Created
April 18, 2017 11:32
-
-
Save MikeMKH/50cf71c91b7843071d1949a56876ff8c to your computer and use it in GitHub Desktop.
Simple proofs in Coq taken from More Exercises section of https://www.seas.upenn.edu/~cis500/current/sf/Basics.html
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
| (* taken from More Exercises sections in https://www.seas.upenn.edu/~cis500/current/sf/Basics.html *) | |
| Theorem identity_fn_applied_twice : | |
| forall (f : bool -> bool), | |
| (forall (x : bool), f x = x) | |
| -> forall (b : bool), f (f b) = b. | |
| Proof. | |
| intros f H b. | |
| rewrite -> H. | |
| rewrite -> H. | |
| reflexivity. | |
| Qed. | |
| Theorem andb_eq_orb : forall (a b : bool), | |
| (andb a b = orb a b) -> a = b. | |
| Proof. | |
| intros a b H. | |
| destruct a, b. | |
| - (* case true = true *) | |
| reflexivity. | |
| - (* case true = false *) | |
| inversion H. | |
| - (* case false = true *) | |
| inversion H. | |
| - (* case false = false *) | |
| reflexivity. | |
| Qed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment