[STATEMENT]
lemma "uniq ns secret ==> preserv ns keys n Ks"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uniq ns secret \<Longrightarrow> preserv ns keys n Ks
[PROOF STEP]
apply (unfold preserv_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uniq ns secret \<Longrightarrow> \<forall>evs R' s' R s. evs \<in> tr ns \<longrightarrow> Guard n Ks (knows Spy evs) \<longrightarrow> safe Ks (knows Spy evs) \<longrightarrow> fresh ns R' s' n Ks evs \<longrightarrow> keys R' s' n evs \<subseteq> Ks \<longrightarrow> R \<in> ns \<longrightarrow> ok evs R s \<longrightarrow> apm' s R \<in> guard n Ks
[PROOF STEP]
apply (rule allI)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>evs R' s' R s. uniq ns secret \<Longrightarrow> evs \<in> tr ns \<longrightarrow> Guard n Ks (knows Spy evs) \<longrightarrow> safe Ks (knows Spy evs) \<longrightarrow> fresh ns R' s' n Ks evs \<longrightarrow> keys R' s' n evs \<subseteq> Ks \<longrightarrow> R \<in> ns \<longrightarrow> ok evs R s \<longrightarrow> apm' s R \<in> guard n Ks
[PROOF STEP]
apply (rule impI, rule impI, rule impI, rule impI, rule impI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>evs R' s' R s. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); fresh ns R' s' n Ks evs; keys R' s' n evs \<subseteq> Ks\<rbrakk> \<Longrightarrow> R \<in> ns \<longrightarrow> ok evs R s \<longrightarrow> apm' s R \<in> guard n Ks
[PROOF STEP]
apply (erule fresh_ruleD, simp, simp, simp, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>evs R' s' R s. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys R' s' n evs \<subseteq> Ks\<rbrakk> \<Longrightarrow> \<forall>Ra k sa. nonce sa k = n \<longrightarrow> Nonce n \<in> used evs \<longrightarrow> Ra \<in> ns \<longrightarrow> k \<in> newn Ra \<longrightarrow> Nonce n \<in> parts {apm' sa Ra} \<longrightarrow> apm' sa Ra \<in> guard n Ks \<longrightarrow> apm' sa Ra \<in> parts (knows Spy evs) \<longrightarrow> keys Ra sa n evs \<subseteq> Ks \<longrightarrow> R \<in> ns \<longrightarrow> ok evs R s \<longrightarrow> apm' s R \<in> guard n Ks
[PROOF STEP]
apply (rule allI)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>evs R' s' R s Ra k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys R' s' n evs \<subseteq> Ks\<rbrakk> \<Longrightarrow> nonce sa k = n \<longrightarrow> Nonce n \<in> used evs \<longrightarrow> Ra \<in> ns \<longrightarrow> k \<in> newn Ra \<longrightarrow> Nonce n \<in> parts {apm' sa Ra} \<longrightarrow> apm' sa Ra \<in> guard n Ks \<longrightarrow> apm' sa Ra \<in> parts (knows Spy evs) \<longrightarrow> keys Ra sa n evs \<subseteq> Ks \<longrightarrow> R \<in> ns \<longrightarrow> ok evs R s \<longrightarrow> apm' s R \<in> guard n Ks
[PROOF STEP]
apply (rule impI, rule impI, rule impI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>evs R' s' R s Ra k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys R' s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; Ra \<in> ns\<rbrakk> \<Longrightarrow> k \<in> newn Ra \<longrightarrow> Nonce n \<in> parts {apm' sa Ra} \<longrightarrow> apm' sa Ra \<in> guard n Ks \<longrightarrow> apm' sa Ra \<in> parts (knows Spy evs) \<longrightarrow> keys Ra sa n evs \<subseteq> Ks \<longrightarrow> R \<in> ns \<longrightarrow> ok evs R s \<longrightarrow> apm' s R \<in> guard n Ks
[PROOF STEP]
apply (simp add: split_paired_all)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>evs a b s' aa ba s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (a, b) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; (ab, bb) \<in> ns\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aa, ba) \<in> ns \<longrightarrow> ok evs (aa, ba) s \<longrightarrow> apm s (msg ba) \<in> guard n Ks
[PROOF STEP]
apply (erule ns.cases)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {}; bb = Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 2. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; bb = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 3. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply (rule impI, rule impI, rule impI, rule impI, rule impI, rule impI)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {}; bb = Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>); k \<in> newn (ab, bb); Nonce n \<in> parts {apm sa (msg bb)}; apm sa (msg bb) \<in> guard n Ks; apm sa (msg bb) \<in> parts (knows Spy evs); keys (ab, bb) sa n evs \<subseteq> Ks; (aaa, baa) \<in> ns\<rbrakk> \<Longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 2. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; bb = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 3. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply (erule ns.cases)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {}; bb = Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>); k \<in> newn (ab, bb); Nonce n \<in> parts {apm sa (msg bb)}; apm sa (msg bb) \<in> guard n Ks; apm sa (msg bb) \<in> parts (knows Spy evs); keys (ab, bb) sa n evs \<subseteq> Ks; aaa = {}; baa = Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)\<rbrakk> \<Longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 2. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {}; bb = Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>); k \<in> newn (ab, bb); Nonce n \<in> parts {apm sa (msg bb)}; apm sa (msg bb) \<in> guard n Ks; apm sa (msg bb) \<in> parts (knows Spy evs); keys (ab, bb) sa n evs \<subseteq> Ks; aaa = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; baa = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)\<rbrakk> \<Longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 3. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {}; bb = Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>); k \<in> newn (ab, bb); Nonce n \<in> parts {apm sa (msg bb)}; apm sa (msg bb) \<in> guard n Ks; apm sa (msg bb) \<in> parts (knows Spy evs); keys (ab, bb) sa n evs \<subseteq> Ks; aaa = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; baa = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 4. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; bb = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 5. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Na) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Na) evs \<subseteq> Ks; Nonce (nonce sa Na) \<in> used evs; n = nonce sa Na; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> guard (nonce sa Na) Ks; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> parts (knows Spy evs); keys ns1 sa (nonce sa Na) evs \<subseteq> Ks; ok evs ns1 s\<rbrakk> \<Longrightarrow> Crypt (pubK' s b) \<lbrace>Nonce (nonce s Na), Agent (agent s a)\<rbrace> \<in> guard (nonce sa Na) Ks
 2. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {}; bb = Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>); k \<in> newn (ab, bb); Nonce n \<in> parts {apm sa (msg bb)}; apm sa (msg bb) \<in> guard n Ks; apm sa (msg bb) \<in> parts (knows Spy evs); keys (ab, bb) sa n evs \<subseteq> Ks; aaa = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; baa = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)\<rbrakk> \<Longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 3. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {}; bb = Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>); k \<in> newn (ab, bb); Nonce n \<in> parts {apm sa (msg bb)}; apm sa (msg bb) \<in> guard n Ks; apm sa (msg bb) \<in> parts (knows Spy evs); keys (ab, bb) sa n evs \<subseteq> Ks; aaa = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; baa = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 4. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; bb = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 5. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply (frule newn_neq_used, simp, simp)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Na) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Na) evs \<subseteq> Ks; Nonce (nonce sa Na) \<in> used evs; n = nonce sa Na; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> guard (nonce sa Na) Ks; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> parts (knows Spy evs); keys ns1 sa (nonce sa Na) evs \<subseteq> Ks; ok evs ns1 s; nonce sa Na \<noteq> nonce s Na\<rbrakk> \<Longrightarrow> Crypt (pubK' s b) \<lbrace>Nonce (nonce s Na), Agent (agent s a)\<rbrace> \<in> guard (nonce sa Na) Ks
 2. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {}; bb = Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>); k \<in> newn (ab, bb); Nonce n \<in> parts {apm sa (msg bb)}; apm sa (msg bb) \<in> guard n Ks; apm sa (msg bb) \<in> parts (knows Spy evs); keys (ab, bb) sa n evs \<subseteq> Ks; aaa = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; baa = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)\<rbrakk> \<Longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 3. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {}; bb = Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>); k \<in> newn (ab, bb); Nonce n \<in> parts {apm sa (msg bb)}; apm sa (msg bb) \<in> guard n Ks; apm sa (msg bb) \<in> parts (knows Spy evs); keys (ab, bb) sa n evs \<subseteq> Ks; aaa = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; baa = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 4. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; bb = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 5. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply (rule No_Nonce, simp)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {}; bb = Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>); k \<in> newn (ab, bb); Nonce n \<in> parts {apm sa (msg bb)}; apm sa (msg bb) \<in> guard n Ks; apm sa (msg bb) \<in> parts (knows Spy evs); keys (ab, bb) sa n evs \<subseteq> Ks; aaa = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; baa = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)\<rbrakk> \<Longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 2. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {}; bb = Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>); k \<in> newn (ab, bb); Nonce n \<in> parts {apm sa (msg bb)}; apm sa (msg bb) \<in> guard n Ks; apm sa (msg bb) \<in> parts (knows Spy evs); keys (ab, bb) sa n evs \<subseteq> Ks; aaa = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; baa = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 3. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; bb = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 4. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Na) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Na) evs \<subseteq> Ks; Nonce (nonce sa Na) \<in> used evs; n = nonce sa Na; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> guard (nonce sa Na) Ks; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> parts (knows Spy evs); keys ns1 sa (nonce sa Na) evs \<subseteq> Ks; ok evs ns2 s\<rbrakk> \<Longrightarrow> Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce sa Na) Ks
 2. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {}; bb = Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>); k \<in> newn (ab, bb); Nonce n \<in> parts {apm sa (msg bb)}; apm sa (msg bb) \<in> guard n Ks; apm sa (msg bb) \<in> parts (knows Spy evs); keys (ab, bb) sa n evs \<subseteq> Ks; aaa = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; baa = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 3. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; bb = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 4. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply (frule newn_neq_used, simp, simp)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Na) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Na) evs \<subseteq> Ks; Nonce (nonce sa Na) \<in> used evs; n = nonce sa Na; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> guard (nonce sa Na) Ks; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> parts (knows Spy evs); keys ns1 sa (nonce sa Na) evs \<subseteq> Ks; ok evs ns2 s; nonce sa Na \<noteq> nonce s Nb\<rbrakk> \<Longrightarrow> Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce sa Na) Ks
 2. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {}; bb = Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>); k \<in> newn (ab, bb); Nonce n \<in> parts {apm sa (msg bb)}; apm sa (msg bb) \<in> guard n Ks; apm sa (msg bb) \<in> parts (knows Spy evs); keys (ab, bb) sa n evs \<subseteq> Ks; aaa = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; baa = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 3. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; bb = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 4. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply (case_tac "nonce sa Na = nonce s Na")
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Na) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Na) evs \<subseteq> Ks; Nonce (nonce sa Na) \<in> used evs; n = nonce sa Na; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> guard (nonce sa Na) Ks; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> parts (knows Spy evs); keys ns1 sa (nonce sa Na) evs \<subseteq> Ks; ok evs ns2 s; nonce sa Na \<noteq> nonce s Nb; nonce sa Na = nonce s Na\<rbrakk> \<Longrightarrow> Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce sa Na) Ks
 2. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Na) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Na) evs \<subseteq> Ks; Nonce (nonce sa Na) \<in> used evs; n = nonce sa Na; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> guard (nonce sa Na) Ks; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> parts (knows Spy evs); keys ns1 sa (nonce sa Na) evs \<subseteq> Ks; ok evs ns2 s; nonce sa Na \<noteq> nonce s Nb; nonce sa Na \<noteq> nonce s Na\<rbrakk> \<Longrightarrow> Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce sa Na) Ks
 3. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {}; bb = Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>); k \<in> newn (ab, bb); Nonce n \<in> parts {apm sa (msg bb)}; apm sa (msg bb) \<in> guard n Ks; apm sa (msg bb) \<in> parts (knows Spy evs); keys (ab, bb) sa n evs \<subseteq> Ks; aaa = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; baa = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 4. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; bb = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 5. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply (frule Guard_safe, simp)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Na) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Na) evs \<subseteq> Ks; Nonce (nonce sa Na) \<in> used evs; n = nonce sa Na; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> guard (nonce sa Na) Ks; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> parts (knows Spy evs); keys ns1 sa (nonce sa Na) evs \<subseteq> Ks; ok evs ns2 s; nonce sa Na \<noteq> nonce s Nb; nonce sa Na = nonce s Na; Nonce (nonce sa Na) \<notin> analz (knows Spy evs)\<rbrakk> \<Longrightarrow> Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce sa Na) Ks
 2. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Na) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Na) evs \<subseteq> Ks; Nonce (nonce sa Na) \<in> used evs; n = nonce sa Na; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> guard (nonce sa Na) Ks; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> parts (knows Spy evs); keys ns1 sa (nonce sa Na) evs \<subseteq> Ks; ok evs ns2 s; nonce sa Na \<noteq> nonce s Nb; nonce sa Na \<noteq> nonce s Na\<rbrakk> \<Longrightarrow> Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce sa Na) Ks
 3. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {}; bb = Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>); k \<in> newn (ab, bb); Nonce n \<in> parts {apm sa (msg bb)}; apm sa (msg bb) \<in> guard n Ks; apm sa (msg bb) \<in> parts (knows Spy evs); keys (ab, bb) sa n evs \<subseteq> Ks; aaa = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; baa = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 4. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; bb = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 5. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply (frule Crypt_guard_invKey, simp)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Na) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Na) evs \<subseteq> Ks; Nonce (nonce sa Na) \<in> used evs; n = nonce sa Na; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> guard (nonce sa Na) Ks; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> parts (knows Spy evs); keys ns1 sa (nonce sa Na) evs \<subseteq> Ks; ok evs ns2 s; nonce sa Na \<noteq> nonce s Nb; nonce sa Na = nonce s Na; Nonce (nonce sa Na) \<notin> analz (knows Spy evs); priEK (agent sa b) \<in> Ks\<rbrakk> \<Longrightarrow> Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce sa Na) Ks
 2. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Na) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Na) evs \<subseteq> Ks; Nonce (nonce sa Na) \<in> used evs; n = nonce sa Na; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> guard (nonce sa Na) Ks; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> parts (knows Spy evs); keys ns1 sa (nonce sa Na) evs \<subseteq> Ks; ok evs ns2 s; nonce sa Na \<noteq> nonce s Nb; nonce sa Na \<noteq> nonce s Na\<rbrakk> \<Longrightarrow> Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce sa Na) Ks
 3. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {}; bb = Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>); k \<in> newn (ab, bb); Nonce n \<in> parts {apm sa (msg bb)}; apm sa (msg bb) \<in> guard n Ks; apm sa (msg bb) \<in> parts (knows Spy evs); keys (ab, bb) sa n evs \<subseteq> Ks; aaa = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; baa = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 4. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; bb = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 5. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply (frule ok_Guard, simp, simp, simp, clarsimp)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce s Na) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce s Na) evs \<subseteq> Ks; Nonce (nonce s Na) \<in> used evs; n = nonce s Na; Crypt (pubK' sa b) \<lbrace>Nonce (nonce s Na), Agent (agent sa a)\<rbrace> \<in> guard (nonce s Na) Ks; Crypt (pubK' sa b) \<lbrace>Nonce (nonce s Na), Agent (agent sa a)\<rbrace> \<in> parts (knows Spy evs); keys ns1 sa (nonce s Na) evs \<subseteq> Ks; ok evs ns2 s; nonce s Na \<noteq> nonce s Nb; nonce sa Na = nonce s Na; Nonce (nonce s Na) \<notin> analz (knows Spy evs); priEK (agent sa b) \<in> Ks; Crypt (pubK' s b) \<lbrace>Nonce (nonce s Na), Agent (agent s a)\<rbrace> \<in> parts (knows Spy evs); Crypt (pubK' s b) \<lbrace>Nonce (nonce s Na), Agent (agent s a)\<rbrace> \<in> guard (nonce s Na) Ks\<rbrakk> \<Longrightarrow> Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce s Na) Ks
 2. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Na) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Na) evs \<subseteq> Ks; Nonce (nonce sa Na) \<in> used evs; n = nonce sa Na; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> guard (nonce sa Na) Ks; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> parts (knows Spy evs); keys ns1 sa (nonce sa Na) evs \<subseteq> Ks; ok evs ns2 s; nonce sa Na \<noteq> nonce s Nb; nonce sa Na \<noteq> nonce s Na\<rbrakk> \<Longrightarrow> Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce sa Na) Ks
 3. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {}; bb = Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>); k \<in> newn (ab, bb); Nonce n \<in> parts {apm sa (msg bb)}; apm sa (msg bb) \<in> guard n Ks; apm sa (msg bb) \<in> parts (knows Spy evs); keys (ab, bb) sa n evs \<subseteq> Ks; aaa = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; baa = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 4. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; bb = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 5. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply (frule_tac K="pubK' s b" in Crypt_guard_invKey, simp)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce s Na) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce s Na) evs \<subseteq> Ks; Nonce (nonce s Na) \<in> used evs; n = nonce s Na; Crypt (pubK' sa b) \<lbrace>Nonce (nonce s Na), Agent (agent sa a)\<rbrace> \<in> guard (nonce s Na) Ks; Crypt (pubK' sa b) \<lbrace>Nonce (nonce s Na), Agent (agent sa a)\<rbrace> \<in> parts (knows Spy evs); keys ns1 sa (nonce s Na) evs \<subseteq> Ks; ok evs ns2 s; nonce s Na \<noteq> nonce s Nb; nonce sa Na = nonce s Na; Nonce (nonce s Na) \<notin> analz (knows Spy evs); priEK (agent sa b) \<in> Ks; Crypt (pubK' s b) \<lbrace>Nonce (nonce s Na), Agent (agent s a)\<rbrace> \<in> parts (knows Spy evs); Crypt (pubK' s b) \<lbrace>Nonce (nonce s Na), Agent (agent s a)\<rbrace> \<in> guard (nonce s Na) Ks; priEK (agent s b) \<in> Ks\<rbrakk> \<Longrightarrow> Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce s Na) Ks
 2. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Na) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Na) evs \<subseteq> Ks; Nonce (nonce sa Na) \<in> used evs; n = nonce sa Na; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> guard (nonce sa Na) Ks; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> parts (knows Spy evs); keys ns1 sa (nonce sa Na) evs \<subseteq> Ks; ok evs ns2 s; nonce sa Na \<noteq> nonce s Nb; nonce sa Na \<noteq> nonce s Na\<rbrakk> \<Longrightarrow> Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce sa Na) Ks
 3. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {}; bb = Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>); k \<in> newn (ab, bb); Nonce n \<in> parts {apm sa (msg bb)}; apm sa (msg bb) \<in> guard n Ks; apm sa (msg bb) \<in> parts (knows Spy evs); keys (ab, bb) sa n evs \<subseteq> Ks; aaa = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; baa = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 4. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; bb = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 5. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply (frule_tac R=ns1 and R'=ns1 and Ks=Ks and s=sa and s'=s in uniqD, simp+)
[PROOF STATE]
proof (prove)
goal (9 subgoals):
 1. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce s Na) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce s Na) evs \<subseteq> Ks; Nonce (nonce s Na) \<in> used evs; n = nonce s Na; Crypt (pubK' sa b) \<lbrace>Nonce (nonce s Na), Agent (agent sa a)\<rbrace> \<in> guard (nonce s Na) Ks; Crypt (pubK' sa b) \<lbrace>Nonce (nonce s Na), Agent (agent sa a)\<rbrace> \<in> parts (knows Spy evs); keys ns1 sa (nonce s Na) evs \<subseteq> Ks; ok evs ns2 s; nonce s Na \<noteq> nonce s Nb; nonce sa Na = nonce s Na; Nonce (nonce s Na) \<notin> analz (knows Spy evs); priEK (agent sa b) \<in> Ks; Crypt (pubK' s b) \<lbrace>Nonce (nonce s Na), Agent (agent s a)\<rbrace> \<in> parts (knows Spy evs); Crypt (pubK' s b) \<lbrace>Nonce (nonce s Na), Agent (agent s a)\<rbrace> \<in> guard (nonce s Na) Ks; priEK (agent s b) \<in> Ks\<rbrakk> \<Longrightarrow> secret ns1 Na sa Ks \<in> parts (knows Spy evs)
 2. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce s Na) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce s Na) evs \<subseteq> Ks; Nonce (nonce s Na) \<in> used evs; n = nonce s Na; Crypt (pubK' sa b) \<lbrace>Nonce (nonce s Na), Agent (agent sa a)\<rbrace> \<in> guard (nonce s Na) Ks; Crypt (pubK' sa b) \<lbrace>Nonce (nonce s Na), Agent (agent sa a)\<rbrace> \<in> parts (knows Spy evs); keys ns1 sa (nonce s Na) evs \<subseteq> Ks; ok evs ns2 s; nonce s Na \<noteq> nonce s Nb; nonce sa Na = nonce s Na; Nonce (nonce s Na) \<notin> analz (knows Spy evs); priEK (agent sa b) \<in> Ks; Crypt (pubK' s b) \<lbrace>Nonce (nonce s Na), Agent (agent s a)\<rbrace> \<in> parts (knows Spy evs); Crypt (pubK' s b) \<lbrace>Nonce (nonce s Na), Agent (agent s a)\<rbrace> \<in> guard (nonce s Na) Ks; priEK (agent s b) \<in> Ks\<rbrakk> \<Longrightarrow> secret ns1 Na s Ks \<in> parts (knows Spy evs)
 3. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce s Na) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce s Na) evs \<subseteq> Ks; Nonce (nonce s Na) \<in> used evs; n = nonce s Na; Crypt (pubK' sa b) \<lbrace>Nonce (nonce s Na), Agent (agent sa a)\<rbrace> \<in> guard (nonce s Na) Ks; Crypt (pubK' sa b) \<lbrace>Nonce (nonce s Na), Agent (agent sa a)\<rbrace> \<in> parts (knows Spy evs); keys ns1 sa (nonce s Na) evs \<subseteq> Ks; ok evs ns2 s; nonce s Na \<noteq> nonce s Nb; nonce sa Na = nonce s Na; Nonce (nonce s Na) \<notin> analz (knows Spy evs); priEK (agent sa b) \<in> Ks; Crypt (pubK' s b) \<lbrace>Nonce (nonce s Na), Agent (agent s a)\<rbrace> \<in> parts (knows Spy evs); Crypt (pubK' s b) \<lbrace>Nonce (nonce s Na), Agent (agent s a)\<rbrace> \<in> guard (nonce s Na) Ks; priEK (agent s b) \<in> Ks\<rbrakk> \<Longrightarrow> apm' sa ns1 \<in> guard (nonce sa Na) Ks
 4. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce s Na) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce s Na) evs \<subseteq> Ks; Nonce (nonce s Na) \<in> used evs; n = nonce s Na; Crypt (pubK' sa b) \<lbrace>Nonce (nonce s Na), Agent (agent sa a)\<rbrace> \<in> guard (nonce s Na) Ks; Crypt (pubK' sa b) \<lbrace>Nonce (nonce s Na), Agent (agent sa a)\<rbrace> \<in> parts (knows Spy evs); keys ns1 sa (nonce s Na) evs \<subseteq> Ks; ok evs ns2 s; nonce s Na \<noteq> nonce s Nb; nonce sa Na = nonce s Na; Nonce (nonce s Na) \<notin> analz (knows Spy evs); priEK (agent sa b) \<in> Ks; Crypt (pubK' s b) \<lbrace>Nonce (nonce s Na), Agent (agent s a)\<rbrace> \<in> parts (knows Spy evs); Crypt (pubK' s b) \<lbrace>Nonce (nonce s Na), Agent (agent s a)\<rbrace> \<in> guard (nonce s Na) Ks; priEK (agent s b) \<in> Ks\<rbrakk> \<Longrightarrow> apm' s ns1 \<in> guard (nonce sa Na) Ks
 5. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce s Na) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce s Na) evs \<subseteq> Ks; Nonce (nonce s Na) \<in> used evs; n = nonce s Na; Crypt (pubK' sa b) \<lbrace>Nonce (nonce s Na), Agent (agent sa a)\<rbrace> \<in> guard (nonce s Na) Ks; Crypt (pubK' sa b) \<lbrace>Nonce (nonce s Na), Agent (agent sa a)\<rbrace> \<in> parts (knows Spy evs); keys ns1 sa (nonce s Na) evs \<subseteq> Ks; ok evs ns2 s; nonce s Na \<noteq> nonce s Nb; nonce sa Na = nonce s Na; Nonce (nonce s Na) \<notin> analz (knows Spy evs); priEK (agent sa b) \<in> Ks; Crypt (pubK' s b) \<lbrace>Nonce (nonce s Na), Agent (agent s a)\<rbrace> \<in> parts (knows Spy evs); Crypt (pubK' s b) \<lbrace>Nonce (nonce s Na), Agent (agent s a)\<rbrace> \<in> guard (nonce s Na) Ks; priEK (agent s b) \<in> Ks; secret ns1 Na sa Ks = secret ns1 Na s Ks\<rbrakk> \<Longrightarrow> Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce s Na) Ks
 6. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Na) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Na) evs \<subseteq> Ks; Nonce (nonce sa Na) \<in> used evs; n = nonce sa Na; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> guard (nonce sa Na) Ks; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> parts (knows Spy evs); keys ns1 sa (nonce sa Na) evs \<subseteq> Ks; ok evs ns2 s; nonce sa Na \<noteq> nonce s Nb; nonce sa Na \<noteq> nonce s Na\<rbrakk> \<Longrightarrow> Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce sa Na) Ks
 7. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {}; bb = Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>); k \<in> newn (ab, bb); Nonce n \<in> parts {apm sa (msg bb)}; apm sa (msg bb) \<in> guard n Ks; apm sa (msg bb) \<in> parts (knows Spy evs); keys (ab, bb) sa n evs \<subseteq> Ks; aaa = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; baa = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 8. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; bb = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 9. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply (simp add: secret_def, simp add: secret_def, force, force)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce s Na) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce s Na) evs \<subseteq> Ks; Nonce (nonce s Na) \<in> used evs; n = nonce s Na; Crypt (pubK' sa b) \<lbrace>Nonce (nonce s Na), Agent (agent sa a)\<rbrace> \<in> guard (nonce s Na) Ks; Crypt (pubK' sa b) \<lbrace>Nonce (nonce s Na), Agent (agent sa a)\<rbrace> \<in> parts (knows Spy evs); keys ns1 sa (nonce s Na) evs \<subseteq> Ks; ok evs ns2 s; nonce s Na \<noteq> nonce s Nb; nonce sa Na = nonce s Na; Nonce (nonce s Na) \<notin> analz (knows Spy evs); priEK (agent sa b) \<in> Ks; Crypt (pubK' s b) \<lbrace>Nonce (nonce s Na), Agent (agent s a)\<rbrace> \<in> parts (knows Spy evs); Crypt (pubK' s b) \<lbrace>Nonce (nonce s Na), Agent (agent s a)\<rbrace> \<in> guard (nonce s Na) Ks; priEK (agent s b) \<in> Ks; secret ns1 Na sa Ks = secret ns1 Na s Ks\<rbrakk> \<Longrightarrow> Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce s Na) Ks
 2. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Na) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Na) evs \<subseteq> Ks; Nonce (nonce sa Na) \<in> used evs; n = nonce sa Na; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> guard (nonce sa Na) Ks; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> parts (knows Spy evs); keys ns1 sa (nonce sa Na) evs \<subseteq> Ks; ok evs ns2 s; nonce sa Na \<noteq> nonce s Nb; nonce sa Na \<noteq> nonce s Na\<rbrakk> \<Longrightarrow> Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce sa Na) Ks
 3. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {}; bb = Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>); k \<in> newn (ab, bb); Nonce n \<in> parts {apm sa (msg bb)}; apm sa (msg bb) \<in> guard n Ks; apm sa (msg bb) \<in> parts (knows Spy evs); keys (ab, bb) sa n evs \<subseteq> Ks; aaa = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; baa = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 4. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; bb = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 5. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply (simp add: secret_def keys_def, blast)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Na) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Na) evs \<subseteq> Ks; Nonce (nonce sa Na) \<in> used evs; n = nonce sa Na; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> guard (nonce sa Na) Ks; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> parts (knows Spy evs); keys ns1 sa (nonce sa Na) evs \<subseteq> Ks; ok evs ns2 s; nonce sa Na \<noteq> nonce s Nb; nonce sa Na \<noteq> nonce s Na\<rbrakk> \<Longrightarrow> Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce sa Na) Ks
 2. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {}; bb = Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>); k \<in> newn (ab, bb); Nonce n \<in> parts {apm sa (msg bb)}; apm sa (msg bb) \<in> guard n Ks; apm sa (msg bb) \<in> parts (knows Spy evs); keys (ab, bb) sa n evs \<subseteq> Ks; aaa = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; baa = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 3. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; bb = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 4. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply (rule No_Nonce, simp)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {}; bb = Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>); k \<in> newn (ab, bb); Nonce n \<in> parts {apm sa (msg bb)}; apm sa (msg bb) \<in> guard n Ks; apm sa (msg bb) \<in> parts (knows Spy evs); keys (ab, bb) sa n evs \<subseteq> Ks; aaa = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; baa = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 2. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; bb = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 3. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Na) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Na) evs \<subseteq> Ks; Nonce (nonce sa Na) \<in> used evs; n = nonce sa Na; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> guard (nonce sa Na) Ks; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> parts (knows Spy evs); keys ns1 sa (nonce sa Na) evs \<subseteq> Ks; ok evs ns3 s\<rbrakk> \<Longrightarrow> Crypt (pubK' s b) (Nonce (nonce s Nb)) \<in> guard (nonce sa Na) Ks
 2. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; bb = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 3. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply (case_tac "nonce sa Na = nonce s Nb")
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Na) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Na) evs \<subseteq> Ks; Nonce (nonce sa Na) \<in> used evs; n = nonce sa Na; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> guard (nonce sa Na) Ks; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> parts (knows Spy evs); keys ns1 sa (nonce sa Na) evs \<subseteq> Ks; ok evs ns3 s; nonce sa Na = nonce s Nb\<rbrakk> \<Longrightarrow> Crypt (pubK' s b) (Nonce (nonce s Nb)) \<in> guard (nonce sa Na) Ks
 2. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Na) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Na) evs \<subseteq> Ks; Nonce (nonce sa Na) \<in> used evs; n = nonce sa Na; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> guard (nonce sa Na) Ks; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> parts (knows Spy evs); keys ns1 sa (nonce sa Na) evs \<subseteq> Ks; ok evs ns3 s; nonce sa Na \<noteq> nonce s Nb\<rbrakk> \<Longrightarrow> Crypt (pubK' s b) (Nonce (nonce s Nb)) \<in> guard (nonce sa Na) Ks
 3. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; bb = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 4. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply (frule Guard_safe, simp)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Na) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Na) evs \<subseteq> Ks; Nonce (nonce sa Na) \<in> used evs; n = nonce sa Na; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> guard (nonce sa Na) Ks; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> parts (knows Spy evs); keys ns1 sa (nonce sa Na) evs \<subseteq> Ks; ok evs ns3 s; nonce sa Na = nonce s Nb; Nonce (nonce sa Na) \<notin> analz (knows Spy evs)\<rbrakk> \<Longrightarrow> Crypt (pubK' s b) (Nonce (nonce s Nb)) \<in> guard (nonce sa Na) Ks
 2. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Na) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Na) evs \<subseteq> Ks; Nonce (nonce sa Na) \<in> used evs; n = nonce sa Na; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> guard (nonce sa Na) Ks; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> parts (knows Spy evs); keys ns1 sa (nonce sa Na) evs \<subseteq> Ks; ok evs ns3 s; nonce sa Na \<noteq> nonce s Nb\<rbrakk> \<Longrightarrow> Crypt (pubK' s b) (Nonce (nonce s Nb)) \<in> guard (nonce sa Na) Ks
 3. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; bb = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 4. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply (frule Crypt_guard_invKey, simp)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Na) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Na) evs \<subseteq> Ks; Nonce (nonce sa Na) \<in> used evs; n = nonce sa Na; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> guard (nonce sa Na) Ks; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> parts (knows Spy evs); keys ns1 sa (nonce sa Na) evs \<subseteq> Ks; ok evs ns3 s; nonce sa Na = nonce s Nb; Nonce (nonce sa Na) \<notin> analz (knows Spy evs); priEK (agent sa b) \<in> Ks\<rbrakk> \<Longrightarrow> Crypt (pubK' s b) (Nonce (nonce s Nb)) \<in> guard (nonce sa Na) Ks
 2. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Na) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Na) evs \<subseteq> Ks; Nonce (nonce sa Na) \<in> used evs; n = nonce sa Na; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> guard (nonce sa Na) Ks; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> parts (knows Spy evs); keys ns1 sa (nonce sa Na) evs \<subseteq> Ks; ok evs ns3 s; nonce sa Na \<noteq> nonce s Nb\<rbrakk> \<Longrightarrow> Crypt (pubK' s b) (Nonce (nonce s Nb)) \<in> guard (nonce sa Na) Ks
 3. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; bb = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 4. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply (frule_tac x=ns3b in ok_Guard, simp, simp, simp, clarsimp)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce s Nb) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce s Nb) evs \<subseteq> Ks; Nonce (nonce s Nb) \<in> used evs; n = nonce s Nb; Crypt (pubK' sa b) \<lbrace>Nonce (nonce s Nb), Agent (agent sa a)\<rbrace> \<in> guard (nonce s Nb) Ks; Crypt (pubK' sa b) \<lbrace>Nonce (nonce s Nb), Agent (agent sa a)\<rbrace> \<in> parts (knows Spy evs); keys ns1 sa (nonce s Nb) evs \<subseteq> Ks; ok evs ns3 s; nonce sa Na = nonce s Nb; Nonce (nonce s Nb) \<notin> analz (knows Spy evs); priEK (agent sa b) \<in> Ks; Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> parts (knows Spy evs); Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce s Nb) Ks\<rbrakk> \<Longrightarrow> Crypt (pubK' s b) (Nonce (nonce s Nb)) \<in> guard (nonce s Nb) Ks
 2. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Na) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Na) evs \<subseteq> Ks; Nonce (nonce sa Na) \<in> used evs; n = nonce sa Na; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> guard (nonce sa Na) Ks; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> parts (knows Spy evs); keys ns1 sa (nonce sa Na) evs \<subseteq> Ks; ok evs ns3 s; nonce sa Na \<noteq> nonce s Nb\<rbrakk> \<Longrightarrow> Crypt (pubK' s b) (Nonce (nonce s Nb)) \<in> guard (nonce sa Na) Ks
 3. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; bb = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 4. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply (frule_tac K="pubK' s a" in Crypt_guard_invKey, simp)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce s Nb) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce s Nb) evs \<subseteq> Ks; Nonce (nonce s Nb) \<in> used evs; n = nonce s Nb; Crypt (pubK' sa b) \<lbrace>Nonce (nonce s Nb), Agent (agent sa a)\<rbrace> \<in> guard (nonce s Nb) Ks; Crypt (pubK' sa b) \<lbrace>Nonce (nonce s Nb), Agent (agent sa a)\<rbrace> \<in> parts (knows Spy evs); keys ns1 sa (nonce s Nb) evs \<subseteq> Ks; ok evs ns3 s; nonce sa Na = nonce s Nb; Nonce (nonce s Nb) \<notin> analz (knows Spy evs); priEK (agent sa b) \<in> Ks; Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> parts (knows Spy evs); Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce s Nb) Ks; priEK (agent s a) \<in> Ks\<rbrakk> \<Longrightarrow> Crypt (pubK' s b) (Nonce (nonce s Nb)) \<in> guard (nonce s Nb) Ks
 2. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Na) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Na) evs \<subseteq> Ks; Nonce (nonce sa Na) \<in> used evs; n = nonce sa Na; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> guard (nonce sa Na) Ks; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> parts (knows Spy evs); keys ns1 sa (nonce sa Na) evs \<subseteq> Ks; ok evs ns3 s; nonce sa Na \<noteq> nonce s Nb\<rbrakk> \<Longrightarrow> Crypt (pubK' s b) (Nonce (nonce s Nb)) \<in> guard (nonce sa Na) Ks
 3. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; bb = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 4. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply (frule_tac R=ns1 and R'=ns2 and Ks=Ks and s=sa and s'=s in uniqD, simp+)
[PROOF STATE]
proof (prove)
goal (8 subgoals):
 1. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce s Nb) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce s Nb) evs \<subseteq> Ks; Nonce (nonce s Nb) \<in> used evs; n = nonce s Nb; Crypt (pubK' sa b) \<lbrace>Nonce (nonce s Nb), Agent (agent sa a)\<rbrace> \<in> guard (nonce s Nb) Ks; Crypt (pubK' sa b) \<lbrace>Nonce (nonce s Nb), Agent (agent sa a)\<rbrace> \<in> parts (knows Spy evs); keys ns1 sa (nonce s Nb) evs \<subseteq> Ks; ok evs ns3 s; nonce sa Na = nonce s Nb; Nonce (nonce s Nb) \<notin> analz (knows Spy evs); priEK (agent sa b) \<in> Ks; Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> parts (knows Spy evs); Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce s Nb) Ks; priEK (agent s a) \<in> Ks\<rbrakk> \<Longrightarrow> secret ns1 Na sa Ks \<in> parts (knows Spy evs)
 2. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce s Nb) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce s Nb) evs \<subseteq> Ks; Nonce (nonce s Nb) \<in> used evs; n = nonce s Nb; Crypt (pubK' sa b) \<lbrace>Nonce (nonce s Nb), Agent (agent sa a)\<rbrace> \<in> guard (nonce s Nb) Ks; Crypt (pubK' sa b) \<lbrace>Nonce (nonce s Nb), Agent (agent sa a)\<rbrace> \<in> parts (knows Spy evs); keys ns1 sa (nonce s Nb) evs \<subseteq> Ks; ok evs ns3 s; nonce sa Na = nonce s Nb; Nonce (nonce s Nb) \<notin> analz (knows Spy evs); priEK (agent sa b) \<in> Ks; Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> parts (knows Spy evs); Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce s Nb) Ks; priEK (agent s a) \<in> Ks\<rbrakk> \<Longrightarrow> secret ns2 Nb s Ks \<in> parts (knows Spy evs)
 3. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce s Nb) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce s Nb) evs \<subseteq> Ks; Nonce (nonce s Nb) \<in> used evs; n = nonce s Nb; Crypt (pubK' sa b) \<lbrace>Nonce (nonce s Nb), Agent (agent sa a)\<rbrace> \<in> guard (nonce s Nb) Ks; Crypt (pubK' sa b) \<lbrace>Nonce (nonce s Nb), Agent (agent sa a)\<rbrace> \<in> parts (knows Spy evs); keys ns1 sa (nonce s Nb) evs \<subseteq> Ks; ok evs ns3 s; nonce sa Na = nonce s Nb; Nonce (nonce s Nb) \<notin> analz (knows Spy evs); priEK (agent sa b) \<in> Ks; Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> parts (knows Spy evs); Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce s Nb) Ks; priEK (agent s a) \<in> Ks\<rbrakk> \<Longrightarrow> apm' sa ns1 \<in> guard (nonce sa Na) Ks
 4. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce s Nb) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce s Nb) evs \<subseteq> Ks; Nonce (nonce s Nb) \<in> used evs; n = nonce s Nb; Crypt (pubK' sa b) \<lbrace>Nonce (nonce s Nb), Agent (agent sa a)\<rbrace> \<in> guard (nonce s Nb) Ks; Crypt (pubK' sa b) \<lbrace>Nonce (nonce s Nb), Agent (agent sa a)\<rbrace> \<in> parts (knows Spy evs); keys ns1 sa (nonce s Nb) evs \<subseteq> Ks; ok evs ns3 s; nonce sa Na = nonce s Nb; Nonce (nonce s Nb) \<notin> analz (knows Spy evs); priEK (agent sa b) \<in> Ks; Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> parts (knows Spy evs); Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce s Nb) Ks; priEK (agent s a) \<in> Ks\<rbrakk> \<Longrightarrow> apm' s ns2 \<in> guard (nonce sa Na) Ks
 5. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce s Nb) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce s Nb) evs \<subseteq> Ks; Nonce (nonce s Nb) \<in> used evs; n = nonce s Nb; Crypt (pubK' sa b) \<lbrace>Nonce (nonce s Nb), Agent (agent sa a)\<rbrace> \<in> guard (nonce s Nb) Ks; Crypt (pubK' sa b) \<lbrace>Nonce (nonce s Nb), Agent (agent sa a)\<rbrace> \<in> parts (knows Spy evs); keys ns1 sa (nonce s Nb) evs \<subseteq> Ks; ok evs ns3 s; nonce sa Na = nonce s Nb; Nonce (nonce s Nb) \<notin> analz (knows Spy evs); priEK (agent sa b) \<in> Ks; Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> parts (knows Spy evs); Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce s Nb) Ks; priEK (agent s a) \<in> Ks; secret ns1 Na sa Ks = secret ns2 Nb s Ks\<rbrakk> \<Longrightarrow> Crypt (pubK' s b) (Nonce (nonce s Nb)) \<in> guard (nonce s Nb) Ks
 6. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Na) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Na) evs \<subseteq> Ks; Nonce (nonce sa Na) \<in> used evs; n = nonce sa Na; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> guard (nonce sa Na) Ks; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> parts (knows Spy evs); keys ns1 sa (nonce sa Na) evs \<subseteq> Ks; ok evs ns3 s; nonce sa Na \<noteq> nonce s Nb\<rbrakk> \<Longrightarrow> Crypt (pubK' s b) (Nonce (nonce s Nb)) \<in> guard (nonce sa Na) Ks
 7. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; bb = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 8. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply (simp add: secret_def, simp add: secret_def, force, force)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce s Nb) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce s Nb) evs \<subseteq> Ks; Nonce (nonce s Nb) \<in> used evs; n = nonce s Nb; Crypt (pubK' sa b) \<lbrace>Nonce (nonce s Nb), Agent (agent sa a)\<rbrace> \<in> guard (nonce s Nb) Ks; Crypt (pubK' sa b) \<lbrace>Nonce (nonce s Nb), Agent (agent sa a)\<rbrace> \<in> parts (knows Spy evs); keys ns1 sa (nonce s Nb) evs \<subseteq> Ks; ok evs ns3 s; nonce sa Na = nonce s Nb; Nonce (nonce s Nb) \<notin> analz (knows Spy evs); priEK (agent sa b) \<in> Ks; Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> parts (knows Spy evs); Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce s Nb) Ks; priEK (agent s a) \<in> Ks; secret ns1 Na sa Ks = secret ns2 Nb s Ks\<rbrakk> \<Longrightarrow> Crypt (pubK' s b) (Nonce (nonce s Nb)) \<in> guard (nonce s Nb) Ks
 2. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Na) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Na) evs \<subseteq> Ks; Nonce (nonce sa Na) \<in> used evs; n = nonce sa Na; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> guard (nonce sa Na) Ks; Crypt (pubK' sa b) \<lbrace>Nonce (nonce sa Na), Agent (agent sa a)\<rbrace> \<in> parts (knows Spy evs); keys ns1 sa (nonce sa Na) evs \<subseteq> Ks; ok evs ns3 s; nonce sa Na \<noteq> nonce s Nb\<rbrakk> \<Longrightarrow> Crypt (pubK' s b) (Nonce (nonce s Nb)) \<in> guard (nonce sa Na) Ks
 3. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; bb = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 4. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply (simp add: secret_def, rule No_Nonce, simp)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; bb = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 2. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply (rule impI, rule impI, rule impI, rule impI, rule impI, rule impI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; bb = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>); k \<in> newn (ab, bb); Nonce n \<in> parts {apm sa (msg bb)}; apm sa (msg bb) \<in> guard n Ks; apm sa (msg bb) \<in> parts (knows Spy evs); keys (ab, bb) sa n evs \<subseteq> Ks; (aaa, baa) \<in> ns\<rbrakk> \<Longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 2. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply (erule ns.cases)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; bb = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>); k \<in> newn (ab, bb); Nonce n \<in> parts {apm sa (msg bb)}; apm sa (msg bb) \<in> guard n Ks; apm sa (msg bb) \<in> parts (knows Spy evs); keys (ab, bb) sa n evs \<subseteq> Ks; aaa = {}; baa = Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)\<rbrakk> \<Longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 2. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; bb = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>); k \<in> newn (ab, bb); Nonce n \<in> parts {apm sa (msg bb)}; apm sa (msg bb) \<in> guard n Ks; apm sa (msg bb) \<in> parts (knows Spy evs); keys (ab, bb) sa n evs \<subseteq> Ks; aaa = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; baa = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)\<rbrakk> \<Longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 3. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; bb = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>); k \<in> newn (ab, bb); Nonce n \<in> parts {apm sa (msg bb)}; apm sa (msg bb) \<in> guard n Ks; apm sa (msg bb) \<in> parts (knows Spy evs); keys (ab, bb) sa n evs \<subseteq> Ks; aaa = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; baa = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 4. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Nb) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Nb) evs \<subseteq> Ks; Nonce (nonce sa Nb) \<in> used evs; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> guard (nonce sa Nb) Ks; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> parts (knows Spy evs); keys ns2 sa (nonce sa Nb) evs \<subseteq> Ks; n = nonce sa Nb; ok evs ns1 s\<rbrakk> \<Longrightarrow> Crypt (pubK' s b) \<lbrace>Nonce (nonce s Na), Agent (agent s a)\<rbrace> \<in> guard (nonce sa Nb) Ks
 2. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; bb = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>); k \<in> newn (ab, bb); Nonce n \<in> parts {apm sa (msg bb)}; apm sa (msg bb) \<in> guard n Ks; apm sa (msg bb) \<in> parts (knows Spy evs); keys (ab, bb) sa n evs \<subseteq> Ks; aaa = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; baa = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)\<rbrakk> \<Longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 3. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; bb = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>); k \<in> newn (ab, bb); Nonce n \<in> parts {apm sa (msg bb)}; apm sa (msg bb) \<in> guard n Ks; apm sa (msg bb) \<in> parts (knows Spy evs); keys (ab, bb) sa n evs \<subseteq> Ks; aaa = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; baa = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 4. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply (frule newn_neq_used, simp, simp)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Nb) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Nb) evs \<subseteq> Ks; Nonce (nonce sa Nb) \<in> used evs; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> guard (nonce sa Nb) Ks; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> parts (knows Spy evs); keys ns2 sa (nonce sa Nb) evs \<subseteq> Ks; n = nonce sa Nb; ok evs ns1 s; nonce sa Nb \<noteq> nonce s Na\<rbrakk> \<Longrightarrow> Crypt (pubK' s b) \<lbrace>Nonce (nonce s Na), Agent (agent s a)\<rbrace> \<in> guard (nonce sa Nb) Ks
 2. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; bb = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>); k \<in> newn (ab, bb); Nonce n \<in> parts {apm sa (msg bb)}; apm sa (msg bb) \<in> guard n Ks; apm sa (msg bb) \<in> parts (knows Spy evs); keys (ab, bb) sa n evs \<subseteq> Ks; aaa = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; baa = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)\<rbrakk> \<Longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 3. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; bb = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>); k \<in> newn (ab, bb); Nonce n \<in> parts {apm sa (msg bb)}; apm sa (msg bb) \<in> guard n Ks; apm sa (msg bb) \<in> parts (knows Spy evs); keys (ab, bb) sa n evs \<subseteq> Ks; aaa = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; baa = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 4. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply (rule No_Nonce, simp)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; bb = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>); k \<in> newn (ab, bb); Nonce n \<in> parts {apm sa (msg bb)}; apm sa (msg bb) \<in> guard n Ks; apm sa (msg bb) \<in> parts (knows Spy evs); keys (ab, bb) sa n evs \<subseteq> Ks; aaa = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; baa = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)\<rbrakk> \<Longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 2. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; bb = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>); k \<in> newn (ab, bb); Nonce n \<in> parts {apm sa (msg bb)}; apm sa (msg bb) \<in> guard n Ks; apm sa (msg bb) \<in> parts (knows Spy evs); keys (ab, bb) sa n evs \<subseteq> Ks; aaa = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; baa = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 3. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Nb) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Nb) evs \<subseteq> Ks; Nonce (nonce sa Nb) \<in> used evs; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> guard (nonce sa Nb) Ks; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> parts (knows Spy evs); keys ns2 sa (nonce sa Nb) evs \<subseteq> Ks; n = nonce sa Nb; ok evs ns2 s\<rbrakk> \<Longrightarrow> Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce sa Nb) Ks
 2. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; bb = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>); k \<in> newn (ab, bb); Nonce n \<in> parts {apm sa (msg bb)}; apm sa (msg bb) \<in> guard n Ks; apm sa (msg bb) \<in> parts (knows Spy evs); keys (ab, bb) sa n evs \<subseteq> Ks; aaa = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; baa = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 3. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply (frule newn_neq_used, simp, simp)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Nb) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Nb) evs \<subseteq> Ks; Nonce (nonce sa Nb) \<in> used evs; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> guard (nonce sa Nb) Ks; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> parts (knows Spy evs); keys ns2 sa (nonce sa Nb) evs \<subseteq> Ks; n = nonce sa Nb; ok evs ns2 s; nonce sa Nb \<noteq> nonce s Nb\<rbrakk> \<Longrightarrow> Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce sa Nb) Ks
 2. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; bb = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>); k \<in> newn (ab, bb); Nonce n \<in> parts {apm sa (msg bb)}; apm sa (msg bb) \<in> guard n Ks; apm sa (msg bb) \<in> parts (knows Spy evs); keys (ab, bb) sa n evs \<subseteq> Ks; aaa = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; baa = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 3. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply (case_tac "nonce sa Nb = nonce s Na")
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Nb) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Nb) evs \<subseteq> Ks; Nonce (nonce sa Nb) \<in> used evs; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> guard (nonce sa Nb) Ks; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> parts (knows Spy evs); keys ns2 sa (nonce sa Nb) evs \<subseteq> Ks; n = nonce sa Nb; ok evs ns2 s; nonce sa Nb \<noteq> nonce s Nb; nonce sa Nb = nonce s Na\<rbrakk> \<Longrightarrow> Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce sa Nb) Ks
 2. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Nb) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Nb) evs \<subseteq> Ks; Nonce (nonce sa Nb) \<in> used evs; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> guard (nonce sa Nb) Ks; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> parts (knows Spy evs); keys ns2 sa (nonce sa Nb) evs \<subseteq> Ks; n = nonce sa Nb; ok evs ns2 s; nonce sa Nb \<noteq> nonce s Nb; nonce sa Nb \<noteq> nonce s Na\<rbrakk> \<Longrightarrow> Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce sa Nb) Ks
 3. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; bb = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>); k \<in> newn (ab, bb); Nonce n \<in> parts {apm sa (msg bb)}; apm sa (msg bb) \<in> guard n Ks; apm sa (msg bb) \<in> parts (knows Spy evs); keys (ab, bb) sa n evs \<subseteq> Ks; aaa = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; baa = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 4. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply (frule Guard_safe, simp)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Nb) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Nb) evs \<subseteq> Ks; Nonce (nonce sa Nb) \<in> used evs; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> guard (nonce sa Nb) Ks; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> parts (knows Spy evs); keys ns2 sa (nonce sa Nb) evs \<subseteq> Ks; n = nonce sa Nb; ok evs ns2 s; nonce sa Nb \<noteq> nonce s Nb; nonce sa Nb = nonce s Na; Nonce (nonce sa Nb) \<notin> analz (knows Spy evs)\<rbrakk> \<Longrightarrow> Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce sa Nb) Ks
 2. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Nb) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Nb) evs \<subseteq> Ks; Nonce (nonce sa Nb) \<in> used evs; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> guard (nonce sa Nb) Ks; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> parts (knows Spy evs); keys ns2 sa (nonce sa Nb) evs \<subseteq> Ks; n = nonce sa Nb; ok evs ns2 s; nonce sa Nb \<noteq> nonce s Nb; nonce sa Nb \<noteq> nonce s Na\<rbrakk> \<Longrightarrow> Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce sa Nb) Ks
 3. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; bb = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>); k \<in> newn (ab, bb); Nonce n \<in> parts {apm sa (msg bb)}; apm sa (msg bb) \<in> guard n Ks; apm sa (msg bb) \<in> parts (knows Spy evs); keys (ab, bb) sa n evs \<subseteq> Ks; aaa = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; baa = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 4. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply (frule Crypt_guard_invKey, simp)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Nb) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Nb) evs \<subseteq> Ks; Nonce (nonce sa Nb) \<in> used evs; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> guard (nonce sa Nb) Ks; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> parts (knows Spy evs); keys ns2 sa (nonce sa Nb) evs \<subseteq> Ks; n = nonce sa Nb; ok evs ns2 s; nonce sa Nb \<noteq> nonce s Nb; nonce sa Nb = nonce s Na; Nonce (nonce sa Nb) \<notin> analz (knows Spy evs); priEK (agent sa a) \<in> Ks\<rbrakk> \<Longrightarrow> Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce sa Nb) Ks
 2. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Nb) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Nb) evs \<subseteq> Ks; Nonce (nonce sa Nb) \<in> used evs; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> guard (nonce sa Nb) Ks; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> parts (knows Spy evs); keys ns2 sa (nonce sa Nb) evs \<subseteq> Ks; n = nonce sa Nb; ok evs ns2 s; nonce sa Nb \<noteq> nonce s Nb; nonce sa Nb \<noteq> nonce s Na\<rbrakk> \<Longrightarrow> Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce sa Nb) Ks
 3. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; bb = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>); k \<in> newn (ab, bb); Nonce n \<in> parts {apm sa (msg bb)}; apm sa (msg bb) \<in> guard n Ks; apm sa (msg bb) \<in> parts (knows Spy evs); keys (ab, bb) sa n evs \<subseteq> Ks; aaa = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; baa = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 4. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply (frule ok_Guard, simp, simp, simp, clarsimp)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce s Na) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce s Na) evs \<subseteq> Ks; Nonce (nonce s Na) \<in> used evs; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce s Na), Agent (agent sa b)\<rbrace> \<in> guard (nonce s Na) Ks; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce s Na), Agent (agent sa b)\<rbrace> \<in> parts (knows Spy evs); keys ns2 sa (nonce s Na) evs \<subseteq> Ks; n = nonce s Na; ok evs ns2 s; nonce s Na \<noteq> nonce s Nb; nonce sa Nb = nonce s Na; Nonce (nonce s Na) \<notin> analz (knows Spy evs); priEK (agent sa a) \<in> Ks; Crypt (pubK' s b) \<lbrace>Nonce (nonce s Na), Agent (agent s a)\<rbrace> \<in> parts (knows Spy evs); Crypt (pubK' s b) \<lbrace>Nonce (nonce s Na), Agent (agent s a)\<rbrace> \<in> guard (nonce s Na) Ks\<rbrakk> \<Longrightarrow> Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce s Na) Ks
 2. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Nb) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Nb) evs \<subseteq> Ks; Nonce (nonce sa Nb) \<in> used evs; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> guard (nonce sa Nb) Ks; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> parts (knows Spy evs); keys ns2 sa (nonce sa Nb) evs \<subseteq> Ks; n = nonce sa Nb; ok evs ns2 s; nonce sa Nb \<noteq> nonce s Nb; nonce sa Nb \<noteq> nonce s Na\<rbrakk> \<Longrightarrow> Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce sa Nb) Ks
 3. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; bb = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>); k \<in> newn (ab, bb); Nonce n \<in> parts {apm sa (msg bb)}; apm sa (msg bb) \<in> guard n Ks; apm sa (msg bb) \<in> parts (knows Spy evs); keys (ab, bb) sa n evs \<subseteq> Ks; aaa = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; baa = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 4. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply (frule_tac K="pubK' s b" in Crypt_guard_invKey, simp)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce s Na) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce s Na) evs \<subseteq> Ks; Nonce (nonce s Na) \<in> used evs; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce s Na), Agent (agent sa b)\<rbrace> \<in> guard (nonce s Na) Ks; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce s Na), Agent (agent sa b)\<rbrace> \<in> parts (knows Spy evs); keys ns2 sa (nonce s Na) evs \<subseteq> Ks; n = nonce s Na; ok evs ns2 s; nonce s Na \<noteq> nonce s Nb; nonce sa Nb = nonce s Na; Nonce (nonce s Na) \<notin> analz (knows Spy evs); priEK (agent sa a) \<in> Ks; Crypt (pubK' s b) \<lbrace>Nonce (nonce s Na), Agent (agent s a)\<rbrace> \<in> parts (knows Spy evs); Crypt (pubK' s b) \<lbrace>Nonce (nonce s Na), Agent (agent s a)\<rbrace> \<in> guard (nonce s Na) Ks; priEK (agent s b) \<in> Ks\<rbrakk> \<Longrightarrow> Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce s Na) Ks
 2. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Nb) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Nb) evs \<subseteq> Ks; Nonce (nonce sa Nb) \<in> used evs; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> guard (nonce sa Nb) Ks; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> parts (knows Spy evs); keys ns2 sa (nonce sa Nb) evs \<subseteq> Ks; n = nonce sa Nb; ok evs ns2 s; nonce sa Nb \<noteq> nonce s Nb; nonce sa Nb \<noteq> nonce s Na\<rbrakk> \<Longrightarrow> Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce sa Nb) Ks
 3. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; bb = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>); k \<in> newn (ab, bb); Nonce n \<in> parts {apm sa (msg bb)}; apm sa (msg bb) \<in> guard n Ks; apm sa (msg bb) \<in> parts (knows Spy evs); keys (ab, bb) sa n evs \<subseteq> Ks; aaa = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; baa = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 4. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply (frule_tac R=ns2 and R'=ns1 and Ks=Ks and s=sa and s'=s in uniqD, simp+)
[PROOF STATE]
proof (prove)
goal (8 subgoals):
 1. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce s Na) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce s Na) evs \<subseteq> Ks; Nonce (nonce s Na) \<in> used evs; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce s Na), Agent (agent sa b)\<rbrace> \<in> guard (nonce s Na) Ks; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce s Na), Agent (agent sa b)\<rbrace> \<in> parts (knows Spy evs); keys ns2 sa (nonce s Na) evs \<subseteq> Ks; n = nonce s Na; ok evs ns2 s; nonce s Na \<noteq> nonce s Nb; nonce sa Nb = nonce s Na; Nonce (nonce s Na) \<notin> analz (knows Spy evs); priEK (agent sa a) \<in> Ks; Crypt (pubK' s b) \<lbrace>Nonce (nonce s Na), Agent (agent s a)\<rbrace> \<in> parts (knows Spy evs); Crypt (pubK' s b) \<lbrace>Nonce (nonce s Na), Agent (agent s a)\<rbrace> \<in> guard (nonce s Na) Ks; priEK (agent s b) \<in> Ks\<rbrakk> \<Longrightarrow> secret ns2 Nb sa Ks \<in> parts (knows Spy evs)
 2. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce s Na) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce s Na) evs \<subseteq> Ks; Nonce (nonce s Na) \<in> used evs; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce s Na), Agent (agent sa b)\<rbrace> \<in> guard (nonce s Na) Ks; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce s Na), Agent (agent sa b)\<rbrace> \<in> parts (knows Spy evs); keys ns2 sa (nonce s Na) evs \<subseteq> Ks; n = nonce s Na; ok evs ns2 s; nonce s Na \<noteq> nonce s Nb; nonce sa Nb = nonce s Na; Nonce (nonce s Na) \<notin> analz (knows Spy evs); priEK (agent sa a) \<in> Ks; Crypt (pubK' s b) \<lbrace>Nonce (nonce s Na), Agent (agent s a)\<rbrace> \<in> parts (knows Spy evs); Crypt (pubK' s b) \<lbrace>Nonce (nonce s Na), Agent (agent s a)\<rbrace> \<in> guard (nonce s Na) Ks; priEK (agent s b) \<in> Ks\<rbrakk> \<Longrightarrow> secret ns1 Na s Ks \<in> parts (knows Spy evs)
 3. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce s Na) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce s Na) evs \<subseteq> Ks; Nonce (nonce s Na) \<in> used evs; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce s Na), Agent (agent sa b)\<rbrace> \<in> guard (nonce s Na) Ks; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce s Na), Agent (agent sa b)\<rbrace> \<in> parts (knows Spy evs); keys ns2 sa (nonce s Na) evs \<subseteq> Ks; n = nonce s Na; ok evs ns2 s; nonce s Na \<noteq> nonce s Nb; nonce sa Nb = nonce s Na; Nonce (nonce s Na) \<notin> analz (knows Spy evs); priEK (agent sa a) \<in> Ks; Crypt (pubK' s b) \<lbrace>Nonce (nonce s Na), Agent (agent s a)\<rbrace> \<in> parts (knows Spy evs); Crypt (pubK' s b) \<lbrace>Nonce (nonce s Na), Agent (agent s a)\<rbrace> \<in> guard (nonce s Na) Ks; priEK (agent s b) \<in> Ks\<rbrakk> \<Longrightarrow> apm' sa ns2 \<in> guard (nonce sa Nb) Ks
 4. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce s Na) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce s Na) evs \<subseteq> Ks; Nonce (nonce s Na) \<in> used evs; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce s Na), Agent (agent sa b)\<rbrace> \<in> guard (nonce s Na) Ks; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce s Na), Agent (agent sa b)\<rbrace> \<in> parts (knows Spy evs); keys ns2 sa (nonce s Na) evs \<subseteq> Ks; n = nonce s Na; ok evs ns2 s; nonce s Na \<noteq> nonce s Nb; nonce sa Nb = nonce s Na; Nonce (nonce s Na) \<notin> analz (knows Spy evs); priEK (agent sa a) \<in> Ks; Crypt (pubK' s b) \<lbrace>Nonce (nonce s Na), Agent (agent s a)\<rbrace> \<in> parts (knows Spy evs); Crypt (pubK' s b) \<lbrace>Nonce (nonce s Na), Agent (agent s a)\<rbrace> \<in> guard (nonce s Na) Ks; priEK (agent s b) \<in> Ks\<rbrakk> \<Longrightarrow> apm' s ns1 \<in> guard (nonce sa Nb) Ks
 5. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce s Na) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce s Na) evs \<subseteq> Ks; Nonce (nonce s Na) \<in> used evs; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce s Na), Agent (agent sa b)\<rbrace> \<in> guard (nonce s Na) Ks; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce s Na), Agent (agent sa b)\<rbrace> \<in> parts (knows Spy evs); keys ns2 sa (nonce s Na) evs \<subseteq> Ks; n = nonce s Na; ok evs ns2 s; nonce s Na \<noteq> nonce s Nb; nonce sa Nb = nonce s Na; Nonce (nonce s Na) \<notin> analz (knows Spy evs); priEK (agent sa a) \<in> Ks; Crypt (pubK' s b) \<lbrace>Nonce (nonce s Na), Agent (agent s a)\<rbrace> \<in> parts (knows Spy evs); Crypt (pubK' s b) \<lbrace>Nonce (nonce s Na), Agent (agent s a)\<rbrace> \<in> guard (nonce s Na) Ks; priEK (agent s b) \<in> Ks; secret ns2 Nb sa Ks = secret ns1 Na s Ks\<rbrakk> \<Longrightarrow> Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce s Na) Ks
 6. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Nb) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Nb) evs \<subseteq> Ks; Nonce (nonce sa Nb) \<in> used evs; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> guard (nonce sa Nb) Ks; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> parts (knows Spy evs); keys ns2 sa (nonce sa Nb) evs \<subseteq> Ks; n = nonce sa Nb; ok evs ns2 s; nonce sa Nb \<noteq> nonce s Nb; nonce sa Nb \<noteq> nonce s Na\<rbrakk> \<Longrightarrow> Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce sa Nb) Ks
 7. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; bb = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>); k \<in> newn (ab, bb); Nonce n \<in> parts {apm sa (msg bb)}; apm sa (msg bb) \<in> guard n Ks; apm sa (msg bb) \<in> parts (knows Spy evs); keys (ab, bb) sa n evs \<subseteq> Ks; aaa = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; baa = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 8. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply (simp add: secret_def, simp add: secret_def, force, force)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce s Na) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce s Na) evs \<subseteq> Ks; Nonce (nonce s Na) \<in> used evs; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce s Na), Agent (agent sa b)\<rbrace> \<in> guard (nonce s Na) Ks; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce s Na), Agent (agent sa b)\<rbrace> \<in> parts (knows Spy evs); keys ns2 sa (nonce s Na) evs \<subseteq> Ks; n = nonce s Na; ok evs ns2 s; nonce s Na \<noteq> nonce s Nb; nonce sa Nb = nonce s Na; Nonce (nonce s Na) \<notin> analz (knows Spy evs); priEK (agent sa a) \<in> Ks; Crypt (pubK' s b) \<lbrace>Nonce (nonce s Na), Agent (agent s a)\<rbrace> \<in> parts (knows Spy evs); Crypt (pubK' s b) \<lbrace>Nonce (nonce s Na), Agent (agent s a)\<rbrace> \<in> guard (nonce s Na) Ks; priEK (agent s b) \<in> Ks; secret ns2 Nb sa Ks = secret ns1 Na s Ks\<rbrakk> \<Longrightarrow> Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce s Na) Ks
 2. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Nb) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Nb) evs \<subseteq> Ks; Nonce (nonce sa Nb) \<in> used evs; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> guard (nonce sa Nb) Ks; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> parts (knows Spy evs); keys ns2 sa (nonce sa Nb) evs \<subseteq> Ks; n = nonce sa Nb; ok evs ns2 s; nonce sa Nb \<noteq> nonce s Nb; nonce sa Nb \<noteq> nonce s Na\<rbrakk> \<Longrightarrow> Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce sa Nb) Ks
 3. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; bb = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>); k \<in> newn (ab, bb); Nonce n \<in> parts {apm sa (msg bb)}; apm sa (msg bb) \<in> guard n Ks; apm sa (msg bb) \<in> parts (knows Spy evs); keys (ab, bb) sa n evs \<subseteq> Ks; aaa = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; baa = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 4. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply (simp add: secret_def, rule No_Nonce, simp)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a' b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>)}; bb = Says b a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>); k \<in> newn (ab, bb); Nonce n \<in> parts {apm sa (msg bb)}; apm sa (msg bb) \<in> guard n Ks; apm sa (msg bb) \<in> parts (knows Spy evs); keys (ab, bb) sa n evs \<subseteq> Ks; aaa = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; baa = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
 2. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Nb) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Nb) evs \<subseteq> Ks; Nonce (nonce sa Nb) \<in> used evs; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> guard (nonce sa Nb) Ks; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> parts (knows Spy evs); keys ns2 sa (nonce sa Nb) evs \<subseteq> Ks; n = nonce sa Nb; ok evs ns3 s\<rbrakk> \<Longrightarrow> Crypt (pubK' s b) (Nonce (nonce s Nb)) \<in> guard (nonce sa Nb) Ks
 2. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply (case_tac "nonce sa Nb = nonce s Nb")
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Nb) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Nb) evs \<subseteq> Ks; Nonce (nonce sa Nb) \<in> used evs; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> guard (nonce sa Nb) Ks; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> parts (knows Spy evs); keys ns2 sa (nonce sa Nb) evs \<subseteq> Ks; n = nonce sa Nb; ok evs ns3 s; nonce sa Nb = nonce s Nb\<rbrakk> \<Longrightarrow> Crypt (pubK' s b) (Nonce (nonce s Nb)) \<in> guard (nonce sa Nb) Ks
 2. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Nb) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Nb) evs \<subseteq> Ks; Nonce (nonce sa Nb) \<in> used evs; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> guard (nonce sa Nb) Ks; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> parts (knows Spy evs); keys ns2 sa (nonce sa Nb) evs \<subseteq> Ks; n = nonce sa Nb; ok evs ns3 s; nonce sa Nb \<noteq> nonce s Nb\<rbrakk> \<Longrightarrow> Crypt (pubK' s b) (Nonce (nonce s Nb)) \<in> guard (nonce sa Nb) Ks
 3. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply (frule Guard_safe, simp)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Nb) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Nb) evs \<subseteq> Ks; Nonce (nonce sa Nb) \<in> used evs; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> guard (nonce sa Nb) Ks; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> parts (knows Spy evs); keys ns2 sa (nonce sa Nb) evs \<subseteq> Ks; n = nonce sa Nb; ok evs ns3 s; nonce sa Nb = nonce s Nb; Nonce (nonce sa Nb) \<notin> analz (knows Spy evs)\<rbrakk> \<Longrightarrow> Crypt (pubK' s b) (Nonce (nonce s Nb)) \<in> guard (nonce sa Nb) Ks
 2. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Nb) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Nb) evs \<subseteq> Ks; Nonce (nonce sa Nb) \<in> used evs; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> guard (nonce sa Nb) Ks; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> parts (knows Spy evs); keys ns2 sa (nonce sa Nb) evs \<subseteq> Ks; n = nonce sa Nb; ok evs ns3 s; nonce sa Nb \<noteq> nonce s Nb\<rbrakk> \<Longrightarrow> Crypt (pubK' s b) (Nonce (nonce s Nb)) \<in> guard (nonce sa Nb) Ks
 3. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply (frule Crypt_guard_invKey, simp)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Nb) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Nb) evs \<subseteq> Ks; Nonce (nonce sa Nb) \<in> used evs; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> guard (nonce sa Nb) Ks; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> parts (knows Spy evs); keys ns2 sa (nonce sa Nb) evs \<subseteq> Ks; n = nonce sa Nb; ok evs ns3 s; nonce sa Nb = nonce s Nb; Nonce (nonce sa Nb) \<notin> analz (knows Spy evs); priEK (agent sa a) \<in> Ks\<rbrakk> \<Longrightarrow> Crypt (pubK' s b) (Nonce (nonce s Nb)) \<in> guard (nonce sa Nb) Ks
 2. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Nb) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Nb) evs \<subseteq> Ks; Nonce (nonce sa Nb) \<in> used evs; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> guard (nonce sa Nb) Ks; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> parts (knows Spy evs); keys ns2 sa (nonce sa Nb) evs \<subseteq> Ks; n = nonce sa Nb; ok evs ns3 s; nonce sa Nb \<noteq> nonce s Nb\<rbrakk> \<Longrightarrow> Crypt (pubK' s b) (Nonce (nonce s Nb)) \<in> guard (nonce sa Nb) Ks
 3. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply (frule_tac x=ns3b in ok_Guard, simp, simp, simp, clarsimp)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce s Nb) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce s Nb) evs \<subseteq> Ks; Nonce (nonce s Nb) \<in> used evs; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce s Nb), Agent (agent sa b)\<rbrace> \<in> guard (nonce s Nb) Ks; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce s Nb), Agent (agent sa b)\<rbrace> \<in> parts (knows Spy evs); keys ns2 sa (nonce s Nb) evs \<subseteq> Ks; n = nonce s Nb; ok evs ns3 s; nonce sa Nb = nonce s Nb; Nonce (nonce s Nb) \<notin> analz (knows Spy evs); priEK (agent sa a) \<in> Ks; Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> parts (knows Spy evs); Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce s Nb) Ks\<rbrakk> \<Longrightarrow> Crypt (pubK' s b) (Nonce (nonce s Nb)) \<in> guard (nonce s Nb) Ks
 2. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Nb) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Nb) evs \<subseteq> Ks; Nonce (nonce sa Nb) \<in> used evs; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> guard (nonce sa Nb) Ks; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> parts (knows Spy evs); keys ns2 sa (nonce sa Nb) evs \<subseteq> Ks; n = nonce sa Nb; ok evs ns3 s; nonce sa Nb \<noteq> nonce s Nb\<rbrakk> \<Longrightarrow> Crypt (pubK' s b) (Nonce (nonce s Nb)) \<in> guard (nonce sa Nb) Ks
 3. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply (frule_tac K="pubK' s a" in Crypt_guard_invKey, simp)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce s Nb) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce s Nb) evs \<subseteq> Ks; Nonce (nonce s Nb) \<in> used evs; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce s Nb), Agent (agent sa b)\<rbrace> \<in> guard (nonce s Nb) Ks; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce s Nb), Agent (agent sa b)\<rbrace> \<in> parts (knows Spy evs); keys ns2 sa (nonce s Nb) evs \<subseteq> Ks; n = nonce s Nb; ok evs ns3 s; nonce sa Nb = nonce s Nb; Nonce (nonce s Nb) \<notin> analz (knows Spy evs); priEK (agent sa a) \<in> Ks; Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> parts (knows Spy evs); Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce s Nb) Ks; priEK (agent s a) \<in> Ks\<rbrakk> \<Longrightarrow> Crypt (pubK' s b) (Nonce (nonce s Nb)) \<in> guard (nonce s Nb) Ks
 2. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Nb) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Nb) evs \<subseteq> Ks; Nonce (nonce sa Nb) \<in> used evs; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> guard (nonce sa Nb) Ks; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> parts (knows Spy evs); keys ns2 sa (nonce sa Nb) evs \<subseteq> Ks; n = nonce sa Nb; ok evs ns3 s; nonce sa Nb \<noteq> nonce s Nb\<rbrakk> \<Longrightarrow> Crypt (pubK' s b) (Nonce (nonce s Nb)) \<in> guard (nonce sa Nb) Ks
 3. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply (frule_tac R=ns2 and R'=ns2 and Ks=Ks and s=sa and s'=s in uniqD, simp+)
[PROOF STATE]
proof (prove)
goal (7 subgoals):
 1. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce s Nb) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce s Nb) evs \<subseteq> Ks; Nonce (nonce s Nb) \<in> used evs; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce s Nb), Agent (agent sa b)\<rbrace> \<in> guard (nonce s Nb) Ks; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce s Nb), Agent (agent sa b)\<rbrace> \<in> parts (knows Spy evs); keys ns2 sa (nonce s Nb) evs \<subseteq> Ks; n = nonce s Nb; ok evs ns3 s; nonce sa Nb = nonce s Nb; Nonce (nonce s Nb) \<notin> analz (knows Spy evs); priEK (agent sa a) \<in> Ks; Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> parts (knows Spy evs); Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce s Nb) Ks; priEK (agent s a) \<in> Ks\<rbrakk> \<Longrightarrow> secret ns2 Nb sa Ks \<in> parts (knows Spy evs)
 2. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce s Nb) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce s Nb) evs \<subseteq> Ks; Nonce (nonce s Nb) \<in> used evs; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce s Nb), Agent (agent sa b)\<rbrace> \<in> guard (nonce s Nb) Ks; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce s Nb), Agent (agent sa b)\<rbrace> \<in> parts (knows Spy evs); keys ns2 sa (nonce s Nb) evs \<subseteq> Ks; n = nonce s Nb; ok evs ns3 s; nonce sa Nb = nonce s Nb; Nonce (nonce s Nb) \<notin> analz (knows Spy evs); priEK (agent sa a) \<in> Ks; Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> parts (knows Spy evs); Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce s Nb) Ks; priEK (agent s a) \<in> Ks\<rbrakk> \<Longrightarrow> secret ns2 Nb s Ks \<in> parts (knows Spy evs)
 3. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce s Nb) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce s Nb) evs \<subseteq> Ks; Nonce (nonce s Nb) \<in> used evs; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce s Nb), Agent (agent sa b)\<rbrace> \<in> guard (nonce s Nb) Ks; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce s Nb), Agent (agent sa b)\<rbrace> \<in> parts (knows Spy evs); keys ns2 sa (nonce s Nb) evs \<subseteq> Ks; n = nonce s Nb; ok evs ns3 s; nonce sa Nb = nonce s Nb; Nonce (nonce s Nb) \<notin> analz (knows Spy evs); priEK (agent sa a) \<in> Ks; Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> parts (knows Spy evs); Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce s Nb) Ks; priEK (agent s a) \<in> Ks\<rbrakk> \<Longrightarrow> apm' sa ns2 \<in> guard (nonce sa Nb) Ks
 4. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce s Nb) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce s Nb) evs \<subseteq> Ks; Nonce (nonce s Nb) \<in> used evs; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce s Nb), Agent (agent sa b)\<rbrace> \<in> guard (nonce s Nb) Ks; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce s Nb), Agent (agent sa b)\<rbrace> \<in> parts (knows Spy evs); keys ns2 sa (nonce s Nb) evs \<subseteq> Ks; n = nonce s Nb; ok evs ns3 s; nonce sa Nb = nonce s Nb; Nonce (nonce s Nb) \<notin> analz (knows Spy evs); priEK (agent sa a) \<in> Ks; Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> parts (knows Spy evs); Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce s Nb) Ks; priEK (agent s a) \<in> Ks\<rbrakk> \<Longrightarrow> apm' s ns2 \<in> guard (nonce sa Nb) Ks
 5. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce s Nb) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce s Nb) evs \<subseteq> Ks; Nonce (nonce s Nb) \<in> used evs; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce s Nb), Agent (agent sa b)\<rbrace> \<in> guard (nonce s Nb) Ks; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce s Nb), Agent (agent sa b)\<rbrace> \<in> parts (knows Spy evs); keys ns2 sa (nonce s Nb) evs \<subseteq> Ks; n = nonce s Nb; ok evs ns3 s; nonce sa Nb = nonce s Nb; Nonce (nonce s Nb) \<notin> analz (knows Spy evs); priEK (agent sa a) \<in> Ks; Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> parts (knows Spy evs); Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce s Nb) Ks; priEK (agent s a) \<in> Ks; secret ns2 Nb sa Ks = secret ns2 Nb s Ks\<rbrakk> \<Longrightarrow> Crypt (pubK' s b) (Nonce (nonce s Nb)) \<in> guard (nonce s Nb) Ks
 6. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Nb) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Nb) evs \<subseteq> Ks; Nonce (nonce sa Nb) \<in> used evs; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> guard (nonce sa Nb) Ks; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> parts (knows Spy evs); keys ns2 sa (nonce sa Nb) evs \<subseteq> Ks; n = nonce sa Nb; ok evs ns3 s; nonce sa Nb \<noteq> nonce s Nb\<rbrakk> \<Longrightarrow> Crypt (pubK' s b) (Nonce (nonce s Nb)) \<in> guard (nonce sa Nb) Ks
 7. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply (simp add: secret_def, simp add: secret_def, force, force)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce s Nb) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce s Nb) evs \<subseteq> Ks; Nonce (nonce s Nb) \<in> used evs; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce s Nb), Agent (agent sa b)\<rbrace> \<in> guard (nonce s Nb) Ks; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce s Nb), Agent (agent sa b)\<rbrace> \<in> parts (knows Spy evs); keys ns2 sa (nonce s Nb) evs \<subseteq> Ks; n = nonce s Nb; ok evs ns3 s; nonce sa Nb = nonce s Nb; Nonce (nonce s Nb) \<notin> analz (knows Spy evs); priEK (agent sa a) \<in> Ks; Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> parts (knows Spy evs); Crypt (pubK' s a) \<lbrace>Nonce (nonce s Na), Nonce (nonce s Nb), Agent (agent s b)\<rbrace> \<in> guard (nonce s Nb) Ks; priEK (agent s a) \<in> Ks; secret ns2 Nb sa Ks = secret ns2 Nb s Ks\<rbrakk> \<Longrightarrow> Crypt (pubK' s b) (Nonce (nonce s Nb)) \<in> guard (nonce s Nb) Ks
 2. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Nb) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Nb) evs \<subseteq> Ks; Nonce (nonce sa Nb) \<in> used evs; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> guard (nonce sa Nb) Ks; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> parts (knows Spy evs); keys ns2 sa (nonce sa Nb) evs \<subseteq> Ks; n = nonce sa Nb; ok evs ns3 s; nonce sa Nb \<noteq> nonce s Nb\<rbrakk> \<Longrightarrow> Crypt (pubK' s b) (Nonce (nonce s Nb)) \<in> guard (nonce sa Nb) Ks
 3. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply (simp add: secret_def keys_def, blast)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>evs aa ba s' s sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard (nonce sa Nb) Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' (nonce sa Nb) evs \<subseteq> Ks; Nonce (nonce sa Nb) \<in> used evs; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> guard (nonce sa Nb) Ks; Crypt (pubK' sa a) \<lbrace>Nonce (nonce sa Na), Nonce (nonce sa Nb), Agent (agent sa b)\<rbrace> \<in> parts (knows Spy evs); keys ns2 sa (nonce sa Nb) evs \<subseteq> Ks; n = nonce sa Nb; ok evs ns3 s; nonce sa Nb \<noteq> nonce s Nb\<rbrakk> \<Longrightarrow> Crypt (pubK' s b) (Nonce (nonce s Nb)) \<in> guard (nonce sa Nb) Ks
 2. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
apply (rule No_Nonce, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>evs aa ba s' aaa baa s ab bb k sa. \<lbrakk>uniq ns secret; evs \<in> tr ns; Guard n Ks (knows Spy evs); safe Ks (knows Spy evs); keys (aa, ba) s' n evs \<subseteq> Ks; nonce sa k = n; Nonce n \<in> used evs; ab = {Says a b (Crypt (pubK b) \<lbrace>Nonce Na, Agent a\<rbrace>), Says b' a (Crypt (pubK a) \<lbrace>Nonce Na, Nonce Nb, Agent b\<rbrace>)}; bb = Says a b (Crypt (pubK b) (Nonce Nb))\<rbrakk> \<Longrightarrow> k \<in> newn (ab, bb) \<longrightarrow> Nonce n \<in> parts {apm sa (msg bb)} \<longrightarrow> apm sa (msg bb) \<in> guard n Ks \<longrightarrow> apm sa (msg bb) \<in> parts (knows Spy evs) \<longrightarrow> keys (ab, bb) sa n evs \<subseteq> Ks \<longrightarrow> (aaa, baa) \<in> ns \<longrightarrow> ok evs (aaa, baa) s \<longrightarrow> apm s (msg baa) \<in> guard n Ks
[PROOF STEP]
by simp