]> matita.cs.unibo.it Git - helm.git/blob - helm/matita/library/nat/orders_op.ma
A little bit more of notation here and there.
[helm.git] / helm / matita / library / nat / orders_op.ma
1 (**************************************************************************)
2 (*       ___                                                                *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||       A.Asperti, C.Sacerdoti Coen,                          *)
8 (*      ||A||       E.Tassi, S.Zacchiroli                                 *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU Lesser General Public License Version 2.1         *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 set "baseuri" "cic:/matita/nat/orders_op".
16
17 include "higher_order_defs/functions.ma".
18 include "nat/times.ma".
19 include "nat/orders.ma".
20
21 (* plus *)
22 theorem monotonic_le_plus_r: 
23 \forall n:nat.monotonic nat le (\lambda m.n+m).
24 simplify.intros.elim n.
25 simplify.assumption.
26 simplify.apply le_S_S.assumption.
27 qed.
28
29 theorem le_plus_r: \forall p,n,m:nat. n \leq m \to p+n \leq p+m
30 \def monotonic_le_plus_r.
31
32 theorem monotonic_le_plus_l: 
33 \forall m:nat.monotonic nat le (\lambda n.n+m).
34 simplify.intros.
35 rewrite < sym_plus.rewrite < sym_plus m.
36 apply le_plus_r.assumption.
37 qed.
38
39 theorem le_plus_l: \forall p,n,m:nat. n \leq m \to n+p \leq m+p
40 \def monotonic_le_plus_l.
41
42 theorem le_plus: \forall n1,n2,m1,m2:nat. n1 \leq n2  \to m1 \leq m2 
43 \to n1+m1 \leq n2+m2.
44 intros.
45 apply trans_le ? (n2+m1).
46 apply le_plus_l.assumption.
47 apply le_plus_r.assumption.
48 qed.
49
50 theorem le_plus_n :\forall n,m:nat. m \leq n+m.
51 intros.change with O+m \leq n+m.
52 apply le_plus_l.apply le_O_n.
53 qed.
54
55 theorem eq_plus_to_le: \forall n,m,p:nat.n=m+p \to m \leq n.
56 intros.rewrite > H.
57 rewrite < sym_plus.
58 apply le_plus_n.
59 qed.
60
61 (* times *)
62 theorem monotonic_le_times_r: 
63 \forall n:nat.monotonic nat le (\lambda m.n*m).
64 simplify.intros.elim n.
65 simplify.apply le_O_n.
66 simplify.apply le_plus.
67 assumption.
68 assumption.
69 qed.
70
71 theorem le_times_r: \forall p,n,m:nat. n \leq m \to p*n \leq p*m
72 \def monotonic_le_times_r.
73
74 theorem monotonic_le_times_l: 
75 \forall m:nat.monotonic nat le (\lambda n.n*m).
76 simplify.intros.
77 rewrite < sym_times.rewrite < sym_times m.
78 apply le_times_r.assumption.
79 qed.
80
81 theorem le_times_l: \forall p,n,m:nat. n \leq m \to n*p \leq m*p
82 \def monotonic_le_times_l.
83
84 theorem le_times: \forall n1,n2,m1,m2:nat. n1 \leq n2  \to m1 \leq m2 
85 \to n1*m1 \leq n2*m2.
86 intros.
87 apply trans_le ? (n2*m1).
88 apply le_times_l.assumption.
89 apply le_times_r.assumption.
90 qed.
91
92 theorem le_times_n: \forall n,m:nat.S O \leq n \to m \leq n*m.
93 intros.elim H.simplify.
94 elim (plus_n_O ?).apply le_n.
95 simplify.rewrite < sym_plus.apply le_plus_n.
96 qed.
97
98