| author | wenzelm |
| Thu, 29 Dec 2011 19:37:24 +0100 | |
| changeset 46045 | 332cb37cfcee |
| parent 45970 | b6d0cff57d96 |
| child 46075 | 0054a9513b37 |
| permissions | -rw-r--r-- |
|
41141
ad923cdd4a5d
added example to exercise higher-order reasoning with Sledgehammer and Metis
blanchet
parents:
39260
diff
changeset
|
1 |
(* Title: HOL/Metis_Examples/Message.thy |
| 43197 | 2 |
Author: Lawrence C. Paulson, Cambridge University Computer Laboratory |
| 41144 | 3 |
Author: Jasmin Blanchette, TU Muenchen |
| 23449 | 4 |
|
| 43197 | 5 |
Metis example featuring message authentication. |
| 23449 | 6 |
*) |
7 |
||
| 43197 | 8 |
header {* Metis Example Featuring Message Authentication *}
|
9 |
||
| 36553 | 10 |
theory Message |
11 |
imports Main |
|
12 |
begin |
|
| 23449 | 13 |
|
|
42103
6066a35f6678
Metis examples use the new Skolemizer to test it
blanchet
parents:
41144
diff
changeset
|
14 |
declare [[metis_new_skolemizer]] |
|
6066a35f6678
Metis examples use the new Skolemizer to test it
blanchet
parents:
41144
diff
changeset
|
15 |
|
| 23449 | 16 |
lemma strange_Un_eq [simp]: "A \<union> (B \<union> A) = B \<union> A" |
| 36911 | 17 |
by (metis Un_commute Un_left_absorb) |
| 23449 | 18 |
|
| 42463 | 19 |
type_synonym key = nat |
| 23449 | 20 |
|
21 |
consts |
|
22 |
all_symmetric :: bool --{*true if all keys are symmetric*}
|
|
23 |
invKey :: "key=>key" --{*inverse of a symmetric key*}
|
|
24 |
||
25 |
specification (invKey) |
|
26 |
invKey [simp]: "invKey (invKey K) = K" |
|
27 |
invKey_symmetric: "all_symmetric --> invKey = id" |
|
| 36553 | 28 |
by (metis id_apply) |
| 23449 | 29 |
|
30 |
||
31 |
text{*The inverse of a symmetric key is itself; that of a public key
|
|
32 |
is the private key and vice versa*} |
|
33 |
||
|
35416
d8d7d1b785af
replaced a couple of constsdefs by definitions (also some old primrecs by modern ones)
haftmann
parents:
35109
diff
changeset
|
34 |
definition symKeys :: "key set" where |
| 23449 | 35 |
"symKeys == {K. invKey K = K}"
|
36 |
||
37 |
datatype --{*We allow any number of friendly agents*}
|
|
38 |
agent = Server | Friend nat | Spy |
|
39 |
||
40 |
datatype |
|
|
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32864
diff
changeset
|
41 |
msg = Agent agent --{*Agent names*}
|
| 23449 | 42 |
| Number nat --{*Ordinary integers, timestamps, ...*}
|
43 |
| Nonce nat --{*Unguessable nonces*}
|
|
44 |
| Key key --{*Crypto keys*}
|
|
|
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32864
diff
changeset
|
45 |
| Hash msg --{*Hashing*}
|
|
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32864
diff
changeset
|
46 |
| MPair msg msg --{*Compound messages*}
|
|
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32864
diff
changeset
|
47 |
| Crypt key msg --{*Encryption, public- or shared-key*}
|
| 23449 | 48 |
|
49 |
||
50 |
text{*Concrete syntax: messages appear as {|A,B,NA|}, etc...*}
|
|
51 |
syntax |
|
| 35109 | 52 |
"_MTuple" :: "['a, args] => 'a * 'b" ("(2{|_,/ _|})")
|
| 23449 | 53 |
|
54 |
syntax (xsymbols) |
|
| 35109 | 55 |
"_MTuple" :: "['a, args] => 'a * 'b" ("(2\<lbrace>_,/ _\<rbrace>)")
|
| 23449 | 56 |
|
57 |
translations |
|
58 |
"{|x, y, z|}" == "{|x, {|y, z|}|}"
|
|
| 35054 | 59 |
"{|x, y|}" == "CONST MPair x y"
|
| 23449 | 60 |
|
61 |
||
|
35416
d8d7d1b785af
replaced a couple of constsdefs by definitions (also some old primrecs by modern ones)
haftmann
parents:
35109
diff
changeset
|
62 |
definition HPair :: "[msg,msg] => msg" ("(4Hash[_] /_)" [0, 1000]) where
|
| 23449 | 63 |
--{*Message Y paired with a MAC computed with the help of X*}
|
64 |
"Hash[X] Y == {| Hash{|X,Y|}, Y|}"
|
|
65 |
||
|
35416
d8d7d1b785af
replaced a couple of constsdefs by definitions (also some old primrecs by modern ones)
haftmann
parents:
35109
diff
changeset
|
66 |
definition keysFor :: "msg set => key set" where |
| 23449 | 67 |
--{*Keys useful to decrypt elements of a message set*}
|
68 |
"keysFor H == invKey ` {K. \<exists>X. Crypt K X \<in> H}"
|
|
69 |
||
70 |
||
71 |
subsubsection{*Inductive Definition of All Parts" of a Message*}
|
|
72 |
||
| 23755 | 73 |
inductive_set |
74 |
parts :: "msg set => msg set" |
|
75 |
for H :: "msg set" |
|
76 |
where |
|
| 23449 | 77 |
Inj [intro]: "X \<in> H ==> X \<in> parts H" |
| 23755 | 78 |
| Fst: "{|X,Y|} \<in> parts H ==> X \<in> parts H"
|
79 |
| Snd: "{|X,Y|} \<in> parts H ==> Y \<in> parts H"
|
|
80 |
| Body: "Crypt K X \<in> parts H ==> X \<in> parts H" |
|
| 23449 | 81 |
|
82 |
lemma parts_mono: "G \<subseteq> H ==> parts(G) \<subseteq> parts(H)" |
|
83 |
apply auto |
|
| 36553 | 84 |
apply (erule parts.induct) |
85 |
apply (metis parts.Inj set_rev_mp) |
|
86 |
apply (metis parts.Fst) |
|
87 |
apply (metis parts.Snd) |
|
88 |
by (metis parts.Body) |
|
| 23449 | 89 |
|
90 |
text{*Equations hold because constructors are injective.*}
|
|
91 |
lemma Friend_image_eq [simp]: "(Friend x \<in> Friend`A) = (x:A)" |
|
| 39260 | 92 |
by (metis agent.inject image_iff) |
| 23449 | 93 |
|
| 36553 | 94 |
lemma Key_image_eq [simp]: "(Key x \<in> Key`A) = (x \<in> A)" |
95 |
by (metis image_iff msg.inject(4)) |
|
| 23449 | 96 |
|
| 36553 | 97 |
lemma Nonce_Key_image_eq [simp]: "Nonce x \<notin> Key`A" |
98 |
by (metis image_iff msg.distinct(23)) |
|
| 23449 | 99 |
|
100 |
||
101 |
subsubsection{*Inverse of keys *}
|
|
102 |
||
| 36553 | 103 |
lemma invKey_eq [simp]: "(invKey K = invKey K') = (K = K')" |
| 23449 | 104 |
by (metis invKey) |
105 |
||
106 |
||
107 |
subsection{*keysFor operator*}
|
|
108 |
||
109 |
lemma keysFor_empty [simp]: "keysFor {} = {}"
|
|
110 |
by (unfold keysFor_def, blast) |
|
111 |
||
112 |
lemma keysFor_Un [simp]: "keysFor (H \<union> H') = keysFor H \<union> keysFor H'" |
|
113 |
by (unfold keysFor_def, blast) |
|
114 |
||
115 |
lemma keysFor_UN [simp]: "keysFor (\<Union>i\<in>A. H i) = (\<Union>i\<in>A. keysFor (H i))" |
|
116 |
by (unfold keysFor_def, blast) |
|
117 |
||
118 |
text{*Monotonicity*}
|
|
119 |
lemma keysFor_mono: "G \<subseteq> H ==> keysFor(G) \<subseteq> keysFor(H)" |
|
120 |
by (unfold keysFor_def, blast) |
|
121 |
||
122 |
lemma keysFor_insert_Agent [simp]: "keysFor (insert (Agent A) H) = keysFor H" |
|
123 |
by (unfold keysFor_def, auto) |
|
124 |
||
125 |
lemma keysFor_insert_Nonce [simp]: "keysFor (insert (Nonce N) H) = keysFor H" |
|
126 |
by (unfold keysFor_def, auto) |
|
127 |
||
128 |
lemma keysFor_insert_Number [simp]: "keysFor (insert (Number N) H) = keysFor H" |
|
129 |
by (unfold keysFor_def, auto) |
|
130 |
||
131 |
lemma keysFor_insert_Key [simp]: "keysFor (insert (Key K) H) = keysFor H" |
|
132 |
by (unfold keysFor_def, auto) |
|
133 |
||
134 |
lemma keysFor_insert_Hash [simp]: "keysFor (insert (Hash X) H) = keysFor H" |
|
135 |
by (unfold keysFor_def, auto) |
|
136 |
||
137 |
lemma keysFor_insert_MPair [simp]: "keysFor (insert {|X,Y|} H) = keysFor H"
|
|
138 |
by (unfold keysFor_def, auto) |
|
139 |
||
| 43197 | 140 |
lemma keysFor_insert_Crypt [simp]: |
| 23449 | 141 |
"keysFor (insert (Crypt K X) H) = insert (invKey K) (keysFor H)" |
142 |
by (unfold keysFor_def, auto) |
|
143 |
||
144 |
lemma keysFor_image_Key [simp]: "keysFor (Key`E) = {}"
|
|
145 |
by (unfold keysFor_def, auto) |
|
146 |
||
147 |
lemma Crypt_imp_invKey_keysFor: "Crypt K X \<in> H ==> invKey K \<in> keysFor H" |
|
148 |
by (unfold keysFor_def, blast) |
|
149 |
||
150 |
||
151 |
subsection{*Inductive relation "parts"*}
|
|
152 |
||
153 |
lemma MPair_parts: |
|
| 43197 | 154 |
"[| {|X,Y|} \<in> parts H;
|
| 23449 | 155 |
[| X \<in> parts H; Y \<in> parts H |] ==> P |] ==> P" |
| 43197 | 156 |
by (blast dest: parts.Fst parts.Snd) |
| 23449 | 157 |
|
| 36553 | 158 |
declare MPair_parts [elim!] parts.Body [dest!] |
| 23449 | 159 |
text{*NB These two rules are UNSAFE in the formal sense, as they discard the
|
| 43197 | 160 |
compound message. They work well on THIS FILE. |
| 23449 | 161 |
@{text MPair_parts} is left as SAFE because it speeds up proofs.
|
162 |
The Crypt rule is normally kept UNSAFE to avoid breaking up certificates.*} |
|
163 |
||
164 |
lemma parts_increasing: "H \<subseteq> parts(H)" |
|
165 |
by blast |
|
166 |
||
| 45605 | 167 |
lemmas parts_insertI = subset_insertI [THEN parts_mono, THEN subsetD] |
| 23449 | 168 |
|
169 |
lemma parts_empty [simp]: "parts{} = {}"
|
|
170 |
apply safe |
|
171 |
apply (erule parts.induct) |
|
172 |
apply blast+ |
|
173 |
done |
|
174 |
||
175 |
lemma parts_emptyE [elim!]: "X\<in> parts{} ==> P"
|
|
176 |
by simp |
|
177 |
||
178 |
text{*WARNING: loops if H = {Y}, therefore must not be repeated!*}
|
|
179 |
lemma parts_singleton: "X\<in> parts H ==> \<exists>Y\<in>H. X\<in> parts {Y}"
|
|
180 |
apply (erule parts.induct) |
|
|
26807
4cd176ea28dc
Replaced blast by fast in proof of parts_singleton, since blast looped
berghofe
parents:
25710
diff
changeset
|
181 |
apply fast+ |
| 23449 | 182 |
done |
183 |
||
184 |
||
185 |
subsubsection{*Unions *}
|
|
186 |
||
187 |
lemma parts_Un_subset1: "parts(G) \<union> parts(H) \<subseteq> parts(G \<union> H)" |
|
188 |
by (intro Un_least parts_mono Un_upper1 Un_upper2) |
|
189 |
||
190 |
lemma parts_Un_subset2: "parts(G \<union> H) \<subseteq> parts(G) \<union> parts(H)" |
|
191 |
apply (rule subsetI) |
|
192 |
apply (erule parts.induct, blast+) |
|
193 |
done |
|
194 |
||
195 |
lemma parts_Un [simp]: "parts(G \<union> H) = parts(G) \<union> parts(H)" |
|
196 |
by (intro equalityI parts_Un_subset1 parts_Un_subset2) |
|
197 |
||
198 |
lemma parts_insert: "parts (insert X H) = parts {X} \<union> parts H"
|
|
199 |
apply (subst insert_is_Un [of _ H]) |
|
200 |
apply (simp only: parts_Un) |
|
201 |
done |
|
202 |
||
203 |
lemma parts_insert2: |
|
204 |
"parts (insert X (insert Y H)) = parts {X} \<union> parts {Y} \<union> parts H"
|
|
|
25710
4cdf7de81e1b
Replaced refs by config params; finer critical section in mets method
paulson
parents:
25457
diff
changeset
|
205 |
by (metis Un_commute Un_empty_left Un_empty_right Un_insert_left Un_insert_right parts_Un) |
| 23449 | 206 |
|
207 |
||
208 |
lemma parts_UN_subset1: "(\<Union>x\<in>A. parts(H x)) \<subseteq> parts(\<Union>x\<in>A. H x)" |
|
209 |
by (intro UN_least parts_mono UN_upper) |
|
210 |
||
211 |
lemma parts_UN_subset2: "parts(\<Union>x\<in>A. H x) \<subseteq> (\<Union>x\<in>A. parts(H x))" |
|
212 |
apply (rule subsetI) |
|
213 |
apply (erule parts.induct, blast+) |
|
214 |
done |
|
215 |
||
216 |
lemma parts_UN [simp]: "parts(\<Union>x\<in>A. H x) = (\<Union>x\<in>A. parts(H x))" |
|
217 |
by (intro equalityI parts_UN_subset1 parts_UN_subset2) |
|
218 |
||
219 |
text{*Added to simplify arguments to parts, analz and synth.
|
|
220 |
NOTE: the UN versions are no longer used!*} |
|
221 |
||
222 |
||
| 43197 | 223 |
text{*This allows @{text blast} to simplify occurrences of
|
| 23449 | 224 |
@{term "parts(G\<union>H)"} in the assumption.*}
|
| 43197 | 225 |
lemmas in_parts_UnE = parts_Un [THEN equalityD1, THEN subsetD, THEN UnE] |
| 23449 | 226 |
declare in_parts_UnE [elim!] |
227 |
||
228 |
lemma parts_insert_subset: "insert X (parts H) \<subseteq> parts(insert X H)" |
|
229 |
by (blast intro: parts_mono [THEN [2] rev_subsetD]) |
|
230 |
||
231 |
subsubsection{*Idempotence and transitivity *}
|
|
232 |
||
233 |
lemma parts_partsD [dest!]: "X\<in> parts (parts H) ==> X\<in> parts H" |
|
234 |
by (erule parts.induct, blast+) |
|
235 |
||
236 |
lemma parts_idem [simp]: "parts (parts H) = parts H" |
|
237 |
by blast |
|
238 |
||
239 |
lemma parts_subset_iff [simp]: "(parts G \<subseteq> parts H) = (G \<subseteq> parts H)" |
|
| 43197 | 240 |
apply (rule iffI) |
| 23449 | 241 |
apply (metis Un_absorb1 Un_subset_iff parts_Un parts_increasing) |
|
25710
4cdf7de81e1b
Replaced refs by config params; finer critical section in mets method
paulson
parents:
25457
diff
changeset
|
242 |
apply (metis parts_idem parts_mono) |
| 23449 | 243 |
done |
244 |
||
245 |
lemma parts_trans: "[| X\<in> parts G; G \<subseteq> parts H |] ==> X\<in> parts H" |
|
| 45503 | 246 |
by (blast dest: parts_mono) |
| 23449 | 247 |
|
|
45970
b6d0cff57d96
adjusted to set/pred distinction by means of type constructor `set`
haftmann
parents:
45605
diff
changeset
|
248 |
(*lemma parts_cut: "[|Y\<in> parts (insert X G); X\<in> parts H|] ==> Y\<in> parts(G \<union> H)" |
|
b6d0cff57d96
adjusted to set/pred distinction by means of type constructor `set`
haftmann
parents:
45605
diff
changeset
|
249 |
by (metis UnI2 insert_subset le_supE parts_Un_subset1 parts_increasing parts_trans subsetD) |
|
b6d0cff57d96
adjusted to set/pred distinction by means of type constructor `set`
haftmann
parents:
45605
diff
changeset
|
250 |
by (metis Un_insert_left Un_insert_right insert_absorb parts_Un parts_idem sup1CI)*) |
| 23449 | 251 |
|
252 |
||
253 |
subsubsection{*Rewrite rules for pulling out atomic messages *}
|
|
254 |
||
255 |
lemmas parts_insert_eq_I = equalityI [OF subsetI parts_insert_subset] |
|
256 |
||
257 |
||
258 |
lemma parts_insert_Agent [simp]: |
|
259 |
"parts (insert (Agent agt) H) = insert (Agent agt) (parts H)" |
|
| 43197 | 260 |
apply (rule parts_insert_eq_I) |
261 |
apply (erule parts.induct, auto) |
|
| 23449 | 262 |
done |
263 |
||
264 |
lemma parts_insert_Nonce [simp]: |
|
265 |
"parts (insert (Nonce N) H) = insert (Nonce N) (parts H)" |
|
| 43197 | 266 |
apply (rule parts_insert_eq_I) |
267 |
apply (erule parts.induct, auto) |
|
| 23449 | 268 |
done |
269 |
||
270 |
lemma parts_insert_Number [simp]: |
|
271 |
"parts (insert (Number N) H) = insert (Number N) (parts H)" |
|
| 43197 | 272 |
apply (rule parts_insert_eq_I) |
273 |
apply (erule parts.induct, auto) |
|
| 23449 | 274 |
done |
275 |
||
276 |
lemma parts_insert_Key [simp]: |
|
277 |
"parts (insert (Key K) H) = insert (Key K) (parts H)" |
|
| 43197 | 278 |
apply (rule parts_insert_eq_I) |
279 |
apply (erule parts.induct, auto) |
|
| 23449 | 280 |
done |
281 |
||
282 |
lemma parts_insert_Hash [simp]: |
|
283 |
"parts (insert (Hash X) H) = insert (Hash X) (parts H)" |
|
| 43197 | 284 |
apply (rule parts_insert_eq_I) |
285 |
apply (erule parts.induct, auto) |
|
| 23449 | 286 |
done |
287 |
||
288 |
lemma parts_insert_Crypt [simp]: |
|
| 43197 | 289 |
"parts (insert (Crypt K X) H) = |
| 23449 | 290 |
insert (Crypt K X) (parts (insert X H))" |
291 |
apply (rule equalityI) |
|
292 |
apply (rule subsetI) |
|
293 |
apply (erule parts.induct, auto) |
|
294 |
apply (blast intro: parts.Body) |
|
295 |
done |
|
296 |
||
297 |
lemma parts_insert_MPair [simp]: |
|
| 43197 | 298 |
"parts (insert {|X,Y|} H) =
|
| 23449 | 299 |
insert {|X,Y|} (parts (insert X (insert Y H)))"
|
300 |
apply (rule equalityI) |
|
301 |
apply (rule subsetI) |
|
302 |
apply (erule parts.induct, auto) |
|
303 |
apply (blast intro: parts.Fst parts.Snd)+ |
|
304 |
done |
|
305 |
||
306 |
lemma parts_image_Key [simp]: "parts (Key`N) = Key`N" |
|
307 |
apply auto |
|
308 |
apply (erule parts.induct, auto) |
|
309 |
done |
|
310 |
||
311 |
lemma msg_Nonce_supply: "\<exists>N. \<forall>n. N\<le>n --> Nonce n \<notin> parts {msg}"
|
|
| 43197 | 312 |
apply (induct_tac "msg") |
| 23449 | 313 |
apply (simp_all add: parts_insert2) |
314 |
apply (metis Suc_n_not_le_n) |
|
315 |
apply (metis le_trans linorder_linear) |
|
316 |
done |
|
317 |
||
318 |
subsection{*Inductive relation "analz"*}
|
|
319 |
||
320 |
text{*Inductive definition of "analz" -- what can be broken down from a set of
|
|
321 |
messages, including keys. A form of downward closure. Pairs can |
|
322 |
be taken apart; messages decrypted with known keys. *} |
|
323 |
||
| 23755 | 324 |
inductive_set |
325 |
analz :: "msg set => msg set" |
|
326 |
for H :: "msg set" |
|
327 |
where |
|
| 23449 | 328 |
Inj [intro,simp] : "X \<in> H ==> X \<in> analz H" |
| 23755 | 329 |
| Fst: "{|X,Y|} \<in> analz H ==> X \<in> analz H"
|
330 |
| Snd: "{|X,Y|} \<in> analz H ==> Y \<in> analz H"
|
|
| 43197 | 331 |
| Decrypt [dest]: |
| 23449 | 332 |
"[|Crypt K X \<in> analz H; Key(invKey K): analz H|] ==> X \<in> analz H" |
333 |
||
334 |
||
335 |
text{*Monotonicity; Lemma 1 of Lowe's paper*}
|
|
336 |
lemma analz_mono: "G\<subseteq>H ==> analz(G) \<subseteq> analz(H)" |
|
337 |
apply auto |
|
| 43197 | 338 |
apply (erule analz.induct) |
339 |
apply (auto dest: analz.Fst analz.Snd) |
|
| 23449 | 340 |
done |
341 |
||
342 |
text{*Making it safe speeds up proofs*}
|
|
343 |
lemma MPair_analz [elim!]: |
|
| 43197 | 344 |
"[| {|X,Y|} \<in> analz H;
|
345 |
[| X \<in> analz H; Y \<in> analz H |] ==> P |
|
| 23449 | 346 |
|] ==> P" |
347 |
by (blast dest: analz.Fst analz.Snd) |
|
348 |
||
349 |
lemma analz_increasing: "H \<subseteq> analz(H)" |
|
350 |
by blast |
|
351 |
||
352 |
lemma analz_subset_parts: "analz H \<subseteq> parts H" |
|
353 |
apply (rule subsetI) |
|
354 |
apply (erule analz.induct, blast+) |
|
355 |
done |
|
356 |
||
| 45605 | 357 |
lemmas analz_into_parts = analz_subset_parts [THEN subsetD] |
| 23449 | 358 |
|
| 45605 | 359 |
lemmas not_parts_not_analz = analz_subset_parts [THEN contra_subsetD] |
| 23449 | 360 |
|
361 |
lemma parts_analz [simp]: "parts (analz H) = parts H" |
|
362 |
apply (rule equalityI) |
|
363 |
apply (metis analz_subset_parts parts_subset_iff) |
|
364 |
apply (metis analz_increasing parts_mono) |
|
365 |
done |
|
366 |
||
367 |
||
368 |
lemma analz_parts [simp]: "analz (parts H) = parts H" |
|
369 |
apply auto |
|
370 |
apply (erule analz.induct, auto) |
|
371 |
done |
|
372 |
||
| 45605 | 373 |
lemmas analz_insertI = subset_insertI [THEN analz_mono, THEN [2] rev_subsetD] |
| 23449 | 374 |
|
375 |
subsubsection{*General equational properties *}
|
|
376 |
||
377 |
lemma analz_empty [simp]: "analz{} = {}"
|
|
378 |
apply safe |
|
379 |
apply (erule analz.induct, blast+) |
|
380 |
done |
|
381 |
||
| 43197 | 382 |
text{*Converse fails: we can analz more from the union than from the
|
| 23449 | 383 |
separate parts, as a key in one might decrypt a message in the other*} |
384 |
lemma analz_Un: "analz(G) \<union> analz(H) \<subseteq> analz(G \<union> H)" |
|
385 |
by (intro Un_least analz_mono Un_upper1 Un_upper2) |
|
386 |
||
387 |
lemma analz_insert: "insert X (analz H) \<subseteq> analz(insert X H)" |
|
388 |
by (blast intro: analz_mono [THEN [2] rev_subsetD]) |
|
389 |
||
390 |
subsubsection{*Rewrite rules for pulling out atomic messages *}
|
|
391 |
||
392 |
lemmas analz_insert_eq_I = equalityI [OF subsetI analz_insert] |
|
393 |
||
394 |
lemma analz_insert_Agent [simp]: |
|
395 |
"analz (insert (Agent agt) H) = insert (Agent agt) (analz H)" |
|
| 43197 | 396 |
apply (rule analz_insert_eq_I) |
397 |
apply (erule analz.induct, auto) |
|
| 23449 | 398 |
done |
399 |
||
400 |
lemma analz_insert_Nonce [simp]: |
|
401 |
"analz (insert (Nonce N) H) = insert (Nonce N) (analz H)" |
|
| 43197 | 402 |
apply (rule analz_insert_eq_I) |
403 |
apply (erule analz.induct, auto) |
|
| 23449 | 404 |
done |
405 |
||
406 |
lemma analz_insert_Number [simp]: |
|
407 |
"analz (insert (Number N) H) = insert (Number N) (analz H)" |
|
| 43197 | 408 |
apply (rule analz_insert_eq_I) |
409 |
apply (erule analz.induct, auto) |
|
| 23449 | 410 |
done |
411 |
||
412 |
lemma analz_insert_Hash [simp]: |
|
413 |
"analz (insert (Hash X) H) = insert (Hash X) (analz H)" |
|
| 43197 | 414 |
apply (rule analz_insert_eq_I) |
415 |
apply (erule analz.induct, auto) |
|
| 23449 | 416 |
done |
417 |
||
418 |
text{*Can only pull out Keys if they are not needed to decrypt the rest*}
|
|
| 43197 | 419 |
lemma analz_insert_Key [simp]: |
420 |
"K \<notin> keysFor (analz H) ==> |
|
| 23449 | 421 |
analz (insert (Key K) H) = insert (Key K) (analz H)" |
422 |
apply (unfold keysFor_def) |
|
| 43197 | 423 |
apply (rule analz_insert_eq_I) |
424 |
apply (erule analz.induct, auto) |
|
| 23449 | 425 |
done |
426 |
||
427 |
lemma analz_insert_MPair [simp]: |
|
| 43197 | 428 |
"analz (insert {|X,Y|} H) =
|
| 23449 | 429 |
insert {|X,Y|} (analz (insert X (insert Y H)))"
|
430 |
apply (rule equalityI) |
|
431 |
apply (rule subsetI) |
|
432 |
apply (erule analz.induct, auto) |
|
433 |
apply (erule analz.induct) |
|
434 |
apply (blast intro: analz.Fst analz.Snd)+ |
|
435 |
done |
|
436 |
||
437 |
text{*Can pull out enCrypted message if the Key is not known*}
|
|
438 |
lemma analz_insert_Crypt: |
|
| 43197 | 439 |
"Key (invKey K) \<notin> analz H |
| 23449 | 440 |
==> analz (insert (Crypt K X) H) = insert (Crypt K X) (analz H)" |
| 43197 | 441 |
apply (rule analz_insert_eq_I) |
442 |
apply (erule analz.induct, auto) |
|
| 23449 | 443 |
|
444 |
done |
|
445 |
||
| 43197 | 446 |
lemma lemma1: "Key (invKey K) \<in> analz H ==> |
447 |
analz (insert (Crypt K X) H) \<subseteq> |
|
448 |
insert (Crypt K X) (analz (insert X H))" |
|
| 23449 | 449 |
apply (rule subsetI) |
| 23755 | 450 |
apply (erule_tac x = x in analz.induct, auto) |
| 23449 | 451 |
done |
452 |
||
| 43197 | 453 |
lemma lemma2: "Key (invKey K) \<in> analz H ==> |
454 |
insert (Crypt K X) (analz (insert X H)) \<subseteq> |
|
| 23449 | 455 |
analz (insert (Crypt K X) H)" |
456 |
apply auto |
|
| 23755 | 457 |
apply (erule_tac x = x in analz.induct, auto) |
| 23449 | 458 |
apply (blast intro: analz_insertI analz.Decrypt) |
459 |
done |
|
460 |
||
461 |
lemma analz_insert_Decrypt: |
|
| 43197 | 462 |
"Key (invKey K) \<in> analz H ==> |
463 |
analz (insert (Crypt K X) H) = |
|
| 23449 | 464 |
insert (Crypt K X) (analz (insert X H))" |
465 |
by (intro equalityI lemma1 lemma2) |
|
466 |
||
467 |
text{*Case analysis: either the message is secure, or it is not! Effective,
|
|
468 |
but can cause subgoals to blow up! Use with @{text "split_if"}; apparently
|
|
469 |
@{text "split_tac"} does not cope with patterns such as @{term"analz (insert
|
|
| 43197 | 470 |
(Crypt K X) H)"} *} |
| 23449 | 471 |
lemma analz_Crypt_if [simp]: |
| 43197 | 472 |
"analz (insert (Crypt K X) H) = |
473 |
(if (Key (invKey K) \<in> analz H) |
|
474 |
then insert (Crypt K X) (analz (insert X H)) |
|
| 23449 | 475 |
else insert (Crypt K X) (analz H))" |
476 |
by (simp add: analz_insert_Crypt analz_insert_Decrypt) |
|
477 |
||
478 |
||
479 |
text{*This rule supposes "for the sake of argument" that we have the key.*}
|
|
480 |
lemma analz_insert_Crypt_subset: |
|
| 43197 | 481 |
"analz (insert (Crypt K X) H) \<subseteq> |
| 23449 | 482 |
insert (Crypt K X) (analz (insert X H))" |
483 |
apply (rule subsetI) |
|
484 |
apply (erule analz.induct, auto) |
|
485 |
done |
|
486 |
||
487 |
||
488 |
lemma analz_image_Key [simp]: "analz (Key`N) = Key`N" |
|
489 |
apply auto |
|
490 |
apply (erule analz.induct, auto) |
|
491 |
done |
|
492 |
||
493 |
||
494 |
subsubsection{*Idempotence and transitivity *}
|
|
495 |
||
496 |
lemma analz_analzD [dest!]: "X\<in> analz (analz H) ==> X\<in> analz H" |
|
497 |
by (erule analz.induct, blast+) |
|
498 |
||
499 |
lemma analz_idem [simp]: "analz (analz H) = analz H" |
|
500 |
by blast |
|
501 |
||
502 |
lemma analz_subset_iff [simp]: "(analz G \<subseteq> analz H) = (G \<subseteq> analz H)" |
|
503 |
apply (rule iffI) |
|
| 43197 | 504 |
apply (iprover intro: subset_trans analz_increasing) |
505 |
apply (frule analz_mono, simp) |
|
| 23449 | 506 |
done |
507 |
||
508 |
lemma analz_trans: "[| X\<in> analz G; G \<subseteq> analz H |] ==> X\<in> analz H" |
|
509 |
by (drule analz_mono, blast) |
|
510 |
||
511 |
||
| 36553 | 512 |
declare analz_trans[intro] |
513 |
||
| 23449 | 514 |
lemma analz_cut: "[| Y\<in> analz (insert X H); X\<in> analz H |] ==> Y\<in> analz H" |
515 |
(*TOO SLOW |
|
516 |
by (metis analz_idem analz_increasing analz_mono insert_absorb insert_mono insert_subset) --{*317s*}
|
|
517 |
??*) |
|
518 |
by (erule analz_trans, blast) |
|
519 |
||
520 |
||
521 |
text{*This rewrite rule helps in the simplification of messages that involve
|
|
522 |
the forwarding of unknown components (X). Without it, removing occurrences |
|
523 |
of X can be very complicated. *} |
|
524 |
lemma analz_insert_eq: "X\<in> analz H ==> analz (insert X H) = analz H" |
|
525 |
by (blast intro: analz_cut analz_insertI) |
|
526 |
||
527 |
||
528 |
text{*A congruence rule for "analz" *}
|
|
529 |
||
530 |
lemma analz_subset_cong: |
|
| 43197 | 531 |
"[| analz G \<subseteq> analz G'; analz H \<subseteq> analz H' |] |
| 23449 | 532 |
==> analz (G \<union> H) \<subseteq> analz (G' \<union> H')" |
533 |
apply simp |
|
534 |
apply (metis Un_absorb2 Un_commute Un_subset_iff Un_upper1 Un_upper2 analz_mono) |
|
535 |
done |
|
536 |
||
537 |
||
538 |
lemma analz_cong: |
|
| 43197 | 539 |
"[| analz G = analz G'; analz H = analz H' |
| 23449 | 540 |
|] ==> analz (G \<union> H) = analz (G' \<union> H')" |
| 43197 | 541 |
by (intro equalityI analz_subset_cong, simp_all) |
| 23449 | 542 |
|
543 |
lemma analz_insert_cong: |
|
544 |
"analz H = analz H' ==> analz(insert X H) = analz(insert X H')" |
|
545 |
by (force simp only: insert_def intro!: analz_cong) |
|
546 |
||
547 |
text{*If there are no pairs or encryptions then analz does nothing*}
|
|
548 |
lemma analz_trivial: |
|
549 |
"[| \<forall>X Y. {|X,Y|} \<notin> H; \<forall>X K. Crypt K X \<notin> H |] ==> analz H = H"
|
|
550 |
apply safe |
|
551 |
apply (erule analz.induct, blast+) |
|
552 |
done |
|
553 |
||
554 |
text{*These two are obsolete (with a single Spy) but cost little to prove...*}
|
|
555 |
lemma analz_UN_analz_lemma: |
|
556 |
"X\<in> analz (\<Union>i\<in>A. analz (H i)) ==> X\<in> analz (\<Union>i\<in>A. H i)" |
|
557 |
apply (erule analz.induct) |
|
558 |
apply (blast intro: analz_mono [THEN [2] rev_subsetD])+ |
|
559 |
done |
|
560 |
||
561 |
lemma analz_UN_analz [simp]: "analz (\<Union>i\<in>A. analz (H i)) = analz (\<Union>i\<in>A. H i)" |
|
562 |
by (blast intro: analz_UN_analz_lemma analz_mono [THEN [2] rev_subsetD]) |
|
563 |
||
564 |
||
565 |
subsection{*Inductive relation "synth"*}
|
|
566 |
||
567 |
text{*Inductive definition of "synth" -- what can be built up from a set of
|
|
568 |
messages. A form of upward closure. Pairs can be built, messages |
|
569 |
encrypted with known keys. Agent names are public domain. |
|
570 |
Numbers can be guessed, but Nonces cannot be. *} |
|
571 |
||
| 23755 | 572 |
inductive_set |
573 |
synth :: "msg set => msg set" |
|
574 |
for H :: "msg set" |
|
575 |
where |
|
| 23449 | 576 |
Inj [intro]: "X \<in> H ==> X \<in> synth H" |
| 23755 | 577 |
| Agent [intro]: "Agent agt \<in> synth H" |
578 |
| Number [intro]: "Number n \<in> synth H" |
|
579 |
| Hash [intro]: "X \<in> synth H ==> Hash X \<in> synth H" |
|
580 |
| MPair [intro]: "[|X \<in> synth H; Y \<in> synth H|] ==> {|X,Y|} \<in> synth H"
|
|
581 |
| Crypt [intro]: "[|X \<in> synth H; Key(K) \<in> H|] ==> Crypt K X \<in> synth H" |
|
| 23449 | 582 |
|
583 |
text{*Monotonicity*}
|
|
584 |
lemma synth_mono: "G\<subseteq>H ==> synth(G) \<subseteq> synth(H)" |
|
| 43197 | 585 |
by (auto, erule synth.induct, auto) |
| 23449 | 586 |
|
| 43197 | 587 |
text{*NO @{text Agent_synth}, as any Agent name can be synthesized.
|
| 23449 | 588 |
The same holds for @{term Number}*}
|
589 |
inductive_cases Nonce_synth [elim!]: "Nonce n \<in> synth H" |
|
590 |
inductive_cases Key_synth [elim!]: "Key K \<in> synth H" |
|
591 |
inductive_cases Hash_synth [elim!]: "Hash X \<in> synth H" |
|
592 |
inductive_cases MPair_synth [elim!]: "{|X,Y|} \<in> synth H"
|
|
593 |
inductive_cases Crypt_synth [elim!]: "Crypt K X \<in> synth H" |
|
594 |
||
595 |
||
596 |
lemma synth_increasing: "H \<subseteq> synth(H)" |
|
597 |
by blast |
|
598 |
||
599 |
subsubsection{*Unions *}
|
|
600 |
||
| 43197 | 601 |
text{*Converse fails: we can synth more from the union than from the
|
| 23449 | 602 |
separate parts, building a compound message using elements of each.*} |
603 |
lemma synth_Un: "synth(G) \<union> synth(H) \<subseteq> synth(G \<union> H)" |
|
604 |
by (intro Un_least synth_mono Un_upper1 Un_upper2) |
|
605 |
||
606 |
lemma synth_insert: "insert X (synth H) \<subseteq> synth(insert X H)" |
|
607 |
by (metis insert_iff insert_subset subset_insertI synth.Inj synth_mono) |
|
608 |
||
609 |
subsubsection{*Idempotence and transitivity *}
|
|
610 |
||
611 |
lemma synth_synthD [dest!]: "X\<in> synth (synth H) ==> X\<in> synth H" |
|
612 |
by (erule synth.induct, blast+) |
|
613 |
||
614 |
lemma synth_idem: "synth (synth H) = synth H" |
|
615 |
by blast |
|
616 |
||
617 |
lemma synth_subset_iff [simp]: "(synth G \<subseteq> synth H) = (G \<subseteq> synth H)" |
|
618 |
apply (rule iffI) |
|
| 43197 | 619 |
apply (iprover intro: subset_trans synth_increasing) |
620 |
apply (frule synth_mono, simp add: synth_idem) |
|
| 23449 | 621 |
done |
622 |
||
623 |
lemma synth_trans: "[| X\<in> synth G; G \<subseteq> synth H |] ==> X\<in> synth H" |
|
624 |
by (drule synth_mono, blast) |
|
625 |
||
626 |
lemma synth_cut: "[| Y\<in> synth (insert X H); X\<in> synth H |] ==> Y\<in> synth H" |
|
627 |
(*TOO SLOW |
|
628 |
by (metis insert_absorb insert_mono insert_subset synth_idem synth_increasing synth_mono) |
|
629 |
*) |
|
630 |
by (erule synth_trans, blast) |
|
631 |
||
632 |
||
633 |
lemma Agent_synth [simp]: "Agent A \<in> synth H" |
|
634 |
by blast |
|
635 |
||
636 |
lemma Number_synth [simp]: "Number n \<in> synth H" |
|
637 |
by blast |
|
638 |
||
639 |
lemma Nonce_synth_eq [simp]: "(Nonce N \<in> synth H) = (Nonce N \<in> H)" |
|
640 |
by blast |
|
641 |
||
642 |
lemma Key_synth_eq [simp]: "(Key K \<in> synth H) = (Key K \<in> H)" |
|
643 |
by blast |
|
644 |
||
645 |
lemma Crypt_synth_eq [simp]: |
|
646 |
"Key K \<notin> H ==> (Crypt K X \<in> synth H) = (Crypt K X \<in> H)" |
|
647 |
by blast |
|
648 |
||
649 |
||
| 43197 | 650 |
lemma keysFor_synth [simp]: |
| 23449 | 651 |
"keysFor (synth H) = keysFor H \<union> invKey`{K. Key K \<in> H}"
|
652 |
by (unfold keysFor_def, blast) |
|
653 |
||
654 |
||
655 |
subsubsection{*Combinations of parts, analz and synth *}
|
|
656 |
||
657 |
lemma parts_synth [simp]: "parts (synth H) = parts H \<union> synth H" |
|
658 |
apply (rule equalityI) |
|
659 |
apply (rule subsetI) |
|
660 |
apply (erule parts.induct) |
|
661 |
apply (metis UnCI) |
|
662 |
apply (metis MPair_synth UnCI UnE insert_absorb insert_subset parts.Fst parts_increasing) |
|
663 |
apply (metis MPair_synth UnCI UnE insert_absorb insert_subset parts.Snd parts_increasing) |
|
664 |
apply (metis Body Crypt_synth UnCI UnE insert_absorb insert_subset parts_increasing) |
|
665 |
apply (metis Un_subset_iff parts_increasing parts_mono synth_increasing) |
|
666 |
done |
|
667 |
||
668 |
lemma analz_analz_Un [simp]: "analz (analz G \<union> H) = analz (G \<union> H)" |
|
| 45503 | 669 |
apply (rule equalityI) |
| 23449 | 670 |
apply (metis analz_idem analz_subset_cong order_eq_refl) |
671 |
apply (metis analz_increasing analz_subset_cong order_eq_refl) |
|
672 |
done |
|
673 |
||
| 36553 | 674 |
declare analz_mono [intro] analz.Fst [intro] analz.Snd [intro] Un_least [intro] |
675 |
||
| 23449 | 676 |
lemma analz_synth_Un [simp]: "analz (synth G \<union> H) = analz (G \<union> H) \<union> synth G" |
677 |
apply (rule equalityI) |
|
678 |
apply (rule subsetI) |
|
679 |
apply (erule analz.induct) |
|
680 |
apply (metis UnCI UnE Un_commute analz.Inj) |
|
|
45970
b6d0cff57d96
adjusted to set/pred distinction by means of type constructor `set`
haftmann
parents:
45605
diff
changeset
|
681 |
apply (metis MPair_synth UnCI UnE Un_commute analz.Fst analz.Inj) |
|
b6d0cff57d96
adjusted to set/pred distinction by means of type constructor `set`
haftmann
parents:
45605
diff
changeset
|
682 |
apply (metis MPair_synth UnCI UnE Un_commute analz.Inj analz.Snd) |
| 23449 | 683 |
apply (blast intro: analz.Decrypt) |
| 24759 | 684 |
apply blast |
| 23449 | 685 |
done |
686 |
||
687 |
lemma analz_synth [simp]: "analz (synth H) = analz H \<union> synth H" |
|
| 36553 | 688 |
proof - |
| 36911 | 689 |
have "\<forall>x\<^isub>2 x\<^isub>1. synth x\<^isub>1 \<union> analz (x\<^isub>1 \<union> x\<^isub>2) = analz (synth x\<^isub>1 \<union> x\<^isub>2)" by (metis Un_commute analz_synth_Un) |
690 |
hence "\<forall>x\<^isub>1. synth x\<^isub>1 \<union> analz x\<^isub>1 = analz (synth x\<^isub>1 \<union> {})" by (metis Un_empty_right)
|
|
691 |
hence "\<forall>x\<^isub>1. synth x\<^isub>1 \<union> analz x\<^isub>1 = analz (synth x\<^isub>1)" by (metis Un_empty_right) |
|
692 |
hence "\<forall>x\<^isub>1. analz x\<^isub>1 \<union> synth x\<^isub>1 = analz (synth x\<^isub>1)" by (metis Un_commute) |
|
| 36553 | 693 |
thus "analz (synth H) = analz H \<union> synth H" by metis |
| 23449 | 694 |
qed |
695 |
||
696 |
||
697 |
subsubsection{*For reasoning about the Fake rule in traces *}
|
|
698 |
||
|
45970
b6d0cff57d96
adjusted to set/pred distinction by means of type constructor `set`
haftmann
parents:
45605
diff
changeset
|
699 |
lemma parts_insert_subset_Un: "X \<in> G ==> parts(insert X H) \<subseteq> parts G \<union> parts H" |
| 36553 | 700 |
proof - |
701 |
assume "X \<in> G" |
|
|
45970
b6d0cff57d96
adjusted to set/pred distinction by means of type constructor `set`
haftmann
parents:
45605
diff
changeset
|
702 |
hence "\<forall>x\<^isub>1. G \<subseteq> x\<^isub>1 \<longrightarrow> X \<in> x\<^isub>1 " by auto |
|
b6d0cff57d96
adjusted to set/pred distinction by means of type constructor `set`
haftmann
parents:
45605
diff
changeset
|
703 |
hence "\<forall>x\<^isub>1. X \<in> G \<union> x\<^isub>1" by (metis Un_upper1) |
| 36911 | 704 |
hence "insert X H \<subseteq> G \<union> H" by (metis Un_upper2 insert_subset) |
705 |
hence "parts (insert X H) \<subseteq> parts (G \<union> H)" by (metis parts_mono) |
|
706 |
thus "parts (insert X H) \<subseteq> parts G \<union> parts H" by (metis parts_Un) |
|
| 23449 | 707 |
qed |
708 |
||
709 |
lemma Fake_parts_insert: |
|
| 43197 | 710 |
"X \<in> synth (analz H) ==> |
| 23449 | 711 |
parts (insert X H) \<subseteq> synth (analz H) \<union> parts H" |
| 36553 | 712 |
proof - |
713 |
assume A1: "X \<in> synth (analz H)" |
|
714 |
have F1: "\<forall>x\<^isub>1. analz x\<^isub>1 \<union> synth (analz x\<^isub>1) = analz (synth (analz x\<^isub>1))" |
|
715 |
by (metis analz_idem analz_synth) |
|
716 |
have F2: "\<forall>x\<^isub>1. parts x\<^isub>1 \<union> synth (analz x\<^isub>1) = parts (synth (analz x\<^isub>1))" |
|
717 |
by (metis parts_analz parts_synth) |
|
|
45970
b6d0cff57d96
adjusted to set/pred distinction by means of type constructor `set`
haftmann
parents:
45605
diff
changeset
|
718 |
have F3: "X \<in> synth (analz H)" using A1 by metis |
| 36553 | 719 |
have "\<forall>x\<^isub>2 x\<^isub>1\<Colon>msg set. x\<^isub>1 \<le> sup x\<^isub>1 x\<^isub>2" by (metis inf_sup_ord(3)) |
720 |
hence F4: "\<forall>x\<^isub>1. analz x\<^isub>1 \<subseteq> analz (synth x\<^isub>1)" by (metis analz_synth) |
|
|
45970
b6d0cff57d96
adjusted to set/pred distinction by means of type constructor `set`
haftmann
parents:
45605
diff
changeset
|
721 |
have F5: "X \<in> synth (analz H)" using F3 by metis |
| 36553 | 722 |
have "\<forall>x\<^isub>1. analz x\<^isub>1 \<subseteq> synth (analz x\<^isub>1) |
723 |
\<longrightarrow> analz (synth (analz x\<^isub>1)) = synth (analz x\<^isub>1)" |
|
724 |
using F1 by (metis subset_Un_eq) |
|
725 |
hence F6: "\<forall>x\<^isub>1. analz (synth (analz x\<^isub>1)) = synth (analz x\<^isub>1)" |
|
726 |
by (metis synth_increasing) |
|
727 |
have "\<forall>x\<^isub>1. x\<^isub>1 \<subseteq> analz (synth x\<^isub>1)" using F4 by (metis analz_subset_iff) |
|
728 |
hence "\<forall>x\<^isub>1. x\<^isub>1 \<subseteq> analz (synth (analz x\<^isub>1))" by (metis analz_subset_iff) |
|
729 |
hence "\<forall>x\<^isub>1. x\<^isub>1 \<subseteq> synth (analz x\<^isub>1)" using F6 by metis |
|
730 |
hence "H \<subseteq> synth (analz H)" by metis |
|
731 |
hence "H \<subseteq> synth (analz H) \<and> X \<in> synth (analz H)" using F5 by metis |
|
732 |
hence "insert X H \<subseteq> synth (analz H)" by (metis insert_subset) |
|
733 |
hence "parts (insert X H) \<subseteq> parts (synth (analz H))" by (metis parts_mono) |
|
734 |
hence "parts (insert X H) \<subseteq> parts H \<union> synth (analz H)" using F2 by metis |
|
735 |
thus "parts (insert X H) \<subseteq> synth (analz H) \<union> parts H" by (metis Un_commute) |
|
| 23449 | 736 |
qed |
737 |
||
738 |
lemma Fake_parts_insert_in_Un: |
|
| 43197 | 739 |
"[|Z \<in> parts (insert X H); X: synth (analz H)|] |
| 45505 | 740 |
==> Z \<in> synth (analz H) \<union> parts H" |
| 36553 | 741 |
by (blast dest: Fake_parts_insert [THEN subsetD, dest]) |
| 23449 | 742 |
|
|
45970
b6d0cff57d96
adjusted to set/pred distinction by means of type constructor `set`
haftmann
parents:
45605
diff
changeset
|
743 |
declare synth_mono [intro] |
| 36553 | 744 |
|
| 23449 | 745 |
lemma Fake_analz_insert: |
| 36553 | 746 |
"X \<in> synth (analz G) ==> |
| 23449 | 747 |
analz (insert X H) \<subseteq> synth (analz G) \<union> analz (G \<union> H)" |
| 36553 | 748 |
by (metis Un_commute Un_insert_left Un_insert_right Un_upper1 analz_analz_Un |
749 |
analz_mono analz_synth_Un insert_absorb) |
|
| 23449 | 750 |
|
751 |
lemma Fake_analz_insert_simpler: |
|
| 43197 | 752 |
"X \<in> synth (analz G) ==> |
| 23449 | 753 |
analz (insert X H) \<subseteq> synth (analz G) \<union> analz (G \<union> H)" |
754 |
apply (rule subsetI) |
|
755 |
apply (subgoal_tac "x \<in> analz (synth (analz G) \<union> H) ") |
|
756 |
apply (metis Un_commute analz_analz_Un analz_synth_Un) |
|
| 39260 | 757 |
by (metis Un_upper1 Un_upper2 analz_mono insert_absorb insert_subset) |
| 23449 | 758 |
|
759 |
end |