[STATEMENT]
lemma basic_cqe_conv3:
  fixes p q :: "complex poly"
  assumes l: "p \<noteq> 0"
  shows "(\<exists>x. poly (pCons a p) x = 0 \<and> poly q x \<noteq> 0) \<longleftrightarrow> \<not> (pCons a p) dvd (q ^ psize p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x. poly (pCons a p) x = 0 \<and> poly q x \<noteq> 0) = (\<not> pCons a p dvd q ^ psize p)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<exists>x. poly (pCons a p) x = 0 \<and> poly q x \<noteq> 0) = (\<not> pCons a p dvd q ^ psize p)
[PROOF STEP]
from l
[PROOF STATE]
proof (chain)
picking this:
p \<noteq> 0
[PROOF STEP]
have dp: "degree (pCons a p) = psize p"
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0

goal (1 subgoal):
 1. degree (pCons a p) = psize p
[PROOF STEP]
by (simp add: psize_def)
[PROOF STATE]
proof (state)
this:
degree (pCons a p) = psize p

goal (1 subgoal):
 1. (\<exists>x. poly (pCons a p) x = 0 \<and> poly q x \<noteq> 0) = (\<not> pCons a p dvd q ^ psize p)
[PROOF STEP]
from nullstellensatz_univariate[of "pCons a p" q] l
[PROOF STATE]
proof (chain)
picking this:
(\<forall>x. poly (pCons a p) x = 0 \<longrightarrow> poly q x = 0) = (pCons a p dvd q ^ degree (pCons a p) \<or> pCons a p = 0 \<and> q = 0)
p \<noteq> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<forall>x. poly (pCons a p) x = 0 \<longrightarrow> poly q x = 0) = (pCons a p dvd q ^ degree (pCons a p) \<or> pCons a p = 0 \<and> q = 0)
p \<noteq> 0

goal (1 subgoal):
 1. (\<exists>x. poly (pCons a p) x = 0 \<and> poly q x \<noteq> 0) = (\<not> pCons a p dvd q ^ psize p)
[PROOF STEP]
by (metis dp pCons_eq_0_iff)
[PROOF STATE]
proof (state)
this:
(\<exists>x. poly (pCons a p) x = 0 \<and> poly q x \<noteq> 0) = (\<not> pCons a p dvd q ^ psize p)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in vfsequence) vfsequence_vlrestriction_succ:
  assumes [simp]: "k \<in>\<^sub>\<circ> vcard xs"
  shows "xs \<restriction>\<^sup>l\<^sub>\<circ> succ k = xs \<restriction>\<^sup>l\<^sub>\<circ> k #\<^sub>\<circ> (xs\<lparr>k\<rparr>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs \<restriction>\<^sup>l\<^sub>\<circ> ZFC_in_HOL.succ k = xs \<restriction>\<^sup>l\<^sub>\<circ> k #\<^sub>\<circ> xs\<lparr>k\<rparr>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. xs \<restriction>\<^sup>l\<^sub>\<circ> ZFC_in_HOL.succ k = xs \<restriction>\<^sup>l\<^sub>\<circ> k #\<^sub>\<circ> xs\<lparr>k\<rparr>
[PROOF STEP]
interpret vlr: vfsequence \<open>xs \<restriction>\<^sup>l\<^sub>\<circ> k\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vfsequence (xs \<restriction>\<^sup>l\<^sub>\<circ> k)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
k \<in>\<^sub>\<circ> vcard xs

goal (1 subgoal):
 1. vfsequence (xs \<restriction>\<^sup>l\<^sub>\<circ> k)
[PROOF STEP]
by (blast intro: vfsequence_vcard_in_omega Ord_trans)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. xs \<restriction>\<^sup>l\<^sub>\<circ> ZFC_in_HOL.succ k = xs \<restriction>\<^sup>l\<^sub>\<circ> k #\<^sub>\<circ> xs\<lparr>k\<rparr>
[PROOF STEP]
from vlr.vfsequence_vdomain[symmetric, simplified]
[PROOF STATE]
proof (chain)
picking this:
vcard (xs \<restriction>\<^sup>l\<^sub>\<circ> k) = k
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vcard (xs \<restriction>\<^sup>l\<^sub>\<circ> k) = k

goal (1 subgoal):
 1. xs \<restriction>\<^sup>l\<^sub>\<circ> ZFC_in_HOL.succ k = xs \<restriction>\<^sup>l\<^sub>\<circ> k #\<^sub>\<circ> xs\<lparr>k\<rparr>
[PROOF STEP]
by
      (
        simp add:
          vcons_def succ_def vfsequence_vdomain vsv_vlrestriction_vinsert
      )
[PROOF STATE]
proof (state)
this:
xs \<restriction>\<^sup>l\<^sub>\<circ> ZFC_in_HOL.succ k = xs \<restriction>\<^sup>l\<^sub>\<circ> k #\<^sub>\<circ> xs\<lparr>k\<rparr>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma has_fps_expansion_deriv [fps_expansion_intros]:
  assumes "f has_fps_expansion F"
  shows   "deriv f has_fps_expansion fps_deriv F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deriv f has_fps_expansion fps_deriv F
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. deriv f has_fps_expansion fps_deriv F
[PROOF STEP]
have "eventually (\<lambda>z. z \<in> eball 0 (fps_conv_radius F)) (nhds 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F z in nhds (0::'b). z \<in> eball (0::'b) (fps_conv_radius F)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f has_fps_expansion F

goal (1 subgoal):
 1. \<forall>\<^sub>F z in nhds (0::'b). z \<in> eball (0::'b) (fps_conv_radius F)
[PROOF STEP]
by (intro eventually_nhds_in_open)
                   (auto simp: has_fps_expansion_def zero_ereal_def)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F z in nhds (0::?'b1). z \<in> eball (0::?'b1) (fps_conv_radius F)

goal (1 subgoal):
 1. deriv f has_fps_expansion fps_deriv F
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F z in nhds (0::?'b1). z \<in> eball (0::?'b1) (fps_conv_radius F)

goal (1 subgoal):
 1. deriv f has_fps_expansion fps_deriv F
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
f has_fps_expansion F
[PROOF STEP]
have "eventually (\<lambda>z. eval_fps F z = f z) (nhds 0)"
[PROOF STATE]
proof (prove)
using this:
f has_fps_expansion F

goal (1 subgoal):
 1. \<forall>\<^sub>F z in nhds (0::'a). eval_fps F z = f z
[PROOF STEP]
by (auto simp: has_fps_expansion_def)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F z in nhds (0::'a). eval_fps F z = f z

goal (1 subgoal):
 1. deriv f has_fps_expansion fps_deriv F
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F z in nhds (0::'a). eval_fps F z = f z
[PROOF STEP]
obtain s where "open s" "0 \<in> s" and s: "\<And>w. w \<in> s \<Longrightarrow> eval_fps F w = f w"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F z in nhds (0::'a). eval_fps F z = f z

goal (1 subgoal):
 1. (\<And>s. \<lbrakk>open s; (0::'a) \<in> s; \<And>w. w \<in> s \<Longrightarrow> eval_fps F w = f w\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: eventually_nhds)
[PROOF STATE]
proof (state)
this:
open s
(0::'a) \<in> s
?w1 \<in> s \<Longrightarrow> eval_fps F ?w1 = f ?w1

goal (1 subgoal):
 1. deriv f has_fps_expansion fps_deriv F
[PROOF STEP]
hence "eventually (\<lambda>w. w \<in> s) (nhds 0)"
[PROOF STATE]
proof (prove)
using this:
open s
(0::'a) \<in> s
?w1 \<in> s \<Longrightarrow> eval_fps F ?w1 = f ?w1

goal (1 subgoal):
 1. \<forall>\<^sub>F w in nhds (0::'a). w \<in> s
[PROOF STEP]
by (intro eventually_nhds_in_open) auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F w in nhds (0::'a). w \<in> s

goal (1 subgoal):
 1. deriv f has_fps_expansion fps_deriv F
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F z in nhds (0::?'b1). z \<in> eball (0::?'b1) (fps_conv_radius F)
\<forall>\<^sub>F w in nhds (0::'a). w \<in> s
[PROOF STEP]
have "eventually (\<lambda>z. eval_fps (fps_deriv F) z = deriv f z) (nhds 0)"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F z in nhds (0::?'b1). z \<in> eball (0::?'b1) (fps_conv_radius F)
\<forall>\<^sub>F w in nhds (0::'a). w \<in> s

goal (1 subgoal):
 1. \<forall>\<^sub>F z in nhds (0::'a). eval_fps (fps_deriv F) z = deriv f z
[PROOF STEP]
proof eventually_elim
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>z. \<lbrakk>z \<in> eball (0::'a) (fps_conv_radius F); z \<in> s\<rbrakk> \<Longrightarrow> eval_fps (fps_deriv F) z = deriv f z
[PROOF STEP]
case (elim z)
[PROOF STATE]
proof (state)
this:
z \<in> eball (0::'a) (fps_conv_radius F)
z \<in> s

goal (1 subgoal):
 1. \<And>z. \<lbrakk>z \<in> eball (0::'a) (fps_conv_radius F); z \<in> s\<rbrakk> \<Longrightarrow> eval_fps (fps_deriv F) z = deriv f z
[PROOF STEP]
hence "eval_fps (fps_deriv F) z = deriv (eval_fps F) z"
[PROOF STATE]
proof (prove)
using this:
z \<in> eball (0::'a) (fps_conv_radius F)
z \<in> s

goal (1 subgoal):
 1. eval_fps (fps_deriv F) z = deriv (eval_fps F) z
[PROOF STEP]
by (simp add: eval_fps_deriv)
[PROOF STATE]
proof (state)
this:
eval_fps (fps_deriv F) z = deriv (eval_fps F) z

goal (1 subgoal):
 1. \<And>z. \<lbrakk>z \<in> eball (0::'a) (fps_conv_radius F); z \<in> s\<rbrakk> \<Longrightarrow> eval_fps (fps_deriv F) z = deriv f z
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
eval_fps (fps_deriv F) z = deriv (eval_fps F) z

goal (1 subgoal):
 1. \<And>z. \<lbrakk>z \<in> eball (0::'a) (fps_conv_radius F); z \<in> s\<rbrakk> \<Longrightarrow> eval_fps (fps_deriv F) z = deriv f z
[PROOF STEP]
have "eventually (\<lambda>w. w \<in> s) (nhds z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F w in nhds z. w \<in> s
[PROOF STEP]
using elim and \<open>open s\<close>
[PROOF STATE]
proof (prove)
using this:
z \<in> eball (0::'a) (fps_conv_radius F)
z \<in> s
open s

goal (1 subgoal):
 1. \<forall>\<^sub>F w in nhds z. w \<in> s
[PROOF STEP]
by (intro eventually_nhds_in_open) auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F w in nhds z. w \<in> s

goal (1 subgoal):
 1. \<And>z. \<lbrakk>z \<in> eball (0::'a) (fps_conv_radius F); z \<in> s\<rbrakk> \<Longrightarrow> eval_fps (fps_deriv F) z = deriv f z
[PROOF STEP]
hence "eventually (\<lambda>w. eval_fps F w = f w) (nhds z)"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F w in nhds z. w \<in> s

goal (1 subgoal):
 1. \<forall>\<^sub>F w in nhds z. eval_fps F w = f w
[PROOF STEP]
by eventually_elim (simp add: s)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F w in nhds z. eval_fps F w = f w

goal (1 subgoal):
 1. \<And>z. \<lbrakk>z \<in> eball (0::'a) (fps_conv_radius F); z \<in> s\<rbrakk> \<Longrightarrow> eval_fps (fps_deriv F) z = deriv f z
[PROOF STEP]
hence "deriv (eval_fps F) z = deriv f z"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F w in nhds z. eval_fps F w = f w

goal (1 subgoal):
 1. deriv (eval_fps F) z = deriv f z
[PROOF STEP]
by (intro deriv_cong_ev refl)
[PROOF STATE]
proof (state)
this:
deriv (eval_fps F) z = deriv f z

goal (1 subgoal):
 1. \<And>z. \<lbrakk>z \<in> eball (0::'a) (fps_conv_radius F); z \<in> s\<rbrakk> \<Longrightarrow> eval_fps (fps_deriv F) z = deriv f z
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
eval_fps (fps_deriv F) z = deriv f z
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
eval_fps (fps_deriv F) z = deriv f z

goal (1 subgoal):
 1. eval_fps (fps_deriv F) z = deriv f z
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
eval_fps (fps_deriv F) z = deriv f z

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F z in nhds (0::'a). eval_fps (fps_deriv F) z = deriv f z

goal (1 subgoal):
 1. deriv f has_fps_expansion fps_deriv F
[PROOF STEP]
with assms and fps_conv_radius_deriv[of F]
[PROOF STATE]
proof (chain)
picking this:
f has_fps_expansion F
fps_conv_radius F \<le> fps_conv_radius (fps_deriv F)
\<forall>\<^sub>F z in nhds (0::'a). eval_fps (fps_deriv F) z = deriv f z
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f has_fps_expansion F
fps_conv_radius F \<le> fps_conv_radius (fps_deriv F)
\<forall>\<^sub>F z in nhds (0::'a). eval_fps (fps_deriv F) z = deriv f z

goal (1 subgoal):
 1. deriv f has_fps_expansion fps_deriv F
[PROOF STEP]
by (auto simp: has_fps_expansion_def)
[PROOF STATE]
proof (state)
this:
deriv f has_fps_expansion fps_deriv F

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma isPrefixElements:
  assumes "isPrefix a b"
  shows "isPrefix (elements a) (elements b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isPrefix (elements a) (elements b)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
isPrefix a b

goal (1 subgoal):
 1. isPrefix (elements a) (elements b)
[PROOF STEP]
unfolding isPrefix_def
[PROOF STATE]
proof (prove)
using this:
\<exists>s. a @ s = b

goal (1 subgoal):
 1. \<exists>s. elements a @ s = elements b
[PROOF STEP]
by auto


[STATEMENT]
lemma s'_calc_i_0: "$s'_n = n" if "i = 0" "n \<ge> 0" for n::real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. $s'_n = n
[PROOF STEP]
unfolding acc_cont_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral {0..n} ((.^) (1 + i)) = n
[PROOF STEP]
apply (subst \<open>i = 0\<close>, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral {0..n} ((.^) 1) = n
[PROOF STEP]
by (simp add: integral_cong that)


[STATEMENT]
lemma mat_is_design:
  assumes "\<And>j. j < dim_col M\<Longrightarrow> 1 \<in>$ (col M j)"
  shows "design {0..<dim_row M} {# map_col_to_block c . c \<in># mset (cols M)#}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. design {0..<dim_row M} (image_mset map_col_to_block (mset (cols M)))
[PROOF STEP]
proof (unfold_locales)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>bl. bl \<in># image_mset map_col_to_block (mset (cols M)) \<Longrightarrow> bl \<noteq> {}
[PROOF STEP]
fix bl
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>bl. bl \<in># image_mset map_col_to_block (mset (cols M)) \<Longrightarrow> bl \<noteq> {}
[PROOF STEP]
assume "bl \<in># {# map_col_to_block c . c \<in># mset (cols M)#}"
[PROOF STATE]
proof (state)
this:
bl \<in># image_mset map_col_to_block (mset (cols M))

goal (1 subgoal):
 1. \<And>bl. bl \<in># image_mset map_col_to_block (mset (cols M)) \<Longrightarrow> bl \<noteq> {}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
bl \<in># image_mset map_col_to_block (mset (cols M))
[PROOF STEP]
obtain j where "j < dim_col M" and map: "bl = map_col_to_block (col M j)"
[PROOF STATE]
proof (prove)
using this:
bl \<in># image_mset map_col_to_block (mset (cols M))

goal (1 subgoal):
 1. (\<And>j. \<lbrakk>j < dim_col M; bl = map_col_to_block (col M j)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using obtain_block_index_map_block_set
[PROOF STATE]
proof (prove)
using this:
bl \<in># image_mset map_col_to_block (mset (cols M))
\<lbrakk>?bl \<in># image_mset map_col_to_block (mset (cols M)); \<And>j. \<lbrakk>j < dim_col M; ?bl = map_col_to_block (col M j)\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>j. \<lbrakk>j < dim_col M; bl = map_col_to_block (col M j)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
j < dim_col M
bl = map_col_to_block (col M j)

goal (1 subgoal):
 1. \<And>bl. bl \<in># image_mset map_col_to_block (mset (cols M)) \<Longrightarrow> bl \<noteq> {}
[PROOF STEP]
thus "bl \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
j < dim_col M
bl = map_col_to_block (col M j)

goal (1 subgoal):
 1. bl \<noteq> {}
[PROOF STEP]
using assms one_implies_block_nempty
[PROOF STATE]
proof (prove)
using this:
j < dim_col M
bl = map_col_to_block (col M j)
?j < dim_col M \<Longrightarrow> (1::'b) \<in>$ col M ?j
\<lbrakk>?j < dim_col M; (1::'b) \<in>$ col M ?j\<rbrakk> \<Longrightarrow> map_col_to_block (col M ?j) \<noteq> {}

goal (1 subgoal):
 1. bl \<noteq> {}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
bl \<noteq> {}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma gp:
  assumes a0: "a$0 = (0::'a::field)"
  shows "(Abs_fps (\<lambda>n. 1)) oo a = 1/(1 - a)"
    (is "?one oo a = _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs_fps (\<lambda>n. 1::'a) oo a = 1 / (1 - a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Abs_fps (\<lambda>n. 1::'a) oo a = 1 / (1 - a)
[PROOF STEP]
have o0: "?one $ 0 \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs_fps (\<lambda>n. 1::'a) $ 0 \<noteq> (0::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Abs_fps (\<lambda>n. 1::'a) $ 0 \<noteq> (0::'a)

goal (1 subgoal):
 1. Abs_fps (\<lambda>n. 1::'a) oo a = 1 / (1 - a)
[PROOF STEP]
have th0: "(1 - fps_X) $ 0 \<noteq> (0::'a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 - fps_X) $ 0 \<noteq> (0::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(1 - fps_X) $ 0 \<noteq> (0::'a)

goal (1 subgoal):
 1. Abs_fps (\<lambda>n. 1::'a) oo a = 1 / (1 - a)
[PROOF STEP]
from fps_inverse_gp[where ?'a = 'a]
[PROOF STATE]
proof (chain)
picking this:
inverse (Abs_fps (\<lambda>n. 1::'a)) = Abs_fps (\<lambda>n. if n = 0 then 1::'a else if n = 1 then - (1::'a) else (0::'a))
[PROOF STEP]
have "inverse ?one = 1 - fps_X"
[PROOF STATE]
proof (prove)
using this:
inverse (Abs_fps (\<lambda>n. 1::'a)) = Abs_fps (\<lambda>n. if n = 0 then 1::'a else if n = 1 then - (1::'a) else (0::'a))

goal (1 subgoal):
 1. inverse (Abs_fps (\<lambda>n. 1::'a)) = 1 - fps_X
[PROOF STEP]
by (simp add: fps_eq_iff)
[PROOF STATE]
proof (state)
this:
inverse (Abs_fps (\<lambda>n. 1::'a)) = 1 - fps_X

goal (1 subgoal):
 1. Abs_fps (\<lambda>n. 1::'a) oo a = 1 / (1 - a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inverse (Abs_fps (\<lambda>n. 1::'a)) = 1 - fps_X
[PROOF STEP]
have "inverse (inverse ?one) = inverse (1 - fps_X)"
[PROOF STATE]
proof (prove)
using this:
inverse (Abs_fps (\<lambda>n. 1::'a)) = 1 - fps_X

goal (1 subgoal):
 1. inverse (inverse (Abs_fps (\<lambda>n. 1::'a))) = inverse (1 - fps_X)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
inverse (inverse (Abs_fps (\<lambda>n. 1::'a))) = inverse (1 - fps_X)

goal (1 subgoal):
 1. Abs_fps (\<lambda>n. 1::'a) oo a = 1 / (1 - a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inverse (inverse (Abs_fps (\<lambda>n. 1::'a))) = inverse (1 - fps_X)
[PROOF STEP]
have th: "?one = 1/(1 - fps_X)"
[PROOF STATE]
proof (prove)
using this:
inverse (inverse (Abs_fps (\<lambda>n. 1::'a))) = inverse (1 - fps_X)

goal (1 subgoal):
 1. Abs_fps (\<lambda>n. 1::'a) = 1 / (1 - fps_X)
[PROOF STEP]
unfolding fps_inverse_idempotent[OF o0]
[PROOF STATE]
proof (prove)
using this:
Abs_fps (\<lambda>n. 1::'a) = inverse (1 - fps_X)

goal (1 subgoal):
 1. Abs_fps (\<lambda>n. 1::'a) = 1 / (1 - fps_X)
[PROOF STEP]
by (simp add: fps_divide_def)
[PROOF STATE]
proof (state)
this:
Abs_fps (\<lambda>n. 1::'a) = 1 / (1 - fps_X)

goal (1 subgoal):
 1. Abs_fps (\<lambda>n. 1::'a) oo a = 1 / (1 - a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs_fps (\<lambda>n. 1::'a) oo a = 1 / (1 - a)
[PROOF STEP]
unfolding th
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / (1 - fps_X) oo a = 1 / (1 - a)
[PROOF STEP]
unfolding fps_divide_compose[OF a0 th0]
    fps_compose_1 fps_compose_sub_distrib fps_X_fps_compose_startby0[OF a0]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / (1 - a) = 1 / (1 - a)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
Abs_fps (\<lambda>n. 1::'a) oo a = 1 / (1 - a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma compute_nr_of_jordan_blocks: assumes jnf: "jordan_nf A n_as"
  and no_0: "k \<noteq> 0"
  shows "compute_nr_of_jordan_blocks A ev k = length (filter ((=) (k,ev)) n_as)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.compute_nr_of_jordan_blocks A ev k = length (filter ((=) (k, ev)) n_as)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. local.compute_nr_of_jordan_blocks A ev k = length (filter ((=) (k, ev)) n_as)
[PROOF STEP]
from no_0
[PROOF STATE]
proof (chain)
picking this:
k \<noteq> 0
[PROOF STEP]
obtain k1 where k: "k = Suc k1"
[PROOF STATE]
proof (prove)
using this:
k \<noteq> 0

goal (1 subgoal):
 1. (\<And>k1. k = Suc k1 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases k, auto)
[PROOF STATE]
proof (state)
this:
k = Suc k1

goal (1 subgoal):
 1. local.compute_nr_of_jordan_blocks A ev k = length (filter ((=) (k, ev)) n_as)
[PROOF STEP]
let ?k = "Suc k1"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. local.compute_nr_of_jordan_blocks A ev k = length (filter ((=) (k, ev)) n_as)
[PROOF STEP]
let ?k2 = "Suc ?k"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. local.compute_nr_of_jordan_blocks A ev k = length (filter ((=) (k, ev)) n_as)
[PROOF STEP]
let ?dim = "dim_gen_eigenspace A ev"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. local.compute_nr_of_jordan_blocks A ev k = length (filter ((=) (k, ev)) n_as)
[PROOF STEP]
let ?sizes = "map fst [(n, e)\<leftarrow>n_as . e = ev]"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. local.compute_nr_of_jordan_blocks A ev k = length (filter ((=) (k, ev)) n_as)
[PROOF STEP]
define sizes where "sizes = ?sizes"
[PROOF STATE]
proof (state)
this:
sizes = map fst (filter (\<lambda>(n, e). e = ev) n_as)

goal (1 subgoal):
 1. local.compute_nr_of_jordan_blocks A ev k = length (filter ((=) (k, ev)) n_as)
[PROOF STEP]
let ?two = "length (filter ((=) (k, ev)) n_as)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. local.compute_nr_of_jordan_blocks A ev k = length (filter ((=) (k, ev)) n_as)
[PROOF STEP]
have "compute_nr_of_jordan_blocks A ev k =
    ?dim ?k + ?dim ?k - ?dim k1 - ?dim ?k2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.compute_nr_of_jordan_blocks A ev k = local.dim_gen_eigenspace A ev (Suc k1) + local.dim_gen_eigenspace A ev (Suc k1) - local.dim_gen_eigenspace A ev k1 - local.dim_gen_eigenspace A ev (Suc (Suc k1))
[PROOF STEP]
unfolding compute_nr_of_jordan_blocks_def k
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * local.dim_gen_eigenspace A ev (Suc k1) - local.dim_gen_eigenspace A ev (Suc k1 - 1) - local.dim_gen_eigenspace A ev (Suc (Suc k1)) = local.dim_gen_eigenspace A ev (Suc k1) + local.dim_gen_eigenspace A ev (Suc k1) - local.dim_gen_eigenspace A ev k1 - local.dim_gen_eigenspace A ev (Suc (Suc k1))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
local.compute_nr_of_jordan_blocks A ev k = local.dim_gen_eigenspace A ev (Suc k1) + local.dim_gen_eigenspace A ev (Suc k1) - local.dim_gen_eigenspace A ev k1 - local.dim_gen_eigenspace A ev (Suc (Suc k1))

goal (1 subgoal):
 1. local.compute_nr_of_jordan_blocks A ev k = length (filter ((=) (k, ev)) n_as)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
local.compute_nr_of_jordan_blocks A ev k = local.dim_gen_eigenspace A ev (Suc k1) + local.dim_gen_eigenspace A ev (Suc k1) - local.dim_gen_eigenspace A ev k1 - local.dim_gen_eigenspace A ev (Suc (Suc k1))

goal (1 subgoal):
 1. local.compute_nr_of_jordan_blocks A ev k = length (filter ((=) (k, ev)) n_as)
[PROOF STEP]
have "\<dots> = length (filter ((=) k) ?sizes)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.dim_gen_eigenspace A ev (Suc k1) + local.dim_gen_eigenspace A ev (Suc k1) - local.dim_gen_eigenspace A ev k1 - local.dim_gen_eigenspace A ev (Suc (Suc k1)) = length (filter ((=) k) (map fst (filter (\<lambda>(n, e). e = ev) n_as)))
[PROOF STEP]
unfolding dim_gen_eigenspace[OF jnf] k sizes_def[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (map (min (Suc k1)) sizes) + sum_list (map (min (Suc k1)) sizes) - sum_list (map (min k1) sizes) - sum_list (map (min (Suc (Suc k1))) sizes) = length (filter ((=) (Suc k1)) sizes)
[PROOF STEP]
proof (rule sym, induct sizes)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. length (filter ((=) (Suc k1)) []) = sum_list (map (min (Suc k1)) []) + sum_list (map (min (Suc k1)) []) - sum_list (map (min k1) []) - sum_list (map (min (Suc (Suc k1))) [])
 2. \<And>a sizes. length (filter ((=) (Suc k1)) sizes) = sum_list (map (min (Suc k1)) sizes) + sum_list (map (min (Suc k1)) sizes) - sum_list (map (min k1) sizes) - sum_list (map (min (Suc (Suc k1))) sizes) \<Longrightarrow> length (filter ((=) (Suc k1)) (a # sizes)) = sum_list (map (min (Suc k1)) (a # sizes)) + sum_list (map (min (Suc k1)) (a # sizes)) - sum_list (map (min k1) (a # sizes)) - sum_list (map (min (Suc (Suc k1))) (a # sizes))
[PROOF STEP]
case (Cons s sizes)
[PROOF STATE]
proof (state)
this:
length (filter ((=) (Suc k1)) sizes) = sum_list (map (min (Suc k1)) sizes) + sum_list (map (min (Suc k1)) sizes) - sum_list (map (min k1) sizes) - sum_list (map (min (Suc (Suc k1))) sizes)

goal (2 subgoals):
 1. length (filter ((=) (Suc k1)) []) = sum_list (map (min (Suc k1)) []) + sum_list (map (min (Suc k1)) []) - sum_list (map (min k1) []) - sum_list (map (min (Suc (Suc k1))) [])
 2. \<And>a sizes. length (filter ((=) (Suc k1)) sizes) = sum_list (map (min (Suc k1)) sizes) + sum_list (map (min (Suc k1)) sizes) - sum_list (map (min k1) sizes) - sum_list (map (min (Suc (Suc k1))) sizes) \<Longrightarrow> length (filter ((=) (Suc k1)) (a # sizes)) = sum_list (map (min (Suc k1)) (a # sizes)) + sum_list (map (min (Suc k1)) (a # sizes)) - sum_list (map (min k1) (a # sizes)) - sum_list (map (min (Suc (Suc k1))) (a # sizes))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (filter ((=) (Suc k1)) (s # sizes)) = sum_list (map (min (Suc k1)) (s # sizes)) + sum_list (map (min (Suc k1)) (s # sizes)) - sum_list (map (min k1) (s # sizes)) - sum_list (map (min (Suc (Suc k1))) (s # sizes))
[PROOF STEP]
proof (cases "s = ?k")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. s = Suc k1 \<Longrightarrow> length (filter ((=) (Suc k1)) (s # sizes)) = sum_list (map (min (Suc k1)) (s # sizes)) + sum_list (map (min (Suc k1)) (s # sizes)) - sum_list (map (min k1) (s # sizes)) - sum_list (map (min (Suc (Suc k1))) (s # sizes))
 2. s \<noteq> Suc k1 \<Longrightarrow> length (filter ((=) (Suc k1)) (s # sizes)) = sum_list (map (min (Suc k1)) (s # sizes)) + sum_list (map (min (Suc k1)) (s # sizes)) - sum_list (map (min k1) (s # sizes)) - sum_list (map (min (Suc (Suc k1))) (s # sizes))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
s = Suc k1

goal (2 subgoals):
 1. s = Suc k1 \<Longrightarrow> length (filter ((=) (Suc k1)) (s # sizes)) = sum_list (map (min (Suc k1)) (s # sizes)) + sum_list (map (min (Suc k1)) (s # sizes)) - sum_list (map (min k1) (s # sizes)) - sum_list (map (min (Suc (Suc k1))) (s # sizes))
 2. s \<noteq> Suc k1 \<Longrightarrow> length (filter ((=) (Suc k1)) (s # sizes)) = sum_list (map (min (Suc k1)) (s # sizes)) + sum_list (map (min (Suc k1)) (s # sizes)) - sum_list (map (min k1) (s # sizes)) - sum_list (map (min (Suc (Suc k1))) (s # sizes))
[PROOF STEP]
let ?sum = "\<lambda> k sizes. sum_list (map (min k) sizes)"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. s = Suc k1 \<Longrightarrow> length (filter ((=) (Suc k1)) (s # sizes)) = sum_list (map (min (Suc k1)) (s # sizes)) + sum_list (map (min (Suc k1)) (s # sizes)) - sum_list (map (min k1) (s # sizes)) - sum_list (map (min (Suc (Suc k1))) (s # sizes))
 2. s \<noteq> Suc k1 \<Longrightarrow> length (filter ((=) (Suc k1)) (s # sizes)) = sum_list (map (min (Suc k1)) (s # sizes)) + sum_list (map (min (Suc k1)) (s # sizes)) - sum_list (map (min k1) (s # sizes)) - sum_list (map (min (Suc (Suc k1))) (s # sizes))
[PROOF STEP]
let ?len = "\<lambda> sizes. length (filter ((=) ?k) sizes)"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. s = Suc k1 \<Longrightarrow> length (filter ((=) (Suc k1)) (s # sizes)) = sum_list (map (min (Suc k1)) (s # sizes)) + sum_list (map (min (Suc k1)) (s # sizes)) - sum_list (map (min k1) (s # sizes)) - sum_list (map (min (Suc (Suc k1))) (s # sizes))
 2. s \<noteq> Suc k1 \<Longrightarrow> length (filter ((=) (Suc k1)) (s # sizes)) = sum_list (map (min (Suc k1)) (s # sizes)) + sum_list (map (min (Suc k1)) (s # sizes)) - sum_list (map (min k1) (s # sizes)) - sum_list (map (min (Suc (Suc k1))) (s # sizes))
[PROOF STEP]
have len: "?len (s # sizes) = Suc (?len sizes)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (filter ((=) (Suc k1)) (s # sizes)) = Suc (length (filter ((=) (Suc k1)) sizes))
[PROOF STEP]
unfolding True
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (filter ((=) (Suc k1)) (Suc k1 # sizes)) = Suc (length (filter ((=) (Suc k1)) sizes))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length (filter ((=) (Suc k1)) (s # sizes)) = Suc (length (filter ((=) (Suc k1)) sizes))

goal (2 subgoals):
 1. s = Suc k1 \<Longrightarrow> length (filter ((=) (Suc k1)) (s # sizes)) = sum_list (map (min (Suc k1)) (s # sizes)) + sum_list (map (min (Suc k1)) (s # sizes)) - sum_list (map (min k1) (s # sizes)) - sum_list (map (min (Suc (Suc k1))) (s # sizes))
 2. s \<noteq> Suc k1 \<Longrightarrow> length (filter ((=) (Suc k1)) (s # sizes)) = sum_list (map (min (Suc k1)) (s # sizes)) + sum_list (map (min (Suc k1)) (s # sizes)) - sum_list (map (min k1) (s # sizes)) - sum_list (map (min (Suc (Suc k1))) (s # sizes))
[PROOF STEP]
have IH: "?len sizes = ?sum ?k sizes + ?sum ?k sizes -
        ?sum k1 sizes - ?sum ?k2 sizes"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (filter ((=) (Suc k1)) sizes) = sum_list (map (min (Suc k1)) sizes) + sum_list (map (min (Suc k1)) sizes) - sum_list (map (min k1) sizes) - sum_list (map (min (Suc (Suc k1))) sizes)
[PROOF STEP]
by (rule Cons)
[PROOF STATE]
proof (state)
this:
length (filter ((=) (Suc k1)) sizes) = sum_list (map (min (Suc k1)) sizes) + sum_list (map (min (Suc k1)) sizes) - sum_list (map (min k1) sizes) - sum_list (map (min (Suc (Suc k1))) sizes)

goal (2 subgoals):
 1. s = Suc k1 \<Longrightarrow> length (filter ((=) (Suc k1)) (s # sizes)) = sum_list (map (min (Suc k1)) (s # sizes)) + sum_list (map (min (Suc k1)) (s # sizes)) - sum_list (map (min k1) (s # sizes)) - sum_list (map (min (Suc (Suc k1))) (s # sizes))
 2. s \<noteq> Suc k1 \<Longrightarrow> length (filter ((=) (Suc k1)) (s # sizes)) = sum_list (map (min (Suc k1)) (s # sizes)) + sum_list (map (min (Suc k1)) (s # sizes)) - sum_list (map (min k1) (s # sizes)) - sum_list (map (min (Suc (Suc k1))) (s # sizes))
[PROOF STEP]
have "?sum ?k (s # sizes) + ?sum ?k (s # sizes) -
        ?sum k1 (s # sizes) - ?sum ?k2 (s # sizes)
        = Suc (?sum ?k sizes + ?sum ?k sizes) -
         (?sum k1 sizes + ?sum ?k2 sizes)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (map (min (Suc k1)) (s # sizes)) + sum_list (map (min (Suc k1)) (s # sizes)) - sum_list (map (min k1) (s # sizes)) - sum_list (map (min (Suc (Suc k1))) (s # sizes)) = Suc (sum_list (map (min (Suc k1)) sizes) + sum_list (map (min (Suc k1)) sizes)) - (sum_list (map (min k1) sizes) + sum_list (map (min (Suc (Suc k1))) sizes))
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
s = Suc k1

goal (1 subgoal):
 1. sum_list (map (min (Suc k1)) (s # sizes)) + sum_list (map (min (Suc k1)) (s # sizes)) - sum_list (map (min k1) (s # sizes)) - sum_list (map (min (Suc (Suc k1))) (s # sizes)) = Suc (sum_list (map (min (Suc k1)) sizes) + sum_list (map (min (Suc k1)) sizes)) - (sum_list (map (min k1) sizes) + sum_list (map (min (Suc (Suc k1))) sizes))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum_list (map (min (Suc k1)) (s # sizes)) + sum_list (map (min (Suc k1)) (s # sizes)) - sum_list (map (min k1) (s # sizes)) - sum_list (map (min (Suc (Suc k1))) (s # sizes)) = Suc (sum_list (map (min (Suc k1)) sizes) + sum_list (map (min (Suc k1)) sizes)) - (sum_list (map (min k1) sizes) + sum_list (map (min (Suc (Suc k1))) sizes))

goal (2 subgoals):
 1. s = Suc k1 \<Longrightarrow> length (filter ((=) (Suc k1)) (s # sizes)) = sum_list (map (min (Suc k1)) (s # sizes)) + sum_list (map (min (Suc k1)) (s # sizes)) - sum_list (map (min k1) (s # sizes)) - sum_list (map (min (Suc (Suc k1))) (s # sizes))
 2. s \<noteq> Suc k1 \<Longrightarrow> length (filter ((=) (Suc k1)) (s # sizes)) = sum_list (map (min (Suc k1)) (s # sizes)) + sum_list (map (min (Suc k1)) (s # sizes)) - sum_list (map (min k1) (s # sizes)) - sum_list (map (min (Suc (Suc k1))) (s # sizes))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum_list (map (min (Suc k1)) (s # sizes)) + sum_list (map (min (Suc k1)) (s # sizes)) - sum_list (map (min k1) (s # sizes)) - sum_list (map (min (Suc (Suc k1))) (s # sizes)) = Suc (sum_list (map (min (Suc k1)) sizes) + sum_list (map (min (Suc k1)) sizes)) - (sum_list (map (min k1) sizes) + sum_list (map (min (Suc (Suc k1))) sizes))

goal (2 subgoals):
 1. s = Suc k1 \<Longrightarrow> length (filter ((=) (Suc k1)) (s # sizes)) = sum_list (map (min (Suc k1)) (s # sizes)) + sum_list (map (min (Suc k1)) (s # sizes)) - sum_list (map (min k1) (s # sizes)) - sum_list (map (min (Suc (Suc k1))) (s # sizes))
 2. s \<noteq> Suc k1 \<Longrightarrow> length (filter ((=) (Suc k1)) (s # sizes)) = sum_list (map (min (Suc k1)) (s # sizes)) + sum_list (map (min (Suc k1)) (s # sizes)) - sum_list (map (min k1) (s # sizes)) - sum_list (map (min (Suc (Suc k1))) (s # sizes))
[PROOF STEP]
have "\<dots> = Suc (?sum ?k sizes + ?sum ?k sizes - (?sum k1 sizes + ?sum ?k2 sizes))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc (sum_list (map (min (Suc k1)) sizes) + sum_list (map (min (Suc k1)) sizes)) - (sum_list (map (min k1) sizes) + sum_list (map (min (Suc (Suc k1))) sizes)) = Suc (sum_list (map (min (Suc k1)) sizes) + sum_list (map (min (Suc k1)) sizes) - (sum_list (map (min k1) sizes) + sum_list (map (min (Suc (Suc k1))) sizes)))
[PROOF STEP]
by (rule Suc_diff_le, induct sizes, auto)
[PROOF STATE]
proof (state)
this:
Suc (sum_list (map (min (Suc k1)) sizes) + sum_list (map (min (Suc k1)) sizes)) - (sum_list (map (min k1) sizes) + sum_list (map (min (Suc (Suc k1))) sizes)) = Suc (sum_list (map (min (Suc k1)) sizes) + sum_list (map (min (Suc k1)) sizes) - (sum_list (map (min k1) sizes) + sum_list (map (min (Suc (Suc k1))) sizes)))

goal (2 subgoals):
 1. s = Suc k1 \<Longrightarrow> length (filter ((=) (Suc k1)) (s # sizes)) = sum_list (map (min (Suc k1)) (s # sizes)) + sum_list (map (min (Suc k1)) (s # sizes)) - sum_list (map (min k1) (s # sizes)) - sum_list (map (min (Suc (Suc k1))) (s # sizes))
 2. s \<noteq> Suc k1 \<Longrightarrow> length (filter ((=) (Suc k1)) (s # sizes)) = sum_list (map (min (Suc k1)) (s # sizes)) + sum_list (map (min (Suc k1)) (s # sizes)) - sum_list (map (min k1) (s # sizes)) - sum_list (map (min (Suc (Suc k1))) (s # sizes))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Suc (sum_list (map (min (Suc k1)) sizes) + sum_list (map (min (Suc k1)) sizes)) - (sum_list (map (min k1) sizes) + sum_list (map (min (Suc (Suc k1))) sizes)) = Suc (sum_list (map (min (Suc k1)) sizes) + sum_list (map (min (Suc k1)) sizes) - (sum_list (map (min k1) sizes) + sum_list (map (min (Suc (Suc k1))) sizes)))

goal (2 subgoals):
 1. s = Suc k1 \<Longrightarrow> length (filter ((=) (Suc k1)) (s # sizes)) = sum_list (map (min (Suc k1)) (s # sizes)) + sum_list (map (min (Suc k1)) (s # sizes)) - sum_list (map (min k1) (s # sizes)) - sum_list (map (min (Suc (Suc k1))) (s # sizes))
 2. s \<noteq> Suc k1 \<Longrightarrow> length (filter ((=) (Suc k1)) (s # sizes)) = sum_list (map (min (Suc k1)) (s # sizes)) + sum_list (map (min (Suc k1)) (s # sizes)) - sum_list (map (min k1) (s # sizes)) - sum_list (map (min (Suc (Suc k1))) (s # sizes))
[PROOF STEP]
have "\<dots> = ?len (s # sizes)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc (sum_list (map (min (Suc k1)) sizes) + sum_list (map (min (Suc k1)) sizes) - (sum_list (map (min k1) sizes) + sum_list (map (min (Suc (Suc k1))) sizes))) = length (filter ((=) (Suc k1)) (s # sizes))
[PROOF STEP]
unfolding len IH
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc (sum_list (map (min (Suc k1)) sizes) + sum_list (map (min (Suc k1)) sizes) - (sum_list (map (min k1) sizes) + sum_list (map (min (Suc (Suc k1))) sizes))) = Suc (sum_list (map (min (Suc k1)) sizes) + sum_list (map (min (Suc k1)) sizes) - sum_list (map (min k1) sizes) - sum_list (map (min (Suc (Suc k1))) sizes))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Suc (sum_list (map (min (Suc k1)) sizes) + sum_list (map (min (Suc k1)) sizes) - (sum_list (map (min k1) sizes) + sum_list (map (min (Suc (Suc k1))) sizes))) = length (filter ((=) (Suc k1)) (s # sizes))

goal (2 subgoals):
 1. s = Suc k1 \<Longrightarrow> length (filter ((=) (Suc k1)) (s # sizes)) = sum_list (map (min (Suc k1)) (s # sizes)) + sum_list (map (min (Suc k1)) (s # sizes)) - sum_list (map (min k1) (s # sizes)) - sum_list (map (min (Suc (Suc k1))) (s # sizes))
 2. s \<noteq> Suc k1 \<Longrightarrow> length (filter ((=) (Suc k1)) (s # sizes)) = sum_list (map (min (Suc k1)) (s # sizes)) + sum_list (map (min (Suc k1)) (s # sizes)) - sum_list (map (min k1) (s # sizes)) - sum_list (map (min (Suc (Suc k1))) (s # sizes))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sum_list (map (min (Suc k1)) (s # sizes)) + sum_list (map (min (Suc k1)) (s # sizes)) - sum_list (map (min k1) (s # sizes)) - sum_list (map (min (Suc (Suc k1))) (s # sizes)) = length (filter ((=) (Suc k1)) (s # sizes))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sum_list (map (min (Suc k1)) (s # sizes)) + sum_list (map (min (Suc k1)) (s # sizes)) - sum_list (map (min k1) (s # sizes)) - sum_list (map (min (Suc (Suc k1))) (s # sizes)) = length (filter ((=) (Suc k1)) (s # sizes))

goal (1 subgoal):
 1. length (filter ((=) (Suc k1)) (s # sizes)) = sum_list (map (min (Suc k1)) (s # sizes)) + sum_list (map (min (Suc k1)) (s # sizes)) - sum_list (map (min k1) (s # sizes)) - sum_list (map (min (Suc (Suc k1))) (s # sizes))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length (filter ((=) (Suc k1)) (s # sizes)) = sum_list (map (min (Suc k1)) (s # sizes)) + sum_list (map (min (Suc k1)) (s # sizes)) - sum_list (map (min k1) (s # sizes)) - sum_list (map (min (Suc (Suc k1))) (s # sizes))

goal (1 subgoal):
 1. s \<noteq> Suc k1 \<Longrightarrow> length (filter ((=) (Suc k1)) (s # sizes)) = sum_list (map (min (Suc k1)) (s # sizes)) + sum_list (map (min (Suc k1)) (s # sizes)) - sum_list (map (min k1) (s # sizes)) - sum_list (map (min (Suc (Suc k1))) (s # sizes))
[PROOF STEP]
qed (insert Cons, auto)
[PROOF STATE]
proof (state)
this:
length (filter ((=) (Suc k1)) (s # sizes)) = sum_list (map (min (Suc k1)) (s # sizes)) + sum_list (map (min (Suc k1)) (s # sizes)) - sum_list (map (min k1) (s # sizes)) - sum_list (map (min (Suc (Suc k1))) (s # sizes))

goal (1 subgoal):
 1. length (filter ((=) (Suc k1)) []) = sum_list (map (min (Suc k1)) []) + sum_list (map (min (Suc k1)) []) - sum_list (map (min k1) []) - sum_list (map (min (Suc (Suc k1))) [])
[PROOF STEP]
qed simp
[PROOF STATE]
proof (state)
this:
local.dim_gen_eigenspace A ev (Suc k1) + local.dim_gen_eigenspace A ev (Suc k1) - local.dim_gen_eigenspace A ev k1 - local.dim_gen_eigenspace A ev (Suc (Suc k1)) = length (filter ((=) k) (map fst (filter (\<lambda>(n, e). e = ev) n_as)))

goal (1 subgoal):
 1. local.compute_nr_of_jordan_blocks A ev k = length (filter ((=) (k, ev)) n_as)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
local.dim_gen_eigenspace A ev (Suc k1) + local.dim_gen_eigenspace A ev (Suc k1) - local.dim_gen_eigenspace A ev k1 - local.dim_gen_eigenspace A ev (Suc (Suc k1)) = length (filter ((=) k) (map fst (filter (\<lambda>(n, e). e = ev) n_as)))

goal (1 subgoal):
 1. local.compute_nr_of_jordan_blocks A ev k = length (filter ((=) (k, ev)) n_as)
[PROOF STEP]
have "\<dots> = length (filter ((=) (k, ev)) n_as)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (filter ((=) k) (map fst (filter (\<lambda>(n, e). e = ev) n_as))) = length (filter ((=) (k, ev)) n_as)
[PROOF STEP]
by (induct n_as, force+)
[PROOF STATE]
proof (state)
this:
length (filter ((=) k) (map fst (filter (\<lambda>(n, e). e = ev) n_as))) = length (filter ((=) (k, ev)) n_as)

goal (1 subgoal):
 1. local.compute_nr_of_jordan_blocks A ev k = length (filter ((=) (k, ev)) n_as)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
local.compute_nr_of_jordan_blocks A ev k = length (filter ((=) (k, ev)) n_as)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
local.compute_nr_of_jordan_blocks A ev k = length (filter ((=) (k, ev)) n_as)

goal (1 subgoal):
 1. local.compute_nr_of_jordan_blocks A ev k = length (filter ((=) (k, ev)) n_as)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
local.compute_nr_of_jordan_blocks A ev k = length (filter ((=) (k, ev)) n_as)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma map_lookup:
assumes "g 0 = 0"
shows "lookup (Poly_Mapping.map g f) x = g ((lookup f) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup (Poly_Mapping.map g f) x = g (lookup f x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lookup (Poly_Mapping.map g f) x = g (lookup f x)
[PROOF STEP]
have "(g (lookup f x) when lookup f x \<noteq> 0) = g (lookup f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g (lookup f x) when lookup f x \<noteq> (0::'b)) = g (lookup f x)
[PROOF STEP]
by (metis (mono_tags, lifting) assms when_def)
[PROOF STATE]
proof (state)
this:
(g (lookup f x) when lookup f x \<noteq> (0::'b)) = g (lookup f x)

goal (1 subgoal):
 1. lookup (Poly_Mapping.map g f) x = g (lookup f x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(g (lookup f x) when lookup f x \<noteq> (0::'b)) = g (lookup f x)
[PROOF STEP]
have "(g (lookup f x) when x \<in> keys f) = g (lookup f x)"
[PROOF STATE]
proof (prove)
using this:
(g (lookup f x) when lookup f x \<noteq> (0::'b)) = g (lookup f x)

goal (1 subgoal):
 1. (g (lookup f x) when x \<in> keys f) = g (lookup f x)
[PROOF STEP]
using lookup_not_eq_zero_eq_in_keys [of f]
[PROOF STATE]
proof (prove)
using this:
(g (lookup f x) when lookup f x \<noteq> (0::'b)) = g (lookup f x)
(lookup f ?k \<noteq> (0::'b)) = (?k \<in> keys f)

goal (1 subgoal):
 1. (g (lookup f x) when x \<in> keys f) = g (lookup f x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(g (lookup f x) when x \<in> keys f) = g (lookup f x)

goal (1 subgoal):
 1. lookup (Poly_Mapping.map g f) x = g (lookup f x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(g (lookup f x) when x \<in> keys f) = g (lookup f x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(g (lookup f x) when x \<in> keys f) = g (lookup f x)

goal (1 subgoal):
 1. lookup (Poly_Mapping.map g f) x = g (lookup f x)
[PROOF STEP]
by (simp add: Poly_Mapping.map_def map_fun_def in_keys_iff)
[PROOF STATE]
proof (state)
this:
lookup (Poly_Mapping.map g f) x = g (lookup f x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma llength_ltake [simp]: "llength (ltake n xs) = min n (llength xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. llength (ltake n xs) = min n (llength xs)
[PROOF STEP]
by(coinduction arbitrary: n xs rule: enat_coinduct)(auto 4 3 simp add: enat_min_eq_0_iff epred_llength ltl_ltake)


[STATEMENT]
lemma urel_integer_0: "urel_integer 0 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. urel_integer 0 0
[PROOF STEP]
unfolding urel_integer_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 = int_of_integer 0 \<and> 0 \<le> 0 \<and> 0 < p
[PROOF STEP]
using p2
[PROOF STATE]
proof (prove)
using this:
2 \<le> p

goal (1 subgoal):
 1. 0 = int_of_integer 0 \<and> 0 \<le> 0 \<and> 0 < p
[PROOF STEP]
by simp


[STATEMENT]
lemma segment_open_subset_closed:
   "open_segment a b \<subseteq> closed_segment a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open_segment a b \<subseteq> closed_segment a b
[PROOF STEP]
by (auto simp: closed_segment_def open_segment_def)


[STATEMENT]
lemma sorted_descending_sort_descending_key: "sorted_descending (map f (sort_descending_key f xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted_descending (map f (sort_descending_key f xs))
[PROOF STEP]
apply(simp add: sort_descending_key_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted_descending (map f (rev (sort_key f xs)))
[PROOF STEP]
using sorted_descending
[PROOF STATE]
proof (prove)
using this:
sorted_descending (rev ?xs) = sorted ?xs

goal (1 subgoal):
 1. sorted_descending (map f (rev (sort_key f xs)))
[PROOF STEP]
by (metis rev_map sorted_sort_key)


[STATEMENT]
lemma e_geom_series:
  assumes "b \<ge> 2"
  shows "(E q b = e) \<longleftrightarrow> ((b-1) * e = b^(Suc q) - 1 )" (is "?P \<longleftrightarrow> ?Q")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (E q b = e) = ((b - 1) * e = b ^ Suc q - 1)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (E q b = e) = ((b - 1) * e = b ^ Suc q - 1)
[PROOF STEP]
have "sum ((^) (int b)) {..<Suc q} = sum ((^) b) {0..q}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum ((^) (int b)) {..<Suc q} = int (sum ((^) b) {0..q})
[PROOF STEP]
by (simp add: atLeast0AtMost lessThan_Suc_atMost)
[PROOF STATE]
proof (state)
this:
sum ((^) (int b)) {..<Suc q} = int (sum ((^) b) {0..q})

goal (1 subgoal):
 1. (E q b = e) = ((b - 1) * e = b ^ Suc q - 1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
sum ((^) (int b)) {..<Suc q} = int (sum ((^) b) {0..q})
[PROOF STEP]
have "(int b - 1) *  (E q b) = int b ^ Suc q - 1"
[PROOF STATE]
proof (prove)
using this:
sum ((^) (int b)) {..<Suc q} = int (sum ((^) b) {0..q})

goal (1 subgoal):
 1. (int b - 1) * int (E q b) = int b ^ Suc q - 1
[PROOF STEP]
using E_def
[PROOF STATE]
proof (prove)
using this:
sum ((^) (int b)) {..<Suc q} = int (sum ((^) b) {0..q})
E ?q ?b = sum ((^) ?b) {0..?q}

goal (1 subgoal):
 1. (int b - 1) * int (E q b) = int b ^ Suc q - 1
[PROOF STEP]
by (metis power_diff_1_eq)
[PROOF STATE]
proof (state)
this:
(int b - 1) * int (E q b) = int b ^ Suc q - 1

goal (1 subgoal):
 1. (E q b = e) = ((b - 1) * e = b ^ Suc q - 1)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(int b - 1) * int (E q b) = int b ^ Suc q - 1

goal (1 subgoal):
 1. (E q b = e) = ((b - 1) * e = b ^ Suc q - 1)
[PROOF STEP]
have "int b ^ Suc q - 1 =  b ^ (Suc q) - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int b ^ Suc q - 1 = int (b ^ Suc q - 1)
[PROOF STEP]
using one_le_power[of "int b" "Suc q"] assms
[PROOF STATE]
proof (prove)
using this:
1 \<le> int b \<Longrightarrow> 1 \<le> int b ^ Suc q
2 \<le> b

goal (1 subgoal):
 1. int b ^ Suc q - 1 = int (b ^ Suc q - 1)
[PROOF STEP]
by (simp add: of_nat_diff)
[PROOF STATE]
proof (state)
this:
int b ^ Suc q - 1 = int (b ^ Suc q - 1)

goal (1 subgoal):
 1. (E q b = e) = ((b - 1) * e = b ^ Suc q - 1)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
int b ^ Suc q - 1 = int (b ^ Suc q - 1)

goal (1 subgoal):
 1. (E q b = e) = ((b - 1) * e = b ^ Suc q - 1)
[PROOF STEP]
have "int b - 1 = b - 1 "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int b - 1 = int (b - 1)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
2 \<le> b

goal (1 subgoal):
 1. int b - 1 = int (b - 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
int b - 1 = int (b - 1)

goal (1 subgoal):
 1. (E q b = e) = ((b - 1) * e = b ^ Suc q - 1)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(int b - 1) * int (E q b) = int b ^ Suc q - 1
int b ^ Suc q - 1 = int (b ^ Suc q - 1)
int b - 1 = int (b - 1)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(int b - 1) * int (E q b) = int b ^ Suc q - 1
int b ^ Suc q - 1 = int (b ^ Suc q - 1)
int b - 1 = int (b - 1)

goal (1 subgoal):
 1. (E q b = e) = ((b - 1) * e = b ^ Suc q - 1)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(int b - 1) * int (E q b) = int b ^ Suc q - 1
int b ^ Suc q - 1 = int (b ^ Suc q - 1)
int b - 1 = int (b - 1)
2 \<le> b

goal (1 subgoal):
 1. (E q b = e) = ((b - 1) * e = b ^ Suc q - 1)
[PROOF STEP]
by (metis Suc_1 Suc_diff_le Zero_not_Suc diff_Suc_Suc int_ops(7) mult_cancel_left of_nat_eq_iff)
[PROOF STATE]
proof (state)
this:
(E q b = e) = ((b - 1) * e = b ^ Suc q - 1)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tminus_less:
  "\<lbrakk> 0 \<le> a; 0 \<le> b \<rbrakk> \<Longrightarrow> a \<ominus> b \<le> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> a; 0 \<le> b\<rbrakk> \<Longrightarrow> a \<ominus> b \<le> a
[PROOF STEP]
unfolding tminus_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> a; 0 \<le> b\<rbrakk> \<Longrightarrow> max (a - b) 0 \<le> a
[PROOF STEP]
by(force)


[STATEMENT]
lemma span_Un: "span (S \<union> T) = {x + y | x y. x \<in> span S \<and> y \<in> span T}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. span (S \<union> T) = {x + y |x y. x \<in> span S \<and> y \<in> span T}
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> span (S \<union> T) \<Longrightarrow> \<exists>xa y. x = xa + y \<and> xa \<in> span S \<and> y \<in> span T
 2. \<And>x xa y. \<lbrakk>xa \<in> span S; y \<in> span T\<rbrakk> \<Longrightarrow> xa + y \<in> span (S \<union> T)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> span (S \<union> T) \<Longrightarrow> \<exists>xa y. x = xa + y \<and> xa \<in> span S \<and> y \<in> span T
 2. \<And>x xa y. \<lbrakk>xa \<in> span S; y \<in> span T\<rbrakk> \<Longrightarrow> xa + y \<in> span (S \<union> T)
[PROOF STEP]
assume "x \<in> span (S \<union> T)"
[PROOF STATE]
proof (state)
this:
x \<in> span (S \<union> T)

goal (2 subgoals):
 1. \<And>x. x \<in> span (S \<union> T) \<Longrightarrow> \<exists>xa y. x = xa + y \<and> xa \<in> span S \<and> y \<in> span T
 2. \<And>x xa y. \<lbrakk>xa \<in> span S; y \<in> span T\<rbrakk> \<Longrightarrow> xa + y \<in> span (S \<union> T)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> span (S \<union> T)
[PROOF STEP]
obtain t r where t: "finite t" "t \<subseteq> S \<union> T" and x: "x = (\<Sum>a\<in>t. r a *s a)"
[PROOF STATE]
proof (prove)
using this:
x \<in> span (S \<union> T)

goal (1 subgoal):
 1. (\<And>t r. \<lbrakk>finite t; t \<subseteq> S \<union> T; x = (\<Sum>a\<in>t. r a *s a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: span_explicit)
[PROOF STATE]
proof (state)
this:
finite t
t \<subseteq> S \<union> T
x = (\<Sum>a\<in>t. r a *s a)

goal (2 subgoals):
 1. \<And>x. x \<in> span (S \<union> T) \<Longrightarrow> \<exists>xa y. x = xa + y \<and> xa \<in> span S \<and> y \<in> span T
 2. \<And>x xa y. \<lbrakk>xa \<in> span S; y \<in> span T\<rbrakk> \<Longrightarrow> xa + y \<in> span (S \<union> T)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite t
t \<subseteq> S \<union> T
x = (\<Sum>a\<in>t. r a *s a)

goal (2 subgoals):
 1. \<And>x. x \<in> span (S \<union> T) \<Longrightarrow> \<exists>xa y. x = xa + y \<and> xa \<in> span S \<and> y \<in> span T
 2. \<And>x xa y. \<lbrakk>xa \<in> span S; y \<in> span T\<rbrakk> \<Longrightarrow> xa + y \<in> span (S \<union> T)
[PROOF STEP]
have "t \<inter> S \<union> (t - S) = t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t \<inter> S \<union> (t - S) = t
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
t \<inter> S \<union> (t - S) = t

goal (2 subgoals):
 1. \<And>x. x \<in> span (S \<union> T) \<Longrightarrow> \<exists>xa y. x = xa + y \<and> xa \<in> span S \<and> y \<in> span T
 2. \<And>x xa y. \<lbrakk>xa \<in> span S; y \<in> span T\<rbrakk> \<Longrightarrow> xa + y \<in> span (S \<union> T)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
finite t
t \<subseteq> S \<union> T
x = (\<Sum>a\<in>t. r a *s a)
t \<inter> S \<union> (t - S) = t
[PROOF STEP]
show "\<exists>xa y. x = xa + y \<and> xa \<in> span S \<and> y \<in> span T"
[PROOF STATE]
proof (prove)
using this:
finite t
t \<subseteq> S \<union> T
x = (\<Sum>a\<in>t. r a *s a)
t \<inter> S \<union> (t - S) = t

goal (1 subgoal):
 1. \<exists>xa y. x = xa + y \<and> xa \<in> span S \<and> y \<in> span T
[PROOF STEP]
unfolding x
[PROOF STATE]
proof (prove)
using this:
finite t
t \<subseteq> S \<union> T
(\<Sum>a\<in>t. r a *s a) = (\<Sum>a\<in>t. r a *s a)
t \<inter> S \<union> (t - S) = t

goal (1 subgoal):
 1. \<exists>xa y. (\<Sum>a\<in>t. r a *s a) = xa + y \<and> xa \<in> span S \<and> y \<in> span T
[PROOF STEP]
apply (rule_tac exI[of _ "\<Sum>a\<in>t \<inter> S. r a *s a"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite t; t \<subseteq> S \<union> T; (\<Sum>a\<in>t. r a *s a) = (\<Sum>a\<in>t. r a *s a); t \<inter> S \<union> (t - S) = t\<rbrakk> \<Longrightarrow> \<exists>y. (\<Sum>a\<in>t. r a *s a) = (\<Sum>a\<in>t \<inter> S. r a *s a) + y \<and> (\<Sum>a\<in>t \<inter> S. r a *s a) \<in> span S \<and> y \<in> span T
[PROOF STEP]
apply (rule_tac exI[of _ "\<Sum>a\<in>t - S. r a *s a"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite t; t \<subseteq> S \<union> T; (\<Sum>a\<in>t. r a *s a) = (\<Sum>a\<in>t. r a *s a); t \<inter> S \<union> (t - S) = t\<rbrakk> \<Longrightarrow> (\<Sum>a\<in>t. r a *s a) = (\<Sum>a\<in>t \<inter> S. r a *s a) + (\<Sum>a\<in>t - S. r a *s a) \<and> (\<Sum>a\<in>t \<inter> S. r a *s a) \<in> span S \<and> (\<Sum>a\<in>t - S. r a *s a) \<in> span T
[PROOF STEP]
apply (subst sum.union_inter_neutral[symmetric])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<lbrakk>finite t; t \<subseteq> S \<union> T; (\<Sum>a\<in>t. r a *s a) = (\<Sum>a\<in>t. r a *s a); t \<inter> S \<union> (t - S) = t\<rbrakk> \<Longrightarrow> finite (t \<inter> S)
 2. \<lbrakk>finite t; t \<subseteq> S \<union> T; (\<Sum>a\<in>t. r a *s a) = (\<Sum>a\<in>t. r a *s a); t \<inter> S \<union> (t - S) = t\<rbrakk> \<Longrightarrow> finite (t - S)
 3. \<lbrakk>finite t; t \<subseteq> S \<union> T; (\<Sum>a\<in>t. r a *s a) = (\<Sum>a\<in>t. r a *s a); t \<inter> S \<union> (t - S) = t\<rbrakk> \<Longrightarrow> \<forall>x\<in>t \<inter> S \<inter> (t - S). r x *s x = (0::'b)
 4. \<lbrakk>finite t; t \<subseteq> S \<union> T; (\<Sum>a\<in>t. r a *s a) = (\<Sum>a\<in>t. r a *s a); t \<inter> S \<union> (t - S) = t\<rbrakk> \<Longrightarrow> (\<Sum>a\<in>t. r a *s a) = (\<Sum>a\<in>t \<inter> S \<union> (t - S). r a *s a) \<and> (\<Sum>a\<in>t \<inter> S. r a *s a) \<in> span S \<and> (\<Sum>a\<in>t - S. r a *s a) \<in> span T
[PROOF STEP]
apply (auto intro!: span_sum span_scale intro: span_base)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<exists>xa y. x = xa + y \<and> xa \<in> span S \<and> y \<in> span T

goal (1 subgoal):
 1. \<And>x xa y. \<lbrakk>xa \<in> span S; y \<in> span T\<rbrakk> \<Longrightarrow> xa + y \<in> span (S \<union> T)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xa y. \<lbrakk>xa \<in> span S; y \<in> span T\<rbrakk> \<Longrightarrow> xa + y \<in> span (S \<union> T)
[PROOF STEP]
fix x y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xa y. \<lbrakk>xa \<in> span S; y \<in> span T\<rbrakk> \<Longrightarrow> xa + y \<in> span (S \<union> T)
[PROOF STEP]
assume"x \<in> span S" "y \<in> span T"
[PROOF STATE]
proof (state)
this:
x \<in> span S
y \<in> span T

goal (1 subgoal):
 1. \<And>x xa y. \<lbrakk>xa \<in> span S; y \<in> span T\<rbrakk> \<Longrightarrow> xa + y \<in> span (S \<union> T)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> span S
y \<in> span T
[PROOF STEP]
show "x + y \<in> span (S \<union> T)"
[PROOF STATE]
proof (prove)
using this:
x \<in> span S
y \<in> span T

goal (1 subgoal):
 1. x + y \<in> span (S \<union> T)
[PROOF STEP]
using span_mono[of S "S \<union> T"] span_mono[of T "S \<union> T"]
[PROOF STATE]
proof (prove)
using this:
x \<in> span S
y \<in> span T
S \<subseteq> S \<union> T \<Longrightarrow> span S \<subseteq> span (S \<union> T)
T \<subseteq> S \<union> T \<Longrightarrow> span T \<subseteq> span (S \<union> T)

goal (1 subgoal):
 1. x + y \<in> span (S \<union> T)
[PROOF STEP]
by (auto intro!: span_add)
[PROOF STATE]
proof (state)
this:
x + y \<in> span (S \<union> T)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in idom_char_0) degree_unique:
  assumes pq: "poly p = poly q"
  shows "degree p = degree q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree p = degree q
[PROOF STEP]
using pnormalize_unique[OF pq]
[PROOF STATE]
proof (prove)
using this:
pnormalize p = pnormalize q

goal (1 subgoal):
 1. degree p = degree q
[PROOF STEP]
unfolding degree_def
[PROOF STATE]
proof (prove)
using this:
pnormalize p = pnormalize q

goal (1 subgoal):
 1. length (pnormalize p) - 1 = length (pnormalize q) - 1
[PROOF STEP]
by simp


[STATEMENT]
theorem psubstt_id:
  fixes t :: \<open>'a term\<close> and ts :: \<open>'a term list\<close>
  shows \<open>psubstt id t = t\<close> and \<open>psubstts (\<lambda>x. x) ts = ts\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. psubstt id t = t &&& psubstts (\<lambda>x. x) ts = ts
[PROOF STEP]
by (induct t and ts rule: psubstt.induct psubstts.induct) simp_all


[STATEMENT]
lemma Always_Int_I:
     "[| F \<in> Always A;  F \<in> Always B |] ==> F \<in> Always (A \<inter> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>F \<in> Always A; F \<in> Always B\<rbrakk> \<Longrightarrow> F \<in> Always (A \<inter> B)
[PROOF STEP]
by (simp add: Always_Int_distrib)


[STATEMENT]
lemma RECT_gfp_def: "RECT B x =
  (if (trimono B) then (gfp B x) else (top::'a::complete_lattice))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. REC\<^sub>T B x = (if trimono B then gfp B x else top)
[PROOF STEP]
unfolding RECT_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if trimono B then flatf_gfp B x else top) = (if trimono B then gfp B x else top)
[PROOF STEP]
by (auto simp: gfp_eq_flatf_gfp[OF trimonoD_flatf_ge trimonoD_mono])


[STATEMENT]
lemma (in aGroup) pOp_assoc_cancel:"\<lbrakk>a \<in> carrier A; b \<in> carrier A;
 c \<in> carrier A\<rbrakk> \<Longrightarrow> a \<plusminus> -\<^sub>a b \<plusminus> (b \<plusminus> -\<^sub>a c) = a \<plusminus> -\<^sub>a c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier A; b \<in> carrier A; c \<in> carrier A\<rbrakk> \<Longrightarrow> a \<plusminus> -\<^sub>a b \<plusminus> (b \<plusminus> -\<^sub>a c) = a \<plusminus> -\<^sub>a c
[PROOF STEP]
apply (subst pOp_assocTr43, assumption)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<lbrakk>a \<in> carrier A; b \<in> carrier A; c \<in> carrier A\<rbrakk> \<Longrightarrow> -\<^sub>a b \<in> carrier A
 2. \<lbrakk>a \<in> carrier A; b \<in> carrier A; c \<in> carrier A\<rbrakk> \<Longrightarrow> b \<in> carrier A
 3. \<lbrakk>a \<in> carrier A; b \<in> carrier A; c \<in> carrier A\<rbrakk> \<Longrightarrow> -\<^sub>a c \<in> carrier A
 4. \<lbrakk>a \<in> carrier A; b \<in> carrier A; c \<in> carrier A\<rbrakk> \<Longrightarrow> a \<plusminus> (-\<^sub>a b \<plusminus> b) \<plusminus> -\<^sub>a c = a \<plusminus> -\<^sub>a c
[PROOF STEP]
apply (simp add:ag_l_inv1 ag_mOp_closed)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier A; b \<in> carrier A; c \<in> carrier A\<rbrakk> \<Longrightarrow> a \<plusminus> \<zero> \<plusminus> -\<^sub>a c = a \<plusminus> -\<^sub>a c
[PROOF STEP]
apply (simp add:ag_r_zero)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma butlast_subset:
  "xs \<noteq> [] \<Longrightarrow> set xs \<subseteq> A \<Longrightarrow> set (butlast xs) \<subseteq> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>xs \<noteq> []; set xs \<subseteq> A\<rbrakk> \<Longrightarrow> set (butlast xs) \<subseteq> A
[PROOF STEP]
by (metis in_set_butlastD rev_subsetD subsetI)


[STATEMENT]
lemma convergent_prod_imp_LIMSEQ:
  fixes f :: "nat \<Rightarrow> 'a :: {real_normed_field}"
  assumes "convergent_prod f"
  shows   "f \<longlonglongrightarrow> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<longlonglongrightarrow> (1::'a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f \<longlonglongrightarrow> (1::'a)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
convergent_prod f
[PROOF STEP]
obtain M L where L: "(\<lambda>n. \<Prod>i\<le>n. f (i+M)) \<longlonglongrightarrow> L" "\<And>n. n \<ge> M \<Longrightarrow> f n \<noteq> 0" "L \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
convergent_prod f

goal (1 subgoal):
 1. (\<And>M L. \<lbrakk>(\<lambda>n. \<Prod>i\<le>n. f (i + M)) \<longlonglongrightarrow> L; \<And>n. M \<le> n \<Longrightarrow> f n \<noteq> (0::'a); L \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: convergent_prod_altdef)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. \<Prod>i\<le>n. f (i + M)) \<longlonglongrightarrow> L
M \<le> ?n \<Longrightarrow> f ?n \<noteq> (0::'a)
L \<noteq> (0::'a)

goal (1 subgoal):
 1. f \<longlonglongrightarrow> (1::'a)
[PROOF STEP]
hence L': "(\<lambda>n. \<Prod>i\<le>Suc n. f (i+M)) \<longlonglongrightarrow> L"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. \<Prod>i\<le>n. f (i + M)) \<longlonglongrightarrow> L
M \<le> ?n \<Longrightarrow> f ?n \<noteq> (0::'a)
L \<noteq> (0::'a)

goal (1 subgoal):
 1. (\<lambda>n. \<Prod>i\<le>Suc n. f (i + M)) \<longlonglongrightarrow> L
[PROOF STEP]
by (subst filterlim_sequentially_Suc)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. \<Prod>i\<le>Suc n. f (i + M)) \<longlonglongrightarrow> L

goal (1 subgoal):
 1. f \<longlonglongrightarrow> (1::'a)
[PROOF STEP]
have "(\<lambda>n. (\<Prod>i\<le>Suc n. f (i+M)) / (\<Prod>i\<le>n. f (i+M))) \<longlonglongrightarrow> L / L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. (\<Prod>i\<le>Suc n. f (i + M)) / (\<Prod>i\<le>n. f (i + M))) \<longlonglongrightarrow> L / L
[PROOF STEP]
using L L'
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. \<Prod>i\<le>n. f (i + M)) \<longlonglongrightarrow> L
M \<le> ?n \<Longrightarrow> f ?n \<noteq> (0::'a)
L \<noteq> (0::'a)
(\<lambda>n. \<Prod>i\<le>Suc n. f (i + M)) \<longlonglongrightarrow> L

goal (1 subgoal):
 1. (\<lambda>n. (\<Prod>i\<le>Suc n. f (i + M)) / (\<Prod>i\<le>n. f (i + M))) \<longlonglongrightarrow> L / L
[PROOF STEP]
by (intro tendsto_divide) simp_all
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (\<Prod>i\<le>Suc n. f (i + M)) / (\<Prod>i\<le>n. f (i + M))) \<longlonglongrightarrow> L / L

goal (1 subgoal):
 1. f \<longlonglongrightarrow> (1::'a)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (\<Prod>i\<le>Suc n. f (i + M)) / (\<Prod>i\<le>n. f (i + M))) \<longlonglongrightarrow> L / L

goal (1 subgoal):
 1. f \<longlonglongrightarrow> (1::'a)
[PROOF STEP]
from L
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. \<Prod>i\<le>n. f (i + M)) \<longlonglongrightarrow> L
M \<le> ?n \<Longrightarrow> f ?n \<noteq> (0::'a)
L \<noteq> (0::'a)
[PROOF STEP]
have "L / L = 1"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. \<Prod>i\<le>n. f (i + M)) \<longlonglongrightarrow> L
M \<le> ?n \<Longrightarrow> f ?n \<noteq> (0::'a)
L \<noteq> (0::'a)

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

goal (1 subgoal):
 1. f \<longlonglongrightarrow> (1::'a)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
L / L = (1::'a)

goal (1 subgoal):
 1. f \<longlonglongrightarrow> (1::'a)
[PROOF STEP]
have "(\<lambda>n. (\<Prod>i\<le>Suc n. f (i+M)) / (\<Prod>i\<le>n. f (i+M))) = (\<lambda>n. f (n + Suc M))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. (\<Prod>i\<le>Suc n. f (i + M)) / (\<Prod>i\<le>n. f (i + M))) = (\<lambda>n. f (n + Suc M))
[PROOF STEP]
using assms L
[PROOF STATE]
proof (prove)
using this:
convergent_prod f
(\<lambda>n. \<Prod>i\<le>n. f (i + M)) \<longlonglongrightarrow> L
M \<le> ?n \<Longrightarrow> f ?n \<noteq> (0::'a)
L \<noteq> (0::'a)

goal (1 subgoal):
 1. (\<lambda>n. (\<Prod>i\<le>Suc n. f (i + M)) / (\<Prod>i\<le>n. f (i + M))) = (\<lambda>n. f (n + Suc M))
[PROOF STEP]
by (auto simp: fun_eq_iff atMost_Suc)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (\<Prod>i\<le>Suc n. f (i + M)) / (\<Prod>i\<le>n. f (i + M))) = (\<lambda>n. f (n + Suc M))

goal (1 subgoal):
 1. f \<longlonglongrightarrow> (1::'a)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. f (n + Suc M)) \<longlonglongrightarrow> (1::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. f (n + Suc M)) \<longlonglongrightarrow> (1::'a)

goal (1 subgoal):
 1. f \<longlonglongrightarrow> (1::'a)
[PROOF STEP]
by (rule LIMSEQ_offset)
[PROOF STATE]
proof (state)
this:
f \<longlonglongrightarrow> (1::'a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bigo_const_mult1: "(\<lambda>x. c * f x) \<in> O(f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. c * f x) \<in> O(f)
[PROOF STEP]
apply (simp add: bigo_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>ca. \<forall>x. \<bar>c * f x\<bar> \<le> ca * \<bar>f x\<bar>
[PROOF STEP]
apply (rule_tac x = "\<bar>c\<bar>" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. \<bar>c * f x\<bar> \<le> \<bar>c\<bar> * \<bar>f x\<bar>
[PROOF STEP]
apply (auto simp flip: abs_mult)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma srsteps_funas_l:
  assumes "ground_sys \<R>"
   and  "(s, t) \<in> (srstep \<F> \<R>)\<^sup>+"
  shows "funas_term t \<subseteq> funas_term s \<union> funas_rel \<R>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. funas_term t \<subseteq> funas_term s \<union> funas_rel \<R>
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
(s, t) \<in> (srstep \<F> \<R>)\<^sup>+

goal (1 subgoal):
 1. funas_term t \<subseteq> funas_term s \<union> funas_rel \<R>
[PROOF STEP]
by (induct rule: converse_trancl_induct) (auto dest: srstep_funas_l[OF assms(1)])


[STATEMENT]
lemma pos_poly_total: "p = 0 \<or> pos_poly p \<or> pos_poly (- p)"
  for p :: "'a::linordered_idom poly"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p = 0 \<or> pos_poly p \<or> pos_poly (- p)
[PROOF STEP]
by (induct p) (auto simp: pos_poly_pCons)


[STATEMENT]
lemma v_0_AE: "cfg \<in> valid_cfg \<Longrightarrow> v cfg = 0 \<longleftrightarrow> (AE x in T cfg. not (HLD S1 suntil HLD S2) (state cfg ## x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cfg \<in> valid_cfg \<Longrightarrow> (v cfg = 0) = (AE x in T cfg. \<not> (HLD S1 suntil HLD S2) (state cfg ## x))
[PROOF STEP]
unfolding v_eq T.emeasure_eq_measure space_T[symmetric, of cfg] ennreal_eq_zero_iff[OF measure_nonneg]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cfg \<in> valid_cfg \<Longrightarrow> (T.prob cfg {x \<in> space (T cfg). (HLD S1 suntil HLD S2) (state cfg ## x)} = 0) = (AE x in T cfg. \<not> (HLD S1 suntil HLD S2) (state cfg ## x))
[PROOF STEP]
by (rule T.prob_Collect_eq_0) simp