Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
CM10196 Lecture Notes 2 Issued 12 October 2016 1. Commutative laws Let x, y be propositions. Then x ∧ y is true if Commutative law for conjunction. and only if y ∧ x. Equivalent formulation. For variables X, Y the Boolean formula (X ∧ Y ) ≡ (Y ∧ X) is identically true. Proof. Straightforward check of tables defining ∧ and ≡. Commutative law for disjunction. only if y ∨ x. Let x, y be propositions. Then x ∨ y is true if and Equivalent formulation. For variables X, Y the Boolean formula (X ∨ Y ) ≡ (Y ∨ X) is identically true. Proof. 2. Straightforward check of tables defining ∨ and ≡. Associative laws In what follows we will formulate each law only in a form of identically true Boolean formula. Associative law for conjunction. For variables X, Y , Z the Boolean formula ((X ∧ Y ) ∧ Z) ≡ (X ∧ (Y ∧ Z)) is identically true. Associative law for disjunction. For variables X, Y , Z the Boolean formula ((X ∨ Y ) ∨ Z) ≡ (X ∨ (Y ∨ Z)) is identically true. Proof. 3. Straightforward check of tables. Distributive laws 1 Conjunction over disjunction. For variables X, Y , Z the Boolean formula (X ∧ (Y ∨ Z)) ≡ ((X ∧ Y ) ∨ (X ∧ Z)) is identically true. Disjunction over conjunction. For variables X, Y , Z the Boolean formula (X ∨ (Y ∧ Z)) ≡ ((X ∨ Y ) ∧ (X ∨ Z)) is identically true. Proof. 4. Straightforward check of tables. De Morgan’s laws For variables X, Y , Z the Boolean formulae ¬(X ∧ Y ) ≡ (¬X ∨ ¬Y ), ¬(X ∨ Y ) ≡ (¬X ∧ ¬Y ). are identically true. Proof. Straightforward check of tables. 5. Some other laws of logic (i) (ii) (iii) (iv) (v) X ∨ ¬X; ¬¬X ≡ X; ¬(X ∧ ¬X); ((¬X → Y ) ∧ (¬X → ¬Y )) → X; (X → Y ) ≡ (¬X ∨ Y ). Observe that De Morgan’s laws combined with (ii) allow to express ∧ via ∨ and vice versa. For example, (ii) implies that a disjunction U ∨ V , where U , V are variables, can be replaced by an equivalent formula ¬¬U ∨ ¬¬V , which in turn, by the first of De Morgan’s laws is equivalent to ¬(¬U ∧ ¬V ). Also, (v) provides a way of replacing → by ∨. It follows that every Boolean formula is equivalent to a formula having only one of the following pairs of connectives: (a) ¬, ∧ or (b) ¬, ∨ or (c) ¬, →. 6. Reductio ad absurdum. Direct and inverse theorems The tautology ((¬X → Y ) ∧ (¬X → ¬Y )) → X 2 (formula (iv) from Section 5) is often used for proving mathematical statements by “leading to contradiction”. To prove a proposition x it’s sufficient to assume the negation ¬x of x and deduce from ¬x two contradictory statements, say, y and ¬y. The the above tautology implies that x is true. Many mathematical theorems can be formally described by an implication x → y. Call this implication direct theorem. Then the proposition y → x is known as inverse theorem. Even if the direct theorem is true, the inverse may or may not be true. The proposition ¬x → ¬y is called opposite theorem. The proposition ¬y → ¬x is, therefore, opposite to inverse theorem. Observe, that an opposite to inverse theorem is true if and only if the direct theorem is true, because of the tautology (X → Y ) ≡ (¬Y → ¬X). In some cases it’s easier to prove opposite to inverse theorem than the direct theorem. If a theorem has a structure of an implication x → y, then x is called the sufficient condition of the theorem, while y is its necessary condition. If a theorem has a form “x is necessary and sufficient for y” it means that two statements are true at the same time: x → y and y → x. 7. Disjunctive normal form of a Boolean formula Let X1 , X2 , . . . , Xn be variables. Yi is called a literal if Yi is either Xi or ¬Xi for any i. A conjunctive term is a conjunction of the kind Yi1 ∧ Yi2 ∧ · · · ∧ Yim , where ij is one of the numbers 1, 2, . . . , n for 1 ≤ j ≤ m, and each Yij is a literal. Definition A Boolean formula F is in disjunctive normal form (DNF) if F is of the form F1 ∨ F2 ∨ · · · ∨ Fk , where Fi is a conjunctive term for any i. Theorem For each Boolean formula G with variables X1 , X2 , . . . , Xn there exists a Boolean formula F in DNF, with variables from {X1 , X2 , . . . , Xn }, such that G ≡ F . We don’t prove this theorem in this course. Examples (1) Let G be the formula X → Y . From (v), Section 4 it follows that G ≡ ¬X ∨ Y . The righthand side of the latter equivalence is a formula in disjunctive normal form with conjunctive terms ¬X and Y . (2) Let G be the formula ((¬X → Y ) ∧ (¬X → ¬Y )) → X. Using again (v), Section 4 and De Morgan’s laws we can write a following string of equivalent formulae: 3 ((¬X → Y ) ∧ (¬X → ¬Y )) → X ¬((X ∨ Y ) ∧ (X ∨ ¬Y )) ∨ X ¬(X ∨ Y ) ∨ ¬(X ∨ ¬Y ) ∨ X (¬X ∧ ¬Y ) ∨ (¬X ∧ Y ) ∨ X. The last formula in this list is equivalent to G and is in DNF. 8. Conjunctive normal form of a Boolean formula Conjunctive normal form (CNF) of a Boolean formula is a representation dual to its representation in DNF. A disjunctive term is a disjunction of the kind Yi1 ∨ Yi2 ∨ · · · ∨ Yim where ij is one of the numbers 1, 2, . . . , n for 1 ≤ j ≤ m. Definition A Boolean formula F is in conjunctive normal form (CNF) if F is of the form F1 ∧ F2 ∧ · · · ∧ Fk , where Fi is a disjunctive term for any i. Theorem For each Boolean formula G with variables X1 , X2 , . . . , Xn there exists a Boolean formula F in CNF, with variables from {X1 , X2 , . . . , Xn }, such that G ≡ F . We don’t prove this theorem. 4