Skip to content

Instantly share code, notes, and snippets.

@methylene
Last active December 11, 2015 05:28
Show Gist options
  • Save methylene/4552124 to your computer and use it in GitHub Desktop.
Save methylene/4552124 to your computer and use it in GitHub Desktop.
coq problems
(*
https://www.youtube.com/watch?v=7sk8hPWAMSw
http://en.wikipedia.org/wiki/Law_of_excluded_middle
http://en.wikipedia.org/wiki/Peirce_law
*)
Definition peirce := forall (p q : Prop),
((p -> q) -> p) -> p.
Definition lem := forall p : Prop,
p\/ ~ p.
Theorem peirce_implies_lem: peirce -> lem.
Proof.
unfold peirce, lem.
intros.
apply H with (q := ~ (p \/ ~ p)).
firstorder.
Qed.
(* Not so fast please.
Can we break the last two steps down a bit? *)
Definition w0 := forall (p : Prop),
((p -> ~ (p \/ ~ p) ) -> p) -> p.
Definition w1 := forall (p : Prop),
(p \/ ~ p -> ~ (p \/ ~ p)) -> p \/ ~ p.
Lemma w0_implies_w1: w0 -> w1.
Proof.
unfold w0, w1.
firstorder.
Qed.
(* How to prove w0_implies_w1 without 'firstorder magic'? *)
Lemma w1_implies_lem: w1 -> lem.
Proof.
unfold w1, lem.
intro.
intro.
(* How to finish proof of w1_implies_lem? *)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment