[STATEMENT]
lemma quantale_hom_prop1:
  fixes f :: "'a::quantale_with_dual \<Rightarrow> 'b::quantale_with_dual"
  shows "f \<in> quantale_homset \<Longrightarrow> radj f (f x \<rightarrow> y) = x \<rightarrow> radj f y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> quantale_homset \<Longrightarrow> radj f (f x \<rightarrow> y) = x \<rightarrow> radj f y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f \<in> quantale_homset \<Longrightarrow> radj f (f x \<rightarrow> y) = x \<rightarrow> radj f y
[PROOF STEP]
assume h: "f \<in> quantale_homset"
[PROOF STATE]
proof (state)
this:
f \<in> quantale_homset

goal (1 subgoal):
 1. f \<in> quantale_homset \<Longrightarrow> radj f (f x \<rightarrow> y) = x \<rightarrow> radj f y
[PROOF STEP]
have "f x \<cdot> f (radj f (f x \<rightarrow> y)) \<le> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f x \<cdot> f (radj f (f x \<rightarrow> y)) \<le> y
[PROOF STEP]
by (meson h adj_def bres_galois order_refl quantale_hom_radj)
[PROOF STATE]
proof (state)
this:
f x \<cdot> f (radj f (f x \<rightarrow> y)) \<le> y

goal (1 subgoal):
 1. f \<in> quantale_homset \<Longrightarrow> radj f (f x \<rightarrow> y) = x \<rightarrow> radj f y
[PROOF STEP]
hence "f (x \<cdot> radj f (f x \<rightarrow> y)) \<le> y"
[PROOF STATE]
proof (prove)
using this:
f x \<cdot> f (radj f (f x \<rightarrow> y)) \<le> y

goal (1 subgoal):
 1. f (x \<cdot> radj f (f x \<rightarrow> y)) \<le> y
[PROOF STEP]
by (metis h quantale_homset_iff)
[PROOF STATE]
proof (state)
this:
f (x \<cdot> radj f (f x \<rightarrow> y)) \<le> y

goal (1 subgoal):
 1. f \<in> quantale_homset \<Longrightarrow> radj f (f x \<rightarrow> y) = x \<rightarrow> radj f y
[PROOF STEP]
hence "x \<cdot> radj f (f x \<rightarrow> y) \<le> radj f y"
[PROOF STATE]
proof (prove)
using this:
f (x \<cdot> radj f (f x \<rightarrow> y)) \<le> y

goal (1 subgoal):
 1. x \<cdot> radj f (f x \<rightarrow> y) \<le> radj f y
[PROOF STEP]
using adj_def h quantale_hom_radj
[PROOF STATE]
proof (prove)
using this:
f (x \<cdot> radj f (f x \<rightarrow> y)) \<le> y
?f \<stileturn> ?g = (\<forall>x y. (?f x \<le> y) = (x \<le> ?g y))
f \<in> quantale_homset
?f \<in> quantale_homset \<Longrightarrow> ?f \<stileturn> radj ?f

goal (1 subgoal):
 1. x \<cdot> radj f (f x \<rightarrow> y) \<le> radj f y
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<cdot> radj f (f x \<rightarrow> y) \<le> radj f y

goal (1 subgoal):
 1. f \<in> quantale_homset \<Longrightarrow> radj f (f x \<rightarrow> y) = x \<rightarrow> radj f y
[PROOF STEP]
hence le: "radj f (f x \<rightarrow> y) \<le> x \<rightarrow> radj f y"
[PROOF STATE]
proof (prove)
using this:
x \<cdot> radj f (f x \<rightarrow> y) \<le> radj f y

goal (1 subgoal):
 1. radj f (f x \<rightarrow> y) \<le> x \<rightarrow> radj f y
[PROOF STEP]
by (simp add: bres_galois)
[PROOF STATE]
proof (state)
this:
radj f (f x \<rightarrow> y) \<le> x \<rightarrow> radj f y

goal (1 subgoal):
 1. f \<in> quantale_homset \<Longrightarrow> radj f (f x \<rightarrow> y) = x \<rightarrow> radj f y
[PROOF STEP]
have "x \<cdot> (x \<rightarrow> radj f y) \<le> radj f y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<cdot> (x \<rightarrow> radj f y) \<le> radj f y
[PROOF STEP]
by (simp add: bres_canc1)
[PROOF STATE]
proof (state)
this:
x \<cdot> (x \<rightarrow> radj f y) \<le> radj f y

goal (1 subgoal):
 1. f \<in> quantale_homset \<Longrightarrow> radj f (f x \<rightarrow> y) = x \<rightarrow> radj f y
[PROOF STEP]
hence  "f (x \<cdot> (x \<rightarrow> radj f y)) \<le> y"
[PROOF STATE]
proof (prove)
using this:
x \<cdot> (x \<rightarrow> radj f y) \<le> radj f y

goal (1 subgoal):
 1. f (x \<cdot> (x \<rightarrow> radj f y)) \<le> y
[PROOF STEP]
using adj_def h quantale_hom_radj
[PROOF STATE]
proof (prove)
using this:
x \<cdot> (x \<rightarrow> radj f y) \<le> radj f y
?f \<stileturn> ?g = (\<forall>x y. (?f x \<le> y) = (x \<le> ?g y))
f \<in> quantale_homset
?f \<in> quantale_homset \<Longrightarrow> ?f \<stileturn> radj ?f

goal (1 subgoal):
 1. f (x \<cdot> (x \<rightarrow> radj f y)) \<le> y
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f (x \<cdot> (x \<rightarrow> radj f y)) \<le> y

goal (1 subgoal):
 1. f \<in> quantale_homset \<Longrightarrow> radj f (f x \<rightarrow> y) = x \<rightarrow> radj f y
[PROOF STEP]
hence "f x \<cdot> f (x \<rightarrow> radj f y) \<le> y"
[PROOF STATE]
proof (prove)
using this:
f (x \<cdot> (x \<rightarrow> radj f y)) \<le> y

goal (1 subgoal):
 1. f x \<cdot> f (x \<rightarrow> radj f y) \<le> y
[PROOF STEP]
by (metis h quantale_homset_iff)
[PROOF STATE]
proof (state)
this:
f x \<cdot> f (x \<rightarrow> radj f y) \<le> y

goal (1 subgoal):
 1. f \<in> quantale_homset \<Longrightarrow> radj f (f x \<rightarrow> y) = x \<rightarrow> radj f y
[PROOF STEP]
hence "f (x \<rightarrow> radj f y) \<le> f x \<rightarrow> y"
[PROOF STATE]
proof (prove)
using this:
f x \<cdot> f (x \<rightarrow> radj f y) \<le> y

goal (1 subgoal):
 1. f (x \<rightarrow> radj f y) \<le> f x \<rightarrow> y
[PROOF STEP]
by (simp add: bres_galois)
[PROOF STATE]
proof (state)
this:
f (x \<rightarrow> radj f y) \<le> f x \<rightarrow> y

goal (1 subgoal):
 1. f \<in> quantale_homset \<Longrightarrow> radj f (f x \<rightarrow> y) = x \<rightarrow> radj f y
[PROOF STEP]
hence "x \<rightarrow> radj f y \<le> radj f (f x \<rightarrow> y)"
[PROOF STATE]
proof (prove)
using this:
f (x \<rightarrow> radj f y) \<le> f x \<rightarrow> y

goal (1 subgoal):
 1. x \<rightarrow> radj f y \<le> radj f (f x \<rightarrow> y)
[PROOF STEP]
using adj_def h quantale_hom_radj
[PROOF STATE]
proof (prove)
using this:
f (x \<rightarrow> radj f y) \<le> f x \<rightarrow> y
?f \<stileturn> ?g = (\<forall>x y. (?f x \<le> y) = (x \<le> ?g y))
f \<in> quantale_homset
?f \<in> quantale_homset \<Longrightarrow> ?f \<stileturn> radj ?f

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

goal (1 subgoal):
 1. f \<in> quantale_homset \<Longrightarrow> radj f (f x \<rightarrow> y) = x \<rightarrow> radj f y
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<rightarrow> radj f y \<le> radj f (f x \<rightarrow> y)

goal (1 subgoal):
 1. radj f (f x \<rightarrow> y) = x \<rightarrow> radj f y
[PROOF STEP]
by (simp add: dual_order.antisym le)
[PROOF STATE]
proof (state)
this:
radj f (f x \<rightarrow> y) = x \<rightarrow> radj f y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inverse_rat [simp]: "inverse (Fract a b) = Fract b a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse (Fract a b) = Fract b a
[PROOF STEP]
by transfer simp


[STATEMENT]
lemma subspace_null_space:
  fixes A::"'a::{field}^'n^'m"
  shows "vec.subspace (null_space A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec.subspace (null_space A)
[PROOF STEP]
by (auto simp: vec.subspace_def null_space_def vec.scale vec.add)


[STATEMENT]
lemma aezfun_left_minus [simp] :
  fixes a :: "('a::group_add, 'b) aezfun"
  shows "- a + a = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - a + a = 0
[PROOF STEP]
by    transfer simp


[STATEMENT]
lemma Infinitesimal_ratio:
  "y \<noteq> 0 \<Longrightarrow> y \<in> Infinitesimal \<Longrightarrow> x / y \<in> HFinite \<Longrightarrow> x \<in> Infinitesimal"
  for x y :: "'a::{real_normed_div_algebra,field} star"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>y \<noteq> 0; y \<in> Infinitesimal; x / y \<in> HFinite\<rbrakk> \<Longrightarrow> x \<in> Infinitesimal
[PROOF STEP]
using Infinitesimal_HFinite_mult
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> Infinitesimal; ?y \<in> HFinite\<rbrakk> \<Longrightarrow> ?x * ?y \<in> Infinitesimal

goal (1 subgoal):
 1. \<lbrakk>y \<noteq> 0; y \<in> Infinitesimal; x / y \<in> HFinite\<rbrakk> \<Longrightarrow> x \<in> Infinitesimal
[PROOF STEP]
by fastforce


[STATEMENT]
lemma aff_dim_affine_Int_hyperplane:
  fixes a :: "'a::euclidean_space"
  assumes "affine S"
    shows "aff_dim(S \<inter> {x. a \<bullet> x = b}) =
             (if S \<inter> {v. a \<bullet> v = b} = {} then - 1
              else if S \<subseteq> {v. a \<bullet> v = b} then aff_dim S
              else aff_dim S - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aff_dim (S \<inter> {x. a \<bullet> x = b}) = (if S \<inter> {v. a \<bullet> v = b} = {} then - 1 else if S \<subseteq> {v. a \<bullet> v = b} then aff_dim S else aff_dim S - 1)
[PROOF STEP]
proof (cases "a = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a = (0::'a) \<Longrightarrow> aff_dim (S \<inter> {x. a \<bullet> x = b}) = (if S \<inter> {v. a \<bullet> v = b} = {} then - 1 else if S \<subseteq> {v. a \<bullet> v = b} then aff_dim S else aff_dim S - 1)
 2. a \<noteq> (0::'a) \<Longrightarrow> aff_dim (S \<inter> {x. a \<bullet> x = b}) = (if S \<inter> {v. a \<bullet> v = b} = {} then - 1 else if S \<subseteq> {v. a \<bullet> v = b} then aff_dim S else aff_dim S - 1)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
a = (0::'a)

goal (2 subgoals):
 1. a = (0::'a) \<Longrightarrow> aff_dim (S \<inter> {x. a \<bullet> x = b}) = (if S \<inter> {v. a \<bullet> v = b} = {} then - 1 else if S \<subseteq> {v. a \<bullet> v = b} then aff_dim S else aff_dim S - 1)
 2. a \<noteq> (0::'a) \<Longrightarrow> aff_dim (S \<inter> {x. a \<bullet> x = b}) = (if S \<inter> {v. a \<bullet> v = b} = {} then - 1 else if S \<subseteq> {v. a \<bullet> v = b} then aff_dim S else aff_dim S - 1)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
affine S
a = (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
affine S
a = (0::'a)

goal (1 subgoal):
 1. aff_dim (S \<inter> {x. a \<bullet> x = b}) = (if S \<inter> {v. a \<bullet> v = b} = {} then - 1 else if S \<subseteq> {v. a \<bullet> v = b} then aff_dim S else aff_dim S - 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
aff_dim (S \<inter> {x. a \<bullet> x = b}) = (if S \<inter> {v. a \<bullet> v = b} = {} then - 1 else if S \<subseteq> {v. a \<bullet> v = b} then aff_dim S else aff_dim S - 1)

goal (1 subgoal):
 1. a \<noteq> (0::'a) \<Longrightarrow> aff_dim (S \<inter> {x. a \<bullet> x = b}) = (if S \<inter> {v. a \<bullet> v = b} = {} then - 1 else if S \<subseteq> {v. a \<bullet> v = b} then aff_dim S else aff_dim S - 1)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<noteq> (0::'a) \<Longrightarrow> aff_dim (S \<inter> {x. a \<bullet> x = b}) = (if S \<inter> {v. a \<bullet> v = b} = {} then - 1 else if S \<subseteq> {v. a \<bullet> v = b} then aff_dim S else aff_dim S - 1)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
a \<noteq> (0::'a)

goal (1 subgoal):
 1. a \<noteq> (0::'a) \<Longrightarrow> aff_dim (S \<inter> {x. a \<bullet> x = b}) = (if S \<inter> {v. a \<bullet> v = b} = {} then - 1 else if S \<subseteq> {v. a \<bullet> v = b} then aff_dim S else aff_dim S - 1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<noteq> (0::'a)
[PROOF STEP]
have "aff_dim (S \<inter> {x. a \<bullet> x = b}) = aff_dim S - 1"
            if "x \<in> S" "a \<bullet> x \<noteq> b" and non: "S \<inter> {v. a \<bullet> v = b} \<noteq> {}" for x
[PROOF STATE]
proof (prove)
using this:
a \<noteq> (0::'a)

goal (1 subgoal):
 1. aff_dim (S \<inter> {x. a \<bullet> x = b}) = aff_dim S - 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<noteq> (0::'a) \<Longrightarrow> aff_dim (S \<inter> {x. a \<bullet> x = b}) = aff_dim S - 1
[PROOF STEP]
have [simp]: "{x + y| x y. x \<in> S \<and> a \<bullet> y = b} = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x + y |x y. x \<in> S \<and> a \<bullet> y = b} = UNIV
[PROOF STEP]
using affine_hyperplane_sums_eq_UNIV [OF assms non] that
[PROOF STATE]
proof (prove)
using this:
S - {v. a \<bullet> v = b} \<noteq> {} \<Longrightarrow> {x + y |x y. x \<in> S \<and> a \<bullet> y = b} = UNIV
x \<in> S
a \<bullet> x \<noteq> b
S \<inter> {v. a \<bullet> v = b} \<noteq> {}

goal (1 subgoal):
 1. {x + y |x y. x \<in> S \<and> a \<bullet> y = b} = UNIV
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
{x + y |x y. x \<in> S \<and> a \<bullet> y = b} = UNIV

goal (1 subgoal):
 1. a \<noteq> (0::'a) \<Longrightarrow> aff_dim (S \<inter> {x. a \<bullet> x = b}) = aff_dim S - 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aff_dim (S \<inter> {x. a \<bullet> x = b}) = aff_dim S - 1
[PROOF STEP]
using aff_dim_sums_Int [OF assms affine_hyperplane non]
[PROOF STATE]
proof (prove)
using this:
aff_dim {x + y |x y. x \<in> S \<and> y \<in> {v. a \<bullet> v = b}} = aff_dim S + aff_dim {v. a \<bullet> v = b} - aff_dim (S \<inter> {v. a \<bullet> v = b})

goal (1 subgoal):
 1. aff_dim (S \<inter> {x. a \<bullet> x = b}) = aff_dim S - 1
[PROOF STEP]
by (simp add: of_nat_diff False)
[PROOF STATE]
proof (state)
this:
aff_dim (S \<inter> {x. a \<bullet> x = b}) = aff_dim S - 1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x \<in> S; a \<bullet> ?x \<noteq> b; S \<inter> {v. a \<bullet> v = b} \<noteq> {}\<rbrakk> \<Longrightarrow> aff_dim (S \<inter> {x. a \<bullet> x = b}) = aff_dim S - 1

goal (1 subgoal):
 1. a \<noteq> (0::'a) \<Longrightarrow> aff_dim (S \<inter> {x. a \<bullet> x = b}) = (if S \<inter> {v. a \<bullet> v = b} = {} then - 1 else if S \<subseteq> {v. a \<bullet> v = b} then aff_dim S else aff_dim S - 1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?x \<in> S; a \<bullet> ?x \<noteq> b; S \<inter> {v. a \<bullet> v = b} \<noteq> {}\<rbrakk> \<Longrightarrow> aff_dim (S \<inter> {x. a \<bullet> x = b}) = aff_dim S - 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> S; a \<bullet> ?x \<noteq> b; S \<inter> {v. a \<bullet> v = b} \<noteq> {}\<rbrakk> \<Longrightarrow> aff_dim (S \<inter> {x. a \<bullet> x = b}) = aff_dim S - 1

goal (1 subgoal):
 1. aff_dim (S \<inter> {x. a \<bullet> x = b}) = (if S \<inter> {v. a \<bullet> v = b} = {} then - 1 else if S \<subseteq> {v. a \<bullet> v = b} then aff_dim S else aff_dim S - 1)
[PROOF STEP]
by (metis (mono_tags, lifting) inf.orderE aff_dim_empty_eq mem_Collect_eq subsetI)
[PROOF STATE]
proof (state)
this:
aff_dim (S \<inter> {x. a \<bullet> x = b}) = (if S \<inter> {v. a \<bullet> v = b} = {} then - 1 else if S \<subseteq> {v. a \<bullet> v = b} then aff_dim S else aff_dim S - 1)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_sel'_1_if_notfin1: "\<not>finite X \<Longrightarrow> set_sel' f X Y = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite X \<Longrightarrow> set_sel' f X Y = 1
[PROOF STEP]
unfolding set_sel'_def set_sel_aux'_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite X \<Longrightarrow> (\<Prod>y\<in>Y. \<Prod>x\<in>X. f x y) = 1
[PROOF STEP]
by simp


[STATEMENT]
lemma eval_fds_newman_conv_infsetsum:
  assumes s: "Re s > 1"
  shows   "eval_fds fds_newman s = (\<Sum>\<^sub>ap | prime p. (ln (real p) / real p) * hurwitz_zeta p s)"
          "(\<lambda>p. ln (real p) / real p * hurwitz_zeta p s) abs_summable_on {p. prime p}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_fds fds_newman s = (\<Sum>\<^sub>ap | prime p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s) &&& (\<lambda>p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s) abs_summable_on {p. prime p}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. eval_fds fds_newman s = (\<Sum>\<^sub>ap | prime p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s)
 2. (\<lambda>p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s) abs_summable_on {p. prime p}
[PROOF STEP]
from s
[PROOF STATE]
proof (chain)
picking this:
1 < Re s
[PROOF STEP]
have conv: "fds_abs_converges fds_newman s"
[PROOF STATE]
proof (prove)
using this:
1 < Re s

goal (1 subgoal):
 1. fds_abs_converges fds_newman s
[PROOF STEP]
by (intro fds_abs_converges le_less_trans[OF abs_conv_abscissa_newman]) auto
[PROOF STATE]
proof (state)
this:
fds_abs_converges fds_newman s

goal (2 subgoals):
 1. eval_fds fds_newman s = (\<Sum>\<^sub>ap | prime p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s)
 2. (\<lambda>p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s) abs_summable_on {p. prime p}
[PROOF STEP]
define f where "f = (\<lambda>n p. ln (real p) / real p / of_nat n powr s)"
[PROOF STATE]
proof (state)
this:
f = (\<lambda>n p. complex_of_real (ln (real p) / real p) / of_nat n powr s)

goal (2 subgoals):
 1. eval_fds fds_newman s = (\<Sum>\<^sub>ap | prime p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s)
 2. (\<lambda>p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s) abs_summable_on {p. prime p}
[PROOF STEP]
have eq: "(\<Sum>\<^sub>an\<in>{p..}. f n p) = ln (real p) / real p * hurwitz_zeta p s" if "prime p" for p
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sub>an\<in>{p..}. f n p) = complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>\<^sub>an\<in>{p..}. f n p) = complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s
[PROOF STEP]
have "(\<Sum>\<^sub>an\<in>{p..}. f n p) = (\<Sum>\<^sub>ax\<in>{p..}. (ln (real p) / of_nat p) * (1 / of_nat x powr s))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sub>an\<in>{p..}. f n p) = (\<Sum>\<^sub>ax\<in>{p..}. complex_of_real (ln (real p) / real p) * (1 / of_nat x powr s))
[PROOF STEP]
by (simp add: f_def)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sub>an\<in>{p..}. f n p) = (\<Sum>\<^sub>ax\<in>{p..}. complex_of_real (ln (real p) / real p) * (1 / of_nat x powr s))

goal (1 subgoal):
 1. (\<Sum>\<^sub>an\<in>{p..}. f n p) = complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sub>an\<in>{p..}. f n p) = (\<Sum>\<^sub>ax\<in>{p..}. complex_of_real (ln (real p) / real p) * (1 / of_nat x powr s))

goal (1 subgoal):
 1. (\<Sum>\<^sub>an\<in>{p..}. f n p) = complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s
[PROOF STEP]
have "\<dots> = (ln (real p) / of_nat p) * (\<Sum>\<^sub>ax\<in>{p..}. 1 / of_nat x powr s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sub>ax\<in>{p..}. complex_of_real (ln (real p) / real p) * (1 / of_nat x powr s)) = complex_of_real (ln (real p) / real p) * (\<Sum>\<^sub>ax\<in>{p..}. 1 / of_nat x powr s)
[PROOF STEP]
using abs_summable_hurwitz_zeta[of s 0 p] that s
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>1 < Re s; 0 < 0 + real p\<rbrakk> \<Longrightarrow> (\<lambda>n. 1 / complex_of_real (real n + 0) powr s) abs_summable_on {p..}
prime p
1 < Re s

goal (1 subgoal):
 1. (\<Sum>\<^sub>ax\<in>{p..}. complex_of_real (ln (real p) / real p) * (1 / of_nat x powr s)) = complex_of_real (ln (real p) / real p) * (\<Sum>\<^sub>ax\<in>{p..}. 1 / of_nat x powr s)
[PROOF STEP]
by (intro infsetsum_cmult_right) (auto dest: prime_gt_0_nat)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sub>ax\<in>{p..}. complex_of_real (ln (real p) / real p) * (1 / of_nat x powr s)) = complex_of_real (ln (real p) / real p) * (\<Sum>\<^sub>ax\<in>{p..}. 1 / of_nat x powr s)

goal (1 subgoal):
 1. (\<Sum>\<^sub>an\<in>{p..}. f n p) = complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sub>ax\<in>{p..}. complex_of_real (ln (real p) / real p) * (1 / of_nat x powr s)) = complex_of_real (ln (real p) / real p) * (\<Sum>\<^sub>ax\<in>{p..}. 1 / of_nat x powr s)

goal (1 subgoal):
 1. (\<Sum>\<^sub>an\<in>{p..}. f n p) = complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s
[PROOF STEP]
have "(\<Sum>\<^sub>ax\<in>{p..}. 1 / of_nat x powr s) = hurwitz_zeta p s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sub>ax\<in>{p..}. 1 / of_nat x powr s) = hurwitz_zeta (real p) s
[PROOF STEP]
using s that
[PROOF STATE]
proof (prove)
using this:
1 < Re s
prime p

goal (1 subgoal):
 1. (\<Sum>\<^sub>ax\<in>{p..}. 1 / of_nat x powr s) = hurwitz_zeta (real p) s
[PROOF STEP]
by (subst hurwitz_zeta_nat_conv_infsetsum(2))
                      (auto dest: prime_gt_0_nat simp: field_simps powr_minus)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sub>ax\<in>{p..}. 1 / of_nat x powr s) = hurwitz_zeta (real p) s

goal (1 subgoal):
 1. (\<Sum>\<^sub>an\<in>{p..}. f n p) = complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>\<^sub>an\<in>{p..}. f n p) = complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>\<^sub>an\<in>{p..}. f n p) = complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s

goal (1 subgoal):
 1. (\<Sum>\<^sub>an\<in>{p..}. f n p) = complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sub>an\<in>{p..}. f n p) = complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
prime ?p \<Longrightarrow> (\<Sum>\<^sub>an\<in>{?p..}. f n ?p) = complex_of_real (ln (real ?p) / real ?p) * hurwitz_zeta (real ?p) s

goal (2 subgoals):
 1. eval_fds fds_newman s = (\<Sum>\<^sub>ap | prime p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s)
 2. (\<lambda>p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s) abs_summable_on {p. prime p}
[PROOF STEP]
have norm_f: "norm (f n p) = ln p / p / n powr Re s" if "prime p" for n p :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (f n p) = ln (real p) / real p / real n powr Re s
[PROOF STEP]
by (auto simp: f_def norm_divide norm_mult norm_powr_real_powr)
[PROOF STATE]
proof (state)
this:
prime ?p \<Longrightarrow> cmod (f ?n ?p) = ln (real ?p) / real ?p / real ?n powr Re s

goal (2 subgoals):
 1. eval_fds fds_newman s = (\<Sum>\<^sub>ap | prime p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s)
 2. (\<lambda>p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s) abs_summable_on {p. prime p}
[PROOF STEP]
from conv
[PROOF STATE]
proof (chain)
picking this:
fds_abs_converges fds_newman s
[PROOF STEP]
have "(\<lambda>n. norm (fds_nth fds_newman n / n powr s)) abs_summable_on UNIV"
[PROOF STATE]
proof (prove)
using this:
fds_abs_converges fds_newman s

goal (1 subgoal):
 1. (\<lambda>n. cmod (fds_nth fds_newman n / of_nat n powr s)) abs_summable_on UNIV
[PROOF STEP]
by (intro abs_summable_on_normI) (simp add: fds_abs_converges_altdef')
[PROOF STATE]
proof (state)
this:
(\<lambda>n. cmod (fds_nth fds_newman n / of_nat n powr s)) abs_summable_on UNIV

goal (2 subgoals):
 1. eval_fds fds_newman s = (\<Sum>\<^sub>ap | prime p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s)
 2. (\<lambda>p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s) abs_summable_on {p. prime p}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>n. cmod (fds_nth fds_newman n / of_nat n powr s)) abs_summable_on UNIV

goal (2 subgoals):
 1. eval_fds fds_newman s = (\<Sum>\<^sub>ap | prime p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s)
 2. (\<lambda>p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s) abs_summable_on {p. prime p}
[PROOF STEP]
have "(\<lambda>n. norm (fds_nth fds_newman n / n powr s)) =
               (\<lambda>n. \<Sum>p | prime p \<and> p \<le> n. norm (f n p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. cmod (fds_nth fds_newman n / of_nat n powr s)) = (\<lambda>n. \<Sum>p | prime p \<and> p \<le> n. cmod (f n p))
[PROOF STEP]
by (auto simp: norm_divide norm_fds_nth_newman sum_divide_distrib primes_M_def
                   prime_sum_upto_def norm_mult norm_f norm_powr_real_powr intro!: sum.cong)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. cmod (fds_nth fds_newman n / of_nat n powr s)) = (\<lambda>n. \<Sum>p | prime p \<and> p \<le> n. cmod (f n p))

goal (2 subgoals):
 1. eval_fds fds_newman s = (\<Sum>\<^sub>ap | prime p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s)
 2. (\<lambda>p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s) abs_summable_on {p. prime p}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. \<Sum>p | prime p \<and> p \<le> n. cmod (f n p)) abs_summable_on UNIV
[PROOF STEP]
have summable1: "(\<lambda>(n,p). f n p) abs_summable_on (SIGMA n:UNIV. {p. prime p \<and> p \<le> n})"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. \<Sum>p | prime p \<and> p \<le> n. cmod (f n p)) abs_summable_on UNIV

goal (1 subgoal):
 1. (\<lambda>(n, p). f n p) abs_summable_on (SIGMA n:UNIV. {p. prime p \<and> p \<le> n})
[PROOF STEP]
using conv
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. \<Sum>p | prime p \<and> p \<le> n. cmod (f n p)) abs_summable_on UNIV
fds_abs_converges fds_newman s

goal (1 subgoal):
 1. (\<lambda>(n, p). f n p) abs_summable_on (SIGMA n:UNIV. {p. prime p \<and> p \<le> n})
[PROOF STEP]
by (subst abs_summable_on_Sigma_iff) auto
[PROOF STATE]
proof (state)
this:
(\<lambda>(n, p). f n p) abs_summable_on (SIGMA n:UNIV. {p. prime p \<and> p \<le> n})

goal (2 subgoals):
 1. eval_fds fds_newman s = (\<Sum>\<^sub>ap | prime p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s)
 2. (\<lambda>p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s) abs_summable_on {p. prime p}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>(n, p). f n p) abs_summable_on (SIGMA n:UNIV. {p. prime p \<and> p \<le> n})

goal (2 subgoals):
 1. eval_fds fds_newman s = (\<Sum>\<^sub>ap | prime p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s)
 2. (\<lambda>p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s) abs_summable_on {p. prime p}
[PROOF STEP]
have "?this \<longleftrightarrow> (\<lambda>(p,n). f n p) abs_summable_on
                         (\<lambda>(n,p). (p,n)) ` (SIGMA n:UNIV. {p. prime p \<and> p \<le> n})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>(n, p). f n p) abs_summable_on (SIGMA n:UNIV. {p. prime p \<and> p \<le> n})) = ((\<lambda>(p, n). f n p) abs_summable_on (\<lambda>(n, p). (p, n)) ` (SIGMA n:UNIV. {p. prime p \<and> p \<le> n}))
[PROOF STEP]
by (subst abs_summable_on_reindex_iff [symmetric]) (auto simp: case_prod_unfold inj_on_def)
[PROOF STATE]
proof (state)
this:
((\<lambda>(n, p). f n p) abs_summable_on (SIGMA n:UNIV. {p. prime p \<and> p \<le> n})) = ((\<lambda>(p, n). f n p) abs_summable_on (\<lambda>(n, p). (p, n)) ` (SIGMA n:UNIV. {p. prime p \<and> p \<le> n}))

goal (2 subgoals):
 1. eval_fds fds_newman s = (\<Sum>\<^sub>ap | prime p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s)
 2. (\<lambda>p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s) abs_summable_on {p. prime p}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<lambda>(n, p). f n p) abs_summable_on (SIGMA n:UNIV. {p. prime p \<and> p \<le> n})) = ((\<lambda>(p, n). f n p) abs_summable_on (\<lambda>(n, p). (p, n)) ` (SIGMA n:UNIV. {p. prime p \<and> p \<le> n}))

goal (2 subgoals):
 1. eval_fds fds_newman s = (\<Sum>\<^sub>ap | prime p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s)
 2. (\<lambda>p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s) abs_summable_on {p. prime p}
[PROOF STEP]
have "(\<lambda>(n,p). (p,n)) ` (SIGMA n:UNIV. {p. prime p \<and> p \<le> n}) =
               (SIGMA p:{p. prime p}. {p..})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>(n, p). (p, n)) ` (SIGMA n:UNIV. {p. prime p \<and> p \<le> n}) = Sigma {p. prime p} atLeast
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>(n, p). (p, n)) ` (SIGMA n:UNIV. {p. prime p \<and> p \<le> n}) = Sigma {p. prime p} atLeast

goal (2 subgoals):
 1. eval_fds fds_newman s = (\<Sum>\<^sub>ap | prime p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s)
 2. (\<lambda>p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s) abs_summable_on {p. prime p}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>a. case a of (p, n) \<Rightarrow> f n p) abs_summable_on Sigma {p. prime p} atLeast
[PROOF STEP]
have summable2: "(\<lambda>(p,n). f n p) abs_summable_on \<dots>"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>a. case a of (p, n) \<Rightarrow> f n p) abs_summable_on Sigma {p. prime p} atLeast

goal (1 subgoal):
 1. (\<lambda>(p, n). f n p) abs_summable_on Sigma {p. prime p} atLeast
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<lambda>(p, n). f n p) abs_summable_on Sigma {p. prime p} atLeast

goal (2 subgoals):
 1. eval_fds fds_newman s = (\<Sum>\<^sub>ap | prime p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s)
 2. (\<lambda>p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s) abs_summable_on {p. prime p}
[PROOF STEP]
from abs_summable_on_Sigma_project1'[OF this]
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>countable {p. prime p}; \<And>x. x \<in> {p. prime p} \<Longrightarrow> countable {x..}\<rbrakk> \<Longrightarrow> (\<lambda>x. \<Sum>\<^sub>ay\<in>{x..}. f y x) abs_summable_on {p. prime p}
[PROOF STEP]
have "(\<lambda>p. \<Sum>\<^sub>an\<in>{p..}. f n p) abs_summable_on {p. prime p}"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>countable {p. prime p}; \<And>x. x \<in> {p. prime p} \<Longrightarrow> countable {x..}\<rbrakk> \<Longrightarrow> (\<lambda>x. \<Sum>\<^sub>ay\<in>{x..}. f y x) abs_summable_on {p. prime p}

goal (1 subgoal):
 1. (\<lambda>p. \<Sum>\<^sub>an\<in>{p..}. f n p) abs_summable_on {p. prime p}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>p. \<Sum>\<^sub>an\<in>{p..}. f n p) abs_summable_on {p. prime p}

goal (2 subgoals):
 1. eval_fds fds_newman s = (\<Sum>\<^sub>ap | prime p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s)
 2. (\<lambda>p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s) abs_summable_on {p. prime p}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>p. \<Sum>\<^sub>an\<in>{p..}. f n p) abs_summable_on {p. prime p}

goal (2 subgoals):
 1. eval_fds fds_newman s = (\<Sum>\<^sub>ap | prime p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s)
 2. (\<lambda>p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s) abs_summable_on {p. prime p}
[PROOF STEP]
have "?this \<longleftrightarrow> (\<lambda>p. ln (real p) / real p * hurwitz_zeta p s) abs_summable_on {p. prime p}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>p. \<Sum>\<^sub>an\<in>{p..}. f n p) abs_summable_on {p. prime p}) = ((\<lambda>p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s) abs_summable_on {p. prime p})
[PROOF STEP]
by (intro abs_summable_on_cong eq) auto
[PROOF STATE]
proof (state)
this:
((\<lambda>p. \<Sum>\<^sub>an\<in>{p..}. f n p) abs_summable_on {p. prime p}) = ((\<lambda>p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s) abs_summable_on {p. prime p})

goal (2 subgoals):
 1. eval_fds fds_newman s = (\<Sum>\<^sub>ap | prime p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s)
 2. (\<lambda>p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s) abs_summable_on {p. prime p}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s) abs_summable_on {p. prime p}
[PROOF STEP]
show \<dots>
[PROOF STATE]
proof (prove)
using this:
(\<lambda>p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s) abs_summable_on {p. prime p}

goal (1 subgoal):
 1. (\<lambda>p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s) abs_summable_on {p. prime p}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<lambda>p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s) abs_summable_on {p. prime p}

goal (1 subgoal):
 1. eval_fds fds_newman s = (\<Sum>\<^sub>ap | prime p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s)
[PROOF STEP]
have "eval_fds fds_newman s =
          (\<Sum>\<^sub>an. \<Sum>p | prime p \<and> p \<le> n. ln (real p) / real p / of_nat n powr s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_fds fds_newman s = (\<Sum>\<^sub>an. \<Sum>p | prime p \<and> p \<le> n. complex_of_real (ln (real p) / real p) / of_nat n powr s)
[PROOF STEP]
using conv
[PROOF STATE]
proof (prove)
using this:
fds_abs_converges fds_newman s

goal (1 subgoal):
 1. eval_fds fds_newman s = (\<Sum>\<^sub>an. \<Sum>p | prime p \<and> p \<le> n. complex_of_real (ln (real p) / real p) / of_nat n powr s)
[PROOF STEP]
by (simp add: eval_fds_altdef fds_nth_newman sum_divide_distrib
                             primes_M_def prime_sum_upto_def)
[PROOF STATE]
proof (state)
this:
eval_fds fds_newman s = (\<Sum>\<^sub>an. \<Sum>p | prime p \<and> p \<le> n. complex_of_real (ln (real p) / real p) / of_nat n powr s)

goal (1 subgoal):
 1. eval_fds fds_newman s = (\<Sum>\<^sub>ap | prime p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
eval_fds fds_newman s = (\<Sum>\<^sub>an. \<Sum>p | prime p \<and> p \<le> n. complex_of_real (ln (real p) / real p) / of_nat n powr s)

goal (1 subgoal):
 1. eval_fds fds_newman s = (\<Sum>\<^sub>ap | prime p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s)
[PROOF STEP]
have "\<dots> = (\<Sum>\<^sub>an. \<Sum>\<^sub>ap | prime p \<and> p \<le> n. f n p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sub>an. \<Sum>p | prime p \<and> p \<le> n. complex_of_real (ln (real p) / real p) / of_nat n powr s) = (\<Sum>\<^sub>an. \<Sum>\<^sub>ap | prime p \<and> p \<le> n. f n p)
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sub>an. \<Sum>p | prime p \<and> p \<le> n. complex_of_real (ln (real p) / real p) / of_nat n powr s) = (\<Sum>\<^sub>an. \<Sum>\<^sub>ap | prime p \<and> p \<le> n. complex_of_real (ln (real p) / real p) / of_nat n powr s)
[PROOF STEP]
by (subst infsetsum_finite) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sub>an. \<Sum>p | prime p \<and> p \<le> n. complex_of_real (ln (real p) / real p) / of_nat n powr s) = (\<Sum>\<^sub>an. \<Sum>\<^sub>ap | prime p \<and> p \<le> n. f n p)

goal (1 subgoal):
 1. eval_fds fds_newman s = (\<Sum>\<^sub>ap | prime p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sub>an. \<Sum>p | prime p \<and> p \<le> n. complex_of_real (ln (real p) / real p) / of_nat n powr s) = (\<Sum>\<^sub>an. \<Sum>\<^sub>ap | prime p \<and> p \<le> n. f n p)

goal (1 subgoal):
 1. eval_fds fds_newman s = (\<Sum>\<^sub>ap | prime p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s)
[PROOF STEP]
have "\<dots> = (\<Sum>\<^sub>a(n, p) \<in> (SIGMA n:UNIV. {p. prime p \<and> p \<le> n}). f n p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sub>an. \<Sum>\<^sub>ap | prime p \<and> p \<le> n. f n p) = (\<Sum>\<^sub>a(n, p)\<in>(SIGMA n:UNIV. {p. prime p \<and> p \<le> n}). f n p)
[PROOF STEP]
using summable1
[PROOF STATE]
proof (prove)
using this:
(\<lambda>(n, p). f n p) abs_summable_on (SIGMA n:UNIV. {p. prime p \<and> p \<le> n})

goal (1 subgoal):
 1. (\<Sum>\<^sub>an. \<Sum>\<^sub>ap | prime p \<and> p \<le> n. f n p) = (\<Sum>\<^sub>a(n, p)\<in>(SIGMA n:UNIV. {p. prime p \<and> p \<le> n}). f n p)
[PROOF STEP]
by (subst infsetsum_Sigma) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sub>an. \<Sum>\<^sub>ap | prime p \<and> p \<le> n. f n p) = (\<Sum>\<^sub>a(n, p)\<in>(SIGMA n:UNIV. {p. prime p \<and> p \<le> n}). f n p)

goal (1 subgoal):
 1. eval_fds fds_newman s = (\<Sum>\<^sub>ap | prime p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sub>an. \<Sum>\<^sub>ap | prime p \<and> p \<le> n. f n p) = (\<Sum>\<^sub>a(n, p)\<in>(SIGMA n:UNIV. {p. prime p \<and> p \<le> n}). f n p)

goal (1 subgoal):
 1. eval_fds fds_newman s = (\<Sum>\<^sub>ap | prime p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s)
[PROOF STEP]
have "\<dots> = (\<Sum>\<^sub>a(p, n) \<in> (\<lambda>(n,p). (p, n)) ` (SIGMA n:UNIV. {p. prime p \<and> p \<le> n}). f n p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sub>a(n, p)\<in>(SIGMA n:UNIV. {p. prime p \<and> p \<le> n}). f n p) = (\<Sum>\<^sub>a(p, n)\<in>(\<lambda>(n, p). (p, n)) ` (SIGMA n:UNIV. {p. prime p \<and> p \<le> n}). f n p)
[PROOF STEP]
by (subst infsetsum_reindex) (auto simp: case_prod_unfold inj_on_def)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sub>a(n, p)\<in>(SIGMA n:UNIV. {p. prime p \<and> p \<le> n}). f n p) = (\<Sum>\<^sub>a(p, n)\<in>(\<lambda>(n, p). (p, n)) ` (SIGMA n:UNIV. {p. prime p \<and> p \<le> n}). f n p)

goal (1 subgoal):
 1. eval_fds fds_newman s = (\<Sum>\<^sub>ap | prime p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sub>a(n, p)\<in>(SIGMA n:UNIV. {p. prime p \<and> p \<le> n}). f n p) = (\<Sum>\<^sub>a(p, n)\<in>(\<lambda>(n, p). (p, n)) ` (SIGMA n:UNIV. {p. prime p \<and> p \<le> n}). f n p)

goal (1 subgoal):
 1. eval_fds fds_newman s = (\<Sum>\<^sub>ap | prime p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s)
[PROOF STEP]
have "(\<lambda>(n,p). (p, n)) ` (SIGMA n:UNIV. {p. prime p \<and> p \<le> n}) =
               (SIGMA p:{p. prime p}. {p..})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>(n, p). (p, n)) ` (SIGMA n:UNIV. {p. prime p \<and> p \<le> n}) = Sigma {p. prime p} atLeast
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>(n, p). (p, n)) ` (SIGMA n:UNIV. {p. prime p \<and> p \<le> n}) = Sigma {p. prime p} atLeast

goal (1 subgoal):
 1. eval_fds fds_newman s = (\<Sum>\<^sub>ap | prime p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>(n, p). (p, n)) ` (SIGMA n:UNIV. {p. prime p \<and> p \<le> n}) = Sigma {p. prime p} atLeast

goal (1 subgoal):
 1. eval_fds fds_newman s = (\<Sum>\<^sub>ap | prime p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s)
[PROOF STEP]
have "(\<Sum>\<^sub>a(p,n)\<in>\<dots>. f n p) = (\<Sum>\<^sub>ap | prime p. \<Sum>\<^sub>an\<in>{p..}. f n p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sub>a(p, n)\<in>Sigma {p. prime p} atLeast. f n p) = (\<Sum>\<^sub>ap | prime p. \<Sum>\<^sub>an\<in>{p..}. f n p)
[PROOF STEP]
using summable2
[PROOF STATE]
proof (prove)
using this:
(\<lambda>(p, n). f n p) abs_summable_on Sigma {p. prime p} atLeast

goal (1 subgoal):
 1. (\<Sum>\<^sub>a(p, n)\<in>Sigma {p. prime p} atLeast. f n p) = (\<Sum>\<^sub>ap | prime p. \<Sum>\<^sub>an\<in>{p..}. f n p)
[PROOF STEP]
by (subst infsetsum_Sigma) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sub>a(p, n)\<in>Sigma {p. prime p} atLeast. f n p) = (\<Sum>\<^sub>ap | prime p. \<Sum>\<^sub>an\<in>{p..}. f n p)

goal (1 subgoal):
 1. eval_fds fds_newman s = (\<Sum>\<^sub>ap | prime p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sub>a(p, n)\<in>Sigma {p. prime p} atLeast. f n p) = (\<Sum>\<^sub>ap | prime p. \<Sum>\<^sub>an\<in>{p..}. f n p)

goal (1 subgoal):
 1. eval_fds fds_newman s = (\<Sum>\<^sub>ap | prime p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s)
[PROOF STEP]
have "(\<Sum>\<^sub>ap | prime p. \<Sum>\<^sub>an\<in>{p..}. f n p) =
               (\<Sum>\<^sub>ap | prime p. ln (real p) / real p * hurwitz_zeta p s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sub>ap | prime p. \<Sum>\<^sub>an\<in>{p..}. f n p) = (\<Sum>\<^sub>ap | prime p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s)
[PROOF STEP]
by (intro infsetsum_cong eq) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sub>ap | prime p. \<Sum>\<^sub>an\<in>{p..}. f n p) = (\<Sum>\<^sub>ap | prime p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s)

goal (1 subgoal):
 1. eval_fds fds_newman s = (\<Sum>\<^sub>ap | prime p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
eval_fds fds_newman s = (\<Sum>\<^sub>ap | prime p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s)
[PROOF STEP]
show "eval_fds fds_newman s =
                  (\<Sum>\<^sub>ap | prime p. (ln (real p) / real p) * hurwitz_zeta p s)"
[PROOF STATE]
proof (prove)
using this:
eval_fds fds_newman s = (\<Sum>\<^sub>ap | prime p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s)

goal (1 subgoal):
 1. eval_fds fds_newman s = (\<Sum>\<^sub>ap | prime p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
eval_fds fds_newman s = (\<Sum>\<^sub>ap | prime p. complex_of_real (ln (real p) / real p) * hurwitz_zeta (real p) s)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma from_bool_eq_if:
  "(from_bool Q = (if P then 1 else 0)) = (P = Q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (from_bool Q = (if P then 1 else 0)) = (P = Q)
[PROOF STEP]
by (cases Q) (simp_all add: from_bool_def)


[STATEMENT]
lemma cbox_image_unit_interval:
  fixes a :: "'a::euclidean_space"
  assumes "cbox a b \<noteq> {}"
    shows "cbox a b =
           (+) a ` (\<lambda>x. \<Sum>k\<in>Basis. ((b \<bullet> k - a \<bullet> k) * (x \<bullet> k)) *\<^sub>R k) ` cbox 0 One"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cbox a b = (+) a ` (\<lambda>x. \<Sum>k\<in>Basis. ((b \<bullet> k - a \<bullet> k) * (x \<bullet> k)) *\<^sub>R k) ` cbox (0::'a) One
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
cbox a b \<noteq> {}

goal (1 subgoal):
 1. cbox a b = (+) a ` (\<lambda>x. \<Sum>k\<in>Basis. ((b \<bullet> k - a \<bullet> k) * (x \<bullet> k)) *\<^sub>R k) ` cbox (0::'a) One
[PROOF STEP]
apply (simp add: box_ne_empty image_stretch_interval cbox_translation [symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i\<in>Basis. a \<bullet> i \<le> b \<bullet> i \<Longrightarrow> cbox a b = cbox a (a + (\<Sum>k\<in>Basis. (b \<bullet> k - a \<bullet> k) *\<^sub>R k))
[PROOF STEP]
apply (simp add: min_def max_def algebra_simps sum_subtractf euclidean_representation)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma open_fbint_altdef: "open = generate_topology {arith_prog_fb a b |a b. b > 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open = generate_topology {arith_prog_fb a b |a b. 0 < b}
[PROOF STEP]
using topological_basis_imp_subbasis[OF topological_basis_fbint]
[PROOF STATE]
proof (prove)
using this:
open = generate_topology {arith_prog_fb a b |a b. 0 < b}

goal (1 subgoal):
 1. open = generate_topology {arith_prog_fb a b |a b. 0 < b}
[PROOF STEP]
.


[STATEMENT]
lemma Sup_insert:
  fixes S :: "real set"
  shows "bounded S \<Longrightarrow> Sup (insert x S) = (if S = {} then x else max x (Sup S))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded S \<Longrightarrow> Sup (insert x S) = (if S = {} then x else max x (Sup S))
[PROOF STEP]
by (auto simp: bounded_imp_bdd_above sup_max cSup_insert_If)


[STATEMENT]
lemma NSDERIVD5:
  "\<lbrakk>NSDERIV f x :> D; u \<approx> hypreal_of_real x\<rbrakk> \<Longrightarrow>
     ( *f* (\<lambda>z. f z - f x)) u \<approx> hypreal_of_real D * (u - hypreal_of_real x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>NSDERIV f x :> D; u \<approx> hypreal_of_real x\<rbrakk> \<Longrightarrow> (*f* (\<lambda>z. f z - f x)) u \<approx> hypreal_of_real D * (u - hypreal_of_real x)
[PROOF STEP]
unfolding NSDERIV_iff2
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>w. w \<noteq> hypreal_of_real x \<and> w \<approx> hypreal_of_real x \<longrightarrow> (*f* (\<lambda>z. (f z - f x) / (z - x))) w \<approx> hypreal_of_real D; u \<approx> hypreal_of_real x\<rbrakk> \<Longrightarrow> (*f* (\<lambda>z. f z - f x)) u \<approx> hypreal_of_real D * (u - hypreal_of_real x)
[PROOF STEP]
apply (case_tac "u = hypreal_of_real x", auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>w. w \<noteq> hypreal_of_real x \<and> w \<approx> hypreal_of_real x \<longrightarrow> ((*f* f) w - hypreal_of_real (f x)) / (w - hypreal_of_real x) \<approx> hypreal_of_real D; u \<approx> hypreal_of_real x; u \<noteq> hypreal_of_real x\<rbrakk> \<Longrightarrow> (*f* f) u - hypreal_of_real (f x) \<approx> hypreal_of_real D * (u - hypreal_of_real x)
[PROOF STEP]
by (metis (mono_tags, lifting) HFinite_star_of Infinitesimal_ratio approx_def approx_minus_iff approx_mult_subst approx_star_of_HFinite approx_sym mult_zero_right right_minus_eq)


[STATEMENT]
lemma Lim_UN1:  "Old_Datatype.Lim (\<lambda>x. \<Union>y. f x y) = (\<Union>y. Old_Datatype.Lim (\<lambda>x. f x y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Old_Datatype.Lim (\<lambda>x. \<Union> (range (f x))) = (\<Union>y. Old_Datatype.Lim (\<lambda>x. f x y))
[PROOF STEP]
by(simp add: Old_Datatype.Lim_def) blast


[STATEMENT]
lemma dist_mult[simp]: "dist (x * y) (x * z) = \<bar>x\<bar> * dist y z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (x * y) (x * z) = \<bar>x\<bar> * dist y z
[PROOF STEP]
unfolding dist_real_def abs_mult[symmetric] right_diff_distrib
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>x * y - x * z\<bar> = \<bar>x * y - x * z\<bar>
[PROOF STEP]
..


[STATEMENT]
lemma gjs_and_take_cols_var:
  fixes A::"'a mat"
  assumes A:"A \<in> carrier_mat n nc"
  assumes order: "nc \<ge> n"
  shows "(take_cols A (map snd (pivot_positions (gauss_jordan_single A)))) =
  (take_cols_var A (map snd (pivot_positions (gauss_jordan_single A))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. take_cols A (map snd (pivot_positions (gauss_jordan_single A))) = take_cols_var A (map snd (pivot_positions (gauss_jordan_single A)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. take_cols A (map snd (pivot_positions (gauss_jordan_single A))) = take_cols_var A (map snd (pivot_positions (gauss_jordan_single A)))
[PROOF STEP]
let ?gjs = "(gauss_jordan_single A)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. take_cols A (map snd (pivot_positions (gauss_jordan_single A))) = take_cols_var A (map snd (pivot_positions (gauss_jordan_single A)))
[PROOF STEP]
have "\<forall>x. List.member (map snd (pivot_positions (gauss_jordan_single A))) x \<longrightarrow> x \<le> dim_col A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. List.member (map snd (pivot_positions (gauss_jordan_single A))) x \<longrightarrow> x \<le> dim_col A
[PROOF STEP]
using rref_pivot_positions gauss_jordan_single(3) carrier_matD(2) gauss_jordan_single(2) in_set_impl_in_set_zip2 in_set_member length_map less_irrefl less_trans not_le_imp_less zip_map_fst_snd
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>row_echelon_form ?R; ?R \<in> carrier_mat ?nr ?nc; (?i, ?j) \<in> set (pivot_positions ?R)\<rbrakk> \<Longrightarrow> ?i < ?nr \<and> ?j < ?nc
\<lbrakk>?A \<in> carrier_mat ?nr ?nc; gauss_jordan_single ?A = ?C\<rbrakk> \<Longrightarrow> row_echelon_form ?C
?A \<in> carrier_mat ?nr ?nc \<Longrightarrow> dim_col ?A = ?nc
\<lbrakk>?A \<in> carrier_mat ?nr ?nc; gauss_jordan_single ?A = ?C\<rbrakk> \<Longrightarrow> ?C \<in> carrier_mat ?nr ?nc
\<lbrakk>length ?xs = length ?ys; ?y \<in> set ?ys; \<And>x. (x, ?y) \<in> set (zip ?xs ?ys) \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
(?x \<in> set ?xs) = List.member ?xs ?x
length (map ?f ?xs) = length ?xs
\<not> ?x < ?x
\<lbrakk>?x < ?y; ?y < ?z\<rbrakk> \<Longrightarrow> ?x < ?z
\<not> ?y \<le> ?x \<Longrightarrow> ?x < ?y
zip (map fst ?zs) (map snd ?zs) = ?zs

goal (1 subgoal):
 1. \<forall>x. List.member (map snd (pivot_positions (gauss_jordan_single A))) x \<longrightarrow> x \<le> dim_col A
[PROOF STEP]
by (smt A carrier_matD(2) gauss_jordan_single(2) in_set_impl_in_set_zip2 in_set_member length_map less_irrefl less_trans not_le_imp_less zip_map_fst_snd)
[PROOF STATE]
proof (state)
this:
\<forall>x. List.member (map snd (pivot_positions (gauss_jordan_single A))) x \<longrightarrow> x \<le> dim_col A

goal (1 subgoal):
 1. take_cols A (map snd (pivot_positions (gauss_jordan_single A))) = take_cols_var A (map snd (pivot_positions (gauss_jordan_single A)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x. List.member (map snd (pivot_positions (gauss_jordan_single A))) x \<longrightarrow> x \<le> dim_col A
[PROOF STEP]
have "(filter (\<lambda>y. y < dim_col A) (map snd (pivot_positions (gauss_jordan_single A)))) =
    (map snd (pivot_positions (gauss_jordan_single A)))"
[PROOF STATE]
proof (prove)
using this:
\<forall>x. List.member (map snd (pivot_positions (gauss_jordan_single A))) x \<longrightarrow> x \<le> dim_col A

goal (1 subgoal):
 1. filter (\<lambda>y. y < dim_col A) (map snd (pivot_positions (gauss_jordan_single A))) = map snd (pivot_positions (gauss_jordan_single A))
[PROOF STEP]
by (metis (no_types, lifting) A carrier_matD(2) filter_True gauss_jordan_single(2) gauss_jordan_single(3) in_set_impl_in_set_zip2 length_map rref_pivot_positions zip_map_fst_snd)
[PROOF STATE]
proof (state)
this:
filter (\<lambda>y. y < dim_col A) (map snd (pivot_positions (gauss_jordan_single A))) = map snd (pivot_positions (gauss_jordan_single A))

goal (1 subgoal):
 1. take_cols A (map snd (pivot_positions (gauss_jordan_single A))) = take_cols_var A (map snd (pivot_positions (gauss_jordan_single A)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
filter (\<lambda>y. y < dim_col A) (map snd (pivot_positions (gauss_jordan_single A))) = map snd (pivot_positions (gauss_jordan_single A))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
filter (\<lambda>y. y < dim_col A) (map snd (pivot_positions (gauss_jordan_single A))) = map snd (pivot_positions (gauss_jordan_single A))

goal (1 subgoal):
 1. take_cols A (map snd (pivot_positions (gauss_jordan_single A))) = take_cols_var A (map snd (pivot_positions (gauss_jordan_single A)))
[PROOF STEP]
unfolding take_cols_def take_cols_var_def
[PROOF STATE]
proof (prove)
using this:
filter (\<lambda>y. y < dim_col A) (map snd (pivot_positions (gauss_jordan_single A))) = map snd (pivot_positions (gauss_jordan_single A))

goal (1 subgoal):
 1. mat_of_cols (dim_row A) (map ((!) (cols A)) (filter (\<lambda>y. y < dim_col A) (map snd (pivot_positions (gauss_jordan_single A))))) = mat_of_cols (dim_row A) (map ((!) (cols A)) (map snd (pivot_positions (gauss_jordan_single A))))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
take_cols A (map snd (pivot_positions (gauss_jordan_single A))) = take_cols_var A (map snd (pivot_positions (gauss_jordan_single A)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem p43: "\<forall>x y. Q(x,y) \<longleftrightarrow> (\<forall>z. F(z,x) \<longleftrightarrow> F(z,y)) \<Longrightarrow>
  \<forall>x y. Q(x,y) \<longleftrightarrow> Q(y,x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. Q (x, y) = (\<forall>z. F (z, x) = F (z, y)) \<Longrightarrow> \<forall>x y. Q (x, y) = Q (y, x)
[PROOF STEP]
by auto2


[STATEMENT]
theorem theorem_2_1_Erdos_Straus :
  "(\<Sum>n. (b n / (\<Prod>i \<le> n. a i))) \<in> \<rat> \<longleftrightarrow> (\<exists> (B::int)>0. \<exists> c::nat\<Rightarrow> int.
            (\<forall>\<^sub>F n in sequentially. B*b n = c n * a n - c(n+1) \<and> \<bar>c(n+1)\<bar><a n/2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<Sum>n. real_of_int (b n) / real_of_int (prod a {..n})) \<in> \<rat>) = (\<exists>B>0. \<exists>c. \<forall>\<^sub>F n in sequentially. B * b n = c n * a n - c (n + 1) \<and> real_of_int \<bar>c (n + 1)\<bar> < real_of_int (a n) / 2)
[PROOF STEP]
using ab_rationality_imp imp_ab_rational
[PROOF STATE]
proof (prove)
using this:
(\<Sum>n. real_of_int (b n) / real_of_int (prod a {..n})) \<in> \<rat> \<Longrightarrow> \<exists>B>0. \<exists>c. (\<forall>\<^sub>F n in sequentially. B * b n = c n * a n - c (n + 1) \<and> real_of_int \<bar>c (n + 1)\<bar> < real_of_int (a n) / 2) \<and> (\<lambda>n. real_of_int (c (Suc n)) / real_of_int (a n)) \<longlonglongrightarrow> 0
\<exists>B>0. \<exists>c. \<forall>\<^sub>F n in sequentially. B * b n = c n * a n - c (n + 1) \<and> real_of_int \<bar>c (n + 1)\<bar> < real_of_int (a n) / 2 \<Longrightarrow> (\<Sum>n. real_of_int (b n) / real_of_int (prod a {..n})) \<in> \<rat>

goal (1 subgoal):
 1. ((\<Sum>n. real_of_int (b n) / real_of_int (prod a {..n})) \<in> \<rat>) = (\<exists>B>0. \<exists>c. \<forall>\<^sub>F n in sequentially. B * b n = c n * a n - c (n + 1) \<and> real_of_int \<bar>c (n + 1)\<bar> < real_of_int (a n) / 2)
[PROOF STEP]
by auto


[STATEMENT]
lemma init_Plus [simp]: "init (Plus fsm1 fsm2) = init fsm1 + init fsm2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. init (Plus fsm1 fsm2) = init fsm1 + init fsm2
[PROOF STEP]
by (simp add: Plus_def)


[STATEMENT]
lemma closed_map_into_subtopology:
    "\<lbrakk>closed_map X X' f; f ` topspace X \<subseteq> S\<rbrakk> \<Longrightarrow> closed_map X (subtopology X' S) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>closed_map X X' f; f ` topspace X \<subseteq> S\<rbrakk> \<Longrightarrow> closed_map X (subtopology X' S) f
[PROOF STEP]
unfolding closed_map_def closedin_subtopology
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>U. closedin X U \<longrightarrow> closedin X' (f ` U); f ` topspace X \<subseteq> S\<rbrakk> \<Longrightarrow> \<forall>U. closedin X U \<longrightarrow> (\<exists>T. closedin X' T \<and> f ` U = T \<inter> S)
[PROOF STEP]
using closedin_subset
[PROOF STATE]
proof (prove)
using this:
closedin ?U ?S \<Longrightarrow> ?S \<subseteq> topspace ?U

goal (1 subgoal):
 1. \<lbrakk>\<forall>U. closedin X U \<longrightarrow> closedin X' (f ` U); f ` topspace X \<subseteq> S\<rbrakk> \<Longrightarrow> \<forall>U. closedin X U \<longrightarrow> (\<exists>T. closedin X' T \<and> f ` U = T \<inter> S)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma SUP_ereal_sum:
  fixes f g :: "'a \<Rightarrow> nat \<Rightarrow> ereal"
  assumes "\<And>n. n \<in> A \<Longrightarrow> incseq (f n)"
    and pos: "\<And>n i. n \<in> A \<Longrightarrow> 0 \<le> f n i"
  shows "(SUP i. \<Sum>n\<in>A. f n i) = (\<Sum>n\<in>A. Sup ((f n) ` UNIV))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SUP i. \<Sum>n\<in>A. f n i) = (\<Sum>n\<in>A. Sup (range (f n)))
[PROOF STEP]
proof (cases "finite A")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite A \<Longrightarrow> (SUP i. \<Sum>n\<in>A. f n i) = (\<Sum>n\<in>A. Sup (range (f n)))
 2. infinite A \<Longrightarrow> (SUP i. \<Sum>n\<in>A. f n i) = (\<Sum>n\<in>A. Sup (range (f n)))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
finite A

goal (2 subgoals):
 1. finite A \<Longrightarrow> (SUP i. \<Sum>n\<in>A. f n i) = (\<Sum>n\<in>A. Sup (range (f n)))
 2. infinite A \<Longrightarrow> (SUP i. \<Sum>n\<in>A. f n i) = (\<Sum>n\<in>A. Sup (range (f n)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite A

goal (1 subgoal):
 1. (SUP i. \<Sum>n\<in>A. f n i) = (\<Sum>n\<in>A. Sup (range (f n)))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A
?n \<in> A \<Longrightarrow> incseq (f ?n)
?n \<in> A \<Longrightarrow> 0 \<le> f ?n ?i

goal (1 subgoal):
 1. (SUP i. \<Sum>n\<in>A. f n i) = (\<Sum>n\<in>A. Sup (range (f n)))
[PROOF STEP]
by induct (auto simp: incseq_sumI2 sum_nonneg SUP_ereal_add_pos)
[PROOF STATE]
proof (state)
this:
(SUP i. \<Sum>n\<in>A. f n i) = (\<Sum>n\<in>A. Sup (range (f n)))

goal (1 subgoal):
 1. infinite A \<Longrightarrow> (SUP i. \<Sum>n\<in>A. f n i) = (\<Sum>n\<in>A. Sup (range (f n)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. infinite A \<Longrightarrow> (SUP i. \<Sum>n\<in>A. f n i) = (\<Sum>n\<in>A. Sup (range (f n)))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
infinite A

goal (1 subgoal):
 1. infinite A \<Longrightarrow> (SUP i. \<Sum>n\<in>A. f n i) = (\<Sum>n\<in>A. Sup (range (f n)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
infinite A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
infinite A

goal (1 subgoal):
 1. (SUP i. \<Sum>n\<in>A. f n i) = (\<Sum>n\<in>A. Sup (range (f n)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(SUP i. \<Sum>n\<in>A. f n i) = (\<Sum>n\<in>A. Sup (range (f n)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_ReZ_segments_imp_jumpFs:
  assumes "finite_ReZ_segments g z" "path g"
  shows "finite_jumpFs (\<lambda>t. Im (g t - z)/Re (g t - z)) 0 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_jumpFs (\<lambda>t. Im (g t - z) / Re (g t - z)) 0 1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite_ReZ_segments g z
path g

goal (1 subgoal):
 1. finite_jumpFs (\<lambda>t. Im (g t - z) / Re (g t - z)) 0 1
[PROOF STEP]
unfolding finite_ReZ_segments_def path_def
[PROOF STATE]
proof (prove)
using this:
finite_Psegments (\<lambda>t. Re (g t - z) = 0) 0 1
continuous_on {0..1} g

goal (1 subgoal):
 1. finite_jumpFs (\<lambda>t. Im (g t - z) / Re (g t - z)) 0 1
[PROOF STEP]
by (rule finite_Psegments_Re_imp_jumpFs)


[STATEMENT]
lemma match_eval_trm: "\<forall>t\<in>set ts. \<forall>i\<in>Formula.fv_trm t. i < n \<Longrightarrow> Some f = match ts xs \<Longrightarrow>
    map (Formula.eval_trm (Table.tabulate (\<lambda>i. the (f i)) 0 n)) ts = xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>t\<in>set ts. \<forall>i\<in>fv_trm t. i < n; Some f = match ts xs\<rbrakk> \<Longrightarrow> map (Formula.eval_trm (tabulate (\<lambda>i. the (f i)) 0 n)) ts = xs
[PROOF STEP]
proof (induction ts xs arbitrary: f rule: match.induct)
[PROOF STATE]
proof (state)
goal (22 subgoals):
 1. \<And>f. \<lbrakk>\<forall>t\<in>set []. \<forall>i\<in>fv_trm t. i < n; Some f = match [] []\<rbrakk> \<Longrightarrow> map (Formula.eval_trm (tabulate (\<lambda>i. the (f i)) 0 n)) [] = []
 2. \<And>x ts y ys f. \<lbrakk>\<And>f. \<lbrakk>x = y; \<forall>t\<in>set ts. \<forall>i\<in>fv_trm t. i < n; Some f = match ts ys\<rbrakk> \<Longrightarrow> map (Formula.eval_trm (tabulate (\<lambda>i. the (f i)) 0 n)) ts = ys; \<forall>t\<in>set (trm.Const x # ts). \<forall>i\<in>fv_trm t. i < n; Some f = match (trm.Const x # ts) (y # ys)\<rbrakk> \<Longrightarrow> map (Formula.eval_trm (tabulate (\<lambda>i. the (f i)) 0 n)) (trm.Const x # ts) = y # ys
 3. \<And>x ts y ys f. \<lbrakk>\<And>f. \<lbrakk>\<forall>t\<in>set ts. \<forall>i\<in>fv_trm t. i < n; Some f = match ts ys\<rbrakk> \<Longrightarrow> map (Formula.eval_trm (tabulate (\<lambda>i. the (f i)) 0 n)) ts = ys; \<forall>t\<in>set (trm.Var x # ts). \<forall>i\<in>fv_trm t. i < n; Some f = match (trm.Var x # ts) (y # ys)\<rbrakk> \<Longrightarrow> map (Formula.eval_trm (tabulate (\<lambda>i. the (f i)) 0 n)) (trm.Var x # ts) = y # ys
 4. \<And>vb va f. \<lbrakk>\<forall>t\<in>set (trm.Var vb # va). \<forall>i\<in>fv_trm t. i < n; Some f = match (trm.Var vb # va) []\<rbrakk> \<Longrightarrow> map (Formula.eval_trm (tabulate (\<lambda>i. the (f i)) 0 n)) (trm.Var vb # va) = []
 5. \<And>vb vc va uv_ f. \<lbrakk>\<forall>t\<in>set (trm.Plus vb vc # va). \<forall>i\<in>fv_trm t. i < n; Some f = match (trm.Plus vb vc # va) uv_\<rbrakk> \<Longrightarrow> map (Formula.eval_trm (tabulate (\<lambda>i. the (f i)) 0 n)) (trm.Plus vb vc # va) = uv_
 6. \<And>vb vc va uv_ f. \<lbrakk>\<forall>t\<in>set (trm.Minus vb vc # va). \<forall>i\<in>fv_trm t. i < n; Some f = match (trm.Minus vb vc # va) uv_\<rbrakk> \<Longrightarrow> map (Formula.eval_trm (tabulate (\<lambda>i. the (f i)) 0 n)) (trm.Minus vb vc # va) = uv_
 7. \<And>vb va uv_ f. \<lbrakk>\<forall>t\<in>set (trm.UMinus vb # va). \<forall>i\<in>fv_trm t. i < n; Some f = match (trm.UMinus vb # va) uv_\<rbrakk> \<Longrightarrow> map (Formula.eval_trm (tabulate (\<lambda>i. the (f i)) 0 n)) (trm.UMinus vb # va) = uv_
 8. \<And>vb vc va uv_ f. \<lbrakk>\<forall>t\<in>set (trm.Mult vb vc # va). \<forall>i\<in>fv_trm t. i < n; Some f = match (trm.Mult vb vc # va) uv_\<rbrakk> \<Longrightarrow> map (Formula.eval_trm (tabulate (\<lambda>i. the (f i)) 0 n)) (trm.Mult vb vc # va) = uv_
 9. \<And>vb vc va uv_ f. \<lbrakk>\<forall>t\<in>set (trm.Div vb vc # va). \<forall>i\<in>fv_trm t. i < n; Some f = match (trm.Div vb vc # va) uv_\<rbrakk> \<Longrightarrow> map (Formula.eval_trm (tabulate (\<lambda>i. the (f i)) 0 n)) (trm.Div vb vc # va) = uv_
 10. \<And>vb vc va uv_ f. \<lbrakk>\<forall>t\<in>set (trm.Mod vb vc # va). \<forall>i\<in>fv_trm t. i < n; Some f = match (trm.Mod vb vc # va) uv_\<rbrakk> \<Longrightarrow> map (Formula.eval_trm (tabulate (\<lambda>i. the (f i)) 0 n)) (trm.Mod vb vc # va) = uv_
A total of 22 subgoals...
[PROOF STEP]
case (3 x ts y ys)
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<forall>t\<in>set ts. \<forall>i\<in>fv_trm t. i < n; Some ?f = match ts ys\<rbrakk> \<Longrightarrow> map (Formula.eval_trm (tabulate (\<lambda>i. the (?f i)) 0 n)) ts = ys
\<forall>t\<in>set (trm.Var x # ts). \<forall>i\<in>fv_trm t. i < n
Some f = match (trm.Var x # ts) (y # ys)

goal (22 subgoals):
 1. \<And>f. \<lbrakk>\<forall>t\<in>set []. \<forall>i\<in>fv_trm t. i < n; Some f = match [] []\<rbrakk> \<Longrightarrow> map (Formula.eval_trm (tabulate (\<lambda>i. the (f i)) 0 n)) [] = []
 2. \<And>x ts y ys f. \<lbrakk>\<And>f. \<lbrakk>x = y; \<forall>t\<in>set ts. \<forall>i\<in>fv_trm t. i < n; Some f = match ts ys\<rbrakk> \<Longrightarrow> map (Formula.eval_trm (tabulate (\<lambda>i. the (f i)) 0 n)) ts = ys; \<forall>t\<in>set (trm.Const x # ts). \<forall>i\<in>fv_trm t. i < n; Some f = match (trm.Const x # ts) (y # ys)\<rbrakk> \<Longrightarrow> map (Formula.eval_trm (tabulate (\<lambda>i. the (f i)) 0 n)) (trm.Const x # ts) = y # ys
 3. \<And>x ts y ys f. \<lbrakk>\<And>f. \<lbrakk>\<forall>t\<in>set ts. \<forall>i\<in>fv_trm t. i < n; Some f = match ts ys\<rbrakk> \<Longrightarrow> map (Formula.eval_trm (tabulate (\<lambda>i. the (f i)) 0 n)) ts = ys; \<forall>t\<in>set (trm.Var x # ts). \<forall>i\<in>fv_trm t. i < n; Some f = match (trm.Var x # ts) (y # ys)\<rbrakk> \<Longrightarrow> map (Formula.eval_trm (tabulate (\<lambda>i. the (f i)) 0 n)) (trm.Var x # ts) = y # ys
 4. \<And>vb va f. \<lbrakk>\<forall>t\<in>set (trm.Var vb # va). \<forall>i\<in>fv_trm t. i < n; Some f = match (trm.Var vb # va) []\<rbrakk> \<Longrightarrow> map (Formula.eval_trm (tabulate (\<lambda>i. the (f i)) 0 n)) (trm.Var vb # va) = []
 5. \<And>vb vc va uv_ f. \<lbrakk>\<forall>t\<in>set (trm.Plus vb vc # va). \<forall>i\<in>fv_trm t. i < n; Some f = match (trm.Plus vb vc # va) uv_\<rbrakk> \<Longrightarrow> map (Formula.eval_trm (tabulate (\<lambda>i. the (f i)) 0 n)) (trm.Plus vb vc # va) = uv_
 6. \<And>vb vc va uv_ f. \<lbrakk>\<forall>t\<in>set (trm.Minus vb vc # va). \<forall>i\<in>fv_trm t. i < n; Some f = match (trm.Minus vb vc # va) uv_\<rbrakk> \<Longrightarrow> map (Formula.eval_trm (tabulate (\<lambda>i. the (f i)) 0 n)) (trm.Minus vb vc # va) = uv_
 7. \<And>vb va uv_ f. \<lbrakk>\<forall>t\<in>set (trm.UMinus vb # va). \<forall>i\<in>fv_trm t. i < n; Some f = match (trm.UMinus vb # va) uv_\<rbrakk> \<Longrightarrow> map (Formula.eval_trm (tabulate (\<lambda>i. the (f i)) 0 n)) (trm.UMinus vb # va) = uv_
 8. \<And>vb vc va uv_ f. \<lbrakk>\<forall>t\<in>set (trm.Mult vb vc # va). \<forall>i\<in>fv_trm t. i < n; Some f = match (trm.Mult vb vc # va) uv_\<rbrakk> \<Longrightarrow> map (Formula.eval_trm (tabulate (\<lambda>i. the (f i)) 0 n)) (trm.Mult vb vc # va) = uv_
 9. \<And>vb vc va uv_ f. \<lbrakk>\<forall>t\<in>set (trm.Div vb vc # va). \<forall>i\<in>fv_trm t. i < n; Some f = match (trm.Div vb vc # va) uv_\<rbrakk> \<Longrightarrow> map (Formula.eval_trm (tabulate (\<lambda>i. the (f i)) 0 n)) (trm.Div vb vc # va) = uv_
 10. \<And>vb vc va uv_ f. \<lbrakk>\<forall>t\<in>set (trm.Mod vb vc # va). \<forall>i\<in>fv_trm t. i < n; Some f = match (trm.Mod vb vc # va) uv_\<rbrakk> \<Longrightarrow> map (Formula.eval_trm (tabulate (\<lambda>i. the (f i)) 0 n)) (trm.Mod vb vc # va) = uv_
A total of 22 subgoals...
[PROOF STEP]
from 3(1)[symmetric] 3(2,3)
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>\<forall>t\<in>set ts. \<forall>i\<in>fv_trm t. i < n; Some ?f = match ts ys\<rbrakk> \<Longrightarrow> ys = map (Formula.eval_trm (tabulate (\<lambda>i. the (?f i)) 0 n)) ts
\<forall>t\<in>set (trm.Var x # ts). \<forall>i\<in>fv_trm t. i < n
Some f = match (trm.Var x # ts) (y # ys)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<forall>t\<in>set ts. \<forall>i\<in>fv_trm t. i < n; Some ?f = match ts ys\<rbrakk> \<Longrightarrow> ys = map (Formula.eval_trm (tabulate (\<lambda>i. the (?f i)) 0 n)) ts
\<forall>t\<in>set (trm.Var x # ts). \<forall>i\<in>fv_trm t. i < n
Some f = match (trm.Var x # ts) (y # ys)

goal (1 subgoal):
 1. map (Formula.eval_trm (tabulate (\<lambda>i. the (f i)) 0 n)) (trm.Var x # ts) = y # ys
[PROOF STEP]
by (auto 0 3 dest: match_fvi_trm_Some sym split: option.splits if_splits intro!: eval_trm_fv_cong)
[PROOF STATE]
proof (state)
this:
map (Formula.eval_trm (tabulate (\<lambda>i. the (f i)) 0 n)) (trm.Var x # ts) = y # ys

goal (21 subgoals):
 1. \<And>f. \<lbrakk>\<forall>t\<in>set []. \<forall>i\<in>fv_trm t. i < n; Some f = match [] []\<rbrakk> \<Longrightarrow> map (Formula.eval_trm (tabulate (\<lambda>i. the (f i)) 0 n)) [] = []
 2. \<And>x ts y ys f. \<lbrakk>\<And>f. \<lbrakk>x = y; \<forall>t\<in>set ts. \<forall>i\<in>fv_trm t. i < n; Some f = match ts ys\<rbrakk> \<Longrightarrow> map (Formula.eval_trm (tabulate (\<lambda>i. the (f i)) 0 n)) ts = ys; \<forall>t\<in>set (trm.Const x # ts). \<forall>i\<in>fv_trm t. i < n; Some f = match (trm.Const x # ts) (y # ys)\<rbrakk> \<Longrightarrow> map (Formula.eval_trm (tabulate (\<lambda>i. the (f i)) 0 n)) (trm.Const x # ts) = y # ys
 3. \<And>vb va f. \<lbrakk>\<forall>t\<in>set (trm.Var vb # va). \<forall>i\<in>fv_trm t. i < n; Some f = match (trm.Var vb # va) []\<rbrakk> \<Longrightarrow> map (Formula.eval_trm (tabulate (\<lambda>i. the (f i)) 0 n)) (trm.Var vb # va) = []
 4. \<And>vb vc va uv_ f. \<lbrakk>\<forall>t\<in>set (trm.Plus vb vc # va). \<forall>i\<in>fv_trm t. i < n; Some f = match (trm.Plus vb vc # va) uv_\<rbrakk> \<Longrightarrow> map (Formula.eval_trm (tabulate (\<lambda>i. the (f i)) 0 n)) (trm.Plus vb vc # va) = uv_
 5. \<And>vb vc va uv_ f. \<lbrakk>\<forall>t\<in>set (trm.Minus vb vc # va). \<forall>i\<in>fv_trm t. i < n; Some f = match (trm.Minus vb vc # va) uv_\<rbrakk> \<Longrightarrow> map (Formula.eval_trm (tabulate (\<lambda>i. the (f i)) 0 n)) (trm.Minus vb vc # va) = uv_
 6. \<And>vb va uv_ f. \<lbrakk>\<forall>t\<in>set (trm.UMinus vb # va). \<forall>i\<in>fv_trm t. i < n; Some f = match (trm.UMinus vb # va) uv_\<rbrakk> \<Longrightarrow> map (Formula.eval_trm (tabulate (\<lambda>i. the (f i)) 0 n)) (trm.UMinus vb # va) = uv_
 7. \<And>vb vc va uv_ f. \<lbrakk>\<forall>t\<in>set (trm.Mult vb vc # va). \<forall>i\<in>fv_trm t. i < n; Some f = match (trm.Mult vb vc # va) uv_\<rbrakk> \<Longrightarrow> map (Formula.eval_trm (tabulate (\<lambda>i. the (f i)) 0 n)) (trm.Mult vb vc # va) = uv_
 8. \<And>vb vc va uv_ f. \<lbrakk>\<forall>t\<in>set (trm.Div vb vc # va). \<forall>i\<in>fv_trm t. i < n; Some f = match (trm.Div vb vc # va) uv_\<rbrakk> \<Longrightarrow> map (Formula.eval_trm (tabulate (\<lambda>i. the (f i)) 0 n)) (trm.Div vb vc # va) = uv_
 9. \<And>vb vc va uv_ f. \<lbrakk>\<forall>t\<in>set (trm.Mod vb vc # va). \<forall>i\<in>fv_trm t. i < n; Some f = match (trm.Mod vb vc # va) uv_\<rbrakk> \<Longrightarrow> map (Formula.eval_trm (tabulate (\<lambda>i. the (f i)) 0 n)) (trm.Mod vb vc # va) = uv_
 10. \<And>vb va uv_ f. \<lbrakk>\<forall>t\<in>set (trm.F2i vb # va). \<forall>i\<in>fv_trm t. i < n; Some f = match (trm.F2i vb # va) uv_\<rbrakk> \<Longrightarrow> map (Formula.eval_trm (tabulate (\<lambda>i. the (f i)) 0 n)) (trm.F2i vb # va) = uv_
A total of 21 subgoals...
[PROOF STEP]
qed (auto split: if_splits)


[STATEMENT]
lemma eint_minus_plus':
"a - (eint b + eint c) = a - eint c - eint b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a - (eint b + eint c) = a - eint c - eint b
[PROOF STEP]
by (metis add.commute eint_minus_plus)


[STATEMENT]
lemma iMODb_iMOD_subset: "
  \<lbrakk> r \<le> r'; r' mod m = r mod m; m' mod m = 0 \<rbrakk> \<Longrightarrow> [r', mod m', c'] \<subseteq> [r, mod m]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>r \<le> r'; r' mod m = r mod m; m' mod m = 0\<rbrakk> \<Longrightarrow> [ r', mod m', c' ] \<subseteq> [ r, mod m ]
[PROOF STEP]
apply (case_tac "c' = 0")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>r \<le> r'; r' mod m = r mod m; m' mod m = 0; c' = 0\<rbrakk> \<Longrightarrow> [ r', mod m', c' ] \<subseteq> [ r, mod m ]
 2. \<lbrakk>r \<le> r'; r' mod m = r mod m; m' mod m = 0; c' \<noteq> 0\<rbrakk> \<Longrightarrow> [ r', mod m', c' ] \<subseteq> [ r, mod m ]
[PROOF STEP]
apply (simp add: iMODb_0 iIN_0 iMOD_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>r \<le> r'; r' mod m = r mod m; m' mod m = 0; c' \<noteq> 0\<rbrakk> \<Longrightarrow> [ r', mod m', c' ] \<subseteq> [ r, mod m ]
[PROOF STEP]
apply (simp add: iMODb_iMOD_subset_conv)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma cf_lcomp_Hom_ObjMap_vdomain[cat_cs_simps]:
  assumes "category \<alpha> \<CC>" and "\<FF> : \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>"
  shows "\<D>\<^sub>\<circ> (Hom\<^sub>O\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>\<CC>(\<FF>-,-)\<lparr>ObjMap\<rparr>) = (op_cat \<BB> \<times>\<^sub>C \<CC>)\<lparr>Obj\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (Hom\<^sub>O\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>\<CC>(\<FF>-,-)\<lparr>ObjMap\<rparr>) = (op_cat \<BB> \<times>\<^sub>C \<CC>)\<lparr>Obj\<rparr>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
category \<alpha> \<CC>
\<FF> : \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>

goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (Hom\<^sub>O\<^sub>.\<^sub>C\<^bsub>\<alpha>\<^esub>\<CC>(\<FF>-,-)\<lparr>ObjMap\<rparr>) = (op_cat \<BB> \<times>\<^sub>C \<CC>)\<lparr>Obj\<rparr>
[PROOF STEP]
by
    (
      cs_concl cs_shallow
        cs_simp: cat_cs_simps cf_lcomp_Hom_def cs_intro: cat_cs_intros
    )


[STATEMENT]
lemma fps_integral0_fps_X:
  "fps_integral0 (fps_X::'a::{semiring_1,inverse} fps) =
    fps_const (inverse (of_nat 2)) * fps_X\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_integral0 fps_X = fps_const (inverse (of_nat 2)) * fps_X\<^sup>2
[PROOF STEP]
by (intro fps_ext) (auto simp: fps_integral_def)


[STATEMENT]
lemma exp_two_pi_i [simp]: "exp (2 * of_real pi * \<i>) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp (2 * complex_of_real pi * \<i>) = 1
[PROOF STEP]
by (simp add: exp_eq_polar complex_eq_iff)


[STATEMENT]
lemma VectorSpace_FGModuleHomSet :
  fixes   smult'     :: "('f, 'g) aezfun \<Rightarrow> 'w::ab_group_add \<Rightarrow> 'w" (infixr "\<star>" 70)
  and     fsmult'    :: "'f \<Rightarrow> 'w \<Rightarrow> 'w" (infixr "\<sharp>\<star>" 70)
  and     hom_fsmult :: "'f \<Rightarrow> ('v \<Rightarrow> 'w) \<Rightarrow> ('v \<Rightarrow> 'w)" (infixr "\<sharp>\<star>\<cdot>" 70)
  defines "fsmult' \<equiv> aezfun_scalar_mult.fsmult smult'"
  defines "hom_fsmult \<equiv> \<lambda>a T v. a \<sharp>\<star> T v"
  assumes "FGModule G smult' W"
  shows   "VectorSpace hom_fsmult (FGModuleHomSet G smult V smult' W)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. VectorSpace (\<sharp>\<star>\<cdot>) (FGModuleHomSet G (\<cdot>) V (\<star>) W)
[PROOF STEP]
using   assms Subspace_FGModuleHomSet Module.intro VectorSpace.intro
[PROOF STATE]
proof (prove)
using this:
(\<sharp>\<star>) \<equiv> aezfun_scalar_mult.fsmult (\<star>)
(\<sharp>\<star>\<cdot>) \<equiv> \<lambda>a T v. a \<sharp>\<star> T v
FGModule G (\<star>) W
FGModule G ?smult' ?W \<Longrightarrow> RModule UNIV (\<lambda>a T v. aezfun_scalar_mult.fsmult ?smult' a (T v)) (FGModuleHomSet G (\<cdot>) V ?smult' ?W) \<and> FGModuleHomSet G (\<cdot>) V ?smult' ?W \<subseteq> VectorSpaceHomSet (\<sharp>\<cdot>) V (aezfun_scalar_mult.fsmult ?smult') ?W
RModule UNIV ?smult ?M \<Longrightarrow> Module ?smult ?M
Module ?smult ?V \<Longrightarrow> VectorSpace ?smult ?V

goal (1 subgoal):
 1. VectorSpace (\<sharp>\<star>\<cdot>) (FGModuleHomSet G (\<cdot>) V (\<star>) W)
[PROOF STEP]
by      fast


[STATEMENT]
lemma Always_tokens_allocRel_le_rel: "System \<in> Always (INT i: lessThan Nclients.
                          {s. (tokens o sub i o allocRel) s
                           \<le> (tokens o rel o sub i o client) s})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. System \<in> Always (\<Inter>i<Nclients. {s. (sum_list \<circ> sub i \<circ> allocRel) s \<le> (sum_list \<circ> rel \<circ> sub i \<circ> client) s})
[PROOF STEP]
apply (rule Always_allocRel_le_rel [THEN Always_weaken])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Inter>i<Nclients. {s. (sub i \<circ> allocRel) s \<le> (rel \<circ> sub i \<circ> client) s}) \<subseteq> (\<Inter>i<Nclients. {s. (sum_list \<circ> sub i \<circ> allocRel) s \<le> (sum_list \<circ> rel \<circ> sub i \<circ> client) s})
[PROOF STEP]
apply (auto intro: tokens_mono_prefix simp add: o_apply)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Im_linepath: "Im(linepath (of_real a) (of_real b) x) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Im (linepath (complex_of_real a) (complex_of_real b) x) = 0
[PROOF STEP]
by (simp add: linepath_def)


[STATEMENT]
lemma untion_image_mset_Pair_distribute:
  "\<Sum>\<^sub>#{#image_mset (Pair x) (C x). x \<in># J - I#} =
   \<Sum>\<^sub># {#image_mset (Pair x) (C x). x \<in># J#} - \<Sum>\<^sub>#{#image_mset (Pair x) (C x). x \<in># I#}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>#J - I. image_mset (Pair x) (C x)) = (\<Sum>x\<in>#J. image_mset (Pair x) (C x)) - (\<Sum>x\<in>#I. image_mset (Pair x) (C x))
[PROOF STEP]
by (auto simp: multiset_eq_iff count_sum_mset count_image_mset_Pair sum_mset_if_eq_constant
    iterate_op_plus diff_mult_distrib2)


[STATEMENT]
lemma mem_snd_map: "(\<exists>x. (x, y) \<in> S) \<longleftrightarrow> y \<in> snd ` S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x. (x, y) \<in> S) = (y \<in> snd ` S)
[PROOF STEP]
by force


[STATEMENT]
lemma lm075:
  assumes "R \<in> totalRels A B"
  shows   "R outside C \<in> totalRels (A-C) B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Outside' C R \<in> totalRels (A - C) B
[PROOF STEP]
unfolding Outside_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R - C \<times> Range R \<in> totalRels (A - C) B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
R \<in> totalRels A B

goal (1 subgoal):
 1. R - C \<times> Range R \<in> totalRels (A - C) B
[PROOF STEP]
by blast


[STATEMENT]
lemma cofactor_list_syz_plus:
  "cofactor_list_syz n (p + q) = map2 (+) (cofactor_list_syz n p) (cofactor_list_syz n q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cofactor_list_syz n (p + q) = map2 (+) (cofactor_list_syz n p) (cofactor_list_syz n q)
[PROOF STEP]
by (rule nth_equalityI, simp_all add: cofactor_list_syz_nth proj_plus)


[STATEMENT]
lemma vint_assoc_law_multiplication:
  assumes "x \<in>\<^sub>\<circ> \<int>\<^sub>\<circ>" and "y \<in>\<^sub>\<circ> \<int>\<^sub>\<circ>" and "z \<in>\<^sub>\<circ> \<int>\<^sub>\<circ>"
  shows "(x *\<^sub>\<int> y) *\<^sub>\<int> z = x *\<^sub>\<int> (y *\<^sub>\<int> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x *\<^sub>\<int> y *\<^sub>\<int> z = x *\<^sub>\<int> (y *\<^sub>\<int> z)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x *\<^sub>\<int> y *\<^sub>\<int> z = x *\<^sub>\<int> (y *\<^sub>\<int> z)
[PROOF STEP]
have "(x' * y') * z' = x' * (y' * z')" for x' y' z' :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x' * y' * z' = x' * (y' * z')
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
?x' * ?y' * ?z' = ?x' * (?y' * ?z')

goal (1 subgoal):
 1. x *\<^sub>\<int> y *\<^sub>\<int> z = x *\<^sub>\<int> (y *\<^sub>\<int> z)
[PROOF STEP]
from this[untransferred, OF assms]
[PROOF STATE]
proof (chain)
picking this:
x *\<^sub>\<int> y *\<^sub>\<int> z = x *\<^sub>\<int> (y *\<^sub>\<int> z)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x *\<^sub>\<int> y *\<^sub>\<int> z = x *\<^sub>\<int> (y *\<^sub>\<int> z)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inj_on_span_iff_independent_image: "m2.independent (f ` B) \<Longrightarrow> inj_on f (m1.span B) \<longleftrightarrow> inj_on f B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m2.independent (f ` B) \<Longrightarrow> inj_on f (m1.span B) = inj_on f B
[PROOF STEP]
using inj_on_span_independent_image[of B] inj_on_subset[OF _ m1.span_superset, of f B]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>m2.independent (f ` B); inj_on f B\<rbrakk> \<Longrightarrow> inj_on f (m1.span B)
inj_on f (m1.span B) \<Longrightarrow> inj_on f B

goal (1 subgoal):
 1. m2.independent (f ` B) \<Longrightarrow> inj_on f (m1.span B) = inj_on f B
[PROOF STEP]
by auto


[STATEMENT]
lemma HComplex_eq_1 [simp]: "\<And>x y. HComplex x y = 1 \<longleftrightarrow> x = 1 \<and> y = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. (HComplex x y = 1) = (x = 1 \<and> y = 0)
[PROOF STEP]
by transfer (rule Complex_eq_1)


[STATEMENT]
lemma f_approx_pos: "x \<ge> x\<^sub>0 \<Longrightarrow> f_approx x > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x\<^sub>0 \<le> x \<Longrightarrow> 0 < f_approx x
[PROOF STEP]
unfolding f_approx_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x\<^sub>0 \<le> x \<Longrightarrow> 0 < x powr p * (1 + integral (\<lambda>u. g u / u powr (p + 1)) x\<^sub>0 x)
[PROOF STEP]
by (intro mult_pos_pos, insert x0_pos, simp, drule f_approx_aux, simp)


[STATEMENT]
lemma seteqI:
  "\<lbrakk> \<And>x. x\<in>A \<Longrightarrow> x\<in>B; \<And>x. x\<in>B \<Longrightarrow> x\<in>A \<rbrakk> \<Longrightarrow> A = B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x. x \<in> A \<Longrightarrow> x \<in> B; \<And>x. x \<in> B \<Longrightarrow> x \<in> A\<rbrakk> \<Longrightarrow> A = B
[PROOF STEP]
by auto


[STATEMENT]
lemma max_Sup:
  fixes f g::\<open>'a \<Rightarrow> real\<close>
  assumes \<open>X \<noteq> {}\<close> and \<open>bdd_above (f ` X)\<close> and \<open>bdd_above (g ` X)\<close>
  shows \<open>Sup ((pointwise_max f g) ` X) = max (Sup (f ` X)) (Sup (g ` X))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sup (pointwise_max f g ` X) = max (Sup (f ` X)) (Sup (g ` X))
[PROOF STEP]
text \<open>
  Explanation: Let \<^term>\<open>X\<close> be a nonempty set. Two supremum over \<^term>\<open>X\<close> of the maximum of two
  real-value functions is equal to the maximum of their suprema over \<^term>\<open>X\<close>, provided that the
  functions are bounded above on \<^term>\<open>X\<close>.
\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sup (pointwise_max f g ` X) = max (Sup (f ` X)) (Sup (g ` X))
[PROOF STEP]
proof(cases \<open>Sup (f ` X) \<ge> Sup (g ` X)\<close>)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Sup (g ` X) \<le> Sup (f ` X) \<Longrightarrow> Sup (pointwise_max f g ` X) = max (Sup (f ` X)) (Sup (g ` X))
 2. \<not> Sup (g ` X) \<le> Sup (f ` X) \<Longrightarrow> Sup (pointwise_max f g ` X) = max (Sup (f ` X)) (Sup (g ` X))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
Sup (g ` X) \<le> Sup (f ` X)

goal (2 subgoals):
 1. Sup (g ` X) \<le> Sup (f ` X) \<Longrightarrow> Sup (pointwise_max f g ` X) = max (Sup (f ` X)) (Sup (g ` X))
 2. \<not> Sup (g ` X) \<le> Sup (f ` X) \<Longrightarrow> Sup (pointwise_max f g ` X) = max (Sup (f ` X)) (Sup (g ` X))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
Sup (g ` X) \<le> Sup (f ` X)

goal (1 subgoal):
 1. Sup (pointwise_max f g ` X) = max (Sup (f ` X)) (Sup (g ` X))
[PROOF STEP]
by (simp add: assms(1) assms(2) assms(3) max_Sup_absorb_left)
[PROOF STATE]
proof (state)
this:
Sup (pointwise_max f g ` X) = max (Sup (f ` X)) (Sup (g ` X))

goal (1 subgoal):
 1. \<not> Sup (g ` X) \<le> Sup (f ` X) \<Longrightarrow> Sup (pointwise_max f g ` X) = max (Sup (f ` X)) (Sup (g ` X))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> Sup (g ` X) \<le> Sup (f ` X) \<Longrightarrow> Sup (pointwise_max f g ` X) = max (Sup (f ` X)) (Sup (g ` X))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> Sup (g ` X) \<le> Sup (f ` X)

goal (1 subgoal):
 1. \<not> Sup (g ` X) \<le> Sup (f ` X) \<Longrightarrow> Sup (pointwise_max f g ` X) = max (Sup (f ` X)) (Sup (g ` X))
[PROOF STEP]
have f1: "\<not> 0 \<le> Sup (f ` X) + - 1 * Sup (g ` X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> 0 \<le> Sup (f ` X) + - 1 * Sup (g ` X)
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
\<not> Sup (g ` X) \<le> Sup (f ` X)

goal (1 subgoal):
 1. \<not> 0 \<le> Sup (f ` X) + - 1 * Sup (g ` X)
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
\<not> 0 \<le> Sup (f ` X) + - 1 * Sup (g ` X)

goal (1 subgoal):
 1. \<not> Sup (g ` X) \<le> Sup (f ` X) \<Longrightarrow> Sup (pointwise_max f g ` X) = max (Sup (f ` X)) (Sup (g ` X))
[PROOF STEP]
hence "Sup (Banach_Steinhaus_Missing.pointwise_max f g ` X) = Sup (g ` X)"
[PROOF STATE]
proof (prove)
using this:
\<not> 0 \<le> Sup (f ` X) + - 1 * Sup (g ` X)

goal (1 subgoal):
 1. Sup (pointwise_max f g ` X) = Sup (g ` X)
[PROOF STEP]
by (simp add: assms(1) assms(2) assms(3) max_Sup_absorb_right)
[PROOF STATE]
proof (state)
this:
Sup (pointwise_max f g ` X) = Sup (g ` X)

goal (1 subgoal):
 1. \<not> Sup (g ` X) \<le> Sup (f ` X) \<Longrightarrow> Sup (pointwise_max f g ` X) = max (Sup (f ` X)) (Sup (g ` X))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
Sup (pointwise_max f g ` X) = Sup (g ` X)

goal (1 subgoal):
 1. Sup (pointwise_max f g ` X) = max (Sup (f ` X)) (Sup (g ` X))
[PROOF STEP]
using f1
[PROOF STATE]
proof (prove)
using this:
Sup (pointwise_max f g ` X) = Sup (g ` X)
\<not> 0 \<le> Sup (f ` X) + - 1 * Sup (g ` X)

goal (1 subgoal):
 1. Sup (pointwise_max f g ` X) = max (Sup (f ` X)) (Sup (g ` X))
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
Sup (pointwise_max f g ` X) = max (Sup (f ` X)) (Sup (g ` X))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem wls_psubstAbs_substAbs_compose:
assumes "wlsAbs (us,s) A" and "wls (asSort ys) Y" and "wlsEnv rho"
shows "((A $[Y / y]_ys) $[rho]) = (A $[(rho [y \<leftarrow> (Y #[rho])]_ys)])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A $[Y / y]_ys $[rho] = A $[rho [y \<leftarrow> Y #[rho]]_ys]
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
wlsAbs (us, s) A
wls (asSort ys) Y
wlsEnv rho

goal (1 subgoal):
 1. A $[Y / y]_ys $[rho] = A $[rho [y \<leftarrow> Y #[rho]]_ys]
[PROOF STEP]
by(simp add: psubstAbs_substAbs_compose)


[STATEMENT]
lemma nlists_set[code]: "nlists n (set xs) = set (List.n_lists n xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nlists n (set xs) = set (List.n_lists n xs)
[PROOF STEP]
unfolding nlists_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {xsa. length xsa = n \<and> set xsa \<subseteq> set xs} = set (List.n_lists n xs)
[PROOF STEP]
by (rule sym, induct n) (auto simp: image_iff length_Suc_conv)


[STATEMENT]
lemma gAnd_commute: "gval (gAnd a b) s = gval (gAnd b a) s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gval (gAnd a b) s = gval (gAnd b a) s
[PROOF STEP]
by (simp add: times_trilean_commutative)


[STATEMENT]
lemma borel_measurable_LIMSEQ_real:
  fixes u :: "nat \<Rightarrow> 'a \<Rightarrow> real"
  assumes u': "\<And>x. x \<in> space M \<Longrightarrow> (\<lambda>i. u i x) \<longlonglongrightarrow> u' x"
  and u: "\<And>i. u i \<in> borel_measurable M"
  shows "u' \<in> borel_measurable M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u' \<in> borel_measurable M
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. u' \<in> borel_measurable M
[PROOF STEP]
have "\<And>x. x \<in> space M \<Longrightarrow> liminf (\<lambda>n. ereal (u n x)) = ereal (u' x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> space M \<Longrightarrow> liminf (\<lambda>n. ereal (u n x)) = ereal (u' x)
[PROOF STEP]
using u'
[PROOF STATE]
proof (prove)
using this:
?x \<in> space M \<Longrightarrow> (\<lambda>i. u i ?x) \<longlonglongrightarrow> u' ?x

goal (1 subgoal):
 1. \<And>x. x \<in> space M \<Longrightarrow> liminf (\<lambda>n. ereal (u n x)) = ereal (u' x)
[PROOF STEP]
by (simp add: lim_imp_Liminf)
[PROOF STATE]
proof (state)
this:
?x \<in> space M \<Longrightarrow> liminf (\<lambda>n. ereal (u n ?x)) = ereal (u' ?x)

goal (1 subgoal):
 1. u' \<in> borel_measurable M
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
?x \<in> space M \<Longrightarrow> liminf (\<lambda>n. ereal (u n ?x)) = ereal (u' ?x)

goal (1 subgoal):
 1. u' \<in> borel_measurable M
[PROOF STEP]
from u
[PROOF STATE]
proof (chain)
picking this:
u ?i \<in> borel_measurable M
[PROOF STEP]
have "(\<lambda>x. liminf (\<lambda>n. ereal (u n x))) \<in> borel_measurable M"
[PROOF STATE]
proof (prove)
using this:
u ?i \<in> borel_measurable M

goal (1 subgoal):
 1. (\<lambda>x. liminf (\<lambda>n. ereal (u n x))) \<in> borel_measurable M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. liminf (\<lambda>n. ereal (u n x))) \<in> borel_measurable M

goal (1 subgoal):
 1. u' \<in> borel_measurable M
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
?x \<in> space M \<Longrightarrow> liminf (\<lambda>n. ereal (u n ?x)) = ereal (u' ?x)
(\<lambda>x. liminf (\<lambda>n. ereal (u n x))) \<in> borel_measurable M
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
?x \<in> space M \<Longrightarrow> liminf (\<lambda>n. ereal (u n ?x)) = ereal (u' ?x)
(\<lambda>x. liminf (\<lambda>n. ereal (u n x))) \<in> borel_measurable M

goal (1 subgoal):
 1. u' \<in> borel_measurable M
[PROOF STEP]
by (simp cong: measurable_cong add: borel_measurable_ereal_iff)
[PROOF STATE]
proof (state)
this:
u' \<in> borel_measurable M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Maclaurin_sin_expansion3:
  assumes "n > 0" "x > 0"
    shows "\<exists>t. 0 < t \<and> t < x \<and>
          sin x = (\<Sum>m<n. sin_coeff m * x ^ m) + (sin (t + 1/2 * real n * pi) / fact n) * x ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>t>0. t < x \<and> sin x = (\<Sum>m<n. sin_coeff m * x ^ m) + sin (t + 1 / 2 * real n * pi) / fact n * x ^ n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>t>0. t < x \<and> sin x = (\<Sum>m<n. sin_coeff m * x ^ m) + sin (t + 1 / 2 * real n * pi) / fact n * x ^ n
[PROOF STEP]
let ?diff = "\<lambda>n x. sin (x + 1/2 * real n * pi)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>t>0. t < x \<and> sin x = (\<Sum>m<n. sin_coeff m * x ^ m) + sin (t + 1 / 2 * real n * pi) / fact n * x ^ n
[PROOF STEP]
have "\<exists>t. 0 < t \<and> t < x \<and> sin x = (\<Sum>m<n. ?diff m 0 / (fact m) * x ^ m) + ?diff n t / fact n * x ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>t>0. t < x \<and> sin x = (\<Sum>m<n. sin (0 + 1 / 2 * real m * pi) / fact m * x ^ m) + sin (t + 1 / 2 * real n * pi) / fact n * x ^ n
[PROOF STEP]
proof (rule Maclaurin)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. 0 < x
 2. 0 < n
 3. (\<lambda>a. sin (a + 1 / 2 * real 0 * pi)) = sin
 4. \<forall>m t. m < n \<and> 0 \<le> t \<and> t \<le> x \<longrightarrow> ((\<lambda>a. sin (a + 1 / 2 * real m * pi)) has_real_derivative sin (t + 1 / 2 * real (Suc m) * pi)) (at t)
[PROOF STEP]
show "\<forall>m t. m < n \<and> 0 \<le> t \<and> t \<le> x \<longrightarrow>
                ((\<lambda>u. sin (u + 1/2 * real m * pi)) has_real_derivative
                 sin (t + 1/2 * real (Suc m) * pi)) (at t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>m t. m < n \<and> 0 \<le> t \<and> t \<le> x \<longrightarrow> ((\<lambda>u. sin (u + 1 / 2 * real m * pi)) has_real_derivative sin (t + 1 / 2 * real (Suc m) * pi)) (at t)
[PROOF STEP]
apply (simp add: sin_expansion_lemma del: of_nat_Suc)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>m t. m < n \<and> 0 \<le> t \<and> t \<le> x \<longrightarrow> ((\<lambda>u. sin (u + real m * pi / 2)) has_real_derivative cos (t + real m * pi / 2)) (at t)
[PROOF STEP]
apply (force intro!: derivative_eq_intros)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<forall>m t. m < n \<and> 0 \<le> t \<and> t \<le> x \<longrightarrow> ((\<lambda>u. sin (u + 1 / 2 * real m * pi)) has_real_derivative sin (t + 1 / 2 * real (Suc m) * pi)) (at t)

goal (3 subgoals):
 1. 0 < x
 2. 0 < n
 3. (\<lambda>a. sin (a + 1 / 2 * real 0 * pi)) = sin
[PROOF STEP]
qed (use assms in auto)
[PROOF STATE]
proof (state)
this:
\<exists>t>0. t < x \<and> sin x = (\<Sum>m<n. sin (0 + 1 / 2 * real m * pi) / fact m * x ^ m) + sin (t + 1 / 2 * real n * pi) / fact n * x ^ n

goal (1 subgoal):
 1. \<exists>t>0. t < x \<and> sin x = (\<Sum>m<n. sin_coeff m * x ^ m) + sin (t + 1 / 2 * real n * pi) / fact n * x ^ n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>t>0. t < x \<and> sin x = (\<Sum>m<n. sin (0 + 1 / 2 * real m * pi) / fact m * x ^ m) + sin (t + 1 / 2 * real n * pi) / fact n * x ^ n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>t>0. t < x \<and> sin x = (\<Sum>m<n. sin (0 + 1 / 2 * real m * pi) / fact m * x ^ m) + sin (t + 1 / 2 * real n * pi) / fact n * x ^ n

goal (1 subgoal):
 1. \<exists>t>0. t < x \<and> sin x = (\<Sum>m<n. sin_coeff m * x ^ m) + sin (t + 1 / 2 * real n * pi) / fact n * x ^ n
[PROOF STEP]
apply (rule ex_forward, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>t. \<lbrakk>0 < t \<and> t < x \<and> sin x = (\<Sum>m<n. sin (real m * pi / 2) * x ^ m / fact m) + sin (t + real n * pi / 2) * x ^ n / fact n; \<exists>ta>0. ta < x \<and> sin (t + real n * pi / 2) = sin (ta + real n * pi / 2)\<rbrakk> \<Longrightarrow> (\<Sum>m<n. sin (real m * pi / 2) * x ^ m / fact m) = (\<Sum>m<n. sin_coeff m * x ^ m)
[PROOF STEP]
apply (rule sum.cong[OF refl])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>t xa. \<lbrakk>0 < t \<and> t < x \<and> sin x = (\<Sum>m<n. sin (real m * pi / 2) * x ^ m / fact m) + sin (t + real n * pi / 2) * x ^ n / fact n; \<exists>ta>0. ta < x \<and> sin (t + real n * pi / 2) = sin (ta + real n * pi / 2); xa \<in> {..<n}\<rbrakk> \<Longrightarrow> sin (real xa * pi / 2) * x ^ xa / fact xa = sin_coeff xa * x ^ xa
[PROOF STEP]
apply (auto simp: sin_coeff_def sin_zero_iff elim: oddE simp del: of_nat_Suc)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<exists>t>0. t < x \<and> sin x = (\<Sum>m<n. sin_coeff m * x ^ m) + sin (t + 1 / 2 * real n * pi) / fact n * x ^ n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vec_hom_lim_set_distinct_iff:
  fixes xs :: "'a vec list"
  assumes "\<And> v . v \<in> set (xs) \<Longrightarrow> set\<^sub>v v \<subseteq> A"
  shows "distinct xs \<longleftrightarrow> distinct (map (map_vec f) xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct xs = distinct (map (map_vec f) xs)
[PROOF STEP]
using assms vec_hom_inj_lim
[PROOF STATE]
proof (prove)
using this:
?v \<in> set xs \<Longrightarrow> set\<^sub>v ?v \<subseteq> A
\<lbrakk>set\<^sub>v ?v \<subseteq> A; set\<^sub>v ?w \<subseteq> A; map_vec f ?v = map_vec f ?w\<rbrakk> \<Longrightarrow> ?v = ?w

goal (1 subgoal):
 1. distinct xs = distinct (map (map_vec f) xs)
[PROOF STEP]
by (induct xs, simp_all) (metis (no_types, lifting) image_iff)


[STATEMENT]
lemma finite_set_decidable: "finite X \<Longrightarrow> decidable X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite X \<Longrightarrow> decidable X
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite X \<Longrightarrow> decidable X
[PROOF STEP]
fix X :: "nat set"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite X \<Longrightarrow> decidable X
[PROOF STEP]
assume "finite X"
[PROOF STATE]
proof (state)
this:
finite X

goal (1 subgoal):
 1. finite X \<Longrightarrow> decidable X
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite X
[PROOF STEP]
obtain xs where "X = set xs"
[PROOF STATE]
proof (prove)
using this:
finite X

goal (1 subgoal):
 1. (\<And>xs. X = set xs \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using finite_list
[PROOF STATE]
proof (prove)
using this:
finite X
finite ?A \<Longrightarrow> \<exists>xs. set xs = ?A

goal (1 subgoal):
 1. (\<And>xs. X = set xs \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
X = set xs

goal (1 subgoal):
 1. finite X \<Longrightarrow> decidable X
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
X = set xs
[PROOF STEP]
have "\<forall>x. eval (r_contains xs) [x] \<down>= (if x \<in> X then 1 else 0)"
[PROOF STATE]
proof (prove)
using this:
X = set xs

goal (1 subgoal):
 1. \<forall>x. eval (r_contains xs) [x] \<down>= (if x \<in> X then 1 else 0)
[PROOF STEP]
using r_contains
[PROOF STATE]
proof (prove)
using this:
X = set xs
eval (r_contains ?xs) [?x] \<down>= (if ?x \<in> set ?xs then 1 else 0)

goal (1 subgoal):
 1. \<forall>x. eval (r_contains xs) [x] \<down>= (if x \<in> X then 1 else 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>x. eval (r_contains xs) [x] \<down>= (if x \<in> X then 1 else 0)

goal (1 subgoal):
 1. finite X \<Longrightarrow> decidable X
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x. eval (r_contains xs) [x] \<down>= (if x \<in> X then 1 else 0)
[PROOF STEP]
show "decidable X"
[PROOF STATE]
proof (prove)
using this:
\<forall>x. eval (r_contains xs) [x] \<down>= (if x \<in> X then 1 else 0)

goal (1 subgoal):
 1. decidable X
[PROOF STEP]
using decidable_def r_contains_prim
[PROOF STATE]
proof (prove)
using this:
\<forall>x. eval (r_contains xs) [x] \<down>= (if x \<in> X then 1 else 0)
decidable ?X \<equiv> \<exists>f. recfn 1 f \<and> (\<forall>x. eval f [x] \<down>= (if x \<in> ?X then 1 else 0))
prim_recfn 1 (r_contains ?xs)

goal (1 subgoal):
 1. decidable X
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
decidable X

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma normalize_boundary_iff:
  "\<bar>normalize p $ 1\<bar> = 1 \<longleftrightarrow> p $ 2 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<bar>normalize p $ 1\<bar> = 1) = (p $ 2 = 0)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<bar>normalize p $ 1\<bar> = 1 \<Longrightarrow> p $ 2 = 0
 2. p $ 2 = 0 \<Longrightarrow> \<bar>normalize p $ 1\<bar> = 1
[PROOF STEP]
assume "\<bar>normalize p $ 1\<bar> = 1"
[PROOF STATE]
proof (state)
this:
\<bar>normalize p $ 1\<bar> = 1

goal (2 subgoals):
 1. \<bar>normalize p $ 1\<bar> = 1 \<Longrightarrow> p $ 2 = 0
 2. p $ 2 = 0 \<Longrightarrow> \<bar>normalize p $ 1\<bar> = 1
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
\<bar>normalize p $ 1\<bar> = 1
[PROOF STEP]
have 1: "(p $ 1) ^ 2 = norm p ^ 2"
[PROOF STATE]
proof (prove)
using this:
\<bar>normalize p $ 1\<bar> = 1

goal (1 subgoal):
 1. (p $ 1)\<^sup>2 = (norm p)\<^sup>2
[PROOF STEP]
unfolding normalize_def
[PROOF STATE]
proof (prove)
using this:
\<bar>(if p = 0 then axis 1 1 else (1 / norm p) *\<^sub>R p) $ 1\<bar> = 1

goal (1 subgoal):
 1. (p $ 1)\<^sup>2 = (norm p)\<^sup>2
[PROOF STEP]
by (auto split: if_split_asm simp add: power2_eq_iff)
[PROOF STATE]
proof (state)
this:
(p $ 1)\<^sup>2 = (norm p)\<^sup>2

goal (2 subgoals):
 1. \<bar>normalize p $ 1\<bar> = 1 \<Longrightarrow> p $ 2 = 0
 2. p $ 2 = 0 \<Longrightarrow> \<bar>normalize p $ 1\<bar> = 1
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(p $ 1)\<^sup>2 = (norm p)\<^sup>2

goal (2 subgoals):
 1. \<bar>normalize p $ 1\<bar> = 1 \<Longrightarrow> p $ 2 = 0
 2. p $ 2 = 0 \<Longrightarrow> \<bar>normalize p $ 1\<bar> = 1
[PROOF STEP]
have "(p $ 1) ^ 2 + (p $ 2) ^ 2 = norm p ^ 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (p $ 1)\<^sup>2 + (p $ 2)\<^sup>2 = (norm p)\<^sup>2
[PROOF STEP]
using norm_eq_on_real_2_vec
[PROOF STATE]
proof (prove)
using this:
norm ?x = sqrt ((?x $ 1)\<^sup>2 + (?x $ 2)\<^sup>2)

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

goal (2 subgoals):
 1. \<bar>normalize p $ 1\<bar> = 1 \<Longrightarrow> p $ 2 = 0
 2. p $ 2 = 0 \<Longrightarrow> \<bar>normalize p $ 1\<bar> = 1
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(p $ 1)\<^sup>2 = (norm p)\<^sup>2
(p $ 1)\<^sup>2 + (p $ 2)\<^sup>2 = (norm p)\<^sup>2
[PROOF STEP]
show "p $ 2 = 0"
[PROOF STATE]
proof (prove)
using this:
(p $ 1)\<^sup>2 = (norm p)\<^sup>2
(p $ 1)\<^sup>2 + (p $ 2)\<^sup>2 = (norm p)\<^sup>2

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

goal (1 subgoal):
 1. p $ 2 = 0 \<Longrightarrow> \<bar>normalize p $ 1\<bar> = 1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p $ 2 = 0 \<Longrightarrow> \<bar>normalize p $ 1\<bar> = 1
[PROOF STEP]
assume "p $ 2 = 0"
[PROOF STATE]
proof (state)
this:
p $ 2 = 0

goal (1 subgoal):
 1. p $ 2 = 0 \<Longrightarrow> \<bar>normalize p $ 1\<bar> = 1
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
p $ 2 = 0
[PROOF STEP]
have "\<bar>p $ 1\<bar> = norm p"
[PROOF STATE]
proof (prove)
using this:
p $ 2 = 0

goal (1 subgoal):
 1. \<bar>p $ 1\<bar> = norm p
[PROOF STEP]
by (auto simp add: norm_eq_on_real_2_vec)
[PROOF STATE]
proof (state)
this:
\<bar>p $ 1\<bar> = norm p

goal (1 subgoal):
 1. p $ 2 = 0 \<Longrightarrow> \<bar>normalize p $ 1\<bar> = 1
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
\<bar>p $ 1\<bar> = norm p
[PROOF STEP]
show "\<bar>normalize p $ 1\<bar> = 1"
[PROOF STATE]
proof (prove)
using this:
\<bar>p $ 1\<bar> = norm p

goal (1 subgoal):
 1. \<bar>normalize p $ 1\<bar> = 1
[PROOF STEP]
unfolding normalize_def
[PROOF STATE]
proof (prove)
using this:
\<bar>p $ 1\<bar> = norm p

goal (1 subgoal):
 1. \<bar>(if p = 0 then axis 1 1 else (1 / norm p) *\<^sub>R p) $ 1\<bar> = 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<bar>normalize p $ 1\<bar> = 1

goal:
No subgoals!
[PROOF STEP]
qed