From: Enrico Tassi Date: Mon, 3 Dec 2007 15:21:39 +0000 (+0000) Subject: 1 lemma left!!!! X-Git-Tag: make_still_working~5743 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=feaabb3c45906fafb4b6eb3fb10add6e6da6069b;p=helm.git 1 lemma left!!!! --- diff --git a/helm/software/matita/dama/classical_pointfree/ordered_sets.ma b/helm/software/matita/dama/classical_pointfree/ordered_sets.ma index 127bbf696..b42a8c44b 100644 --- a/helm/software/matita/dama/classical_pointfree/ordered_sets.ma +++ b/helm/software/matita/dama/classical_pointfree/ordered_sets.ma @@ -14,9 +14,9 @@ set "baseuri" "cic:/matita/classical_pointwise/ordered_sets/". -include "ordered_set.ma". +include "excedence.ma". -record is_dedekind_sigma_complete (O:ordered_set) : Type ≝ +record is_dedekind_sigma_complete (O:excedence) : Type ≝ { dsc_inf: ∀a:nat→O.∀m:O. is_lower_bound ? a m → ex ? (λs:O.is_inf O a s); dsc_inf_proof_irrelevant: ∀a:nat→O.∀m,m':O.∀p:is_lower_bound ? a m.∀p':is_lower_bound ? a m'. @@ -30,7 +30,7 @@ record is_dedekind_sigma_complete (O:ordered_set) : Type ≝ }. record dedekind_sigma_complete_ordered_set : Type ≝ - { dscos_ordered_set:> ordered_set; + { dscos_ordered_set:> excedence; dscos_dedekind_sigma_complete_properties:> is_dedekind_sigma_complete dscos_ordered_set }. @@ -155,7 +155,7 @@ lemma inf_respects_le: qed. definition is_sequentially_monotone ≝ - λO:ordered_set.λf:O→O. + λO:excedence.λf:O→O. ∀a:nat→O.∀p:is_increasing ? a. is_increasing ? (λi.f (a i)). diff --git a/helm/software/matita/dama/divisible_group.ma b/helm/software/matita/dama/divisible_group.ma new file mode 100644 index 000000000..5c7025a9c --- /dev/null +++ b/helm/software/matita/dama/divisible_group.ma @@ -0,0 +1,55 @@ +(**************************************************************************) +(* ___ *) +(* ||M|| *) +(* ||A|| A project by Andrea Asperti *) +(* ||T|| *) +(* ||I|| Developers: *) +(* ||T|| The HELM team. *) +(* ||A|| http://helm.cs.unibo.it *) +(* \ / *) +(* \ / This file is distributed under the terms of the *) +(* v GNU General Public License Version 2 *) +(* *) +(**************************************************************************) + +set "baseuri" "cic:/matita/divisible_group/". + +include "nat/orders.ma". +include "group.ma". + +let rec pow (G : abelian_group) (x : G) (n : nat) on n : G ≝ + match n with [ O ⇒ 0 | S m ⇒ x + pow ? x m]. + +interpretation "abelian group pow" 'exp x n = + (cic:/matita/divisible_group/pow.con _ x n). + +record dgroup : Type ≝ { + dg_carr:> abelian_group; + dg_prop: ∀x:dg_carr.∀n:nat.∃y.pow ? y (S n) ≈ x +}. + +lemma divide: ∀G:dgroup.G → nat → G. +intros (G x n); cases (dg_prop G x n); apply w; +qed. + +interpretation "divisible group divide" 'divide x n = + (cic:/matita/divisible_group/divide.con _ x n). + +lemma divide_divides: + ∀G:dgroup.∀x:G.∀n. pow ? (x / n) (S n) ≈ x. +intro G; cases G; unfold divide; intros (x n); simplify; +cases (f x n); simplify; exact H; +qed. + +lemma feq_pow: ∀G:dgroup.∀x,y:G.∀n.x≈y → pow ? x n ≈ pow ? y n. +intros (G x y n H); elim n; [apply eq_reflexive] +simplify; apply (Eq≈ (x + (pow ? y n1)) H1); +apply (Eq≈ (y+pow ? y n1) H (eq_reflexive ??)); +qed. + +lemma div1: ∀G:dgroup.∀x:G.x/O ≈ x. +intro G; cases G; unfold divide; intros; simplify; +cases (f x O); simplify; simplify in H; intro; apply H; +apply (ap_rewl ???? (plus_comm ???)); +apply (ap_rewl ???w (zero_neutral ??)); assumption; +qed. diff --git a/helm/software/matita/dama/excedence.ma b/helm/software/matita/dama/excedence.ma index ab7a53af0..1bddcb16e 100644 --- a/helm/software/matita/dama/excedence.ma +++ b/helm/software/matita/dama/excedence.ma @@ -86,7 +86,7 @@ intros (E); unfold; intros (x y Exy); unfold; unfold; intros (Ayx); apply Exy; apply ap_symmetric; assumption; qed. -lemma eq_sym:∀E:apartness.∀x,y:E.x ≈ y → y ≈ x := eq_sym_. +lemma eq_sym:∀E:apartness.∀x,y:E.x ≈ y → y ≈ x ≝ eq_sym_. coercion cic:/matita/excedence/eq_sym.con. @@ -206,12 +206,20 @@ whd in LE LEx APx; cases APx (EXx EXx); [cases (LEx EXx)] cases (exc_cotransitive ??? x EXx) (EXz EXz); [right; assumption] cases LE; assumption; qed. - lemma le_le_eq: ∀E:excedence.∀a,b:E. a ≤ b → b ≤ a → a ≈ b. intros (E x y L1 L2); intro H; cases H; [apply L1|apply L2] assumption; qed. +lemma eq_le_le: ∀E:excedence.∀a,b:E. a ≈ b → a ≤ b ∧ b ≤ a. +intros (E x y H); unfold apart_of_excedence in H; unfold apart in H; +simplify in H; split; intro; apply H; [left|right] assumption. +qed. + lemma ap_le_to_lt: ∀E:excedence.∀a,c:E.c # a → c ≤ a → c < a. intros; split; assumption; -qed. \ No newline at end of file +qed. + +definition total_order_property : ∀E:excedence. Type ≝ + λE:excedence. ∀a,b:E. a ≰ b → b < a. + diff --git a/helm/software/matita/dama/metric_lattice.ma b/helm/software/matita/dama/metric_lattice.ma index 81eab3137..ae55b5551 100644 --- a/helm/software/matita/dama/metric_lattice.ma +++ b/helm/software/matita/dama/metric_lattice.ma @@ -17,7 +17,7 @@ set "baseuri" "cic:/matita/metric_lattice/". include "metric_space.ma". include "lattice.ma". -record mlattice_ (R : ogroup) : Type ≝ { +record mlattice_ (R : todgroup) : Type ≝ { ml_mspace_: metric_space R; ml_lattice:> lattice; ml_with_: ms_carr ? ml_mspace_ = ap_carr (l_carr ml_lattice) @@ -33,12 +33,12 @@ qed. coercion cic:/matita/metric_lattice/ml_mspace.con. -record is_mlattice (R : ogroup) (ml: mlattice_ R) : Type ≝ { +record is_mlattice (R : todgroup) (ml: mlattice_ R) : Type ≝ { ml_prop1: ∀a,b:ml. 0 < δ a b → a # b; ml_prop2: ∀a,b,c:ml. δ (a∨b) (a∨c) + δ (a∧b) (a∧c) ≤ δ b c }. -record mlattice (R : ogroup) : Type ≝ { +record mlattice (R : todgroup) : Type ≝ { ml_carr :> mlattice_ R; ml_props:> is_mlattice R ml_carr }. @@ -103,40 +103,6 @@ qed. include "sequence.ma". include "nat/plus.ma". -definition d2s ≝ - λR.λml:mlattice R.λs:sequence (pordered_set_of_excedence ml).λk.λn. δ (s n) k. -(* -notation "s ⇝ 'Zero'" non associative with precedence 50 for @{'tends0 $s }. - -interpretation "tends to" 'tends s x = - (cic:/matita/sequence/tends0.con _ s). -*) - -lemma lew_opp : ∀O:ogroup.∀a,b,c:O.0 ≤ b → a ≤ c → a + -b ≤ c. -intros (O a b c L0 L); -apply (le_transitive ????? L); -apply (plus_cancl_le ??? (-a)); -apply (le_rewr ??? 0 (opp_inverse ??)); -apply (le_rewl ??? (-a+a+-b) (plus_assoc ????)); -apply (le_rewl ??? (0+-b) (opp_inverse ??)); -apply (le_rewl ??? (-b) (zero_neutral ?(-b))); -apply le_zero_x_to_le_opp_x_zero; -assumption; -qed. - - -lemma ltw_opp : ∀O:ogroup.∀a,b,c:O.0 < b → a < c → a + -b < c. -intros (O a b c P L); -apply (lt_transitive ????? L); -apply (plus_cancl_lt ??? (-a)); -apply (lt_rewr ??? 0 (opp_inverse ??)); -apply (lt_rewl ??? (-a+a+-b) (plus_assoc ????)); -apply (lt_rewl ??? (0+-b) (opp_inverse ??)); -apply (lt_rewl ??? ? (zero_neutral ??)); -apply lt_zero_x_to_lt_opp_x_zero; -assumption; -qed. - lemma ltwl: ∀a,b,c:nat. b + a < c → a < c. intros 3 (x y z); elim y (H z IH H); [apply H] apply IH; apply lt_S_to_lt; apply H; @@ -146,17 +112,31 @@ lemma ltwr: ∀a,b,c:nat. a + b < c → a < c. intros 3 (x y z); rewrite > sym_plus; apply ltwl; qed. + +definition d2s ≝ + λR.λml:mlattice R.λs:sequence ml.λk.λn. δ (s n) k. +(* +notation "s ⇝ 'Zero'" non associative with precedence 50 for @{'tends0 $s }. + +interpretation "tends to" 'tends s x = + (cic:/matita/sequence/tends0.con _ s). +*) + +axiom core1: ∀G:todgroup.∀e:G.0 Type; metric: ms_carr → ms_carr → R; mpositive: ∀a,b:ms_carr. 0 ≤ metric a b; @@ -34,7 +34,7 @@ interpretation "metric" 'delta = (cic:/matita/metric_space/metric.con _ _). definition apart_metric:= λR.λms:metric_space R.λa,b:ms.0 < δ a b. -lemma apart_of_metric_space: ∀R:ogroup.metric_space R → apartness. +lemma apart_of_metric_space: ∀R:todgroup.metric_space R → apartness. intros (R ms); apply (mk_apartness ? (apart_metric ? ms)); unfold apart_metric; unfold; [1: intros 2 (x H); cases H (H1 H2); lapply (ap_rewr ???? (eq_sym ??? (mreflexive ??x)) H2); diff --git a/helm/software/matita/dama/ordered_divisible_group.ma b/helm/software/matita/dama/ordered_divisible_group.ma new file mode 100644 index 000000000..34bd25a23 --- /dev/null +++ b/helm/software/matita/dama/ordered_divisible_group.ma @@ -0,0 +1,70 @@ +(**************************************************************************) +(* ___ *) +(* ||M|| *) +(* ||A|| A project by Andrea Asperti *) +(* ||T|| *) +(* ||I|| Developers: *) +(* ||T|| The HELM team. *) +(* ||A|| http://helm.cs.unibo.it *) +(* \ / *) +(* \ / This file is distributed under the terms of the *) +(* v GNU General Public License Version 2 *) +(* *) +(**************************************************************************) + +set "baseuri" "cic:/matita/ordered_divisible_group/". + +include "nat/orders.ma". +include "nat/times.ma". +include "ordered_group.ma". +include "divisible_group.ma". + +record todgroup : Type ≝ { + todg_order:> togroup; + todg_division_: dgroup; + todg_with_: dg_carr todg_division_ = og_abelian_group todg_order +}. + +lemma todg_division: todgroup → dgroup. +intro G; apply (mk_dgroup G); unfold abelian_group_OF_todgroup; +cases (todg_with_ G); exact (dg_prop (todg_division_ G)); +qed. + +coercion cic:/matita/ordered_divisible_group/todg_division.con. + +lemma pow_lt: ∀G:todgroup.∀x:G.∀n.0 < x → 0 < x + pow ? x n. +intros (G x n H); elim n; [ + simplify; apply (lt_rewr ???? (plus_comm ???)); + apply (lt_rewr ???x (zero_neutral ??)); assumption] +simplify; apply (lt_transitive ?? (x+(x)\sup(n1))); [assumption] +apply flt_plusl; apply (lt_rewr ???? (plus_comm ???)); +apply (lt_rewl ??? (0 + (x \sup n1)) (eq_sym ??? (zero_neutral ??))); +apply (lt_rewl ???? (plus_comm ???)); +apply flt_plusl; assumption; +qed. + +lemma pow_ge: ∀G:todgroup.∀x:G.∀n.0 ≤ x → 0 ≤ pow ? x n. +intros (G x n); elim n; simplify; [apply le_reflexive] +apply (le_transitive ???? H1); +apply (le_rewl ??? (0+(x\sup n1)) (zero_neutral ??)); +apply fle_plusr; assumption; +qed. + +lemma ge_pow: ∀G:todgroup.∀x:G.∀n.0 < pow ? x n → 0 < x. +intros 3; elim n; [ + simplify in l; cases (lt_coreflexive ?? l);] +simplify in l; +cut (0+0 tordered_set; - og_with: carr og_abelian_group_ = og_tordered_set + og_excedence:> excedence; + og_with: carr og_abelian_group_ = apart_of_excedence og_excedence }. -lemma og_abelian_group: pre_ogroup → abelian_group. +lemma og_abelian_group: pogroup_ → 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; +unfold apartness_OF_pogroup_; 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_gorup/og_abelian_group.con. +coercion cic:/matita/ordered_group/og_abelian_group.con. -record ogroup : Type ≝ { - og_carr:> pre_ogroup; - exc_canc_plusr: ∀f,g,h:og_carr. f+h ≰ g+h → f ≰ g +record pogroup : Type ≝ { + og_carr:> pogroup_; + canc_plusr_exc: ∀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)); + ∀G:pogroup.∀x,y,z:G. x ≰ y → x+z ≰ y + z. +intros 5 (G x y z L); apply (canc_plusr_exc ??? (-z)); apply (Ex≪ (x + (z + -z)) (plus_assoc ????)); apply (Ex≪ (x + (-z + z)) (plus_comm ??z)); apply (Ex≪ (x+0) (opp_inverse ??)); @@ -52,17 +51,17 @@ apply (Ex≫ (0+y) (plus_comm ???)); apply (Ex≫ y (zero_neutral ??) L); qed. -coercion cic:/matita/ordered_gorup/fexc_plusr.con nocomposites. +coercion cic:/matita/ordered_group/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); +lemma canc_plusl_exc: ∀G:pogroup.∀f,g,h:G. h+f ≰ h+g → f ≰ g. +intros 5 (G x y z L); apply (canc_plusr_exc ??? z); apply (exc_rewl ??? (z+x) (plus_comm ???)); apply (exc_rewr ??? (z+y) (plus_comm ???) L); qed. lemma fexc_plusl: - ∀G:ogroup.∀x,y,z:G. x ≰ y → z+x ≰ z+y. -intros 5 (G x y z L); apply (exc_canc_plusl ??? (-z)); + ∀G:pogroup.∀x,y,z:G. x ≰ y → z+x ≰ z+y. +intros 5 (G x y z L); apply (canc_plusl_exc ??? (-z)); apply (exc_rewl ???? (plus_assoc ??z x)); apply (exc_rewr ???? (plus_assoc ??z y)); apply (exc_rewl ??? (0+x) (opp_inverse ??)); @@ -71,10 +70,10 @@ apply (exc_rewl ???? (zero_neutral ??)); apply (exc_rewr ???? (zero_neutral ??) L); qed. -coercion cic:/matita/ordered_gorup/fexc_plusl.con nocomposites. +coercion cic:/matita/ordered_group/fexc_plusl.con nocomposites. lemma plus_cancr_le: - ∀G:ogroup.∀x,y,z:G.x+z ≤ y + z → x ≤ y. + ∀G:pogroup.∀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 ???)); @@ -86,10 +85,10 @@ apply (le_rewr ??? (y+0) (plus_comm ???)); 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 ????)); -intro H; apply L; clear L; apply (exc_canc_plusr ??? (-z) H); +intro H; apply L; clear L; apply (canc_plusr_exc ??? (-z) H); qed. -lemma fle_plusl: ∀G:ogroup. ∀f,g,h:G. f≤g → h+f≤h+g. +lemma fle_plusl: ∀G:pogroup. ∀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) (plus_comm ? f h)); @@ -106,13 +105,13 @@ apply (le_rewr ??? (0+g) (plus_comm ???)); apply (le_rewr ??? (g) (zero_neutral ??) H); qed. -lemma fle_plusr: ∀G:ogroup. ∀f,g,h:G. f≤g → f+h≤g+h. +lemma fle_plusr: ∀G:pogroup. ∀f,g,h:G. f≤g → f+h≤g+h. intros (G f g h H); apply (le_rewl ???? (plus_comm ???)); apply (le_rewr ???? (plus_comm ???)); apply fle_plusl; assumption; qed. lemma plus_cancl_le: - ∀G:ogroup.∀x,y,z:G.z+x ≤ z+y → x ≤ y. + ∀G:pogroup.∀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) (opp_inverse ??)); @@ -124,50 +123,50 @@ apply (fle_plusl ??? (-z) L); qed. lemma plus_cancl_lt: - ∀G:ogroup.∀x,y,z:G.z+x < z+y → x < y. + ∀G:pogroup.∀x,y,z:G.z+x < z+y → x < y. intros 5 (G x y z L); elim L (A LE); split; [apply plus_cancl_le; assumption] apply (plus_cancl_ap ???? LE); qed. lemma plus_cancr_lt: - ∀G:ogroup.∀x,y,z:G.x+z < y+z → x < y. + ∀G:pogroup.∀x,y,z:G.x+z < y+z → x < y. intros 5 (G x y z L); elim L (A LE); split; [apply plus_cancr_le; assumption] apply (plus_cancr_ap ???? LE); qed. lemma exc_opp_x_zero_to_exc_zero_x: - ∀G:ogroup.∀x:G.-x ≰ 0 → 0 ≰ x. -intros (G x H); apply (exc_canc_plusr ??? (-x)); + ∀G:pogroup.∀x:G.-x ≰ 0 → 0 ≰ x. +intros (G x H); apply (canc_plusr_exc ??? (-x)); apply (exc_rewr ???? (plus_comm ???)); apply (exc_rewr ???? (opp_inverse ??)); apply (exc_rewl ???? (zero_neutral ??) H); qed. lemma le_zero_x_to_le_opp_x_zero: - ∀G:ogroup.∀x:G.0 ≤ x → -x ≤ 0. + ∀G:pogroup.∀x:G.0 ≤ x → -x ≤ 0. intros (G x Px); apply (plus_cancr_le ??? x); apply (le_rewl ??? 0 (opp_inverse ??)); apply (le_rewr ??? x (zero_neutral ??) Px); qed. lemma lt_zero_x_to_lt_opp_x_zero: - ∀G:ogroup.∀x:G.0 < x → -x < 0. + ∀G:pogroup.∀x:G.0 < x → -x < 0. intros (G x Px); apply (plus_cancr_lt ??? x); apply (lt_rewl ??? 0 (opp_inverse ??)); apply (lt_rewr ??? x (zero_neutral ??) Px); qed. lemma exc_zero_opp_x_to_exc_x_zero: - ∀G:ogroup.∀x:G. 0 ≰ -x → x ≰ 0. -intros (G x H); apply (exc_canc_plusl ??? (-x)); + ∀G:pogroup.∀x:G. 0 ≰ -x → x ≰ 0. +intros (G x H); apply (canc_plusl_exc ??? (-x)); apply (exc_rewr ???? (plus_comm ???)); apply (exc_rewl ???? (opp_inverse ??)); apply (exc_rewr ???? (zero_neutral ??) H); qed. lemma le_x_zero_to_le_zero_opp_x: - ∀G:ogroup.∀x:G. x ≤ 0 → 0 ≤ -x. + ∀G:pogroup.∀x:G. x ≤ 0 → 0 ≤ -x. intros (G x Lx0); apply (plus_cancr_le ??? x); apply (le_rewr ??? 0 (opp_inverse ??)); apply (le_rewl ??? x (zero_neutral ??)); @@ -175,7 +174,7 @@ assumption; qed. lemma lt_x_zero_to_lt_zero_opp_x: - ∀G:ogroup.∀x:G. x < 0 → 0 < -x. + ∀G:pogroup.∀x:G. x < 0 → 0 < -x. intros (G x Lx0); apply (plus_cancr_lt ??? x); apply (lt_rewr ??? 0 (opp_inverse ??)); apply (lt_rewl ??? x (zero_neutral ??)); @@ -184,7 +183,7 @@ qed. lemma lt0plus_orlt: - ∀G:ogroup. ∀x,y:G. 0 ≤ x → 0 ≤ y → 0 < x + y → 0 < x ∨ 0 < y. + ∀G:pogroup. ∀x,y:G. 0 ≤ x → 0 ≤ y → 0 < x + y → 0 < x ∨ 0 < y. intros (G x y LEx LEy LT); cases LT (H1 H2); cases (ap_cotransitive ??? y H2); [right; split; assumption|left;split;[assumption]] apply (plus_cancr_ap ??? y); apply (ap_rewl ???? (zero_neutral ??)); @@ -192,7 +191,7 @@ assumption; qed. lemma le0plus_le: - ∀G:ogroup.∀a,b,c:G. 0 ≤ b → a + b ≤ c → a ≤ c. + ∀G:pogroup.∀a,b,c:G. 0 ≤ b → a + b ≤ c → a ≤ c. intros (G a b c L H); apply (le_transitive ????? H); apply (plus_cancl_le ??? (-a)); apply (le_rewl ??? 0 (opp_inverse ??)); @@ -203,7 +202,7 @@ assumption; qed. lemma le_le0plus: - ∀G:ogroup.∀a,b:G. 0 ≤ a → 0 ≤ b → 0 ≤ a + b. + ∀G:pogroup.∀a,b:G. 0 ≤ a → 0 ≤ b → 0 ≤ a + b. intros (G a b L1 L2); apply (le_transitive ???? L1); apply (plus_cancl_le ??? (-a)); apply (le_rewl ??? 0 (opp_inverse ??)); @@ -213,5 +212,101 @@ apply (le_rewr ??? b (zero_neutral ??)); assumption; qed. - - \ No newline at end of file +lemma flt_plusl: + ∀G:pogroup.∀x,y,z:G.x < y → z + x < z + y. +intros (G x y z H); cases H; split; [apply fle_plusl; assumption] +apply fap_plusl; assumption; +qed. + +lemma flt_plusr: + ∀G:pogroup.∀x,y,z:G.x < y → x + z < y + z. +intros (G x y z H); cases H; split; [apply fle_plusr; assumption] +apply fap_plusr; assumption; +qed. + + +lemma ltxy_ltyyxx: ∀G:pogroup.∀x,y:G. y < x → y+y < x+x. +intros; apply (lt_transitive ?? (y+x));[2: + apply (lt_rewl ???? (plus_comm ???)); + apply (lt_rewr ???? (plus_comm ???));] +apply flt_plusl;assumption; +qed. + +lemma lew_opp : ∀O:pogroup.∀a,b,c:O.0 ≤ b → a ≤ c → a + -b ≤ c. +intros (O a b c L0 L); +apply (le_transitive ????? L); +apply (plus_cancl_le ??? (-a)); +apply (le_rewr ??? 0 (opp_inverse ??)); +apply (le_rewl ??? (-a+a+-b) (plus_assoc ????)); +apply (le_rewl ??? (0+-b) (opp_inverse ??)); +apply (le_rewl ??? (-b) (zero_neutral ?(-b))); +apply le_zero_x_to_le_opp_x_zero; +assumption; +qed. + +lemma ltw_opp : ∀O:pogroup.∀a,b,c:O.0 < b → a < c → a + -b < c. +intros (O a b c P L); +apply (lt_transitive ????? L); +apply (plus_cancl_lt ??? (-a)); +apply (lt_rewr ??? 0 (opp_inverse ??)); +apply (lt_rewl ??? (-a+a+-b) (plus_assoc ????)); +apply (lt_rewl ??? (0+-b) (opp_inverse ??)); +apply (lt_rewl ??? ? (zero_neutral ??)); +apply lt_zero_x_to_lt_opp_x_zero; +assumption; +qed. + +record togroup : Type ≝ { + tog_carr:> pogroup; + tog_total: ∀x,y:tog_carr.x≰y → y < x +}. + +lemma lexxyy_lexy: ∀G:togroup. ∀x,y:G. x+x ≤ y+y → x ≤ y. +intros (G x y H); intro H1; lapply (tog_total ??? H1) as H2; +lapply (ltxy_ltyyxx ??? H2) as H3; lapply (lt_to_excede ??? H3) as H4; +cases (H H4); +qed. + +lemma eqxxyy_eqxy: ∀G:togroup.∀x,y:G. x + x ≈ y + y → x ≈ y. +intros (G x y H); cases (eq_le_le ??? H); apply le_le_eq; +apply lexxyy_lexy; assumption; +qed. + +lemma bar: ∀G:abelian_group. ∀x,y:G. 0 # x + y → 0 #x ∨ 0#y. +intros; cases (ap_cotransitive ??? y a); [right; assumption] +left; apply (plus_cancr_ap ??? y); apply (ap_rewl ???y (zero_neutral ??)); +assumption; +qed. + +lemma pippo: ∀G:pogroup.∀a,b,c,d:G. a < b → c < d → a+c < b + d. +intros (G a b c d H1 H2); +lapply (flt_plusr ??? c H1) as H3; +apply (lt_transitive ???? H3); +apply flt_plusl; assumption; +qed. + +lemma pippo2: ∀G:pogroup.∀a,b,c,d:G. a+c ≰ b + d → a ≰ b ∨ c ≰ d. +intros (G a b c d H1 H2); +cases (exc_cotransitive ??? (a + d) H1); [ + right; apply (canc_plusl_exc ??? a); assumption] +left; apply (canc_plusr_exc ??? d); assumption; +qed. + +lemma pippo3: ∀G:pogroup.∀a,b,c,d:G. a ≤ b → c ≤ d → a+c ≤ b + d. +intros (G a b c d H1 H2); intro H3; cases (pippo2 ????? H3); +[apply H1|apply H2] assumption; +qed. + +lemma foo: ∀G:togroup.∀x,y:G. 0 ≤ x + y → x < 0 → 0 ≤ y. +intros; intro; apply H; lapply (lt_to_excede ??? l); +lapply (tog_total ??? e); +lapply (tog_total ??? Hletin); +lapply (pippo ????? Hletin2 Hletin1); +apply (exc_rewl ??? (0+0)); [apply eq_sym; apply zero_neutral] +apply lt_to_excede; assumption; +qed. + +lemma pippo4: ∀G:togroup.∀a,b,c,d:G. a+c < b + d → a < b ∨ c < d. +intros (G a b c d H1 H2); lapply (lt_to_excede ??? H1); +cases (pippo2 ????? Hletin); [left|right] apply tog_total; assumption; +qed. diff --git a/helm/software/matita/dama/ordered_set.ma b/helm/software/matita/dama/ordered_set.ma deleted file mode 100644 index 7178bd9a7..000000000 --- a/helm/software/matita/dama/ordered_set.ma +++ /dev/null @@ -1,47 +0,0 @@ -(**************************************************************************) -(* ___ *) -(* ||M|| *) -(* ||A|| A project by Andrea Asperti *) -(* ||T|| *) -(* ||I|| Developers: *) -(* ||T|| The HELM team. *) -(* ||A|| http://helm.cs.unibo.it *) -(* \ / *) -(* \ / This file is distributed under the terms of the *) -(* v GNU General Public License Version 2 *) -(* *) -(**************************************************************************) - -set "baseuri" "cic:/matita/ordered_set/". - -include "excedence.ma". - -record is_porder_relation (C:Type) (le:C→C→Prop) (eq:C→C→Prop) : Type ≝ { - por_reflexive: reflexive ? le; - por_transitive: transitive ? le; - por_antisimmetric: antisymmetric ? le eq -}. - -record pordered_set: Type ≝ { - pos_carr:> excedence; - pos_order_relation_properties:> is_porder_relation ? (le pos_carr) (eq pos_carr) -}. - -lemma pordered_set_of_excedence: excedence → pordered_set. -intros (E); apply (mk_pordered_set E); apply (mk_is_porder_relation); -[apply le_reflexive|apply le_transitive|apply le_antisymmetric] -qed. - -coercion cic:/matita/ordered_set/pordered_set_of_excedence.con. - -alias id "transitive" = "cic:/matita/higher_order_defs/relations/transitive.con". -alias id "cotransitive" = "cic:/matita/higher_order_defs/relations/cotransitive.con". -alias id "antisymmetric" = "cic:/matita/higher_order_defs/relations/antisymmetric.con". - -definition total_order_property : ∀E:excedence. Type ≝ - λE:excedence. ∀a,b:E. a ≰ b → b < a. - -record tordered_set : Type ≝ { - tos_poset:> pordered_set; - tos_totality: total_order_property tos_poset -}. diff --git a/helm/software/matita/dama/sequence.ma b/helm/software/matita/dama/sequence.ma index 40e2f477a..c26ae5721 100644 --- a/helm/software/matita/dama/sequence.ma +++ b/helm/software/matita/dama/sequence.ma @@ -14,46 +14,46 @@ set "baseuri" "cic:/matita/sequence/". -include "ordered_set.ma". +include "excedence.ma". -definition sequence := λO:pordered_set.nat → O. +definition sequence := λO:excedence.nat → O. -definition fun_of_sequence: ∀O:pordered_set.sequence O → nat → O. +definition fun_of_sequence: ∀O:excedence.sequence O → nat → O. intros; apply s; assumption; qed. coercion cic:/matita/sequence/fun_of_sequence.con 1. definition upper_bound ≝ - λO:pordered_set.λa:sequence O.λu:O.∀n:nat.a n ≤ u. + λO:excedence.λa:sequence O.λu:O.∀n:nat.a n ≤ u. definition lower_bound ≝ - λO:pordered_set.λa:sequence O.λu:O.∀n:nat.u ≤ a n. + λO:excedence.λa:sequence O.λu:O.∀n:nat.u ≤ a n. definition strong_sup ≝ - λO:pordered_set.λs:sequence O.λx. + λO:excedence.λs:sequence O.λx. upper_bound ? s x ∧ (∀y:O.x ≰ y → ∃n.s n ≰ y). definition strong_inf ≝ - λO:pordered_set.λs:sequence O.λx. + λO:excedence.λs:sequence O.λx. lower_bound ? s x ∧ (∀y:O.y ≰ x → ∃n.y ≰ s n). definition weak_sup ≝ - λO:pordered_set.λs:sequence O.λx. + λO:excedence.λs:sequence O.λx. upper_bound ? s x ∧ (∀y:O.upper_bound ? s y → x ≤ y). definition weak_inf ≝ - λO:pordered_set.λs:sequence O.λx. + λO:excedence.λs:sequence O.λx. lower_bound ? s x ∧ (∀y:O.lower_bound ? s y → y ≤ x). lemma strong_sup_is_weak: - ∀O:pordered_set.∀s:sequence O.∀x:O.strong_sup ? s x → weak_sup ? s x. + ∀O:excedence.∀s:sequence O.∀x:O.strong_sup ? s x → weak_sup ? s x. intros (O s x Ssup); elim Ssup (Ubx M); clear Ssup; split; [assumption] intros 3 (y Uby E); cases (M ? E) (n En); unfold in Uby; cases (Uby ? En); qed. lemma strong_inf_is_weak: - ∀O:pordered_set.∀s:sequence O.∀x:O.strong_inf ? s x → weak_inf ? s x. + ∀O:excedence.∀s:sequence O.∀x:O.strong_inf ? s x → weak_inf ? s x. intros (O s x Ssup); elim Ssup (Ubx M); clear Ssup; split; [assumption] intros 3 (y Uby E); cases (M ? E) (n En); unfold in Uby; cases (Uby ? En); qed. @@ -62,92 +62,92 @@ include "ordered_group.ma". include "nat/orders.ma". definition tends0 ≝ - λO:ogroup.λs:sequence O. + λO:pogroup.λs:sequence O. ∀e:O.0 < e → ∃N.∀n.N < n → -e < s n ∧ s n < e. definition increasing ≝ - λO:pordered_set.λa:sequence O.∀n:nat.a n ≤ a (S n). + λO:excedence.λa:sequence O.∀n:nat.a n ≤ a (S n). definition decreasing ≝ - λO:pordered_set.λa:sequence O.∀n:nat.a (S n) ≤ a n. + λO:excedence.λa:sequence O.∀n:nat.a (S n) ≤ a n. (* -definition is_upper_bound ≝ λO:pordered_set.λa:sequence O.λu:O.∀n:nat.a n ≤ u. -definition is_lower_bound ≝ λO:pordered_set.λa:sequence O.λu:O.∀n:nat.u ≤ a n. +definition is_upper_bound ≝ λO:excedence.λa:sequence O.λu:O.∀n:nat.a n ≤ u. +definition is_lower_bound ≝ λO:excedence.λa:sequence O.λu:O.∀n:nat.u ≤ a n. -record is_sup (O:pordered_set) (a:sequence O) (u:O) : Prop ≝ +record is_sup (O:excedence) (a:sequence O) (u:O) : Prop ≝ { sup_upper_bound: is_upper_bound O a u; sup_least_upper_bound: ∀v:O. is_upper_bound O a v → u≤v }. -record is_inf (O:pordered_set) (a:sequence O) (u:O) : Prop ≝ +record is_inf (O:excedence) (a:sequence O) (u:O) : Prop ≝ { inf_lower_bound: is_lower_bound O a u; inf_greatest_lower_bound: ∀v:O. is_lower_bound O a v → v≤u }. -record is_bounded_below (O:pordered_set) (a:sequence O) : Type ≝ +record is_bounded_below (O:excedence) (a:sequence O) : Type ≝ { ib_lower_bound: O; ib_lower_bound_is_lower_bound: is_lower_bound ? a ib_lower_bound }. -record is_bounded_above (O:pordered_set) (a:sequence O) : Type ≝ +record is_bounded_above (O:excedence) (a:sequence O) : Type ≝ { ib_upper_bound: O; ib_upper_bound_is_upper_bound: is_upper_bound ? a ib_upper_bound }. -record is_bounded (O:pordered_set) (a:sequence O) : Type ≝ +record is_bounded (O:excedence) (a:sequence O) : Type ≝ { ib_bounded_below:> is_bounded_below ? a; ib_bounded_above:> is_bounded_above ? a }. -record bounded_below_sequence (O:pordered_set) : Type ≝ +record bounded_below_sequence (O:excedence) : Type ≝ { bbs_seq:> sequence O; bbs_is_bounded_below:> is_bounded_below ? bbs_seq }. -record bounded_above_sequence (O:pordered_set) : Type ≝ +record bounded_above_sequence (O:excedence) : Type ≝ { bas_seq:> sequence O; bas_is_bounded_above:> is_bounded_above ? bas_seq }. -record bounded_sequence (O:pordered_set) : Type ≝ +record bounded_sequence (O:excedence) : Type ≝ { bs_seq:> sequence O; bs_is_bounded_below: is_bounded_below ? bs_seq; bs_is_bounded_above: is_bounded_above ? bs_seq }. definition bounded_below_sequence_of_bounded_sequence ≝ - λO:pordered_set.λb:bounded_sequence O. + λO:excedence.λb:bounded_sequence O. mk_bounded_below_sequence ? b (bs_is_bounded_below ? b). coercion cic:/matita/sequence/bounded_below_sequence_of_bounded_sequence.con. definition bounded_above_sequence_of_bounded_sequence ≝ - λO:pordered_set.λb:bounded_sequence O. + λO:excedence.λb:bounded_sequence O. mk_bounded_above_sequence ? b (bs_is_bounded_above ? b). coercion cic:/matita/sequence/bounded_above_sequence_of_bounded_sequence.con. definition lower_bound ≝ - λO:pordered_set.λb:bounded_below_sequence O. + λO:excedence.λb:bounded_below_sequence O. ib_lower_bound ? b (bbs_is_bounded_below ? b). lemma lower_bound_is_lower_bound: - ∀O:pordered_set.∀b:bounded_below_sequence O. + ∀O:excedence.∀b:bounded_below_sequence O. is_lower_bound ? b (lower_bound ? b). intros; unfold lower_bound; apply ib_lower_bound_is_lower_bound. qed. definition upper_bound ≝ - λO:pordered_set.λb:bounded_above_sequence O. + λO:excedence.λb:bounded_above_sequence O. ib_upper_bound ? b (bas_is_bounded_above ? b). lemma upper_bound_is_upper_bound: - ∀O:pordered_set.∀b:bounded_above_sequence O. + ∀O:excedence.∀b:bounded_above_sequence O. is_upper_bound ? b (upper_bound ? b). intros; unfold upper_bound; apply ib_upper_bound_is_upper_bound. qed. @@ -159,76 +159,76 @@ cases E (T f cRf cTf); simplify; |2: intros (x y z); apply Or_symmetric; apply cTf; assumption;] qed. -definition reverse_pordered_set: pordered_set → pordered_set. -intros (p); apply (mk_pordered_set (reverse_excedence p)); +definition reverse_excedence: excedence → excedence. +intros (p); apply (mk_excedence (reverse_excedence p)); generalize in match (reverse_excedence p); intros (E); apply mk_is_porder_relation; [apply le_reflexive|apply le_transitive|apply le_antisymmetric] qed. lemma is_lower_bound_reverse_is_upper_bound: - ∀O:pordered_set.∀a:sequence O.∀l:O. - is_lower_bound O a l → is_upper_bound (reverse_pordered_set O) a l. -intros (O a l H); unfold; intros (n); unfold reverse_pordered_set; + ∀O:excedence.∀a:sequence O.∀l:O. + is_lower_bound O a l → is_upper_bound (reverse_excedence O) a l. +intros (O a l H); unfold; intros (n); unfold reverse_excedence; unfold reverse_excedence; simplify; fold unfold le (le ? l (a n)); apply H; qed. lemma is_upper_bound_reverse_is_lower_bound: - ∀O:pordered_set.∀a:sequence O.∀l:O. - is_upper_bound O a l → is_lower_bound (reverse_pordered_set O) a l. -intros (O a l H); unfold; intros (n); unfold reverse_pordered_set; + ∀O:excedence.∀a:sequence O.∀l:O. + is_upper_bound O a l → is_lower_bound (reverse_excedence O) a l. +intros (O a l H); unfold; intros (n); unfold reverse_excedence; unfold reverse_excedence; simplify; fold unfold le (le ? (a n) l); apply H; qed. lemma reverse_is_lower_bound_is_upper_bound: - ∀O:pordered_set.∀a:sequence O.∀l:O. - is_lower_bound (reverse_pordered_set O) a l → is_upper_bound O a l. -intros (O a l H); unfold; intros (n); unfold reverse_pordered_set in H; + ∀O:excedence.∀a:sequence O.∀l:O. + is_lower_bound (reverse_excedence O) a l → is_upper_bound O a l. +intros (O a l H); unfold; intros (n); unfold reverse_excedence in H; unfold reverse_excedence in H; simplify in H; apply H; qed. lemma reverse_is_upper_bound_is_lower_bound: - ∀O:pordered_set.∀a:sequence O.∀l:O. - is_upper_bound (reverse_pordered_set O) a l → is_lower_bound O a l. -intros (O a l H); unfold; intros (n); unfold reverse_pordered_set in H; + ∀O:excedence.∀a:sequence O.∀l:O. + is_upper_bound (reverse_excedence O) a l → is_lower_bound O a l. +intros (O a l H); unfold; intros (n); unfold reverse_excedence in H; unfold reverse_excedence in H; simplify in H; apply H; qed. lemma is_inf_to_reverse_is_sup: - ∀O:pordered_set.∀a:bounded_below_sequence O.∀l:O. - is_inf O a l → is_sup (reverse_pordered_set O) a l. -intros (O a l H); apply (mk_is_sup (reverse_pordered_set O)); + ∀O:excedence.∀a:bounded_below_sequence O.∀l:O. + is_inf O a l → is_sup (reverse_excedence O) a l. +intros (O a l H); apply (mk_is_sup (reverse_excedence O)); [1: apply is_lower_bound_reverse_is_upper_bound; apply inf_lower_bound; assumption -|2: unfold reverse_pordered_set; simplify; unfold reverse_excedence; simplify; +|2: unfold reverse_excedence; simplify; unfold reverse_excedence; simplify; intros (m H1); apply (inf_greatest_lower_bound ? ? ? H); apply H1;] qed. lemma is_sup_to_reverse_is_inf: - ∀O:pordered_set.∀a:bounded_above_sequence O.∀l:O. - is_sup O a l → is_inf (reverse_pordered_set O) a l. -intros (O a l H); apply (mk_is_inf (reverse_pordered_set O)); + ∀O:excedence.∀a:bounded_above_sequence O.∀l:O. + is_sup O a l → is_inf (reverse_excedence O) a l. +intros (O a l H); apply (mk_is_inf (reverse_excedence O)); [1: apply is_upper_bound_reverse_is_lower_bound; apply sup_upper_bound; assumption -|2: unfold reverse_pordered_set; simplify; unfold reverse_excedence; simplify; +|2: unfold reverse_excedence; simplify; unfold reverse_excedence; simplify; intros (m H1); apply (sup_least_upper_bound ? ? ? H); apply H1;] qed. lemma reverse_is_sup_to_is_inf: - ∀O:pordered_set.∀a:bounded_above_sequence O.∀l:O. - is_sup (reverse_pordered_set O) a l → is_inf O a l. + ∀O:excedence.∀a:bounded_above_sequence O.∀l:O. + is_sup (reverse_excedence O) a l → is_inf O a l. intros (O a l H); apply mk_is_inf; [1: apply reverse_is_upper_bound_is_lower_bound; - apply (sup_upper_bound (reverse_pordered_set O)); assumption -|2: intros (v H1); apply (sup_least_upper_bound (reverse_pordered_set O) a l H v); + apply (sup_upper_bound (reverse_excedence O)); assumption +|2: intros (v H1); apply (sup_least_upper_bound (reverse_excedence O) a l H v); apply is_lower_bound_reverse_is_upper_bound; assumption;] qed. lemma reverse_is_inf_to_is_sup: - ∀O:pordered_set.∀a:bounded_above_sequence O.∀l:O. - is_inf (reverse_pordered_set O) a l → is_sup O a l. + ∀O:excedence.∀a:bounded_above_sequence O.∀l:O. + is_inf (reverse_excedence O) a l → is_sup O a l. intros (O a l H); apply mk_is_sup; [1: apply reverse_is_lower_bound_is_upper_bound; - apply (inf_lower_bound (reverse_pordered_set O)); assumption -|2: intros (v H1); apply (inf_greatest_lower_bound (reverse_pordered_set O) a l H v); + apply (inf_lower_bound (reverse_excedence O)); assumption +|2: intros (v H1); apply (inf_greatest_lower_bound (reverse_excedence O) a l H v); apply is_upper_bound_reverse_is_lower_bound; assumption;] qed.