X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fmatita%2Fcontribs%2Fformal_topology%2Foverlap%2Fo-algebra.ma;h=b17dacbaf8a01ab107d8cd24914f9599899e511b;hb=6b71ae123d3e412d43872b8b7965b7013a970d05;hp=6be19d92c31ac4518d402650c362e85dc4b3fd9b;hpb=c78cbede35ed85575e274864e6b6b9c635c6956d;p=helm.git diff --git a/helm/software/matita/contribs/formal_topology/overlap/o-algebra.ma b/helm/software/matita/contribs/formal_topology/overlap/o-algebra.ma index 6be19d92c..b17dacbaf 100644 --- a/helm/software/matita/contribs/formal_topology/overlap/o-algebra.ma +++ b/helm/software/matita/contribs/formal_topology/overlap/o-algebra.ma @@ -51,31 +51,30 @@ interpretation "unary morphism1 comprehension with proof" 'comprehension_by s \e (* per il set-indexing vedere capitolo BPTools (foundational tools), Sect. 0.3.4 complete lattices, Definizione 0.9 *) (* USARE L'ESISTENZIALE DEBOLE *) -(*alias symbol "comprehension_by" = "unary morphism comprehension with proof".*) record OAlgebra : Type2 := { oa_P :> SET1; - oa_leq : binary_morphism1 oa_P oa_P CPROP; (* CPROP is setoid1, CPROP importante che sia small *) + oa_leq : binary_morphism1 oa_P oa_P CPROP; oa_overlap: binary_morphism1 oa_P oa_P CPROP; - oa_meet: ∀I:SET.unary_morphism2 (arrows2 SET1 I oa_P) oa_P; - oa_join: ∀I:SET.unary_morphism2 (arrows2 SET1 I oa_P) oa_P; + oa_meet: ∀I:SET.unary_morphism2 (I ⇒ oa_P) oa_P; + oa_join: ∀I:SET.unary_morphism2 (I ⇒ oa_P) oa_P; oa_one: oa_P; oa_zero: oa_P; oa_leq_refl: ∀a:oa_P. oa_leq a a; oa_leq_antisym: ∀a,b:oa_P.oa_leq a b → oa_leq b a → a = b; oa_leq_trans: ∀a,b,c:oa_P.oa_leq a b → oa_leq b c → oa_leq a c; oa_overlap_sym: ∀a,b:oa_P.oa_overlap a b → oa_overlap b a; - (* Errore: = in oa_meet_inf e oa_join_sup *) - oa_meet_inf: ∀I.∀p_i.∀p:oa_P.oa_leq p (oa_meet I p_i) → ∀i:I.oa_leq p (p_i i); - oa_join_sup: ∀I.∀p_i.∀p:oa_P.oa_leq (oa_join I p_i) p → ∀i:I.oa_leq (p_i i) p; + oa_meet_inf: + ∀I:SET.∀p_i:I ⇒ oa_P.∀p:oa_P. + oa_leq p (oa_meet I p_i) = ∀i:I.oa_leq p (p_i i); + oa_join_sup: ∀I:SET.∀p_i:I ⇒ oa_P.∀p:oa_P.oa_leq (oa_join I p_i) p = ∀i:I.oa_leq (p_i i) p; oa_zero_bot: ∀p:oa_P.oa_leq oa_zero p; oa_one_top: ∀p:oa_P.oa_leq p oa_one; oa_overlap_preserves_meet_: ∀p,q:oa_P.oa_overlap p q → oa_overlap p (oa_meet ? { x ∈ BOOL | match x with [ true ⇒ p | false ⇒ q ] | IF_THEN_ELSE_p oa_P p q }); - (* ⇔ deve essere =, l'esiste debole *) oa_join_split: - ∀I:SET.∀p.∀q:arrows2 SET1 I oa_P. - oa_overlap p (oa_join I q) ⇔ ∃i:carr I.oa_overlap p (q i); + ∀I:SET.∀p.∀q:I ⇒ oa_P. + oa_overlap p (oa_join I q) = ∃i:I.oa_overlap p (q i); (*oa_base : setoid; 1) enum non e' il nome giusto perche' non e' suriettiva 2) manca (vedere altro capitolo) la "suriettivita'" come immagine di insiemi di oa_base @@ -97,30 +96,24 @@ non associative with precedence 50 for @{ 'oa_meet $p }. notation < "hovbox(mstyle scriptlevel 1 scriptsizemultiplier 1.7 (∧) \below (ident i ∈  I) break term 90 p)" non associative with precedence 50 for @{ 'oa_meet_mk (λ${ident i}:$I.$p) }. -(* -notation < "hovbox(a ∧ b)" left associative with precedence 35 -for @{ 'oa_meet_mk (λ${ident i}:$_.match $i with [ true ⇒ $a | false ⇒ $b ]) }. -*) notation > "hovbox(∧ f)" non associative with precedence 60 for @{ 'oa_meet $f }. -(* -notation > "hovbox(a ∧ b)" left associative with precedence 50 -for @{ 'oa_meet (mk_unary_morphism BOOL ? (λx__:bool.match x__ with [ true ⇒ $a | false ⇒ $b ]) (IF_THEN_ELSE_p ? $a $b)) }. -*) interpretation "o-algebra meet" 'oa_meet f = (fun12 __ (oa_meet __) f). interpretation "o-algebra meet with explicit function" 'oa_meet_mk f = (fun12 __ (oa_meet __) (mk_unary_morphism _ _ f _)). -definition hint3: OAlgebra → setoid1. - intro; apply (oa_P o); -qed. -coercion hint3. +notation < "hovbox(mstyle scriptlevel 1 scriptsizemultiplier 1.7 (∨) \below (\emsp) \nbsp term 90 p)" +non associative with precedence 50 for @{ 'oa_join $p }. +notation < "hovbox(mstyle scriptlevel 1 scriptsizemultiplier 1.7 (∨) \below (ident i ∈  I) break term 90 p)" +non associative with precedence 50 for @{ 'oa_join_mk (λ${ident i}:$I.$p) }. -definition hint4: ∀A. setoid2_OF_OAlgebra A → hint3 A. - intros; apply t; -qed. -coercion hint4. +notation > "hovbox(∨ f)" non associative with precedence 60 +for @{ 'oa_join $f }. +interpretation "o-algebra join" 'oa_join f = + (fun12 __ (oa_join __) f). +interpretation "o-algebra join with explicit function" 'oa_join_mk f = + (fun12 __ (oa_join __) (mk_unary_morphism _ _ f _)). definition binary_meet : ∀O:OAlgebra. binary_morphism1 O O O. intros; split; @@ -136,7 +129,21 @@ qed. interpretation "o-algebra binary meet" 'and a b = (fun21 ___ (binary_meet _) a b). -coercion Type1_OF_OAlgebra nocomposites. +prefer coercion Type1_OF_OAlgebra. + +definition binary_join : ∀O:OAlgebra. binary_morphism1 O O O. +intros; split; +[ intros (p q); + apply (∨ { x ∈ BOOL | match x with [ true ⇒ p | false ⇒ q ] | IF_THEN_ELSE_p ? p q }); +| intros; lapply (prop12 ? O (oa_join O BOOL)); + [2: apply ({ x ∈ BOOL | match x with [ true ⇒ a | false ⇒ b ] | IF_THEN_ELSE_p ? a b }); + |3: apply ({ x ∈ BOOL | match x with [ true ⇒ a' | false ⇒ b' ] | IF_THEN_ELSE_p ? a' b' }); + | apply Hletin;] + intro x; simplify; cases x; simplify; assumption;] +qed. + +interpretation "o-algebra binary join" 'or a b = + (fun21 ___ (binary_join _) a b). lemma oa_overlap_preservers_meet: ∀O:OAlgebra.∀p,q:O.p >< q → p >< (p ∧ q). (* next change to avoid universe inconsistency *) @@ -163,16 +170,11 @@ interpretation "o-algebra join" 'oa_join f = interpretation "o-algebra join with explicit function" 'oa_join_mk f = (fun12 __ (oa_join __) (mk_unary_morphism _ _ f _)). -definition hint5: OAlgebra → objs2 SET1. - intro; apply (oa_P o); -qed. -coercion hint5. - -record ORelation (P,Q : OAlgebra) : Type ≝ { - or_f_ : P ⇒ Q; - or_f_minus_star_ : P ⇒ Q; - or_f_star_ : Q ⇒ P; - or_f_minus_ : Q ⇒ P; +record ORelation (P,Q : OAlgebra) : Type2 ≝ { + or_f_ : carr2 (P ⇒ Q); + or_f_minus_star_ : carr2(P ⇒ Q); + or_f_star_ : carr2(Q ⇒ P); + or_f_minus_ : carr2(Q ⇒ P); or_prop1_ : ∀p,q. (or_f_ p ≤ q) = (p ≤ or_f_star_ q); or_prop2_ : ∀p,q. (or_f_minus_ p ≤ q) = (p ≤ or_f_minus_star_ q); or_prop3_ : ∀p,q. (or_f_ p >< q) = (p >< or_f_minus_ q) @@ -199,6 +201,10 @@ constructor 1; | apply (.= (e3 a)); apply e7;]]] qed. +definition ORelation_of_ORelation_setoid : + ∀P,Q.ORelation_setoid P Q → ORelation P Q ≝ λP,Q,x.x. +coercion ORelation_of_ORelation_setoid. + definition or_f_minus_star: ∀P,Q:OAlgebra.unary_morphism2 (ORelation_setoid P Q) (P ⇒ Q). intros; constructor 1; @@ -212,8 +218,6 @@ definition or_f: ∀P,Q:OAlgebra.unary_morphism2 (ORelation_setoid P Q) (P ⇒ Q | intros; cases e; assumption] qed. -coercion or_f. - definition or_f_minus: ∀P,Q:OAlgebra.unary_morphism2 (ORelation_setoid P Q) (Q ⇒ P). intros; constructor 1; [ apply or_f_minus_; @@ -226,34 +230,10 @@ definition or_f_star: ∀P,Q:OAlgebra.unary_morphism2 (ORelation_setoid P Q) (Q | intros; cases e; assumption] qed. -lemma arrows1_OF_ORelation_setoid : ∀P,Q. ORelation_setoid P Q → (P ⇒ Q). -intros; apply (or_f ?? t); -qed. - -coercion arrows1_OF_ORelation_setoid. - -lemma umorphism_OF_ORelation_setoid : ∀P,Q. ORelation_setoid P Q → unary_morphism1 P Q. -intros; apply (or_f ?? t); -qed. - -coercion umorphism_OF_ORelation_setoid. - -lemma umorphism_setoid_OF_ORelation_setoid : ∀P,Q. ORelation_setoid P Q → unary_morphism1_setoid1 P Q. -intros; apply (or_f ?? t); -qed. - -coercion umorphism_setoid_OF_ORelation_setoid. - -lemma uncurry_arrows : ∀B,C. ORelation_setoid B C → B → C. -intros; apply ((fun11 ?? t) t1); -qed. - -coercion uncurry_arrows 1. - -lemma hint6: ∀P,Q. Type_OF_setoid2 (hint5 P ⇒ hint5 Q) → unary_morphism1 P Q. - intros; apply t; +lemma arrows1_of_ORelation_setoid : ∀P,Q. ORelation_setoid P Q → (P ⇒ Q). +intros; apply (or_f ?? c); qed. -coercion hint6. +coercion arrows1_of_ORelation_setoid. notation "r \sup *" non associative with precedence 90 for @{'OR_f_star $r}. notation > "r *" non associative with precedence 90 for @{'OR_f_star $r}. @@ -306,7 +286,9 @@ constructor 1; apply or_prop3; ] | intros; split; simplify; - [1,3: unfold umorphism_setoid_OF_ORelation_setoid; unfold arrows1_OF_ORelation_setoid; apply ((†e)‡(†e1)); + [3: unfold arrows1_of_ORelation_setoid; + apply ((†e)‡(†e1)); + |1: apply ((†e)‡(†e1)); |2,4: apply ((†e1)‡(†e));]] qed. @@ -328,22 +310,135 @@ split; | intros; split; unfold ORelation_composition; simplify; apply id_neutral_right2;] qed. -lemma setoid1_of_OA: OA → setoid1. - intro; apply (oa_P t); +definition OAlgebra_of_objs2_OA: objs2 OA → OAlgebra ≝ λx.x. +coercion OAlgebra_of_objs2_OA. + +definition ORelation_setoid_of_arrows2_OA: + ∀P,Q. arrows2 OA P Q → ORelation_setoid P Q ≝ λP,Q,c.c. +coercion ORelation_setoid_of_arrows2_OA. + +prefer coercion Type_OF_objs2. + +(* alias symbol "eq" = "setoid1 eq". *) + +(* qui la notazione non va *) +lemma leq_to_eq_join: ∀S:OA.∀p,q:S. p ≤ q → q = (binary_join ? p q). + intros; + apply oa_leq_antisym; + [ apply oa_density; intros; + apply oa_overlap_sym; + unfold binary_join; simplify; + apply (. (oa_join_split : ?)); + exists; [ apply false ] + apply oa_overlap_sym; + assumption + | unfold binary_join; simplify; + apply (. (oa_join_sup : ?)); intro; + cases i; whd in ⊢ (? ? ? ? ? % ?); + [ assumption | apply oa_leq_refl ]] +qed. + +lemma overlap_monotone_left: ∀S:OA.∀p,q,r:S. p ≤ q → p >< r → q >< r. + intros; + apply (. (leq_to_eq_join : ?)‡#); + [ apply f; + | skip + | apply oa_overlap_sym; + unfold binary_join; simplify; + apply (. (oa_join_split : ?)); + exists [ apply true ] + apply oa_overlap_sym; + assumption; ] qed. -coercion setoid1_of_OA. -lemma SET1_of_OA: OA → SET1. - intro; whd; apply (setoid1_of_OA t); +(* Part of proposition 9.9 *) +lemma f_minus_image_monotone: ∀S,T.∀R:arrows2 OA S T.∀p,q. p ≤ q → R⎻ p ≤ R⎻ q. + intros; + apply (. (or_prop2 : ?)); + apply oa_leq_trans; [2: apply f; | skip | apply (. (or_prop2 : ?)^ -1); apply oa_leq_refl;] +qed. + +(* Part of proposition 9.9 *) +lemma f_minus_star_image_monotone: ∀S,T.∀R:arrows2 OA S T.∀p,q. p ≤ q → R⎻* p ≤ R⎻* q. + intros; + apply (. (or_prop2 : ?)^ -1); + apply oa_leq_trans; [3: apply f; | skip | apply (. (or_prop2 : ?)); apply oa_leq_refl;] qed. -coercion SET1_of_OA. -lemma objs2_SET1_OF_OA: OA → objs2 SET1. - intro; whd; apply (setoid1_of_OA t); +(* Part of proposition 9.9 *) +lemma f_image_monotone: ∀S,T.∀R:arrows2 OA S T.∀p,q. p ≤ q → R p ≤ R q. + intros; + apply (. (or_prop1 : ?)); + apply oa_leq_trans; [2: apply f; | skip | apply (. (or_prop1 : ?)^ -1); apply oa_leq_refl;] qed. -coercion objs2_SET1_OF_OA. -lemma Type_OF_category2_OF_SET1_OF_OA: OA → Type_OF_category2 SET1. - intro; apply (oa_P t); +(* Part of proposition 9.9 *) +lemma f_star_image_monotone: ∀S,T.∀R:arrows2 OA S T.∀p,q. p ≤ q → R* p ≤ R* q. + intros; + apply (. (or_prop1 : ?)^ -1); + apply oa_leq_trans; [3: apply f; | skip | apply (. (or_prop1 : ?)); apply oa_leq_refl;] qed. -coercion Type_OF_category2_OF_SET1_OF_OA. + +lemma lemma_10_2_a: ∀S,T.∀R:arrows2 OA S T.∀p. p ≤ R⎻* (R⎻ p). + intros; + apply (. (or_prop2 : ?)^-1); + apply oa_leq_refl. +qed. + +lemma lemma_10_2_b: ∀S,T.∀R:arrows2 OA S T.∀p. R⎻ (R⎻* p) ≤ p. + intros; + apply (. (or_prop2 : ?)); + apply oa_leq_refl. +qed. + +lemma lemma_10_2_c: ∀S,T.∀R:arrows2 OA S T.∀p. p ≤ R* (R p). + intros; + apply (. (or_prop1 : ?)^-1); + apply oa_leq_refl. +qed. + +lemma lemma_10_2_d: ∀S,T.∀R:arrows2 OA S T.∀p. R (R* p) ≤ p. + intros; + apply (. (or_prop1 : ?)); + apply oa_leq_refl. +qed. + +lemma lemma_10_3_a: ∀S,T.∀R:arrows2 OA S T.∀p. R⎻ (R⎻* (R⎻ p)) = R⎻ p. + intros; apply oa_leq_antisym; + [ apply lemma_10_2_b; + | apply f_minus_image_monotone; + apply lemma_10_2_a; ] +qed. + +lemma lemma_10_3_b: ∀S,T.∀R:arrows2 OA S T.∀p. R* (R (R* p)) = R* p. + intros; apply oa_leq_antisym; + [ apply f_star_image_monotone; + apply (lemma_10_2_d ?? R p); + | apply lemma_10_2_c; ] +qed. + +lemma lemma_10_3_c: ∀S,T.∀R:arrows2 OA S T.∀p. R (R* (R p)) = R p. + intros; apply oa_leq_antisym; + [ apply lemma_10_2_d; + | apply f_image_monotone; + apply (lemma_10_2_c ?? R p); ] +qed. + +lemma lemma_10_3_d: ∀S,T.∀R:arrows2 OA S T.∀p. R⎻* (R⎻ (R⎻* p)) = R⎻* p. + intros; apply oa_leq_antisym; + [ apply f_minus_star_image_monotone; + apply (lemma_10_2_b ?? R p); + | apply lemma_10_2_a; ] +qed. + +lemma lemma_10_4_a: ∀S,T.∀R:arrows2 OA S T.∀p. R⎻* (R⎻ (R⎻* (R⎻ p))) = R⎻* (R⎻ p). + intros; apply (†(lemma_10_3_a ?? R p)); +qed. + +lemma lemma_10_4_b: ∀S,T.∀R:arrows2 OA S T.∀p. R (R* (R (R* p))) = R (R* p). +intros; unfold in ⊢ (? ? ? % %); apply (†(lemma_10_3_b ?? R p)); +qed. + +lemma oa_overlap_sym': ∀o:OA.∀U,V:o. (U >< V) = (V >< U). + intros; split; intro; apply oa_overlap_sym; assumption. +qed. \ No newline at end of file