Created
May 10, 2017 11:44
-
-
Save MikeMKH/a6cad9f9a2aa84d15d02fa7f36e3780b to your computer and use it in GitHub Desktop.
Example of proof by elimination with Coq from Coq Art
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* 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. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.