[STATEMENT]
lemma f_Streams_Connected_nth_conv_if: "
  f_Streams_Connected outS inS =
  (length inS = Suc (length outS) \<and>
  (\<forall>i<length inS. inS ! i = (if i = 0 then \<NoMsg> else outS ! (i - Suc 0))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f_Streams_Connected outS inS = (length inS = Suc (length outS) \<and> (\<forall>i<length inS. inS ! i = (if i = 0 then NoMsg else outS ! (i - Suc 0))))
[PROOF STEP]
apply (subst f_Streams_Connected_nth_conv)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (length inS = Suc (length outS) \<and> (\<forall>i<length inS. inS ! i = (case i of 0 \<Rightarrow> NoMsg | Suc x \<Rightarrow> outS ! x))) = (length inS = Suc (length outS) \<and> (\<forall>i<length inS. inS ! i = (if i = 0 then NoMsg else outS ! (i - Suc 0))))
[PROOF STEP]
apply (rule conj_cong, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length inS = Suc (length outS) \<Longrightarrow> (\<forall>i<length inS. inS ! i = (case i of 0 \<Rightarrow> NoMsg | Suc x \<Rightarrow> outS ! x)) = (\<forall>i<length inS. inS ! i = (if i = 0 then NoMsg else outS ! (i - Suc 0)))
[PROOF STEP]
apply (rule all_imp_eqI, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>length inS = Suc (length outS); i < length inS\<rbrakk> \<Longrightarrow> (inS ! i = (case i of 0 \<Rightarrow> NoMsg | Suc x \<Rightarrow> outS ! x)) = (inS ! i = (if i = 0 then NoMsg else outS ! (i - Suc 0)))
[PROOF STEP]
apply (rename_tac i, case_tac i, simp+)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma (in ring_hom_ring) subfield_polynomial_hom:
  assumes "subfield K R" and "\<one>\<^bsub>S\<^esub> \<noteq> \<zero>\<^bsub>S\<^esub>"
  shows "p \<in> carrier (K[X]\<^bsub>R\<^esub>) \<Longrightarrow> (map h p) \<in> carrier ((h ` K)[X]\<^bsub>S\<^esub>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<in> carrier (K [X]) \<Longrightarrow> map h p \<in> carrier (h ` K [X]\<^bsub>S\<^esub>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p \<in> carrier (K [X]) \<Longrightarrow> map h p \<in> carrier (h ` K [X]\<^bsub>S\<^esub>)
[PROOF STEP]
assume "p \<in> carrier (K[X]\<^bsub>R\<^esub>)"
[PROOF STATE]
proof (state)
this:
p \<in> carrier (K [X])

goal (1 subgoal):
 1. p \<in> carrier (K [X]) \<Longrightarrow> map h p \<in> carrier (h ` K [X]\<^bsub>S\<^esub>)
[PROOF STEP]
hence "p \<in> carrier (poly_ring (R \<lparr> carrier := K \<rparr>))"
[PROOF STATE]
proof (prove)
using this:
p \<in> carrier (K [X])

goal (1 subgoal):
 1. p \<in> carrier (poly_ring (R\<lparr>carrier := K\<rparr>))
[PROOF STEP]
using R.univ_poly_consistent[OF subfieldE(1)[OF assms(1)]]
[PROOF STATE]
proof (prove)
using this:
p \<in> carrier (K [X])
univ_poly (R\<lparr>carrier := K\<rparr>) = univ_poly R

goal (1 subgoal):
 1. p \<in> carrier (poly_ring (R\<lparr>carrier := K\<rparr>))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
p \<in> carrier (poly_ring (R\<lparr>carrier := K\<rparr>))

goal (1 subgoal):
 1. p \<in> carrier (K [X]) \<Longrightarrow> map h p \<in> carrier (h ` K [X]\<^bsub>S\<^esub>)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
p \<in> carrier (poly_ring (R\<lparr>carrier := K\<rparr>))

goal (1 subgoal):
 1. p \<in> carrier (K [X]) \<Longrightarrow> map h p \<in> carrier (h ` K [X]\<^bsub>S\<^esub>)
[PROOF STEP]
have "h \<in> ring_hom (R \<lparr> carrier := K \<rparr>) (S \<lparr> carrier := h ` K \<rparr>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h \<in> ring_hom (R\<lparr>carrier := K\<rparr>) (S\<lparr>carrier := h ` K\<rparr>)
[PROOF STEP]
using hom_mult subfieldE(3)[OF assms(1)]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> carrier R; ?y \<in> carrier R\<rbrakk> \<Longrightarrow> h (?x \<otimes> ?y) = h ?x \<otimes>\<^bsub>S\<^esub> h ?y
K \<subseteq> carrier R

goal (1 subgoal):
 1. h \<in> ring_hom (R\<lparr>carrier := K\<rparr>) (S\<lparr>carrier := h ` K\<rparr>)
[PROOF STEP]
unfolding ring_hom_def subset_iff
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> carrier R; ?y \<in> carrier R\<rbrakk> \<Longrightarrow> h (?x \<otimes> ?y) = h ?x \<otimes>\<^bsub>S\<^esub> h ?y
\<forall>t. t \<in> K \<longrightarrow> t \<in> carrier R

goal (1 subgoal):
 1. h \<in> {ha \<in> carrier (R\<lparr>carrier := K\<rparr>) \<rightarrow> carrier (S\<lparr>carrier := h ` K\<rparr>). (\<forall>x y. x \<in> carrier (R\<lparr>carrier := K\<rparr>) \<and> y \<in> carrier (R\<lparr>carrier := K\<rparr>) \<longrightarrow> ha (x \<otimes>\<^bsub>R\<lparr>carrier := K\<rparr>\<^esub> y) = ha x \<otimes>\<^bsub>S\<lparr>carrier := h ` K\<rparr>\<^esub> ha y \<and> ha (x \<oplus>\<^bsub>R\<lparr>carrier := K\<rparr>\<^esub> y) = ha x \<oplus>\<^bsub>S\<lparr>carrier := h ` K\<rparr>\<^esub> ha y) \<and> ha \<one>\<^bsub>R\<lparr>carrier := K\<rparr>\<^esub> = \<one>\<^bsub>S\<lparr>carrier := h ` K\<rparr>\<^esub>}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
h \<in> ring_hom (R\<lparr>carrier := K\<rparr>) (S\<lparr>carrier := h ` K\<rparr>)

goal (1 subgoal):
 1. p \<in> carrier (K [X]) \<Longrightarrow> map h p \<in> carrier (h ` K [X]\<^bsub>S\<^esub>)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
h \<in> ring_hom (R\<lparr>carrier := K\<rparr>) (S\<lparr>carrier := h ` K\<rparr>)

goal (1 subgoal):
 1. p \<in> carrier (K [X]) \<Longrightarrow> map h p \<in> carrier (h ` K [X]\<^bsub>S\<^esub>)
[PROOF STEP]
have "field (R \<lparr> carrier := K \<rparr>)" and "field (S \<lparr> carrier := (h ` K) \<rparr>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. field (R\<lparr>carrier := K\<rparr>) &&& field (S\<lparr>carrier := h ` K\<rparr>)
[PROOF STEP]
using R.subfield_iff(2)[OF assms(1)] S.subfield_iff(2)[OF img_is_subfield(2)[OF assms]]
[PROOF STATE]
proof (prove)
using this:
field (R\<lparr>carrier := K\<rparr>)
field (S\<lparr>carrier := h ` K\<rparr>)

goal (1 subgoal):
 1. field (R\<lparr>carrier := K\<rparr>) &&& field (S\<lparr>carrier := h ` K\<rparr>)
[PROOF STEP]
by simp+
[PROOF STATE]
proof (state)
this:
field (R\<lparr>carrier := K\<rparr>)
field (S\<lparr>carrier := h ` K\<rparr>)

goal (1 subgoal):
 1. p \<in> carrier (K [X]) \<Longrightarrow> map h p \<in> carrier (h ` K [X]\<^bsub>S\<^esub>)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
p \<in> carrier (poly_ring (R\<lparr>carrier := K\<rparr>))
h \<in> ring_hom (R\<lparr>carrier := K\<rparr>) (S\<lparr>carrier := h ` K\<rparr>)
field (R\<lparr>carrier := K\<rparr>)
field (S\<lparr>carrier := h ` K\<rparr>)
[PROOF STEP]
have "(map h p) \<in> carrier (poly_ring (S \<lparr> carrier := h ` K \<rparr>))"
[PROOF STATE]
proof (prove)
using this:
p \<in> carrier (poly_ring (R\<lparr>carrier := K\<rparr>))
h \<in> ring_hom (R\<lparr>carrier := K\<rparr>) (S\<lparr>carrier := h ` K\<rparr>)
field (R\<lparr>carrier := K\<rparr>)
field (S\<lparr>carrier := h ` K\<rparr>)

goal (1 subgoal):
 1. map h p \<in> carrier (poly_ring (S\<lparr>carrier := h ` K\<rparr>))
[PROOF STEP]
using polynomial_hom[of h "R \<lparr> carrier := K \<rparr>" "S \<lparr> carrier := h ` K \<rparr>"]
[PROOF STATE]
proof (prove)
using this:
p \<in> carrier (poly_ring (R\<lparr>carrier := K\<rparr>))
h \<in> ring_hom (R\<lparr>carrier := K\<rparr>) (S\<lparr>carrier := h ` K\<rparr>)
field (R\<lparr>carrier := K\<rparr>)
field (S\<lparr>carrier := h ` K\<rparr>)
\<lbrakk>h \<in> ring_hom (R\<lparr>carrier := K\<rparr>) (S\<lparr>carrier := h ` K\<rparr>); field (R\<lparr>carrier := K\<rparr>); field (S\<lparr>carrier := h ` K\<rparr>); ?p \<in> carrier (poly_ring (R\<lparr>carrier := K\<rparr>))\<rbrakk> \<Longrightarrow> map h ?p \<in> carrier (poly_ring (S\<lparr>carrier := h ` K\<rparr>))

goal (1 subgoal):
 1. map h p \<in> carrier (poly_ring (S\<lparr>carrier := h ` K\<rparr>))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
map h p \<in> carrier (poly_ring (S\<lparr>carrier := h ` K\<rparr>))

goal (1 subgoal):
 1. p \<in> carrier (K [X]) \<Longrightarrow> map h p \<in> carrier (h ` K [X]\<^bsub>S\<^esub>)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
map h p \<in> carrier (poly_ring (S\<lparr>carrier := h ` K\<rparr>))

goal (1 subgoal):
 1. map h p \<in> carrier (h ` K [X]\<^bsub>S\<^esub>)
[PROOF STEP]
using S.univ_poly_consistent[OF subfieldE(1)[OF img_is_subfield(2)[OF assms]]]
[PROOF STATE]
proof (prove)
using this:
map h p \<in> carrier (poly_ring (S\<lparr>carrier := h ` K\<rparr>))
univ_poly (S\<lparr>carrier := h ` K\<rparr>) = univ_poly S

goal (1 subgoal):
 1. map h p \<in> carrier (h ` K [X]\<^bsub>S\<^esub>)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
map h p \<in> carrier (h ` K [X]\<^bsub>S\<^esub>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma strip_while_change_subset:
  assumes "set xs \<subseteq> s"
    "\<forall>x\<in>s. P x \<longrightarrow> S x"
    "\<forall>x\<in>s. (\<not> P x) \<longrightarrow> (\<not> S x)"
  shows "strip_while P xs = strip_while S xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. strip_while P xs = strip_while S xs
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
set xs \<subseteq> s

goal (1 subgoal):
 1. strip_while P xs = strip_while S xs
[PROOF STEP]
proof (induct xs rule: rev_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. set [] \<subseteq> s \<Longrightarrow> strip_while P [] = strip_while S []
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> s \<Longrightarrow> strip_while P xs = strip_while S xs; set (xs @ [x]) \<subseteq> s\<rbrakk> \<Longrightarrow> strip_while P (xs @ [x]) = strip_while S (xs @ [x])
[PROOF STEP]
case (snoc x xs)
[PROOF STATE]
proof (state)
this:
set xs \<subseteq> s \<Longrightarrow> strip_while P xs = strip_while S xs
set (xs @ [x]) \<subseteq> s

goal (2 subgoals):
 1. set [] \<subseteq> s \<Longrightarrow> strip_while P [] = strip_while S []
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> s \<Longrightarrow> strip_while P xs = strip_while S xs; set (xs @ [x]) \<subseteq> s\<rbrakk> \<Longrightarrow> strip_while P (xs @ [x]) = strip_while S (xs @ [x])
[PROOF STEP]
have "x\<in>s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> s
[PROOF STEP]
using snoc(2)
[PROOF STATE]
proof (prove)
using this:
set (xs @ [x]) \<subseteq> s

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

goal (2 subgoals):
 1. set [] \<subseteq> s \<Longrightarrow> strip_while P [] = strip_while S []
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> s \<Longrightarrow> strip_while P xs = strip_while S xs; set (xs @ [x]) \<subseteq> s\<rbrakk> \<Longrightarrow> strip_while P (xs @ [x]) = strip_while S (xs @ [x])
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> s
[PROOF STEP]
have "P x \<longrightarrow> S x" and "(\<not> P x) \<longrightarrow> (\<not> S x)"
[PROOF STATE]
proof (prove)
using this:
x \<in> s

goal (1 subgoal):
 1. P x \<longrightarrow> S x &&& \<not> P x \<longrightarrow> \<not> S x
[PROOF STEP]
using assms(2) assms(3)
[PROOF STATE]
proof (prove)
using this:
x \<in> s
\<forall>x\<in>s. P x \<longrightarrow> S x
\<forall>x\<in>s. \<not> P x \<longrightarrow> \<not> S x

goal (1 subgoal):
 1. P x \<longrightarrow> S x &&& \<not> P x \<longrightarrow> \<not> S x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
P x \<longrightarrow> S x
\<not> P x \<longrightarrow> \<not> S x

goal (2 subgoals):
 1. set [] \<subseteq> s \<Longrightarrow> strip_while P [] = strip_while S []
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> s \<Longrightarrow> strip_while P xs = strip_while S xs; set (xs @ [x]) \<subseteq> s\<rbrakk> \<Longrightarrow> strip_while P (xs @ [x]) = strip_while S (xs @ [x])
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
P x \<longrightarrow> S x
\<not> P x \<longrightarrow> \<not> S x
[PROOF STEP]
have "P x = S x"
[PROOF STATE]
proof (prove)
using this:
P x \<longrightarrow> S x
\<not> P x \<longrightarrow> \<not> S x

goal (1 subgoal):
 1. P x = S x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
P x = S x

goal (2 subgoals):
 1. set [] \<subseteq> s \<Longrightarrow> strip_while P [] = strip_while S []
 2. \<And>x xs. \<lbrakk>set xs \<subseteq> s \<Longrightarrow> strip_while P xs = strip_while S xs; set (xs @ [x]) \<subseteq> s\<rbrakk> \<Longrightarrow> strip_while P (xs @ [x]) = strip_while S (xs @ [x])
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
P x = S x
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
P x = S x

goal (1 subgoal):
 1. strip_while P (xs @ [x]) = strip_while S (xs @ [x])
[PROOF STEP]
using snoc.hyps snoc.prems
[PROOF STATE]
proof (prove)
using this:
P x = S x
set xs \<subseteq> s \<Longrightarrow> strip_while P xs = strip_while S xs
set (xs @ [x]) \<subseteq> s

goal (1 subgoal):
 1. strip_while P (xs @ [x]) = strip_while S (xs @ [x])
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
strip_while P (xs @ [x]) = strip_while S (xs @ [x])

goal (1 subgoal):
 1. set [] \<subseteq> s \<Longrightarrow> strip_while P [] = strip_while S []
[PROOF STEP]
qed simp


[STATEMENT]
lemma basis_row_space_subset_row_space:
fixes A::"'a::{field}^'cols::{mod_type}^'rows::{mod_type}"
shows "basis_row_space A \<subseteq> row_space A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. basis_row_space A \<subseteq> row_space A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. basis_row_space A \<subseteq> row_space A
[PROOF STEP]
have "basis_row_space A = {row i (Gauss_Jordan A) |i. row i (Gauss_Jordan A) \<noteq> 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. basis_row_space A = {row i (Gauss_Jordan A) |i. row i (Gauss_Jordan A) \<noteq> 0}
[PROOF STEP]
unfolding basis_row_space_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {row i (Gauss_Jordan A) |i. row i (Gauss_Jordan A) \<noteq> 0} = {row i (Gauss_Jordan A) |i. row i (Gauss_Jordan A) \<noteq> 0}
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
basis_row_space A = {row i (Gauss_Jordan A) |i. row i (Gauss_Jordan A) \<noteq> 0}

goal (1 subgoal):
 1. basis_row_space A \<subseteq> row_space A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
basis_row_space A = {row i (Gauss_Jordan A) |i. row i (Gauss_Jordan A) \<noteq> 0}

goal (1 subgoal):
 1. basis_row_space A \<subseteq> row_space A
[PROOF STEP]
have "... \<subseteq> row_space (Gauss_Jordan A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {row i (Gauss_Jordan A) |i. row i (Gauss_Jordan A) \<noteq> 0} \<subseteq> row_space (Gauss_Jordan A)
[PROOF STEP]
proof (unfold row_space_def, clarify)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x i. row i (Gauss_Jordan A) \<noteq> 0 \<Longrightarrow> row i (Gauss_Jordan A) \<in> vec.span (rows (Gauss_Jordan A))
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x i. row i (Gauss_Jordan A) \<noteq> 0 \<Longrightarrow> row i (Gauss_Jordan A) \<in> vec.span (rows (Gauss_Jordan A))
[PROOF STEP]
assume "row i (Gauss_Jordan A) \<noteq> 0"
[PROOF STATE]
proof (state)
this:
row i (Gauss_Jordan A) \<noteq> 0

goal (1 subgoal):
 1. \<And>x i. row i (Gauss_Jordan A) \<noteq> 0 \<Longrightarrow> row i (Gauss_Jordan A) \<in> vec.span (rows (Gauss_Jordan A))
[PROOF STEP]
show "row i (Gauss_Jordan A) \<in> vec.span (rows (Gauss_Jordan A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row i (Gauss_Jordan A) \<in> vec.span (rows (Gauss_Jordan A))
[PROOF STEP]
using rows_def vec.span_base
[PROOF STATE]
proof (prove)
using this:
rows ?A = {row i ?A |i. i \<in> UNIV}
?a \<in> ?S \<Longrightarrow> ?a \<in> vec.span ?S

goal (1 subgoal):
 1. row i (Gauss_Jordan A) \<in> vec.span (rows (Gauss_Jordan A))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
row i (Gauss_Jordan A) \<in> vec.span (rows (Gauss_Jordan A))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
{row i (Gauss_Jordan A) |i. row i (Gauss_Jordan A) \<noteq> 0} \<subseteq> row_space (Gauss_Jordan A)

goal (1 subgoal):
 1. basis_row_space A \<subseteq> row_space A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{row i (Gauss_Jordan A) |i. row i (Gauss_Jordan A) \<noteq> 0} \<subseteq> row_space (Gauss_Jordan A)

goal (1 subgoal):
 1. basis_row_space A \<subseteq> row_space A
[PROOF STEP]
have "... = row_space A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row_space (Gauss_Jordan A) = row_space A
[PROOF STEP]
unfolding Gauss_Jordan_PA_eq[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row_space (snd (Gauss_Jordan_PA A)) = row_space A
[PROOF STEP]
unfolding fst_Gauss_Jordan_PA[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row_space (fst (Gauss_Jordan_PA A) ** A) = row_space A
[PROOF STEP]
by (rule row_space_is_preserved[OF invertible_fst_Gauss_Jordan_PA])
[PROOF STATE]
proof (state)
this:
row_space (Gauss_Jordan A) = row_space A

goal (1 subgoal):
 1. basis_row_space A \<subseteq> row_space A
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
basis_row_space A \<subseteq> row_space A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
basis_row_space A \<subseteq> row_space A

goal (1 subgoal):
 1. basis_row_space A \<subseteq> row_space A
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
basis_row_space A \<subseteq> row_space A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_list_nlex_eq_zero_iff:
  assumes nlex: "list_all (\<lambda>x. lex x 0) xs"
  shows "sum_list xs = 0 \<longleftrightarrow> list_all ((=) 0) xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sum_list xs = 0) = list_all ((=) 0) xs
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
list_all (\<lambda>x. Counterclockwise_2D_Arbitrary.lex x 0) xs

goal (1 subgoal):
 1. (sum_list xs = 0) = list_all ((=) 0) xs
[PROOF STEP]
by (auto intro: sum_list_nlex_eq_zeroI sum_list_eq0I simp: list_all_iff)


[STATEMENT]
lemma rref_condition4_explicit:
assumes rref_A: "reduced_row_echelon_form A"
and "\<not> is_zero_row i A"
and "i \<noteq> j"
shows "A $ j $ (LEAST n. A $ i $ n \<noteq> 0) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A $ j $ (LEAST n. A $ i $ n \<noteq> (0::'a)) = (0::'a)
[PROOF STEP]
using rref_condition4 assms
[PROOF STATE]
proof (prove)
using this:
reduced_row_echelon_form ?A \<Longrightarrow> \<forall>i. \<not> is_zero_row i ?A \<longrightarrow> (\<forall>j. i \<noteq> j \<longrightarrow> ?A $ j $ (LEAST n. ?A $ i $ n \<noteq> (0::?'a)) = (0::?'a))
reduced_row_echelon_form A
\<not> is_zero_row i A
i \<noteq> j

goal (1 subgoal):
 1. A $ j $ (LEAST n. A $ i $ n \<noteq> (0::'a)) = (0::'a)
[PROOF STEP]
by blast


[STATEMENT]
lemma is_path_undir_sym:
    assumes "is_path_undir G v p v'"
    shows "is_path_undir G v' (rev (map (\<lambda>(u, w, u'). (u', w, u)) p)) v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_path_undir G v' (rev (map (\<lambda>(u, w, u'). (u', w, u)) p)) v
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_path_undir G v p v'

goal (1 subgoal):
 1. is_path_undir G v' (rev (map (\<lambda>(u, w, u'). (u', w, u)) p)) v
[PROOF STEP]
by (induct p arbitrary: v) (auto simp: E_validD)


[STATEMENT]
lemma lm085: (*fixes f::"'a => 'b" fixes P::"'a => bool" fixes xx::"'a"*)
  assumes "P xx"
  shows "{(x,f x)| x. P x},,xx   =   f xx"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(x, f x) |x. P x} ,, xx = f xx
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {(x, f x) |x. P x} ,, xx = f xx
[PROOF STEP]
let ?F="{(x,f x)| x. P x}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {(x, f x) |x. P x} ,, xx = f xx
[PROOF STEP]
let ?X="?F``{xx}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {(x, f x) |x. P x} ,, xx = f xx
[PROOF STEP]
have "?X={f xx}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(x, f x) |x. P x} `` {xx} = {f xx}
[PROOF STEP]
using Image_def assms
[PROOF STATE]
proof (prove)
using this:
?r `` ?s = {y. \<exists>x\<in>?s. (x, y) \<in> ?r}
P xx

goal (1 subgoal):
 1. {(x, f x) |x. P x} `` {xx} = {f xx}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
{(x, f x) |x. P x} `` {xx} = {f xx}

goal (1 subgoal):
 1. {(x, f x) |x. P x} ,, xx = f xx
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
{(x, f x) |x. P x} `` {xx} = {f xx}

goal (1 subgoal):
 1. {(x, f x) |x. P x} ,, xx = f xx
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
{(x, f x) |x. P x} ,, xx = f xx

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vpairs_iff_pairs: "\<langle>a, b\<rangle> \<in>\<^sub>\<circ> vpairs r \<longleftrightarrow> (a, b) \<in> pairs r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<langle>a, b\<rangle> \<in>\<^sub>\<circ> vpairs r) = ((a, b) \<in> pairs r)
[PROOF STEP]
by (simp add: vpairs_iff_elts pairs_iff_elts)


[STATEMENT]
lemma pre_mangoldt_primepow:
  assumes "primepow n" "aprimedivisor n = p"
  shows   "pre_mangoldt n = p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pre_mangoldt n = p
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
primepow n
aprimedivisor n = p

goal (1 subgoal):
 1. pre_mangoldt n = p
[PROOF STEP]
by (simp add: pre_mangoldt_def)


[STATEMENT]
lemma sorted_list_of_map_inj_aux:
    fixes A B :: "'a\<rightharpoonup>'b"
    assumes [simp]: "finite (dom A)"
    assumes [simp]: "finite (dom B)"
    assumes E: "sorted_list_of_map A = sorted_list_of_map B"
    shows "A=B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite (dom A)
finite (dom B)
sorted_list_of_map A = sorted_list_of_map B

goal (1 subgoal):
 1. A = B
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>finite (dom A); finite (dom B); sorted_list_of_map A = sorted_list_of_map B\<rbrakk> \<Longrightarrow> A = B
[PROOF STEP]
have "A = map_of (sorted_list_of_map A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = map_of (sorted_list_of_map A)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
A = map_of (sorted_list_of_map A)

goal (1 subgoal):
 1. \<lbrakk>finite (dom A); finite (dom B); sorted_list_of_map A = sorted_list_of_map B\<rbrakk> \<Longrightarrow> A = B
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A = map_of (sorted_list_of_map A)

goal (1 subgoal):
 1. \<lbrakk>finite (dom A); finite (dom B); sorted_list_of_map A = sorted_list_of_map B\<rbrakk> \<Longrightarrow> A = B
[PROOF STEP]
note E
[PROOF STATE]
proof (state)
this:
sorted_list_of_map A = sorted_list_of_map B

goal (1 subgoal):
 1. \<lbrakk>finite (dom A); finite (dom B); sorted_list_of_map A = sorted_list_of_map B\<rbrakk> \<Longrightarrow> A = B
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sorted_list_of_map A = sorted_list_of_map B

goal (1 subgoal):
 1. \<lbrakk>finite (dom A); finite (dom B); sorted_list_of_map A = sorted_list_of_map B\<rbrakk> \<Longrightarrow> A = B
[PROOF STEP]
have "map_of (sorted_list_of_map B) = B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_of (sorted_list_of_map B) = B
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
map_of (sorted_list_of_map B) = B

goal (1 subgoal):
 1. \<lbrakk>finite (dom A); finite (dom B); sorted_list_of_map A = sorted_list_of_map B\<rbrakk> \<Longrightarrow> A = B
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
A = B
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
A = B

goal (1 subgoal):
 1. A = B
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
A = B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma liminf_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> liminf u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> liminf 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> liminf u
 2. \<not> ?P \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> liminf u
[PROOF STEP]
assume "\<forall>n. \<exists>p>n. \<forall>m\<ge>p. u m \<ge> u p"
[PROOF STATE]
proof (state)
this:
\<forall>n. \<exists>p>n. \<forall>m\<ge>p. u p \<le> u m

goal (2 subgoals):
 1. ?P \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> liminf u
 2. \<not> ?P \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> liminf u
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>n. \<exists>p>n. \<forall>m\<ge>p. u p \<le> u m
[PROOF STEP]
have "\<exists>r. \<forall>n. (\<forall>m\<ge>r n. u m \<ge> 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 p \<le> u m

goal (1 subgoal):
 1. \<exists>r. \<forall>n. (\<forall>m\<ge>r n. u (r n) \<le> u m) \<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 (r n) \<le> u m) \<and> r n < r (Suc n)

goal (2 subgoals):
 1. ?P \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> liminf u
 2. \<not> ?P \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> liminf u
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>r. \<forall>n. (\<forall>m\<ge>r n. u (r n) \<le> u m) \<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 \<ge> u (r n)"
[PROOF STATE]
proof (prove)
using this:
\<exists>r. \<forall>n. (\<forall>m\<ge>r n. u (r n) \<le> u m) \<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 (r n) \<le> u m\<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 (r ?n) \<le> u ?m

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

goal (2 subgoals):
 1. ?P \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> liminf u
 2. \<not> ?P \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> liminf u
[PROOF STEP]
have "incseq umin"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. incseq umin
[PROOF STEP]
unfolding umin_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. incseq (\<lambda>n. Inf (u ` {n..}))
[PROOF STEP]
by (simp add: INF_superset_mono incseq_def)
[PROOF STATE]
proof (state)
this:
incseq umin

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

goal (1 subgoal):
 1. umin \<longlonglongrightarrow> liminf u
[PROOF STEP]
unfolding umin_def
[PROOF STATE]
proof (prove)
using this:
incseq (\<lambda>n. Inf (u ` {n..}))

goal (1 subgoal):
 1. (\<lambda>n. Inf (u ` {n..})) \<longlonglongrightarrow> liminf u
[PROOF STEP]
by (metis LIMSEQ_SUP liminf_SUP_INF)
[PROOF STATE]
proof (state)
this:
umin \<longlonglongrightarrow> liminf u

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

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

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

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

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

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

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

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

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

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

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

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

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

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

goal (1 subgoal):
 1. \<not> (\<forall>n. \<exists>p>n. \<forall>m\<ge>p. u p \<le> u m) \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> liminf u
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (\<forall>n. \<exists>p>n. \<forall>m\<ge>p. u p \<le> u m)
[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 p \<le> u m)

goal (1 subgoal):
 1. (\<And>N. (\<And>p. N < p \<Longrightarrow> \<exists>m>p. u m < u p) \<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 m < u ?p

goal (1 subgoal):
 1. \<not> (\<forall>n. \<exists>p>n. \<forall>m\<ge>p. u p \<le> u m) \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> liminf 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 \<ge> 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 (r (Suc n)) \<le> u i)
[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 y \<le> u i)
[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 y \<le> u i)
[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 y \<le> u i)
[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 y \<le> u i)
[PROOF STEP]
have "Min {u i |i. i \<in> {N<..x}} \<in> {u i |i. i \<in> {N<..x}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Min {u i |i. i \<in> {N<..x}} \<in> {u i |i. i \<in> {N<..x}}
[PROOF STEP]
apply (rule Min_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:
Min {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 y \<le> u i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Min {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 upmin: "u p = Min{u i |i. i \<in> {N<..x}}"
[PROOF STATE]
proof (prove)
using this:
Min {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 = Min {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 = Min {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 y \<le> u i)
[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 m < 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 y \<le> u i)
[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 m < u p} \<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 m < u p
p \<in> {N<..x}

goal (1 subgoal):
 1. {m. p < m \<and> u m < u p} \<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 y \<le> u i)
[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 y \<le> u i)
[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 y \<le> u i)
[PROOF STEP]
have a: "\<And>i. i \<in> {N<..x} \<Longrightarrow> u i \<ge> u p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i \<in> {N<..x} \<Longrightarrow> u p \<le> u i
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i \<in> {N<..x} \<Longrightarrow> u p \<le> u i
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i \<in> {N<..x} \<Longrightarrow> u p \<le> u i
[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 p \<le> u i
[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 p \<le> u i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u i \<in> {u i |i. i \<in> {N<..x}}
[PROOF STEP]
show "u i \<ge> u p"
[PROOF STATE]
proof (prove)
using this:
u i \<in> {u i |i. i \<in> {N<..x}}

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

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

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

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 y \<le> u i)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
?i \<in> {N<..x} \<Longrightarrow> u p \<le> u ?i

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 y \<le> u i)
[PROOF STEP]
have "u p > u y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u y < u p
[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 m < u p}

goal (1 subgoal):
 1. u y < u p
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u y < 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 y \<le> u i)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
?i \<in> {N<..x} \<Longrightarrow> u p \<le> u ?i
u y < u p
[PROOF STEP]
have "y \<notin> {N<..x}"
[PROOF STATE]
proof (prove)
using this:
?i \<in> {N<..x} \<Longrightarrow> u p \<le> u ?i
u y < u p

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 p \<le> u ?i
u y < u p
(\<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 y \<le> u i)
[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 y \<le> u i)
[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 m < u p}
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 y \<le> u i)
[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 y \<le> u i)
[PROOF STEP]
have "\<And>i. i \<in> {N<..y} \<Longrightarrow> u i \<ge> u y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i \<in> {N<..y} \<Longrightarrow> u y \<le> u i
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i \<in> {N<..y} \<Longrightarrow> u y \<le> u i
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i \<in> {N<..y} \<Longrightarrow> u y \<le> u i
[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 y \<le> u i
[PROOF STEP]
show "u i \<ge> u y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u y \<le> u i
[PROOF STEP]
proof (cases)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> u y \<le> u i
 2. \<not> ?P \<Longrightarrow> u y \<le> u i
[PROOF STEP]
assume "i = y"
[PROOF STATE]
proof (state)
this:
i = y

goal (2 subgoals):
 1. ?P \<Longrightarrow> u y \<le> u i
 2. \<not> ?P \<Longrightarrow> u y \<le> u i
[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 y \<le> u i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
u y \<le> u i

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

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

goal (2 subgoals):
 1. ?P \<Longrightarrow> u p \<le> u i
 2. \<not> ?P \<Longrightarrow> u p \<le> u i
[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 p \<le> u i
 2. \<not> ?P \<Longrightarrow> u p \<le> u i
[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 p \<le> u i
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
i \<in> {N<..x}
?i \<in> {N<..x} \<Longrightarrow> u p \<le> u ?i

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

goal (1 subgoal):
 1. \<not> i \<le> x \<Longrightarrow> u p \<le> u i
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> i \<le> x \<Longrightarrow> u p \<le> u i
[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 p \<le> u i
[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 p \<le> u i
[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 p \<le> u i
[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 p \<le> u i
[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 p \<le> u i
[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 p \<le> u i
[PROOF STEP]
using U_def *
[PROOF STATE]
proof (prove)
using this:
i \<notin> U
U = {m. p < m \<and> u m < u p}
p < i

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

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

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

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

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

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

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

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 y \<le> u i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?i \<in> {N<..y} \<Longrightarrow> u y \<le> u ?i
[PROOF STEP]
have "N < y \<and> x < y \<and> (\<forall>i\<in>{N<..y}. u i \<ge> u y)"
[PROOF STATE]
proof (prove)
using this:
?i \<in> {N<..y} \<Longrightarrow> u y \<le> u ?i

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

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

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 y \<le> u i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
N < y \<and> x < y \<and> (\<forall>i\<in>{N<..y}. u y \<le> u i)
[PROOF STEP]
show "\<exists>y>N. x < y \<and> (\<forall>i\<in>{N<..y}. u i \<ge> u y)"
[PROOF STATE]
proof (prove)
using this:
N < y \<and> x < y \<and> (\<forall>i\<in>{N<..y}. u y \<le> u i)

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

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 (r (Suc n)) \<le> u i)

goal (1 subgoal):
 1. \<not> (\<forall>n. \<exists>p>n. \<forall>m\<ge>p. u p \<le> u m) \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> liminf 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 (r (Suc n)) \<le> u i)
[PROOF STEP]
obtain r :: "nat \<Rightarrow> nat"
    where r: "\<forall>n. N < r n \<and> r n < r (Suc n) \<and> (\<forall>i\<in> {N<..r (Suc n)}. u i \<ge> 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 (r (Suc n)) \<le> u i)

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 (r (Suc n)) \<le> u i) \<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 (r (Suc n)) \<le> u i)

goal (1 subgoal):
 1. \<not> (\<forall>n. \<exists>p>n. \<forall>m\<ge>p. u p \<le> u m) \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> liminf 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 (r (Suc n)) \<le> u i)

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 p \<le> u m) \<Longrightarrow> \<exists>r. strict_mono r \<and> (u \<circ> r) \<longlonglongrightarrow> liminf u
[PROOF STEP]
have "decseq (u o r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. decseq (u \<circ> r)
[PROOF STEP]
unfolding o_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. decseq (\<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 (r (Suc n)) \<le> u i)

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

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

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

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

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

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

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

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

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

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

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

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

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

goal (1 subgoal):
 1. u (r (Suc n)) \<le> u i
[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 (r (Suc n)) \<le> u i)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem eval_ifz[simp]: assumes e1: "E e1  = E(ENat 0)" shows "E(EIf e1 e2 e3) = E(e3)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. E (EIf e1 e2 e3) = E e3
[PROOF STEP]
using e1
[PROOF STATE]
proof (prove)
using this:
E e1 = E (ENat 0)

goal (1 subgoal):
 1. E (EIf e1 e2 e3) = E e3
[PROOF STEP]
by auto


[STATEMENT]
lemma antilinear_o_antilinear: "antilinear f \<Longrightarrow> antilinear g \<Longrightarrow> clinear (g o f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>antilinear f; antilinear g\<rbrakk> \<Longrightarrow> clinear (g \<circ> f)
[PROOF STEP]
apply (rule clinearI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>b1 b2. \<lbrakk>antilinear f; antilinear g\<rbrakk> \<Longrightarrow> (g \<circ> f) (b1 + b2) = (g \<circ> f) b1 + (g \<circ> f) b2
 2. \<And>r b. \<lbrakk>antilinear f; antilinear g\<rbrakk> \<Longrightarrow> (g \<circ> f) (r *\<^sub>C b) = r *\<^sub>C (g \<circ> f) b
[PROOF STEP]
apply (simp add: additive.add antilinear_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>r b. \<lbrakk>antilinear f; antilinear g\<rbrakk> \<Longrightarrow> (g \<circ> f) (r *\<^sub>C b) = r *\<^sub>C (g \<circ> f) b
[PROOF STEP]
by (simp add: antilinear.scaleC)


[STATEMENT]
lemma card_poly_roots_bound:
  fixes p :: "'a::{comm_ring_1,ring_no_zero_divisors} poly"
  assumes "p \<noteq> 0"
  shows   "card {x. poly p x = 0} \<le> degree p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {x. poly p x = (0::'a)} \<le> degree p
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0

goal (1 subgoal):
 1. card {x. poly p x = (0::'a)} \<le> degree p
[PROOF STEP]
proof (induction "degree p" arbitrary: p rule: less_induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<And>pa. \<lbrakk>degree pa < degree p; pa \<noteq> 0\<rbrakk> \<Longrightarrow> card {x. poly pa x = (0::'a)} \<le> degree pa; p \<noteq> 0\<rbrakk> \<Longrightarrow> card {x. poly p x = (0::'a)} \<le> degree p
[PROOF STEP]
case (less p)
[PROOF STATE]
proof (state)
this:
\<lbrakk>degree ?p < degree p; ?p \<noteq> 0\<rbrakk> \<Longrightarrow> card {x. poly ?p x = (0::'a)} \<le> degree ?p
p \<noteq> 0

goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<And>pa. \<lbrakk>degree pa < degree p; pa \<noteq> 0\<rbrakk> \<Longrightarrow> card {x. poly pa x = (0::'a)} \<le> degree pa; p \<noteq> 0\<rbrakk> \<Longrightarrow> card {x. poly p x = (0::'a)} \<le> degree p
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {x. poly p x = (0::'a)} \<le> degree p
[PROOF STEP]
proof (cases "\<exists>x. poly p x = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>x. poly p x = (0::'a) \<Longrightarrow> card {x. poly p x = (0::'a)} \<le> degree p
 2. \<nexists>x. poly p x = (0::'a) \<Longrightarrow> card {x. poly p x = (0::'a)} \<le> degree p
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<nexists>x. poly p x = (0::'a)

goal (2 subgoals):
 1. \<exists>x. poly p x = (0::'a) \<Longrightarrow> card {x. poly p x = (0::'a)} \<le> degree p
 2. \<nexists>x. poly p x = (0::'a) \<Longrightarrow> card {x. poly p x = (0::'a)} \<le> degree p
[PROOF STEP]
hence "{x. poly p x = 0} = {}"
[PROOF STATE]
proof (prove)
using this:
\<nexists>x. poly p x = (0::'a)

goal (1 subgoal):
 1. {x. poly p x = (0::'a)} = {}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
{x. poly p x = (0::'a)} = {}

goal (2 subgoals):
 1. \<exists>x. poly p x = (0::'a) \<Longrightarrow> card {x. poly p x = (0::'a)} \<le> degree p
 2. \<nexists>x. poly p x = (0::'a) \<Longrightarrow> card {x. poly p x = (0::'a)} \<le> degree p
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
{x. poly p x = (0::'a)} = {}

goal (1 subgoal):
 1. card {x. poly p x = (0::'a)} \<le> degree p
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card {x. poly p x = (0::'a)} \<le> degree p

goal (1 subgoal):
 1. \<exists>x. poly p x = (0::'a) \<Longrightarrow> card {x. poly p x = (0::'a)} \<le> degree p
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>x. poly p x = (0::'a) \<Longrightarrow> card {x. poly p x = (0::'a)} \<le> degree p
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
\<exists>x. poly p x = (0::'a)

goal (1 subgoal):
 1. \<exists>x. poly p x = (0::'a) \<Longrightarrow> card {x. poly p x = (0::'a)} \<le> degree p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>x. poly p x = (0::'a)
[PROOF STEP]
obtain x where x: "poly p x = 0"
[PROOF STATE]
proof (prove)
using this:
\<exists>x. poly p x = (0::'a)

goal (1 subgoal):
 1. (\<And>x. poly p x = (0::'a) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
poly p x = (0::'a)

goal (1 subgoal):
 1. \<exists>x. poly p x = (0::'a) \<Longrightarrow> card {x. poly p x = (0::'a)} \<le> degree p
[PROOF STEP]
hence "[:-x, 1:] dvd p"
[PROOF STATE]
proof (prove)
using this:
poly p x = (0::'a)

goal (1 subgoal):
 1. [:- x, 1::'a:] dvd p
[PROOF STEP]
by (subst (asm) poly_eq_0_iff_dvd)
[PROOF STATE]
proof (state)
this:
[:- x, 1::'a:] dvd p

goal (1 subgoal):
 1. \<exists>x. poly p x = (0::'a) \<Longrightarrow> card {x. poly p x = (0::'a)} \<le> degree p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[:- x, 1::'a:] dvd p
[PROOF STEP]
obtain q where q: "p = [:-x, 1:] * q"
[PROOF STATE]
proof (prove)
using this:
[:- x, 1::'a:] dvd p

goal (1 subgoal):
 1. (\<And>q. p = [:- x, 1::'a:] * q \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: dvd_def)
[PROOF STATE]
proof (state)
this:
p = [:- x, 1::'a:] * q

goal (1 subgoal):
 1. \<exists>x. poly p x = (0::'a) \<Longrightarrow> card {x. poly p x = (0::'a)} \<le> degree p
[PROOF STEP]
with \<open>p \<noteq> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
p \<noteq> 0
p = [:- x, 1::'a:] * q
[PROOF STEP]
have [simp]: "q \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0
p = [:- x, 1::'a:] * q

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

goal (1 subgoal):
 1. \<exists>x. poly p x = (0::'a) \<Longrightarrow> card {x. poly p x = (0::'a)} \<le> degree p
[PROOF STEP]
have deg: "degree p = Suc (degree q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree p = Suc (degree q)
[PROOF STEP]
by (subst q, subst degree_mult_eq) auto
[PROOF STATE]
proof (state)
this:
degree p = Suc (degree q)

goal (1 subgoal):
 1. \<exists>x. poly p x = (0::'a) \<Longrightarrow> card {x. poly p x = (0::'a)} \<le> degree p
[PROOF STEP]
have "card {x. poly p x = 0} \<le> card (insert x {x. poly q x = 0})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {x. poly p x = (0::'a)} \<le> card (insert x {x. poly q x = (0::'a)})
[PROOF STEP]
by (intro card_mono) (auto intro: poly_roots_finite simp: q)
[PROOF STATE]
proof (state)
this:
card {x. poly p x = (0::'a)} \<le> card (insert x {x. poly q x = (0::'a)})

goal (1 subgoal):
 1. \<exists>x. poly p x = (0::'a) \<Longrightarrow> card {x. poly p x = (0::'a)} \<le> degree p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card {x. poly p x = (0::'a)} \<le> card (insert x {x. poly q x = (0::'a)})

goal (1 subgoal):
 1. \<exists>x. poly p x = (0::'a) \<Longrightarrow> card {x. poly p x = (0::'a)} \<le> degree p
[PROOF STEP]
have "\<dots> \<le> Suc (card {x. poly q x = 0})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (insert x {x. poly q x = (0::'a)}) \<le> Suc (card {x. poly q x = (0::'a)})
[PROOF STEP]
by (rule card_insert_le_m1) auto
[PROOF STATE]
proof (state)
this:
card (insert x {x. poly q x = (0::'a)}) \<le> Suc (card {x. poly q x = (0::'a)})

goal (1 subgoal):
 1. \<exists>x. poly p x = (0::'a) \<Longrightarrow> card {x. poly p x = (0::'a)} \<le> degree p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card (insert x {x. poly q x = (0::'a)}) \<le> Suc (card {x. poly q x = (0::'a)})

goal (1 subgoal):
 1. \<exists>x. poly p x = (0::'a) \<Longrightarrow> card {x. poly p x = (0::'a)} \<le> degree p
[PROOF STEP]
from deg
[PROOF STATE]
proof (chain)
picking this:
degree p = Suc (degree q)
[PROOF STEP]
have  "card {x. poly q x = 0} \<le> degree q"
[PROOF STATE]
proof (prove)
using this:
degree p = Suc (degree q)

goal (1 subgoal):
 1. card {x. poly q x = (0::'a)} \<le> degree q
[PROOF STEP]
using \<open>p \<noteq> 0\<close> and q
[PROOF STATE]
proof (prove)
using this:
degree p = Suc (degree q)
p \<noteq> 0
p = [:- x, 1::'a:] * q

goal (1 subgoal):
 1. card {x. poly q x = (0::'a)} \<le> degree q
[PROOF STEP]
by (intro less) auto
[PROOF STATE]
proof (state)
this:
card {x. poly q x = (0::'a)} \<le> degree q

goal (1 subgoal):
 1. \<exists>x. poly p x = (0::'a) \<Longrightarrow> card {x. poly p x = (0::'a)} \<le> degree p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card {x. poly q x = (0::'a)} \<le> degree q

goal (1 subgoal):
 1. \<exists>x. poly p x = (0::'a) \<Longrightarrow> card {x. poly p x = (0::'a)} \<le> degree p
[PROOF STEP]
have "Suc \<dots> = degree p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc (degree q) = degree p
[PROOF STEP]
by (simp add: deg)
[PROOF STATE]
proof (state)
this:
Suc (degree q) = degree p

goal (1 subgoal):
 1. \<exists>x. poly p x = (0::'a) \<Longrightarrow> card {x. poly p x = (0::'a)} \<le> degree p
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<And>x y. x \<le> y \<Longrightarrow> Suc x \<le> Suc y) \<Longrightarrow> card {x. poly p x = (0::'a)} \<le> degree p
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<And>x y. x \<le> y \<Longrightarrow> Suc x \<le> Suc y) \<Longrightarrow> card {x. poly p x = (0::'a)} \<le> degree p

goal (1 subgoal):
 1. card {x. poly p x = (0::'a)} \<le> degree p
[PROOF STEP]
by - simp_all
[PROOF STATE]
proof (state)
this:
card {x. poly p x = (0::'a)} \<le> degree p

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
card {x. poly p x = (0::'a)} \<le> degree p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma monom_rep_X_pow:
  assumes "a \<in> carrier R"
  shows "monom P a n = a\<odot>\<^bsub>P\<^esub>(X[^]\<^bsub>P\<^esub>n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monom P a n = a \<odot>\<^bsub>P\<^esub> X_poly R [^]\<^bsub>P\<^esub> n
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. monom P a n = a \<odot>\<^bsub>P\<^esub> X_poly R [^]\<^bsub>P\<^esub> n
[PROOF STEP]
have "monom P a n = a\<odot>\<^bsub>P\<^esub>monom P \<one> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monom P a n = a \<odot>\<^bsub>P\<^esub> monom P \<one> n
[PROOF STEP]
by (metis R.one_closed R.r_one assms monom_mult_smult)
[PROOF STATE]
proof (state)
this:
monom P a n = a \<odot>\<^bsub>P\<^esub> monom P \<one> n

goal (1 subgoal):
 1. monom P a n = a \<odot>\<^bsub>P\<^esub> X_poly R [^]\<^bsub>P\<^esub> n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
monom P a n = a \<odot>\<^bsub>P\<^esub> monom P \<one> n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
monom P a n = a \<odot>\<^bsub>P\<^esub> monom P \<one> n

goal (1 subgoal):
 1. monom P a n = a \<odot>\<^bsub>P\<^esub> X_poly R [^]\<^bsub>P\<^esub> n
[PROOF STEP]
unfolding X_poly_def
[PROOF STATE]
proof (prove)
using this:
monom P a n = a \<odot>\<^bsub>P\<^esub> monom P \<one> n

goal (1 subgoal):
 1. monom P a n = a \<odot>\<^bsub>P\<^esub> monom (UP R) \<one> 1 [^]\<^bsub>P\<^esub> n
[PROOF STEP]
using monom_pow
[PROOF STATE]
proof (prove)
using this:
monom P a n = a \<odot>\<^bsub>P\<^esub> monom P \<one> n
?a \<in> carrier R \<Longrightarrow> monom P ?a ?n [^]\<^bsub>P\<^esub> ?m = monom P (?a [^] ?m) (?n * ?m)

goal (1 subgoal):
 1. monom P a n = a \<odot>\<^bsub>P\<^esub> monom (UP R) \<one> 1 [^]\<^bsub>P\<^esub> n
[PROOF STEP]
by (simp add: P_def)
[PROOF STATE]
proof (state)
this:
monom P a n = a \<odot>\<^bsub>P\<^esub> X_poly R [^]\<^bsub>P\<^esub> n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma star_inductr: "z + y \<cdot> x \<le> y \<Longrightarrow> z \<cdot> x\<^sup>\<star> \<le> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z + y \<cdot> x \<le> y \<Longrightarrow> z \<cdot> x\<^sup>\<star> \<le> y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. z + y \<cdot> x \<le> y \<Longrightarrow> z \<cdot> x\<^sup>\<star> \<le> y
[PROOF STEP]
assume hyp: "z + y \<cdot> x \<le> y"
[PROOF STATE]
proof (state)
this:
z + y \<cdot> x \<le> y

goal (1 subgoal):
 1. z + y \<cdot> x \<le> y \<Longrightarrow> z \<cdot> x\<^sup>\<star> \<le> y
[PROOF STEP]
hence "x \<le> y \<rightarrow> y"
[PROOF STATE]
proof (prove)
using this:
z + y \<cdot> x \<le> y

goal (1 subgoal):
 1. x \<le> y \<rightarrow> y
[PROOF STEP]
by (simp add: resr_galois)
[PROOF STATE]
proof (state)
this:
x \<le> y \<rightarrow> y

goal (1 subgoal):
 1. z + y \<cdot> x \<le> y \<Longrightarrow> z \<cdot> x\<^sup>\<star> \<le> y
[PROOF STEP]
hence "x\<^sup>\<star> \<le> (y \<rightarrow> y)\<^sup>\<star>"
[PROOF STATE]
proof (prove)
using this:
x \<le> y \<rightarrow> y

goal (1 subgoal):
 1. x\<^sup>\<star> \<le> (y \<rightarrow> y)\<^sup>\<star>
[PROOF STEP]
by (fact star_mon)
[PROOF STATE]
proof (state)
this:
x\<^sup>\<star> \<le> (y \<rightarrow> y)\<^sup>\<star>

goal (1 subgoal):
 1. z + y \<cdot> x \<le> y \<Longrightarrow> z \<cdot> x\<^sup>\<star> \<le> y
[PROOF STEP]
hence "x\<^sup>\<star> \<le> y \<rightarrow> y"
[PROOF STATE]
proof (prove)
using this:
x\<^sup>\<star> \<le> (y \<rightarrow> y)\<^sup>\<star>

goal (1 subgoal):
 1. x\<^sup>\<star> \<le> y \<rightarrow> y
[PROOF STEP]
by (metis order_trans residual_r_pure_induction)
[PROOF STATE]
proof (state)
this:
x\<^sup>\<star> \<le> y \<rightarrow> y

goal (1 subgoal):
 1. z + y \<cdot> x \<le> y \<Longrightarrow> z \<cdot> x\<^sup>\<star> \<le> y
[PROOF STEP]
hence "y \<cdot> x\<^sup>\<star> \<le> y"
[PROOF STATE]
proof (prove)
using this:
x\<^sup>\<star> \<le> y \<rightarrow> y

goal (1 subgoal):
 1. y \<cdot> x\<^sup>\<star> \<le> y
[PROOF STEP]
by (simp add: local.resr_galois)
[PROOF STATE]
proof (state)
this:
y \<cdot> x\<^sup>\<star> \<le> y

goal (1 subgoal):
 1. z + y \<cdot> x \<le> y \<Longrightarrow> z \<cdot> x\<^sup>\<star> \<le> y
[PROOF STEP]
thus "z \<cdot> x\<^sup>\<star> \<le> y"
[PROOF STATE]
proof (prove)
using this:
y \<cdot> x\<^sup>\<star> \<le> y

goal (1 subgoal):
 1. z \<cdot> x\<^sup>\<star> \<le> y
[PROOF STEP]
by (meson hyp local.join.le_supE local.order_trans local.resl_galois)
[PROOF STATE]
proof (state)
this:
z \<cdot> x\<^sup>\<star> \<le> y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma null_if_pos_func_has_zero_int:
  assumes [measurable]: "integrable M f" "A \<in> sets M"
      and "AE x\<in>A in M. f x > 0" "(\<integral>x\<in>A. f x \<partial>M) = (0::real)"
  shows "A \<in> null_sets M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<in> null_sets M
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A \<in> null_sets M
[PROOF STEP]
have "AE x in M. indicator A x * f x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in M. indicat_real A x * f x = 0
[PROOF STEP]
apply (subst integral_nonneg_eq_0_iff_AE[symmetric])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. integrable M (\<lambda>x. indicat_real A x * f x)
 2. AE x in M. 0 \<le> indicat_real A x * f x
 3. LINT x|M. indicat_real A x * f x = 0
[PROOF STEP]
using assms integrable_mult_indicator[OF \<open>A \<in> sets M\<close> assms(1)]
[PROOF STATE]
proof (prove)
using this:
integrable M f
A \<in> sets M
AE x\<in>A in M. 0 < f x
set_lebesgue_integral M A f = 0
integrable M (\<lambda>x. indicat_real A x *\<^sub>R f x)

goal (3 subgoals):
 1. integrable M (\<lambda>x. indicat_real A x * f x)
 2. AE x in M. 0 \<le> indicat_real A x * f x
 3. LINT x|M. indicat_real A x * f x = 0
[PROOF STEP]
by (auto simp: set_lebesgue_integral_def)
[PROOF STATE]
proof (state)
this:
AE x in M. indicat_real A x * f x = 0

goal (1 subgoal):
 1. A \<in> null_sets M
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
AE x in M. indicat_real A x * f x = 0
[PROOF STEP]
have "AE x\<in>A in M. f x = 0"
[PROOF STATE]
proof (prove)
using this:
AE x in M. indicat_real A x * f x = 0

goal (1 subgoal):
 1. AE x\<in>A in M. f x = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
AE x\<in>A in M. f x = 0

goal (1 subgoal):
 1. A \<in> null_sets M
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
AE x\<in>A in M. f x = 0
[PROOF STEP]
have "AE x\<in>A in M. False"
[PROOF STATE]
proof (prove)
using this:
AE x\<in>A in M. f x = 0

goal (1 subgoal):
 1. AE x\<in>A in M. False
[PROOF STEP]
using assms(3)
[PROOF STATE]
proof (prove)
using this:
AE x\<in>A in M. f x = 0
AE x\<in>A in M. 0 < f x

goal (1 subgoal):
 1. AE x\<in>A in M. False
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
AE x\<in>A in M. False

goal (1 subgoal):
 1. A \<in> null_sets M
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
AE x\<in>A in M. False
[PROOF STEP]
show "A \<in> null_sets M"
[PROOF STATE]
proof (prove)
using this:
AE x\<in>A in M. False

goal (1 subgoal):
 1. A \<in> null_sets M
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
AE x\<in>A in M. False
A \<in> sets M

goal (1 subgoal):
 1. A \<in> null_sets M
[PROOF STEP]
by (simp add: AE_iff_null_sets)
[PROOF STATE]
proof (state)
this:
A \<in> null_sets M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma WHILE_Its: "(WHILE b DO c,s) \<Rightarrow> t \<Longrightarrow> \<exists>n. Its b c s n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (WHILE b DO c, s) \<Rightarrow> t \<Longrightarrow> \<exists>n. Its b c s n
[PROOF STEP]
proof(induction "WHILE b DO c" s t rule: big_step_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>s. \<not> bval b s \<Longrightarrow> Ex (Its b c s)
 2. \<And>s\<^sub>1 s\<^sub>2 s\<^sub>3. \<lbrakk>bval b s\<^sub>1; (c, s\<^sub>1) \<Rightarrow> s\<^sub>2; c = WHILE b DO c \<Longrightarrow> Ex (Its b c s\<^sub>1); (WHILE b DO c, s\<^sub>2) \<Rightarrow> s\<^sub>3; Ex (Its b c s\<^sub>2)\<rbrakk> \<Longrightarrow> Ex (Its b c s\<^sub>1)
[PROOF STEP]
case WhileFalse
[PROOF STATE]
proof (state)
this:
\<not> bval b s_

goal (2 subgoals):
 1. \<And>s. \<not> bval b s \<Longrightarrow> Ex (Its b c s)
 2. \<And>s\<^sub>1 s\<^sub>2 s\<^sub>3. \<lbrakk>bval b s\<^sub>1; (c, s\<^sub>1) \<Rightarrow> s\<^sub>2; c = WHILE b DO c \<Longrightarrow> Ex (Its b c s\<^sub>1); (WHILE b DO c, s\<^sub>2) \<Rightarrow> s\<^sub>3; Ex (Its b c s\<^sub>2)\<rbrakk> \<Longrightarrow> Ex (Its b c s\<^sub>1)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
\<not> bval b s_

goal (1 subgoal):
 1. Ex (Its b c s_)
[PROOF STEP]
by (metis Its_0)
[PROOF STATE]
proof (state)
this:
Ex (Its b c s_)

goal (1 subgoal):
 1. \<And>s\<^sub>1 s\<^sub>2 s\<^sub>3. \<lbrakk>bval b s\<^sub>1; (c, s\<^sub>1) \<Rightarrow> s\<^sub>2; c = WHILE b DO c \<Longrightarrow> Ex (Its b c s\<^sub>1); (WHILE b DO c, s\<^sub>2) \<Rightarrow> s\<^sub>3; Ex (Its b c s\<^sub>2)\<rbrakk> \<Longrightarrow> Ex (Its b c s\<^sub>1)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>s\<^sub>1 s\<^sub>2 s\<^sub>3. \<lbrakk>bval b s\<^sub>1; (c, s\<^sub>1) \<Rightarrow> s\<^sub>2; c = WHILE b DO c \<Longrightarrow> Ex (Its b c s\<^sub>1); (WHILE b DO c, s\<^sub>2) \<Rightarrow> s\<^sub>3; Ex (Its b c s\<^sub>2)\<rbrakk> \<Longrightarrow> Ex (Its b c s\<^sub>1)
[PROOF STEP]
case WhileTrue
[PROOF STATE]
proof (state)
this:
bval b s\<^sub>1_
(c, s\<^sub>1_) \<Rightarrow> s\<^sub>2_
c = WHILE b DO c \<Longrightarrow> Ex (Its b c s\<^sub>1_)
(WHILE b DO c, s\<^sub>2_) \<Rightarrow> s\<^sub>3_
Ex (Its b c s\<^sub>2_)

goal (1 subgoal):
 1. \<And>s\<^sub>1 s\<^sub>2 s\<^sub>3. \<lbrakk>bval b s\<^sub>1; (c, s\<^sub>1) \<Rightarrow> s\<^sub>2; c = WHILE b DO c \<Longrightarrow> Ex (Its b c s\<^sub>1); (WHILE b DO c, s\<^sub>2) \<Rightarrow> s\<^sub>3; Ex (Its b c s\<^sub>2)\<rbrakk> \<Longrightarrow> Ex (Its b c s\<^sub>1)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
bval b s\<^sub>1_
(c, s\<^sub>1_) \<Rightarrow> s\<^sub>2_
c = WHILE b DO c \<Longrightarrow> Ex (Its b c s\<^sub>1_)
(WHILE b DO c, s\<^sub>2_) \<Rightarrow> s\<^sub>3_
Ex (Its b c s\<^sub>2_)

goal (1 subgoal):
 1. Ex (Its b c s\<^sub>1_)
[PROOF STEP]
by (metis Its_Suc)
[PROOF STATE]
proof (state)
this:
Ex (Its b c s\<^sub>1_)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mat_append_row_in_mat:
  assumes "i < dim_row A"
  shows "row (mat_append_row A r) i = row A i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row (mat_append_row A r) i = row A i
[PROOF STEP]
by (auto) (metis assms le_imp_less_Suc length_append_singleton
      length_rows mat_of_rows_row nat_less_le nth_append nth_rows row_carrier)


[STATEMENT]
lemma ValD_copy_lub_ID:
  "ValD_copy_lub = ID"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ValD_copy_lub = ID
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ValD_copy_lub = ID
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ValD_copy_lub = ID
[PROOF STEP]
fix x :: ValD
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ValD_copy_lub = ID
[PROOF STEP]
fix i :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ValD_copy_lub = ID
[PROOF STEP]
have "ValD_take i\<cdot>(ValD_copy_i i\<cdot>(ValD_take i\<cdot>x)) = ValD_take i\<cdot>x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ValD_take i\<cdot>(ValD_copy_i i\<cdot>(ValD_take i\<cdot>x)) = ValD_take i\<cdot>x
[PROOF STEP]
proof (induct i arbitrary: x)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. ValD_take 0\<cdot>(ValD_copy_i 0\<cdot>(ValD_take 0\<cdot>x)) = ValD_take 0\<cdot>x
 2. \<And>i x. (\<And>x. ValD_take i\<cdot>(ValD_copy_i i\<cdot>(ValD_take i\<cdot>x)) = ValD_take i\<cdot>x) \<Longrightarrow> ValD_take (Suc i)\<cdot>(ValD_copy_i (Suc i)\<cdot>(ValD_take (Suc i)\<cdot>x)) = ValD_take (Suc i)\<cdot>x
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
ValD_take n\<cdot>(ValD_copy_i n\<cdot>(ValD_take n\<cdot>?x)) = ValD_take n\<cdot>?x

goal (2 subgoals):
 1. \<And>x. ValD_take 0\<cdot>(ValD_copy_i 0\<cdot>(ValD_take 0\<cdot>x)) = ValD_take 0\<cdot>x
 2. \<And>i x. (\<And>x. ValD_take i\<cdot>(ValD_copy_i i\<cdot>(ValD_take i\<cdot>x)) = ValD_take i\<cdot>x) \<Longrightarrow> ValD_take (Suc i)\<cdot>(ValD_copy_i (Suc i)\<cdot>(ValD_take (Suc i)\<cdot>x)) = ValD_take (Suc i)\<cdot>x
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
ValD_take n\<cdot>(ValD_copy_i n\<cdot>(ValD_take n\<cdot>?x)) = ValD_take n\<cdot>?x

goal (1 subgoal):
 1. ValD_take (Suc n)\<cdot>(ValD_copy_i (Suc n)\<cdot>(ValD_take (Suc n)\<cdot>x)) = ValD_take (Suc n)\<cdot>x
[PROOF STEP]
by (cases x) (simp_all add: cfun_map_def)
[PROOF STATE]
proof (state)
this:
ValD_take (Suc n)\<cdot>(ValD_copy_i (Suc n)\<cdot>(ValD_take (Suc n)\<cdot>x)) = ValD_take (Suc n)\<cdot>x

goal (1 subgoal):
 1. \<And>x. ValD_take 0\<cdot>(ValD_copy_i 0\<cdot>(ValD_take 0\<cdot>x)) = ValD_take 0\<cdot>x
[PROOF STEP]
qed simp
[PROOF STATE]
proof (state)
this:
ValD_take i\<cdot>(ValD_copy_i i\<cdot>(ValD_take i\<cdot>x)) = ValD_take i\<cdot>x

goal (1 subgoal):
 1. ValD_copy_lub = ID
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
ValD_take ?i2\<cdot>(ValD_copy_i ?i2\<cdot>(ValD_take ?i2\<cdot>?x2)) = ValD_take ?i2\<cdot>?x2

goal (1 subgoal):
 1. ValD_copy_lub = ID
[PROOF STEP]
hence "\<And>x :: ValD. (\<Squnion>i. ValD_take i\<cdot>(ValD_copy_i i\<cdot>(ValD_take i\<cdot>x))) = (\<Squnion>i. ValD_take i\<cdot>x)"
[PROOF STATE]
proof (prove)
using this:
ValD_take ?i2\<cdot>(ValD_copy_i ?i2\<cdot>(ValD_take ?i2\<cdot>?x2)) = ValD_take ?i2\<cdot>?x2

goal (1 subgoal):
 1. \<And>x. (\<Squnion>i. ValD_take i\<cdot>(ValD_copy_i i\<cdot>(ValD_take i\<cdot>x))) = (\<Squnion>i. ValD_take i\<cdot>x)
[PROOF STEP]
by (blast intro: lub_eq)
[PROOF STATE]
proof (state)
this:
(\<Squnion>i. ValD_take i\<cdot>(ValD_copy_i i\<cdot>(ValD_take i\<cdot>?x))) = (\<Squnion>i. ValD_take i\<cdot>?x)

goal (1 subgoal):
 1. ValD_copy_lub = ID
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Squnion>i. ValD_take i\<cdot>(ValD_copy_i i\<cdot>(ValD_take i\<cdot>?x))) = (\<Squnion>i. ValD_take i\<cdot>?x)

goal (1 subgoal):
 1. ValD_copy_lub = ID
[PROOF STEP]
by (simp add: lub_distribs ValD.lub_take cfun_eq_iff)
[PROOF STATE]
proof (state)
this:
ValD_copy_lub = ID

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ssubseqs_refl: "xs \<in> ssubseqs xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs \<in> ssubseqs xs
[PROOF STEP]
proof (induct xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. [] \<in> ssubseqs []
 2. \<And>a xs. xs \<in> ssubseqs xs \<Longrightarrow> a # xs \<in> ssubseqs (a # xs)
[PROOF STEP]
case (Cons x xs)
[PROOF STATE]
proof (state)
this:
xs \<in> ssubseqs xs

goal (2 subgoals):
 1. [] \<in> ssubseqs []
 2. \<And>a xs. xs \<in> ssubseqs xs \<Longrightarrow> a # xs \<in> ssubseqs (a # xs)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
xs \<in> ssubseqs xs

goal (1 subgoal):
 1. x # xs \<in> ssubseqs (x # xs)
[PROOF STEP]
using ssubseqs_Cons
[PROOF STATE]
proof (prove)
using this:
xs \<in> ssubseqs xs
ssubseqs (?x # ?xs) = (#) ?x ` ssubseqs ?xs \<union> ssubseqs ?xs

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

goal (1 subgoal):
 1. [] \<in> ssubseqs []
[PROOF STEP]
qed (rule nil_ssubseqs)


[STATEMENT]
lemma mult1_mono:
  assumes "\<And>x y. \<lbrakk>x \<in> A; y \<in> A; (x, y) \<in> R\<rbrakk> \<Longrightarrow> (x, y) \<in> S"
    and "M \<in> multisets A"
    and "N \<in> multisets A"
    and "(M, N) \<in> mult1 R"
  shows "(M, N) \<in> mult1 S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (M, N) \<in> mult1 S
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> A; ?y \<in> A; (?x, ?y) \<in> R\<rbrakk> \<Longrightarrow> (?x, ?y) \<in> S
M \<in> multisets A
N \<in> multisets A
(M, N) \<in> mult1 R

goal (1 subgoal):
 1. (M, N) \<in> mult1 S
[PROOF STEP]
unfolding mult1_def multisets_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> A; ?y \<in> A; (?x, ?y) \<in> R\<rbrakk> \<Longrightarrow> (?x, ?y) \<in> S
M \<in> {M. set_mset M \<subseteq> A}
N \<in> {M. set_mset M \<subseteq> A}
(M, N) \<in> {(N, M). \<exists>a M0 K. M = add_mset a M0 \<and> N = M0 + K \<and> (\<forall>b. b \<in># K \<longrightarrow> (b, a) \<in> R)}

goal (1 subgoal):
 1. (M, N) \<in> {(N, M). \<exists>a M0 K. M = add_mset a M0 \<and> N = M0 + K \<and> (\<forall>b. b \<in># K \<longrightarrow> (b, a) \<in> S)}
[PROOF STEP]
by auto (metis (full_types) subsetD)


[STATEMENT]
lemma closure_openin_Int_closure:
  assumes ope: "openin (top_of_set U) S" and "T \<subseteq> U"
  shows "closure(S \<inter> closure T) = closure(S \<inter> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure (S \<inter> closure T) = closure (S \<inter> T)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. closure (S \<inter> closure T) \<subseteq> closure (S \<inter> T)
 2. closure (S \<inter> T) \<subseteq> closure (S \<inter> closure T)
[PROOF STEP]
obtain V where "open V" and S: "S = U \<inter> V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>V. \<lbrakk>open V; S = U \<inter> V\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using ope
[PROOF STATE]
proof (prove)
using this:
openin (top_of_set U) S

goal (1 subgoal):
 1. (\<And>V. \<lbrakk>open V; S = U \<inter> V\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using openin_open
[PROOF STATE]
proof (prove)
using this:
openin (top_of_set U) S
openin (top_of_set ?U) ?S = (\<exists>T. open T \<and> ?S = ?U \<inter> T)

goal (1 subgoal):
 1. (\<And>V. \<lbrakk>open V; S = U \<inter> V\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
open V
S = U \<inter> V

goal (2 subgoals):
 1. closure (S \<inter> closure T) \<subseteq> closure (S \<inter> T)
 2. closure (S \<inter> T) \<subseteq> closure (S \<inter> closure T)
[PROOF STEP]
show "closure (S \<inter> closure T) \<subseteq> closure (S \<inter> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure (S \<inter> closure T) \<subseteq> closure (S \<inter> T)
[PROOF STEP]
proof (clarsimp simp: S)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> closure (U \<inter> V \<inter> closure T) \<Longrightarrow> x \<in> closure (U \<inter> V \<inter> T)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> closure (U \<inter> V \<inter> closure T) \<Longrightarrow> x \<in> closure (U \<inter> V \<inter> T)
[PROOF STEP]
assume  "x \<in> closure (U \<inter> V \<inter> closure T)"
[PROOF STATE]
proof (state)
this:
x \<in> closure (U \<inter> V \<inter> closure T)

goal (1 subgoal):
 1. \<And>x. x \<in> closure (U \<inter> V \<inter> closure T) \<Longrightarrow> x \<in> closure (U \<inter> V \<inter> T)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> closure (U \<inter> V \<inter> closure T)
[PROOF STEP]
have "V \<inter> closure T \<subseteq> A \<Longrightarrow> x \<in> closure A" for A
[PROOF STATE]
proof (prove)
using this:
x \<in> closure (U \<inter> V \<inter> closure T)

goal (1 subgoal):
 1. V \<inter> closure T \<subseteq> A \<Longrightarrow> x \<in> closure A
[PROOF STEP]
by (metis closure_mono subsetD inf.coboundedI2 inf_assoc)
[PROOF STATE]
proof (state)
this:
V \<inter> closure T \<subseteq> ?A \<Longrightarrow> x \<in> closure ?A

goal (1 subgoal):
 1. \<And>x. x \<in> closure (U \<inter> V \<inter> closure T) \<Longrightarrow> x \<in> closure (U \<inter> V \<inter> T)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
V \<inter> closure T \<subseteq> ?A \<Longrightarrow> x \<in> closure ?A
[PROOF STEP]
have "x \<in> closure (T \<inter> V)"
[PROOF STATE]
proof (prove)
using this:
V \<inter> closure T \<subseteq> ?A \<Longrightarrow> x \<in> closure ?A

goal (1 subgoal):
 1. x \<in> closure (T \<inter> V)
[PROOF STEP]
by (metis \<open>open V\<close> closure_closure inf_commute open_Int_closure_subset)
[PROOF STATE]
proof (state)
this:
x \<in> closure (T \<inter> V)

goal (1 subgoal):
 1. \<And>x. x \<in> closure (U \<inter> V \<inter> closure T) \<Longrightarrow> x \<in> closure (U \<inter> V \<inter> T)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> closure (T \<inter> V)
[PROOF STEP]
show "x \<in> closure (U \<inter> V \<inter> T)"
[PROOF STATE]
proof (prove)
using this:
x \<in> closure (T \<inter> V)

goal (1 subgoal):
 1. x \<in> closure (U \<inter> V \<inter> T)
[PROOF STEP]
by (metis \<open>T \<subseteq> U\<close> inf.absorb_iff2 inf_assoc inf_commute)
[PROOF STATE]
proof (state)
this:
x \<in> closure (U \<inter> V \<inter> T)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
closure (S \<inter> closure T) \<subseteq> closure (S \<inter> T)

goal (1 subgoal):
 1. closure (S \<inter> T) \<subseteq> closure (S \<inter> closure T)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. closure (S \<inter> T) \<subseteq> closure (S \<inter> closure T)
[PROOF STEP]
show "closure (S \<inter> T) \<subseteq> closure (S \<inter> closure T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure (S \<inter> T) \<subseteq> closure (S \<inter> closure T)
[PROOF STEP]
by (meson Int_mono closure_mono closure_subset order_refl)
[PROOF STATE]
proof (state)
this:
closure (S \<inter> T) \<subseteq> closure (S \<inter> closure T)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma word_leq_le_minus_one:
  "\<lbrakk> x \<le> y; x \<noteq> 0 \<rbrakk> \<Longrightarrow> x - 1 < (y :: 'a :: len word)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<le> y; x \<noteq> 0\<rbrakk> \<Longrightarrow> x - 1 < y
[PROOF STEP]
apply (simp add: word_less_nat_alt word_le_nat_alt)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>unat x \<le> unat y; x \<noteq> 0\<rbrakk> \<Longrightarrow> unat (x - 1) < unat y
[PROOF STEP]
apply (subst unat_minus_one)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>unat x \<le> unat y; x \<noteq> 0\<rbrakk> \<Longrightarrow> x \<noteq> 0
 2. \<lbrakk>unat x \<le> unat y; x \<noteq> 0\<rbrakk> \<Longrightarrow> unat x - 1 < unat y
[PROOF STEP]
apply assumption
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>unat x \<le> unat y; x \<noteq> 0\<rbrakk> \<Longrightarrow> unat x - 1 < unat y
[PROOF STEP]
apply (cases "unat x")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>unat x \<le> unat y; x \<noteq> 0; unat x = 0\<rbrakk> \<Longrightarrow> unat x - 1 < unat y
 2. \<And>nat. \<lbrakk>unat x \<le> unat y; x \<noteq> 0; unat x = Suc nat\<rbrakk> \<Longrightarrow> unat x - 1 < unat y
[PROOF STEP]
apply (simp add: unat_eq_zero)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>nat. \<lbrakk>unat x \<le> unat y; x \<noteq> 0; unat x = Suc nat\<rbrakk> \<Longrightarrow> unat x - 1 < unat y
[PROOF STEP]
apply arith
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma card_set [code]:
  "card (set xs) = length (remdups xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (set xs) = length (remdups xs)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card (set xs) = length (remdups xs)
[PROOF STEP]
have "card (set (remdups xs)) = length (remdups xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (set (remdups xs)) = length (remdups xs)
[PROOF STEP]
by (rule distinct_card) simp
[PROOF STATE]
proof (state)
this:
card (set (remdups xs)) = length (remdups xs)

goal (1 subgoal):
 1. card (set xs) = length (remdups xs)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card (set (remdups xs)) = length (remdups xs)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card (set (remdups xs)) = length (remdups xs)

goal (1 subgoal):
 1. card (set xs) = length (remdups xs)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card (set xs) = length (remdups xs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma frechet_derivative_ident [simp]: "frechet_derivative (\<lambda>x. x) (at a) = (\<lambda>x. x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frechet_derivative (\<lambda>x. x) (at a) = (\<lambda>x. x)
[PROOF STEP]
by (metis eq_id_iff frechet_derivative_id)