-include "ordered_sets2.ma".
-
-record pre_ordered_abelian_group : Type ≝
- { og_abelian_group:> abelian_group;
- og_ordered_set_: ordered_set;
- og_with: os_carrier og_ordered_set_ = og_abelian_group
- }.
-
-lemma og_ordered_set: pre_ordered_abelian_group → ordered_set.
- intro G;
- apply mk_ordered_set;
- [ apply (carrier (og_abelian_group G))
- | apply (eq_rect ? ? (λC:Type.C→C→Prop) ? ? (og_with G));
- apply os_le
- | apply
- (eq_rect' ? ?
- (λa:Type.λH:os_carrier (og_ordered_set_ G) = a.
- is_order_relation a
- (eq_rect Type (og_ordered_set_ G) (λC:Type.C→C→Prop)
- (os_le (og_ordered_set_ G)) a H))
- ? ? (og_with G));
- simplify;
- apply (os_order_relation_properties (og_ordered_set_ G))
- ]
+
+record pre_ogroup : Type ≝ {
+ og_abelian_group_: abelian_group;
+ og_tordered_set:> tordered_set;
+ og_with: carr og_abelian_group_ = og_tordered_set
+}.
+
+lemma og_abelian_group: pre_ogroup → abelian_group.
+intro G; apply (mk_abelian_group G); [1,2,3: rewrite < (og_with G)]
+[apply (plus (og_abelian_group_ G));|apply zero;|apply opp]
+unfold apartness_OF_pre_ogroup; cases (og_with G); simplify;
+[apply plus_assoc|apply plus_comm|apply zero_neutral|apply opp_inverse|apply plus_strong_ext]
+qed.
+
+coercion cic:/matita/ordered_groups/og_abelian_group.con.
+
+(* CSC: NO! Cosi' e' nel frammento negativo. Devi scriverlo con l'eccedenza!
+ Tutto il resto del file e' da rigirare nel frammento positivo.
+*)
+record ogroup : Type ≝ {
+ og_carr:> pre_ogroup;
+ exc_canc_plusr: ∀f,g,h:og_carr. f+h ≰ g+h → f ≰ g
+}.
+
+lemma fexc_plusr:
+ ∀G:ogroup.∀x,y,z:G. x ≰ y → x+z ≰ y + z.
+intros 5 (G x y z L); apply (exc_canc_plusr ??? (-z));
+apply (exc_rewl ??? (x + (z + -z)) (plus_assoc ????));
+apply (exc_rewl ??? (x + (-z + z)) (plus_comm ??z));
+apply (exc_rewl ??? (x+0) (opp_inverse ??));
+apply (exc_rewl ??? (0+x) (plus_comm ???));
+apply (exc_rewl ??? x (zero_neutral ??));
+apply (exc_rewr ??? (y + (z + -z)) (plus_assoc ????));
+apply (exc_rewr ??? (y + (-z + z)) (plus_comm ??z));
+apply (exc_rewr ??? (y+0) (opp_inverse ??));
+apply (exc_rewr ??? (0+y) (plus_comm ???));
+apply (exc_rewr ??? y (zero_neutral ??) L);
+qed.
+
+coercion cic:/matita/ordered_groups/fexc_plusr.con nocomposites.
+
+lemma exc_canc_plusl: ∀G:ogroup.∀f,g,h:G. h+f ≰ h+g → f ≰ g.
+intros 5 (G x y z L); apply (exc_canc_plusr ??? z);
+apply (exc_rewl ??? (z+x) (plus_comm ???));
+apply (exc_rewr ??? (z+y) (plus_comm ???) L);