Created
December 28, 2016 13:42
-
-
Save keizo042/74d022f7ab3f5be8b1aeb181cb974d7a to your computer and use it in GitHub Desktop.
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
Theorem plus_comm : forall n m : nat, | |
n + m = m + n. | |
Proof. | |
intros. | |
induction n. | |
induction m. | |
reflexivity. | |
simpl. rewrite <- IHm. simpl. reflexivity. | |
induction m. | |
simpl. rewrite -> IHn. simpl. reflexivity. | |
simpl. rewrite <- IHm. | |
simpl. rewrite -> IHn. simpl. | |
induction n. | |
simpl. | |
assert (plus_0_nat :forall l : nat, l + 0 = l). | |
induction l. reflexivity. simpl. rewrite -> IHl. reflexivity. | |
rewrite -> plus_0_nat. reflexivity. | |
simpl. | |
assert (plus_Sm_n : forall n' m' : nat, m' + S n' = S n' + m'). | |
induction n'. | |
induction m'. | |
simpl. reflexivity. | |
simpl. rewrite -> IHm'. simpl. reflexivity. | |
induction m'. | |
simpl. assert (plus_0_nat :forall l : nat, l + 0 = l). | |
induction l. reflexivity. simpl. rewrite -> IHl. reflexivity. | |
rewrite -> plus_0_nat. reflexivity. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment