theory Nddemo
imports Main
begin
theorem AndCommutes: "A ∧ B ⟹ B ∧ A"
apply (erule conjE) (* Diff from Monday: gives BOTH *)
apply (rule conjI) (* Prove both A and B*)
apply assumption (* But we have that already *)
apply assumption (* Ditto *)
done
(* Note tilde for not *)
theorem modusTollens: "(A ⟶ B) ∧ ~B ⟹ ~A"
apply (erule conjE)
apply (rule notI) (* gotta get that ~ in front of A somehow*)
apply (erule notE)
apply (erule impE)
apply assumption
apply assumption
done
(* Note: ⟹ syntax here. Note parens ARE IMPORTANT *)
theorem impliesTr: "(A ⟶ B) ∧ (B ⟶ C) ⟹ A ⟶ C"
apply (erule conjE)
(* Not productive direction... try backwards instead.
This will break up the first implication in premise *)
(*apply (erule impE)*)
apply (rule impI) (* Now we have A ⟹ C as conclusion*)
apply (erule impE) (* And applying the elimination rule will *)
apply assumption
apply (erule impE)
apply assumption
apply assumption
done
theorem DeMorganOrIn: "~(A ∨ B) ⟹ ~A ∧ ~B"
apply (rule conjI)
apply (rule notI)
apply (erule notE)
apply (erule disjI1)
apply (rule notI)
apply (erule notE)
apply (erule disjI2)
done
end