Skip to content

Instantly share code, notes, and snippets.

@totem3
Created November 17, 2014 11:17
Show Gist options
  • Save totem3/c797ee3013bb2a221aed to your computer and use it in GitHub Desktop.
Save totem3/c797ee3013bb2a221aed to your computer and use it in GitHub Desktop.
Goal forall (A : Prop), A -> A.
intros.
exact H.
Qed.
Require Import Arith.
Theorem plus_comm: forall (n m : nat), (n + m) = m + n.
intros.
induction m.
simpl.
induction n.
simpl.
reflexivity.
simpl.
rewrite IHn.
reflexivity.
simpl.
rewrite <- plus_n_Sm.
f_equal.
exact IHm.
Qed.
Goal forall (n m: nat), (n*m) = (m*n).
intros.
induction n.
simpl.
rewrite <- mult_n_O.
reflexivity.
rewrite <- mult_n_Sm.
simpl.
rewrite plus_comm.
f_equal.
exact IHn.
Qed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment