+ | apply rule (⊥_e (⊥));
+ apply rule (¬_e (¬¬A) (¬A));
+ [ apply rule (¬_i [K] (⊥)).
+ apply rule (¬_e (¬(A ∨ ¬A)) (A ∨ ¬A));
+ [ (*BEGIN*)apply rule (discharge [H]).(*END*)
+ | (*BEGIN*)apply rule (∨_i_r (¬A)).
+ apply rule (discharge [K]).(*END*)
+ ]
+ | (*BEGIN*)apply rule (¬_i [K] (⊥)).
+ apply rule (¬_e (¬(A ∨ ¬A)) (A ∨ ¬A));
+ [ apply rule (discharge [H]).
+ | apply rule (∨_i_l (A)).
+ apply rule (discharge [K]).
+ ](*END*)
+ ]
+ ]
+qed.
+
+theorem ex1 : (C∧G ⇒ E) ⇒ (¬L ⇒ E∨C) ⇒ G ∨ L ⇒ ¬L ⇒ E.
+apply rule (prove ((C∧G ⇒ E) ⇒ (¬L ⇒ E∨C) ⇒ G ∨ L ⇒ ¬L ⇒ E));
+(*BEGIN*)
+apply rule (⇒_i [h1] ((¬L ⇒ E∨C) ⇒ G ∨ L ⇒ ¬L ⇒ E));
+apply rule (⇒_i [h2] (G ∨ L ⇒ ¬L ⇒ E));
+apply rule (⇒_i [h3] (¬L ⇒ E));
+apply rule (⇒_i [h4] (E));
+apply rule (∨_e (G∨L) [h5] (E) [h6] (E));
+ [ apply rule (discharge [h3]);
+ | apply rule (∨_e (E∨C) [h6] (E) [h7] (E));
+ [ apply rule (⇒_e (¬L ⇒ E∨C) (¬L));
+ [ apply rule (discharge [h2]);
+ | apply rule (discharge [h4]);
+ ]
+ | apply rule (discharge [h6]);
+ | apply rule (⇒_e (C∧G ⇒ E) (C∧G));
+ [ apply rule (discharge [h1]);
+ | apply rule (∧_i (C) (G));
+ [ apply rule (discharge [h7]);
+ | apply rule (discharge [h5]);
+ ]
+ ]
+ ]
+ | apply rule (⊥_e (⊥));
+ apply rule (¬_e (¬L) (L));
+ [ apply rule (discharge [h4]);
+ | apply rule (discharge [h6]);
+ ]
+ ]
+(*END*)
+qed.
+
+theorem ex2 : (A∧¬B ⇒ C) ⇒ (B∧D ⇒ C) ⇒ (D ⇒ A) ⇒ D ⇒ C.
+apply rule (prove ((A∧¬B ⇒ C) ⇒ (B∧D ⇒ C) ⇒ (D ⇒ A) ⇒ D ⇒ C));
+(*BEGIN*)
+apply rule (⇒_i [h1] ((B∧D ⇒ C) ⇒ (D ⇒ A) ⇒ D ⇒ C));
+apply rule (⇒_i [h2] ((D ⇒ A) ⇒ D ⇒ C));
+apply rule (⇒_i [h3] (D ⇒ C));
+apply rule (⇒_i [h4] (C));
+apply rule (∨_e (B∨¬B) [h5] (C) [h6] (C));
+ [ apply rule (lem 0 EM);
+ | apply rule (⇒_e (B∧D⇒C) (B∧D));
+ [ apply rule (discharge [h2]);
+ | apply rule (∧_i (B) (D));
+ [ apply rule (discharge [h5]);
+ | apply rule (discharge [h4]);
+ ]
+ ]
+ | apply rule (⇒_e (A∧¬B⇒C) (A∧¬B));
+ [ apply rule (discharge [h1]);
+ | apply rule (∧_i (A) (¬B));
+ [ apply rule (⇒_e (D⇒A) (D));
+ [ apply rule (discharge [h3]);
+ | apply rule (discharge [h4]);
+ ]
+ | apply rule (discharge [h6]);
+ ]
+ ]
+ ]
+(*END*)
+qed.
+
+(* Per dimostrare questo teorema torna comodo il lemma EM
+ dimostrato in precedenza. *)
+theorem ex3: (F ⇒ G∨E) ⇒ (G ⇒ ¬L∨E) ⇒ (L⇒F) ⇒ L ⇒ E.
+apply rule (prove ((F ⇒ G∨E) ⇒ (G ⇒ ¬L∨E) ⇒ (L⇒F) ⇒ L ⇒ E));
+(*BEGIN*)
+apply rule (⇒_i [h1] ((G ⇒ ¬L∨E) ⇒ (L⇒F) ⇒ L ⇒ E));
+apply rule (⇒_i [h2] ((L⇒F) ⇒ L ⇒ E));
+apply rule (⇒_i [h3] (L ⇒ E));
+apply rule (⇒_i [h4] (E));
+apply rule (∨_e (G∨E) [h5] (E) [h6] (E));
+ [ apply rule (⇒_e (F ⇒ G∨E) (F));
+ [ apply rule (discharge [h1]);
+ | apply rule (⇒_e (L⇒F) (L));
+ [ apply rule (discharge [h3]);
+ | apply rule (discharge [h4]);
+ ]
+ ]
+ |apply rule (∨_e (¬L∨E) [h7] (E) [h8] (E));
+ [ apply rule (⇒_e (G⇒¬L∨E) (G));
+ [ apply rule (discharge [h2]);
+ | apply rule (discharge [h5]);
+ ]
+ | apply rule (⊥_e (⊥));
+ apply rule (¬_e (¬L) (L));
+ [ apply rule (discharge [h7]);
+ | apply rule (discharge [h4]);
+ ]
+ | apply rule (discharge [h8]);
+ ]
+ | apply rule (discharge [h6]);
+ ]
+(*END*)
+qed.
+
+theorem ex4: ¬(A∧B) ⇒ ¬A∨¬B.
+apply rule (prove (¬(A∧B) ⇒ ¬A∨¬B));
+(*BEGIN*)
+apply rule (⇒_i [h1] (¬A∨¬B));
+apply rule (∨_e (A ∨ ¬A) [h2] ((¬A∨¬B)) [h3] ((¬A∨¬B)));
+ [ apply rule (lem 0 EM);
+ | apply rule (∨_e (B ∨ ¬B) [h4] ((¬A∨¬B)) [h5] ((¬A∨¬B)));
+ [ apply rule (lem 0 EM);
+ | apply rule (⊥_e (⊥));
+ apply rule (¬_e (¬(A∧B)) (A∧B));
+ [ apply rule (discharge [h1]);
+ | apply rule (∧_i (A) (B));
+ [ apply rule (discharge [h2]);
+ | apply rule (discharge [h4]);
+ ]
+ ]
+ | apply rule (∨_i_r (¬B));
+ apply rule (discharge [h5]);
+ ]
+ | apply rule (∨_i_l (¬A));
+ apply rule (discharge [h3]);
+ ]
+(*END*)
+qed.
+
+theorem ex5: ¬(A∨B) ⇒ (¬A ∧ ¬B).
+apply rule (prove (¬(A∨B) ⇒ (¬A ∧ ¬B)));
+(*BEGIN*)
+apply rule (⇒_i [h1] (¬A ∧ ¬B));
+apply rule (∨_e (A∨¬A) [h2] (¬A ∧ ¬B) [h3] (¬A ∧ ¬B));
+ [ apply rule (lem 0 EM);
+ | apply rule (⊥_e (⊥));
+ apply rule (¬_e (¬(A∨B)) (A∨B));
+ [ apply rule (discharge [h1]);
+ | apply rule (∨_i_l (A));
+ apply rule (discharge [h2]);
+ ]
+ | apply rule (∨_e (B∨¬B) [h10] (¬A ∧ ¬B) [h11] (¬A ∧ ¬B));
+ [ apply rule (lem 0 EM);
+ | apply rule (⊥_e (⊥));
+ apply rule (¬_e (¬(A∨B)) (A∨B));
+ [ apply rule (discharge [h1]);
+ | apply rule (∨_i_r (B));
+ apply rule (discharge [h10]);
+ ]
+ | apply rule (∧_i (¬A) (¬B));
+ [ apply rule (discharge [h3]);
+ |apply rule (discharge [h11]);
+ ]
+ ]
+ ]
+(*END*)
+qed.
+
+theorem ex6: ¬A ∧ ¬B ⇒ ¬(A∨B).
+apply rule (prove (¬A ∧ ¬B ⇒ ¬(A∨B)));
+(*BEGIN*)
+apply rule (⇒_i [h1] (¬(A∨B)));
+apply rule (¬_i [h2] (⊥));
+apply rule (∨_e (A∨B) [h3] (⊥) [h3] (⊥));
+ [ apply rule (discharge [h2]);
+ | apply rule (¬_e (¬A) (A));
+ [ apply rule (∧_e_l (¬A∧¬B));
+ apply rule (discharge [h1]);
+ | apply rule (discharge [h3]);
+ ]
+ | apply rule (¬_e (¬B) (B));
+ [ apply rule (∧_e_r (¬A∧¬B));
+ apply rule (discharge [h1]);
+ | apply rule (discharge [h3]);
+ ]