[STATEMENT]
lemma l3_dy_refines_dy_fake_msg_dy_fake_chan_skip:
   "{R23s \<inter> UNIV \<times> (l3_inv5 \<inter> l3_inv6 \<inter> l3_inv7 \<inter> l3_inv8 \<inter> l3_inv9)}
      l2_dy_fake_msg M \<union> (\<Union>M'. l2_dy_fake_chan M') \<union> Id, l3_dy M
    {>R23s}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {R23s \<inter> UNIV \<times> (l3_inv5 \<inter> l3_inv6 \<inter> l3_inv7 \<inter> l3_inv8 \<inter> l3_inv9)} (l2_dy_fake_msg M \<union> \<Union> (range l2_dy_fake_chan))\<^sup>=, l3_dy M {> R23s}
[PROOF STEP]
by (cases "M \<in> payload \<union> valid \<union> range LtK")
   (auto dest: l3_dy_payload_refines_dy_fake_msg l3_dy_valid_refines_dy_fake_chan_Un
         intro: l3_dy_isLtKey_refines_skip dest!: l3_dy_others_refines_skip)


[STATEMENT]
lemma "xs @ [] = ys @ []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs @ [] = ys @ []
[PROOF STEP]
refute [expect = potential]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs @ [] = ys @ []
[PROOF STEP]
oops


[STATEMENT]
lemma "(\<exists>x. P x) \<longrightarrow> (\<exists>!x. P x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x. P x) \<longrightarrow> (\<exists>!x. P x)
[PROOF STEP]
quickcheck[random, expect = counterexample]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x. P x) \<longrightarrow> (\<exists>!x. P x)
[PROOF STEP]
quickcheck[expect = counterexample]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x. P x) \<longrightarrow> (\<exists>!x. P x)
[PROOF STEP]
oops


[STATEMENT]
theorem (in constructive_security) lifting:
  assumes WT_conv [WT_intro]: "\<And>\<eta>. \<I>_common' \<eta>, \<I>_common \<eta> \<turnstile>\<^sub>C conv \<eta> \<surd>"
    and bound [interaction_bound]: "\<And>\<eta>. interaction_any_bounded_converter (conv \<eta>) (bound_conv \<eta>)"
    and bound_le: "\<And>\<eta>. bound' \<eta> * max (bound_conv \<eta>) 1 \<le> bound \<eta>"
    and lossless [plossless_intro]: "\<And>\<eta>. lossless \<Longrightarrow> plossless_converter (\<I>_common' \<eta>) (\<I>_common \<eta>) (conv \<eta>)"
  shows "constructive_security
     (\<lambda>\<eta>. 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>) (\<lambda>\<eta>. 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) sim
     \<I>_real \<I>_ideal \<I>_common' bound' lossless w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. constructive_security (\<lambda>\<eta>. 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>) (\<lambda>\<eta>. 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) sim \<I>_real \<I>_ideal \<I>_common' bound' lossless w
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. \<And>\<eta>. \<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>res 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta> \<surd>
 2. \<And>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>res 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta> \<surd>
 3. \<And>\<eta>. \<I>_real \<eta>, \<I>_ideal \<eta> \<turnstile>\<^sub>C sim \<eta> \<surd>
 4. \<And>\<A>. \<lbrakk>\<And>\<eta>. \<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<A> \<eta> \<surd>; \<And>\<eta>. interaction_any_bounded_by (\<A> \<eta>) (bound' \<eta>); \<And>\<eta>. lossless \<Longrightarrow> plossless_gpv (\<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<A> \<eta>)\<rbrakk> \<Longrightarrow> Negligible.negligible (\<lambda>\<eta>. advantage (\<A> \<eta>) (sim \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))
 5. \<exists>cnv. \<forall>\<D>. (\<forall>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<D> \<eta> \<surd>) \<longrightarrow> (\<forall>\<eta>. interaction_any_bounded_by (\<D> \<eta>) (bound' \<eta>)) \<longrightarrow> (\<forall>\<eta>. lossless \<longrightarrow> plossless_gpv (\<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<D> \<eta>)) \<longrightarrow> (\<forall>\<eta>. wiring (\<I>_ideal \<eta>) (\<I>_real \<eta>) (cnv \<eta>) (w \<eta>)) \<and> Negligible.negligible (\<lambda>\<eta>. advantage (\<D> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))
[PROOF STEP]
fix \<A> :: "security \<Rightarrow> ('a + 'g, 'b + 'h) distinguisher"
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. \<And>\<eta>. \<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>res 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta> \<surd>
 2. \<And>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>res 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta> \<surd>
 3. \<And>\<eta>. \<I>_real \<eta>, \<I>_ideal \<eta> \<turnstile>\<^sub>C sim \<eta> \<surd>
 4. \<And>\<A>. \<lbrakk>\<And>\<eta>. \<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<A> \<eta> \<surd>; \<And>\<eta>. interaction_any_bounded_by (\<A> \<eta>) (bound' \<eta>); \<And>\<eta>. lossless \<Longrightarrow> plossless_gpv (\<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<A> \<eta>)\<rbrakk> \<Longrightarrow> Negligible.negligible (\<lambda>\<eta>. advantage (\<A> \<eta>) (sim \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))
 5. \<exists>cnv. \<forall>\<D>. (\<forall>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<D> \<eta> \<surd>) \<longrightarrow> (\<forall>\<eta>. interaction_any_bounded_by (\<D> \<eta>) (bound' \<eta>)) \<longrightarrow> (\<forall>\<eta>. lossless \<longrightarrow> plossless_gpv (\<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<D> \<eta>)) \<longrightarrow> (\<forall>\<eta>. wiring (\<I>_ideal \<eta>) (\<I>_real \<eta>) (cnv \<eta>) (w \<eta>)) \<and> Negligible.negligible (\<lambda>\<eta>. advantage (\<D> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))
[PROOF STEP]
assume WT_\<A> [WT_intro]: "\<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<A> \<eta> \<surd>" for \<eta>
[PROOF STATE]
proof (state)
this:
\<I>_real ?\<eta> \<oplus>\<^sub>\<I> \<I>_common' ?\<eta> \<turnstile>g \<A> ?\<eta> \<surd>

goal (5 subgoals):
 1. \<And>\<eta>. \<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>res 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta> \<surd>
 2. \<And>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>res 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta> \<surd>
 3. \<And>\<eta>. \<I>_real \<eta>, \<I>_ideal \<eta> \<turnstile>\<^sub>C sim \<eta> \<surd>
 4. \<And>\<A>. \<lbrakk>\<And>\<eta>. \<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<A> \<eta> \<surd>; \<And>\<eta>. interaction_any_bounded_by (\<A> \<eta>) (bound' \<eta>); \<And>\<eta>. lossless \<Longrightarrow> plossless_gpv (\<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<A> \<eta>)\<rbrakk> \<Longrightarrow> Negligible.negligible (\<lambda>\<eta>. advantage (\<A> \<eta>) (sim \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))
 5. \<exists>cnv. \<forall>\<D>. (\<forall>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<D> \<eta> \<surd>) \<longrightarrow> (\<forall>\<eta>. interaction_any_bounded_by (\<D> \<eta>) (bound' \<eta>)) \<longrightarrow> (\<forall>\<eta>. lossless \<longrightarrow> plossless_gpv (\<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<D> \<eta>)) \<longrightarrow> (\<forall>\<eta>. wiring (\<I>_ideal \<eta>) (\<I>_real \<eta>) (cnv \<eta>) (w \<eta>)) \<and> Negligible.negligible (\<lambda>\<eta>. advantage (\<D> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))
[PROOF STEP]
assume bound_\<A> [interaction_bound]: "interaction_any_bounded_by (\<A> \<eta>) (bound' \<eta>)" for \<eta>
[PROOF STATE]
proof (state)
this:
interaction_any_bounded_by (\<A> ?\<eta>) (bound' ?\<eta>)

goal (5 subgoals):
 1. \<And>\<eta>. \<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>res 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta> \<surd>
 2. \<And>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>res 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta> \<surd>
 3. \<And>\<eta>. \<I>_real \<eta>, \<I>_ideal \<eta> \<turnstile>\<^sub>C sim \<eta> \<surd>
 4. \<And>\<A>. \<lbrakk>\<And>\<eta>. \<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<A> \<eta> \<surd>; \<And>\<eta>. interaction_any_bounded_by (\<A> \<eta>) (bound' \<eta>); \<And>\<eta>. lossless \<Longrightarrow> plossless_gpv (\<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<A> \<eta>)\<rbrakk> \<Longrightarrow> Negligible.negligible (\<lambda>\<eta>. advantage (\<A> \<eta>) (sim \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))
 5. \<exists>cnv. \<forall>\<D>. (\<forall>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<D> \<eta> \<surd>) \<longrightarrow> (\<forall>\<eta>. interaction_any_bounded_by (\<D> \<eta>) (bound' \<eta>)) \<longrightarrow> (\<forall>\<eta>. lossless \<longrightarrow> plossless_gpv (\<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<D> \<eta>)) \<longrightarrow> (\<forall>\<eta>. wiring (\<I>_ideal \<eta>) (\<I>_real \<eta>) (cnv \<eta>) (w \<eta>)) \<and> Negligible.negligible (\<lambda>\<eta>. advantage (\<D> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))
[PROOF STEP]
assume lossless_\<A> [plossless_intro]: "lossless \<Longrightarrow> plossless_gpv (\<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<A> \<eta>)" for \<eta>
[PROOF STATE]
proof (state)
this:
lossless \<Longrightarrow> plossless_gpv (\<I>_real ?\<eta> \<oplus>\<^sub>\<I> \<I>_common' ?\<eta>) (\<A> ?\<eta>)

goal (5 subgoals):
 1. \<And>\<eta>. \<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>res 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta> \<surd>
 2. \<And>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>res 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta> \<surd>
 3. \<And>\<eta>. \<I>_real \<eta>, \<I>_ideal \<eta> \<turnstile>\<^sub>C sim \<eta> \<surd>
 4. \<And>\<A>. \<lbrakk>\<And>\<eta>. \<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<A> \<eta> \<surd>; \<And>\<eta>. interaction_any_bounded_by (\<A> \<eta>) (bound' \<eta>); \<And>\<eta>. lossless \<Longrightarrow> plossless_gpv (\<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<A> \<eta>)\<rbrakk> \<Longrightarrow> Negligible.negligible (\<lambda>\<eta>. advantage (\<A> \<eta>) (sim \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))
 5. \<exists>cnv. \<forall>\<D>. (\<forall>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<D> \<eta> \<surd>) \<longrightarrow> (\<forall>\<eta>. interaction_any_bounded_by (\<D> \<eta>) (bound' \<eta>)) \<longrightarrow> (\<forall>\<eta>. lossless \<longrightarrow> plossless_gpv (\<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<D> \<eta>)) \<longrightarrow> (\<forall>\<eta>. wiring (\<I>_ideal \<eta>) (\<I>_real \<eta>) (cnv \<eta>) (w \<eta>)) \<and> Negligible.negligible (\<lambda>\<eta>. advantage (\<D> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))
[PROOF STEP]
let ?\<A> = "\<lambda>\<eta>. absorb (\<A> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta>)"
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. \<And>\<eta>. \<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>res 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta> \<surd>
 2. \<And>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>res 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta> \<surd>
 3. \<And>\<eta>. \<I>_real \<eta>, \<I>_ideal \<eta> \<turnstile>\<^sub>C sim \<eta> \<surd>
 4. \<And>\<A>. \<lbrakk>\<And>\<eta>. \<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<A> \<eta> \<surd>; \<And>\<eta>. interaction_any_bounded_by (\<A> \<eta>) (bound' \<eta>); \<And>\<eta>. lossless \<Longrightarrow> plossless_gpv (\<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<A> \<eta>)\<rbrakk> \<Longrightarrow> Negligible.negligible (\<lambda>\<eta>. advantage (\<A> \<eta>) (sim \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))
 5. \<exists>cnv. \<forall>\<D>. (\<forall>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<D> \<eta> \<surd>) \<longrightarrow> (\<forall>\<eta>. interaction_any_bounded_by (\<D> \<eta>) (bound' \<eta>)) \<longrightarrow> (\<forall>\<eta>. lossless \<longrightarrow> plossless_gpv (\<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<D> \<eta>)) \<longrightarrow> (\<forall>\<eta>. wiring (\<I>_ideal \<eta>) (\<I>_real \<eta>) (cnv \<eta>) (w \<eta>)) \<and> Negligible.negligible (\<lambda>\<eta>. advantage (\<D> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))
[PROOF STEP]
have ideal: "connect (\<A> \<eta>) (sim \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) = connect (?\<A> \<eta>) (sim \<eta> |\<^sub>= 1\<^sub>C \<rhd> ideal_resource \<eta>)" for \<eta>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connect (\<A> \<eta>) (sim \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) = connect (absorb (\<A> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta>)) (sim \<eta> |\<^sub>= 1\<^sub>C \<rhd> ideal_resource \<eta>)
[PROOF STEP]
by(simp add: distinguish_attach[symmetric] attach_compose[symmetric] comp_converter_parallel2 comp_converter_id_left comp_converter_id_right)
[PROOF STATE]
proof (state)
this:
connect (\<A> ?\<eta>) (sim ?\<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv ?\<eta> \<rhd> ideal_resource ?\<eta>) = connect (absorb (\<A> ?\<eta>) (1\<^sub>C |\<^sub>= conv ?\<eta>)) (sim ?\<eta> |\<^sub>= 1\<^sub>C \<rhd> ideal_resource ?\<eta>)

goal (5 subgoals):
 1. \<And>\<eta>. \<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>res 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta> \<surd>
 2. \<And>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>res 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta> \<surd>
 3. \<And>\<eta>. \<I>_real \<eta>, \<I>_ideal \<eta> \<turnstile>\<^sub>C sim \<eta> \<surd>
 4. \<And>\<A>. \<lbrakk>\<And>\<eta>. \<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<A> \<eta> \<surd>; \<And>\<eta>. interaction_any_bounded_by (\<A> \<eta>) (bound' \<eta>); \<And>\<eta>. lossless \<Longrightarrow> plossless_gpv (\<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<A> \<eta>)\<rbrakk> \<Longrightarrow> Negligible.negligible (\<lambda>\<eta>. advantage (\<A> \<eta>) (sim \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))
 5. \<exists>cnv. \<forall>\<D>. (\<forall>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<D> \<eta> \<surd>) \<longrightarrow> (\<forall>\<eta>. interaction_any_bounded_by (\<D> \<eta>) (bound' \<eta>)) \<longrightarrow> (\<forall>\<eta>. lossless \<longrightarrow> plossless_gpv (\<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<D> \<eta>)) \<longrightarrow> (\<forall>\<eta>. wiring (\<I>_ideal \<eta>) (\<I>_real \<eta>) (cnv \<eta>) (w \<eta>)) \<and> Negligible.negligible (\<lambda>\<eta>. advantage (\<D> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))
[PROOF STEP]
have real: "connect (\<A> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>) = connect (?\<A> \<eta>) (real_resource \<eta>)" for \<eta>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connect (\<A> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>) = connect (absorb (\<A> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta>)) (real_resource \<eta>)
[PROOF STEP]
by(simp add: distinguish_attach[symmetric])
[PROOF STATE]
proof (state)
this:
connect (\<A> ?\<eta>) (1\<^sub>C |\<^sub>= conv ?\<eta> \<rhd> real_resource ?\<eta>) = connect (absorb (\<A> ?\<eta>) (1\<^sub>C |\<^sub>= conv ?\<eta>)) (real_resource ?\<eta>)

goal (5 subgoals):
 1. \<And>\<eta>. \<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>res 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta> \<surd>
 2. \<And>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>res 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta> \<surd>
 3. \<And>\<eta>. \<I>_real \<eta>, \<I>_ideal \<eta> \<turnstile>\<^sub>C sim \<eta> \<surd>
 4. \<And>\<A>. \<lbrakk>\<And>\<eta>. \<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<A> \<eta> \<surd>; \<And>\<eta>. interaction_any_bounded_by (\<A> \<eta>) (bound' \<eta>); \<And>\<eta>. lossless \<Longrightarrow> plossless_gpv (\<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<A> \<eta>)\<rbrakk> \<Longrightarrow> Negligible.negligible (\<lambda>\<eta>. advantage (\<A> \<eta>) (sim \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))
 5. \<exists>cnv. \<forall>\<D>. (\<forall>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<D> \<eta> \<surd>) \<longrightarrow> (\<forall>\<eta>. interaction_any_bounded_by (\<D> \<eta>) (bound' \<eta>)) \<longrightarrow> (\<forall>\<eta>. lossless \<longrightarrow> plossless_gpv (\<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<D> \<eta>)) \<longrightarrow> (\<forall>\<eta>. wiring (\<I>_ideal \<eta>) (\<I>_real \<eta>) (cnv \<eta>) (w \<eta>)) \<and> Negligible.negligible (\<lambda>\<eta>. advantage (\<D> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))
[PROOF STEP]
have "\<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common \<eta> \<turnstile>g ?\<A> \<eta> \<surd>" for \<eta>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common \<eta> \<turnstile>g absorb (\<A> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta>) \<surd>
[PROOF STEP]
by(rule WT_intro)+
[PROOF STATE]
proof (state)
this:
\<I>_real ?\<eta> \<oplus>\<^sub>\<I> \<I>_common ?\<eta> \<turnstile>g absorb (\<A> ?\<eta>) (1\<^sub>C |\<^sub>= conv ?\<eta>) \<surd>

goal (5 subgoals):
 1. \<And>\<eta>. \<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>res 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta> \<surd>
 2. \<And>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>res 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta> \<surd>
 3. \<And>\<eta>. \<I>_real \<eta>, \<I>_ideal \<eta> \<turnstile>\<^sub>C sim \<eta> \<surd>
 4. \<And>\<A>. \<lbrakk>\<And>\<eta>. \<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<A> \<eta> \<surd>; \<And>\<eta>. interaction_any_bounded_by (\<A> \<eta>) (bound' \<eta>); \<And>\<eta>. lossless \<Longrightarrow> plossless_gpv (\<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<A> \<eta>)\<rbrakk> \<Longrightarrow> Negligible.negligible (\<lambda>\<eta>. advantage (\<A> \<eta>) (sim \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))
 5. \<exists>cnv. \<forall>\<D>. (\<forall>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<D> \<eta> \<surd>) \<longrightarrow> (\<forall>\<eta>. interaction_any_bounded_by (\<D> \<eta>) (bound' \<eta>)) \<longrightarrow> (\<forall>\<eta>. lossless \<longrightarrow> plossless_gpv (\<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<D> \<eta>)) \<longrightarrow> (\<forall>\<eta>. wiring (\<I>_ideal \<eta>) (\<I>_real \<eta>) (cnv \<eta>) (w \<eta>)) \<and> Negligible.negligible (\<lambda>\<eta>. advantage (\<D> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<I>_real ?\<eta> \<oplus>\<^sub>\<I> \<I>_common ?\<eta> \<turnstile>g absorb (\<A> ?\<eta>) (1\<^sub>C |\<^sub>= conv ?\<eta>) \<surd>

goal (5 subgoals):
 1. \<And>\<eta>. \<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>res 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta> \<surd>
 2. \<And>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>res 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta> \<surd>
 3. \<And>\<eta>. \<I>_real \<eta>, \<I>_ideal \<eta> \<turnstile>\<^sub>C sim \<eta> \<surd>
 4. \<And>\<A>. \<lbrakk>\<And>\<eta>. \<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<A> \<eta> \<surd>; \<And>\<eta>. interaction_any_bounded_by (\<A> \<eta>) (bound' \<eta>); \<And>\<eta>. lossless \<Longrightarrow> plossless_gpv (\<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<A> \<eta>)\<rbrakk> \<Longrightarrow> Negligible.negligible (\<lambda>\<eta>. advantage (\<A> \<eta>) (sim \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))
 5. \<exists>cnv. \<forall>\<D>. (\<forall>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<D> \<eta> \<surd>) \<longrightarrow> (\<forall>\<eta>. interaction_any_bounded_by (\<D> \<eta>) (bound' \<eta>)) \<longrightarrow> (\<forall>\<eta>. lossless \<longrightarrow> plossless_gpv (\<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<D> \<eta>)) \<longrightarrow> (\<forall>\<eta>. wiring (\<I>_ideal \<eta>) (\<I>_real \<eta>) (cnv \<eta>) (w \<eta>)) \<and> Negligible.negligible (\<lambda>\<eta>. advantage (\<D> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))
[PROOF STEP]
have "interaction_any_bounded_by (?\<A> \<eta>) (bound \<eta>)" for \<eta>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interaction_any_bounded_by (absorb (\<A> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta>)) (bound \<eta>)
[PROOF STEP]
by interaction_bound_converter(use bound_le[of \<eta>] in \<open>simp add: max.commute\<close>)
[PROOF STATE]
proof (state)
this:
interaction_any_bounded_by (absorb (\<A> ?\<eta>) (1\<^sub>C |\<^sub>= conv ?\<eta>)) (bound ?\<eta>)

goal (5 subgoals):
 1. \<And>\<eta>. \<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>res 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta> \<surd>
 2. \<And>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>res 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta> \<surd>
 3. \<And>\<eta>. \<I>_real \<eta>, \<I>_ideal \<eta> \<turnstile>\<^sub>C sim \<eta> \<surd>
 4. \<And>\<A>. \<lbrakk>\<And>\<eta>. \<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<A> \<eta> \<surd>; \<And>\<eta>. interaction_any_bounded_by (\<A> \<eta>) (bound' \<eta>); \<And>\<eta>. lossless \<Longrightarrow> plossless_gpv (\<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<A> \<eta>)\<rbrakk> \<Longrightarrow> Negligible.negligible (\<lambda>\<eta>. advantage (\<A> \<eta>) (sim \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))
 5. \<exists>cnv. \<forall>\<D>. (\<forall>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<D> \<eta> \<surd>) \<longrightarrow> (\<forall>\<eta>. interaction_any_bounded_by (\<D> \<eta>) (bound' \<eta>)) \<longrightarrow> (\<forall>\<eta>. lossless \<longrightarrow> plossless_gpv (\<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<D> \<eta>)) \<longrightarrow> (\<forall>\<eta>. wiring (\<I>_ideal \<eta>) (\<I>_real \<eta>) (cnv \<eta>) (w \<eta>)) \<and> Negligible.negligible (\<lambda>\<eta>. advantage (\<D> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
interaction_any_bounded_by (absorb (\<A> ?\<eta>) (1\<^sub>C |\<^sub>= conv ?\<eta>)) (bound ?\<eta>)

goal (5 subgoals):
 1. \<And>\<eta>. \<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>res 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta> \<surd>
 2. \<And>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>res 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta> \<surd>
 3. \<And>\<eta>. \<I>_real \<eta>, \<I>_ideal \<eta> \<turnstile>\<^sub>C sim \<eta> \<surd>
 4. \<And>\<A>. \<lbrakk>\<And>\<eta>. \<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<A> \<eta> \<surd>; \<And>\<eta>. interaction_any_bounded_by (\<A> \<eta>) (bound' \<eta>); \<And>\<eta>. lossless \<Longrightarrow> plossless_gpv (\<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<A> \<eta>)\<rbrakk> \<Longrightarrow> Negligible.negligible (\<lambda>\<eta>. advantage (\<A> \<eta>) (sim \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))
 5. \<exists>cnv. \<forall>\<D>. (\<forall>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<D> \<eta> \<surd>) \<longrightarrow> (\<forall>\<eta>. interaction_any_bounded_by (\<D> \<eta>) (bound' \<eta>)) \<longrightarrow> (\<forall>\<eta>. lossless \<longrightarrow> plossless_gpv (\<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<D> \<eta>)) \<longrightarrow> (\<forall>\<eta>. wiring (\<I>_ideal \<eta>) (\<I>_real \<eta>) (cnv \<eta>) (w \<eta>)) \<and> Negligible.negligible (\<lambda>\<eta>. advantage (\<D> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))
[PROOF STEP]
have " plossless_gpv (\<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common \<eta>) (absorb (\<A> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta>))" if lossless for \<eta>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. plossless_gpv (\<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common \<eta>) (absorb (\<A> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta>))
[PROOF STEP]
by(rule plossless_intro WT_intro | simp add: that)+
[PROOF STATE]
proof (state)
this:
lossless \<Longrightarrow> plossless_gpv (\<I>_real ?\<eta> \<oplus>\<^sub>\<I> \<I>_common ?\<eta>) (absorb (\<A> ?\<eta>) (1\<^sub>C |\<^sub>= conv ?\<eta>))

goal (5 subgoals):
 1. \<And>\<eta>. \<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>res 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta> \<surd>
 2. \<And>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>res 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta> \<surd>
 3. \<And>\<eta>. \<I>_real \<eta>, \<I>_ideal \<eta> \<turnstile>\<^sub>C sim \<eta> \<surd>
 4. \<And>\<A>. \<lbrakk>\<And>\<eta>. \<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<A> \<eta> \<surd>; \<And>\<eta>. interaction_any_bounded_by (\<A> \<eta>) (bound' \<eta>); \<And>\<eta>. lossless \<Longrightarrow> plossless_gpv (\<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<A> \<eta>)\<rbrakk> \<Longrightarrow> Negligible.negligible (\<lambda>\<eta>. advantage (\<A> \<eta>) (sim \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))
 5. \<exists>cnv. \<forall>\<D>. (\<forall>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<D> \<eta> \<surd>) \<longrightarrow> (\<forall>\<eta>. interaction_any_bounded_by (\<D> \<eta>) (bound' \<eta>)) \<longrightarrow> (\<forall>\<eta>. lossless \<longrightarrow> plossless_gpv (\<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<D> \<eta>)) \<longrightarrow> (\<forall>\<eta>. wiring (\<I>_ideal \<eta>) (\<I>_real \<eta>) (cnv \<eta>) (w \<eta>)) \<and> Negligible.negligible (\<lambda>\<eta>. advantage (\<D> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<I>_real ?\<eta> \<oplus>\<^sub>\<I> \<I>_common ?\<eta> \<turnstile>g absorb (\<A> ?\<eta>) (1\<^sub>C |\<^sub>= conv ?\<eta>) \<surd>
interaction_any_bounded_by (absorb (\<A> ?\<eta>) (1\<^sub>C |\<^sub>= conv ?\<eta>)) (bound ?\<eta>)
lossless \<Longrightarrow> plossless_gpv (\<I>_real ?\<eta> \<oplus>\<^sub>\<I> \<I>_common ?\<eta>) (absorb (\<A> ?\<eta>) (1\<^sub>C |\<^sub>= conv ?\<eta>))
[PROOF STEP]
show "negligible (\<lambda>\<eta>. advantage (\<A> \<eta>) (sim \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))"
[PROOF STATE]
proof (prove)
using this:
\<I>_real ?\<eta> \<oplus>\<^sub>\<I> \<I>_common ?\<eta> \<turnstile>g absorb (\<A> ?\<eta>) (1\<^sub>C |\<^sub>= conv ?\<eta>) \<surd>
interaction_any_bounded_by (absorb (\<A> ?\<eta>) (1\<^sub>C |\<^sub>= conv ?\<eta>)) (bound ?\<eta>)
lossless \<Longrightarrow> plossless_gpv (\<I>_real ?\<eta> \<oplus>\<^sub>\<I> \<I>_common ?\<eta>) (absorb (\<A> ?\<eta>) (1\<^sub>C |\<^sub>= conv ?\<eta>))

goal (1 subgoal):
 1. Negligible.negligible (\<lambda>\<eta>. advantage (\<A> \<eta>) (sim \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))
[PROOF STEP]
unfolding advantage_def ideal real
[PROOF STATE]
proof (prove)
using this:
\<I>_real ?\<eta> \<oplus>\<^sub>\<I> \<I>_common ?\<eta> \<turnstile>g absorb (\<A> ?\<eta>) (1\<^sub>C |\<^sub>= conv ?\<eta>) \<surd>
interaction_any_bounded_by (absorb (\<A> ?\<eta>) (1\<^sub>C |\<^sub>= conv ?\<eta>)) (bound ?\<eta>)
lossless \<Longrightarrow> plossless_gpv (\<I>_real ?\<eta> \<oplus>\<^sub>\<I> \<I>_common ?\<eta>) (absorb (\<A> ?\<eta>) (1\<^sub>C |\<^sub>= conv ?\<eta>))

goal (1 subgoal):
 1. Negligible.negligible (\<lambda>\<eta>. \<bar>spmf (connect (absorb (\<A> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta>)) (sim \<eta> |\<^sub>= 1\<^sub>C \<rhd> ideal_resource \<eta>)) True - spmf (connect (absorb (\<A> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta>)) (real_resource \<eta>)) True\<bar>)
[PROOF STEP]
by(rule adv[unfolded advantage_def])
[PROOF STATE]
proof (state)
this:
Negligible.negligible (\<lambda>\<eta>. advantage (\<A> \<eta>) (sim \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))

goal (4 subgoals):
 1. \<And>\<eta>. \<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>res 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta> \<surd>
 2. \<And>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>res 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta> \<surd>
 3. \<And>\<eta>. \<I>_real \<eta>, \<I>_ideal \<eta> \<turnstile>\<^sub>C sim \<eta> \<surd>
 4. \<exists>cnv. \<forall>\<D>. (\<forall>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<D> \<eta> \<surd>) \<longrightarrow> (\<forall>\<eta>. interaction_any_bounded_by (\<D> \<eta>) (bound' \<eta>)) \<longrightarrow> (\<forall>\<eta>. lossless \<longrightarrow> plossless_gpv (\<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<D> \<eta>)) \<longrightarrow> (\<forall>\<eta>. wiring (\<I>_ideal \<eta>) (\<I>_real \<eta>) (cnv \<eta>) (w \<eta>)) \<and> Negligible.negligible (\<lambda>\<eta>. advantage (\<D> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>\<eta>. \<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>res 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta> \<surd>
 2. \<And>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>res 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta> \<surd>
 3. \<And>\<eta>. \<I>_real \<eta>, \<I>_ideal \<eta> \<turnstile>\<^sub>C sim \<eta> \<surd>
 4. \<exists>cnv. \<forall>\<D>. (\<forall>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<D> \<eta> \<surd>) \<longrightarrow> (\<forall>\<eta>. interaction_any_bounded_by (\<D> \<eta>) (bound' \<eta>)) \<longrightarrow> (\<forall>\<eta>. lossless \<longrightarrow> plossless_gpv (\<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<D> \<eta>)) \<longrightarrow> (\<forall>\<eta>. wiring (\<I>_ideal \<eta>) (\<I>_real \<eta>) (cnv \<eta>) (w \<eta>)) \<and> Negligible.negligible (\<lambda>\<eta>. advantage (\<D> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))
[PROOF STEP]
from correct
[PROOF STATE]
proof (chain)
picking this:
\<exists>cnv. \<forall>\<D>. (\<forall>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common \<eta> \<turnstile>g \<D> \<eta> \<surd>) \<longrightarrow> (\<forall>\<eta>. interaction_any_bounded_by (\<D> \<eta>) (bound \<eta>)) \<longrightarrow> (\<forall>\<eta>. lossless \<longrightarrow> plossless_gpv (\<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common \<eta>) (\<D> \<eta>)) \<longrightarrow> (\<forall>\<eta>. wiring (\<I>_ideal \<eta>) (\<I>_real \<eta>) (cnv \<eta>) (w \<eta>)) \<and> Negligible.negligible (\<lambda>\<eta>. advantage (\<D> \<eta>) (ideal_resource \<eta>) (cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> real_resource \<eta>))
[PROOF STEP]
obtain cnv
    where correct': "\<And>\<D>. \<lbrakk> \<And>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common \<eta> \<turnstile>g \<D> \<eta> \<surd>;
          \<And>\<eta>. interaction_any_bounded_by (\<D> \<eta>) (bound \<eta>);
          \<And>\<eta>. lossless \<Longrightarrow> plossless_gpv (\<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common \<eta>) (\<D> \<eta>) \<rbrakk>
          \<Longrightarrow> (\<forall>\<eta>. wiring (\<I>_ideal \<eta>) (\<I>_real \<eta>) (cnv \<eta>) (w \<eta>)) \<and>
              negligible (\<lambda>\<eta>. advantage (\<D> \<eta>) (ideal_resource \<eta>) (cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> real_resource \<eta>))"
[PROOF STATE]
proof (prove)
using this:
\<exists>cnv. \<forall>\<D>. (\<forall>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common \<eta> \<turnstile>g \<D> \<eta> \<surd>) \<longrightarrow> (\<forall>\<eta>. interaction_any_bounded_by (\<D> \<eta>) (bound \<eta>)) \<longrightarrow> (\<forall>\<eta>. lossless \<longrightarrow> plossless_gpv (\<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common \<eta>) (\<D> \<eta>)) \<longrightarrow> (\<forall>\<eta>. wiring (\<I>_ideal \<eta>) (\<I>_real \<eta>) (cnv \<eta>) (w \<eta>)) \<and> Negligible.negligible (\<lambda>\<eta>. advantage (\<D> \<eta>) (ideal_resource \<eta>) (cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> real_resource \<eta>))

goal (1 subgoal):
 1. (\<And>cnv. (\<And>\<D>. \<lbrakk>\<And>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common \<eta> \<turnstile>g \<D> \<eta> \<surd>; \<And>\<eta>. interaction_any_bounded_by (\<D> \<eta>) (bound \<eta>); \<And>\<eta>. lossless \<Longrightarrow> plossless_gpv (\<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common \<eta>) (\<D> \<eta>)\<rbrakk> \<Longrightarrow> (\<forall>\<eta>. wiring (\<I>_ideal \<eta>) (\<I>_real \<eta>) (cnv \<eta>) (w \<eta>)) \<and> Negligible.negligible (\<lambda>\<eta>. advantage (\<D> \<eta>) (ideal_resource \<eta>) (cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> real_resource \<eta>))) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<And>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common \<eta> \<turnstile>g ?\<D> \<eta> \<surd>; \<And>\<eta>. interaction_any_bounded_by (?\<D> \<eta>) (bound \<eta>); \<And>\<eta>. lossless \<Longrightarrow> plossless_gpv (\<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common \<eta>) (?\<D> \<eta>)\<rbrakk> \<Longrightarrow> (\<forall>\<eta>. wiring (\<I>_ideal \<eta>) (\<I>_real \<eta>) (cnv \<eta>) (w \<eta>)) \<and> Negligible.negligible (\<lambda>\<eta>. advantage (?\<D> \<eta>) (ideal_resource \<eta>) (cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> real_resource \<eta>))

goal (4 subgoals):
 1. \<And>\<eta>. \<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>res 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta> \<surd>
 2. \<And>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>res 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta> \<surd>
 3. \<And>\<eta>. \<I>_real \<eta>, \<I>_ideal \<eta> \<turnstile>\<^sub>C sim \<eta> \<surd>
 4. \<exists>cnv. \<forall>\<D>. (\<forall>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<D> \<eta> \<surd>) \<longrightarrow> (\<forall>\<eta>. interaction_any_bounded_by (\<D> \<eta>) (bound' \<eta>)) \<longrightarrow> (\<forall>\<eta>. lossless \<longrightarrow> plossless_gpv (\<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<D> \<eta>)) \<longrightarrow> (\<forall>\<eta>. wiring (\<I>_ideal \<eta>) (\<I>_real \<eta>) (cnv \<eta>) (w \<eta>)) \<and> Negligible.negligible (\<lambda>\<eta>. advantage (\<D> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))
[PROOF STEP]
show "\<exists>cnv. \<forall>\<D>. (\<forall>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<D> \<eta> \<surd>) \<longrightarrow>
         (\<forall>\<eta>. interaction_any_bounded_by (\<D> \<eta>) (bound' \<eta>)) \<longrightarrow>
         (\<forall>\<eta>. lossless \<longrightarrow> plossless_gpv (\<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<D> \<eta>)) \<longrightarrow>
         (\<forall>\<eta>. wiring (\<I>_ideal \<eta>) (\<I>_real \<eta>) (cnv \<eta>) (w \<eta>)) \<and>
         negligible (\<lambda>\<eta>. advantage (\<D> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>cnv. \<forall>\<D>. (\<forall>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<D> \<eta> \<surd>) \<longrightarrow> (\<forall>\<eta>. interaction_any_bounded_by (\<D> \<eta>) (bound' \<eta>)) \<longrightarrow> (\<forall>\<eta>. lossless \<longrightarrow> plossless_gpv (\<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<D> \<eta>)) \<longrightarrow> (\<forall>\<eta>. wiring (\<I>_ideal \<eta>) (\<I>_real \<eta>) (cnv \<eta>) (w \<eta>)) \<and> Negligible.negligible (\<lambda>\<eta>. advantage (\<D> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))
[PROOF STEP]
proof(intro exI conjI strip)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>\<D> \<eta>. \<lbrakk>\<forall>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<D> \<eta> \<surd>; \<forall>\<eta>. interaction_any_bounded_by (\<D> \<eta>) (bound' \<eta>); \<forall>\<eta>. lossless \<longrightarrow> plossless_gpv (\<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<D> \<eta>)\<rbrakk> \<Longrightarrow> wiring (\<I>_ideal \<eta>) (\<I>_real \<eta>) (?cnv \<eta>) (w \<eta>)
 2. \<And>\<D>. \<lbrakk>\<forall>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<D> \<eta> \<surd>; \<forall>\<eta>. interaction_any_bounded_by (\<D> \<eta>) (bound' \<eta>); \<forall>\<eta>. lossless \<longrightarrow> plossless_gpv (\<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<D> \<eta>)\<rbrakk> \<Longrightarrow> Negligible.negligible (\<lambda>\<eta>. advantage (\<D> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (?cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))
[PROOF STEP]
fix \<D> :: "security \<Rightarrow> ('c + 'g, 'd + 'h) distinguisher"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>\<D> \<eta>. \<lbrakk>\<forall>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<D> \<eta> \<surd>; \<forall>\<eta>. interaction_any_bounded_by (\<D> \<eta>) (bound' \<eta>); \<forall>\<eta>. lossless \<longrightarrow> plossless_gpv (\<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<D> \<eta>)\<rbrakk> \<Longrightarrow> wiring (\<I>_ideal \<eta>) (\<I>_real \<eta>) (?cnv \<eta>) (w \<eta>)
 2. \<And>\<D>. \<lbrakk>\<forall>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<D> \<eta> \<surd>; \<forall>\<eta>. interaction_any_bounded_by (\<D> \<eta>) (bound' \<eta>); \<forall>\<eta>. lossless \<longrightarrow> plossless_gpv (\<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<D> \<eta>)\<rbrakk> \<Longrightarrow> Negligible.negligible (\<lambda>\<eta>. advantage (\<D> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (?cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))
[PROOF STEP]
assume WT_D [rule_format, WT_intro]: "\<forall>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<D> \<eta> \<surd>"
      and bound [rule_format, interaction_bound]: "\<forall>\<eta>. interaction_bounded_by (\<lambda>_. True) (\<D> \<eta>) (bound' \<eta>)"
      and lossless [rule_format]: "\<forall>\<eta>. lossless \<longrightarrow> plossless_gpv (\<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<D> \<eta>)"
[PROOF STATE]
proof (state)
this:
\<I>_ideal ?\<eta> \<oplus>\<^sub>\<I> \<I>_common' ?\<eta> \<turnstile>g \<D> ?\<eta> \<surd>
interaction_any_bounded_by (\<D> ?\<eta>) (bound' ?\<eta>)
lossless \<Longrightarrow> plossless_gpv (\<I>_ideal ?\<eta> \<oplus>\<^sub>\<I> \<I>_common' ?\<eta>) (\<D> ?\<eta>)

goal (2 subgoals):
 1. \<And>\<D> \<eta>. \<lbrakk>\<forall>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<D> \<eta> \<surd>; \<forall>\<eta>. interaction_any_bounded_by (\<D> \<eta>) (bound' \<eta>); \<forall>\<eta>. lossless \<longrightarrow> plossless_gpv (\<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<D> \<eta>)\<rbrakk> \<Longrightarrow> wiring (\<I>_ideal \<eta>) (\<I>_real \<eta>) (?cnv \<eta>) (w \<eta>)
 2. \<And>\<D>. \<lbrakk>\<forall>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<D> \<eta> \<surd>; \<forall>\<eta>. interaction_any_bounded_by (\<D> \<eta>) (bound' \<eta>); \<forall>\<eta>. lossless \<longrightarrow> plossless_gpv (\<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<D> \<eta>)\<rbrakk> \<Longrightarrow> Negligible.negligible (\<lambda>\<eta>. advantage (\<D> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (?cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))
[PROOF STEP]
let ?\<D> = "\<lambda>\<eta>. absorb (\<D> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta>)"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>\<D> \<eta>. \<lbrakk>\<forall>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<D> \<eta> \<surd>; \<forall>\<eta>. interaction_any_bounded_by (\<D> \<eta>) (bound' \<eta>); \<forall>\<eta>. lossless \<longrightarrow> plossless_gpv (\<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<D> \<eta>)\<rbrakk> \<Longrightarrow> wiring (\<I>_ideal \<eta>) (\<I>_real \<eta>) (?cnv \<eta>) (w \<eta>)
 2. \<And>\<D>. \<lbrakk>\<forall>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<D> \<eta> \<surd>; \<forall>\<eta>. interaction_any_bounded_by (\<D> \<eta>) (bound' \<eta>); \<forall>\<eta>. lossless \<longrightarrow> plossless_gpv (\<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<D> \<eta>)\<rbrakk> \<Longrightarrow> Negligible.negligible (\<lambda>\<eta>. advantage (\<D> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (?cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))
[PROOF STEP]
have WT_D' [WT_intro]: "\<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common \<eta> \<turnstile>g ?\<D> \<eta> \<surd>" for \<eta>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common \<eta> \<turnstile>g absorb (\<D> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta>) \<surd>
[PROOF STEP]
by(rule WT_intro)+
[PROOF STATE]
proof (state)
this:
\<I>_ideal ?\<eta> \<oplus>\<^sub>\<I> \<I>_common ?\<eta> \<turnstile>g absorb (\<D> ?\<eta>) (1\<^sub>C |\<^sub>= conv ?\<eta>) \<surd>

goal (2 subgoals):
 1. \<And>\<D> \<eta>. \<lbrakk>\<forall>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<D> \<eta> \<surd>; \<forall>\<eta>. interaction_any_bounded_by (\<D> \<eta>) (bound' \<eta>); \<forall>\<eta>. lossless \<longrightarrow> plossless_gpv (\<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<D> \<eta>)\<rbrakk> \<Longrightarrow> wiring (\<I>_ideal \<eta>) (\<I>_real \<eta>) (?cnv \<eta>) (w \<eta>)
 2. \<And>\<D>. \<lbrakk>\<forall>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<D> \<eta> \<surd>; \<forall>\<eta>. interaction_any_bounded_by (\<D> \<eta>) (bound' \<eta>); \<forall>\<eta>. lossless \<longrightarrow> plossless_gpv (\<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<D> \<eta>)\<rbrakk> \<Longrightarrow> Negligible.negligible (\<lambda>\<eta>. advantage (\<D> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (?cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))
[PROOF STEP]
have bound': "interaction_any_bounded_by (?\<D> \<eta>) (bound \<eta>)" for \<eta>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interaction_any_bounded_by (absorb (\<D> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta>)) (bound \<eta>)
[PROOF STEP]
by interaction_bound(use bound_le[of \<eta>] in \<open>auto simp add: max_def split: if_split_asm\<close>)
[PROOF STATE]
proof (state)
this:
interaction_any_bounded_by (absorb (\<D> ?\<eta>) (1\<^sub>C |\<^sub>= conv ?\<eta>)) (bound ?\<eta>)

goal (2 subgoals):
 1. \<And>\<D> \<eta>. \<lbrakk>\<forall>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<D> \<eta> \<surd>; \<forall>\<eta>. interaction_any_bounded_by (\<D> \<eta>) (bound' \<eta>); \<forall>\<eta>. lossless \<longrightarrow> plossless_gpv (\<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<D> \<eta>)\<rbrakk> \<Longrightarrow> wiring (\<I>_ideal \<eta>) (\<I>_real \<eta>) (?cnv \<eta>) (w \<eta>)
 2. \<And>\<D>. \<lbrakk>\<forall>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<D> \<eta> \<surd>; \<forall>\<eta>. interaction_any_bounded_by (\<D> \<eta>) (bound' \<eta>); \<forall>\<eta>. lossless \<longrightarrow> plossless_gpv (\<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<D> \<eta>)\<rbrakk> \<Longrightarrow> Negligible.negligible (\<lambda>\<eta>. advantage (\<D> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (?cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))
[PROOF STEP]
have "plossless_gpv (\<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common \<eta>) (?\<D> \<eta>)" if lossless for \<eta>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. plossless_gpv (\<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common \<eta>) (absorb (\<D> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta>))
[PROOF STEP]
by(rule lossless that WT_intro plossless_intro)+
[PROOF STATE]
proof (state)
this:
lossless \<Longrightarrow> plossless_gpv (\<I>_ideal ?\<eta> \<oplus>\<^sub>\<I> \<I>_common ?\<eta>) (absorb (\<D> ?\<eta>) (1\<^sub>C |\<^sub>= conv ?\<eta>))

goal (2 subgoals):
 1. \<And>\<D> \<eta>. \<lbrakk>\<forall>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<D> \<eta> \<surd>; \<forall>\<eta>. interaction_any_bounded_by (\<D> \<eta>) (bound' \<eta>); \<forall>\<eta>. lossless \<longrightarrow> plossless_gpv (\<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<D> \<eta>)\<rbrakk> \<Longrightarrow> wiring (\<I>_ideal \<eta>) (\<I>_real \<eta>) (?cnv \<eta>) (w \<eta>)
 2. \<And>\<D>. \<lbrakk>\<forall>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<D> \<eta> \<surd>; \<forall>\<eta>. interaction_any_bounded_by (\<D> \<eta>) (bound' \<eta>); \<forall>\<eta>. lossless \<longrightarrow> plossless_gpv (\<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<D> \<eta>)\<rbrakk> \<Longrightarrow> Negligible.negligible (\<lambda>\<eta>. advantage (\<D> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (?cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))
[PROOF STEP]
from correct'[OF WT_D' bound' this]
[PROOF STATE]
proof (chain)
picking this:
(\<And>\<eta>. lossless \<Longrightarrow> lossless) \<Longrightarrow> (\<forall>\<eta>. wiring (\<I>_ideal \<eta>) (\<I>_real \<eta>) (cnv \<eta>) (w \<eta>)) \<and> Negligible.negligible (\<lambda>\<eta>. advantage (absorb (\<D> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta>)) (ideal_resource \<eta>) (cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> real_resource \<eta>))
[PROOF STEP]
have w1: "wiring (\<I>_ideal \<eta>) (\<I>_real \<eta>) (cnv \<eta>) (w \<eta>)"
      and adv': "negligible (\<lambda>\<eta>. advantage (?\<D> \<eta>) (ideal_resource \<eta>) (cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> real_resource \<eta>))" for \<eta>
[PROOF STATE]
proof (prove)
using this:
(\<And>\<eta>. lossless \<Longrightarrow> lossless) \<Longrightarrow> (\<forall>\<eta>. wiring (\<I>_ideal \<eta>) (\<I>_real \<eta>) (cnv \<eta>) (w \<eta>)) \<and> Negligible.negligible (\<lambda>\<eta>. advantage (absorb (\<D> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta>)) (ideal_resource \<eta>) (cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> real_resource \<eta>))

goal (1 subgoal):
 1. wiring (\<I>_ideal \<eta>) (\<I>_real \<eta>) (cnv \<eta>) (w \<eta>) &&& Negligible.negligible (\<lambda>\<eta>. advantage (absorb (\<D> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta>)) (ideal_resource \<eta>) (cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> real_resource \<eta>))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
wiring (\<I>_ideal ?\<eta>) (\<I>_real ?\<eta>) (cnv ?\<eta>) (w ?\<eta>)
Negligible.negligible (\<lambda>\<eta>. advantage (absorb (\<D> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta>)) (ideal_resource \<eta>) (cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> real_resource \<eta>))

goal (2 subgoals):
 1. \<And>\<D> \<eta>. \<lbrakk>\<forall>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<D> \<eta> \<surd>; \<forall>\<eta>. interaction_any_bounded_by (\<D> \<eta>) (bound' \<eta>); \<forall>\<eta>. lossless \<longrightarrow> plossless_gpv (\<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<D> \<eta>)\<rbrakk> \<Longrightarrow> wiring (\<I>_ideal \<eta>) (\<I>_real \<eta>) (?cnv \<eta>) (w \<eta>)
 2. \<And>\<D>. \<lbrakk>\<forall>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<D> \<eta> \<surd>; \<forall>\<eta>. interaction_any_bounded_by (\<D> \<eta>) (bound' \<eta>); \<forall>\<eta>. lossless \<longrightarrow> plossless_gpv (\<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<D> \<eta>)\<rbrakk> \<Longrightarrow> Negligible.negligible (\<lambda>\<eta>. advantage (\<D> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (?cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))
[PROOF STEP]
show "wiring (\<I>_ideal \<eta>) (\<I>_real \<eta>) (cnv \<eta>) (w \<eta>)" for \<eta>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wiring (\<I>_ideal \<eta>) (\<I>_real \<eta>) (cnv \<eta>) (w \<eta>)
[PROOF STEP]
by(rule w1)
[PROOF STATE]
proof (state)
this:
wiring (\<I>_ideal ?\<eta>) (\<I>_real ?\<eta>) (cnv ?\<eta>) (w ?\<eta>)

goal (1 subgoal):
 1. \<And>\<D>. \<lbrakk>\<forall>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<D> \<eta> \<surd>; \<forall>\<eta>. interaction_any_bounded_by (\<D> \<eta>) (bound' \<eta>); \<forall>\<eta>. lossless \<longrightarrow> plossless_gpv (\<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<D> \<eta>)\<rbrakk> \<Longrightarrow> Negligible.negligible (\<lambda>\<eta>. advantage (\<D> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))
[PROOF STEP]
have "cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta> = 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> real_resource \<eta>" for \<eta>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta> = 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> real_resource \<eta>
[PROOF STEP]
by(simp add: attach_compose[symmetric] comp_converter_parallel2 comp_converter_id_left comp_converter_id_right)
[PROOF STATE]
proof (state)
this:
cnv ?\<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv ?\<eta> \<rhd> real_resource ?\<eta> = 1\<^sub>C |\<^sub>= conv ?\<eta> \<rhd> cnv ?\<eta> |\<^sub>= 1\<^sub>C \<rhd> real_resource ?\<eta>

goal (1 subgoal):
 1. \<And>\<D>. \<lbrakk>\<forall>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<D> \<eta> \<surd>; \<forall>\<eta>. interaction_any_bounded_by (\<D> \<eta>) (bound' \<eta>); \<forall>\<eta>. lossless \<longrightarrow> plossless_gpv (\<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<D> \<eta>)\<rbrakk> \<Longrightarrow> Negligible.negligible (\<lambda>\<eta>. advantage (\<D> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))
[PROOF STEP]
with adv'
[PROOF STATE]
proof (chain)
picking this:
Negligible.negligible (\<lambda>\<eta>. advantage (absorb (\<D> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta>)) (ideal_resource \<eta>) (cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> real_resource \<eta>))
cnv ?\<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv ?\<eta> \<rhd> real_resource ?\<eta> = 1\<^sub>C |\<^sub>= conv ?\<eta> \<rhd> cnv ?\<eta> |\<^sub>= 1\<^sub>C \<rhd> real_resource ?\<eta>
[PROOF STEP]
show "negligible (\<lambda>\<eta>. advantage (\<D> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))"
[PROOF STATE]
proof (prove)
using this:
Negligible.negligible (\<lambda>\<eta>. advantage (absorb (\<D> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta>)) (ideal_resource \<eta>) (cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> real_resource \<eta>))
cnv ?\<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv ?\<eta> \<rhd> real_resource ?\<eta> = 1\<^sub>C |\<^sub>= conv ?\<eta> \<rhd> cnv ?\<eta> |\<^sub>= 1\<^sub>C \<rhd> real_resource ?\<eta>

goal (1 subgoal):
 1. Negligible.negligible (\<lambda>\<eta>. advantage (\<D> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))
[PROOF STEP]
by(simp add: advantage_def distinguish_attach[symmetric])
[PROOF STATE]
proof (state)
this:
Negligible.negligible (\<lambda>\<eta>. advantage (\<D> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>cnv. \<forall>\<D>. (\<forall>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>g \<D> \<eta> \<surd>) \<longrightarrow> (\<forall>\<eta>. interaction_any_bounded_by (\<D> \<eta>) (bound' \<eta>)) \<longrightarrow> (\<forall>\<eta>. lossless \<longrightarrow> plossless_gpv (\<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta>) (\<D> \<eta>)) \<longrightarrow> (\<forall>\<eta>. wiring (\<I>_ideal \<eta>) (\<I>_real \<eta>) (cnv \<eta>) (w \<eta>)) \<and> Negligible.negligible (\<lambda>\<eta>. advantage (\<D> \<eta>) (1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta>) (cnv \<eta> |\<^sub>= 1\<^sub>C \<rhd> 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta>))

goal (3 subgoals):
 1. \<And>\<eta>. \<I>_real \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>res 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> real_resource \<eta> \<surd>
 2. \<And>\<eta>. \<I>_ideal \<eta> \<oplus>\<^sub>\<I> \<I>_common' \<eta> \<turnstile>res 1\<^sub>C |\<^sub>= conv \<eta> \<rhd> ideal_resource \<eta> \<surd>
 3. \<And>\<eta>. \<I>_real \<eta>, \<I>_ideal \<eta> \<turnstile>\<^sub>C sim \<eta> \<surd>
[PROOF STEP]
qed(rule WT_intro)+


[STATEMENT]
lemma put_M\<^sub>D\<^sub>o\<^sub>c\<^sub>u\<^sub>m\<^sub>e\<^sub>n\<^sub>t_document_element_type_wf_preserved [simp]:
  assumes "h \<turnstile> put_M document_ptr document_element_update v \<rightarrow>\<^sub>h h'"
  shows "type_wf h = type_wf h'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ShadowRootClass.type_wf h = ShadowRootClass.type_wf h'
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ShadowRootClass.type_wf h = ShadowRootClass.type_wf h'
[PROOF STEP]
have "object_ptr_kinds h = object_ptr_kinds h'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. object_ptr_kinds h = object_ptr_kinds h'
[PROOF STEP]
using writes_singleton assms object_ptr_kinds_preserved
[PROOF STATE]
proof (prove)
using this:
writes (all_args ?f) (?f ?a) ?h ?h'
h \<turnstile> put_M document_ptr document_element_update v \<rightarrow>\<^sub>h h'
\<lbrakk>writes ?SW ?setter ?h ?h'; ?h \<turnstile> ?setter \<rightarrow>\<^sub>h ?h'; \<And>h h' w object_ptr. \<lbrakk>w \<in> ?SW; h \<turnstile> w \<rightarrow>\<^sub>h h'\<rbrakk> \<Longrightarrow> preserved (get_M object_ptr RObject.nothing) h h'\<rbrakk> \<Longrightarrow> object_ptr_kinds ?h = object_ptr_kinds ?h'

goal (1 subgoal):
 1. object_ptr_kinds h = object_ptr_kinds h'
[PROOF STEP]
unfolding all_args_def
[PROOF STATE]
proof (prove)
using this:
writes (\<Union>arg. {?f arg}) (?f ?a) ?h ?h'
h \<turnstile> put_M document_ptr document_element_update v \<rightarrow>\<^sub>h h'
\<lbrakk>writes ?SW ?setter ?h ?h'; ?h \<turnstile> ?setter \<rightarrow>\<^sub>h ?h'; \<And>h h' w object_ptr. \<lbrakk>w \<in> ?SW; h \<turnstile> w \<rightarrow>\<^sub>h h'\<rbrakk> \<Longrightarrow> preserved (get_M object_ptr RObject.nothing) h h'\<rbrakk> \<Longrightarrow> object_ptr_kinds ?h = object_ptr_kinds ?h'

goal (1 subgoal):
 1. object_ptr_kinds h = object_ptr_kinds h'
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
object_ptr_kinds h = object_ptr_kinds h'

goal (1 subgoal):
 1. ShadowRootClass.type_wf h = ShadowRootClass.type_wf h'
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
object_ptr_kinds h = object_ptr_kinds h'
[PROOF STEP]
have "shadow_root_ptr_kinds h = shadow_root_ptr_kinds h'"
[PROOF STATE]
proof (prove)
using this:
object_ptr_kinds h = object_ptr_kinds h'

goal (1 subgoal):
 1. shadow_root_ptr_kinds h = shadow_root_ptr_kinds h'
[PROOF STEP]
unfolding shadow_root_ptr_kinds_def
[PROOF STATE]
proof (prove)
using this:
object_ptr_kinds h = object_ptr_kinds h'

goal (1 subgoal):
 1. the |`| cast |`| ffilter is_shadow_root_ptr_kind (object_ptr_kinds h) = the |`| cast |`| ffilter is_shadow_root_ptr_kind (object_ptr_kinds h')
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
shadow_root_ptr_kinds h = shadow_root_ptr_kinds h'

goal (1 subgoal):
 1. ShadowRootClass.type_wf h = ShadowRootClass.type_wf h'
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
h \<turnstile> put_M document_ptr document_element_update v \<rightarrow>\<^sub>h h'
shadow_root_ptr_kinds h = shadow_root_ptr_kinds h'
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
h \<turnstile> put_M document_ptr document_element_update v \<rightarrow>\<^sub>h h'
shadow_root_ptr_kinds h = shadow_root_ptr_kinds h'

goal (1 subgoal):
 1. ShadowRootClass.type_wf h = ShadowRootClass.type_wf h'
[PROOF STEP]
by(auto simp add: DocumentMonad.put_M_defs type_wf_defs)
[PROOF STATE]
proof (state)
this:
ShadowRootClass.type_wf h = ShadowRootClass.type_wf h'

goal:
No subgoals!
[PROOF STEP]
qed