[STATEMENT]
lemma unit_disc_fix_decompose_blaschke_rotation:
  assumes "unit_disc_fix M"
  shows "\<exists> k \<phi>. cmod k < 1 \<and> M = moebius_rotation \<phi> + blaschke k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>k \<phi>. cmod k < 1 \<and> M = moebius_rotation \<phi> + blaschke k
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
unit_disc_fix M

goal (1 subgoal):
 1. \<exists>k \<phi>. cmod k < 1 \<and> M = moebius_rotation \<phi> + blaschke k
[PROOF STEP]
unfolding moebius_rotation_def moebius_similarity_def
[PROOF STATE]
proof (prove)
using this:
unit_disc_fix M

goal (1 subgoal):
 1. \<exists>k \<phi>. cmod k < 1 \<and> M = mk_moebius (cis \<phi>) 0 0 1 + blaschke k
[PROOF STEP]
proof (simp, transfer, transfer)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>M Ma. \<lbrakk>mat_det M \<noteq> 0; unit_disc_fix_cmat M; unit_disc_fix_cmat M; unit_disc_fix_mmat Ma\<rbrakk> \<Longrightarrow> \<exists>k. cmod k < 1 \<and> (\<exists>\<phi>. moebius_cmat_eq M (moebius_comp_cmat (mk_moebius_cmat (cis \<phi>) 0 0 1) (blaschke_cmat k)))
[PROOF STEP]
fix M
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>M Ma. \<lbrakk>mat_det M \<noteq> 0; unit_disc_fix_cmat M; unit_disc_fix_cmat M; unit_disc_fix_mmat Ma\<rbrakk> \<Longrightarrow> \<exists>k. cmod k < 1 \<and> (\<exists>\<phi>. moebius_cmat_eq M (moebius_comp_cmat (mk_moebius_cmat (cis \<phi>) 0 0 1) (blaschke_cmat k)))
[PROOF STEP]
assume *: "mat_det M \<noteq> 0" "unit_disc_fix_cmat M"
[PROOF STATE]
proof (state)
this:
mat_det M \<noteq> 0
unit_disc_fix_cmat M

goal (1 subgoal):
 1. \<And>M Ma. \<lbrakk>mat_det M \<noteq> 0; unit_disc_fix_cmat M; unit_disc_fix_cmat M; unit_disc_fix_mmat Ma\<rbrakk> \<Longrightarrow> \<exists>k. cmod k < 1 \<and> (\<exists>\<phi>. moebius_cmat_eq M (moebius_comp_cmat (mk_moebius_cmat (cis \<phi>) 0 0 1) (blaschke_cmat k)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
mat_det M \<noteq> 0
unit_disc_fix_cmat M
[PROOF STEP]
obtain k a b :: complex where
    **: "k \<noteq> 0" "mat_det (a, b, cnj b, cnj a) \<noteq> 0" "M = k *\<^sub>s\<^sub>m (a, b, cnj b, cnj a)"
[PROOF STATE]
proof (prove)
using this:
mat_det M \<noteq> 0
unit_disc_fix_cmat M

goal (1 subgoal):
 1. (\<And>k a b. \<lbrakk>k \<noteq> 0; mat_det (a, b, cnj b, cnj a) \<noteq> 0; M = k *\<^sub>s\<^sub>m (a, b, cnj b, cnj a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using unitary11_gen_iff[of M]
[PROOF STATE]
proof (prove)
using this:
mat_det M \<noteq> 0
unit_disc_fix_cmat M
unitary11_gen M = (\<exists>k a b. k \<noteq> 0 \<and> mat_det (a, b, cnj b, cnj a) \<noteq> 0 \<and> M = k *\<^sub>s\<^sub>m (a, b, cnj b, cnj a))

goal (1 subgoal):
 1. (\<And>k a b. \<lbrakk>k \<noteq> 0; mat_det (a, b, cnj b, cnj a) \<noteq> 0; M = k *\<^sub>s\<^sub>m (a, b, cnj b, cnj a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
k \<noteq> 0
mat_det (a, b, cnj b, cnj a) \<noteq> 0
M = k *\<^sub>s\<^sub>m (a, b, cnj b, cnj a)

goal (1 subgoal):
 1. \<And>M Ma. \<lbrakk>mat_det M \<noteq> 0; unit_disc_fix_cmat M; unit_disc_fix_cmat M; unit_disc_fix_mmat Ma\<rbrakk> \<Longrightarrow> \<exists>k. cmod k < 1 \<and> (\<exists>\<phi>. moebius_cmat_eq M (moebius_comp_cmat (mk_moebius_cmat (cis \<phi>) 0 0 1) (blaschke_cmat k)))
[PROOF STEP]
have "a \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<noteq> 0
[PROOF STEP]
using * **
[PROOF STATE]
proof (prove)
using this:
mat_det M \<noteq> 0
unit_disc_fix_cmat M
k \<noteq> 0
mat_det (a, b, cnj b, cnj a) \<noteq> 0
M = k *\<^sub>s\<^sub>m (a, b, cnj b, cnj a)

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

goal (1 subgoal):
 1. \<And>M Ma. \<lbrakk>mat_det M \<noteq> 0; unit_disc_fix_cmat M; unit_disc_fix_cmat M; unit_disc_fix_mmat Ma\<rbrakk> \<Longrightarrow> \<exists>k. cmod k < 1 \<and> (\<exists>\<phi>. moebius_cmat_eq M (moebius_comp_cmat (mk_moebius_cmat (cis \<phi>) 0 0 1) (blaschke_cmat k)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<noteq> 0
[PROOF STEP]
obtain a' k' \<phi>
    where ***: "k' \<noteq> 0 \<and> a' * cnj a' \<noteq> 1 \<and> M = k' *\<^sub>s\<^sub>m (cis \<phi>, 0, 0, 1) *\<^sub>m\<^sub>m (1, - a', - cnj a', 1)"
[PROOF STATE]
proof (prove)
using this:
a \<noteq> 0

goal (1 subgoal):
 1. (\<And>k' a' \<phi>. k' \<noteq> 0 \<and> a' * cnj a' \<noteq> 1 \<and> M = k' *\<^sub>s\<^sub>m (cis \<phi>, 0, 0, 1) *\<^sub>m\<^sub>m (1, - a', - cnj a', 1) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using ** unitary11_gen_cis_blaschke[of k M a b]
[PROOF STATE]
proof (prove)
using this:
a \<noteq> 0
k \<noteq> 0
mat_det (a, b, cnj b, cnj a) \<noteq> 0
M = k *\<^sub>s\<^sub>m (a, b, cnj b, cnj a)
\<lbrakk>k \<noteq> 0; M = k *\<^sub>s\<^sub>m (a, b, cnj b, cnj a); a \<noteq> 0; mat_det (a, b, cnj b, cnj a) \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>k' \<phi> a'. k' \<noteq> 0 \<and> a' * cnj a' \<noteq> 1 \<and> M = k' *\<^sub>s\<^sub>m (cis \<phi>, 0, 0, 1) *\<^sub>m\<^sub>m (1, - a', - cnj a', 1)

goal (1 subgoal):
 1. (\<And>k' a' \<phi>. k' \<noteq> 0 \<and> a' * cnj a' \<noteq> 1 \<and> M = k' *\<^sub>s\<^sub>m (cis \<phi>, 0, 0, 1) *\<^sub>m\<^sub>m (1, - a', - cnj a', 1) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto blast
[PROOF STATE]
proof (state)
this:
k' \<noteq> 0 \<and> a' * cnj a' \<noteq> 1 \<and> M = k' *\<^sub>s\<^sub>m (cis \<phi>, 0, 0, 1) *\<^sub>m\<^sub>m (1, - a', - cnj a', 1)

goal (1 subgoal):
 1. \<And>M Ma. \<lbrakk>mat_det M \<noteq> 0; unit_disc_fix_cmat M; unit_disc_fix_cmat M; unit_disc_fix_mmat Ma\<rbrakk> \<Longrightarrow> \<exists>k. cmod k < 1 \<and> (\<exists>\<phi>. moebius_cmat_eq M (moebius_comp_cmat (mk_moebius_cmat (cis \<phi>) 0 0 1) (blaschke_cmat k)))
[PROOF STEP]
have "a' = 0 \<or> 1 < 1 / (cmod a')\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a' = 0 \<or> 1 < 1 / (cmod a')\<^sup>2
[PROOF STEP]
using * *** complex_mult_cnj_cmod[of a']
[PROOF STATE]
proof (prove)
using this:
mat_det M \<noteq> 0
unit_disc_fix_cmat M
k' \<noteq> 0 \<and> a' * cnj a' \<noteq> 1 \<and> M = k' *\<^sub>s\<^sub>m (cis \<phi>, 0, 0, 1) *\<^sub>m\<^sub>m (1, - a', - cnj a', 1)
a' * cnj a' = cor ((cmod a')\<^sup>2)

goal (1 subgoal):
 1. a' = 0 \<or> 1 < 1 / (cmod a')\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a' = 0 \<or> 1 < 1 / (cmod a')\<^sup>2

goal (1 subgoal):
 1. \<And>M Ma. \<lbrakk>mat_det M \<noteq> 0; unit_disc_fix_cmat M; unit_disc_fix_cmat M; unit_disc_fix_mmat Ma\<rbrakk> \<Longrightarrow> \<exists>k. cmod k < 1 \<and> (\<exists>\<phi>. moebius_cmat_eq M (moebius_comp_cmat (mk_moebius_cmat (cis \<phi>) 0 0 1) (blaschke_cmat k)))
[PROOF STEP]
hence "cmod a' < 1"
[PROOF STATE]
proof (prove)
using this:
a' = 0 \<or> 1 < 1 / (cmod a')\<^sup>2

goal (1 subgoal):
 1. cmod a' < 1
[PROOF STEP]
by (smt less_divide_eq_1_pos norm_zero one_less_power one_power2 pos2)
[PROOF STATE]
proof (state)
this:
cmod a' < 1

goal (1 subgoal):
 1. \<And>M Ma. \<lbrakk>mat_det M \<noteq> 0; unit_disc_fix_cmat M; unit_disc_fix_cmat M; unit_disc_fix_mmat Ma\<rbrakk> \<Longrightarrow> \<exists>k. cmod k < 1 \<and> (\<exists>\<phi>. moebius_cmat_eq M (moebius_comp_cmat (mk_moebius_cmat (cis \<phi>) 0 0 1) (blaschke_cmat k)))
[PROOF STEP]
thus "\<exists>k. cmod k < 1 \<and>
            (\<exists>\<phi>. moebius_cmat_eq M (moebius_comp_cmat (mk_moebius_cmat (cis \<phi>) 0 0 1) (blaschke_cmat k)))"
[PROOF STATE]
proof (prove)
using this:
cmod a' < 1

goal (1 subgoal):
 1. \<exists>k. cmod k < 1 \<and> (\<exists>\<phi>. moebius_cmat_eq M (moebius_comp_cmat (mk_moebius_cmat (cis \<phi>) 0 0 1) (blaschke_cmat k)))
[PROOF STEP]
using ***
[PROOF STATE]
proof (prove)
using this:
cmod a' < 1
k' \<noteq> 0 \<and> a' * cnj a' \<noteq> 1 \<and> M = k' *\<^sub>s\<^sub>m (cis \<phi>, 0, 0, 1) *\<^sub>m\<^sub>m (1, - a', - cnj a', 1)

goal (1 subgoal):
 1. \<exists>k. cmod k < 1 \<and> (\<exists>\<phi>. moebius_cmat_eq M (moebius_comp_cmat (mk_moebius_cmat (cis \<phi>) 0 0 1) (blaschke_cmat k)))
[PROOF STEP]
apply (rule_tac x=a' in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>cmod a' < 1; k' \<noteq> 0 \<and> a' * cnj a' \<noteq> 1 \<and> M = k' *\<^sub>s\<^sub>m (cis \<phi>, 0, 0, 1) *\<^sub>m\<^sub>m (1, - a', - cnj a', 1)\<rbrakk> \<Longrightarrow> cmod a' < 1 \<and> (\<exists>\<phi>. moebius_cmat_eq M (moebius_comp_cmat (mk_moebius_cmat (cis \<phi>) 0 0 1) (blaschke_cmat a')))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>cmod a' < 1; k' \<noteq> 0 \<and> a' * cnj a' \<noteq> 1 \<and> M = (k' * cis \<phi>, - (k' * cis \<phi> * a'), - (k' * cnj a'), k')\<rbrakk> \<Longrightarrow> \<exists>\<phi>' k. k \<noteq> 0 \<and> cis \<phi>' = k * (k' * cis \<phi>) \<and> (a' = 0 \<or> cis \<phi>' = k * (k' * cis \<phi>)) \<and> (a' = 0 \<or> k * k' = 1) \<and> k * k' = 1
[PROOF STEP]
apply (rule_tac x=\<phi> in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>cmod a' < 1; k' \<noteq> 0 \<and> a' * cnj a' \<noteq> 1 \<and> M = (k' * cis \<phi>, - (k' * cis \<phi> * a'), - (k' * cnj a'), k')\<rbrakk> \<Longrightarrow> \<exists>k. k \<noteq> 0 \<and> cis \<phi> = k * (k' * cis \<phi>) \<and> (a' = 0 \<or> cis \<phi> = k * (k' * cis \<phi>)) \<and> (a' = 0 \<or> k * k' = 1) \<and> k * k' = 1
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>cmod a' < 1; k' \<noteq> 0 \<and> a' * cnj a' \<noteq> 1 \<and> M = (k' * cis \<phi>, - (k' * cis \<phi> * a'), - (k' * cnj a'), k')\<rbrakk> \<Longrightarrow> \<exists>k. k \<noteq> 0 \<and> k * k' = 1 \<and> (a' = 0 \<or> k * k' = 1) \<and> k * k' = 1
[PROOF STEP]
apply (rule_tac x="1/k'" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>cmod a' < 1; k' \<noteq> 0 \<and> a' * cnj a' \<noteq> 1 \<and> M = (k' * cis \<phi>, - (k' * cis \<phi> * a'), - (k' * cnj a'), k')\<rbrakk> \<Longrightarrow> 1 / k' \<noteq> 0 \<and> 1 / k' * k' = 1 \<and> (a' = 0 \<or> 1 / k' * k' = 1) \<and> 1 / k' * k' = 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>k. cmod k < 1 \<and> (\<exists>\<phi>. moebius_cmat_eq M (moebius_comp_cmat (mk_moebius_cmat (cis \<phi>) 0 0 1) (blaschke_cmat k)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma log_exp [simp]: "log (2 ^ n) = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.log (2 ^ n) = n
[PROOF STEP]
by (induct n) simp_all


[STATEMENT]
lemma lim_ln_over_ln1: "(\<lambda>n. ln n / ln(Suc n)) \<longlonglongrightarrow> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. ln (real n) / ln (real (Suc n))) \<longlonglongrightarrow> 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>n. ln (real n) / ln (real (Suc n))) \<longlonglongrightarrow> 1
[PROOF STEP]
have "(\<lambda>n. inverse (ln(Suc n) / ln n)) \<longlonglongrightarrow> inverse 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. inverse (ln (real (Suc n)) / ln (real n))) \<longlonglongrightarrow> inverse 1
[PROOF STEP]
by (rule tendsto_inverse [OF lim_ln1_over_ln]) auto
[PROOF STATE]
proof (state)
this:
(\<lambda>n. inverse (ln (real (Suc n)) / ln (real n))) \<longlonglongrightarrow> inverse 1

goal (1 subgoal):
 1. (\<lambda>n. ln (real n) / ln (real (Suc n))) \<longlonglongrightarrow> 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. inverse (ln (real (Suc n)) / ln (real n))) \<longlonglongrightarrow> inverse 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. inverse (ln (real (Suc n)) / ln (real n))) \<longlonglongrightarrow> inverse 1

goal (1 subgoal):
 1. (\<lambda>n. ln (real n) / ln (real (Suc n))) \<longlonglongrightarrow> 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>n. ln (real n) / ln (real (Suc n))) \<longlonglongrightarrow> 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma scaleR_le_cancel_left_neg: "c < 0 \<Longrightarrow> c *\<^sub>R a \<le> c *\<^sub>R b \<longleftrightarrow> b \<le> a"
  for b :: "'a::ordered_real_vector"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c < 0 \<Longrightarrow> (c *\<^sub>R a \<le> c *\<^sub>R b) = (b \<le> a)
[PROOF STEP]
by (auto simp: scaleR_le_cancel_left)


[STATEMENT]
lemma hcmod_mult_i [simp]: "\<And>y. hcmod (iii * hcomplex_of_hypreal y) = \<bar>y\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y. hcmod (iii * hcomplex_of_hypreal y) = \<bar>y\<bar>
[PROOF STEP]
by transfer (simp add: norm_complex_def)


[STATEMENT]
lemma Elem_Opair_exists: "\<exists>z. Elem x z & Elem y z & Elem z (Opair x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>z. Elem x z \<and> Elem y z \<and> Elem z (Opair x y)
[PROOF STEP]
apply (rule exI[where x="Upair x y"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Elem x (Upair x y) \<and> Elem y (Upair x y) \<and> Elem (Upair x y) (Opair x y)
[PROOF STEP]
by (simp add: Upair Opair_def)


[STATEMENT]
lemma bisum_is_map_zip:
  "(\<Sum>x\<leftarrow>zip (0 # l1) (l1 @ [0]). f x) = bisum (\<lambda>x y. f (x,y)) l1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (map f (zip ((0::'b) # l1) (l1 @ [0::'b]))) = bisum (\<lambda>x y. f (x, y)) l1
[PROOF STEP]
using bisumTail_is_map_zip[of f "hd l1" "tl l1"]
[PROOF STATE]
proof (prove)
using this:
sum_list (map f (zip (hd l1 # tl l1) (tl l1 @ [0::'b]))) = bisumTail (\<lambda>x y. f (x, y)) (hd l1 # tl l1)

goal (1 subgoal):
 1. sum_list (map f (zip ((0::'b) # l1) (l1 @ [0::'b]))) = bisum (\<lambda>x y. f (x, y)) l1
[PROOF STEP]
by(cases l1,auto)


[STATEMENT]
lemma star_inductr_var_equiv: "y \<cdot> x \<le> y \<longleftrightarrow> y \<cdot> x\<^sup>\<star> \<le> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (y \<cdot> x \<le> y) = (y \<cdot> x\<^sup>\<star> \<le> y)
[PROOF STEP]
by (meson order_trans mult_isol star_ext star_inductr_var)


[STATEMENT]
lemma nn_integral_bind_pmf[simp]: "(\<integral>\<^sup>+x. f x \<partial>bind_pmf M N) = (\<integral>\<^sup>+x. \<integral>\<^sup>+y. f y \<partial>N x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N (measure_pmf (M \<bind> N)) f = \<integral>\<^sup>+ x. integral\<^sup>N (measure_pmf (N x)) f \<partial>measure_pmf M
[PROOF STEP]
using measurable_measure_pmf[of N]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. measure_pmf (N x)) \<in> count_space UNIV \<rightarrow>\<^sub>M subprob_algebra (count_space UNIV)

goal (1 subgoal):
 1. integral\<^sup>N (measure_pmf (M \<bind> N)) f = \<integral>\<^sup>+ x. integral\<^sup>N (measure_pmf (N x)) f \<partial>measure_pmf M
[PROOF STEP]
unfolding measure_pmf_bind
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. measure_pmf (N x)) \<in> count_space UNIV \<rightarrow>\<^sub>M subprob_algebra (count_space UNIV)

goal (1 subgoal):
 1. integral\<^sup>N (measure_pmf M \<bind> (\<lambda>x. measure_pmf (N x))) f = \<integral>\<^sup>+ x. integral\<^sup>N (measure_pmf (N x)) f \<partial>measure_pmf M
[PROOF STEP]
apply (intro nn_integral_bind[where B="count_space UNIV"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<lambda>x. measure_pmf (N x)) \<in> count_space UNIV \<rightarrow>\<^sub>M subprob_algebra (count_space UNIV) \<Longrightarrow> f \<in> borel_measurable (count_space UNIV)
 2. (\<lambda>x. measure_pmf (N x)) \<in> count_space UNIV \<rightarrow>\<^sub>M subprob_algebra (count_space UNIV) \<Longrightarrow> measure_pmf.random_variable M (subprob_algebra (count_space UNIV)) (\<lambda>x. measure_pmf (N x))
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma min_ed_ix'_min_ed:
  "min_ed_ix' xs ys (length xs) (length ys) (i, j) = min_ed (drop i xs) (drop j ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min_ed_ix' xs ys (length xs) (length ys) (i, j) = min_ed (drop i xs) (drop j ys)
[PROOF STEP]
apply(induction "(i,j)" arbitrary: i j rule: min_ed_ix'.induct[of "length xs" "length ys"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>\<lbrakk>length xs \<le> i; \<not> length ys \<le> j\<rbrakk> \<Longrightarrow> min_ed_ix' xs ys (length xs) (length ys) (i, j + 1) = min_ed (drop i xs) (drop (j + 1) ys); \<lbrakk>\<not> length xs \<le> i; length ys \<le> j\<rbrakk> \<Longrightarrow> min_ed_ix' xs ys (length xs) (length ys) (i + 1, j) = min_ed (drop (i + 1) xs) (drop j ys); \<lbrakk>\<not> length xs \<le> i; \<not> length ys \<le> j\<rbrakk> \<Longrightarrow> min_ed_ix' xs ys (length xs) (length ys) (i, j + 1) = min_ed (drop i xs) (drop (j + 1) ys); \<lbrakk>\<not> length xs \<le> i; \<not> length ys \<le> j\<rbrakk> \<Longrightarrow> min_ed_ix' xs ys (length xs) (length ys) (i + 1, j) = min_ed (drop (i + 1) xs) (drop j ys); \<lbrakk>\<not> length xs \<le> i; \<not> length ys \<le> j\<rbrakk> \<Longrightarrow> min_ed_ix' xs ys (length xs) (length ys) (i + 1, j + 1) = min_ed (drop (i + 1) xs) (drop (j + 1) ys)\<rbrakk> \<Longrightarrow> min_ed_ix' xs ys (length xs) (length ys) (i, j) = min_ed (drop i xs) (drop j ys)
[PROOF STEP]
apply(subst min_ed_ix'.simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>\<lbrakk>length xs \<le> i; \<not> length ys \<le> j\<rbrakk> \<Longrightarrow> min_ed_ix' xs ys (length xs) (length ys) (i, j + 1) = min_ed (drop i xs) (drop (j + 1) ys); \<lbrakk>\<not> length xs \<le> i; length ys \<le> j\<rbrakk> \<Longrightarrow> min_ed_ix' xs ys (length xs) (length ys) (i + 1, j) = min_ed (drop (i + 1) xs) (drop j ys); \<lbrakk>\<not> length xs \<le> i; \<not> length ys \<le> j\<rbrakk> \<Longrightarrow> min_ed_ix' xs ys (length xs) (length ys) (i, j + 1) = min_ed (drop i xs) (drop (j + 1) ys); \<lbrakk>\<not> length xs \<le> i; \<not> length ys \<le> j\<rbrakk> \<Longrightarrow> min_ed_ix' xs ys (length xs) (length ys) (i + 1, j) = min_ed (drop (i + 1) xs) (drop j ys); \<lbrakk>\<not> length xs \<le> i; \<not> length ys \<le> j\<rbrakk> \<Longrightarrow> min_ed_ix' xs ys (length xs) (length ys) (i + 1, j + 1) = min_ed (drop (i + 1) xs) (drop (j + 1) ys)\<rbrakk> \<Longrightarrow> (if length xs \<le> i then if length ys \<le> j then 0 else 1 + min_ed_ix' xs ys (length xs) (length ys) (i, j + 1) else if length ys \<le> j then 1 + min_ed_ix' xs ys (length xs) (length ys) (i + 1, j) else Min {1 + min_ed_ix' xs ys (length xs) (length ys) (i, j + 1), 1 + min_ed_ix' xs ys (length xs) (length ys) (i + 1, j), (if xs ! i = ys ! j then 0 else 1) + min_ed_ix' xs ys (length xs) (length ys) (i + 1, j + 1)}) = min_ed (drop i xs) (drop j ys)
[PROOF STEP]
apply(simp add: Cons_nth_drop_Suc[symmetric])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma simple_integral_completion:
  "simple_function M f \<Longrightarrow> simple_integral (completion M) f = simple_integral M f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. simple_function M f \<Longrightarrow> integral\<^sup>S (completion M) f = integral\<^sup>S M f
[PROOF STEP]
unfolding simple_integral_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. simple_function M f \<Longrightarrow> (\<Sum>x\<in>f ` space (completion M). x * emeasure (completion M) (f -` {x} \<inter> space (completion M))) = (\<Sum>x\<in>f ` space M. x * emeasure M (f -` {x} \<inter> space M))
[PROOF STEP]
by simp


[STATEMENT]
lemma convex_hull_caratheodory_aff_dim:
  fixes p :: "('a::euclidean_space) set"
  shows "convex hull p =
    {y. \<exists>S u. finite S \<and> S \<subseteq> p \<and> card S \<le> aff_dim p + 1 \<and>
        (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> sum (\<lambda>v. u v *\<^sub>R v) S = y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex hull p = {y. \<exists>S u. finite S \<and> S \<subseteq> p \<and> int (card S) \<le> aff_dim p + 1 \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = y}
[PROOF STEP]
unfolding convex_hull_explicit set_eq_iff mem_Collect_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. (\<exists>S u. finite S \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = x) = (\<exists>S u. finite S \<and> S \<subseteq> p \<and> int (card S) \<le> aff_dim p + 1 \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = x)
[PROOF STEP]
proof (intro allI iffI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. \<exists>S u. finite S \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = x \<Longrightarrow> \<exists>S u. finite S \<and> S \<subseteq> p \<and> int (card S) \<le> aff_dim p + 1 \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = x
 2. \<And>x. \<exists>S u. finite S \<and> S \<subseteq> p \<and> int (card S) \<le> aff_dim p + 1 \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = x \<Longrightarrow> \<exists>S u. finite S \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = x
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. \<exists>S u. finite S \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = x \<Longrightarrow> \<exists>S u. finite S \<and> S \<subseteq> p \<and> int (card S) \<le> aff_dim p + 1 \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = x
 2. \<And>x. \<exists>S u. finite S \<and> S \<subseteq> p \<and> int (card S) \<le> aff_dim p + 1 \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = x \<Longrightarrow> \<exists>S u. finite S \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = x
[PROOF STEP]
let ?P = "\<lambda>n. \<exists>S u. finite S \<and> card S = n \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and>
    sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = y"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. \<exists>S u. finite S \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = x \<Longrightarrow> \<exists>S u. finite S \<and> S \<subseteq> p \<and> int (card S) \<le> aff_dim p + 1 \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = x
 2. \<And>x. \<exists>S u. finite S \<and> S \<subseteq> p \<and> int (card S) \<le> aff_dim p + 1 \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = x \<Longrightarrow> \<exists>S u. finite S \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = x
[PROOF STEP]
assume "\<exists>S u. finite S \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = y"
[PROOF STATE]
proof (state)
this:
\<exists>S u. finite S \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = y

goal (2 subgoals):
 1. \<And>x. \<exists>S u. finite S \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = x \<Longrightarrow> \<exists>S u. finite S \<and> S \<subseteq> p \<and> int (card S) \<le> aff_dim p + 1 \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = x
 2. \<And>x. \<exists>S u. finite S \<and> S \<subseteq> p \<and> int (card S) \<le> aff_dim p + 1 \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = x \<Longrightarrow> \<exists>S u. finite S \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>S u. finite S \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = y
[PROOF STEP]
obtain N where "?P N"
[PROOF STATE]
proof (prove)
using this:
\<exists>S u. finite S \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = y

goal (1 subgoal):
 1. (\<And>N. \<exists>S u. finite S \<and> card S = N \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = y \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>S u. finite S \<and> card S = N \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = y

goal (2 subgoals):
 1. \<And>x. \<exists>S u. finite S \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = x \<Longrightarrow> \<exists>S u. finite S \<and> S \<subseteq> p \<and> int (card S) \<le> aff_dim p + 1 \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = x
 2. \<And>x. \<exists>S u. finite S \<and> S \<subseteq> p \<and> int (card S) \<le> aff_dim p + 1 \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = x \<Longrightarrow> \<exists>S u. finite S \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>S u. finite S \<and> card S = N \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = y
[PROOF STEP]
have "\<exists>n\<le>N. (\<forall>k<n. \<not> ?P k) \<and> ?P n"
[PROOF STATE]
proof (prove)
using this:
\<exists>S u. finite S \<and> card S = N \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = y

goal (1 subgoal):
 1. \<exists>n\<le>N. (\<forall>k<n. \<nexists>S u. finite S \<and> card S = k \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = y) \<and> (\<exists>S u. finite S \<and> card S = n \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = y)
[PROOF STEP]
by (rule_tac ex_least_nat_le, auto)
[PROOF STATE]
proof (state)
this:
\<exists>n\<le>N. (\<forall>k<n. \<nexists>S u. finite S \<and> card S = k \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = y) \<and> (\<exists>S u. finite S \<and> card S = n \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = y)

goal (2 subgoals):
 1. \<And>x. \<exists>S u. finite S \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = x \<Longrightarrow> \<exists>S u. finite S \<and> S \<subseteq> p \<and> int (card S) \<le> aff_dim p + 1 \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = x
 2. \<And>x. \<exists>S u. finite S \<and> S \<subseteq> p \<and> int (card S) \<le> aff_dim p + 1 \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = x \<Longrightarrow> \<exists>S u. finite S \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>n\<le>N. (\<forall>k<n. \<nexists>S u. finite S \<and> card S = k \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = y) \<and> (\<exists>S u. finite S \<and> card S = n \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = y)
[PROOF STEP]
obtain n where "?P n" and smallest: "\<forall>k<n. \<not> ?P k"
[PROOF STATE]
proof (prove)
using this:
\<exists>n\<le>N. (\<forall>k<n. \<nexists>S u. finite S \<and> card S = k \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = y) \<and> (\<exists>S u. finite S \<and> card S = n \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = y)

goal (1 subgoal):
 1. (\<And>n. \<lbrakk>\<exists>S u. finite S \<and> card S = n \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = y; \<forall>k<n. \<nexists>S u. finite S \<and> card S = k \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>S u. finite S \<and> card S = n \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = y
\<forall>k<n. \<nexists>S u. finite S \<and> card S = k \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = y

goal (2 subgoals):
 1. \<And>x. \<exists>S u. finite S \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = x \<Longrightarrow> \<exists>S u. finite S \<and> S \<subseteq> p \<and> int (card S) \<le> aff_dim p + 1 \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = x
 2. \<And>x. \<exists>S u. finite S \<and> S \<subseteq> p \<and> int (card S) \<le> aff_dim p + 1 \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = x \<Longrightarrow> \<exists>S u. finite S \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>S u. finite S \<and> card S = n \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = y
\<forall>k<n. \<nexists>S u. finite S \<and> card S = k \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = y
[PROOF STEP]
obtain S u where obt: "finite S" "card S = n" "S\<subseteq>p" "\<forall>x\<in>S. 0 \<le> u x"
    "sum u S = 1"  "(\<Sum>v\<in>S. u v *\<^sub>R v) = y"
[PROOF STATE]
proof (prove)
using this:
\<exists>S u. finite S \<and> card S = n \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = y
\<forall>k<n. \<nexists>S u. finite S \<and> card S = k \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = y

goal (1 subgoal):
 1. (\<And>S u. \<lbrakk>finite S; card S = n; S \<subseteq> p; \<forall>x\<in>S. 0 \<le> u x; sum u S = 1; (\<Sum>v\<in>S. u v *\<^sub>R v) = y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite S
card S = n
S \<subseteq> p
\<forall>x\<in>S. 0 \<le> u x
sum u S = 1
(\<Sum>v\<in>S. u v *\<^sub>R v) = y

goal (2 subgoals):
 1. \<And>x. \<exists>S u. finite S \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = x \<Longrightarrow> \<exists>S u. finite S \<and> S \<subseteq> p \<and> int (card S) \<le> aff_dim p + 1 \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = x
 2. \<And>x. \<exists>S u. finite S \<and> S \<subseteq> p \<and> int (card S) \<le> aff_dim p + 1 \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = x \<Longrightarrow> \<exists>S u. finite S \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = x
[PROOF STEP]
have "card S \<le> aff_dim p + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (card S) \<le> aff_dim p + 1
[PROOF STEP]
proof (rule ccontr, simp only: not_le)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. aff_dim p + 1 < int (card S) \<Longrightarrow> False
[PROOF STEP]
assume "aff_dim p + 1 < card S"
[PROOF STATE]
proof (state)
this:
aff_dim p + 1 < int (card S)

goal (1 subgoal):
 1. aff_dim p + 1 < int (card S) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
aff_dim p + 1 < int (card S)
[PROOF STEP]
have "affine_dependent S"
[PROOF STATE]
proof (prove)
using this:
aff_dim p + 1 < int (card S)

goal (1 subgoal):
 1. affine_dependent S
[PROOF STEP]
using affine_dependent_biggerset[OF obt(1)] independent_card_le_aff_dim not_less obt(3)
[PROOF STATE]
proof (prove)
using this:
aff_dim p + 1 < int (card S)
DIM('a) + 2 \<le> card S \<Longrightarrow> affine_dependent S
\<lbrakk>?B \<subseteq> ?V; \<not> affine_dependent ?B\<rbrakk> \<Longrightarrow> int (card ?B) \<le> aff_dim ?V + 1
(\<not> ?x < ?y) = (?y \<le> ?x)
S \<subseteq> p

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

goal (1 subgoal):
 1. aff_dim p + 1 < int (card S) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
affine_dependent S
[PROOF STEP]
obtain w v where wv: "sum w S = 0" "v\<in>S" "w v \<noteq> 0" "(\<Sum>v\<in>S. w v *\<^sub>R v) = 0"
[PROOF STATE]
proof (prove)
using this:
affine_dependent S

goal (1 subgoal):
 1. (\<And>w v. \<lbrakk>sum w S = 0; v \<in> S; w v \<noteq> 0; (\<Sum>v\<in>S. w v *\<^sub>R v) = (0::'a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using affine_dependent_explicit_finite[OF obt(1)]
[PROOF STATE]
proof (prove)
using this:
affine_dependent S
affine_dependent S = (\<exists>u. sum u S = 0 \<and> (\<exists>v\<in>S. u v \<noteq> 0) \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = (0::'a))

goal (1 subgoal):
 1. (\<And>w v. \<lbrakk>sum w S = 0; v \<in> S; w v \<noteq> 0; (\<Sum>v\<in>S. w v *\<^sub>R v) = (0::'a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sum w S = 0
v \<in> S
w v \<noteq> 0
(\<Sum>v\<in>S. w v *\<^sub>R v) = (0::'a)

goal (1 subgoal):
 1. aff_dim p + 1 < int (card S) \<Longrightarrow> False
[PROOF STEP]
define i where "i = (\<lambda>v. (u v) / (- w v)) ` {v\<in>S. w v < 0}"
[PROOF STATE]
proof (state)
this:
i = (\<lambda>v. u v / - w v) ` {v \<in> S. w v < 0}

goal (1 subgoal):
 1. aff_dim p + 1 < int (card S) \<Longrightarrow> False
[PROOF STEP]
define t where "t = Min i"
[PROOF STATE]
proof (state)
this:
t = Min i

goal (1 subgoal):
 1. aff_dim p + 1 < int (card S) \<Longrightarrow> False
[PROOF STEP]
have "\<exists>x\<in>S. w x < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x\<in>S. w x < 0
[PROOF STEP]
proof (rule ccontr, simp add: not_less)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>x\<in>S. 0 \<le> w x \<Longrightarrow> False
[PROOF STEP]
assume as:"\<forall>x\<in>S. 0 \<le> w x"
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>S. 0 \<le> w x

goal (1 subgoal):
 1. \<forall>x\<in>S. 0 \<le> w x \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>S. 0 \<le> w x
[PROOF STEP]
have "sum w (S - {v}) \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>S. 0 \<le> w x

goal (1 subgoal):
 1. 0 \<le> sum w (S - {v})
[PROOF STEP]
by (meson Diff_iff sum_nonneg)
[PROOF STATE]
proof (state)
this:
0 \<le> sum w (S - {v})

goal (1 subgoal):
 1. \<forall>x\<in>S. 0 \<le> w x \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 \<le> sum w (S - {v})
[PROOF STEP]
have "sum w S > 0"
[PROOF STATE]
proof (prove)
using this:
0 \<le> sum w (S - {v})

goal (1 subgoal):
 1. 0 < sum w S
[PROOF STEP]
using as obt(1) sum_nonneg_eq_0_iff wv
[PROOF STATE]
proof (prove)
using this:
0 \<le> sum w (S - {v})
\<forall>x\<in>S. 0 \<le> w x
finite S
\<lbrakk>finite ?A; \<And>x. x \<in> ?A \<Longrightarrow> (0::?'a) \<le> ?f x\<rbrakk> \<Longrightarrow> (sum ?f ?A = (0::?'a)) = (\<forall>x\<in>?A. ?f x = (0::?'a))
sum w S = 0
v \<in> S
w v \<noteq> 0
(\<Sum>v\<in>S. w v *\<^sub>R v) = (0::'a)

goal (1 subgoal):
 1. 0 < sum w S
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
0 < sum w S

goal (1 subgoal):
 1. \<forall>x\<in>S. 0 \<le> w x \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < sum w S
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
0 < sum w S

goal (1 subgoal):
 1. False
[PROOF STEP]
using wv(1)
[PROOF STATE]
proof (prove)
using this:
0 < sum w S
sum w S = 0

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>x\<in>S. w x < 0

goal (1 subgoal):
 1. aff_dim p + 1 < int (card S) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>x\<in>S. w x < 0
[PROOF STEP]
have "i \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
\<exists>x\<in>S. w x < 0

goal (1 subgoal):
 1. i \<noteq> {}
[PROOF STEP]
unfolding i_def
[PROOF STATE]
proof (prove)
using this:
\<exists>x\<in>S. w x < 0

goal (1 subgoal):
 1. (\<lambda>v. u v / - w v) ` {v \<in> S. w v < 0} \<noteq> {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i \<noteq> {}

goal (1 subgoal):
 1. aff_dim p + 1 < int (card S) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i \<noteq> {}
[PROOF STEP]
have "t \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
i \<noteq> {}

goal (1 subgoal):
 1. 0 \<le> t
[PROOF STEP]
using Min_ge_iff[of i 0] and obt(1)
[PROOF STATE]
proof (prove)
using this:
i \<noteq> {}
\<lbrakk>finite i; i \<noteq> {}\<rbrakk> \<Longrightarrow> (0 \<le> Min i) = (\<forall>a\<in>i. 0 \<le> a)
finite S

goal (1 subgoal):
 1. 0 \<le> t
[PROOF STEP]
unfolding t_def i_def
[PROOF STATE]
proof (prove)
using this:
(\<lambda>v. u v / - w v) ` {v \<in> S. w v < 0} \<noteq> {}
\<lbrakk>finite ((\<lambda>v. u v / - w v) ` {v \<in> S. w v < 0}); (\<lambda>v. u v / - w v) ` {v \<in> S. w v < 0} \<noteq> {}\<rbrakk> \<Longrightarrow> (0 \<le> (MIN v\<in>{v \<in> S. w v < 0}. u v / - w v)) = (\<forall>a\<in>(\<lambda>v. u v / - w v) ` {v \<in> S. w v < 0}. 0 \<le> a)
finite S

goal (1 subgoal):
 1. 0 \<le> (MIN v\<in>{v \<in> S. w v < 0}. u v / - w v)
[PROOF STEP]
using obt(4)[unfolded le_less]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>v. u v / - w v) ` {v \<in> S. w v < 0} \<noteq> {}
\<lbrakk>finite ((\<lambda>v. u v / - w v) ` {v \<in> S. w v < 0}); (\<lambda>v. u v / - w v) ` {v \<in> S. w v < 0} \<noteq> {}\<rbrakk> \<Longrightarrow> (0 \<le> (MIN v\<in>{v \<in> S. w v < 0}. u v / - w v)) = (\<forall>a\<in>(\<lambda>v. u v / - w v) ` {v \<in> S. w v < 0}. 0 \<le> a)
finite S
\<forall>x\<in>S. 0 < u x \<or> 0 = u x

goal (1 subgoal):
 1. 0 \<le> (MIN v\<in>{v \<in> S. w v < 0}. u v / - w v)
[PROOF STEP]
by (auto simp: divide_le_0_iff)
[PROOF STATE]
proof (state)
this:
0 \<le> t

goal (1 subgoal):
 1. aff_dim p + 1 < int (card S) \<Longrightarrow> False
[PROOF STEP]
have t: "\<forall>v\<in>S. u v + t * w v \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>v\<in>S. 0 \<le> u v + t * w v
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>v. v \<in> S \<Longrightarrow> 0 \<le> u v + t * w v
[PROOF STEP]
fix v
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>v. v \<in> S \<Longrightarrow> 0 \<le> u v + t * w v
[PROOF STEP]
assume "v \<in> S"
[PROOF STATE]
proof (state)
this:
v \<in> S

goal (1 subgoal):
 1. \<And>v. v \<in> S \<Longrightarrow> 0 \<le> u v + t * w v
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
v \<in> S
[PROOF STEP]
have v: "0 \<le> u v"
[PROOF STATE]
proof (prove)
using this:
v \<in> S

goal (1 subgoal):
 1. 0 \<le> u v
[PROOF STEP]
using obt(4)[THEN bspec[where x=v]]
[PROOF STATE]
proof (prove)
using this:
v \<in> S
v \<in> S \<Longrightarrow> 0 \<le> u v

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

goal (1 subgoal):
 1. \<And>v. v \<in> S \<Longrightarrow> 0 \<le> u v + t * w v
[PROOF STEP]
show "0 \<le> u v + t * w v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> u v + t * w v
[PROOF STEP]
proof (cases "w v < 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. w v < 0 \<Longrightarrow> 0 \<le> u v + t * w v
 2. \<not> w v < 0 \<Longrightarrow> 0 \<le> u v + t * w v
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> w v < 0

goal (2 subgoals):
 1. w v < 0 \<Longrightarrow> 0 \<le> u v + t * w v
 2. \<not> w v < 0 \<Longrightarrow> 0 \<le> u v + t * w v
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> w v < 0

goal (1 subgoal):
 1. 0 \<le> u v + t * w v
[PROOF STEP]
using v \<open>t\<ge>0\<close>
[PROOF STATE]
proof (prove)
using this:
\<not> w v < 0
0 \<le> u v
0 \<le> t

goal (1 subgoal):
 1. 0 \<le> u v + t * w v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> u v + t * w v

goal (1 subgoal):
 1. w v < 0 \<Longrightarrow> 0 \<le> u v + t * w v
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. w v < 0 \<Longrightarrow> 0 \<le> u v + t * w v
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
w v < 0

goal (1 subgoal):
 1. w v < 0 \<Longrightarrow> 0 \<le> u v + t * w v
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
w v < 0
[PROOF STEP]
have "t \<le> u v / (- w v)"
[PROOF STATE]
proof (prove)
using this:
w v < 0

goal (1 subgoal):
 1. t \<le> u v / - w v
[PROOF STEP]
using \<open>v\<in>S\<close> obt
[PROOF STATE]
proof (prove)
using this:
w v < 0
v \<in> S
finite S
card S = n
S \<subseteq> p
\<forall>x\<in>S. 0 \<le> u x
sum u S = 1
(\<Sum>v\<in>S. u v *\<^sub>R v) = y

goal (1 subgoal):
 1. t \<le> u v / - w v
[PROOF STEP]
unfolding t_def i_def
[PROOF STATE]
proof (prove)
using this:
w v < 0
v \<in> S
finite S
card S = n
S \<subseteq> p
\<forall>x\<in>S. 0 \<le> u x
sum u S = 1
(\<Sum>v\<in>S. u v *\<^sub>R v) = y

goal (1 subgoal):
 1. (MIN v\<in>{v \<in> S. w v < 0}. u v / - w v) \<le> u v / - w v
[PROOF STEP]
by (auto intro: Min_le)
[PROOF STATE]
proof (state)
this:
t \<le> u v / - w v

goal (1 subgoal):
 1. w v < 0 \<Longrightarrow> 0 \<le> u v + t * w v
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
t \<le> u v / - w v
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
t \<le> u v / - w v

goal (1 subgoal):
 1. 0 \<le> u v + t * w v
[PROOF STEP]
unfolding real_0_le_add_iff
[PROOF STATE]
proof (prove)
using this:
t \<le> u v / - w v

goal (1 subgoal):
 1. - u v \<le> t * w v
[PROOF STEP]
using True neg_le_minus_divide_eq
[PROOF STATE]
proof (prove)
using this:
t \<le> u v / - w v
w v < 0
?c < (0::?'a) \<Longrightarrow> (?a \<le> - (?b / ?c)) = (- ?b \<le> ?a * ?c)

goal (1 subgoal):
 1. - u v \<le> t * w v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> u v + t * w v

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 \<le> u v + t * w v

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>v\<in>S. 0 \<le> u v + t * w v

goal (1 subgoal):
 1. aff_dim p + 1 < int (card S) \<Longrightarrow> False
[PROOF STEP]
obtain a where "a \<in> S" and "t = (\<lambda>v. (u v) / (- w v)) a" and "w a < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a. \<lbrakk>a \<in> S; t = u a / - w a; w a < 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using Min_in[OF _ \<open>i\<noteq>{}\<close>] and obt(1)
[PROOF STATE]
proof (prove)
using this:
finite i \<Longrightarrow> Min i \<in> i
finite S

goal (1 subgoal):
 1. (\<And>a. \<lbrakk>a \<in> S; t = u a / - w a; w a < 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding i_def t_def
[PROOF STATE]
proof (prove)
using this:
finite ((\<lambda>v. u v / - w v) ` {v \<in> S. w v < 0}) \<Longrightarrow> (MIN v\<in>{v \<in> S. w v < 0}. u v / - w v) \<in> (\<lambda>v. u v / - w v) ` {v \<in> S. w v < 0}
finite S

goal (1 subgoal):
 1. (\<And>a. \<lbrakk>a \<in> S; (MIN v\<in>{v \<in> S. w v < 0}. u v / - w v) = u a / - w a; w a < 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a \<in> S
t = u a / - w a
w a < 0

goal (1 subgoal):
 1. aff_dim p + 1 < int (card S) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<in> S
t = u a / - w a
w a < 0
[PROOF STEP]
have a: "a \<in> S" "u a + t * w a = 0"
[PROOF STATE]
proof (prove)
using this:
a \<in> S
t = u a / - w a
w a < 0

goal (1 subgoal):
 1. a \<in> S &&& u a + t * w a = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a \<in> S
u a + t * w a = 0

goal (1 subgoal):
 1. aff_dim p + 1 < int (card S) \<Longrightarrow> False
[PROOF STEP]
have *: "\<And>f. sum f (S - {a}) = sum f S - ((f a)::'b::ab_group_add)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f. sum f (S - {a}) = sum f S - f a
[PROOF STEP]
unfolding sum.remove[OF obt(1) \<open>a\<in>S\<close>]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f. sum f (S - {a}) = f a + sum f (S - {a}) - f a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sum ?f (S - {a}) = sum ?f S - ?f a

goal (1 subgoal):
 1. aff_dim p + 1 < int (card S) \<Longrightarrow> False
[PROOF STEP]
have "(\<Sum>v\<in>S. u v + t * w v) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>v\<in>S. u v + t * w v) = 1
[PROOF STEP]
unfolding sum.distrib wv(1) sum_distrib_left[symmetric] obt(5)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 + t * 0 = 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>v\<in>S. u v + t * w v) = 1

goal (1 subgoal):
 1. aff_dim p + 1 < int (card S) \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<Sum>v\<in>S. u v + t * w v) = 1

goal (1 subgoal):
 1. aff_dim p + 1 < int (card S) \<Longrightarrow> False
[PROOF STEP]
have "(\<Sum>v\<in>S. u v *\<^sub>R v + (t * w v) *\<^sub>R v) - (u a *\<^sub>R a + (t * w a) *\<^sub>R a) = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>v\<in>S. u v *\<^sub>R v + (t * w v) *\<^sub>R v) - (u a *\<^sub>R a + (t * w a) *\<^sub>R a) = y
[PROOF STEP]
unfolding sum.distrib obt(6) scaleR_scaleR[symmetric] scaleR_right.sum [symmetric] wv(4)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y + t *\<^sub>R (0::'a) - (u a *\<^sub>R a + t *\<^sub>R w a *\<^sub>R a) = y
[PROOF STEP]
using a(2) [THEN eq_neg_iff_add_eq_0 [THEN iffD2]]
[PROOF STATE]
proof (prove)
using this:
u a = - (t * w a)

goal (1 subgoal):
 1. y + t *\<^sub>R (0::'a) - (u a *\<^sub>R a + t *\<^sub>R w a *\<^sub>R a) = y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>v\<in>S. u v *\<^sub>R v + (t * w v) *\<^sub>R v) - (u a *\<^sub>R a + (t * w a) *\<^sub>R a) = y

goal (1 subgoal):
 1. aff_dim p + 1 < int (card S) \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>v\<in>S. u v + t * w v) = 1
(\<Sum>v\<in>S. u v *\<^sub>R v + (t * w v) *\<^sub>R v) - (u a *\<^sub>R a + (t * w a) *\<^sub>R a) = y
[PROOF STEP]
have "?P (n - 1)"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>v\<in>S. u v + t * w v) = 1
(\<Sum>v\<in>S. u v *\<^sub>R v + (t * w v) *\<^sub>R v) - (u a *\<^sub>R a + (t * w a) *\<^sub>R a) = y

goal (1 subgoal):
 1. \<exists>S u. finite S \<and> card S = n - 1 \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = y
[PROOF STEP]
apply (rule_tac x="(S - {a})" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(\<Sum>v\<in>S. u v + t * w v) = 1; (\<Sum>v\<in>S. u v *\<^sub>R v + (t * w v) *\<^sub>R v) - (u a *\<^sub>R a + (t * w a) *\<^sub>R a) = y\<rbrakk> \<Longrightarrow> \<exists>u. finite (S - {a}) \<and> card (S - {a}) = n - 1 \<and> S - {a} \<subseteq> p \<and> (\<forall>x\<in>S - {a}. 0 \<le> u x) \<and> sum u (S - {a}) = 1 \<and> (\<Sum>v\<in>S - {a}. u v *\<^sub>R v) = y
[PROOF STEP]
apply (rule_tac x="\<lambda>v. u v + t * w v" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(\<Sum>v\<in>S. u v + t * w v) = 1; (\<Sum>v\<in>S. u v *\<^sub>R v + (t * w v) *\<^sub>R v) - (u a *\<^sub>R a + (t * w a) *\<^sub>R a) = y\<rbrakk> \<Longrightarrow> finite (S - {a}) \<and> card (S - {a}) = n - 1 \<and> S - {a} \<subseteq> p \<and> (\<forall>x\<in>S - {a}. 0 \<le> u x + t * w x) \<and> (\<Sum>v\<in>S - {a}. u v + t * w v) = 1 \<and> (\<Sum>v\<in>S - {a}. (u v + t * w v) *\<^sub>R v) = y
[PROOF STEP]
using obt(1-3) and t and a
[PROOF STATE]
proof (prove)
using this:
finite S
card S = n
S \<subseteq> p
\<forall>v\<in>S. 0 \<le> u v + t * w v
a \<in> S
u a + t * w a = 0

goal (1 subgoal):
 1. \<lbrakk>(\<Sum>v\<in>S. u v + t * w v) = 1; (\<Sum>v\<in>S. u v *\<^sub>R v + (t * w v) *\<^sub>R v) - (u a *\<^sub>R a + (t * w a) *\<^sub>R a) = y\<rbrakk> \<Longrightarrow> finite (S - {a}) \<and> card (S - {a}) = n - 1 \<and> S - {a} \<subseteq> p \<and> (\<forall>x\<in>S - {a}. 0 \<le> u x + t * w x) \<and> (\<Sum>v\<in>S - {a}. u v + t * w v) = 1 \<and> (\<Sum>v\<in>S - {a}. (u v + t * w v) *\<^sub>R v) = y
[PROOF STEP]
apply (auto simp: * scaleR_left_distrib)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<exists>S u. finite S \<and> card S = n - 1 \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = y

goal (1 subgoal):
 1. aff_dim p + 1 < int (card S) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>S u. finite S \<and> card S = n - 1 \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = y
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
\<exists>S u. finite S \<and> card S = n - 1 \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = y

goal (1 subgoal):
 1. False
[PROOF STEP]
using smallest[THEN spec[where x="n - 1"]]
[PROOF STATE]
proof (prove)
using this:
\<exists>S u. finite S \<and> card S = n - 1 \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = y
n - 1 < n \<longrightarrow> (\<nexists>S u. finite S \<and> card S = n - 1 \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = y)

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
int (card S) \<le> aff_dim p + 1

goal (2 subgoals):
 1. \<And>x. \<exists>S u. finite S \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = x \<Longrightarrow> \<exists>S u. finite S \<and> S \<subseteq> p \<and> int (card S) \<le> aff_dim p + 1 \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = x
 2. \<And>x. \<exists>S u. finite S \<and> S \<subseteq> p \<and> int (card S) \<le> aff_dim p + 1 \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = x \<Longrightarrow> \<exists>S u. finite S \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
int (card S) \<le> aff_dim p + 1
[PROOF STEP]
show "\<exists>S u. finite S \<and> S \<subseteq> p \<and> card S \<le> aff_dim p + 1 \<and>
      (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = y"
[PROOF STATE]
proof (prove)
using this:
int (card S) \<le> aff_dim p + 1

goal (1 subgoal):
 1. \<exists>S u. finite S \<and> S \<subseteq> p \<and> int (card S) \<le> aff_dim p + 1 \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = y
[PROOF STEP]
using obt
[PROOF STATE]
proof (prove)
using this:
int (card S) \<le> aff_dim p + 1
finite S
card S = n
S \<subseteq> p
\<forall>x\<in>S. 0 \<le> u x
sum u S = 1
(\<Sum>v\<in>S. u v *\<^sub>R v) = y

goal (1 subgoal):
 1. \<exists>S u. finite S \<and> S \<subseteq> p \<and> int (card S) \<le> aff_dim p + 1 \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>S u. finite S \<and> S \<subseteq> p \<and> int (card S) \<le> aff_dim p + 1 \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = y

goal (1 subgoal):
 1. \<And>x. \<exists>S u. finite S \<and> S \<subseteq> p \<and> int (card S) \<le> aff_dim p + 1 \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = x \<Longrightarrow> \<exists>S u. finite S \<and> S \<subseteq> p \<and> (\<forall>x\<in>S. 0 \<le> u x) \<and> sum u S = 1 \<and> (\<Sum>v\<in>S. u v *\<^sub>R v) = x
[PROOF STEP]
qed auto


[STATEMENT]
lemma ordertype_WW_2: "ordertype UNIV (lenlex less_than) \<le> \<omega>\<up>\<omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordertype UNIV (lenlex less_than) \<le> \<omega> \<up> \<omega>
[PROOF STEP]
proof (rule ordertype_inc_le_Ord)
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. small UNIV
 2. Ord (\<omega> \<up> \<omega>)
 3. \<And>x y. \<lbrakk>x \<in> UNIV; y \<in> UNIV; (x, y) \<in> lenlex less_than\<rbrakk> \<Longrightarrow> ?\<pi> x < ?\<pi> y
 4. wf (lenlex less_than)
 5. total (lenlex less_than)
 6. range ?\<pi> \<subseteq> elts (\<omega> \<up> \<omega>)
[PROOF STEP]
show "range (\<lambda>ms. omega_sum (1#ms)) \<subseteq> elts (\<omega>\<up>\<omega>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. range (\<lambda>ms. omega_sum (1 # ms)) \<subseteq> elts (\<omega> \<up> \<omega>)
[PROOF STEP]
by (meson Ord_\<omega> Ord_mem_iff_lt Ord_oexp Ord_omega_sum image_subset_iff omega_sum_less_\<omega>\<omega>)
[PROOF STATE]
proof (state)
this:
range (\<lambda>ms. omega_sum (1 # ms)) \<subseteq> elts (\<omega> \<up> \<omega>)

goal (5 subgoals):
 1. small UNIV
 2. Ord (\<omega> \<up> \<omega>)
 3. \<And>x y. \<lbrakk>x \<in> UNIV; y \<in> UNIV; (x, y) \<in> lenlex less_than\<rbrakk> \<Longrightarrow> omega_sum (1 # x) < omega_sum (1 # y)
 4. wf (lenlex less_than)
 5. total (lenlex less_than)
[PROOF STEP]
qed (use omega_sum_1_less in auto)


[STATEMENT]
lemma ChiPlus_ChiRel_Ex [rule_format]:
  "\<lbrakk> (S,T) \<in> ChiPlus A \<rbrakk> \<Longrightarrow> (S,T) \<notin> ChiRel A \<longrightarrow>
    (\<exists> U. (S,U) \<in> ChiPlus A \<and> (U,T) \<in> ChiRel A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (S, T) \<in> ChiPlus A \<Longrightarrow> (S, T) \<notin> ChiRel A \<longrightarrow> (\<exists>U. (S, U) \<in> ChiPlus A \<and> (U, T) \<in> ChiRel A)
[PROOF STEP]
apply (unfold ChiPlus_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (S, T) \<in> (ChiRel A)\<^sup>+ \<Longrightarrow> (S, T) \<notin> ChiRel A \<longrightarrow> (\<exists>U. (S, U) \<in> (ChiRel A)\<^sup>+ \<and> (U, T) \<in> ChiRel A)
[PROOF STEP]
apply (rule_tac a="S" and b="T" and r="(ChiRel A)" in converse_trancl_induct)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. (S, T) \<in> (ChiRel A)\<^sup>+ \<Longrightarrow> (S, T) \<in> (ChiRel A)\<^sup>+
 2. \<And>y. \<lbrakk>(S, T) \<in> (ChiRel A)\<^sup>+; (y, T) \<in> ChiRel A\<rbrakk> \<Longrightarrow> (y, T) \<notin> ChiRel A \<longrightarrow> (\<exists>U. (y, U) \<in> (ChiRel A)\<^sup>+ \<and> (U, T) \<in> ChiRel A)
 3. \<And>y z. \<lbrakk>(S, T) \<in> (ChiRel A)\<^sup>+; (y, z) \<in> ChiRel A; (z, T) \<in> (ChiRel A)\<^sup>+; (z, T) \<notin> ChiRel A \<longrightarrow> (\<exists>U. (z, U) \<in> (ChiRel A)\<^sup>+ \<and> (U, T) \<in> ChiRel A)\<rbrakk> \<Longrightarrow> (y, T) \<notin> ChiRel A \<longrightarrow> (\<exists>U. (y, U) \<in> (ChiRel A)\<^sup>+ \<and> (U, T) \<in> ChiRel A)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y z U. \<lbrakk>(S, T) \<in> (ChiRel A)\<^sup>+; (y, z) \<in> ChiRel A; (z, T) \<in> (ChiRel A)\<^sup>+; (y, T) \<notin> ChiRel A; (z, U) \<in> (ChiRel A)\<^sup>+; (U, T) \<in> ChiRel A\<rbrakk> \<Longrightarrow> \<exists>U. (y, U) \<in> (ChiRel A)\<^sup>+ \<and> (U, T) \<in> ChiRel A
[PROOF STEP]
apply (rename_tac U)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y z U. \<lbrakk>(S, T) \<in> (ChiRel A)\<^sup>+; (y, z) \<in> ChiRel A; (z, T) \<in> (ChiRel A)\<^sup>+; (y, T) \<notin> ChiRel A; (z, U) \<in> (ChiRel A)\<^sup>+; (U, T) \<in> ChiRel A\<rbrakk> \<Longrightarrow> \<exists>U. (y, U) \<in> (ChiRel A)\<^sup>+ \<and> (U, T) \<in> ChiRel A
[PROOF STEP]
apply (rule_tac x=U in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y z U. \<lbrakk>(S, T) \<in> (ChiRel A)\<^sup>+; (y, z) \<in> ChiRel A; (z, T) \<in> (ChiRel A)\<^sup>+; (y, T) \<notin> ChiRel A; (z, U) \<in> (ChiRel A)\<^sup>+; (U, T) \<in> ChiRel A\<rbrakk> \<Longrightarrow> (y, U) \<in> (ChiRel A)\<^sup>+ \<and> (U, T) \<in> ChiRel A
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma in_close_world_conv:
    "\<phi> \<in> close_world M \<longleftrightarrow> (
        \<phi>\<in>M
      \<or> (\<exists>p as. \<phi>=\<^bold>\<not>(Atom (predAtm p as)) \<and> Atom (predAtm p as)\<notin>M)
      \<or> (\<exists>a. \<phi>=Atom (Eq a a))
      \<or> (\<exists>a b. \<phi>=\<^bold>\<not>(Atom (Eq a b)) \<and> a\<noteq>b)
    )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<phi> \<in> close_world M) = (\<phi> \<in> M \<or> (\<exists>p as. \<phi> = \<^bold>\<not> (Atom (predAtm p as)) \<and> Atom (predAtm p as) \<notin> M) \<or> (\<exists>a. \<phi> = Atom (Eq a a)) \<or> (\<exists>a b. \<phi> = \<^bold>\<not> (Atom (Eq a b)) \<and> a \<noteq> b))
[PROOF STEP]
by (auto simp: close_world_def)


[STATEMENT]
lemma "(\<exists>y. \<forall>x. F x y = F x x) \<longrightarrow>
             \<not>(\<forall>x. \<exists>y. \<forall>z. F z y = (\<not> F z x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>y. \<forall>x. F x y = F x x) \<longrightarrow> \<not> (\<forall>x. \<exists>y. \<forall>z. F z y = (\<not> F z x))
[PROOF STEP]
by iprover


[STATEMENT]
lemma deriv_ln_Gamma_complex:
  assumes "z \<notin> \<real>\<^sub>\<le>\<^sub>0"
  shows   "deriv ln_Gamma z = Digamma (z :: complex)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deriv ln_Gamma z = Digamma z
[PROOF STEP]
by (intro DERIV_imp_deriv has_field_derivative_ln_Gamma_complex assms)


[STATEMENT]
lemma sum_up_index_split':
  assumes "N \<le> n" shows "(\<Sum>i\<le>n. f i) = (\<Sum>i\<le>n-N. f i) + (\<Sum>i=Suc (n-N)..n. f i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {..n} = sum f {..n - N} + sum f {Suc (n - N)..n}
[PROOF STEP]
by (metis assms diff_add sum_up_index_split)


[STATEMENT]
lemma lepoll_trans1 [trans]: "\<lbrakk>A \<approx> B; B \<lesssim> C\<rbrakk> \<Longrightarrow> A \<lesssim> C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<approx> B; B \<lesssim> C\<rbrakk> \<Longrightarrow> A \<lesssim> C
[PROOF STEP]
by (meson card_of_ordLeq eqpoll_iff_card_of_ordIso lepoll_def lepoll_trans ordIso_iff_ordLeq)


[STATEMENT]
lemma tdev_slist_sum: "tdev_slist xs = sum (abs \<circ> snd) (set_slist xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tdev_slist xs = sum (abs \<circ> snd) (set_slist xs)
[PROOF STEP]
by transfer (auto simp: distinct_map sum_list_distinct_conv_sum_set[symmetric] o_def)


[STATEMENT]
lemma equalOnD: "equalOn A f g \<Longrightarrow> (\<forall> x \<in> A . f x = g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. equalOn A f g \<Longrightarrow> \<forall>x\<in>A. f x = g x
[PROOF STEP]
by(simp add: equalOn_def)


[STATEMENT]
theorem gauss_sum_nonzero_noncoprime_necessary_condition:
  assumes "gauss_sum k \<noteq> 0" "\<not>coprime k n" "k > 0"
  defines "d \<equiv> n div gcd k n"
  assumes "coprime a n" "[a = 1] (mod d)"
  shows   "d dvd n" "d < n" "\<chi> a = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d dvd n &&& d < n &&& \<chi> a = 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. d dvd n
 2. d < n
 3. \<chi> a = 1
[PROOF STEP]
show "d dvd n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d dvd n
[PROOF STEP]
unfolding d_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n div gcd k n dvd n
[PROOF STEP]
using n
[PROOF STATE]
proof (prove)
using this:
1 < n

goal (1 subgoal):
 1. n div gcd k n dvd n
[PROOF STEP]
by (subst div_dvd_iff_mult) auto
[PROOF STATE]
proof (state)
this:
d dvd n

goal (2 subgoals):
 1. d < n
 2. \<chi> a = 1
[PROOF STEP]
from assms(2)
[PROOF STATE]
proof (chain)
picking this:
\<not> coprime k n
[PROOF STEP]
have "gcd k n \<noteq> 1"
[PROOF STATE]
proof (prove)
using this:
\<not> coprime k n

goal (1 subgoal):
 1. gcd k n \<noteq> 1
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
gcd k n \<noteq> 1

goal (2 subgoals):
 1. d < n
 2. \<chi> a = 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
gcd k n \<noteq> 1
[PROOF STEP]
have "gcd k n > 1"
[PROOF STATE]
proof (prove)
using this:
gcd k n \<noteq> 1

goal (1 subgoal):
 1. 1 < gcd k n
[PROOF STEP]
using assms(3,4)
[PROOF STATE]
proof (prove)
using this:
gcd k n \<noteq> 1
0 < k
d \<equiv> n div gcd k n

goal (1 subgoal):
 1. 1 < gcd k n
[PROOF STEP]
by (simp add: nat_neq_iff)
[PROOF STATE]
proof (state)
this:
1 < gcd k n

goal (2 subgoals):
 1. d < n
 2. \<chi> a = 1
[PROOF STEP]
with n
[PROOF STATE]
proof (chain)
picking this:
1 < n
1 < gcd k n
[PROOF STEP]
show "d < n"
[PROOF STATE]
proof (prove)
using this:
1 < n
1 < gcd k n

goal (1 subgoal):
 1. d < n
[PROOF STEP]
by (simp add: d_def)
[PROOF STATE]
proof (state)
this:
d < n

goal (1 subgoal):
 1. \<chi> a = 1
[PROOF STEP]
have "periodic_arithmetic (\<lambda>r. \<chi> (r)* unity_root n (k*r)) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. periodic_arithmetic (\<lambda>r. \<chi> r * unity_root n (int (k * r))) n
[PROOF STEP]
using mult_periodic_arithmetic[OF dir_periodic_arithmetic unity_periodic_arithmetic_mult]
[PROOF STATE]
proof (prove)
using this:
periodic_arithmetic (\<lambda>n. \<chi> n * unity_root n (?m1 * int n)) n

goal (1 subgoal):
 1. periodic_arithmetic (\<lambda>r. \<chi> r * unity_root n (int (k * r))) n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
periodic_arithmetic (\<lambda>r. \<chi> r * unity_root n (int (k * r))) n

goal (1 subgoal):
 1. \<chi> a = 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
periodic_arithmetic (\<lambda>r. \<chi> r * unity_root n (int (k * r))) n
[PROOF STEP]
have 1: "periodic_arithmetic (\<lambda>r. \<chi> (r)* unity_root n (r*k)) n"
[PROOF STATE]
proof (prove)
using this:
periodic_arithmetic (\<lambda>r. \<chi> r * unity_root n (int (k * r))) n

goal (1 subgoal):
 1. periodic_arithmetic (\<lambda>r. \<chi> r * unity_root n (int (r * k))) n
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
periodic_arithmetic (\<lambda>r. \<chi> r * unity_root n (int (r * k))) n

goal (1 subgoal):
 1. \<chi> a = 1
[PROOF STEP]
have "gauss_sum k = (\<Sum>m = 1..n . \<chi>(m) * unity_root n (m*k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gauss_sum k = (\<Sum>m = 1..n. \<chi> m * unity_root n (int (m * k)))
[PROOF STEP]
unfolding gauss_sum_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>m = 1..n. \<chi> m * unity_root n (int (m * k))) = (\<Sum>m = 1..n. \<chi> m * unity_root n (int (m * k)))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
gauss_sum k = (\<Sum>m = 1..n. \<chi> m * unity_root n (int (m * k)))

goal (1 subgoal):
 1. \<chi> a = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
gauss_sum k = (\<Sum>m = 1..n. \<chi> m * unity_root n (int (m * k)))

goal (1 subgoal):
 1. \<chi> a = 1
[PROOF STEP]
have "\<dots> = (\<Sum>m = 1..n . \<chi>(m*a) * unity_root n (m*a*k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>m = 1..n. \<chi> m * unity_root n (int (m * k))) = (\<Sum>m = 1..n. \<chi> (m * a) * unity_root n (int (m * a * k)))
[PROOF STEP]
using periodic_arithmetic_remove_homothecy[OF assms(5) 1] n
[PROOF STATE]
proof (prove)
using this:
0 < n \<Longrightarrow> (\<Sum>l = 1..n. \<chi> l * unity_root n (int (l * k))) = (\<Sum>l = 1..n. \<chi> (l * a) * unity_root n (int (l * a * k)))
1 < n

goal (1 subgoal):
 1. (\<Sum>m = 1..n. \<chi> m * unity_root n (int (m * k))) = (\<Sum>m = 1..n. \<chi> (m * a) * unity_root n (int (m * a * k)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>m = 1..n. \<chi> m * unity_root n (int (m * k))) = (\<Sum>m = 1..n. \<chi> (m * a) * unity_root n (int (m * a * k)))

goal (1 subgoal):
 1. \<chi> a = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>m = 1..n. \<chi> m * unity_root n (int (m * k))) = (\<Sum>m = 1..n. \<chi> (m * a) * unity_root n (int (m * a * k)))

goal (1 subgoal):
 1. \<chi> a = 1
[PROOF STEP]
have "\<dots> = (\<Sum>m = 1..n . \<chi>(m*a) * unity_root n (m*k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>m = 1..n. \<chi> (m * a) * unity_root n (int (m * a * k))) = (\<Sum>m = 1..n. \<chi> (m * a) * unity_root n (int (m * k)))
[PROOF STEP]
proof (intro sum.cong refl)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {1..n} \<Longrightarrow> \<chi> (x * a) * unity_root n (int (x * a * k)) = \<chi> (x * a) * unity_root n (int (x * k))
[PROOF STEP]
fix m
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {1..n} \<Longrightarrow> \<chi> (x * a) * unity_root n (int (x * a * k)) = \<chi> (x * a) * unity_root n (int (x * k))
[PROOF STEP]
from assms(6)
[PROOF STATE]
proof (chain)
picking this:
[a = 1] (mod d)
[PROOF STEP]
obtain b where "a = 1 + b*d"
[PROOF STATE]
proof (prove)
using this:
[a = 1] (mod d)

goal (1 subgoal):
 1. (\<And>b. a = 1 + b * d \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>d < n\<close> assms(5) cong_to_1'_nat
[PROOF STATE]
proof (prove)
using this:
[a = 1] (mod d)
d < n
coprime a n
[?a = 1] (mod ?n) = (?a = 0 \<and> ?n = 1 \<or> (\<exists>m. ?a = 1 + m * ?n))

goal (1 subgoal):
 1. (\<And>b. a = 1 + b * d \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a = 1 + b * d

goal (1 subgoal):
 1. \<And>x. x \<in> {1..n} \<Longrightarrow> \<chi> (x * a) * unity_root n (int (x * a * k)) = \<chi> (x * a) * unity_root n (int (x * k))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a = 1 + b * d
[PROOF STEP]
have "m*a*k = m*k+m*b*(n div gcd k n)*k"
[PROOF STATE]
proof (prove)
using this:
a = 1 + b * d

goal (1 subgoal):
 1. m * a * k = m * k + m * b * (n div gcd k n) * k
[PROOF STEP]
by (simp add: algebra_simps d_def)
[PROOF STATE]
proof (state)
this:
m * a * k = m * k + m * b * (n div gcd k n) * k

goal (1 subgoal):
 1. \<And>x. x \<in> {1..n} \<Longrightarrow> \<chi> (x * a) * unity_root n (int (x * a * k)) = \<chi> (x * a) * unity_root n (int (x * k))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
m * a * k = m * k + m * b * (n div gcd k n) * k

goal (1 subgoal):
 1. \<And>x. x \<in> {1..n} \<Longrightarrow> \<chi> (x * a) * unity_root n (int (x * a * k)) = \<chi> (x * a) * unity_root n (int (x * k))
[PROOF STEP]
have "\<dots> = m*k+m*b*n*(k div gcd k n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m * k + m * b * (n div gcd k n) * k = m * k + m * b * n * (k div gcd k n)
[PROOF STEP]
by (simp add: div_mult_swap dvd_div_mult)
[PROOF STATE]
proof (state)
this:
m * k + m * b * (n div gcd k n) * k = m * k + m * b * n * (k div gcd k n)

goal (1 subgoal):
 1. \<And>x. x \<in> {1..n} \<Longrightarrow> \<chi> (x * a) * unity_root n (int (x * a * k)) = \<chi> (x * a) * unity_root n (int (x * k))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
m * k + m * b * (n div gcd k n) * k = m * k + m * b * n * (k div gcd k n)

goal (1 subgoal):
 1. \<And>x. x \<in> {1..n} \<Longrightarrow> \<chi> (x * a) * unity_root n (int (x * a * k)) = \<chi> (x * a) * unity_root n (int (x * k))
[PROOF STEP]
obtain p where "\<dots> = m*k+m*b*n*p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>p. m * k + m * b * n * (k div gcd k n) = m * k + m * b * n * p \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
m * k + m * b * n * (k div gcd k n) = m * k + m * b * n * p

goal (1 subgoal):
 1. \<And>x. x \<in> {1..n} \<Longrightarrow> \<chi> (x * a) * unity_root n (int (x * a * k)) = \<chi> (x * a) * unity_root n (int (x * k))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
m * a * k = m * k + m * b * n * p
[PROOF STEP]
have "m*a*k = m*k+m*b*p*n"
[PROOF STATE]
proof (prove)
using this:
m * a * k = m * k + m * b * n * p

goal (1 subgoal):
 1. m * a * k = m * k + m * b * p * n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
m * a * k = m * k + m * b * p * n

goal (1 subgoal):
 1. \<And>x. x \<in> {1..n} \<Longrightarrow> \<chi> (x * a) * unity_root n (int (x * a * k)) = \<chi> (x * a) * unity_root n (int (x * k))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
m * a * k = m * k + m * b * p * n
[PROOF STEP]
have 1: "m*a*k mod n= m*k mod n"
[PROOF STATE]
proof (prove)
using this:
m * a * k = m * k + m * b * p * n

goal (1 subgoal):
 1. m * a * k mod n = m * k mod n
[PROOF STEP]
using mod_mult_self1
[PROOF STATE]
proof (prove)
using this:
m * a * k = m * k + m * b * p * n
(?a + ?c * ?b) mod ?b = ?a mod ?b

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

goal (1 subgoal):
 1. \<And>x. x \<in> {1..n} \<Longrightarrow> \<chi> (x * a) * unity_root n (int (x * a * k)) = \<chi> (x * a) * unity_root n (int (x * k))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
m * a * k mod n = m * k mod n
[PROOF STEP]
have "unity_root n (m * a * k) = unity_root n (m * k)"
[PROOF STATE]
proof (prove)
using this:
m * a * k mod n = m * k mod n

goal (1 subgoal):
 1. unity_root n (int (m * a * k)) = unity_root n (int (m * k))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. m * a * k mod n = m * k mod n \<Longrightarrow> unity_root n (int (m * a * k)) = unity_root n (int (m * k))
[PROOF STEP]
have "unity_root n (m * a * k) = unity_root n ((m * a * k) mod n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unity_root n (int (m * a * k)) = unity_root n (int (m * a * k mod n))
[PROOF STEP]
using unity_root_mod[of n] zmod_int
[PROOF STATE]
proof (prove)
using this:
unity_root n (?n mod int n) = unity_root n ?n
int (?a mod ?b) = int ?a mod int ?b

goal (1 subgoal):
 1. unity_root n (int (m * a * k)) = unity_root n (int (m * a * k mod n))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
unity_root n (int (m * a * k)) = unity_root n (int (m * a * k mod n))

goal (1 subgoal):
 1. m * a * k mod n = m * k mod n \<Longrightarrow> unity_root n (int (m * a * k)) = unity_root n (int (m * k))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
unity_root n (int (m * a * k)) = unity_root n (int (m * a * k mod n))

goal (1 subgoal):
 1. m * a * k mod n = m * k mod n \<Longrightarrow> unity_root n (int (m * a * k)) = unity_root n (int (m * k))
[PROOF STEP]
have "\<dots> = unity_root n (m * k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unity_root n (int (m * a * k mod n)) = unity_root n (int (m * k))
[PROOF STEP]
using unity_root_mod[of n] zmod_int 1
[PROOF STATE]
proof (prove)
using this:
unity_root n (?n mod int n) = unity_root n ?n
int (?a mod ?b) = int ?a mod int ?b
m * a * k mod n = m * k mod n

goal (1 subgoal):
 1. unity_root n (int (m * a * k mod n)) = unity_root n (int (m * k))
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
unity_root n (int (m * a * k mod n)) = unity_root n (int (m * k))

goal (1 subgoal):
 1. m * a * k mod n = m * k mod n \<Longrightarrow> unity_root n (int (m * a * k)) = unity_root n (int (m * k))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
unity_root n (int (m * a * k)) = unity_root n (int (m * k))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
unity_root n (int (m * a * k)) = unity_root n (int (m * k))

goal (1 subgoal):
 1. unity_root n (int (m * a * k)) = unity_root n (int (m * k))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
unity_root n (int (m * a * k)) = unity_root n (int (m * k))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
unity_root n (int (m * a * k)) = unity_root n (int (m * k))

goal (1 subgoal):
 1. \<And>x. x \<in> {1..n} \<Longrightarrow> \<chi> (x * a) * unity_root n (int (x * a * k)) = \<chi> (x * a) * unity_root n (int (x * k))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
unity_root n (int (m * a * k)) = unity_root n (int (m * k))
[PROOF STEP]
show "\<chi> (m * a) * unity_root n (int (m * a * k)) =
               \<chi> (m * a) * unity_root n (int (m * k))"
[PROOF STATE]
proof (prove)
using this:
unity_root n (int (m * a * k)) = unity_root n (int (m * k))

goal (1 subgoal):
 1. \<chi> (m * a) * unity_root n (int (m * a * k)) = \<chi> (m * a) * unity_root n (int (m * k))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<chi> (m * a) * unity_root n (int (m * a * k)) = \<chi> (m * a) * unity_root n (int (m * k))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>m = 1..n. \<chi> (m * a) * unity_root n (int (m * a * k))) = (\<Sum>m = 1..n. \<chi> (m * a) * unity_root n (int (m * k)))

goal (1 subgoal):
 1. \<chi> a = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>m = 1..n. \<chi> (m * a) * unity_root n (int (m * a * k))) = (\<Sum>m = 1..n. \<chi> (m * a) * unity_root n (int (m * k)))

goal (1 subgoal):
 1. \<chi> a = 1
[PROOF STEP]
have "\<dots> = (\<Sum>m = 1..n . \<chi>(a) * (\<chi>(m) * unity_root n (m*k)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>m = 1..n. \<chi> (m * a) * unity_root n (int (m * k))) = (\<Sum>m = 1..n. \<chi> a * (\<chi> m * unity_root n (int (m * k))))
[PROOF STEP]
by (rule sum.cong,simp,subst mult,simp)
[PROOF STATE]
proof (state)
this:
(\<Sum>m = 1..n. \<chi> (m * a) * unity_root n (int (m * k))) = (\<Sum>m = 1..n. \<chi> a * (\<chi> m * unity_root n (int (m * k))))

goal (1 subgoal):
 1. \<chi> a = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>m = 1..n. \<chi> (m * a) * unity_root n (int (m * k))) = (\<Sum>m = 1..n. \<chi> a * (\<chi> m * unity_root n (int (m * k))))

goal (1 subgoal):
 1. \<chi> a = 1
[PROOF STEP]
have "\<dots> =  \<chi>(a) * (\<Sum>m = 1..n . \<chi>(m) * unity_root n (m*k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>m = 1..n. \<chi> a * (\<chi> m * unity_root n (int (m * k)))) = \<chi> a * (\<Sum>m = 1..n. \<chi> m * unity_root n (int (m * k)))
[PROOF STEP]
by (simp add: sum_distrib_left[symmetric])
[PROOF STATE]
proof (state)
this:
(\<Sum>m = 1..n. \<chi> a * (\<chi> m * unity_root n (int (m * k)))) = \<chi> a * (\<Sum>m = 1..n. \<chi> m * unity_root n (int (m * k)))

goal (1 subgoal):
 1. \<chi> a = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>m = 1..n. \<chi> a * (\<chi> m * unity_root n (int (m * k)))) = \<chi> a * (\<Sum>m = 1..n. \<chi> m * unity_root n (int (m * k)))

goal (1 subgoal):
 1. \<chi> a = 1
[PROOF STEP]
have "\<dots> = \<chi>(a) * gauss_sum k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<chi> a * (\<Sum>m = 1..n. \<chi> m * unity_root n (int (m * k))) = \<chi> a * gauss_sum k
[PROOF STEP]
unfolding gauss_sum_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<chi> a * (\<Sum>m = 1..n. \<chi> m * unity_root n (int (m * k))) = \<chi> a * (\<Sum>m = 1..n. \<chi> m * unity_root n (int (m * k)))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<chi> a * (\<Sum>m = 1..n. \<chi> m * unity_root n (int (m * k))) = \<chi> a * gauss_sum k

goal (1 subgoal):
 1. \<chi> a = 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
gauss_sum k = \<chi> a * gauss_sum k
[PROOF STEP]
have "gauss_sum k = \<chi>(a) * gauss_sum k"
[PROOF STATE]
proof (prove)
using this:
gauss_sum k = \<chi> a * gauss_sum k

goal (1 subgoal):
 1. gauss_sum k = \<chi> a * gauss_sum k
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
gauss_sum k = \<chi> a * gauss_sum k

goal (1 subgoal):
 1. \<chi> a = 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
gauss_sum k = \<chi> a * gauss_sum k
[PROOF STEP]
show "\<chi> a = 1"
[PROOF STATE]
proof (prove)
using this:
gauss_sum k = \<chi> a * gauss_sum k

goal (1 subgoal):
 1. \<chi> a = 1
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
gauss_sum k = \<chi> a * gauss_sum k
gauss_sum k \<noteq> 0

goal (1 subgoal):
 1. \<chi> a = 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<chi> a = 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma wf_less_multiset: "wf {(M :: 'a multiset, N). M < N}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf {(M, N). M < N}
[PROOF STEP]
unfolding less_multiset_def multp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf {(M, N). (M, N) \<in> mult {(x, y). x < y}}
[PROOF STEP]
by (auto intro: wf_mult wf)


[STATEMENT]
lemma convex_rel_open_direct_sum:
  fixes S T :: "'n::euclidean_space set"
  assumes "convex S"
    and "rel_open S"
    and "convex T"
    and "rel_open T"
  shows "convex (S \<times> T) \<and> rel_open (S \<times> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex (S \<times> T) \<and> rel_open (S \<times> T)
[PROOF STEP]
by (metis assms convex_Times rel_interior_Times rel_open_def)


[STATEMENT]
lemma fds_primepow_subseries_euler_product_cm:
  fixes f :: "'a :: dirichlet_series fds"
  assumes "completely_multiplicative_function (fds_nth f)" "prime p"
  assumes "s \<bullet> 1 > abs_conv_abscissa f"
  shows   "eval_fds (fds_primepow_subseries p f) s = 1 / (1 - fds_nth f p / nat_power p s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_fds (fds_primepow_subseries p f) s = (1::'a) / ((1::'a) - fds_nth f p / nat_power p s)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. eval_fds (fds_primepow_subseries p f) s = (1::'a) / ((1::'a) - fds_nth f p / nat_power p s)
[PROOF STEP]
let ?f = "(\<lambda>n. \<Prod>pa\<le>n. if prime pa then inverse (1 - fds_nth (fds_primepow_subseries p f) pa /
                 nat_power pa s) else 1)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. eval_fds (fds_primepow_subseries p f) s = (1::'a) / ((1::'a) - fds_nth f p / nat_power p s)
[PROOF STEP]
have "sequentially \<noteq> bot"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sequentially \<noteq> bot
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sequentially \<noteq> bot

goal (1 subgoal):
 1. eval_fds (fds_primepow_subseries p f) s = (1::'a) / ((1::'a) - fds_nth f p / nat_power p s)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
sequentially \<noteq> bot

goal (1 subgoal):
 1. eval_fds (fds_primepow_subseries p f) s = (1::'a) / ((1::'a) - fds_nth f p / nat_power p s)
[PROOF STEP]
have "?f \<longlonglongrightarrow> eval_fds (fds_primepow_subseries p f) s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. \<Prod>pa\<le>n. if prime pa then inverse ((1::'a) - fds_nth (fds_primepow_subseries p f) pa / nat_power pa s) else (1::'a)) \<longlonglongrightarrow> eval_fds (fds_primepow_subseries p f) s
[PROOF STEP]
by (intro fds_euler_product_LIMSEQ' completely_multiplicative_function_only_pows assms
          fds_abs_converges_subseries) (insert assms, auto intro!: fds_abs_converges)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. \<Prod>pa\<le>n. if prime pa then inverse ((1::'a) - fds_nth (fds_primepow_subseries p f) pa / nat_power pa s) else (1::'a)) \<longlonglongrightarrow> eval_fds (fds_primepow_subseries p f) s

goal (1 subgoal):
 1. eval_fds (fds_primepow_subseries p f) s = (1::'a) / ((1::'a) - fds_nth f p / nat_power p s)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>n. \<Prod>pa\<le>n. if prime pa then inverse ((1::'a) - fds_nth (fds_primepow_subseries p f) pa / nat_power pa s) else (1::'a)) \<longlonglongrightarrow> eval_fds (fds_primepow_subseries p f) s

goal (1 subgoal):
 1. eval_fds (fds_primepow_subseries p f) s = (1::'a) / ((1::'a) - fds_nth f p / nat_power p s)
[PROOF STEP]
have "eventually (\<lambda>n. ?f n = 1 / (1 - fds_nth f p / nat_power p s)) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. (\<Prod>pa\<le>n. if prime pa then inverse ((1::'a) - fds_nth (fds_primepow_subseries p f) pa / nat_power pa s) else (1::'a)) = (1::'a) / ((1::'a) - fds_nth f p / nat_power p s)
[PROOF STEP]
using eventually_ge_at_top[of p]
[PROOF STATE]
proof (prove)
using this:
eventually ((\<le>) p) sequentially

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. (\<Prod>pa\<le>n. if prime pa then inverse ((1::'a) - fds_nth (fds_primepow_subseries p f) pa / nat_power pa s) else (1::'a)) = (1::'a) / ((1::'a) - fds_nth f p / nat_power p s)
[PROOF STEP]
proof eventually_elim
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. p \<le> n \<Longrightarrow> (\<Prod>pa\<le>n. if prime pa then inverse ((1::'a) - fds_nth (fds_primepow_subseries p f) pa / nat_power pa s) else (1::'a)) = (1::'a) / ((1::'a) - fds_nth f p / nat_power p s)
[PROOF STEP]
case (elim n)
[PROOF STATE]
proof (state)
this:
p \<le> n

goal (1 subgoal):
 1. \<And>n. p \<le> n \<Longrightarrow> (\<Prod>pa\<le>n. if prime pa then inverse ((1::'a) - fds_nth (fds_primepow_subseries p f) pa / nat_power pa s) else (1::'a)) = (1::'a) / ((1::'a) - fds_nth f p / nat_power p s)
[PROOF STEP]
have "(\<Prod>pa\<le>n. if prime pa then inverse (1 - fds_nth (fds_primepow_subseries p f) pa /
              nat_power pa s) else 1) =
          (\<Prod>q\<le>n. if q = p then inverse (1 - fds_nth f p / nat_power p s) else 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>pa\<le>n. if prime pa then inverse ((1::'a) - fds_nth (fds_primepow_subseries p f) pa / nat_power pa s) else (1::'a)) = (\<Prod>q\<le>n. if q = p then inverse ((1::'a) - fds_nth f p / nat_power p s) else (1::'a))
[PROOF STEP]
using \<open>prime p\<close>
[PROOF STATE]
proof (prove)
using this:
prime p

goal (1 subgoal):
 1. (\<Prod>pa\<le>n. if prime pa then inverse ((1::'a) - fds_nth (fds_primepow_subseries p f) pa / nat_power pa s) else (1::'a)) = (\<Prod>q\<le>n. if q = p then inverse ((1::'a) - fds_nth f p / nat_power p s) else (1::'a))
[PROOF STEP]
by (intro prod.cong) (auto simp: fds_nth_subseries prime_prime_factors)
[PROOF STATE]
proof (state)
this:
(\<Prod>pa\<le>n. if prime pa then inverse ((1::'a) - fds_nth (fds_primepow_subseries p f) pa / nat_power pa s) else (1::'a)) = (\<Prod>q\<le>n. if q = p then inverse ((1::'a) - fds_nth f p / nat_power p s) else (1::'a))

goal (1 subgoal):
 1. \<And>n. p \<le> n \<Longrightarrow> (\<Prod>pa\<le>n. if prime pa then inverse ((1::'a) - fds_nth (fds_primepow_subseries p f) pa / nat_power pa s) else (1::'a)) = (1::'a) / ((1::'a) - fds_nth f p / nat_power p s)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Prod>pa\<le>n. if prime pa then inverse ((1::'a) - fds_nth (fds_primepow_subseries p f) pa / nat_power pa s) else (1::'a)) = (\<Prod>q\<le>n. if q = p then inverse ((1::'a) - fds_nth f p / nat_power p s) else (1::'a))

goal (1 subgoal):
 1. \<And>n. p \<le> n \<Longrightarrow> (\<Prod>pa\<le>n. if prime pa then inverse ((1::'a) - fds_nth (fds_primepow_subseries p f) pa / nat_power pa s) else (1::'a)) = (1::'a) / ((1::'a) - fds_nth f p / nat_power p s)
[PROOF STEP]
have "\<dots> = 1 / (1 - fds_nth f p / nat_power p s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>q\<le>n. if q = p then inverse ((1::'a) - fds_nth f p / nat_power p s) else (1::'a)) = (1::'a) / ((1::'a) - fds_nth f p / nat_power p s)
[PROOF STEP]
using elim
[PROOF STATE]
proof (prove)
using this:
p \<le> n

goal (1 subgoal):
 1. (\<Prod>q\<le>n. if q = p then inverse ((1::'a) - fds_nth f p / nat_power p s) else (1::'a)) = (1::'a) / ((1::'a) - fds_nth f p / nat_power p s)
[PROOF STEP]
by (subst prod.delta) (auto simp: divide_simps)
[PROOF STATE]
proof (state)
this:
(\<Prod>q\<le>n. if q = p then inverse ((1::'a) - fds_nth f p / nat_power p s) else (1::'a)) = (1::'a) / ((1::'a) - fds_nth f p / nat_power p s)

goal (1 subgoal):
 1. \<And>n. p \<le> n \<Longrightarrow> (\<Prod>pa\<le>n. if prime pa then inverse ((1::'a) - fds_nth (fds_primepow_subseries p f) pa / nat_power pa s) else (1::'a)) = (1::'a) / ((1::'a) - fds_nth f p / nat_power p s)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Prod>pa\<le>n. if prime pa then inverse ((1::'a) - fds_nth (fds_primepow_subseries p f) pa / nat_power pa s) else (1::'a)) = (1::'a) / ((1::'a) - fds_nth f p / nat_power p s)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(\<Prod>pa\<le>n. if prime pa then inverse ((1::'a) - fds_nth (fds_primepow_subseries p f) pa / nat_power pa s) else (1::'a)) = (1::'a) / ((1::'a) - fds_nth f p / nat_power p s)

goal (1 subgoal):
 1. (\<Prod>pa\<le>n. if prime pa then inverse ((1::'a) - fds_nth (fds_primepow_subseries p f) pa / nat_power pa s) else (1::'a)) = (1::'a) / ((1::'a) - fds_nth f p / nat_power p s)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Prod>pa\<le>n. if prime pa then inverse ((1::'a) - fds_nth (fds_primepow_subseries p f) pa / nat_power pa s) else (1::'a)) = (1::'a) / ((1::'a) - fds_nth f p / nat_power p s)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. (\<Prod>pa\<le>n. if prime pa then inverse ((1::'a) - fds_nth (fds_primepow_subseries p f) pa / nat_power pa s) else (1::'a)) = (1::'a) / ((1::'a) - fds_nth f p / nat_power p s)

goal (1 subgoal):
 1. eval_fds (fds_primepow_subseries p f) s = (1::'a) / ((1::'a) - fds_nth f p / nat_power p s)
[PROOF STEP]
hence "?f \<longlonglongrightarrow> 1 / (1 - fds_nth f p / nat_power p s)"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. (\<Prod>pa\<le>n. if prime pa then inverse ((1::'a) - fds_nth (fds_primepow_subseries p f) pa / nat_power pa s) else (1::'a)) = (1::'a) / ((1::'a) - fds_nth f p / nat_power p s)

goal (1 subgoal):
 1. (\<lambda>n. \<Prod>pa\<le>n. if prime pa then inverse ((1::'a) - fds_nth (fds_primepow_subseries p f) pa / nat_power pa s) else (1::'a)) \<longlonglongrightarrow> (1::'a) / ((1::'a) - fds_nth f p / nat_power p s)
[PROOF STEP]
by (rule tendsto_eventually)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. \<Prod>pa\<le>n. if prime pa then inverse ((1::'a) - fds_nth (fds_primepow_subseries p f) pa / nat_power pa s) else (1::'a)) \<longlonglongrightarrow> (1::'a) / ((1::'a) - fds_nth f p / nat_power p s)

goal (1 subgoal):
 1. eval_fds (fds_primepow_subseries p f) s = (1::'a) / ((1::'a) - fds_nth f p / nat_power p s)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
sequentially \<noteq> bot
(\<lambda>n. \<Prod>pa\<le>n. if prime pa then inverse ((1::'a) - fds_nth (fds_primepow_subseries p f) pa / nat_power pa s) else (1::'a)) \<longlonglongrightarrow> eval_fds (fds_primepow_subseries p f) s
(\<lambda>n. \<Prod>pa\<le>n. if prime pa then inverse ((1::'a) - fds_nth (fds_primepow_subseries p f) pa / nat_power pa s) else (1::'a)) \<longlonglongrightarrow> (1::'a) / ((1::'a) - fds_nth f p / nat_power p s)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sequentially \<noteq> bot
(\<lambda>n. \<Prod>pa\<le>n. if prime pa then inverse ((1::'a) - fds_nth (fds_primepow_subseries p f) pa / nat_power pa s) else (1::'a)) \<longlonglongrightarrow> eval_fds (fds_primepow_subseries p f) s
(\<lambda>n. \<Prod>pa\<le>n. if prime pa then inverse ((1::'a) - fds_nth (fds_primepow_subseries p f) pa / nat_power pa s) else (1::'a)) \<longlonglongrightarrow> (1::'a) / ((1::'a) - fds_nth f p / nat_power p s)

goal (1 subgoal):
 1. eval_fds (fds_primepow_subseries p f) s = (1::'a) / ((1::'a) - fds_nth f p / nat_power p s)
[PROOF STEP]
by (rule tendsto_unique)
[PROOF STATE]
proof (state)
this:
eval_fds (fds_primepow_subseries p f) s = (1::'a) / ((1::'a) - fds_nth f p / nat_power p s)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Ord_sup [simp]: "Ord k \<Longrightarrow> Ord l \<Longrightarrow> Ord (k \<squnion> l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Ord k; Ord l\<rbrakk> \<Longrightarrow> Ord (k \<squnion> l)
[PROOF STEP]
by (metis Ord_linear_le le_iff_sup sup_absorb1)


[STATEMENT]
lemma less_ccSUP_iff: "countable A \<Longrightarrow> a < (SUP i\<in>A. f i) \<longleftrightarrow> (\<exists>x\<in>A. a < f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable A \<Longrightarrow> (a < Sup (f ` A)) = (\<exists>x\<in>A. a < f x)
[PROOF STEP]
using less_ccSup_iff [of "f ` A"]
[PROOF STATE]
proof (prove)
using this:
countable (f ` A) \<Longrightarrow> (a < Sup (f ` A)) = (\<exists>x\<in>f ` A. a < x)

goal (1 subgoal):
 1. countable A \<Longrightarrow> (a < Sup (f ` A)) = (\<exists>x\<in>A. a < f x)
[PROOF STEP]
by simp


[STATEMENT]
lemma Fract_le_zero_iff: "0 < b \<Longrightarrow> Fract a b \<le> 0 \<longleftrightarrow> a \<le> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) < b \<Longrightarrow> (Fract a b \<le> 0) = (a \<le> (0::'a))
[PROOF STEP]
by (auto simp add: Zero_fract_def mult_le_0_iff)


[STATEMENT]
lemma CHORun_eq:
  "CHORun A rho HOs coords =
     (CHOinitConfig A (rho 0) (coords 0)
      \<and> (\<forall>r. CHOnextConfig A r (rho r) (HOs r) (coords (Suc r)) (rho (Suc r))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. CHORun A rho HOs coords = (CHOinitConfig A (rho 0) (coords 0) \<and> (\<forall>r. CHOnextConfig A r (rho r) (HOs r) (coords (Suc r)) (rho (Suc r))))
[PROOF STEP]
by (auto simp: CHORun_def CSHORun_def CHOinitConfig_def CHOnextConfig_def)


[STATEMENT]
lemma Max_atLeastLessThan_nat[simp]: "a < b \<Longrightarrow> linorder_class.Max {a..<b} = b - 1" for a b::nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a < b \<Longrightarrow> Max {a..<b} = b - 1
[PROOF STEP]
by (auto intro!: Max_eqI)


[STATEMENT]
lemma bounded_translation_minus:
  fixes S :: "'a::real_normed_vector set"
  shows "bounded S \<Longrightarrow> bounded ((\<lambda>x. x - a) ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded S \<Longrightarrow> bounded ((\<lambda>x. x - a) ` S)
[PROOF STEP]
using bounded_translation [of S "-a"]
[PROOF STATE]
proof (prove)
using this:
bounded S \<Longrightarrow> bounded ((+) (- a) ` S)

goal (1 subgoal):
 1. bounded S \<Longrightarrow> bounded ((\<lambda>x. x - a) ` S)
[PROOF STEP]
by simp


[STATEMENT]
lemma scaleC_mono:
  "a \<le> b \<Longrightarrow> x \<le> y \<Longrightarrow> 0 \<le> b \<Longrightarrow> 0 \<le> x \<Longrightarrow> a *\<^sub>C x \<le> b *\<^sub>C y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> b; x \<le> y; 0 \<le> b; (0::'a) \<le> x\<rbrakk> \<Longrightarrow> a *\<^sub>C x \<le> b *\<^sub>C y
[PROOF STEP]
by (meson order_trans scaleC_left_mono scaleC_right_mono)


[STATEMENT]
lemma list_update_le_cong:
  "\<lbrakk> i<size xs; xs <=[r] ys; x <=_r y \<rbrakk> \<Longrightarrow> xs[i:=x] <=[r] ys[i:=y]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i < length xs; xs <=[r] ys; x \<sqsubseteq>\<^bsub>r\<^esub> y\<rbrakk> \<Longrightarrow> xs[i := x] <=[r] ys[i := y]
[PROOF STEP]
apply (unfold unfold_lesub_list)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i < length xs; Listn.le r xs ys; x \<sqsubseteq>\<^bsub>r\<^esub> y\<rbrakk> \<Longrightarrow> Listn.le r (xs[i := x]) (ys[i := y])
[PROOF STEP]
apply (unfold Listn.le_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i < length xs; list_all2 (\<lambda>x. lesub x r) xs ys; x \<sqsubseteq>\<^bsub>r\<^esub> y\<rbrakk> \<Longrightarrow> list_all2 (\<lambda>x. lesub x r) (xs[i := x]) (ys[i := y])
[PROOF STEP]
apply (simp add: list_all2_conv_all_nth nth_list_update)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma at_map_minus_pres: "at_map (x - y) = at_map x - at_map y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. at_map (x - y) = at_map x - at_map y
[PROOF STEP]
unfolding at_map_def comp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs_atoms (atom_map (x - y)) = Abs_atoms (atom_map x) - Abs_atoms (atom_map y)
[PROOF STEP]
by (simp add: Abs_atoms_inverse atom_map_minus_pres minus_atoms.abs_eq)


[STATEMENT]
lemma val_ring_polys_memE:
  assumes "f \<in> val_ring_polys"
  shows "f \<in> carrier (UP Q\<^sub>p)"
        "f i \<in> \<O>\<^sub>p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> carrier (UP Q\<^sub>p) &&& f i \<in> \<O>\<^sub>p
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f \<in> val_ring_polys

goal (1 subgoal):
 1. f \<in> carrier (UP Q\<^sub>p) &&& f i \<in> \<O>\<^sub>p
[PROOF STEP]
unfolding val_ring_polys_def
[PROOF STATE]
proof (prove)
using this:
f \<in> {f \<in> carrier (UP Q\<^sub>p). \<forall>i. f i \<in> \<O>\<^sub>p}

goal (1 subgoal):
 1. f \<in> carrier (UP Q\<^sub>p) &&& f i \<in> \<O>\<^sub>p
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f i \<in> \<O>\<^sub>p
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f \<in> val_ring_polys

goal (1 subgoal):
 1. f i \<in> \<O>\<^sub>p
[PROOF STEP]
unfolding val_ring_polys_def
[PROOF STATE]
proof (prove)
using this:
f \<in> {f \<in> carrier (UP Q\<^sub>p). \<forall>i. f i \<in> \<O>\<^sub>p}

goal (1 subgoal):
 1. f i \<in> \<O>\<^sub>p
[PROOF STEP]
by blast


[STATEMENT]
lemma (in ring) divides_pirreducible_condition:
  assumes "pirreducible K q" and "p \<in> carrier (K[X])"
  shows "p divides\<^bsub>K[X]\<^esub> q \<Longrightarrow> p \<in> Units (K[X]) \<or> p \<sim>\<^bsub>K[X]\<^esub> q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p divides\<^bsub>K [X]\<^esub> q \<Longrightarrow> p \<in> Units (K [X]) \<or> p \<sim>\<^bsub>K [X]\<^esub> q
[PROOF STEP]
using divides_irreducible_condition[of "K[X]" q p] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>irreducible (K [X]) q; p \<in> carrier (K [X]); p divides\<^bsub>K [X]\<^esub> q\<rbrakk> \<Longrightarrow> p \<in> Units (K [X]) \<or> p \<sim>\<^bsub>K [X]\<^esub> q
pirreducible K q
p \<in> carrier (K [X])

goal (1 subgoal):
 1. p divides\<^bsub>K [X]\<^esub> q \<Longrightarrow> p \<in> Units (K [X]) \<or> p \<sim>\<^bsub>K [X]\<^esub> q
[PROOF STEP]
unfolding ring_irreducible_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>irreducible (K [X]) q; p \<in> carrier (K [X]); p divides\<^bsub>K [X]\<^esub> q\<rbrakk> \<Longrightarrow> p \<in> Units (K [X]) \<or> p \<sim>\<^bsub>K [X]\<^esub> q
q \<noteq> \<zero>\<^bsub>K [X]\<^esub> \<and> irreducible (K [X]) q
p \<in> carrier (K [X])

goal (1 subgoal):
 1. p divides\<^bsub>K [X]\<^esub> q \<Longrightarrow> p \<in> Units (K [X]) \<or> p \<sim>\<^bsub>K [X]\<^esub> q
[PROOF STEP]
by auto


[STATEMENT]
theorem states_of_se_assume :
  assumes "se c (Assume e) c'"
  shows   "states c' = {\<sigma> \<in> states c. e \<sigma>}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. states c' = {\<sigma> \<in> states c. e \<sigma>}
[PROOF STEP]
using assms se_Assume_eq[of c e c']
[PROOF STATE]
proof (prove)
using this:
se c (Assume e) c'
se c (Assume e) c' = (c' = \<lparr>store = store c, pred = pred c \<union> {adapt_bexp e (store c)}\<rparr>)

goal (1 subgoal):
 1. states c' = {\<sigma> \<in> states c. e \<sigma>}
[PROOF STEP]
by (auto simp add : adapt_bexp_is_subst states_def conjunct_def)


[STATEMENT]
lemma continuous_map_prod [continuous_intros]:
   "\<lbrakk>finite I;
         \<And>i. i \<in> I \<Longrightarrow> continuous_map X euclideanreal (\<lambda>x. f x i)\<rbrakk>
        \<Longrightarrow> continuous_map X euclideanreal (\<lambda>x. prod (f x) I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; \<And>i. i \<in> I \<Longrightarrow> continuous_map X euclideanreal (\<lambda>x. f x i)\<rbrakk> \<Longrightarrow> continuous_map X euclideanreal (\<lambda>x. prod (f x) I)
[PROOF STEP]
by (simp add: continuous_map_atin tendsto_prod)


[STATEMENT]
lemma gcd_dvd_1[simp]: "gcd a b dvd 1 \<longleftrightarrow> coprime a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (gcd a b dvd (1::'a)) = coprime a b
[PROOF STEP]
using dvd_trans[OF gcd_greatest[of _ a b], of _ 1]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?a dvd a; ?a dvd b; gcd a b dvd (1::'a)\<rbrakk> \<Longrightarrow> ?a dvd (1::'a)

goal (1 subgoal):
 1. (gcd a b dvd (1::'a)) = coprime a b
[PROOF STEP]
by (cases "a = 0 \<and> b = 0") (auto intro!: coprimeI elim: coprimeE)


[STATEMENT]
lemma ln_ln_nonneg: "x \<ge> (3::real) \<Longrightarrow> ln (ln x) \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3 \<le> x \<Longrightarrow> 0 \<le> ln (ln x)
[PROOF STEP]
using ln_ln_pos[of "x"]
[PROOF STATE]
proof (prove)
using this:
3 \<le> x \<Longrightarrow> 0 < ln (ln x)

goal (1 subgoal):
 1. 3 \<le> x \<Longrightarrow> 0 \<le> ln (ln x)
[PROOF STEP]
by simp