]> matita.cs.unibo.it Git - helm.git/blob - matita/dama/ordered_groups.ma
cff205ce9a267a3eaa791f4ccf2b347cbead6140
[helm.git] / matita / dama / ordered_groups.ma
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 set "baseuri" "cic:/matita/ordered_groups/".
16
17 include "ordered_sets.ma".
18 include "groups.ma".
19
20 record pre_ogroup : Type ≝ { 
21   og_abelian_group_: abelian_group;
22   og_tordered_set:> tordered_set;
23   og_with: carr og_abelian_group_ = og_tordered_set
24 }.
25
26 lemma og_abelian_group: pre_ogroup → abelian_group.
27 intro G; apply (mk_abelian_group G); [1,2,3: rewrite < (og_with G)]
28 [apply (plus (og_abelian_group_ G));|apply zero;|apply opp]
29 unfold apartness_OF_pre_ogroup; cases (og_with G); simplify;
30 [apply plus_assoc|apply plus_comm|apply zero_neutral|apply opp_inverse|apply plus_strong_ext]
31 qed.
32
33 coercion cic:/matita/ordered_groups/og_abelian_group.con.
34
35
36 record ogroup : Type ≝ { 
37   og_carr:> pre_ogroup;
38   fle_plusr: ∀f,g,h:og_carr. f≤g → f+h≤g+h
39 }.
40
41 lemma plus_cancr_le: 
42   ∀G:ogroup.∀x,y,z:G.x+z ≤ y + z → x ≤ y.
43 intros 5 (G x y z L);
44 apply (le_rewl ??? (0+x) (zero_neutral ??));
45 apply (le_rewl ??? (x+0) (plus_comm ???));
46 apply (le_rewl ??? (x+(-z+z)) (opp_inverse ??));
47 apply (le_rewl ??? (x+(z+ -z)) (plus_comm ??z));
48 apply (le_rewl ??? (x+z+ -z) (plus_assoc ????));
49 apply (le_rewr ??? (0+y) (zero_neutral ??));
50 apply (le_rewr ??? (y+0) (plus_comm ???));
51 apply (le_rewr ??? (y+(-z+z)) (opp_inverse ??));
52 apply (le_rewr ??? (y+(z+ -z)) (plus_comm ??z));
53 apply (le_rewr ??? (y+z+ -z) (plus_assoc ????));
54 apply (fle_plusr ??? (-z) L);
55 qed.
56
57 lemma fle_plusl: ∀G:ogroup. ∀f,g,h:G. f≤g → h+f≤h+g.
58 intros (G f g h);
59 apply (plus_cancr_le ??? (-h));
60 apply (le_rewl ??? (f+h+ -h) (plus_comm ? f h));
61 apply (le_rewl ??? (f+(h+ -h)) (plus_assoc ????));
62 apply (le_rewl ??? (f+(-h+h)) (plus_comm ? h (-h)));
63 apply (le_rewl ??? (f+0) (opp_inverse ??));
64 apply (le_rewl ??? (0+f) (plus_comm ???));
65 apply (le_rewl ??? (f) (zero_neutral ??));
66 apply (le_rewr ??? (g+h+ -h) (plus_comm ? h ?));
67 apply (le_rewr ??? (g+(h+ -h)) (plus_assoc ????));
68 apply (le_rewr ??? (g+(-h+h)) (plus_comm ??h));
69 apply (le_rewr ??? (g+0) (opp_inverse ??));
70 apply (le_rewr ??? (0+g) (plus_comm ???));
71 apply (le_rewr ??? (g) (zero_neutral ??) H);
72 qed.
73
74 lemma plus_cancl_le: 
75   ∀G:ogroup.∀x,y,z:G.z+x ≤ z+y → x ≤ y.
76 intros 5 (G x y z L);
77 apply (le_rewl ??? (0+x) (zero_neutral ??));
78 apply (le_rewl ??? ((-z+z)+x) (opp_inverse ??));
79 apply (le_rewl ??? (-z+(z+x)) (plus_assoc ????));
80 apply (le_rewr ??? (0+y) (zero_neutral ??));
81 apply (le_rewr ??? ((-z+z)+y) (opp_inverse ??));
82 apply (le_rewr ??? (-z+(z+y)) (plus_assoc ????));
83 apply (fle_plusl ??? (-z) L);
84 qed.
85
86
87 lemma le_zero_x_to_le_opp_x_zero: 
88   ∀G:ogroup.∀x:G.0 ≤ x → -x ≤ 0.
89 intros (G x Px); apply (plus_cancr_le ??? x);
90 apply (le_rewl ??? 0 (opp_inverse ??));
91 apply (le_rewr ??? x (zero_neutral ??) Px);
92 qed.
93
94 lemma le_x_zero_to_le_zero_opp_x: 
95   ∀G:ogroup.∀x:G. x ≤ 0 → 0 ≤ -x.
96 intros (G x Lx0); apply (plus_cancr_le ??? x);
97 apply (le_rewr ??? 0 (opp_inverse ??));
98 apply (le_rewl ??? x (zero_neutral ??));
99 assumption; 
100 qed.