Skip to content

Instantly share code, notes, and snippets.

@joshcough
Created October 18, 2011 17:25
Show Gist options
  • Save joshcough/1296038 to your computer and use it in GitHub Desktop.
Save joshcough/1296038 to your computer and use it in GitHub Desktop.
Josh Cough is Awesome
Require Import Coq.Strings.String.
Require Export "Prop".
Require Export "Logic".
Inductive person: Type := personc : string -> string -> person.
Definition jc: person := personc "Josh" "Cough".
Inductive awesome : person -> Prop := | ajc : awesome jc.
Theorem josh_cough_is_awesome : awesome jc. Proof. apply ajc. Qed.
Definition is_josh_cough (p:person) : Prop := p = jc.
Theorem only_josh_cough_is_awesome : forall p : person,
(is_josh_cough p -> awesome p) /\ (~ is_josh_cough p -> ~ awesome p).
Proof.
intros.
split.
Case "Josh Cough".
intros.
inversion H.
apply josh_cough_is_awesome.
Case "Any other human ever.".
unfold not.
intros.
unfold is_josh_cough in H.
inversion H0.
unfold jc in H.
rewrite H1 in H.
apply H.
reflexivity.
Qed.
@clklein
Copy link

clklein commented Oct 18, 2011

This is a good example of how hard it is to get definitions right :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment