[STATEMENT]
lemma round_diff_minimal: "\<bar>z - of_int (round z)\<bar> \<le> \<bar>z - of_int m\<bar>"
  for z :: "'a::floor_ceiling"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>z - of_int (round z)\<bar> \<le> \<bar>z - of_int m\<bar>
[PROOF STEP]
proof (cases "of_int m \<ge> z")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. z \<le> of_int m \<Longrightarrow> \<bar>z - of_int (round z)\<bar> \<le> \<bar>z - of_int m\<bar>
 2. \<not> z \<le> of_int m \<Longrightarrow> \<bar>z - of_int (round z)\<bar> \<le> \<bar>z - of_int m\<bar>
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
z \<le> of_int m

goal (2 subgoals):
 1. z \<le> of_int m \<Longrightarrow> \<bar>z - of_int (round z)\<bar> \<le> \<bar>z - of_int m\<bar>
 2. \<not> z \<le> of_int m \<Longrightarrow> \<bar>z - of_int (round z)\<bar> \<le> \<bar>z - of_int m\<bar>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z \<le> of_int m
[PROOF STEP]
have "\<bar>z - of_int (round z)\<bar> \<le> \<bar>of_int \<lceil>z\<rceil> - z\<bar>"
[PROOF STATE]
proof (prove)
using this:
z \<le> of_int m

goal (1 subgoal):
 1. \<bar>z - of_int (round z)\<bar> \<le> \<bar>of_int \<lceil>z\<rceil> - z\<bar>
[PROOF STEP]
unfolding round_altdef
[PROOF STATE]
proof (prove)
using this:
z \<le> of_int m

goal (1 subgoal):
 1. \<bar>z - of_int (if (1::'a) / (2::'a) \<le> frac z then \<lceil>z\<rceil> else \<lfloor>z\<rfloor>)\<bar> \<le> \<bar>of_int \<lceil>z\<rceil> - z\<bar>
[PROOF STEP]
by (simp add: field_simps ceiling_altdef frac_def) linarith
[PROOF STATE]
proof (state)
this:
\<bar>z - of_int (round z)\<bar> \<le> \<bar>of_int \<lceil>z\<rceil> - z\<bar>

goal (2 subgoals):
 1. z \<le> of_int m \<Longrightarrow> \<bar>z - of_int (round z)\<bar> \<le> \<bar>z - of_int m\<bar>
 2. \<not> z \<le> of_int m \<Longrightarrow> \<bar>z - of_int (round z)\<bar> \<le> \<bar>z - of_int m\<bar>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<bar>z - of_int (round z)\<bar> \<le> \<bar>of_int \<lceil>z\<rceil> - z\<bar>

goal (2 subgoals):
 1. z \<le> of_int m \<Longrightarrow> \<bar>z - of_int (round z)\<bar> \<le> \<bar>z - of_int m\<bar>
 2. \<not> z \<le> of_int m \<Longrightarrow> \<bar>z - of_int (round z)\<bar> \<le> \<bar>z - of_int m\<bar>
[PROOF STEP]
have "of_int \<lceil>z\<rceil> - z \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) \<le> of_int \<lceil>z\<rceil> - z
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
(0::'a) \<le> of_int \<lceil>z\<rceil> - z

goal (2 subgoals):
 1. z \<le> of_int m \<Longrightarrow> \<bar>z - of_int (round z)\<bar> \<le> \<bar>z - of_int m\<bar>
 2. \<not> z \<le> of_int m \<Longrightarrow> \<bar>z - of_int (round z)\<bar> \<le> \<bar>z - of_int m\<bar>
[PROOF STEP]
with True
[PROOF STATE]
proof (chain)
picking this:
z \<le> of_int m
(0::'a) \<le> of_int \<lceil>z\<rceil> - z
[PROOF STEP]
have "\<bar>of_int \<lceil>z\<rceil> - z\<bar> \<le> \<bar>z - of_int m\<bar>"
[PROOF STATE]
proof (prove)
using this:
z \<le> of_int m
(0::'a) \<le> of_int \<lceil>z\<rceil> - z

goal (1 subgoal):
 1. \<bar>of_int \<lceil>z\<rceil> - z\<bar> \<le> \<bar>z - of_int m\<bar>
[PROOF STEP]
by (simp add: ceiling_le_iff)
[PROOF STATE]
proof (state)
this:
\<bar>of_int \<lceil>z\<rceil> - z\<bar> \<le> \<bar>z - of_int m\<bar>

goal (2 subgoals):
 1. z \<le> of_int m \<Longrightarrow> \<bar>z - of_int (round z)\<bar> \<le> \<bar>z - of_int m\<bar>
 2. \<not> z \<le> of_int m \<Longrightarrow> \<bar>z - of_int (round z)\<bar> \<le> \<bar>z - of_int m\<bar>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<bar>z - of_int (round z)\<bar> \<le> \<bar>z - of_int m\<bar>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<bar>z - of_int (round z)\<bar> \<le> \<bar>z - of_int m\<bar>

goal (1 subgoal):
 1. \<bar>z - of_int (round z)\<bar> \<le> \<bar>z - of_int m\<bar>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<bar>z - of_int (round z)\<bar> \<le> \<bar>z - of_int m\<bar>

goal (1 subgoal):
 1. \<not> z \<le> of_int m \<Longrightarrow> \<bar>z - of_int (round z)\<bar> \<le> \<bar>z - of_int m\<bar>
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> z \<le> of_int m \<Longrightarrow> \<bar>z - of_int (round z)\<bar> \<le> \<bar>z - of_int m\<bar>
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> z \<le> of_int m

goal (1 subgoal):
 1. \<not> z \<le> of_int m \<Longrightarrow> \<bar>z - of_int (round z)\<bar> \<le> \<bar>z - of_int m\<bar>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> z \<le> of_int m
[PROOF STEP]
have "\<bar>z - of_int (round z)\<bar> \<le> \<bar>of_int \<lfloor>z\<rfloor> - z\<bar>"
[PROOF STATE]
proof (prove)
using this:
\<not> z \<le> of_int m

goal (1 subgoal):
 1. \<bar>z - of_int (round z)\<bar> \<le> \<bar>of_int \<lfloor>z\<rfloor> - z\<bar>
[PROOF STEP]
unfolding round_altdef
[PROOF STATE]
proof (prove)
using this:
\<not> z \<le> of_int m

goal (1 subgoal):
 1. \<bar>z - of_int (if (1::'a) / (2::'a) \<le> frac z then \<lceil>z\<rceil> else \<lfloor>z\<rfloor>)\<bar> \<le> \<bar>of_int \<lfloor>z\<rfloor> - z\<bar>
[PROOF STEP]
by (simp add: field_simps ceiling_altdef frac_def) linarith
[PROOF STATE]
proof (state)
this:
\<bar>z - of_int (round z)\<bar> \<le> \<bar>of_int \<lfloor>z\<rfloor> - z\<bar>

goal (1 subgoal):
 1. \<not> z \<le> of_int m \<Longrightarrow> \<bar>z - of_int (round z)\<bar> \<le> \<bar>z - of_int m\<bar>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<bar>z - of_int (round z)\<bar> \<le> \<bar>of_int \<lfloor>z\<rfloor> - z\<bar>

goal (1 subgoal):
 1. \<not> z \<le> of_int m \<Longrightarrow> \<bar>z - of_int (round z)\<bar> \<le> \<bar>z - of_int m\<bar>
[PROOF STEP]
have "z - of_int \<lfloor>z\<rfloor> \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) \<le> z - of_int \<lfloor>z\<rfloor>
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
(0::'a) \<le> z - of_int \<lfloor>z\<rfloor>

goal (1 subgoal):
 1. \<not> z \<le> of_int m \<Longrightarrow> \<bar>z - of_int (round z)\<bar> \<le> \<bar>z - of_int m\<bar>
[PROOF STEP]
with False
[PROOF STATE]
proof (chain)
picking this:
\<not> z \<le> of_int m
(0::'a) \<le> z - of_int \<lfloor>z\<rfloor>
[PROOF STEP]
have "\<bar>of_int \<lfloor>z\<rfloor> - z\<bar> \<le> \<bar>z - of_int m\<bar>"
[PROOF STATE]
proof (prove)
using this:
\<not> z \<le> of_int m
(0::'a) \<le> z - of_int \<lfloor>z\<rfloor>

goal (1 subgoal):
 1. \<bar>of_int \<lfloor>z\<rfloor> - z\<bar> \<le> \<bar>z - of_int m\<bar>
[PROOF STEP]
by (simp add: le_floor_iff)
[PROOF STATE]
proof (state)
this:
\<bar>of_int \<lfloor>z\<rfloor> - z\<bar> \<le> \<bar>z - of_int m\<bar>

goal (1 subgoal):
 1. \<not> z \<le> of_int m \<Longrightarrow> \<bar>z - of_int (round z)\<bar> \<le> \<bar>z - of_int m\<bar>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<bar>z - of_int (round z)\<bar> \<le> \<bar>z - of_int m\<bar>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<bar>z - of_int (round z)\<bar> \<le> \<bar>z - of_int m\<bar>

goal (1 subgoal):
 1. \<bar>z - of_int (round z)\<bar> \<le> \<bar>z - of_int m\<bar>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<bar>z - of_int (round z)\<bar> \<le> \<bar>z - of_int m\<bar>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma discriminant_cubic_depressed: assumes "[:-x,1:] * [:-y,1:] * [:-z,1:] = [:f,e,0,1:]"
  shows "discriminant_cubic_depressed e f = (x-y)^2 * (x - z)^2 * (y - z)^2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. discriminant_cubic_depressed e f = (x - y)\<^sup>2 * (x - z)\<^sup>2 * (y - z)\<^sup>2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. discriminant_cubic_depressed e f = (x - y)\<^sup>2 * (x - z)\<^sup>2 * (y - z)\<^sup>2
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
[:- x, 1::'a:] * [:- y, 1::'a:] * [:- z, 1::'a:] = [:f, e, 0::'a, 1::'a:]
[PROOF STEP]
have f: "f = - (z * (y * x))" and e: "e = y * x - z * (- y - x)" and
      z: "z = - y - x"
[PROOF STATE]
proof (prove)
using this:
[:- x, 1::'a:] * [:- y, 1::'a:] * [:- z, 1::'a:] = [:f, e, 0::'a, 1::'a:]

goal (1 subgoal):
 1. f = - (z * (y * x)) &&& e = y * x - z * (- y - x) &&& z = - y - x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f = - (z * (y * x))
e = y * x - z * (- y - x)
z = - y - x

goal (1 subgoal):
 1. discriminant_cubic_depressed e f = (x - y)\<^sup>2 * (x - z)\<^sup>2 * (y - z)\<^sup>2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. discriminant_cubic_depressed e f = (x - y)\<^sup>2 * (x - z)\<^sup>2 * (y - z)\<^sup>2
[PROOF STEP]
unfolding discriminant_cubic_depressed_def e f z
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - ((4::'a) * (y * x - (- y - x) * (- y - x)) ^ 3 + (27::'a) * (- ((- y - x) * (y * x)))\<^sup>2) = (x - y)\<^sup>2 * (x - (- y - x))\<^sup>2 * (y - (- y - x))\<^sup>2
[PROOF STEP]
by (simp add: power2_eq_square power3_eq_cube field_simps)
[PROOF STATE]
proof (state)
this:
discriminant_cubic_depressed e f = (x - y)\<^sup>2 * (x - z)\<^sup>2 * (y - z)\<^sup>2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma blinfunpow_mono:
  assumes "\<And>u v. u \<le> v \<Longrightarrow> (f :: 'b :: {ord, real_normed_vector} \<Rightarrow>\<^sub>L 'b) u \<le> f v"
  shows "u \<le> v \<Longrightarrow> (f^^n) u \<le> (f^^n) v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u \<le> v \<Longrightarrow> blinfun_apply (f ^^ n) u \<le> blinfun_apply (f ^^ n) v
[PROOF STEP]
by (induction n) (auto simp: assms)


[STATEMENT]
lemma ZL_simp:
  "ZL c p b (Suc t) l = (Z2 (steps c p (Suc t)) l) * b ^ (Suc t) + (ZL c p b t l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ZL c p b (Suc t) l = Z2 (steps c p (Suc t)) l * b ^ Suc t + ZL c p b t l
[PROOF STEP]
proof (induction t arbitrary: p c b)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>p c b. ZL c p b (Suc 0) l = Z2 (steps c p (Suc 0)) l * b ^ Suc 0 + ZL c p b 0 l
 2. \<And>t p c b. (\<And>p c b. ZL c p b (Suc t) l = Z2 (steps c p (Suc t)) l * b ^ Suc t + ZL c p b t l) \<Longrightarrow> ZL c p b (Suc (Suc t)) l = Z2 (steps c p (Suc (Suc t))) l * b ^ Suc (Suc t) + ZL c p b (Suc t) l
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>p c b. ZL c p b (Suc 0) l = Z2 (steps c p (Suc 0)) l * b ^ Suc 0 + ZL c p b 0 l
 2. \<And>t p c b. (\<And>p c b. ZL c p b (Suc t) l = Z2 (steps c p (Suc t)) l * b ^ Suc t + ZL c p b t l) \<Longrightarrow> ZL c p b (Suc (Suc t)) l = Z2 (steps c p (Suc (Suc t))) l * b ^ Suc (Suc t) + ZL c p b (Suc t) l
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ZL c p b (Suc 0) l = Z2 (steps c p (Suc 0)) l * b ^ Suc 0 + ZL c p b 0 l
[PROOF STEP]
by (auto simp: ZL.simps)
[PROOF STATE]
proof (state)
this:
ZL c p b (Suc 0) l = Z2 (steps c p (Suc 0)) l * b ^ Suc 0 + ZL c p b 0 l

goal (1 subgoal):
 1. \<And>t p c b. (\<And>p c b. ZL c p b (Suc t) l = Z2 (steps c p (Suc t)) l * b ^ Suc t + ZL c p b t l) \<Longrightarrow> ZL c p b (Suc (Suc t)) l = Z2 (steps c p (Suc (Suc t))) l * b ^ Suc (Suc t) + ZL c p b (Suc t) l
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>t p c b. (\<And>p c b. ZL c p b (Suc t) l = Z2 (steps c p (Suc t)) l * b ^ Suc t + ZL c p b t l) \<Longrightarrow> ZL c p b (Suc (Suc t)) l = Z2 (steps c p (Suc (Suc t))) l * b ^ Suc (Suc t) + ZL c p b (Suc t) l
[PROOF STEP]
case (Suc t p c b)
[PROOF STATE]
proof (state)
this:
ZL ?c ?p ?b (Suc t) l = Z2 (steps ?c ?p (Suc t)) l * ?b ^ Suc t + ZL ?c ?p ?b t l

goal (1 subgoal):
 1. \<And>t p c b. (\<And>p c b. ZL c p b (Suc t) l = Z2 (steps c p (Suc t)) l * b ^ Suc t + ZL c p b t l) \<Longrightarrow> ZL c p b (Suc (Suc t)) l = Z2 (steps c p (Suc (Suc t))) l * b ^ Suc (Suc t) + ZL c p b (Suc t) l
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ZL c p b (Suc (Suc t)) l = Z2 (steps c p (Suc (Suc t))) l * b ^ Suc (Suc t) + ZL c p b (Suc t) l
[PROOF STEP]
by (subst ZL.simps) (auto simp: Suc step_commutative algebra_simps ZL_simp_aux)
[PROOF STATE]
proof (state)
this:
ZL c p b (Suc (Suc t)) l = Z2 (steps c p (Suc (Suc t))) l * b ^ Suc (Suc t) + ZL c p b (Suc t) l

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma summable_zero_power [simp]: "summable (\<lambda>n. 0 ^ n :: 'a::{comm_ring_1,topological_space})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable ((^) (0::'a))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. summable ((^) (0::'a))
[PROOF STEP]
have "(\<lambda>n. 0 ^ n :: 'a) = (\<lambda>n. if n = 0 then 0^0 else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (^) (0::'a) = (\<lambda>n. if n = 0 then (0::'a) ^ 0 else (0::'a))
[PROOF STEP]
by (intro ext) (simp add: zero_power)
[PROOF STATE]
proof (state)
this:
(^) (0::'a) = (\<lambda>n. if n = 0 then (0::'a) ^ 0 else (0::'a))

goal (1 subgoal):
 1. summable ((^) (0::'a))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(^) (0::'a) = (\<lambda>n. if n = 0 then (0::'a) ^ 0 else (0::'a))

goal (1 subgoal):
 1. summable ((^) (0::'a))
[PROOF STEP]
have "summable \<dots>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. if n = 0 then (0::'a) ^ 0 else (0::'a))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. if n = 0 then (0::'a) ^ 0 else (0::'a))

goal (1 subgoal):
 1. summable ((^) (0::'a))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(^) (0::'a) = (\<lambda>n. if n = 0 then (0::'a) ^ 0 else (0::'a))
summable (\<lambda>n. if n = 0 then (0::'a) ^ 0 else (0::'a))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(^) (0::'a) = (\<lambda>n. if n = 0 then (0::'a) ^ 0 else (0::'a))
summable (\<lambda>n. if n = 0 then (0::'a) ^ 0 else (0::'a))

goal (1 subgoal):
 1. summable ((^) (0::'a))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
summable ((^) (0::'a))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma isometry_on_minus [simp]:
  "isometry_on A (\<lambda>(x::'a::real_normed_vector). -x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isometry_on A uminus
[PROOF STEP]
unfolding isometry_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>A. \<forall>y\<in>A. dist (- x) (- y) = dist x y
[PROOF STEP]
by (auto simp add: dist_minus)


[STATEMENT]
lemma cos_series: "(\<lambda>n. ((-1)^n / fact (2*n)) *\<^sub>R z^(2*n)) sums cos z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. ((- 1) ^ n / fact (2 * n)) *\<^sub>R z ^ (2 * n)) sums cos z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>n. ((- 1) ^ n / fact (2 * n)) *\<^sub>R z ^ (2 * n)) sums cos z
[PROOF STEP]
from cos_converges[of z]
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. cos_coeff n *\<^sub>R z ^ n) sums cos z
[PROOF STEP]
have "(\<lambda>n. cos_coeff n *\<^sub>R z^n) sums cos z"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. cos_coeff n *\<^sub>R z ^ n) sums cos z

goal (1 subgoal):
 1. (\<lambda>n. cos_coeff n *\<^sub>R z ^ n) sums cos z
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<lambda>n. cos_coeff n *\<^sub>R z ^ n) sums cos z

goal (1 subgoal):
 1. (\<lambda>n. ((- 1) ^ n / fact (2 * n)) *\<^sub>R z ^ (2 * n)) sums cos z
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>n. cos_coeff n *\<^sub>R z ^ n) sums cos z

goal (1 subgoal):
 1. (\<lambda>n. ((- 1) ^ n / fact (2 * n)) *\<^sub>R z ^ (2 * n)) sums cos z
[PROOF STEP]
have "(\<lambda>n. cos_coeff n *\<^sub>R z^n) sums cos z \<longleftrightarrow>
                 (\<lambda>n. ((-1)^n / fact (2*n)) *\<^sub>R z^(2*n)) sums cos z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. cos_coeff n *\<^sub>R z ^ n) sums cos z = (\<lambda>n. ((- 1) ^ n / fact (2 * n)) *\<^sub>R z ^ (2 * n)) sums cos z
[PROOF STEP]
by (subst sums_mono_reindex[of "\<lambda>n. 2*n", symmetric])
       (auto simp: cos_coeff_def strict_mono_def ac_simps elim!: evenE)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. cos_coeff n *\<^sub>R z ^ n) sums cos z = (\<lambda>n. ((- 1) ^ n / fact (2 * n)) *\<^sub>R z ^ (2 * n)) sums cos z

goal (1 subgoal):
 1. (\<lambda>n. ((- 1) ^ n / fact (2 * n)) *\<^sub>R z ^ (2 * n)) sums cos z
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. ((- 1) ^ n / fact (2 * n)) *\<^sub>R z ^ (2 * n)) sums cos z
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. ((- 1) ^ n / fact (2 * n)) *\<^sub>R z ^ (2 * n)) sums cos z

goal (1 subgoal):
 1. (\<lambda>n. ((- 1) ^ n / fact (2 * n)) *\<^sub>R z ^ (2 * n)) sums cos z
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<lambda>n. ((- 1) ^ n / fact (2 * n)) *\<^sub>R z ^ (2 * n)) sums cos z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in weak_upper_semilattice) weak_join_assoc:
  assumes L: "x \<in> carrier L"  "y \<in> carrier L"  "z \<in> carrier L"
  shows "(x \<squnion> y) \<squnion> z .= x \<squnion> (y \<squnion> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<squnion> y \<squnion> z .= x \<squnion> (y \<squnion> z)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<squnion> y \<squnion> z .= x \<squnion> (y \<squnion> z)
[PROOF STEP]
have "(x \<squnion> y) \<squnion> z = z \<squnion> (x \<squnion> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<squnion> y \<squnion> z = z \<squnion> (x \<squnion> y)
[PROOF STEP]
by (simp only: join_comm)
[PROOF STATE]
proof (state)
this:
x \<squnion> y \<squnion> z = z \<squnion> (x \<squnion> y)

goal (1 subgoal):
 1. x \<squnion> y \<squnion> z .= x \<squnion> (y \<squnion> z)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x \<squnion> y \<squnion> z = z \<squnion> (x \<squnion> y)

goal (1 subgoal):
 1. x \<squnion> y \<squnion> z .= x \<squnion> (y \<squnion> z)
[PROOF STEP]
from L
[PROOF STATE]
proof (chain)
picking this:
x \<in> carrier L
y \<in> carrier L
z \<in> carrier L
[PROOF STEP]
have "... .= \<Squnion>{z, x, y}"
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier L
y \<in> carrier L
z \<in> carrier L

goal (1 subgoal):
 1. z \<squnion> (x \<squnion> y) .= \<Squnion>{z, x, y}
[PROOF STEP]
by (simp add: weak_join_assoc_lemma)
[PROOF STATE]
proof (state)
this:
z \<squnion> (x \<squnion> y) .= \<Squnion>{z, x, y}

goal (1 subgoal):
 1. x \<squnion> y \<squnion> z .= x \<squnion> (y \<squnion> z)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
z \<squnion> (x \<squnion> y) .= \<Squnion>{z, x, y}

goal (1 subgoal):
 1. x \<squnion> y \<squnion> z .= x \<squnion> (y \<squnion> z)
[PROOF STEP]
from L
[PROOF STATE]
proof (chain)
picking this:
x \<in> carrier L
y \<in> carrier L
z \<in> carrier L
[PROOF STEP]
have "... = \<Squnion>{x, y, z}"
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier L
y \<in> carrier L
z \<in> carrier L

goal (1 subgoal):
 1. \<Squnion>{z, x, y} = \<Squnion>{x, y, z}
[PROOF STEP]
by (simp add: insert_commute)
[PROOF STATE]
proof (state)
this:
\<Squnion>{z, x, y} = \<Squnion>{x, y, z}

goal (1 subgoal):
 1. x \<squnion> y \<squnion> z .= x \<squnion> (y \<squnion> z)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<Squnion>{z, x, y} = \<Squnion>{x, y, z}

goal (1 subgoal):
 1. x \<squnion> y \<squnion> z .= x \<squnion> (y \<squnion> z)
[PROOF STEP]
from L
[PROOF STATE]
proof (chain)
picking this:
x \<in> carrier L
y \<in> carrier L
z \<in> carrier L
[PROOF STEP]
have "... .= x \<squnion> (y \<squnion> z)"
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier L
y \<in> carrier L
z \<in> carrier L

goal (1 subgoal):
 1. \<Squnion>{x, y, z} .= x \<squnion> (y \<squnion> z)
[PROOF STEP]
by (simp add: weak_join_assoc_lemma [symmetric])
[PROOF STATE]
proof (state)
this:
\<Squnion>{x, y, z} .= x \<squnion> (y \<squnion> z)

goal (1 subgoal):
 1. x \<squnion> y \<squnion> z .= x \<squnion> (y \<squnion> z)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>x \<squnion> y \<squnion> z \<in> carrier L; \<Squnion>{x, y, z} \<in> carrier L; x \<squnion> (y \<squnion> z) \<in> carrier L\<rbrakk> \<Longrightarrow> x \<squnion> y \<squnion> z .= x \<squnion> (y \<squnion> z)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x \<squnion> y \<squnion> z \<in> carrier L; \<Squnion>{x, y, z} \<in> carrier L; x \<squnion> (y \<squnion> z) \<in> carrier L\<rbrakk> \<Longrightarrow> x \<squnion> y \<squnion> z .= x \<squnion> (y \<squnion> z)

goal (1 subgoal):
 1. x \<squnion> y \<squnion> z .= x \<squnion> (y \<squnion> z)
[PROOF STEP]
by (simp add: L)
[PROOF STATE]
proof (state)
this:
x \<squnion> y \<squnion> z .= x \<squnion> (y \<squnion> z)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ln_add_one_self_less_self:
  fixes x :: real
  assumes "x > 0"
  shows "ln (1 + x) < x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ln (1 + x) < x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ln (1 + x) < x
[PROOF STEP]
have "0 \<le> x" "0 < x" "exp x > 0" "1+x > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 \<le> x &&& 0 < x) &&& 0 < exp x &&& 0 < 1 + x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < x

goal (1 subgoal):
 1. (0 \<le> x &&& 0 < x) &&& 0 < exp x &&& 0 < 1 + x
[PROOF STEP]
by simp+
[PROOF STATE]
proof (state)
this:
0 \<le> x
0 < x
0 < exp x
0 < 1 + x

goal (1 subgoal):
 1. ln (1 + x) < x
[PROOF STEP]
have "1 + x < 1 + x + x\<^sup>2 / 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 + x < 1 + x + x\<^sup>2 / 2
[PROOF STEP]
using \<open>0 < x\<close>
[PROOF STATE]
proof (prove)
using this:
0 < x

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

goal (1 subgoal):
 1. ln (1 + x) < x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 + x < 1 + x + x\<^sup>2 / 2

goal (1 subgoal):
 1. ln (1 + x) < x
[PROOF STEP]
have "\<dots> \<le> exp x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 + x + x\<^sup>2 / 2 \<le> exp x
[PROOF STEP]
using exp_lower_Taylor_quadratic[OF \<open>0 \<le> x\<close>]
[PROOF STATE]
proof (prove)
using this:
1 + x + x\<^sup>2 / 2 \<le> exp x

goal (1 subgoal):
 1. 1 + x + x\<^sup>2 / 2 \<le> exp x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
1 + x + x\<^sup>2 / 2 \<le> exp x

goal (1 subgoal):
 1. ln (1 + x) < x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
1 + x < exp x
[PROOF STEP]
have "1 + x < exp (x)"
[PROOF STATE]
proof (prove)
using this:
1 + x < exp x

goal (1 subgoal):
 1. 1 + x < exp x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
1 + x < exp x

goal (1 subgoal):
 1. ln (1 + x) < x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 + x < exp x
[PROOF STEP]
have "ln (1 + x) < ln (exp (x))"
[PROOF STATE]
proof (prove)
using this:
1 + x < exp x

goal (1 subgoal):
 1. ln (1 + x) < ln (exp x)
[PROOF STEP]
using ln_less_cancel_iff[OF \<open>1+x > 0\<close> \<open>exp(x) > 0\<close>]
[PROOF STATE]
proof (prove)
using this:
1 + x < exp x
(ln (1 + x) < ln (exp x)) = (1 + x < exp x)

goal (1 subgoal):
 1. ln (1 + x) < ln (exp x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ln (1 + x) < ln (exp x)

goal (1 subgoal):
 1. ln (1 + x) < x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ln (1 + x) < ln (exp x)

goal (1 subgoal):
 1. ln (1 + x) < x
[PROOF STEP]
have "\<dots> = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ln (exp x) = x
[PROOF STEP]
using ln_exp
[PROOF STATE]
proof (prove)
using this:
ln (exp ?x) = ?x

goal (1 subgoal):
 1. ln (exp x) = x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
ln (exp x) = x

goal (1 subgoal):
 1. ln (1 + x) < x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
ln (1 + x) < x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ln (1 + x) < x

goal (1 subgoal):
 1. ln (1 + x) < x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ln (1 + x) < x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma walras_law_in_compeq:
  assumes "\<And>i. i\<in>agents \<Longrightarrow> local_nonsatiation consumption_set Pr[i]"
  assumes "competitive_equilibrium P X Y"
  shows "P \<bullet> ((\<Sum>i\<in>agents. (X i)) - (\<Sum>i\<in>agents. \<E>[i]) - (\<Sum>j\<in>firms. Y j)) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P \<bullet> (sum X agents - sum \<E> agents - sum Y firms) = 0
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. P \<bullet> (sum X agents - sum \<E> agents - sum Y firms) = 0
[PROOF STEP]
have "P \<bullet> (\<Sum>i\<in>agents. (X i)) = P \<bullet> ((\<Sum>i\<in>agents. \<E>[i]) + (\<Sum>j\<in>firms. Y j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P \<bullet> sum X agents = P \<bullet> (sum \<E> agents + sum Y firms)
[PROOF STEP]
using assms(1) assms(2) walras_law
[PROOF STATE]
proof (prove)
using this:
?i \<in> agents \<Longrightarrow> local_nonsatiation consumption_set Pr[?i]
competitive_equilibrium P X Y
\<lbrakk>\<And>i. i \<in> agents \<Longrightarrow> local_nonsatiation consumption_set Pr[i]; \<forall>i\<in>agents. ?X i \<in> arg_max_set U[i] (budget_constraint ((\<bullet>) ?P) consumption_set (poe_wealth ?P i ?Y))\<rbrakk> \<Longrightarrow> ?P \<bullet> sum ?X agents = ?P \<bullet> (sum \<E> agents + sum ?Y firms)

goal (1 subgoal):
 1. P \<bullet> sum X agents = P \<bullet> (sum \<E> agents + sum Y firms)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
P \<bullet> sum X agents = P \<bullet> (sum \<E> agents + sum Y firms)

goal (1 subgoal):
 1. P \<bullet> (sum X agents - sum \<E> agents - sum Y firms) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
P \<bullet> sum X agents = P \<bullet> (sum \<E> agents + sum Y firms)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
P \<bullet> sum X agents = P \<bullet> (sum \<E> agents + sum Y firms)

goal (1 subgoal):
 1. P \<bullet> (sum X agents - sum \<E> agents - sum Y firms) = 0
[PROOF STEP]
by (simp add: inner_diff_right inner_right_distrib)
[PROOF STATE]
proof (state)
this:
P \<bullet> (sum X agents - sum \<E> agents - sum Y firms) = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem primorial'_primes_omega_le:
  fixes n :: nat
  assumes n: "n > 0"
  shows "primorial' (primes_omega n) \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. primorial' (primes_omega n) \<le> n
[PROOF STEP]
proof (cases "n = 1")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 1 \<Longrightarrow> primorial' (primes_omega n) \<le> n
 2. n \<noteq> 1 \<Longrightarrow> primorial' (primes_omega n) \<le> n
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
n = 1

goal (2 subgoals):
 1. n = 1 \<Longrightarrow> primorial' (primes_omega n) \<le> n
 2. n \<noteq> 1 \<Longrightarrow> primorial' (primes_omega n) \<le> n
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
n = 1

goal (1 subgoal):
 1. primorial' (primes_omega n) \<le> n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
primorial' (primes_omega n) \<le> n

goal (1 subgoal):
 1. n \<noteq> 1 \<Longrightarrow> primorial' (primes_omega n) \<le> n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n \<noteq> 1 \<Longrightarrow> primorial' (primes_omega n) \<le> n
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
n \<noteq> 1

goal (1 subgoal):
 1. n \<noteq> 1 \<Longrightarrow> primorial' (primes_omega n) \<le> n
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
0 < n
n \<noteq> 1
[PROOF STEP]
have "n > 1"
[PROOF STATE]
proof (prove)
using this:
0 < n
n \<noteq> 1

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

goal (1 subgoal):
 1. n \<noteq> 1 \<Longrightarrow> primorial' (primes_omega n) \<le> n
[PROOF STEP]
define m where "m = primes_omega n"
[PROOF STATE]
proof (state)
this:
m = primes_omega n

goal (1 subgoal):
 1. n \<noteq> 1 \<Longrightarrow> primorial' (primes_omega n) \<le> n
[PROOF STEP]
define P where "P = {p. prime p \<and> real p \<le> primes_pi n}"
[PROOF STATE]
proof (state)
this:
P = {p. prime p \<and> real p \<le> primes_pi (real n)}

goal (1 subgoal):
 1. n \<noteq> 1 \<Longrightarrow> primorial' (primes_omega n) \<le> n
[PROOF STEP]
define ps where "ps = sorted_list_of_set (prime_factors n)"
[PROOF STATE]
proof (state)
this:
ps = sorted_list_of_set (prime_factors n)

goal (1 subgoal):
 1. n \<noteq> 1 \<Longrightarrow> primorial' (primes_omega n) \<le> n
[PROOF STEP]
have set_ps: "set ps = prime_factors n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set ps = prime_factors n
[PROOF STEP]
by (simp add: ps_def)
[PROOF STATE]
proof (state)
this:
set ps = prime_factors n

goal (1 subgoal):
 1. n \<noteq> 1 \<Longrightarrow> primorial' (primes_omega n) \<le> n
[PROOF STEP]
have [simp]: "length ps = m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length ps = m
[PROOF STEP]
by (simp add: ps_def m_def primes_omega_def)
[PROOF STATE]
proof (state)
this:
length ps = m

goal (1 subgoal):
 1. n \<noteq> 1 \<Longrightarrow> primorial' (primes_omega n) \<le> n
[PROOF STEP]
have "sorted ps" "distinct ps"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted ps &&& distinct ps
[PROOF STEP]
by (simp_all add: ps_def)
[PROOF STATE]
proof (state)
this:
sorted ps
distinct ps

goal (1 subgoal):
 1. n \<noteq> 1 \<Longrightarrow> primorial' (primes_omega n) \<le> n
[PROOF STEP]
hence mono: "strict_mono_on {..<m} (\<lambda>k. ps ! k)"
[PROOF STATE]
proof (prove)
using this:
sorted ps
distinct ps

goal (1 subgoal):
 1. strict_mono_on {..<m} ((!) ps)
[PROOF STEP]
by (intro strict_mono_onI le_neq_trans) (auto simp: sorted_nth_mono distinct_conv_nth)
[PROOF STATE]
proof (state)
this:
strict_mono_on {..<m} ((!) ps)

goal (1 subgoal):
 1. n \<noteq> 1 \<Longrightarrow> primorial' (primes_omega n) \<le> n
[PROOF STEP]
from \<open>n > 1\<close>
[PROOF STATE]
proof (chain)
picking this:
1 < n
[PROOF STEP]
have "m > 0"
[PROOF STATE]
proof (prove)
using this:
1 < n

goal (1 subgoal):
 1. 0 < m
[PROOF STEP]
by (auto simp: m_def prime_factorization_empty_iff intro!: Nat.gr0I)
[PROOF STATE]
proof (state)
this:
0 < m

goal (1 subgoal):
 1. n \<noteq> 1 \<Longrightarrow> primorial' (primes_omega n) \<le> n
[PROOF STEP]
have "primorial' m = (\<Prod>k<m. nth_prime k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. primorial' m = prod nth_prime {..<m}
[PROOF STEP]
using \<open>m > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < m

goal (1 subgoal):
 1. primorial' m = prod nth_prime {..<m}
[PROOF STEP]
by (simp add: of_nat_diff primorial'_def m_def)
[PROOF STATE]
proof (state)
this:
primorial' m = prod nth_prime {..<m}

goal (1 subgoal):
 1. n \<noteq> 1 \<Longrightarrow> primorial' (primes_omega n) \<le> n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
primorial' m = prod nth_prime {..<m}

goal (1 subgoal):
 1. n \<noteq> 1 \<Longrightarrow> primorial' (primes_omega n) \<le> n
[PROOF STEP]
have "(\<Prod>k<m. nth_prime k) \<le> (\<Prod>k<m. ps ! k ^ multiplicity (ps ! k) n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod nth_prime {..<m} \<le> (\<Prod>k<m. ps ! k ^ multiplicity (ps ! k) n)
[PROOF STEP]
proof (intro prod_mono conjI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. i \<in> {..<m} \<Longrightarrow> 0 \<le> nth_prime i
 2. \<And>i. i \<in> {..<m} \<Longrightarrow> nth_prime i \<le> ps ! i ^ multiplicity (ps ! i) n
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. i \<in> {..<m} \<Longrightarrow> 0 \<le> nth_prime i
 2. \<And>i. i \<in> {..<m} \<Longrightarrow> nth_prime i \<le> ps ! i ^ multiplicity (ps ! i) n
[PROOF STEP]
assume i: "i \<in> {..<m}"
[PROOF STATE]
proof (state)
this:
i \<in> {..<m}

goal (2 subgoals):
 1. \<And>i. i \<in> {..<m} \<Longrightarrow> 0 \<le> nth_prime i
 2. \<And>i. i \<in> {..<m} \<Longrightarrow> nth_prime i \<le> ps ! i ^ multiplicity (ps ! i) n
[PROOF STEP]
hence p: "ps ! i \<in> prime_factors n"
[PROOF STATE]
proof (prove)
using this:
i \<in> {..<m}

goal (1 subgoal):
 1. ps ! i \<in># prime_factorization n
[PROOF STEP]
using set_ps
[PROOF STATE]
proof (prove)
using this:
i \<in> {..<m}
set ps = prime_factors n

goal (1 subgoal):
 1. ps ! i \<in># prime_factorization n
[PROOF STEP]
by (auto simp: set_conv_nth)
[PROOF STATE]
proof (state)
this:
ps ! i \<in># prime_factorization n

goal (2 subgoals):
 1. \<And>i. i \<in> {..<m} \<Longrightarrow> 0 \<le> nth_prime i
 2. \<And>i. i \<in> {..<m} \<Longrightarrow> nth_prime i \<le> ps ! i ^ multiplicity (ps ! i) n
[PROOF STEP]
with i set_ps
[PROOF STATE]
proof (chain)
picking this:
i \<in> {..<m}
set ps = prime_factors n
ps ! i \<in># prime_factorization n
[PROOF STEP]
have "nth_prime i \<le> ps ! i"
[PROOF STATE]
proof (prove)
using this:
i \<in> {..<m}
set ps = prime_factors n
ps ! i \<in># prime_factorization n

goal (1 subgoal):
 1. nth_prime i \<le> ps ! i
[PROOF STEP]
by (intro nth_prime_le_prime_sequence[where n = m] mono) (auto simp: set_conv_nth)
[PROOF STATE]
proof (state)
this:
nth_prime i \<le> ps ! i

goal (2 subgoals):
 1. \<And>i. i \<in> {..<m} \<Longrightarrow> 0 \<le> nth_prime i
 2. \<And>i. i \<in> {..<m} \<Longrightarrow> nth_prime i \<le> ps ! i ^ multiplicity (ps ! i) n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
nth_prime i \<le> ps ! i

goal (2 subgoals):
 1. \<And>i. i \<in> {..<m} \<Longrightarrow> 0 \<le> nth_prime i
 2. \<And>i. i \<in> {..<m} \<Longrightarrow> nth_prime i \<le> ps ! i ^ multiplicity (ps ! i) n
[PROOF STEP]
have "\<dots> \<le> ps ! i ^ multiplicity (ps ! i) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ps ! i \<le> ps ! i ^ multiplicity (ps ! i) n
[PROOF STEP]
using p
[PROOF STATE]
proof (prove)
using this:
ps ! i \<in># prime_factorization n

goal (1 subgoal):
 1. ps ! i \<le> ps ! i ^ multiplicity (ps ! i) n
[PROOF STEP]
by (intro self_le_power) (auto simp: prime_factors_multiplicity dest: prime_gt_1_nat)
[PROOF STATE]
proof (state)
this:
ps ! i \<le> ps ! i ^ multiplicity (ps ! i) n

goal (2 subgoals):
 1. \<And>i. i \<in> {..<m} \<Longrightarrow> 0 \<le> nth_prime i
 2. \<And>i. i \<in> {..<m} \<Longrightarrow> nth_prime i \<le> ps ! i ^ multiplicity (ps ! i) n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
nth_prime i \<le> ps ! i ^ multiplicity (ps ! i) n
[PROOF STEP]
show "nth_prime i \<le> \<dots>"
[PROOF STATE]
proof (prove)
using this:
nth_prime i \<le> ps ! i ^ multiplicity (ps ! i) n

goal (1 subgoal):
 1. nth_prime i \<le> ps ! i ^ multiplicity (ps ! i) n
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
nth_prime i \<le> ps ! i ^ multiplicity (ps ! i) n

goal (1 subgoal):
 1. \<And>i. i \<in> {..<m} \<Longrightarrow> 0 \<le> nth_prime i
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
prod nth_prime {..<m} \<le> (\<Prod>k<m. ps ! k ^ multiplicity (ps ! k) n)

goal (1 subgoal):
 1. n \<noteq> 1 \<Longrightarrow> primorial' (primes_omega n) \<le> n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
prod nth_prime {..<m} \<le> (\<Prod>k<m. ps ! k ^ multiplicity (ps ! k) n)

goal (1 subgoal):
 1. n \<noteq> 1 \<Longrightarrow> primorial' (primes_omega n) \<le> n
[PROOF STEP]
have "\<dots> = (\<Prod>p\<in>(\<lambda>i. ps ! i) ` {..<m}. p ^ multiplicity p n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>k<m. ps ! k ^ multiplicity (ps ! k) n) = (\<Prod>p\<in>(!) ps ` {..<m}. p ^ multiplicity p n)
[PROOF STEP]
using \<open>distinct ps\<close>
[PROOF STATE]
proof (prove)
using this:
distinct ps

goal (1 subgoal):
 1. (\<Prod>k<m. ps ! k ^ multiplicity (ps ! k) n) = (\<Prod>p\<in>(!) ps ` {..<m}. p ^ multiplicity p n)
[PROOF STEP]
by (subst prod.reindex) (auto intro!: inj_onI simp: distinct_conv_nth)
[PROOF STATE]
proof (state)
this:
(\<Prod>k<m. ps ! k ^ multiplicity (ps ! k) n) = (\<Prod>p\<in>(!) ps ` {..<m}. p ^ multiplicity p n)

goal (1 subgoal):
 1. n \<noteq> 1 \<Longrightarrow> primorial' (primes_omega n) \<le> n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Prod>k<m. ps ! k ^ multiplicity (ps ! k) n) = (\<Prod>p\<in>(!) ps ` {..<m}. p ^ multiplicity p n)

goal (1 subgoal):
 1. n \<noteq> 1 \<Longrightarrow> primorial' (primes_omega n) \<le> n
[PROOF STEP]
have "(\<lambda>i. ps ! i) ` {..<m} = set ps"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (!) ps ` {..<m} = set ps
[PROOF STEP]
by (auto simp: set_conv_nth)
[PROOF STATE]
proof (state)
this:
(!) ps ` {..<m} = set ps

goal (1 subgoal):
 1. n \<noteq> 1 \<Longrightarrow> primorial' (primes_omega n) \<le> n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(!) ps ` {..<m} = set ps

goal (1 subgoal):
 1. n \<noteq> 1 \<Longrightarrow> primorial' (primes_omega n) \<le> n
[PROOF STEP]
have "set ps = prime_factors n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set ps = prime_factors n
[PROOF STEP]
by (simp add: set_ps)
[PROOF STATE]
proof (state)
this:
set ps = prime_factors n

goal (1 subgoal):
 1. n \<noteq> 1 \<Longrightarrow> primorial' (primes_omega n) \<le> n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
set ps = prime_factors n

goal (1 subgoal):
 1. n \<noteq> 1 \<Longrightarrow> primorial' (primes_omega n) \<le> n
[PROOF STEP]
have "(\<Prod>p\<in>prime_factors n. p ^ multiplicity p n) = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>p\<in>prime_factors n. p ^ multiplicity p n) = n
[PROOF STEP]
using \<open>n > 1\<close>
[PROOF STATE]
proof (prove)
using this:
1 < n

goal (1 subgoal):
 1. (\<Prod>p\<in>prime_factors n. p ^ multiplicity p n) = n
[PROOF STEP]
by (intro prime_factorization_nat [symmetric]) auto
[PROOF STATE]
proof (state)
this:
(\<Prod>p\<in>prime_factors n. p ^ multiplicity p n) = n

goal (1 subgoal):
 1. n \<noteq> 1 \<Longrightarrow> primorial' (primes_omega n) \<le> n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
primorial' m \<le> n
[PROOF STEP]
show "primorial' m \<le> n"
[PROOF STATE]
proof (prove)
using this:
primorial' m \<le> n

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma map_list_nth: "\<And>n xs.
  \<lbrakk> n < length fs; n < length xs \<rbrakk> \<Longrightarrow>
  (map_list fs xs ! n) =
  (fs ! n) (xs ! n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n xs. \<lbrakk>n < length fs; n < length xs\<rbrakk> \<Longrightarrow> map_list fs xs ! n = (fs ! n) (xs ! n)
[PROOF STEP]
apply (induct fs, simp+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a fs n xs. \<lbrakk>\<And>n xs. \<lbrakk>n < length fs; n < length xs\<rbrakk> \<Longrightarrow> map_list fs xs ! n = (fs ! n) (xs ! n); n < Suc (length fs); n < length xs\<rbrakk> \<Longrightarrow> (a (hd xs) # map_list fs (tl xs)) ! n = ((a # fs) ! n) (xs ! n)
[PROOF STEP]
apply (case_tac n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a fs n xs. \<lbrakk>\<And>n xs. \<lbrakk>n < length fs; n < length xs\<rbrakk> \<Longrightarrow> map_list fs xs ! n = (fs ! n) (xs ! n); n < Suc (length fs); n < length xs; n = 0\<rbrakk> \<Longrightarrow> (a (hd xs) # map_list fs (tl xs)) ! n = ((a # fs) ! n) (xs ! n)
 2. \<And>a fs n xs nat. \<lbrakk>\<And>n xs. \<lbrakk>n < length fs; n < length xs\<rbrakk> \<Longrightarrow> map_list fs xs ! n = (fs ! n) (xs ! n); n < Suc (length fs); n < length xs; n = Suc nat\<rbrakk> \<Longrightarrow> (a (hd xs) # map_list fs (tl xs)) ! n = ((a # fs) ! n) (xs ! n)
[PROOF STEP]
apply (simp add: hd_conv_nth)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a fs n xs nat. \<lbrakk>\<And>n xs. \<lbrakk>n < length fs; n < length xs\<rbrakk> \<Longrightarrow> map_list fs xs ! n = (fs ! n) (xs ! n); n < Suc (length fs); n < length xs; n = Suc nat\<rbrakk> \<Longrightarrow> (a (hd xs) # map_list fs (tl xs)) ! n = ((a # fs) ! n) (xs ! n)
[PROOF STEP]
apply (simp add: nth_tl_eq_nth_Suc2)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma sum_inverses_conv_fraction:
  fixes f :: "'a \<Rightarrow> 'b :: field"
  assumes "\<And>x. x \<in> A \<Longrightarrow> f x \<noteq> 0" "finite A"
  shows "(\<Sum>x\<in>A. 1 / f x) = (\<Sum>x\<in>A. \<Prod>y\<in>A-{x}. f y) / (\<Prod>x\<in>A. f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>A. (1::'b) / f x) = (\<Sum>x\<in>A. prod f (A - {x})) / prod f A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>x\<in>A. (1::'b) / f x) = (\<Sum>x\<in>A. prod f (A - {x})) / prod f A
[PROOF STEP]
have "(\<Sum>x\<in>A. (\<Prod>y\<in>A. f y) / f x) = (\<Sum>x\<in>A. \<Prod>y\<in>A-{x}. f y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>A. prod f A / f x) = (\<Sum>x\<in>A. prod f (A - {x}))
[PROOF STEP]
using prod.remove[of A _ f] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite A; ?x \<in> A\<rbrakk> \<Longrightarrow> prod f A = f ?x * prod f (A - {?x})
?x \<in> A \<Longrightarrow> f ?x \<noteq> (0::'b)
finite A

goal (1 subgoal):
 1. (\<Sum>x\<in>A. prod f A / f x) = (\<Sum>x\<in>A. prod f (A - {x}))
[PROOF STEP]
by (intro sum.cong refl) (auto simp: field_simps)
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>A. prod f A / f x) = (\<Sum>x\<in>A. prod f (A - {x}))

goal (1 subgoal):
 1. (\<Sum>x\<in>A. (1::'b) / f x) = (\<Sum>x\<in>A. prod f (A - {x})) / prod f A
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>x\<in>A. prod f A / f x) = (\<Sum>x\<in>A. prod f (A - {x}))

goal (1 subgoal):
 1. (\<Sum>x\<in>A. (1::'b) / f x) = (\<Sum>x\<in>A. prod f (A - {x})) / prod f A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(\<Sum>x\<in>A. prod f A / f x) = (\<Sum>x\<in>A. prod f (A - {x}))
?x \<in> A \<Longrightarrow> f ?x \<noteq> (0::'b)
finite A

goal (1 subgoal):
 1. (\<Sum>x\<in>A. (1::'b) / f x) = (\<Sum>x\<in>A. prod f (A - {x})) / prod f A
[PROOF STEP]
by (simp add: field_simps sum_distrib_right sum_distrib_left)
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>A. (1::'b) / f x) = (\<Sum>x\<in>A. prod f (A - {x})) / prod f A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma scaleC_le_cancel_left_neg: "c < 0 \<Longrightarrow> c *\<^sub>C a \<le> c *\<^sub>C b \<longleftrightarrow> b \<le> a"
  for b :: "'a::ordered_complex_vector"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c < 0 \<Longrightarrow> (c *\<^sub>C a \<le> c *\<^sub>C b) = (b \<le> a)
[PROOF STEP]
by (simp add: complex_is_Real_iff less_complex_def scaleC_le_cancel_left)


[STATEMENT]
lemma fv_fo_fmla_list_Conj: "fv_fo_fmla_list (Conj \<phi> \<psi>) = fv_fo_fmla_list (Conj \<psi> \<phi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fv_fo_fmla_list (Conj \<phi> \<psi>) = fv_fo_fmla_list (Conj \<psi> \<phi>)
[PROOF STEP]
using fv_fo_fmla_list_eq[of "Conj \<phi> \<psi>" "Conj \<psi> \<phi>"]
[PROOF STATE]
proof (prove)
using this:
fv_fo_fmla (Conj \<phi> \<psi>) = fv_fo_fmla (Conj \<psi> \<phi>) \<Longrightarrow> fv_fo_fmla_list (Conj \<phi> \<psi>) = fv_fo_fmla_list (Conj \<psi> \<phi>)

goal (1 subgoal):
 1. fv_fo_fmla_list (Conj \<phi> \<psi>) = fv_fo_fmla_list (Conj \<psi> \<phi>)
[PROOF STEP]
by auto


[STATEMENT]
lemma vec_to_iarray_columns: "vec_to_iarray` (columns A) = columns_iarray (matrix_to_iarray A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_to_iarray ` columns A = columns_iarray (matrix_to_iarray A)
[PROOF STEP]
unfolding columns_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_to_iarray ` {column i A |i. i \<in> UNIV} = columns_iarray (matrix_to_iarray A)
[PROOF STEP]
unfolding columns_iarray_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_to_iarray ` {column i A |i. i \<in> UNIV} = {column_iarray i (matrix_to_iarray A) |i. i \<in> {..<ncols_iarray (matrix_to_iarray A)}}
[PROOF STEP]
apply(auto simp add: ncols_eq_card_columns to_nat_less_card vec_to_iarray_column)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i < CARD('c) \<Longrightarrow> column_iarray i (matrix_to_iarray A) \<in> vec_to_iarray ` {uu_. \<exists>i. uu_ = column i A}
[PROOF STEP]
by (unfold image_def, auto, metis from_nat_not_eq vec_to_iarray_column)


[STATEMENT]
lemma shiftl_ge_0: fixes i :: int shows "push_bit n i \<ge> 0 \<longleftrightarrow> i \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 \<le> push_bit n i) = (0 \<le> i)
[PROOF STEP]
by (fact push_bit_nonnegative_int_iff)


[STATEMENT]
lemma bigo_sum4: "f =o g +o O(h) \<Longrightarrow>
    (\<lambda>x. \<Sum>y \<in> A x. l x y * f(k x y)) =o
      (\<lambda>x. \<Sum>y \<in> A x. l x y * g(k x y)) +o
        O(\<lambda>x. \<Sum>y \<in> A x. \<bar>l x y * h(k x y)\<bar>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> g +o O(h) \<Longrightarrow> (\<lambda>x. \<Sum>y\<in>A x. l x y * f (k x y)) \<in> (\<lambda>x. \<Sum>y\<in>A x. l x y * g (k x y)) +o O(\<lambda>x. \<Sum>y\<in>A x. \<bar>l x y * h (k x y)\<bar>)
[PROOF STEP]
apply (rule set_minus_imp_plus)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> g +o O(h) \<Longrightarrow> (\<lambda>x. \<Sum>y\<in>A x. l x y * f (k x y)) - (\<lambda>x. \<Sum>y\<in>A x. l x y * g (k x y)) \<in> O(\<lambda>x. \<Sum>y\<in>A x. \<bar>l x y * h (k x y)\<bar>)
[PROOF STEP]
apply (subst fun_diff_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> g +o O(h) \<Longrightarrow> (\<lambda>x. (\<Sum>y\<in>A x. l x y * f (k x y)) - (\<Sum>y\<in>A x. l x y * g (k x y))) \<in> O(\<lambda>x. \<Sum>y\<in>A x. \<bar>l x y * h (k x y)\<bar>)
[PROOF STEP]
apply (subst sum_subtractf [symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> g +o O(h) \<Longrightarrow> (\<lambda>x. \<Sum>xa\<in>A x. l x xa * f (k x xa) - l x xa * g (k x xa)) \<in> O(\<lambda>x. \<Sum>y\<in>A x. \<bar>l x y * h (k x y)\<bar>)
[PROOF STEP]
apply (subst right_diff_distrib [symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> g +o O(h) \<Longrightarrow> (\<lambda>x. \<Sum>xa\<in>A x. l x xa * (f (k x xa) - g (k x xa))) \<in> O(\<lambda>x. \<Sum>y\<in>A x. \<bar>l x y * h (k x y)\<bar>)
[PROOF STEP]
apply (rule bigo_sum3)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> g +o O(h) \<Longrightarrow> (\<lambda>a. f a - g a) \<in> O(h)
[PROOF STEP]
by (metis (lifting, no_types) fun_diff_def set_plus_imp_minus ext)


[STATEMENT]
lemma lim14: "((\<lambda>x::real. 3 * x / (1 + 3 * x\<^sup>2)) \<longlongrightarrow> 0) at_infinity"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. 3 * x / (1 + 3 * x\<^sup>2)) \<longlongrightarrow> 0) at_infinity
[PROOF STEP]
apply (rule tendsto_0_le [where f = inverse and K=1])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (inverse \<longlongrightarrow> 0) at_infinity
 2. \<forall>\<^sub>F x in at_infinity. norm (3 * x / (1 + 3 * x\<^sup>2)) \<le> norm (inverse x) * 1
[PROOF STEP]
apply (metis tendsto_inverse_0)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_infinity. norm (3 * x / (1 + 3 * x\<^sup>2)) \<le> norm (inverse x) * 1
[PROOF STEP]
apply (simp add: eventually_at_infinity)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>b. \<forall>x. b \<le> \<bar>x\<bar> \<longrightarrow> \<bar>3 * x\<bar> / (1 + 3 * x\<^sup>2) \<le> inverse \<bar>x\<bar>
[PROOF STEP]
apply (rule_tac x=1 in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. 1 \<le> \<bar>x\<bar> \<longrightarrow> \<bar>3 * x\<bar> / (1 + 3 * x\<^sup>2) \<le> inverse \<bar>x\<bar>
[PROOF STEP]
apply (simp add: power_eq_if abs_if divide_simps add_sign_intros)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma degree_smult_eq_iff:
  "degree (smult a p) = degree p \<longleftrightarrow> degree p = 0 \<or> a * lead_coeff p \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (degree (Polynomial.smult a p) = degree p) = (degree p = 0 \<or> a * lead_coeff p \<noteq> (0::'a))
[PROOF STEP]
by (metis (no_types, lifting) coeff_smult degree_0 degree_smult_le le_antisym
      le_degree le_zero_eq leading_coeff_0_iff)


[STATEMENT]
lemma trace_square_less_square_trace:
  fixes B ::  "complex mat"
  assumes dimB: "B \<in> carrier_mat n n"
      and dB: "diagonal_mat B" and pB: "\<And>i. i < n \<Longrightarrow> B$$(i, i) \<ge> 0"
    shows "trace (B*B) \<le> (trace B)\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trace (B * B) \<le> (trace B)\<^sup>2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. trace (B * B) \<le> (trace B)\<^sup>2
[PROOF STEP]
have tB:  "trace B = (\<Sum> i \<in> {0 ..<n}. B $$ (i,i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trace B = (\<Sum>i = 0..<n. B $$ (i, i))
[PROOF STEP]
using assms trace_def[of B] carrier_mat_def
[PROOF STATE]
proof (prove)
using this:
B \<in> carrier_mat n n
diagonal_mat B
?i < n \<Longrightarrow> 0 \<le> B $$ (?i, ?i)
trace B = (\<Sum>i = 0..<dim_row B. B $$ (i, i))
carrier_mat ?nr ?nc = {m. dim_row m = ?nr \<and> dim_col m = ?nc}

goal (1 subgoal):
 1. trace B = (\<Sum>i = 0..<n. B $$ (i, i))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
trace B = (\<Sum>i = 0..<n. B $$ (i, i))

goal (1 subgoal):
 1. trace (B * B) \<le> (trace B)\<^sup>2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
trace B = (\<Sum>i = 0..<n. B $$ (i, i))
[PROOF STEP]
have tBtB: "(trace B)\<^sup>2 = (\<Sum> i \<in> {0 ..<n}.\<Sum> j \<in> {0 ..<n}. B $$ (i,i)*B $$ (j,j))"
[PROOF STATE]
proof (prove)
using this:
trace B = (\<Sum>i = 0..<n. B $$ (i, i))

goal (1 subgoal):
 1. (trace B)\<^sup>2 = (\<Sum>i = 0..<n. \<Sum>j = 0..<n. B $$ (i, i) * B $$ (j, j))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. trace B = (\<Sum>i = 0..<n. B $$ (i, i)) \<Longrightarrow> (trace B)\<^sup>2 = (\<Sum>i = 0..<n. \<Sum>j = 0..<n. B $$ (i, i) * B $$ (j, j))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (trace B)\<^sup>2 = (\<Sum>i = 0..<n. \<Sum>j = 0..<n. B $$ (i, i) * B $$ (j, j))
[PROOF STEP]
by (metis (no_types) semiring_normalization_rules(29) sum_product tB)
[PROOF STATE]
proof (state)
this:
(trace B)\<^sup>2 = (\<Sum>i = 0..<n. \<Sum>j = 0..<n. B $$ (i, i) * B $$ (j, j))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(trace B)\<^sup>2 = (\<Sum>i = 0..<n. \<Sum>j = 0..<n. B $$ (i, i) * B $$ (j, j))

goal (1 subgoal):
 1. trace (B * B) \<le> (trace B)\<^sup>2
[PROOF STEP]
have BB: "\<And>i. i < n \<Longrightarrow> (B*B) $$ (i,i) = (B$$(i, i))\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i < n \<Longrightarrow> (B * B) $$ (i, i) = (B $$ (i, i))\<^sup>2
[PROOF STEP]
using diag_mat_mul_diag_ele[of B n B] dimB dB
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>B \<in> carrier_mat n n; B \<in> carrier_mat n n; diagonal_mat B; diagonal_mat B\<rbrakk> \<Longrightarrow> \<forall>i<n. (B * B) $$ (i, i) = B $$ (i, i) * B $$ (i, i)
B \<in> carrier_mat n n
diagonal_mat B

goal (1 subgoal):
 1. \<And>i. i < n \<Longrightarrow> (B * B) $$ (i, i) = (B $$ (i, i))\<^sup>2
[PROOF STEP]
by (metis numeral_1_eq_Suc_0 power_Suc0_right power_add_numeral semiring_norm(2))
[PROOF STATE]
proof (state)
this:
?i < n \<Longrightarrow> (B * B) $$ (?i, ?i) = (B $$ (?i, ?i))\<^sup>2

goal (1 subgoal):
 1. trace (B * B) \<le> (trace B)\<^sup>2
[PROOF STEP]
have tBB:  "trace (B*B) = (\<Sum> i \<in> {0 ..<n}. (B*B) $$ (i,i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trace (B * B) = (\<Sum>i = 0..<n. (B * B) $$ (i, i))
[PROOF STEP]
using assms trace_def[of "B*B"] carrier_mat_def
[PROOF STATE]
proof (prove)
using this:
B \<in> carrier_mat n n
diagonal_mat B
?i < n \<Longrightarrow> 0 \<le> B $$ (?i, ?i)
trace (B * B) = (\<Sum>i = 0..<dim_row (B * B). (B * B) $$ (i, i))
carrier_mat ?nr ?nc = {m. dim_row m = ?nr \<and> dim_col m = ?nc}

goal (1 subgoal):
 1. trace (B * B) = (\<Sum>i = 0..<n. (B * B) $$ (i, i))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
trace (B * B) = (\<Sum>i = 0..<n. (B * B) $$ (i, i))

goal (1 subgoal):
 1. trace (B * B) \<le> (trace B)\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
trace (B * B) = (\<Sum>i = 0..<n. (B * B) $$ (i, i))

goal (1 subgoal):
 1. trace (B * B) \<le> (trace B)\<^sup>2
[PROOF STEP]
have "\<dots> =  (\<Sum> i \<in> {0 ..<n}. (B$$(i, i))\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<n. (B * B) $$ (i, i)) = (\<Sum>i = 0..<n. (B $$ (i, i))\<^sup>2)
[PROOF STEP]
using BB
[PROOF STATE]
proof (prove)
using this:
?i < n \<Longrightarrow> (B * B) $$ (?i, ?i) = (B $$ (?i, ?i))\<^sup>2

goal (1 subgoal):
 1. (\<Sum>i = 0..<n. (B * B) $$ (i, i)) = (\<Sum>i = 0..<n. (B $$ (i, i))\<^sup>2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<n. (B * B) $$ (i, i)) = (\<Sum>i = 0..<n. (B $$ (i, i))\<^sup>2)

goal (1 subgoal):
 1. trace (B * B) \<le> (trace B)\<^sup>2
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
trace (B * B) = (\<Sum>i = 0..<n. (B $$ (i, i))\<^sup>2)
[PROOF STEP]
have BBt: " trace (B * B) = (\<Sum>i = 0..<n. (B $$ (i, i))\<^sup>2)"
[PROOF STATE]
proof (prove)
using this:
trace (B * B) = (\<Sum>i = 0..<n. (B $$ (i, i))\<^sup>2)

goal (1 subgoal):
 1. trace (B * B) = (\<Sum>i = 0..<n. (B $$ (i, i))\<^sup>2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
trace (B * B) = (\<Sum>i = 0..<n. (B $$ (i, i))\<^sup>2)

goal (1 subgoal):
 1. trace (B * B) \<le> (trace B)\<^sup>2
[PROOF STEP]
have lesseq: "\<forall>i \<in> {0 ..<n}. (B $$ (i, i))\<^sup>2 \<le> (\<Sum> j \<in> {0 ..<n}. B $$ (i,i)*B $$ (j,j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i\<in>{0..<n}. (B $$ (i, i))\<^sup>2 \<le> (\<Sum>j = 0..<n. B $$ (i, i) * B $$ (j, j))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>i\<in>{0..<n}. (B $$ (i, i))\<^sup>2 \<le> (\<Sum>j = 0..<n. B $$ (i, i) * B $$ (j, j))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>i\<in>{0..<n}. (B $$ (i, i))\<^sup>2 \<le> (\<Sum>j = 0..<n. B $$ (i, i) * B $$ (j, j))
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>i\<in>{0..<n}. (B $$ (i, i))\<^sup>2 \<le> (\<Sum>j = 0..<n. B $$ (i, i) * B $$ (j, j))
[PROOF STEP]
assume i: "i < n"
[PROOF STATE]
proof (state)
this:
i < n

goal (1 subgoal):
 1. \<forall>i\<in>{0..<n}. (B $$ (i, i))\<^sup>2 \<le> (\<Sum>j = 0..<n. B $$ (i, i) * B $$ (j, j))
[PROOF STEP]
have "(\<Sum>j = 0..<n. B $$ (i, i) * B $$ (j, j)) = (B $$ (i, i))\<^sup>2  + sum (\<lambda> j. (B $$ (i, i) * B $$ (j, j))) ({0 ..<n} - {i})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j = 0..<n. B $$ (i, i) * B $$ (j, j)) = (B $$ (i, i))\<^sup>2 + (\<Sum>j\<in>{0..<n} - {i}. B $$ (i, i) * B $$ (j, j))
[PROOF STEP]
by (metis (no_types, lifting) BB atLeastLessThan_iff dB diag_mat_mul_diag_ele dimB finite_atLeastLessThan i not_le not_less_zero sum.remove)
[PROOF STATE]
proof (state)
this:
(\<Sum>j = 0..<n. B $$ (i, i) * B $$ (j, j)) = (B $$ (i, i))\<^sup>2 + (\<Sum>j\<in>{0..<n} - {i}. B $$ (i, i) * B $$ (j, j))

goal (1 subgoal):
 1. \<forall>i\<in>{0..<n}. (B $$ (i, i))\<^sup>2 \<le> (\<Sum>j = 0..<n. B $$ (i, i) * B $$ (j, j))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<Sum>j = 0..<n. B $$ (i, i) * B $$ (j, j)) = (B $$ (i, i))\<^sup>2 + (\<Sum>j\<in>{0..<n} - {i}. B $$ (i, i) * B $$ (j, j))

goal (1 subgoal):
 1. \<forall>i\<in>{0..<n}. (B $$ (i, i))\<^sup>2 \<le> (\<Sum>j = 0..<n. B $$ (i, i) * B $$ (j, j))
[PROOF STEP]
have "(sum (\<lambda> j. (B $$ (i, i) * B $$ (j, j))) ({0 ..<n} - {i})) \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> (\<Sum>j\<in>{0..<n} - {i}. B $$ (i, i) * B $$ (j, j))
[PROOF STEP]
proof (cases "{0..<n} - {i} \<noteq> {}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {0..<n} - {i} \<noteq> {} \<Longrightarrow> 0 \<le> (\<Sum>j\<in>{0..<n} - {i}. B $$ (i, i) * B $$ (j, j))
 2. \<not> {0..<n} - {i} \<noteq> {} \<Longrightarrow> 0 \<le> (\<Sum>j\<in>{0..<n} - {i}. B $$ (i, i) * B $$ (j, j))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
{0..<n} - {i} \<noteq> {}

goal (2 subgoals):
 1. {0..<n} - {i} \<noteq> {} \<Longrightarrow> 0 \<le> (\<Sum>j\<in>{0..<n} - {i}. B $$ (i, i) * B $$ (j, j))
 2. \<not> {0..<n} - {i} \<noteq> {} \<Longrightarrow> 0 \<le> (\<Sum>j\<in>{0..<n} - {i}. B $$ (i, i) * B $$ (j, j))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{0..<n} - {i} \<noteq> {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
{0..<n} - {i} \<noteq> {}

goal (1 subgoal):
 1. 0 \<le> (\<Sum>j\<in>{0..<n} - {i}. B $$ (i, i) * B $$ (j, j))
[PROOF STEP]
using pB i sum_nonneg[of "{0..<n} - {i}" "\<lambda> j. (B $$ (i, i) * B $$ (j, j))"]
[PROOF STATE]
proof (prove)
using this:
{0..<n} - {i} \<noteq> {}
?i < n \<Longrightarrow> 0 \<le> B $$ (?i, ?i)
i < n
(\<And>x. x \<in> {0..<n} - {i} \<Longrightarrow> 0 \<le> B $$ (i, i) * B $$ (x, x)) \<Longrightarrow> 0 \<le> (\<Sum>j\<in>{0..<n} - {i}. B $$ (i, i) * B $$ (j, j))

goal (1 subgoal):
 1. 0 \<le> (\<Sum>j\<in>{0..<n} - {i}. B $$ (i, i) * B $$ (j, j))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> (\<Sum>j\<in>{0..<n} - {i}. B $$ (i, i) * B $$ (j, j))

goal (1 subgoal):
 1. \<not> {0..<n} - {i} \<noteq> {} \<Longrightarrow> 0 \<le> (\<Sum>j\<in>{0..<n} - {i}. B $$ (i, i) * B $$ (j, j))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> {0..<n} - {i} \<noteq> {} \<Longrightarrow> 0 \<le> (\<Sum>j\<in>{0..<n} - {i}. B $$ (i, i) * B $$ (j, j))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> {0..<n} - {i} \<noteq> {}

goal (1 subgoal):
 1. \<not> {0..<n} - {i} \<noteq> {} \<Longrightarrow> 0 \<le> (\<Sum>j\<in>{0..<n} - {i}. B $$ (i, i) * B $$ (j, j))
[PROOF STEP]
have "(\<Sum>j\<in>{0..<n} - {i}. B $$ (i, i) * B $$ (j, j)) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j\<in>{0..<n} - {i}. B $$ (i, i) * B $$ (j, j)) = 0
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
\<not> {0..<n} - {i} \<noteq> {}

goal (1 subgoal):
 1. (\<Sum>j\<in>{0..<n} - {i}. B $$ (i, i) * B $$ (j, j)) = 0
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(\<Sum>j\<in>{0..<n} - {i}. B $$ (i, i) * B $$ (j, j)) = 0

goal (1 subgoal):
 1. \<not> {0..<n} - {i} \<noteq> {} \<Longrightarrow> 0 \<le> (\<Sum>j\<in>{0..<n} - {i}. B $$ (i, i) * B $$ (j, j))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>j\<in>{0..<n} - {i}. B $$ (i, i) * B $$ (j, j)) = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>j\<in>{0..<n} - {i}. B $$ (i, i) * B $$ (j, j)) = 0

goal (1 subgoal):
 1. 0 \<le> (\<Sum>j\<in>{0..<n} - {i}. B $$ (i, i) * B $$ (j, j))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> (\<Sum>j\<in>{0..<n} - {i}. B $$ (i, i) * B $$ (j, j))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 \<le> (\<Sum>j\<in>{0..<n} - {i}. B $$ (i, i) * B $$ (j, j))

goal (1 subgoal):
 1. \<forall>i\<in>{0..<n}. (B $$ (i, i))\<^sup>2 \<le> (\<Sum>j = 0..<n. B $$ (i, i) * B $$ (j, j))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>j = 0..<n. B $$ (i, i) * B $$ (j, j)) = (B $$ (i, i))\<^sup>2 + (\<Sum>j\<in>{0..<n} - {i}. B $$ (i, i) * B $$ (j, j))
0 \<le> (\<Sum>j\<in>{0..<n} - {i}. B $$ (i, i) * B $$ (j, j))
[PROOF STEP]
have "(\<Sum>j = 0..<n. B $$ (i, i) * B $$ (j, j)) \<ge> (B $$ (i, i))\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>j = 0..<n. B $$ (i, i) * B $$ (j, j)) = (B $$ (i, i))\<^sup>2 + (\<Sum>j\<in>{0..<n} - {i}. B $$ (i, i) * B $$ (j, j))
0 \<le> (\<Sum>j\<in>{0..<n} - {i}. B $$ (i, i) * B $$ (j, j))

goal (1 subgoal):
 1. (B $$ (i, i))\<^sup>2 \<le> (\<Sum>j = 0..<n. B $$ (i, i) * B $$ (j, j))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(B $$ (i, i))\<^sup>2 \<le> (\<Sum>j = 0..<n. B $$ (i, i) * B $$ (j, j))

goal (1 subgoal):
 1. \<forall>i\<in>{0..<n}. (B $$ (i, i))\<^sup>2 \<le> (\<Sum>j = 0..<n. B $$ (i, i) * B $$ (j, j))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?i2 < n \<Longrightarrow> (B $$ (?i2, ?i2))\<^sup>2 \<le> (\<Sum>j = 0..<n. B $$ (?i2, ?i2) * B $$ (j, j))

goal (1 subgoal):
 1. \<forall>i\<in>{0..<n}. (B $$ (i, i))\<^sup>2 \<le> (\<Sum>j = 0..<n. B $$ (i, i) * B $$ (j, j))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?i2 < n \<Longrightarrow> (B $$ (?i2, ?i2))\<^sup>2 \<le> (\<Sum>j = 0..<n. B $$ (?i2, ?i2) * B $$ (j, j))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
?i2 < n \<Longrightarrow> (B $$ (?i2, ?i2))\<^sup>2 \<le> (\<Sum>j = 0..<n. B $$ (?i2, ?i2) * B $$ (j, j))

goal (1 subgoal):
 1. \<forall>i\<in>{0..<n}. (B $$ (i, i))\<^sup>2 \<le> (\<Sum>j = 0..<n. B $$ (i, i) * B $$ (j, j))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>i\<in>{0..<n}. (B $$ (i, i))\<^sup>2 \<le> (\<Sum>j = 0..<n. B $$ (i, i) * B $$ (j, j))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>i\<in>{0..<n}. (B $$ (i, i))\<^sup>2 \<le> (\<Sum>j = 0..<n. B $$ (i, i) * B $$ (j, j))

goal (1 subgoal):
 1. trace (B * B) \<le> (trace B)\<^sup>2
[PROOF STEP]
from tBtB BBt lesseq
[PROOF STATE]
proof (chain)
picking this:
(trace B)\<^sup>2 = (\<Sum>i = 0..<n. \<Sum>j = 0..<n. B $$ (i, i) * B $$ (j, j))
trace (B * B) = (\<Sum>i = 0..<n. (B $$ (i, i))\<^sup>2)
\<forall>i\<in>{0..<n}. (B $$ (i, i))\<^sup>2 \<le> (\<Sum>j = 0..<n. B $$ (i, i) * B $$ (j, j))
[PROOF STEP]
have "trace (B*B) \<le> (trace B)\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
(trace B)\<^sup>2 = (\<Sum>i = 0..<n. \<Sum>j = 0..<n. B $$ (i, i) * B $$ (j, j))
trace (B * B) = (\<Sum>i = 0..<n. (B $$ (i, i))\<^sup>2)
\<forall>i\<in>{0..<n}. (B $$ (i, i))\<^sup>2 \<le> (\<Sum>j = 0..<n. B $$ (i, i) * B $$ (j, j))

goal (1 subgoal):
 1. trace (B * B) \<le> (trace B)\<^sup>2
[PROOF STEP]
using sum_mono[of "{0..<n}" "\<lambda> i. (B $$ (i, i))\<^sup>2" "\<lambda> i. (\<Sum>j = 0..<n. B $$ (i, i) * B $$ (j, j))"]
[PROOF STATE]
proof (prove)
using this:
(trace B)\<^sup>2 = (\<Sum>i = 0..<n. \<Sum>j = 0..<n. B $$ (i, i) * B $$ (j, j))
trace (B * B) = (\<Sum>i = 0..<n. (B $$ (i, i))\<^sup>2)
\<forall>i\<in>{0..<n}. (B $$ (i, i))\<^sup>2 \<le> (\<Sum>j = 0..<n. B $$ (i, i) * B $$ (j, j))
(\<And>i. i \<in> {0..<n} \<Longrightarrow> (B $$ (i, i))\<^sup>2 \<le> (\<Sum>j = 0..<n. B $$ (i, i) * B $$ (j, j))) \<Longrightarrow> (\<Sum>i = 0..<n. (B $$ (i, i))\<^sup>2) \<le> (\<Sum>i = 0..<n. \<Sum>j = 0..<n. B $$ (i, i) * B $$ (j, j))

goal (1 subgoal):
 1. trace (B * B) \<le> (trace B)\<^sup>2
[PROOF STEP]
by (metis (no_types, lifting))
[PROOF STATE]
proof (state)
this:
trace (B * B) \<le> (trace B)\<^sup>2

goal (1 subgoal):
 1. trace (B * B) \<le> (trace B)\<^sup>2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
trace (B * B) \<le> (trace B)\<^sup>2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
trace (B * B) \<le> (trace B)\<^sup>2

goal (1 subgoal):
 1. trace (B * B) \<le> (trace B)\<^sup>2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
trace (B * B) \<le> (trace B)\<^sup>2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma blaschke_real_preserve_sgn_arg [simp]:
  assumes "is_real a" and "cmod a < 1" and "z \<notin> circline_set x_axis"
  shows "sgn (Arg (to_complex (moebius_pt (blaschke a) z))) = sgn (Arg (to_complex z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sgn (Arg (to_complex (moebius_pt (blaschke a) z))) = sgn (Arg (to_complex z))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sgn (Arg (to_complex (moebius_pt (blaschke a) z))) = sgn (Arg (to_complex z))
[PROOF STEP]
have "z \<noteq> \<infinity>\<^sub>h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<noteq> \<infinity>\<^sub>h
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_real a
cmod a < 1
z \<notin> circline_set x_axis

goal (1 subgoal):
 1. z \<noteq> \<infinity>\<^sub>h
[PROOF STEP]
using special_points_on_x_axis''(3)
[PROOF STATE]
proof (prove)
using this:
is_real a
cmod a < 1
z \<notin> circline_set x_axis
\<infinity>\<^sub>h \<in> circline_set x_axis

goal (1 subgoal):
 1. z \<noteq> \<infinity>\<^sub>h
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
z \<noteq> \<infinity>\<^sub>h

goal (1 subgoal):
 1. sgn (Arg (to_complex (moebius_pt (blaschke a) z))) = sgn (Arg (to_complex z))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
z \<noteq> \<infinity>\<^sub>h

goal (1 subgoal):
 1. sgn (Arg (to_complex (moebius_pt (blaschke a) z))) = sgn (Arg (to_complex z))
[PROOF STEP]
have "z \<noteq> inversion (of_complex a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<noteq> inversion (of_complex a)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_real a
cmod a < 1
z \<notin> circline_set x_axis

goal (1 subgoal):
 1. z \<noteq> inversion (of_complex a)
[PROOF STEP]
by (metis calculation circline_equation_x_axis circline_set_x_axis_I conjugate_of_complex inversion_of_complex inversion_sym is_real_inversion o_apply of_complex_zero reciprocal_zero to_complex_of_complex)
[PROOF STATE]
proof (state)
this:
z \<noteq> inversion (of_complex a)

goal (1 subgoal):
 1. sgn (Arg (to_complex (moebius_pt (blaschke a) z))) = sgn (Arg (to_complex z))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
z \<noteq> \<infinity>\<^sub>h
z \<noteq> inversion (of_complex a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
z \<noteq> \<infinity>\<^sub>h
z \<noteq> inversion (of_complex a)

goal (1 subgoal):
 1. sgn (Arg (to_complex (moebius_pt (blaschke a) z))) = sgn (Arg (to_complex z))
[PROOF STEP]
using blaschke_real_preserve_sgn_Im[OF assms(1) assms(2), of z]
[PROOF STATE]
proof (prove)
using this:
z \<noteq> \<infinity>\<^sub>h
z \<noteq> inversion (of_complex a)
\<lbrakk>z \<noteq> \<infinity>\<^sub>h; z \<noteq> inversion (of_complex a)\<rbrakk> \<Longrightarrow> sgn (Im (to_complex (moebius_pt (blaschke a) z))) = sgn (Im (to_complex z))

goal (1 subgoal):
 1. sgn (Arg (to_complex (moebius_pt (blaschke a) z))) = sgn (Arg (to_complex z))
[PROOF STEP]
by (smt arg_Im_sgn assms(3) circline_set_x_axis_I norm_sgn of_complex_to_complex)
[PROOF STATE]
proof (state)
this:
sgn (Arg (to_complex (moebius_pt (blaschke a) z))) = sgn (Arg (to_complex z))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_even[simp]: "card {a \<in> Collect even. a < 2 * n} = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {a \<in> Collect even. a < 2 * n} = n
[PROOF STEP]
proof (induction n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. card {a \<in> Collect even. a < 2 * 0} = 0
 2. \<And>n. card {a \<in> Collect even. a < 2 * n} = n \<Longrightarrow> card {a \<in> Collect even. a < 2 * Suc n} = Suc n
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. card {a \<in> Collect even. a < 2 * 0} = 0
 2. \<And>n. card {a \<in> Collect even. a < 2 * n} = n \<Longrightarrow> card {a \<in> Collect even. a < 2 * Suc n} = Suc n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {a \<in> Collect even. a < 2 * 0} = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card {a \<in> Collect even. a < 2 * 0} = 0

goal (1 subgoal):
 1. \<And>n. card {a \<in> Collect even. a < 2 * n} = n \<Longrightarrow> card {a \<in> Collect even. a < 2 * Suc n} = Suc n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. card {a \<in> Collect even. a < 2 * n} = n \<Longrightarrow> card {a \<in> Collect even. a < 2 * Suc n} = Suc n
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
card {a \<in> Collect even. a < 2 * n} = n

goal (1 subgoal):
 1. \<And>n. card {a \<in> Collect even. a < 2 * n} = n \<Longrightarrow> card {a \<in> Collect even. a < 2 * Suc n} = Suc n
[PROOF STEP]
have "{a \<in> Collect even. a < 2 * Suc n} = insert (2*n) {a \<in> Collect even. a < 2 * n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {a \<in> Collect even. a < 2 * Suc n} = insert (2 * n) {a \<in> Collect even. a < 2 * n}
[PROOF STEP]
using le_eq_less_or_eq less_Suc_eq_le subset_antisym
[PROOF STATE]
proof (prove)
using this:
(?m \<le> ?n) = (?m < ?n \<or> ?m = ?n)
(?m < Suc ?n) = (?m \<le> ?n)
\<lbrakk>?A \<subseteq> ?B; ?B \<subseteq> ?A\<rbrakk> \<Longrightarrow> ?A = ?B

goal (1 subgoal):
 1. {a \<in> Collect even. a < 2 * Suc n} = insert (2 * n) {a \<in> Collect even. a < 2 * n}
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
{a \<in> Collect even. a < 2 * Suc n} = insert (2 * n) {a \<in> Collect even. a < 2 * n}

goal (1 subgoal):
 1. \<And>n. card {a \<in> Collect even. a < 2 * n} = n \<Longrightarrow> card {a \<in> Collect even. a < 2 * Suc n} = Suc n
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {a \<in> Collect even. a < 2 * Suc n} = Suc n
[PROOF STEP]
unfolding \<open>{a \<in> Collect even. a < 2 * Suc n} = insert (2*n) {a \<in> Collect even. a < 2 * n}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (insert (2 * n) {a \<in> Collect even. a < 2 * n}) = Suc n
[PROOF STEP]
using Suc card_insert_disjoint[of "{a \<in> Collect even. a < 2 * n}" "2*n"]
[PROOF STATE]
proof (prove)
using this:
card {a \<in> Collect even. a < 2 * n} = n
\<lbrakk>finite {a \<in> Collect even. a < 2 * n}; 2 * n \<notin> {a \<in> Collect even. a < 2 * n}\<rbrakk> \<Longrightarrow> card (insert (2 * n) {a \<in> Collect even. a < 2 * n}) = Suc (card {a \<in> Collect even. a < 2 * n})

goal (1 subgoal):
 1. card (insert (2 * n) {a \<in> Collect even. a < 2 * n}) = Suc n
[PROOF STEP]
by (simp add: finite_M_bounded_by_nat less_not_refl2)
[PROOF STATE]
proof (state)
this:
card {a \<in> Collect even. a < 2 * Suc n} = Suc n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma height_balL2:
  "\<lbrakk> hbt l; hbt r; height l \<noteq> height r + m + 1 \<rbrakk> \<Longrightarrow>
   height (balL l a r) = 1 + max (height l) (height r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>hbt l; hbt r; height l \<noteq> height r + m + 1\<rbrakk> \<Longrightarrow> height (balL l a r) = 1 + max (height l) (height r)
[PROOF STEP]
by (simp_all add: balL_def)


[STATEMENT]
lemma Ex_first_occurrence [rule_format]: "P (n::nat) \<longrightarrow> (\<exists>m. P m \<and> (\<forall>i<m. \<not> P i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P n \<longrightarrow> (\<exists>m. P m \<and> (\<forall>i<m. \<not> P i))
[PROOF STEP]
apply(rule nat_less_induct)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<forall>m<n. P m \<longrightarrow> (\<exists>m. P m \<and> (\<forall>i<m. \<not> P i)) \<Longrightarrow> P n \<longrightarrow> (\<exists>m. P m \<and> (\<forall>i<m. \<not> P i))
[PROOF STEP]
apply clarify
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<forall>m<n. P m \<longrightarrow> (\<exists>m. P m \<and> (\<forall>i<m. \<not> P i)); P n\<rbrakk> \<Longrightarrow> \<exists>m. P m \<and> (\<forall>i<m. \<not> P i)
[PROOF STEP]
apply(case_tac "\<forall>m. m<n \<longrightarrow> \<not> P m")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n. \<lbrakk>\<forall>m<n. P m \<longrightarrow> (\<exists>m. P m \<and> (\<forall>i<m. \<not> P i)); P n; \<forall>m<n. \<not> P m\<rbrakk> \<Longrightarrow> \<exists>m. P m \<and> (\<forall>i<m. \<not> P i)
 2. \<And>n. \<lbrakk>\<forall>m<n. P m \<longrightarrow> (\<exists>m. P m \<and> (\<forall>i<m. \<not> P i)); P n; \<not> (\<forall>m<n. \<not> P m)\<rbrakk> \<Longrightarrow> \<exists>m. P m \<and> (\<forall>i<m. \<not> P i)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma degree_of_X_minus:
  assumes "a \<in> carrier R"
  assumes "\<one> \<noteq>\<zero>"
  shows "degree (X_minus a) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deg R (X_poly_minus R a) = 1
[PROOF STEP]
using degree_of_X_plus[of "\<ominus>a"] X_minus_plus[simp] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<ominus> a \<in> carrier R; \<one> \<noteq> \<zero>\<rbrakk> \<Longrightarrow> deg R (X_poly_plus R (\<ominus> a)) = 1
?a \<in> carrier R \<Longrightarrow> X_poly_minus R ?a = X_poly_plus R (\<ominus> ?a)
a \<in> carrier R
\<one> \<noteq> \<zero>

goal (1 subgoal):
 1. deg R (X_poly_minus R a) = 1
[PROOF STEP]
by auto


[STATEMENT]
lemma GS_rec_def': "GS_rec v $ s = (\<Squnion>a \<in> A s. r (s, a) + l * (
  (\<Sum>s' < s. pmf (K (s,a)) s' * (GS_rec v $ s')) +
  (\<Sum>s' \<in> {s'. s \<le> s'}. pmf (K (s,a)) s' * v $ s')))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. GS_rec v $ s = (\<Squnion>a\<in>A s. r (s, a) + l * ((\<Sum>s'<s. pmf (K (s, a)) s' * GS_rec v $ s') + (\<Sum>s' | s \<le> s'. pmf (K (s, a)) s' * v $ s')))
[PROOF STEP]
unfolding GS_rec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_lambda (GS_rec_fun (($) v)) $ s = (\<Squnion>a\<in>A s. r (s, a) + l * ((\<Sum>s'<s. pmf (K (s, a)) s' * vec_lambda (GS_rec_fun (($) v)) $ s') + (\<Sum>s' | s \<le> s'. pmf (K (s, a)) s' * v $ s')))
[PROOF STEP]
by (auto simp: GS_rec_fun.simps[of _ s])


[STATEMENT]
lemma cube_card: "card ({..<n::nat} \<rightarrow>\<^sub>E {..<t::nat}) = t ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card ({..<n} \<rightarrow>\<^sub>E {..<t}) = t ^ n
[PROOF STEP]
by (simp add: card_PiE)


[STATEMENT]
lemma eventually_nonneg_add1 [eventually_nonzero_simps]:
  assumes "eventually_nonneg F f" "g \<in> o[F](f)"
  shows   "eventually_nonneg F (\<lambda>x. f x + g x :: real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eventually_nonneg F (\<lambda>x. f x + g x)
[PROOF STEP]
using  landau_o.smallD[OF assms(2) zero_less_one] assms(1)
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. norm (g x) \<le> 1 * norm (f x)
eventually_nonneg F f

goal (1 subgoal):
 1. eventually_nonneg F (\<lambda>x. f x + g x)
[PROOF STEP]
unfolding eventually_nonneg_def
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. norm (g x) \<le> 1 * norm (f x)
\<forall>\<^sub>F x in F. 0 \<le> f x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. 0 \<le> f x + g x
[PROOF STEP]
by eventually_elim simp_all


[STATEMENT]
lemma in_arcs_single_per_vert:
  assumes "v \<in> verts G" and "u \<in> verts G"
  assumes "e1 \<in> in_arcs G v" and " e2 \<in> in_arcs G v"
  assumes "tail G e1 = u" and "tail G e2 = u"
  shows "e1 = e2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. e1 = e2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. e1 = e2
[PROOF STEP]
have in_arcs1: "e1 \<in> arcs G" and in_arcs2: "e2 \<in> arcs G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. e1 \<in> arcs G &&& e2 \<in> arcs G
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
v \<in> verts G
u \<in> verts G
e1 \<in> in_arcs G v
e2 \<in> in_arcs G v
tail G e1 = u
tail G e2 = u

goal (1 subgoal):
 1. e1 \<in> arcs G &&& e2 \<in> arcs G
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
e1 \<in> arcs G
e2 \<in> arcs G

goal (1 subgoal):
 1. e1 = e2
[PROOF STEP]
have "arc_to_ends G e1 = arc_to_ends G e2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arc_to_ends G e1 = arc_to_ends G e2
[PROOF STEP]
using assms arc_to_ends_def
[PROOF STATE]
proof (prove)
using this:
v \<in> verts G
u \<in> verts G
e1 \<in> in_arcs G v
e2 \<in> in_arcs G v
tail G e1 = u
tail G e2 = u
arc_to_ends ?G ?e \<equiv> (tail ?G ?e, head ?G ?e)

goal (1 subgoal):
 1. arc_to_ends G e1 = arc_to_ends G e2
[PROOF STEP]
by (metis in_in_arcs_conv)
[PROOF STATE]
proof (state)
this:
arc_to_ends G e1 = arc_to_ends G e2

goal (1 subgoal):
 1. e1 = e2
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
arc_to_ends G e1 = arc_to_ends G e2

goal (1 subgoal):
 1. e1 = e2
[PROOF STEP]
using in_arcs1 in_arcs2 no_multi_arcs
[PROOF STATE]
proof (prove)
using this:
arc_to_ends G e1 = arc_to_ends G e2
e1 \<in> arcs G
e2 \<in> arcs G
\<lbrakk>?e1.0 \<in> arcs G; ?e2.0 \<in> arcs G; arc_to_ends G ?e1.0 = arc_to_ends G ?e2.0\<rbrakk> \<Longrightarrow> ?e1.0 = ?e2.0

goal (1 subgoal):
 1. e1 = e2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
e1 = e2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vec_norm_sq_cpx_vec_length_sq:
  shows "(vec_norm v)\<^sup>2 = (cpx_vec_length v)\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (vec_norm v)\<^sup>2 = complex_of_real (\<parallel>v\<parallel>\<^sup>2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (vec_norm v)\<^sup>2 = complex_of_real (\<parallel>v\<parallel>\<^sup>2)
[PROOF STEP]
have "(vec_norm v)\<^sup>2 = inner_prod v v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (vec_norm v)\<^sup>2 = Complex_Matrix.inner_prod v v
[PROOF STEP]
unfolding vec_norm_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (csqrt (Complex_Matrix.inner_prod v v))\<^sup>2 = Complex_Matrix.inner_prod v v
[PROOF STEP]
using power2_csqrt
[PROOF STATE]
proof (prove)
using this:
(csqrt ?z)\<^sup>2 = ?z

goal (1 subgoal):
 1. (csqrt (Complex_Matrix.inner_prod v v))\<^sup>2 = Complex_Matrix.inner_prod v v
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(vec_norm v)\<^sup>2 = Complex_Matrix.inner_prod v v

goal (1 subgoal):
 1. (vec_norm v)\<^sup>2 = complex_of_real (\<parallel>v\<parallel>\<^sup>2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(vec_norm v)\<^sup>2 = Complex_Matrix.inner_prod v v

goal (1 subgoal):
 1. (vec_norm v)\<^sup>2 = complex_of_real (\<parallel>v\<parallel>\<^sup>2)
[PROOF STEP]
have "... = (\<Sum>i<dim_vec v. (cmod (Matrix.vec_index v i))\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.inner_prod v v = complex_of_real (\<Sum>i<dim_vec v. (cmod (v $ i))\<^sup>2)
[PROOF STEP]
unfolding Matrix.scalar_prod_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<dim_vec (conjugate v). v $ i * conjugate v $ i) = complex_of_real (\<Sum>i<dim_vec v. (cmod (v $ i))\<^sup>2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>i = 0..<dim_vec (conjugate v). v $ i * conjugate v $ i) = complex_of_real (\<Sum>i<dim_vec v. (cmod (v $ i))\<^sup>2)
[PROOF STEP]
have "\<And>i. i < dim_vec v \<Longrightarrow> Matrix.vec_index v  i * conjugate (Matrix.vec_index v i) =
      (cmod (Matrix.vec_index v i))\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i < dim_vec v \<Longrightarrow> v $ i * conjugate (v $ i) = complex_of_real ((cmod (v $ i))\<^sup>2)
[PROOF STEP]
using mult_conj_cmod_square
[PROOF STATE]
proof (prove)
using this:
?z * conjugate ?z = complex_of_real ((cmod ?z)\<^sup>2)

goal (1 subgoal):
 1. \<And>i. i < dim_vec v \<Longrightarrow> v $ i * conjugate (v $ i) = complex_of_real ((cmod (v $ i))\<^sup>2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
?i < dim_vec v \<Longrightarrow> v $ ?i * conjugate (v $ ?i) = complex_of_real ((cmod (v $ ?i))\<^sup>2)

goal (1 subgoal):
 1. (\<Sum>i = 0..<dim_vec (conjugate v). v $ i * conjugate v $ i) = complex_of_real (\<Sum>i<dim_vec v. (cmod (v $ i))\<^sup>2)
[PROOF STEP]
thus "(\<Sum>i = 0..<dim_vec (conjugate v). Matrix.vec_index v i *
      Matrix.vec_index (conjugate v) i) =  (\<Sum>i<dim_vec v. (cmod (Matrix.vec_index v i))\<^sup>2)"
[PROOF STATE]
proof (prove)
using this:
?i < dim_vec v \<Longrightarrow> v $ ?i * conjugate (v $ ?i) = complex_of_real ((cmod (v $ ?i))\<^sup>2)

goal (1 subgoal):
 1. (\<Sum>i = 0..<dim_vec (conjugate v). v $ i * conjugate v $ i) = complex_of_real (\<Sum>i<dim_vec v. (cmod (v $ i))\<^sup>2)
[PROOF STEP]
by (simp add: lessThan_atLeast0)
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<dim_vec (conjugate v). v $ i * conjugate v $ i) = complex_of_real (\<Sum>i<dim_vec v. (cmod (v $ i))\<^sup>2)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Complex_Matrix.inner_prod v v = complex_of_real (\<Sum>i<dim_vec v. (cmod (v $ i))\<^sup>2)

goal (1 subgoal):
 1. (vec_norm v)\<^sup>2 = complex_of_real (\<parallel>v\<parallel>\<^sup>2)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(vec_norm v)\<^sup>2 = complex_of_real (\<Sum>i<dim_vec v. (cmod (v $ i))\<^sup>2)
[PROOF STEP]
show "(vec_norm v)\<^sup>2 = (cpx_vec_length v)\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
(vec_norm v)\<^sup>2 = complex_of_real (\<Sum>i<dim_vec v. (cmod (v $ i))\<^sup>2)

goal (1 subgoal):
 1. (vec_norm v)\<^sup>2 = complex_of_real (\<parallel>v\<parallel>\<^sup>2)
[PROOF STEP]
unfolding cpx_vec_length_def
[PROOF STATE]
proof (prove)
using this:
(vec_norm v)\<^sup>2 = complex_of_real (\<Sum>i<dim_vec v. (cmod (v $ i))\<^sup>2)

goal (1 subgoal):
 1. (vec_norm v)\<^sup>2 = complex_of_real ((sqrt (\<Sum>i<dim_vec v. (cmod (v $ i))\<^sup>2))\<^sup>2)
[PROOF STEP]
by (simp add: sum_nonneg)
[PROOF STATE]
proof (state)
this:
(vec_norm v)\<^sup>2 = complex_of_real (\<parallel>v\<parallel>\<^sup>2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sgn_less_eq_1_real: fixes a b :: real
  shows "sgn a = 1 \<Longrightarrow> a \<le> b \<Longrightarrow> sgn b = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>sgn a = 1; a \<le> b\<rbrakk> \<Longrightarrow> sgn b = 1
[PROOF STEP]
by (metis (no_types, opaque_lifting) not_less one_neq_neg_one one_neq_zero order_trans sgn_real_def)


[STATEMENT]
lemma acyclic_paths_set :
  "acyclic_paths_up_to_length M q (size M - 1) = {p . path M q p \<and> distinct (visited_states q p)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. acyclic_paths_up_to_length M q (FSM.size M - 1) = {p. path M q p \<and> distinct (visited_states q p)}
[PROOF STEP]
unfolding acyclic_paths_up_to_length.simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {p. path M q p \<and> length p \<le> FSM.size M - 1 \<and> distinct (visited_states q p)} = {p. path M q p \<and> distinct (visited_states q p)}
[PROOF STEP]
using acyclic_path_length_limit[of M q]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>path M q ?p; distinct (visited_states q ?p)\<rbrakk> \<Longrightarrow> length ?p < FSM.size M

goal (1 subgoal):
 1. {p. path M q p \<and> length p \<le> FSM.size M - 1 \<and> distinct (visited_states q p)} = {p. path M q p \<and> distinct (visited_states q p)}
[PROOF STEP]
by (metis (no_types, lifting) One_nat_def Suc_pred cyclic_path_shortening leD list.size(3)
       not_less_eq_eq not_less_zero path.intros(1) path_begin_state)


[STATEMENT]
lemma finite_set_has_max:
  "finite (s:: nat set) \<Longrightarrow> s \<noteq> {} \<Longrightarrow> \<exists>k \<in> s. \<forall> p \<in> s. p \<le> k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite s; s \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>k\<in>s. \<forall>p\<in>s. p \<le> k
[PROOF STEP]
by (metis Max_ge Max_in)


[STATEMENT]
lemma (in prob_space) standard_normal_distributed_expectation:
  assumes D: "distributed M lborel X std_normal_density"
  shows "expectation X = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. expectation X = 0
[PROOF STEP]
using integral_std_normal_moment_odd[of 0]
    distributed_integral[OF D, of "\<lambda>x. x", symmetric]
[PROOF STATE]
proof (prove)
using this:
LBINT x. std_normal_density x * x ^ (2 * 0 + 1) = 0
\<lbrakk>(\<lambda>x. x) \<in> borel_measurable lborel; \<And>x. x \<in> space lborel \<Longrightarrow> 0 \<le> std_normal_density x\<rbrakk> \<Longrightarrow> expectation X = LBINT x. std_normal_density x * x

goal (1 subgoal):
 1. expectation X = 0
[PROOF STEP]
by auto


[STATEMENT]
lemma evalC_sum_list:
  "evalC b (C ns) = sum_list (map (\<lambda>n. b^evalC b n) ns)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. evalC b (C ns) = (\<Sum>n\<leftarrow>ns. b ^ evalC b n)
[PROOF STEP]
by (induct ns) auto


[STATEMENT]
lemma lemma_3_5_i_3: "(d3 a b = 1) = (a = b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (d3 a b = (1::'a)) = (a = b)
[PROOF STEP]
apply (simp add: d3_def lemma_3_5_i_1)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (b = a) = (a = b)
[PROOF STEP]
by auto


[STATEMENT]
lemma graph_homomorphism_concr_graph:
  assumes "graph G" "graph (LG e v)"
  shows "graph_homomorphism (LG e v) G x \<longleftrightarrow>
         x `` v \<subseteq> vertices G \<and> on_triple x `` e \<subseteq> edges G \<and> univalent x \<and> Domain x = v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. graph_homomorphism (LG e v) G x = (x `` v \<subseteq> vertices G \<and> on_triple x `` e \<subseteq> edges G \<and> univalent x \<and> Domain x = v)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
graph G
graph (LG e v)

goal (1 subgoal):
 1. graph_homomorphism (LG e v) G x = (x `` v \<subseteq> vertices G \<and> on_triple x `` e \<subseteq> edges G \<and> univalent x \<and> Domain x = v)
[PROOF STEP]
unfolding graph_homomorphism_def2 graph_union_iff
[PROOF STATE]
proof (prove)
using this:
graph G
graph (LG e v)

goal (1 subgoal):
 1. (vertices (LG e v) = Domain x \<and> univalent x \<and> graph (LG e v) \<and> graph G \<and> edges (map_graph x (LG e v)) \<subseteq> edges G \<and> vertices (map_graph x (LG e v)) \<subseteq> vertices G) = (x `` v \<subseteq> vertices G \<and> on_triple x `` e \<subseteq> edges G \<and> univalent x \<and> Domain x = v)
[PROOF STEP]
by auto


[STATEMENT]
lemma continuous_at_within_log[continuous_intros]:
  assumes "continuous (at a within s) f"
    and "continuous (at a within s) g"
    and "0 < f a"
    and "f a \<noteq> 1"
    and "0 < g a"
  shows "continuous (at a within s) (\<lambda>x. log (f x) (g x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous (at a within s) (\<lambda>x. log (f x) (g x))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
continuous (at a within s) f
continuous (at a within s) g
0 < f a
f a \<noteq> 1
0 < g a

goal (1 subgoal):
 1. continuous (at a within s) (\<lambda>x. log (f x) (g x))
[PROOF STEP]
unfolding continuous_within
[PROOF STATE]
proof (prove)
using this:
(f \<longlongrightarrow> f a) (at a within s)
(g \<longlongrightarrow> g a) (at a within s)
0 < f a
f a \<noteq> 1
0 < g a

goal (1 subgoal):
 1. ((\<lambda>x. log (f x) (g x)) \<longlongrightarrow> log (f a) (g a)) (at a within s)
[PROOF STEP]
by (rule tendsto_log)


[STATEMENT]
lemma field_lbound_gt_zero: "0 < d1 \<Longrightarrow> 0 < d2 \<Longrightarrow> \<exists>e. 0 < e \<and> e < d1 \<and> e < d2"
  for d1 d2 :: "'a::linordered_field"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(0::'a) < d1; (0::'a) < d2\<rbrakk> \<Longrightarrow> \<exists>e>0::'a. e < d1 \<and> e < d2
[PROOF STEP]
by (rule exI [where x = "min d1 d2 / 2"]) (simp add: min_def)


[STATEMENT]
lemma mult_singleton[simp]: "(x, y) \<in> r \<Longrightarrow> (add_mset x M, add_mset y M) \<in> mult r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x, y) \<in> r \<Longrightarrow> (add_mset x M, add_mset y M) \<in> mult r
[PROOF STEP]
unfolding add_mset_add_single[of x M] add_mset_add_single[of y M]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x, y) \<in> r \<Longrightarrow> (M + {#x#}, M + {#y#}) \<in> mult r
[PROOF STEP]
apply (rule mult_on_union)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x, y) \<in> r \<Longrightarrow> ({#x#}, {#y#}) \<in> mult r
[PROOF STEP]
using mult1_singleton[of x y r]
[PROOF STATE]
proof (prove)
using this:
(({#x#}, {#y#}) \<in> mult1 r) = ((x, y) \<in> r)

goal (1 subgoal):
 1. (x, y) \<in> r \<Longrightarrow> ({#x#}, {#y#}) \<in> mult r
[PROOF STEP]
by (auto simp add: mult_def mult_on_union)


[STATEMENT]
lemma negligible_iff_emeasure0: "S \<in> sets lebesgue \<Longrightarrow> (negligible S \<longleftrightarrow> emeasure lebesgue S = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<in> sets lebesgue \<Longrightarrow> negligible S = (emeasure lebesgue S = 0)
[PROOF STEP]
by (auto simp: measure_eq_0_null_sets negligible_iff_null_sets)


[STATEMENT]
lemma n_zero_nonempty: "n \<noteq> 0 \<Longrightarrow> {0 ..< n :: nat} \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> {0..<n} \<noteq> {}
[PROOF STEP]
by auto


[STATEMENT]
lemma has_integral_component_ubound:
  fixes f::"'a::euclidean_space => 'b::euclidean_space"
  assumes "(f has_integral i) (cbox a b)"
    and "\<forall>x\<in>cbox a b. f x\<bullet>k \<le> B"
    and "k \<in> Basis"
  shows "i\<bullet>k \<le> B * content (cbox a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<bullet> k \<le> B * content (cbox a b)
[PROOF STEP]
using has_integral_component_le[OF assms(3,1) has_integral_const, of "\<Sum>i\<in>Basis. B *\<^sub>R i"] assms(2-)
[PROOF STATE]
proof (prove)
using this:
(\<And>x. x \<in> cbox a b \<Longrightarrow> f x \<bullet> k \<le> sum ((*\<^sub>R) B) Basis \<bullet> k) \<Longrightarrow> i \<bullet> k \<le> content (cbox a b) *\<^sub>R sum ((*\<^sub>R) B) Basis \<bullet> k
\<forall>x\<in>cbox a b. f x \<bullet> k \<le> B
k \<in> Basis

goal (1 subgoal):
 1. i \<bullet> k \<le> B * content (cbox a b)
[PROOF STEP]
by (auto simp add: field_simps)


[STATEMENT]
lemma lemmaA_3_9:  "(M -s S) -s T = M -s (S \<union> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M -s S -s T = M -s (S \<union> T)
[PROOF STEP]
unfolding diff_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {#x \<in># {#x \<in># M. x \<notin> S#}. x \<notin> T#} = {#x \<in># M. x \<notin> S \<union> T#}
[PROOF STEP]
by (rule multiset_eqI) simp


[STATEMENT]
lemma euler_liar_mult:
  shows "euler_liar y n \<Longrightarrow> euler_liar x n \<Longrightarrow> euler_liar (x*y) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>euler_liar y n; euler_liar x n\<rbrakk> \<Longrightarrow> euler_liar (x * y) n
[PROOF STEP]
unfolding euler_witness_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<not> [Jacobi y (int n) \<noteq> y ^ ((n - 1) div 2)] (mod int n); \<not> [Jacobi x (int n) \<noteq> x ^ ((n - 1) div 2)] (mod int n)\<rbrakk> \<Longrightarrow> \<not> [Jacobi (x * y) (int n) \<noteq> (x * y) ^ ((n - 1) div 2)] (mod int n)
[PROOF STEP]
by (auto simp: power_mult_distrib intro: cong_mult)


[STATEMENT]
lemma wf_tuple_Cons[simp]:
  "wf_tuple n A (x # xs) \<longleftrightarrow> ((if x = None then 0 \<notin> A else 0 \<in> A) \<and>
   (\<exists>m. n = Suc m \<and> wf_tuple m ((\<lambda>x. x - 1) ` (A - {0})) xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf_tuple n A (x # xs) = ((if x = None then 0 \<notin> A else 0 \<in> A) \<and> (\<exists>m. n = Suc m \<and> wf_tuple m ((\<lambda>x. x - 1) ` (A - {0})) xs))
[PROOF STEP]
unfolding wf_tuple_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (length (x # xs) = n \<and> (\<forall>i<n. ((x # xs) ! i = None) = (i \<notin> A))) = ((if x = None then 0 \<notin> A else 0 \<in> A) \<and> (\<exists>m. n = Suc m \<and> length xs = m \<and> (\<forall>i<m. (xs ! i = None) = (i \<notin> (\<lambda>x. x - 1) ` (A - {0})))))
[PROOF STEP]
by (auto 0 3 simp: nth_Cons image_iff Ball_def gr0_conv_Suc Suc_pred' split: nat.splits)


[STATEMENT]
lemma DERIV_NS_iff: "(DERIV f x :> D) \<longleftrightarrow> (\<lambda>h. (f (x + h) - f x) / h) \<midarrow>0\<rightarrow>\<^sub>N\<^sub>S D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_field_derivative D) (at x) = (\<lambda>h. (f (x + h) - f x) / h) \<midarrow>0::'a\<rightarrow>\<^sub>N\<^sub>S D
[PROOF STEP]
by (simp add: DERIV_def LIM_NSLIM_iff)


[STATEMENT]
lemma bounded_linear_vec_lambda_blinfun:
  fixes f :: "('s \<Rightarrow>\<^sub>b real) \<Rightarrow>\<^sub>L ('s \<Rightarrow>\<^sub>b real)"
  shows "bounded_linear (\<lambda>v. vec_lambda (apply_bfun (blinfun_apply f (bfun.Bfun (($) v)))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_linear (\<lambda>v. vec_lambda (apply_bfun (blinfun_apply f (bfun.Bfun (($) v)))))
[PROOF STEP]
using blinfun.bounded_linear_right
[PROOF STATE]
proof (prove)
using this:
bounded_linear (blinfun_apply ?a)

goal (1 subgoal):
 1. bounded_linear (\<lambda>v. vec_lambda (apply_bfun (blinfun_apply f (bfun.Bfun (($) v)))))
[PROOF STEP]
by (fastforce intro: bounded_linear_compose[OF bounded_linear_vec_lambda]
      bounded_linear_bfun_nth bounded_linear_compose[of f])


[STATEMENT]
lemma cball_trans: "y \<in> cball z b \<Longrightarrow> x \<in> cball y a \<Longrightarrow> x \<in> cball z (b + a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>y \<in> cball z b; x \<in> cball y a\<rbrakk> \<Longrightarrow> x \<in> cball z (b + a)
[PROOF STEP]
by metric


[STATEMENT]
theorem exp_cf2_lower_bound_pos: "0\<le>x \<Longrightarrow> exp_cf2 x \<le> exp x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> x \<Longrightarrow> exp_cf2 x \<le> exp x
[PROOF STEP]
by (metis exp_cf2_pos exp_le_cancel_iff exp_ln ln_exp_cf2_lower_bound_pos)