You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
lemmasubst_term_var_name:"atom c \<sharp> (a, e) \<Longrightarrow> subst_term e' a e = subst_term e' c ((a \<leftrightarrow> c) \<bullet> e)"
@@ -383,7 +383,7 @@ where
383
383
384
384
|T_AppTI:"\<lbrakk> \<Gamma> \<turnstile> e : (\<forall>a . \<sigma>) \<rbrakk> \<Longrightarrow> \<Gamma> \<turnstile> TyApp e \<tau> : subst_type \<tau> a \<sigma>"
385
385
386
-
|T_AbsTI:"\<lbrakk> BTyVar a # \<Gamma> \<turnstile> e : \<sigma> ; atom a \<sharp> (e, \<sigma>, \<Gamma>) \<rbrakk> \<Longrightarrow> \<Gamma> \<turnstile> (\<Lambda> a . e) : (\<forall> a . \<sigma>)"
386
+
|T_AbsTI:"\<lbrakk> BTyVar a # \<Gamma> \<turnstile> e : \<sigma> ; atom a \<sharp> (e, \<Gamma>) \<rbrakk> \<Longrightarrow> \<Gamma> \<turnstile> (\<Lambda> a . e) : (\<forall> a . \<sigma>)"
387
387
388
388
lemmafresh_not_isin_tyvar:"atom a \<sharp> \<Gamma> \<Longrightarrow> \<not>isin (BTyVar a) \<Gamma>"
lemmasubstitution:"\<lbrakk> (x, \<tau>')#\<Gamma> \<turnstile> e : \<tau> ; [] \<turnstile> v : \<tau>' \<rbrakk> \<Longrightarrow> \<Gamma> \<turnstile> subst_term v x e : \<tau>"
135
+
lemmasubstitution:"\<lbrakk> BVar x \<tau>'#\<Gamma> \<turnstile> e : \<tau> ; [] \<turnstile> v : \<tau>' \<rbrakk> \<Longrightarrow> \<Gamma> \<turnstile> subst_term v x e : \<tau>"
thenhave"(x, \<tau>')#(y, \<sigma>)#\<Gamma> \<turnstile> e : \<tau>2"usingcontext_invariance\<open>atom y \<sharp> x\<close>byauto
150
+
thenobtain\<tau>2whereP:"BVar y \<sigma>#BVar x \<tau>'#\<Gamma> \<turnstile> e : \<tau>2 \<and> \<tau> = (\<sigma> \<rightarrow> \<tau>2)"usingT_Abs_Inv[OFLam(7)]fresh_Consfresh_Pairbinder.fresh(1)byblast
151
+
thenhave"BVar x \<tau>'#BVar y \<sigma>#\<Gamma> \<turnstile> e : \<tau>2"usingcontext_invariance\<open>atom y \<sharp> x\<close>byauto
thenhavee:"BVar x \<tau>' # BTyVar a # \<Gamma> \<turnstile> e : \<sigma>"
186
+
proof(casesrule:T.cases[OFTyLam(7)])
187
+
case(7b\<Gamma>'e'\<sigma>')
188
+
have1:"(a \<leftrightarrow> b) \<bullet> e' = e"by(metis"7"(2)"7"(5)Abs1_eq_iff(3)flip_fresh_freshfresh_PairD(1)term.eq_iff(6))
189
+
have2:"(a \<leftrightarrow> b) \<bullet> \<sigma>' = \<sigma>"by(metis"7"(3)Abs1_eq_iff(3)PTyLam.hyps(2)\<tau>.eq_iff(4)\<tau>.perm_simps(4)flip_at_simps(2)flip_fresh_fresh)
190
+
191
+
from7have"BVar x \<tau>' # BTyVar b # \<Gamma> \<turnstile> e' : \<sigma>'"usingcontext_invariancebyauto
192
+
thenhave"(a \<leftrightarrow> b) \<bullet> (BVar x \<tau>' # BTyVar b # \<Gamma> \<turnstile> e' : \<sigma>')"bysimp
193
+
thenhave3:"((a \<leftrightarrow> b) \<bullet> BVar x \<tau>') # (BTyVar a) # ((a \<leftrightarrow> b) \<bullet> \<Gamma>) \<turnstile> e : \<sigma>"using12byauto
194
+
195
+
havex:"atom a \<sharp> BVar x \<tau>'"by(simpadd:TyLam)
196
+
have"atom b \<sharp> BVar x \<tau>'"using7(1)7(5)fresh_Pairfresh_ConsTyLambymetis
197
+
thenhave4:"BVar x \<tau>' # (BTyVar a) # ((a \<leftrightarrow> b) \<bullet> \<Gamma>) \<turnstile> e : \<sigma>"using3flip_fresh_fresh[OFx]bymetis
198
+
199
+
have"atom b \<sharp> \<Gamma>"using7(1)7(5)fresh_Pairfresh_Consbymetis
0 commit comments