[STATEMENT]
lemma emeasure_cball_aux:
  assumes "finite A" "r > 0"
  shows   "emeasure (Pi\<^sub>M A (\<lambda>_. lborel))
             ({f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) =
             ennreal (unit_ball_vol (real (card A)) * r ^ card A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure (Pi\<^sub>M A (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card A)) * r ^ card A)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A
0 < r

goal (1 subgoal):
 1. emeasure (Pi\<^sub>M A (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card A)) * r ^ card A)
[PROOF STEP]
proof (induction arbitrary: r)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>r. 0 < r \<Longrightarrow> emeasure (Pi\<^sub>M {} (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>{}. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M {} (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card {})) * r ^ card {})
 2. \<And>x F r. \<lbrakk>finite F; x \<notin> F; \<And>r. 0 < r \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card F)) * r ^ card F); 0 < r\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>insert x F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card (insert x F))) * r ^ card (insert x F))
[PROOF STEP]
case (empty r)
[PROOF STATE]
proof (state)
this:
0 < r

goal (2 subgoals):
 1. \<And>r. 0 < r \<Longrightarrow> emeasure (Pi\<^sub>M {} (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>{}. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M {} (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card {})) * r ^ card {})
 2. \<And>x F r. \<lbrakk>finite F; x \<notin> F; \<And>r. 0 < r \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card F)) * r ^ card F); 0 < r\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>insert x F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card (insert x F))) * r ^ card (insert x F))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
0 < r

goal (1 subgoal):
 1. emeasure (Pi\<^sub>M {} (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>{}. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M {} (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card {})) * r ^ card {})
[PROOF STEP]
by (simp add: unit_ball_vol_def space_PiM)
[PROOF STATE]
proof (state)
this:
emeasure (Pi\<^sub>M {} (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>{}. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M {} (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card {})) * r ^ card {})

goal (1 subgoal):
 1. \<And>x F r. \<lbrakk>finite F; x \<notin> F; \<And>r. 0 < r \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card F)) * r ^ card F); 0 < r\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>insert x F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card (insert x F))) * r ^ card (insert x F))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F r. \<lbrakk>finite F; x \<notin> F; \<And>r. 0 < r \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card F)) * r ^ card F); 0 < r\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>insert x F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card (insert x F))) * r ^ card (insert x F))
[PROOF STEP]
case (insert i A r)
[PROOF STATE]
proof (state)
this:
finite A
i \<notin> A
0 < ?r \<Longrightarrow> emeasure (Pi\<^sub>M A (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> ?r} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card A)) * ?r ^ card A)
0 < r

goal (1 subgoal):
 1. \<And>x F r. \<lbrakk>finite F; x \<notin> F; \<And>r. 0 < r \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card F)) * r ^ card F); 0 < r\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>insert x F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card (insert x F))) * r ^ card (insert x F))
[PROOF STEP]
interpret product_sigma_finite "\<lambda>_. lborel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. product_sigma_finite (\<lambda>_. lborel)
[PROOF STEP]
by standard
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F r. \<lbrakk>finite F; x \<notin> F; \<And>r. 0 < r \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card F)) * r ^ card F); 0 < r\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>insert x F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card (insert x F))) * r ^ card (insert x F))
[PROOF STEP]
have "emeasure (Pi\<^sub>M (insert i A) (\<lambda>_. lborel))
            ({f. sqrt (\<Sum>i\<in>insert i A. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert i A) (\<lambda>_. lborel))) =
        nn_integral (Pi\<^sub>M (insert i A) (\<lambda>_. lborel))
          (indicator ({f. sqrt (\<Sum>i\<in>insert i A. (f i)\<^sup>2) \<le> r} \<inter>
          space (Pi\<^sub>M (insert i A) (\<lambda>_. lborel))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure (Pi\<^sub>M (insert i A) (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>insert i A. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert i A) (\<lambda>_. lborel))) = integral\<^sup>N (Pi\<^sub>M (insert i A) (\<lambda>_. lborel)) (indicator ({f. sqrt (\<Sum>i\<in>insert i A. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert i A) (\<lambda>_. lborel))))
[PROOF STEP]
by (subst nn_integral_indicator) auto
[PROOF STATE]
proof (state)
this:
emeasure (Pi\<^sub>M (insert i A) (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>insert i A. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert i A) (\<lambda>_. lborel))) = integral\<^sup>N (Pi\<^sub>M (insert i A) (\<lambda>_. lborel)) (indicator ({f. sqrt (\<Sum>i\<in>insert i A. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert i A) (\<lambda>_. lborel))))

goal (1 subgoal):
 1. \<And>x F r. \<lbrakk>finite F; x \<notin> F; \<And>r. 0 < r \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card F)) * r ^ card F); 0 < r\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>insert x F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card (insert x F))) * r ^ card (insert x F))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
emeasure (Pi\<^sub>M (insert i A) (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>insert i A. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert i A) (\<lambda>_. lborel))) = integral\<^sup>N (Pi\<^sub>M (insert i A) (\<lambda>_. lborel)) (indicator ({f. sqrt (\<Sum>i\<in>insert i A. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert i A) (\<lambda>_. lborel))))

goal (1 subgoal):
 1. \<And>x F r. \<lbrakk>finite F; x \<notin> F; \<And>r. 0 < r \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card F)) * r ^ card F); 0 < r\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>insert x F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card (insert x F))) * r ^ card (insert x F))
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+ y. \<integral>\<^sup>+ x. indicator ({f. sqrt ((f i)\<^sup>2 + (\<Sum>i\<in>A. (f i)\<^sup>2)) \<le> r} \<inter>
                                space (Pi\<^sub>M (insert i A) (\<lambda>_. lborel))) (x(i := y))
                   \<partial>Pi\<^sub>M A (\<lambda>_. lborel) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N (Pi\<^sub>M (insert i A) (\<lambda>_. lborel)) (indicator ({f. sqrt (\<Sum>i\<in>insert i A. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert i A) (\<lambda>_. lborel)))) = \<integral>\<^sup>+ y. \<integral>\<^sup>+ x. indicator ({f. sqrt ((f i)\<^sup>2 + (\<Sum>i\<in>A. (f i)\<^sup>2)) \<le> r} \<inter> space (Pi\<^sub>M (insert i A) (\<lambda>_. lborel))) (x(i := y)) \<partial>Pi\<^sub>M A (\<lambda>_. lborel) \<partial>lborel
[PROOF STEP]
using insert.prems insert.hyps
[PROOF STATE]
proof (prove)
using this:
0 < r
finite A
i \<notin> A

goal (1 subgoal):
 1. integral\<^sup>N (Pi\<^sub>M (insert i A) (\<lambda>_. lborel)) (indicator ({f. sqrt (\<Sum>i\<in>insert i A. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert i A) (\<lambda>_. lborel)))) = \<integral>\<^sup>+ y. \<integral>\<^sup>+ x. indicator ({f. sqrt ((f i)\<^sup>2 + (\<Sum>i\<in>A. (f i)\<^sup>2)) \<le> r} \<inter> space (Pi\<^sub>M (insert i A) (\<lambda>_. lborel))) (x(i := y)) \<partial>Pi\<^sub>M A (\<lambda>_. lborel) \<partial>lborel
[PROOF STEP]
by (subst product_nn_integral_insert_rev) auto
[PROOF STATE]
proof (state)
this:
integral\<^sup>N (Pi\<^sub>M (insert i A) (\<lambda>_. lborel)) (indicator ({f. sqrt (\<Sum>i\<in>insert i A. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert i A) (\<lambda>_. lborel)))) = \<integral>\<^sup>+ y. \<integral>\<^sup>+ x. indicator ({f. sqrt ((f i)\<^sup>2 + (\<Sum>i\<in>A. (f i)\<^sup>2)) \<le> r} \<inter> space (Pi\<^sub>M (insert i A) (\<lambda>_. lborel))) (x(i := y)) \<partial>Pi\<^sub>M A (\<lambda>_. lborel) \<partial>lborel

goal (1 subgoal):
 1. \<And>x F r. \<lbrakk>finite F; x \<notin> F; \<And>r. 0 < r \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card F)) * r ^ card F); 0 < r\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>insert x F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card (insert x F))) * r ^ card (insert x F))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
integral\<^sup>N (Pi\<^sub>M (insert i A) (\<lambda>_. lborel)) (indicator ({f. sqrt (\<Sum>i\<in>insert i A. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert i A) (\<lambda>_. lborel)))) = \<integral>\<^sup>+ y. \<integral>\<^sup>+ x. indicator ({f. sqrt ((f i)\<^sup>2 + (\<Sum>i\<in>A. (f i)\<^sup>2)) \<le> r} \<inter> space (Pi\<^sub>M (insert i A) (\<lambda>_. lborel))) (x(i := y)) \<partial>Pi\<^sub>M A (\<lambda>_. lborel) \<partial>lborel

goal (1 subgoal):
 1. \<And>x F r. \<lbrakk>finite F; x \<notin> F; \<And>r. 0 < r \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card F)) * r ^ card F); 0 < r\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>insert x F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card (insert x F))) * r ^ card (insert x F))
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+ (y::real). \<integral>\<^sup>+ x. indicator {-r..r} y * indicator ({f. sqrt ((\<Sum>i\<in>A. (f i)\<^sup>2)) \<le>
               sqrt (r ^ 2 - y ^ 2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) x \<partial>Pi\<^sub>M A (\<lambda>_. lborel) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ y. \<integral>\<^sup>+ x. indicator ({f. sqrt ((f i)\<^sup>2 + (\<Sum>i\<in>A. (f i)\<^sup>2)) \<le> r} \<inter> space (Pi\<^sub>M (insert i A) (\<lambda>_. lborel))) (x(i := y)) \<partial>Pi\<^sub>M A (\<lambda>_. lborel) \<partial>lborel = \<integral>\<^sup>+ y. (\<integral>\<^sup>+x\<in>{f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> sqrt (r\<^sup>2 - y\<^sup>2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel)). indicator {- r..r} y\<partial>Pi\<^sub>M A (\<lambda>_. lborel)) \<partial>lborel
[PROOF STEP]
proof (intro nn_integral_cong, goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>x \<in> space lborel; xa \<in> space (Pi\<^sub>M A (\<lambda>_. lborel))\<rbrakk> \<Longrightarrow> indicator ({f. sqrt ((f i)\<^sup>2 + (\<Sum>i\<in>A. (f i)\<^sup>2)) \<le> r} \<inter> space (Pi\<^sub>M (insert i A) (\<lambda>_. lborel))) (xa(i := x)) = indicator {- r..r} x * indicator ({f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> sqrt (r\<^sup>2 - x\<^sup>2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) xa
[PROOF STEP]
case (1 y f)
[PROOF STATE]
proof (state)
this:
y \<in> space lborel
f \<in> space (Pi\<^sub>M A (\<lambda>_. lborel))

goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>x \<in> space lborel; xa \<in> space (Pi\<^sub>M A (\<lambda>_. lborel))\<rbrakk> \<Longrightarrow> indicator ({f. sqrt ((f i)\<^sup>2 + (\<Sum>i\<in>A. (f i)\<^sup>2)) \<le> r} \<inter> space (Pi\<^sub>M (insert i A) (\<lambda>_. lborel))) (xa(i := x)) = indicator {- r..r} x * indicator ({f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> sqrt (r\<^sup>2 - x\<^sup>2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) xa
[PROOF STEP]
have *: "y \<in> {-r..r}" if "y ^ 2 + c \<le> r ^ 2" "c \<ge> 0" for c
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<in> {- r..r}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. y \<in> {- r..r}
[PROOF STEP]
have "y ^ 2 \<le> y ^ 2 + c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y\<^sup>2 \<le> y\<^sup>2 + c
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
y\<^sup>2 + c \<le> r\<^sup>2
0 \<le> c

goal (1 subgoal):
 1. y\<^sup>2 \<le> y\<^sup>2 + c
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
y\<^sup>2 \<le> y\<^sup>2 + c

goal (1 subgoal):
 1. y \<in> {- r..r}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
y\<^sup>2 \<le> y\<^sup>2 + c

goal (1 subgoal):
 1. y \<in> {- r..r}
[PROOF STEP]
have "\<dots> \<le> r ^ 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y\<^sup>2 + c \<le> r\<^sup>2
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
y\<^sup>2 + c \<le> r\<^sup>2

goal (1 subgoal):
 1. y \<in> {- r..r}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
y\<^sup>2 \<le> r\<^sup>2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
y\<^sup>2 \<le> r\<^sup>2

goal (1 subgoal):
 1. y \<in> {- r..r}
[PROOF STEP]
using \<open>r > 0\<close>
[PROOF STATE]
proof (prove)
using this:
y\<^sup>2 \<le> r\<^sup>2
0 < r

goal (1 subgoal):
 1. y \<in> {- r..r}
[PROOF STEP]
by (simp add: power2_le_iff_abs_le abs_if split: if_splits)
[PROOF STATE]
proof (state)
this:
y \<in> {- r..r}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>y\<^sup>2 + ?c \<le> r\<^sup>2; 0 \<le> ?c\<rbrakk> \<Longrightarrow> y \<in> {- r..r}

goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>x \<in> space lborel; xa \<in> space (Pi\<^sub>M A (\<lambda>_. lborel))\<rbrakk> \<Longrightarrow> indicator ({f. sqrt ((f i)\<^sup>2 + (\<Sum>i\<in>A. (f i)\<^sup>2)) \<le> r} \<inter> space (Pi\<^sub>M (insert i A) (\<lambda>_. lborel))) (xa(i := x)) = indicator {- r..r} x * indicator ({f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> sqrt (r\<^sup>2 - x\<^sup>2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) xa
[PROOF STEP]
have "(\<Sum>x\<in>A. (if x = i then y else f x)\<^sup>2) = (\<Sum>x\<in>A. (f x)\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>A. (if x = i then y else f x)\<^sup>2) = (\<Sum>x\<in>A. (f x)\<^sup>2)
[PROOF STEP]
using insert.hyps
[PROOF STATE]
proof (prove)
using this:
finite A
i \<notin> A

goal (1 subgoal):
 1. (\<Sum>x\<in>A. (if x = i then y else f x)\<^sup>2) = (\<Sum>x\<in>A. (f x)\<^sup>2)
[PROOF STEP]
by (intro sum.cong) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>A. (if x = i then y else f x)\<^sup>2) = (\<Sum>x\<in>A. (f x)\<^sup>2)

goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>x \<in> space lborel; xa \<in> space (Pi\<^sub>M A (\<lambda>_. lborel))\<rbrakk> \<Longrightarrow> indicator ({f. sqrt ((f i)\<^sup>2 + (\<Sum>i\<in>A. (f i)\<^sup>2)) \<le> r} \<inter> space (Pi\<^sub>M (insert i A) (\<lambda>_. lborel))) (xa(i := x)) = indicator {- r..r} x * indicator ({f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> sqrt (r\<^sup>2 - x\<^sup>2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) xa
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
(\<Sum>x\<in>A. (if x = i then y else f x)\<^sup>2) = (\<Sum>x\<in>A. (f x)\<^sup>2)

goal (1 subgoal):
 1. indicator ({f. sqrt ((f i)\<^sup>2 + (\<Sum>i\<in>A. (f i)\<^sup>2)) \<le> r} \<inter> space (Pi\<^sub>M (insert i A) (\<lambda>_. lborel))) (f(i := y)) = indicator {- r..r} y * indicator ({f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> sqrt (r\<^sup>2 - y\<^sup>2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) f
[PROOF STEP]
using 1 \<open>r > 0\<close>
[PROOF STATE]
proof (prove)
using this:
(\<Sum>x\<in>A. (if x = i then y else f x)\<^sup>2) = (\<Sum>x\<in>A. (f x)\<^sup>2)
y \<in> space lborel
f \<in> space (Pi\<^sub>M A (\<lambda>_. lborel))
0 < r

goal (1 subgoal):
 1. indicator ({f. sqrt ((f i)\<^sup>2 + (\<Sum>i\<in>A. (f i)\<^sup>2)) \<le> r} \<inter> space (Pi\<^sub>M (insert i A) (\<lambda>_. lborel))) (f(i := y)) = indicator {- r..r} y * indicator ({f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> sqrt (r\<^sup>2 - y\<^sup>2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) f
[PROOF STEP]
by (auto simp: sum_nonneg real_sqrt_le_iff' indicator_def PiE_def space_PiM dest!: *)
[PROOF STATE]
proof (state)
this:
indicator ({f. sqrt ((f i)\<^sup>2 + (\<Sum>i\<in>A. (f i)\<^sup>2)) \<le> r} \<inter> space (Pi\<^sub>M (insert i A) (\<lambda>_. lborel))) (f(i := y)) = indicator {- r..r} y * indicator ({f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> sqrt (r\<^sup>2 - y\<^sup>2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) f

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ y. \<integral>\<^sup>+ x. indicator ({f. sqrt ((f i)\<^sup>2 + (\<Sum>i\<in>A. (f i)\<^sup>2)) \<le> r} \<inter> space (Pi\<^sub>M (insert i A) (\<lambda>_. lborel))) (x(i := y)) \<partial>Pi\<^sub>M A (\<lambda>_. lborel) \<partial>lborel = \<integral>\<^sup>+ y. (\<integral>\<^sup>+x\<in>{f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> sqrt (r\<^sup>2 - y\<^sup>2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel)). indicator {- r..r} y\<partial>Pi\<^sub>M A (\<lambda>_. lborel)) \<partial>lborel

goal (1 subgoal):
 1. \<And>x F r. \<lbrakk>finite F; x \<notin> F; \<And>r. 0 < r \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card F)) * r ^ card F); 0 < r\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>insert x F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card (insert x F))) * r ^ card (insert x F))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ y. \<integral>\<^sup>+ x. indicator ({f. sqrt ((f i)\<^sup>2 + (\<Sum>i\<in>A. (f i)\<^sup>2)) \<le> r} \<inter> space (Pi\<^sub>M (insert i A) (\<lambda>_. lborel))) (x(i := y)) \<partial>Pi\<^sub>M A (\<lambda>_. lborel) \<partial>lborel = \<integral>\<^sup>+ y. (\<integral>\<^sup>+x\<in>{f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> sqrt (r\<^sup>2 - y\<^sup>2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel)). indicator {- r..r} y\<partial>Pi\<^sub>M A (\<lambda>_. lborel)) \<partial>lborel

goal (1 subgoal):
 1. \<And>x F r. \<lbrakk>finite F; x \<notin> F; \<And>r. 0 < r \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card F)) * r ^ card F); 0 < r\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>insert x F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card (insert x F))) * r ^ card (insert x F))
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+ (y::real). indicator {-r..r} y * (\<integral>\<^sup>+ x. indicator ({f. sqrt ((\<Sum>i\<in>A. (f i)\<^sup>2))
                                   \<le> sqrt (r ^ 2 - y ^ 2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) x
                  \<partial>Pi\<^sub>M A (\<lambda>_. lborel)) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ y. (\<integral>\<^sup>+x\<in>{f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> sqrt (r\<^sup>2 - y\<^sup>2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel)). indicator {- r..r} y\<partial>Pi\<^sub>M A (\<lambda>_. lborel)) \<partial>lborel = \<integral>\<^sup>+ y. indicator {- r..r} y * integral\<^sup>N (Pi\<^sub>M A (\<lambda>_. lborel)) (indicator ({f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> sqrt (r\<^sup>2 - y\<^sup>2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel)))) \<partial>lborel
[PROOF STEP]
by (subst nn_integral_cmult) auto
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ y. (\<integral>\<^sup>+x\<in>{f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> sqrt (r\<^sup>2 - y\<^sup>2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel)). indicator {- r..r} y\<partial>Pi\<^sub>M A (\<lambda>_. lborel)) \<partial>lborel = \<integral>\<^sup>+ y. indicator {- r..r} y * integral\<^sup>N (Pi\<^sub>M A (\<lambda>_. lborel)) (indicator ({f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> sqrt (r\<^sup>2 - y\<^sup>2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel)))) \<partial>lborel

goal (1 subgoal):
 1. \<And>x F r. \<lbrakk>finite F; x \<notin> F; \<And>r. 0 < r \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card F)) * r ^ card F); 0 < r\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>insert x F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card (insert x F))) * r ^ card (insert x F))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ y. (\<integral>\<^sup>+x\<in>{f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> sqrt (r\<^sup>2 - y\<^sup>2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel)). indicator {- r..r} y\<partial>Pi\<^sub>M A (\<lambda>_. lborel)) \<partial>lborel = \<integral>\<^sup>+ y. indicator {- r..r} y * integral\<^sup>N (Pi\<^sub>M A (\<lambda>_. lborel)) (indicator ({f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> sqrt (r\<^sup>2 - y\<^sup>2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel)))) \<partial>lborel

goal (1 subgoal):
 1. \<And>x F r. \<lbrakk>finite F; x \<notin> F; \<And>r. 0 < r \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card F)) * r ^ card F); 0 < r\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>insert x F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card (insert x F))) * r ^ card (insert x F))
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+ (y::real). indicator {-r..r} y * emeasure (PiM A (\<lambda>_. lborel))
      ({f. sqrt ((\<Sum>i\<in>A. (f i)\<^sup>2)) \<le> sqrt (r ^ 2 - y ^ 2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ y. indicator {- r..r} y * integral\<^sup>N (Pi\<^sub>M A (\<lambda>_. lborel)) (indicator ({f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> sqrt (r\<^sup>2 - y\<^sup>2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel)))) \<partial>lborel = \<integral>\<^sup>+ y. indicator {- r..r} y * emeasure (Pi\<^sub>M A (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> sqrt (r\<^sup>2 - y\<^sup>2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) \<partial>lborel
[PROOF STEP]
using \<open>finite A\<close>
[PROOF STATE]
proof (prove)
using this:
finite A

goal (1 subgoal):
 1. \<integral>\<^sup>+ y. indicator {- r..r} y * integral\<^sup>N (Pi\<^sub>M A (\<lambda>_. lborel)) (indicator ({f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> sqrt (r\<^sup>2 - y\<^sup>2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel)))) \<partial>lborel = \<integral>\<^sup>+ y. indicator {- r..r} y * emeasure (Pi\<^sub>M A (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> sqrt (r\<^sup>2 - y\<^sup>2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) \<partial>lborel
[PROOF STEP]
by (intro nn_integral_cong, subst nn_integral_indicator) auto
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ y. indicator {- r..r} y * integral\<^sup>N (Pi\<^sub>M A (\<lambda>_. lborel)) (indicator ({f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> sqrt (r\<^sup>2 - y\<^sup>2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel)))) \<partial>lborel = \<integral>\<^sup>+ y. indicator {- r..r} y * emeasure (Pi\<^sub>M A (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> sqrt (r\<^sup>2 - y\<^sup>2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) \<partial>lborel

goal (1 subgoal):
 1. \<And>x F r. \<lbrakk>finite F; x \<notin> F; \<And>r. 0 < r \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card F)) * r ^ card F); 0 < r\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>insert x F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card (insert x F))) * r ^ card (insert x F))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ y. indicator {- r..r} y * integral\<^sup>N (Pi\<^sub>M A (\<lambda>_. lborel)) (indicator ({f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> sqrt (r\<^sup>2 - y\<^sup>2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel)))) \<partial>lborel = \<integral>\<^sup>+ y. indicator {- r..r} y * emeasure (Pi\<^sub>M A (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> sqrt (r\<^sup>2 - y\<^sup>2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) \<partial>lborel

goal (1 subgoal):
 1. \<And>x F r. \<lbrakk>finite F; x \<notin> F; \<And>r. 0 < r \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card F)) * r ^ card F); 0 < r\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>insert x F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card (insert x F))) * r ^ card (insert x F))
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+ (y::real). indicator {-r..r} y * ennreal (unit_ball_vol (real (card A)) *
                                  (sqrt (r ^ 2 - y ^ 2)) ^ card A) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ y. indicator {- r..r} y * emeasure (Pi\<^sub>M A (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> sqrt (r\<^sup>2 - y\<^sup>2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) \<partial>lborel = \<integral>\<^sup>+ y. indicator {- r..r} y * ennreal (unit_ball_vol (real (card A)) * sqrt (r\<^sup>2 - y\<^sup>2) ^ card A) \<partial>lborel
[PROOF STEP]
proof (intro nn_integral_cong_AE, goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. AE x in lborel. indicator {- r..r} x * emeasure (Pi\<^sub>M A (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> sqrt (r\<^sup>2 - x\<^sup>2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) = indicator {- r..r} x * ennreal (unit_ball_vol (real (card A)) * sqrt (r\<^sup>2 - x\<^sup>2) ^ card A)
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:

goal (1 subgoal):
 1. AE x in lborel. indicator {- r..r} x * emeasure (Pi\<^sub>M A (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> sqrt (r\<^sup>2 - x\<^sup>2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) = indicator {- r..r} x * ennreal (unit_ball_vol (real (card A)) * sqrt (r\<^sup>2 - x\<^sup>2) ^ card A)
[PROOF STEP]
have "AE y in lborel. y \<notin> {-r,r}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE y in lborel. y \<notin> {- r, r}
[PROOF STEP]
by (intro AE_not_in countable_imp_null_set_lborel) auto
[PROOF STATE]
proof (state)
this:
AE y in lborel. y \<notin> {- r, r}

goal (1 subgoal):
 1. AE x in lborel. indicator {- r..r} x * emeasure (Pi\<^sub>M A (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> sqrt (r\<^sup>2 - x\<^sup>2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) = indicator {- r..r} x * ennreal (unit_ball_vol (real (card A)) * sqrt (r\<^sup>2 - x\<^sup>2) ^ card A)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
AE y in lborel. y \<notin> {- r, r}

goal (1 subgoal):
 1. AE x in lborel. indicator {- r..r} x * emeasure (Pi\<^sub>M A (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> sqrt (r\<^sup>2 - x\<^sup>2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) = indicator {- r..r} x * ennreal (unit_ball_vol (real (card A)) * sqrt (r\<^sup>2 - x\<^sup>2) ^ card A)
[PROOF STEP]
proof eventually_elim
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<notin> {- r, r} \<Longrightarrow> indicator {- r..r} x * emeasure (Pi\<^sub>M A (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> sqrt (r\<^sup>2 - x\<^sup>2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) = indicator {- r..r} x * ennreal (unit_ball_vol (real (card A)) * sqrt (r\<^sup>2 - x\<^sup>2) ^ card A)
[PROOF STEP]
case (elim y)
[PROOF STATE]
proof (state)
this:
y \<notin> {- r, r}

goal (1 subgoal):
 1. \<And>x. x \<notin> {- r, r} \<Longrightarrow> indicator {- r..r} x * emeasure (Pi\<^sub>M A (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> sqrt (r\<^sup>2 - x\<^sup>2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) = indicator {- r..r} x * ennreal (unit_ball_vol (real (card A)) * sqrt (r\<^sup>2 - x\<^sup>2) ^ card A)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indicator {- r..r} y * emeasure (Pi\<^sub>M A (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> sqrt (r\<^sup>2 - y\<^sup>2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) = indicator {- r..r} y * ennreal (unit_ball_vol (real (card A)) * sqrt (r\<^sup>2 - y\<^sup>2) ^ card A)
[PROOF STEP]
proof (cases "y \<in> {-r<..<r}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. y \<in> {- r<..<r} \<Longrightarrow> indicator {- r..r} y * emeasure (Pi\<^sub>M A (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> sqrt (r\<^sup>2 - y\<^sup>2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) = indicator {- r..r} y * ennreal (unit_ball_vol (real (card A)) * sqrt (r\<^sup>2 - y\<^sup>2) ^ card A)
 2. y \<notin> {- r<..<r} \<Longrightarrow> indicator {- r..r} y * emeasure (Pi\<^sub>M A (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> sqrt (r\<^sup>2 - y\<^sup>2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) = indicator {- r..r} y * ennreal (unit_ball_vol (real (card A)) * sqrt (r\<^sup>2 - y\<^sup>2) ^ card A)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
y \<in> {- r<..<r}

goal (2 subgoals):
 1. y \<in> {- r<..<r} \<Longrightarrow> indicator {- r..r} y * emeasure (Pi\<^sub>M A (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> sqrt (r\<^sup>2 - y\<^sup>2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) = indicator {- r..r} y * ennreal (unit_ball_vol (real (card A)) * sqrt (r\<^sup>2 - y\<^sup>2) ^ card A)
 2. y \<notin> {- r<..<r} \<Longrightarrow> indicator {- r..r} y * emeasure (Pi\<^sub>M A (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> sqrt (r\<^sup>2 - y\<^sup>2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) = indicator {- r..r} y * ennreal (unit_ball_vol (real (card A)) * sqrt (r\<^sup>2 - y\<^sup>2) ^ card A)
[PROOF STEP]
hence "y\<^sup>2 < r\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
y \<in> {- r<..<r}

goal (1 subgoal):
 1. y\<^sup>2 < r\<^sup>2
[PROOF STEP]
by (subst real_sqrt_less_iff [symmetric]) auto
[PROOF STATE]
proof (state)
this:
y\<^sup>2 < r\<^sup>2

goal (2 subgoals):
 1. y \<in> {- r<..<r} \<Longrightarrow> indicator {- r..r} y * emeasure (Pi\<^sub>M A (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> sqrt (r\<^sup>2 - y\<^sup>2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) = indicator {- r..r} y * ennreal (unit_ball_vol (real (card A)) * sqrt (r\<^sup>2 - y\<^sup>2) ^ card A)
 2. y \<notin> {- r<..<r} \<Longrightarrow> indicator {- r..r} y * emeasure (Pi\<^sub>M A (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> sqrt (r\<^sup>2 - y\<^sup>2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) = indicator {- r..r} y * ennreal (unit_ball_vol (real (card A)) * sqrt (r\<^sup>2 - y\<^sup>2) ^ card A)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
y\<^sup>2 < r\<^sup>2

goal (1 subgoal):
 1. indicator {- r..r} y * emeasure (Pi\<^sub>M A (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> sqrt (r\<^sup>2 - y\<^sup>2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) = indicator {- r..r} y * ennreal (unit_ball_vol (real (card A)) * sqrt (r\<^sup>2 - y\<^sup>2) ^ card A)
[PROOF STEP]
by (subst insert.IH) (auto)
[PROOF STATE]
proof (state)
this:
indicator {- r..r} y * emeasure (Pi\<^sub>M A (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> sqrt (r\<^sup>2 - y\<^sup>2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) = indicator {- r..r} y * ennreal (unit_ball_vol (real (card A)) * sqrt (r\<^sup>2 - y\<^sup>2) ^ card A)

goal (1 subgoal):
 1. y \<notin> {- r<..<r} \<Longrightarrow> indicator {- r..r} y * emeasure (Pi\<^sub>M A (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> sqrt (r\<^sup>2 - y\<^sup>2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) = indicator {- r..r} y * ennreal (unit_ball_vol (real (card A)) * sqrt (r\<^sup>2 - y\<^sup>2) ^ card A)
[PROOF STEP]
qed (insert elim, auto)
[PROOF STATE]
proof (state)
this:
indicator {- r..r} y * emeasure (Pi\<^sub>M A (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> sqrt (r\<^sup>2 - y\<^sup>2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) = indicator {- r..r} y * ennreal (unit_ball_vol (real (card A)) * sqrt (r\<^sup>2 - y\<^sup>2) ^ card A)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
AE x in lborel. indicator {- r..r} x * emeasure (Pi\<^sub>M A (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> sqrt (r\<^sup>2 - x\<^sup>2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) = indicator {- r..r} x * ennreal (unit_ball_vol (real (card A)) * sqrt (r\<^sup>2 - x\<^sup>2) ^ card A)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ y. indicator {- r..r} y * emeasure (Pi\<^sub>M A (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> sqrt (r\<^sup>2 - y\<^sup>2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) \<partial>lborel = \<integral>\<^sup>+ y. indicator {- r..r} y * ennreal (unit_ball_vol (real (card A)) * sqrt (r\<^sup>2 - y\<^sup>2) ^ card A) \<partial>lborel

goal (1 subgoal):
 1. \<And>x F r. \<lbrakk>finite F; x \<notin> F; \<And>r. 0 < r \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card F)) * r ^ card F); 0 < r\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>insert x F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card (insert x F))) * r ^ card (insert x F))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ y. indicator {- r..r} y * emeasure (Pi\<^sub>M A (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>A. (f i)\<^sup>2) \<le> sqrt (r\<^sup>2 - y\<^sup>2)} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) \<partial>lborel = \<integral>\<^sup>+ y. indicator {- r..r} y * ennreal (unit_ball_vol (real (card A)) * sqrt (r\<^sup>2 - y\<^sup>2) ^ card A) \<partial>lborel

goal (1 subgoal):
 1. \<And>x F r. \<lbrakk>finite F; x \<notin> F; \<And>r. 0 < r \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card F)) * r ^ card F); 0 < r\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>insert x F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card (insert x F))) * r ^ card (insert x F))
[PROOF STEP]
have "\<dots> = ennreal (unit_ball_vol (real (card A))) *
                    (\<integral>\<^sup>+ (y::real). indicator {-r..r} y * (sqrt (r ^ 2 - y ^ 2)) ^ card A \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ y. indicator {- r..r} y * ennreal (unit_ball_vol (real (card A)) * sqrt (r\<^sup>2 - y\<^sup>2) ^ card A) \<partial>lborel = ennreal (unit_ball_vol (real (card A))) * \<integral>\<^sup>+ x. ennreal (indicat_real {- r..r} x * sqrt (r\<^sup>2 - x\<^sup>2) ^ card A) \<partial>lborel
[PROOF STEP]
by (subst nn_integral_cmult [symmetric])
       (auto simp: mult_ac ennreal_mult' [symmetric] indicator_def intro!: nn_integral_cong)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ y. indicator {- r..r} y * ennreal (unit_ball_vol (real (card A)) * sqrt (r\<^sup>2 - y\<^sup>2) ^ card A) \<partial>lborel = ennreal (unit_ball_vol (real (card A))) * \<integral>\<^sup>+ x. ennreal (indicat_real {- r..r} x * sqrt (r\<^sup>2 - x\<^sup>2) ^ card A) \<partial>lborel

goal (1 subgoal):
 1. \<And>x F r. \<lbrakk>finite F; x \<notin> F; \<And>r. 0 < r \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card F)) * r ^ card F); 0 < r\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>insert x F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card (insert x F))) * r ^ card (insert x F))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ y. indicator {- r..r} y * ennreal (unit_ball_vol (real (card A)) * sqrt (r\<^sup>2 - y\<^sup>2) ^ card A) \<partial>lborel = ennreal (unit_ball_vol (real (card A))) * \<integral>\<^sup>+ x. ennreal (indicat_real {- r..r} x * sqrt (r\<^sup>2 - x\<^sup>2) ^ card A) \<partial>lborel

goal (1 subgoal):
 1. \<And>x F r. \<lbrakk>finite F; x \<notin> F; \<And>r. 0 < r \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card F)) * r ^ card F); 0 < r\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>insert x F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card (insert x F))) * r ^ card (insert x F))
[PROOF STEP]
have "(\<integral>\<^sup>+ (y::real). indicator {-r..r} y * (sqrt (r ^ 2 - y ^ 2)) ^ card A \<partial>lborel) =
               (\<integral>\<^sup>+ (y::real). r ^ card A * indicator {-1..1} y * (sqrt (1 - y ^ 2)) ^ card A
               \<partial>(distr lborel borel ((*) (1/r))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real {- r..r} x * sqrt (r\<^sup>2 - x\<^sup>2) ^ card A) \<partial>lborel = \<integral>\<^sup>+ x. ennreal (r ^ card A * indicat_real {- 1..1} x * sqrt (1 - x\<^sup>2) ^ card A) \<partial>distr lborel borel ((*) (1 / r))
[PROOF STEP]
using \<open>r > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < r

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real {- r..r} x * sqrt (r\<^sup>2 - x\<^sup>2) ^ card A) \<partial>lborel = \<integral>\<^sup>+ x. ennreal (r ^ card A * indicat_real {- 1..1} x * sqrt (1 - x\<^sup>2) ^ card A) \<partial>distr lborel borel ((*) (1 / r))
[PROOF STEP]
by (subst nn_integral_distr)
       (auto simp: indicator_def field_simps real_sqrt_divide intro!: nn_integral_cong)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (indicat_real {- r..r} x * sqrt (r\<^sup>2 - x\<^sup>2) ^ card A) \<partial>lborel = \<integral>\<^sup>+ x. ennreal (r ^ card A * indicat_real {- 1..1} x * sqrt (1 - x\<^sup>2) ^ card A) \<partial>distr lborel borel ((*) (1 / r))

goal (1 subgoal):
 1. \<And>x F r. \<lbrakk>finite F; x \<notin> F; \<And>r. 0 < r \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card F)) * r ^ card F); 0 < r\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>insert x F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card (insert x F))) * r ^ card (insert x F))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (indicat_real {- r..r} x * sqrt (r\<^sup>2 - x\<^sup>2) ^ card A) \<partial>lborel = \<integral>\<^sup>+ x. ennreal (r ^ card A * indicat_real {- 1..1} x * sqrt (1 - x\<^sup>2) ^ card A) \<partial>distr lborel borel ((*) (1 / r))

goal (1 subgoal):
 1. \<And>x F r. \<lbrakk>finite F; x \<notin> F; \<And>r. 0 < r \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card F)) * r ^ card F); 0 < r\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>insert x F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card (insert x F))) * r ^ card (insert x F))
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+ x. ennreal (r ^ Suc (card A)) *
               (indicator {- 1..1} x * sqrt (1 - x\<^sup>2) ^ card A) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (r ^ card A * indicat_real {- 1..1} x * sqrt (1 - x\<^sup>2) ^ card A) \<partial>distr lborel borel ((*) (1 / r)) = \<integral>\<^sup>+ x. ennreal (r ^ Suc (card A)) * ennreal (indicat_real {- 1..1} x * sqrt (1 - x\<^sup>2) ^ card A) \<partial>lborel
[PROOF STEP]
using \<open>r > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < r

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (r ^ card A * indicat_real {- 1..1} x * sqrt (1 - x\<^sup>2) ^ card A) \<partial>distr lborel borel ((*) (1 / r)) = \<integral>\<^sup>+ x. ennreal (r ^ Suc (card A)) * ennreal (indicat_real {- 1..1} x * sqrt (1 - x\<^sup>2) ^ card A) \<partial>lborel
[PROOF STEP]
by (subst lborel_distr_mult) (auto simp: nn_integral_density ennreal_mult' [symmetric] mult_ac)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (r ^ card A * indicat_real {- 1..1} x * sqrt (1 - x\<^sup>2) ^ card A) \<partial>distr lborel borel ((*) (1 / r)) = \<integral>\<^sup>+ x. ennreal (r ^ Suc (card A)) * ennreal (indicat_real {- 1..1} x * sqrt (1 - x\<^sup>2) ^ card A) \<partial>lborel

goal (1 subgoal):
 1. \<And>x F r. \<lbrakk>finite F; x \<notin> F; \<And>r. 0 < r \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card F)) * r ^ card F); 0 < r\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>insert x F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card (insert x F))) * r ^ card (insert x F))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (r ^ card A * indicat_real {- 1..1} x * sqrt (1 - x\<^sup>2) ^ card A) \<partial>distr lborel borel ((*) (1 / r)) = \<integral>\<^sup>+ x. ennreal (r ^ Suc (card A)) * ennreal (indicat_real {- 1..1} x * sqrt (1 - x\<^sup>2) ^ card A) \<partial>lborel

goal (1 subgoal):
 1. \<And>x F r. \<lbrakk>finite F; x \<notin> F; \<And>r. 0 < r \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card F)) * r ^ card F); 0 < r\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>insert x F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card (insert x F))) * r ^ card (insert x F))
[PROOF STEP]
have "\<dots> = ennreal (r ^ Suc (card A)) * (\<integral>\<^sup>+ x. indicator {- 1..1} x *
                    sqrt (1 - x\<^sup>2) ^ card A \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (r ^ Suc (card A)) * ennreal (indicat_real {- 1..1} x * sqrt (1 - x\<^sup>2) ^ card A) \<partial>lborel = ennreal (r ^ Suc (card A)) * \<integral>\<^sup>+ x. ennreal (indicat_real {- 1..1} x * sqrt (1 - x\<^sup>2) ^ card A) \<partial>lborel
[PROOF STEP]
by (subst nn_integral_cmult) auto
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (r ^ Suc (card A)) * ennreal (indicat_real {- 1..1} x * sqrt (1 - x\<^sup>2) ^ card A) \<partial>lborel = ennreal (r ^ Suc (card A)) * \<integral>\<^sup>+ x. ennreal (indicat_real {- 1..1} x * sqrt (1 - x\<^sup>2) ^ card A) \<partial>lborel

goal (1 subgoal):
 1. \<And>x F r. \<lbrakk>finite F; x \<notin> F; \<And>r. 0 < r \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card F)) * r ^ card F); 0 < r\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>insert x F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card (insert x F))) * r ^ card (insert x F))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (r ^ Suc (card A)) * ennreal (indicat_real {- 1..1} x * sqrt (1 - x\<^sup>2) ^ card A) \<partial>lborel = ennreal (r ^ Suc (card A)) * \<integral>\<^sup>+ x. ennreal (indicat_real {- 1..1} x * sqrt (1 - x\<^sup>2) ^ card A) \<partial>lborel

goal (1 subgoal):
 1. \<And>x F r. \<lbrakk>finite F; x \<notin> F; \<And>r. 0 < r \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card F)) * r ^ card F); 0 < r\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>insert x F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card (insert x F))) * r ^ card (insert x F))
[PROOF STEP]
note emeasure_cball_aux_integral
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (indicat_real {- 1..1} x * sqrt (1 - x\<^sup>2) ^ ?n) \<partial>lborel = ennreal (Beta (1 / 2) (real ?n / 2 + 1))

goal (1 subgoal):
 1. \<And>x F r. \<lbrakk>finite F; x \<notin> F; \<And>r. 0 < r \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card F)) * r ^ card F); 0 < r\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>insert x F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card (insert x F))) * r ^ card (insert x F))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (indicat_real {- 1..1} x * sqrt (1 - x\<^sup>2) ^ ?n) \<partial>lborel = ennreal (Beta (1 / 2) (real ?n / 2 + 1))

goal (1 subgoal):
 1. \<And>x F r. \<lbrakk>finite F; x \<notin> F; \<And>r. 0 < r \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card F)) * r ^ card F); 0 < r\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>insert x F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card (insert x F))) * r ^ card (insert x F))
[PROOF STEP]
have "ennreal (unit_ball_vol (real (card A))) * (ennreal (r ^ Suc (card A)) *
                 ennreal (Beta (1/2) (card A / 2 + 1))) =
               ennreal (unit_ball_vol (card A) * Beta (1/2) (card A / 2 + 1) * r ^ Suc (card A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ennreal (unit_ball_vol (real (card A))) * (ennreal (r ^ Suc (card A)) * ennreal (Beta (1 / 2) (real (card A) / 2 + 1))) = ennreal (unit_ball_vol (real (card A)) * Beta (1 / 2) (real (card A) / 2 + 1) * r ^ Suc (card A))
[PROOF STEP]
using \<open>r > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < r

goal (1 subgoal):
 1. ennreal (unit_ball_vol (real (card A))) * (ennreal (r ^ Suc (card A)) * ennreal (Beta (1 / 2) (real (card A) / 2 + 1))) = ennreal (unit_ball_vol (real (card A)) * Beta (1 / 2) (real (card A) / 2 + 1) * r ^ Suc (card A))
[PROOF STEP]
by (simp add: ennreal_mult' [symmetric] mult_ac)
[PROOF STATE]
proof (state)
this:
ennreal (unit_ball_vol (real (card A))) * (ennreal (r ^ Suc (card A)) * ennreal (Beta (1 / 2) (real (card A) / 2 + 1))) = ennreal (unit_ball_vol (real (card A)) * Beta (1 / 2) (real (card A) / 2 + 1) * r ^ Suc (card A))

goal (1 subgoal):
 1. \<And>x F r. \<lbrakk>finite F; x \<notin> F; \<And>r. 0 < r \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card F)) * r ^ card F); 0 < r\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>insert x F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card (insert x F))) * r ^ card (insert x F))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ennreal (unit_ball_vol (real (card A))) * (ennreal (r ^ Suc (card A)) * ennreal (Beta (1 / 2) (real (card A) / 2 + 1))) = ennreal (unit_ball_vol (real (card A)) * Beta (1 / 2) (real (card A) / 2 + 1) * r ^ Suc (card A))

goal (1 subgoal):
 1. \<And>x F r. \<lbrakk>finite F; x \<notin> F; \<And>r. 0 < r \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card F)) * r ^ card F); 0 < r\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>insert x F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card (insert x F))) * r ^ card (insert x F))
[PROOF STEP]
have "unit_ball_vol (card A) * Beta (1/2) (card A / 2 + 1) = unit_ball_vol (Suc (card A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unit_ball_vol (real (card A)) * Beta (1 / 2) (real (card A) / 2 + 1) = unit_ball_vol (real (Suc (card A)))
[PROOF STEP]
by (auto simp: unit_ball_vol_def Beta_def Gamma_eq_zero_iff field_simps
          Gamma_one_half_real powr_half_sqrt [symmetric] powr_add [symmetric])
[PROOF STATE]
proof (state)
this:
unit_ball_vol (real (card A)) * Beta (1 / 2) (real (card A) / 2 + 1) = unit_ball_vol (real (Suc (card A)))

goal (1 subgoal):
 1. \<And>x F r. \<lbrakk>finite F; x \<notin> F; \<And>r. 0 < r \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card F)) * r ^ card F); 0 < r\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>insert x F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card (insert x F))) * r ^ card (insert x F))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
unit_ball_vol (real (card A)) * Beta (1 / 2) (real (card A) / 2 + 1) = unit_ball_vol (real (Suc (card A)))

goal (1 subgoal):
 1. \<And>x F r. \<lbrakk>finite F; x \<notin> F; \<And>r. 0 < r \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card F)) * r ^ card F); 0 < r\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>insert x F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card (insert x F))) * r ^ card (insert x F))
[PROOF STEP]
have "Suc (card A) = card (insert i A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc (card A) = card (insert i A)
[PROOF STEP]
using insert.hyps
[PROOF STATE]
proof (prove)
using this:
finite A
i \<notin> A

goal (1 subgoal):
 1. Suc (card A) = card (insert i A)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Suc (card A) = card (insert i A)

goal (1 subgoal):
 1. \<And>x F r. \<lbrakk>finite F; x \<notin> F; \<And>r. 0 < r \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card F)) * r ^ card F); 0 < r\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>insert x F. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card (insert x F))) * r ^ card (insert x F))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
emeasure (Pi\<^sub>M (insert i A) (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>insert i A. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert i A) (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card (insert i A))) * r ^ card (insert i A))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
emeasure (Pi\<^sub>M (insert i A) (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>insert i A. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert i A) (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card (insert i A))) * r ^ card (insert i A))

goal (1 subgoal):
 1. emeasure (Pi\<^sub>M (insert i A) (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>insert i A. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert i A) (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card (insert i A))) * r ^ card (insert i A))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
emeasure (Pi\<^sub>M (insert i A) (\<lambda>_. lborel)) ({f. sqrt (\<Sum>i\<in>insert i A. (f i)\<^sup>2) \<le> r} \<inter> space (Pi\<^sub>M (insert i A) (\<lambda>_. lborel))) = ennreal (unit_ball_vol (real (card (insert i A))) * r ^ card (insert i A))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma times_ms_aux_MSLCons_eval: "times_ms_aux (MSLCons (c1, e1) xs) (MSLCons (c2, e2) ys) =
  MSLCons (c1 * c2, e1 + e2) (plus_ms_aux (scale_shift_ms_aux (c1, e1) ys)
    (times_ms_aux xs (MSLCons (c2, e2) ys)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. times_ms_aux (MSLCons (c1, e1) xs) (MSLCons (c2, e2) ys) = MSLCons (c1 * c2, e1 + e2) (plus_ms_aux (scale_shift_ms_aux (c1, e1) ys) (times_ms_aux xs (MSLCons (c2, e2) ys)))
[PROOF STEP]
by (simp add: times_ms_aux_MSLCons)


[STATEMENT]
lemma sets_PiF:
  "sets (PiF I M) = sigma_sets (\<Union>J \<in> I. (\<Pi>' j\<in>J. space (M j)))
    {(\<Pi>' j\<in>J. X j) |X J. J \<in> I \<and> X \<in> (\<Pi> j\<in>J. sets (M j))}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sets (Pi\<^sub>F I M) = sigma_sets (\<Union>J\<in>I. \<Pi>' j\<in>J. space (M j)) {Pi' J X |X J. J \<in> I \<and> X \<in> (\<Pi> j\<in>J. sets (M j))}
[PROOF STEP]
unfolding PiF_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sets (sigma (\<Union>J\<in>I. \<Pi>' j\<in>J. space (M j)) {Pi' J X |X J. J \<in> I \<and> X \<in> (\<Pi> j\<in>J. sets (M j))}) = sigma_sets (\<Union>J\<in>I. \<Pi>' j\<in>J. space (M j)) {Pi' J X |X J. J \<in> I \<and> X \<in> (\<Pi> j\<in>J. sets (M j))}
[PROOF STEP]
using PiF_gen_subset
[PROOF STATE]
proof (prove)
using this:
{Pi' J X |X J. J \<in> ?I \<and> X \<in> (\<Pi> j\<in>J. sets (?M j))} \<subseteq> Pow (\<Union>J\<in>?I. \<Pi>' j\<in>J. space (?M j))

goal (1 subgoal):
 1. sets (sigma (\<Union>J\<in>I. \<Pi>' j\<in>J. space (M j)) {Pi' J X |X J. J \<in> I \<and> X \<in> (\<Pi> j\<in>J. sets (M j))}) = sigma_sets (\<Union>J\<in>I. \<Pi>' j\<in>J. space (M j)) {Pi' J X |X J. J \<in> I \<and> X \<in> (\<Pi> j\<in>J. sets (M j))}
[PROOF STEP]
by (rule sets_measure_of)


[STATEMENT]
lemma lookup_default_fold_combine_plus:
  fixes A :: "'b set" and f :: "'b \<Rightarrow> ('a, real) mapping"
  assumes "finite A"
  shows   "Mapping.lookup_default 0 (fold_combine_plus f A) x =
             (\<Sum>y\<in>A. Mapping.lookup_default 0 (f y) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Mapping.lookup_default 0 (fold_combine_plus f A) x = (\<Sum>y\<in>A. Mapping.lookup_default 0 (f y) x)
[PROOF STEP]
unfolding fold_combine_plus_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Mapping.lookup_default 0 (fold_combine_plus.combine.F f A) x = (\<Sum>y\<in>A. Mapping.lookup_default 0 (f y) x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A

goal (1 subgoal):
 1. Mapping.lookup_default 0 (fold_combine_plus.combine.F f A) x = (\<Sum>y\<in>A. Mapping.lookup_default 0 (f y) x)
[PROOF STEP]
by (induction A rule: finite_induct)
       (simp_all add: lookup_default_empty lookup_default_neutral_combine)


[STATEMENT]
lemma limitin_transform_eventually:
   "\<lbrakk>eventually (\<lambda>x. f x = g x) F; limitin X f l F\<rbrakk> \<Longrightarrow> limitin X g l F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>\<^sub>F x in F. f x = g x; limitin X f l F\<rbrakk> \<Longrightarrow> limitin X g l F
[PROOF STEP]
unfolding limitin_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>\<^sub>F x in F. f x = g x; l \<in> topspace X \<and> (\<forall>U. openin X U \<and> l \<in> U \<longrightarrow> (\<forall>\<^sub>F x in F. f x \<in> U))\<rbrakk> \<Longrightarrow> l \<in> topspace X \<and> (\<forall>U. openin X U \<and> l \<in> U \<longrightarrow> (\<forall>\<^sub>F x in F. g x \<in> U))
[PROOF STEP]
using eventually_elim2
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>eventually ?P ?F; eventually ?Q ?F; \<And>i. \<lbrakk>?P i; ?Q i\<rbrakk> \<Longrightarrow> ?R i\<rbrakk> \<Longrightarrow> eventually ?R ?F

goal (1 subgoal):
 1. \<lbrakk>\<forall>\<^sub>F x in F. f x = g x; l \<in> topspace X \<and> (\<forall>U. openin X U \<and> l \<in> U \<longrightarrow> (\<forall>\<^sub>F x in F. f x \<in> U))\<rbrakk> \<Longrightarrow> l \<in> topspace X \<and> (\<forall>U. openin X U \<and> l \<in> U \<longrightarrow> (\<forall>\<^sub>F x in F. g x \<in> U))
[PROOF STEP]
by fastforce


[STATEMENT]
lemma N_zero [simp]: "N 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. N 0 = 0
[PROOF STEP]
by (simp add: N_def)


[STATEMENT]
lemma contour_integral_linepath_Reals_eq:
  fixes a b :: complex and f :: "complex \<Rightarrow> complex"
  assumes "a \<in> Reals" "b \<in> Reals" "Re a < Re b"
  shows   "contour_integral (linepath a b) f = integral {Re a..Re b} (\<lambda>x. f (of_real x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. contour_integral (linepath a b) f = integral {Re a..Re b} (\<lambda>x. f (complex_of_real x))
[PROOF STEP]
proof (cases "f contour_integrable_on linepath a b")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f contour_integrable_on linepath a b \<Longrightarrow> contour_integral (linepath a b) f = integral {Re a..Re b} (\<lambda>x. f (complex_of_real x))
 2. \<not> f contour_integrable_on linepath a b \<Longrightarrow> contour_integral (linepath a b) f = integral {Re a..Re b} (\<lambda>x. f (complex_of_real x))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
f contour_integrable_on linepath a b

goal (2 subgoals):
 1. f contour_integrable_on linepath a b \<Longrightarrow> contour_integral (linepath a b) f = integral {Re a..Re b} (\<lambda>x. f (complex_of_real x))
 2. \<not> f contour_integrable_on linepath a b \<Longrightarrow> contour_integral (linepath a b) f = integral {Re a..Re b} (\<lambda>x. f (complex_of_real x))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
f contour_integrable_on linepath a b

goal (1 subgoal):
 1. contour_integral (linepath a b) f = integral {Re a..Re b} (\<lambda>x. f (complex_of_real x))
[PROOF STEP]
using has_contour_integral_linepath_Reals_iff[OF assms, of f]
[PROOF STATE]
proof (prove)
using this:
f contour_integrable_on linepath a b
(f has_contour_integral ?I) (linepath a b) = ((\<lambda>x. f (complex_of_real x)) has_integral ?I) {Re a..Re b}

goal (1 subgoal):
 1. contour_integral (linepath a b) f = integral {Re a..Re b} (\<lambda>x. f (complex_of_real x))
[PROOF STEP]
using has_contour_integral_integral has_contour_integral_unique
[PROOF STATE]
proof (prove)
using this:
f contour_integrable_on linepath a b
(f has_contour_integral ?I) (linepath a b) = ((\<lambda>x. f (complex_of_real x)) has_integral ?I) {Re a..Re b}
?f contour_integrable_on ?i \<Longrightarrow> (?f has_contour_integral contour_integral ?i ?f) ?i
\<lbrakk>(?f has_contour_integral ?i) ?g; (?f has_contour_integral ?j) ?g\<rbrakk> \<Longrightarrow> ?i = ?j

goal (1 subgoal):
 1. contour_integral (linepath a b) f = integral {Re a..Re b} (\<lambda>x. f (complex_of_real x))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
contour_integral (linepath a b) f = integral {Re a..Re b} (\<lambda>x. f (complex_of_real x))

goal (1 subgoal):
 1. \<not> f contour_integrable_on linepath a b \<Longrightarrow> contour_integral (linepath a b) f = integral {Re a..Re b} (\<lambda>x. f (complex_of_real x))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> f contour_integrable_on linepath a b \<Longrightarrow> contour_integral (linepath a b) f = integral {Re a..Re b} (\<lambda>x. f (complex_of_real x))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> f contour_integrable_on linepath a b

goal (1 subgoal):
 1. \<not> f contour_integrable_on linepath a b \<Longrightarrow> contour_integral (linepath a b) f = integral {Re a..Re b} (\<lambda>x. f (complex_of_real x))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> f contour_integrable_on linepath a b

goal (1 subgoal):
 1. contour_integral (linepath a b) f = integral {Re a..Re b} (\<lambda>x. f (complex_of_real x))
[PROOF STEP]
using contour_integrable_linepath_Reals_iff[OF assms, of f]
[PROOF STATE]
proof (prove)
using this:
\<not> f contour_integrable_on linepath a b
(f contour_integrable_on linepath a b) = ((\<lambda>x. f (complex_of_real x)) integrable_on {Re a..Re b})

goal (1 subgoal):
 1. contour_integral (linepath a b) f = integral {Re a..Re b} (\<lambda>x. f (complex_of_real x))
[PROOF STEP]
by (simp add: not_integrable_contour_integral not_integrable_integral)
[PROOF STATE]
proof (state)
this:
contour_integral (linepath a b) f = integral {Re a..Re b} (\<lambda>x. f (complex_of_real x))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lbI:
  assumes "\<forall>x \<in> {1..m}. \<forall>y \<in> {1..m}. x \<noteq> y \<longrightarrow> A x \<inter> A y = {}"
          "(\<Union>x \<in> {1..m}. A x) = {1..j}"
          "\<forall>x \<in> {1..m}. (\<Sum>y \<in> A x. t y) = T x"
  shows "lb T A j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lb T A j
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>{1..m}. \<forall>y\<in>{1..m}. x \<noteq> y \<longrightarrow> A x \<inter> A y = {}
\<Union> (A ` {1..m}) = {1..j}
\<forall>x\<in>{1..m}. sum t (A x) = T x

goal (1 subgoal):
 1. lb T A j
[PROOF STEP]
unfolding lb_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>{1..m}. \<forall>y\<in>{1..m}. x \<noteq> y \<longrightarrow> A x \<inter> A y = {}
\<Union> (A ` {1..m}) = {1..j}
\<forall>x\<in>{1..m}. sum t (A x) = T x

goal (1 subgoal):
 1. (\<forall>x\<in>{1..m}. \<forall>y\<in>{1..m}. x \<noteq> y \<longrightarrow> A x \<inter> A y = {}) \<and> \<Union> (A ` {1..m}) = {1..j} \<and> (\<forall>x\<in>{1..m}. sum t (A x) = T x)
[PROOF STEP]
by blast


[STATEMENT]
lemma invfun_mem1:"\<lbrakk>f \<in> A \<rightarrow> B; bij_to f A B; b \<in> B\<rbrakk> \<Longrightarrow>
                 (invfun A B f) b \<in> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> A \<rightarrow> B; bij_to f A B; b \<in> B\<rbrakk> \<Longrightarrow> (f\<inverse>\<^bsub>B,A\<^esub>) b \<in> A
[PROOF STEP]
apply (simp add:bij_to_def, erule conjE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> A \<rightarrow> B; b \<in> B; surj_to f A B; inj_on f A\<rbrakk> \<Longrightarrow> (f\<inverse>\<^bsub>B,A\<^esub>) b \<in> A
[PROOF STEP]
apply (simp add:invfun_mem)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma homeomorphic_local_compactness:
  fixes S:: "'a::metric_space set" and T:: "'b::metric_space set"
  shows "S homeomorphic T \<Longrightarrow> locally compact S \<longleftrightarrow> locally compact T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S homeomorphic T \<Longrightarrow> locally compact S = locally compact T
[PROOF STEP]
by (simp add: homeomorphic_compactness homeomorphic_locally)


[STATEMENT]
lemma map_poly_plus:
  assumes "f 0 = 0" and "\<And>a b. f (a + b) = f a + f b"
  shows "map_poly f (p + q) = map_poly f p + map_poly f q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_poly f (p + q) = map_poly f p + map_poly f q
[PROOF STEP]
by (rule Polynomial.poly_eqI) (simp add: coeff_map_poly assms)


[STATEMENT]
lemma list_mono: "A<=B ==> list(A) <= list(B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<subseteq> B \<Longrightarrow> list A \<subseteq> list B
[PROOF STEP]
apply (rule subsetI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>A \<subseteq> B; x \<in> list A\<rbrakk> \<Longrightarrow> x \<in> list B
[PROOF STEP]
apply (erule list.induct)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. A \<subseteq> B \<Longrightarrow> NIL \<in> list B
 2. \<And>x a M. \<lbrakk>A \<subseteq> B; a \<in> A; M \<in> list A; M \<in> list B\<rbrakk> \<Longrightarrow> CONS a M \<in> list B
[PROOF STEP]
apply (auto intro!: list.intros)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma path_image_subpath_subset:
    "\<lbrakk>u \<in> {0..1}; v \<in> {0..1}\<rbrakk> \<Longrightarrow> path_image(subpath u v g) \<subseteq> path_image g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>u \<in> {0..1}; v \<in> {0..1}\<rbrakk> \<Longrightarrow> path_image (subpath u v g) \<subseteq> path_image g
[PROOF STEP]
by (metis atLeastAtMost_iff atLeastatMost_subset_iff path_image_def path_image_subpath subset_image_iff)


[STATEMENT]
lemma Suc_diff_Suc: "m < n \<Longrightarrow> Suc (n - Suc m) = n - m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m < n \<Longrightarrow> Suc (n - Suc m) = n - m
[PROOF STEP]
apply (rule subst[OF sub_Suc0_sub_Suc_conv])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m < n \<Longrightarrow> Suc (n - m - Suc 0) = n - m
[PROOF STEP]
apply (rule Suc_pred)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m < n \<Longrightarrow> 0 < n - m
[PROOF STEP]
apply (simp only: zero_less_diff)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma sum_Basis_prod_eq:
  fixes f::"('a*'b)\<Rightarrow>('a*'b)"
  shows "sum f Basis = sum (\<lambda>i. f (i, 0)) Basis + sum (\<lambda>i. f (0, i)) Basis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f Basis = (\<Sum>i\<in>Basis. f (i, 0::'b)) + (\<Sum>i\<in>Basis. f (0::'a, i))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum f Basis = (\<Sum>i\<in>Basis. f (i, 0::'b)) + (\<Sum>i\<in>Basis. f (0::'a, i))
[PROOF STEP]
have "inj_on (\<lambda>u. (u::'a, 0::'b)) Basis" "inj_on (\<lambda>u. (0::'a, u::'b)) Basis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (\<lambda>u. (u, 0::'b)) Basis &&& inj_on (Pair (0::'a)) Basis
[PROOF STEP]
by (auto intro!: inj_onI Pair_inject)
[PROOF STATE]
proof (state)
this:
inj_on (\<lambda>u. (u, 0::'b)) Basis
inj_on (Pair (0::'a)) Basis

goal (1 subgoal):
 1. sum f Basis = (\<Sum>i\<in>Basis. f (i, 0::'b)) + (\<Sum>i\<in>Basis. f (0::'a, i))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
inj_on (\<lambda>u. (u, 0::'b)) Basis
inj_on (Pair (0::'a)) Basis

goal (1 subgoal):
 1. sum f Basis = (\<Sum>i\<in>Basis. f (i, 0::'b)) + (\<Sum>i\<in>Basis. f (0::'a, i))
[PROOF STEP]
unfolding Basis_prod_def
[PROOF STATE]
proof (prove)
using this:
inj_on (\<lambda>u. (u, 0::'b)) Basis
inj_on (Pair (0::'a)) Basis

goal (1 subgoal):
 1. sum f ((\<lambda>u. (u, 0::'b)) ` Basis \<union> Pair (0::'a) ` Basis) = (\<Sum>i\<in>Basis. f (i, 0::'b)) + (\<Sum>i\<in>Basis. f (0::'a, i))
[PROOF STEP]
by (subst sum.union_disjoint) (auto simp: Basis_prod_def sum.reindex)
[PROOF STATE]
proof (state)
this:
sum f Basis = (\<Sum>i\<in>Basis. f (i, 0::'b)) + (\<Sum>i\<in>Basis. f (0::'a, i))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma least_order:
  assumes transitive: "\<forall>x y z . le x y \<and> le y z \<longrightarrow> le x z"
      and total: "\<forall>x y . le x y \<or> le y x"
    shows "finite A \<Longrightarrow> A \<noteq> {} \<Longrightarrow> \<exists>x . x \<in> A \<and> (\<forall>y . y \<in> A \<longrightarrow> le x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; A \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>x. x \<in> A \<and> (\<forall>y. y \<in> A \<longrightarrow> le x y)
[PROOF STEP]
proof (induct A rule: finite_ne_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. \<exists>xa. xa \<in> {x} \<and> (\<forall>y. y \<in> {x} \<longrightarrow> le xa y)
 2. \<And>x F. \<lbrakk>finite F; F \<noteq> {}; x \<notin> F; \<exists>x. x \<in> F \<and> (\<forall>y. y \<in> F \<longrightarrow> le x y)\<rbrakk> \<Longrightarrow> \<exists>xa. xa \<in> insert x F \<and> (\<forall>y. y \<in> insert x F \<longrightarrow> le xa y)
[PROOF STEP]
case singleton
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>x. \<exists>xa. xa \<in> {x} \<and> (\<forall>y. y \<in> {x} \<longrightarrow> le xa y)
 2. \<And>x F. \<lbrakk>finite F; F \<noteq> {}; x \<notin> F; \<exists>x. x \<in> F \<and> (\<forall>y. y \<in> F \<longrightarrow> le x y)\<rbrakk> \<Longrightarrow> \<exists>xa. xa \<in> insert x F \<and> (\<forall>y. y \<in> insert x F \<longrightarrow> le xa y)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>xa. xa \<in> {x_} \<and> (\<forall>y. y \<in> {x_} \<longrightarrow> le xa y)
[PROOF STEP]
using total
[PROOF STATE]
proof (prove)
using this:
\<forall>x y. le x y \<or> le y x

goal (1 subgoal):
 1. \<exists>xa. xa \<in> {x_} \<and> (\<forall>y. y \<in> {x_} \<longrightarrow> le xa y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>xa. xa \<in> {x_} \<and> (\<forall>y. y \<in> {x_} \<longrightarrow> le xa y)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; F \<noteq> {}; x \<notin> F; \<exists>x. x \<in> F \<and> (\<forall>y. y \<in> F \<longrightarrow> le x y)\<rbrakk> \<Longrightarrow> \<exists>xa. xa \<in> insert x F \<and> (\<forall>y. y \<in> insert x F \<longrightarrow> le xa y)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; F \<noteq> {}; x \<notin> F; \<exists>x. x \<in> F \<and> (\<forall>y. y \<in> F \<longrightarrow> le x y)\<rbrakk> \<Longrightarrow> \<exists>xa. xa \<in> insert x F \<and> (\<forall>y. y \<in> insert x F \<longrightarrow> le xa y)
[PROOF STEP]
case insert
[PROOF STATE]
proof (state)
this:
finite F_
F_ \<noteq> {}
x_ \<notin> F_
\<exists>x. x \<in> F_ \<and> (\<forall>y. y \<in> F_ \<longrightarrow> le x y)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; F \<noteq> {}; x \<notin> F; \<exists>x. x \<in> F \<and> (\<forall>y. y \<in> F \<longrightarrow> le x y)\<rbrakk> \<Longrightarrow> \<exists>xa. xa \<in> insert x F \<and> (\<forall>y. y \<in> insert x F \<longrightarrow> le xa y)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
finite F_
F_ \<noteq> {}
x_ \<notin> F_
\<exists>x. x \<in> F_ \<and> (\<forall>y. y \<in> F_ \<longrightarrow> le x y)

goal (1 subgoal):
 1. \<exists>xa. xa \<in> insert x_ F_ \<and> (\<forall>y. y \<in> insert x_ F_ \<longrightarrow> le xa y)
[PROOF STEP]
by (metis insert_iff transitive total)
[PROOF STATE]
proof (state)
this:
\<exists>xa. xa \<in> insert x_ F_ \<and> (\<forall>y. y \<in> insert x_ F_ \<longrightarrow> le xa y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma imgTr8:"\<lbrakk>Group F; Group G; f \<in> gHom F G; F \<guillemotright> H; u \<in> f ` H;
                v \<in> f` H \<rbrakk> \<Longrightarrow> u \<cdot>\<^bsub>G\<^esub> v \<in> f ` H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G; F \<guillemotright> H ; u \<in> f ` H; v \<in> f ` H\<rbrakk> \<Longrightarrow> u \<cdot>\<^bsub>G\<^esub> v \<in> f ` H
[PROOF STEP]
apply (simp add:image_def, (erule bexE)+, simp,
       subst gHom [of "F" "G" "f" _, THEN sym], assumption+)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x xa xb. \<lbrakk>Group F; Group G; f \<in> gHom F G; F \<guillemotright> H ; x \<in> H; u = f x; xa \<in> H; v = f xa\<rbrakk> \<Longrightarrow> x \<in> carrier F
 2. \<And>x xa xb. \<lbrakk>Group F; Group G; f \<in> gHom F G; F \<guillemotright> H ; x \<in> H; u = f x; xa \<in> H; v = f xa\<rbrakk> \<Longrightarrow> xa \<in> carrier F
 3. \<And>x xa. \<lbrakk>Group F; Group G; f \<in> gHom F G; F \<guillemotright> H ; x \<in> H; u = f x; xa \<in> H; v = f xa\<rbrakk> \<Longrightarrow> \<exists>xb\<in>H. f (x \<cdot>\<^bsub>F\<^esub> xa) = f xb
[PROOF STEP]
apply (simp only:Group.sg_subset_elem[of "F"],
         simp only:Group.sg_subset_elem[of "F"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>Group F; Group G; f \<in> gHom F G; F \<guillemotright> H ; x \<in> H; u = f x; xa \<in> H; v = f xa\<rbrakk> \<Longrightarrow> \<exists>xb\<in>H. f (x \<cdot>\<^bsub>F\<^esub> xa) = f xb
[PROOF STEP]
apply (frule_tac x = x and y = xa in Group.sg_mult_closed[of "F" "H"],
           assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>Group F; Group G; f \<in> gHom F G; F \<guillemotright> H ; x \<in> H; u = f x; xa \<in> H; v = f xa; x \<cdot>\<^bsub>F\<^esub> xa \<in> H\<rbrakk> \<Longrightarrow> \<exists>xb\<in>H. f (x \<cdot>\<^bsub>F\<^esub> xa) = f xb
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma prob_sum_is_one [simp]:
  assumes "state n v"
  shows "prob1 n v i + prob0 n v i = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob1 n v i + prob0 n v i = 1
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. prob1 n v i + prob0 n v i = 1
[PROOF STEP]
have "prob1 n v i + prob0 n v i = (\<Sum>j\<in>{0..<2^n::nat}. (cmod(v $$ (j,0)))\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob1 n v i + prob0 n v i = (\<Sum>j = 0..<2 ^ n. (cmod (v $$ (j, 0)))\<^sup>2)
[PROOF STEP]
using prob1_def prob0_def outcomes_sum
[PROOF STATE]
proof (prove)
using this:
prob1 ?n ?v ?i \<equiv> \<Sum>j\<in>{k |k. select_index ?n ?i k}. (cmod (?v $$ (j, 0)))\<^sup>2
prob0 ?n ?v ?i \<equiv> \<Sum>j\<in>{k |k. k < 2 ^ ?n \<and> \<not> select_index ?n ?i k}. (cmod (?v $$ (j, 0)))\<^sup>2
sum ?f {k |k. select_index ?n ?i k} + sum ?f {k |k. k < 2 ^ ?n \<and> \<not> select_index ?n ?i k} = sum ?f {0..<2 ^ ?n}

goal (1 subgoal):
 1. prob1 n v i + prob0 n v i = (\<Sum>j = 0..<2 ^ n. (cmod (v $$ (j, 0)))\<^sup>2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
prob1 n v i + prob0 n v i = (\<Sum>j = 0..<2 ^ n. (cmod (v $$ (j, 0)))\<^sup>2)

goal (1 subgoal):
 1. prob1 n v i + prob0 n v i = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
prob1 n v i + prob0 n v i = (\<Sum>j = 0..<2 ^ n. (cmod (v $$ (j, 0)))\<^sup>2)

goal (1 subgoal):
 1. prob1 n v i + prob0 n v i = 1
[PROOF STEP]
have "\<dots> = \<parallel>col v 0\<parallel>\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j = 0..<2 ^ n. (cmod (v $$ (j, 0)))\<^sup>2) = \<parallel>col v 0\<parallel>\<^sup>2
[PROOF STEP]
using cpx_vec_length_def assms state_def atLeast0LessThan
[PROOF STATE]
proof (prove)
using this:
\<parallel>?v\<parallel> \<equiv> sqrt (\<Sum>i<dim_vec ?v. (cmod (?v $ i))\<^sup>2)
state n v
state ?n ?v \<equiv> dim_col ?v = 1 \<and> dim_row ?v = 2 ^ ?n \<and> \<parallel>col ?v 0\<parallel> = 1
{0..<?n} = {..<?n}

goal (1 subgoal):
 1. (\<Sum>j = 0..<2 ^ n. (cmod (v $$ (j, 0)))\<^sup>2) = \<parallel>col v 0\<parallel>\<^sup>2
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(\<Sum>j = 0..<2 ^ n. (cmod (v $$ (j, 0)))\<^sup>2) = \<parallel>col v 0\<parallel>\<^sup>2

goal (1 subgoal):
 1. prob1 n v i + prob0 n v i = 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
prob1 n v i + prob0 n v i = \<parallel>col v 0\<parallel>\<^sup>2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
prob1 n v i + prob0 n v i = \<parallel>col v 0\<parallel>\<^sup>2

goal (1 subgoal):
 1. prob1 n v i + prob0 n v i = 1
[PROOF STEP]
using assms state_def
[PROOF STATE]
proof (prove)
using this:
prob1 n v i + prob0 n v i = \<parallel>col v 0\<parallel>\<^sup>2
state n v
state ?n ?v \<equiv> dim_col ?v = 1 \<and> dim_row ?v = 2 ^ ?n \<and> \<parallel>col ?v 0\<parallel> = 1

goal (1 subgoal):
 1. prob1 n v i + prob0 n v i = 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
prob1 n v i + prob0 n v i = 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_eq_2_doubleton:
  assumes "card A = 2" and "x \<noteq> y" and "x \<in> A" and "y \<in> A"
  shows "A = {x, y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = {x, y}
[PROOF STEP]
using assms card_eq_2_iff_doubleton[of A]
[PROOF STATE]
proof (prove)
using this:
card A = 2
x \<noteq> y
x \<in> A
y \<in> A
(card A = 2) = (\<exists>x y. x \<noteq> y \<and> A = {x, y})

goal (1 subgoal):
 1. A = {x, y}
[PROOF STEP]
by auto


[STATEMENT]
lemma is_cnf_foldr_and_if:
  assumes "\<forall>f \<in> set fs. is_cnf f"
  shows "is_cnf (foldr (\<^bold>\<and>) fs (\<^bold>\<not>\<bottom>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_cnf (foldr (\<^bold>\<and>) fs (\<^bold>\<not> \<bottom>))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>f\<in>set fs. is_cnf f

goal (1 subgoal):
 1. is_cnf (foldr (\<^bold>\<and>) fs (\<^bold>\<not> \<bottom>))
[PROOF STEP]
proof (induction fs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Ball (set []) is_cnf \<Longrightarrow> is_cnf (foldr (\<^bold>\<and>) [] (\<^bold>\<not> \<bottom>))
 2. \<And>a fs. \<lbrakk>Ball (set fs) is_cnf \<Longrightarrow> is_cnf (foldr (\<^bold>\<and>) fs (\<^bold>\<not> \<bottom>)); Ball (set (a # fs)) is_cnf\<rbrakk> \<Longrightarrow> is_cnf (foldr (\<^bold>\<and>) (a # fs) (\<^bold>\<not> \<bottom>))
[PROOF STEP]
case (Cons f fs)
[PROOF STATE]
proof (state)
this:
\<forall>a\<in>set fs. is_cnf a \<Longrightarrow> is_cnf (foldr (\<^bold>\<and>) fs (\<^bold>\<not> \<bottom>))
\<forall>a\<in>set (f # fs). is_cnf a

goal (2 subgoals):
 1. Ball (set []) is_cnf \<Longrightarrow> is_cnf (foldr (\<^bold>\<and>) [] (\<^bold>\<not> \<bottom>))
 2. \<And>a fs. \<lbrakk>Ball (set fs) is_cnf \<Longrightarrow> is_cnf (foldr (\<^bold>\<and>) fs (\<^bold>\<not> \<bottom>)); Ball (set (a # fs)) is_cnf\<rbrakk> \<Longrightarrow> is_cnf (foldr (\<^bold>\<and>) (a # fs) (\<^bold>\<not> \<bottom>))
[PROOF STEP]
have "foldr (\<^bold>\<and>) (f # fs) (\<^bold>\<not>\<bottom>) = f \<^bold>\<and> (foldr (\<^bold>\<and>) fs (\<^bold>\<not>\<bottom>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldr (\<^bold>\<and>) (f # fs) (\<^bold>\<not> \<bottom>) = f \<^bold>\<and> foldr (\<^bold>\<and>) fs (\<^bold>\<not> \<bottom>)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
foldr (\<^bold>\<and>) (f # fs) (\<^bold>\<not> \<bottom>) = f \<^bold>\<and> foldr (\<^bold>\<and>) fs (\<^bold>\<not> \<bottom>)

goal (2 subgoals):
 1. Ball (set []) is_cnf \<Longrightarrow> is_cnf (foldr (\<^bold>\<and>) [] (\<^bold>\<not> \<bottom>))
 2. \<And>a fs. \<lbrakk>Ball (set fs) is_cnf \<Longrightarrow> is_cnf (foldr (\<^bold>\<and>) fs (\<^bold>\<not> \<bottom>)); Ball (set (a # fs)) is_cnf\<rbrakk> \<Longrightarrow> is_cnf (foldr (\<^bold>\<and>) (a # fs) (\<^bold>\<not> \<bottom>))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
foldr (\<^bold>\<and>) (f # fs) (\<^bold>\<not> \<bottom>) = f \<^bold>\<and> foldr (\<^bold>\<and>) fs (\<^bold>\<not> \<bottom>)

goal (2 subgoals):
 1. Ball (set []) is_cnf \<Longrightarrow> is_cnf (foldr (\<^bold>\<and>) [] (\<^bold>\<not> \<bottom>))
 2. \<And>a fs. \<lbrakk>Ball (set fs) is_cnf \<Longrightarrow> is_cnf (foldr (\<^bold>\<and>) fs (\<^bold>\<not> \<bottom>)); Ball (set (a # fs)) is_cnf\<rbrakk> \<Longrightarrow> is_cnf (foldr (\<^bold>\<and>) (a # fs) (\<^bold>\<not> \<bottom>))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
foldr (\<^bold>\<and>) (f # fs) (\<^bold>\<not> \<bottom>) = f \<^bold>\<and> foldr (\<^bold>\<and>) fs (\<^bold>\<not> \<bottom>)

goal (2 subgoals):
 1. Ball (set []) is_cnf \<Longrightarrow> is_cnf (foldr (\<^bold>\<and>) [] (\<^bold>\<not> \<bottom>))
 2. \<And>a fs. \<lbrakk>Ball (set fs) is_cnf \<Longrightarrow> is_cnf (foldr (\<^bold>\<and>) fs (\<^bold>\<not> \<bottom>)); Ball (set (a # fs)) is_cnf\<rbrakk> \<Longrightarrow> is_cnf (foldr (\<^bold>\<and>) (a # fs) (\<^bold>\<not> \<bottom>))
[PROOF STEP]
have "\<forall>f \<in> set fs. is_cnf f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>f\<in>set fs. is_cnf f
[PROOF STEP]
using Cons.prems
[PROOF STATE]
proof (prove)
using this:
\<forall>a\<in>set (f # fs). is_cnf a

goal (1 subgoal):
 1. \<forall>f\<in>set fs. is_cnf f
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<forall>f\<in>set fs. is_cnf f

goal (2 subgoals):
 1. Ball (set []) is_cnf \<Longrightarrow> is_cnf (foldr (\<^bold>\<and>) [] (\<^bold>\<not> \<bottom>))
 2. \<And>a fs. \<lbrakk>Ball (set fs) is_cnf \<Longrightarrow> is_cnf (foldr (\<^bold>\<and>) fs (\<^bold>\<not> \<bottom>)); Ball (set (a # fs)) is_cnf\<rbrakk> \<Longrightarrow> is_cnf (foldr (\<^bold>\<and>) (a # fs) (\<^bold>\<not> \<bottom>))
[PROOF STEP]
hence "is_cnf (foldr (\<^bold>\<and>) fs (\<^bold>\<not>\<bottom>))"
[PROOF STATE]
proof (prove)
using this:
\<forall>f\<in>set fs. is_cnf f

goal (1 subgoal):
 1. is_cnf (foldr (\<^bold>\<and>) fs (\<^bold>\<not> \<bottom>))
[PROOF STEP]
using Cons.IH
[PROOF STATE]
proof (prove)
using this:
\<forall>f\<in>set fs. is_cnf f
\<forall>a\<in>set fs. is_cnf a \<Longrightarrow> is_cnf (foldr (\<^bold>\<and>) fs (\<^bold>\<not> \<bottom>))

goal (1 subgoal):
 1. is_cnf (foldr (\<^bold>\<and>) fs (\<^bold>\<not> \<bottom>))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
is_cnf (foldr (\<^bold>\<and>) fs (\<^bold>\<not> \<bottom>))

goal (2 subgoals):
 1. Ball (set []) is_cnf \<Longrightarrow> is_cnf (foldr (\<^bold>\<and>) [] (\<^bold>\<not> \<bottom>))
 2. \<And>a fs. \<lbrakk>Ball (set fs) is_cnf \<Longrightarrow> is_cnf (foldr (\<^bold>\<and>) fs (\<^bold>\<not> \<bottom>)); Ball (set (a # fs)) is_cnf\<rbrakk> \<Longrightarrow> is_cnf (foldr (\<^bold>\<and>) (a # fs) (\<^bold>\<not> \<bottom>))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
is_cnf (foldr (\<^bold>\<and>) fs (\<^bold>\<not> \<bottom>))

goal (2 subgoals):
 1. Ball (set []) is_cnf \<Longrightarrow> is_cnf (foldr (\<^bold>\<and>) [] (\<^bold>\<not> \<bottom>))
 2. \<And>a fs. \<lbrakk>Ball (set fs) is_cnf \<Longrightarrow> is_cnf (foldr (\<^bold>\<and>) fs (\<^bold>\<not> \<bottom>)); Ball (set (a # fs)) is_cnf\<rbrakk> \<Longrightarrow> is_cnf (foldr (\<^bold>\<and>) (a # fs) (\<^bold>\<not> \<bottom>))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
is_cnf (foldr (\<^bold>\<and>) fs (\<^bold>\<not> \<bottom>))

goal (2 subgoals):
 1. Ball (set []) is_cnf \<Longrightarrow> is_cnf (foldr (\<^bold>\<and>) [] (\<^bold>\<not> \<bottom>))
 2. \<And>a fs. \<lbrakk>Ball (set fs) is_cnf \<Longrightarrow> is_cnf (foldr (\<^bold>\<and>) fs (\<^bold>\<not> \<bottom>)); Ball (set (a # fs)) is_cnf\<rbrakk> \<Longrightarrow> is_cnf (foldr (\<^bold>\<and>) (a # fs) (\<^bold>\<not> \<bottom>))
[PROOF STEP]
have "is_cnf f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_cnf f
[PROOF STEP]
using Cons.prems
[PROOF STATE]
proof (prove)
using this:
\<forall>a\<in>set (f # fs). is_cnf a

goal (1 subgoal):
 1. is_cnf f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
is_cnf f

goal (2 subgoals):
 1. Ball (set []) is_cnf \<Longrightarrow> is_cnf (foldr (\<^bold>\<and>) [] (\<^bold>\<not> \<bottom>))
 2. \<And>a fs. \<lbrakk>Ball (set fs) is_cnf \<Longrightarrow> is_cnf (foldr (\<^bold>\<and>) fs (\<^bold>\<not> \<bottom>)); Ball (set (a # fs)) is_cnf\<rbrakk> \<Longrightarrow> is_cnf (foldr (\<^bold>\<and>) (a # fs) (\<^bold>\<not> \<bottom>))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
foldr (\<^bold>\<and>) (f # fs) (\<^bold>\<not> \<bottom>) = f \<^bold>\<and> foldr (\<^bold>\<and>) fs (\<^bold>\<not> \<bottom>)
is_cnf (foldr (\<^bold>\<and>) fs (\<^bold>\<not> \<bottom>))
is_cnf f
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
foldr (\<^bold>\<and>) (f # fs) (\<^bold>\<not> \<bottom>) = f \<^bold>\<and> foldr (\<^bold>\<and>) fs (\<^bold>\<not> \<bottom>)
is_cnf (foldr (\<^bold>\<and>) fs (\<^bold>\<not> \<bottom>))
is_cnf f

goal (1 subgoal):
 1. is_cnf (foldr (\<^bold>\<and>) (f # fs) (\<^bold>\<not> \<bottom>))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
is_cnf (foldr (\<^bold>\<and>) (f # fs) (\<^bold>\<not> \<bottom>))

goal (1 subgoal):
 1. Ball (set []) is_cnf \<Longrightarrow> is_cnf (foldr (\<^bold>\<and>) [] (\<^bold>\<not> \<bottom>))
[PROOF STEP]
qed simp


[STATEMENT]
lemma finite_derangements:
  assumes "finite A"
  shows "finite (derangements A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (derangements A)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A

goal (1 subgoal):
 1. finite (derangements A)
[PROOF STEP]
unfolding derangements_def
[PROOF STATE]
proof (prove)
using this:
finite A

goal (1 subgoal):
 1. finite {p. p permutes A \<and> (\<forall>x\<in>A. p x \<noteq> x)}
[PROOF STEP]
by (auto simp add: finite_permutations)


[STATEMENT]
lemma Cons_Suc_inj2: "inj2 (\<lambda>x ys. Suc x # ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj2 (\<lambda>x. (#) (Suc x))
[PROOF STEP]
unfolding inj2_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x1\<in>UNIV. \<forall>x2\<in>UNIV. \<forall>y1\<in>UNIV. \<forall>y2\<in>UNIV. Suc x1 # y1 = Suc x2 # y2 \<longrightarrow> x1 = x2 \<and> y1 = y2
[PROOF STEP]
by simp


[STATEMENT]
theorem n_subset_enum_correct:
  "distinct xs \<Longrightarrow> set (map set (n_subset_enum xs n)) = n_subsets (set xs) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct xs \<Longrightarrow> set (map set (n_subset_enum xs n)) = n_subsets (set xs) n
[PROOF STEP]
proof(standard)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. distinct xs \<Longrightarrow> set (map set (n_subset_enum xs n)) \<subseteq> n_subsets (set xs) n
 2. distinct xs \<Longrightarrow> n_subsets (set xs) n \<subseteq> set (map set (n_subset_enum xs n))
[PROOF STEP]
show "distinct xs \<Longrightarrow> set (map set (n_subset_enum xs n)) \<subseteq> n_subsets (set xs) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct xs \<Longrightarrow> set (map set (n_subset_enum xs n)) \<subseteq> n_subsets (set xs) n
[PROOF STEP]
using n_subset_enum_correct_aux1 n_bool_lists_correct
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>distinct ?xs; length ?ys = length ?xs\<rbrakk> \<Longrightarrow> set (filter_bool_list ?ys ?xs) \<in> n_subsets (set ?xs) (count_list ?ys True)
set (n_bool_lists ?n ?x) = {xs. length xs = ?x \<and> count_list xs True = ?n}

goal (1 subgoal):
 1. distinct xs \<Longrightarrow> set (map set (n_subset_enum xs n)) \<subseteq> n_subsets (set xs) n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
distinct xs \<Longrightarrow> set (map set (n_subset_enum xs n)) \<subseteq> n_subsets (set xs) n

goal (1 subgoal):
 1. distinct xs \<Longrightarrow> n_subsets (set xs) n \<subseteq> set (map set (n_subset_enum xs n))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. distinct xs \<Longrightarrow> n_subsets (set xs) n \<subseteq> set (map set (n_subset_enum xs n))
[PROOF STEP]
show "distinct xs \<Longrightarrow> n_subsets (set xs) n \<subseteq> set (map set (n_subset_enum xs n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct xs \<Longrightarrow> n_subsets (set xs) n \<subseteq> set (map set (n_subset_enum xs n))
[PROOF STEP]
using n_subset_enum_correct_aux2
[PROOF STATE]
proof (prove)
using this:
distinct ?xs \<Longrightarrow> n_subsets (set ?xs) ?n \<subseteq> set (map set (n_subset_enum ?xs ?n))

goal (1 subgoal):
 1. distinct xs \<Longrightarrow> n_subsets (set xs) n \<subseteq> set (map set (n_subset_enum xs n))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
distinct xs \<Longrightarrow> n_subsets (set xs) n \<subseteq> set (map set (n_subset_enum xs n))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ssorted_iff_le_Suc: "ssorted s \<longleftrightarrow> (\<forall>i. s !! i \<le> s !! Suc i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ssorted s = (\<forall>i. s !! i \<le> s !! Suc i)
[PROOF STEP]
using mono_iff_le_Suc[of "snth s"]
[PROOF STATE]
proof (prove)
using this:
mono ((!!) s) = (\<forall>n. s !! n \<le> s !! Suc n)

goal (1 subgoal):
 1. ssorted s = (\<forall>i. s !! i \<le> s !! Suc i)
[PROOF STEP]
by (simp add: mono_def ssorted_iff_mono)


[STATEMENT]
theorem max_flow_min_cut_countable:
  fixes \<Delta> (structure)
  assumes countable_E [simp]: "countable \<^bold>E"
  and source_neq_sink [simp]: "source \<Delta> \<noteq> sink \<Delta>"
  and capacity_outside: "\<forall>e. e \<notin> \<^bold>E \<longrightarrow> capacity \<Delta> e = 0"
  and capacity_finite [simp]: "\<forall>e. capacity \<Delta> e \<noteq> \<top>"
  shows "\<exists>f S. flow \<Delta> f \<and> cut \<Delta> S \<and> orthogonal \<Delta> f S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f S. flow \<Delta> f \<and> MFMC_Network.cut \<Delta> S \<and> orthogonal \<Delta> f S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f S. flow \<Delta> f \<and> MFMC_Network.cut \<Delta> S \<and> orthogonal \<Delta> f S
[PROOF STEP]
interpret countable_network \<Delta>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable_network \<Delta>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
countable \<^bold>E
source \<Delta> \<noteq> sink \<Delta>
\<forall>e. e \<notin> \<^bold>E \<longrightarrow> capacity \<Delta> e = 0
\<forall>e. capacity \<Delta> e \<noteq> \<top>

goal (1 subgoal):
 1. countable_network \<Delta>
[PROOF STEP]
by(unfold_locales) auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f S. flow \<Delta> f \<and> MFMC_Network.cut \<Delta> S \<and> orthogonal \<Delta> f S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f S. flow \<Delta> f \<and> MFMC_Network.cut \<Delta> S \<and> orthogonal \<Delta> f S
[PROOF STEP]
by(rule max_flow_min_cut)
[PROOF STATE]
proof (state)
this:
\<exists>f S. flow \<Delta> f \<and> MFMC_Network.cut \<Delta> S \<and> orthogonal \<Delta> f S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma disjointify_finite:
  assumes "finite As"
  shows "finite (disjointify As)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (disjointify As)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite As

goal (1 subgoal):
 1. finite (disjointify As)
[PROOF STEP]
unfolding disjointify_def
[PROOF STATE]
proof (prove)
using this:
finite As

goal (1 subgoal):
 1. finite (rec_disjointify (card As) (Generated_Boolean_Algebra.enumerate As))
[PROOF STEP]
by (simp add: rec_disjointify_finite)


[STATEMENT]
theorem Plus_assoc: "Plus X (Plus Y Z) = Plus (Plus X Y) Z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Plus X (Plus Y Z) = Plus (Plus X Y) Z
[PROOF STEP]
by (cases X, cases Y, cases Z, simp add: Plus exprel.ASSOC)


[STATEMENT]
lemma gf_U'_tendsto_U':
  assumes x: "recurrent x" "(x, y) \<in> acc"
  shows "((\<lambda>z. ennreal (gf_U' x y z)) \<longlongrightarrow> U' x y) (at_left 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>z. ennreal (gf_U' x y z)) \<longlongrightarrow> U' x y) (at_left 1)
[PROOF STEP]
unfolding U'_eq_suminf[OF x] gf_U'_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>z. ennreal (\<Sum>n. u x y n * real (Suc n) * z ^ n)) \<longlongrightarrow> (\<Sum>i. ennreal (u x y i * real (Suc i)))) (at_left 1)
[PROOF STEP]
by (auto intro!: power_series_tendsto_at_left summable_gf_U' mult_nonneg_nonneg u_nonneg simp del: of_nat_Suc)


[STATEMENT]
theorem swap_all_disj: "(P \<or> (\<forall>x. Q x)) \<longleftrightarrow> (\<forall>x. P \<or> Q x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (P \<or> (\<forall>x. Q x)) = (\<forall>x. P \<or> Q x)
[PROOF STEP]
by auto


[STATEMENT]
lemma poly_inf_mult[simp]:
  fixes p :: "('a::real_normed_field) poly"
  shows "poly_inf (p*q) = poly_inf p * poly_inf q"
        "poly_neg_inf (p*q) = poly_neg_inf p * poly_neg_inf q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_inf (p * q) = poly_inf p * poly_inf q &&& poly_neg_inf (p * q) = poly_neg_inf p * poly_neg_inf q
[PROOF STEP]
unfolding poly_inf_def poly_neg_inf_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sgn (lead_coeff (p * q)) = sgn (lead_coeff p) * sgn (lead_coeff q) &&& (if even (degree (p * q)) then sgn (lead_coeff (p * q)) else - sgn (lead_coeff (p * q))) = (if even (degree p) then sgn (lead_coeff p) else - sgn (lead_coeff p)) * (if even (degree q) then sgn (lead_coeff q) else - sgn (lead_coeff q))
[PROOF STEP]
by ((cases "p = 0 \<or> q = 0",auto simp: sgn_zero_iff
         degree_mult_eq[of p q] coeff_mult_degree_sum Real_Vector_Spaces.sgn_mult)[])+