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 (**************************************************************************)
15 set "baseuri" "cic:/matita/nat/plus".
17 include "logic/equality.ma".
23 | (S p) \Rightarrow S (plus p m) ].
25 theorem plus_n_O: \forall n:nat. eq nat n (plus n O).
28 simplify.apply eq_f.assumption.
31 theorem plus_n_Sm : \forall n,m:nat. eq nat (S (plus n m)) (plus n (S m)).
34 simplify.apply eq_f.assumption.
37 (* some problem here: confusion between relations/symmetric
38 and functions/symmetric; functions symmetric is not in
40 theorem symmetric_plus: symmetric nat plus. *)
42 theorem sym_plus: \forall n,m:nat. eq nat (plus n m) (plus m n).
44 simplify.apply plus_n_O.
45 simplify.rewrite > H.apply plus_n_Sm.
48 theorem associative_plus : associative nat plus.
49 simplify.intros.elim x.
51 simplify.apply eq_f.assumption.
54 theorem assoc_plus : \forall n,m,p:nat. eq nat (plus (plus n m) p) (plus n (plus m p))
55 \def associative_plus.
57 theorem injective_plus_r: \forall n:nat.injective nat nat (\lambda m.plus n m).
58 intro.simplify.intros 2.elim n.
60 apply H.apply inj_S.apply H1.
63 theorem inj_plus_r: \forall p,n,m:nat.eq nat (plus p n) (plus p m) \to (eq nat n m)
64 \def injective_plus_r.
66 theorem injective_plus_l: \forall m:nat.injective nat nat (\lambda n.plus n m).
67 intro.simplify.intros.
68 (* qui vorrei applicare injective_plus_r *)
75 theorem inj_plus_l: \forall p,n,m:nat.eq nat (plus n p) (plus m p) \to (eq nat n m)
76 \def injective_plus_l.