[STATEMENT]
lemma nat_helper1:
  assumes ass: "nat_to_bv (bv_to_nat w) = norm_unsigned w"
  shows        "nat_to_bv (2 * bv_to_nat w + bitval x) = norm_unsigned (w @ [x])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat_to_bv (2 * bv_to_nat w + bitval x) = norm_unsigned (w @ [x])
[PROOF STEP]
proof (cases x)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x = \<zero> \<Longrightarrow> nat_to_bv (2 * bv_to_nat w + bitval x) = norm_unsigned (w @ [x])
 2. x = \<one> \<Longrightarrow> nat_to_bv (2 * bv_to_nat w + bitval x) = norm_unsigned (w @ [x])
[PROOF STEP]
assume [simp]: "x = \<one>"
[PROOF STATE]
proof (state)
this:
x = \<one>

goal (2 subgoals):
 1. x = \<zero> \<Longrightarrow> nat_to_bv (2 * bv_to_nat w + bitval x) = norm_unsigned (w @ [x])
 2. x = \<one> \<Longrightarrow> nat_to_bv (2 * bv_to_nat w + bitval x) = norm_unsigned (w @ [x])
[PROOF STEP]
have "nat_to_bv (Suc (2 * bv_to_nat w) div 2) @ [\<one>] =
      nat_to_bv ((1 + 2 * bv_to_nat w) div 2) @ [\<one>]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat_to_bv (Suc (2 * bv_to_nat w) div 2) @ [\<one>] = nat_to_bv ((1 + 2 * bv_to_nat w) div 2) @ [\<one>]
[PROOF STEP]
by (simp add: add.commute)
[PROOF STATE]
proof (state)
this:
nat_to_bv (Suc (2 * bv_to_nat w) div 2) @ [\<one>] = nat_to_bv ((1 + 2 * bv_to_nat w) div 2) @ [\<one>]

goal (2 subgoals):
 1. x = \<zero> \<Longrightarrow> nat_to_bv (2 * bv_to_nat w + bitval x) = norm_unsigned (w @ [x])
 2. x = \<one> \<Longrightarrow> nat_to_bv (2 * bv_to_nat w + bitval x) = norm_unsigned (w @ [x])
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
nat_to_bv (Suc (2 * bv_to_nat w) div 2) @ [\<one>] = nat_to_bv ((1 + 2 * bv_to_nat w) div 2) @ [\<one>]

goal (2 subgoals):
 1. x = \<zero> \<Longrightarrow> nat_to_bv (2 * bv_to_nat w + bitval x) = norm_unsigned (w @ [x])
 2. x = \<one> \<Longrightarrow> nat_to_bv (2 * bv_to_nat w + bitval x) = norm_unsigned (w @ [x])
[PROOF STEP]
have "... = nat_to_bv (bv_to_nat w) @ [\<one>]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat_to_bv ((1 + 2 * bv_to_nat w) div 2) @ [\<one>] = nat_to_bv (bv_to_nat w) @ [\<one>]
[PROOF STEP]
by (subst div_add1_eq) simp
[PROOF STATE]
proof (state)
this:
nat_to_bv ((1 + 2 * bv_to_nat w) div 2) @ [\<one>] = nat_to_bv (bv_to_nat w) @ [\<one>]

goal (2 subgoals):
 1. x = \<zero> \<Longrightarrow> nat_to_bv (2 * bv_to_nat w + bitval x) = norm_unsigned (w @ [x])
 2. x = \<one> \<Longrightarrow> nat_to_bv (2 * bv_to_nat w + bitval x) = norm_unsigned (w @ [x])
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
nat_to_bv ((1 + 2 * bv_to_nat w) div 2) @ [\<one>] = nat_to_bv (bv_to_nat w) @ [\<one>]

goal (2 subgoals):
 1. x = \<zero> \<Longrightarrow> nat_to_bv (2 * bv_to_nat w + bitval x) = norm_unsigned (w @ [x])
 2. x = \<one> \<Longrightarrow> nat_to_bv (2 * bv_to_nat w + bitval x) = norm_unsigned (w @ [x])
[PROOF STEP]
have "... = norm_unsigned w @ [\<one>]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat_to_bv (bv_to_nat w) @ [\<one>] = norm_unsigned w @ [\<one>]
[PROOF STEP]
by (subst ass) (rule refl)
[PROOF STATE]
proof (state)
this:
nat_to_bv (bv_to_nat w) @ [\<one>] = norm_unsigned w @ [\<one>]

goal (2 subgoals):
 1. x = \<zero> \<Longrightarrow> nat_to_bv (2 * bv_to_nat w + bitval x) = norm_unsigned (w @ [x])
 2. x = \<one> \<Longrightarrow> nat_to_bv (2 * bv_to_nat w + bitval x) = norm_unsigned (w @ [x])
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
nat_to_bv (bv_to_nat w) @ [\<one>] = norm_unsigned w @ [\<one>]

goal (2 subgoals):
 1. x = \<zero> \<Longrightarrow> nat_to_bv (2 * bv_to_nat w + bitval x) = norm_unsigned (w @ [x])
 2. x = \<one> \<Longrightarrow> nat_to_bv (2 * bv_to_nat w + bitval x) = norm_unsigned (w @ [x])
[PROOF STEP]
have "... = norm_unsigned (w @ [\<one>])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm_unsigned w @ [\<one>] = norm_unsigned (w @ [\<one>])
[PROOF STEP]
by (cases "norm_unsigned w") simp_all
[PROOF STATE]
proof (state)
this:
norm_unsigned w @ [\<one>] = norm_unsigned (w @ [\<one>])

goal (2 subgoals):
 1. x = \<zero> \<Longrightarrow> nat_to_bv (2 * bv_to_nat w + bitval x) = norm_unsigned (w @ [x])
 2. x = \<one> \<Longrightarrow> nat_to_bv (2 * bv_to_nat w + bitval x) = norm_unsigned (w @ [x])
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
nat_to_bv (Suc (2 * bv_to_nat w) div 2) @ [\<one>] = norm_unsigned (w @ [\<one>])
[PROOF STEP]
have "nat_to_bv (Suc (2 * bv_to_nat w) div 2) @ [\<one>] = norm_unsigned (w @ [\<one>])"
[PROOF STATE]
proof (prove)
using this:
nat_to_bv (Suc (2 * bv_to_nat w) div 2) @ [\<one>] = norm_unsigned (w @ [\<one>])

goal (1 subgoal):
 1. nat_to_bv (Suc (2 * bv_to_nat w) div 2) @ [\<one>] = norm_unsigned (w @ [\<one>])
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
nat_to_bv (Suc (2 * bv_to_nat w) div 2) @ [\<one>] = norm_unsigned (w @ [\<one>])

goal (2 subgoals):
 1. x = \<zero> \<Longrightarrow> nat_to_bv (2 * bv_to_nat w + bitval x) = norm_unsigned (w @ [x])
 2. x = \<one> \<Longrightarrow> nat_to_bv (2 * bv_to_nat w + bitval x) = norm_unsigned (w @ [x])
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
nat_to_bv (Suc (2 * bv_to_nat w) div 2) @ [\<one>] = norm_unsigned (w @ [\<one>])
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
nat_to_bv (Suc (2 * bv_to_nat w) div 2) @ [\<one>] = norm_unsigned (w @ [\<one>])

goal (1 subgoal):
 1. nat_to_bv (2 * bv_to_nat w + bitval x) = norm_unsigned (w @ [x])
[PROOF STEP]
by (simp add: nat_to_bv_non0)
[PROOF STATE]
proof (state)
this:
nat_to_bv (2 * bv_to_nat w + bitval x) = norm_unsigned (w @ [x])

goal (1 subgoal):
 1. x = \<zero> \<Longrightarrow> nat_to_bv (2 * bv_to_nat w + bitval x) = norm_unsigned (w @ [x])
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x = \<zero> \<Longrightarrow> nat_to_bv (2 * bv_to_nat w + bitval x) = norm_unsigned (w @ [x])
[PROOF STEP]
assume [simp]: "x = \<zero>"
[PROOF STATE]
proof (state)
this:
x = \<zero>

goal (1 subgoal):
 1. x = \<zero> \<Longrightarrow> nat_to_bv (2 * bv_to_nat w + bitval x) = norm_unsigned (w @ [x])
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat_to_bv (2 * bv_to_nat w + bitval x) = norm_unsigned (w @ [x])
[PROOF STEP]
proof (cases "bv_to_nat w = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. bv_to_nat w = 0 \<Longrightarrow> nat_to_bv (2 * bv_to_nat w + bitval x) = norm_unsigned (w @ [x])
 2. bv_to_nat w \<noteq> 0 \<Longrightarrow> nat_to_bv (2 * bv_to_nat w + bitval x) = norm_unsigned (w @ [x])
[PROOF STEP]
assume "bv_to_nat w = 0"
[PROOF STATE]
proof (state)
this:
bv_to_nat w = 0

goal (2 subgoals):
 1. bv_to_nat w = 0 \<Longrightarrow> nat_to_bv (2 * bv_to_nat w + bitval x) = norm_unsigned (w @ [x])
 2. bv_to_nat w \<noteq> 0 \<Longrightarrow> nat_to_bv (2 * bv_to_nat w + bitval x) = norm_unsigned (w @ [x])
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
bv_to_nat w = 0

goal (1 subgoal):
 1. nat_to_bv (2 * bv_to_nat w + bitval x) = norm_unsigned (w @ [x])
[PROOF STEP]
by (simp add: bv_to_nat_zero_imp_empty)
[PROOF STATE]
proof (state)
this:
nat_to_bv (2 * bv_to_nat w + bitval x) = norm_unsigned (w @ [x])

goal (1 subgoal):
 1. bv_to_nat w \<noteq> 0 \<Longrightarrow> nat_to_bv (2 * bv_to_nat w + bitval x) = norm_unsigned (w @ [x])
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bv_to_nat w \<noteq> 0 \<Longrightarrow> nat_to_bv (2 * bv_to_nat w + bitval x) = norm_unsigned (w @ [x])
[PROOF STEP]
assume "bv_to_nat w \<noteq> 0"
[PROOF STATE]
proof (state)
this:
bv_to_nat w \<noteq> 0

goal (1 subgoal):
 1. bv_to_nat w \<noteq> 0 \<Longrightarrow> nat_to_bv (2 * bv_to_nat w + bitval x) = norm_unsigned (w @ [x])
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
bv_to_nat w \<noteq> 0

goal (1 subgoal):
 1. nat_to_bv (2 * bv_to_nat w + bitval x) = norm_unsigned (w @ [x])
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < bv_to_nat w \<Longrightarrow> nat_to_bv (2 * bv_to_nat w) = norm_unsigned (w @ [\<zero>])
[PROOF STEP]
apply (subst nat_to_bv_non0)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 0 < bv_to_nat w \<Longrightarrow> 2 * bv_to_nat w \<noteq> 0
 2. 0 < bv_to_nat w \<Longrightarrow> nat_to_bv (2 * bv_to_nat w div 2) @ [if 2 * bv_to_nat w mod 2 = 0 then \<zero> else \<one>] = norm_unsigned (w @ [\<zero>])
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < bv_to_nat w \<Longrightarrow> nat_to_bv (2 * bv_to_nat w div 2) @ [if 2 * bv_to_nat w mod 2 = 0 then \<zero> else \<one>] = norm_unsigned (w @ [\<zero>])
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < bv_to_nat w \<Longrightarrow> nat_to_bv (bv_to_nat w) @ [\<zero>] = norm_unsigned (w @ [\<zero>])
[PROOF STEP]
apply (subst ass)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < bv_to_nat w \<Longrightarrow> norm_unsigned w @ [\<zero>] = norm_unsigned (w @ [\<zero>])
[PROOF STEP]
apply (cases "norm_unsigned w")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>0 < bv_to_nat w; norm_unsigned w = []\<rbrakk> \<Longrightarrow> norm_unsigned w @ [\<zero>] = norm_unsigned (w @ [\<zero>])
 2. \<And>a list. \<lbrakk>0 < bv_to_nat w; norm_unsigned w = a # list\<rbrakk> \<Longrightarrow> norm_unsigned w @ [\<zero>] = norm_unsigned (w @ [\<zero>])
[PROOF STEP]
apply (simp_all add: norm_empty_bv_to_nat_zero)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
nat_to_bv (2 * bv_to_nat w + bitval x) = norm_unsigned (w @ [x])

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
nat_to_bv (2 * bv_to_nat w + bitval x) = norm_unsigned (w @ [x])

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_intersection[simp]:
  "\<lbrakk> distinct xs; distinct ys; sorted xs; sorted ys \<rbrakk>
     \<Longrightarrow> set (intersection xs ys) = set xs \<inter> set ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>distinct xs; distinct ys; sorted xs; sorted ys\<rbrakk> \<Longrightarrow> set (intersection xs ys) = set xs \<inter> set ys
[PROOF STEP]
by (induct xs ys rule: intersection.induct) (auto)


[STATEMENT]
lemma abs_summable_on_cong [cong]:
  "(\<And>x. x \<in> A \<Longrightarrow> f x = g x) \<Longrightarrow> A = B \<Longrightarrow> (f abs_summable_on A) \<longleftrightarrow> (g abs_summable_on B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x. x \<in> A \<Longrightarrow> f x = g x; A = B\<rbrakk> \<Longrightarrow> (f abs_summable_on A) = (g abs_summable_on B)
[PROOF STEP]
unfolding abs_summable_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x. x \<in> A \<Longrightarrow> f x = g x; A = B\<rbrakk> \<Longrightarrow> integrable (count_space A) f = integrable (count_space B) g
[PROOF STEP]
by (intro integrable_cong) auto


[STATEMENT]
lemma bheight_rbtreeify_f_eq_plog2I:
  "\<lbrakk> rbtreeify_f n kvs = (t, kvs'); n \<le> length kvs \<rbrakk>
  \<Longrightarrow> bheight t = plog2 n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>rbtreeify_f n kvs = (t, kvs'); n \<le> length kvs\<rbrakk> \<Longrightarrow> bheight t = plog2 n
[PROOF STEP]
using bheight_rbtreeify_f[of n kvs]
[PROOF STATE]
proof (prove)
using this:
n \<le> length kvs \<Longrightarrow> bheight (fst (rbtreeify_f n kvs)) = plog2 n

goal (1 subgoal):
 1. \<lbrakk>rbtreeify_f n kvs = (t, kvs'); n \<le> length kvs\<rbrakk> \<Longrightarrow> bheight t = plog2 n
[PROOF STEP]
by simp


[STATEMENT]
lemma less_lemma: "\<And> x y. rec_exec rec_less [x, y] =
  (if x < y then 1 else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. rec_exec rec_less [x, y] = (if x < y then 1 else 0)
[PROOF STEP]
by(induct_tac y, auto simp: rec_exec.simps
      rec_less_def minus_lemma sg_lemma)


[STATEMENT]
lemma prime_sum_upto_altdef1:
  "prime_sum_upto f x = sum_upto (\<lambda>p. ind prime p * f p) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime_sum_upto f x = sum_upto (\<lambda>p. ind prime p * f p) x
[PROOF STEP]
unfolding sum_upto_def prime_sum_upto_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {p. prime p \<and> real p \<le> x} = (\<Sum>p\<in>{i. 0 < i \<and> real i \<le> x}. ind prime p * f p)
[PROOF STEP]
by (intro sum.mono_neutral_cong_left finite_subset[OF _ finite_Nats_le_real[of x]])
     (auto dest: prime_gt_1_nat simp: ind_def)


[STATEMENT]
lemma fbox_anti: "\<forall>s. F\<^sub>1 s \<subseteq> F\<^sub>2 s \<Longrightarrow> |F\<^sub>2] P \<le> |F\<^sub>1] P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>s. F\<^sub>1 s \<subseteq> F\<^sub>2 s \<Longrightarrow> |F\<^sub>2] P \<le> |F\<^sub>1] P
[PROOF STEP]
unfolding fbox_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>s. F\<^sub>1 s \<subseteq> F\<^sub>2 s \<Longrightarrow> (\<lambda>s. \<forall>s'. s' \<in> F\<^sub>2 s \<longrightarrow> P s') \<le> (\<lambda>s. \<forall>s'. s' \<in> F\<^sub>1 s \<longrightarrow> P s')
[PROOF STEP]
by auto


[STATEMENT]
lemma is_top_sorted_alt: "is_top_sorted R l \<longleftrightarrow> (\<forall>x y. (x,y)\<in>list_before_rel l \<longrightarrow> (y,x)\<notin>R\<^sup>*)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_top_sorted R l = (\<forall>x y. (x, y) \<in> list_before_rel l \<longrightarrow> (y, x) \<notin> R\<^sup>*)
[PROOF STEP]
unfolding is_top_sorted_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (list_before_rel l \<inter> (R\<^sup>*)\<inverse> = {}) = (\<forall>x y. (x, y) \<in> list_before_rel l \<longrightarrow> (y, x) \<notin> R\<^sup>*)
[PROOF STEP]
by auto


[STATEMENT]
lemma absolutely_integrable_mult_Dirichlet_kernel_reflected:
  assumes f: "f absolutely_integrable_on {-pi..pi}"
    and periodic: "\<And>x. f(x + 2*pi) = f x"
  shows "(\<lambda>x. Dirichlet_kernel n x * f(t+x)) absolutely_integrable_on {-pi..pi}"
        "(\<lambda>x. Dirichlet_kernel n x * f(t-x)) absolutely_integrable_on {-pi..pi}"
        "(\<lambda>x. Dirichlet_kernel n x * c) absolutely_integrable_on {-pi..pi}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. Dirichlet_kernel n x * f (t + x)) absolutely_integrable_on {- pi..pi} &&& (\<lambda>x. Dirichlet_kernel n x * f (t - x)) absolutely_integrable_on {- pi..pi} &&& (\<lambda>x. Dirichlet_kernel n x * c) absolutely_integrable_on {- pi..pi}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. (\<lambda>x. Dirichlet_kernel n x * f (t + x)) absolutely_integrable_on {- pi..pi}
 2. (\<lambda>x. Dirichlet_kernel n x * f (t - x)) absolutely_integrable_on {- pi..pi}
 3. (\<lambda>x. Dirichlet_kernel n x * c) absolutely_integrable_on {- pi..pi}
[PROOF STEP]
show "(\<lambda>x. Dirichlet_kernel n x * f(t+x)) absolutely_integrable_on {-pi..pi}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. Dirichlet_kernel n x * f (t + x)) absolutely_integrable_on {- pi..pi}
[PROOF STEP]
apply (rule absolutely_integrable_mult_Dirichlet_kernel)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. f (t + x)) absolutely_integrable_on {- pi..pi}
[PROOF STEP]
using absolutely_integrable_periodic_offset [OF f, of t] periodic
[PROOF STATE]
proof (prove)
using this:
(\<And>x. f (x + (pi - - pi)) = f x) \<Longrightarrow> (\<lambda>x. f (x + t)) absolutely_integrable_on {- pi..pi}
(\<And>x. f (x + (pi - - pi)) = f x) \<Longrightarrow> (\<lambda>x. f (t + x)) absolutely_integrable_on {- pi..pi}
f (?x + 2 * pi) = f ?x

goal (1 subgoal):
 1. (\<lambda>x. f (t + x)) absolutely_integrable_on {- pi..pi}
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(\<lambda>x. Dirichlet_kernel n x * f (t + x)) absolutely_integrable_on {- pi..pi}

goal (2 subgoals):
 1. (\<lambda>x. Dirichlet_kernel n x * f (t - x)) absolutely_integrable_on {- pi..pi}
 2. (\<lambda>x. Dirichlet_kernel n x * c) absolutely_integrable_on {- pi..pi}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. Dirichlet_kernel n x * f (t + x)) absolutely_integrable_on {- pi..pi}
[PROOF STEP]
show "(\<lambda>x. Dirichlet_kernel n x * f(t-x)) absolutely_integrable_on {-pi..pi}"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. Dirichlet_kernel n x * f (t + x)) absolutely_integrable_on {- pi..pi}

goal (1 subgoal):
 1. (\<lambda>x. Dirichlet_kernel n x * f (t - x)) absolutely_integrable_on {- pi..pi}
[PROOF STEP]
by (subst absolutely_integrable_reflect_real [symmetric]) simp
[PROOF STATE]
proof (state)
this:
(\<lambda>x. Dirichlet_kernel n x * f (t - x)) absolutely_integrable_on {- pi..pi}

goal (1 subgoal):
 1. (\<lambda>x. Dirichlet_kernel n x * c) absolutely_integrable_on {- pi..pi}
[PROOF STEP]
show "(\<lambda>x. Dirichlet_kernel n x * c) absolutely_integrable_on {-pi..pi}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. Dirichlet_kernel n x * c) absolutely_integrable_on {- pi..pi}
[PROOF STEP]
by (simp add: absolutely_integrable_measurable_real borel_measurable_integrable integrable_Dirichlet_kernel)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. Dirichlet_kernel n x * c) absolutely_integrable_on {- pi..pi}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lemma_4_2_iii: "(a * c \<le> b * c) = (a \<le> b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a * c \<le> b * c) = (a \<le> b)
[PROOF STEP]
by (simp add: left_lesseq lemma_4_2_i [THEN sym])


[STATEMENT]
lemma csols_eq: "csols t\<^sub>0 s = {(x, t). t \<in> T \<and>  x \<in> Sols f (\<lambda>s. {t\<^sub>0--t}) S t\<^sub>0 s}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. csols t\<^sub>0 s = {(x, t). t \<in> T \<and> x \<in> Sols f (\<lambda>s. {t\<^sub>0--t}) S t\<^sub>0 s}
[PROOF STEP]
unfolding ivp_sols_def csols_def solves_ode_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(x, t1). {t\<^sub>0--t1} \<subseteq> T \<and> x t\<^sub>0 = s \<and>  D x = (\<lambda>t. f t (x t)) on {t\<^sub>0--t1} \<and> x \<in> {t\<^sub>0--t1} \<rightarrow> S} = {(x, t). t \<in> T \<and> x \<in> {X \<in> {t\<^sub>0--t} \<rightarrow> S.  D X = (\<lambda>t. f t (X t)) on {t\<^sub>0--t} \<and> X t\<^sub>0 = s \<and> t\<^sub>0 \<in> {t\<^sub>0--t}}}
[PROOF STEP]
using closed_segment_subset_domain init_time
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?t0.0 \<in> T; ?t \<in> T\<rbrakk> \<Longrightarrow> {?t0.0--?t} \<subseteq> T
t\<^sub>0 \<in> T

goal (1 subgoal):
 1. {(x, t1). {t\<^sub>0--t1} \<subseteq> T \<and> x t\<^sub>0 = s \<and>  D x = (\<lambda>t. f t (x t)) on {t\<^sub>0--t1} \<and> x \<in> {t\<^sub>0--t1} \<rightarrow> S} = {(x, t). t \<in> T \<and> x \<in> {X \<in> {t\<^sub>0--t} \<rightarrow> S.  D X = (\<lambda>t. f t (X t)) on {t\<^sub>0--t} \<and> X t\<^sub>0 = s \<and> t\<^sub>0 \<in> {t\<^sub>0--t}}}
[PROOF STEP]
by auto


[STATEMENT]
lemma order_eq: "order G = totient n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. order G = totient n
[PROOF STEP]
by (simp add: order_def totient_def)


[STATEMENT]
lemma sum_set_upt_eq_sum_list: "(\<Sum>i = m..<n. f i) = (\<Sum>i\<leftarrow>[m..<n]. f i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {m..<n} = sum_list (map f [m..<n])
[PROOF STEP]
using sum_set_upt_conv_sum_list_nat
[PROOF STATE]
proof (prove)
using this:
sum ?f (set [?m..<?n]) = sum_list (map ?f [?m..<?n])

goal (1 subgoal):
 1. sum f {m..<n} = sum_list (map f [m..<n])
[PROOF STEP]
by auto


[STATEMENT]
lemma similar_mat_jordan_block_smult: fixes A :: "'a :: field mat"
  assumes "similar_mat A (jordan_block n a)"
   and k: "k \<noteq> 0"
  shows "similar_mat (k \<cdot>\<^sub>m A) (jordan_block n (k * a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. similar_mat (k \<cdot>\<^sub>m A) (jordan_block n (k * a))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. similar_mat (k \<cdot>\<^sub>m A) (jordan_block n (k * a))
[PROOF STEP]
let ?J = "jordan_block n a"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. similar_mat (k \<cdot>\<^sub>m A) (jordan_block n (k * a))
[PROOF STEP]
let ?Jk = "jordan_block n (k * a)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. similar_mat (k \<cdot>\<^sub>m A) (jordan_block n (k * a))
[PROOF STEP]
let ?kJ = "k \<cdot>\<^sub>m jordan_block n a"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. similar_mat (k \<cdot>\<^sub>m A) (jordan_block n (k * a))
[PROOF STEP]
from k
[PROOF STATE]
proof (chain)
picking this:
k \<noteq> (0::'a)
[PROOF STEP]
have inv: "k ^ i \<noteq> 0" for i
[PROOF STATE]
proof (prove)
using this:
k \<noteq> (0::'a)

goal (1 subgoal):
 1. k ^ i \<noteq> (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
k ^ ?i \<noteq> (0::'a)

goal (1 subgoal):
 1. similar_mat (k \<cdot>\<^sub>m A) (jordan_block n (k * a))
[PROOF STEP]
let ?A = "mat_diag n (\<lambda> i. k^i)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. similar_mat (k \<cdot>\<^sub>m A) (jordan_block n (k * a))
[PROOF STEP]
let ?B = "mat_diag n (\<lambda> i. inverse (k^i))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. similar_mat (k \<cdot>\<^sub>m A) (jordan_block n (k * a))
[PROOF STEP]
have "similar_mat_wit ?Jk ?kJ ?A ?B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. similar_mat_wit (jordan_block n (k * a)) (k \<cdot>\<^sub>m jordan_block n a) (mat_diag n ((^) k)) (mat_diag n (\<lambda>i. inverse (k ^ i)))
[PROOF STEP]
proof (rule similar_mat_witI)
[PROOF STATE]
proof (state)
goal (7 subgoals):
 1. mat_diag n ((^) k) * mat_diag n (\<lambda>i. inverse (k ^ i)) = 1\<^sub>m ?n
 2. mat_diag n (\<lambda>i. inverse (k ^ i)) * mat_diag n ((^) k) = 1\<^sub>m ?n
 3. jordan_block n (k * a) = mat_diag n ((^) k) * (k \<cdot>\<^sub>m jordan_block n a) * mat_diag n (\<lambda>i. inverse (k ^ i))
 4. jordan_block n (k * a) \<in> carrier_mat ?n ?n
 5. k \<cdot>\<^sub>m jordan_block n a \<in> carrier_mat ?n ?n
 6. mat_diag n ((^) k) \<in> carrier_mat ?n ?n
 7. mat_diag n (\<lambda>i. inverse (k ^ i)) \<in> carrier_mat ?n ?n
[PROOF STEP]
show "jordan_block n (k * a) = ?A * ?kJ * ?B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jordan_block n (k * a) = mat_diag n ((^) k) * (k \<cdot>\<^sub>m jordan_block n a) * mat_diag n (\<lambda>i. inverse (k ^ i))
[PROOF STEP]
by (subst mat_diag_mult_left[of _ _ n], force, subst mat_diag_mult_right[of _ n],
       insert k inv, auto simp: jordan_block_def field_simps intro!: eq_matI)
[PROOF STATE]
proof (state)
this:
jordan_block n (k * a) = mat_diag n ((^) k) * (k \<cdot>\<^sub>m jordan_block n a) * mat_diag n (\<lambda>i. inverse (k ^ i))

goal (6 subgoals):
 1. mat_diag n ((^) k) * mat_diag n (\<lambda>i. inverse (k ^ i)) = 1\<^sub>m ?n
 2. mat_diag n (\<lambda>i. inverse (k ^ i)) * mat_diag n ((^) k) = 1\<^sub>m ?n
 3. jordan_block n (k * a) \<in> carrier_mat ?n ?n
 4. k \<cdot>\<^sub>m jordan_block n a \<in> carrier_mat ?n ?n
 5. mat_diag n ((^) k) \<in> carrier_mat ?n ?n
 6. mat_diag n (\<lambda>i. inverse (k ^ i)) \<in> carrier_mat ?n ?n
[PROOF STEP]
qed (auto simp: inv field_simps k)
[PROOF STATE]
proof (state)
this:
similar_mat_wit (jordan_block n (k * a)) (k \<cdot>\<^sub>m jordan_block n a) (mat_diag n ((^) k)) (mat_diag n (\<lambda>i. inverse (k ^ i)))

goal (1 subgoal):
 1. similar_mat (k \<cdot>\<^sub>m A) (jordan_block n (k * a))
[PROOF STEP]
hence kJ: "similar_mat ?Jk ?kJ"
[PROOF STATE]
proof (prove)
using this:
similar_mat_wit (jordan_block n (k * a)) (k \<cdot>\<^sub>m jordan_block n a) (mat_diag n ((^) k)) (mat_diag n (\<lambda>i. inverse (k ^ i)))

goal (1 subgoal):
 1. similar_mat (jordan_block n (k * a)) (k \<cdot>\<^sub>m jordan_block n a)
[PROOF STEP]
unfolding similar_mat_def
[PROOF STATE]
proof (prove)
using this:
similar_mat_wit (jordan_block n (k * a)) (k \<cdot>\<^sub>m jordan_block n a) (mat_diag n ((^) k)) (mat_diag n (\<lambda>i. inverse (k ^ i)))

goal (1 subgoal):
 1. \<exists>P. Ex (similar_mat_wit (jordan_block n (k * a)) (k \<cdot>\<^sub>m jordan_block n a) P)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
similar_mat (jordan_block n (k * a)) (k \<cdot>\<^sub>m jordan_block n a)

goal (1 subgoal):
 1. similar_mat (k \<cdot>\<^sub>m A) (jordan_block n (k * a))
[PROOF STEP]
have "similar_mat A ?J"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. similar_mat A (jordan_block n a)
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
similar_mat A (jordan_block n a)

goal (1 subgoal):
 1. similar_mat (k \<cdot>\<^sub>m A) (jordan_block n (k * a))
[PROOF STEP]
hence "similar_mat (k \<cdot>\<^sub>m A) (k \<cdot>\<^sub>m ?J)"
[PROOF STATE]
proof (prove)
using this:
similar_mat A (jordan_block n a)

goal (1 subgoal):
 1. similar_mat (k \<cdot>\<^sub>m A) (k \<cdot>\<^sub>m jordan_block n a)
[PROOF STEP]
by (rule similar_mat_smult)
[PROOF STATE]
proof (state)
this:
similar_mat (k \<cdot>\<^sub>m A) (k \<cdot>\<^sub>m jordan_block n a)

goal (1 subgoal):
 1. similar_mat (k \<cdot>\<^sub>m A) (jordan_block n (k * a))
[PROOF STEP]
with kJ
[PROOF STATE]
proof (chain)
picking this:
similar_mat (jordan_block n (k * a)) (k \<cdot>\<^sub>m jordan_block n a)
similar_mat (k \<cdot>\<^sub>m A) (k \<cdot>\<^sub>m jordan_block n a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
similar_mat (jordan_block n (k * a)) (k \<cdot>\<^sub>m jordan_block n a)
similar_mat (k \<cdot>\<^sub>m A) (k \<cdot>\<^sub>m jordan_block n a)

goal (1 subgoal):
 1. similar_mat (k \<cdot>\<^sub>m A) (jordan_block n (k * a))
[PROOF STEP]
using similar_mat_sym similar_mat_trans
[PROOF STATE]
proof (prove)
using this:
similar_mat (jordan_block n (k * a)) (k \<cdot>\<^sub>m jordan_block n a)
similar_mat (k \<cdot>\<^sub>m A) (k \<cdot>\<^sub>m jordan_block n a)
similar_mat ?A ?B \<Longrightarrow> similar_mat ?B ?A
\<lbrakk>similar_mat ?A ?B; similar_mat ?B ?C\<rbrakk> \<Longrightarrow> similar_mat ?A ?C

goal (1 subgoal):
 1. similar_mat (k \<cdot>\<^sub>m A) (jordan_block n (k * a))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
similar_mat (k \<cdot>\<^sub>m A) (jordan_block n (k * a))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pinv_double_half:
  assumes "ppos p"
  shows "pmult half (pinv p) = pinv (padd p p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pmult half (pinv p) = pinv (padd p p)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pmult half (pinv p) = pinv (padd p p)
[PROOF STEP]
have "(Fract 1 2) * ((Fract 1 1) / (Rep_prat p)) = (Fract 1 1) / (Rep_prat p + Rep_prat p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Fract 1 2 * (Fract 1 1 / Rep_prat p) = Fract 1 1 / (Rep_prat p + Rep_prat p)
[PROOF STEP]
by (metis (no_types, lifting) One_rat_def comm_monoid_mult_class.mult_1 divide_rat mult_2 mult_rat rat_number_expand(3) times_divide_times_eq)
[PROOF STATE]
proof (state)
this:
Fract 1 2 * (Fract 1 1 / Rep_prat p) = Fract 1 1 / (Rep_prat p + Rep_prat p)

goal (1 subgoal):
 1. pmult half (pinv p) = pinv (padd p p)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Fract 1 2 * (Fract 1 1 / Rep_prat p) = Fract 1 1 / (Rep_prat p + Rep_prat p)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Fract 1 2 * (Fract 1 1 / Rep_prat p) = Fract 1 1 / (Rep_prat p + Rep_prat p)

goal (1 subgoal):
 1. pmult half (pinv p) = pinv (padd p p)
[PROOF STEP]
by (metis Rep_prat_inject half.rep_eq mult_2 mult_numeral_1_right numeral_One padd.rep_eq pdiv.rep_eq pinv_def pmult.rep_eq pwrite.rep_eq times_divide_times_eq)
[PROOF STATE]
proof (state)
this:
pmult half (pinv p) = pinv (padd p p)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma higher_deriv_const [simp]: "(deriv ^^ n) (\<lambda>w. c) = (\<lambda>w. if n=0 then c else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (deriv ^^ n) (\<lambda>w. c) = (\<lambda>w. if n = 0 then c else (0::'a))
[PROOF STEP]
by (induction n) auto


[STATEMENT]
lemma matrix_mult_assoc:
  "(A::('a::semiring_0,'m,'n) matrix) *\<^sub>M B *\<^sub>M C = A *\<^sub>M (B *\<^sub>M C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *\<^sub>M B *\<^sub>M C = A *\<^sub>M (B *\<^sub>M C)
[PROOF STEP]
apply (cases A)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. A = Matrix x \<Longrightarrow> A *\<^sub>M B *\<^sub>M C = A *\<^sub>M (B *\<^sub>M C)
[PROOF STEP]
apply (cases B)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>A = Matrix x; B = Matrix xa\<rbrakk> \<Longrightarrow> A *\<^sub>M B *\<^sub>M C = A *\<^sub>M (B *\<^sub>M C)
[PROOF STEP]
apply (cases C)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa xb. \<lbrakk>A = Matrix x; B = Matrix xa; C = Matrix xb\<rbrakk> \<Longrightarrow> A *\<^sub>M B *\<^sub>M C = A *\<^sub>M (B *\<^sub>M C)
[PROOF STEP]
apply (simp add: sum_distrib_right sum_distrib_left mult.assoc)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa xb. \<lbrakk>A = Matrix x; B = Matrix xa; C = Matrix xb\<rbrakk> \<Longrightarrow> (\<lambda>i j. \<Sum>k\<in>UNIV. \<Sum>n\<in>UNIV. x i n \<cdot> (xa n k \<cdot> xb k j)) = (\<lambda>i j. \<Sum>k\<in>UNIV. \<Sum>n\<in>UNIV. x i k \<cdot> (xa k n \<cdot> xb n j))
[PROOF STEP]
apply (subst sum.swap)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa xb. \<lbrakk>A = Matrix x; B = Matrix xa; C = Matrix xb\<rbrakk> \<Longrightarrow> (\<lambda>i j. \<Sum>ja\<in>UNIV. \<Sum>ia\<in>UNIV. x i ja \<cdot> (xa ja ia \<cdot> xb ia j)) = (\<lambda>i j. \<Sum>k\<in>UNIV. \<Sum>n\<in>UNIV. x i k \<cdot> (xa k n \<cdot> xb n j))
[PROOF STEP]
apply (rule refl)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma length_merge: "length(merge xs ys) = length xs + length ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (merge xs ys) = length xs + length ys
[PROOF STEP]
apply (induction xs ys rule: merge.induct)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>ys. length (merge [] ys) = length [] + length ys
 2. \<And>v va. length (merge (v # va) []) = length (v # va) + length []
 3. \<And>x xs y ys. \<lbrakk>x \<le> y \<Longrightarrow> length (merge xs (y # ys)) = length xs + length (y # ys); \<not> x \<le> y \<Longrightarrow> length (merge (x # xs) ys) = length (x # xs) + length ys\<rbrakk> \<Longrightarrow> length (merge (x # xs) (y # ys)) = length (x # xs) + length (y # ys)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma card_of_countable_sets_Func:
"|{X. X \<subseteq> A \<and> countable X \<and> X \<noteq> {}}| \<le>o |A| ^c natLeq"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |{X. X \<subseteq> A \<and> countable X \<and> X \<noteq> {}}| \<le>o |A| ^c natLeq
[PROOF STEP]
using card_of_countable_sets_range card_of_Func_UNIV[THEN ordIso_symmetric]
[PROOF STATE]
proof (prove)
using this:
|{X. X \<subseteq> ?A \<and> countable X \<and> X \<noteq> {}}| \<le>o |{f. range f \<subseteq> ?A}|
|{f. range f \<subseteq> ?B1}| =o |Func UNIV ?B1|

goal (1 subgoal):
 1. |{X. X \<subseteq> A \<and> countable X \<and> X \<noteq> {}}| \<le>o |A| ^c natLeq
[PROOF STEP]
unfolding cexp_def Field_natLeq Field_card_of
[PROOF STATE]
proof (prove)
using this:
|{X. X \<subseteq> ?A \<and> countable X \<and> X \<noteq> {}}| \<le>o |{f. range f \<subseteq> ?A}|
|{f. range f \<subseteq> ?B1}| =o |Func UNIV ?B1|

goal (1 subgoal):
 1. |{X. X \<subseteq> A \<and> countable X \<and> X \<noteq> {}}| \<le>o |Func UNIV A|
[PROOF STEP]
by (rule ordLeq_ordIso_trans)


[STATEMENT]
lemma mod_ring_divide32: "(mod_ring_rel32 ===> mod_ring_rel32 ===> mod_ring_rel32) (divide_p32 pp) (/)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (mod_ring_rel32 ===> mod_ring_rel32 ===> mod_ring_rel32) (divide_p32 pp) (/)
[PROOF STEP]
using mod_ring_inverse32 mod_ring_mult32[OF *]
[PROOF STATE]
proof (prove)
using this:
(mod_ring_rel32 ===> mod_ring_rel32) (inverse_p32 pp) inverse
(mod_ring_rel32 ===> mod_ring_rel32 ===> mod_ring_rel32) (mult_p32 pp) (*)

goal (1 subgoal):
 1. (mod_ring_rel32 ===> mod_ring_rel32 ===> mod_ring_rel32) (divide_p32 pp) (/)
[PROOF STEP]
unfolding divide_p32_def divide_mod_ring_def inverse_mod_ring_def[symmetric]
    rel_fun_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x y. mod_ring_rel32 x y \<longrightarrow> mod_ring_rel32 (inverse_p32 pp x) (inverse y)
\<forall>x y. mod_ring_rel32 x y \<longrightarrow> (\<forall>xa ya. mod_ring_rel32 xa ya \<longrightarrow> mod_ring_rel32 (mult_p32 pp x xa) (y * ya))

goal (1 subgoal):
 1. \<forall>x y. mod_ring_rel32 x y \<longrightarrow> (\<forall>xa ya. mod_ring_rel32 xa ya \<longrightarrow> mod_ring_rel32 (mult_p32 pp x (inverse_p32 pp xa)) (y * inverse ya))
[PROOF STEP]
by blast


[STATEMENT]
lemma inverse_arrows_char:
    shows "inverse_arrows f g \<longleftrightarrow>
             antipar f g \<and> compose (Dom f) (Fun g) (Fun f) = (\<lambda>x \<in> Dom f. x)
                         \<and> compose (Dom g) (Fun f) (Fun g) = (\<lambda>y \<in> Dom g. y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse_arrows f g = (antipar f g \<and> compose (Dom f) (Fun g) (Fun f) = (\<lambda>x\<in>Dom f. x) \<and> compose (Dom g) (Fun f) (Fun g) = (\<lambda>y\<in>Dom g. y))
[PROOF STEP]
using section_retraction_char
[PROOF STATE]
proof (prove)
using this:
ide (?g \<cdot> ?f) = (antipar ?f ?g \<and> compose (Dom ?f) (Fun ?g) (Fun ?f) = (\<lambda>x\<in>Dom ?f. x))

goal (1 subgoal):
 1. inverse_arrows f g = (antipar f g \<and> compose (Dom f) (Fun g) (Fun f) = (\<lambda>x\<in>Dom f. x) \<and> compose (Dom g) (Fun f) (Fun g) = (\<lambda>y\<in>Dom g. y))
[PROOF STEP]
by blast


[STATEMENT]
lemma ereal_eq_minus_iff:
  fixes x y z :: ereal
  shows "x = z - y \<longleftrightarrow>
    (\<bar>y\<bar> \<noteq> \<infinity> \<longrightarrow> x + y = z) \<and>
    (y = -\<infinity> \<longrightarrow> x = \<infinity>) \<and>
    (y = \<infinity> \<longrightarrow> z = \<infinity> \<longrightarrow> x = \<infinity>) \<and>
    (y = \<infinity> \<longrightarrow> z \<noteq> \<infinity> \<longrightarrow> x = -\<infinity>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x = z - y) = ((\<bar>y\<bar> \<noteq> \<infinity> \<longrightarrow> x + y = z) \<and> (y = - \<infinity> \<longrightarrow> x = \<infinity>) \<and> (y = \<infinity> \<longrightarrow> z = \<infinity> \<longrightarrow> x = \<infinity>) \<and> (y = \<infinity> \<longrightarrow> z \<noteq> \<infinity> \<longrightarrow> x = - \<infinity>))
[PROOF STEP]
by (cases rule: ereal3_cases[of x y z]) auto


[STATEMENT]
lemma euclid_diff:
   "FPRE (\<lambda>s::nat store. s ''x'' = x \<and> s ''y'' = y \<and> x > 0 \<and> y > 0)
    (WHILE (\<lambda>s. s ''x''\<noteq> s ''y'') INV (\<lambda>s. gcd (s ''x'') (s ''y'') = gcd x y)
     DO
        (IF (\<lambda>s. s ''x'' >  s ''y'')
         THEN (''x'' ::= (\<lambda>s. s ''x'' - s ''y''))
         ELSE (''y'' ::= (\<lambda>s. s ''y'' - s ''x''))
         FI)
    OD)
    POST (\<lambda>s. s ''x'' = gcd x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_antirange_kleene_algebra.bdia (WHILE (\<lambda>s. s ''x'' \<noteq> s ''y'') INV (\<lambda>s. gcd (s ''x'') (s ''y'') = gcd x y) DO (IF (\<lambda>s. s ''y'' < s ''x'') THEN (''x'' ::= (\<lambda>s. s ''x'' - s ''y'')) ELSE (''y'' ::= (\<lambda>s. s ''y'' - s ''x'')) FI) OD) \<lceil>\<lambda>s. s ''x'' = x \<and> s ''y'' = y \<and> 0 < x \<and> 0 < y\<rceil> \<subseteq> rel_antirange_kleene_algebra.ars_r \<lceil>\<lambda>s. s ''x'' = gcd x y\<rceil>
[PROOF STEP]
apply (rule rel_modal_kleene_algebra.bdia_whilei, simp_all)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>s. gcd (s ''x'') (s ''y'') = gcd x y \<and> s ''x'' = s ''y'' \<longrightarrow> s ''y'' = gcd x y
 2. \<forall>s. ((\<exists>w. s ''x'' = w - s ''y'' \<and> s ''y'' < w \<and> w \<noteq> s ''y'' \<and> gcd w (s ''y'') = gcd x y) \<longrightarrow> gcd (s ''x'') (s ''y'') = gcd x y) \<and> ((\<exists>w. s ''y'' = w - s ''x'' \<and> \<not> w < s ''x'' \<and> s ''x'' \<noteq> w \<and> gcd (s ''x'') w = gcd x y) \<longrightarrow> gcd (s ''x'') (s ''y'') = gcd x y)
[PROOF STEP]
apply auto[1]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>s. ((\<exists>w. s ''x'' = w - s ''y'' \<and> s ''y'' < w \<and> w \<noteq> s ''y'' \<and> gcd w (s ''y'') = gcd x y) \<longrightarrow> gcd (s ''x'') (s ''y'') = gcd x y) \<and> ((\<exists>w. s ''y'' = w - s ''x'' \<and> \<not> w < s ''x'' \<and> s ''x'' \<noteq> w \<and> gcd (s ''x'') w = gcd x y) \<longrightarrow> gcd (s ''x'') (s ''y'') = gcd x y)
[PROOF STEP]
by (metis gcd.commute gcd_diff1_nat le_cases nat_less_le)


[STATEMENT]
lemma omega_loop_nu:
  "\<nu> (\<lambda>x . y * x \<squnion> z) = y\<^sup>\<omega> \<squnion> y\<^sup>\<star> * z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<nu> (\<lambda>x. y * x \<squnion> z) = y\<^sup>\<omega> \<squnion> y\<^sup>\<star> * z
[PROOF STEP]
by (metis greatest_fixpoint_same omega_loop_is_greatest_fixpoint)


[STATEMENT]
lemma real_le:
  "Abs_Real(realrel``{(x1,y1)}) \<le> Abs_Real(realrel``{(x2,y2)})  \<longleftrightarrow>  x1 + y2 \<le> x2 + y1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Abs_Real (Dedekind_Real.realrel `` {(x1, y1)}) \<le> Abs_Real (Dedekind_Real.realrel `` {(x2, y2)})) = (x1 + y2 \<le> x2 + y1)
[PROOF STEP]
unfolding real_le_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x y u v. x + v \<le> u + y \<and> (x, y) \<in> Rep_Real (Abs_Real (Dedekind_Real.realrel `` {(x1, y1)})) \<and> (u, v) \<in> Rep_Real (Abs_Real (Dedekind_Real.realrel `` {(x2, y2)}))) = (x1 + y2 \<le> x2 + y1)
[PROOF STEP]
by (auto intro: real_le_lemma)


[STATEMENT]
lemma matrix_vs: "vectorspace (class_ring :: 'a :: field ring) (module_mat TYPE('a) nr nc)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vectorspace class_ring (module_mat TYPE('a) nr nc)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vectorspace class_ring (module_mat TYPE('a) nr nc)
[PROOF STEP]
interpret abelian_group "module_mat TYPE('a) nr nc"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. abelian_group (module_mat TYPE('a) nr nc)
[PROOF STEP]
by (rule abelian_group_mat)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vectorspace class_ring (module_mat TYPE('a) nr nc)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vectorspace class_ring (module_mat TYPE('a) nr nc)
[PROOF STEP]
unfolding class_field_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vectorspace class_ring (module_mat TYPE('a) nr nc)
[PROOF STEP]
by (unfold_locales, unfold matrix_vs_simps,
      auto simp: add_smult_distrib_left_mat add_smult_distrib_right_mat)
[PROOF STATE]
proof (state)
this:
vectorspace class_ring (module_mat TYPE('a) nr nc)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ChiPlus_ChiRel_NoCycle_1 [rule_format]:
 "\<lbrakk> (T,S) \<in> ChiPlus A\<rbrakk> \<Longrightarrow>
   (insert S (insert T ({U. (T,U) \<in> ChiPlus A \<and> (U,S) \<in> ChiPlus A})))  \<inter> (ChiRel A `` {T}) \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (T, S) \<in> ChiPlus A \<Longrightarrow> insert S (insert T {U. (T, U) \<in> ChiPlus A \<and> (U, S) \<in> ChiPlus A}) \<inter> ChiRel A `` {T} \<noteq> {}
[PROOF STEP]
apply (unfold ChiPlus_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (T, S) \<in> (ChiRel A)\<^sup>+ \<Longrightarrow> insert S (insert T {U. (T, U) \<in> (ChiRel A)\<^sup>+ \<and> (U, S) \<in> (ChiRel A)\<^sup>+}) \<inter> ChiRel A `` {T} \<noteq> {}
[PROOF STEP]
apply (rule_tac a="T" and b="S" and r="(ChiRel A)" in converse_trancl_induct)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. (T, S) \<in> (ChiRel A)\<^sup>+ \<Longrightarrow> (T, S) \<in> (ChiRel A)\<^sup>+
 2. \<And>y. \<lbrakk>(T, S) \<in> (ChiRel A)\<^sup>+; (y, S) \<in> ChiRel A\<rbrakk> \<Longrightarrow> insert S (insert y {U. (y, U) \<in> (ChiRel A)\<^sup>+ \<and> (U, S) \<in> (ChiRel A)\<^sup>+}) \<inter> ChiRel A `` {y} \<noteq> {}
 3. \<And>y z. \<lbrakk>(T, S) \<in> (ChiRel A)\<^sup>+; (y, z) \<in> ChiRel A; (z, S) \<in> (ChiRel A)\<^sup>+; insert S (insert z {U. (z, U) \<in> (ChiRel A)\<^sup>+ \<and> (U, S) \<in> (ChiRel A)\<^sup>+}) \<inter> ChiRel A `` {z} \<noteq> {}\<rbrakk> \<Longrightarrow> insert S (insert y {U. (y, U) \<in> (ChiRel A)\<^sup>+ \<and> (U, S) \<in> (ChiRel A)\<^sup>+}) \<inter> ChiRel A `` {y} \<noteq> {}
[PROOF STEP]
apply (unfold Image_def Int_def)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. (T, S) \<in> (ChiRel A)\<^sup>+ \<Longrightarrow> (T, S) \<in> (ChiRel A)\<^sup>+
 2. \<And>y. \<lbrakk>(T, S) \<in> (ChiRel A)\<^sup>+; (y, S) \<in> ChiRel A\<rbrakk> \<Longrightarrow> {x \<in> insert S (insert y {U. (y, U) \<in> (ChiRel A)\<^sup>+ \<and> (U, S) \<in> (ChiRel A)\<^sup>+}). x \<in> {ya. \<exists>x\<in>{y}. (x, ya) \<in> ChiRel A}} \<noteq> {}
 3. \<And>y z. \<lbrakk>(T, S) \<in> (ChiRel A)\<^sup>+; (y, z) \<in> ChiRel A; (z, S) \<in> (ChiRel A)\<^sup>+; {x \<in> insert S (insert z {U. (z, U) \<in> (ChiRel A)\<^sup>+ \<and> (U, S) \<in> (ChiRel A)\<^sup>+}). x \<in> {y. \<exists>x\<in>{z}. (x, y) \<in> ChiRel A}} \<noteq> {}\<rbrakk> \<Longrightarrow> {x \<in> insert S (insert y {U. (y, U) \<in> (ChiRel A)\<^sup>+ \<and> (U, S) \<in> (ChiRel A)\<^sup>+}). x \<in> {ya. \<exists>x\<in>{y}. (x, ya) \<in> ChiRel A}} \<noteq> {}
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma complex_double [simp]:
  shows "(Complex a b) * 2 = Complex (2*a) (2*b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex a b * 2 = Complex (2 * a) (2 * b)
[PROOF STEP]
by (simp add: Complex_eq)


[STATEMENT]
lemma real_lt_affinity: "0 < m \<Longrightarrow> y < m * x + c \<longleftrightarrow> inverse m * y + - (c / m) < x"
  for m :: "'a::linordered_field"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) < m \<Longrightarrow> (y < m * x + c) = (inverse m * y + - (c / m) < x)
[PROOF STEP]
by (simp add: field_simps)


[STATEMENT]
lemma normal_lconjby_closed:
  "\<lbrakk> Subgroup H; normal H; g\<in>G; h\<in>H \<rbrakk> \<Longrightarrow> lconjby g h \<in> H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Subgroup H; normal H; g \<in> G; h \<in> H\<rbrakk> \<Longrightarrow> lconjby g h \<in> H
[PROOF STEP]
using lcoset_relI[of g "g+h" H] add_closed[of g h] normal_def[of H]
        symD[OF Group.rcoset_rel_sym, of H g "g+h"] rcoset_rel_def[of H]
[PROOF STATE]
proof (prove)
using this:
- g + (g + h) \<in> H \<Longrightarrow> (g, g + h) \<in> lcoset_rel H
\<lbrakk>g \<in> G; h \<in> G\<rbrakk> \<Longrightarrow> g + h \<in> G
normal H \<equiv> \<forall>g\<in>G. LCoset_rel H `` {g} = RCoset_rel H `` {g}
\<lbrakk>Group H; (g, g + h) \<in> rcoset_rel H\<rbrakk> \<Longrightarrow> (g + h, g) \<in> rcoset_rel H
rcoset_rel H \<equiv> {(x, y). x - y \<in> H}

goal (1 subgoal):
 1. \<lbrakk>Subgroup H; normal H; g \<in> G; h \<in> H\<rbrakk> \<Longrightarrow> lconjby g h \<in> H
[PROOF STEP]
by    auto


[STATEMENT]
lemma finite_fv_fo_fmla: "finite (fv_fo_fmla \<phi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (fv_fo_fmla \<phi>)
[PROOF STEP]
by (induction \<phi> rule: fv_fo_fmla.induct)
     (auto simp: finite_fv_fo_term_set finite_fv_fo_terms_set)


[STATEMENT]
lemma real_sqrt_unique: "y\<^sup>2 = x \<Longrightarrow> 0 \<le> y \<Longrightarrow> sqrt x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>y\<^sup>2 = x; 0 \<le> y\<rbrakk> \<Longrightarrow> sqrt x = y
[PROOF STEP]
unfolding sqrt_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>y\<^sup>2 = x; 0 \<le> y\<rbrakk> \<Longrightarrow> root 2 x = y
[PROOF STEP]
by (rule real_root_pos_unique [OF pos2])


[STATEMENT]
lemma countably_compact_imp_compact:
  assumes "countably_compact U"
    and ccover: "countable B" "\<forall>b\<in>B. open b"
    and basis: "\<And>T x. open T \<Longrightarrow> x \<in> T \<Longrightarrow> x \<in> U \<Longrightarrow> \<exists>b\<in>B. x \<in> b \<and> b \<inter> U \<subseteq> T"
  shows "compact U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compact U
[PROOF STEP]
using \<open>countably_compact U\<close>
[PROOF STATE]
proof (prove)
using this:
countably_compact U

goal (1 subgoal):
 1. compact U
[PROOF STEP]
unfolding compact_eq_Heine_Borel countably_compact_def
[PROOF STATE]
proof (prove)
using this:
\<forall>A. countable A \<longrightarrow> Ball A open \<longrightarrow> U \<subseteq> \<Union> A \<longrightarrow> (\<exists>T\<subseteq>A. finite T \<and> U \<subseteq> \<Union> T)

goal (1 subgoal):
 1. \<forall>C. Ball C open \<and> U \<subseteq> \<Union> C \<longrightarrow> (\<exists>D\<subseteq>C. finite D \<and> U \<subseteq> \<Union> D)
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>C. \<lbrakk>\<forall>A. countable A \<longrightarrow> Ball A open \<longrightarrow> U \<subseteq> \<Union> A \<longrightarrow> (\<exists>T\<subseteq>A. finite T \<and> U \<subseteq> \<Union> T); Ball C open; U \<subseteq> \<Union> C\<rbrakk> \<Longrightarrow> \<exists>D\<subseteq>C. finite D \<and> U \<subseteq> \<Union> D
[PROOF STEP]
fix A
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>C. \<lbrakk>\<forall>A. countable A \<longrightarrow> Ball A open \<longrightarrow> U \<subseteq> \<Union> A \<longrightarrow> (\<exists>T\<subseteq>A. finite T \<and> U \<subseteq> \<Union> T); Ball C open; U \<subseteq> \<Union> C\<rbrakk> \<Longrightarrow> \<exists>D\<subseteq>C. finite D \<and> U \<subseteq> \<Union> D
[PROOF STEP]
assume A: "\<forall>a\<in>A. open a" "U \<subseteq> \<Union>A"
[PROOF STATE]
proof (state)
this:
\<forall>a\<in>A. open a
U \<subseteq> \<Union> A

goal (1 subgoal):
 1. \<And>C. \<lbrakk>\<forall>A. countable A \<longrightarrow> Ball A open \<longrightarrow> U \<subseteq> \<Union> A \<longrightarrow> (\<exists>T\<subseteq>A. finite T \<and> U \<subseteq> \<Union> T); Ball C open; U \<subseteq> \<Union> C\<rbrakk> \<Longrightarrow> \<exists>D\<subseteq>C. finite D \<and> U \<subseteq> \<Union> D
[PROOF STEP]
assume *: "\<forall>A. countable A \<longrightarrow> (\<forall>a\<in>A. open a) \<longrightarrow> U \<subseteq> \<Union>A \<longrightarrow> (\<exists>T\<subseteq>A. finite T \<and> U \<subseteq> \<Union>T)"
[PROOF STATE]
proof (state)
this:
\<forall>A. countable A \<longrightarrow> (\<forall>a\<in>A. open a) \<longrightarrow> U \<subseteq> \<Union> A \<longrightarrow> (\<exists>T\<subseteq>A. finite T \<and> U \<subseteq> \<Union> T)

goal (1 subgoal):
 1. \<And>C. \<lbrakk>\<forall>A. countable A \<longrightarrow> Ball A open \<longrightarrow> U \<subseteq> \<Union> A \<longrightarrow> (\<exists>T\<subseteq>A. finite T \<and> U \<subseteq> \<Union> T); Ball C open; U \<subseteq> \<Union> C\<rbrakk> \<Longrightarrow> \<exists>D\<subseteq>C. finite D \<and> U \<subseteq> \<Union> D
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>A. countable A \<longrightarrow> (\<forall>a\<in>A. open a) \<longrightarrow> U \<subseteq> \<Union> A \<longrightarrow> (\<exists>T\<subseteq>A. finite T \<and> U \<subseteq> \<Union> T)

goal (1 subgoal):
 1. \<And>C. \<lbrakk>\<forall>A. countable A \<longrightarrow> Ball A open \<longrightarrow> U \<subseteq> \<Union> A \<longrightarrow> (\<exists>T\<subseteq>A. finite T \<and> U \<subseteq> \<Union> T); Ball C open; U \<subseteq> \<Union> C\<rbrakk> \<Longrightarrow> \<exists>D\<subseteq>C. finite D \<and> U \<subseteq> \<Union> D
[PROOF STEP]
define C where "C = {b\<in>B. \<exists>a\<in>A. b \<inter> U \<subseteq> a}"
[PROOF STATE]
proof (state)
this:
C = {b \<in> B. \<exists>a\<in>A. b \<inter> U \<subseteq> a}

goal (1 subgoal):
 1. \<And>C. \<lbrakk>\<forall>A. countable A \<longrightarrow> Ball A open \<longrightarrow> U \<subseteq> \<Union> A \<longrightarrow> (\<exists>T\<subseteq>A. finite T \<and> U \<subseteq> \<Union> T); Ball C open; U \<subseteq> \<Union> C\<rbrakk> \<Longrightarrow> \<exists>D\<subseteq>C. finite D \<and> U \<subseteq> \<Union> D
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>A. countable A \<longrightarrow> (\<forall>a\<in>A. open a) \<longrightarrow> U \<subseteq> \<Union> A \<longrightarrow> (\<exists>T\<subseteq>A. finite T \<and> U \<subseteq> \<Union> T)
C = {b \<in> B. \<exists>a\<in>A. b \<inter> U \<subseteq> a}
[PROOF STEP]
have "countable C" "\<forall>a\<in>C. open a"
[PROOF STATE]
proof (prove)
using this:
\<forall>A. countable A \<longrightarrow> (\<forall>a\<in>A. open a) \<longrightarrow> U \<subseteq> \<Union> A \<longrightarrow> (\<exists>T\<subseteq>A. finite T \<and> U \<subseteq> \<Union> T)
C = {b \<in> B. \<exists>a\<in>A. b \<inter> U \<subseteq> a}

goal (1 subgoal):
 1. countable C &&& \<forall>a\<in>C. open a
[PROOF STEP]
unfolding C_def
[PROOF STATE]
proof (prove)
using this:
\<forall>A. countable A \<longrightarrow> (\<forall>a\<in>A. open a) \<longrightarrow> U \<subseteq> \<Union> A \<longrightarrow> (\<exists>T\<subseteq>A. finite T \<and> U \<subseteq> \<Union> T)
{b \<in> B. Bex A ((\<subseteq>) (b \<inter> U))} = {b \<in> B. \<exists>a\<in>A. b \<inter> U \<subseteq> a}

goal (1 subgoal):
 1. countable {b \<in> B. Bex A ((\<subseteq>) (b \<inter> U))} &&& \<forall>a\<in>{b \<in> B. Bex A ((\<subseteq>) (b \<inter> U))}. open a
[PROOF STEP]
using ccover
[PROOF STATE]
proof (prove)
using this:
\<forall>A. countable A \<longrightarrow> (\<forall>a\<in>A. open a) \<longrightarrow> U \<subseteq> \<Union> A \<longrightarrow> (\<exists>T\<subseteq>A. finite T \<and> U \<subseteq> \<Union> T)
{b \<in> B. Bex A ((\<subseteq>) (b \<inter> U))} = {b \<in> B. \<exists>a\<in>A. b \<inter> U \<subseteq> a}
countable B
\<forall>b\<in>B. open b

goal (1 subgoal):
 1. countable {b \<in> B. Bex A ((\<subseteq>) (b \<inter> U))} &&& \<forall>a\<in>{b \<in> B. Bex A ((\<subseteq>) (b \<inter> U))}. open a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
countable C
\<forall>a\<in>C. open a

goal (1 subgoal):
 1. \<And>C. \<lbrakk>\<forall>A. countable A \<longrightarrow> Ball A open \<longrightarrow> U \<subseteq> \<Union> A \<longrightarrow> (\<exists>T\<subseteq>A. finite T \<and> U \<subseteq> \<Union> T); Ball C open; U \<subseteq> \<Union> C\<rbrakk> \<Longrightarrow> \<exists>D\<subseteq>C. finite D \<and> U \<subseteq> \<Union> D
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
countable C
\<forall>a\<in>C. open a

goal (1 subgoal):
 1. \<And>C. \<lbrakk>\<forall>A. countable A \<longrightarrow> Ball A open \<longrightarrow> U \<subseteq> \<Union> A \<longrightarrow> (\<exists>T\<subseteq>A. finite T \<and> U \<subseteq> \<Union> T); Ball C open; U \<subseteq> \<Union> C\<rbrakk> \<Longrightarrow> \<exists>D\<subseteq>C. finite D \<and> U \<subseteq> \<Union> D
[PROOF STEP]
have "\<Union>A \<inter> U \<subseteq> \<Union>C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> A \<inter> U \<subseteq> \<Union> C
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x X. \<lbrakk>x \<in> U; x \<in> X; X \<in> A\<rbrakk> \<Longrightarrow> x \<in> \<Union> C
[PROOF STEP]
fix x a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x X. \<lbrakk>x \<in> U; x \<in> X; X \<in> A\<rbrakk> \<Longrightarrow> x \<in> \<Union> C
[PROOF STEP]
assume "x \<in> U" "x \<in> a" "a \<in> A"
[PROOF STATE]
proof (state)
this:
x \<in> U
x \<in> a
a \<in> A

goal (1 subgoal):
 1. \<And>x X. \<lbrakk>x \<in> U; x \<in> X; X \<in> A\<rbrakk> \<Longrightarrow> x \<in> \<Union> C
[PROOF STEP]
with basis[of a x] A
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>open a; x \<in> a; x \<in> U\<rbrakk> \<Longrightarrow> \<exists>b\<in>B. x \<in> b \<and> b \<inter> U \<subseteq> a
\<forall>a\<in>A. open a
U \<subseteq> \<Union> A
x \<in> U
x \<in> a
a \<in> A
[PROOF STEP]
obtain b where "b \<in> B" "x \<in> b" "b \<inter> U \<subseteq> a"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>open a; x \<in> a; x \<in> U\<rbrakk> \<Longrightarrow> \<exists>b\<in>B. x \<in> b \<and> b \<inter> U \<subseteq> a
\<forall>a\<in>A. open a
U \<subseteq> \<Union> A
x \<in> U
x \<in> a
a \<in> A

goal (1 subgoal):
 1. (\<And>b. \<lbrakk>b \<in> B; x \<in> b; b \<inter> U \<subseteq> a\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
b \<in> B
x \<in> b
b \<inter> U \<subseteq> a

goal (1 subgoal):
 1. \<And>x X. \<lbrakk>x \<in> U; x \<in> X; X \<in> A\<rbrakk> \<Longrightarrow> x \<in> \<Union> C
[PROOF STEP]
with \<open>a \<in> A\<close>
[PROOF STATE]
proof (chain)
picking this:
a \<in> A
b \<in> B
x \<in> b
b \<inter> U \<subseteq> a
[PROOF STEP]
show "x \<in> \<Union>C"
[PROOF STATE]
proof (prove)
using this:
a \<in> A
b \<in> B
x \<in> b
b \<inter> U \<subseteq> a

goal (1 subgoal):
 1. x \<in> \<Union> C
[PROOF STEP]
unfolding C_def
[PROOF STATE]
proof (prove)
using this:
a \<in> A
b \<in> B
x \<in> b
b \<inter> U \<subseteq> a

goal (1 subgoal):
 1. x \<in> \<Union> {b \<in> B. Bex A ((\<subseteq>) (b \<inter> U))}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> \<Union> C

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<Union> A \<inter> U \<subseteq> \<Union> C

goal (1 subgoal):
 1. \<And>C. \<lbrakk>\<forall>A. countable A \<longrightarrow> Ball A open \<longrightarrow> U \<subseteq> \<Union> A \<longrightarrow> (\<exists>T\<subseteq>A. finite T \<and> U \<subseteq> \<Union> T); Ball C open; U \<subseteq> \<Union> C\<rbrakk> \<Longrightarrow> \<exists>D\<subseteq>C. finite D \<and> U \<subseteq> \<Union> D
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<Union> A \<inter> U \<subseteq> \<Union> C
[PROOF STEP]
have "U \<subseteq> \<Union>C"
[PROOF STATE]
proof (prove)
using this:
\<Union> A \<inter> U \<subseteq> \<Union> C

goal (1 subgoal):
 1. U \<subseteq> \<Union> C
[PROOF STEP]
using \<open>U \<subseteq> \<Union>A\<close>
[PROOF STATE]
proof (prove)
using this:
\<Union> A \<inter> U \<subseteq> \<Union> C
U \<subseteq> \<Union> A

goal (1 subgoal):
 1. U \<subseteq> \<Union> C
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
U \<subseteq> \<Union> C

goal (1 subgoal):
 1. \<And>C. \<lbrakk>\<forall>A. countable A \<longrightarrow> Ball A open \<longrightarrow> U \<subseteq> \<Union> A \<longrightarrow> (\<exists>T\<subseteq>A. finite T \<and> U \<subseteq> \<Union> T); Ball C open; U \<subseteq> \<Union> C\<rbrakk> \<Longrightarrow> \<exists>D\<subseteq>C. finite D \<and> U \<subseteq> \<Union> D
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
countable C
\<forall>a\<in>C. open a
U \<subseteq> \<Union> C
[PROOF STEP]
obtain T where T: "T\<subseteq>C" "finite T" "U \<subseteq> \<Union>T"
[PROOF STATE]
proof (prove)
using this:
countable C
\<forall>a\<in>C. open a
U \<subseteq> \<Union> C

goal (1 subgoal):
 1. (\<And>T. \<lbrakk>T \<subseteq> C; finite T; U \<subseteq> \<Union> T\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
countable C
\<forall>a\<in>C. open a
U \<subseteq> \<Union> C
\<forall>A. countable A \<longrightarrow> (\<forall>a\<in>A. open a) \<longrightarrow> U \<subseteq> \<Union> A \<longrightarrow> (\<exists>T\<subseteq>A. finite T \<and> U \<subseteq> \<Union> T)

goal (1 subgoal):
 1. (\<And>T. \<lbrakk>T \<subseteq> C; finite T; U \<subseteq> \<Union> T\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
T \<subseteq> C
finite T
U \<subseteq> \<Union> T

goal (1 subgoal):
 1. \<And>C. \<lbrakk>\<forall>A. countable A \<longrightarrow> Ball A open \<longrightarrow> U \<subseteq> \<Union> A \<longrightarrow> (\<exists>T\<subseteq>A. finite T \<and> U \<subseteq> \<Union> T); Ball C open; U \<subseteq> \<Union> C\<rbrakk> \<Longrightarrow> \<exists>D\<subseteq>C. finite D \<and> U \<subseteq> \<Union> D
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
T \<subseteq> C
finite T
U \<subseteq> \<Union> T
[PROOF STEP]
have "\<forall>t\<in>T. \<exists>a\<in>A. t \<inter> U \<subseteq> a"
[PROOF STATE]
proof (prove)
using this:
T \<subseteq> C
finite T
U \<subseteq> \<Union> T

goal (1 subgoal):
 1. \<forall>t\<in>T. \<exists>a\<in>A. t \<inter> U \<subseteq> a
[PROOF STEP]
by (auto simp: C_def)
[PROOF STATE]
proof (state)
this:
\<forall>t\<in>T. \<exists>a\<in>A. t \<inter> U \<subseteq> a

goal (1 subgoal):
 1. \<And>C. \<lbrakk>\<forall>A. countable A \<longrightarrow> Ball A open \<longrightarrow> U \<subseteq> \<Union> A \<longrightarrow> (\<exists>T\<subseteq>A. finite T \<and> U \<subseteq> \<Union> T); Ball C open; U \<subseteq> \<Union> C\<rbrakk> \<Longrightarrow> \<exists>D\<subseteq>C. finite D \<and> U \<subseteq> \<Union> D
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>t\<in>T. \<exists>a\<in>A. t \<inter> U \<subseteq> a
[PROOF STEP]
obtain f where "\<forall>t\<in>T. f t \<in> A \<and> t \<inter> U \<subseteq> f t"
[PROOF STATE]
proof (prove)
using this:
\<forall>t\<in>T. \<exists>a\<in>A. t \<inter> U \<subseteq> a

goal (1 subgoal):
 1. (\<And>f. \<forall>t\<in>T. f t \<in> A \<and> t \<inter> U \<subseteq> f t \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding bchoice_iff Bex_def
[PROOF STATE]
proof (prove)
using this:
\<exists>f. \<forall>t\<in>T. f t \<in> A \<and> t \<inter> U \<subseteq> f t

goal (1 subgoal):
 1. (\<And>f. \<forall>t\<in>T. f t \<in> A \<and> t \<inter> U \<subseteq> f t \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<forall>t\<in>T. f t \<in> A \<and> t \<inter> U \<subseteq> f t

goal (1 subgoal):
 1. \<And>C. \<lbrakk>\<forall>A. countable A \<longrightarrow> Ball A open \<longrightarrow> U \<subseteq> \<Union> A \<longrightarrow> (\<exists>T\<subseteq>A. finite T \<and> U \<subseteq> \<Union> T); Ball C open; U \<subseteq> \<Union> C\<rbrakk> \<Longrightarrow> \<exists>D\<subseteq>C. finite D \<and> U \<subseteq> \<Union> D
[PROOF STEP]
with T
[PROOF STATE]
proof (chain)
picking this:
T \<subseteq> C
finite T
U \<subseteq> \<Union> T
\<forall>t\<in>T. f t \<in> A \<and> t \<inter> U \<subseteq> f t
[PROOF STEP]
show "\<exists>T\<subseteq>A. finite T \<and> U \<subseteq> \<Union>T"
[PROOF STATE]
proof (prove)
using this:
T \<subseteq> C
finite T
U \<subseteq> \<Union> T
\<forall>t\<in>T. f t \<in> A \<and> t \<inter> U \<subseteq> f t

goal (1 subgoal):
 1. \<exists>T\<subseteq>A. finite T \<and> U \<subseteq> \<Union> T
[PROOF STEP]
unfolding C_def
[PROOF STATE]
proof (prove)
using this:
T \<subseteq> {b \<in> B. Bex A ((\<subseteq>) (b \<inter> U))}
finite T
U \<subseteq> \<Union> T
\<forall>t\<in>T. f t \<in> A \<and> t \<inter> U \<subseteq> f t

goal (1 subgoal):
 1. \<exists>T\<subseteq>A. finite T \<and> U \<subseteq> \<Union> T
[PROOF STEP]
by (intro exI[of _ "f`T"]) fastforce
[PROOF STATE]
proof (state)
this:
\<exists>T\<subseteq>A. finite T \<and> U \<subseteq> \<Union> T

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma less_add_1_iff_le_hmset: "m < n + 1 \<longleftrightarrow> m \<le> n" for m n :: hmultiset
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (m < n + 1) = (m \<le> n)
[PROOF STEP]
by (rule less_iff_add1_le_hmset[of m "n + 1", simplified])


[STATEMENT]
lemma braun_list_not_Nil: "xs \<noteq> [] \<Longrightarrow>
  braun_list t xs =
 (\<exists>l x r. t = Node l x r \<and> x = hd xs \<and>
    braun_list l (take_nths 1 1 xs) \<and>
    braun_list r (take_nths 2 1 xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs \<noteq> [] \<Longrightarrow> braun_list t xs = (\<exists>l x r. t = \<langle>l, x, r\<rangle> \<and> x = hd xs \<and> braun_list l (take_nths 1 1 xs) \<and> braun_list r (take_nths 2 1 xs))
[PROOF STEP]
by(cases t; simp)


[STATEMENT]
lemma prod_fun_closed [intro]: "(\<And>x. f x \<in> A) \<Longrightarrow> (\<And>x. g x \<in> A) \<Longrightarrow> prod_fun f g x \<in> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x. f x \<in> A; \<And>x. g x \<in> A\<rbrakk> \<Longrightarrow> prod_fun f g x \<in> A
[PROOF STEP]
by (auto simp: prod_fun_def when_def intro!: Sum_any_closed mult_closed)


[STATEMENT]
lemma [code]:
  "listrel1p r [] xs = False"
  "listrel1p r xs [] =  False"
  "listrel1p r (x # xs) (y # ys) \<longleftrightarrow>
     r x y \<and> xs = ys \<or> x = y \<and> listrel1p r xs ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. listrel1p r [] xs = False &&& listrel1p r xs [] = False &&& listrel1p r (x # xs) (y # ys) = (r x y \<and> xs = ys \<or> x = y \<and> listrel1p r xs ys)
[PROOF STEP]
by (simp add: listrel1p_def)+


[STATEMENT]
lemma isometry_quasi_isometry_on:
  assumes "isometry_on X f"
  shows "1 0-quasi_isometry_on X f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 0 -quasi_isometry_on X f
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
isometry_on X f

goal (1 subgoal):
 1. 1 0 -quasi_isometry_on X f
[PROOF STEP]
unfolding isometry_on_def quasi_isometry_on_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>X. \<forall>y\<in>X. dist (f x) (f y) = dist x y

goal (1 subgoal):
 1. 1 \<le> 1 \<and> 0 \<le> 0 \<and> (\<forall>x\<in>X. \<forall>y\<in>X. dist (f x) (f y) \<le> 1 * dist x y + 0 \<and> 1 / 1 * dist x y - 0 \<le> dist (f x) (f y))
[PROOF STEP]
by auto


[STATEMENT]
lemma L2_set_mult_ineq: "(\<Sum>i\<in>A. \<bar>f i\<bar> * \<bar>g i\<bar>) \<le> L2_set f A * L2_set g A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>A. \<bar>f i\<bar> * \<bar>g i\<bar>) \<le> L2_set f A * L2_set g A
[PROOF STEP]
apply (cases "finite A")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. finite A \<Longrightarrow> (\<Sum>i\<in>A. \<bar>f i\<bar> * \<bar>g i\<bar>) \<le> L2_set f A * L2_set g A
 2. infinite A \<Longrightarrow> (\<Sum>i\<in>A. \<bar>f i\<bar> * \<bar>g i\<bar>) \<le> L2_set f A * L2_set g A
[PROOF STEP]
apply (induct set: finite)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. (\<Sum>i\<in>{}. \<bar>f i\<bar> * \<bar>g i\<bar>) \<le> L2_set f {} * L2_set g {}
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<Sum>i\<in>F. \<bar>f i\<bar> * \<bar>g i\<bar>) \<le> L2_set f F * L2_set g F\<rbrakk> \<Longrightarrow> (\<Sum>i\<in>insert x F. \<bar>f i\<bar> * \<bar>g i\<bar>) \<le> L2_set f (insert x F) * L2_set g (insert x F)
 3. infinite A \<Longrightarrow> (\<Sum>i\<in>A. \<bar>f i\<bar> * \<bar>g i\<bar>) \<le> L2_set f A * L2_set g A
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<Sum>i\<in>F. \<bar>f i\<bar> * \<bar>g i\<bar>) \<le> L2_set f F * L2_set g F\<rbrakk> \<Longrightarrow> (\<Sum>i\<in>insert x F. \<bar>f i\<bar> * \<bar>g i\<bar>) \<le> L2_set f (insert x F) * L2_set g (insert x F)
 2. infinite A \<Longrightarrow> (\<Sum>i\<in>A. \<bar>f i\<bar> * \<bar>g i\<bar>) \<le> L2_set f A * L2_set g A
[PROOF STEP]
apply (rule power2_le_imp_le, simp)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<Sum>i\<in>F. \<bar>f i\<bar> * \<bar>g i\<bar>) \<le> L2_set f F * L2_set g F\<rbrakk> \<Longrightarrow> (\<bar>f x\<bar> * \<bar>g x\<bar> + (\<Sum>i\<in>F. \<bar>f i\<bar> * \<bar>g i\<bar>))\<^sup>2 \<le> (sqrt ((f x)\<^sup>2 + (L2_set f F)\<^sup>2) * sqrt ((g x)\<^sup>2 + (L2_set g F)\<^sup>2))\<^sup>2
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<Sum>i\<in>F. \<bar>f i\<bar> * \<bar>g i\<bar>) \<le> L2_set f F * L2_set g F\<rbrakk> \<Longrightarrow> 0 \<le> L2_set f (insert x F) * L2_set g (insert x F)
 3. infinite A \<Longrightarrow> (\<Sum>i\<in>A. \<bar>f i\<bar> * \<bar>g i\<bar>) \<le> L2_set f A * L2_set g A
[PROOF STEP]
apply (rule order_trans)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<Sum>i\<in>F. \<bar>f i\<bar> * \<bar>g i\<bar>) \<le> L2_set f F * L2_set g F\<rbrakk> \<Longrightarrow> (\<bar>f x\<bar> * \<bar>g x\<bar> + (\<Sum>i\<in>F. \<bar>f i\<bar> * \<bar>g i\<bar>))\<^sup>2 \<le> ?y5 x F
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<Sum>i\<in>F. \<bar>f i\<bar> * \<bar>g i\<bar>) \<le> L2_set f F * L2_set g F\<rbrakk> \<Longrightarrow> ?y5 x F \<le> (sqrt ((f x)\<^sup>2 + (L2_set f F)\<^sup>2) * sqrt ((g x)\<^sup>2 + (L2_set g F)\<^sup>2))\<^sup>2
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<Sum>i\<in>F. \<bar>f i\<bar> * \<bar>g i\<bar>) \<le> L2_set f F * L2_set g F\<rbrakk> \<Longrightarrow> 0 \<le> L2_set f (insert x F) * L2_set g (insert x F)
 4. infinite A \<Longrightarrow> (\<Sum>i\<in>A. \<bar>f i\<bar> * \<bar>g i\<bar>) \<le> L2_set f A * L2_set g A
[PROOF STEP]
apply (rule power_mono)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<Sum>i\<in>F. \<bar>f i\<bar> * \<bar>g i\<bar>) \<le> L2_set f F * L2_set g F\<rbrakk> \<Longrightarrow> \<bar>f x\<bar> * \<bar>g x\<bar> + (\<Sum>i\<in>F. \<bar>f i\<bar> * \<bar>g i\<bar>) \<le> ?b8 x F
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<Sum>i\<in>F. \<bar>f i\<bar> * \<bar>g i\<bar>) \<le> L2_set f F * L2_set g F\<rbrakk> \<Longrightarrow> 0 \<le> \<bar>f x\<bar> * \<bar>g x\<bar> + (\<Sum>i\<in>F. \<bar>f i\<bar> * \<bar>g i\<bar>)
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<Sum>i\<in>F. \<bar>f i\<bar> * \<bar>g i\<bar>) \<le> L2_set f F * L2_set g F\<rbrakk> \<Longrightarrow> (?b8 x F)\<^sup>2 \<le> (sqrt ((f x)\<^sup>2 + (L2_set f F)\<^sup>2) * sqrt ((g x)\<^sup>2 + (L2_set g F)\<^sup>2))\<^sup>2
 4. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<Sum>i\<in>F. \<bar>f i\<bar> * \<bar>g i\<bar>) \<le> L2_set f F * L2_set g F\<rbrakk> \<Longrightarrow> 0 \<le> L2_set f (insert x F) * L2_set g (insert x F)
 5. infinite A \<Longrightarrow> (\<Sum>i\<in>A. \<bar>f i\<bar> * \<bar>g i\<bar>) \<le> L2_set f A * L2_set g A
[PROOF STEP]
apply (erule add_left_mono)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<Sum>i\<in>F. \<bar>f i\<bar> * \<bar>g i\<bar>) \<le> L2_set f F * L2_set g F\<rbrakk> \<Longrightarrow> 0 \<le> \<bar>f x\<bar> * \<bar>g x\<bar> + (\<Sum>i\<in>F. \<bar>f i\<bar> * \<bar>g i\<bar>)
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<Sum>i\<in>F. \<bar>f i\<bar> * \<bar>g i\<bar>) \<le> L2_set f F * L2_set g F\<rbrakk> \<Longrightarrow> (\<bar>f x\<bar> * \<bar>g x\<bar> + L2_set f F * L2_set g F)\<^sup>2 \<le> (sqrt ((f x)\<^sup>2 + (L2_set f F)\<^sup>2) * sqrt ((g x)\<^sup>2 + (L2_set g F)\<^sup>2))\<^sup>2
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<Sum>i\<in>F. \<bar>f i\<bar> * \<bar>g i\<bar>) \<le> L2_set f F * L2_set g F\<rbrakk> \<Longrightarrow> 0 \<le> L2_set f (insert x F) * L2_set g (insert x F)
 4. infinite A \<Longrightarrow> (\<Sum>i\<in>A. \<bar>f i\<bar> * \<bar>g i\<bar>) \<le> L2_set f A * L2_set g A
[PROOF STEP]
apply (simp add: sum_nonneg)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<Sum>i\<in>F. \<bar>f i\<bar> * \<bar>g i\<bar>) \<le> L2_set f F * L2_set g F\<rbrakk> \<Longrightarrow> (\<bar>f x\<bar> * \<bar>g x\<bar> + L2_set f F * L2_set g F)\<^sup>2 \<le> (sqrt ((f x)\<^sup>2 + (L2_set f F)\<^sup>2) * sqrt ((g x)\<^sup>2 + (L2_set g F)\<^sup>2))\<^sup>2
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<Sum>i\<in>F. \<bar>f i\<bar> * \<bar>g i\<bar>) \<le> L2_set f F * L2_set g F\<rbrakk> \<Longrightarrow> 0 \<le> L2_set f (insert x F) * L2_set g (insert x F)
 3. infinite A \<Longrightarrow> (\<Sum>i\<in>A. \<bar>f i\<bar> * \<bar>g i\<bar>) \<le> L2_set f A * L2_set g A
[PROOF STEP]
apply (simp add: power2_sum)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<Sum>i\<in>F. \<bar>f i\<bar> * \<bar>g i\<bar>) \<le> L2_set f F * L2_set g F\<rbrakk> \<Longrightarrow> (\<bar>f x\<bar> * \<bar>g x\<bar>)\<^sup>2 + (L2_set f F * L2_set g F)\<^sup>2 + 2 * (\<bar>f x\<bar> * \<bar>g x\<bar>) * (L2_set f F * L2_set g F) \<le> (sqrt ((f x)\<^sup>2 + (L2_set f F)\<^sup>2) * sqrt ((g x)\<^sup>2 + (L2_set g F)\<^sup>2))\<^sup>2
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<Sum>i\<in>F. \<bar>f i\<bar> * \<bar>g i\<bar>) \<le> L2_set f F * L2_set g F\<rbrakk> \<Longrightarrow> 0 \<le> L2_set f (insert x F) * L2_set g (insert x F)
 3. infinite A \<Longrightarrow> (\<Sum>i\<in>A. \<bar>f i\<bar> * \<bar>g i\<bar>) \<le> L2_set f A * L2_set g A
[PROOF STEP]
apply (simp add: power_mult_distrib)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<Sum>i\<in>F. \<bar>f i\<bar> * \<bar>g i\<bar>) \<le> L2_set f F * L2_set g F\<rbrakk> \<Longrightarrow> (f x)\<^sup>2 * (g x)\<^sup>2 + (L2_set f F)\<^sup>2 * (L2_set g F)\<^sup>2 + 2 * (\<bar>f x\<bar> * \<bar>g x\<bar>) * (L2_set f F * L2_set g F) \<le> ((f x)\<^sup>2 + (L2_set f F)\<^sup>2) * ((g x)\<^sup>2 + (L2_set g F)\<^sup>2)
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<Sum>i\<in>F. \<bar>f i\<bar> * \<bar>g i\<bar>) \<le> L2_set f F * L2_set g F\<rbrakk> \<Longrightarrow> 0 \<le> L2_set f (insert x F) * L2_set g (insert x F)
 3. infinite A \<Longrightarrow> (\<Sum>i\<in>A. \<bar>f i\<bar> * \<bar>g i\<bar>) \<le> L2_set f A * L2_set g A
[PROOF STEP]
apply (simp add: distrib_left distrib_right)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<Sum>i\<in>F. \<bar>f i\<bar> * \<bar>g i\<bar>) \<le> L2_set f F * L2_set g F\<rbrakk> \<Longrightarrow> 2 * (\<bar>f x\<bar> * \<bar>g x\<bar>) * (L2_set f F * L2_set g F) \<le> (L2_set f F)\<^sup>2 * (g x)\<^sup>2 + (f x)\<^sup>2 * (L2_set g F)\<^sup>2
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<Sum>i\<in>F. \<bar>f i\<bar> * \<bar>g i\<bar>) \<le> L2_set f F * L2_set g F\<rbrakk> \<Longrightarrow> 0 \<le> L2_set f (insert x F) * L2_set g (insert x F)
 3. infinite A \<Longrightarrow> (\<Sum>i\<in>A. \<bar>f i\<bar> * \<bar>g i\<bar>) \<le> L2_set f A * L2_set g A
[PROOF STEP]
apply (rule ord_le_eq_trans)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<Sum>i\<in>F. \<bar>f i\<bar> * \<bar>g i\<bar>) \<le> L2_set f F * L2_set g F\<rbrakk> \<Longrightarrow> 2 * (\<bar>f x\<bar> * \<bar>g x\<bar>) * (L2_set f F * L2_set g F) \<le> ?b12 x F
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<Sum>i\<in>F. \<bar>f i\<bar> * \<bar>g i\<bar>) \<le> L2_set f F * L2_set g F\<rbrakk> \<Longrightarrow> ?b12 x F = (L2_set f F)\<^sup>2 * (g x)\<^sup>2 + (f x)\<^sup>2 * (L2_set g F)\<^sup>2
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<Sum>i\<in>F. \<bar>f i\<bar> * \<bar>g i\<bar>) \<le> L2_set f F * L2_set g F\<rbrakk> \<Longrightarrow> 0 \<le> L2_set f (insert x F) * L2_set g (insert x F)
 4. infinite A \<Longrightarrow> (\<Sum>i\<in>A. \<bar>f i\<bar> * \<bar>g i\<bar>) \<le> L2_set f A * L2_set g A
[PROOF STEP]
apply (rule L2_set_mult_ineq_lemma)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<Sum>i\<in>F. \<bar>f i\<bar> * \<bar>g i\<bar>) \<le> L2_set f F * L2_set g F\<rbrakk> \<Longrightarrow> \<bar>f x\<bar>\<^sup>2 * (L2_set g F)\<^sup>2 + (L2_set f F)\<^sup>2 * \<bar>g x\<bar>\<^sup>2 = (L2_set f F)\<^sup>2 * (g x)\<^sup>2 + (f x)\<^sup>2 * (L2_set g F)\<^sup>2
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<Sum>i\<in>F. \<bar>f i\<bar> * \<bar>g i\<bar>) \<le> L2_set f F * L2_set g F\<rbrakk> \<Longrightarrow> 0 \<le> L2_set f (insert x F) * L2_set g (insert x F)
 3. infinite A \<Longrightarrow> (\<Sum>i\<in>A. \<bar>f i\<bar> * \<bar>g i\<bar>) \<le> L2_set f A * L2_set g A
[PROOF STEP]
apply simp_all
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma dmask_aux:
  fixes c :: nat
  shows "d < c \<Longrightarrow> (2^c - Suc 0) div 2^d = 2 ^ (c - d) - Suc 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d < c \<Longrightarrow> (2 ^ c - Suc 0) div 2 ^ d = 2 ^ (c - d) - Suc 0
[PROOF STEP]
proof (induction d)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < c \<Longrightarrow> (2 ^ c - Suc 0) div 2 ^ 0 = 2 ^ (c - 0) - Suc 0
 2. \<And>d. \<lbrakk>d < c \<Longrightarrow> (2 ^ c - Suc 0) div 2 ^ d = 2 ^ (c - d) - Suc 0; Suc d < c\<rbrakk> \<Longrightarrow> (2 ^ c - Suc 0) div 2 ^ Suc d = 2 ^ (c - Suc d) - Suc 0
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
0 < c

goal (2 subgoals):
 1. 0 < c \<Longrightarrow> (2 ^ c - Suc 0) div 2 ^ 0 = 2 ^ (c - 0) - Suc 0
 2. \<And>d. \<lbrakk>d < c \<Longrightarrow> (2 ^ c - Suc 0) div 2 ^ d = 2 ^ (c - d) - Suc 0; Suc d < c\<rbrakk> \<Longrightarrow> (2 ^ c - Suc 0) div 2 ^ Suc d = 2 ^ (c - Suc d) - Suc 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < c
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
0 < c

goal (1 subgoal):
 1. (2 ^ c - Suc 0) div 2 ^ 0 = 2 ^ (c - 0) - Suc 0
[PROOF STEP]
by (auto)
[PROOF STATE]
proof (state)
this:
(2 ^ c - Suc 0) div 2 ^ 0 = 2 ^ (c - 0) - Suc 0

goal (1 subgoal):
 1. \<And>d. \<lbrakk>d < c \<Longrightarrow> (2 ^ c - Suc 0) div 2 ^ d = 2 ^ (c - d) - Suc 0; Suc d < c\<rbrakk> \<Longrightarrow> (2 ^ c - Suc 0) div 2 ^ Suc d = 2 ^ (c - Suc d) - Suc 0
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>d. \<lbrakk>d < c \<Longrightarrow> (2 ^ c - Suc 0) div 2 ^ d = 2 ^ (c - d) - Suc 0; Suc d < c\<rbrakk> \<Longrightarrow> (2 ^ c - Suc 0) div 2 ^ Suc d = 2 ^ (c - Suc d) - Suc 0
[PROOF STEP]
case (Suc d)
[PROOF STATE]
proof (state)
this:
d < c \<Longrightarrow> (2 ^ c - Suc 0) div 2 ^ d = 2 ^ (c - d) - Suc 0
Suc d < c

goal (1 subgoal):
 1. \<And>d. \<lbrakk>d < c \<Longrightarrow> (2 ^ c - Suc 0) div 2 ^ d = 2 ^ (c - d) - Suc 0; Suc d < c\<rbrakk> \<Longrightarrow> (2 ^ c - Suc 0) div 2 ^ Suc d = 2 ^ (c - Suc d) - Suc 0
[PROOF STEP]
have d: "d < c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d < c
[PROOF STEP]
using Suc.prems
[PROOF STATE]
proof (prove)
using this:
Suc d < c

goal (1 subgoal):
 1. d < c
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
d < c

goal (1 subgoal):
 1. \<And>d. \<lbrakk>d < c \<Longrightarrow> (2 ^ c - Suc 0) div 2 ^ d = 2 ^ (c - d) - Suc 0; Suc d < c\<rbrakk> \<Longrightarrow> (2 ^ c - Suc 0) div 2 ^ Suc d = 2 ^ (c - Suc d) - Suc 0
[PROOF STEP]
have "(2 ^ c - Suc 0) div 2 ^ Suc d = (2 ^ c - Suc 0) div 2 ^ d div 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2 ^ c - Suc 0) div 2 ^ Suc d = (2 ^ c - Suc 0) div 2 ^ d div 2
[PROOF STEP]
by (auto) (metis mult.commute div_mult2_eq)
[PROOF STATE]
proof (state)
this:
(2 ^ c - Suc 0) div 2 ^ Suc d = (2 ^ c - Suc 0) div 2 ^ d div 2

goal (1 subgoal):
 1. \<And>d. \<lbrakk>d < c \<Longrightarrow> (2 ^ c - Suc 0) div 2 ^ d = 2 ^ (c - d) - Suc 0; Suc d < c\<rbrakk> \<Longrightarrow> (2 ^ c - Suc 0) div 2 ^ Suc d = 2 ^ (c - Suc d) - Suc 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(2 ^ c - Suc 0) div 2 ^ Suc d = (2 ^ c - Suc 0) div 2 ^ d div 2

goal (1 subgoal):
 1. \<And>d. \<lbrakk>d < c \<Longrightarrow> (2 ^ c - Suc 0) div 2 ^ d = 2 ^ (c - d) - Suc 0; Suc d < c\<rbrakk> \<Longrightarrow> (2 ^ c - Suc 0) div 2 ^ Suc d = 2 ^ (c - Suc d) - Suc 0
[PROOF STEP]
have "... = (2 ^ (c - d) - Suc 0) div 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2 ^ c - Suc 0) div 2 ^ d div 2 = (2 ^ (c - d) - Suc 0) div 2
[PROOF STEP]
by (subst Suc.IH) (auto simp: d)
[PROOF STATE]
proof (state)
this:
(2 ^ c - Suc 0) div 2 ^ d div 2 = (2 ^ (c - d) - Suc 0) div 2

goal (1 subgoal):
 1. \<And>d. \<lbrakk>d < c \<Longrightarrow> (2 ^ c - Suc 0) div 2 ^ d = 2 ^ (c - d) - Suc 0; Suc d < c\<rbrakk> \<Longrightarrow> (2 ^ c - Suc 0) div 2 ^ Suc d = 2 ^ (c - Suc d) - Suc 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(2 ^ c - Suc 0) div 2 ^ d div 2 = (2 ^ (c - d) - Suc 0) div 2

goal (1 subgoal):
 1. \<And>d. \<lbrakk>d < c \<Longrightarrow> (2 ^ c - Suc 0) div 2 ^ d = 2 ^ (c - d) - Suc 0; Suc d < c\<rbrakk> \<Longrightarrow> (2 ^ c - Suc 0) div 2 ^ Suc d = 2 ^ (c - Suc d) - Suc 0
[PROOF STEP]
have "... = 2 ^ (c - Suc d) - Suc 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2 ^ (c - d) - Suc 0) div 2 = 2 ^ (c - Suc d) - Suc 0
[PROOF STEP]
apply (subst dmask_aux0[of "c - d"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 0 < c - d
 2. 2 ^ (c - d - 1) - Suc 0 = 2 ^ (c - Suc d) - Suc 0
[PROOF STEP]
using d
[PROOF STATE]
proof (prove)
using this:
d < c

goal (2 subgoals):
 1. 0 < c - d
 2. 2 ^ (c - d - 1) - Suc 0 = 2 ^ (c - Suc d) - Suc 0
[PROOF STEP]
by (auto)
[PROOF STATE]
proof (state)
this:
(2 ^ (c - d) - Suc 0) div 2 = 2 ^ (c - Suc d) - Suc 0

goal (1 subgoal):
 1. \<And>d. \<lbrakk>d < c \<Longrightarrow> (2 ^ c - Suc 0) div 2 ^ d = 2 ^ (c - d) - Suc 0; Suc d < c\<rbrakk> \<Longrightarrow> (2 ^ c - Suc 0) div 2 ^ Suc d = 2 ^ (c - Suc d) - Suc 0
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(2 ^ c - Suc 0) div 2 ^ Suc d = 2 ^ (c - Suc d) - Suc 0
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(2 ^ c - Suc 0) div 2 ^ Suc d = 2 ^ (c - Suc d) - Suc 0

goal (1 subgoal):
 1. (2 ^ c - Suc 0) div 2 ^ Suc d = 2 ^ (c - Suc d) - Suc 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(2 ^ c - Suc 0) div 2 ^ Suc d = 2 ^ (c - Suc d) - Suc 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma map_join_pmf: "map_pmf f (join_pmf AA) = join_pmf (map_pmf (map_pmf f) AA)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_pmf f (join_pmf AA) = join_pmf (map_pmf (map_pmf f) AA)
[PROOF STEP]
by (simp add: join_pmf_def map_pmf_def bind_assoc_pmf bind_return_pmf)


[STATEMENT]
lemma powr_mono2':
  fixes a x y :: real
  assumes "a \<le> 0" "x > 0" "x \<le> y"
  shows "x powr a \<ge> y powr a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y powr a \<le> x powr a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. y powr a \<le> x powr a
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
a \<le> 0
0 < x
x \<le> y
[PROOF STEP]
have "x powr - a \<le> y powr - a"
[PROOF STATE]
proof (prove)
using this:
a \<le> 0
0 < x
x \<le> y

goal (1 subgoal):
 1. x powr - a \<le> y powr - a
[PROOF STEP]
by (intro powr_mono2) simp_all
[PROOF STATE]
proof (state)
this:
x powr - a \<le> y powr - a

goal (1 subgoal):
 1. y powr a \<le> x powr a
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
a \<le> 0
0 < x
x \<le> y
x powr - a \<le> y powr - a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a \<le> 0
0 < x
x \<le> y
x powr - a \<le> y powr - a

goal (1 subgoal):
 1. y powr a \<le> x powr a
[PROOF STEP]
by (auto simp: powr_minus field_simps)
[PROOF STATE]
proof (state)
this:
y powr a \<le> x powr a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Nset_nonempty:"{i. i \<le> (n::nat)} \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {i. i \<le> n} \<noteq> {}
[PROOF STEP]
apply (subgoal_tac "0 \<in> {i. i \<le> n}")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 0 \<in> {i. i \<le> n} \<Longrightarrow> {i. i \<le> n} \<noteq> {}
 2. 0 \<in> {i. i \<le> n}
[PROOF STEP]
apply (rule nonempty[of 0], assumption)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<in> {i. i \<le> n}
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma expectation_uniform_count:
  assumes "M = uniform_count_measure X" and "finite X"
  shows "expectation f = (\<Sum> x \<in> X. f x) / card X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. expectation f = sum f X / real (card X)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. expectation f = sum f X / real (card X)
[PROOF STEP]
have "expectation f = (\<Sum> x \<in> X. (1 / (card X)) * f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. expectation f = (\<Sum>x\<in>X. 1 / real (card X) * f x)
[PROOF STEP]
using assms uniform_count_measure_def bot_nat_0.extremum of_nat_0 of_nat_le_iff real_scaleR_def
    lebesgue_integral_point_measure_finite[of _ "(\<lambda> x. 1 / card X)" "f"]
    scaleR_sum_right sum_distrib_left zero_le_divide_1_iff
[PROOF STATE]
proof (prove)
using this:
M = uniform_count_measure X
finite X
uniform_count_measure ?A = point_measure ?A (\<lambda>x. ennreal (1 / real (card ?A)))
0 \<le> ?a
of_nat 0 = (0::?'a)
(of_nat ?m \<le> of_nat ?n) = (?m \<le> ?n)
?a *\<^sub>R ?x = ?a * ?x
\<lbrakk>finite ?A; \<And>a. a \<in> ?A \<Longrightarrow> 0 \<le> 1 / real (card X)\<rbrakk> \<Longrightarrow> integral\<^sup>L (point_measure ?A (\<lambda>x. ennreal (1 / real (card X)))) f = (\<Sum>a\<in>?A. (1 / real (card X)) *\<^sub>R f a)
?a *\<^sub>R sum ?f ?A = (\<Sum>x\<in>?A. ?a *\<^sub>R ?f x)
?r * sum ?f ?A = (\<Sum>n\<in>?A. ?r * ?f n)
((0::?'a) \<le> (1::?'a) / ?a) = ((0::?'a) \<le> ?a)

goal (1 subgoal):
 1. expectation f = (\<Sum>x\<in>X. 1 / real (card X) * f x)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
expectation f = (\<Sum>x\<in>X. 1 / real (card X) * f x)

goal (1 subgoal):
 1. expectation f = sum f X / real (card X)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
expectation f = (\<Sum>x\<in>X. 1 / real (card X) * f x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
expectation f = (\<Sum>x\<in>X. 1 / real (card X) * f x)

goal (1 subgoal):
 1. expectation f = sum f X / real (card X)
[PROOF STEP]
using sum_left_div_distrib
[PROOF STATE]
proof (prove)
using this:
expectation f = (\<Sum>x\<in>X. 1 / real (card X) * f x)
(\<Sum>i\<in>?I. ?f i / ?x) = sum ?f ?I / ?x

goal (1 subgoal):
 1. expectation f = sum f X / real (card X)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
expectation f = sum f X / real (card X)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma divide_eq1:
  assumes "eventually (\<lambda>x. h x \<noteq> 0) F"
  shows   "f \<in> L F (\<lambda>x. g x / h x) \<longleftrightarrow> (\<lambda>x. f x * h x) \<in> L F (g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<in> L F (\<lambda>x. g x / h x)) = ((\<lambda>x. f x * h x) \<in> L F g)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (f \<in> L F (\<lambda>x. g x / h x)) = ((\<lambda>x. f x * h x) \<in> L F g)
[PROOF STEP]
have "f \<in> L F (\<lambda>x. g x / h x) \<longleftrightarrow> (\<lambda>x. f x * h x / h x) \<in> L F (\<lambda>x. g x / h x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<in> L F (\<lambda>x. g x / h x)) = ((\<lambda>x. f x * h x / h x) \<in> L F (\<lambda>x. g x / h x))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. h x \<noteq> (0::'b)

goal (1 subgoal):
 1. (f \<in> L F (\<lambda>x. g x / h x)) = ((\<lambda>x. f x * h x / h x) \<in> L F (\<lambda>x. g x / h x))
[PROOF STEP]
by (intro in_cong) (auto elim: eventually_mono)
[PROOF STATE]
proof (state)
this:
(f \<in> L F (\<lambda>x. g x / h x)) = ((\<lambda>x. f x * h x / h x) \<in> L F (\<lambda>x. g x / h x))

goal (1 subgoal):
 1. (f \<in> L F (\<lambda>x. g x / h x)) = ((\<lambda>x. f x * h x) \<in> L F g)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(f \<in> L F (\<lambda>x. g x / h x)) = ((\<lambda>x. f x * h x / h x) \<in> L F (\<lambda>x. g x / h x))

goal (1 subgoal):
 1. (f \<in> L F (\<lambda>x. g x / h x)) = ((\<lambda>x. f x * h x) \<in> L F g)
[PROOF STEP]
by (simp only: divide_right_iff assms)
[PROOF STATE]
proof (state)
this:
(f \<in> L F (\<lambda>x. g x / h x)) = ((\<lambda>x. f x * h x) \<in> L F g)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cube_restrict:
  assumes "j < n"
    and "y \<in> cube n t"
  shows "(\<lambda>g \<in> {..<j}. y g) \<in> cube j t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. restrict y {..<j} \<in> cube j t
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
j < n
y \<in> cube n t

goal (1 subgoal):
 1. restrict y {..<j} \<in> cube j t
[PROOF STEP]
unfolding cube_def
[PROOF STATE]
proof (prove)
using this:
j < n
y \<in> {..<n} \<rightarrow>\<^sub>E {..<t}

goal (1 subgoal):
 1. restrict y {..<j} \<in> {..<j} \<rightarrow>\<^sub>E {..<t}
[PROOF STEP]
by force


[STATEMENT]
lemma (in group) subgroup_intersect:
  assumes "subgroup H G"
  assumes "subgroup H' G"
  shows "subgroup (H \<inter> H') G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgroup (H \<inter> H') G
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
subgroup H G
subgroup H' G

goal (1 subgoal):
 1. subgroup (H \<inter> H') G
[PROOF STEP]
unfolding subgroup_def
[PROOF STATE]
proof (prove)
using this:
(H \<subseteq> carrier G \<and> (\<forall>x y. x \<in> H \<longrightarrow> y \<in> H \<longrightarrow> x \<otimes> y \<in> H)) \<and> \<one> \<in> H \<and> (\<forall>x. x \<in> H \<longrightarrow> inv x \<in> H)
(H' \<subseteq> carrier G \<and> (\<forall>x y. x \<in> H' \<longrightarrow> y \<in> H' \<longrightarrow> x \<otimes> y \<in> H')) \<and> \<one> \<in> H' \<and> (\<forall>x. x \<in> H' \<longrightarrow> inv x \<in> H')

goal (1 subgoal):
 1. (H \<inter> H' \<subseteq> carrier G \<and> (\<forall>x y. x \<in> H \<inter> H' \<longrightarrow> y \<in> H \<inter> H' \<longrightarrow> x \<otimes> y \<in> H \<inter> H')) \<and> \<one> \<in> H \<inter> H' \<and> (\<forall>x. x \<in> H \<inter> H' \<longrightarrow> inv x \<in> H \<inter> H')
[PROOF STEP]
by auto


[STATEMENT]
lemma bounded_minus:
  fixes S ::"'a::real_normed_vector set"
  assumes "bounded S" "bounded T"
  shows "bounded ((\<lambda>(x,y). x - y) ` (S \<times> T))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded ((\<lambda>(x, y). x - y) ` (S \<times> T))
[PROOF STEP]
using bounded_minus_comp [of fst "S \<times> T" snd] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>bounded (fst ` (S \<times> T)); bounded (snd ` (S \<times> T))\<rbrakk> \<Longrightarrow> bounded ((\<lambda>x. fst x - snd x) ` (S \<times> T))
bounded S
bounded T

goal (1 subgoal):
 1. bounded ((\<lambda>(x, y). x - y) ` (S \<times> T))
[PROOF STEP]
by (auto simp: split_def split: if_split_asm)


[STATEMENT]
lemma Pbij_inverse_DomRng[rule_format]:
  "\<gamma> = Pbij_inverse \<beta> \<Longrightarrow>
   (Pbij_Dom \<beta> = Pbij_Rng \<gamma> \<and> Pbij_Dom \<gamma> = Pbij_Rng \<beta>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<gamma> = Pbij_inverse \<beta> \<Longrightarrow> Pbij_Dom \<beta> = Pbij_Rng \<gamma> \<and> Pbij_Dom \<gamma> = Pbij_Rng \<beta>
[PROOF STEP]
(*<*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<gamma> = Pbij_inverse \<beta> \<Longrightarrow> Pbij_Dom \<beta> = Pbij_Rng \<gamma> \<and> Pbij_Dom \<gamma> = Pbij_Rng \<beta>
[PROOF STEP]
by (simp add: Pbij_inverse_def Pbij_Dom_def Pbij_Rng_def)


[STATEMENT]
lemma sum_mat_mono_gt:
  assumes "sd \<le> n"
  and A: "A \<in> carrier_mat n n" and B: "B \<in> carrier_mat n n"
  and AB: "mat_gt (\<succ>) sd A (B :: 'a mat)"
  shows "sum_mat A \<succ> sum_mat B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_mat A \<succ> sum_mat B
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum_mat A \<succ> sum_mat B
[PROOF STEP]
from A B
[PROOF STATE]
proof (chain)
picking this:
A \<in> carrier_mat n n
B \<in> carrier_mat n n
[PROOF STEP]
have id: "dim_row B = dim_row A" "dim_col B = dim_col A"
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
B \<in> carrier_mat n n

goal (1 subgoal):
 1. dim_row B = dim_row A &&& dim_col B = dim_col A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dim_row B = dim_row A
dim_col B = dim_col A

goal (1 subgoal):
 1. sum_mat A \<succ> sum_mat B
[PROOF STEP]
from mat_gtD[OF AB]
[PROOF STATE]
proof (chain)
picking this:
A \<ge>\<^sub>m B
\<exists>i<sd. \<exists>j<sd. A $$ (i, j) \<succ> B $$ (i, j)
[PROOF STEP]
obtain i j where AB: "A \<ge>\<^sub>m B" and
    ij: "i < sd" "j < sd" and gt: "A $$ (i,j) \<succ> B $$ (i,j)"
[PROOF STATE]
proof (prove)
using this:
A \<ge>\<^sub>m B
\<exists>i<sd. \<exists>j<sd. A $$ (i, j) \<succ> B $$ (i, j)

goal (1 subgoal):
 1. (\<And>i j. \<lbrakk>A \<ge>\<^sub>m B; i < sd; j < sd; A $$ (i, j) \<succ> B $$ (i, j)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A \<ge>\<^sub>m B
i < sd
j < sd
A $$ (i, j) \<succ> B $$ (i, j)

goal (1 subgoal):
 1. sum_mat A \<succ> sum_mat B
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_mat A \<succ> sum_mat B
[PROOF STEP]
unfolding sum_mat_def id
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum (($$) A) ({0..<dim_row A} \<times> {0..<dim_col A}) \<succ> sum (($$) B) ({0..<dim_row A} \<times> {0..<dim_col A})
[PROOF STEP]
by (rule sum_mono_gt[of _ _ _ "(i,j)"], insert ij gt mat_geD[OF AB] A B \<open>sd \<le> n\<close>, auto)
[PROOF STATE]
proof (state)
this:
sum_mat A \<succ> sum_mat B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "(-10::int) mod 3 = 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - 10 mod 3 = 2
[PROOF STEP]
by simp


[STATEMENT]
lemma tendsto_ln_powr_over_ln_powr'':
  "a > 0 \<Longrightarrow> ((\<lambda>x::real. ln (a*x) powr d / ln x powr d) \<longlongrightarrow> 1) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < a \<Longrightarrow> ((\<lambda>x. ln (a * x) powr d / ln x powr d) \<longlongrightarrow> 1) at_top
[PROOF STEP]
using tendsto_ln_powr_over_ln_powr[of _ 1]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < ?a; 0 < 1\<rbrakk> \<Longrightarrow> ((\<lambda>x. ln (?a * x) powr ?d / ln (1 * x) powr ?d) \<longlongrightarrow> 1) at_top

goal (1 subgoal):
 1. 0 < a \<Longrightarrow> ((\<lambda>x. ln (a * x) powr d / ln x powr d) \<longlongrightarrow> 1) at_top
[PROOF STEP]
by simp


[STATEMENT]
lemma foo:
  fixes v :: "'a :: comm_semiring_1 vec"
  shows "monom 1 d \<cdot>\<^sub>v map_vec coeff_lift v = map_vec (\<lambda>a. monom a d) v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monom (1::'a) d \<cdot>\<^sub>v coeff_lift_hom.vec_hom v = map_vec (\<lambda>a. monom a d) v
[PROOF STEP]
apply (rule eq_vecI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i. i < dim_vec (map_vec (\<lambda>a. monom a d) v) \<Longrightarrow> (monom (1::'a) d \<cdot>\<^sub>v coeff_lift_hom.vec_hom v) $ i = map_vec (\<lambda>a. monom a d) v $ i
 2. dim_vec (monom (1::'a) d \<cdot>\<^sub>v coeff_lift_hom.vec_hom v) = dim_vec (map_vec (\<lambda>a. monom a d) v)
[PROOF STEP]
unfolding index_map_vec index_col
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i. i < dim_vec v \<Longrightarrow> (monom (1::'a) d \<cdot>\<^sub>v coeff_lift_hom.vec_hom v) $ i = monom (v $ i) d
 2. dim_vec (monom (1::'a) d \<cdot>\<^sub>v coeff_lift_hom.vec_hom v) = dim_vec v
[PROOF STEP]
by (auto simp add: Polynomial.smult_monom)


[STATEMENT]
lemma [measurable (raw)]:
  fixes f :: "nat \<Rightarrow> 'a \<Rightarrow> 'b::{complete_linorder, second_countable_topology, linorder_topology}"
  assumes "\<And>i. f i \<in> borel_measurable M"
  shows borel_measurable_liminf: "(\<lambda>x. liminf (\<lambda>i. f i x)) \<in> borel_measurable M"
    and borel_measurable_limsup: "(\<lambda>x. limsup (\<lambda>i. f i x)) \<in> borel_measurable M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. liminf (\<lambda>i. f i x)) \<in> borel_measurable M &&& (\<lambda>x. limsup (\<lambda>i. f i x)) \<in> borel_measurable M
[PROOF STEP]
unfolding liminf_SUP_INF limsup_INF_SUP
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. SUP n. INF i\<in>{n..}. f i x) \<in> borel_measurable M &&& (\<lambda>x. INF n. SUP i\<in>{n..}. f i x) \<in> borel_measurable M
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f ?i \<in> borel_measurable M

goal (1 subgoal):
 1. (\<lambda>x. SUP n. INF i\<in>{n..}. f i x) \<in> borel_measurable M &&& (\<lambda>x. INF n. SUP i\<in>{n..}. f i x) \<in> borel_measurable M
[PROOF STEP]
by auto


[STATEMENT]
theorem wls_vsubst_subst_compose2:
assumes  "wls s X" and "wls (asSort ys) Y"
and "ys \<noteq> zs \<or> y \<notin> {z,z1}"
shows "((X #[Y / y]_ys) #[z1 // z]_zs) = ((X #[z1 // z]_zs) #[(Y #[z1 // z]_zs) / y]_ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X #[Y / y]_ys #[z1 // z]_zs = X #[z1 // z]_zs #[Y #[z1 // z]_zs / y]_ys
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
wls s X
wls (asSort ys) Y
ys \<noteq> zs \<or> y \<notin> {z, z1}

goal (1 subgoal):
 1. X #[Y / y]_ys #[z1 // z]_zs = X #[z1 // z]_zs #[Y #[z1 // z]_zs / y]_ys
[PROOF STEP]
by(simp add: vsubst_subst_compose2)


[STATEMENT]
lemma contrapositive: "(X guarantees Y) = -Y guarantees -X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X guarantees Y = - Y guarantees - X
[PROOF STEP]
by (unfold guar_def, blast)


[STATEMENT]
lemma delete_node_set_edges:
    "set (edgesL (delete_node v G)) = {(a,b). (a, b) \<in> set (edgesL G) \<and> a \<noteq> v \<and> b \<noteq> v}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (edgesL (FiniteListGraph.delete_node v G)) = {(a, b). (a, b) \<in> set (edgesL G) \<and> a \<noteq> v \<and> b \<noteq> v}
[PROOF STEP]
unfolding delete_node_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (edgesL \<lparr>nodesL = remove1 v (nodesL G), edgesL = filter (\<lambda>(e1, e2). e1 \<noteq> v \<and> e2 \<noteq> v) (edgesL G)\<rparr>) = {(a, b). (a, b) \<in> set (edgesL G) \<and> a \<noteq> v \<and> b \<noteq> v}
[PROOF STEP]
by auto


[STATEMENT]
lemma uncountable_UNIV_real: "uncountable (UNIV :: real set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uncountable UNIV
[PROOF STEP]
using real_non_denum
[PROOF STATE]
proof (prove)
using this:
\<nexists>f. surj f

goal (1 subgoal):
 1. uncountable UNIV
[PROOF STEP]
unfolding uncountable_def
[PROOF STATE]
proof (prove)
using this:
\<nexists>f. surj f

goal (1 subgoal):
 1. UNIV \<noteq> {} \<and> (\<nexists>f. surj f)
[PROOF STEP]
by auto


[STATEMENT]
lemma synth_parts_mono: "G\<subseteq>H \<Longrightarrow> synth (parts G) \<subseteq> synth (parts H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. G \<subseteq> H \<Longrightarrow> synth (parts G) \<subseteq> synth (parts H)
[PROOF STEP]
by (iprover intro: synth_mono parts_mono)


[STATEMENT]
lemma has_vderiv_on_compose':
  assumes "(f has_vderiv_on f') (g ` T)"
  assumes "(g has_vderiv_on g') T"
  shows "((\<lambda>x. f (g x)) has_vderiv_on (\<lambda>x. g' x *\<^sub>R f' (g x))) T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f (g x)) has_vderiv_on (\<lambda>x. g' x *\<^sub>R f' (g x))) T
[PROOF STEP]
using has_vderiv_on_compose[OF assms]
[PROOF STATE]
proof (prove)
using this:
(f \<circ> g has_vderiv_on (\<lambda>x. g' x *\<^sub>R f' (g x))) T

goal (1 subgoal):
 1. ((\<lambda>x. f (g x)) has_vderiv_on (\<lambda>x. g' x *\<^sub>R f' (g x))) T
[PROOF STEP]
by simp


[STATEMENT]
lemma ccInf_superset_mono: "countable A \<Longrightarrow> B \<subseteq> A \<Longrightarrow> Inf A \<le> Inf B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>countable A; B \<subseteq> A\<rbrakk> \<Longrightarrow> Inf A \<le> Inf B
[PROOF STEP]
by (auto intro: ccInf_greatest ccInf_lower countable_subset)


[STATEMENT]
lemma all_edges_between_swap:
  "all_edges_between X Y = (\<lambda>(x,y). (y,x)) ` (all_edges_between Y X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. all_edges_between X Y = (\<lambda>(x, y). (y, x)) ` all_edges_between Y X
[PROOF STEP]
unfolding all_edges_between_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(x, y). x \<in> X \<and> y \<in> Y \<and> {x, y} \<in> E} = (\<lambda>(x, y). (y, x)) ` {(x, y). x \<in> Y \<and> y \<in> X \<and> {x, y} \<in> E}
[PROOF STEP]
by (auto simp add: insert_commute image_iff split: prod.split)


[STATEMENT]
lemma (in jozsa) \<psi>\<^sub>3_values:
  assumes "i < dim_row \<psi>\<^sub>3"
  shows "odd i \<longrightarrow> \<psi>\<^sub>3 $$ (i,0) = (\<Sum>k<2^n. (-1)^(f(k) + 1 + ((i div 2) \<cdot>\<^bsub>n\<^esub> k))/((sqrt 2)^n * (sqrt 2)^(n+1)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. odd i \<longrightarrow> Matrix.mat (2 ^ (n + 1)) 1 (\<lambda>x. complex_of_real (case x of (i, j) \<Rightarrow> if even i then \<Sum>k<2 ^ n. (- 1) ^ (f k + i div 2 \<cdot>\<^bsub>n\<^esub>  k) / (sqrt 2 ^ n * sqrt 2 ^ (n + 1)) else \<Sum>k<2 ^ n. (- 1) ^ (f k + 1 + i div 2 \<cdot>\<^bsub>n\<^esub>  k) / (sqrt 2 ^ n * sqrt 2 ^ (n + 1)))) $$ (i, 0) = complex_of_real (\<Sum>k<2 ^ n. (- 1) ^ (f k + 1 + i div 2 \<cdot>\<^bsub>n\<^esub>  k) / (sqrt 2 ^ n * sqrt 2 ^ (n + 1)))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
i < dim_row (Matrix.mat (2 ^ (n + 1)) 1 (\<lambda>x. complex_of_real (case x of (i, j) \<Rightarrow> if even i then \<Sum>k<2 ^ n. (- 1) ^ (f k + i div 2 \<cdot>\<^bsub>n\<^esub>  k) / (sqrt 2 ^ n * sqrt 2 ^ (n + 1)) else \<Sum>k<2 ^ n. (- 1) ^ (f k + 1 + i div 2 \<cdot>\<^bsub>n\<^esub>  k) / (sqrt 2 ^ n * sqrt 2 ^ (n + 1)))))

goal (1 subgoal):
 1. odd i \<longrightarrow> Matrix.mat (2 ^ (n + 1)) 1 (\<lambda>x. complex_of_real (case x of (i, j) \<Rightarrow> if even i then \<Sum>k<2 ^ n. (- 1) ^ (f k + i div 2 \<cdot>\<^bsub>n\<^esub>  k) / (sqrt 2 ^ n * sqrt 2 ^ (n + 1)) else \<Sum>k<2 ^ n. (- 1) ^ (f k + 1 + i div 2 \<cdot>\<^bsub>n\<^esub>  k) / (sqrt 2 ^ n * sqrt 2 ^ (n + 1)))) $$ (i, 0) = complex_of_real (\<Sum>k<2 ^ n. (- 1) ^ (f k + 1 + i div 2 \<cdot>\<^bsub>n\<^esub>  k) / (sqrt 2 ^ n * sqrt 2 ^ (n + 1)))
[PROOF STEP]
by simp


[STATEMENT]
lemma ord0_less_trans:
"\<lbrakk>(x::ord0) < y; y < z\<rbrakk> \<Longrightarrow> x < z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x < y; y < z\<rbrakk> \<Longrightarrow> x < z
[PROOF STEP]
apply (unfold ord0_less_def, clarify)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa ya za xaa yaa zaa. \<lbrakk>(x, ya) \<in> ord0_leq; (ya, y) \<in> ord0_prec\<^sup>+; (y, yaa) \<in> ord0_leq; (yaa, z) \<in> ord0_prec\<^sup>+\<rbrakk> \<Longrightarrow> (x, z) \<in> ord0_leq O ord0_prec\<^sup>+
[PROOF STEP]
apply (drule ord0_leqD, assumption, clarify)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa ya za xaa yaa zaa xb yb zb. \<lbrakk>(x, xb) \<in> ord0_leq; (xb, y) \<in> ord0_prec\<^sup>+; (zb, z) \<in> ord0_prec\<^sup>+; (xb, yb) \<in> ord0_leq; (yb, zb) \<in> ord0_prec\<^sup>+\<rbrakk> \<Longrightarrow> (x, z) \<in> ord0_leq O ord0_prec\<^sup>+
[PROOF STEP]
by (rule relcompI[OF ord0_leq_trans trancl_trans])