[STATEMENT]
lemma Span_append_eq_set_add:
  assumes "set Us \<subseteq> carrier R" and "set Vs \<subseteq> carrier R"
  shows "Span K (Us @ Vs) = (Span K Us <+>\<^bsub>R\<^esub> Span K Vs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Span K (Us @ Vs) = Span K Us <+> Span K Vs
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
set Us \<subseteq> carrier R
set Vs \<subseteq> carrier R

goal (1 subgoal):
 1. Span K (Us @ Vs) = Span K Us <+> Span K Vs
[PROOF STEP]
proof (induct Us)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>set [] \<subseteq> carrier R; set Vs \<subseteq> carrier R\<rbrakk> \<Longrightarrow> Span K ([] @ Vs) = Span K [] <+> Span K Vs
 2. \<And>a Us. \<lbrakk>\<lbrakk>set Us \<subseteq> carrier R; set Vs \<subseteq> carrier R\<rbrakk> \<Longrightarrow> Span K (Us @ Vs) = Span K Us <+> Span K Vs; set (a # Us) \<subseteq> carrier R; set Vs \<subseteq> carrier R\<rbrakk> \<Longrightarrow> Span K ((a # Us) @ Vs) = Span K (a # Us) <+> Span K Vs
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
set [] \<subseteq> carrier R
set Vs \<subseteq> carrier R

goal (2 subgoals):
 1. \<lbrakk>set [] \<subseteq> carrier R; set Vs \<subseteq> carrier R\<rbrakk> \<Longrightarrow> Span K ([] @ Vs) = Span K [] <+> Span K Vs
 2. \<And>a Us. \<lbrakk>\<lbrakk>set Us \<subseteq> carrier R; set Vs \<subseteq> carrier R\<rbrakk> \<Longrightarrow> Span K (Us @ Vs) = Span K Us <+> Span K Vs; set (a # Us) \<subseteq> carrier R; set Vs \<subseteq> carrier R\<rbrakk> \<Longrightarrow> Span K ((a # Us) @ Vs) = Span K (a # Us) <+> Span K Vs
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
set [] \<subseteq> carrier R
set Vs \<subseteq> carrier R

goal (1 subgoal):
 1. Span K ([] @ Vs) = Span K [] <+> Span K Vs
[PROOF STEP]
using Span_subgroup_props(1)[OF Nil(2)]
[PROOF STATE]
proof (prove)
using this:
set [] \<subseteq> carrier R
set Vs \<subseteq> carrier R
Span K Vs \<subseteq> carrier R

goal (1 subgoal):
 1. Span K ([] @ Vs) = Span K [] <+> Span K Vs
[PROOF STEP]
unfolding set_add_def'
[PROOF STATE]
proof (prove)
using this:
set [] \<subseteq> carrier R
set Vs \<subseteq> carrier R
Span K Vs \<subseteq> carrier R

goal (1 subgoal):
 1. Span K ([] @ Vs) = (\<Union>h\<in>Span K []. \<Union>k\<in>Span K Vs. {h \<oplus> k})
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
Span K ([] @ Vs) = Span K [] <+> Span K Vs

goal (1 subgoal):
 1. \<And>a Us. \<lbrakk>\<lbrakk>set Us \<subseteq> carrier R; set Vs \<subseteq> carrier R\<rbrakk> \<Longrightarrow> Span K (Us @ Vs) = Span K Us <+> Span K Vs; set (a # Us) \<subseteq> carrier R; set Vs \<subseteq> carrier R\<rbrakk> \<Longrightarrow> Span K ((a # Us) @ Vs) = Span K (a # Us) <+> Span K Vs
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a Us. \<lbrakk>\<lbrakk>set Us \<subseteq> carrier R; set Vs \<subseteq> carrier R\<rbrakk> \<Longrightarrow> Span K (Us @ Vs) = Span K Us <+> Span K Vs; set (a # Us) \<subseteq> carrier R; set Vs \<subseteq> carrier R\<rbrakk> \<Longrightarrow> Span K ((a # Us) @ Vs) = Span K (a # Us) <+> Span K Vs
[PROOF STEP]
case (Cons u Us)
[PROOF STATE]
proof (state)
this:
\<lbrakk>set Us \<subseteq> carrier R; set Vs \<subseteq> carrier R\<rbrakk> \<Longrightarrow> Span K (Us @ Vs) = Span K Us <+> Span K Vs
set (u # Us) \<subseteq> carrier R
set Vs \<subseteq> carrier R

goal (1 subgoal):
 1. \<And>a Us. \<lbrakk>\<lbrakk>set Us \<subseteq> carrier R; set Vs \<subseteq> carrier R\<rbrakk> \<Longrightarrow> Span K (Us @ Vs) = Span K Us <+> Span K Vs; set (a # Us) \<subseteq> carrier R; set Vs \<subseteq> carrier R\<rbrakk> \<Longrightarrow> Span K ((a # Us) @ Vs) = Span K (a # Us) <+> Span K Vs
[PROOF STEP]
hence in_carrier:
    "u \<in> carrier R" "set Us \<subseteq> carrier R" "set Vs \<subseteq> carrier R"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>set Us \<subseteq> carrier R; set Vs \<subseteq> carrier R\<rbrakk> \<Longrightarrow> Span K (Us @ Vs) = Span K Us <+> Span K Vs
set (u # Us) \<subseteq> carrier R
set Vs \<subseteq> carrier R

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

goal (1 subgoal):
 1. \<And>a Us. \<lbrakk>\<lbrakk>set Us \<subseteq> carrier R; set Vs \<subseteq> carrier R\<rbrakk> \<Longrightarrow> Span K (Us @ Vs) = Span K Us <+> Span K Vs; set (a # Us) \<subseteq> carrier R; set Vs \<subseteq> carrier R\<rbrakk> \<Longrightarrow> Span K ((a # Us) @ Vs) = Span K (a # Us) <+> Span K Vs
[PROOF STEP]
have "line_extension K u (Span K Us <+>\<^bsub>R\<^esub> Span K Vs) = (Span K (u # Us) <+>\<^bsub>R\<^esub> Span K Vs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. line_extension K u (Span K Us <+> Span K Vs) = Span K (u # Us) <+> Span K Vs
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. line_extension K u (Span K Us <+> Span K Vs) \<subseteq> Span K (u # Us) <+> Span K Vs
 2. Span K (u # Us) <+> Span K Vs \<subseteq> line_extension K u (Span K Us <+> Span K Vs)
[PROOF STEP]
show "line_extension K u (Span K Us <+>\<^bsub>R\<^esub> Span K Vs) \<subseteq> (Span K (u # Us) <+>\<^bsub>R\<^esub> Span K Vs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. line_extension K u (Span K Us <+> Span K Vs) \<subseteq> Span K (u # Us) <+> Span K Vs
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> line_extension K u (Span K Us <+> Span K Vs) \<Longrightarrow> x \<in> Span K (u # Us) <+> Span K Vs
[PROOF STEP]
fix v
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> line_extension K u (Span K Us <+> Span K Vs) \<Longrightarrow> x \<in> Span K (u # Us) <+> Span K Vs
[PROOF STEP]
assume "v \<in> line_extension K u (Span K Us <+>\<^bsub>R\<^esub> Span K Vs)"
[PROOF STATE]
proof (state)
this:
v \<in> line_extension K u (Span K Us <+> Span K Vs)

goal (1 subgoal):
 1. \<And>x. x \<in> line_extension K u (Span K Us <+> Span K Vs) \<Longrightarrow> x \<in> Span K (u # Us) <+> Span K Vs
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
v \<in> line_extension K u (Span K Us <+> Span K Vs)
[PROOF STEP]
obtain k u' v'
        where v: "k \<in> K" "u' \<in> Span K Us" "v' \<in> Span K Vs" "v = k \<otimes> u \<oplus> (u' \<oplus> v')"
[PROOF STATE]
proof (prove)
using this:
v \<in> line_extension K u (Span K Us <+> Span K Vs)

goal (1 subgoal):
 1. (\<And>k u' v'. \<lbrakk>k \<in> K; u' \<in> Span K Us; v' \<in> Span K Vs; v = k \<otimes> u \<oplus> (u' \<oplus> v')\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using line_extension_mem_iff[of v _ u "Span K Us <+>\<^bsub>R\<^esub> Span K Vs"]
[PROOF STATE]
proof (prove)
using this:
v \<in> line_extension K u (Span K Us <+> Span K Vs)
(v \<in> line_extension ?K u (Span K Us <+> Span K Vs)) = (\<exists>k\<in>?K. \<exists>va\<in>Span K Us <+> Span K Vs. v = k \<otimes> u \<oplus> va)

goal (1 subgoal):
 1. (\<And>k u' v'. \<lbrakk>k \<in> K; u' \<in> Span K Us; v' \<in> Span K Vs; v = k \<otimes> u \<oplus> (u' \<oplus> v')\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding set_add_def'
[PROOF STATE]
proof (prove)
using this:
v \<in> line_extension K u (\<Union>h\<in>Span K Us. \<Union>k\<in>Span K Vs. {h \<oplus> k})
(v \<in> line_extension ?K u (\<Union>h\<in>Span K Us. \<Union>k\<in>Span K Vs. {h \<oplus> k})) = (\<exists>k\<in>?K. \<exists>va\<in>\<Union>h\<in>Span K Us. \<Union>k\<in>Span K Vs. {h \<oplus> k}. v = k \<otimes> u \<oplus> va)

goal (1 subgoal):
 1. (\<And>k u' v'. \<lbrakk>k \<in> K; u' \<in> Span K Us; v' \<in> Span K Vs; v = k \<otimes> u \<oplus> (u' \<oplus> v')\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
k \<in> K
u' \<in> Span K Us
v' \<in> Span K Vs
v = k \<otimes> u \<oplus> (u' \<oplus> v')

goal (1 subgoal):
 1. \<And>x. x \<in> line_extension K u (Span K Us <+> Span K Vs) \<Longrightarrow> x \<in> Span K (u # Us) <+> Span K Vs
[PROOF STEP]
hence "v = (k \<otimes> u \<oplus> u') \<oplus> v'"
[PROOF STATE]
proof (prove)
using this:
k \<in> K
u' \<in> Span K Us
v' \<in> Span K Vs
v = k \<otimes> u \<oplus> (u' \<oplus> v')

goal (1 subgoal):
 1. v = k \<otimes> u \<oplus> u' \<oplus> v'
[PROOF STEP]
using in_carrier(2-3)[THEN Span_subgroup_props(1)] in_carrier(1) subring_props(1)
[PROOF STATE]
proof (prove)
using this:
k \<in> K
u' \<in> Span K Us
v' \<in> Span K Vs
v = k \<otimes> u \<oplus> (u' \<oplus> v')
Span K Us \<subseteq> carrier R
Span K Vs \<subseteq> carrier R
u \<in> carrier R
K \<subseteq> carrier R

goal (1 subgoal):
 1. v = k \<otimes> u \<oplus> u' \<oplus> v'
[PROOF STEP]
by (metis (no_types, lifting) rev_subsetD ring_simprules(7) semiring_simprules(3))
[PROOF STATE]
proof (state)
this:
v = k \<otimes> u \<oplus> u' \<oplus> v'

goal (1 subgoal):
 1. \<And>x. x \<in> line_extension K u (Span K Us <+> Span K Vs) \<Longrightarrow> x \<in> Span K (u # Us) <+> Span K Vs
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
v = k \<otimes> u \<oplus> u' \<oplus> v'

goal (1 subgoal):
 1. \<And>x. x \<in> line_extension K u (Span K Us <+> Span K Vs) \<Longrightarrow> x \<in> Span K (u # Us) <+> Span K Vs
[PROOF STEP]
have "k \<otimes> u \<oplus> u' \<in> Span K (u # Us)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<otimes> u \<oplus> u' \<in> Span K (u # Us)
[PROOF STEP]
using line_extension_mem_iff v(1-2)
[PROOF STATE]
proof (prove)
using this:
(?u \<in> line_extension ?K ?a ?E) = (\<exists>k\<in>?K. \<exists>v\<in>?E. ?u = k \<otimes> ?a \<oplus> v)
k \<in> K
u' \<in> Span K Us

goal (1 subgoal):
 1. k \<otimes> u \<oplus> u' \<in> Span K (u # Us)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
k \<otimes> u \<oplus> u' \<in> Span K (u # Us)

goal (1 subgoal):
 1. \<And>x. x \<in> line_extension K u (Span K Us <+> Span K Vs) \<Longrightarrow> x \<in> Span K (u # Us) <+> Span K Vs
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
v = k \<otimes> u \<oplus> u' \<oplus> v'
k \<otimes> u \<oplus> u' \<in> Span K (u # Us)
[PROOF STEP]
show "v \<in> Span K (u # Us) <+>\<^bsub>R\<^esub> Span K Vs"
[PROOF STATE]
proof (prove)
using this:
v = k \<otimes> u \<oplus> u' \<oplus> v'
k \<otimes> u \<oplus> u' \<in> Span K (u # Us)

goal (1 subgoal):
 1. v \<in> Span K (u # Us) <+> Span K Vs
[PROOF STEP]
unfolding set_add_def'
[PROOF STATE]
proof (prove)
using this:
v = k \<otimes> u \<oplus> u' \<oplus> v'
k \<otimes> u \<oplus> u' \<in> Span K (u # Us)

goal (1 subgoal):
 1. v \<in> (\<Union>h\<in>Span K (u # Us). \<Union>k\<in>Span K Vs. {h \<oplus> k})
[PROOF STEP]
using v(3)
[PROOF STATE]
proof (prove)
using this:
v = k \<otimes> u \<oplus> u' \<oplus> v'
k \<otimes> u \<oplus> u' \<in> Span K (u # Us)
v' \<in> Span K Vs

goal (1 subgoal):
 1. v \<in> (\<Union>h\<in>Span K (u # Us). \<Union>k\<in>Span K Vs. {h \<oplus> k})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v \<in> Span K (u # Us) <+> Span K Vs

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
line_extension K u (Span K Us <+> Span K Vs) \<subseteq> Span K (u # Us) <+> Span K Vs

goal (1 subgoal):
 1. Span K (u # Us) <+> Span K Vs \<subseteq> line_extension K u (Span K Us <+> Span K Vs)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Span K (u # Us) <+> Span K Vs \<subseteq> line_extension K u (Span K Us <+> Span K Vs)
[PROOF STEP]
show "Span K (u # Us) <+>\<^bsub>R\<^esub> Span K Vs \<subseteq> line_extension K u (Span K Us <+>\<^bsub>R\<^esub> Span K Vs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Span K (u # Us) <+> Span K Vs \<subseteq> line_extension K u (Span K Us <+> Span K Vs)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> Span K (u # Us) <+> Span K Vs \<Longrightarrow> x \<in> line_extension K u (Span K Us <+> Span K Vs)
[PROOF STEP]
fix v
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> Span K (u # Us) <+> Span K Vs \<Longrightarrow> x \<in> line_extension K u (Span K Us <+> Span K Vs)
[PROOF STEP]
assume "v \<in> Span K (u # Us) <+>\<^bsub>R\<^esub> Span K Vs"
[PROOF STATE]
proof (state)
this:
v \<in> Span K (u # Us) <+> Span K Vs

goal (1 subgoal):
 1. \<And>x. x \<in> Span K (u # Us) <+> Span K Vs \<Longrightarrow> x \<in> line_extension K u (Span K Us <+> Span K Vs)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
v \<in> Span K (u # Us) <+> Span K Vs
[PROOF STEP]
obtain k u' v'
        where v: "k \<in> K" "u' \<in> Span K Us" "v' \<in> Span K Vs" "v = (k \<otimes> u \<oplus> u') \<oplus> v'"
[PROOF STATE]
proof (prove)
using this:
v \<in> Span K (u # Us) <+> Span K Vs

goal (1 subgoal):
 1. (\<And>k u' v'. \<lbrakk>k \<in> K; u' \<in> Span K Us; v' \<in> Span K Vs; v = k \<otimes> u \<oplus> u' \<oplus> v'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using line_extension_mem_iff[of _ _ u "Span K Us"]
[PROOF STATE]
proof (prove)
using this:
v \<in> Span K (u # Us) <+> Span K Vs
(?u \<in> line_extension ?K u (Span K Us)) = (\<exists>k\<in>?K. \<exists>v\<in>Span K Us. ?u = k \<otimes> u \<oplus> v)

goal (1 subgoal):
 1. (\<And>k u' v'. \<lbrakk>k \<in> K; u' \<in> Span K Us; v' \<in> Span K Vs; v = k \<otimes> u \<oplus> u' \<oplus> v'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding set_add_def'
[PROOF STATE]
proof (prove)
using this:
v \<in> (\<Union>h\<in>Span K (u # Us). \<Union>k\<in>Span K Vs. {h \<oplus> k})
(?u \<in> line_extension ?K u (Span K Us)) = (\<exists>k\<in>?K. \<exists>v\<in>Span K Us. ?u = k \<otimes> u \<oplus> v)

goal (1 subgoal):
 1. (\<And>k u' v'. \<lbrakk>k \<in> K; u' \<in> Span K Us; v' \<in> Span K Vs; v = k \<otimes> u \<oplus> u' \<oplus> v'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
k \<in> K
u' \<in> Span K Us
v' \<in> Span K Vs
v = k \<otimes> u \<oplus> u' \<oplus> v'

goal (1 subgoal):
 1. \<And>x. x \<in> Span K (u # Us) <+> Span K Vs \<Longrightarrow> x \<in> line_extension K u (Span K Us <+> Span K Vs)
[PROOF STEP]
hence "v = (k \<otimes> u) \<oplus> (u' \<oplus> v')"
[PROOF STATE]
proof (prove)
using this:
k \<in> K
u' \<in> Span K Us
v' \<in> Span K Vs
v = k \<otimes> u \<oplus> u' \<oplus> v'

goal (1 subgoal):
 1. v = k \<otimes> u \<oplus> (u' \<oplus> v')
[PROOF STEP]
using in_carrier(2-3)[THEN Span_subgroup_props(1)] in_carrier(1) subring_props(1)
[PROOF STATE]
proof (prove)
using this:
k \<in> K
u' \<in> Span K Us
v' \<in> Span K Vs
v = k \<otimes> u \<oplus> u' \<oplus> v'
Span K Us \<subseteq> carrier R
Span K Vs \<subseteq> carrier R
u \<in> carrier R
K \<subseteq> carrier R

goal (1 subgoal):
 1. v = k \<otimes> u \<oplus> (u' \<oplus> v')
[PROOF STEP]
by (metis (no_types, lifting) rev_subsetD ring_simprules(5,7))
[PROOF STATE]
proof (state)
this:
v = k \<otimes> u \<oplus> (u' \<oplus> v')

goal (1 subgoal):
 1. \<And>x. x \<in> Span K (u # Us) <+> Span K Vs \<Longrightarrow> x \<in> line_extension K u (Span K Us <+> Span K Vs)
[PROOF STEP]
thus "v \<in> line_extension K u (Span K Us <+>\<^bsub>R\<^esub> Span K Vs)"
[PROOF STATE]
proof (prove)
using this:
v = k \<otimes> u \<oplus> (u' \<oplus> v')

goal (1 subgoal):
 1. v \<in> line_extension K u (Span K Us <+> Span K Vs)
[PROOF STEP]
using line_extension_mem_iff[of "(k \<otimes> u) \<oplus> (u' \<oplus> v')" K u "Span K Us <+>\<^bsub>R\<^esub> Span K Vs"]
[PROOF STATE]
proof (prove)
using this:
v = k \<otimes> u \<oplus> (u' \<oplus> v')
(k \<otimes> u \<oplus> (u' \<oplus> v') \<in> line_extension K u (Span K Us <+> Span K Vs)) = (\<exists>ka\<in>K. \<exists>v\<in>Span K Us <+> Span K Vs. k \<otimes> u \<oplus> (u' \<oplus> v') = ka \<otimes> u \<oplus> v)

goal (1 subgoal):
 1. v \<in> line_extension K u (Span K Us <+> Span K Vs)
[PROOF STEP]
unfolding set_add_def'
[PROOF STATE]
proof (prove)
using this:
v = k \<otimes> u \<oplus> (u' \<oplus> v')
(k \<otimes> u \<oplus> (u' \<oplus> v') \<in> line_extension K u (\<Union>h\<in>Span K Us. \<Union>k\<in>Span K Vs. {h \<oplus> k})) = (\<exists>ka\<in>K. \<exists>v\<in>\<Union>h\<in>Span K Us. \<Union>k\<in>Span K Vs. {h \<oplus> k}. k \<otimes> u \<oplus> (u' \<oplus> v') = ka \<otimes> u \<oplus> v)

goal (1 subgoal):
 1. v \<in> line_extension K u (\<Union>h\<in>Span K Us. \<Union>k\<in>Span K Vs. {h \<oplus> k})
[PROOF STEP]
using v
[PROOF STATE]
proof (prove)
using this:
v = k \<otimes> u \<oplus> (u' \<oplus> v')
(k \<otimes> u \<oplus> (u' \<oplus> v') \<in> line_extension K u (\<Union>h\<in>Span K Us. \<Union>k\<in>Span K Vs. {h \<oplus> k})) = (\<exists>ka\<in>K. \<exists>v\<in>\<Union>h\<in>Span K Us. \<Union>k\<in>Span K Vs. {h \<oplus> k}. k \<otimes> u \<oplus> (u' \<oplus> v') = ka \<otimes> u \<oplus> v)
k \<in> K
u' \<in> Span K Us
v' \<in> Span K Vs
v = k \<otimes> u \<oplus> u' \<oplus> v'

goal (1 subgoal):
 1. v \<in> line_extension K u (\<Union>h\<in>Span K Us. \<Union>k\<in>Span K Vs. {h \<oplus> k})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v \<in> line_extension K u (Span K Us <+> Span K Vs)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Span K (u # Us) <+> Span K Vs \<subseteq> line_extension K u (Span K Us <+> Span K Vs)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
line_extension K u (Span K Us <+> Span K Vs) = Span K (u # Us) <+> Span K Vs

goal (1 subgoal):
 1. \<And>a Us. \<lbrakk>\<lbrakk>set Us \<subseteq> carrier R; set Vs \<subseteq> carrier R\<rbrakk> \<Longrightarrow> Span K (Us @ Vs) = Span K Us <+> Span K Vs; set (a # Us) \<subseteq> carrier R; set Vs \<subseteq> carrier R\<rbrakk> \<Longrightarrow> Span K ((a # Us) @ Vs) = Span K (a # Us) <+> Span K Vs
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
line_extension K u (Span K Us <+> Span K Vs) = Span K (u # Us) <+> Span K Vs

goal (1 subgoal):
 1. Span K ((u # Us) @ Vs) = Span K (u # Us) <+> Span K Vs
[PROOF STEP]
using Cons
[PROOF STATE]
proof (prove)
using this:
line_extension K u (Span K Us <+> Span K Vs) = Span K (u # Us) <+> Span K Vs
\<lbrakk>set Us \<subseteq> carrier R; set Vs \<subseteq> carrier R\<rbrakk> \<Longrightarrow> Span K (Us @ Vs) = Span K Us <+> Span K Vs
set (u # Us) \<subseteq> carrier R
set Vs \<subseteq> carrier R

goal (1 subgoal):
 1. Span K ((u # Us) @ Vs) = Span K (u # Us) <+> Span K Vs
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Span K ((u # Us) @ Vs) = Span K (u # Us) <+> Span K Vs

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prime_elem_power_mult_dvdI:
  fixes p :: "'a :: algebraic_semidom"
  assumes "prime_elem p" "p ^ n dvd c" "b dvd c" "\<not>p dvd b"
  shows   "p ^ n * b dvd c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p ^ n * b dvd c
[PROOF STEP]
proof (cases "n = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> p ^ n * b dvd c
 2. n \<noteq> 0 \<Longrightarrow> p ^ n * b dvd c
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
n \<noteq> 0

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> p ^ n * b dvd c
 2. n \<noteq> 0 \<Longrightarrow> p ^ n * b dvd c
[PROOF STEP]
from assms(3)
[PROOF STATE]
proof (chain)
picking this:
b dvd c
[PROOF STEP]
obtain a where c: "c = a * b"
[PROOF STATE]
proof (prove)
using this:
b dvd c

goal (1 subgoal):
 1. (\<And>a. c = a * b \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using mult.commute
[PROOF STATE]
proof (prove)
using this:
b dvd c
?a * ?b = ?b * ?a

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

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> p ^ n * b dvd c
 2. n \<noteq> 0 \<Longrightarrow> p ^ n * b dvd c
[PROOF STEP]
with assms(2)
[PROOF STATE]
proof (chain)
picking this:
p ^ n dvd c
c = a * b
[PROOF STEP]
have "p ^ n dvd b * a"
[PROOF STATE]
proof (prove)
using this:
p ^ n dvd c
c = a * b

goal (1 subgoal):
 1. p ^ n dvd b * a
[PROOF STEP]
by (simp add: mult_ac)
[PROOF STATE]
proof (state)
this:
p ^ n dvd b * a

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> p ^ n * b dvd c
 2. n \<noteq> 0 \<Longrightarrow> p ^ n * b dvd c
[PROOF STEP]
hence "p ^ n dvd a"
[PROOF STATE]
proof (prove)
using this:
p ^ n dvd b * a

goal (1 subgoal):
 1. p ^ n dvd a
[PROOF STEP]
by (rule prime_power_dvd_multD[OF assms(1)]) (use assms False in auto)
[PROOF STATE]
proof (state)
this:
p ^ n dvd a

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> p ^ n * b dvd c
 2. n \<noteq> 0 \<Longrightarrow> p ^ n * b dvd c
[PROOF STEP]
with c
[PROOF STATE]
proof (chain)
picking this:
c = a * b
p ^ n dvd a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
c = a * b
p ^ n dvd a

goal (1 subgoal):
 1. p ^ n * b dvd c
[PROOF STEP]
by (auto intro: mult_dvd_mono)
[PROOF STATE]
proof (state)
this:
p ^ n * b dvd c

goal (1 subgoal):
 1. n = 0 \<Longrightarrow> p ^ n * b dvd c
[PROOF STEP]
qed (use assms in auto)


[STATEMENT]
lemma (in field) carrier_is_subfield: "subfield (carrier R) R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subfield (carrier R) R
[PROOF STEP]
by (auto intro: subfieldI[OF carrier_is_subcring] simp add: field_Units)


[STATEMENT]
lemma powser_ms_aux'_MSSCons:
  "powser_ms_aux' (MSSCons c cs) xs =
     MSLCons (const_expansion c, 0) (times_ms_aux xs (powser_ms_aux' cs xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. powser_ms_aux' (MSSCons c cs) xs = MSLCons (const_expansion c, 0) (times_ms_aux xs (powser_ms_aux' cs xs))
[PROOF STEP]
by (simp add: powser_ms_aux'_def powser_ms_aux_MSLCons)


[STATEMENT]
lemma derivative_is_smooth':
  assumes "(k+1)-smooth_on S f"
  shows "k-smooth_on S (\<lambda>x. frechet_derivative f (at x) v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k-smooth_on S (\<lambda>x. frechet_derivative f (at x) v)
[PROOF STEP]
unfolding smooth_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n. enat n \<le> k \<longrightarrow> higher_differentiable_on S (\<lambda>x. frechet_derivative f (at x) v) n
[PROOF STEP]
proof (intro allI impI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. enat n \<le> k \<Longrightarrow> higher_differentiable_on S (\<lambda>x. frechet_derivative f (at x) v) n
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. enat n \<le> k \<Longrightarrow> higher_differentiable_on S (\<lambda>x. frechet_derivative f (at x) v) n
[PROOF STEP]
assume "enat n \<le> k"
[PROOF STATE]
proof (state)
this:
enat n \<le> k

goal (1 subgoal):
 1. \<And>n. enat n \<le> k \<Longrightarrow> higher_differentiable_on S (\<lambda>x. frechet_derivative f (at x) v) n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
enat n \<le> k
[PROOF STEP]
have "Suc n \<le> k + 1"
[PROOF STATE]
proof (prove)
using this:
enat n \<le> k

goal (1 subgoal):
 1. enat (Suc n) \<le> k + 1
[PROOF STEP]
unfolding plus_1_eSuc
[PROOF STATE]
proof (prove)
using this:
enat n \<le> k

goal (1 subgoal):
 1. enat (Suc n) \<le> eSuc k
[PROOF STEP]
by (auto simp: eSuc_def split: enat.splits)
[PROOF STATE]
proof (state)
this:
enat (Suc n) \<le> k + 1

goal (1 subgoal):
 1. \<And>n. enat n \<le> k \<Longrightarrow> higher_differentiable_on S (\<lambda>x. frechet_derivative f (at x) v) n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
enat (Suc n) \<le> k + 1
[PROOF STEP]
have "higher_differentiable_on S f (Suc n)"
[PROOF STATE]
proof (prove)
using this:
enat (Suc n) \<le> k + 1

goal (1 subgoal):
 1. higher_differentiable_on S f (Suc n)
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
enat (Suc n) \<le> k + 1
(k + 1)-smooth_on S f

goal (1 subgoal):
 1. higher_differentiable_on S f (Suc n)
[PROOF STEP]
by (auto simp: smooth_on_def)
[PROOF STATE]
proof (state)
this:
higher_differentiable_on S f (Suc n)

goal (1 subgoal):
 1. \<And>n. enat n \<le> k \<Longrightarrow> higher_differentiable_on S (\<lambda>x. frechet_derivative f (at x) v) n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
higher_differentiable_on S f (Suc n)
[PROOF STEP]
show "higher_differentiable_on S (\<lambda>x. frechet_derivative f (at x) v) n"
[PROOF STATE]
proof (prove)
using this:
higher_differentiable_on S f (Suc n)

goal (1 subgoal):
 1. higher_differentiable_on S (\<lambda>x. frechet_derivative f (at x) v) n
[PROOF STEP]
by (auto simp: higher_differentiable_on.simps(2))
[PROOF STATE]
proof (state)
this:
higher_differentiable_on S (\<lambda>x. frechet_derivative f (at x) v) n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma has_vector_derivative_withinD:
  fixes f::"real \<Rightarrow> 'b::euclidean_space"
  assumes "(f has_vector_derivative f') (at x0 within S)"
  shows "((\<lambda>x. (f x - f x0) /\<^sub>R (x - x0)) \<longlongrightarrow> f') (at x0 within S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. (f x - f x0) /\<^sub>R (x - x0)) \<longlongrightarrow> f') (at x0 within S)
[PROOF STEP]
apply (rule LIM_zero_cancel)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. (f x - f x0) /\<^sub>R (x - x0) - f') \<longlongrightarrow> (0::'b)) (at x0 within S)
[PROOF STEP]
apply (rule tendsto_norm_zero_cancel)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. norm ((f x - f x0) /\<^sub>R (x - x0) - f')) \<longlongrightarrow> 0) (at x0 within S)
[PROOF STEP]
apply (rule Lim_transform_eventually)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (?f4 \<longlongrightarrow> 0) (at x0 within S)
 2. \<forall>\<^sub>F x in at x0 within S. ?f4 x = norm ((f x - f x0) /\<^sub>R (x - x0) - f')
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (?f4 \<longlongrightarrow> 0) (at x0 within S)
 2. \<forall>\<^sub>F x in at x0 within S. ?f4 x = norm ((f x - f x0) /\<^sub>R (x - x0) - f')
[PROOF STEP]
show "\<forall>\<^sub>F x in at x0 within S. norm ((f x - f x0 - (x - x0) *\<^sub>R f') /\<^sub>R norm (x - x0)) =
    norm ((f x - f x0) /\<^sub>R (x - x0) - f')"
    (is "\<forall>\<^sub>F x in _. ?th x")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at x0 within S. norm ((f x - f x0 - (x - x0) *\<^sub>R f') /\<^sub>R norm (x - x0)) = norm ((f x - f x0) /\<^sub>R (x - x0) - f')
[PROOF STEP]
unfolding eventually_at_filter
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds x0. x \<noteq> x0 \<longrightarrow> x \<in> S \<longrightarrow> norm ((f x - f x0 - (x - x0) *\<^sub>R f') /\<^sub>R norm (x - x0)) = norm ((f x - f x0) /\<^sub>R (x - x0) - f')
[PROOF STEP]
proof (safe intro!: eventuallyI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<noteq> x0; x \<in> S\<rbrakk> \<Longrightarrow> norm ((f x - f x0 - (x - x0) *\<^sub>R f') /\<^sub>R norm (x - x0)) = norm ((f x - f x0) /\<^sub>R (x - x0) - f')
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<noteq> x0; x \<in> S\<rbrakk> \<Longrightarrow> norm ((f x - f x0 - (x - x0) *\<^sub>R f') /\<^sub>R norm (x - x0)) = norm ((f x - f x0) /\<^sub>R (x - x0) - f')
[PROOF STEP]
assume x: "x \<noteq> x0"
[PROOF STATE]
proof (state)
this:
x \<noteq> x0

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<noteq> x0; x \<in> S\<rbrakk> \<Longrightarrow> norm ((f x - f x0 - (x - x0) *\<^sub>R f') /\<^sub>R norm (x - x0)) = norm ((f x - f x0) /\<^sub>R (x - x0) - f')
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<noteq> x0
[PROOF STEP]
have "norm ((f x - f x0) /\<^sub>R (x - x0) - f') = norm (sgn (x - x0) *\<^sub>R ((f x - f x0) /\<^sub>R (x - x0) - f'))"
[PROOF STATE]
proof (prove)
using this:
x \<noteq> x0

goal (1 subgoal):
 1. norm ((f x - f x0) /\<^sub>R (x - x0) - f') = norm (sgn (x - x0) *\<^sub>R ((f x - f x0) /\<^sub>R (x - x0) - f'))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
norm ((f x - f x0) /\<^sub>R (x - x0) - f') = norm (sgn (x - x0) *\<^sub>R ((f x - f x0) /\<^sub>R (x - x0) - f'))

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<noteq> x0; x \<in> S\<rbrakk> \<Longrightarrow> norm ((f x - f x0 - (x - x0) *\<^sub>R f') /\<^sub>R norm (x - x0)) = norm ((f x - f x0) /\<^sub>R (x - x0) - f')
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm ((f x - f x0) /\<^sub>R (x - x0) - f') = norm (sgn (x - x0) *\<^sub>R ((f x - f x0) /\<^sub>R (x - x0) - f'))

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<noteq> x0; x \<in> S\<rbrakk> \<Longrightarrow> norm ((f x - f x0 - (x - x0) *\<^sub>R f') /\<^sub>R norm (x - x0)) = norm ((f x - f x0) /\<^sub>R (x - x0) - f')
[PROOF STEP]
have "sgn (x - x0) *\<^sub>R ((f x - f x0) /\<^sub>R (x - x0) - f') = ((f x - f x0) /\<^sub>R norm (x - x0) - (x - x0) *\<^sub>R f' /\<^sub>R norm (x - x0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sgn (x - x0) *\<^sub>R ((f x - f x0) /\<^sub>R (x - x0) - f') = (f x - f x0) /\<^sub>R norm (x - x0) - (x - x0) *\<^sub>R f' /\<^sub>R norm (x - x0)
[PROOF STEP]
by (auto simp add: algebra_simps sgn_div_norm divide_simps)
        (metis add.commute add_divide_distrib diff_add_cancel scaleR_add_left)
[PROOF STATE]
proof (state)
this:
sgn (x - x0) *\<^sub>R ((f x - f x0) /\<^sub>R (x - x0) - f') = (f x - f x0) /\<^sub>R norm (x - x0) - (x - x0) *\<^sub>R f' /\<^sub>R norm (x - x0)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<noteq> x0; x \<in> S\<rbrakk> \<Longrightarrow> norm ((f x - f x0 - (x - x0) *\<^sub>R f') /\<^sub>R norm (x - x0)) = norm ((f x - f x0) /\<^sub>R (x - x0) - f')
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sgn (x - x0) *\<^sub>R ((f x - f x0) /\<^sub>R (x - x0) - f') = (f x - f x0) /\<^sub>R norm (x - x0) - (x - x0) *\<^sub>R f' /\<^sub>R norm (x - x0)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<noteq> x0; x \<in> S\<rbrakk> \<Longrightarrow> norm ((f x - f x0 - (x - x0) *\<^sub>R f') /\<^sub>R norm (x - x0)) = norm ((f x - f x0) /\<^sub>R (x - x0) - f')
[PROOF STEP]
have "\<dots> = (f x - f x0 - (x - x0) *\<^sub>R f') /\<^sub>R norm (x - x0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f x - f x0) /\<^sub>R norm (x - x0) - (x - x0) *\<^sub>R f' /\<^sub>R norm (x - x0) = (f x - f x0 - (x - x0) *\<^sub>R f') /\<^sub>R norm (x - x0)
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
(f x - f x0) /\<^sub>R norm (x - x0) - (x - x0) *\<^sub>R f' /\<^sub>R norm (x - x0) = (f x - f x0 - (x - x0) *\<^sub>R f') /\<^sub>R norm (x - x0)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<noteq> x0; x \<in> S\<rbrakk> \<Longrightarrow> norm ((f x - f x0 - (x - x0) *\<^sub>R f') /\<^sub>R norm (x - x0)) = norm ((f x - f x0) /\<^sub>R (x - x0) - f')
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
norm ((f x - f x0) /\<^sub>R (x - x0) - f') = norm ((f x - f x0 - (x - x0) *\<^sub>R f') /\<^sub>R norm (x - x0))
[PROOF STEP]
show "?th x"
[PROOF STATE]
proof (prove)
using this:
norm ((f x - f x0) /\<^sub>R (x - x0) - f') = norm ((f x - f x0 - (x - x0) *\<^sub>R f') /\<^sub>R norm (x - x0))

goal (1 subgoal):
 1. norm ((f x - f x0 - (x - x0) *\<^sub>R f') /\<^sub>R norm (x - x0)) = norm ((f x - f x0) /\<^sub>R (x - x0) - f')
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
norm ((f x - f x0 - (x - x0) *\<^sub>R f') /\<^sub>R norm (x - x0)) = norm ((f x - f x0) /\<^sub>R (x - x0) - f')

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at x0 within S. norm ((f x - f x0 - (x - x0) *\<^sub>R f') /\<^sub>R norm (x - x0)) = norm ((f x - f x0) /\<^sub>R (x - x0) - f')

goal (1 subgoal):
 1. ((\<lambda>x. norm ((f x - f x0 - (x - x0) *\<^sub>R f') /\<^sub>R norm (x - x0))) \<longlongrightarrow> 0) (at x0 within S)
[PROOF STEP]
show "((\<lambda>x. norm ((f x - f x0 - (x - x0) *\<^sub>R f') /\<^sub>R norm (x - x0))) \<longlongrightarrow> 0) (at x0 within S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. norm ((f x - f x0 - (x - x0) *\<^sub>R f') /\<^sub>R norm (x - x0))) \<longlongrightarrow> 0) (at x0 within S)
[PROOF STEP]
by (rule tendsto_norm_zero)
      (use assms in \<open>auto simp: has_vector_derivative_def has_derivative_at_within\<close>)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. norm ((f x - f x0 - (x - x0) *\<^sub>R f') /\<^sub>R norm (x - x0))) \<longlongrightarrow> 0) (at x0 within S)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma indefinite_integral_continuous_real:
  fixes f :: "real \<Rightarrow> 'a::euclidean_space"
  assumes "integrable (lebesgue_on {a..b}) f"
  shows "continuous_on {a..b} (\<lambda>x. integral\<^sup>L (lebesgue_on {a..x}) f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {a..b} (\<lambda>x. integral\<^sup>L (lebesgue_on {a..x}) f)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. continuous_on {a..b} (\<lambda>x. integral\<^sup>L (lebesgue_on {a..x}) f)
[PROOF STEP]
have "f integrable_on {a..b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f integrable_on {a..b}
[PROOF STEP]
by (simp add: assms integrable_on_lebesgue_on)
[PROOF STATE]
proof (state)
this:
f integrable_on {a..b}

goal (1 subgoal):
 1. continuous_on {a..b} (\<lambda>x. integral\<^sup>L (lebesgue_on {a..x}) f)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f integrable_on {a..b}
[PROOF STEP]
have "continuous_on {a..b} (\<lambda>x. integral {a..x} f)"
[PROOF STATE]
proof (prove)
using this:
f integrable_on {a..b}

goal (1 subgoal):
 1. continuous_on {a..b} (\<lambda>x. integral {a..x} f)
[PROOF STEP]
using indefinite_integral_continuous_1
[PROOF STATE]
proof (prove)
using this:
f integrable_on {a..b}
?f integrable_on {?a..?b} \<Longrightarrow> continuous_on {?a..?b} (\<lambda>x. integral {?a..x} ?f)

goal (1 subgoal):
 1. continuous_on {a..b} (\<lambda>x. integral {a..x} f)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
continuous_on {a..b} (\<lambda>x. integral {a..x} f)

goal (1 subgoal):
 1. continuous_on {a..b} (\<lambda>x. integral\<^sup>L (lebesgue_on {a..x}) f)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
continuous_on {a..b} (\<lambda>x. integral {a..x} f)

goal (1 subgoal):
 1. continuous_on {a..b} (\<lambda>x. integral\<^sup>L (lebesgue_on {a..x}) f)
[PROOF STEP]
have "integral\<^sup>L (lebesgue_on {a..x}) f = integral {a..x} f" if "a \<le> x" "x \<le> b" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>L (lebesgue_on {a..x}) f = integral {a..x} f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integral\<^sup>L (lebesgue_on {a..x}) f = integral {a..x} f
[PROOF STEP]
have "{a..x} \<subseteq> {a..b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {a..x} \<subseteq> {a..b}
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
a \<le> x
x \<le> b

goal (1 subgoal):
 1. {a..x} \<subseteq> {a..b}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{a..x} \<subseteq> {a..b}

goal (1 subgoal):
 1. integral\<^sup>L (lebesgue_on {a..x}) f = integral {a..x} f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{a..x} \<subseteq> {a..b}
[PROOF STEP]
have "integrable (lebesgue_on {a..x}) f"
[PROOF STATE]
proof (prove)
using this:
{a..x} \<subseteq> {a..b}

goal (1 subgoal):
 1. integrable (lebesgue_on {a..x}) f
[PROOF STEP]
using integrable_subinterval assms
[PROOF STATE]
proof (prove)
using this:
{a..x} \<subseteq> {a..b}
\<lbrakk>integrable (lebesgue_on {?a..?b}) ?f; {?c..?d} \<subseteq> {?a..?b}\<rbrakk> \<Longrightarrow> integrable (lebesgue_on {?c..?d}) ?f
integrable (lebesgue_on {a..b}) f

goal (1 subgoal):
 1. integrable (lebesgue_on {a..x}) f
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
integrable (lebesgue_on {a..x}) f

goal (1 subgoal):
 1. integral\<^sup>L (lebesgue_on {a..x}) f = integral {a..x} f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
integrable (lebesgue_on {a..x}) f
[PROOF STEP]
show "integral\<^sup>L (lebesgue_on {a..x}) f = integral {a..x} f"
[PROOF STATE]
proof (prove)
using this:
integrable (lebesgue_on {a..x}) f

goal (1 subgoal):
 1. integral\<^sup>L (lebesgue_on {a..x}) f = integral {a..x} f
[PROOF STEP]
by (simp add: lebesgue_integral_eq_integral)
[PROOF STATE]
proof (state)
this:
integral\<^sup>L (lebesgue_on {a..x}) f = integral {a..x} f

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>a \<le> ?x; ?x \<le> b\<rbrakk> \<Longrightarrow> integral\<^sup>L (lebesgue_on {a..?x}) f = integral {a..?x} f

goal (1 subgoal):
 1. continuous_on {a..b} (\<lambda>x. integral\<^sup>L (lebesgue_on {a..x}) f)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
continuous_on {a..b} (\<lambda>x. integral {a..x} f)
\<lbrakk>a \<le> ?x; ?x \<le> b\<rbrakk> \<Longrightarrow> integral\<^sup>L (lebesgue_on {a..?x}) f = integral {a..?x} f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
continuous_on {a..b} (\<lambda>x. integral {a..x} f)
\<lbrakk>a \<le> ?x; ?x \<le> b\<rbrakk> \<Longrightarrow> integral\<^sup>L (lebesgue_on {a..?x}) f = integral {a..?x} f

goal (1 subgoal):
 1. continuous_on {a..b} (\<lambda>x. integral\<^sup>L (lebesgue_on {a..x}) f)
[PROOF STEP]
by (metis (no_types, lifting) atLeastAtMost_iff continuous_on_cong)
[PROOF STATE]
proof (state)
this:
continuous_on {a..b} (\<lambda>x. integral\<^sup>L (lebesgue_on {a..x}) f)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fun_inv_permute:
  assumes "\<sigma> permutes {..<n}"
  shows "fun_inv \<sigma> permutes {..<n}"
        "\<sigma> \<circ> (fun_inv \<sigma>) = id"
        "(fun_inv \<sigma>) \<circ> \<sigma> = id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fun_inv \<sigma> permutes {..<n} &&& \<sigma> \<circ> fun_inv \<sigma> = id &&& fun_inv \<sigma> \<circ> \<sigma> = id
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<sigma> permutes {..<n}

goal (1 subgoal):
 1. fun_inv \<sigma> permutes {..<n} &&& \<sigma> \<circ> fun_inv \<sigma> = id &&& fun_inv \<sigma> \<circ> \<sigma> = id
[PROOF STEP]
unfolding fun_inv_def
[PROOF STATE]
proof (prove)
using this:
\<sigma> permutes {..<n}

goal (1 subgoal):
 1. inv \<sigma> permutes {..<n} &&& \<sigma> \<circ> inv \<sigma> = id &&& inv \<sigma> \<circ> \<sigma> = id
[PROOF STEP]
using permutes_inv
[PROOF STATE]
proof (prove)
using this:
\<sigma> permutes {..<n}
?p permutes ?S \<Longrightarrow> inv ?p permutes ?S

goal (1 subgoal):
 1. inv \<sigma> permutes {..<n} &&& \<sigma> \<circ> inv \<sigma> = id &&& inv \<sigma> \<circ> \<sigma> = id
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<sigma> \<circ> inv \<sigma> = id
 2. inv \<sigma> \<circ> \<sigma> = id
[PROOF STEP]
using assms permutes_inv_o(1)
[PROOF STATE]
proof (prove)
using this:
\<sigma> permutes {..<n}
?p permutes ?S \<Longrightarrow> ?p \<circ> inv ?p = id

goal (2 subgoals):
 1. \<sigma> \<circ> inv \<sigma> = id
 2. inv \<sigma> \<circ> \<sigma> = id
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv \<sigma> \<circ> \<sigma> = id
[PROOF STEP]
using assms permutes_inv_o(2)
[PROOF STATE]
proof (prove)
using this:
\<sigma> permutes {..<n}
?p permutes ?S \<Longrightarrow> inv ?p \<circ> ?p = id

goal (1 subgoal):
 1. inv \<sigma> \<circ> \<sigma> = id
[PROOF STEP]
by blast


[STATEMENT]
lemma pochhammer_same: "pochhammer (- of_nat n) n =
    ((- 1) ^ n :: 'a::{semiring_char_0,comm_ring_1,semiring_no_zero_divisors}) * fact n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pochhammer (- of_nat n) n = (- (1::'a)) ^ n * fact n
[PROOF STEP]
unfolding pochhammer_minus
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- (1::'a)) ^ n * pochhammer (of_nat n - of_nat n + (1::'a)) n = (- (1::'a)) ^ n * fact n
[PROOF STEP]
by (simp add: of_nat_diff pochhammer_fact)


[STATEMENT]
lemma sum_list_ennreal[simp]:
  assumes "\<And>x. x \<in> set xs \<Longrightarrow> f x \<ge> 0"
  shows   "sum_list (map (\<lambda>x. ennreal (f x)) xs) = ennreal (sum_list (map f xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<leftarrow>xs. ennreal (f x)) = ennreal (sum_list (map f xs))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?x \<in> set xs \<Longrightarrow> 0 \<le> f ?x

goal (1 subgoal):
 1. (\<Sum>x\<leftarrow>xs. ennreal (f x)) = ennreal (sum_list (map f xs))
[PROOF STEP]
proof (induction xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<And>x. x \<in> set [] \<Longrightarrow> 0 \<le> f x) \<Longrightarrow> (\<Sum>x\<leftarrow>[]. ennreal (f x)) = ennreal (sum_list (map f []))
 2. \<And>a xs. \<lbrakk>(\<And>x. x \<in> set xs \<Longrightarrow> 0 \<le> f x) \<Longrightarrow> (\<Sum>x\<leftarrow>xs. ennreal (f x)) = ennreal (sum_list (map f xs)); \<And>x. x \<in> set (a # xs) \<Longrightarrow> 0 \<le> f x\<rbrakk> \<Longrightarrow> (\<Sum>x\<leftarrow>a # xs. ennreal (f x)) = ennreal (sum_list (map f (a # xs)))
[PROOF STEP]
case (Cons x xs)
[PROOF STATE]
proof (state)
this:
(\<And>x. x \<in> set xs \<Longrightarrow> 0 \<le> f x) \<Longrightarrow> (\<Sum>x\<leftarrow>xs. ennreal (f x)) = ennreal (sum_list (map f xs))
?x \<in> set (x # xs) \<Longrightarrow> 0 \<le> f ?x

goal (2 subgoals):
 1. (\<And>x. x \<in> set [] \<Longrightarrow> 0 \<le> f x) \<Longrightarrow> (\<Sum>x\<leftarrow>[]. ennreal (f x)) = ennreal (sum_list (map f []))
 2. \<And>a xs. \<lbrakk>(\<And>x. x \<in> set xs \<Longrightarrow> 0 \<le> f x) \<Longrightarrow> (\<Sum>x\<leftarrow>xs. ennreal (f x)) = ennreal (sum_list (map f xs)); \<And>x. x \<in> set (a # xs) \<Longrightarrow> 0 \<le> f x\<rbrakk> \<Longrightarrow> (\<Sum>x\<leftarrow>a # xs. ennreal (f x)) = ennreal (sum_list (map f (a # xs)))
[PROOF STEP]
from Cons
[PROOF STATE]
proof (chain)
picking this:
(\<And>x. x \<in> set xs \<Longrightarrow> 0 \<le> f x) \<Longrightarrow> (\<Sum>x\<leftarrow>xs. ennreal (f x)) = ennreal (sum_list (map f xs))
?x \<in> set (x # xs) \<Longrightarrow> 0 \<le> f ?x
[PROOF STEP]
have "(\<Sum>x\<leftarrow>x # xs. ennreal (f x)) = ennreal (f x) + ennreal (sum_list (map f xs))"
[PROOF STATE]
proof (prove)
using this:
(\<And>x. x \<in> set xs \<Longrightarrow> 0 \<le> f x) \<Longrightarrow> (\<Sum>x\<leftarrow>xs. ennreal (f x)) = ennreal (sum_list (map f xs))
?x \<in> set (x # xs) \<Longrightarrow> 0 \<le> f ?x

goal (1 subgoal):
 1. (\<Sum>x\<leftarrow>x # xs. ennreal (f x)) = ennreal (f x) + ennreal (sum_list (map f xs))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<leftarrow>x # xs. ennreal (f x)) = ennreal (f x) + ennreal (sum_list (map f xs))

goal (2 subgoals):
 1. (\<And>x. x \<in> set [] \<Longrightarrow> 0 \<le> f x) \<Longrightarrow> (\<Sum>x\<leftarrow>[]. ennreal (f x)) = ennreal (sum_list (map f []))
 2. \<And>a xs. \<lbrakk>(\<And>x. x \<in> set xs \<Longrightarrow> 0 \<le> f x) \<Longrightarrow> (\<Sum>x\<leftarrow>xs. ennreal (f x)) = ennreal (sum_list (map f xs)); \<And>x. x \<in> set (a # xs) \<Longrightarrow> 0 \<le> f x\<rbrakk> \<Longrightarrow> (\<Sum>x\<leftarrow>a # xs. ennreal (f x)) = ennreal (sum_list (map f (a # xs)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<leftarrow>x # xs. ennreal (f x)) = ennreal (f x) + ennreal (sum_list (map f xs))

goal (2 subgoals):
 1. (\<And>x. x \<in> set [] \<Longrightarrow> 0 \<le> f x) \<Longrightarrow> (\<Sum>x\<leftarrow>[]. ennreal (f x)) = ennreal (sum_list (map f []))
 2. \<And>a xs. \<lbrakk>(\<And>x. x \<in> set xs \<Longrightarrow> 0 \<le> f x) \<Longrightarrow> (\<Sum>x\<leftarrow>xs. ennreal (f x)) = ennreal (sum_list (map f xs)); \<And>x. x \<in> set (a # xs) \<Longrightarrow> 0 \<le> f x\<rbrakk> \<Longrightarrow> (\<Sum>x\<leftarrow>a # xs. ennreal (f x)) = ennreal (sum_list (map f (a # xs)))
[PROOF STEP]
from Cons.prems
[PROOF STATE]
proof (chain)
picking this:
?x \<in> set (x # xs) \<Longrightarrow> 0 \<le> f ?x
[PROOF STEP]
have "\<dots> = ennreal (f x + sum_list (map f xs))"
[PROOF STATE]
proof (prove)
using this:
?x \<in> set (x # xs) \<Longrightarrow> 0 \<le> f ?x

goal (1 subgoal):
 1. ennreal (f x) + ennreal (sum_list (map f xs)) = ennreal (f x + sum_list (map f xs))
[PROOF STEP]
by (intro ennreal_plus [symmetric] sum_list_nonneg) auto
[PROOF STATE]
proof (state)
this:
ennreal (f x) + ennreal (sum_list (map f xs)) = ennreal (f x + sum_list (map f xs))

goal (2 subgoals):
 1. (\<And>x. x \<in> set [] \<Longrightarrow> 0 \<le> f x) \<Longrightarrow> (\<Sum>x\<leftarrow>[]. ennreal (f x)) = ennreal (sum_list (map f []))
 2. \<And>a xs. \<lbrakk>(\<And>x. x \<in> set xs \<Longrightarrow> 0 \<le> f x) \<Longrightarrow> (\<Sum>x\<leftarrow>xs. ennreal (f x)) = ennreal (sum_list (map f xs)); \<And>x. x \<in> set (a # xs) \<Longrightarrow> 0 \<le> f x\<rbrakk> \<Longrightarrow> (\<Sum>x\<leftarrow>a # xs. ennreal (f x)) = ennreal (sum_list (map f (a # xs)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>x\<leftarrow>x # xs. ennreal (f x)) = ennreal (f x + sum_list (map f xs))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(\<Sum>x\<leftarrow>x # xs. ennreal (f x)) = ennreal (f x + sum_list (map f xs))

goal (1 subgoal):
 1. (\<Sum>x\<leftarrow>x # xs. ennreal (f x)) = ennreal (sum_list (map f (x # xs)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<leftarrow>x # xs. ennreal (f x)) = ennreal (sum_list (map f (x # xs)))

goal (1 subgoal):
 1. (\<And>x. x \<in> set [] \<Longrightarrow> 0 \<le> f x) \<Longrightarrow> (\<Sum>x\<leftarrow>[]. ennreal (f x)) = ennreal (sum_list (map f []))
[PROOF STEP]
qed simp_all


[STATEMENT]
lemma isolated_singularity_at_uminus[singularity_intros]:
  assumes f_iso:"isolated_singularity_at f z"
  shows "isolated_singularity_at (\<lambda>w. - f w) z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isolated_singularity_at (\<lambda>w. - f w) z
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
isolated_singularity_at f z

goal (1 subgoal):
 1. isolated_singularity_at (\<lambda>w. - f w) z
[PROOF STEP]
unfolding isolated_singularity_at_def
[PROOF STATE]
proof (prove)
using this:
\<exists>r>0. f analytic_on ball z r - {z}

goal (1 subgoal):
 1. \<exists>r>0. (\<lambda>w. - f w) analytic_on ball z r - {z}
[PROOF STEP]
using analytic_on_neg
[PROOF STATE]
proof (prove)
using this:
\<exists>r>0. f analytic_on ball z r - {z}
?f analytic_on ?S \<Longrightarrow> (\<lambda>z. - ?f z) analytic_on ?S

goal (1 subgoal):
 1. \<exists>r>0. (\<lambda>w. - f w) analytic_on ball z r - {z}
[PROOF STEP]
by blast


[STATEMENT]
lemma card_geq_3_iff_contains_3_elems:
  shows "card A \<ge> 3 \<longleftrightarrow> finite A \<and> (\<exists> x y z. x \<noteq> y \<and> x \<noteq> z \<and> y \<noteq> z \<and> x \<in> A \<and> y \<in> A \<and> z \<in> A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (3 \<le> card A) = (finite A \<and> (\<exists>x y z. x \<noteq> y \<and> x \<noteq> z \<and> y \<noteq> z \<and> x \<in> A \<and> y \<in> A \<and> z \<in> A))
[PROOF STEP]
proof (intro iffI conjI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. 3 \<le> card A \<Longrightarrow> finite A
 2. 3 \<le> card A \<Longrightarrow> \<exists>x y z. x \<noteq> y \<and> x \<noteq> z \<and> y \<noteq> z \<and> x \<in> A \<and> y \<in> A \<and> z \<in> A
 3. finite A \<and> (\<exists>x y z. x \<noteq> y \<and> x \<noteq> z \<and> y \<noteq> z \<and> x \<in> A \<and> y \<in> A \<and> z \<in> A) \<Longrightarrow> 3 \<le> card A
[PROOF STEP]
assume *: "card A \<ge> 3"
[PROOF STATE]
proof (state)
this:
3 \<le> card A

goal (3 subgoals):
 1. 3 \<le> card A \<Longrightarrow> finite A
 2. 3 \<le> card A \<Longrightarrow> \<exists>x y z. x \<noteq> y \<and> x \<noteq> z \<and> y \<noteq> z \<and> x \<in> A \<and> y \<in> A \<and> z \<in> A
 3. finite A \<and> (\<exists>x y z. x \<noteq> y \<and> x \<noteq> z \<and> y \<noteq> z \<and> x \<in> A \<and> y \<in> A \<and> z \<in> A) \<Longrightarrow> 3 \<le> card A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
3 \<le> card A
[PROOF STEP]
show "finite A"
[PROOF STATE]
proof (prove)
using this:
3 \<le> card A

goal (1 subgoal):
 1. finite A
[PROOF STEP]
using card.infinite
[PROOF STATE]
proof (prove)
using this:
3 \<le> card A
infinite ?A \<Longrightarrow> card ?A = 0

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

goal (2 subgoals):
 1. 3 \<le> card A \<Longrightarrow> \<exists>x y z. x \<noteq> y \<and> x \<noteq> z \<and> y \<noteq> z \<and> x \<in> A \<and> y \<in> A \<and> z \<in> A
 2. finite A \<and> (\<exists>x y z. x \<noteq> y \<and> x \<noteq> z \<and> y \<noteq> z \<and> x \<in> A \<and> y \<in> A \<and> z \<in> A) \<Longrightarrow> 3 \<le> card A
[PROOF STEP]
show "\<exists> x y z. x \<noteq> y \<and> x \<noteq> z \<and> y \<noteq> z \<and> x \<in> A \<and> y \<in> A \<and> z \<in> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x y z. x \<noteq> y \<and> x \<noteq> z \<and> y \<noteq> z \<and> x \<in> A \<and> y \<in> A \<and> z \<in> A
[PROOF STEP]
by (smt (verit, best) "*" card_2_iff' card_geq_2_iff_contains_2_elems le_cases3 not_less_eq_eq numeral_2_eq_2 numeral_3_eq_3)
[PROOF STATE]
proof (state)
this:
\<exists>x y z. x \<noteq> y \<and> x \<noteq> z \<and> y \<noteq> z \<and> x \<in> A \<and> y \<in> A \<and> z \<in> A

goal (1 subgoal):
 1. finite A \<and> (\<exists>x y z. x \<noteq> y \<and> x \<noteq> z \<and> y \<noteq> z \<and> x \<in> A \<and> y \<in> A \<and> z \<in> A) \<Longrightarrow> 3 \<le> card A
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite A \<and> (\<exists>x y z. x \<noteq> y \<and> x \<noteq> z \<and> y \<noteq> z \<and> x \<in> A \<and> y \<in> A \<and> z \<in> A) \<Longrightarrow> 3 \<le> card A
[PROOF STEP]
assume *: "finite A \<and> (\<exists> x y z. x \<noteq> y \<and> x \<noteq> z \<and> y \<noteq> z \<and> x \<in> A \<and> y \<in> A \<and> z \<in> A)"
[PROOF STATE]
proof (state)
this:
finite A \<and> (\<exists>x y z. x \<noteq> y \<and> x \<noteq> z \<and> y \<noteq> z \<and> x \<in> A \<and> y \<in> A \<and> z \<in> A)

goal (1 subgoal):
 1. finite A \<and> (\<exists>x y z. x \<noteq> y \<and> x \<noteq> z \<and> y \<noteq> z \<and> x \<in> A \<and> y \<in> A \<and> z \<in> A) \<Longrightarrow> 3 \<le> card A
[PROOF STEP]
thus "card A \<ge> 3"
[PROOF STATE]
proof (prove)
using this:
finite A \<and> (\<exists>x y z. x \<noteq> y \<and> x \<noteq> z \<and> y \<noteq> z \<and> x \<in> A \<and> y \<in> A \<and> z \<in> A)

goal (1 subgoal):
 1. 3 \<le> card A
[PROOF STEP]
by (metis One_nat_def Suc_le_eq card_2_iff' card_le_Suc0_iff_eq leI numeral_3_eq_3 one_add_one order_class.order.eq_iff plus_1_eq_Suc)
[PROOF STATE]
proof (state)
this:
3 \<le> card A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in domain) algebraic_self:
  assumes "subring K R" and "k \<in> K" shows "(algebraic over K) k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (algebraic over K) k
[PROOF STEP]
proof (rule algebraicI[of "[ \<one>, \<ominus> k ]"])
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. [\<one>, \<ominus> k] \<in> carrier (K [X])
 2. [\<one>, \<ominus> k] \<noteq> []
 3. local.eval [\<one>, \<ominus> k] k = \<zero>
[PROOF STEP]
show "[ \<one>, \<ominus> k ] \<in> carrier (K [X])" and "[ \<one>, \<ominus> k ] \<noteq> []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [\<one>, \<ominus> k] \<in> carrier (K [X]) &&& [\<one>, \<ominus> k] \<noteq> []
[PROOF STEP]
using subringE(2-3,5)[OF assms(1)] assms(2)
[PROOF STATE]
proof (prove)
using this:
\<zero> \<in> K
\<one> \<in> K
?h \<in> K \<Longrightarrow> \<ominus> ?h \<in> K
k \<in> K

goal (1 subgoal):
 1. [\<one>, \<ominus> k] \<in> carrier (K [X]) &&& [\<one>, \<ominus> k] \<noteq> []
[PROOF STEP]
unfolding univ_poly_def polynomial_def
[PROOF STATE]
proof (prove)
using this:
\<zero> \<in> K
\<one> \<in> K
?h \<in> K \<Longrightarrow> \<ominus> ?h \<in> K
k \<in> K

goal (1 subgoal):
 1. [\<one>, \<ominus> k] \<in> carrier \<lparr>carrier = {p. p = [] \<or> set p \<subseteq> K \<and> lead_coeff p \<noteq> \<zero>}, monoid.mult = poly_mult, one = [\<one>], zero = [], add = poly_add\<rparr> &&& [\<one>, \<ominus> k] \<noteq> []
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
[\<one>, \<ominus> k] \<in> carrier (K [X])
[\<one>, \<ominus> k] \<noteq> []

goal (1 subgoal):
 1. local.eval [\<one>, \<ominus> k] k = \<zero>
[PROOF STEP]
have "k \<in> carrier R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<in> carrier R
[PROOF STEP]
using subringE(1)[OF assms(1)] assms(2)
[PROOF STATE]
proof (prove)
using this:
K \<subseteq> carrier R
k \<in> K

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

goal (1 subgoal):
 1. local.eval [\<one>, \<ominus> k] k = \<zero>
[PROOF STEP]
thus "eval [ \<one>, \<ominus> k ] k = \<zero>"
[PROOF STATE]
proof (prove)
using this:
k \<in> carrier R

goal (1 subgoal):
 1. local.eval [\<one>, \<ominus> k] k = \<zero>
[PROOF STEP]
by (auto, algebra)
[PROOF STATE]
proof (state)
this:
local.eval [\<one>, \<ominus> k] k = \<zero>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "(P \<or> (Q \<and> R)) = ((P \<or> Q) \<and> (P \<or> R))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (P \<or> Q \<and> R) = ((P \<or> Q) \<and> (P \<or> R))
[PROOF STEP]
by blast


[STATEMENT]
lemma inverse_matrix:
fixes A::"'a::{field}^'n::{mod_type}^'n::{mod_type}"
shows "inverse_matrix A = (if invertible A then Some (P_Gauss_Jordan A) else None)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse_matrix A = (if invertible A then Some (P_Gauss_Jordan A) else None)
[PROOF STEP]
by (metis inverse_matrix_def option.sel the_inverse_matrix)


[STATEMENT]
lemma M_All:
  shows "(\<forall>m. P m) \<longleftrightarrow> (\<forall>m\<in>set [M1, M2, M3]. P m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>m. P m) = (\<forall>m\<in>set [M1, M2, M3]. P m)
[PROOF STEP]
by (metis M_UNIV UNIV_I)


[STATEMENT]
lemma mset_map[simp]: "mset (map f xs) = image_mset f (mset xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (map f xs) = image_mset f (mset xs)
[PROOF STEP]
by (induct xs) simp_all


[STATEMENT]
lemma of_nat_CARD_eq_0[simp]: "(of_nat CARD('a) :: 'b mod_ring) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat CARD('a) = 0
[PROOF STEP]
using dvd
[PROOF STATE]
proof (prove)
using this:
CARD('b) dvd CARD('a)

goal (1 subgoal):
 1. of_nat CARD('a) = 0
[PROOF STEP]
by (transfer, presburger)


[STATEMENT]
lemma accepts_conc:
 "accepts (conc L R) w = (\<exists>u v. w = u@v \<and> accepts L u \<and> accepts R v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. NAe.accepts (RegExp2NAe.conc L R) w = (\<exists>u v. w = u @ v \<and> NAe.accepts L u \<and> NAe.accepts R v)
[PROOF STEP]
apply (simp add: accepts_def True_steps_conc final_conc start_conc)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>q. ((\<exists>r. (start L, r) \<in> NAe.steps L w \<and> q = True # r) \<or> (\<exists>u v. w = u @ v \<and> (\<exists>r. (start L, r) \<in> NAe.steps L u \<and> fin L r \<and> (\<exists>s. (start R, s) \<in> NAe.steps R v \<and> q = False # s)))) \<and> (\<exists>s. q = False # s \<and> fin R s)) = (\<exists>u v. w = u @ v \<and> (\<exists>q. (start L, q) \<in> NAe.steps L u \<and> fin L q) \<and> (\<exists>q. (start R, q) \<in> NAe.steps R v \<and> fin R q))
[PROOF STEP]
apply (blast)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma ring_hom_lucas_lehmer_hom:
  "lucas_lehmer_hom m \<in> ring_hom lucas_lehmer_ring (lucas_lehmer_ring_mod m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lucas_lehmer_hom m \<in> ring_hom lucas_lehmer_ring (lucas_lehmer_ring_mod m)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lucas_lehmer_hom m \<in> ring_hom lucas_lehmer_ring (lucas_lehmer_ring_mod m)
[PROOF STEP]
interpret R: cring lucas_lehmer_ring
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cring lucas_lehmer_ring
[PROOF STEP]
..
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lucas_lehmer_hom m \<in> ring_hom lucas_lehmer_ring (lucas_lehmer_ring_mod m)
[PROOF STEP]
from m
[PROOF STATE]
proof (chain)
picking this:
1 < m
[PROOF STEP]
interpret S: cring "lucas_lehmer_ring_mod m"
[PROOF STATE]
proof (prove)
using this:
1 < m

goal (1 subgoal):
 1. cring (lucas_lehmer_ring_mod m)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lucas_lehmer_hom m \<in> ring_hom lucas_lehmer_ring (lucas_lehmer_ring_mod m)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lucas_lehmer_hom m \<in> ring_hom lucas_lehmer_ring (lucas_lehmer_ring_mod m)
[PROOF STEP]
unfolding ring_hom_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lucas_lehmer_hom m \<in> {h \<in> carrier lucas_lehmer_ring \<rightarrow> carrier (lucas_lehmer_ring_mod m). (\<forall>x y. x \<in> carrier lucas_lehmer_ring \<and> y \<in> carrier lucas_lehmer_ring \<longrightarrow> h (x \<otimes>\<^bsub>lucas_lehmer_ring\<^esub> y) = h x \<otimes>\<^bsub>lucas_lehmer_ring_mod m\<^esub> h y \<and> h (x \<oplus>\<^bsub>lucas_lehmer_ring\<^esub> y) = h x \<oplus>\<^bsub>lucas_lehmer_ring_mod m\<^esub> h y) \<and> h \<one>\<^bsub>lucas_lehmer_ring\<^esub> = \<one>\<^bsub>lucas_lehmer_ring_mod m\<^esub>}
[PROOF STEP]
using lucas_lehmer_hom_in_carrier m
[PROOF STATE]
proof (prove)
using this:
lucas_lehmer_hom m ?x \<in> {..<m} \<times> {..<m}
1 < m

goal (1 subgoal):
 1. lucas_lehmer_hom m \<in> {h \<in> carrier lucas_lehmer_ring \<rightarrow> carrier (lucas_lehmer_ring_mod m). (\<forall>x y. x \<in> carrier lucas_lehmer_ring \<and> y \<in> carrier lucas_lehmer_ring \<longrightarrow> h (x \<otimes>\<^bsub>lucas_lehmer_ring\<^esub> y) = h x \<otimes>\<^bsub>lucas_lehmer_ring_mod m\<^esub> h y \<and> h (x \<oplus>\<^bsub>lucas_lehmer_ring\<^esub> y) = h x \<oplus>\<^bsub>lucas_lehmer_ring_mod m\<^esub> h y) \<and> h \<one>\<^bsub>lucas_lehmer_ring\<^esub> = \<one>\<^bsub>lucas_lehmer_ring_mod m\<^esub>}
[PROOF STEP]
by (auto simp: lucas_lehmer_ring_mod_def lucas_lehmer_hom_add
                   lucas_lehmer_ring_def lucas_lehmer_hom_mult)
[PROOF STATE]
proof (state)
this:
lucas_lehmer_hom m \<in> ring_hom lucas_lehmer_ring (lucas_lehmer_ring_mod m)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma minus_fract [simp]:
  fixes a b :: "'a::idom"
  shows "- Fract a b = Fract (- a) b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - Fract a b = Fract (- a) b
[PROOF STEP]
by transfer simp


[STATEMENT]
lemma (in topological_space) at_within_eq:
  "at x within s = (INF S\<in>{S. open S \<and> x \<in> S}. principal (S \<inter> s - {x}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. at x within s = (INF S\<in>{S. open S \<and> x \<in> S}. principal (S \<inter> s - {x}))
[PROOF STEP]
unfolding nhds_def at_within_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inf (Inf (principal ` {S. open S \<and> x \<in> S})) (principal (s - {x})) = (INF S\<in>{S. open S \<and> x \<in> S}. principal (S \<inter> s - {x}))
[PROOF STEP]
by (subst INF_inf_const2[symmetric]) (auto simp: Diff_Int_distrib)


[STATEMENT]
lemma ennreal_sum_eq_top[simp]:
  fixes f :: "'a \<Rightarrow> ennreal"
  shows "finite I \<Longrightarrow> (\<Sum>i\<in>I. f i) = top \<longleftrightarrow> (\<exists>i\<in>I. f i = top)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite I \<Longrightarrow> (sum f I = top) = (\<exists>i\<in>I. f i = top)
[PROOF STEP]
by (induction I rule: finite_induct) auto


[STATEMENT]
lemma square_bounded_less:
  fixes a b::"'a :: linordered_ring_strict"
  shows "-a < b \<and> b < a \<Longrightarrow> b*b < a*a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - a < b \<and> b < a \<Longrightarrow> b * b < a * a
[PROOF STEP]
by (metis (no_types, lifting) leD leI minus_less_iff minus_mult_minus mult_strict_mono'
      neg_less_eq_nonneg neg_less_pos verit_minus_simplify(4) zero_le_mult_iff zero_le_square)


[STATEMENT]
lemma "\<bar>x - z\<bar> \<le> e \<and> \<bar>y - z\<bar> \<le> e \<and> 0 \<le> u \<and> 0 \<le> v \<and> u + v = 1 \<longrightarrow> \<bar>(u * x + v * y) - z\<bar> \<le> (e::real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>x - z\<bar> \<le> e \<and> \<bar>y - z\<bar> \<le> e \<and> 0 \<le> u \<and> 0 \<le> v \<and> u + v = 1 \<longrightarrow> \<bar>u * x + v * y - z\<bar> \<le> e
[PROOF STEP]
by sos


[STATEMENT]
lemma R2_R3_commute: "R2 o R3 = R3 o R2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R2 \<circ> R3 = R3 \<circ> R2
[PROOF STEP]
by (auto simp: rp_defs design_defs fun_eq_iff prefix_def split: cond_splits)


[STATEMENT]
lemma setprod_eq_zero [simp]:
  fixes f::"nat \<Rightarrow> nat"
  shows "(\<Prod>i < n. f i) = 0 \<longleftrightarrow> (\<exists>i < n. f i = 0)"
    "(\<Prod>i \<le> n. f i) = 0 \<longleftrightarrow> (\<exists>i \<le> n. f i = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (prod f {..<n} = 0) = (\<exists>i<n. f i = 0) &&& (prod f {..n} = 0) = (\<exists>i\<le>n. f i = 0)
[PROOF STEP]
by (auto)


[STATEMENT]
lemma tendsto_arcosh_strong [tendsto_intros]:
  fixes f :: "_ \<Rightarrow> real"
  assumes "(f \<longlongrightarrow> a) F" "a \<ge> 1" "eventually (\<lambda>x. f x \<ge> 1) F"
  shows   "((\<lambda>x. arcosh (f x)) \<longlongrightarrow> arcosh a) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. arcosh (f x)) \<longlongrightarrow> arcosh a) F
[PROOF STEP]
by (rule continuous_on_tendsto_compose[OF continuous_on_arcosh[OF order.refl]])
     (use assms in auto)


[STATEMENT]
lemma lfp_prod:
  fixes F :: "'a::complete_lattice \<times> 'b::complete_lattice \<Rightarrow> 'a \<times> 'b"
  assumes "mono F"
  shows "lfp F = (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))),
                 (lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y)))))"
  (is "lfp F = (?x, ?y)")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lfp F = (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y))))
[PROOF STEP]
proof(rule lfp_eqI[OF assms])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y)))) = (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y))))
 2. \<And>z. F z = z \<Longrightarrow> (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y)))) \<le> z
[PROOF STEP]
have 1: "fst (F (?x, ?y)) = ?x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y))))) = lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y))))))
[PROOF STEP]
by (rule trans [symmetric, OF lfp_unfold])
       (blast intro!: monoI monoD[OF assms(1)] fst_mono snd_mono Pair_mono lfp_mono)+
[PROOF STATE]
proof (state)
this:
fst (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y))))) = lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y))))))

goal (2 subgoals):
 1. F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y)))) = (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y))))
 2. \<And>z. F z = z \<Longrightarrow> (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y)))) \<le> z
[PROOF STEP]
have 2: "snd (F (?x, ?y)) = ?y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y))))) = lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y)))
[PROOF STEP]
by (rule trans [symmetric, OF lfp_unfold])
       (blast intro!: monoI monoD[OF assms(1)] fst_mono snd_mono Pair_mono lfp_mono)+
[PROOF STATE]
proof (state)
this:
snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y))))) = lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y)))

goal (2 subgoals):
 1. F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y)))) = (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y))))
 2. \<And>z. F z = z \<Longrightarrow> (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y)))) \<le> z
[PROOF STEP]
from 1 2
[PROOF STATE]
proof (chain)
picking this:
fst (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y))))) = lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y))))))
snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y))))) = lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y)))
[PROOF STEP]
show "F (?x, ?y) = (?x, ?y)"
[PROOF STATE]
proof (prove)
using this:
fst (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y))))) = lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y))))))
snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y))))) = lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y)))

goal (1 subgoal):
 1. F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y)))) = (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y))))
[PROOF STEP]
by (simp add: prod_eq_iff)
[PROOF STATE]
proof (state)
this:
F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y)))) = (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y))))

goal (1 subgoal):
 1. \<And>z. F z = z \<Longrightarrow> (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y)))) \<le> z
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>z. F z = z \<Longrightarrow> (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y)))) \<le> z
[PROOF STEP]
fix z
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>z. F z = z \<Longrightarrow> (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y)))) \<le> z
[PROOF STEP]
assume F_z: "F z = z"
[PROOF STATE]
proof (state)
this:
F z = z

goal (1 subgoal):
 1. \<And>z. F z = z \<Longrightarrow> (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y)))) \<le> z
[PROOF STEP]
obtain x y where z: "z = (x, y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x y. z = (x, y) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (rule prod.exhaust)
[PROOF STATE]
proof (state)
this:
z = (x, y)

goal (1 subgoal):
 1. \<And>z. F z = z \<Longrightarrow> (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y)))) \<le> z
[PROOF STEP]
from F_z z
[PROOF STATE]
proof (chain)
picking this:
F z = z
z = (x, y)
[PROOF STEP]
have F_x: "fst (F (x, y)) = x"
[PROOF STATE]
proof (prove)
using this:
F z = z
z = (x, y)

goal (1 subgoal):
 1. fst (F (x, y)) = x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fst (F (x, y)) = x

goal (1 subgoal):
 1. \<And>z. F z = z \<Longrightarrow> (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y)))) \<le> z
[PROOF STEP]
from F_z z
[PROOF STATE]
proof (chain)
picking this:
F z = z
z = (x, y)
[PROOF STEP]
have F_y: "snd (F (x, y)) = y"
[PROOF STATE]
proof (prove)
using this:
F z = z
z = (x, y)

goal (1 subgoal):
 1. snd (F (x, y)) = y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
snd (F (x, y)) = y

goal (1 subgoal):
 1. \<And>z. F z = z \<Longrightarrow> (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y)))) \<le> z
[PROOF STEP]
let ?y1 = "lfp (\<lambda>y. snd (F (x, y)))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>z. F z = z \<Longrightarrow> (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y)))) \<le> z
[PROOF STEP]
have "?y1 \<le> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lfp (\<lambda>y. snd (F (x, y))) \<le> y
[PROOF STEP]
by (rule lfp_lowerbound, simp add: F_y)
[PROOF STATE]
proof (state)
this:
lfp (\<lambda>y. snd (F (x, y))) \<le> y

goal (1 subgoal):
 1. \<And>z. F z = z \<Longrightarrow> (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y)))) \<le> z
[PROOF STEP]
hence "fst (F (x, ?y1)) \<le> fst (F (x, y))"
[PROOF STATE]
proof (prove)
using this:
lfp (\<lambda>y. snd (F (x, y))) \<le> y

goal (1 subgoal):
 1. fst (F (x, lfp (\<lambda>y. snd (F (x, y))))) \<le> fst (F (x, y))
[PROOF STEP]
by (simp add: assms fst_mono monoD)
[PROOF STATE]
proof (state)
this:
fst (F (x, lfp (\<lambda>y. snd (F (x, y))))) \<le> fst (F (x, y))

goal (1 subgoal):
 1. \<And>z. F z = z \<Longrightarrow> (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y)))) \<le> z
[PROOF STEP]
hence "fst (F (x, ?y1)) \<le> x"
[PROOF STATE]
proof (prove)
using this:
fst (F (x, lfp (\<lambda>y. snd (F (x, y))))) \<le> fst (F (x, y))

goal (1 subgoal):
 1. fst (F (x, lfp (\<lambda>y. snd (F (x, y))))) \<le> x
[PROOF STEP]
using F_x
[PROOF STATE]
proof (prove)
using this:
fst (F (x, lfp (\<lambda>y. snd (F (x, y))))) \<le> fst (F (x, y))
fst (F (x, y)) = x

goal (1 subgoal):
 1. fst (F (x, lfp (\<lambda>y. snd (F (x, y))))) \<le> x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fst (F (x, lfp (\<lambda>y. snd (F (x, y))))) \<le> x

goal (1 subgoal):
 1. \<And>z. F z = z \<Longrightarrow> (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y)))) \<le> z
[PROOF STEP]
hence 1: "?x \<le> x"
[PROOF STATE]
proof (prove)
using this:
fst (F (x, lfp (\<lambda>y. snd (F (x, y))))) \<le> x

goal (1 subgoal):
 1. lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))) \<le> x
[PROOF STEP]
by (simp add: lfp_lowerbound)
[PROOF STATE]
proof (state)
this:
lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))) \<le> x

goal (1 subgoal):
 1. \<And>z. F z = z \<Longrightarrow> (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y)))) \<le> z
[PROOF STEP]
hence "snd (F (?x, y)) \<le> snd (F (x, y))"
[PROOF STATE]
proof (prove)
using this:
lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))) \<le> x

goal (1 subgoal):
 1. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y)) \<le> snd (F (x, y))
[PROOF STEP]
by (simp add: assms snd_mono monoD)
[PROOF STATE]
proof (state)
this:
snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y)) \<le> snd (F (x, y))

goal (1 subgoal):
 1. \<And>z. F z = z \<Longrightarrow> (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y)))) \<le> z
[PROOF STEP]
hence "snd (F (?x, y)) \<le> y"
[PROOF STATE]
proof (prove)
using this:
snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y)) \<le> snd (F (x, y))

goal (1 subgoal):
 1. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y)) \<le> y
[PROOF STEP]
using F_y
[PROOF STATE]
proof (prove)
using this:
snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y)) \<le> snd (F (x, y))
snd (F (x, y)) = y

goal (1 subgoal):
 1. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y)) \<le> y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y)) \<le> y

goal (1 subgoal):
 1. \<And>z. F z = z \<Longrightarrow> (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y)))) \<le> z
[PROOF STEP]
hence 2: "?y \<le> y"
[PROOF STATE]
proof (prove)
using this:
snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y)) \<le> y

goal (1 subgoal):
 1. lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y))) \<le> y
[PROOF STEP]
by (simp add: lfp_lowerbound)
[PROOF STATE]
proof (state)
this:
lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y))) \<le> y

goal (1 subgoal):
 1. \<And>z. F z = z \<Longrightarrow> (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y)))) \<le> z
[PROOF STEP]
show "(?x, ?y) \<le> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y)))) \<le> z
[PROOF STEP]
using z 1 2
[PROOF STATE]
proof (prove)
using this:
z = (x, y)
lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))) \<le> x
lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y))) \<le> y

goal (1 subgoal):
 1. (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y)))) \<le> z
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), lfp (\<lambda>y. snd (F (lfp (\<lambda>x. fst (F (x, lfp (\<lambda>y. snd (F (x, y)))))), y)))) \<le> z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma [simp]: "(s-(1::real) < r) = (s < r+1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (s - 1 < r) = (s < r + 1)
[PROOF STEP]
by arith


[STATEMENT]
lemma apply_power_mod_order_eq [simp]:
  "(f ^ (n mod order f a)) \<langle>$\<rangle> a = (f ^ n) \<langle>$\<rangle> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f ^ (n mod order f a)) \<langle>$\<rangle> a = (f ^ n) \<langle>$\<rangle> a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (f ^ (n mod order f a)) \<langle>$\<rangle> a = (f ^ n) \<langle>$\<rangle> a
[PROOF STEP]
have "(f ^ n) \<langle>$\<rangle> a = (f ^ (n mod order f a + order f a * (n div order f a))) \<langle>$\<rangle> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f ^ n) \<langle>$\<rangle> a = (f ^ (n mod order f a + order f a * (n div order f a))) \<langle>$\<rangle> a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(f ^ n) \<langle>$\<rangle> a = (f ^ (n mod order f a + order f a * (n div order f a))) \<langle>$\<rangle> a

goal (1 subgoal):
 1. (f ^ (n mod order f a)) \<langle>$\<rangle> a = (f ^ n) \<langle>$\<rangle> a
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(f ^ n) \<langle>$\<rangle> a = (f ^ (n mod order f a + order f a * (n div order f a))) \<langle>$\<rangle> a

goal (1 subgoal):
 1. (f ^ (n mod order f a)) \<langle>$\<rangle> a = (f ^ n) \<langle>$\<rangle> a
[PROOF STEP]
have "\<dots> = (f ^ (n mod order f a) * f ^ (order f a * (n div order f a))) \<langle>$\<rangle> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f ^ (n mod order f a + order f a * (n div order f a))) \<langle>$\<rangle> a = (f ^ (n mod order f a) * f ^ (order f a * (n div order f a))) \<langle>$\<rangle> a
[PROOF STEP]
by (simp flip: power_add)
[PROOF STATE]
proof (state)
this:
(f ^ (n mod order f a + order f a * (n div order f a))) \<langle>$\<rangle> a = (f ^ (n mod order f a) * f ^ (order f a * (n div order f a))) \<langle>$\<rangle> a

goal (1 subgoal):
 1. (f ^ (n mod order f a)) \<langle>$\<rangle> a = (f ^ n) \<langle>$\<rangle> a
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(f ^ n) \<langle>$\<rangle> a = (f ^ (n mod order f a) * f ^ (order f a * (n div order f a))) \<langle>$\<rangle> a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(f ^ n) \<langle>$\<rangle> a = (f ^ (n mod order f a) * f ^ (order f a * (n div order f a))) \<langle>$\<rangle> a

goal (1 subgoal):
 1. (f ^ (n mod order f a)) \<langle>$\<rangle> a = (f ^ n) \<langle>$\<rangle> a
[PROOF STEP]
by (simp add: apply_times)
[PROOF STATE]
proof (state)
this:
(f ^ (n mod order f a)) \<langle>$\<rangle> a = (f ^ n) \<langle>$\<rangle> a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tendsto_cosh [tendsto_intros]:
  fixes f :: "_ \<Rightarrow>'a::{real_normed_field,banach}"
  shows "(f \<longlongrightarrow> a) F \<Longrightarrow> ((\<lambda>x. cosh (f x)) \<longlongrightarrow> cosh a) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<longlongrightarrow> a) F \<Longrightarrow> ((\<lambda>x. cosh (f x)) \<longlongrightarrow> cosh a) F
[PROOF STEP]
by (rule isCont_tendsto_compose [OF isCont_cosh])


[STATEMENT]
lemma inner_add_right: "inner x (y + z) = inner x y + inner x z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner x (y + z) = inner x y + inner x z
[PROOF STEP]
using inner_add_left [of y z x]
[PROOF STATE]
proof (prove)
using this:
inner (y + z) x = inner y x + inner z x

goal (1 subgoal):
 1. inner x (y + z) = inner x y + inner x z
[PROOF STEP]
by (simp only: inner_commute)


[STATEMENT]
lemma cltn2_transpose_id [simp]: "cltn2_transpose cltn2_id = cltn2_id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cltn2_transpose cltn2_id = cltn2_id
[PROOF STEP]
using cltn2_transpose_abs
[PROOF STATE]
proof (prove)
using this:
invertible ?M \<Longrightarrow> cltn2_transpose (cltn2_abs ?M) = cltn2_abs (Finite_Cartesian_Product.transpose ?M)

goal (1 subgoal):
 1. cltn2_transpose cltn2_id = cltn2_id
[PROOF STEP]
unfolding cltn2_id_def
[PROOF STATE]
proof (prove)
using this:
invertible ?M \<Longrightarrow> cltn2_transpose (cltn2_abs ?M) = cltn2_abs (Finite_Cartesian_Product.transpose ?M)

goal (1 subgoal):
 1. cltn2_transpose (cltn2_abs (mat 1)) = cltn2_abs (mat 1)
[PROOF STEP]
by (simp add: transpose_mat matrix_id_invertible)


[STATEMENT]
lemma map_ds_func2:
  fixes g :: "'a::complete_lattice \<Rightarrow> 'b::complete_lattice"
  shows "map_ds (f \<circ> g) = map_ds f \<circ> map_ds g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_ds (f \<circ> g) = map_ds f \<circ> map_ds g
[PROOF STEP]
unfolding map_ds_def fun_eq_iff comp_def ds_def SSup_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. Abs_downset (\<down> (f (g (\<Squnion> Rep_downset x)))) = Abs_downset (\<down> (f (\<Squnion> Rep_downset (Abs_downset (\<down> (g (\<Squnion> Rep_downset x)))))))
[PROOF STEP]
by (metis Abs_downset_inverse Sup_atMost atMost_def downset_prop rangeI)


[STATEMENT]
theorem Cauchy_integral_circlepath:
  assumes contf: "continuous_on (cball z r) f" and holf: "f holomorphic_on (ball z r)" and wz: "norm(w - z) < r"
  shows "((\<lambda>u. f u/(u - w)) has_contour_integral (2 * of_real pi * \<i> * f w))
         (circlepath z r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>u. f u / (u - w)) has_contour_integral 2 * complex_of_real pi * \<i> * f w) (circlepath z r)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>u. f u / (u - w)) has_contour_integral 2 * complex_of_real pi * \<i> * f w) (circlepath z r)
[PROOF STEP]
have "r > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < r
[PROOF STEP]
using assms le_less_trans norm_ge_zero
[PROOF STATE]
proof (prove)
using this:
continuous_on (cball z r) f
f holomorphic_on ball z r
cmod (w - z) < r
\<lbrakk>?x \<le> ?y; ?y < ?z\<rbrakk> \<Longrightarrow> ?x < ?z
0 \<le> norm ?x

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

goal (1 subgoal):
 1. ((\<lambda>u. f u / (u - w)) has_contour_integral 2 * complex_of_real pi * \<i> * f w) (circlepath z r)
[PROOF STEP]
have "((\<lambda>u. f u / (u - w)) has_contour_integral (2 * pi) * \<i> * winding_number (circlepath z r) w * f w)
        (circlepath z r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>u. f u / (u - w)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number (circlepath z r) w * f w) (circlepath z r)
[PROOF STEP]
proof (rule Cauchy_integral_formula_weak [where S = "cball z r" and k = "{}"])
[PROOF STATE]
proof (state)
goal (8 subgoals):
 1. convex (cball z r)
 2. finite {}
 3. continuous_on (cball z r) f
 4. \<And>x. x \<in> interior (cball z r) - {} \<Longrightarrow> f field_differentiable at x
 5. w \<in> interior (cball z r) - {}
 6. valid_path (circlepath z r)
 7. path_image (circlepath z r) \<subseteq> cball z r - {w}
 8. pathfinish (circlepath z r) = pathstart (circlepath z r)
[PROOF STEP]
show "\<And>x. x \<in> interior (cball z r) - {} \<Longrightarrow>
         f field_differentiable at x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> interior (cball z r) - {} \<Longrightarrow> f field_differentiable at x
[PROOF STEP]
using holf holomorphic_on_imp_differentiable_at
[PROOF STATE]
proof (prove)
using this:
f holomorphic_on ball z r
\<lbrakk>?f holomorphic_on ?s; open ?s; ?x \<in> ?s\<rbrakk> \<Longrightarrow> ?f field_differentiable at ?x

goal (1 subgoal):
 1. \<And>x. x \<in> interior (cball z r) - {} \<Longrightarrow> f field_differentiable at x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?x \<in> interior (cball z r) - {} \<Longrightarrow> f field_differentiable at ?x

goal (7 subgoals):
 1. convex (cball z r)
 2. finite {}
 3. continuous_on (cball z r) f
 4. w \<in> interior (cball z r) - {}
 5. valid_path (circlepath z r)
 6. path_image (circlepath z r) \<subseteq> cball z r - {w}
 7. pathfinish (circlepath z r) = pathstart (circlepath z r)
[PROOF STEP]
have "w \<notin> sphere z r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<notin> sphere z r
[PROOF STEP]
by simp (metis dist_commute dist_norm not_le order_refl wz)
[PROOF STATE]
proof (state)
this:
w \<notin> sphere z r

goal (7 subgoals):
 1. convex (cball z r)
 2. finite {}
 3. continuous_on (cball z r) f
 4. w \<in> interior (cball z r) - {}
 5. valid_path (circlepath z r)
 6. path_image (circlepath z r) \<subseteq> cball z r - {w}
 7. pathfinish (circlepath z r) = pathstart (circlepath z r)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
w \<notin> sphere z r
[PROOF STEP]
show "path_image (circlepath z r) \<subseteq> cball z r - {w}"
[PROOF STATE]
proof (prove)
using this:
w \<notin> sphere z r

goal (1 subgoal):
 1. path_image (circlepath z r) \<subseteq> cball z r - {w}
[PROOF STEP]
using \<open>r > 0\<close>
[PROOF STATE]
proof (prove)
using this:
w \<notin> sphere z r
0 < r

goal (1 subgoal):
 1. path_image (circlepath z r) \<subseteq> cball z r - {w}
[PROOF STEP]
by (auto simp add: cball_def sphere_def)
[PROOF STATE]
proof (state)
this:
path_image (circlepath z r) \<subseteq> cball z r - {w}

goal (6 subgoals):
 1. convex (cball z r)
 2. finite {}
 3. continuous_on (cball z r) f
 4. w \<in> interior (cball z r) - {}
 5. valid_path (circlepath z r)
 6. pathfinish (circlepath z r) = pathstart (circlepath z r)
[PROOF STEP]
qed (use wz in \<open>simp_all add: dist_norm norm_minus_commute contf\<close>)
[PROOF STATE]
proof (state)
this:
((\<lambda>u. f u / (u - w)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number (circlepath z r) w * f w) (circlepath z r)

goal (1 subgoal):
 1. ((\<lambda>u. f u / (u - w)) has_contour_integral 2 * complex_of_real pi * \<i> * f w) (circlepath z r)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>u. f u / (u - w)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number (circlepath z r) w * f w) (circlepath z r)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>u. f u / (u - w)) has_contour_integral complex_of_real (2 * pi) * \<i> * winding_number (circlepath z r) w * f w) (circlepath z r)

goal (1 subgoal):
 1. ((\<lambda>u. f u / (u - w)) has_contour_integral 2 * complex_of_real pi * \<i> * f w) (circlepath z r)
[PROOF STEP]
by (simp add: winding_number_circlepath assms)
[PROOF STATE]
proof (state)
this:
((\<lambda>u. f u / (u - w)) has_contour_integral 2 * complex_of_real pi * \<i> * f w) (circlepath z r)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma expands_to_powr_nat_0:
  assumes "eventually (\<lambda>x. f x = 0) at_top" "(g expands_to G) basis" "trimmed G"
          "basis_wf basis" "length basis = expansion_level TYPE('a :: multiseries)"
  shows   "((\<lambda>x. powr_nat (f x) (g x)) expands_to (zero_expansion :: 'a)) basis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. powr_nat (f x) (g x)) expands_to zero_expansion) basis
[PROOF STEP]
proof (rule expands_to_cong [OF expands_to_zero])
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. basis_wf basis
 2. length basis = expansion_level TYPE('a)
 3. \<forall>\<^sub>F x in at_top. 0 = powr_nat (f x) (g x)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in at_top. f x = 0
(g expands_to G) basis
trimmed G
basis_wf basis
length basis = expansion_level TYPE('a)
[PROOF STEP]
have "eventually (\<lambda>x. g x \<noteq> 0) at_top"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. f x = 0
(g expands_to G) basis
trimmed G
basis_wf basis
length basis = expansion_level TYPE('a)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. g x \<noteq> 0
[PROOF STEP]
using expands_to_imp_eventually_nz[of basis g G]
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. f x = 0
(g expands_to G) basis
trimmed G
basis_wf basis
length basis = expansion_level TYPE('a)
\<lbrakk>basis_wf basis; (g expands_to G) basis; trimmed G\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in at_top. g x \<noteq> 0

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. g x \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. g x \<noteq> 0

goal (3 subgoals):
 1. basis_wf basis
 2. length basis = expansion_level TYPE('a)
 3. \<forall>\<^sub>F x in at_top. 0 = powr_nat (f x) (g x)
[PROOF STEP]
with assms(1)
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in at_top. f x = 0
\<forall>\<^sub>F x in at_top. g x \<noteq> 0
[PROOF STEP]
show "eventually (\<lambda>x. 0 = powr_nat (f x) (g x)) at_top"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. f x = 0
\<forall>\<^sub>F x in at_top. g x \<noteq> 0

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

goal (2 subgoals):
 1. basis_wf basis
 2. length basis = expansion_level TYPE('a)
[PROOF STEP]
qed (insert assms, auto elim!: eventually_mono simp: powr_nat_def)


[STATEMENT]
lemma min_set_Union:
  "finite X \<Longrightarrow> min_set (\<Union> (min_set ` X)) = min_set (\<Union> X)" for X :: "'a fset set set"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite X \<Longrightarrow> min_set (\<Union> (min_set ` X)) = min_set (\<Union> X)
[PROOF STEP]
by (induction X rule: finite_induct) (force, metis Sup_insert image_insert min_set_min_union min_union_def)


[STATEMENT]
lemma matrix_to_iarray_morph:
  fixes A::"'a^'n::{mod_type}^'m::{mod_type}"
  shows "(A = B) = (matrix_to_iarray A = matrix_to_iarray B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A = B) = (matrix_to_iarray A = matrix_to_iarray B)
[PROOF STEP]
unfolding matrix_to_iarray_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A = B) = (IArray (map (vec_to_iarray \<circ> ($) A \<circ> mod_type_class.from_nat) [0..<CARD('m)]) = IArray (map (vec_to_iarray \<circ> ($) B \<circ> mod_type_class.from_nat) [0..<CARD('m)]))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A = B) = (\<forall>x\<in>{0..<CARD('m)}. vec_to_iarray (A $ mod_type_class.from_nat x) = vec_to_iarray (B $ mod_type_class.from_nat x))
[PROOF STEP]
unfolding forall_from_nat_rw[of "\<lambda>x. vec_to_iarray (A $ x) = vec_to_iarray (B $ x)"]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A = B) = (\<forall>x. vec_to_iarray (A $ mod_type_class.from_nat x) = vec_to_iarray (B $ mod_type_class.from_nat x))
[PROOF STEP]
by (metis from_nat_to_nat_id vec_eq_iff vec_to_iarray_morph)


[STATEMENT]
lemma eigenspace_memberD:
  assumes "x \<in> space_as_set (eigenspace e A)"
  shows "A *\<^sub>V x = e *\<^sub>C x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *\<^sub>V x = e *\<^sub>C x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in> space_as_set (eigenspace e A)

goal (1 subgoal):
 1. A *\<^sub>V x = e *\<^sub>C x
[PROOF STEP]
unfolding eigenspace_def
[PROOF STATE]
proof (prove)
using this:
x \<in> space_as_set (kernel (A - e *\<^sub>C id_cblinfun))

goal (1 subgoal):
 1. A *\<^sub>V x = e *\<^sub>C x
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x A e. \<lbrakk>bounded_clinear A; x \<in> (\<lambda>x. A x - e *\<^sub>C x) -` {0::'a}\<rbrakk> \<Longrightarrow> A x = e *\<^sub>C x
[PROOF STEP]
by auto


[STATEMENT]
lemma hlog_eq_one [simp]: "\<And>a. 0 < a \<Longrightarrow> a \<noteq> 1 \<Longrightarrow> hlog a a = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. \<lbrakk>0 < a; a \<noteq> 1\<rbrakk> \<Longrightarrow> hlog a a = 1
[PROOF STEP]
by transfer (rule log_eq_one)


[STATEMENT]
lemma less_list_iff_less_sets:
  assumes "sorted xs" "sorted ys"
  shows "xs < ys \<longleftrightarrow> list.set xs \<lless> list.set ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (xs < ys) = (list.set xs \<lless> list.set ys)
[PROOF STEP]
using assms sorted_hd_le sorted_le_last
[PROOF STATE]
proof (prove)
using this:
sorted xs
sorted ys
\<lbrakk>sorted ?xs; ?x \<in> list.set ?xs\<rbrakk> \<Longrightarrow> hd ?xs \<le> ?x
\<lbrakk>sorted ?xs; ?x \<in> list.set ?xs\<rbrakk> \<Longrightarrow> ?x \<le> last ?xs

goal (1 subgoal):
 1. (xs < ys) = (list.set xs \<lless> list.set ys)
[PROOF STEP]
by (force simp: less_list_def less_sets_def intro: order.trans)


[STATEMENT]
lemma has_sum_Im:
  assumes "has_sum f M a"
  shows "has_sum (\<lambda>x. Im (f x)) M (Im a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. has_sum (\<lambda>x. Im (f x)) M (Im a)
[PROOF STEP]
apply (rule has_sum_comm_additive[where f=Im, unfolded o_def])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. additive Im
 2. Im \<midarrow>a\<rightarrow> Im a
 3. has_sum f M a
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
has_sum f M a

goal (3 subgoals):
 1. additive Im
 2. Im \<midarrow>a\<rightarrow> Im a
 3. has_sum f M a
[PROOF STEP]
by (auto intro!: additive.intro tendsto_Im)


[STATEMENT]
lemma root_nat_floor_lower: assumes p0: "p \<noteq> 0"
  shows "root_nat_floor p x ^ p \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. root_nat_floor p x ^ p \<le> int x
[PROOF STEP]
using root_int_floor_pos_lower[OF p0, of x]
[PROOF STATE]
proof (prove)
using this:
0 \<le> int x \<Longrightarrow> root_int_floor_pos p (int x) ^ p \<le> int x

goal (1 subgoal):
 1. root_nat_floor p x ^ p \<le> int x
[PROOF STEP]
unfolding root_nat_floor_def
[PROOF STATE]
proof (prove)
using this:
0 \<le> int x \<Longrightarrow> root_int_floor_pos p (int x) ^ p \<le> int x

goal (1 subgoal):
 1. root_int_floor_pos p (int x) ^ p \<le> int x
[PROOF STEP]
by auto


[STATEMENT]
lemma zero_less_ceiling [simp]: "0 < \<lceil>x\<rceil> \<longleftrightarrow> 0 < x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 < \<lceil>x\<rceil>) = ((0::'a) < x)
[PROOF STEP]
by (simp add: less_ceiling_iff)


[STATEMENT]
lemma Right_Coset_eq_iff:
  assumes "x \<in> G" and "y \<in> G"
  shows "H |\<cdot> x = (H |\<cdot> y) \<longleftrightarrow> H |\<cdot> x \<inter> (H |\<cdot> y) \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (H |\<cdot> x = H |\<cdot> y) = (H |\<cdot> x \<inter> (H |\<cdot> y) \<noteq> {})
[PROOF STEP]
using assms Right_Coset_is_orbit
[PROOF STATE]
proof (prove)
using this:
x \<in> G
y \<in> G
?x \<in> G \<Longrightarrow> H |\<cdot> ?x = orbit.Class ?x

goal (1 subgoal):
 1. (H |\<cdot> x = H |\<cdot> y) = (H |\<cdot> x \<inter> (H |\<cdot> y) \<noteq> {})
[PROOF STEP]
by (metis Int_absorb orbit.disjoint orbit.natural.map_closed orbit.non_vacuous)


[STATEMENT]
lemma col_four_block_mat:
  assumes c: "A \<in> carrier_mat nr1 nc1" "B \<in> carrier_mat nr1 nc2"
  "C \<in> carrier_mat nr2 nc1" "D \<in> carrier_mat nr2 nc2"
  shows
  "j < nc1 \<Longrightarrow> col (four_block_mat A B C D) j = col A j @\<^sub>v col C j" (is "_ \<Longrightarrow> ?AC")
  "\<not> j < nc1 \<Longrightarrow> j < nc1 + nc2 \<Longrightarrow> col (four_block_mat A B C D) j = col B (j - nc1) @\<^sub>v col D (j - nc1)"
  (is "_ \<Longrightarrow> _ \<Longrightarrow> ?BD")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (j < nc1 \<Longrightarrow> col (four_block_mat A B C D) j = col A j @\<^sub>v col C j) &&& (\<lbrakk>\<not> j < nc1; j < nc1 + nc2\<rbrakk> \<Longrightarrow> col (four_block_mat A B C D) j = col B (j - nc1) @\<^sub>v col D (j - nc1))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. j < nc1 \<Longrightarrow> col (four_block_mat A B C D) j = col A j @\<^sub>v col C j
 2. \<lbrakk>\<not> j < nc1; j < nc1 + nc2\<rbrakk> \<Longrightarrow> col (four_block_mat A B C D) j = col B (j - nc1) @\<^sub>v col D (j - nc1)
[PROOF STEP]
assume j: "j < nc1"
[PROOF STATE]
proof (state)
this:
j < nc1

goal (2 subgoals):
 1. j < nc1 \<Longrightarrow> col (four_block_mat A B C D) j = col A j @\<^sub>v col C j
 2. \<lbrakk>\<not> j < nc1; j < nc1 + nc2\<rbrakk> \<Longrightarrow> col (four_block_mat A B C D) j = col B (j - nc1) @\<^sub>v col D (j - nc1)
[PROOF STEP]
show ?AC
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. col (four_block_mat A B C D) j = col A j @\<^sub>v col C j
[PROOF STEP]
by (rule eq_vecI, insert j c, auto)
[PROOF STATE]
proof (state)
this:
col (four_block_mat A B C D) j = col A j @\<^sub>v col C j

goal (1 subgoal):
 1. \<lbrakk>\<not> j < nc1; j < nc1 + nc2\<rbrakk> \<Longrightarrow> col (four_block_mat A B C D) j = col B (j - nc1) @\<^sub>v col D (j - nc1)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<not> j < nc1; j < nc1 + nc2\<rbrakk> \<Longrightarrow> col (four_block_mat A B C D) j = col B (j - nc1) @\<^sub>v col D (j - nc1)
[PROOF STEP]
assume j: "\<not> j < nc1" "j < nc1 + nc2"
[PROOF STATE]
proof (state)
this:
\<not> j < nc1
j < nc1 + nc2

goal (1 subgoal):
 1. \<lbrakk>\<not> j < nc1; j < nc1 + nc2\<rbrakk> \<Longrightarrow> col (four_block_mat A B C D) j = col B (j - nc1) @\<^sub>v col D (j - nc1)
[PROOF STEP]
show ?BD
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. col (four_block_mat A B C D) j = col B (j - nc1) @\<^sub>v col D (j - nc1)
[PROOF STEP]
by (rule eq_vecI, insert j c, auto)
[PROOF STATE]
proof (state)
this:
col (four_block_mat A B C D) j = col B (j - nc1) @\<^sub>v col D (j - nc1)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma add_independentS_doubleD:
  assumes "add_independentS [A,B]"
  shows   "\<And>b a. b\<in>B \<Longrightarrow> a\<in>A \<Longrightarrow> a + b = 0 \<Longrightarrow> a = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>b a. \<lbrakk>b \<in> B; a \<in> A; a + b = (0::'a)\<rbrakk> \<Longrightarrow> a = (0::'a)
[PROOF STEP]
using assms sum_list_sets_single[of B]
[PROOF STATE]
proof (prove)
using this:
add_independentS [A, B]
(\<Sum>X\<leftarrow>[B]. X) = B

goal (1 subgoal):
 1. \<And>b a. \<lbrakk>b \<in> B; a \<in> A; a + b = (0::'a)\<rbrakk> \<Longrightarrow> a = (0::'a)
[PROOF STEP]
by simp


[STATEMENT]
lemma lim_inverse_n': "((\<lambda>n. 1 / n) \<longlongrightarrow> 0) sequentially"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. 1 / real n) \<longlonglongrightarrow> 0
[PROOF STEP]
using lim_inverse_n
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. inverse (of_nat n)) \<longlonglongrightarrow> (0::?'a)

goal (1 subgoal):
 1. (\<lambda>n. 1 / real n) \<longlonglongrightarrow> 0
[PROOF STEP]
by (simp add: inverse_eq_divide)


[STATEMENT]
lemma abs_lesseq_square: "abs (x :: real) \<le> abs y \<longleftrightarrow> x * x \<le> y * y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<bar>x\<bar> \<le> \<bar>y\<bar>) = (x * x \<le> y * y)
[PROOF STEP]
using square_lesseq_square[of "abs x" "abs y"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 \<le> \<bar>x\<bar>; 0 \<le> \<bar>y\<bar>\<rbrakk> \<Longrightarrow> (\<bar>x\<bar> * \<bar>x\<bar> \<le> \<bar>y\<bar> * \<bar>y\<bar>) = (\<bar>x\<bar> \<le> \<bar>y\<bar>)

goal (1 subgoal):
 1. (\<bar>x\<bar> \<le> \<bar>y\<bar>) = (x * x \<le> y * y)
[PROOF STEP]
by auto


[STATEMENT]
lemma subset_imp_less_zmset: "M \<subset>#\<^sub>z N \<Longrightarrow> M < N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M \<subset>#\<^sub>z N \<Longrightarrow> M < N
[PROOF STEP]
by (metis le_neq_trans subset_eq_imp_le_zmset subset_zmset_def)


[STATEMENT]
lemma fds_const_mult [simp]:
  "fds_const (a * b :: 'a :: semiring_0) = fds_const a * fds_const b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_const (a * b) = fds_const a * fds_const b
[PROOF STEP]
by (simp add: fds_eq_iff fds_nth_const fds_nth_mult)