induct: fixes x1 :: "event list"   and x2 :: "agent \<times> nat \<times> nat \<Rightarrow> session"   and x3 :: "msg set"   and x4 :: "msg set"   and P :: "event list \<Rightarrow> (agent \<times> nat \<times> nat \<Rightarrow> session) \<Rightarrow> msg set \<Rightarrow> msg set \<Rightarrow> bool" assumes "(x1, x2, x3, x4) \<in> protocol"   and "P [] start_S start_A start_U"   and "\<And>evsR1 S A U s n run m. \<lbrakk>(evsR1, S, A, U) \<in> protocol; P evsR1 S A U; Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card n, n, run)) = None\<rbrakk> \<Longrightarrow> P (Says n run 1 (Card n) (User m) (Crypt (symK n) (Pri_AgrK s)) # evsR1) (S((Card n, n, run) := S (Card n, n, run)\<lparr>NonceS := Some s\<rparr>)) (if n \<in> bad then insert (Pri_AgrK s) A else A) (insert (Pri_AgrK s) U)"   and "\<And>evsFR1 S A U m s n run. \<lbrakk>(evsFR1, S, A, U) \<in> protocol; P evsFR1 S A U; User m \<noteq> Spy; s \<noteq> 0; Crypt (symK m) (Pri_AgrK s) \<in> synth (analz (A \<union> spies evsFR1))\<rbrakk> \<Longrightarrow> P (Says n run 1 Spy (User m) (Crypt (symK m) (Pri_AgrK s)) # evsFR1) S A U"   and "\<And>evsC2 S A U a m n run X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; P evsC2 S A U; Pri_AgrK a \<notin> U; NonceS (S (User m, n, run)) = None; Says n run 1 X (User m) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK m then s else 0)\<rbrakk> \<Longrightarrow> P (Says n run 2 (User m) (Card n) (pubAK a) # evsC2) (S((User m, n, run) := S (User m, n, run)\<lparr>NonceS := Some s', IntMapK := Some a\<rparr>)) (if User m = Spy then insert (Pri_AgrK a) A else A) (insert (Pri_AgrK a) U)"   and "\<And>evsFC2 S A U a n run. \<lbrakk>(evsFC2, S, A, U) \<in> protocol; P evsFC2 S A U; Pri_AgrK a \<in> analz (A \<union> spies evsFC2)\<rbrakk> \<Longrightarrow> P (Says n run 2 Spy (Card n) (pubAK a) # evsFC2) S A U"   and "\<And>evsR2 S A U b n run X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; P evsR2 S A U; Pri_AgrK b \<notin> U; NonceS (S (Card n, n, run)) \<noteq> None; IntMapK (S (Card n, n, run)) = None; Says n run 2 X (Card n) (pubAK a) \<in> set evsR2\<rbrakk> \<Longrightarrow> P (Says n run 2 (Card n) X (pubAK b) # evsR2) (S((Card n, n, run) := S (Card n, n, run)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) A (insert (Pri_AgrK b) U)"   and "\<And>evsFR2 S A U m b n run. \<lbrakk>(evsFR2, S, A, U) \<in> protocol; P evsFR2 S A U; User m \<noteq> Spy; Pri_AgrK b \<in> analz (A \<union> spies evsFR2)\<rbrakk> \<Longrightarrow> P (Says n run 2 Spy (User m) (pubAK b) # evsFR2) S A U"   and "\<And>evsC3 S A U c m n run s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; P evsC3 S A U; Pri_AgrK c \<notin> U; NonceS (S (User m, n, run)) = Some s; IntMapK (S (User m, n, run)) = Some a; ExtMapK (S (User m, n, run)) = None; Says n run 2 X (User m) (pubAK b) \<in> set evsC3; c * (s + a * b) \<noteq> 0\<rbrakk> \<Longrightarrow> P (Says n run 3 (User m) (Card n) (pubAK (c * (s + a * b))) # evsC3) (S((User m, n, run) := S (User m, n, run)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (if User m = Spy then insert (Pri_AgrK c) A else A) (insert (Pri_AgrK c) U)"   and "\<And>evsFC3 S A U n run s b a c. \<lbrakk>(evsFC3, S, A, U) \<in> protocol; P evsFC3 S A U; NonceS (S (Card n, n, run)) = Some s; IntMapK (S (Card n, n, run)) = Some b; ExtMapK (S (Card n, n, run)) = Some a; {Pri_AgrK s, Pri_AgrK a, Pri_AgrK c} \<subseteq> analz (A \<union> spies evsFC3)\<rbrakk> \<Longrightarrow> P (Says n run 3 Spy (Card n) (pubAK (c * (s + a * b))) # evsFC3) S A U"   and "\<And>evsR3 S A U d n run s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; P evsR3 S A U; Pri_AgrK d \<notin> U; NonceS (S (Card n, n, run)) = Some s; IntMapK (S (Card n, n, run)) = Some b; ExtMapK (S (Card n, n, run)) = Some a; IntAgrK (S (Card n, n, run)) = None; Says n run 3 X (Card n) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d * (s + a * b) \<noteq> 0\<rbrakk> \<Longrightarrow> P (Says n run 3 (Card n) X (pubAK (d * (s + a * b))) # evsR3) (S((Card n, n, run) := S (Card n, n, run)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (if s' = s \<and> Pri_AgrK c \<in> analz (A \<union> spies evsR3) then insert (Key (sesK (c * d * (s + a * b)))) A else A) ({Pri_AgrK d, Key (sesK (c * d * (s' + a * b))), Key (sesK (c * d * (s + a * b))), \<lbrace>Key (sesK (c * d * (s + a * b))), Agent X, Number n, Number run\<rbrace>} \<union> U)"   and "\<And>evsFR3 S A U m n run s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; P evsFR3 S A U; User m \<noteq> Spy; NonceS (S (User m, n, run)) = Some s; IntMapK (S (User m, n, run)) = Some a; ExtMapK (S (User m, n, run)) = Some b; IntAgrK (S (User m, n, run)) = Some c; {Pri_AgrK s, Pri_AgrK b, Pri_AgrK d} \<subseteq> analz (A \<union> spies evsFR3); Key (sesK (c * d * (s + a * b))) \<notin> U\<rbrakk> \<Longrightarrow> P (Says n run 3 Spy (User m) (pubAK (d * (s + a * b))) # evsFR3) S (insert (Key (sesK (c * d * (s + a * b)))) A) ({Key (sesK (c * d * (s + a * b))), \<lbrace>Key (sesK (c * d * (s + a * b))), Agent (User m), Number n, Number run\<rbrace>} \<union> U)"   and "\<And>evsC4 S A U m n run c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; P evsC4 S A U; IntAgrK (S (User m, n, run)) = Some c; ExtAgrK (S (User m, n, run)) = None; Says n run 3 X (User m) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User m), Number n, Number run\<rbrace> \<in> U\<rbrakk> \<Longrightarrow> P (Says n run 4 (User m) (Card n) (Crypt (sesK (c * f)) (pubAK f)) # evsC4) (S((User m, n, run) := S (User m, n, run)\<lparr>ExtAgrK := Some f\<rparr>)) A U"   and "\<And>evsFC4 S A U n run s b a d e. \<lbrakk>(evsFC4, S, A, U) \<in> protocol; P evsFC4 S A U; NonceS (S (Card n, n, run)) = Some s; IntMapK (S (Card n, n, run)) = Some b; ExtMapK (S (Card n, n, run)) = Some a; IntAgrK (S (Card n, n, run)) = Some d; ExtAgrK (S (Card n, n, run)) = Some e; Crypt (sesK (d * e)) (pubAK (d * (s + a * b))) \<in> synth (analz (A \<union> spies evsFC4))\<rbrakk> \<Longrightarrow> P (Says n run 4 Spy (Card n) (Crypt (sesK (d * e)) (pubAK (d * (s + a * b)))) # evsFC4) S A U"   and "\<And>evsR4 S A U n run s b a d e X. \<lbrakk>(evsR4, S, A, U) \<in> protocol; P evsR4 S A U; NonceS (S (Card n, n, run)) = Some s; IntMapK (S (Card n, n, run)) = Some b; ExtMapK (S (Card n, n, run)) = Some a; IntAgrK (S (Card n, n, run)) = Some d; ExtAgrK (S (Card n, n, run)) = Some e; Says n run 4 X (Card n) (Crypt (sesK (d * e)) (pubAK (d * (s + a * b)))) \<in> set evsR4\<rbrakk> \<Longrightarrow> P (Says n run 4 (Card n) X (Crypt (sesK (d * e)) \<lbrace>pubAK e, Auth_Data (priAK n) b, pubAK (priAK n), Crypt (priSK CA) (Hash (pubAK (priAK n)))\<rbrace>) # evsR4) S A U"   and "\<And>evsFR4 S A U m n run s a b c f g. \<lbrakk>(evsFR4, S, A, U) \<in> protocol; P evsFR4 S A U; User m \<noteq> Spy; NonceS (S (User m, n, run)) = Some s; IntMapK (S (User m, n, run)) = Some a; ExtMapK (S (User m, n, run)) = Some b; IntAgrK (S (User m, n, run)) = Some c; ExtAgrK (S (User m, n, run)) = Some f; Crypt (sesK (c * f)) \<lbrace>pubAK (c * (s + a * b)), Auth_Data g b, pubAK g, Crypt (priSK CA) (Hash (pubAK g))\<rbrace> \<in> synth (analz (A \<union> spies evsFR4))\<rbrakk> \<Longrightarrow> P (Says n run 4 Spy (User m) (Crypt (sesK (c * f)) \<lbrace>pubAK (c * (s + a * b)), Auth_Data g b, pubAK g, Crypt (priSK CA) (Hash (pubAK g))\<rbrace>) # evsFR4) S A U"   and "\<And>evsC5 S A U m n run s a b c f X g. \<lbrakk>(evsC5, S, A, U) \<in> protocol; P evsC5 S A U; NonceS (S (User m, n, run)) = Some s; IntMapK (S (User m, n, run)) = Some a; ExtMapK (S (User m, n, run)) = Some b; IntAgrK (S (User m, n, run)) = Some c; ExtAgrK (S (User m, n, run)) = Some f; Says n run 4 X (User m) (Crypt (sesK (c * f)) \<lbrace>pubAK (c * (s + a * b)), Auth_Data g b, pubAK g, Crypt (priSK CA) (Hash (pubAK g))\<rbrace>) \<in> set evsC5\<rbrakk> \<Longrightarrow> P (Says n run 5 (User m) (Card n) (Crypt (sesK (c * f)) (Passwd m)) # evsC5) S A U"   and "\<And>evsFC5 S A U n run d e. \<lbrakk>(evsFC5, S, A, U) \<in> protocol; P evsFC5 S A U; IntAgrK (S (Card n, n, run)) = Some d; ExtAgrK (S (Card n, n, run)) = Some e; Crypt (sesK (d * e)) (Passwd n) \<in> synth (analz (A \<union> spies evsFC5))\<rbrakk> \<Longrightarrow> P (Says n run 5 Spy (Card n) (Crypt (sesK (d * e)) (Passwd n)) # evsFC5) S A U"   and "\<And>evsR5 S A U n run d e X. \<lbrakk>(evsR5, S, A, U) \<in> protocol; P evsR5 S A U; IntAgrK (S (Card n, n, run)) = Some d; ExtAgrK (S (Card n, n, run)) = Some e; Says n run 5 X (Card n) (Crypt (sesK (d * e)) (Passwd n)) \<in> set evsR5\<rbrakk> \<Longrightarrow> P (Says n run 5 (Card n) X (Crypt (sesK (d * e)) (Number 0)) # evsR5) S A U"   and "\<And>evsFR5 S A U m n run c f. \<lbrakk>(evsFR5, S, A, U) \<in> protocol; P evsFR5 S A U; User m \<noteq> Spy; IntAgrK (S (User m, n, run)) = Some c; ExtAgrK (S (User m, n, run)) = Some f; Crypt (sesK (c * f)) (Number 0) \<in> synth (analz (A \<union> spies evsFR5))\<rbrakk> \<Longrightarrow> P (Says n run 5 Spy (User m) (Crypt (sesK (c * f)) (Number 0)) # evsFR5) S A U" shows "P x1 x2 x3 x4"