[STATEMENT]
lemma from_list_correct:
  assumes "valid_wgraph_repr l"
  shows
    "invar (from_list l)"
    "nodes (\<alpha>g (from_list l)) = fst`fst`set l \<union> snd`fst`set l"
    "edges (\<alpha>g (from_list l)) = (fst`set l) \<union> (fst`set l)\<inverse>"
    "((u,v),d)\<in>set l \<Longrightarrow> \<alpha>w (from_list l) {u,v} = d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (invar (from_list l) &&& nodes (\<alpha>g (from_list l)) = fst ` fst ` set l \<union> snd ` fst ` set l) &&& edges (\<alpha>g (from_list l)) = fst ` set l \<union> (fst ` set l)\<inverse> &&& (((u, v), d) \<in> set l \<Longrightarrow> \<alpha>w (from_list l) {u, v} = d)
[PROOF STEP]
apply (simp_all add: from_list_refine[OF assms])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. nodes (graph_from_list (map fst l)) = fst ` fst ` set l \<union> snd ` fst ` set l
 2. edges (graph_from_list (map fst l)) = fst ` set l \<union> (fst ` set l)\<inverse>
 3. ((u, v), d) \<in> set l \<Longrightarrow> weight_from_list l {u, v} = d
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
valid_wgraph_repr l

goal (3 subgoals):
 1. nodes (graph_from_list (map fst l)) = fst ` fst ` set l \<union> snd ` fst ` set l
 2. edges (graph_from_list (map fst l)) = fst ` set l \<union> (fst ` set l)\<inverse>
 3. ((u, v), d) \<in> set l \<Longrightarrow> weight_from_list l {u, v} = d
[PROOF STEP]
unfolding valid_wgraph_repr_def
[PROOF STATE]
proof (prove)
using this:
valid_graph_repr (map fst l) \<and> valid_weight_repr l

goal (3 subgoals):
 1. nodes (graph_from_list (map fst l)) = fst ` fst ` set l \<union> snd ` fst ` set l
 2. edges (graph_from_list (map fst l)) = fst ` set l \<union> (fst ` set l)\<inverse>
 3. ((u, v), d) \<in> set l \<Longrightarrow> weight_from_list l {u, v} = d
[PROOF STEP]
apply (simp_all add:
      edges_of_graph_from_list nodes_of_graph_from_list weight_from_list_correct)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma absolutely_integrable_approximate_continuous:
  fixes f :: "real \<Rightarrow> real"
  assumes f: "f absolutely_integrable_on S" and S: "S \<in> lmeasurable" and "0 < e"
  obtains g where "continuous_on UNIV g" "g absolutely_integrable_on S" "integral\<^sup>L (lebesgue_on S) (\<lambda>x. \<bar>f x - g x\<bar>) < e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>g. \<lbrakk>continuous_on UNIV g; g absolutely_integrable_on S; LINT x|lebesgue_on S. \<bar>f x - g x\<bar> < e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>g. \<lbrakk>continuous_on UNIV g; g absolutely_integrable_on S; LINT x|lebesgue_on S. \<bar>f x - g x\<bar> < e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
obtain g where "continuous_on UNIV g" "g \<in> lspace (lebesgue_on S) 1"
              and lnorm: "lnorm (lebesgue_on S) 1 (f - g) < e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>g. \<lbrakk>continuous_on UNIV g; g \<in> lspace (lebesgue_on S) 1; lnorm (lebesgue_on S) 1 (f - g) < e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof (rule lspace_approximate_continuous)
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. (\<And>g. \<lbrakk>continuous_on UNIV g; g \<in> lspace (lebesgue_on S) 1; lnorm (lebesgue_on S) 1 (f - g) < e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> ?f2 \<in> lspace (lebesgue_on ?S2) (ennreal ?p2)
 2. (\<And>g. \<lbrakk>continuous_on UNIV g; g \<in> lspace (lebesgue_on S) 1; lnorm (lebesgue_on S) 1 (f - g) < e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> ?S2 \<in> lmeasurable
 3. (\<And>g. \<lbrakk>continuous_on UNIV g; g \<in> lspace (lebesgue_on S) 1; lnorm (lebesgue_on S) 1 (f - g) < e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> 1 \<le> ?p2
 4. (\<And>g. \<lbrakk>continuous_on UNIV g; g \<in> lspace (lebesgue_on S) 1; lnorm (lebesgue_on S) 1 (f - g) < e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> 0 < ?e2
 5. \<And>g. \<lbrakk>\<And>g. \<lbrakk>continuous_on UNIV g; g \<in> lspace (lebesgue_on S) 1; lnorm (lebesgue_on S) 1 (f - g) < e\<rbrakk> \<Longrightarrow> thesis; continuous_on UNIV g; g \<in> lspace (lebesgue_on ?S2) (ennreal ?p2); lnorm (lebesgue_on ?S2) ?p2 (?f2 - g) < ?e2\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
show "f \<in> lspace (lebesgue_on S) (ennreal 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> lspace (lebesgue_on S) (ennreal 1)
[PROOF STEP]
by (simp add: S f fmeasurableD lspace_1)
[PROOF STATE]
proof (state)
this:
f \<in> lspace (lebesgue_on S) (ennreal 1)

goal (4 subgoals):
 1. (\<And>g. \<lbrakk>continuous_on UNIV g; g \<in> lspace (lebesgue_on S) 1; lnorm (lebesgue_on S) 1 (f - g) < e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> S \<in> lmeasurable
 2. (\<And>g. \<lbrakk>continuous_on UNIV g; g \<in> lspace (lebesgue_on S) 1; lnorm (lebesgue_on S) 1 (f - g) < e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> 1 \<le> 1
 3. (\<And>g. \<lbrakk>continuous_on UNIV g; g \<in> lspace (lebesgue_on S) 1; lnorm (lebesgue_on S) 1 (f - g) < e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> 0 < ?e2
 4. \<And>g. \<lbrakk>\<And>g. \<lbrakk>continuous_on UNIV g; g \<in> lspace (lebesgue_on S) 1; lnorm (lebesgue_on S) 1 (f - g) < e\<rbrakk> \<Longrightarrow> thesis; continuous_on UNIV g; g \<in> lspace (lebesgue_on S) (ennreal 1); lnorm (lebesgue_on S) 1 (f - g) < ?e2\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
qed (auto simp: assms)
[PROOF STATE]
proof (state)
this:
continuous_on UNIV g
g \<in> lspace (lebesgue_on S) 1
lnorm (lebesgue_on S) 1 (f - g) < e

goal (1 subgoal):
 1. (\<And>g. \<lbrakk>continuous_on UNIV g; g absolutely_integrable_on S; LINT x|lebesgue_on S. \<bar>f x - g x\<bar> < e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
show thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. thesis
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. continuous_on UNIV ?g
 2. ?g absolutely_integrable_on S
 3. LINT x|lebesgue_on S. \<bar>f x - ?g x\<bar> < e
[PROOF STEP]
show "continuous_on UNIV g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on UNIV g
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
continuous_on UNIV g

goal (2 subgoals):
 1. g absolutely_integrable_on S
 2. LINT x|lebesgue_on S. \<bar>f x - g x\<bar> < e
[PROOF STEP]
show "g absolutely_integrable_on S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g absolutely_integrable_on S
[PROOF STEP]
using S \<open>g \<in> lspace (lebesgue_on S) 1\<close> lspace_1
[PROOF STATE]
proof (prove)
using this:
S \<in> lmeasurable
g \<in> lspace (lebesgue_on S) 1
?S \<in> sets lebesgue \<Longrightarrow> (?f \<in> lspace (lebesgue_on ?S) 1) = (?f absolutely_integrable_on ?S)

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

goal (1 subgoal):
 1. LINT x|lebesgue_on S. \<bar>f x - g x\<bar> < e
[PROOF STEP]
have *: "(\<lambda>x. f x - g x) absolutely_integrable_on S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. f x - g x) absolutely_integrable_on S
[PROOF STEP]
by (simp add: \<open>g absolutely_integrable_on S\<close> f)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. f x - g x) absolutely_integrable_on S

goal (1 subgoal):
 1. LINT x|lebesgue_on S. \<bar>f x - g x\<bar> < e
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>x. f x - g x) absolutely_integrable_on S

goal (1 subgoal):
 1. LINT x|lebesgue_on S. \<bar>f x - g x\<bar> < e
[PROOF STEP]
have "integrable (lebesgue_on S) (\<lambda>x. \<bar>f x - g x\<bar>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable (lebesgue_on S) (\<lambda>x. \<bar>f x - g x\<bar>)
[PROOF STEP]
by (simp add: L1_D(2) S * fmeasurableD lspace_1)
[PROOF STATE]
proof (state)
this:
integrable (lebesgue_on S) (\<lambda>x. \<bar>f x - g x\<bar>)

goal (1 subgoal):
 1. LINT x|lebesgue_on S. \<bar>f x - g x\<bar> < e
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. f x - g x) absolutely_integrable_on S
integrable (lebesgue_on S) (\<lambda>x. \<bar>f x - g x\<bar>)
[PROOF STEP]
show "integral\<^sup>L (lebesgue_on S)  (\<lambda>x. \<bar>f x - g x\<bar>) < e"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. f x - g x) absolutely_integrable_on S
integrable (lebesgue_on S) (\<lambda>x. \<bar>f x - g x\<bar>)

goal (1 subgoal):
 1. LINT x|lebesgue_on S. \<bar>f x - g x\<bar> < e
[PROOF STEP]
using lnorm S
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. f x - g x) absolutely_integrable_on S
integrable (lebesgue_on S) (\<lambda>x. \<bar>f x - g x\<bar>)
lnorm (lebesgue_on S) 1 (f - g) < e
S \<in> lmeasurable

goal (1 subgoal):
 1. LINT x|lebesgue_on S. \<bar>f x - g x\<bar> < e
[PROOF STEP]
unfolding lnorm_def absolutely_integrable_on_def
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. f x - g x) integrable_on S \<and> (\<lambda>x. norm (f x - g x)) integrable_on S
integrable (lebesgue_on S) (\<lambda>x. \<bar>f x - g x\<bar>)
(LINT x|lebesgue_on S. \<bar>(f - g) x\<bar> powr 1) powr (1 / 1) < e
S \<in> lmeasurable

goal (1 subgoal):
 1. LINT x|lebesgue_on S. \<bar>f x - g x\<bar> < e
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
LINT x|lebesgue_on S. \<bar>f x - g x\<bar> < e

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma conv_order:
  "x \<le> y \<longleftrightarrow> x\<^sup>T \<le> y\<^sup>T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<le> y) = (x\<^sup>T \<le> y\<^sup>T)
[PROOF STEP]
using conv_isotone
[PROOF STATE]
proof (prove)
using this:
?x \<le> ?y \<Longrightarrow> ?x\<^sup>T \<le> ?y\<^sup>T

goal (1 subgoal):
 1. (x \<le> y) = (x\<^sup>T \<le> y\<^sup>T)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma \<pi>_smallest_prime_beyond:
  "\<pi> (real (smallest_prime_beyond m)) = \<pi> (real (m - 1)) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi> (real (smallest_prime_beyond m)) = \<pi> (real (m - 1)) + 1
[PROOF STEP]
proof (cases m)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. m = 0 \<Longrightarrow> \<pi> (real (smallest_prime_beyond m)) = \<pi> (real (m - 1)) + 1
 2. \<And>nat. m = Suc nat \<Longrightarrow> \<pi> (real (smallest_prime_beyond m)) = \<pi> (real (m - 1)) + 1
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
m = 0

goal (2 subgoals):
 1. m = 0 \<Longrightarrow> \<pi> (real (smallest_prime_beyond m)) = \<pi> (real (m - 1)) + 1
 2. \<And>nat. m = Suc nat \<Longrightarrow> \<pi> (real (smallest_prime_beyond m)) = \<pi> (real (m - 1)) + 1
[PROOF STEP]
have "smallest_prime_beyond 0 = 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. smallest_prime_beyond 0 = 2
[PROOF STEP]
by (rule smallest_prime_beyond_eq) (auto dest: prime_gt_1_nat)
[PROOF STATE]
proof (state)
this:
smallest_prime_beyond 0 = 2

goal (2 subgoals):
 1. m = 0 \<Longrightarrow> \<pi> (real (smallest_prime_beyond m)) = \<pi> (real (m - 1)) + 1
 2. \<And>nat. m = Suc nat \<Longrightarrow> \<pi> (real (smallest_prime_beyond m)) = \<pi> (real (m - 1)) + 1
[PROOF STEP]
with 0
[PROOF STATE]
proof (chain)
picking this:
m = 0
smallest_prime_beyond 0 = 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
m = 0
smallest_prime_beyond 0 = 2

goal (1 subgoal):
 1. \<pi> (real (smallest_prime_beyond m)) = \<pi> (real (m - 1)) + 1
[PROOF STEP]
by (simp add: eval_\<pi>)
[PROOF STATE]
proof (state)
this:
\<pi> (real (smallest_prime_beyond m)) = \<pi> (real (m - 1)) + 1

goal (1 subgoal):
 1. \<And>nat. m = Suc nat \<Longrightarrow> \<pi> (real (smallest_prime_beyond m)) = \<pi> (real (m - 1)) + 1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>nat. m = Suc nat \<Longrightarrow> \<pi> (real (smallest_prime_beyond m)) = \<pi> (real (m - 1)) + 1
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
m = Suc n

goal (1 subgoal):
 1. \<And>nat. m = Suc nat \<Longrightarrow> \<pi> (real (smallest_prime_beyond m)) = \<pi> (real (m - 1)) + 1
[PROOF STEP]
define n' where "n' = smallest_prime_beyond (Suc n)"
[PROOF STATE]
proof (state)
this:
n' = smallest_prime_beyond (Suc n)

goal (1 subgoal):
 1. \<And>nat. m = Suc nat \<Longrightarrow> \<pi> (real (smallest_prime_beyond m)) = \<pi> (real (m - 1)) + 1
[PROOF STEP]
have "n < n'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < n'
[PROOF STEP]
using smallest_prime_beyond_le[of "Suc n"]
[PROOF STATE]
proof (prove)
using this:
Suc n \<le> smallest_prime_beyond (Suc n)

goal (1 subgoal):
 1. n < n'
[PROOF STEP]
unfolding n'_def
[PROOF STATE]
proof (prove)
using this:
Suc n \<le> smallest_prime_beyond (Suc n)

goal (1 subgoal):
 1. n < smallest_prime_beyond (Suc n)
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
n < n'

goal (1 subgoal):
 1. \<And>nat. m = Suc nat \<Longrightarrow> \<pi> (real (smallest_prime_beyond m)) = \<pi> (real (m - 1)) + 1
[PROOF STEP]
have "prime n'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime n'
[PROOF STEP]
by (simp add: n'_def)
[PROOF STATE]
proof (state)
this:
prime n'

goal (1 subgoal):
 1. \<And>nat. m = Suc nat \<Longrightarrow> \<pi> (real (smallest_prime_beyond m)) = \<pi> (real (m - 1)) + 1
[PROOF STEP]
have "n' \<le> p" if "prime p" "p > n" for p
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n' \<le> p
[PROOF STEP]
using that smallest_prime_beyond_smallest[of p "Suc n"]
[PROOF STATE]
proof (prove)
using this:
prime p
n < p
\<lbrakk>prime p; Suc n \<le> p\<rbrakk> \<Longrightarrow> smallest_prime_beyond (Suc n) \<le> p

goal (1 subgoal):
 1. n' \<le> p
[PROOF STEP]
by (auto simp: n'_def)
[PROOF STATE]
proof (state)
this:
\<lbrakk>prime ?p; n < ?p\<rbrakk> \<Longrightarrow> n' \<le> ?p

goal (1 subgoal):
 1. \<And>nat. m = Suc nat \<Longrightarrow> \<pi> (real (smallest_prime_beyond m)) = \<pi> (real (m - 1)) + 1
[PROOF STEP]
note n' = \<open>n < n'\<close> \<open>prime n'\<close> this
[PROOF STATE]
proof (state)
this:
n < n'
prime n'
\<lbrakk>prime ?p; n < ?p\<rbrakk> \<Longrightarrow> n' \<le> ?p

goal (1 subgoal):
 1. \<And>nat. m = Suc nat \<Longrightarrow> \<pi> (real (smallest_prime_beyond m)) = \<pi> (real (m - 1)) + 1
[PROOF STEP]
have "\<pi> (real n') = real (card {p. prime p \<and> p \<le> n'})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi> (real n') = real (card {p. prime p \<and> p \<le> n'})
[PROOF STEP]
by (simp add: \<pi>_def prime_sum_upto_def)
[PROOF STATE]
proof (state)
this:
\<pi> (real n') = real (card {p. prime p \<and> p \<le> n'})

goal (1 subgoal):
 1. \<And>nat. m = Suc nat \<Longrightarrow> \<pi> (real (smallest_prime_beyond m)) = \<pi> (real (m - 1)) + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<pi> (real n') = real (card {p. prime p \<and> p \<le> n'})

goal (1 subgoal):
 1. \<And>nat. m = Suc nat \<Longrightarrow> \<pi> (real (smallest_prime_beyond m)) = \<pi> (real (m - 1)) + 1
[PROOF STEP]
have "Suc n \<le> n'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc n \<le> n'
[PROOF STEP]
unfolding n'_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc n \<le> smallest_prime_beyond (Suc n)
[PROOF STEP]
by (rule smallest_prime_beyond_le)
[PROOF STATE]
proof (state)
this:
Suc n \<le> n'

goal (1 subgoal):
 1. \<And>nat. m = Suc nat \<Longrightarrow> \<pi> (real (smallest_prime_beyond m)) = \<pi> (real (m - 1)) + 1
[PROOF STEP]
hence "{p. prime p \<and> p \<le> n'} = {p. prime p \<and> p \<le> n} \<union> {p. prime p \<and> p \<in> {n<..n'}}"
[PROOF STATE]
proof (prove)
using this:
Suc n \<le> n'

goal (1 subgoal):
 1. {p. prime p \<and> p \<le> n'} = {p. prime p \<and> p \<le> n} \<union> {p. prime p \<and> p \<in> {n<..n'}}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{p. prime p \<and> p \<le> n'} = {p. prime p \<and> p \<le> n} \<union> {p. prime p \<and> p \<in> {n<..n'}}

goal (1 subgoal):
 1. \<And>nat. m = Suc nat \<Longrightarrow> \<pi> (real (smallest_prime_beyond m)) = \<pi> (real (m - 1)) + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{p. prime p \<and> p \<le> n'} = {p. prime p \<and> p \<le> n} \<union> {p. prime p \<and> p \<in> {n<..n'}}

goal (1 subgoal):
 1. \<And>nat. m = Suc nat \<Longrightarrow> \<pi> (real (smallest_prime_beyond m)) = \<pi> (real (m - 1)) + 1
[PROOF STEP]
have "real (card \<dots>) = \<pi> (real n) + real (card {p. prime p \<and> p \<in> {n<..n'}})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (card ({p. prime p \<and> p \<le> n} \<union> {p. prime p \<and> p \<in> {n<..n'}})) = \<pi> (real n) + real (card {p. prime p \<and> p \<in> {n<..n'}})
[PROOF STEP]
by (subst card_Un_disjoint) (auto simp: \<pi>_def prime_sum_upto_def)
[PROOF STATE]
proof (state)
this:
real (card ({p. prime p \<and> p \<le> n} \<union> {p. prime p \<and> p \<in> {n<..n'}})) = \<pi> (real n) + real (card {p. prime p \<and> p \<in> {n<..n'}})

goal (1 subgoal):
 1. \<And>nat. m = Suc nat \<Longrightarrow> \<pi> (real (smallest_prime_beyond m)) = \<pi> (real (m - 1)) + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real (card ({p. prime p \<and> p \<le> n} \<union> {p. prime p \<and> p \<in> {n<..n'}})) = \<pi> (real n) + real (card {p. prime p \<and> p \<in> {n<..n'}})

goal (1 subgoal):
 1. \<And>nat. m = Suc nat \<Longrightarrow> \<pi> (real (smallest_prime_beyond m)) = \<pi> (real (m - 1)) + 1
[PROOF STEP]
have "{p. prime p \<and> p \<in> {n<..n'}} = {n'}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {p. prime p \<and> p \<in> {n<..n'}} = {n'}
[PROOF STEP]
using n'
[PROOF STATE]
proof (prove)
using this:
n < n'
prime n'
\<lbrakk>prime ?p; n < ?p\<rbrakk> \<Longrightarrow> n' \<le> ?p

goal (1 subgoal):
 1. {p. prime p \<and> p \<in> {n<..n'}} = {n'}
[PROOF STEP]
by (auto intro: antisym)
[PROOF STATE]
proof (state)
this:
{p. prime p \<and> p \<in> {n<..n'}} = {n'}

goal (1 subgoal):
 1. \<And>nat. m = Suc nat \<Longrightarrow> \<pi> (real (smallest_prime_beyond m)) = \<pi> (real (m - 1)) + 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<pi> (real n') = \<pi> (real n) + real (card {n'})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<pi> (real n') = \<pi> (real n) + real (card {n'})

goal (1 subgoal):
 1. \<pi> (real (smallest_prime_beyond m)) = \<pi> (real (m - 1)) + 1
[PROOF STEP]
using Suc
[PROOF STATE]
proof (prove)
using this:
\<pi> (real n') = \<pi> (real n) + real (card {n'})
m = Suc n

goal (1 subgoal):
 1. \<pi> (real (smallest_prime_beyond m)) = \<pi> (real (m - 1)) + 1
[PROOF STEP]
by (simp add: n'_def)
[PROOF STATE]
proof (state)
this:
\<pi> (real (smallest_prime_beyond m)) = \<pi> (real (m - 1)) + 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in module) zero_nin_lin_indpt:
  assumes h2: "S\<subseteq>carrier M" and li: "\<not>(lin_dep S)" and nonzero: "carrier R \<noteq> {\<zero>\<^bsub>R\<^esub>}"
  shows "\<zero>\<^bsub>M\<^esub> \<notin> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<zero>\<^bsub>M\<^esub> \<notin> S
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> \<zero>\<^bsub>M\<^esub> \<notin> S \<Longrightarrow> False
[PROOF STEP]
assume a1: "\<not>(\<zero>\<^bsub>M\<^esub> \<notin> S)"
[PROOF STATE]
proof (state)
this:
\<not> \<zero>\<^bsub>M\<^esub> \<notin> S

goal (1 subgoal):
 1. \<not> \<zero>\<^bsub>M\<^esub> \<notin> S \<Longrightarrow> False
[PROOF STEP]
from a1
[PROOF STATE]
proof (chain)
picking this:
\<not> \<zero>\<^bsub>M\<^esub> \<notin> S
[PROOF STEP]
have a2: "\<zero>\<^bsub>M\<^esub> \<in> S"
[PROOF STATE]
proof (prove)
using this:
\<not> \<zero>\<^bsub>M\<^esub> \<notin> S

goal (1 subgoal):
 1. \<zero>\<^bsub>M\<^esub> \<in> S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<zero>\<^bsub>M\<^esub> \<in> S

goal (1 subgoal):
 1. \<not> \<zero>\<^bsub>M\<^esub> \<notin> S \<Longrightarrow> False
[PROOF STEP]
from a2 nonzero
[PROOF STATE]
proof (chain)
picking this:
\<zero>\<^bsub>M\<^esub> \<in> S
carrier R \<noteq> {\<zero>}
[PROOF STEP]
have ld: "lin_dep S"
[PROOF STATE]
proof (prove)
using this:
\<zero>\<^bsub>M\<^esub> \<in> S
carrier R \<noteq> {\<zero>}

goal (1 subgoal):
 1. lin_dep S
[PROOF STEP]
by (rule zero_lin_dep)
[PROOF STATE]
proof (state)
this:
lin_dep S

goal (1 subgoal):
 1. \<not> \<zero>\<^bsub>M\<^esub> \<notin> S \<Longrightarrow> False
[PROOF STEP]
from li ld
[PROOF STATE]
proof (chain)
picking this:
lin_indpt S
lin_dep S
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
lin_indpt S
lin_dep S

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mult_lcm_left: "c * lcm a b = unit_factor c * lcm (c * a) (c * b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c * lcm a b = unit_factor c * lcm (c * a) (c * b)
[PROOF STEP]
by (simp add: lcm_mult_left mult.assoc [symmetric] normalize_mult)


[STATEMENT]
lemma rec_disjointify_is_disjoint:
  assumes "A \<in> rec_disjointify m f"
  assumes "B \<in>  rec_disjointify m f"
  assumes "A \<noteq> B"
  shows "A \<inter> B = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<inter> B = {}
[PROOF STEP]
using  rec_disjointify_as_enum_rec_disjointify_image enum_rec_disjointify_disjoint' assms
[PROOF STATE]
proof (prove)
using this:
rec_disjointify ?m ?f = enum_rec_disjointify ?f ` {..<?m}
?k \<noteq> ?m \<Longrightarrow> enum_rec_disjointify ?f ?m \<inter> enum_rec_disjointify ?f ?k = {}
A \<in> rec_disjointify m f
B \<in> rec_disjointify m f
A \<noteq> B

goal (1 subgoal):
 1. A \<inter> B = {}
[PROOF STEP]
by (smt image_iff)


[STATEMENT]
lemma signed_take_bit_0 [simp]:
  \<open>signed_take_bit 0 a = - (a mod 2)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. signed_take_bit 0 a = - (a mod (2::'a))
[PROOF STEP]
by (simp add: bit_0 signed_take_bit_def odd_iff_mod_2_eq_one)


[STATEMENT]
lemma minimal_basis_red_rtrancl_nonzero:
  assumes "is_minimal_basis B" and "p \<in> B" and "(red (B - {p}))\<^sup>*\<^sup>* p r"
  shows "r \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r \<noteq> 0
[PROOF STEP]
proof (rule nadds_red_rtrancl_nonzero)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>q. q \<in> ?B \<Longrightarrow> \<not> lt q adds\<^sub>t lt ?p
 2. ?p \<noteq> 0
 3. (red ?B)\<^sup>*\<^sup>* ?p r
[PROOF STEP]
fix q
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>q. q \<in> ?B \<Longrightarrow> \<not> lt q adds\<^sub>t lt ?p
 2. ?p \<noteq> 0
 3. (red ?B)\<^sup>*\<^sup>* ?p r
[PROOF STEP]
assume "q \<in> (B - {p})"
[PROOF STATE]
proof (state)
this:
q \<in> B - {p}

goal (3 subgoals):
 1. \<And>q. q \<in> ?B \<Longrightarrow> \<not> lt q adds\<^sub>t lt ?p
 2. ?p \<noteq> 0
 3. (red ?B)\<^sup>*\<^sup>* ?p r
[PROOF STEP]
hence "q \<in> B" and "q \<noteq> p"
[PROOF STATE]
proof (prove)
using this:
q \<in> B - {p}

goal (1 subgoal):
 1. q \<in> B &&& q \<noteq> p
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
q \<in> B
q \<noteq> p

goal (3 subgoals):
 1. \<And>q. q \<in> ?B \<Longrightarrow> \<not> lt q adds\<^sub>t lt ?p
 2. ?p \<noteq> 0
 3. (red ?B)\<^sup>*\<^sup>* ?p r
[PROOF STEP]
show "\<not> lt q adds\<^sub>t lt p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> lt q adds\<^sub>t lt p
[PROOF STEP]
by (rule is_minimal_basisD2, fact+)
[PROOF STATE]
proof (state)
this:
\<not> lt q adds\<^sub>t lt p

goal (2 subgoals):
 1. p \<noteq> 0
 2. (red (B - {p}))\<^sup>*\<^sup>* p r
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. p \<noteq> 0
 2. (red (B - {p}))\<^sup>*\<^sup>* p r
[PROOF STEP]
show "p \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<noteq> 0
[PROOF STEP]
by (rule is_minimal_basisD1, fact+)
[PROOF STATE]
proof (state)
this:
p \<noteq> 0

goal (1 subgoal):
 1. (red (B - {p}))\<^sup>*\<^sup>* p r
[PROOF STEP]
qed fact


[STATEMENT]
lemma measure_spmf_zero_iff: "measure (measure_spmf p) A = 0 \<longleftrightarrow> set_spmf p \<inter> A = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Sigma_Algebra.measure (measure_spmf p) A = 0) = (set_spmf p \<inter> A = {})
[PROOF STEP]
unfolding measure_measure_spmf_conv_measure_pmf
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (measure_pmf.prob p (Some ` A) = 0) = (set_spmf p \<inter> A = {})
[PROOF STEP]
by(simp add: measure_pmf_zero_iff set_pmf_Int_Some)


[STATEMENT]
lemma rel_interior_closure_convex_shrink:
  fixes S :: "_::euclidean_space set"
  assumes "convex S"
    and "c \<in> rel_interior S"
    and "x \<in> closure S"
    and "e > 0"
    and "e \<le> 1"
  shows "x - e *\<^sub>R (x - c) \<in> rel_interior S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x - e *\<^sub>R (x - c) \<in> rel_interior S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x - e *\<^sub>R (x - c) \<in> rel_interior S
[PROOF STEP]
obtain d where "d > 0" and d: "ball c d \<inter> affine hull S \<subseteq> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>d. \<lbrakk>0 < d; ball c d \<inter> affine hull S \<subseteq> S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
c \<in> rel_interior S

goal (1 subgoal):
 1. (\<And>d. \<lbrakk>0 < d; ball c d \<inter> affine hull S \<subseteq> S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding mem_rel_interior_ball
[PROOF STATE]
proof (prove)
using this:
c \<in> S \<and> (\<exists>e>0. ball c e \<inter> affine hull S \<subseteq> S)

goal (1 subgoal):
 1. (\<And>d. \<lbrakk>0 < d; ball c d \<inter> affine hull S \<subseteq> S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < d
ball c d \<inter> affine hull S \<subseteq> S

goal (1 subgoal):
 1. x - e *\<^sub>R (x - c) \<in> rel_interior S
[PROOF STEP]
have "\<exists>y \<in> S. norm (y - x) * (1 - e) < e * d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>y\<in>S. norm (y - x) * (1 - e) < e * d
[PROOF STEP]
proof (cases "x \<in> S")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x \<in> S \<Longrightarrow> \<exists>y\<in>S. norm (y - x) * (1 - e) < e * d
 2. x \<notin> S \<Longrightarrow> \<exists>y\<in>S. norm (y - x) * (1 - e) < e * d
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x \<in> S

goal (2 subgoals):
 1. x \<in> S \<Longrightarrow> \<exists>y\<in>S. norm (y - x) * (1 - e) < e * d
 2. x \<notin> S \<Longrightarrow> \<exists>y\<in>S. norm (y - x) * (1 - e) < e * d
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<in> S

goal (1 subgoal):
 1. \<exists>y\<in>S. norm (y - x) * (1 - e) < e * d
[PROOF STEP]
using \<open>e > 0\<close> \<open>d > 0\<close>
[PROOF STATE]
proof (prove)
using this:
x \<in> S
0 < e
0 < d

goal (1 subgoal):
 1. \<exists>y\<in>S. norm (y - x) * (1 - e) < e * d
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<exists>y\<in>S. norm (y - x) * (1 - e) < e * d

goal (1 subgoal):
 1. x \<notin> S \<Longrightarrow> \<exists>y\<in>S. norm (y - x) * (1 - e) < e * d
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<notin> S \<Longrightarrow> \<exists>y\<in>S. norm (y - x) * (1 - e) < e * d
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
x \<notin> S

goal (1 subgoal):
 1. x \<notin> S \<Longrightarrow> \<exists>y\<in>S. norm (y - x) * (1 - e) < e * d
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<notin> S
[PROOF STEP]
have x: "x islimpt S"
[PROOF STATE]
proof (prove)
using this:
x \<notin> S

goal (1 subgoal):
 1. x islimpt S
[PROOF STEP]
using assms(3)[unfolded closure_def]
[PROOF STATE]
proof (prove)
using this:
x \<notin> S
x \<in> S \<union> {x. x islimpt S}

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

goal (1 subgoal):
 1. x \<notin> S \<Longrightarrow> \<exists>y\<in>S. norm (y - x) * (1 - e) < e * d
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>y\<in>S. norm (y - x) * (1 - e) < e * d
[PROOF STEP]
proof (cases "e = 1")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. e = 1 \<Longrightarrow> \<exists>y\<in>S. norm (y - x) * (1 - e) < e * d
 2. e \<noteq> 1 \<Longrightarrow> \<exists>y\<in>S. norm (y - x) * (1 - e) < e * d
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
e = 1

goal (2 subgoals):
 1. e = 1 \<Longrightarrow> \<exists>y\<in>S. norm (y - x) * (1 - e) < e * d
 2. e \<noteq> 1 \<Longrightarrow> \<exists>y\<in>S. norm (y - x) * (1 - e) < e * d
[PROOF STEP]
obtain y where "y \<in> S" "y \<noteq> x" "dist y x < 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>y. \<lbrakk>y \<in> S; y \<noteq> x; dist y x < 1\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using x[unfolded islimpt_approachable,THEN spec[where x=1]]
[PROOF STATE]
proof (prove)
using this:
0 < 1 \<longrightarrow> (\<exists>x'\<in>S. x' \<noteq> x \<and> dist x' x < 1)

goal (1 subgoal):
 1. (\<And>y. \<lbrakk>y \<in> S; y \<noteq> x; dist y x < 1\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y \<in> S
y \<noteq> x
dist y x < 1

goal (2 subgoals):
 1. e = 1 \<Longrightarrow> \<exists>y\<in>S. norm (y - x) * (1 - e) < e * d
 2. e \<noteq> 1 \<Longrightarrow> \<exists>y\<in>S. norm (y - x) * (1 - e) < e * d
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y \<in> S
y \<noteq> x
dist y x < 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
y \<in> S
y \<noteq> x
dist y x < 1

goal (1 subgoal):
 1. \<exists>y\<in>S. norm (y - x) * (1 - e) < e * d
[PROOF STEP]
unfolding True
[PROOF STATE]
proof (prove)
using this:
y \<in> S
y \<noteq> x
dist y x < 1

goal (1 subgoal):
 1. \<exists>y\<in>S. norm (y - x) * (1 - 1) < 1 * d
[PROOF STEP]
using \<open>d > 0\<close>
[PROOF STATE]
proof (prove)
using this:
y \<in> S
y \<noteq> x
dist y x < 1
0 < d

goal (1 subgoal):
 1. \<exists>y\<in>S. norm (y - x) * (1 - 1) < 1 * d
[PROOF STEP]
by (force simp add: )
[PROOF STATE]
proof (state)
this:
\<exists>y\<in>S. norm (y - x) * (1 - e) < e * d

goal (1 subgoal):
 1. e \<noteq> 1 \<Longrightarrow> \<exists>y\<in>S. norm (y - x) * (1 - e) < e * d
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. e \<noteq> 1 \<Longrightarrow> \<exists>y\<in>S. norm (y - x) * (1 - e) < e * d
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
e \<noteq> 1

goal (1 subgoal):
 1. e \<noteq> 1 \<Longrightarrow> \<exists>y\<in>S. norm (y - x) * (1 - e) < e * d
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
e \<noteq> 1
[PROOF STEP]
have "0 < e * d / (1 - e)" and *: "1 - e > 0"
[PROOF STATE]
proof (prove)
using this:
e \<noteq> 1

goal (1 subgoal):
 1. 0 < e * d / (1 - e) &&& 0 < 1 - e
[PROOF STEP]
using \<open>e \<le> 1\<close> \<open>e > 0\<close> \<open>d > 0\<close>
[PROOF STATE]
proof (prove)
using this:
e \<noteq> 1
e \<le> 1
0 < e
0 < d

goal (1 subgoal):
 1. 0 < e * d / (1 - e) &&& 0 < 1 - e
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < e * d / (1 - e)
0 < 1 - e

goal (1 subgoal):
 1. e \<noteq> 1 \<Longrightarrow> \<exists>y\<in>S. norm (y - x) * (1 - e) < e * d
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < e * d / (1 - e)
0 < 1 - e
[PROOF STEP]
obtain y where "y \<in> S" "y \<noteq> x" "dist y x < e * d / (1 - e)"
[PROOF STATE]
proof (prove)
using this:
0 < e * d / (1 - e)
0 < 1 - e

goal (1 subgoal):
 1. (\<And>y. \<lbrakk>y \<in> S; y \<noteq> x; dist y x < e * d / (1 - e)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using x[unfolded islimpt_approachable,THEN spec[where x="e*d / (1 - e)"]]
[PROOF STATE]
proof (prove)
using this:
0 < e * d / (1 - e)
0 < 1 - e
0 < e * d / (1 - e) \<longrightarrow> (\<exists>x'\<in>S. x' \<noteq> x \<and> dist x' x < e * d / (1 - e))

goal (1 subgoal):
 1. (\<And>y. \<lbrakk>y \<in> S; y \<noteq> x; dist y x < e * d / (1 - e)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y \<in> S
y \<noteq> x
dist y x < e * d / (1 - e)

goal (1 subgoal):
 1. e \<noteq> 1 \<Longrightarrow> \<exists>y\<in>S. norm (y - x) * (1 - e) < e * d
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y \<in> S
y \<noteq> x
dist y x < e * d / (1 - e)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
y \<in> S
y \<noteq> x
dist y x < e * d / (1 - e)

goal (1 subgoal):
 1. \<exists>y\<in>S. norm (y - x) * (1 - e) < e * d
[PROOF STEP]
unfolding dist_norm
[PROOF STATE]
proof (prove)
using this:
y \<in> S
y \<noteq> x
norm (y - x) < e * d / (1 - e)

goal (1 subgoal):
 1. \<exists>y\<in>S. norm (y - x) * (1 - e) < e * d
[PROOF STEP]
using pos_less_divide_eq[OF *]
[PROOF STATE]
proof (prove)
using this:
y \<in> S
y \<noteq> x
norm (y - x) < e * d / (1 - e)
(?a < ?b / (1 - e)) = (?a * (1 - e) < ?b)

goal (1 subgoal):
 1. \<exists>y\<in>S. norm (y - x) * (1 - e) < e * d
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<exists>y\<in>S. norm (y - x) * (1 - e) < e * d

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>y\<in>S. norm (y - x) * (1 - e) < e * d

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>y\<in>S. norm (y - x) * (1 - e) < e * d

goal (1 subgoal):
 1. x - e *\<^sub>R (x - c) \<in> rel_interior S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>y\<in>S. norm (y - x) * (1 - e) < e * d
[PROOF STEP]
obtain y where "y \<in> S" and y: "norm (y - x) * (1 - e) < e * d"
[PROOF STATE]
proof (prove)
using this:
\<exists>y\<in>S. norm (y - x) * (1 - e) < e * d

goal (1 subgoal):
 1. (\<And>y. \<lbrakk>y \<in> S; norm (y - x) * (1 - e) < e * d\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y \<in> S
norm (y - x) * (1 - e) < e * d

goal (1 subgoal):
 1. x - e *\<^sub>R (x - c) \<in> rel_interior S
[PROOF STEP]
define z where "z = c + ((1 - e) / e) *\<^sub>R (x - y)"
[PROOF STATE]
proof (state)
this:
z = c + ((1 - e) / e) *\<^sub>R (x - y)

goal (1 subgoal):
 1. x - e *\<^sub>R (x - c) \<in> rel_interior S
[PROOF STEP]
have *: "x - e *\<^sub>R (x - c) = y - e *\<^sub>R (y - z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x - e *\<^sub>R (x - c) = y - e *\<^sub>R (y - z)
[PROOF STEP]
unfolding z_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x - e *\<^sub>R (x - c) = y - e *\<^sub>R (y - (c + ((1 - e) / e) *\<^sub>R (x - y)))
[PROOF STEP]
using \<open>e > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < e

goal (1 subgoal):
 1. x - e *\<^sub>R (x - c) = y - e *\<^sub>R (y - (c + ((1 - e) / e) *\<^sub>R (x - y)))
[PROOF STEP]
by (auto simp: scaleR_right_diff_distrib scaleR_right_distrib scaleR_left_diff_distrib)
[PROOF STATE]
proof (state)
this:
x - e *\<^sub>R (x - c) = y - e *\<^sub>R (y - z)

goal (1 subgoal):
 1. x - e *\<^sub>R (x - c) \<in> rel_interior S
[PROOF STEP]
have zball: "z \<in> ball c d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<in> ball c d
[PROOF STEP]
using mem_ball z_def dist_norm[of c]
[PROOF STATE]
proof (prove)
using this:
(?y \<in> ball ?x ?e) = (dist ?x ?y < ?e)
z = c + ((1 - e) / e) *\<^sub>R (x - y)
dist c ?y = norm (c - ?y)

goal (1 subgoal):
 1. z \<in> ball c d
[PROOF STEP]
using y and assms(4,5)
[PROOF STATE]
proof (prove)
using this:
(?y \<in> ball ?x ?e) = (dist ?x ?y < ?e)
z = c + ((1 - e) / e) *\<^sub>R (x - y)
dist c ?y = norm (c - ?y)
norm (y - x) * (1 - e) < e * d
0 < e
e \<le> 1

goal (1 subgoal):
 1. z \<in> ball c d
[PROOF STEP]
by (simp add: norm_minus_commute) (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
z \<in> ball c d

goal (1 subgoal):
 1. x - e *\<^sub>R (x - c) \<in> rel_interior S
[PROOF STEP]
have "x \<in> affine hull S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> affine hull S
[PROOF STEP]
using closure_affine_hull assms
[PROOF STATE]
proof (prove)
using this:
closure ?S \<subseteq> affine hull ?S
convex S
c \<in> rel_interior S
x \<in> closure S
0 < e
e \<le> 1

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

goal (1 subgoal):
 1. x - e *\<^sub>R (x - c) \<in> rel_interior S
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
x \<in> affine hull S

goal (1 subgoal):
 1. x - e *\<^sub>R (x - c) \<in> rel_interior S
[PROOF STEP]
have "y \<in> affine hull S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<in> affine hull S
[PROOF STEP]
using \<open>y \<in> S\<close> hull_subset[of S]
[PROOF STATE]
proof (prove)
using this:
y \<in> S
S \<subseteq> ?S hull S

goal (1 subgoal):
 1. y \<in> affine hull S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y \<in> affine hull S

goal (1 subgoal):
 1. x - e *\<^sub>R (x - c) \<in> rel_interior S
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y \<in> affine hull S

goal (1 subgoal):
 1. x - e *\<^sub>R (x - c) \<in> rel_interior S
[PROOF STEP]
have "c \<in> affine hull S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<in> affine hull S
[PROOF STEP]
using assms rel_interior_subset hull_subset[of S]
[PROOF STATE]
proof (prove)
using this:
convex S
c \<in> rel_interior S
x \<in> closure S
0 < e
e \<le> 1
rel_interior ?S \<subseteq> ?S
S \<subseteq> ?S hull S

goal (1 subgoal):
 1. c \<in> affine hull S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c \<in> affine hull S

goal (1 subgoal):
 1. x - e *\<^sub>R (x - c) \<in> rel_interior S
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
x \<in> affine hull S
y \<in> affine hull S
c \<in> affine hull S
[PROOF STEP]
have "z \<in> affine hull S"
[PROOF STATE]
proof (prove)
using this:
x \<in> affine hull S
y \<in> affine hull S
c \<in> affine hull S

goal (1 subgoal):
 1. z \<in> affine hull S
[PROOF STEP]
using z_def affine_affine_hull[of S]
      mem_affine_3_minus [of "affine hull S" c x y "(1 - e) / e"]
      assms
[PROOF STATE]
proof (prove)
using this:
x \<in> affine hull S
y \<in> affine hull S
c \<in> affine hull S
z = c + ((1 - e) / e) *\<^sub>R (x - y)
affine (affine hull S)
\<lbrakk>affine (affine hull S); c \<in> affine hull S; x \<in> affine hull S; y \<in> affine hull S\<rbrakk> \<Longrightarrow> c + ((1 - e) / e) *\<^sub>R (x - y) \<in> affine hull S
convex S
c \<in> rel_interior S
x \<in> closure S
0 < e
e \<le> 1

goal (1 subgoal):
 1. z \<in> affine hull S
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
z \<in> affine hull S

goal (1 subgoal):
 1. x - e *\<^sub>R (x - c) \<in> rel_interior S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z \<in> affine hull S
[PROOF STEP]
have "z \<in> S"
[PROOF STATE]
proof (prove)
using this:
z \<in> affine hull S

goal (1 subgoal):
 1. z \<in> S
[PROOF STEP]
using d zball
[PROOF STATE]
proof (prove)
using this:
z \<in> affine hull S
ball c d \<inter> affine hull S \<subseteq> S
z \<in> ball c d

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

goal (1 subgoal):
 1. x - e *\<^sub>R (x - c) \<in> rel_interior S
[PROOF STEP]
obtain d1 where "d1 > 0" and d1: "ball z d1 \<le> ball c d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>d1. \<lbrakk>0 < d1; ball z d1 \<subseteq> ball c d\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using zball open_ball[of c d] openE[of "ball c d" z]
[PROOF STATE]
proof (prove)
using this:
z \<in> ball c d
open (ball c d)
\<lbrakk>open (ball c d); z \<in> ball c d; \<And>e. \<lbrakk>0 < e; ball z e \<subseteq> ball c d\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>d1. \<lbrakk>0 < d1; ball z d1 \<subseteq> ball c d\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < d1
ball z d1 \<subseteq> ball c d

goal (1 subgoal):
 1. x - e *\<^sub>R (x - c) \<in> rel_interior S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < d1
ball z d1 \<subseteq> ball c d
[PROOF STEP]
have "ball z d1 \<inter> affine hull S \<subseteq> ball c d \<inter> affine hull S"
[PROOF STATE]
proof (prove)
using this:
0 < d1
ball z d1 \<subseteq> ball c d

goal (1 subgoal):
 1. ball z d1 \<inter> affine hull S \<subseteq> ball c d \<inter> affine hull S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ball z d1 \<inter> affine hull S \<subseteq> ball c d \<inter> affine hull S

goal (1 subgoal):
 1. x - e *\<^sub>R (x - c) \<in> rel_interior S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ball z d1 \<inter> affine hull S \<subseteq> ball c d \<inter> affine hull S
[PROOF STEP]
have "ball z d1 \<inter> affine hull S \<subseteq> S"
[PROOF STATE]
proof (prove)
using this:
ball z d1 \<inter> affine hull S \<subseteq> ball c d \<inter> affine hull S

goal (1 subgoal):
 1. ball z d1 \<inter> affine hull S \<subseteq> S
[PROOF STEP]
using d
[PROOF STATE]
proof (prove)
using this:
ball z d1 \<inter> affine hull S \<subseteq> ball c d \<inter> affine hull S
ball c d \<inter> affine hull S \<subseteq> S

goal (1 subgoal):
 1. ball z d1 \<inter> affine hull S \<subseteq> S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ball z d1 \<inter> affine hull S \<subseteq> S

goal (1 subgoal):
 1. x - e *\<^sub>R (x - c) \<in> rel_interior S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ball z d1 \<inter> affine hull S \<subseteq> S
[PROOF STEP]
have "z \<in> rel_interior S"
[PROOF STATE]
proof (prove)
using this:
ball z d1 \<inter> affine hull S \<subseteq> S

goal (1 subgoal):
 1. z \<in> rel_interior S
[PROOF STEP]
using mem_rel_interior_ball
[PROOF STATE]
proof (prove)
using this:
ball z d1 \<inter> affine hull S \<subseteq> S
(?x \<in> rel_interior ?S) = (?x \<in> ?S \<and> (\<exists>e>0. ball ?x e \<inter> affine hull ?S \<subseteq> ?S))

goal (1 subgoal):
 1. z \<in> rel_interior S
[PROOF STEP]
using \<open>d1 > 0\<close> \<open>z \<in> S\<close>
[PROOF STATE]
proof (prove)
using this:
ball z d1 \<inter> affine hull S \<subseteq> S
(?x \<in> rel_interior ?S) = (?x \<in> ?S \<and> (\<exists>e>0. ball ?x e \<inter> affine hull ?S \<subseteq> ?S))
0 < d1
z \<in> S

goal (1 subgoal):
 1. z \<in> rel_interior S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
z \<in> rel_interior S

goal (1 subgoal):
 1. x - e *\<^sub>R (x - c) \<in> rel_interior S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z \<in> rel_interior S
[PROOF STEP]
have "y - e *\<^sub>R (y - z) \<in> rel_interior S"
[PROOF STATE]
proof (prove)
using this:
z \<in> rel_interior S

goal (1 subgoal):
 1. y - e *\<^sub>R (y - z) \<in> rel_interior S
[PROOF STEP]
using rel_interior_convex_shrink[of S z y e] assms \<open>y \<in> S\<close>
[PROOF STATE]
proof (prove)
using this:
z \<in> rel_interior S
\<lbrakk>convex S; z \<in> rel_interior S; y \<in> S; 0 < e; e \<le> 1\<rbrakk> \<Longrightarrow> y - e *\<^sub>R (y - z) \<in> rel_interior S
convex S
c \<in> rel_interior S
x \<in> closure S
0 < e
e \<le> 1
y \<in> S

goal (1 subgoal):
 1. y - e *\<^sub>R (y - z) \<in> rel_interior S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y - e *\<^sub>R (y - z) \<in> rel_interior S

goal (1 subgoal):
 1. x - e *\<^sub>R (x - c) \<in> rel_interior S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y - e *\<^sub>R (y - z) \<in> rel_interior S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
y - e *\<^sub>R (y - z) \<in> rel_interior S

goal (1 subgoal):
 1. x - e *\<^sub>R (x - c) \<in> rel_interior S
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
y - e *\<^sub>R (y - z) \<in> rel_interior S
x - e *\<^sub>R (x - c) = y - e *\<^sub>R (y - z)

goal (1 subgoal):
 1. x - e *\<^sub>R (x - c) \<in> rel_interior S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x - e *\<^sub>R (x - c) \<in> rel_interior S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma trivial_imp_finite_group:
   "trivial_group G \<Longrightarrow> finite(carrier G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trivial_group G \<Longrightarrow> finite (carrier G)
[PROOF STEP]
by (simp add: trivial_group_def)


[STATEMENT]
lemma of_rat_less_1_iff [simp]: "(of_rat r :: 'a::linordered_field) < 1 \<longleftrightarrow> r < 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (of_rat r < (1::'a)) = (r < 1)
[PROOF STEP]
using of_rat_less [of r 1]
[PROOF STATE]
proof (prove)
using this:
(of_rat r < of_rat 1) = (r < 1)

goal (1 subgoal):
 1. (of_rat r < (1::'a)) = (r < 1)
[PROOF STEP]
by simp


[STATEMENT]
lemma sep_conj_true_P [simp]:
  "(sep_true ** (sep_true ** P)) = (sep_true ** P)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>s. True) \<and>* (\<lambda>s. True) \<and>* P) = ((\<lambda>s. True) \<and>* P)
[PROOF STEP]
by (simp add: sep_conj_assoc[symmetric])


[STATEMENT]
lemma x_zero_meet_closed: "(x \<cdot> 0) \<sqinter> (y \<cdot> 0) = (x \<sqinter> y) \<cdot> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<cdot> (0::'a) \<sqinter> y \<cdot> (0::'a) = (x \<sqinter> y) \<cdot> (0::'a)
[PROOF STEP]
by (metis c_0 local.cl6 local.meet_assoc local.meet_comm)


[STATEMENT]
lemma lm076:
  assumes "runiq P"
  shows "card (Domain P) = card P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (Domain P) = card P
[PROOF STEP]
using assms rightUniqueInjectiveOnFirst card_image
[PROOF STATE]
proof (prove)
using this:
runiq P
runiq ?P = inj_on fst ?P
inj_on ?f ?A \<Longrightarrow> card (?f ` ?A) = card ?A

goal (1 subgoal):
 1. card (Domain P) = card P
[PROOF STEP]
by (metis Domain_fst)


[STATEMENT]
lemma hypnat_induct_obj:
  "\<And>n. (( *p* P) (0::hypnat) \<and> (\<forall>n. ( *p* P) n \<longrightarrow> ( *p* P) (n + 1))) \<longrightarrow> ( *p* P) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. (*p* P) 0 \<and> (\<forall>n. (*p* P) n \<longrightarrow> (*p* P) (n + 1)) \<longrightarrow> (*p* P) n
[PROOF STEP]
by transfer (induct_tac n, auto)


[STATEMENT]
lemma summable_on_add:
  fixes f g :: "'a \<Rightarrow> 'b::{topological_comm_monoid_add}"
  assumes \<open>f summable_on A\<close>
  assumes \<open>g summable_on A\<close>
  shows \<open>(\<lambda>x. f x + g x) summable_on A\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. f x + g x) summable_on A
[PROOF STEP]
by (metis (full_types) assms(1) assms(2) summable_on_def has_sum_add)


[STATEMENT]
lemma small_big_asymmetric: "f \<in> l F (g) \<Longrightarrow> g \<in> L F (f) \<Longrightarrow> eventually (\<lambda>x. f x = 0) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> l F g; g \<in> L F f\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. f x = (0::'b)
[PROOF STEP]
by (drule (1) small_big_trans) (simp add: small_refl_iff)


[STATEMENT]
lemma lcf_deg_0:
  assumes "degree p = 0"
  assumes "p \<in> carrier P"
  assumes "q \<in> carrier P"
  shows "(p \<otimes>\<^bsub>P\<^esub> q) = (lcf p)\<odot>\<^bsub>P\<^esub>q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<otimes>\<^bsub>P\<^esub> q = p (deg R p) \<odot>\<^bsub>P\<^esub> q
[PROOF STEP]
using P_def assms(1) assms(2) assms(3)
[PROOF STATE]
proof (prove)
using this:
P \<equiv> UP R
deg R p = 0
p \<in> carrier P
q \<in> carrier P

goal (1 subgoal):
 1. p \<otimes>\<^bsub>P\<^esub> q = p (deg R p) \<odot>\<^bsub>P\<^esub> q
[PROOF STEP]
by (metis ltrm_deg_0 cfs_closed monom_mult_is_smult)


[STATEMENT]
lemma ta_der'_inf_mctxt:
  assumes "t |\<in>| ta_der' \<A> s"
  shows "fst (split_vars t) \<le> (mctxt_of_term s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (split_vars t) \<le> mctxt_of_term s
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
t |\<in>| ta_der' \<A> s

goal (1 subgoal):
 1. fst (split_vars t) \<le> mctxt_of_term s
[PROOF STEP]
proof (induct s arbitrary: t)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x t. t |\<in>| ta_der' \<A> (Var x) \<Longrightarrow> fst (split_vars t) \<le> mctxt_of_term (Var x)
 2. \<And>x1a x2 t. \<lbrakk>\<And>x2a t. \<lbrakk>x2a \<in> set x2; t |\<in>| ta_der' \<A> x2a\<rbrakk> \<Longrightarrow> fst (split_vars t) \<le> mctxt_of_term x2a; t |\<in>| ta_der' \<A> (Fun x1a x2)\<rbrakk> \<Longrightarrow> fst (split_vars t) \<le> mctxt_of_term (Fun x1a x2)
[PROOF STEP]
case (Fun f ts)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x2a \<in> set ts; ?t |\<in>| ta_der' \<A> ?x2a\<rbrakk> \<Longrightarrow> fst (split_vars ?t) \<le> mctxt_of_term ?x2a
t |\<in>| ta_der' \<A> (Fun f ts)

goal (2 subgoals):
 1. \<And>x t. t |\<in>| ta_der' \<A> (Var x) \<Longrightarrow> fst (split_vars t) \<le> mctxt_of_term (Var x)
 2. \<And>x1a x2 t. \<lbrakk>\<And>x2a t. \<lbrakk>x2a \<in> set x2; t |\<in>| ta_der' \<A> x2a\<rbrakk> \<Longrightarrow> fst (split_vars t) \<le> mctxt_of_term x2a; t |\<in>| ta_der' \<A> (Fun x1a x2)\<rbrakk> \<Longrightarrow> fst (split_vars t) \<le> mctxt_of_term (Fun x1a x2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?x2a \<in> set ts; ?t |\<in>| ta_der' \<A> ?x2a\<rbrakk> \<Longrightarrow> fst (split_vars ?t) \<le> mctxt_of_term ?x2a
t |\<in>| ta_der' \<A> (Fun f ts)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x2a \<in> set ts; ?t |\<in>| ta_der' \<A> ?x2a\<rbrakk> \<Longrightarrow> fst (split_vars ?t) \<le> mctxt_of_term ?x2a
t |\<in>| ta_der' \<A> (Fun f ts)

goal (1 subgoal):
 1. fst (split_vars t) \<le> mctxt_of_term (Fun f ts)
[PROOF STEP]
by (cases t) (auto simp: comp_def less_eq_mctxt_prime intro: less_eq_mctxt'.intros)
[PROOF STATE]
proof (state)
this:
fst (split_vars t) \<le> mctxt_of_term (Fun f ts)

goal (1 subgoal):
 1. \<And>x t. t |\<in>| ta_der' \<A> (Var x) \<Longrightarrow> fst (split_vars t) \<le> mctxt_of_term (Var x)
[PROOF STEP]
qed (auto simp: ta_der'.simps)


[STATEMENT]
lemma sum_arith_progression:
  "(\<Sum>r<(N::nat). (\<Sum>i<a. f (i*N+r))) = (\<Sum>j<a*N. f j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>r<N. \<Sum>i<a. f (i * N + r)) = sum f {..<a * N}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>r<N. \<Sum>i<a. f (i * N + r)) = sum f {..<a * N}
[PROOF STEP]
have *: "(\<Sum>r<N. f (i*N+r)) = (\<Sum> j \<in> {i*N..<i*N + N}. f j)" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>r<N. f (i * N + r)) = sum f {i * N..<i * N + N}
[PROOF STEP]
by (rule sum.reindex_bij_betw, rule bij_betw_byWitness[where ?f' = "\<lambda>r. r-i*N"], auto)
[PROOF STATE]
proof (state)
this:
(\<Sum>r<N. f (?i * N + r)) = sum f {?i * N..<?i * N + N}

goal (1 subgoal):
 1. (\<Sum>r<N. \<Sum>i<a. f (i * N + r)) = sum f {..<a * N}
[PROOF STEP]
have "(\<Sum>r<N. (\<Sum>i<a. f (i*N+r))) = (\<Sum>i<a. (\<Sum>r<N. f (i*N+r)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>r<N. \<Sum>i<a. f (i * N + r)) = (\<Sum>i<a. \<Sum>r<N. f (i * N + r))
[PROOF STEP]
using sum.swap
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<in>?A. sum (?g i) ?B) = (\<Sum>j\<in>?B. \<Sum>i\<in>?A. ?g i j)

goal (1 subgoal):
 1. (\<Sum>r<N. \<Sum>i<a. f (i * N + r)) = (\<Sum>i<a. \<Sum>r<N. f (i * N + r))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>r<N. \<Sum>i<a. f (i * N + r)) = (\<Sum>i<a. \<Sum>r<N. f (i * N + r))

goal (1 subgoal):
 1. (\<Sum>r<N. \<Sum>i<a. f (i * N + r)) = sum f {..<a * N}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>r<N. \<Sum>i<a. f (i * N + r)) = (\<Sum>i<a. \<Sum>r<N. f (i * N + r))

goal (1 subgoal):
 1. (\<Sum>r<N. \<Sum>i<a. f (i * N + r)) = sum f {..<a * N}
[PROOF STEP]
have "... = (\<Sum>i<a. (\<Sum> j \<in> {i*N..<i*N + N}. f j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<a. \<Sum>r<N. f (i * N + r)) = (\<Sum>i<a. sum f {i * N..<i * N + N})
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
(\<Sum>r<N. f (?i * N + r)) = sum f {?i * N..<?i * N + N}

goal (1 subgoal):
 1. (\<Sum>i<a. \<Sum>r<N. f (i * N + r)) = (\<Sum>i<a. sum f {i * N..<i * N + N})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i<a. \<Sum>r<N. f (i * N + r)) = (\<Sum>i<a. sum f {i * N..<i * N + N})

goal (1 subgoal):
 1. (\<Sum>r<N. \<Sum>i<a. f (i * N + r)) = sum f {..<a * N}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i<a. \<Sum>r<N. f (i * N + r)) = (\<Sum>i<a. sum f {i * N..<i * N + N})

goal (1 subgoal):
 1. (\<Sum>r<N. \<Sum>i<a. f (i * N + r)) = sum f {..<a * N}
[PROOF STEP]
have "... = (\<Sum>j<a*N. f j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<a. sum f {i * N..<i * N + N}) = sum f {..<a * N}
[PROOF STEP]
by (rule sum.nat_group)
[PROOF STATE]
proof (state)
this:
(\<Sum>i<a. sum f {i * N..<i * N + N}) = sum f {..<a * N}

goal (1 subgoal):
 1. (\<Sum>r<N. \<Sum>i<a. f (i * N + r)) = sum f {..<a * N}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>r<N. \<Sum>i<a. f (i * N + r)) = sum f {..<a * N}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>r<N. \<Sum>i<a. f (i * N + r)) = sum f {..<a * N}

goal (1 subgoal):
 1. (\<Sum>r<N. \<Sum>i<a. f (i * N + r)) = sum f {..<a * N}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>r<N. \<Sum>i<a. f (i * N + r)) = sum f {..<a * N}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma concat_take_sing: assumes "k \<le> l" shows "concat (take k ([r]\<^sup>@l)) = r\<^sup>@k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. concat (take k ([r] \<^sup>@ l)) = r \<^sup>@ k
[PROOF STEP]
unfolding take_sing_pow[OF \<open>k \<le> l\<close>]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. concat ([r] \<^sup>@ k) = r \<^sup>@ k
[PROOF STEP]
using concat_sing_pow
[PROOF STATE]
proof (prove)
using this:
concat ([?a] \<^sup>@ ?k) = ?a \<^sup>@ ?k

goal (1 subgoal):
 1. concat ([r] \<^sup>@ k) = r \<^sup>@ k
[PROOF STEP]
.


[STATEMENT]
lemma filter_mset_image_mset:
  "filter_mset P (image_mset f A) = image_mset f (filter_mset (\<lambda>x. P (f x)) A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filter_mset P (image_mset f A) = image_mset f {#x \<in># A. P (f x)#}
[PROOF STEP]
by (induction A) auto


[STATEMENT]
lemma resr_distl: "(x \<squnion> y) \<rightarrow> z = (x \<rightarrow> z) \<sqinter> (y \<rightarrow> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<squnion> y \<rightarrow> z = (x \<rightarrow> z) \<sqinter> (y \<rightarrow> z)
[PROOF STEP]
proof (rule order.antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x \<squnion> y \<rightarrow> z \<le> (x \<rightarrow> z) \<sqinter> (y \<rightarrow> z)
 2. (x \<rightarrow> z) \<sqinter> (y \<rightarrow> z) \<le> x \<squnion> y \<rightarrow> z
[PROOF STEP]
show "x \<squnion> y \<rightarrow> z \<le> (x \<rightarrow> z) \<sqinter> (y \<rightarrow> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<squnion> y \<rightarrow> z \<le> (x \<rightarrow> z) \<sqinter> (y \<rightarrow> z)
[PROOF STEP]
by (metis local.inf.bounded_iff local.resr_antitonel local.resr_superdist_var local.sup_ge2)
[PROOF STATE]
proof (state)
this:
x \<squnion> y \<rightarrow> z \<le> (x \<rightarrow> z) \<sqinter> (y \<rightarrow> z)

goal (1 subgoal):
 1. (x \<rightarrow> z) \<sqinter> (y \<rightarrow> z) \<le> x \<squnion> y \<rightarrow> z
[PROOF STEP]
show "(x \<rightarrow> z) \<sqinter> (y \<rightarrow> z) \<le> x \<squnion> y \<rightarrow> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<rightarrow> z) \<sqinter> (y \<rightarrow> z) \<le> x \<squnion> y \<rightarrow> z
[PROOF STEP]
by (metis local.inf.cobounded1 local.inf.cobounded2 local.resl_galois local.resr_galois local.sup_least)
[PROOF STATE]
proof (state)
this:
(x \<rightarrow> z) \<sqinter> (y \<rightarrow> z) \<le> x \<squnion> y \<rightarrow> z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem lookup_some_append:
  assumes "lookup env (xs @ ys) = Some e"
  shows "\<exists>e. lookup env xs = Some e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>e. lookup env xs = Some e
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>e. lookup env xs = Some e
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
lookup env (xs @ ys) = Some e
[PROOF STEP]
have "lookup env (xs @ ys) \<noteq> None"
[PROOF STATE]
proof (prove)
using this:
lookup env (xs @ ys) = Some e

goal (1 subgoal):
 1. lookup env (xs @ ys) \<noteq> None
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
lookup env (xs @ ys) \<noteq> None

goal (1 subgoal):
 1. \<exists>e. lookup env xs = Some e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
lookup env (xs @ ys) \<noteq> None
[PROOF STEP]
have "lookup env xs \<noteq> None"
[PROOF STATE]
proof (prove)
using this:
lookup env (xs @ ys) \<noteq> None

goal (1 subgoal):
 1. lookup env xs \<noteq> None
[PROOF STEP]
by (rule contrapos_nn) (simp only: lookup_append_none)
[PROOF STATE]
proof (state)
this:
lookup env xs \<noteq> None

goal (1 subgoal):
 1. \<exists>e. lookup env xs = Some e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
lookup env xs \<noteq> None
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
lookup env xs \<noteq> None

goal (1 subgoal):
 1. \<exists>e. lookup env xs = Some e
[PROOF STEP]
by (simp)
[PROOF STATE]
proof (state)
this:
\<exists>e. lookup env xs = Some e

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma homeomorphic_space_contractibility:
   "X homeomorphic_space Y
        \<Longrightarrow> (contractible_space X \<longleftrightarrow> contractible_space Y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X homeomorphic_space Y \<Longrightarrow> contractible_space X = contractible_space Y
[PROOF STEP]
by (simp add: homeomorphic_imp_homotopy_equivalent_space homotopy_equivalent_space_contractibility)


[STATEMENT]
lemma [code abstract]:
  "integer_of_natural (m div n) = integer_of_natural m div integer_of_natural n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integer_of_natural (m div n) = integer_of_natural m div integer_of_natural n
[PROOF STEP]
by transfer (simp add: zdiv_int)


[STATEMENT]
lemma config'_rand_append: "config'_rand A s (xs@ys) = config'_rand A (config'_rand A s xs) ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. config'_rand A s (xs @ ys) = config'_rand A (config'_rand A s xs) ys
[PROOF STEP]
apply(induct xs arbitrary: s)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>s. config'_rand A s ([] @ ys) = config'_rand A (config'_rand A s []) ys
 2. \<And>a xs s. (\<And>s. config'_rand A s (xs @ ys) = config'_rand A (config'_rand A s xs) ys) \<Longrightarrow> config'_rand A s ((a # xs) @ ys) = config'_rand A (config'_rand A s (a # xs)) ys
[PROOF STEP]
by(simp_all)


[STATEMENT]
lemma km: "k < m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k < m
[PROOF STEP]
using power_strict_increasing_iff[of k 1 4] k2
[PROOF STATE]
proof (prove)
using this:
1 < k \<Longrightarrow> (k ^ 1 < k ^ 4) = (1 < 4)
2 < k

goal (1 subgoal):
 1. k < m
[PROOF STEP]
unfolding m_def
[PROOF STATE]
proof (prove)
using this:
1 < k \<Longrightarrow> (k ^ 1 < k ^ 4) = (1 < 4)
2 < k

goal (1 subgoal):
 1. k < k ^ 4
[PROOF STEP]
by auto


[STATEMENT]
lemma iso_compose:
  "\<lbrakk>f \<in> carrier A \<rightarrow> carrier B; isotone A B f; g \<in> carrier B \<rightarrow> carrier C; isotone B C g\<rbrakk> \<Longrightarrow>
   isotone A C (g \<circ> f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> carrier A \<rightarrow> carrier B; isotone A B f; g \<in> carrier B \<rightarrow> carrier C; isotone B C g\<rbrakk> \<Longrightarrow> isotone A C (g \<circ> f)
[PROOF STEP]
by (simp add: isotone_def, safe, metis Pi_iff)


[STATEMENT]
lemma inverse_powr: "\<And>y::real. 0 \<le> y \<Longrightarrow> inverse y powr a = inverse (y powr a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y. 0 \<le> y \<Longrightarrow> inverse y powr a = inverse (y powr a)
[PROOF STEP]
by (simp add: exp_minus ln_inverse powr_def)


[STATEMENT]
lemma contour_integral_trivial [simp]: "contour_integral (linepath a a) f = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. contour_integral (linepath a a) f = 0
[PROOF STEP]
using has_contour_integral_trivial contour_integral_unique
[PROOF STATE]
proof (prove)
using this:
(?f has_contour_integral 0) (linepath ?a ?a)
(?f has_contour_integral ?i) ?g \<Longrightarrow> contour_integral ?g ?f = ?i

goal (1 subgoal):
 1. contour_integral (linepath a a) f = 0
[PROOF STEP]
by blast


[STATEMENT]
lemma Nil_in_nlists [simp]: "[] \<in> nlists A n \<longleftrightarrow> n = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ([] \<in> nlists A n) = (n = 0)
[PROOF STEP]
by(auto simp add: nlists_alt_def)


[STATEMENT]
lemma borel_measurable_subalgebra:
  assumes "sets N \<subseteq> sets M" "space N = space M" "f \<in> borel_measurable N"
  shows "f \<in> borel_measurable M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> borel_measurable M
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
sets N \<subseteq> sets M
space N = space M
f \<in> borel_measurable N

goal (1 subgoal):
 1. f \<in> borel_measurable M
[PROOF STEP]
unfolding measurable_def
[PROOF STATE]
proof (prove)
using this:
sets N \<subseteq> sets M
space N = space M
f \<in> {f \<in> space N \<rightarrow> space borel. \<forall>y\<in>sets borel. f -` y \<inter> space N \<in> sets N}

goal (1 subgoal):
 1. f \<in> {f \<in> space M \<rightarrow> space borel. \<forall>y\<in>sets borel. f -` y \<inter> space M \<in> sets M}
[PROOF STEP]
by auto


[STATEMENT]
theorem rbt_insert2: "rbt t \<Longrightarrow> rbt (insert x t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rbt t \<Longrightarrow> rbt (RBT_Set.insert x t)
[PROOF STEP]
by (simp add: inv_ins color_paint_Black invh_paint rbt_def insert_def)


[STATEMENT]
lemma SA_Units_inv_closed:
  assumes "f \<in> (Units (SA n))"
  shows "inv\<^bsub>SA n\<^esub> f \<in> carrier (SA n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv\<^bsub>SA n\<^esub> f \<in> carrier (SA n)
[PROOF STEP]
using assms SA_is_monoid[of n] monoid.Units_inv_closed[of "SA n" f]
[PROOF STATE]
proof (prove)
using this:
f \<in> Units (SA n)
Group.monoid (SA n)
\<lbrakk>Group.monoid (SA n); f \<in> Units (SA n)\<rbrakk> \<Longrightarrow> inv\<^bsub>SA n\<^esub> f \<in> carrier (SA n)

goal (1 subgoal):
 1. inv\<^bsub>SA n\<^esub> f \<in> carrier (SA n)
[PROOF STEP]
by blast


[STATEMENT]
lemma Bex_Sum_iff: "(\<exists>x\<in>A<+>B. P x) \<longleftrightarrow> (\<exists> x\<in>A. P (Inl x)) \<or> (\<exists> y\<in>B. P (Inr y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x\<in>A <+> B. P x) = ((\<exists>x\<in>A. P (Inl x)) \<or> (\<exists>y\<in>B. P (Inr y)))
[PROOF STEP]
by (auto)


[STATEMENT]
lemma maybe_negate_false: "(\<not>? x = false) = (x = true)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<not>? x = false) = (x = true)
[PROOF STEP]
by (cases x, auto)


[STATEMENT]
lemma banach_fix_type:
  fixes f::"'a::complete_space\<Rightarrow>'a"
  assumes c:"0 \<le> c" "c < 1"
      and lipschitz:"\<forall>x. \<forall>y. dist (f x) (f y) \<le> c * dist x y"
  shows "\<exists>!x. (f x = x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>!x. f x = x
[PROOF STEP]
using assms banach_fix[OF complete_UNIV UNIV_not_empty assms(1,2) subset_UNIV, of f]
[PROOF STATE]
proof (prove)
using this:
0 \<le> c
c < 1
\<forall>x y. dist (f x) (f y) \<le> c * dist x y
\<forall>x\<in>UNIV. \<forall>y\<in>UNIV. dist (f x) (f y) \<le> c * dist x y \<Longrightarrow> \<exists>!x. x \<in> UNIV \<and> f x = x

goal (1 subgoal):
 1. \<exists>!x. f x = x
[PROOF STEP]
by auto


[STATEMENT]
lemma scaleR_matrix_vector_assoc:
  fixes A :: "real^('m::finite)^'n"
  shows "k *\<^sub>R (A *v v) = k *\<^sub>R A *v v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k *\<^sub>R (A *v v) = k *\<^sub>R A *v v
[PROOF STEP]
by (metis matrix_scaleR_vector_ac matrix_vector_mult_scaleR)


[STATEMENT]
lemma or_nat_rec:
  \<open>m OR n = of_bool (odd m \<or> odd n) + 2 * ((m div 2) OR (n div 2))\<close> for m n :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m OR n = of_bool (odd m \<or> odd n) + 2 * (m div 2 OR n div 2)
[PROOF STEP]
by (simp add: or_nat_def or_int_rec [of \<open>int m\<close> \<open>int n\<close>] zdiv_int nat_add_distrib nat_mult_distrib)


[STATEMENT]
lemma fls_mult_distrib_base_factor:
  fixes a b c :: "'a::semiring_0 fls"
  shows
    "fls_base_factor a * (fls_base_factor b + fls_base_factor c) =
      fls_base_factor a * fls_base_factor b + fls_base_factor a * fls_base_factor c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_base_factor a * (fls_base_factor b + fls_base_factor c) = fls_base_factor a * fls_base_factor b + fls_base_factor a * fls_base_factor c
[PROOF STEP]
by    (simp add: fls_mult_distrib_subdegree_ge_0 del: fls_base_factor_def)


[STATEMENT]
lemma invertible_imp_bijective:
  assumes "invertible_lf scaleB scaleC f"
  shows "bij f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij f
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
invertible_lf scaleB scaleC f

goal (1 subgoal):
 1. bij f
[PROOF STEP]
unfolding invertible_lf_def invertible_lf_axioms_def
[PROOF STATE]
proof (prove)
using this:
linear scaleB scaleC f \<and> (\<exists>g. g \<circ> f = id \<and> f \<circ> g = id)

goal (1 subgoal):
 1. bij f
[PROOF STEP]
by (metis bij_betw_comp_iff bij_betw_imp_surj inj_on_imageI2 inj_on_imp_bij_betw inv_id surj_id surj_imp_inj_inv)


[STATEMENT]
lemma selectlike_equal_cond: "(selectlike X \<nu> V = selectlike Y \<nu> V) = (\<forall>\<mu>. Uvariation \<mu> \<nu> (-V) \<longrightarrow> (\<mu>\<in>X) = (\<mu>\<in>Y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (selectlike X \<nu> V = selectlike Y \<nu> V) = (\<forall>\<mu>. Uvariation \<mu> \<nu> (- V) \<longrightarrow> (\<mu> \<in> X) = (\<mu> \<in> Y))
[PROOF STEP]
unfolding selectlike_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({\<omega> \<in> X. Vagree \<omega> \<nu> V} = {\<omega> \<in> Y. Vagree \<omega> \<nu> V}) = (\<forall>\<mu>. Uvariation \<mu> \<nu> (- V) \<longrightarrow> (\<mu> \<in> X) = (\<mu> \<in> Y))
[PROOF STEP]
using Uvariation_Vagree
[PROOF STATE]
proof (prove)
using this:
Uvariation ?\<nu> ?\<nu>' (- ?V) = Vagree ?\<nu> ?\<nu>' ?V

goal (1 subgoal):
 1. ({\<omega> \<in> X. Vagree \<omega> \<nu> V} = {\<omega> \<in> Y. Vagree \<omega> \<nu> V}) = (\<forall>\<mu>. Uvariation \<mu> \<nu> (- V) \<longrightarrow> (\<mu> \<in> X) = (\<mu> \<in> Y))
[PROOF STEP]
by auto


[STATEMENT]
lemma sinh_ln_complex: "x \<noteq> 0 \<Longrightarrow> sinh (ln x :: complex) = (x - inverse x) / 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> sinh (Ln x) = (x - inverse x) / 2
[PROOF STEP]
by (simp add: sinh_def exp_minus scaleR_conv_of_real exp_of_real)


[STATEMENT]
lemma cont_case_prod_iff:
  "\<lbrakk> monotone (rel_prod orda ordb) (\<le>) (case_prod f);
     class.preorder orda (mk_less orda); lub_singleton luba;
     class.preorder ordb (mk_less ordb); lub_singleton lubb \<rbrakk>
  \<Longrightarrow> cont (prod_lub luba lubb) (rel_prod orda ordb) Sup (\<le>) (case_prod f) \<longleftrightarrow>
   (\<forall>x. cont lubb ordb Sup (\<le>) (\<lambda>y. f x y)) \<and> (\<forall>y. cont luba orda Sup (\<le>) (\<lambda>x. f x y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>monotone (rel_prod orda ordb) (\<le>) (\<lambda>(x, y). f x y); class.preorder orda (mk_less orda); lub_singleton luba; class.preorder ordb (mk_less ordb); lub_singleton lubb\<rbrakk> \<Longrightarrow> cont (prod_lub luba lubb) (rel_prod orda ordb) Sup (\<le>) (\<lambda>(x, y). f x y) = ((\<forall>x. cont lubb ordb Sup (\<le>) (f x)) \<and> (\<forall>y. cont luba orda Sup (\<le>) (\<lambda>x. f x y)))
[PROOF STEP]
by(blast dest: cont_case_prodD1 cont_case_prodD2 intro: cont_case_prodI)


[STATEMENT]
lemma interleave_butlast: "xs \<in> ys \<otimes> zs \<Longrightarrow> butlast xs \<in> butlast ys \<otimes> zs \<or> butlast xs \<in> ys \<otimes> (butlast zs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs \<in> ys \<otimes> zs \<Longrightarrow> butlast xs \<in> butlast ys \<otimes> zs \<or> butlast xs \<in> ys \<otimes> butlast zs
[PROOF STEP]
by (induction rule:interleave_induct) (auto intro: interleave_intros)


[STATEMENT]
lemma congruence_inv:
  assumes "mat_det M \<noteq> 0" and "congruence M H = H'"
  shows "congruence (mat_inv M) H' = H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. congruence (mat_inv M) H' = H
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
mat_det M \<noteq> 0
congruence M H = H'

goal (1 subgoal):
 1. congruence (mat_inv M) H' = H
[PROOF STEP]
using \<open>mat_det M \<noteq> 0\<close> mult_mm_inv_l[of "mat_adj M" "H *\<^sub>m\<^sub>m M" "H'"]
[PROOF STATE]
proof (prove)
using this:
mat_det M \<noteq> 0
congruence M H = H'
mat_det M \<noteq> 0
\<lbrakk>mat_det (mat_adj M) \<noteq> 0; mat_adj M *\<^sub>m\<^sub>m (H *\<^sub>m\<^sub>m M) = H'\<rbrakk> \<Longrightarrow> H *\<^sub>m\<^sub>m M = mat_inv (mat_adj M) *\<^sub>m\<^sub>m H'

goal (1 subgoal):
 1. congruence (mat_inv M) H' = H
[PROOF STEP]
using mult_mm_inv_r[of M "H" "mat_inv (mat_adj M) *\<^sub>m\<^sub>m H'"]
[PROOF STATE]
proof (prove)
using this:
mat_det M \<noteq> 0
congruence M H = H'
mat_det M \<noteq> 0
\<lbrakk>mat_det (mat_adj M) \<noteq> 0; mat_adj M *\<^sub>m\<^sub>m (H *\<^sub>m\<^sub>m M) = H'\<rbrakk> \<Longrightarrow> H *\<^sub>m\<^sub>m M = mat_inv (mat_adj M) *\<^sub>m\<^sub>m H'
\<lbrakk>mat_det M \<noteq> 0; H *\<^sub>m\<^sub>m M = mat_inv (mat_adj M) *\<^sub>m\<^sub>m H'\<rbrakk> \<Longrightarrow> H = mat_inv (mat_adj M) *\<^sub>m\<^sub>m H' *\<^sub>m\<^sub>m mat_inv M

goal (1 subgoal):
 1. congruence (mat_inv M) H' = H
[PROOF STEP]
by (simp add: mat_det_adj mult_mm_assoc mat_adj_inv)


[STATEMENT]
lemma cos_Taylor_1_lower_bound:
  fixes x :: real
  assumes "0 \<le> x"
    shows "(1 - x^2 / 2) \<le> cos x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 - x\<^sup>2 / 2 \<le> cos x
[PROOF STEP]
apply (rule gen_lower_bound_increasing [OF assms])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>y. \<lbrakk>0 \<le> y; y \<le> x\<rbrakk> \<Longrightarrow> ((\<lambda>x. 1 - x\<^sup>2 / 2 - cos x) has_real_derivative ?g y) (at y)
 2. \<And>y. \<lbrakk>0 \<le> y; y \<le> x\<rbrakk> \<Longrightarrow> ?g y \<le> 0
 3. 1 - 0\<^sup>2 / 2 = cos 0
[PROOF STEP]
apply (intro derivative_eq_intros)
[PROOF STATE]
proof (prove)
goal (12 subgoals):
 1. \<And>y. \<lbrakk>0 \<le> y; y \<le> x\<rbrakk> \<Longrightarrow> 0 = ?f'11 y
 2. \<And>y. \<lbrakk>0 \<le> y; y \<le> x\<rbrakk> \<Longrightarrow> 1 = ?D18 y
 3. \<And>y. \<lbrakk>0 \<le> y; y \<le> x\<rbrakk> \<Longrightarrow> real 2 * (?D18 y * y ^ (2 - Suc 0)) = ?D13 y
 4. \<And>y. \<lbrakk>0 \<le> y; y \<le> x\<rbrakk> \<Longrightarrow> 0 = ?E13 y
 5. \<And>y. \<lbrakk>0 \<le> y; y \<le> x\<rbrakk> \<Longrightarrow> 2 \<noteq> 0
 6. \<And>y. \<lbrakk>0 \<le> y; y \<le> x\<rbrakk> \<Longrightarrow> (?D13 y * 2 - y\<^sup>2 * ?E13 y) / (2 * 2) = ?g'11 y
 7. \<And>y. \<lbrakk>0 \<le> y; y \<le> x\<rbrakk> \<Longrightarrow> ?f'11 y - ?g'11 y = ?f'5 y
 8. \<And>y. \<lbrakk>0 \<le> y; y \<le> x\<rbrakk> \<Longrightarrow> 1 = ?Db7 y
 9. \<And>y. \<lbrakk>0 \<le> y; y \<le> x\<rbrakk> \<Longrightarrow> - sin y * ?Db7 y = ?g'5 y
 10. \<And>y. \<lbrakk>0 \<le> y; y \<le> x\<rbrakk> \<Longrightarrow> ?f'5 y - ?g'5 y = ?g y
A total of 12 subgoals...
[PROOF STEP]
apply (rule refl | simp add: sin_le_arg)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma open_Collect_neg: "closed {x. P x} \<Longrightarrow> open {x. \<not> P x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed {x. P x} \<Longrightarrow> open {x. \<not> P x}
[PROOF STEP]
unfolding Collect_neg_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed {x. P x} \<Longrightarrow> open (- {x. P x})
[PROOF STEP]
by (rule open_Compl)


[STATEMENT]
lemma matrix_vector_mul_lid [simp]: "mat 1 *v x = (x::'a::semiring_1 ^ 'n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat (1::'a) *v x = x
[PROOF STEP]
apply (vector matrix_vector_mult_def mat_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i. (\<Sum>j\<in>UNIV. (if i = j then 1::'a else (0::'a)) * x $ j) = x $ i
[PROOF STEP]
apply (simp add: if_distrib if_distribR cong del: if_weak_cong)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma sum_content_null:
  assumes "content (cbox a b) = 0"
    and "p tagged_division_of (cbox a b)"
  shows "(\<Sum>(x,K)\<in>p. content K *\<^sub>R f x) = (0::'a::real_normed_vector)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>(x, K)\<in>p. content K *\<^sub>R f x) = (0::'a)
[PROOF STEP]
proof (rule sum.neutral, rule)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> p \<Longrightarrow> (case x of (x, K) \<Rightarrow> content K *\<^sub>R f x) = (0::'a)
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> p \<Longrightarrow> (case x of (x, K) \<Rightarrow> content K *\<^sub>R f x) = (0::'a)
[PROOF STEP]
assume y: "y \<in> p"
[PROOF STATE]
proof (state)
this:
y \<in> p

goal (1 subgoal):
 1. \<And>x. x \<in> p \<Longrightarrow> (case x of (x, K) \<Rightarrow> content K *\<^sub>R f x) = (0::'a)
[PROOF STEP]
obtain x K where xk: "y = (x, K)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x K. y = (x, K) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using surj_pair[of y]
[PROOF STATE]
proof (prove)
using this:
\<exists>x ya. y = (x, ya)

goal (1 subgoal):
 1. (\<And>x K. y = (x, K) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
y = (x, K)

goal (1 subgoal):
 1. \<And>x. x \<in> p \<Longrightarrow> (case x of (x, K) \<Rightarrow> content K *\<^sub>R f x) = (0::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y = (x, K)
[PROOF STEP]
obtain c d where k: "K = cbox c d" "K \<subseteq> cbox a b"
[PROOF STATE]
proof (prove)
using this:
y = (x, K)

goal (1 subgoal):
 1. (\<And>c d. \<lbrakk>K = cbox c d; K \<subseteq> cbox a b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis assms(2) tagged_division_ofD(3) tagged_division_ofD(4) y)
[PROOF STATE]
proof (state)
this:
K = cbox c d
K \<subseteq> cbox a b

goal (1 subgoal):
 1. \<And>x. x \<in> p \<Longrightarrow> (case x of (x, K) \<Rightarrow> content K *\<^sub>R f x) = (0::'a)
[PROOF STEP]
have "(\<lambda>(x',K'). content K' *\<^sub>R f x') y = content K *\<^sub>R f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (case y of (x', K') \<Rightarrow> content K' *\<^sub>R f x') = content K *\<^sub>R f x
[PROOF STEP]
unfolding xk
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (case (x, K) of (x', K') \<Rightarrow> content K' *\<^sub>R f x') = content K *\<^sub>R f x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(case y of (x', K') \<Rightarrow> content K' *\<^sub>R f x') = content K *\<^sub>R f x

goal (1 subgoal):
 1. \<And>x. x \<in> p \<Longrightarrow> (case x of (x, K) \<Rightarrow> content K *\<^sub>R f x) = (0::'a)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(case y of (x', K') \<Rightarrow> content K' *\<^sub>R f x') = content K *\<^sub>R f x

goal (1 subgoal):
 1. \<And>x. x \<in> p \<Longrightarrow> (case x of (x, K) \<Rightarrow> content K *\<^sub>R f x) = (0::'a)
[PROOF STEP]
have "\<dots> = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. content K *\<^sub>R f x = (0::'a)
[PROOF STEP]
using assms(1) content_0_subset k(2)
[PROOF STATE]
proof (prove)
using this:
content (cbox a b) = 0
\<lbrakk>content (cbox ?a ?b) = 0; ?s \<subseteq> cbox ?a ?b\<rbrakk> \<Longrightarrow> content ?s = 0
K \<subseteq> cbox a b

goal (1 subgoal):
 1. content K *\<^sub>R f x = (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
content K *\<^sub>R f x = (0::'a)

goal (1 subgoal):
 1. \<And>x. x \<in> p \<Longrightarrow> (case x of (x, K) \<Rightarrow> content K *\<^sub>R f x) = (0::'a)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(case y of (x', K') \<Rightarrow> content K' *\<^sub>R f x') = (0::'a)
[PROOF STEP]
show "(\<lambda>(x, k). content k *\<^sub>R f x) y = 0"
[PROOF STATE]
proof (prove)
using this:
(case y of (x', K') \<Rightarrow> content K' *\<^sub>R f x') = (0::'a)

goal (1 subgoal):
 1. (case y of (x, k) \<Rightarrow> content k *\<^sub>R f x) = (0::'a)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(case y of (x, k) \<Rightarrow> content k *\<^sub>R f x) = (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma jumpF_pathfinish_eq_0:
  assumes "path g" "Re(pathfinish g)\<noteq>Re z"
  shows "jumpF_pathfinish g z = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_pathfinish g z = 0
[PROOF STEP]
unfolding jumpF_pathfinish_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF (\<lambda>t. Im (g t - z) / Re (g t - z)) (at_left 1) = 0
[PROOF STEP]
apply (rule jumpF_im_divide_Re_0)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. path (\<lambda>t. g t - z)
 2. Re (g 1 - z) \<noteq> 0
 3. 0 < 1
 4. 1 \<le> 1
[PROOF STEP]
using assms[unfolded pathfinish_def]
[PROOF STATE]
proof (prove)
using this:
path g
Re (g 1) \<noteq> Re z

goal (4 subgoals):
 1. path (\<lambda>t. g t - z)
 2. Re (g 1 - z) \<noteq> 0
 3. 0 < 1
 4. 1 \<le> 1
[PROOF STEP]
by auto


[STATEMENT]
theorem abs_summable_sophomores_dream: "summable (\<lambda>k. 1 / real (k ^ k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>k. 1 / real (k ^ k))
[PROOF STEP]
proof (rule summable_comparison_test_bigo)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. summable (\<lambda>n. norm (?g n))
 2. (\<lambda>k. 1 / real (k ^ k)) \<in> O(?g)
[PROOF STEP]
show "(\<lambda>k. 1 / real (k ^ k)) \<in> O(\<lambda>k. 1 / real k ^ 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>k. 1 / real (k ^ k)) \<in> O(\<lambda>k. 1 / (real k)\<^sup>2)
[PROOF STEP]
by real_asymp
[PROOF STATE]
proof (state)
this:
(\<lambda>k. 1 / real (k ^ k)) \<in> O(\<lambda>k. 1 / (real k)\<^sup>2)

goal (1 subgoal):
 1. summable (\<lambda>n. norm (1 / (real n)\<^sup>2))
[PROOF STEP]
show "summable (\<lambda>n. norm (1 / real n ^ 2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. norm (1 / (real n)\<^sup>2))
[PROOF STEP]
using inverse_power_summable[of 2, where ?'a = real]
[PROOF STATE]
proof (prove)
using this:
2 \<le> 2 \<Longrightarrow> summable (\<lambda>n. inverse ((real n)\<^sup>2))

goal (1 subgoal):
 1. summable (\<lambda>n. norm (1 / (real n)\<^sup>2))
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. norm (1 / (real n)\<^sup>2))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem moebius_inverse:
  assumes "a * d \<noteq> b * c" "c * z + d \<noteq> 0"
  shows   "moebius d (-b) (-c) a (moebius a b c d z) = z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius d (- b) (- c) a (moebius a b c d z) = z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. moebius d (- b) (- c) a (moebius a b c d z) = z
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
a * d \<noteq> b * c
c * z + d \<noteq> (0::'a)
[PROOF STEP]
have "(-c) * moebius a b c d z + a \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
a * d \<noteq> b * c
c * z + d \<noteq> (0::'a)

goal (1 subgoal):
 1. - c * moebius a b c d z + a \<noteq> (0::'a)
[PROOF STEP]
unfolding moebius_def
[PROOF STATE]
proof (prove)
using this:
a * d \<noteq> b * c
c * z + d \<noteq> (0::'a)

goal (1 subgoal):
 1. - c * ((a * z + b) / (c * z + d)) + a \<noteq> (0::'a)
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
- c * moebius a b c d z + a \<noteq> (0::'a)

goal (1 subgoal):
 1. moebius d (- b) (- c) a (moebius a b c d z) = z
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
a * d \<noteq> b * c
c * z + d \<noteq> (0::'a)
- c * moebius a b c d z + a \<noteq> (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a * d \<noteq> b * c
c * z + d \<noteq> (0::'a)
- c * moebius a b c d z + a \<noteq> (0::'a)

goal (1 subgoal):
 1. moebius d (- b) (- c) a (moebius a b c d z) = z
[PROOF STEP]
unfolding moebius_def
[PROOF STATE]
proof (prove)
using this:
a * d \<noteq> b * c
c * z + d \<noteq> (0::'a)
- c * ((a * z + b) / (c * z + d)) + a \<noteq> (0::'a)

goal (1 subgoal):
 1. (d * ((a * z + b) / (c * z + d)) + - b) / (- c * ((a * z + b) / (c * z + d)) + a) = z
[PROOF STEP]
by (simp add: moebius_def divide_simps) (simp add: algebra_simps)?
[PROOF STATE]
proof (state)
this:
moebius d (- b) (- c) a (moebius a b c d z) = z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma absolute_neighbourhood_extensor_imp_ANR:
  fixes S :: "'a::euclidean_space set"
  assumes "\<And>f :: 'a * real \<Rightarrow> 'a.
           \<And>U T. \<lbrakk>continuous_on T f;  f ` T \<subseteq> S;
                  closedin (top_of_set U) T\<rbrakk>
                 \<Longrightarrow> \<exists>V g. T \<subseteq> V \<and> openin (top_of_set U) V \<and>
                       continuous_on V g \<and> g ` V \<subseteq> S \<and> (\<forall>x \<in> T. g x = f x)"
  shows "ANR S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ANR S
[PROOF STEP]
proof (clarsimp simp: ANR_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>U S'. \<lbrakk>S homeomorphic S'; closedin (top_of_set U) S'\<rbrakk> \<Longrightarrow> \<exists>T. openin (top_of_set U) T \<and> S' retract_of T
[PROOF STEP]
fix U and T :: "('a * real) set"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>U S'. \<lbrakk>S homeomorphic S'; closedin (top_of_set U) S'\<rbrakk> \<Longrightarrow> \<exists>T. openin (top_of_set U) T \<and> S' retract_of T
[PROOF STEP]
assume "S homeomorphic T" and clo: "closedin (top_of_set U) T"
[PROOF STATE]
proof (state)
this:
S homeomorphic T
closedin (top_of_set U) T

goal (1 subgoal):
 1. \<And>U S'. \<lbrakk>S homeomorphic S'; closedin (top_of_set U) S'\<rbrakk> \<Longrightarrow> \<exists>T. openin (top_of_set U) T \<and> S' retract_of T
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
S homeomorphic T
closedin (top_of_set U) T
[PROOF STEP]
obtain g h where hom: "homeomorphism S T g h"
[PROOF STATE]
proof (prove)
using this:
S homeomorphic T
closedin (top_of_set U) T

goal (1 subgoal):
 1. (\<And>g h. homeomorphism S T g h \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (force simp: homeomorphic_def)
[PROOF STATE]
proof (state)
this:
homeomorphism S T g h

goal (1 subgoal):
 1. \<And>U S'. \<lbrakk>S homeomorphic S'; closedin (top_of_set U) S'\<rbrakk> \<Longrightarrow> \<exists>T. openin (top_of_set U) T \<and> S' retract_of T
[PROOF STEP]
obtain h: "continuous_on T h" " h ` T \<subseteq> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lbrakk>continuous_on T h; h ` T \<subseteq> S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using hom homeomorphism_def
[PROOF STATE]
proof (prove)
using this:
homeomorphism S T g h
homeomorphism ?s ?t ?f ?g = ((\<forall>x\<in>?s. ?g (?f x) = x) \<and> ?f ` ?s = ?t \<and> continuous_on ?s ?f \<and> (\<forall>y\<in>?t. ?f (?g y) = y) \<and> ?g ` ?t = ?s \<and> continuous_on ?t ?g)

goal (1 subgoal):
 1. (\<lbrakk>continuous_on T h; h ` T \<subseteq> S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
continuous_on T h
h ` T \<subseteq> S

goal (1 subgoal):
 1. \<And>U S'. \<lbrakk>S homeomorphic S'; closedin (top_of_set U) S'\<rbrakk> \<Longrightarrow> \<exists>T. openin (top_of_set U) T \<and> S' retract_of T
[PROOF STEP]
obtain V h' where "T \<subseteq> V" and opV: "openin (top_of_set U) V"
                and h': "continuous_on V h'" "h' ` V \<subseteq> S"
              and h'h: "\<forall>x\<in>T. h' x = h x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>V h'. \<lbrakk>T \<subseteq> V; openin (top_of_set U) V; continuous_on V h'; h' ` V \<subseteq> S; \<forall>x\<in>T. h' x = h x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms [OF h clo]
[PROOF STATE]
proof (prove)
using this:
\<exists>V g. T \<subseteq> V \<and> openin (top_of_set U) V \<and> continuous_on V g \<and> g ` V \<subseteq> S \<and> (\<forall>x\<in>T. g x = h x)

goal (1 subgoal):
 1. (\<And>V h'. \<lbrakk>T \<subseteq> V; openin (top_of_set U) V; continuous_on V h'; h' ` V \<subseteq> S; \<forall>x\<in>T. h' x = h x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
T \<subseteq> V
openin (top_of_set U) V
continuous_on V h'
h' ` V \<subseteq> S
\<forall>x\<in>T. h' x = h x

goal (1 subgoal):
 1. \<And>U S'. \<lbrakk>S homeomorphic S'; closedin (top_of_set U) S'\<rbrakk> \<Longrightarrow> \<exists>T. openin (top_of_set U) T \<and> S' retract_of T
[PROOF STEP]
have [simp]: "T \<subseteq> U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T \<subseteq> U
[PROOF STEP]
using clo closedin_imp_subset
[PROOF STATE]
proof (prove)
using this:
closedin (top_of_set U) T
closedin (subtopology ?U ?S) ?T \<Longrightarrow> ?T \<subseteq> ?S

goal (1 subgoal):
 1. T \<subseteq> U
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
T \<subseteq> U

goal (1 subgoal):
 1. \<And>U S'. \<lbrakk>S homeomorphic S'; closedin (top_of_set U) S'\<rbrakk> \<Longrightarrow> \<exists>T. openin (top_of_set U) T \<and> S' retract_of T
[PROOF STEP]
have "T retract_of V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T retract_of V
[PROOF STEP]
proof (simp add: retraction_def retract_of_def, intro exI conjI \<open>T \<subseteq> V\<close>)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. continuous_on V ?r8
 2. ?r8 ` V \<subseteq> T
 3. \<forall>x\<in>T. ?r8 x = x
[PROOF STEP]
show "continuous_on V (g \<circ> h')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on V (g \<circ> h')
[PROOF STEP]
by (meson continuous_on_compose continuous_on_subset h' hom homeomorphism_cont1)
[PROOF STATE]
proof (state)
this:
continuous_on V (g \<circ> h')

goal (2 subgoals):
 1. (g \<circ> h') ` V \<subseteq> T
 2. \<forall>x\<in>T. (g \<circ> h') x = x
[PROOF STEP]
show "(g \<circ> h') ` V \<subseteq> T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g \<circ> h') ` V \<subseteq> T
[PROOF STEP]
using h'
[PROOF STATE]
proof (prove)
using this:
continuous_on V h'
h' ` V \<subseteq> S

goal (1 subgoal):
 1. (g \<circ> h') ` V \<subseteq> T
[PROOF STEP]
by clarsimp (metis hom subsetD homeomorphism_def imageI)
[PROOF STATE]
proof (state)
this:
(g \<circ> h') ` V \<subseteq> T

goal (1 subgoal):
 1. \<forall>x\<in>T. (g \<circ> h') x = x
[PROOF STEP]
show "\<forall>x\<in>T. (g \<circ> h') x = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>T. (g \<circ> h') x = x
[PROOF STEP]
by clarsimp (metis h'h hom homeomorphism_def)
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>T. (g \<circ> h') x = x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
T retract_of V

goal (1 subgoal):
 1. \<And>U S'. \<lbrakk>S homeomorphic S'; closedin (top_of_set U) S'\<rbrakk> \<Longrightarrow> \<exists>T. openin (top_of_set U) T \<and> S' retract_of T
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
T retract_of V
[PROOF STEP]
show "\<exists>V. openin (top_of_set U) V \<and> T retract_of V"
[PROOF STATE]
proof (prove)
using this:
T retract_of V

goal (1 subgoal):
 1. \<exists>V. openin (top_of_set U) V \<and> T retract_of V
[PROOF STEP]
using opV
[PROOF STATE]
proof (prove)
using this:
T retract_of V
openin (top_of_set U) V

goal (1 subgoal):
 1. \<exists>V. openin (top_of_set U) V \<and> T retract_of V
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>V. openin (top_of_set U) V \<and> T retract_of V

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma col_polys_to_mat:
  assumes "j < length ts"
  shows "col (polys_to_mat ts ps) j = vec_of_list (map (\<lambda>p. lookup p (ts ! j)) ps)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. col (polys_to_mat ts ps) j = vec_of_list (map (\<lambda>p. lookup p (ts ! j)) ps)
[PROOF STEP]
by (simp add: vec_of_list_alt col_def, rule vec_cong, rule refl, simp add: polys_to_mat_index assms)


[STATEMENT]
lemma abs_harm [simp]: "(abs (harm n) :: real) = harm n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>harm n\<bar> = harm n
[PROOF STEP]
using harm_nonneg[of n]
[PROOF STATE]
proof (prove)
using this:
(0::?'a) \<le> harm n

goal (1 subgoal):
 1. \<bar>harm n\<bar> = harm n
[PROOF STEP]
by (rule abs_of_nonneg)


[STATEMENT]
lemma postSetpostList: "postList xs l s \<Longrightarrow>  postSet (set xs) l s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. postList xs l s \<Longrightarrow> postSet (set xs) l s
[PROOF STEP]
proof (induct xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. postList [] l s \<Longrightarrow> postSet (set []) l s
 2. \<And>a xs. \<lbrakk>postList xs l s \<Longrightarrow> postSet (set xs) l s; postList (a # xs) l s\<rbrakk> \<Longrightarrow> postSet (set (a # xs)) l s
[PROOF STEP]
case (Cons a xs)
[PROOF STATE]
proof (state)
this:
postList xs l s \<Longrightarrow> postSet (set xs) l s
postList (a # xs) l s

goal (2 subgoals):
 1. postList [] l s \<Longrightarrow> postSet (set []) l s
 2. \<And>a xs. \<lbrakk>postList xs l s \<Longrightarrow> postSet (set xs) l s; postList (a # xs) l s\<rbrakk> \<Longrightarrow> postSet (set (a # xs)) l s
[PROOF STEP]
obtain y e where a: "a=(y,e)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>y e. a = (y, e) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
a = (y, e)

goal (2 subgoals):
 1. postList [] l s \<Longrightarrow> postSet (set []) l s
 2. \<And>a xs. \<lbrakk>postList xs l s \<Longrightarrow> postSet (set xs) l s; postList (a # xs) l s\<rbrakk> \<Longrightarrow> postSet (set (a # xs)) l s
[PROOF STEP]
from Cons
[PROOF STATE]
proof (chain)
picking this:
postList xs l s \<Longrightarrow> postSet (set xs) l s
postList (a # xs) l s
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
postList xs l s \<Longrightarrow> postSet (set xs) l s
postList (a # xs) l s

goal (1 subgoal):
 1. postSet (set (a # xs)) l s
[PROOF STEP]
unfolding a
[PROOF STATE]
proof (prove)
using this:
postList xs l s \<Longrightarrow> postSet (set xs) l s
postList ((y, e) # xs) l s

goal (1 subgoal):
 1. postSet (set ((y, e) # xs)) l s
[PROOF STEP]
by(simp)
[PROOF STATE]
proof (state)
this:
postSet (set (a # xs)) l s

goal (1 subgoal):
 1. postList [] l s \<Longrightarrow> postSet (set []) l s
[PROOF STEP]
qed simp


[STATEMENT]
lemma power2_csqrt[simp,algebra]: "(csqrt z)\<^sup>2 = z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (csqrt z)\<^sup>2 = z
[PROOF STEP]
proof (cases "Im z = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Im z = 0 \<Longrightarrow> (csqrt z)\<^sup>2 = z
 2. Im z \<noteq> 0 \<Longrightarrow> (csqrt z)\<^sup>2 = z
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
Im z = 0

goal (2 subgoals):
 1. Im z = 0 \<Longrightarrow> (csqrt z)\<^sup>2 = z
 2. Im z \<noteq> 0 \<Longrightarrow> (csqrt z)\<^sup>2 = z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Im z = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Im z = 0

goal (1 subgoal):
 1. (csqrt z)\<^sup>2 = z
[PROOF STEP]
using real_sqrt_pow2[of "Re z"] real_sqrt_pow2[of "- Re z"]
[PROOF STATE]
proof (prove)
using this:
Im z = 0
0 \<le> Re z \<Longrightarrow> (sqrt (Re z))\<^sup>2 = Re z
0 \<le> - Re z \<Longrightarrow> (sqrt (- Re z))\<^sup>2 = - Re z

goal (1 subgoal):
 1. (csqrt z)\<^sup>2 = z
[PROOF STEP]
by (cases "0::real" "Re z" rule: linorder_cases)
      (simp_all add: complex_eq_iff Re_power2 Im_power2 power2_eq_square cmod_eq_Re)
[PROOF STATE]
proof (state)
this:
(csqrt z)\<^sup>2 = z

goal (1 subgoal):
 1. Im z \<noteq> 0 \<Longrightarrow> (csqrt z)\<^sup>2 = z
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Im z \<noteq> 0 \<Longrightarrow> (csqrt z)\<^sup>2 = z
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
Im z \<noteq> 0

goal (1 subgoal):
 1. Im z \<noteq> 0 \<Longrightarrow> (csqrt z)\<^sup>2 = z
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Im z \<noteq> 0

goal (1 subgoal):
 1. Im z \<noteq> 0 \<Longrightarrow> (csqrt z)\<^sup>2 = z
[PROOF STEP]
have "cmod z * cmod z - Re z * Re z = Im z * Im z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod z * cmod z - Re z * Re z = Im z * Im z
[PROOF STEP]
by (simp add: norm_complex_def power2_eq_square)
[PROOF STATE]
proof (state)
this:
cmod z * cmod z - Re z * Re z = Im z * Im z

goal (1 subgoal):
 1. Im z \<noteq> 0 \<Longrightarrow> (csqrt z)\<^sup>2 = z
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
cmod z * cmod z - Re z * Re z = Im z * Im z

goal (1 subgoal):
 1. Im z \<noteq> 0 \<Longrightarrow> (csqrt z)\<^sup>2 = z
[PROOF STEP]
have "\<bar>Re z\<bar> \<le> cmod z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>Re z\<bar> \<le> cmod z
[PROOF STEP]
by (simp add: norm_complex_def)
[PROOF STATE]
proof (state)
this:
\<bar>Re z\<bar> \<le> cmod z

goal (1 subgoal):
 1. Im z \<noteq> 0 \<Longrightarrow> (csqrt z)\<^sup>2 = z
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Im z \<noteq> 0
cmod z * cmod z - Re z * Re z = Im z * Im z
\<bar>Re z\<bar> \<le> cmod z
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Im z \<noteq> 0
cmod z * cmod z - Re z * Re z = Im z * Im z
\<bar>Re z\<bar> \<le> cmod z

goal (1 subgoal):
 1. (csqrt z)\<^sup>2 = z
[PROOF STEP]
by (simp add: Re_power2 Im_power2 complex_eq_iff real_sgn_eq
        field_simps real_sqrt_mult[symmetric] real_sqrt_divide)
[PROOF STATE]
proof (state)
this:
(csqrt z)\<^sup>2 = z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma span_add_eq: assumes x: "x \<in> span S" shows "x + y \<in> span S \<longleftrightarrow> y \<in> span S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x + y \<in> span S) = (y \<in> span S)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x + y \<in> span S \<Longrightarrow> y \<in> span S
 2. y \<in> span S \<Longrightarrow> x + y \<in> span S
[PROOF STEP]
assume *: "x + y \<in> span S"
[PROOF STATE]
proof (state)
this:
x + y \<in> span S

goal (2 subgoals):
 1. x + y \<in> span S \<Longrightarrow> y \<in> span S
 2. y \<in> span S \<Longrightarrow> x + y \<in> span S
[PROOF STEP]
have "(x + y) - x \<in> span S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x + y - x \<in> span S
[PROOF STEP]
using * x
[PROOF STATE]
proof (prove)
using this:
x + y \<in> span S
x \<in> span S

goal (1 subgoal):
 1. x + y - x \<in> span S
[PROOF STEP]
by (rule span_diff)
[PROOF STATE]
proof (state)
this:
x + y - x \<in> span S

goal (2 subgoals):
 1. x + y \<in> span S \<Longrightarrow> y \<in> span S
 2. y \<in> span S \<Longrightarrow> x + y \<in> span S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x + y - x \<in> span S
[PROOF STEP]
show "y \<in> span S"
[PROOF STATE]
proof (prove)
using this:
x + y - x \<in> span S

goal (1 subgoal):
 1. y \<in> span S
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
y \<in> span S

goal (1 subgoal):
 1. y \<in> span S \<Longrightarrow> x + y \<in> span S
[PROOF STEP]
qed (intro span_add x)


[STATEMENT]
lemma open_exclude_setI:
  assumes "\<exists>U. open U \<and> U\<inter> A = {x}"
shows "open (open_exclude_set x A)" and "(open_exclude_set x A) \<inter> A = {x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open (open_exclude_set x A) &&& open_exclude_set x A \<inter> A = {x}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. open (open_exclude_set x A)
 2. open_exclude_set x A \<inter> A = {x}
[PROOF STEP]
let ?V = "SOME U. open U \<and> U \<inter> A = {x}"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. open (open_exclude_set x A)
 2. open_exclude_set x A \<inter> A = {x}
[PROOF STEP]
have vprop: "open ?V \<and> ?V \<inter> A = {x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open (SOME U. open U \<and> U \<inter> A = {x}) \<and> (SOME U. open U \<and> U \<inter> A = {x}) \<inter> A = {x}
[PROOF STEP]
using someI_ex[of "\<lambda>U. open U \<and> U \<inter> A = {x}"] assms
[PROOF STATE]
proof (prove)
using this:
\<exists>xa. open xa \<and> xa \<inter> A = {x} \<Longrightarrow> open (SOME xa. open xa \<and> xa \<inter> A = {x}) \<and> (SOME xa. open xa \<and> xa \<inter> A = {x}) \<inter> A = {x}
\<exists>U. open U \<and> U \<inter> A = {x}

goal (1 subgoal):
 1. open (SOME U. open U \<and> U \<inter> A = {x}) \<and> (SOME U. open U \<and> U \<inter> A = {x}) \<inter> A = {x}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
open (SOME U. open U \<and> U \<inter> A = {x}) \<and> (SOME U. open U \<and> U \<inter> A = {x}) \<inter> A = {x}

goal (2 subgoals):
 1. open (open_exclude_set x A)
 2. open_exclude_set x A \<inter> A = {x}
[PROOF STEP]
show "open (open_exclude_set x A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open (open_exclude_set x A)
[PROOF STEP]
by (simp add: open_exclude_set_def vprop)
[PROOF STATE]
proof (state)
this:
open (open_exclude_set x A)

goal (1 subgoal):
 1. open_exclude_set x A \<inter> A = {x}
[PROOF STEP]
show "open_exclude_set x A \<inter> A = {x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open_exclude_set x A \<inter> A = {x}
[PROOF STEP]
by (metis (mono_tags, lifting) open_exclude_set_def vprop)
[PROOF STATE]
proof (state)
this:
open_exclude_set x A \<inter> A = {x}

goal:
No subgoals!
[PROOF STEP]
qed