[STATEMENT]
lemma beukers_nn_integral1_series:
  "beukers_nn_integral1 r s = (\<Sum>k. ennreal (1/((k+r+1)^2*(k+s+1)) + 1/((k+r+1)*(k+s+1)^2)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. beukers_nn_integral1 r s = (\<Sum>k. ennreal (1 / real ((k + r + 1)\<^sup>2 * (k + s + 1)) + 1 / real ((k + r + 1) * (k + s + 1)\<^sup>2)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. beukers_nn_integral1 r s = (\<Sum>k. ennreal (1 / real ((k + r + 1)\<^sup>2 * (k + s + 1)) + 1 / real ((k + r + 1) * (k + s + 1)\<^sup>2)))
[PROOF STEP]
have "beukers_nn_integral1 r s =
          (\<integral>\<^sup>+(x,y)\<in>{0<..<1}\<times>{0<..<1}. (\<Sum>k. ennreal (-ln (x*y) * x^(k+r) * y^(k+s))) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. beukers_nn_integral1 r s = \<integral>\<^sup>+x\<in>{0<..<1} \<times> {0<..<1}. (case x of (x, y) \<Rightarrow> \<Sum>k. ennreal (- ln (x * y) * x ^ (k + r) * y ^ (k + s)))\<partial>lborel
[PROOF STEP]
unfolding beukers_nn_integral1_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>{0<..<1} \<times> {0<..<1}. (case x of (x, y) \<Rightarrow> ennreal (- ln (x * y) / (1 - x * y) * x ^ r * y ^ s))\<partial>lborel = \<integral>\<^sup>+x\<in>{0<..<1} \<times> {0<..<1}. (case x of (x, y) \<Rightarrow> \<Sum>k. ennreal (- ln (x * y) * x ^ (k + r) * y ^ (k + s)))\<partial>lborel
[PROOF STEP]
proof (intro set_nn_integral_cong refl, clarify)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>(a, b) \<in> space lborel; a \<in> {0<..<1}; b \<in> {0<..<1}\<rbrakk> \<Longrightarrow> ennreal (- ln (a * b) / (1 - a * b) * a ^ r * b ^ s) = (\<Sum>k. ennreal (- ln (a * b) * a ^ (k + r) * b ^ (k + s)))
[PROOF STEP]
fix x y :: real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>(a, b) \<in> space lborel; a \<in> {0<..<1}; b \<in> {0<..<1}\<rbrakk> \<Longrightarrow> ennreal (- ln (a * b) / (1 - a * b) * a ^ r * b ^ s) = (\<Sum>k. ennreal (- ln (a * b) * a ^ (k + r) * b ^ (k + s)))
[PROOF STEP]
assume xy: "x \<in> {0<..<1}" "y \<in> {0<..<1}"
[PROOF STATE]
proof (state)
this:
x \<in> {0<..<1}
y \<in> {0<..<1}

goal (1 subgoal):
 1. \<And>a b. \<lbrakk>(a, b) \<in> space lborel; a \<in> {0<..<1}; b \<in> {0<..<1}\<rbrakk> \<Longrightarrow> ennreal (- ln (a * b) / (1 - a * b) * a ^ r * b ^ s) = (\<Sum>k. ennreal (- ln (a * b) * a ^ (k + r) * b ^ (k + s)))
[PROOF STEP]
from xy
[PROOF STATE]
proof (chain)
picking this:
x \<in> {0<..<1}
y \<in> {0<..<1}
[PROOF STEP]
have "x * y < 1"
[PROOF STATE]
proof (prove)
using this:
x \<in> {0<..<1}
y \<in> {0<..<1}

goal (1 subgoal):
 1. x * y < 1
[PROOF STEP]
using mult_strict_mono[of x 1 y 1]
[PROOF STATE]
proof (prove)
using this:
x \<in> {0<..<1}
y \<in> {0<..<1}
\<lbrakk>x < 1; y < 1; 0 < 1; 0 \<le> y\<rbrakk> \<Longrightarrow> x * y < 1 * 1

goal (1 subgoal):
 1. x * y < 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x * y < 1

goal (1 subgoal):
 1. \<And>a b. \<lbrakk>(a, b) \<in> space lborel; a \<in> {0<..<1}; b \<in> {0<..<1}\<rbrakk> \<Longrightarrow> ennreal (- ln (a * b) / (1 - a * b) * a ^ r * b ^ s) = (\<Sum>k. ennreal (- ln (a * b) * a ^ (k + r) * b ^ (k + s)))
[PROOF STEP]
have "(\<Sum>k. ennreal (-ln (x*y) * x^(k+r) * y^(k+s))) =
             ennreal (-ln (x*y) * x^r * y^s) * (\<Sum>k. ennreal ((x*y)^k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k. ennreal (- ln (x * y) * x ^ (k + r) * y ^ (k + s))) = ennreal (- ln (x * y) * x ^ r * y ^ s) * (\<Sum>k. ennreal ((x * y) ^ k))
[PROOF STEP]
using xy
[PROOF STATE]
proof (prove)
using this:
x \<in> {0<..<1}
y \<in> {0<..<1}

goal (1 subgoal):
 1. (\<Sum>k. ennreal (- ln (x * y) * x ^ (k + r) * y ^ (k + s))) = ennreal (- ln (x * y) * x ^ r * y ^ s) * (\<Sum>k. ennreal ((x * y) ^ k))
[PROOF STEP]
by (subst ennreal_suminf_cmult [symmetric], subst ennreal_mult'' [symmetric])
                  (auto simp: power_add mult_ac power_mult_distrib)
[PROOF STATE]
proof (state)
this:
(\<Sum>k. ennreal (- ln (x * y) * x ^ (k + r) * y ^ (k + s))) = ennreal (- ln (x * y) * x ^ r * y ^ s) * (\<Sum>k. ennreal ((x * y) ^ k))

goal (1 subgoal):
 1. \<And>a b. \<lbrakk>(a, b) \<in> space lborel; a \<in> {0<..<1}; b \<in> {0<..<1}\<rbrakk> \<Longrightarrow> ennreal (- ln (a * b) / (1 - a * b) * a ^ r * b ^ s) = (\<Sum>k. ennreal (- ln (a * b) * a ^ (k + r) * b ^ (k + s)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k. ennreal (- ln (x * y) * x ^ (k + r) * y ^ (k + s))) = ennreal (- ln (x * y) * x ^ r * y ^ s) * (\<Sum>k. ennreal ((x * y) ^ k))

goal (1 subgoal):
 1. \<And>a b. \<lbrakk>(a, b) \<in> space lborel; a \<in> {0<..<1}; b \<in> {0<..<1}\<rbrakk> \<Longrightarrow> ennreal (- ln (a * b) / (1 - a * b) * a ^ r * b ^ s) = (\<Sum>k. ennreal (- ln (a * b) * a ^ (k + r) * b ^ (k + s)))
[PROOF STEP]
have "(\<Sum>k. ennreal ((x*y)^k)) = ennreal (1 / (1 - x*y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k. ennreal ((x * y) ^ k)) = ennreal (1 / (1 - x * y))
[PROOF STEP]
using geometric_sums[of "x*y"] \<open>x * y < 1\<close> xy
[PROOF STATE]
proof (prove)
using this:
norm (x * y) < 1 \<Longrightarrow> (^) (x * y) sums (1 / (1 - x * y))
x * y < 1
x \<in> {0<..<1}
y \<in> {0<..<1}

goal (1 subgoal):
 1. (\<Sum>k. ennreal ((x * y) ^ k)) = ennreal (1 / (1 - x * y))
[PROOF STEP]
by (intro suminf_ennreal_eq) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>k. ennreal ((x * y) ^ k)) = ennreal (1 / (1 - x * y))

goal (1 subgoal):
 1. \<And>a b. \<lbrakk>(a, b) \<in> space lborel; a \<in> {0<..<1}; b \<in> {0<..<1}\<rbrakk> \<Longrightarrow> ennreal (- ln (a * b) / (1 - a * b) * a ^ r * b ^ s) = (\<Sum>k. ennreal (- ln (a * b) * a ^ (k + r) * b ^ (k + s)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k. ennreal ((x * y) ^ k)) = ennreal (1 / (1 - x * y))

goal (1 subgoal):
 1. \<And>a b. \<lbrakk>(a, b) \<in> space lborel; a \<in> {0<..<1}; b \<in> {0<..<1}\<rbrakk> \<Longrightarrow> ennreal (- ln (a * b) / (1 - a * b) * a ^ r * b ^ s) = (\<Sum>k. ennreal (- ln (a * b) * a ^ (k + r) * b ^ (k + s)))
[PROOF STEP]
have "ennreal (-ln (x*y) * x^r * y^s) * \<dots> =
                 ennreal (-ln (x*y) / (1 - x*y) * x^r * y^s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ennreal (- ln (x * y) * x ^ r * y ^ s) * ennreal (1 / (1 - x * y)) = ennreal (- ln (x * y) / (1 - x * y) * x ^ r * y ^ s)
[PROOF STEP]
using \<open>x * y < 1\<close>
[PROOF STATE]
proof (prove)
using this:
x * y < 1

goal (1 subgoal):
 1. ennreal (- ln (x * y) * x ^ r * y ^ s) * ennreal (1 / (1 - x * y)) = ennreal (- ln (x * y) / (1 - x * y) * x ^ r * y ^ s)
[PROOF STEP]
by (subst ennreal_mult'' [symmetric]) auto
[PROOF STATE]
proof (state)
this:
ennreal (- ln (x * y) * x ^ r * y ^ s) * ennreal (1 / (1 - x * y)) = ennreal (- ln (x * y) / (1 - x * y) * x ^ r * y ^ s)

goal (1 subgoal):
 1. \<And>a b. \<lbrakk>(a, b) \<in> space lborel; a \<in> {0<..<1}; b \<in> {0<..<1}\<rbrakk> \<Longrightarrow> ennreal (- ln (a * b) / (1 - a * b) * a ^ r * b ^ s) = (\<Sum>k. ennreal (- ln (a * b) * a ^ (k + r) * b ^ (k + s)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>k. ennreal (- ln (x * y) * x ^ (k + r) * y ^ (k + s))) = ennreal (- ln (x * y) / (1 - x * y) * x ^ r * y ^ s)
[PROOF STEP]
show "ennreal (-ln (x*y) / (1 - x*y) * x^r * y^s) =
                    (\<Sum>k. ennreal (-ln (x*y) * x^(k+r) * y^(k+s)))"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>k. ennreal (- ln (x * y) * x ^ (k + r) * y ^ (k + s))) = ennreal (- ln (x * y) / (1 - x * y) * x ^ r * y ^ s)

goal (1 subgoal):
 1. ennreal (- ln (x * y) / (1 - x * y) * x ^ r * y ^ s) = (\<Sum>k. ennreal (- ln (x * y) * x ^ (k + r) * y ^ (k + s)))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
ennreal (- ln (x * y) / (1 - x * y) * x ^ r * y ^ s) = (\<Sum>k. ennreal (- ln (x * y) * x ^ (k + r) * y ^ (k + s)))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
beukers_nn_integral1 r s = \<integral>\<^sup>+x\<in>{0<..<1} \<times> {0<..<1}. (case x of (x, y) \<Rightarrow> \<Sum>k. ennreal (- ln (x * y) * x ^ (k + r) * y ^ (k + s)))\<partial>lborel

goal (1 subgoal):
 1. beukers_nn_integral1 r s = (\<Sum>k. ennreal (1 / real ((k + r + 1)\<^sup>2 * (k + s + 1)) + 1 / real ((k + r + 1) * (k + s + 1)\<^sup>2)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
beukers_nn_integral1 r s = \<integral>\<^sup>+x\<in>{0<..<1} \<times> {0<..<1}. (case x of (x, y) \<Rightarrow> \<Sum>k. ennreal (- ln (x * y) * x ^ (k + r) * y ^ (k + s)))\<partial>lborel

goal (1 subgoal):
 1. beukers_nn_integral1 r s = (\<Sum>k. ennreal (1 / real ((k + r + 1)\<^sup>2 * (k + s + 1)) + 1 / real ((k + r + 1) * (k + s + 1)\<^sup>2)))
[PROOF STEP]
have "\<dots> = (\<Sum>k. (\<integral>\<^sup>+(x,y)\<in>{0<..<1}\<times>{0<..<1}. (ennreal (-ln (x*y) * x^(k+r) * y^(k+s))) \<partial>lborel))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>{0<..<1} \<times> {0<..<1}. (case x of (x, y) \<Rightarrow> \<Sum>k. ennreal (- ln (x * y) * x ^ (k + r) * y ^ (k + s)))\<partial>lborel = (\<Sum>k. \<integral>\<^sup>+x\<in>{0<..<1} \<times> {0<..<1}. (case x of (x, y) \<Rightarrow> ennreal (- ln (x * y) * x ^ (k + r) * y ^ (k + s)))\<partial>lborel)
[PROOF STEP]
unfolding case_prod_unfold
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>{0<..<1} \<times> {0<..<1}. (\<Sum>k. ennreal (- ln (fst x * snd x) * fst x ^ (k + r) * snd x ^ (k + s)))\<partial>lborel = (\<Sum>k. \<integral>\<^sup>+x\<in>{0<..<1} \<times> {0<..<1}. ennreal (- ln (fst x * snd x) * fst x ^ (k + r) * snd x ^ (k + s))\<partial>lborel)
[PROOF STEP]
by (subst nn_integral_suminf [symmetric]) (auto simp flip: borel_prod)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>{0<..<1} \<times> {0<..<1}. (case x of (x, y) \<Rightarrow> \<Sum>k. ennreal (- ln (x * y) * x ^ (k + r) * y ^ (k + s)))\<partial>lborel = (\<Sum>k. \<integral>\<^sup>+x\<in>{0<..<1} \<times> {0<..<1}. (case x of (x, y) \<Rightarrow> ennreal (- ln (x * y) * x ^ (k + r) * y ^ (k + s)))\<partial>lborel)

goal (1 subgoal):
 1. beukers_nn_integral1 r s = (\<Sum>k. ennreal (1 / real ((k + r + 1)\<^sup>2 * (k + s + 1)) + 1 / real ((k + r + 1) * (k + s + 1)\<^sup>2)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>{0<..<1} \<times> {0<..<1}. (case x of (x, y) \<Rightarrow> \<Sum>k. ennreal (- ln (x * y) * x ^ (k + r) * y ^ (k + s)))\<partial>lborel = (\<Sum>k. \<integral>\<^sup>+x\<in>{0<..<1} \<times> {0<..<1}. (case x of (x, y) \<Rightarrow> ennreal (- ln (x * y) * x ^ (k + r) * y ^ (k + s)))\<partial>lborel)

goal (1 subgoal):
 1. beukers_nn_integral1 r s = (\<Sum>k. ennreal (1 / real ((k + r + 1)\<^sup>2 * (k + s + 1)) + 1 / real ((k + r + 1) * (k + s + 1)\<^sup>2)))
[PROOF STEP]
have "\<dots> = (\<Sum>k. ennreal (1 / ((k+r+1)^2*(k+s+1)) + 1 / ((k+r+1)*(k+s+1)^2)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k. \<integral>\<^sup>+x\<in>{0<..<1} \<times> {0<..<1}. (case x of (x, y) \<Rightarrow> ennreal (- ln (x * y) * x ^ (k + r) * y ^ (k + s)))\<partial>lborel) = (\<Sum>k. ennreal (1 / real ((k + r + 1)\<^sup>2 * (k + s + 1)) + 1 / real ((k + r + 1) * (k + s + 1)\<^sup>2)))
[PROOF STEP]
proof (rule suminf_cong)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<integral>\<^sup>+x\<in>{0<..<1} \<times> {0<..<1}. (case x of (x, y) \<Rightarrow> ennreal (- ln (x * y) * x ^ (n + r) * y ^ (n + s)))\<partial>lborel = ennreal (1 / real ((n + r + 1)\<^sup>2 * (n + s + 1)) + 1 / real ((n + r + 1) * (n + s + 1)\<^sup>2))
[PROOF STEP]
fix k :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<integral>\<^sup>+x\<in>{0<..<1} \<times> {0<..<1}. (case x of (x, y) \<Rightarrow> ennreal (- ln (x * y) * x ^ (n + r) * y ^ (n + s)))\<partial>lborel = ennreal (1 / real ((n + r + 1)\<^sup>2 * (n + s + 1)) + 1 / real ((n + r + 1) * (n + s + 1)\<^sup>2))
[PROOF STEP]
define F where "F = (\<lambda>x y::real. x + y)"
[PROOF STATE]
proof (state)
this:
F = (+)

goal (1 subgoal):
 1. \<And>n. \<integral>\<^sup>+x\<in>{0<..<1} \<times> {0<..<1}. (case x of (x, y) \<Rightarrow> ennreal (- ln (x * y) * x ^ (n + r) * y ^ (n + s)))\<partial>lborel = ennreal (1 / real ((n + r + 1)\<^sup>2 * (n + s + 1)) + 1 / real ((n + r + 1) * (n + s + 1)\<^sup>2))
[PROOF STEP]
have "(\<integral>\<^sup>+(x,y)\<in>{0<..<1}\<times>{0<..<1}. ennreal (-ln (x*y) * x^(k+r) * y^(k+s)) \<partial>lborel) =
            (\<integral>\<^sup>+x\<in>{0<..<1}. (\<integral>\<^sup>+y\<in>{0<..<1}. ennreal (-ln (x*y) * x^(k+r) * y^(k+s)) \<partial>lborel) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>{0<..<1} \<times> {0<..<1}. (case x of (x, y) \<Rightarrow> ennreal (- ln (x * y) * x ^ (k + r) * y ^ (k + s)))\<partial>lborel = \<integral>\<^sup>+x\<in>{0<..<1}. (\<integral>\<^sup>+xa\<in>{0<..<1}. ennreal (- ln (x * xa) * x ^ (k + r) * xa ^ (k + s))\<partial>lborel)\<partial>lborel
[PROOF STEP]
unfolding case_prod_unfold lborel_prod [symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>{0<..<1} \<times> {0<..<1}. ennreal (- ln (fst x * snd x) * fst x ^ (k + r) * snd x ^ (k + s))\<partial>lborel \<Otimes>\<^sub>M lborel = \<integral>\<^sup>+x\<in>{0<..<1}. (\<integral>\<^sup>+xa\<in>{0<..<1}. ennreal (- ln (x * xa) * x ^ (k + r) * xa ^ (k + s))\<partial>lborel)\<partial>lborel
[PROOF STEP]
by (subst lborel.nn_integral_fst [symmetric]) (auto intro!: nn_integral_cong simp: indicator_def)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>{0<..<1} \<times> {0<..<1}. (case x of (x, y) \<Rightarrow> ennreal (- ln (x * y) * x ^ (k + r) * y ^ (k + s)))\<partial>lborel = \<integral>\<^sup>+x\<in>{0<..<1}. (\<integral>\<^sup>+xa\<in>{0<..<1}. ennreal (- ln (x * xa) * x ^ (k + r) * xa ^ (k + s))\<partial>lborel)\<partial>lborel

goal (1 subgoal):
 1. \<And>n. \<integral>\<^sup>+x\<in>{0<..<1} \<times> {0<..<1}. (case x of (x, y) \<Rightarrow> ennreal (- ln (x * y) * x ^ (n + r) * y ^ (n + s)))\<partial>lborel = ennreal (1 / real ((n + r + 1)\<^sup>2 * (n + s + 1)) + 1 / real ((n + r + 1) * (n + s + 1)\<^sup>2))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>{0<..<1} \<times> {0<..<1}. (case x of (x, y) \<Rightarrow> ennreal (- ln (x * y) * x ^ (k + r) * y ^ (k + s)))\<partial>lborel = \<integral>\<^sup>+x\<in>{0<..<1}. (\<integral>\<^sup>+xa\<in>{0<..<1}. ennreal (- ln (x * xa) * x ^ (k + r) * xa ^ (k + s))\<partial>lborel)\<partial>lborel

goal (1 subgoal):
 1. \<And>n. \<integral>\<^sup>+x\<in>{0<..<1} \<times> {0<..<1}. (case x of (x, y) \<Rightarrow> ennreal (- ln (x * y) * x ^ (n + r) * y ^ (n + s)))\<partial>lborel = ennreal (1 / real ((n + r + 1)\<^sup>2 * (n + s + 1)) + 1 / real ((n + r + 1) * (n + s + 1)\<^sup>2))
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+x\<in>{0<..<1}. ennreal (-ln x * x^(k+r) / (k+s+1) + x^(k+r)/(k+s+1)^2) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>{0<..<1}. (\<integral>\<^sup>+xa\<in>{0<..<1}. ennreal (- ln (x * xa) * x ^ (k + r) * xa ^ (k + s))\<partial>lborel)\<partial>lborel = \<integral>\<^sup>+x\<in>{0<..<1}. ennreal (- ln x * x ^ (k + r) / real (k + s + 1) + x ^ (k + r) / real ((k + s + 1)\<^sup>2))\<partial>lborel
[PROOF STEP]
proof (intro set_nn_integral_cong refl, clarify)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> space lborel; x \<in> {0<..<1}\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+xa\<in>{0<..<1}. ennreal (- ln (x * xa) * x ^ (k + r) * xa ^ (k + s))\<partial>lborel = ennreal (- ln x * x ^ (k + r) / real (k + s + 1) + x ^ (k + r) / real ((k + s + 1)\<^sup>2))
[PROOF STEP]
fix x :: real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> space lborel; x \<in> {0<..<1}\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+xa\<in>{0<..<1}. ennreal (- ln (x * xa) * x ^ (k + r) * xa ^ (k + s))\<partial>lborel = ennreal (- ln x * x ^ (k + r) / real (k + s + 1) + x ^ (k + r) / real ((k + s + 1)\<^sup>2))
[PROOF STEP]
assume x: "x \<in> {0<..<1}"
[PROOF STATE]
proof (state)
this:
x \<in> {0<..<1}

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> space lborel; x \<in> {0<..<1}\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+xa\<in>{0<..<1}. ennreal (- ln (x * xa) * x ^ (k + r) * xa ^ (k + s))\<partial>lborel = ennreal (- ln x * x ^ (k + r) / real (k + s + 1) + x ^ (k + r) / real ((k + s + 1)\<^sup>2))
[PROOF STEP]
have "(\<integral>\<^sup>+y\<in>{0<..<1}. ennreal (-ln (x*y) * x^(k+r) * y^(k+s)) \<partial>lborel) =
              (\<integral>\<^sup>+y\<in>{0<..<1}. (ennreal (-ln x * x^(k+r) * y^(k+s)) + ennreal (-ln y * x^(k+r) * y^(k+s))) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+xa\<in>{0<..<1}. ennreal (- ln (x * xa) * x ^ (k + r) * xa ^ (k + s))\<partial>lborel = \<integral>\<^sup>+xa\<in>{0<..<1}. (ennreal (- ln x * x ^ (k + r) * xa ^ (k + s)) + ennreal (- ln xa * x ^ (k + r) * xa ^ (k + s)))\<partial>lborel
[PROOF STEP]
by (intro set_nn_integral_cong)
           (use x in \<open>auto simp: ln_mult ring_distribs mult_nonpos_nonneg simp flip: ennreal_plus\<close>)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+xa\<in>{0<..<1}. ennreal (- ln (x * xa) * x ^ (k + r) * xa ^ (k + s))\<partial>lborel = \<integral>\<^sup>+xa\<in>{0<..<1}. (ennreal (- ln x * x ^ (k + r) * xa ^ (k + s)) + ennreal (- ln xa * x ^ (k + r) * xa ^ (k + s)))\<partial>lborel

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> space lborel; x \<in> {0<..<1}\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+xa\<in>{0<..<1}. ennreal (- ln (x * xa) * x ^ (k + r) * xa ^ (k + s))\<partial>lborel = ennreal (- ln x * x ^ (k + r) / real (k + s + 1) + x ^ (k + r) / real ((k + s + 1)\<^sup>2))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+xa\<in>{0<..<1}. ennreal (- ln (x * xa) * x ^ (k + r) * xa ^ (k + s))\<partial>lborel = \<integral>\<^sup>+xa\<in>{0<..<1}. (ennreal (- ln x * x ^ (k + r) * xa ^ (k + s)) + ennreal (- ln xa * x ^ (k + r) * xa ^ (k + s)))\<partial>lborel

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> space lborel; x \<in> {0<..<1}\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+xa\<in>{0<..<1}. ennreal (- ln (x * xa) * x ^ (k + r) * xa ^ (k + s))\<partial>lborel = ennreal (- ln x * x ^ (k + r) / real (k + s + 1) + x ^ (k + r) / real ((k + s + 1)\<^sup>2))
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+y\<in>{0<..<1}. ennreal (-ln x * x^(k+r) * y^(k+s)) \<partial>lborel) +
                      (\<integral>\<^sup>+y\<in>{0<..<1}. ennreal (-ln y * x^(k+r) * y^(k+s)) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+xa\<in>{0<..<1}. (ennreal (- ln x * x ^ (k + r) * xa ^ (k + s)) + ennreal (- ln xa * x ^ (k + r) * xa ^ (k + s)))\<partial>lborel = (\<integral>\<^sup>+xa\<in>{0<..<1}. ennreal (- ln x * x ^ (k + r) * xa ^ (k + s))\<partial>lborel) + (\<integral>\<^sup>+xa\<in>{0<..<1}. ennreal (- ln xa * x ^ (k + r) * xa ^ (k + s))\<partial>lborel)
[PROOF STEP]
by (subst nn_integral_add [symmetric]) (auto intro!: nn_integral_cong simp: indicator_def)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+xa\<in>{0<..<1}. (ennreal (- ln x * x ^ (k + r) * xa ^ (k + s)) + ennreal (- ln xa * x ^ (k + r) * xa ^ (k + s)))\<partial>lborel = (\<integral>\<^sup>+xa\<in>{0<..<1}. ennreal (- ln x * x ^ (k + r) * xa ^ (k + s))\<partial>lborel) + (\<integral>\<^sup>+xa\<in>{0<..<1}. ennreal (- ln xa * x ^ (k + r) * xa ^ (k + s))\<partial>lborel)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> space lborel; x \<in> {0<..<1}\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+xa\<in>{0<..<1}. ennreal (- ln (x * xa) * x ^ (k + r) * xa ^ (k + s))\<partial>lborel = ennreal (- ln x * x ^ (k + r) / real (k + s + 1) + x ^ (k + r) / real ((k + s + 1)\<^sup>2))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+xa\<in>{0<..<1}. (ennreal (- ln x * x ^ (k + r) * xa ^ (k + s)) + ennreal (- ln xa * x ^ (k + r) * xa ^ (k + s)))\<partial>lborel = (\<integral>\<^sup>+xa\<in>{0<..<1}. ennreal (- ln x * x ^ (k + r) * xa ^ (k + s))\<partial>lborel) + (\<integral>\<^sup>+xa\<in>{0<..<1}. ennreal (- ln xa * x ^ (k + r) * xa ^ (k + s))\<partial>lborel)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> space lborel; x \<in> {0<..<1}\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+xa\<in>{0<..<1}. ennreal (- ln (x * xa) * x ^ (k + r) * xa ^ (k + s))\<partial>lborel = ennreal (- ln x * x ^ (k + r) / real (k + s + 1) + x ^ (k + r) / real ((k + s + 1)\<^sup>2))
[PROOF STEP]
have "(\<integral>\<^sup>+y\<in>{0<..<1}. ennreal (-ln x * x^(k+r) * y^(k+s)) \<partial>lborel) =
                 ennreal (-ln x * x^(k+r)) * (\<integral>\<^sup>+y\<in>{0<..<1}. ennreal (y^(k+s)) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+xa\<in>{0<..<1}. ennreal (- ln x * x ^ (k + r) * xa ^ (k + s))\<partial>lborel = ennreal (- ln x * x ^ (k + r)) * (\<integral>\<^sup>+x\<in>{0<..<1}. ennreal (x ^ (k + s))\<partial>lborel)
[PROOF STEP]
by (subst nn_integral_cmult [symmetric])
           (auto intro!: nn_integral_cong simp: indicator_def simp flip: ennreal_mult'')
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+xa\<in>{0<..<1}. ennreal (- ln x * x ^ (k + r) * xa ^ (k + s))\<partial>lborel = ennreal (- ln x * x ^ (k + r)) * (\<integral>\<^sup>+x\<in>{0<..<1}. ennreal (x ^ (k + s))\<partial>lborel)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> space lborel; x \<in> {0<..<1}\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+xa\<in>{0<..<1}. ennreal (- ln (x * xa) * x ^ (k + r) * xa ^ (k + s))\<partial>lborel = ennreal (- ln x * x ^ (k + r) / real (k + s + 1) + x ^ (k + r) / real ((k + s + 1)\<^sup>2))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+xa\<in>{0<..<1}. ennreal (- ln x * x ^ (k + r) * xa ^ (k + s))\<partial>lborel = ennreal (- ln x * x ^ (k + r)) * (\<integral>\<^sup>+x\<in>{0<..<1}. ennreal (x ^ (k + s))\<partial>lborel)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> space lborel; x \<in> {0<..<1}\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+xa\<in>{0<..<1}. ennreal (- ln (x * xa) * x ^ (k + r) * xa ^ (k + s))\<partial>lborel = ennreal (- ln x * x ^ (k + r) / real (k + s + 1) + x ^ (k + r) / real ((k + s + 1)\<^sup>2))
[PROOF STEP]
have "(\<integral>\<^sup>+y\<in>{0<..<1}. ennreal (y^(k+s)) \<partial>lborel) = ennreal (1/(k+s+1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>{0<..<1}. ennreal (x ^ (k + s))\<partial>lborel = ennreal (1 / real (k + s + 1))
[PROOF STEP]
by (subst nn_integral_0_1_power) simp
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>{0<..<1}. ennreal (x ^ (k + s))\<partial>lborel = ennreal (1 / real (k + s + 1))

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> space lborel; x \<in> {0<..<1}\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+xa\<in>{0<..<1}. ennreal (- ln (x * xa) * x ^ (k + r) * xa ^ (k + s))\<partial>lborel = ennreal (- ln x * x ^ (k + r) / real (k + s + 1) + x ^ (k + r) / real ((k + s + 1)\<^sup>2))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>{0<..<1}. ennreal (x ^ (k + s))\<partial>lborel = ennreal (1 / real (k + s + 1))

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> space lborel; x \<in> {0<..<1}\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+xa\<in>{0<..<1}. ennreal (- ln (x * xa) * x ^ (k + r) * xa ^ (k + s))\<partial>lborel = ennreal (- ln x * x ^ (k + r) / real (k + s + 1) + x ^ (k + r) / real ((k + s + 1)\<^sup>2))
[PROOF STEP]
have "ennreal (-ln x * x^(k+r)) * \<dots> = ennreal (-ln x * x^(k+r) / (k+s+1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ennreal (- ln x * x ^ (k + r)) * ennreal (1 / real (k + s + 1)) = ennreal (- ln x * x ^ (k + r) / real (k + s + 1))
[PROOF STEP]
by (subst ennreal_mult'' [symmetric]) auto
[PROOF STATE]
proof (state)
this:
ennreal (- ln x * x ^ (k + r)) * ennreal (1 / real (k + s + 1)) = ennreal (- ln x * x ^ (k + r) / real (k + s + 1))

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> space lborel; x \<in> {0<..<1}\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+xa\<in>{0<..<1}. ennreal (- ln (x * xa) * x ^ (k + r) * xa ^ (k + s))\<partial>lborel = ennreal (- ln x * x ^ (k + r) / real (k + s + 1) + x ^ (k + r) / real ((k + s + 1)\<^sup>2))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ennreal (- ln x * x ^ (k + r)) * ennreal (1 / real (k + s + 1)) = ennreal (- ln x * x ^ (k + r) / real (k + s + 1))

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> space lborel; x \<in> {0<..<1}\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+xa\<in>{0<..<1}. ennreal (- ln (x * xa) * x ^ (k + r) * xa ^ (k + s))\<partial>lborel = ennreal (- ln x * x ^ (k + r) / real (k + s + 1) + x ^ (k + r) / real ((k + s + 1)\<^sup>2))
[PROOF STEP]
have "(\<integral>\<^sup>+y\<in>{0<..<1}. ennreal (-ln y * x^(k+r) * y^(k+s)) \<partial>lborel) =
                   ennreal (x^(k+r)) * (\<integral>\<^sup>+y\<in>{0<..<1}. ennreal (-ln y * y^(k+s)) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+xa\<in>{0<..<1}. ennreal (- ln xa * x ^ (k + r) * xa ^ (k + s))\<partial>lborel = ennreal (x ^ (k + r)) * (\<integral>\<^sup>+x\<in>{0<..<1}. ennreal (- ln x * x ^ (k + s))\<partial>lborel)
[PROOF STEP]
by (subst nn_integral_cmult [symmetric])
           (use x in \<open>auto intro!: nn_integral_cong simp: indicator_def mult_ac simp flip: ennreal_mult'\<close>)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+xa\<in>{0<..<1}. ennreal (- ln xa * x ^ (k + r) * xa ^ (k + s))\<partial>lborel = ennreal (x ^ (k + r)) * (\<integral>\<^sup>+x\<in>{0<..<1}. ennreal (- ln x * x ^ (k + s))\<partial>lborel)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> space lborel; x \<in> {0<..<1}\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+xa\<in>{0<..<1}. ennreal (- ln (x * xa) * x ^ (k + r) * xa ^ (k + s))\<partial>lborel = ennreal (- ln x * x ^ (k + r) / real (k + s + 1) + x ^ (k + r) / real ((k + s + 1)\<^sup>2))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+xa\<in>{0<..<1}. ennreal (- ln xa * x ^ (k + r) * xa ^ (k + s))\<partial>lborel = ennreal (x ^ (k + r)) * (\<integral>\<^sup>+x\<in>{0<..<1}. ennreal (- ln x * x ^ (k + s))\<partial>lborel)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> space lborel; x \<in> {0<..<1}\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+xa\<in>{0<..<1}. ennreal (- ln (x * xa) * x ^ (k + r) * xa ^ (k + s))\<partial>lborel = ennreal (- ln x * x ^ (k + r) / real (k + s + 1) + x ^ (k + r) / real ((k + s + 1)\<^sup>2))
[PROOF STEP]
have "(\<integral>\<^sup>+y\<in>{0<..<1}. ennreal (-ln y * y^(k+s)) \<partial>lborel) = ennreal (1 / (k + s + 1)\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>{0<..<1}. ennreal (- ln x * x ^ (k + s))\<partial>lborel = ennreal (1 / real ((k + s + 1)\<^sup>2))
[PROOF STEP]
by (subst nn_integral_0_1_ln_times_power) simp
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>{0<..<1}. ennreal (- ln x * x ^ (k + s))\<partial>lborel = ennreal (1 / real ((k + s + 1)\<^sup>2))

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> space lborel; x \<in> {0<..<1}\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+xa\<in>{0<..<1}. ennreal (- ln (x * xa) * x ^ (k + r) * xa ^ (k + s))\<partial>lborel = ennreal (- ln x * x ^ (k + r) / real (k + s + 1) + x ^ (k + r) / real ((k + s + 1)\<^sup>2))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>{0<..<1}. ennreal (- ln x * x ^ (k + s))\<partial>lborel = ennreal (1 / real ((k + s + 1)\<^sup>2))

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> space lborel; x \<in> {0<..<1}\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+xa\<in>{0<..<1}. ennreal (- ln (x * xa) * x ^ (k + r) * xa ^ (k + s))\<partial>lborel = ennreal (- ln x * x ^ (k + r) / real (k + s + 1) + x ^ (k + r) / real ((k + s + 1)\<^sup>2))
[PROOF STEP]
have "ennreal (x ^ (k + r)) * \<dots> = ennreal (x ^ (k + r) / (k + s + 1) ^ 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ennreal (x ^ (k + r)) * ennreal (1 / real ((k + s + 1)\<^sup>2)) = ennreal (x ^ (k + r) / real ((k + s + 1)\<^sup>2))
[PROOF STEP]
by (subst ennreal_mult'' [symmetric]) auto
[PROOF STATE]
proof (state)
this:
ennreal (x ^ (k + r)) * ennreal (1 / real ((k + s + 1)\<^sup>2)) = ennreal (x ^ (k + r) / real ((k + s + 1)\<^sup>2))

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> space lborel; x \<in> {0<..<1}\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+xa\<in>{0<..<1}. ennreal (- ln (x * xa) * x ^ (k + r) * xa ^ (k + s))\<partial>lborel = ennreal (- ln x * x ^ (k + r) / real (k + s + 1) + x ^ (k + r) / real ((k + s + 1)\<^sup>2))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ennreal (x ^ (k + r)) * ennreal (1 / real ((k + s + 1)\<^sup>2)) = ennreal (x ^ (k + r) / real ((k + s + 1)\<^sup>2))

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> space lborel; x \<in> {0<..<1}\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+xa\<in>{0<..<1}. ennreal (- ln (x * xa) * x ^ (k + r) * xa ^ (k + s))\<partial>lborel = ennreal (- ln x * x ^ (k + r) / real (k + s + 1) + x ^ (k + r) / real ((k + s + 1)\<^sup>2))
[PROOF STEP]
have "ennreal (- ln x * x ^ (k + r) / (k + s + 1)) + \<dots> =
                   ennreal (-ln x * x^(k+r) / (k+s+1) + x^(k+r)/(k+s+1)^2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ennreal (- ln x * x ^ (k + r) / real (k + s + 1)) + ennreal (x ^ (k + r) / real ((k + s + 1)\<^sup>2)) = ennreal (- ln x * x ^ (k + r) / real (k + s + 1) + x ^ (k + r) / real ((k + s + 1)\<^sup>2))
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
x \<in> {0<..<1}

goal (1 subgoal):
 1. ennreal (- ln x * x ^ (k + r) / real (k + s + 1)) + ennreal (x ^ (k + r) / real ((k + s + 1)\<^sup>2)) = ennreal (- ln x * x ^ (k + r) / real (k + s + 1) + x ^ (k + r) / real ((k + s + 1)\<^sup>2))
[PROOF STEP]
by (subst ennreal_plus) (auto simp: mult_nonpos_nonneg divide_nonpos_nonneg)
[PROOF STATE]
proof (state)
this:
ennreal (- ln x * x ^ (k + r) / real (k + s + 1)) + ennreal (x ^ (k + r) / real ((k + s + 1)\<^sup>2)) = ennreal (- ln x * x ^ (k + r) / real (k + s + 1) + x ^ (k + r) / real ((k + s + 1)\<^sup>2))

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> space lborel; x \<in> {0<..<1}\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+xa\<in>{0<..<1}. ennreal (- ln (x * xa) * x ^ (k + r) * xa ^ (k + s))\<partial>lborel = ennreal (- ln x * x ^ (k + r) / real (k + s + 1) + x ^ (k + r) / real ((k + s + 1)\<^sup>2))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<integral>\<^sup>+xa\<in>{0<..<1}. ennreal (- ln (x * xa) * x ^ (k + r) * xa ^ (k + s))\<partial>lborel = ennreal (- ln x * x ^ (k + r) / real (k + s + 1) + x ^ (k + r) / real ((k + s + 1)\<^sup>2))
[PROOF STEP]
show "(\<integral>\<^sup>+y\<in>{0<..<1}. ennreal (-ln (x*y) * x^(k+r) * y^(k+s)) \<partial>lborel) =
                      ennreal (-ln x * x^(k+r) / (k+s+1) + x^(k+r)/(k+s+1)^2)"
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+xa\<in>{0<..<1}. ennreal (- ln (x * xa) * x ^ (k + r) * xa ^ (k + s))\<partial>lborel = ennreal (- ln x * x ^ (k + r) / real (k + s + 1) + x ^ (k + r) / real ((k + s + 1)\<^sup>2))

goal (1 subgoal):
 1. \<integral>\<^sup>+xa\<in>{0<..<1}. ennreal (- ln (x * xa) * x ^ (k + r) * xa ^ (k + s))\<partial>lborel = ennreal (- ln x * x ^ (k + r) / real (k + s + 1) + x ^ (k + r) / real ((k + s + 1)\<^sup>2))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+xa\<in>{0<..<1}. ennreal (- ln (x * xa) * x ^ (k + r) * xa ^ (k + s))\<partial>lborel = ennreal (- ln x * x ^ (k + r) / real (k + s + 1) + x ^ (k + r) / real ((k + s + 1)\<^sup>2))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>{0<..<1}. (\<integral>\<^sup>+xa\<in>{0<..<1}. ennreal (- ln (x * xa) * x ^ (k + r) * xa ^ (k + s))\<partial>lborel)\<partial>lborel = \<integral>\<^sup>+x\<in>{0<..<1}. ennreal (- ln x * x ^ (k + r) / real (k + s + 1) + x ^ (k + r) / real ((k + s + 1)\<^sup>2))\<partial>lborel

goal (1 subgoal):
 1. \<And>n. \<integral>\<^sup>+x\<in>{0<..<1} \<times> {0<..<1}. (case x of (x, y) \<Rightarrow> ennreal (- ln (x * y) * x ^ (n + r) * y ^ (n + s)))\<partial>lborel = ennreal (1 / real ((n + r + 1)\<^sup>2 * (n + s + 1)) + 1 / real ((n + r + 1) * (n + s + 1)\<^sup>2))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>{0<..<1}. (\<integral>\<^sup>+xa\<in>{0<..<1}. ennreal (- ln (x * xa) * x ^ (k + r) * xa ^ (k + s))\<partial>lborel)\<partial>lborel = \<integral>\<^sup>+x\<in>{0<..<1}. ennreal (- ln x * x ^ (k + r) / real (k + s + 1) + x ^ (k + r) / real ((k + s + 1)\<^sup>2))\<partial>lborel

goal (1 subgoal):
 1. \<And>n. \<integral>\<^sup>+x\<in>{0<..<1} \<times> {0<..<1}. (case x of (x, y) \<Rightarrow> ennreal (- ln (x * y) * x ^ (n + r) * y ^ (n + s)))\<partial>lborel = ennreal (1 / real ((n + r + 1)\<^sup>2 * (n + s + 1)) + 1 / real ((n + r + 1) * (n + s + 1)\<^sup>2))
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+x\<in>{0<..<1}. (ennreal (-ln x * x^(k+r) / (k+s+1)) +
                       ennreal (x^(k+r)/(k+s+1)^2)) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>{0<..<1}. ennreal (- ln x * x ^ (k + r) / real (k + s + 1) + x ^ (k + r) / real ((k + s + 1)\<^sup>2))\<partial>lborel = \<integral>\<^sup>+x\<in>{0<..<1}. (ennreal (- ln x * x ^ (k + r) / real (k + s + 1)) + ennreal (x ^ (k + r) / real ((k + s + 1)\<^sup>2)))\<partial>lborel
[PROOF STEP]
by (intro set_nn_integral_cong refl, subst ennreal_plus)
         (auto simp: mult_nonpos_nonneg divide_nonpos_nonneg)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>{0<..<1}. ennreal (- ln x * x ^ (k + r) / real (k + s + 1) + x ^ (k + r) / real ((k + s + 1)\<^sup>2))\<partial>lborel = \<integral>\<^sup>+x\<in>{0<..<1}. (ennreal (- ln x * x ^ (k + r) / real (k + s + 1)) + ennreal (x ^ (k + r) / real ((k + s + 1)\<^sup>2)))\<partial>lborel

goal (1 subgoal):
 1. \<And>n. \<integral>\<^sup>+x\<in>{0<..<1} \<times> {0<..<1}. (case x of (x, y) \<Rightarrow> ennreal (- ln (x * y) * x ^ (n + r) * y ^ (n + s)))\<partial>lborel = ennreal (1 / real ((n + r + 1)\<^sup>2 * (n + s + 1)) + 1 / real ((n + r + 1) * (n + s + 1)\<^sup>2))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>{0<..<1}. ennreal (- ln x * x ^ (k + r) / real (k + s + 1) + x ^ (k + r) / real ((k + s + 1)\<^sup>2))\<partial>lborel = \<integral>\<^sup>+x\<in>{0<..<1}. (ennreal (- ln x * x ^ (k + r) / real (k + s + 1)) + ennreal (x ^ (k + r) / real ((k + s + 1)\<^sup>2)))\<partial>lborel

goal (1 subgoal):
 1. \<And>n. \<integral>\<^sup>+x\<in>{0<..<1} \<times> {0<..<1}. (case x of (x, y) \<Rightarrow> ennreal (- ln (x * y) * x ^ (n + r) * y ^ (n + s)))\<partial>lborel = ennreal (1 / real ((n + r + 1)\<^sup>2 * (n + s + 1)) + 1 / real ((n + r + 1) * (n + s + 1)\<^sup>2))
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+x\<in>{0<..<1}. ennreal (-ln x * x^(k+r) / (k+s+1)) \<partial>lborel) +
                    (\<integral>\<^sup>+x\<in>{0<..<1}. ennreal (x^(k+r)/(k+s+1)^2) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>{0<..<1}. (ennreal (- ln x * x ^ (k + r) / real (k + s + 1)) + ennreal (x ^ (k + r) / real ((k + s + 1)\<^sup>2)))\<partial>lborel = (\<integral>\<^sup>+x\<in>{0<..<1}. ennreal (- ln x * x ^ (k + r) / real (k + s + 1))\<partial>lborel) + (\<integral>\<^sup>+x\<in>{0<..<1}. ennreal (x ^ (k + r) / real ((k + s + 1)\<^sup>2))\<partial>lborel)
[PROOF STEP]
by (subst nn_integral_add [symmetric]) (auto intro!: nn_integral_cong simp: indicator_def)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>{0<..<1}. (ennreal (- ln x * x ^ (k + r) / real (k + s + 1)) + ennreal (x ^ (k + r) / real ((k + s + 1)\<^sup>2)))\<partial>lborel = (\<integral>\<^sup>+x\<in>{0<..<1}. ennreal (- ln x * x ^ (k + r) / real (k + s + 1))\<partial>lborel) + (\<integral>\<^sup>+x\<in>{0<..<1}. ennreal (x ^ (k + r) / real ((k + s + 1)\<^sup>2))\<partial>lborel)

goal (1 subgoal):
 1. \<And>n. \<integral>\<^sup>+x\<in>{0<..<1} \<times> {0<..<1}. (case x of (x, y) \<Rightarrow> ennreal (- ln (x * y) * x ^ (n + r) * y ^ (n + s)))\<partial>lborel = ennreal (1 / real ((n + r + 1)\<^sup>2 * (n + s + 1)) + 1 / real ((n + r + 1) * (n + s + 1)\<^sup>2))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>{0<..<1}. (ennreal (- ln x * x ^ (k + r) / real (k + s + 1)) + ennreal (x ^ (k + r) / real ((k + s + 1)\<^sup>2)))\<partial>lborel = (\<integral>\<^sup>+x\<in>{0<..<1}. ennreal (- ln x * x ^ (k + r) / real (k + s + 1))\<partial>lborel) + (\<integral>\<^sup>+x\<in>{0<..<1}. ennreal (x ^ (k + r) / real ((k + s + 1)\<^sup>2))\<partial>lborel)

goal (1 subgoal):
 1. \<And>n. \<integral>\<^sup>+x\<in>{0<..<1} \<times> {0<..<1}. (case x of (x, y) \<Rightarrow> ennreal (- ln (x * y) * x ^ (n + r) * y ^ (n + s)))\<partial>lborel = ennreal (1 / real ((n + r + 1)\<^sup>2 * (n + s + 1)) + 1 / real ((n + r + 1) * (n + s + 1)\<^sup>2))
[PROOF STEP]
have "(\<integral>\<^sup>+x\<in>{0<..<1}. ennreal (-ln x * x^(k+r) / (k+s+1)) \<partial>lborel) =
                  ennreal (1 / (k+s+1)) * (\<integral>\<^sup>+x\<in>{0<..<1}. ennreal (-ln x * x^(k+r)) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>{0<..<1}. ennreal (- ln x * x ^ (k + r) / real (k + s + 1))\<partial>lborel = ennreal (1 / real (k + s + 1)) * (\<integral>\<^sup>+x\<in>{0<..<1}. ennreal (- ln x * x ^ (k + r))\<partial>lborel)
[PROOF STEP]
by (subst nn_integral_cmult [symmetric])
         (auto intro!: nn_integral_cong simp: indicator_def simp flip: ennreal_mult')
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>{0<..<1}. ennreal (- ln x * x ^ (k + r) / real (k + s + 1))\<partial>lborel = ennreal (1 / real (k + s + 1)) * (\<integral>\<^sup>+x\<in>{0<..<1}. ennreal (- ln x * x ^ (k + r))\<partial>lborel)

goal (1 subgoal):
 1. \<And>n. \<integral>\<^sup>+x\<in>{0<..<1} \<times> {0<..<1}. (case x of (x, y) \<Rightarrow> ennreal (- ln (x * y) * x ^ (n + r) * y ^ (n + s)))\<partial>lborel = ennreal (1 / real ((n + r + 1)\<^sup>2 * (n + s + 1)) + 1 / real ((n + r + 1) * (n + s + 1)\<^sup>2))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>{0<..<1}. ennreal (- ln x * x ^ (k + r) / real (k + s + 1))\<partial>lborel = ennreal (1 / real (k + s + 1)) * (\<integral>\<^sup>+x\<in>{0<..<1}. ennreal (- ln x * x ^ (k + r))\<partial>lborel)

goal (1 subgoal):
 1. \<And>n. \<integral>\<^sup>+x\<in>{0<..<1} \<times> {0<..<1}. (case x of (x, y) \<Rightarrow> ennreal (- ln (x * y) * x ^ (n + r) * y ^ (n + s)))\<partial>lborel = ennreal (1 / real ((n + r + 1)\<^sup>2 * (n + s + 1)) + 1 / real ((n + r + 1) * (n + s + 1)\<^sup>2))
[PROOF STEP]
have "\<dots> = ennreal (1 / ((k+s+1) * (k+r+1)^2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ennreal (1 / real (k + s + 1)) * (\<integral>\<^sup>+x\<in>{0<..<1}. ennreal (- ln x * x ^ (k + r))\<partial>lborel) = ennreal (1 / real ((k + s + 1) * (k + r + 1)\<^sup>2))
[PROOF STEP]
by (subst nn_integral_0_1_ln_times_power, subst ennreal_mult [symmetric]) (auto simp: algebra_simps)
[PROOF STATE]
proof (state)
this:
ennreal (1 / real (k + s + 1)) * (\<integral>\<^sup>+x\<in>{0<..<1}. ennreal (- ln x * x ^ (k + r))\<partial>lborel) = ennreal (1 / real ((k + s + 1) * (k + r + 1)\<^sup>2))

goal (1 subgoal):
 1. \<And>n. \<integral>\<^sup>+x\<in>{0<..<1} \<times> {0<..<1}. (case x of (x, y) \<Rightarrow> ennreal (- ln (x * y) * x ^ (n + r) * y ^ (n + s)))\<partial>lborel = ennreal (1 / real ((n + r + 1)\<^sup>2 * (n + s + 1)) + 1 / real ((n + r + 1) * (n + s + 1)\<^sup>2))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ennreal (1 / real (k + s + 1)) * (\<integral>\<^sup>+x\<in>{0<..<1}. ennreal (- ln x * x ^ (k + r))\<partial>lborel) = ennreal (1 / real ((k + s + 1) * (k + r + 1)\<^sup>2))

goal (1 subgoal):
 1. \<And>n. \<integral>\<^sup>+x\<in>{0<..<1} \<times> {0<..<1}. (case x of (x, y) \<Rightarrow> ennreal (- ln (x * y) * x ^ (n + r) * y ^ (n + s)))\<partial>lborel = ennreal (1 / real ((n + r + 1)\<^sup>2 * (n + s + 1)) + 1 / real ((n + r + 1) * (n + s + 1)\<^sup>2))
[PROOF STEP]
have "(\<integral>\<^sup>+x\<in>{0<..<1}. ennreal (x^(k+r)/(k+s+1)^2) \<partial>lborel) =
                  ennreal (1/(k+s+1)^2) * (\<integral>\<^sup>+x\<in>{0<..<1}. ennreal (x^(k+r)) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>{0<..<1}. ennreal (x ^ (k + r) / real ((k + s + 1)\<^sup>2))\<partial>lborel = ennreal (1 / real ((k + s + 1)\<^sup>2)) * (\<integral>\<^sup>+x\<in>{0<..<1}. ennreal (x ^ (k + r))\<partial>lborel)
[PROOF STEP]
by (subst nn_integral_cmult [symmetric])
         (auto intro!: nn_integral_cong simp: indicator_def simp flip: ennreal_mult')
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>{0<..<1}. ennreal (x ^ (k + r) / real ((k + s + 1)\<^sup>2))\<partial>lborel = ennreal (1 / real ((k + s + 1)\<^sup>2)) * (\<integral>\<^sup>+x\<in>{0<..<1}. ennreal (x ^ (k + r))\<partial>lborel)

goal (1 subgoal):
 1. \<And>n. \<integral>\<^sup>+x\<in>{0<..<1} \<times> {0<..<1}. (case x of (x, y) \<Rightarrow> ennreal (- ln (x * y) * x ^ (n + r) * y ^ (n + s)))\<partial>lborel = ennreal (1 / real ((n + r + 1)\<^sup>2 * (n + s + 1)) + 1 / real ((n + r + 1) * (n + s + 1)\<^sup>2))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>{0<..<1}. ennreal (x ^ (k + r) / real ((k + s + 1)\<^sup>2))\<partial>lborel = ennreal (1 / real ((k + s + 1)\<^sup>2)) * (\<integral>\<^sup>+x\<in>{0<..<1}. ennreal (x ^ (k + r))\<partial>lborel)

goal (1 subgoal):
 1. \<And>n. \<integral>\<^sup>+x\<in>{0<..<1} \<times> {0<..<1}. (case x of (x, y) \<Rightarrow> ennreal (- ln (x * y) * x ^ (n + r) * y ^ (n + s)))\<partial>lborel = ennreal (1 / real ((n + r + 1)\<^sup>2 * (n + s + 1)) + 1 / real ((n + r + 1) * (n + s + 1)\<^sup>2))
[PROOF STEP]
have "\<dots> = ennreal (1/((k+r+1)*(k+s+1)^2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ennreal (1 / real ((k + s + 1)\<^sup>2)) * (\<integral>\<^sup>+x\<in>{0<..<1}. ennreal (x ^ (k + r))\<partial>lborel) = ennreal (1 / real ((k + r + 1) * (k + s + 1)\<^sup>2))
[PROOF STEP]
by (subst nn_integral_0_1_power, subst ennreal_mult [symmetric]) (auto simp: algebra_simps)
[PROOF STATE]
proof (state)
this:
ennreal (1 / real ((k + s + 1)\<^sup>2)) * (\<integral>\<^sup>+x\<in>{0<..<1}. ennreal (x ^ (k + r))\<partial>lborel) = ennreal (1 / real ((k + r + 1) * (k + s + 1)\<^sup>2))

goal (1 subgoal):
 1. \<And>n. \<integral>\<^sup>+x\<in>{0<..<1} \<times> {0<..<1}. (case x of (x, y) \<Rightarrow> ennreal (- ln (x * y) * x ^ (n + r) * y ^ (n + s)))\<partial>lborel = ennreal (1 / real ((n + r + 1)\<^sup>2 * (n + s + 1)) + 1 / real ((n + r + 1) * (n + s + 1)\<^sup>2))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ennreal (1 / real ((k + s + 1)\<^sup>2)) * (\<integral>\<^sup>+x\<in>{0<..<1}. ennreal (x ^ (k + r))\<partial>lborel) = ennreal (1 / real ((k + r + 1) * (k + s + 1)\<^sup>2))

goal (1 subgoal):
 1. \<And>n. \<integral>\<^sup>+x\<in>{0<..<1} \<times> {0<..<1}. (case x of (x, y) \<Rightarrow> ennreal (- ln (x * y) * x ^ (n + r) * y ^ (n + s)))\<partial>lborel = ennreal (1 / real ((n + r + 1)\<^sup>2 * (n + s + 1)) + 1 / real ((n + r + 1) * (n + s + 1)\<^sup>2))
[PROOF STEP]
have "ennreal (1 / ((k+s+1) * (k+r+1)^2)) + \<dots> =
                 ennreal (1/((k+r+1)^2*(k+s+1)) + 1/((k+r+1)*(k+s+1)^2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ennreal (1 / real ((k + s + 1) * (k + r + 1)\<^sup>2)) + ennreal (1 / real ((k + r + 1) * (k + s + 1)\<^sup>2)) = ennreal (1 / real ((k + r + 1)\<^sup>2 * (k + s + 1)) + 1 / real ((k + r + 1) * (k + s + 1)\<^sup>2))
[PROOF STEP]
by (subst ennreal_plus [symmetric]) (auto simp: algebra_simps)
[PROOF STATE]
proof (state)
this:
ennreal (1 / real ((k + s + 1) * (k + r + 1)\<^sup>2)) + ennreal (1 / real ((k + r + 1) * (k + s + 1)\<^sup>2)) = ennreal (1 / real ((k + r + 1)\<^sup>2 * (k + s + 1)) + 1 / real ((k + r + 1) * (k + s + 1)\<^sup>2))

goal (1 subgoal):
 1. \<And>n. \<integral>\<^sup>+x\<in>{0<..<1} \<times> {0<..<1}. (case x of (x, y) \<Rightarrow> ennreal (- ln (x * y) * x ^ (n + r) * y ^ (n + s)))\<partial>lborel = ennreal (1 / real ((n + r + 1)\<^sup>2 * (n + s + 1)) + 1 / real ((n + r + 1) * (n + s + 1)\<^sup>2))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<integral>\<^sup>+x\<in>{0<..<1} \<times> {0<..<1}. (case x of (x, y) \<Rightarrow> ennreal (- ln (x * y) * x ^ (k + r) * y ^ (k + s)))\<partial>lborel = ennreal (1 / real ((k + r + 1)\<^sup>2 * (k + s + 1)) + 1 / real ((k + r + 1) * (k + s + 1)\<^sup>2))
[PROOF STEP]
show "(\<integral>\<^sup>+(x,y)\<in>{0<..<1}\<times>{0<..<1}. ennreal (-ln (x*y) * x^(k+r) * y^(k+s)) \<partial>lborel) = \<dots>"
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+x\<in>{0<..<1} \<times> {0<..<1}. (case x of (x, y) \<Rightarrow> ennreal (- ln (x * y) * x ^ (k + r) * y ^ (k + s)))\<partial>lborel = ennreal (1 / real ((k + r + 1)\<^sup>2 * (k + s + 1)) + 1 / real ((k + r + 1) * (k + s + 1)\<^sup>2))

goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>{0<..<1} \<times> {0<..<1}. (case x of (x, y) \<Rightarrow> ennreal (- ln (x * y) * x ^ (k + r) * y ^ (k + s)))\<partial>lborel = ennreal (1 / real ((k + r + 1)\<^sup>2 * (k + s + 1)) + 1 / real ((k + r + 1) * (k + s + 1)\<^sup>2))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>{0<..<1} \<times> {0<..<1}. (case x of (x, y) \<Rightarrow> ennreal (- ln (x * y) * x ^ (k + r) * y ^ (k + s)))\<partial>lborel = ennreal (1 / real ((k + r + 1)\<^sup>2 * (k + s + 1)) + 1 / real ((k + r + 1) * (k + s + 1)\<^sup>2))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>k. \<integral>\<^sup>+x\<in>{0<..<1} \<times> {0<..<1}. (case x of (x, y) \<Rightarrow> ennreal (- ln (x * y) * x ^ (k + r) * y ^ (k + s)))\<partial>lborel) = (\<Sum>k. ennreal (1 / real ((k + r + 1)\<^sup>2 * (k + s + 1)) + 1 / real ((k + r + 1) * (k + s + 1)\<^sup>2)))

goal (1 subgoal):
 1. beukers_nn_integral1 r s = (\<Sum>k. ennreal (1 / real ((k + r + 1)\<^sup>2 * (k + s + 1)) + 1 / real ((k + r + 1) * (k + s + 1)\<^sup>2)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
beukers_nn_integral1 r s = (\<Sum>k. ennreal (1 / real ((k + r + 1)\<^sup>2 * (k + s + 1)) + 1 / real ((k + r + 1) * (k + s + 1)\<^sup>2)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
beukers_nn_integral1 r s = (\<Sum>k. ennreal (1 / real ((k + r + 1)\<^sup>2 * (k + s + 1)) + 1 / real ((k + r + 1) * (k + s + 1)\<^sup>2)))

goal (1 subgoal):
 1. beukers_nn_integral1 r s = (\<Sum>k. ennreal (1 / real ((k + r + 1)\<^sup>2 * (k + s + 1)) + 1 / real ((k + r + 1) * (k + s + 1)\<^sup>2)))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
beukers_nn_integral1 r s = (\<Sum>k. ennreal (1 / real ((k + r + 1)\<^sup>2 * (k + s + 1)) + 1 / real ((k + r + 1) * (k + s + 1)\<^sup>2)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma poly_roots_smult [simp]: "c \<noteq> 0 \<Longrightarrow> poly_roots (Polynomial.smult c p) = poly_roots p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<noteq> (0::'a) \<Longrightarrow> poly_roots (Polynomial.smult c p) = poly_roots p
[PROOF STEP]
by (intro multiset_eqI) (auto simp: count_poly_roots' order_smult)


[STATEMENT]
lemma st_neg_1 [simp]: "st (- 1) = - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. st (- 1) = - 1
[PROOF STEP]
by (simp add: st_SReal_eq)


[STATEMENT]
lemma approx_closed_set_with_set_zero_measure_boundary:
  assumes "closed S" "epsilon > 0" "S \<noteq> {}"
  shows "\<exists>r. r < epsilon \<and> r > 0 \<and> measure M {x. infdist x S = r} = 0 \<and> measure M {x. infdist x S \<le> r} < measure M S + epsilon"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>r<epsilon. 0 < r \<and> Sigma_Algebra.measure M {x. infdist x S = r} = 0 \<and> Sigma_Algebra.measure M {x. infdist x S \<le> r} < Sigma_Algebra.measure M S + epsilon
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>r<epsilon. 0 < r \<and> Sigma_Algebra.measure M {x. infdist x S = r} = 0 \<and> Sigma_Algebra.measure M {x. infdist x S \<le> r} < Sigma_Algebra.measure M S + epsilon
[PROOF STEP]
have [measurable]: "S \<in> sets M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<in> sets M
[PROOF STEP]
using \<open>closed S\<close>
[PROOF STATE]
proof (prove)
using this:
closed S

goal (1 subgoal):
 1. S \<in> sets M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
S \<in> sets M

goal (1 subgoal):
 1. \<exists>r<epsilon. 0 < r \<and> Sigma_Algebra.measure M {x. infdist x S = r} = 0 \<and> Sigma_Algebra.measure M {x. infdist x S \<le> r} < Sigma_Algebra.measure M S + epsilon
[PROOF STEP]
define T where "T = (\<lambda>r. {x. infdist x S \<le> r})"
[PROOF STATE]
proof (state)
this:
T = (\<lambda>r. {x. infdist x S \<le> r})

goal (1 subgoal):
 1. \<exists>r<epsilon. 0 < r \<and> Sigma_Algebra.measure M {x. infdist x S = r} = 0 \<and> Sigma_Algebra.measure M {x. infdist x S \<le> r} < Sigma_Algebra.measure M S + epsilon
[PROOF STEP]
have [measurable]: "T r \<in> sets borel" for r
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T r \<in> sets borel
[PROOF STEP]
unfolding T_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. infdist x S \<le> r} \<in> sets borel
[PROOF STEP]
by measurable
[PROOF STATE]
proof (state)
this:
T ?r \<in> sets borel

goal (1 subgoal):
 1. \<exists>r<epsilon. 0 < r \<and> Sigma_Algebra.measure M {x. infdist x S = r} = 0 \<and> Sigma_Algebra.measure M {x. infdist x S \<le> r} < Sigma_Algebra.measure M S + epsilon
[PROOF STEP]
have *: "(\<Inter>n. T ((1/2)^n)) = S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Inter>n. T ((1 / 2) ^ n)) = S
[PROOF STEP]
unfolding T_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Inter>n. {x. infdist x S \<le> (1 / 2) ^ n}) = S
[PROOF STEP]
proof (auto)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<forall>xa. infdist x S \<le> (1 / 2) ^ xa \<Longrightarrow> x \<in> S
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<forall>xa. infdist x S \<le> (1 / 2) ^ xa \<Longrightarrow> x \<in> S
[PROOF STEP]
assume *: "\<forall>n. infdist x S \<le> (1 / 2) ^n"
[PROOF STATE]
proof (state)
this:
\<forall>n. infdist x S \<le> (1 / 2) ^ n

goal (1 subgoal):
 1. \<And>x. \<forall>xa. infdist x S \<le> (1 / 2) ^ xa \<Longrightarrow> x \<in> S
[PROOF STEP]
have "infdist x S \<le> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infdist x S \<le> 0
[PROOF STEP]
apply (rule LIMSEQ_le_const[of "\<lambda>n. (1/2)^n"], intro tendsto_intros)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. norm (1 / 2) < 1
 2. \<exists>N. \<forall>n\<ge>N. infdist x S \<le> (1 / 2) ^ n
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
\<forall>n. infdist x S \<le> (1 / 2) ^ n

goal (2 subgoals):
 1. norm (1 / 2) < 1
 2. \<exists>N. \<forall>n\<ge>N. infdist x S \<le> (1 / 2) ^ n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
infdist x S \<le> 0

goal (1 subgoal):
 1. \<And>x. \<forall>xa. infdist x S \<le> (1 / 2) ^ xa \<Longrightarrow> x \<in> S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
infdist x S \<le> 0
[PROOF STEP]
show "x \<in> S"
[PROOF STATE]
proof (prove)
using this:
infdist x S \<le> 0

goal (1 subgoal):
 1. x \<in> S
[PROOF STEP]
using assms infdist_pos_not_in_closed
[PROOF STATE]
proof (prove)
using this:
infdist x S \<le> 0
closed S
0 < epsilon
S \<noteq> {}
\<lbrakk>closed ?S; ?S \<noteq> {}; ?x \<notin> ?S\<rbrakk> \<Longrightarrow> 0 < infdist ?x ?S

goal (1 subgoal):
 1. x \<in> S
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
x \<in> S

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Inter>n. T ((1 / 2) ^ n)) = S

goal (1 subgoal):
 1. \<exists>r<epsilon. 0 < r \<and> Sigma_Algebra.measure M {x. infdist x S = r} = 0 \<and> Sigma_Algebra.measure M {x. infdist x S \<le> r} < Sigma_Algebra.measure M S + epsilon
[PROOF STEP]
have A: "((1::real)/2)^n \<le> (1/2)^m" if "m \<le> n" for m n::nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 / 2) ^ n \<le> (1 / 2) ^ m
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
m \<le> n

goal (1 subgoal):
 1. (1 / 2) ^ n \<le> (1 / 2) ^ m
[PROOF STEP]
by (simp add: power_decreasing)
[PROOF STATE]
proof (state)
this:
?m \<le> ?n \<Longrightarrow> (1 / 2) ^ ?n \<le> (1 / 2) ^ ?m

goal (1 subgoal):
 1. \<exists>r<epsilon. 0 < r \<and> Sigma_Algebra.measure M {x. infdist x S = r} = 0 \<and> Sigma_Algebra.measure M {x. infdist x S \<le> r} < Sigma_Algebra.measure M S + epsilon
[PROOF STEP]
have "(\<lambda>n. measure M (T ((1/2)^n))) \<longlonglongrightarrow> measure M S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. Sigma_Algebra.measure M (T ((1 / 2) ^ n))) \<longlonglongrightarrow> Sigma_Algebra.measure M S
[PROOF STEP]
unfolding *[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. Sigma_Algebra.measure M (T ((1 / 2) ^ n))) \<longlonglongrightarrow> Sigma_Algebra.measure M (\<Inter>n. T ((1 / 2) ^ n))
[PROOF STEP]
apply (rule finite_Lim_measure_decseq, auto simp add: T_def decseq_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m n x. \<lbrakk>m \<le> n; infdist x S \<le> (1 / 2) ^ n\<rbrakk> \<Longrightarrow> infdist x S \<le> (1 / 2) ^ m
[PROOF STEP]
using A order.trans
[PROOF STATE]
proof (prove)
using this:
?m \<le> ?n \<Longrightarrow> (1 / 2) ^ ?n \<le> (1 / 2) ^ ?m
\<lbrakk>?a \<le> ?b; ?b \<le> ?c\<rbrakk> \<Longrightarrow> ?a \<le> ?c

goal (1 subgoal):
 1. \<And>m n x. \<lbrakk>m \<le> n; infdist x S \<le> (1 / 2) ^ n\<rbrakk> \<Longrightarrow> infdist x S \<le> (1 / 2) ^ m
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<lambda>n. Sigma_Algebra.measure M (T ((1 / 2) ^ n))) \<longlonglongrightarrow> Sigma_Algebra.measure M S

goal (1 subgoal):
 1. \<exists>r<epsilon. 0 < r \<and> Sigma_Algebra.measure M {x. infdist x S = r} = 0 \<and> Sigma_Algebra.measure M {x. infdist x S \<le> r} < Sigma_Algebra.measure M S + epsilon
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. Sigma_Algebra.measure M (T ((1 / 2) ^ n))) \<longlonglongrightarrow> Sigma_Algebra.measure M S
[PROOF STEP]
have B: "eventually (\<lambda>n. measure M (T ((1/2)^n)) < measure M S + epsilon) sequentially"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. Sigma_Algebra.measure M (T ((1 / 2) ^ n))) \<longlonglongrightarrow> Sigma_Algebra.measure M S

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. Sigma_Algebra.measure M (T ((1 / 2) ^ n)) < Sigma_Algebra.measure M S + epsilon
[PROOF STEP]
apply (rule order_tendstoD)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sigma_Algebra.measure M S < Sigma_Algebra.measure M S + epsilon
[PROOF STEP]
using \<open>epsilon > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < epsilon

goal (1 subgoal):
 1. Sigma_Algebra.measure M S < Sigma_Algebra.measure M S + epsilon
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. Sigma_Algebra.measure M (T ((1 / 2) ^ n)) < Sigma_Algebra.measure M S + epsilon

goal (1 subgoal):
 1. \<exists>r<epsilon. 0 < r \<and> Sigma_Algebra.measure M {x. infdist x S = r} = 0 \<and> Sigma_Algebra.measure M {x. infdist x S \<le> r} < Sigma_Algebra.measure M S + epsilon
[PROOF STEP]
have C: "eventually (\<lambda>n. (1/2)^n < epsilon) sequentially"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. (1 / 2) ^ n < epsilon
[PROOF STEP]
by (rule order_tendstoD[OF _ \<open>epsilon > 0\<close>], intro tendsto_intros, auto)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. (1 / 2) ^ n < epsilon

goal (1 subgoal):
 1. \<exists>r<epsilon. 0 < r \<and> Sigma_Algebra.measure M {x. infdist x S = r} = 0 \<and> Sigma_Algebra.measure M {x. infdist x S \<le> r} < Sigma_Algebra.measure M S + epsilon
[PROOF STEP]
obtain n where n: "(1/2)^n < epsilon" "measure M (T ((1/2)^n)) < measure M S + epsilon"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>n. \<lbrakk>(1 / 2) ^ n < epsilon; Sigma_Algebra.measure M (T ((1 / 2) ^ n)) < Sigma_Algebra.measure M S + epsilon\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using eventually_conj[OF B C]
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in sequentially. Sigma_Algebra.measure M (T ((1 / 2) ^ x)) < Sigma_Algebra.measure M S + epsilon \<and> (1 / 2) ^ x < epsilon

goal (1 subgoal):
 1. (\<And>n. \<lbrakk>(1 / 2) ^ n < epsilon; Sigma_Algebra.measure M (T ((1 / 2) ^ n)) < Sigma_Algebra.measure M S + epsilon\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding eventually_sequentially
[PROOF STATE]
proof (prove)
using this:
\<exists>N. \<forall>n\<ge>N. Sigma_Algebra.measure M (T ((1 / 2) ^ n)) < Sigma_Algebra.measure M S + epsilon \<and> (1 / 2) ^ n < epsilon

goal (1 subgoal):
 1. (\<And>n. \<lbrakk>(1 / 2) ^ n < epsilon; Sigma_Algebra.measure M (T ((1 / 2) ^ n)) < Sigma_Algebra.measure M S + epsilon\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(1 / 2) ^ n < epsilon
Sigma_Algebra.measure M (T ((1 / 2) ^ n)) < Sigma_Algebra.measure M S + epsilon

goal (1 subgoal):
 1. \<exists>r<epsilon. 0 < r \<and> Sigma_Algebra.measure M {x. infdist x S = r} = 0 \<and> Sigma_Algebra.measure M {x. infdist x S \<le> r} < Sigma_Algebra.measure M S + epsilon
[PROOF STEP]
have "\<exists>r\<in>{0<..<(1/2)^n}. measure M {x. infdist x S = r} = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>r\<in>{0<..<(1 / 2) ^ n}. Sigma_Algebra.measure M {x. infdist x S = r} = 0
[PROOF STEP]
apply (rule uncountable_disjoint_family_then_exists_zero_measure, auto simp add: disjoint_family_on_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable {0<..<(1 / 2) ^ n} \<Longrightarrow> False
[PROOF STEP]
using uncountable_open_interval
[PROOF STATE]
proof (prove)
using this:
uncountable {?a<..<?b} = (?a < ?b)

goal (1 subgoal):
 1. countable {0<..<(1 / 2) ^ n} \<Longrightarrow> False
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<exists>r\<in>{0<..<(1 / 2) ^ n}. Sigma_Algebra.measure M {x. infdist x S = r} = 0

goal (1 subgoal):
 1. \<exists>r<epsilon. 0 < r \<and> Sigma_Algebra.measure M {x. infdist x S = r} = 0 \<and> Sigma_Algebra.measure M {x. infdist x S \<le> r} < Sigma_Algebra.measure M S + epsilon
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>r\<in>{0<..<(1 / 2) ^ n}. Sigma_Algebra.measure M {x. infdist x S = r} = 0
[PROOF STEP]
obtain r where r: "r\<in>{0<..<(1/2)^n}" "measure M {x. infdist x S = r} = 0"
[PROOF STATE]
proof (prove)
using this:
\<exists>r\<in>{0<..<(1 / 2) ^ n}. Sigma_Algebra.measure M {x. infdist x S = r} = 0

goal (1 subgoal):
 1. (\<And>r. \<lbrakk>r \<in> {0<..<(1 / 2) ^ n}; Sigma_Algebra.measure M {x. infdist x S = r} = 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
r \<in> {0<..<(1 / 2) ^ n}
Sigma_Algebra.measure M {x. infdist x S = r} = 0

goal (1 subgoal):
 1. \<exists>r<epsilon. 0 < r \<and> Sigma_Algebra.measure M {x. infdist x S = r} = 0 \<and> Sigma_Algebra.measure M {x. infdist x S \<le> r} < Sigma_Algebra.measure M S + epsilon
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
r \<in> {0<..<(1 / 2) ^ n}
Sigma_Algebra.measure M {x. infdist x S = r} = 0
[PROOF STEP]
have r2: "r > 0" "r < epsilon"
[PROOF STATE]
proof (prove)
using this:
r \<in> {0<..<(1 / 2) ^ n}
Sigma_Algebra.measure M {x. infdist x S = r} = 0

goal (1 subgoal):
 1. 0 < r &&& r < epsilon
[PROOF STEP]
using n
[PROOF STATE]
proof (prove)
using this:
r \<in> {0<..<(1 / 2) ^ n}
Sigma_Algebra.measure M {x. infdist x S = r} = 0
(1 / 2) ^ n < epsilon
Sigma_Algebra.measure M (T ((1 / 2) ^ n)) < Sigma_Algebra.measure M S + epsilon

goal (1 subgoal):
 1. 0 < r &&& r < epsilon
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < r
r < epsilon

goal (1 subgoal):
 1. \<exists>r<epsilon. 0 < r \<and> Sigma_Algebra.measure M {x. infdist x S = r} = 0 \<and> Sigma_Algebra.measure M {x. infdist x S \<le> r} < Sigma_Algebra.measure M S + epsilon
[PROOF STEP]
have "measure M {x. infdist x S \<le> r} \<le> measure M {x. infdist x S \<le> (1/2)^n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sigma_Algebra.measure M {x. infdist x S \<le> r} \<le> Sigma_Algebra.measure M {x. infdist x S \<le> (1 / 2) ^ n}
[PROOF STEP]
apply (rule finite_measure_mono)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. {x. infdist x S \<le> r} \<subseteq> {x. infdist x S \<le> (1 / 2) ^ n}
 2. {x. infdist x S \<le> (1 / 2) ^ n} \<in> sets M
[PROOF STEP]
using r
[PROOF STATE]
proof (prove)
using this:
r \<in> {0<..<(1 / 2) ^ n}
Sigma_Algebra.measure M {x. infdist x S = r} = 0

goal (2 subgoals):
 1. {x. infdist x S \<le> r} \<subseteq> {x. infdist x S \<le> (1 / 2) ^ n}
 2. {x. infdist x S \<le> (1 / 2) ^ n} \<in> sets M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Sigma_Algebra.measure M {x. infdist x S \<le> r} \<le> Sigma_Algebra.measure M {x. infdist x S \<le> (1 / 2) ^ n}

goal (1 subgoal):
 1. \<exists>r<epsilon. 0 < r \<and> Sigma_Algebra.measure M {x. infdist x S = r} = 0 \<and> Sigma_Algebra.measure M {x. infdist x S \<le> r} < Sigma_Algebra.measure M S + epsilon
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Sigma_Algebra.measure M {x. infdist x S \<le> r} \<le> Sigma_Algebra.measure M {x. infdist x S \<le> (1 / 2) ^ n}
[PROOF STEP]
have "measure M {x. infdist x S \<le> r} < measure M S + epsilon"
[PROOF STATE]
proof (prove)
using this:
Sigma_Algebra.measure M {x. infdist x S \<le> r} \<le> Sigma_Algebra.measure M {x. infdist x S \<le> (1 / 2) ^ n}

goal (1 subgoal):
 1. Sigma_Algebra.measure M {x. infdist x S \<le> r} < Sigma_Algebra.measure M S + epsilon
[PROOF STEP]
using n(2)
[PROOF STATE]
proof (prove)
using this:
Sigma_Algebra.measure M {x. infdist x S \<le> r} \<le> Sigma_Algebra.measure M {x. infdist x S \<le> (1 / 2) ^ n}
Sigma_Algebra.measure M (T ((1 / 2) ^ n)) < Sigma_Algebra.measure M S + epsilon

goal (1 subgoal):
 1. Sigma_Algebra.measure M {x. infdist x S \<le> r} < Sigma_Algebra.measure M S + epsilon
[PROOF STEP]
unfolding T_def
[PROOF STATE]
proof (prove)
using this:
Sigma_Algebra.measure M {x. infdist x S \<le> r} \<le> Sigma_Algebra.measure M {x. infdist x S \<le> (1 / 2) ^ n}
Sigma_Algebra.measure M {x. infdist x S \<le> (1 / 2) ^ n} < Sigma_Algebra.measure M S + epsilon

goal (1 subgoal):
 1. Sigma_Algebra.measure M {x. infdist x S \<le> r} < Sigma_Algebra.measure M S + epsilon
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Sigma_Algebra.measure M {x. infdist x S \<le> r} < Sigma_Algebra.measure M S + epsilon

goal (1 subgoal):
 1. \<exists>r<epsilon. 0 < r \<and> Sigma_Algebra.measure M {x. infdist x S = r} = 0 \<and> Sigma_Algebra.measure M {x. infdist x S \<le> r} < Sigma_Algebra.measure M S + epsilon
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Sigma_Algebra.measure M {x. infdist x S \<le> r} < Sigma_Algebra.measure M S + epsilon
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Sigma_Algebra.measure M {x. infdist x S \<le> r} < Sigma_Algebra.measure M S + epsilon

goal (1 subgoal):
 1. \<exists>r<epsilon. 0 < r \<and> Sigma_Algebra.measure M {x. infdist x S = r} = 0 \<and> Sigma_Algebra.measure M {x. infdist x S \<le> r} < Sigma_Algebra.measure M S + epsilon
[PROOF STEP]
using r(2) r2
[PROOF STATE]
proof (prove)
using this:
Sigma_Algebra.measure M {x. infdist x S \<le> r} < Sigma_Algebra.measure M S + epsilon
Sigma_Algebra.measure M {x. infdist x S = r} = 0
0 < r
r < epsilon

goal (1 subgoal):
 1. \<exists>r<epsilon. 0 < r \<and> Sigma_Algebra.measure M {x. infdist x S = r} = 0 \<and> Sigma_Algebra.measure M {x. infdist x S \<le> r} < Sigma_Algebra.measure M S + epsilon
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>r<epsilon. 0 < r \<and> Sigma_Algebra.measure M {x. infdist x S = r} = 0 \<and> Sigma_Algebra.measure M {x. infdist x S \<le> r} < Sigma_Algebra.measure M S + epsilon

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma midpoints_in_convex_hull:
  assumes "x \<in> convex hull s" "y \<in> convex hull s"
    shows "midpoint x y \<in> convex hull s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. midpoint x y \<in> convex hull s
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. midpoint x y \<in> convex hull s
[PROOF STEP]
have "(1 - inverse(2)) *\<^sub>R x + inverse(2) *\<^sub>R y \<in> convex hull s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 - inverse 2) *\<^sub>R x + y /\<^sub>R 2 \<in> convex hull s
[PROOF STEP]
by (rule convexD_alt) (use assms in auto)
[PROOF STATE]
proof (state)
this:
(1 - inverse 2) *\<^sub>R x + y /\<^sub>R 2 \<in> convex hull s

goal (1 subgoal):
 1. midpoint x y \<in> convex hull s
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(1 - inverse 2) *\<^sub>R x + y /\<^sub>R 2 \<in> convex hull s
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(1 - inverse 2) *\<^sub>R x + y /\<^sub>R 2 \<in> convex hull s

goal (1 subgoal):
 1. midpoint x y \<in> convex hull s
[PROOF STEP]
by (simp add: midpoint_def algebra_simps)
[PROOF STATE]
proof (state)
this:
midpoint x y \<in> convex hull s

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Fract_quot_of_fract [simp]: "Fract (fst (quot_of_fract x)) (snd (quot_of_fract x)) = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Fract (fst (quot_of_fract x)) (snd (quot_of_fract x)) = x
[PROOF STEP]
by transfer (simp del: fractrel_iff, subst fractrel_normalize_quot_left, simp)


[STATEMENT]
lemma group_semidirect_sum_ker_image:
  assumes "(g \<circ> f) \<in> iso G K" "f \<in> hom G H" "g \<in> hom H K" "group G" "group H" "group K"
  shows "(kernel H K g) \<inter> (f ` carrier G) = {\<one>\<^bsub>H\<^esub>}"
        "kernel H K g <#>\<^bsub>H\<^esub> (f ` carrier G) = carrier H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. kernel H K g \<inter> f ` carrier G = {\<one>\<^bsub>H\<^esub>} &&& kernel H K g <#>\<^bsub>H\<^esub> f ` carrier G = carrier H
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
g \<circ> f \<in> Group.iso G K
f \<in> hom G H
g \<in> hom H K
Group.group G
Group.group H
Group.group K

goal (1 subgoal):
 1. kernel H K g \<inter> f ` carrier G = {\<one>\<^bsub>H\<^esub>} &&& kernel H K g <#>\<^bsub>H\<^esub> f ` carrier G = carrier H
[PROOF STEP]
by (simp_all add: iso_iff_mon_epi group_Int_image_ker group_sum_ker_image epi_def mon_def Int_commute [of "kernel H K g"])


[STATEMENT]
lemma poly_fcompose_0_denominator:
  assumes "poly q2 x=0"
  shows "poly (fcompose p q1 q2) x = poly q1 x ^ degree p * lead_coeff p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (fcompose p q1 q2) x = poly q1 x ^ degree p * lead_coeff p
[PROOF STEP]
apply (induct p)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. poly (fcompose 0 q1 q2) x = poly q1 x ^ degree 0 * lead_coeff 0
 2. \<And>a p. \<lbrakk>a \<noteq> (0::'a) \<or> p \<noteq> 0; poly (fcompose p q1 q2) x = poly q1 x ^ degree p * lead_coeff p\<rbrakk> \<Longrightarrow> poly (fcompose (pCons a p) q1 q2) x = poly q1 x ^ degree (pCons a p) * lead_coeff (pCons a p)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
poly q2 x = (0::'a)

goal (2 subgoals):
 1. poly (fcompose 0 q1 q2) x = poly q1 x ^ degree 0 * lead_coeff 0
 2. \<And>a p. \<lbrakk>a \<noteq> (0::'a) \<or> p \<noteq> 0; poly (fcompose p q1 q2) x = poly q1 x ^ degree p * lead_coeff p\<rbrakk> \<Longrightarrow> poly (fcompose (pCons a p) q1 q2) x = poly q1 x ^ degree (pCons a p) * lead_coeff (pCons a p)
[PROOF STEP]
by (auto simp add:fcompose_pCons)


[STATEMENT]
lemma cart_product_singleton_right: "{#m \<in># (N \<times># {#b#}) . fst m \<in> snd m #} =
  ({# n \<in># N . n \<in> b #} \<times># {# b #})" (is "?A = ?B")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {#m \<in># N \<times># {#b#}. fst m \<in> snd m#} = {#n \<in># N. n \<in> b#} \<times># {#b#}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {#m \<in># N \<times># {#b#}. fst m \<in> snd m#} = {#n \<in># N. n \<in> b#} \<times># {#b#}
[PROOF STEP]
have stmt: "\<And>m. m \<in># (N \<times># {#b#}) \<Longrightarrow> fst m \<in> snd m \<longleftrightarrow> fst m \<in>b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m. m \<in># N \<times># {#b#} \<Longrightarrow> (fst m \<in> snd m) = (fst m \<in> b)
[PROOF STEP]
by (simp add: mem_Times_mset_iff)
[PROOF STATE]
proof (state)
this:
?m \<in># N \<times># {#b#} \<Longrightarrow> (fst ?m \<in> snd ?m) = (fst ?m \<in> b)

goal (1 subgoal):
 1. {#m \<in># N \<times># {#b#}. fst m \<in> snd m#} = {#n \<in># N. n \<in> b#} \<times># {#b#}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
?m \<in># N \<times># {#b#} \<Longrightarrow> (fst ?m \<in> snd ?m) = (fst ?m \<in> b)

goal (1 subgoal):
 1. {#m \<in># N \<times># {#b#}. fst m \<in> snd m#} = {#n \<in># N. n \<in> b#} \<times># {#b#}
[PROOF STEP]
by (metis (no_types, lifting) Sigma_mset_cong stmt cart_prod_singleton_right_gen)
[PROOF STATE]
proof (state)
this:
{#m \<in># N \<times># {#b#}. fst m \<in> snd m#} = {#n \<in># N. n \<in> b#} \<times># {#b#}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma blinfun_apply_eq_sum:
  assumes [simp]: "length v = CARD('n)"
  shows "blinfun_apply (B::(real^'n::enum)\<Rightarrow>\<^sub>L(real^'m::enum)) (eucl_of_list v) =
    (\<Sum>i<CARD('m). \<Sum>j<CARD('n). ((B (Basis_list ! j) \<bullet> Basis_list ! i) * v ! j) *\<^sub>R (Basis_list ! i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. blinfun_apply B (eucl_of_list v) = (\<Sum>i<CARD('m). \<Sum>j<CARD('n). (blinfun_apply B (Basis_list ! j) \<bullet> Basis_list ! i * v ! j) *\<^sub>R Basis_list ! i)
[PROOF STEP]
apply (subst blinfun_apply_componentwise[of B])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. blinfun_apply (\<Sum>i\<in>Basis. blinfun_scaleR (blinfun_inner_left i) (blinfun_apply B i)) (eucl_of_list v) = (\<Sum>i<CARD('m). \<Sum>j<CARD('n). (blinfun_apply B (Basis_list ! j) \<bullet> Basis_list ! i * v ! j) *\<^sub>R Basis_list ! i)
[PROOF STEP]
apply (auto intro!: euclidean_eqI[where 'a="(real,'m) vec"]
      simp: blinfun.bilinear_simps eucl_of_list_inner inner_sum_left inner_Basis if_distrib
        sum_Basis_sum_nth_Basis_list nth_eq_iff_index if_distribR
        cong: if_cong)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>b. b \<in> Basis \<Longrightarrow> (\<Sum>i<CARD('n). v ! i * (blinfun_apply B (Basis_list ! i) \<bullet> b)) = (\<Sum>i<CARD('m). \<Sum>j<CARD('n). if i = index Basis_list b then blinfun_apply B (Basis_list ! j) \<bullet> b * v ! j else 0)
[PROOF STEP]
apply (subst sum.swap)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>b. b \<in> Basis \<Longrightarrow> (\<Sum>i<CARD('n). v ! i * (blinfun_apply B (Basis_list ! i) \<bullet> b)) = (\<Sum>j<CARD('n). \<Sum>i<CARD('m). if i = index Basis_list b then blinfun_apply B (Basis_list ! j) \<bullet> b * v ! j else 0)
[PROOF STEP]
by (auto simp: sum.delta algebra_simps)


[STATEMENT]
lemma LIM_offset_zero_cancel: "(\<lambda>h. f (a + h)) \<midarrow>0\<rightarrow> L \<Longrightarrow> f \<midarrow>a\<rightarrow> L"
  for a :: "'a::real_normed_vector"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>h. f (a + h)) \<midarrow>0::'a\<rightarrow> L \<Longrightarrow> f \<midarrow>a\<rightarrow> L
[PROOF STEP]
by (drule LIM_offset [where k = "- a"]) simp


[STATEMENT]
lemma has_field_derivative_csqrt:
  assumes "z \<notin> \<real>\<^sub>\<le>\<^sub>0"
    shows "(csqrt has_field_derivative inverse(2 * csqrt z)) (at z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (csqrt has_field_derivative inverse (2 * csqrt z)) (at z)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (csqrt has_field_derivative inverse (2 * csqrt z)) (at z)
[PROOF STEP]
have z: "z \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<noteq> 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
z \<notin> \<real>\<^sub>\<le>\<^sub>0

goal (1 subgoal):
 1. z \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
z \<noteq> 0

goal (1 subgoal):
 1. (csqrt has_field_derivative inverse (2 * csqrt z)) (at z)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z \<noteq> 0
[PROOF STEP]
have *: "inverse z = inverse (2*z) * 2"
[PROOF STATE]
proof (prove)
using this:
z \<noteq> 0

goal (1 subgoal):
 1. inverse z = inverse (2 * z) * 2
[PROOF STEP]
by (simp add: field_split_simps)
[PROOF STATE]
proof (state)
this:
inverse z = inverse (2 * z) * 2

goal (1 subgoal):
 1. (csqrt has_field_derivative inverse (2 * csqrt z)) (at z)
[PROOF STEP]
have [simp]: "exp (Ln z / 2) * inverse z = inverse (csqrt z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp (Ln z / 2) * inverse z = inverse (csqrt z)
[PROOF STEP]
by (simp add: z field_simps csqrt_exp_Ln [symmetric]) (metis power2_csqrt power2_eq_square)
[PROOF STATE]
proof (state)
this:
exp (Ln z / 2) * inverse z = inverse (csqrt z)

goal (1 subgoal):
 1. (csqrt has_field_derivative inverse (2 * csqrt z)) (at z)
[PROOF STEP]
have "Im z = 0 \<Longrightarrow> 0 < Re z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Im z = 0 \<Longrightarrow> 0 < Re z
[PROOF STEP]
using assms complex_nonpos_Reals_iff not_less
[PROOF STATE]
proof (prove)
using this:
z \<notin> \<real>\<^sub>\<le>\<^sub>0
(?z \<in> \<real>\<^sub>\<le>\<^sub>0) = (Re ?z \<le> 0 \<and> Im ?z = 0)
(\<not> ?x < ?y) = (?y \<le> ?x)

goal (1 subgoal):
 1. Im z = 0 \<Longrightarrow> 0 < Re z
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Im z = 0 \<Longrightarrow> 0 < Re z

goal (1 subgoal):
 1. (csqrt has_field_derivative inverse (2 * csqrt z)) (at z)
[PROOF STEP]
with z
[PROOF STATE]
proof (chain)
picking this:
z \<noteq> 0
Im z = 0 \<Longrightarrow> 0 < Re z
[PROOF STEP]
have "((\<lambda>z. exp (Ln z / 2)) has_field_derivative inverse (2 * csqrt z)) (at z)"
[PROOF STATE]
proof (prove)
using this:
z \<noteq> 0
Im z = 0 \<Longrightarrow> 0 < Re z

goal (1 subgoal):
 1. ((\<lambda>z. exp (Ln z / 2)) has_field_derivative inverse (2 * csqrt z)) (at z)
[PROOF STEP]
by (force intro: derivative_eq_intros * simp add: assms)
[PROOF STATE]
proof (state)
this:
((\<lambda>z. exp (Ln z / 2)) has_field_derivative inverse (2 * csqrt z)) (at z)

goal (1 subgoal):
 1. (csqrt has_field_derivative inverse (2 * csqrt z)) (at z)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>z. exp (Ln z / 2)) has_field_derivative inverse (2 * csqrt z)) (at z)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>z. exp (Ln z / 2)) has_field_derivative inverse (2 * csqrt z)) (at z)

goal (1 subgoal):
 1. (csqrt has_field_derivative inverse (2 * csqrt z)) (at z)
[PROOF STEP]
proof (rule has_field_derivative_transform_within)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. 0 < ?d
 2. z \<in> UNIV
 3. \<And>x. \<lbrakk>x \<in> UNIV; dist x z < ?d\<rbrakk> \<Longrightarrow> exp (Ln x / 2) = csqrt x
[PROOF STEP]
show "\<And>x. dist x z < cmod z \<Longrightarrow> exp (Ln x / 2) = csqrt x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. dist x z < cmod z \<Longrightarrow> exp (Ln x / 2) = csqrt x
[PROOF STEP]
by (metis csqrt_exp_Ln dist_0_norm less_irrefl)
[PROOF STATE]
proof (state)
this:
dist ?x z < cmod z \<Longrightarrow> exp (Ln ?x / 2) = csqrt ?x

goal (2 subgoals):
 1. 0 < cmod z
 2. z \<in> UNIV
[PROOF STEP]
qed (use z in auto)
[PROOF STATE]
proof (state)
this:
(csqrt has_field_derivative inverse (2 * csqrt z)) (at z)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma degree_pderiv_le:
  shows   "degree (pderiv p) \<le> degree p - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (pderiv p) \<le> degree p - 1
[PROOF STEP]
by (rule degree_le, cases "degree p = 0") (auto simp: coeff_pderiv coeff_eq_0)


[STATEMENT]
lemma LIM_fun_gt_zero: "f \<midarrow>c\<rightarrow> l \<Longrightarrow> 0 < l \<Longrightarrow> \<exists>r. 0 < r \<and> (\<forall>x. x \<noteq> c \<and> \<bar>c - x\<bar> < r \<longrightarrow> 0 < f x)"
  for f :: "real \<Rightarrow> real"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<midarrow>c\<rightarrow> l; 0 < l\<rbrakk> \<Longrightarrow> \<exists>r>0. \<forall>x. x \<noteq> c \<and> \<bar>c - x\<bar> < r \<longrightarrow> 0 < f x
[PROOF STEP]
by (force simp: dest: LIM_D)


[STATEMENT]
lemma SEQ_suc: "SEQ n s = Some t \<Longrightarrow> SEQ (Suc n) s = NEXT t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SEQ n s = Some t \<Longrightarrow> SEQ (Suc n) s = NEXT t
[PROOF STEP]
apply (induction n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. SEQ 0 s = Some t \<Longrightarrow> SEQ (Suc 0) s = NEXT t
 2. \<And>n. \<lbrakk>SEQ n s = Some t \<Longrightarrow> SEQ (Suc n) s = NEXT t; SEQ (Suc n) s = Some t\<rbrakk> \<Longrightarrow> SEQ (Suc (Suc n)) s = NEXT t
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>SEQ n s = Some t \<Longrightarrow> SEQ (Suc n) s = NEXT t; SEQ (Suc n) s = Some t\<rbrakk> \<Longrightarrow> SEQ (Suc (Suc n)) s = NEXT t
[PROOF STEP]
by (simp add: option.case_eq_if)


[STATEMENT]
lemma sign_changes_replicate: "sign_changes (replicate n x) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sign_changes (replicate n x) = 0
[PROOF STEP]
by (simp add: sign_changes_def remdups_adj_replicate filter_replicate)


[STATEMENT]
lemma roots_of_real_alg:
  "p \<noteq> 0 \<Longrightarrow> real_of ` set (roots_of_real_alg p) = {x. ipoly p x = 0}"
  "distinct (map real_of (roots_of_real_alg p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (p \<noteq> 0 \<Longrightarrow> real_of ` set (roots_of_real_alg p) = {x. poly (real_of_int_poly p) x = 0}) &&& distinct (map real_of (roots_of_real_alg p))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. p \<noteq> 0 \<Longrightarrow> real_of ` set (roots_of_real_alg p) = {x. poly (real_of_int_poly p) x = 0}
 2. distinct (map real_of (roots_of_real_alg p))
[PROOF STEP]
show "p \<noteq> 0 \<Longrightarrow> real_of ` set (roots_of_real_alg p) = {x. ipoly p x = 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> real_of ` set (roots_of_real_alg p) = {x. poly (real_of_int_poly p) x = 0}
[PROOF STEP]
by (transfer', insert roots_of_3, auto)
[PROOF STATE]
proof (state)
this:
p \<noteq> 0 \<Longrightarrow> real_of ` set (roots_of_real_alg p) = {x. poly (real_of_int_poly p) x = 0}

goal (1 subgoal):
 1. distinct (map real_of (roots_of_real_alg p))
[PROOF STEP]
show "distinct (map real_of (roots_of_real_alg p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (map real_of (roots_of_real_alg p))
[PROOF STEP]
by (transfer, insert roots_of_3(2), auto)
[PROOF STATE]
proof (state)
this:
distinct (map real_of (roots_of_real_alg p))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma knights_path_min1: "knights_path (board n m) ps \<Longrightarrow> min1 ps = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. knights_path (board n m) ps \<Longrightarrow> min1 ps = 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. knights_path (board n m) ps \<Longrightarrow> min1 ps = 1
[PROOF STEP]
assume assms: "knights_path (board n m) ps"
[PROOF STATE]
proof (state)
this:
knights_path (board n m) ps

goal (1 subgoal):
 1. knights_path (board n m) ps \<Longrightarrow> min1 ps = 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
knights_path (board n m) ps
[PROOF STEP]
have "min n m \<ge> 1"
[PROOF STATE]
proof (prove)
using this:
knights_path (board n m) ps

goal (1 subgoal):
 1. 1 \<le> min n m
[PROOF STEP]
using knights_path_board_m_n_geq_1
[PROOF STATE]
proof (prove)
using this:
knights_path (board n m) ps
knights_path (board ?n ?m) ?ps \<Longrightarrow> 1 \<le> min ?n ?m

goal (1 subgoal):
 1. 1 \<le> min n m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 \<le> min n m

goal (1 subgoal):
 1. knights_path (board n m) ps \<Longrightarrow> min1 ps = 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 \<le> min n m
[PROOF STEP]
have "(1,1) \<in> board n m" and ge_1: "\<forall>(i,j) \<in> board n m. i \<ge> 1"
[PROOF STATE]
proof (prove)
using this:
1 \<le> min n m

goal (1 subgoal):
 1. (1, 1) \<in> board n m &&& \<forall>(i, j)\<in>board n m. 1 \<le> i
[PROOF STEP]
unfolding board_def
[PROOF STATE]
proof (prove)
using this:
1 \<le> min n m

goal (1 subgoal):
 1. (1, 1) \<in> {(i, j) |i j. 1 \<le> i \<and> i \<le> int n \<and> 1 \<le> j \<and> j \<le> int m} &&& \<forall>(i, j)\<in>{(i, j) |i j. 1 \<le> i \<and> i \<le> int n \<and> 1 \<le> j \<and> j \<le> int m}. 1 \<le> i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(1, 1) \<in> board n m
\<forall>(i, j)\<in>board n m. 1 \<le> i

goal (1 subgoal):
 1. knights_path (board n m) ps \<Longrightarrow> min1 ps = 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(1, 1) \<in> board n m
\<forall>(i, j)\<in>board n m. 1 \<le> i
[PROOF STEP]
have finite: "finite ((fst) ` board n m)" and
          non_empty: "(fst) ` board n m \<noteq> {}" and
          mem_1: "1 \<in> (fst) ` board n m"
[PROOF STATE]
proof (prove)
using this:
(1, 1) \<in> board n m
\<forall>(i, j)\<in>board n m. 1 \<le> i

goal (1 subgoal):
 1. finite (fst ` board n m) &&& fst ` board n m \<noteq> {} &&& 1 \<in> fst ` board n m
[PROOF STEP]
using board_finite
[PROOF STATE]
proof (prove)
using this:
(1, 1) \<in> board n m
\<forall>(i, j)\<in>board n m. 1 \<le> i
finite (board ?n ?m)

goal (1 subgoal):
 1. finite (fst ` board n m) &&& fst ` board n m \<noteq> {} &&& 1 \<in> fst ` board n m
[PROOF STEP]
by auto (metis fstI image_eqI)
[PROOF STATE]
proof (state)
this:
finite (fst ` board n m)
fst ` board n m \<noteq> {}
1 \<in> fst ` board n m

goal (1 subgoal):
 1. knights_path (board n m) ps \<Longrightarrow> min1 ps = 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite (fst ` board n m)
fst ` board n m \<noteq> {}
1 \<in> fst ` board n m
[PROOF STEP]
have "Min ((fst) ` board n m) = 1"
[PROOF STATE]
proof (prove)
using this:
finite (fst ` board n m)
fst ` board n m \<noteq> {}
1 \<in> fst ` board n m

goal (1 subgoal):
 1. Min (fst ` board n m) = 1
[PROOF STEP]
using ge_1
[PROOF STATE]
proof (prove)
using this:
finite (fst ` board n m)
fst ` board n m \<noteq> {}
1 \<in> fst ` board n m
\<forall>(i, j)\<in>board n m. 1 \<le> i

goal (1 subgoal):
 1. Min (fst ` board n m) = 1
[PROOF STEP]
by (auto simp: Min_eq_iff)
[PROOF STATE]
proof (state)
this:
Min (fst ` board n m) = 1

goal (1 subgoal):
 1. knights_path (board n m) ps \<Longrightarrow> min1 ps = 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Min (fst ` board n m) = 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Min (fst ` board n m) = 1

goal (1 subgoal):
 1. min1 ps = 1
[PROOF STEP]
using assms knights_path_set_eq
[PROOF STATE]
proof (prove)
using this:
Min (fst ` board n m) = 1
knights_path (board n m) ps
knights_path ?b ?ps \<Longrightarrow> set ?ps = ?b

goal (1 subgoal):
 1. min1 ps = 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
min1 ps = 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma xor_list_assoc [simp]:
  fixes xs ys :: "'a :: boolean_algebra list"
  shows "(xs [\<oplus>] ys) [\<oplus>] zs = xs [\<oplus>] (ys [\<oplus>] zs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (xs [\<oplus>] ys) [\<oplus>] zs = xs [\<oplus>] ys [\<oplus>] zs
[PROOF STEP]
unfolding xor_list_def zip_map1 zip_map2
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (\<lambda>(x, y). x \<oplus> y) (map2 (\<lambda>x. Pair (case x of (x, xa) \<Rightarrow> x \<oplus> xa)) (zip xs ys) zs) = map (\<lambda>(x, y). x \<oplus> y) (map2 (\<lambda>x y. (x, case y of (x, xa) \<Rightarrow> x \<oplus> xa)) xs (zip ys zs))
[PROOF STEP]
apply(subst (2) zip_commute)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (\<lambda>(x, y). x \<oplus> y) (map (\<lambda>(x, y). (case x of (x, xa) \<Rightarrow> x \<oplus> xa, y)) (map2 (\<lambda>x y. (y, x)) zs (zip xs ys))) = map (\<lambda>(x, y). x \<oplus> y) (map2 (\<lambda>x y. (x, case y of (x, xa) \<Rightarrow> x \<oplus> xa)) xs (zip ys zs))
[PROOF STEP]
apply(subst zip_left_commute)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (\<lambda>(x, y). x \<oplus> y) (map (\<lambda>(x, y). (case x of (x, xa) \<Rightarrow> x \<oplus> xa, y)) (map (\<lambda>(x, y). (y, x)) (map2 (\<lambda>y (x, z). (x, y, z)) xs (zip zs ys)))) = map (\<lambda>(x, y). x \<oplus> y) (map2 (\<lambda>x y. (x, case y of (x, xa) \<Rightarrow> x \<oplus> xa)) xs (zip ys zs))
[PROOF STEP]
apply(subst (2) zip_commute)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (\<lambda>(x, y). x \<oplus> y) (map (\<lambda>(x, y). (case x of (x, xa) \<Rightarrow> x \<oplus> xa, y)) (map (\<lambda>(x, y). (y, x)) (map2 (\<lambda>y (x, z). (x, y, z)) xs (map2 (\<lambda>x y. (y, x)) ys zs)))) = map (\<lambda>(x, y). x \<oplus> y) (map2 (\<lambda>x y. (x, case y of (x, xa) \<Rightarrow> x \<oplus> xa)) xs (zip ys zs))
[PROOF STEP]
apply(auto simp add: zip_map2 split_def xor_assoc)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma frac_le_eq:
  "y \<noteq> 0 \<Longrightarrow> z \<noteq> 0 \<Longrightarrow> x / y \<le> w / z \<longleftrightarrow> (x * z - w * y) / (y * z) \<le> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>y \<noteq> (0::'a); z \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> (x / y \<le> w / z) = ((x * z - w * y) / (y * z) \<le> (0::'a))
[PROOF STEP]
by (subst le_iff_diff_le_0) (simp add: diff_frac_eq )


[STATEMENT]
lemma isometry_vector_to_cblinfun[simp]:
  assumes "norm x = 1"
  shows "isometry (vector_to_cblinfun x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isometry (vector_to_cblinfun x)
[PROOF STEP]
using assms cnorm_eq_1 isometry_def
[PROOF STATE]
proof (prove)
using this:
norm x = 1
(norm ?x = 1) = (?x \<bullet>\<^sub>C ?x = 1)
isometry ?U = (?U* o\<^sub>C\<^sub>L ?U = id_cblinfun)

goal (1 subgoal):
 1. isometry (vector_to_cblinfun x)
[PROOF STEP]
by force


[STATEMENT]
lemma bezout_coefficients_left_0:
  "bezout_coefficients 0 a = (0, 1 div unit_factor a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bezout_coefficients (0::'a) a = (0::'a, (1::'a) div unit_factor a)
[PROOF STEP]
by (simp add: bezout_coefficients_def euclid_ext_aux.simps)


[STATEMENT]
lemma relation_mono:
  "\<lbrakk> A \<subseteq> C; B \<subseteq> D \<rbrakk> \<Longrightarrow> A \<times> B \<subseteq> C \<times> D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<subseteq> C; B \<subseteq> D\<rbrakk> \<Longrightarrow> A \<times> B \<subseteq> C \<times> D
[PROOF STEP]
by bestsimp


[STATEMENT]
lemma shufflesE:
  "zs \<in> shuffles xs ys \<Longrightarrow>
    (zs = xs \<Longrightarrow> ys = [] \<Longrightarrow> P) \<Longrightarrow>
    (zs = ys \<Longrightarrow> xs = [] \<Longrightarrow> P) \<Longrightarrow>
    (\<And>x xs' z zs'. xs = x # xs' \<Longrightarrow> zs = z # zs' \<Longrightarrow> x = z \<Longrightarrow> zs' \<in> shuffles xs' ys \<Longrightarrow> P) \<Longrightarrow>
    (\<And>y ys' z zs'. ys = y # ys' \<Longrightarrow> zs = z # zs' \<Longrightarrow> y = z \<Longrightarrow> zs' \<in> shuffles xs ys' \<Longrightarrow> P) \<Longrightarrow> P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>zs \<in> shuffles xs ys; \<lbrakk>zs = xs; ys = []\<rbrakk> \<Longrightarrow> P; \<lbrakk>zs = ys; xs = []\<rbrakk> \<Longrightarrow> P; \<And>x xs' z zs'. \<lbrakk>xs = x # xs'; zs = z # zs'; x = z; zs' \<in> shuffles xs' ys\<rbrakk> \<Longrightarrow> P; \<And>y ys' z zs'. \<lbrakk>ys = y # ys'; zs = z # zs'; y = z; zs' \<in> shuffles xs ys'\<rbrakk> \<Longrightarrow> P\<rbrakk> \<Longrightarrow> P
[PROOF STEP]
by (induct xs ys rule: shuffles.induct) auto


[STATEMENT]
lemma vimage_set_eq_at:
  "{b. \<exists>a\<in>\<^sub>\<circ>A \<inter>\<^sub>\<circ> \<D>\<^sub>\<circ> r. r\<lparr>a\<rparr> = b} = {b. \<exists>a\<in>\<^sub>\<circ>A. \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {b. \<exists>a\<in>elts (A \<inter>\<^sub>\<circ> \<D>\<^sub>\<circ> r). r\<lparr>a\<rparr> = b} = {b. \<exists>a\<in>elts A. \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r}
[PROOF STEP]
by (rule subset_antisym; rule subsetI; unfold mem_Collect_eq) auto


[STATEMENT]
lemma (in group) ord_min:
  assumes "m \<ge> 1" "x \<in> carrier G" "x [^] m = \<one>"
  shows   "ord x \<le> m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ord x \<le> m
[PROOF STEP]
using assms pow_eq_id
[PROOF STATE]
proof (prove)
using this:
1 \<le> m
x \<in> carrier G
x [^] m = \<one>
?x \<in> carrier G \<Longrightarrow> (?x [^] ?n = \<one>) = (ord ?x dvd ?n)

goal (1 subgoal):
 1. ord x \<le> m
[PROOF STEP]
by auto


[STATEMENT]
lemma NSsummable_NSCauchy:
  "NSsummable f \<longleftrightarrow> (\<forall>M \<in> HNatInfinite. \<forall>N \<in> HNatInfinite. \<bar>sumhr (M, N, f)\<bar> \<approx> 0)" (is "?L=?R")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. NSsummable f = (\<forall>M\<in>HNatInfinite. \<forall>N\<in>HNatInfinite. \<bar>sumhr (M, N, f)\<bar> \<approx> 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. NSsummable f = (\<forall>M\<in>HNatInfinite. \<forall>N\<in>HNatInfinite. \<bar>sumhr (M, N, f)\<bar> \<approx> 0)
[PROOF STEP]
have "?L = (\<forall>M\<in>HNatInfinite. \<forall>N\<in>HNatInfinite. sumhr (0, M, f) \<approx> sumhr (0, N, f))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. NSsummable f = (\<forall>M\<in>HNatInfinite. \<forall>N\<in>HNatInfinite. sumhr (0, M, f) \<approx> sumhr (0, N, f))
[PROOF STEP]
by (auto simp add: summable_iff_convergent convergent_NSconvergent_iff NSCauchy_def starfunNat_sumr
        simp flip: NSCauchy_NSconvergent_iff summable_NSsummable_iff atLeast0LessThan)
[PROOF STATE]
proof (state)
this:
NSsummable f = (\<forall>M\<in>HNatInfinite. \<forall>N\<in>HNatInfinite. sumhr (0, M, f) \<approx> sumhr (0, N, f))

goal (1 subgoal):
 1. NSsummable f = (\<forall>M\<in>HNatInfinite. \<forall>N\<in>HNatInfinite. \<bar>sumhr (M, N, f)\<bar> \<approx> 0)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
NSsummable f = (\<forall>M\<in>HNatInfinite. \<forall>N\<in>HNatInfinite. sumhr (0, M, f) \<approx> sumhr (0, N, f))

goal (1 subgoal):
 1. NSsummable f = (\<forall>M\<in>HNatInfinite. \<forall>N\<in>HNatInfinite. \<bar>sumhr (M, N, f)\<bar> \<approx> 0)
[PROOF STEP]
have "... \<longleftrightarrow> ?R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>M\<in>HNatInfinite. \<forall>N\<in>HNatInfinite. sumhr (0, M, f) \<approx> sumhr (0, N, f)) = (\<forall>M\<in>HNatInfinite. \<forall>N\<in>HNatInfinite. \<bar>sumhr (M, N, f)\<bar> \<approx> 0)
[PROOF STEP]
by (metis approx_hrabs_zero_cancel approx_minus_iff approx_refl approx_sym linorder_less_linear sumhr_hrabs_approx sumhr_split_diff)
[PROOF STATE]
proof (state)
this:
(\<forall>M\<in>HNatInfinite. \<forall>N\<in>HNatInfinite. sumhr (0, M, f) \<approx> sumhr (0, N, f)) = (\<forall>M\<in>HNatInfinite. \<forall>N\<in>HNatInfinite. \<bar>sumhr (M, N, f)\<bar> \<approx> 0)

goal (1 subgoal):
 1. NSsummable f = (\<forall>M\<in>HNatInfinite. \<forall>N\<in>HNatInfinite. \<bar>sumhr (M, N, f)\<bar> \<approx> 0)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
NSsummable f = (\<forall>M\<in>HNatInfinite. \<forall>N\<in>HNatInfinite. \<bar>sumhr (M, N, f)\<bar> \<approx> 0)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
NSsummable f = (\<forall>M\<in>HNatInfinite. \<forall>N\<in>HNatInfinite. \<bar>sumhr (M, N, f)\<bar> \<approx> 0)

goal (1 subgoal):
 1. NSsummable f = (\<forall>M\<in>HNatInfinite. \<forall>N\<in>HNatInfinite. \<bar>sumhr (M, N, f)\<bar> \<approx> 0)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
NSsummable f = (\<forall>M\<in>HNatInfinite. \<forall>N\<in>HNatInfinite. \<bar>sumhr (M, N, f)\<bar> \<approx> 0)

goal:
No subgoals!
[PROOF STEP]
qed