[STATEMENT]
lemma bfun_bounded_norm_range: "bounded (range (\<lambda>s. norm (apply_bfun v s)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded (range (\<lambda>s. norm (apply_bfun v s)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bounded (range (\<lambda>s. norm (apply_bfun v s)))
[PROOF STEP]
obtain b where "\<forall>s. norm (v s) \<le> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>b. \<forall>s. norm (apply_bfun v s) \<le> b \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using norm_le_norm_bfun
[PROOF STATE]
proof (prove)
using this:
norm (apply_bfun ?f ?x) \<le> norm ?f

goal (1 subgoal):
 1. (\<And>b. \<forall>s. norm (apply_bfun v s) \<le> b \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
\<forall>s. norm (apply_bfun v s) \<le> b

goal (1 subgoal):
 1. bounded (range (\<lambda>s. norm (apply_bfun v s)))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>s. norm (apply_bfun v s) \<le> b

goal (1 subgoal):
 1. bounded (range (\<lambda>s. norm (apply_bfun v s)))
[PROOF STEP]
by (simp add: bounded_norm_comp)
[PROOF STATE]
proof (state)
this:
bounded (range (\<lambda>s. norm (apply_bfun v s)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma map_nth_eq:
  "length xs = length ys \<Longrightarrow> (\<And>i. i < length xs \<Longrightarrow> f (xs ! i) = g (ys ! i)) \<Longrightarrow>
  map f xs = map g ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length xs = length ys; \<And>i. i < length xs \<Longrightarrow> f (xs ! i) = g (ys ! i)\<rbrakk> \<Longrightarrow> map f xs = map g ys
[PROOF STEP]
apply(induct xs ys rule: list_induct2)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<And>i. i < length [] \<Longrightarrow> f ([] ! i) = g ([] ! i)) \<Longrightarrow> map f [] = map g []
 2. \<And>x xs y ys. \<lbrakk>length xs = length ys; (\<And>i. i < length xs \<Longrightarrow> f (xs ! i) = g (ys ! i)) \<Longrightarrow> map f xs = map g ys; \<And>i. i < length (x # xs) \<Longrightarrow> f ((x # xs) ! i) = g ((y # ys) ! i)\<rbrakk> \<Longrightarrow> map f (x # xs) = map g (y # ys)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xs y ys. \<lbrakk>length xs = length ys; (\<And>i. i < length xs \<Longrightarrow> f (xs ! i) = g (ys ! i)) \<Longrightarrow> map f xs = map g ys; \<And>i. i < length (x # xs) \<Longrightarrow> f ((x # xs) ! i) = g ((y # ys) ! i)\<rbrakk> \<Longrightarrow> map f (x # xs) = map g (y # ys)
[PROOF STEP]
apply force
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma finite_lists_length_le:
  assumes "finite A" shows "finite {xs. set xs \<subseteq> A \<and> length xs \<le> n}"
 (is "finite ?S")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {xs. set xs \<subseteq> A \<and> length xs \<le> n}
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {xs. set xs \<subseteq> A \<and> length xs \<le> n}
[PROOF STEP]
have "?S = (\<Union>n\<in>{0..n}. {xs. set xs \<subseteq> A \<and> length xs = n})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {xs. set xs \<subseteq> A \<and> length xs \<le> n} = (\<Union>n\<in>{0..n}. {xs. set xs \<subseteq> A \<and> length xs = n})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{xs. set xs \<subseteq> A \<and> length xs \<le> n} = (\<Union>n\<in>{0..n}. {xs. set xs \<subseteq> A \<and> length xs = n})

goal (1 subgoal):
 1. finite {xs. set xs \<subseteq> A \<and> length xs \<le> n}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
{xs. set xs \<subseteq> A \<and> length xs \<le> n} = (\<Union>n\<in>{0..n}. {xs. set xs \<subseteq> A \<and> length xs = n})

goal (1 subgoal):
 1. finite {xs. set xs \<subseteq> A \<and> length xs \<le> n}
[PROOF STEP]
by (auto intro!: finite_lists_length_eq[OF \<open>finite A\<close>] simp only:)
[PROOF STATE]
proof (state)
this:
finite {xs. set xs \<subseteq> A \<and> length xs \<le> n}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Polygamma_approx_1_real':
  assumes x: "(x::real) > 0" and m: "m > 0"
  shows   "Polygamma_approx 1 m x = ln x - (\<Sum>k = Suc 0..m. bernoulli' k * inverse x ^ k / real k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Polygamma_approx 1 m x = ln x - (\<Sum>k = Suc 0..m. bernoulli' k * inverse x ^ k / real k)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Polygamma_approx 1 m x = ln x - (\<Sum>k = Suc 0..m. bernoulli' k * inverse x ^ k / real k)
[PROOF STEP]
have "Polygamma_approx 1 m x = ln x - (1 / (2 * x) +
          (\<Sum>k=Suc 0..<m. bernoulli (Suc k) * inverse x ^ Suc k / real (Suc k)))"
    (is "_ = _ - (_ + ?S)")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Polygamma_approx 1 m x = ln x - (1 / (2 * x) + (\<Sum>k = Suc 0..<m. bernoulli (Suc k) * inverse x ^ Suc k / real (Suc k)))
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
0 < x

goal (1 subgoal):
 1. Polygamma_approx 1 m x = ln x - (1 / (2 * x) + (\<Sum>k = Suc 0..<m. bernoulli (Suc k) * inverse x ^ Suc k / real (Suc k)))
[PROOF STEP]
by (simp add: Polygamma_approx_1_real stirling_sum_def)
[PROOF STATE]
proof (state)
this:
Polygamma_approx 1 m x = ln x - (1 / (2 * x) + (\<Sum>k = Suc 0..<m. bernoulli (Suc k) * inverse x ^ Suc k / real (Suc k)))

goal (1 subgoal):
 1. Polygamma_approx 1 m x = ln x - (\<Sum>k = Suc 0..m. bernoulli' k * inverse x ^ k / real k)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Polygamma_approx 1 m x = ln x - (1 / (2 * x) + (\<Sum>k = Suc 0..<m. bernoulli (Suc k) * inverse x ^ Suc k / real (Suc k)))

goal (1 subgoal):
 1. Polygamma_approx 1 m x = ln x - (\<Sum>k = Suc 0..m. bernoulli' k * inverse x ^ k / real k)
[PROOF STEP]
have "?S = (\<Sum>k=Suc 0..<m. bernoulli' (Suc k) * inverse x ^ Suc k / real (Suc k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = Suc 0..<m. bernoulli (Suc k) * inverse x ^ Suc k / real (Suc k)) = (\<Sum>k = Suc 0..<m. bernoulli' (Suc k) * inverse x ^ Suc k / real (Suc k))
[PROOF STEP]
by (intro sum.cong refl) (simp_all add: bernoulli'_def)
[PROOF STATE]
proof (state)
this:
(\<Sum>k = Suc 0..<m. bernoulli (Suc k) * inverse x ^ Suc k / real (Suc k)) = (\<Sum>k = Suc 0..<m. bernoulli' (Suc k) * inverse x ^ Suc k / real (Suc k))

goal (1 subgoal):
 1. Polygamma_approx 1 m x = ln x - (\<Sum>k = Suc 0..m. bernoulli' k * inverse x ^ k / real k)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k = Suc 0..<m. bernoulli (Suc k) * inverse x ^ Suc k / real (Suc k)) = (\<Sum>k = Suc 0..<m. bernoulli' (Suc k) * inverse x ^ Suc k / real (Suc k))

goal (1 subgoal):
 1. Polygamma_approx 1 m x = ln x - (\<Sum>k = Suc 0..m. bernoulli' k * inverse x ^ k / real k)
[PROOF STEP]
have "1 / (2 * x) + \<dots> =
               (\<Sum>k=0..<m. bernoulli' (Suc k) * inverse x ^ Suc k / real (Suc k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / (2 * x) + (\<Sum>k = Suc 0..<m. bernoulli' (Suc k) * inverse x ^ Suc k / real (Suc k)) = (\<Sum>k = 0..<m. bernoulli' (Suc k) * inverse x ^ Suc k / real (Suc k))
[PROOF STEP]
using m
[PROOF STATE]
proof (prove)
using this:
0 < m

goal (1 subgoal):
 1. 1 / (2 * x) + (\<Sum>k = Suc 0..<m. bernoulli' (Suc k) * inverse x ^ Suc k / real (Suc k)) = (\<Sum>k = 0..<m. bernoulli' (Suc k) * inverse x ^ Suc k / real (Suc k))
[PROOF STEP]
by (subst (2) sum.atLeast_Suc_lessThan) (simp_all add: field_simps)
[PROOF STATE]
proof (state)
this:
1 / (2 * x) + (\<Sum>k = Suc 0..<m. bernoulli' (Suc k) * inverse x ^ Suc k / real (Suc k)) = (\<Sum>k = 0..<m. bernoulli' (Suc k) * inverse x ^ Suc k / real (Suc k))

goal (1 subgoal):
 1. Polygamma_approx 1 m x = ln x - (\<Sum>k = Suc 0..m. bernoulli' k * inverse x ^ k / real k)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 / (2 * x) + (\<Sum>k = Suc 0..<m. bernoulli' (Suc k) * inverse x ^ Suc k / real (Suc k)) = (\<Sum>k = 0..<m. bernoulli' (Suc k) * inverse x ^ Suc k / real (Suc k))

goal (1 subgoal):
 1. Polygamma_approx 1 m x = ln x - (\<Sum>k = Suc 0..m. bernoulli' k * inverse x ^ k / real k)
[PROOF STEP]
have "\<dots> = (\<Sum>k = Suc 0..m. bernoulli' k * inverse x ^ k / real k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = 0..<m. bernoulli' (Suc k) * inverse x ^ Suc k / real (Suc k)) = (\<Sum>k = Suc 0..m. bernoulli' k * inverse x ^ k / real k)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < x
0 < m

goal (1 subgoal):
 1. (\<Sum>k = 0..<m. bernoulli' (Suc k) * inverse x ^ Suc k / real (Suc k)) = (\<Sum>k = Suc 0..m. bernoulli' k * inverse x ^ k / real k)
[PROOF STEP]
by (subst sum.shift_bounds_Suc_ivl [symmetric]) (simp add: atLeastLessThanSuc_atLeastAtMost)
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 0..<m. bernoulli' (Suc k) * inverse x ^ Suc k / real (Suc k)) = (\<Sum>k = Suc 0..m. bernoulli' k * inverse x ^ k / real k)

goal (1 subgoal):
 1. Polygamma_approx 1 m x = ln x - (\<Sum>k = Suc 0..m. bernoulli' k * inverse x ^ k / real k)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Polygamma_approx 1 m x = ln x - (\<Sum>k = Suc 0..m. bernoulli' k * inverse x ^ k / real k)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Polygamma_approx 1 m x = ln x - (\<Sum>k = Suc 0..m. bernoulli' k * inverse x ^ k / real k)

goal (1 subgoal):
 1. Polygamma_approx 1 m x = ln x - (\<Sum>k = Suc 0..m. bernoulli' k * inverse x ^ k / real k)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Polygamma_approx 1 m x = ln x - (\<Sum>k = Suc 0..m. bernoulli' k * inverse x ^ k / real k)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rank_mono_2:
  assumes "finite S"
  shows "S' \<subseteq> S \<Longrightarrow> rank_of x S' \<le> rank_of x S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S' \<subseteq> S \<Longrightarrow> rank_of x S' \<le> rank_of x S
[PROOF STEP]
unfolding rank_of_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S' \<subseteq> S \<Longrightarrow> card {y \<in> S'. y < x} \<le> card {y \<in> S. y < x}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite S

goal (1 subgoal):
 1. S' \<subseteq> S \<Longrightarrow> card {y \<in> S'. y < x} \<le> card {y \<in> S. y < x}
[PROOF STEP]
by (intro card_mono, auto)


[STATEMENT]
theorem language: "M.language = N.language"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M.language = N.language
[PROOF STEP]
proof (rule set_eqI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (x \<in> M.language) = (x \<in> N.language)
[PROOF STEP]
fix u
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (x \<in> M.language) = (x \<in> N.language)
[PROOF STEP]
have "M.nextl (init M) u \<in> final M \<longleftrightarrow> h (M.nextl (init M) u) \<in> h ` final M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (M.nextl (init M) u \<in> final M) = (h (M.nextl (init M) u) \<in> h ` final M)
[PROOF STEP]
by (subst inj_on_image_mem_iff [OF bij_betw_imp_inj_on [OF h] _ M.final]) (auto)
[PROOF STATE]
proof (state)
this:
(M.nextl (init M) u \<in> final M) = (h (M.nextl (init M) u) \<in> h ` final M)

goal (1 subgoal):
 1. \<And>x. (x \<in> M.language) = (x \<in> N.language)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(M.nextl (init M) u \<in> final M) = (h (M.nextl (init M) u) \<in> h ` final M)

goal (1 subgoal):
 1. \<And>x. (x \<in> M.language) = (x \<in> N.language)
[PROOF STEP]
have "... \<longleftrightarrow> N.nextl (init N) u \<in> final N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (h (M.nextl (init M) u) \<in> h ` final M) = (N.nextl (init N) u \<in> final N)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(h (M.nextl (init M) u) \<in> h ` final M) = (N.nextl (init N) u \<in> final N)

goal (1 subgoal):
 1. \<And>x. (x \<in> M.language) = (x \<in> N.language)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(M.nextl (init M) u \<in> final M) = (N.nextl (init N) u \<in> final N)
[PROOF STEP]
show "u \<in> M.language \<longleftrightarrow> u \<in> dfa.language N"
[PROOF STATE]
proof (prove)
using this:
(M.nextl (init M) u \<in> final M) = (N.nextl (init N) u \<in> final N)

goal (1 subgoal):
 1. (u \<in> M.language) = (u \<in> N.language)
[PROOF STEP]
by (simp add: M.language_def N.language_def)
[PROOF STATE]
proof (state)
this:
(u \<in> M.language) = (u \<in> N.language)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma p_H_p_f_less_1: "p_H * p_f < 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p_H * p_f < 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p_H * p_f < 1
[PROOF STEP]
have "p_H * p_f < 1 * 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p_H * p_f < 1 * 1
[PROOF STEP]
using p_H p_f
[PROOF STATE]
proof (prove)
using this:
0 < p_H
p_H < 1
0 < p_f
p_f < 1

goal (1 subgoal):
 1. p_H * p_f < 1 * 1
[PROOF STEP]
by (intro mult_strict_mono) auto
[PROOF STATE]
proof (state)
this:
p_H * p_f < 1 * 1

goal (1 subgoal):
 1. p_H * p_f < 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p_H * p_f < 1 * 1
[PROOF STEP]
show "p_H * p_f < 1"
[PROOF STATE]
proof (prove)
using this:
p_H * p_f < 1 * 1

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem \<theta>_upper_bound_weak:
  fixes n :: nat
  assumes n: "n > 0"
  shows   "\<theta> n < 4 * ln 2 * n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<theta> (real n) < 4 * ln 2 * real n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<theta> (real n) < 4 * ln 2 * real n
[PROOF STEP]
define r where "r = Discrete.log n"
[PROOF STATE]
proof (state)
this:
r = Discrete.log n

goal (1 subgoal):
 1. \<theta> (real n) < 4 * ln 2 * real n
[PROOF STEP]
have "\<theta> n \<le> \<theta> (real (2 ^ Suc r))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<theta> (real n) \<le> \<theta> (real (2 ^ Suc r))
[PROOF STEP]
unfolding r_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<theta> (real n) \<le> \<theta> (real (2 ^ Suc (Discrete.log n)))
[PROOF STEP]
using log_exp2_ge[of n]
[PROOF STATE]
proof (prove)
using this:
n \<le> 2 * 2 ^ Discrete.log n

goal (1 subgoal):
 1. \<theta> (real n) \<le> \<theta> (real (2 ^ Suc (Discrete.log n)))
[PROOF STEP]
by (intro \<theta>_mono, unfold of_nat_le_iff) auto
[PROOF STATE]
proof (state)
this:
\<theta> (real n) \<le> \<theta> (real (2 ^ Suc r))

goal (1 subgoal):
 1. \<theta> (real n) < 4 * ln 2 * real n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<theta> (real n) \<le> \<theta> (real (2 ^ Suc r))

goal (1 subgoal):
 1. \<theta> (real n) < 4 * ln 2 * real n
[PROOF STEP]
have "\<dots> < 4 * ln 2 * real (2 ^ r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<theta> (real (2 ^ Suc r)) < 4 * ln 2 * real (2 ^ r)
[PROOF STEP]
using \<theta>_twopow_less[of "r + 1"]
[PROOF STATE]
proof (prove)
using this:
\<theta> (2 ^ (r + 1)) < 2 ^ (r + 1 + 1) * ln 2

goal (1 subgoal):
 1. \<theta> (real (2 ^ Suc r)) < 4 * ln 2 * real (2 ^ r)
[PROOF STEP]
by (simp add: mult_ac)
[PROOF STATE]
proof (state)
this:
\<theta> (real (2 ^ Suc r)) < 4 * ln 2 * real (2 ^ r)

goal (1 subgoal):
 1. \<theta> (real n) < 4 * ln 2 * real n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<theta> (real (2 ^ Suc r)) < 4 * ln 2 * real (2 ^ r)

goal (1 subgoal):
 1. \<theta> (real n) < 4 * ln 2 * real n
[PROOF STEP]
have "\<dots> \<le> 4 * ln 2 * real n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 4 * ln 2 * real (2 ^ r) \<le> 4 * ln 2 * real n
[PROOF STEP]
unfolding r_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 4 * ln 2 * real (2 ^ Discrete.log n) \<le> 4 * ln 2 * real n
[PROOF STEP]
by (intro mult_left_mono, unfold of_nat_le_iff, intro log_exp2_le) (use n in auto)
[PROOF STATE]
proof (state)
this:
4 * ln 2 * real (2 ^ r) \<le> 4 * ln 2 * real n

goal (1 subgoal):
 1. \<theta> (real n) < 4 * ln 2 * real n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<theta> (real n) < 4 * ln 2 * real n
[PROOF STEP]
show "\<theta> n < 4 * ln 2 * n"
[PROOF STATE]
proof (prove)
using this:
\<theta> (real n) < 4 * ln 2 * real n

goal (1 subgoal):
 1. \<theta> (real n) < 4 * ln 2 * real n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<theta> (real n) < 4 * ln 2 * real n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Schottky_lemma1:
  fixes n::nat
  assumes "0 < n"
  shows "0 < n + sqrt(real n ^ 2 - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < real n + sqrt ((real n)\<^sup>2 - 1)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < real n + sqrt ((real n)\<^sup>2 - 1)
[PROOF STEP]
have "0 < n * n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n * n
[PROOF STEP]
by (simp add: assms)
[PROOF STATE]
proof (state)
this:
0 < n * n

goal (1 subgoal):
 1. 0 < real n + sqrt ((real n)\<^sup>2 - 1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < n * n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < n * n

goal (1 subgoal):
 1. 0 < real n + sqrt ((real n)\<^sup>2 - 1)
[PROOF STEP]
by (metis add.commute add.right_neutral add_pos_nonneg assms diff_ge_0_iff_ge nat_less_real_le of_nat_0 of_nat_0_less_iff of_nat_power power2_eq_square real_sqrt_ge_0_iff)
[PROOF STATE]
proof (state)
this:
0 < real n + sqrt ((real n)\<^sup>2 - 1)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "((\<lambda>x::real. exp (exp (exp x)) / exp (exp (exp x - exp (-exp (exp x))))) \<longlongrightarrow> 1) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. exp (exp (exp x)) / exp (exp (exp x - exp (- exp (exp x))))) \<longlongrightarrow> 1) at_top
[PROOF STEP]
by real_asymp


[STATEMENT]
lemma "((\<lambda>x::real. exp (x*exp (-x) / (exp (-x) + exp (-2*x^2/(x+1))))/exp x) \<longlongrightarrow> 1) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. exp (x * exp (- x) / (exp (- x) + exp (- 2 * x\<^sup>2 / (x + 1)))) / exp x) \<longlongrightarrow> 1) at_top
[PROOF STEP]
by real_asymp


[STATEMENT]
lemma content_cbox: "\<forall>i\<in>Basis. a\<bullet>i \<le> b\<bullet>i \<Longrightarrow> content (cbox a b) = (\<Prod>i\<in>Basis. b\<bullet>i - a\<bullet>i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i\<in>Basis. a \<bullet> i \<le> b \<bullet> i \<Longrightarrow> content (cbox a b) = (\<Prod>i\<in>Basis. b \<bullet> i - a \<bullet> i)
[PROOF STEP]
unfolding content_cbox_cases
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i\<in>Basis. a \<bullet> i \<le> b \<bullet> i \<Longrightarrow> (if \<forall>i\<in>Basis. a \<bullet> i \<le> b \<bullet> i then \<Prod>i\<in>Basis. b \<bullet> i - a \<bullet> i else 0) = (\<Prod>i\<in>Basis. b \<bullet> i - a \<bullet> i)
[PROOF STEP]
by simp


[STATEMENT]
lemma ball_less_Suc_eq: "(\<forall>i<Suc n. P i) \<longleftrightarrow> (P 0 \<and> (\<forall>i<n. P (Suc i)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>i<Suc n. P i) = (P 0 \<and> (\<forall>i<n. P (Suc i)))
[PROOF STEP]
using less_Suc_eq_0_disj
[PROOF STATE]
proof (prove)
using this:
(?m < Suc ?n) = (?m = 0 \<or> (\<exists>j. ?m = Suc j \<and> j < ?n))

goal (1 subgoal):
 1. (\<forall>i<Suc n. P i) = (P 0 \<and> (\<forall>i<n. P (Suc i)))
[PROOF STEP]
by auto


[STATEMENT]
lemma ln_root: "n > 0 \<Longrightarrow> b > 0 \<Longrightarrow> ln (root n b) =  ln b / n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < n; 0 < b\<rbrakk> \<Longrightarrow> ln (root n b) = ln b / real n
[PROOF STEP]
by (simp add: root_powr_inverse ln_powr)


[STATEMENT]
lemma fds_eval_shift [simp]:
  fixes z :: "'a :: {banach, nat_power_field, real_normed_field}"
  shows "eval_fds (fds_shift c f) z = eval_fds f (z - c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_fds (fds_shift c f) z = eval_fds f (z - c)
[PROOF STEP]
unfolding eval_fds_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n. fds_nth (fds_shift c f) n / nat_power n z) = (\<Sum>n. fds_nth f n / nat_power n (z - c))
[PROOF STEP]
proof (rule suminf_cong, goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. fds_nth (fds_shift c f) n / nat_power n z = fds_nth f n / nat_power n (z - c)
[PROOF STEP]
case (1 n)
[PROOF STATE]
proof (state)
this:

goal (1 subgoal):
 1. \<And>n. fds_nth (fds_shift c f) n / nat_power n z = fds_nth f n / nat_power n (z - c)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_nth (fds_shift c f) n / nat_power n z = fds_nth f n / nat_power n (z - c)
[PROOF STEP]
by (cases "n = 0") (simp_all add: nat_power_diff)
[PROOF STATE]
proof (state)
this:
fds_nth (fds_shift c f) n / nat_power n z = fds_nth f n / nat_power n (z - c)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma has_derivative_exp_scaleRl[derivative_intros]:
  fixes f::"real \<Rightarrow> real" (* by Fabian Immler and Johannes H?lzl *)
  assumes "D f \<mapsto> f' at t within T"
  shows "D (\<lambda>t. exp (f t *\<^sub>R A)) \<mapsto> (\<lambda>h. f' h *\<^sub>R (exp (f t *\<^sub>R A) * A)) at t within T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. D (\<lambda>t. exp (f t *\<^sub>R A)) \<mapsto> (\<lambda>h. f' h *\<^sub>R (exp (f t *\<^sub>R A) * A)) at t within T
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. D (\<lambda>t. exp (f t *\<^sub>R A)) \<mapsto> (\<lambda>h. f' h *\<^sub>R (exp (f t *\<^sub>R A) * A)) at t within T
[PROOF STEP]
have "bounded_linear f'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_linear f'
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
D f \<mapsto> f' at t within T

goal (1 subgoal):
 1. bounded_linear f'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
bounded_linear f'

goal (1 subgoal):
 1. D (\<lambda>t. exp (f t *\<^sub>R A)) \<mapsto> (\<lambda>h. f' h *\<^sub>R (exp (f t *\<^sub>R A) * A)) at t within T
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
bounded_linear f'
[PROOF STEP]
obtain m where obs: "f' = (\<lambda>h. h * m)"
[PROOF STATE]
proof (prove)
using this:
bounded_linear f'

goal (1 subgoal):
 1. (\<And>m. f' = (\<lambda>h. h * m) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using real_bounded_linear
[PROOF STATE]
proof (prove)
using this:
bounded_linear f'
bounded_linear ?f = (\<exists>c. ?f = (\<lambda>x. x * c))

goal (1 subgoal):
 1. (\<And>m. f' = (\<lambda>h. h * m) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f' = (\<lambda>h. h * m)

goal (1 subgoal):
 1. D (\<lambda>t. exp (f t *\<^sub>R A)) \<mapsto> (\<lambda>h. f' h *\<^sub>R (exp (f t *\<^sub>R A) * A)) at t within T
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
f' = (\<lambda>h. h * m)

goal (1 subgoal):
 1. D (\<lambda>t. exp (f t *\<^sub>R A)) \<mapsto> (\<lambda>h. f' h *\<^sub>R (exp (f t *\<^sub>R A) * A)) at t within T
[PROOF STEP]
using vector_diff_chain_within[OF _ exp_scaleR_has_vector_derivative_right]
      assms obs
[PROOF STATE]
proof (prove)
using this:
f' = (\<lambda>h. h * m)
(?f has_vector_derivative ?f') (at ?x within ?s) \<Longrightarrow> ((\<lambda>t. exp (t *\<^sub>R ?A1)) \<circ> ?f has_vector_derivative ?f' *\<^sub>R (exp (?f ?x *\<^sub>R ?A1) * ?A1)) (at ?x within ?s)
D f \<mapsto> f' at t within T
f' = (\<lambda>h. h * m)

goal (1 subgoal):
 1. D (\<lambda>t. exp (f t *\<^sub>R A)) \<mapsto> (\<lambda>h. f' h *\<^sub>R (exp (f t *\<^sub>R A) * A)) at t within T
[PROOF STEP]
by (auto simp: has_vector_derivative_def comp_def)
[PROOF STATE]
proof (state)
this:
D (\<lambda>t. exp (f t *\<^sub>R A)) \<mapsto> (\<lambda>h. f' h *\<^sub>R (exp (f t *\<^sub>R A) * A)) at t within T

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma euler_mascheroni_sum:
  "(\<lambda>n. inverse (of_nat (n+1)) + of_real (ln (of_nat (n+1))) - of_real (ln (of_nat (n+2))))
       sums (euler_mascheroni :: 'a :: {banach, real_normed_field})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. inverse (of_nat (n + 1)) + of_real (ln (real (n + 1))) - of_real (ln (real (n + 2)))) sums euler_mascheroni
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>n. inverse (of_nat (n + 1)) + of_real (ln (real (n + 1))) - of_real (ln (real (n + 2)))) sums euler_mascheroni
[PROOF STEP]
have "(\<lambda>n. of_real (inverse (of_nat (n+1)) + ln (of_nat (n+1)) - ln (of_nat (n+2))))
       sums (of_real euler_mascheroni :: 'a :: {banach, real_normed_field})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. of_real (inverse (real (n + 1)) + ln (real (n + 1)) - ln (real (n + 2)))) sums of_real euler_mascheroni
[PROOF STEP]
by (subst sums_of_real_iff) (rule euler_mascheroni_sum_real)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. of_real (inverse (real (n + 1)) + ln (real (n + 1)) - ln (real (n + 2)))) sums of_real euler_mascheroni

goal (1 subgoal):
 1. (\<lambda>n. inverse (of_nat (n + 1)) + of_real (ln (real (n + 1))) - of_real (ln (real (n + 2)))) sums euler_mascheroni
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. of_real (inverse (real (n + 1)) + ln (real (n + 1)) - ln (real (n + 2)))) sums of_real euler_mascheroni

goal (1 subgoal):
 1. (\<lambda>n. inverse (of_nat (n + 1)) + of_real (ln (real (n + 1))) - of_real (ln (real (n + 2)))) sums euler_mascheroni
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>n. inverse (of_nat (n + 1)) + of_real (ln (real (n + 1))) - of_real (ln (real (n + 2)))) sums euler_mascheroni

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dim_row_of_iter_tensor_of_H [simp]:
  assumes "n \<ge> 1"
  shows "1 < dim_row (H^\<^sub>\<otimes> n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < dim_row (Matrix.mat (2 ^ n) (2 ^ n) (\<lambda>x. complex_of_real (case x of (i, j) \<Rightarrow> (- 1) ^ i \<cdot>\<^bsub>n\<^esub>  j / sqrt 2 ^ n)))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
1 \<le> n

goal (1 subgoal):
 1. 1 < dim_row (Matrix.mat (2 ^ n) (2 ^ n) (\<lambda>x. complex_of_real (case x of (i, j) \<Rightarrow> (- 1) ^ i \<cdot>\<^bsub>n\<^esub>  j / sqrt 2 ^ n)))
[PROOF STEP]
by(metis One_nat_def Suc_1 dim_row_mat(1) le_trans lessI linorder_not_less one_less_power)


[STATEMENT]
lemma "collatz 5 [] = [5,16,8,4,2,1]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. collatz 5 [] = [5, 16, 8, 4, 2, 1]
[PROOF STEP]
by (simp add: collatz.simps even_case.simps)


[STATEMENT]
lemma gfp_while_lattice:
  fixes f :: "'a::complete_lattice \<Rightarrow> 'a"
  assumes "mono f" and "finite (UNIV :: 'a set)"
  shows "gfp f = while (\<lambda>A. f A \<noteq> A) f top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gfp f = while (\<lambda>A. f A \<noteq> A) f top
[PROOF STEP]
unfolding while_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gfp f = the (while_option (\<lambda>A. f A \<noteq> A) f top)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
mono f
finite UNIV

goal (1 subgoal):
 1. gfp f = the (while_option (\<lambda>A. f A \<noteq> A) f top)
[PROOF STEP]
by (rule gfp_the_while_option_lattice)


[STATEMENT]
lemma subtopology_eq_discrete_topology_finite:
   "\<lbrakk>t1_space X; S \<subseteq> topspace X; finite S\<rbrakk>
        \<Longrightarrow> subtopology X S = discrete_topology S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>t1_space X; S \<subseteq> topspace X; finite S\<rbrakk> \<Longrightarrow> subtopology X S = discrete_topology S
[PROOF STEP]
by (simp add: subtopology_eq_discrete_topology_eq t1_space_derived_set_of_finite)


[STATEMENT]
lemma Suc_times_gbinomial: "of_nat (Suc k) * ((a + 1) gchoose (Suc k)) = (a + 1) * (a gchoose k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat (Suc k) * (a + (1::'a) gchoose Suc k) = (a + (1::'a)) * (a gchoose k)
[PROOF STEP]
proof (cases k)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. k = 0 \<Longrightarrow> of_nat (Suc k) * (a + (1::'a) gchoose Suc k) = (a + (1::'a)) * (a gchoose k)
 2. \<And>nat. k = Suc nat \<Longrightarrow> of_nat (Suc k) * (a + (1::'a) gchoose Suc k) = (a + (1::'a)) * (a gchoose k)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
k = 0

goal (2 subgoals):
 1. k = 0 \<Longrightarrow> of_nat (Suc k) * (a + (1::'a) gchoose Suc k) = (a + (1::'a)) * (a gchoose k)
 2. \<And>nat. k = Suc nat \<Longrightarrow> of_nat (Suc k) * (a + (1::'a) gchoose Suc k) = (a + (1::'a)) * (a gchoose k)
[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. of_nat (Suc k) * (a + (1::'a) gchoose Suc k) = (a + (1::'a)) * (a gchoose k)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
of_nat (Suc k) * (a + (1::'a) gchoose Suc k) = (a + (1::'a)) * (a gchoose k)

goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> of_nat (Suc k) * (a + (1::'a) gchoose Suc k) = (a + (1::'a)) * (a gchoose k)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> of_nat (Suc k) * (a + (1::'a) gchoose Suc k) = (a + (1::'a)) * (a gchoose k)
[PROOF STEP]
case (Suc b)
[PROOF STATE]
proof (state)
this:
k = Suc b

goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> of_nat (Suc k) * (a + (1::'a) gchoose Suc k) = (a + (1::'a)) * (a gchoose k)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
k = Suc b
[PROOF STEP]
have "((a + 1) gchoose (Suc (Suc b))) = (\<Prod>i = 0..Suc b. a + (1 - of_nat i)) / fact (b + 2)"
[PROOF STATE]
proof (prove)
using this:
k = Suc b

goal (1 subgoal):
 1. a + (1::'a) gchoose Suc (Suc b) = (\<Prod>i = 0..Suc b. a + ((1::'a) - of_nat i)) / fact (b + 2)
[PROOF STEP]
by (simp add: field_simps gbinomial_prod_rev atLeastLessThanSuc_atLeastAtMost)
[PROOF STATE]
proof (state)
this:
a + (1::'a) gchoose Suc (Suc b) = (\<Prod>i = 0..Suc b. a + ((1::'a) - of_nat i)) / fact (b + 2)

goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> of_nat (Suc k) * (a + (1::'a) gchoose Suc k) = (a + (1::'a)) * (a gchoose k)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
a + (1::'a) gchoose Suc (Suc b) = (\<Prod>i = 0..Suc b. a + ((1::'a) - of_nat i)) / fact (b + 2)

goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> of_nat (Suc k) * (a + (1::'a) gchoose Suc k) = (a + (1::'a)) * (a gchoose k)
[PROOF STEP]
have "(\<Prod>i = 0..Suc b. a + (1 - of_nat i)) = (a + 1) * (\<Prod>i = 0..b. a - of_nat i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>i = 0..Suc b. a + ((1::'a) - of_nat i)) = (a + (1::'a)) * (\<Prod>i = 0..b. a - of_nat i)
[PROOF STEP]
by (simp add: prod.atLeast0_atMost_Suc_shift del: prod.cl_ivl_Suc)
[PROOF STATE]
proof (state)
this:
(\<Prod>i = 0..Suc b. a + ((1::'a) - of_nat i)) = (a + (1::'a)) * (\<Prod>i = 0..b. a - of_nat i)

goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> of_nat (Suc k) * (a + (1::'a) gchoose Suc k) = (a + (1::'a)) * (a gchoose k)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Prod>i = 0..Suc b. a + ((1::'a) - of_nat i)) = (a + (1::'a)) * (\<Prod>i = 0..b. a - of_nat i)

goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> of_nat (Suc k) * (a + (1::'a) gchoose Suc k) = (a + (1::'a)) * (a gchoose k)
[PROOF STEP]
have "\<dots> / fact (b + 2) = (a + 1) / of_nat (Suc (Suc b)) * (a gchoose Suc b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a + (1::'a)) * (\<Prod>i = 0..b. a - of_nat i) / fact (b + 2) = (a + (1::'a)) / of_nat (Suc (Suc b)) * (a gchoose Suc b)
[PROOF STEP]
by (simp_all add: gbinomial_prod_rev atLeastLessThanSuc_atLeastAtMost)
[PROOF STATE]
proof (state)
this:
(a + (1::'a)) * (\<Prod>i = 0..b. a - of_nat i) / fact (b + 2) = (a + (1::'a)) / of_nat (Suc (Suc b)) * (a gchoose Suc b)

goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> of_nat (Suc k) * (a + (1::'a) gchoose Suc k) = (a + (1::'a)) * (a gchoose k)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
a + (1::'a) gchoose Suc (Suc b) = (a + (1::'a)) / of_nat (Suc (Suc b)) * (a gchoose Suc b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a + (1::'a) gchoose Suc (Suc b) = (a + (1::'a)) / of_nat (Suc (Suc b)) * (a gchoose Suc b)

goal (1 subgoal):
 1. of_nat (Suc k) * (a + (1::'a) gchoose Suc k) = (a + (1::'a)) * (a gchoose k)
[PROOF STEP]
by (simp add: Suc field_simps del: of_nat_Suc)
[PROOF STATE]
proof (state)
this:
of_nat (Suc k) * (a + (1::'a) gchoose Suc k) = (a + (1::'a)) * (a gchoose k)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Nle_iff[simp]:
  assumes nx: "isnormNum x"
    and ny: "isnormNum y"
  shows "((INum x :: 'a::{field_char_0,linordered_field}) \<le> INum y) \<longleftrightarrow> x \<le>\<^sub>N y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (INum x \<le> INum y) = x \<le>\<^sub>N y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (INum x \<le> INum y) = x \<le>\<^sub>N y
[PROOF STEP]
have "((INum x ::'a) \<le> INum y) \<longleftrightarrow> INum (x -\<^sub>N y) \<le> (0::'a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (INum x \<le> INum y) = (INum (x -\<^sub>N y) \<le> (0::'a))
[PROOF STEP]
using nx ny
[PROOF STATE]
proof (prove)
using this:
isnormNum x
isnormNum y

goal (1 subgoal):
 1. (INum x \<le> INum y) = (INum (x -\<^sub>N y) \<le> (0::'a))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(INum x \<le> INum y) = (INum (x -\<^sub>N y) \<le> (0::'a))

goal (1 subgoal):
 1. (INum x \<le> INum y) = x \<le>\<^sub>N y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(INum x \<le> INum y) = (INum (x -\<^sub>N y) \<le> (0::'a))

goal (1 subgoal):
 1. (INum x \<le> INum y) = x \<le>\<^sub>N y
[PROOF STEP]
have "\<dots> \<longleftrightarrow> 0\<ge>\<^sub>N (x -\<^sub>N y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (INum (x -\<^sub>N y) \<le> (0::'a)) = 0\<ge>\<^sub>N (x -\<^sub>N y)
[PROOF STEP]
using Nle0_iff[OF Nsub_normN[OF ny]]
[PROOF STATE]
proof (prove)
using this:
(INum (?x1 -\<^sub>N y) \<le> (0::?'a)) = 0\<ge>\<^sub>N (?x1 -\<^sub>N y)

goal (1 subgoal):
 1. (INum (x -\<^sub>N y) \<le> (0::'a)) = 0\<ge>\<^sub>N (x -\<^sub>N y)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(INum (x -\<^sub>N y) \<le> (0::'a)) = 0\<ge>\<^sub>N (x -\<^sub>N y)

goal (1 subgoal):
 1. (INum x \<le> INum y) = x \<le>\<^sub>N y
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(INum x \<le> INum y) = 0\<ge>\<^sub>N (x -\<^sub>N y)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(INum x \<le> INum y) = 0\<ge>\<^sub>N (x -\<^sub>N y)

goal (1 subgoal):
 1. (INum x \<le> INum y) = x \<le>\<^sub>N y
[PROOF STEP]
by (simp add: Nle_def)
[PROOF STATE]
proof (state)
this:
(INum x \<le> INum y) = x \<le>\<^sub>N y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mult_eq_0_not_zero_divisor_left[simp]:
  fixes a b :: "'a :: mult_zero"
  assumes "\<not> zero_divisor a"
  shows "a * b = 0 \<longleftrightarrow> b = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a * b = (0::'a)) = (b = (0::'a))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<not> zero_divisor a

goal (1 subgoal):
 1. (a * b = (0::'a)) = (b = (0::'a))
[PROOF STEP]
unfolding zero_divisor_def
[PROOF STATE]
proof (prove)
using this:
\<nexists>b. b \<noteq> (0::'a) \<and> a * b = (0::'a)

goal (1 subgoal):
 1. (a * b = (0::'a)) = (b = (0::'a))
[PROOF STEP]
by force


[STATEMENT]
lemma Subspace_dim_le :
  assumes "Subspace U"
  shows   "dim U \<le> dim V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_R U \<le> dim_R V
[PROOF STEP]
using   assms findim
[PROOF STATE]
proof (prove)
using this:
Subspace U
\<exists>ms. set ms \<subseteq> V \<and> RSpan ms = V

goal (1 subgoal):
 1. dim_R U \<le> dim_R V
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>Subspace U; \<exists>ms. set ms \<subseteq> V \<and> RSpan ms = V\<rbrakk> \<Longrightarrow> dim_R U \<le> dim_R V
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
Subspace U
[PROOF STEP]
obtain us where "basis_for U us"
[PROOF STATE]
proof (prove)
using this:
Subspace U

goal (1 subgoal):
 1. (\<And>us. set us \<subseteq> U \<and> U = RSpan us \<and> R_lin_independent us \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using Subspace_is_findim SubspaceD1
          VectorSpace.FinDimVectorSpaceI[of "(\<cdot>)" U]
          FinDimVectorSpace.basis_ex[of "(\<cdot>)" U]
[PROOF STATE]
proof (prove)
using this:
Subspace U
Subspace ?U \<Longrightarrow> \<exists>ms. set ms \<subseteq> ?U \<and> RSpan ms = ?U
Subspace ?U \<Longrightarrow> VectorSpace (\<cdot>) ?U
\<lbrakk>VectorSpace (\<cdot>) U; \<exists>ms. set ms \<subseteq> U \<and> RSpan ms = U\<rbrakk> \<Longrightarrow> FinDimVectorSpace (\<cdot>) U
FinDimVectorSpace (\<cdot>) U \<Longrightarrow> \<exists>vs. set vs \<subseteq> U \<and> U = RSpan vs \<and> R_lin_independent vs

goal (1 subgoal):
 1. (\<And>us. set us \<subseteq> U \<and> U = RSpan us \<and> R_lin_independent us \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by    auto
[PROOF STATE]
proof (state)
this:
set us \<subseteq> U \<and> U = RSpan us \<and> R_lin_independent us

goal (1 subgoal):
 1. \<lbrakk>Subspace U; \<exists>ms. set ms \<subseteq> V \<and> RSpan ms = V\<rbrakk> \<Longrightarrow> dim_R U \<le> dim_R V
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
Subspace U
set us \<subseteq> U \<and> U = RSpan us \<and> R_lin_independent us
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Subspace U
set us \<subseteq> U \<and> U = RSpan us \<and> R_lin_independent us

goal (1 subgoal):
 1. dim_R U \<le> dim_R V
[PROOF STEP]
using RSpan_contains_spanset[of us] lin_independent_length_le_dim[of us]
          SubspaceD1 VectorSpace.dim_eq_size_basis[of "(\<cdot>)" U us]
[PROOF STATE]
proof (prove)
using this:
Subspace U
set us \<subseteq> U \<and> U = RSpan us \<and> R_lin_independent us
set us \<subseteq> V \<Longrightarrow> set us \<subseteq> RSpan us
\<lbrakk>set us \<subseteq> V; R_lin_independent us\<rbrakk> \<Longrightarrow> length us \<le> dim_R V
Subspace ?U \<Longrightarrow> VectorSpace (\<cdot>) ?U
\<lbrakk>VectorSpace (\<cdot>) U; set us \<subseteq> U \<and> U = RSpan us \<and> R_lin_independent us\<rbrakk> \<Longrightarrow> length us = dim_R U

goal (1 subgoal):
 1. dim_R U \<le> dim_R V
[PROOF STEP]
by    auto
[PROOF STATE]
proof (state)
this:
dim_R U \<le> dim_R V

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Zn_iso_DirProds_prime_powers':
  assumes "n \<noteq> 0"
  shows "Z n \<cong> DirProds (\<lambda>p. Z p) ((\<lambda>p. p ^ multiplicity p n) ` (prime_factors n))" (is "Z n \<cong> ?DP")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Z n \<cong> DirProds Z ((\<lambda>p. p ^ multiplicity p n) ` prime_factors n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Z n \<cong> DirProds Z ((\<lambda>p. p ^ multiplicity p n) ` prime_factors n)
[PROOF STEP]
have cp: "(\<lambda>p. Z (p ^ multiplicity p n)) = (\<lambda>p. Z p) \<circ> (\<lambda>p. p ^ multiplicity p n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>p. Z (p ^ multiplicity p n)) = Z \<circ> (\<lambda>p. p ^ multiplicity p n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>p. Z (p ^ multiplicity p n)) = Z \<circ> (\<lambda>p. p ^ multiplicity p n)

goal (1 subgoal):
 1. Z n \<cong> DirProds Z ((\<lambda>p. p ^ multiplicity p n) ` prime_factors n)
[PROOF STEP]
have "DirProds (\<lambda>p. Z (p ^ multiplicity p n)) (prime_factors n) \<cong> ?DP"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. DirProds (\<lambda>p. Z (p ^ multiplicity p n)) (prime_factors n) \<cong> DirProds Z ((\<lambda>p. p ^ multiplicity p n) ` prime_factors n)
[PROOF STEP]
proof(subst cp, intro DirProds_iso2)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. inj_on (\<lambda>p. p ^ multiplicity p n) (prime_factors n)
 2. Group.group (DirProds Z ((\<lambda>p. p ^ multiplicity p n) ` prime_factors n))
[PROOF STEP]
show "inj_on (\<lambda>p. p ^ multiplicity p n) (prime_factors n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (\<lambda>p. p ^ multiplicity p n) (prime_factors n)
[PROOF STEP]
by (intro inj_onI; simp add: prime_factors_multiplicity prime_power_inj'')
[PROOF STATE]
proof (state)
this:
inj_on (\<lambda>p. p ^ multiplicity p n) (prime_factors n)

goal (1 subgoal):
 1. Group.group (DirProds Z ((\<lambda>p. p ^ multiplicity p n) ` prime_factors n))
[PROOF STEP]
show "group (DirProds Z ((\<lambda>p. p ^ multiplicity p n) ` prime_factors n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.group (DirProds Z ((\<lambda>p. p ^ multiplicity p n) ` prime_factors n))
[PROOF STEP]
by (intro DirProds_is_group, use group_integer_mod_group in auto)
[PROOF STATE]
proof (state)
this:
Group.group (DirProds Z ((\<lambda>p. p ^ multiplicity p n) ` prime_factors n))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
DirProds (\<lambda>p. Z (p ^ multiplicity p n)) (prime_factors n) \<cong> DirProds Z ((\<lambda>p. p ^ multiplicity p n) ` prime_factors n)

goal (1 subgoal):
 1. Z n \<cong> DirProds Z ((\<lambda>p. p ^ multiplicity p n) ` prime_factors n)
[PROOF STEP]
with Zn_iso_DirProds_prime_powers[OF assms]
[PROOF STATE]
proof (chain)
picking this:
Z n \<cong> DirProds (\<lambda>p. Z (p ^ multiplicity p n)) (prime_factors n)
DirProds (\<lambda>p. Z (p ^ multiplicity p n)) (prime_factors n) \<cong> DirProds Z ((\<lambda>p. p ^ multiplicity p n) ` prime_factors n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Z n \<cong> DirProds (\<lambda>p. Z (p ^ multiplicity p n)) (prime_factors n)
DirProds (\<lambda>p. Z (p ^ multiplicity p n)) (prime_factors n) \<cong> DirProds Z ((\<lambda>p. p ^ multiplicity p n) ` prime_factors n)

goal (1 subgoal):
 1. Z n \<cong> DirProds Z ((\<lambda>p. p ^ multiplicity p n) ` prime_factors n)
[PROOF STEP]
using Group.iso_trans
[PROOF STATE]
proof (prove)
using this:
Z n \<cong> DirProds (\<lambda>p. Z (p ^ multiplicity p n)) (prime_factors n)
DirProds (\<lambda>p. Z (p ^ multiplicity p n)) (prime_factors n) \<cong> DirProds Z ((\<lambda>p. p ^ multiplicity p n) ` prime_factors n)
\<lbrakk>?G \<cong> ?H; ?H \<cong> ?I\<rbrakk> \<Longrightarrow> ?G \<cong> ?I

goal (1 subgoal):
 1. Z n \<cong> DirProds Z ((\<lambda>p. p ^ multiplicity p n) ` prime_factors n)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Z n \<cong> DirProds Z ((\<lambda>p. p ^ multiplicity p n) ` prime_factors n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma interval_integral_const [intro, simp]:
  fixes a b c :: real
  shows "interval_lebesgue_integrable lborel a b (\<lambda>x. c)" and "LBINT x=a..b. c = c * (b - a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interval_lebesgue_integrable lborel (ereal a) (ereal b) (\<lambda>x. c) &&& LBINT x=ereal a..ereal b. c = c * (b - a)
[PROOF STEP]
unfolding interval_lebesgue_integral_def interval_lebesgue_integrable_def einterval_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. if ereal a \<le> ereal b then set_integrable lborel {a<..<b} (\<lambda>x. c) else set_integrable lborel {b<..<a} (\<lambda>x. c) &&& (if ereal a \<le> ereal b then LBINT x:{a<..<b}. c else - (LBINT x:{b<..<a}. c)) = c * (b - a)
[PROOF STEP]
by (auto simp: less_imp_le field_simps measure_def set_integrable_def set_lebesgue_integral_def)


[STATEMENT]
lemma list_all3_list_all2_eq: "list_all3 P xs ys zs \<longleftrightarrow>
  (length xs = length ys \<and> list_all2 (case_prod P) (zip xs ys) zs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_all3 P xs ys zs = (length xs = length ys \<and> list_all2 (\<lambda>(x, y). P x y) (zip xs ys) zs)
[PROOF STEP]
using list_all2_list_all3I list_all3_list_all2D
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>length ?xs = length ?ys; list_all2 (\<lambda>(x, y). ?P x y) (zip ?xs ?ys) ?zs\<rbrakk> \<Longrightarrow> list_all3 ?P ?xs ?ys ?zs
list_all3 ?P ?xs ?ys ?zs \<Longrightarrow> length ?xs = length ?ys \<and> list_all2 (\<lambda>(x, y). ?P x y) (zip ?xs ?ys) ?zs

goal (1 subgoal):
 1. list_all3 P xs ys zs = (length xs = length ys \<and> list_all2 (\<lambda>(x, y). P x y) (zip xs ys) zs)
[PROOF STEP]
by blast


[STATEMENT]
lemma orthogonal_complement_closed_subspace[simp]:
  "closed_csubspace (orthogonal_complement A)"
  for A :: \<open>('a::complex_inner) set\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed_csubspace (orthogonal_complement A)
[PROOF STEP]
proof (intro closed_csubspace.intro complex_vector.subspaceI)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. (0::'a) \<in> orthogonal_complement A
 2. \<And>x y. \<lbrakk>x \<in> orthogonal_complement A; y \<in> orthogonal_complement A\<rbrakk> \<Longrightarrow> x + y \<in> orthogonal_complement A
 3. \<And>c x. x \<in> orthogonal_complement A \<Longrightarrow> c *\<^sub>C x \<in> orthogonal_complement A
 4. closed (orthogonal_complement A)
[PROOF STEP]
fix x y and c
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. (0::'a) \<in> orthogonal_complement A
 2. \<And>x y. \<lbrakk>x \<in> orthogonal_complement A; y \<in> orthogonal_complement A\<rbrakk> \<Longrightarrow> x + y \<in> orthogonal_complement A
 3. \<And>c x. x \<in> orthogonal_complement A \<Longrightarrow> c *\<^sub>C x \<in> orthogonal_complement A
 4. closed (orthogonal_complement A)
[PROOF STEP]
show \<open>0 \<in> orthogonal_complement A\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) \<in> orthogonal_complement A
[PROOF STEP]
by (rule orthogonal_complementI, simp)
[PROOF STATE]
proof (state)
this:
(0::'a) \<in> orthogonal_complement A

goal (3 subgoals):
 1. \<And>x y. \<lbrakk>x \<in> orthogonal_complement A; y \<in> orthogonal_complement A\<rbrakk> \<Longrightarrow> x + y \<in> orthogonal_complement A
 2. \<And>c x. x \<in> orthogonal_complement A \<Longrightarrow> c *\<^sub>C x \<in> orthogonal_complement A
 3. closed (orthogonal_complement A)
[PROOF STEP]
show \<open>x + y \<in> orthogonal_complement A\<close>
    if \<open>x \<in> orthogonal_complement A\<close> and \<open>y \<in> orthogonal_complement A\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x + y \<in> orthogonal_complement A
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
x \<in> orthogonal_complement A
y \<in> orthogonal_complement A

goal (1 subgoal):
 1. x + y \<in> orthogonal_complement A
[PROOF STEP]
by (auto intro!: orthogonal_complementI dest!: orthogonal_complement_orthoI
        simp add: cinner_add_left)
[PROOF STATE]
proof (state)
this:
\<lbrakk>x \<in> orthogonal_complement A; y \<in> orthogonal_complement A\<rbrakk> \<Longrightarrow> x + y \<in> orthogonal_complement A

goal (2 subgoals):
 1. \<And>c x. x \<in> orthogonal_complement A \<Longrightarrow> c *\<^sub>C x \<in> orthogonal_complement A
 2. closed (orthogonal_complement A)
[PROOF STEP]
show \<open>c *\<^sub>C x \<in> orthogonal_complement A\<close> if \<open>x \<in> orthogonal_complement A\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c *\<^sub>C x \<in> orthogonal_complement A
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
x \<in> orthogonal_complement A

goal (1 subgoal):
 1. c *\<^sub>C x \<in> orthogonal_complement A
[PROOF STEP]
by (auto intro!: orthogonal_complementI dest!: orthogonal_complement_orthoI)
[PROOF STATE]
proof (state)
this:
x \<in> orthogonal_complement A \<Longrightarrow> c *\<^sub>C x \<in> orthogonal_complement A

goal (1 subgoal):
 1. closed (orthogonal_complement A)
[PROOF STEP]
show "closed (orthogonal_complement A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed (orthogonal_complement A)
[PROOF STEP]
proof (auto simp add: closed_sequential_limits, rename_tac an a)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>an a. \<lbrakk>\<forall>n. an n \<in> orthogonal_complement A; an \<longlonglongrightarrow> a\<rbrakk> \<Longrightarrow> a \<in> orthogonal_complement A
[PROOF STEP]
fix an a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>an a. \<lbrakk>\<forall>n. an n \<in> orthogonal_complement A; an \<longlonglongrightarrow> a\<rbrakk> \<Longrightarrow> a \<in> orthogonal_complement A
[PROOF STEP]
assume ortho: \<open>\<forall>n::nat. an n \<in> orthogonal_complement A\<close>
[PROOF STATE]
proof (state)
this:
\<forall>n. an n \<in> orthogonal_complement A

goal (1 subgoal):
 1. \<And>an a. \<lbrakk>\<forall>n. an n \<in> orthogonal_complement A; an \<longlonglongrightarrow> a\<rbrakk> \<Longrightarrow> a \<in> orthogonal_complement A
[PROOF STEP]
assume lim: \<open>an \<longlonglongrightarrow> a\<close>
[PROOF STATE]
proof (state)
this:
an \<longlonglongrightarrow> a

goal (1 subgoal):
 1. \<And>an a. \<lbrakk>\<forall>n. an n \<in> orthogonal_complement A; an \<longlonglongrightarrow> a\<rbrakk> \<Longrightarrow> a \<in> orthogonal_complement A
[PROOF STEP]
have \<open>\<forall> y \<in> A. \<forall> n. is_orthogonal y (an n)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>y\<in>A. \<forall>n. is_orthogonal y (an n)
[PROOF STEP]
using orthogonal_complement_orthoI'
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> ?M; ?y \<in> orthogonal_complement ?M\<rbrakk> \<Longrightarrow> is_orthogonal ?x ?y

goal (1 subgoal):
 1. \<forall>y\<in>A. \<forall>n. is_orthogonal y (an n)
[PROOF STEP]
by (simp add: orthogonal_complement_orthoI' ortho)
[PROOF STATE]
proof (state)
this:
\<forall>y\<in>A. \<forall>n. is_orthogonal y (an n)

goal (1 subgoal):
 1. \<And>an a. \<lbrakk>\<forall>n. an n \<in> orthogonal_complement A; an \<longlonglongrightarrow> a\<rbrakk> \<Longrightarrow> a \<in> orthogonal_complement A
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>y\<in>A. \<forall>n. is_orthogonal y (an n)

goal (1 subgoal):
 1. \<And>an a. \<lbrakk>\<forall>n. an n \<in> orthogonal_complement A; an \<longlonglongrightarrow> a\<rbrakk> \<Longrightarrow> a \<in> orthogonal_complement A
[PROOF STEP]
have \<open>isCont (\<lambda> x. y \<bullet>\<^sub>C x) a\<close> for y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont ((\<bullet>\<^sub>C) y) a
[PROOF STEP]
using bounded_clinear_cinner_right clinear_continuous_at
[PROOF STATE]
proof (prove)
using this:
bounded_clinear ((\<bullet>\<^sub>C) ?a)
bounded_clinear ?f \<Longrightarrow> isCont ?f ?x

goal (1 subgoal):
 1. isCont ((\<bullet>\<^sub>C) y) a
[PROOF STEP]
by (simp add: clinear_continuous_at bounded_clinear_cinner_right)
[PROOF STATE]
proof (state)
this:
isCont ((\<bullet>\<^sub>C) ?y) a

goal (1 subgoal):
 1. \<And>an a. \<lbrakk>\<forall>n. an n \<in> orthogonal_complement A; an \<longlonglongrightarrow> a\<rbrakk> \<Longrightarrow> a \<in> orthogonal_complement A
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>y\<in>A. \<forall>n. is_orthogonal y (an n)
isCont ((\<bullet>\<^sub>C) ?y) a
[PROOF STEP]
have \<open>(\<lambda> n. (\<lambda> v. y \<bullet>\<^sub>C v) (an n)) \<longlonglongrightarrow> (\<lambda> v. y \<bullet>\<^sub>C v) a\<close> for y
[PROOF STATE]
proof (prove)
using this:
\<forall>y\<in>A. \<forall>n. is_orthogonal y (an n)
isCont ((\<bullet>\<^sub>C) ?y) a

goal (1 subgoal):
 1. (\<lambda>n. y \<bullet>\<^sub>C an n) \<longlonglongrightarrow> y \<bullet>\<^sub>C a
[PROOF STEP]
using isCont_tendsto_compose
[PROOF STATE]
proof (prove)
using this:
\<forall>y\<in>A. \<forall>n. is_orthogonal y (an n)
isCont ((\<bullet>\<^sub>C) ?y) a
\<lbrakk>isCont ?g ?l; (?f \<longlongrightarrow> ?l) ?F\<rbrakk> \<Longrightarrow> ((\<lambda>x. ?g (?f x)) \<longlongrightarrow> ?g ?l) ?F

goal (1 subgoal):
 1. (\<lambda>n. y \<bullet>\<^sub>C an n) \<longlonglongrightarrow> y \<bullet>\<^sub>C a
[PROOF STEP]
by (simp add: isCont_tendsto_compose lim)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. ?y \<bullet>\<^sub>C an n) \<longlonglongrightarrow> ?y \<bullet>\<^sub>C a

goal (1 subgoal):
 1. \<And>an a. \<lbrakk>\<forall>n. an n \<in> orthogonal_complement A; an \<longlonglongrightarrow> a\<rbrakk> \<Longrightarrow> a \<in> orthogonal_complement A
[PROOF STEP]
hence  \<open>\<forall> y\<in>A. (\<lambda> n. y \<bullet>\<^sub>C an n) \<longlonglongrightarrow>  y \<bullet>\<^sub>C a\<close>
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. ?y \<bullet>\<^sub>C an n) \<longlonglongrightarrow> ?y \<bullet>\<^sub>C a

goal (1 subgoal):
 1. \<forall>y\<in>A. (\<lambda>n. y \<bullet>\<^sub>C an n) \<longlonglongrightarrow> y \<bullet>\<^sub>C a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>y\<in>A. (\<lambda>n. y \<bullet>\<^sub>C an n) \<longlonglongrightarrow> y \<bullet>\<^sub>C a

goal (1 subgoal):
 1. \<And>an a. \<lbrakk>\<forall>n. an n \<in> orthogonal_complement A; an \<longlonglongrightarrow> a\<rbrakk> \<Longrightarrow> a \<in> orthogonal_complement A
[PROOF STEP]
hence  \<open>\<forall> y\<in>A. (\<lambda> n. 0) \<longlonglongrightarrow>  y \<bullet>\<^sub>C a\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>y\<in>A. (\<lambda>n. y \<bullet>\<^sub>C an n) \<longlonglongrightarrow> y \<bullet>\<^sub>C a

goal (1 subgoal):
 1. \<forall>y\<in>A. (\<lambda>n. 0) \<longlonglongrightarrow> y \<bullet>\<^sub>C a
[PROOF STEP]
using \<open>\<forall> y \<in> A. \<forall> n. is_orthogonal y (an n)\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>y\<in>A. (\<lambda>n. y \<bullet>\<^sub>C an n) \<longlonglongrightarrow> y \<bullet>\<^sub>C a
\<forall>y\<in>A. \<forall>n. is_orthogonal y (an n)

goal (1 subgoal):
 1. \<forall>y\<in>A. (\<lambda>n. 0) \<longlonglongrightarrow> y \<bullet>\<^sub>C a
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<forall>y\<in>A. (\<lambda>n. 0) \<longlonglongrightarrow> y \<bullet>\<^sub>C a

goal (1 subgoal):
 1. \<And>an a. \<lbrakk>\<forall>n. an n \<in> orthogonal_complement A; an \<longlonglongrightarrow> a\<rbrakk> \<Longrightarrow> a \<in> orthogonal_complement A
[PROOF STEP]
hence  \<open>\<forall> y \<in> A. is_orthogonal y a\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>y\<in>A. (\<lambda>n. 0) \<longlonglongrightarrow> y \<bullet>\<^sub>C a

goal (1 subgoal):
 1. \<forall>y\<in>A. is_orthogonal y a
[PROOF STEP]
using limI
[PROOF STATE]
proof (prove)
using this:
\<forall>y\<in>A. (\<lambda>n. 0) \<longlonglongrightarrow> y \<bullet>\<^sub>C a
?X \<longlonglongrightarrow> ?L \<Longrightarrow> lim ?X = ?L

goal (1 subgoal):
 1. \<forall>y\<in>A. is_orthogonal y a
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<forall>y\<in>A. is_orthogonal y a

goal (1 subgoal):
 1. \<And>an a. \<lbrakk>\<forall>n. an n \<in> orthogonal_complement A; an \<longlonglongrightarrow> a\<rbrakk> \<Longrightarrow> a \<in> orthogonal_complement A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>y\<in>A. is_orthogonal y a
[PROOF STEP]
show \<open>a \<in> orthogonal_complement A\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>y\<in>A. is_orthogonal y a

goal (1 subgoal):
 1. a \<in> orthogonal_complement A
[PROOF STEP]
by (simp add: orthogonal_complementI is_orthogonal_sym)
[PROOF STATE]
proof (state)
this:
a \<in> orthogonal_complement A

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
closed (orthogonal_complement A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prodinf_pos_iff:
  fixes f :: "nat \<Rightarrow> real"
  assumes "convergent_prod f" "\<And>n. 1 \<le> f n"
  shows "1 < prodinf f \<longleftrightarrow> (\<exists>i. 1 < f i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 < prodinf f) = (\<exists>i. 1 < f i)
[PROOF STEP]
using prod_le_prodinf[of f 1] prodinf_eq_one_iff
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>f has_prod 1; \<And>i. 0 \<le> f i; \<And>i. ?n \<le> i \<Longrightarrow> 1 \<le> f i\<rbrakk> \<Longrightarrow> prod f {..<?n} \<le> prodinf f
\<lbrakk>convergent_prod ?f; \<And>n. 1 \<le> ?f n\<rbrakk> \<Longrightarrow> (prodinf ?f = 1) = (\<forall>n. ?f n = 1)

goal (1 subgoal):
 1. (1 < prodinf f) = (\<exists>i. 1 < f i)
[PROOF STEP]
by (metis convergent_prod_has_prod assms less_le prodinf_nonneg)


[STATEMENT]
lemma arcsin_minus_1 [simp]: "arcsin (- 1) = - (pi/2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arcsin (- 1) = - (pi / 2)
[PROOF STEP]
using arcsin_sin [of "- pi/2"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>- (pi / 2) \<le> - pi / 2; - pi / 2 \<le> pi / 2\<rbrakk> \<Longrightarrow> arcsin (sin (- pi / 2)) = - pi / 2

goal (1 subgoal):
 1. arcsin (- 1) = - (pi / 2)
[PROOF STEP]
by simp


[STATEMENT]
lemma omega_simulation: "z \<cdot> x \<le> y \<cdot> z \<Longrightarrow> z \<cdot> x\<^sup>\<omega> \<le> y\<^sup>\<omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<cdot> x \<le> y \<cdot> z \<Longrightarrow> z \<cdot> x\<^sup>\<omega> \<le> y\<^sup>\<omega>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. z \<cdot> x \<le> y \<cdot> z \<Longrightarrow> z \<cdot> x\<^sup>\<omega> \<le> y\<^sup>\<omega>
[PROOF STEP]
assume hyp: "z \<cdot> x \<le> y \<cdot> z"
[PROOF STATE]
proof (state)
this:
z \<cdot> x \<le> y \<cdot> z

goal (1 subgoal):
 1. z \<cdot> x \<le> y \<cdot> z \<Longrightarrow> z \<cdot> x\<^sup>\<omega> \<le> y\<^sup>\<omega>
[PROOF STEP]
have "z \<cdot> x\<^sup>\<omega> = z \<cdot> x \<cdot> x\<^sup>\<omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<cdot> x\<^sup>\<omega> = z \<cdot> x \<cdot> x\<^sup>\<omega>
[PROOF STEP]
by (simp add: mult_assoc)
[PROOF STATE]
proof (state)
this:
z \<cdot> x\<^sup>\<omega> = z \<cdot> x \<cdot> x\<^sup>\<omega>

goal (1 subgoal):
 1. z \<cdot> x \<le> y \<cdot> z \<Longrightarrow> z \<cdot> x\<^sup>\<omega> \<le> y\<^sup>\<omega>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
z \<cdot> x\<^sup>\<omega> = z \<cdot> x \<cdot> x\<^sup>\<omega>

goal (1 subgoal):
 1. z \<cdot> x \<le> y \<cdot> z \<Longrightarrow> z \<cdot> x\<^sup>\<omega> \<le> y\<^sup>\<omega>
[PROOF STEP]
have "... \<le> y \<cdot> z \<cdot> x\<^sup>\<omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<cdot> x \<cdot> x\<^sup>\<omega> \<le> y \<cdot> z \<cdot> x\<^sup>\<omega>
[PROOF STEP]
by (simp add: hyp local.mult_isor)
[PROOF STATE]
proof (state)
this:
z \<cdot> x \<cdot> x\<^sup>\<omega> \<le> y \<cdot> z \<cdot> x\<^sup>\<omega>

goal (1 subgoal):
 1. z \<cdot> x \<le> y \<cdot> z \<Longrightarrow> z \<cdot> x\<^sup>\<omega> \<le> y\<^sup>\<omega>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
z \<cdot> x\<^sup>\<omega> \<le> y \<cdot> z \<cdot> x\<^sup>\<omega>
[PROOF STEP]
show "z \<cdot> x\<^sup>\<omega> \<le> y\<^sup>\<omega>"
[PROOF STATE]
proof (prove)
using this:
z \<cdot> x\<^sup>\<omega> \<le> y \<cdot> z \<cdot> x\<^sup>\<omega>

goal (1 subgoal):
 1. z \<cdot> x\<^sup>\<omega> \<le> y\<^sup>\<omega>
[PROOF STEP]
by (simp add: mult_assoc omega_coinduct_var2)
[PROOF STATE]
proof (state)
this:
z \<cdot> x\<^sup>\<omega> \<le> y\<^sup>\<omega>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma absolutely_integrable_mult_Fejer_kernel_reflected_part4:
  assumes f: "f absolutely_integrable_on {-pi..pi}"
    and periodic: "\<And>x. f(x + 2*pi) = f x" and "d \<le> pi"
  shows "(\<lambda>x. Fejer_kernel n x * (f(t + x) + f(t - x))) absolutely_integrable_on {0..d}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. Fejer_kernel n x * (f (t + x) + f (t - x))) absolutely_integrable_on {0..d}
[PROOF STEP]
unfolding distrib_left
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. Fejer_kernel n x * f (t + x) + Fejer_kernel n x * f (t - x)) absolutely_integrable_on {0..d}
[PROOF STEP]
by (intro set_integral_add absolutely_integrable_mult_Fejer_kernel_reflected_part1 absolutely_integrable_mult_Fejer_kernel_reflected_part2 assms)


[STATEMENT]
lemma powr_diff:
  fixes w:: "'a::{ln,real_normed_field}" shows  "w powr (z1 - z2) = w powr z1 / w powr z2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w powr (z1 - z2) = w powr z1 / w powr z2
[PROOF STEP]
by (simp add: powr_def algebra_simps exp_diff)


[STATEMENT]
lemma cardinalityIntersectionEquality:
  assumes "finite X" "finite Y" "card X = card Y"
  shows "(card (X\<inter>Y) = card X)     =    (X = Y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (card (X \<inter> Y) = card X) = (X = Y)
[PROOF STEP]
using assms lm084
[PROOF STATE]
proof (prove)
using this:
finite X
finite Y
card X = card Y
\<lbrakk>finite ?X; finite ?Y; card (?X \<inter> ?Y) = card ?X\<rbrakk> \<Longrightarrow> ?X \<subseteq> ?Y

goal (1 subgoal):
 1. (card (X \<inter> Y) = card X) = (X = Y)
[PROOF STEP]
by (metis card_seteq le_iff_inf order_refl)


[STATEMENT]
lemma sq_norm_smult_vec: "sq_norm ((c :: 'a :: {conjugatable_ring,comm_semiring_0}) \<cdot>\<^sub>v v) = (c * conjugate c) * sq_norm v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>c \<cdot>\<^sub>v v\<parallel>\<^sup>2 = sq_norm_conjugate c * \<parallel>v\<parallel>\<^sup>2
[PROOF STEP]
unfolding sq_norm_vec_as_cscalar_prod
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (c \<cdot>\<^sub>v v) \<bullet>c (c \<cdot>\<^sub>v v) = sq_norm_conjugate c * (v \<bullet>c v)
[PROOF STEP]
by (subst scalar_prod_smult_left, force, unfold conjugate_smult_vec,
    subst scalar_prod_smult_right, force, simp add: ac_simps)


[STATEMENT]
theorem ratio_test_convergence:
  fixes f :: "nat \<Rightarrow> real"
  assumes pos_f: "eventually (\<lambda>n. f n > 0) sequentially"
  defines "l \<equiv> liminf (\<lambda>n. ereal (f n / f (Suc n)))"
  assumes l: "l > 1"
  shows   "summable f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable f
[PROOF STEP]
proof (rule kummers_test_convergence[OF pos_f])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>\<^sub>F n in sequentially. 0 \<le> ?p n
 2. 0 < liminf (\<lambda>n. ereal (?p n * f n / f (Suc n) - ?p (Suc n)))
[PROOF STEP]
note l
[PROOF STATE]
proof (state)
this:
1 < l

goal (2 subgoals):
 1. \<forall>\<^sub>F n in sequentially. 0 \<le> ?p n
 2. 0 < liminf (\<lambda>n. ereal (?p n * f n / f (Suc n) - ?p (Suc n)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 < l

goal (2 subgoals):
 1. \<forall>\<^sub>F n in sequentially. 0 \<le> ?p n
 2. 0 < liminf (\<lambda>n. ereal (?p n * f n / f (Suc n) - ?p (Suc n)))
[PROOF STEP]
have "l = liminf (\<lambda>n. ereal (f n / f (Suc n) - 1)) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l = liminf (\<lambda>n. ereal (f n / f (Suc n) - 1)) + 1
[PROOF STEP]
by (subst Liminf_add_ereal_right[symmetric]) (simp_all add: minus_ereal_def l_def one_ereal_def)
[PROOF STATE]
proof (state)
this:
l = liminf (\<lambda>n. ereal (f n / f (Suc n) - 1)) + 1

goal (2 subgoals):
 1. \<forall>\<^sub>F n in sequentially. 0 \<le> ?p n
 2. 0 < liminf (\<lambda>n. ereal (?p n * f n / f (Suc n) - ?p (Suc n)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
1 < liminf (\<lambda>n. ereal (f n / f (Suc n) - 1)) + 1
[PROOF STEP]
show "liminf (\<lambda>n. ereal (1 * f n / f (Suc n) - 1)) > 0"
[PROOF STATE]
proof (prove)
using this:
1 < liminf (\<lambda>n. ereal (f n / f (Suc n) - 1)) + 1

goal (1 subgoal):
 1. 0 < liminf (\<lambda>n. ereal (1 * f n / f (Suc n) - 1))
[PROOF STEP]
by (cases "liminf (\<lambda>n. ereal (1 * f n / f (Suc n) - 1))") simp_all
[PROOF STATE]
proof (state)
this:
0 < liminf (\<lambda>n. ereal (1 * f n / f (Suc n) - 1))

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 0 \<le> 1
[PROOF STEP]
qed simp


[STATEMENT]
lemma norm_bound_elements_mat: "norm_bound A b = (\<forall> x \<in> elements_mat A. norm x \<le> b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm_bound A b = (\<forall>x\<in>elements_mat A. norm x \<le> b)
[PROOF STEP]
unfolding norm_bound_def elements_mat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>i j. i < dim_row A \<longrightarrow> j < dim_col A \<longrightarrow> norm (A $$ (i, j)) \<le> b) = (\<forall>x\<in>{A $$ (i, j) |i j. i < dim_row A \<and> j < dim_col A}. norm x \<le> b)
[PROOF STEP]
by auto


[STATEMENT]
theorem join_assoc: "(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 "dual ((x \<squnion> y) \<squnion> z) = (dual x \<sqinter> dual y) \<sqinter> dual z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dual (x \<squnion> y \<squnion> z) = dual x \<sqinter> dual y \<sqinter> dual z
[PROOF STEP]
by (simp only: dual_join)
[PROOF STATE]
proof (state)
this:
dual (x \<squnion> y \<squnion> z) = dual x \<sqinter> dual y \<sqinter> dual z

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

goal (1 subgoal):
 1. x \<squnion> y \<squnion> z = x \<squnion> (y \<squnion> z)
[PROOF STEP]
have "\<dots> = dual x \<sqinter> (dual y \<sqinter> dual z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dual x \<sqinter> dual y \<sqinter> dual z = dual x \<sqinter> (dual y \<sqinter> dual z)
[PROOF STEP]
by (rule meet_assoc)
[PROOF STATE]
proof (state)
this:
dual x \<sqinter> dual y \<sqinter> dual z = dual x \<sqinter> (dual y \<sqinter> dual z)

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

goal (1 subgoal):
 1. x \<squnion> y \<squnion> z = x \<squnion> (y \<squnion> z)
[PROOF STEP]
have "\<dots> = dual (x \<squnion> (y \<squnion> z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dual x \<sqinter> (dual y \<sqinter> dual z) = dual (x \<squnion> (y \<squnion> z))
[PROOF STEP]
by (simp only: dual_join)
[PROOF STATE]
proof (state)
this:
dual x \<sqinter> (dual y \<sqinter> dual z) = dual (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:
dual (x \<squnion> y \<squnion> z) = dual (x \<squnion> (y \<squnion> z))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
dual (x \<squnion> y \<squnion> z) = dual (x \<squnion> (y \<squnion> z))

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma degree_1_ipoly: assumes "degree p = Suc 0"
  shows "ipoly p x = 0 \<longleftrightarrow> (x = real_of_rat (Rat.Fract (- coeff p 0) (coeff p 1)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (poly (real_of_int_poly p) x = 0) = (x = real_of_rat (Rat.Fract (- coeff p 0) (coeff p 1)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (poly (real_of_int_poly p) x = 0) = (x = real_of_rat (Rat.Fract (- coeff p 0) (coeff p 1)))
[PROOF STEP]
from roots1[of "map_poly real_of_int p"] assms
[PROOF STATE]
proof (chain)
picking this:
degree (real_of_int_poly p) = 1 \<Longrightarrow> {x. poly (real_of_int_poly p) x = 0} = {roots1 (real_of_int_poly p)}
degree p = Suc 0
[PROOF STEP]
have "ipoly p x = 0 \<longleftrightarrow> x \<in> {roots1 (real_of_int_poly p)}"
[PROOF STATE]
proof (prove)
using this:
degree (real_of_int_poly p) = 1 \<Longrightarrow> {x. poly (real_of_int_poly p) x = 0} = {roots1 (real_of_int_poly p)}
degree p = Suc 0

goal (1 subgoal):
 1. (poly (real_of_int_poly p) x = 0) = (x \<in> {roots1 (real_of_int_poly p)})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(poly (real_of_int_poly p) x = 0) = (x \<in> {roots1 (real_of_int_poly p)})

goal (1 subgoal):
 1. (poly (real_of_int_poly p) x = 0) = (x = real_of_rat (Rat.Fract (- coeff p 0) (coeff p 1)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(poly (real_of_int_poly p) x = 0) = (x \<in> {roots1 (real_of_int_poly p)})

goal (1 subgoal):
 1. (poly (real_of_int_poly p) x = 0) = (x = real_of_rat (Rat.Fract (- coeff p 0) (coeff p 1)))
[PROOF STEP]
have "\<dots> = (x = real_of_rat (Rat.Fract (- coeff p 0) (coeff p 1)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> {roots1 (real_of_int_poly p)}) = (x = real_of_rat (Rat.Fract (- coeff p 0) (coeff p 1)))
[PROOF STEP]
unfolding Fract_of_int_quotient roots1_def hom_distribs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> {- coeff (real_of_int_poly p) 0 / coeff (real_of_int_poly p) 1}) = (x = - real_of_rat (rat_of_int (coeff p 0)) / real_of_rat (rat_of_int (coeff p 1)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(x \<in> {roots1 (real_of_int_poly p)}) = (x = real_of_rat (Rat.Fract (- coeff p 0) (coeff p 1)))

goal (1 subgoal):
 1. (poly (real_of_int_poly p) x = 0) = (x = real_of_rat (Rat.Fract (- coeff p 0) (coeff p 1)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(poly (real_of_int_poly p) x = 0) = (x = real_of_rat (Rat.Fract (- coeff p 0) (coeff p 1)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(poly (real_of_int_poly p) x = 0) = (x = real_of_rat (Rat.Fract (- coeff p 0) (coeff p 1)))

goal (1 subgoal):
 1. (poly (real_of_int_poly p) x = 0) = (x = real_of_rat (Rat.Fract (- coeff p 0) (coeff p 1)))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(poly (real_of_int_poly p) x = 0) = (x = real_of_rat (Rat.Fract (- coeff p 0) (coeff p 1)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lin_comb_sum_lin_indpt:
  fixes A :: "'a vec list"
  assumes "set (A) \<subseteq> carrier_vec n"
  assumes "distinct A"
  assumes "\<And> f. lincomb_list (\<lambda>i. f (A ! i)) A = 0\<^sub>v n \<Longrightarrow> \<forall>v\<in> (set A). f v = 0"
  shows "lin_indpt (set A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lin_indpt (set A)
[PROOF STEP]
by (rule finite_lin_indpt2, auto simp add: assms lincomb_as_lincomb_list_distinct)


[STATEMENT]
lemma rank_1_proj_projector:
  assumes "\<parallel>v\<parallel> = 1"
  shows "projector (rank_1_proj v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. projector (rank_1_proj v)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. projector (rank_1_proj v)
[PROOF STEP]
have  "Complex_Matrix.adjoint (rank_1_proj v) = rank_1_proj v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.adjoint (rank_1_proj v) = rank_1_proj v
[PROOF STEP]
using rank_1_proj_adjoint
[PROOF STATE]
proof (prove)
using this:
Complex_Matrix.adjoint (rank_1_proj ?v) = rank_1_proj ?v

goal (1 subgoal):
 1. Complex_Matrix.adjoint (rank_1_proj v) = rank_1_proj v
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint (rank_1_proj v) = rank_1_proj v

goal (1 subgoal):
 1. projector (rank_1_proj v)
[PROOF STEP]
hence a: "hermitian (rank_1_proj v)"
[PROOF STATE]
proof (prove)
using this:
Complex_Matrix.adjoint (rank_1_proj v) = rank_1_proj v

goal (1 subgoal):
 1. hermitian (rank_1_proj v)
[PROOF STEP]
unfolding hermitian_def
[PROOF STATE]
proof (prove)
using this:
Complex_Matrix.adjoint (rank_1_proj v) = rank_1_proj v

goal (1 subgoal):
 1. Complex_Matrix.adjoint (rank_1_proj v) = rank_1_proj v
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
hermitian (rank_1_proj v)

goal (1 subgoal):
 1. projector (rank_1_proj v)
[PROOF STEP]
have "rank_1_proj v * rank_1_proj v = inner_prod v v  \<cdot>\<^sub>m outer_prod v v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rank_1_proj v * rank_1_proj v = Complex_Matrix.inner_prod v v \<cdot>\<^sub>m outer_prod v v
[PROOF STEP]
unfolding rank_1_proj_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. outer_prod v v * outer_prod v v = Complex_Matrix.inner_prod v v \<cdot>\<^sub>m outer_prod v v
[PROOF STEP]
using outer_prod_mult_outer_prod assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?a \<in> carrier_vec ?d1.0; ?b \<in> carrier_vec ?d2.0; ?c \<in> carrier_vec ?d2.0; ?d \<in> carrier_vec ?d3.0\<rbrakk> \<Longrightarrow> outer_prod ?a ?b * outer_prod ?c ?d = Complex_Matrix.inner_prod ?b ?c \<cdot>\<^sub>m outer_prod ?a ?d
\<parallel>v\<parallel> = 1

goal (1 subgoal):
 1. outer_prod v v * outer_prod v v = Complex_Matrix.inner_prod v v \<cdot>\<^sub>m outer_prod v v
[PROOF STEP]
using carrier_vec_dim_vec
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?a \<in> carrier_vec ?d1.0; ?b \<in> carrier_vec ?d2.0; ?c \<in> carrier_vec ?d2.0; ?d \<in> carrier_vec ?d3.0\<rbrakk> \<Longrightarrow> outer_prod ?a ?b * outer_prod ?c ?d = Complex_Matrix.inner_prod ?b ?c \<cdot>\<^sub>m outer_prod ?a ?d
\<parallel>v\<parallel> = 1
?v \<in> carrier_vec (dim_vec ?v)

goal (1 subgoal):
 1. outer_prod v v * outer_prod v v = Complex_Matrix.inner_prod v v \<cdot>\<^sub>m outer_prod v v
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
rank_1_proj v * rank_1_proj v = Complex_Matrix.inner_prod v v \<cdot>\<^sub>m outer_prod v v

goal (1 subgoal):
 1. projector (rank_1_proj v)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
rank_1_proj v * rank_1_proj v = Complex_Matrix.inner_prod v v \<cdot>\<^sub>m outer_prod v v

goal (1 subgoal):
 1. projector (rank_1_proj v)
[PROOF STEP]
have "... = (vec_norm v)\<^sup>2  \<cdot>\<^sub>m outer_prod v v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.inner_prod v v \<cdot>\<^sub>m outer_prod v v = (vec_norm v)\<^sup>2 \<cdot>\<^sub>m outer_prod v v
[PROOF STEP]
unfolding vec_norm_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.inner_prod v v \<cdot>\<^sub>m outer_prod v v = (csqrt (Complex_Matrix.inner_prod v v))\<^sup>2 \<cdot>\<^sub>m outer_prod v v
[PROOF STEP]
using power2_csqrt
[PROOF STATE]
proof (prove)
using this:
(csqrt ?z)\<^sup>2 = ?z

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

goal (1 subgoal):
 1. projector (rank_1_proj v)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Complex_Matrix.inner_prod v v \<cdot>\<^sub>m outer_prod v v = (vec_norm v)\<^sup>2 \<cdot>\<^sub>m outer_prod v v

goal (1 subgoal):
 1. projector (rank_1_proj v)
[PROOF STEP]
have "... =  (cpx_vec_length v)\<^sup>2 \<cdot>\<^sub>m outer_prod v v "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (vec_norm v)\<^sup>2 \<cdot>\<^sub>m outer_prod v v = complex_of_real (\<parallel>v\<parallel>\<^sup>2) \<cdot>\<^sub>m outer_prod v v
[PROOF STEP]
using vec_norm_sq_cpx_vec_length_sq
[PROOF STATE]
proof (prove)
using this:
(vec_norm ?v)\<^sup>2 = complex_of_real (\<parallel>?v\<parallel>\<^sup>2)

goal (1 subgoal):
 1. (vec_norm v)\<^sup>2 \<cdot>\<^sub>m outer_prod v v = complex_of_real (\<parallel>v\<parallel>\<^sup>2) \<cdot>\<^sub>m outer_prod v v
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(vec_norm v)\<^sup>2 \<cdot>\<^sub>m outer_prod v v = complex_of_real (\<parallel>v\<parallel>\<^sup>2) \<cdot>\<^sub>m outer_prod v v

goal (1 subgoal):
 1. projector (rank_1_proj v)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(vec_norm v)\<^sup>2 \<cdot>\<^sub>m outer_prod v v = complex_of_real (\<parallel>v\<parallel>\<^sup>2) \<cdot>\<^sub>m outer_prod v v

goal (1 subgoal):
 1. projector (rank_1_proj v)
[PROOF STEP]
have "... = outer_prod v v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. complex_of_real (\<parallel>v\<parallel>\<^sup>2) \<cdot>\<^sub>m outer_prod v v = outer_prod v v
[PROOF STEP]
using assms state_qbit_norm_sq smult_one[of "outer_prod v v"]
[PROOF STATE]
proof (prove)
using this:
\<parallel>v\<parallel> = 1
?v \<in> state_qbit ?n \<Longrightarrow> \<parallel>?v\<parallel>\<^sup>2 = 1
1 \<cdot>\<^sub>m outer_prod v v = outer_prod v v

goal (1 subgoal):
 1. complex_of_real (\<parallel>v\<parallel>\<^sup>2) \<cdot>\<^sub>m outer_prod v v = outer_prod v v
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
complex_of_real (\<parallel>v\<parallel>\<^sup>2) \<cdot>\<^sub>m outer_prod v v = outer_prod v v

goal (1 subgoal):
 1. projector (rank_1_proj v)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
complex_of_real (\<parallel>v\<parallel>\<^sup>2) \<cdot>\<^sub>m outer_prod v v = outer_prod v v

goal (1 subgoal):
 1. projector (rank_1_proj v)
[PROOF STEP]
have "... = rank_1_proj v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. outer_prod v v = rank_1_proj v
[PROOF STEP]
unfolding rank_1_proj_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. outer_prod v v = outer_prod v v
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
outer_prod v v = rank_1_proj v

goal (1 subgoal):
 1. projector (rank_1_proj v)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
rank_1_proj v * rank_1_proj v = rank_1_proj v
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
rank_1_proj v * rank_1_proj v = rank_1_proj v

goal (1 subgoal):
 1. projector (rank_1_proj v)
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
rank_1_proj v * rank_1_proj v = rank_1_proj v
hermitian (rank_1_proj v)

goal (1 subgoal):
 1. projector (rank_1_proj v)
[PROOF STEP]
unfolding projector_def
[PROOF STATE]
proof (prove)
using this:
rank_1_proj v * rank_1_proj v = rank_1_proj v
hermitian (rank_1_proj v)

goal (1 subgoal):
 1. hermitian (rank_1_proj v) \<and> rank_1_proj v * rank_1_proj v = rank_1_proj v
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
projector (rank_1_proj v)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma translate_scale_01:
  assumes "a \<le> b"
  shows "(\<lambda>x. a + (b - a) * x) ` {0..1} = {a..b::real}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. a + (b - a) * x) ` {0..1} = {a..b}
[PROOF STEP]
using closed_segment_real_eq [of a b] assms closed_segment_eq_real_ivl
[PROOF STATE]
proof (prove)
using this:
closed_segment a b = (\<lambda>x. (b - a) * x + a) ` {0..1}
a \<le> b
closed_segment ?a ?b = (if ?a \<le> ?b then {?a..?b} else {?b..?a})

goal (1 subgoal):
 1. (\<lambda>x. a + (b - a) * x) ` {0..1} = {a..b}
[PROOF STEP]
by auto


[STATEMENT]
lemma interval_lowerbound[simp]:
  "\<forall>i\<in>Basis. a\<bullet>i \<le> b\<bullet>i \<Longrightarrow>
    interval_lowerbound (cbox a b) = (a::'a::euclidean_space)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i\<in>Basis. a \<bullet> i \<le> b \<bullet> i \<Longrightarrow> interval_lowerbound (cbox a b) = a
[PROOF STEP]
unfolding interval_lowerbound_def euclidean_representation_sum cbox_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i\<in>Basis. a \<bullet> i \<le> b \<bullet> i \<Longrightarrow> \<forall>i\<in>Basis. (INF x\<in>{x. \<forall>i\<in>Basis. a \<bullet> i \<le> x \<bullet> i \<and> x \<bullet> i \<le> b \<bullet> i}. x \<bullet> i) = a \<bullet> i
[PROOF STEP]
by (safe intro!: cInf_eq) auto


[STATEMENT]
lemma divisor_sigma_of_nat: "divisor_sigma (of_nat x) n = of_nat (divisor_sigma x n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. divisor_sigma (of_nat x) n = of_nat (divisor_sigma x n)
[PROOF STEP]
proof (cases "n = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> divisor_sigma (of_nat x) n = of_nat (divisor_sigma x n)
 2. n \<noteq> 0 \<Longrightarrow> divisor_sigma (of_nat x) n = of_nat (divisor_sigma x n)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
n \<noteq> 0

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> divisor_sigma (of_nat x) n = of_nat (divisor_sigma x n)
 2. n \<noteq> 0 \<Longrightarrow> divisor_sigma (of_nat x) n = of_nat (divisor_sigma x n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. divisor_sigma (of_nat x) n = of_nat (divisor_sigma x n)
[PROOF STEP]
unfolding divisor_sigma_def of_nat_sum
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d | d dvd n. nat_power d (of_nat x)) = (\<Sum>xa\<in>{d. d dvd n}. of_nat (nat_power xa x))
[PROOF STEP]
by (intro sum.cong refl, subst nat_power_of_nat) (insert False, auto elim: dvdE)
[PROOF STATE]
proof (state)
this:
divisor_sigma (of_nat x) n = of_nat (divisor_sigma x n)

goal (1 subgoal):
 1. n = 0 \<Longrightarrow> divisor_sigma (of_nat x) n = of_nat (divisor_sigma x n)
[PROOF STEP]
qed auto


[STATEMENT]
lemma matrix_sum_Suc_remove_head:
  fixes f :: "nat \<Rightarrow> complex mat"
  shows "(\<And>k. k < n + 1 \<Longrightarrow> f k \<in> carrier_mat d d) \<Longrightarrow>
    matrix_sum d f (n + 1) = f 0 + matrix_sum d (\<lambda>k. f (k + 1)) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>k. k < n + 1 \<Longrightarrow> f k \<in> carrier_mat d d) \<Longrightarrow> matrix_sum d f (n + 1) = f 0 + matrix_sum d (\<lambda>k. f (k + 1)) n
[PROOF STEP]
proof (induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<And>k. k < 0 + 1 \<Longrightarrow> f k \<in> carrier_mat d d) \<Longrightarrow> matrix_sum d f (0 + 1) = f 0 + matrix_sum d (\<lambda>k. f (k + 1)) 0
 2. \<And>n. \<lbrakk>(\<And>k. k < n + 1 \<Longrightarrow> f k \<in> carrier_mat d d) \<Longrightarrow> matrix_sum d f (n + 1) = f 0 + matrix_sum d (\<lambda>k. f (k + 1)) n; \<And>k. k < Suc n + 1 \<Longrightarrow> f k \<in> carrier_mat d d\<rbrakk> \<Longrightarrow> matrix_sum d f (Suc n + 1) = f 0 + matrix_sum d (\<lambda>k. f (k + 1)) (Suc n)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
?k < 0 + 1 \<Longrightarrow> f ?k \<in> carrier_mat d d

goal (2 subgoals):
 1. (\<And>k. k < 0 + 1 \<Longrightarrow> f k \<in> carrier_mat d d) \<Longrightarrow> matrix_sum d f (0 + 1) = f 0 + matrix_sum d (\<lambda>k. f (k + 1)) 0
 2. \<And>n. \<lbrakk>(\<And>k. k < n + 1 \<Longrightarrow> f k \<in> carrier_mat d d) \<Longrightarrow> matrix_sum d f (n + 1) = f 0 + matrix_sum d (\<lambda>k. f (k + 1)) n; \<And>k. k < Suc n + 1 \<Longrightarrow> f k \<in> carrier_mat d d\<rbrakk> \<Longrightarrow> matrix_sum d f (Suc n + 1) = f 0 + matrix_sum d (\<lambda>k. f (k + 1)) (Suc n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?k < 0 + 1 \<Longrightarrow> f ?k \<in> carrier_mat d d
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
?k < 0 + 1 \<Longrightarrow> f ?k \<in> carrier_mat d d

goal (1 subgoal):
 1. matrix_sum d f (0 + 1) = f 0 + matrix_sum d (\<lambda>k. f (k + 1)) 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
matrix_sum d f (0 + 1) = f 0 + matrix_sum d (\<lambda>k. f (k + 1)) 0

goal (1 subgoal):
 1. \<And>n. \<lbrakk>(\<And>k. k < n + 1 \<Longrightarrow> f k \<in> carrier_mat d d) \<Longrightarrow> matrix_sum d f (n + 1) = f 0 + matrix_sum d (\<lambda>k. f (k + 1)) n; \<And>k. k < Suc n + 1 \<Longrightarrow> f k \<in> carrier_mat d d\<rbrakk> \<Longrightarrow> matrix_sum d f (Suc n + 1) = f 0 + matrix_sum d (\<lambda>k. f (k + 1)) (Suc n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>(\<And>k. k < n + 1 \<Longrightarrow> f k \<in> carrier_mat d d) \<Longrightarrow> matrix_sum d f (n + 1) = f 0 + matrix_sum d (\<lambda>k. f (k + 1)) n; \<And>k. k < Suc n + 1 \<Longrightarrow> f k \<in> carrier_mat d d\<rbrakk> \<Longrightarrow> matrix_sum d f (Suc n + 1) = f 0 + matrix_sum d (\<lambda>k. f (k + 1)) (Suc n)
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
(\<And>k. k < n + 1 \<Longrightarrow> f k \<in> carrier_mat d d) \<Longrightarrow> matrix_sum d f (n + 1) = f 0 + matrix_sum d (\<lambda>k. f (k + 1)) n
?k < Suc n + 1 \<Longrightarrow> f ?k \<in> carrier_mat d d

goal (1 subgoal):
 1. \<And>n. \<lbrakk>(\<And>k. k < n + 1 \<Longrightarrow> f k \<in> carrier_mat d d) \<Longrightarrow> matrix_sum d f (n + 1) = f 0 + matrix_sum d (\<lambda>k. f (k + 1)) n; \<And>k. k < Suc n + 1 \<Longrightarrow> f k \<in> carrier_mat d d\<rbrakk> \<Longrightarrow> matrix_sum d f (Suc n + 1) = f 0 + matrix_sum d (\<lambda>k. f (k + 1)) (Suc n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<And>k. k < n + 1 \<Longrightarrow> f k \<in> carrier_mat d d) \<Longrightarrow> matrix_sum d f (n + 1) = f 0 + matrix_sum d (\<lambda>k. f (k + 1)) n
?k < Suc n + 1 \<Longrightarrow> f ?k \<in> carrier_mat d d
[PROOF STEP]
have dSS: "\<And>k. k < Suc (Suc n) \<Longrightarrow> f k \<in> carrier_mat d d"
[PROOF STATE]
proof (prove)
using this:
(\<And>k. k < n + 1 \<Longrightarrow> f k \<in> carrier_mat d d) \<Longrightarrow> matrix_sum d f (n + 1) = f 0 + matrix_sum d (\<lambda>k. f (k + 1)) n
?k < Suc n + 1 \<Longrightarrow> f ?k \<in> carrier_mat d d

goal (1 subgoal):
 1. \<And>k. k < Suc (Suc n) \<Longrightarrow> f k \<in> carrier_mat d d
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?k < Suc (Suc n) \<Longrightarrow> f ?k \<in> carrier_mat d d

goal (1 subgoal):
 1. \<And>n. \<lbrakk>(\<And>k. k < n + 1 \<Longrightarrow> f k \<in> carrier_mat d d) \<Longrightarrow> matrix_sum d f (n + 1) = f 0 + matrix_sum d (\<lambda>k. f (k + 1)) n; \<And>k. k < Suc n + 1 \<Longrightarrow> f k \<in> carrier_mat d d\<rbrakk> \<Longrightarrow> matrix_sum d f (Suc n + 1) = f 0 + matrix_sum d (\<lambda>k. f (k + 1)) (Suc n)
[PROOF STEP]
have ds: "matrix_sum d (\<lambda>k. f (k + 1)) n \<in> carrier_mat d d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_sum d (\<lambda>k. f (k + 1)) n \<in> carrier_mat d d
[PROOF STEP]
using matrix_sum_dim[OF dSS, of "n" "\<lambda>k. k + 1"]
[PROOF STATE]
proof (prove)
using this:
(\<And>k. k < n \<Longrightarrow> k + 1 < Suc (Suc n)) \<Longrightarrow> matrix_sum d (\<lambda>k. f (k + 1)) n \<in> carrier_mat d d

goal (1 subgoal):
 1. matrix_sum d (\<lambda>k. f (k + 1)) n \<in> carrier_mat d d
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
matrix_sum d (\<lambda>k. f (k + 1)) n \<in> carrier_mat d d

goal (1 subgoal):
 1. \<And>n. \<lbrakk>(\<And>k. k < n + 1 \<Longrightarrow> f k \<in> carrier_mat d d) \<Longrightarrow> matrix_sum d f (n + 1) = f 0 + matrix_sum d (\<lambda>k. f (k + 1)) n; \<And>k. k < Suc n + 1 \<Longrightarrow> f k \<in> carrier_mat d d\<rbrakk> \<Longrightarrow> matrix_sum d f (Suc n + 1) = f 0 + matrix_sum d (\<lambda>k. f (k + 1)) (Suc n)
[PROOF STEP]
have "matrix_sum d f (Suc n + 1) = f (n + 1) + matrix_sum d f (n + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_sum d f (Suc n + 1) = f (n + 1) + matrix_sum d f (n + 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
matrix_sum d f (Suc n + 1) = f (n + 1) + matrix_sum d f (n + 1)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>(\<And>k. k < n + 1 \<Longrightarrow> f k \<in> carrier_mat d d) \<Longrightarrow> matrix_sum d f (n + 1) = f 0 + matrix_sum d (\<lambda>k. f (k + 1)) n; \<And>k. k < Suc n + 1 \<Longrightarrow> f k \<in> carrier_mat d d\<rbrakk> \<Longrightarrow> matrix_sum d f (Suc n + 1) = f 0 + matrix_sum d (\<lambda>k. f (k + 1)) (Suc n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
matrix_sum d f (Suc n + 1) = f (n + 1) + matrix_sum d f (n + 1)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>(\<And>k. k < n + 1 \<Longrightarrow> f k \<in> carrier_mat d d) \<Longrightarrow> matrix_sum d f (n + 1) = f 0 + matrix_sum d (\<lambda>k. f (k + 1)) n; \<And>k. k < Suc n + 1 \<Longrightarrow> f k \<in> carrier_mat d d\<rbrakk> \<Longrightarrow> matrix_sum d f (Suc n + 1) = f 0 + matrix_sum d (\<lambda>k. f (k + 1)) (Suc n)
[PROOF STEP]
have "\<dots> = f (n + 1) + (f 0 + matrix_sum d (\<lambda>k. f (k + 1)) n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (n + 1) + matrix_sum d f (n + 1) = f (n + 1) + (f 0 + matrix_sum d (\<lambda>k. f (k + 1)) n)
[PROOF STEP]
using Suc
[PROOF STATE]
proof (prove)
using this:
(\<And>k. k < n + 1 \<Longrightarrow> f k \<in> carrier_mat d d) \<Longrightarrow> matrix_sum d f (n + 1) = f 0 + matrix_sum d (\<lambda>k. f (k + 1)) n
?k < Suc n + 1 \<Longrightarrow> f ?k \<in> carrier_mat d d

goal (1 subgoal):
 1. f (n + 1) + matrix_sum d f (n + 1) = f (n + 1) + (f 0 + matrix_sum d (\<lambda>k. f (k + 1)) n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f (n + 1) + matrix_sum d f (n + 1) = f (n + 1) + (f 0 + matrix_sum d (\<lambda>k. f (k + 1)) n)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>(\<And>k. k < n + 1 \<Longrightarrow> f k \<in> carrier_mat d d) \<Longrightarrow> matrix_sum d f (n + 1) = f 0 + matrix_sum d (\<lambda>k. f (k + 1)) n; \<And>k. k < Suc n + 1 \<Longrightarrow> f k \<in> carrier_mat d d\<rbrakk> \<Longrightarrow> matrix_sum d f (Suc n + 1) = f 0 + matrix_sum d (\<lambda>k. f (k + 1)) (Suc n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f (n + 1) + matrix_sum d f (n + 1) = f (n + 1) + (f 0 + matrix_sum d (\<lambda>k. f (k + 1)) n)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>(\<And>k. k < n + 1 \<Longrightarrow> f k \<in> carrier_mat d d) \<Longrightarrow> matrix_sum d f (n + 1) = f 0 + matrix_sum d (\<lambda>k. f (k + 1)) n; \<And>k. k < Suc n + 1 \<Longrightarrow> f k \<in> carrier_mat d d\<rbrakk> \<Longrightarrow> matrix_sum d f (Suc n + 1) = f 0 + matrix_sum d (\<lambda>k. f (k + 1)) (Suc n)
[PROOF STEP]
have "\<dots> = f 0 + (f (n + 1) + matrix_sum d (\<lambda>k. f (k + 1)) n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (n + 1) + (f 0 + matrix_sum d (\<lambda>k. f (k + 1)) n) = f 0 + (f (n + 1) + matrix_sum d (\<lambda>k. f (k + 1)) n)
[PROOF STEP]
using ds
[PROOF STATE]
proof (prove)
using this:
matrix_sum d (\<lambda>k. f (k + 1)) n \<in> carrier_mat d d

goal (1 subgoal):
 1. f (n + 1) + (f 0 + matrix_sum d (\<lambda>k. f (k + 1)) n) = f 0 + (f (n + 1) + matrix_sum d (\<lambda>k. f (k + 1)) n)
[PROOF STEP]
apply (mat_assoc d)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. f (n + 1) \<in> carrier_mat d d
 2. f 0 \<in> carrier_mat d d
[PROOF STEP]
using dSS
[PROOF STATE]
proof (prove)
using this:
?k < Suc (Suc n) \<Longrightarrow> f ?k \<in> carrier_mat d d

goal (2 subgoals):
 1. f (n + 1) \<in> carrier_mat d d
 2. f 0 \<in> carrier_mat d d
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f (n + 1) + (f 0 + matrix_sum d (\<lambda>k. f (k + 1)) n) = f 0 + (f (n + 1) + matrix_sum d (\<lambda>k. f (k + 1)) n)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>(\<And>k. k < n + 1 \<Longrightarrow> f k \<in> carrier_mat d d) \<Longrightarrow> matrix_sum d f (n + 1) = f 0 + matrix_sum d (\<lambda>k. f (k + 1)) n; \<And>k. k < Suc n + 1 \<Longrightarrow> f k \<in> carrier_mat d d\<rbrakk> \<Longrightarrow> matrix_sum d f (Suc n + 1) = f 0 + matrix_sum d (\<lambda>k. f (k + 1)) (Suc n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
matrix_sum d f (Suc n + 1) = f 0 + (f (n + 1) + matrix_sum d (\<lambda>k. f (k + 1)) n)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
matrix_sum d f (Suc n + 1) = f 0 + (f (n + 1) + matrix_sum d (\<lambda>k. f (k + 1)) n)

goal (1 subgoal):
 1. matrix_sum d f (Suc n + 1) = f 0 + matrix_sum d (\<lambda>k. f (k + 1)) (Suc n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
matrix_sum d f (Suc n + 1) = f 0 + matrix_sum d (\<lambda>k. f (k + 1)) (Suc n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in ell_field) padd_closed:
  assumes "a \<in> carrier R" "b \<in> carrier R" "on_curvep a b p\<^sub>1" "on_curvep a b p\<^sub>2"
  shows "on_curvep a b (padd a p\<^sub>1 p\<^sub>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. on_curvep a b (padd a p\<^sub>1 p\<^sub>2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. on_curvep a b (padd a p\<^sub>1 p\<^sub>2)
[PROOF STEP]
from \<open>on_curvep a b p\<^sub>1\<close>
[PROOF STATE]
proof (chain)
picking this:
on_curvep a b p\<^sub>1
[PROOF STEP]
have "in_carrierp p\<^sub>1"
[PROOF STATE]
proof (prove)
using this:
on_curvep a b p\<^sub>1

goal (1 subgoal):
 1. in_carrierp p\<^sub>1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
in_carrierp p\<^sub>1

goal (1 subgoal):
 1. on_curvep a b (padd a p\<^sub>1 p\<^sub>2)
[PROOF STEP]
from \<open>on_curvep a b p\<^sub>2\<close>
[PROOF STATE]
proof (chain)
picking this:
on_curvep a b p\<^sub>2
[PROOF STEP]
have "in_carrierp p\<^sub>2"
[PROOF STATE]
proof (prove)
using this:
on_curvep a b p\<^sub>2

goal (1 subgoal):
 1. in_carrierp p\<^sub>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
in_carrierp p\<^sub>2

goal (1 subgoal):
 1. on_curvep a b (padd a p\<^sub>1 p\<^sub>2)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
a \<in> carrier R
b \<in> carrier R
on_curvep a b p\<^sub>1
on_curvep a b p\<^sub>2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier R
b \<in> carrier R
on_curvep a b p\<^sub>1
on_curvep a b p\<^sub>2

goal (1 subgoal):
 1. on_curvep a b (padd a p\<^sub>1 p\<^sub>2)
[PROOF STEP]
by (simp add: on_curvep_iff_on_curve padd_in_carrierp padd_correct
      add_closed \<open>in_carrierp p\<^sub>1\<close> \<open>in_carrierp p\<^sub>2\<close>)
[PROOF STATE]
proof (state)
this:
on_curvep a b (padd a p\<^sub>1 p\<^sub>2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Cn_union: \<open>Cn(Cn(A) \<union> Cn(B)) = Cn(A \<union> B)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Cn (Cn A \<union> Cn B) = Cn (A \<union> B)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Cn (Cn A \<union> Cn B) \<subseteq> Cn (A \<union> B)
 2. Cn (A \<union> B) \<subseteq> Cn (Cn A \<union> Cn B)
[PROOF STEP]
have \<open>Cn(Cn(A) \<union> Cn(B)) \<subseteq> Cn(Cn (A \<union> B))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Cn (Cn A \<union> Cn B) \<subseteq> Cn (Cn (A \<union> B))
[PROOF STEP]
by (simp add: monotonicity_L)
[PROOF STATE]
proof (state)
this:
Cn (Cn A \<union> Cn B) \<subseteq> Cn (Cn (A \<union> B))

goal (2 subgoals):
 1. Cn (Cn A \<union> Cn B) \<subseteq> Cn (A \<union> B)
 2. Cn (A \<union> B) \<subseteq> Cn (Cn A \<union> Cn B)
[PROOF STEP]
thus \<open>Cn(Cn(A) \<union> Cn(B)) \<subseteq> Cn(A \<union> B)\<close>
[PROOF STATE]
proof (prove)
using this:
Cn (Cn A \<union> Cn B) \<subseteq> Cn (Cn (A \<union> B))

goal (1 subgoal):
 1. Cn (Cn A \<union> Cn B) \<subseteq> Cn (A \<union> B)
[PROOF STEP]
by (simp add: idempotency_L)
[PROOF STATE]
proof (state)
this:
Cn (Cn A \<union> Cn B) \<subseteq> Cn (A \<union> B)

goal (1 subgoal):
 1. Cn (A \<union> B) \<subseteq> Cn (Cn A \<union> Cn B)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Cn (A \<union> B) \<subseteq> Cn (Cn A \<union> Cn B)
[PROOF STEP]
have \<open>(A \<union> B) \<subseteq> (Cn(A) \<union> Cn(B))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<union> B \<subseteq> Cn A \<union> Cn B
[PROOF STEP]
using inclusion_L
[PROOF STATE]
proof (prove)
using this:
?A \<subseteq> Cn ?A

goal (1 subgoal):
 1. A \<union> B \<subseteq> Cn A \<union> Cn B
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
A \<union> B \<subseteq> Cn A \<union> Cn B

goal (1 subgoal):
 1. Cn (A \<union> B) \<subseteq> Cn (Cn A \<union> Cn B)
[PROOF STEP]
thus \<open>Cn(A \<union> B) \<subseteq> Cn(Cn(A) \<union> Cn(B))\<close>
[PROOF STATE]
proof (prove)
using this:
A \<union> B \<subseteq> Cn A \<union> Cn B

goal (1 subgoal):
 1. Cn (A \<union> B) \<subseteq> Cn (Cn A \<union> Cn B)
[PROOF STEP]
by (simp add: monotonicity_L)
[PROOF STATE]
proof (state)
this:
Cn (A \<union> B) \<subseteq> Cn (Cn A \<union> Cn B)

goal:
No subgoals!
[PROOF STEP]
qed

\<comment> \<open>
The closure of an infinite union of consequence closures.
\<close>


[STATEMENT]
theorem permutation_Ex_bij:
  assumes "xs <~~> ys"
  shows "\<exists>f. bij_betw f {..<length xs} {..<length ys} \<and> (\<forall>i<length xs. xs ! i = ys ! (f i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f. bij_betw f {..<length xs} {..<length ys} \<and> (\<forall>i<length xs. xs ! i = ys ! f i)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f. bij_betw f {..<length xs} {..<length ys} \<and> (\<forall>i<length xs. xs ! i = ys ! f i)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
mset xs = mset ys
[PROOF STEP]
have \<open>mset xs = mset ys\<close> \<open>length xs = length ys\<close>
[PROOF STATE]
proof (prove)
using this:
mset xs = mset ys

goal (1 subgoal):
 1. mset xs = mset ys &&& length xs = length ys
[PROOF STEP]
by (auto simp add: dest: mset_eq_length)
[PROOF STATE]
proof (state)
this:
mset xs = mset ys
length xs = length ys

goal (1 subgoal):
 1. \<exists>f. bij_betw f {..<length xs} {..<length ys} \<and> (\<forall>i<length xs. xs ! i = ys ! f i)
[PROOF STEP]
from \<open>mset xs = mset ys\<close>
[PROOF STATE]
proof (chain)
picking this:
mset xs = mset ys
[PROOF STEP]
obtain p where \<open>p permutes {..<length ys}\<close> \<open>permute_list p ys = xs\<close>
[PROOF STATE]
proof (prove)
using this:
mset xs = mset ys

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>p permutes {..<length ys}; permute_list p ys = xs\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (rule mset_eq_permutation)
[PROOF STATE]
proof (state)
this:
p permutes {..<length ys}
permute_list p ys = xs

goal (1 subgoal):
 1. \<exists>f. bij_betw f {..<length xs} {..<length ys} \<and> (\<forall>i<length xs. xs ! i = ys ! f i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p permutes {..<length ys}
permute_list p ys = xs
[PROOF STEP]
have \<open>bij_betw p {..<length xs} {..<length ys}\<close>
[PROOF STATE]
proof (prove)
using this:
p permutes {..<length ys}
permute_list p ys = xs

goal (1 subgoal):
 1. bij_betw p {..<length xs} {..<length ys}
[PROOF STEP]
by (simp add: \<open>length xs = length ys\<close> permutes_imp_bij)
[PROOF STATE]
proof (state)
this:
bij_betw p {..<length xs} {..<length ys}

goal (1 subgoal):
 1. \<exists>f. bij_betw f {..<length xs} {..<length ys} \<and> (\<forall>i<length xs. xs ! i = ys ! f i)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
bij_betw p {..<length xs} {..<length ys}

goal (1 subgoal):
 1. \<exists>f. bij_betw f {..<length xs} {..<length ys} \<and> (\<forall>i<length xs. xs ! i = ys ! f i)
[PROOF STEP]
have \<open>\<forall>i<length xs. xs ! i = ys ! (p i)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i<length xs. xs ! i = ys ! p i
[PROOF STEP]
using \<open>permute_list p ys = xs\<close> \<open>length xs = length ys\<close> \<open>p permutes {..<length ys}\<close> permute_list_nth
[PROOF STATE]
proof (prove)
using this:
permute_list p ys = xs
length xs = length ys
p permutes {..<length ys}
\<lbrakk>?f permutes {..<length ?xs}; ?i < length ?xs\<rbrakk> \<Longrightarrow> permute_list ?f ?xs ! ?i = ?xs ! ?f ?i

goal (1 subgoal):
 1. \<forall>i<length xs. xs ! i = ys ! p i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>i<length xs. xs ! i = ys ! p i

goal (1 subgoal):
 1. \<exists>f. bij_betw f {..<length xs} {..<length ys} \<and> (\<forall>i<length xs. xs ! i = ys ! f i)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
bij_betw p {..<length xs} {..<length ys}
\<forall>i<length xs. xs ! i = ys ! p i
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
bij_betw p {..<length xs} {..<length ys}
\<forall>i<length xs. xs ! i = ys ! p i

goal (1 subgoal):
 1. \<exists>f. bij_betw f {..<length xs} {..<length ys} \<and> (\<forall>i<length xs. xs ! i = ys ! f i)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>f. bij_betw f {..<length xs} {..<length ys} \<and> (\<forall>i<length xs. xs ! i = ys ! f i)

goal:
No subgoals!
[PROOF STEP]
qed