# HG changeset patch # User wenzelm # Date 1004098953 -7200 # Node ID 1b540afebf4d10fc48bbb990b07c62fa0d6eaed5 # Parent 0594e63e60575a985609013ab7b121888d09976c Rrightarrow; diff -r 0594e63e6057 -r 1b540afebf4d src/HOL/Lambda/Type.thy --- a/src/HOL/Lambda/Type.thy Fri Oct 26 14:02:58 2001 +0200 +++ b/src/HOL/Lambda/Type.thy Fri Oct 26 14:22:33 2001 +0200 @@ -19,14 +19,14 @@ datatype type = Atom nat - | Fun type type (infixr "\" 200) + | Fun type type (infixr "\" 200) consts typing :: "((nat \ type) \ dB \ type) set" typings :: "(nat \ type) \ dB list \ type list \ bool" syntax - "_funs" :: "type list \ type \ type" (infixr "=\" 200) + "_funs" :: "type list \ type \ type" (infixr "=>>" 200) "_typing" :: "(nat \ type) \ dB \ type \ bool" ("_ |- _ : _" [50, 50, 50] 50) "_typings" :: "(nat \ type) \ dB list \ type list \ bool" ("_ ||- _ : _" [50, 50, 50] 50) @@ -34,19 +34,20 @@ syntax (symbols) "_typing" :: "(nat \ type) \ dB \ type \ bool" ("_ \ _ : _" [50, 50, 50] 50) syntax (latex) + "_funs" :: "type list \ type \ type" (infixr "\" 200) "_typings" :: "(nat \ type) \ dB list \ type list \ bool" ("_ \ _ : _" [50, 50, 50] 50) translations - "Ts =\ T" \ "foldr Fun Ts T" + "Ts \ T" \ "foldr Fun Ts T" "env \ t : T" \ "(env, t, T) \ typing" "env \ ts : Ts" \ "typings env ts Ts" inductive typing intros Var [intro!]: "env x = T \ env \ Var x : T" - Abs [intro!]: "(nat_case T env) \ t : U \ env \ Abs t : (T \ U)" - App [intro!]: "env \ s : T \ U \ env \ t : T \ env \ (s \<^sub>\ t) : U" + Abs [intro!]: "nat_case T env \ t : U \ env \ Abs t : (T \ U)" + App [intro!]: "env \ s : T \ U \ env \ t : T \ env \ (s \<^sub>\ t) : U" inductive_cases typing_elims [elim!]: "e \ Var i : T" @@ -82,7 +83,7 @@ subsection {* @{text n}-ary function types *} lemma list_app_typeD [rule_format]: - "\t T. e \ t \<^sub>\\<^sub>\ ts : T \ (\Ts. e \ t : Ts =\ T \ e \ ts : Ts)" + "\t T. e \ t \<^sub>\\<^sub>\ ts : T \ (\Ts. e \ t : Ts \ T \ e \ ts : Ts)" apply (induct_tac ts) apply simp apply (intro strip) @@ -98,11 +99,11 @@ done lemma list_app_typeE: - "e \ t \<^sub>\\<^sub>\ ts : T \ (\Ts. e \ t : Ts =\ T \ e \ ts : Ts \ C) \ C" + "e \ t \<^sub>\\<^sub>\ ts : T \ (\Ts. e \ t : Ts \ T \ e \ ts : Ts \ C) \ C" by (insert list_app_typeD) fast lemma list_app_typeI [rule_format]: - "\t T Ts. e \ t : Ts =\ T \ e \ ts : Ts \ e \ t \<^sub>\\<^sub>\ ts : T" + "\t T Ts. e \ t : Ts \ T \ e \ ts : Ts \ e \ t \<^sub>\\<^sub>\ ts : T" apply (induct_tac ts) apply (intro strip) apply simp @@ -265,7 +266,7 @@ apply (intro strip) apply (ind_cases "s \<^sub>\ t -> t'") apply hypsubst - apply (ind_cases "env \ Abs t : T \ U") + apply (ind_cases "env \ Abs t : T \ U") apply (rule subst_lemma) apply assumption apply assumption @@ -335,8 +336,8 @@ done lemma type_induct [induct type]: - "(\T. (\T1 T2. T = T1 \ T2 \ P T1) \ - (\T1 T2. T = T1 \ T2 \ P T2) \ P T) \ P T" + "(\T. (\T1 T2. T = T1 \ T2 \ P T1) \ + (\T1 T2. T = T1 \ T2 \ P T2) \ P T) \ P T" proof - case rule_context show ?thesis @@ -358,8 +359,8 @@ (is "PROP ?P U" is "\t e T u i. _ \ PROP ?Q t e T u i U") proof (induct U) fix T t - assume MI1: "\T1 T2. T = T1 \ T2 \ PROP ?P T1" - assume MI2: "\T1 T2. T = T1 \ T2 \ PROP ?P T2" + assume MI1: "\T1 T2. T = T1 \ T2 \ PROP ?P T1" + assume MI2: "\T1 T2. T = T1 \ T2 \ PROP ?P T2" assume "t \ IT" thus "\e T' u i. PROP ?Q t e T' u i T" proof induct @@ -383,16 +384,16 @@ case (Cons a as) with nT have "e\i:T\ \ Var n \<^sub>\ a \<^sub>\\<^sub>\ as : T'" by simp then obtain Ts - where headT: "e\i:T\ \ Var n \<^sub>\ a : Ts =\ T'" + where headT: "e\i:T\ \ Var n \<^sub>\ a : Ts \ T'" and argsT: "(e\i:T\) \ as : Ts" by (rule list_app_typeE) from headT obtain T'' - where varT: "e\i:T\ \ Var n : T'' \ Ts =\ T'" + where varT: "e\i:T\ \ Var n : T'' \ Ts \ T'" and argT: "e\i:T\ \ a : T''" by cases simp_all - from varT True have T: "T = T'' \ Ts =\ T'" + from varT True have T: "T = T'' \ Ts \ T'" by cases (auto simp add: shift_def) - with uT have uT': "e \ u : T'' \ Ts =\ T'" by simp + with uT have uT': "e \ u : T'' \ Ts \ T'" by simp from Var have SI: "?R a" by cases (simp_all add: Cons) from T have "(Var 0 \<^sub>\\<^sub>\ map (\t. lift t 0) (map (\t. t[u/i]) as))[(u \<^sub>\ a[u/i])/0] \ IT" @@ -401,9 +402,9 @@ proof (rule MI1) have "lift u 0 \ IT" by (rule lift_IT) thus "lift u 0 \<^sub>\ Var 0 \ IT" by (rule app_Var_IT) - show "e\0:T''\ \ lift u 0 \<^sub>\ Var 0 : Ts =\ T'" + show "e\0:T''\ \ lift u 0 \<^sub>\ Var 0 : Ts \ T'" proof (rule typing.App) - show "e\0:T''\ \ lift u 0 : T'' \ Ts =\ T'" + show "e\0:T''\ \ lift u 0 : T'' \ Ts \ T'" by (rule lift_type') (rule uT') show "e\0:T''\ \ Var 0 : T''" by (rule typing.Var) (simp add: shift_def) @@ -436,17 +437,17 @@ thus ?case by simp qed thus "Var 0 \<^sub>\\<^sub>\ ?ls as \ IT" by (rule IT.Var) - have "e\0:Ts =\ T'\ \ Var 0 : Ts =\ T'" + have "e\0:Ts \ T'\ \ Var 0 : Ts \ T'" by (rule typing.Var) (simp add: shift_def) moreover from uT argsT have "e \ map (\t. t[u/i]) as : Ts" by (rule substs_lemma) - hence "(e\0:Ts =\ T'\) \ ?ls as : Ts" + hence "(e\0:Ts \ T'\) \ ?ls as : Ts" by (rule lift_typings) - ultimately show "e\0:Ts =\ T'\ \ Var 0 \<^sub>\\<^sub>\ ?ls as : T'" + ultimately show "e\0:Ts \ T'\ \ Var 0 \<^sub>\\<^sub>\ ?ls as : T'" by (rule list_app_typeI) from argT uT have "e \ a[u/i] : T''" by (rule subst_lemma) (rule refl) - with uT' show "e \ u \<^sub>\ a[u/i] : Ts =\ T'" + with uT' show "e \ u \<^sub>\ a[u/i] : Ts \ T'" by (rule typing.App) qed with Cons True show ?thesis @@ -527,11 +528,11 @@ hence "Var 0 \<^sub>\\<^sub>\ [lift t 0] \ IT" by (rule IT.Var) also have "(Var 0 \<^sub>\\<^sub>\ [lift t 0]) = (Var 0 \<^sub>\ lift t 0)" by simp finally show "\ \ IT" . - have "e\0:T \ U\ \ Var 0 : T \ U" + have "e\0:T \ U\ \ Var 0 : T \ U" by (rule typing.Var) (simp add: shift_def) - moreover have "e\0:T \ U\ \ lift t 0 : T" + moreover have "e\0:T \ U\ \ lift t 0 : T" by (rule lift_type') - ultimately show "e\0:T \ U\ \ Var 0 \<^sub>\ lift t 0 : U" + ultimately show "e\0:T \ U\ \ Var 0 \<^sub>\ lift t 0 : U" by (rule typing.App) qed thus ?case by simp diff -r 0594e63e6057 -r 1b540afebf4d src/HOL/Lambda/document/root.tex --- a/src/HOL/Lambda/document/root.tex Fri Oct 26 14:02:58 2001 +0200 +++ b/src/HOL/Lambda/document/root.tex Fri Oct 26 14:22:33 2001 +0200 @@ -5,10 +5,12 @@ \usepackage{graphicx} \usepackage[english]{babel} \usepackage[latin1]{inputenc} +\usepackage{amssymb} \usepackage{isabelle,isabellesym,pdfsetup} \isabellestyle{it} \renewcommand{\isamarkupsubsubsection}[1]{\subsubsection*{#1}} +\newcommand{\isasymRrightarrow}{\isamath{\Rrightarrow}} \begin{document}