From 3807c5d0fa5abceccbc67f40edb9939b353ead0e Mon Sep 17 00:00:00 2001 From: Claudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it> Date: Tue, 4 Aug 2009 21:22:30 +0000 Subject: [PATCH] More Gonthierism. Are they the right solution? --- .../matita/nlibrary/algebra/magmas.ma | 6 ++-- helm/software/matita/nlibrary/sets/sets.ma | 31 ++++++++++++++----- 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/helm/software/matita/nlibrary/algebra/magmas.ma b/helm/software/matita/nlibrary/algebra/magmas.ma index d4a650c5e..103d17557 100644 --- a/helm/software/matita/nlibrary/algebra/magmas.ma +++ b/helm/software/matita/nlibrary/algebra/magmas.ma @@ -63,12 +63,12 @@ ndefinition mm_counter_image: nrewrite < Hy1; napply (mmprop ⦠f)]##] nqed. +*) ndefinition m_intersect: âA. magma A â magma A â magma A. #A; #M1; #M2; napply (mk_magma â¦) - [ napply (M1 â© M2) + [ napply (intersects_ok ? M1 M2) | #x; #y; nwhd in ⢠(% â % â %); *; #Hx1; #Hx2; *; #Hy1; #Hy2; napply conj; napply op_closed; nassumption ] -nqed. -*) \ No newline at end of file +nqed. \ No newline at end of file diff --git a/helm/software/matita/nlibrary/sets/sets.ma b/helm/software/matita/nlibrary/sets/sets.ma index 20065cec4..f4b924dcc 100644 --- a/helm/software/matita/nlibrary/sets/sets.ma +++ b/helm/software/matita/nlibrary/sets/sets.ma @@ -14,7 +14,7 @@ include "logic/cprop.ma". -nrecord powerset (A: setoid) : Type[1] â { mem_op: unary_morphism1 A CPROP }. +nrecord powerset (A: setoid) : Type[1] â { mem_op:> unary_morphism1 A CPROP }. interpretation "powerset" 'powerset A = (powerset A). @@ -67,13 +67,30 @@ ndefinition overlaps â λA.λU,V:Ω \sup A.âx:A.x â U ⧠x â V. interpretation "overlaps" 'overlaps U V = (overlaps ? U V). -ndefinition intersects â λA.λU,V:Ω \sup A. {x | x â U ⧠x â V }. - #a; #a'; #H; napply mk_iff; *; #H1; #H2 - [ napply (. ((H^-1â¡#)â¡(H^-1â¡#))); nwhd; napply conj; nassumption - | napply (. ((Hâ¡#)â¡(Hâ¡#))); nwhd; napply conj; nassumption] +ndefinition intersects â λA:Type[0].λU,V:A â CProp[0]. λx. U x ⧠V x. + +interpretation "intersects" 'intersects U V = (intersects ? U V). + +(* dovrebbe essere un binario? *) +ndefinition intersects_ok: âA. Ω \sup A â Ω \sup A â Ω \sup A. + #A; #U; #V; napply mk_powerset; napply mk_unary_morphism1 + [ napply (intersects ? (mem_op ? U) (mem_op ? V)) + | #a; #a'; #H; napply mk_iff; *; #H1; #H2 + [ nwhd; napply (. ((H^-1â¡#)â¡(H^-1â¡#))); nwhd; napply conj; nassumption + | nwhd; napply (. ((Hâ¡#)â¡(Hâ¡#))); nwhd; napply conj; nassumption] +nqed. + +unification hint 0 (âA.âU,V: Ω \sup A.âw.(λx,y.True) + (intersects A U V w) (fun11 ?? (mem_op ? (intersects_ok A U V)) w)). + +nlemma test: âA. âU,V: Ω \sup A. âx,x':A. x=x' â (U â© V) x â (U â© V) x'. + #A; #U; #V; #x; #x'; #H; #p; + nwhd in ⢠(? ? % % ?); + (* l'unification hint non funziona *) + nchange with (? â (intersects_ok ? ? ?)); + napply (. (â H^-1)); + nassumption. nqed. - -(*interpretation "intersects" 'intersects U V = (intersects ? U V).*) (* ndefinition union â λA.λU,V:Ω \sup A. {x | x â U ⨠x â V }. -- 2.39.2