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/le_arith".
17 include "nat/times.ma".
18 include "nat/orders.ma".
21 theorem monotonic_le_plus_r:
22 \forall n:nat.monotonic nat le (\lambda m.n + m).
23 simplify.intros.elim n.
25 simplify.apply le_S_S.assumption.
28 theorem le_plus_r: \forall p,n,m:nat. n \le m \to p + n \le p + m
29 \def monotonic_le_plus_r.
31 theorem monotonic_le_plus_l:
32 \forall m:nat.monotonic nat le (\lambda n.n + m).
34 rewrite < sym_plus.rewrite < (sym_plus m).
35 apply le_plus_r.assumption.
38 theorem le_plus_l: \forall p,n,m:nat. n \le m \to n + p \le m + p
39 \def monotonic_le_plus_l.
41 theorem le_plus: \forall n1,n2,m1,m2:nat. n1 \le n2 \to m1 \le m2
42 \to n1 + m1 \le n2 + m2.
44 apply (trans_le ? (n2 + m1)).
45 apply le_plus_l.assumption.
46 apply le_plus_r.assumption.
49 theorem le_plus_n :\forall n,m:nat. m \le n + m.
50 intros.change with (O+m \le n+m).
51 apply le_plus_l.apply le_O_n.
54 theorem eq_plus_to_le: \forall n,m,p:nat.n=m+p \to m \le n.
61 theorem monotonic_le_times_r:
62 \forall n:nat.monotonic nat le (\lambda m. n * m).
63 simplify.intros.elim n.
64 simplify.apply le_O_n.
65 simplify.apply le_plus.
70 theorem le_times_r: \forall p,n,m:nat. n \le m \to p*n \le p*m
71 \def monotonic_le_times_r.
73 theorem monotonic_le_times_l:
74 \forall m:nat.monotonic nat le (\lambda n.n*m).
76 rewrite < sym_times.rewrite < (sym_times m).
77 apply le_times_r.assumption.
80 theorem le_times_l: \forall p,n,m:nat. n \le m \to n*p \le m*p
81 \def monotonic_le_times_l.
83 theorem le_times: \forall n1,n2,m1,m2:nat. n1 \le n2 \to m1 \le m2
86 apply (trans_le ? (n2*m1)).
87 apply le_times_l.assumption.
88 apply le_times_r.assumption.
91 theorem le_times_n: \forall n,m:nat.(S O) \le n \to m \le n*m.
92 intros.elim H.simplify.
93 elim (plus_n_O ?).apply le_n.
94 simplify.rewrite < sym_plus.apply le_plus_n.