Formal Software Verification

2.4. Quantifier Negation Laws🔗

The De Morgan laws of Lecture 1 exchange negation with conjunction and disjunction. The laws below exchange negation with the quantifiers.

Name

Equivalence

Negation of ∃

¬(∃ x, P x) ≡ ∀ x, ¬P x

Negation of ∀

¬(∀ x, P x) ≡ ∃ x, ¬P x

The first law is constructive in both directions.

theorem not_exists_iff (α : Type) (P : α Prop) : ¬( x, P x) x, ¬P x := α:TypeP:α Prop(¬ x, P x) (x : α), ¬P x α:TypeP:α Prop(¬ x, P x) (x : α), ¬P xα:TypeP:α Prop(∀ (x : α), ¬P x) ¬ x, P x α:TypeP:α Prop(¬ x, P x) (x : α), ¬P x α:TypeP:α Proph:¬ x, P xa:αhPa:P aFalse All goals completed! 🐙 α:TypeP:α Prop(∀ (x : α), ¬P x) ¬ x, P x α:TypeP:α Proph: (x : α), ¬P xhex: x, P xFalse α:TypeP:α Proph: (x : α), ¬P xa:αhPa:P aFalse All goals completed! 🐙

In the second law, the direction from ∃ x, ¬P x to ¬(∀ x, P x) is constructive, and the converse direction requires classical reasoning, as the first De Morgan law did in Lecture 1. Two applications of Classical.byContradiction produce the witness.

theorem not_forall_exists (α : Type) (P : α Prop) (h : ¬ x, P x) : x, ¬P x := α:TypeP:α Proph:¬ (x : α), P x x, ¬P x α:TypeP:α Proph:¬ (x : α), P x(¬ x, ¬P x) False α:TypeP:α Proph:¬ (x : α), P xhne:¬ x, ¬P xFalse α:TypeP:α Proph:¬ (x : α), P xhne:¬ x, ¬P x (x : α), P x α:TypeP:α Proph:¬ (x : α), P xhne:¬ x, ¬P xa:αP a α:TypeP:α Proph:¬ (x : α), P xhne:¬ x, ¬P xa:α¬P a False α:TypeP:α Proph:¬ (x : α), P xhne:¬ x, ¬P xa:αhnPa:¬P aFalse All goals completed! 🐙