As with arithmetic expressions, there are algebraic laws for logical expressions that establish the equivalence of two expressions. Each of these laws can be proven by showing the equivalence is a tautology.
p AND q == q AND p p OR q == q OR p
p AND (q AND r) == (p AND q) AND r p OR (q OR r) == (p OR q) OR r
p AND (q OR r) == (p AND q) OR (p AND r) p OR (q AND r) == (p OR q) AND (p OR r)
p AND TRUE == p p OR FALSE == p
p AND FALSE == FALSE p OR TRUE == TRUE
p AND p == p p OR p == p
DeMorgan's Laws are algebraic laws (or equivalences) that allow us to rewrite any logical expression so that NOT is only applied to propositional variables (and not to other logical expressions).
These laws state that the negation of the conjunction (or disjunction) of two propositions is logically equivalent to the disjunction (or conjunction) of their negations.
By repeated application of DeMorgan's laws, we can push the NOT operators inward in an expression until they apply to variables only.
NOT ((p AND q) OR (NOT p AND r)) == NOT (p AND q) AND NOT (NOT p AND r) == (NOT p OR NOT q) AND (p OR NOT r)
NOT (NOT p OR (q AND ( NOT(r OR NOT s) ) ) == NOT NOT p AND NOT (q AND (NOT(r OR NOT s)) == p AND (NOT q OR NOT (NOT(r OR NOT s)) == p AND (NOT q OR NOT (NOT r AND NOT NOT s) == p AND (NOT q OR (r OR NOT s) )
Two expressions are equivalent if they imply each other.
If two expressions are equivalent, they imply each other.
Implies is transitive.
We can express "implies" in terms of NOT and OR.
We can express a series of implicants using NOT and OR.
This equivalence is known as the contrapositive law.
This equivalence follows from expressing implies in terms of NOT and OR: (Not p OR q) AND (p OR q) == q.