X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fmatita%2Fdama%2Fexcedence.ma;h=fa6848e120314b987eaa0f61bf81cec57d42dea6;hb=c0f86a886451a0df3b42a1435e21b5def9f34792;hp=c2a5ffd4fde20049391060de83b85f2cd22cf310;hpb=6abaacea86e652ea0dc7cd2f8ab04005251532cb;p=helm.git diff --git a/helm/software/matita/dama/excedence.ma b/helm/software/matita/dama/excedence.ma index c2a5ffd4f..fa6848e12 100644 --- a/helm/software/matita/dama/excedence.ma +++ b/helm/software/matita/dama/excedence.ma @@ -52,9 +52,11 @@ record apartness : Type ≝ { }. notation "a break # b" non associative with precedence 50 for @{ 'apart $a $b}. -interpretation "axiomatic apartness" 'apart x y = +interpretation "apartness" 'apart x y = (cic:/matita/excedence/ap_apart.con _ x y). +definition strong_ext ≝ λA:apartness.λop:A→A.∀x,y. op x # op y → x # y. + definition apart ≝ λE:excedence.λa,b:E. a ≰ b ∨ b ≰ a. definition apart_of_excedence: excedence → apartness. @@ -84,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. @@ -94,9 +96,17 @@ intros 6 (E x y z Exy Eyz); intro Axy; cases (ap_cotransitive ???y Axy); [apply Exy|apply Eyz] assumption. qed. -lemma eq_trans:∀E:apartness.∀x,y,z:E.x ≈ y → y ≈ z → x ≈ z ≝ eq_trans_. +lemma eq_trans:∀E:apartness.∀x,z,y:E.x ≈ y → y ≈ z → x ≈ z ≝ + λE,x,y,z.eq_trans_ E x z y. + +notation > "'Eq'≈" non associative with precedence 50 for + @{'eqrewrite}. + +interpretation "eq_rew" 'eqrewrite = + (cic:/matita/excedence/eq_trans.con _ _ _). (* BUG: vedere se ricapita *) +alias id "antisymmetric" = "cic:/matita/constructive_higher_order_relations/antisymmetric.con". lemma le_antisymmetric: ∀E.antisymmetric ? (le E) (eq ?). intros 5 (E x y Lxy Lyx); intro H; cases H; [apply Lxy;|apply Lyx] assumption; @@ -136,11 +146,23 @@ intros (E z y x Exy Lxz); apply (le_transitive ???? ? Lxz); intro Xyz; apply Exy; apply unfold_apart; right; assumption; qed. +notation > "'Ex'≪" non associative with precedence 50 for + @{'excedencerewritel}. + +interpretation "exc_rewl" 'excedencerewritel = + (cic:/matita/excedence/exc_rewl.con _ _ _). + lemma le_rewr: ∀E:excedence.∀z,y,x:E. x ≈ y → z ≤ x → z ≤ y. intros (E z y x Exy Lxz); apply (le_transitive ???? Lxz); intro Xyz; apply Exy; apply unfold_apart; left; assumption; qed. + +notation > "'Ex'≫" non associative with precedence 50 for + @{'excedencerewriter}. +interpretation "exc_rewr" 'excedencerewriter = + (cic:/matita/excedence/exc_rewr.con _ _ _). + lemma ap_rewl: ∀A:apartness.∀x,z,y:A. x ≈ y → y # z → x # z. intros (A x z y Exy Ayz); cases (ap_cotransitive ???x Ayz); [2:assumption] cases (Exy (ap_symmetric ??? a)); @@ -160,3 +182,44 @@ lemma exc_rewr: ∀A:excedence.∀x,z,y:A. x ≈ y → z ≰ y → z ≰ x. intros (A x z y Exy Azy); elim (exc_cotransitive ???x Azy); [assumption] elim (Exy); left; assumption; qed. + +lemma lt_rewr: ∀A:excedence.∀x,z,y:A. x ≈ y → z < y → z < x. +intros (A x y z E H); split; elim H; +[apply (le_rewr ???? (eq_sym ??? E));|apply (ap_rewr ???? E)] assumption; +qed. + +lemma lt_rewl: ∀A:excedence.∀x,z,y:A. x ≈ y → y < z → x < z. +intros (A x y z E H); split; elim H; +[apply (le_rewl ???? (eq_sym ??? E));| apply (ap_rewl ???? E);] assumption; +qed. + +lemma lt_le_transitive: ∀A:excedence.∀x,y,z:A.x < y → y ≤ z → x < z. +intros (A x y z LT LE); cases LT (LEx APx); split; [apply (le_transitive ???? LEx LE)] +whd in LE LEx APx; cases APx (EXx EXx); [cases (LEx EXx)] +cases (exc_cotransitive ??? z EXx) (EXz EXz); [cases (LE EXz)] +right; assumption; +qed. + +lemma le_lt_transitive: ∀A:excedence.∀x,y,z:A.x ≤ y → y < z → x < z. +intros (A x y z LE LT); cases LT (LEx APx); split; [apply (le_transitive ???? LE LEx)] +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. + +definition total_order_property : ∀E:excedence. Type ≝ + λE:excedence. ∀a,b:E. a ≰ b → b < a. +