[STATEMENT]
lemma limsup_subseq_lim:
  fixes u::"nat \<Rightarrow> 'a :: {complete_linorder, linorder_topology}"
  shows "\<exists>r::nat\<Rightarrow>nat. strict_mono r \<and> (u o r) \<longlonglongrightarrow> limsup u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
proof (cases)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
 2. \<not> ?P \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
assume "\<forall>n. \<exists>p>n. \<forall>m\<ge>p. u m \<le> u p"
[PROOF STATE]
proof (state)
this:
\<forall>n. \<exists>p>n. \<forall>m\<ge>p. u m \<le> u p

goal (2 subgoals):
 1. ?P \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
 2. \<not> ?P \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>n. \<exists>p>n. \<forall>m\<ge>p. u m \<le> u p
[PROOF STEP]
have "\<exists>r. \<forall>n. (\<forall>m\<ge>r n. u m \<le> u (r n)) \<and> r n < r (Suc n)"
[PROOF STATE]
proof (prove)
using this:
\<forall>n. \<exists>p>n. \<forall>m\<ge>p. u m \<le> u p

goal (1 subgoal):
 1. \<exists>r. \<forall>n. (\<forall>m\<ge>r n. u m \<le> u (r n)) \<and> r n < r (Suc n)
[PROOF STEP]
by (intro dependent_nat_choice) (auto simp: conj_commute)
[PROOF STATE]
proof (state)
this:
\<exists>r. \<forall>n. (\<forall>m\<ge>r n. u m \<le> u (r n)) \<and> r n < r (Suc n)

goal (2 subgoals):
 1. ?P \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
 2. \<not> ?P \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>r. \<forall>n. (\<forall>m\<ge>r n. u m \<le> u (r n)) \<and> r n < r (Suc n)
[PROOF STEP]
obtain r :: "nat \<Rightarrow> nat" where "strict_mono r" and mono: "\<And>n m. r n \<le> m \<Longrightarrow> u m \<le> u (r n)"
[PROOF STATE]
proof (prove)
using this:
\<exists>r. \<forall>n. (\<forall>m\<ge>r n. u m \<le> u (r n)) \<and> r n < r (Suc n)

goal (1 subgoal):
 1. (\<And>r. \<lbrakk>strict_mono r; \<And>n m. r n \<le> m \<Longrightarrow> u m \<le> u (r n)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: strict_mono_Suc_iff)
[PROOF STATE]
proof (state)
this:
strict_mono r
r ?n \<le> ?m \<Longrightarrow> u ?m \<le> u (r ?n)

goal (2 subgoals):
 1. ?P \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
 2. \<not> ?P \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
define umax where "umax = (\<lambda>n. (SUP m\<in>{n..}. u m))"
[PROOF STATE]
proof (state)
this:
umax = (\<lambda>n. Sup (u ` {n..}))

goal (2 subgoals):
 1. ?P \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
 2. \<not> ?P \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
have "decseq umax"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. decseq umax
[PROOF STEP]
unfolding umax_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. decseq (\<lambda>n. Sup (u ` {n..}))
[PROOF STEP]
by (simp add: SUP_subset_mono antimono_def)
[PROOF STATE]
proof (state)
this:
decseq umax

goal (2 subgoals):
 1. ?P \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
 2. \<not> ?P \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
decseq umax
[PROOF STEP]
have "umax \<longlonglongrightarrow> limsup u"
[PROOF STATE]
proof (prove)
using this:
decseq umax

goal (1 subgoal):
 1. umax \<longlonglongrightarrow> limsup u
[PROOF STEP]
unfolding umax_def
[PROOF STATE]
proof (prove)
using this:
decseq (\<lambda>n. Sup (u ` {n..}))

goal (1 subgoal):
 1. (\<lambda>n. Sup (u ` {n..})) \<longlonglongrightarrow> limsup u
[PROOF STEP]
by (metis LIMSEQ_INF limsup_INF_SUP)
[PROOF STATE]
proof (state)
this:
umax \<longlonglongrightarrow> limsup u

goal (2 subgoals):
 1. ?P \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
 2. \<not> ?P \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
umax \<longlonglongrightarrow> limsup u
[PROOF STEP]
have *: "(umax o r) \<longlonglongrightarrow> limsup u"
[PROOF STATE]
proof (prove)
using this:
umax \<longlonglongrightarrow> limsup u

goal (1 subgoal):
 1. (umax \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
by (simp add: LIMSEQ_subseq_LIMSEQ \<open>strict_mono r\<close>)
[PROOF STATE]
proof (state)
this:
(umax \<circ> r) \<longlonglongrightarrow> limsup u

goal (2 subgoals):
 1. ?P \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
 2. \<not> ?P \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
have "\<And>n. umax(r n) = u(r n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. umax (r n) = u (r n)
[PROOF STEP]
unfolding umax_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. Sup (u ` {r n..}) = u (r n)
[PROOF STEP]
using mono
[PROOF STATE]
proof (prove)
using this:
r ?n \<le> ?m \<Longrightarrow> u ?m \<le> u (r ?n)

goal (1 subgoal):
 1. \<And>n. Sup (u ` {r n..}) = u (r n)
[PROOF STEP]
by (metis SUP_le_iff antisym atLeast_def mem_Collect_eq order_refl)
[PROOF STATE]
proof (state)
this:
umax (r ?n) = u (r ?n)

goal (2 subgoals):
 1. ?P \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
 2. \<not> ?P \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
umax (r ?n) = u (r ?n)
[PROOF STEP]
have "umax o r = u o r"
[PROOF STATE]
proof (prove)
using this:
umax (r ?n) = u (r ?n)

goal (1 subgoal):
 1. umax \<circ> r = u \<circ> r
[PROOF STEP]
unfolding o_def
[PROOF STATE]
proof (prove)
using this:
umax (r ?n) = u (r ?n)

goal (1 subgoal):
 1. (\<lambda>x. umax (r x)) = (\<lambda>x. u (r x))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
umax \<circ> r = u \<circ> r

goal (2 subgoals):
 1. ?P \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
 2. \<not> ?P \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
umax \<circ> r = u \<circ> r
[PROOF STEP]
have "(u o r) \<longlonglongrightarrow> limsup u"
[PROOF STATE]
proof (prove)
using this:
umax \<circ> r = u \<circ> r

goal (1 subgoal):
 1. (u \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
umax \<circ> r = u \<circ> r
(umax \<circ> r) \<longlonglongrightarrow> limsup u

goal (1 subgoal):
 1. (u \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(u \<circ> r) \<longlonglongrightarrow> limsup u

goal (2 subgoals):
 1. ?P \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
 2. \<not> ?P \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(u \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(u \<circ> r) \<longlonglongrightarrow> limsup u

goal (1 subgoal):
 1. \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
using \<open>strict_mono r\<close>
[PROOF STATE]
proof (prove)
using this:
(u \<circ> r) \<longlonglongrightarrow> limsup u
strict_mono r

goal (1 subgoal):
 1. \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u

goal (1 subgoal):
 1. \<not> (\<forall>n. \<exists>p>n. \<forall>m\<ge>p. u m \<le> u p) \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (\<forall>n. \<exists>p>n. \<forall>m\<ge>p. u m \<le> u p) \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
assume "\<not> (\<forall>n. \<exists>p>n. (\<forall>m\<ge>p. u m \<le> u p))"
[PROOF STATE]
proof (state)
this:
\<not> (\<forall>n. \<exists>p>n. \<forall>m\<ge>p. u m \<le> u p)

goal (1 subgoal):
 1. \<not> (\<forall>n. \<exists>p>n. \<forall>m\<ge>p. u m \<le> u p) \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (\<forall>n. \<exists>p>n. \<forall>m\<ge>p. u m \<le> u p)
[PROOF STEP]
obtain N where N: "\<And>p. p > N \<Longrightarrow> \<exists>m>p. u p < u m"
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>n. \<exists>p>n. \<forall>m\<ge>p. u m \<le> u p)

goal (1 subgoal):
 1. (\<And>N. (\<And>p. N < p \<Longrightarrow> \<exists>m>p. u p < u m) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (force simp: not_le le_less)
[PROOF STATE]
proof (state)
this:
N < ?p \<Longrightarrow> \<exists>m>?p. u ?p < u m

goal (1 subgoal):
 1. \<not> (\<forall>n. \<exists>p>n. \<forall>m\<ge>p. u m \<le> u p) \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
have "\<exists>r. \<forall>n. N < r n \<and> r n < r (Suc n) \<and> (\<forall>i\<in> {N<..r (Suc n)}. u i \<le> u (r (Suc n)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>r. \<forall>n. N < r n \<and> r n < r (Suc n) \<and> (\<forall>i\<in>{N<..r (Suc n)}. u i \<le> u (r (Suc n)))
[PROOF STEP]
proof (rule dependent_nat_choice)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>x. N < x
 2. \<And>x n. N < x \<Longrightarrow> \<exists>y>N. x < y \<and> (\<forall>i\<in>{N<..y}. u i \<le> u y)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>x. N < x
 2. \<And>x n. N < x \<Longrightarrow> \<exists>y>N. x < y \<and> (\<forall>i\<in>{N<..y}. u i \<le> u y)
[PROOF STEP]
assume "N < x"
[PROOF STATE]
proof (state)
this:
N < x

goal (2 subgoals):
 1. \<exists>x. N < x
 2. \<And>x n. N < x \<Longrightarrow> \<exists>y>N. x < y \<and> (\<forall>i\<in>{N<..y}. u i \<le> u y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
N < x
[PROOF STEP]
have a: "finite {N<..x}" "{N<..x} \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
N < x

goal (1 subgoal):
 1. finite {N<..x} &&& {N<..x} \<noteq> {}
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
finite {N<..x}
{N<..x} \<noteq> {}

goal (2 subgoals):
 1. \<exists>x. N < x
 2. \<And>x n. N < x \<Longrightarrow> \<exists>y>N. x < y \<and> (\<forall>i\<in>{N<..y}. u i \<le> u y)
[PROOF STEP]
have "Max {u i |i. i \<in> {N<..x}} \<in> {u i |i. i \<in> {N<..x}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Max {u i |i. i \<in> {N<..x}} \<in> {u i |i. i \<in> {N<..x}}
[PROOF STEP]
apply (rule Max_in)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. finite {u i |i. i \<in> {N<..x}}
 2. {u i |i. i \<in> {N<..x}} \<noteq> {}
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
finite {N<..x}
{N<..x} \<noteq> {}

goal (2 subgoals):
 1. finite {u i |i. i \<in> {N<..x}}
 2. {u i |i. i \<in> {N<..x}} \<noteq> {}
[PROOF STEP]
by (auto)
[PROOF STATE]
proof (state)
this:
Max {u i |i. i \<in> {N<..x}} \<in> {u i |i. i \<in> {N<..x}}

goal (2 subgoals):
 1. \<exists>x. N < x
 2. \<And>x n. N < x \<Longrightarrow> \<exists>y>N. x < y \<and> (\<forall>i\<in>{N<..y}. u i \<le> u y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Max {u i |i. i \<in> {N<..x}} \<in> {u i |i. i \<in> {N<..x}}
[PROOF STEP]
obtain p where "p \<in> {N<..x}" and upmax: "u p = Max{u i |i. i \<in> {N<..x}}"
[PROOF STATE]
proof (prove)
using this:
Max {u i |i. i \<in> {N<..x}} \<in> {u i |i. i \<in> {N<..x}}

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>p \<in> {N<..x}; u p = Max {u i |i. i \<in> {N<..x}}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
p \<in> {N<..x}
u p = Max {u i |i. i \<in> {N<..x}}

goal (2 subgoals):
 1. \<exists>x. N < x
 2. \<And>x n. N < x \<Longrightarrow> \<exists>y>N. x < y \<and> (\<forall>i\<in>{N<..y}. u i \<le> u y)
[PROOF STEP]
define U where "U = {m. m > p \<and> u p < u m}"
[PROOF STATE]
proof (state)
this:
U = {m. p < m \<and> u p < u m}

goal (2 subgoals):
 1. \<exists>x. N < x
 2. \<And>x n. N < x \<Longrightarrow> \<exists>y>N. x < y \<and> (\<forall>i\<in>{N<..y}. u i \<le> u y)
[PROOF STEP]
have "U \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. U \<noteq> {}
[PROOF STEP]
unfolding U_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {m. p < m \<and> u p < u m} \<noteq> {}
[PROOF STEP]
using N[of p] \<open>p \<in> {N<..x}\<close>
[PROOF STATE]
proof (prove)
using this:
N < p \<Longrightarrow> \<exists>m>p. u p < u m
p \<in> {N<..x}

goal (1 subgoal):
 1. {m. p < m \<and> u p < u m} \<noteq> {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
U \<noteq> {}

goal (2 subgoals):
 1. \<exists>x. N < x
 2. \<And>x n. N < x \<Longrightarrow> \<exists>y>N. x < y \<and> (\<forall>i\<in>{N<..y}. u i \<le> u y)
[PROOF STEP]
define y where "y = Inf U"
[PROOF STATE]
proof (state)
this:
y = Inf U

goal (2 subgoals):
 1. \<exists>x. N < x
 2. \<And>x n. N < x \<Longrightarrow> \<exists>y>N. x < y \<and> (\<forall>i\<in>{N<..y}. u i \<le> u y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y = Inf U
[PROOF STEP]
have "y \<in> U"
[PROOF STATE]
proof (prove)
using this:
y = Inf U

goal (1 subgoal):
 1. y \<in> U
[PROOF STEP]
using \<open>U \<noteq> {}\<close>
[PROOF STATE]
proof (prove)
using this:
y = Inf U
U \<noteq> {}

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

goal (2 subgoals):
 1. \<exists>x. N < x
 2. \<And>x n. N < x \<Longrightarrow> \<exists>y>N. x < y \<and> (\<forall>i\<in>{N<..y}. u i \<le> u y)
[PROOF STEP]
have a: "\<And>i. i \<in> {N<..x} \<Longrightarrow> u i \<le> u p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i \<in> {N<..x} \<Longrightarrow> u i \<le> u p
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i \<in> {N<..x} \<Longrightarrow> u i \<le> u p
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i \<in> {N<..x} \<Longrightarrow> u i \<le> u p
[PROOF STEP]
assume "i \<in> {N<..x}"
[PROOF STATE]
proof (state)
this:
i \<in> {N<..x}

goal (1 subgoal):
 1. \<And>i. i \<in> {N<..x} \<Longrightarrow> u i \<le> u p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i \<in> {N<..x}
[PROOF STEP]
have "u i \<in> {u i |i. i \<in> {N<..x}}"
[PROOF STATE]
proof (prove)
using this:
i \<in> {N<..x}

goal (1 subgoal):
 1. u i \<in> {u i |i. i \<in> {N<..x}}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
u i \<in> {u i |i. i \<in> {N<..x}}

goal (1 subgoal):
 1. \<And>i. i \<in> {N<..x} \<Longrightarrow> u i \<le> u p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u i \<in> {u i |i. i \<in> {N<..x}}
[PROOF STEP]
show "u i \<le> u p"
[PROOF STATE]
proof (prove)
using this:
u i \<in> {u i |i. i \<in> {N<..x}}

goal (1 subgoal):
 1. u i \<le> u p
[PROOF STEP]
using upmax
[PROOF STATE]
proof (prove)
using this:
u i \<in> {u i |i. i \<in> {N<..x}}
u p = Max {u i |i. i \<in> {N<..x}}

goal (1 subgoal):
 1. u i \<le> u p
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
u i \<le> u p

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?i \<in> {N<..x} \<Longrightarrow> u ?i \<le> u p

goal (2 subgoals):
 1. \<exists>x. N < x
 2. \<And>x n. N < x \<Longrightarrow> \<exists>y>N. x < y \<and> (\<forall>i\<in>{N<..y}. u i \<le> u y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
?i \<in> {N<..x} \<Longrightarrow> u ?i \<le> u p

goal (2 subgoals):
 1. \<exists>x. N < x
 2. \<And>x n. N < x \<Longrightarrow> \<exists>y>N. x < y \<and> (\<forall>i\<in>{N<..y}. u i \<le> u y)
[PROOF STEP]
have "u p < u y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u p < u y
[PROOF STEP]
using \<open>y \<in> U\<close> U_def
[PROOF STATE]
proof (prove)
using this:
y \<in> U
U = {m. p < m \<and> u p < u m}

goal (1 subgoal):
 1. u p < u y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u p < u y

goal (2 subgoals):
 1. \<exists>x. N < x
 2. \<And>x n. N < x \<Longrightarrow> \<exists>y>N. x < y \<and> (\<forall>i\<in>{N<..y}. u i \<le> u y)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
?i \<in> {N<..x} \<Longrightarrow> u ?i \<le> u p
u p < u y
[PROOF STEP]
have "y \<notin> {N<..x}"
[PROOF STATE]
proof (prove)
using this:
?i \<in> {N<..x} \<Longrightarrow> u ?i \<le> u p
u p < u y

goal (1 subgoal):
 1. y \<notin> {N<..x}
[PROOF STEP]
using not_le
[PROOF STATE]
proof (prove)
using this:
?i \<in> {N<..x} \<Longrightarrow> u ?i \<le> u p
u p < u y
(\<not> ?x \<le> ?y) = (?y < ?x)

goal (1 subgoal):
 1. y \<notin> {N<..x}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
y \<notin> {N<..x}

goal (2 subgoals):
 1. \<exists>x. N < x
 2. \<And>x n. N < x \<Longrightarrow> \<exists>y>N. x < y \<and> (\<forall>i\<in>{N<..y}. u i \<le> u y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y \<notin> {N<..x}

goal (2 subgoals):
 1. \<exists>x. N < x
 2. \<And>x n. N < x \<Longrightarrow> \<exists>y>N. x < y \<and> (\<forall>i\<in>{N<..y}. u i \<le> u y)
[PROOF STEP]
have "y > N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. N < y
[PROOF STEP]
using \<open>y \<in> U\<close> U_def \<open>p \<in> {N<..x}\<close>
[PROOF STATE]
proof (prove)
using this:
y \<in> U
U = {m. p < m \<and> u p < u m}
p \<in> {N<..x}

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

goal (2 subgoals):
 1. \<exists>x. N < x
 2. \<And>x n. N < x \<Longrightarrow> \<exists>y>N. x < y \<and> (\<forall>i\<in>{N<..y}. u i \<le> u y)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
y \<notin> {N<..x}
N < y
[PROOF STEP]
have "y > x"
[PROOF STATE]
proof (prove)
using this:
y \<notin> {N<..x}
N < y

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

goal (2 subgoals):
 1. \<exists>x. N < x
 2. \<And>x n. N < x \<Longrightarrow> \<exists>y>N. x < y \<and> (\<forall>i\<in>{N<..y}. u i \<le> u y)
[PROOF STEP]
have "\<And>i. i \<in> {N<..y} \<Longrightarrow> u i \<le> u y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i \<in> {N<..y} \<Longrightarrow> u i \<le> u y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i \<in> {N<..y} \<Longrightarrow> u i \<le> u y
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i \<in> {N<..y} \<Longrightarrow> u i \<le> u y
[PROOF STEP]
assume "i \<in> {N<..y}"
[PROOF STATE]
proof (state)
this:
i \<in> {N<..y}

goal (1 subgoal):
 1. \<And>i. i \<in> {N<..y} \<Longrightarrow> u i \<le> u y
[PROOF STEP]
show "u i \<le> u y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u i \<le> u y
[PROOF STEP]
proof (cases)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> u i \<le> u y
 2. \<not> ?P \<Longrightarrow> u i \<le> u y
[PROOF STEP]
assume "i = y"
[PROOF STATE]
proof (state)
this:
i = y

goal (2 subgoals):
 1. ?P \<Longrightarrow> u i \<le> u y
 2. \<not> ?P \<Longrightarrow> u i \<le> u y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i = y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
i = y

goal (1 subgoal):
 1. u i \<le> u y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
u i \<le> u y

goal (1 subgoal):
 1. i \<noteq> y \<Longrightarrow> u i \<le> u y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. i \<noteq> y \<Longrightarrow> u i \<le> u y
[PROOF STEP]
assume "\<not>(i=y)"
[PROOF STATE]
proof (state)
this:
i \<noteq> y

goal (1 subgoal):
 1. i \<noteq> y \<Longrightarrow> u i \<le> u y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i \<noteq> y
[PROOF STEP]
have i:"i \<in> {N<..<y}"
[PROOF STATE]
proof (prove)
using this:
i \<noteq> y

goal (1 subgoal):
 1. i \<in> {N<..<y}
[PROOF STEP]
using \<open>i \<in> {N<..y}\<close>
[PROOF STATE]
proof (prove)
using this:
i \<noteq> y
i \<in> {N<..y}

goal (1 subgoal):
 1. i \<in> {N<..<y}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
i \<in> {N<..<y}

goal (1 subgoal):
 1. i \<noteq> y \<Longrightarrow> u i \<le> u y
[PROOF STEP]
have "u i \<le> u p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u i \<le> u p
[PROOF STEP]
proof (cases)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> u i \<le> u p
 2. \<not> ?P \<Longrightarrow> u i \<le> u p
[PROOF STEP]
assume "i \<le> x"
[PROOF STATE]
proof (state)
this:
i \<le> x

goal (2 subgoals):
 1. ?P \<Longrightarrow> u i \<le> u p
 2. \<not> ?P \<Longrightarrow> u i \<le> u p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i \<le> x
[PROOF STEP]
have "i \<in> {N<..x}"
[PROOF STATE]
proof (prove)
using this:
i \<le> x

goal (1 subgoal):
 1. i \<in> {N<..x}
[PROOF STEP]
using i
[PROOF STATE]
proof (prove)
using this:
i \<le> x
i \<in> {N<..<y}

goal (1 subgoal):
 1. i \<in> {N<..x}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
i \<in> {N<..x}

goal (2 subgoals):
 1. ?P \<Longrightarrow> u i \<le> u p
 2. \<not> ?P \<Longrightarrow> u i \<le> u p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i \<in> {N<..x}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
i \<in> {N<..x}

goal (1 subgoal):
 1. u i \<le> u p
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
i \<in> {N<..x}
?i \<in> {N<..x} \<Longrightarrow> u ?i \<le> u p

goal (1 subgoal):
 1. u i \<le> u p
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
u i \<le> u p

goal (1 subgoal):
 1. \<not> i \<le> x \<Longrightarrow> u i \<le> u p
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> i \<le> x \<Longrightarrow> u i \<le> u p
[PROOF STEP]
assume "\<not>(i \<le> x)"
[PROOF STATE]
proof (state)
this:
\<not> i \<le> x

goal (1 subgoal):
 1. \<not> i \<le> x \<Longrightarrow> u i \<le> u p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> i \<le> x
[PROOF STEP]
have "i > x"
[PROOF STATE]
proof (prove)
using this:
\<not> i \<le> x

goal (1 subgoal):
 1. x < i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x < i

goal (1 subgoal):
 1. \<not> i \<le> x \<Longrightarrow> u i \<le> u p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x < i
[PROOF STEP]
have *: "i > p"
[PROOF STATE]
proof (prove)
using this:
x < i

goal (1 subgoal):
 1. p < i
[PROOF STEP]
using \<open>p \<in> {N<..x}\<close>
[PROOF STATE]
proof (prove)
using this:
x < i
p \<in> {N<..x}

goal (1 subgoal):
 1. p < i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
p < i

goal (1 subgoal):
 1. \<not> i \<le> x \<Longrightarrow> u i \<le> u p
[PROOF STEP]
have "i < Inf U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < Inf U
[PROOF STEP]
using i y_def
[PROOF STATE]
proof (prove)
using this:
i \<in> {N<..<y}
y = Inf U

goal (1 subgoal):
 1. i < Inf U
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
i < Inf U

goal (1 subgoal):
 1. \<not> i \<le> x \<Longrightarrow> u i \<le> u p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i < Inf U
[PROOF STEP]
have "i \<notin> U"
[PROOF STATE]
proof (prove)
using this:
i < Inf U

goal (1 subgoal):
 1. i \<notin> U
[PROOF STEP]
using Inf_nat_def not_less_Least
[PROOF STATE]
proof (prove)
using this:
i < Inf U
Inf ?X = (LEAST n. n \<in> ?X)
?k < (LEAST x. ?P x) \<Longrightarrow> \<not> ?P ?k

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

goal (1 subgoal):
 1. \<not> i \<le> x \<Longrightarrow> u i \<le> u p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i \<notin> U
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
i \<notin> U

goal (1 subgoal):
 1. u i \<le> u p
[PROOF STEP]
using U_def *
[PROOF STATE]
proof (prove)
using this:
i \<notin> U
U = {m. p < m \<and> u p < u m}
p < i

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
u i \<le> u p

goal (1 subgoal):
 1. i \<noteq> y \<Longrightarrow> u i \<le> u y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u i \<le> u p
[PROOF STEP]
show "u i \<le> u y"
[PROOF STATE]
proof (prove)
using this:
u i \<le> u p

goal (1 subgoal):
 1. u i \<le> u y
[PROOF STEP]
using \<open>u p < u y\<close>
[PROOF STATE]
proof (prove)
using this:
u i \<le> u p
u p < u y

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
u i \<le> u y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?i \<in> {N<..y} \<Longrightarrow> u ?i \<le> u y

goal (2 subgoals):
 1. \<exists>x. N < x
 2. \<And>x n. N < x \<Longrightarrow> \<exists>y>N. x < y \<and> (\<forall>i\<in>{N<..y}. u i \<le> u y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?i \<in> {N<..y} \<Longrightarrow> u ?i \<le> u y
[PROOF STEP]
have "N < y \<and> x < y \<and> (\<forall>i\<in>{N<..y}. u i \<le> u y)"
[PROOF STATE]
proof (prove)
using this:
?i \<in> {N<..y} \<Longrightarrow> u ?i \<le> u y

goal (1 subgoal):
 1. N < y \<and> x < y \<and> (\<forall>i\<in>{N<..y}. u i \<le> u y)
[PROOF STEP]
using \<open>y > x\<close> \<open>y > N\<close>
[PROOF STATE]
proof (prove)
using this:
?i \<in> {N<..y} \<Longrightarrow> u ?i \<le> u y
x < y
N < y

goal (1 subgoal):
 1. N < y \<and> x < y \<and> (\<forall>i\<in>{N<..y}. u i \<le> u y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
N < y \<and> x < y \<and> (\<forall>i\<in>{N<..y}. u i \<le> u y)

goal (2 subgoals):
 1. \<exists>x. N < x
 2. \<And>x n. N < x \<Longrightarrow> \<exists>y>N. x < y \<and> (\<forall>i\<in>{N<..y}. u i \<le> u y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
N < y \<and> x < y \<and> (\<forall>i\<in>{N<..y}. u i \<le> u y)
[PROOF STEP]
show "\<exists>y>N. x < y \<and> (\<forall>i\<in>{N<..y}. u i \<le> u y)"
[PROOF STATE]
proof (prove)
using this:
N < y \<and> x < y \<and> (\<forall>i\<in>{N<..y}. u i \<le> u y)

goal (1 subgoal):
 1. \<exists>y>N. x < y \<and> (\<forall>i\<in>{N<..y}. u i \<le> u y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>y>N. x < y \<and> (\<forall>i\<in>{N<..y}. u i \<le> u y)

goal (1 subgoal):
 1. \<exists>x. N < x
[PROOF STEP]
qed (auto)
[PROOF STATE]
proof (state)
this:
\<exists>r. \<forall>n. N < r n \<and> r n < r (Suc n) \<and> (\<forall>i\<in>{N<..r (Suc n)}. u i \<le> u (r (Suc n)))

goal (1 subgoal):
 1. \<not> (\<forall>n. \<exists>p>n. \<forall>m\<ge>p. u m \<le> u p) \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>r. \<forall>n. N < r n \<and> r n < r (Suc n) \<and> (\<forall>i\<in>{N<..r (Suc n)}. u i \<le> u (r (Suc n)))
[PROOF STEP]
obtain r where r: "\<forall>n. N < r n \<and> r n < r (Suc n) \<and> (\<forall>i\<in> {N<..r (Suc n)}. u i \<le> u (r (Suc n)))"
[PROOF STATE]
proof (prove)
using this:
\<exists>r. \<forall>n. N < r n \<and> r n < r (Suc n) \<and> (\<forall>i\<in>{N<..r (Suc n)}. u i \<le> u (r (Suc n)))

goal (1 subgoal):
 1. (\<And>r. \<forall>n. N < r n \<and> r n < r (Suc n) \<and> (\<forall>i\<in>{N<..r (Suc n)}. u i \<le> u (r (Suc n))) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>n. N < r n \<and> r n < r (Suc n) \<and> (\<forall>i\<in>{N<..r (Suc n)}. u i \<le> u (r (Suc n)))

goal (1 subgoal):
 1. \<not> (\<forall>n. \<exists>p>n. \<forall>m\<ge>p. u m \<le> u p) \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
have "strict_mono r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. strict_mono r
[PROOF STEP]
using r
[PROOF STATE]
proof (prove)
using this:
\<forall>n. N < r n \<and> r n < r (Suc n) \<and> (\<forall>i\<in>{N<..r (Suc n)}. u i \<le> u (r (Suc n)))

goal (1 subgoal):
 1. strict_mono r
[PROOF STEP]
by (auto simp: strict_mono_Suc_iff)
[PROOF STATE]
proof (state)
this:
strict_mono r

goal (1 subgoal):
 1. \<not> (\<forall>n. \<exists>p>n. \<forall>m\<ge>p. u m \<le> u p) \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
have "incseq (u o r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. incseq (u \<circ> r)
[PROOF STEP]
unfolding o_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. incseq (\<lambda>x. u (r x))
[PROOF STEP]
using r
[PROOF STATE]
proof (prove)
using this:
\<forall>n. N < r n \<and> r n < r (Suc n) \<and> (\<forall>i\<in>{N<..r (Suc n)}. u i \<le> u (r (Suc n)))

goal (1 subgoal):
 1. incseq (\<lambda>x. u (r x))
[PROOF STEP]
by (simp add: incseq_SucI order.strict_implies_order)
[PROOF STATE]
proof (state)
this:
incseq (u \<circ> r)

goal (1 subgoal):
 1. \<not> (\<forall>n. \<exists>p>n. \<forall>m\<ge>p. u m \<le> u p) \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
incseq (u \<circ> r)
[PROOF STEP]
have "(u o r) \<longlonglongrightarrow> (SUP n. (u o r) n)"
[PROOF STATE]
proof (prove)
using this:
incseq (u \<circ> r)

goal (1 subgoal):
 1. (u \<circ> r) \<longlonglongrightarrow> Sup (range (u \<circ> r))
[PROOF STEP]
using LIMSEQ_SUP
[PROOF STATE]
proof (prove)
using this:
incseq (u \<circ> r)
incseq ?X \<Longrightarrow> ?X \<longlonglongrightarrow> Sup (range ?X)

goal (1 subgoal):
 1. (u \<circ> r) \<longlonglongrightarrow> Sup (range (u \<circ> r))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(u \<circ> r) \<longlonglongrightarrow> Sup (range (u \<circ> r))

goal (1 subgoal):
 1. \<not> (\<forall>n. \<exists>p>n. \<forall>m\<ge>p. u m \<le> u p) \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(u \<circ> r) \<longlonglongrightarrow> Sup (range (u \<circ> r))
[PROOF STEP]
have "limsup (u o r) = (SUP n. (u o r) n)"
[PROOF STATE]
proof (prove)
using this:
(u \<circ> r) \<longlonglongrightarrow> Sup (range (u \<circ> r))

goal (1 subgoal):
 1. limsup (u \<circ> r) = Sup (range (u \<circ> r))
[PROOF STEP]
by (simp add: lim_imp_Limsup)
[PROOF STATE]
proof (state)
this:
limsup (u \<circ> r) = Sup (range (u \<circ> r))

goal (1 subgoal):
 1. \<not> (\<forall>n. \<exists>p>n. \<forall>m\<ge>p. u m \<le> u p) \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
limsup (u \<circ> r) = Sup (range (u \<circ> r))

goal (1 subgoal):
 1. \<not> (\<forall>n. \<exists>p>n. \<forall>m\<ge>p. u m \<le> u p) \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
have "limsup (u o r) \<le> limsup u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. limsup (u \<circ> r) \<le> limsup u
[PROOF STEP]
using \<open>strict_mono r\<close>
[PROOF STATE]
proof (prove)
using this:
strict_mono r

goal (1 subgoal):
 1. limsup (u \<circ> r) \<le> limsup u
[PROOF STEP]
by (simp add: limsup_subseq_mono)
[PROOF STATE]
proof (state)
this:
limsup (u \<circ> r) \<le> limsup u

goal (1 subgoal):
 1. \<not> (\<forall>n. \<exists>p>n. \<forall>m\<ge>p. u m \<le> u p) \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
limsup (u \<circ> r) = Sup (range (u \<circ> r))
limsup (u \<circ> r) \<le> limsup u
[PROOF STEP]
have "(SUP n. (u o r) n) \<le> limsup u"
[PROOF STATE]
proof (prove)
using this:
limsup (u \<circ> r) = Sup (range (u \<circ> r))
limsup (u \<circ> r) \<le> limsup u

goal (1 subgoal):
 1. Sup (range (u \<circ> r)) \<le> limsup u
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Sup (range (u \<circ> r)) \<le> limsup u

goal (1 subgoal):
 1. \<not> (\<forall>n. \<exists>p>n. \<forall>m\<ge>p. u m \<le> u p) \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
Sup (range (u \<circ> r)) \<le> limsup u

goal (1 subgoal):
 1. \<not> (\<forall>n. \<exists>p>n. \<forall>m\<ge>p. u m \<le> u p) \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (\<forall>n. \<exists>p>n. \<forall>m\<ge>p. u m \<le> u p) \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
assume i: "i \<in> {N<..}"
[PROOF STATE]
proof (state)
this:
i \<in> {N<..}

goal (1 subgoal):
 1. \<not> (\<forall>n. \<exists>p>n. \<forall>m\<ge>p. u m \<le> u p) \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
obtain n where "i < r (Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>n. i < r (Suc n) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>strict_mono r\<close>
[PROOF STATE]
proof (prove)
using this:
strict_mono r

goal (1 subgoal):
 1. (\<And>n. i < r (Suc n) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using Suc_le_eq seq_suble
[PROOF STATE]
proof (prove)
using this:
strict_mono r
(Suc ?m \<le> ?n) = (?m < ?n)
strict_mono ?f \<Longrightarrow> ?n \<le> ?f ?n

goal (1 subgoal):
 1. (\<And>n. i < r (Suc n) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
i < r (Suc n)

goal (1 subgoal):
 1. \<not> (\<forall>n. \<exists>p>n. \<forall>m\<ge>p. u m \<le> u p) \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i < r (Suc n)
[PROOF STEP]
have "i \<in> {N<..r(Suc n)}"
[PROOF STATE]
proof (prove)
using this:
i < r (Suc n)

goal (1 subgoal):
 1. i \<in> {N<..r (Suc n)}
[PROOF STEP]
using i
[PROOF STATE]
proof (prove)
using this:
i < r (Suc n)
i \<in> {N<..}

goal (1 subgoal):
 1. i \<in> {N<..r (Suc n)}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
i \<in> {N<..r (Suc n)}

goal (1 subgoal):
 1. \<not> (\<forall>n. \<exists>p>n. \<forall>m\<ge>p. u m \<le> u p) \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i \<in> {N<..r (Suc n)}
[PROOF STEP]
have "u i \<le> u (r(Suc n))"
[PROOF STATE]
proof (prove)
using this:
i \<in> {N<..r (Suc n)}

goal (1 subgoal):
 1. u i \<le> u (r (Suc n))
[PROOF STEP]
using r
[PROOF STATE]
proof (prove)
using this:
i \<in> {N<..r (Suc n)}
\<forall>n. N < r n \<and> r n < r (Suc n) \<and> (\<forall>i\<in>{N<..r (Suc n)}. u i \<le> u (r (Suc n)))

goal (1 subgoal):
 1. u i \<le> u (r (Suc n))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
u i \<le> u (r (Suc n))

goal (1 subgoal):
 1. \<not> (\<forall>n. \<exists>p>n. \<forall>m\<ge>p. u m \<le> u p) \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u i \<le> u (r (Suc n))
[PROOF STEP]
have "u i \<le> (SUP n. (u o r) n)"
[PROOF STATE]
proof (prove)
using this:
u i \<le> u (r (Suc n))

goal (1 subgoal):
 1. u i \<le> Sup (range (u \<circ> r))
[PROOF STEP]
unfolding o_def
[PROOF STATE]
proof (prove)
using this:
u i \<le> u (r (Suc n))

goal (1 subgoal):
 1. u i \<le> (SUP n. u (r n))
[PROOF STEP]
by (meson SUP_upper2 UNIV_I)
[PROOF STATE]
proof (state)
this:
u i \<le> Sup (range (u \<circ> r))

goal (1 subgoal):
 1. \<not> (\<forall>n. \<exists>p>n. \<forall>m\<ge>p. u m \<le> u p) \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?i2 \<in> {N<..} \<Longrightarrow> u ?i2 \<le> Sup (range (u \<circ> r))

goal (1 subgoal):
 1. \<not> (\<forall>n. \<exists>p>n. \<forall>m\<ge>p. u m \<le> u p) \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?i2 \<in> {N<..} \<Longrightarrow> u ?i2 \<le> Sup (range (u \<circ> r))
[PROOF STEP]
have "(SUP i\<in>{N<..}. u i) \<le> (SUP n. (u o r) n)"
[PROOF STATE]
proof (prove)
using this:
?i2 \<in> {N<..} \<Longrightarrow> u ?i2 \<le> Sup (range (u \<circ> r))

goal (1 subgoal):
 1. Sup (u ` {N<..}) \<le> Sup (range (u \<circ> r))
[PROOF STEP]
using SUP_least
[PROOF STATE]
proof (prove)
using this:
?i2 \<in> {N<..} \<Longrightarrow> u ?i2 \<le> Sup (range (u \<circ> r))
(\<And>i. i \<in> ?A \<Longrightarrow> ?f i \<le> ?u) \<Longrightarrow> Sup (?f ` ?A) \<le> ?u

goal (1 subgoal):
 1. Sup (u ` {N<..}) \<le> Sup (range (u \<circ> r))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Sup (u ` {N<..}) \<le> Sup (range (u \<circ> r))

goal (1 subgoal):
 1. \<not> (\<forall>n. \<exists>p>n. \<forall>m\<ge>p. u m \<le> u p) \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Sup (u ` {N<..}) \<le> Sup (range (u \<circ> r))
[PROOF STEP]
have "limsup u \<le> (SUP n. (u o r) n)"
[PROOF STATE]
proof (prove)
using this:
Sup (u ` {N<..}) \<le> Sup (range (u \<circ> r))

goal (1 subgoal):
 1. limsup u \<le> Sup (range (u \<circ> r))
[PROOF STEP]
unfolding Limsup_def
[PROOF STATE]
proof (prove)
using this:
Sup (u ` {N<..}) \<le> Sup (range (u \<circ> r))

goal (1 subgoal):
 1. (INF P\<in>{P. eventually P sequentially}. Sup (u ` Collect P)) \<le> Sup (range (u \<circ> r))
[PROOF STEP]
by (metis (mono_tags, lifting) INF_lower2 atLeast_Suc_greaterThan atLeast_def eventually_ge_at_top mem_Collect_eq)
[PROOF STATE]
proof (state)
this:
limsup u \<le> Sup (range (u \<circ> r))

goal (1 subgoal):
 1. \<not> (\<forall>n. \<exists>p>n. \<forall>m\<ge>p. u m \<le> u p) \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
limsup u \<le> Sup (range (u \<circ> r))
[PROOF STEP]
have "limsup u = (SUP n. (u o r) n)"
[PROOF STATE]
proof (prove)
using this:
limsup u \<le> Sup (range (u \<circ> r))

goal (1 subgoal):
 1. limsup u = Sup (range (u \<circ> r))
[PROOF STEP]
using \<open>(SUP n. (u o r) n) \<le> limsup u\<close>
[PROOF STATE]
proof (prove)
using this:
limsup u \<le> Sup (range (u \<circ> r))
Sup (range (u \<circ> r)) \<le> limsup u

goal (1 subgoal):
 1. limsup u = Sup (range (u \<circ> r))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
limsup u = Sup (range (u \<circ> r))

goal (1 subgoal):
 1. \<not> (\<forall>n. \<exists>p>n. \<forall>m\<ge>p. u m \<le> u p) \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
limsup u = Sup (range (u \<circ> r))
[PROOF STEP]
have "(u o r) \<longlonglongrightarrow> limsup u"
[PROOF STATE]
proof (prove)
using this:
limsup u = Sup (range (u \<circ> r))

goal (1 subgoal):
 1. (u \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
using \<open>(u o r) \<longlonglongrightarrow> (SUP n. (u o r) n)\<close>
[PROOF STATE]
proof (prove)
using this:
limsup u = Sup (range (u \<circ> r))
(u \<circ> r) \<longlonglongrightarrow> Sup (range (u \<circ> r))

goal (1 subgoal):
 1. (u \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(u \<circ> r) \<longlonglongrightarrow> limsup u

goal (1 subgoal):
 1. \<not> (\<forall>n. \<exists>p>n. \<forall>m\<ge>p. u m \<le> u p) \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(u \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(u \<circ> r) \<longlonglongrightarrow> limsup u

goal (1 subgoal):
 1. \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
using \<open>strict_mono r\<close>
[PROOF STATE]
proof (prove)
using this:
(u \<circ> r) \<longlonglongrightarrow> limsup u
strict_mono r

goal (1 subgoal):
 1. \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> limsup u

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma IS_ID_imp_PRES_ZERO_UNIQUE[constraint_rules]: "IS_ID A \<Longrightarrow> PRES_ZERO_UNIQUE A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. IS_ID A \<Longrightarrow> PRES_ZERO_UNIQUE A
[PROOF STEP]
unfolding IS_ID_def PRES_ZERO_UNIQUE_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = Id \<Longrightarrow> A `` {0::'a} = {0::'a} \<and> A\<inverse> `` {0::'a} = {0::'a}
[PROOF STEP]
by auto


[STATEMENT]
lemma l1: "eval_ternary_Not tv = TernaryTrue \<Longrightarrow> tv = TernaryFalse"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_ternary_Not tv = TernaryTrue \<Longrightarrow> tv = TernaryFalse
[PROOF STEP]
by (metis eval_ternary_Not.simps(1) eval_ternary_idempotence_Not)


[STATEMENT]
lemma size_fst_split_bst [termination_simp]: "size (fst (split_bst x t)) \<le> size t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size (fst (split_bst x t)) \<le> size t
[PROOF STEP]
by (induction t) (auto simp: case_prod_unfold)


[STATEMENT]
lemma vconverse_iff: "\<langle>b, a\<rangle> \<in>\<^sub>\<circ> r\<inverse>\<^sub>\<circ> \<longleftrightarrow> \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<langle>b, a\<rangle> \<in>\<^sub>\<circ> r\<inverse>\<^sub>\<circ>) = (\<langle>a, b\<rangle> \<in>\<^sub>\<circ> r)
[PROOF STEP]
by auto


[STATEMENT]
lemma linear_compose: "linear s1 s2 f \<Longrightarrow> linear s2 s3 g \<Longrightarrow> linear s1 s3 (g o f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>linear s1 s2 f; linear s2 s3 g\<rbrakk> \<Longrightarrow> linear s1 s3 (g \<circ> f)
[PROOF STEP]
unfolding module_hom_iff_linear[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>module_hom s1 s2 f; module_hom s2 s3 g\<rbrakk> \<Longrightarrow> module_hom s1 s3 (g \<circ> f)
[PROOF STEP]
by (rule module_hom_compose)


[STATEMENT]
lemma pderiv_div:
  assumes [simp]: "q dvd p" "q \<noteq> 0"
  shows "pderiv (p div q) = (q * pderiv p - p * pderiv q) div (q * q)"
        "q*q dvd (q * pderiv p - p * pderiv q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pderiv (p div q) = (q * pderiv p - p * pderiv q) div (q * q) &&& q * q dvd q * pderiv p - p * pderiv q
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. pderiv (p div q) = (q * pderiv p - p * pderiv q) div (q * q)
 2. q * q dvd q * pderiv p - p * pderiv q
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
q dvd p
q \<noteq> 0
[PROOF STEP]
obtain r where "p = q * r"
[PROOF STATE]
proof (prove)
using this:
q dvd p
q \<noteq> 0

goal (1 subgoal):
 1. (\<And>r. p = q * r \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding dvd_def
[PROOF STATE]
proof (prove)
using this:
\<exists>k. p = q * k
q \<noteq> 0

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

goal (2 subgoals):
 1. pderiv (p div q) = (q * pderiv p - p * pderiv q) div (q * q)
 2. q * q dvd q * pderiv p - p * pderiv q
[PROOF STEP]
hence "q * pderiv p - p * pderiv q = (q * q) * pderiv r"
[PROOF STATE]
proof (prove)
using this:
p = q * r

goal (1 subgoal):
 1. q * pderiv p - p * pderiv q = q * q * pderiv r
[PROOF STEP]
by (simp add: algebra_simps pderiv_mult)
[PROOF STATE]
proof (state)
this:
q * pderiv p - p * pderiv q = q * q * pderiv r

goal (2 subgoals):
 1. pderiv (p div q) = (q * pderiv p - p * pderiv q) div (q * q)
 2. q * q dvd q * pderiv p - p * pderiv q
[PROOF STEP]
thus "q*q dvd (q * pderiv p - p * pderiv q)"
[PROOF STATE]
proof (prove)
using this:
q * pderiv p - p * pderiv q = q * q * pderiv r

goal (1 subgoal):
 1. q * q dvd q * pderiv p - p * pderiv q
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
q * q dvd q * pderiv p - p * pderiv q

goal (1 subgoal):
 1. pderiv (p div q) = (q * pderiv p - p * pderiv q) div (q * q)
[PROOF STEP]
note 0 = pderiv_mult[of q "p div q"]
[PROOF STATE]
proof (state)
this:
pderiv (q * (p div q)) = q * pderiv (p div q) + p div q * pderiv q

goal (1 subgoal):
 1. pderiv (p div q) = (q * pderiv p - p * pderiv q) div (q * q)
[PROOF STEP]
have 1: "q * (p div q) = p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. q * (p div q) = p
[PROOF STEP]
by (metis assms(1) assms(2) dvd_def nonzero_mult_div_cancel_left)
[PROOF STATE]
proof (state)
this:
q * (p div q) = p

goal (1 subgoal):
 1. pderiv (p div q) = (q * pderiv p - p * pderiv q) div (q * q)
[PROOF STEP]
have f1: "pderiv (p div q) * (q * q) div (q * q) = pderiv (p div q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pderiv (p div q) * (q * q) div (q * q) = pderiv (p div q)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
pderiv (p div q) * (q * q) div (q * q) = pderiv (p div q)

goal (1 subgoal):
 1. pderiv (p div q) = (q * pderiv p - p * pderiv q) div (q * q)
[PROOF STEP]
have f2: "pderiv p = q * pderiv (p div q) + p div q * pderiv q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pderiv p = q * pderiv (p div q) + p div q * pderiv q
[PROOF STEP]
by (metis 0 1)
[PROOF STATE]
proof (state)
this:
pderiv p = q * pderiv (p div q) + p div q * pderiv q

goal (1 subgoal):
 1. pderiv (p div q) = (q * pderiv p - p * pderiv q) div (q * q)
[PROOF STEP]
have "p * pderiv q = pderiv q * (q * (p div q))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p * pderiv q = pderiv q * (q * (p div q))
[PROOF STEP]
by (metis 1 mult.commute)
[PROOF STATE]
proof (state)
this:
p * pderiv q = pderiv q * (q * (p div q))

goal (1 subgoal):
 1. pderiv (p div q) = (q * pderiv p - p * pderiv q) div (q * q)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p * pderiv q = pderiv q * (q * (p div q))
[PROOF STEP]
have "p * pderiv q = q * (p div q * pderiv q)"
[PROOF STATE]
proof (prove)
using this:
p * pderiv q = pderiv q * (q * (p div q))

goal (1 subgoal):
 1. p * pderiv q = q * (p div q * pderiv q)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
p * pderiv q = q * (p div q * pderiv q)

goal (1 subgoal):
 1. pderiv (p div q) = (q * pderiv p - p * pderiv q) div (q * q)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p * pderiv q = q * (p div q * pderiv q)
[PROOF STEP]
have "q * pderiv p - p * pderiv q = q * (q * pderiv (p div q))"
[PROOF STATE]
proof (prove)
using this:
p * pderiv q = q * (p div q * pderiv q)

goal (1 subgoal):
 1. q * pderiv p - p * pderiv q = q * (q * pderiv (p div q))
[PROOF STEP]
using f2
[PROOF STATE]
proof (prove)
using this:
p * pderiv q = q * (p div q * pderiv q)
pderiv p = q * pderiv (p div q) + p div q * pderiv q

goal (1 subgoal):
 1. q * pderiv p - p * pderiv q = q * (q * pderiv (p div q))
[PROOF STEP]
by (metis add_diff_cancel_right' distrib_left)
[PROOF STATE]
proof (state)
this:
q * pderiv p - p * pderiv q = q * (q * pderiv (p div q))

goal (1 subgoal):
 1. pderiv (p div q) = (q * pderiv p - p * pderiv q) div (q * q)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
q * pderiv p - p * pderiv q = q * (q * pderiv (p div q))
[PROOF STEP]
show "pderiv (p div q) = (q * pderiv p - p * pderiv q) div (q * q)"
[PROOF STATE]
proof (prove)
using this:
q * pderiv p - p * pderiv q = q * (q * pderiv (p div q))

goal (1 subgoal):
 1. pderiv (p div q) = (q * pderiv p - p * pderiv q) div (q * q)
[PROOF STEP]
using f1
[PROOF STATE]
proof (prove)
using this:
q * pderiv p - p * pderiv q = q * (q * pderiv (p div q))
pderiv (p div q) * (q * q) div (q * q) = pderiv (p div q)

goal (1 subgoal):
 1. pderiv (p div q) = (q * pderiv p - p * pderiv q) div (q * q)
[PROOF STEP]
by (metis mult.commute mult.left_commute)
[PROOF STATE]
proof (state)
this:
pderiv (p div q) = (q * pderiv p - p * pderiv q) div (q * q)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma map_sort_key: assumes [simp]: "\<And> x y. g1 x \<le> g1 y \<longleftrightarrow> g2 (f x) \<le> g2 (f y)"
  shows "map f (sort_key g1 xs) = sort_key g2 (map f xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map f (sort_key g1 xs) = sort_key g2 (map f xs)
[PROOF STEP]
by (induct xs, auto simp: map_insort_key)


[STATEMENT]
lemma open_UN [continuous_intros, intro]: "\<forall>x\<in>A. open (B x) \<Longrightarrow> open (\<Union>x\<in>A. B x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>A. open (B x) \<Longrightarrow> open (\<Union> (B ` A))
[PROOF STEP]
using open_Union [of "B ` A"]
[PROOF STATE]
proof (prove)
using this:
Ball (B ` A) open \<Longrightarrow> open (\<Union> (B ` A))

goal (1 subgoal):
 1. \<forall>x\<in>A. open (B x) \<Longrightarrow> open (\<Union> (B ` A))
[PROOF STEP]
by simp


[STATEMENT]
lemma mult_gcd_right: "gcd a b * c = gcd (a * c) (b * c) * unit_factor c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd a b * c = gcd (a * c) (b * c) * unit_factor c
[PROOF STEP]
using mult_gcd_left [of c a b]
[PROOF STATE]
proof (prove)
using this:
c * gcd a b = unit_factor c * gcd (c * a) (c * b)

goal (1 subgoal):
 1. gcd a b * c = gcd (a * c) (b * c) * unit_factor c
[PROOF STEP]
by (simp add: ac_simps)


[STATEMENT]
lemma interval_lebesgue_integral_lborel_01_cong:
  assumes "\<And>x. x \<in> {0<..<1} \<Longrightarrow> f x = g x"
  shows   "interval_lebesgue_integral lborel 0 1 f =
           interval_lebesgue_integral lborel 0 1 g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interval_lebesgue_integral lborel 0 1 f = interval_lebesgue_integral lborel 0 1 g
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?x \<in> {0<..<1} \<Longrightarrow> f ?x = g ?x

goal (1 subgoal):
 1. interval_lebesgue_integral lborel 0 1 f = interval_lebesgue_integral lborel 0 1 g
[PROOF STEP]
by (subst (1 2) interval_integral_Ioo)
     (auto intro!: set_lebesgue_integral_cong assms)


[STATEMENT]
lemma tl_queue_rep: "\<not>is_empty q \<Longrightarrow> linearize (tl_queue q) = tl (linearize q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> Optimized_MTL.is_empty q \<Longrightarrow> linearize (tl_queue q) = tl (linearize q)
[PROOF STEP]
by transfer (auto simp: tl_append split: prod.splits list.splits elim!: tl_queue_t.elims)


[STATEMENT]
lemma ith_in_extension:
  assumes chain: "wf_infpath f"
  assumes smalli: "i < length (f n\<^sub>1)"
  assumes n\<^sub>1n\<^sub>2: "n\<^sub>1 \<le> n\<^sub>2"
  shows "f n\<^sub>1 ! i = f n\<^sub>2 ! i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f n\<^sub>1 ! i = f n\<^sub>2 ! i
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f n\<^sub>1 ! i = f n\<^sub>2 ! i
[PROOF STEP]
from chain n\<^sub>1n\<^sub>2
[PROOF STATE]
proof (chain)
picking this:
wf_infpath f
n\<^sub>1 \<le> n\<^sub>2
[PROOF STEP]
have "\<exists>a. f n\<^sub>1 @ a = f n\<^sub>2"
[PROOF STATE]
proof (prove)
using this:
wf_infpath f
n\<^sub>1 \<le> n\<^sub>2

goal (1 subgoal):
 1. \<exists>a. f n\<^sub>1 @ a = f n\<^sub>2
[PROOF STEP]
using chain_prefix
[PROOF STATE]
proof (prove)
using this:
wf_infpath f
n\<^sub>1 \<le> n\<^sub>2
\<lbrakk>wf_infpath ?f; ?n\<^sub>1 \<le> ?n\<^sub>2\<rbrakk> \<Longrightarrow> \<exists>a. ?f ?n\<^sub>1 @ a = ?f ?n\<^sub>2

goal (1 subgoal):
 1. \<exists>a. f n\<^sub>1 @ a = f n\<^sub>2
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>a. f n\<^sub>1 @ a = f n\<^sub>2

goal (1 subgoal):
 1. f n\<^sub>1 ! i = f n\<^sub>2 ! i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>a. f n\<^sub>1 @ a = f n\<^sub>2
[PROOF STEP]
obtain a where a_p: "f n\<^sub>1 @ a = f n\<^sub>2"
[PROOF STATE]
proof (prove)
using this:
\<exists>a. f n\<^sub>1 @ a = f n\<^sub>2

goal (1 subgoal):
 1. (\<And>a. f n\<^sub>1 @ a = f n\<^sub>2 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f n\<^sub>1 @ a = f n\<^sub>2

goal (1 subgoal):
 1. f n\<^sub>1 ! i = f n\<^sub>2 ! i
[PROOF STEP]
have "(f n\<^sub>1 @ a) ! i = f n\<^sub>1 ! i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f n\<^sub>1 @ a) ! i = f n\<^sub>1 ! i
[PROOF STEP]
using smalli
[PROOF STATE]
proof (prove)
using this:
i < length (f n\<^sub>1)

goal (1 subgoal):
 1. (f n\<^sub>1 @ a) ! i = f n\<^sub>1 ! i
[PROOF STEP]
by (simp add: nth_append)
[PROOF STATE]
proof (state)
this:
(f n\<^sub>1 @ a) ! i = f n\<^sub>1 ! i

goal (1 subgoal):
 1. f n\<^sub>1 ! i = f n\<^sub>2 ! i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(f n\<^sub>1 @ a) ! i = f n\<^sub>1 ! i
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(f n\<^sub>1 @ a) ! i = f n\<^sub>1 ! i

goal (1 subgoal):
 1. f n\<^sub>1 ! i = f n\<^sub>2 ! i
[PROOF STEP]
using a_p
[PROOF STATE]
proof (prove)
using this:
(f n\<^sub>1 @ a) ! i = f n\<^sub>1 ! i
f n\<^sub>1 @ a = f n\<^sub>2

goal (1 subgoal):
 1. f n\<^sub>1 ! i = f n\<^sub>2 ! i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f n\<^sub>1 ! i = f n\<^sub>2 ! i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma enc_atom_dec:
  "\<lbrakk>wf_word n w; \<forall>i \<in> FO. i < n \<longrightarrow> (\<exists>!p. p < length w \<and> snd (w ! p) ! i); p < length w\<rbrakk> \<Longrightarrow>
   enc_atom (dec_interp n FO w) p (fst (w ! p)) = w ! p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>wf_word n w; \<forall>i\<in>FO. i < n \<longrightarrow> (\<exists>!p. p < length w \<and> snd (w ! p) ! i); p < length w\<rbrakk> \<Longrightarrow> enc_atom (dec_interp n FO w) p (fst (w ! p)) = w ! p
[PROOF STEP]
unfolding wf_word dec_interp_def map_filter_def Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>w \<in> lists ((set \<circ> \<sigma> \<Sigma>) n); \<forall>i\<in>FO. i < n \<longrightarrow> (\<exists>!p. p < length w \<and> snd (w ! p) ! i); p < length w\<rbrakk> \<Longrightarrow> enc_atom (map (\<lambda>i. if i \<in> FO then Inl (the_elem (positions_in_row w i)) else Inr (positions_in_row w i)) [0..<n]) p (fst (w ! p)) = w ! p
[PROOF STEP]
by (auto 0 4 simp: comp_def \<sigma>_def set_n_lists positions_in_row dest: nth_mem[of p w]
    intro!: trans[OF iffD2[OF prod.inject] prod.collapse] nth_equalityI the_equality[symmetric]
    intro: the1I2[of "\<lambda>p. p < length w \<and> snd (w ! p) ! i" "\<lambda>p. snd (w ! p) ! i" for i]
    elim!: contrapos_np[of _ False])


[STATEMENT]
lemma group_free_Abelian_group [simp]: "group (free_Abelian_group S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.group (free_Abelian_group S)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Group.group (free_Abelian_group S)
[PROOF STEP]
have "\<And>x. Poly_Mapping.keys x \<subseteq> S \<Longrightarrow> x \<in> Units (free_Abelian_group S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. Poly_Mapping.keys x \<subseteq> S \<Longrightarrow> x \<in> Units (free_Abelian_group S)
[PROOF STEP]
unfolding free_Abelian_group_def Units_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. Poly_Mapping.keys x \<subseteq> S \<Longrightarrow> x \<in> {y \<in> carrier \<lparr>carrier = {c. Poly_Mapping.keys c \<subseteq> S}, mult = (+), one = 0\<rparr>. \<exists>x\<in>carrier \<lparr>carrier = {c. Poly_Mapping.keys c \<subseteq> S}, mult = (+), one = 0\<rparr>. x \<otimes>\<^bsub>\<lparr>carrier = {c. Poly_Mapping.keys c \<subseteq> S}, mult = (+), one = 0\<rparr>\<^esub> y = \<one>\<^bsub>\<lparr>carrier = {c. Poly_Mapping.keys c \<subseteq> S}, mult = (+), one = 0\<rparr>\<^esub> \<and> y \<otimes>\<^bsub>\<lparr>carrier = {c. Poly_Mapping.keys c \<subseteq> S}, mult = (+), one = 0\<rparr>\<^esub> x = \<one>\<^bsub>\<lparr>carrier = {c. Poly_Mapping.keys c \<subseteq> S}, mult = (+), one = 0\<rparr>\<^esub>}
[PROOF STEP]
by clarsimp (metis eq_neg_iff_add_eq_0 neg_eq_iff_add_eq_0 keys_minus)
[PROOF STATE]
proof (state)
this:
Poly_Mapping.keys ?x \<subseteq> S \<Longrightarrow> ?x \<in> Units (free_Abelian_group S)

goal (1 subgoal):
 1. Group.group (free_Abelian_group S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Poly_Mapping.keys ?x \<subseteq> S \<Longrightarrow> ?x \<in> Units (free_Abelian_group S)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Poly_Mapping.keys ?x \<subseteq> S \<Longrightarrow> ?x \<in> Units (free_Abelian_group S)

goal (1 subgoal):
 1. Group.group (free_Abelian_group S)
[PROOF STEP]
unfolding free_Abelian_group_def
[PROOF STATE]
proof (prove)
using this:
Poly_Mapping.keys ?x \<subseteq> S \<Longrightarrow> ?x \<in> Units \<lparr>carrier = {c. Poly_Mapping.keys c \<subseteq> S}, mult = (+), one = 0\<rparr>

goal (1 subgoal):
 1. Group.group \<lparr>carrier = {c. Poly_Mapping.keys c \<subseteq> S}, mult = (+), one = 0\<rparr>
[PROOF STEP]
by unfold_locales (auto simp: dest: subsetD [OF keys_add])
[PROOF STATE]
proof (state)
this:
Group.group (free_Abelian_group S)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma higher_lower_decomp: "higher p v + monomial (lookup p v) v + lower p v = p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. higher p v + monomial (lookup p v) v + lower p v = p
[PROOF STEP]
proof (rule poly_mapping_eqI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k. lookup (higher p v + monomial (lookup p v) v + lower p v) k = lookup p k
[PROOF STEP]
fix u
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k. lookup (higher p v + monomial (lookup p v) v + lower p v) k = lookup p k
[PROOF STEP]
show "lookup (higher p v + monomial (lookup p v) v + lower p v) u = lookup p u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup (higher p v + monomial (lookup p v) v + lower p v) u = lookup p u
[PROOF STEP]
proof (rule ord_term_lin.linorder_cases)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. ?x \<prec>\<^sub>t ?y \<Longrightarrow> lookup (higher p v + monomial (lookup p v) v + lower p v) u = lookup p u
 2. ?x = ?y \<Longrightarrow> lookup (higher p v + monomial (lookup p v) v + lower p v) u = lookup p u
 3. ?y \<prec>\<^sub>t ?x \<Longrightarrow> lookup (higher p v + monomial (lookup p v) v + lower p v) u = lookup p u
[PROOF STEP]
assume "u \<prec>\<^sub>t v"
[PROOF STATE]
proof (state)
this:
u \<prec>\<^sub>t v

goal (3 subgoals):
 1. ?x \<prec>\<^sub>t ?y \<Longrightarrow> lookup (higher p v + monomial (lookup p v) v + lower p v) u = lookup p u
 2. ?x = ?y \<Longrightarrow> lookup (higher p v + monomial (lookup p v) v + lower p v) u = lookup p u
 3. ?y \<prec>\<^sub>t ?x \<Longrightarrow> lookup (higher p v + monomial (lookup p v) v + lower p v) u = lookup p u
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
u \<prec>\<^sub>t v

goal (1 subgoal):
 1. lookup (higher p v + monomial (lookup p v) v + lower p v) u = lookup p u
[PROOF STEP]
by (simp add: lookup_add lookup_higher_when lookup_single lookup_lower_when)
[PROOF STATE]
proof (state)
this:
lookup (higher p v + monomial (lookup p v) v + lower p v) u = lookup p u

goal (2 subgoals):
 1. u = v \<Longrightarrow> lookup (higher p v + monomial (lookup p v) v + lower p v) u = lookup p u
 2. v \<prec>\<^sub>t u \<Longrightarrow> lookup (higher p v + monomial (lookup p v) v + lower p v) u = lookup p u
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. u = v \<Longrightarrow> lookup (higher p v + monomial (lookup p v) v + lower p v) u = lookup p u
 2. v \<prec>\<^sub>t u \<Longrightarrow> lookup (higher p v + monomial (lookup p v) v + lower p v) u = lookup p u
[PROOF STEP]
assume "u = v"
[PROOF STATE]
proof (state)
this:
u = v

goal (2 subgoals):
 1. u = v \<Longrightarrow> lookup (higher p v + monomial (lookup p v) v + lower p v) u = lookup p u
 2. v \<prec>\<^sub>t u \<Longrightarrow> lookup (higher p v + monomial (lookup p v) v + lower p v) u = lookup p u
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
u = v

goal (1 subgoal):
 1. lookup (higher p v + monomial (lookup p v) v + lower p v) u = lookup p u
[PROOF STEP]
by (simp add: lookup_add lookup_higher_when lookup_single lookup_lower_when)
[PROOF STATE]
proof (state)
this:
lookup (higher p v + monomial (lookup p v) v + lower p v) u = lookup p u

goal (1 subgoal):
 1. v \<prec>\<^sub>t u \<Longrightarrow> lookup (higher p v + monomial (lookup p v) v + lower p v) u = lookup p u
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. v \<prec>\<^sub>t u \<Longrightarrow> lookup (higher p v + monomial (lookup p v) v + lower p v) u = lookup p u
[PROOF STEP]
assume "v \<prec>\<^sub>t u"
[PROOF STATE]
proof (state)
this:
v \<prec>\<^sub>t u

goal (1 subgoal):
 1. v \<prec>\<^sub>t u \<Longrightarrow> lookup (higher p v + monomial (lookup p v) v + lower p v) u = lookup p u
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
v \<prec>\<^sub>t u

goal (1 subgoal):
 1. lookup (higher p v + monomial (lookup p v) v + lower p v) u = lookup p u
[PROOF STEP]
by (simp add: lookup_add lookup_higher_when lookup_single lookup_lower_when)
[PROOF STATE]
proof (state)
this:
lookup (higher p v + monomial (lookup p v) v + lower p v) u = lookup p u

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
lookup (higher p v + monomial (lookup p v) v + lower p v) u = lookup p u

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_minus_filter_out:
  "set xs - {y} = set (filter (\<lambda>x. \<not> (x = y)) xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set xs - {y} = set (filter (\<lambda>x. x \<noteq> y) xs)
[PROOF STEP]
by (induct xs) auto


[STATEMENT]
lemma expands_to_max_lt:
  assumes "(g expands_to G) basis" "eventually (\<lambda>x. f x < g x) at_top"
  shows   "((\<lambda>x. max (f x) (g x)) expands_to G) basis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. max (f x) (g x)) expands_to G) basis
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
(g expands_to G) basis

goal (1 subgoal):
 1. ((\<lambda>x. max (f x) (g x)) expands_to G) basis
[PROOF STEP]
by (rule expands_to_cong) (insert assms(2), auto simp: max_def elim: eventually_mono)


[STATEMENT]
lemma cf_list_entries:
  assumes "i \<le> deg R p"
  shows "(cf_list R p)!i = p i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cf_list R p ! i = p i
[PROOF STEP]
unfolding cf_list_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map p [0..<Suc (deg R p)] ! i = p i
[PROOF STEP]
by (metis add.left_neutral assms diff_zero less_Suc_eq_le map_eq_map_tailrec nth_map_upt)


[STATEMENT]
lemma Inf_exp_greatest:
  "\<lbrakk> S \<noteq> {}; \<forall>P\<in>S. Q \<le> P \<rbrakk> \<Longrightarrow> Q \<le> Inf_exp S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S \<noteq> {}; \<forall>P\<in>S. Q \<tturnstile> P\<rbrakk> \<Longrightarrow> Q \<tturnstile> Inf_exp S
[PROOF STEP]
unfolding Inf_exp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S \<noteq> {}; \<forall>P\<in>S. Q \<tturnstile> P\<rbrakk> \<Longrightarrow> Q \<tturnstile> \<lambda>s. Inf {f s |f. f \<in> S}
[PROOF STEP]
by(auto intro!:le_funI[OF cInf_greatest])


[STATEMENT]
lemma matrix_point_not_in_block_zero: "i < \<v> \<Longrightarrow> j < \<b> \<Longrightarrow> \<V>s ! i \<notin> \<B>s ! j \<Longrightarrow> N $$ (i, j) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i < \<v>; j < \<b>; \<V>s ! i \<notin> \<B>s ! j\<rbrakk> \<Longrightarrow> N $$ (i, j) = 0
[PROOF STEP]
by(metis inc_matrix_point_not_in_block_zero points_list_length blocks_list_length)


[STATEMENT]
lemma meet_col_2:
  assumes "meet_in (line A B) (line C D) P"
  shows "col C D P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. col C D P
[PROOF STEP]
using assms meet_col_1 meet_in_def
[PROOF STATE]
proof (prove)
using this:
meet_in (line A B) (line C D) P
meet_in (line ?A ?B) (line ?C ?D) ?P \<Longrightarrow> col ?A ?B ?P
meet_in ?l ?m ?P \<equiv> incid ?P ?l \<and> incid ?P ?m

goal (1 subgoal):
 1. col C D P
[PROOF STEP]
by auto


[STATEMENT]
lemma reaches_invar: "reaches f x n y \<Longrightarrow> P x \<Longrightarrow> (\<And>z z' v. P z \<Longrightarrow> f z = Some (z', v) \<Longrightarrow> P z') \<Longrightarrow> P y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>reaches f x n y; P x; \<And>z z' v. \<lbrakk>P z; f z = Some (z', v)\<rbrakk> \<Longrightarrow> P z'\<rbrakk> \<Longrightarrow> P y
[PROOF STEP]
by (induction x n y rule: reaches.induct) auto


[STATEMENT]
lemma Allowed_totalize [simp]: "Allowed (totalize F) = Allowed F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Allowed (totalize F) = Allowed F
[PROOF STEP]
by (simp add: Allowed_def)


[STATEMENT]
lemma separatedin_Union:
  "finite \<F> \<Longrightarrow> separatedin X S (\<Union>\<F>) \<longleftrightarrow> S \<subseteq> topspace X \<and> (\<forall>T \<in> \<F>. separatedin X S T)"
  "finite \<F> \<Longrightarrow> separatedin X (\<Union>\<F>) S \<longleftrightarrow> (\<forall>T \<in> \<F>. separatedin X S T) \<and> S \<subseteq> topspace X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (finite \<F> \<Longrightarrow> separatedin X S (\<Union> \<F>) = (S \<subseteq> topspace X \<and> (\<forall>T\<in>\<F>. separatedin X S T))) &&& (finite \<F> \<Longrightarrow> separatedin X (\<Union> \<F>) S = ((\<forall>T\<in>\<F>. separatedin X S T) \<and> S \<subseteq> topspace X))
[PROOF STEP]
by (auto simp: separatedin_def closure_of_Union)


[STATEMENT]
lemma construct_in_span:
  assumes B[simp]: "vs1.independent B"
  shows "construct B f v \<in> vs2.span (f ` B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. construct B f v \<in> vs2.span (f ` B)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. construct B f v \<in> vs2.span (f ` B)
[PROOF STEP]
interpret c: linear s1 s2 "construct B f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. linear (*a) (*b) (construct B f)
[PROOF STEP]
by (rule linear_construct) fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. construct B f v \<in> vs2.span (f ` B)
[PROOF STEP]
let ?R = "vs1.representation B"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. construct B f v \<in> vs2.span (f ` B)
[PROOF STEP]
have "v \<in> vs1.span ((vs1.extend_basis B - B) \<union> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> vs1.span (vs1.extend_basis B - B \<union> B)
[PROOF STEP]
by (auto simp: Un_absorb2 vs1.extend_basis_superset)
[PROOF STATE]
proof (state)
this:
v \<in> vs1.span (vs1.extend_basis B - B \<union> B)

goal (1 subgoal):
 1. construct B f v \<in> vs2.span (f ` B)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
v \<in> vs1.span (vs1.extend_basis B - B \<union> B)
[PROOF STEP]
obtain x y where "v = x + y" "x \<in> vs1.span (vs1.extend_basis B - B)" "y \<in> vs1.span B"
[PROOF STATE]
proof (prove)
using this:
v \<in> vs1.span (vs1.extend_basis B - B \<union> B)

goal (1 subgoal):
 1. (\<And>x y. \<lbrakk>v = x + y; x \<in> vs1.span (vs1.extend_basis B - B); y \<in> vs1.span B\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding vs1.span_Un
[PROOF STATE]
proof (prove)
using this:
v \<in> {x + y |x y. x \<in> vs1.span (vs1.extend_basis B - B) \<and> y \<in> vs1.span B}

goal (1 subgoal):
 1. (\<And>x y. \<lbrakk>v = x + y; x \<in> vs1.span (vs1.extend_basis B - B); y \<in> vs1.span B\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v = x + y
x \<in> vs1.span (vs1.extend_basis B - B)
y \<in> vs1.span B

goal (1 subgoal):
 1. construct B f v \<in> vs2.span (f ` B)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
v = x + y
x \<in> vs1.span (vs1.extend_basis B - B)
y \<in> vs1.span B

goal (1 subgoal):
 1. construct B f v \<in> vs2.span (f ` B)
[PROOF STEP]
have "construct B f (\<Sum>b | ?R y b \<noteq> 0. ?R y b *a b) \<in> vs2.span (f ` B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. construct B f (\<Sum>b | vs1.representation B y b \<noteq> (0::'a). vs1.representation B y b *a b) \<in> vs2.span (f ` B)
[PROOF STEP]
by (auto simp add: c.sum c.scale construct_basis vs1.representation_ne_zero
      intro!: vs2.span_sum vs2.span_scale intro: vs2.span_base )
[PROOF STATE]
proof (state)
this:
construct B f (\<Sum>b | vs1.representation B y b \<noteq> (0::'a). vs1.representation B y b *a b) \<in> vs2.span (f ` B)

goal (1 subgoal):
 1. construct B f v \<in> vs2.span (f ` B)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
v = x + y
x \<in> vs1.span (vs1.extend_basis B - B)
y \<in> vs1.span B
construct B f (\<Sum>b | vs1.representation B y b \<noteq> (0::'a). vs1.representation B y b *a b) \<in> vs2.span (f ` B)
[PROOF STEP]
show "construct B f v \<in> vs2.span (f ` B)"
[PROOF STATE]
proof (prove)
using this:
v = x + y
x \<in> vs1.span (vs1.extend_basis B - B)
y \<in> vs1.span B
construct B f (\<Sum>b | vs1.representation B y b \<noteq> (0::'a). vs1.representation B y b *a b) \<in> vs2.span (f ` B)

goal (1 subgoal):
 1. construct B f v \<in> vs2.span (f ` B)
[PROOF STEP]
by (auto simp add: c.add construct_outside vs1.sum_nonzero_representation_eq)
[PROOF STATE]
proof (state)
this:
construct B f v \<in> vs2.span (f ` B)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma positions_strict_border: "l < length w \<Longrightarrow> \<forall>j<l. w!j = w!(length w - l + j) \<Longrightarrow> strict_border (take l w) w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>l < length w; \<forall>j<l. w ! j = w ! (length w - l + j)\<rbrakk> \<Longrightarrow> strict_border (take l w) w
[PROOF STEP]
by (simp add: positions_border strict_border_def)


[STATEMENT]
lemma arbitrary_union_of_Union:
   "(\<And>S. S \<in> \<U> \<Longrightarrow> (arbitrary union_of P) S) \<Longrightarrow> (arbitrary union_of P) (\<Union>\<U>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>S. S \<in> \<U> \<Longrightarrow> (arbitrary union_of P) S) \<Longrightarrow> (arbitrary union_of P) (\<Union> \<U>)
[PROOF STEP]
by (metis union_of_def arbitrary_def arbitrary_union_of_idempot mem_Collect_eq subsetI)


[STATEMENT]
theorem make_set:
  "VARS p
  [ point x \<and> p0 = p ]
  p[x] := x
  [ make_set_postcondition p x p0 ]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [point x \<and> p0 = p]
p := (p[x\<longmapsto>x])
[make_set_postcondition p x p0]
[PROOF STEP]
apply vcg_tc_simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. point x \<Longrightarrow> make_set_postcondition (p0[x\<longmapsto>x]) x p0
[PROOF STEP]
by (simp add: make_set_postcondition_def inf_sup_distrib1 inf_assoc[THEN sym] vector_covector[THEN sym])


[STATEMENT]
lemma find_sub_in_sound: "find_sub_in X xs b = Some (ys, z, zs) \<Longrightarrow>
  xs = ys @ z # zs \<and> (z \<subseteq> X \<or> (b \<and> X \<subseteq> z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. find_sub_in X xs b = Some (ys, z, zs) \<Longrightarrow> xs = ys @ z # zs \<and> (z \<subseteq> X \<or> b \<and> X \<subseteq> z)
[PROOF STEP]
by (induction X xs b arbitrary: ys z zs rule: find_sub_in.induct)
     (fastforce split: if_splits option.splits)+


[STATEMENT]
lemma hausdorff_distance_nonneg [simp, mono_intros]:
  "hausdorff_distance A B \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> hausdorff_distance A B
[PROOF STEP]
proof (cases "A = {} \<or> B = {} \<or> (\<not>(bounded A)) \<or> (\<not>(bounded B))")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. A = {} \<or> B = {} \<or> \<not> bounded A \<or> \<not> bounded B \<Longrightarrow> 0 \<le> hausdorff_distance A B
 2. \<not> (A = {} \<or> B = {} \<or> \<not> bounded A \<or> \<not> bounded B) \<Longrightarrow> 0 \<le> hausdorff_distance A B
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
A = {} \<or> B = {} \<or> \<not> bounded A \<or> \<not> bounded B

goal (2 subgoals):
 1. A = {} \<or> B = {} \<or> \<not> bounded A \<or> \<not> bounded B \<Longrightarrow> 0 \<le> hausdorff_distance A B
 2. \<not> (A = {} \<or> B = {} \<or> \<not> bounded A \<or> \<not> bounded B) \<Longrightarrow> 0 \<le> hausdorff_distance A B
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A = {} \<or> B = {} \<or> \<not> bounded A \<or> \<not> bounded B
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
A = {} \<or> B = {} \<or> \<not> bounded A \<or> \<not> bounded B

goal (1 subgoal):
 1. 0 \<le> hausdorff_distance A B
[PROOF STEP]
unfolding hausdorff_distance_def
[PROOF STATE]
proof (prove)
using this:
A = {} \<or> B = {} \<or> \<not> bounded A \<or> \<not> bounded B

goal (1 subgoal):
 1. 0 \<le> (if A = {} \<or> B = {} \<or> \<not> bounded A \<or> \<not> bounded B then 0 else max (SUP x\<in>A. infdist x B) (SUP x\<in>B. infdist x A))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> hausdorff_distance A B

goal (1 subgoal):
 1. \<not> (A = {} \<or> B = {} \<or> \<not> bounded A \<or> \<not> bounded B) \<Longrightarrow> 0 \<le> hausdorff_distance A B
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (A = {} \<or> B = {} \<or> \<not> bounded A \<or> \<not> bounded B) \<Longrightarrow> 0 \<le> hausdorff_distance A B
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (A = {} \<or> B = {} \<or> \<not> bounded A \<or> \<not> bounded B)

goal (1 subgoal):
 1. \<not> (A = {} \<or> B = {} \<or> \<not> bounded A \<or> \<not> bounded B) \<Longrightarrow> 0 \<le> hausdorff_distance A B
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (A = {} \<or> B = {} \<or> \<not> bounded A \<or> \<not> bounded B)
[PROOF STEP]
have "A \<noteq> {}" "B \<noteq> {}" "bounded A" "bounded B"
[PROOF STATE]
proof (prove)
using this:
\<not> (A = {} \<or> B = {} \<or> \<not> bounded A \<or> \<not> bounded B)

goal (1 subgoal):
 1. (A \<noteq> {} &&& B \<noteq> {}) &&& bounded A &&& bounded B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A \<noteq> {}
B \<noteq> {}
bounded A
bounded B

goal (1 subgoal):
 1. \<not> (A = {} \<or> B = {} \<or> \<not> bounded A \<or> \<not> bounded B) \<Longrightarrow> 0 \<le> hausdorff_distance A B
[PROOF STEP]
have "(SUP x\<in>A. infdist x B) \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> (SUP x\<in>A. infdist x B)
[PROOF STEP]
using bdd_above_infdist_aux[OF \<open>bounded A\<close> \<open>bounded B\<close>] infdist_nonneg
[PROOF STATE]
proof (prove)
using this:
bdd_above ((\<lambda>x. infdist x B) ` A)
0 \<le> infdist ?x ?A

goal (1 subgoal):
 1. 0 \<le> (SUP x\<in>A. infdist x B)
[PROOF STEP]
by (metis \<open>A \<noteq> {}\<close> all_not_in_conv cSUP_upper2)
[PROOF STATE]
proof (state)
this:
0 \<le> (SUP x\<in>A. infdist x B)

goal (1 subgoal):
 1. \<not> (A = {} \<or> B = {} \<or> \<not> bounded A \<or> \<not> bounded B) \<Longrightarrow> 0 \<le> hausdorff_distance A B
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 \<le> (SUP x\<in>A. infdist x B)

goal (1 subgoal):
 1. \<not> (A = {} \<or> B = {} \<or> \<not> bounded A \<or> \<not> bounded B) \<Longrightarrow> 0 \<le> hausdorff_distance A B
[PROOF STEP]
have "(SUP x\<in>B. infdist x A) \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> (SUP x\<in>B. infdist x A)
[PROOF STEP]
using bdd_above_infdist_aux[OF \<open>bounded B\<close> \<open>bounded A\<close>] infdist_nonneg
[PROOF STATE]
proof (prove)
using this:
bdd_above ((\<lambda>x. infdist x A) ` B)
0 \<le> infdist ?x ?A

goal (1 subgoal):
 1. 0 \<le> (SUP x\<in>B. infdist x A)
[PROOF STEP]
by (metis \<open>B \<noteq> {}\<close> all_not_in_conv cSUP_upper2)
[PROOF STATE]
proof (state)
this:
0 \<le> (SUP x\<in>B. infdist x A)

goal (1 subgoal):
 1. \<not> (A = {} \<or> B = {} \<or> \<not> bounded A \<or> \<not> bounded B) \<Longrightarrow> 0 \<le> hausdorff_distance A B
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
0 \<le> (SUP x\<in>A. infdist x B)
0 \<le> (SUP x\<in>B. infdist x A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 \<le> (SUP x\<in>A. infdist x B)
0 \<le> (SUP x\<in>B. infdist x A)

goal (1 subgoal):
 1. 0 \<le> hausdorff_distance A B
[PROOF STEP]
unfolding hausdorff_distance_def
[PROOF STATE]
proof (prove)
using this:
0 \<le> (SUP x\<in>A. infdist x B)
0 \<le> (SUP x\<in>B. infdist x A)

goal (1 subgoal):
 1. 0 \<le> (if A = {} \<or> B = {} \<or> \<not> bounded A \<or> \<not> bounded B then 0 else max (SUP x\<in>A. infdist x B) (SUP x\<in>B. infdist x A))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> hausdorff_distance A B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prodrg_pOp:"\<forall>k\<in>I. Ring (A k) \<Longrightarrow>
                  pop (prodrg I A) = prod_pOp I A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>k\<in>I. Ring (A k) \<Longrightarrow> (\<plusminus>\<^bsub>r\<Pi>\<^bsub>I\<^esub> A\<^esub>) = prod_pOp I A
[PROOF STEP]
apply (simp add:prodrg_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma circle_left_bot_edges_neq [simp]: "circle_left_edge \<noteq> circle_bot_edge"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. circle_left_edge \<noteq> circle_bot_edge
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. circle_left_edge \<noteq> circle_bot_edge
[PROOF STEP]
have "circle_bot_edge = (1, \<lambda>r. (x_coord r * d, - d * circle_y (x_coord r)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. circle_bot_edge = (1, \<lambda>r. (x_coord r * d, - d * circle_y (x_coord r)))
[PROOF STEP]
using circle.circle_bot_edge_def circle_axioms
[PROOF STATE]
proof (prove)
using this:
circle ?i ?j ?d \<Longrightarrow> circle.circle_bot_edge ?d = (1, \<lambda>t. (x_coord t * ?d, - ?d * circle_y (x_coord t)))
circle i j d

goal (1 subgoal):
 1. circle_bot_edge = (1, \<lambda>r. (x_coord r * d, - d * circle_y (x_coord r)))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
circle_bot_edge = (1, \<lambda>r. (x_coord r * d, - d * circle_y (x_coord r)))

goal (1 subgoal):
 1. circle_left_edge \<noteq> circle_bot_edge
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
circle_bot_edge = (1, \<lambda>r. (x_coord r * d, - d * circle_y (x_coord r)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
circle_bot_edge = (1, \<lambda>r. (x_coord r * d, - d * circle_y (x_coord r)))

goal (1 subgoal):
 1. circle_left_edge \<noteq> circle_bot_edge
[PROOF STEP]
by (simp add: circle_left_edge_def)
[PROOF STATE]
proof (state)
this:
circle_left_edge \<noteq> circle_bot_edge

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma option_map_mono[partial_function_mono]:
  assumes mf: "mono_option B"
  shows "mono_option (\<lambda>f. map_option h (B f))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monotone option.le_fun option_ord (\<lambda>f. map_option h (B f))
[PROOF STEP]
proof (rule monotoneI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. option.le_fun x y \<Longrightarrow> option_ord (map_option h (B x)) (map_option h (B y))
[PROOF STEP]
fix f g :: "'a \<Rightarrow> 'b option"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. option.le_fun x y \<Longrightarrow> option_ord (map_option h (B x)) (map_option h (B y))
[PROOF STEP]
assume fg: "fun_ord option_ord f g"
[PROOF STATE]
proof (state)
this:
option.le_fun f g

goal (1 subgoal):
 1. \<And>x y. option.le_fun x y \<Longrightarrow> option_ord (map_option h (B x)) (map_option h (B y))
[PROOF STEP]
with mf
[PROOF STATE]
proof (chain)
picking this:
monotone option.le_fun option_ord B
option.le_fun f g
[PROOF STEP]
have "option_ord (B f) (B g)"
[PROOF STATE]
proof (prove)
using this:
monotone option.le_fun option_ord B
option.le_fun f g

goal (1 subgoal):
 1. option_ord (B f) (B g)
[PROOF STEP]
by (rule monotoneD[of _ _ _ f g])
[PROOF STATE]
proof (state)
this:
option_ord (B f) (B g)

goal (1 subgoal):
 1. \<And>x y. option.le_fun x y \<Longrightarrow> option_ord (map_option h (B x)) (map_option h (B y))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
option_ord (B f) (B g)
[PROOF STEP]
show "option_ord (map_option h (B f)) (map_option h (B g))"
[PROOF STATE]
proof (prove)
using this:
option_ord (B f) (B g)

goal (1 subgoal):
 1. option_ord (map_option h (B f)) (map_option h (B g))
[PROOF STEP]
unfolding flat_ord_def
[PROOF STATE]
proof (prove)
using this:
B f = None \<or> B f = B g

goal (1 subgoal):
 1. map_option h (B f) = None \<or> map_option h (B f) = map_option h (B g)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
option_ord (map_option h (B f)) (map_option h (B g))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma linear_compose: "linear s1 s2 f \<Longrightarrow> linear s2 s3 g \<Longrightarrow> linear s1 s3 (g o f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>linear s1 s2 f; linear s2 s3 g\<rbrakk> \<Longrightarrow> linear s1 s3 (g \<circ> f)
[PROOF STEP]
unfolding module_hom_iff_linear[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>module_hom s1 s2 f; module_hom s2 s3 g\<rbrakk> \<Longrightarrow> module_hom s1 s3 (g \<circ> f)
[PROOF STEP]
by (rule module_hom_compose)


[STATEMENT]
lemma empty_fine_imp_eq: "\<lbrakk>fine \<delta> (a, b) D; D = []\<rbrakk> \<Longrightarrow> a = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>fine \<delta> (a, b) D; D = []\<rbrakk> \<Longrightarrow> a = b
[PROOF STEP]
by (simp add: fine_Nil_iff)


[STATEMENT]
lemma circle_right_bot_edges_neq [simp]: "circle_right_edge \<noteq> circle_bot_edge"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. circle_right_edge \<noteq> circle_bot_edge
[PROOF STEP]
by (smt Pair_inject circle_bot_edge_def d_gt_0 circle.circle_right_edge_def circle_axioms mult_le_cancel_iff1 x_coord_def)