Skip to content

Instantly share code, notes, and snippets.

@autotaker
Created May 4, 2014 14:01
Show Gist options
  • Save autotaker/701f8d22c2981642b9e9 to your computer and use it in GitHub Desktop.
Save autotaker/701f8d22c2981642b9e9 to your computer and use it in GitHub Desktop.
(* Q13 *)
Inductive pos : Set :=
| S0 : pos
| S : pos -> pos.
Fixpoint plus(n m:pos) : pos :=
match n with
| S0 => S m
| S n => S (plus n m)
end.
Infix "+" := plus.
Theorem plus_assoc : forall n m p : pos, n + (m + p) = (n + m) + p.
Proof.
intros.
induction n.
simpl.
reflexivity.
simpl.
f_equal.
apply IHn.
Qed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment