Skip to content

Instantly share code, notes, and snippets.

@qnighy
Created April 13, 2014 13:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qnighy/10583491 to your computer and use it in GitHub Desktop.
Save qnighy/10583491 to your computer and use it in GitHub Desktop.
Theorem Modus_ponens : forall P Q : Prop, P -> (P -> Q) -> Q.
Proof.
intros P Q HP HPQ; apply HPQ, HP.
Qed.
Theorem Modus_tollens : forall P Q : Prop, ~Q /\ (P -> Q) -> ~P.
Proof.
intros P Q [HnQ HPQ] HP; apply HnQ, HPQ, HP.
Qed.
Theorem Disjunctive_syllogism : forall P Q : Prop, (P \/ Q) -> ~P -> Q.
Proof.
intros P Q H HnP.
destruct H as [HP | HQ].
- destruct HnP.
exact HP.
- exact HQ.
Qed.
Goal forall P Q : Prop, (P \/ Q) -> ~P -> Q.
Proof.
intros P Q [HP|HQ] HnP; [contradict HnP|]; assumption.
Qed.
Theorem DeMorgan1 : forall P Q : Prop, ~P \/ ~Q -> ~(P /\ Q).
Proof.
intros P Q [HnP|HnQ] [HP HQ]; contradiction.
Qed.
Theorem DeMorgan2 : forall P Q : Prop, ~P /\ ~Q -> ~(P \/ Q).
Proof.
intros P Q [HnP HnQ] [HP|HQ]; contradiction.
Qed.
Theorem DeMorgan3 : forall P Q : Prop, ~(P \/ Q) -> ~P /\ ~Q.
Proof.
intros P Q H; split; contradict H; [left|right]; assumption.
Qed.
Theorem NotNot_LEM : forall P : Prop, ~ ~(P \/ ~P).
Proof.
intros P H; apply H; right; contradict H; left; assumption.
Qed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment