[STATEMENT]
lemma sum_Union_span:
  assumes "A \<subseteq> G"
  shows "\<Union> ((\<lambda> d .{(a, b) | a b. a \<in> A \<and> b \<in> A \<and> (a \<oplus> b = d)}) ` (sumset A A)) = A \<times> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>d\<in>sumset A A. {(a, b) |a b. a \<in> A \<and> b \<in> A \<and> a \<oplus> b = d}) = A \<times> A
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<Union>d\<in>sumset A A. {(a, b) |a b. a \<in> A \<and> b \<in> A \<and> a \<oplus> b = d}) \<subseteq> A \<times> A
 2. A \<times> A \<subseteq> (\<Union>d\<in>sumset A A. {(a, b) |a b. a \<in> A \<and> b \<in> A \<and> a \<oplus> b = d})
[PROOF STEP]
show "\<Union> ((\<lambda> d .{(a, b) | a b. a \<in> A \<and> b \<in> A \<and> (a \<oplus> b = d)}) ` (sumset A A)) \<subseteq> A \<times> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>d\<in>sumset A A. {(a, b) |a b. a \<in> A \<and> b \<in> A \<and> a \<oplus> b = d}) \<subseteq> A \<times> A
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<Union>d\<in>sumset A A. {(a, b) |a b. a \<in> A \<and> b \<in> A \<and> a \<oplus> b = d}) \<subseteq> A \<times> A

goal (1 subgoal):
 1. A \<times> A \<subseteq> (\<Union>d\<in>sumset A A. {(a, b) |a b. a \<in> A \<and> b \<in> A \<and> a \<oplus> b = d})
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A \<times> A \<subseteq> (\<Union>d\<in>sumset A A. {(a, b) |a b. a \<in> A \<and> b \<in> A \<and> a \<oplus> b = d})
[PROOF STEP]
show "A \<times> A \<subseteq> \<Union> ((\<lambda> d .{(a, b) | a b. a \<in> A \<and> b \<in> A \<and> (a \<oplus> b = d)}) ` (sumset A A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<times> A \<subseteq> (\<Union>d\<in>sumset A A. {(a, b) |a b. a \<in> A \<and> b \<in> A \<and> a \<oplus> b = d})
[PROOF STEP]
proof (intro subsetI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> A \<times> A \<Longrightarrow> x \<in> (\<Union>d\<in>sumset A A. {(a, b) |a b. a \<in> A \<and> b \<in> A \<and> a \<oplus> b = d})
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> A \<times> A \<Longrightarrow> x \<in> (\<Union>d\<in>sumset A A. {(a, b) |a b. a \<in> A \<and> b \<in> A \<and> a \<oplus> b = d})
[PROOF STEP]
assume hxA: "x \<in> A \<times> A"
[PROOF STATE]
proof (state)
this:
x \<in> A \<times> A

goal (1 subgoal):
 1. \<And>x. x \<in> A \<times> A \<Longrightarrow> x \<in> (\<Union>d\<in>sumset A A. {(a, b) |a b. a \<in> A \<and> b \<in> A \<and> a \<oplus> b = d})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> A \<times> A
[PROOF STEP]
obtain y z where hxyz: "x = (y, z)" and hy: "y \<in> A" and hz:"z \<in> A"
[PROOF STATE]
proof (prove)
using this:
x \<in> A \<times> A

goal (1 subgoal):
 1. (\<And>y z. \<lbrakk>x = (y, z); y \<in> A; z \<in> A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x = (y, z)
y \<in> A
z \<in> A

goal (1 subgoal):
 1. \<And>x. x \<in> A \<times> A \<Longrightarrow> x \<in> (\<Union>d\<in>sumset A A. {(a, b) |a b. a \<in> A \<and> b \<in> A \<and> a \<oplus> b = d})
[PROOF STEP]
show "x \<in> (\<Union>d\<in>(sumset A A).{(a, b) |a b. a \<in> A \<and> b \<in> A \<and> a \<oplus> b = d})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> (\<Union>d\<in>sumset A A. {(a, b) |a b. a \<in> A \<and> b \<in> A \<and> a \<oplus> b = d})
[PROOF STEP]
using hy hz assms hxA hxyz
[PROOF STATE]
proof (prove)
using this:
y \<in> A
z \<in> A
A \<subseteq> G
x \<in> A \<times> A
x = (y, z)

goal (1 subgoal):
 1. x \<in> (\<Union>d\<in>sumset A A. {(a, b) |a b. a \<in> A \<and> b \<in> A \<and> a \<oplus> b = d})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> (\<Union>d\<in>sumset A A. {(a, b) |a b. a \<in> A \<and> b \<in> A \<and> a \<oplus> b = d})

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
A \<times> A \<subseteq> (\<Union>d\<in>sumset A A. {(a, b) |a b. a \<in> A \<and> b \<in> A \<and> a \<oplus> b = d})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma of_nat_fun: "of_nat n = (\<lambda>x::'a. of_nat n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat n = (\<lambda>x. of_nat n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. of_nat n = (\<lambda>x. of_nat n)
[PROOF STEP]
have comp: "comp = (\<lambda>f g x. f (g x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<circ>) = (\<lambda>f g x. f (g x))
[PROOF STEP]
by (rule ext)+ simp
[PROOF STATE]
proof (state)
this:
(\<circ>) = (\<lambda>f g x. f (g x))

goal (1 subgoal):
 1. of_nat n = (\<lambda>x. of_nat n)
[PROOF STEP]
have plus_fun: "plus = (\<lambda>f g x. f x + g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (+) = (\<lambda>f g x. f x + g x)
[PROOF STEP]
by (rule ext, rule ext) (fact plus_fun_def)
[PROOF STATE]
proof (state)
this:
(+) = (\<lambda>f g x. f x + g x)

goal (1 subgoal):
 1. of_nat n = (\<lambda>x. of_nat n)
[PROOF STEP]
have "of_nat n = (comp (plus (1::'b)) ^^ n) (\<lambda>x::'a. 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat n = ((\<circ>) ((+) (1::'b)) ^^ n) (\<lambda>x. 0::'b)
[PROOF STEP]
by (simp add: of_nat_def plus_fun zero_fun_def one_fun_def comp)
[PROOF STATE]
proof (state)
this:
of_nat n = ((\<circ>) ((+) (1::'b)) ^^ n) (\<lambda>x. 0::'b)

goal (1 subgoal):
 1. of_nat n = (\<lambda>x. of_nat n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
of_nat n = ((\<circ>) ((+) (1::'b)) ^^ n) (\<lambda>x. 0::'b)

goal (1 subgoal):
 1. of_nat n = (\<lambda>x. of_nat n)
[PROOF STEP]
have "... = comp ((plus 1) ^^ n) (\<lambda>x::'a. 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<circ>) ((+) (1::'b)) ^^ n) (\<lambda>x. 0::'b) = (+) (1::'b) ^^ n \<circ> (\<lambda>x. 0::'b)
[PROOF STEP]
by (simp only: comp_funpow)
[PROOF STATE]
proof (state)
this:
((\<circ>) ((+) (1::'b)) ^^ n) (\<lambda>x. 0::'b) = (+) (1::'b) ^^ n \<circ> (\<lambda>x. 0::'b)

goal (1 subgoal):
 1. of_nat n = (\<lambda>x. of_nat n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
of_nat n = (+) (1::'b) ^^ n \<circ> (\<lambda>x. 0::'b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
of_nat n = (+) (1::'b) ^^ n \<circ> (\<lambda>x. 0::'b)

goal (1 subgoal):
 1. of_nat n = (\<lambda>x. of_nat n)
[PROOF STEP]
by (simp add: of_nat_def comp)
[PROOF STATE]
proof (state)
this:
of_nat n = (\<lambda>x. of_nat n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma addrow_mat_inv: assumes k: "k < n" and l: "l < n" and neq: "k \<noteq> l"
  shows "addrow_mat n a k l * addrow_mat n (- (a :: 'a :: comm_ring_1)) k l = 1\<^sub>m n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. addrow_mat n a k l * addrow_mat n (- a) k l = 1\<^sub>m n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. addrow_mat n a k l * addrow_mat n (- a) k l = 1\<^sub>m n
[PROOF STEP]
have "addrow_mat n a k l * addrow_mat n (- a) k l =
    addrow_mat n a k l * (addrow_mat n (- a) k l * 1\<^sub>m n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. addrow_mat n a k l * addrow_mat n (- a) k l = addrow_mat n a k l * (addrow_mat n (- a) k l * 1\<^sub>m n)
[PROOF STEP]
by (simp add: right_mult_one_mat[of _ n])
[PROOF STATE]
proof (state)
this:
addrow_mat n a k l * addrow_mat n (- a) k l = addrow_mat n a k l * (addrow_mat n (- a) k l * 1\<^sub>m n)

goal (1 subgoal):
 1. addrow_mat n a k l * addrow_mat n (- a) k l = 1\<^sub>m n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
addrow_mat n a k l * addrow_mat n (- a) k l = addrow_mat n a k l * (addrow_mat n (- a) k l * 1\<^sub>m n)

goal (1 subgoal):
 1. addrow_mat n a k l * addrow_mat n (- a) k l = 1\<^sub>m n
[PROOF STEP]
have "addrow_mat n (- a) k l * 1\<^sub>m n = addrow (- a) k l (1\<^sub>m n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. addrow_mat n (- a) k l * 1\<^sub>m n = addrow (- a) k l (1\<^sub>m n)
[PROOF STEP]
by (rule addrow_mat[symmetric, of _ _ n], insert k l, auto)
[PROOF STATE]
proof (state)
this:
addrow_mat n (- a) k l * 1\<^sub>m n = addrow (- a) k l (1\<^sub>m n)

goal (1 subgoal):
 1. addrow_mat n a k l * addrow_mat n (- a) k l = 1\<^sub>m n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
addrow_mat n (- a) k l * 1\<^sub>m n = addrow (- a) k l (1\<^sub>m n)

goal (1 subgoal):
 1. addrow_mat n a k l * addrow_mat n (- a) k l = 1\<^sub>m n
[PROOF STEP]
have "addrow_mat n a k l * \<dots> = addrow a k l \<dots>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. addrow_mat n a k l * addrow (- a) k l (1\<^sub>m n) = addrow a k l (addrow (- a) k l (1\<^sub>m n))
[PROOF STEP]
by (rule addrow_mat[symmetric, of _ _ n], insert k l, auto)
[PROOF STATE]
proof (state)
this:
addrow_mat n a k l * addrow (- a) k l (1\<^sub>m n) = addrow a k l (addrow (- a) k l (1\<^sub>m n))

goal (1 subgoal):
 1. addrow_mat n a k l * addrow_mat n (- a) k l = 1\<^sub>m n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
addrow_mat n a k l * addrow (- a) k l (1\<^sub>m n) = addrow a k l (addrow (- a) k l (1\<^sub>m n))

goal (1 subgoal):
 1. addrow_mat n a k l * addrow_mat n (- a) k l = 1\<^sub>m n
[PROOF STEP]
have "\<dots> = 1\<^sub>m n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. addrow a k l (addrow (- a) k l (1\<^sub>m n)) = 1\<^sub>m n
[PROOF STEP]
by (rule eq_matI, insert k l neq, auto, algebra)
[PROOF STATE]
proof (state)
this:
addrow a k l (addrow (- a) k l (1\<^sub>m n)) = 1\<^sub>m n

goal (1 subgoal):
 1. addrow_mat n a k l * addrow_mat n (- a) k l = 1\<^sub>m n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
addrow_mat n a k l * addrow_mat n (- a) k l = 1\<^sub>m n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
addrow_mat n a k l * addrow_mat n (- a) k l = 1\<^sub>m n

goal (1 subgoal):
 1. addrow_mat n a k l * addrow_mat n (- a) k l = 1\<^sub>m n
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
addrow_mat n a k l * addrow_mat n (- a) k l = 1\<^sub>m n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_cart_basis: "finite (cart_basis)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite cart_basis
[PROOF STEP]
unfolding cart_basis_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {axis i (1::'a) |i. i \<in> UNIV}
[PROOF STEP]
using finite_Atleast_Atmost_nat
[PROOF STATE]
proof (prove)
using this:
finite {?f x |x. x \<in> UNIV}

goal (1 subgoal):
 1. finite {axis i (1::'a) |i. i \<in> UNIV}
[PROOF STEP]
by fastforce


[STATEMENT]
lemma indicator_UN_disjoint:
  "finite A \<Longrightarrow> disjoint_family_on f A \<Longrightarrow> indicator (\<Union>(f ` A)) x = (\<Sum>y\<in>A. indicator (f y) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; disjoint_family_on f A\<rbrakk> \<Longrightarrow> indicator (\<Union> (f ` A)) x = (\<Sum>y\<in>A. indicator (f y) x)
[PROOF STEP]
by (induct A rule: finite_induct)
    (auto simp: disjoint_family_on_def indicator_def split: if_splits split_of_bool_asm)


[STATEMENT]
lemma am_gm2:
  fixes a b :: real
  assumes "a \<ge> 0" and "b \<ge> 0"
  shows "sqrt (a * b) \<le> (a + b) / 2"
  and "sqrt (a * b) = (a + b) / 2 \<longleftrightarrow> a = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrt (a * b) \<le> (a + b) / 2 &&& (sqrt (a * b) = (a + b) / 2) = (a = b)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. sqrt (a * b) \<le> (a + b) / 2
 2. (sqrt (a * b) = (a + b) / 2) = (a = b)
[PROOF STEP]
have "0 \<le> (a - b) * (a - b)" and "0 = (a - b) * (a - b) \<longleftrightarrow> a = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> (a - b) * (a - b) &&& (0 = (a - b) * (a - b)) = (a = b)
[PROOF STEP]
by simp+
[PROOF STATE]
proof (state)
this:
0 \<le> (a - b) * (a - b)
(0 = (a - b) * (a - b)) = (a = b)

goal (2 subgoals):
 1. sqrt (a * b) \<le> (a + b) / 2
 2. (sqrt (a * b) = (a + b) / 2) = (a = b)
[PROOF STEP]
with right_diff_distrib [of "a - b" a b] and left_diff_distrib [of a b]
[PROOF STATE]
proof (chain)
picking this:
(a - b) * (a - b) = (a - b) * a - (a - b) * b
(a - b) * ?c = a * ?c - b * ?c
0 \<le> (a - b) * (a - b)
(0 = (a - b) * (a - b)) = (a = b)
[PROOF STEP]
have
    "0 \<le> a * a - 2 * a * b + b * b"
    and "0 = a * a - 2 * a * b + b * b \<longleftrightarrow> a = b"
[PROOF STATE]
proof (prove)
using this:
(a - b) * (a - b) = (a - b) * a - (a - b) * b
(a - b) * ?c = a * ?c - b * ?c
0 \<le> (a - b) * (a - b)
(0 = (a - b) * (a - b)) = (a = b)

goal (1 subgoal):
 1. 0 \<le> a * a - 2 * a * b + b * b &&& (0 = a * a - 2 * a * b + b * b) = (a = b)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> a * a - 2 * a * b + b * b
(0 = a * a - 2 * a * b + b * b) = (a = b)

goal (2 subgoals):
 1. sqrt (a * b) \<le> (a + b) / 2
 2. (sqrt (a * b) = (a + b) / 2) = (a = b)
[PROOF STEP]
hence "4 * a * b \<le> a * a + 2 * a * b + b * b"
    and "4 * a * b = a * a + 2 * a * b + b * b \<longleftrightarrow> a = b"
[PROOF STATE]
proof (prove)
using this:
0 \<le> a * a - 2 * a * b + b * b
(0 = a * a - 2 * a * b + b * b) = (a = b)

goal (1 subgoal):
 1. 4 * a * b \<le> a * a + 2 * a * b + b * b &&& (4 * a * b = a * a + 2 * a * b + b * b) = (a = b)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
4 * a * b \<le> a * a + 2 * a * b + b * b
(4 * a * b = a * a + 2 * a * b + b * b) = (a = b)

goal (2 subgoals):
 1. sqrt (a * b) \<le> (a + b) / 2
 2. (sqrt (a * b) = (a + b) / 2) = (a = b)
[PROOF STEP]
with distrib_right [of "a + b" a b] and distrib_left [of a b]
[PROOF STATE]
proof (chain)
picking this:
(a + b + a) * b = (a + b) * b + a * b
a * (b + ?c) = a * b + a * ?c
4 * a * b \<le> a * a + 2 * a * b + b * b
(4 * a * b = a * a + 2 * a * b + b * b) = (a = b)
[PROOF STEP]
have
    "4 * a * b \<le> (a + b) * (a + b)"
    and "4 * a * b = (a + b) * (a + b) \<longleftrightarrow> a = b"
[PROOF STATE]
proof (prove)
using this:
(a + b + a) * b = (a + b) * b + a * b
a * (b + ?c) = a * b + a * ?c
4 * a * b \<le> a * a + 2 * a * b + b * b
(4 * a * b = a * a + 2 * a * b + b * b) = (a = b)

goal (1 subgoal):
 1. 4 * a * b \<le> (a + b) * (a + b) &&& (4 * a * b = (a + b) * (a + b)) = (a = b)
[PROOF STEP]
by (simp add: field_simps)+
[PROOF STATE]
proof (state)
this:
4 * a * b \<le> (a + b) * (a + b)
(4 * a * b = (a + b) * (a + b)) = (a = b)

goal (2 subgoals):
 1. sqrt (a * b) \<le> (a + b) / 2
 2. (sqrt (a * b) = (a + b) / 2) = (a = b)
[PROOF STEP]
with real_sqrt_le_mono [of "4 * a * b" "(a + b) * (a + b)"]
    and real_sqrt_eq_iff [of "4 * a * b" "(a + b) * (a + b)"]
[PROOF STATE]
proof (chain)
picking this:
4 * a * b \<le> (a + b) * (a + b) \<Longrightarrow> sqrt (4 * a * b) \<le> sqrt ((a + b) * (a + b))
(sqrt (4 * a * b) = sqrt ((a + b) * (a + b))) = (4 * a * b = (a + b) * (a + b))
4 * a * b \<le> (a + b) * (a + b)
(4 * a * b = (a + b) * (a + b)) = (a = b)
[PROOF STEP]
have
    "sqrt (4 * a * b) \<le> sqrt ((a + b) * (a + b))"
    and "sqrt (4 * a * b) = sqrt ((a + b) * (a + b)) \<longleftrightarrow> a = b"
[PROOF STATE]
proof (prove)
using this:
4 * a * b \<le> (a + b) * (a + b) \<Longrightarrow> sqrt (4 * a * b) \<le> sqrt ((a + b) * (a + b))
(sqrt (4 * a * b) = sqrt ((a + b) * (a + b))) = (4 * a * b = (a + b) * (a + b))
4 * a * b \<le> (a + b) * (a + b)
(4 * a * b = (a + b) * (a + b)) = (a = b)

goal (1 subgoal):
 1. sqrt (4 * a * b) \<le> sqrt ((a + b) * (a + b)) &&& (sqrt (4 * a * b) = sqrt ((a + b) * (a + b))) = (a = b)
[PROOF STEP]
by simp+
[PROOF STATE]
proof (state)
this:
sqrt (4 * a * b) \<le> sqrt ((a + b) * (a + b))
(sqrt (4 * a * b) = sqrt ((a + b) * (a + b))) = (a = b)

goal (2 subgoals):
 1. sqrt (a * b) \<le> (a + b) / 2
 2. (sqrt (a * b) = (a + b) / 2) = (a = b)
[PROOF STEP]
with \<open>a \<ge> 0\<close> and \<open>b \<ge> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
0 \<le> a
0 \<le> b
sqrt (4 * a * b) \<le> sqrt ((a + b) * (a + b))
(sqrt (4 * a * b) = sqrt ((a + b) * (a + b))) = (a = b)
[PROOF STEP]
have "sqrt (4 * a * b) \<le> a + b"
    and "sqrt (4 * a * b) = a + b \<longleftrightarrow> a = b"
[PROOF STATE]
proof (prove)
using this:
0 \<le> a
0 \<le> b
sqrt (4 * a * b) \<le> sqrt ((a + b) * (a + b))
(sqrt (4 * a * b) = sqrt ((a + b) * (a + b))) = (a = b)

goal (1 subgoal):
 1. sqrt (4 * a * b) \<le> a + b &&& (sqrt (4 * a * b) = a + b) = (a = b)
[PROOF STEP]
by simp+
[PROOF STATE]
proof (state)
this:
sqrt (4 * a * b) \<le> a + b
(sqrt (4 * a * b) = a + b) = (a = b)

goal (2 subgoals):
 1. sqrt (a * b) \<le> (a + b) / 2
 2. (sqrt (a * b) = (a + b) / 2) = (a = b)
[PROOF STEP]
with real_sqrt_abs2 [of 2] and real_sqrt_mult [of 4 "a * b"]
[PROOF STATE]
proof (chain)
picking this:
sqrt (2 * 2) = \<bar>2\<bar>
sqrt (4 * (a * b)) = sqrt 4 * sqrt (a * b)
sqrt (4 * a * b) \<le> a + b
(sqrt (4 * a * b) = a + b) = (a = b)
[PROOF STEP]
show
    "sqrt (a * b) \<le> (a + b) / 2"
    and "sqrt (a * b) = (a + b) / 2 \<longleftrightarrow> a = b"
[PROOF STATE]
proof (prove)
using this:
sqrt (2 * 2) = \<bar>2\<bar>
sqrt (4 * (a * b)) = sqrt 4 * sqrt (a * b)
sqrt (4 * a * b) \<le> a + b
(sqrt (4 * a * b) = a + b) = (a = b)

goal (1 subgoal):
 1. sqrt (a * b) \<le> (a + b) / 2 &&& (sqrt (a * b) = (a + b) / 2) = (a = b)
[PROOF STEP]
by (simp add: ac_simps)+
[PROOF STATE]
proof (state)
this:
sqrt (a * b) \<le> (a + b) / 2
(sqrt (a * b) = (a + b) / 2) = (a = b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ennsqrt_strict_mono:
  "strict_mono ennsqrt"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. strict_mono ennsqrt
[PROOF STEP]
unfolding ennsqrt_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. strict_mono (\<lambda>x. ennexp (eln x / 2))
[PROOF STEP]
apply (rule strict_mono_compose[OF ennexp_strict_mono])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. strict_mono (\<lambda>x. eln x / 2)
[PROOF STEP]
apply (rule strict_mono_compose[OF _ eln_strict_mono])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. strict_mono (\<lambda>a. a / 2)
[PROOF STEP]
by (auto simp add: ereal_less_divide_pos ereal_mult_divide strict_mono_def)


[STATEMENT]
lemma S\<^sub>e_E_iff: "s \<in> S1 \<Longrightarrow> s \<in> S\<^sub>e \<longleftrightarrow> (\<forall>t. (s, t) \<in> E \<longrightarrow> t \<in> S\<^sub>e)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s \<in> S1 \<Longrightarrow> (s \<in> S\<^sub>e) = (\<forall>t. (s, t) \<in> E \<longrightarrow> t \<in> S\<^sub>e)
[PROOF STEP]
using S\<^sub>e_E1[of s] S\<^sub>e_E2[of s]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>s \<in> S\<^sub>e \<inter> S1; (s, ?t) \<in> E\<rbrakk> \<Longrightarrow> ?t \<in> S\<^sub>e
\<lbrakk>s \<in> S1; \<And>t. (s, t) \<in> E \<Longrightarrow> t \<in> S\<^sub>e\<rbrakk> \<Longrightarrow> s \<in> S\<^sub>e

goal (1 subgoal):
 1. s \<in> S1 \<Longrightarrow> (s \<in> S\<^sub>e) = (\<forall>t. (s, t) \<in> E \<longrightarrow> t \<in> S\<^sub>e)
[PROOF STEP]
by blast


[STATEMENT]
lemma degree_greater_zero_in_keys:
  assumes "0 < degree f"
  shows "degree f - 1 \<in> keys f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree f - 1 \<in> keys f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. degree f - 1 \<in> keys f
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
0 < degree f
[PROOF STEP]
have "keys f \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
0 < degree f

goal (1 subgoal):
 1. keys f \<noteq> {}
[PROOF STEP]
by (auto simp add: degree_def)
[PROOF STATE]
proof (state)
this:
keys f \<noteq> {}

goal (1 subgoal):
 1. degree f - 1 \<in> keys f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
keys f \<noteq> {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
keys f \<noteq> {}

goal (1 subgoal):
 1. degree f - 1 \<in> keys f
[PROOF STEP]
unfolding degree_def
[PROOF STATE]
proof (prove)
using this:
keys f \<noteq> {}

goal (1 subgoal):
 1. Max (insert 0 (Suc ` keys f)) - 1 \<in> keys f
[PROOF STEP]
by (simp add: mono_Max_commute [symmetric] mono_Suc)
[PROOF STATE]
proof (state)
this:
degree f - 1 \<in> keys f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma split_less_Suc: "(\<forall>x<Suc k. P x) =  (P k \<and> (\<forall>x<k. P x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x<Suc k. P x) = (P k \<and> (\<forall>x<k. P x))
[PROOF STEP]
apply rule
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>x<Suc k. P x \<Longrightarrow> P k \<and> (\<forall>x<k. P x)
 2. P k \<and> (\<forall>x<k. P x) \<Longrightarrow> \<forall>x<Suc k. P x
[PROOF STEP]
apply  clarsimp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P k \<and> (\<forall>x<k. P x) \<Longrightarrow> \<forall>x<Suc k. P x
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>P k; \<forall>x<k. P x; x < Suc k\<rbrakk> \<Longrightarrow> P x
[PROOF STEP]
apply (case_tac "x = k")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>P k; \<forall>x<k. P x; x < Suc k; x = k\<rbrakk> \<Longrightarrow> P x
 2. \<And>x. \<lbrakk>P k; \<forall>x<k. P x; x < Suc k; x \<noteq> k\<rbrakk> \<Longrightarrow> P x
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma ereal_zero_le_0_iff:
  fixes a b :: ereal
  shows "0 \<le> a * b \<longleftrightarrow> (0 \<le> a \<and> 0 \<le> b) \<or> (a \<le> 0 \<and> b \<le> 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 \<le> a * b) = (0 \<le> a \<and> 0 \<le> b \<or> a \<le> 0 \<and> b \<le> 0)
[PROOF STEP]
by (cases rule: ereal2_cases[of a b]) (simp_all add: zero_le_mult_iff)


[STATEMENT]
lemma right_coset_singular_relboundary:
  "r_coset (relcycle_group p X S) (singular_relboundary_set p X S)
  = (\<lambda>a. {b. homologous_rel p X S a b})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (#>\<^bsub>relcycle_group p X S\<^esub>) (singular_relboundary_set p X S) = homologous_rel_set p X S
[PROOF STEP]
using singular_relboundary_minus
[PROOF STATE]
proof (prove)
using this:
singular_relboundary ?p ?X ?S (- ?c) = singular_relboundary ?p ?X ?S ?c

goal (1 subgoal):
 1. (#>\<^bsub>relcycle_group p X S\<^esub>) (singular_relboundary_set p X S) = homologous_rel_set p X S
[PROOF STEP]
by (force simp: r_coset_def homologous_rel_def relcycle_group_def subgroup_generated_def)


[STATEMENT]
lemma VLambda_in_vproduct:
  assumes "\<And>i. i \<in>\<^sub>\<circ> I \<Longrightarrow> f i \<in>\<^sub>\<circ> A i"
  shows "(\<lambda>i\<in>\<^sub>\<circ>I. f i) \<in>\<^sub>\<circ> (\<Prod>\<^sub>\<circ>i\<in>\<^sub>\<circ>I. A i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. VLambda I f \<in>\<^sub>\<circ> vproduct I A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?i \<in>\<^sub>\<circ> I \<Longrightarrow> f ?i \<in>\<^sub>\<circ> A ?i

goal (1 subgoal):
 1. VLambda I f \<in>\<^sub>\<circ> vproduct I A
[PROOF STEP]
by (simp add: vproductI vsv.vsv_vrange_vsubset_vifunion_app)


[STATEMENT]
lemma finite_measure_subalgebra_is_sigma_finite:
  assumes "finite_measure_subalgebra M F"
  shows "sigma_finite_subalgebra M F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sigma_finite_subalgebra M F
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sigma_finite_subalgebra M F
[PROOF STEP]
interpret finite_measure_subalgebra M F
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_measure_subalgebra M F
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite_measure_subalgebra M F

goal (1 subgoal):
 1. finite_measure_subalgebra M F
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sigma_finite_subalgebra M F
[PROOF STEP]
have "finite_measure (restr_to_subalg M F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_measure (restr_to_subalg M F)
[PROOF STEP]
using finite_measure_restr_to_subalg subalg finite_emeasure_space finite_measureI
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>subalgebra ?M ?F; finite_measure ?M\<rbrakk> \<Longrightarrow> finite_measure (restr_to_subalg ?M ?F)
subalgebra M F
emeasure M (space M) \<noteq> top
emeasure ?M (space ?M) \<noteq> \<infinity> \<Longrightarrow> finite_measure ?M

goal (1 subgoal):
 1. finite_measure (restr_to_subalg M F)
[PROOF STEP]
unfolding infinity_ennreal_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>subalgebra ?M ?F; finite_measure ?M\<rbrakk> \<Longrightarrow> finite_measure (restr_to_subalg ?M ?F)
subalgebra M F
emeasure M (space M) \<noteq> top
emeasure ?M (space ?M) \<noteq> top \<Longrightarrow> finite_measure ?M

goal (1 subgoal):
 1. finite_measure (restr_to_subalg M F)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
finite_measure (restr_to_subalg M F)

goal (1 subgoal):
 1. sigma_finite_subalgebra M F
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite_measure (restr_to_subalg M F)
[PROOF STEP]
have "sigma_finite_measure (restr_to_subalg M F)"
[PROOF STATE]
proof (prove)
using this:
finite_measure (restr_to_subalg M F)

goal (1 subgoal):
 1. sigma_finite_measure (restr_to_subalg M F)
[PROOF STEP]
unfolding finite_measure_def
[PROOF STATE]
proof (prove)
using this:
sigma_finite_measure (restr_to_subalg M F) \<and> finite_measure_axioms (restr_to_subalg M F)

goal (1 subgoal):
 1. sigma_finite_measure (restr_to_subalg M F)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sigma_finite_measure (restr_to_subalg M F)

goal (1 subgoal):
 1. sigma_finite_subalgebra M F
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
sigma_finite_measure (restr_to_subalg M F)
[PROOF STEP]
show "sigma_finite_subalgebra M F"
[PROOF STATE]
proof (prove)
using this:
sigma_finite_measure (restr_to_subalg M F)

goal (1 subgoal):
 1. sigma_finite_subalgebra M F
[PROOF STEP]
unfolding sigma_finite_subalgebra_def
[PROOF STATE]
proof (prove)
using this:
sigma_finite_measure (restr_to_subalg M F)

goal (1 subgoal):
 1. subalgebra M F \<and> sigma_finite_measure (restr_to_subalg M F)
[PROOF STEP]
using subalg
[PROOF STATE]
proof (prove)
using this:
sigma_finite_measure (restr_to_subalg M F)
subalgebra M F

goal (1 subgoal):
 1. subalgebra M F \<and> sigma_finite_measure (restr_to_subalg M F)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sigma_finite_subalgebra M F

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma newman_ingham_aux1:
  fixes R :: real and z :: complex
  assumes R: "R > 0" and z : "norm z = R"
  shows   "norm (1 / z + z / R\<^sup>2) = 2 * \<bar>Re z\<bar> / R\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (1 / z + z / complex_of_real (R\<^sup>2)) = 2 * \<bar>Re z\<bar> / R\<^sup>2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cmod (1 / z + z / complex_of_real (R\<^sup>2)) = 2 * \<bar>Re z\<bar> / R\<^sup>2
[PROOF STEP]
from z and R
[PROOF STATE]
proof (chain)
picking this:
cmod z = R
0 < R
[PROOF STEP]
have [simp]: "z \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
cmod z = R
0 < R

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

goal (1 subgoal):
 1. cmod (1 / z + z / complex_of_real (R\<^sup>2)) = 2 * \<bar>Re z\<bar> / R\<^sup>2
[PROOF STEP]
have "1 / z + z / R\<^sup>2 = (R\<^sup>2 + z\<^sup>2) * (1 / R\<^sup>2 / z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / z + z / complex_of_real (R\<^sup>2) = (complex_of_real (R\<^sup>2) + z\<^sup>2) * (complex_of_real (1 / R\<^sup>2) / z)
[PROOF STEP]
using R
[PROOF STATE]
proof (prove)
using this:
0 < R

goal (1 subgoal):
 1. 1 / z + z / complex_of_real (R\<^sup>2) = (complex_of_real (R\<^sup>2) + z\<^sup>2) * (complex_of_real (1 / R\<^sup>2) / z)
[PROOF STEP]
by (simp add: field_simps power2_eq_square)
[PROOF STATE]
proof (state)
this:
1 / z + z / complex_of_real (R\<^sup>2) = (complex_of_real (R\<^sup>2) + z\<^sup>2) * (complex_of_real (1 / R\<^sup>2) / z)

goal (1 subgoal):
 1. cmod (1 / z + z / complex_of_real (R\<^sup>2)) = 2 * \<bar>Re z\<bar> / R\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 / z + z / complex_of_real (R\<^sup>2) = (complex_of_real (R\<^sup>2) + z\<^sup>2) * (complex_of_real (1 / R\<^sup>2) / z)

goal (1 subgoal):
 1. cmod (1 / z + z / complex_of_real (R\<^sup>2)) = 2 * \<bar>Re z\<bar> / R\<^sup>2
[PROOF STEP]
have "norm \<dots> = norm (R\<^sup>2 + z\<^sup>2) / R ^ 3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod ((complex_of_real (R\<^sup>2) + z\<^sup>2) * (complex_of_real (1 / R\<^sup>2) / z)) = cmod (complex_of_real (R\<^sup>2) + z\<^sup>2) / R ^ 3
[PROOF STEP]
by (simp add: numeral_3_eq_3 z norm_divide norm_mult power2_eq_square)
[PROOF STATE]
proof (state)
this:
cmod ((complex_of_real (R\<^sup>2) + z\<^sup>2) * (complex_of_real (1 / R\<^sup>2) / z)) = cmod (complex_of_real (R\<^sup>2) + z\<^sup>2) / R ^ 3

goal (1 subgoal):
 1. cmod (1 / z + z / complex_of_real (R\<^sup>2)) = 2 * \<bar>Re z\<bar> / R\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod ((complex_of_real (R\<^sup>2) + z\<^sup>2) * (complex_of_real (1 / R\<^sup>2) / z)) = cmod (complex_of_real (R\<^sup>2) + z\<^sup>2) / R ^ 3

goal (1 subgoal):
 1. cmod (1 / z + z / complex_of_real (R\<^sup>2)) = 2 * \<bar>Re z\<bar> / R\<^sup>2
[PROOF STEP]
have "R\<^sup>2 + z\<^sup>2 = z * (z + cnj z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. complex_of_real (R\<^sup>2) + z\<^sup>2 = z * (z + cnj z)
[PROOF STEP]
using complex_norm_square[of z]
[PROOF STATE]
proof (prove)
using this:
complex_of_real ((cmod z)\<^sup>2) = z * cnj z

goal (1 subgoal):
 1. complex_of_real (R\<^sup>2) + z\<^sup>2 = z * (z + cnj z)
[PROOF STEP]
by (simp add: z power2_eq_square algebra_simps)
[PROOF STATE]
proof (state)
this:
complex_of_real (R\<^sup>2) + z\<^sup>2 = z * (z + cnj z)

goal (1 subgoal):
 1. cmod (1 / z + z / complex_of_real (R\<^sup>2)) = 2 * \<bar>Re z\<bar> / R\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
complex_of_real (R\<^sup>2) + z\<^sup>2 = z * (z + cnj z)

goal (1 subgoal):
 1. cmod (1 / z + z / complex_of_real (R\<^sup>2)) = 2 * \<bar>Re z\<bar> / R\<^sup>2
[PROOF STEP]
have "norm \<dots> = 2 * \<bar>Re z\<bar> * R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (z * (z + cnj z)) = 2 * \<bar>Re z\<bar> * R
[PROOF STEP]
by (subst complex_add_cnj) (simp_all add: z norm_mult)
[PROOF STATE]
proof (state)
this:
cmod (z * (z + cnj z)) = 2 * \<bar>Re z\<bar> * R

goal (1 subgoal):
 1. cmod (1 / z + z / complex_of_real (R\<^sup>2)) = 2 * \<bar>Re z\<bar> / R\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod (z * (z + cnj z)) = 2 * \<bar>Re z\<bar> * R

goal (1 subgoal):
 1. cmod (1 / z + z / complex_of_real (R\<^sup>2)) = 2 * \<bar>Re z\<bar> / R\<^sup>2
[PROOF STEP]
have "\<dots> / R ^ 3 = 2 * \<bar>Re z\<bar> / R\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * \<bar>Re z\<bar> * R / R ^ 3 = 2 * \<bar>Re z\<bar> / R\<^sup>2
[PROOF STEP]
using R
[PROOF STATE]
proof (prove)
using this:
0 < R

goal (1 subgoal):
 1. 2 * \<bar>Re z\<bar> * R / R ^ 3 = 2 * \<bar>Re z\<bar> / R\<^sup>2
[PROOF STEP]
by (simp add: field_simps numeral_3_eq_3 power2_eq_square)
[PROOF STATE]
proof (state)
this:
2 * \<bar>Re z\<bar> * R / R ^ 3 = 2 * \<bar>Re z\<bar> / R\<^sup>2

goal (1 subgoal):
 1. cmod (1 / z + z / complex_of_real (R\<^sup>2)) = 2 * \<bar>Re z\<bar> / R\<^sup>2
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cmod (1 / z + z / complex_of_real (R\<^sup>2)) = 2 * \<bar>Re z\<bar> / R\<^sup>2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cmod (1 / z + z / complex_of_real (R\<^sup>2)) = 2 * \<bar>Re z\<bar> / R\<^sup>2

goal (1 subgoal):
 1. cmod (1 / z + z / complex_of_real (R\<^sup>2)) = 2 * \<bar>Re z\<bar> / R\<^sup>2
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
cmod (1 / z + z / complex_of_real (R\<^sup>2)) = 2 * \<bar>Re z\<bar> / R\<^sup>2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_alt: "(\<Sum>i<k. as!i * bs!i powr p') = (\<Sum>i<k. as!i * exp (p' * ln (bs!i)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<k. as ! i * bs ! i powr p') = (\<Sum>i<k. as ! i * exp (p' * ln (bs ! i)))
[PROOF STEP]
proof (intro sum.cong)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {..<k} = {..<k}
 2. \<And>x. x \<in> {..<k} \<Longrightarrow> as ! x * bs ! x powr p' = as ! x * exp (p' * ln (bs ! x))
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {..<k} = {..<k}
 2. \<And>x. x \<in> {..<k} \<Longrightarrow> as ! x * bs ! x powr p' = as ! x * exp (p' * ln (bs ! x))
[PROOF STEP]
assume "i \<in> {..<k}"
[PROOF STATE]
proof (state)
this:
i \<in> {..<k}

goal (2 subgoals):
 1. {..<k} = {..<k}
 2. \<And>x. x \<in> {..<k} \<Longrightarrow> as ! x * bs ! x powr p' = as ! x * exp (p' * ln (bs ! x))
[PROOF STEP]
with b_bounds
[PROOF STATE]
proof (chain)
picking this:
?b \<in> set bs \<Longrightarrow> ?b \<in> {0<..<1}
i \<in> {..<k}
[PROOF STEP]
have "bs!i > 0"
[PROOF STATE]
proof (prove)
using this:
?b \<in> set bs \<Longrightarrow> ?b \<in> {0<..<1}
i \<in> {..<k}

goal (1 subgoal):
 1. 0 < bs ! i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < bs ! i

goal (2 subgoals):
 1. {..<k} = {..<k}
 2. \<And>x. x \<in> {..<k} \<Longrightarrow> as ! x * bs ! x powr p' = as ! x * exp (p' * ln (bs ! x))
[PROOF STEP]
thus "as!i * bs!i powr p' = as!i * exp (p' * ln (bs!i))"
[PROOF STATE]
proof (prove)
using this:
0 < bs ! i

goal (1 subgoal):
 1. as ! i * bs ! i powr p' = as ! i * exp (p' * ln (bs ! i))
[PROOF STEP]
by (simp add: powr_def)
[PROOF STATE]
proof (state)
this:
as ! i * bs ! i powr p' = as ! i * exp (p' * ln (bs ! i))

goal (1 subgoal):
 1. {..<k} = {..<k}
[PROOF STEP]
qed simp


[STATEMENT]
lemma vec_of_poly_pCons:
  shows "vec_of_poly (pCons a p) =
   (if p = 0 then vec_of_list [a] else vec_of_poly p @\<^sub>v vec_of_list [a])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_of_poly (pCons a p) = (if p = 0 then vec_of_list [a] else vec_of_poly p @\<^sub>v vec_of_list [a])
[PROOF STEP]
by (cases "degree p", auto simp: vec_of_poly_as[symmetric])


[STATEMENT]
lemma exact_decompD:
  assumes "exact_decomp m ps" and "(h, U) \<in> set ps"
  shows "h \<in> P[X]" and "U \<subseteq> X"
    and "(h', U') \<in> set ps \<Longrightarrow> poly_deg h = poly_deg h' \<Longrightarrow> m < card U \<Longrightarrow> m < card U' \<Longrightarrow>
            (h, U) = (h', U')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h \<in> P[X] &&& U \<subseteq> X &&& (\<lbrakk>(h', U') \<in> set ps; poly_deg h = poly_deg h'; m < card U; m < card U'\<rbrakk> \<Longrightarrow> (h, U) = (h', U'))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
exact_decomp m ps
(h, U) \<in> set ps

goal (1 subgoal):
 1. h \<in> P[X] &&& U \<subseteq> X &&& (\<lbrakk>(h', U') \<in> set ps; poly_deg h = poly_deg h'; m < card U; m < card U'\<rbrakk> \<Longrightarrow> (h, U) = (h', U'))
[PROOF STEP]
unfolding exact_decomp_def
[PROOF STATE]
proof (prove)
using this:
(\<forall>(h, U)\<in>set ps. h \<in> P[X] \<and> U \<subseteq> X) \<and> (\<forall>(h, U)\<in>set ps. \<forall>(h', U')\<in>set ps. poly_deg h = poly_deg h' \<longrightarrow> m < card U \<longrightarrow> m < card U' \<longrightarrow> (h, U) = (h', U'))
(h, U) \<in> set ps

goal (1 subgoal):
 1. h \<in> P[X] &&& U \<subseteq> X &&& (\<lbrakk>(h', U') \<in> set ps; poly_deg h = poly_deg h'; m < card U; m < card U'\<rbrakk> \<Longrightarrow> (h, U) = (h', U'))
[PROOF STEP]
by fastforce+


[STATEMENT]
lemma uconnectedV_insert_selfloop: "x\<in>verts \<Longrightarrow> uconnectedV (insert (Upair x x) F) = uconnectedV F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> verts \<Longrightarrow> Restr (uconnected (insert (Upair x x) F)) verts = Restr (uconnected F) verts
[PROOF STEP]
apply(rule)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. x \<in> verts \<Longrightarrow> Restr (uconnected (insert (Upair x x) F)) verts \<subseteq> Restr (uconnected F) verts
 2. x \<in> verts \<Longrightarrow> Restr (uconnected F) verts \<subseteq> Restr (uconnected (insert (Upair x x) F)) verts
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a b xa xaa xb. \<lbrakk>(a, b) \<in> uconnected (insert (Upair x x) F); xa \<in> E; x \<in> set_uprod xa; xaa \<in> E; a \<in> set_uprod xaa; xb \<in> E; b \<in> set_uprod xb\<rbrakk> \<Longrightarrow> (a, b) \<in> uconnected F
 2. \<And>a b xa xaa xb. \<lbrakk>(a, b) \<in> uconnected F; xa \<in> E; x \<in> set_uprod xa; xaa \<in> E; a \<in> set_uprod xaa; xb \<in> E; b \<in> set_uprod xb\<rbrakk> \<Longrightarrow> (a, b) \<in> uconnected (insert (Upair x x) F)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(a_, b_) \<in> uconnected (insert (Upair x x) F); xa_ \<in> E; x \<in> set_uprod xa_; xaa_ \<in> E; a_ \<in> set_uprod xaa_; xb_ \<in> E; b_ \<in> set_uprod xb_\<rbrakk> \<Longrightarrow> (a_, b_) \<in> uconnected F
[PROOF STEP]
unfolding uconnected_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(a_, b_) \<in> {(u, v). \<exists>p. epath (insert (Upair x x) F) u p v}; xa_ \<in> E; x \<in> set_uprod xa_; xaa_ \<in> E; a_ \<in> set_uprod xaa_; xb_ \<in> E; b_ \<in> set_uprod xb_\<rbrakk> \<Longrightarrow> (a_, b_) \<in> {(u, v). \<exists>p. epath F u p v}
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>p. \<lbrakk>xa_ \<in> E; x \<in> set_uprod xa_; xaa_ \<in> E; a_ \<in> set_uprod xaa_; xb_ \<in> E; b_ \<in> set_uprod xb_; epath (insert (Upair x x) F) a_ p b_\<rbrakk> \<Longrightarrow> \<exists>p. epath F a_ p b_
[PROOF STEP]
using epath_filter_selfloop
[PROOF STATE]
proof (prove)
using this:
epath (insert (Upair ?x ?x) ?F) ?a ?p ?b \<Longrightarrow> \<exists>p. epath ?F ?a p ?b

goal (1 subgoal):
 1. \<And>p. \<lbrakk>xa_ \<in> E; x \<in> set_uprod xa_; xaa_ \<in> E; a_ \<in> set_uprod xaa_; xb_ \<in> E; b_ \<in> set_uprod xb_; epath (insert (Upair x x) F) a_ p b_\<rbrakk> \<Longrightarrow> \<exists>p. epath F a_ p b_
[PROOF STEP]
by metis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b xa xaa xb. \<lbrakk>(a, b) \<in> uconnected F; xa \<in> E; x \<in> set_uprod xa; xaa \<in> E; a \<in> set_uprod xaa; xb \<in> E; b \<in> set_uprod xb\<rbrakk> \<Longrightarrow> (a, b) \<in> uconnected (insert (Upair x x) F)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(a_, b_) \<in> uconnected F; xa_ \<in> E; x \<in> set_uprod xa_; xaa_ \<in> E; a_ \<in> set_uprod xaa_; xb_ \<in> E; b_ \<in> set_uprod xb_\<rbrakk> \<Longrightarrow> (a_, b_) \<in> uconnected (insert (Upair x x) F)
[PROOF STEP]
by (meson subsetCE subset_insertI uconnected_mono)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem substEnv_def2:
"(rho &[Y / y]_ys) =
 (\<lambda>xs x. case rho xs x of
           None \<Rightarrow> if (xs = ys \<and> x = y) then Some Y else None
          |Some X \<Rightarrow> Some (X #[Y / y]_ys))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rho &[Y / y]_ys = (\<lambda>xs x. case rho xs x of None \<Rightarrow> if xs = ys \<and> x = y then Some Y else None | Some X \<Rightarrow> Some (X #[Y / y]_ys))
[PROOF STEP]
unfolding substEnv_def psubstEnv_def subst_def idEnv_def updEnv_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>xs x. case rho xs x of None \<Rightarrow> if xs = ys \<and> x = y then Some Y else None | Some X \<Rightarrow> Some X #[\<lambda>ysa ya. if ysa = ys \<and> ya = y then Some Y else None]) = (\<lambda>xs x. case rho xs x of None \<Rightarrow> if xs = ys \<and> x = y then Some Y else None | Some X \<Rightarrow> Some X #[\<lambda>ysa ya. if ysa = ys \<and> ya = y then Some Y else None])
[PROOF STEP]
apply(rule ext)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xs x. (case rho xs x of None \<Rightarrow> if xs = ys \<and> x = y then Some Y else None | Some X \<Rightarrow> Some X #[\<lambda>ysa ya. if ysa = ys \<and> ya = y then Some Y else None]) = (case rho xs x of None \<Rightarrow> if xs = ys \<and> x = y then Some Y else None | Some X \<Rightarrow> Some X #[\<lambda>ysa ya. if ysa = ys \<and> ya = y then Some Y else None])
[PROOF STEP]
by(case_tac "rho xs x", simp_all)


[STATEMENT]
lemma content_subset: "cbox a b \<subseteq> box c d \<Longrightarrow> content (cbox a b) \<le> content (box c d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cbox a b \<subseteq> box c d \<Longrightarrow> content (cbox a b) \<le> content (box c d)
[PROOF STEP]
unfolding measure_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cbox a b \<subseteq> box c d \<Longrightarrow> enn2real (emeasure lborel (cbox a b)) \<le> enn2real (emeasure lborel (box c d))
[PROOF STEP]
by (intro enn2real_mono emeasure_mono) (auto simp: emeasure_lborel_cbox_eq emeasure_lborel_box_eq)


[STATEMENT]
lemma sum_equals_pmf_expectation:
  assumes "p \<in> lotteries_on outcomes"
  shows"(\<Sum>z\<in>outcomes. (pmf p z) * (u z)) = measure_pmf.expectation p u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>z\<in>outcomes. pmf p z * u z) = measure_pmf.expectation p u
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>z\<in>outcomes. pmf p z * u z) = measure_pmf.expectation p u
[PROOF STEP]
have fnt: "finite outcomes"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite outcomes
[PROOF STEP]
by (simp add: vNM_utilityD(1) fnt)
[PROOF STATE]
proof (state)
this:
finite outcomes

goal (1 subgoal):
 1. (\<Sum>z\<in>outcomes. pmf p z * u z) = measure_pmf.expectation p u
[PROOF STEP]
have "measure_pmf.expectation p u = (\<Sum>a\<in>outcomes. pmf p a * u a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. measure_pmf.expectation p u = (\<Sum>a\<in>outcomes. pmf p a * u a)
[PROOF STEP]
using support_in_outcomes assms fnt integral_measure_pmf_real
      sum_pmf_util_commute
[PROOF STATE]
proof (prove)
using this:
\<forall>oc. \<forall>p\<in>\<P> oc. \<forall>a\<in>set_pmf p. a \<in> oc
p \<in> \<P> outcomes
finite outcomes
\<lbrakk>finite ?A; \<And>a. \<lbrakk>a \<in> set_pmf ?M; ?f a \<noteq> 0\<rbrakk> \<Longrightarrow> a \<in> ?A\<rbrakk> \<Longrightarrow> measure_pmf.expectation ?M ?f = (\<Sum>a\<in>?A. ?f a * pmf ?M a)
(\<Sum>a\<in>outcomes. pmf ?p a * u a) = (\<Sum>a\<in>outcomes. u a * pmf ?p a)

goal (1 subgoal):
 1. measure_pmf.expectation p u = (\<Sum>a\<in>outcomes. pmf p a * u a)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
measure_pmf.expectation p u = (\<Sum>a\<in>outcomes. pmf p a * u a)

goal (1 subgoal):
 1. (\<Sum>z\<in>outcomes. pmf p z * u z) = measure_pmf.expectation p u
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
measure_pmf.expectation p u = (\<Sum>a\<in>outcomes. pmf p a * u a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
measure_pmf.expectation p u = (\<Sum>a\<in>outcomes. pmf p a * u a)

goal (1 subgoal):
 1. (\<Sum>z\<in>outcomes. pmf p z * u z) = measure_pmf.expectation p u
[PROOF STEP]
using real_scaleR_def
[PROOF STATE]
proof (prove)
using this:
measure_pmf.expectation p u = (\<Sum>a\<in>outcomes. pmf p a * u a)
?a *\<^sub>R ?x = ?a * ?x

goal (1 subgoal):
 1. (\<Sum>z\<in>outcomes. pmf p z * u z) = measure_pmf.expectation p u
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
(\<Sum>z\<in>outcomes. pmf p z * u z) = measure_pmf.expectation p u

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma height_le_size_tree: "height t \<le> size (t::'a tree)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. height t \<le> size t
[PROOF STEP]
by (induction t) auto


[STATEMENT]
lemma space_lborel_f_subset: "space (lborel_f n) \<subseteq> space (lborel_f (Suc n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. space (lborel_f n) \<subseteq> space (lborel_f (Suc n))
[PROOF STEP]
unfolding space_lborel_f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {..<n} \<rightarrow>\<^sub>E UNIV \<subseteq> {..<Suc n} \<rightarrow>\<^sub>E UNIV
[PROOF STEP]
by (rule subsetI, rule PiE_I, blast,
  metis PiE_E  Suc_n_not_le_n le_cases lessThan_subset_iff subsetCE)


[STATEMENT]
lemma filter_ex1: "\<exists>!x \<in> set xs. P x \<Longrightarrow> P x \<Longrightarrow> x \<in> set xs \<Longrightarrow> distinct xs
                  \<Longrightarrow> filter P xs = [x]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>!x. x \<in> set xs \<and> P x; P x; x \<in> set xs; distinct xs\<rbrakk> \<Longrightarrow> filter P xs = [x]
[PROOF STEP]
apply(auto)[1]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. \<lbrakk>P x; x \<in> set xs; distinct xs; \<forall>y y'. y \<in> set xs \<and> P y \<and> y' \<in> set xs \<and> P y' \<longrightarrow> y = y'; xa \<in> set xs; P xa\<rbrakk> \<Longrightarrow> filter P xs = [x]
[PROOF STEP]
apply(induct xs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>xa. \<lbrakk>P x; x \<in> set []; distinct []; \<forall>y y'. y \<in> set [] \<and> P y \<and> y' \<in> set [] \<and> P y' \<longrightarrow> y = y'; xa \<in> set []; P xa\<rbrakk> \<Longrightarrow> filter P [] = [x]
 2. \<And>a xs xa. \<lbrakk>\<And>xa. \<lbrakk>P x; x \<in> set xs; distinct xs; \<forall>y y'. y \<in> set xs \<and> P y \<and> y' \<in> set xs \<and> P y' \<longrightarrow> y = y'; xa \<in> set xs; P xa\<rbrakk> \<Longrightarrow> filter P xs = [x]; P x; x \<in> set (a # xs); distinct (a # xs); \<forall>y y'. y \<in> set (a # xs) \<and> P y \<and> y' \<in> set (a # xs) \<and> P y' \<longrightarrow> y = y'; xa \<in> set (a # xs); P xa\<rbrakk> \<Longrightarrow> filter P (a # xs) = [x]
[PROOF STEP]
apply(auto)[1]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a xs xa. \<lbrakk>\<And>xa. \<lbrakk>P x; x \<in> set xs; distinct xs; \<forall>y y'. y \<in> set xs \<and> P y \<and> y' \<in> set xs \<and> P y' \<longrightarrow> y = y'; xa \<in> set xs; P xa\<rbrakk> \<Longrightarrow> filter P xs = [x]; P x; x \<in> set (a # xs); distinct (a # xs); \<forall>y y'. y \<in> set (a # xs) \<and> P y \<and> y' \<in> set (a # xs) \<and> P y' \<longrightarrow> y = y'; xa \<in> set (a # xs); P xa\<rbrakk> \<Longrightarrow> filter P (a # xs) = [x]
[PROOF STEP]
apply(auto)[1]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xs. \<lbrakk>\<forall>y y'. (y = x \<or> y \<in> set xs) \<and> P y \<and> (y' = x \<or> y' \<in> set xs) \<and> P y' \<longrightarrow> y = y'; x \<notin> set xs; distinct xs; P x\<rbrakk> \<Longrightarrow> filter P xs = []
[PROOF STEP]
using filter_empty_conv
[PROOF STATE]
proof (prove)
using this:
(filter ?P ?xs = []) = (\<forall>x\<in>set ?xs. \<not> ?P x)

goal (1 subgoal):
 1. \<And>xs. \<lbrakk>\<forall>y y'. (y = x \<or> y \<in> set xs) \<and> P y \<and> (y' = x \<or> y' \<in> set xs) \<and> P y' \<longrightarrow> y = y'; x \<notin> set xs; distinct xs; P x\<rbrakk> \<Longrightarrow> filter P xs = []
[PROOF STEP]
by fastforce


[STATEMENT]
lemma plus_vinsert: "x + vinsert z y = vinsert (x+z) (x + y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x + vinsert z y = vinsert (x + z) (x + y)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x + vinsert z y = vinsert (x + z) (x + y)
[PROOF STEP]
have f1: "elts (x + y) = elts x \<union> (+) x ` elts y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. elts (x + y) = elts x \<union> (+) x ` elts y
[PROOF STEP]
by (metis elts_of_set lift_def plus_eq_lift replacement small_Un small_elts sup_V_def)
[PROOF STATE]
proof (state)
this:
elts (x + y) = elts x \<union> (+) x ` elts y

goal (1 subgoal):
 1. x + vinsert z y = vinsert (x + z) (x + y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
elts (x + y) = elts x \<union> (+) x ` elts y

goal (1 subgoal):
 1. x + vinsert z y = vinsert (x + z) (x + y)
[PROOF STEP]
have "lift x (vinsert z y) = set ((+) x ` elts (set (insert z (elts y))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lift x (vinsert z y) = set ((+) x ` elts (set (insert z (elts y))))
[PROOF STEP]
using vinsert_def lift_def
[PROOF STATE]
proof (prove)
using this:
vinsert ?x ?y \<equiv> set (insert ?x (elts ?y))
lift ?x ?y \<equiv> set ((+) ?x ` elts ?y)

goal (1 subgoal):
 1. lift x (vinsert z y) = set ((+) x ` elts (set (insert z (elts y))))
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
lift x (vinsert z y) = set ((+) x ` elts (set (insert z (elts y))))

goal (1 subgoal):
 1. x + vinsert z y = vinsert (x + z) (x + y)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
elts (x + y) = elts x \<union> (+) x ` elts y
lift x (vinsert z y) = set ((+) x ` elts (set (insert z (elts y))))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
elts (x + y) = elts x \<union> (+) x ` elts y
lift x (vinsert z y) = set ((+) x ` elts (set (insert z (elts y))))

goal (1 subgoal):
 1. x + vinsert z y = vinsert (x + z) (x + y)
[PROOF STEP]
by (simp add: vinsert_def plus_eq_lift sup_V_def)
[PROOF STATE]
proof (state)
this:
x + vinsert z y = vinsert (x + z) (x + y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_arcs_dv: "card (arcs (del_vert u)) = card (arcs G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (arcs (del_vert u)) = card (arcs G)
[PROOF STEP]
using u_isolated
[PROOF STATE]
proof (prove)
using this:
out_arcs G u = {}

goal (1 subgoal):
 1. card (arcs (del_vert u)) = card (arcs G)
[PROOF STEP]
by (auto simp add: arcs_dv in_arcs_eq)


[STATEMENT]
lemma EM_remainder'_cong:
  assumes "\<And>x. x \<in> {a..b} \<Longrightarrow> f x = g x" "n = n'" "a = a'" "b = b'"
  shows   "EM_remainder' n f a b = EM_remainder' n' g a' b'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. EM_remainder' n f a b = EM_remainder' n' g a' b'
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. EM_remainder' n f a b = EM_remainder' n' g a' b'
[PROOF STEP]
have "integral {a..b} (\<lambda>t. pbernpoly n t *\<^sub>R f t) = integral {a'..b'} (\<lambda>t. pbernpoly n' t *\<^sub>R g t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral {a..b} (\<lambda>t. pbernpoly n t *\<^sub>R f t) = integral {a'..b'} (\<lambda>t. pbernpoly n' t *\<^sub>R g t)
[PROOF STEP]
unfolding assms
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral {a'..b'} (\<lambda>t. pbernpoly n' t *\<^sub>R f t) = integral {a'..b'} (\<lambda>t. pbernpoly n' t *\<^sub>R g t)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?x \<in> {a..b} \<Longrightarrow> f ?x = g ?x
n = n'
a = a'
b = b'

goal (1 subgoal):
 1. integral {a'..b'} (\<lambda>t. pbernpoly n' t *\<^sub>R f t) = integral {a'..b'} (\<lambda>t. pbernpoly n' t *\<^sub>R g t)
[PROOF STEP]
by (intro integral_cong) auto
[PROOF STATE]
proof (state)
this:
integral {a..b} (\<lambda>t. pbernpoly n t *\<^sub>R f t) = integral {a'..b'} (\<lambda>t. pbernpoly n' t *\<^sub>R g t)

goal (1 subgoal):
 1. EM_remainder' n f a b = EM_remainder' n' g a' b'
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
?x \<in> {a..b} \<Longrightarrow> f ?x = g ?x
n = n'
a = a'
b = b'
integral {a..b} (\<lambda>t. pbernpoly n t *\<^sub>R f t) = integral {a'..b'} (\<lambda>t. pbernpoly n' t *\<^sub>R g t)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
?x \<in> {a..b} \<Longrightarrow> f ?x = g ?x
n = n'
a = a'
b = b'
integral {a..b} (\<lambda>t. pbernpoly n t *\<^sub>R f t) = integral {a'..b'} (\<lambda>t. pbernpoly n' t *\<^sub>R g t)

goal (1 subgoal):
 1. EM_remainder' n f a b = EM_remainder' n' g a' b'
[PROOF STEP]
by (simp add: EM_remainder'_def)
[PROOF STATE]
proof (state)
this:
EM_remainder' n f a b = EM_remainder' n' g a' b'

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cmod_1_plus_mult_le:
  shows "cmod (1 + z*w) \<le> sqrt((1 + (cmod z)\<^sup>2) * (1 + (cmod w)\<^sup>2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (1 + z * w) \<le> sqrt ((1 + (cmod z)\<^sup>2) * (1 + (cmod w)\<^sup>2))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cmod (1 + z * w) \<le> sqrt ((1 + (cmod z)\<^sup>2) * (1 + (cmod w)\<^sup>2))
[PROOF STEP]
have "Re ((1+z*w)*(1+cnj z*cnj w)) \<le> Re (1+z*cnj z)* Re (1+w*cnj w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re ((1 + z * w) * (1 + cnj z * cnj w)) \<le> Re (1 + z * cnj z) * Re (1 + w * cnj w)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Re ((1 + z * w) * (1 + cnj z * cnj w)) \<le> Re (1 + z * cnj z) * Re (1 + w * cnj w)
[PROOF STEP]
have "Re ((w - cnj z)*cnj(w - cnj z)) \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> Re ((w - cnj z) * cnj (w - cnj z))
[PROOF STEP]
by (subst complex_mult_cnj_cmod) (simp add: power2_eq_square)
[PROOF STATE]
proof (state)
this:
0 \<le> Re ((w - cnj z) * cnj (w - cnj z))

goal (1 subgoal):
 1. Re ((1 + z * w) * (1 + cnj z * cnj w)) \<le> Re (1 + z * cnj z) * Re (1 + w * cnj w)
[PROOF STEP]
hence "Re (z*w + cnj z * cnj w) \<le> Re (w*cnj w) + Re(z*cnj z)"
[PROOF STATE]
proof (prove)
using this:
0 \<le> Re ((w - cnj z) * cnj (w - cnj z))

goal (1 subgoal):
 1. Re (z * w + cnj z * cnj w) \<le> Re (w * cnj w) + Re (z * cnj z)
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
Re (z * w + cnj z * cnj w) \<le> Re (w * cnj w) + Re (z * cnj z)

goal (1 subgoal):
 1. Re ((1 + z * w) * (1 + cnj z * cnj w)) \<le> Re (1 + z * cnj z) * Re (1 + w * cnj w)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
Re (z * w + cnj z * cnj w) \<le> Re (w * cnj w) + Re (z * cnj z)

goal (1 subgoal):
 1. Re ((1 + z * w) * (1 + cnj z * cnj w)) \<le> Re (1 + z * cnj z) * Re (1 + w * cnj w)
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
Re ((1 + z * w) * (1 + cnj z * cnj w)) \<le> Re (1 + z * cnj z) * Re (1 + w * cnj w)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Re ((1 + z * w) * (1 + cnj z * cnj w)) \<le> Re (1 + z * cnj z) * Re (1 + w * cnj w)

goal (1 subgoal):
 1. cmod (1 + z * w) \<le> sqrt ((1 + (cmod z)\<^sup>2) * (1 + (cmod w)\<^sup>2))
[PROOF STEP]
hence "(cmod (1 + z * w))\<^sup>2 \<le> (1 + (cmod z)\<^sup>2) * (1 + (cmod w)\<^sup>2)"
[PROOF STATE]
proof (prove)
using this:
Re ((1 + z * w) * (1 + cnj z * cnj w)) \<le> Re (1 + z * cnj z) * Re (1 + w * cnj w)

goal (1 subgoal):
 1. (cmod (1 + z * w))\<^sup>2 \<le> (1 + (cmod z)\<^sup>2) * (1 + (cmod w)\<^sup>2)
[PROOF STEP]
by (subst cmod_square)+ simp
[PROOF STATE]
proof (state)
this:
(cmod (1 + z * w))\<^sup>2 \<le> (1 + (cmod z)\<^sup>2) * (1 + (cmod w)\<^sup>2)

goal (1 subgoal):
 1. cmod (1 + z * w) \<le> sqrt ((1 + (cmod z)\<^sup>2) * (1 + (cmod w)\<^sup>2))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(cmod (1 + z * w))\<^sup>2 \<le> (1 + (cmod z)\<^sup>2) * (1 + (cmod w)\<^sup>2)

goal (1 subgoal):
 1. cmod (1 + z * w) \<le> sqrt ((1 + (cmod z)\<^sup>2) * (1 + (cmod w)\<^sup>2))
[PROOF STEP]
by (metis abs_norm_cancel real_sqrt_abs real_sqrt_le_iff)
[PROOF STATE]
proof (state)
this:
cmod (1 + z * w) \<le> sqrt ((1 + (cmod z)\<^sup>2) * (1 + (cmod w)\<^sup>2))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma interval_integral_zero [simp]:
  fixes a b :: ereal
  shows "LBINT x=a..b. 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LBINT x=a..b. (0::'a) = (0::'a)
[PROOF STEP]
unfolding interval_lebesgue_integral_def set_lebesgue_integral_def einterval_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if a \<le> b then LBINT x. indicat_real (einterval a b) x *\<^sub>R (0::'a) else - (LBINT x. indicat_real (einterval b a) x *\<^sub>R (0::'a))) = (0::'a)
[PROOF STEP]
by simp


[STATEMENT]
lemma eval_fds_eqI:
  assumes "(\<lambda>n. fds_nth f (Suc n) / nat_power (Suc n) s) sums L"
  shows   "eval_fds f s = L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_fds f s = L
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. eval_fds f s = L
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. fds_nth f (Suc n) / nat_power (Suc n) s) sums L
[PROOF STEP]
have "(\<lambda>n. fds_nth f n / nat_power n s) sums L"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. fds_nth f (Suc n) / nat_power (Suc n) s) sums L

goal (1 subgoal):
 1. (\<lambda>n. fds_nth f n / nat_power n s) sums L
[PROOF STEP]
by (subst (asm) sums_Suc_iff) auto
[PROOF STATE]
proof (state)
this:
(\<lambda>n. fds_nth f n / nat_power n s) sums L

goal (1 subgoal):
 1. eval_fds f s = L
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. fds_nth f n / nat_power n s) sums L

goal (1 subgoal):
 1. eval_fds f s = L
[PROOF STEP]
by (simp add: eval_fds_def sums_iff)
[PROOF STATE]
proof (state)
this:
eval_fds f s = L

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma all_unshared_takeWhile_subset: "all_unshared (takeWhile P sb) \<subseteq> all_unshared sb"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. all_unshared (takeWhile P sb) \<subseteq> all_unshared sb
[PROOF STEP]
using all_unshared_append [of "(takeWhile P sb)" "(dropWhile P sb)"]
[PROOF STATE]
proof (prove)
using this:
all_unshared (takeWhile P sb @ dropWhile P sb) = all_unshared (takeWhile P sb) \<union> all_unshared (dropWhile P sb)

goal (1 subgoal):
 1. all_unshared (takeWhile P sb) \<subseteq> all_unshared sb
[PROOF STEP]
by auto


[STATEMENT]
lemma sameprod_altdef: "X^\<two> = {Y. Y \<subseteq> X \<and> card Y = 2}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X^\<two> = {Y. Y \<subseteq> X \<and> card Y = 2}
[PROOF STEP]
unfolding binprod_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {{x, y} |x y. x \<in> X \<and> y \<in> X \<and> x \<noteq> y} = {Y. Y \<subseteq> X \<and> card Y = 2}
[PROOF STEP]
by (auto simp: card_2_iff)


[STATEMENT]
lemma numeral_less_floor [simp]: "numeral v < \<lfloor>x\<rfloor> \<longleftrightarrow> numeral v + 1 \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (numeral v < \<lfloor>x\<rfloor>) = (numeral v + (1::'a) \<le> x)
[PROOF STEP]
by (simp add: less_floor_iff)


[STATEMENT]
lemma ennreal_zero_divide[simp]: "0 / (x::ennreal) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 / x = 0
[PROOF STEP]
by (simp add: divide_ennreal_def)


[STATEMENT]
lemma is_Var_iff: "is_Var v \<longleftrightarrow> v = succ (ord_of (nat_of_name (decode_Var v)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_Var v = (v = succ (ord_of (nat_of_name (decode_Var v))))
[PROOF STEP]
by (metis eval_tm_ORD_OF eval_tm_SUCC is_Var_imp_decode_Var quot_Var is_Var_succ_iff Ord_ord_of)


[STATEMENT]
lemma analz_UN_analz [simp]: "analz (\<Union>i\<in>A. analz (H i)) = analz (\<Union>i\<in>A. H i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. analz (\<Union>i\<in>A. analz (H i)) = analz (\<Union> (H ` A))
[PROOF STEP]
by (blast intro: analz_UN_analz_lemma analz_mono [THEN [2] rev_subsetD])


[STATEMENT]
lemma nn_integral_0_1_ln_times_powr:
  assumes "e > -1"
  shows    "(\<integral>\<^sup>+y\<in>{0<..<1}. ennreal (-ln y * y powr e) \<partial>lborel) = ennreal (1 / (e + 1)\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>{0<..<1}. ennreal (- ln x * x powr e)\<partial>lborel = ennreal (1 / (e + 1)\<^sup>2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>{0<..<1}. ennreal (- ln x * x powr e)\<partial>lborel = ennreal (1 / (e + 1)\<^sup>2)
[PROOF STEP]
have *: "(LBINT x=0..1. - ln x * x powr e = 1 / (e + 1)\<^sup>2)"
          "interval_lebesgue_integrable lborel 0 1 (\<lambda>x. - ln x * x powr e)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LBINT x=0..1. - ln x * x powr e = 1 / (e + 1)\<^sup>2 &&& interval_lebesgue_integrable lborel 0 1 (\<lambda>x. - ln x * x powr e)
[PROOF STEP]
using integral_0_1_ln_times_powr[OF assms]
[PROOF STATE]
proof (prove)
using this:
LBINT x=0..1. - ln x * x powr e = 1 / (e + 1)\<^sup>2
interval_lebesgue_integrable lborel 0 1 (\<lambda>x. - ln x * x powr e)

goal (1 subgoal):
 1. LBINT x=0..1. - ln x * x powr e = 1 / (e + 1)\<^sup>2 &&& interval_lebesgue_integrable lborel 0 1 (\<lambda>x. - ln x * x powr e)
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
LBINT x=0..1. - ln x * x powr e = 1 / (e + 1)\<^sup>2
interval_lebesgue_integrable lborel 0 1 (\<lambda>x. - ln x * x powr e)

goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>{0<..<1}. ennreal (- ln x * x powr e)\<partial>lborel = ennreal (1 / (e + 1)\<^sup>2)
[PROOF STEP]
have eq: "(\<lambda>y. (if 0 < y \<and> y < 1 then 1 else 0) * ln y * y powr e) =
            (\<lambda>y. if 0 < y \<and> y < 1 then ln y * y powr e else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>y. (if 0 < y \<and> y < 1 then 1 else 0) * ln y * y powr e) = (\<lambda>y. if 0 < y \<and> y < 1 then ln y * y powr e else 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>y. (if 0 < y \<and> y < 1 then 1 else 0) * ln y * y powr e) = (\<lambda>y. if 0 < y \<and> y < 1 then ln y * y powr e else 0)

goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>{0<..<1}. ennreal (- ln x * x powr e)\<partial>lborel = ennreal (1 / (e + 1)\<^sup>2)
[PROOF STEP]
have "(\<integral>\<^sup>+y\<in>{0<..<1}. ennreal (-ln y * y powr e) \<partial>lborel) =
           (\<integral>\<^sup>+y. ennreal (-ln y * y powr e * indicator {0<..<1} y) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>{0<..<1}. ennreal (- ln x * x powr e)\<partial>lborel = \<integral>\<^sup>+ y. ennreal (- ln y * y powr e * indicat_real {0<..<1} y) \<partial>lborel
[PROOF STEP]
by (intro nn_integral_cong) (auto simp: indicator_def)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>{0<..<1}. ennreal (- ln x * x powr e)\<partial>lborel = \<integral>\<^sup>+ y. ennreal (- ln y * y powr e * indicat_real {0<..<1} y) \<partial>lborel

goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>{0<..<1}. ennreal (- ln x * x powr e)\<partial>lborel = ennreal (1 / (e + 1)\<^sup>2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>{0<..<1}. ennreal (- ln x * x powr e)\<partial>lborel = \<integral>\<^sup>+ y. ennreal (- ln y * y powr e * indicat_real {0<..<1} y) \<partial>lborel

goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>{0<..<1}. ennreal (- ln x * x powr e)\<partial>lborel = ennreal (1 / (e + 1)\<^sup>2)
[PROOF STEP]
have "\<dots> = ennreal (1 / (e + 1)\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ y. ennreal (- ln y * y powr e * indicat_real {0<..<1} y) \<partial>lborel = ennreal (1 / (e + 1)\<^sup>2)
[PROOF STEP]
using * eq
[PROOF STATE]
proof (prove)
using this:
LBINT x=0..1. - ln x * x powr e = 1 / (e + 1)\<^sup>2
interval_lebesgue_integrable lborel 0 1 (\<lambda>x. - ln x * x powr e)
(\<lambda>y. (if 0 < y \<and> y < 1 then 1 else 0) * ln y * y powr e) = (\<lambda>y. if 0 < y \<and> y < 1 then ln y * y powr e else 0)

goal (1 subgoal):
 1. \<integral>\<^sup>+ y. ennreal (- ln y * y powr e * indicat_real {0<..<1} y) \<partial>lborel = ennreal (1 / (e + 1)\<^sup>2)
[PROOF STEP]
by (subst nn_integral_eq_integral)
       (auto intro!: AE_I2 simp: indicator_def interval_lebesgue_integrable_def
               set_integrable_def one_ereal_def zero_ereal_def interval_integral_Ioo
                mult_ac mult_nonpos_nonneg set_lebesgue_integral_def)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ y. ennreal (- ln y * y powr e * indicat_real {0<..<1} y) \<partial>lborel = ennreal (1 / (e + 1)\<^sup>2)

goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>{0<..<1}. ennreal (- ln x * x powr e)\<partial>lborel = ennreal (1 / (e + 1)\<^sup>2)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<integral>\<^sup>+x\<in>{0<..<1}. ennreal (- ln x * x powr e)\<partial>lborel = ennreal (1 / (e + 1)\<^sup>2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+x\<in>{0<..<1}. ennreal (- ln x * x powr e)\<partial>lborel = ennreal (1 / (e + 1)\<^sup>2)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma conjugate_preserve_poincare_between':
  assumes "u \<in> unit_disc" "v \<in> unit_disc" "w \<in> unit_disc"
  shows "poincare_between (conjugate u) (conjugate v) (conjugate w) \<longleftrightarrow> poincare_between u v w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poincare_between (conjugate u) (conjugate v) (conjugate w) = poincare_between u v w
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
u \<in> unit_disc
v \<in> unit_disc
w \<in> unit_disc

goal (1 subgoal):
 1. poincare_between (conjugate u) (conjugate v) (conjugate w) = poincare_between u v w
[PROOF STEP]
using poincare_between_sum_distances
[PROOF STATE]
proof (prove)
using this:
u \<in> unit_disc
v \<in> unit_disc
w \<in> unit_disc
\<lbrakk>?u \<in> unit_disc; ?v \<in> unit_disc; ?w \<in> unit_disc\<rbrakk> \<Longrightarrow> poincare_between ?u ?v ?w = (poincare_distance ?u ?v + poincare_distance ?v ?w = poincare_distance ?u ?w)

goal (1 subgoal):
 1. poincare_between (conjugate u) (conjugate v) (conjugate w) = poincare_between u v w
[PROOF STEP]
by simp


[STATEMENT]
lemma trancl_collect [rule_format]:
  "\<lbrakk> (x,y) \<in> R^*; S \<notin> Domain R \<rbrakk> \<Longrightarrow> y \<noteq> S \<longrightarrow> (x,y) \<in> {p. fst p \<noteq> S \<and> snd p \<noteq> S \<and> p \<in> R}^*"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(x, y) \<in> R\<^sup>*; S \<notin> Domain R\<rbrakk> \<Longrightarrow> y \<noteq> S \<longrightarrow> (x, y) \<in> {p. fst p \<noteq> S \<and> snd p \<noteq> S \<and> p \<in> R}\<^sup>*
[PROOF STEP]
apply (rule_tac b=y in rtrancl_induct)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>(x, y) \<in> R\<^sup>*; S \<notin> Domain R\<rbrakk> \<Longrightarrow> (?a, y) \<in> ?r\<^sup>*
 2. \<lbrakk>(x, y) \<in> R\<^sup>*; S \<notin> Domain R\<rbrakk> \<Longrightarrow> ?a \<noteq> S \<longrightarrow> (x, ?a) \<in> {p. fst p \<noteq> S \<and> snd p \<noteq> S \<and> p \<in> R}\<^sup>*
 3. \<And>ya z. \<lbrakk>(x, y) \<in> R\<^sup>*; S \<notin> Domain R; (?a, ya) \<in> ?r\<^sup>*; (ya, z) \<in> ?r; ya \<noteq> S \<longrightarrow> (x, ya) \<in> {p. fst p \<noteq> S \<and> snd p \<noteq> S \<and> p \<in> R}\<^sup>*\<rbrakk> \<Longrightarrow> z \<noteq> S \<longrightarrow> (x, z) \<in> {p. fst p \<noteq> S \<and> snd p \<noteq> S \<and> p \<in> R}\<^sup>*
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>ya z. \<lbrakk>(x, y) \<in> R\<^sup>*; S \<notin> Domain R; (x, ya) \<in> R\<^sup>*; (ya, z) \<in> R; z \<noteq> S; (x, ya) \<in> {p. fst p \<noteq> S \<and> snd p \<noteq> S \<and> p \<in> R}\<^sup>*\<rbrakk> \<Longrightarrow> (x, z) \<in> {p. fst p \<noteq> S \<and> snd p \<noteq> S \<and> p \<in> R}\<^sup>*
[PROOF STEP]
apply (rule rtrancl_into_rtrancl)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>ya z. \<lbrakk>(x, y) \<in> R\<^sup>*; S \<notin> Domain R; (x, ya) \<in> R\<^sup>*; (ya, z) \<in> R; z \<noteq> S; (x, ya) \<in> {p. fst p \<noteq> S \<and> snd p \<noteq> S \<and> p \<in> R}\<^sup>*\<rbrakk> \<Longrightarrow> (x, ?b13 ya z) \<in> {p. fst p \<noteq> S \<and> snd p \<noteq> S \<and> p \<in> R}\<^sup>*
 2. \<And>ya z. \<lbrakk>(x, y) \<in> R\<^sup>*; S \<notin> Domain R; (x, ya) \<in> R\<^sup>*; (ya, z) \<in> R; z \<noteq> S; (x, ya) \<in> {p. fst p \<noteq> S \<and> snd p \<noteq> S \<and> p \<in> R}\<^sup>*\<rbrakk> \<Longrightarrow> (?b13 ya z, z) \<in> {p. fst p \<noteq> S \<and> snd p \<noteq> S \<and> p \<in> R}
[PROOF STEP]
apply fast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>ya z. \<lbrakk>(x, y) \<in> R\<^sup>*; S \<notin> Domain R; (x, ya) \<in> R\<^sup>*; (ya, z) \<in> R; z \<noteq> S; (x, ya) \<in> {p. fst p \<noteq> S \<and> snd p \<noteq> S \<and> p \<in> R}\<^sup>*\<rbrakk> \<Longrightarrow> (ya, z) \<in> {p. fst p \<noteq> S \<and> snd p \<noteq> S \<and> p \<in> R}
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma single_eq_single [simp]: "{#a#} = {#b#} \<longleftrightarrow> a = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({#a#} = {#b#}) = (a = b)
[PROOF STEP]
by (auto simp add: multiset_eq_iff)


[STATEMENT]
lemma real_mult_gt_cube: "A \<ge> (X ::real) \<Longrightarrow> B \<ge> X \<Longrightarrow> C \<ge> X \<Longrightarrow> X \<ge> 0 \<Longrightarrow> A * B * C \<ge> X^3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>X \<le> A; X \<le> B; X \<le> C; 0 \<le> X\<rbrakk> \<Longrightarrow> X ^ 3 \<le> A * B * C
[PROOF STEP]
by (simp add: mult_mono' power3_eq_cube)


[STATEMENT]
lemma nonpos_Reals_mult_I2: "\<lbrakk>a \<in> \<real>\<^sub>\<le>\<^sub>0; b \<in> \<real>\<^sub>\<ge>\<^sub>0\<rbrakk> \<Longrightarrow> a * b \<in> \<real>\<^sub>\<le>\<^sub>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> \<real>\<^sub>\<le>\<^sub>0; b \<in> \<real>\<^sub>\<ge>\<^sub>0\<rbrakk> \<Longrightarrow> a * b \<in> \<real>\<^sub>\<le>\<^sub>0
[PROOF STEP]
by (metis nonneg_Reals_mult_I mult_minus_left uminus_nonneg_Reals_iff)


[STATEMENT]
lemma hypext_fun_inverse:
  assumes "f twice_field_differentiable_at (Base x)"
      and "f (Base x) \<noteq> 0"
    shows "(*h* (\<lambda>x. inverse (f x))) x = inverse ((*h* f) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (*h* (\<lambda>x. inverse (f x))) x = inverse ((*h* f) x)
[PROOF STEP]
using assms hypext_compose[of f x inverse]
[PROOF STATE]
proof (prove)
using this:
f twice_field_differentiable_at Base x
f (Base x) \<noteq> (0::'a)
\<lbrakk>f twice_field_differentiable_at Base x; inverse twice_field_differentiable_at f (Base x)\<rbrakk> \<Longrightarrow> (*h* (\<lambda>x. inverse (f x))) x = (*h* inverse) ((*h* f) x)

goal (1 subgoal):
 1. (*h* (\<lambda>x. inverse (f x))) x = inverse ((*h* f) x)
[PROOF STEP]
by (simp add: hypext_inverse)


[STATEMENT]
lemma iTILL_iFROM_subset_conv: "([\<dots>n'] \<subseteq> [n\<dots>]) = (n = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ([\<dots>n'] \<subseteq> [n\<dots>]) = (n = 0)
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. [\<dots>n'] \<subseteq> [n\<dots>] \<Longrightarrow> n = 0
 2. n = 0 \<Longrightarrow> [\<dots>n'] \<subseteq> [n\<dots>]
[PROOF STEP]
apply (drule subsetD[of _ _ 0])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. 0 \<in> [\<dots>n']
 2. 0 \<in> [n\<dots>] \<Longrightarrow> n = 0
 3. n = 0 \<Longrightarrow> [\<dots>n'] \<subseteq> [n\<dots>]
[PROOF STEP]
apply (simp add: iT_iff)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n = 0 \<Longrightarrow> [\<dots>n'] \<subseteq> [0\<dots>]
[PROOF STEP]
apply (simp add: iFROM_0)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma ListSum_eq [trans]:
  "(\<And>v. v \<in> set V \<Longrightarrow> f v = g v) \<Longrightarrow> (\<Sum>\<^bsub>v \<in> V\<^esub> f v) = (\<Sum>\<^bsub>v \<in> V\<^esub> g v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>v. v \<in> set V \<Longrightarrow> f v = g v) \<Longrightarrow> ListSum V f = ListSum V g
[PROOF STEP]
by(auto intro!:listsum_cong)


[STATEMENT]
lemma gcd_greatest:
  assumes "is_gcd gcd'" and "c dvd a" and "c dvd b"
  shows "c dvd gcd' a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c dvd gcd' a b
[PROOF STEP]
using assms is_gcd_def
[PROOF STATE]
proof (prove)
using this:
is_gcd gcd'
c dvd a
c dvd b
is_gcd ?gcd' = (\<forall>a b. ?gcd' a b dvd a \<and> ?gcd' a b dvd b \<and> (\<forall>d'. d' dvd a \<and> d' dvd b \<longrightarrow> d' dvd ?gcd' a b))

goal (1 subgoal):
 1. c dvd gcd' a b
[PROOF STEP]
by blast


[STATEMENT]
lemma MaxI_ex2: "\<lbrakk> A \<noteq> {}; finite A \<rbrakk> \<Longrightarrow> Max A \<in> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<noteq> {}; finite A\<rbrakk> \<Longrightarrow> Max A \<in> A
[PROOF STEP]
by (blast intro: MaxI)


[STATEMENT]
lemma fls_left_inverse_eq_fls_right_inverse_comm:
  fixes   f :: "'a::comm_ring_1 fls"
  assumes "x * f $$ fls_subdegree f = 1"
  shows   "fls_left_inverse f x = fls_right_inverse f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_left_inverse f x = fls_right_inverse f x
[PROOF STEP]
using   assms fls_left_inverse_eq_fls_right_inverse[of x f x]
[PROOF STATE]
proof (prove)
using this:
x * f $$ fls_subdegree f = (1::'a)
\<lbrakk>x * f $$ fls_subdegree f = (1::'a); f $$ fls_subdegree f * x = (1::'a)\<rbrakk> \<Longrightarrow> fls_left_inverse f x = fls_right_inverse f x

goal (1 subgoal):
 1. fls_left_inverse f x = fls_right_inverse f x
[PROOF STEP]
by      (simp add: mult.commute)


[STATEMENT]
lemma map_us_func1: "map_us id = (id::'a::complete_lattice_with_dual upset \<Rightarrow> 'a upset)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_us id = id
[PROOF STEP]
unfolding map_us_def fun_eq_iff comp_def us_def id_def IInf_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. Abs_upset (\<up> (\<Sqinter> Rep_upset x)) = x
[PROOF STEP]
by (metis (no_types, lifting) Inf_upset_id Rep_upset Rep_upset_inverse image_iff pointfree_idE)


[STATEMENT]
lemma bmod_assoc_aux1:
  "\<Squnion>{\<Squnion>{(f :: 'a \<Rightarrow> 'b::proto_near_quantale) u \<cdot> g v \<cdot> h w |u v. R y u v} |y w. R x y w}
     = \<Squnion>{(f u \<cdot> g v) \<cdot> h w |u v y w. R y u v \<and> R x y w}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Squnion>{\<Squnion>{f u \<cdot> g v \<cdot> h w |u v. R y u v} |y w. R x y w} = \<Squnion>{uu_. \<exists>u v y w. uu_ = f u \<cdot> g v \<cdot> h w \<and> R y u v \<and> R x y w}
[PROOF STEP]
apply (rule antisym)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<Squnion>{\<Squnion>{f u \<cdot> g v \<cdot> h w |u v. R y u v} |y w. R x y w} \<le> \<Squnion>{uu_. \<exists>u v y w. uu_ = f u \<cdot> g v \<cdot> h w \<and> R y u v \<and> R x y w}
 2. \<Squnion>{uu_. \<exists>u v y w. uu_ = f u \<cdot> g v \<cdot> h w \<and> R y u v \<and> R x y w} \<le> \<Squnion>{\<Squnion>{f u \<cdot> g v \<cdot> h w |u v. R y u v} |y w. R x y w}
[PROOF STEP]
apply (rule Sup_least, safe)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>xa y w. R x y w \<Longrightarrow> \<Squnion>{f u \<cdot> g v \<cdot> h w |u v. R y u v} \<le> \<Squnion>{uu_. \<exists>u v y w. uu_ = f u \<cdot> g v \<cdot> h w \<and> R y u v \<and> R x y w}
 2. \<Squnion>{uu_. \<exists>u v y w. uu_ = f u \<cdot> g v \<cdot> h w \<and> R y u v \<and> R x y w} \<le> \<Squnion>{\<Squnion>{f u \<cdot> g v \<cdot> h w |u v. R y u v} |y w. R x y w}
[PROOF STEP]
apply (intro Sup_least Sup_upper, force)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Squnion>{uu_. \<exists>u v y w. uu_ = f u \<cdot> g v \<cdot> h w \<and> R y u v \<and> R x y w} \<le> \<Squnion>{\<Squnion>{f u \<cdot> g v \<cdot> h w |u v. R y u v} |y w. R x y w}
[PROOF STEP]
apply (rule Sup_least, safe)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa u v y w. \<lbrakk>R y u v; R x y w\<rbrakk> \<Longrightarrow> f u \<cdot> g v \<cdot> h w \<le> \<Squnion>{\<Squnion>{f u \<cdot> g v \<cdot> h w |u v. R y u v} |y w. R x y w}
[PROOF STEP]
by (rule Sup_upper2, auto)+


[STATEMENT]
lemma vinsert_vintersection: "vinsert a (A \<inter>\<^sub>\<circ> B) = vinsert a A \<inter>\<^sub>\<circ> vinsert a B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vinsert a (A \<inter>\<^sub>\<circ> B) = vinsert a A \<inter>\<^sub>\<circ> vinsert a B
[PROOF STEP]
by auto


[STATEMENT]
lemma card_singleton_differenceset_eq:
  assumes "a \<in> G" and "A \<subseteq> G"
  shows "card A = card (differenceset {a} A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card A = card (differenceset {a} A)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<in> G
A \<subseteq> G

goal (1 subgoal):
 1. card A = card (differenceset {a} A)
[PROOF STEP]
by (metis card_minusset' card_sumset_singleton_subset_eq minusset_subset_carrier)


[STATEMENT]
lemma numeral_less_floor [simp]: "numeral v < \<lfloor>x\<rfloor> \<longleftrightarrow> numeral v + 1 \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (numeral v < \<lfloor>x\<rfloor>) = (numeral v + (1::'a) \<le> x)
[PROOF STEP]
by (simp add: less_floor_iff)


[STATEMENT]
theorem "!! (y::int) (z::int) n. Suc(n::nat) < 6 ==>  3 dvd z ==>
  2 dvd (y::int) ==> (\<exists>(x::int).  2*x =  y) & (\<exists>(k::int). 3*k = z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y z n. \<lbrakk>Suc n < 6; 3 dvd z; even y\<rbrakk> \<Longrightarrow> (\<exists>x. 2 * x = y) \<and> (\<exists>k. 3 * k = z)
[PROOF STEP]
by presburger


[STATEMENT]
lemma Vd_succ:
      assumes "u\<in>Vd d"
      assumes "(u,v)\<in>E"
      assumes "\<forall>i\<le>d. v\<notin>Vd i"
      shows "v\<in>Vd (Suc d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> Vd (Suc d)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
u \<in> Vd d
(u, v) \<in> E
\<forall>i\<le>d. v \<notin> Vd i

goal (1 subgoal):
 1. v \<in> Vd (Suc d)
[PROOF STEP]
by (metis connected_append_edge in_Vd_conv le_SucE min_dist_succ)


[STATEMENT]
lemma fds_norm_1 [simp]: "fds_norm 1 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_norm 1 = 1
[PROOF STEP]
by (simp add: fds_eq_iff one_fds_def)


[STATEMENT]
lemma nat_lepoll_real: "(UNIV::nat set) \<lesssim> (UNIV::real set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. UNIV \<lesssim> UNIV
[PROOF STEP]
using infinite_UNIV_char_0 infinite_countable_subset
[PROOF STATE]
proof (prove)
using this:
infinite UNIV
infinite ?S \<Longrightarrow> \<exists>f. inj f \<and> range f \<subseteq> ?S

goal (1 subgoal):
 1. UNIV \<lesssim> UNIV
[PROOF STEP]
unfolding lepoll_def
[PROOF STATE]
proof (prove)
using this:
infinite UNIV
infinite ?S \<Longrightarrow> \<exists>f. inj f \<and> range f \<subseteq> ?S

goal (1 subgoal):
 1. \<exists>f. inj f \<and> range f \<subseteq> UNIV
[PROOF STEP]
by blast


[STATEMENT]
lemma complex_add_cnj: "z + cnj z = complex_of_real (2 * Re z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z + cnj z = complex_of_real (2 * Re z)
[PROOF STEP]
by (simp add: complex_eq_iff)


[STATEMENT]
lemma dist_add_cancel [simp]: "dist (a + b) (a + c) = dist b c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (a + b) (a + c) = dist b c
[PROOF STEP]
by (simp add: dist_norm)


[STATEMENT]
lemma measure_spmf_eq_density: "measure_spmf p = density (count_space UNIV) (spmf p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. measure_spmf p = density (count_space UNIV) (\<lambda>x. ennreal (spmf p x))
[PROOF STEP]
by(rule measure_eqI)(simp_all add: emeasure_density nn_integral_spmf[symmetric] nn_integral_count_space_indicator)