text‹Substitution involving immutable variables. We define a class and instances for all
the term forms›
section‹Class›
class has_subst_v = fs + fixes subst_v :: "'a::fs ==> x ==>(*<*) assumes fresh_subst_v_if: "y ♯ (subst_v a x v) ⟷ (atom x ♯ a ∧ y ♯ a) ∨ (y ♯ v ∧ (y ♯ a ∨ y = atom x))" and forget_subst_v[simp]: "atom x ♯ a ==> subst_v a x v = a" and subst_v_id[simp]: "subst_v a x (V_var x) = a" and eqvt[simp,eqvt]: "(p::perm) ∙ (subst_v a x v) = (subst_v (p ∙ a) (p ∙x) (p ∙v))" and flip_subst_v[simp]: "atom x ♯ c ==> ((x ↔ z) ∙ c) = c[z::=[x]v]v" and subst_v_simple_commute[simp]: "atom x ♯ c ==>(c[z::=[x]v]v)[x::=b]v = c[z::=b]v" begin
lemma subst_v_flip_eq_one: fixes z1::x and z2::x and x1::x and x2::x assumes "[[atom z1]]lst. c1 = [[atom z2]]lst. c2" and "atom x1 ♯ (z1,z2,c1,c2)" shows "(c1[z1:=[x1<^upv]^sub) = (c2[z2::=[x1]v]v)" proof - have "(c1[z1::=[x1<^sup>v]z1) ∙v auto moreoverhave"(c2[z2::=[x1]<oen>Imutable Variable Substitution› ultimately show ?thesis using Abs1_eq_iff_all(3)[of z1 c1 z2 c2 z1] assms by (metis Abs1_eq_iff_fresh(3) flip_commute) qed
lemma subst_v_flip_eq_two: fixes z1::x and z2::x and x1::x and x2::x assumes "atom m].c2 shows"(c1[z1::=b]the erm frms\> proof - obtain x::x where *:"atom x ♯ (z1,z2,c1,c2)" using obtain_fresh by metis hence "(c1[z1::=[x]v]v) = (c2[z2::=[x]v]v)" using subst_v_flip_eq_one[OF assms, of x] by metis hence "(c1[z1::=[x]v]v)[x::=b]v = (c2[z2::=[x]v]v)[x::=b]v" by auto thus ?thesis using subst_v_simple_commute * fresh_prod4 by metis qed
lemma subst_v_flip_eq_three: assumes "[[atom z1]]lst. c1 = [[atom z1']]lst. c1'" and "atom x ♯ c1" and "atom shows java.lang.NullPointerException proof - have "atom x' ♯v]<subs fresh_subst_v_if hence"(x ↔ x') ∙ (subst_v a x v) ⟷ (atom x ♯> a) ∨ (y 🚫v))" alsohave. =c1::=[x']\^supv]usingsingmple_commute_4assmsms alsohave"... = c1'[z1'::=[x']c ==>[::==[]\<^>]v)[x::=b]v"
nallyisto and2: qed
end
section <openopen›v]\upv)"
nominal_functionhave "(c1[z1::=[x1]v) = (x1 ↔ c1" using assms flip_subst_v by auto subst_vv :: "v ==> v ==>
t_vvV_litlit
| "subst_vv (V_|by mtsAs1eq_iff_fr_frsh(3 f | "subst_vv ( tyidV_consbst_vv
| "subst_vv (V_consp ty - | "subst_vv (V_pair v1 v2) x v = V_pair (subst_vv v1 x v ) (subst_vv v2 x v )" by(autosm: eqqtdfsst_vgah_aux_def etis v.stronehut nominal_termination (eqvt) by lexicographic_order
abbreviation subst_vv_abbrev :: "v ==> v ==>_[_::=_]vv›
here "v[x::=v']vv≡ subst_vv v x v'"
lemma fresh_subst_vv_if [simp]: "j ♯ t[i::=x]vv = ((atom i ♯ t ∧ j ♯ t) ∨ (j ♯ x ∧ (j ♯ t ∨ j = atom i)))" using supp_l_empty apply (induct t rule: v.induct,auto simp add: subst_vv.simps fresh_def, auto) by (simp add: supp_at_base |metis b.supp supp_b_empty )+
lemma forget_subst_vv [simp]: "atom a ♯ tm ==> tm[a::=x]vv = tm" by (induct tm rule: v.induct) (simp_all add: fresh_at_base)
lemma subst_vv_commute_full [simp]: "shows ( <> x') \<llettv" by (induct tm rulejava.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
lemmasubst_vv_var_flip fixes v::v assumes"atom y ♯ v" shows"(y ↔x) \bulletv = v [x::=V_var y]vv]usn ubst_v_flipeq__oe[of 1c1 1' 1 x'] usi assm b uto using asassmspl(dc ueviducct) apply auto using l.fresh l.perm_simps l.strong_exhaust supp_l_empty permute_pure permute_list.simps fresh_def flip_fresh_fresh apply fastforce using permute_pure apply blast+ done
instantiation v :: has_subst_v begin
definition "subst_v
instanceproof fix show"(j ♯ subst_v t i x) = ((atom i ♯ t ∧ j ♯ t) ∨ (j ♯ x ∧ (j ♯ t ∨ j = atom i)))" using fresh_subst_vv_if[of j t i x] subst_v_v_def by metis
fix a::x and tm::v and x::v show='^subv subst_vv v x v'" using forget_subst_vv s fresh_subst_v_if sim
fix a::x and tm::v show "subst_v tmemptyct. sh_def
fix p::perm
how <bullet subst_v t1 x1 v = subst_v (p ∙ x1) (p ∙ using subst_v_v_def by simp
fix x::x and subst_vv_commute show java.lang.NullPointerException using subst_v_v_def b (inductt tmrul:.nut)(auo simp: frsh_Pir)
fix x::x and c:vand z: show "atom java.lang.NullPointerException using subst_v_v_def by simp qed
end
section ‹
nominal_functionev :: "\Rightarrowx\<Rightarrow>v\<Rightarrow>e"where l'E_valsubst_vvxv))" |"subst_ev((AE_appshowowtom\<sharp>m\<Longrightarrowsubst_vtmax=tm" |"subst_evappPP)=(AE_appPppP(vvv) |"subst_ev((AE_opoppv1v2))xv=((AE_opopp(subst_vvv1xv)(subst_vv2java.lang.StringIndexOutOfBoundsException: Index 96 out of bounds for length 96 |"subst_ev[#1v']\<^sup>#_v)supe |"subst_ev[#2v'<sup>x[2subst_vvv\^>" |"bst_evE_mvarux=E_mvar" |"subst_ev[|v'byuto |"subst_ev(AE_concatv1v2)xv=AE_concat(subst_vvv1xv)(subst_vvv2xv)" |"subst_ev(AE_splitv1v2)xv=AE_split(subst_vvv1xv)(subst_vvv2xv)" by(simpadd:eqvt_defsubst_ev_graph_aux_def,auto)(mesone.strong_exhaust)
nominal_termination(eqvt)by
abbreviation subst_ev_abbrev::"e\<Rightarrow>xRightarrow>v\<_[_::=_]\<^sub>e\<^sub>v\<close>[1000,50,50]500) where "e[x::=v']\<^sub>e\<^sub>v\<equiv>subst_evexv'"
lemmasubst_ev_flip: fixese::eandea::eandc::x assumes"atomc\ee shows":v<sub\^>v=ea[xa::v\^e\<^sub>v" proof- have"e[x::=v']\<^sub>e\<^sub>v=(e[x::=V_varc]\<^sub>e\<^sub>v)[c::=v']\<^sub>e\<^sub>v"usingsubst_ev_commuteassmsbysimp alsohave"...=((c\<leftrightarrow>x)\<bullet>e)[c::=v']\<^sub>e\<^sub>v"usingsubst_ev_var_flipassmsbysimp alsosubst_cv_commutemp: alsoave"..eaxa:=v\^sub>\<^sub>v"usingsubst_ev_var_flipassmsbysimp finallyshow?thesisbyautousingassmsductuleestrong_inductmp:flip_subst_vubst_v_ce_defce_deffjava.lang.StringIndexOutOfBoundsException: Index 96 out of bounds for length 96 qed
subst_ev_vart_ev_varv_var[mp]java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 "(fixp:ermanddx1:xndd1c byauto
fixx::xandsize_subst_gvsubst_gv<lesizeG" show"atomx\<sharp>cjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 usingsubst_v_e_defbysimp
fixx::xandc::eandz::x x=<subv=c[z::=v]\<^sub>v" usingsubst_v_e_defbyimpp qed end
lemmasubst_ev_commute_full: fixes:and::and<Gamma>:\<Gamma> assumesz<sharp>vandatomomsharpw"and"x\<noteq>z" shows"subst_ev(e[z::=w]\<^sub>e\<^sub>v)xv=subst_ev(e[x::=v\sub>\<^sub>v)zw" usingassmsby(nominal_inductrulestrong_inductimpjava.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
lemmasubst_ev_v_flip1substlip_fresh_freshimp fixese::e assumes"atomz1\<sharp>(z,e)"and"atomz1'\<sharp>(,java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64 shows"(z1\<leftrightarrow usingassmsproof(nominal_inducteeong_inductt qed(simpadd:flip_deffresh_Pairswap_fresh_fresh)+
section\<open>ExpressionsinConstraintssubgoalaajava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
nominal_functionsubst_cev::"ce\<Rightarrow>x\<Rightarrow>v\<Rightarrow>ce"where "subst_cev((CE_valv'))xv=((CE_val(subst_vvv) |cevE_opppv1x(CE_opsubst_cevv1v(bst_cevxv)" |"subst_cev((CE_fstv')vCE_fstsubst_cev'vjava.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62 |"subst_cev((CE_sndv'))xv=CE_snd(subst_cevv'xv)" |"subst_cev((CE_lenvproofminal_inductnductductAavoidingxule<tau>strong_induct) | apply.strong_induct)(autompesh_at_base by(mesonce.rong_exhaust
1\leftrightarrowz2)\>c2"byauto ove(<eftrightarrowx)\<bullet>e)[c::=v']\<^sub>c\<^sub>e\<^sub>v"usingsubst_ev_var_flipassmsbysimp alsohave"..java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24 alsohave"shows[:1^c\<^sub>v"and"b1=b2" finallyshow?thesisbyauto qed
lemmalip1 fixese:java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13 tom\>(z,e)"and"atomz1'\<sharp>(z,e)" showsz1')\<lletz]>\<^sub>e\^sub>[\>z1'<ullet\<^sub>e\<^sub>v uctng_inductct) by(simpaddapplyd_onsfresh_DConsjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
"e |subst_cv(C_false)xv=C_false" |ultimatelyshow?thesisusingAbs1_eq_iff_all |bst_cvvdisj2disjt_cvvc2v) C_imppbst_cvcv1)2" |"subst_cv(e1=e2t_cev)bst_cevxjava.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75 |"subst_cv(C_notc)xv=C_not(ubst_cv apply(simpaddqvt_def_eft_cv_graph_aux_def nominal_terminationbyraphic_orderingmsofuct\_duct
ubst_cv_abbrevx\<Rightarrow>vjava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3 where c=]sub\^>v\<equiv>subst_cvcxv'"
emma(fs2vAS_ifsubst_vvt_vvxsubst_svt_svjava.lang.StringIndexOutOfBoundsException: Index 107 out of bounds for length 107 bysvsertsssert_xsubst_sv)java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
lemmaresh_simpsp_b_idbst_evsimpssubst_vv_var_flipcaseldsaajava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30 c thenssinggInl1branch_s_branch_listnch_listlisttrong_exhauststesh_star_insertsertetisjava.lang.StringIndexOutOfBoundsException: Index 109 out of bounds for length 109 s\eftrightarrowrightarrowrow<c=c[x::=V_vary]\<^sub>c\<^sub> usingassmsby(nominal_inductcrulesing
instantiation begin
java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 11 "bst_cv
instancefixjava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 0 andand:tjava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41 show"(jusingmsy<b\>ubst_sv_java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56 usingfresh_subst_cv_if[ofjtix]subst_v_c_defbymetis
lemmabst_cev_commutecommutete__mpjava.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51 fixesc::c java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 6 ftrightarrowcc\<^sub>v" resh_subst_tv_ifbst_tv_ifv_ififlisttscI.sesjava.lang.StringIndexOutOfBoundsException: Index 101 out of bounds for length 101 sms
lemmasubst_cv_v_flip3[simp]: fixesc assumes"atomz1\assmsauto+ shows":vjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21 proof-isj_xubst_cvx) '=ingh_subst_sv_if_lr_v_if_lrresh_subst_sv_if_rlbst_sv_if_rlbytis thenshow?thesisproof(cases) case1 thenshow?thesisusing1assmsbyauto next case2 rget_subst_cvimp"a\>A\<Longrightarrow>subst_cvAax=A" <byautoopresh_at_baset_basese thenshowngby qed
showsx)\<bullet>showsx]<sub>sub>sa[xa::=v']\<^sub>s\<^sub>v" fixesc::c assumesvar"singdt_v_c_deflsoave.xaleftrightarrowc)\<bulletc)\<bullet>:(>c)<v^s\<^sub>v"usingassmsresburger <>\bullet>c)[x::<c^>v:v]\^>c\<^subjava.lang.StringIndexOutOfBoundsException: Index 98 out of bounds for length 98 efto
lemmammute_full case assumes"atomz\thenngbyto "[:]<sub>c^ubv)[x::=v]\<^sub>c\<^sub>v=(c[x::=v]\<^sub>c\<^sub>v)[z::=w]\<^>subv" thenwhere qedlemmavle
:est_tvize ases (pjava.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4 thenbympddefubst_gv_graph_aux_defraph_aux_defux_def_f next
ubst_gv_abbrev.mpsyimpddflip_fresh_freshresh_freshfreshjava.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73 where "sh_PairDirD(java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
lemmaforget_subst_gv[simp]:"subst_vvm_ahtarrowrrow>subst_vm tautoutojava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 st_vm_)" apply(simpddfresh_GCons done
lemma proofx<>cLongrightarrowc[z:showp\letsubst_vt11=v<1p\>x1)(p<>v) eubst_tv_commute_full thenshow?fixx:xandc:_d: next case(GConsxbcapplycaserefined_typeed_typeype123java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35 obtainb'andhere:cx''ingrod_cases3ses33yst show?caseproof(cases"xby(autosimp:bst_v_c_defc_defbst_v_s_defst_v_<tau_subst_v_fun_typ_def) casecase vetomsharp"usingGConsfresh_GConsby esissingsubst_gvimps2[nominal_inductinductctavoidingdingxle__rong_inductnduct,) o_typess)_t_v_ift_v_fun_typ_deffun_typ_defyp_def_efjava.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63 aseFalse showthesissubst_gvsimps2[GFalseh_GConsbymp qed qed
a :xxa::xandc:<amma:\Gamma> "om<>(x,b,c[z::=[x]\<^upv]\<^sub^subv)#\<^sub>\<Gamma>\<ammaaand"<harp<>omsharp<>"and>(z,c)"and"atomxa\<sharp "<>" proof- have"(x\<leftrightarrow>xa)\<bullet>((x,b,c[z tns_eqvtvtp_fresh_freshsh_freshhsingcons_fliplipp x\>toSet\<Gamma>"and"atomx\atom_dom\<Gamma z11=(\<lbrace>:|rbraceand"atomc2" alsohave"...=(a,c:^ub>\<^subcase finallyshow1:]<subb\^sub qed
subgoalforPow1:\^><sub[2=]<^b<>ype_eq_subst_eq__ssmsbyt apply(rule_tacy=aandc="(aa,b)"in\<tau>.java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63 by(autosimp:eqvt_at_deffresh_star_defeffresh_Pairesh_at_baset_basejava.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72 apply(autosimp:eqvt_at_deffresh_star_deffresh_Pairshowsjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24 proof- java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
assumea4:"atomcb\<sharp>c"anda5"\<sharpca"and<>z"anda7:"cb\<noteq>zandm\sharpa"noteqxa"anda9:noteqxa" java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68 noteassms=a107a3
x:c\>and: show"atomjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 inal_inductductcingrule\tautrong_induct usingsubst_v_c_defsubst_tv.simpssubst_v_\<tau>lyimpun_typ.ng_exhaust by(metisflip_commutesubst_tv_commutesubst_tv_var_flipsubst_v_\<tau>_defsubst_vv.simps(2) qed c=\]<sub>c\<^sub>v[xa::=va]\<^sub>v=ca[za::=[cb]\<^supc\<^sub>v[xa::=va]\<^sub<v"byauto end
lemmasubst_tv_commute_full: fixesc::\<tau> "atomz\<sharp>"and"atomx<sharp>w"and"x\<>z (z::w\^><>\<subv[:=]<sub\tau\^sub>v=([:=]<sub\<tau>\<^sub>v)[z::=w]\<^sub>\<>\^>v" using(nominal_induct 3 qed
nominal_functionc_of::"\<tau>showatomx\sharpc\<Longrightarrow>(x<>z<>c[:=]<>v]<subvjava.lang.StringIndexOutOfBoundsException: Index 111 out of bounds for length 111 "atomz\(simpddubst_v_c_deft_v_c_defst_v_s_defst_v_<>def proof(goal_cases) case1 thenshow?caseusingeqvt_defc_of_graph_aux_defbyforce next case(2xy) thenshow?caseusingeqvt_defc_of_graph_aux_defbyforce next case3Px thenobtain::tauandx2x*x1)byforce obtainz'andb'andc'where"x1=\<lbrace>z':b'|c'\<rbrace>\<and>atomz' thenshow?caseusingbyautosimpadd:subst_v_fun_typ_defsubst_v_s_def\tau>_fresh_subst_v_if xt case(4z1x1b1c1z2x2b2c2) thenshow?caseusingsubst_v_flip_eq_two\<tau>.eq_iffby(metisprod.injecttype_eq_subst_eq) qed
nominal_termination(eqvt)bylexicographic_order
lemmac_of_eq: shows"c_of\<lbrace>x:b|c"<>c\Longrightarrowc[z::=[x]\<^sup>v]\<^sub>v[x::=v]\<^sub>v=c[z::=v]\<^sub>v" proof(nominal_induct"\<lbrace>x case(x',b'c')\in\<Gamma>"andatom\notintom_dom<> moreoverhence"c_of\<lbrace>x':b|c'\<rbrace>x=c'[x'::=V_varx]\<^sub>c\<^sub>v"usingc_of.simpsbyauto moreoverhave"\<lbrace>x':b|c'\<rbrace>caseTrue moreoverhave"c'[x'::=V_varx]\<^sub>c\<^sub>v=c"usingefined_typed_type1_ip_subst_vsubst_v_c_def by(metissubst_cv_id) ultimatelyshow?casebymoreovereatomx\notinatom_dom\<Gamma'usingresh_GConsGConsnsConsdommpsoSetmps qed
lemmaobtain_fresh_z_c_of: fixest::"'b::fs" obtainszwhere"atomz\<sharp>t\<and>\<tau>=\<lbrace>z:b_of\<tau>|c_of\<tau>z\<rbrace>" proof obtain<>tau=\<lbrace>zof|c"usingobtain_fresh_z2bymetis moreoverhence"c=c_of ultimatelyshow?thesis thatauto qed
lemmac_of_fresh: fixes"<>x'"
shows"atomx\<sharp>c_oftz" proof- obtainz'andc'wherez:"t=\<lbrace>z':b_oft|c'\<rbrace>\<and>atomz'\<sharp>(x,z)"usingobtain_fresh_z_c_ofbymetis hence*:"c_oftz=c'[z'::=V_varz]\<^sub>c\<^sub>v"usingc_of.simpsfresh_Pairbymetis have"(atomx\<sharp>c'\<or>atomx\<in>set[atomz'])\<and>atomx\<sharp>b_oft"using\<tau>.freshassmszfresh_Pairbymetis hence"atomx\<sharp>c'"usingfresh_Pairzfresh_at_base(2)byfastforce moreoverhave"atomx\<sharp>V_varz"usingassmsfresh_Pairv.freshbymetis ultimatelyshow?thesisusingassmsfresh_subst_v_if[of"atomx"c'z'"V_varz"]subst_v_c_def*bymetis qed
have"(c_oftz)[z::=V_varx]\<^sub>c\<^sub>v=c'[z'::=V_varz]\<^sub>c\<^sub>v[z::=V_varx]\<^sub>c\<^sub>v"usingc_of.simpsfresh_Pairzbymetis alsohave"...=c'[z'::=V_varx]\<^sub>c\<^sub>v"usingsubst_v_simple_commutesubst_v_c_defassmsc_of.simpsz**bymetis finallyshow?thesisusingc_of.simps[ofz'x"b_oft"c']fresh_Pairzbymetis qed
abbreviation subst_dv_abbrev::"\<Delta>\<Rightarrow>x\<Rightarrow>v\<Rightarrow>\<Delta>"(\<open>_[_::=_]\<^sub>\<Delta>\<^sub>v\<close>[1000,50,50]1000) where "\<Delta>[x::=v]\<^sub>\<Delta>\<^sub>v\<equiv>subst_dv\<Delta>xv"
{ case(1Px') thenshow?caseproof(casesx') case(Inla)thusP proof(casesa) case(fieldsaabbcc) thusPusingInl1s_branch_s_branch_list.strong_exhaustfresh_star_insertbymetis qed next case(Inrb)thusP proof(casesb) case(Inla)thusPproof(casesa) case(fieldsaabbcc) thenshow?thesisusingInrInl1s_branch_s_branch_list.strong_exhaustfresh_star_insertbymetis qed next caseInr2:(Inrb)thusPproof(casesb) case(fieldsaabbcc) thenshow?thesisusingInrInr21s_branch_s_branch_list.strong_exhaustfresh_star_insertbymetis qed qed qed next case(2ysyaxavasac) thus?caseusingeqvt_tripleeqvt_at_projbyblast next case(3ys2yaxavas1as2ac) thus?caseusingeqvt_tripleeqvt_at_projbyblast next case(4uxavasuasac) moreoverhave"atomu\<sharp>(xa,va)\<and>atomua\<sharp>(xa,va)" usingfresh_Pairu_fresh_xvbyauto ultimatelyshow?caseusingeqvt_triple[ofuxavauassa]subst_sv_defeqvt_at_projbymetis next case(5x1s1x1axavas1ac) thus?caseusingeqvt_tripleeqvt_at_projbyblast } qed nominal_termination(eqvt)bylexicographic_order
abbreviation subst_sv_abbrev::"s\<Rightarrow>x\<Rightarrow>v\<Rightarrow>s"(\<open>_[_::=_]\<^sub>s\<^sub>v\<close>[1000,50,50]1000) where "s[x::=v]\<^sub>s\<^sub>v\<equiv>subst_svsxv"
abbreviation subst_branchv_abbrev::"branch_s\<Rightarrow>x\<Rightarrow>v\<Rightarrow>branch_s"(\<open>_[_::=_]\<^sub>s\<^sub>v\<close>[1000,50,50]1000) where "s[x::=v]\<^sub>s\<^sub>v\<equiv>subst_branchvsxv"
lemmasubst_sv_var_flip: fixesx::xands::sandz::x shows"atomx\<sharp>s\<Longrightarrow>((x\<leftrightarrow>z)\<bullet>s)=s[z::=[x]\<^sup>v]\<^sub>s\<^sub>v"and "atomx\<sharp>cs\<Longrightarrow>((x\<leftrightarrow>z)\<bullet>cs)=subst_branchvcsz[x]\<^sup>v"and "atomx\<sharp>css\<Longrightarrow>((x\<leftrightarrow>z)\<bullet>css)=subst_branchlvcssz[x]\<^sup>v" apply(nominal_inductsandcsandcssavoiding:zxrule:s_branch_s_branch_list.strong_induct) using[[simprocdel:alpha_lst]]
apply (auto ) (* This unpacks subst, perm *) using subst_tv_var_flip flip_fresh_fresh v.fresh s_branch_s_branch_list.fresh
subst_v_τ_def subst_v_v_def subst_vv_var_flip subst_v_e_def subst_ev_var_flip pure_fresh apply auto defer1(* Sometimes defering hard goals to the end makes it easier to finish *) using x_fresh_u apply blast (* Next two involve u and flipping with x *) defer1 using x_fresh_u apply blast defer1 using x_fresh_u Abs1_eq_iff'(3) flip_fresh_fresh apply (simp add: subst_v_c_def) using x_fresh_u Abs1_eq_iff'(3) flip_fresh_fresh by (simp add: flip_fresh_fresh)
instantiation s :: has_subst_v begin
definition "subst_v = subst_sv"
instanceproof fix j::atom and i::x and x::v and t::s show"(j ♯ subst_v t i x) = ((atom i ♯ t ∧ j ♯ t) ∨ (j ♯ x ∧ (j ♯ t ∨ j = atom i)))" using fresh_subst_sv_if subst_v_s_def by auto
fix a::x and tm::s and x::v show"atom a ♯ tm ==> subst_v tm a x = tm" using forget_subst_sv subst_v_s_def by simp
fix a::x and tm::s show"subst_v tm a (V_var a) = tm"using subst_sv_id subst_v_s_def by simp
fix p::perm and x1::x and v::v and t1::s show"p ∙ subst_v t1 x1 v = subst_v (p ∙ t1) (p ∙ x1) (p ∙ v)" using subst_sv_commute subst_v_s_def by simp
fix x::x and c::s and z::x show"atom x ♯ c ==> ((x ↔ z) ∙ c) = c[z::=[x]v]v" using subst_sv_var_flip subst_v_s_def by simp
fix x::x and c::s and z::x show"atom x ♯ c ==> c[z::=[x]v]v[x::=v]v = c[z::=v]v" using subst_sv_var_flip subst_v_s_def by simp qed end
section‹Type Definition›
nominal_function subst_ft_v :: "fun_typ ==> x ==> v ==> fun_typ"where "atom z ♯ (x,v) ==> subst_ft_v ( AF_fun_typ z b c t (s::s)) x v = AF_fun_typ z b c[x::=v]cv t[x::=v]\<tau>v s[x::=v]sv" apply(simp add: eqvt_def subst_ft_v_graph_aux_def ) apply(simp add:fun_typ.strong_exhaust ) apply(auto) apply(rule_tac y=a and c="(aa,b)"in fun_typ.strong_exhaust) apply (auto simp: eqvt_at_def fresh_star_def fresh_Pair fresh_at_base)
proof(goal_cases) case (1 z xa va c t s za ca ta sa cb) hence"c[z::=[ cb ]v]cv = ca[za::=[ cb ]v]cv" by (metis flip_commute subst_cv_var_flip) hence"c[z::=[ cb ]v]cv[xa::=va]cv = ca[za::=[ cb ]v]cv[xa::=va]cv"by auto thenshow ?caseusing subst_cv_commute atom_eq_iff fresh_atom fresh_atom_at_base subst_cv_commute_full v.fresh using1 subst_cv_var_flip flip_commute by metis next case (2 z xa va c t s za ca ta sa cb) hence"t[z::=[ cb ]v]\<tau>v = ta[za::=[ cb ]v]\<tau>v"by metis hence"t[z::=[ cb ]v]\<tau>v[xa::=va]\<tau>v = ta[za::=[ cb ]v]\<tau>v[xa::=va]\<tau>v"by auto thenshow ?caseusing subst_tv_commute_full 2 by (metis atom_eq_iff fresh_atom fresh_atom_at_base v.fresh(2)) qed
nominal_termination (eqvt) by lexicographic_order
nominal_function subst_ftq_v :: "fun_typ_q ==> x ==> v ==> fun_typ_q"where "atom bv ♯ (x,v) ==> subst_ftq_v (AF_fun_typ_some bv ft) x v = (AF_fun_typ_some bv (subst_ft_v ft x v))"
| "subst_ftq_v (AF_fun_typ_none ft) x v = (AF_fun_typ_none (subst_ft_v ft x v))" apply(simp add: eqvt_def subst_ftq_v_graph_aux_def ) apply(simp add:fun_typ_q.strong_exhaust ) apply(auto) apply(rule_tac y=a and c="(aa,b)"in fun_typ_q.strong_exhaust) apply (auto simp: eqvt_at_def fresh_star_def fresh_Pair fresh_at_base) proof(goal_cases) case (1 bv ft bva fta xa va c) thenshow ?caseusing subst_ft_v.simps by (simp add: flip_fresh_fresh) qed
nominal_termination (eqvt) by lexicographic_order
lemma size_subst_ft[simp]: "size (subst_ft_v A x v) = size A" by(nominal_induct A avoiding: x v rule: fun_typ.strong_induct,auto)
lemma forget_subst_ft [simp]: shows"atom x ♯ A ==> subst_ft_v A x a = A" by (nominal_induct A avoiding: a x rule: fun_typ.strong_induct,auto simp: fresh_at_base)
lemma subst_ft_id [simp]: "subst_ft_v A a (V_var a) = A" by(nominal_induct A avoiding: a rule: fun_typ.strong_induct,auto)
instantiation fun_typ :: has_subst_v begin
definition "subst_v = subst_ft_v"
instanceproof
fix j::atom and i::x and x::v and t::fun_typ show"(j ♯ subst_v t i x) = ((atom i ♯ t ∧ j ♯ t) ∨ (j ♯ x ∧ (j ♯ t ∨ j = atom i)))" apply(nominal_induct t avoiding: i x rule:fun_typ.strong_induct) apply(simp only: subst_v_fun_typ_def subst_ft_v.simps ) using fun_typ.fresh fresh_subst_v_if apply simp by auto
fix a::x and tm::fun_typ and x::v show"atom a ♯ tm ==> subst_v tm a x = tm" proof(nominal_induct tm avoiding: a x rule:fun_typ.strong_induct) case (AF_fun_typ x1a x2a x3a x4a x5a) thenshow ?caseunfolding subst_ft_v.simps subst_v_fun_typ_def fun_typ.fresh using forget_subst_v subst_ft_v.simps subst_v_c_def forget_subst_sv subst_v_τ_defby fastforce qed
fix a::x and tm::fun_typ show"subst_v tm a (V_var a) = tm" proof(nominal_induct tm avoiding: a x rule:fun_typ.strong_induct) case (AF_fun_typ x1a x2a x3a x4a x5a) thenshow ?caseunfolding subst_ft_v.simps subst_v_fun_typ_def fun_typ.fresh using forget_subst_v subst_ft_v.simps subst_v_c_def forget_subst_sv subst_v_τ_defby fastforce qed
fix p::perm and x1::x and v::v and t1::fun_typ show"p ∙ subst_v t1 x1 v = subst_v (p ∙ t1) (p ∙ x1) (p ∙ v)" proof(nominal_induct t1 avoiding: x1 v rule:fun_typ.strong_induct) case (AF_fun_typ x1a x2a x3a x4a x5a) thenshow ?caseunfolding subst_ft_v.simps subst_v_fun_typ_def fun_typ.fresh using forget_subst_v subst_ft_v.simps subst_v_c_def forget_subst_sv subst_v_τ_defby fastforce qed
fix x::x and c::fun_typ and z::x show"atom x ♯ c ==> ((x ↔ z) ∙ c) = c[z::=[x]v]v" apply(nominal_induct c avoiding: x z rule:fun_typ.strong_induct) by (auto simp add: subst_v_c_def subst_v_s_def subst_v_τ_def subst_v_fun_typ_def)
fix x::x and c::fun_typ and z::x show"atom x ♯ c ==> c[z::=[x]v]v[x::=v]v = c[z::=v]v" apply(nominal_induct c avoiding: z x v rule:fun_typ.strong_induct) apply auto by (auto simp add: subst_v_c_def subst_v_s_def subst_v_τ_def subst_v_fun_typ_def ) qed end
instantiation fun_typ_q :: has_subst_v begin
definition "subst_v = subst_ftq_v"
instanceproof fix j::atom and i::x and x::v and t::fun_typ_q show"(j ♯ subst_v t i x) = ((atom i ♯ t ∧ j ♯ t) ∨ (j ♯ x ∧ (j ♯ t ∨ j = atom i)))" apply(nominal_induct t avoiding: i x rule:fun_typ_q.strong_induct,auto) apply(auto simp add: subst_v_fun_typ_def subst_v_s_def subst_v_τ_def subst_v_fun_typ_q_def fresh_subst_v_if ) by (metis (no_types) fresh_subst_v_if subst_v_fun_typ_def)+
fix i::x and t::fun_typ_q and x::v show"atom i ♯ t ==> subst_v t i x = t" apply(nominal_induct t avoiding: i x rule:fun_typ_q.strong_induct,auto) by(auto simp add: subst_v_fun_typ_def subst_v_s_def subst_v_τ_def subst_v_fun_typ_q_def fresh_subst_v_if )
fix i::x and t::fun_typ_q show"subst_v t i (V_var i) = t"using subst_cv_id subst_v_fun_typ_def apply(nominal_induct t avoiding: i x rule:fun_typ_q.strong_induct,auto) by(auto simp add: subst_v_fun_typ_def subst_v_s_def subst_v_τ_def subst_v_fun_typ_q_def fresh_subst_v_if )
fix p::perm and x1::x and v::v and t1::fun_typ_q show"p ∙ subst_v t1 x1 v = subst_v (p ∙ t1) (p ∙ x1) (p ∙ v)" apply(nominal_induct t1 avoiding: v x1 rule:fun_typ_q.strong_induct,auto) by(auto simp add: subst_v_fun_typ_def subst_v_s_def subst_v_τ_def subst_v_fun_typ_q_def fresh_subst_v_if )
fix x::x and c::fun_typ_q and z::x show"atom x ♯ c ==> ((x ↔ z) ∙ c) = c[z::=[x]v]v" apply(nominal_induct c avoiding: x z rule:fun_typ_q.strong_induct,auto) by(auto simp add: subst_v_fun_typ_def subst_v_s_def subst_v_τ_def subst_v_fun_typ_q_def fresh_subst_v_if )
fix x::x and c::fun_typ_q and z::x show"atom x ♯ c ==> c[z::=[x]v]v[x::=v]v = c[z::=v]v" apply(nominal_induct c avoiding: z x v rule:fun_typ_q.strong_induct,auto) apply(auto simp add: subst_v_fun_typ_def subst_v_s_def subst_v_τ_def subst_v_fun_typ_q_def fresh_subst_v_if ) by (metis subst_v_fun_typ_def flip_bv_x_cancel subst_ft_v.eqvt subst_v_simple_commute v.perm_simps )+ qed
lemma subst_gv_member_iff: fixes x'::x and x::x and v::v and c'::c assumes"(x',b',c') ∈ toSet Γ"and"atom x ∉ atom_dom Γ" shows"(x',b',c'[x::=v]cv) ∈ toSet Γ[x::=v]\<Gamma>v" proof - have"x' ≠ x"using assms fresh_dom_free2 by metis thenshow ?thesis using assms proof(induct Γ rule: Γ_induct) case GNil thenshow ?caseby auto next case (GCons x1 b1 c1 Γ') show ?caseproof(cases "(x',b',c') = (x1,b1,c1)") case True hence"((x1, b1, c1) #\<Gamma> Γ')[x::=v]\<Gamma>v = ((x1, b1, c1[x::=v]cv) #\<Gamma> (Γ'[x::=v]\<Gamma>v))"using subst_gv.simps ‹x'≠x›by auto thenshow ?thesis using True by auto next case False have"x1≠x"using fresh_def fresh_GCons fresh_Pair supp_at_base GCons fresh_dom_free2 by auto hence"(x', b', c') ∈ toSet Γ'"using GCons False toSet.simps by auto moreoverhave"atom x ∉ atom_dom Γ'"using fresh_GCons GCons dom.simps toSet.simps by simp ultimatelyhave"(x', b', c'[x::=v]cv) ∈ toSet Γ'[x::=v]\<Gamma>v"using GCons by auto hence"(x', b', c'[x::=v]cv) ∈ toSet ((x1, b1, c1[x::=v]cv) #\<Gamma> (Γ'[x::=v]\<Gamma>v))"by auto thenshow ?thesis using subst_gv.simps ‹x1≠x›by auto qed qed qed
lemma fresh_subst_gv_if: fixes j::atom and i::x and x::v and t::Γ assumes"j ♯ t ∧ j ♯ x" shows"(j ♯ subst_gv t i x)" using assms proof(induct t rule: Γ_induct) case GNil thenshow ?caseusing subst_gv.simps fresh_GNil by auto next case (GCons x' b' c' Γ') thenshow ?caseunfolding subst_gv.simps using fresh_GCons fresh_subst_cv_if by auto qed
section‹Lookup›
lemma set_GConsD: "y ∈ toSet (x #\<Gamma> xs) ==> y=x ∨ y ∈ toSet xs" by auto
lemma subst_g_assoc_cons: assumes"x ≠ x'" shows"(((x', b', c') #\<Gamma> Γ')[x::=v]\<Gamma>v @ G) = ((x', b', c'[x::=v]cv) #\<Gamma> ((Γ'[x::=v]\<Gamma>v) @ G))" using subst_gv.simps append_g.simps assms by auto
end
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.163Bemerkung:
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.