| author | wenzelm | 
| Wed, 30 Aug 2006 12:28:32 +0200 | |
| changeset 20437 | 0eb5e30fd620 | 
| parent 20217 | 25b068a99d2b | 
| child 20503 | 503ac4c5ef91 | 
| permissions | -rw-r--r-- | 
| 1269 | 1 | (* Title: HOL/Lambda/Eta.thy | 
| 2 | ID: $Id$ | |
| 15522 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 3 | Author: Tobias Nipkow and Stefan Berghofer | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 4 | Copyright 1995, 2005 TU Muenchen | 
| 1269 | 5 | *) | 
| 6 | ||
| 9811 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 7 | header {* Eta-reduction *}
 | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 8 | |
| 16417 | 9 | theory Eta imports ParRed begin | 
| 9811 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 10 | |
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 11 | |
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 12 | subsection {* Definition of eta-reduction and relatives *}
 | 
| 1269 | 13 | |
| 9811 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 14 | consts | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 15 | free :: "dB => nat => bool" | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 16 | primrec | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 17 | "free (Var j) i = (j = i)" | 
| 12011 | 18 | "free (s \<degree> t) i = (free s i \<or> free t i)" | 
| 9811 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 19 | "free (Abs s) i = free s (i + 1)" | 
| 1269 | 20 | |
| 9811 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 21 | consts | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 22 | eta :: "(dB \<times> dB) set" | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 23 | |
| 19363 | 24 | abbreviation | 
| 19086 | 25 | eta_red :: "[dB, dB] => bool" (infixl "-e>" 50) | 
| 19363 | 26 | "s -e> t == (s, t) \<in> eta" | 
| 19086 | 27 | eta_reds :: "[dB, dB] => bool" (infixl "-e>>" 50) | 
| 19363 | 28 | "s -e>> t == (s, t) \<in> eta^*" | 
| 19086 | 29 | eta_red0 :: "[dB, dB] => bool" (infixl "-e>=" 50) | 
| 19363 | 30 | "s -e>= t == (s, t) \<in> eta^=" | 
| 1269 | 31 | |
| 1789 | 32 | inductive eta | 
| 11638 | 33 | intros | 
| 12011 | 34 | eta [simp, intro]: "\<not> free s 0 ==> Abs (s \<degree> Var 0) -e> s[dummy/0]" | 
| 35 | appL [simp, intro]: "s -e> t ==> s \<degree> u -e> t \<degree> u" | |
| 36 | appR [simp, intro]: "s -e> t ==> u \<degree> s -e> u \<degree> t" | |
| 11638 | 37 | abs [simp, intro]: "s -e> t ==> Abs s -e> Abs t" | 
| 9811 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 38 | |
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 39 | inductive_cases eta_cases [elim!]: | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 40 | "Abs s -e> z" | 
| 12011 | 41 | "s \<degree> t -e> u" | 
| 9811 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 42 | "Var i -e> t" | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 43 | |
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 44 | |
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 45 | subsection "Properties of eta, subst and free" | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 46 | |
| 18241 | 47 | lemma subst_not_free [simp]: "\<not> free s i \<Longrightarrow> s[t/i] = s[u/i]" | 
| 48 | by (induct s fixing: i t u) (simp_all add: subst_Var) | |
| 9811 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 49 | |
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 50 | lemma free_lift [simp]: | 
| 18241 | 51 | "free (lift t k) i = (i < k \<and> free t i \<or> k < i \<and> free t (i - 1))" | 
| 52 | apply (induct t fixing: i k) | |
| 20217 
25b068a99d2b
linear arithmetic splits certain operators (e.g. min, max, abs)
 webertj parents: 
19656diff
changeset | 53 | apply (auto cong: conj_cong) | 
| 9811 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 54 | done | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 55 | |
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 56 | lemma free_subst [simp]: | 
| 18241 | 57 | "free (s[t/k]) i = | 
| 9811 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 58 | (free s k \<and> free t i \<or> free s (if i < k then i else i + 1))" | 
| 18241 | 59 | apply (induct s fixing: i k t) | 
| 9811 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 60 | prefer 2 | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 61 | apply simp | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 62 | apply blast | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 63 | prefer 2 | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 64 | apply simp | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 65 | apply (simp add: diff_Suc subst_Var split: nat.split) | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 66 | done | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 67 | |
| 18257 | 68 | lemma free_eta: "s -e> t ==> free t i = free s i" | 
| 69 | by (induct fixing: i set: eta) (simp_all cong: conj_cong) | |
| 9811 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 70 | |
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 71 | lemma not_free_eta: | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 72 | "[| s -e> t; \<not> free s i |] ==> \<not> free t i" | 
| 18241 | 73 | by (simp add: free_eta) | 
| 9811 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 74 | |
| 18241 | 75 | lemma eta_subst [simp]: | 
| 18257 | 76 | "s -e> t ==> s[u/i] -e> t[u/i]" | 
| 77 | by (induct fixing: u i set: eta) (simp_all add: subst_subst [symmetric]) | |
| 9811 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 78 | |
| 18241 | 79 | theorem lift_subst_dummy: "\<not> free s i \<Longrightarrow> lift (s[dummy/i]) i = s" | 
| 80 | by (induct s fixing: i dummy) simp_all | |
| 15522 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 81 | |
| 9811 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 82 | |
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 83 | subsection "Confluence of eta" | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 84 | |
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 85 | lemma square_eta: "square eta eta (eta^=) (eta^=)" | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 86 | apply (unfold square_def id_def) | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 87 | apply (rule impI [THEN allI [THEN allI]]) | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 88 | apply simp | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 89 | apply (erule eta.induct) | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 90 | apply (slowsimp intro: subst_not_free eta_subst free_eta [THEN iffD1]) | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 91 | apply safe | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 92 | prefer 5 | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 93 | apply (blast intro!: eta_subst intro: free_eta [THEN iffD1]) | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 94 | apply blast+ | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 95 | done | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 96 | |
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 97 | theorem eta_confluent: "confluent eta" | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 98 | apply (rule square_eta [THEN square_reflcl_confluent]) | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 99 | done | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 100 | |
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 101 | |
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 102 | subsection "Congruence rules for eta*" | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 103 | |
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 104 | lemma rtrancl_eta_Abs: "s -e>> s' ==> Abs s -e>> Abs s'" | 
| 18241 | 105 | by (induct set: rtrancl) | 
| 106 | (blast intro: rtrancl_refl rtrancl_into_rtrancl)+ | |
| 9811 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 107 | |
| 12011 | 108 | lemma rtrancl_eta_AppL: "s -e>> s' ==> s \<degree> t -e>> s' \<degree> t" | 
| 18241 | 109 | by (induct set: rtrancl) | 
| 110 | (blast intro: rtrancl_refl rtrancl_into_rtrancl)+ | |
| 9811 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 111 | |
| 12011 | 112 | lemma rtrancl_eta_AppR: "t -e>> t' ==> s \<degree> t -e>> s \<degree> t'" | 
| 18241 | 113 | by (induct set: rtrancl) (blast intro: rtrancl_refl rtrancl_into_rtrancl)+ | 
| 9811 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 114 | |
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 115 | lemma rtrancl_eta_App: | 
| 12011 | 116 | "[| s -e>> s'; t -e>> t' |] ==> s \<degree> t -e>> s' \<degree> t'" | 
| 18241 | 117 | by (blast intro!: rtrancl_eta_AppL rtrancl_eta_AppR intro: rtrancl_trans) | 
| 9811 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 118 | |
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 119 | |
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 120 | subsection "Commutation of beta and eta" | 
| 1900 | 121 | |
| 18241 | 122 | lemma free_beta: | 
| 18257 | 123 | "s -> t ==> free t i \<Longrightarrow> free s i" | 
| 124 | by (induct fixing: i set: beta) auto | |
| 9811 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 125 | |
| 18257 | 126 | lemma beta_subst [intro]: "s -> t ==> s[u/i] -> t[u/i]" | 
| 127 | by (induct fixing: u i set: beta) (simp_all add: subst_subst [symmetric]) | |
| 9811 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 128 | |
| 18241 | 129 | lemma subst_Var_Suc [simp]: "t[Var i/i] = t[Var(i)/i + 1]" | 
| 130 | by (induct t fixing: i) (auto elim!: linorder_neqE simp: subst_Var) | |
| 9811 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 131 | |
| 18257 | 132 | lemma eta_lift [simp]: "s -e> t ==> lift s i -e> lift t i" | 
| 133 | by (induct fixing: i set: eta) simp_all | |
| 9811 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 134 | |
| 18241 | 135 | lemma rtrancl_eta_subst: "s -e> t \<Longrightarrow> u[s/i] -e>> u[t/i]" | 
| 136 | apply (induct u fixing: s t i) | |
| 9811 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 137 | apply (simp_all add: subst_Var) | 
| 18241 | 138 | apply blast | 
| 9811 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 139 | apply (blast intro: rtrancl_eta_App) | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 140 | apply (blast intro!: rtrancl_eta_Abs eta_lift) | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 141 | done | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 142 | |
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 143 | lemma square_beta_eta: "square beta eta (eta^*) (beta^=)" | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 144 | apply (unfold square_def) | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 145 | apply (rule impI [THEN allI [THEN allI]]) | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 146 | apply (erule beta.induct) | 
| 11183 | 147 | apply (slowsimp intro: rtrancl_eta_subst eta_subst) | 
| 148 | apply (blast intro: rtrancl_eta_AppL) | |
| 149 | apply (blast intro: rtrancl_eta_AppR) | |
| 150 | apply simp; | |
| 151 | apply (slowsimp intro: rtrancl_eta_Abs free_beta | |
| 9858 | 152 | iff del: dB.distinct simp: dB.distinct) (*23 seconds?*) | 
| 9811 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 153 | done | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 154 | |
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 155 | lemma confluent_beta_eta: "confluent (beta \<union> eta)" | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 156 | apply (assumption | | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 157 | rule square_rtrancl_reflcl_commute confluent_Un | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 158 | beta_confluent eta_confluent square_beta_eta)+ | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 159 | done | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 160 | |
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 161 | |
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 162 | subsection "Implicit definition of eta" | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 163 | |
| 12011 | 164 | text {* @{term "Abs (lift s 0 \<degree> Var 0) -e> s"} *}
 | 
| 9811 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 165 | |
| 18241 | 166 | lemma not_free_iff_lifted: | 
| 167 | "(\<not> free s i) = (\<exists>t. s = lift t i)" | |
| 168 | apply (induct s fixing: i) | |
| 9811 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 169 | apply simp | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 170 | apply (rule iffI) | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 171 | apply (erule linorder_neqE) | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 172 | apply (rule_tac x = "Var nat" in exI) | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 173 | apply simp | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 174 | apply (rule_tac x = "Var (nat - 1)" in exI) | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 175 | apply simp | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 176 | apply clarify | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 177 | apply (rule notE) | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 178 | prefer 2 | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 179 | apply assumption | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 180 | apply (erule thin_rl) | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 181 | apply (case_tac t) | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 182 | apply simp | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 183 | apply simp | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 184 | apply simp | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 185 | apply simp | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 186 | apply (erule thin_rl) | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 187 | apply (erule thin_rl) | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 188 | apply (rule iffI) | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 189 | apply (elim conjE exE) | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 190 | apply (rename_tac u1 u2) | 
| 12011 | 191 | apply (rule_tac x = "u1 \<degree> u2" in exI) | 
| 9811 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 192 | apply simp | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 193 | apply (erule exE) | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 194 | apply (erule rev_mp) | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 195 | apply (case_tac t) | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 196 | apply simp | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 197 | apply simp | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 198 | apply blast | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 199 | apply simp | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 200 | apply simp | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 201 | apply (erule thin_rl) | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 202 | apply (rule iffI) | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 203 | apply (erule exE) | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 204 | apply (rule_tac x = "Abs t" in exI) | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 205 | apply simp | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 206 | apply (erule exE) | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 207 | apply (erule rev_mp) | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 208 | apply (case_tac t) | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 209 | apply simp | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 210 | apply simp | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 211 | apply simp | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 212 | apply blast | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 213 | done | 
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 214 | |
| 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 215 | theorem explicit_is_implicit: | 
| 12011 | 216 | "(\<forall>s u. (\<not> free s 0) --> R (Abs (s \<degree> Var 0)) (s[u/0])) = | 
| 217 | (\<forall>s. R (Abs (lift s 0 \<degree> Var 0)) s)" | |
| 18241 | 218 | by (auto simp add: not_free_iff_lifted) | 
| 9811 
39ffdb8cab03
HOL/Lambda: converted into new-style theory and document;
 wenzelm parents: 
9102diff
changeset | 219 | |
| 15522 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 220 | |
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 221 | subsection {* Parallel eta-reduction *}
 | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 222 | |
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 223 | consts | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 224 | par_eta :: "(dB \<times> dB) set" | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 225 | |
| 19363 | 226 | abbreviation | 
| 19086 | 227 | par_eta_red :: "[dB, dB] => bool" (infixl "=e>" 50) | 
| 19363 | 228 | "s =e> t == (s, t) \<in> par_eta" | 
| 15522 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 229 | |
| 19656 
09be06943252
tuned concrete syntax -- abbreviation/const_syntax;
 wenzelm parents: 
19380diff
changeset | 230 | const_syntax (xsymbols) | 
| 
09be06943252
tuned concrete syntax -- abbreviation/const_syntax;
 wenzelm parents: 
19380diff
changeset | 231 | par_eta_red (infixl "\<Rightarrow>\<^sub>\<eta>" 50) | 
| 15522 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 232 | |
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 233 | inductive par_eta | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 234 | intros | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 235 | var [simp, intro]: "Var x \<Rightarrow>\<^sub>\<eta> Var x" | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 236 | eta [simp, intro]: "\<not> free s 0 \<Longrightarrow> s \<Rightarrow>\<^sub>\<eta> s'\<Longrightarrow> Abs (s \<degree> Var 0) \<Rightarrow>\<^sub>\<eta> s'[dummy/0]" | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 237 | app [simp, intro]: "s \<Rightarrow>\<^sub>\<eta> s' \<Longrightarrow> t \<Rightarrow>\<^sub>\<eta> t' \<Longrightarrow> s \<degree> t \<Rightarrow>\<^sub>\<eta> s' \<degree> t'" | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 238 | abs [simp, intro]: "s \<Rightarrow>\<^sub>\<eta> t \<Longrightarrow> Abs s \<Rightarrow>\<^sub>\<eta> Abs t" | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 239 | |
| 18241 | 240 | lemma free_par_eta [simp]: | 
| 241 | assumes eta: "s \<Rightarrow>\<^sub>\<eta> t" | |
| 242 | shows "free t i = free s i" using eta | |
| 243 | by (induct fixing: i) (simp_all cong: conj_cong) | |
| 15522 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 244 | |
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 245 | lemma par_eta_refl [simp]: "t \<Rightarrow>\<^sub>\<eta> t" | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 246 | by (induct t) simp_all | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 247 | |
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 248 | lemma par_eta_lift [simp]: | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 249 | assumes eta: "s \<Rightarrow>\<^sub>\<eta> t" | 
| 18241 | 250 | shows "lift s i \<Rightarrow>\<^sub>\<eta> lift t i" using eta | 
| 251 | by (induct fixing: i) simp_all | |
| 15522 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 252 | |
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 253 | lemma par_eta_subst [simp]: | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 254 | assumes eta: "s \<Rightarrow>\<^sub>\<eta> t" | 
| 18241 | 255 | shows "u \<Rightarrow>\<^sub>\<eta> u' \<Longrightarrow> s[u/i] \<Rightarrow>\<^sub>\<eta> t[u'/i]" using eta | 
| 256 | by (induct fixing: u u' i) (simp_all add: subst_subst [symmetric] subst_Var) | |
| 15522 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 257 | |
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 258 | theorem eta_subset_par_eta: "eta \<subseteq> par_eta" | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 259 | apply (rule subsetI) | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 260 | apply clarify | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 261 | apply (erule eta.induct) | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 262 | apply (blast intro!: par_eta_refl)+ | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 263 | done | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 264 | |
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 265 | theorem par_eta_subset_eta: "par_eta \<subseteq> eta\<^sup>*" | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 266 | apply (rule subsetI) | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 267 | apply clarify | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 268 | apply (erule par_eta.induct) | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 269 | apply blast | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 270 | apply (rule rtrancl_into_rtrancl) | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 271 | apply (rule rtrancl_eta_Abs) | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 272 | apply (rule rtrancl_eta_AppL) | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 273 | apply assumption | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 274 | apply (rule eta.eta) | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 275 | apply simp | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 276 | apply (rule rtrancl_eta_App) | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 277 | apply assumption+ | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 278 | apply (rule rtrancl_eta_Abs) | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 279 | apply assumption | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 280 | done | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 281 | |
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 282 | |
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 283 | subsection {* n-ary eta-expansion *}
 | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 284 | |
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 285 | consts eta_expand :: "nat \<Rightarrow> dB \<Rightarrow> dB" | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 286 | primrec | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 287 | eta_expand_0: "eta_expand 0 t = t" | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 288 | eta_expand_Suc: "eta_expand (Suc n) t = Abs (lift (eta_expand n t) 0 \<degree> Var 0)" | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 289 | |
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 290 | lemma eta_expand_Suc': | 
| 18241 | 291 | "eta_expand (Suc n) t = eta_expand n (Abs (lift t 0 \<degree> Var 0))" | 
| 292 | by (induct n fixing: t) simp_all | |
| 15522 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 293 | |
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 294 | theorem lift_eta_expand: "lift (eta_expand k t) i = eta_expand k (lift t i)" | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 295 | by (induct k) (simp_all add: lift_lift) | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 296 | |
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 297 | theorem eta_expand_beta: | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 298 | assumes u: "u => u'" | 
| 18241 | 299 | shows "t => t' \<Longrightarrow> eta_expand k (Abs t) \<degree> u => t'[u'/0]" | 
| 300 | proof (induct k fixing: t t') | |
| 19656 
09be06943252
tuned concrete syntax -- abbreviation/const_syntax;
 wenzelm parents: 
19380diff
changeset | 301 | case 0 | 
| 
09be06943252
tuned concrete syntax -- abbreviation/const_syntax;
 wenzelm parents: 
19380diff
changeset | 302 | with u show ?case by simp | 
| 15522 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 303 | next | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 304 | case (Suc k) | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 305 | hence "Abs (lift t (Suc 0)) \<degree> Var 0 => lift t' (Suc 0)[Var 0/0]" | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 306 | by (blast intro: par_beta_lift) | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 307 | with Suc show ?case by (simp del: eta_expand_Suc add: eta_expand_Suc') | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 308 | qed | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 309 | |
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 310 | theorem eta_expand_red: | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 311 | assumes t: "t => t'" | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 312 | shows "eta_expand k t => eta_expand k t'" | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 313 | by (induct k) (simp_all add: t) | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 314 | |
| 18241 | 315 | theorem eta_expand_eta: "t \<Rightarrow>\<^sub>\<eta> t' \<Longrightarrow> eta_expand k t \<Rightarrow>\<^sub>\<eta> t'" | 
| 316 | proof (induct k fixing: t t') | |
| 15522 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 317 | case 0 | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 318 | show ?case by simp | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 319 | next | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 320 | case (Suc k) | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 321 | have "Abs (lift (eta_expand k t) 0 \<degree> Var 0) \<Rightarrow>\<^sub>\<eta> lift t' 0[arbitrary/0]" | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 322 | by (fastsimp intro: par_eta_lift Suc) | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 323 | thus ?case by simp | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 324 | qed | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 325 | |
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 326 | |
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 327 | subsection {* Elimination rules for parallel eta reduction *}
 | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 328 | |
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 329 | theorem par_eta_elim_app: assumes eta: "t \<Rightarrow>\<^sub>\<eta> u" | 
| 18241 | 330 | shows "u = u1' \<degree> u2' \<Longrightarrow> | 
| 15522 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 331 | \<exists>u1 u2 k. t = eta_expand k (u1 \<degree> u2) \<and> u1 \<Rightarrow>\<^sub>\<eta> u1' \<and> u2 \<Rightarrow>\<^sub>\<eta> u2'" using eta | 
| 18241 | 332 | proof (induct fixing: u1' u2') | 
| 15522 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 333 | case (app s s' t t') | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 334 | have "s \<degree> t = eta_expand 0 (s \<degree> t)" by simp | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 335 | with app show ?case by blast | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 336 | next | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 337 | case (eta dummy s s') | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 338 | then obtain u1'' u2'' where s': "s' = u1'' \<degree> u2''" | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 339 | by (cases s') (auto simp add: subst_Var free_par_eta [symmetric] split: split_if_asm) | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 340 | then have "\<exists>u1 u2 k. s = eta_expand k (u1 \<degree> u2) \<and> u1 \<Rightarrow>\<^sub>\<eta> u1'' \<and> u2 \<Rightarrow>\<^sub>\<eta> u2''" by (rule eta) | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 341 | then obtain u1 u2 k where s: "s = eta_expand k (u1 \<degree> u2)" | 
| 17589 | 342 | and u1: "u1 \<Rightarrow>\<^sub>\<eta> u1''" and u2: "u2 \<Rightarrow>\<^sub>\<eta> u2''" by iprover | 
| 15522 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 343 | from u1 u2 eta s' have "\<not> free u1 0" and "\<not> free u2 0" | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 344 | by (simp_all del: free_par_eta add: free_par_eta [symmetric]) | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 345 | with s have "Abs (s \<degree> Var 0) = eta_expand (Suc k) (u1[dummy/0] \<degree> u2[dummy/0])" | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 346 | by (simp del: lift_subst add: lift_subst_dummy lift_eta_expand) | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 347 | moreover from u1 par_eta_refl have "u1[dummy/0] \<Rightarrow>\<^sub>\<eta> u1''[dummy/0]" | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 348 | by (rule par_eta_subst) | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 349 | moreover from u2 par_eta_refl have "u2[dummy/0] \<Rightarrow>\<^sub>\<eta> u2''[dummy/0]" | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 350 | by (rule par_eta_subst) | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 351 | ultimately show ?case using eta s' | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 352 | by (simp only: subst.simps dB.simps) blast | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 353 | next | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 354 | case var thus ?case by simp | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 355 | next | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 356 | case abs thus ?case by simp | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 357 | qed | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 358 | |
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 359 | theorem par_eta_elim_abs: assumes eta: "t \<Rightarrow>\<^sub>\<eta> t'" | 
| 18241 | 360 | shows "t' = Abs u' \<Longrightarrow> | 
| 15522 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 361 | \<exists>u k. t = eta_expand k (Abs u) \<and> u \<Rightarrow>\<^sub>\<eta> u'" using eta | 
| 18241 | 362 | proof (induct fixing: u') | 
| 15522 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 363 | case (abs s t) | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 364 | have "Abs s = eta_expand 0 (Abs s)" by simp | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 365 | with abs show ?case by blast | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 366 | next | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 367 | case (eta dummy s s') | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 368 | then obtain u'' where s': "s' = Abs u''" | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 369 | by (cases s') (auto simp add: subst_Var free_par_eta [symmetric] split: split_if_asm) | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 370 | then have "\<exists>u k. s = eta_expand k (Abs u) \<and> u \<Rightarrow>\<^sub>\<eta> u''" by (rule eta) | 
| 17589 | 371 | then obtain u k where s: "s = eta_expand k (Abs u)" and u: "u \<Rightarrow>\<^sub>\<eta> u''" by iprover | 
| 15522 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 372 | from eta u s' have "\<not> free u (Suc 0)" | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 373 | by (simp del: free_par_eta add: free_par_eta [symmetric]) | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 374 | with s have "Abs (s \<degree> Var 0) = eta_expand (Suc k) (Abs (u[lift dummy 0/Suc 0]))" | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 375 | by (simp del: lift_subst add: lift_eta_expand lift_subst_dummy) | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 376 | moreover from u par_eta_refl have "u[lift dummy 0/Suc 0] \<Rightarrow>\<^sub>\<eta> u''[lift dummy 0/Suc 0]" | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 377 | by (rule par_eta_subst) | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 378 | ultimately show ?case using eta s' by fastsimp | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 379 | next | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 380 | case var thus ?case by simp | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 381 | next | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 382 | case app thus ?case by simp | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 383 | qed | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 384 | |
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 385 | |
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 386 | subsection {* Eta-postponement theorem *}
 | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 387 | |
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 388 | text {*
 | 
| 19656 
09be06943252
tuned concrete syntax -- abbreviation/const_syntax;
 wenzelm parents: 
19380diff
changeset | 389 |   Based on a proof by Masako Takahashi \cite{Takahashi-IandC}.
 | 
| 15522 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 390 | *} | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 391 | |
| 18241 | 392 | theorem par_eta_beta: "s \<Rightarrow>\<^sub>\<eta> t \<Longrightarrow> t => u \<Longrightarrow> \<exists>t'. s => t' \<and> t' \<Rightarrow>\<^sub>\<eta> u" | 
| 18460 | 393 | proof (induct t fixing: s u taking: "size :: dB \<Rightarrow> nat" rule: measure_induct_rule) | 
| 394 | case (less t) | |
| 395 | from `t => u` | |
| 15522 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 396 | show ?case | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 397 | proof cases | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 398 | case (var n) | 
| 18460 | 399 | with less show ?thesis | 
| 15522 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 400 | by (auto intro: par_beta_refl) | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 401 | next | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 402 | case (abs r' r'') | 
| 18460 | 403 | with less have "s \<Rightarrow>\<^sub>\<eta> Abs r'" by simp | 
| 15522 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 404 | then obtain r k where s: "s = eta_expand k (Abs r)" and rr: "r \<Rightarrow>\<^sub>\<eta> r'" | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 405 | by (blast dest: par_eta_elim_abs) | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 406 | from abs have "size r' < size t" by simp | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 407 | with abs(2) rr obtain t' where rt: "r => t'" and t': "t' \<Rightarrow>\<^sub>\<eta> r''" | 
| 18557 
60a0f9caa0a2
Provers/classical: stricter checks to ensure that supplied intro, dest and
 paulson parents: 
18460diff
changeset | 408 | by (blast dest: less(1)) | 
| 15522 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 409 | with s abs show ?thesis | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 410 | by (auto intro: eta_expand_red eta_expand_eta) | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 411 | next | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 412 | case (app q' q'' r' r'') | 
| 18460 | 413 | with less have "s \<Rightarrow>\<^sub>\<eta> q' \<degree> r'" by simp | 
| 15522 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 414 | then obtain q r k where s: "s = eta_expand k (q \<degree> r)" | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 415 | and qq: "q \<Rightarrow>\<^sub>\<eta> q'" and rr: "r \<Rightarrow>\<^sub>\<eta> r'" | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 416 | by (blast dest: par_eta_elim_app [OF _ refl]) | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 417 | from app have "size q' < size t" and "size r' < size t" by simp_all | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 418 | with app(2,3) qq rr obtain t' t'' where "q => t'" and | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 419 | "t' \<Rightarrow>\<^sub>\<eta> q''" and "r => t''" and "t'' \<Rightarrow>\<^sub>\<eta> r''" | 
| 18557 
60a0f9caa0a2
Provers/classical: stricter checks to ensure that supplied intro, dest and
 paulson parents: 
18460diff
changeset | 420 | by (blast dest: less(1)) | 
| 15522 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 421 | with s app show ?thesis | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 422 | by (fastsimp intro: eta_expand_red eta_expand_eta) | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 423 | next | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 424 | case (beta q' q'' r' r'') | 
| 18460 | 425 | with less have "s \<Rightarrow>\<^sub>\<eta> Abs q' \<degree> r'" by simp | 
| 15522 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 426 | then obtain q r k k' where s: "s = eta_expand k (eta_expand k' (Abs q) \<degree> r)" | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 427 | and qq: "q \<Rightarrow>\<^sub>\<eta> q'" and rr: "r \<Rightarrow>\<^sub>\<eta> r'" | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 428 | by (blast dest: par_eta_elim_app par_eta_elim_abs) | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 429 | from beta have "size q' < size t" and "size r' < size t" by simp_all | 
| 19656 
09be06943252
tuned concrete syntax -- abbreviation/const_syntax;
 wenzelm parents: 
19380diff
changeset | 430 | with beta(2-3) qq rr obtain t' t'' where "q => t'" and | 
| 15522 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 431 | "t' \<Rightarrow>\<^sub>\<eta> q''" and "r => t''" and "t'' \<Rightarrow>\<^sub>\<eta> r''" | 
| 18557 
60a0f9caa0a2
Provers/classical: stricter checks to ensure that supplied intro, dest and
 paulson parents: 
18460diff
changeset | 432 | by (blast dest: less(1)) | 
| 15522 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 433 | with s beta show ?thesis | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 434 | by (auto intro: eta_expand_red eta_expand_beta eta_expand_eta par_eta_subst) | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 435 | qed | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 436 | qed | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 437 | |
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 438 | theorem eta_postponement': assumes eta: "s -e>> t" | 
| 18241 | 439 | shows "t => u \<Longrightarrow> \<exists>t'. s => t' \<and> t' -e>> u" | 
| 15522 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 440 | using eta [simplified rtrancl_subset | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 441 | [OF eta_subset_par_eta par_eta_subset_eta, symmetric]] | 
| 18241 | 442 | proof (induct fixing: u) | 
| 15522 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 443 | case 1 | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 444 | thus ?case by blast | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 445 | next | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 446 | case (2 s' s'' s''') | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 447 | from 2 obtain t' where s': "s' => t'" and t': "t' \<Rightarrow>\<^sub>\<eta> s'''" | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 448 | by (auto dest: par_eta_beta) | 
| 18557 
60a0f9caa0a2
Provers/classical: stricter checks to ensure that supplied intro, dest and
 paulson parents: 
18460diff
changeset | 449 | from s' obtain t'' where s: "s => t''" and t'': "t'' -e>> t'" using 2 | 
| 
60a0f9caa0a2
Provers/classical: stricter checks to ensure that supplied intro, dest and
 paulson parents: 
18460diff
changeset | 450 | by blast | 
| 15522 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 451 | from par_eta_subset_eta t' have "t' -e>> s'''" .. | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 452 | with t'' have "t'' -e>> s'''" by (rule rtrancl_trans) | 
| 17589 | 453 | with s show ?case by iprover | 
| 15522 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 454 | qed | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 455 | |
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 456 | theorem eta_postponement: | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 457 | assumes st: "(s, t) \<in> (beta \<union> eta)\<^sup>*" | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 458 | shows "(s, t) \<in> eta\<^sup>* O beta\<^sup>*" using st | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 459 | proof induct | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 460 | case 1 | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 461 | show ?case by blast | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 462 | next | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 463 | case (2 s' s'') | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 464 | from 2(3) obtain t' where s: "s \<rightarrow>\<^sub>\<beta>\<^sup>* t'" and t': "t' -e>> s'" by blast | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 465 | from 2(2) show ?case | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 466 | proof | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 467 | assume "s' -> s''" | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 468 | with beta_subset_par_beta have "s' => s''" .. | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 469 | with t' obtain t'' where st: "t' => t''" and tu: "t'' -e>> s''" | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 470 | by (auto dest: eta_postponement') | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 471 | from par_beta_subset_beta st have "t' \<rightarrow>\<^sub>\<beta>\<^sup>* t''" .. | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 472 | with s have "s \<rightarrow>\<^sub>\<beta>\<^sup>* t''" by (rule rtrancl_trans) | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 473 | thus ?thesis using tu .. | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 474 | next | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 475 | assume "s' -e> s''" | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 476 | with t' have "t' -e>> s''" .. | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 477 | with s show ?thesis .. | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 478 | qed | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 479 | qed | 
| 
ec0fd05b2f2c
Added proof of eta-postponement theorem (using parallel eta-reduction).
 berghofe parents: 
13187diff
changeset | 480 | |
| 11638 | 481 | end |