| author | wenzelm | 
| Sat, 17 May 2008 21:46:24 +0200 | |
| changeset 26933 | 7ca61b1ad872 | 
| parent 26838 | 7f7c6a9e083a | 
| child 27101 | 864d29f11c9d | 
| permissions | -rw-r--r-- | 
| 17293 | 1 | (* Title: HOLCF/ex/Stream_adm.thy | 
| 11355 | 2 | ID: $Id$ | 
| 17293 | 3 | Author: David von Oheimb, TU Muenchen | 
| 11350 
4c55b020d6ee
added FOCUS including the One-Element Buffer by Manfred Broy
 oheimb parents: diff
changeset | 4 | *) | 
| 
4c55b020d6ee
added FOCUS including the One-Element Buffer by Manfred Broy
 oheimb parents: diff
changeset | 5 | |
| 17293 | 6 | header {* Admissibility for streams *}
 | 
| 11350 
4c55b020d6ee
added FOCUS including the One-Element Buffer by Manfred Broy
 oheimb parents: diff
changeset | 7 | |
| 17293 | 8 | theory Stream_adm | 
| 24107 | 9 | imports "../ex/Stream" Continuity | 
| 17293 | 10 | begin | 
| 11350 
4c55b020d6ee
added FOCUS including the One-Element Buffer by Manfred Broy
 oheimb parents: diff
changeset | 11 | |
| 19763 | 12 | definition | 
| 21404 
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
 wenzelm parents: 
19763diff
changeset | 13 |   stream_monoP  :: "(('a stream) set \<Rightarrow> ('a stream) set) \<Rightarrow> bool" where
 | 
| 19763 | 14 | "stream_monoP F = (\<exists>Q i. \<forall>P s. Fin i \<le> #s \<longrightarrow> | 
| 15 | (s \<in> F P) = (stream_take i\<cdot>s \<in> Q \<and> iterate i\<cdot>rt\<cdot>s \<in> P))" | |
| 17293 | 16 | |
| 21404 
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
 wenzelm parents: 
19763diff
changeset | 17 | definition | 
| 
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
 wenzelm parents: 
19763diff
changeset | 18 |   stream_antiP  :: "(('a stream) set \<Rightarrow> ('a stream) set) \<Rightarrow> bool" where
 | 
| 19763 | 19 | "stream_antiP F = (\<forall>P x. \<exists>Q i. | 
| 17293 | 20 | (#x < Fin i \<longrightarrow> (\<forall>y. x \<sqsubseteq> y \<longrightarrow> y \<in> F P \<longrightarrow> x \<in> F P)) \<and> | 
| 21 | (Fin i <= #x \<longrightarrow> (\<forall>y. x \<sqsubseteq> y \<longrightarrow> | |
| 19763 | 22 | (y \<in> F P) = (stream_take i\<cdot>y \<in> Q \<and> iterate i\<cdot>rt\<cdot>y \<in> P))))" | 
| 17293 | 23 | |
| 21404 
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
 wenzelm parents: 
19763diff
changeset | 24 | definition | 
| 
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
 wenzelm parents: 
19763diff
changeset | 25 | antitonP :: "'a set => bool" where | 
| 19763 | 26 | "antitonP P = (\<forall>x y. x \<sqsubseteq> y \<longrightarrow> y\<in>P \<longrightarrow> x\<in>P)" | 
| 17293 | 27 | |
| 28 | ||
| 19759 | 29 | (* ----------------------------------------------------------------------- *) | 
| 30 | ||
| 31 | section "admissibility" | |
| 32 | ||
| 33 | lemma flatstream_adm_lemma: | |
| 26451 
f8a615f3bb31
avoid amiguity of Continuity.chain vs. Porder.chain;
 wenzelm parents: 
26102diff
changeset | 34 | assumes 1: "Porder.chain Y" | 
| 19759 | 35 | assumes 2: "!i. P (Y i)" | 
| 26451 
f8a615f3bb31
avoid amiguity of Continuity.chain vs. Porder.chain;
 wenzelm parents: 
26102diff
changeset | 36 | assumes 3: "(!!Y. [| Porder.chain Y; !i. P (Y i); !k. ? j. Fin k < #((Y j)::'a::flat stream)|] | 
| 19759 | 37 | ==> P(lub (range Y)))" | 
| 38 | shows "P(lub (range Y))" | |
| 26838 
7f7c6a9e083a
Instantiated rule increasing_chain_adm_lemma in proof of flatstream_adm_lemma
 berghofe parents: 
26451diff
changeset | 39 | apply (rule increasing_chain_adm_lemma [of _ P, OF 1 2]) | 
| 19759 | 40 | apply (erule 3, assumption) | 
| 41 | apply (erule thin_rl) | |
| 42 | apply (rule allI) | |
| 43 | apply (case_tac "!j. stream_finite (Y j)") | |
| 44 | apply ( rule chain_incr) | |
| 45 | apply ( rule allI) | |
| 46 | apply ( drule spec) | |
| 47 | apply ( safe) | |
| 48 | apply ( rule exI) | |
| 49 | apply ( rule slen_strict_mono) | |
| 50 | apply ( erule spec) | |
| 51 | apply ( assumption) | |
| 52 | apply ( assumption) | |
| 53 | apply (drule not_ex [THEN iffD1]) | |
| 54 | apply (subst slen_infinite) | |
| 55 | apply (erule thin_rl) | |
| 56 | apply (drule spec) | |
| 26102 | 57 | apply (unfold linorder_not_less) | 
| 19759 | 58 | apply (erule ile_iless_trans [THEN Infty_eq [THEN iffD1]]) | 
| 59 | apply (simp) | |
| 60 | done | |
| 61 | ||
| 62 | ||
| 63 | (* should be without reference to stream length? *) | |
| 26451 
f8a615f3bb31
avoid amiguity of Continuity.chain vs. Porder.chain;
 wenzelm parents: 
26102diff
changeset | 64 | lemma flatstream_admI: "[|(!!Y. [| Porder.chain Y; !i. P (Y i); | 
| 19759 | 65 | !k. ? j. Fin k < #((Y j)::'a::flat stream)|] ==> P(lub (range Y)))|]==> adm P" | 
| 66 | apply (unfold adm_def) | |
| 67 | apply (intro strip) | |
| 68 | apply (erule (1) flatstream_adm_lemma) | |
| 69 | apply (fast) | |
| 70 | done | |
| 71 | ||
| 72 | ||
| 73 | (* context (theory "Nat_InFinity");*) | |
| 74 | lemma ile_lemma: "Fin (i + j) <= x ==> Fin i <= x" | |
| 75 | apply (rule ile_trans) | |
| 76 | prefer 2 | |
| 77 | apply (assumption) | |
| 78 | apply (simp) | |
| 79 | done | |
| 80 | ||
| 81 | lemma stream_monoP2I: | |
| 82 | "!!X. stream_monoP F ==> !i. ? l. !x y. | |
| 83 | Fin l <= #x --> (x::'a::flat stream) << y --> x:down_iterate F i --> y:down_iterate F i" | |
| 84 | apply (unfold stream_monoP_def) | |
| 85 | apply (safe) | |
| 86 | apply (rule_tac x="i*ia" in exI) | |
| 87 | apply (induct_tac "ia") | |
| 88 | apply ( simp) | |
| 89 | apply (simp) | |
| 90 | apply (intro strip) | |
| 91 | apply (erule allE, erule all_dupE, drule mp, erule ile_lemma) | |
| 92 | apply (drule_tac P="%x. x" in subst, assumption) | |
| 93 | apply (erule allE, drule mp, rule ile_lemma) back | |
| 94 | apply ( erule ile_trans) | |
| 95 | apply ( erule slen_mono) | |
| 96 | apply (erule ssubst) | |
| 97 | apply (safe) | |
| 98 | apply ( erule (2) ile_lemma [THEN slen_take_lemma3, THEN subst]) | |
| 99 | apply (erule allE) | |
| 100 | apply (drule mp) | |
| 101 | apply ( erule slen_rt_mult) | |
| 102 | apply (erule allE) | |
| 103 | apply (drule mp) | |
| 104 | apply (erule monofun_rt_mult) | |
| 105 | apply (drule (1) mp) | |
| 106 | apply (assumption) | |
| 107 | done | |
| 108 | ||
| 109 | lemma stream_monoP2_gfp_admI: "[| !i. ? l. !x y. | |
| 110 | Fin l <= #x --> (x::'a::flat stream) << y --> x:down_iterate F i --> y:down_iterate F i; | |
| 111 | down_cont F |] ==> adm (%x. x:gfp F)" | |
| 112 | apply (erule INTER_down_iterate_is_gfp [THEN ssubst]) (* cont *) | |
| 113 | apply (simp (no_asm)) | |
| 114 | apply (rule adm_lemmas) | |
| 115 | apply (rule flatstream_admI) | |
| 116 | apply (erule allE) | |
| 117 | apply (erule exE) | |
| 118 | apply (erule allE, erule exE) | |
| 119 | apply (erule allE, erule allE, drule mp) (* stream_monoP *) | |
| 120 | apply ( drule ileI1) | |
| 121 | apply ( drule ile_trans) | |
| 122 | apply ( rule ile_iSuc) | |
| 123 | apply ( drule iSuc_ile_mono [THEN iffD1]) | |
| 124 | apply ( assumption) | |
| 125 | apply (drule mp) | |
| 126 | apply ( erule is_ub_thelub) | |
| 127 | apply (fast) | |
| 128 | done | |
| 129 | ||
| 130 | lemmas fstream_gfp_admI = stream_monoP2I [THEN stream_monoP2_gfp_admI] | |
| 131 | ||
| 132 | lemma stream_antiP2I: | |
| 133 | "!!X. [|stream_antiP (F::(('a::flat stream)set => ('a stream set)))|]
 | |
| 134 | ==> !i x y. x << y --> y:down_iterate F i --> x:down_iterate F i" | |
| 135 | apply (unfold stream_antiP_def) | |
| 136 | apply (rule allI) | |
| 137 | apply (induct_tac "i") | |
| 138 | apply ( simp) | |
| 139 | apply (simp) | |
| 140 | apply (intro strip) | |
| 141 | apply (erule allE, erule all_dupE, erule exE, erule exE) | |
| 142 | apply (erule conjE) | |
| 143 | apply (case_tac "#x < Fin i") | |
| 144 | apply ( fast) | |
| 26102 | 145 | apply (unfold linorder_not_less) | 
| 19759 | 146 | apply (drule (1) mp) | 
| 147 | apply (erule all_dupE, drule mp, rule refl_less) | |
| 148 | apply (erule ssubst) | |
| 149 | apply (erule allE, drule (1) mp) | |
| 150 | apply (drule_tac P="%x. x" in subst, assumption) | |
| 151 | apply (erule conjE, rule conjI) | |
| 152 | apply ( erule slen_take_lemma3 [THEN ssubst], assumption) | |
| 153 | apply ( assumption) | |
| 154 | apply (erule allE, erule allE, drule mp, erule monofun_rt_mult) | |
| 155 | apply (drule (1) mp) | |
| 156 | apply (assumption) | |
| 157 | done | |
| 158 | ||
| 159 | lemma stream_antiP2_non_gfp_admI: | |
| 160 | "!!X. [|!i x y. x << y --> y:down_iterate F i --> x:down_iterate F i; down_cont F |] | |
| 161 | ==> adm (%u. ~ u:gfp F)" | |
| 162 | apply (unfold adm_def) | |
| 163 | apply (simp add: INTER_down_iterate_is_gfp) | |
| 164 | apply (fast dest!: is_ub_thelub) | |
| 165 | done | |
| 166 | ||
| 167 | lemmas fstream_non_gfp_admI = stream_antiP2I [THEN stream_antiP2_non_gfp_admI] | |
| 168 | ||
| 169 | ||
| 170 | ||
| 171 | (**new approach for adm********************************************************) | |
| 172 | ||
| 173 | section "antitonP" | |
| 174 | ||
| 175 | lemma antitonPD: "[| antitonP P; y:P; x<<y |] ==> x:P" | |
| 176 | apply (unfold antitonP_def) | |
| 177 | apply auto | |
| 178 | done | |
| 179 | ||
| 180 | lemma antitonPI: "!x y. y:P --> x<<y --> x:P ==> antitonP P" | |
| 181 | apply (unfold antitonP_def) | |
| 182 | apply (fast) | |
| 183 | done | |
| 184 | ||
| 185 | lemma antitonP_adm_non_P: "antitonP P ==> adm (%u. u~:P)" | |
| 186 | apply (unfold adm_def) | |
| 187 | apply (auto dest: antitonPD elim: is_ub_thelub) | |
| 188 | done | |
| 189 | ||
| 190 | lemma def_gfp_adm_nonP: "P \<equiv> gfp F \<Longrightarrow> {y. \<exists>x::'a::pcpo. y \<sqsubseteq> x \<and> x \<in> P} \<subseteq> F {y. \<exists>x. y \<sqsubseteq> x \<and> x \<in> P} \<Longrightarrow> 
 | |
| 191 | adm (\<lambda>u. u\<notin>P)" | |
| 192 | apply (simp) | |
| 193 | apply (rule antitonP_adm_non_P) | |
| 194 | apply (rule antitonPI) | |
| 195 | apply (drule gfp_upperbound) | |
| 196 | apply (fast) | |
| 197 | done | |
| 198 | ||
| 199 | lemma adm_set: | |
| 26451 
f8a615f3bb31
avoid amiguity of Continuity.chain vs. Porder.chain;
 wenzelm parents: 
26102diff
changeset | 200 | "{lub (range Y) |Y. Porder.chain Y & (\<forall>i. Y i \<in> P)} \<subseteq> P \<Longrightarrow> adm (\<lambda>x. x\<in>P)"
 | 
| 19759 | 201 | apply (unfold adm_def) | 
| 202 | apply (fast) | |
| 203 | done | |
| 204 | ||
| 26451 
f8a615f3bb31
avoid amiguity of Continuity.chain vs. Porder.chain;
 wenzelm parents: 
26102diff
changeset | 205 | lemma def_gfp_admI: "P \<equiv> gfp F \<Longrightarrow> {lub (range Y) |Y. Porder.chain Y \<and> (\<forall>i. Y i \<in> P)} \<subseteq> 
 | 
| 
f8a615f3bb31
avoid amiguity of Continuity.chain vs. Porder.chain;
 wenzelm parents: 
26102diff
changeset | 206 |   F {lub (range Y) |Y. Porder.chain Y \<and> (\<forall>i. Y i \<in> P)} \<Longrightarrow> adm (\<lambda>x. x\<in>P)"
 | 
| 19759 | 207 | apply (simp) | 
| 208 | apply (rule adm_set) | |
| 209 | apply (erule gfp_upperbound) | |
| 210 | done | |
| 211 | ||
| 11350 
4c55b020d6ee
added FOCUS including the One-Element Buffer by Manfred Broy
 oheimb parents: diff
changeset | 212 | end |