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 (**************************************************************************)
19 record pogroup_ : Type ≝ {
20 og_abelian_group_: abelian_group;
22 og_with: carr og_abelian_group_ = exc_ap og_excess
25 lemma og_abelian_group: pogroup_ → abelian_group.
26 intro G; apply (mk_abelian_group G); unfold apartness_OF_pogroup_;
27 cases (og_with G); simplify;
28 [apply (plus (og_abelian_group_ G));|apply zero;|apply opp
29 |apply plus_assoc|apply plus_comm|apply zero_neutral|apply opp_inverse|apply plus_strong_ext]
32 coercion cic:/matita/ordered_group/og_abelian_group.con.
34 record pogroup : Type ≝ {
36 plus_cancr_exc: ∀f,g,h:og_carr. f+h ≰ g+h → f ≰ g
40 ∀G:pogroup.∀x,y,z:G. x ≰ y → x+z ≰ y + z.
41 intros 5 (G x y z L); apply (plus_cancr_exc ??? (-z));
42 apply (Ex≪ (x + (z + -z)) (plus_assoc ????));
43 apply (Ex≪ (x + (-z + z)) (plus_comm ??z));
44 apply (Ex≪ (x+0) (opp_inverse ??));
45 apply (Ex≪ (0+x) (plus_comm ???));
46 apply (Ex≪ x (zero_neutral ??));
47 apply (Ex≫ (y + (z + -z)) (plus_assoc ????));
48 apply (Ex≫ (y + (-z + z)) (plus_comm ??z));
49 apply (Ex≫ (y+0) (opp_inverse ??));
50 apply (Ex≫ (0+y) (plus_comm ???));
51 apply (Ex≫ y (zero_neutral ??) L);
54 coercion cic:/matita/ordered_group/fexc_plusr.con nocomposites.
56 lemma plus_cancl_exc: ∀G:pogroup.∀f,g,h:G. h+f ≰ h+g → f ≰ g.
57 intros 5 (G x y z L); apply (plus_cancr_exc ??? z);
58 apply (Ex≪ (z+x) (plus_comm ???));
59 apply (Ex≫ (z+y) (plus_comm ???) L);
63 ∀G:pogroup.∀x,y,z:G. x ≰ y → z+x ≰ z+y.
64 intros 5 (G x y z L); apply (plus_cancl_exc ??? (-z));
65 apply (Ex≪? (plus_assoc ??z x));
66 apply (Ex≫? (plus_assoc ??z y));
67 apply (Ex≪ (0+x) (opp_inverse ??));
68 apply (Ex≫ (0+y) (opp_inverse ??));
69 apply (Ex≪? (zero_neutral ??));
70 apply (Ex≫? (zero_neutral ??) L);
73 coercion cic:/matita/ordered_group/fexc_plusl.con nocomposites.
76 ∀G:pogroup.∀x,y,z:G.x+z ≤ y + z → x ≤ y.
78 apply (Le≪ (0+x) (zero_neutral ??));
79 apply (Le≪ (x+0) (plus_comm ???));
80 apply (Le≪ (x+(-z+z)) (opp_inverse ??));
81 apply (Le≪ (x+(z+ -z)) (plus_comm ??z));
82 apply (Le≪ (x+z+ -z) (plus_assoc ????));
83 apply (Le≫ (0+y) (zero_neutral ??));
84 apply (Le≫ (y+0) (plus_comm ???));
85 apply (Le≫ (y+(-z+z)) (opp_inverse ??));
86 apply (Le≫ (y+(z+ -z)) (plus_comm ??z));
87 apply (Le≫ (y+z+ -z) (plus_assoc ????));
88 intro H; apply L; clear L; apply (plus_cancr_exc ??? (-z) H);
91 lemma fle_plusl: ∀G:pogroup. ∀f,g,h:G. f≤g → h+f≤h+g.
93 apply (plus_cancr_le ??? (-h));
94 apply (Le≪ (f+h+ -h) (plus_comm ? f h));
95 apply (Le≪ (f+(h+ -h)) (plus_assoc ????));
96 apply (Le≪ (f+(-h+h)) (plus_comm ? h (-h)));
97 apply (Le≪ (f+0) (opp_inverse ??));
98 apply (Le≪ (0+f) (plus_comm ???));
99 apply (Le≪ (f) (zero_neutral ??));
100 apply (Le≫ (g+h+ -h) (plus_comm ? h ?));
101 apply (Le≫ (g+(h+ -h)) (plus_assoc ????));
102 apply (Le≫ (g+(-h+h)) (plus_comm ??h));
103 apply (Le≫ (g+0) (opp_inverse ??));
104 apply (Le≫ (0+g) (plus_comm ???));
105 apply (Le≫ (g) (zero_neutral ??) H);
108 lemma fle_plusr: ∀G:pogroup. ∀f,g,h:G. f≤g → f+h≤g+h.
109 intros (G f g h H); apply (Le≪? (plus_comm ???));
110 apply (Le≫? (plus_comm ???)); apply fle_plusl; assumption;
114 ∀G:pogroup.∀x,y,z:G.z+x ≤ z+y → x ≤ y.
115 intros 5 (G x y z L);
116 apply (Le≪ (0+x) (zero_neutral ??));
117 apply (Le≪ ((-z+z)+x) (opp_inverse ??));
118 apply (Le≪ (-z+(z+x)) (plus_assoc ????));
119 apply (Le≫ (0+y) (zero_neutral ??));
120 apply (Le≫ ((-z+z)+y) (opp_inverse ??));
121 apply (Le≫ (-z+(z+y)) (plus_assoc ????));
122 apply (fle_plusl ??? (-z) L);
126 ∀G:pogroup.∀x,y,z:G.z+x < z+y → x < y.
127 intros 5 (G x y z L); elim L (A LE); split; [apply plus_cancl_le; assumption]
128 apply (plus_cancl_ap ???? LE);
132 ∀G:pogroup.∀x,y,z:G.x+z < y+z → x < y.
133 intros 5 (G x y z L); elim L (A LE); split; [apply plus_cancr_le; assumption]
134 apply (plus_cancr_ap ???? LE);
138 lemma exc_opp_x_zero_to_exc_zero_x:
139 ∀G:pogroup.∀x:G.-x ≰ 0 → 0 ≰ x.
140 intros (G x H); apply (plus_cancr_exc ??? (-x));
141 apply (Ex≫? (plus_comm ???));
142 apply (Ex≫? (opp_inverse ??));
143 apply (Ex≪? (zero_neutral ??) H);
146 lemma le_zero_x_to_le_opp_x_zero:
147 ∀G:pogroup.∀x:G.0 ≤ x → -x ≤ 0.
148 intros (G x Px); apply (plus_cancr_le ??? x);
149 apply (Le≪ 0 (opp_inverse ??));
150 apply (Le≫ x (zero_neutral ??) Px);
153 lemma lt_zero_x_to_lt_opp_x_zero:
154 ∀G:pogroup.∀x:G.0 < x → -x < 0.
155 intros (G x Px); apply (plus_cancr_lt ??? x);
156 apply (Lt≪ 0 (opp_inverse ??));
157 apply (Lt≫ x (zero_neutral ??) Px);
160 lemma exc_zero_opp_x_to_exc_x_zero:
161 ∀G:pogroup.∀x:G. 0 ≰ -x → x ≰ 0.
162 intros (G x H); apply (plus_cancl_exc ??? (-x));
163 apply (Ex≫? (plus_comm ???));
164 apply (Ex≪? (opp_inverse ??));
165 apply (Ex≫? (zero_neutral ??) H);
168 lemma le_x_zero_to_le_zero_opp_x:
169 ∀G:pogroup.∀x:G. x ≤ 0 → 0 ≤ -x.
170 intros (G x Lx0); apply (plus_cancr_le ??? x);
171 apply (Le≫ 0 (opp_inverse ??));
172 apply (Le≪ x (zero_neutral ??));
176 lemma lt_x_zero_to_lt_zero_opp_x:
177 ∀G:pogroup.∀x:G. x < 0 → 0 < -x.
178 intros (G x Lx0); apply (plus_cancr_lt ??? x);
179 apply (Lt≫ 0 (opp_inverse ??));
180 apply (Lt≪ x (zero_neutral ??));
184 lemma lt_opp_x_zero_to_lt_zero_x:
185 ∀G:pogroup.∀x:G. -x < 0 → 0 < x.
186 intros (G x Lx0); apply (plus_cancr_lt ??? (-x));
187 apply (Lt≪ (-x) (zero_neutral ??));
188 apply (Lt≫ (-x+x) (plus_comm ???));
189 apply (Lt≫ 0 (opp_inverse ??));
194 ∀G:pogroup. ∀x,y:G. 0 ≤ x → 0 ≤ y → 0 < x + y → 0 < x ∨ 0 < y.
195 intros (G x y LEx LEy LT); cases LT (H1 H2); cases (ap_cotransitive ??? y H2);
196 [right; split; assumption|left;split;[assumption]]
197 apply (plus_cancr_ap ??? y); apply (Ap≪? (zero_neutral ??));
202 ∀G:pogroup.∀a,b,c:G. 0 ≤ b → a + b ≤ c → a ≤ c.
203 intros (G a b c L H); apply (le_transitive ????? H);
204 apply (plus_cancl_le ??? (-a));
205 apply (Le≪ 0 (opp_inverse ??));
206 apply (Le≫ (-a + a + b) (plus_assoc ????));
207 apply (Le≫ (0 + b) (opp_inverse ??));
208 apply (Le≫ b (zero_neutral ??));
213 ∀G:pogroup.∀a,b:G. 0 ≤ a → 0 ≤ b → 0 ≤ a + b.
214 intros (G a b L1 L2); apply (le_transitive ???? L1);
215 apply (plus_cancl_le ??? (-a));
216 apply (Le≪ 0 (opp_inverse ??));
217 apply (Le≫ (-a + a + b) (plus_assoc ????));
218 apply (Le≫ (0 + b) (opp_inverse ??));
219 apply (Le≫ b (zero_neutral ??));
224 ∀G:pogroup.∀x,y,z:G.x < y → z + x < z + y.
225 intros (G x y z H); cases H; split; [apply fle_plusl; assumption]
226 apply fap_plusl; assumption;
230 ∀G:pogroup.∀x,y,z:G.x < y → x + z < y + z.
231 intros (G x y z H); cases H; split; [apply fle_plusr; assumption]
232 apply fap_plusr; assumption;
236 lemma ltxy_ltyyxx: ∀G:pogroup.∀x,y:G. y < x → y+y < x+x.
237 intros; apply (lt_transitive ?? (y+x));[2:
238 apply (Lt≪? (plus_comm ???));
239 apply (Lt≫? (plus_comm ???));]
240 apply flt_plusl;assumption;
243 lemma lew_opp : ∀O:pogroup.∀a,b,c:O.0 ≤ b → a ≤ c → a + -b ≤ c.
244 intros (O a b c L0 L);
245 apply (le_transitive ????? L);
246 apply (plus_cancl_le ??? (-a));
247 apply (Le≫ 0 (opp_inverse ??));
248 apply (Le≪ (-a+a+-b) (plus_assoc ????));
249 apply (Le≪ (0+-b) (opp_inverse ??));
250 apply (Le≪ (-b) (zero_neutral ?(-b)));
251 apply le_zero_x_to_le_opp_x_zero;
255 lemma ltw_opp : ∀O:pogroup.∀a,b,c:O.0 < b → a < c → a + -b < c.
256 intros (O a b c P L);
257 apply (lt_transitive ????? L);
258 apply (plus_cancl_lt ??? (-a));
259 apply (Lt≫ 0 (opp_inverse ??));
260 apply (Lt≪ (-a+a+-b) (plus_assoc ????));
261 apply (Lt≪ (0+-b) (opp_inverse ??));
262 apply (Lt≪ ? (zero_neutral ??));
263 apply lt_zero_x_to_lt_opp_x_zero;
267 record togroup : Type ≝ {
269 tog_total: ∀x,y:tog_carr.x≰y → y < x
272 lemma lexxyy_lexy: ∀G:togroup. ∀x,y:G. x+x ≤ y+y → x ≤ y.
273 intros (G x y H); intro H1; lapply (tog_total ??? H1) as H2;
274 lapply (ltxy_ltyyxx ??? H2) as H3; lapply (lt_to_excess ??? H3) as H4;
278 lemma eqxxyy_eqxy: ∀G:togroup.∀x,y:G. x + x ≈ y + y → x ≈ y.
279 intros (G x y H); cases (eq_le_le ??? H); apply le_le_eq;
280 apply lexxyy_lexy; assumption;
283 lemma applus_orap: ∀G:abelian_group. ∀x,y:G. 0 # x + y → 0 #x ∨ 0#y.
284 intros; cases (ap_cotransitive ??? y a); [right; assumption]
285 left; apply (plus_cancr_ap ??? y); apply (Ap≪y (zero_neutral ??));
289 lemma ltplus: ∀G:pogroup.∀a,b,c,d:G. a < b → c < d → a+c < b + d.
290 intros (G a b c d H1 H2);
291 lapply (flt_plusr ??? c H1) as H3;
292 apply (lt_transitive ???? H3);
293 apply flt_plusl; assumption;
296 lemma excplus_orexc: ∀G:pogroup.∀a,b,c,d:G. a+c ≰ b + d → a ≰ b ∨ c ≰ d.
297 intros (G a b c d H1 H2);
298 cases (exc_cotransitive ??? (a + d) H1); [
299 right; apply (plus_cancl_exc ??? a); assumption]
300 left; apply (plus_cancr_exc ??? d); assumption;
303 lemma leplus: ∀G:pogroup.∀a,b,c,d:G. a ≤ b → c ≤ d → a+c ≤ b + d.
304 intros (G a b c d H1 H2); intro H3; cases (excplus_orexc ????? H3);
305 [apply H1|apply H2] assumption;
308 lemma leplus_lt_le: ∀G:togroup.∀x,y:G. 0 ≤ x + y → x < 0 → 0 ≤ y.
309 intros; intro; apply H; lapply (lt_to_excess ??? l);
310 lapply (tog_total ??? e);
311 lapply (tog_total ??? Hletin);
312 lapply (ltplus ????? Hletin2 Hletin1);
313 apply (Ex≪ (0+0)); [apply eq_sym; apply zero_neutral]
314 apply lt_to_excess; assumption;
317 lemma ltplus_orlt: ∀G:togroup.∀a,b,c,d:G. a+c < b + d → a < b ∨ c < d.
318 intros (G a b c d H1 H2); lapply (lt_to_excess ??? H1);
319 cases (excplus_orexc ????? Hletin); [left|right] apply tog_total; assumption;
322 lemma excplus: ∀G:togroup.∀a,b,c,d:G.a ≰ b → c ≰ d → a + c ≰ b + d.
323 intros (G a b c d L1 L2);
324 lapply (fexc_plusr ??? (c) L1) as L3;
325 elim (exc_cotransitive ??? (b+d) L3); [assumption]
326 lapply (plus_cancl_exc ???? b1); lapply (tog_total ??? Hletin);
327 cases Hletin1; cases (H L2);