[STATEMENT]
lemma GS_rec_fun_code: "GS_rec_fun v s = foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..s}) s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. GS_rec_fun v s = foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..s}) s
[PROOF STEP]
proof (induction s rule: less_induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (\<And>y. y < x \<Longrightarrow> GS_rec_fun v y = foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..y}) y) \<Longrightarrow> GS_rec_fun v x = foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..x}) x
[PROOF STEP]
case (less s)
[PROOF STATE]
proof (state)
this:
?y3 < s \<Longrightarrow> GS_rec_fun v ?y3 = foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..?y3}) ?y3

goal (1 subgoal):
 1. \<And>x. (\<And>y. y < x \<Longrightarrow> GS_rec_fun v y = foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..y}) y) \<Longrightarrow> GS_rec_fun v x = foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..x}) x
[PROOF STEP]
have "foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..s}) s
    = foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {x \<in> {..s}. x < s} @ sorted_list_of_set {x \<in> {..s}. s \<le> x}) s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..s}) s = foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {x \<in> {..s}. x < s} @ sorted_list_of_set {x \<in> {..s}. s \<le> x}) s
[PROOF STEP]
by (subst sorted_list_of_set_split[of _ s]) auto
[PROOF STATE]
proof (state)
this:
foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..s}) s = foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {x \<in> {..s}. x < s} @ sorted_list_of_set {x \<in> {..s}. s \<le> x}) s

goal (1 subgoal):
 1. \<And>x. (\<And>y. y < x \<Longrightarrow> GS_rec_fun v y = foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..y}) y) \<Longrightarrow> GS_rec_fun v x = foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..x}) x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..s}) s = foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {x \<in> {..s}. x < s} @ sorted_list_of_set {x \<in> {..s}. s \<le> x}) s

goal (1 subgoal):
 1. \<And>x. (\<And>y. y < x \<Longrightarrow> GS_rec_fun v y = foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..y}) y) \<Longrightarrow> GS_rec_fun v x = foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..x}) x
[PROOF STEP]
have "\<dots> = foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..<s} @ sorted_list_of_set {s}) s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {x \<in> {..s}. x < s} @ sorted_list_of_set {x \<in> {..s}. s \<le> x}) s = foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..<s} @ sorted_list_of_set {s}) s
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {x \<in> {..s}. x < s} @ sorted_list_of_set {x \<in> {..s}. s \<le> x}) s = foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..<s} @ sorted_list_of_set {s}) s
[PROOF STEP]
have "{x \<in> {..s}. x <s} = {..<s}" "{x \<in> {..s}. s \<le> x} = {s}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> {..s}. x < s} = {..<s} &&& {x \<in> {..s}. s \<le> x} = {s}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{x \<in> {..s}. x < s} = {..<s}
{x \<in> {..s}. s \<le> x} = {s}

goal (1 subgoal):
 1. foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {x \<in> {..s}. x < s} @ sorted_list_of_set {x \<in> {..s}. s \<le> x}) s = foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..<s} @ sorted_list_of_set {s}) s
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
{x \<in> {..s}. x < s} = {..<s}
{x \<in> {..s}. s \<le> x} = {s}

goal (1 subgoal):
 1. foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {x \<in> {..s}. x < s} @ sorted_list_of_set {x \<in> {..s}. s \<le> x}) s = foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..<s} @ sorted_list_of_set {s}) s
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {x \<in> {..s}. x < s} @ sorted_list_of_set {x \<in> {..s}. s \<le> x}) s = foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..<s} @ sorted_list_of_set {s}) s

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {x \<in> {..s}. x < s} @ sorted_list_of_set {x \<in> {..s}. s \<le> x}) s = foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..<s} @ sorted_list_of_set {s}) s

goal (1 subgoal):
 1. \<And>x. (\<And>y. y < x \<Longrightarrow> GS_rec_fun v y = foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..y}) y) \<Longrightarrow> GS_rec_fun v x = foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..x}) x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {x \<in> {..s}. x < s} @ sorted_list_of_set {x \<in> {..s}. s \<le> x}) s = foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..<s} @ sorted_list_of_set {s}) s

goal (1 subgoal):
 1. \<And>x. (\<And>y. y < x \<Longrightarrow> GS_rec_fun v y = foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..y}) y) \<Longrightarrow> GS_rec_fun v x = foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..x}) x
[PROOF STEP]
have "\<dots> =  GS_rec_iter (foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..<s})) s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..<s} @ sorted_list_of_set {s}) s = GS_rec_iter (foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..<s})) s
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..<s} @ sorted_list_of_set {s}) s = GS_rec_iter (foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..<s})) s

goal (1 subgoal):
 1. \<And>x. (\<And>y. y < x \<Longrightarrow> GS_rec_fun v y = foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..y}) y) \<Longrightarrow> GS_rec_fun v x = foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..x}) x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..<s} @ sorted_list_of_set {s}) s = GS_rec_iter (foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..<s})) s

goal (1 subgoal):
 1. \<And>x. (\<And>y. y < x \<Longrightarrow> GS_rec_fun v y = foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..y}) y) \<Longrightarrow> GS_rec_fun v x = foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..x}) x
[PROOF STEP]
have "\<dots> = GS_rec_fun v s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. GS_rec_iter (foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..<s})) s = GS_rec_fun v s
[PROOF STEP]
proof (intro GS_rec_fun_eq_GS_iter[symmetric], safe, goal_cases)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>s'. s' < s \<Longrightarrow> foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..<s}) s' = GS_rec_fun v s'
 2. \<And>s'. s \<le> s' \<Longrightarrow> foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..<s}) s' = v s'
[PROOF STEP]
case (1 s')
[PROOF STATE]
proof (state)
this:
s' < s

goal (2 subgoals):
 1. \<And>s'. s' < s \<Longrightarrow> foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..<s}) s' = GS_rec_fun v s'
 2. \<And>s'. s \<le> s' \<Longrightarrow> foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..<s}) s' = v s'
[PROOF STEP]
assume "s' < s"
[PROOF STATE]
proof (state)
this:
s' < s

goal (2 subgoals):
 1. \<And>s'. s' < s \<Longrightarrow> foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..<s}) s' = GS_rec_fun v s'
 2. \<And>s'. s \<le> s' \<Longrightarrow> foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..<s}) s' = v s'
[PROOF STEP]
hence *: "(Collect ((<) s')) \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
s' < s

goal (1 subgoal):
 1. Collect ((<) s') \<noteq> {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Collect ((<) s') \<noteq> {}

goal (2 subgoals):
 1. \<And>s'. s' < s \<Longrightarrow> foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..<s}) s' = GS_rec_fun v s'
 2. \<And>s'. s \<le> s' \<Longrightarrow> foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..<s}) s' = v s'
[PROOF STEP]
hence "{x \<in> {..<s}. x < Min (Collect ((<) s'))} = {..s'}"
[PROOF STATE]
proof (prove)
using this:
Collect ((<) s') \<noteq> {}

goal (1 subgoal):
 1. {x \<in> {..<s}. x < Min (Collect ((<) s'))} = {..s'}
[PROOF STEP]
using leI 1
[PROOF STATE]
proof (prove)
using this:
Collect ((<) s') \<noteq> {}
\<not> ?x < ?y \<Longrightarrow> ?y \<le> ?x
s' < s

goal (1 subgoal):
 1. {x \<in> {..<s}. x < Min (Collect ((<) s'))} = {..s'}
[PROOF STEP]
by (auto simp add: Min_gr_iff[OF finite])
[PROOF STATE]
proof (state)
this:
{x \<in> {..<s}. x < Min (Collect ((<) s'))} = {..s'}

goal (2 subgoals):
 1. \<And>s'. s' < s \<Longrightarrow> foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..<s}) s' = GS_rec_fun v s'
 2. \<And>s'. s \<le> s' \<Longrightarrow> foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..<s}) s' = v s'
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{x \<in> {..<s}. x < Min (Collect ((<) s'))} = {..s'}

goal (2 subgoals):
 1. \<And>s'. s' < s \<Longrightarrow> foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..<s}) s' = GS_rec_fun v s'
 2. \<And>s'. s \<le> s' \<Longrightarrow> foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..<s}) s' = v s'
[PROOF STEP]
have "{x \<in> {..<s}. Min (Collect ((<) s')) \<le> x} = {s'<..<s}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> {..<s}. Min (Collect ((<) s')) \<le> x} = {s'<..<s}
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
Collect ((<) s') \<noteq> {}

goal (1 subgoal):
 1. {x \<in> {..<s}. Min (Collect ((<) s')) \<le> x} = {s'<..<s}
[PROOF STEP]
by (auto simp add: Min_le_iff[OF finite])
[PROOF STATE]
proof (state)
this:
{x \<in> {..<s}. Min (Collect ((<) s')) \<le> x} = {s'<..<s}

goal (2 subgoals):
 1. \<And>s'. s' < s \<Longrightarrow> foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..<s}) s' = GS_rec_fun v s'
 2. \<And>s'. s \<le> s' \<Longrightarrow> foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..<s}) s' = v s'
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
{x \<in> {..<s}. x < Min (Collect ((<) s'))} = {..s'}
{x \<in> {..<s}. Min (Collect ((<) s')) \<le> x} = {s'<..<s}
[PROOF STEP]
have "foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..<s}) s'
  = foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..s'} @ sorted_list_of_set {s'<..<s}) s'"
[PROOF STATE]
proof (prove)
using this:
{x \<in> {..<s}. x < Min (Collect ((<) s'))} = {..s'}
{x \<in> {..<s}. Min (Collect ((<) s')) \<le> x} = {s'<..<s}

goal (1 subgoal):
 1. foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..<s}) s' = foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..s'} @ sorted_list_of_set {s'<..<s}) s'
[PROOF STEP]
by (subst sorted_list_of_set_split[of _ "Min{s. s' < s}"]) auto
[PROOF STATE]
proof (state)
this:
foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..<s}) s' = foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..s'} @ sorted_list_of_set {s'<..<s}) s'

goal (2 subgoals):
 1. \<And>s'. s' < s \<Longrightarrow> foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..<s}) s' = GS_rec_fun v s'
 2. \<And>s'. s \<le> s' \<Longrightarrow> foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..<s}) s' = v s'
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..<s}) s' = foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..s'} @ sorted_list_of_set {s'<..<s}) s'

goal (2 subgoals):
 1. \<And>s'. s' < s \<Longrightarrow> foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..<s}) s' = GS_rec_fun v s'
 2. \<And>s'. s \<le> s' \<Longrightarrow> foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..<s}) s' = v s'
[PROOF STEP]
have "\<dots> =  GS_rec_fun v s'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..s'} @ sorted_list_of_set {s'<..<s}) s' = GS_rec_fun v s'
[PROOF STEP]
using "1" less.IH
[PROOF STATE]
proof (prove)
using this:
s' < s
?y3 < s \<Longrightarrow> GS_rec_fun v ?y3 = foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..?y3}) ?y3

goal (1 subgoal):
 1. foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..s'} @ sorted_list_of_set {s'<..<s}) s' = GS_rec_fun v s'
[PROOF STEP]
by (subst foldl_upd_notin') fastforce+
[PROOF STATE]
proof (state)
this:
foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..s'} @ sorted_list_of_set {s'<..<s}) s' = GS_rec_fun v s'

goal (2 subgoals):
 1. \<And>s'. s' < s \<Longrightarrow> foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..<s}) s' = GS_rec_fun v s'
 2. \<And>s'. s \<le> s' \<Longrightarrow> foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..<s}) s' = v s'
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..<s}) s' = GS_rec_fun v s'
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..<s}) s' = GS_rec_fun v s'

goal (1 subgoal):
 1. foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..<s}) s' = GS_rec_fun v s'
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..<s}) s' = GS_rec_fun v s'

goal (1 subgoal):
 1. \<And>s'. s \<le> s' \<Longrightarrow> foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..<s}) s' = v s'
[PROOF STEP]
qed (auto intro: foldl_upd_notin)
[PROOF STATE]
proof (state)
this:
GS_rec_iter (foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..<s})) s = GS_rec_fun v s

goal (1 subgoal):
 1. \<And>x. (\<And>y. y < x \<Longrightarrow> GS_rec_fun v y = foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..y}) y) \<Longrightarrow> GS_rec_fun v x = foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..x}) x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..s}) s = GS_rec_fun v s
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..s}) s = GS_rec_fun v s

goal (1 subgoal):
 1. GS_rec_fun v s = foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..s}) s
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
GS_rec_fun v s = foldl (\<lambda>v s. v(s := GS_rec_iter v s)) v (sorted_list_of_set {..s}) s

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nat_abs_summable_on_comparison_test:
  fixes f :: "nat \<Rightarrow> 'a :: {banach, second_countable_topology}"
  assumes "g abs_summable_on I"
  assumes "\<And>n. \<lbrakk>n\<ge>N; n \<in> I\<rbrakk> \<Longrightarrow> norm (f n) \<le> g n"
  shows   "f abs_summable_on I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f abs_summable_on I
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
g abs_summable_on I
\<lbrakk>N \<le> ?n; ?n \<in> I\<rbrakk> \<Longrightarrow> norm (f ?n) \<le> g ?n

goal (1 subgoal):
 1. f abs_summable_on I
[PROOF STEP]
by (fastforce simp add: abs_summable_on_nat_iff intro: summable_comparison_test')


[STATEMENT]
lemma add_less_abs_positive_iff:
  fixes a b :: real
  assumes "abs b < abs a"
  shows "a + b > 0 \<longleftrightarrow> a > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 < a + b) = (0 < a)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<bar>b\<bar> < \<bar>a\<bar>

goal (1 subgoal):
 1. (0 < a + b) = (0 < a)
[PROOF STEP]
by auto


[STATEMENT]
lemma vector_all_zero_from_index3:
  fixes A::"'a::{bezout_ring}^'cols::{mod_type}^'rows::{mod_type}"
  shows "(\<exists>m>i. A $ m $ k \<noteq> 0)
  = (\<not> vector_all_zero_from_index (to_nat i + 1, vec_to_iarray (column k A)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>m>i. A $ m $ k \<noteq> (0::'a)) = (\<not> vector_all_zero_from_index (mod_type_class.to_nat i + 1, vec_to_iarray (column k A)))
[PROOF STEP]
using matrix_vector_all_zero_from_index2
[PROOF STATE]
proof (prove)
using this:
(\<forall>m>?i. ?A $ m $ ?k = (0::?'a)) = vector_all_zero_from_index (mod_type_class.to_nat ?i + 1, vec_to_iarray (column ?k ?A))

goal (1 subgoal):
 1. (\<exists>m>i. A $ m $ k \<noteq> (0::'a)) = (\<not> vector_all_zero_from_index (mod_type_class.to_nat i + 1, vec_to_iarray (column k A)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>i A k. (\<forall>m>i. A $ m $ k = (0::?'a)) = vector_all_zero_from_index (mod_type_class.to_nat i + 1, vec_to_iarray (column k A))) \<Longrightarrow> (\<exists>m>i. A $ m $ k \<noteq> (0::'a)) = (\<not> vector_all_zero_from_index (mod_type_class.to_nat i + 1, vec_to_iarray (column k A)))
[PROOF STEP]
have "(\<forall>m>i. A $ m $ k = 0) = (vector_all_zero_from_index (to_nat i + 1, vec_to_iarray (column k A)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>m>i. A $ m $ k = (0::'a)) = vector_all_zero_from_index (mod_type_class.to_nat i + 1, vec_to_iarray (column k A))
[PROOF STEP]
using matrix_vector_all_zero_from_index2[of i A k]
[PROOF STATE]
proof (prove)
using this:
(\<forall>m>i. A $ m $ k = (0::'a)) = vector_all_zero_from_index (mod_type_class.to_nat i + 1, vec_to_iarray (column k A))

goal (1 subgoal):
 1. (\<forall>m>i. A $ m $ k = (0::'a)) = vector_all_zero_from_index (mod_type_class.to_nat i + 1, vec_to_iarray (column k A))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<forall>m>i. A $ m $ k = (0::'a)) = vector_all_zero_from_index (mod_type_class.to_nat i + 1, vec_to_iarray (column k A))

goal (1 subgoal):
 1. (\<And>i A k. (\<forall>m>i. A $ m $ k = (0::?'a)) = vector_all_zero_from_index (mod_type_class.to_nat i + 1, vec_to_iarray (column k A))) \<Longrightarrow> (\<exists>m>i. A $ m $ k \<noteq> (0::'a)) = (\<not> vector_all_zero_from_index (mod_type_class.to_nat i + 1, vec_to_iarray (column k A)))
[PROOF STEP]
hence "(\<not> (\<forall>m>i. A $ m $ k = 0))
    = (\<not>(vector_all_zero_from_index (to_nat i + 1, vec_to_iarray (column k A))))"
[PROOF STATE]
proof (prove)
using this:
(\<forall>m>i. A $ m $ k = (0::'a)) = vector_all_zero_from_index (mod_type_class.to_nat i + 1, vec_to_iarray (column k A))

goal (1 subgoal):
 1. (\<not> (\<forall>m>i. A $ m $ k = (0::'a))) = (\<not> vector_all_zero_from_index (mod_type_class.to_nat i + 1, vec_to_iarray (column k A)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<not> (\<forall>m>i. A $ m $ k = (0::'a))) = (\<not> vector_all_zero_from_index (mod_type_class.to_nat i + 1, vec_to_iarray (column k A)))

goal (1 subgoal):
 1. (\<And>i A k. (\<forall>m>i. A $ m $ k = (0::?'a)) = vector_all_zero_from_index (mod_type_class.to_nat i + 1, vec_to_iarray (column k A))) \<Longrightarrow> (\<exists>m>i. A $ m $ k \<noteq> (0::'a)) = (\<not> vector_all_zero_from_index (mod_type_class.to_nat i + 1, vec_to_iarray (column k A)))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<not> (\<forall>m>i. A $ m $ k = (0::'a))) = (\<not> vector_all_zero_from_index (mod_type_class.to_nat i + 1, vec_to_iarray (column k A)))

goal (1 subgoal):
 1. (\<exists>m>i. A $ m $ k \<noteq> (0::'a)) = (\<not> vector_all_zero_from_index (mod_type_class.to_nat i + 1, vec_to_iarray (column k A)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<exists>m>i. A $ m $ k \<noteq> (0::'a)) = (\<not> vector_all_zero_from_index (mod_type_class.to_nat i + 1, vec_to_iarray (column k A)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nonempty_InternalNatSet_has_least: "S \<in> InternalSets \<Longrightarrow> S \<noteq> {} \<Longrightarrow> \<exists>n \<in> S. \<forall>m \<in> S. n \<le> m"
  for S :: "hypnat set"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S \<in> InternalSets; S \<noteq> {}\<rbrakk> \<Longrightarrow> \<exists>n\<in>S. \<forall>m\<in>S. n \<le> m
[PROOF STEP]
by (force simp add: InternalSets_def starset_n_def dest!: nonempty_set_star_has_least)


[STATEMENT]
lemma gcd_pos_int [simp]: "gcd m n > 0 \<longleftrightarrow> m \<noteq> 0 \<or> n \<noteq> 0"
  for m n :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 < gcd m n) = (m \<noteq> 0 \<or> n \<noteq> 0)
[PROOF STEP]
using gcd_eq_0_iff [of m n] gcd_ge_0_int [of m n]
[PROOF STATE]
proof (prove)
using this:
(gcd m n = 0) = (m = 0 \<and> n = 0)
0 \<le> gcd m n

goal (1 subgoal):
 1. (0 < gcd m n) = (m \<noteq> 0 \<or> n \<noteq> 0)
[PROOF STEP]
by arith


[STATEMENT]
lemma vec_of_basis_enum_minus:
  "vec_of_basis_enum (b1 - b2) = vec_of_basis_enum b1 - vec_of_basis_enum b2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_of_basis_enum (b1 - b2) = vec_of_basis_enum b1 - vec_of_basis_enum b2
[PROOF STEP]
by (metis (mono_tags, opaque_lifting) carrier_vec_dim_vec diff_conv_add_uminus diff_zero index_add_vec(2) minus_add_uminus_vec vec_of_basis_enum_add vec_of_basis_enum_uminus)


[STATEMENT]
lemma doubleton_eq_iff: "set {a,b} = set {c,d} \<longleftrightarrow> (a=c \<and> b=d) \<or> (a=d \<and> b=c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (set {a, b} = set {c, d}) = (a = c \<and> b = d \<or> a = d \<and> b = c)
[PROOF STEP]
by (simp add: Set.doubleton_eq_iff)


[STATEMENT]
lemma well_related_extend:
  fixes r (infix "\<sqsubseteq>" 50)
  assumes "well_related_set A (\<sqsubseteq>)" and "well_related_set B (\<sqsubseteq>)" and "\<forall>a \<in> A. \<forall>b \<in> B. a \<sqsubseteq> b"
  shows "well_related_set (A \<union> B) (\<sqsubseteq>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. well_related_set (A \<union> B) (\<sqsubseteq>)
[PROOF STEP]
using well_founded_extend[of _ "\<lambda>x y. \<not> y \<sqsubseteq> x", folded well_related_iff_neg_well_founded]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>well_related_set ?A (\<sqsubseteq>); well_related_set ?B (\<sqsubseteq>); \<forall>a\<in>?A. \<forall>b\<in>?B. \<not> \<not> a \<sqsubseteq> b\<rbrakk> \<Longrightarrow> well_related_set (?A \<union> ?B) (\<sqsubseteq>)

goal (1 subgoal):
 1. well_related_set (A \<union> B) (\<sqsubseteq>)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>well_related_set ?A (\<sqsubseteq>); well_related_set ?B (\<sqsubseteq>); \<forall>a\<in>?A. \<forall>b\<in>?B. \<not> \<not> a \<sqsubseteq> b\<rbrakk> \<Longrightarrow> well_related_set (?A \<union> ?B) (\<sqsubseteq>)
well_related_set A (\<sqsubseteq>)
well_related_set B (\<sqsubseteq>)
\<forall>a\<in>A. \<forall>b\<in>B. a \<sqsubseteq> b

goal (1 subgoal):
 1. well_related_set (A \<union> B) (\<sqsubseteq>)
[PROOF STEP]
by auto


[STATEMENT]
lemma pp_total_linorder_matrix_2:
  fixes f :: "('a::finite,'b::linorder_stone_relation_algebra_expansion) square"
  assumes "\<forall>i . \<exists>j . f (i,j) \<noteq> bot"
    shows "\<ominus>(f \<odot> mtop) = mbot"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_p_algebra.dense (f \<odot> mtop)
[PROOF STEP]
proof (rule ext, rule prod_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x a b. (\<ominus> (f \<odot> mtop)) (a, b) = mbot (a, b)
[PROOF STEP]
fix i j
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x a b. (\<ominus> (f \<odot> mtop)) (a, b) = mbot (a, b)
[PROOF STEP]
have "(\<ominus>(f \<odot> mtop)) (i,j) = -(\<Squnion>\<^sub>k f (i,k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<ominus> (f \<odot> mtop)) (i, j) = - sup_monoid.sum (\<lambda>k. f (i, k)) {k. True}
[PROOF STEP]
by (simp add: comp_top_linorder_matrix uminus_matrix_def)
[PROOF STATE]
proof (state)
this:
(\<ominus> (f \<odot> mtop)) (i, j) = - sup_monoid.sum (\<lambda>k. f (i, k)) {k. True}

goal (1 subgoal):
 1. \<And>x a b. (\<ominus> (f \<odot> mtop)) (a, b) = mbot (a, b)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<ominus> (f \<odot> mtop)) (i, j) = - sup_monoid.sum (\<lambda>k. f (i, k)) {k. True}

goal (1 subgoal):
 1. \<And>x a b. (\<ominus> (f \<odot> mtop)) (a, b) = mbot (a, b)
[PROOF STEP]
have "... = bot"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dense (sup_monoid.sum (\<lambda>k. f (i, k)) {k. True})
[PROOF STEP]
by (metis antisym assms bot.extremum comp_inf.ub_sum uminus_def)
[PROOF STATE]
proof (state)
this:
dense (sup_monoid.sum (\<lambda>k. f (i, k)) {k. True})

goal (1 subgoal):
 1. \<And>x a b. (\<ominus> (f \<odot> mtop)) (a, b) = mbot (a, b)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<ominus> (f \<odot> mtop)) (i, j) = bot
[PROOF STEP]
show "(\<ominus>(f \<odot> mtop)) (i,j) = mbot (i,j)"
[PROOF STATE]
proof (prove)
using this:
(\<ominus> (f \<odot> mtop)) (i, j) = bot

goal (1 subgoal):
 1. (\<ominus> (f \<odot> mtop)) (i, j) = mbot (i, j)
[PROOF STEP]
by (simp add: bot_matrix_def)
[PROOF STATE]
proof (state)
this:
(\<ominus> (f \<odot> mtop)) (i, j) = mbot (i, j)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma in_ivp_sols_subset:
  "t\<^sub>0 \<in> (U s) \<Longrightarrow> (U s) \<subseteq> (T s) \<Longrightarrow> X \<in> Sols f T S t\<^sub>0 s \<Longrightarrow> X \<in> Sols f U S t\<^sub>0 s "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>t\<^sub>0 \<in> U s; U s \<subseteq> T s; X \<in> Sols f T S t\<^sub>0 s\<rbrakk> \<Longrightarrow> X \<in> Sols f U S t\<^sub>0 s
[PROOF STEP]
apply(rule ivp_solsI)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<lbrakk>t\<^sub>0 \<in> U s; U s \<subseteq> T s; X \<in> Sols f T S t\<^sub>0 s\<rbrakk> \<Longrightarrow>  D X = (\<lambda>t. f t (X t)) on U s
 2. \<lbrakk>t\<^sub>0 \<in> U s; U s \<subseteq> T s; X \<in> Sols f T S t\<^sub>0 s\<rbrakk> \<Longrightarrow> X t\<^sub>0 = s
 3. \<lbrakk>t\<^sub>0 \<in> U s; U s \<subseteq> T s; X \<in> Sols f T S t\<^sub>0 s\<rbrakk> \<Longrightarrow> X \<in> U s \<rightarrow> S
 4. \<lbrakk>t\<^sub>0 \<in> U s; U s \<subseteq> T s; X \<in> Sols f T S t\<^sub>0 s\<rbrakk> \<Longrightarrow> t\<^sub>0 \<in> U s
[PROOF STEP]
using ivp_solsD(1,2) has_vderiv_on_subset
[PROOF STATE]
proof (prove)
using this:
?X \<in> Sols ?f ?U ?S ?t\<^sub>0 ?s \<Longrightarrow>  D ?X = (\<lambda>t. ?f t (?X t)) on ?U ?s
?X \<in> Sols ?f ?U ?S ?t\<^sub>0 ?s \<Longrightarrow> ?X ?t\<^sub>0 = ?s
\<lbrakk> D ?f = ?f' on ?S; ?T \<subseteq> ?S\<rbrakk> \<Longrightarrow>  D ?f = ?f' on ?T

goal (4 subgoals):
 1. \<lbrakk>t\<^sub>0 \<in> U s; U s \<subseteq> T s; X \<in> Sols f T S t\<^sub>0 s\<rbrakk> \<Longrightarrow>  D X = (\<lambda>t. f t (X t)) on U s
 2. \<lbrakk>t\<^sub>0 \<in> U s; U s \<subseteq> T s; X \<in> Sols f T S t\<^sub>0 s\<rbrakk> \<Longrightarrow> X t\<^sub>0 = s
 3. \<lbrakk>t\<^sub>0 \<in> U s; U s \<subseteq> T s; X \<in> Sols f T S t\<^sub>0 s\<rbrakk> \<Longrightarrow> X \<in> U s \<rightarrow> S
 4. \<lbrakk>t\<^sub>0 \<in> U s; U s \<subseteq> T s; X \<in> Sols f T S t\<^sub>0 s\<rbrakk> \<Longrightarrow> t\<^sub>0 \<in> U s
[PROOF STEP]
apply blast+
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>t\<^sub>0 \<in> U s; U s \<subseteq> T s; X \<in> Sols f T S t\<^sub>0 s\<rbrakk> \<Longrightarrow> X \<in> U s \<rightarrow> S
 2. \<lbrakk>t\<^sub>0 \<in> U s; U s \<subseteq> T s; X \<in> Sols f T S t\<^sub>0 s\<rbrakk> \<Longrightarrow> t\<^sub>0 \<in> U s
[PROOF STEP]
by (drule ivp_solsD(3)) auto


[STATEMENT]
lemma invertible_matrix_mult_right_rank':
  fixes A::"'a::{field}^'n::{mod_type}^'m::{mod_type}"
  and Q::"'a::{field}^'n::{mod_type}^'n::{mod_type}"
  assumes invertible_Q: "invertible Q" and B_eq_PA: "B=A**Q"
  shows "rank B = rank A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rank B = rank A
[PROOF STEP]
by (metis B_eq_PA invertible_Q invertible_matrix_mult_right_rank)


[STATEMENT]
lemma pdevs_val_minus: "pdevs_val (\<lambda>i. e i - f i) xs = pdevs_val e xs - pdevs_val f xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pdevs_val (\<lambda>i. e i - f i) xs = pdevs_val e xs - pdevs_val f xs
[PROOF STEP]
by (auto simp: pdevs_val_pdevs_domain algebra_simps sum_subtractf)


[STATEMENT]
lemma sorted_list_of_set_UN_atMost:
  fixes k::nat
  assumes "strict_mono_sets {..k} A" and "\<And>i. i \<le> k \<Longrightarrow> finite (A i)"
  shows "sorted_list_of_set (\<Union>i\<le>k. A i) = concat (map (sorted_list_of_set \<circ> A) (sorted_list_of_set {..k}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted_list_of_set (\<Union> (A ` {..k})) = concat (map (sorted_list_of_set \<circ> A) (sorted_list_of_set {..k}))
[PROOF STEP]
by (metis assms lessThan_Suc_atMost less_Suc_eq_le sorted_list_of_set_UN_lessThan)


[STATEMENT]
lemma image_TimesA: "(\<lambda>(x, y). (f x, g y)) ` (A \<times> B) = (f ` A) \<times> (g ` B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>(x, y). (f x, g y)) ` (A \<times> B) = f ` A \<times> g ` B
[PROOF STEP]
by (metis map_prod_def map_prod_surj_on)


[STATEMENT]
lemma neighbourhood_base_of_open_subset:
   "\<lbrakk>neighbourhood_base_of P X; openin X S\<rbrakk>
        \<Longrightarrow> neighbourhood_base_of P (subtopology X S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>neighbourhood_base_of P X; openin X S\<rbrakk> \<Longrightarrow> neighbourhood_base_of P (subtopology X S)
[PROOF STEP]
apply (clarsimp simp add: neighbourhood_base_of openin_subtopology_alt image_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>\<forall>W x. openin X W \<and> x \<in> W \<longrightarrow> (\<exists>U. openin X U \<and> (\<exists>V. P V \<and> x \<in> U \<and> U \<subseteq> V \<and> V \<subseteq> W)); openin X S; openin X xa; x \<in> S; x \<in> xa\<rbrakk> \<Longrightarrow> \<exists>U. (\<exists>x. openin X x \<and> U = S \<inter> x) \<and> (\<exists>V. P V \<and> x \<in> U \<and> U \<subseteq> V \<and> V \<subseteq> S \<and> V \<subseteq> xa)
[PROOF STEP]
apply (rename_tac x V)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x V. \<lbrakk>\<forall>W x. openin X W \<and> x \<in> W \<longrightarrow> (\<exists>U. openin X U \<and> (\<exists>V. P V \<and> x \<in> U \<and> U \<subseteq> V \<and> V \<subseteq> W)); openin X S; openin X V; x \<in> S; x \<in> V\<rbrakk> \<Longrightarrow> \<exists>U. (\<exists>x. openin X x \<and> U = S \<inter> x) \<and> (\<exists>Va. P Va \<and> x \<in> U \<and> U \<subseteq> Va \<and> Va \<subseteq> S \<and> Va \<subseteq> V)
[PROOF STEP]
apply (drule_tac x="S \<inter> V" in spec)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x V. \<lbrakk>openin X S; openin X V; x \<in> S; x \<in> V; \<forall>x. openin X (S \<inter> V) \<and> x \<in> S \<inter> V \<longrightarrow> (\<exists>U. openin X U \<and> (\<exists>Va. P Va \<and> x \<in> U \<and> U \<subseteq> Va \<and> Va \<subseteq> S \<inter> V))\<rbrakk> \<Longrightarrow> \<exists>U. (\<exists>x. openin X x \<and> U = S \<inter> x) \<and> (\<exists>Va. P Va \<and> x \<in> U \<and> U \<subseteq> Va \<and> Va \<subseteq> S \<and> Va \<subseteq> V)
[PROOF STEP]
apply (simp add: Int_ac)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x V. \<lbrakk>openin X S; openin X V; x \<in> S; x \<in> V; \<forall>x. openin X (V \<inter> S) \<and> x \<in> V \<and> x \<in> S \<longrightarrow> (\<exists>U. openin X U \<and> (\<exists>Va. P Va \<and> x \<in> U \<and> U \<subseteq> Va \<and> Va \<subseteq> V \<and> Va \<subseteq> S))\<rbrakk> \<Longrightarrow> \<exists>U. (\<exists>x. openin X x \<and> U = x \<inter> S) \<and> (\<exists>Va. P Va \<and> x \<in> U \<and> U \<subseteq> Va \<and> Va \<subseteq> S \<and> Va \<subseteq> V)
[PROOF STEP]
by (metis IntI le_infI1 openin_Int)


[STATEMENT]
lemma zero_spaceN_add:
  assumes "x \<in> zero_space\<^sub>N N" "y \<in> zero_space\<^sub>N N"
  shows "x + y \<in> zero_space\<^sub>N N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x + y \<in> zero_space\<^sub>N N
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x + y \<in> zero_space\<^sub>N N
[PROOF STEP]
have "eNorm N x = 0" "eNorm N y = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eNorm N x = 0 &&& eNorm N y = 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in> zero_space\<^sub>N N
y \<in> zero_space\<^sub>N N

goal (1 subgoal):
 1. eNorm N x = 0 &&& eNorm N y = 0
[PROOF STEP]
unfolding zero_space\<^sub>N_def
[PROOF STATE]
proof (prove)
using this:
x \<in> {f. eNorm N f = 0}
y \<in> {f. eNorm N f = 0}

goal (1 subgoal):
 1. eNorm N x = 0 &&& eNorm N y = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
eNorm N x = 0
eNorm N y = 0

goal (1 subgoal):
 1. x + y \<in> zero_space\<^sub>N N
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
eNorm N x = 0
eNorm N y = 0
[PROOF STEP]
have "defect N * eNorm N x + defect N * eNorm N y = 0"
[PROOF STATE]
proof (prove)
using this:
eNorm N x = 0
eNorm N y = 0

goal (1 subgoal):
 1. ennreal (defect N) * eNorm N x + ennreal (defect N) * eNorm N y = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ennreal (defect N) * eNorm N x + ennreal (defect N) * eNorm N y = 0

goal (1 subgoal):
 1. x + y \<in> zero_space\<^sub>N N
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ennreal (defect N) * eNorm N x + ennreal (defect N) * eNorm N y = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ennreal (defect N) * eNorm N x + ennreal (defect N) * eNorm N y = 0

goal (1 subgoal):
 1. x + y \<in> zero_space\<^sub>N N
[PROOF STEP]
unfolding zero_spaceN_iff
[PROOF STATE]
proof (prove)
using this:
ennreal (defect N) * eNorm N x + ennreal (defect N) * eNorm N y = 0

goal (1 subgoal):
 1. eNorm N (x + y) = 0
[PROOF STEP]
using eNorm_triangular_ineq[of N x y]
[PROOF STATE]
proof (prove)
using this:
ennreal (defect N) * eNorm N x + ennreal (defect N) * eNorm N y = 0
eNorm N (x + y) \<le> ennreal (defect N) * eNorm N x + ennreal (defect N) * eNorm N y

goal (1 subgoal):
 1. eNorm N (x + y) = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x + y \<in> zero_space\<^sub>N N

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma poly_pos_between_leq_less:
  "(\<forall>x. a \<le> x \<and> x < b \<longrightarrow> poly p x > 0) \<longleftrightarrow>
   ((a \<ge> b \<or> (p \<noteq> 0 \<and> poly p a > 0 \<and> count_roots_between p a b =
        (if a < b \<and> poly p b = 0 then 1 else 0))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. a \<le> x \<and> x < b \<longrightarrow> 0 < poly p x) = (b \<le> a \<or> p \<noteq> 0 \<and> 0 < poly p a \<and> count_roots_between p a b = (if a < b \<and> poly p b = 0 then 1 else 0))
[PROOF STEP]
by (simp only: poly_pos_between_leq_less Let_def
                poly_no_roots_leq_less, force)


[STATEMENT]
lemma bigo_mult8: "\<forall>x. f x \<noteq> 0 \<Longrightarrow> O(f * g) = O(f) * O(g)"
  for f :: "'a \<Rightarrow> 'b::linordered_field"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. f x \<noteq> (0::'b) \<Longrightarrow> O(f * g) = O(f) * O(g)
[PROOF STEP]
apply (rule equalityI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>x. f x \<noteq> (0::'b) \<Longrightarrow> O(f * g) \<subseteq> O(f) * O(g)
 2. \<forall>x. f x \<noteq> (0::'b) \<Longrightarrow> O(f) * O(g) \<subseteq> O(f * g)
[PROOF STEP]
apply (erule bigo_mult7)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. f x \<noteq> (0::'b) \<Longrightarrow> O(f) * O(g) \<subseteq> O(f * g)
[PROOF STEP]
apply (rule bigo_mult)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma sin_cos_le1: "\<bar>sin x * sin y + cos x * cos y\<bar> \<le> 1"
  for x :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>sin x * sin y + cos x * cos y\<bar> \<le> 1
[PROOF STEP]
using cos_diff [of x y]
[PROOF STATE]
proof (prove)
using this:
cos (x - y) = cos x * cos y + sin x * sin y

goal (1 subgoal):
 1. \<bar>sin x * sin y + cos x * cos y\<bar> \<le> 1
[PROOF STEP]
by (metis abs_cos_le_one add.commute)


[STATEMENT]
lemma invertible_matrix'_imp_invertible_lf:
fixes f:: "'a::{field}^'b \<Rightarrow> 'a^'b"
  assumes "invertible (matrix' X Y f)"  and basis_X: "is_basis (set_of_vector X)"
  and linear_f: "linear ((*s)) ((*s)) f" and basis_Y: "is_basis (set_of_vector Y)"
  shows "invertible_lf ((*s)) ((*s)) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invertible_lf (*s) (*s) f
[PROOF STEP]
unfolding invertible_matrix_iff_invertible_lf'[OF linear_f, symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invertible (matrix f)
[PROOF STEP]
by (metis assms(1) basis_X basis_Y id_o invertible_matrix_change_of_basis
     invertible_mult is_basis_cart_basis' linear_f vec.linear_id
    matrix'_compose matrix'_eq_matrix matrix'_id_eq_matrix_change_of_basis matrix'_matrix_change_of_basis)


[STATEMENT]
lemma subset_continuous_image_segment_1:
  fixes f :: "'a::euclidean_space \<Rightarrow> real"
  assumes "continuous_on (closed_segment a b) f"
  shows "closed_segment (f a) (f b) \<subseteq> image f (closed_segment a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed_segment (f a) (f b) \<subseteq> f ` closed_segment a b
[PROOF STEP]
by (metis connected_segment convex_contains_segment ends_in_segment imageI
           is_interval_connected_1 is_interval_convex connected_continuous_image [OF assms])


[STATEMENT]
lemma continuous_on_prod' [continuous_intros]:
  fixes f :: "'a \<Rightarrow> 'b::topological_space \<Rightarrow> 'c::topological_comm_monoid_mult"
  shows "(\<And>i. i \<in> I \<Longrightarrow> continuous_on S (f i)) \<Longrightarrow> continuous_on S (\<lambda>x. \<Prod>i\<in>I. f i x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. i \<in> I \<Longrightarrow> continuous_on S (f i)) \<Longrightarrow> continuous_on S (\<lambda>x. \<Prod>i\<in>I. f i x)
[PROOF STEP]
unfolding continuous_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. i \<in> I \<Longrightarrow> \<forall>x\<in>S. (f i \<longlongrightarrow> f i x) (at x within S)) \<Longrightarrow> \<forall>x\<in>S. ((\<lambda>x. \<Prod>i\<in>I. f i x) \<longlongrightarrow> (\<Prod>i\<in>I. f i x)) (at x within S)
[PROOF STEP]
by (auto intro: tendsto_prod')


[STATEMENT]
lemma Dirichlet_kernel_cosine_sum:
  assumes "\<bar>x\<bar> < 2 * pi"
  shows "Dirichlet_kernel n x = 1/2 + (\<Sum>k = Suc 0..n. cos(real k * x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Dirichlet_kernel n x = 1 / 2 + (\<Sum>k = Suc 0..n. cos (real k * x))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Dirichlet_kernel n x = 1 / 2 + (\<Sum>k = Suc 0..n. cos (real k * x))
[PROOF STEP]
have "sin ((real n + 1/2) * x) / (2 * sin (x/2)) = 1/2 + (\<Sum>k = Suc 0..n. cos (real k * x))"
    if "x \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sin ((real n + 1 / 2) * x) / (2 * sin (x / 2)) = 1 / 2 + (\<Sum>k = Suc 0..n. cos (real k * x))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sin ((real n + 1 / 2) * x) / (2 * sin (x / 2)) = 1 / 2 + (\<Sum>k = Suc 0..n. cos (real k * x))
[PROOF STEP]
have "sin(x/2) \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sin (x / 2) \<noteq> 0
[PROOF STEP]
using assms that
[PROOF STATE]
proof (prove)
using this:
\<bar>x\<bar> < 2 * pi
x \<noteq> 0

goal (1 subgoal):
 1. sin (x / 2) \<noteq> 0
[PROOF STEP]
by (auto simp: sin_zero_iff)
[PROOF STATE]
proof (state)
this:
sin (x / 2) \<noteq> 0

goal (1 subgoal):
 1. sin ((real n + 1 / 2) * x) / (2 * sin (x / 2)) = 1 / 2 + (\<Sum>k = Suc 0..n. cos (real k * x))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
sin (x / 2) \<noteq> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sin (x / 2) \<noteq> 0

goal (1 subgoal):
 1. sin ((real n + 1 / 2) * x) / (2 * sin (x / 2)) = 1 / 2 + (\<Sum>k = Suc 0..n. cos (real k * x))
[PROOF STEP]
using cosine_sum_lemma [of x n]
[PROOF STATE]
proof (prove)
using this:
sin (x / 2) \<noteq> 0
(1 / 2 + (\<Sum>k = Suc 0..n. cos (real k * x))) * sin (x / 2) = sin ((real n + 1 / 2) * x) / 2

goal (1 subgoal):
 1. sin ((real n + 1 / 2) * x) / (2 * sin (x / 2)) = 1 / 2 + (\<Sum>k = Suc 0..n. cos (real k * x))
[PROOF STEP]
by (simp add: divide_simps)
[PROOF STATE]
proof (state)
this:
sin ((real n + 1 / 2) * x) / (2 * sin (x / 2)) = 1 / 2 + (\<Sum>k = Suc 0..n. cos (real k * x))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<noteq> 0 \<Longrightarrow> sin ((real n + 1 / 2) * x) / (2 * sin (x / 2)) = 1 / 2 + (\<Sum>k = Suc 0..n. cos (real k * x))

goal (1 subgoal):
 1. Dirichlet_kernel n x = 1 / 2 + (\<Sum>k = Suc 0..n. cos (real k * x))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<noteq> 0 \<Longrightarrow> sin ((real n + 1 / 2) * x) / (2 * sin (x / 2)) = 1 / 2 + (\<Sum>k = Suc 0..n. cos (real k * x))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<noteq> 0 \<Longrightarrow> sin ((real n + 1 / 2) * x) / (2 * sin (x / 2)) = 1 / 2 + (\<Sum>k = Suc 0..n. cos (real k * x))

goal (1 subgoal):
 1. Dirichlet_kernel n x = 1 / 2 + (\<Sum>k = Suc 0..n. cos (real k * x))
[PROOF STEP]
by (auto simp: Dirichlet_kernel_def)
[PROOF STATE]
proof (state)
this:
Dirichlet_kernel n x = 1 / 2 + (\<Sum>k = Suc 0..n. cos (real k * x))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma length_remove_nth:
  assumes "i < length xs"
  shows "length (remove_nth i xs) = length xs - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (remove_nth i xs) = length xs - 1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
i < length xs

goal (1 subgoal):
 1. length (remove_nth i xs) = length xs - 1
[PROOF STEP]
unfolding remove_nth_take_drop
[PROOF STATE]
proof (prove)
using this:
i < length xs

goal (1 subgoal):
 1. length (take i xs @ drop (Suc i) xs) = length xs - 1
[PROOF STEP]
by simp


[STATEMENT]
lemma gbinomial_int_plus_le:
  assumes "0 < k" and "0 \<le> x" and "0 \<le> (y::int)"
  shows "(x gchoose k) + (y gchoose k) \<le> (x + y) gchoose k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x gchoose k + (y gchoose k) \<le> x + y gchoose k
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x gchoose k + (y gchoose k) \<le> x + y gchoose k
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
0 < k
[PROOF STEP]
have "nat x choose k + (nat y choose k) \<le> nat x + nat y choose k"
[PROOF STATE]
proof (prove)
using this:
0 < k

goal (1 subgoal):
 1. nat x choose k + (nat y choose k) \<le> nat x + nat y choose k
[PROOF STEP]
by (rule binomial_plus_le)
[PROOF STATE]
proof (state)
this:
nat x choose k + (nat y choose k) \<le> nat x + nat y choose k

goal (1 subgoal):
 1. x gchoose k + (y gchoose k) \<le> x + y gchoose k
[PROOF STEP]
hence "int (nat x choose k + (nat y choose k)) \<le> int (nat x + nat y choose k)"
[PROOF STATE]
proof (prove)
using this:
nat x choose k + (nat y choose k) \<le> nat x + nat y choose k

goal (1 subgoal):
 1. int (nat x choose k + (nat y choose k)) \<le> int (nat x + nat y choose k)
[PROOF STEP]
by (simp only: zle_int)
[PROOF STATE]
proof (state)
this:
int (nat x choose k + (nat y choose k)) \<le> int (nat x + nat y choose k)

goal (1 subgoal):
 1. x gchoose k + (y gchoose k) \<le> x + y gchoose k
[PROOF STEP]
hence "int (nat x) gchoose k + (int (nat y) gchoose k) \<le> int (nat x) + int (nat y) gchoose k"
[PROOF STATE]
proof (prove)
using this:
int (nat x choose k + (nat y choose k)) \<le> int (nat x + nat y choose k)

goal (1 subgoal):
 1. int (nat x) gchoose k + (int (nat y) gchoose k) \<le> int (nat x) + int (nat y) gchoose k
[PROOF STEP]
by (simp only: int_plus int_binomial)
[PROOF STATE]
proof (state)
this:
int (nat x) gchoose k + (int (nat y) gchoose k) \<le> int (nat x) + int (nat y) gchoose k

goal (1 subgoal):
 1. x gchoose k + (y gchoose k) \<le> x + y gchoose k
[PROOF STEP]
with assms(2, 3)
[PROOF STATE]
proof (chain)
picking this:
0 \<le> x
0 \<le> y
int (nat x) gchoose k + (int (nat y) gchoose k) \<le> int (nat x) + int (nat y) gchoose k
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 \<le> x
0 \<le> y
int (nat x) gchoose k + (int (nat y) gchoose k) \<le> int (nat x) + int (nat y) gchoose k

goal (1 subgoal):
 1. x gchoose k + (y gchoose k) \<le> x + y gchoose k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x gchoose k + (y gchoose k) \<le> x + y gchoose k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma minus_add_minus_vec: fixes u :: "'a :: ab_group_add vec"
  assumes "u \<in> carrier_vec n" "v \<in> carrier_vec n" "w \<in> carrier_vec n"
  shows "u - (v + w) = u - v - w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u - (v + w) = u - v - w
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
u \<in> carrier_vec n
v \<in> carrier_vec n
w \<in> carrier_vec n

goal (1 subgoal):
 1. u - (v + w) = u - v - w
[PROOF STEP]
by auto


[STATEMENT]
lemma ceiling_diff_of_int [simp]: "\<lceil>x - of_int z\<rceil> = \<lceil>x\<rceil> - z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lceil>x - of_int z\<rceil> = \<lceil>x\<rceil> - z
[PROOF STEP]
using ceiling_add_of_int [of x "- z"]
[PROOF STATE]
proof (prove)
using this:
\<lceil>x + of_int (- z)\<rceil> = \<lceil>x\<rceil> + - z

goal (1 subgoal):
 1. \<lceil>x - of_int z\<rceil> = \<lceil>x\<rceil> - z
[PROOF STEP]
by (simp add: algebra_simps)


[STATEMENT]
theorem rank_nullity_theorem:
  assumes l: "Vector_Spaces.linear scale scaleC f"
  shows "dimension = dim {x. f x = 0} + vector_space.dim scaleC (range f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.dimension = local.dim {x. f x = (0::'c)} + vector_space.dim scaleC (range f)
[PROOF STEP]
proof -
  \<comment> \<open>For convenience we define abbreviations for the universe set, $V$,
    and the kernel of $f$\<close>
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. local.dimension = local.dim {x. f x = (0::'c)} + vector_space.dim scaleC (range f)
[PROOF STEP]
interpret l: Vector_Spaces.linear scale scaleC f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. linear (*s) scaleC f
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. local.dimension = local.dim {x. f x = (0::'c)} + l.vs2.dim (range f)
[PROOF STEP]
define V :: "'b set" where "V = UNIV"
[PROOF STATE]
proof (state)
this:
V = UNIV

goal (1 subgoal):
 1. local.dimension = local.dim {x. f x = (0::'c)} + l.vs2.dim (range f)
[PROOF STEP]
define ker_f where "ker_f = {x. f x = 0}"
  \<comment> \<open>The kernel is a proper subspace:\<close>
[PROOF STATE]
proof (state)
this:
ker_f = {x. f x = (0::'c)}

goal (1 subgoal):
 1. local.dimension = local.dim {x. f x = (0::'c)} + l.vs2.dim (range f)
[PROOF STEP]
have sub_ker: "subspace {x. f x = 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.subspace {x. f x = (0::'c)}
[PROOF STEP]
using l.subspace_kernel
[PROOF STATE]
proof (prove)
using this:
local.subspace {x. f x = (0::'c)}

goal (1 subgoal):
 1. local.subspace {x. f x = (0::'c)}
[PROOF STEP]
.
  \<comment> \<open>The kernel has its proper basis, $B$:\<close>
[PROOF STATE]
proof (state)
this:
local.subspace {x. f x = (0::'c)}

goal (1 subgoal):
 1. local.dimension = local.dim {x. f x = (0::'c)} + l.vs2.dim (range f)
[PROOF STEP]
obtain B where B_in_ker: "B \<subseteq> {x. f x = 0}"
    and independent_B: "independent B"
    and ker_in_span:"{x. f x = 0} \<subseteq> span B"
    and card_B: "card B = dim {x. f x = 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>B. \<lbrakk>B \<subseteq> {x. f x = (0::'c)}; local.independent B; {x. f x = (0::'c)} \<subseteq> local.span B; card B = local.dim {x. f x = (0::'c)}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using basis_exists
[PROOF STATE]
proof (prove)
using this:
(\<And>B. \<lbrakk>B \<subseteq> ?V; local.independent B; ?V \<subseteq> local.span B; card B = local.dim ?V\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>B. \<lbrakk>B \<subseteq> {x. f x = (0::'c)}; local.independent B; {x. f x = (0::'c)} \<subseteq> local.span B; card B = local.dim {x. f x = (0::'c)}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
  \<comment> \<open>The space $V$ has a (finite dimensional) basis, $C$:\<close>
[PROOF STATE]
proof (state)
this:
B \<subseteq> {x. f x = (0::'c)}
local.independent B
{x. f x = (0::'c)} \<subseteq> local.span B
card B = local.dim {x. f x = (0::'c)}

goal (1 subgoal):
 1. local.dimension = local.dim {x. f x = (0::'c)} + l.vs2.dim (range f)
[PROOF STEP]
obtain C where B_in_C: "B \<subseteq> C" and C_in_V: "C \<subseteq> V"
    and independent_C: "independent C"
    and span_C: "V = span C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>C. \<lbrakk>B \<subseteq> C; C \<subseteq> V; local.independent C; V = local.span C\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding V_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>C. \<lbrakk>B \<subseteq> C; C \<subseteq> UNIV; local.independent C; UNIV = local.span C\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis independent_B extend_basis_superset independent_extend_basis span_extend_basis span_superset)
  \<comment> \<open>The basis of $V$, $C$, can be decomposed in the disjoint union of the
      basis of the kernel, $B$, and its complementary set, $C - B$\<close>
[PROOF STATE]
proof (state)
this:
B \<subseteq> C
C \<subseteq> V
local.independent C
V = local.span C

goal (1 subgoal):
 1. local.dimension = local.dim {x. f x = (0::'c)} + l.vs2.dim (range f)
[PROOF STEP]
have C_eq: "C = B \<union> (C - B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. C = B \<union> (C - B)
[PROOF STEP]
by (rule Diff_partition [OF B_in_C, symmetric])
[PROOF STATE]
proof (state)
this:
C = B \<union> (C - B)

goal (1 subgoal):
 1. local.dimension = local.dim {x. f x = (0::'c)} + l.vs2.dim (range f)
[PROOF STEP]
have eq_fC: "f ` C = f ` B \<union> f ` (C - B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` C = f ` B \<union> f ` (C - B)
[PROOF STEP]
by (subst C_eq, unfold image_Un, simp)
  \<comment> \<open>The basis $C$, and its image, are finite, since $V$ is finite-dimensional\<close>
[PROOF STATE]
proof (state)
this:
f ` C = f ` B \<union> f ` (C - B)

goal (1 subgoal):
 1. local.dimension = local.dim {x. f x = (0::'c)} + l.vs2.dim (range f)
[PROOF STEP]
have finite_C: "finite C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite C
[PROOF STEP]
using finiteI_independent[OF independent_C]
[PROOF STATE]
proof (prove)
using this:
finite C

goal (1 subgoal):
 1. finite C
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
finite C

goal (1 subgoal):
 1. local.dimension = local.dim {x. f x = (0::'c)} + l.vs2.dim (range f)
[PROOF STEP]
have finite_fC: "finite (f ` C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (f ` C)
[PROOF STEP]
by (rule finite_imageI [OF finite_C])
  \<comment> \<open>The basis $B$ of the kernel of $f$, and its image, are also finite\<close>
[PROOF STATE]
proof (state)
this:
finite (f ` C)

goal (1 subgoal):
 1. local.dimension = local.dim {x. f x = (0::'c)} + l.vs2.dim (range f)
[PROOF STEP]
have finite_B: "finite B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite B
[PROOF STEP]
by (rule rev_finite_subset [OF finite_C B_in_C])
[PROOF STATE]
proof (state)
this:
finite B

goal (1 subgoal):
 1. local.dimension = local.dim {x. f x = (0::'c)} + l.vs2.dim (range f)
[PROOF STEP]
have finite_fB: "finite (f ` B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (f ` B)
[PROOF STEP]
by (rule finite_imageI[OF finite_B])
  \<comment> \<open>The set $C - B$ is also finite\<close>
[PROOF STATE]
proof (state)
this:
finite (f ` B)

goal (1 subgoal):
 1. local.dimension = local.dim {x. f x = (0::'c)} + l.vs2.dim (range f)
[PROOF STEP]
have finite_CB: "finite (C - B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (C - B)
[PROOF STEP]
by (rule finite_Diff [OF finite_C, of B])
[PROOF STATE]
proof (state)
this:
finite (C - B)

goal (1 subgoal):
 1. local.dimension = local.dim {x. f x = (0::'c)} + l.vs2.dim (range f)
[PROOF STEP]
have dim_ker_le_dim_V:"dim (ker_f) \<le> dim V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.dim ker_f \<le> local.dim V
[PROOF STEP]
using dim_subset [of ker_f V]
[PROOF STATE]
proof (prove)
using this:
ker_f \<subseteq> V \<Longrightarrow> local.dim ker_f \<le> local.dim V

goal (1 subgoal):
 1. local.dim ker_f \<le> local.dim V
[PROOF STEP]
unfolding V_def
[PROOF STATE]
proof (prove)
using this:
ker_f \<subseteq> UNIV \<Longrightarrow> local.dim ker_f \<le> local.dim UNIV

goal (1 subgoal):
 1. local.dim ker_f \<le> local.dim UNIV
[PROOF STEP]
by simp
  \<comment> \<open>Here it starts the proof of the theorem: the sets $B$ and
      $C - B$ must be proven to be bases, respectively, of the kernel
      of $f$ and its range\<close>
[PROOF STATE]
proof (state)
this:
local.dim ker_f \<le> local.dim V

goal (1 subgoal):
 1. local.dimension = local.dim {x. f x = (0::'c)} + l.vs2.dim (range f)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.dimension = local.dim {x. f x = (0::'c)} + l.vs2.dim (range f)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. local.dimension = local.dim {x. f x = (0::'c)} + l.vs2.dim (range f)
[PROOF STEP]
have "dimension = dim V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.dimension = local.dim V
[PROOF STEP]
unfolding V_def dim_UNIV dimension_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card Basis = card Basis
[PROOF STEP]
by (metis basis_card_eq_dim dimension_def independent_Basis span_Basis top_greatest)
[PROOF STATE]
proof (state)
this:
local.dimension = local.dim V

goal (1 subgoal):
 1. local.dimension = local.dim {x. f x = (0::'c)} + l.vs2.dim (range f)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
local.dimension = local.dim V

goal (1 subgoal):
 1. local.dimension = local.dim {x. f x = (0::'c)} + l.vs2.dim (range f)
[PROOF STEP]
have "dim V = dim C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.dim V = local.dim C
[PROOF STEP]
unfolding span_C dim_span
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.dim C = local.dim C
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
local.dim V = local.dim C

goal (1 subgoal):
 1. local.dimension = local.dim {x. f x = (0::'c)} + l.vs2.dim (range f)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
local.dim V = local.dim C

goal (1 subgoal):
 1. local.dimension = local.dim {x. f x = (0::'c)} + l.vs2.dim (range f)
[PROOF STEP]
have "... = card C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.dim C = card C
[PROOF STEP]
using basis_card_eq_dim [of C C, OF _ span_superset independent_C]
[PROOF STATE]
proof (prove)
using this:
C \<subseteq> C \<Longrightarrow> card C = local.dim C

goal (1 subgoal):
 1. local.dim C = card C
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
local.dim C = card C

goal (1 subgoal):
 1. local.dimension = local.dim {x. f x = (0::'c)} + l.vs2.dim (range f)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
local.dim C = card C

goal (1 subgoal):
 1. local.dimension = local.dim {x. f x = (0::'c)} + l.vs2.dim (range f)
[PROOF STEP]
have "... = card (B \<union> (C - B))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card C = card (B \<union> (C - B))
[PROOF STEP]
using C_eq
[PROOF STATE]
proof (prove)
using this:
C = B \<union> (C - B)

goal (1 subgoal):
 1. card C = card (B \<union> (C - B))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card C = card (B \<union> (C - B))

goal (1 subgoal):
 1. local.dimension = local.dim {x. f x = (0::'c)} + l.vs2.dim (range f)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card C = card (B \<union> (C - B))

goal (1 subgoal):
 1. local.dimension = local.dim {x. f x = (0::'c)} + l.vs2.dim (range f)
[PROOF STEP]
have "... = card B + card (C-B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (B \<union> (C - B)) = card B + card (C - B)
[PROOF STEP]
by (rule card_Un_disjoint[OF finite_B finite_CB], fast)
[PROOF STATE]
proof (state)
this:
card (B \<union> (C - B)) = card B + card (C - B)

goal (1 subgoal):
 1. local.dimension = local.dim {x. f x = (0::'c)} + l.vs2.dim (range f)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card (B \<union> (C - B)) = card B + card (C - B)

goal (1 subgoal):
 1. local.dimension = local.dim {x. f x = (0::'c)} + l.vs2.dim (range f)
[PROOF STEP]
have "... = dim ker_f + card (C-B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card B + card (C - B) = local.dim ker_f + card (C - B)
[PROOF STEP]
unfolding ker_f_def card_B
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.dim {x. f x = (0::'c)} + card (C - B) = local.dim {x. f x = (0::'c)} + card (C - B)
[PROOF STEP]
..
    \<comment> \<open>Now it has to be proved that the elements of $C - B$ are a basis of
      the range of $f$\<close>
[PROOF STATE]
proof (state)
this:
card B + card (C - B) = local.dim ker_f + card (C - B)

goal (1 subgoal):
 1. local.dimension = local.dim {x. f x = (0::'c)} + l.vs2.dim (range f)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card B + card (C - B) = local.dim ker_f + card (C - B)

goal (1 subgoal):
 1. local.dimension = local.dim {x. f x = (0::'c)} + l.vs2.dim (range f)
[PROOF STEP]
have "... = dim ker_f + l.vs2.dim (range f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.dim ker_f + card (C - B) = local.dim ker_f + l.vs2.dim (range f)
[PROOF STEP]
proof (unfold add_left_cancel)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card (C - B) = l.vs2.dim (range f)
[PROOF STEP]
define W where "W = C - B"
[PROOF STATE]
proof (state)
this:
W = C - B

goal (1 subgoal):
 1. card (C - B) = l.vs2.dim (range f)
[PROOF STEP]
have finite_W: "finite W"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite W
[PROOF STEP]
unfolding W_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (C - B)
[PROOF STEP]
using finite_CB
[PROOF STATE]
proof (prove)
using this:
finite (C - B)

goal (1 subgoal):
 1. finite (C - B)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
finite W

goal (1 subgoal):
 1. card (C - B) = l.vs2.dim (range f)
[PROOF STEP]
have finite_fW: "finite (f ` W)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (f ` W)
[PROOF STEP]
using finite_imageI[OF finite_W]
[PROOF STATE]
proof (prove)
using this:
finite (?h ` W)

goal (1 subgoal):
 1. finite (f ` W)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
finite (f ` W)

goal (1 subgoal):
 1. card (C - B) = l.vs2.dim (range f)
[PROOF STEP]
have "card W = card (f ` W)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card W = card (f ` W)
[PROOF STEP]
by (rule card_image [symmetric], rule inj_on_extended[OF l, of C B], rule finite_C)
          (rule independent_C,unfold W_def, subst C_eq, rule refl, simp, rule ker_in_span)
[PROOF STATE]
proof (state)
this:
card W = card (f ` W)

goal (1 subgoal):
 1. card (C - B) = l.vs2.dim (range f)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card W = card (f ` W)

goal (1 subgoal):
 1. card (C - B) = l.vs2.dim (range f)
[PROOF STEP]
have "... = l.vs2.dim (range f)"
        \<comment> \<open>The image set of $W$ is independent and its span contains the range
             of $f$, so it is a basis of the range:\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (f ` W) = l.vs2.dim (range f)
[PROOF STEP]
proof (rule l.vs2.basis_card_eq_dim)
        \<comment> \<open>1. The image set of $W$ generates the range of $f$:\<close>
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. f ` W \<subseteq> range f
 2. range f \<subseteq> l.vs2.span (f ` W)
 3. l.vs2.independent (f ` W)
[PROOF STEP]
show "range f \<subseteq> l.vs2.span (f ` W)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. range f \<subseteq> l.vs2.span (f ` W)
[PROOF STEP]
proof (unfold l.vs2.span_finite [OF finite_fW], auto)
          \<comment> \<open>Given any element $v$ in $V$, its image can be expressed as a
            linear combination of elements of the image by $f$ of $C$:\<close>
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. f xa \<in> range (\<lambda>u. \<Sum>v\<in>f ` W. scaleC (u v) v)
[PROOF STEP]
fix v :: 'b
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. f xa \<in> range (\<lambda>u. \<Sum>v\<in>f ` W. scaleC (u v) v)
[PROOF STEP]
have fV_span: "f ` V \<subseteq> l.vs2.span  (f ` C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` V \<subseteq> l.vs2.span (f ` C)
[PROOF STEP]
by (simp add: span_C l.span_image)
[PROOF STATE]
proof (state)
this:
f ` V \<subseteq> l.vs2.span (f ` C)

goal (1 subgoal):
 1. \<And>xa. f xa \<in> range (\<lambda>u. \<Sum>v\<in>f ` W. scaleC (u v) v)
[PROOF STEP]
have "\<exists>g. (\<Sum>x\<in>f`C. scaleC (g x) x) = f v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>g. (\<Sum>x\<in>f ` C. scaleC (g x) x) = f v
[PROOF STEP]
using fV_span
[PROOF STATE]
proof (prove)
using this:
f ` V \<subseteq> l.vs2.span (f ` C)

goal (1 subgoal):
 1. \<exists>g. (\<Sum>x\<in>f ` C. scaleC (g x) x) = f v
[PROOF STEP]
unfolding V_def
[PROOF STATE]
proof (prove)
using this:
range f \<subseteq> l.vs2.span (f ` C)

goal (1 subgoal):
 1. \<exists>g. (\<Sum>x\<in>f ` C. scaleC (g x) x) = f v
[PROOF STEP]
using l.vs2.span_finite[OF finite_fC]
[PROOF STATE]
proof (prove)
using this:
range f \<subseteq> l.vs2.span (f ` C)
l.vs2.span (f ` C) = range (\<lambda>u. \<Sum>v\<in>f ` C. scaleC (u v) v)

goal (1 subgoal):
 1. \<exists>g. (\<Sum>x\<in>f ` C. scaleC (g x) x) = f v
[PROOF STEP]
by (metis (no_types, lifting) V_def rangeE rangeI span_C l.span_image)
[PROOF STATE]
proof (state)
this:
\<exists>g. (\<Sum>x\<in>f ` C. scaleC (g x) x) = f v

goal (1 subgoal):
 1. \<And>xa. f xa \<in> range (\<lambda>u. \<Sum>v\<in>f ` W. scaleC (u v) v)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>g. (\<Sum>x\<in>f ` C. scaleC (g x) x) = f v
[PROOF STEP]
obtain g where fv: "f v = (\<Sum>x\<in>f ` C. scaleC (g x) x)"
[PROOF STATE]
proof (prove)
using this:
\<exists>g. (\<Sum>x\<in>f ` C. scaleC (g x) x) = f v

goal (1 subgoal):
 1. (\<And>g. f v = (\<Sum>x\<in>f ` C. scaleC (g x) x) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
              \<comment> \<open>We recall that $C$ is equal to $B$ union $(C - B)$, and $B$
            is the basis of the kernel; thus, the image of the elements of
            $B$ will be equal to zero:\<close>
[PROOF STATE]
proof (state)
this:
f v = (\<Sum>x\<in>f ` C. scaleC (g x) x)

goal (1 subgoal):
 1. \<And>xa. f xa \<in> range (\<lambda>u. \<Sum>v\<in>f ` W. scaleC (u v) v)
[PROOF STEP]
have zero_fB: "(\<Sum>x\<in>f ` B. scaleC (g x) x) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>f ` B. scaleC (g x) x) = (0::'c)
[PROOF STEP]
using B_in_ker
[PROOF STATE]
proof (prove)
using this:
B \<subseteq> {x. f x = (0::'c)}

goal (1 subgoal):
 1. (\<Sum>x\<in>f ` B. scaleC (g x) x) = (0::'c)
[PROOF STEP]
by (auto intro!: sum.neutral)
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>f ` B. scaleC (g x) x) = (0::'c)

goal (1 subgoal):
 1. \<And>xa. f xa \<in> range (\<lambda>u. \<Sum>v\<in>f ` W. scaleC (u v) v)
[PROOF STEP]
have zero_inter: "(\<Sum>x\<in>(f ` B \<inter> f ` W). scaleC (g x) x) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>f ` B \<inter> f ` W. scaleC (g x) x) = (0::'c)
[PROOF STEP]
using B_in_ker
[PROOF STATE]
proof (prove)
using this:
B \<subseteq> {x. f x = (0::'c)}

goal (1 subgoal):
 1. (\<Sum>x\<in>f ` B \<inter> f ` W. scaleC (g x) x) = (0::'c)
[PROOF STEP]
by (auto intro!: sum.neutral)
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>f ` B \<inter> f ` W. scaleC (g x) x) = (0::'c)

goal (1 subgoal):
 1. \<And>xa. f xa \<in> range (\<lambda>u. \<Sum>v\<in>f ` W. scaleC (u v) v)
[PROOF STEP]
have "f v = (\<Sum>x\<in>f ` C. scaleC (g x) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f v = (\<Sum>x\<in>f ` C. scaleC (g x) x)
[PROOF STEP]
using fv
[PROOF STATE]
proof (prove)
using this:
f v = (\<Sum>x\<in>f ` C. scaleC (g x) x)

goal (1 subgoal):
 1. f v = (\<Sum>x\<in>f ` C. scaleC (g x) x)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
f v = (\<Sum>x\<in>f ` C. scaleC (g x) x)

goal (1 subgoal):
 1. \<And>xa. f xa \<in> range (\<lambda>u. \<Sum>v\<in>f ` W. scaleC (u v) v)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f v = (\<Sum>x\<in>f ` C. scaleC (g x) x)

goal (1 subgoal):
 1. \<And>xa. f xa \<in> range (\<lambda>u. \<Sum>v\<in>f ` W. scaleC (u v) v)
[PROOF STEP]
have "... = (\<Sum>x\<in>(f ` B \<union> f ` W).  scaleC (g x) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>f ` C. scaleC (g x) x) = (\<Sum>x\<in>f ` B \<union> f ` W. scaleC (g x) x)
[PROOF STEP]
using eq_fC W_def
[PROOF STATE]
proof (prove)
using this:
f ` C = f ` B \<union> f ` (C - B)
W = C - B

goal (1 subgoal):
 1. (\<Sum>x\<in>f ` C. scaleC (g x) x) = (\<Sum>x\<in>f ` B \<union> f ` W. scaleC (g x) x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>f ` C. scaleC (g x) x) = (\<Sum>x\<in>f ` B \<union> f ` W. scaleC (g x) x)

goal (1 subgoal):
 1. \<And>xa. f xa \<in> range (\<lambda>u. \<Sum>v\<in>f ` W. scaleC (u v) v)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>f ` C. scaleC (g x) x) = (\<Sum>x\<in>f ` B \<union> f ` W. scaleC (g x) x)

goal (1 subgoal):
 1. \<And>xa. f xa \<in> range (\<lambda>u. \<Sum>v\<in>f ` W. scaleC (u v) v)
[PROOF STEP]
have "... =
              (\<Sum>x\<in>f ` B. scaleC (g x) x) + (\<Sum>x\<in>f ` W. scaleC (g x) x)
                - (\<Sum>x\<in>(f ` B \<inter> f ` W). scaleC (g x) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>f ` B \<union> f ` W. scaleC (g x) x) = (\<Sum>x\<in>f ` B. scaleC (g x) x) + (\<Sum>x\<in>f ` W. scaleC (g x) x) - (\<Sum>x\<in>f ` B \<inter> f ` W. scaleC (g x) x)
[PROOF STEP]
using sum_Un [OF finite_fB finite_fW]
[PROOF STATE]
proof (prove)
using this:
sum ?f (f ` B \<union> f ` W) = sum ?f (f ` B) + sum ?f (f ` W) - sum ?f (f ` B \<inter> f ` W)

goal (1 subgoal):
 1. (\<Sum>x\<in>f ` B \<union> f ` W. scaleC (g x) x) = (\<Sum>x\<in>f ` B. scaleC (g x) x) + (\<Sum>x\<in>f ` W. scaleC (g x) x) - (\<Sum>x\<in>f ` B \<inter> f ` W. scaleC (g x) x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>f ` B \<union> f ` W. scaleC (g x) x) = (\<Sum>x\<in>f ` B. scaleC (g x) x) + (\<Sum>x\<in>f ` W. scaleC (g x) x) - (\<Sum>x\<in>f ` B \<inter> f ` W. scaleC (g x) x)

goal (1 subgoal):
 1. \<And>xa. f xa \<in> range (\<lambda>u. \<Sum>v\<in>f ` W. scaleC (u v) v)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>f ` B \<union> f ` W. scaleC (g x) x) = (\<Sum>x\<in>f ` B. scaleC (g x) x) + (\<Sum>x\<in>f ` W. scaleC (g x) x) - (\<Sum>x\<in>f ` B \<inter> f ` W. scaleC (g x) x)

goal (1 subgoal):
 1. \<And>xa. f xa \<in> range (\<lambda>u. \<Sum>v\<in>f ` W. scaleC (u v) v)
[PROOF STEP]
have "... = (\<Sum>x\<in>f ` W. scaleC (g x) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>f ` B. scaleC (g x) x) + (\<Sum>x\<in>f ` W. scaleC (g x) x) - (\<Sum>x\<in>f ` B \<inter> f ` W. scaleC (g x) x) = (\<Sum>x\<in>f ` W. scaleC (g x) x)
[PROOF STEP]
unfolding zero_fB zero_inter
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'c) + (\<Sum>x\<in>f ` W. scaleC (g x) x) - (0::'c) = (\<Sum>x\<in>f ` W. scaleC (g x) x)
[PROOF STEP]
by simp
              \<comment> \<open>We have proved that the image set of $W$ is a generating set
              of the range of $f$\<close>
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>f ` B. scaleC (g x) x) + (\<Sum>x\<in>f ` W. scaleC (g x) x) - (\<Sum>x\<in>f ` B \<inter> f ` W. scaleC (g x) x) = (\<Sum>x\<in>f ` W. scaleC (g x) x)

goal (1 subgoal):
 1. \<And>xa. f xa \<in> range (\<lambda>u. \<Sum>v\<in>f ` W. scaleC (u v) v)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
f v = (\<Sum>x\<in>f ` W. scaleC (g x) x)
[PROOF STEP]
show "f v \<in> range (\<lambda>u. \<Sum>v\<in>f ` W. scaleC (u v) v)"
[PROOF STATE]
proof (prove)
using this:
f v = (\<Sum>x\<in>f ` W. scaleC (g x) x)

goal (1 subgoal):
 1. f v \<in> range (\<lambda>u. \<Sum>v\<in>f ` W. scaleC (u v) v)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f v \<in> range (\<lambda>u. \<Sum>v\<in>f ` W. scaleC (u v) v)

goal:
No subgoals!
[PROOF STEP]
qed
          \<comment> \<open>2. The image set of $W$ is linearly independent:\<close>
[PROOF STATE]
proof (state)
this:
range f \<subseteq> l.vs2.span (f ` W)

goal (2 subgoals):
 1. f ` W \<subseteq> range f
 2. l.vs2.independent (f ` W)
[PROOF STEP]
show "l.vs2.independent (f ` W)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l.vs2.independent (f ` W)
[PROOF STEP]
using finite_fW
[PROOF STATE]
proof (prove)
using this:
finite (f ` W)

goal (1 subgoal):
 1. l.vs2.independent (f ` W)
[PROOF STEP]
proof (rule l.vs2.independent_if_scalars_zero)
          \<comment> \<open>Every linear combination (given by $g x$) of the elements of
           the image set of $W$ equal to zero, requires every coefficient to
           be zero:\<close>
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>fa x. \<lbrakk>(\<Sum>x\<in>f ` W. scaleC (fa x) x) = (0::'c); x \<in> f ` W\<rbrakk> \<Longrightarrow> fa x = (0::'a)
[PROOF STEP]
fix g :: "'c => 'a" and w :: 'c
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>fa x. \<lbrakk>(\<Sum>x\<in>f ` W. scaleC (fa x) x) = (0::'c); x \<in> f ` W\<rbrakk> \<Longrightarrow> fa x = (0::'a)
[PROOF STEP]
assume sum: "(\<Sum>x\<in>f ` W. scaleC (g x) x) = 0" and w: "w \<in> f ` W"
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>f ` W. scaleC (g x) x) = (0::'c)
w \<in> f ` W

goal (1 subgoal):
 1. \<And>fa x. \<lbrakk>(\<Sum>x\<in>f ` W. scaleC (fa x) x) = (0::'c); x \<in> f ` W\<rbrakk> \<Longrightarrow> fa x = (0::'a)
[PROOF STEP]
have "0 = (\<Sum>x\<in>f ` W. scaleC (g x) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'c) = (\<Sum>x\<in>f ` W. scaleC (g x) x)
[PROOF STEP]
using sum
[PROOF STATE]
proof (prove)
using this:
(\<Sum>x\<in>f ` W. scaleC (g x) x) = (0::'c)

goal (1 subgoal):
 1. (0::'c) = (\<Sum>x\<in>f ` W. scaleC (g x) x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(0::'c) = (\<Sum>x\<in>f ` W. scaleC (g x) x)

goal (1 subgoal):
 1. \<And>fa x. \<lbrakk>(\<Sum>x\<in>f ` W. scaleC (fa x) x) = (0::'c); x \<in> f ` W\<rbrakk> \<Longrightarrow> fa x = (0::'a)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(0::'c) = (\<Sum>x\<in>f ` W. scaleC (g x) x)

goal (1 subgoal):
 1. \<And>fa x. \<lbrakk>(\<Sum>x\<in>f ` W. scaleC (fa x) x) = (0::'c); x \<in> f ` W\<rbrakk> \<Longrightarrow> fa x = (0::'a)
[PROOF STEP]
have "... = sum ((\<lambda>x. scaleC (g x) x) \<circ> f) W"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>f ` W. scaleC (g x) x) = sum ((\<lambda>x. scaleC (g x) x) \<circ> f) W
[PROOF STEP]
by (rule sum.reindex, rule inj_on_extended[OF l, of C B])
              (unfold W_def, rule finite_C, rule independent_C, rule C_eq, simp,
                rule ker_in_span)
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>f ` W. scaleC (g x) x) = sum ((\<lambda>x. scaleC (g x) x) \<circ> f) W

goal (1 subgoal):
 1. \<And>fa x. \<lbrakk>(\<Sum>x\<in>f ` W. scaleC (fa x) x) = (0::'c); x \<in> f ` W\<rbrakk> \<Longrightarrow> fa x = (0::'a)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>f ` W. scaleC (g x) x) = sum ((\<lambda>x. scaleC (g x) x) \<circ> f) W

goal (1 subgoal):
 1. \<And>fa x. \<lbrakk>(\<Sum>x\<in>f ` W. scaleC (fa x) x) = (0::'c); x \<in> f ` W\<rbrakk> \<Longrightarrow> fa x = (0::'a)
[PROOF STEP]
have "... = (\<Sum>x\<in>W. scaleC ((g \<circ> f) x) (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum ((\<lambda>x. scaleC (g x) x) \<circ> f) W = (\<Sum>x\<in>W. scaleC ((g \<circ> f) x) (f x))
[PROOF STEP]
unfolding o_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>W. scaleC (g (f x)) (f x)) = (\<Sum>x\<in>W. scaleC (g (f x)) (f x))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
sum ((\<lambda>x. scaleC (g x) x) \<circ> f) W = (\<Sum>x\<in>W. scaleC ((g \<circ> f) x) (f x))

goal (1 subgoal):
 1. \<And>fa x. \<lbrakk>(\<Sum>x\<in>f ` W. scaleC (fa x) x) = (0::'c); x \<in> f ` W\<rbrakk> \<Longrightarrow> fa x = (0::'a)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum ((\<lambda>x. scaleC (g x) x) \<circ> f) W = (\<Sum>x\<in>W. scaleC ((g \<circ> f) x) (f x))

goal (1 subgoal):
 1. \<And>fa x. \<lbrakk>(\<Sum>x\<in>f ` W. scaleC (fa x) x) = (0::'c); x \<in> f ` W\<rbrakk> \<Longrightarrow> fa x = (0::'a)
[PROOF STEP]
have "... = f (\<Sum>x\<in>W. scale ((g \<circ> f) x) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>W. scaleC ((g \<circ> f) x) (f x)) = f (\<Sum>x\<in>W. (g \<circ> f) x *s x)
[PROOF STEP]
unfolding l.sum[symmetric] l.scale[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (\<Sum>x\<in>W. (g \<circ> f) x *s x) = f (\<Sum>x\<in>W. (g \<circ> f) x *s x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>W. scaleC ((g \<circ> f) x) (f x)) = f (\<Sum>x\<in>W. (g \<circ> f) x *s x)

goal (1 subgoal):
 1. \<And>fa x. \<lbrakk>(\<Sum>x\<in>f ` W. scaleC (fa x) x) = (0::'c); x \<in> f ` W\<rbrakk> \<Longrightarrow> fa x = (0::'a)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(0::'c) = f (\<Sum>x\<in>W. (g \<circ> f) x *s x)
[PROOF STEP]
have f_sum_zero:"f (\<Sum>x\<in>W. scale ((g \<circ> f) x) x) = 0"
[PROOF STATE]
proof (prove)
using this:
(0::'c) = f (\<Sum>x\<in>W. (g \<circ> f) x *s x)

goal (1 subgoal):
 1. f (\<Sum>x\<in>W. (g \<circ> f) x *s x) = (0::'c)
[PROOF STEP]
by (rule sym)
[PROOF STATE]
proof (state)
this:
f (\<Sum>x\<in>W. (g \<circ> f) x *s x) = (0::'c)

goal (1 subgoal):
 1. \<And>fa x. \<lbrakk>(\<Sum>x\<in>f ` W. scaleC (fa x) x) = (0::'c); x \<in> f ` W\<rbrakk> \<Longrightarrow> fa x = (0::'a)
[PROOF STEP]
hence "(\<Sum>x\<in>W. scale ((g \<circ> f) x) x) \<in> ker_f"
[PROOF STATE]
proof (prove)
using this:
f (\<Sum>x\<in>W. (g \<circ> f) x *s x) = (0::'c)

goal (1 subgoal):
 1. (\<Sum>x\<in>W. (g \<circ> f) x *s x) \<in> ker_f
[PROOF STEP]
unfolding ker_f_def
[PROOF STATE]
proof (prove)
using this:
f (\<Sum>x\<in>W. (g \<circ> f) x *s x) = (0::'c)

goal (1 subgoal):
 1. (\<Sum>x\<in>W. (g \<circ> f) x *s x) \<in> {x. f x = (0::'c)}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>W. (g \<circ> f) x *s x) \<in> ker_f

goal (1 subgoal):
 1. \<And>fa x. \<lbrakk>(\<Sum>x\<in>f ` W. scaleC (fa x) x) = (0::'c); x \<in> f ` W\<rbrakk> \<Longrightarrow> fa x = (0::'a)
[PROOF STEP]
hence "\<exists>h. (\<Sum>v\<in>B. scale (h v) v) = (\<Sum>x\<in>W. scale ((g \<circ> f) x) x)"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>x\<in>W. (g \<circ> f) x *s x) \<in> ker_f

goal (1 subgoal):
 1. \<exists>h. (\<Sum>v\<in>B. h v *s v) = (\<Sum>x\<in>W. (g \<circ> f) x *s x)
[PROOF STEP]
using span_finite[OF finite_B]
[PROOF STATE]
proof (prove)
using this:
(\<Sum>x\<in>W. (g \<circ> f) x *s x) \<in> ker_f
local.span B = range (\<lambda>u. \<Sum>v\<in>B. u v *s v)

goal (1 subgoal):
 1. \<exists>h. (\<Sum>v\<in>B. h v *s v) = (\<Sum>x\<in>W. (g \<circ> f) x *s x)
[PROOF STEP]
using ker_in_span
[PROOF STATE]
proof (prove)
using this:
(\<Sum>x\<in>W. (g \<circ> f) x *s x) \<in> ker_f
local.span B = range (\<lambda>u. \<Sum>v\<in>B. u v *s v)
{x. f x = (0::'c)} \<subseteq> local.span B

goal (1 subgoal):
 1. \<exists>h. (\<Sum>v\<in>B. h v *s v) = (\<Sum>x\<in>W. (g \<circ> f) x *s x)
[PROOF STEP]
unfolding ker_f_def
[PROOF STATE]
proof (prove)
using this:
(\<Sum>x\<in>W. (g \<circ> f) x *s x) \<in> {x. f x = (0::'c)}
local.span B = range (\<lambda>u. \<Sum>v\<in>B. u v *s v)
{x. f x = (0::'c)} \<subseteq> local.span B

goal (1 subgoal):
 1. \<exists>h. (\<Sum>v\<in>B. h v *s v) = (\<Sum>x\<in>W. (g \<circ> f) x *s x)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<exists>h. (\<Sum>v\<in>B. h v *s v) = (\<Sum>x\<in>W. (g \<circ> f) x *s x)

goal (1 subgoal):
 1. \<And>fa x. \<lbrakk>(\<Sum>x\<in>f ` W. scaleC (fa x) x) = (0::'c); x \<in> f ` W\<rbrakk> \<Longrightarrow> fa x = (0::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>h. (\<Sum>v\<in>B. h v *s v) = (\<Sum>x\<in>W. (g \<circ> f) x *s x)
[PROOF STEP]
obtain h where
            sum_h: "(\<Sum>v\<in>B. scale (h v) v) = (\<Sum>x\<in>W. scale ((g \<circ> f) x) x)"
[PROOF STATE]
proof (prove)
using this:
\<exists>h. (\<Sum>v\<in>B. h v *s v) = (\<Sum>x\<in>W. (g \<circ> f) x *s x)

goal (1 subgoal):
 1. (\<And>h. (\<Sum>v\<in>B. h v *s v) = (\<Sum>x\<in>W. (g \<circ> f) x *s x) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<Sum>v\<in>B. h v *s v) = (\<Sum>x\<in>W. (g \<circ> f) x *s x)

goal (1 subgoal):
 1. \<And>fa x. \<lbrakk>(\<Sum>x\<in>f ` W. scaleC (fa x) x) = (0::'c); x \<in> f ` W\<rbrakk> \<Longrightarrow> fa x = (0::'a)
[PROOF STEP]
define t where "t a = (if a \<in> B then h a else - ((g \<circ> f) a))" for a
[PROOF STATE]
proof (state)
this:
t ?a = (if ?a \<in> B then h ?a else - (g \<circ> f) ?a)

goal (1 subgoal):
 1. \<And>fa x. \<lbrakk>(\<Sum>x\<in>f ` W. scaleC (fa x) x) = (0::'c); x \<in> f ` W\<rbrakk> \<Longrightarrow> fa x = (0::'a)
[PROOF STEP]
have "0 = (\<Sum>v\<in>B. scale (h v) v) + - (\<Sum>x\<in>W. scale ((g \<circ> f) x) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'b) = (\<Sum>v\<in>B. h v *s v) + - (\<Sum>x\<in>W. (g \<circ> f) x *s x)
[PROOF STEP]
using sum_h
[PROOF STATE]
proof (prove)
using this:
(\<Sum>v\<in>B. h v *s v) = (\<Sum>x\<in>W. (g \<circ> f) x *s x)

goal (1 subgoal):
 1. (0::'b) = (\<Sum>v\<in>B. h v *s v) + - (\<Sum>x\<in>W. (g \<circ> f) x *s x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(0::'b) = (\<Sum>v\<in>B. h v *s v) + - (\<Sum>x\<in>W. (g \<circ> f) x *s x)

goal (1 subgoal):
 1. \<And>fa x. \<lbrakk>(\<Sum>x\<in>f ` W. scaleC (fa x) x) = (0::'c); x \<in> f ` W\<rbrakk> \<Longrightarrow> fa x = (0::'a)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(0::'b) = (\<Sum>v\<in>B. h v *s v) + - (\<Sum>x\<in>W. (g \<circ> f) x *s x)

goal (1 subgoal):
 1. \<And>fa x. \<lbrakk>(\<Sum>x\<in>f ` W. scaleC (fa x) x) = (0::'c); x \<in> f ` W\<rbrakk> \<Longrightarrow> fa x = (0::'a)
[PROOF STEP]
have "... =  (\<Sum>v\<in>B. scale (h v) v) + (\<Sum>x\<in>W. - (scale ((g \<circ> f) x) x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>v\<in>B. h v *s v) + - (\<Sum>x\<in>W. (g \<circ> f) x *s x) = (\<Sum>v\<in>B. h v *s v) + (\<Sum>x\<in>W. - ((g \<circ> f) x *s x))
[PROOF STEP]
unfolding sum_negf
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>v\<in>B. h v *s v) + - (\<Sum>x\<in>W. (g \<circ> f) x *s x) = (\<Sum>v\<in>B. h v *s v) + - (\<Sum>x\<in>W. (g \<circ> f) x *s x)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
(\<Sum>v\<in>B. h v *s v) + - (\<Sum>x\<in>W. (g \<circ> f) x *s x) = (\<Sum>v\<in>B. h v *s v) + (\<Sum>x\<in>W. - ((g \<circ> f) x *s x))

goal (1 subgoal):
 1. \<And>fa x. \<lbrakk>(\<Sum>x\<in>f ` W. scaleC (fa x) x) = (0::'c); x \<in> f ` W\<rbrakk> \<Longrightarrow> fa x = (0::'a)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>v\<in>B. h v *s v) + - (\<Sum>x\<in>W. (g \<circ> f) x *s x) = (\<Sum>v\<in>B. h v *s v) + (\<Sum>x\<in>W. - ((g \<circ> f) x *s x))

goal (1 subgoal):
 1. \<And>fa x. \<lbrakk>(\<Sum>x\<in>f ` W. scaleC (fa x) x) = (0::'c); x \<in> f ` W\<rbrakk> \<Longrightarrow> fa x = (0::'a)
[PROOF STEP]
have "... = (\<Sum>v\<in>B. scale (t v) v) + (\<Sum>x\<in>W. -(scale((g \<circ> f) x) x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>v\<in>B. h v *s v) + (\<Sum>x\<in>W. - ((g \<circ> f) x *s x)) = (\<Sum>v\<in>B. t v *s v) + (\<Sum>x\<in>W. - ((g \<circ> f) x *s x))
[PROOF STEP]
unfolding add_right_cancel
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>v\<in>B. h v *s v) = (\<Sum>v\<in>B. t v *s v)
[PROOF STEP]
unfolding t_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>v\<in>B. h v *s v) = (\<Sum>v\<in>B. (if v \<in> B then h v else - (g \<circ> f) v) *s v)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>v\<in>B. h v *s v) + (\<Sum>x\<in>W. - ((g \<circ> f) x *s x)) = (\<Sum>v\<in>B. t v *s v) + (\<Sum>x\<in>W. - ((g \<circ> f) x *s x))

goal (1 subgoal):
 1. \<And>fa x. \<lbrakk>(\<Sum>x\<in>f ` W. scaleC (fa x) x) = (0::'c); x \<in> f ` W\<rbrakk> \<Longrightarrow> fa x = (0::'a)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>v\<in>B. h v *s v) + (\<Sum>x\<in>W. - ((g \<circ> f) x *s x)) = (\<Sum>v\<in>B. t v *s v) + (\<Sum>x\<in>W. - ((g \<circ> f) x *s x))

goal (1 subgoal):
 1. \<And>fa x. \<lbrakk>(\<Sum>x\<in>f ` W. scaleC (fa x) x) = (0::'c); x \<in> f ` W\<rbrakk> \<Longrightarrow> fa x = (0::'a)
[PROOF STEP]
have "... =  (\<Sum>v\<in>B. scale (t v) v) + (\<Sum>x\<in>W. scale (t x) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>v\<in>B. t v *s v) + (\<Sum>x\<in>W. - ((g \<circ> f) x *s x)) = (\<Sum>v\<in>B. t v *s v) + (\<Sum>x\<in>W. t x *s x)
[PROOF STEP]
by (unfold add_left_cancel t_def W_def, rule sum.cong) simp+
[PROOF STATE]
proof (state)
this:
(\<Sum>v\<in>B. t v *s v) + (\<Sum>x\<in>W. - ((g \<circ> f) x *s x)) = (\<Sum>v\<in>B. t v *s v) + (\<Sum>x\<in>W. t x *s x)

goal (1 subgoal):
 1. \<And>fa x. \<lbrakk>(\<Sum>x\<in>f ` W. scaleC (fa x) x) = (0::'c); x \<in> f ` W\<rbrakk> \<Longrightarrow> fa x = (0::'a)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>v\<in>B. t v *s v) + (\<Sum>x\<in>W. - ((g \<circ> f) x *s x)) = (\<Sum>v\<in>B. t v *s v) + (\<Sum>x\<in>W. t x *s x)

goal (1 subgoal):
 1. \<And>fa x. \<lbrakk>(\<Sum>x\<in>f ` W. scaleC (fa x) x) = (0::'c); x \<in> f ` W\<rbrakk> \<Longrightarrow> fa x = (0::'a)
[PROOF STEP]
have "... = (\<Sum>v\<in>B \<union> W. scale (t v) v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>v\<in>B. t v *s v) + (\<Sum>x\<in>W. t x *s x) = (\<Sum>v\<in>B \<union> W. t v *s v)
[PROOF STEP]
by (rule sum.union_inter_neutral [symmetric], rule finite_B, rule finite_W)
              (simp add: W_def)
[PROOF STATE]
proof (state)
this:
(\<Sum>v\<in>B. t v *s v) + (\<Sum>x\<in>W. t x *s x) = (\<Sum>v\<in>B \<union> W. t v *s v)

goal (1 subgoal):
 1. \<And>fa x. \<lbrakk>(\<Sum>x\<in>f ` W. scaleC (fa x) x) = (0::'c); x \<in> f ` W\<rbrakk> \<Longrightarrow> fa x = (0::'a)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(0::'b) = (\<Sum>v\<in>B \<union> W. t v *s v)
[PROOF STEP]
have "(\<Sum>v\<in>B \<union> W. scale (t v) v) = 0"
[PROOF STATE]
proof (prove)
using this:
(0::'b) = (\<Sum>v\<in>B \<union> W. t v *s v)

goal (1 subgoal):
 1. (\<Sum>v\<in>B \<union> W. t v *s v) = (0::'b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>v\<in>B \<union> W. t v *s v) = (0::'b)

goal (1 subgoal):
 1. \<And>fa x. \<lbrakk>(\<Sum>x\<in>f ` W. scaleC (fa x) x) = (0::'c); x \<in> f ` W\<rbrakk> \<Longrightarrow> fa x = (0::'a)
[PROOF STEP]
hence coef_zero: "\<forall>x\<in>B \<union> W. t x = 0"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>v\<in>B \<union> W. t v *s v) = (0::'b)

goal (1 subgoal):
 1. \<forall>x\<in>B \<union> W. t x = (0::'a)
[PROOF STEP]
using C_eq scalars_zero_if_independent [OF finite_C independent_C]
[PROOF STATE]
proof (prove)
using this:
(\<Sum>v\<in>B \<union> W. t v *s v) = (0::'b)
C = B \<union> (C - B)
(\<Sum>x\<in>C. ?f x *s x) = (0::'b) \<Longrightarrow> \<forall>x\<in>C. ?f x = (0::'a)

goal (1 subgoal):
 1. \<forall>x\<in>B \<union> W. t x = (0::'a)
[PROOF STEP]
unfolding W_def
[PROOF STATE]
proof (prove)
using this:
(\<Sum>v\<in>B \<union> (C - B). t v *s v) = (0::'b)
C = B \<union> (C - B)
(\<Sum>x\<in>C. ?f x *s x) = (0::'b) \<Longrightarrow> \<forall>x\<in>C. ?f x = (0::'a)

goal (1 subgoal):
 1. \<forall>x\<in>B \<union> (C - B). t x = (0::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>B \<union> W. t x = (0::'a)

goal (1 subgoal):
 1. \<And>fa x. \<lbrakk>(\<Sum>x\<in>f ` W. scaleC (fa x) x) = (0::'c); x \<in> f ` W\<rbrakk> \<Longrightarrow> fa x = (0::'a)
[PROOF STEP]
obtain y where w_fy: "w = f y " and y_in_W: "y \<in> W"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>y. \<lbrakk>w = f y; y \<in> W\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using w
[PROOF STATE]
proof (prove)
using this:
w \<in> f ` W

goal (1 subgoal):
 1. (\<And>y. \<lbrakk>w = f y; y \<in> W\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
w = f y
y \<in> W

goal (1 subgoal):
 1. \<And>fa x. \<lbrakk>(\<Sum>x\<in>f ` W. scaleC (fa x) x) = (0::'c); x \<in> f ` W\<rbrakk> \<Longrightarrow> fa x = (0::'a)
[PROOF STEP]
have "- g w = t y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - g w = t y
[PROOF STEP]
unfolding t_def w_fy
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - g (f y) = (if y \<in> B then h y else - (g \<circ> f) y)
[PROOF STEP]
using y_in_W
[PROOF STATE]
proof (prove)
using this:
y \<in> W

goal (1 subgoal):
 1. - g (f y) = (if y \<in> B then h y else - (g \<circ> f) y)
[PROOF STEP]
unfolding W_def
[PROOF STATE]
proof (prove)
using this:
y \<in> C - B

goal (1 subgoal):
 1. - g (f y) = (if y \<in> B then h y else - (g \<circ> f) y)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
- g w = t y

goal (1 subgoal):
 1. \<And>fa x. \<lbrakk>(\<Sum>x\<in>f ` W. scaleC (fa x) x) = (0::'c); x \<in> f ` W\<rbrakk> \<Longrightarrow> fa x = (0::'a)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- g w = t y

goal (1 subgoal):
 1. \<And>fa x. \<lbrakk>(\<Sum>x\<in>f ` W. scaleC (fa x) x) = (0::'c); x \<in> f ` W\<rbrakk> \<Longrightarrow> fa x = (0::'a)
[PROOF STEP]
have "... = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t y = (0::'a)
[PROOF STEP]
using coef_zero y_in_W
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>B \<union> W. t x = (0::'a)
y \<in> W

goal (1 subgoal):
 1. t y = (0::'a)
[PROOF STEP]
unfolding W_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>B \<union> (C - B). t x = (0::'a)
y \<in> C - B

goal (1 subgoal):
 1. t y = (0::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
t y = (0::'a)

goal (1 subgoal):
 1. \<And>fa x. \<lbrakk>(\<Sum>x\<in>f ` W. scaleC (fa x) x) = (0::'c); x \<in> f ` W\<rbrakk> \<Longrightarrow> fa x = (0::'a)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
- g w = (0::'a)
[PROOF STEP]
show "g w = 0"
[PROOF STATE]
proof (prove)
using this:
- g w = (0::'a)

goal (1 subgoal):
 1. g w = (0::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
g w = (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
l.vs2.independent (f ` W)

goal (1 subgoal):
 1. f ` W \<subseteq> range f
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
card (f ` W) = l.vs2.dim (range f)

goal (1 subgoal):
 1. card (C - B) = l.vs2.dim (range f)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
card W = l.vs2.dim (range f)
[PROOF STEP]
show "card (C - B) = l.vs2.dim (range f)"
[PROOF STATE]
proof (prove)
using this:
card W = l.vs2.dim (range f)

goal (1 subgoal):
 1. card (C - B) = l.vs2.dim (range f)
[PROOF STEP]
unfolding W_def
[PROOF STATE]
proof (prove)
using this:
card (C - B) = l.vs2.dim (range f)

goal (1 subgoal):
 1. card (C - B) = l.vs2.dim (range f)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
card (C - B) = l.vs2.dim (range f)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
local.dim ker_f + card (C - B) = local.dim ker_f + l.vs2.dim (range f)

goal (1 subgoal):
 1. local.dimension = local.dim {x. f x = (0::'c)} + l.vs2.dim (range f)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
local.dimension = local.dim ker_f + l.vs2.dim (range f)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
local.dimension = local.dim ker_f + l.vs2.dim (range f)

goal (1 subgoal):
 1. local.dimension = local.dim {x. f x = (0::'c)} + l.vs2.dim (range f)
[PROOF STEP]
unfolding V_def ker_f_def
[PROOF STATE]
proof (prove)
using this:
local.dimension = local.dim {x. f x = (0::'c)} + l.vs2.dim (range f)

goal (1 subgoal):
 1. local.dimension = local.dim {x. f x = (0::'c)} + l.vs2.dim (range f)
[PROOF STEP]
unfolding dim_UNIV
[PROOF STATE]
proof (prove)
using this:
local.dimension = local.dim {x. f x = (0::'c)} + l.vs2.dim (range f)

goal (1 subgoal):
 1. local.dimension = local.dim {x. f x = (0::'c)} + l.vs2.dim (range f)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
local.dimension = local.dim {x. f x = (0::'c)} + l.vs2.dim (range f)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
local.dimension = local.dim {x. f x = (0::'c)} + l.vs2.dim (range f)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lc_set_iff:
  shows "c \<in> lc_set F \<longleftrightarrow> (\<exists>f\<in>F. f \<noteq> 0 \<and> lc f = c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (c \<in> lc_set F) = (\<exists>f\<in>F. f \<noteq> 0 \<and> lc f = c)
[PROOF STEP]
unfolding lc_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (c \<in> lc ` (F - {0})) = (\<exists>f\<in>F. f \<noteq> 0 \<and> lc f = c)
[PROOF STEP]
by auto


[STATEMENT]
lemma prime_gt_0_nat: "prime p \<Longrightarrow> p > (0::nat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime p \<Longrightarrow> 0 < p
[PROOF STEP]
using prime_ge_2_nat [of p]
[PROOF STATE]
proof (prove)
using this:
prime p \<Longrightarrow> 2 \<le> p

goal (1 subgoal):
 1. prime p \<Longrightarrow> 0 < p
[PROOF STEP]
by simp


[STATEMENT]
lemma (in valid_unMultigraph) del_UnEdge_even:
  assumes "(v,w,v') \<in> E" "finite E"
  shows "v\<in>odd_nodes_set(del_unEdge v w v' G) \<longleftrightarrow> even (degree v G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (v \<in> odd_nodes_set (del_unEdge v w v' G)) = even (degree v G)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (v \<in> odd_nodes_set (del_unEdge v w v' G)) = even (degree v G)
[PROOF STEP]
have "degree v (del_unEdge v w v' G) + 1=degree v G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree v (del_unEdge v w v' G) + 1 = degree v G
[PROOF STEP]
using del_edge_undirected_degree_plus corres
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite (edges ?g); (?v, ?e, ?v') \<in> edges ?g; (?v', ?e, ?v) \<in> edges ?g\<rbrakk> \<Longrightarrow> degree ?v (del_unEdge ?v ?e ?v' ?g) + 1 = degree ?v ?g
((?v, ?w, ?u') \<in> E) = ((?u', ?w, ?v) \<in> E)

goal (1 subgoal):
 1. degree v (del_unEdge v w v' G) + 1 = degree v G
[PROOF STEP]
by (metis assms)
[PROOF STATE]
proof (state)
this:
degree v (del_unEdge v w v' G) + 1 = degree v G

goal (1 subgoal):
 1. (v \<in> odd_nodes_set (del_unEdge v w v' G)) = even (degree v G)
[PROOF STEP]
from this [symmetric]
[PROOF STATE]
proof (chain)
picking this:
degree v G = degree v (del_unEdge v w v' G) + 1
[PROOF STEP]
have "odd (degree v (del_unEdge v w v' G)) = even (degree v G)"
[PROOF STATE]
proof (prove)
using this:
degree v G = degree v (del_unEdge v w v' G) + 1

goal (1 subgoal):
 1. odd (degree v (del_unEdge v w v' G)) = even (degree v G)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
odd (degree v (del_unEdge v w v' G)) = even (degree v G)

goal (1 subgoal):
 1. (v \<in> odd_nodes_set (del_unEdge v w v' G)) = even (degree v G)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
odd (degree v (del_unEdge v w v' G)) = even (degree v G)

goal (1 subgoal):
 1. (v \<in> odd_nodes_set (del_unEdge v w v' G)) = even (degree v G)
[PROOF STEP]
have "v\<in>nodes (del_unEdge v w v' G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> nodes (del_unEdge v w v' G)
[PROOF STEP]
by (metis E_validD(1) assms(1) del_UnEdge_node)
[PROOF STATE]
proof (state)
this:
v \<in> nodes (del_unEdge v w v' G)

goal (1 subgoal):
 1. (v \<in> odd_nodes_set (del_unEdge v w v' G)) = even (degree v G)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
odd (degree v (del_unEdge v w v' G)) = even (degree v G)
v \<in> nodes (del_unEdge v w v' G)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
odd (degree v (del_unEdge v w v' G)) = even (degree v G)
v \<in> nodes (del_unEdge v w v' G)

goal (1 subgoal):
 1. (v \<in> odd_nodes_set (del_unEdge v w v' G)) = even (degree v G)
[PROOF STEP]
unfolding odd_nodes_set_def
[PROOF STATE]
proof (prove)
using this:
odd (degree v (del_unEdge v w v' G)) = even (degree v G)
v \<in> nodes (del_unEdge v w v' G)

goal (1 subgoal):
 1. (v \<in> {va \<in> nodes (del_unEdge v w v' G). odd (degree va (del_unEdge v w v' G))}) = even (degree v G)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(v \<in> odd_nodes_set (del_unEdge v w v' G)) = even (degree v G)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mult_scalar_minus_mult_right [simp]: "p \<odot> (- q) = - (p \<odot> q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<odot> - q = - (p \<odot> q)
[PROOF STEP]
by (rule sym, rule minus_unique, simp add: mult_scalar_distrib_left [symmetric])


[STATEMENT]
lemma Fract_less_zero_iff: "0 < b \<Longrightarrow> Fract a b < 0 \<longleftrightarrow> a < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < b \<Longrightarrow> (Fract a b < 0) = (a < 0)
[PROOF STEP]
by (simp add: Zero_rat_def mult_less_0_iff)


[STATEMENT]
lemma locally_path_connected_sphere_gen:
  fixes S :: "'a::euclidean_space set"
  assumes "bounded S" and "convex S"
  shows "locally path_connected (rel_frontier S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. locally path_connected (rel_frontier S)
[PROOF STEP]
proof (cases "rel_interior S = {}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. rel_interior S = {} \<Longrightarrow> locally path_connected (rel_frontier S)
 2. rel_interior S \<noteq> {} \<Longrightarrow> locally path_connected (rel_frontier S)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
rel_interior S = {}

goal (2 subgoals):
 1. rel_interior S = {} \<Longrightarrow> locally path_connected (rel_frontier S)
 2. rel_interior S \<noteq> {} \<Longrightarrow> locally path_connected (rel_frontier S)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
bounded S
convex S
rel_interior S = {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
bounded S
convex S
rel_interior S = {}

goal (1 subgoal):
 1. locally path_connected (rel_frontier S)
[PROOF STEP]
by (simp add: rel_interior_eq_empty)
[PROOF STATE]
proof (state)
this:
locally path_connected (rel_frontier S)

goal (1 subgoal):
 1. rel_interior S \<noteq> {} \<Longrightarrow> locally path_connected (rel_frontier S)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rel_interior S \<noteq> {} \<Longrightarrow> locally path_connected (rel_frontier S)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
rel_interior S \<noteq> {}

goal (1 subgoal):
 1. rel_interior S \<noteq> {} \<Longrightarrow> locally path_connected (rel_frontier S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rel_interior S \<noteq> {}
[PROOF STEP]
obtain a where a: "a \<in> rel_interior S"
[PROOF STATE]
proof (prove)
using this:
rel_interior S \<noteq> {}

goal (1 subgoal):
 1. (\<And>a. a \<in> rel_interior S \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
a \<in> rel_interior S

goal (1 subgoal):
 1. rel_interior S \<noteq> {} \<Longrightarrow> locally path_connected (rel_frontier S)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. locally path_connected (rel_frontier S)
[PROOF STEP]
proof (rule retract_of_locally_path_connected)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. locally path_connected ?T
 2. rel_frontier S retract_of ?T
[PROOF STEP]
show "locally path_connected (affine hull S - {a})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. locally path_connected (affine hull S - {a})
[PROOF STEP]
by (meson convex_affine_hull convex_imp_locally_path_connected locally_open_subset openin_delete openin_subtopology_self)
[PROOF STATE]
proof (state)
this:
locally path_connected (affine hull S - {a})

goal (1 subgoal):
 1. rel_frontier S retract_of affine hull S - {a}
[PROOF STEP]
show "rel_frontier S retract_of affine hull S - {a}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_frontier S retract_of affine hull S - {a}
[PROOF STEP]
using a assms rel_frontier_retract_of_punctured_affine_hull
[PROOF STATE]
proof (prove)
using this:
a \<in> rel_interior S
bounded S
convex S
\<lbrakk>bounded ?S; convex ?S; ?a \<in> rel_interior ?S\<rbrakk> \<Longrightarrow> rel_frontier ?S retract_of affine hull ?S - {?a}

goal (1 subgoal):
 1. rel_frontier S retract_of affine hull S - {a}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
rel_frontier S retract_of affine hull S - {a}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
locally path_connected (rel_frontier S)

goal:
No subgoals!
[PROOF STEP]
qed