[STATEMENT]
lemma inj_on_span_independent_image:
  assumes ifB: "m2.independent (f ` B)" and f: "inj_on f B" shows "inj_on f (m1.span B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on f (m1.span B)
[PROOF STEP]
unfolding inj_on_iff_eq_0[OF m1.subspace_span]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>m1.span B. f x = (0::'c) \<longrightarrow> x = (0::'b)
[PROOF STEP]
unfolding m1.span_explicit'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>{\<Sum>v | f v \<noteq> (0::'a). f v *a v |f. finite {v. f v \<noteq> (0::'a)} \<and> (\<forall>v. f v \<noteq> (0::'a) \<longrightarrow> v \<in> B)}. f x = (0::'c) \<longrightarrow> x = (0::'b)
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x fa. \<lbrakk>finite {v. fa v \<noteq> (0::'a)}; \<forall>v. fa v \<noteq> (0::'a) \<longrightarrow> v \<in> B; f (\<Sum>v | fa v \<noteq> (0::'a). fa v *a v) = (0::'c)\<rbrakk> \<Longrightarrow> (\<Sum>v | fa v \<noteq> (0::'a). fa v *a v) = (0::'b)
[PROOF STEP]
fix r
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x fa. \<lbrakk>finite {v. fa v \<noteq> (0::'a)}; \<forall>v. fa v \<noteq> (0::'a) \<longrightarrow> v \<in> B; f (\<Sum>v | fa v \<noteq> (0::'a). fa v *a v) = (0::'c)\<rbrakk> \<Longrightarrow> (\<Sum>v | fa v \<noteq> (0::'a). fa v *a v) = (0::'b)
[PROOF STEP]
assume fr: "finite {v. r v \<noteq> 0}" and r: "\<forall>v. r v \<noteq> 0 \<longrightarrow> v \<in> B"
    and eq0: "f (\<Sum>v | r v \<noteq> 0. r v *a v) = 0"
[PROOF STATE]
proof (state)
this:
finite {v. r v \<noteq> (0::'a)}
\<forall>v. r v \<noteq> (0::'a) \<longrightarrow> v \<in> B
f (\<Sum>v | r v \<noteq> (0::'a). r v *a v) = (0::'c)

goal (1 subgoal):
 1. \<And>x fa. \<lbrakk>finite {v. fa v \<noteq> (0::'a)}; \<forall>v. fa v \<noteq> (0::'a) \<longrightarrow> v \<in> B; f (\<Sum>v | fa v \<noteq> (0::'a). fa v *a v) = (0::'c)\<rbrakk> \<Longrightarrow> (\<Sum>v | fa v \<noteq> (0::'a). fa v *a v) = (0::'b)
[PROOF STEP]
have "0 = (\<Sum>v | r v \<noteq> 0. r v *b f v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'c) = (\<Sum>v | r v \<noteq> (0::'a). r v *b f v)
[PROOF STEP]
using eq0
[PROOF STATE]
proof (prove)
using this:
f (\<Sum>v | r v \<noteq> (0::'a). r v *a v) = (0::'c)

goal (1 subgoal):
 1. (0::'c) = (\<Sum>v | r v \<noteq> (0::'a). r v *b f v)
[PROOF STEP]
by (simp add: sum scale)
[PROOF STATE]
proof (state)
this:
(0::'c) = (\<Sum>v | r v \<noteq> (0::'a). r v *b f v)

goal (1 subgoal):
 1. \<And>x fa. \<lbrakk>finite {v. fa v \<noteq> (0::'a)}; \<forall>v. fa v \<noteq> (0::'a) \<longrightarrow> v \<in> B; f (\<Sum>v | fa v \<noteq> (0::'a). fa v *a v) = (0::'c)\<rbrakk> \<Longrightarrow> (\<Sum>v | fa v \<noteq> (0::'a). fa v *a v) = (0::'b)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(0::'c) = (\<Sum>v | r v \<noteq> (0::'a). r v *b f v)

goal (1 subgoal):
 1. \<And>x fa. \<lbrakk>finite {v. fa v \<noteq> (0::'a)}; \<forall>v. fa v \<noteq> (0::'a) \<longrightarrow> v \<in> B; f (\<Sum>v | fa v \<noteq> (0::'a). fa v *a v) = (0::'c)\<rbrakk> \<Longrightarrow> (\<Sum>v | fa v \<noteq> (0::'a). fa v *a v) = (0::'b)
[PROOF STEP]
have "... = (\<Sum>v\<in>f ` {v. r v \<noteq> 0}. r (the_inv_into B f v) *b v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>v | r v \<noteq> (0::'a). r v *b f v) = (\<Sum>v\<in>f ` {v. r v \<noteq> (0::'a)}. r (the_inv_into B f v) *b v)
[PROOF STEP]
using r
[PROOF STATE]
proof (prove)
using this:
\<forall>v. r v \<noteq> (0::'a) \<longrightarrow> v \<in> B

goal (1 subgoal):
 1. (\<Sum>v | r v \<noteq> (0::'a). r v *b f v) = (\<Sum>v\<in>f ` {v. r v \<noteq> (0::'a)}. r (the_inv_into B f v) *b v)
[PROOF STEP]
by (subst sum.reindex) (auto simp: the_inv_into_f_f[OF f] intro!: inj_on_subset[OF f] sum.cong)
[PROOF STATE]
proof (state)
this:
(\<Sum>v | r v \<noteq> (0::'a). r v *b f v) = (\<Sum>v\<in>f ` {v. r v \<noteq> (0::'a)}. r (the_inv_into B f v) *b v)

goal (1 subgoal):
 1. \<And>x fa. \<lbrakk>finite {v. fa v \<noteq> (0::'a)}; \<forall>v. fa v \<noteq> (0::'a) \<longrightarrow> v \<in> B; f (\<Sum>v | fa v \<noteq> (0::'a). fa v *a v) = (0::'c)\<rbrakk> \<Longrightarrow> (\<Sum>v | fa v \<noteq> (0::'a). fa v *a v) = (0::'b)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(0::'c) = (\<Sum>v\<in>f ` {v. r v \<noteq> (0::'a)}. r (the_inv_into B f v) *b v)
[PROOF STEP]
have "r v \<noteq> 0 \<Longrightarrow> r (the_inv_into B f (f v)) = 0" for v
[PROOF STATE]
proof (prove)
using this:
(0::'c) = (\<Sum>v\<in>f ` {v. r v \<noteq> (0::'a)}. r (the_inv_into B f v) *b v)

goal (1 subgoal):
 1. r v \<noteq> (0::'a) \<Longrightarrow> r (the_inv_into B f (f v)) = (0::'a)
[PROOF STEP]
using fr r ifB[unfolded m2.independent_explicit_module, rule_format,
        of "f ` {v. r v \<noteq> 0}" "\<lambda>v. r (the_inv_into B f v)"]
[PROOF STATE]
proof (prove)
using this:
(0::'c) = (\<Sum>v\<in>f ` {v. r v \<noteq> (0::'a)}. r (the_inv_into B f v) *b v)
finite {v. r v \<noteq> (0::'a)}
\<forall>v. r v \<noteq> (0::'a) \<longrightarrow> v \<in> B
\<lbrakk>finite (f ` {v. r v \<noteq> (0::'a)}); f ` {v. r v \<noteq> (0::'a)} \<subseteq> f ` B; (\<Sum>v\<in>f ` {v. r v \<noteq> (0::'a)}. r (the_inv_into B f v) *b v) = (0::'c); ?v \<in> f ` {v. r v \<noteq> (0::'a)}\<rbrakk> \<Longrightarrow> r (the_inv_into B f ?v) = (0::'a)

goal (1 subgoal):
 1. r v \<noteq> (0::'a) \<Longrightarrow> r (the_inv_into B f (f v)) = (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
r ?v \<noteq> (0::'a) \<Longrightarrow> r (the_inv_into B f (f ?v)) = (0::'a)

goal (1 subgoal):
 1. \<And>x fa. \<lbrakk>finite {v. fa v \<noteq> (0::'a)}; \<forall>v. fa v \<noteq> (0::'a) \<longrightarrow> v \<in> B; f (\<Sum>v | fa v \<noteq> (0::'a). fa v *a v) = (0::'c)\<rbrakk> \<Longrightarrow> (\<Sum>v | fa v \<noteq> (0::'a). fa v *a v) = (0::'b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
r ?v \<noteq> (0::'a) \<Longrightarrow> r (the_inv_into B f (f ?v)) = (0::'a)
[PROOF STEP]
have "r v = 0" for v
[PROOF STATE]
proof (prove)
using this:
r ?v \<noteq> (0::'a) \<Longrightarrow> r (the_inv_into B f (f ?v)) = (0::'a)

goal (1 subgoal):
 1. r v = (0::'a)
[PROOF STEP]
using the_inv_into_f_f[OF f] r
[PROOF STATE]
proof (prove)
using this:
r ?v \<noteq> (0::'a) \<Longrightarrow> r (the_inv_into B f (f ?v)) = (0::'a)
?x \<in> B \<Longrightarrow> the_inv_into B f (f ?x) = ?x
\<forall>v. r v \<noteq> (0::'a) \<longrightarrow> v \<in> B

goal (1 subgoal):
 1. r v = (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
r ?v = (0::'a)

goal (1 subgoal):
 1. \<And>x fa. \<lbrakk>finite {v. fa v \<noteq> (0::'a)}; \<forall>v. fa v \<noteq> (0::'a) \<longrightarrow> v \<in> B; f (\<Sum>v | fa v \<noteq> (0::'a). fa v *a v) = (0::'c)\<rbrakk> \<Longrightarrow> (\<Sum>v | fa v \<noteq> (0::'a). fa v *a v) = (0::'b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
r ?v = (0::'a)
[PROOF STEP]
show "(\<Sum>v | r v \<noteq> 0. r v *a v) = 0"
[PROOF STATE]
proof (prove)
using this:
r ?v = (0::'a)

goal (1 subgoal):
 1. (\<Sum>v | r v \<noteq> (0::'a). r v *a v) = (0::'b)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>v | r v \<noteq> (0::'a). r v *a v) = (0::'b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inv_Mp_coeff: "coeff (inv_Mp f) n = inv_M (coeff f n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff (inv_Mp f) n = inv_M (coeff f n)
[PROOF STEP]
unfolding inv_Mp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff (map_poly inv_M f) n = inv_M (coeff f n)
[PROOF STEP]
by (rule coeff_map_poly, insert m1, auto simp: inv_M_def)


[STATEMENT]
lemma isomorphism_expand:
  "f \<circ> g = id \<and> g \<circ> f = id \<longleftrightarrow> (\<forall>x. f (g x) = x) \<and> (\<forall>x. g (f x) = x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<circ> g = id \<and> g \<circ> f = id) = ((\<forall>x. f (g x) = x) \<and> (\<forall>x. g (f x) = x))
[PROOF STEP]
by (simp add: fun_eq_iff o_def id_def)


[STATEMENT]
lemma (in jozsa) U\<^sub>f_mult_without_empty_summands_even:
  fixes i j A
  assumes "i < dim_row U\<^sub>f" and "j < dim_col A" and "even i" and "dim_col U\<^sub>f = dim_row A"
  shows "(U\<^sub>f * A) $$ (i,j) = (\<Sum>k \<in> {i,i+1}. U\<^sub>f $$ (i,k) * A $$ (k,j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (U\<^sub>f * A) $$ (i, j) = (\<Sum>k\<in>{i, i + 1}. U\<^sub>f $$ (i, k) * A $$ (k, j))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (U\<^sub>f * A) $$ (i, j) = (\<Sum>k\<in>{i, i + 1}. U\<^sub>f $$ (i, k) * A $$ (k, j))
[PROOF STEP]
have "(U\<^sub>f * A) $$ (i,j) = (\<Sum> k\<in>{0..< dim_row A}. (U\<^sub>f $$ (i,k)) * (A $$ (k,j)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (U\<^sub>f * A) $$ (i, j) = (\<Sum>k = 0..<dim_row A. U\<^sub>f $$ (i, k) * A $$ (k, j))
[PROOF STEP]
using assms(1,2,4) index_matrix_prod
[PROOF STATE]
proof (prove)
using this:
i < dim_row U\<^sub>f
j < dim_col A
dim_col U\<^sub>f = dim_row A
\<lbrakk>?i < dim_row ?A; ?j < dim_col ?B; dim_col ?A = dim_row ?B\<rbrakk> \<Longrightarrow> (?A * ?B) $$ (?i, ?j) = (\<Sum>k<dim_row ?B. ?A $$ (?i, k) * ?B $$ (k, ?j))

goal (1 subgoal):
 1. (U\<^sub>f * A) $$ (i, j) = (\<Sum>k = 0..<dim_row A. U\<^sub>f $$ (i, k) * A $$ (k, j))
[PROOF STEP]
by (simp add: atLeast0LessThan)
[PROOF STATE]
proof (state)
this:
(U\<^sub>f * A) $$ (i, j) = (\<Sum>k = 0..<dim_row A. U\<^sub>f $$ (i, k) * A $$ (k, j))

goal (1 subgoal):
 1. (U\<^sub>f * A) $$ (i, j) = (\<Sum>k\<in>{i, i + 1}. U\<^sub>f $$ (i, k) * A $$ (k, j))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(U\<^sub>f * A) $$ (i, j) = (\<Sum>k = 0..<dim_row A. U\<^sub>f $$ (i, k) * A $$ (k, j))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(U\<^sub>f * A) $$ (i, j) = (\<Sum>k = 0..<dim_row A. U\<^sub>f $$ (i, k) * A $$ (k, j))

goal (1 subgoal):
 1. (U\<^sub>f * A) $$ (i, j) = (\<Sum>k\<in>{i, i + 1}. U\<^sub>f $$ (i, k) * A $$ (k, j))
[PROOF STEP]
using assms U\<^sub>f_mult_without_empty_summands_sum_even
[PROOF STATE]
proof (prove)
using this:
(U\<^sub>f * A) $$ (i, j) = (\<Sum>k = 0..<dim_row A. U\<^sub>f $$ (i, k) * A $$ (k, j))
i < dim_row U\<^sub>f
j < dim_col A
even i
dim_col U\<^sub>f = dim_row A
\<lbrakk>?i < dim_row U\<^sub>f; ?j < dim_col ?A; even ?i; dim_col U\<^sub>f = dim_row ?A\<rbrakk> \<Longrightarrow> (\<Sum>k = 0..<dim_row ?A. U\<^sub>f $$ (?i, k) * ?A $$ (k, ?j)) = (\<Sum>k\<in>{?i, ?i + 1}. U\<^sub>f $$ (?i, k) * ?A $$ (k, ?j))

goal (1 subgoal):
 1. (U\<^sub>f * A) $$ (i, j) = (\<Sum>k\<in>{i, i + 1}. U\<^sub>f $$ (i, k) * A $$ (k, j))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(U\<^sub>f * A) $$ (i, j) = (\<Sum>k\<in>{i, i + 1}. U\<^sub>f $$ (i, k) * A $$ (k, j))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma incidence_alt_def:
  assumes "p \<in> \<V>"
  assumes "b \<in># \<B>"
  shows "incident p b \<longleftrightarrow> p \<in> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. incident p b = (p \<in> b)
[PROOF STEP]
by (auto simp add: incident_def \<I>_def assms)


[STATEMENT]
lemma flow_has_derivative:
  assumes "t \<in> existence_ivl t0 x0"
  shows "(flow t0 x0 has_derivative (\<lambda>i. i *\<^sub>R f t (flow t0 x0 t))) (at t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (flow t0 x0 has_derivative (\<lambda>i. i *\<^sub>R f t (flow t0 x0 t))) (at t)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (flow t0 x0 has_derivative (\<lambda>i. i *\<^sub>R f t (flow t0 x0 t))) (at t)
[PROOF STEP]
have "(flow t0 x0 has_derivative (\<lambda>i. i *\<^sub>R f t (flow t0 x0 t))) (at t within existence_ivl t0 x0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (flow t0 x0 has_derivative (\<lambda>i. i *\<^sub>R f t (flow t0 x0 t))) (at t within existence_ivl t0 x0)
[PROOF STEP]
using flow_has_vderiv_on
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>t0 \<in> T; ?x0.0 \<in> X\<rbrakk> \<Longrightarrow> (flow t0 ?x0.0 has_vderiv_on (\<lambda>t. f t (flow t0 ?x0.0 t))) (existence_ivl t0 ?x0.0)

goal (1 subgoal):
 1. (flow t0 x0 has_derivative (\<lambda>i. i *\<^sub>R f t (flow t0 x0 t))) (at t within existence_ivl t0 x0)
[PROOF STEP]
by (auto simp: has_vderiv_on_def has_vector_derivative_def assms mem_existence_ivl_iv_defined[OF assms])
[PROOF STATE]
proof (state)
this:
(flow t0 x0 has_derivative (\<lambda>i. i *\<^sub>R f t (flow t0 x0 t))) (at t within existence_ivl t0 x0)

goal (1 subgoal):
 1. (flow t0 x0 has_derivative (\<lambda>i. i *\<^sub>R f t (flow t0 x0 t))) (at t)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(flow t0 x0 has_derivative (\<lambda>i. i *\<^sub>R f t (flow t0 x0 t))) (at t within existence_ivl t0 x0)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(flow t0 x0 has_derivative (\<lambda>i. i *\<^sub>R f t (flow t0 x0 t))) (at t within existence_ivl t0 x0)

goal (1 subgoal):
 1. (flow t0 x0 has_derivative (\<lambda>i. i *\<^sub>R f t (flow t0 x0 t))) (at t)
[PROOF STEP]
by (simp add: at_within_open[OF assms open_existence_ivl])
[PROOF STATE]
proof (state)
this:
(flow t0 x0 has_derivative (\<lambda>i. i *\<^sub>R f t (flow t0 x0 t))) (at t)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_common_refinement:
  assumes "finite \
" "\<And>P. P \<in> \
 \<Longrightarrow> finite P"
  shows "card (common_refinement \
) \<le> (\<Prod>P \<in> \
. card P)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (common_refinement \
) \<le> prod card \

[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card (common_refinement \
) \<le> prod card \

[PROOF STEP]
have "card (common_refinement \
) \<le> card (\<Union>f \<in> (\<Pi>\<^sub>E P\<in>\
. P). {\<Inter> (f ` \
)})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (common_refinement \
) \<le> card (\<Union>f\<in>\<Pi>\<^sub>E P\<in>\
. P. {\<Inter> (f ` \
)})
[PROOF STEP]
unfolding common_refinement_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card ((\<Union>f\<in>\<Pi>\<^sub>E P\<in>\
. P. {\<Inter> (f ` \<P>)}) - {{}}) \<le> card (\<Union>f\<in>\<Pi>\<^sub>E P\<in>\<P>. P. {\<Inter> (f ` \
)})
[PROOF STEP]
by (meson card_Diff1_le)
[PROOF STATE]
proof (state)
this:
card (common_refinement \
) \<le> card (\<Union>f\<in>\<Pi>\<^sub>E P\<in>\
. P. {\<Inter> (f ` \
)})

goal (1 subgoal):
 1. card (common_refinement \
) \<le> prod card \

[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card (common_refinement \
) \<le> card (\<Union>f\<in>\<Pi>\<^sub>E P\<in>\
. P. {\<Inter> (f ` \
)})

goal (1 subgoal):
 1. card (common_refinement \
) \<le> prod card \

[PROOF STEP]
have "\<dots> \<le> (\<Sum>f\<in>(\<Pi>\<^sub>E P\<in>\
. P). card{\<Inter> (f ` \
)})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (\<Union>f\<in>\<Pi>\<^sub>E P\<in>\
. P. {\<Inter> (f ` \<P>)}) \<le> (\<Sum>f\<in>(\<Pi>\<^sub>E P\<in>\<P>. P). card {\<Inter> (f ` \
)})
[PROOF STEP]
by (metis assms finite_PiE card_UN_le)
[PROOF STATE]
proof (state)
this:
card (\<Union>f\<in>\<Pi>\<^sub>E P\<in>\
. P. {\<Inter> (f ` \<P>)}) \<le> (\<Sum>f\<in>(\<Pi>\<^sub>E P\<in>\<P>. P). card {\<Inter> (f ` \
)})

goal (1 subgoal):
 1. card (common_refinement \
) \<le> prod card \

[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card (\<Union>f\<in>\<Pi>\<^sub>E P\<in>\
. P. {\<Inter> (f ` \<P>)}) \<le> (\<Sum>f\<in>(\<Pi>\<^sub>E P\<in>\<P>. P). card {\<Inter> (f ` \
)})

goal (1 subgoal):
 1. card (common_refinement \
) \<le> prod card \

[PROOF STEP]
have "\<dots> = card(\<Pi>\<^sub>E P\<in>\
. P)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>f\<in>(\<Pi>\<^sub>E P\<in>\
. P). card {\<Inter> (f ` \
)}) = card (\<Pi>\<^sub>E P\<in>\
. P)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>f\<in>(\<Pi>\<^sub>E P\<in>\
. P). card {\<Inter> (f ` \
)}) = card (\<Pi>\<^sub>E P\<in>\
. P)

goal (1 subgoal):
 1. card (common_refinement \
) \<le> prod card \

[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>f\<in>(\<Pi>\<^sub>E P\<in>\
. P). card {\<Inter> (f ` \
)}) = card (\<Pi>\<^sub>E P\<in>\
. P)

goal (1 subgoal):
 1. card (common_refinement \
) \<le> prod card \

[PROOF STEP]
have "\<dots> = (\<Prod>P \<in> \
. card P)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (\<Pi>\<^sub>E P\<in>\
. P) = prod card \

[PROOF STEP]
by (simp add: assms(1) card_PiE dual_order.eq_iff)
[PROOF STATE]
proof (state)
this:
card (\<Pi>\<^sub>E P\<in>\
. P) = prod card \

goal (1 subgoal):
 1. card (common_refinement \
) \<le> prod card \

[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
card (common_refinement \
) \<le> prod card \

[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card (common_refinement \
) \<le> prod card \

goal (1 subgoal):
 1. card (common_refinement \
) \<le> prod card \

[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
card (common_refinement \
) \<le> prod card \

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sums_NSsums_iff: "f sums l \<longleftrightarrow> f NSsums l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f sums l = f NSsums l
[PROOF STEP]
by (simp add: sums_def NSsums_def LIMSEQ_NSLIMSEQ_iff)


[STATEMENT]
lemma prime_dvd_prod_mset_primes_iff:
  assumes "prime p" "\<And>q. q \<in># A \<Longrightarrow> prime q"
  shows   "p dvd prod_mset A \<longleftrightarrow> p \<in># A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (p dvd \<Prod>\<^sub># A) = (p \<in># A)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (p dvd \<Prod>\<^sub># A) = (p \<in># A)
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
prime p
[PROOF STEP]
have "p dvd prod_mset A \<longleftrightarrow> (\<exists>x. x \<in># A \<and> p dvd x)"
[PROOF STATE]
proof (prove)
using this:
prime p

goal (1 subgoal):
 1. (p dvd \<Prod>\<^sub># A) = (\<exists>x. x \<in># A \<and> p dvd x)
[PROOF STEP]
by (rule prime_dvd_prod_mset_iff)
[PROOF STATE]
proof (state)
this:
(p dvd \<Prod>\<^sub># A) = (\<exists>x. x \<in># A \<and> p dvd x)

goal (1 subgoal):
 1. (p dvd \<Prod>\<^sub># A) = (p \<in># A)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(p dvd \<Prod>\<^sub># A) = (\<exists>x. x \<in># A \<and> p dvd x)

goal (1 subgoal):
 1. (p dvd \<Prod>\<^sub># A) = (p \<in># A)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
prime p
?q1 \<in># A \<Longrightarrow> prime ?q1
[PROOF STEP]
have "\<dots> \<longleftrightarrow> p \<in># A"
[PROOF STATE]
proof (prove)
using this:
prime p
?q1 \<in># A \<Longrightarrow> prime ?q1

goal (1 subgoal):
 1. (\<exists>x. x \<in># A \<and> p dvd x) = (p \<in># A)
[PROOF STEP]
by (auto dest: primes_dvd_imp_eq)
[PROOF STATE]
proof (state)
this:
(\<exists>x. x \<in># A \<and> p dvd x) = (p \<in># A)

goal (1 subgoal):
 1. (p dvd \<Prod>\<^sub># A) = (p \<in># A)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(p dvd \<Prod>\<^sub># A) = (p \<in># A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(p dvd \<Prod>\<^sub># A) = (p \<in># A)

goal (1 subgoal):
 1. (p dvd \<Prod>\<^sub># A) = (p \<in># A)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(p dvd \<Prod>\<^sub># A) = (p \<in># A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in jozsa) U\<^sub>f_mult_without_empty_summands_odd:
  fixes i j A
  assumes "i < dim_row U\<^sub>f" and "j < dim_col A" and "odd i" and "dim_col U\<^sub>f = dim_row A"
  shows "(U\<^sub>f * A) $$ (i,j) = (\<Sum>k \<in> {i-1,i}. U\<^sub>f $$ (i,k) * A $$ (k,j)) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (U\<^sub>f * A) $$ (i, j) = (\<Sum>k\<in>{i - 1, i}. U\<^sub>f $$ (i, k) * A $$ (k, j))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (U\<^sub>f * A) $$ (i, j) = (\<Sum>k\<in>{i - 1, i}. U\<^sub>f $$ (i, k) * A $$ (k, j))
[PROOF STEP]
have "(U\<^sub>f * A) $$ (i,j) = (\<Sum>k \<in> {0 ..< dim_row A}. (U\<^sub>f $$ (i,k)) * (A $$ (k,j)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (U\<^sub>f * A) $$ (i, j) = (\<Sum>k = 0..<dim_row A. U\<^sub>f $$ (i, k) * A $$ (k, j))
[PROOF STEP]
using assms(1,2,4) index_matrix_prod
[PROOF STATE]
proof (prove)
using this:
i < dim_row U\<^sub>f
j < dim_col A
dim_col U\<^sub>f = dim_row A
\<lbrakk>?i < dim_row ?A; ?j < dim_col ?B; dim_col ?A = dim_row ?B\<rbrakk> \<Longrightarrow> (?A * ?B) $$ (?i, ?j) = (\<Sum>k<dim_row ?B. ?A $$ (?i, k) * ?B $$ (k, ?j))

goal (1 subgoal):
 1. (U\<^sub>f * A) $$ (i, j) = (\<Sum>k = 0..<dim_row A. U\<^sub>f $$ (i, k) * A $$ (k, j))
[PROOF STEP]
by (simp add: atLeast0LessThan)
[PROOF STATE]
proof (state)
this:
(U\<^sub>f * A) $$ (i, j) = (\<Sum>k = 0..<dim_row A. U\<^sub>f $$ (i, k) * A $$ (k, j))

goal (1 subgoal):
 1. (U\<^sub>f * A) $$ (i, j) = (\<Sum>k\<in>{i - 1, i}. U\<^sub>f $$ (i, k) * A $$ (k, j))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(U\<^sub>f * A) $$ (i, j) = (\<Sum>k = 0..<dim_row A. U\<^sub>f $$ (i, k) * A $$ (k, j))
[PROOF STEP]
show "?thesis"
[PROOF STATE]
proof (prove)
using this:
(U\<^sub>f * A) $$ (i, j) = (\<Sum>k = 0..<dim_row A. U\<^sub>f $$ (i, k) * A $$ (k, j))

goal (1 subgoal):
 1. (U\<^sub>f * A) $$ (i, j) = (\<Sum>k\<in>{i - 1, i}. U\<^sub>f $$ (i, k) * A $$ (k, j))
[PROOF STEP]
using assms U\<^sub>f_mult_without_empty_summands_sum_odd
[PROOF STATE]
proof (prove)
using this:
(U\<^sub>f * A) $$ (i, j) = (\<Sum>k = 0..<dim_row A. U\<^sub>f $$ (i, k) * A $$ (k, j))
i < dim_row U\<^sub>f
j < dim_col A
odd i
dim_col U\<^sub>f = dim_row A
\<lbrakk>?i < dim_row U\<^sub>f; ?j < dim_col ?A; odd ?i; dim_col U\<^sub>f = dim_row ?A\<rbrakk> \<Longrightarrow> (\<Sum>k = 0..<dim_row ?A. U\<^sub>f $$ (?i, k) * ?A $$ (k, ?j)) = (\<Sum>k\<in>{?i - 1, ?i}. U\<^sub>f $$ (?i, k) * ?A $$ (k, ?j))

goal (1 subgoal):
 1. (U\<^sub>f * A) $$ (i, j) = (\<Sum>k\<in>{i - 1, i}. U\<^sub>f $$ (i, k) * A $$ (k, j))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(U\<^sub>f * A) $$ (i, j) = (\<Sum>k\<in>{i - 1, i}. U\<^sub>f $$ (i, k) * A $$ (k, j))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma uncountable_convex:
  fixes a :: "'a::real_normed_vector"
  assumes "convex S" "a \<in> S" "b \<in> S" "a \<noteq> b"
    shows "uncountable S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uncountable S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. uncountable S
[PROOF STEP]
have "uncountable (closed_segment a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uncountable (closed_segment a b)
[PROOF STEP]
by (simp add: uncountable_closed_segment assms)
[PROOF STATE]
proof (state)
this:
uncountable (closed_segment a b)

goal (1 subgoal):
 1. uncountable S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
uncountable (closed_segment a b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
uncountable (closed_segment a b)

goal (1 subgoal):
 1. uncountable S
[PROOF STEP]
by (meson assms convex_contains_segment countable_subset)
[PROOF STATE]
proof (state)
this:
uncountable S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma range_image_mset:
  assumes "set_mset Ds \<subseteq> range f"
  shows "Ds \<in> range (image_mset f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ds \<in> range (image_mset f)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Ds \<in> range (image_mset f)
[PROOF STEP]
have "\<forall>D. D \<in># Ds \<longrightarrow> (\<exists>C. f C = D)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>D. D \<in># Ds \<longrightarrow> (\<exists>C. f C = D)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
set_mset Ds \<subseteq> range f

goal (1 subgoal):
 1. \<forall>D. D \<in># Ds \<longrightarrow> (\<exists>C. f C = D)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>D. D \<in># Ds \<longrightarrow> (\<exists>C. f C = D)

goal (1 subgoal):
 1. Ds \<in> range (image_mset f)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>D. D \<in># Ds \<longrightarrow> (\<exists>C. f C = D)
[PROOF STEP]
obtain f_i where
    f_p: "\<forall>D. D \<in># Ds \<longrightarrow> (f (f_i D) = D)"
[PROOF STATE]
proof (prove)
using this:
\<forall>D. D \<in># Ds \<longrightarrow> (\<exists>C. f C = D)

goal (1 subgoal):
 1. (\<And>f_i. \<forall>D. D \<in># Ds \<longrightarrow> f (f_i D) = D \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<forall>D. D \<in># Ds \<longrightarrow> f (f_i D) = D

goal (1 subgoal):
 1. Ds \<in> range (image_mset f)
[PROOF STEP]
define Cs where
    "Cs \<equiv> image_mset f_i Ds"
[PROOF STATE]
proof (state)
this:
Cs \<equiv> image_mset f_i Ds

goal (1 subgoal):
 1. Ds \<in> range (image_mset f)
[PROOF STEP]
from f_p Cs_def
[PROOF STATE]
proof (chain)
picking this:
\<forall>D. D \<in># Ds \<longrightarrow> f (f_i D) = D
Cs \<equiv> image_mset f_i Ds
[PROOF STEP]
have "image_mset f Cs = Ds"
[PROOF STATE]
proof (prove)
using this:
\<forall>D. D \<in># Ds \<longrightarrow> f (f_i D) = D
Cs \<equiv> image_mset f_i Ds

goal (1 subgoal):
 1. image_mset f Cs = Ds
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
image_mset f Cs = Ds

goal (1 subgoal):
 1. Ds \<in> range (image_mset f)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
image_mset f Cs = Ds
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
image_mset f Cs = Ds

goal (1 subgoal):
 1. Ds \<in> range (image_mset f)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Ds \<in> range (image_mset f)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma convex_hull_list_mono:
  assumes "set Ws \<subseteq> carrier_vec n"
  shows "set Vs \<subseteq> set Ws \<Longrightarrow> convex_hull_list Vs \<subseteq> convex_hull_list Ws"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set Vs \<subseteq> set Ws \<Longrightarrow> convex_hull_list Vs \<subseteq> convex_hull_list Ws
[PROOF STEP]
proof (standard, induction Vs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>set [] \<subseteq> set Ws; x \<in> convex_hull_list []\<rbrakk> \<Longrightarrow> x \<in> convex_hull_list Ws
 2. \<And>a Vs x. \<lbrakk>\<And>x. \<lbrakk>set Vs \<subseteq> set Ws; x \<in> convex_hull_list Vs\<rbrakk> \<Longrightarrow> x \<in> convex_hull_list Ws; set (a # Vs) \<subseteq> set Ws; x \<in> convex_hull_list (a # Vs)\<rbrakk> \<Longrightarrow> x \<in> convex_hull_list Ws
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
set [] \<subseteq> set Ws
x \<in> convex_hull_list []

goal (2 subgoals):
 1. \<And>x. \<lbrakk>set [] \<subseteq> set Ws; x \<in> convex_hull_list []\<rbrakk> \<Longrightarrow> x \<in> convex_hull_list Ws
 2. \<And>a Vs x. \<lbrakk>\<And>x. \<lbrakk>set Vs \<subseteq> set Ws; x \<in> convex_hull_list Vs\<rbrakk> \<Longrightarrow> x \<in> convex_hull_list Ws; set (a # Vs) \<subseteq> set Ws; x \<in> convex_hull_list (a # Vs)\<rbrakk> \<Longrightarrow> x \<in> convex_hull_list Ws
[PROOF STEP]
from Nil(2)
[PROOF STATE]
proof (chain)
picking this:
x \<in> convex_hull_list []
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
x \<in> convex_hull_list []

goal (1 subgoal):
 1. x \<in> convex_hull_list Ws
[PROOF STEP]
unfolding convex_hull_list_def convex_lincomb_list_def
[PROOF STATE]
proof (prove)
using this:
x \<in> {x. \<exists>c. nonneg_lincomb_list c [] x \<and> sum c {0..<length []} = (1::'a)}

goal (1 subgoal):
 1. x \<in> {x. \<exists>c. nonneg_lincomb_list c Ws x \<and> sum c {0..<length Ws} = (1::'a)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> convex_hull_list Ws

goal (1 subgoal):
 1. \<And>a Vs x. \<lbrakk>\<And>x. \<lbrakk>set Vs \<subseteq> set Ws; x \<in> convex_hull_list Vs\<rbrakk> \<Longrightarrow> x \<in> convex_hull_list Ws; set (a # Vs) \<subseteq> set Ws; x \<in> convex_hull_list (a # Vs)\<rbrakk> \<Longrightarrow> x \<in> convex_hull_list Ws
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a Vs x. \<lbrakk>\<And>x. \<lbrakk>set Vs \<subseteq> set Ws; x \<in> convex_hull_list Vs\<rbrakk> \<Longrightarrow> x \<in> convex_hull_list Ws; set (a # Vs) \<subseteq> set Ws; x \<in> convex_hull_list (a # Vs)\<rbrakk> \<Longrightarrow> x \<in> convex_hull_list Ws
[PROOF STEP]
case (Cons v Vs)
[PROOF STATE]
proof (state)
this:
\<lbrakk>set Vs \<subseteq> set Ws; ?x3 \<in> convex_hull_list Vs\<rbrakk> \<Longrightarrow> ?x3 \<in> convex_hull_list Ws
set (v # Vs) \<subseteq> set Ws
x \<in> convex_hull_list (v # Vs)

goal (1 subgoal):
 1. \<And>a Vs x. \<lbrakk>\<And>x. \<lbrakk>set Vs \<subseteq> set Ws; x \<in> convex_hull_list Vs\<rbrakk> \<Longrightarrow> x \<in> convex_hull_list Ws; set (a # Vs) \<subseteq> set Ws; x \<in> convex_hull_list (a # Vs)\<rbrakk> \<Longrightarrow> x \<in> convex_hull_list Ws
[PROOF STEP]
have v: "v \<in> set Ws" and Vs: "set Vs \<subseteq> set Ws"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> set Ws &&& set Vs \<subseteq> set Ws
[PROOF STEP]
using Cons.prems(1)
[PROOF STATE]
proof (prove)
using this:
set (v # Vs) \<subseteq> set Ws

goal (1 subgoal):
 1. v \<in> set Ws &&& set Vs \<subseteq> set Ws
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v \<in> set Ws
set Vs \<subseteq> set Ws

goal (1 subgoal):
 1. \<And>a Vs x. \<lbrakk>\<And>x. \<lbrakk>set Vs \<subseteq> set Ws; x \<in> convex_hull_list Vs\<rbrakk> \<Longrightarrow> x \<in> convex_hull_list Ws; set (a # Vs) \<subseteq> set Ws; x \<in> convex_hull_list (a # Vs)\<rbrakk> \<Longrightarrow> x \<in> convex_hull_list Ws
[PROOF STEP]
hence v1: "v \<in> convex_hull_list Ws"
[PROOF STATE]
proof (prove)
using this:
v \<in> set Ws
set Vs \<subseteq> set Ws

goal (1 subgoal):
 1. v \<in> convex_hull_list Ws
[PROOF STEP]
using set_in_convex_hull_list[OF assms]
[PROOF STATE]
proof (prove)
using this:
v \<in> set Ws
set Vs \<subseteq> set Ws
set Ws \<subseteq> convex_hull_list Ws

goal (1 subgoal):
 1. v \<in> convex_hull_list Ws
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v \<in> convex_hull_list Ws

goal (1 subgoal):
 1. \<And>a Vs x. \<lbrakk>\<And>x. \<lbrakk>set Vs \<subseteq> set Ws; x \<in> convex_hull_list Vs\<rbrakk> \<Longrightarrow> x \<in> convex_hull_list Ws; set (a # Vs) \<subseteq> set Ws; x \<in> convex_hull_list (a # Vs)\<rbrakk> \<Longrightarrow> x \<in> convex_hull_list Ws
[PROOF STEP]
from Cons.prems(2)
[PROOF STATE]
proof (chain)
picking this:
x \<in> convex_hull_list (v # Vs)
[PROOF STEP]
obtain c
    where x: "lincomb_list c (v # Vs) = x" and c0: "\<forall> i < length Vs + 1. c i \<ge> 0"
      and c1: "sum c {0..<length Vs + 1} = 1"
[PROOF STATE]
proof (prove)
using this:
x \<in> convex_hull_list (v # Vs)

goal (1 subgoal):
 1. (\<And>c. \<lbrakk>lincomb_list c (v # Vs) = x; \<forall>i<length Vs + 1. (0::'a) \<le> c i; sum c {0..<length Vs + 1} = (1::'a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding convex_hull_list_def convex_lincomb_list_def nonneg_lincomb_list_def
[PROOF STATE]
proof (prove)
using this:
x \<in> {x. \<exists>c. (lincomb_list c (v # Vs) = x \<and> (\<forall>i<length (v # Vs). (0::'a) \<le> c i)) \<and> sum c {0..<length (v # Vs)} = (1::'a)}

goal (1 subgoal):
 1. (\<And>c. \<lbrakk>lincomb_list c (v # Vs) = x; \<forall>i<length Vs + 1. (0::'a) \<le> c i; sum c {0..<length Vs + 1} = (1::'a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lincomb_list c (v # Vs) = x
\<forall>i<length Vs + 1. (0::'a) \<le> c i
sum c {0..<length Vs + 1} = (1::'a)

goal (1 subgoal):
 1. \<And>a Vs x. \<lbrakk>\<And>x. \<lbrakk>set Vs \<subseteq> set Ws; x \<in> convex_hull_list Vs\<rbrakk> \<Longrightarrow> x \<in> convex_hull_list Ws; set (a # Vs) \<subseteq> set Ws; x \<in> convex_hull_list (a # Vs)\<rbrakk> \<Longrightarrow> x \<in> convex_hull_list Ws
[PROOF STEP]
have x: "x = c 0 \<cdot>\<^sub>v v + lincomb_list (c \<circ> Suc) Vs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = c 0 \<cdot>\<^sub>v v + lincomb_list (c \<circ> Suc) Vs
[PROOF STEP]
using Vs v assms x
[PROOF STATE]
proof (prove)
using this:
set Vs \<subseteq> set Ws
v \<in> set Ws
set Ws \<subseteq> carrier_vec n
lincomb_list c (v # Vs) = x

goal (1 subgoal):
 1. x = c 0 \<cdot>\<^sub>v v + lincomb_list (c \<circ> Suc) Vs
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x = c 0 \<cdot>\<^sub>v v + lincomb_list (c \<circ> Suc) Vs

goal (1 subgoal):
 1. \<And>a Vs x. \<lbrakk>\<And>x. \<lbrakk>set Vs \<subseteq> set Ws; x \<in> convex_hull_list Vs\<rbrakk> \<Longrightarrow> x \<in> convex_hull_list Ws; set (a # Vs) \<subseteq> set Ws; x \<in> convex_hull_list (a # Vs)\<rbrakk> \<Longrightarrow> x \<in> convex_hull_list Ws
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> convex_hull_list Ws
[PROOF STEP]
proof (cases)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> x \<in> convex_hull_list Ws
 2. \<not> ?P \<Longrightarrow> x \<in> convex_hull_list Ws
[PROOF STEP]
assume P: "c 0 = 1"
[PROOF STATE]
proof (state)
this:
c 0 = (1::'a)

goal (2 subgoals):
 1. ?P \<Longrightarrow> x \<in> convex_hull_list Ws
 2. \<not> ?P \<Longrightarrow> x \<in> convex_hull_list Ws
[PROOF STEP]
hence "sum (c \<circ> Suc) {0..<length Vs} = 0"
[PROOF STATE]
proof (prove)
using this:
c 0 = (1::'a)

goal (1 subgoal):
 1. sum (c \<circ> Suc) {0..<length Vs} = (0::'a)
[PROOF STEP]
using sum.atLeast0_lessThan_Suc_shift c1
[PROOF STATE]
proof (prove)
using this:
c 0 = (1::'a)
sum ?g {0..<Suc ?n} = ?g 0 + sum (?g \<circ> Suc) {0..<?n}
sum c {0..<length Vs + 1} = (1::'a)

goal (1 subgoal):
 1. sum (c \<circ> Suc) {0..<length Vs} = (0::'a)
[PROOF STEP]
by (metis One_nat_def R.show_r_zero add.right_neutral add_Suc_right)
[PROOF STATE]
proof (state)
this:
sum (c \<circ> Suc) {0..<length Vs} = (0::'a)

goal (2 subgoals):
 1. ?P \<Longrightarrow> x \<in> convex_hull_list Ws
 2. \<not> ?P \<Longrightarrow> x \<in> convex_hull_list Ws
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
sum (c \<circ> Suc) {0..<length Vs} = (0::'a)

goal (2 subgoals):
 1. ?P \<Longrightarrow> x \<in> convex_hull_list Ws
 2. \<not> ?P \<Longrightarrow> x \<in> convex_hull_list Ws
[PROOF STEP]
have "\<And> i. i \<in> {0..<length Vs} \<Longrightarrow> (c \<circ> Suc) i \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i \<in> {0..<length Vs} \<Longrightarrow> (0::'a) \<le> (c \<circ> Suc) i
[PROOF STEP]
using c0
[PROOF STATE]
proof (prove)
using this:
\<forall>i<length Vs + 1. (0::'a) \<le> c i

goal (1 subgoal):
 1. \<And>i. i \<in> {0..<length Vs} \<Longrightarrow> (0::'a) \<le> (c \<circ> Suc) i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
?i3 \<in> {0..<length Vs} \<Longrightarrow> (0::'a) \<le> (c \<circ> Suc) ?i3

goal (2 subgoals):
 1. ?P \<Longrightarrow> x \<in> convex_hull_list Ws
 2. \<not> ?P \<Longrightarrow> x \<in> convex_hull_list Ws
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
sum (c \<circ> Suc) {0..<length Vs} = (0::'a)
?i3 \<in> {0..<length Vs} \<Longrightarrow> (0::'a) \<le> (c \<circ> Suc) ?i3
[PROOF STEP]
have "\<forall> i \<in> {0..<length Vs}. (c \<circ> Suc) i = 0"
[PROOF STATE]
proof (prove)
using this:
sum (c \<circ> Suc) {0..<length Vs} = (0::'a)
?i3 \<in> {0..<length Vs} \<Longrightarrow> (0::'a) \<le> (c \<circ> Suc) ?i3

goal (1 subgoal):
 1. \<forall>i\<in>{0..<length Vs}. (c \<circ> Suc) i = (0::'a)
[PROOF STEP]
using sum_nonneg_eq_0_iff
[PROOF STATE]
proof (prove)
using this:
sum (c \<circ> Suc) {0..<length Vs} = (0::'a)
?i3 \<in> {0..<length Vs} \<Longrightarrow> (0::'a) \<le> (c \<circ> Suc) ?i3
\<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))

goal (1 subgoal):
 1. \<forall>i\<in>{0..<length Vs}. (c \<circ> Suc) i = (0::'a)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>i\<in>{0..<length Vs}. (c \<circ> Suc) i = (0::'a)

goal (2 subgoals):
 1. ?P \<Longrightarrow> x \<in> convex_hull_list Ws
 2. \<not> ?P \<Longrightarrow> x \<in> convex_hull_list Ws
[PROOF STEP]
hence "\<And> i. i < length Vs \<Longrightarrow> (c \<circ> Suc) i \<cdot>\<^sub>v Vs ! i = 0\<^sub>v n"
[PROOF STATE]
proof (prove)
using this:
\<forall>i\<in>{0..<length Vs}. (c \<circ> Suc) i = (0::'a)

goal (1 subgoal):
 1. \<And>i. i < length Vs \<Longrightarrow> (c \<circ> Suc) i \<cdot>\<^sub>v Vs ! i = 0\<^sub>v n
[PROOF STEP]
using Vs assms
[PROOF STATE]
proof (prove)
using this:
\<forall>i\<in>{0..<length Vs}. (c \<circ> Suc) i = (0::'a)
set Vs \<subseteq> set Ws
set Ws \<subseteq> carrier_vec n

goal (1 subgoal):
 1. \<And>i. i < length Vs \<Longrightarrow> (c \<circ> Suc) i \<cdot>\<^sub>v Vs ! i = 0\<^sub>v n
[PROOF STEP]
by (simp add: subset_code(1))
[PROOF STATE]
proof (state)
this:
?i3 < length Vs \<Longrightarrow> (c \<circ> Suc) ?i3 \<cdot>\<^sub>v Vs ! ?i3 = 0\<^sub>v n

goal (2 subgoals):
 1. ?P \<Longrightarrow> x \<in> convex_hull_list Ws
 2. \<not> ?P \<Longrightarrow> x \<in> convex_hull_list Ws
[PROOF STEP]
hence "lincomb_list (c \<circ> Suc) Vs = 0\<^sub>v n"
[PROOF STATE]
proof (prove)
using this:
?i3 < length Vs \<Longrightarrow> (c \<circ> Suc) ?i3 \<cdot>\<^sub>v Vs ! ?i3 = 0\<^sub>v n

goal (1 subgoal):
 1. lincomb_list (c \<circ> Suc) Vs = 0\<^sub>v n
[PROOF STEP]
using lincomb_list_eq_0
[PROOF STATE]
proof (prove)
using this:
?i3 < length Vs \<Longrightarrow> (c \<circ> Suc) ?i3 \<cdot>\<^sub>v Vs ! ?i3 = 0\<^sub>v n
(\<And>i. i < length ?vs \<Longrightarrow> ?c i \<cdot>\<^sub>v ?vs ! i = 0\<^sub>v n) \<Longrightarrow> lincomb_list ?c ?vs = 0\<^sub>v n

goal (1 subgoal):
 1. lincomb_list (c \<circ> Suc) Vs = 0\<^sub>v n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
lincomb_list (c \<circ> Suc) Vs = 0\<^sub>v n

goal (2 subgoals):
 1. ?P \<Longrightarrow> x \<in> convex_hull_list Ws
 2. \<not> ?P \<Longrightarrow> x \<in> convex_hull_list Ws
[PROOF STEP]
hence "x = v"
[PROOF STATE]
proof (prove)
using this:
lincomb_list (c \<circ> Suc) Vs = 0\<^sub>v n

goal (1 subgoal):
 1. x = v
[PROOF STEP]
using P x v assms
[PROOF STATE]
proof (prove)
using this:
lincomb_list (c \<circ> Suc) Vs = 0\<^sub>v n
c 0 = (1::'a)
x = c 0 \<cdot>\<^sub>v v + lincomb_list (c \<circ> Suc) Vs
v \<in> set Ws
set Ws \<subseteq> carrier_vec n

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

goal (2 subgoals):
 1. ?P \<Longrightarrow> x \<in> convex_hull_list Ws
 2. \<not> ?P \<Longrightarrow> x \<in> convex_hull_list Ws
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
x = v

goal (1 subgoal):
 1. x \<in> convex_hull_list Ws
[PROOF STEP]
using v1
[PROOF STATE]
proof (prove)
using this:
x = v
v \<in> convex_hull_list Ws

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

goal (1 subgoal):
 1. c 0 \<noteq> (1::'a) \<Longrightarrow> x \<in> convex_hull_list Ws
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. c 0 \<noteq> (1::'a) \<Longrightarrow> x \<in> convex_hull_list Ws
[PROOF STEP]
assume P: "c 0 \<noteq> 1"
[PROOF STATE]
proof (state)
this:
c 0 \<noteq> (1::'a)

goal (1 subgoal):
 1. c 0 \<noteq> (1::'a) \<Longrightarrow> x \<in> convex_hull_list Ws
[PROOF STEP]
have c1: "c 0 + sum (c \<circ> Suc) {0..<length Vs} = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c 0 + sum (c \<circ> Suc) {0..<length Vs} = (1::'a)
[PROOF STEP]
using sum.atLeast0_lessThan_Suc_shift[of c] c1
[PROOF STATE]
proof (prove)
using this:
sum c {0..<Suc ?n} = c 0 + sum (c \<circ> Suc) {0..<?n}
sum c {0..<length Vs + 1} = (1::'a)

goal (1 subgoal):
 1. c 0 + sum (c \<circ> Suc) {0..<length Vs} = (1::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
c 0 + sum (c \<circ> Suc) {0..<length Vs} = (1::'a)

goal (1 subgoal):
 1. c 0 \<noteq> (1::'a) \<Longrightarrow> x \<in> convex_hull_list Ws
[PROOF STEP]
have "sum (c \<circ> Suc) {0..<length Vs} \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) \<le> sum (c \<circ> Suc) {0..<length Vs}
[PROOF STEP]
by (rule sum_nonneg, insert c0, simp)
[PROOF STATE]
proof (state)
this:
(0::'a) \<le> sum (c \<circ> Suc) {0..<length Vs}

goal (1 subgoal):
 1. c 0 \<noteq> (1::'a) \<Longrightarrow> x \<in> convex_hull_list Ws
[PROOF STEP]
hence "c 0 < 1"
[PROOF STATE]
proof (prove)
using this:
(0::'a) \<le> sum (c \<circ> Suc) {0..<length Vs}

goal (1 subgoal):
 1. c 0 < (1::'a)
[PROOF STEP]
using P c1
[PROOF STATE]
proof (prove)
using this:
(0::'a) \<le> sum (c \<circ> Suc) {0..<length Vs}
c 0 \<noteq> (1::'a)
c 0 + sum (c \<circ> Suc) {0..<length Vs} = (1::'a)

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

goal (1 subgoal):
 1. c 0 \<noteq> (1::'a) \<Longrightarrow> x \<in> convex_hull_list Ws
[PROOF STEP]
let ?c' = "\<lambda> i. 1 / (1 - c 0) * (c \<circ> Suc) i"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. c 0 \<noteq> (1::'a) \<Longrightarrow> x \<in> convex_hull_list Ws
[PROOF STEP]
have "sum ?c' {0..<length Vs} = 1 / (1 - c 0) * sum (c \<circ> Suc) {0..<length Vs}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<length Vs. (1::'a) / ((1::'a) - c 0) * (c \<circ> Suc) i) = (1::'a) / ((1::'a) - c 0) * sum (c \<circ> Suc) {0..<length Vs}
[PROOF STEP]
using c1 P sum_distrib_left
[PROOF STATE]
proof (prove)
using this:
c 0 + sum (c \<circ> Suc) {0..<length Vs} = (1::'a)
c 0 \<noteq> (1::'a)
?r * sum ?f ?A = (\<Sum>n\<in>?A. ?r * ?f n)

goal (1 subgoal):
 1. (\<Sum>i = 0..<length Vs. (1::'a) / ((1::'a) - c 0) * (c \<circ> Suc) i) = (1::'a) / ((1::'a) - c 0) * sum (c \<circ> Suc) {0..<length Vs}
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<length Vs. (1::'a) / ((1::'a) - c 0) * (c \<circ> Suc) i) = (1::'a) / ((1::'a) - c 0) * sum (c \<circ> Suc) {0..<length Vs}

goal (1 subgoal):
 1. c 0 \<noteq> (1::'a) \<Longrightarrow> x \<in> convex_hull_list Ws
[PROOF STEP]
hence "sum ?c' {0..<length Vs} = 1"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i = 0..<length Vs. (1::'a) / ((1::'a) - c 0) * (c \<circ> Suc) i) = (1::'a) / ((1::'a) - c 0) * sum (c \<circ> Suc) {0..<length Vs}

goal (1 subgoal):
 1. (\<Sum>i = 0..<length Vs. (1::'a) / ((1::'a) - c 0) * (c \<circ> Suc) i) = (1::'a)
[PROOF STEP]
using P c1
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i = 0..<length Vs. (1::'a) / ((1::'a) - c 0) * (c \<circ> Suc) i) = (1::'a) / ((1::'a) - c 0) * sum (c \<circ> Suc) {0..<length Vs}
c 0 \<noteq> (1::'a)
c 0 + sum (c \<circ> Suc) {0..<length Vs} = (1::'a)

goal (1 subgoal):
 1. (\<Sum>i = 0..<length Vs. (1::'a) / ((1::'a) - c 0) * (c \<circ> Suc) i) = (1::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<length Vs. (1::'a) / ((1::'a) - c 0) * (c \<circ> Suc) i) = (1::'a)

goal (1 subgoal):
 1. c 0 \<noteq> (1::'a) \<Longrightarrow> x \<in> convex_hull_list Ws
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<length Vs. (1::'a) / ((1::'a) - c 0) * (c \<circ> Suc) i) = (1::'a)

goal (1 subgoal):
 1. c 0 \<noteq> (1::'a) \<Longrightarrow> x \<in> convex_hull_list Ws
[PROOF STEP]
have "\<forall> i < length Vs. ?c' i \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i<length Vs. (0::'a) \<le> (1::'a) / ((1::'a) - c 0) * (c \<circ> Suc) i
[PROOF STEP]
using c0 \<open>c 0 < 1\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>i<length Vs + 1. (0::'a) \<le> c i
c 0 < (1::'a)

goal (1 subgoal):
 1. \<forall>i<length Vs. (0::'a) \<le> (1::'a) / ((1::'a) - c 0) * (c \<circ> Suc) i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>i<length Vs. (0::'a) \<le> (1::'a) / ((1::'a) - c 0) * (c \<circ> Suc) i

goal (1 subgoal):
 1. c 0 \<noteq> (1::'a) \<Longrightarrow> x \<in> convex_hull_list Ws
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>i = 0..<length Vs. (1::'a) / ((1::'a) - c 0) * (c \<circ> Suc) i) = (1::'a)
\<forall>i<length Vs. (0::'a) \<le> (1::'a) / ((1::'a) - c 0) * (c \<circ> Suc) i
[PROOF STEP]
have c': "lincomb_list ?c' Vs \<in> convex_hull_list Ws"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i = 0..<length Vs. (1::'a) / ((1::'a) - c 0) * (c \<circ> Suc) i) = (1::'a)
\<forall>i<length Vs. (0::'a) \<le> (1::'a) / ((1::'a) - c 0) * (c \<circ> Suc) i

goal (1 subgoal):
 1. lincomb_list (\<lambda>i. (1::'a) / ((1::'a) - c 0) * (c \<circ> Suc) i) Vs \<in> convex_hull_list Ws
[PROOF STEP]
using Cons.IH[OF Vs]
        convex_hull_list_def convex_lincomb_list_def nonneg_lincomb_list_def
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i = 0..<length Vs. (1::'a) / ((1::'a) - c 0) * (c \<circ> Suc) i) = (1::'a)
\<forall>i<length Vs. (0::'a) \<le> (1::'a) / ((1::'a) - c 0) * (c \<circ> Suc) i
?x3 \<in> convex_hull_list Vs \<Longrightarrow> ?x3 \<in> convex_hull_list Ws
convex_hull_list ?Vs = {x. \<exists>c. convex_lincomb_list c ?Vs x}
convex_lincomb_list ?c ?Vs ?b = (nonneg_lincomb_list ?c ?Vs ?b \<and> sum ?c {0..<length ?Vs} = (1::'a))
nonneg_lincomb_list ?c ?Vs ?b = (lincomb_list ?c ?Vs = ?b \<and> (\<forall>i<length ?Vs. (0::'a) \<le> ?c i))

goal (1 subgoal):
 1. lincomb_list (\<lambda>i. (1::'a) / ((1::'a) - c 0) * (c \<circ> Suc) i) Vs \<in> convex_hull_list Ws
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
lincomb_list (\<lambda>i. (1::'a) / ((1::'a) - c 0) * (c \<circ> Suc) i) Vs \<in> convex_hull_list Ws

goal (1 subgoal):
 1. c 0 \<noteq> (1::'a) \<Longrightarrow> x \<in> convex_hull_list Ws
[PROOF STEP]
have "lincomb_list ?c' Vs = 1 / (1 - c 0) \<cdot>\<^sub>v lincomb_list (c \<circ> Suc) Vs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb_list (\<lambda>i. (1::'a) / ((1::'a) - c 0) * (c \<circ> Suc) i) Vs = (1::'a) / ((1::'a) - c 0) \<cdot>\<^sub>v lincomb_list (c \<circ> Suc) Vs
[PROOF STEP]
by(rule lincomb_list_smult, insert Vs assms, auto)
[PROOF STATE]
proof (state)
this:
lincomb_list (\<lambda>i. (1::'a) / ((1::'a) - c 0) * (c \<circ> Suc) i) Vs = (1::'a) / ((1::'a) - c 0) \<cdot>\<^sub>v lincomb_list (c \<circ> Suc) Vs

goal (1 subgoal):
 1. c 0 \<noteq> (1::'a) \<Longrightarrow> x \<in> convex_hull_list Ws
[PROOF STEP]
hence "(1 - c 0) \<cdot>\<^sub>v lincomb_list ?c' Vs = lincomb_list (c \<circ> Suc) Vs"
[PROOF STATE]
proof (prove)
using this:
lincomb_list (\<lambda>i. (1::'a) / ((1::'a) - c 0) * (c \<circ> Suc) i) Vs = (1::'a) / ((1::'a) - c 0) \<cdot>\<^sub>v lincomb_list (c \<circ> Suc) Vs

goal (1 subgoal):
 1. ((1::'a) - c 0) \<cdot>\<^sub>v lincomb_list (\<lambda>i. (1::'a) / ((1::'a) - c 0) * (c \<circ> Suc) i) Vs = lincomb_list (c \<circ> Suc) Vs
[PROOF STEP]
using P
[PROOF STATE]
proof (prove)
using this:
lincomb_list (\<lambda>i. (1::'a) / ((1::'a) - c 0) * (c \<circ> Suc) i) Vs = (1::'a) / ((1::'a) - c 0) \<cdot>\<^sub>v lincomb_list (c \<circ> Suc) Vs
c 0 \<noteq> (1::'a)

goal (1 subgoal):
 1. ((1::'a) - c 0) \<cdot>\<^sub>v lincomb_list (\<lambda>i. (1::'a) / ((1::'a) - c 0) * (c \<circ> Suc) i) Vs = lincomb_list (c \<circ> Suc) Vs
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((1::'a) - c 0) \<cdot>\<^sub>v lincomb_list (\<lambda>i. (1::'a) / ((1::'a) - c 0) * (c \<circ> Suc) i) Vs = lincomb_list (c \<circ> Suc) Vs

goal (1 subgoal):
 1. c 0 \<noteq> (1::'a) \<Longrightarrow> x \<in> convex_hull_list Ws
[PROOF STEP]
hence "x = c 0 \<cdot>\<^sub>v v + (1 - c 0) \<cdot>\<^sub>v lincomb_list ?c' Vs"
[PROOF STATE]
proof (prove)
using this:
((1::'a) - c 0) \<cdot>\<^sub>v lincomb_list (\<lambda>i. (1::'a) / ((1::'a) - c 0) * (c \<circ> Suc) i) Vs = lincomb_list (c \<circ> Suc) Vs

goal (1 subgoal):
 1. x = c 0 \<cdot>\<^sub>v v + ((1::'a) - c 0) \<cdot>\<^sub>v lincomb_list (\<lambda>i. (1::'a) / ((1::'a) - c 0) * (c \<circ> Suc) i) Vs
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
((1::'a) - c 0) \<cdot>\<^sub>v lincomb_list (\<lambda>i. (1::'a) / ((1::'a) - c 0) * (c \<circ> Suc) i) Vs = lincomb_list (c \<circ> Suc) Vs
x = c 0 \<cdot>\<^sub>v v + lincomb_list (c \<circ> Suc) Vs

goal (1 subgoal):
 1. x = c 0 \<cdot>\<^sub>v v + ((1::'a) - c 0) \<cdot>\<^sub>v lincomb_list (\<lambda>i. (1::'a) / ((1::'a) - c 0) * (c \<circ> Suc) i) Vs
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x = c 0 \<cdot>\<^sub>v v + ((1::'a) - c 0) \<cdot>\<^sub>v lincomb_list (\<lambda>i. (1::'a) / ((1::'a) - c 0) * (c \<circ> Suc) i) Vs

goal (1 subgoal):
 1. c 0 \<noteq> (1::'a) \<Longrightarrow> x \<in> convex_hull_list Ws
[PROOF STEP]
thus "x \<in> convex_hull_list Ws"
[PROOF STATE]
proof (prove)
using this:
x = c 0 \<cdot>\<^sub>v v + ((1::'a) - c 0) \<cdot>\<^sub>v lincomb_list (\<lambda>i. (1::'a) / ((1::'a) - c 0) * (c \<circ> Suc) i) Vs

goal (1 subgoal):
 1. x \<in> convex_hull_list Ws
[PROOF STEP]
using convex_hull_list_combination[OF assms v1 c'] c0 \<open>c 0 < 1\<close>
[PROOF STATE]
proof (prove)
using this:
x = c 0 \<cdot>\<^sub>v v + ((1::'a) - c 0) \<cdot>\<^sub>v lincomb_list (\<lambda>i. (1::'a) / ((1::'a) - c 0) * (c \<circ> Suc) i) Vs
\<lbrakk>(0::'a) \<le> ?l; ?l \<le> (1::'a)\<rbrakk> \<Longrightarrow> ?l \<cdot>\<^sub>v v + ((1::'a) - ?l) \<cdot>\<^sub>v lincomb_list (\<lambda>i. (1::'a) / ((1::'a) - c 0) * (c \<circ> Suc) i) Vs \<in> convex_hull_list Ws
\<forall>i<length Vs + 1. (0::'a) \<le> c i
c 0 < (1::'a)

goal (1 subgoal):
 1. x \<in> convex_hull_list Ws
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x \<in> convex_hull_list Ws

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<in> convex_hull_list Ws

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma greaterThanAtMost_iff[simp]: "(i \<in> {l<\<^sub>a..\<le>\<^sub>au}) = (l <\<^sub>a i \<and> i \<le>\<^sub>a u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (i \<in> {l<\<^sub>a..\<le>\<^sub>au}) = (l <\<^sub>a i \<and> i \<le>\<^sub>a u)
[PROOF STEP]
unfolding interval_def ray_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (i \<in> {x \<in> UNIV. l <\<^sub>a x} \<inter> {x \<in> UNIV. x \<le>\<^sub>a u}) = (l <\<^sub>a i \<and> i \<le>\<^sub>a u)
[PROOF STEP]
by simp


[STATEMENT]
lemma p_dvd_orbit_size:
  assumes orderG:"order G = p ^ a"
  assumes prime:"prime p"
  assumes finM:"finite M"
  assumes Norbit:"N \<in> orbits"
  assumes "card N > 1"
  shows "p dvd card N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p dvd card N
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p dvd card N
[PROOF STEP]
from Norbit
[PROOF STATE]
proof (chain)
picking this:
N \<in> orbits
[PROOF STEP]
obtain m where m:"m \<in> M" "N = orbit m"
[PROOF STATE]
proof (prove)
using this:
N \<in> orbits

goal (1 subgoal):
 1. (\<And>m. \<lbrakk>m \<in> M; N = orbit m\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding orbits_def quotient_def orbit_def
[PROOF STATE]
proof (prove)
using this:
N \<in> (\<Union>x\<in>M. {same_orbit_rel `` {x}})

goal (1 subgoal):
 1. (\<And>m. \<lbrakk>m \<in> M; N = same_orbit_rel `` {m}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
m \<in> M
N = orbit m

goal (1 subgoal):
 1. p dvd card N
[PROOF STEP]
from prime
[PROOF STATE]
proof (chain)
picking this:
prime p
[PROOF STEP]
have "0 < p ^ a"
[PROOF STATE]
proof (prove)
using this:
prime p

goal (1 subgoal):
 1. 0 < p ^ a
[PROOF STEP]
by (simp add: prime_gt_0_nat)
[PROOF STATE]
proof (state)
this:
0 < p ^ a

goal (1 subgoal):
 1. p dvd card N
[PROOF STEP]
with orderG
[PROOF STATE]
proof (chain)
picking this:
order G = p ^ a
0 < p ^ a
[PROOF STEP]
have "finite (carrier G)"
[PROOF STATE]
proof (prove)
using this:
order G = p ^ a
0 < p ^ a

goal (1 subgoal):
 1. finite (carrier G)
[PROOF STEP]
unfolding order_def
[PROOF STATE]
proof (prove)
using this:
card (carrier G) = p ^ a
0 < p ^ a

goal (1 subgoal):
 1. finite (carrier G)
[PROOF STEP]
by (metis card.infinite less_nat_zero_code)
[PROOF STATE]
proof (state)
this:
finite (carrier G)

goal (1 subgoal):
 1. p dvd card N
[PROOF STEP]
with m
[PROOF STATE]
proof (chain)
picking this:
m \<in> M
N = orbit m
finite (carrier G)
[PROOF STEP]
have "order G = card (orbit m) * card (stabilizer m)"
[PROOF STATE]
proof (prove)
using this:
m \<in> M
N = orbit m
finite (carrier G)

goal (1 subgoal):
 1. order G = card (orbit m) * card (stabilizer m)
[PROOF STEP]
by (metis orbit_size)
[PROOF STATE]
proof (state)
this:
order G = card (orbit m) * card (stabilizer m)

goal (1 subgoal):
 1. p dvd card N
[PROOF STEP]
with orderG m
[PROOF STATE]
proof (chain)
picking this:
order G = p ^ a
m \<in> M
N = orbit m
order G = card (orbit m) * card (stabilizer m)
[PROOF STEP]
have "p ^ a = card N * card (stabilizer m)"
[PROOF STATE]
proof (prove)
using this:
order G = p ^ a
m \<in> M
N = orbit m
order G = card (orbit m) * card (stabilizer m)

goal (1 subgoal):
 1. p ^ a = card N * card (stabilizer m)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
p ^ a = card N * card (stabilizer m)

goal (1 subgoal):
 1. p dvd card N
[PROOF STEP]
with \<open>card N > 1\<close>
[PROOF STATE]
proof (chain)
picking this:
1 < card N
p ^ a = card N * card (stabilizer m)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
1 < card N
p ^ a = card N * card (stabilizer m)

goal (1 subgoal):
 1. p dvd card N
[PROOF STEP]
by (metis dvd_mult2 dvd_mult_cancel1 nat_dvd_not_less nat_mult_1 prime
          prime_dvd_power_nat prime_factor_nat prime_nat_iff zero_less_one)
[PROOF STATE]
proof (state)
this:
p dvd card N

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma liset_mcont: "Complete_Partial_Order2.mcont lSup lprefix Sup less_eq (liset A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mcont lSup lprefix \<Union> (\<subseteq>) (liset A)
[PROOF STEP]
unfolding lprefix_lSup_revert
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mcont Sup (\<le>) \<Union> (\<subseteq>) (liset A)
[PROOF STEP]
by (blast intro: mcontI monotoneI contI)


[STATEMENT]
lemma chart_inj_on [simp]:
  fixes c :: "('a, 'b) chart"
  assumes "x \<in> domain c" "y \<in> domain c"
  shows "c x = c y \<longleftrightarrow> x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (apply_chart c x = apply_chart c y) = (x = y)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (apply_chart c x = apply_chart c y) = (x = y)
[PROOF STEP]
have "inj_on c (domain c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (apply_chart c) (domain c)
[PROOF STEP]
by (rule inj_on_apply_chart)
[PROOF STATE]
proof (state)
this:
inj_on (apply_chart c) (domain c)

goal (1 subgoal):
 1. (apply_chart c x = apply_chart c y) = (x = y)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
x \<in> domain c
y \<in> domain c
inj_on (apply_chart c) (domain c)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<in> domain c
y \<in> domain c
inj_on (apply_chart c) (domain c)

goal (1 subgoal):
 1. (apply_chart c x = apply_chart c y) = (x = y)
[PROOF STEP]
by (auto simp: inj_on_def)
[PROOF STATE]
proof (state)
this:
(apply_chart c x = apply_chart c y) = (x = y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma filterlim_at_infinity_imp_filterlim_at_top:
  assumes "filterlim (f :: 'a \<Rightarrow> real) at_infinity F"
  assumes "eventually (\<lambda>x. f x > 0) F"
  shows   "filterlim f at_top F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filterlim f at_top F
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. filterlim f at_top F
[PROOF STEP]
from assms(2)
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in F. 0 < f x
[PROOF STEP]
have *: "eventually (\<lambda>x. norm (f x) = f x) F"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. 0 < f x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. norm (f x) = f x
[PROOF STEP]
by eventually_elim simp
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. norm (f x) = f x

goal (1 subgoal):
 1. filterlim f at_top F
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
filterlim f at_infinity F
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
filterlim f at_infinity F

goal (1 subgoal):
 1. filterlim f at_top F
[PROOF STEP]
unfolding filterlim_at_infinity_conv_norm_at_top
[PROOF STATE]
proof (prove)
using this:
LIM x F. norm (f x) :> at_top

goal (1 subgoal):
 1. filterlim f at_top F
[PROOF STEP]
by (subst (asm) filterlim_cong[OF refl refl *])
[PROOF STATE]
proof (state)
this:
filterlim f at_top F

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma trans_T: "P \<sqsubseteq>\<^sub>T Q \<Longrightarrow> Q \<sqsubseteq>\<^sub>T S \<Longrightarrow> P \<sqsubseteq>\<^sub>T S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>P \<sqsubseteq>\<^sub>T Q; Q \<sqsubseteq>\<^sub>T S\<rbrakk> \<Longrightarrow> P \<sqsubseteq>\<^sub>T S
[PROOF STEP]
by (meson trace_refine_def order_trans)


[STATEMENT]
lemma Complex_divide:
    "(x / y) = Complex ((Re x * Re y + Im x * Im y) / ((Re y)\<^sup>2 + (Im y)\<^sup>2))
                       ((Im x * Re y - Re x * Im y) / ((Re y)\<^sup>2 + (Im y)\<^sup>2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x / y = Complex ((Re x * Re y + Im x * Im y) / ((Re y)\<^sup>2 + (Im y)\<^sup>2)) ((Im x * Re y - Re x * Im y) / ((Re y)\<^sup>2 + (Im y)\<^sup>2))
[PROOF STEP]
by (metis Im_divide Re_divide complex_surj)


[STATEMENT]
lemma (in comm_monoid) nat_pow_distrib:
  fixes n::nat
  assumes "x \<in> carrier G" "y \<in> carrier G"
  shows "(x \<otimes> y) [^] n = x [^] n \<otimes> y [^] n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<otimes> y) [^] n = x [^] n \<otimes> y [^] n
[PROOF STEP]
by (simp add: assms pow_mult_distrib m_comm)


[STATEMENT]
lemma pcompose_monom: "pcompose (Polynomial.monom c n) p = Polynomial.smult c (p ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Polynomial.monom c n \<circ>\<^sub>p p = Polynomial.smult c (p ^ n)
[PROOF STEP]
by (simp add: monom_altdef pcompose_hom.hom_power pcompose_smult)


[STATEMENT]
lemma supp_Conj [simp]:
  assumes "finite (supp xset)"
  shows "supp (Conj xset) = supp xset"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. supp (Conj xset) = supp xset
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite (supp xset)

goal (1 subgoal):
 1. supp (Conj xset) = supp xset
[PROOF STEP]
unfolding Conj_def
[PROOF STATE]
proof (prove)
using this:
finite (supp xset)

goal (1 subgoal):
 1. supp (Abs_formula (Conj\<^sub>\<alpha> (map_bset Rep_formula xset))) = supp xset
[PROOF STEP]
by simp


[STATEMENT]
lemma eq_vector_fraction_iff [vector_add_divide_simps]:
  fixes x :: "'a :: real_vector"
  shows "(x = (u / v) *\<^sub>R a) \<longleftrightarrow> (if v=0 then x = 0 else v *\<^sub>R x = u *\<^sub>R a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x = (u / v) *\<^sub>R a) = (if v = 0 then x = (0::'a) else v *\<^sub>R x = u *\<^sub>R a)
[PROOF STEP]
by auto (metis (no_types) divide_eq_1_iff divide_inverse_commute scaleR_one scaleR_scaleR)


[STATEMENT]
lemma listgcd_greatest: "(\<And> x. x \<in> set xs \<Longrightarrow> y dvd x) \<Longrightarrow> y dvd listgcd xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> set xs \<Longrightarrow> y dvd x) \<Longrightarrow> y dvd listgcd xs
[PROOF STEP]
by (induct xs arbitrary:y, auto intro: gcd_greatest)


[STATEMENT]
lemma (in complete_measure) null_sets_iff_AE: "A \<in> null_sets M \<longleftrightarrow> ((AE x in M. x \<notin> A) \<and> A \<subseteq> space M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A \<in> null_sets M) = ((AE x in M. x \<notin> A) \<and> A \<subseteq> space M)
[PROOF STEP]
unfolding AE_iff_null_sets
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A \<in> null_sets M) = ({x \<in> space M. \<not> x \<notin> A} \<in> null_sets M \<and> A \<subseteq> space M)
[PROOF STEP]
by (auto cong: rev_conj_cong dest: sets.sets_into_space simp: subset_eq)


[STATEMENT]
lemma complex_poly: assumes re: "re represents (Re x)"
   and im: "im represents (Im x)"
  shows "\<exists> f \<in> set (complex_poly re im). f represents x" "\<And> f. f \<in> set (complex_poly re im) \<Longrightarrow> poly_cond f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f\<in>set (complex_poly re im). f represents x &&& (\<And>f. f \<in> set (complex_poly re im) \<Longrightarrow> poly_cond f)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>f\<in>set (complex_poly re im). f represents x
 2. \<And>f. f \<in> set (complex_poly re im) \<Longrightarrow> poly_cond f
[PROOF STEP]
let ?p = "poly_add re (poly_mult im [:1, 0, 1:])"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>f\<in>set (complex_poly re im). f represents x
 2. \<And>f. f \<in> set (complex_poly re im) \<Longrightarrow> poly_cond f
[PROOF STEP]
from re
[PROOF STATE]
proof (chain)
picking this:
re represents Re x
[PROOF STEP]
have re: "re represents complex_of_real (Re x)"
[PROOF STATE]
proof (prove)
using this:
re represents Re x

goal (1 subgoal):
 1. re represents complex_of_real (Re x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
re represents complex_of_real (Re x)

goal (2 subgoals):
 1. \<exists>f\<in>set (complex_poly re im). f represents x
 2. \<And>f. f \<in> set (complex_poly re im) \<Longrightarrow> poly_cond f
[PROOF STEP]
from im
[PROOF STATE]
proof (chain)
picking this:
im represents Im x
[PROOF STEP]
have im: "im represents complex_of_real (Im x)"
[PROOF STATE]
proof (prove)
using this:
im represents Im x

goal (1 subgoal):
 1. im represents complex_of_real (Im x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
im represents complex_of_real (Im x)

goal (2 subgoals):
 1. \<exists>f\<in>set (complex_poly re im). f represents x
 2. \<And>f. f \<in> set (complex_poly re im) \<Longrightarrow> poly_cond f
[PROOF STEP]
have "[:1,0,1:] represents \<i>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [:1, 0, 1:] represents \<i>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
[:1, 0, 1:] represents \<i>

goal (2 subgoals):
 1. \<exists>f\<in>set (complex_poly re im). f represents x
 2. \<And>f. f \<in> set (complex_poly re im) \<Longrightarrow> poly_cond f
[PROOF STEP]
from represents_add[OF re represents_mult[OF im this]]
[PROOF STATE]
proof (chain)
picking this:
poly [:1, 0, 1:] 0 \<noteq> 0 \<Longrightarrow> poly_add re (poly_mult im [:1, 0, 1:]) represents complex_of_real (Re x) + complex_of_real (Im x) * \<i>
[PROOF STEP]
have "?p represents of_real (Re x) + complex_of_real (Im x) * \<i>"
[PROOF STATE]
proof (prove)
using this:
poly [:1, 0, 1:] 0 \<noteq> 0 \<Longrightarrow> poly_add re (poly_mult im [:1, 0, 1:]) represents complex_of_real (Re x) + complex_of_real (Im x) * \<i>

goal (1 subgoal):
 1. poly_add re (poly_mult im [:1, 0, 1:]) represents complex_of_real (Re x) + complex_of_real (Im x) * \<i>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
poly_add re (poly_mult im [:1, 0, 1:]) represents complex_of_real (Re x) + complex_of_real (Im x) * \<i>

goal (2 subgoals):
 1. \<exists>f\<in>set (complex_poly re im). f represents x
 2. \<And>f. f \<in> set (complex_poly re im) \<Longrightarrow> poly_cond f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
poly_add re (poly_mult im [:1, 0, 1:]) represents complex_of_real (Re x) + complex_of_real (Im x) * \<i>

goal (2 subgoals):
 1. \<exists>f\<in>set (complex_poly re im). f represents x
 2. \<And>f. f \<in> set (complex_poly re im) \<Longrightarrow> poly_cond f
[PROOF STEP]
have "of_real (Re x) + complex_of_real (Im x) * \<i> = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. complex_of_real (Re x) + complex_of_real (Im x) * \<i> = x
[PROOF STEP]
by (metis complex_eq mult.commute)
[PROOF STATE]
proof (state)
this:
complex_of_real (Re x) + complex_of_real (Im x) * \<i> = x

goal (2 subgoals):
 1. \<exists>f\<in>set (complex_poly re im). f represents x
 2. \<And>f. f \<in> set (complex_poly re im) \<Longrightarrow> poly_cond f
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
poly_add re (poly_mult im [:1, 0, 1:]) represents x
[PROOF STEP]
have p: "?p represents x"
[PROOF STATE]
proof (prove)
using this:
poly_add re (poly_mult im [:1, 0, 1:]) represents x

goal (1 subgoal):
 1. poly_add re (poly_mult im [:1, 0, 1:]) represents x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
poly_add re (poly_mult im [:1, 0, 1:]) represents x

goal (2 subgoals):
 1. \<exists>f\<in>set (complex_poly re im). f represents x
 2. \<And>f. f \<in> set (complex_poly re im) \<Longrightarrow> poly_cond f
[PROOF STEP]
have "factors_of_int_poly ?p = complex_poly re im"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. factors_of_int_poly (poly_add re (poly_mult im [:1, 0, 1:])) = complex_poly re im
[PROOF STEP]
unfolding complex_poly_def Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. factors_of_int_poly (poly_add re (poly_mult im [:1, 0, 1:])) = factors_of_int_poly (poly_add re (poly_mult im [:1, 0, 1:]))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
factors_of_int_poly (poly_add re (poly_mult im [:1, 0, 1:])) = complex_poly re im

goal (2 subgoals):
 1. \<exists>f\<in>set (complex_poly re im). f represents x
 2. \<And>f. f \<in> set (complex_poly re im) \<Longrightarrow> poly_cond f
[PROOF STEP]
from factors_of_int_poly(1)[OF this] factors_of_int_poly(2)[OF this, of x] p
[PROOF STATE]
proof (chain)
picking this:
?q \<in> set (complex_poly re im) \<Longrightarrow> irreducible ?q \<and> 0 < lead_coeff ?q \<and> degree ?q \<le> degree (poly_add re (poly_mult im [:1, 0, 1:])) \<and> degree ?q \<noteq> 0
poly_add re (poly_mult im [:1, 0, 1:]) \<noteq> 0 \<Longrightarrow> (poly (complex_of_int_poly (poly_add re (poly_mult im [:1, 0, 1:]))) x = 0) = (\<exists>q\<in>set (complex_poly re im). poly (complex_of_int_poly q) x = 0)
poly_add re (poly_mult im [:1, 0, 1:]) represents x
[PROOF STEP]
show "\<exists> f \<in> set (complex_poly re im). f represents x" "\<And> f. f \<in> set (complex_poly re im) \<Longrightarrow> poly_cond f"
[PROOF STATE]
proof (prove)
using this:
?q \<in> set (complex_poly re im) \<Longrightarrow> irreducible ?q \<and> 0 < lead_coeff ?q \<and> degree ?q \<le> degree (poly_add re (poly_mult im [:1, 0, 1:])) \<and> degree ?q \<noteq> 0
poly_add re (poly_mult im [:1, 0, 1:]) \<noteq> 0 \<Longrightarrow> (poly (complex_of_int_poly (poly_add re (poly_mult im [:1, 0, 1:]))) x = 0) = (\<exists>q\<in>set (complex_poly re im). poly (complex_of_int_poly q) x = 0)
poly_add re (poly_mult im [:1, 0, 1:]) represents x

goal (1 subgoal):
 1. \<exists>f\<in>set (complex_poly re im). f represents x &&& (\<And>f. f \<in> set (complex_poly re im) \<Longrightarrow> poly_cond f)
[PROOF STEP]
unfolding represents_def
[PROOF STATE]
proof (prove)
using this:
?q \<in> set (complex_poly re im) \<Longrightarrow> irreducible ?q \<and> 0 < lead_coeff ?q \<and> degree ?q \<le> degree (poly_add re (poly_mult im [:1, 0, 1:])) \<and> degree ?q \<noteq> 0
poly_add re (poly_mult im [:1, 0, 1:]) \<noteq> 0 \<Longrightarrow> (poly (complex_of_int_poly (poly_add re (poly_mult im [:1, 0, 1:]))) x = 0) = (\<exists>q\<in>set (complex_poly re im). poly (complex_of_int_poly q) x = 0)
poly (complex_of_int_poly (poly_add re (poly_mult im [:1, 0, 1:]))) x = 0 \<and> poly_add re (poly_mult im [:1, 0, 1:]) \<noteq> 0

goal (1 subgoal):
 1. \<exists>f\<in>set (complex_poly re im). poly (complex_of_int_poly f) x = 0 \<and> f \<noteq> 0 &&& (\<And>f. f \<in> set (complex_poly re im) \<Longrightarrow> poly_cond f)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>f\<in>set (complex_poly re im). f represents x
?f \<in> set (complex_poly re im) \<Longrightarrow> poly_cond ?f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma i1_ne_infinity [simp]: "1 \<noteq> (\<infinity>::eint)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<noteq> \<infinity>
[PROOF STEP]
by (simp add: one_eint_def)


[STATEMENT]
lemma sum_divisors_moebius_mu_times_multiplicative:
  fixes f :: "nat \<Rightarrow> 'a :: {comm_ring_1}"
  assumes "multiplicative_function f" and "n > 0"
  shows   "(\<Sum>d | d dvd n. moebius_mu d * f d) = (\<Prod>p\<in>prime_factors n. 1 - f p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>d | d dvd n. moebius_mu d * f d) = (\<Prod>p\<in>prime_factors n. (1::'a) - f p)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>d | d dvd n. moebius_mu d * f d) = (\<Prod>p\<in>prime_factors n. (1::'a) - f p)
[PROOF STEP]
define g where "g = (\<lambda>n. \<Sum>d | d dvd n. moebius_mu d * f d)"
[PROOF STATE]
proof (state)
this:
g = (\<lambda>n. \<Sum>d | d dvd n. moebius_mu d * f d)

goal (1 subgoal):
 1. (\<Sum>d | d dvd n. moebius_mu d * f d) = (\<Prod>p\<in>prime_factors n. (1::'a) - f p)
[PROOF STEP]
define g' where "g' = dirichlet_prod (\<lambda>n. moebius_mu n * f n) (\<lambda>n. if n = 0 then 0 else 1)"
[PROOF STATE]
proof (state)
this:
g' = dirichlet_prod (\<lambda>n. moebius_mu n * f n) (\<lambda>n. if n = 0 then 0::'a else (1::'a))

goal (1 subgoal):
 1. (\<Sum>d | d dvd n. moebius_mu d * f d) = (\<Prod>p\<in>prime_factors n. (1::'a) - f p)
[PROOF STEP]
interpret f: multiplicative_function f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicative_function f
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>d | d dvd n. moebius_mu d * f d) = (\<Prod>p\<in>prime_factors n. (1::'a) - f p)
[PROOF STEP]
have "multiplicative_function (\<lambda>n. if n = 0 then 0 else 1 :: 'a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicative_function (\<lambda>n. if n = 0 then 0::'a else (1::'a))
[PROOF STEP]
by standard auto
[PROOF STATE]
proof (state)
this:
multiplicative_function (\<lambda>n. if n = 0 then 0::'a else (1::'a))

goal (1 subgoal):
 1. (\<Sum>d | d dvd n. moebius_mu d * f d) = (\<Prod>p\<in>prime_factors n. (1::'a) - f p)
[PROOF STEP]
interpret multiplicative_function g'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicative_function g'
[PROOF STEP]
unfolding g'_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicative_function (dirichlet_prod (\<lambda>n. moebius_mu n * f n) (\<lambda>n. if n = 0 then 0::'a else (1::'a)))
[PROOF STEP]
by (intro multiplicative_dirichlet_prod multiplicative_function_mult
              moebius_mu.multiplicative_function_axioms assms) fact+
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>d | d dvd n. moebius_mu d * f d) = (\<Prod>p\<in>prime_factors n. (1::'a) - f p)
[PROOF STEP]
have g'_primepow: "g' (p ^ k) = 1 - f p" if "prime p" "k > 0" for p k
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g' (p ^ k) = (1::'a) - f p
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. g' (p ^ k) = (1::'a) - f p
[PROOF STEP]
have "g' (p ^ k) = (\<Sum>i\<le>k. moebius_mu (p ^ i) * f (p ^ i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g' (p ^ k) = (\<Sum>i\<le>k. moebius_mu (p ^ i) * f (p ^ i))
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
prime p
0 < k

goal (1 subgoal):
 1. g' (p ^ k) = (\<Sum>i\<le>k. moebius_mu (p ^ i) * f (p ^ i))
[PROOF STEP]
by (simp add: g'_def dirichlet_prod_prime_power)
[PROOF STATE]
proof (state)
this:
g' (p ^ k) = (\<Sum>i\<le>k. moebius_mu (p ^ i) * f (p ^ i))

goal (1 subgoal):
 1. g' (p ^ k) = (1::'a) - f p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
g' (p ^ k) = (\<Sum>i\<le>k. moebius_mu (p ^ i) * f (p ^ i))

goal (1 subgoal):
 1. g' (p ^ k) = (1::'a) - f p
[PROOF STEP]
have "\<dots> = (\<Sum>i\<in>{0, 1}. moebius_mu (p ^ i) * f (p ^ i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>k. moebius_mu (p ^ i) * f (p ^ i)) = (\<Sum>i\<in>{0, 1}. moebius_mu (p ^ i) * f (p ^ i))
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
prime p
0 < k

goal (1 subgoal):
 1. (\<Sum>i\<le>k. moebius_mu (p ^ i) * f (p ^ i)) = (\<Sum>i\<in>{0, 1}. moebius_mu (p ^ i) * f (p ^ i))
[PROOF STEP]
by (intro sum.mono_neutral_right) (auto simp: moebius_mu_power')
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>k. moebius_mu (p ^ i) * f (p ^ i)) = (\<Sum>i\<in>{0, 1}. moebius_mu (p ^ i) * f (p ^ i))

goal (1 subgoal):
 1. g' (p ^ k) = (1::'a) - f p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>k. moebius_mu (p ^ i) * f (p ^ i)) = (\<Sum>i\<in>{0, 1}. moebius_mu (p ^ i) * f (p ^ i))

goal (1 subgoal):
 1. g' (p ^ k) = (1::'a) - f p
[PROOF STEP]
have "\<dots> = 1 - f p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>{0, 1}. moebius_mu (p ^ i) * f (p ^ i)) = (1::'a) - f p
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
prime p
0 < k

goal (1 subgoal):
 1. (\<Sum>i\<in>{0, 1}. moebius_mu (p ^ i) * f (p ^ i)) = (1::'a) - f p
[PROOF STEP]
by (simp add: moebius_mu.prime)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>{0, 1}. moebius_mu (p ^ i) * f (p ^ i)) = (1::'a) - f p

goal (1 subgoal):
 1. g' (p ^ k) = (1::'a) - f p
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
g' (p ^ k) = (1::'a) - f p
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
g' (p ^ k) = (1::'a) - f p

goal (1 subgoal):
 1. g' (p ^ k) = (1::'a) - f p
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
g' (p ^ k) = (1::'a) - f p

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>prime ?p; 0 < ?k\<rbrakk> \<Longrightarrow> g' (?p ^ ?k) = (1::'a) - f ?p

goal (1 subgoal):
 1. (\<Sum>d | d dvd n. moebius_mu d * f d) = (\<Prod>p\<in>prime_factors n. (1::'a) - f p)
[PROOF STEP]
have "g' n = g n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g' n = g n
[PROOF STEP]
by (simp add: g_def g'_def dirichlet_prod_def)
[PROOF STATE]
proof (state)
this:
g' n = g n

goal (1 subgoal):
 1. (\<Sum>d | d dvd n. moebius_mu d * f d) = (\<Prod>p\<in>prime_factors n. (1::'a) - f p)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
g' n = g n

goal (1 subgoal):
 1. (\<Sum>d | d dvd n. moebius_mu d * f d) = (\<Prod>p\<in>prime_factors n. (1::'a) - f p)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
multiplicative_function f
0 < n
[PROOF STEP]
have "g' n = (\<Prod>p\<in>prime_factors n. g' (p ^ multiplicity p n))"
[PROOF STATE]
proof (prove)
using this:
multiplicative_function f
0 < n

goal (1 subgoal):
 1. g' n = (\<Prod>p\<in>prime_factors n. g' (p ^ multiplicity p n))
[PROOF STEP]
by (intro prod_prime_factors) auto
[PROOF STATE]
proof (state)
this:
g' n = (\<Prod>p\<in>prime_factors n. g' (p ^ multiplicity p n))

goal (1 subgoal):
 1. (\<Sum>d | d dvd n. moebius_mu d * f d) = (\<Prod>p\<in>prime_factors n. (1::'a) - f p)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
g' n = (\<Prod>p\<in>prime_factors n. g' (p ^ multiplicity p n))

goal (1 subgoal):
 1. (\<Sum>d | d dvd n. moebius_mu d * f d) = (\<Prod>p\<in>prime_factors n. (1::'a) - f p)
[PROOF STEP]
have "\<dots> = (\<Prod>p\<in>prime_factors n. 1 - f p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>p\<in>prime_factors n. g' (p ^ multiplicity p n)) = (\<Prod>p\<in>prime_factors n. (1::'a) - f p)
[PROOF STEP]
by (intro prod.cong) (auto simp: g'_primepow prime_factors_multiplicity)
[PROOF STATE]
proof (state)
this:
(\<Prod>p\<in>prime_factors n. g' (p ^ multiplicity p n)) = (\<Prod>p\<in>prime_factors n. (1::'a) - f p)

goal (1 subgoal):
 1. (\<Sum>d | d dvd n. moebius_mu d * f d) = (\<Prod>p\<in>prime_factors n. (1::'a) - f p)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Prod>p\<in>prime_factors n. (1::'a) - f p) = g n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Prod>p\<in>prime_factors n. (1::'a) - f p) = g n

goal (1 subgoal):
 1. (\<Sum>d | d dvd n. moebius_mu d * f d) = (\<Prod>p\<in>prime_factors n. (1::'a) - f p)
[PROOF STEP]
by (simp add: g_def)
[PROOF STATE]
proof (state)
this:
(\<Sum>d | d dvd n. moebius_mu d * f d) = (\<Prod>p\<in>prime_factors n. (1::'a) - f p)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bounded_SUP_mul[simp]:
  "X \<noteq> {} \<Longrightarrow> 0 \<le> l \<Longrightarrow> bounded (f ` X) \<Longrightarrow> (\<Squnion>x \<in> X. (l :: real) * f x) = (l * (\<Squnion>x \<in> X. f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>X \<noteq> {}; 0 \<le> l; bounded (f ` X)\<rbrakk> \<Longrightarrow> (\<Squnion>x\<in>X. l * f x) = l * \<Squnion> (f ` X)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>X \<noteq> {}; 0 \<le> l; bounded (f ` X)\<rbrakk> \<Longrightarrow> (\<Squnion>x\<in>X. l * f x) = l * \<Squnion> (f ` X)
[PROOF STEP]
assume "X \<noteq> {} "" bounded (f ` X)" "0 \<le> l"
[PROOF STATE]
proof (state)
this:
X \<noteq> {}
bounded (f ` X)
0 \<le> l

goal (1 subgoal):
 1. \<lbrakk>X \<noteq> {}; 0 \<le> l; bounded (f ` X)\<rbrakk> \<Longrightarrow> (\<Squnion>x\<in>X. l * f x) = l * \<Squnion> (f ` X)
[PROOF STEP]
have "(\<Squnion>x \<in> X. ereal l * ereal (f x)) = (l * (\<Squnion>x \<in> X. ereal (f x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Squnion>x\<in>X. ereal l * ereal (f x)) = ereal l * (\<Squnion>x\<in>X. ereal (f x))
[PROOF STEP]
by (simp add: Sup_ereal_mult_left' \<open>0 \<le> l\<close> \<open>X \<noteq> {}\<close>)
[PROOF STATE]
proof (state)
this:
(\<Squnion>x\<in>X. ereal l * ereal (f x)) = ereal l * (\<Squnion>x\<in>X. ereal (f x))

goal (1 subgoal):
 1. \<lbrakk>X \<noteq> {}; 0 \<le> l; bounded (f ` X)\<rbrakk> \<Longrightarrow> (\<Squnion>x\<in>X. l * f x) = l * \<Squnion> (f ` X)
[PROOF STEP]
obtain b where "\<forall>a \<in>X. \<bar>f a\<bar> \<le> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>b. \<forall>a\<in>X. \<bar>f a\<bar> \<le> b \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>bounded (f ` X)\<close> bounded_real
[PROOF STATE]
proof (prove)
using this:
bounded (f ` X)
bounded ?S = (\<exists>a. \<forall>x\<in>?S. \<bar>x\<bar> \<le> a)

goal (1 subgoal):
 1. (\<And>b. \<forall>a\<in>X. \<bar>f a\<bar> \<le> b \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>a\<in>X. \<bar>f a\<bar> \<le> b

goal (1 subgoal):
 1. \<lbrakk>X \<noteq> {}; 0 \<le> l; bounded (f ` X)\<rbrakk> \<Longrightarrow> (\<Squnion>x\<in>X. l * f x) = l * \<Squnion> (f ` X)
[PROOF STEP]
have "\<forall>a \<in>X. \<bar>ereal (f a)\<bar> \<le> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>a\<in>X. \<bar>ereal (f a)\<bar> \<le> ereal b
[PROOF STEP]
by (simp add: \<open>\<forall>a\<in>X. \<bar>f a\<bar> \<le> b\<close>)
[PROOF STATE]
proof (state)
this:
\<forall>a\<in>X. \<bar>ereal (f a)\<bar> \<le> ereal b

goal (1 subgoal):
 1. \<lbrakk>X \<noteq> {}; 0 \<le> l; bounded (f ` X)\<rbrakk> \<Longrightarrow> (\<Squnion>x\<in>X. l * f x) = l * \<Squnion> (f ` X)
[PROOF STEP]
hence sup_leb: "(\<Squnion>a\<in>X. \<bar>ereal (f a)\<bar>)\<le> b"
[PROOF STATE]
proof (prove)
using this:
\<forall>a\<in>X. \<bar>ereal (f a)\<bar> \<le> ereal b

goal (1 subgoal):
 1. (\<Squnion>a\<in>X. \<bar>ereal (f a)\<bar>) \<le> ereal b
[PROOF STEP]
by (simp add: SUP_least)
[PROOF STATE]
proof (state)
this:
(\<Squnion>a\<in>X. \<bar>ereal (f a)\<bar>) \<le> ereal b

goal (1 subgoal):
 1. \<lbrakk>X \<noteq> {}; 0 \<le> l; bounded (f ` X)\<rbrakk> \<Longrightarrow> (\<Squnion>x\<in>X. l * f x) = l * \<Squnion> (f ` X)
[PROOF STEP]
have "(\<Squnion>a\<in>X. ereal (f a)) \<le> (\<Squnion>a\<in>X. \<bar>ereal (f a)\<bar>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Squnion>a\<in>X. ereal (f a)) \<le> (\<Squnion>a\<in>X. \<bar>ereal (f a)\<bar>)
[PROOF STEP]
by (auto intro: Complete_Lattices.SUP_mono')
[PROOF STATE]
proof (state)
this:
(\<Squnion>a\<in>X. ereal (f a)) \<le> (\<Squnion>a\<in>X. \<bar>ereal (f a)\<bar>)

goal (1 subgoal):
 1. \<lbrakk>X \<noteq> {}; 0 \<le> l; bounded (f ` X)\<rbrakk> \<Longrightarrow> (\<Squnion>x\<in>X. l * f x) = l * \<Squnion> (f ` X)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<Squnion>a\<in>X. ereal (f a)) \<le> (\<Squnion>a\<in>X. \<bar>ereal (f a)\<bar>)

goal (1 subgoal):
 1. \<lbrakk>X \<noteq> {}; 0 \<le> l; bounded (f ` X)\<rbrakk> \<Longrightarrow> (\<Squnion>x\<in>X. l * f x) = l * \<Squnion> (f ` X)
[PROOF STEP]
have "-(\<Squnion>a\<in>X. ereal (f a)) \<le> (\<Squnion>a\<in>X. \<bar>ereal (f a)\<bar>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (\<Squnion>a\<in>X. ereal (f a)) \<le> (\<Squnion>a\<in>X. \<bar>ereal (f a)\<bar>)
[PROOF STEP]
using \<open>X \<noteq> {}\<close>
[PROOF STATE]
proof (prove)
using this:
X \<noteq> {}

goal (1 subgoal):
 1. - (\<Squnion>a\<in>X. ereal (f a)) \<le> (\<Squnion>a\<in>X. \<bar>ereal (f a)\<bar>)
[PROOF STEP]
by (auto intro!: Inf_less_eq cSUP_upper2 simp add: ereal_INF_uminus_eq[symmetric])
[PROOF STATE]
proof (state)
this:
- (\<Squnion>a\<in>X. ereal (f a)) \<le> (\<Squnion>a\<in>X. \<bar>ereal (f a)\<bar>)

goal (1 subgoal):
 1. \<lbrakk>X \<noteq> {}; 0 \<le> l; bounded (f ` X)\<rbrakk> \<Longrightarrow> (\<Squnion>x\<in>X. l * f x) = l * \<Squnion> (f ` X)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<Squnion>a\<in>X. ereal (f a)) \<le> (\<Squnion>a\<in>X. \<bar>ereal (f a)\<bar>)
- (\<Squnion>a\<in>X. ereal (f a)) \<le> (\<Squnion>a\<in>X. \<bar>ereal (f a)\<bar>)
[PROOF STEP]
have "\<bar>(\<Squnion>a\<in>X. ereal (f a))\<bar> \<le> (\<Squnion>a\<in>X. \<bar>ereal (f a)\<bar>)"
[PROOF STATE]
proof (prove)
using this:
(\<Squnion>a\<in>X. ereal (f a)) \<le> (\<Squnion>a\<in>X. \<bar>ereal (f a)\<bar>)
- (\<Squnion>a\<in>X. ereal (f a)) \<le> (\<Squnion>a\<in>X. \<bar>ereal (f a)\<bar>)

goal (1 subgoal):
 1. \<bar>\<Squnion>a\<in>X. ereal (f a)\<bar> \<le> (\<Squnion>a\<in>X. \<bar>ereal (f a)\<bar>)
[PROOF STEP]
by (auto intro: ereal_abs_leI)
[PROOF STATE]
proof (state)
this:
\<bar>\<Squnion>a\<in>X. ereal (f a)\<bar> \<le> (\<Squnion>a\<in>X. \<bar>ereal (f a)\<bar>)

goal (1 subgoal):
 1. \<lbrakk>X \<noteq> {}; 0 \<le> l; bounded (f ` X)\<rbrakk> \<Longrightarrow> (\<Squnion>x\<in>X. l * f x) = l * \<Squnion> (f ` X)
[PROOF STEP]
hence "\<bar>\<Squnion>a\<in>X. ereal (f a)\<bar> \<le> b"
[PROOF STATE]
proof (prove)
using this:
\<bar>\<Squnion>a\<in>X. ereal (f a)\<bar> \<le> (\<Squnion>a\<in>X. \<bar>ereal (f a)\<bar>)

goal (1 subgoal):
 1. \<bar>\<Squnion>a\<in>X. ereal (f a)\<bar> \<le> ereal b
[PROOF STEP]
using sup_leb
[PROOF STATE]
proof (prove)
using this:
\<bar>\<Squnion>a\<in>X. ereal (f a)\<bar> \<le> (\<Squnion>a\<in>X. \<bar>ereal (f a)\<bar>)
(\<Squnion>a\<in>X. \<bar>ereal (f a)\<bar>) \<le> ereal b

goal (1 subgoal):
 1. \<bar>\<Squnion>a\<in>X. ereal (f a)\<bar> \<le> ereal b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<bar>\<Squnion>a\<in>X. ereal (f a)\<bar> \<le> ereal b

goal (1 subgoal):
 1. \<lbrakk>X \<noteq> {}; 0 \<le> l; bounded (f ` X)\<rbrakk> \<Longrightarrow> (\<Squnion>x\<in>X. l * f x) = l * \<Squnion> (f ` X)
[PROOF STEP]
hence "\<bar>\<Squnion>a\<in>X. ereal (f a)\<bar> \<noteq> \<infinity>"
[PROOF STATE]
proof (prove)
using this:
\<bar>\<Squnion>a\<in>X. ereal (f a)\<bar> \<le> ereal b

goal (1 subgoal):
 1. \<bar>\<Squnion>a\<in>X. ereal (f a)\<bar> \<noteq> \<infinity>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<bar>\<Squnion>a\<in>X. ereal (f a)\<bar> \<noteq> \<infinity>

goal (1 subgoal):
 1. \<lbrakk>X \<noteq> {}; 0 \<le> l; bounded (f ` X)\<rbrakk> \<Longrightarrow> (\<Squnion>x\<in>X. l * f x) = l * \<Squnion> (f ` X)
[PROOF STEP]
hence "(\<Squnion>x \<in> X. ereal (f x)) = ereal (\<Squnion>x \<in> X. (f x))"
[PROOF STATE]
proof (prove)
using this:
\<bar>\<Squnion>a\<in>X. ereal (f a)\<bar> \<noteq> \<infinity>

goal (1 subgoal):
 1. (\<Squnion>x\<in>X. ereal (f x)) = ereal (\<Squnion> (f ` X))
[PROOF STEP]
using ereal_SUP
[PROOF STATE]
proof (prove)
using this:
\<bar>\<Squnion>a\<in>X. ereal (f a)\<bar> \<noteq> \<infinity>
\<bar>\<Squnion>a\<in>?A. ereal (?f a)\<bar> \<noteq> \<infinity> \<Longrightarrow> ereal (\<Squnion> (?f ` ?A)) = (\<Squnion>a\<in>?A. ereal (?f a))

goal (1 subgoal):
 1. (\<Squnion>x\<in>X. ereal (f x)) = ereal (\<Squnion> (f ` X))
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
(\<Squnion>x\<in>X. ereal (f x)) = ereal (\<Squnion> (f ` X))

goal (1 subgoal):
 1. \<lbrakk>X \<noteq> {}; 0 \<le> l; bounded (f ` X)\<rbrakk> \<Longrightarrow> (\<Squnion>x\<in>X. l * f x) = l * \<Squnion> (f ` X)
[PROOF STEP]
hence "(\<Squnion>x \<in> X. ereal (l * f x)) = ereal (l * (\<Squnion>x \<in> X. f x))"
[PROOF STATE]
proof (prove)
using this:
(\<Squnion>x\<in>X. ereal (f x)) = ereal (\<Squnion> (f ` X))

goal (1 subgoal):
 1. (\<Squnion>x\<in>X. ereal (l * f x)) = ereal (l * \<Squnion> (f ` X))
[PROOF STEP]
using \<open>(\<Squnion>x\<in>X. ereal l * ereal (f x)) = ereal l * (\<Squnion>x\<in>X. ereal (f x))\<close>
[PROOF STATE]
proof (prove)
using this:
(\<Squnion>x\<in>X. ereal (f x)) = ereal (\<Squnion> (f ` X))
(\<Squnion>x\<in>X. ereal l * ereal (f x)) = ereal l * (\<Squnion>x\<in>X. ereal (f x))

goal (1 subgoal):
 1. (\<Squnion>x\<in>X. ereal (l * f x)) = ereal (l * \<Squnion> (f ` X))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Squnion>x\<in>X. ereal (l * f x)) = ereal (l * \<Squnion> (f ` X))

goal (1 subgoal):
 1. \<lbrakk>X \<noteq> {}; 0 \<le> l; bounded (f ` X)\<rbrakk> \<Longrightarrow> (\<Squnion>x\<in>X. l * f x) = l * \<Squnion> (f ` X)
[PROOF STEP]
hence "ereal (\<Squnion>x \<in> X. l * f x) = ereal (l * (\<Squnion>x \<in> X. f x))"
[PROOF STATE]
proof (prove)
using this:
(\<Squnion>x\<in>X. ereal (l * f x)) = ereal (l * \<Squnion> (f ` X))

goal (1 subgoal):
 1. ereal (\<Squnion>x\<in>X. l * f x) = ereal (l * \<Squnion> (f ` X))
[PROOF STEP]
by (simp add: ereal_SUP)
[PROOF STATE]
proof (state)
this:
ereal (\<Squnion>x\<in>X. l * f x) = ereal (l * \<Squnion> (f ` X))

goal (1 subgoal):
 1. \<lbrakk>X \<noteq> {}; 0 \<le> l; bounded (f ` X)\<rbrakk> \<Longrightarrow> (\<Squnion>x\<in>X. l * f x) = l * \<Squnion> (f ` X)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
ereal (\<Squnion>x\<in>X. l * f x) = ereal (l * \<Squnion> (f ` X))

goal (1 subgoal):
 1. (\<Squnion>x\<in>X. l * f x) = l * \<Squnion> (f ` X)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Squnion>x\<in>X. l * f x) = l * \<Squnion> (f ` X)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma list_of_vec_0 [simp]: "list_of_vec (0\<^sub>v n) = replicate n 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_of_vec (0\<^sub>v n) = replicate n (0::'a)
[PROOF STEP]
by (simp add: zero_vec_def map_replicate_trivial)


[STATEMENT]
lemma subgraph_antisym: "subgraph V' E' V E \<Longrightarrow> subgraph V E V' E' \<Longrightarrow> V = V' \<and> E = E'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>subgraph V' E' V E; subgraph V E V' E'\<rbrakk> \<Longrightarrow> V = V' \<and> E = E'
[PROOF STEP]
by (simp add: dual_order.eq_iff subgraph.edges_ss subgraph.verts_ss)


[STATEMENT]
lemma sumhr_split_diff: "n < p \<Longrightarrow> sumhr (0, p, f) - sumhr (0, n, f) = sumhr (n, p, f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < p \<Longrightarrow> sumhr (0, p, f) - sumhr (0, n, f) = sumhr (n, p, f)
[PROOF STEP]
by (drule sumhr_split_add [symmetric, where f = f]) simp


[STATEMENT]
lemma (in abelian_subgroup) a_coset_eq:
     "(\<forall>x \<in> carrier G. H +> x = x <+ H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>carrier G. H +> x = x <+ H
[PROOF STEP]
by (rule normal.coset_eq[OF a_normal,
    folded a_r_coset_def a_l_coset_def, simplified monoid_record_simps])


[STATEMENT]
lemma enat_min:
  assumes "m \<ge> enat n'"
    and "enat n < m - enat n'"
  shows "enat n + enat n' < m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enat n + enat n' < m
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
enat n' \<le> m
enat n < m - enat n'

goal (1 subgoal):
 1. enat n + enat n' < m
[PROOF STEP]
by (metis add.commute enat.simps(3) enat_add_mono enat_add_sub_same le_iff_add)


[STATEMENT]
lemma radical_1 [simp]: "radical 1 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. radical (1::'a) = (1::'a)
[PROOF STEP]
by (simp add: radical_def)


[STATEMENT]
lemma set_mset_remdups_mset[simp]: \<open>set_mset (remdups_mset A) = set_mset A\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_mset (remdups_mset A) = set_mset A
[PROOF STEP]
unfolding remdups_mset_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_mset (mset_set (set_mset A)) = set_mset A
[PROOF STEP]
by auto


[STATEMENT]
lemma mat_Ph_split:
  "mat_Ph = 2 \<cdot>\<^sub>m pre - 1\<^sub>m N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_Ph = 2 \<cdot>\<^sub>m pre - 1\<^sub>m N
[PROOF STEP]
unfolding mat_Ph_def pre_mat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat N N (\<lambda>(i, j). if i = j then if i = 0 then 1 else - 1 else 0) = 2 \<cdot>\<^sub>m mat N N (\<lambda>(i, j). if i = j \<and> i = 0 then 1 else 0) - 1\<^sub>m N
[PROOF STEP]
apply (rule eq_matI)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (2 \<cdot>\<^sub>m mat N N (\<lambda>(i, j). if i = j \<and> i = 0 then 1 else 0) - 1\<^sub>m N); j < dim_col (2 \<cdot>\<^sub>m mat N N (\<lambda>(i, j). if i = j \<and> i = 0 then 1 else 0) - 1\<^sub>m N)\<rbrakk> \<Longrightarrow> mat N N (\<lambda>(i, j). if i = j then if i = 0 then 1 else - 1 else 0) $$ (i, j) = (2 \<cdot>\<^sub>m mat N N (\<lambda>(i, j). if i = j \<and> i = 0 then 1 else 0) - 1\<^sub>m N) $$ (i, j)
 2. dim_row (mat N N (\<lambda>(i, j). if i = j then if i = 0 then 1 else - 1 else 0)) = dim_row (2 \<cdot>\<^sub>m mat N N (\<lambda>(i, j). if i = j \<and> i = 0 then 1 else 0) - 1\<^sub>m N)
 3. dim_col (mat N N (\<lambda>(i, j). if i = j then if i = 0 then 1 else - 1 else 0)) = dim_col (2 \<cdot>\<^sub>m mat N N (\<lambda>(i, j). if i = j \<and> i = 0 then 1 else 0) - 1\<^sub>m N)
[PROOF STEP]
by auto


[STATEMENT]
lemma lt_of_comp_less_prod: "lt_of_comp (comparator_prod c_a c_b) =
  less_prod (le_of_comp c_a) (lt_of_comp c_a) (lt_of_comp c_b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lt_of_comp (comparator_prod c_a c_b) = less_prod (le_of_comp c_a) (lt_of_comp c_a) (lt_of_comp c_b)
[PROOF STEP]
unfolding less_prod_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lt_of_comp (comparator_prod c_a c_b) = (\<lambda>(x1, x2) (y1, y2). lt_of_comp c_a x1 y1 \<or> le_of_comp c_a x1 y1 \<and> lt_of_comp c_b x2 y2)
[PROOF STEP]
by (intro ext, auto simp: lt_of_comp_def le_of_comp_def split: order.split_asm prod.split)


[STATEMENT]
lemma fds_logderiv_completely_multiplicative:
  fixes f :: "'a :: {real_normed_field} fds"
  assumes "completely_multiplicative_function (fds_nth f)" "fds_nth f 1 \<noteq> 0"
  shows   "fds_deriv f / f = - fds (\<lambda>n. fds_nth f n * mangoldt n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_deriv f / f = - fds (\<lambda>n. fds_nth f n * mangoldt n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fds_deriv f / f = - fds (\<lambda>n. fds_nth f n * mangoldt n)
[PROOF STEP]
have "fds_deriv f / f = - fds (\<lambda>n. fds_nth f n * mangoldt n) * f / f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_deriv f / f = - fds (\<lambda>n. fds_nth f n * mangoldt n) * f / f
[PROOF STEP]
using completely_multiplicative_fds_deriv[of "fds_nth f"] assms
[PROOF STATE]
proof (prove)
using this:
completely_multiplicative_function (fds_nth f) \<Longrightarrow> fds_deriv (fds (fds_nth f)) = - fds (\<lambda>n. fds_nth f n * mangoldt n) * fds (fds_nth f)
completely_multiplicative_function (fds_nth f)
fds_nth f 1 \<noteq> (0::'a)

goal (1 subgoal):
 1. fds_deriv f / f = - fds (\<lambda>n. fds_nth f n * mangoldt n) * f / f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fds_deriv f / f = - fds (\<lambda>n. fds_nth f n * mangoldt n) * f / f

goal (1 subgoal):
 1. fds_deriv f / f = - fds (\<lambda>n. fds_nth f n * mangoldt n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fds_deriv f / f = - fds (\<lambda>n. fds_nth f n * mangoldt n) * f / f

goal (1 subgoal):
 1. fds_deriv f / f = - fds (\<lambda>n. fds_nth f n * mangoldt n)
[PROOF STEP]
have "\<dots> = - fds (\<lambda>n. fds_nth f n * mangoldt n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - fds (\<lambda>n. fds_nth f n * mangoldt n) * f / f = - fds (\<lambda>n. fds_nth f n * mangoldt n)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
completely_multiplicative_function (fds_nth f)
fds_nth f 1 \<noteq> (0::'a)

goal (1 subgoal):
 1. - fds (\<lambda>n. fds_nth f n * mangoldt n) * f / f = - fds (\<lambda>n. fds_nth f n * mangoldt n)
[PROOF STEP]
by (simp add: divide_fds_def fds_right_inverse)
[PROOF STATE]
proof (state)
this:
- fds (\<lambda>n. fds_nth f n * mangoldt n) * f / f = - fds (\<lambda>n. fds_nth f n * mangoldt n)

goal (1 subgoal):
 1. fds_deriv f / f = - fds (\<lambda>n. fds_nth f n * mangoldt n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
fds_deriv f / f = - fds (\<lambda>n. fds_nth f n * mangoldt n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
fds_deriv f / f = - fds (\<lambda>n. fds_nth f n * mangoldt n)

goal (1 subgoal):
 1. fds_deriv f / f = - fds (\<lambda>n. fds_nth f n * mangoldt n)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
fds_deriv f / f = - fds (\<lambda>n. fds_nth f n * mangoldt n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma supp_Conj [simp]:
  assumes "finite (supp xset)"
  shows "supp (Conj xset) = supp xset"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. supp (Conj xset) = supp xset
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite (supp xset)

goal (1 subgoal):
 1. supp (Conj xset) = supp xset
[PROOF STEP]
unfolding Conj_def
[PROOF STATE]
proof (prove)
using this:
finite (supp xset)

goal (1 subgoal):
 1. supp (Abs_formula (Conj\<^sub>\<alpha> (map_bset Rep_formula xset))) = supp xset
[PROOF STEP]
by simp


[STATEMENT]
lemma bij_betw_conv_Ex1: "bij_betw f A B \<longleftrightarrow> (\<forall>y\<in>B. \<exists>!x\<in>A. f x = y) \<and> B = f ` A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw f A B = ((\<forall>y\<in>B. \<exists>!x. x \<in> A \<and> f x = y) \<and> B = f ` A)
[PROOF STEP]
unfolding bij_betw_def inj_on_conv_Ex1
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<forall>y\<in>f ` A. \<exists>!x. x \<in> A \<and> y = f x) \<and> f ` A = B) = ((\<forall>y\<in>B. \<exists>!x. x \<in> A \<and> f x = y) \<and> B = f ` A)
[PROOF STEP]
by (auto simp: eq_commute)


[STATEMENT]
lemma intersperseE':
  assumes "\<sigma> permutes ({..<n})"
  assumes "length as + length bs = n"
  assumes "length as = k"
  assumes "\<sigma> i < k"
  shows "(intersperse \<sigma> as bs)! i  = as ! \<sigma> i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. intersperse \<sigma> as bs ! i = as ! \<sigma> i
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. intersperse \<sigma> as bs ! i = as ! \<sigma> i
[PROOF STEP]
have "permute_list \<sigma> (as @ bs) ! i = (as @ bs) ! \<sigma> i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. permute_list \<sigma> (as @ bs) ! i = (as @ bs) ! \<sigma> i
[PROOF STEP]
using assms permute_list_nth[of \<sigma> "(as@bs)" i]
[PROOF STATE]
proof (prove)
using this:
\<sigma> permutes {..<n}
length as + length bs = n
length as = k
\<sigma> i < k
\<lbrakk>\<sigma> permutes {..<length (as @ bs)}; i < length (as @ bs)\<rbrakk> \<Longrightarrow> permute_list \<sigma> (as @ bs) ! i = (as @ bs) ! \<sigma> i

goal (1 subgoal):
 1. permute_list \<sigma> (as @ bs) ! i = (as @ bs) ! \<sigma> i
[PROOF STEP]
unfolding intersperse_def
[PROOF STATE]
proof (prove)
using this:
\<sigma> permutes {..<n}
length as + length bs = n
length as = k
\<sigma> i < k
\<lbrakk>\<sigma> permutes {..<length (as @ bs)}; i < length (as @ bs)\<rbrakk> \<Longrightarrow> permute_list \<sigma> (as @ bs) ! i = (as @ bs) ! \<sigma> i

goal (1 subgoal):
 1. permute_list \<sigma> (as @ bs) ! i = (as @ bs) ! \<sigma> i
[PROOF STEP]
by (metis length_append lessThan_iff permutes_not_in trans_less_add1)
[PROOF STATE]
proof (state)
this:
permute_list \<sigma> (as @ bs) ! i = (as @ bs) ! \<sigma> i

goal (1 subgoal):
 1. intersperse \<sigma> as bs ! i = as ! \<sigma> i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
permute_list \<sigma> (as @ bs) ! i = (as @ bs) ! \<sigma> i
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
permute_list \<sigma> (as @ bs) ! i = (as @ bs) ! \<sigma> i

goal (1 subgoal):
 1. intersperse \<sigma> as bs ! i = as ! \<sigma> i
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
permute_list \<sigma> (as @ bs) ! i = (as @ bs) ! \<sigma> i
\<sigma> permutes {..<n}
length as + length bs = n
length as = k
\<sigma> i < k

goal (1 subgoal):
 1. intersperse \<sigma> as bs ! i = as ! \<sigma> i
[PROOF STEP]
by (metis intersperse_def nth_append)
[PROOF STATE]
proof (state)
this:
intersperse \<sigma> as bs ! i = as ! \<sigma> i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma h_code[code] :
  "h M (q,x) = (let m = set_as_map (image (\<lambda>(q,x,y,q') . ((q,x),y,q')) (transitions M))
                 in (case m (q,x) of Some yqs \<Rightarrow> yqs | None \<Rightarrow> {}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h M (q, x) = (let m = set_as_map ((\<lambda>(q, x, y, q'). ((q, x), y, q')) ` transitions M) in case m (q, x) of None \<Rightarrow> {} | Some yqs \<Rightarrow> yqs)
[PROOF STEP]
unfolding set_as_map_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h M (q, x) = (let m = \<lambda>x. if \<exists>z. (x, z) \<in> (\<lambda>(q, x, y, q'). ((q, x), y, q')) ` transitions M then Some {z. (x, z) \<in> (\<lambda>(q, x, y, q'). ((q, x), y, q')) ` transitions M} else None in case m (q, x) of None \<Rightarrow> {} | Some yqs \<Rightarrow> yqs)
[PROOF STEP]
by force