X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=weblib%2Ftutorial%2Fchapter8.ma;h=0e3293c1e79186894105304f7d6d3b9eefe45e25;hb=cac0166656e08399eaaf1a1e19f0ccea28c36d39;hp=c0d4d91dc25594fffa820ea7f23ad4b5155abd6f;hpb=fc43587e06d59afb5b1c65904372843d928fdfe5;p=helm.git diff --git a/weblib/tutorial/chapter8.ma b/weblib/tutorial/chapter8.ma index c0d4d91dc..0e3293c1e 100644 --- a/weblib/tutorial/chapter8.ma +++ b/weblib/tutorial/chapter8.ma @@ -13,243 +13,303 @@ reached the end of a + ϵ and we must pursue broadcasting inside (b*a + b)b. Aga parallel on the two additive subterms b^*a and b; the first point is allowed to both enter the star, and to traverse it, stopping in front of a; the second point just stops in front of b. No point reached that end of b^*a + b hence no further propagation is possible. In conclusion: - •((a + ϵ)(b^*a + b)b) = 〈(•a + ϵ)((•b)^*•a + •b)b, false〉 + •((a + ϵ)(b^*a + b)b) = 〈(•a + ϵ)((•b)^*•a + •b)b, false〉 *) - include "tutorial/chapter7.ma". -definition lo ≝ λS:DeqSet.λa,b:pre S.〈\fst a + \fst b,\snd a ∨ \snd b〉. +(* Broadcasting a point inside an item generates a pre, since the point could possibly reach +the end of the expression. +Broadcasting inside a i1+i2 amounts to broadcast in parallel inside i1 and i2. +If we define + 〈i1,b1〉 ⊕ 〈i2,b2〉 = 〈i1 + i2, b1∨ b2〉 +then, we just have •(i1+i2) = •(i1)⊕ •(i2). +*) + +img class="anchor" src="icons/tick.png" id="lo"definition lo ≝ λS:a href="cic:/matita/tutorial/chapter4/DeqSet.ind(1,0,0)"DeqSet/a.λa,b:a href="cic:/matita/tutorial/chapter7/pre.def(1)"pre/a S.a title="Pair construction" href="cic:/fakeuri.def(1)"〈/aa title="pair pi1" href="cic:/fakeuri.def(1)"\fst/a a a title="pitem or" href="cic:/fakeuri.def(1)"+/a a title="pair pi1" href="cic:/fakeuri.def(1)"\fst/a b,a title="pair pi2" href="cic:/fakeuri.def(1)"\snd/a a a title="boolean or" href="cic:/fakeuri.def(1)"∨/a a title="pair pi2" href="cic:/fakeuri.def(1)"\snd/a ba title="Pair construction" href="cic:/fakeuri.def(1)"〉/a. notation "a ⊕ b" left associative with precedence 60 for @{'oplus $a $b}. interpretation "oplus" 'oplus a b = (lo ? a b). -lemma lo_def: ∀S.∀i1,i2:pitem S.∀b1,b2. 〈i1,b1〉⊕〈i2,b2〉=〈i1+i2,b1∨b2〉. +img class="anchor" src="icons/tick.png" id="lo_def"lemma lo_def: ∀S.∀i1,i2:a href="cic:/matita/tutorial/chapter7/pitem.ind(1,0,1)"pitem/a S.∀b1,b2. a title="Pair construction" href="cic:/fakeuri.def(1)"〈/ai1,b1a title="Pair construction" href="cic:/fakeuri.def(1)"〉/aa title="oplus" href="cic:/fakeuri.def(1)"⊕/aa title="Pair construction" href="cic:/fakeuri.def(1)"〈/ai2,b2a title="Pair construction" href="cic:/fakeuri.def(1)"〉/aa title="leibnitz's equality" href="cic:/fakeuri.def(1)"=/aa title="Pair construction" href="cic:/fakeuri.def(1)"〈/ai1a title="pitem or" href="cic:/fakeuri.def(1)"+/ai2,b1a title="boolean or" href="cic:/fakeuri.def(1)"∨/ab2a title="Pair construction" href="cic:/fakeuri.def(1)"〉/a. // qed. -definition pre_concat_r ≝ λS:DeqSet.λi:pitem S.λe:pre S. - match e with [ mk_Prod i1 b ⇒ 〈i · i1, b〉]. +(* +Concatenation is a bit more complex. In order to broadcast a point inside i1 · i2 +we should start broadcasting it inside i1 and then proceed into i2 if and only if a +point reached the end of i1. This suggests to define •(i1 · i2) as •(i1) ▹ i2, where +e ▹ i is a general operation of concatenation between a pre and an item, defined by +cases on the boolean in e: + + 〈i1,true〉 ▹ i2 = i1 ◃ •(i_2) + 〈i1,false〉 ▹ i2 = i1 · i2 +In turn, ◃ says how to concatenate an item with a pre, that is however extremely simple: + i1 ◃ 〈i1,b〉 = 〈i_1 · i2, b〉 +Let us come to the formalized definitions: +*) + +img class="anchor" src="icons/tick.png" id="pre_concat_r"definition pre_concat_r ≝ λS:a href="cic:/matita/tutorial/chapter4/DeqSet.ind(1,0,0)"DeqSet/a.λi:a href="cic:/matita/tutorial/chapter7/pitem.ind(1,0,1)"pitem/a S.λe:a href="cic:/matita/tutorial/chapter7/pre.def(1)"pre/a S. + match e with [ mk_Prod i1 b ⇒ a title="Pair construction" href="cic:/fakeuri.def(1)"〈/ai a title="pitem cat" href="cic:/fakeuri.def(1)"·/a i1, ba title="Pair construction" href="cic:/fakeuri.def(1)"〉/a]. notation "i ◃ e" left associative with precedence 60 for @{'lhd $i $e}. interpretation "pre_concat_r" 'lhd i e = (pre_concat_r ? i e). -lemma eq_to_ex_eq: ∀S.∀A,B:word S → Prop. - A = B → A =1 B. -#S #A #B #H >H /2/ qed. +img class="anchor" src="icons/tick.png" id="eq_to_ex_eq"lemma eq_to_ex_eq: ∀S.∀A,B:a href="cic:/matita/tutorial/chapter6/word.def(3)"word/a S → Prop. + A a title="leibnitz's equality" href="cic:/fakeuri.def(1)"=/a B → A a title="extensional equality" href="cic:/fakeuri.def(1)"=/a1 B. +#S #A #B #H >H #x % // qed. + +(* The behaviour of ◃ is summarized by the following, easy lemma: *) -lemma sem_pre_concat_r : ∀S,i.∀e:pre S. - \sem{i ◃ e} =1 \sem{i} · \sem{|\fst e|} ∪ \sem{e}. -#S #i * #i1 #b1 cases b1 [2: @eq_to_ex_eq //] ->sem_pre_true >sem_cat >sem_pre_true /2/ +img class="anchor" src="icons/tick.png" id="sem_pre_concat_r"lemma sem_pre_concat_r : ∀S,i.∀e:a href="cic:/matita/tutorial/chapter7/pre.def(1)"pre/a S. + a title="in_prl" href="cic:/fakeuri.def(1)"\sem/a{i a title="pre_concat_r" href="cic:/fakeuri.def(1)"◃/a ea title="in_prl" href="cic:/fakeuri.def(1)"}/a a title="extensional equality" href="cic:/fakeuri.def(1)"=/a1 a title="in_pl" href="cic:/fakeuri.def(1)"\sem/a{ia title="in_pl" href="cic:/fakeuri.def(1)"}/a a title="cat lang" href="cic:/fakeuri.def(1)"·/a a title="in_l" href="cic:/fakeuri.def(1)"\sem/a{a title="forget" href="cic:/fakeuri.def(1)"|/aa title="pair pi1" href="cic:/fakeuri.def(1)"\fst/a ea title="forget" href="cic:/fakeuri.def(1)"|/aa title="in_l" href="cic:/fakeuri.def(1)"}/a a title="union" href="cic:/fakeuri.def(1)"∪/a a title="in_prl" href="cic:/fakeuri.def(1)"\sem/a{ea title="in_prl" href="cic:/fakeuri.def(1)"}/a. +#S #i * #i1 #b1 cases b1 [2: @a href="cic:/matita/tutorial/chapter8/eq_to_ex_eq.def(4)"eq_to_ex_eq/a //] +>a href="cic:/matita/tutorial/chapter7/sem_pre_true.def(9)"sem_pre_true/a >a href="cic:/matita/tutorial/chapter7/sem_cat.def(8)"sem_cat/a >a href="cic:/matita/tutorial/chapter7/sem_pre_true.def(9)"sem_pre_true/a /span class="autotactic"2span class="autotrace" trace /span/span/ qed. -definition pre_concat_l ≝ λS:DeqSet.λbcast:∀S:DeqSet.pitem S → pre S.λe1:pre S.λi2:pitem S. +(* The definition of $•(-)$ (eclose) and ▹ (pre_concat_l) are mutually recursive. +In this situation, a viable alternative that is usually simpler to reason about, +is to abstract one of the two functions with respect to the other. In particular +we abstract pre_concat_l with respect to an input bcast function from items to +pres. *) + +img class="anchor" src="icons/tick.png" id="pre_concat_l"definition pre_concat_l ≝ λS:a href="cic:/matita/tutorial/chapter4/DeqSet.ind(1,0,0)"DeqSet/a.λbcast:∀S:a href="cic:/matita/tutorial/chapter4/DeqSet.ind(1,0,0)"DeqSet/a.a href="cic:/matita/tutorial/chapter7/pitem.ind(1,0,1)"pitem/a S → a href="cic:/matita/tutorial/chapter7/pre.def(1)"pre/a S.λe1:a href="cic:/matita/tutorial/chapter7/pre.def(1)"pre/a S.λi2:a href="cic:/matita/tutorial/chapter7/pitem.ind(1,0,1)"pitem/a S. match e1 with [ mk_Prod i1 b1 ⇒ match b1 with - [ true ⇒ (i1 ◃ (bcast ? i2)) - | false ⇒ 〈i1 · i2,false〉 + [ true ⇒ (i1 a title="pre_concat_r" href="cic:/fakeuri.def(1)"◃/a (bcast ? i2)) + | false ⇒ a title="Pair construction" href="cic:/fakeuri.def(1)"〈/ai1 a title="pitem cat" href="cic:/fakeuri.def(1)"·/a i2,a href="cic:/matita/basics/bool/bool.con(0,2,0)"false/aa title="Pair construction" href="cic:/fakeuri.def(1)"〉/a ] ]. notation "a ▹ b" left associative with precedence 60 for @{'tril eclose $a $b}. interpretation "item-pre concat" 'tril op a b = (pre_concat_l ? op a b). +(* We are ready to give the formal definition of the broadcasting operation. *) + notation "•" non associative with precedence 60 for @{eclose ?}. -let rec eclose (S: DeqSet) (i: pitem S) on i : pre S ≝ +img class="anchor" src="icons/tick.png" id="eclose"let rec eclose (S: a href="cic:/matita/tutorial/chapter4/DeqSet.ind(1,0,0)"DeqSet/a) (i: a href="cic:/matita/tutorial/chapter7/pitem.ind(1,0,1)"pitem/a S) on i : a href="cic:/matita/tutorial/chapter7/pre.def(1)"pre/a S ≝ match i with - [ pz ⇒ 〈 `∅, false 〉 - | pe ⇒ 〈 ϵ, true 〉 - | ps x ⇒ 〈 `.x, false〉 - | pp x ⇒ 〈 `.x, false 〉 - | po i1 i2 ⇒ •i1 ⊕ •i2 - | pc i1 i2 ⇒ •i1 ▹ i2 - | pk i ⇒ 〈(\fst (•i))^*,true〉]. + [ pz ⇒ a title="Pair construction" href="cic:/fakeuri.def(1)"〈/a a href="cic:/matita/tutorial/chapter7/pitem.con(0,1,1)"pz/a ?, a href="cic:/matita/basics/bool/bool.con(0,2,0)"false/a a title="Pair construction" href="cic:/fakeuri.def(1)"〉/a + | pe ⇒ a title="Pair construction" href="cic:/fakeuri.def(1)"〈/a a title="pitem epsilon" href="cic:/fakeuri.def(1)"ϵ/a, a href="cic:/matita/basics/bool/bool.con(0,1,0)"true/a a title="Pair construction" href="cic:/fakeuri.def(1)"〉/a + | ps x ⇒ a title="Pair construction" href="cic:/fakeuri.def(1)"〈/a a title="pitem pp" href="cic:/fakeuri.def(1)"`/aa title="pitem pp" href="cic:/fakeuri.def(1)"./ax, a href="cic:/matita/basics/bool/bool.con(0,2,0)"false/aa title="Pair construction" href="cic:/fakeuri.def(1)"〉/a + | pp x ⇒ a title="Pair construction" href="cic:/fakeuri.def(1)"〈/a a title="pitem pp" href="cic:/fakeuri.def(1)"`/aa title="pitem pp" href="cic:/fakeuri.def(1)"./ax, a href="cic:/matita/basics/bool/bool.con(0,2,0)"false/a a title="Pair construction" href="cic:/fakeuri.def(1)"〉/a + | po i1 i2 ⇒ •i1 a title="oplus" href="cic:/fakeuri.def(1)"⊕/a •i2 + | pc i1 i2 ⇒ •i1 a title="item-pre concat" href="cic:/fakeuri.def(1)"▹/a i2 + | pk i ⇒ a title="Pair construction" href="cic:/fakeuri.def(1)"〈/a(a title="pair pi1" href="cic:/fakeuri.def(1)"\fst/a (•i))a title="pitem star" href="cic:/fakeuri.def(1)"^/aa title="pitem star" href="cic:/fakeuri.def(1)"*/a,a href="cic:/matita/basics/bool/bool.con(0,1,0)"true/aa title="Pair construction" href="cic:/fakeuri.def(1)"〉/a]. notation "• x" non associative with precedence 60 for @{'eclose $x}. interpretation "eclose" 'eclose x = (eclose ? x). -lemma eclose_plus: ∀S:DeqSet.∀i1,i2:pitem S. - •(i1 + i2) = •i1 ⊕ •i2. +(* Here are a few simple properties of ▹ and •(-) *) + +img class="anchor" src="icons/tick.png" id="pcl_true"lemma pcl_true : ∀S.∀i1,i2:a href="cic:/matita/tutorial/chapter7/pitem.ind(1,0,1)"pitem/a S. + a title="Pair construction" href="cic:/fakeuri.def(1)"〈/ai1,a href="cic:/matita/basics/bool/bool.con(0,1,0)"true/aa title="Pair construction" href="cic:/fakeuri.def(1)"〉/a a title="item-pre concat" href="cic:/fakeuri.def(1)"▹/a i2 a title="leibnitz's equality" href="cic:/fakeuri.def(1)"=/a i1 a title="pre_concat_r" href="cic:/fakeuri.def(1)"◃/a (a title="eclose" href="cic:/fakeuri.def(1)"•/ai2). // qed. -lemma eclose_dot: ∀S:DeqSet.∀i1,i2:pitem S. - •(i1 · i2) = •i1 ▹ i2. +img class="anchor" src="icons/tick.png" id="pcl_true_bis"lemma pcl_true_bis : ∀S.∀i1,i2:a href="cic:/matita/tutorial/chapter7/pitem.ind(1,0,1)"pitem/a S. + a title="Pair construction" href="cic:/fakeuri.def(1)"〈/ai1,a href="cic:/matita/basics/bool/bool.con(0,1,0)"true/aa title="Pair construction" href="cic:/fakeuri.def(1)"〉/a a title="item-pre concat" href="cic:/fakeuri.def(1)"▹/a i2 a title="leibnitz's equality" href="cic:/fakeuri.def(1)"=/a a title="Pair construction" href="cic:/fakeuri.def(1)"〈/ai1 a title="pitem cat" href="cic:/fakeuri.def(1)"·/a a title="pair pi1" href="cic:/fakeuri.def(1)"\fst/a (a title="eclose" href="cic:/fakeuri.def(1)"•/ai2), a title="pair pi2" href="cic:/fakeuri.def(1)"\snd/a (a title="eclose" href="cic:/fakeuri.def(1)"•/ai2)a title="Pair construction" href="cic:/fakeuri.def(1)"〉/a. +#S #i1 #i2 normalize cases (a title="eclose" href="cic:/fakeuri.def(1)"•/ai2) // qed. + +img class="anchor" src="icons/tick.png" id="pcl_false"lemma pcl_false: ∀S.∀i1,i2:a href="cic:/matita/tutorial/chapter7/pitem.ind(1,0,1)"pitem/a S. + a title="Pair construction" href="cic:/fakeuri.def(1)"〈/ai1,a href="cic:/matita/basics/bool/bool.con(0,2,0)"false/aa title="Pair construction" href="cic:/fakeuri.def(1)"〉/a a title="item-pre concat" href="cic:/fakeuri.def(1)"▹/a i2 a title="leibnitz's equality" href="cic:/fakeuri.def(1)"=/a a title="Pair construction" href="cic:/fakeuri.def(1)"〈/ai1 a title="pitem cat" href="cic:/fakeuri.def(1)"·/a i2, a href="cic:/matita/basics/bool/bool.con(0,2,0)"false/aa title="Pair construction" href="cic:/fakeuri.def(1)"〉/a. +// qed. + +img class="anchor" src="icons/tick.png" id="eclose_plus"lemma eclose_plus: ∀S:a href="cic:/matita/tutorial/chapter4/DeqSet.ind(1,0,0)"DeqSet/a.∀i1,i2:a href="cic:/matita/tutorial/chapter7/pitem.ind(1,0,1)"pitem/a S. + a title="eclose" href="cic:/fakeuri.def(1)"•/a(i1 a title="pitem or" href="cic:/fakeuri.def(1)"+/a i2) a title="leibnitz's equality" href="cic:/fakeuri.def(1)"=/a a title="eclose" href="cic:/fakeuri.def(1)"•/ai1 a title="oplus" href="cic:/fakeuri.def(1)"⊕/a a title="eclose" href="cic:/fakeuri.def(1)"•/ai2. +// qed. + +img class="anchor" src="icons/tick.png" id="eclose_dot"lemma eclose_dot: ∀S:a href="cic:/matita/tutorial/chapter4/DeqSet.ind(1,0,0)"DeqSet/a.∀i1,i2:a href="cic:/matita/tutorial/chapter7/pitem.ind(1,0,1)"pitem/a S. + a title="eclose" href="cic:/fakeuri.def(1)"•/a(i1 a title="pitem cat" href="cic:/fakeuri.def(1)"·/a i2) a title="leibnitz's equality" href="cic:/fakeuri.def(1)"=/a a title="eclose" href="cic:/fakeuri.def(1)"•/ai1 a title="item-pre concat" href="cic:/fakeuri.def(1)"▹/a i2. // qed. -lemma eclose_star: ∀S:DeqSet.∀i:pitem S. - •i^* = 〈(\fst(•i))^*,true〉. +img class="anchor" src="icons/tick.png" id="eclose_star"lemma eclose_star: ∀S:a href="cic:/matita/tutorial/chapter4/DeqSet.ind(1,0,0)"DeqSet/a.∀i:a href="cic:/matita/tutorial/chapter7/pitem.ind(1,0,1)"pitem/a S. + a title="eclose" href="cic:/fakeuri.def(1)"•/aia title="pitem star" href="cic:/fakeuri.def(1)"^/aa title="pitem star" href="cic:/fakeuri.def(1)"*/a a title="leibnitz's equality" href="cic:/fakeuri.def(1)"=/a a title="Pair construction" href="cic:/fakeuri.def(1)"〈/a(a title="pair pi1" href="cic:/fakeuri.def(1)"\fst/a(a title="eclose" href="cic:/fakeuri.def(1)"•/ai))a title="pitem star" href="cic:/fakeuri.def(1)"^/aa title="pitem star" href="cic:/fakeuri.def(1)"*/a,a href="cic:/matita/basics/bool/bool.con(0,1,0)"true/aa title="Pair construction" href="cic:/fakeuri.def(1)"〉/a. // qed. -definition lift ≝ λS.λf:pitem S →pre S.λe:pre S. +(* The definition of •(-) (eclose) can then be lifted from items to pres +in the obvious way. *) + +img class="anchor" src="icons/tick.png" id="lift"definition lift ≝ λS.λf:a href="cic:/matita/tutorial/chapter7/pitem.ind(1,0,1)"pitem/a S →a href="cic:/matita/tutorial/chapter7/pre.def(1)"pre/a S.λe:a href="cic:/matita/tutorial/chapter7/pre.def(1)"pre/a S. match e with - [ mk_Prod i b ⇒ 〈\fst (f i), \snd (f i) ∨ b〉]. + [ mk_Prod i b ⇒ a title="Pair construction" href="cic:/fakeuri.def(1)"〈/aa title="pair pi1" href="cic:/fakeuri.def(1)"\fst/a (f i), a title="pair pi2" href="cic:/fakeuri.def(1)"\snd/a (f i) a title="boolean or" href="cic:/fakeuri.def(1)"∨/a ba title="Pair construction" href="cic:/fakeuri.def(1)"〉/a]. -definition preclose ≝ λS. lift S (eclose S). +img class="anchor" src="icons/tick.png" id="preclose"definition preclose ≝ λS. a href="cic:/matita/tutorial/chapter8/lift.def(2)"lift/a S (a href="cic:/matita/tutorial/chapter8/eclose.fix(0,1,4)"eclose/a S). interpretation "preclose" 'eclose x = (preclose ? x). -(* theorem 16: 2 *) -lemma sem_oplus: ∀S:DeqSet.∀e1,e2:pre S. - \sem{e1 ⊕ e2} =1 \sem{e1} ∪ \sem{e2}. -#S * #i1 #b1 * #i2 #b2 #w % - [cases b1 cases b2 normalize /2/ * /3/ * /3/ - |cases b1 cases b2 normalize /2/ * /3/ * /3/ +(* Obviously, broadcasting does not change the carrier of the item, +as it is easily proved by structural induction. *) + +img class="anchor" src="icons/tick.png" id="erase_bull"lemma erase_bull : ∀S.∀i:a href="cic:/matita/tutorial/chapter7/pitem.ind(1,0,1)"pitem/a S. a title="forget" href="cic:/fakeuri.def(1)"|/aa title="pair pi1" href="cic:/fakeuri.def(1)"\fst/a (a title="eclose" href="cic:/fakeuri.def(1)"•/ai)a title="forget" href="cic:/fakeuri.def(1)"|/a a title="leibnitz's equality" href="cic:/fakeuri.def(1)"=/a a title="forget" href="cic:/fakeuri.def(1)"|/aia title="forget" href="cic:/fakeuri.def(1)"|/a. +#S #i elim i // + [ #i1 #i2 #IH1 #IH2 >a href="cic:/matita/tutorial/chapter7/erase_dot.def(4)"erase_dot/a a href="cic:/matita/tutorial/chapter8/eclose_dot.def(5)"eclose_dot/a + cases (a title="eclose" href="cic:/fakeuri.def(1)"•/ai1) #i11 #b1 cases b1 // a href="cic:/matita/tutorial/chapter8/pcl_true_bis.def(5)"pcl_true_bis/a // + | #i1 #i2 #IH1 #IH2 >a href="cic:/matita/tutorial/chapter8/eclose_plus.def(5)"eclose_plus/a >(a href="cic:/matita/tutorial/chapter7/erase_plus.def(4)"erase_plus/a … i1) a href="cic:/matita/tutorial/chapter8/eclose_star.def(5)"eclose_star/a >(a href="cic:/matita/tutorial/chapter7/erase_star.def(4)"erase_star/a … i) erase_dot eclose_dot - cases (•i1) #i11 #b1 cases b1 // odot_true_bis // - | #i1 #i2 #IH1 #IH2 >eclose_plus >(erase_plus … i1) eclose_star >(erase_star … i) odot_false >sem_pre_false >sem_pre_false >sem_cat /2/ - |#H >odot_true >sem_pre_true @(eqP_trans … (sem_pre_concat_r …)) - >erase_bull @eqP_trans [|@(eqP_union_l … H)] - @eqP_trans [|@eqP_union_l[|@union_comm ]] - @eqP_trans [|@eqP_sym @union_assoc ] /3/ + [2:#th >a href="cic:/matita/tutorial/chapter8/pcl_false.def(5)"pcl_false/a >a href="cic:/matita/tutorial/chapter7/sem_pre_false.def(9)"sem_pre_false/a >a href="cic:/matita/tutorial/chapter7/sem_pre_false.def(9)"sem_pre_false/a >a href="cic:/matita/tutorial/chapter7/sem_cat.def(8)"sem_cat/a /span class="autotactic"2span class="autotrace" trace a href="cic:/matita/tutorial/chapter8/eq_to_ex_eq.def(4)"eq_to_ex_eq/a/span/span/ + |#H >a href="cic:/matita/tutorial/chapter8/pcl_true.def(5)"pcl_true/a >a href="cic:/matita/tutorial/chapter7/sem_pre_true.def(9)"sem_pre_true/a @(a href="cic:/matita/tutorial/chapter4/eqP_trans.def(3)"eqP_trans/a … (a href="cic:/matita/tutorial/chapter8/sem_pre_concat_r.def(10)"sem_pre_concat_r/a …)) + >a href="cic:/matita/tutorial/chapter8/erase_bull.def(6)"erase_bull/a @a href="cic:/matita/tutorial/chapter4/eqP_trans.def(3)"eqP_trans/a [|@(a href="cic:/matita/tutorial/chapter4/eqP_union_l.def(3)"eqP_union_l/a … H)] + @a href="cic:/matita/tutorial/chapter4/eqP_trans.def(3)"eqP_trans/a [|@a href="cic:/matita/tutorial/chapter4/eqP_union_l.def(3)"eqP_union_l/a[|@a href="cic:/matita/tutorial/chapter4/union_comm.def(3)"union_comm/a ]] + @a href="cic:/matita/tutorial/chapter4/eqP_trans.def(3)"eqP_trans/a [|@a href="cic:/matita/tutorial/chapter4/eqP_sym.def(3)"eqP_sym/a @a href="cic:/matita/tutorial/chapter4/union_assoc.def(3)"union_assoc/a ] /span class="autotactic"3span class="autotrace" trace a href="cic:/matita/tutorial/chapter4/eqP_union_r.def(3)"eqP_union_r/a, a href="cic:/matita/tutorial/chapter4/eqP_sym.def(3)"eqP_sym/a/span/span/ ] qed. -lemma minus_eps_pre_aux: ∀S.∀e:pre S.∀i:pitem S.∀A. - \sem{e} =1 \sem{i} ∪ A → \sem{\fst e} =1 \sem{i} ∪ (A - {[ ]}). +img class="anchor" src="icons/tick.png" id="minus_eps_pre_aux"lemma minus_eps_pre_aux: ∀S.∀e:a href="cic:/matita/tutorial/chapter7/pre.def(1)"pre/a S.∀i:a href="cic:/matita/tutorial/chapter7/pitem.ind(1,0,1)"pitem/a S.∀A. + a title="in_prl" href="cic:/fakeuri.def(1)"\sem/a{ea title="in_prl" href="cic:/fakeuri.def(1)"}/a a title="extensional equality" href="cic:/fakeuri.def(1)"=/a1 a title="in_pl" href="cic:/fakeuri.def(1)"\sem/a{ia title="in_pl" href="cic:/fakeuri.def(1)"}/a a title="union" href="cic:/fakeuri.def(1)"∪/a A → a title="in_pl" href="cic:/fakeuri.def(1)"\sem/a{a title="pair pi1" href="cic:/fakeuri.def(1)"\fst/a ea title="in_pl" href="cic:/fakeuri.def(1)"}/a a title="extensional equality" href="cic:/fakeuri.def(1)"=/a1 a title="in_pl" href="cic:/fakeuri.def(1)"\sem/a{ia title="in_pl" href="cic:/fakeuri.def(1)"}/a a title="union" href="cic:/fakeuri.def(1)"∪/a (A a title="substraction" href="cic:/fakeuri.def(1)"-/a a title="singleton" href="cic:/fakeuri.def(1)"{/aa title="nil" href="cic:/fakeuri.def(1)"[/a a title="nil" href="cic:/fakeuri.def(1)"]/aa title="singleton" href="cic:/fakeuri.def(1)"}/a). #S #e #i #A #seme -@eqP_trans [|@minus_eps_pre] -@eqP_trans [||@eqP_union_r [|@eqP_sym @minus_eps_item]] -@eqP_trans [||@distribute_substract] -@eqP_substract_r // +@a href="cic:/matita/tutorial/chapter4/eqP_trans.def(3)"eqP_trans/a [|@a href="cic:/matita/tutorial/chapter7/minus_eps_pre.def(10)"minus_eps_pre/a] +@a href="cic:/matita/tutorial/chapter4/eqP_trans.def(3)"eqP_trans/a [||@a href="cic:/matita/tutorial/chapter4/eqP_union_r.def(3)"eqP_union_r/a [|@a href="cic:/matita/tutorial/chapter4/eqP_sym.def(3)"eqP_sym/a @a href="cic:/matita/tutorial/chapter7/minus_eps_item.def(9)"minus_eps_item/a]] +@a href="cic:/matita/tutorial/chapter4/eqP_trans.def(3)"eqP_trans/a [||@a href="cic:/matita/tutorial/chapter4/distribute_substract.def(3)"distribute_substract/a] +@a href="cic:/matita/tutorial/chapter4/eqP_substract_r.def(3)"eqP_substract_r/a // qed. -(* theorem 16: 1 *) -theorem sem_bull: ∀S:DeqSet. ∀i:pitem S. \sem{•i} =1 \sem{i} ∪ \sem{|i|}. +img class="anchor" src="icons/tick.png" id="sem_bull"theorem sem_bull: ∀S:a href="cic:/matita/tutorial/chapter4/DeqSet.ind(1,0,0)"DeqSet/a. ∀i:a href="cic:/matita/tutorial/chapter7/pitem.ind(1,0,1)"pitem/a S. a title="in_prl" href="cic:/fakeuri.def(1)"\sem/a{a title="eclose" href="cic:/fakeuri.def(1)"•/aia title="in_prl" href="cic:/fakeuri.def(1)"}/a a title="extensional equality" href="cic:/fakeuri.def(1)"=/a1 a title="in_pl" href="cic:/fakeuri.def(1)"\sem/a{ia title="in_pl" href="cic:/fakeuri.def(1)"}/a a title="union" href="cic:/fakeuri.def(1)"∪/a a title="in_l" href="cic:/fakeuri.def(1)"\sem/a{a title="forget" href="cic:/fakeuri.def(1)"|/aia title="forget" href="cic:/fakeuri.def(1)"|/aa title="in_l" href="cic:/fakeuri.def(1)"}/a. #S #e elim e - [#w normalize % [/2/ | * //] - |/2/ - |#x normalize #w % [ /2/ | * [@False_ind | //]] - |#x normalize #w % [ /2/ | * // ] - |#i1 #i2 #IH1 #IH2 >eclose_dot - @eqP_trans [|@odot_dot_aux //] >sem_cat - @eqP_trans - [|@eqP_union_r - [|@eqP_trans [|@(cat_ext_l … IH1)] @distr_cat_r]] - @eqP_trans [|@union_assoc] - @eqP_trans [||@eqP_sym @union_assoc] - @eqP_union_l // - |#i1 #i2 #IH1 #IH2 >eclose_plus - @eqP_trans [|@sem_oplus] >sem_plus >erase_plus - @eqP_trans [|@(eqP_union_l … IH2)] - @eqP_trans [|@eqP_sym @union_assoc] - @eqP_trans [||@union_assoc] @eqP_union_r - @eqP_trans [||@eqP_sym @union_assoc] - @eqP_trans [||@eqP_union_l [|@union_comm]] - @eqP_trans [||@union_assoc] /2/ - |#i #H >sem_pre_true >sem_star >erase_bull >sem_star - @eqP_trans [|@eqP_union_r [|@cat_ext_l [|@minus_eps_pre_aux //]]] - @eqP_trans [|@eqP_union_r [|@distr_cat_r]] - @eqP_trans [|@union_assoc] @eqP_union_l >erase_star - @eqP_sym @star_fix_eps + [#w normalize % [/span class="autotactic"2span class="autotrace" trace a href="cic:/matita/basics/logic/Or.con(0,2,2)"or_intror/a/span/span/ | * //] + |/span class="autotactic"2span class="autotrace" trace a href="cic:/matita/tutorial/chapter8/eq_to_ex_eq.def(4)"eq_to_ex_eq/a/span/span/ + |#x normalize #w % [ /span class="autotactic"2span class="autotrace" trace a href="cic:/matita/basics/logic/Or.con(0,2,2)"or_intror/a/span/span/ | * [@a href="cic:/matita/basics/logic/False_ind.fix(0,1,1)"False_ind/a | //]] + |#x normalize #w % [ /span class="autotactic"2span class="autotrace" trace a href="cic:/matita/basics/logic/Or.con(0,2,2)"or_intror/a/span/span/ | * // ] + |#i1 #i2 #IH1 #IH2 >a href="cic:/matita/tutorial/chapter8/eclose_dot.def(5)"eclose_dot/a + @a href="cic:/matita/tutorial/chapter4/eqP_trans.def(3)"eqP_trans/a [|@a href="cic:/matita/tutorial/chapter8/sem_pcl_aux.def(11)"sem_pcl_aux/a //] >a href="cic:/matita/tutorial/chapter7/sem_cat.def(8)"sem_cat/a + @a href="cic:/matita/tutorial/chapter4/eqP_trans.def(3)"eqP_trans/a + [|@a href="cic:/matita/tutorial/chapter4/eqP_union_r.def(3)"eqP_union_r/a + [|@a href="cic:/matita/tutorial/chapter4/eqP_trans.def(3)"eqP_trans/a [|@(a href="cic:/matita/tutorial/chapter6/cat_ext_l.def(5)"cat_ext_l/a … IH1)] @a href="cic:/matita/tutorial/chapter6/distr_cat_r.def(5)"distr_cat_r/a]] + @a href="cic:/matita/tutorial/chapter4/eqP_trans.def(3)"eqP_trans/a [|@a href="cic:/matita/tutorial/chapter4/union_assoc.def(3)"union_assoc/a] + @a href="cic:/matita/tutorial/chapter4/eqP_trans.def(3)"eqP_trans/a [||@a href="cic:/matita/tutorial/chapter4/eqP_sym.def(3)"eqP_sym/a @a href="cic:/matita/tutorial/chapter4/union_assoc.def(3)"union_assoc/a] + @a href="cic:/matita/tutorial/chapter4/eqP_union_l.def(3)"eqP_union_l/a // + |#i1 #i2 #IH1 #IH2 >a href="cic:/matita/tutorial/chapter8/eclose_plus.def(5)"eclose_plus/a + @a href="cic:/matita/tutorial/chapter4/eqP_trans.def(3)"eqP_trans/a [|@a href="cic:/matita/tutorial/chapter8/sem_oplus.def(9)"sem_oplus/a] >a href="cic:/matita/tutorial/chapter7/sem_plus.def(8)"sem_plus/a >a href="cic:/matita/tutorial/chapter7/erase_plus.def(4)"erase_plus/a + @a href="cic:/matita/tutorial/chapter4/eqP_trans.def(3)"eqP_trans/a [|@(a href="cic:/matita/tutorial/chapter4/eqP_union_l.def(3)"eqP_union_l/a … IH2)] + @a href="cic:/matita/tutorial/chapter4/eqP_trans.def(3)"eqP_trans/a [|@a href="cic:/matita/tutorial/chapter4/eqP_sym.def(3)"eqP_sym/a @a href="cic:/matita/tutorial/chapter4/union_assoc.def(3)"union_assoc/a] + @a href="cic:/matita/tutorial/chapter4/eqP_trans.def(3)"eqP_trans/a [||@a href="cic:/matita/tutorial/chapter4/union_assoc.def(3)"union_assoc/a] @a href="cic:/matita/tutorial/chapter4/eqP_union_r.def(3)"eqP_union_r/a + @a href="cic:/matita/tutorial/chapter4/eqP_trans.def(3)"eqP_trans/a [||@a href="cic:/matita/tutorial/chapter4/eqP_sym.def(3)"eqP_sym/a @a href="cic:/matita/tutorial/chapter4/union_assoc.def(3)"union_assoc/a] + @a href="cic:/matita/tutorial/chapter4/eqP_trans.def(3)"eqP_trans/a [||@a href="cic:/matita/tutorial/chapter4/eqP_union_l.def(3)"eqP_union_l/a [|@a href="cic:/matita/tutorial/chapter4/union_comm.def(3)"union_comm/a]] + @a href="cic:/matita/tutorial/chapter4/eqP_trans.def(3)"eqP_trans/a [||@a href="cic:/matita/tutorial/chapter4/union_assoc.def(3)"union_assoc/a] /span class="autotactic"2span class="autotrace" trace a href="cic:/matita/tutorial/chapter4/eqP_union_r.def(3)"eqP_union_r/a/span/span/ + |#i #H >a href="cic:/matita/tutorial/chapter7/sem_pre_true.def(9)"sem_pre_true/a >a href="cic:/matita/tutorial/chapter7/sem_star.def(8)"sem_star/a >a href="cic:/matita/tutorial/chapter8/erase_bull.def(6)"erase_bull/a >a href="cic:/matita/tutorial/chapter7/sem_star.def(8)"sem_star/a + @a href="cic:/matita/tutorial/chapter4/eqP_trans.def(3)"eqP_trans/a [|@a href="cic:/matita/tutorial/chapter4/eqP_union_r.def(3)"eqP_union_r/a [|@a href="cic:/matita/tutorial/chapter6/cat_ext_l.def(5)"cat_ext_l/a [|@a href="cic:/matita/tutorial/chapter8/minus_eps_pre_aux.def(11)"minus_eps_pre_aux/a //]]] + @a href="cic:/matita/tutorial/chapter4/eqP_trans.def(3)"eqP_trans/a [|@a href="cic:/matita/tutorial/chapter4/eqP_union_r.def(3)"eqP_union_r/a [|@a href="cic:/matita/tutorial/chapter6/distr_cat_r.def(5)"distr_cat_r/a]] + @a href="cic:/matita/tutorial/chapter4/eqP_trans.def(3)"eqP_trans/a [|@a href="cic:/matita/tutorial/chapter4/union_assoc.def(3)"union_assoc/a] @a href="cic:/matita/tutorial/chapter4/eqP_union_l.def(3)"eqP_union_l/a >a href="cic:/matita/tutorial/chapter7/erase_star.def(4)"erase_star/a + @a href="cic:/matita/tutorial/chapter4/eqP_sym.def(3)"eqP_sym/a @a href="cic:/matita/tutorial/chapter6/star_fix_eps.def(7)"star_fix_eps/a ] qed. -(* blank item *) -let rec blank (S: DeqSet) (i: re S) on i :pitem S ≝ +(* +h2Blank item/h2 + +As a corollary of theorem sem_bullet, given a regular expression e, we can easily +find an item with the same semantics of $e$: it is enough to get an item (blank e) +having e as carrier and no point, and then broadcast a point in it. The semantics of +(blank e) is obviously the empty language: from the point of view of the automaton, +it corresponds with the pit state. *) + +img class="anchor" src="icons/tick.png" id="blank"let rec blank (S: a href="cic:/matita/tutorial/chapter4/DeqSet.ind(1,0,0)"DeqSet/a) (i: a href="cic:/matita/tutorial/chapter7/re.ind(1,0,1)"re/a S) on i :a href="cic:/matita/tutorial/chapter7/pitem.ind(1,0,1)"pitem/a S ≝ match i with - [ z ⇒ `∅ - | e ⇒ ϵ - | s y ⇒ `y - | o e1 e2 ⇒ (blank S e1) + (blank S e2) - | c e1 e2 ⇒ (blank S e1) · (blank S e2) - | k e ⇒ (blank S e)^* ]. + [ z ⇒ a href="cic:/matita/tutorial/chapter7/pitem.con(0,1,1)"pz/a ? + | e ⇒ a title="pitem epsilon" href="cic:/fakeuri.def(1)"ϵ/a + | s y ⇒ a title="pitem ps" href="cic:/fakeuri.def(1)"`/ay + | o e1 e2 ⇒ (blank S e1) a title="pitem or" href="cic:/fakeuri.def(1)"+/a (blank S e2) + | c e1 e2 ⇒ (blank S e1) a title="pitem cat" href="cic:/fakeuri.def(1)"·/a (blank S e2) + | k e ⇒ (blank S e)a title="pitem star" href="cic:/fakeuri.def(1)"^/aa title="pitem star" href="cic:/fakeuri.def(1)"*/a ]. -lemma forget_blank: ∀S.∀e:re S.|blank S e| = e. +img class="anchor" src="icons/tick.png" id="forget_blank"lemma forget_blank: ∀S.∀e:a href="cic:/matita/tutorial/chapter7/re.ind(1,0,1)"re/a S.a title="forget" href="cic:/fakeuri.def(1)"|/aa href="cic:/matita/tutorial/chapter8/blank.fix(0,1,3)"blank/a S ea title="forget" href="cic:/fakeuri.def(1)"|/a a title="leibnitz's equality" href="cic:/fakeuri.def(1)"=/a e. #S #e elim e normalize // qed. -lemma sem_blank: ∀S.∀e:re S.\sem{blank S e} =1 ∅. +img class="anchor" src="icons/tick.png" id="sem_blank"lemma sem_blank: ∀S.∀e:a href="cic:/matita/tutorial/chapter7/re.ind(1,0,1)"re/a S.a title="in_pl" href="cic:/fakeuri.def(1)"\sem/a{a href="cic:/matita/tutorial/chapter8/blank.fix(0,1,3)"blank/a S ea title="in_pl" href="cic:/fakeuri.def(1)"}/a a title="extensional equality" href="cic:/fakeuri.def(1)"=/a1 a title="empty set" href="cic:/fakeuri.def(1)"∅/a. #S #e elim e - [1,2:@eq_to_ex_eq // - |#s @eq_to_ex_eq // - |#e1 #e2 #Hind1 #Hind2 >sem_cat - @eqP_trans [||@(union_empty_r … ∅)] - @eqP_trans [|@eqP_union_l[|@Hind2]] @eqP_union_r - @eqP_trans [||@(cat_empty_l … ?)] @cat_ext_l @Hind1 - |#e1 #e2 #Hind1 #Hind2 >sem_plus - @eqP_trans [||@(union_empty_r … ∅)] - @eqP_trans [|@eqP_union_l[|@Hind2]] @eqP_union_r @Hind1 - |#e #Hind >sem_star - @eqP_trans [||@(cat_empty_l … ?)] @cat_ext_l @Hind + [1,2:@a href="cic:/matita/tutorial/chapter8/eq_to_ex_eq.def(4)"eq_to_ex_eq/a // + |#s @a href="cic:/matita/tutorial/chapter8/eq_to_ex_eq.def(4)"eq_to_ex_eq/a // + |#e1 #e2 #Hind1 #Hind2 >a href="cic:/matita/tutorial/chapter7/sem_cat.def(8)"sem_cat/a + @a href="cic:/matita/tutorial/chapter4/eqP_trans.def(3)"eqP_trans/a [||@(a href="cic:/matita/tutorial/chapter4/union_empty_r.def(3)"union_empty_r/a … a title="empty set" href="cic:/fakeuri.def(1)"∅/a)] + @a href="cic:/matita/tutorial/chapter4/eqP_trans.def(3)"eqP_trans/a [|@a href="cic:/matita/tutorial/chapter4/eqP_union_l.def(3)"eqP_union_l/a[|@Hind2]] @a href="cic:/matita/tutorial/chapter4/eqP_union_r.def(3)"eqP_union_r/a + @a href="cic:/matita/tutorial/chapter4/eqP_trans.def(3)"eqP_trans/a [||@(a href="cic:/matita/tutorial/chapter6/cat_empty_l.def(5)"cat_empty_l/a … ?)] @a href="cic:/matita/tutorial/chapter6/cat_ext_l.def(5)"cat_ext_l/a @Hind1 + |#e1 #e2 #Hind1 #Hind2 >a href="cic:/matita/tutorial/chapter7/sem_plus.def(8)"sem_plus/a + @a href="cic:/matita/tutorial/chapter4/eqP_trans.def(3)"eqP_trans/a [||@(a href="cic:/matita/tutorial/chapter4/union_empty_r.def(3)"union_empty_r/a … a title="empty set" href="cic:/fakeuri.def(1)"∅/a)] + @a href="cic:/matita/tutorial/chapter4/eqP_trans.def(3)"eqP_trans/a [|@a href="cic:/matita/tutorial/chapter4/eqP_union_l.def(3)"eqP_union_l/a[|@Hind2]] @a href="cic:/matita/tutorial/chapter4/eqP_union_r.def(3)"eqP_union_r/a @Hind1 + |#e #Hind >a href="cic:/matita/tutorial/chapter7/sem_star.def(8)"sem_star/a + @a href="cic:/matita/tutorial/chapter4/eqP_trans.def(3)"eqP_trans/a [||@(a href="cic:/matita/tutorial/chapter6/cat_empty_l.def(5)"cat_empty_l/a … ?)] @a href="cic:/matita/tutorial/chapter6/cat_ext_l.def(5)"cat_ext_l/a @Hind ] qed. -theorem re_embedding: ∀S.∀e:re S. - \sem{•(blank S e)} =1 \sem{e}. -#S #e @eqP_trans [|@sem_bull] >forget_blank -@eqP_trans [|@eqP_union_r [|@sem_blank]] -@eqP_trans [|@union_comm] @union_empty_r. +img class="anchor" src="icons/tick.png" id="re_embedding"theorem re_embedding: ∀S.∀e:a href="cic:/matita/tutorial/chapter7/re.ind(1,0,1)"re/a S. + a title="in_prl" href="cic:/fakeuri.def(1)"\sem/a{a title="eclose" href="cic:/fakeuri.def(1)"•/a(a href="cic:/matita/tutorial/chapter8/blank.fix(0,1,3)"blank/a S e)a title="in_prl" href="cic:/fakeuri.def(1)"}/a a title="extensional equality" href="cic:/fakeuri.def(1)"=/a1 a title="in_l" href="cic:/fakeuri.def(1)"\sem/a{ea title="in_l" href="cic:/fakeuri.def(1)"}/a. +#S #e @a href="cic:/matita/tutorial/chapter4/eqP_trans.def(3)"eqP_trans/a [|@a href="cic:/matita/tutorial/chapter8/sem_bull.def(12)"sem_bull/a] >a href="cic:/matita/tutorial/chapter8/forget_blank.def(4)"forget_blank/a +@a href="cic:/matita/tutorial/chapter4/eqP_trans.def(3)"eqP_trans/a [|@a href="cic:/matita/tutorial/chapter4/eqP_union_r.def(3)"eqP_union_r/a [|@a href="cic:/matita/tutorial/chapter8/sem_blank.def(9)"sem_blank/a]] +@a href="cic:/matita/tutorial/chapter4/eqP_trans.def(3)"eqP_trans/a [|@a href="cic:/matita/tutorial/chapter4/union_comm.def(3)"union_comm/a] @a href="cic:/matita/tutorial/chapter4/union_empty_r.def(3)"union_empty_r/a. qed. -(* lefted operations *) -definition lifted_cat ≝ λS:DeqSet.λe:pre S. - lift S (pre_concat_l S eclose e). +(* +h2Lifted Operators/h2 + +Plus and bullet have been already lifted from items to pres. We can now +do a similar job for concatenation ⊙ and Kleene's star ⊛.*) + +img class="anchor" src="icons/tick.png" id="lifted_cat"definition lifted_cat ≝ λS:a href="cic:/matita/tutorial/chapter4/DeqSet.ind(1,0,0)"DeqSet/a.λe:a href="cic:/matita/tutorial/chapter7/pre.def(1)"pre/a S. + a href="cic:/matita/tutorial/chapter8/lift.def(2)"lift/a S (a href="cic:/matita/tutorial/chapter8/pre_concat_l.def(3)"pre_concat_l/a S a href="cic:/matita/tutorial/chapter8/eclose.fix(0,1,4)"eclose/a e). notation "e1 ⊙ e2" left associative with precedence 70 for @{'odot $e1 $e2}. interpretation "lifted cat" 'odot e1 e2 = (lifted_cat ? e1 e2). -lemma odot_true_b : ∀S.∀i1,i2:pitem S.∀b. - 〈i1,true〉 ⊙ 〈i2,b〉 = 〈i1 · (\fst (•i2)),\snd (•i2) ∨ b〉. -#S #i1 #i2 #b normalize in ⊢ (??%?); cases (•i2) // +img class="anchor" src="icons/tick.png" id="odot_true_b"lemma odot_true_b : ∀S.∀i1,i2:a href="cic:/matita/tutorial/chapter7/pitem.ind(1,0,1)"pitem/a S.∀b. + a title="Pair construction" href="cic:/fakeuri.def(1)"〈/ai1,a href="cic:/matita/basics/bool/bool.con(0,1,0)"true/aa title="Pair construction" href="cic:/fakeuri.def(1)"〉/a a title="lifted cat" href="cic:/fakeuri.def(1)"⊙/a a title="Pair construction" href="cic:/fakeuri.def(1)"〈/ai2,ba title="Pair construction" href="cic:/fakeuri.def(1)"〉/a a title="leibnitz's equality" href="cic:/fakeuri.def(1)"=/a a title="Pair construction" href="cic:/fakeuri.def(1)"〈/ai1 a title="pitem cat" href="cic:/fakeuri.def(1)"·/a (a title="pair pi1" href="cic:/fakeuri.def(1)"\fst/a (a title="eclose" href="cic:/fakeuri.def(1)"•/ai2)),a title="pair pi2" href="cic:/fakeuri.def(1)"\snd/a (a title="eclose" href="cic:/fakeuri.def(1)"•/ai2) a title="boolean or" href="cic:/fakeuri.def(1)"∨/a ba title="Pair construction" href="cic:/fakeuri.def(1)"〉/a. +#S #i1 #i2 #b normalize in ⊢ (??%?); cases (a title="eclose" href="cic:/fakeuri.def(1)"•/ai2) // qed. -lemma odot_false_b : ∀S.∀i1,i2:pitem S.∀b. - 〈i1,false〉 ⊙ 〈i2,b〉 = 〈i1 · i2 ,b〉. +img class="anchor" src="icons/tick.png" id="odot_false_b"lemma odot_false_b : ∀S.∀i1,i2:a href="cic:/matita/tutorial/chapter7/pitem.ind(1,0,1)"pitem/a S.∀b. + a title="Pair construction" href="cic:/fakeuri.def(1)"〈/ai1,a href="cic:/matita/basics/bool/bool.con(0,2,0)"false/aa title="Pair construction" href="cic:/fakeuri.def(1)"〉/a a title="lifted cat" href="cic:/fakeuri.def(1)"⊙/a a title="Pair construction" href="cic:/fakeuri.def(1)"〈/ai2,ba title="Pair construction" href="cic:/fakeuri.def(1)"〉/a a title="leibnitz's equality" href="cic:/fakeuri.def(1)"=/a a title="Pair construction" href="cic:/fakeuri.def(1)"〈/ai1 a title="pitem cat" href="cic:/fakeuri.def(1)"·/a i2 ,ba title="Pair construction" href="cic:/fakeuri.def(1)"〉/a. // qed. -lemma erase_odot:∀S.∀e1,e2:pre S. - |\fst (e1 ⊙ e2)| = |\fst e1| · (|\fst e2|). -#S * #i1 * * #i2 #b2 // >odot_true_b >erase_dot // +img class="anchor" src="icons/tick.png" id="erase_odot"lemma erase_odot:∀S.∀e1,e2:a href="cic:/matita/tutorial/chapter7/pre.def(1)"pre/a S. + a title="forget" href="cic:/fakeuri.def(1)"|/aa title="pair pi1" href="cic:/fakeuri.def(1)"\fst/a (e1 a title="lifted cat" href="cic:/fakeuri.def(1)"⊙/a e2)a title="forget" href="cic:/fakeuri.def(1)"|/a a title="leibnitz's equality" href="cic:/fakeuri.def(1)"=/a a title="forget" href="cic:/fakeuri.def(1)"|/aa title="pair pi1" href="cic:/fakeuri.def(1)"\fst/a e1a title="forget" href="cic:/fakeuri.def(1)"|/a a title="re cat" href="cic:/fakeuri.def(1)"·/a (a title="forget" href="cic:/fakeuri.def(1)"|/aa title="pair pi1" href="cic:/fakeuri.def(1)"\fst/a e2a title="forget" href="cic:/fakeuri.def(1)"|/a). +#S * #i1 * * #i2 #b2 // >a href="cic:/matita/tutorial/chapter8/odot_true_b.def(6)"odot_true_b/a >a href="cic:/matita/tutorial/chapter7/erase_dot.def(4)"erase_dot/a // qed. -definition lk ≝ λS:DeqSet.λe:pre S. +(* Let us come to the star operation: *) + +img class="anchor" src="icons/tick.png" id="lk"definition lk ≝ λS:a href="cic:/matita/tutorial/chapter4/DeqSet.ind(1,0,0)"DeqSet/a.λe:a href="cic:/matita/tutorial/chapter7/pre.def(1)"pre/a S. match e with [ mk_Prod i1 b1 ⇒ match b1 with - [true ⇒ 〈(\fst (eclose ? i1))^*, true〉 - |false ⇒ 〈i1^*,false〉 + [true ⇒ a title="Pair construction" href="cic:/fakeuri.def(1)"〈/a(a title="pair pi1" href="cic:/fakeuri.def(1)"\fst/a (a href="cic:/matita/tutorial/chapter8/eclose.fix(0,1,4)"eclose/a ? i1))a title="pitem star" href="cic:/fakeuri.def(1)"^/aa title="pitem star" href="cic:/fakeuri.def(1)"*/a, a href="cic:/matita/basics/bool/bool.con(0,1,0)"true/aa title="Pair construction" href="cic:/fakeuri.def(1)"〉/a + |false ⇒ a title="Pair construction" href="cic:/fakeuri.def(1)"〈/ai1a title="pitem star" href="cic:/fakeuri.def(1)"^/aa title="pitem star" href="cic:/fakeuri.def(1)"*/a,a href="cic:/matita/basics/bool/bool.con(0,2,0)"false/aa title="Pair construction" href="cic:/fakeuri.def(1)"〉/a ] ]. @@ -257,57 +317,58 @@ definition lk ≝ λS:DeqSet.λe:pre S. interpretation "lk" 'lk a = (lk ? a). notation "a^⊛" non associative with precedence 90 for @{'lk $a}. - -lemma ostar_true: ∀S.∀i:pitem S. - 〈i,true〉^⊛ = 〈(\fst (•i))^*, true〉. +img class="anchor" src="icons/tick.png" id="ostar_true"lemma ostar_true: ∀S.∀i:a href="cic:/matita/tutorial/chapter7/pitem.ind(1,0,1)"pitem/a S. + a title="Pair construction" href="cic:/fakeuri.def(1)"〈/ai,a href="cic:/matita/basics/bool/bool.con(0,1,0)"true/aa title="Pair construction" href="cic:/fakeuri.def(1)"〉/aa title="lk" href="cic:/fakeuri.def(1)"^/aa title="lk" href="cic:/fakeuri.def(1)"⊛/a a title="leibnitz's equality" href="cic:/fakeuri.def(1)"=/a a title="Pair construction" href="cic:/fakeuri.def(1)"〈/a(a title="pair pi1" href="cic:/fakeuri.def(1)"\fst/a (a title="eclose" href="cic:/fakeuri.def(1)"•/ai))a title="pitem star" href="cic:/fakeuri.def(1)"^/aa title="pitem star" href="cic:/fakeuri.def(1)"*/a, a href="cic:/matita/basics/bool/bool.con(0,1,0)"true/aa title="Pair construction" href="cic:/fakeuri.def(1)"〉/a. // qed. -lemma ostar_false: ∀S.∀i:pitem S. - 〈i,false〉^⊛ = 〈i^*, false〉. +img class="anchor" src="icons/tick.png" id="ostar_false"lemma ostar_false: ∀S.∀i:a href="cic:/matita/tutorial/chapter7/pitem.ind(1,0,1)"pitem/a S. + a title="Pair construction" href="cic:/fakeuri.def(1)"〈/ai,a href="cic:/matita/basics/bool/bool.con(0,2,0)"false/aa title="Pair construction" href="cic:/fakeuri.def(1)"〉/aa title="lk" href="cic:/fakeuri.def(1)"^/aa title="lk" href="cic:/fakeuri.def(1)"⊛/a a title="leibnitz's equality" href="cic:/fakeuri.def(1)"=/a a title="Pair construction" href="cic:/fakeuri.def(1)"〈/aia title="pitem star" href="cic:/fakeuri.def(1)"^/aa title="pitem star" href="cic:/fakeuri.def(1)"*/a, a href="cic:/matita/basics/bool/bool.con(0,2,0)"false/aa title="Pair construction" href="cic:/fakeuri.def(1)"〉/a. // qed. -lemma erase_ostar: ∀S.∀e:pre S. - |\fst (e^⊛)| = |\fst e|^*. +img class="anchor" src="icons/tick.png" id="erase_ostar"lemma erase_ostar: ∀S.∀e:a href="cic:/matita/tutorial/chapter7/pre.def(1)"pre/a S. + a title="forget" href="cic:/fakeuri.def(1)"|/aa title="pair pi1" href="cic:/fakeuri.def(1)"\fst/a (ea title="lk" href="cic:/fakeuri.def(1)"^/aa title="lk" href="cic:/fakeuri.def(1)"⊛/a)a title="forget" href="cic:/fakeuri.def(1)"|/a a title="leibnitz's equality" href="cic:/fakeuri.def(1)"=/a a title="forget" href="cic:/fakeuri.def(1)"|/aa title="pair pi1" href="cic:/fakeuri.def(1)"\fst/a ea title="forget" href="cic:/fakeuri.def(1)"|/aa title="re star" href="cic:/fakeuri.def(1)"^/aa title="re star" href="cic:/fakeuri.def(1)"*/a. #S * #i * // qed. -lemma sem_odot_true: ∀S:DeqSet.∀e1:pre S.∀i. - \sem{e1 ⊙ 〈i,true〉} =1 \sem{e1 ▹ i} ∪ { [ ] }. +img class="anchor" src="icons/tick.png" id="sem_odot_true"lemma sem_odot_true: ∀S:a href="cic:/matita/tutorial/chapter4/DeqSet.ind(1,0,0)"DeqSet/a.∀e1:a href="cic:/matita/tutorial/chapter7/pre.def(1)"pre/a S.∀i. + a title="in_prl" href="cic:/fakeuri.def(1)"\sem/a{e1 a title="lifted cat" href="cic:/fakeuri.def(1)"⊙/a a title="Pair construction" href="cic:/fakeuri.def(1)"〈/ai,a href="cic:/matita/basics/bool/bool.con(0,1,0)"true/aa title="Pair construction" href="cic:/fakeuri.def(1)"〉/aa title="in_prl" href="cic:/fakeuri.def(1)"}/a a title="extensional equality" href="cic:/fakeuri.def(1)"=/a1 a title="in_prl" href="cic:/fakeuri.def(1)"\sem/a{e1 a title="item-pre concat" href="cic:/fakeuri.def(1)"▹/a ia title="in_prl" href="cic:/fakeuri.def(1)"}/a a title="union" href="cic:/fakeuri.def(1)"∪/a a title="singleton" href="cic:/fakeuri.def(1)"{/a a title="nil" href="cic:/fakeuri.def(1)"[/a a title="nil" href="cic:/fakeuri.def(1)"]/a a title="singleton" href="cic:/fakeuri.def(1)"}/a. #S #e1 #i -cut (e1 ⊙ 〈i,true〉 = 〈\fst (e1 ▹ i), \snd(e1 ▹ i) ∨ true〉) [//] -#H >H cases (e1 ▹ i) #i1 #b1 cases b1 - [>sem_pre_true @eqP_trans [||@eqP_sym @union_assoc] - @eqP_union_l /2/ - |/2/ +cut (e1 a title="lifted cat" href="cic:/fakeuri.def(1)"⊙/a a title="Pair construction" href="cic:/fakeuri.def(1)"〈/ai,a href="cic:/matita/basics/bool/bool.con(0,1,0)"true/aa title="Pair construction" href="cic:/fakeuri.def(1)"〉/a a title="leibnitz's equality" href="cic:/fakeuri.def(1)"=/a a title="Pair construction" href="cic:/fakeuri.def(1)"〈/aa title="pair pi1" href="cic:/fakeuri.def(1)"\fst/a (e1 a title="item-pre concat" href="cic:/fakeuri.def(1)"▹/a i), a title="pair pi2" href="cic:/fakeuri.def(1)"\snd/a(e1 a title="item-pre concat" href="cic:/fakeuri.def(1)"▹/a i) a title="boolean or" href="cic:/fakeuri.def(1)"∨/a a href="cic:/matita/basics/bool/bool.con(0,1,0)"true/aa title="Pair construction" href="cic:/fakeuri.def(1)"〉/a) [//] +#H >H cases (e1 a title="item-pre concat" href="cic:/fakeuri.def(1)"▹/a i) #i1 #b1 cases b1 + [>a href="cic:/matita/tutorial/chapter7/sem_pre_true.def(9)"sem_pre_true/a @a href="cic:/matita/tutorial/chapter4/eqP_trans.def(3)"eqP_trans/a [||@a href="cic:/matita/tutorial/chapter4/eqP_sym.def(3)"eqP_sym/a @a href="cic:/matita/tutorial/chapter4/union_assoc.def(3)"union_assoc/a] + @a href="cic:/matita/tutorial/chapter4/eqP_union_l.def(3)"eqP_union_l/a /span class="autotactic"2span class="autotrace" trace a href="cic:/matita/tutorial/chapter4/eqP_sym.def(3)"eqP_sym/a/span/span/ + |/span class="autotactic"2span class="autotrace" trace a href="cic:/matita/tutorial/chapter8/eq_to_ex_eq.def(4)"eq_to_ex_eq/a/span/span/ ] qed. -lemma eq_odot_false: ∀S:DeqSet.∀e1:pre S.∀i. - e1 ⊙ 〈i,false〉 = e1 ▹ i. +img class="anchor" src="icons/tick.png" id="eq_odot_false"lemma eq_odot_false: ∀S:a href="cic:/matita/tutorial/chapter4/DeqSet.ind(1,0,0)"DeqSet/a.∀e1:a href="cic:/matita/tutorial/chapter7/pre.def(1)"pre/a S.∀i. + e1 a title="lifted cat" href="cic:/fakeuri.def(1)"⊙/a a title="Pair construction" href="cic:/fakeuri.def(1)"〈/ai,a href="cic:/matita/basics/bool/bool.con(0,2,0)"false/aa title="Pair construction" href="cic:/fakeuri.def(1)"〉/a a title="leibnitz's equality" href="cic:/fakeuri.def(1)"=/a e1 a title="item-pre concat" href="cic:/fakeuri.def(1)"▹/a i. #S #e1 #i -cut (e1 ⊙ 〈i,false〉 = 〈\fst (e1 ▹ i), \snd(e1 ▹ i) ∨ false〉) [//] -cases (e1 ▹ i) #i1 #b1 cases b1 #H @H +cut (e1 a title="lifted cat" href="cic:/fakeuri.def(1)"⊙/a a title="Pair construction" href="cic:/fakeuri.def(1)"〈/ai,a href="cic:/matita/basics/bool/bool.con(0,2,0)"false/aa title="Pair construction" href="cic:/fakeuri.def(1)"〉/a a title="leibnitz's equality" href="cic:/fakeuri.def(1)"=/a a title="Pair construction" href="cic:/fakeuri.def(1)"〈/aa title="pair pi1" href="cic:/fakeuri.def(1)"\fst/a (e1 a title="item-pre concat" href="cic:/fakeuri.def(1)"▹/a i), a title="pair pi2" href="cic:/fakeuri.def(1)"\snd/a(e1 a title="item-pre concat" href="cic:/fakeuri.def(1)"▹/a i) a title="boolean or" href="cic:/fakeuri.def(1)"∨/a a href="cic:/matita/basics/bool/bool.con(0,2,0)"false/aa title="Pair construction" href="cic:/fakeuri.def(1)"〉/a) [//] +cases (e1 a title="item-pre concat" href="cic:/fakeuri.def(1)"▹/a i) #i1 #b1 cases b1 #H @H qed. -lemma sem_odot: - ∀S.∀e1,e2: pre S. \sem{e1 ⊙ e2} =1 \sem{e1}· \sem{|\fst e2|} ∪ \sem{e2}. +(* We conclude this section with the proof of the main semantic properties +of ⊙ and ⊛. *) + +img class="anchor" src="icons/tick.png" id="sem_odot"lemma sem_odot: + ∀S.∀e1,e2: a href="cic:/matita/tutorial/chapter7/pre.def(1)"pre/a S. a title="in_prl" href="cic:/fakeuri.def(1)"\sem/a{e1 a title="lifted cat" href="cic:/fakeuri.def(1)"⊙/a e2a title="in_prl" href="cic:/fakeuri.def(1)"}/a a title="extensional equality" href="cic:/fakeuri.def(1)"=/a1 a title="in_prl" href="cic:/fakeuri.def(1)"\sem/a{e1a title="in_prl" href="cic:/fakeuri.def(1)"}/aa title="cat lang" href="cic:/fakeuri.def(1)"·/a a title="in_l" href="cic:/fakeuri.def(1)"\sem/a{a title="forget" href="cic:/fakeuri.def(1)"|/aa title="pair pi1" href="cic:/fakeuri.def(1)"\fst/a e2a title="forget" href="cic:/fakeuri.def(1)"|/aa title="in_l" href="cic:/fakeuri.def(1)"}/a a title="union" href="cic:/fakeuri.def(1)"∪/a a title="in_prl" href="cic:/fakeuri.def(1)"\sem/a{e2a title="in_prl" href="cic:/fakeuri.def(1)"}/a. #S #e1 * #i2 * - [>sem_pre_true - @eqP_trans [|@sem_odot_true] - @eqP_trans [||@union_assoc] @eqP_union_r @odot_dot_aux // - |>sem_pre_false >eq_odot_false @odot_dot_aux // + [>a href="cic:/matita/tutorial/chapter7/sem_pre_true.def(9)"sem_pre_true/a + @a href="cic:/matita/tutorial/chapter4/eqP_trans.def(3)"eqP_trans/a [|@a href="cic:/matita/tutorial/chapter8/sem_odot_true.def(10)"sem_odot_true/a] + @a href="cic:/matita/tutorial/chapter4/eqP_trans.def(3)"eqP_trans/a [||@a href="cic:/matita/tutorial/chapter4/union_assoc.def(3)"union_assoc/a] @a href="cic:/matita/tutorial/chapter4/eqP_union_r.def(3)"eqP_union_r/a @a href="cic:/matita/tutorial/chapter8/sem_pcl_aux.def(11)"sem_pcl_aux/a // + |>a href="cic:/matita/tutorial/chapter7/sem_pre_false.def(9)"sem_pre_false/a >a href="cic:/matita/tutorial/chapter8/eq_odot_false.def(6)"eq_odot_false/a @a href="cic:/matita/tutorial/chapter8/sem_pcl_aux.def(11)"sem_pcl_aux/a // ] qed. -(* theorem 16: 4 *) -theorem sem_ostar: ∀S.∀e:pre S. - \sem{e^⊛} =1 \sem{e} · \sem{|\fst e|}^*. +img class="anchor" src="icons/tick.png" id="sem_ostar"theorem sem_ostar: ∀S.∀e:a href="cic:/matita/tutorial/chapter7/pre.def(1)"pre/a S. + a title="in_prl" href="cic:/fakeuri.def(1)"\sem/a{ea title="lk" href="cic:/fakeuri.def(1)"^/aa title="lk" href="cic:/fakeuri.def(1)"⊛/aa title="in_prl" href="cic:/fakeuri.def(1)"}/a a title="extensional equality" href="cic:/fakeuri.def(1)"=/a1 a title="in_prl" href="cic:/fakeuri.def(1)"\sem/a{ea title="in_prl" href="cic:/fakeuri.def(1)"}/a a title="cat lang" href="cic:/fakeuri.def(1)"·/a a title="in_l" href="cic:/fakeuri.def(1)"\sem/a{a title="forget" href="cic:/fakeuri.def(1)"|/aa title="pair pi1" href="cic:/fakeuri.def(1)"\fst/a ea title="forget" href="cic:/fakeuri.def(1)"|/aa title="in_l" href="cic:/fakeuri.def(1)"}/aa title="star lang" href="cic:/fakeuri.def(1)"^/aa title="star lang" href="cic:/fakeuri.def(1)"*/a. #S * #i #b cases b - [>sem_pre_true >sem_pre_true >sem_star >erase_bull - @eqP_trans [|@eqP_union_r[|@cat_ext_l [|@minus_eps_pre_aux //]]] - @eqP_trans [|@eqP_union_r [|@distr_cat_r]] - @eqP_trans [||@eqP_sym @distr_cat_r] - @eqP_trans [|@union_assoc] @eqP_union_l - @eqP_trans [||@eqP_sym @epsilon_cat_l] @eqP_sym @star_fix_eps - |>sem_pre_false >sem_pre_false >sem_star /2/ + [>a href="cic:/matita/tutorial/chapter7/sem_pre_true.def(9)"sem_pre_true/a >a href="cic:/matita/tutorial/chapter7/sem_pre_true.def(9)"sem_pre_true/a >a href="cic:/matita/tutorial/chapter7/sem_star.def(8)"sem_star/a >a href="cic:/matita/tutorial/chapter8/erase_bull.def(6)"erase_bull/a + @a href="cic:/matita/tutorial/chapter4/eqP_trans.def(3)"eqP_trans/a [|@a href="cic:/matita/tutorial/chapter4/eqP_union_r.def(3)"eqP_union_r/a[|@a href="cic:/matita/tutorial/chapter6/cat_ext_l.def(5)"cat_ext_l/a [|@a href="cic:/matita/tutorial/chapter8/minus_eps_pre_aux.def(11)"minus_eps_pre_aux/a //]]] + @a href="cic:/matita/tutorial/chapter4/eqP_trans.def(3)"eqP_trans/a [|@a href="cic:/matita/tutorial/chapter4/eqP_union_r.def(3)"eqP_union_r/a [|@a href="cic:/matita/tutorial/chapter6/distr_cat_r.def(5)"distr_cat_r/a]] + @a href="cic:/matita/tutorial/chapter4/eqP_trans.def(3)"eqP_trans/a [||@a href="cic:/matita/tutorial/chapter4/eqP_sym.def(3)"eqP_sym/a @a href="cic:/matita/tutorial/chapter6/distr_cat_r.def(5)"distr_cat_r/a] + @a href="cic:/matita/tutorial/chapter4/eqP_trans.def(3)"eqP_trans/a [|@a href="cic:/matita/tutorial/chapter4/union_assoc.def(3)"union_assoc/a] @a href="cic:/matita/tutorial/chapter4/eqP_union_l.def(3)"eqP_union_l/a + @a href="cic:/matita/tutorial/chapter4/eqP_trans.def(3)"eqP_trans/a [||@a href="cic:/matita/tutorial/chapter4/eqP_sym.def(3)"eqP_sym/a @a href="cic:/matita/tutorial/chapter6/epsilon_cat_l.def(5)"epsilon_cat_l/a] @a href="cic:/matita/tutorial/chapter4/eqP_sym.def(3)"eqP_sym/a @a href="cic:/matita/tutorial/chapter6/star_fix_eps.def(7)"star_fix_eps/a + |>a href="cic:/matita/tutorial/chapter7/sem_pre_false.def(9)"sem_pre_false/a >a href="cic:/matita/tutorial/chapter7/sem_pre_false.def(9)"sem_pre_false/a >a href="cic:/matita/tutorial/chapter7/sem_star.def(8)"sem_star/a /span class="autotactic"2span class="autotrace" trace a href="cic:/matita/tutorial/chapter8/eq_to_ex_eq.def(4)"eq_to_ex_eq/a/span/span/ ] -qed. \ No newline at end of file +qed. \ No newline at end of file