From 864b6ef1956a312e5401a8705bcf7cf0cccf4e9f Mon Sep 17 00:00:00 2001 From: Enrico Tassi Date: Fri, 16 Nov 2007 14:12:48 +0000 Subject: [PATCH] more cleanup --- matita/dama/excedence.ma | 4 ++- matita/dama/groups.ma | 47 +++++++++++++++++++++------------- matita/dama/ordered_groups.ma | 48 ++++++++++++++++------------------- 3 files changed, 55 insertions(+), 44 deletions(-) diff --git a/matita/dama/excedence.ma b/matita/dama/excedence.ma index 84a033c3a..735fe2262 100644 --- a/matita/dama/excedence.ma +++ b/matita/dama/excedence.ma @@ -88,12 +88,14 @@ lemma eq_symmetric_:∀E:apartness.∀x,y:E.x ≈ y → y ≈ x := eq_symmetric. coercion cic:/matita/excedence/eq_symmetric_.con. -lemma eq_transitive: ∀E.transitive ? (eq E). +lemma eq_transitive_: ∀E.transitive ? (eq E). (* bug. intros k deve fare whd quanto basta *) intros 6 (E x y z Exy Eyz); intro Axy; cases (ap_cotransitive ???y Axy); [apply Exy|apply Eyz] assumption. qed. +lemma eq_transitive:∀E:apartness.∀x,y,z:E.x ≈ y → y ≈ z → x ≈ z ≝ eq_transitive_. + (* BUG: vedere se ricapita *) lemma le_antisymmetric: ∀E.antisymmetric ? (le E) (eq ?). intros 5 (E x y Lxy Lyx); intro H; diff --git a/matita/dama/groups.ma b/matita/dama/groups.ma index f67625817..28f7858a0 100644 --- a/matita/dama/groups.ma +++ b/matita/dama/groups.ma @@ -36,10 +36,10 @@ record abelian_group : Type ≝ plus: carr → carr → carr; zero: carr; opp: carr → carr; - plus_assoc: associative ? plus (eq carr); - plus_comm: commutative ? plus (eq carr); - zero_neutral: left_neutral ? plus zero; - opp_inverse: left_inverse ? plus zero opp; + plus_assoc_: associative ? plus (eq carr); + plus_comm_: commutative ? plus (eq carr); + zero_neutral_: left_neutral ? plus zero; + opp_inverse_: left_inverse ? plus zero opp; plus_strong_ext: ∀z.strong_ext ? (plus z) }. @@ -60,6 +60,11 @@ definition minus ≝ interpretation "Abelian group minus" 'minus a b = (cic:/matita/groups/minus.con _ a b). +lemma plus_assoc: ∀G:abelian_group.∀x,y,z:G.x+(y+z)≈x+y+z ≝ plus_assoc_. +lemma plus_comm: ∀G:abelian_group.∀x,y:G.x+y≈y+x ≝ plus_comm_. +lemma zero_neutral: ∀G:abelian_group.∀x:G.0+x≈x ≝ zero_neutral_. +lemma opp_inverse: ∀G:abelian_group.∀x:G.-x+x≈0 ≝ opp_inverse_. + definition ext ≝ λA:apartness.λop:A→A. ∀x,y. x ≈ y → op x ≈ op y. lemma strong_ext_to_ext: ∀A:apartness.∀op:A→A. strong_ext ? op → ext ? op. @@ -71,7 +76,7 @@ intros (G x y z Eyz); apply (strong_ext_to_ext ?? (plus_strong_ext ? x)); assumption; qed. -coercion cic:/matita/groups/feq_plusl.con. +coercion cic:/matita/groups/feq_plusl.con nocomposites. lemma plus_strong_extr: ∀G:abelian_group.∀z:G.strong_ext ? (λx.x + z). intros 5 (G z x y A); simplify in A; @@ -85,8 +90,18 @@ intros (G x y z Eyz); apply (strong_ext_to_ext ?? (plus_strong_extr ? x)); assumption; qed. -coercion cic:/matita/groups/feq_plusr.con. - +coercion cic:/matita/groups/feq_plusr.con nocomposites. + +(* generation of coercions to make *_rew[lr] easier *) +lemma feq_plusr_sym_: ∀G:abelian_group.∀x,y,z:G.z ≈ y → y+x ≈ z+x. +compose feq_plusr with eq_symmetric_ (H); apply H; assumption; +qed. +coercion cic:/matita/groups/feq_plusr_sym_.con nocomposites. +lemma feq_plusl_sym_: ∀G:abelian_group.∀x,y,z:G.z ≈ y → x+y ≈ x+z. +compose feq_plusl with eq_symmetric_ (H); apply H; assumption; +qed. +coercion cic:/matita/groups/feq_plusl_sym_.con nocomposites. + lemma fap_plusl: ∀G:abelian_group.∀x,y,z:G. y # z → x+y # x+z. intros (G x y z Ayz); apply (plus_strong_ext ? (-x)); apply (ap_rewl ??? ((-x + x) + y)); @@ -95,25 +110,23 @@ apply (ap_rewl ??? ((-x + x) + y)); [1: apply plus_assoc; |2: apply (ap_rewl ??? (0 + y)); [1: apply (feq_plusr ???? (opp_inverse ??)); - |2: apply (ap_rewl ???? (zero_neutral ? y)); apply (ap_rewr ??? (0 + z)); - [1: apply (feq_plusr ???? (opp_inverse ??)); - |2: apply (ap_rewr ???? (zero_neutral ??)); assumption;]]]] + |2: apply (ap_rewl ???? (zero_neutral ? y)); + apply (ap_rewr ??? (0 + z) (opp_inverse ??)); + apply (ap_rewr ???? (zero_neutral ??)); assumption;]]] qed. - - lemma fap_plusr: ∀G:abelian_group.∀x,y,z:G. y # z → y+x # z+x. intros (G x y z Ayz); apply (plus_strong_extr ? (-x)); apply (ap_rewl ??? (y + (x + -x))); [1: apply (eq_symmetric ??? (plus_assoc ????)); |2: apply (ap_rewr ??? (z + (x + -x))); [1: apply (eq_symmetric ??? (plus_assoc ????)); - |2: apply (ap_rewl ??? (y + (-x+x)) (feq_plusl ???? (plus_comm ???))); - apply (ap_rewl ??? (y + 0) (feq_plusl ???? (opp_inverse ??))); + |2: apply (ap_rewl ??? (y + (-x+x)) (plus_comm ? x (-x))); + apply (ap_rewl ??? (y + 0) (opp_inverse ??)); apply (ap_rewl ??? (0 + y) (plus_comm ???)); apply (ap_rewl ??? y (zero_neutral ??)); - apply (ap_rewr ??? (z + (-x+x)) (feq_plusl ???? (plus_comm ???))); - apply (ap_rewr ??? (z + 0) (feq_plusl ???? (opp_inverse ??))); + apply (ap_rewr ??? (z + (-x+x)) (plus_comm ? x (-x))); + apply (ap_rewr ??? (z + 0) (opp_inverse ??)); apply (ap_rewr ??? (0 + z) (plus_comm ???)); apply (ap_rewr ??? z (zero_neutral ??)); assumption]] @@ -130,7 +143,7 @@ qed. theorem eq_opp_plus_plus_opp_opp: ∀G:abelian_group.∀x,y:G. -(x+y) ≈ -x + -y. intros (G x y); apply (plus_cancr ??? (x+y)); -apply (eq_transitive ?? 0); [apply (opp_inverse ??)] +apply (eq_transitive ?? 0 ? (opp_inverse ??)); apply (eq_transitive ?? (-x + -y + x + y)); [2: apply (eq_symmetric ??? (plus_assoc ????))] apply (eq_transitive ?? (-y + -x + x + y)); [2: repeat apply feq_plusr; apply plus_comm] apply (eq_transitive ?? (-y + (-x + x) + y)); [2: apply feq_plusr; apply plus_assoc;] diff --git a/matita/dama/ordered_groups.ma b/matita/dama/ordered_groups.ma index fb4b29f0d..cff205ce9 100644 --- a/matita/dama/ordered_groups.ma +++ b/matita/dama/ordered_groups.ma @@ -43,62 +43,58 @@ lemma plus_cancr_le: 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_rewl ??? (x+(-z+z)) (opp_inverse ??)); +apply (le_rewl ??? (x+(z+ -z)) (plus_comm ??z)); +apply (le_rewl ??? (x+z+ -z) (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; +apply (le_rewr ??? (y+(-z+z)) (opp_inverse ??)); +apply (le_rewr ??? (y+(z+ -z)) (plus_comm ??z)); +apply (le_rewr ??? (y+z+ -z) (plus_assoc ????)); +apply (fle_plusr ??? (-z) L); 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_comm ? f h)); 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 ??? (f+(-h+h)) (plus_comm ? h (-h))); +apply (le_rewl ??? (f+0) (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_rewl ??? (f) (zero_neutral ??)); +apply (le_rewr ??? (g+h+ -h) (plus_comm ? h ?)); 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 ??? (g+(-h+h)) (plus_comm ??h)); +apply (le_rewr ??? (g+0) (opp_inverse ??)); apply (le_rewr ??? (0+g) (plus_comm ???)); -apply (le_rewr ??? (g) (eq_symmetric ??? (zero_neutral ??))); -assumption; +apply (le_rewr ??? (g) (zero_neutral ??) H); 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) (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) (opp_inverse ??)); apply (le_rewr ??? (-z+(z+y)) (plus_assoc ????)); -apply (fle_plusl ??? (-z)); -assumption; +apply (fle_plusl ??? (-z) L); qed. lemma le_zero_x_to_le_opp_x_zero: ∀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; +apply (le_rewl ??? 0 (opp_inverse ??)); +apply (le_rewr ??? x (zero_neutral ??) Px); qed. 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 ??))); +apply (le_rewr ??? 0 (opp_inverse ??)); +apply (le_rewl ??? x (zero_neutral ??)); assumption; qed. -- 2.39.2