X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fmatita%2Fcontribs%2Fformal_topology%2Foverlap%2Fo-algebra.ma;h=a86d286bc0b034d658e0b34521964795d29d540a;hb=05cfeb82d2624860e66941421a937f308d66cf33;hp=b17dacbaf8a01ab107d8cd24914f9599899e511b;hpb=6b71ae123d3e412d43872b8b7965b7013a970d05;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 b17dacbaf..a86d286bc 100644 --- a/helm/software/matita/contribs/formal_topology/overlap/o-algebra.ma +++ b/helm/software/matita/contribs/formal_topology/overlap/o-algebra.ma @@ -34,9 +34,9 @@ intros; cases x in e; cases y; simplify; intros; try apply refl1; whd in e; case qed. interpretation "unary morphism comprehension with no proof" 'comprehension T P = - (mk_unary_morphism T _ P _). + (mk_unary_morphism T ? P ?). interpretation "unary morphism1 comprehension with no proof" 'comprehension T P = - (mk_unary_morphism1 T _ P _). + (mk_unary_morphism1 T ? P ?). notation > "hvbox({ ident i ∈ s | term 19 p | by })" with precedence 90 for @{ 'comprehension_by $s (λ${ident i}. $p) $by}. @@ -44,52 +44,60 @@ notation < "hvbox({ ident i ∈ s | term 19 p })" with precedence 90 for @{ 'comprehension_by $s (λ${ident i}:$_. $p) $by}. interpretation "unary morphism comprehension with proof" 'comprehension_by s \eta.f p = - (mk_unary_morphism s _ f p). + (mk_unary_morphism s ? f p). interpretation "unary morphism1 comprehension with proof" 'comprehension_by s \eta.f p = - (mk_unary_morphism1 s _ f p). + (mk_unary_morphism1 s ? f p). (* per il set-indexing vedere capitolo BPTools (foundational tools), Sect. 0.3.4 complete lattices, Definizione 0.9 *) (* USARE L'ESISTENZIALE DEBOLE *) + +definition if_then_else ≝ λT:Type.λe,t,f.match e return λ_.T with [ true ⇒ t | false ⇒ f]. +notation > "'If' term 19 e 'then' term 19 t 'else' term 90 f" non associative with precedence 19 for @{ 'if_then_else $e $t $f }. +notation < "'If' \nbsp term 19 e \nbsp 'then' \nbsp term 19 t \nbsp 'else' \nbsp term 90 f \nbsp" non associative with precedence 19 for @{ 'if_then_else $e $t $f }. +interpretation "Formula if_then_else" 'if_then_else e t f = (if_then_else ? e t f). + +notation > "hvbox(a break ≤ b)" non associative with precedence 45 for @{oa_leq $a $b}. +notation > "a >< b" non associative with precedence 45 for @{oa_overlap $a $b}. +notation > "⋁ p" non associative with precedence 45 for @{oa_join ? $p}. +notation > "⋀ p" non associative with precedence 45 for @{oa_meet ? $p}. +notation > "𝟙" non associative with precedence 90 for @{oa_one}. +notation > "𝟘" non associative with precedence 90 for @{oa_zero}. record OAlgebra : Type2 := { oa_P :> SET1; - oa_leq : binary_morphism1 oa_P oa_P CPROP; - oa_overlap: binary_morphism1 oa_P oa_P CPROP; - oa_meet: ∀I:SET.unary_morphism2 (I ⇒ oa_P) oa_P; - oa_join: ∀I:SET.unary_morphism2 (I ⇒ oa_P) oa_P; + oa_leq : oa_P × oa_P ⇒_1 CPROP; + oa_overlap: oa_P × oa_P ⇒_1 CPROP; + oa_meet: ∀I:SET.(I ⇒_2 oa_P) ⇒_2. oa_P; + oa_join: ∀I:SET.(I ⇒_2 oa_P) ⇒_2. 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; - 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 }); - oa_join_split: - ∀I:SET.∀p.∀q:I ⇒ oa_P. - oa_overlap p (oa_join I q) = ∃i:I.oa_overlap p (q i); + oa_leq_refl: ∀a:oa_P. a ≤ a; + oa_leq_antisym: ∀a,b:oa_P.a ≤ b → b ≤ a → a = b; + oa_leq_trans: ∀a,b,c:oa_P.a ≤ b → b ≤ c → a ≤ c; + oa_overlap_sym: ∀a,b:oa_P.a >< b → b >< a; + oa_meet_inf: ∀I:SET.∀p_i:I ⇒_2 oa_P.∀p:oa_P.p ≤ (⋀ p_i) = (∀i:I.p ≤ (p_i i)); + oa_join_sup: ∀I:SET.∀p_i:I ⇒_2 oa_P.∀p:oa_P.(⋁ p_i) ≤ p = (∀i:I.p_i i ≤ p); + oa_zero_bot: ∀p:oa_P.𝟘 ≤ p; + oa_one_top: ∀p:oa_P.p ≤ 𝟙; + oa_overlap_preserves_meet_: ∀p,q:oa_P.p >< q → + p >< (⋀ { x ∈ BOOL | If x then p else q(*match x with [ true ⇒ p | false ⇒ q ]*) | IF_THEN_ELSE_p oa_P p q }); + oa_join_split: ∀I:SET.∀p.∀q:I ⇒_2 oa_P.p >< (⋁ q) = (∃i:I.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 oa_enum : ums oa_base oa_P; oa_density: ∀p,q.(∀i.oa_overlap p (oa_enum i) → oa_overlap q (oa_enum i)) → oa_leq p q *) - oa_density: - ∀p,q.(∀r.oa_overlap p r → oa_overlap q r) → oa_leq p q + oa_density: ∀p,q.(∀r.p >< r → q >< r) → p ≤ q }. -interpretation "o-algebra leq" 'leq a b = (fun21 ___ (oa_leq _) a b). +notation "hvbox(a break ≤ b)" non associative with precedence 45 for @{ 'leq $a $b }. + +interpretation "o-algebra leq" 'leq a b = (fun21 ??? (oa_leq ?) a b). notation "hovbox(a mpadded width -150% (>)< b)" non associative with precedence 45 for @{ 'overlap $a $b}. -interpretation "o-algebra overlap" 'overlap a b = (fun21 ___ (oa_overlap _) a b). +interpretation "o-algebra overlap" 'overlap a b = (fun21 ??? (oa_overlap ?) a b). notation < "hovbox(mstyle scriptlevel 1 scriptsizemultiplier 1.7 (∧) \below (\emsp) \nbsp term 90 p)" non associative with precedence 50 for @{ 'oa_meet $p }. @@ -99,9 +107,9 @@ non associative with precedence 50 for @{ 'oa_meet_mk (λ${ident i}:$I.$p) }. notation > "hovbox(∧ f)" non associative with precedence 60 for @{ 'oa_meet $f }. interpretation "o-algebra meet" 'oa_meet f = - (fun12 __ (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 _)). + (fun12 ?? (oa_meet ??) (mk_unary_morphism1 ?? f ?)). notation < "hovbox(mstyle scriptlevel 1 scriptsizemultiplier 1.7 (∨) \below (\emsp) \nbsp term 90 p)" non associative with precedence 50 for @{ 'oa_join $p }. @@ -111,11 +119,11 @@ non associative with precedence 50 for @{ 'oa_join_mk (λ${ident i}:$I.$p) }. notation > "hovbox(∨ f)" non associative with precedence 60 for @{ 'oa_join $f }. interpretation "o-algebra join" 'oa_join f = - (fun12 __ (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 _)). + (fun12 ?? (oa_join ??) (mk_unary_morphism ?? f ?)). -definition binary_meet : ∀O:OAlgebra. binary_morphism1 O O O. +definition binary_meet : ∀O:OAlgebra. O × O ⇒_1 O. intros; split; [ intros (p q); apply (∧ { x ∈ BOOL | match x with [ true ⇒ p | false ⇒ q ] | IF_THEN_ELSE_p ? p q }); @@ -127,11 +135,11 @@ intros; split; qed. interpretation "o-algebra binary meet" 'and a b = - (fun21 ___ (binary_meet _) a b). + (fun21 ??? (binary_meet ?) a b). prefer coercion Type1_OF_OAlgebra. -definition binary_join : ∀O:OAlgebra. binary_morphism1 O O O. +definition binary_join : ∀O:OAlgebra. O × O ⇒_1 O. intros; split; [ intros (p q); apply (∨ { x ∈ BOOL | match x with [ true ⇒ p | false ⇒ q ] | IF_THEN_ELSE_p ? p q }); @@ -143,14 +151,12 @@ intros; split; qed. interpretation "o-algebra binary join" 'or a b = - (fun21 ___ (binary_join _) 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 *) -change in ⊢ (?→%→%→?) with (Type1_OF_OAlgebra O); -intros; lapply (oa_overlap_preserves_meet_ O p q f); -lapply (prop21 O O CPROP (oa_overlap O) p p ? (p ∧ q) # ?); -[3: apply (if ?? (Hletin1)); apply Hletin;|skip] apply refl1; +intros; lapply (oa_overlap_preserves_meet_ O p q f) as H; clear f; +(** screenshot "screenoa". *) +assumption; qed. notation < "hovbox(mstyle scriptlevel 1 scriptsizemultiplier 1.7 (∨) \below (\emsp) \nbsp term 90 p)" @@ -166,15 +172,15 @@ notation > "hovbox(a ∨ b)" left associative with precedence 49 for @{ 'oa_join (mk_unary_morphism BOOL ? (λx__:bool.match x__ with [ true ⇒ $a | false ⇒ $b ]) (IF_THEN_ELSE_p ? $a $b)) }. interpretation "o-algebra join" 'oa_join f = - (fun12 __ (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 _)). + (fun12 ?? (oa_join ??) (mk_unary_morphism ?? f ?)). 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_f_ : P ⇒_2 Q; + or_f_minus_star_ : P ⇒_2 Q; + or_f_star_ : Q ⇒_2 P; + or_f_minus_ : Q ⇒_2 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) @@ -187,10 +193,11 @@ constructor 1; | constructor 1; (* tenere solo una uguaglianza e usare la proposizione 9.9 per le altre (unicita' degli aggiunti e del simmetrico) *) - [ apply (λp,q. And42 (eq2 ? (or_f_minus_star_ ?? p) (or_f_minus_star_ ?? q)) - (eq2 ? (or_f_minus_ ?? p) (or_f_minus_ ?? q)) - (eq2 ? (or_f_ ?? p) (or_f_ ?? q)) - (eq2 ? (or_f_star_ ?? p) (or_f_star_ ?? q))); + [ apply (λp,q. And42 + (or_f_minus_star_ ?? p = or_f_minus_star_ ?? q) + (or_f_minus_ ?? p = or_f_minus_ ?? q) + (or_f_ ?? p = or_f_ ?? q) + (or_f_star_ ?? p = or_f_star_ ?? q)); | whd; simplify; intros; repeat split; intros; apply refl2; | whd; simplify; intros; cases a; clear a; split; intro a; apply sym1; generalize in match a;assumption; @@ -205,32 +212,31 @@ 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). +definition or_f_minus_star: ∀P,Q:OAlgebra.(ORelation_setoid P Q) ⇒_2 (P ⇒_2 Q). intros; constructor 1; [ apply or_f_minus_star_; | intros; cases e; assumption] qed. -definition or_f: ∀P,Q:OAlgebra.unary_morphism2 (ORelation_setoid P Q) (P ⇒ Q). +definition or_f: ∀P,Q:OAlgebra.(ORelation_setoid P Q) ⇒_2 (P ⇒_2 Q). intros; constructor 1; [ apply or_f_; | intros; cases e; assumption] qed. -definition or_f_minus: ∀P,Q:OAlgebra.unary_morphism2 (ORelation_setoid P Q) (Q ⇒ P). +definition or_f_minus: ∀P,Q:OAlgebra.(ORelation_setoid P Q) ⇒_2 (Q ⇒_2 P). intros; constructor 1; [ apply or_f_minus_; | intros; cases e; assumption] qed. -definition or_f_star: ∀P,Q:OAlgebra.unary_morphism2 (ORelation_setoid P Q) (Q ⇒ P). +definition or_f_star: ∀P,Q:OAlgebra.(ORelation_setoid P Q) ⇒_2 (Q ⇒_2 P). intros; constructor 1; [ apply or_f_star_; | intros; cases e; assumption] qed. -lemma arrows1_of_ORelation_setoid : ∀P,Q. ORelation_setoid P Q → (P ⇒ Q). +lemma arrows1_of_ORelation_setoid : ∀P,Q. ORelation_setoid P Q → (P ⇒_2 Q). intros; apply (or_f ?? c); qed. coercion arrows1_of_ORelation_setoid. @@ -244,9 +250,9 @@ notation > "r⎻*" non associative with precedence 90 for @{'OR_f_minus_star $r} notation "r \sup ⎻" non associative with precedence 90 for @{'OR_f_minus $r}. notation > "r⎻" non associative with precedence 90 for @{'OR_f_minus $r}. -interpretation "o-relation f⎻*" 'OR_f_minus_star r = (fun12 __ (or_f_minus_star _ _) r). -interpretation "o-relation f⎻" 'OR_f_minus r = (fun12 __ (or_f_minus _ _) r). -interpretation "o-relation f*" 'OR_f_star r = (fun12 __ (or_f_star _ _) r). +interpretation "o-relation f⎻*" 'OR_f_minus_star r = (fun12 ?? (or_f_minus_star ? ?) r). +interpretation "o-relation f⎻" 'OR_f_minus r = (fun12 ?? (or_f_minus ? ?) r). +interpretation "o-relation f*" 'OR_f_star r = (fun12 ?? (or_f_star ? ?) r). definition or_prop1 : ∀P,Q:OAlgebra.∀F:ORelation_setoid P Q.∀p,q. (F p ≤ q) = (p ≤ F* q). @@ -264,7 +270,7 @@ intros; apply (or_prop3_ ?? F p q); qed. definition ORelation_composition : ∀P,Q,R. - binary_morphism2 (ORelation_setoid P Q) (ORelation_setoid Q R) (ORelation_setoid P R). + (ORelation_setoid P Q) × (ORelation_setoid Q R) ⇒_2 (ORelation_setoid P R). intros; constructor 1; [ intros (F G); @@ -286,8 +292,7 @@ constructor 1; apply or_prop3; ] | intros; split; simplify; - [3: 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. @@ -319,7 +324,9 @@ coercion ORelation_setoid_of_arrows2_OA. prefer coercion Type_OF_objs2. -(* alias symbol "eq" = "setoid1 eq". *) +notation > "B ⇒_\o2 C" right associative with precedence 72 for @{'arrows2_OA $B $C}. +notation "B ⇒\sub (\o 2) C" right associative with precedence 72 for @{'arrows2_OA $B $C}. +interpretation "'arrows2_OA" 'arrows2_OA A B = (arrows2 OA A B). (* qui la notazione non va *) lemma leq_to_eq_join: ∀S:OA.∀p,q:S. p ≤ q → q = (binary_join ? p q). @@ -441,4 +448,4 @@ 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 +qed.