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/library_autobatch/nat/le_arith".
17 include "auto/nat/times.ma".
18 include "auto/nat/orders.ma".
21 theorem monotonic_le_plus_r:
22 \forall n:nat.monotonic nat le (\lambda m.n + m).
27 (*apply le_S_S.assumption*)
31 theorem le_plus_r: \forall p,n,m:nat. n \le m \to p + n \le p + m
32 \def monotonic_le_plus_r.
34 theorem monotonic_le_plus_l:
35 \forall m:nat.monotonic nat le (\lambda n.n + m).
38 rewrite < (sym_plus m).*)
45 theorem monotonic_le_plus_l:
46 \forall m:nat.monotonic nat le (\lambda n.n + m).
49 rewrite < (sym_plus m).
53 theorem le_plus_l: \forall p,n,m:nat. n \le m \to n + p \le m + p
54 \def monotonic_le_plus_l.
56 theorem le_plus: \forall n1,n2,m1,m2:nat. n1 \le n2 \to m1 \le m2
57 \to n1 + m1 \le n2 + m2.
60 (*apply (trans_le ? (n2 + m1)).
61 apply le_plus_l.assumption.
62 apply le_plus_r.assumption.*)
65 theorem le_plus_n :\forall n,m:nat. m \le n + m.
67 change with (O+m \le n+m).
73 theorem eq_plus_to_le: \forall n,m,p:nat.n=m+p \to m \le n.
77 apply le_plus_n. (* a questo punto funziona anche: autobatch.*)
81 theorem monotonic_le_times_r:
82 \forall n:nat.monotonic nat le (\lambda m. n * m).
83 simplify.intros.elim n;simplify
87 assumption. *) (* chiudo entrambi i goal attivi in questo modo*)
91 theorem le_times_r: \forall p,n,m:nat. n \le m \to p*n \le p*m
92 \def monotonic_le_times_r.
94 theorem monotonic_le_times_l:
95 \forall m:nat.monotonic nat le (\lambda n.n*m).
97 (*rewrite < sym_times.
98 rewrite < (sym_times m).
105 theorem monotonic_le_times_l:
106 \forall m:nat.monotonic nat le (\lambda n.n*m).
109 rewrite < (sym_times m).
114 theorem le_times_l: \forall p,n,m:nat. n \le m \to n*p \le m*p
115 \def monotonic_le_times_l.
117 theorem le_times: \forall n1,n2,m1,m2:nat. n1 \le n2 \to m1 \le m2
121 (*apply (trans_le ? (n2*m1)).
122 apply le_times_l.assumption.
123 apply le_times_r.assumption.*)
126 theorem le_times_n: \forall n,m:nat.(S O) \le n \to m \le n*m.
127 intros.elim H;simplify
132 (*rewrite < sym_plus.