X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fmatita%2Fnlibrary%2Fsets%2Fsets.ma;h=113654ad330de847908ae68b3fcf65faaf9c3033;hb=924e808f1bc958a2d3c8ac05c96aeb8bc1f6d791;hp=f230957a765e1f877af40378ccd1e9269ac38dd6;hpb=d446c5ce6678ab367e26b76a7be522241fb17fc2;p=helm.git diff --git a/helm/software/matita/nlibrary/sets/sets.ma b/helm/software/matita/nlibrary/sets/sets.ma index f230957a7..113654ad3 100644 --- a/helm/software/matita/nlibrary/sets/sets.ma +++ b/helm/software/matita/nlibrary/sets/sets.ma @@ -116,7 +116,8 @@ unification hint 0 ≔ A; (* ----------------------------------------------------- *) ⊢ carr1 R ≡ ext_powerclass A. - +interpretation "prop21 mem" 'prop2 l r = (prop21 (setoid1_of_setoid ?) (ext_powerclass_setoid ?) ? ? ???? l r). + (* ncoercion ext_carr' : ∀A.∀x:ext_powerclass_setoid A. Ω^A ≝ ext_carr on _x : (carr1 (ext_powerclass_setoid ?)) to (Ω^?). @@ -138,11 +139,10 @@ unification hint 0 ≔ A:setoid, x, S; TT ≟ (mk_binary_morphism1 ??? (λx:setoid1_of_setoid ?.λS:ext_powerclass_setoid ?. x ∈ S) (prop21 ??? (mem_ext_powerclass_setoid_is_morph A))), - M1 ≟ ?, - M2 ≟ ?, - M3 ≟ ? + XX ≟ (ext_powerclass_setoid A) (*-------------------------------------*) ⊢ - fun21 M1 M2 M3 TT x S ≡ mem A SS x. + fun21 (setoid1_of_setoid A) XX CPROP TT x S + ≡ mem A SS x. nlemma subseteq_is_morph: ∀A. binary_morphism1 (ext_powerclass_setoid A) (ext_powerclass_setoid A) CPROP. #A; @ @@ -160,7 +160,7 @@ unification hint 0 ≔ A,a,a' nlemma intersect_is_ext: ∀A. 𝛀^A → 𝛀^A → 𝛀^A. #A; #S; #S'; @ (S ∩ S'); - #a; #a'; #Ha; @; *; #H1; #H2; @ + #a; #a'; #Ha; @; *; #H1; #H2; @ [##1,2: napply (. Ha^-1‡#); nassumption; ##|##3,4: napply (. Ha‡#); nassumption] nqed. @@ -193,14 +193,7 @@ unification hint 0 ≔ fun21 (powerclass_setoid A) (powerclass_setoid A) (powerclass_setoid A) R B C ≡ intersect ? B C. -ndefinition prop21_mem : - ∀A,C.∀f:binary_morphism1 (setoid1_of_setoid A) (ext_powerclass_setoid A) C. - ∀a,a':setoid1_of_setoid A. - ∀b,b':ext_powerclass_setoid A.a = a' → b = b' → f a b = f a' b'. -#A; #C; #f; #a; #a'; #b; #b'; #H1; #H2; napply prop21; nassumption; -nqed. - -interpretation "prop21 mem" 'prop2 l r = (prop21_mem ??????? l r). +interpretation "prop21 ext" 'prop2 l r = (prop21 (ext_powerclass_setoid ?) (ext_powerclass_setoid ?) ? ? ???? l r). nlemma intersect_is_ext_morph: ∀A. binary_morphism1 (ext_powerclass_setoid A) (ext_powerclass_setoid A) (ext_powerclass_setoid A). @@ -225,19 +218,31 @@ unification hint 1 ≔ intersect (carr A) BB CC. (* +alias symbol "hint_decl" = "hint_decl_Type2". +unification hint 0 ≔ + A : setoid, B,C : 𝛀^A ; + CC ≟ (ext_carr ? C), + BB ≟ (ext_carr ? B), + C1 ≟ (carr1 (powerclass_setoid (carr A))), + C2 ≟ (carr1 (ext_powerclass_setoid A)) + ⊢ + eq_rel1 C1 (eq1 (powerclass_setoid (carr A))) BB CC ≡ + eq_rel1 C2 (eq1 (ext_powerclass_setoid A)) B C. + +unification hint 0 ≔ + A, B : CPROP ⊢ iff A B ≡ eq_rel1 ? (eq1 CPROP) A B. - -nlemma test: ∀U.∀A,B:qpowerclass U. A ∩ B = A → +nlemma test: ∀U.∀A,B:𝛀^U. A ∩ B = A → ∀x,y. x=y → x ∈ A → y ∈ A ∩ B. - #U; #A; #B; #H; #x; #y; #K; #K2; napply (. #‡(?)); -##[ nchange with (A ∩ B = ?); - napply (prop21 ??? (mk_binary_morphism1 … (λS,S'.S ∩ S') (prop21 … (intersect_ok' U))) A A B B ##); - #H; napply H; + #U; #A; #B; #H; #x; #y; #K; #K2; + alias symbol "prop2" = "prop21 mem". + alias symbol "invert" = "setoid1 symmetry". + napply (. K^-1‡H); nassumption; nqed. -(* -nlemma intersect_ok: ∀A. binary_morphism1 (qpowerclass_setoid A) (qpowerclass_setoid A) (qpowerclass_setoid A). + +nlemma intersect_ok: ∀A. binary_morphism1 (ext_powerclass_setoid A) (ext_powerclass_setoid A) (ext_powerclass_setoid A). #A; @ [ #S; #S'; @ [ napply (S ∩ S') @@ -247,14 +252,16 @@ nlemma intersect_ok: ∀A. binary_morphism1 (qpowerclass_setoid A) (qpowerclass_ ##|##3,4: napply (. Ha‡#); nassumption]##] ##| #a; #a'; #b; #b'; #Ha; #Hb; nwhd; @; #x; nwhd in ⊢ (% → %); #H [ alias symbol "invert" = "setoid1 symmetry". - napply (. ((#‡Ha^-1)‡(#‡Hb^-1))); nassumption + alias symbol "refl" = "refl". +alias symbol "prop2" = "prop21". +napply (. ((#‡Ha^-1)‡(#‡Hb^-1))); nassumption | napply (. ((#‡Ha)‡(#‡Hb))); nassumption ]##] nqed. (* unfold if intersect, exposing fun21 *) alias symbol "hint_decl" = "hint_decl_Type1". unification hint 0 ≔ - A : setoid, B,C : qpowerclass A ⊢ + A : setoid, B,C : ext_powerclass A ⊢ pc A (fun21 … (mk_binary_morphism1 … (λS,S':qpowerclass_setoid A.mk_qpowerclass ? (S ∩ S') (mem_ok' ? (intersect_ok ? S S'))) @@ -316,12 +323,13 @@ nlemma first_omomorphism_theorem_functions1: #A; #B; #f; #x; napply refl; nqed. +alias symbol "eq" = "setoid eq". ndefinition surjective ≝ - λA,B.λS: qpowerclass A.λT: qpowerclass B.λf:unary_morphism A B. + λA,B.λS: ext_powerclass A.λT: ext_powerclass B.λf:unary_morphism A B. ∀y. y ∈ T → ∃x. x ∈ S ∧ f x = y. ndefinition injective ≝ - λA,B.λS: qpowerclass A.λf:unary_morphism A B. + λA,B.λS: ext_powerclass A.λf:unary_morphism A B. ∀x,x'. x ∈ S → x' ∈ S → f x = f x' → x = x'. nlemma first_omomorphism_theorem_functions2: @@ -337,13 +345,25 @@ nlemma first_omomorphism_theorem_functions3: #A; #B; #f; nwhd; #x; #x'; #Hx; #Hx'; #K; nassumption. nqed. -nrecord isomorphism (A, B : setoid) (S: qpowerclass A) (T: qpowerclass B) : Type[0] ≝ +nrecord isomorphism (A, B : setoid) (S: ext_powerclass A) (T: ext_powerclass B) : Type[0] ≝ { iso_f:> unary_morphism A B; f_closed: ∀x. x ∈ S → iso_f x ∈ T; f_sur: surjective … S T iso_f; f_inj: injective … S iso_f }. +nlemma subseteq_intersection_l: ∀A.∀U,V,W:Ω^A.U ⊆ W ∨ V ⊆ W → U ∩ V ⊆ W. +#A; #U; #V; #W; *; #H; #x; *; #xU; #xV; napply H; nassumption; +nqed. + +nlemma subseteq_union_l: ∀A.∀U,V,W:Ω^A.U ⊆ W → V ⊆ W → U ∪ V ⊆ W. +#A; #U; #V; #W; #H; #H1; #x; *; #Hx; ##[ napply H; ##| napply H1; ##] nassumption; +nqed. + +nlemma subseteq_intersection_r: ∀A.∀U,V,W:Ω^A.W ⊆ U → W ⊆ V → W ⊆ U ∩ V. +#A; #U; #V; #W; #H1; #H2; #x; #Hx; @; ##[ napply H1; ##| napply H2; ##] nassumption; +nqed. + (* nrecord isomorphism (A, B : setoid) (S: qpowerclass A) (T: qpowerclass B) : CProp[0] ≝ { iso_f:> unary_morphism A B; @@ -365,4 +385,3 @@ ncheck (λA:?. ; }. *) -*) \ No newline at end of file