[STATEMENT]
lemma l2_when_right_child:
  assumes "l < l'"
  and i'_bot: "i' > i * 2^(l' - l)"
  and i'_top: "i' < (i + 1) * 2^(l' - l)"
  shows "l2_\<phi> (l', i') (l, i) = (1 - real_of_int i' / 2^(l' - l) + real_of_int i) / 2^(l' + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l2_\<phi> (l', i') (l, i) = (1 - real_of_int i' / 2 ^ (l' - l) + real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
proof (subst l2_\<phi>I_DERIV)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 - real_of_int i' / 2 ^ (l' - l) + real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
let ?l' = "(2 :: real)^(l' + 1)"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 - real_of_int i' / 2 ^ (l' - l) + real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
let ?in' = "real_of_int i' - 1"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 - real_of_int i' / 2 ^ (l' - l) + real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
let ?ip' = "real_of_int i' + 1"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 - real_of_int i' / 2 ^ (l' - l) + real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
let ?l = "(2 :: real)^(l + 1)"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 - real_of_int i' / 2 ^ (l' - l) + real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
let ?i = "real_of_int i + 1"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 - real_of_int i' / 2 ^ (l' - l) + real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
let ?\<phi>' = "\<phi> (l',i')"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 - real_of_int i' / 2 ^ (l' - l) + real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
let ?\<phi> = "\<phi> (l, i)"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 - real_of_int i' / 2 ^ (l' - l) + real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
let ?\<phi>2 = "\<lambda>x. ?\<phi>' x * ?\<phi> x"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 - real_of_int i' / 2 ^ (l' - l) + real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
define \<Phi>_n where "\<Phi>_n x = x^2 / 2 * (?in' * ?l + ?i * ?l') - x^3 / 3 * ?l' * ?l - x * ?i * ?in'" for x
[PROOF STATE]
proof (state)
this:
\<Phi>_n ?x = ?x\<^sup>2 / 2 * ((real_of_int i' - 1) * 2 ^ (l + 1) + (real_of_int i + 1) * 2 ^ (l' + 1)) - ?x ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) - ?x * (real_of_int i + 1) * (real_of_int i' - 1)

goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 - real_of_int i' / 2 ^ (l' - l) + real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
define \<Phi>_p where "\<Phi>_p x = x^3 / 3 * ?l' * ?l + x * ?i * ?ip' - x^2 / 2 * (?ip' * ?l + ?i * ?l')" for x
[PROOF STATE]
proof (state)
this:
\<Phi>_p ?x = ?x ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) + ?x * (real_of_int i + 1) * (real_of_int i' + 1) - ?x\<^sup>2 / 2 * ((real_of_int i' + 1) * 2 ^ (l + 1) + (real_of_int i + 1) * 2 ^ (l' + 1))

goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 - real_of_int i' / 2 ^ (l' - l) + real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
have level_diff: "2^(l' - l) = 2^l' / (2^l :: real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ (l' - l) = 2 ^ l' / 2 ^ l
[PROOF STEP]
using power_diff[of "2::real" l l'] \<open>l < l'\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>2 \<noteq> 0; l \<le> l'\<rbrakk> \<Longrightarrow> 2 ^ (l' - l) = 2 ^ l' / 2 ^ l
l < l'

goal (1 subgoal):
 1. 2 ^ (l' - l) = 2 ^ l' / 2 ^ l
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
2 ^ (l' - l) = 2 ^ l' / 2 ^ l

goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 - real_of_int i' / 2 ^ (l' - l) + real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
2 ^ (l' - l) = 2 ^ l' / 2 ^ l

goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 - real_of_int i' / 2 ^ (l' - l) + real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 - real_of_int i' / 2 ^ (l' - l) + real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
assume x: "x \<in> {?in' / ?l' .. ?ip' / ?l'}"
[PROOF STATE]
proof (state)
this:
x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)}

goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 - real_of_int i' / 2 ^ (l' - l) + real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
have "real_of_int i * 2^(l' - l) \<le> ?in'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int i * 2 ^ (l' - l) \<le> real_of_int i' - 1
[PROOF STEP]
using i'_bot int_less_real_le
[PROOF STATE]
proof (prove)
using this:
i * 2 ^ (l' - l) < i'
(?n < ?m) = (real_of_int ?n + 1 \<le> real_of_int ?m)

goal (1 subgoal):
 1. real_of_int i * 2 ^ (l' - l) \<le> real_of_int i' - 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real_of_int i * 2 ^ (l' - l) \<le> real_of_int i' - 1

goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 - real_of_int i' / 2 ^ (l' - l) + real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
hence "real_of_int i / ?l \<le> ?in' / ?l'"
[PROOF STATE]
proof (prove)
using this:
real_of_int i * 2 ^ (l' - l) \<le> real_of_int i' - 1

goal (1 subgoal):
 1. real_of_int i / 2 ^ (l + 1) \<le> (real_of_int i' - 1) / 2 ^ (l' + 1)
[PROOF STEP]
using level_diff
[PROOF STATE]
proof (prove)
using this:
real_of_int i * 2 ^ (l' - l) \<le> real_of_int i' - 1
2 ^ (l' - l) = 2 ^ l' / 2 ^ l

goal (1 subgoal):
 1. real_of_int i / 2 ^ (l + 1) \<le> (real_of_int i' - 1) / 2 ^ (l' + 1)
[PROOF STEP]
by (auto simp: field_simps)
[PROOF STATE]
proof (state)
this:
real_of_int i / 2 ^ (l + 1) \<le> (real_of_int i' - 1) / 2 ^ (l' + 1)

goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 - real_of_int i' / 2 ^ (l' - l) + real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
hence "real_of_int i / ?l \<le> x"
[PROOF STATE]
proof (prove)
using this:
real_of_int i / 2 ^ (l + 1) \<le> (real_of_int i' - 1) / 2 ^ (l' + 1)

goal (1 subgoal):
 1. real_of_int i / 2 ^ (l + 1) \<le> x
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
real_of_int i / 2 ^ (l + 1) \<le> (real_of_int i' - 1) / 2 ^ (l' + 1)
x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)}

goal (1 subgoal):
 1. real_of_int i / 2 ^ (l + 1) \<le> x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real_of_int i / 2 ^ (l + 1) \<le> x

goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 - real_of_int i' / 2 ^ (l' - l) + real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
real_of_int i / 2 ^ (l + 1) \<le> x

goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 - real_of_int i' / 2 ^ (l' - l) + real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
have "?ip' \<le> ?i * 2^(l' - l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int i' + 1 \<le> (real_of_int i + 1) * 2 ^ (l' - l)
[PROOF STEP]
using i'_top int_less_real_le
[PROOF STATE]
proof (prove)
using this:
i' < (i + 1) * 2 ^ (l' - l)
(?n < ?m) = (real_of_int ?n + 1 \<le> real_of_int ?m)

goal (1 subgoal):
 1. real_of_int i' + 1 \<le> (real_of_int i + 1) * 2 ^ (l' - l)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real_of_int i' + 1 \<le> (real_of_int i + 1) * 2 ^ (l' - l)

goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 - real_of_int i' / 2 ^ (l' - l) + real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
hence ip'_le_i: "?ip' / ?l' \<le> ?i / ?l"
[PROOF STATE]
proof (prove)
using this:
real_of_int i' + 1 \<le> (real_of_int i + 1) * 2 ^ (l' - l)

goal (1 subgoal):
 1. (real_of_int i' + 1) / 2 ^ (l' + 1) \<le> (real_of_int i + 1) / 2 ^ (l + 1)
[PROOF STEP]
using level_diff
[PROOF STATE]
proof (prove)
using this:
real_of_int i' + 1 \<le> (real_of_int i + 1) * 2 ^ (l' - l)
2 ^ (l' - l) = 2 ^ l' / 2 ^ l

goal (1 subgoal):
 1. (real_of_int i' + 1) / 2 ^ (l' + 1) \<le> (real_of_int i + 1) / 2 ^ (l + 1)
[PROOF STEP]
by (auto simp: field_simps)
[PROOF STATE]
proof (state)
this:
(real_of_int i' + 1) / 2 ^ (l' + 1) \<le> (real_of_int i + 1) / 2 ^ (l + 1)

goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 - real_of_int i' / 2 ^ (l' - l) + real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
hence "x \<le> ?i / ?l"
[PROOF STATE]
proof (prove)
using this:
(real_of_int i' + 1) / 2 ^ (l' + 1) \<le> (real_of_int i + 1) / 2 ^ (l + 1)

goal (1 subgoal):
 1. x \<le> (real_of_int i + 1) / 2 ^ (l + 1)
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
(real_of_int i' + 1) / 2 ^ (l' + 1) \<le> (real_of_int i + 1) / 2 ^ (l + 1)
x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)}

goal (1 subgoal):
 1. x \<le> (real_of_int i + 1) / 2 ^ (l + 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<le> (real_of_int i + 1) / 2 ^ (l + 1)

goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 - real_of_int i' / 2 ^ (l' - l) + real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
real_of_int i / 2 ^ (l + 1) \<le> x
x \<le> (real_of_int i + 1) / 2 ^ (l + 1)
[PROOF STEP]
have "?\<phi> x = ?i - ?l * x"
[PROOF STATE]
proof (prove)
using this:
real_of_int i / 2 ^ (l + 1) \<le> x
x \<le> (real_of_int i + 1) / 2 ^ (l + 1)

goal (1 subgoal):
 1. \<phi> (l, i) x = real_of_int i + 1 - 2 ^ (l + 1) * x
[PROOF STEP]
using \<phi>_right_support'
[PROOF STATE]
proof (prove)
using this:
real_of_int i / 2 ^ (l + 1) \<le> x
x \<le> (real_of_int i + 1) / 2 ^ (l + 1)
?x \<in> {real_of_int ?i / 2 ^ (?l + 1)..real_of_int (?i + 1) / 2 ^ (?l + 1)} \<Longrightarrow> \<phi> (?l, ?i) ?x = 1 - ?x * 2 ^ (?l + 1) + real_of_int ?i

goal (1 subgoal):
 1. \<phi> (l, i) x = real_of_int i + 1 - 2 ^ (l + 1) * x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<phi> (l, i) x = real_of_int i + 1 - 2 ^ (l + 1) * x

goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 - real_of_int i' / 2 ^ (l' - l) + real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?x2 \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> \<phi> (l, i) ?x2 = real_of_int i + 1 - 2 ^ (l + 1) * ?x2

goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 - real_of_int i' / 2 ^ (l' - l) + real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
note \<phi>_eq = this
[PROOF STATE]
proof (state)
this:
?x2 \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> \<phi> (l, i) ?x2 = real_of_int i + 1 - 2 ^ (l + 1) * ?x2

goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 - real_of_int i' / 2 ^ (l' - l) + real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
?x2 \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> \<phi> (l, i) ?x2 = real_of_int i + 1 - 2 ^ (l + 1) * ?x2

goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 - real_of_int i' / 2 ^ (l' - l) + real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 - real_of_int i' / 2 ^ (l' - l) + real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
assume x: "x \<in> {?in' / ?l' .. real_of_int i' / ?l'}"
[PROOF STATE]
proof (state)
this:
x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)}

goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 - real_of_int i' / 2 ^ (l' - l) + real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
hence \<phi>'_eq: "?\<phi>' x = ?l' * x  - ?in'"
[PROOF STATE]
proof (prove)
using this:
x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)}

goal (1 subgoal):
 1. \<phi> (l', i') x = 2 ^ (l' + 1) * x - (real_of_int i' - 1)
[PROOF STEP]
using \<phi>_left_support'
[PROOF STATE]
proof (prove)
using this:
x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)}
?x \<in> {real_of_int (?i - 1) / 2 ^ (?l + 1)..real_of_int ?i / 2 ^ (?l + 1)} \<Longrightarrow> \<phi> (?l, ?i) ?x = 1 + ?x * 2 ^ (?l + 1) - real_of_int ?i

goal (1 subgoal):
 1. \<phi> (l', i') x = 2 ^ (l' + 1) * x - (real_of_int i' - 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<phi> (l', i') x = 2 ^ (l' + 1) * x - (real_of_int i' - 1)

goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 - real_of_int i' / 2 ^ (l' - l) + real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
from x
[PROOF STATE]
proof (chain)
picking this:
x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)}
[PROOF STEP]
have x': "x \<in> {?in' / ?l' .. ?ip' / ?l'}"
[PROOF STATE]
proof (prove)
using this:
x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)}

goal (1 subgoal):
 1. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)}
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)}

goal (3 subgoals):
 1. \<And>x. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 3. ?\<Phi>_n (real_of_int i' / 2 ^ (l' + 1)) - ?\<Phi>_n ((real_of_int i' - 1) / 2 ^ (l' + 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 - real_of_int i' / 2 ^ (l' - l) + real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
show "DERIV \<Phi>_n x :> ?\<phi>2 x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
[PROOF STEP]
unfolding \<Phi>_n_def \<phi>_eq[OF x'] \<phi>'_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. x\<^sup>2 / 2 * ((real_of_int i' - 1) * 2 ^ (l + 1) + (real_of_int i + 1) * 2 ^ (l' + 1)) - x ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) - x * (real_of_int i + 1) * (real_of_int i' - 1)) has_real_derivative (2 ^ (l' + 1) * x - (real_of_int i' - 1)) * (real_of_int i + 1 - 2 ^ (l + 1) * x)) (at x)
[PROOF STEP]
by (auto intro!: derivative_eq_intros simp add: simp add: power2_eq_square algebra_simps)
[PROOF STATE]
proof (state)
this:
(\<Phi>_n has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)

goal (2 subgoals):
 1. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. (real_of_int i' / 2 ^ (l' + 1))\<^sup>2 / 2 * ((real_of_int i' - 1) * 2 ^ (l + 1) + (real_of_int i + 1) * 2 ^ (l' + 1)) - (real_of_int i' / 2 ^ (l' + 1)) ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) - real_of_int i' / 2 ^ (l' + 1) * (real_of_int i + 1) * (real_of_int i' - 1) - (((real_of_int i' - 1) / 2 ^ (l' + 1))\<^sup>2 / 2 * ((real_of_int i' - 1) * 2 ^ (l + 1) + (real_of_int i + 1) * 2 ^ (l' + 1)) - ((real_of_int i' - 1) / 2 ^ (l' + 1)) ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) - (real_of_int i' - 1) / 2 ^ (l' + 1) * (real_of_int i + 1) * (real_of_int i' - 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 - real_of_int i' / 2 ^ (l' - l) + real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?x2 \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (\<Phi>_n has_real_derivative \<phi> (l', i') ?x2 * \<phi> (l, i) ?x2) (at ?x2)

goal (2 subgoals):
 1. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. (real_of_int i' / 2 ^ (l' + 1))\<^sup>2 / 2 * ((real_of_int i' - 1) * 2 ^ (l + 1) + (real_of_int i + 1) * 2 ^ (l' + 1)) - (real_of_int i' / 2 ^ (l' + 1)) ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) - real_of_int i' / 2 ^ (l' + 1) * (real_of_int i + 1) * (real_of_int i' - 1) - (((real_of_int i' - 1) / 2 ^ (l' + 1))\<^sup>2 / 2 * ((real_of_int i' - 1) * 2 ^ (l + 1) + (real_of_int i + 1) * 2 ^ (l' + 1)) - ((real_of_int i' - 1) / 2 ^ (l' + 1)) ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) - (real_of_int i' - 1) / 2 ^ (l' + 1) * (real_of_int i + 1) * (real_of_int i' - 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 - real_of_int i' / 2 ^ (l' - l) + real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
?x2 \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..real_of_int i' / 2 ^ (l' + 1)} \<Longrightarrow> (\<Phi>_n has_real_derivative \<phi> (l', i') ?x2 * \<phi> (l, i) ?x2) (at ?x2)

goal (2 subgoals):
 1. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. (real_of_int i' / 2 ^ (l' + 1))\<^sup>2 / 2 * ((real_of_int i' - 1) * 2 ^ (l + 1) + (real_of_int i + 1) * 2 ^ (l' + 1)) - (real_of_int i' / 2 ^ (l' + 1)) ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) - real_of_int i' / 2 ^ (l' + 1) * (real_of_int i + 1) * (real_of_int i' - 1) - (((real_of_int i' - 1) / 2 ^ (l' + 1))\<^sup>2 / 2 * ((real_of_int i' - 1) * 2 ^ (l + 1) + (real_of_int i + 1) * 2 ^ (l' + 1)) - ((real_of_int i' - 1) / 2 ^ (l' + 1)) ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) - (real_of_int i' - 1) / 2 ^ (l' + 1) * (real_of_int i + 1) * (real_of_int i' - 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 - real_of_int i' / 2 ^ (l' - l) + real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. (real_of_int i' / 2 ^ (l' + 1))\<^sup>2 / 2 * ((real_of_int i' - 1) * 2 ^ (l + 1) + (real_of_int i + 1) * 2 ^ (l' + 1)) - (real_of_int i' / 2 ^ (l' + 1)) ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) - real_of_int i' / 2 ^ (l' + 1) * (real_of_int i + 1) * (real_of_int i' - 1) - (((real_of_int i' - 1) / 2 ^ (l' + 1))\<^sup>2 / 2 * ((real_of_int i' - 1) * 2 ^ (l + 1) + (real_of_int i + 1) * 2 ^ (l' + 1)) - ((real_of_int i' - 1) / 2 ^ (l' + 1)) ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) - (real_of_int i' - 1) / 2 ^ (l' + 1) * (real_of_int i + 1) * (real_of_int i' - 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 - real_of_int i' / 2 ^ (l' - l) + real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
assume x: "x \<in> {real_of_int i' / ?l' .. ?ip' / ?l'}"
[PROOF STATE]
proof (state)
this:
x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)}

goal (2 subgoals):
 1. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. (real_of_int i' / 2 ^ (l' + 1))\<^sup>2 / 2 * ((real_of_int i' - 1) * 2 ^ (l + 1) + (real_of_int i + 1) * 2 ^ (l' + 1)) - (real_of_int i' / 2 ^ (l' + 1)) ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) - real_of_int i' / 2 ^ (l' + 1) * (real_of_int i + 1) * (real_of_int i' - 1) - (((real_of_int i' - 1) / 2 ^ (l' + 1))\<^sup>2 / 2 * ((real_of_int i' - 1) * 2 ^ (l + 1) + (real_of_int i + 1) * 2 ^ (l' + 1)) - ((real_of_int i' - 1) / 2 ^ (l' + 1)) ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) - (real_of_int i' - 1) / 2 ^ (l' + 1) * (real_of_int i + 1) * (real_of_int i' - 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 - real_of_int i' / 2 ^ (l' - l) + real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
hence \<phi>'_eq: "?\<phi>' x = ?ip' - ?l' * x"
[PROOF STATE]
proof (prove)
using this:
x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)}

goal (1 subgoal):
 1. \<phi> (l', i') x = real_of_int i' + 1 - 2 ^ (l' + 1) * x
[PROOF STEP]
using \<phi>_right_support'
[PROOF STATE]
proof (prove)
using this:
x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)}
?x \<in> {real_of_int ?i / 2 ^ (?l + 1)..real_of_int (?i + 1) / 2 ^ (?l + 1)} \<Longrightarrow> \<phi> (?l, ?i) ?x = 1 - ?x * 2 ^ (?l + 1) + real_of_int ?i

goal (1 subgoal):
 1. \<phi> (l', i') x = real_of_int i' + 1 - 2 ^ (l' + 1) * x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<phi> (l', i') x = real_of_int i' + 1 - 2 ^ (l' + 1) * x

goal (2 subgoals):
 1. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. (real_of_int i' / 2 ^ (l' + 1))\<^sup>2 / 2 * ((real_of_int i' - 1) * 2 ^ (l + 1) + (real_of_int i + 1) * 2 ^ (l' + 1)) - (real_of_int i' / 2 ^ (l' + 1)) ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) - real_of_int i' / 2 ^ (l' + 1) * (real_of_int i + 1) * (real_of_int i' - 1) - (((real_of_int i' - 1) / 2 ^ (l' + 1))\<^sup>2 / 2 * ((real_of_int i' - 1) * 2 ^ (l + 1) + (real_of_int i + 1) * 2 ^ (l' + 1)) - ((real_of_int i' - 1) / 2 ^ (l' + 1)) ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) - (real_of_int i' - 1) / 2 ^ (l' + 1) * (real_of_int i + 1) * (real_of_int i' - 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 - real_of_int i' / 2 ^ (l' - l) + real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
from x
[PROOF STATE]
proof (chain)
picking this:
x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)}
[PROOF STEP]
have x': "x \<in> {?in' / ?l' .. ?ip' / ?l'}"
[PROOF STATE]
proof (prove)
using this:
x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)}

goal (1 subgoal):
 1. x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)}
[PROOF STEP]
by (auto simp: field_simps)
[PROOF STATE]
proof (state)
this:
x \<in> {(real_of_int i' - 1) / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)}

goal (2 subgoals):
 1. \<And>x. x \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (?\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
 2. (real_of_int i' / 2 ^ (l' + 1))\<^sup>2 / 2 * ((real_of_int i' - 1) * 2 ^ (l + 1) + (real_of_int i + 1) * 2 ^ (l' + 1)) - (real_of_int i' / 2 ^ (l' + 1)) ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) - real_of_int i' / 2 ^ (l' + 1) * (real_of_int i + 1) * (real_of_int i' - 1) - (((real_of_int i' - 1) / 2 ^ (l' + 1))\<^sup>2 / 2 * ((real_of_int i' - 1) * 2 ^ (l + 1) + (real_of_int i + 1) * 2 ^ (l' + 1)) - ((real_of_int i' - 1) / 2 ^ (l' + 1)) ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) - (real_of_int i' - 1) / 2 ^ (l' + 1) * (real_of_int i + 1) * (real_of_int i' - 1)) + (?\<Phi>_p ((real_of_int i' + 1) / 2 ^ (l' + 1)) - ?\<Phi>_p (real_of_int i' / 2 ^ (l' + 1))) = (1 - real_of_int i' / 2 ^ (l' - l) + real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
show "DERIV \<Phi>_p x :> ?\<phi>2 x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)
[PROOF STEP]
unfolding \<phi>_eq[OF x'] \<phi>'_eq \<Phi>_p_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. x ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) + x * (real_of_int i + 1) * (real_of_int i' + 1) - x\<^sup>2 / 2 * ((real_of_int i' + 1) * 2 ^ (l + 1) + (real_of_int i + 1) * 2 ^ (l' + 1))) has_real_derivative (real_of_int i' + 1 - 2 ^ (l' + 1) * x) * (real_of_int i + 1 - 2 ^ (l + 1) * x)) (at x)
[PROOF STEP]
by (auto intro!: derivative_eq_intros simp add: power2_eq_square algebra_simps)
[PROOF STATE]
proof (state)
this:
(\<Phi>_p has_real_derivative \<phi> (l', i') x * \<phi> (l, i) x) (at x)

goal (1 subgoal):
 1. (real_of_int i' / 2 ^ (l' + 1))\<^sup>2 / 2 * ((real_of_int i' - 1) * 2 ^ (l + 1) + (real_of_int i + 1) * 2 ^ (l' + 1)) - (real_of_int i' / 2 ^ (l' + 1)) ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) - real_of_int i' / 2 ^ (l' + 1) * (real_of_int i + 1) * (real_of_int i' - 1) - (((real_of_int i' - 1) / 2 ^ (l' + 1))\<^sup>2 / 2 * ((real_of_int i' - 1) * 2 ^ (l + 1) + (real_of_int i + 1) * 2 ^ (l' + 1)) - ((real_of_int i' - 1) / 2 ^ (l' + 1)) ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) - (real_of_int i' - 1) / 2 ^ (l' + 1) * (real_of_int i + 1) * (real_of_int i' - 1)) + (((real_of_int i' + 1) / 2 ^ (l' + 1)) ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) + (real_of_int i' + 1) / 2 ^ (l' + 1) * (real_of_int i + 1) * (real_of_int i' + 1) - ((real_of_int i' + 1) / 2 ^ (l' + 1))\<^sup>2 / 2 * ((real_of_int i' + 1) * 2 ^ (l + 1) + (real_of_int i + 1) * 2 ^ (l' + 1)) - ((real_of_int i' / 2 ^ (l' + 1)) ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) + real_of_int i' / 2 ^ (l' + 1) * (real_of_int i + 1) * (real_of_int i' + 1) - (real_of_int i' / 2 ^ (l' + 1))\<^sup>2 / 2 * ((real_of_int i' + 1) * 2 ^ (l + 1) + (real_of_int i + 1) * 2 ^ (l' + 1)))) = (1 - real_of_int i' / 2 ^ (l' - l) + real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?x2 \<in> {real_of_int i' / 2 ^ (l' + 1)..(real_of_int i' + 1) / 2 ^ (l' + 1)} \<Longrightarrow> (\<Phi>_p has_real_derivative \<phi> (l', i') ?x2 * \<phi> (l, i) ?x2) (at ?x2)

goal (1 subgoal):
 1. (real_of_int i' / 2 ^ (l' + 1))\<^sup>2 / 2 * ((real_of_int i' - 1) * 2 ^ (l + 1) + (real_of_int i + 1) * 2 ^ (l' + 1)) - (real_of_int i' / 2 ^ (l' + 1)) ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) - real_of_int i' / 2 ^ (l' + 1) * (real_of_int i + 1) * (real_of_int i' - 1) - (((real_of_int i' - 1) / 2 ^ (l' + 1))\<^sup>2 / 2 * ((real_of_int i' - 1) * 2 ^ (l + 1) + (real_of_int i + 1) * 2 ^ (l' + 1)) - ((real_of_int i' - 1) / 2 ^ (l' + 1)) ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) - (real_of_int i' - 1) / 2 ^ (l' + 1) * (real_of_int i + 1) * (real_of_int i' - 1)) + (((real_of_int i' + 1) / 2 ^ (l' + 1)) ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) + (real_of_int i' + 1) / 2 ^ (l' + 1) * (real_of_int i + 1) * (real_of_int i' + 1) - ((real_of_int i' + 1) / 2 ^ (l' + 1))\<^sup>2 / 2 * ((real_of_int i' + 1) * 2 ^ (l + 1) + (real_of_int i + 1) * 2 ^ (l' + 1)) - ((real_of_int i' / 2 ^ (l' + 1)) ^ 3 / 3 * 2 ^ (l' + 1) * 2 ^ (l + 1) + real_of_int i' / 2 ^ (l' + 1) * (real_of_int i + 1) * (real_of_int i' + 1) - (real_of_int i' / 2 ^ (l' + 1))\<^sup>2 / 2 * ((real_of_int i' + 1) * 2 ^ (l + 1) + (real_of_int i + 1) * 2 ^ (l' + 1)))) = (1 - real_of_int i' / 2 ^ (l' - l) + real_of_int i) / 2 ^ (l' + 1)
[PROOF STEP]
qed (simp_all add: field_simps power_eq_if[of _ 2] power_eq_if[of _ 3] power_diff[of "2::real", OF _ \<open>l < l'\<close>[THEN less_imp_le]] )


[STATEMENT]
lemma dot_scaleR_mult:
  shows "(k *\<^sub>R a) \<bullet> b = k * (a \<bullet> b)" and "a \<bullet> (k *\<^sub>R b) = k * (a \<bullet> b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k *\<^sub>R a \<bullet> b = k * (a \<bullet> b) &&& a \<bullet> k *\<^sub>R b = k * (a \<bullet> b)
[PROOF STEP]
by auto


[STATEMENT]
lemma length_merge:
  "length (merge f xs ys) = length xs + length ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (Common.merge f xs ys) = length xs + length ys
[PROOF STEP]
by (induction f xs ys rule: merge.induct) auto


[STATEMENT]
lemma subarray_eq_samelength_iff: "Array.length h a = Array.length h' a \<Longrightarrow> (subarray i j a h = subarray i j a h') = (\<forall>i'. i \<le> i' \<and> i' < j \<longrightarrow> Array.get h a ! i' = Array.get h' a ! i')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Array.length h a = Array.length h' a \<Longrightarrow> (subarray i j a h = subarray i j a h') = (\<forall>i'. i \<le> i' \<and> i' < j \<longrightarrow> Array.get h a ! i' = Array.get h' a ! i')
[PROOF STEP]
unfolding Array.length_def subarray_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (Array.get h a) = length (Array.get h' a) \<Longrightarrow> (nths' i j (Array.get h a) = nths' i j (Array.get h' a)) = (\<forall>i'. i \<le> i' \<and> i' < j \<longrightarrow> Array.get h a ! i' = Array.get h' a ! i')
[PROOF STEP]
by (rule nths'_eq_samelength_iff)


[STATEMENT]
lemma replicate_mset_subset_iff_lt[simp]: "replicate_mset m x \<subset># replicate_mset n x \<longleftrightarrow> m < n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (replicate_mset m x \<subset># replicate_mset n x) = (m < n)
[PROOF STEP]
by (induct n m rule: diff_induct) (auto intro: subset_mset.gr_zeroI)


[STATEMENT]
lemma nth_default_append:
  "nth_default dflt (xs @ ys) n =
    (if n < length xs then nth xs n else nth_default dflt ys (n - length xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nth_default dflt (xs @ ys) n = (if n < length xs then xs ! n else nth_default dflt ys (n - length xs))
[PROOF STEP]
by (auto simp add: nth_default_def nth_append)


[STATEMENT]
lemma (in linorder_topology) eventually_at_right:
  "x < y \<Longrightarrow> eventually P (at_right x) \<longleftrightarrow> (\<exists>b>x. \<forall>y>x. y < b \<longrightarrow> P y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < y \<Longrightarrow> eventually P (at_right x) = (\<exists>b>x. \<forall>y>x. y < b \<longrightarrow> P y)
[PROOF STEP]
unfolding at_right_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < y \<Longrightarrow> eventually P (INF a\<in>{x<..}. principal {x<..<a}) = (\<exists>b>x. \<forall>y>x. y < b \<longrightarrow> P y)
[PROOF STEP]
by (subst eventually_INF_base) (auto simp: eventually_principal Ball_def)


[STATEMENT]
lemma cball_Pair_split_subset: "cball (a, b) c \<subseteq> cball a c \<times> cball b c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cball (a, b) c \<subseteq> cball a c \<times> cball b c
[PROOF STEP]
by (auto simp: dist_prod_def mem_cball power2_eq_square
      intro: order_trans[OF le_real_sqrt_sumsq] order_trans[OF le_real_sqrt_sumsq'])


[STATEMENT]
lemma sub_polyfun_alt:
  fixes x :: "'a::{comm_ring,monoid_mult}"
  shows   "(\<Sum>i\<le>n. a i * x^i) - (\<Sum>i\<le>n. a i * y^i) =
           (x - y) * (\<Sum>j<n. \<Sum>k<n-j. a (j+k+1) * y^k * x^j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>n. a i * x ^ i) - (\<Sum>i\<le>n. a i * y ^ i) = (x - y) * (\<Sum>j<n. \<Sum>k<n - j. a (j + k + 1) * y ^ k * x ^ j)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>i\<le>n. a i * x ^ i) - (\<Sum>i\<le>n. a i * y ^ i) = (x - y) * (\<Sum>j<n. \<Sum>k<n - j. a (j + k + 1) * y ^ k * x ^ j)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>i\<le>n. a i * x ^ i) - (\<Sum>i\<le>n. a i * y ^ i) = (x - y) * (\<Sum>j<n. \<Sum>k<n - j. a (j + k + 1) * y ^ k * x ^ j)
[PROOF STEP]
fix j
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>i\<le>n. a i * x ^ i) - (\<Sum>i\<le>n. a i * y ^ i) = (x - y) * (\<Sum>j<n. \<Sum>k<n - j. a (j + k + 1) * y ^ k * x ^ j)
[PROOF STEP]
have "(\<Sum>k = Suc j..n. a k * y^(k - Suc j) * x^j) =
          (\<Sum>k <n - j. a (Suc (j + k)) * y^k * x^j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = Suc j..n. a k * y ^ (k - Suc j) * x ^ j) = (\<Sum>k<n - j. a (Suc (j + k)) * y ^ k * x ^ j)
[PROOF STEP]
by (rule sum.reindex_bij_witness[where i="\<lambda>i. i + Suc j" and j="\<lambda>i. i - Suc j"]) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>k = Suc j..n. a k * y ^ (k - Suc j) * x ^ j) = (\<Sum>k<n - j. a (Suc (j + k)) * y ^ k * x ^ j)

goal (1 subgoal):
 1. (\<Sum>i\<le>n. a i * x ^ i) - (\<Sum>i\<le>n. a i * y ^ i) = (x - y) * (\<Sum>j<n. \<Sum>k<n - j. a (j + k + 1) * y ^ k * x ^ j)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
(\<Sum>k = Suc ?j2..n. a k * y ^ (k - Suc ?j2) * x ^ ?j2) = (\<Sum>k<n - ?j2. a (Suc (?j2 + k)) * y ^ k * x ^ ?j2)

goal (1 subgoal):
 1. (\<Sum>i\<le>n. a i * x ^ i) - (\<Sum>i\<le>n. a i * y ^ i) = (x - y) * (\<Sum>j<n. \<Sum>k<n - j. a (j + k + 1) * y ^ k * x ^ j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>k = Suc ?j2..n. a k * y ^ (k - Suc ?j2) * x ^ ?j2) = (\<Sum>k<n - ?j2. a (Suc (?j2 + k)) * y ^ k * x ^ ?j2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>k = Suc ?j2..n. a k * y ^ (k - Suc ?j2) * x ^ ?j2) = (\<Sum>k<n - ?j2. a (Suc (?j2 + k)) * y ^ k * x ^ ?j2)

goal (1 subgoal):
 1. (\<Sum>i\<le>n. a i * x ^ i) - (\<Sum>i\<le>n. a i * y ^ i) = (x - y) * (\<Sum>j<n. \<Sum>k<n - j. a (j + k + 1) * y ^ k * x ^ j)
[PROOF STEP]
by (simp add: sub_polyfun)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n. a i * x ^ i) - (\<Sum>i\<le>n. a i * y ^ i) = (x - y) * (\<Sum>j<n. \<Sum>k<n - j. a (j + k + 1) * y ^ k * x ^ j)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma and_mask_dvd_nat: "2 ^ n dvd unat w \<longleftrightarrow> w AND mask n = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2 ^ n dvd unat w) = (w AND mask n = 0)
[PROOF STEP]
by (simp flip: take_bit_eq_mask take_bit_eq_mod unsigned_take_bit_eq add: dvd_eq_mod_eq_0 unat_0_iff uint_0_iff)


[STATEMENT]
lemma diagonal_step_dvd2[simp]:
  fixes A::"'a::{bezout_ring}^'b::mod_type^'c::mod_type" and j i
  defines "v==case bezout (A $ from_nat i $ from_nat i) (A $ from_nat j $ from_nat j) of (p,q,u,v,d) \<Rightarrow> v"
  and "d==case bezout (A $ from_nat i $ from_nat i) (A $ from_nat j $ from_nat j) of (p,q,u,v,d) \<Rightarrow> d"
 shows "diagonal_step A i j d v $ from_nat i $ from_nat i dvd A $ from_nat j $ from_nat j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diagonal_step A i j d v $ from_nat i $ from_nat i dvd A $ from_nat j $ from_nat j
[PROOF STEP]
using ib
[PROOF STATE]
proof (prove)
using this:
is_bezout_ext bezout

goal (1 subgoal):
 1. diagonal_step A i j d v $ from_nat i $ from_nat i dvd A $ from_nat j $ from_nat j
[PROOF STEP]
unfolding is_bezout_ext_def diagonal_step_def v_def d_def
[PROOF STATE]
proof (prove)
using this:
\<forall>a b. let (p, q, u, v, gcd_a_b) = bezout a b in p * a + q * b = gcd_a_b \<and> gcd_a_b dvd a \<and> gcd_a_b dvd b \<and> (\<forall>d'. d' dvd a \<and> d' dvd b \<longrightarrow> d' dvd gcd_a_b) \<and> gcd_a_b * u = - b \<and> gcd_a_b * v = a

goal (1 subgoal):
 1. (\<chi>a b. if a = from_nat i \<and> b = from_nat i then case bezout (A $ from_nat i $ from_nat i) (A $ from_nat j $ from_nat j) of (p, q, u, v, d) \<Rightarrow> d else if a = from_nat j \<and> b = from_nat j then (case bezout (A $ from_nat i $ from_nat i) (A $ from_nat j $ from_nat j) of (p, q, u, v, d) \<Rightarrow> v) * A $ from_nat j $ from_nat j else A $ a $ b) $ from_nat i $ from_nat i dvd A $ from_nat j $ from_nat j
[PROOF STEP]
by (auto simp add: split_beta)


[STATEMENT]
lemma characterizationallAllocations:
  "a \<in> allAllocations N G = (a \<in> injections (Domain a) (Range a)  &
   Range a \<in> all_partitions G &
   Domain a \<subseteq> N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<in> allAllocations N G) = (a \<in> injections (Domain a) (Range a) \<and> Range a \<in> all_partitions G \<and> Domain a \<subseteq> N)
[PROOF STEP]
using lm036 lm037
[PROOF STATE]
proof (prove)
using this:
?a \<in> allAllocations ?N ?G \<Longrightarrow> ?a \<in> injections (Domain ?a) (Range ?a) \<and> Range ?a \<in> all_partitions ?G \<and> Domain ?a \<subseteq> ?N
\<lbrakk>?a \<in> injections (Domain ?a) (Range ?a); Range ?a \<in> all_partitions ?G; Domain ?a \<subseteq> ?N\<rbrakk> \<Longrightarrow> ?a \<in> allAllocations ?N ?G

goal (1 subgoal):
 1. (a \<in> allAllocations N G) = (a \<in> injections (Domain a) (Range a) \<and> Range a \<in> all_partitions G \<and> Domain a \<subseteq> N)
[PROOF STEP]
by metis


[STATEMENT]
lemma tranclp_stepfun_conv:
  "P\<^sup>+\<^sup>+ x y \<longleftrightarrow> (\<exists>f n. f 0 = x \<and> f (Suc n) = y \<and> (\<forall>i\<le>n. P (f i) (f (Suc i))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P\<^sup>+\<^sup>+ x y = (\<exists>f n. f 0 = x \<and> f (Suc n) = y \<and> (\<forall>i\<le>n. P (f i) (f (Suc i))))
[PROOF STEP]
using tranclp_imp_stepfun and stepfun_imp_tranclp
[PROOF STATE]
proof (prove)
using this:
?P\<^sup>+\<^sup>+ ?x ?z \<Longrightarrow> \<exists>f n. f 0 = ?x \<and> f (Suc n) = ?z \<and> (\<forall>i\<le>n. ?P (f i) (f (Suc i)))
\<lbrakk>?f 0 = ?x; ?f (Suc ?n) = ?z; \<forall>i\<le>?n. ?P (?f i) (?f (Suc i))\<rbrakk> \<Longrightarrow> ?P\<^sup>+\<^sup>+ ?x ?z

goal (1 subgoal):
 1. P\<^sup>+\<^sup>+ x y = (\<exists>f n. f 0 = x \<and> f (Suc n) = y \<and> (\<forall>i\<le>n. P (f i) (f (Suc i))))
[PROOF STEP]
by metis


[STATEMENT]
lemma prime_imp_euler_liar:
  assumes "prime p" "2 < p" "0 < x" "x < p"
  shows   "euler_liar x p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. euler_liar x p
[PROOF STEP]
using assms prime_p_Jacobi_eq_Legendre and euler_criterion
[PROOF STATE]
proof (prove)
using this:
prime p
2 < p
0 < x
x < int p
prime ?p \<Longrightarrow> Jacobi ?a ?p = Legendre ?a ?p
\<lbrakk>prime ?p; 2 < ?p\<rbrakk> \<Longrightarrow> [Legendre ?a (int ?p) = ?a ^ ((?p - 1) div 2)] (mod int ?p)

goal (1 subgoal):
 1. euler_liar x p
[PROOF STEP]
unfolding euler_witness_def
[PROOF STATE]
proof (prove)
using this:
prime p
2 < p
0 < x
x < int p
prime ?p \<Longrightarrow> Jacobi ?a ?p = Legendre ?a ?p
\<lbrakk>prime ?p; 2 < ?p\<rbrakk> \<Longrightarrow> [Legendre ?a (int ?p) = ?a ^ ((?p - 1) div 2)] (mod int ?p)

goal (1 subgoal):
 1. \<not> [Jacobi x (int p) \<noteq> x ^ ((p - 1) div 2)] (mod int p)
[PROOF STEP]
by simp


[STATEMENT]
lemma borel_measurable_erealD[measurable_dest]:
  "(\<lambda>x. ereal (f x)) \<in> borel_measurable M \<Longrightarrow> g \<in> measurable N M \<Longrightarrow> (\<lambda>x. f (g x)) \<in> borel_measurable N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(\<lambda>x. ereal (f x)) \<in> borel_measurable M; g \<in> N \<rightarrow>\<^sub>M M\<rbrakk> \<Longrightarrow> (\<lambda>x. f (g x)) \<in> borel_measurable N
[PROOF STEP]
unfolding borel_measurable_ereal_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> borel_measurable M; g \<in> N \<rightarrow>\<^sub>M M\<rbrakk> \<Longrightarrow> (\<lambda>x. f (g x)) \<in> borel_measurable N
[PROOF STEP]
by simp


[STATEMENT]
theorem borel_Times:
  fixes A :: "'a::topological_space set" and B :: "'b::topological_space set"
  assumes A: "A \<in> sets borel" and B: "B \<in> sets borel"
  shows "A \<times> B \<in> sets borel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<times> B \<in> sets borel
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A \<times> B \<in> sets borel
[PROOF STEP]
have "A \<times> B = (A\<times>UNIV) \<inter> (UNIV \<times> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<times> B = A \<times> UNIV \<inter> UNIV \<times> B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A \<times> B = A \<times> UNIV \<inter> UNIV \<times> B

goal (1 subgoal):
 1. A \<times> B \<in> sets borel
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
A \<times> B = A \<times> UNIV \<inter> UNIV \<times> B

goal (1 subgoal):
 1. A \<times> B \<in> sets borel
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
A \<times> B = A \<times> UNIV \<inter> UNIV \<times> B

goal (1 subgoal):
 1. A \<times> B \<in> sets borel
[PROOF STEP]
have "A \<in> sigma_sets UNIV {S. open S}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<in> sigma_sets UNIV {S. open S}
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
A \<in> sets borel

goal (1 subgoal):
 1. A \<in> sigma_sets UNIV {S. open S}
[PROOF STEP]
by (simp add: sets_borel)
[PROOF STATE]
proof (state)
this:
A \<in> sigma_sets UNIV {S. open S}

goal (1 subgoal):
 1. A \<times> B \<in> sets borel
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A \<in> sigma_sets UNIV {S. open S}
[PROOF STEP]
have "A\<times>UNIV \<in> sets borel"
[PROOF STATE]
proof (prove)
using this:
A \<in> sigma_sets UNIV {S. open S}

goal (1 subgoal):
 1. A \<times> UNIV \<in> sets borel
[PROOF STEP]
proof (induct A)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>a. a \<in> {S. open S} \<Longrightarrow> a \<times> UNIV \<in> sets borel
 2. {} \<times> UNIV \<in> sets borel
 3. \<And>a. \<lbrakk>a \<in> sigma_sets UNIV {S. open S}; a \<times> UNIV \<in> sets borel\<rbrakk> \<Longrightarrow> (UNIV - a) \<times> UNIV \<in> sets borel
 4. \<And>a. \<lbrakk>\<And>i. a i \<in> sigma_sets UNIV {S. open S}; \<And>i. a i \<times> UNIV \<in> sets borel\<rbrakk> \<Longrightarrow> \<Union> (range a) \<times> UNIV \<in> sets borel
[PROOF STEP]
case (Basic S)
[PROOF STATE]
proof (state)
this:
S \<in> {S. open S}

goal (4 subgoals):
 1. \<And>a. a \<in> {S. open S} \<Longrightarrow> a \<times> UNIV \<in> sets borel
 2. {} \<times> UNIV \<in> sets borel
 3. \<And>a. \<lbrakk>a \<in> sigma_sets UNIV {S. open S}; a \<times> UNIV \<in> sets borel\<rbrakk> \<Longrightarrow> (UNIV - a) \<times> UNIV \<in> sets borel
 4. \<And>a. \<lbrakk>\<And>i. a i \<in> sigma_sets UNIV {S. open S}; \<And>i. a i \<times> UNIV \<in> sets borel\<rbrakk> \<Longrightarrow> \<Union> (range a) \<times> UNIV \<in> sets borel
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
S \<in> {S. open S}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
S \<in> {S. open S}

goal (1 subgoal):
 1. S \<times> UNIV \<in> sets borel
[PROOF STEP]
by (auto intro!: borel_open open_Times)
[PROOF STATE]
proof (state)
this:
S \<times> UNIV \<in> sets borel

goal (3 subgoals):
 1. {} \<times> UNIV \<in> sets borel
 2. \<And>a. \<lbrakk>a \<in> sigma_sets UNIV {S. open S}; a \<times> UNIV \<in> sets borel\<rbrakk> \<Longrightarrow> (UNIV - a) \<times> UNIV \<in> sets borel
 3. \<And>a. \<lbrakk>\<And>i. a i \<in> sigma_sets UNIV {S. open S}; \<And>i. a i \<times> UNIV \<in> sets borel\<rbrakk> \<Longrightarrow> \<Union> (range a) \<times> UNIV \<in> sets borel
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. {} \<times> UNIV \<in> sets borel
 2. \<And>a. \<lbrakk>a \<in> sigma_sets UNIV {S. open S}; a \<times> UNIV \<in> sets borel\<rbrakk> \<Longrightarrow> (UNIV - a) \<times> UNIV \<in> sets borel
 3. \<And>a. \<lbrakk>\<And>i. a i \<in> sigma_sets UNIV {S. open S}; \<And>i. a i \<times> UNIV \<in> sets borel\<rbrakk> \<Longrightarrow> \<Union> (range a) \<times> UNIV \<in> sets borel
[PROOF STEP]
case (Compl A)
[PROOF STATE]
proof (state)
this:
A \<in> sigma_sets UNIV {S. open S}
A \<times> UNIV \<in> sets borel

goal (3 subgoals):
 1. {} \<times> UNIV \<in> sets borel
 2. \<And>a. \<lbrakk>a \<in> sigma_sets UNIV {S. open S}; a \<times> UNIV \<in> sets borel\<rbrakk> \<Longrightarrow> (UNIV - a) \<times> UNIV \<in> sets borel
 3. \<And>a. \<lbrakk>\<And>i. a i \<in> sigma_sets UNIV {S. open S}; \<And>i. a i \<times> UNIV \<in> sets borel\<rbrakk> \<Longrightarrow> \<Union> (range a) \<times> UNIV \<in> sets borel
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
A \<in> sigma_sets UNIV {S. open S}
A \<times> UNIV \<in> sets borel

goal (3 subgoals):
 1. {} \<times> UNIV \<in> sets borel
 2. \<And>a. \<lbrakk>a \<in> sigma_sets UNIV {S. open S}; a \<times> UNIV \<in> sets borel\<rbrakk> \<Longrightarrow> (UNIV - a) \<times> UNIV \<in> sets borel
 3. \<And>a. \<lbrakk>\<And>i. a i \<in> sigma_sets UNIV {S. open S}; \<And>i. a i \<times> UNIV \<in> sets borel\<rbrakk> \<Longrightarrow> \<Union> (range a) \<times> UNIV \<in> sets borel
[PROOF STEP]
have *: "(UNIV - A) \<times> UNIV = UNIV - (A \<times> UNIV)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (UNIV - A) \<times> UNIV = UNIV - A \<times> UNIV
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(UNIV - A) \<times> UNIV = UNIV - A \<times> UNIV

goal (3 subgoals):
 1. {} \<times> UNIV \<in> sets borel
 2. \<And>a. \<lbrakk>a \<in> sigma_sets UNIV {S. open S}; a \<times> UNIV \<in> sets borel\<rbrakk> \<Longrightarrow> (UNIV - a) \<times> UNIV \<in> sets borel
 3. \<And>a. \<lbrakk>\<And>i. a i \<in> sigma_sets UNIV {S. open S}; \<And>i. a i \<times> UNIV \<in> sets borel\<rbrakk> \<Longrightarrow> \<Union> (range a) \<times> UNIV \<in> sets borel
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
A \<in> sigma_sets UNIV {S. open S}
A \<times> UNIV \<in> sets borel
(UNIV - A) \<times> UNIV = UNIV - A \<times> UNIV
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
A \<in> sigma_sets UNIV {S. open S}
A \<times> UNIV \<in> sets borel
(UNIV - A) \<times> UNIV = UNIV - A \<times> UNIV

goal (1 subgoal):
 1. (UNIV - A) \<times> UNIV \<in> sets borel
[PROOF STEP]
unfolding *
[PROOF STATE]
proof (prove)
using this:
A \<in> sigma_sets UNIV {S. open S}
A \<times> UNIV \<in> sets borel
UNIV - A \<times> UNIV = UNIV - A \<times> UNIV

goal (1 subgoal):
 1. UNIV - A \<times> UNIV \<in> sets borel
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(UNIV - A) \<times> UNIV \<in> sets borel

goal (2 subgoals):
 1. {} \<times> UNIV \<in> sets borel
 2. \<And>a. \<lbrakk>\<And>i. a i \<in> sigma_sets UNIV {S. open S}; \<And>i. a i \<times> UNIV \<in> sets borel\<rbrakk> \<Longrightarrow> \<Union> (range a) \<times> UNIV \<in> sets borel
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {} \<times> UNIV \<in> sets borel
 2. \<And>a. \<lbrakk>\<And>i. a i \<in> sigma_sets UNIV {S. open S}; \<And>i. a i \<times> UNIV \<in> sets borel\<rbrakk> \<Longrightarrow> \<Union> (range a) \<times> UNIV \<in> sets borel
[PROOF STEP]
case (Union A)
[PROOF STATE]
proof (state)
this:
A ?i \<in> sigma_sets UNIV {S. open S}
A ?i \<times> UNIV \<in> sets borel

goal (2 subgoals):
 1. {} \<times> UNIV \<in> sets borel
 2. \<And>a. \<lbrakk>\<And>i. a i \<in> sigma_sets UNIV {S. open S}; \<And>i. a i \<times> UNIV \<in> sets borel\<rbrakk> \<Longrightarrow> \<Union> (range a) \<times> UNIV \<in> sets borel
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
A ?i \<in> sigma_sets UNIV {S. open S}
A ?i \<times> UNIV \<in> sets borel

goal (2 subgoals):
 1. {} \<times> UNIV \<in> sets borel
 2. \<And>a. \<lbrakk>\<And>i. a i \<in> sigma_sets UNIV {S. open S}; \<And>i. a i \<times> UNIV \<in> sets borel\<rbrakk> \<Longrightarrow> \<Union> (range a) \<times> UNIV \<in> sets borel
[PROOF STEP]
have *: "(\<Union>(A ` UNIV)) \<times> UNIV = \<Union>((\<lambda>i. A i \<times> UNIV) ` UNIV)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (range A) \<times> UNIV = (\<Union>i. A i \<times> UNIV)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<Union> (range A) \<times> UNIV = (\<Union>i. A i \<times> UNIV)

goal (2 subgoals):
 1. {} \<times> UNIV \<in> sets borel
 2. \<And>a. \<lbrakk>\<And>i. a i \<in> sigma_sets UNIV {S. open S}; \<And>i. a i \<times> UNIV \<in> sets borel\<rbrakk> \<Longrightarrow> \<Union> (range a) \<times> UNIV \<in> sets borel
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
A ?i \<in> sigma_sets UNIV {S. open S}
A ?i \<times> UNIV \<in> sets borel
\<Union> (range A) \<times> UNIV = (\<Union>i. A i \<times> UNIV)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
A ?i \<in> sigma_sets UNIV {S. open S}
A ?i \<times> UNIV \<in> sets borel
\<Union> (range A) \<times> UNIV = (\<Union>i. A i \<times> UNIV)

goal (1 subgoal):
 1. \<Union> (range A) \<times> UNIV \<in> sets borel
[PROOF STEP]
unfolding *
[PROOF STATE]
proof (prove)
using this:
A ?i \<in> sigma_sets UNIV {S. open S}
A ?i \<times> UNIV \<in> sets borel
(\<Union>i. A i \<times> UNIV) = (\<Union>i. A i \<times> UNIV)

goal (1 subgoal):
 1. (\<Union>i. A i \<times> UNIV) \<in> sets borel
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<Union> (range A) \<times> UNIV \<in> sets borel

goal (1 subgoal):
 1. {} \<times> UNIV \<in> sets borel
[PROOF STEP]
qed simp
[PROOF STATE]
proof (state)
this:
A \<times> UNIV \<in> sets borel

goal (1 subgoal):
 1. A \<times> B \<in> sets borel
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
A \<times> UNIV \<in> sets borel

goal (1 subgoal):
 1. A \<times> B \<in> sets borel
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
A \<times> UNIV \<in> sets borel

goal (1 subgoal):
 1. A \<times> B \<in> sets borel
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
A \<times> UNIV \<in> sets borel

goal (1 subgoal):
 1. A \<times> B \<in> sets borel
[PROOF STEP]
have "B \<in> sigma_sets UNIV {S. open S}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B \<in> sigma_sets UNIV {S. open S}
[PROOF STEP]
using B
[PROOF STATE]
proof (prove)
using this:
B \<in> sets borel

goal (1 subgoal):
 1. B \<in> sigma_sets UNIV {S. open S}
[PROOF STEP]
by (simp add: sets_borel)
[PROOF STATE]
proof (state)
this:
B \<in> sigma_sets UNIV {S. open S}

goal (1 subgoal):
 1. A \<times> B \<in> sets borel
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
B \<in> sigma_sets UNIV {S. open S}
[PROOF STEP]
have "UNIV\<times>B \<in> sets borel"
[PROOF STATE]
proof (prove)
using this:
B \<in> sigma_sets UNIV {S. open S}

goal (1 subgoal):
 1. UNIV \<times> B \<in> sets borel
[PROOF STEP]
proof (induct B)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>a. a \<in> {S. open S} \<Longrightarrow> UNIV \<times> a \<in> sets borel
 2. UNIV \<times> {} \<in> sets borel
 3. \<And>a. \<lbrakk>a \<in> sigma_sets UNIV {S. open S}; UNIV \<times> a \<in> sets borel\<rbrakk> \<Longrightarrow> UNIV \<times> (UNIV - a) \<in> sets borel
 4. \<And>a. \<lbrakk>\<And>i. a i \<in> sigma_sets UNIV {S. open S}; \<And>i. UNIV \<times> a i \<in> sets borel\<rbrakk> \<Longrightarrow> UNIV \<times> \<Union> (range a) \<in> sets borel
[PROOF STEP]
case (Basic S)
[PROOF STATE]
proof (state)
this:
S \<in> {S. open S}

goal (4 subgoals):
 1. \<And>a. a \<in> {S. open S} \<Longrightarrow> UNIV \<times> a \<in> sets borel
 2. UNIV \<times> {} \<in> sets borel
 3. \<And>a. \<lbrakk>a \<in> sigma_sets UNIV {S. open S}; UNIV \<times> a \<in> sets borel\<rbrakk> \<Longrightarrow> UNIV \<times> (UNIV - a) \<in> sets borel
 4. \<And>a. \<lbrakk>\<And>i. a i \<in> sigma_sets UNIV {S. open S}; \<And>i. UNIV \<times> a i \<in> sets borel\<rbrakk> \<Longrightarrow> UNIV \<times> \<Union> (range a) \<in> sets borel
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
S \<in> {S. open S}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
S \<in> {S. open S}

goal (1 subgoal):
 1. UNIV \<times> S \<in> sets borel
[PROOF STEP]
by (auto intro!: borel_open open_Times)
[PROOF STATE]
proof (state)
this:
UNIV \<times> S \<in> sets borel

goal (3 subgoals):
 1. UNIV \<times> {} \<in> sets borel
 2. \<And>a. \<lbrakk>a \<in> sigma_sets UNIV {S. open S}; UNIV \<times> a \<in> sets borel\<rbrakk> \<Longrightarrow> UNIV \<times> (UNIV - a) \<in> sets borel
 3. \<And>a. \<lbrakk>\<And>i. a i \<in> sigma_sets UNIV {S. open S}; \<And>i. UNIV \<times> a i \<in> sets borel\<rbrakk> \<Longrightarrow> UNIV \<times> \<Union> (range a) \<in> sets borel
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. UNIV \<times> {} \<in> sets borel
 2. \<And>a. \<lbrakk>a \<in> sigma_sets UNIV {S. open S}; UNIV \<times> a \<in> sets borel\<rbrakk> \<Longrightarrow> UNIV \<times> (UNIV - a) \<in> sets borel
 3. \<And>a. \<lbrakk>\<And>i. a i \<in> sigma_sets UNIV {S. open S}; \<And>i. UNIV \<times> a i \<in> sets borel\<rbrakk> \<Longrightarrow> UNIV \<times> \<Union> (range a) \<in> sets borel
[PROOF STEP]
case (Compl B)
[PROOF STATE]
proof (state)
this:
B \<in> sigma_sets UNIV {S. open S}
UNIV \<times> B \<in> sets borel

goal (3 subgoals):
 1. UNIV \<times> {} \<in> sets borel
 2. \<And>a. \<lbrakk>a \<in> sigma_sets UNIV {S. open S}; UNIV \<times> a \<in> sets borel\<rbrakk> \<Longrightarrow> UNIV \<times> (UNIV - a) \<in> sets borel
 3. \<And>a. \<lbrakk>\<And>i. a i \<in> sigma_sets UNIV {S. open S}; \<And>i. UNIV \<times> a i \<in> sets borel\<rbrakk> \<Longrightarrow> UNIV \<times> \<Union> (range a) \<in> sets borel
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
B \<in> sigma_sets UNIV {S. open S}
UNIV \<times> B \<in> sets borel

goal (3 subgoals):
 1. UNIV \<times> {} \<in> sets borel
 2. \<And>a. \<lbrakk>a \<in> sigma_sets UNIV {S. open S}; UNIV \<times> a \<in> sets borel\<rbrakk> \<Longrightarrow> UNIV \<times> (UNIV - a) \<in> sets borel
 3. \<And>a. \<lbrakk>\<And>i. a i \<in> sigma_sets UNIV {S. open S}; \<And>i. UNIV \<times> a i \<in> sets borel\<rbrakk> \<Longrightarrow> UNIV \<times> \<Union> (range a) \<in> sets borel
[PROOF STEP]
have *: "UNIV \<times> (UNIV - B) = UNIV - (UNIV \<times> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. UNIV \<times> (UNIV - B) = UNIV - UNIV \<times> B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
UNIV \<times> (UNIV - B) = UNIV - UNIV \<times> B

goal (3 subgoals):
 1. UNIV \<times> {} \<in> sets borel
 2. \<And>a. \<lbrakk>a \<in> sigma_sets UNIV {S. open S}; UNIV \<times> a \<in> sets borel\<rbrakk> \<Longrightarrow> UNIV \<times> (UNIV - a) \<in> sets borel
 3. \<And>a. \<lbrakk>\<And>i. a i \<in> sigma_sets UNIV {S. open S}; \<And>i. UNIV \<times> a i \<in> sets borel\<rbrakk> \<Longrightarrow> UNIV \<times> \<Union> (range a) \<in> sets borel
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
B \<in> sigma_sets UNIV {S. open S}
UNIV \<times> B \<in> sets borel
UNIV \<times> (UNIV - B) = UNIV - UNIV \<times> B
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
B \<in> sigma_sets UNIV {S. open S}
UNIV \<times> B \<in> sets borel
UNIV \<times> (UNIV - B) = UNIV - UNIV \<times> B

goal (1 subgoal):
 1. UNIV \<times> (UNIV - B) \<in> sets borel
[PROOF STEP]
unfolding *
[PROOF STATE]
proof (prove)
using this:
B \<in> sigma_sets UNIV {S. open S}
UNIV \<times> B \<in> sets borel
UNIV - UNIV \<times> B = UNIV - UNIV \<times> B

goal (1 subgoal):
 1. UNIV - UNIV \<times> B \<in> sets borel
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
UNIV \<times> (UNIV - B) \<in> sets borel

goal (2 subgoals):
 1. UNIV \<times> {} \<in> sets borel
 2. \<And>a. \<lbrakk>\<And>i. a i \<in> sigma_sets UNIV {S. open S}; \<And>i. UNIV \<times> a i \<in> sets borel\<rbrakk> \<Longrightarrow> UNIV \<times> \<Union> (range a) \<in> sets borel
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. UNIV \<times> {} \<in> sets borel
 2. \<And>a. \<lbrakk>\<And>i. a i \<in> sigma_sets UNIV {S. open S}; \<And>i. UNIV \<times> a i \<in> sets borel\<rbrakk> \<Longrightarrow> UNIV \<times> \<Union> (range a) \<in> sets borel
[PROOF STEP]
case (Union B)
[PROOF STATE]
proof (state)
this:
B ?i \<in> sigma_sets UNIV {S. open S}
UNIV \<times> B ?i \<in> sets borel

goal (2 subgoals):
 1. UNIV \<times> {} \<in> sets borel
 2. \<And>a. \<lbrakk>\<And>i. a i \<in> sigma_sets UNIV {S. open S}; \<And>i. UNIV \<times> a i \<in> sets borel\<rbrakk> \<Longrightarrow> UNIV \<times> \<Union> (range a) \<in> sets borel
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
B ?i \<in> sigma_sets UNIV {S. open S}
UNIV \<times> B ?i \<in> sets borel

goal (2 subgoals):
 1. UNIV \<times> {} \<in> sets borel
 2. \<And>a. \<lbrakk>\<And>i. a i \<in> sigma_sets UNIV {S. open S}; \<And>i. UNIV \<times> a i \<in> sets borel\<rbrakk> \<Longrightarrow> UNIV \<times> \<Union> (range a) \<in> sets borel
[PROOF STEP]
have *: "UNIV \<times> (\<Union>(B ` UNIV)) = \<Union>((\<lambda>i. UNIV \<times> B i) ` UNIV)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. UNIV \<times> \<Union> (range B) = (\<Union>i. UNIV \<times> B i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
UNIV \<times> \<Union> (range B) = (\<Union>i. UNIV \<times> B i)

goal (2 subgoals):
 1. UNIV \<times> {} \<in> sets borel
 2. \<And>a. \<lbrakk>\<And>i. a i \<in> sigma_sets UNIV {S. open S}; \<And>i. UNIV \<times> a i \<in> sets borel\<rbrakk> \<Longrightarrow> UNIV \<times> \<Union> (range a) \<in> sets borel
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
B ?i \<in> sigma_sets UNIV {S. open S}
UNIV \<times> B ?i \<in> sets borel
UNIV \<times> \<Union> (range B) = (\<Union>i. UNIV \<times> B i)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
B ?i \<in> sigma_sets UNIV {S. open S}
UNIV \<times> B ?i \<in> sets borel
UNIV \<times> \<Union> (range B) = (\<Union>i. UNIV \<times> B i)

goal (1 subgoal):
 1. UNIV \<times> \<Union> (range B) \<in> sets borel
[PROOF STEP]
unfolding *
[PROOF STATE]
proof (prove)
using this:
B ?i \<in> sigma_sets UNIV {S. open S}
UNIV \<times> B ?i \<in> sets borel
(\<Union>i. UNIV \<times> B i) = (\<Union>i. UNIV \<times> B i)

goal (1 subgoal):
 1. (\<Union>i. UNIV \<times> B i) \<in> sets borel
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
UNIV \<times> \<Union> (range B) \<in> sets borel

goal (1 subgoal):
 1. UNIV \<times> {} \<in> sets borel
[PROOF STEP]
qed simp
[PROOF STATE]
proof (state)
this:
UNIV \<times> B \<in> sets borel

goal (1 subgoal):
 1. A \<times> B \<in> sets borel
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
UNIV \<times> B \<in> sets borel

goal (1 subgoal):
 1. A \<times> B \<in> sets borel
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
A \<times> B = A \<times> UNIV \<inter> UNIV \<times> B
A \<times> UNIV \<in> sets borel
UNIV \<times> B \<in> sets borel
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
A \<times> B = A \<times> UNIV \<inter> UNIV \<times> B
A \<times> UNIV \<in> sets borel
UNIV \<times> B \<in> sets borel

goal (1 subgoal):
 1. A \<times> B \<in> sets borel
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A \<times> B \<in> sets borel

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma openin_subtopology_alt:
     "openin (subtopology X U) S \<longleftrightarrow> S \<in> (\<lambda>T. U \<inter> T) ` Collect (openin X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. openin (subtopology X U) S = (S \<in> (\<inter>) U ` Collect (openin X))
[PROOF STEP]
by (simp add: image_iff inf_commute openin_subtopology)


[STATEMENT]
lemma fpairwise_subset: "fpairwise P M \<Longrightarrow> N |\<subseteq>| M \<Longrightarrow> fpairwise P N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>fpairwise P M; N |\<subseteq>| M\<rbrakk> \<Longrightarrow> fpairwise P N
[PROOF STEP]
unfolding fpairwise_alt_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>fBall M (\<lambda>m. fBall M (P m)); N |\<subseteq>| M\<rbrakk> \<Longrightarrow> fBall N (\<lambda>m. fBall N (P m))
[PROOF STEP]
by auto


[STATEMENT]
lemma row_echelon_form_one_dim0[simp]: "row_echelon_form (1\<^sub>m 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row_echelon_form (1\<^sub>m 0)
[PROOF STEP]
unfolding row_echelon_form_def pivot_fun_def Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f. \<forall>i<dim_row (1\<^sub>m 0). f i \<le> dim_col (1\<^sub>m 0) \<and> (f i < dim_col (1\<^sub>m 0) \<longrightarrow> 1\<^sub>m 0 $$ (i, f i) = (1::'b) \<and> (\<forall>i'<dim_row (1\<^sub>m 0). i' \<noteq> i \<longrightarrow> 1\<^sub>m 0 $$ (i', f i) = (0::'b))) \<and> (\<forall>j<f i. 1\<^sub>m 0 $$ (i, j) = (0::'b)) \<and> (Suc i < dim_row (1\<^sub>m 0) \<longrightarrow> f i < f (Suc i) \<or> f (Suc i) = dim_col (1\<^sub>m 0))
[PROOF STEP]
by auto


[STATEMENT]
lemma "\<lbrakk> length p \<noteq> 0; abc_notfinal cf p \<rbrakk> \<Longrightarrow> \<not> abc_final cf p \<and> \<not> abc_out_of_prog cf p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length p \<noteq> 0; abc_notfinal cf p\<rbrakk> \<Longrightarrow> \<not> abc_final cf p \<and> \<not> abc_out_of_prog cf p
[PROOF STEP]
by (metis abc_final.simps abc_notfinal.elims(2) abc_out_of_prog.simps less_Suc_eq nat_neq_iff not_less_eq)


[STATEMENT]
lemma Bij_imp_funcset: "f \<in> Bij S \<Longrightarrow> f \<in> S \<rightarrow> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> Bij S \<Longrightarrow> f \<in> S \<rightarrow> S
[PROOF STEP]
by (auto simp add: Bij_def bij_betw_imp_funcset)


[STATEMENT]
lemma connected_component_overlap:
  "connected_component_set S a \<inter> connected_component_set S b \<noteq> {} \<longleftrightarrow>
    a \<in> S \<and> b \<in> S \<and> connected_component_set S a = connected_component_set S b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (connected_component_set S a \<inter> connected_component_set S b \<noteq> {}) = (a \<in> S \<and> b \<in> S \<and> connected_component_set S a = connected_component_set S b)
[PROOF STEP]
by (auto simp: connected_component_nonoverlap)


[STATEMENT]
lemma list_to_lpoly_coeff_nth:
  assumes "i < length cs "
  shows "coeff (list_to_lpoly cs) i = cs ! i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abstract_Linear_Poly.coeff (list_to_lpoly cs) i = cs ! i
[PROOF STEP]
using gr_implies_not0 rl_lpoly_coeff_nth_non_empty assms
[PROOF STATE]
proof (prove)
using this:
?m < ?n \<Longrightarrow> ?n \<noteq> 0
\<lbrakk>?i < length ?cs; ?cs \<noteq> []\<rbrakk> \<Longrightarrow> Abstract_Linear_Poly.coeff (list_to_lpoly ?cs) ?i = ?cs ! ?i
i < length cs

goal (1 subgoal):
 1. Abstract_Linear_Poly.coeff (list_to_lpoly cs) i = cs ! i
[PROOF STEP]
by fastforce


[STATEMENT]
lemma sqmatrix_add_assoc:
  "(A::('a::semigroup_add,'m) sqmatrix) + B + C = A + (B + C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A + B + C = A + (B + C)
[PROOF STEP]
by (cases A, cases B, cases C, simp add: add.assoc)


[STATEMENT]
lemma (in group) l_coset_subset_G:
  "\<lbrakk> H \<subseteq> carrier G; x \<in> carrier G \<rbrakk> \<Longrightarrow> x <# H \<subseteq> carrier G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>H \<subseteq> carrier G; x \<in> carrier G\<rbrakk> \<Longrightarrow> x <# H \<subseteq> carrier G
[PROOF STEP]
by (auto simp add: l_coset_def subsetD)


[STATEMENT]
lemma field_vector_diff_chain_at:  (*thanks to Wenda Li*)
 assumes Df: "(f has_vector_derivative f') (at x)"
     and Dg: "(g has_field_derivative g') (at (f x))"
 shows "((g \<circ> f) has_vector_derivative (f' * g')) (at x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g \<circ> f has_vector_derivative f' * g') (at x)
[PROOF STEP]
using diff_chain_at[OF Df[unfolded has_vector_derivative_def]
                       Dg [unfolded has_field_derivative_def]]
[PROOF STATE]
proof (prove)
using this:
(g \<circ> f has_derivative (*) g' \<circ> (\<lambda>x. x *\<^sub>R f')) (at x)

goal (1 subgoal):
 1. (g \<circ> f has_vector_derivative f' * g') (at x)
[PROOF STEP]
by (auto simp: o_def mult.commute has_vector_derivative_def)


[STATEMENT]
lemma wf_ordertype_eqpoll:
  assumes "wf r" "total_on A r" "small A"
  shows "elts (ordertype A r) \<approx> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. elts (ordertype A r) \<approx> A
[PROOF STEP]
using assms eqpoll_def eqpoll_sym ordermap_bij
[PROOF STATE]
proof (prove)
using this:
wf r
total_on A r
small A
?A \<approx> ?B \<equiv> \<exists>f. bij_betw f ?A ?B
?A \<approx> ?B \<Longrightarrow> ?B \<approx> ?A
\<lbrakk>wf ?r; total_on ?A ?r; small ?A\<rbrakk> \<Longrightarrow> bij_betw (ordermap ?A ?r) ?A (elts (ordertype ?A ?r))

goal (1 subgoal):
 1. elts (ordertype A r) \<approx> A
[PROOF STEP]
by blast


[STATEMENT]
lemma measurable_iff_sets:
  "f \<in> measurable M N \<longleftrightarrow> (f \<in> space M \<rightarrow> space N \<and> sets (vimage_algebra (space M) f N) \<subseteq> sets M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<in> M \<rightarrow>\<^sub>M N) = (f \<in> space M \<rightarrow> space N \<and> sets (vimage_algebra (space M) f N) \<subseteq> sets M)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (f \<in> M \<rightarrow>\<^sub>M N) = (f \<in> space M \<rightarrow> space N \<and> sets (vimage_algebra (space M) f N) \<subseteq> sets M)
[PROOF STEP]
have *: "{f -` A \<inter> space M |A. A \<in> sets N} \<subseteq> Pow (space M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {f -` A \<inter> space M |A. A \<in> sets N} \<subseteq> Pow (space M)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{f -` A \<inter> space M |A. A \<in> sets N} \<subseteq> Pow (space M)

goal (1 subgoal):
 1. (f \<in> M \<rightarrow>\<^sub>M N) = (f \<in> space M \<rightarrow> space N \<and> sets (vimage_algebra (space M) f N) \<subseteq> sets M)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<in> M \<rightarrow>\<^sub>M N) = (f \<in> space M \<rightarrow> space N \<and> sets (vimage_algebra (space M) f N) \<subseteq> sets M)
[PROOF STEP]
unfolding measurable_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<in> {f \<in> space M \<rightarrow> space N. \<forall>y\<in>sets N. f -` y \<inter> space M \<in> sets M}) = (f \<in> space M \<rightarrow> space N \<and> sets (vimage_algebra (space M) f N) \<subseteq> sets M)
[PROOF STEP]
by (auto simp add: vimage_algebra_def sigma_le_sets[OF *])
[PROOF STATE]
proof (state)
this:
(f \<in> M \<rightarrow>\<^sub>M N) = (f \<in> space M \<rightarrow> space N \<and> sets (vimage_algebra (space M) f N) \<subseteq> sets M)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma LIM_cnj: "f \<midarrow>a\<rightarrow> L \<Longrightarrow> (\<lambda>x. cnj (f x)) \<midarrow>a\<rightarrow> cnj L"
  for f :: "'a::real_normed_vector \<Rightarrow> complex"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<midarrow>a\<rightarrow> L \<Longrightarrow> (\<lambda>x. cnj (f x)) \<midarrow>a\<rightarrow> cnj L
[PROOF STEP]
by (simp add: LIM_eq complex_cnj_diff [symmetric] del: complex_cnj_diff)


[STATEMENT]
lemma (in \<Z>) cf_dag_Rel_is_iso_functor'[cat_cs_intros]:
  assumes "\<AA>' = op_cat (cat_Rel \<alpha>)"
    and "\<BB>' = cat_Rel \<alpha>"
    and "\<alpha>' = \<alpha>"
  shows "\<dagger>\<^sub>C\<^sub>.\<^sub>R\<^sub>e\<^sub>l \<alpha> : \<AA>' \<mapsto>\<mapsto>\<^sub>C\<^sub>.\<^sub>i\<^sub>s\<^sub>o\<^bsub>\<alpha>'\<^esub> \<BB>'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<dagger>\<^sub>C\<^sub>.\<^sub>R\<^sub>e\<^sub>l \<alpha> : \<AA>' \<mapsto>\<mapsto>\<^sub>C\<^sub>.\<^sub>i\<^sub>s\<^sub>o\<^bsub>\<alpha>'\<^esub> \<BB>'
[PROOF STEP]
unfolding assms
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<dagger>\<^sub>C\<^sub>.\<^sub>R\<^sub>e\<^sub>l \<alpha> : op_cat (cat_Rel \<alpha>) \<mapsto>\<mapsto>\<^sub>C\<^sub>.\<^sub>i\<^sub>s\<^sub>o\<^bsub>\<alpha>\<^esub> cat_Rel \<alpha>
[PROOF STEP]
by (rule cf_dag_Rel_is_iso_functor)


[STATEMENT]
lemma lub_insert[simp]:
  fixes x :: "'a :: Join_cpo"
  shows "lub (insert x S) = x \<squnion> lub S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lub (insert x S) = x \<squnion> lub S
[PROOF STEP]
by (rule lub_eqI) (auto intro: below_trans[OF _ join_above2] simp add: join_below_iff is_ub_def is_lub_def)


[STATEMENT]
lemma sum_if_distrib_add: "finite A \<Longrightarrow> b \<in> A \<Longrightarrow> (\<Sum>a\<in>A. if a=b then X b + Y a else X a) = (\<Sum>a\<in>A. X a) + Y b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; b \<in> A\<rbrakk> \<Longrightarrow> (\<Sum>a\<in>A. if a = b then X b + Y a else X a) = sum X A + Y b
[PROOF STEP]
by (simp add: Sum_eq_pick_changed_elem)


[STATEMENT]
lemma a0[arith]: "a>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < a
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < a
[PROOF STEP]
have "1/(c - 1) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < 1 / (c - 1)
[PROOF STEP]
using ac
[PROOF STATE]
proof (prove)
using this:
1 / (c - 1) \<le> a

goal (1 subgoal):
 1. 0 < 1 / (c - 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < 1 / (c - 1)

goal (1 subgoal):
 1. 0 < a
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < 1 / (c - 1)

goal (1 subgoal):
 1. 0 < a
[PROOF STEP]
by (metis ac dual_order.strict_trans1)
[PROOF STATE]
proof (state)
this:
0 < a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma SA_poly_to_Qp_poly_mult:
  assumes "a \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)"
  assumes "f \<in> carrier (UP (SA n))"
  assumes "g \<in> carrier (UP (SA n))"
  shows "SA_poly_to_Qp_poly n a (f \<otimes>\<^bsub>UP (SA n)\<^esub> g) = SA_poly_to_Qp_poly n a f \<otimes>\<^bsub>Q\<^sub>p_x\<^esub> SA_poly_to_Qp_poly n a g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SA_poly_to_Qp_poly n a (f \<otimes>\<^bsub>UP (SA n)\<^esub> g) = SA_poly_to_Qp_poly n a f \<otimes>\<^bsub>UP Q\<^sub>p\<^esub> SA_poly_to_Qp_poly n a g
[PROOF STEP]
using SA_poly_to_Qp_poly_is_hom ring_hom_mult assms
[PROOF STATE]
proof (prove)
using this:
?a \<in> carrier (Q\<^sub>p\<^bsup>?n\<^esup>) \<Longrightarrow> SA_poly_to_Qp_poly ?n ?a \<in> ring_hom (UP (SA ?n)) (UP Q\<^sub>p)
\<lbrakk>?h \<in> ring_hom ?R ?S; ?x \<in> carrier ?R; ?y \<in> carrier ?R\<rbrakk> \<Longrightarrow> ?h (?x \<otimes>\<^bsub>?R\<^esub> ?y) = ?h ?x \<otimes>\<^bsub>?S\<^esub> ?h ?y
a \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)
f \<in> carrier (UP (SA n))
g \<in> carrier (UP (SA n))

goal (1 subgoal):
 1. SA_poly_to_Qp_poly n a (f \<otimes>\<^bsub>UP (SA n)\<^esub> g) = SA_poly_to_Qp_poly n a f \<otimes>\<^bsub>UP Q\<^sub>p\<^esub> SA_poly_to_Qp_poly n a g
[PROOF STEP]
by (metis (no_types, opaque_lifting))


[STATEMENT]
lemma ev4:
  assumes g: "negl g"
  shows   "eventually (\<lambda>x. ln (b*x) powr (-e/2) - ln x powr (-e/2) \<ge> g x) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. g x \<le> ln (b * x) powr (- e / 2) - ln x powr (- e / 2)
[PROOF STEP]
proof (rule smallo_imp_le_real)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. g \<in> o(\<lambda>x. ln (b * x) powr (- e / 2) - ln x powr (- e / 2))
 2. \<forall>\<^sub>F x in at_top. 0 \<le> ln (b * x) powr (- e / 2) - ln x powr (- e / 2)
[PROOF STEP]
define h1 where [abs_def]:
    "h1 x = (1 + ln b/ln x) powr (-e/2) - 1 + e/2 * (ln b/ln x)" for x
[PROOF STATE]
proof (state)
this:
h1 \<equiv> \<lambda>x. (1 + ln b / ln x) powr (- e / 2) - 1 + e / 2 * (ln b / ln x)

goal (2 subgoals):
 1. g \<in> o(\<lambda>x. ln (b * x) powr (- e / 2) - ln x powr (- e / 2))
 2. \<forall>\<^sub>F x in at_top. 0 \<le> ln (b * x) powr (- e / 2) - ln x powr (- e / 2)
[PROOF STEP]
define h2 where [abs_def]:
    "h2 x = ln x powr (- e / 2) * ((1 + ln b / ln x) powr (- e / 2) - 1)" for x
[PROOF STATE]
proof (state)
this:
h2 \<equiv> \<lambda>x. ln x powr (- e / 2) * ((1 + ln b / ln x) powr (- e / 2) - 1)

goal (2 subgoals):
 1. g \<in> o(\<lambda>x. ln (b * x) powr (- e / 2) - ln x powr (- e / 2))
 2. \<forall>\<^sub>F x in at_top. 0 \<le> ln (b * x) powr (- e / 2) - ln x powr (- e / 2)
[PROOF STEP]
from bep
[PROOF STATE]
proof (chain)
picking this:
0 < b
b < 1
0 < e
0 < hb
[PROOF STEP]
have "((\<lambda>x. ln b / ln x) \<longlongrightarrow> 0) at_top"
[PROOF STATE]
proof (prove)
using this:
0 < b
b < 1
0 < e
0 < hb

goal (1 subgoal):
 1. ((\<lambda>x. ln b / ln x) \<longlongrightarrow> 0) at_top
[PROOF STEP]
by (simp add: tendsto_0_smallo_1)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. ln b / ln x) \<longlongrightarrow> 0) at_top

goal (2 subgoals):
 1. g \<in> o(\<lambda>x. ln (b * x) powr (- e / 2) - ln x powr (- e / 2))
 2. \<forall>\<^sub>F x in at_top. 0 \<le> ln (b * x) powr (- e / 2) - ln x powr (- e / 2)
[PROOF STEP]
note one_plus_x_powr_Taylor2_bigo[OF this, of "-e/2"]
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (1 + ln b / ln x) powr (- e / 2) - 1 - - e / 2 * (ln b / ln x)) \<in> O(\<lambda>x. (ln b / ln x)\<^sup>2)

goal (2 subgoals):
 1. g \<in> o(\<lambda>x. ln (b * x) powr (- e / 2) - ln x powr (- e / 2))
 2. \<forall>\<^sub>F x in at_top. 0 \<le> ln (b * x) powr (- e / 2) - ln x powr (- e / 2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (1 + ln b / ln x) powr (- e / 2) - 1 - - e / 2 * (ln b / ln x)) \<in> O(\<lambda>x. (ln b / ln x)\<^sup>2)

goal (2 subgoals):
 1. g \<in> o(\<lambda>x. ln (b * x) powr (- e / 2) - ln x powr (- e / 2))
 2. \<forall>\<^sub>F x in at_top. 0 \<le> ln (b * x) powr (- e / 2) - ln x powr (- e / 2)
[PROOF STEP]
have "(\<lambda>x. (1 + ln b / ln x) powr (- e / 2) - 1 - - e / 2 * (ln b / ln x)) = h1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. (1 + ln b / ln x) powr (- e / 2) - 1 - - e / 2 * (ln b / ln x)) = h1
[PROOF STEP]
by (simp add: h1_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (1 + ln b / ln x) powr (- e / 2) - 1 - - e / 2 * (ln b / ln x)) = h1

goal (2 subgoals):
 1. g \<in> o(\<lambda>x. ln (b * x) powr (- e / 2) - ln x powr (- e / 2))
 2. \<forall>\<^sub>F x in at_top. 0 \<le> ln (b * x) powr (- e / 2) - ln x powr (- e / 2)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
h1 \<in> O(\<lambda>x. (ln b / ln x)\<^sup>2)
[PROOF STEP]
have "h1 \<in> o(\<lambda>x. 1 / ln x)"
[PROOF STATE]
proof (prove)
using this:
h1 \<in> O(\<lambda>x. (ln b / ln x)\<^sup>2)

goal (1 subgoal):
 1. h1 \<in> o(\<lambda>x. 1 / ln x)
[PROOF STEP]
by (rule landau_o.big_small_trans) (insert bep, simp add: power2_eq_square)
[PROOF STATE]
proof (state)
this:
h1 \<in> o(\<lambda>x. 1 / ln x)

goal (2 subgoals):
 1. g \<in> o(\<lambda>x. ln (b * x) powr (- e / 2) - ln x powr (- e / 2))
 2. \<forall>\<^sub>F x in at_top. 0 \<le> ln (b * x) powr (- e / 2) - ln x powr (- e / 2)
[PROOF STEP]
with bep
[PROOF STATE]
proof (chain)
picking this:
0 < b
b < 1
0 < e
0 < hb
h1 \<in> o(\<lambda>x. 1 / ln x)
[PROOF STEP]
have "(\<lambda>x. h1 x - e/2 * (ln b / ln x)) \<in> \<Theta>(\<lambda>x. 1 / ln x)"
[PROOF STATE]
proof (prove)
using this:
0 < b
b < 1
0 < e
0 < hb
h1 \<in> o(\<lambda>x. 1 / ln x)

goal (1 subgoal):
 1. (\<lambda>x. h1 x - e / 2 * (ln b / ln x)) \<in> \<Theta>(\<lambda>x. 1 / ln x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>x. h1 x - e / 2 * (ln b / ln x)) \<in> \<Theta>(\<lambda>x. 1 / ln x)

goal (2 subgoals):
 1. g \<in> o(\<lambda>x. ln (b * x) powr (- e / 2) - ln x powr (- e / 2))
 2. \<forall>\<^sub>F x in at_top. 0 \<le> ln (b * x) powr (- e / 2) - ln x powr (- e / 2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>x. h1 x - e / 2 * (ln b / ln x)) \<in> \<Theta>(\<lambda>x. 1 / ln x)

goal (2 subgoals):
 1. g \<in> o(\<lambda>x. ln (b * x) powr (- e / 2) - ln x powr (- e / 2))
 2. \<forall>\<^sub>F x in at_top. 0 \<le> ln (b * x) powr (- e / 2) - ln x powr (- e / 2)
[PROOF STEP]
have "(\<lambda>x. h1 x - e/2 * (ln b/ln x)) = (\<lambda>x. (1 + ln b/ ln x) powr (-e/2) - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. h1 x - e / 2 * (ln b / ln x)) = (\<lambda>x. (1 + ln b / ln x) powr (- e / 2) - 1)
[PROOF STEP]
by (rule ext) (simp add: h1_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. h1 x - e / 2 * (ln b / ln x)) = (\<lambda>x. (1 + ln b / ln x) powr (- e / 2) - 1)

goal (2 subgoals):
 1. g \<in> o(\<lambda>x. ln (b * x) powr (- e / 2) - ln x powr (- e / 2))
 2. \<forall>\<^sub>F x in at_top. 0 \<le> ln (b * x) powr (- e / 2) - ln x powr (- e / 2)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. (1 + ln b / ln x) powr (- e / 2) - 1) \<in> \<Theta>(\<lambda>x. 1 / ln x)
[PROOF STEP]
have "h2 \<in> \<Theta>(\<lambda>x. ln x powr (-e/2) * (1 / ln x))"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. (1 + ln b / ln x) powr (- e / 2) - 1) \<in> \<Theta>(\<lambda>x. 1 / ln x)

goal (1 subgoal):
 1. h2 \<in> \<Theta>(\<lambda>x. ln x powr (- e / 2) * (1 / ln x))
[PROOF STEP]
unfolding h2_def
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. (1 + ln b / ln x) powr (- e / 2) - 1) \<in> \<Theta>(\<lambda>x. 1 / ln x)

goal (1 subgoal):
 1. (\<lambda>x. ln x powr (- e / 2) * ((1 + ln b / ln x) powr (- e / 2) - 1)) \<in> \<Theta>(\<lambda>x. ln x powr (- e / 2) * (1 / ln x))
[PROOF STEP]
by (intro landau_theta.mult) simp_all
[PROOF STATE]
proof (state)
this:
h2 \<in> \<Theta>(\<lambda>x. ln x powr (- e / 2) * (1 / ln x))

goal (2 subgoals):
 1. g \<in> o(\<lambda>x. ln (b * x) powr (- e / 2) - ln x powr (- e / 2))
 2. \<forall>\<^sub>F x in at_top. 0 \<le> ln (b * x) powr (- e / 2) - ln x powr (- e / 2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
h2 \<in> \<Theta>(\<lambda>x. ln x powr (- e / 2) * (1 / ln x))

goal (2 subgoals):
 1. g \<in> o(\<lambda>x. ln (b * x) powr (- e / 2) - ln x powr (- e / 2))
 2. \<forall>\<^sub>F x in at_top. 0 \<le> ln (b * x) powr (- e / 2) - ln x powr (- e / 2)
[PROOF STEP]
have "(\<lambda>x. ln x powr (-e/2) * (1 / ln x)) \<in> \<Theta>(\<lambda>x. ln x powr (-(e/2+1)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. ln x powr (- e / 2) * (1 / ln x)) \<in> \<Theta>(\<lambda>x. ln x powr - (e / 2 + 1))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>x. ln x powr (- e / 2) * (1 / ln x)) \<in> \<Theta>(\<lambda>x. ln x powr - (e / 2 + 1))

goal (2 subgoals):
 1. g \<in> o(\<lambda>x. ln (b * x) powr (- e / 2) - ln x powr (- e / 2))
 2. \<forall>\<^sub>F x in at_top. 0 \<le> ln (b * x) powr (- e / 2) - ln x powr (- e / 2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>x. ln x powr (- e / 2) * (1 / ln x)) \<in> \<Theta>(\<lambda>x. ln x powr - (e / 2 + 1))

goal (2 subgoals):
 1. g \<in> o(\<lambda>x. ln (b * x) powr (- e / 2) - ln x powr (- e / 2))
 2. \<forall>\<^sub>F x in at_top. 0 \<le> ln (b * x) powr (- e / 2) - ln x powr (- e / 2)
[PROOF STEP]
from g bep
[PROOF STATE]
proof (chain)
picking this:
g \<in> o(\<lambda>x. ln (b * x) powr - (e / 2 + 1))
0 < b
b < 1
0 < e
0 < hb
[PROOF STEP]
have "(\<lambda>x. ln x powr (-(e/2+1))) \<in> \<omega>(g)"
[PROOF STATE]
proof (prove)
using this:
g \<in> o(\<lambda>x. ln (b * x) powr - (e / 2 + 1))
0 < b
b < 1
0 < e
0 < hb

goal (1 subgoal):
 1. (\<lambda>x. ln x powr - (e / 2 + 1)) \<in> \<omega>(g)
[PROOF STEP]
by (simp add: smallomega_iff_smallo)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. ln x powr - (e / 2 + 1)) \<in> \<omega>(g)

goal (2 subgoals):
 1. g \<in> o(\<lambda>x. ln (b * x) powr (- e / 2) - ln x powr (- e / 2))
 2. \<forall>\<^sub>F x in at_top. 0 \<le> ln (b * x) powr (- e / 2) - ln x powr (- e / 2)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
h2 \<in> \<omega>(g)
[PROOF STEP]
have "g \<in> o(h2)"
[PROOF STATE]
proof (prove)
using this:
h2 \<in> \<omega>(g)

goal (1 subgoal):
 1. g \<in> o(h2)
[PROOF STEP]
by (simp add: smallomega_iff_smallo)
[PROOF STATE]
proof (state)
this:
g \<in> o(h2)

goal (2 subgoals):
 1. g \<in> o(\<lambda>x. ln (b * x) powr (- e / 2) - ln x powr (- e / 2))
 2. \<forall>\<^sub>F x in at_top. 0 \<le> ln (b * x) powr (- e / 2) - ln x powr (- e / 2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
g \<in> o(h2)

goal (2 subgoals):
 1. g \<in> o(\<lambda>x. ln (b * x) powr (- e / 2) - ln x powr (- e / 2))
 2. \<forall>\<^sub>F x in at_top. 0 \<le> ln (b * x) powr (- e / 2) - ln x powr (- e / 2)
[PROOF STEP]
have "eventually (\<lambda>x. h2 x = ln (b*x) powr (-e/2) - ln x powr (-e/2)) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. h2 x = ln (b * x) powr (- e / 2) - ln x powr (- e / 2)
[PROOF STEP]
using eventually_gt_at_top[of "1::real"] eventually_gt_at_top[of "1/b"]
[PROOF STATE]
proof (prove)
using this:
eventually ((<) 1) at_top
eventually ((<) (1 / b)) at_top

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. h2 x = ln (b * x) powr (- e / 2) - ln x powr (- e / 2)
[PROOF STEP]
by eventually_elim (insert bep, simp add: field_simps powr_diff [symmetric]  h2_def
                                      ln_mult [symmetric] powr_divide del: ln_mult)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. h2 x = ln (b * x) powr (- e / 2) - ln x powr (- e / 2)

goal (2 subgoals):
 1. g \<in> o(\<lambda>x. ln (b * x) powr (- e / 2) - ln x powr (- e / 2))
 2. \<forall>\<^sub>F x in at_top. 0 \<le> ln (b * x) powr (- e / 2) - ln x powr (- e / 2)
[PROOF STEP]
hence "h2 \<in> \<Theta>(\<lambda>x. ln (b*x) powr (-e/2) - ln x powr (-e/2))"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. h2 x = ln (b * x) powr (- e / 2) - ln x powr (- e / 2)

goal (1 subgoal):
 1. h2 \<in> \<Theta>(\<lambda>x. ln (b * x) powr (- e / 2) - ln x powr (- e / 2))
[PROOF STEP]
by (rule bigthetaI_cong)
[PROOF STATE]
proof (state)
this:
h2 \<in> \<Theta>(\<lambda>x. ln (b * x) powr (- e / 2) - ln x powr (- e / 2))

goal (2 subgoals):
 1. g \<in> o(\<lambda>x. ln (b * x) powr (- e / 2) - ln x powr (- e / 2))
 2. \<forall>\<^sub>F x in at_top. 0 \<le> ln (b * x) powr (- e / 2) - ln x powr (- e / 2)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
g \<in> o(\<lambda>x. ln (b * x) powr (- e / 2) - ln x powr (- e / 2))
[PROOF STEP]
show "g \<in> o(\<lambda>x. ln (b * x) powr (- e / 2) - ln x powr (- e / 2))"
[PROOF STATE]
proof (prove)
using this:
g \<in> o(\<lambda>x. ln (b * x) powr (- e / 2) - ln x powr (- e / 2))

goal (1 subgoal):
 1. g \<in> o(\<lambda>x. ln (b * x) powr (- e / 2) - ln x powr (- e / 2))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
g \<in> o(\<lambda>x. ln (b * x) powr (- e / 2) - ln x powr (- e / 2))

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. 0 \<le> ln (b * x) powr (- e / 2) - ln x powr (- e / 2)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. 0 \<le> ln (b * x) powr (- e / 2) - ln x powr (- e / 2)
[PROOF STEP]
show "eventually (\<lambda>x. ln (b*x) powr (-e/2) - ln x powr (-e/2) \<ge> 0) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. 0 \<le> ln (b * x) powr (- e / 2) - ln x powr (- e / 2)
[PROOF STEP]
using eventually_gt_at_top[of "1/b"] eventually_gt_at_top[of "1::real"]
[PROOF STATE]
proof (prove)
using this:
eventually ((<) (1 / b)) at_top
eventually ((<) 1) at_top

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. 0 \<le> ln (b * x) powr (- e / 2) - ln x powr (- e / 2)
[PROOF STEP]
by eventually_elim (insert bep, auto intro!: powr_mono2' simp: field_simps simp del: ln_mult)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. 0 \<le> ln (b * x) powr (- e / 2) - ln x powr (- e / 2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma row_transpose: "row (transpose M) i = col M i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Square_Matrix.row (Square_Matrix.transpose M) i = col M i
[PROOF STEP]
by transfer simp


[STATEMENT]
lemma eval_tm_upper_bound: "eval_tm \<AA> is \<le> (2 ^ Length \<AA> - 1) * sum_list [i. i \<leftarrow> is, i > 0]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_tm \<AA> is \<le> (2 ^ Length \<AA> - 1) * sum_list (concat (map (\<lambda>i. if 0 < i then [i] else []) is))
[PROOF STEP]
by transfer (auto simp: scalar_product_upper_bound)


[STATEMENT]
lemma eeqButPID_F_toEq:
assumes "eeqButPID_F sw sw1"
shows "sw (PID := map (\<lambda> (aID,_). (aID,b)) (sw PID)) =
       sw1 (PID := map (\<lambda> (aID,_). (aID,b)) (sw1 PID))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sw(PID := map (\<lambda>(aID, uu_). (aID, b)) (sw PID)) = sw1(PID := map (\<lambda>(aID, uu_). (aID, b)) (sw1 PID))
[PROOF STEP]
using length_map eeqButPID_F_eqButF[OF assms] eeqButPID_F_not_PID[OF assms]
[PROOF STATE]
proof (prove)
using this:
length (map ?f ?xs) = length ?xs
eqButF (sw PID) (sw1 PID)
?pid \<noteq> PID \<Longrightarrow> sw ?pid = sw1 ?pid

goal (1 subgoal):
 1. sw(PID := map (\<lambda>(aID, uu_). (aID, b)) (sw PID)) = sw1(PID := map (\<lambda>(aID, uu_). (aID, b)) (sw1 PID))
[PROOF STEP]
apply(auto simp: o_def split_def map_replicate_const intro!: map_prod_cong ext)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>map fst (sw PID) = map fst (sw1 PID); \<And>pid. pid \<noteq> PID \<Longrightarrow> sw pid = sw1 pid\<rbrakk> \<Longrightarrow> length (sw PID) = length (sw1 PID)
[PROOF STEP]
by (metis length_map)


[STATEMENT]
lemma map_to_set_upd[simp]: "map_to_set (m (k \<mapsto> v)) = insert (k, v) (map_to_set m - {(k, v') |v'. True})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_to_set (m(k \<mapsto> v)) = insert (k, v) (map_to_set m - {(k, v') |v'. True})
[PROOF STEP]
unfolding map_to_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(ka, va). (m(k \<mapsto> v)) ka = Some va} = insert (k, v) ({(k, v). m k = Some v} - {(k, v') |v'. True})
[PROOF STEP]
apply (simp add: set_eq_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>b. (v = b) = (b = v)
[PROOF STEP]
apply metis
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma inj_imp_image_group_iso:
  assumes "inj_on f (carrier G)" shows "f \<in> iso G (image_group f G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> Group.iso G (image_group f G)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
inj_on f (carrier G)

goal (1 subgoal):
 1. f \<in> Group.iso G (image_group f G)
[PROOF STEP]
by (auto simp add: image_group_def iso_def bij_betw_def hom_def)