src/HOL/Metis_Examples/Message.thy
changeset 69597 ff784d5a5bfb
parent 67613 ce654b0e6d69
child 69712 dc85b5b3a532
equal deleted inserted replaced
69596:c8a2755bf220 69597:ff784d5a5bfb
   215 text\<open>Added to simplify arguments to parts, analz and synth.
   215 text\<open>Added to simplify arguments to parts, analz and synth.
   216   NOTE: the UN versions are no longer used!\<close>
   216   NOTE: the UN versions are no longer used!\<close>
   217 
   217 
   218 
   218 
   219 text\<open>This allows \<open>blast\<close> to simplify occurrences of
   219 text\<open>This allows \<open>blast\<close> to simplify occurrences of
   220   @{term "parts(G\<union>H)"} in the assumption.\<close>
   220   \<^term>\<open>parts(G\<union>H)\<close> in the assumption.\<close>
   221 lemmas in_parts_UnE = parts_Un [THEN equalityD1, THEN subsetD, THEN UnE]
   221 lemmas in_parts_UnE = parts_Un [THEN equalityD1, THEN subsetD, THEN UnE]
   222 declare in_parts_UnE [elim!]
   222 declare in_parts_UnE [elim!]
   223 
   223 
   224 lemma parts_insert_subset: "insert X (parts H) \<subseteq> parts(insert X H)"
   224 lemma parts_insert_subset: "insert X (parts H) \<subseteq> parts(insert X H)"
   225 by (blast intro: parts_mono [THEN [2] rev_subsetD])
   225 by (blast intro: parts_mono [THEN [2] rev_subsetD])
   459                insert (Crypt K X) (analz (insert X H))"
   459                insert (Crypt K X) (analz (insert X H))"
   460 by (intro equalityI lemma1 lemma2)
   460 by (intro equalityI lemma1 lemma2)
   461 
   461 
   462 text\<open>Case analysis: either the message is secure, or it is not! Effective,
   462 text\<open>Case analysis: either the message is secure, or it is not! Effective,
   463 but can cause subgoals to blow up! Use with \<open>if_split\<close>; apparently
   463 but can cause subgoals to blow up! Use with \<open>if_split\<close>; apparently
   464 \<open>split_tac\<close> does not cope with patterns such as @{term"analz (insert
   464 \<open>split_tac\<close> does not cope with patterns such as \<^term>\<open>analz (insert
   465 (Crypt K X) H)"}\<close>
   465 (Crypt K X) H)\<close>\<close>
   466 lemma analz_Crypt_if [simp]:
   466 lemma analz_Crypt_if [simp]:
   467      "analz (insert (Crypt K X) H) =
   467      "analz (insert (Crypt K X) H) =
   468           (if (Key (invKey K) \<in> analz H)
   468           (if (Key (invKey K) \<in> analz H)
   469            then insert (Crypt K X) (analz (insert X H))
   469            then insert (Crypt K X) (analz (insert X H))
   470            else insert (Crypt K X) (analz H))"
   470            else insert (Crypt K X) (analz H))"
   574 text\<open>Monotonicity\<close>
   574 text\<open>Monotonicity\<close>
   575 lemma synth_mono: "G\<subseteq>H ==> synth(G) \<subseteq> synth(H)"
   575 lemma synth_mono: "G\<subseteq>H ==> synth(G) \<subseteq> synth(H)"
   576   by (auto, erule synth.induct, auto)
   576   by (auto, erule synth.induct, auto)
   577 
   577 
   578 text\<open>NO \<open>Agent_synth\<close>, as any Agent name can be synthesized.
   578 text\<open>NO \<open>Agent_synth\<close>, as any Agent name can be synthesized.
   579   The same holds for @{term Number}\<close>
   579   The same holds for \<^term>\<open>Number\<close>\<close>
   580 inductive_cases Nonce_synth [elim!]: "Nonce n \<in> synth H"
   580 inductive_cases Nonce_synth [elim!]: "Nonce n \<in> synth H"
   581 inductive_cases Key_synth   [elim!]: "Key K \<in> synth H"
   581 inductive_cases Key_synth   [elim!]: "Key K \<in> synth H"
   582 inductive_cases Hash_synth  [elim!]: "Hash X \<in> synth H"
   582 inductive_cases Hash_synth  [elim!]: "Hash X \<in> synth H"
   583 inductive_cases MPair_synth [elim!]: "\<lbrace>X,Y\<rbrace> \<in> synth H"
   583 inductive_cases MPair_synth [elim!]: "\<lbrace>X,Y\<rbrace> \<in> synth H"
   584 inductive_cases Crypt_synth [elim!]: "Crypt K X \<in> synth H"
   584 inductive_cases Crypt_synth [elim!]: "Crypt K X \<in> synth H"