X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matita%2Fdama%2Fordered_groups.ma;h=fb4b29f0dc3dd59ff9ae31163ca4d2471a1ab6ad;hb=f2e7cb9757a151382ed3a70d1a610e8f729a6597;hp=c9cab27f85e542b71265fd2244dfa9c9a1ecdce8;hpb=ae98f5490e20dd26ece5804d9847acfba0e4d16b;p=helm.git diff --git a/matita/dama/ordered_groups.ma b/matita/dama/ordered_groups.ma index c9cab27f8..fb4b29f0d 100644 --- a/matita/dama/ordered_groups.ma +++ b/matita/dama/ordered_groups.ma @@ -14,68 +14,91 @@ set "baseuri" "cic:/matita/ordered_groups/". -include "groups.ma". include "ordered_sets.ma". +include "groups.ma". -record pre_ordered_abelian_group : Type ≝ - { og_abelian_group:> abelian_group; - og_tordered_set_: tordered_set; - og_with: exc_carr og_tordered_set_ = og_abelian_group - }. +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_tordered_set: pre_ordered_abelian_group → tordered_set. -intro G; apply mk_tordered_set; -[1: apply mk_pordered_set; - [1: apply (mk_excedence G); - [1: cases G; clear G; simplify; rewrite < H; clear H; - cases og_tordered_set_; clear og_tordered_set_; simplify; - cases tos_poset; simplify; cases pos_carr; simplify; assumption; - |2: cases G; simplify; cases H; simplify; clear H; - cases og_tordered_set_; simplify; clear og_tordered_set_; - cases tos_poset; simplify; cases pos_carr; simplify; - intros; apply H; - |3: cases G; simplify; cases H; simplify; cases og_tordered_set_; simplify; - cases tos_poset; simplify; cases pos_carr; simplify; - intros; apply c; assumption] - |2: cases G; simplify; - cases H; simplify; clear H; cases og_tordered_set_; simplify; - cases tos_poset; simplify; assumption;] -|2: simplify; (* SLOW, senza la simplify il widget muore *) - cases G; simplify; - generalize in match (tos_totality og_tordered_set_); - unfold total_order_property; - cases H; simplify; cases og_tordered_set_; simplify; - cases tos_poset; simplify; cases pos_carr; simplify; - intros; apply f; assumption;] +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_tordered_set.con. +coercion cic:/matita/ordered_groups/og_abelian_group.con. + -definition is_ordered_abelian_group ≝ - λG:pre_ordered_abelian_group. ∀f,g,h:G. f≤g → f+h≤g+h. +record ogroup : Type ≝ { + og_carr:> pre_ogroup; + fle_plusr: ∀f,g,h:og_carr. f≤g → f+h≤g+h +}. + +lemma plus_cancr_le: + ∀G:ogroup.∀x,y,z:G.x+z ≤ y + z → x ≤ y. +intros 5 (G x y z L); +apply (le_rewl ??? (0+x) (zero_neutral ??)); +apply (le_rewl ??? (x+0) (plus_comm ???)); +apply (le_rewl ??? (x+(-z+z))); [apply feq_plusl;apply opp_inverse;] +apply (le_rewl ??? (x+(z+ -z))); [apply feq_plusl;apply plus_comm;] +apply (le_rewl ??? (x+z+ -z)); [apply eq_symmetric; apply plus_assoc;] +apply (le_rewr ??? (0+y) (zero_neutral ??)); +apply (le_rewr ??? (y+0) (plus_comm ???)); +apply (le_rewr ??? (y+(-z+z))); [apply feq_plusl;apply opp_inverse;] +apply (le_rewr ??? (y+(z+ -z))); [apply feq_plusl;apply plus_comm;] +apply (le_rewr ??? (y+z+ -z)); [apply eq_symmetric; apply plus_assoc;] +apply (fle_plusr ??? (-z)); +assumption; +qed. + +lemma fle_plusl: ∀G:ogroup. ∀f,g,h:G. f≤g → h+f≤h+g. +intros (G f g h); +apply (plus_cancr_le ??? (-h)); +apply (le_rewl ??? (f+h+ -h)); [apply feq_plusr;apply plus_comm;] +apply (le_rewl ??? (f+(h+ -h)) (plus_assoc ????)); +apply (le_rewl ??? (f+(-h+h))); [apply feq_plusl;apply plus_comm;] +apply (le_rewl ??? (f+0)); [apply feq_plusl; apply eq_symmetric; apply opp_inverse] +apply (le_rewl ??? (0+f) (plus_comm ???)); +apply (le_rewl ??? (f) (eq_symmetric ??? (zero_neutral ??))); +apply (le_rewr ??? (g+h+ -h)); [apply feq_plusr;apply plus_comm;] +apply (le_rewr ??? (g+(h+ -h)) (plus_assoc ????)); +apply (le_rewr ??? (g+(-h+h))); [apply feq_plusl;apply plus_comm;] +apply (le_rewr ??? (g+0)); [apply feq_plusl; apply eq_symmetric; apply opp_inverse] +apply (le_rewr ??? (0+g) (plus_comm ???)); +apply (le_rewr ??? (g) (eq_symmetric ??? (zero_neutral ??))); +assumption; +qed. + +lemma plus_cancl_le: + ∀G:ogroup.∀x,y,z:G.z+x ≤ z+y → x ≤ y. +intros 5 (G x y z L); +apply (le_rewl ??? (0+x) (zero_neutral ??)); +apply (le_rewl ??? ((-z+z)+x)); [apply feq_plusr;apply opp_inverse;] +apply (le_rewl ??? (-z+(z+x)) (plus_assoc ????)); +apply (le_rewr ??? (0+y) (zero_neutral ??)); +apply (le_rewr ??? ((-z+z)+y)); [apply feq_plusr;apply opp_inverse;] +apply (le_rewr ??? (-z+(z+y)) (plus_assoc ????)); +apply (fle_plusl ??? (-z)); +assumption; +qed. -record ordered_abelian_group : Type ≝ - { og_pre_ordered_abelian_group:> pre_ordered_abelian_group; - og_ordered_abelian_group_properties: - is_ordered_abelian_group og_pre_ordered_abelian_group - }. lemma le_zero_x_to_le_opp_x_zero: - ∀G:ordered_abelian_group.∀x:G.0 ≤ x → -x ≤ 0. -intros (G x Px); -generalize in match (og_ordered_abelian_group_properties ? ? ? (-x) Px); intro; -(* ma cazzo, qui bisogna rifare anche i gruppi con ≈ ? *) - rewrite > zero_neutral in H; - rewrite > plus_comm in H; - rewrite > opp_inverse in H; - assumption. + ∀G:ogroup.∀x:G.0 ≤ x → -x ≤ 0. +intros (G x Px); apply (plus_cancr_le ??? x); +apply (le_rewl ??? 0 (eq_symmetric ??? (opp_inverse ??))); +apply (le_rewr ??? x (eq_symmetric ??? (zero_neutral ??))); +assumption; qed. -lemma le_x_zero_to_le_zero_opp_x: ∀G:ordered_abelian_group.∀x:G. x ≤ 0 → 0 ≤ -x. - intros; - generalize in match (og_ordered_abelian_group_properties ? ? ? (-x) H); intro; - rewrite > zero_neutral in H1; - rewrite > plus_comm in H1; - rewrite > opp_inverse in H1; - assumption. +lemma le_x_zero_to_le_zero_opp_x: + ∀G:ogroup.∀x:G. x ≤ 0 → 0 ≤ -x. +intros (G x Lx0); apply (plus_cancr_le ??? x); +apply (le_rewr ??? 0 (eq_symmetric ??? (opp_inverse ??))); +apply (le_rewl ??? x (eq_symmetric ??? (zero_neutral ??))); +assumption; qed.