Formal Software Verification

1.4. Logical Equivalence🔗

A valuation assigns a truth value to each propositional variable. A proposition is a tautology when it is true under every valuation. Two propositions A and B are logically equivalent, written A ≡ B, when they have the same truth value under every valuation, that is, when A ↔ B is a tautology.

The classical equivalences below appear constantly in proofs.

Name

Equivalence

De Morgan

¬(P ∧ Q) ≡ ¬P ∨ ¬Q

De Morgan

¬(P ∨ Q) ≡ ¬P ∧ ¬Q

Double negation

¬¬P ≡ P

Contrapositive

P → Q ≡ ¬Q → ¬P

Material implication

P → Q ≡ ¬P ∨ Q

A truth table verifies each equivalence. For the second De Morgan law, the columns for ¬(P ∨ Q) and ¬P ∧ ¬Q agree on all four valuations.

P

Q

P ∨ Q

¬(P ∨ Q)

¬P

¬Q

¬P ∧ ¬Q

T

T

T

F

F

F

F

T

F

T

F

F

T

F

F

T

T

F

T

F

F

F

F

F

T

T

T

T

Truth tables decide any propositional question, but their size grows exponentially in the number of variables, and they do not extend to the quantifiers of Lecture 2. Deduction rules, applied one step at a time, scale and generalize. The rest of this lecture develops such proofs in Lean.