1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 set "baseuri" "cic:/matita/ordered_groups/".
17 include "ordered_sets.ma".
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
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]
33 coercion cic:/matita/ordered_groups/og_abelian_group.con.
36 record ogroup : Type ≝ {
38 fle_plusr: ∀f,g,h:og_carr. f≤g → f+h≤g+h
42 ∀G:ogroup.∀x,y,z:G.x+z ≤ y + z → x ≤ y.
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);
57 lemma fle_plusl: ∀G:ogroup. ∀f,g,h:G. f≤g → h+f≤h+g.
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);
75 ∀G:ogroup.∀x,y,z:G.z+x ≤ z+y → x ≤ y.
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);
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);
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 ??));