[STATEMENT]
theorem Ln_series:
  fixes z :: complex
  assumes "norm z < 1"
  shows   "(\<lambda>n. (-1)^Suc n / of_nat n * z^n) sums ln (1 + z)" (is "(\<lambda>n. ?f n * z^n) sums _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. (- 1) ^ Suc n / of_nat n * z ^ n) sums Ln (1 + z)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>n. (- 1) ^ Suc n / of_nat n * z ^ n) sums Ln (1 + z)
[PROOF STEP]
let ?F = "\<lambda>z. \<Sum>n. ?f n * z^n" and ?F' = "\<lambda>z. \<Sum>n. diffs ?f n * z^n"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>n. (- 1) ^ Suc n / of_nat n * z ^ n) sums Ln (1 + z)
[PROOF STEP]
have r: "conv_radius ?f = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conv_radius (\<lambda>n. (- 1) ^ Suc n / of_nat n) = 1
[PROOF STEP]
by (intro conv_radius_ratio_limit_nonzero[of _ 1])
       (simp_all add: norm_divide LIMSEQ_Suc_n_over_n del: of_nat_Suc)
[PROOF STATE]
proof (state)
this:
conv_radius (\<lambda>n. (- 1) ^ Suc n / of_nat n) = 1

goal (1 subgoal):
 1. (\<lambda>n. (- 1) ^ Suc n / of_nat n * z ^ n) sums Ln (1 + z)
[PROOF STEP]
have "\<exists>c. \<forall>z\<in>ball 0 1. ln (1 + z) - ?F z = c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>c. \<forall>z\<in>ball 0 1. Ln (1 + z) - (\<Sum>n. (- 1) ^ Suc n / of_nat n * z ^ n) = c
[PROOF STEP]
proof (rule has_field_derivative_zero_constant)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. convex (ball 0 1)
 2. \<And>z. z \<in> ball 0 1 \<Longrightarrow> ((\<lambda>x. Ln (1 + x) - (\<Sum>n. (- 1) ^ Suc n / of_nat n * x ^ n)) has_field_derivative 0) (at z within ball 0 1)
[PROOF STEP]
fix z :: complex
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. convex (ball 0 1)
 2. \<And>z. z \<in> ball 0 1 \<Longrightarrow> ((\<lambda>x. Ln (1 + x) - (\<Sum>n. (- 1) ^ Suc n / of_nat n * x ^ n)) has_field_derivative 0) (at z within ball 0 1)
[PROOF STEP]
assume z': "z \<in> ball 0 1"
[PROOF STATE]
proof (state)
this:
z \<in> ball 0 1

goal (2 subgoals):
 1. convex (ball 0 1)
 2. \<And>z. z \<in> ball 0 1 \<Longrightarrow> ((\<lambda>x. Ln (1 + x) - (\<Sum>n. (- 1) ^ Suc n / of_nat n * x ^ n)) has_field_derivative 0) (at z within ball 0 1)
[PROOF STEP]
hence z: "norm z < 1"
[PROOF STATE]
proof (prove)
using this:
z \<in> ball 0 1

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

goal (2 subgoals):
 1. convex (ball 0 1)
 2. \<And>z. z \<in> ball 0 1 \<Longrightarrow> ((\<lambda>x. Ln (1 + x) - (\<Sum>n. (- 1) ^ Suc n / of_nat n * x ^ n)) has_field_derivative 0) (at z within ball 0 1)
[PROOF STEP]
define t :: complex where "t = of_real (1 + norm z) / 2"
[PROOF STATE]
proof (state)
this:
t = complex_of_real (1 + cmod z) / 2

goal (2 subgoals):
 1. convex (ball 0 1)
 2. \<And>z. z \<in> ball 0 1 \<Longrightarrow> ((\<lambda>x. Ln (1 + x) - (\<Sum>n. (- 1) ^ Suc n / of_nat n * x ^ n)) has_field_derivative 0) (at z within ball 0 1)
[PROOF STEP]
from z
[PROOF STATE]
proof (chain)
picking this:
cmod z < 1
[PROOF STEP]
have t: "norm z < norm t" "norm t < 1"
[PROOF STATE]
proof (prove)
using this:
cmod z < 1

goal (1 subgoal):
 1. cmod z < cmod t &&& cmod t < 1
[PROOF STEP]
unfolding t_def
[PROOF STATE]
proof (prove)
using this:
cmod z < 1

goal (1 subgoal):
 1. cmod z < cmod (complex_of_real (1 + cmod z) / 2) &&& cmod (complex_of_real (1 + cmod z) / 2) < 1
[PROOF STEP]
by (simp_all add: field_simps norm_divide del: of_real_add)
[PROOF STATE]
proof (state)
this:
cmod z < cmod t
cmod t < 1

goal (2 subgoals):
 1. convex (ball 0 1)
 2. \<And>z. z \<in> ball 0 1 \<Longrightarrow> ((\<lambda>x. Ln (1 + x) - (\<Sum>n. (- 1) ^ Suc n / of_nat n * x ^ n)) has_field_derivative 0) (at z within ball 0 1)
[PROOF STEP]
have "Re (-z) \<le> norm (-z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re (- z) \<le> cmod (- z)
[PROOF STEP]
by (rule complex_Re_le_cmod)
[PROOF STATE]
proof (state)
this:
Re (- z) \<le> cmod (- z)

goal (2 subgoals):
 1. convex (ball 0 1)
 2. \<And>z. z \<in> ball 0 1 \<Longrightarrow> ((\<lambda>x. Ln (1 + x) - (\<Sum>n. (- 1) ^ Suc n / of_nat n * x ^ n)) has_field_derivative 0) (at z within ball 0 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Re (- z) \<le> cmod (- z)

goal (2 subgoals):
 1. convex (ball 0 1)
 2. \<And>z. z \<in> ball 0 1 \<Longrightarrow> ((\<lambda>x. Ln (1 + x) - (\<Sum>n. (- 1) ^ Suc n / of_nat n * x ^ n)) has_field_derivative 0) (at z within ball 0 1)
[PROOF STEP]
from z
[PROOF STATE]
proof (chain)
picking this:
cmod z < 1
[PROOF STEP]
have "\<dots> < 1"
[PROOF STATE]
proof (prove)
using this:
cmod z < 1

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

goal (2 subgoals):
 1. convex (ball 0 1)
 2. \<And>z. z \<in> ball 0 1 \<Longrightarrow> ((\<lambda>x. Ln (1 + x) - (\<Sum>n. (- 1) ^ Suc n / of_nat n * x ^ n)) has_field_derivative 0) (at z within ball 0 1)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Re (- z) < 1
[PROOF STEP]
have "((\<lambda>z. ln (1 + z)) has_field_derivative inverse (1+z)) (at z)"
[PROOF STATE]
proof (prove)
using this:
Re (- z) < 1

goal (1 subgoal):
 1. ((\<lambda>z. Ln (1 + z)) has_field_derivative inverse (1 + z)) (at z)
[PROOF STEP]
by (auto intro!: derivative_eq_intros simp: complex_nonpos_Reals_iff)
[PROOF STATE]
proof (state)
this:
((\<lambda>z. Ln (1 + z)) has_field_derivative inverse (1 + z)) (at z)

goal (2 subgoals):
 1. convex (ball 0 1)
 2. \<And>z. z \<in> ball 0 1 \<Longrightarrow> ((\<lambda>x. Ln (1 + x) - (\<Sum>n. (- 1) ^ Suc n / of_nat n * x ^ n)) has_field_derivative 0) (at z within ball 0 1)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
((\<lambda>z. Ln (1 + z)) has_field_derivative inverse (1 + z)) (at z)

goal (2 subgoals):
 1. convex (ball 0 1)
 2. \<And>z. z \<in> ball 0 1 \<Longrightarrow> ((\<lambda>x. Ln (1 + x) - (\<Sum>n. (- 1) ^ Suc n / of_nat n * x ^ n)) has_field_derivative 0) (at z within ball 0 1)
[PROOF STEP]
have "(?F has_field_derivative ?F' z) (at z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>z. \<Sum>n. (- 1) ^ Suc n / of_nat n * z ^ n) has_field_derivative (\<Sum>n. diffs (\<lambda>n. (- 1) ^ Suc n / of_nat n) n * z ^ n)) (at z)
[PROOF STEP]
using t r
[PROOF STATE]
proof (prove)
using this:
cmod z < cmod t
cmod t < 1
conv_radius (\<lambda>n. (- 1) ^ Suc n / of_nat n) = 1

goal (1 subgoal):
 1. ((\<lambda>z. \<Sum>n. (- 1) ^ Suc n / of_nat n * z ^ n) has_field_derivative (\<Sum>n. diffs (\<lambda>n. (- 1) ^ Suc n / of_nat n) n * z ^ n)) (at z)
[PROOF STEP]
by (intro termdiffs_strong[of _ t] summable_in_conv_radius) simp_all
[PROOF STATE]
proof (state)
this:
((\<lambda>z. \<Sum>n. (- 1) ^ Suc n / of_nat n * z ^ n) has_field_derivative (\<Sum>n. diffs (\<lambda>n. (- 1) ^ Suc n / of_nat n) n * z ^ n)) (at z)

goal (2 subgoals):
 1. convex (ball 0 1)
 2. \<And>z. z \<in> ball 0 1 \<Longrightarrow> ((\<lambda>x. Ln (1 + x) - (\<Sum>n. (- 1) ^ Suc n / of_nat n * x ^ n)) has_field_derivative 0) (at z within ball 0 1)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>z. Ln (1 + z)) has_field_derivative inverse (1 + z)) (at z)
((\<lambda>z. \<Sum>n. (- 1) ^ Suc n / of_nat n * z ^ n) has_field_derivative (\<Sum>n. diffs (\<lambda>n. (- 1) ^ Suc n / of_nat n) n * z ^ n)) (at z)
[PROOF STEP]
have "((\<lambda>z. ln (1 + z) - ?F z) has_field_derivative (inverse (1 + z) - ?F' z))
                       (at z within ball 0 1)"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>z. Ln (1 + z)) has_field_derivative inverse (1 + z)) (at z)
((\<lambda>z. \<Sum>n. (- 1) ^ Suc n / of_nat n * z ^ n) has_field_derivative (\<Sum>n. diffs (\<lambda>n. (- 1) ^ Suc n / of_nat n) n * z ^ n)) (at z)

goal (1 subgoal):
 1. ((\<lambda>z. Ln (1 + z) - (\<Sum>n. (- 1) ^ Suc n / of_nat n * z ^ n)) has_field_derivative inverse (1 + z) - (\<Sum>n. diffs (\<lambda>n. (- 1) ^ Suc n / of_nat n) n * z ^ n)) (at z within ball 0 1)
[PROOF STEP]
by (intro derivative_intros) (simp_all add: at_within_open[OF z'])
[PROOF STATE]
proof (state)
this:
((\<lambda>z. Ln (1 + z) - (\<Sum>n. (- 1) ^ Suc n / of_nat n * z ^ n)) has_field_derivative inverse (1 + z) - (\<Sum>n. diffs (\<lambda>n. (- 1) ^ Suc n / of_nat n) n * z ^ n)) (at z within ball 0 1)

goal (2 subgoals):
 1. convex (ball 0 1)
 2. \<And>z. z \<in> ball 0 1 \<Longrightarrow> ((\<lambda>x. Ln (1 + x) - (\<Sum>n. (- 1) ^ Suc n / of_nat n * x ^ n)) has_field_derivative 0) (at z within ball 0 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<lambda>z. Ln (1 + z) - (\<Sum>n. (- 1) ^ Suc n / of_nat n * z ^ n)) has_field_derivative inverse (1 + z) - (\<Sum>n. diffs (\<lambda>n. (- 1) ^ Suc n / of_nat n) n * z ^ n)) (at z within ball 0 1)

goal (2 subgoals):
 1. convex (ball 0 1)
 2. \<And>z. z \<in> ball 0 1 \<Longrightarrow> ((\<lambda>x. Ln (1 + x) - (\<Sum>n. (- 1) ^ Suc n / of_nat n * x ^ n)) has_field_derivative 0) (at z within ball 0 1)
[PROOF STEP]
have "(\<lambda>n. of_nat n * ?f n * z ^ (n - Suc 0)) sums ?F' z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. of_nat n * ((- 1) ^ Suc n / of_nat n) * z ^ (n - Suc 0)) sums (\<Sum>n. diffs (\<lambda>n. (- 1) ^ Suc n / of_nat n) n * z ^ n)
[PROOF STEP]
using t r
[PROOF STATE]
proof (prove)
using this:
cmod z < cmod t
cmod t < 1
conv_radius (\<lambda>n. (- 1) ^ Suc n / of_nat n) = 1

goal (1 subgoal):
 1. (\<lambda>n. of_nat n * ((- 1) ^ Suc n / of_nat n) * z ^ (n - Suc 0)) sums (\<Sum>n. diffs (\<lambda>n. (- 1) ^ Suc n / of_nat n) n * z ^ n)
[PROOF STEP]
by (intro diffs_equiv termdiff_converges[OF t(1)] summable_in_conv_radius) simp_all
[PROOF STATE]
proof (state)
this:
(\<lambda>n. of_nat n * ((- 1) ^ Suc n / of_nat n) * z ^ (n - Suc 0)) sums (\<Sum>n. diffs (\<lambda>n. (- 1) ^ Suc n / of_nat n) n * z ^ n)

goal (2 subgoals):
 1. convex (ball 0 1)
 2. \<And>z. z \<in> ball 0 1 \<Longrightarrow> ((\<lambda>x. Ln (1 + x) - (\<Sum>n. (- 1) ^ Suc n / of_nat n * x ^ n)) has_field_derivative 0) (at z within ball 0 1)
[PROOF STEP]
from sums_split_initial_segment[OF this, of 1]
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>i. of_nat (i + 1) * ((- 1) ^ Suc (i + 1) / of_nat (i + 1)) * z ^ (i + 1 - Suc 0)) sums ((\<Sum>n. diffs (\<lambda>n. (- 1) ^ Suc n / of_nat n) n * z ^ n) - (\<Sum>i<1. of_nat i * ((- 1) ^ Suc i / of_nat i) * z ^ (i - Suc 0)))
[PROOF STEP]
have "(\<lambda>i. (-z) ^ i) sums ?F' z"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>i. of_nat (i + 1) * ((- 1) ^ Suc (i + 1) / of_nat (i + 1)) * z ^ (i + 1 - Suc 0)) sums ((\<Sum>n. diffs (\<lambda>n. (- 1) ^ Suc n / of_nat n) n * z ^ n) - (\<Sum>i<1. of_nat i * ((- 1) ^ Suc i / of_nat i) * z ^ (i - Suc 0)))

goal (1 subgoal):
 1. (^) (- z) sums (\<Sum>n. diffs (\<lambda>n. (- 1) ^ Suc n / of_nat n) n * z ^ n)
[PROOF STEP]
by (simp add: power_minus[of z] del: of_nat_Suc)
[PROOF STATE]
proof (state)
this:
(^) (- z) sums (\<Sum>n. diffs (\<lambda>n. (- 1) ^ Suc n / of_nat n) n * z ^ n)

goal (2 subgoals):
 1. convex (ball 0 1)
 2. \<And>z. z \<in> ball 0 1 \<Longrightarrow> ((\<lambda>x. Ln (1 + x) - (\<Sum>n. (- 1) ^ Suc n / of_nat n * x ^ n)) has_field_derivative 0) (at z within ball 0 1)
[PROOF STEP]
hence "?F' z = inverse (1 + z)"
[PROOF STATE]
proof (prove)
using this:
(^) (- z) sums (\<Sum>n. diffs (\<lambda>n. (- 1) ^ Suc n / of_nat n) n * z ^ n)

goal (1 subgoal):
 1. (\<Sum>n. diffs (\<lambda>n. (- 1) ^ Suc n / of_nat n) n * z ^ n) = inverse (1 + z)
[PROOF STEP]
using z
[PROOF STATE]
proof (prove)
using this:
(^) (- z) sums (\<Sum>n. diffs (\<lambda>n. (- 1) ^ Suc n / of_nat n) n * z ^ n)
cmod z < 1

goal (1 subgoal):
 1. (\<Sum>n. diffs (\<lambda>n. (- 1) ^ Suc n / of_nat n) n * z ^ n) = inverse (1 + z)
[PROOF STEP]
by (simp add: sums_iff suminf_geometric divide_inverse)
[PROOF STATE]
proof (state)
this:
(\<Sum>n. diffs (\<lambda>n. (- 1) ^ Suc n / of_nat n) n * z ^ n) = inverse (1 + z)

goal (2 subgoals):
 1. convex (ball 0 1)
 2. \<And>z. z \<in> ball 0 1 \<Longrightarrow> ((\<lambda>x. Ln (1 + x) - (\<Sum>n. (- 1) ^ Suc n / of_nat n * x ^ n)) has_field_derivative 0) (at z within ball 0 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>n. diffs (\<lambda>n. (- 1) ^ Suc n / of_nat n) n * z ^ n) = inverse (1 + z)

goal (2 subgoals):
 1. convex (ball 0 1)
 2. \<And>z. z \<in> ball 0 1 \<Longrightarrow> ((\<lambda>x. Ln (1 + x) - (\<Sum>n. (- 1) ^ Suc n / of_nat n * x ^ n)) has_field_derivative 0) (at z within ball 0 1)
[PROOF STEP]
have "inverse (1 + z) - inverse (1 + z) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse (1 + z) - inverse (1 + z) = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
inverse (1 + z) - inverse (1 + z) = 0

goal (2 subgoals):
 1. convex (ball 0 1)
 2. \<And>z. z \<in> ball 0 1 \<Longrightarrow> ((\<lambda>x. Ln (1 + x) - (\<Sum>n. (- 1) ^ Suc n / of_nat n * x ^ n)) has_field_derivative 0) (at z within ball 0 1)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>z. Ln (1 + z) - (\<Sum>n. (- 1) ^ Suc n / of_nat n * z ^ n)) has_field_derivative 0) (at z within ball 0 1)
[PROOF STEP]
show "((\<lambda>z. ln (1 + z) - ?F z) has_field_derivative 0) (at z within ball 0 1)"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>z. Ln (1 + z) - (\<Sum>n. (- 1) ^ Suc n / of_nat n * z ^ n)) has_field_derivative 0) (at z within ball 0 1)

goal (1 subgoal):
 1. ((\<lambda>z. Ln (1 + z) - (\<Sum>n. (- 1) ^ Suc n / of_nat n * z ^ n)) has_field_derivative 0) (at z within ball 0 1)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
((\<lambda>z. Ln (1 + z) - (\<Sum>n. (- 1) ^ Suc n / of_nat n * z ^ n)) has_field_derivative 0) (at z within ball 0 1)

goal (1 subgoal):
 1. convex (ball 0 1)
[PROOF STEP]
qed simp_all
[PROOF STATE]
proof (state)
this:
\<exists>c. \<forall>z\<in>ball 0 1. Ln (1 + z) - (\<Sum>n. (- 1) ^ Suc n / of_nat n * z ^ n) = c

goal (1 subgoal):
 1. (\<lambda>n. (- 1) ^ Suc n / of_nat n * z ^ n) sums Ln (1 + z)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>c. \<forall>z\<in>ball 0 1. Ln (1 + z) - (\<Sum>n. (- 1) ^ Suc n / of_nat n * z ^ n) = c
[PROOF STEP]
obtain c where c: "\<And>z. z \<in> ball 0 1 \<Longrightarrow> ln (1 + z) - ?F z = c"
[PROOF STATE]
proof (prove)
using this:
\<exists>c. \<forall>z\<in>ball 0 1. Ln (1 + z) - (\<Sum>n. (- 1) ^ Suc n / of_nat n * z ^ n) = c

goal (1 subgoal):
 1. (\<And>c. (\<And>z. z \<in> ball 0 1 \<Longrightarrow> Ln (1 + z) - (\<Sum>n. (- 1) ^ Suc n / of_nat n * z ^ n) = c) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
?z \<in> ball 0 1 \<Longrightarrow> Ln (1 + ?z) - (\<Sum>n. (- 1) ^ Suc n / of_nat n * ?z ^ n) = c

goal (1 subgoal):
 1. (\<lambda>n. (- 1) ^ Suc n / of_nat n * z ^ n) sums Ln (1 + z)
[PROOF STEP]
from c[of 0]
[PROOF STATE]
proof (chain)
picking this:
0 \<in> ball 0 1 \<Longrightarrow> Ln (1 + 0) - (\<Sum>n. (- 1) ^ Suc n / of_nat n * 0 ^ n) = c
[PROOF STEP]
have "c = 0"
[PROOF STATE]
proof (prove)
using this:
0 \<in> ball 0 1 \<Longrightarrow> Ln (1 + 0) - (\<Sum>n. (- 1) ^ Suc n / of_nat n * 0 ^ n) = c

goal (1 subgoal):
 1. c = 0
[PROOF STEP]
by (simp only: powser_zero) simp
[PROOF STATE]
proof (state)
this:
c = 0

goal (1 subgoal):
 1. (\<lambda>n. (- 1) ^ Suc n / of_nat n * z ^ n) sums Ln (1 + z)
[PROOF STEP]
with c[of z] assms
[PROOF STATE]
proof (chain)
picking this:
z \<in> ball 0 1 \<Longrightarrow> Ln (1 + z) - (\<Sum>n. (- 1) ^ Suc n / of_nat n * z ^ n) = c
cmod z < 1
c = 0
[PROOF STEP]
have "ln (1 + z) = ?F z"
[PROOF STATE]
proof (prove)
using this:
z \<in> ball 0 1 \<Longrightarrow> Ln (1 + z) - (\<Sum>n. (- 1) ^ Suc n / of_nat n * z ^ n) = c
cmod z < 1
c = 0

goal (1 subgoal):
 1. Ln (1 + z) = (\<Sum>n. (- 1) ^ Suc n / of_nat n * z ^ n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Ln (1 + z) = (\<Sum>n. (- 1) ^ Suc n / of_nat n * z ^ n)

goal (1 subgoal):
 1. (\<lambda>n. (- 1) ^ Suc n / of_nat n * z ^ n) sums Ln (1 + z)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Ln (1 + z) = (\<Sum>n. (- 1) ^ Suc n / of_nat n * z ^ n)

goal (1 subgoal):
 1. (\<lambda>n. (- 1) ^ Suc n / of_nat n * z ^ n) sums Ln (1 + z)
[PROOF STEP]
have "summable (\<lambda>n. ?f n * z^n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. (- 1) ^ Suc n / of_nat n * z ^ n)
[PROOF STEP]
using assms r
[PROOF STATE]
proof (prove)
using this:
cmod z < 1
conv_radius (\<lambda>n. (- 1) ^ Suc n / of_nat n) = 1

goal (1 subgoal):
 1. summable (\<lambda>n. (- 1) ^ Suc n / of_nat n * z ^ n)
[PROOF STEP]
by (intro summable_in_conv_radius) simp_all
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. (- 1) ^ Suc n / of_nat n * z ^ n)

goal (1 subgoal):
 1. (\<lambda>n. (- 1) ^ Suc n / of_nat n * z ^ n) sums Ln (1 + z)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Ln (1 + z) = (\<Sum>n. (- 1) ^ Suc n / of_nat n * z ^ n)
summable (\<lambda>n. (- 1) ^ Suc n / of_nat n * z ^ n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Ln (1 + z) = (\<Sum>n. (- 1) ^ Suc n / of_nat n * z ^ n)
summable (\<lambda>n. (- 1) ^ Suc n / of_nat n * z ^ n)

goal (1 subgoal):
 1. (\<lambda>n. (- 1) ^ Suc n / of_nat n * z ^ n) sums Ln (1 + z)
[PROOF STEP]
by (simp add: sums_iff)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (- 1) ^ Suc n / of_nat n * z ^ n) sums Ln (1 + z)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma succ_tran_mono:
  "wf_graph \<lparr>nodes=N, edges=E\<rparr> \<Longrightarrow> E' \<subseteq> E \<Longrightarrow> succ_tran \<lparr>nodes=N, edges=E'\<rparr> v \<subseteq> succ_tran \<lparr>nodes=N, edges=E\<rparr> v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>wf_graph \<lparr>nodes = N, edges = E\<rparr>; E' \<subseteq> E\<rbrakk> \<Longrightarrow> succ_tran \<lparr>nodes = N, edges = E'\<rparr> v \<subseteq> succ_tran \<lparr>nodes = N, edges = E\<rparr> v
[PROOF STEP]
apply(drule wf_graph.finiteE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>E' \<subseteq> E; finite (edges \<lparr>nodes = N, edges = E\<rparr>)\<rbrakk> \<Longrightarrow> succ_tran \<lparr>nodes = N, edges = E'\<rparr> v \<subseteq> succ_tran \<lparr>nodes = N, edges = E\<rparr> v
[PROOF STEP]
apply(frule_tac A="E'" in rev_finite_subset, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>E' \<subseteq> E; finite (edges \<lparr>nodes = N, edges = E\<rparr>); finite E'\<rbrakk> \<Longrightarrow> succ_tran \<lparr>nodes = N, edges = E'\<rparr> v \<subseteq> succ_tran \<lparr>nodes = N, edges = E\<rparr> v
[PROOF STEP]
apply(simp add: num_reachable_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>E' \<subseteq> E; finite E; finite E'\<rbrakk> \<Longrightarrow> succ_tran \<lparr>nodes = N, edges = E'\<rparr> v \<subseteq> succ_tran \<lparr>nodes = N, edges = E\<rparr> v
[PROOF STEP]
apply(simp add: succ_tran_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>E' \<subseteq> E; finite E; finite E'\<rbrakk> \<Longrightarrow> {e2. (v, e2) \<in> E'\<^sup>+} \<subseteq> {e2. (v, e2) \<in> E\<^sup>+}
[PROOF STEP]
apply(metis (lifting, full_types) Collect_mono trancl_mono)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done

  \<comment> \<open>num_reachable\<close>


[STATEMENT]
lemma dvd_dvd_smult: "a dvd b \<Longrightarrow> f dvd g \<Longrightarrow> smult a f dvd smult b g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a dvd b; f dvd g\<rbrakk> \<Longrightarrow> smult a f dvd smult b g
[PROOF STEP]
unfolding dvd_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>k. b = a * k; \<exists>k. g = f * k\<rbrakk> \<Longrightarrow> \<exists>k. smult b g = smult a f * k
[PROOF STEP]
by (metis mult_smult_left mult_smult_right smult_smult)


[STATEMENT]
lemma the_sorted_list_of_map:
    assumes "distinct (map fst l)"
    assumes "sorted (map fst l)"
    shows "sorted_list_of_map (map_of l) = l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted_list_of_map (map_of l) = l
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sorted_list_of_map (map_of l) = l
[PROOF STEP]
have "dom (map_of l) = set (map fst l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dom (map_of l) = set (map fst l)
[PROOF STEP]
by (induct l) force+
[PROOF STATE]
proof (state)
this:
dom (map_of l) = set (map fst l)

goal (1 subgoal):
 1. sorted_list_of_map (map_of l) = l
[PROOF STEP]
hence "sorted_list_of_set (dom (map_of l)) = map fst l"
[PROOF STATE]
proof (prove)
using this:
dom (map_of l) = set (map fst l)

goal (1 subgoal):
 1. sorted_list_of_set (dom (map_of l)) = map fst l
[PROOF STEP]
using sorted_list_of_set.idem_if_sorted_distinct[OF assms(2,1)]
[PROOF STATE]
proof (prove)
using this:
dom (map_of l) = set (map fst l)
sorted_list_of_set (set (map fst l)) = map fst l

goal (1 subgoal):
 1. sorted_list_of_set (dom (map_of l)) = map fst l
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sorted_list_of_set (dom (map_of l)) = map fst l

goal (1 subgoal):
 1. sorted_list_of_map (map_of l) = l
[PROOF STEP]
hence "sorted_list_of_map (map_of l)
      = map (\<lambda>k. (k, the (map_of l k))) (map fst l)"
[PROOF STATE]
proof (prove)
using this:
sorted_list_of_set (dom (map_of l)) = map fst l

goal (1 subgoal):
 1. sorted_list_of_map (map_of l) = map (\<lambda>k. (k, the (map_of l k))) (map fst l)
[PROOF STEP]
unfolding sorted_list_of_map_def
[PROOF STATE]
proof (prove)
using this:
sorted_list_of_set (dom (map_of l)) = map fst l

goal (1 subgoal):
 1. map (\<lambda>k. (k, the (map_of l k))) (sorted_list_of_set (dom (map_of l))) = map (\<lambda>k. (k, the (map_of l k))) (map fst l)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sorted_list_of_map (map_of l) = map (\<lambda>k. (k, the (map_of l k))) (map fst l)

goal (1 subgoal):
 1. sorted_list_of_map (map_of l) = l
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sorted_list_of_map (map_of l) = map (\<lambda>k. (k, the (map_of l k))) (map fst l)

goal (1 subgoal):
 1. sorted_list_of_map (map_of l) = l
[PROOF STEP]
have "\<dots> = l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (\<lambda>k. (k, the (map_of l k))) (map fst l) = l
[PROOF STEP]
using \<open>distinct (map fst l)\<close>
[PROOF STATE]
proof (prove)
using this:
distinct (map fst l)

goal (1 subgoal):
 1. map (\<lambda>k. (k, the (map_of l k))) (map fst l) = l
[PROOF STEP]
proof (induct l)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. distinct (map fst []) \<Longrightarrow> map (\<lambda>k. (k, the (map_of [] k))) (map fst []) = []
 2. \<And>a l. \<lbrakk>distinct (map fst l) \<Longrightarrow> map (\<lambda>k. (k, the (map_of l k))) (map fst l) = l; distinct (map fst (a # l))\<rbrakk> \<Longrightarrow> map (\<lambda>k. (k, the (map_of (a # l) k))) (map fst (a # l)) = a # l
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
distinct (map fst [])

goal (2 subgoals):
 1. distinct (map fst []) \<Longrightarrow> map (\<lambda>k. (k, the (map_of [] k))) (map fst []) = []
 2. \<And>a l. \<lbrakk>distinct (map fst l) \<Longrightarrow> map (\<lambda>k. (k, the (map_of l k))) (map fst l) = l; distinct (map fst (a # l))\<rbrakk> \<Longrightarrow> map (\<lambda>k. (k, the (map_of (a # l) k))) (map fst (a # l)) = a # l
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
distinct (map fst [])

goal (1 subgoal):
 1. map (\<lambda>k. (k, the (map_of [] k))) (map fst []) = []
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
map (\<lambda>k. (k, the (map_of [] k))) (map fst []) = []

goal (1 subgoal):
 1. \<And>a l. \<lbrakk>distinct (map fst l) \<Longrightarrow> map (\<lambda>k. (k, the (map_of l k))) (map fst l) = l; distinct (map fst (a # l))\<rbrakk> \<Longrightarrow> map (\<lambda>k. (k, the (map_of (a # l) k))) (map fst (a # l)) = a # l
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a l. \<lbrakk>distinct (map fst l) \<Longrightarrow> map (\<lambda>k. (k, the (map_of l k))) (map fst l) = l; distinct (map fst (a # l))\<rbrakk> \<Longrightarrow> map (\<lambda>k. (k, the (map_of (a # l) k))) (map fst (a # l)) = a # l
[PROOF STEP]
case (Cons a l)
[PROOF STATE]
proof (state)
this:
distinct (map fst l) \<Longrightarrow> map (\<lambda>k. (k, the (map_of l k))) (map fst l) = l
distinct (map fst (a # l))

goal (1 subgoal):
 1. \<And>a l. \<lbrakk>distinct (map fst l) \<Longrightarrow> map (\<lambda>k. (k, the (map_of l k))) (map fst l) = l; distinct (map fst (a # l))\<rbrakk> \<Longrightarrow> map (\<lambda>k. (k, the (map_of (a # l) k))) (map fst (a # l)) = a # l
[PROOF STEP]
hence
        1: "distinct (map fst l)"
        and 2: "fst a\<notin>fst`set l"
        and 3: "map (\<lambda>k. (k, the (map_of l k))) (map fst l) = l"
[PROOF STATE]
proof (prove)
using this:
distinct (map fst l) \<Longrightarrow> map (\<lambda>k. (k, the (map_of l k))) (map fst l) = l
distinct (map fst (a # l))

goal (1 subgoal):
 1. distinct (map fst l) &&& fst a \<notin> fst ` set l &&& map (\<lambda>k. (k, the (map_of l k))) (map fst l) = l
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
distinct (map fst l)
fst a \<notin> fst ` set l
map (\<lambda>k. (k, the (map_of l k))) (map fst l) = l

goal (1 subgoal):
 1. \<And>a l. \<lbrakk>distinct (map fst l) \<Longrightarrow> map (\<lambda>k. (k, the (map_of l k))) (map fst l) = l; distinct (map fst (a # l))\<rbrakk> \<Longrightarrow> map (\<lambda>k. (k, the (map_of (a # l) k))) (map fst (a # l)) = a # l
[PROOF STEP]
from 2
[PROOF STATE]
proof (chain)
picking this:
fst a \<notin> fst ` set l
[PROOF STEP]
have [simp]: "\<not>(\<exists>x\<in>set l. fst x = fst a)"
[PROOF STATE]
proof (prove)
using this:
fst a \<notin> fst ` set l

goal (1 subgoal):
 1. \<not> (\<exists>x\<in>set l. fst x = fst a)
[PROOF STEP]
by (auto simp: image_iff)
[PROOF STATE]
proof (state)
this:
\<not> (\<exists>x\<in>set l. fst x = fst a)

goal (1 subgoal):
 1. \<And>a l. \<lbrakk>distinct (map fst l) \<Longrightarrow> map (\<lambda>k. (k, the (map_of l k))) (map fst l) = l; distinct (map fst (a # l))\<rbrakk> \<Longrightarrow> map (\<lambda>k. (k, the (map_of (a # l) k))) (map fst (a # l)) = a # l
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (\<lambda>k. (k, the (map_of (a # l) k))) (map fst (a # l)) = a # l
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map ((\<lambda>k. (k, the (if k = fst a then Some (snd a) else map_of l k))) \<circ> fst) l = l
[PROOF STEP]
apply (subst (3) 3[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map ((\<lambda>k. (k, the (if k = fst a then Some (snd a) else map_of l k))) \<circ> fst) l = map (\<lambda>k. (k, the (map_of l k))) (map fst l)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
map (\<lambda>k. (k, the (map_of (a # l) k))) (map fst (a # l)) = a # l

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
map (\<lambda>k. (k, the (map_of l k))) (map fst l) = l

goal (1 subgoal):
 1. sorted_list_of_map (map_of l) = l
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sorted_list_of_map (map_of l) = l
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sorted_list_of_map (map_of l) = l

goal (1 subgoal):
 1. sorted_list_of_map (map_of l) = l
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
sorted_list_of_map (map_of l) = l

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tendsto_rabs_zero: "(f \<longlongrightarrow> (0::real)) F \<Longrightarrow> ((\<lambda>x. \<bar>f x\<bar>) \<longlongrightarrow> 0) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<longlongrightarrow> 0) F \<Longrightarrow> ((\<lambda>x. \<bar>f x\<bar>) \<longlongrightarrow> 0) F
[PROOF STEP]
by (fold real_norm_def) (rule tendsto_norm_zero)


[STATEMENT]
lemma cos_minus1_imp_pi:
  assumes "cos x = -1" "x \<ge> 0" "x < 3 * pi"
  shows   "x = pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = pi
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x = pi
[PROOF STEP]
have "cos (x - pi) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos (x - pi) = 1
[PROOF STEP]
by (simp add: assms)
[PROOF STATE]
proof (state)
this:
cos (x - pi) = 1

goal (1 subgoal):
 1. x = pi
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
cos (x - pi) = 1
[PROOF STEP]
obtain n :: int where n: "of_int n = (x / pi - 1) / 2"
[PROOF STATE]
proof (prove)
using this:
cos (x - pi) = 1

goal (1 subgoal):
 1. (\<And>n. real_of_int n = (x / pi - 1) / 2 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (subst (asm) cos_one_2pi_int) (auto simp: field_simps)
[PROOF STATE]
proof (state)
this:
real_of_int n = (x / pi - 1) / 2

goal (1 subgoal):
 1. x = pi
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real_of_int n = (x / pi - 1) / 2

goal (1 subgoal):
 1. x = pi
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
cos x = - 1
0 \<le> x
x < 3 * pi
[PROOF STEP]
have "\<dots> \<in> {-1<..<1}"
[PROOF STATE]
proof (prove)
using this:
cos x = - 1
0 \<le> x
x < 3 * pi

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

goal (1 subgoal):
 1. x = pi
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
real_of_int n \<in> {- 1<..<1}
[PROOF STEP]
have "n = 0"
[PROOF STATE]
proof (prove)
using this:
real_of_int n \<in> {- 1<..<1}

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

goal (1 subgoal):
 1. x = pi
[PROOF STEP]
with n
[PROOF STATE]
proof (chain)
picking this:
real_of_int n = (x / pi - 1) / 2
n = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
real_of_int n = (x / pi - 1) / 2
n = 0

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma S_transform_Not [simp]: "S_transform (Not x) = Not (S_transform x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S_transform (Formula.Not x) = Formula.Not (S_transform x)
[PROOF STEP]
unfolding S_transform_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs_formula (S_transform_formula (Formula.Not x)) = Formula.Not (Abs_formula (S_transform_formula x))
[PROOF STEP]
by (simp add: Not.abs_eq eq_onp_same_args)


[STATEMENT]
lemma liouville_lambda_power_odd:
  "odd m \<Longrightarrow> liouville_lambda (n ^ m) = liouville_lambda n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. odd m \<Longrightarrow> liouville_lambda (n ^ m) = liouville_lambda n
[PROOF STEP]
by (subst liouville_lambda.power) (auto elim!: oddE simp: liouville_lambda_def power_neg_one_If)


[STATEMENT]
lemma le_nhds_metric: "F \<le> nhds a \<longleftrightarrow> (\<forall>e>0. eventually (\<lambda>x. dist x a < e) F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (F \<le> nhds a) = (\<forall>e>0. \<forall>\<^sub>F x in F. dist x a < e)
[PROOF STEP]
unfolding le_filter_def eventually_nhds_metric
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>P. (\<exists>d>0. \<forall>x. dist x a < d \<longrightarrow> P x) \<longrightarrow> eventually P F) = (\<forall>e>0. \<forall>\<^sub>F x in F. dist x a < e)
[PROOF STEP]
by (fast elim: eventually_mono)


[STATEMENT]
lemma bv_add_length: "length (bv_add w1 w2) \<le> Suc (max (length w1) (length w2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (bv_add w1 w2) \<le> Suc (max (length w1) (length w2))
[PROOF STEP]
proof (unfold bv_add_def,rule length_nat_to_bv_upper_limit)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bv_to_nat w1 + bv_to_nat w2 \<le> 2 ^ Suc (max (length w1) (length w2)) - 1
[PROOF STEP]
from bv_to_nat_upper_range [of w1] and bv_to_nat_upper_range [of w2]
[PROOF STATE]
proof (chain)
picking this:
bv_to_nat w1 < 2 ^ length w1
bv_to_nat w2 < 2 ^ length w2
[PROOF STEP]
have "bv_to_nat w1 + bv_to_nat w2 \<le> (2 ^ length w1 - 1) + (2 ^ length w2 - 1)"
[PROOF STATE]
proof (prove)
using this:
bv_to_nat w1 < 2 ^ length w1
bv_to_nat w2 < 2 ^ length w2

goal (1 subgoal):
 1. bv_to_nat w1 + bv_to_nat w2 \<le> 2 ^ length w1 - 1 + (2 ^ length w2 - 1)
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
bv_to_nat w1 + bv_to_nat w2 \<le> 2 ^ length w1 - 1 + (2 ^ length w2 - 1)

goal (1 subgoal):
 1. bv_to_nat w1 + bv_to_nat w2 \<le> 2 ^ Suc (max (length w1) (length w2)) - 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
bv_to_nat w1 + bv_to_nat w2 \<le> 2 ^ length w1 - 1 + (2 ^ length w2 - 1)

goal (1 subgoal):
 1. bv_to_nat w1 + bv_to_nat w2 \<le> 2 ^ Suc (max (length w1) (length w2)) - 1
[PROOF STEP]
have "... \<le>
      max (2 ^ length w1 - 1) (2 ^ length w2 - 1) + max (2 ^ length w1 - 1) (2 ^ length w2 - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ length w1 - 1 + (2 ^ length w2 - 1) \<le> max (2 ^ length w1 - 1) (2 ^ length w2 - 1) + max (2 ^ length w1 - 1) (2 ^ length w2 - 1)
[PROOF STEP]
by (rule add_mono,safe intro!: max.cobounded1 max.cobounded2)
[PROOF STATE]
proof (state)
this:
2 ^ length w1 - 1 + (2 ^ length w2 - 1) \<le> max (2 ^ length w1 - 1) (2 ^ length w2 - 1) + max (2 ^ length w1 - 1) (2 ^ length w2 - 1)

goal (1 subgoal):
 1. bv_to_nat w1 + bv_to_nat w2 \<le> 2 ^ Suc (max (length w1) (length w2)) - 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
2 ^ length w1 - 1 + (2 ^ length w2 - 1) \<le> max (2 ^ length w1 - 1) (2 ^ length w2 - 1) + max (2 ^ length w1 - 1) (2 ^ length w2 - 1)

goal (1 subgoal):
 1. bv_to_nat w1 + bv_to_nat w2 \<le> 2 ^ Suc (max (length w1) (length w2)) - 1
[PROOF STEP]
have "... = 2 * max (2 ^ length w1 - 1) (2 ^ length w2 - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. max (2 ^ length w1 - 1) (2 ^ length w2 - 1) + max (2 ^ length w1 - 1) (2 ^ length w2 - 1) = 2 * max (2 ^ length w1 - 1) (2 ^ length w2 - 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
max (2 ^ length w1 - 1) (2 ^ length w2 - 1) + max (2 ^ length w1 - 1) (2 ^ length w2 - 1) = 2 * max (2 ^ length w1 - 1) (2 ^ length w2 - 1)

goal (1 subgoal):
 1. bv_to_nat w1 + bv_to_nat w2 \<le> 2 ^ Suc (max (length w1) (length w2)) - 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
max (2 ^ length w1 - 1) (2 ^ length w2 - 1) + max (2 ^ length w1 - 1) (2 ^ length w2 - 1) = 2 * max (2 ^ length w1 - 1) (2 ^ length w2 - 1)

goal (1 subgoal):
 1. bv_to_nat w1 + bv_to_nat w2 \<le> 2 ^ Suc (max (length w1) (length w2)) - 1
[PROOF STEP]
have "... \<le> 2 ^ Suc (max (length w1) (length w2)) - 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * max (2 ^ length w1 - 1) (2 ^ length w2 - 1) \<le> 2 ^ Suc (max (length w1) (length w2)) - 2
[PROOF STEP]
proof (cases "length w1 \<le> length w2")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. length w1 \<le> length w2 \<Longrightarrow> 2 * max (2 ^ length w1 - 1) (2 ^ length w2 - 1) \<le> 2 ^ Suc (max (length w1) (length w2)) - 2
 2. \<not> length w1 \<le> length w2 \<Longrightarrow> 2 * max (2 ^ length w1 - 1) (2 ^ length w2 - 1) \<le> 2 ^ Suc (max (length w1) (length w2)) - 2
[PROOF STEP]
assume w1w2: "length w1 \<le> length w2"
[PROOF STATE]
proof (state)
this:
length w1 \<le> length w2

goal (2 subgoals):
 1. length w1 \<le> length w2 \<Longrightarrow> 2 * max (2 ^ length w1 - 1) (2 ^ length w2 - 1) \<le> 2 ^ Suc (max (length w1) (length w2)) - 2
 2. \<not> length w1 \<le> length w2 \<Longrightarrow> 2 * max (2 ^ length w1 - 1) (2 ^ length w2 - 1) \<le> 2 ^ Suc (max (length w1) (length w2)) - 2
[PROOF STEP]
hence "(2::nat) ^ length w1 \<le> 2 ^ length w2"
[PROOF STATE]
proof (prove)
using this:
length w1 \<le> length w2

goal (1 subgoal):
 1. 2 ^ length w1 \<le> 2 ^ length w2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 ^ length w1 \<le> 2 ^ length w2

goal (2 subgoals):
 1. length w1 \<le> length w2 \<Longrightarrow> 2 * max (2 ^ length w1 - 1) (2 ^ length w2 - 1) \<le> 2 ^ Suc (max (length w1) (length w2)) - 2
 2. \<not> length w1 \<le> length w2 \<Longrightarrow> 2 * max (2 ^ length w1 - 1) (2 ^ length w2 - 1) \<le> 2 ^ Suc (max (length w1) (length w2)) - 2
[PROOF STEP]
hence "(2::nat) ^ length w1 - 1 \<le> 2 ^ length w2 - 1"
[PROOF STATE]
proof (prove)
using this:
2 ^ length w1 \<le> 2 ^ length w2

goal (1 subgoal):
 1. 2 ^ length w1 - 1 \<le> 2 ^ length w2 - 1
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
2 ^ length w1 - 1 \<le> 2 ^ length w2 - 1

goal (2 subgoals):
 1. length w1 \<le> length w2 \<Longrightarrow> 2 * max (2 ^ length w1 - 1) (2 ^ length w2 - 1) \<le> 2 ^ Suc (max (length w1) (length w2)) - 2
 2. \<not> length w1 \<le> length w2 \<Longrightarrow> 2 * max (2 ^ length w1 - 1) (2 ^ length w2 - 1) \<le> 2 ^ Suc (max (length w1) (length w2)) - 2
[PROOF STEP]
with w1w2
[PROOF STATE]
proof (chain)
picking this:
length w1 \<le> length w2
2 ^ length w1 - 1 \<le> 2 ^ length w2 - 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
length w1 \<le> length w2
2 ^ length w1 - 1 \<le> 2 ^ length w2 - 1

goal (1 subgoal):
 1. 2 * max (2 ^ length w1 - 1) (2 ^ length w2 - 1) \<le> 2 ^ Suc (max (length w1) (length w2)) - 2
[PROOF STEP]
by (simp add: diff_mult_distrib2 split: split_max)
[PROOF STATE]
proof (state)
this:
2 * max (2 ^ length w1 - 1) (2 ^ length w2 - 1) \<le> 2 ^ Suc (max (length w1) (length w2)) - 2

goal (1 subgoal):
 1. \<not> length w1 \<le> length w2 \<Longrightarrow> 2 * max (2 ^ length w1 - 1) (2 ^ length w2 - 1) \<le> 2 ^ Suc (max (length w1) (length w2)) - 2
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> length w1 \<le> length w2 \<Longrightarrow> 2 * max (2 ^ length w1 - 1) (2 ^ length w2 - 1) \<le> 2 ^ Suc (max (length w1) (length w2)) - 2
[PROOF STEP]
assume [simp]: "~ (length w1 \<le> length w2)"
[PROOF STATE]
proof (state)
this:
\<not> length w1 \<le> length w2

goal (1 subgoal):
 1. \<not> length w1 \<le> length w2 \<Longrightarrow> 2 * max (2 ^ length w1 - 1) (2 ^ length w2 - 1) \<le> 2 ^ Suc (max (length w1) (length w2)) - 2
[PROOF STEP]
have "~ ((2::nat) ^ length w1 - 1 \<le> 2 ^ length w2 - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> 2 ^ length w1 - 1 \<le> 2 ^ length w2 - 1
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 2 ^ length w1 - 1 \<le> 2 ^ length w2 - 1 \<Longrightarrow> False
[PROOF STEP]
assume "(2::nat) ^ length w1 - 1 \<le> 2 ^ length w2 - 1"
[PROOF STATE]
proof (state)
this:
2 ^ length w1 - 1 \<le> 2 ^ length w2 - 1

goal (1 subgoal):
 1. 2 ^ length w1 - 1 \<le> 2 ^ length w2 - 1 \<Longrightarrow> False
[PROOF STEP]
hence "((2::nat) ^ length w1 - 1) + 1 \<le> (2 ^ length w2 - 1) + 1"
[PROOF STATE]
proof (prove)
using this:
2 ^ length w1 - 1 \<le> 2 ^ length w2 - 1

goal (1 subgoal):
 1. 2 ^ length w1 - 1 + 1 \<le> 2 ^ length w2 - 1 + 1
[PROOF STEP]
by (rule add_right_mono)
[PROOF STATE]
proof (state)
this:
2 ^ length w1 - 1 + 1 \<le> 2 ^ length w2 - 1 + 1

goal (1 subgoal):
 1. 2 ^ length w1 - 1 \<le> 2 ^ length w2 - 1 \<Longrightarrow> False
[PROOF STEP]
hence "(2::nat) ^ length w1 \<le> 2 ^ length w2"
[PROOF STATE]
proof (prove)
using this:
2 ^ length w1 - 1 + 1 \<le> 2 ^ length w2 - 1 + 1

goal (1 subgoal):
 1. 2 ^ length w1 \<le> 2 ^ length w2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 ^ length w1 \<le> 2 ^ length w2

goal (1 subgoal):
 1. 2 ^ length w1 - 1 \<le> 2 ^ length w2 - 1 \<Longrightarrow> False
[PROOF STEP]
hence "length w1 \<le> length w2"
[PROOF STATE]
proof (prove)
using this:
2 ^ length w1 \<le> 2 ^ length w2

goal (1 subgoal):
 1. length w1 \<le> length w2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length w1 \<le> length w2

goal (1 subgoal):
 1. 2 ^ length w1 - 1 \<le> 2 ^ length w2 - 1 \<Longrightarrow> False
[PROOF STEP]
thus False
[PROOF STATE]
proof (prove)
using this:
length w1 \<le> length w2

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<not> 2 ^ length w1 - 1 \<le> 2 ^ length w2 - 1

goal (1 subgoal):
 1. \<not> length w1 \<le> length w2 \<Longrightarrow> 2 * max (2 ^ length w1 - 1) (2 ^ length w2 - 1) \<le> 2 ^ Suc (max (length w1) (length w2)) - 2
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> 2 ^ length w1 - 1 \<le> 2 ^ length w2 - 1

goal (1 subgoal):
 1. 2 * max (2 ^ length w1 - 1) (2 ^ length w2 - 1) \<le> 2 ^ Suc (max (length w1) (length w2)) - 2
[PROOF STEP]
by (simp add: diff_mult_distrib2 split: split_max)
[PROOF STATE]
proof (state)
this:
2 * max (2 ^ length w1 - 1) (2 ^ length w2 - 1) \<le> 2 ^ Suc (max (length w1) (length w2)) - 2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
2 * max (2 ^ length w1 - 1) (2 ^ length w2 - 1) \<le> 2 ^ Suc (max (length w1) (length w2)) - 2

goal (1 subgoal):
 1. bv_to_nat w1 + bv_to_nat w2 \<le> 2 ^ Suc (max (length w1) (length w2)) - 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
bv_to_nat w1 + bv_to_nat w2 \<le> 2 ^ Suc (max (length w1) (length w2)) - 2
[PROOF STEP]
show "bv_to_nat w1 + bv_to_nat w2 \<le> 2 ^ Suc (max (length w1) (length w2)) - 1"
[PROOF STATE]
proof (prove)
using this:
bv_to_nat w1 + bv_to_nat w2 \<le> 2 ^ Suc (max (length w1) (length w2)) - 2

goal (1 subgoal):
 1. bv_to_nat w1 + bv_to_nat w2 \<le> 2 ^ Suc (max (length w1) (length w2)) - 1
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
bv_to_nat w1 + bv_to_nat w2 \<le> 2 ^ Suc (max (length w1) (length w2)) - 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma real_transfer_operator_cmult [intro, simp]:
  fixes c::real
  assumes "integrable M f"
  shows "AE x in M. real_transfer_operator (\<lambda>x. c * f x) x = c * real_transfer_operator f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in M. real_transfer_operator (\<lambda>x. c * f x) x = c * real_transfer_operator f x
[PROOF STEP]
by (rule real_transfer_operator_foT_g) (auto simp add: assms borel_measurable_integrable)


[STATEMENT]
lemma isCont_cdf: "isCont (cdf M) x \<longleftrightarrow> measure M {x} = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont (cdf M) x = (Sigma_Algebra.measure M {x} = 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. isCont (cdf M) x = (Sigma_Algebra.measure M {x} = 0)
[PROOF STEP]
have "isCont (cdf M) x \<longleftrightarrow> cdf M x = measure M {..<x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont (cdf M) x = (cdf M x = Sigma_Algebra.measure M {..<x})
[PROOF STEP]
by (auto simp: continuous_at_split cdf_is_right_cont continuous_within[where s="{..< _}"]
                   cdf_at_left tendsto_unique[OF _ cdf_at_left])
[PROOF STATE]
proof (state)
this:
isCont (cdf M) x = (cdf M x = Sigma_Algebra.measure M {..<x})

goal (1 subgoal):
 1. isCont (cdf M) x = (Sigma_Algebra.measure M {x} = 0)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
isCont (cdf M) x = (cdf M x = Sigma_Algebra.measure M {..<x})

goal (1 subgoal):
 1. isCont (cdf M) x = (Sigma_Algebra.measure M {x} = 0)
[PROOF STEP]
have "cdf M x = measure M {..<x} \<longleftrightarrow> measure M {x} = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (cdf M x = Sigma_Algebra.measure M {..<x}) = (Sigma_Algebra.measure M {x} = 0)
[PROOF STEP]
unfolding cdf_def ivl_disj_un(2)[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Sigma_Algebra.measure M ({..<x} \<union> {x}) = Sigma_Algebra.measure M {..<x}) = (Sigma_Algebra.measure M {x} = 0)
[PROOF STEP]
by (subst finite_measure_Union) auto
[PROOF STATE]
proof (state)
this:
(cdf M x = Sigma_Algebra.measure M {..<x}) = (Sigma_Algebra.measure M {x} = 0)

goal (1 subgoal):
 1. isCont (cdf M) x = (Sigma_Algebra.measure M {x} = 0)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
isCont (cdf M) x = (Sigma_Algebra.measure M {x} = 0)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
isCont (cdf M) x = (Sigma_Algebra.measure M {x} = 0)

goal (1 subgoal):
 1. isCont (cdf M) x = (Sigma_Algebra.measure M {x} = 0)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
isCont (cdf M) x = (Sigma_Algebra.measure M {x} = 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma listrel_converse: "listrel(r^-1) = (listrel r)^-1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. listrel (r\<inverse>) = (listrel r)\<inverse>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. listrel (r\<inverse>) = (listrel r)\<inverse>
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. listrel (r\<inverse>) = (listrel r)\<inverse>
[PROOF STEP]
fix xs ys
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. listrel (r\<inverse>) = (listrel r)\<inverse>
[PROOF STEP]
have "(xs,ys) : listrel(r^-1) \<longleftrightarrow> (ys,xs) : listrel r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((xs, ys) \<in> listrel (r\<inverse>)) = ((ys, xs) \<in> listrel r)
[PROOF STEP]
apply(induct xs arbitrary: ys)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>ys. (([], ys) \<in> listrel (r\<inverse>)) = ((ys, []) \<in> listrel r)
 2. \<And>a xs ys. (\<And>ys. ((xs, ys) \<in> listrel (r\<inverse>)) = ((ys, xs) \<in> listrel r)) \<Longrightarrow> ((a # xs, ys) \<in> listrel (r\<inverse>)) = ((ys, a # xs) \<in> listrel r)
[PROOF STEP]
apply (fastforce simp: listrel.Nil)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a xs ys. (\<And>ys. ((xs, ys) \<in> listrel (r\<inverse>)) = ((ys, xs) \<in> listrel r)) \<Longrightarrow> ((a # xs, ys) \<in> listrel (r\<inverse>)) = ((ys, a # xs) \<in> listrel r)
[PROOF STEP]
apply (fastforce simp: listrel_Cons_iff)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
((xs, ys) \<in> listrel (r\<inverse>)) = ((ys, xs) \<in> listrel r)

goal (1 subgoal):
 1. listrel (r\<inverse>) = (listrel r)\<inverse>
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
((?xs2, ?ys2) \<in> listrel (r\<inverse>)) = ((?ys2, ?xs2) \<in> listrel r)

goal (1 subgoal):
 1. listrel (r\<inverse>) = (listrel r)\<inverse>
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
((?xs2, ?ys2) \<in> listrel (r\<inverse>)) = ((?ys2, ?xs2) \<in> listrel r)

goal (1 subgoal):
 1. listrel (r\<inverse>) = (listrel r)\<inverse>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
listrel (r\<inverse>) = (listrel r)\<inverse>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prime_elem_gauss_int_of_nat:
  fixes n :: nat
  assumes prime: "prime n" and "[n = 3] (mod 4)"
  shows   "prime_elem (of_nat n :: gauss_int)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime_elem (of_nat n)
[PROOF STEP]
proof (intro irreducible_imp_prime_elem irreducibleI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. of_nat n \<noteq> 0
 2. \<not> is_unit (of_nat n)
 3. \<And>a b. of_nat n = a * b \<Longrightarrow> is_unit a \<or> is_unit b
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
prime n
[n = 3] (mod 4)
[PROOF STEP]
show "of_nat n \<noteq> (0 :: gauss_int)"
[PROOF STATE]
proof (prove)
using this:
prime n
[n = 3] (mod 4)

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

goal (2 subgoals):
 1. \<not> is_unit (of_nat n)
 2. \<And>a b. of_nat n = a * b \<Longrightarrow> is_unit a \<or> is_unit b
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<not> is_unit (of_nat n)
 2. \<And>a b. of_nat n = a * b \<Longrightarrow> is_unit a \<or> is_unit b
[PROOF STEP]
show "\<not>is_unit (of_nat n :: gauss_int)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> is_unit (of_nat n)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
prime n
[n = 3] (mod 4)

goal (1 subgoal):
 1. \<not> is_unit (of_nat n)
[PROOF STEP]
by (subst is_unit_gauss_int_iff) (auto simp: gauss_int_eq_iff)
[PROOF STATE]
proof (state)
this:
\<not> is_unit (of_nat n)

goal (1 subgoal):
 1. \<And>a b. of_nat n = a * b \<Longrightarrow> is_unit a \<or> is_unit b
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. of_nat n = a * b \<Longrightarrow> is_unit a \<or> is_unit b
[PROOF STEP]
fix a b :: gauss_int
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. of_nat n = a * b \<Longrightarrow> is_unit a \<or> is_unit b
[PROOF STEP]
assume *: "of_nat n = a * b"
[PROOF STATE]
proof (state)
this:
of_nat n = a * b

goal (1 subgoal):
 1. \<And>a b. of_nat n = a * b \<Longrightarrow> is_unit a \<or> is_unit b
[PROOF STEP]
hence "gauss_int_norm (a * b) = gauss_int_norm (of_nat n)"
[PROOF STATE]
proof (prove)
using this:
of_nat n = a * b

goal (1 subgoal):
 1. gauss_int_norm (a * b) = gauss_int_norm (of_nat n)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
gauss_int_norm (a * b) = gauss_int_norm (of_nat n)

goal (1 subgoal):
 1. \<And>a b. of_nat n = a * b \<Longrightarrow> is_unit a \<or> is_unit b
[PROOF STEP]
hence *: "gauss_int_norm a * gauss_int_norm b = n ^ 2"
[PROOF STATE]
proof (prove)
using this:
gauss_int_norm (a * b) = gauss_int_norm (of_nat n)

goal (1 subgoal):
 1. gauss_int_norm a * gauss_int_norm b = n\<^sup>2
[PROOF STEP]
by (simp add: gauss_int_norm_mult power2_eq_square flip: nat_mult_distrib)
[PROOF STATE]
proof (state)
this:
gauss_int_norm a * gauss_int_norm b = n\<^sup>2

goal (1 subgoal):
 1. \<And>a b. of_nat n = a * b \<Longrightarrow> is_unit a \<or> is_unit b
[PROOF STEP]
from prime_power_mult_nat[OF prime this]
[PROOF STATE]
proof (chain)
picking this:
\<exists>i j. gauss_int_norm a = n ^ i \<and> gauss_int_norm b = n ^ j
[PROOF STEP]
obtain i j :: nat
    where ij: "gauss_int_norm a = n ^ i" "gauss_int_norm b = n ^ j"
[PROOF STATE]
proof (prove)
using this:
\<exists>i j. gauss_int_norm a = n ^ i \<and> gauss_int_norm b = n ^ j

goal (1 subgoal):
 1. (\<And>i j. \<lbrakk>gauss_int_norm a = n ^ i; gauss_int_norm b = n ^ j\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
gauss_int_norm a = n ^ i
gauss_int_norm b = n ^ j

goal (1 subgoal):
 1. \<And>a b. of_nat n = a * b \<Longrightarrow> is_unit a \<or> is_unit b
[PROOF STEP]
have "i + j = 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i + j = 2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. i + j = 2
[PROOF STEP]
have "n ^ (i + j) = n ^ 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n ^ (i + j) = n\<^sup>2
[PROOF STEP]
using ij *
[PROOF STATE]
proof (prove)
using this:
gauss_int_norm a = n ^ i
gauss_int_norm b = n ^ j
gauss_int_norm a * gauss_int_norm b = n\<^sup>2

goal (1 subgoal):
 1. n ^ (i + j) = n\<^sup>2
[PROOF STEP]
by (simp add: power_add)
[PROOF STATE]
proof (state)
this:
n ^ (i + j) = n\<^sup>2

goal (1 subgoal):
 1. i + j = 2
[PROOF STEP]
from prime_power_inj[OF prime this]
[PROOF STATE]
proof (chain)
picking this:
i + j = 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
i + j = 2

goal (1 subgoal):
 1. i + j = 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
i + j = 2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
i + j = 2

goal (1 subgoal):
 1. \<And>a b. of_nat n = a * b \<Longrightarrow> is_unit a \<or> is_unit b
[PROOF STEP]
hence "i = 0 \<and> j = 2 \<or> i = 1 \<and> j = 1 \<or> i = 2 \<and> j = 0"
[PROOF STATE]
proof (prove)
using this:
i + j = 2

goal (1 subgoal):
 1. i = 0 \<and> j = 2 \<or> i = 1 \<and> j = 1 \<or> i = 2 \<and> j = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i = 0 \<and> j = 2 \<or> i = 1 \<and> j = 1 \<or> i = 2 \<and> j = 0

goal (1 subgoal):
 1. \<And>a b. of_nat n = a * b \<Longrightarrow> is_unit a \<or> is_unit b
[PROOF STEP]
thus "is_unit a \<or> is_unit b"
[PROOF STATE]
proof (prove)
using this:
i = 0 \<and> j = 2 \<or> i = 1 \<and> j = 1 \<or> i = 2 \<and> j = 0

goal (1 subgoal):
 1. is_unit a \<or> is_unit b
[PROOF STEP]
proof (elim disjE)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. i = 0 \<and> j = 2 \<Longrightarrow> is_unit a \<or> is_unit b
 2. i = 1 \<and> j = 1 \<Longrightarrow> is_unit a \<or> is_unit b
 3. i = 2 \<and> j = 0 \<Longrightarrow> is_unit a \<or> is_unit b
[PROOF STEP]
assume "i = 1 \<and> j = 1"
[PROOF STATE]
proof (state)
this:
i = 1 \<and> j = 1

goal (3 subgoals):
 1. i = 0 \<and> j = 2 \<Longrightarrow> is_unit a \<or> is_unit b
 2. i = 1 \<and> j = 1 \<Longrightarrow> is_unit a \<or> is_unit b
 3. i = 2 \<and> j = 0 \<Longrightarrow> is_unit a \<or> is_unit b
[PROOF STEP]
with ij
[PROOF STATE]
proof (chain)
picking this:
gauss_int_norm a = n ^ i
gauss_int_norm b = n ^ j
i = 1 \<and> j = 1
[PROOF STEP]
have "gauss_int_norm a = n"
[PROOF STATE]
proof (prove)
using this:
gauss_int_norm a = n ^ i
gauss_int_norm b = n ^ j
i = 1 \<and> j = 1

goal (1 subgoal):
 1. gauss_int_norm a = n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
gauss_int_norm a = n

goal (3 subgoals):
 1. i = 0 \<and> j = 2 \<Longrightarrow> is_unit a \<or> is_unit b
 2. i = 1 \<and> j = 1 \<Longrightarrow> is_unit a \<or> is_unit b
 3. i = 2 \<and> j = 0 \<Longrightarrow> is_unit a \<or> is_unit b
[PROOF STEP]
hence "[gauss_int_norm a = n] (mod 4)"
[PROOF STATE]
proof (prove)
using this:
gauss_int_norm a = n

goal (1 subgoal):
 1. [gauss_int_norm a = n] (mod 4)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
[gauss_int_norm a = n] (mod 4)

goal (3 subgoals):
 1. i = 0 \<and> j = 2 \<Longrightarrow> is_unit a \<or> is_unit b
 2. i = 1 \<and> j = 1 \<Longrightarrow> is_unit a \<or> is_unit b
 3. i = 2 \<and> j = 0 \<Longrightarrow> is_unit a \<or> is_unit b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
[gauss_int_norm a = n] (mod 4)

goal (3 subgoals):
 1. i = 0 \<and> j = 2 \<Longrightarrow> is_unit a \<or> is_unit b
 2. i = 1 \<and> j = 1 \<Longrightarrow> is_unit a \<or> is_unit b
 3. i = 2 \<and> j = 0 \<Longrightarrow> is_unit a \<or> is_unit b
[PROOF STEP]
have "[n = 3] (mod 4)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [n = 3] (mod 4)
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
[n = 3] (mod 4)

goal (3 subgoals):
 1. i = 0 \<and> j = 2 \<Longrightarrow> is_unit a \<or> is_unit b
 2. i = 1 \<and> j = 1 \<Longrightarrow> is_unit a \<or> is_unit b
 3. i = 2 \<and> j = 0 \<Longrightarrow> is_unit a \<or> is_unit b
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
[gauss_int_norm a = 3] (mod 4)
[PROOF STEP]
have "[gauss_int_norm a = 3] (mod 4)"
[PROOF STATE]
proof (prove)
using this:
[gauss_int_norm a = 3] (mod 4)

goal (1 subgoal):
 1. [gauss_int_norm a = 3] (mod 4)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
[gauss_int_norm a = 3] (mod 4)

goal (3 subgoals):
 1. i = 0 \<and> j = 2 \<Longrightarrow> is_unit a \<or> is_unit b
 2. i = 1 \<and> j = 1 \<Longrightarrow> is_unit a \<or> is_unit b
 3. i = 2 \<and> j = 0 \<Longrightarrow> is_unit a \<or> is_unit b
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
[gauss_int_norm a = 3] (mod 4)

goal (3 subgoals):
 1. i = 0 \<and> j = 2 \<Longrightarrow> is_unit a \<or> is_unit b
 2. i = 1 \<and> j = 1 \<Longrightarrow> is_unit a \<or> is_unit b
 3. i = 2 \<and> j = 0 \<Longrightarrow> is_unit a \<or> is_unit b
[PROOF STEP]
have "[gauss_int_norm a \<noteq> 3] (mod 4)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [gauss_int_norm a \<noteq> 3] (mod 4)
[PROOF STEP]
by (rule gauss_int_norm_not_3_mod_4)
[PROOF STATE]
proof (state)
this:
[gauss_int_norm a \<noteq> 3] (mod 4)

goal (3 subgoals):
 1. i = 0 \<and> j = 2 \<Longrightarrow> is_unit a \<or> is_unit b
 2. i = 1 \<and> j = 1 \<Longrightarrow> is_unit a \<or> is_unit b
 3. i = 2 \<and> j = 0 \<Longrightarrow> is_unit a \<or> is_unit b
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
[gauss_int_norm a = 3] (mod 4)
[gauss_int_norm a \<noteq> 3] (mod 4)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
[gauss_int_norm a = 3] (mod 4)
[gauss_int_norm a \<noteq> 3] (mod 4)

goal (1 subgoal):
 1. is_unit a \<or> is_unit b
[PROOF STEP]
by contradiction
[PROOF STATE]
proof (state)
this:
is_unit a \<or> is_unit b

goal (2 subgoals):
 1. i = 0 \<and> j = 2 \<Longrightarrow> is_unit a \<or> is_unit b
 2. i = 2 \<and> j = 0 \<Longrightarrow> is_unit a \<or> is_unit b
[PROOF STEP]
qed (use ij in \<open>auto simp: is_unit_gauss_int_iff'\<close>)
[PROOF STATE]
proof (state)
this:
is_unit a \<or> is_unit b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma all_edges_betw_prod_def_neighbors: "all_edges_between X Y = {(x, y) \<in> X \<times> Y . vert_adj x y }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. all_edges_between X Y = {(x, y). (x, y) \<in> X \<times> Y \<and> vert_adj x y}
[PROOF STEP]
by (auto simp: vert_adj_def all_edges_between_def)


[STATEMENT]
lemma fin_U_imp_wf:
  assumes "finite U"
  shows "wf (gen_dfs_var U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf (gen_dfs_var U)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite U

goal (1 subgoal):
 1. wf (gen_dfs_var U)
[PROOF STEP]
unfolding gen_dfs_var_def
[PROOF STATE]
proof (prove)
using this:
finite U

goal (1 subgoal):
 1. wf (finite_psupset U)
[PROOF STEP]
by auto


[STATEMENT]
lemma map_poly_dvd:
  fixes p q::"real poly"
  assumes hdvd: "map_poly complex_of_real p dvd
                    map_poly complex_of_real q" "q \<noteq> 0"
  shows "p dvd q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p dvd q
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p dvd q
[PROOF STEP]
from hdvd
[PROOF STATE]
proof (chain)
picking this:
map_poly complex_of_real p dvd map_poly complex_of_real q
q \<noteq> 0
[PROOF STEP]
obtain r
    where h:"map_poly complex_of_real q = r * map_poly complex_of_real p"
[PROOF STATE]
proof (prove)
using this:
map_poly complex_of_real p dvd map_poly complex_of_real q
q \<noteq> 0

goal (1 subgoal):
 1. (\<And>r. map_poly complex_of_real q = r * map_poly complex_of_real p \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
map_poly complex_of_real q = r * map_poly complex_of_real p

goal (1 subgoal):
 1. p dvd q
[PROOF STEP]
hence "r = map_poly complex_of_real (map_poly Re r)"
[PROOF STATE]
proof (prove)
using this:
map_poly complex_of_real q = r * map_poly complex_of_real p

goal (1 subgoal):
 1. r = map_poly complex_of_real (map_poly Re r)
[PROOF STEP]
using mult_map_poly_imp_map_poly assms
[PROOF STATE]
proof (prove)
using this:
map_poly complex_of_real q = r * map_poly complex_of_real p
\<lbrakk>map_poly complex_of_real ?q = ?r * map_poly complex_of_real ?p; ?p \<noteq> 0\<rbrakk> \<Longrightarrow> ?r = map_poly complex_of_real (map_poly Re ?r)
map_poly complex_of_real p dvd map_poly complex_of_real q
q \<noteq> 0

goal (1 subgoal):
 1. r = map_poly complex_of_real (map_poly Re r)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
r = map_poly complex_of_real (map_poly Re r)

goal (1 subgoal):
 1. p dvd q
[PROOF STEP]
hence "map_poly complex_of_real q = map_poly complex_of_real (p * map_poly Re r)"
[PROOF STATE]
proof (prove)
using this:
r = map_poly complex_of_real (map_poly Re r)

goal (1 subgoal):
 1. map_poly complex_of_real q = map_poly complex_of_real (p * map_poly Re r)
[PROOF STEP]
using h
[PROOF STATE]
proof (prove)
using this:
r = map_poly complex_of_real (map_poly Re r)
map_poly complex_of_real q = r * map_poly complex_of_real p

goal (1 subgoal):
 1. map_poly complex_of_real q = map_poly complex_of_real (p * map_poly Re r)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
map_poly complex_of_real q = map_poly complex_of_real (p * map_poly Re r)

goal (1 subgoal):
 1. p dvd q
[PROOF STEP]
hence "q = p * map_poly Re r"
[PROOF STATE]
proof (prove)
using this:
map_poly complex_of_real q = map_poly complex_of_real (p * map_poly Re r)

goal (1 subgoal):
 1. q = p * map_poly Re r
[PROOF STEP]
using of_real_poly_eq_iff
[PROOF STATE]
proof (prove)
using this:
map_poly complex_of_real q = map_poly complex_of_real (p * map_poly Re r)
(map_poly of_real ?p = map_poly of_real ?q) = (?p = ?q)

goal (1 subgoal):
 1. q = p * map_poly Re r
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
q = p * map_poly Re r

goal (1 subgoal):
 1. p dvd q
[PROOF STEP]
thus "p dvd q"
[PROOF STATE]
proof (prove)
using this:
q = p * map_poly Re r

goal (1 subgoal):
 1. p dvd q
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
p dvd q

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma GFP_greatest_fixed_point:
  assumes "Mono f" "f \<in> carrier L \<rightarrow> carrier L" "x \<in> fps L f"
  shows "x \<sqsubseteq> GFP f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqsubseteq> GFP f
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Mono f
f \<in> carrier L \<rightarrow> carrier L
x \<in> fps L f

goal (1 subgoal):
 1. x \<sqsubseteq> GFP f
[PROOF STEP]
by (rule_tac GFP_upperbound, auto simp add: fps_def, meson PiE local.sym weak_refl)


[STATEMENT]
lemma dual_assertion_prop: "x \<in> assertion \<Longrightarrow> ((x ^ o) * \<bottom>) \<squnion> 1 = x ^ o"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> assertion \<Longrightarrow> x ^ o * \<bottom> \<squnion> (1::'a) = x ^ o
[PROOF STEP]
apply (rule dual_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> assertion \<Longrightarrow> (x ^ o * \<bottom> \<squnion> (1::'a)) ^ o = (x ^ o) ^ o
[PROOF STEP]
by (simp add: dual_sup dual_comp assertion_prop)


[STATEMENT]
lemma pochhammer_of_nat_eq_0_lemma':
  assumes kn: "k \<le> n"
  shows "pochhammer (- (of_nat n :: 'a::{idom,ring_char_0})) k \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pochhammer (- of_nat n) k \<noteq> (0::'a)
[PROOF STEP]
proof (cases k)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. k = 0 \<Longrightarrow> pochhammer (- of_nat n) k \<noteq> (0::'a)
 2. \<And>nat. k = Suc nat \<Longrightarrow> pochhammer (- of_nat n) k \<noteq> (0::'a)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
k = 0

goal (2 subgoals):
 1. k = 0 \<Longrightarrow> pochhammer (- of_nat n) k \<noteq> (0::'a)
 2. \<And>nat. k = Suc nat \<Longrightarrow> pochhammer (- of_nat n) k \<noteq> (0::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
k = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
k = 0

goal (1 subgoal):
 1. pochhammer (- of_nat n) k \<noteq> (0::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
pochhammer (- of_nat n) k \<noteq> (0::'a)

goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> pochhammer (- of_nat n) k \<noteq> (0::'a)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> pochhammer (- of_nat n) k \<noteq> (0::'a)
[PROOF STEP]
case (Suc h)
[PROOF STATE]
proof (state)
this:
k = Suc h

goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> pochhammer (- of_nat n) k \<noteq> (0::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
k = Suc h
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
k = Suc h

goal (1 subgoal):
 1. pochhammer (- of_nat n) k \<noteq> (0::'a)
[PROOF STEP]
apply (simp add: pochhammer_Suc_prod)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k = Suc h \<Longrightarrow> \<not> n \<le> h
[PROOF STEP]
using Suc kn
[PROOF STATE]
proof (prove)
using this:
k = Suc h
k \<le> n

goal (1 subgoal):
 1. k = Suc h \<Longrightarrow> \<not> n \<le> h
[PROOF STEP]
apply (auto simp add: algebra_simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
pochhammer (- of_nat n) k \<noteq> (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sums_long_telescope:
  fixes f :: "nat \<Rightarrow> 'a :: {topological_group_add, topological_comm_monoid_add, ab_group_add}"
  assumes lim: "f \<longlonglongrightarrow> 0"
  shows "(\<lambda>n. f n - f (n + c)) sums (\<Sum>k<c. f k)" (is "_ sums ?S")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. f n - f (n + c)) sums sum f {..<c}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>n. f n - f (n + c)) sums sum f {..<c}
[PROOF STEP]
thm tendsto_diff
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>n. f n - f (n + c)) sums sum f {..<c}
[PROOF STEP]
have "(\<lambda>N. ?S - (\<Sum>n<c. f (N + n))) \<longlonglongrightarrow> ?S - 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>N. sum f {..<c} - (\<Sum>n<c. f (N + n))) \<longlonglongrightarrow> sum f {..<c} - (0::'a)
[PROOF STEP]
by (intro tendsto_intros tendsto_null_sum filterlim_compose[OF assms]; real_asymp)
[PROOF STATE]
proof (state)
this:
(\<lambda>N. sum f {..<c} - (\<Sum>n<c. f (N + n))) \<longlonglongrightarrow> sum f {..<c} - (0::'a)

goal (1 subgoal):
 1. (\<lambda>n. f n - f (n + c)) sums sum f {..<c}
[PROOF STEP]
hence "(\<lambda>N. ?S - (\<Sum>n<c. f (N + n))) \<longlonglongrightarrow> ?S"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>N. sum f {..<c} - (\<Sum>n<c. f (N + n))) \<longlonglongrightarrow> sum f {..<c} - (0::'a)

goal (1 subgoal):
 1. (\<lambda>N. sum f {..<c} - (\<Sum>n<c. f (N + n))) \<longlonglongrightarrow> sum f {..<c}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>N. sum f {..<c} - (\<Sum>n<c. f (N + n))) \<longlonglongrightarrow> sum f {..<c}

goal (1 subgoal):
 1. (\<lambda>n. f n - f (n + c)) sums sum f {..<c}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>N. sum f {..<c} - (\<Sum>n<c. f (N + n))) \<longlonglongrightarrow> sum f {..<c}

goal (1 subgoal):
 1. (\<lambda>n. f n - f (n + c)) sums sum f {..<c}
[PROOF STEP]
have "eventually (\<lambda>N. ?S - (\<Sum>n<c. f (N + n)) = (\<Sum>n<N. f n - f (n + c))) sequentially"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F N in sequentially. sum f {..<c} - (\<Sum>n<c. f (N + n)) = (\<Sum>n<N. f n - f (n + c))
[PROOF STEP]
using eventually_ge_at_top[of c]
[PROOF STATE]
proof (prove)
using this:
eventually ((\<le>) c) sequentially

goal (1 subgoal):
 1. \<forall>\<^sub>F N in sequentially. sum f {..<c} - (\<Sum>n<c. f (N + n)) = (\<Sum>n<N. f n - f (n + c))
[PROOF STEP]
proof eventually_elim
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>N. c \<le> N \<Longrightarrow> sum f {..<c} - (\<Sum>n<c. f (N + n)) = (\<Sum>n<N. f n - f (n + c))
[PROOF STEP]
case (elim N)
[PROOF STATE]
proof (state)
this:
c \<le> N

goal (1 subgoal):
 1. \<And>N. c \<le> N \<Longrightarrow> sum f {..<c} - (\<Sum>n<c. f (N + n)) = (\<Sum>n<N. f n - f (n + c))
[PROOF STEP]
have "(\<Sum>n<N. f n - f (n + c)) = (\<Sum>n<N. f n) - (\<Sum>n<N. f (n + c))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n<N. f n - f (n + c)) = sum f {..<N} - (\<Sum>n<N. f (n + c))
[PROOF STEP]
by (simp only: sum_subtractf)
[PROOF STATE]
proof (state)
this:
(\<Sum>n<N. f n - f (n + c)) = sum f {..<N} - (\<Sum>n<N. f (n + c))

goal (1 subgoal):
 1. \<And>N. c \<le> N \<Longrightarrow> sum f {..<c} - (\<Sum>n<c. f (N + n)) = (\<Sum>n<N. f n - f (n + c))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>n<N. f n - f (n + c)) = sum f {..<N} - (\<Sum>n<N. f (n + c))

goal (1 subgoal):
 1. \<And>N. c \<le> N \<Longrightarrow> sum f {..<c} - (\<Sum>n<c. f (N + n)) = (\<Sum>n<N. f n - f (n + c))
[PROOF STEP]
have "(\<Sum>n<N. f n) = (\<Sum>n\<in>{..<c} \<union> {c..<N}. f n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {..<N} = sum f ({..<c} \<union> {c..<N})
[PROOF STEP]
using elim
[PROOF STATE]
proof (prove)
using this:
c \<le> N

goal (1 subgoal):
 1. sum f {..<N} = sum f ({..<c} \<union> {c..<N})
[PROOF STEP]
by (intro sum.cong) auto
[PROOF STATE]
proof (state)
this:
sum f {..<N} = sum f ({..<c} \<union> {c..<N})

goal (1 subgoal):
 1. \<And>N. c \<le> N \<Longrightarrow> sum f {..<c} - (\<Sum>n<c. f (N + n)) = (\<Sum>n<N. f n - f (n + c))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum f {..<N} = sum f ({..<c} \<union> {c..<N})

goal (1 subgoal):
 1. \<And>N. c \<le> N \<Longrightarrow> sum f {..<c} - (\<Sum>n<c. f (N + n)) = (\<Sum>n<N. f n - f (n + c))
[PROOF STEP]
have "\<dots> = (\<Sum>n<c. f n) + (\<Sum>n\<in>{c..<N}. f n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f ({..<c} \<union> {c..<N}) = sum f {..<c} + sum f {c..<N}
[PROOF STEP]
by (subst sum.union_disjoint) auto
[PROOF STATE]
proof (state)
this:
sum f ({..<c} \<union> {c..<N}) = sum f {..<c} + sum f {c..<N}

goal (1 subgoal):
 1. \<And>N. c \<le> N \<Longrightarrow> sum f {..<c} - (\<Sum>n<c. f (N + n)) = (\<Sum>n<N. f n - f (n + c))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum f ({..<c} \<union> {c..<N}) = sum f {..<c} + sum f {c..<N}

goal (1 subgoal):
 1. \<And>N. c \<le> N \<Longrightarrow> sum f {..<c} - (\<Sum>n<c. f (N + n)) = (\<Sum>n<N. f n - f (n + c))
[PROOF STEP]
have "(\<Sum>n<N. f (n + c)) = (\<Sum>n\<in>{c..<N+c}. f n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n<N. f (n + c)) = sum f {c..<N + c}
[PROOF STEP]
using elim
[PROOF STATE]
proof (prove)
using this:
c \<le> N

goal (1 subgoal):
 1. (\<Sum>n<N. f (n + c)) = sum f {c..<N + c}
[PROOF STEP]
by (intro sum.reindex_bij_witness[of _ "\<lambda>n. n - c" "\<lambda>n. n + c"]) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>n<N. f (n + c)) = sum f {c..<N + c}

goal (1 subgoal):
 1. \<And>N. c \<le> N \<Longrightarrow> sum f {..<c} - (\<Sum>n<c. f (N + n)) = (\<Sum>n<N. f n - f (n + c))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>n<N. f (n + c)) = sum f {c..<N + c}

goal (1 subgoal):
 1. \<And>N. c \<le> N \<Longrightarrow> sum f {..<c} - (\<Sum>n<c. f (N + n)) = (\<Sum>n<N. f n - f (n + c))
[PROOF STEP]
have "\<dots> = (\<Sum>n\<in>{c..<N}\<union>{N..<N+c}. f n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {c..<N + c} = sum f ({c..<N} \<union> {N..<N + c})
[PROOF STEP]
using elim
[PROOF STATE]
proof (prove)
using this:
c \<le> N

goal (1 subgoal):
 1. sum f {c..<N + c} = sum f ({c..<N} \<union> {N..<N + c})
[PROOF STEP]
by (intro sum.cong) auto
[PROOF STATE]
proof (state)
this:
sum f {c..<N + c} = sum f ({c..<N} \<union> {N..<N + c})

goal (1 subgoal):
 1. \<And>N. c \<le> N \<Longrightarrow> sum f {..<c} - (\<Sum>n<c. f (N + n)) = (\<Sum>n<N. f n - f (n + c))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum f {c..<N + c} = sum f ({c..<N} \<union> {N..<N + c})

goal (1 subgoal):
 1. \<And>N. c \<le> N \<Longrightarrow> sum f {..<c} - (\<Sum>n<c. f (N + n)) = (\<Sum>n<N. f n - f (n + c))
[PROOF STEP]
have "\<dots> = (\<Sum>n\<in>{c..<N}. f n) + (\<Sum>n\<in>{N..<N+c}. f n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f ({c..<N} \<union> {N..<N + c}) = sum f {c..<N} + sum f {N..<N + c}
[PROOF STEP]
by (subst sum.union_disjoint) auto
[PROOF STATE]
proof (state)
this:
sum f ({c..<N} \<union> {N..<N + c}) = sum f {c..<N} + sum f {N..<N + c}

goal (1 subgoal):
 1. \<And>N. c \<le> N \<Longrightarrow> sum f {..<c} - (\<Sum>n<c. f (N + n)) = (\<Sum>n<N. f n - f (n + c))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum f ({c..<N} \<union> {N..<N + c}) = sum f {c..<N} + sum f {N..<N + c}

goal (1 subgoal):
 1. \<And>N. c \<le> N \<Longrightarrow> sum f {..<c} - (\<Sum>n<c. f (N + n)) = (\<Sum>n<N. f n - f (n + c))
[PROOF STEP]
have "(\<Sum>n\<in>{N..<N+c}. f n) = (\<Sum>n<c. f (N + n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {N..<N + c} = (\<Sum>n<c. f (N + n))
[PROOF STEP]
by (intro sum.reindex_bij_witness[of _ "\<lambda>n. n + N" "\<lambda>n. n - N"]) auto
[PROOF STATE]
proof (state)
this:
sum f {N..<N + c} = (\<Sum>n<c. f (N + n))

goal (1 subgoal):
 1. \<And>N. c \<le> N \<Longrightarrow> sum f {..<c} - (\<Sum>n<c. f (N + n)) = (\<Sum>n<N. f n - f (n + c))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>n<N. f n - f (n + c)) = sum f {..<c} + sum f {c..<N} - (sum f {c..<N} + (\<Sum>n<c. f (N + n)))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(\<Sum>n<N. f n - f (n + c)) = sum f {..<c} + sum f {c..<N} - (sum f {c..<N} + (\<Sum>n<c. f (N + n)))

goal (1 subgoal):
 1. sum f {..<c} - (\<Sum>n<c. f (N + n)) = (\<Sum>n<N. f n - f (n + c))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum f {..<c} - (\<Sum>n<c. f (N + n)) = (\<Sum>n<N. f n - f (n + c))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F N in sequentially. sum f {..<c} - (\<Sum>n<c. f (N + n)) = (\<Sum>n<N. f n - f (n + c))

goal (1 subgoal):
 1. (\<lambda>n. f n - f (n + c)) sums sum f {..<c}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>N. sum f {..<c} - (\<Sum>n<c. f (N + n))) \<longlonglongrightarrow> sum f {..<c}
\<forall>\<^sub>F N in sequentially. sum f {..<c} - (\<Sum>n<c. f (N + n)) = (\<Sum>n<N. f n - f (n + c))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>N. sum f {..<c} - (\<Sum>n<c. f (N + n))) \<longlonglongrightarrow> sum f {..<c}
\<forall>\<^sub>F N in sequentially. sum f {..<c} - (\<Sum>n<c. f (N + n)) = (\<Sum>n<N. f n - f (n + c))

goal (1 subgoal):
 1. (\<lambda>n. f n - f (n + c)) sums sum f {..<c}
[PROOF STEP]
unfolding sums_def
[PROOF STATE]
proof (prove)
using this:
(\<lambda>N. sum f {..<c} - (\<Sum>n<c. f (N + n))) \<longlonglongrightarrow> sum f {..<c}
\<forall>\<^sub>F N in sequentially. sum f {..<c} - (\<Sum>n<c. f (N + n)) = (\<Sum>n<N. f n - f (n + c))

goal (1 subgoal):
 1. (\<lambda>n. \<Sum>n<n. f n - f (n + c)) \<longlonglongrightarrow> sum f {..<c}
[PROOF STEP]
by (rule Lim_transform_eventually)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. f n - f (n + c)) sums sum f {..<c}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lenlex_append2 [simp]:
  assumes "irrefl R"
  shows "(us @ xs, us @ ys) \<in> lenlex R \<longleftrightarrow> (xs, ys) \<in> lenlex R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((us @ xs, us @ ys) \<in> lenlex R) = ((xs, ys) \<in> lenlex R)
[PROOF STEP]
proof (induction us)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (([] @ xs, [] @ ys) \<in> lenlex R) = ((xs, ys) \<in> lenlex R)
 2. \<And>a us. ((us @ xs, us @ ys) \<in> lenlex R) = ((xs, ys) \<in> lenlex R) \<Longrightarrow> (((a # us) @ xs, (a # us) @ ys) \<in> lenlex R) = ((xs, ys) \<in> lenlex R)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. (([] @ xs, [] @ ys) \<in> lenlex R) = ((xs, ys) \<in> lenlex R)
 2. \<And>a us. ((us @ xs, us @ ys) \<in> lenlex R) = ((xs, ys) \<in> lenlex R) \<Longrightarrow> (((a # us) @ xs, (a # us) @ ys) \<in> lenlex R) = ((xs, ys) \<in> lenlex R)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (([] @ xs, [] @ ys) \<in> lenlex R) = ((xs, ys) \<in> lenlex R)
[PROOF STEP]
by (simp add: lenlex_def)
[PROOF STATE]
proof (state)
this:
(([] @ xs, [] @ ys) \<in> lenlex R) = ((xs, ys) \<in> lenlex R)

goal (1 subgoal):
 1. \<And>a us. ((us @ xs, us @ ys) \<in> lenlex R) = ((xs, ys) \<in> lenlex R) \<Longrightarrow> (((a # us) @ xs, (a # us) @ ys) \<in> lenlex R) = ((xs, ys) \<in> lenlex R)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a us. ((us @ xs, us @ ys) \<in> lenlex R) = ((xs, ys) \<in> lenlex R) \<Longrightarrow> (((a # us) @ xs, (a # us) @ ys) \<in> lenlex R) = ((xs, ys) \<in> lenlex R)
[PROOF STEP]
case (Cons u us)
[PROOF STATE]
proof (state)
this:
((us @ xs, us @ ys) \<in> lenlex R) = ((xs, ys) \<in> lenlex R)

goal (1 subgoal):
 1. \<And>a us. ((us @ xs, us @ ys) \<in> lenlex R) = ((xs, ys) \<in> lenlex R) \<Longrightarrow> (((a # us) @ xs, (a # us) @ ys) \<in> lenlex R) = ((xs, ys) \<in> lenlex R)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
irrefl R
((us @ xs, us @ ys) \<in> lenlex R) = ((xs, ys) \<in> lenlex R)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
irrefl R
((us @ xs, us @ ys) \<in> lenlex R) = ((xs, ys) \<in> lenlex R)

goal (1 subgoal):
 1. (((u # us) @ xs, (u # us) @ ys) \<in> lenlex R) = ((xs, ys) \<in> lenlex R)
[PROOF STEP]
by (auto simp: lenlex_def irrefl_def)
[PROOF STATE]
proof (state)
this:
(((u # us) @ xs, (u # us) @ ys) \<in> lenlex R) = ((xs, ys) \<in> lenlex R)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem abs_summable_in_conv_radius:
  fixes f :: "nat \<Rightarrow> 'a :: {banach, real_normed_div_algebra}"
  assumes "ereal (norm z) < conv_radius f"
  shows   "summable (\<lambda>n. norm (f n * z ^ n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. norm (f n * z ^ n))
[PROOF STEP]
proof (rule root_test_convergence')
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. limsup (\<lambda>n. ereal (root n (norm (norm (f n * z ^ n))))) < 1
[PROOF STEP]
define l where "l = limsup (\<lambda>n. ereal (root n (norm (f n))))"
[PROOF STATE]
proof (state)
this:
l = limsup (\<lambda>n. ereal (root n (norm (f n))))

goal (1 subgoal):
 1. limsup (\<lambda>n. ereal (root n (norm (norm (f n * z ^ n))))) < 1
[PROOF STEP]
have "0 = limsup (\<lambda>n. 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'b) = limsup (\<lambda>n. 0::'b)
[PROOF STEP]
by (simp add: Limsup_const)
[PROOF STATE]
proof (state)
this:
(0::?'b1) = limsup (\<lambda>n. 0::?'b1)

goal (1 subgoal):
 1. limsup (\<lambda>n. ereal (root n (norm (norm (f n * z ^ n))))) < 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(0::?'b1) = limsup (\<lambda>n. 0::?'b1)

goal (1 subgoal):
 1. limsup (\<lambda>n. ereal (root n (norm (norm (f n * z ^ n))))) < 1
[PROOF STEP]
have "... \<le> l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. limsup (\<lambda>n. 0) \<le> l
[PROOF STEP]
unfolding l_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. limsup (\<lambda>n. 0) \<le> limsup (\<lambda>n. ereal (root n (norm (f n))))
[PROOF STEP]
by (intro Limsup_mono) (simp_all add: real_root_ge_zero)
[PROOF STATE]
proof (state)
this:
limsup (\<lambda>n. 0) \<le> l

goal (1 subgoal):
 1. limsup (\<lambda>n. ereal (root n (norm (norm (f n * z ^ n))))) < 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
0 \<le> l
[PROOF STEP]
have l_nonneg: "l \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
0 \<le> l

goal (1 subgoal):
 1. 0 \<le> l
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
0 \<le> l

goal (1 subgoal):
 1. limsup (\<lambda>n. ereal (root n (norm (norm (f n * z ^ n))))) < 1
[PROOF STEP]
have "limsup (\<lambda>n. root n (norm (f n * z^n))) = l * ereal (norm z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. limsup (\<lambda>x. ereal (root x (norm (f x * z ^ x)))) = l * ereal (norm z)
[PROOF STEP]
unfolding l_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. limsup (\<lambda>x. ereal (root x (norm (f x * z ^ x)))) = limsup (\<lambda>n. ereal (root n (norm (f n)))) * ereal (norm z)
[PROOF STEP]
by (rule limsup_root_powser)
[PROOF STATE]
proof (state)
this:
limsup (\<lambda>x. ereal (root x (norm (f x * z ^ x)))) = l * ereal (norm z)

goal (1 subgoal):
 1. limsup (\<lambda>n. ereal (root n (norm (norm (f n * z ^ n))))) < 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
limsup (\<lambda>x. ereal (root x (norm (f x * z ^ x)))) = l * ereal (norm z)

goal (1 subgoal):
 1. limsup (\<lambda>n. ereal (root n (norm (norm (f n * z ^ n))))) < 1
[PROOF STEP]
from l_nonneg
[PROOF STATE]
proof (chain)
picking this:
0 \<le> l
[PROOF STEP]
consider "l = 0" | "l = \<infinity>" | "\<exists>l'. l = ereal l' \<and> l' > 0"
[PROOF STATE]
proof (prove)
using this:
0 \<le> l

goal (1 subgoal):
 1. \<lbrakk>l = 0 \<Longrightarrow> thesis; l = \<infinity> \<Longrightarrow> thesis; \<exists>l'. l = ereal l' \<and> 0 < l' \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by (cases "l") (auto simp: less_le)
[PROOF STATE]
proof (state)
this:
\<lbrakk>l = 0 \<Longrightarrow> ?thesis1; l = \<infinity> \<Longrightarrow> ?thesis1; \<exists>l'. l = ereal l' \<and> 0 < l' \<Longrightarrow> ?thesis1\<rbrakk> \<Longrightarrow> ?thesis1

goal (1 subgoal):
 1. limsup (\<lambda>n. ereal (root n (norm (norm (f n * z ^ n))))) < 1
[PROOF STEP]
hence "l * ereal (norm z) < 1"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>l = 0 \<Longrightarrow> ?thesis1; l = \<infinity> \<Longrightarrow> ?thesis1; \<exists>l'. l = ereal l' \<and> 0 < l' \<Longrightarrow> ?thesis1\<rbrakk> \<Longrightarrow> ?thesis1

goal (1 subgoal):
 1. l * ereal (norm z) < 1
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. l = 0 \<Longrightarrow> l * ereal (norm z) < 1
 2. l = \<infinity> \<Longrightarrow> l * ereal (norm z) < 1
 3. \<exists>l'. l = ereal l' \<and> 0 < l' \<Longrightarrow> l * ereal (norm z) < 1
[PROOF STEP]
assume "l = \<infinity>"
[PROOF STATE]
proof (state)
this:
l = \<infinity>

goal (3 subgoals):
 1. l = 0 \<Longrightarrow> l * ereal (norm z) < 1
 2. l = \<infinity> \<Longrightarrow> l * ereal (norm z) < 1
 3. \<exists>l'. l = ereal l' \<and> 0 < l' \<Longrightarrow> l * ereal (norm z) < 1
[PROOF STEP]
hence "conv_radius f = 0"
[PROOF STATE]
proof (prove)
using this:
l = \<infinity>

goal (1 subgoal):
 1. conv_radius f = 0
[PROOF STEP]
unfolding conv_radius_def l_def
[PROOF STATE]
proof (prove)
using this:
limsup (\<lambda>n. ereal (root n (norm (f n)))) = \<infinity>

goal (1 subgoal):
 1. inverse (limsup (\<lambda>n. ereal (root n (norm (f n))))) = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
conv_radius f = 0

goal (3 subgoals):
 1. l = 0 \<Longrightarrow> l * ereal (norm z) < 1
 2. l = \<infinity> \<Longrightarrow> l * ereal (norm z) < 1
 3. \<exists>l'. l = ereal l' \<and> 0 < l' \<Longrightarrow> l * ereal (norm z) < 1
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
ereal (norm z) < conv_radius f
conv_radius f = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ereal (norm z) < conv_radius f
conv_radius f = 0

goal (1 subgoal):
 1. l * ereal (norm z) < 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
l * ereal (norm z) < 1

goal (2 subgoals):
 1. l = 0 \<Longrightarrow> l * ereal (norm z) < 1
 2. \<exists>l'. l = ereal l' \<and> 0 < l' \<Longrightarrow> l * ereal (norm z) < 1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. l = 0 \<Longrightarrow> l * ereal (norm z) < 1
 2. \<exists>l'. l = ereal l' \<and> 0 < l' \<Longrightarrow> l * ereal (norm z) < 1
[PROOF STEP]
assume "\<exists>l'. l = ereal l' \<and> l' > 0"
[PROOF STATE]
proof (state)
this:
\<exists>l'. l = ereal l' \<and> 0 < l'

goal (2 subgoals):
 1. l = 0 \<Longrightarrow> l * ereal (norm z) < 1
 2. \<exists>l'. l = ereal l' \<and> 0 < l' \<Longrightarrow> l * ereal (norm z) < 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>l'. l = ereal l' \<and> 0 < l'
[PROOF STEP]
obtain l' where l': "l = ereal l'" "0 < l'"
[PROOF STATE]
proof (prove)
using this:
\<exists>l'. l = ereal l' \<and> 0 < l'

goal (1 subgoal):
 1. (\<And>l'. \<lbrakk>l = ereal l'; 0 < l'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
l = ereal l'
0 < l'

goal (2 subgoals):
 1. l = 0 \<Longrightarrow> l * ereal (norm z) < 1
 2. \<exists>l'. l = ereal l' \<and> 0 < l' \<Longrightarrow> l * ereal (norm z) < 1
[PROOF STEP]
hence "l \<noteq> \<infinity>"
[PROOF STATE]
proof (prove)
using this:
l = ereal l'
0 < l'

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

goal (2 subgoals):
 1. l = 0 \<Longrightarrow> l * ereal (norm z) < 1
 2. \<exists>l'. l = ereal l' \<and> 0 < l' \<Longrightarrow> l * ereal (norm z) < 1
[PROOF STEP]
have "l * ereal (norm z) < l * conv_radius f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l * ereal (norm z) < l * conv_radius f
[PROOF STEP]
by (intro ereal_mult_strict_left_mono) (simp_all add: l' assms)
[PROOF STATE]
proof (state)
this:
l * ereal (norm z) < l * conv_radius f

goal (2 subgoals):
 1. l = 0 \<Longrightarrow> l * ereal (norm z) < 1
 2. \<exists>l'. l = ereal l' \<and> 0 < l' \<Longrightarrow> l * ereal (norm z) < 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
l * ereal (norm z) < l * conv_radius f

goal (2 subgoals):
 1. l = 0 \<Longrightarrow> l * ereal (norm z) < 1
 2. \<exists>l'. l = ereal l' \<and> 0 < l' \<Longrightarrow> l * ereal (norm z) < 1
[PROOF STEP]
have "conv_radius f = inverse l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conv_radius f = inverse l
[PROOF STEP]
by (simp add: conv_radius_def l_def)
[PROOF STATE]
proof (state)
this:
conv_radius f = inverse l

goal (2 subgoals):
 1. l = 0 \<Longrightarrow> l * ereal (norm z) < 1
 2. \<exists>l'. l = ereal l' \<and> 0 < l' \<Longrightarrow> l * ereal (norm z) < 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
conv_radius f = inverse l

goal (2 subgoals):
 1. l = 0 \<Longrightarrow> l * ereal (norm z) < 1
 2. \<exists>l'. l = ereal l' \<and> 0 < l' \<Longrightarrow> l * ereal (norm z) < 1
[PROOF STEP]
from l'
[PROOF STATE]
proof (chain)
picking this:
l = ereal l'
0 < l'
[PROOF STEP]
have "l * inverse l = 1"
[PROOF STATE]
proof (prove)
using this:
l = ereal l'
0 < l'

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

goal (2 subgoals):
 1. l = 0 \<Longrightarrow> l * ereal (norm z) < 1
 2. \<exists>l'. l = ereal l' \<and> 0 < l' \<Longrightarrow> l * ereal (norm z) < 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
l * ereal (norm z) < 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
l * ereal (norm z) < 1

goal (1 subgoal):
 1. l * ereal (norm z) < 1
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
l * ereal (norm z) < 1

goal (1 subgoal):
 1. l = 0 \<Longrightarrow> l * ereal (norm z) < 1
[PROOF STEP]
qed simp_all
[PROOF STATE]
proof (state)
this:
l * ereal (norm z) < 1

goal (1 subgoal):
 1. limsup (\<lambda>n. ereal (root n (norm (norm (f n * z ^ n))))) < 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
limsup (\<lambda>x. ereal (root x (norm (f x * z ^ x)))) < 1
[PROOF STEP]
show "limsup (\<lambda>n. ereal (root n (norm (norm (f n * z ^ n))))) < 1"
[PROOF STATE]
proof (prove)
using this:
limsup (\<lambda>x. ereal (root x (norm (f x * z ^ x)))) < 1

goal (1 subgoal):
 1. limsup (\<lambda>n. ereal (root n (norm (norm (f n * z ^ n))))) < 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
limsup (\<lambda>n. ereal (root n (norm (norm (f n * z ^ n))))) < 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma uniqOneElementCharacterization:
assumes
  "uniq l"
shows
  "(l = [a]) = (set l = {a})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (l = [a]) = (set l = {a})
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
uniq l

goal (1 subgoal):
 1. (l = [a]) = (set l = {a})
[PROOF STEP]
using uniqDistinct[of "l"]
[PROOF STATE]
proof (prove)
using this:
uniq l
uniq l = distinct l

goal (1 subgoal):
 1. (l = [a]) = (set l = {a})
[PROOF STEP]
using oneElementSetCharacterization[of "l" "a"]
[PROOF STATE]
proof (prove)
using this:
uniq l
uniq l = distinct l
(set l = {a}) = (remdups l = [a])

goal (1 subgoal):
 1. (l = [a]) = (set l = {a})
[PROOF STEP]
using distinct_remdups_id[of "l"]
[PROOF STATE]
proof (prove)
using this:
uniq l
uniq l = distinct l
(set l = {a}) = (remdups l = [a])
distinct l \<Longrightarrow> remdups l = l

goal (1 subgoal):
 1. (l = [a]) = (set l = {a})
[PROOF STEP]
by auto


[STATEMENT]
lemma fps_add_assoc: "((f::('a,'b::semigroup_add) fps) + g) + h = f + (g + h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f + g + h = f + (g + h)
[PROOF STEP]
unfolding plus_fps_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs_fps (\<lambda>n. Abs_fps (\<lambda>n. f $ n + g $ n) $ n + h $ n) = Abs_fps (\<lambda>n. f $ n + Abs_fps (\<lambda>n. g $ n + h $ n) $ n)
[PROOF STEP]
by (simp add: add.assoc)


[STATEMENT]
lemma fst_quicksort' [simp]: "fst (quicksort' R xs) = quicksort R xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (quicksort' R xs) = quicksort R xs
[PROOF STEP]
by (induction R xs rule: quicksort.induct) (simp_all add: case_prod_unfold Let_def o_def)


[STATEMENT]
lemma total_quasi_ordered_subset: "B \<subseteq> A \<Longrightarrow> total_quasi_ordered_set B (\<sqsubseteq>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B \<subseteq> A \<Longrightarrow> total_quasi_ordered_set B (\<sqsubseteq>)
[PROOF STEP]
using transitive_subset connex_subset
[PROOF STATE]
proof (prove)
using this:
?B \<subseteq> A \<Longrightarrow> transitive ?B (\<sqsubseteq>)
?B \<subseteq> A \<Longrightarrow> connex ?B (\<sqsubseteq>)

goal (1 subgoal):
 1. B \<subseteq> A \<Longrightarrow> total_quasi_ordered_set B (\<sqsubseteq>)
[PROOF STEP]
by intro_locales


[STATEMENT]
lemma deMorgan1: "not(X and Y) = ((not X) or (not Y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. not (X and Y) = (not X or not Y)
[PROOF STEP]
by(simp add: OclOr_def)


[STATEMENT]
lemma norm_pres_extensionI:  (* FIXME ? *)
  "\<exists>H h. g = graph H h
    \<and> linearform H h
    \<and> H \<unlhd> E
    \<and> F \<unlhd> H
    \<and> graph F f \<subseteq> graph H h
    \<and> (\<forall>x \<in> H. h x \<le> p x) \<Longrightarrow> g \<in> norm_pres_extensions E p F f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>H h. g = graph H h \<and> linearform H h \<and> Subspace.subspace H E \<and> Subspace.subspace F H \<and> graph F f \<subseteq> graph H h \<and> (\<forall>x\<in>H. h x \<le> p x) \<Longrightarrow> g \<in> norm_pres_extensions E p F f
[PROOF STEP]
unfolding norm_pres_extensions_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>H h. g = graph H h \<and> linearform H h \<and> Subspace.subspace H E \<and> Subspace.subspace F H \<and> graph F f \<subseteq> graph H h \<and> (\<forall>x\<in>H. h x \<le> p x) \<Longrightarrow> g \<in> {graph H h |H h. linearform H h \<and> Subspace.subspace H E \<and> Subspace.subspace F H \<and> graph F f \<subseteq> graph H h \<and> (\<forall>x\<in>H. h x \<le> p x)}
[PROOF STEP]
by blast


[STATEMENT]
lemma "((x::real) \<le> y) = (x < y \<or> x = y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<le> y) = (x < y \<or> x = y)
[PROOF STEP]
by arith