src/HOL/Lambda/Type.thy
changeset 18257 2124b24454dd
parent 18241 afdba6b3e383
child 19086 1b3780be6cc2
equal deleted inserted replaced
18256:8de262a22f23 18257:2124b24454dd
   286   done
   286   done
   287 
   287 
   288 
   288 
   289 subsection {* Lifting preserves well-typedness *}
   289 subsection {* Lifting preserves well-typedness *}
   290 
   290 
   291 lemma lift_type [intro!]: "e \<turnstile> t : T \<Longrightarrow> (\<And>i U. e\<langle>i:U\<rangle> \<turnstile> lift t i : T)"
   291 lemma lift_type [intro!]: "e \<turnstile> t : T \<Longrightarrow> e\<langle>i:U\<rangle> \<turnstile> lift t i : T"
   292   by (induct set: typing) auto
   292   by (induct fixing: i U set: typing) auto
   293 
   293 
   294 lemma lift_types:
   294 lemma lift_types:
   295   "e \<tturnstile> ts : Ts \<Longrightarrow> e\<langle>i:U\<rangle> \<tturnstile> (map (\<lambda>t. lift t i) ts) : Ts"
   295   "e \<tturnstile> ts : Ts \<Longrightarrow> e\<langle>i:U\<rangle> \<tturnstile> (map (\<lambda>t. lift t i) ts) : Ts"
   296   apply (induct ts fixing: Ts)
   296   apply (induct ts fixing: Ts)
   297    apply simp
   297    apply simp
   301 
   301 
   302 
   302 
   303 subsection {* Substitution lemmas *}
   303 subsection {* Substitution lemmas *}
   304 
   304 
   305 lemma subst_lemma:
   305 lemma subst_lemma:
   306     "e \<turnstile> t : T \<Longrightarrow> (\<And>e' i U u. e' \<turnstile> u : U \<Longrightarrow> e = e'\<langle>i:U\<rangle> \<Longrightarrow> e' \<turnstile> t[u/i] : T)"
   306     "e \<turnstile> t : T \<Longrightarrow> e' \<turnstile> u : U \<Longrightarrow> e = e'\<langle>i:U\<rangle> \<Longrightarrow> e' \<turnstile> t[u/i] : T"
   307   apply (induct set: typing)
   307   apply (induct fixing: e' i U u set: typing)
   308     apply (rule_tac x = x and y = i in linorder_cases)
   308     apply (rule_tac x = x and y = i in linorder_cases)
   309       apply auto
   309       apply auto
   310   apply blast
   310   apply blast
   311   done
   311   done
   312 
   312 
   327   done
   327   done
   328 
   328 
   329 
   329 
   330 subsection {* Subject reduction *}
   330 subsection {* Subject reduction *}
   331 
   331 
   332 lemma subject_reduction: "e \<turnstile> t : T \<Longrightarrow> (\<And>t'. t -> t' \<Longrightarrow> e \<turnstile> t' : T)"
   332 lemma subject_reduction: "e \<turnstile> t : T \<Longrightarrow> t -> t' \<Longrightarrow> e \<turnstile> t' : T"
   333   apply (induct set: typing)
   333   apply (induct fixing: t' set: typing)
   334     apply blast
   334     apply blast
   335    apply blast
   335    apply blast
   336   apply atomize
   336   apply atomize
   337   apply (ind_cases "s \<degree> t -> t'")
   337   apply (ind_cases "s \<degree> t -> t'")
   338     apply hypsubst
   338     apply hypsubst