Skip to content

Instantly share code, notes, and snippets.

@MikeMKH
Created May 10, 2017 11:44
Show Gist options
  • Save MikeMKH/a6cad9f9a2aa84d15d02fa7f36e3780b to your computer and use it in GitHub Desktop.
Save MikeMKH/a6cad9f9a2aa84d15d02fa7f36e3780b to your computer and use it in GitHub Desktop.
Example of proof by elimination with Coq from Coq Art
(* exercise 6.29 from Coq Art *)
Check eq_ind.
(*
eq_ind
     : forall (A : Type) (x : A) (P : A -> Prop),
       P x -> forall y : A, x = y -> P y
*)
Theorem plus_n_O : forall n, n + 0 = n.
Proof.
intro n; elim n.
reflexivity.
simpl; intros n0 H.
apply eq_ind
with (x := n0 + 0) (P := fun y => S(n0 + 0) = S y).
reflexivity.
assumption.
Qed.
@MikeMKH
Copy link
Author

MikeMKH commented May 10, 2017

Problem:

Prove the following theorem, using only the following tactics : intros, assumption, elim, simpl, and reflexivity.
Theorem plus_n_O : forall n, n+0 =n.

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