1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| A.Asperti, C.Sacerdoti Coen, *)
8 (* ||A|| E.Tassi, S.Zacchiroli *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU Lesser General Public License Version 2.1 *)
13 (**************************************************************************)
20 | (S p) \Rightarrow S (plus p m) ].
22 interpretation "natural plus" 'plus x y = (plus x y).
24 theorem plus_n_O: \forall n:nat. n = n+O.
27 simplify.apply eq_f.assumption.
30 theorem plus_n_Sm : \forall n,m:nat. S (n+m) = n+(S m).
33 simplify.apply eq_f.assumption.
36 theorem plus_n_SO : \forall n:nat. S n = n+(S O).
37 intro.rewrite > plus_n_O.
41 theorem sym_plus: \forall n,m:nat. n+m = m+n.
43 simplify.apply plus_n_O.
44 simplify.rewrite > H.apply plus_n_Sm.
47 theorem associative_plus : associative nat plus.
48 unfold associative.intros.elim x.
50 simplify.apply eq_f.assumption.
53 theorem assoc_plus : \forall n,m,p:nat. (n+m)+p = n+(m+p)
54 \def associative_plus.
56 theorem injective_plus_r: \forall n:nat.injective nat nat (\lambda m.n+m).
57 intro.simplify.intros 2.elim n.
59 apply H.apply inj_S.apply H1.
62 theorem inj_plus_r: \forall p,n,m:nat. p+n = p+m \to n=m
63 \def injective_plus_r.
65 theorem injective_plus_l: \forall m:nat.injective nat nat (\lambda n.n+m).
66 intro.simplify.intros.
67 apply (injective_plus_r m).
69 rewrite < (sym_plus y).
73 theorem inj_plus_l: \forall p,n,m:nat. n+p = m+p \to n=m
74 \def injective_plus_l.