(* Formalizing and Proving Theorems in Coq --- Homework 3, part b. curated by Tobias Kappé, May 2022. There are no exercises in this file; it just serves to show that all of the exercises in Lecture 1 can be automated. *) Require Import Coq.Setoids.Setoid. Lemma conj_commutes (P Q: Prop): P /\ Q -> Q /\ P . Proof. intuition. Qed. Lemma conj_commutes_alternative (P Q: Prop): P /\ Q -> Q /\ P . Proof. intuition. Qed. Lemma disj_commutes (P Q: Prop): P \/ Q -> Q \/ P . Proof. intuition. Qed. Lemma conj_commutes_iff (P Q: Prop): P /\ Q <-> Q /\ P . Proof. intuition. Qed. Lemma conj_distributes (P Q R: Prop): (P /\ Q) \/ (P /\ R) -> P /\ (Q \/ R) . Proof. intuition. Qed. Lemma conj_distributes' (P Q R: Prop): (P /\ R) \/ (Q /\ R) -> (P \/ Q) /\ R . Proof. intuition. Qed. Lemma conj_distributes_compl (P Q R: Prop): P /\ (Q \/ R) -> (P /\ Q) \/ (P /\ R) . Proof. intuition. Qed. Lemma conj_distributes_compl' (P Q R: Prop): (Q \/ R) /\ P -> (Q /\ P) \/ (R /\ P) . Proof. intuition. Qed. Lemma conj_distributes_compl'_alternative (P Q R: Prop): (Q \/ R) /\ P -> (Q /\ P) \/ (R /\ P) . Proof. intuition. Qed. Lemma disj_commutes_iff (P Q: Prop): P \/ Q <-> Q \/ P . Proof. intuition. Qed. Lemma disj_distributes (P Q R: Prop): P \/ (Q /\ R) -> (P \/ Q) /\ (P \/ R) . Proof. intuition. Qed. Lemma disj_distributes_compl (P Q R: Prop): (P \/ Q) /\ (P \/ R) -> P \/ (Q /\ R) . Proof. intuition. Qed. Lemma disj_associative (P Q R: Prop): (P \/ Q) \/ R -> P \/ (Q \/ R) . Proof. intuition. Qed. Lemma disj_associative_compl (P Q R: Prop): P \/ (Q \/ R) -> (P \/ Q) \/ R . Proof. intuition. Qed. Lemma conj_associative (P Q R: Prop): (P /\ Q) /\ R -> P /\ (Q /\ R) . Proof. intuition. Qed. Lemma conj_associative_compl (P Q R: Prop): P /\ (Q /\ R) -> (P /\ Q) /\ R . Proof. intuition. Qed. Lemma introduce_double_negation (P: Prop): P -> ~~P . Proof. intuition. Qed. Lemma demorgan_first (P Q: Prop): ~(P \/ Q) -> ~P /\ ~Q . Proof. intuition. Qed. Lemma demorgan_first_compl (P Q: Prop): ~P /\ ~Q -> ~(P \/ Q) . Proof. intuition. Qed. Lemma demorgan_second (P Q: Prop): ~P \/ ~Q -> ~(P /\ Q) . Proof. intuition. Qed. Require Import Coq.Logic.Classical. Lemma demorgan_second_compl (P Q: Prop): ~(P /\ Q) -> ~P \/ ~Q . Proof. (* The intuition tactic does not help here, even with the extra axiom. *) intuition. Abort.