Skip to content

Instantly share code, notes, and snippets.

@keizo042
Created December 28, 2016 13:42
Show Gist options
  • Save keizo042/74d022f7ab3f5be8b1aeb181cb974d7a to your computer and use it in GitHub Desktop.
Save keizo042/74d022f7ab3f5be8b1aeb181cb974d7a to your computer and use it in GitHub Desktop.
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