[STATEMENT]
lemma distinct_setsub_finite: "finite xs \<Longrightarrow> finite {ys. set ys \<subseteq> xs \<and> distinct ys}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite xs \<Longrightarrow> finite {ys. set ys \<subseteq> xs \<and> distinct ys}
[PROOF STEP]
proof(induction "Finite_Set.card xs" arbitrary: xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>xs. \<lbrakk>0 = Finite_Set.card xs; finite xs\<rbrakk> \<Longrightarrow> finite {ys. set ys \<subseteq> xs \<and> distinct ys}
 2. \<And>x xs. \<lbrakk>\<And>xs. \<lbrakk>x = Finite_Set.card xs; finite xs\<rbrakk> \<Longrightarrow> finite {ys. set ys \<subseteq> xs \<and> distinct ys}; Suc x = Finite_Set.card xs; finite xs\<rbrakk> \<Longrightarrow> finite {ys. set ys \<subseteq> xs \<and> distinct ys}
[PROOF STEP]
case (Suc x)
[PROOF STATE]
proof (state)
this:
\<lbrakk>x = Finite_Set.card ?xs; finite ?xs\<rbrakk> \<Longrightarrow> finite {ys. set ys \<subseteq> ?xs \<and> distinct ys}
Suc x = Finite_Set.card xs
finite xs

goal (2 subgoals):
 1. \<And>xs. \<lbrakk>0 = Finite_Set.card xs; finite xs\<rbrakk> \<Longrightarrow> finite {ys. set ys \<subseteq> xs \<and> distinct ys}
 2. \<And>x xs. \<lbrakk>\<And>xs. \<lbrakk>x = Finite_Set.card xs; finite xs\<rbrakk> \<Longrightarrow> finite {ys. set ys \<subseteq> xs \<and> distinct ys}; Suc x = Finite_Set.card xs; finite xs\<rbrakk> \<Longrightarrow> finite {ys. set ys \<subseteq> xs \<and> distinct ys}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>x = Finite_Set.card ?xs; finite ?xs\<rbrakk> \<Longrightarrow> finite {ys. set ys \<subseteq> ?xs \<and> distinct ys}
Suc x = Finite_Set.card xs
finite xs
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x = Finite_Set.card ?xs; finite ?xs\<rbrakk> \<Longrightarrow> finite {ys. set ys \<subseteq> ?xs \<and> distinct ys}
Suc x = Finite_Set.card xs
finite xs

goal (1 subgoal):
 1. finite {ys. set ys \<subseteq> xs \<and> distinct ys}
[PROOF STEP]
using distinct_seteq_finite distinct_setsub_split[of xs]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x = Finite_Set.card ?xs; finite ?xs\<rbrakk> \<Longrightarrow> finite {ys. set ys \<subseteq> ?xs \<and> distinct ys}
Suc x = Finite_Set.card xs
finite xs
finite ?xs \<Longrightarrow> finite {ys. set ys = ?xs \<and> distinct ys}
{ys. set ys \<subseteq> xs \<and> distinct ys} = {ys. set ys = xs \<and> distinct ys} \<union> (\<Union>y\<in>xs. {ys. set ys \<subseteq> xs - {y} \<and> distinct ys})

goal (1 subgoal):
 1. finite {ys. set ys \<subseteq> xs \<and> distinct ys}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite {ys. set ys \<subseteq> xs \<and> distinct ys}

goal (1 subgoal):
 1. \<And>xs. \<lbrakk>0 = Finite_Set.card xs; finite xs\<rbrakk> \<Longrightarrow> finite {ys. set ys \<subseteq> xs \<and> distinct ys}
[PROOF STEP]
qed(simp)


[STATEMENT]
lemma powr_left_bounds:
  fixes f g :: "real \<Rightarrow> real"
  shows "\<forall>x. f x > 0 \<longrightarrow> g x \<in> {l x..u x} \<longrightarrow> f x \<ge> 1 \<longrightarrow> f x powr g x \<in> {f x powr l x..f x powr u x}"
    and "\<forall>x. f x > 0 \<longrightarrow> g x \<in> {l x..u x} \<longrightarrow> f x \<le> 1 \<longrightarrow> f x powr g x \<in> {f x powr u x..f x powr l x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. 0 < f x \<longrightarrow> g x \<in> {l x..u x} \<longrightarrow> 1 \<le> f x \<longrightarrow> f x powr g x \<in> {f x powr l x..f x powr u x} &&& \<forall>x. 0 < f x \<longrightarrow> g x \<in> {l x..u x} \<longrightarrow> f x \<le> 1 \<longrightarrow> f x powr g x \<in> {f x powr u x..f x powr l x}
[PROOF STEP]
by (auto intro: powr_mono powr_mono')


[STATEMENT]
lemma idiff_0_right [simp]: "(n::enat) - 0 = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n - 0 = n
[PROOF STEP]
by (cases n) (simp_all add: zero_enat_def)


[STATEMENT]
lemma le_add_iff2: "a *\<^sub>R e + c \<le> b *\<^sub>R e + d \<longleftrightarrow> c \<le> (b - a) *\<^sub>R e + d"
  for c d e :: "'a::ordered_real_vector"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a *\<^sub>R e + c \<le> b *\<^sub>R e + d) = (c \<le> (b - a) *\<^sub>R e + d)
[PROOF STEP]
by (simp add: algebra_simps)


[STATEMENT]
lemma continuous_max [continuous_intros]:
  fixes f :: "'a::t2_space \<Rightarrow> 'b::linorder_topology"
  shows "\<lbrakk>continuous F f; continuous F g\<rbrakk> \<Longrightarrow> continuous F (\<lambda>x. (max (f x) (g x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>continuous F f; continuous F g\<rbrakk> \<Longrightarrow> continuous F (\<lambda>x. max (f x) (g x))
[PROOF STEP]
by (simp add: tendsto_max continuous_def)


[STATEMENT]
lemma mean_divisor_count_asymptotics:
  "(\<lambda>m. M m - (ln m + 2 * euler_mascheroni - 1)) \<in> O(\<lambda>m. 1 / sqrt m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>m. M m - (ln (real m) + 2 * euler_mascheroni - 1)) \<in> O(\<lambda>x. 1 / sqrt (real x))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>m. M m - (ln (real m) + 2 * euler_mascheroni - 1)) \<in> O(\<lambda>x. 1 / sqrt (real x))
[PROOF STEP]
have "(\<lambda>m. M m - (ln m + 2 * euler_mascheroni - 1))
          \<in> \<Theta>(\<lambda>m. (sum_upto (\<lambda>n. real (divisor_count n)) (real m) -
                 (m * ln m + (2 * euler_mascheroni - 1) * m)) / m)" (is "_ \<in> \<Theta>(?f)")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>m. M m - (ln (real m) + 2 * euler_mascheroni - 1)) \<in> \<Theta>(\<lambda>m. (sum_upto (\<lambda>n. real (divisor_count n)) (real m) - (real m * ln (real m) + (2 * euler_mascheroni - 1) * real m)) / real m)
[PROOF STEP]
unfolding M_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>m. real (card {(n, d). n \<in> {0<..m} \<and> d dvd n}) / real (card {0<..m}) - (ln (real m) + 2 * euler_mascheroni - 1)) \<in> \<Theta>(\<lambda>m. (sum_upto (\<lambda>n. real (divisor_count n)) (real m) - (real m * ln (real m) + (2 * euler_mascheroni - 1) * real m)) / real m)
[PROOF STEP]
by (intro bigthetaI_cong eventually_mono [OF eventually_gt_at_top[of "0::nat"]])
       (auto simp: summatory_divisor_eq field_simps)
[PROOF STATE]
proof (state)
this:
(\<lambda>m. M m - (ln (real m) + 2 * euler_mascheroni - 1)) \<in> \<Theta>(\<lambda>m. (sum_upto (\<lambda>n. real (divisor_count n)) (real m) - (real m * ln (real m) + (2 * euler_mascheroni - 1) * real m)) / real m)

goal (1 subgoal):
 1. (\<lambda>m. M m - (ln (real m) + 2 * euler_mascheroni - 1)) \<in> O(\<lambda>x. 1 / sqrt (real x))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>m. M m - (ln (real m) + 2 * euler_mascheroni - 1)) \<in> \<Theta>(\<lambda>m. (sum_upto (\<lambda>n. real (divisor_count n)) (real m) - (real m * ln (real m) + (2 * euler_mascheroni - 1) * real m)) / real m)

goal (1 subgoal):
 1. (\<lambda>m. M m - (ln (real m) + 2 * euler_mascheroni - 1)) \<in> O(\<lambda>x. 1 / sqrt (real x))
[PROOF STEP]
have "?f \<in> O(\<lambda>m. sqrt m / m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>m. (sum_upto (\<lambda>n. real (divisor_count n)) (real m) - (real m * ln (real m) + (2 * euler_mascheroni - 1) * real m)) / real m) \<in> O(\<lambda>x. sqrt (real x) / real x)
[PROOF STEP]
by (intro landau_o.big.compose[OF _ filterlim_real_sequentially] landau_o.big.divide_right
          summatory_divisor_count_asymptotics eventually_at_top_not_equal)
[PROOF STATE]
proof (state)
this:
(\<lambda>m. (sum_upto (\<lambda>n. real (divisor_count n)) (real m) - (real m * ln (real m) + (2 * euler_mascheroni - 1) * real m)) / real m) \<in> O(\<lambda>x. sqrt (real x) / real x)

goal (1 subgoal):
 1. (\<lambda>m. M m - (ln (real m) + 2 * euler_mascheroni - 1)) \<in> O(\<lambda>x. 1 / sqrt (real x))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>m. (sum_upto (\<lambda>n. real (divisor_count n)) (real m) - (real m * ln (real m) + (2 * euler_mascheroni - 1) * real m)) / real m) \<in> O(\<lambda>x. sqrt (real x) / real x)

goal (1 subgoal):
 1. (\<lambda>m. M m - (ln (real m) + 2 * euler_mascheroni - 1)) \<in> O(\<lambda>x. 1 / sqrt (real x))
[PROOF STEP]
have "(\<lambda>m::nat. sqrt m / m) \<in> \<Theta>(\<lambda>m. 1 / sqrt m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>m. sqrt (real m) / real m) \<in> \<Theta>(\<lambda>x. 1 / sqrt (real x))
[PROOF STEP]
by (intro bigthetaI_cong eventually_mono [OF eventually_gt_at_top[of "0::nat"]])
       (auto simp: field_simps)
[PROOF STATE]
proof (state)
this:
(\<lambda>m. sqrt (real m) / real m) \<in> \<Theta>(\<lambda>x. 1 / sqrt (real x))

goal (1 subgoal):
 1. (\<lambda>m. M m - (ln (real m) + 2 * euler_mascheroni - 1)) \<in> O(\<lambda>x. 1 / sqrt (real x))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>m. M m - (ln (real m) + 2 * euler_mascheroni - 1)) \<in> O(\<lambda>x. 1 / sqrt (real x))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>m. M m - (ln (real m) + 2 * euler_mascheroni - 1)) \<in> O(\<lambda>x. 1 / sqrt (real x))

goal (1 subgoal):
 1. (\<lambda>m. M m - (ln (real m) + 2 * euler_mascheroni - 1)) \<in> O(\<lambda>x. 1 / sqrt (real x))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<lambda>m. M m - (ln (real m) + 2 * euler_mascheroni - 1)) \<in> O(\<lambda>x. 1 / sqrt (real x))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma divisor_sigma_naive [code]:
  "divisor_sigma x n = (if n = 0 then 0 else fold_atLeastAtMost_nat
        (\<lambda>d acc. if d dvd n then nat_power d x + acc else acc) 1 n 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. divisor_sigma x n = (if n = 0 then 0::'a else fold_atLeastAtMost_nat (\<lambda>d acc. if d dvd n then nat_power d x + acc else acc) 1 n (0::'a))
[PROOF STEP]
proof (cases "n = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> divisor_sigma x n = (if n = 0 then 0::'a else fold_atLeastAtMost_nat (\<lambda>d acc. if d dvd n then nat_power d x + acc else acc) 1 n (0::'a))
 2. n \<noteq> 0 \<Longrightarrow> divisor_sigma x n = (if n = 0 then 0::'a else fold_atLeastAtMost_nat (\<lambda>d acc. if d dvd n then nat_power d x + acc else acc) 1 n (0::'a))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
n \<noteq> 0

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> divisor_sigma x n = (if n = 0 then 0::'a else fold_atLeastAtMost_nat (\<lambda>d acc. if d dvd n then nat_power d x + acc else acc) 1 n (0::'a))
 2. n \<noteq> 0 \<Longrightarrow> divisor_sigma x n = (if n = 0 then 0::'a else fold_atLeastAtMost_nat (\<lambda>d acc. if d dvd n then nat_power d x + acc else acc) 1 n (0::'a))
[PROOF STEP]
have "divisor_sigma x n = (\<Sum>d\<in>{1..n}. if d dvd n then nat_power d x else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. divisor_sigma x n = (\<Sum>d = 1..n. if d dvd n then nat_power d x else (0::'a))
[PROOF STEP]
unfolding divisor_sigma_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d | d dvd n. nat_power d x) = (\<Sum>d = 1..n. if d dvd n then nat_power d x else (0::'a))
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
n \<noteq> 0

goal (1 subgoal):
 1. (\<Sum>d | d dvd n. nat_power d x) = (\<Sum>d = 1..n. if d dvd n then nat_power d x else (0::'a))
[PROOF STEP]
by (intro sum.mono_neutral_cong_left) (auto elim: dvdE)
[PROOF STATE]
proof (state)
this:
divisor_sigma x n = (\<Sum>d = 1..n. if d dvd n then nat_power d x else (0::'a))

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> divisor_sigma x n = (if n = 0 then 0::'a else fold_atLeastAtMost_nat (\<lambda>d acc. if d dvd n then nat_power d x + acc else acc) 1 n (0::'a))
 2. n \<noteq> 0 \<Longrightarrow> divisor_sigma x n = (if n = 0 then 0::'a else fold_atLeastAtMost_nat (\<lambda>d acc. if d dvd n then nat_power d x + acc else acc) 1 n (0::'a))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
divisor_sigma x n = (\<Sum>d = 1..n. if d dvd n then nat_power d x else (0::'a))

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> divisor_sigma x n = (if n = 0 then 0::'a else fold_atLeastAtMost_nat (\<lambda>d acc. if d dvd n then nat_power d x + acc else acc) 1 n (0::'a))
 2. n \<noteq> 0 \<Longrightarrow> divisor_sigma x n = (if n = 0 then 0::'a else fold_atLeastAtMost_nat (\<lambda>d acc. if d dvd n then nat_power d x + acc else acc) 1 n (0::'a))
[PROOF STEP]
have "\<dots> = fold_atLeastAtMost_nat
        (\<lambda>d acc. (if d dvd n then nat_power d x else 0) + acc) 1 n 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d = 1..n. if d dvd n then nat_power d x else (0::'a)) = fold_atLeastAtMost_nat (\<lambda>d. (+) (if d dvd n then nat_power d x else (0::'a))) 1 n (0::'a)
[PROOF STEP]
by (rule sum_atLeastAtMost_code)
[PROOF STATE]
proof (state)
this:
(\<Sum>d = 1..n. if d dvd n then nat_power d x else (0::'a)) = fold_atLeastAtMost_nat (\<lambda>d. (+) (if d dvd n then nat_power d x else (0::'a))) 1 n (0::'a)

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> divisor_sigma x n = (if n = 0 then 0::'a else fold_atLeastAtMost_nat (\<lambda>d acc. if d dvd n then nat_power d x + acc else acc) 1 n (0::'a))
 2. n \<noteq> 0 \<Longrightarrow> divisor_sigma x n = (if n = 0 then 0::'a else fold_atLeastAtMost_nat (\<lambda>d acc. if d dvd n then nat_power d x + acc else acc) 1 n (0::'a))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>d = 1..n. if d dvd n then nat_power d x else (0::'a)) = fold_atLeastAtMost_nat (\<lambda>d. (+) (if d dvd n then nat_power d x else (0::'a))) 1 n (0::'a)

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> divisor_sigma x n = (if n = 0 then 0::'a else fold_atLeastAtMost_nat (\<lambda>d acc. if d dvd n then nat_power d x + acc else acc) 1 n (0::'a))
 2. n \<noteq> 0 \<Longrightarrow> divisor_sigma x n = (if n = 0 then 0::'a else fold_atLeastAtMost_nat (\<lambda>d acc. if d dvd n then nat_power d x + acc else acc) 1 n (0::'a))
[PROOF STEP]
have "(\<lambda>d acc. (if d dvd n then nat_power d x else 0) + acc) =
               (\<lambda>d acc. (if d dvd n then nat_power d x + acc else acc))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>d. (+) (if d dvd n then nat_power d x else (0::'a))) = (\<lambda>d acc. if d dvd n then nat_power d x + acc else acc)
[PROOF STEP]
by (auto simp: fun_eq_iff)
[PROOF STATE]
proof (state)
this:
(\<lambda>d. (+) (if d dvd n then nat_power d x else (0::'a))) = (\<lambda>d acc. if d dvd n then nat_power d x + acc else acc)

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> divisor_sigma x n = (if n = 0 then 0::'a else fold_atLeastAtMost_nat (\<lambda>d acc. if d dvd n then nat_power d x + acc else acc) 1 n (0::'a))
 2. n \<noteq> 0 \<Longrightarrow> divisor_sigma x n = (if n = 0 then 0::'a else fold_atLeastAtMost_nat (\<lambda>d acc. if d dvd n then nat_power d x + acc else acc) 1 n (0::'a))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
divisor_sigma x n = fold_atLeastAtMost_nat (\<lambda>d acc. if d dvd n then nat_power d x + acc else acc) 1 n (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
divisor_sigma x n = fold_atLeastAtMost_nat (\<lambda>d acc. if d dvd n then nat_power d x + acc else acc) 1 n (0::'a)

goal (1 subgoal):
 1. divisor_sigma x n = (if n = 0 then 0::'a else fold_atLeastAtMost_nat (\<lambda>d acc. if d dvd n then nat_power d x + acc else acc) 1 n (0::'a))
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
divisor_sigma x n = fold_atLeastAtMost_nat (\<lambda>d acc. if d dvd n then nat_power d x + acc else acc) 1 n (0::'a)
n \<noteq> 0

goal (1 subgoal):
 1. divisor_sigma x n = (if n = 0 then 0::'a else fold_atLeastAtMost_nat (\<lambda>d acc. if d dvd n then nat_power d x + acc else acc) 1 n (0::'a))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
divisor_sigma x n = (if n = 0 then 0::'a else fold_atLeastAtMost_nat (\<lambda>d acc. if d dvd n then nat_power d x + acc else acc) 1 n (0::'a))

goal (1 subgoal):
 1. n = 0 \<Longrightarrow> divisor_sigma x n = (if n = 0 then 0::'a else fold_atLeastAtMost_nat (\<lambda>d acc. if d dvd n then nat_power d x + acc else acc) 1 n (0::'a))
[PROOF STEP]
qed auto


[STATEMENT]
lemma closed_Proj_rel: "closed {(x, y). Proj x = Proj y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed {(x, y). Proj x = Proj y}
[PROOF STEP]
using closed_proj_rel
[PROOF STATE]
proof (prove)
using this:
closed {(x, y). proj_rel x y}

goal (1 subgoal):
 1. closed {(x, y). Proj x = Proj y}
[PROOF STEP]
by (smt Collect_cong case_prodE case_prodI2 prod.inject proj_space.abs_eq_iff)


[STATEMENT]
lemma subset_AboveS_UnderS: "B \<le> Field r \<Longrightarrow> B \<le> AboveS r (UnderS r B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B \<subseteq> Field r \<Longrightarrow> B \<subseteq> AboveS r (UnderS r B)
[PROOF STEP]
by(auto simp add: AboveS_def UnderS_def)


[STATEMENT]
lemma parent_one_conv[simp]: "parent (Suc 0) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. parent (Suc 0) = 0
[PROOF STEP]
by (auto simp: parent_def)


[STATEMENT]
lemma Eps12_hypext_inverse [simp]:
  "Base  (x::'a::real_normed_field hyperdual) \<noteq> 0
   \<Longrightarrow> Eps12 (inverse x) = Eps1 x * Eps2 x * (2/ (Base x ^ 3)) - Eps12 x / (Base x)\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Base x \<noteq> (0::'a) \<Longrightarrow> Eps12 (inverse x) = Eps1 x * Eps2 x * ((2::'a) / Base x ^ 3) - Eps12 x / (Base x)\<^sup>2
[PROOF STEP]
by simp


[STATEMENT]
lemma exp_1_powr_real [simp]: "exp (1::real) powr x = exp x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp 1 powr x = exp x
[PROOF STEP]
by (simp add: powr_def)


[STATEMENT]
lemma intersect_segment_xline:
  assumes "intersect_segment_xline prec (p0, p1) x = Some (m, M)"
  shows "closed_segment p0 p1 \<inter> {p. fst p = x} \<subseteq> {(x, m) .. (x, M)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed_segment p0 p1 \<inter> {p. fst p = x} \<subseteq> {(x, m)..(x, M)}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
intersect_segment_xline prec (p0, p1) x = Some (m, M)

goal (1 subgoal):
 1. closed_segment p0 p1 \<inter> {p. fst p = x} \<subseteq> {(x, m)..(x, M)}
[PROOF STEP]
by (cases p0, cases p1)
    (auto simp: closed_segment_commute split: if_split_asm simp del: intersect_segment_xline'.simps
      dest!: intersect_segment_xline')


[STATEMENT]
lemma str_del_block_del_point:
  assumes "{x} \<notin># \<B>"
  shows "str_del_block {x} = (del_point_blocks x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. str_del_block {x} = del_point_blocks x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. str_del_block {x} = del_point_blocks x
[PROOF STEP]
have neqx: "\<And> bl. bl \<in># \<B> \<Longrightarrow> bl \<noteq> {x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>bl. bl \<in># \<B> \<Longrightarrow> bl \<noteq> {x}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
{x} \<notin># \<B>

goal (1 subgoal):
 1. \<And>bl. bl \<in># \<B> \<Longrightarrow> bl \<noteq> {x}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?bl \<in># \<B> \<Longrightarrow> ?bl \<noteq> {x}

goal (1 subgoal):
 1. str_del_block {x} = del_point_blocks x
[PROOF STEP]
have "str_del_block {x} = {# bl - {x} | bl \<in># \<B> . bl \<noteq> {x} #}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. str_del_block {x} = {#bl - {x}. bl \<in># {#bl \<in># \<B>. bl \<noteq> {x}#}#}
[PROOF STEP]
by (simp add: str_del_block_def)
[PROOF STATE]
proof (state)
this:
str_del_block {x} = {#bl - {x}. bl \<in># {#bl \<in># \<B>. bl \<noteq> {x}#}#}

goal (1 subgoal):
 1. str_del_block {x} = del_point_blocks x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
str_del_block {x} = {#bl - {x}. bl \<in># {#bl \<in># \<B>. bl \<noteq> {x}#}#}
[PROOF STEP]
have "str_del_block {x} = {# bl - {x} . bl \<in># \<B> #}"
[PROOF STATE]
proof (prove)
using this:
str_del_block {x} = {#bl - {x}. bl \<in># {#bl \<in># \<B>. bl \<noteq> {x}#}#}

goal (1 subgoal):
 1. str_del_block {x} = {#bl - {x}. bl \<in># \<B>#}
[PROOF STEP]
using assms neqx
[PROOF STATE]
proof (prove)
using this:
str_del_block {x} = {#bl - {x}. bl \<in># {#bl \<in># \<B>. bl \<noteq> {x}#}#}
{x} \<notin># \<B>
?bl \<in># \<B> \<Longrightarrow> ?bl \<noteq> {x}

goal (1 subgoal):
 1. str_del_block {x} = {#bl - {x}. bl \<in># \<B>#}
[PROOF STEP]
by (simp add: filter_mset_cong)
[PROOF STATE]
proof (state)
this:
str_del_block {x} = {#bl - {x}. bl \<in># \<B>#}

goal (1 subgoal):
 1. str_del_block {x} = del_point_blocks x
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
str_del_block {x} = {#bl - {x}. bl \<in># \<B>#}

goal (1 subgoal):
 1. str_del_block {x} = del_point_blocks x
[PROOF STEP]
by (simp add: del_point_blocks_def)
[PROOF STATE]
proof (state)
this:
str_del_block {x} = del_point_blocks x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma subspace_neg: "subspace S \<Longrightarrow> x \<in> S \<Longrightarrow> - x \<in> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>subspace S; x \<in> S\<rbrakk> \<Longrightarrow> - x \<in> S
[PROOF STEP]
by (metis scale_minus_left scale_one subspace_scale)


[STATEMENT]
lemma antisym_conv: "y \<le> x \<Longrightarrow> x \<le> y \<longleftrightarrow> x \<approx> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<le> x \<Longrightarrow> (x \<le> y) = (x \<approx> y)
[PROOF STEP]
by (simp add: equiv_def)


[STATEMENT]
lemma continuous_on_tanh [continuous_intros]:
  fixes f :: "_ \<Rightarrow>'a::{real_normed_field,banach}"
  assumes "continuous_on A f" "\<And>x. x \<in> A \<Longrightarrow> cosh (f x) \<noteq> 0"
  shows   "continuous_on A (\<lambda>x. tanh (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on A (\<lambda>x. tanh (f x))
[PROOF STEP]
unfolding tanh_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on A (\<lambda>x. sinh (f x) / cosh (f x))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
continuous_on A f
?x \<in> A \<Longrightarrow> cosh (f ?x) \<noteq> (0::'a)

goal (1 subgoal):
 1. continuous_on A (\<lambda>x. sinh (f x) / cosh (f x))
[PROOF STEP]
by (intro continuous_intros) auto


[STATEMENT]
lemma list_of_eucl_eucl_of_list[simp]:
  "length xs = DIM('a::executable_euclidean_space) \<Longrightarrow> list_of_eucl (eucl_of_list xs::'a) = xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length xs = DIM('a) \<Longrightarrow> list_of_eucl (eucl_of_list xs) = xs
[PROOF STEP]
by (auto simp: list_of_eucl_def eucl_of_list_inner intro!: nth_equalityI)


[STATEMENT]
lemma plus_subset2: "g \<in> o[F](f) \<Longrightarrow> L F (f) \<subseteq> L F (\<lambda>x. f x + g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g \<in> o[F](f) \<Longrightarrow> L F f \<subseteq> L F (\<lambda>x. f x + g x)
[PROOF STEP]
by (subst add.commute) (rule plus_subset1)


[STATEMENT]
lemma clinear_iff:
  "clinear f \<longleftrightarrow> (\<forall>x y. f (x + y) = f x + f y) \<and> (\<forall>c x. f (c *\<^sub>C x) = c *\<^sub>C f x)"
  (is "clinear f \<longleftrightarrow> ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. clinear f = ((\<forall>x y. f (x + y) = f x + f y) \<and> (\<forall>c x. f (c *\<^sub>C x) = c *\<^sub>C f x))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. clinear f \<Longrightarrow> (\<forall>x y. f (x + y) = f x + f y) \<and> (\<forall>c x. f (c *\<^sub>C x) = c *\<^sub>C f x)
 2. (\<forall>x y. f (x + y) = f x + f y) \<and> (\<forall>c x. f (c *\<^sub>C x) = c *\<^sub>C f x) \<Longrightarrow> clinear f
[PROOF STEP]
assume "clinear f"
[PROOF STATE]
proof (state)
this:
clinear f

goal (2 subgoals):
 1. clinear f \<Longrightarrow> (\<forall>x y. f (x + y) = f x + f y) \<and> (\<forall>c x. f (c *\<^sub>C x) = c *\<^sub>C f x)
 2. (\<forall>x y. f (x + y) = f x + f y) \<and> (\<forall>c x. f (c *\<^sub>C x) = c *\<^sub>C f x) \<Longrightarrow> clinear f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
clinear f
[PROOF STEP]
interpret f: clinear f
[PROOF STATE]
proof (prove)
using this:
clinear f

goal (1 subgoal):
 1. clinear f
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. clinear f \<Longrightarrow> (\<forall>x y. f (x + y) = f x + f y) \<and> (\<forall>c x. f (c *\<^sub>C x) = c *\<^sub>C f x)
 2. (\<forall>x y. f (x + y) = f x + f y) \<and> (\<forall>c x. f (c *\<^sub>C x) = c *\<^sub>C f x) \<Longrightarrow> clinear f
[PROOF STEP]
show "?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x y. f (x + y) = f x + f y) \<and> (\<forall>c x. f (c *\<^sub>C x) = c *\<^sub>C f x)
[PROOF STEP]
by (simp add: f.add f.scale complex_vector.linear_scale f.clinear_axioms)
[PROOF STATE]
proof (state)
this:
(\<forall>x y. f (x + y) = f x + f y) \<and> (\<forall>c x. f (c *\<^sub>C x) = c *\<^sub>C f x)

goal (1 subgoal):
 1. (\<forall>x y. f (x + y) = f x + f y) \<and> (\<forall>c x. f (c *\<^sub>C x) = c *\<^sub>C f x) \<Longrightarrow> clinear f
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<forall>x y. f (x + y) = f x + f y) \<and> (\<forall>c x. f (c *\<^sub>C x) = c *\<^sub>C f x) \<Longrightarrow> clinear f
[PROOF STEP]
assume "?rhs"
[PROOF STATE]
proof (state)
this:
(\<forall>x y. f (x + y) = f x + f y) \<and> (\<forall>c x. f (c *\<^sub>C x) = c *\<^sub>C f x)

goal (1 subgoal):
 1. (\<forall>x y. f (x + y) = f x + f y) \<and> (\<forall>c x. f (c *\<^sub>C x) = c *\<^sub>C f x) \<Longrightarrow> clinear f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<forall>x y. f (x + y) = f x + f y) \<and> (\<forall>c x. f (c *\<^sub>C x) = c *\<^sub>C f x)
[PROOF STEP]
show "clinear f"
[PROOF STATE]
proof (prove)
using this:
(\<forall>x y. f (x + y) = f x + f y) \<and> (\<forall>c x. f (c *\<^sub>C x) = c *\<^sub>C f x)

goal (1 subgoal):
 1. clinear f
[PROOF STEP]
by (intro clinearI) auto
[PROOF STATE]
proof (state)
this:
clinear f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bij_betw_linorders_on':
  assumes "finite A"
  shows   "bij_betw (\<lambda>R. sorted_wrt_list_of_set R A) (linorders_on A) (permutations_of_set A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw (\<lambda>R. sorted_wrt_list_of_set R A) (linorders_on A) (permutations_of_set A)
[PROOF STEP]
by (rule bij_betw_byWitness[where f' = linorder_of_list])
     (insert assms, auto simp: linorders_on_def permutations_of_set_def
        linorder_sorted_wrt_list_of_set)


[STATEMENT]
lemma preserves_isomorphic:
    assumes "C.isomorphic f g"
    shows "D.isomorphic (F f) (F g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. D.isomorphic (F f) (F g)
[PROOF STEP]
using assms C.isomorphic_def D.isomorphic_def preserves_iso
[PROOF STATE]
proof (prove)
using this:
C.isomorphic f g
C.isomorphic ?a ?a' = (\<exists>f. \<guillemotleft>f : ?a \<Rightarrow>\<^sub>C ?a'\<guillemotright> \<and> C.iso f)
D.isomorphic ?a ?a' = (\<exists>f. \<guillemotleft>f : ?a \<Rightarrow>\<^sub>D ?a'\<guillemotright> \<and> D.iso f)
C.iso ?f \<Longrightarrow> D.iso (F ?f)

goal (1 subgoal):
 1. D.isomorphic (F f) (F g)
[PROOF STEP]
by auto


[STATEMENT]
lemma subindex_permutation:
  assumes "distinct ss" "set ss \<subseteq> {..<length ls}"
  obtains f where "f permutes {..<length ls}"
    "permute_list f ls = map ((!) ls) (filter (\<lambda>i. i \<notin> set ss) [0..<length ls]) @ map ((!) ls) ss"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>f. \<lbrakk>f permutes {..<length ls}; permute_list f ls = map ((!) ls) (filter (\<lambda>i. i \<notin> set ss) [0..<length ls]) @ map ((!) ls) ss\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>f. \<lbrakk>f permutes {..<length ls}; permute_list f ls = map ((!) ls) (filter (\<lambda>i. i \<notin> set ss) [0..<length ls]) @ map ((!) ls) ss\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "set [0..<length ls] = set (filter (\<lambda>i. i \<notin> set ss) [0..<length ls] @ ss)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set [0..<length ls] = set (filter (\<lambda>i. i \<notin> set ss) [0..<length ls] @ ss)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
distinct ss
set ss \<subseteq> {..<length ls}

goal (1 subgoal):
 1. set [0..<length ls] = set (filter (\<lambda>i. i \<notin> set ss) [0..<length ls] @ ss)
[PROOF STEP]
unfolding multiset_eq_iff
[PROOF STATE]
proof (prove)
using this:
distinct ss
set ss \<subseteq> {..<length ls}

goal (1 subgoal):
 1. set [0..<length ls] = set (filter (\<lambda>i. i \<notin> set ss) [0..<length ls] @ ss)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set [0..<length ls] = set (filter (\<lambda>i. i \<notin> set ss) [0..<length ls] @ ss)

goal (1 subgoal):
 1. (\<And>f. \<lbrakk>f permutes {..<length ls}; permute_list f ls = map ((!) ls) (filter (\<lambda>i. i \<notin> set ss) [0..<length ls]) @ map ((!) ls) ss\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
set [0..<length ls] = set (filter (\<lambda>i. i \<notin> set ss) [0..<length ls] @ ss)
[PROOF STEP]
have "mset [0..<length ls] = mset (filter (\<lambda>i. i \<notin> set ss) [0..<length ls] @ ss)"
[PROOF STATE]
proof (prove)
using this:
set [0..<length ls] = set (filter (\<lambda>i. i \<notin> set ss) [0..<length ls] @ ss)

goal (1 subgoal):
 1. mset [0..<length ls] = mset (filter (\<lambda>i. i \<notin> set ss) [0..<length ls] @ ss)
[PROOF STEP]
apply (subst set_eq_iff_mset_eq_distinct[symmetric])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. set [0..<length ls] = set (filter (\<lambda>i. i \<notin> set ss) [0..<length ls] @ ss) \<Longrightarrow> distinct [0..<length ls]
 2. set [0..<length ls] = set (filter (\<lambda>i. i \<notin> set ss) [0..<length ls] @ ss) \<Longrightarrow> distinct (filter (\<lambda>i. i \<notin> set ss) [0..<length ls] @ ss)
 3. set [0..<length ls] = set (filter (\<lambda>i. i \<notin> set ss) [0..<length ls] @ ss) \<Longrightarrow> set [0..<length ls] = set (filter (\<lambda>i. i \<notin> set ss) [0..<length ls] @ ss)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
distinct ss
set ss \<subseteq> {..<length ls}

goal (3 subgoals):
 1. set [0..<length ls] = set (filter (\<lambda>i. i \<notin> set ss) [0..<length ls] @ ss) \<Longrightarrow> distinct [0..<length ls]
 2. set [0..<length ls] = set (filter (\<lambda>i. i \<notin> set ss) [0..<length ls] @ ss) \<Longrightarrow> distinct (filter (\<lambda>i. i \<notin> set ss) [0..<length ls] @ ss)
 3. set [0..<length ls] = set (filter (\<lambda>i. i \<notin> set ss) [0..<length ls] @ ss) \<Longrightarrow> set [0..<length ls] = set (filter (\<lambda>i. i \<notin> set ss) [0..<length ls] @ ss)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mset [0..<length ls] = mset (filter (\<lambda>i. i \<notin> set ss) [0..<length ls] @ ss)

goal (1 subgoal):
 1. (\<And>f. \<lbrakk>f permutes {..<length ls}; permute_list f ls = map ((!) ls) (filter (\<lambda>i. i \<notin> set ss) [0..<length ls]) @ map ((!) ls) ss\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
mset [0..<length ls] = mset (filter (\<lambda>i. i \<notin> set ss) [0..<length ls] @ ss)
[PROOF STEP]
have "mset ls = mset (map ((!) ls)
           (filter (\<lambda>i. i \<notin> set ss)
             [0..<length ls]) @ map ((!) ls) ss)"
[PROOF STATE]
proof (prove)
using this:
mset [0..<length ls] = mset (filter (\<lambda>i. i \<notin> set ss) [0..<length ls] @ ss)

goal (1 subgoal):
 1. mset ls = mset (map ((!) ls) (filter (\<lambda>i. i \<notin> set ss) [0..<length ls]) @ map ((!) ls) ss)
[PROOF STEP]
by (smt length_map map_append map_nth mset_eq_permutation mset_permute_list permute_list_map)
[PROOF STATE]
proof (state)
this:
mset ls = mset (map ((!) ls) (filter (\<lambda>i. i \<notin> set ss) [0..<length ls]) @ map ((!) ls) ss)

goal (1 subgoal):
 1. (\<And>f. \<lbrakk>f permutes {..<length ls}; permute_list f ls = map ((!) ls) (filter (\<lambda>i. i \<notin> set ss) [0..<length ls]) @ map ((!) ls) ss\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
mset ls = mset (map ((!) ls) (filter (\<lambda>i. i \<notin> set ss) [0..<length ls]) @ map ((!) ls) ss)

goal (1 subgoal):
 1. thesis
[PROOF STEP]
by (metis mset_eq_permutation that)
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bl_shiftl1: "to_bl (shiftl1 w) = tl (to_bl w) @ [False]"
  for w :: "'a::len word"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_bl (shiftl1 w) = tl (to_bl w) @ [False]
[PROOF STEP]
by (simp add: shiftl1_bl word_rep_drop drop_Suc drop_Cons') (fast intro!: Suc_leI)


[STATEMENT]
lemma power_rep_eq [ueval]: "\<lbrakk>P ^ n\<rbrakk>\<^sub>e = (\<lambda> b. \<lbrakk>P\<rbrakk>\<^sub>e b ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>P ^ n\<rbrakk>\<^sub>e = (\<lambda>b. \<lbrakk>P\<rbrakk>\<^sub>e b ^ n)
[PROOF STEP]
by (induct n, simp_all add: lit.rep_eq one_uexpr_def bop.rep_eq times_uexpr_def)


[STATEMENT]
lemma set_iterator_rev_linord_foldli_conv :
    "set_iterator_rev_linord iti S \<longleftrightarrow>
     (\<exists>l0. distinct l0 \<and> S = set l0 \<and> sorted (rev l0) \<and> iti = foldli l0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_iterator_rev_linord iti S = (\<exists>l0. distinct l0 \<and> S = set l0 \<and> sorted (rev l0) \<and> iti = foldli l0)
[PROOF STEP]
unfolding set_iterator_rev_linord_def set_iterator_genord_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>l0. distinct l0 \<and> S = set l0 \<and> sorted_wrt (\<lambda>x y. y \<le> x) l0 \<and> iti = foldli l0) = (\<exists>l0. distinct l0 \<and> S = set l0 \<and> sorted (rev l0) \<and> iti = foldli l0)
[PROOF STEP]
by simp


[STATEMENT]
lemma smult_map_sq_matrix:
  "(\<And>y. f (x * y) = z * f y) \<Longrightarrow> map_sq_matrix f (x *\<^sub>S A) = z *\<^sub>S map_sq_matrix f A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>y. f (x * y) = z * f y) \<Longrightarrow> map_sq_matrix f (x *\<^sub>S A) = z *\<^sub>S map_sq_matrix f A
[PROOF STEP]
by transfer simp


[STATEMENT]
lemma zeta_critical_strip:
  fixes s :: complex and a :: real
  defines "S \<equiv> (\<lambda>n. \<Sum>i=1..n. (of_nat i) powr - s)"
  defines "I \<equiv> (\<lambda>n. of_nat n powr (1 - s) / (1 - s))"
  assumes s: "Re s > 0" "s \<noteq> 1"
  shows   "(\<lambda>n. S n - I n) \<longlonglongrightarrow> zeta s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. S n - I n) \<longlonglongrightarrow> zeta s
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>n. S n - I n) \<longlonglongrightarrow> zeta s
[PROOF STEP]
from hurwitz_zeta_critical_strip[OF s zero_less_one]
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. (\<Sum>i<n. complex_of_real (real i + 1) powr - s) - of_nat n powr (1 - s) / (1 - s)) \<longlonglongrightarrow> hurwitz_zeta 1 s
[PROOF STEP]
have "(\<lambda>n. (\<Sum>i<n. complex_of_real (Suc i) powr - s) -
            of_nat n powr (1 - s) / (1 - s)) \<longlonglongrightarrow> hurwitz_zeta 1 s"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. (\<Sum>i<n. complex_of_real (real i + 1) powr - s) - of_nat n powr (1 - s) / (1 - s)) \<longlonglongrightarrow> hurwitz_zeta 1 s

goal (1 subgoal):
 1. (\<lambda>n. (\<Sum>i<n. complex_of_real (real (Suc i)) powr - s) - of_nat n powr (1 - s) / (1 - s)) \<longlonglongrightarrow> hurwitz_zeta 1 s
[PROOF STEP]
by (simp add: add_ac)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (\<Sum>i<n. complex_of_real (real (Suc i)) powr - s) - of_nat n powr (1 - s) / (1 - s)) \<longlonglongrightarrow> hurwitz_zeta 1 s

goal (1 subgoal):
 1. (\<lambda>n. S n - I n) \<longlonglongrightarrow> zeta s
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (\<Sum>i<n. complex_of_real (real (Suc i)) powr - s) - of_nat n powr (1 - s) / (1 - s)) \<longlonglongrightarrow> hurwitz_zeta 1 s

goal (1 subgoal):
 1. (\<lambda>n. S n - I n) \<longlonglongrightarrow> zeta s
[PROOF STEP]
have "(\<lambda>n. (\<Sum>i<n. complex_of_real (Suc i) powr -s)) = (\<lambda>n. (\<Sum>i=1..n. of_nat i powr -s))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. \<Sum>i<n. complex_of_real (real (Suc i)) powr - s) = (\<lambda>n. \<Sum>i = 1..n. of_nat i powr - s)
[PROOF STEP]
by (intro ext sum.reindex_bij_witness[of _ "\<lambda>x. x - 1" Suc]) auto
[PROOF STATE]
proof (state)
this:
(\<lambda>n. \<Sum>i<n. complex_of_real (real (Suc i)) powr - s) = (\<lambda>n. \<Sum>i = 1..n. of_nat i powr - s)

goal (1 subgoal):
 1. (\<lambda>n. S n - I n) \<longlonglongrightarrow> zeta s
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. (\<Sum>i = 1..n. of_nat i powr - s) - of_nat n powr (1 - s) / (1 - s)) \<longlonglongrightarrow> hurwitz_zeta 1 s
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. (\<Sum>i = 1..n. of_nat i powr - s) - of_nat n powr (1 - s) / (1 - s)) \<longlonglongrightarrow> hurwitz_zeta 1 s

goal (1 subgoal):
 1. (\<lambda>n. S n - I n) \<longlonglongrightarrow> zeta s
[PROOF STEP]
by (simp add: zeta_def S_def I_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. S n - I n) \<longlonglongrightarrow> zeta s

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma height_node43:
  "height m > 0 \<Longrightarrow> height(node43 l a m b n c r) =
   max (height l) (max (height m) (max (height n) (height r))) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < height m \<Longrightarrow> height (node43 l a m b n c r) = max (height l) (max (height m) (max (height n) (height r))) + 1
[PROOF STEP]
by(induct l a m b n c r rule: node43.induct)(simp_all add: max_def)


[STATEMENT]
lemma Ord_ex_eqpoll_vdisjnt:
  assumes "Ord \<alpha>" and "X \<subseteq>\<^sub>\<circ> Y" and "Y \<in>\<^sub>\<circ> Vset \<alpha>"
  obtains Z where "X \<approx>\<^sub>\<circ> Z" and "vdisjnt Z Y" and "Z \<subseteq>\<^sub>\<circ> Vset (succ \<alpha>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>Z. \<lbrakk>X \<approx>\<^sub>\<circ> Z; Z \<inter>\<^sub>\<circ> Y = []\<^sub>\<circ>; Z \<subseteq>\<^sub>\<circ> Vset (ZFC_in_HOL.succ \<alpha>)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Ord \<alpha>
X \<subseteq>\<^sub>\<circ> Y
Y \<in>\<^sub>\<circ> Vset \<alpha>

goal (1 subgoal):
 1. (\<And>Z. \<lbrakk>X \<approx>\<^sub>\<circ> Z; Z \<inter>\<^sub>\<circ> Y = []\<^sub>\<circ>; Z \<subseteq>\<^sub>\<circ> Vset (ZFC_in_HOL.succ \<alpha>)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (intro that[of \<open>mk_doubleton_image X Y\<close>])
    (
      simp_all add:
        mk_doubleton_image_veqpoll
        vdisjnt_mk_doubleton_image
        Ord_mk_doubleton_image_vsubset_Vset_succ
    )


[STATEMENT]
lemma rev_filter: "rev (filter P xs) = filter P (rev xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rev (filter P xs) = filter P (rev xs)
[PROOF STEP]
by (induct xs) simp_all


[STATEMENT]
lemma ereal_divide_pos_iff [simp]:
  "0 < x/(y::ereal) \<longleftrightarrow> (y \<noteq> \<infinity> \<and> y \<noteq> -\<infinity>) \<and> ((x > 0 \<and> y > 0) \<or> (x < 0 \<and> y < 0) \<or> (y = 0 \<and> x > 0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 < x / y) = ((y \<noteq> \<infinity> \<and> y \<noteq> - \<infinity>) \<and> (0 < x \<and> 0 < y \<or> x < 0 \<and> y < 0 \<or> y = 0 \<and> 0 < x))
[PROOF STEP]
unfolding divide_ereal_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 < x * inverse y) = ((y \<noteq> \<infinity> \<and> y \<noteq> - \<infinity>) \<and> (0 < x \<and> 0 < y \<or> x < 0 \<and> y < 0 \<or> y = 0 \<and> 0 < x))
[PROOF STEP]
by auto


[STATEMENT]
theorem nat_to_pr_into_pr: "nat_to_pr n \<in> PrimRec1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat_to_pr n \<in> PrimRec1
[PROOF STEP]
by (simp add: nat_to_pr_def sch_to_pr_into_pr)


[STATEMENT]
lemma equal_div_mod2:"(((j::nat) div a)  = (i div a)
                      \<and> ((j mod a) = (i mod a))) = (j = i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (j div a = i div a \<and> j mod a = i mod a) = (j = i)
[PROOF STEP]
using equal_div_mod
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?j div ?a = ?i div ?a; ?j mod ?a = ?i mod ?a\<rbrakk> \<Longrightarrow> ?j = ?i

goal (1 subgoal):
 1. (j div a = i div a \<and> j mod a = i mod a) = (j = i)
[PROOF STEP]
by metis


[STATEMENT]
lemma and_minus_minus_numerals [simp]:
  \<open>- (numeral m :: int) AND - (numeral n :: int) = NOT ((numeral m - 1) OR (numeral n - 1))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - numeral m AND - numeral n = NOT (numeral m - 1 OR numeral n - 1)
[PROOF STEP]
by (simp add: minus_numeral_eq_not_sub_one)


[STATEMENT]
lemma to_int_mod_ring_plus: "to_int_mod_ring ((x :: 'a mod_ring) + y) = (to_int_mod_ring x + to_int_mod_ring y) mod m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_int_mod_ring (x + y) = (to_int_mod_ring x + to_int_mod_ring y) mod m
[PROOF STEP]
using m
[PROOF STATE]
proof (prove)
using this:
m = int CARD('a)

goal (1 subgoal):
 1. to_int_mod_ring (x + y) = (to_int_mod_ring x + to_int_mod_ring y) mod m
[PROOF STEP]
by (transfer, auto)


[STATEMENT]
lemma ord_option_inf: "inf (ord_option A) (ord_option B) = ord_option (inf A B)" (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ord_option A \<sqinter> ord_option B = ord_option (A \<sqinter> B)
[PROOF STEP]
proof(rule antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ord_option A \<sqinter> ord_option B \<le> ord_option (A \<sqinter> B)
 2. ord_option (A \<sqinter> B) \<le> ord_option A \<sqinter> ord_option B
[PROOF STEP]
show "?lhs \<le> ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ord_option A \<sqinter> ord_option B \<le> ord_option (A \<sqinter> B)
[PROOF STEP]
by(auto elim!: ord_option.cases)
[PROOF STATE]
proof (state)
this:
ord_option A \<sqinter> ord_option B \<le> ord_option (A \<sqinter> B)

goal (1 subgoal):
 1. ord_option (A \<sqinter> B) \<le> ord_option A \<sqinter> ord_option B
[PROOF STEP]
qed(auto elim: ord_option_mono)


[STATEMENT]
lemma op_cf_cf_scospan[cat_op_simps]:
  "op_cf (\<langle>\<aa>\<rightarrow>\<gg>\<rightarrow>\<oo>\<leftarrow>\<ff>\<leftarrow>\<bb>\<rangle>\<^sub>C\<^sub>F\<^bsub>\<CC>\<^esub>) = \<langle>\<aa>\<leftarrow>\<gg>\<leftarrow>\<oo>\<rightarrow>\<ff>\<rightarrow>\<bb>\<rangle>\<^sub>C\<^sub>F\<^bsub>op_cat \<CC>\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. op_cf (\<langle>\<aa>\<rightarrow>\<gg>\<rightarrow>\<oo>\<leftarrow>\<ff>\<leftarrow>\<bb>\<rangle>\<^sub>C\<^sub>F\<^bsub>\<CC>\<^esub>) = \<langle>\<aa>\<leftarrow>\<gg>\<leftarrow>\<oo>\<rightarrow>\<ff>\<rightarrow>\<bb>\<rangle>\<^sub>C\<^sub>F\<^bsub>op_cat \<CC>\<^esub>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. op_cf (\<langle>\<aa>\<rightarrow>\<gg>\<rightarrow>\<oo>\<leftarrow>\<ff>\<leftarrow>\<bb>\<rangle>\<^sub>C\<^sub>F\<^bsub>\<CC>\<^esub>) = \<langle>\<aa>\<leftarrow>\<gg>\<leftarrow>\<oo>\<rightarrow>\<ff>\<rightarrow>\<bb>\<rangle>\<^sub>C\<^sub>F\<^bsub>op_cat \<CC>\<^esub>
[PROOF STEP]
have dom_lhs: "\<D>\<^sub>\<circ> (op_cf (\<langle>\<aa>\<rightarrow>\<gg>\<rightarrow>\<oo>\<leftarrow>\<ff>\<leftarrow>\<bb>\<rangle>\<^sub>C\<^sub>F\<^bsub>\<CC>\<^esub>)) = 4\<^sub>\<nat>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (op_cf (\<langle>\<aa>\<rightarrow>\<gg>\<rightarrow>\<oo>\<leftarrow>\<ff>\<leftarrow>\<bb>\<rangle>\<^sub>C\<^sub>F\<^bsub>\<CC>\<^esub>)) = 4\<^sub>\<nat>
[PROOF STEP]
unfolding op_cf_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> [\<langle>\<aa>\<rightarrow>\<gg>\<rightarrow>\<oo>\<leftarrow>\<ff>\<leftarrow>\<bb>\<rangle>\<^sub>C\<^sub>F\<^bsub>\<CC>\<^esub>\<lparr>ObjMap\<rparr>, \<langle>\<aa>\<rightarrow>\<gg>\<rightarrow>\<oo>\<leftarrow>\<ff>\<leftarrow>\<bb>\<rangle>\<^sub>C\<^sub>F\<^bsub>\<CC>\<^esub>\<lparr>ArrMap\<rparr>, op_cat (\<langle>\<aa>\<rightarrow>\<gg>\<rightarrow>\<oo>\<leftarrow>\<ff>\<leftarrow>\<bb>\<rangle>\<^sub>C\<^sub>F\<^bsub>\<CC>\<^esub>\<lparr>HomDom\<rparr>), op_cat (\<langle>\<aa>\<rightarrow>\<gg>\<rightarrow>\<oo>\<leftarrow>\<ff>\<leftarrow>\<bb>\<rangle>\<^sub>C\<^sub>F\<^bsub>\<CC>\<^esub>\<lparr>HomCod\<rparr>)]\<^sub>\<circ> = 4\<^sub>\<nat>
[PROOF STEP]
by (simp add: nat_omega_simps)
[PROOF STATE]
proof (state)
this:
\<D>\<^sub>\<circ> (op_cf (\<langle>\<aa>\<rightarrow>\<gg>\<rightarrow>\<oo>\<leftarrow>\<ff>\<leftarrow>\<bb>\<rangle>\<^sub>C\<^sub>F\<^bsub>\<CC>\<^esub>)) = 4\<^sub>\<nat>

goal (1 subgoal):
 1. op_cf (\<langle>\<aa>\<rightarrow>\<gg>\<rightarrow>\<oo>\<leftarrow>\<ff>\<leftarrow>\<bb>\<rangle>\<^sub>C\<^sub>F\<^bsub>\<CC>\<^esub>) = \<langle>\<aa>\<leftarrow>\<gg>\<leftarrow>\<oo>\<rightarrow>\<ff>\<rightarrow>\<bb>\<rangle>\<^sub>C\<^sub>F\<^bsub>op_cat \<CC>\<^esub>
[PROOF STEP]
have dom_rhs: "\<D>\<^sub>\<circ> (\<langle>\<aa>\<leftarrow>\<gg>\<leftarrow>\<oo>\<rightarrow>\<ff>\<rightarrow>\<bb>\<rangle>\<^sub>C\<^sub>F\<^bsub>op_cat \<CC>\<^esub>) = 4\<^sub>\<nat>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (\<langle>\<aa>\<leftarrow>\<gg>\<leftarrow>\<oo>\<rightarrow>\<ff>\<rightarrow>\<bb>\<rangle>\<^sub>C\<^sub>F\<^bsub>op_cat \<CC>\<^esub>) = 4\<^sub>\<nat>
[PROOF STEP]
unfolding the_cf_sspan_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> [\<lambda>a\<in>\<^sub>\<circ>\<leftarrow>\<bullet>\<rightarrow>\<^sub>C\<lparr>Obj\<rparr>. if a = \<aa>\<^sub>S\<^sub>S \<Rightarrow> \<aa> | a = \<bb>\<^sub>S\<^sub>S \<Rightarrow> \<bb> | otherwise \<Rightarrow> \<oo>, \<lambda>f\<in>\<^sub>\<circ>\<leftarrow>\<bullet>\<rightarrow>\<^sub>C\<lparr>Arr\<rparr>. if f = \<aa>\<^sub>S\<^sub>S \<Rightarrow> op_cat \<CC>\<lparr>CId\<rparr>\<lparr>\<aa>\<rparr> | f = \<bb>\<^sub>S\<^sub>S \<Rightarrow> op_cat \<CC>\<lparr>CId\<rparr>\<lparr>\<bb>\<rparr> | f = \<gg>\<^sub>S\<^sub>S \<Rightarrow> \<gg> | f = \<ff>\<^sub>S\<^sub>S \<Rightarrow> \<ff> | otherwise \<Rightarrow> op_cat \<CC>\<lparr>CId\<rparr>\<lparr>\<oo>\<rparr>, \<leftarrow>\<bullet>\<rightarrow>\<^sub>C, op_cat \<CC>]\<^sub>\<circ> = 4\<^sub>\<nat>
[PROOF STEP]
by (simp add: nat_omega_simps)
[PROOF STATE]
proof (state)
this:
\<D>\<^sub>\<circ> (\<langle>\<aa>\<leftarrow>\<gg>\<leftarrow>\<oo>\<rightarrow>\<ff>\<rightarrow>\<bb>\<rangle>\<^sub>C\<^sub>F\<^bsub>op_cat \<CC>\<^esub>) = 4\<^sub>\<nat>

goal (1 subgoal):
 1. op_cf (\<langle>\<aa>\<rightarrow>\<gg>\<rightarrow>\<oo>\<leftarrow>\<ff>\<leftarrow>\<bb>\<rangle>\<^sub>C\<^sub>F\<^bsub>\<CC>\<^esub>) = \<langle>\<aa>\<leftarrow>\<gg>\<leftarrow>\<oo>\<rightarrow>\<ff>\<rightarrow>\<bb>\<rangle>\<^sub>C\<^sub>F\<^bsub>op_cat \<CC>\<^esub>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. op_cf (\<langle>\<aa>\<rightarrow>\<gg>\<rightarrow>\<oo>\<leftarrow>\<ff>\<leftarrow>\<bb>\<rangle>\<^sub>C\<^sub>F\<^bsub>\<CC>\<^esub>) = \<langle>\<aa>\<leftarrow>\<gg>\<leftarrow>\<oo>\<rightarrow>\<ff>\<rightarrow>\<bb>\<rangle>\<^sub>C\<^sub>F\<^bsub>op_cat \<CC>\<^esub>
[PROOF STEP]
proof(rule vsv_eqI, unfold dom_lhs dom_rhs)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. vsv (op_cf (\<langle>\<aa>\<rightarrow>\<gg>\<rightarrow>\<oo>\<leftarrow>\<ff>\<leftarrow>\<bb>\<rangle>\<^sub>C\<^sub>F\<^bsub>\<CC>\<^esub>))
 2. vsv (\<langle>\<aa>\<leftarrow>\<gg>\<leftarrow>\<oo>\<rightarrow>\<ff>\<rightarrow>\<bb>\<rangle>\<^sub>C\<^sub>F\<^bsub>op_cat \<CC>\<^esub>)
 3. 4\<^sub>\<nat> = 4\<^sub>\<nat>
 4. \<And>a. a \<in>\<^sub>\<circ> 4\<^sub>\<nat> \<Longrightarrow> op_cf (\<langle>\<aa>\<rightarrow>\<gg>\<rightarrow>\<oo>\<leftarrow>\<ff>\<leftarrow>\<bb>\<rangle>\<^sub>C\<^sub>F\<^bsub>\<CC>\<^esub>)\<lparr>a\<rparr> = \<langle>\<aa>\<leftarrow>\<gg>\<leftarrow>\<oo>\<rightarrow>\<ff>\<rightarrow>\<bb>\<rangle>\<^sub>C\<^sub>F\<^bsub>op_cat \<CC>\<^esub>\<lparr>a\<rparr>
[PROOF STEP]
show "op_cf (\<langle>\<aa>\<rightarrow>\<gg>\<rightarrow>\<oo>\<leftarrow>\<ff>\<leftarrow>\<bb>\<rangle>\<^sub>C\<^sub>F\<^bsub>\<CC>\<^esub>)\<lparr>a\<rparr> = \<langle>\<aa>\<leftarrow>\<gg>\<leftarrow>\<oo>\<rightarrow>\<ff>\<rightarrow>\<bb>\<rangle>\<^sub>C\<^sub>F\<^bsub>op_cat \<CC>\<^esub>\<lparr>a\<rparr>"
      if "a \<in>\<^sub>\<circ> 4\<^sub>\<nat>" for a
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. op_cf (\<langle>\<aa>\<rightarrow>\<gg>\<rightarrow>\<oo>\<leftarrow>\<ff>\<leftarrow>\<bb>\<rangle>\<^sub>C\<^sub>F\<^bsub>\<CC>\<^esub>)\<lparr>a\<rparr> = \<langle>\<aa>\<leftarrow>\<gg>\<leftarrow>\<oo>\<rightarrow>\<ff>\<rightarrow>\<bb>\<rangle>\<^sub>C\<^sub>F\<^bsub>op_cat \<CC>\<^esub>\<lparr>a\<rparr>
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
a \<in>\<^sub>\<circ> 4\<^sub>\<nat>

goal (1 subgoal):
 1. op_cf (\<langle>\<aa>\<rightarrow>\<gg>\<rightarrow>\<oo>\<leftarrow>\<ff>\<leftarrow>\<bb>\<rangle>\<^sub>C\<^sub>F\<^bsub>\<CC>\<^esub>)\<lparr>a\<rparr> = \<langle>\<aa>\<leftarrow>\<gg>\<leftarrow>\<oo>\<rightarrow>\<ff>\<rightarrow>\<bb>\<rangle>\<^sub>C\<^sub>F\<^bsub>op_cat \<CC>\<^esub>\<lparr>a\<rparr>
[PROOF STEP]
by
        (
          elim_in_numeral,
          fold dghm_field_simps,
          unfold cat_op_simps the_cf_sspan_components the_cf_scospan_components
        )
        (
          simp_all add:
            the_cat_scospan_components(1,2)
            the_cat_sspan_components(1,2)
            cat_op_simps
        )
[PROOF STATE]
proof (state)
this:
?a \<in>\<^sub>\<circ> 4\<^sub>\<nat> \<Longrightarrow> op_cf (\<langle>\<aa>\<rightarrow>\<gg>\<rightarrow>\<oo>\<leftarrow>\<ff>\<leftarrow>\<bb>\<rangle>\<^sub>C\<^sub>F\<^bsub>\<CC>\<^esub>)\<lparr>?a\<rparr> = \<langle>\<aa>\<leftarrow>\<gg>\<leftarrow>\<oo>\<rightarrow>\<ff>\<rightarrow>\<bb>\<rangle>\<^sub>C\<^sub>F\<^bsub>op_cat \<CC>\<^esub>\<lparr>?a\<rparr>

goal (3 subgoals):
 1. vsv (op_cf (\<langle>\<aa>\<rightarrow>\<gg>\<rightarrow>\<oo>\<leftarrow>\<ff>\<leftarrow>\<bb>\<rangle>\<^sub>C\<^sub>F\<^bsub>\<CC>\<^esub>))
 2. vsv (\<langle>\<aa>\<leftarrow>\<gg>\<leftarrow>\<oo>\<rightarrow>\<ff>\<rightarrow>\<bb>\<rangle>\<^sub>C\<^sub>F\<^bsub>op_cat \<CC>\<^esub>)
 3. 4\<^sub>\<nat> = 4\<^sub>\<nat>
[PROOF STEP]
qed (auto intro: cat_op_intros cat_ss_cs_intros)
[PROOF STATE]
proof (state)
this:
op_cf (\<langle>\<aa>\<rightarrow>\<gg>\<rightarrow>\<oo>\<leftarrow>\<ff>\<leftarrow>\<bb>\<rangle>\<^sub>C\<^sub>F\<^bsub>\<CC>\<^esub>) = \<langle>\<aa>\<leftarrow>\<gg>\<leftarrow>\<oo>\<rightarrow>\<ff>\<rightarrow>\<bb>\<rangle>\<^sub>C\<^sub>F\<^bsub>op_cat \<CC>\<^esub>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma simple_integral_cong_AE_mult_indicator:
  assumes sf: "simple_function M f" and eq: "AE x in M. x \<in> S" and "S \<in> sets M"
  shows "integral\<^sup>S M f = (\<integral>\<^sup>Sx. f x * indicator S x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>S M f = \<integral>\<^sup>S x. f x * indicator S x \<partial>M
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
simple_function M f
AE x in M. x \<in> S
S \<in> sets M

goal (1 subgoal):
 1. integral\<^sup>S M f = \<integral>\<^sup>S x. f x * indicator S x \<partial>M
[PROOF STEP]
by (intro simple_integral_cong_AE) auto


[STATEMENT]
lemma tendsto_zero_powrI:
  assumes "(f \<longlongrightarrow> (0::real)) F" "(g \<longlongrightarrow> b) F" "\<forall>\<^sub>F x in F. 0 \<le> f x" "0 < b"
  shows "((\<lambda>x. f x powr g x) \<longlongrightarrow> 0) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f x powr g x) \<longlongrightarrow> 0) F
[PROOF STEP]
using tendsto_powr2[OF assms]
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. f x powr g x) \<longlongrightarrow> 0 powr b) F

goal (1 subgoal):
 1. ((\<lambda>x. f x powr g x) \<longlongrightarrow> 0) F
[PROOF STEP]
by simp


[STATEMENT]
lemma Infinitesimal_monad_zero_iff: "x \<in> Infinitesimal \<longleftrightarrow> x \<in> monad 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> Infinitesimal) = (x \<in> monad 0)
[PROOF STEP]
by (auto intro: approx_sym simp add: monad_def mem_infmal_iff)


[STATEMENT]
lemma vector_derivative_of_real_right:
  assumes "f field_differentiable at (of_real x)"
  shows   "vector_derivative (\<lambda>x. f (of_real x)) (at x) = deriv f (of_real x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vector_derivative (\<lambda>x. f (of_real x)) (at x) = deriv f (of_real x)
[PROOF STEP]
by (metis DERIV_deriv_iff_field_differentiable assms has_vector_derivative_real_field vector_derivative_at)


[STATEMENT]
lemma space_measure_spmf: "space (measure_spmf p) = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. space (measure_spmf p) = UNIV
[PROOF STEP]
by(simp add: measure_spmf_def)


[STATEMENT]
lemma partition_on_mset_add:
  assumes "partition_on_mset A P"
  assumes "X \<in># P"
  assumes "add_mset a X = X'"
  shows "partition_on_mset (add_mset a A) (add_mset X' (P - {#X#}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. partition_on_mset (add_mset a A) (add_mset X' (remove1_mset X P))
[PROOF STEP]
using add_mset_add_single assms empty_not_add_mset mset_subset_eq_single partition_on_mset_all
[PROOF STATE]
proof (prove)
using this:
add_mset ?a ?A = ?A + {#?a#}
partition_on_mset A P
X \<in># P
add_mset a X = X'
{#} \<noteq> add_mset ?a ?A
?a \<in># ?B \<Longrightarrow> {#?a#} \<subseteq># ?B
?A \<noteq> {#} \<Longrightarrow> partition_on_mset ?A {#?A#}

goal (1 subgoal):
 1. partition_on_mset (add_mset a A) (add_mset X' (remove1_mset X P))
[PROOF STEP]
by (smt partition_on_mset_def subset_mset.add_diff_inverse sum_mset.add_mset sum_mset.remove union_iff union_mset_add_mset_left)


[STATEMENT]
lemma (in PolynRg) const_times_polyn:"\<lbrakk>Idomain S; c \<in> carrier S; c \<noteq> \<zero>\<^bsub>S\<^esub>;
       p \<in> carrier R; p \<noteq> \<zero>\<rbrakk> \<Longrightarrow> (c \<cdot>\<^sub>r p) \<noteq> \<zero>  \<and>
       deg_n R S X (c \<cdot>\<^sub>r p) = deg_n R S X p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Idomain S; c \<in> carrier S; c \<noteq> \<zero>\<^bsub>S\<^esub>; p \<in> carrier R; p \<noteq> \<zero>\<rbrakk> \<Longrightarrow> c \<cdot>\<^sub>r p \<noteq> \<zero> \<and> deg_n R S X (c \<cdot>\<^sub>r p) = deg_n R S X p
[PROOF STEP]
apply (frule Idomain.idom_is_ring[of "S"],
       cut_tac subring,
       frule mem_subring_mem_ring[of S c], assumption+,
       simp add:Subring_zero_ring_zero)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Idomain S; c \<in> carrier S; c \<noteq> \<zero>; p \<in> carrier R; p \<noteq> \<zero>; Ring S; Subring R S; c \<in> carrier R\<rbrakk> \<Longrightarrow> c \<cdot>\<^sub>r p \<noteq> \<zero> \<and> deg_n R S X (c \<cdot>\<^sub>r p) = deg_n R S X p
[PROOF STEP]
apply (frule deg_mult_pols[of c p], assumption+,
       erule conjE, simp,
       simp add:pol_of_deg0[THEN sym, of "c"])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma powr_less_mono2_neg: "a < 0 \<Longrightarrow> 0 < x \<Longrightarrow> x < y \<Longrightarrow> y powr a < x powr a"
  for x :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a < 0; 0 < x; x < y\<rbrakk> \<Longrightarrow> y powr a < x powr a
[PROOF STEP]
by (simp add: powr_def)


[STATEMENT]
lemma union_commute: "M + N = N + (M::'a multiset)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M + N = N + M
[PROOF STEP]
by (fact add.commute)


[STATEMENT]
lemma complex_is_Nat_iff: "z \<in> \<nat> \<longleftrightarrow> Im z = 0 \<and> (\<exists>i. Re z = of_nat i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (z \<in> \<nat>) = (Im z = 0 \<and> (\<exists>i. Re z = real i))
[PROOF STEP]
by (auto simp: Nats_def complex_eq_iff)


[STATEMENT]
lemma injective_into_1d_imp_open_map:
  fixes f :: "'a::topological_space \<Rightarrow> real"
  assumes "continuous_on S f" "path_connected S" "inj_on f S" "openin (subtopology euclidean S) T"
  shows "openin (subtopology euclidean (f ` S)) (f ` T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. openin (top_of_set (f ` S)) (f ` T)
[PROOF STEP]
using assms homeomorphism_imp_open_map injective_into_1d_eq_homeomorphism
[PROOF STATE]
proof (prove)
using this:
continuous_on S f
path_connected S
inj_on f S
openin (top_of_set S) T
\<lbrakk>homeomorphism ?S ?T ?f ?g; openin (top_of_set ?S) ?U\<rbrakk> \<Longrightarrow> openin (top_of_set ?T) (?f ` ?U)
\<lbrakk>continuous_on ?S ?f; path_connected ?S\<rbrakk> \<Longrightarrow> inj_on ?f ?S = (\<exists>g. homeomorphism ?S (?f ` ?S) ?f g)

goal (1 subgoal):
 1. openin (top_of_set (f ` S)) (f ` T)
[PROOF STEP]
by blast


[STATEMENT]
lemma euclid:
  "PRE (\<lambda>s::nat store. s ''x'' = x \<and> s ''y'' = y)
   (WHILE (\<lambda>s. s ''y'' \<noteq> 0) INV (\<lambda>s. gcd (s ''x'') (s ''y'') = gcd x y)
    DO
     (''z'' ::= (\<lambda>s. s ''y''));
     (''y'' ::= (\<lambda>s. s ''x'' mod s ''y''));
     (''x'' ::= (\<lambda>s. s ''z''))
    OD)
   POST (\<lambda>s. s ''x'' = gcd x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rdom \<lceil>\<lambda>s. s ''x'' = x \<and> s ''y'' = y\<rceil> \<subseteq> wp (WHILE (\<lambda>s. s ''y'' \<noteq> 0) INV (\<lambda>s. gcd (s ''x'') (s ''y'') = gcd x y) DO (''z'' ::= (\<lambda>s. s ''y'')) ; (''y'' ::= (\<lambda>s. s ''x'' mod s ''y'')) ; (''x'' ::= (\<lambda>s. s ''z'')) OD) \<lceil>\<lambda>s. s ''x'' = gcd x y\<rceil>
[PROOF STEP]
by (rule rel_antidomain_kleene_algebra.fbox_whilei, auto simp: gcd_non_0_nat)


[STATEMENT]
lemma INFM_iff_infinite: "(INFM x. P x) \<longleftrightarrow> infinite {x. P x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>\<^sub>\<infinity>x. P x) = infinite {x. P x}
[PROOF STEP]
by (fact frequently_cofinite)


[STATEMENT]
lemma nested_prop_atoms_card:
  "card {Abs \<psi> | \<psi>. nested_prop_atoms \<psi> \<subseteq> nested_prop_atoms \<phi>} \<le> 2 ^ 2 ^ card (nested_prop_atoms \<phi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {Abs \<psi> |\<psi>. nested_prop_atoms \<psi> \<subseteq> nested_prop_atoms \<phi>} \<le> 2 ^ 2 ^ card (nested_prop_atoms \<phi>)
[PROOF STEP]
using equiv_card'[OF Equivalence_Relations.nested_prop_atoms_finite]
[PROOF STATE]
proof (prove)
using this:
card {Abs \<psi> |\<psi>. nested_prop_atoms \<psi> \<subseteq> nested_prop_atoms ?\<phi>1} \<le> 2 ^ 2 ^ card (nested_prop_atoms ?\<phi>1)

goal (1 subgoal):
 1. card {Abs \<psi> |\<psi>. nested_prop_atoms \<psi> \<subseteq> nested_prop_atoms \<phi>} \<le> 2 ^ 2 ^ card (nested_prop_atoms \<phi>)
[PROOF STEP]
.


[STATEMENT]
lemma represents_sqrt:
  assumes alg: "p represents x" and pos: "x \<ge> 0"
  shows "(poly_nth_root 2 p) represents (sqrt x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_nth_root 2 p represents sqrt x
[PROOF STEP]
by (rule represents_nth_root[OF _ _ alg], insert pos, auto)


[STATEMENT]
lemma zero_le_arctan_iff [simp]: "0 \<le> arctan x \<longleftrightarrow> 0 \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 \<le> arctan x) = (0 \<le> x)
[PROOF STEP]
using arctan_le_iff [of 0 x]
[PROOF STATE]
proof (prove)
using this:
(arctan 0 \<le> arctan x) = (0 \<le> x)

goal (1 subgoal):
 1. (0 \<le> arctan x) = (0 \<le> x)
[PROOF STEP]
by simp


[STATEMENT]
lemma (in PO) monotoneE:
     "[| monotone f A r;  x \<in> A; y \<in> A; (x, y) \<in> r |] ==> (f x, f y) \<in> r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Tarski.monotone f A r; x \<in> A; y \<in> A; (x, y) \<in> r\<rbrakk> \<Longrightarrow> (f x, f y) \<in> r
[PROOF STEP]
by (simp add: monotone_def)


[STATEMENT]
lemma is_ulgraph: "ulgraph V edge_set"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ulgraph V edge_set
[PROOF STEP]
using ulgraph_axioms_def is_graph_system adj_to_edge_set_card_lim
[PROOF STATE]
proof (prove)
using this:
ulgraph_axioms ?edges \<equiv> \<forall>e. e \<in> ?edges \<longrightarrow> 0 < card e \<and> card e \<le> 2
graph_system V edge_set
?e \<in> edge_set \<Longrightarrow> 0 < card ?e \<and> card ?e \<le> 2

goal (1 subgoal):
 1. ulgraph V edge_set
[PROOF STEP]
by (intro_locales) auto


[STATEMENT]
lemma Float_num[simp]:
   "real_of_float (Float 1 0) = 1"
   "real_of_float (Float 1 1) = 2"
   "real_of_float (Float 1 2) = 4"
   "real_of_float (Float 1 (- 1)) = 1/2"
   "real_of_float (Float 1 (- 2)) = 1/4"
   "real_of_float (Float 1 (- 3)) = 1/8"
   "real_of_float (Float (- 1) 0) = -1"
   "real_of_float (Float (numeral n) 0) = numeral n"
   "real_of_float (Float (- numeral n) 0) = - numeral n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((real_of_float (Float 1 0) = 1 &&& real_of_float (Float 1 1) = 2) &&& real_of_float (Float 1 2) = 4 &&& real_of_float (Float 1 (- 1)) = 1 / 2) &&& (real_of_float (Float 1 (- 2)) = 1 / 4 &&& real_of_float (Float 1 (- 3)) = 1 / 8) &&& real_of_float (Float (- 1) 0) = - 1 &&& real_of_float (Float (numeral n) 0) = numeral n &&& real_of_float (Float (- numeral n) 0) = - numeral n
[PROOF STEP]
using two_powr_int_float[of 2] two_powr_int_float[of "-1"] two_powr_int_float[of "-2"]
    two_powr_int_float[of "-3"]
[PROOF STATE]
proof (prove)
using this:
2 powr real_of_int 2 \<in> float
2 powr real_of_int (- 1) \<in> float
2 powr real_of_int (- 2) \<in> float
2 powr real_of_int (- 3) \<in> float

goal (1 subgoal):
 1. ((real_of_float (Float 1 0) = 1 &&& real_of_float (Float 1 1) = 2) &&& real_of_float (Float 1 2) = 4 &&& real_of_float (Float 1 (- 1)) = 1 / 2) &&& (real_of_float (Float 1 (- 2)) = 1 / 4 &&& real_of_float (Float 1 (- 3)) = 1 / 8) &&& real_of_float (Float (- 1) 0) = - 1 &&& real_of_float (Float (numeral n) 0) = numeral n &&& real_of_float (Float (- numeral n) 0) = - numeral n
[PROOF STEP]
using powr_realpow[of 2 2] powr_realpow[of 2 3]
[PROOF STATE]
proof (prove)
using this:
2 powr real_of_int 2 \<in> float
2 powr real_of_int (- 1) \<in> float
2 powr real_of_int (- 2) \<in> float
2 powr real_of_int (- 3) \<in> float
0 < 2 \<Longrightarrow> 2 powr real 2 = 2\<^sup>2
0 < 2 \<Longrightarrow> 2 powr real 3 = 2 ^ 3

goal (1 subgoal):
 1. ((real_of_float (Float 1 0) = 1 &&& real_of_float (Float 1 1) = 2) &&& real_of_float (Float 1 2) = 4 &&& real_of_float (Float 1 (- 1)) = 1 / 2) &&& (real_of_float (Float 1 (- 2)) = 1 / 4 &&& real_of_float (Float 1 (- 3)) = 1 / 8) &&& real_of_float (Float (- 1) 0) = - 1 &&& real_of_float (Float (numeral n) 0) = numeral n &&& real_of_float (Float (- numeral n) 0) = - numeral n
[PROOF STEP]
using powr_minus[of "2::real" 1] powr_minus[of "2::real" 2] powr_minus[of "2::real" 3]
[PROOF STATE]
proof (prove)
using this:
2 powr real_of_int 2 \<in> float
2 powr real_of_int (- 1) \<in> float
2 powr real_of_int (- 2) \<in> float
2 powr real_of_int (- 3) \<in> float
0 < 2 \<Longrightarrow> 2 powr real 2 = 2\<^sup>2
0 < 2 \<Longrightarrow> 2 powr real 3 = 2 ^ 3
2 powr - 1 = inverse (2 powr 1)
2 powr - 2 = inverse (2 powr 2)
2 powr - 3 = inverse (2 powr 3)

goal (1 subgoal):
 1. ((real_of_float (Float 1 0) = 1 &&& real_of_float (Float 1 1) = 2) &&& real_of_float (Float 1 2) = 4 &&& real_of_float (Float 1 (- 1)) = 1 / 2) &&& (real_of_float (Float 1 (- 2)) = 1 / 4 &&& real_of_float (Float 1 (- 3)) = 1 / 8) &&& real_of_float (Float (- 1) 0) = - 1 &&& real_of_float (Float (numeral n) 0) = numeral n &&& real_of_float (Float (- numeral n) 0) = - numeral n
[PROOF STEP]
by auto


[STATEMENT]
lemma sum_list_eq_0_iff_nonpos:
  fixes xs::"'a::ordered_ab_group_add list"
  shows "list_all (\<lambda>x. x \<le> 0) xs \<Longrightarrow> sum_list xs = 0 \<longleftrightarrow> (\<forall>n\<in>set xs. n = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_all (\<lambda>x. x \<le> (0::'a)) xs \<Longrightarrow> (sum_list xs = (0::'a)) = (\<forall>n\<in>set xs. n = (0::'a))
[PROOF STEP]
by (auto simp: list_all_iff sum_list_sum_nth sum_nonpos_eq_0_iff)
    (auto simp add: in_set_conv_nth)


[STATEMENT]
lemma continuous_on_prod_compactE:
  fixes fx::"'a::topological_space \<times> 'b::topological_space \<Rightarrow> 'c::metric_space"
    and e::real
  assumes cont_fx: "continuous_on (U \<times> C) fx"
  assumes "compact C"
  assumes [intro]: "x0 \<in> U"
  notes [continuous_intros] = continuous_on_compose2[OF cont_fx]
  assumes "e > 0"
  obtains X0 where "x0 \<in> X0" "open X0"
    "\<forall>x\<in>X0 \<inter> U. \<forall>t \<in> C. dist (fx (x, t)) (fx (x0, t)) \<le> e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>X0. \<lbrakk>x0 \<in> X0; open X0; \<forall>x\<in>X0 \<inter> U. \<forall>t\<in>C. dist (fx (x, t)) (fx (x0, t)) \<le> e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>X0. \<lbrakk>x0 \<in> X0; open X0; \<forall>x\<in>X0 \<inter> U. \<forall>t\<in>C. dist (fx (x, t)) (fx (x0, t)) \<le> e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
define psi where "psi = (\<lambda>(x, t). dist (fx (x, t)) (fx (x0, t)))"
[PROOF STATE]
proof (state)
this:
psi = (\<lambda>(x, t). dist (fx (x, t)) (fx (x0, t)))

goal (1 subgoal):
 1. (\<And>X0. \<lbrakk>x0 \<in> X0; open X0; \<forall>x\<in>X0 \<inter> U. \<forall>t\<in>C. dist (fx (x, t)) (fx (x0, t)) \<le> e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
define W0 where "W0 = {(x, t) \<in> U \<times> C. psi (x, t) < e}"
[PROOF STATE]
proof (state)
this:
W0 = {(x, t). (x, t) \<in> U \<times> C \<and> psi (x, t) < e}

goal (1 subgoal):
 1. (\<And>X0. \<lbrakk>x0 \<in> X0; open X0; \<forall>x\<in>X0 \<inter> U. \<forall>t\<in>C. dist (fx (x, t)) (fx (x0, t)) \<le> e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have W0_eq: "W0 = psi -` {..<e} \<inter> U \<times> C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. W0 = psi -` {..<e} \<inter> U \<times> C
[PROOF STEP]
by (auto simp: vimage_def W0_def)
[PROOF STATE]
proof (state)
this:
W0 = psi -` {..<e} \<inter> U \<times> C

goal (1 subgoal):
 1. (\<And>X0. \<lbrakk>x0 \<in> X0; open X0; \<forall>x\<in>X0 \<inter> U. \<forall>t\<in>C. dist (fx (x, t)) (fx (x0, t)) \<le> e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "open {..<e}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open {..<e}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
open {..<e}

goal (1 subgoal):
 1. (\<And>X0. \<lbrakk>x0 \<in> X0; open X0; \<forall>x\<in>X0 \<inter> U. \<forall>t\<in>C. dist (fx (x, t)) (fx (x0, t)) \<le> e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "continuous_on (U \<times> C) psi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (U \<times> C) psi
[PROOF STEP]
by (auto intro!: continuous_intros simp: psi_def split_beta')
[PROOF STATE]
proof (state)
this:
continuous_on (U \<times> C) psi

goal (1 subgoal):
 1. (\<And>X0. \<lbrakk>x0 \<in> X0; open X0; \<forall>x\<in>X0 \<inter> U. \<forall>t\<in>C. dist (fx (x, t)) (fx (x0, t)) \<le> e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from this[unfolded continuous_on_open_invariant, rule_format, OF \<open>open {..<e}\<close>]
[PROOF STATE]
proof (chain)
picking this:
\<exists>A. open A \<and> A \<inter> U \<times> C = psi -` {..<e} \<inter> U \<times> C
[PROOF STEP]
obtain W where W: "open W" "W \<inter> U \<times> C = W0 \<inter> U \<times> C"
[PROOF STATE]
proof (prove)
using this:
\<exists>A. open A \<and> A \<inter> U \<times> C = psi -` {..<e} \<inter> U \<times> C

goal (1 subgoal):
 1. (\<And>W. \<lbrakk>open W; W \<inter> U \<times> C = W0 \<inter> U \<times> C\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding W0_eq
[PROOF STATE]
proof (prove)
using this:
\<exists>A. open A \<and> A \<inter> U \<times> C = psi -` {..<e} \<inter> U \<times> C

goal (1 subgoal):
 1. (\<And>W. \<lbrakk>open W; W \<inter> U \<times> C = psi -` {..<e} \<inter> U \<times> C \<inter> U \<times> C\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
open W
W \<inter> U \<times> C = W0 \<inter> U \<times> C

goal (1 subgoal):
 1. (\<And>X0. \<lbrakk>x0 \<in> X0; open X0; \<forall>x\<in>X0 \<inter> U. \<forall>t\<in>C. dist (fx (x, t)) (fx (x0, t)) \<le> e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "{x0} \<times> C \<subseteq> W \<inter> U \<times> C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x0} \<times> C \<subseteq> W \<inter> U \<times> C
[PROOF STEP]
unfolding W
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x0} \<times> C \<subseteq> W0 \<inter> U \<times> C
[PROOF STEP]
by (auto simp: W0_def psi_def \<open>0 < e\<close>)
[PROOF STATE]
proof (state)
this:
{x0} \<times> C \<subseteq> W \<inter> U \<times> C

goal (1 subgoal):
 1. (\<And>X0. \<lbrakk>x0 \<in> X0; open X0; \<forall>x\<in>X0 \<inter> U. \<forall>t\<in>C. dist (fx (x, t)) (fx (x0, t)) \<le> e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{x0} \<times> C \<subseteq> W \<inter> U \<times> C
[PROOF STEP]
have "{x0} \<times> C \<subseteq> W"
[PROOF STATE]
proof (prove)
using this:
{x0} \<times> C \<subseteq> W \<inter> U \<times> C

goal (1 subgoal):
 1. {x0} \<times> C \<subseteq> W
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
{x0} \<times> C \<subseteq> W

goal (1 subgoal):
 1. (\<And>X0. \<lbrakk>x0 \<in> X0; open X0; \<forall>x\<in>X0 \<inter> U. \<forall>t\<in>C. dist (fx (x, t)) (fx (x0, t)) \<le> e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from tube_lemma[OF \<open>compact C\<close> \<open>open W\<close> this]
[PROOF STATE]
proof (chain)
picking this:
\<exists>X0. x0 \<in> X0 \<and> open X0 \<and> X0 \<times> C \<subseteq> W
[PROOF STEP]
obtain X0 where X0: "x0 \<in> X0" "open X0" "X0 \<times> C \<subseteq> W"
[PROOF STATE]
proof (prove)
using this:
\<exists>X0. x0 \<in> X0 \<and> open X0 \<and> X0 \<times> C \<subseteq> W

goal (1 subgoal):
 1. (\<And>X0. \<lbrakk>x0 \<in> X0; open X0; X0 \<times> C \<subseteq> W\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x0 \<in> X0
open X0
X0 \<times> C \<subseteq> W

goal (1 subgoal):
 1. (\<And>X0. \<lbrakk>x0 \<in> X0; open X0; \<forall>x\<in>X0 \<inter> U. \<forall>t\<in>C. dist (fx (x, t)) (fx (x0, t)) \<le> e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "\<forall>x\<in>X0 \<inter> U. \<forall>t \<in> C. dist (fx (x, t)) (fx (x0, t)) \<le> e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>X0 \<inter> U. \<forall>t\<in>C. dist (fx (x, t)) (fx (x0, t)) \<le> e
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x t. \<lbrakk>x \<in> X0; x \<in> U; t \<in> C\<rbrakk> \<Longrightarrow> dist (fx (x, t)) (fx (x0, t)) \<le> e
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x t. \<lbrakk>x \<in> X0; x \<in> U; t \<in> C\<rbrakk> \<Longrightarrow> dist (fx (x, t)) (fx (x0, t)) \<le> e
[PROOF STEP]
assume x: "x \<in> X0" "x \<in> U"
[PROOF STATE]
proof (state)
this:
x \<in> X0
x \<in> U

goal (1 subgoal):
 1. \<And>x t. \<lbrakk>x \<in> X0; x \<in> U; t \<in> C\<rbrakk> \<Longrightarrow> dist (fx (x, t)) (fx (x0, t)) \<le> e
[PROOF STEP]
fix t
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x t. \<lbrakk>x \<in> X0; x \<in> U; t \<in> C\<rbrakk> \<Longrightarrow> dist (fx (x, t)) (fx (x0, t)) \<le> e
[PROOF STEP]
assume t: "t \<in> C"
[PROOF STATE]
proof (state)
this:
t \<in> C

goal (1 subgoal):
 1. \<And>x t. \<lbrakk>x \<in> X0; x \<in> U; t \<in> C\<rbrakk> \<Longrightarrow> dist (fx (x, t)) (fx (x0, t)) \<le> e
[PROOF STEP]
have "dist (fx (x, t)) (fx (x0, t)) = psi (x, t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (fx (x, t)) (fx (x0, t)) = psi (x, t)
[PROOF STEP]
by (auto simp: psi_def)
[PROOF STATE]
proof (state)
this:
dist (fx (x, t)) (fx (x0, t)) = psi (x, t)

goal (1 subgoal):
 1. \<And>x t. \<lbrakk>x \<in> X0; x \<in> U; t \<in> C\<rbrakk> \<Longrightarrow> dist (fx (x, t)) (fx (x0, t)) \<le> e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dist (fx (x, t)) (fx (x0, t)) = psi (x, t)

goal (1 subgoal):
 1. \<And>x t. \<lbrakk>x \<in> X0; x \<in> U; t \<in> C\<rbrakk> \<Longrightarrow> dist (fx (x, t)) (fx (x0, t)) \<le> e
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
dist (fx (x, t)) (fx (x0, t)) = psi (x, t)

goal (1 subgoal):
 1. \<And>x t. \<lbrakk>x \<in> X0; x \<in> U; t \<in> C\<rbrakk> \<Longrightarrow> dist (fx (x, t)) (fx (x0, t)) \<le> e
[PROOF STEP]
have "(x, t) \<in> X0 \<times> C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x, t) \<in> X0 \<times> C
[PROOF STEP]
using t x
[PROOF STATE]
proof (prove)
using this:
t \<in> C
x \<in> X0
x \<in> U

goal (1 subgoal):
 1. (x, t) \<in> X0 \<times> C
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(x, t) \<in> X0 \<times> C

goal (1 subgoal):
 1. \<And>x t. \<lbrakk>x \<in> X0; x \<in> U; t \<in> C\<rbrakk> \<Longrightarrow> dist (fx (x, t)) (fx (x0, t)) \<le> e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(x, t) \<in> X0 \<times> C

goal (1 subgoal):
 1. \<And>x t. \<lbrakk>x \<in> X0; x \<in> U; t \<in> C\<rbrakk> \<Longrightarrow> dist (fx (x, t)) (fx (x0, t)) \<le> e
[PROOF STEP]
note \<open>\<dots> \<subseteq> W\<close>
[PROOF STATE]
proof (state)
this:
X0 \<times> C \<subseteq> W

goal (1 subgoal):
 1. \<And>x t. \<lbrakk>x \<in> X0; x \<in> U; t \<in> C\<rbrakk> \<Longrightarrow> dist (fx (x, t)) (fx (x0, t)) \<le> e
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(x, t) \<in> W
[PROOF STEP]
have "(x, t) \<in> W"
[PROOF STATE]
proof (prove)
using this:
(x, t) \<in> W

goal (1 subgoal):
 1. (x, t) \<in> W
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(x, t) \<in> W

goal (1 subgoal):
 1. \<And>x t. \<lbrakk>x \<in> X0; x \<in> U; t \<in> C\<rbrakk> \<Longrightarrow> dist (fx (x, t)) (fx (x0, t)) \<le> e
[PROOF STEP]
with t x
[PROOF STATE]
proof (chain)
picking this:
t \<in> C
x \<in> X0
x \<in> U
(x, t) \<in> W
[PROOF STEP]
have "(x, t) \<in> W \<inter> U \<times> C"
[PROOF STATE]
proof (prove)
using this:
t \<in> C
x \<in> X0
x \<in> U
(x, t) \<in> W

goal (1 subgoal):
 1. (x, t) \<in> W \<inter> U \<times> C
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(x, t) \<in> W \<inter> U \<times> C

goal (1 subgoal):
 1. \<And>x t. \<lbrakk>x \<in> X0; x \<in> U; t \<in> C\<rbrakk> \<Longrightarrow> dist (fx (x, t)) (fx (x0, t)) \<le> e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(x, t) \<in> W \<inter> U \<times> C

goal (1 subgoal):
 1. \<And>x t. \<lbrakk>x \<in> X0; x \<in> U; t \<in> C\<rbrakk> \<Longrightarrow> dist (fx (x, t)) (fx (x0, t)) \<le> e
[PROOF STEP]
note \<open>W \<inter> U \<times> C = W0 \<inter> U \<times> C\<close>
[PROOF STATE]
proof (state)
this:
W \<inter> U \<times> C = W0 \<inter> U \<times> C

goal (1 subgoal):
 1. \<And>x t. \<lbrakk>x \<in> X0; x \<in> U; t \<in> C\<rbrakk> \<Longrightarrow> dist (fx (x, t)) (fx (x0, t)) \<le> e
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(x, t) \<in> W0 \<inter> U \<times> C
[PROOF STEP]
have "psi (x, t) < e"
[PROOF STATE]
proof (prove)
using this:
(x, t) \<in> W0 \<inter> U \<times> C

goal (1 subgoal):
 1. psi (x, t) < e
[PROOF STEP]
by (auto simp: W0_def)
[PROOF STATE]
proof (state)
this:
psi (x, t) < e

goal (1 subgoal):
 1. \<And>x t. \<lbrakk>x \<in> X0; x \<in> U; t \<in> C\<rbrakk> \<Longrightarrow> dist (fx (x, t)) (fx (x0, t)) \<le> e
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
psi (x, t) < e

goal (1 subgoal):
 1. \<And>x t. \<lbrakk>x \<in> X0; x \<in> U; t \<in> C\<rbrakk> \<Longrightarrow> dist (fx (x, t)) (fx (x0, t)) \<le> e
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
dist (fx (x, t)) (fx (x0, t)) < e
[PROOF STEP]
show "dist (fx (x, t)) (fx (x0, t)) \<le> e"
[PROOF STATE]
proof (prove)
using this:
dist (fx (x, t)) (fx (x0, t)) < e

goal (1 subgoal):
 1. dist (fx (x, t)) (fx (x0, t)) \<le> e
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dist (fx (x, t)) (fx (x0, t)) \<le> e

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>X0 \<inter> U. \<forall>t\<in>C. dist (fx (x, t)) (fx (x0, t)) \<le> e

goal (1 subgoal):
 1. (\<And>X0. \<lbrakk>x0 \<in> X0; open X0; \<forall>x\<in>X0 \<inter> U. \<forall>t\<in>C. dist (fx (x, t)) (fx (x0, t)) \<le> e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from X0(1,2) this
[PROOF STATE]
proof (chain)
picking this:
x0 \<in> X0
open X0
\<forall>x\<in>X0 \<inter> U. \<forall>t\<in>C. dist (fx (x, t)) (fx (x0, t)) \<le> e
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x0 \<in> X0
open X0
\<forall>x\<in>X0 \<inter> U. \<forall>t\<in>C. dist (fx (x, t)) (fx (x0, t)) \<le> e

goal (1 subgoal):
 1. thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma moebius_preserve_circline_type [simp]:
  shows "circline_type (moebius_circline M H) = circline_type H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. circline_type (moebius_circline M H) = circline_type H
[PROOF STEP]
proof (transfer, transfer)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>M H. \<lbrakk>mat_det M \<noteq> 0; hermitean H \<and> H \<noteq> mat_zero\<rbrakk> \<Longrightarrow> circline_type_cmat (moebius_circline_cmat_cmat M H) = circline_type_cmat H
[PROOF STEP]
fix M H :: complex_mat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>M H. \<lbrakk>mat_det M \<noteq> 0; hermitean H \<and> H \<noteq> mat_zero\<rbrakk> \<Longrightarrow> circline_type_cmat (moebius_circline_cmat_cmat M H) = circline_type_cmat H
[PROOF STEP]
assume "mat_det M \<noteq> 0" "hermitean H \<and> H \<noteq> mat_zero"
[PROOF STATE]
proof (state)
this:
mat_det M \<noteq> 0
hermitean H \<and> H \<noteq> mat_zero

goal (1 subgoal):
 1. \<And>M H. \<lbrakk>mat_det M \<noteq> 0; hermitean H \<and> H \<noteq> mat_zero\<rbrakk> \<Longrightarrow> circline_type_cmat (moebius_circline_cmat_cmat M H) = circline_type_cmat H
[PROOF STEP]
thus "circline_type_cmat (moebius_circline_cmat_cmat M H) = circline_type_cmat H"
[PROOF STATE]
proof (prove)
using this:
mat_det M \<noteq> 0
hermitean H \<and> H \<noteq> mat_zero

goal (1 subgoal):
 1. circline_type_cmat (moebius_circline_cmat_cmat M H) = circline_type_cmat H
[PROOF STEP]
using Re_det_sgn_congruence[of "mat_inv M" "H"] mat_det_inv[of "M"]
[PROOF STATE]
proof (prove)
using this:
mat_det M \<noteq> 0
hermitean H \<and> H \<noteq> mat_zero
mat_det (mat_inv M) \<noteq> 0 \<Longrightarrow> sgn (Re (mat_det (congruence (mat_inv M) H))) = sgn (Re (mat_det H))
mat_det M \<noteq> 0 \<Longrightarrow> mat_det (mat_inv M) = 1 / mat_det M

goal (1 subgoal):
 1. circline_type_cmat (moebius_circline_cmat_cmat M H) = circline_type_cmat H
[PROOF STEP]
by (simp del: congruence_def)
[PROOF STATE]
proof (state)
this:
circline_type_cmat (moebius_circline_cmat_cmat M H) = circline_type_cmat H

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pderiv_of_int_poly [simp]: "pderiv (of_int_poly p) = of_int_poly (pderiv p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pderiv (of_int_poly p) = of_int_poly (pderiv p)
[PROOF STEP]
by (induction p) (simp_all add: pderiv_pCons)


[STATEMENT]
lemma gcd_neg1 [simp]: "gcd (-a) b = gcd a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd (- a) b = gcd a b
[PROOF STEP]
by (rule sym, rule gcdI) (simp_all add: gcd_greatest)


[STATEMENT]
lemma pair_o_assoc[simp]:
  assumes [simp]: \<open>compatible F G\<close> \<open>compatible G H\<close> \<open>compatible F H\<close>
  shows \<open>(F; (G; H)) \<circ> assoc = ((F; G); H)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (F;(G;H)) \<circ> assoc = ((F;G);H)
[PROOF STEP]
proof (rule tensor_extensionality3')
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. register ((F;(G;H)) \<circ> assoc)
 2. register ((F;G);H)
 3. \<And>f g h. ((F;(G;H)) \<circ> assoc) ((f \<otimes>\<^sub>u g) \<otimes>\<^sub>u h) = ((F;G);H) ((f \<otimes>\<^sub>u g) \<otimes>\<^sub>u h)
[PROOF STEP]
show \<open>register ((F; (G; H)) \<circ> assoc)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. register ((F;(G;H)) \<circ> assoc)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
register ((F;(G;H)) \<circ> assoc)

goal (2 subgoals):
 1. register ((F;G);H)
 2. \<And>f g h. ((F;(G;H)) \<circ> assoc) ((f \<otimes>\<^sub>u g) \<otimes>\<^sub>u h) = ((F;G);H) ((f \<otimes>\<^sub>u g) \<otimes>\<^sub>u h)
[PROOF STEP]
show \<open>register ((F; G); H)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. register ((F;G);H)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
register ((F;G);H)

goal (1 subgoal):
 1. \<And>f g h. ((F;(G;H)) \<circ> assoc) ((f \<otimes>\<^sub>u g) \<otimes>\<^sub>u h) = ((F;G);H) ((f \<otimes>\<^sub>u g) \<otimes>\<^sub>u h)
[PROOF STEP]
show \<open>((F; (G; H)) \<circ> assoc) ((f \<otimes>\<^sub>u g) \<otimes>\<^sub>u h) = ((F; G); H) ((f \<otimes>\<^sub>u g) \<otimes>\<^sub>u h)\<close> for f g h
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((F;(G;H)) \<circ> assoc) ((f \<otimes>\<^sub>u g) \<otimes>\<^sub>u h) = ((F;G);H) ((f \<otimes>\<^sub>u g) \<otimes>\<^sub>u h)
[PROOF STEP]
by (simp add: register_pair_apply assoc_apply cblinfun_compose_assoc)
[PROOF STATE]
proof (state)
this:
((F;(G;H)) \<circ> assoc) ((?f \<otimes>\<^sub>u ?g) \<otimes>\<^sub>u ?h) = ((F;G);H) ((?f \<otimes>\<^sub>u ?g) \<otimes>\<^sub>u ?h)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma hdvd_diff: "\<And>k m n :: hypnat. k dvd m \<Longrightarrow> k dvd n \<Longrightarrow> k dvd (m - n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>k m n. \<lbrakk>k dvd m; k dvd n\<rbrakk> \<Longrightarrow> k dvd m - n
[PROOF STEP]
by transfer (rule dvd_diff_nat)


[STATEMENT]
lemma (in group) generate_consistent':
  assumes "subgroup H G" "A \<subseteq> H"
  shows "\<forall>x \<in> A. generate G {x} = generate (G\<lparr>carrier := H\<rparr>) {x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>A. generate G {x} = generate (G\<lparr>carrier := H\<rparr>) {x}
[PROOF STEP]
using generate_consistent assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?K \<subseteq> ?H; subgroup ?H G\<rbrakk> \<Longrightarrow> generate (G\<lparr>carrier := ?H\<rparr>) ?K = generate G ?K
subgroup H G
A \<subseteq> H

goal (1 subgoal):
 1. \<forall>x\<in>A. generate G {x} = generate (G\<lparr>carrier := H\<rparr>) {x}
[PROOF STEP]
by auto


[STATEMENT]
lemma nth_stirling_row: "k \<le> n \<Longrightarrow> stirling_row n ! k = stirling n k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<le> n \<Longrightarrow> stirling_row n ! k = stirling n k
[PROOF STEP]
by (simp add: stirling_row_def del: upt_Suc)


[STATEMENT]
lemma synth_analz_insert:
  assumes "analz H \<subseteq> synth (analz H')"
  shows "analz (insert X H) \<subseteq> synth (analz (insert X H'))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. analz (insert X H) \<subseteq> synth (analz (insert X H'))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> analz (insert X H) \<Longrightarrow> x \<in> synth (analz (insert X H'))
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> analz (insert X H) \<Longrightarrow> x \<in> synth (analz (insert X H'))
[PROOF STEP]
assume "x \<in> analz (insert X H)"
[PROOF STATE]
proof (state)
this:
x \<in> analz (insert X H)

goal (1 subgoal):
 1. \<And>x. x \<in> analz (insert X H) \<Longrightarrow> x \<in> synth (analz (insert X H'))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> analz (insert X H)
[PROOF STEP]
have "x \<in> analz (insert X (synth (analz H')))"
[PROOF STATE]
proof (prove)
using this:
x \<in> analz (insert X H)

goal (1 subgoal):
 1. x \<in> analz (insert X (synth (analz H')))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in> analz (insert X H)
analz H \<subseteq> synth (analz H')

goal (1 subgoal):
 1. x \<in> analz (insert X (synth (analz H')))
[PROOF STEP]
by (meson analz_increasing analz_monotonic insert_mono)
[PROOF STATE]
proof (state)
this:
x \<in> analz (insert X (synth (analz H')))

goal (1 subgoal):
 1. \<And>x. x \<in> analz (insert X H) \<Longrightarrow> x \<in> synth (analz (insert X H'))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> analz (insert X (synth (analz H')))
[PROOF STEP]
show "x \<in> synth (analz (insert X H'))"
[PROOF STATE]
proof (prove)
using this:
x \<in> analz (insert X (synth (analz H')))

goal (1 subgoal):
 1. x \<in> synth (analz (insert X H'))
[PROOF STEP]
by (metis (no_types) Un_iff analz_idem analz_insert analz_monotonic analz_synth synth.Inj
        synth_insert synth_mono)
[PROOF STATE]
proof (state)
this:
x \<in> synth (analz (insert X H'))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma take_bit_set_bit_eq:
  \<open>take_bit n (set_bit m a) = (if n \<le> m then take_bit n a else set_bit m (take_bit n a))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. take_bit n (set_bit m a) = (if n \<le> m then take_bit n a else set_bit m (take_bit n a))
[PROOF STEP]
by (rule bit_eqI) (auto simp add: bit_take_bit_iff bit_set_bit_iff)


[STATEMENT]
lemma BMax_rec_eq1:
  "BMax_rec R x = (GREATEST z. (R z \<and> z \<le> x) \<or> z = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. BMax_rec R x = (GREATEST z. R z \<and> z \<le> x \<or> z = 0)
[PROOF STEP]
apply(induct x)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. BMax_rec R 0 = (GREATEST z. R z \<and> z \<le> 0 \<or> z = 0)
 2. \<And>x. BMax_rec R x = (GREATEST z. R z \<and> z \<le> x \<or> z = 0) \<Longrightarrow> BMax_rec R (Suc x) = (GREATEST z. R z \<and> z \<le> Suc x \<or> z = 0)
[PROOF STEP]
apply(auto intro: Greatest_equality Greatest_equality[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>BMax_rec R x = (GREATEST z. R z \<and> z \<le> x \<or> z = 0); \<not> R (Suc x)\<rbrakk> \<Longrightarrow> (GREATEST z. R z \<and> z \<le> x \<or> z = 0) = (GREATEST z. R z \<and> z \<le> Suc x \<or> z = 0)
[PROOF STEP]
apply(simp add: le_Suc_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>BMax_rec R x = (GREATEST z. R z \<and> z \<le> x \<or> z = 0); \<not> R (Suc x)\<rbrakk> \<Longrightarrow> (GREATEST z. R z \<and> z \<le> x \<or> z = 0) = (GREATEST z. R z \<and> (z \<le> x \<or> z = Suc x) \<or> z = 0)
[PROOF STEP]
by metis


[STATEMENT]
lemma bij_Var_subst_compose_Var:
  assumes "bij g"
  shows "(Var \<circ> g) \<circ>\<^sub>s (Var \<circ> inv g) = Var"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Var \<circ> g) \<circ>\<^sub>s (Var \<circ> inv g) = Var
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. ((Var \<circ> g) \<circ>\<^sub>s (Var \<circ> inv g)) x = Var x
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. ((Var \<circ> g) \<circ>\<^sub>s (Var \<circ> inv g)) x = Var x
[PROOF STEP]
show "((Var \<circ> g) \<circ>\<^sub>s (Var \<circ> inv g)) x = Var x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((Var \<circ> g) \<circ>\<^sub>s (Var \<circ> inv g)) x = Var x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
bij g

goal (1 subgoal):
 1. ((Var \<circ> g) \<circ>\<^sub>s (Var \<circ> inv g)) x = Var x
[PROOF STEP]
apply (auto simp: subst_compose_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij g \<Longrightarrow> inv g (g x) = x
[PROOF STEP]
by (metis UNIV_I bij_is_inj inv_into_f_f)
[PROOF STATE]
proof (state)
this:
((Var \<circ> g) \<circ>\<^sub>s (Var \<circ> inv g)) x = Var x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_unit_field_poly[simp]:
  fixes p :: "'a::field poly"
  shows "is_unit p \<longleftrightarrow> p \<noteq> 0 \<and> degree p = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_unit p = (p \<noteq> 0 \<and> degree p = 0)
[PROOF STEP]
by (cases "p=0", auto simp: is_unit_iff_degree)


[STATEMENT]
lemma perm_eq_iff2:
  fixes p q :: "perm"
  shows "p = q \<longleftrightarrow> (\<forall>a::atom \<in> supp p \<union> supp q. p \<bullet> a = q \<bullet> a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (p = q) = (\<forall>a\<in>supp p \<union> supp q. p \<bullet> a = q \<bullet> a)
[PROOF STEP]
unfolding perm_eq_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>a. p \<bullet> a = q \<bullet> a) = (\<forall>a\<in>supp p \<union> supp q. p \<bullet> a = q \<bullet> a)
[PROOF STEP]
apply(auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. \<forall>a\<in>supp p \<union> supp q. p \<bullet> a = q \<bullet> a \<Longrightarrow> p \<bullet> a = q \<bullet> a
[PROOF STEP]
apply(case_tac "a \<sharp> p \<and> a \<sharp> q")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a. \<lbrakk>\<forall>a\<in>supp p \<union> supp q. p \<bullet> a = q \<bullet> a; a \<sharp> p \<and> a \<sharp> q\<rbrakk> \<Longrightarrow> p \<bullet> a = q \<bullet> a
 2. \<And>a. \<lbrakk>\<forall>a\<in>supp p \<union> supp q. p \<bullet> a = q \<bullet> a; \<not> (a \<sharp> p \<and> a \<sharp> q)\<rbrakk> \<Longrightarrow> p \<bullet> a = q \<bullet> a
[PROOF STEP]
apply(simp add: fresh_perm)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. \<lbrakk>\<forall>a\<in>supp p \<union> supp q. p \<bullet> a = q \<bullet> a; \<not> (a \<sharp> p \<and> a \<sharp> q)\<rbrakk> \<Longrightarrow> p \<bullet> a = q \<bullet> a
[PROOF STEP]
apply(simp add: fresh_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma list_induct:
    "[| P(Nil);
        !!x xs. P(xs) ==> P(x # xs) |]  ==> P(l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>P []; \<And>x xs. P xs \<Longrightarrow> P (x # xs)\<rbrakk> \<Longrightarrow> P l
[PROOF STEP]
apply (unfold Nil_def Cons_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>P (Abs_List NIL); \<And>x xs. P xs \<Longrightarrow> P (Abs_List (CONS (Leaf x) (Rep_List xs)))\<rbrakk> \<Longrightarrow> P l
[PROOF STEP]
apply (rule Rep_List_inverse [THEN subst])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>P (Abs_List NIL); \<And>x xs. P xs \<Longrightarrow> P (Abs_List (CONS (Leaf x) (Rep_List xs)))\<rbrakk> \<Longrightarrow> P (Abs_List (Rep_List l))
[PROOF STEP]
apply (rule Rep_List [unfolded List_def, THEN list.induct], simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a M. \<lbrakk>P (Abs_List NIL); \<And>x xs. P xs \<Longrightarrow> P (Abs_List (CONS (Leaf x) (Rep_List xs))); a \<in> range Leaf; M \<in> list (range Leaf); P (Abs_List M)\<rbrakk> \<Longrightarrow> P (Abs_List (CONS a M))
[PROOF STEP]
apply (erule Abs_List_inverse [unfolded List_def, THEN subst], blast)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma evimage_ident [simp]: "(\<lambda>x. x) \<inverse>\<^bsub>n\<^esub> Y = Y \<inter> carrier (R\<^bsup>n\<^esup>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. x) \<inverse>\<^bsub>n\<^esub> Y = Y \<inter> carrier (R\<^bsup>n\<^esup>)
[PROOF STEP]
unfolding evimage_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. x) -` Y \<inter> carrier (R\<^bsup>n\<^esup>) = Y \<inter> carrier (R\<^bsup>n\<^esup>)
[PROOF STEP]
by blast


[STATEMENT]
theorem Gamma_asymp_equiv:
  "Gamma \<sim>[at_top] (\<lambda>x. sqrt (2*pi/x) * (x / exp 1) powr x :: real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gamma \<sim>[at_top] (\<lambda>x. sqrt (2 * pi / x) * (x / exp 1) powr x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Gamma \<sim>[at_top] (\<lambda>x. sqrt (2 * pi / x) * (x / exp 1) powr x)
[PROOF STEP]
note Gamma_asymp_equiv_aux
[PROOF STATE]
proof (state)
this:
Gamma \<sim>[at_top] (\<lambda>x. exp c * x powr (x - 1 / 2) / exp x)

goal (1 subgoal):
 1. Gamma \<sim>[at_top] (\<lambda>x. sqrt (2 * pi / x) * (x / exp 1) powr x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Gamma \<sim>[at_top] (\<lambda>x. exp c * x powr (x - 1 / 2) / exp x)

goal (1 subgoal):
 1. Gamma \<sim>[at_top] (\<lambda>x. sqrt (2 * pi / x) * (x / exp 1) powr x)
[PROOF STEP]
have "eventually (\<lambda>x. exp c * x powr (x - 1/2) / exp x =
               sqrt (2*pi/x) * (x / exp 1) powr x) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. exp c * x powr (x - 1 / 2) / exp x = sqrt (2 * pi / x) * (x / exp 1) powr x
[PROOF STEP]
using eventually_gt_at_top[of "0::real"]
[PROOF STATE]
proof (prove)
using this:
eventually ((<) 0) at_top

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. exp c * x powr (x - 1 / 2) / exp x = sqrt (2 * pi / x) * (x / exp 1) powr x
[PROOF STEP]
proof eventually_elim
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. 0 < x \<Longrightarrow> exp c * x powr (x - 1 / 2) / exp x = sqrt (2 * pi / x) * (x / exp 1) powr x
[PROOF STEP]
fix x :: real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. 0 < x \<Longrightarrow> exp c * x powr (x - 1 / 2) / exp x = sqrt (2 * pi / x) * (x / exp 1) powr x
[PROOF STEP]
assume x: "x > 0"
[PROOF STATE]
proof (state)
this:
0 < x

goal (1 subgoal):
 1. \<And>x. 0 < x \<Longrightarrow> exp c * x powr (x - 1 / 2) / exp x = sqrt (2 * pi / x) * (x / exp 1) powr x
[PROOF STEP]
thus "exp c * x powr (x - 1/2) / exp x = sqrt (2*pi/x) * (x / exp 1) powr x"
[PROOF STATE]
proof (prove)
using this:
0 < x

goal (1 subgoal):
 1. exp c * x powr (x - 1 / 2) / exp x = sqrt (2 * pi / x) * (x / exp 1) powr x
[PROOF STEP]
by (subst powr_diff)
         (simp add: exp_c powr_half_sqrt powr_divide field_simps real_sqrt_divide)
[PROOF STATE]
proof (state)
this:
exp c * x powr (x - 1 / 2) / exp x = sqrt (2 * pi / x) * (x / exp 1) powr x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. exp c * x powr (x - 1 / 2) / exp x = sqrt (2 * pi / x) * (x / exp 1) powr x

goal (1 subgoal):
 1. Gamma \<sim>[at_top] (\<lambda>x. sqrt (2 * pi / x) * (x / exp 1) powr x)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Gamma \<sim>[at_top] (\<lambda>x. sqrt (2 * pi / x) * (x / exp 1) powr x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Gamma \<sim>[at_top] (\<lambda>x. sqrt (2 * pi / x) * (x / exp 1) powr x)

goal (1 subgoal):
 1. Gamma \<sim>[at_top] (\<lambda>x. sqrt (2 * pi / x) * (x / exp 1) powr x)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Gamma \<sim>[at_top] (\<lambda>x. sqrt (2 * pi / x) * (x / exp 1) powr x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem th3_6_1:
    assumes "B a b c" and "B a c d"
    shows "B b c d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B b c d
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. B b c d
[PROOF STEP]
from \<open>B a c d\<close> and \<open>B a b c\<close> and th3_2
[PROOF STATE]
proof (chain)
picking this:
B a c d
B a b c
B ?a ?b ?c \<Longrightarrow> B ?c ?b ?a
[PROOF STEP]
have "B d c a" and "B c b a"
[PROOF STATE]
proof (prove)
using this:
B a c d
B a b c
B ?a ?b ?c \<Longrightarrow> B ?c ?b ?a

goal (1 subgoal):
 1. B d c a &&& B c b a
[PROOF STEP]
by fast+
[PROOF STATE]
proof (state)
this:
B d c a
B c b a

goal (1 subgoal):
 1. B b c d
[PROOF STEP]
hence "B d c b"
[PROOF STATE]
proof (prove)
using this:
B d c a
B c b a

goal (1 subgoal):
 1. B d c b
[PROOF STEP]
by (rule th3_5_1)
[PROOF STATE]
proof (state)
this:
B d c b

goal (1 subgoal):
 1. B b c d
[PROOF STEP]
thus "B b c d"
[PROOF STATE]
proof (prove)
using this:
B d c b

goal (1 subgoal):
 1. B b c d
[PROOF STEP]
by (rule th3_2)
[PROOF STATE]
proof (state)
this:
B b c d

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma smc_prod_Comp_app_component[smc_cs_simps]:
  assumes "g : b \<mapsto>\<^bsub>\<Prod>\<^sub>S\<^sub>M\<^sub>Ci\<in>\<^sub>\<circ>I. \<AA> i\<^esub> c"
    and "f : a \<mapsto>\<^bsub>\<Prod>\<^sub>S\<^sub>M\<^sub>Ci\<in>\<^sub>\<circ>I. \<AA> i\<^esub> b"
    and "i \<in>\<^sub>\<circ> I"
  shows "(g \<circ>\<^sub>A\<^bsub>(\<Prod>\<^sub>S\<^sub>M\<^sub>Ci\<in>\<^sub>\<circ>I. \<AA> i)\<^esub> f)\<lparr>i\<rparr> = g\<lparr>i\<rparr> \<circ>\<^sub>A\<^bsub>\<AA> i\<^esub> f\<lparr>i\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g \<circ>\<^sub>A\<^bsub>smc_prod I \<AA>\<^esub> f)\<lparr>i\<rparr> = g\<lparr>i\<rparr> \<circ>\<^sub>A\<^bsub>\<AA> i\<^esub> f\<lparr>i\<rparr>
[PROOF STEP]
using assms(3)
[PROOF STATE]
proof (prove)
using this:
i \<in>\<^sub>\<circ> I

goal (1 subgoal):
 1. (g \<circ>\<^sub>A\<^bsub>smc_prod I \<AA>\<^esub> f)\<lparr>i\<rparr> = g\<lparr>i\<rparr> \<circ>\<^sub>A\<^bsub>\<AA> i\<^esub> f\<lparr>i\<rparr>
[PROOF STEP]
unfolding smc_prod_Comp_app[OF assms(1,2)]
[PROOF STATE]
proof (prove)
using this:
i \<in>\<^sub>\<circ> I

goal (1 subgoal):
 1. (\<lambda>i\<in>\<^sub>\<circ>I. g\<lparr>i\<rparr> \<circ>\<^sub>A\<^bsub>\<AA> i\<^esub> f\<lparr>i\<rparr>)\<lparr>i\<rparr> = g\<lparr>i\<rparr> \<circ>\<^sub>A\<^bsub>\<AA> i\<^esub> f\<lparr>i\<rparr>
[PROOF STEP]
by simp


[STATEMENT]
lemma sin_arccos:
  assumes "- 1 \<le> x" "x \<le> 1"
  shows "sin (arccos x) = sqrt (1 - x\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sin (arccos x) = sqrt (1 - x\<^sup>2)
[PROOF STEP]
proof (rule power2_eq_imp_eq)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. (sin (arccos x))\<^sup>2 = (sqrt (1 - x\<^sup>2))\<^sup>2
 2. 0 \<le> sin (arccos x)
 3. 0 \<le> sqrt (1 - x\<^sup>2)
[PROOF STEP]
show "(sin (arccos x))\<^sup>2 = (sqrt (1 - x\<^sup>2))\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sin (arccos x))\<^sup>2 = (sqrt (1 - x\<^sup>2))\<^sup>2
[PROOF STEP]
by (simp add: square_le_1 assms sin_squared_eq)
[PROOF STATE]
proof (state)
this:
(sin (arccos x))\<^sup>2 = (sqrt (1 - x\<^sup>2))\<^sup>2

goal (2 subgoals):
 1. 0 \<le> sin (arccos x)
 2. 0 \<le> sqrt (1 - x\<^sup>2)
[PROOF STEP]
show "0 \<le> sin (arccos x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> sin (arccos x)
[PROOF STEP]
by (simp add: arccos_bounded assms sin_ge_zero)
[PROOF STATE]
proof (state)
this:
0 \<le> sin (arccos x)

goal (1 subgoal):
 1. 0 \<le> sqrt (1 - x\<^sup>2)
[PROOF STEP]
show "0 \<le> sqrt (1 - x\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> sqrt (1 - x\<^sup>2)
[PROOF STEP]
by (simp add: square_le_1 assms)
[PROOF STATE]
proof (state)
this:
0 \<le> sqrt (1 - x\<^sup>2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nth_prime_ge_2: "nth_prime n \<ge> 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 \<le> nth_prime n
[PROOF STEP]
using nth_prime_le_iff[of 0 n]
[PROOF STATE]
proof (prove)
using this:
(nth_prime 0 \<le> nth_prime n) = (0 \<le> n)

goal (1 subgoal):
 1. 2 \<le> nth_prime n
[PROOF STEP]
by (simp del: nth_prime_le_iff)


[STATEMENT]
lemma NSCauchy_NSconvergent: "NSCauchy X \<Longrightarrow> NSconvergent X"
  for X :: "nat \<Rightarrow> 'a::banach"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. NSCauchy X \<Longrightarrow> NSconvergent X
[PROOF STEP]
using Cauchy_convergent NSCauchy_Cauchy convergent_NSconvergent_iff
[PROOF STATE]
proof (prove)
using this:
Cauchy ?X \<Longrightarrow> convergent ?X
NSCauchy ?X \<Longrightarrow> Cauchy ?X
convergent ?X = NSconvergent ?X

goal (1 subgoal):
 1. NSCauchy X \<Longrightarrow> NSconvergent X
[PROOF STEP]
by auto