[STATEMENT]
lemma inj_card_le:
  "inj (f::'a \<Rightarrow> 'b) \<Longrightarrow> finite (UNIV::'b set) \<Longrightarrow> card (UNIV::'a set) \<le> card (UNIV::'b set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>inj f; finite UNIV\<rbrakk> \<Longrightarrow> card UNIV \<le> card UNIV
[PROOF STEP]
by (blast intro: card_inj_on_le)


[STATEMENT]
lemma step_n_push_size_big [simp]: "\<lbrakk>
  invar (States dir big small);
  (step ^^ n) (States dir (Big.push x big) small) = States dir' big' small'
\<rbrakk> \<Longrightarrow> size big' = Suc (size big)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>invar (States dir big small); (step ^^ n) (States dir (Big.push x big) small) = States dir' big' small'\<rbrakk> \<Longrightarrow> size big' = Suc (size big)
[PROOF STEP]
by (metis Big_Proof.size_push invar_states.simps invar_push_big step_n_size_big)


[STATEMENT]
lemma ds_SSup_inv: "ds \<circ> SSup = (id::'a::complete_lattice downset \<Rightarrow> 'a downset)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ds \<circ> SSup = id
[PROOF STEP]
unfolding ds_def SSup_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs_downset \<circ> \<down> \<circ> (Sup \<circ> Rep_downset) = id
[PROOF STEP]
by (smt Rep_downset Rep_downset_inverse cSup_atMost eq_id_iff imageE o_def ord_class.atMost_def ord_class.downset_prop)


[STATEMENT]
lemma (in Gromov_hyperbolic_space_geodesic) proj_along_geodesic_contraction:
  assumes "geodesic_segment G" "px \<in> proj_set x G" "py \<in> proj_set y G"
  shows "dist px py \<le> max (5 * deltaG(TYPE('a))) (dist x y - dist px x - dist py y + 10 * deltaG(TYPE('a)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist px py \<le> max (5 * deltaG TYPE('a)) (dist x y - dist px x - dist py y + 10 * deltaG TYPE('a))
[PROOF STEP]
using proj_along_quasiconvex_contraction[OF quasiconvex_of_geodesic[OF assms(1)] assms(2) assms(3)]
[PROOF STATE]
proof (prove)
using this:
dist px py \<le> max (5 * deltaG TYPE('a) + 2 * 0) (dist x y - dist px x - dist py y + 10 * deltaG TYPE('a) + 4 * 0)

goal (1 subgoal):
 1. dist px py \<le> max (5 * deltaG TYPE('a)) (dist x y - dist px x - dist py y + 10 * deltaG TYPE('a))
[PROOF STEP]
by auto


[STATEMENT]
lemma (in ring_hom_ring) kernel_is_ideal: "ideal (a_kernel R S h) R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ideal (a_kernel R S h) R
[PROOF STEP]
apply (rule idealI [OF R.ring_axioms])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. subgroup (a_kernel R S h) (add_monoid R)
 2. \<And>a x. \<lbrakk>a \<in> a_kernel R S h; x \<in> carrier R\<rbrakk> \<Longrightarrow> x \<otimes> a \<in> a_kernel R S h
 3. \<And>a x. \<lbrakk>a \<in> a_kernel R S h; x \<in> carrier R\<rbrakk> \<Longrightarrow> a \<otimes> x \<in> a_kernel R S h
[PROOF STEP]
apply (rule additive_subgroup.a_subgroup[OF additive_subgroup_a_kernel])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a x. \<lbrakk>a \<in> a_kernel R S h; x \<in> carrier R\<rbrakk> \<Longrightarrow> x \<otimes> a \<in> a_kernel R S h
 2. \<And>a x. \<lbrakk>a \<in> a_kernel R S h; x \<in> carrier R\<rbrakk> \<Longrightarrow> a \<otimes> x \<in> a_kernel R S h
[PROOF STEP]
apply (auto simp: a_kernel_def')
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma "fps_nth (fps_of_poly [:0, 1:] / fps_of_poly [:1, -1, -1 :: complex:]) \<in>
         O(\<lambda>n. of_nat n ^ 0 * complex_of_real 1.618034 ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ($) (fps_of_poly [:0, 1:] / fps_of_poly [:1, - 1, - 1:]) \<in> O(\<lambda>n. of_nat n ^ 0 * complex_of_real (1618034 / 10 ^ 6) ^ n)
[PROOF STEP]
by ratfps_bigo


[STATEMENT]
lemma two_realpow_ge_two :"(n::real)\<ge> 1 \<Longrightarrow> (2::real)^n \<ge> 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> real n \<Longrightarrow> 2 \<le> 2 ^ n
[PROOF STEP]
by (metis less_one not_less of_nat_1 of_nat_le_iff of_nat_numeral power_increasing power_one_right zero_neq_numeral)


[STATEMENT]
lemma perzeta_conv_hurwitz_zeta_multiplication:
  fixes k :: nat and a :: int and s :: complex
  assumes "k > 0" "s \<noteq> 1"
  shows   "k powr s * perzeta (a / k) s =
             (\<Sum>n=1..k. exp (2 * pi * n * a / k * \<i>) * hurwitz_zeta (n / k) s)"
  (is "?lhs s = ?rhs s")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat k powr s * perzeta (real_of_int a / real k) s = (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * hurwitz_zeta (real n / real k) s)
[PROOF STEP]
proof (rule analytic_continuation_open[where ?f = ?lhs and ?g = ?rhs])
[PROOF STATE]
proof (state)
goal (9 subgoals):
 1. open ?s
 2. open ?s'
 3. ?s \<noteq> {}
 4. connected ?s'
 5. ?s \<subseteq> ?s'
 6. (\<lambda>b. of_nat k powr b * perzeta (real_of_int a / real k) b) holomorphic_on ?s'
 7. (\<lambda>b. \<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * hurwitz_zeta (real n / real k) b) holomorphic_on ?s'
 8. \<And>z. z \<in> ?s \<Longrightarrow> of_nat k powr z * perzeta (real_of_int a / real k) z = (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * hurwitz_zeta (real n / real k) z)
 9. s \<in> ?s'
[PROOF STEP]
show "connected (-{1::complex})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connected (- {1})
[PROOF STEP]
by (rule connected_punctured_universe) auto
[PROOF STATE]
proof (state)
this:
connected (- {1})

goal (8 subgoals):
 1. open ?s
 2. open (- {1})
 3. ?s \<noteq> {}
 4. ?s \<subseteq> - {1}
 5. (\<lambda>b. of_nat k powr b * perzeta (real_of_int a / real k) b) holomorphic_on - {1}
 6. (\<lambda>b. \<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * hurwitz_zeta (real n / real k) b) holomorphic_on - {1}
 7. \<And>z. z \<in> ?s \<Longrightarrow> of_nat k powr z * perzeta (real_of_int a / real k) z = (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * hurwitz_zeta (real n / real k) z)
 8. s \<in> - {1}
[PROOF STEP]
show "{s. Re s > 1} \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {s. 1 < Re s} \<noteq> {}
[PROOF STEP]
by (auto intro!: exI[of _ 2])
[PROOF STATE]
proof (state)
this:
{s. 1 < Re s} \<noteq> {}

goal (7 subgoals):
 1. open {s. 1 < Re s}
 2. open (- {1})
 3. {s. 1 < Re s} \<subseteq> - {1}
 4. (\<lambda>b. of_nat k powr b * perzeta (real_of_int a / real k) b) holomorphic_on - {1}
 5. (\<lambda>b. \<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * hurwitz_zeta (real n / real k) b) holomorphic_on - {1}
 6. \<And>z. z \<in> {s. 1 < Re s} \<Longrightarrow> of_nat k powr z * perzeta (real_of_int a / real k) z = (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * hurwitz_zeta (real n / real k) z)
 7. s \<in> - {1}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (7 subgoals):
 1. open {s. 1 < Re s}
 2. open (- {1})
 3. {s. 1 < Re s} \<subseteq> - {1}
 4. (\<lambda>b. of_nat k powr b * perzeta (real_of_int a / real k) b) holomorphic_on - {1}
 5. (\<lambda>b. \<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * hurwitz_zeta (real n / real k) b) holomorphic_on - {1}
 6. \<And>z. z \<in> {s. 1 < Re s} \<Longrightarrow> of_nat k powr z * perzeta (real_of_int a / real k) z = (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * hurwitz_zeta (real n / real k) z)
 7. s \<in> - {1}
[PROOF STEP]
fix s
[PROOF STATE]
proof (state)
goal (7 subgoals):
 1. open {s. 1 < Re s}
 2. open (- {1})
 3. {s. 1 < Re s} \<subseteq> - {1}
 4. (\<lambda>b. of_nat k powr b * perzeta (real_of_int a / real k) b) holomorphic_on - {1}
 5. (\<lambda>b. \<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * hurwitz_zeta (real n / real k) b) holomorphic_on - {1}
 6. \<And>z. z \<in> {s. 1 < Re s} \<Longrightarrow> of_nat k powr z * perzeta (real_of_int a / real k) z = (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * hurwitz_zeta (real n / real k) z)
 7. s \<in> - {1}
[PROOF STEP]
assume s: "s \<in> {s. Re s > 1}"
[PROOF STATE]
proof (state)
this:
s \<in> {s. 1 < Re s}

goal (7 subgoals):
 1. open {s. 1 < Re s}
 2. open (- {1})
 3. {s. 1 < Re s} \<subseteq> - {1}
 4. (\<lambda>b. of_nat k powr b * perzeta (real_of_int a / real k) b) holomorphic_on - {1}
 5. (\<lambda>b. \<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * hurwitz_zeta (real n / real k) b) holomorphic_on - {1}
 6. \<And>z. z \<in> {s. 1 < Re s} \<Longrightarrow> of_nat k powr z * perzeta (real_of_int a / real k) z = (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * hurwitz_zeta (real n / real k) z)
 7. s \<in> - {1}
[PROOF STEP]
let ?f = "\<lambda>n. exp (2 * pi * n * a / k * \<i>)"
[PROOF STATE]
proof (state)
goal (7 subgoals):
 1. open {s. 1 < Re s}
 2. open (- {1})
 3. {s. 1 < Re s} \<subseteq> - {1}
 4. (\<lambda>b. of_nat k powr b * perzeta (real_of_int a / real k) b) holomorphic_on - {1}
 5. (\<lambda>b. \<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * hurwitz_zeta (real n / real k) b) holomorphic_on - {1}
 6. \<And>z. z \<in> {s. 1 < Re s} \<Longrightarrow> of_nat k powr z * perzeta (real_of_int a / real k) z = (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * hurwitz_zeta (real n / real k) z)
 7. s \<in> - {1}
[PROOF STEP]
show "?lhs s = ?rhs s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat k powr s * perzeta (real_of_int a / real k) s = (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * hurwitz_zeta (real n / real k) s)
[PROOF STEP]
proof (rule sums_unique2)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?f sums (of_nat k powr s * perzeta (real_of_int a / real k) s)
 2. ?f sums (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * hurwitz_zeta (real n / real k) s)
[PROOF STEP]
have "(\<lambda>m. \<Sum>n=1..k. ?f n * (of_nat m + of_real (real n / real k)) powr -s) sums
            (\<Sum>n=1..k. ?f n * hurwitz_zeta (real n / real k) s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>m. \<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * (of_nat m + complex_of_real (real n / real k)) powr - s) sums (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * hurwitz_zeta (real n / real k) s)
[PROOF STEP]
using assms s
[PROOF STATE]
proof (prove)
using this:
0 < k
s \<noteq> 1
s \<in> {s. 1 < Re s}

goal (1 subgoal):
 1. (\<lambda>m. \<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * (of_nat m + complex_of_real (real n / real k)) powr - s) sums (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * hurwitz_zeta (real n / real k) s)
[PROOF STEP]
by (intro sums_sum sums_mult sums_hurwitz_zeta) auto
[PROOF STATE]
proof (state)
this:
(\<lambda>m. \<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * (of_nat m + complex_of_real (real n / real k)) powr - s) sums (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * hurwitz_zeta (real n / real k) s)

goal (2 subgoals):
 1. ?f sums (of_nat k powr s * perzeta (real_of_int a / real k) s)
 2. ?f sums (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * hurwitz_zeta (real n / real k) s)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>m. \<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * (of_nat m + complex_of_real (real n / real k)) powr - s) sums (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * hurwitz_zeta (real n / real k) s)

goal (2 subgoals):
 1. ?f sums (of_nat k powr s * perzeta (real_of_int a / real k) s)
 2. ?f sums (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * hurwitz_zeta (real n / real k) s)
[PROOF STEP]
have "(\<lambda>m. \<Sum>n=1..k. ?f n * (of_nat m + of_real (real n / real k)) powr -s) =
                 (\<lambda>m. of_nat k powr s * (\<Sum>n=1..k. ?f n * of_nat (m * k + n) powr -s))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>m. \<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * (of_nat m + complex_of_real (real n / real k)) powr - s) = (\<lambda>m. of_nat k powr s * (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * of_nat (m * k + n) powr - s))
[PROOF STEP]
unfolding sum_distrib_left
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>m. \<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * (of_nat m + complex_of_real (real n / real k)) powr - s) = (\<lambda>m. \<Sum>n = 1..k. of_nat k powr s * (exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * of_nat (m * k + n) powr - s))
[PROOF STEP]
proof (intro ext sum.cong, goal_cases)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>m. {1..k} = {1..k}
 2. \<And>m x. x \<in> {1..k} \<Longrightarrow> exp (complex_of_real (2 * pi * real x * real_of_int a / real k) * \<i>) * (of_nat m + complex_of_real (real x / real k)) powr - s = of_nat k powr s * (exp (complex_of_real (2 * pi * real x * real_of_int a / real k) * \<i>) * of_nat (m * k + x) powr - s)
[PROOF STEP]
case (2 m n)
[PROOF STATE]
proof (state)
this:
n \<in> {1..k}

goal (2 subgoals):
 1. \<And>m. {1..k} = {1..k}
 2. \<And>m x. x \<in> {1..k} \<Longrightarrow> exp (complex_of_real (2 * pi * real x * real_of_int a / real k) * \<i>) * (of_nat m + complex_of_real (real x / real k)) powr - s = of_nat k powr s * (exp (complex_of_real (2 * pi * real x * real_of_int a / real k) * \<i>) * of_nat (m * k + x) powr - s)
[PROOF STEP]
hence "m * k + n > 0"
[PROOF STATE]
proof (prove)
using this:
n \<in> {1..k}

goal (1 subgoal):
 1. 0 < m * k + n
[PROOF STEP]
by (intro add_nonneg_pos) auto
[PROOF STATE]
proof (state)
this:
0 < m * k + n

goal (2 subgoals):
 1. \<And>m. {1..k} = {1..k}
 2. \<And>m x. x \<in> {1..k} \<Longrightarrow> exp (complex_of_real (2 * pi * real x * real_of_int a / real k) * \<i>) * (of_nat m + complex_of_real (real x / real k)) powr - s = of_nat k powr s * (exp (complex_of_real (2 * pi * real x * real_of_int a / real k) * \<i>) * of_nat (m * k + x) powr - s)
[PROOF STEP]
hence "of_nat 0 \<noteq> (of_nat (m * k + n) :: complex)"
[PROOF STATE]
proof (prove)
using this:
0 < m * k + n

goal (1 subgoal):
 1. of_nat 0 \<noteq> of_nat (m * k + n)
[PROOF STEP]
by (simp only: of_nat_eq_iff)
[PROOF STATE]
proof (state)
this:
of_nat 0 \<noteq> of_nat (m * k + n)

goal (2 subgoals):
 1. \<And>m. {1..k} = {1..k}
 2. \<And>m x. x \<in> {1..k} \<Longrightarrow> exp (complex_of_real (2 * pi * real x * real_of_int a / real k) * \<i>) * (of_nat m + complex_of_real (real x / real k)) powr - s = of_nat k powr s * (exp (complex_of_real (2 * pi * real x * real_of_int a / real k) * \<i>) * of_nat (m * k + x) powr - s)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
of_nat 0 \<noteq> of_nat (m * k + n)

goal (2 subgoals):
 1. \<And>m. {1..k} = {1..k}
 2. \<And>m x. x \<in> {1..k} \<Longrightarrow> exp (complex_of_real (2 * pi * real x * real_of_int a / real k) * \<i>) * (of_nat m + complex_of_real (real x / real k)) powr - s = of_nat k powr s * (exp (complex_of_real (2 * pi * real x * real_of_int a / real k) * \<i>) * of_nat (m * k + x) powr - s)
[PROOF STEP]
have "of_nat (m * k + n) = of_nat m * of_nat k + (of_nat n :: complex)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat (m * k + n) = of_nat m * of_nat k + of_nat n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
of_nat (m * k + n) = of_nat m * of_nat k + of_nat n

goal (2 subgoals):
 1. \<And>m. {1..k} = {1..k}
 2. \<And>m x. x \<in> {1..k} \<Longrightarrow> exp (complex_of_real (2 * pi * real x * real_of_int a / real k) * \<i>) * (of_nat m + complex_of_real (real x / real k)) powr - s = of_nat k powr s * (exp (complex_of_real (2 * pi * real x * real_of_int a / real k) * \<i>) * of_nat (m * k + x) powr - s)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
of_nat 0 \<noteq> of_nat m * of_nat k + of_nat n
[PROOF STEP]
have nz: "\<dots> \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
of_nat 0 \<noteq> of_nat m * of_nat k + of_nat n

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

goal (2 subgoals):
 1. \<And>m. {1..k} = {1..k}
 2. \<And>m x. x \<in> {1..k} \<Longrightarrow> exp (complex_of_real (2 * pi * real x * real_of_int a / real k) * \<i>) * (of_nat m + complex_of_real (real x / real k)) powr - s = of_nat k powr s * (exp (complex_of_real (2 * pi * real x * real_of_int a / real k) * \<i>) * of_nat (m * k + x) powr - s)
[PROOF STEP]
have "of_nat m + of_real (real n / real k) =
              (inverse (of_nat k) * of_nat (m * k + n) :: complex)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat m + complex_of_real (real n / real k) = inverse (of_nat k) * of_nat (m * k + n)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < k
s \<noteq> 1

goal (1 subgoal):
 1. of_nat m + complex_of_real (real n / real k) = inverse (of_nat k) * of_nat (m * k + n)
[PROOF STEP]
(* TODO: Field_as_Ring messing up things again *)
[PROOF STATE]
proof (prove)
using this:
0 < k
s \<noteq> 1

goal (1 subgoal):
 1. of_nat m + complex_of_real (real n / real k) = inverse (of_nat k) * of_nat (m * k + n)
[PROOF STEP]
by (simp add: field_simps del: div_mult_self1 div_mult_self2 div_mult_self3 div_mult_self4)
[PROOF STATE]
proof (state)
this:
of_nat m + complex_of_real (real n / real k) = inverse (of_nat k) * of_nat (m * k + n)

goal (2 subgoals):
 1. \<And>m. {1..k} = {1..k}
 2. \<And>m x. x \<in> {1..k} \<Longrightarrow> exp (complex_of_real (2 * pi * real x * real_of_int a / real k) * \<i>) * (of_nat m + complex_of_real (real x / real k)) powr - s = of_nat k powr s * (exp (complex_of_real (2 * pi * real x * real_of_int a / real k) * \<i>) * of_nat (m * k + x) powr - s)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
of_nat m + complex_of_real (real n / real k) = inverse (of_nat k) * of_nat (m * k + n)

goal (2 subgoals):
 1. \<And>m. {1..k} = {1..k}
 2. \<And>m x. x \<in> {1..k} \<Longrightarrow> exp (complex_of_real (2 * pi * real x * real_of_int a / real k) * \<i>) * (of_nat m + complex_of_real (real x / real k)) powr - s = of_nat k powr s * (exp (complex_of_real (2 * pi * real x * real_of_int a / real k) * \<i>) * of_nat (m * k + x) powr - s)
[PROOF STEP]
from nz
[PROOF STATE]
proof (chain)
picking this:
of_nat m * of_nat k + of_nat n \<noteq> 0
[PROOF STEP]
have "\<dots> powr -s = of_nat k powr s * of_nat (m * k + n) powr -s"
[PROOF STATE]
proof (prove)
using this:
of_nat m * of_nat k + of_nat n \<noteq> 0

goal (1 subgoal):
 1. (inverse (of_nat k) * of_nat (m * k + n)) powr - s = of_nat k powr s * of_nat (m * k + n) powr - s
[PROOF STEP]
by (subst powr_times_real) (auto simp: add_eq_0_iff powr_def exp_minus Ln_inverse)
[PROOF STATE]
proof (state)
this:
(inverse (of_nat k) * of_nat (m * k + n)) powr - s = of_nat k powr s * of_nat (m * k + n) powr - s

goal (2 subgoals):
 1. \<And>m. {1..k} = {1..k}
 2. \<And>m x. x \<in> {1..k} \<Longrightarrow> exp (complex_of_real (2 * pi * real x * real_of_int a / real k) * \<i>) * (of_nat m + complex_of_real (real x / real k)) powr - s = of_nat k powr s * (exp (complex_of_real (2 * pi * real x * real_of_int a / real k) * \<i>) * of_nat (m * k + x) powr - s)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(of_nat m + complex_of_real (real n / real k)) powr - s = of_nat k powr s * of_nat (m * k + n) powr - s
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(of_nat m + complex_of_real (real n / real k)) powr - s = of_nat k powr s * of_nat (m * k + n) powr - s

goal (1 subgoal):
 1. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * (of_nat m + complex_of_real (real n / real k)) powr - s = of_nat k powr s * (exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * of_nat (m * k + n) powr - s)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * (of_nat m + complex_of_real (real n / real k)) powr - s = of_nat k powr s * (exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * of_nat (m * k + n) powr - s)

goal (1 subgoal):
 1. \<And>m. {1..k} = {1..k}
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
(\<lambda>m. \<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * (of_nat m + complex_of_real (real n / real k)) powr - s) = (\<lambda>m. of_nat k powr s * (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * of_nat (m * k + n) powr - s))

goal (2 subgoals):
 1. ?f sums (of_nat k powr s * perzeta (real_of_int a / real k) s)
 2. ?f sums (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * hurwitz_zeta (real n / real k) s)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>m. of_nat k powr s * (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * of_nat (m * k + n) powr - s)) sums (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * hurwitz_zeta (real n / real k) s)
[PROOF STEP]
show "\<dots> sums (\<Sum>n=1..k. ?f n * hurwitz_zeta (real n / real k) s)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>m. of_nat k powr s * (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * of_nat (m * k + n) powr - s)) sums (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * hurwitz_zeta (real n / real k) s)

goal (1 subgoal):
 1. (\<lambda>m. of_nat k powr s * (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * of_nat (m * k + n) powr - s)) sums (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * hurwitz_zeta (real n / real k) s)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<lambda>m. of_nat k powr s * (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * of_nat (m * k + n) powr - s)) sums (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * hurwitz_zeta (real n / real k) s)

goal (1 subgoal):
 1. (\<lambda>m. of_nat k powr s * (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * of_nat (m * k + n) powr - s)) sums (of_nat k powr s * perzeta (real_of_int a / real k) s)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>m. of_nat k powr s * (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * of_nat (m * k + n) powr - s)) sums (of_nat k powr s * perzeta (real_of_int a / real k) s)
[PROOF STEP]
define g where "g = (\<lambda>m. exp (2 * pi * \<i> * m * (real_of_int a / real k)))"
[PROOF STATE]
proof (state)
this:
g = (\<lambda>m. exp (complex_of_real (2 * pi) * \<i> * m * complex_of_real (real_of_int a / real k)))

goal (1 subgoal):
 1. (\<lambda>m. of_nat k powr s * (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * of_nat (m * k + n) powr - s)) sums (of_nat k powr s * perzeta (real_of_int a / real k) s)
[PROOF STEP]
have "(\<lambda>m. g (Suc m) / (Suc m) powr s) sums eval_fds (fds_perzeta (a / k)) s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>m. g (of_nat (Suc m)) / of_nat (Suc m) powr s) sums eval_fds (fds_perzeta (real_of_int a / real k)) s
[PROOF STEP]
unfolding g_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>m. exp (complex_of_real (2 * pi) * \<i> * of_nat (Suc m) * complex_of_real (real_of_int a / real k)) / of_nat (Suc m) powr s) sums eval_fds (fds_perzeta (real_of_int a / real k)) s
[PROOF STEP]
using s
[PROOF STATE]
proof (prove)
using this:
s \<in> {s. 1 < Re s}

goal (1 subgoal):
 1. (\<lambda>m. exp (complex_of_real (2 * pi) * \<i> * of_nat (Suc m) * complex_of_real (real_of_int a / real k)) / of_nat (Suc m) powr s) sums eval_fds (fds_perzeta (real_of_int a / real k)) s
[PROOF STEP]
by (intro sums_fds_perzeta) auto
[PROOF STATE]
proof (state)
this:
(\<lambda>m. g (of_nat (Suc m)) / of_nat (Suc m) powr s) sums eval_fds (fds_perzeta (real_of_int a / real k)) s

goal (1 subgoal):
 1. (\<lambda>m. of_nat k powr s * (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * of_nat (m * k + n) powr - s)) sums (of_nat k powr s * perzeta (real_of_int a / real k) s)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>m. g (of_nat (Suc m)) / of_nat (Suc m) powr s) sums eval_fds (fds_perzeta (real_of_int a / real k)) s

goal (1 subgoal):
 1. (\<lambda>m. of_nat k powr s * (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * of_nat (m * k + n) powr - s)) sums (of_nat k powr s * perzeta (real_of_int a / real k) s)
[PROOF STEP]
have "(\<lambda>m. g (Suc m) / (Suc m) powr s) = (\<lambda>m. ?f (Suc m) * (Suc m) powr -s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>m. g (of_nat (Suc m)) / of_nat (Suc m) powr s) = (\<lambda>m. exp (complex_of_real (2 * pi * real (Suc m) * real_of_int a / real k) * \<i>) * of_nat (Suc m) powr - s)
[PROOF STEP]
by (simp add: powr_minus field_simps g_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>m. g (of_nat (Suc m)) / of_nat (Suc m) powr s) = (\<lambda>m. exp (complex_of_real (2 * pi * real (Suc m) * real_of_int a / real k) * \<i>) * of_nat (Suc m) powr - s)

goal (1 subgoal):
 1. (\<lambda>m. of_nat k powr s * (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * of_nat (m * k + n) powr - s)) sums (of_nat k powr s * perzeta (real_of_int a / real k) s)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>m. g (of_nat (Suc m)) / of_nat (Suc m) powr s) = (\<lambda>m. exp (complex_of_real (2 * pi * real (Suc m) * real_of_int a / real k) * \<i>) * of_nat (Suc m) powr - s)

goal (1 subgoal):
 1. (\<lambda>m. of_nat k powr s * (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * of_nat (m * k + n) powr - s)) sums (of_nat k powr s * perzeta (real_of_int a / real k) s)
[PROOF STEP]
have "eval_fds (fds_perzeta (a / k)) s = perzeta (a / k) s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_fds (fds_perzeta (real_of_int a / real k)) s = perzeta (real_of_int a / real k) s
[PROOF STEP]
using s
[PROOF STATE]
proof (prove)
using this:
s \<in> {s. 1 < Re s}

goal (1 subgoal):
 1. eval_fds (fds_perzeta (real_of_int a / real k)) s = perzeta (real_of_int a / real k) s
[PROOF STEP]
by (simp add: perzeta_altdef1)
[PROOF STATE]
proof (state)
this:
eval_fds (fds_perzeta (real_of_int a / real k)) s = perzeta (real_of_int a / real k) s

goal (1 subgoal):
 1. (\<lambda>m. of_nat k powr s * (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * of_nat (m * k + n) powr - s)) sums (of_nat k powr s * perzeta (real_of_int a / real k) s)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>m. exp (complex_of_real (2 * pi * real (Suc m) * real_of_int a / real k) * \<i>) * of_nat (Suc m) powr - s) sums perzeta (real_of_int a / real k) s
[PROOF STEP]
have "(\<lambda>m. \<Sum>n=m*k..<m*k+k. ?f (Suc n) * of_nat (Suc n) powr -s) sums perzeta (a / k) s"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>m. exp (complex_of_real (2 * pi * real (Suc m) * real_of_int a / real k) * \<i>) * of_nat (Suc m) powr - s) sums perzeta (real_of_int a / real k) s

goal (1 subgoal):
 1. (\<lambda>m. \<Sum>n = m * k..<m * k + k. exp (complex_of_real (2 * pi * real (Suc n) * real_of_int a / real k) * \<i>) * of_nat (Suc n) powr - s) sums perzeta (real_of_int a / real k) s
[PROOF STEP]
using \<open>k > 0\<close>
[PROOF STATE]
proof (prove)
using this:
(\<lambda>m. exp (complex_of_real (2 * pi * real (Suc m) * real_of_int a / real k) * \<i>) * of_nat (Suc m) powr - s) sums perzeta (real_of_int a / real k) s
0 < k

goal (1 subgoal):
 1. (\<lambda>m. \<Sum>n = m * k..<m * k + k. exp (complex_of_real (2 * pi * real (Suc n) * real_of_int a / real k) * \<i>) * of_nat (Suc n) powr - s) sums perzeta (real_of_int a / real k) s
[PROOF STEP]
by (rule sums_group)
[PROOF STATE]
proof (state)
this:
(\<lambda>m. \<Sum>n = m * k..<m * k + k. exp (complex_of_real (2 * pi * real (Suc n) * real_of_int a / real k) * \<i>) * of_nat (Suc n) powr - s) sums perzeta (real_of_int a / real k) s

goal (1 subgoal):
 1. (\<lambda>m. of_nat k powr s * (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * of_nat (m * k + n) powr - s)) sums (of_nat k powr s * perzeta (real_of_int a / real k) s)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>m. \<Sum>n = m * k..<m * k + k. exp (complex_of_real (2 * pi * real (Suc n) * real_of_int a / real k) * \<i>) * of_nat (Suc n) powr - s) sums perzeta (real_of_int a / real k) s

goal (1 subgoal):
 1. (\<lambda>m. of_nat k powr s * (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * of_nat (m * k + n) powr - s)) sums (of_nat k powr s * perzeta (real_of_int a / real k) s)
[PROOF STEP]
have "(\<lambda>m. \<Sum>n=m*k..<m*k+k. ?f (Suc n) * of_nat (Suc n) powr -s) =
                 (\<lambda>m. \<Sum>n=1..k. ?f (m * k + n) * of_nat (m * k + n) powr -s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>m. \<Sum>n = m * k..<m * k + k. exp (complex_of_real (2 * pi * real (Suc n) * real_of_int a / real k) * \<i>) * of_nat (Suc n) powr - s) = (\<lambda>m. \<Sum>n = 1..k. exp (complex_of_real (2 * pi * real (m * k + n) * real_of_int a / real k) * \<i>) * of_nat (m * k + n) powr - s)
[PROOF STEP]
proof (rule ext, goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m. (\<Sum>n = m * k..<m * k + k. exp (complex_of_real (2 * pi * real (Suc n) * real_of_int a / real k) * \<i>) * of_nat (Suc n) powr - s) = (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real (m * k + n) * real_of_int a / real k) * \<i>) * of_nat (m * k + n) powr - s)
[PROOF STEP]
case (1 m)
[PROOF STATE]
proof (state)
this:

goal (1 subgoal):
 1. \<And>m. (\<Sum>n = m * k..<m * k + k. exp (complex_of_real (2 * pi * real (Suc n) * real_of_int a / real k) * \<i>) * of_nat (Suc n) powr - s) = (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real (m * k + n) * real_of_int a / real k) * \<i>) * of_nat (m * k + n) powr - s)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n = m * k..<m * k + k. exp (complex_of_real (2 * pi * real (Suc n) * real_of_int a / real k) * \<i>) * of_nat (Suc n) powr - s) = (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real (m * k + n) * real_of_int a / real k) * \<i>) * of_nat (m * k + n) powr - s)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < k
s \<noteq> 1

goal (1 subgoal):
 1. (\<Sum>n = m * k..<m * k + k. exp (complex_of_real (2 * pi * real (Suc n) * real_of_int a / real k) * \<i>) * of_nat (Suc n) powr - s) = (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real (m * k + n) * real_of_int a / real k) * \<i>) * of_nat (m * k + n) powr - s)
[PROOF STEP]
by (intro ext sum.reindex_bij_witness[of _ "\<lambda>n. m * k + n - 1" "\<lambda>n. Suc n - m * k"]) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>n = m * k..<m * k + k. exp (complex_of_real (2 * pi * real (Suc n) * real_of_int a / real k) * \<i>) * of_nat (Suc n) powr - s) = (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real (m * k + n) * real_of_int a / real k) * \<i>) * of_nat (m * k + n) powr - s)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>m. \<Sum>n = m * k..<m * k + k. exp (complex_of_real (2 * pi * real (Suc n) * real_of_int a / real k) * \<i>) * of_nat (Suc n) powr - s) = (\<lambda>m. \<Sum>n = 1..k. exp (complex_of_real (2 * pi * real (m * k + n) * real_of_int a / real k) * \<i>) * of_nat (m * k + n) powr - s)

goal (1 subgoal):
 1. (\<lambda>m. of_nat k powr s * (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * of_nat (m * k + n) powr - s)) sums (of_nat k powr s * perzeta (real_of_int a / real k) s)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>m. \<Sum>n = m * k..<m * k + k. exp (complex_of_real (2 * pi * real (Suc n) * real_of_int a / real k) * \<i>) * of_nat (Suc n) powr - s) = (\<lambda>m. \<Sum>n = 1..k. exp (complex_of_real (2 * pi * real (m * k + n) * real_of_int a / real k) * \<i>) * of_nat (m * k + n) powr - s)

goal (1 subgoal):
 1. (\<lambda>m. of_nat k powr s * (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * of_nat (m * k + n) powr - s)) sums (of_nat k powr s * perzeta (real_of_int a / real k) s)
[PROOF STEP]
have "(\<lambda>m n. ?f (m * k + n)) = (\<lambda>m n. ?f n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>m n. exp (complex_of_real (2 * pi * real (m * k + n) * real_of_int a / real k) * \<i>)) = (\<lambda>x xa. exp (complex_of_real (2 * pi * real xa * real_of_int a / real k) * \<i>))
[PROOF STEP]
proof (intro ext)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m n. exp (complex_of_real (2 * pi * real (m * k + n) * real_of_int a / real k) * \<i>) = exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>)
[PROOF STEP]
fix m n :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m n. exp (complex_of_real (2 * pi * real (m * k + n) * real_of_int a / real k) * \<i>) = exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>)
[PROOF STEP]
have "?f (m * k + n) / ?f n = exp (2 * pi * m * a * \<i>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp (complex_of_real (2 * pi * real (m * k + n) * real_of_int a / real k) * \<i>) / exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) = exp (complex_of_real (2 * pi * real m * real_of_int a) * \<i>)
[PROOF STEP]
using \<open>k > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < k

goal (1 subgoal):
 1. exp (complex_of_real (2 * pi * real (m * k + n) * real_of_int a / real k) * \<i>) / exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) = exp (complex_of_real (2 * pi * real m * real_of_int a) * \<i>)
[PROOF STEP]
by (auto simp: ring_distribs add_divide_distrib exp_add mult_ac)
[PROOF STATE]
proof (state)
this:
exp (complex_of_real (2 * pi * real (m * k + n) * real_of_int a / real k) * \<i>) / exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) = exp (complex_of_real (2 * pi * real m * real_of_int a) * \<i>)

goal (1 subgoal):
 1. \<And>m n. exp (complex_of_real (2 * pi * real (m * k + n) * real_of_int a / real k) * \<i>) = exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
exp (complex_of_real (2 * pi * real (m * k + n) * real_of_int a / real k) * \<i>) / exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) = exp (complex_of_real (2 * pi * real m * real_of_int a) * \<i>)

goal (1 subgoal):
 1. \<And>m n. exp (complex_of_real (2 * pi * real (m * k + n) * real_of_int a / real k) * \<i>) = exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>)
[PROOF STEP]
have "\<dots> = cis (2 * pi * (m * a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp (complex_of_real (2 * pi * real m * real_of_int a) * \<i>) = cis (2 * pi * real_of_int (int m * a))
[PROOF STEP]
by (simp add: exp_eq_polar mult_ac)
[PROOF STATE]
proof (state)
this:
exp (complex_of_real (2 * pi * real m * real_of_int a) * \<i>) = cis (2 * pi * real_of_int (int m * a))

goal (1 subgoal):
 1. \<And>m n. exp (complex_of_real (2 * pi * real (m * k + n) * real_of_int a / real k) * \<i>) = exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
exp (complex_of_real (2 * pi * real m * real_of_int a) * \<i>) = cis (2 * pi * real_of_int (int m * a))

goal (1 subgoal):
 1. \<And>m n. exp (complex_of_real (2 * pi * real (m * k + n) * real_of_int a / real k) * \<i>) = exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>)
[PROOF STEP]
have "\<dots> = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cis (2 * pi * real_of_int (int m * a)) = 1
[PROOF STEP]
by (rule cis_multiple_2pi) auto
[PROOF STATE]
proof (state)
this:
cis (2 * pi * real_of_int (int m * a)) = 1

goal (1 subgoal):
 1. \<And>m n. exp (complex_of_real (2 * pi * real (m * k + n) * real_of_int a / real k) * \<i>) = exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
exp (complex_of_real (2 * pi * real (m * k + n) * real_of_int a / real k) * \<i>) / exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) = 1
[PROOF STEP]
show "?f (m * k + n) = ?f n"
[PROOF STATE]
proof (prove)
using this:
exp (complex_of_real (2 * pi * real (m * k + n) * real_of_int a / real k) * \<i>) / exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) = 1

goal (1 subgoal):
 1. exp (complex_of_real (2 * pi * real (m * k + n) * real_of_int a / real k) * \<i>) = exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
exp (complex_of_real (2 * pi * real (m * k + n) * real_of_int a / real k) * \<i>) = exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>m n. exp (complex_of_real (2 * pi * real (m * k + n) * real_of_int a / real k) * \<i>)) = (\<lambda>x xa. exp (complex_of_real (2 * pi * real xa * real_of_int a / real k) * \<i>))

goal (1 subgoal):
 1. (\<lambda>m. of_nat k powr s * (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * of_nat (m * k + n) powr - s)) sums (of_nat k powr s * perzeta (real_of_int a / real k) s)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>m. \<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * of_nat (m * k + n) powr - s) sums perzeta (real_of_int a / real k) s
[PROOF STEP]
show "(\<lambda>m. of_nat k powr s * (\<Sum>n=1..k. ?f n * of_nat (m * k + n) powr -s)) sums
                    (of_nat k powr s * perzeta (a / k) s)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>m. \<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * of_nat (m * k + n) powr - s) sums perzeta (real_of_int a / real k) s

goal (1 subgoal):
 1. (\<lambda>m. of_nat k powr s * (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * of_nat (m * k + n) powr - s)) sums (of_nat k powr s * perzeta (real_of_int a / real k) s)
[PROOF STEP]
by (rule sums_mult)
[PROOF STATE]
proof (state)
this:
(\<lambda>m. of_nat k powr s * (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * of_nat (m * k + n) powr - s)) sums (of_nat k powr s * perzeta (real_of_int a / real k) s)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
of_nat k powr s * perzeta (real_of_int a / real k) s = (\<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * hurwitz_zeta (real n / real k) s)

goal (6 subgoals):
 1. open {s. 1 < Re s}
 2. open (- {1})
 3. {s. 1 < Re s} \<subseteq> - {1}
 4. (\<lambda>b. of_nat k powr b * perzeta (real_of_int a / real k) b) holomorphic_on - {1}
 5. (\<lambda>b. \<Sum>n = 1..k. exp (complex_of_real (2 * pi * real n * real_of_int a / real k) * \<i>) * hurwitz_zeta (real n / real k) b) holomorphic_on - {1}
 6. s \<in> - {1}
[PROOF STEP]
qed (use assms in \<open>auto intro!: holomorphic_intros simp: finite_imp_closed open_halfspace_Re_gt\<close>)


[STATEMENT]
lemma sorted_merge_adj:
  "\<forall>xs \<in> set xss. sorted xs \<Longrightarrow> \<forall>xs \<in> set (merge_adj xss). sorted xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ball (set xss) sorted \<Longrightarrow> Ball (set (merge_adj xss)) sorted
[PROOF STEP]
by(induction xss rule: merge_adj.induct) (auto simp: sorted_merge)


[STATEMENT]
lemma continuous_on_closed_Un:
  "closed s \<Longrightarrow> closed t \<Longrightarrow> continuous_on s f \<Longrightarrow> continuous_on t f \<Longrightarrow> continuous_on (s \<union> t) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>closed s; closed t; continuous_on s f; continuous_on t f\<rbrakk> \<Longrightarrow> continuous_on (s \<union> t) f
[PROOF STEP]
by (auto simp add: continuous_on_closed_vimage closed_Un Int_Un_distrib)


[STATEMENT]
lemma path_input_containment :
  assumes "well_formed M"
  and     "path M p q"
shows "set (map fst (map fst p)) \<subseteq> inputs M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (map fst (map fst p)) \<subseteq> inputs M
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
well_formed M
path M p q

goal (1 subgoal):
 1. set (map fst (map fst p)) \<subseteq> inputs M
[PROOF STEP]
proof (induction p arbitrary: q rule: rev_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>q. \<lbrakk>well_formed M; path M [] q\<rbrakk> \<Longrightarrow> set (map fst (map fst [])) \<subseteq> inputs M
 2. \<And>x xs q. \<lbrakk>\<And>q. \<lbrakk>well_formed M; path M xs q\<rbrakk> \<Longrightarrow> set (map fst (map fst xs)) \<subseteq> inputs M; well_formed M; path M (xs @ [x]) q\<rbrakk> \<Longrightarrow> set (map fst (map fst (xs @ [x]))) \<subseteq> inputs M
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
well_formed M
path M [] q

goal (2 subgoals):
 1. \<And>q. \<lbrakk>well_formed M; path M [] q\<rbrakk> \<Longrightarrow> set (map fst (map fst [])) \<subseteq> inputs M
 2. \<And>x xs q. \<lbrakk>\<And>q. \<lbrakk>well_formed M; path M xs q\<rbrakk> \<Longrightarrow> set (map fst (map fst xs)) \<subseteq> inputs M; well_formed M; path M (xs @ [x]) q\<rbrakk> \<Longrightarrow> set (map fst (map fst (xs @ [x]))) \<subseteq> inputs M
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
well_formed M
path M [] q
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
well_formed M
path M [] q

goal (1 subgoal):
 1. set (map fst (map fst [])) \<subseteq> inputs M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set (map fst (map fst [])) \<subseteq> inputs M

goal (1 subgoal):
 1. \<And>x xs q. \<lbrakk>\<And>q. \<lbrakk>well_formed M; path M xs q\<rbrakk> \<Longrightarrow> set (map fst (map fst xs)) \<subseteq> inputs M; well_formed M; path M (xs @ [x]) q\<rbrakk> \<Longrightarrow> set (map fst (map fst (xs @ [x]))) \<subseteq> inputs M
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xs q. \<lbrakk>\<And>q. \<lbrakk>well_formed M; path M xs q\<rbrakk> \<Longrightarrow> set (map fst (map fst xs)) \<subseteq> inputs M; well_formed M; path M (xs @ [x]) q\<rbrakk> \<Longrightarrow> set (map fst (map fst (xs @ [x]))) \<subseteq> inputs M
[PROOF STEP]
case (snoc a p)
[PROOF STATE]
proof (state)
this:
\<lbrakk>well_formed M; path M p ?q\<rbrakk> \<Longrightarrow> set (map fst (map fst p)) \<subseteq> inputs M
well_formed M
path M (p @ [a]) q

goal (1 subgoal):
 1. \<And>x xs q. \<lbrakk>\<And>q. \<lbrakk>well_formed M; path M xs q\<rbrakk> \<Longrightarrow> set (map fst (map fst xs)) \<subseteq> inputs M; well_formed M; path M (xs @ [x]) q\<rbrakk> \<Longrightarrow> set (map fst (map fst (xs @ [x]))) \<subseteq> inputs M
[PROOF STEP]
have "set (map fst (p @ [a])) \<subseteq> (inputs M \<times> outputs M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (map fst (p @ [a])) \<subseteq> inputs M \<times> outputs M
[PROOF STEP]
using well_formed_path_io_containment[OF snoc.prems]
[PROOF STATE]
proof (prove)
using this:
set (map fst (p @ [a])) \<subseteq> inputs M \<times> outputs M

goal (1 subgoal):
 1. set (map fst (p @ [a])) \<subseteq> inputs M \<times> outputs M
[PROOF STEP]
by assumption
[PROOF STATE]
proof (state)
this:
set (map fst (p @ [a])) \<subseteq> inputs M \<times> outputs M

goal (1 subgoal):
 1. \<And>x xs q. \<lbrakk>\<And>q. \<lbrakk>well_formed M; path M xs q\<rbrakk> \<Longrightarrow> set (map fst (map fst xs)) \<subseteq> inputs M; well_formed M; path M (xs @ [x]) q\<rbrakk> \<Longrightarrow> set (map fst (map fst (xs @ [x]))) \<subseteq> inputs M
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
set (map fst (p @ [a])) \<subseteq> inputs M \<times> outputs M
[PROOF STEP]
have "(fst a) \<in> (inputs M \<times> outputs M)"
[PROOF STATE]
proof (prove)
using this:
set (map fst (p @ [a])) \<subseteq> inputs M \<times> outputs M

goal (1 subgoal):
 1. fst a \<in> inputs M \<times> outputs M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
fst a \<in> inputs M \<times> outputs M

goal (1 subgoal):
 1. \<And>x xs q. \<lbrakk>\<And>q. \<lbrakk>well_formed M; path M xs q\<rbrakk> \<Longrightarrow> set (map fst (map fst xs)) \<subseteq> inputs M; well_formed M; path M (xs @ [x]) q\<rbrakk> \<Longrightarrow> set (map fst (map fst (xs @ [x]))) \<subseteq> inputs M
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
fst a \<in> inputs M \<times> outputs M
[PROOF STEP]
have "fst (fst a) \<in> inputs M"
[PROOF STATE]
proof (prove)
using this:
fst a \<in> inputs M \<times> outputs M

goal (1 subgoal):
 1. fst (fst a) \<in> inputs M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
fst (fst a) \<in> inputs M

goal (1 subgoal):
 1. \<And>x xs q. \<lbrakk>\<And>q. \<lbrakk>well_formed M; path M xs q\<rbrakk> \<Longrightarrow> set (map fst (map fst xs)) \<subseteq> inputs M; well_formed M; path M (xs @ [x]) q\<rbrakk> \<Longrightarrow> set (map fst (map fst (xs @ [x]))) \<subseteq> inputs M
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
fst (fst a) \<in> inputs M

goal (1 subgoal):
 1. \<And>x xs q. \<lbrakk>\<And>q. \<lbrakk>well_formed M; path M xs q\<rbrakk> \<Longrightarrow> set (map fst (map fst xs)) \<subseteq> inputs M; well_formed M; path M (xs @ [x]) q\<rbrakk> \<Longrightarrow> set (map fst (map fst (xs @ [x]))) \<subseteq> inputs M
[PROOF STEP]
have "set (map fst (map fst p)) \<subseteq> inputs M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (map fst (map fst p)) \<subseteq> inputs M
[PROOF STEP]
using snoc.IH[OF snoc.prems(1)]
[PROOF STATE]
proof (prove)
using this:
path M p ?q \<Longrightarrow> set (map fst (map fst p)) \<subseteq> inputs M

goal (1 subgoal):
 1. set (map fst (map fst p)) \<subseteq> inputs M
[PROOF STEP]
using snoc.prems(2)
[PROOF STATE]
proof (prove)
using this:
path M p ?q \<Longrightarrow> set (map fst (map fst p)) \<subseteq> inputs M
path M (p @ [a]) q

goal (1 subgoal):
 1. set (map fst (map fst p)) \<subseteq> inputs M
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
set (map fst (map fst p)) \<subseteq> inputs M

goal (1 subgoal):
 1. \<And>x xs q. \<lbrakk>\<And>q. \<lbrakk>well_formed M; path M xs q\<rbrakk> \<Longrightarrow> set (map fst (map fst xs)) \<subseteq> inputs M; well_formed M; path M (xs @ [x]) q\<rbrakk> \<Longrightarrow> set (map fst (map fst (xs @ [x]))) \<subseteq> inputs M
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
fst (fst a) \<in> inputs M
set (map fst (map fst p)) \<subseteq> inputs M
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
fst (fst a) \<in> inputs M
set (map fst (map fst p)) \<subseteq> inputs M

goal (1 subgoal):
 1. set (map fst (map fst (p @ [a]))) \<subseteq> inputs M
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
set (map fst (map fst (p @ [a]))) \<subseteq> inputs M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma has_derivative_at_left_at_right':
  "(g has_derivative g') (at x)"
  if
    "(g has_derivative g') (at x within {..x})"
    "(g has_derivative g') (at x within {x..})"
  for x::real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g has_derivative g') (at x)
[PROOF STEP]
apply (rule has_derivative_split_at)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (g has_derivative g') (at_left x)
 2. (g has_derivative g') (at_right x)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g has_derivative g') (at_left x)
[PROOF STEP]
by (rule has_derivative_subset) (fact, auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g has_derivative g') (at_right x)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g has_derivative g') (at_right x)
[PROOF STEP]
by (rule has_derivative_subset) (fact, auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma nonstrict_eq: "non_strict_dominate i j \<Longrightarrow> \<not> strict_dominate i j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. non_strict_dominate i j \<Longrightarrow> \<not> strict_dominate i j
[PROOF STEP]
by (auto simp add:non_strict_dominate_def strict_dominate_def)


[STATEMENT]
lemma perp2_right_comm:
  assumes "P Perp2 A B C D"
  shows "P Perp2 A B D C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P Perp2 A B D C
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. P Perp2 A B D C
[PROOF STEP]
obtain X Y where "Col P X Y \<and> X Y Perp A B \<and> X Y Perp C D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>X Y. Col P X Y \<and> X Y Perp A B \<and> X Y Perp C D \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using Perp2_def assms
[PROOF STATE]
proof (prove)
using this:
?P Perp2 ?A ?B ?C ?D \<equiv> \<exists>X Y. Col ?P X Y \<and> X Y Perp ?A ?B \<and> X Y Perp ?C ?D
P Perp2 A B C D

goal (1 subgoal):
 1. (\<And>X Y. Col P X Y \<and> X Y Perp A B \<and> X Y Perp C D \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Col P X Y \<and> X Y Perp A B \<and> X Y Perp C D

goal (1 subgoal):
 1. P Perp2 A B D C
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
Col P X Y \<and> X Y Perp A B \<and> X Y Perp C D

goal (1 subgoal):
 1. P Perp2 A B D C
[PROOF STEP]
using Perp2_def perp_right_comm
[PROOF STATE]
proof (prove)
using this:
Col P X Y \<and> X Y Perp A B \<and> X Y Perp C D
?P Perp2 ?A ?B ?C ?D \<equiv> \<exists>X Y. Col ?P X Y \<and> X Y Perp ?A ?B \<and> X Y Perp ?C ?D
?A ?B Perp ?C ?D \<Longrightarrow> ?A ?B Perp ?D ?C

goal (1 subgoal):
 1. P Perp2 A B D C
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
P Perp2 A B D C

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma take_deg_monom_drop_deg:
assumes "degree f \<ge> n"
shows "(f :: 'a mod_ring poly) = take_deg n f + (Polynomial.monom 1 n) * drop_deg n f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f = take_deg n f + Polynomial.monom 1 n * drop_deg n f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f = take_deg n f + Polynomial.monom 1 n * drop_deg n f
[PROOF STEP]
have "min (length (coeffs f)) n = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min (length (coeffs f)) n = n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
n \<le> degree f

goal (1 subgoal):
 1. min (length (coeffs f)) n = n
[PROOF STEP]
by (metis bot_nat_0.not_eq_extremum degree_0 le_imp_less_Suc
    length_coeffs_degree min.absorb1 min.absorb4)
[PROOF STATE]
proof (state)
this:
min (length (coeffs f)) n = n

goal (1 subgoal):
 1. f = take_deg n f + Polynomial.monom 1 n * drop_deg n f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
min (length (coeffs f)) n = n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
min (length (coeffs f)) n = n

goal (1 subgoal):
 1. f = take_deg n f + Polynomial.monom 1 n * drop_deg n f
[PROOF STEP]
unfolding take_deg_def drop_deg_def
[PROOF STATE]
proof (prove)
using this:
min (length (coeffs f)) n = n

goal (1 subgoal):
 1. f = Poly (take n (coeffs f)) + Polynomial.monom 1 n * Poly (drop n (coeffs f))
[PROOF STEP]
apply (subst Poly_coeffs[of f,symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min (length (coeffs f)) n = n \<Longrightarrow> Poly (coeffs f) = Poly (take n (coeffs f)) + Polynomial.monom 1 n * Poly (drop n (coeffs f))
[PROOF STEP]
apply (subst append_take_drop_id[of n "coeffs f", symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min (length (coeffs f)) n = n \<Longrightarrow> Poly (take n (coeffs f) @ drop n (coeffs f)) = Poly (take n (coeffs f)) + Polynomial.monom 1 n * Poly (drop n (coeffs f))
[PROOF STEP]
apply (subst Poly_append)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min (length (coeffs f)) n = n \<Longrightarrow> Poly (take n (coeffs f)) + Polynomial.monom 1 (length (take n (coeffs f))) * Poly (drop n (coeffs f)) = Poly (take n (coeffs f)) + Polynomial.monom 1 n * Poly (drop n (coeffs f))
[PROOF STEP]
by (auto)
[PROOF STATE]
proof (state)
this:
f = take_deg n f + Polynomial.monom 1 n * drop_deg n f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inj_on_exp_pi:
  fixes z::complex shows "inj_on exp (ball z pi)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on exp (ball z pi)
[PROOF STEP]
proof (clarsimp simp: inj_on_def exp_eq)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y n. \<lbrakk>dist z (y + 2 * of_int n * complex_of_real pi * \<i>) < pi; dist z y < pi\<rbrakk> \<Longrightarrow> n = 0
[PROOF STEP]
fix y n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y n. \<lbrakk>dist z (y + 2 * of_int n * complex_of_real pi * \<i>) < pi; dist z y < pi\<rbrakk> \<Longrightarrow> n = 0
[PROOF STEP]
assume "dist z (y + 2 * of_int n * of_real pi * \<i>) < pi"
         "dist z y < pi"
[PROOF STATE]
proof (state)
this:
dist z (y + 2 * of_int n * complex_of_real pi * \<i>) < pi
dist z y < pi

goal (1 subgoal):
 1. \<And>y n. \<lbrakk>dist z (y + 2 * of_int n * complex_of_real pi * \<i>) < pi; dist z y < pi\<rbrakk> \<Longrightarrow> n = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
dist z (y + 2 * of_int n * complex_of_real pi * \<i>) < pi
dist z y < pi
[PROOF STEP]
have "dist y (y + 2 * of_int n * of_real pi * \<i>) < pi+pi"
[PROOF STATE]
proof (prove)
using this:
dist z (y + 2 * of_int n * complex_of_real pi * \<i>) < pi
dist z y < pi

goal (1 subgoal):
 1. dist y (y + 2 * of_int n * complex_of_real pi * \<i>) < pi + pi
[PROOF STEP]
using dist_commute_lessI dist_triangle_less_add
[PROOF STATE]
proof (prove)
using this:
dist z (y + 2 * of_int n * complex_of_real pi * \<i>) < pi
dist z y < pi
dist ?y ?x < ?e \<Longrightarrow> dist ?x ?y < ?e
\<lbrakk>dist ?x1.0 ?y < ?e1.0; dist ?x2.0 ?y < ?e2.0\<rbrakk> \<Longrightarrow> dist ?x1.0 ?x2.0 < ?e1.0 + ?e2.0

goal (1 subgoal):
 1. dist y (y + 2 * of_int n * complex_of_real pi * \<i>) < pi + pi
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
dist y (y + 2 * of_int n * complex_of_real pi * \<i>) < pi + pi

goal (1 subgoal):
 1. \<And>y n. \<lbrakk>dist z (y + 2 * of_int n * complex_of_real pi * \<i>) < pi; dist z y < pi\<rbrakk> \<Longrightarrow> n = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
dist y (y + 2 * of_int n * complex_of_real pi * \<i>) < pi + pi
[PROOF STEP]
have "norm (2 * of_int n * of_real pi * \<i>) < 2*pi"
[PROOF STATE]
proof (prove)
using this:
dist y (y + 2 * of_int n * complex_of_real pi * \<i>) < pi + pi

goal (1 subgoal):
 1. cmod (2 * of_int n * complex_of_real pi * \<i>) < 2 * pi
[PROOF STEP]
by (simp add: dist_norm)
[PROOF STATE]
proof (state)
this:
cmod (2 * of_int n * complex_of_real pi * \<i>) < 2 * pi

goal (1 subgoal):
 1. \<And>y n. \<lbrakk>dist z (y + 2 * of_int n * complex_of_real pi * \<i>) < pi; dist z y < pi\<rbrakk> \<Longrightarrow> n = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
cmod (2 * of_int n * complex_of_real pi * \<i>) < 2 * pi
[PROOF STEP]
show "n = 0"
[PROOF STATE]
proof (prove)
using this:
cmod (2 * of_int n * complex_of_real pi * \<i>) < 2 * pi

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma digitwise_leq:
  assumes "b>1"
  shows "\<forall>t. nth_digit x t b \<le> nth_digit y t b \<Longrightarrow> x \<le> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>t. nth_digit x t b \<le> nth_digit y t b \<Longrightarrow> x \<le> y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>t. nth_digit x t b \<le> nth_digit y t b \<Longrightarrow> x \<le> y
[PROOF STEP]
assume asm: "\<forall>t. nth_digit x t b \<le> nth_digit y t b"
[PROOF STATE]
proof (state)
this:
\<forall>t. nth_digit x t b \<le> nth_digit y t b

goal (1 subgoal):
 1. \<forall>t. nth_digit x t b \<le> nth_digit y t b \<Longrightarrow> x \<le> y
[PROOF STEP]
define r where "r \<equiv>(if x>y then x else y)"
[PROOF STATE]
proof (state)
this:
r \<equiv> if y < x then x else y

goal (1 subgoal):
 1. \<forall>t. nth_digit x t b \<le> nth_digit y t b \<Longrightarrow> x \<le> y
[PROOF STEP]
have "x = (\<Sum>k<x. (nth_digit x k b) * b ^ k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = (\<Sum>k<x. nth_digit x k b * b ^ k)
[PROOF STEP]
using digit_gen_sum_repr_variant \<open>b>1\<close>
[PROOF STATE]
proof (prove)
using this:
1 < ?b \<Longrightarrow> ?n = (\<Sum>k<?n. nth_digit ?n k ?b * ?b ^ k)
1 < b

goal (1 subgoal):
 1. x = (\<Sum>k<x. nth_digit x k b * b ^ k)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x = (\<Sum>k<x. nth_digit x k b * b ^ k)

goal (1 subgoal):
 1. \<forall>t. nth_digit x t b \<le> nth_digit y t b \<Longrightarrow> x \<le> y
[PROOF STEP]
hence x: "x = (\<Sum>k=0..<r. (nth_digit x k b) * b ^ k)"
[PROOF STATE]
proof (prove)
using this:
x = (\<Sum>k<x. nth_digit x k b * b ^ k)

goal (1 subgoal):
 1. x = (\<Sum>k = 0..<r. nth_digit x k b * b ^ k)
[PROOF STEP]
using atLeast0LessThan r_def digit_gen_sum_index_variant \<open>b>1\<close>
[PROOF STATE]
proof (prove)
using this:
x = (\<Sum>k<x. nth_digit x k b * b ^ k)
{0..<?n} = {..<?n}
r \<equiv> if y < x then x else y
\<lbrakk>1 < ?b; ?n < ?r\<rbrakk> \<Longrightarrow> (\<Sum>k<?n. nth_digit ?n k ?b * ?b ^ k) = (\<Sum>k<?r. nth_digit ?n k ?b * ?b ^ k)
1 < b

goal (1 subgoal):
 1. x = (\<Sum>k = 0..<r. nth_digit x k b * b ^ k)
[PROOF STEP]
by (metis (full_types) linorder_neqE_nat)
[PROOF STATE]
proof (state)
this:
x = (\<Sum>k = 0..<r. nth_digit x k b * b ^ k)

goal (1 subgoal):
 1. \<forall>t. nth_digit x t b \<le> nth_digit y t b \<Longrightarrow> x \<le> y
[PROOF STEP]
have "y = (\<Sum>k<y. (nth_digit y k b) * b ^ k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y = (\<Sum>k<y. nth_digit y k b * b ^ k)
[PROOF STEP]
using digit_gen_sum_repr_variant \<open>b>1\<close>
[PROOF STATE]
proof (prove)
using this:
1 < ?b \<Longrightarrow> ?n = (\<Sum>k<?n. nth_digit ?n k ?b * ?b ^ k)
1 < b

goal (1 subgoal):
 1. y = (\<Sum>k<y. nth_digit y k b * b ^ k)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y = (\<Sum>k<y. nth_digit y k b * b ^ k)

goal (1 subgoal):
 1. \<forall>t. nth_digit x t b \<le> nth_digit y t b \<Longrightarrow> x \<le> y
[PROOF STEP]
hence y: "y = (\<Sum>k=0..<r. (nth_digit y k b) * b ^ k)"
[PROOF STATE]
proof (prove)
using this:
y = (\<Sum>k<y. nth_digit y k b * b ^ k)

goal (1 subgoal):
 1. y = (\<Sum>k = 0..<r. nth_digit y k b * b ^ k)
[PROOF STEP]
using atLeast0LessThan r_def digit_gen_sum_index_variant \<open>b>1\<close>
[PROOF STATE]
proof (prove)
using this:
y = (\<Sum>k<y. nth_digit y k b * b ^ k)
{0..<?n} = {..<?n}
r \<equiv> if y < x then x else y
\<lbrakk>1 < ?b; ?n < ?r\<rbrakk> \<Longrightarrow> (\<Sum>k<?n. nth_digit ?n k ?b * ?b ^ k) = (\<Sum>k<?r. nth_digit ?n k ?b * ?b ^ k)
1 < b

goal (1 subgoal):
 1. y = (\<Sum>k = 0..<r. nth_digit y k b * b ^ k)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y = (\<Sum>k = 0..<r. nth_digit y k b * b ^ k)

goal (1 subgoal):
 1. \<forall>t. nth_digit x t b \<le> nth_digit y t b \<Longrightarrow> x \<le> y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> y
[PROOF STEP]
using asm x y
    sum_mono[of "{0..<r}" "\<lambda>k. nth_digit x k b * b^k" "\<lambda>k. nth_digit y k b * b^k"]
[PROOF STATE]
proof (prove)
using this:
\<forall>t. nth_digit x t b \<le> nth_digit y t b
x = (\<Sum>k = 0..<r. nth_digit x k b * b ^ k)
y = (\<Sum>k = 0..<r. nth_digit y k b * b ^ k)
(\<And>i. i \<in> {0..<r} \<Longrightarrow> nth_digit x i b * b ^ i \<le> nth_digit y i b * b ^ i) \<Longrightarrow> (\<Sum>i = 0..<r. nth_digit x i b * b ^ i) \<le> (\<Sum>i = 0..<r. nth_digit y i b * b ^ i)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lns_alt_def2 [iff]:
  "local_nonsatiation B P \<longleftrightarrow> (\<forall>x\<in>B. \<forall>e>0. (\<exists>y.  y \<in> (ball x e) \<and> y \<in> B \<and> y \<succ>[P] x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local_nonsatiation B P = (\<forall>x\<in>B. \<forall>e>0. \<exists>y. y \<in> ball x e \<and> y \<in> B \<and> y \<succeq>[P] x \<and> (x, y) \<notin> P)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. local_nonsatiation B P \<Longrightarrow> \<forall>x\<in>B. \<forall>e>0. \<exists>y. y \<in> ball x e \<and> y \<in> B \<and> y \<succeq>[P] x \<and> (x, y) \<notin> P
 2. \<forall>x\<in>B. \<forall>e>0. \<exists>y. y \<in> ball x e \<and> y \<in> B \<and> y \<succeq>[P] x \<and> (x, y) \<notin> P \<Longrightarrow> local_nonsatiation B P
[PROOF STEP]
assume "local_nonsatiation B P"
[PROOF STATE]
proof (state)
this:
local_nonsatiation B P

goal (2 subgoals):
 1. local_nonsatiation B P \<Longrightarrow> \<forall>x\<in>B. \<forall>e>0. \<exists>y. y \<in> ball x e \<and> y \<in> B \<and> y \<succeq>[P] x \<and> (x, y) \<notin> P
 2. \<forall>x\<in>B. \<forall>e>0. \<exists>y. y \<in> ball x e \<and> y \<in> B \<and> y \<succeq>[P] x \<and> (x, y) \<notin> P \<Longrightarrow> local_nonsatiation B P
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
local_nonsatiation B P
[PROOF STEP]
show "\<forall>x\<in>B. \<forall>e>0. \<exists>x'. x' \<in> ball x e \<and> x' \<in> B \<and> x' \<succ>[P] x"
[PROOF STATE]
proof (prove)
using this:
local_nonsatiation B P

goal (1 subgoal):
 1. \<forall>x\<in>B. \<forall>e>0. \<exists>x'. x' \<in> ball x e \<and> x' \<in> B \<and> x' \<succeq>[P] x \<and> (x, x') \<notin> P
[PROOF STEP]
by (auto simp add : ball_def) (metis dense le_less_trans dist_commute)
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>B. \<forall>e>0. \<exists>x'. x' \<in> ball x e \<and> x' \<in> B \<and> x' \<succeq>[P] x \<and> (x, x') \<notin> P

goal (1 subgoal):
 1. \<forall>x\<in>B. \<forall>e>0. \<exists>y. y \<in> ball x e \<and> y \<in> B \<and> y \<succeq>[P] x \<and> (x, y) \<notin> P \<Longrightarrow> local_nonsatiation B P
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>x\<in>B. \<forall>e>0. \<exists>y. y \<in> ball x e \<and> y \<in> B \<and> y \<succeq>[P] x \<and> (x, y) \<notin> P \<Longrightarrow> local_nonsatiation B P
[PROOF STEP]
assume "\<forall>x\<in>B. \<forall>e>0. \<exists>y. y \<in> ball x e \<and> y \<in> B \<and> y \<succ>[P] x"
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>B. \<forall>e>0. \<exists>y. y \<in> ball x e \<and> y \<in> B \<and> y \<succeq>[P] x \<and> (x, y) \<notin> P

goal (1 subgoal):
 1. \<forall>x\<in>B. \<forall>e>0. \<exists>y. y \<in> ball x e \<and> y \<in> B \<and> y \<succeq>[P] x \<and> (x, y) \<notin> P \<Longrightarrow> local_nonsatiation B P
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>B. \<forall>e>0. \<exists>y. y \<in> ball x e \<and> y \<in> B \<and> y \<succeq>[P] x \<and> (x, y) \<notin> P
[PROOF STEP]
show "local_nonsatiation B P"
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>B. \<forall>e>0. \<exists>y. y \<in> ball x e \<and> y \<in> B \<and> y \<succeq>[P] x \<and> (x, y) \<notin> P

goal (1 subgoal):
 1. local_nonsatiation B P
[PROOF STEP]
by (metis (no_types, lifting) ball_def dist_commute
        less_le_not_le lns_alt_def1 mem_Collect_eq)
[PROOF STATE]
proof (state)
this:
local_nonsatiation B P

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma UNIV_supp:
  shows "supp (UNIV::atom set) = ({}::atom set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. supp UNIV = {}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. supp UNIV = {}
[PROOF STEP]
have "\<forall>(x::atom) (y::atom). [(x,y)]\<bullet>UNIV = (UNIV::atom set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. [(x, y)] \<bullet> UNIV = UNIV
[PROOF STEP]
by (auto simp add: perm_set_def calc_atm)
[PROOF STATE]
proof (state)
this:
\<forall>x y. [(x, y)] \<bullet> UNIV = UNIV

goal (1 subgoal):
 1. supp UNIV = {}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x y. [(x, y)] \<bullet> UNIV = UNIV
[PROOF STEP]
show "supp (UNIV::atom set) = ({}::atom set)"
[PROOF STATE]
proof (prove)
using this:
\<forall>x y. [(x, y)] \<bullet> UNIV = UNIV

goal (1 subgoal):
 1. supp UNIV = {}
[PROOF STEP]
by (simp add: supp_def)
[PROOF STATE]
proof (state)
this:
supp UNIV = {}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma from_list_subset : "list.set xs \<subseteq> set (from_list xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list.set xs \<subseteq> Prefix_Tree.set (from_list xs)
[PROOF STEP]
unfolding from_list_set
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list.set xs \<subseteq> Set.insert [] {xs''. \<exists>xs' xs'''. xs' \<in> list.set xs \<and> xs' = xs'' @ xs'''}
[PROOF STEP]
by auto


[STATEMENT]
lemma FINITE_MPLS:
  assumes "finite (Pi :: 'a problem)"
  shows "finite (MPLS Pi)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (MPLS Pi)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite (MPLS Pi)
[PROOF STEP]
have "\<forall>x \<in> MPLS Pi. x \<le> 2 ^ card (prob_dom Pi) - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>MPLS Pi. x \<le> 2 ^ card (prob_dom Pi) - 1
[PROOF STEP]
using assms in_MPLS_leq_2_pow_n
[PROOF STATE]
proof (prove)
using this:
finite Pi
\<lbrakk>finite ?PROB; ?x \<in> MPLS ?PROB\<rbrakk> \<Longrightarrow> ?x \<le> 2 ^ card (prob_dom ?PROB) - 1

goal (1 subgoal):
 1. \<forall>x\<in>MPLS Pi. x \<le> 2 ^ card (prob_dom Pi) - 1
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>MPLS Pi. x \<le> 2 ^ card (prob_dom Pi) - 1

goal (1 subgoal):
 1. finite (MPLS Pi)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>MPLS Pi. x \<le> 2 ^ card (prob_dom Pi) - 1
[PROOF STEP]
show "finite (MPLS Pi)"
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>MPLS Pi. x \<le> 2 ^ card (prob_dom Pi) - 1

goal (1 subgoal):
 1. finite (MPLS Pi)
[PROOF STEP]
using mems_le_finite[of "MPLS Pi" "2 ^ card (prob_dom Pi) - 1"]
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>MPLS Pi. x \<le> 2 ^ card (prob_dom Pi) - 1
\<forall>x. x \<in> MPLS Pi \<longrightarrow> x \<le> 2 ^ card (prob_dom Pi) - 1 \<Longrightarrow> finite (MPLS Pi)

goal (1 subgoal):
 1. finite (MPLS Pi)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
finite (MPLS Pi)

goal:
No subgoals!
[PROOF STEP]
qed

\<comment> \<open>NOTE 'fun' because of multiple defining equations.\<close>


[STATEMENT]
lemma state_rank_step_foldl:
  "(\<lambda>q. state_rank q n) = foldl step initial (map w [0..<n])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>q. state_rank q n) = foldl step initial (map w [0..<n])
[PROOF STEP]
by (induction n) (unfold state_rank_initial state_rank_step, simp_all)


[STATEMENT]
lemma fds_of_real_higher_deriv [simp]:
  "(fds_deriv ^^ n) (fds_of_real f) = fds_of_real ((fds_deriv ^^ n) f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (fds_deriv ^^ n) (fds_of_real f) = fds_of_real ((fds_deriv ^^ n) f)
[PROOF STEP]
by (induction n) simp_all


[STATEMENT]
lemma meld_correct':
  assumes I: "elem_invar x" "elem_invar x'"
  shows
  "elem_invar (meld' x x')"
  "elem_to_mset (meld' x x') = elem_to_mset x + elem_to_mset x'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. elem_invar (meld' x x') &&& elem_to_mset (meld' x x') = elem_to_mset x + elem_to_mset x'
[PROOF STEP]
using I
[PROOF STATE]
proof (prove)
using this:
elem_invar x
elem_invar x'

goal (1 subgoal):
 1. elem_invar (meld' x x') &&& elem_to_mset (meld' x x') = elem_to_mset x + elem_to_mset x'
[PROOF STEP]
apply (case_tac [!] x)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x1 x2 x3. \<lbrakk>elem_invar x; elem_invar x'; x = Element x1 x2 x3\<rbrakk> \<Longrightarrow> elem_invar (meld' x x')
 2. \<And>x1 x2 x3. \<lbrakk>elem_invar x; elem_invar x'; x = Element x1 x2 x3\<rbrakk> \<Longrightarrow> elem_to_mset (meld' x x') = elem_to_mset x + elem_to_mset x'
[PROOF STEP]
apply (case_tac [!] x')
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x1 x2 x3 x1a x2a x3a. \<lbrakk>elem_invar x; elem_invar x'; x = Element x1 x2 x3; x' = Element x1a x2a x3a\<rbrakk> \<Longrightarrow> elem_invar (meld' x x')
 2. \<And>x1 x2 x3 x1a x2a x3a. \<lbrakk>elem_invar x; elem_invar x'; x = Element x1 x2 x3; x' = Element x1a x2a x3a\<rbrakk> \<Longrightarrow> elem_to_mset (meld' x x') = elem_to_mset x + elem_to_mset x'
[PROOF STEP]
apply (auto simp add: insert_correct union_ac)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma (in order_topology) decreasing_tendsto:
  assumes bdd: "eventually (\<lambda>n. l \<le> f n) F"
    and en: "\<And>x. l < x \<Longrightarrow> eventually (\<lambda>n. f n < x) F"
  shows "(f \<longlongrightarrow> l) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<longlongrightarrow> l) F
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in F. l \<le> f n
l < ?x \<Longrightarrow> \<forall>\<^sub>F n in F. f n < ?x

goal (1 subgoal):
 1. (f \<longlongrightarrow> l) F
[PROOF STEP]
by (intro order_tendstoI) (auto elim!: eventually_mono)


[STATEMENT]
lemma rtranclp_normalize_poly_p_poly_of_mset:
  \<open>normalize_poly_p\<^sup>*\<^sup>* p q \<Longrightarrow> polynomial_of_mset p = polynomial_of_mset q\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. normalize_poly_p\<^sup>*\<^sup>* p q \<Longrightarrow> polynomial_of_mset p = polynomial_of_mset q
[PROOF STEP]
by (induction rule: rtranclp_induct)
    (auto simp: normalize_poly_p_poly_of_mset)


[STATEMENT]
lemma index_vec_of_scal[simp]: "(vec_of_scal x) $ 0 = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_of_scal x $ 0 = x
[PROOF STEP]
unfolding vec_of_scal_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec 1 (\<lambda>i. x) $ 0 = x
[PROOF STEP]
by auto


[STATEMENT]
lemma lossless_sample_coprime:
  assumes "\<not> prime N"
    and "N > 2"
  shows  "lossless_spmf (sample_coprime N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lossless_spmf (sample_coprime N)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lossless_spmf (sample_coprime N)
[PROOF STEP]
have "coprime_set N \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime_set N \<noteq> {}
[PROOF STEP]
by(simp add: coprime_set_non_empty assms)
[PROOF STATE]
proof (state)
this:
coprime_set N \<noteq> {}

goal (1 subgoal):
 1. lossless_spmf (sample_coprime N)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
coprime_set N \<noteq> {}

goal (1 subgoal):
 1. lossless_spmf (sample_coprime N)
[PROOF STEP]
have "finite (coprime_set N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (coprime_set N)
[PROOF STEP]
by(simp add: coprime_set_def)
[PROOF STATE]
proof (state)
this:
finite (coprime_set N)

goal (1 subgoal):
 1. lossless_spmf (sample_coprime N)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
coprime_set N \<noteq> {}
finite (coprime_set N)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
coprime_set N \<noteq> {}
finite (coprime_set N)

goal (1 subgoal):
 1. lossless_spmf (sample_coprime N)
[PROOF STEP]
by(simp add: sample_coprime_def)
[PROOF STATE]
proof (state)
this:
lossless_spmf (sample_coprime N)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma invpst_combine: "invpst l \<Longrightarrow> invpst r \<Longrightarrow> invpst (combine l r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>invpst l; invpst r\<rbrakk> \<Longrightarrow> invpst (combine l r)
[PROOF STEP]
by(induction l r rule: combine.induct)
  (auto split: tree.splits tcolor.splits simp: invpst_baldR invpst_baldL)


[STATEMENT]
lemma convex_PInfty_outside:
  fixes f :: "'a::euclidean_space \<Rightarrow> ereal"
  assumes "convex_on UNIV f" "convex S"
  shows "convex_on UNIV (\<lambda>x. if x:S then (f x) else \<infinity>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Lower_Semicontinuous.convex_on UNIV (\<lambda>x. if x \<in> S then f x else \<infinity>)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Lower_Semicontinuous.convex_on UNIV (\<lambda>x. if x \<in> S then f x else \<infinity>)
[PROOF STEP]
define g where "g x = (if x:S then -\<infinity> else \<infinity>::ereal)" for x
[PROOF STATE]
proof (state)
this:
g ?x = (if ?x \<in> S then - \<infinity> else \<infinity>)

goal (1 subgoal):
 1. Lower_Semicontinuous.convex_on UNIV (\<lambda>x. if x \<in> S then f x else \<infinity>)
[PROOF STEP]
hence "convex_on UNIV g"
[PROOF STATE]
proof (prove)
using this:
g ?x = (if ?x \<in> S then - \<infinity> else \<infinity>)

goal (1 subgoal):
 1. Lower_Semicontinuous.convex_on UNIV g
[PROOF STEP]
apply (subst infinite_convex_domain_iff)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<And>x. g x = (if x \<in> S then - \<infinity> else \<infinity>)) \<Longrightarrow> \<forall>x. g x = \<infinity> \<or> g x = - \<infinity>
 2. (\<And>x. g x = (if x \<in> S then - \<infinity> else \<infinity>)) \<Longrightarrow> convex (domain g)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Lower_Semicontinuous.convex_on UNIV f
convex S

goal (2 subgoals):
 1. (\<And>x. g x = (if x \<in> S then - \<infinity> else \<infinity>)) \<Longrightarrow> \<forall>x. g x = \<infinity> \<or> g x = - \<infinity>
 2. (\<And>x. g x = (if x \<in> S then - \<infinity> else \<infinity>)) \<Longrightarrow> convex (domain g)
[PROOF STEP]
unfolding domain_def
[PROOF STATE]
proof (prove)
using this:
Lower_Semicontinuous.convex_on UNIV f
convex S

goal (2 subgoals):
 1. (\<And>x. g x = (if x \<in> S then - \<infinity> else \<infinity>)) \<Longrightarrow> \<forall>x. g x = \<infinity> \<or> g x = - \<infinity>
 2. (\<And>x. g x = (if x \<in> S then - \<infinity> else \<infinity>)) \<Longrightarrow> convex {x. g x < \<infinity>}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Lower_Semicontinuous.convex_on UNIV g

goal (1 subgoal):
 1. Lower_Semicontinuous.convex_on UNIV (\<lambda>x. if x \<in> S then f x else \<infinity>)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Lower_Semicontinuous.convex_on UNIV g

goal (1 subgoal):
 1. Lower_Semicontinuous.convex_on UNIV (\<lambda>x. if x \<in> S then f x else \<infinity>)
[PROOF STEP]
have "(\<lambda>x. if x:S then (f x) else \<infinity>) = (\<lambda>x. max (f x) (g x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. if x \<in> S then f x else \<infinity>) = (\<lambda>x. max (f x) (g x))
[PROOF STEP]
apply (subst fun_eq_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. (if x \<in> S then f x else \<infinity>) = max (f x) (g x)
[PROOF STEP]
unfolding g_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. (if x \<in> S then f x else \<infinity>) = max (f x) (if x \<in> S then - \<infinity> else \<infinity>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. if x \<in> S then f x else \<infinity>) = (\<lambda>x. max (f x) (g x))

goal (1 subgoal):
 1. Lower_Semicontinuous.convex_on UNIV (\<lambda>x. if x \<in> S then f x else \<infinity>)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Lower_Semicontinuous.convex_on UNIV g
(\<lambda>x. if x \<in> S then f x else \<infinity>) = (\<lambda>x. max (f x) (g x))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Lower_Semicontinuous.convex_on UNIV g
(\<lambda>x. if x \<in> S then f x else \<infinity>) = (\<lambda>x. max (f x) (g x))

goal (1 subgoal):
 1. Lower_Semicontinuous.convex_on UNIV (\<lambda>x. if x \<in> S then f x else \<infinity>)
[PROOF STEP]
using convex_ereal_max assms
[PROOF STATE]
proof (prove)
using this:
Lower_Semicontinuous.convex_on UNIV g
(\<lambda>x. if x \<in> S then f x else \<infinity>) = (\<lambda>x. max (f x) (g x))
\<lbrakk>Lower_Semicontinuous.convex_on ?s ?f; Lower_Semicontinuous.convex_on ?s ?g\<rbrakk> \<Longrightarrow> Lower_Semicontinuous.convex_on ?s (\<lambda>x. max (?f x) (?g x))
Lower_Semicontinuous.convex_on UNIV f
convex S

goal (1 subgoal):
 1. Lower_Semicontinuous.convex_on UNIV (\<lambda>x. if x \<in> S then f x else \<infinity>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Lower_Semicontinuous.convex_on UNIV (\<lambda>x. if x \<in> S then f x else \<infinity>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lift_vars_monom : "vars (liftPoly i j ((MPoly_Type.monom m a)::real mpoly)) = (\<lambda>x. if x\<ge>i then x+j else x) ` vars(MPoly_Type.monom m a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vars (liftPoly i j (MPoly_Type.monom m a)) = (\<lambda>x. if i \<le> x then x + j else x) ` vars (MPoly_Type.monom m a)
[PROOF STEP]
proof(cases "a=0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a = 0 \<Longrightarrow> vars (liftPoly i j (MPoly_Type.monom m a)) = (\<lambda>x. if i \<le> x then x + j else x) ` vars (MPoly_Type.monom m a)
 2. a \<noteq> 0 \<Longrightarrow> vars (liftPoly i j (MPoly_Type.monom m a)) = (\<lambda>x. if i \<le> x then x + j else x) ` vars (MPoly_Type.monom m a)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
a = 0

goal (2 subgoals):
 1. a = 0 \<Longrightarrow> vars (liftPoly i j (MPoly_Type.monom m a)) = (\<lambda>x. if i \<le> x then x + j else x) ` vars (MPoly_Type.monom m a)
 2. a \<noteq> 0 \<Longrightarrow> vars (liftPoly i j (MPoly_Type.monom m a)) = (\<lambda>x. if i \<le> x then x + j else x) ` vars (MPoly_Type.monom m a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a = 0

goal (1 subgoal):
 1. vars (liftPoly i j (MPoly_Type.monom m a)) = (\<lambda>x. if i \<le> x then x + j else x) ` vars (MPoly_Type.monom m a)
[PROOF STEP]
by (smt MPolyExtension.monom_zero add.left_neutral add_diff_cancel_right' image_empty liftPoly_add vars_monom_single_cases)
[PROOF STATE]
proof (state)
this:
vars (liftPoly i j (MPoly_Type.monom m a)) = (\<lambda>x. if i \<le> x then x + j else x) ` vars (MPoly_Type.monom m a)

goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> vars (liftPoly i j (MPoly_Type.monom m a)) = (\<lambda>x. if i \<le> x then x + j else x) ` vars (MPoly_Type.monom m a)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> vars (liftPoly i j (MPoly_Type.monom m a)) = (\<lambda>x. if i \<le> x then x + j else x) ` vars (MPoly_Type.monom m a)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
a \<noteq> 0

goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> vars (liftPoly i j (MPoly_Type.monom m a)) = (\<lambda>x. if i \<le> x then x + j else x) ` vars (MPoly_Type.monom m a)
[PROOF STEP]
have h1: "vars (liftPoly i j (MPoly_Type.monom m a)) = keys (lowerPowers i j m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vars (liftPoly i j (MPoly_Type.monom m a)) = keys (lowerPowers i j m)
[PROOF STEP]
unfolding liftPoly_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vars (map_fun id (map_fun id (map_fun mapping_of MPoly)) higherPoly\<^sub>0 i j (MPoly_Type.monom m a)) = keys (lowerPowers i j m)
[PROOF STEP]
unfolding keys_lowerPowers keys_higherPoly\<^sub>0 vars_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (keys ` keys (mapping_of (map_fun id (map_fun id (map_fun mapping_of MPoly)) higherPoly\<^sub>0 i j (MPoly_Type.monom m a)))) = inc_above i j ` keys m
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x xa. \<lbrakk>xa \<in> keys (mapping_of (MPoly (higherPoly\<^sub>0 i j (monomial a m)))); x \<in> keys xa\<rbrakk> \<Longrightarrow> x \<in> inc_above i j ` keys m
 2. \<And>xa. xa \<in> keys m \<Longrightarrow> \<exists>x\<in>keys (mapping_of (MPoly (higherPoly\<^sub>0 i j (monomial a m)))). inc_above i j xa \<in> keys x
[PROOF STEP]
apply (smt imageE keys_higherPoly\<^sub>0 keys_lowerPowers lookup_eq_zero_in_keys_contradict lookup_single_not_eq mapping_of_inverse monomials.abs_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. xa \<in> keys m \<Longrightarrow> \<exists>x\<in>keys (mapping_of (MPoly (higherPoly\<^sub>0 i j (monomial a m)))). inc_above i j xa \<in> keys x
[PROOF STEP]
by (metis False higherPowers.rep_eq higherPowers_lowerPowers image_eqI in_keys_iff keys_higherPoly\<^sub>0 lookup_single_eq mapping_of_inverse monomials.abs_eq)
[PROOF STATE]
proof (state)
this:
vars (liftPoly i j (MPoly_Type.monom m a)) = keys (lowerPowers i j m)

goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> vars (liftPoly i j (MPoly_Type.monom m a)) = (\<lambda>x. if i \<le> x then x + j else x) ` vars (MPoly_Type.monom m a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vars (liftPoly i j (MPoly_Type.monom m a)) = (\<lambda>x. if i \<le> x then x + j else x) ` vars (MPoly_Type.monom m a)
[PROOF STEP]
unfolding h1  vars_monom_keys[OF False]
      keys_lowerPowers inc_above_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. if x < i then x else x + j) ` keys m = (\<lambda>x. if i \<le> x then x + j else x) ` keys m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vars (liftPoly i j (MPoly_Type.monom m a)) = (\<lambda>x. if i \<le> x then x + j else x) ` vars (MPoly_Type.monom m a)

goal:
No subgoals!
[PROOF STEP]
qed