From: Claudio Sacerdoti Coen Date: Sun, 21 Dec 2008 21:46:04 +0000 (+0000) Subject: Using the new category SET. X-Git-Tag: make_still_working~4341 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=02b7632adbc18175c6459013f2332e1bcc78f5c8;p=helm.git Using the new category SET. Rewriting is no longer working as expected. --- 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 877887ad9..4dcf99b8b 100644 --- a/helm/software/matita/contribs/formal_topology/overlap/o-algebra.ma +++ b/helm/software/matita/contribs/formal_topology/overlap/o-algebra.ma @@ -17,18 +17,7 @@ include "logic/cprop_connectives.ma". inductive bool : Type := true : bool | false : bool. -lemma ums : setoid → setoid → setoid. -intros (S T); -constructor 1; -[ apply (unary_morphism S T); -| constructor 1; - [ intros (f1 f2); apply (∀a,b:S.eq1 ? a b → eq1 ? (f1 a) (f2 b)); - | whd; simplify; intros; apply (.= (†H)); apply refl1; - | whd; simplify; intros; apply (.= (†H1)); apply sym1; apply H; apply refl1; - | whd; simplify; intros; apply (.= (†H2)); apply (.= (H ?? #)); apply (.= (H1 ?? #)); apply rule #;]] -qed. - -lemma BOOL : setoid. +lemma BOOL : objs1 SET. constructor 1; [apply bool] constructor 1; [ intros (x y); apply (match x with [ true ⇒ match y with [ true ⇒ True | _ ⇒ False] | false ⇒ match y with [ true ⇒ False | false ⇒ True ]]); | whd; simplify; intros; cases x; apply I; @@ -36,16 +25,22 @@ constructor 1; [apply bool] constructor 1; | whd; simplify; intros 3; cases x; cases y; cases z; simplify; intros; try assumption; apply I] qed. +definition hint: objs1 SET → setoid. + intros; apply o; +qed. + +coercion hint. + lemma IF_THEN_ELSE_p : ∀S:setoid.∀a,b:S.∀x,y:BOOL.x = y → let f ≝ λm.match m with [ true ⇒ a | false ⇒ b ] in f x = f y. intros; cases x in H; cases y; simplify; intros; try apply refl; whd in H; cases H; qed. -lemma if_then_else : ∀T:setoid. ∀a,b:T. ums BOOL T. +lemma if_then_else : ∀T:SET. ∀a,b:T. arrows1 SET BOOL T. intros; constructor 1; intros; -[ apply (match c2 with [ true ⇒ c | false ⇒ c1 ]); -| apply (IF_THEN_ELSE_p T c c1 a a' H);] +[ apply (match c with [ true ⇒ t | false ⇒ t1 ]); +| apply (IF_THEN_ELSE_p T t t1 a a' H);] qed. interpretation "mk " 'comprehension T P = @@ -57,16 +52,16 @@ for @{ 'comprehension_by $s (\lambda ${ident i}. $p) $by}. interpretation "unary morphism comprehension with proof" 'comprehension_by s f p = (mk_unary_morphism s _ f p). -definition A : ∀S:setoid.∀a,b:S.ums BOOL S. +definition A : ∀S:SET.∀a,b:S.arrows1 SET BOOL S. apply (λS,a,b.{ x ∈ BOOL | match x with [ true ⇒ a | false ⇒ b] | IF_THEN_ELSE_p S a b}). qed. record OAlgebra : Type := { - oa_P :> setoid; + oa_P :> SET; oa_leq : binary_morphism1 oa_P oa_P CPROP; (* CPROP is setoid1 *) oa_overlap: binary_morphism1 oa_P oa_P CPROP; - oa_meet: ∀I:setoid.unary_morphism (ums I oa_P) oa_P; - oa_join: ∀I:setoid.unary_morphism (ums I oa_P) oa_P; + oa_meet: ∀I:SET.unary_morphism (arrows1 SET I oa_P) oa_P; + oa_join: ∀I:SET.unary_morphism (arrows1 SET I oa_P) oa_P; oa_one: oa_P; oa_zero: oa_P; oa_leq_refl: ∀a:oa_P. oa_leq a a; @@ -82,7 +77,7 @@ record OAlgebra : Type := { (oa_meet ? { x ∈ BOOL | match x with [ true ⇒ p | false ⇒ q ] | IF_THEN_ELSE_p oa_P p q }); (*(oa_meet BOOL (if_then_else oa_P p q));*) oa_join_split: (* ha I → oa_P da castare a funX (ums A oa_P) *) - ∀I:setoid.∀p.∀q:ums I oa_P.oa_overlap p (oa_join I q) ⇔ ∃i:I.oa_overlap p (q i); + ∀I:SET.∀p.∀q:arrows1 SET I oa_P.oa_overlap p (oa_join I q) ⇔ ∃i:I.oa_overlap p (q i); (*oa_base : setoid; 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*) @@ -127,13 +122,13 @@ interpretation "o-algebra join" 'oa_join \eta.f = (oa_join _ _ f). *) 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; - 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 + or_f :> arrows1 SET P Q; + or_f_minus_star : arrows1 SET P Q; + or_f_star : arrows1 SET Q P; + or_f_minus : arrows1 SET 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) }. notation "r \sup *" non associative with precedence 90 for @{'OR_f_star $r}. @@ -155,21 +150,29 @@ intros (P Q); constructor 1; [ apply (ORelation P Q); | constructor 1; - [ - alias symbol "and" = "constructive and". - apply (λp,q. - (∀a.p⎻* a = q⎻* a) ∧ - (∀a.p⎻ a = q⎻ a) ∧ - (∀a.p a = q a) ∧ - (∀a.p* a = q* a)); - | whd; simplify; intros; repeat split; intros; apply refl; + [ apply (λp,q. eq1 ? p⎻* q⎻* ∧ eq1 ? p⎻ q⎻ ∧ eq1 ? p q ∧ eq1 ? p* q* ); + | whd; simplify; intros; repeat split; intros; apply refl1; | whd; simplify; intros; cases H; cases H1; cases H3; clear H H3 H1; - repeat split; intros; apply sym; generalize in match a;assumption; - | whd; simplify; intros; elim DAEMON;]] -qed. + repeat split; intros; apply sym1; assumption; + | whd; simplify; intros; cases H; cases H1; cases H2; cases H4; cases H6; cases H8; + repeat split; intros; clear H H1 H2 H4 H6 H8; apply trans1; + [2: apply H10; + |5: apply H11; + |8: apply H7; + |11: apply H3; + |1,4,7,10: skip + |*: assumption + ]]] +qed. -lemma hint : ∀P,Q. ORelation_setoid P Q → P ⇒ Q. intros; apply (or_f ?? c);qed. -coercion hint. +lemma hint1 : ∀P,Q. ORelation_setoid P Q → arrows1 SET P Q. intros; apply (or_f ?? c);qed. +coercion hint1. + +lemma hint3 : ∀P,Q. arrows1 SET P Q → P ⇒ Q. intros; apply c;qed. +coercion hint3. + +lemma hint2: OAlgebra → setoid. intros; apply (oa_P o). qed. +coercion hint2. definition composition : ∀P,Q,R. binary_morphism1 (ORelation_setoid P Q) (ORelation_setoid Q R) (ORelation_setoid P R). @@ -177,21 +180,42 @@ intros; constructor 1; [ intros (F G); constructor 1; - [ constructor 1; [apply (λx. G (F x)); | intros; apply (†(†H));] - |2,3,4,5,6,7: cases DAEMON;] -| intros; cases DAEMON;] + [ apply (G ∘ F); + | apply (G⎻* ∘ F⎻* ); + | apply (F* ∘ G* ); + | apply (F⎻ ∘ G⎻); + | intros; change with ((G (F p) ≤ q) = (p ≤ (F* (G* q)))); + apply (.= or_prop1 ??? (F p) ?); + apply (.= or_prop1 ??? p ?); + apply refl1 + | intros; change with ((F⎻ (G⎻ p) ≤ q) = (p ≤ (G⎻* (F⎻* q)))); + apply (.= or_prop2 ??? (G⎻ p) ?); + apply (.= or_prop2 ??? p ?); + apply refl1; + | intros; change with ((G (F (p)) >< q) = (p >< (F⎻ (G⎻ q)))); + apply (.= or_prop3 ??? (F p) ?); + apply (.= or_prop3 ??? p ?); + apply refl1 + ] +| intros; repeat split; simplify; cases DAEMON (* + [ apply trans1; [2: apply prop1; [3: apply rule #; | skip | 4: + apply rule (†?); + + lapply (.= ((†H1)‡#)); [8: apply Hletin; + [ apply trans1; [2: lapply (prop1); [apply Hletin; +*)] qed. -definition OA : category1. (* category2 *) +definition OA : category1. split; [ apply (OAlgebra); | intros; apply (ORelation_setoid o o1); | intro O; split; - [1,2,3,4: constructor 1; [1,3,5,7:apply (λx.x);|*:intros;assumption] - |5,6,7:intros;split;intros; assumption; ] -|4: apply composition; -|*: elim DAEMON;] -qed. - - - + [1,2,3,4: apply id1; + |5,6,7:intros; apply refl1;] +| apply composition; +| intros; repeat split; unfold composition; simplify; + [1,3: apply (comp_assoc1); | 2,4: apply ((comp_assoc1 ????????) \sup -1);] +| intros; repeat split; unfold composition; simplify; apply id_neutral_left1; +| intros; repeat split; unfold composition; simplify; apply id_neutral_right1;] +qed. \ No newline at end of file