include "didactic/support/natural_deduction.ma".
-
+theorem EM: ∀A. A ∨ ¬ A.
+assume A: CProp.
+apply rule (prove (A ∨ ¬A));
+apply rule (RAA [H] (⊥)).
+apply rule (¬_e (¬(A ∨ ¬A)) (A ∨ ¬A));
+ [ apply rule (discharge [H]).
+ | apply rule (¬_e (¬¬A) (¬A));
+ [ apply rule (¬_i [K] (⊥)).
+ apply rule (¬_e (¬(A ∨ ¬A)) (A ∨ ¬A));
+ [ apply rule (discharge [H]).
+ | apply rule (∨_i_r (¬A)).
+ apply rule (discharge [K]).
+ ]
+ | apply rule (¬_i [K] (⊥)).
+ apply rule (¬_e (¬(A ∨ ¬A)) (A ∨ ¬A));
+ [ apply rule (discharge [H]).
+ | apply rule (∨_i_l (A)).
+ apply rule (discharge [K]).
+ ]
+ ]
+ ]
+qed.
theorem demorgan : ¬(A ∧ B) ⇒ ¬A ∨ ¬B.
apply rule (prove (¬(A ∧ B) ⇒ ¬A ∨ ¬B));
apply rule (¬_e (¬(¬A ∨ ¬B)) (¬A ∨ ¬B));
[ apply rule (discharge [K]).
| apply rule (∨_i_l (¬A));
+ apply rule (¬_i [L] (⊥)).
+ apply rule (¬_e (¬B) (B));
+ [ apply rule (¬_i [M] (⊥)).
+ apply rule (¬_e (¬(A ∧ B)) (A ∧ B));
+ [ apply rule (discharge [H]).
+ | apply rule (∧_i (A) (B));
+ [ apply rule (discharge [L]).
+ | apply rule (discharge [M]).
+ ]
+ ]
+ | apply rule EM;
+ ]
]