## Boolean Algebra. Computability and Logic

Boolean Algebra Computability and Logic Some Useful Equivalences for Boolean Connectives • Double Negation: – P⇔¬¬P • Commutation: – P∧Q⇔Q∧P – P∨Q⇔Q...
Author: Merryl Taylor
Boolean Algebra Computability and Logic

Some Useful Equivalences for Boolean Connectives • Double Negation: – P⇔¬¬P • Commutation: – P∧Q⇔Q∧P – P∨Q⇔Q∨P • Association: – P ∧ (Q ∧ R) ⇔ (P ∧ Q) ∧ R – P ∨ (Q ∨ R) ⇔ (P ∨ Q) ∨ R • Idempotence: – P∧P⇔P – P∨P⇔P

• DeMorgan: – ¬(P ∧ Q) ⇔ ¬P ∨ ¬Q – ¬(P ∨ Q) ⇔ ¬P ∧ ¬Q • Distribution: – P ∨ (Q ∧ R) ⇔ (P ∨ Q) ∧ (P ∨ R) – P ∧ (Q ∨ R) ⇔ (P ∧ Q) ∨ (P ∧ R) – (Q ∧ R) ∨ P ⇔ (Q ∨ P) ∧ (R ∨ P) – (Q ∨ R) ∧ P ⇔ (Q ∧ P) ∨ (R ∧ P)

Simplifying Statements I • Using the principle of substitution of logical equivalents, and using the logical equivalences that we saw before (Double Negation, Association, Commutation, Idempotence, DeMorgan, Distribution, and Subsumption), we can often simplify statements. • Example: (A ∧ B) ∧ A ⇔ (Commutation) (B ∧ A) ∧ A ⇔ (Association) B ∧ (A ∧ A) ⇔ (Idempotence) B∧A

Generalized Conjunctions and Generalized Disjunctions • Recall the Association equivalences: – P ∧ (Q ∧ R) ⇔ (P ∧ Q) ∧ R – P ∨ (Q ∨ R) ⇔ (P ∨ Q) ∨ R

• Because of this, we’ll allow to drop brackets: – P∧Q∧R – P∨Q∨R

• We can generalize conjunctions and disjunctions – A generalized conjunction (disjunction) can have any number of conjuncts (disjuncts)

Simplifying Statements II • Many of the equivalence rules can be generalized in a completely intuitive and straightforward manner to generalized conjunctions and disjunctions. Example (4.41 from book): C ∧ (A ∨ B) ∧ (A ∨ C) ⇔ (Gen’d Commutation) C ∧ (A ∨ C) ∧ (A ∨ B) ⇔ (Gen’d Subsumption) C ∧ (A ∨ B) Note 1: we could have done this in 1 step by gen’d subsumption Note 2: from now on you can just drop the ‘generalized’ part

‘⊤’ and ‘⊥’ • A generalized conjunction is false if it has at least one false conjunct, otherwise it is true. – So, a generalized conjunction with 0 conjuncts cannot have a false conjunct, and hence cannot be false. Therefore, it is a tautology! We will write this as ‘⊤’.

• A generalized disjunction is true if it has at least one true disjunct, otherwise it is false. – Hence, a generalized disjunction with 0 disjuncts can never be true, and is therefore a contradiction! We will write this as ‘⊥’.

Some equivalences involving ‘⊤’ and ‘⊥’ • Complement – P ∧ ¬P ⇔ ⊥ – P ∨ ¬P ⇔ ⊤

• Inverse – ¬⊥ ⇔ ⊤ – ¬⊤ ⇔ ⊥

• Identity –P∧⊤⇔P –P∨⊥⇔P

• Annihilation –⊥∧P⇔⊥ –⊤∨P⇔⊤

Simplifying Statements III • Using ‘⊤’ and ‘⊥’, we can simplify statements even more. Example (based on 6.42):

¬(¬A ∨ ¬(¬B ∧ (¬A ∨ B))) ⇔ (DeMorgan) ¬¬A ∧ ¬¬(¬B ∧ (¬A ∨ B)) ⇔ (Double Neg.) A ∧ ¬B ∧ (¬A ∨ B) ⇔ (Distribution) (A ∧ ¬B ∧ ¬A) ∨ (A ∧ ¬B ∧ B) ⇔ (Contradiction) ⊥ ∨ ⊥ ⇔ (Idempotence (or Identity)) ⊥

Further Simplification Rules • A few other useful simplification priciples: – Absorption:

• P ∧ (P ∨ Q) ⇔ P • P ∨ (P ∧ Q) ⇔ P

– Reduction: • P ∧ (¬P ∨ Q) ⇔ P ∧ Q • P ∨ (¬P ∧ Q) ⇔ P ∨ Q

– Adjacency: • (P ∨ Q) ∧ (P ∨ ¬Q) ⇔ P • (P ∨ Q) ∧ (P ∨ ¬Q) ⇔ P

Deriving Rules from Other Rules • Note that the last three simplification rules can be derived from earlier principles, e.g: P ∧ (¬P ∨ Q) ⇔ (Distribution) (P ∧ ¬P) ∨ (P ∧ Q) ⇔ (Contradiction) ⊥ ∨ (P ∧ Q) ⇔ (Identity) P∧Q Question (possible research project): which rules can be derived from which? And which cannot? How to prove the latter?

Simplifying Statements IV • Let’s redo the earlier example (based on 6.42), but now using the reduction principles: ¬(¬A ∨ ¬(¬B ∧ (¬A ∨ B))) ⇔ (Reduction) ¬(¬A ∨ ¬(¬B ∧ ¬A)) ⇔ (DeMorgan) ¬(¬A ∨ ¬¬B ∨ ¬¬A)) ⇔ (Tautology) ¬(⊤ ∨ ¬¬B) ⇔ (Annihilation) ¬⊤ ⇔ (Inverse) ⊥

Exercise • Simplify the following statement: (¬A ∨ B) ∧ (A ∨ B ∨ D) ∧ ¬D

Substituting Arbitrary Sentences for ‘P’ and ‘Q’ • When doing algebra, we assume that P ⇔ ¬ ¬ P is a general principle, i.e. that the ‘P’ could be any other sentence. • This is why we may want to write ϕ ⇔ ¬ ¬ ϕ • However, why is this more general principle the case? And how would we prove it? • In particular, while a truth-table can easily be used to show P ⇔ ¬ ¬ P, what if P is a complex sentence? Shouldn’t we be worried that possibly the interplay of the atomic variables can change the outcome? – E.g. the truth-table for ‘P’ shows that ‘P’ is a contingency. But it is false to infer that therefore any ϕ is a contingency!

The Substitution Theorem • What we have assumed all along is the Substitution Theorem: – Where P is an atomic sentence, where S1(P) is a sentence containing P, where S2(P) another sentence containing P, and where ϕ is an arbitrary sentence: • If S1(P) ⇔ S2(P), then S1(ϕ) ⇔ S2(ϕ)

• It turns out that the Substitution Theorem can be proven, but proving it is far from trivial! (see handout)

Formal Semantics to the Rescue • Fortunately, formal semantics makes proving the general equivalences a lot easier, e.g.: – For any sentence ϕ and any truth-assignment h: • h(ϕ) = True iff (formal semantics ¬) • h(¬ϕ) = False iff (formal semantics ¬) • h(¬¬ϕ) = True

– Hence, ϕ ⇔ ¬ ¬ ϕ

• This method can be used to prove all general equivalences quite easily.

The Principle of Substitution of Logical Equivalents • Another principle we have implicitly assumed is the principle of substitution of logical equivalents: – if ϕ ⇔ ψ, then S(ϕ) ⇔ S(ψ)

• And again, while intuitively true, we never really proved this principle to be true!

Proof of Substitution of Equivalents Principle • Use mathematical induction over the recursive syntactical formation of S(ϕ), starting with ϕ. That is, show: • Base: if S(ϕ) = ϕ, then the principle holds • Step: Assuming the principle holds for S1(ϕ) and S2(ϕ), then the principle holds for: – – – –

¬S1(ϕ) S1(ϕ) ∧ S2(ϕ) S1(ϕ) ∨ S2(ϕ) Etc.

Duality Theorem • Many of the boolean equivalences come in pairs: – Whenever something holds for the conjunction, something ‘similar’ holds for the disjunction

• As you might expect, this is not a coincidence: – We can make hard exactly what we mean by ‘similar’ – And we can prove that in general, if something holds for one connective, then its counterpart has to hold true as well

• This is the Duality Theorem