[STATEMENT]
lemma positive_cblinfunI: \<open>A \<ge> 0\<close> if \<open>\<And>x. norm x = 1 \<Longrightarrow> cinner x (A *\<^sub>V x) \<ge> 0\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> A
[PROOF STEP]
apply (rule cblinfun_leI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. norm x = 1 \<Longrightarrow> x \<bullet>\<^sub>C (0 *\<^sub>V x) \<le> x \<bullet>\<^sub>C (A *\<^sub>V x)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
norm ?x = 1 \<Longrightarrow> 0 \<le> ?x \<bullet>\<^sub>C (A *\<^sub>V ?x)

goal (1 subgoal):
 1. \<And>x. norm x = 1 \<Longrightarrow> x \<bullet>\<^sub>C (0 *\<^sub>V x) \<le> x \<bullet>\<^sub>C (A *\<^sub>V x)
[PROOF STEP]
by simp


[STATEMENT]
lemma expands_to_basic_powr:
  assumes "basis_wf (b # basis)" "length basis = expansion_level TYPE('a::multiseries)"
  shows   "((\<lambda>x. b x powr e) expands_to
             MS (MSLCons (const_expansion 1 :: 'a, e) MSLNil) (\<lambda>x. b x powr e)) (b # basis)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. b x powr e) expands_to MS (MSLCons (const_expansion 1, e) MSLNil) (\<lambda>x. b x powr e)) (b # basis)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
basis_wf (b # basis)
length basis = expansion_level TYPE('a)

goal (1 subgoal):
 1. ((\<lambda>x. b x powr e) expands_to MS (MSLCons (const_expansion 1, e) MSLNil) (\<lambda>x. b x powr e)) (b # basis)
[PROOF STEP]
by (auto simp: expands_to.simps basis_wf_Cons powr_smallo_iff
                       intro!: is_expansion_aux.intros is_expansion_const powr_smallo_iff)


[STATEMENT]
lemma not_ex_not: "\<not> (\<exists> x \<bullet> \<not> P) = (\<forall> x \<bullet> P)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> (\<exists> x \<bullet> \<not> P) = (\<forall> x \<bullet> P)
[PROOF STEP]
by (pred_auto)


[STATEMENT]
lemma nonneg_Reals_mult_I [simp]: "\<lbrakk>a \<in> \<real>\<^sub>\<ge>\<^sub>0; b \<in> \<real>\<^sub>\<ge>\<^sub>0\<rbrakk> \<Longrightarrow> a * b \<in> \<real>\<^sub>\<ge>\<^sub>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> \<real>\<^sub>\<ge>\<^sub>0; b \<in> \<real>\<^sub>\<ge>\<^sub>0\<rbrakk> \<Longrightarrow> a * b \<in> \<real>\<^sub>\<ge>\<^sub>0
[PROOF STEP]
unfolding nonneg_Reals_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> {of_real r |r. 0 \<le> r}; b \<in> {of_real r |r. 0 \<le> r}\<rbrakk> \<Longrightarrow> a * b \<in> {of_real r |r. 0 \<le> r}
[PROOF STEP]
by (auto simp: of_real_def)


[STATEMENT]
lemma closedin_retract:
  fixes S :: "'a :: t2_space set"
  assumes "S retract_of T"
    shows "closedin (top_of_set T) S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closedin (top_of_set T) S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. closedin (top_of_set T) S
[PROOF STEP]
obtain r where r: "S \<subseteq> T" "continuous_on T r" "r ` T \<subseteq> S" "\<And>x. x \<in> S \<Longrightarrow> r x = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>r. \<lbrakk>S \<subseteq> T; continuous_on T r; r ` T \<subseteq> S; \<And>x. x \<in> S \<Longrightarrow> r x = x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
S retract_of T

goal (1 subgoal):
 1. (\<And>r. \<lbrakk>S \<subseteq> T; continuous_on T r; r ` T \<subseteq> S; \<And>x. x \<in> S \<Longrightarrow> r x = x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: retract_of_def retraction_def)
[PROOF STATE]
proof (state)
this:
S \<subseteq> T
continuous_on T r
r ` T \<subseteq> S
?x \<in> S \<Longrightarrow> r ?x = ?x

goal (1 subgoal):
 1. closedin (top_of_set T) S
[PROOF STEP]
have "S = {x\<in>T. x = r x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S = {x \<in> T. x = r x}
[PROOF STEP]
using r
[PROOF STATE]
proof (prove)
using this:
S \<subseteq> T
continuous_on T r
r ` T \<subseteq> S
?x \<in> S \<Longrightarrow> r ?x = ?x

goal (1 subgoal):
 1. S = {x \<in> T. x = r x}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
S = {x \<in> T. x = r x}

goal (1 subgoal):
 1. closedin (top_of_set T) S
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
S = {x \<in> T. x = r x}

goal (1 subgoal):
 1. closedin (top_of_set T) S
[PROOF STEP]
have "\<dots> = T \<inter> ((\<lambda>x. (x, r x)) -` ({y. \<exists>x. y = (x, x)}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> T. x = r x} = T \<inter> (\<lambda>x. (x, r x)) -` {y. \<exists>x. y = (x, x)}
[PROOF STEP]
unfolding vimage_def mem_Times_iff fst_conv snd_conv
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> T. x = r x} = T \<inter> {x. (x, r x) \<in> {y. \<exists>x. y = (x, x)}}
[PROOF STEP]
using r
[PROOF STATE]
proof (prove)
using this:
S \<subseteq> T
continuous_on T r
r ` T \<subseteq> S
?x \<in> S \<Longrightarrow> r ?x = ?x

goal (1 subgoal):
 1. {x \<in> T. x = r x} = T \<inter> {x. (x, r x) \<in> {y. \<exists>x. y = (x, x)}}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{x \<in> T. x = r x} = T \<inter> (\<lambda>x. (x, r x)) -` {y. \<exists>x. y = (x, x)}

goal (1 subgoal):
 1. closedin (top_of_set T) S
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{x \<in> T. x = r x} = T \<inter> (\<lambda>x. (x, r x)) -` {y. \<exists>x. y = (x, x)}

goal (1 subgoal):
 1. closedin (top_of_set T) S
[PROOF STEP]
have "closedin (top_of_set T) \<dots>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closedin (top_of_set T) (T \<inter> (\<lambda>x. (x, r x)) -` {y. \<exists>x. y = (x, x)})
[PROOF STEP]
by (rule continuous_closedin_preimage) (auto intro!: closed_diagonal continuous_on_Pair r)
[PROOF STATE]
proof (state)
this:
closedin (top_of_set T) (T \<inter> (\<lambda>x. (x, r x)) -` {y. \<exists>x. y = (x, x)})

goal (1 subgoal):
 1. closedin (top_of_set T) S
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
closedin (top_of_set T) S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
closedin (top_of_set T) S

goal (1 subgoal):
 1. closedin (top_of_set T) S
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
closedin (top_of_set T) S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nonneg_mult_imp_nonneg_mat:
  assumes "\<And>v. v \<ge> 0 \<Longrightarrow> X *v v \<ge> 0"
  shows "X \<ge> (0 :: real ^ _ ^_)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> X
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 \<le> X
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 \<le> X
[PROOF STEP]
assume "\<not> (0 \<le> X)"
[PROOF STATE]
proof (state)
this:
\<not> 0 \<le> X

goal (1 subgoal):
 1. 0 \<le> X
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> 0 \<le> X
[PROOF STEP]
obtain i j where neg: "X $ i $ j < 0"
[PROOF STATE]
proof (prove)
using this:
\<not> 0 \<le> X

goal (1 subgoal):
 1. (\<And>i j. X $ i $ j < 0 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis less_eq_vec_def not_le zero_index)
[PROOF STATE]
proof (state)
this:
X $ i $ j < 0

goal (1 subgoal):
 1. 0 \<le> X
[PROOF STEP]
let ?v = "\<chi> k. if j = k then 1::real else 0"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 \<le> X
[PROOF STEP]
have "(X *v ?v) $ i < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (X *v (\<chi>k. if j = k then 1 else 0)) $ i < 0
[PROOF STEP]
using neg
[PROOF STATE]
proof (prove)
using this:
X $ i $ j < 0

goal (1 subgoal):
 1. (X *v (\<chi>k. if j = k then 1 else 0)) $ i < 0
[PROOF STEP]
by (auto simp: matrix_vector_mult_def if_distrib cong: if_cong)
[PROOF STATE]
proof (state)
this:
(X *v (\<chi>k. if j = k then 1 else 0)) $ i < 0

goal (1 subgoal):
 1. 0 \<le> X
[PROOF STEP]
hence "?v \<ge> 0 \<and> \<not> ((X *v ?v) \<ge> 0)"
[PROOF STATE]
proof (prove)
using this:
(X *v (\<chi>k. if j = k then 1 else 0)) $ i < 0

goal (1 subgoal):
 1. 0 \<le> (\<chi>k. if j = k then 1 else 0) \<and> \<not> 0 \<le> X *v (\<chi>k. if j = k then 1 else 0)
[PROOF STEP]
by (auto simp: less_eq_vec_def not_le)
[PROOF STATE]
proof (state)
this:
0 \<le> (\<chi>k. if j = k then 1 else 0) \<and> \<not> 0 \<le> X *v (\<chi>k. if j = k then 1 else 0)

goal (1 subgoal):
 1. 0 \<le> X
[PROOF STEP]
hence "\<exists>v. v \<ge> 0 \<and> \<not> X *v v \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
0 \<le> (\<chi>k. if j = k then 1 else 0) \<and> \<not> 0 \<le> X *v (\<chi>k. if j = k then 1 else 0)

goal (1 subgoal):
 1. \<exists>v\<ge>0. \<not> 0 \<le> X *v v
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>v\<ge>0. \<not> 0 \<le> X *v v

goal (1 subgoal):
 1. 0 \<le> X
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<not> 0 \<le> X \<Longrightarrow> \<exists>v\<ge>0. \<not> 0 \<le> X *v v

goal (1 subgoal):
 1. 0 \<le> X
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> 0 \<le> X \<Longrightarrow> \<exists>v\<ge>0. \<not> 0 \<le> X *v v

goal (1 subgoal):
 1. 0 \<le> X
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<not> 0 \<le> X \<Longrightarrow> \<exists>v\<ge>0. \<not> 0 \<le> X *v v
0 \<le> ?v \<Longrightarrow> 0 \<le> X *v ?v

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma standard_borel_space_UNIVI':
  assumes "standard_borel Y"
      and "space Y = UNIV"
    shows "standard_borel_space_UNIV Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. standard_borel_space_UNIV Y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
standard_borel Y
space Y = UNIV

goal (1 subgoal):
 1. standard_borel_space_UNIV Y
[PROOF STEP]
by(simp add: standard_borel_space_UNIV_def standard_borel_space_UNIV_axioms_def)


[STATEMENT]
lemma prime_prod_dvdI:
  fixes f :: "'b \<Rightarrow> 'a"
  assumes "finite A"
  assumes "\<And>x. x \<in> A \<Longrightarrow> prime (f x)"
  assumes "\<And>x. x \<in> A \<Longrightarrow> f x dvd y"
  assumes "inj_on f A"
  shows   "prod f A dvd y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod f A dvd y
[PROOF STEP]
proof (cases "y = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. y = (0::'a) \<Longrightarrow> prod f A dvd y
 2. y \<noteq> (0::'a) \<Longrightarrow> prod f A dvd y
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
y \<noteq> (0::'a)

goal (2 subgoals):
 1. y = (0::'a) \<Longrightarrow> prod f A dvd y
 2. y \<noteq> (0::'a) \<Longrightarrow> prod f A dvd y
[PROOF STEP]
have nz: "f x \<noteq> 0" if "x \<in> A" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f x \<noteq> (0::'a)
[PROOF STEP]
using assms(2)[of x] that
[PROOF STATE]
proof (prove)
using this:
x \<in> A \<Longrightarrow> prime (f x)
x \<in> A

goal (1 subgoal):
 1. f x \<noteq> (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?x1 \<in> A \<Longrightarrow> f ?x1 \<noteq> (0::'a)

goal (2 subgoals):
 1. y = (0::'a) \<Longrightarrow> prod f A dvd y
 2. y \<noteq> (0::'a) \<Longrightarrow> prod f A dvd y
[PROOF STEP]
have "prod f A \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod f A \<noteq> (0::'a)
[PROOF STEP]
using assms nz
[PROOF STATE]
proof (prove)
using this:
finite A
?x1 \<in> A \<Longrightarrow> prime (f ?x1)
?x1 \<in> A \<Longrightarrow> f ?x1 dvd y
inj_on f A
?x1 \<in> A \<Longrightarrow> f ?x1 \<noteq> (0::'a)

goal (1 subgoal):
 1. prod f A \<noteq> (0::'a)
[PROOF STEP]
by (subst prod_zero_iff) auto
[PROOF STATE]
proof (state)
this:
prod f A \<noteq> (0::'a)

goal (2 subgoals):
 1. y = (0::'a) \<Longrightarrow> prod f A dvd y
 2. y \<noteq> (0::'a) \<Longrightarrow> prod f A dvd y
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
prod f A \<noteq> (0::'a)

goal (1 subgoal):
 1. prod f A dvd y
[PROOF STEP]
proof (rule multiplicity_le_imp_dvd)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>p. prime p \<Longrightarrow> multiplicity p (prod f A) \<le> multiplicity p y
[PROOF STEP]
fix p :: 'a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>p. prime p \<Longrightarrow> multiplicity p (prod f A) \<le> multiplicity p y
[PROOF STEP]
assume "prime p"
[PROOF STATE]
proof (state)
this:
prime p

goal (1 subgoal):
 1. \<And>p. prime p \<Longrightarrow> multiplicity p (prod f A) \<le> multiplicity p y
[PROOF STEP]
show "multiplicity p (prod f A) \<le> multiplicity p y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicity p (prod f A) \<le> multiplicity p y
[PROOF STEP]
proof (cases "p dvd prod f A")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. p dvd prod f A \<Longrightarrow> multiplicity p (prod f A) \<le> multiplicity p y
 2. \<not> p dvd prod f A \<Longrightarrow> multiplicity p (prod f A) \<le> multiplicity p y
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
p dvd prod f A

goal (2 subgoals):
 1. p dvd prod f A \<Longrightarrow> multiplicity p (prod f A) \<le> multiplicity p y
 2. \<not> p dvd prod f A \<Longrightarrow> multiplicity p (prod f A) \<le> multiplicity p y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p dvd prod f A
[PROOF STEP]
obtain x where x: "x \<in> A" and "p dvd f x"
[PROOF STATE]
proof (prove)
using this:
p dvd prod f A

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>x \<in> A; p dvd f x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>prime p\<close> assms
[PROOF STATE]
proof (prove)
using this:
p dvd prod f A
prime p
finite A
?x1 \<in> A \<Longrightarrow> prime (f ?x1)
?x1 \<in> A \<Longrightarrow> f ?x1 dvd y
inj_on f A

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>x \<in> A; p dvd f x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (subst (asm) prime_dvd_prod_iff) auto
[PROOF STATE]
proof (state)
this:
x \<in> A
p dvd f x

goal (2 subgoals):
 1. p dvd prod f A \<Longrightarrow> multiplicity p (prod f A) \<le> multiplicity p y
 2. \<not> p dvd prod f A \<Longrightarrow> multiplicity p (prod f A) \<le> multiplicity p y
[PROOF STEP]
have "multiplicity p (prod f A) = (\<Sum>x\<in>A. multiplicity p (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicity p (prod f A) = (\<Sum>x\<in>A. multiplicity p (f x))
[PROOF STEP]
using assms \<open>prime p\<close> nz
[PROOF STATE]
proof (prove)
using this:
finite A
?x1 \<in> A \<Longrightarrow> prime (f ?x1)
?x1 \<in> A \<Longrightarrow> f ?x1 dvd y
inj_on f A
prime p
?x1 \<in> A \<Longrightarrow> f ?x1 \<noteq> (0::'a)

goal (1 subgoal):
 1. multiplicity p (prod f A) = (\<Sum>x\<in>A. multiplicity p (f x))
[PROOF STEP]
by (intro prime_elem_multiplicity_prod_distrib) auto
[PROOF STATE]
proof (state)
this:
multiplicity p (prod f A) = (\<Sum>x\<in>A. multiplicity p (f x))

goal (2 subgoals):
 1. p dvd prod f A \<Longrightarrow> multiplicity p (prod f A) \<le> multiplicity p y
 2. \<not> p dvd prod f A \<Longrightarrow> multiplicity p (prod f A) \<le> multiplicity p y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
multiplicity p (prod f A) = (\<Sum>x\<in>A. multiplicity p (f x))

goal (2 subgoals):
 1. p dvd prod f A \<Longrightarrow> multiplicity p (prod f A) \<le> multiplicity p y
 2. \<not> p dvd prod f A \<Longrightarrow> multiplicity p (prod f A) \<le> multiplicity p y
[PROOF STEP]
have "\<dots> = (\<Sum>x\<in>{x}. 1 :: nat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>A. multiplicity p (f x)) = (\<Sum>x\<in>{x}. 1)
[PROOF STEP]
using assms \<open>prime p\<close> \<open>p dvd f x\<close> primes_dvd_imp_eq x
[PROOF STATE]
proof (prove)
using this:
finite A
?x1 \<in> A \<Longrightarrow> prime (f ?x1)
?x1 \<in> A \<Longrightarrow> f ?x1 dvd y
inj_on f A
prime p
p dvd f x
\<lbrakk>prime ?p; prime ?q; ?p dvd ?q\<rbrakk> \<Longrightarrow> ?p = ?q
x \<in> A

goal (1 subgoal):
 1. (\<Sum>x\<in>A. multiplicity p (f x)) = (\<Sum>x\<in>{x}. 1)
[PROOF STEP]
by (intro Groups_Big.sum.mono_neutral_cong_right)
           (auto simp: multiplicity_prime_prime inj_on_def)
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>A. multiplicity p (f x)) = (\<Sum>x\<in>{x}. 1)

goal (2 subgoals):
 1. p dvd prod f A \<Longrightarrow> multiplicity p (prod f A) \<le> multiplicity p y
 2. \<not> p dvd prod f A \<Longrightarrow> multiplicity p (prod f A) \<le> multiplicity p y
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
multiplicity p (prod f A) = (\<Sum>x\<in>{x}. 1)
[PROOF STEP]
have "multiplicity p (prod f A) = 1"
[PROOF STATE]
proof (prove)
using this:
multiplicity p (prod f A) = (\<Sum>x\<in>{x}. 1)

goal (1 subgoal):
 1. multiplicity p (prod f A) = 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
multiplicity p (prod f A) = 1

goal (2 subgoals):
 1. p dvd prod f A \<Longrightarrow> multiplicity p (prod f A) \<le> multiplicity p y
 2. \<not> p dvd prod f A \<Longrightarrow> multiplicity p (prod f A) \<le> multiplicity p y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
multiplicity p (prod f A) = 1

goal (2 subgoals):
 1. p dvd prod f A \<Longrightarrow> multiplicity p (prod f A) \<le> multiplicity p y
 2. \<not> p dvd prod f A \<Longrightarrow> multiplicity p (prod f A) \<le> multiplicity p y
[PROOF STEP]
have "1 \<le> multiplicity p y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> multiplicity p y
[PROOF STEP]
using assms nz \<open>prime p\<close> \<open>y \<noteq> 0\<close> x \<open>p dvd f x\<close>
[PROOF STATE]
proof (prove)
using this:
finite A
?x1 \<in> A \<Longrightarrow> prime (f ?x1)
?x1 \<in> A \<Longrightarrow> f ?x1 dvd y
inj_on f A
?x1 \<in> A \<Longrightarrow> f ?x1 \<noteq> (0::'a)
prime p
y \<noteq> (0::'a)
x \<in> A
p dvd f x

goal (1 subgoal):
 1. 1 \<le> multiplicity p y
[PROOF STEP]
by (intro multiplicity_geI) force+
[PROOF STATE]
proof (state)
this:
1 \<le> multiplicity p y

goal (2 subgoals):
 1. p dvd prod f A \<Longrightarrow> multiplicity p (prod f A) \<le> multiplicity p y
 2. \<not> p dvd prod f A \<Longrightarrow> multiplicity p (prod f A) \<le> multiplicity p y
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
multiplicity p (prod f A) \<le> multiplicity p y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
multiplicity p (prod f A) \<le> multiplicity p y

goal (1 subgoal):
 1. multiplicity p (prod f A) \<le> multiplicity p y
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
multiplicity p (prod f A) \<le> multiplicity p y

goal (1 subgoal):
 1. \<not> p dvd prod f A \<Longrightarrow> multiplicity p (prod f A) \<le> multiplicity p y
[PROOF STEP]
qed (auto simp: not_dvd_imp_multiplicity_0)
[PROOF STATE]
proof (state)
this:
multiplicity p (prod f A) \<le> multiplicity p y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
prod f A dvd y

goal (1 subgoal):
 1. y = (0::'a) \<Longrightarrow> prod f A dvd y
[PROOF STEP]
qed auto


[STATEMENT]
theorem Zorn's_Lemma:
  assumes r: "\<And>c. c \<in> chains S \<Longrightarrow> \<exists>x. x \<in> c \<Longrightarrow> \<Union>c \<in> S"
    and aS: "a \<in> S"
  shows "\<exists>y \<in> S. \<forall>z \<in> S. y \<subseteq> z \<longrightarrow> z = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>y\<in>S. \<forall>z\<in>S. y \<subseteq> z \<longrightarrow> z = y
[PROOF STEP]
proof (rule Zorn_Lemma2)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>C\<in>chains S. \<exists>U\<in>S. \<forall>z\<in>C. z \<subseteq> U
[PROOF STEP]
show "\<forall>c \<in> chains S. \<exists>y \<in> S. \<forall>z \<in> c. z \<subseteq> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>c\<in>chains S. \<exists>y\<in>S. \<forall>z\<in>c. z \<subseteq> y
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>c. c \<in> chains S \<Longrightarrow> \<exists>y\<in>S. \<forall>z\<in>c. z \<subseteq> y
[PROOF STEP]
fix c
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>c. c \<in> chains S \<Longrightarrow> \<exists>y\<in>S. \<forall>z\<in>c. z \<subseteq> y
[PROOF STEP]
assume "c \<in> chains S"
[PROOF STATE]
proof (state)
this:
c \<in> chains S

goal (1 subgoal):
 1. \<And>c. c \<in> chains S \<Longrightarrow> \<exists>y\<in>S. \<forall>z\<in>c. z \<subseteq> y
[PROOF STEP]
show "\<exists>y \<in> S. \<forall>z \<in> c. z \<subseteq> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>y\<in>S. \<forall>z\<in>c. z \<subseteq> y
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> \<exists>y\<in>S. \<forall>z\<in>c. z \<subseteq> y
 2. \<not> ?P \<Longrightarrow> \<exists>y\<in>S. \<forall>z\<in>c. z \<subseteq> y
[PROOF STEP]
txt \<open>If \<open>c\<close> is an empty chain, then every element in \<open>S\<close> is an upper
        bound of \<open>c\<close>.\<close>
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> \<exists>y\<in>S. \<forall>z\<in>c. z \<subseteq> y
 2. \<not> ?P \<Longrightarrow> \<exists>y\<in>S. \<forall>z\<in>c. z \<subseteq> y
[PROOF STEP]
assume "c = {}"
[PROOF STATE]
proof (state)
this:
c = {}

goal (2 subgoals):
 1. ?P \<Longrightarrow> \<exists>y\<in>S. \<forall>z\<in>c. z \<subseteq> y
 2. \<not> ?P \<Longrightarrow> \<exists>y\<in>S. \<forall>z\<in>c. z \<subseteq> y
[PROOF STEP]
with aS
[PROOF STATE]
proof (chain)
picking this:
a \<in> S
c = {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a \<in> S
c = {}

goal (1 subgoal):
 1. \<exists>y\<in>S. \<forall>z\<in>c. z \<subseteq> y
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
\<exists>y\<in>S. \<forall>z\<in>c. z \<subseteq> y

goal (1 subgoal):
 1. c \<noteq> {} \<Longrightarrow> \<exists>y\<in>S. \<forall>z\<in>c. z \<subseteq> y
[PROOF STEP]
txt \<open>If \<open>c\<close> is non-empty, then \<open>\<Union>c\<close> is an upper bound of \<open>c\<close>, lying in
        \<open>S\<close>.\<close>
[PROOF STATE]
proof (state)
this:
\<exists>y\<in>S. \<forall>z\<in>c. z \<subseteq> y

goal (1 subgoal):
 1. c \<noteq> {} \<Longrightarrow> \<exists>y\<in>S. \<forall>z\<in>c. z \<subseteq> y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. c \<noteq> {} \<Longrightarrow> \<exists>y\<in>S. \<forall>z\<in>c. z \<subseteq> y
[PROOF STEP]
assume "c \<noteq> {}"
[PROOF STATE]
proof (state)
this:
c \<noteq> {}

goal (1 subgoal):
 1. c \<noteq> {} \<Longrightarrow> \<exists>y\<in>S. \<forall>z\<in>c. z \<subseteq> y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>y\<in>S. \<forall>z\<in>c. z \<subseteq> y
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>z\<in>c. z \<subseteq> ?y
 2. ?y \<in> S
[PROOF STEP]
show "\<forall>z \<in> c. z \<subseteq> \<Union>c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>z\<in>c. z \<subseteq> \<Union> c
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
\<forall>z\<in>c. z \<subseteq> \<Union> c

goal (1 subgoal):
 1. \<Union> c \<in> S
[PROOF STEP]
show "\<Union>c \<in> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> c \<in> S
[PROOF STEP]
proof (rule r)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. c \<in> chains S
 2. \<exists>x. x \<in> c
[PROOF STEP]
from \<open>c \<noteq> {}\<close>
[PROOF STATE]
proof (chain)
picking this:
c \<noteq> {}
[PROOF STEP]
show "\<exists>x. x \<in> c"
[PROOF STATE]
proof (prove)
using this:
c \<noteq> {}

goal (1 subgoal):
 1. \<exists>x. x \<in> c
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
\<exists>x. x \<in> c

goal (1 subgoal):
 1. c \<in> chains S
[PROOF STEP]
show "c \<in> chains S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<in> chains S
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
c \<in> chains S

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<Union> c \<in> S

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>y\<in>S. \<forall>z\<in>c. z \<subseteq> y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>y\<in>S. \<forall>z\<in>c. z \<subseteq> y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>c\<in>chains S. \<exists>y\<in>S. \<forall>z\<in>c. z \<subseteq> y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma hyp_diff_divide_distrib:
  fixes a b c :: "('a :: {inverse, comm_ring_1, division_ring}) hyperdual"
  shows "(a - b) / c = a / c - b / c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a - b) / c = a / c - b / c
[PROOF STEP]
by (simp add: left_diff_distrib hyp_divide_inverse)


[STATEMENT]
lemma imirror_card: "finite I \<Longrightarrow> card (imirror I) = card I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite I \<Longrightarrow> card (imirror I) = card I
[PROOF STEP]
apply (simp only: imirror_eq_mirror_elem_image)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite I \<Longrightarrow> card ((\<lambda>x. mirror_elem x I) ` I) = card I
[PROOF STEP]
apply (rule inj_on_iff_eq_card[THEN iffD1], assumption)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite I \<Longrightarrow> inj_on (\<lambda>x. mirror_elem x I) I
[PROOF STEP]
apply (rule mirror_elem_inj_on, assumption)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma genPrefix_imp_nth:
    "i < length xs \<Longrightarrow> (xs, ys) \<in> genPrefix r \<Longrightarrow> (xs ! i, ys ! i) \<in> r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i < length xs; (xs, ys) \<in> genPrefix r\<rbrakk> \<Longrightarrow> (xs ! i, ys ! i) \<in> r
[PROOF STEP]
apply (induct xs arbitrary: i ys)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i ys. \<lbrakk>i < length []; ([], ys) \<in> genPrefix r\<rbrakk> \<Longrightarrow> ([] ! i, ys ! i) \<in> r
 2. \<And>a xs i ys. \<lbrakk>\<And>i ys. \<lbrakk>i < length xs; (xs, ys) \<in> genPrefix r\<rbrakk> \<Longrightarrow> (xs ! i, ys ! i) \<in> r; i < length (a # xs); (a # xs, ys) \<in> genPrefix r\<rbrakk> \<Longrightarrow> ((a # xs) ! i, ys ! i) \<in> r
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a xs i y ysa. \<lbrakk>\<And>i ys. \<lbrakk>i < length xs; (xs, ys) \<in> genPrefix r\<rbrakk> \<Longrightarrow> (xs ! i, ys ! i) \<in> r; i < Suc (length xs); (a, y) \<in> r; (xs, ysa) \<in> genPrefix r\<rbrakk> \<Longrightarrow> ((a # xs) ! i, (y # ysa) ! i) \<in> r
[PROOF STEP]
apply (case_tac i)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a xs i y ysa. \<lbrakk>\<And>i ys. \<lbrakk>i < length xs; (xs, ys) \<in> genPrefix r\<rbrakk> \<Longrightarrow> (xs ! i, ys ! i) \<in> r; i < Suc (length xs); (a, y) \<in> r; (xs, ysa) \<in> genPrefix r; i = 0\<rbrakk> \<Longrightarrow> ((a # xs) ! i, (y # ysa) ! i) \<in> r
 2. \<And>a xs i y ysa nat. \<lbrakk>\<And>i ys. \<lbrakk>i < length xs; (xs, ys) \<in> genPrefix r\<rbrakk> \<Longrightarrow> (xs ! i, ys ! i) \<in> r; i < Suc (length xs); (a, y) \<in> r; (xs, ysa) \<in> genPrefix r; i = Suc nat\<rbrakk> \<Longrightarrow> ((a # xs) ! i, (y # ysa) ! i) \<in> r
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma sum_list_scf_list:
  assumes "\<And> i. i < length ts \<Longrightarrow> f i > 0"
  shows "sum_list (map weight ts) \<le> sum_list (map weight (scf_list f ts))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (map weight ts) \<le> sum_list (map weight (scf_list f ts))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?i6 < length ts \<Longrightarrow> 0 < f ?i6

goal (1 subgoal):
 1. sum_list (map weight ts) \<le> sum_list (map weight (scf_list f ts))
[PROOF STEP]
unfolding scf_list_def
[PROOF STATE]
proof (prove)
using this:
?i6 < length ts \<Longrightarrow> 0 < f ?i6

goal (1 subgoal):
 1. sum_list (map weight ts) \<le> sum_list (map weight (concat (map2 (\<lambda>x i. replicate (f i) x) ts [0..<length ts])))
[PROOF STEP]
proof (induct ts rule: List.rev_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<And>i. i < length [] \<Longrightarrow> 0 < f i) \<Longrightarrow> sum_list (map weight []) \<le> sum_list (map weight (concat (map2 (\<lambda>x i. replicate (f i) x) [] [0..<length []])))
 2. \<And>x xs. \<lbrakk>(\<And>i. i < length xs \<Longrightarrow> 0 < f i) \<Longrightarrow> sum_list (map weight xs) \<le> sum_list (map weight (concat (map2 (\<lambda>x i. replicate (f i) x) xs [0..<length xs]))); \<And>i. i < length (xs @ [x]) \<Longrightarrow> 0 < f i\<rbrakk> \<Longrightarrow> sum_list (map weight (xs @ [x])) \<le> sum_list (map weight (concat (map2 (\<lambda>x i. replicate (f i) x) (xs @ [x]) [0..<length (xs @ [x])])))
[PROOF STEP]
case (snoc t ts)
[PROOF STATE]
proof (state)
this:
(\<And>i. i < length ts \<Longrightarrow> 0 < f i) \<Longrightarrow> sum_list (map weight ts) \<le> sum_list (map weight (concat (map2 (\<lambda>x i. replicate (f i) x) ts [0..<length ts])))
?i6 < length (ts @ [t]) \<Longrightarrow> 0 < f ?i6

goal (2 subgoals):
 1. (\<And>i. i < length [] \<Longrightarrow> 0 < f i) \<Longrightarrow> sum_list (map weight []) \<le> sum_list (map weight (concat (map2 (\<lambda>x i. replicate (f i) x) [] [0..<length []])))
 2. \<And>x xs. \<lbrakk>(\<And>i. i < length xs \<Longrightarrow> 0 < f i) \<Longrightarrow> sum_list (map weight xs) \<le> sum_list (map weight (concat (map2 (\<lambda>x i. replicate (f i) x) xs [0..<length xs]))); \<And>i. i < length (xs @ [x]) \<Longrightarrow> 0 < f i\<rbrakk> \<Longrightarrow> sum_list (map weight (xs @ [x])) \<le> sum_list (map weight (concat (map2 (\<lambda>x i. replicate (f i) x) (xs @ [x]) [0..<length (xs @ [x])])))
[PROOF STEP]
have "sum_list (map weight ts) \<le>
    sum_list (map weight (concat (map (\<lambda>(x, i). replicate (f i) x) (zip ts [0..<length ts]))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (map weight ts) \<le> sum_list (map weight (concat (map2 (\<lambda>x i. replicate (f i) x) ts [0..<length ts])))
[PROOF STEP]
by (auto intro!: snoc)
[PROOF STATE]
proof (state)
this:
sum_list (map weight ts) \<le> sum_list (map weight (concat (map2 (\<lambda>x i. replicate (f i) x) ts [0..<length ts])))

goal (2 subgoals):
 1. (\<And>i. i < length [] \<Longrightarrow> 0 < f i) \<Longrightarrow> sum_list (map weight []) \<le> sum_list (map weight (concat (map2 (\<lambda>x i. replicate (f i) x) [] [0..<length []])))
 2. \<And>x xs. \<lbrakk>(\<And>i. i < length xs \<Longrightarrow> 0 < f i) \<Longrightarrow> sum_list (map weight xs) \<le> sum_list (map weight (concat (map2 (\<lambda>x i. replicate (f i) x) xs [0..<length xs]))); \<And>i. i < length (xs @ [x]) \<Longrightarrow> 0 < f i\<rbrakk> \<Longrightarrow> sum_list (map weight (xs @ [x])) \<le> sum_list (map weight (concat (map2 (\<lambda>x i. replicate (f i) x) (xs @ [x]) [0..<length (xs @ [x])])))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
sum_list (map weight ts) \<le> sum_list (map weight (concat (map2 (\<lambda>x i. replicate (f i) x) ts [0..<length ts])))

goal (2 subgoals):
 1. (\<And>i. i < length [] \<Longrightarrow> 0 < f i) \<Longrightarrow> sum_list (map weight []) \<le> sum_list (map weight (concat (map2 (\<lambda>x i. replicate (f i) x) [] [0..<length []])))
 2. \<And>x xs. \<lbrakk>(\<And>i. i < length xs \<Longrightarrow> 0 < f i) \<Longrightarrow> sum_list (map weight xs) \<le> sum_list (map weight (concat (map2 (\<lambda>x i. replicate (f i) x) xs [0..<length xs]))); \<And>i. i < length (xs @ [x]) \<Longrightarrow> 0 < f i\<rbrakk> \<Longrightarrow> sum_list (map weight (xs @ [x])) \<le> sum_list (map weight (concat (map2 (\<lambda>x i. replicate (f i) x) (xs @ [x]) [0..<length (xs @ [x])])))
[PROOF STEP]
from snoc(2) [of "length ts"]
[PROOF STATE]
proof (chain)
picking this:
length ts < length (ts @ [t]) \<Longrightarrow> 0 < f (length ts)
[PROOF STEP]
obtain n where "f (length ts) = Suc n"
[PROOF STATE]
proof (prove)
using this:
length ts < length (ts @ [t]) \<Longrightarrow> 0 < f (length ts)

goal (1 subgoal):
 1. (\<And>n. f (length ts) = Suc n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto elim: lessE)
[PROOF STATE]
proof (state)
this:
f (length ts) = Suc n

goal (2 subgoals):
 1. (\<And>i. i < length [] \<Longrightarrow> 0 < f i) \<Longrightarrow> sum_list (map weight []) \<le> sum_list (map weight (concat (map2 (\<lambda>x i. replicate (f i) x) [] [0..<length []])))
 2. \<And>x xs. \<lbrakk>(\<And>i. i < length xs \<Longrightarrow> 0 < f i) \<Longrightarrow> sum_list (map weight xs) \<le> sum_list (map weight (concat (map2 (\<lambda>x i. replicate (f i) x) xs [0..<length xs]))); \<And>i. i < length (xs @ [x]) \<Longrightarrow> 0 < f i\<rbrakk> \<Longrightarrow> sum_list (map weight (xs @ [x])) \<le> sum_list (map weight (concat (map2 (\<lambda>x i. replicate (f i) x) (xs @ [x]) [0..<length (xs @ [x])])))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
sum_list (map weight ts) \<le> sum_list (map weight (concat (map2 (\<lambda>x i. replicate (f i) x) ts [0..<length ts])))
f (length ts) = Suc n
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
sum_list (map weight ts) \<le> sum_list (map weight (concat (map2 (\<lambda>x i. replicate (f i) x) ts [0..<length ts])))
f (length ts) = Suc n

goal (1 subgoal):
 1. sum_list (map weight (ts @ [t])) \<le> sum_list (map weight (concat (map2 (\<lambda>x i. replicate (f i) x) (ts @ [t]) [0..<length (ts @ [t])])))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum_list (map weight (ts @ [t])) \<le> sum_list (map weight (concat (map2 (\<lambda>x i. replicate (f i) x) (ts @ [t]) [0..<length (ts @ [t])])))

goal (1 subgoal):
 1. (\<And>i. i < length [] \<Longrightarrow> 0 < f i) \<Longrightarrow> sum_list (map weight []) \<le> sum_list (map weight (concat (map2 (\<lambda>x i. replicate (f i) x) [] [0..<length []])))
[PROOF STEP]
qed simp


[STATEMENT]
lemma comm_append_is_replicate:
  fixes xs ys :: "'a list"
  assumes "xs \<noteq> []" "ys \<noteq> []"
  assumes "xs @ ys = ys @ xs"
  shows "\<exists>n zs. n > 1 \<and> concat (replicate n zs) = xs @ ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n zs. 1 < n \<and> concat (replicate n zs) = xs @ ys
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>n zs. 1 < n \<and> concat (replicate n zs) = xs @ ys
[PROOF STEP]
obtain m n zs where "concat (replicate m zs) = xs"
    and "concat (replicate n zs) = ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>m zs n. \<lbrakk>concat (replicate m zs) = xs; concat (replicate n zs) = ys\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using comm_append_are_replicate[OF assms(3)]
[PROOF STATE]
proof (prove)
using this:
\<exists>m n zs. concat (replicate m zs) = xs \<and> concat (replicate n zs) = ys

goal (1 subgoal):
 1. (\<And>m zs n. \<lbrakk>concat (replicate m zs) = xs; concat (replicate n zs) = ys\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
concat (replicate m zs) = xs
concat (replicate n zs) = ys

goal (1 subgoal):
 1. \<exists>n zs. 1 < n \<and> concat (replicate n zs) = xs @ ys
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
concat (replicate m zs) = xs
concat (replicate n zs) = ys
[PROOF STEP]
have "m + n > 1" and "concat (replicate (m+n) zs) = xs @ ys"
[PROOF STATE]
proof (prove)
using this:
concat (replicate m zs) = xs
concat (replicate n zs) = ys

goal (1 subgoal):
 1. 1 < m + n &&& concat (replicate (m + n) zs) = xs @ ys
[PROOF STEP]
using \<open>xs \<noteq> []\<close> and \<open>ys \<noteq> []\<close>
[PROOF STATE]
proof (prove)
using this:
concat (replicate m zs) = xs
concat (replicate n zs) = ys
xs \<noteq> []
ys \<noteq> []

goal (1 subgoal):
 1. 1 < m + n &&& concat (replicate (m + n) zs) = xs @ ys
[PROOF STEP]
by (auto simp: replicate_add)
[PROOF STATE]
proof (state)
this:
1 < m + n
concat (replicate (m + n) zs) = xs @ ys

goal (1 subgoal):
 1. \<exists>n zs. 1 < n \<and> concat (replicate n zs) = xs @ ys
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 < m + n
concat (replicate (m + n) zs) = xs @ ys
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
1 < m + n
concat (replicate (m + n) zs) = xs @ ys

goal (1 subgoal):
 1. \<exists>n zs. 1 < n \<and> concat (replicate n zs) = xs @ ys
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>n zs. 1 < n \<and> concat (replicate n zs) = xs @ ys

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma degree_Poly_list_of_vec:
assumes n: "x \<in> carrier_vec n"
and n0: "n > 0"
shows "degree (Poly (list_of_vec x)) < n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (Poly (list_of_vec x)) < n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. degree (Poly (list_of_vec x)) < n
[PROOF STEP]
have x_dim: "dim_vec x = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec x = n
[PROOF STEP]
using n
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier_vec n

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

goal (1 subgoal):
 1. degree (Poly (list_of_vec x)) < n
[PROOF STEP]
have l: "(list_of_vec x) \<noteq> []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_of_vec x \<noteq> []
[PROOF STEP]
by (auto simp add: list_of_vec_rw_map vec_of_dim_0[symmetric] n0 n x_dim)
[PROOF STATE]
proof (state)
this:
list_of_vec x \<noteq> []

goal (1 subgoal):
 1. degree (Poly (list_of_vec x)) < n
[PROOF STEP]
have "degree (Poly (list_of_vec x)) < length (list_of_vec x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (Poly (list_of_vec x)) < length (list_of_vec x)
[PROOF STEP]
by (rule degree_Poly'[OF l])
[PROOF STATE]
proof (state)
this:
degree (Poly (list_of_vec x)) < length (list_of_vec x)

goal (1 subgoal):
 1. degree (Poly (list_of_vec x)) < n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
degree (Poly (list_of_vec x)) < length (list_of_vec x)

goal (1 subgoal):
 1. degree (Poly (list_of_vec x)) < n
[PROOF STEP]
have "... = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (list_of_vec x) = n
[PROOF STEP]
using x_dim
[PROOF STATE]
proof (prove)
using this:
dim_vec x = n

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

goal (1 subgoal):
 1. degree (Poly (list_of_vec x)) < n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
degree (Poly (list_of_vec x)) < n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
degree (Poly (list_of_vec x)) < n

goal (1 subgoal):
 1. degree (Poly (list_of_vec x)) < n
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
degree (Poly (list_of_vec x)) < n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma timpl_closure_set_Union:
  "timpl_closure_set (\<Union>Ms) T = (\<Union>M \<in> Ms. timpl_closure_set M T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. timpl_closure_set (\<Union> Ms) T = (\<Union>M\<in>Ms. timpl_closure_set M T)
[PROOF STEP]
using timpl_closure_set_is_timpl_closure_union[of "\<Union>Ms" T]
      timpl_closure_set_is_timpl_closure_union[of _ T]
[PROOF STATE]
proof (prove)
using this:
timpl_closure_set (\<Union> Ms) T = (\<Union>t\<in>\<Union> Ms. timpl_closure t T)
timpl_closure_set ?M T = (\<Union>t\<in>?M. timpl_closure t T)

goal (1 subgoal):
 1. timpl_closure_set (\<Union> Ms) T = (\<Union>M\<in>Ms. timpl_closure_set M T)
[PROOF STEP]
by force


[STATEMENT]
lemma abs_summable_on_comparison_test:
  assumes "g abs_summable_on A"
  assumes "\<And>x. x \<in> A \<Longrightarrow> norm (f x) \<le> norm (g x)"
  shows   "f abs_summable_on A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f abs_summable_on A
[PROOF STEP]
using assms Bochner_Integration.integrable_bound[of "count_space A" g f]
[PROOF STATE]
proof (prove)
using this:
g abs_summable_on A
?x \<in> A \<Longrightarrow> norm (f ?x) \<le> norm (g ?x)
\<lbrakk>integrable (count_space A) g; f \<in> borel_measurable (count_space A); AE x in count_space A. norm (f x) \<le> norm (g x)\<rbrakk> \<Longrightarrow> integrable (count_space A) f

goal (1 subgoal):
 1. f abs_summable_on A
[PROOF STEP]
unfolding abs_summable_on_def
[PROOF STATE]
proof (prove)
using this:
integrable (count_space A) g
?x \<in> A \<Longrightarrow> norm (f ?x) \<le> norm (g ?x)
\<lbrakk>integrable (count_space A) g; f \<in> borel_measurable (count_space A); AE x in count_space A. norm (f x) \<le> norm (g x)\<rbrakk> \<Longrightarrow> integrable (count_space A) f

goal (1 subgoal):
 1. integrable (count_space A) f
[PROOF STEP]
by (auto simp: AE_count_space)


[STATEMENT]
lemma front_sums: "front_sums xs = {s. \<exists>as bs. xs = as @ bs \<and> s = sum_list as}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. front_sums xs = {s. \<exists>as bs. xs = as @ bs \<and> s = sum_list as}
[PROOF STEP]
unfolding front_sums_def fronts_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list ` {as. \<exists>bs. xs = as @ bs} = {s. \<exists>as bs. xs = as @ bs \<and> s = sum_list as}
[PROOF STEP]
by auto


[STATEMENT]
lemma hd_tl:
  assumes "length l > 1"
  shows "hd (tl l) = l ! 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hd (tl l) = l ! 1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
1 < length l

goal (1 subgoal):
 1. hd (tl l) = l ! 1
[PROOF STEP]
by (induct l) (auto simp add: hd_conv_nth)


[STATEMENT]
lemma finite_ReZ_segments_constI:
  assumes "\<forall>t. 0<t\<and>t<1 \<longrightarrow> g t = c"
  shows "finite_ReZ_segments g z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_ReZ_segments g z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite_ReZ_segments g z
[PROOF STEP]
have "finite_ReZ_segments (\<lambda>_. c) z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_ReZ_segments (\<lambda>_. c) z
[PROOF STEP]
unfolding finite_ReZ_segments_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_Psegments (\<lambda>t. Re (c - z) = 0) 0 1
[PROOF STEP]
by (rule finite_Psegments_constI,auto)
[PROOF STATE]
proof (state)
this:
finite_ReZ_segments (\<lambda>_. c) z

goal (1 subgoal):
 1. finite_ReZ_segments g z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite_ReZ_segments (\<lambda>_. c) z
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite_ReZ_segments (\<lambda>_. c) z

goal (1 subgoal):
 1. finite_ReZ_segments g z
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite_ReZ_segments (\<lambda>_. c) z
\<forall>t. 0 < t \<and> t < 1 \<longrightarrow> g t = c

goal (1 subgoal):
 1. finite_ReZ_segments g z
[PROOF STEP]
by (elim finite_ReZ_segments_congE,auto)
[PROOF STATE]
proof (state)
this:
finite_ReZ_segments g z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Borsukian_open_map_image_compact:
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
  assumes "Borsukian S" and contf: "continuous_on S f" and fim: "f ` S = T" and "compact S"
      and ope: "\<And>U. openin (top_of_set S) U
                     \<Longrightarrow> openin (top_of_set T) (f ` U)"
    shows "Borsukian T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Borsukian T
[PROOF STEP]
proof (clarsimp simp add: Borsukian_continuous_logarithm_circle_real)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f. \<lbrakk>continuous_on T f; f ` T \<subseteq> sphere 0 1\<rbrakk> \<Longrightarrow> \<exists>g. continuous_on T g \<and> (\<forall>x\<in>T. f x = exp (\<i> * complex_of_real (g x)))
[PROOF STEP]
fix g :: "'b \<Rightarrow> complex"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f. \<lbrakk>continuous_on T f; f ` T \<subseteq> sphere 0 1\<rbrakk> \<Longrightarrow> \<exists>g. continuous_on T g \<and> (\<forall>x\<in>T. f x = exp (\<i> * complex_of_real (g x)))
[PROOF STEP]
assume contg: "continuous_on T g" and gim: "g ` T \<subseteq> sphere 0 1"
[PROOF STATE]
proof (state)
this:
continuous_on T g
g ` T \<subseteq> sphere 0 1

goal (1 subgoal):
 1. \<And>f. \<lbrakk>continuous_on T f; f ` T \<subseteq> sphere 0 1\<rbrakk> \<Longrightarrow> \<exists>g. continuous_on T g \<and> (\<forall>x\<in>T. f x = exp (\<i> * complex_of_real (g x)))
[PROOF STEP]
have "continuous_on S (g \<circ> f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on S (g \<circ> f)
[PROOF STEP]
using contf contg continuous_on_compose fim
[PROOF STATE]
proof (prove)
using this:
continuous_on S f
continuous_on T g
\<lbrakk>continuous_on ?s ?f; continuous_on (?f ` ?s) ?g\<rbrakk> \<Longrightarrow> continuous_on ?s (?g \<circ> ?f)
f ` S = T

goal (1 subgoal):
 1. continuous_on S (g \<circ> f)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
continuous_on S (g \<circ> f)

goal (1 subgoal):
 1. \<And>f. \<lbrakk>continuous_on T f; f ` T \<subseteq> sphere 0 1\<rbrakk> \<Longrightarrow> \<exists>g. continuous_on T g \<and> (\<forall>x\<in>T. f x = exp (\<i> * complex_of_real (g x)))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
continuous_on S (g \<circ> f)

goal (1 subgoal):
 1. \<And>f. \<lbrakk>continuous_on T f; f ` T \<subseteq> sphere 0 1\<rbrakk> \<Longrightarrow> \<exists>g. continuous_on T g \<and> (\<forall>x\<in>T. f x = exp (\<i> * complex_of_real (g x)))
[PROOF STEP]
have "(g \<circ> f) ` S \<subseteq> sphere 0 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g \<circ> f) ` S \<subseteq> sphere 0 1
[PROOF STEP]
using fim gim
[PROOF STATE]
proof (prove)
using this:
f ` S = T
g ` T \<subseteq> sphere 0 1

goal (1 subgoal):
 1. (g \<circ> f) ` S \<subseteq> sphere 0 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(g \<circ> f) ` S \<subseteq> sphere 0 1

goal (1 subgoal):
 1. \<And>f. \<lbrakk>continuous_on T f; f ` T \<subseteq> sphere 0 1\<rbrakk> \<Longrightarrow> \<exists>g. continuous_on T g \<and> (\<forall>x\<in>T. f x = exp (\<i> * complex_of_real (g x)))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
continuous_on S (g \<circ> f)
(g \<circ> f) ` S \<subseteq> sphere 0 1
[PROOF STEP]
obtain h where cont_cxh: "continuous_on S (complex_of_real \<circ> h)"
                       and gfh: "\<And>x. x \<in> S \<Longrightarrow> (g \<circ> f) x = exp(\<i> * of_real(h x))"
[PROOF STATE]
proof (prove)
using this:
continuous_on S (g \<circ> f)
(g \<circ> f) ` S \<subseteq> sphere 0 1

goal (1 subgoal):
 1. (\<And>h. \<lbrakk>continuous_on S (complex_of_real \<circ> h); \<And>x. x \<in> S \<Longrightarrow> (g \<circ> f) x = exp (\<i> * complex_of_real (h x))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>Borsukian S\<close> Borsukian_continuous_logarithm_circle_real
[PROOF STATE]
proof (prove)
using this:
continuous_on S (g \<circ> f)
(g \<circ> f) ` S \<subseteq> sphere 0 1
Borsukian S
Borsukian ?S = (\<forall>f. continuous_on ?S f \<and> f ` ?S \<subseteq> sphere 0 1 \<longrightarrow> (\<exists>g. continuous_on ?S (complex_of_real \<circ> g) \<and> (\<forall>x\<in>?S. f x = exp (\<i> * complex_of_real (g x)))))

goal (1 subgoal):
 1. (\<And>h. \<lbrakk>continuous_on S (complex_of_real \<circ> h); \<And>x. x \<in> S \<Longrightarrow> (g \<circ> f) x = exp (\<i> * complex_of_real (h x))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
continuous_on S (complex_of_real \<circ> h)
?x \<in> S \<Longrightarrow> (g \<circ> f) ?x = exp (\<i> * complex_of_real (h ?x))

goal (1 subgoal):
 1. \<And>f. \<lbrakk>continuous_on T f; f ` T \<subseteq> sphere 0 1\<rbrakk> \<Longrightarrow> \<exists>g. continuous_on T g \<and> (\<forall>x\<in>T. f x = exp (\<i> * complex_of_real (g x)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
continuous_on S (complex_of_real \<circ> h)
?x \<in> S \<Longrightarrow> (g \<circ> f) ?x = exp (\<i> * complex_of_real (h ?x))
[PROOF STEP]
have conth: "continuous_on S h"
[PROOF STATE]
proof (prove)
using this:
continuous_on S (complex_of_real \<circ> h)
?x \<in> S \<Longrightarrow> (g \<circ> f) ?x = exp (\<i> * complex_of_real (h ?x))

goal (1 subgoal):
 1. continuous_on S h
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
continuous_on S h

goal (1 subgoal):
 1. \<And>f. \<lbrakk>continuous_on T f; f ` T \<subseteq> sphere 0 1\<rbrakk> \<Longrightarrow> \<exists>g. continuous_on T g \<and> (\<forall>x\<in>T. f x = exp (\<i> * complex_of_real (g x)))
[PROOF STEP]
have "\<exists>x. x \<in> S \<and> f x = y \<and> (\<forall>x' \<in> S. f x' = y \<longrightarrow> h x \<le> h x')" if "y \<in> T" for y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x. x \<in> S \<and> f x = y \<and> (\<forall>x'\<in>S. f x' = y \<longrightarrow> h x \<le> h x')
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>x. x \<in> S \<and> f x = y \<and> (\<forall>x'\<in>S. f x' = y \<longrightarrow> h x \<le> h x')
[PROOF STEP]
have 1: "compact (h ` {x \<in> S. f x = y})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compact (h ` {x \<in> S. f x = y})
[PROOF STEP]
proof (rule compact_continuous_image)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. continuous_on {x \<in> S. f x = y} h
 2. compact {x \<in> S. f x = y}
[PROOF STEP]
show "continuous_on {x \<in> S. f x = y} h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {x \<in> S. f x = y} h
[PROOF STEP]
by (rule continuous_on_subset [OF conth]) auto
[PROOF STATE]
proof (state)
this:
continuous_on {x \<in> S. f x = y} h

goal (1 subgoal):
 1. compact {x \<in> S. f x = y}
[PROOF STEP]
have "compact (S \<inter> f -` {y})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compact (S \<inter> f -` {y})
[PROOF STEP]
by (rule proper_map_from_compact [OF contf _ \<open>compact S\<close>, of T]) (simp_all add: fim that)
[PROOF STATE]
proof (state)
this:
compact (S \<inter> f -` {y})

goal (1 subgoal):
 1. compact {x \<in> S. f x = y}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
compact (S \<inter> f -` {y})
[PROOF STEP]
show "compact {x \<in> S. f x = y}"
[PROOF STATE]
proof (prove)
using this:
compact (S \<inter> f -` {y})

goal (1 subgoal):
 1. compact {x \<in> S. f x = y}
[PROOF STEP]
by (auto simp: vimage_def Int_def)
[PROOF STATE]
proof (state)
this:
compact {x \<in> S. f x = y}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
compact (h ` {x \<in> S. f x = y})

goal (1 subgoal):
 1. \<exists>x. x \<in> S \<and> f x = y \<and> (\<forall>x'\<in>S. f x' = y \<longrightarrow> h x \<le> h x')
[PROOF STEP]
have 2: "h ` {x \<in> S. f x = y} \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h ` {x \<in> S. f x = y} \<noteq> {}
[PROOF STEP]
using fim that
[PROOF STATE]
proof (prove)
using this:
f ` S = T
y \<in> T

goal (1 subgoal):
 1. h ` {x \<in> S. f x = y} \<noteq> {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
h ` {x \<in> S. f x = y} \<noteq> {}

goal (1 subgoal):
 1. \<exists>x. x \<in> S \<and> f x = y \<and> (\<forall>x'\<in>S. f x' = y \<longrightarrow> h x \<le> h x')
[PROOF STEP]
have "\<exists>s \<in> h ` {x \<in> S. f x = y}. \<forall>t \<in> h ` {x \<in> S. f x = y}. s \<le> t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>s\<in>h ` {x \<in> S. f x = y}. \<forall>t\<in>h ` {x \<in> S. f x = y}. s \<le> t
[PROOF STEP]
using compact_attains_inf [OF 1 2]
[PROOF STATE]
proof (prove)
using this:
\<exists>s\<in>h ` {x \<in> S. f x = y}. \<forall>t\<in>h ` {x \<in> S. f x = y}. s \<le> t

goal (1 subgoal):
 1. \<exists>s\<in>h ` {x \<in> S. f x = y}. \<forall>t\<in>h ` {x \<in> S. f x = y}. s \<le> t
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>s\<in>h ` {x \<in> S. f x = y}. \<forall>t\<in>h ` {x \<in> S. f x = y}. s \<le> t

goal (1 subgoal):
 1. \<exists>x. x \<in> S \<and> f x = y \<and> (\<forall>x'\<in>S. f x' = y \<longrightarrow> h x \<le> h x')
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>s\<in>h ` {x \<in> S. f x = y}. \<forall>t\<in>h ` {x \<in> S. f x = y}. s \<le> t
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>s\<in>h ` {x \<in> S. f x = y}. \<forall>t\<in>h ` {x \<in> S. f x = y}. s \<le> t

goal (1 subgoal):
 1. \<exists>x. x \<in> S \<and> f x = y \<and> (\<forall>x'\<in>S. f x' = y \<longrightarrow> h x \<le> h x')
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>x. x \<in> S \<and> f x = y \<and> (\<forall>x'\<in>S. f x' = y \<longrightarrow> h x \<le> h x')

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?y \<in> T \<Longrightarrow> \<exists>x. x \<in> S \<and> f x = ?y \<and> (\<forall>x'\<in>S. f x' = ?y \<longrightarrow> h x \<le> h x')

goal (1 subgoal):
 1. \<And>f. \<lbrakk>continuous_on T f; f ` T \<subseteq> sphere 0 1\<rbrakk> \<Longrightarrow> \<exists>g. continuous_on T g \<and> (\<forall>x\<in>T. f x = exp (\<i> * complex_of_real (g x)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?y \<in> T \<Longrightarrow> \<exists>x. x \<in> S \<and> f x = ?y \<and> (\<forall>x'\<in>S. f x' = ?y \<longrightarrow> h x \<le> h x')
[PROOF STEP]
obtain k where kTS: "\<And>y. y \<in> T \<Longrightarrow> k y \<in> S"
                  and fk:  "\<And>y. y \<in> T \<Longrightarrow> f (k y) = y "
                  and hle: "\<And>x' y. \<lbrakk>y \<in> T; x' \<in> S; f x' = y\<rbrakk> \<Longrightarrow> h (k y) \<le> h x'"
[PROOF STATE]
proof (prove)
using this:
?y \<in> T \<Longrightarrow> \<exists>x. x \<in> S \<and> f x = ?y \<and> (\<forall>x'\<in>S. f x' = ?y \<longrightarrow> h x \<le> h x')

goal (1 subgoal):
 1. (\<And>k. \<lbrakk>\<And>y. y \<in> T \<Longrightarrow> k y \<in> S; \<And>y. y \<in> T \<Longrightarrow> f (k y) = y; \<And>x' y. \<lbrakk>y \<in> T; x' \<in> S; f x' = y\<rbrakk> \<Longrightarrow> h (k y) \<le> h x'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
?y \<in> T \<Longrightarrow> k ?y \<in> S
?y \<in> T \<Longrightarrow> f (k ?y) = ?y
\<lbrakk>?y \<in> T; ?x' \<in> S; f ?x' = ?y\<rbrakk> \<Longrightarrow> h (k ?y) \<le> h ?x'

goal (1 subgoal):
 1. \<And>f. \<lbrakk>continuous_on T f; f ` T \<subseteq> sphere 0 1\<rbrakk> \<Longrightarrow> \<exists>g. continuous_on T g \<and> (\<forall>x\<in>T. f x = exp (\<i> * complex_of_real (g x)))
[PROOF STEP]
have "continuous_on T (h \<circ> k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on T (h \<circ> k)
[PROOF STEP]
proof (clarsimp simp add: continuous_on_iff)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x e. \<lbrakk>x \<in> T; 0 < e\<rbrakk> \<Longrightarrow> \<exists>d>0. \<forall>x'\<in>T. dist x' x < d \<longrightarrow> dist (h (k x')) (h (k x)) < e
[PROOF STEP]
fix y and e::real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x e. \<lbrakk>x \<in> T; 0 < e\<rbrakk> \<Longrightarrow> \<exists>d>0. \<forall>x'\<in>T. dist x' x < d \<longrightarrow> dist (h (k x')) (h (k x)) < e
[PROOF STEP]
assume "y \<in> T" "0 < e"
[PROOF STATE]
proof (state)
this:
y \<in> T
0 < e

goal (1 subgoal):
 1. \<And>x e. \<lbrakk>x \<in> T; 0 < e\<rbrakk> \<Longrightarrow> \<exists>d>0. \<forall>x'\<in>T. dist x' x < d \<longrightarrow> dist (h (k x')) (h (k x)) < e
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y \<in> T
0 < e

goal (1 subgoal):
 1. \<And>x e. \<lbrakk>x \<in> T; 0 < e\<rbrakk> \<Longrightarrow> \<exists>d>0. \<forall>x'\<in>T. dist x' x < d \<longrightarrow> dist (h (k x')) (h (k x)) < e
[PROOF STEP]
have "uniformly_continuous_on S (complex_of_real \<circ> h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uniformly_continuous_on S (complex_of_real \<circ> h)
[PROOF STEP]
using \<open>compact S\<close> cont_cxh compact_uniformly_continuous
[PROOF STATE]
proof (prove)
using this:
compact S
continuous_on S (complex_of_real \<circ> h)
\<lbrakk>continuous_on ?S ?f; compact ?S\<rbrakk> \<Longrightarrow> uniformly_continuous_on ?S ?f

goal (1 subgoal):
 1. uniformly_continuous_on S (complex_of_real \<circ> h)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
uniformly_continuous_on S (complex_of_real \<circ> h)

goal (1 subgoal):
 1. \<And>x e. \<lbrakk>x \<in> T; 0 < e\<rbrakk> \<Longrightarrow> \<exists>d>0. \<forall>x'\<in>T. dist x' x < d \<longrightarrow> dist (h (k x')) (h (k x)) < e
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
y \<in> T
0 < e
uniformly_continuous_on S (complex_of_real \<circ> h)
[PROOF STEP]
obtain d where "0 < d"
                  and d: "\<And>x x'. \<lbrakk>x\<in>S; x'\<in>S; dist x' x < d\<rbrakk> \<Longrightarrow> dist (h x') (h x) < e"
[PROOF STATE]
proof (prove)
using this:
y \<in> T
0 < e
uniformly_continuous_on S (complex_of_real \<circ> h)

goal (1 subgoal):
 1. (\<And>d. \<lbrakk>0 < d; \<And>x x'. \<lbrakk>x \<in> S; x' \<in> S; dist x' x < d\<rbrakk> \<Longrightarrow> dist (h x') (h x) < e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (force simp: uniformly_continuous_on_def)
[PROOF STATE]
proof (state)
this:
0 < d
\<lbrakk>?x \<in> S; ?x' \<in> S; dist ?x' ?x < d\<rbrakk> \<Longrightarrow> dist (h ?x') (h ?x) < e

goal (1 subgoal):
 1. \<And>x e. \<lbrakk>x \<in> T; 0 < e\<rbrakk> \<Longrightarrow> \<exists>d>0. \<forall>x'\<in>T. dist x' x < d \<longrightarrow> dist (h (k x')) (h (k x)) < e
[PROOF STEP]
obtain \<delta> where "0 < \<delta>" and \<delta>:
      "\<And>x'. \<lbrakk>x' \<in> T; dist y x' < \<delta>\<rbrakk>
               \<Longrightarrow> (\<forall>v \<in> {z \<in> S. f z = y}. \<exists>v'. v' \<in> {z \<in> S. f z = x'} \<and> dist v v' < d) \<and>
                   (\<forall>v' \<in> {z \<in> S. f z = x'}. \<exists>v. v \<in> {z \<in> S. f z = y} \<and> dist v' v < d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>\<delta>. \<lbrakk>0 < \<delta>; \<And>x'. \<lbrakk>x' \<in> T; dist y x' < \<delta>\<rbrakk> \<Longrightarrow> (\<forall>v\<in>{z \<in> S. f z = y}. \<exists>v'. v' \<in> {z \<in> S. f z = x'} \<and> dist v v' < d) \<and> (\<forall>v'\<in>{z \<in> S. f z = x'}. \<exists>v. v \<in> {z \<in> S. f z = y} \<and> dist v' v < d)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof (rule upper_lower_hemicontinuous_explicit [of T "\<lambda>y. {z \<in> S. f z = y}" S])
[PROOF STATE]
proof (state)
goal (8 subgoals):
 1. \<And>x. \<lbrakk>\<And>\<delta>. \<lbrakk>0 < \<delta>; \<And>x'. \<lbrakk>x' \<in> T; dist y x' < \<delta>\<rbrakk> \<Longrightarrow> (\<forall>v\<in>{z \<in> S. f z = y}. \<exists>v'. v' \<in> {z \<in> S. f z = x'} \<and> dist v v' < d) \<and> (\<forall>v'\<in>{z \<in> S. f z = x'}. \<exists>v. v \<in> {z \<in> S. f z = y} \<and> dist v' v < d)\<rbrakk> \<Longrightarrow> thesis; x \<in> T\<rbrakk> \<Longrightarrow> {z \<in> S. f z = x} \<subseteq> S
 2. \<And>U. \<lbrakk>\<And>\<delta>. \<lbrakk>0 < \<delta>; \<And>x'. \<lbrakk>x' \<in> T; dist y x' < \<delta>\<rbrakk> \<Longrightarrow> (\<forall>v\<in>{z \<in> S. f z = y}. \<exists>v'. v' \<in> {z \<in> S. f z = x'} \<and> dist v v' < d) \<and> (\<forall>v'\<in>{z \<in> S. f z = x'}. \<exists>v. v \<in> {z \<in> S. f z = y} \<and> dist v' v < d)\<rbrakk> \<Longrightarrow> thesis; openin (top_of_set S) U\<rbrakk> \<Longrightarrow> openin (top_of_set T) {x \<in> T. {z \<in> S. f z = x} \<subseteq> U}
 3. \<And>U. \<lbrakk>\<And>\<delta>. \<lbrakk>0 < \<delta>; \<And>x'. \<lbrakk>x' \<in> T; dist y x' < \<delta>\<rbrakk> \<Longrightarrow> (\<forall>v\<in>{z \<in> S. f z = y}. \<exists>v'. v' \<in> {z \<in> S. f z = x'} \<and> dist v v' < d) \<and> (\<forall>v'\<in>{z \<in> S. f z = x'}. \<exists>v. v \<in> {z \<in> S. f z = y} \<and> dist v' v < d)\<rbrakk> \<Longrightarrow> thesis; closedin (top_of_set S) U\<rbrakk> \<Longrightarrow> closedin (top_of_set T) {x \<in> T. {z \<in> S. f z = x} \<subseteq> U}
 4. (\<And>\<delta>. \<lbrakk>0 < \<delta>; \<And>x'. \<lbrakk>x' \<in> T; dist y x' < \<delta>\<rbrakk> \<Longrightarrow> (\<forall>v\<in>{z \<in> S. f z = y}. \<exists>v'. v' \<in> {z \<in> S. f z = x'} \<and> dist v v' < d) \<and> (\<forall>v'\<in>{z \<in> S. f z = x'}. \<exists>v. v \<in> {z \<in> S. f z = y} \<and> dist v' v < d)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> ?x2 \<in> T
 5. (\<And>\<delta>. \<lbrakk>0 < \<delta>; \<And>x'. \<lbrakk>x' \<in> T; dist y x' < \<delta>\<rbrakk> \<Longrightarrow> (\<forall>v\<in>{z \<in> S. f z = y}. \<exists>v'. v' \<in> {z \<in> S. f z = x'} \<and> dist v v' < d) \<and> (\<forall>v'\<in>{z \<in> S. f z = x'}. \<exists>v. v \<in> {z \<in> S. f z = y} \<and> dist v' v < d)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> 0 < ?e2
 6. (\<And>\<delta>. \<lbrakk>0 < \<delta>; \<And>x'. \<lbrakk>x' \<in> T; dist y x' < \<delta>\<rbrakk> \<Longrightarrow> (\<forall>v\<in>{z \<in> S. f z = y}. \<exists>v'. v' \<in> {z \<in> S. f z = x'} \<and> dist v v' < d) \<and> (\<forall>v'\<in>{z \<in> S. f z = x'}. \<exists>v. v \<in> {z \<in> S. f z = y} \<and> dist v' v < d)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> bounded {z \<in> S. f z = ?x2}
 7. (\<And>\<delta>. \<lbrakk>0 < \<delta>; \<And>x'. \<lbrakk>x' \<in> T; dist y x' < \<delta>\<rbrakk> \<Longrightarrow> (\<forall>v\<in>{z \<in> S. f z = y}. \<exists>v'. v' \<in> {z \<in> S. f z = x'} \<and> dist v v' < d) \<and> (\<forall>v'\<in>{z \<in> S. f z = x'}. \<exists>v. v \<in> {z \<in> S. f z = y} \<and> dist v' v < d)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> {z \<in> S. f z = ?x2} \<noteq> {}
 8. \<And>da. \<lbrakk>\<And>\<delta>. \<lbrakk>0 < \<delta>; \<And>x'. \<lbrakk>x' \<in> T; dist y x' < \<delta>\<rbrakk> \<Longrightarrow> (\<forall>v\<in>{z \<in> S. f z = y}. \<exists>v'. v' \<in> {z \<in> S. f z = x'} \<and> dist v v' < d) \<and> (\<forall>v'\<in>{z \<in> S. f z = x'}. \<exists>v. v \<in> {z \<in> S. f z = y} \<and> dist v' v < d)\<rbrakk> \<Longrightarrow> thesis; 0 < da; \<And>x'. \<lbrakk>x' \<in> T; dist ?x2 x' < da\<rbrakk> \<Longrightarrow> (\<forall>y\<in>{z \<in> S. f z = ?x2}. \<exists>y'. y' \<in> {z \<in> S. f z = x'} \<and> dist y y' < ?e2) \<and> (\<forall>y'\<in>{z \<in> S. f z = x'}. \<exists>y. y \<in> {z \<in> S. f z = ?x2} \<and> dist y' y < ?e2)\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
show "\<And>U. openin (top_of_set S) U
                 \<Longrightarrow> openin (top_of_set T) {x \<in> T. {z \<in> S. f z = x} \<subseteq> U}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>U. openin (top_of_set S) U \<Longrightarrow> openin (top_of_set T) {x \<in> T. {z \<in> S. f z = x} \<subseteq> U}
[PROOF STEP]
using closed_map_iff_upper_hemicontinuous_preimage [OF fim [THEN equalityD1]]
[PROOF STATE]
proof (prove)
using this:
(\<forall>U. closedin (top_of_set S) U \<longrightarrow> closedin (top_of_set T) (f ` U)) = (\<forall>U. openin (top_of_set S) U \<longrightarrow> openin (top_of_set T) {y \<in> T. {x \<in> S. f x = y} \<subseteq> U})

goal (1 subgoal):
 1. \<And>U. openin (top_of_set S) U \<Longrightarrow> openin (top_of_set T) {x \<in> T. {z \<in> S. f z = x} \<subseteq> U}
[PROOF STEP]
by (simp add: Abstract_Topology_2.continuous_imp_closed_map \<open>compact S\<close> contf fim)
[PROOF STATE]
proof (state)
this:
openin (top_of_set S) ?U \<Longrightarrow> openin (top_of_set T) {x \<in> T. {z \<in> S. f z = x} \<subseteq> ?U}

goal (7 subgoals):
 1. \<And>x. \<lbrakk>\<And>\<delta>. \<lbrakk>0 < \<delta>; \<And>x'. \<lbrakk>x' \<in> T; dist y x' < \<delta>\<rbrakk> \<Longrightarrow> (\<forall>v\<in>{z \<in> S. f z = y}. \<exists>v'. v' \<in> {z \<in> S. f z = x'} \<and> dist v v' < d) \<and> (\<forall>v'\<in>{z \<in> S. f z = x'}. \<exists>v. v \<in> {z \<in> S. f z = y} \<and> dist v' v < d)\<rbrakk> \<Longrightarrow> thesis; x \<in> T\<rbrakk> \<Longrightarrow> {z \<in> S. f z = x} \<subseteq> S
 2. \<And>U. \<lbrakk>\<And>\<delta>. \<lbrakk>0 < \<delta>; \<And>x'. \<lbrakk>x' \<in> T; dist y x' < \<delta>\<rbrakk> \<Longrightarrow> (\<forall>v\<in>{z \<in> S. f z = y}. \<exists>v'. v' \<in> {z \<in> S. f z = x'} \<and> dist v v' < d) \<and> (\<forall>v'\<in>{z \<in> S. f z = x'}. \<exists>v. v \<in> {z \<in> S. f z = y} \<and> dist v' v < d)\<rbrakk> \<Longrightarrow> thesis; closedin (top_of_set S) U\<rbrakk> \<Longrightarrow> closedin (top_of_set T) {x \<in> T. {z \<in> S. f z = x} \<subseteq> U}
 3. (\<And>\<delta>. \<lbrakk>0 < \<delta>; \<And>x'. \<lbrakk>x' \<in> T; dist y x' < \<delta>\<rbrakk> \<Longrightarrow> (\<forall>v\<in>{z \<in> S. f z = y}. \<exists>v'. v' \<in> {z \<in> S. f z = x'} \<and> dist v v' < d) \<and> (\<forall>v'\<in>{z \<in> S. f z = x'}. \<exists>v. v \<in> {z \<in> S. f z = y} \<and> dist v' v < d)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> ?x2 \<in> T
 4. (\<And>\<delta>. \<lbrakk>0 < \<delta>; \<And>x'. \<lbrakk>x' \<in> T; dist y x' < \<delta>\<rbrakk> \<Longrightarrow> (\<forall>v\<in>{z \<in> S. f z = y}. \<exists>v'. v' \<in> {z \<in> S. f z = x'} \<and> dist v v' < d) \<and> (\<forall>v'\<in>{z \<in> S. f z = x'}. \<exists>v. v \<in> {z \<in> S. f z = y} \<and> dist v' v < d)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> 0 < ?e2
 5. (\<And>\<delta>. \<lbrakk>0 < \<delta>; \<And>x'. \<lbrakk>x' \<in> T; dist y x' < \<delta>\<rbrakk> \<Longrightarrow> (\<forall>v\<in>{z \<in> S. f z = y}. \<exists>v'. v' \<in> {z \<in> S. f z = x'} \<and> dist v v' < d) \<and> (\<forall>v'\<in>{z \<in> S. f z = x'}. \<exists>v. v \<in> {z \<in> S. f z = y} \<and> dist v' v < d)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> bounded {z \<in> S. f z = ?x2}
 6. (\<And>\<delta>. \<lbrakk>0 < \<delta>; \<And>x'. \<lbrakk>x' \<in> T; dist y x' < \<delta>\<rbrakk> \<Longrightarrow> (\<forall>v\<in>{z \<in> S. f z = y}. \<exists>v'. v' \<in> {z \<in> S. f z = x'} \<and> dist v v' < d) \<and> (\<forall>v'\<in>{z \<in> S. f z = x'}. \<exists>v. v \<in> {z \<in> S. f z = y} \<and> dist v' v < d)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> {z \<in> S. f z = ?x2} \<noteq> {}
 7. \<And>da. \<lbrakk>\<And>\<delta>. \<lbrakk>0 < \<delta>; \<And>x'. \<lbrakk>x' \<in> T; dist y x' < \<delta>\<rbrakk> \<Longrightarrow> (\<forall>v\<in>{z \<in> S. f z = y}. \<exists>v'. v' \<in> {z \<in> S. f z = x'} \<and> dist v v' < d) \<and> (\<forall>v'\<in>{z \<in> S. f z = x'}. \<exists>v. v \<in> {z \<in> S. f z = y} \<and> dist v' v < d)\<rbrakk> \<Longrightarrow> thesis; 0 < da; \<And>x'. \<lbrakk>x' \<in> T; dist ?x2 x' < da\<rbrakk> \<Longrightarrow> (\<forall>y\<in>{z \<in> S. f z = ?x2}. \<exists>y'. y' \<in> {z \<in> S. f z = x'} \<and> dist y y' < ?e2) \<and> (\<forall>y'\<in>{z \<in> S. f z = x'}. \<exists>y. y \<in> {z \<in> S. f z = ?x2} \<and> dist y' y < ?e2)\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
show "\<And>U. closedin (top_of_set S) U \<Longrightarrow>
                 closedin (top_of_set T) {x \<in> T. {z \<in> S. f z = x} \<subseteq> U}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>U. closedin (top_of_set S) U \<Longrightarrow> closedin (top_of_set T) {x \<in> T. {z \<in> S. f z = x} \<subseteq> U}
[PROOF STEP]
using  ope open_map_iff_lower_hemicontinuous_preimage [OF fim [THEN equalityD1]]
[PROOF STATE]
proof (prove)
using this:
openin (top_of_set S) ?U \<Longrightarrow> openin (top_of_set T) (f ` ?U)
(\<forall>U. openin (top_of_set S) U \<longrightarrow> openin (top_of_set T) (f ` U)) = (\<forall>U. closedin (top_of_set S) U \<longrightarrow> closedin (top_of_set T) {y \<in> T. {x \<in> S. f x = y} \<subseteq> U})

goal (1 subgoal):
 1. \<And>U. closedin (top_of_set S) U \<Longrightarrow> closedin (top_of_set T) {x \<in> T. {z \<in> S. f z = x} \<subseteq> U}
[PROOF STEP]
by meson
[PROOF STATE]
proof (state)
this:
closedin (top_of_set S) ?U \<Longrightarrow> closedin (top_of_set T) {x \<in> T. {z \<in> S. f z = x} \<subseteq> ?U}

goal (6 subgoals):
 1. \<And>x. \<lbrakk>\<And>\<delta>. \<lbrakk>0 < \<delta>; \<And>x'. \<lbrakk>x' \<in> T; dist y x' < \<delta>\<rbrakk> \<Longrightarrow> (\<forall>v\<in>{z \<in> S. f z = y}. \<exists>v'. v' \<in> {z \<in> S. f z = x'} \<and> dist v v' < d) \<and> (\<forall>v'\<in>{z \<in> S. f z = x'}. \<exists>v. v \<in> {z \<in> S. f z = y} \<and> dist v' v < d)\<rbrakk> \<Longrightarrow> thesis; x \<in> T\<rbrakk> \<Longrightarrow> {z \<in> S. f z = x} \<subseteq> S
 2. (\<And>\<delta>. \<lbrakk>0 < \<delta>; \<And>x'. \<lbrakk>x' \<in> T; dist y x' < \<delta>\<rbrakk> \<Longrightarrow> (\<forall>v\<in>{z \<in> S. f z = y}. \<exists>v'. v' \<in> {z \<in> S. f z = x'} \<and> dist v v' < d) \<and> (\<forall>v'\<in>{z \<in> S. f z = x'}. \<exists>v. v \<in> {z \<in> S. f z = y} \<and> dist v' v < d)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> ?x2 \<in> T
 3. (\<And>\<delta>. \<lbrakk>0 < \<delta>; \<And>x'. \<lbrakk>x' \<in> T; dist y x' < \<delta>\<rbrakk> \<Longrightarrow> (\<forall>v\<in>{z \<in> S. f z = y}. \<exists>v'. v' \<in> {z \<in> S. f z = x'} \<and> dist v v' < d) \<and> (\<forall>v'\<in>{z \<in> S. f z = x'}. \<exists>v. v \<in> {z \<in> S. f z = y} \<and> dist v' v < d)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> 0 < ?e2
 4. (\<And>\<delta>. \<lbrakk>0 < \<delta>; \<And>x'. \<lbrakk>x' \<in> T; dist y x' < \<delta>\<rbrakk> \<Longrightarrow> (\<forall>v\<in>{z \<in> S. f z = y}. \<exists>v'. v' \<in> {z \<in> S. f z = x'} \<and> dist v v' < d) \<and> (\<forall>v'\<in>{z \<in> S. f z = x'}. \<exists>v. v \<in> {z \<in> S. f z = y} \<and> dist v' v < d)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> bounded {z \<in> S. f z = ?x2}
 5. (\<And>\<delta>. \<lbrakk>0 < \<delta>; \<And>x'. \<lbrakk>x' \<in> T; dist y x' < \<delta>\<rbrakk> \<Longrightarrow> (\<forall>v\<in>{z \<in> S. f z = y}. \<exists>v'. v' \<in> {z \<in> S. f z = x'} \<and> dist v v' < d) \<and> (\<forall>v'\<in>{z \<in> S. f z = x'}. \<exists>v. v \<in> {z \<in> S. f z = y} \<and> dist v' v < d)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> {z \<in> S. f z = ?x2} \<noteq> {}
 6. \<And>da. \<lbrakk>\<And>\<delta>. \<lbrakk>0 < \<delta>; \<And>x'. \<lbrakk>x' \<in> T; dist y x' < \<delta>\<rbrakk> \<Longrightarrow> (\<forall>v\<in>{z \<in> S. f z = y}. \<exists>v'. v' \<in> {z \<in> S. f z = x'} \<and> dist v v' < d) \<and> (\<forall>v'\<in>{z \<in> S. f z = x'}. \<exists>v. v \<in> {z \<in> S. f z = y} \<and> dist v' v < d)\<rbrakk> \<Longrightarrow> thesis; 0 < da; \<And>x'. \<lbrakk>x' \<in> T; dist ?x2 x' < da\<rbrakk> \<Longrightarrow> (\<forall>y\<in>{z \<in> S. f z = ?x2}. \<exists>y'. y' \<in> {z \<in> S. f z = x'} \<and> dist y y' < ?e2) \<and> (\<forall>y'\<in>{z \<in> S. f z = x'}. \<exists>y. y \<in> {z \<in> S. f z = ?x2} \<and> dist y' y < ?e2)\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
show "bounded {z \<in> S. f z = y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded {z \<in> S. f z = y}
[PROOF STEP]
by (metis (no_types, lifting) compact_imp_bounded [OF \<open>compact S\<close>] bounded_subset mem_Collect_eq subsetI)
[PROOF STATE]
proof (state)
this:
bounded {z \<in> S. f z = y}

goal (5 subgoals):
 1. \<And>x. \<lbrakk>\<And>\<delta>. \<lbrakk>0 < \<delta>; \<And>x'. \<lbrakk>x' \<in> T; dist y x' < \<delta>\<rbrakk> \<Longrightarrow> (\<forall>v\<in>{z \<in> S. f z = y}. \<exists>v'. v' \<in> {z \<in> S. f z = x'} \<and> dist v v' < d) \<and> (\<forall>v'\<in>{z \<in> S. f z = x'}. \<exists>v. v \<in> {z \<in> S. f z = y} \<and> dist v' v < d)\<rbrakk> \<Longrightarrow> thesis; x \<in> T\<rbrakk> \<Longrightarrow> {z \<in> S. f z = x} \<subseteq> S
 2. (\<And>\<delta>. \<lbrakk>0 < \<delta>; \<And>x'. \<lbrakk>x' \<in> T; dist y x' < \<delta>\<rbrakk> \<Longrightarrow> (\<forall>v\<in>{z \<in> S. f z = y}. \<exists>v'. v' \<in> {z \<in> S. f z = x'} \<and> dist v v' < d) \<and> (\<forall>v'\<in>{z \<in> S. f z = x'}. \<exists>v. v \<in> {z \<in> S. f z = y} \<and> dist v' v < d)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> y \<in> T
 3. (\<And>\<delta>. \<lbrakk>0 < \<delta>; \<And>x'. \<lbrakk>x' \<in> T; dist y x' < \<delta>\<rbrakk> \<Longrightarrow> (\<forall>v\<in>{z \<in> S. f z = y}. \<exists>v'. v' \<in> {z \<in> S. f z = x'} \<and> dist v v' < d) \<and> (\<forall>v'\<in>{z \<in> S. f z = x'}. \<exists>v. v \<in> {z \<in> S. f z = y} \<and> dist v' v < d)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> 0 < ?e2
 4. (\<And>\<delta>. \<lbrakk>0 < \<delta>; \<And>x'. \<lbrakk>x' \<in> T; dist y x' < \<delta>\<rbrakk> \<Longrightarrow> (\<forall>v\<in>{z \<in> S. f z = y}. \<exists>v'. v' \<in> {z \<in> S. f z = x'} \<and> dist v v' < d) \<and> (\<forall>v'\<in>{z \<in> S. f z = x'}. \<exists>v. v \<in> {z \<in> S. f z = y} \<and> dist v' v < d)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> {z \<in> S. f z = y} \<noteq> {}
 5. \<And>da. \<lbrakk>\<And>\<delta>. \<lbrakk>0 < \<delta>; \<And>x'. \<lbrakk>x' \<in> T; dist y x' < \<delta>\<rbrakk> \<Longrightarrow> (\<forall>v\<in>{z \<in> S. f z = y}. \<exists>v'. v' \<in> {z \<in> S. f z = x'} \<and> dist v v' < d) \<and> (\<forall>v'\<in>{z \<in> S. f z = x'}. \<exists>v. v \<in> {z \<in> S. f z = y} \<and> dist v' v < d)\<rbrakk> \<Longrightarrow> thesis; 0 < da; \<And>x'. \<lbrakk>x' \<in> T; dist y x' < da\<rbrakk> \<Longrightarrow> (\<forall>y\<in>{z \<in> S. f z = y}. \<exists>y'. y' \<in> {z \<in> S. f z = x'} \<and> dist y y' < ?e2) \<and> (\<forall>y'\<in>{z \<in> S. f z = x'}. \<exists>ya. ya \<in> {z \<in> S. f z = y} \<and> dist y' ya < ?e2)\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
qed (use \<open>y \<in> T\<close> \<open>0 < d\<close> fk kTS in \<open>force+\<close>)
[PROOF STATE]
proof (state)
this:
0 < \<delta>
\<lbrakk>?x' \<in> T; dist y ?x' < \<delta>\<rbrakk> \<Longrightarrow> (\<forall>v\<in>{z \<in> S. f z = y}. \<exists>v'. v' \<in> {z \<in> S. f z = ?x'} \<and> dist v v' < d) \<and> (\<forall>v'\<in>{z \<in> S. f z = ?x'}. \<exists>v. v \<in> {z \<in> S. f z = y} \<and> dist v' v < d)

goal (1 subgoal):
 1. \<And>x e. \<lbrakk>x \<in> T; 0 < e\<rbrakk> \<Longrightarrow> \<exists>d>0. \<forall>x'\<in>T. dist x' x < d \<longrightarrow> dist (h (k x')) (h (k x)) < e
[PROOF STEP]
have "dist (h (k y')) (h (k y)) < e" if "y' \<in> T" "dist y y' < \<delta>" for y'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (h (k y')) (h (k y)) < e
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dist (h (k y')) (h (k y)) < e
[PROOF STEP]
have k1: "k y \<in> S" "f (k y) = y" and k2: "k y' \<in> S" "f (k y') = y'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (k y \<in> S &&& f (k y) = y) &&& k y' \<in> S &&& f (k y') = y'
[PROOF STEP]
by (auto simp: \<open>y \<in> T\<close> \<open>y' \<in> T\<close> kTS fk)
[PROOF STATE]
proof (state)
this:
k y \<in> S
f (k y) = y
k y' \<in> S
f (k y') = y'

goal (1 subgoal):
 1. dist (h (k y')) (h (k y)) < e
[PROOF STEP]
have 1: "\<And>v. \<lbrakk>v \<in> S; f v = y\<rbrakk> \<Longrightarrow> \<exists>v'. v' \<in> {z \<in> S. f z = y'} \<and> dist v v' < d"
       and 2: "\<And>v'. \<lbrakk>v' \<in> S; f v' = y'\<rbrakk> \<Longrightarrow> \<exists>v. v \<in> {z \<in> S. f z = y} \<and> dist v' v < d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>v. \<lbrakk>v \<in> S; f v = y\<rbrakk> \<Longrightarrow> \<exists>v'. v' \<in> {z \<in> S. f z = y'} \<and> dist v v' < d) &&& (\<And>v'. \<lbrakk>v' \<in> S; f v' = y'\<rbrakk> \<Longrightarrow> \<exists>v. v \<in> {z \<in> S. f z = y} \<and> dist v' v < d)
[PROOF STEP]
using \<delta> [OF that]
[PROOF STATE]
proof (prove)
using this:
(\<forall>v\<in>{z \<in> S. f z = y}. \<exists>v'. v' \<in> {z \<in> S. f z = y'} \<and> dist v v' < d) \<and> (\<forall>v'\<in>{z \<in> S. f z = y'}. \<exists>v. v \<in> {z \<in> S. f z = y} \<and> dist v' v < d)

goal (1 subgoal):
 1. (\<And>v. \<lbrakk>v \<in> S; f v = y\<rbrakk> \<Longrightarrow> \<exists>v'. v' \<in> {z \<in> S. f z = y'} \<and> dist v v' < d) &&& (\<And>v'. \<lbrakk>v' \<in> S; f v' = y'\<rbrakk> \<Longrightarrow> \<exists>v. v \<in> {z \<in> S. f z = y} \<and> dist v' v < d)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<lbrakk>?v \<in> S; f ?v = y\<rbrakk> \<Longrightarrow> \<exists>v'. v' \<in> {z \<in> S. f z = y'} \<and> dist ?v v' < d
\<lbrakk>?v' \<in> S; f ?v' = y'\<rbrakk> \<Longrightarrow> \<exists>v. v \<in> {z \<in> S. f z = y} \<and> dist ?v' v < d

goal (1 subgoal):
 1. dist (h (k y')) (h (k y)) < e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?v \<in> S; f ?v = y\<rbrakk> \<Longrightarrow> \<exists>v'. v' \<in> {z \<in> S. f z = y'} \<and> dist ?v v' < d
\<lbrakk>?v' \<in> S; f ?v' = y'\<rbrakk> \<Longrightarrow> \<exists>v. v \<in> {z \<in> S. f z = y} \<and> dist ?v' v < d
[PROOF STEP]
obtain w' w where "w' \<in> S" "f w' = y'" "dist (k y) w' < d"
        and "w \<in> S" "f w = y" "dist (k y') w < d"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?v \<in> S; f ?v = y\<rbrakk> \<Longrightarrow> \<exists>v'. v' \<in> {z \<in> S. f z = y'} \<and> dist ?v v' < d
\<lbrakk>?v' \<in> S; f ?v' = y'\<rbrakk> \<Longrightarrow> \<exists>v. v \<in> {z \<in> S. f z = y} \<and> dist ?v' v < d

goal (1 subgoal):
 1. (\<And>w' w. \<lbrakk>w' \<in> S; f w' = y'; dist (k y) w' < d; w \<in> S; f w = y; dist (k y') w < d\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using 1 [OF k1] 2 [OF k2]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?v \<in> S; f ?v = y\<rbrakk> \<Longrightarrow> \<exists>v'. v' \<in> {z \<in> S. f z = y'} \<and> dist ?v v' < d
\<lbrakk>?v' \<in> S; f ?v' = y'\<rbrakk> \<Longrightarrow> \<exists>v. v \<in> {z \<in> S. f z = y} \<and> dist ?v' v < d
\<exists>v'. v' \<in> {z \<in> S. f z = y'} \<and> dist (k y) v' < d
\<exists>v. v \<in> {z \<in> S. f z = y} \<and> dist (k y') v < d

goal (1 subgoal):
 1. (\<And>w' w. \<lbrakk>w' \<in> S; f w' = y'; dist (k y) w' < d; w \<in> S; f w = y; dist (k y') w < d\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
w' \<in> S
f w' = y'
dist (k y) w' < d
w \<in> S
f w = y
dist (k y') w < d

goal (1 subgoal):
 1. dist (h (k y')) (h (k y)) < e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
w' \<in> S
f w' = y'
dist (k y) w' < d
w \<in> S
f w = y
dist (k y') w < d
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
w' \<in> S
f w' = y'
dist (k y) w' < d
w \<in> S
f w = y
dist (k y') w < d

goal (1 subgoal):
 1. dist (h (k y')) (h (k y)) < e
[PROOF STEP]
using d [of w "k y'"] d [of w' "k y"] k1 k2 \<open>y' \<in> T\<close>  \<open>y \<in> T\<close> hle
[PROOF STATE]
proof (prove)
using this:
w' \<in> S
f w' = y'
dist (k y) w' < d
w \<in> S
f w = y
dist (k y') w < d
\<lbrakk>w \<in> S; k y' \<in> S; dist (k y') w < d\<rbrakk> \<Longrightarrow> dist (h (k y')) (h w) < e
\<lbrakk>w' \<in> S; k y \<in> S; dist (k y) w' < d\<rbrakk> \<Longrightarrow> dist (h (k y)) (h w') < e
k y \<in> S
f (k y) = y
k y' \<in> S
f (k y') = y'
y' \<in> T
y \<in> T
\<lbrakk>?y \<in> T; ?x' \<in> S; f ?x' = ?y\<rbrakk> \<Longrightarrow> h (k ?y) \<le> h ?x'

goal (1 subgoal):
 1. dist (h (k y')) (h (k y)) < e
[PROOF STEP]
by (fastforce simp: dist_norm abs_diff_less_iff algebra_simps)
[PROOF STATE]
proof (state)
this:
dist (h (k y')) (h (k y)) < e

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?y' \<in> T; dist y ?y' < \<delta>\<rbrakk> \<Longrightarrow> dist (h (k ?y')) (h (k y)) < e

goal (1 subgoal):
 1. \<And>x e. \<lbrakk>x \<in> T; 0 < e\<rbrakk> \<Longrightarrow> \<exists>d>0. \<forall>x'\<in>T. dist x' x < d \<longrightarrow> dist (h (k x')) (h (k x)) < e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?y' \<in> T; dist y ?y' < \<delta>\<rbrakk> \<Longrightarrow> dist (h (k ?y')) (h (k y)) < e
[PROOF STEP]
show "\<exists>d>0. \<forall>x'\<in>T. dist x' y < d \<longrightarrow> dist (h (k x')) (h (k y)) < e"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?y' \<in> T; dist y ?y' < \<delta>\<rbrakk> \<Longrightarrow> dist (h (k ?y')) (h (k y)) < e

goal (1 subgoal):
 1. \<exists>d>0. \<forall>x'\<in>T. dist x' y < d \<longrightarrow> dist (h (k x')) (h (k y)) < e
[PROOF STEP]
using  \<open>0 < \<delta>\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?y' \<in> T; dist y ?y' < \<delta>\<rbrakk> \<Longrightarrow> dist (h (k ?y')) (h (k y)) < e
0 < \<delta>

goal (1 subgoal):
 1. \<exists>d>0. \<forall>x'\<in>T. dist x' y < d \<longrightarrow> dist (h (k x')) (h (k y)) < e
[PROOF STEP]
by (auto simp: dist_commute)
[PROOF STATE]
proof (state)
this:
\<exists>d>0. \<forall>x'\<in>T. dist x' y < d \<longrightarrow> dist (h (k x')) (h (k y)) < e

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
continuous_on T (h \<circ> k)

goal (1 subgoal):
 1. \<And>f. \<lbrakk>continuous_on T f; f ` T \<subseteq> sphere 0 1\<rbrakk> \<Longrightarrow> \<exists>g. continuous_on T g \<and> (\<forall>x\<in>T. f x = exp (\<i> * complex_of_real (g x)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
continuous_on T (h \<circ> k)
[PROOF STEP]
show "\<exists>h. continuous_on T h \<and> (\<forall>x\<in>T. g x = exp (\<i> * complex_of_real (h x)))"
[PROOF STATE]
proof (prove)
using this:
continuous_on T (h \<circ> k)

goal (1 subgoal):
 1. \<exists>h. continuous_on T h \<and> (\<forall>x\<in>T. g x = exp (\<i> * complex_of_real (h x)))
[PROOF STEP]
using fk gfh kTS
[PROOF STATE]
proof (prove)
using this:
continuous_on T (h \<circ> k)
?y \<in> T \<Longrightarrow> f (k ?y) = ?y
?x \<in> S \<Longrightarrow> (g \<circ> f) ?x = exp (\<i> * complex_of_real (h ?x))
?y \<in> T \<Longrightarrow> k ?y \<in> S

goal (1 subgoal):
 1. \<exists>h. continuous_on T h \<and> (\<forall>x\<in>T. g x = exp (\<i> * complex_of_real (h x)))
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<exists>h. continuous_on T h \<and> (\<forall>x\<in>T. g x = exp (\<i> * complex_of_real (h x)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma P_ring_rdistr:
  assumes "carrier_coeff a"
  assumes "carrier_coeff b"
  assumes "carrier_coeff c"
  shows "a \<Otimes>\<^sub>p (b \<Oplus> c) = (a \<Otimes>\<^sub>p b)\<Oplus> (a \<Otimes>\<^sub>p c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<Otimes>\<^sub>p (b \<Oplus> c) = a \<Otimes>\<^sub>p b \<Oplus> (a \<Otimes>\<^sub>p c)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (a \<Otimes>\<^sub>p (b \<Oplus> c)) x = (a \<Otimes>\<^sub>p b \<Oplus> (a \<Otimes>\<^sub>p c)) x
[PROOF STEP]
fix m
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (a \<Otimes>\<^sub>p (b \<Oplus> c)) x = (a \<Otimes>\<^sub>p b \<Oplus> (a \<Otimes>\<^sub>p c)) x
[PROOF STEP]
show "(a \<Otimes>\<^sub>p (b \<Oplus> c)) m = (a \<Otimes>\<^sub>p b \<Oplus> (a \<Otimes>\<^sub>p c)) m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<Otimes>\<^sub>p (b \<Oplus> c)) m = (a \<Otimes>\<^sub>p b \<Oplus> (a \<Otimes>\<^sub>p c)) m
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (a \<Otimes>\<^sub>p (b \<Oplus> c)) m = (a \<Otimes>\<^sub>p b \<Oplus> (a \<Otimes>\<^sub>p c)) m
[PROOF STEP]
have RHS: "(a \<Otimes>\<^sub>p b \<Oplus> (a \<Otimes>\<^sub>p c)) m =
                  (\<Oplus>x\<in>mset_factors m. a x \<otimes> b (m - x)) \<oplus> (\<Oplus>x\<in>mset_factors m. a x \<otimes> c (m - x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<Otimes>\<^sub>p b \<Oplus> (a \<Otimes>\<^sub>p c)) m = (\<Oplus>x\<in>mset_factors m. a x \<otimes> b (m - x)) \<oplus> (\<Oplus>x\<in>mset_factors m. a x \<otimes> c (m - x))
[PROOF STEP]
unfolding indexed_padd_def P_ring_mult_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Oplus>x\<in>mset_factors m. a x \<otimes> b (m - x)) \<oplus> (\<Oplus>x\<in>mset_factors m. a x \<otimes> c (m - x)) = (\<Oplus>x\<in>mset_factors m. a x \<otimes> b (m - x)) \<oplus> (\<Oplus>x\<in>mset_factors m. a x \<otimes> c (m - x))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(a \<Otimes>\<^sub>p b \<Oplus> (a \<Otimes>\<^sub>p c)) m = (\<Oplus>x\<in>mset_factors m. a x \<otimes> b (m - x)) \<oplus> (\<Oplus>x\<in>mset_factors m. a x \<otimes> c (m - x))

goal (1 subgoal):
 1. (a \<Otimes>\<^sub>p (b \<Oplus> c)) m = (a \<Otimes>\<^sub>p b \<Oplus> (a \<Otimes>\<^sub>p c)) m
[PROOF STEP]
have LHS: "(a \<Otimes>\<^sub>p (b \<Oplus> c)) m=
                  ( \<Oplus>x\<in>mset_factors m. a x \<otimes> b (m - x) \<oplus> a x \<otimes> c (m - x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<Otimes>\<^sub>p (b \<Oplus> c)) m = (\<Oplus>x\<in>mset_factors m. a x \<otimes> b (m - x) \<oplus> a x \<otimes> c (m - x))
[PROOF STEP]
unfolding indexed_padd_def  P_ring_mult_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Oplus>x\<in>mset_factors m. a x \<otimes> (b (m - x) \<oplus> c (m - x))) = (\<Oplus>x\<in>mset_factors m. a x \<otimes> b (m - x) \<oplus> a x \<otimes> c (m - x))
[PROOF STEP]
by (meson assms(1) assms(2) assms(3) local.ring_axioms r_distr ring.carrier_coeff_def)
[PROOF STATE]
proof (state)
this:
(a \<Otimes>\<^sub>p (b \<Oplus> c)) m = (\<Oplus>x\<in>mset_factors m. a x \<otimes> b (m - x) \<oplus> a x \<otimes> c (m - x))

goal (1 subgoal):
 1. (a \<Otimes>\<^sub>p (b \<Oplus> c)) m = (a \<Otimes>\<^sub>p b \<Oplus> (a \<Otimes>\<^sub>p c)) m
[PROOF STEP]
have RHS': "(a \<Otimes>\<^sub>p b \<Oplus> (a \<Otimes>\<^sub>p c)) m =
                  (\<Oplus>x\<in>mset_factors m. a x \<otimes> b (m - x) \<oplus> a x \<otimes> c (m - x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<Otimes>\<^sub>p b \<Oplus> (a \<Otimes>\<^sub>p c)) m = (\<Oplus>x\<in>mset_factors m. a x \<otimes> b (m - x) \<oplus> a x \<otimes> c (m - x))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (a \<Otimes>\<^sub>p b \<Oplus> (a \<Otimes>\<^sub>p c)) m = (\<Oplus>x\<in>mset_factors m. a x \<otimes> b (m - x) \<oplus> a x \<otimes> c (m - x))
[PROOF STEP]
have 0: "(\<lambda>x. a x \<otimes> b (m - x)) \<in> mset_factors m \<rightarrow> carrier R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. a x \<otimes> b (m - x)) \<in> mset_factors m \<rightarrow> carrier R
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> mset_factors m \<Longrightarrow> a x \<otimes> b (m - x) \<in> carrier R
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> mset_factors m \<Longrightarrow> a x \<otimes> b (m - x) \<in> carrier R
[PROOF STEP]
assume "x \<in> mset_factors m"
[PROOF STATE]
proof (state)
this:
x \<in> mset_factors m

goal (1 subgoal):
 1. \<And>x. x \<in> mset_factors m \<Longrightarrow> a x \<otimes> b (m - x) \<in> carrier R
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> mset_factors m
[PROOF STEP]
show "a x \<otimes> b (m - x) \<in> carrier R"
[PROOF STATE]
proof (prove)
using this:
x \<in> mset_factors m

goal (1 subgoal):
 1. a x \<otimes> b (m - x) \<in> carrier R
[PROOF STEP]
using assms carrier_coeffE
[PROOF STATE]
proof (prove)
using this:
x \<in> mset_factors m
carrier_coeff a
carrier_coeff b
carrier_coeff c
carrier_coeff ?P \<Longrightarrow> ?P ?m \<in> carrier R

goal (1 subgoal):
 1. a x \<otimes> b (m - x) \<in> carrier R
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
a x \<otimes> b (m - x) \<in> carrier R

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>x. a x \<otimes> b (m - x)) \<in> mset_factors m \<rightarrow> carrier R

goal (1 subgoal):
 1. (a \<Otimes>\<^sub>p b \<Oplus> (a \<Otimes>\<^sub>p c)) m = (\<Oplus>x\<in>mset_factors m. a x \<otimes> b (m - x) \<oplus> a x \<otimes> c (m - x))
[PROOF STEP]
have 1: "(\<lambda>x. a x \<otimes> c (m - x)) \<in> mset_factors m \<rightarrow> carrier R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. a x \<otimes> c (m - x)) \<in> mset_factors m \<rightarrow> carrier R
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> mset_factors m \<Longrightarrow> a x \<otimes> c (m - x) \<in> carrier R
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> mset_factors m \<Longrightarrow> a x \<otimes> c (m - x) \<in> carrier R
[PROOF STEP]
assume "x \<in> mset_factors m"
[PROOF STATE]
proof (state)
this:
x \<in> mset_factors m

goal (1 subgoal):
 1. \<And>x. x \<in> mset_factors m \<Longrightarrow> a x \<otimes> c (m - x) \<in> carrier R
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> mset_factors m
[PROOF STEP]
show "a x \<otimes> c (m - x) \<in> carrier R"
[PROOF STATE]
proof (prove)
using this:
x \<in> mset_factors m

goal (1 subgoal):
 1. a x \<otimes> c (m - x) \<in> carrier R
[PROOF STEP]
using assms carrier_coeffE
[PROOF STATE]
proof (prove)
using this:
x \<in> mset_factors m
carrier_coeff a
carrier_coeff b
carrier_coeff c
carrier_coeff ?P \<Longrightarrow> ?P ?m \<in> carrier R

goal (1 subgoal):
 1. a x \<otimes> c (m - x) \<in> carrier R
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
a x \<otimes> c (m - x) \<in> carrier R

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>x. a x \<otimes> c (m - x)) \<in> mset_factors m \<rightarrow> carrier R

goal (1 subgoal):
 1. (a \<Otimes>\<^sub>p b \<Oplus> (a \<Otimes>\<^sub>p c)) m = (\<Oplus>x\<in>mset_factors m. a x \<otimes> b (m - x) \<oplus> a x \<otimes> c (m - x))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. a x \<otimes> c (m - x)) \<in> mset_factors m \<rightarrow> carrier R
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. a x \<otimes> c (m - x)) \<in> mset_factors m \<rightarrow> carrier R

goal (1 subgoal):
 1. (a \<Otimes>\<^sub>p b \<Oplus> (a \<Otimes>\<^sub>p c)) m = (\<Oplus>x\<in>mset_factors m. a x \<otimes> b (m - x) \<oplus> a x \<otimes> c (m - x))
[PROOF STEP]
using 0 1 RHS assms finsum_addf[of "\<lambda>x. a x \<otimes> b (m - x)" "mset_factors m"
                                                    "\<lambda>x. a x \<otimes> c (m - x)"]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. a x \<otimes> c (m - x)) \<in> mset_factors m \<rightarrow> carrier R
(\<lambda>x. a x \<otimes> b (m - x)) \<in> mset_factors m \<rightarrow> carrier R
(\<lambda>x. a x \<otimes> c (m - x)) \<in> mset_factors m \<rightarrow> carrier R
(a \<Otimes>\<^sub>p b \<Oplus> (a \<Otimes>\<^sub>p c)) m = (\<Oplus>x\<in>mset_factors m. a x \<otimes> b (m - x)) \<oplus> (\<Oplus>x\<in>mset_factors m. a x \<otimes> c (m - x))
carrier_coeff a
carrier_coeff b
carrier_coeff c
\<lbrakk>(\<lambda>x. a x \<otimes> b (m - x)) \<in> mset_factors m \<rightarrow> carrier R; (\<lambda>x. a x \<otimes> c (m - x)) \<in> mset_factors m \<rightarrow> carrier R\<rbrakk> \<Longrightarrow> (\<Oplus>x\<in>mset_factors m. a x \<otimes> b (m - x) \<oplus> a x \<otimes> c (m - x)) = (\<Oplus>x\<in>mset_factors m. a x \<otimes> b (m - x)) \<oplus> (\<Oplus>x\<in>mset_factors m. a x \<otimes> c (m - x))

goal (1 subgoal):
 1. (a \<Otimes>\<^sub>p b \<Oplus> (a \<Otimes>\<^sub>p c)) m = (\<Oplus>x\<in>mset_factors m. a x \<otimes> b (m - x) \<oplus> a x \<otimes> c (m - x))
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
(a \<Otimes>\<^sub>p b \<Oplus> (a \<Otimes>\<^sub>p c)) m = (\<Oplus>x\<in>mset_factors m. a x \<otimes> b (m - x) \<oplus> a x \<otimes> c (m - x))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(a \<Otimes>\<^sub>p b \<Oplus> (a \<Otimes>\<^sub>p c)) m = (\<Oplus>x\<in>mset_factors m. a x \<otimes> b (m - x) \<oplus> a x \<otimes> c (m - x))

goal (1 subgoal):
 1. (a \<Otimes>\<^sub>p (b \<Oplus> c)) m = (a \<Otimes>\<^sub>p b \<Oplus> (a \<Otimes>\<^sub>p c)) m
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<Otimes>\<^sub>p (b \<Oplus> c)) m = (a \<Otimes>\<^sub>p b \<Oplus> (a \<Otimes>\<^sub>p c)) m
[PROOF STEP]
using LHS RHS'
[PROOF STATE]
proof (prove)
using this:
(a \<Otimes>\<^sub>p (b \<Oplus> c)) m = (\<Oplus>x\<in>mset_factors m. a x \<otimes> b (m - x) \<oplus> a x \<otimes> c (m - x))
(a \<Otimes>\<^sub>p b \<Oplus> (a \<Otimes>\<^sub>p c)) m = (\<Oplus>x\<in>mset_factors m. a x \<otimes> b (m - x) \<oplus> a x \<otimes> c (m - x))

goal (1 subgoal):
 1. (a \<Otimes>\<^sub>p (b \<Oplus> c)) m = (a \<Otimes>\<^sub>p b \<Oplus> (a \<Otimes>\<^sub>p c)) m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(a \<Otimes>\<^sub>p (b \<Oplus> c)) m = (a \<Otimes>\<^sub>p b \<Oplus> (a \<Otimes>\<^sub>p c)) m

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(a \<Otimes>\<^sub>p (b \<Oplus> c)) m = (a \<Otimes>\<^sub>p b \<Oplus> (a \<Otimes>\<^sub>p c)) m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma moebius_pt_invert:
  assumes "moebius_pt M z1 = z2"
  shows "moebius_pt (moebius_inv M) z2 = z1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius_pt (moebius_inv M) z2 = z1
[PROOF STEP]
using assms[symmetric]
[PROOF STATE]
proof (prove)
using this:
z2 = moebius_pt M z1

goal (1 subgoal):
 1. moebius_pt (moebius_inv M) z2 = z1
[PROOF STEP]
by simp


[STATEMENT]
lemma has_prod_mult_nz: "\<lbrakk>f has_prod a; g has_prod b; a \<noteq> 0; b \<noteq> 0\<rbrakk> \<Longrightarrow> (\<lambda>n. f n * g n) has_prod (a * b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f has_prod a; g has_prod b; a \<noteq> (0::'a); b \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> (\<lambda>n. f n * g n) has_prod (a * b)
[PROOF STEP]
by (simp add: raw_has_prod_mult has_prod_def)


[STATEMENT]
lemma norm_lt_square: "norm x < a \<longleftrightarrow> 0 < a \<and> inner x x < a\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (norm x < a) = (0 < a \<and> inner x x < a\<^sup>2)
[PROOF STEP]
by (metis not_le norm_ge_square)


[STATEMENT]
lemma countable_atoms: "countable {x. measure M {x} > 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable {x. 0 < Sigma_Algebra.measure M {x}}
[PROOF STEP]
using countable_support
[PROOF STATE]
proof (prove)
using this:
countable {x. Sigma_Algebra.measure M {x} \<noteq> 0}

goal (1 subgoal):
 1. countable {x. 0 < Sigma_Algebra.measure M {x}}
[PROOF STEP]
unfolding zero_less_measure_iff
[PROOF STATE]
proof (prove)
using this:
countable {x. Sigma_Algebra.measure M {x} \<noteq> 0}

goal (1 subgoal):
 1. countable {x. Sigma_Algebra.measure M {x} \<noteq> 0}
[PROOF STEP]
.


[STATEMENT]
lemma existential_lookup_sem:
  assumes "\<And>i. i \<in> set_fml fml \<Longrightarrow> i < length qs"
  assumes "set signs = consistent_sign_vectors qs UNIV"
  shows "(\<exists>x::real. lookup_sem fml (map (\<lambda>p. rpoly p x) qs)) \<longleftrightarrow>
    find (lookup_sem fml) signs \<noteq> None"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x. lookup_sem fml (map (\<lambda>p. rpoly p x) qs)) = (find (lookup_sem fml) signs \<noteq> None)
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
set signs = consistent_sign_vectors qs UNIV

goal (1 subgoal):
 1. (\<exists>x. lookup_sem fml (map (\<lambda>p. rpoly p x) qs)) = (find (lookup_sem fml) signs \<noteq> None)
[PROOF STEP]
unfolding consistent_sign_vectors_def find_None_iff
[PROOF STATE]
proof (prove)
using this:
set signs = range (sign_vec qs)

goal (1 subgoal):
 1. (\<exists>x. lookup_sem fml (map (\<lambda>p. rpoly p x) qs)) = (\<not> (\<nexists>x. x \<in> set signs \<and> lookup_sem fml x))
[PROOF STEP]
by (simp add: assms(1) sign_vec_semantics)