[STATEMENT]
lemma listset_mono:
  assumes "length xs = length ys" and "\<And>i. i < length ys \<Longrightarrow> xs ! i \<subseteq> ys ! i"
  shows "listset xs \<subseteq> listset ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. listset xs \<subseteq> listset ys
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
length xs = length ys
?i < length ys \<Longrightarrow> xs ! ?i \<subseteq> ys ! ?i

goal (1 subgoal):
 1. listset xs \<subseteq> listset ys
[PROOF STEP]
proof (induct xs ys rule: list_induct2)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<And>i. i < length [] \<Longrightarrow> [] ! i \<subseteq> [] ! i) \<Longrightarrow> listset [] \<subseteq> listset []
 2. \<And>x xs y ys. \<lbrakk>length xs = length ys; (\<And>i. i < length ys \<Longrightarrow> xs ! i \<subseteq> ys ! i) \<Longrightarrow> listset xs \<subseteq> listset ys; \<And>i. i < length (y # ys) \<Longrightarrow> (x # xs) ! i \<subseteq> (y # ys) ! i\<rbrakk> \<Longrightarrow> listset (x # xs) \<subseteq> listset (y # ys)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
?i < length [] \<Longrightarrow> [] ! ?i \<subseteq> [] ! ?i

goal (2 subgoals):
 1. (\<And>i. i < length [] \<Longrightarrow> [] ! i \<subseteq> [] ! i) \<Longrightarrow> listset [] \<subseteq> listset []
 2. \<And>x xs y ys. \<lbrakk>length xs = length ys; (\<And>i. i < length ys \<Longrightarrow> xs ! i \<subseteq> ys ! i) \<Longrightarrow> listset xs \<subseteq> listset ys; \<And>i. i < length (y # ys) \<Longrightarrow> (x # xs) ! i \<subseteq> (y # ys) ! i\<rbrakk> \<Longrightarrow> listset (x # xs) \<subseteq> listset (y # ys)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. listset [] \<subseteq> listset []
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
listset [] \<subseteq> listset []

goal (1 subgoal):
 1. \<And>x xs y ys. \<lbrakk>length xs = length ys; (\<And>i. i < length ys \<Longrightarrow> xs ! i \<subseteq> ys ! i) \<Longrightarrow> listset xs \<subseteq> listset ys; \<And>i. i < length (y # ys) \<Longrightarrow> (x # xs) ! i \<subseteq> (y # ys) ! i\<rbrakk> \<Longrightarrow> listset (x # xs) \<subseteq> listset (y # ys)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xs y ys. \<lbrakk>length xs = length ys; (\<And>i. i < length ys \<Longrightarrow> xs ! i \<subseteq> ys ! i) \<Longrightarrow> listset xs \<subseteq> listset ys; \<And>i. i < length (y # ys) \<Longrightarrow> (x # xs) ! i \<subseteq> (y # ys) ! i\<rbrakk> \<Longrightarrow> listset (x # xs) \<subseteq> listset (y # ys)
[PROOF STEP]
case (Cons x xs y ys)
[PROOF STATE]
proof (state)
this:
length xs = length ys
(\<And>i. i < length ys \<Longrightarrow> xs ! i \<subseteq> ys ! i) \<Longrightarrow> listset xs \<subseteq> listset ys
?i < length (y # ys) \<Longrightarrow> (x # xs) ! ?i \<subseteq> (y # ys) ! ?i

goal (1 subgoal):
 1. \<And>x xs y ys. \<lbrakk>length xs = length ys; (\<And>i. i < length ys \<Longrightarrow> xs ! i \<subseteq> ys ! i) \<Longrightarrow> listset xs \<subseteq> listset ys; \<And>i. i < length (y # ys) \<Longrightarrow> (x # xs) ! i \<subseteq> (y # ys) ! i\<rbrakk> \<Longrightarrow> listset (x # xs) \<subseteq> listset (y # ys)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. listset (x # xs) \<subseteq> listset (y # ys)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. xa \<in> listset (x # xs) \<Longrightarrow> xa \<in> listset (y # ys)
[PROOF STEP]
fix zs'
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. xa \<in> listset (x # xs) \<Longrightarrow> xa \<in> listset (y # ys)
[PROOF STEP]
assume "zs' \<in> listset (x # xs)"
[PROOF STATE]
proof (state)
this:
zs' \<in> listset (x # xs)

goal (1 subgoal):
 1. \<And>xa. xa \<in> listset (x # xs) \<Longrightarrow> xa \<in> listset (y # ys)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
zs' \<in> listset (x # xs)
[PROOF STEP]
obtain z zs where "z \<in> x" and zs: "zs \<in> listset xs" and zs': "zs' = z # zs"
[PROOF STATE]
proof (prove)
using this:
zs' \<in> listset (x # xs)

goal (1 subgoal):
 1. (\<And>z zs. \<lbrakk>z \<in> x; zs \<in> listset xs; zs' = z # zs\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (rule listset_ConsE)
[PROOF STATE]
proof (state)
this:
z \<in> x
zs \<in> listset xs
zs' = z # zs

goal (1 subgoal):
 1. \<And>xa. xa \<in> listset (x # xs) \<Longrightarrow> xa \<in> listset (y # ys)
[PROOF STEP]
have "0 < length (y # ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < length (y # ys)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < length (y # ys)

goal (1 subgoal):
 1. \<And>xa. xa \<in> listset (x # xs) \<Longrightarrow> xa \<in> listset (y # ys)
[PROOF STEP]
hence "(x # xs) ! 0 \<subseteq> (y # ys) ! 0"
[PROOF STATE]
proof (prove)
using this:
0 < length (y # ys)

goal (1 subgoal):
 1. (x # xs) ! 0 \<subseteq> (y # ys) ! 0
[PROOF STEP]
by (rule Cons.prems)
[PROOF STATE]
proof (state)
this:
(x # xs) ! 0 \<subseteq> (y # ys) ! 0

goal (1 subgoal):
 1. \<And>xa. xa \<in> listset (x # xs) \<Longrightarrow> xa \<in> listset (y # ys)
[PROOF STEP]
hence "x \<subseteq> y"
[PROOF STATE]
proof (prove)
using this:
(x # xs) ! 0 \<subseteq> (y # ys) ! 0

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

goal (1 subgoal):
 1. \<And>xa. xa \<in> listset (x # xs) \<Longrightarrow> xa \<in> listset (y # ys)
[PROOF STEP]
with \<open>z \<in> x\<close>
[PROOF STATE]
proof (chain)
picking this:
z \<in> x
x \<subseteq> y
[PROOF STEP]
have "z \<in> y"
[PROOF STATE]
proof (prove)
using this:
z \<in> x
x \<subseteq> y

goal (1 subgoal):
 1. z \<in> y
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
z \<in> y

goal (1 subgoal):
 1. \<And>xa. xa \<in> listset (x # xs) \<Longrightarrow> xa \<in> listset (y # ys)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
z \<in> y

goal (1 subgoal):
 1. \<And>xa. xa \<in> listset (x # xs) \<Longrightarrow> xa \<in> listset (y # ys)
[PROOF STEP]
from zs
[PROOF STATE]
proof (chain)
picking this:
zs \<in> listset xs
[PROOF STEP]
have "zs \<in> listset ys"
[PROOF STATE]
proof (prove)
using this:
zs \<in> listset xs

goal (1 subgoal):
 1. zs \<in> listset ys
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. listset xs \<subseteq> listset ys
[PROOF STEP]
show "listset xs \<subseteq> listset ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. listset xs \<subseteq> listset ys
[PROOF STEP]
proof (rule Cons.hyps)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < length ys \<Longrightarrow> xs ! i \<subseteq> ys ! i
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < length ys \<Longrightarrow> xs ! i \<subseteq> ys ! i
[PROOF STEP]
assume "i < length ys"
[PROOF STATE]
proof (state)
this:
i < length ys

goal (1 subgoal):
 1. \<And>i. i < length ys \<Longrightarrow> xs ! i \<subseteq> ys ! i
[PROOF STEP]
hence "Suc i < length (y # ys)"
[PROOF STATE]
proof (prove)
using this:
i < length ys

goal (1 subgoal):
 1. Suc i < length (y # ys)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Suc i < length (y # ys)

goal (1 subgoal):
 1. \<And>i. i < length ys \<Longrightarrow> xs ! i \<subseteq> ys ! i
[PROOF STEP]
hence "(x # xs) ! Suc i \<subseteq> (y # ys) ! Suc i"
[PROOF STATE]
proof (prove)
using this:
Suc i < length (y # ys)

goal (1 subgoal):
 1. (x # xs) ! Suc i \<subseteq> (y # ys) ! Suc i
[PROOF STEP]
by (rule Cons.prems)
[PROOF STATE]
proof (state)
this:
(x # xs) ! Suc i \<subseteq> (y # ys) ! Suc i

goal (1 subgoal):
 1. \<And>i. i < length ys \<Longrightarrow> xs ! i \<subseteq> ys ! i
[PROOF STEP]
thus "xs ! i \<subseteq> ys ! i"
[PROOF STATE]
proof (prove)
using this:
(x # xs) ! Suc i \<subseteq> (y # ys) ! Suc i

goal (1 subgoal):
 1. xs ! i \<subseteq> ys ! i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
xs ! i \<subseteq> ys ! i

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
listset xs \<subseteq> listset ys

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
zs \<in> listset ys

goal (1 subgoal):
 1. \<And>xa. xa \<in> listset (x # xs) \<Longrightarrow> xa \<in> listset (y # ys)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
z \<in> y
zs \<in> listset ys
[PROOF STEP]
show "zs' \<in> listset (y # ys)"
[PROOF STATE]
proof (prove)
using this:
z \<in> y
zs \<in> listset ys

goal (1 subgoal):
 1. zs' \<in> listset (y # ys)
[PROOF STEP]
using zs'
[PROOF STATE]
proof (prove)
using this:
z \<in> y
zs \<in> listset ys
zs' = z # zs

goal (1 subgoal):
 1. zs' \<in> listset (y # ys)
[PROOF STEP]
by (rule listset_ConsI)
[PROOF STATE]
proof (state)
this:
zs' \<in> listset (y # ys)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
listset (x # xs) \<subseteq> listset (y # ys)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma complete_UNIV: "complete (UNIV :: ('a::complete_space) set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. complete UNIV
[PROOF STEP]
proof (rule completeI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f. \<lbrakk>\<forall>n. f n \<in> UNIV; Cauchy f\<rbrakk> \<Longrightarrow> \<exists>l\<in>UNIV. f \<longlonglongrightarrow> l
[PROOF STEP]
fix f :: "nat \<Rightarrow> 'a"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f. \<lbrakk>\<forall>n. f n \<in> UNIV; Cauchy f\<rbrakk> \<Longrightarrow> \<exists>l\<in>UNIV. f \<longlonglongrightarrow> l
[PROOF STEP]
assume "Cauchy f"
[PROOF STATE]
proof (state)
this:
Cauchy f

goal (1 subgoal):
 1. \<And>f. \<lbrakk>\<forall>n. f n \<in> UNIV; Cauchy f\<rbrakk> \<Longrightarrow> \<exists>l\<in>UNIV. f \<longlonglongrightarrow> l
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Cauchy f
[PROOF STEP]
have "convergent f"
[PROOF STATE]
proof (prove)
using this:
Cauchy f

goal (1 subgoal):
 1. convergent f
[PROOF STEP]
by (rule Cauchy_convergent)
[PROOF STATE]
proof (state)
this:
convergent f

goal (1 subgoal):
 1. \<And>f. \<lbrakk>\<forall>n. f n \<in> UNIV; Cauchy f\<rbrakk> \<Longrightarrow> \<exists>l\<in>UNIV. f \<longlonglongrightarrow> l
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
convergent f
[PROOF STEP]
show "\<exists>l\<in>UNIV. f \<longlonglongrightarrow> l"
[PROOF STATE]
proof (prove)
using this:
convergent f

goal (1 subgoal):
 1. \<exists>l\<in>UNIV. f \<longlonglongrightarrow> l
[PROOF STEP]
unfolding convergent_def
[PROOF STATE]
proof (prove)
using this:
\<exists>L. f \<longlonglongrightarrow> L

goal (1 subgoal):
 1. \<exists>l\<in>UNIV. f \<longlonglongrightarrow> l
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<exists>l\<in>UNIV. f \<longlonglongrightarrow> l

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma map_of_append[simp]: "map_of (xs @ ys) = map_of ys ++ map_of xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_of (xs @ ys) = map_of ys ++ map_of xs
[PROOF STEP]
unfolding map_add_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_of (xs @ ys) = (\<lambda>x. case map_of xs x of None \<Rightarrow> map_of ys x | Some x \<Rightarrow> Some x)
[PROOF STEP]
proof (induct xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. map_of ([] @ ys) = (\<lambda>x. case map_of [] x of None \<Rightarrow> map_of ys x | Some a \<Rightarrow> Some a)
 2. \<And>a xs. map_of (xs @ ys) = (\<lambda>x. case map_of xs x of None \<Rightarrow> map_of ys x | Some a \<Rightarrow> Some a) \<Longrightarrow> map_of ((a # xs) @ ys) = (\<lambda>x. case map_of (a # xs) x of None \<Rightarrow> map_of ys x | Some a \<Rightarrow> Some a)
[PROOF STEP]
case (Cons a xs)
[PROOF STATE]
proof (state)
this:
map_of (xs @ ys) = (\<lambda>x. case map_of xs x of None \<Rightarrow> map_of ys x | Some a \<Rightarrow> Some a)

goal (2 subgoals):
 1. map_of ([] @ ys) = (\<lambda>x. case map_of [] x of None \<Rightarrow> map_of ys x | Some a \<Rightarrow> Some a)
 2. \<And>a xs. map_of (xs @ ys) = (\<lambda>x. case map_of xs x of None \<Rightarrow> map_of ys x | Some a \<Rightarrow> Some a) \<Longrightarrow> map_of ((a # xs) @ ys) = (\<lambda>x. case map_of (a # xs) x of None \<Rightarrow> map_of ys x | Some a \<Rightarrow> Some a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
map_of (xs @ ys) = (\<lambda>x. case map_of xs x of None \<Rightarrow> map_of ys x | Some a \<Rightarrow> Some a)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
map_of (xs @ ys) = (\<lambda>x. case map_of xs x of None \<Rightarrow> map_of ys x | Some a \<Rightarrow> Some a)

goal (1 subgoal):
 1. map_of ((a # xs) @ ys) = (\<lambda>x. case map_of (a # xs) x of None \<Rightarrow> map_of ys x | Some a \<Rightarrow> Some a)
[PROOF STEP]
by (force split: option.split)
[PROOF STATE]
proof (state)
this:
map_of ((a # xs) @ ys) = (\<lambda>x. case map_of (a # xs) x of None \<Rightarrow> map_of ys x | Some a \<Rightarrow> Some a)

goal (1 subgoal):
 1. map_of ([] @ ys) = (\<lambda>x. case map_of [] x of None \<Rightarrow> map_of ys x | Some a \<Rightarrow> Some a)
[PROOF STEP]
qed auto


[STATEMENT]
lemma conv_abscissa_norm [simp]:
  fixes f :: "'a :: dirichlet_series fds"
  shows "conv_abscissa (fds_norm f) = abs_conv_abscissa f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conv_abscissa (fds_norm f) = abs_conv_abscissa f
[PROOF STEP]
proof (rule antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. conv_abscissa (fds_norm f) \<le> abs_conv_abscissa f
 2. abs_conv_abscissa f \<le> conv_abscissa (fds_norm f)
[PROOF STEP]
show "abs_conv_abscissa f \<le> conv_abscissa (fds_norm f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. abs_conv_abscissa f \<le> conv_abscissa (fds_norm f)
[PROOF STEP]
proof (rule abs_conv_abscissa_leI_weak)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. conv_abscissa (fds_norm f) < ereal x \<Longrightarrow> fds_abs_converges f (of_real x)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. conv_abscissa (fds_norm f) < ereal x \<Longrightarrow> fds_abs_converges f (of_real x)
[PROOF STEP]
assume "conv_abscissa (fds_norm f) < ereal x"
[PROOF STATE]
proof (state)
this:
conv_abscissa (fds_norm f) < ereal x

goal (1 subgoal):
 1. \<And>x. conv_abscissa (fds_norm f) < ereal x \<Longrightarrow> fds_abs_converges f (of_real x)
[PROOF STEP]
hence "fds_converges (fds_norm f) (of_real x)"
[PROOF STATE]
proof (prove)
using this:
conv_abscissa (fds_norm f) < ereal x

goal (1 subgoal):
 1. fds_converges (fds_norm f) (of_real x)
[PROOF STEP]
by (intro fds_converges) auto
[PROOF STATE]
proof (state)
this:
fds_converges (fds_norm f) (of_real x)

goal (1 subgoal):
 1. \<And>x. conv_abscissa (fds_norm f) < ereal x \<Longrightarrow> fds_abs_converges f (of_real x)
[PROOF STEP]
thus "fds_abs_converges f (of_real x)"
[PROOF STATE]
proof (prove)
using this:
fds_converges (fds_norm f) (of_real x)

goal (1 subgoal):
 1. fds_abs_converges f (of_real x)
[PROOF STEP]
by (simp add: fds_converges_norm_iff')
[PROOF STATE]
proof (state)
this:
fds_abs_converges f (of_real x)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
abs_conv_abscissa f \<le> conv_abscissa (fds_norm f)

goal (1 subgoal):
 1. conv_abscissa (fds_norm f) \<le> abs_conv_abscissa f
[PROOF STEP]
qed (auto intro!: conv_abscissa_leI_weak simp: fds_abs_converges)


[STATEMENT]
lemma ang_vec_opposite1:
  assumes "z1 \<noteq> 0"
  shows "\<angle> (-z1) z2 = \<downharpoonright>\<angle> z1 z2 - pi\<downharpoonleft>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<angle> (- z1) z2 = \<downharpoonright>\<angle> z1 z2 - pi\<downharpoonleft>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<angle> (- z1) z2 = \<downharpoonright>\<angle> z1 z2 - pi\<downharpoonleft>
[PROOF STEP]
have "\<angle> (-z1) z2 = \<downharpoonright>Arg z2 - (Arg z1 + pi)\<downharpoonleft>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<angle> (- z1) z2 = \<downharpoonright>Arg z2 - (Arg z1 + pi)\<downharpoonleft>
[PROOF STEP]
unfolding ang_vec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<downharpoonright>Arg z2 - Arg (- z1)\<downharpoonleft> = \<downharpoonright>Arg z2 - (Arg z1 + pi)\<downharpoonleft>
[PROOF STEP]
using arg_uminus[OF assms]
[PROOF STATE]
proof (prove)
using this:
Arg (- z1) = \<downharpoonright>Arg z1 + pi\<downharpoonleft>

goal (1 subgoal):
 1. \<downharpoonright>Arg z2 - Arg (- z1)\<downharpoonleft> = \<downharpoonright>Arg z2 - (Arg z1 + pi)\<downharpoonleft>
[PROOF STEP]
using canon_ang_arg[of z2, symmetric]
[PROOF STATE]
proof (prove)
using this:
Arg (- z1) = \<downharpoonright>Arg z1 + pi\<downharpoonleft>
Arg z2 = \<downharpoonright>Arg z2\<downharpoonleft>

goal (1 subgoal):
 1. \<downharpoonright>Arg z2 - Arg (- z1)\<downharpoonleft> = \<downharpoonright>Arg z2 - (Arg z1 + pi)\<downharpoonleft>
[PROOF STEP]
using canon_ang_diff[of "Arg z2" "Arg z1 + pi", symmetric]
[PROOF STATE]
proof (prove)
using this:
Arg (- z1) = \<downharpoonright>Arg z1 + pi\<downharpoonleft>
Arg z2 = \<downharpoonright>Arg z2\<downharpoonleft>
\<downharpoonright>\<downharpoonright>Arg z2\<downharpoonleft> - \<downharpoonright>Arg z1 + pi\<downharpoonleft>\<downharpoonleft> = \<downharpoonright>Arg z2 - (Arg z1 + pi)\<downharpoonleft>

goal (1 subgoal):
 1. \<downharpoonright>Arg z2 - Arg (- z1)\<downharpoonleft> = \<downharpoonright>Arg z2 - (Arg z1 + pi)\<downharpoonleft>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<angle> (- z1) z2 = \<downharpoonright>Arg z2 - (Arg z1 + pi)\<downharpoonleft>

goal (1 subgoal):
 1. \<angle> (- z1) z2 = \<downharpoonright>\<angle> z1 z2 - pi\<downharpoonleft>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<angle> (- z1) z2 = \<downharpoonright>Arg z2 - (Arg z1 + pi)\<downharpoonleft>

goal (1 subgoal):
 1. \<angle> (- z1) z2 = \<downharpoonright>\<angle> z1 z2 - pi\<downharpoonleft>
[PROOF STEP]
have "\<downharpoonright>\<angle> z1 z2 - pi\<downharpoonleft> = \<downharpoonright>Arg z2 - Arg z1 - pi\<downharpoonleft>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<downharpoonright>\<angle> z1 z2 - pi\<downharpoonleft> = \<downharpoonright>Arg z2 - Arg z1 - pi\<downharpoonleft>
[PROOF STEP]
using canon_ang_id[of pi, symmetric]
[PROOF STATE]
proof (prove)
using this:
- pi < pi \<and> pi \<le> pi \<Longrightarrow> pi = \<downharpoonright>pi\<downharpoonleft>

goal (1 subgoal):
 1. \<downharpoonright>\<angle> z1 z2 - pi\<downharpoonleft> = \<downharpoonright>Arg z2 - Arg z1 - pi\<downharpoonleft>
[PROOF STEP]
using canon_ang_diff[of "Arg z2 - Arg z1" "pi", symmetric]
[PROOF STATE]
proof (prove)
using this:
- pi < pi \<and> pi \<le> pi \<Longrightarrow> pi = \<downharpoonright>pi\<downharpoonleft>
\<downharpoonright>\<downharpoonright>Arg z2 - Arg z1\<downharpoonleft> - \<downharpoonright>pi\<downharpoonleft>\<downharpoonleft> = \<downharpoonright>Arg z2 - Arg z1 - pi\<downharpoonleft>

goal (1 subgoal):
 1. \<downharpoonright>\<angle> z1 z2 - pi\<downharpoonleft> = \<downharpoonright>Arg z2 - Arg z1 - pi\<downharpoonleft>
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
\<downharpoonright>\<angle> z1 z2 - pi\<downharpoonleft> = \<downharpoonright>Arg z2 - Arg z1 - pi\<downharpoonleft>

goal (1 subgoal):
 1. \<angle> (- z1) z2 = \<downharpoonright>\<angle> z1 z2 - pi\<downharpoonleft>
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<angle> (- z1) z2 = \<downharpoonright>Arg z2 - (Arg z1 + pi)\<downharpoonleft>
\<downharpoonright>\<angle> z1 z2 - pi\<downharpoonleft> = \<downharpoonright>Arg z2 - Arg z1 - pi\<downharpoonleft>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<angle> (- z1) z2 = \<downharpoonright>Arg z2 - (Arg z1 + pi)\<downharpoonleft>
\<downharpoonright>\<angle> z1 z2 - pi\<downharpoonleft> = \<downharpoonright>Arg z2 - Arg z1 - pi\<downharpoonleft>

goal (1 subgoal):
 1. \<angle> (- z1) z2 = \<downharpoonright>\<angle> z1 z2 - pi\<downharpoonleft>
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
\<angle> (- z1) z2 = \<downharpoonright>\<angle> z1 z2 - pi\<downharpoonleft>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma canon_ang_minus_pi1:
  assumes "0 < \<alpha>" and "\<alpha> \<le> 2*pi"
  shows "\<downharpoonright>\<alpha> - pi\<downharpoonleft> = \<alpha> - pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<downharpoonright>\<alpha> - pi\<downharpoonleft> = \<alpha> - pi
[PROOF STEP]
proof (rule canon_ang_id)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. - pi < \<alpha> - pi \<and> \<alpha> - pi \<le> pi
[PROOF STEP]
show "- pi < \<alpha> - pi \<and> \<alpha> - pi \<le> pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - pi < \<alpha> - pi \<and> \<alpha> - pi \<le> pi
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < \<alpha>
\<alpha> \<le> 2 * pi

goal (1 subgoal):
 1. - pi < \<alpha> - pi \<and> \<alpha> - pi \<le> pi
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
- pi < \<alpha> - pi \<and> \<alpha> - pi \<le> pi

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma chain_le:
  fixes I::"nat => 'a set"
  assumes inc: "\<forall>n. I(n) \<subseteq> I(n+1)"
  shows "\<forall>n\<le>m. I(n) \<subseteq> I(m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n\<le>m. I n \<subseteq> I m
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>n. I n \<subseteq> I (n + 1)

goal (1 subgoal):
 1. \<forall>n\<le>m. I n \<subseteq> I m
[PROOF STEP]
proof (induct m)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>n. I n \<subseteq> I (n + 1) \<Longrightarrow> \<forall>n\<le>0. I n \<subseteq> I 0
 2. \<And>m. \<lbrakk>\<forall>n. I n \<subseteq> I (n + 1) \<Longrightarrow> \<forall>n\<le>m. I n \<subseteq> I m; \<forall>n. I n \<subseteq> I (n + 1)\<rbrakk> \<Longrightarrow> \<forall>n\<le>Suc m. I n \<subseteq> I (Suc m)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
\<forall>n. I n \<subseteq> I (n + 1)

goal (2 subgoals):
 1. \<forall>n. I n \<subseteq> I (n + 1) \<Longrightarrow> \<forall>n\<le>0. I n \<subseteq> I 0
 2. \<And>m. \<lbrakk>\<forall>n. I n \<subseteq> I (n + 1) \<Longrightarrow> \<forall>n\<le>m. I n \<subseteq> I m; \<forall>n. I n \<subseteq> I (n + 1)\<rbrakk> \<Longrightarrow> \<forall>n\<le>Suc m. I n \<subseteq> I (Suc m)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n\<le>0. I n \<subseteq> I 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>n\<le>0. I n \<subseteq> I 0

goal (1 subgoal):
 1. \<And>m. \<lbrakk>\<forall>n. I n \<subseteq> I (n + 1) \<Longrightarrow> \<forall>n\<le>m. I n \<subseteq> I m; \<forall>n. I n \<subseteq> I (n + 1)\<rbrakk> \<Longrightarrow> \<forall>n\<le>Suc m. I n \<subseteq> I (Suc m)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m. \<lbrakk>\<forall>n. I n \<subseteq> I (n + 1) \<Longrightarrow> \<forall>n\<le>m. I n \<subseteq> I m; \<forall>n. I n \<subseteq> I (n + 1)\<rbrakk> \<Longrightarrow> \<forall>n\<le>Suc m. I n \<subseteq> I (Suc m)
[PROOF STEP]
case (Suc m)
[PROOF STATE]
proof (state)
this:
\<forall>n. I n \<subseteq> I (n + 1) \<Longrightarrow> \<forall>n\<le>m. I n \<subseteq> I m
\<forall>n. I n \<subseteq> I (n + 1)

goal (1 subgoal):
 1. \<And>m. \<lbrakk>\<forall>n. I n \<subseteq> I (n + 1) \<Longrightarrow> \<forall>n\<le>m. I n \<subseteq> I m; \<forall>n. I n \<subseteq> I (n + 1)\<rbrakk> \<Longrightarrow> \<forall>n\<le>Suc m. I n \<subseteq> I (Suc m)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n\<le>Suc m. I n \<subseteq> I (Suc m)
[PROOF STEP]
by (metis Suc_eq_plus1 inc lift_Suc_mono_le)
[PROOF STATE]
proof (state)
this:
\<forall>n\<le>Suc m. I n \<subseteq> I (Suc m)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma all_total_iff_totalize: "all_total F = (totalize F = F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. all_total F = (totalize F = F)
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. all_total F \<Longrightarrow> totalize F = F
 2. totalize F = F \<Longrightarrow> all_total F
[PROOF STEP]
apply (erule all_total_imp_totalize)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. totalize F = F \<Longrightarrow> all_total F
[PROOF STEP]
apply (erule subst)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. all_total (totalize F)
[PROOF STEP]
apply (rule all_total_totalize)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma card_of_Sigma_mono:
assumes INJ: "inj_on f I" and IM: "f ` I \<le> J" and
        LEQ: "\<forall>j \<in> J. |A j| \<le>o |B j|"
shows "|SIGMA i : I. A (f i)| \<le>o |SIGMA j : J. B j|"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |SIGMA i:I. A (f i)| \<le>o |Sigma J B|
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. |SIGMA i:I. A (f i)| \<le>o |Sigma J B|
[PROOF STEP]
have "\<forall>i \<in> I. |A(f i)| \<le>o |B(f i)|"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i\<in>I. |A (f i)| \<le>o |B (f i)|
[PROOF STEP]
using IM LEQ
[PROOF STATE]
proof (prove)
using this:
f ` I \<subseteq> J
\<forall>j\<in>J. |A j| \<le>o |B j|

goal (1 subgoal):
 1. \<forall>i\<in>I. |A (f i)| \<le>o |B (f i)|
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>i\<in>I. |A (f i)| \<le>o |B (f i)|

goal (1 subgoal):
 1. |SIGMA i:I. A (f i)| \<le>o |Sigma J B|
[PROOF STEP]
hence "|SIGMA i : I. A (f i)| \<le>o |SIGMA i : I. B (f i)|"
[PROOF STATE]
proof (prove)
using this:
\<forall>i\<in>I. |A (f i)| \<le>o |B (f i)|

goal (1 subgoal):
 1. |SIGMA i:I. A (f i)| \<le>o |SIGMA i:I. B (f i)|
[PROOF STEP]
using card_of_Sigma_mono1[of I]
[PROOF STATE]
proof (prove)
using this:
\<forall>i\<in>I. |A (f i)| \<le>o |B (f i)|
\<forall>i\<in>I. |?A i| \<le>o |?B i| \<Longrightarrow> |Sigma I ?A| \<le>o |Sigma I ?B|

goal (1 subgoal):
 1. |SIGMA i:I. A (f i)| \<le>o |SIGMA i:I. B (f i)|
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
|SIGMA i:I. A (f i)| \<le>o |SIGMA i:I. B (f i)|

goal (1 subgoal):
 1. |SIGMA i:I. A (f i)| \<le>o |Sigma J B|
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
|SIGMA i:I. A (f i)| \<le>o |SIGMA i:I. B (f i)|

goal (1 subgoal):
 1. |SIGMA i:I. A (f i)| \<le>o |Sigma J B|
[PROOF STEP]
have "|SIGMA i : I. B (f i)| \<le>o |SIGMA j : J. B j|"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |SIGMA i:I. B (f i)| \<le>o |Sigma J B|
[PROOF STEP]
using INJ IM card_of_Sigma_mono2
[PROOF STATE]
proof (prove)
using this:
inj_on f I
f ` I \<subseteq> J
\<lbrakk>inj_on ?f ?I; ?f ` ?I \<subseteq> ?J\<rbrakk> \<Longrightarrow> |SIGMA i:?I. ?A (?f i)| \<le>o |Sigma ?J ?A|

goal (1 subgoal):
 1. |SIGMA i:I. B (f i)| \<le>o |Sigma J B|
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
|SIGMA i:I. B (f i)| \<le>o |Sigma J B|

goal (1 subgoal):
 1. |SIGMA i:I. A (f i)| \<le>o |Sigma J B|
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
|SIGMA i:I. A (f i)| \<le>o |SIGMA i:I. B (f i)|
|SIGMA i:I. B (f i)| \<le>o |Sigma J B|
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
|SIGMA i:I. A (f i)| \<le>o |SIGMA i:I. B (f i)|
|SIGMA i:I. B (f i)| \<le>o |Sigma J B|

goal (1 subgoal):
 1. |SIGMA i:I. A (f i)| \<le>o |Sigma J B|
[PROOF STEP]
using ordLeq_transitive
[PROOF STATE]
proof (prove)
using this:
|SIGMA i:I. A (f i)| \<le>o |SIGMA i:I. B (f i)|
|SIGMA i:I. B (f i)| \<le>o |Sigma J B|
\<lbrakk>?r \<le>o ?r'; ?r' \<le>o ?r''\<rbrakk> \<Longrightarrow> ?r \<le>o ?r''

goal (1 subgoal):
 1. |SIGMA i:I. A (f i)| \<le>o |Sigma J B|
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
|SIGMA i:I. A (f i)| \<le>o |Sigma J B|

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma minus_mat_limit:
  fixes X :: "nat \<Rightarrow> complex mat" and A :: "complex mat" and m :: nat and B :: "complex mat"
  assumes dimB: "B \<in> carrier_mat m m" and limX: "limit_mat X A m"
  shows "limit_mat (mat_seq_minus X B) (A - B) m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. limit_mat (mat_seq_minus X B) (A - B) m
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. limit_mat (mat_seq_minus X B) (A - B) m
[PROOF STEP]
have dimXAB: "\<forall>n. X n - B \<in> carrier_mat m m \<and> A - B \<in> carrier_mat m m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n. X n - B \<in> carrier_mat m m \<and> A - B \<in> carrier_mat m m
[PROOF STEP]
using index_minus_mat dimB
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i < dim_row ?B; ?j < dim_col ?B\<rbrakk> \<Longrightarrow> (?A - ?B) $$ (?i, ?j) = ?A $$ (?i, ?j) - ?B $$ (?i, ?j)
dim_row (?A - ?B) = dim_row ?B
dim_col (?A - ?B) = dim_col ?B
B \<in> carrier_mat m m

goal (1 subgoal):
 1. \<forall>n. X n - B \<in> carrier_mat m m \<and> A - B \<in> carrier_mat m m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>n. X n - B \<in> carrier_mat m m \<and> A - B \<in> carrier_mat m m

goal (1 subgoal):
 1. limit_mat (mat_seq_minus X B) (A - B) m
[PROOF STEP]
have "(\<lambda>n. (X n - B) $$ (i, j)) \<longlonglongrightarrow> (A - B) $$ (i, j)" if i: "i < m" and j: "j < m" for i j
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. (X n - B) $$ (i, j)) \<longlonglongrightarrow> (A - B) $$ (i, j)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>n. (X n - B) $$ (i, j)) \<longlonglongrightarrow> (A - B) $$ (i, j)
[PROOF STEP]
from limX i j
[PROOF STATE]
proof (chain)
picking this:
limit_mat X A m
i < m
j < m
[PROOF STEP]
have "(\<lambda>n. (X n) $$ (i, j)) \<longlonglongrightarrow> (A) $$ (i, j)"
[PROOF STATE]
proof (prove)
using this:
limit_mat X A m
i < m
j < m

goal (1 subgoal):
 1. (\<lambda>n. X n $$ (i, j)) \<longlonglongrightarrow> A $$ (i, j)
[PROOF STEP]
unfolding limit_mat_def
[PROOF STATE]
proof (prove)
using this:
\<forall>n. X n \<in> carrier_mat m m \<and> A \<in> carrier_mat m m \<and> (\<forall>i<m. \<forall>j<m. (\<lambda>n. X n $$ (i, j)) \<longlonglongrightarrow> A $$ (i, j))
i < m
j < m

goal (1 subgoal):
 1. (\<lambda>n. X n $$ (i, j)) \<longlonglongrightarrow> A $$ (i, j)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>n. X n $$ (i, j)) \<longlonglongrightarrow> A $$ (i, j)

goal (1 subgoal):
 1. (\<lambda>n. (X n - B) $$ (i, j)) \<longlonglongrightarrow> (A - B) $$ (i, j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. X n $$ (i, j)) \<longlonglongrightarrow> A $$ (i, j)
[PROOF STEP]
have X: "\<forall>r>0. \<exists>no. \<forall>n\<ge>no. dist (X n $$ (i, j)) (A $$ (i, j)) < r"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. X n $$ (i, j)) \<longlonglongrightarrow> A $$ (i, j)

goal (1 subgoal):
 1. \<forall>r>0. \<exists>no. \<forall>n\<ge>no. dist (X n $$ (i, j)) (A $$ (i, j)) < r
[PROOF STEP]
unfolding LIMSEQ_def
[PROOF STATE]
proof (prove)
using this:
\<forall>r>0. \<exists>no. \<forall>n\<ge>no. dist (X n $$ (i, j)) (A $$ (i, j)) < r

goal (1 subgoal):
 1. \<forall>r>0. \<exists>no. \<forall>n\<ge>no. dist (X n $$ (i, j)) (A $$ (i, j)) < r
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>r>0. \<exists>no. \<forall>n\<ge>no. dist (X n $$ (i, j)) (A $$ (i, j)) < r

goal (1 subgoal):
 1. (\<lambda>n. (X n - B) $$ (i, j)) \<longlonglongrightarrow> (A - B) $$ (i, j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>r>0. \<exists>no. \<forall>n\<ge>no. dist (X n $$ (i, j)) (A $$ (i, j)) < r
[PROOF STEP]
have XB: "\<exists>no. \<forall>n\<ge>no. dist ((X n - B) $$ (i, j)) ((A - B) $$ (i, j)) < r" if r: "r > 0" for r
[PROOF STATE]
proof (prove)
using this:
\<forall>r>0. \<exists>no. \<forall>n\<ge>no. dist (X n $$ (i, j)) (A $$ (i, j)) < r

goal (1 subgoal):
 1. \<exists>no. \<forall>n\<ge>no. dist ((X n - B) $$ (i, j)) ((A - B) $$ (i, j)) < r
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>r>0. \<exists>no. \<forall>n\<ge>no. dist (X n $$ (i, j)) (A $$ (i, j)) < r \<Longrightarrow> \<exists>no. \<forall>n\<ge>no. dist ((X n - B) $$ (i, j)) ((A - B) $$ (i, j)) < r
[PROOF STEP]
obtain no where "\<forall>n\<ge>no. dist (X n $$ (i, j)) (A $$ (i, j)) < r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>no. \<forall>n\<ge>no. dist (X n $$ (i, j)) (A $$ (i, j)) < r \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using r X
[PROOF STATE]
proof (prove)
using this:
0 < r
\<forall>r>0. \<exists>no. \<forall>n\<ge>no. dist (X n $$ (i, j)) (A $$ (i, j)) < r

goal (1 subgoal):
 1. (\<And>no. \<forall>n\<ge>no. dist (X n $$ (i, j)) (A $$ (i, j)) < r \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>n\<ge>no. dist (X n $$ (i, j)) (A $$ (i, j)) < r

goal (1 subgoal):
 1. \<forall>r>0. \<exists>no. \<forall>n\<ge>no. dist (X n $$ (i, j)) (A $$ (i, j)) < r \<Longrightarrow> \<exists>no. \<forall>n\<ge>no. dist ((X n - B) $$ (i, j)) ((A - B) $$ (i, j)) < r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>n\<ge>no. dist (X n $$ (i, j)) (A $$ (i, j)) < r
[PROOF STEP]
have dist:  "\<forall>n\<ge>no. norm (X n $$ (i, j) - A $$ (i, j)) < r"
[PROOF STATE]
proof (prove)
using this:
\<forall>n\<ge>no. dist (X n $$ (i, j)) (A $$ (i, j)) < r

goal (1 subgoal):
 1. \<forall>n\<ge>no. cmod (X n $$ (i, j) - A $$ (i, j)) < r
[PROOF STEP]
unfolding dist_norm
[PROOF STATE]
proof (prove)
using this:
\<forall>n\<ge>no. cmod (X n $$ (i, j) - A $$ (i, j)) < r

goal (1 subgoal):
 1. \<forall>n\<ge>no. cmod (X n $$ (i, j) - A $$ (i, j)) < r
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>n\<ge>no. cmod (X n $$ (i, j) - A $$ (i, j)) < r

goal (1 subgoal):
 1. \<forall>r>0. \<exists>no. \<forall>n\<ge>no. dist (X n $$ (i, j)) (A $$ (i, j)) < r \<Longrightarrow> \<exists>no. \<forall>n\<ge>no. dist ((X n - B) $$ (i, j)) ((A - B) $$ (i, j)) < r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>n\<ge>no. cmod (X n $$ (i, j) - A $$ (i, j)) < r
[PROOF STEP]
have "norm ((X n - B) $$ (i, j) - (A - B) $$ (i, j)) < r" if n: "n \<ge> no" for n
[PROOF STATE]
proof (prove)
using this:
\<forall>n\<ge>no. cmod (X n $$ (i, j) - A $$ (i, j)) < r

goal (1 subgoal):
 1. cmod ((X n - B) $$ (i, j) - (A - B) $$ (i, j)) < r
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>n\<ge>no. cmod (X n $$ (i, j) - A $$ (i, j)) < r \<Longrightarrow> cmod ((X n - B) $$ (i, j) - (A - B) $$ (i, j)) < r
[PROOF STEP]
have "(X n - B) $$ (i, j) - (A - B) $$ (i, j) = (X n) $$ (i, j) -  A $$ (i, j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (X n - B) $$ (i, j) - (A - B) $$ (i, j) = X n $$ (i, j) - A $$ (i, j)
[PROOF STEP]
using dimB i j
[PROOF STATE]
proof (prove)
using this:
B \<in> carrier_mat m m
i < m
j < m

goal (1 subgoal):
 1. (X n - B) $$ (i, j) - (A - B) $$ (i, j) = X n $$ (i, j) - A $$ (i, j)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(X n - B) $$ (i, j) - (A - B) $$ (i, j) = X n $$ (i, j) - A $$ (i, j)

goal (1 subgoal):
 1. \<forall>n\<ge>no. cmod (X n $$ (i, j) - A $$ (i, j)) < r \<Longrightarrow> cmod ((X n - B) $$ (i, j) - (A - B) $$ (i, j)) < r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(X n - B) $$ (i, j) - (A - B) $$ (i, j) = X n $$ (i, j) - A $$ (i, j)
[PROOF STEP]
have "norm ((X n - B) $$ (i, j) - (A - B) $$ (i, j)) = norm ((X n) $$ (i, j) -  A $$ (i, j))"
[PROOF STATE]
proof (prove)
using this:
(X n - B) $$ (i, j) - (A - B) $$ (i, j) = X n $$ (i, j) - A $$ (i, j)

goal (1 subgoal):
 1. cmod ((X n - B) $$ (i, j) - (A - B) $$ (i, j)) = cmod (X n $$ (i, j) - A $$ (i, j))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cmod ((X n - B) $$ (i, j) - (A - B) $$ (i, j)) = cmod (X n $$ (i, j) - A $$ (i, j))

goal (1 subgoal):
 1. \<forall>n\<ge>no. cmod (X n $$ (i, j) - A $$ (i, j)) < r \<Longrightarrow> cmod ((X n - B) $$ (i, j) - (A - B) $$ (i, j)) < r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
cmod ((X n - B) $$ (i, j) - (A - B) $$ (i, j)) = cmod (X n $$ (i, j) - A $$ (i, j))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cmod ((X n - B) $$ (i, j) - (A - B) $$ (i, j)) = cmod (X n $$ (i, j) - A $$ (i, j))

goal (1 subgoal):
 1. cmod ((X n - B) $$ (i, j) - (A - B) $$ (i, j)) < r
[PROOF STEP]
using dist n
[PROOF STATE]
proof (prove)
using this:
cmod ((X n - B) $$ (i, j) - (A - B) $$ (i, j)) = cmod (X n $$ (i, j) - A $$ (i, j))
\<forall>n\<ge>no. cmod (X n $$ (i, j) - A $$ (i, j)) < r
no \<le> n

goal (1 subgoal):
 1. cmod ((X n - B) $$ (i, j) - (A - B) $$ (i, j)) < r
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cmod ((X n - B) $$ (i, j) - (A - B) $$ (i, j)) < r

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
no \<le> ?n \<Longrightarrow> cmod ((X ?n - B) $$ (i, j) - (A - B) $$ (i, j)) < r

goal (1 subgoal):
 1. \<forall>r>0. \<exists>no. \<forall>n\<ge>no. dist (X n $$ (i, j)) (A $$ (i, j)) < r \<Longrightarrow> \<exists>no. \<forall>n\<ge>no. dist ((X n - B) $$ (i, j)) ((A - B) $$ (i, j)) < r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
no \<le> ?n \<Longrightarrow> cmod ((X ?n - B) $$ (i, j) - (A - B) $$ (i, j)) < r
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
no \<le> ?n \<Longrightarrow> cmod ((X ?n - B) $$ (i, j) - (A - B) $$ (i, j)) < r

goal (1 subgoal):
 1. \<exists>no. \<forall>n\<ge>no. dist ((X n - B) $$ (i, j)) ((A - B) $$ (i, j)) < r
[PROOF STEP]
using dist_norm
[PROOF STATE]
proof (prove)
using this:
no \<le> ?n \<Longrightarrow> cmod ((X ?n - B) $$ (i, j) - (A - B) $$ (i, j)) < r
dist ?x ?y = norm (?x - ?y)

goal (1 subgoal):
 1. \<exists>no. \<forall>n\<ge>no. dist ((X n - B) $$ (i, j)) ((A - B) $$ (i, j)) < r
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<exists>no. \<forall>n\<ge>no. dist ((X n - B) $$ (i, j)) ((A - B) $$ (i, j)) < r

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 < ?r \<Longrightarrow> \<exists>no. \<forall>n\<ge>no. dist ((X n - B) $$ (i, j)) ((A - B) $$ (i, j)) < ?r

goal (1 subgoal):
 1. (\<lambda>n. (X n - B) $$ (i, j)) \<longlonglongrightarrow> (A - B) $$ (i, j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < ?r \<Longrightarrow> \<exists>no. \<forall>n\<ge>no. dist ((X n - B) $$ (i, j)) ((A - B) $$ (i, j)) < ?r
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < ?r \<Longrightarrow> \<exists>no. \<forall>n\<ge>no. dist ((X n - B) $$ (i, j)) ((A - B) $$ (i, j)) < ?r

goal (1 subgoal):
 1. (\<lambda>n. (X n - B) $$ (i, j)) \<longlonglongrightarrow> (A - B) $$ (i, j)
[PROOF STEP]
unfolding LIMSEQ_def
[PROOF STATE]
proof (prove)
using this:
0 < ?r \<Longrightarrow> \<exists>no. \<forall>n\<ge>no. dist ((X n - B) $$ (i, j)) ((A - B) $$ (i, j)) < ?r

goal (1 subgoal):
 1. \<forall>r>0. \<exists>no. \<forall>n\<ge>no. dist ((X n - B) $$ (i, j)) ((A - B) $$ (i, j)) < r
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (X n - B) $$ (i, j)) \<longlonglongrightarrow> (A - B) $$ (i, j)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?i < m; ?j < m\<rbrakk> \<Longrightarrow> (\<lambda>n. (X n - B) $$ (?i, ?j)) \<longlonglongrightarrow> (A - B) $$ (?i, ?j)

goal (1 subgoal):
 1. limit_mat (mat_seq_minus X B) (A - B) m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?i < m; ?j < m\<rbrakk> \<Longrightarrow> (\<lambda>n. (X n - B) $$ (?i, ?j)) \<longlonglongrightarrow> (A - B) $$ (?i, ?j)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i < m; ?j < m\<rbrakk> \<Longrightarrow> (\<lambda>n. (X n - B) $$ (?i, ?j)) \<longlonglongrightarrow> (A - B) $$ (?i, ?j)

goal (1 subgoal):
 1. limit_mat (mat_seq_minus X B) (A - B) m
[PROOF STEP]
unfolding limit_mat_def mat_seq_minus_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i < m; ?j < m\<rbrakk> \<Longrightarrow> (\<lambda>n. (X n - B) $$ (?i, ?j)) \<longlonglongrightarrow> (A - B) $$ (?i, ?j)

goal (1 subgoal):
 1. \<forall>n. X n - B \<in> carrier_mat m m \<and> A - B \<in> carrier_mat m m \<and> (\<forall>i<m. \<forall>j<m. (\<lambda>n. (X n - B) $$ (i, j)) \<longlonglongrightarrow> (A - B) $$ (i, j))
[PROOF STEP]
using dimXAB
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i < m; ?j < m\<rbrakk> \<Longrightarrow> (\<lambda>n. (X n - B) $$ (?i, ?j)) \<longlonglongrightarrow> (A - B) $$ (?i, ?j)
\<forall>n. X n - B \<in> carrier_mat m m \<and> A - B \<in> carrier_mat m m

goal (1 subgoal):
 1. \<forall>n. X n - B \<in> carrier_mat m m \<and> A - B \<in> carrier_mat m m \<and> (\<forall>i<m. \<forall>j<m. (\<lambda>n. (X n - B) $$ (i, j)) \<longlonglongrightarrow> (A - B) $$ (i, j))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
limit_mat (mat_seq_minus X B) (A - B) m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma resultant_impl_start_code:
  "resultant_impl_start G1 G2 =
     (let pmod = pseudo_mod G1 G2;
          n2 = degree G2;
          n1 = degree G1;
          g2 = lead_coeff G2;
          d1 = n1 - n2
         in if pmod = 0 then if n2 = 0 then if d1 = 0 then 1 else if d1 = 1 then g2 else g2 ^ d1 else 0
            else let
                 G3 = if even d1 then - pmod else pmod;
                 n3 = degree G3;
                 pmod = pseudo_mod G2 G3
                 in if pmod = 0
                    then if n3 = 0 then
                     let d2 = n2 - n3;
                         g3 = lead_coeff G3
                        in (if d2 = 1 then g3 else
                            div_exp g3 (if d1 = 1 then g2 else g2 ^ d1) d2) else 0
                    else let
                           h2 = (if d1 = 1 then g2 else g2 ^ d1);
                           d2 = n2 - n3;
                           divisor = (if d2 = 1 then g2 * h2 else if even d2 then - g2 * h2 ^ d2 else g2 * h2 ^ d2);
                           G4 = sdiv_poly pmod divisor
                         in resultant_impl_rec G3 G4 n3 d2 h2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. resultant_impl_start G1 G2 = (let pmod = pseudo_mod G1 G2; n2 = degree G2; n1 = degree G1; g2 = lead_coeff G2; d1 = n1 - n2 in if pmod = 0 then if n2 = 0 then if d1 = 0 then 1::'a else if d1 = 1 then g2 else g2 ^ d1 else (0::'a) else let G3 = if even d1 then - pmod else pmod; n3 = degree G3; pmod = pseudo_mod G2 G3 in if pmod = 0 then if n3 = 0 then let d2 = n2 - n3; g3 = lead_coeff G3 in if d2 = 1 then g3 else div_exp g3 (if d1 = 1 then g2 else g2 ^ d1) d2 else (0::'a) else let h2 = if d1 = 1 then g2 else g2 ^ d1; d2 = n2 - n3; divisor = if d2 = 1 then g2 * h2 else if even d2 then - g2 * h2 ^ d2 else g2 * h2 ^ d2; G4 = sdiv_poly pmod divisor in resultant_impl_rec G3 G4 n3 d2 h2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. resultant_impl_start G1 G2 = (let pmod = pseudo_mod G1 G2; n2 = degree G2; n1 = degree G1; g2 = lead_coeff G2; d1 = n1 - n2 in if pmod = 0 then if n2 = 0 then if d1 = 0 then 1::'a else if d1 = 1 then g2 else g2 ^ d1 else (0::'a) else let G3 = if even d1 then - pmod else pmod; n3 = degree G3; pmod = pseudo_mod G2 G3 in if pmod = 0 then if n3 = 0 then let d2 = n2 - n3; g3 = lead_coeff G3 in if d2 = 1 then g3 else div_exp g3 (if d1 = 1 then g2 else g2 ^ d1) d2 else (0::'a) else let h2 = if d1 = 1 then g2 else g2 ^ d1; d2 = n2 - n3; divisor = if d2 = 1 then g2 * h2 else if even d2 then - g2 * h2 ^ d2 else g2 * h2 ^ d2; G4 = sdiv_poly pmod divisor in resultant_impl_rec G3 G4 n3 d2 h2)
[PROOF STEP]
obtain d1 where d1: "degree G1 - degree G2 = d1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>d1. degree G1 - degree G2 = d1 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
degree G1 - degree G2 = d1

goal (1 subgoal):
 1. resultant_impl_start G1 G2 = (let pmod = pseudo_mod G1 G2; n2 = degree G2; n1 = degree G1; g2 = lead_coeff G2; d1 = n1 - n2 in if pmod = 0 then if n2 = 0 then if d1 = 0 then 1::'a else if d1 = 1 then g2 else g2 ^ d1 else (0::'a) else let G3 = if even d1 then - pmod else pmod; n3 = degree G3; pmod = pseudo_mod G2 G3 in if pmod = 0 then if n3 = 0 then let d2 = n2 - n3; g3 = lead_coeff G3 in if d2 = 1 then g3 else div_exp g3 (if d1 = 1 then g2 else g2 ^ d1) d2 else (0::'a) else let h2 = if d1 = 1 then g2 else g2 ^ d1; d2 = n2 - n3; divisor = if d2 = 1 then g2 * h2 else if even d2 then - g2 * h2 ^ d2 else g2 * h2 ^ d2; G4 = sdiv_poly pmod divisor in resultant_impl_rec G3 G4 n3 d2 h2)
[PROOF STEP]
have id1: "(if even d1 then - pmod else pmod) = (-1)^ (d1 + 1) * (pmod :: 'a poly)" for pmod
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if even d1 then - pmod else pmod) = (- 1) ^ (d1 + 1) * pmod
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(if even d1 then - ?pmod2 else ?pmod2) = (- 1) ^ (d1 + 1) * ?pmod2

goal (1 subgoal):
 1. resultant_impl_start G1 G2 = (let pmod = pseudo_mod G1 G2; n2 = degree G2; n1 = degree G1; g2 = lead_coeff G2; d1 = n1 - n2 in if pmod = 0 then if n2 = 0 then if d1 = 0 then 1::'a else if d1 = 1 then g2 else g2 ^ d1 else (0::'a) else let G3 = if even d1 then - pmod else pmod; n3 = degree G3; pmod = pseudo_mod G2 G3 in if pmod = 0 then if n3 = 0 then let d2 = n2 - n3; g3 = lead_coeff G3 in if d2 = 1 then g3 else div_exp g3 (if d1 = 1 then g2 else g2 ^ d1) d2 else (0::'a) else let h2 = if d1 = 1 then g2 else g2 ^ d1; d2 = n2 - n3; divisor = if d2 = 1 then g2 * h2 else if even d2 then - g2 * h2 ^ d2 else g2 * h2 ^ d2; G4 = sdiv_poly pmod divisor in resultant_impl_rec G3 G4 n3 d2 h2)
[PROOF STEP]
have id3: "(if d2 = 1 then g2 * h2 else if even d2 then - g2 * h2 ^ d2 else g2 * h2 ^ d2) =
    ((- 1) ^ (d2 + 1) * g2 * h2 ^ d2)"
    for d2 and g2 h2 :: 'a
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if d2 = 1 then g2 * h2 else if even d2 then - g2 * h2 ^ d2 else g2 * h2 ^ d2) = (- (1::'a)) ^ (d2 + 1) * g2 * h2 ^ d2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(if ?d2.2 = 1 then ?g2.2 * ?h2.2 else if even ?d2.2 then - ?g2.2 * ?h2.2 ^ ?d2.2 else ?g2.2 * ?h2.2 ^ ?d2.2) = (- (1::'a)) ^ (?d2.2 + 1) * ?g2.2 * ?h2.2 ^ ?d2.2

goal (1 subgoal):
 1. resultant_impl_start G1 G2 = (let pmod = pseudo_mod G1 G2; n2 = degree G2; n1 = degree G1; g2 = lead_coeff G2; d1 = n1 - n2 in if pmod = 0 then if n2 = 0 then if d1 = 0 then 1::'a else if d1 = 1 then g2 else g2 ^ d1 else (0::'a) else let G3 = if even d1 then - pmod else pmod; n3 = degree G3; pmod = pseudo_mod G2 G3 in if pmod = 0 then if n3 = 0 then let d2 = n2 - n3; g3 = lead_coeff G3 in if d2 = 1 then g3 else div_exp g3 (if d1 = 1 then g2 else g2 ^ d1) d2 else (0::'a) else let h2 = if d1 = 1 then g2 else g2 ^ d1; d2 = n2 - n3; divisor = if d2 = 1 then g2 * h2 else if even d2 then - g2 * h2 ^ d2 else g2 * h2 ^ d2; G4 = sdiv_poly pmod divisor in resultant_impl_rec G3 G4 n3 d2 h2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. resultant_impl_start G1 G2 = (let pmod = pseudo_mod G1 G2; n2 = degree G2; n1 = degree G1; g2 = lead_coeff G2; d1 = n1 - n2 in if pmod = 0 then if n2 = 0 then if d1 = 0 then 1::'a else if d1 = 1 then g2 else g2 ^ d1 else (0::'a) else let G3 = if even d1 then - pmod else pmod; n3 = degree G3; pmod = pseudo_mod G2 G3 in if pmod = 0 then if n3 = 0 then let d2 = n2 - n3; g3 = lead_coeff G3 in if d2 = 1 then g3 else div_exp g3 (if d1 = 1 then g2 else g2 ^ d1) d2 else (0::'a) else let h2 = if d1 = 1 then g2 else g2 ^ d1; d2 = n2 - n3; divisor = if d2 = 1 then g2 * h2 else if even d2 then - g2 * h2 ^ d2 else g2 * h2 ^ d2; G4 = sdiv_poly pmod divisor in resultant_impl_rec G3 G4 n3 d2 h2)
[PROOF STEP]
unfolding resultant_impl_start_def subresultant_prs_impl_def resultant_impl_rec_def[symmetric] Let_def split
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if pseudo_mod G1 G2 = 0 then if degree G2 = 0 then lead_coeff G2 ^ (degree G1 - degree G2) else (0::'a) else if pseudo_mod G2 ((- 1) ^ (degree G1 - degree G2 + 1) * pseudo_mod G1 G2) = 0 then if degree ((- 1) ^ (degree G1 - degree G2 + 1) * pseudo_mod G1 G2) = 0 then if degree G2 - degree ((- 1) ^ (degree G1 - degree G2 + 1) * pseudo_mod G1 G2) = 1 then lead_coeff ((- 1) ^ (degree G1 - degree G2 + 1) * pseudo_mod G1 G2) else div_exp (lead_coeff ((- 1) ^ (degree G1 - degree G2 + 1) * pseudo_mod G1 G2)) (lead_coeff G2 ^ (degree G1 - degree G2)) (degree G2 - degree ((- 1) ^ (degree G1 - degree G2 + 1) * pseudo_mod G1 G2)) else (0::'a) else resultant_impl_rec ((- 1) ^ (degree G1 - degree G2 + 1) * pseudo_mod G1 G2) (sdiv_poly (pseudo_mod G2 ((- 1) ^ (degree G1 - degree G2 + 1) * pseudo_mod G1 G2)) ((- (1::'a)) ^ (degree G2 - degree ((- 1) ^ (degree G1 - degree G2 + 1) * pseudo_mod G1 G2) + 1) * lead_coeff G2 * (lead_coeff G2 ^ (degree G1 - degree G2)) ^ (degree G2 - degree ((- 1) ^ (degree G1 - degree G2 + 1) * pseudo_mod G1 G2)))) (degree ((- 1) ^ (degree G1 - degree G2 + 1) * pseudo_mod G1 G2)) (degree G2 - degree ((- 1) ^ (degree G1 - degree G2 + 1) * pseudo_mod G1 G2)) (lead_coeff G2 ^ (degree G1 - degree G2))) = (if pseudo_mod G1 G2 = 0 then if degree G2 = 0 then if degree G1 - degree G2 = 0 then 1::'a else if degree G1 - degree G2 = 1 then lead_coeff G2 else lead_coeff G2 ^ (degree G1 - degree G2) else (0::'a) else if pseudo_mod G2 (if even (degree G1 - degree G2) then - pseudo_mod G1 G2 else pseudo_mod G1 G2) = 0 then if degree (if even (degree G1 - degree G2) then - pseudo_mod G1 G2 else pseudo_mod G1 G2) = 0 then if degree G2 - degree (if even (degree G1 - degree G2) then - pseudo_mod G1 G2 else pseudo_mod G1 G2) = 1 then lead_coeff (if even (degree G1 - degree G2) then - pseudo_mod G1 G2 else pseudo_mod G1 G2) else div_exp (lead_coeff (if even (degree G1 - degree G2) then - pseudo_mod G1 G2 else pseudo_mod G1 G2)) (if degree G1 - degree G2 = 1 then lead_coeff G2 else lead_coeff G2 ^ (degree G1 - degree G2)) (degree G2 - degree (if even (degree G1 - degree G2) then - pseudo_mod G1 G2 else pseudo_mod G1 G2)) else (0::'a) else resultant_impl_rec (if even (degree G1 - degree G2) then - pseudo_mod G1 G2 else pseudo_mod G1 G2) (sdiv_poly (pseudo_mod G2 (if even (degree G1 - degree G2) then - pseudo_mod G1 G2 else pseudo_mod G1 G2)) (if degree G2 - degree (if even (degree G1 - degree G2) then - pseudo_mod G1 G2 else pseudo_mod G1 G2) = 1 then lead_coeff G2 * (if degree G1 - degree G2 = 1 then lead_coeff G2 else lead_coeff G2 ^ (degree G1 - degree G2)) else if even (degree G2 - degree (if even (degree G1 - degree G2) then - pseudo_mod G1 G2 else pseudo_mod G1 G2)) then - lead_coeff G2 * (if degree G1 - degree G2 = 1 then lead_coeff G2 else lead_coeff G2 ^ (degree G1 - degree G2)) ^ (degree G2 - degree (if even (degree G1 - degree G2) then - pseudo_mod G1 G2 else pseudo_mod G1 G2)) else lead_coeff G2 * (if degree G1 - degree G2 = 1 then lead_coeff G2 else lead_coeff G2 ^ (degree G1 - degree G2)) ^ (degree G2 - degree (if even (degree G1 - degree G2) then - pseudo_mod G1 G2 else pseudo_mod G1 G2)))) (degree (if even (degree G1 - degree G2) then - pseudo_mod G1 G2 else pseudo_mod G1 G2)) (degree G2 - degree (if even (degree G1 - degree G2) then - pseudo_mod G1 G2 else pseudo_mod G1 G2)) (if degree G1 - degree G2 = 1 then lead_coeff G2 else lead_coeff G2 ^ (degree G1 - degree G2)))
[PROOF STEP]
unfolding d1
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if pseudo_mod G1 G2 = 0 then if degree G2 = 0 then lead_coeff G2 ^ d1 else (0::'a) else if pseudo_mod G2 ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2) = 0 then if degree ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2) = 0 then if degree G2 - degree ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2) = 1 then lead_coeff ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2) else div_exp (lead_coeff ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2)) (lead_coeff G2 ^ d1) (degree G2 - degree ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2)) else (0::'a) else resultant_impl_rec ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2) (sdiv_poly (pseudo_mod G2 ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2)) ((- (1::'a)) ^ (degree G2 - degree ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2) + 1) * lead_coeff G2 * (lead_coeff G2 ^ d1) ^ (degree G2 - degree ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2)))) (degree ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2)) (degree G2 - degree ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2)) (lead_coeff G2 ^ d1)) = (if pseudo_mod G1 G2 = 0 then if degree G2 = 0 then if d1 = 0 then 1::'a else if d1 = 1 then lead_coeff G2 else lead_coeff G2 ^ d1 else (0::'a) else if pseudo_mod G2 (if even d1 then - pseudo_mod G1 G2 else pseudo_mod G1 G2) = 0 then if degree (if even d1 then - pseudo_mod G1 G2 else pseudo_mod G1 G2) = 0 then if degree G2 - degree (if even d1 then - pseudo_mod G1 G2 else pseudo_mod G1 G2) = 1 then lead_coeff (if even d1 then - pseudo_mod G1 G2 else pseudo_mod G1 G2) else div_exp (lead_coeff (if even d1 then - pseudo_mod G1 G2 else pseudo_mod G1 G2)) (if d1 = 1 then lead_coeff G2 else lead_coeff G2 ^ d1) (degree G2 - degree (if even d1 then - pseudo_mod G1 G2 else pseudo_mod G1 G2)) else (0::'a) else resultant_impl_rec (if even d1 then - pseudo_mod G1 G2 else pseudo_mod G1 G2) (sdiv_poly (pseudo_mod G2 (if even d1 then - pseudo_mod G1 G2 else pseudo_mod G1 G2)) (if degree G2 - degree (if even d1 then - pseudo_mod G1 G2 else pseudo_mod G1 G2) = 1 then lead_coeff G2 * (if d1 = 1 then lead_coeff G2 else lead_coeff G2 ^ d1) else if even (degree G2 - degree (if even d1 then - pseudo_mod G1 G2 else pseudo_mod G1 G2)) then - lead_coeff G2 * (if d1 = 1 then lead_coeff G2 else lead_coeff G2 ^ d1) ^ (degree G2 - degree (if even d1 then - pseudo_mod G1 G2 else pseudo_mod G1 G2)) else lead_coeff G2 * (if d1 = 1 then lead_coeff G2 else lead_coeff G2 ^ d1) ^ (degree G2 - degree (if even d1 then - pseudo_mod G1 G2 else pseudo_mod G1 G2)))) (degree (if even d1 then - pseudo_mod G1 G2 else pseudo_mod G1 G2)) (degree G2 - degree (if even d1 then - pseudo_mod G1 G2 else pseudo_mod G1 G2)) (if d1 = 1 then lead_coeff G2 else lead_coeff G2 ^ d1))
[PROOF STEP]
unfolding id1
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if pseudo_mod G1 G2 = 0 then if degree G2 = 0 then lead_coeff G2 ^ d1 else (0::'a) else if pseudo_mod G2 ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2) = 0 then if degree ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2) = 0 then if degree G2 - degree ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2) = 1 then lead_coeff ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2) else div_exp (lead_coeff ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2)) (lead_coeff G2 ^ d1) (degree G2 - degree ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2)) else (0::'a) else resultant_impl_rec ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2) (sdiv_poly (pseudo_mod G2 ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2)) ((- (1::'a)) ^ (degree G2 - degree ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2) + 1) * lead_coeff G2 * (lead_coeff G2 ^ d1) ^ (degree G2 - degree ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2)))) (degree ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2)) (degree G2 - degree ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2)) (lead_coeff G2 ^ d1)) = (if pseudo_mod G1 G2 = 0 then if degree G2 = 0 then if d1 = 0 then 1::'a else if d1 = 1 then lead_coeff G2 else lead_coeff G2 ^ d1 else (0::'a) else if pseudo_mod G2 ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2) = 0 then if degree ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2) = 0 then if degree G2 - degree ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2) = 1 then lead_coeff ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2) else div_exp (lead_coeff ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2)) (if d1 = 1 then lead_coeff G2 else lead_coeff G2 ^ d1) (degree G2 - degree ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2)) else (0::'a) else resultant_impl_rec ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2) (sdiv_poly (pseudo_mod G2 ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2)) (if degree G2 - degree ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2) = 1 then lead_coeff G2 * (if d1 = 1 then lead_coeff G2 else lead_coeff G2 ^ d1) else if even (degree G2 - degree ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2)) then - lead_coeff G2 * (if d1 = 1 then lead_coeff G2 else lead_coeff G2 ^ d1) ^ (degree G2 - degree ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2)) else lead_coeff G2 * (if d1 = 1 then lead_coeff G2 else lead_coeff G2 ^ d1) ^ (degree G2 - degree ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2)))) (degree ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2)) (degree G2 - degree ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2)) (if d1 = 1 then lead_coeff G2 else lead_coeff G2 ^ d1))
[PROOF STEP]
unfolding id3
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if pseudo_mod G1 G2 = 0 then if degree G2 = 0 then lead_coeff G2 ^ d1 else (0::'a) else if pseudo_mod G2 ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2) = 0 then if degree ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2) = 0 then if degree G2 - degree ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2) = 1 then lead_coeff ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2) else div_exp (lead_coeff ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2)) (lead_coeff G2 ^ d1) (degree G2 - degree ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2)) else (0::'a) else resultant_impl_rec ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2) (sdiv_poly (pseudo_mod G2 ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2)) ((- (1::'a)) ^ (degree G2 - degree ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2) + 1) * lead_coeff G2 * (lead_coeff G2 ^ d1) ^ (degree G2 - degree ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2)))) (degree ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2)) (degree G2 - degree ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2)) (lead_coeff G2 ^ d1)) = (if pseudo_mod G1 G2 = 0 then if degree G2 = 0 then if d1 = 0 then 1::'a else if d1 = 1 then lead_coeff G2 else lead_coeff G2 ^ d1 else (0::'a) else if pseudo_mod G2 ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2) = 0 then if degree ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2) = 0 then if degree G2 - degree ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2) = 1 then lead_coeff ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2) else div_exp (lead_coeff ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2)) (if d1 = 1 then lead_coeff G2 else lead_coeff G2 ^ d1) (degree G2 - degree ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2)) else (0::'a) else resultant_impl_rec ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2) (sdiv_poly (pseudo_mod G2 ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2)) ((- (1::'a)) ^ (degree G2 - degree ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2) + 1) * lead_coeff G2 * (if d1 = 1 then lead_coeff G2 else lead_coeff G2 ^ d1) ^ (degree G2 - degree ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2)))) (degree ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2)) (degree G2 - degree ((- 1) ^ (d1 + 1) * pseudo_mod G1 G2)) (if d1 = 1 then lead_coeff G2 else lead_coeff G2 ^ d1))
[PROOF STEP]
by (rule if_cong[OF refl if_cong if_cong], auto simp: power2_eq_square)
[PROOF STATE]
proof (state)
this:
resultant_impl_start G1 G2 = (let pmod = pseudo_mod G1 G2; n2 = degree G2; n1 = degree G1; g2 = lead_coeff G2; d1 = n1 - n2 in if pmod = 0 then if n2 = 0 then if d1 = 0 then 1::'a else if d1 = 1 then g2 else g2 ^ d1 else (0::'a) else let G3 = if even d1 then - pmod else pmod; n3 = degree G3; pmod = pseudo_mod G2 G3 in if pmod = 0 then if n3 = 0 then let d2 = n2 - n3; g3 = lead_coeff G3 in if d2 = 1 then g3 else div_exp g3 (if d1 = 1 then g2 else g2 ^ d1) d2 else (0::'a) else let h2 = if d1 = 1 then g2 else g2 ^ d1; d2 = n2 - n3; divisor = if d2 = 1 then g2 * h2 else if even d2 then - g2 * h2 ^ d2 else g2 * h2 ^ d2; G4 = sdiv_poly pmod divisor in resultant_impl_rec G3 G4 n3 d2 h2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mat_vec_mult_ntt:
  "A *v v = mat_vec_mult_ntt A v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *v v = A \<cdot>\<^bsub>ntt\<^esub> v
[PROOF STEP]
unfolding matrix_vector_mult_def mat_vec_mult_ntt_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<chi>i. \<Sum>j\<in>UNIV. A $ i $ j * v $ j) = (\<chi>i. \<Sum>j\<in>UNIV. A $ i $ j *\<^bsub>ntt\<^esub> v $ j)
[PROOF STEP]
using mult_ntt
[PROOF STATE]
proof (prove)
using this:
?f * ?g = ?f *\<^bsub>ntt\<^esub> ?g

goal (1 subgoal):
 1. (\<chi>i. \<Sum>j\<in>UNIV. A $ i $ j * v $ j) = (\<chi>i. \<Sum>j\<in>UNIV. A $ i $ j *\<^bsub>ntt\<^esub> v $ j)
[PROOF STEP]
by auto


[STATEMENT]
lemma Union_member: "(\<exists> S \<in> F . x \<in> S) \<longleftrightarrow> x \<in> \<Union> F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>S\<in>F. x \<in> S) = (x \<in> \<Union> F)
[PROOF STEP]
by blast


[STATEMENT]
lemma prod_A_is_p_unknown: assumes "\<And> a i. (a,i) \<in> as \<Longrightarrow> i < n"
  shows "p = (\<Prod>i = 0..< n. A i ^ Suc i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p = (\<Prod>i = 0..<n. A i ^ Suc i)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p = (\<Prod>i = 0..<n. A i ^ Suc i)
[PROOF STEP]
have "p = (\<Prod>(a, i)\<in>as. a ^ Suc i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p = (\<Prod>(a, i)\<in>as. a ^ Suc i)
[PROOF STEP]
by (rule p)
[PROOF STATE]
proof (state)
this:
p = (\<Prod>(a, i)\<in>as. a ^ Suc i)

goal (1 subgoal):
 1. p = (\<Prod>i = 0..<n. A i ^ Suc i)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
p = (\<Prod>(a, i)\<in>as. a ^ Suc i)

goal (1 subgoal):
 1. p = (\<Prod>i = 0..<n. A i ^ Suc i)
[PROOF STEP]
have "\<dots> = (\<Prod>i = 0..< n. A i ^ Suc i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>(a, i)\<in>as. a ^ Suc i) = (\<Prod>i = 0..<n. A i ^ Suc i)
[PROOF STEP]
unfolding prod_A
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>(a, i)\<in>as. a ^ Suc i) = (\<Prod>(a, i)\<in>as \<inter> UNIV \<times> {0..<n}. a ^ Suc i)
[PROOF STEP]
by (rule prod.cong, insert assms, auto)
[PROOF STATE]
proof (state)
this:
(\<Prod>(a, i)\<in>as. a ^ Suc i) = (\<Prod>i = 0..<n. A i ^ Suc i)

goal (1 subgoal):
 1. p = (\<Prod>i = 0..<n. A i ^ Suc i)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
p = (\<Prod>i = 0..<n. A i ^ Suc i)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
p = (\<Prod>i = 0..<n. A i ^ Suc i)

goal (1 subgoal):
 1. p = (\<Prod>i = 0..<n. A i ^ Suc i)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
p = (\<Prod>i = 0..<n. A i ^ Suc i)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma winning_position_will_remain_winning_Odd:
  assumes "even (length p)" "position (p @ [m])" "winning_position_Odd p"
  shows "winning_position_Odd (p @ [m])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. winning_position_Odd (p @ [m])
[PROOF STEP]
using assms any_moves_remain_winning_Odd[OF assms(1)]
[PROOF STATE]
proof (prove)
using this:
even (length p)
position (p @ [m])
winning_position_Odd p
strategy_winning_by_Odd ?\<sigma> p \<Longrightarrow> strategy_winning_by_Odd ?\<sigma> (p @ [?m])

goal (1 subgoal):
 1. winning_position_Odd (p @ [m])
[PROOF STEP]
by auto


[STATEMENT]
lemma finite_bitset:
  "finite (bitset n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (bitset n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite (bitset n)
[PROOF STEP]
have "bitset n \<subseteq> {..n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bitset n \<subseteq> {..n}
[PROOF STEP]
by (auto dest: in_bitset_bound_weak)
[PROOF STATE]
proof (state)
this:
bitset n \<subseteq> {..n}

goal (1 subgoal):
 1. finite (bitset n)
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
bitset n \<subseteq> {..n}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
bitset n \<subseteq> {..n}

goal (1 subgoal):
 1. finite (bitset n)
[PROOF STEP]
using finite_subset
[PROOF STATE]
proof (prove)
using this:
bitset n \<subseteq> {..n}
\<lbrakk>?A \<subseteq> ?B; finite ?B\<rbrakk> \<Longrightarrow> finite ?A

goal (1 subgoal):
 1. finite (bitset n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite (bitset n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma le_f_make_mono:
"\<lbrakk>\<forall>n. f n < oLimit f; m \<le> make_mono f n\<rbrakk> \<Longrightarrow> f m \<le> f (make_mono f n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>n. f n < oLimit f; m \<le> make_mono f n\<rbrakk> \<Longrightarrow> f m \<le> f (make_mono f n)
[PROOF STEP]
apply (auto simp add: order_le_less)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>n. f n < oLimit f; f m \<noteq> f (make_mono f n); m < make_mono f n\<rbrakk> \<Longrightarrow> f m < f (make_mono f n)
[PROOF STEP]
apply (case_tac n, simp_all)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>nat. \<lbrakk>\<forall>n. f n < oLimit f; f m \<noteq> f (LEAST x. f (make_mono f nat) < f x); m < (LEAST x. f (make_mono f nat) < f x); n = Suc nat\<rbrakk> \<Longrightarrow> f m < f (LEAST x. f (make_mono f nat) < f x)
[PROOF STEP]
apply (drule not_less_Least)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>nat. \<lbrakk>\<forall>n. f n < oLimit f; f m \<noteq> f (LEAST x. f (make_mono f nat) < f x); n = Suc nat; \<not> f (make_mono f nat) < f m\<rbrakk> \<Longrightarrow> f m < f (LEAST x. f (make_mono f nat) < f x)
[PROOF STEP]
apply (simp add: linorder_not_less)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>nat. \<lbrakk>\<forall>n. f n < oLimit f; f m \<noteq> f (LEAST x. f (make_mono f nat) < f x); n = Suc nat; f m \<le> f (make_mono f nat)\<rbrakk> \<Longrightarrow> f m < f (LEAST x. f (make_mono f nat) < f x)
[PROOF STEP]
apply (erule order_le_less_trans)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>nat. \<lbrakk>\<forall>n. f n < oLimit f; f m \<noteq> f (LEAST x. f (make_mono f nat) < f x); n = Suc nat\<rbrakk> \<Longrightarrow> f (make_mono f nat) < f (LEAST x. f (make_mono f nat) < f x)
[PROOF STEP]
apply (rule LeastI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>nat. \<lbrakk>\<forall>n. f n < oLimit f; f m \<noteq> f (LEAST x. f (make_mono f nat) < f x); n = Suc nat\<rbrakk> \<Longrightarrow> f (make_mono f nat) < f (?k11 nat)
[PROOF STEP]
apply (erule f_make_mono_less)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma deg_mod_qr_poly:
  assumes "degree x < deg_qr TYPE('a)"
  shows "x mod (qr_poly :: 'a mod_ring poly) = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x mod qr_poly = x
[PROOF STEP]
using mod_poly_less[of x qr_poly]
[PROOF STATE]
proof (prove)
using this:
degree x < degree qr_poly \<Longrightarrow> x mod qr_poly = x

goal (1 subgoal):
 1. x mod qr_poly = x
[PROOF STEP]
unfolding deg_qr_def
[PROOF STATE]
proof (prove)
using this:
degree x < degree qr_poly \<Longrightarrow> x mod qr_poly = x

goal (1 subgoal):
 1. x mod qr_poly = x
[PROOF STEP]
by (metis assms degree_qr_poly)


[STATEMENT]
theorem sup_state_append_fst:
  "length a = length b \<Longrightarrow>
  (G \<turnstile> (a@x,i) <=s (b@y,j)) = ((G \<turnstile> (a,i) <=s (b,j)) \<and> (G \<turnstile> (x,i) <=s (y,j)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length a = length b \<Longrightarrow> G \<turnstile> (a @ x, i) <=s (b @ y, j) = (G \<turnstile> (a, i) <=s (b, j) \<and> G \<turnstile> (x, i) <=s (y, j))
[PROOF STEP]
by (auto simp add: sup_state_def stk_convert lesub_def Product.le_def sup_loc_append)


[STATEMENT]
lemma shift_vars_closed:
  assumes "p \<in> carrier (R[\<X>\<^bsub>n\<^esub>])"
  shows "shift_vars n m p \<in> carrier (R[\<X>\<^bsub>n+m\<^esub>])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. shift_vars n m p \<in> carrier (R [\<X>\<^bsub>n + m\<^esub>])
[PROOF STEP]
using assms shift_vars_char(1)[of n m] ring_hom_closed[of "shift_vars n m"]
[PROOF STATE]
proof (prove)
using this:
p \<in> carrier (R [\<X>\<^bsub>n\<^esub>])
ring_hom_ring (R [\<X>\<^bsub>n\<^esub>]) (R [\<X>\<^bsub>n + m\<^esub>]) (shift_vars n m)
\<lbrakk>shift_vars n m \<in> ring_hom ?R ?S; ?x \<in> carrier ?R\<rbrakk> \<Longrightarrow> shift_vars n m ?x \<in> carrier ?S

goal (1 subgoal):
 1. shift_vars n m p \<in> carrier (R [\<X>\<^bsub>n + m\<^esub>])
[PROOF STEP]
unfolding ring_hom_ring_def ring_hom_ring_axioms_def
[PROOF STATE]
proof (prove)
using this:
p \<in> carrier (R [\<X>\<^bsub>n\<^esub>])
ring (R [\<X>\<^bsub>n\<^esub>]) \<and> ring (R [\<X>\<^bsub>n + m\<^esub>]) \<and> shift_vars n m \<in> ring_hom (R [\<X>\<^bsub>n\<^esub>]) (R [\<X>\<^bsub>n + m\<^esub>])
\<lbrakk>shift_vars n m \<in> ring_hom ?R ?S; ?x \<in> carrier ?R\<rbrakk> \<Longrightarrow> shift_vars n m ?x \<in> carrier ?S

goal (1 subgoal):
 1. shift_vars n m p \<in> carrier (R [\<X>\<^bsub>n + m\<^esub>])
[PROOF STEP]
by blast


[STATEMENT]
lemma prv_imp_exi:
  assumes "x \<in> var" and "\<phi> \<in> fmla" and "\<chi> \<in> fmla"
  shows "x \<notin> Fvars \<phi> \<Longrightarrow> prv (exi x (imp \<phi> \<chi>)) \<Longrightarrow> prv (imp \<phi> (exi x \<chi>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<notin> Fvars \<phi>; prv (exi x (imp \<phi> \<chi>))\<rbrakk> \<Longrightarrow> prv (imp \<phi> (exi x \<chi>))
[PROOF STEP]
using assms prv_imp_imp_exi prv_imp_mp
[PROOF STATE]
proof (prove)
using this:
x \<in> var
\<phi> \<in> fmla
\<chi> \<in> fmla
\<lbrakk>?x \<in> var; ?\<phi> \<in> fmla; ?\<chi> \<in> fmla; ?x \<notin> Fvars ?\<phi>\<rbrakk> \<Longrightarrow> prv (imp (exi ?x (imp ?\<phi> ?\<chi>)) (imp ?\<phi> (exi ?x ?\<chi>)))
\<lbrakk>?\<phi> \<in> fmla; ?\<chi> \<in> fmla; prv (imp ?\<phi> ?\<chi>); prv ?\<phi>\<rbrakk> \<Longrightarrow> prv ?\<chi>

goal (1 subgoal):
 1. \<lbrakk>x \<notin> Fvars \<phi>; prv (exi x (imp \<phi> \<chi>))\<rbrakk> \<Longrightarrow> prv (imp \<phi> (exi x \<chi>))
[PROOF STEP]
by (meson exi imp)


[STATEMENT]
lemma "ceros_of_boolean_input v = {x. x < dim_vec v \<and> \<not> vec_index v x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ceros_of_boolean_input v = {x. x < dim_vec v \<and> \<not> v $ x}
[PROOF STEP]
unfolding ceros_of_boolean_input_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. x < dim_vec v \<and> v $ x = False} = {x. x < dim_vec v \<and> \<not> v $ x}
[PROOF STEP]
by simp


[STATEMENT]
lemma jordan_nf_powE: assumes A: "A \<in> carrier_mat n n" and jnf: "jordan_nf A n_as"
  obtains P Q where "P \<in> carrier_mat n n" "Q \<in> carrier_mat n n" and
  "char_poly A = (\<Prod>(na, a)\<leftarrow>n_as. [:- a, 1:] ^ na)"
  "\<And> k. A ^\<^sub>m k = P * (jordan_matrix n_as)^\<^sub>m k * Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>P Q. \<lbrakk>P \<in> carrier_mat n n; Q \<in> carrier_mat n n; char_poly A = (\<Prod>(na, a)\<leftarrow>n_as. [:- a, 1::'a:] ^ na); \<And>k. A ^\<^sub>m k = P * jordan_matrix n_as ^\<^sub>m k * Q\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>P Q. \<lbrakk>P \<in> carrier_mat n n; Q \<in> carrier_mat n n; char_poly A = (\<Prod>(na, a)\<leftarrow>n_as. [:- a, 1::'a:] ^ na); \<And>k. A ^\<^sub>m k = P * jordan_matrix n_as ^\<^sub>m k * Q\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from A
[PROOF STATE]
proof (chain)
picking this:
A \<in> carrier_mat n n
[PROOF STEP]
have dim: "dim_row A = n"
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n

goal (1 subgoal):
 1. dim_row A = n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dim_row A = n

goal (1 subgoal):
 1. (\<And>P Q. \<lbrakk>P \<in> carrier_mat n n; Q \<in> carrier_mat n n; char_poly A = (\<Prod>(na, a)\<leftarrow>n_as. [:- a, 1::'a:] ^ na); \<And>k. A ^\<^sub>m k = P * jordan_matrix n_as ^\<^sub>m k * Q\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
assume obt: "\<And>P Q. P \<in> carrier_mat n n \<Longrightarrow> Q \<in> carrier_mat n n \<Longrightarrow>
    char_poly A = (\<Prod>(na, a)\<leftarrow>n_as. [:- a, 1:] ^ na) \<Longrightarrow>
    (\<And>k. A ^\<^sub>m k = P * jordan_matrix n_as ^\<^sub>m k * Q) \<Longrightarrow> thesis"
[PROOF STATE]
proof (state)
this:
\<lbrakk>?P \<in> carrier_mat n n; ?Q \<in> carrier_mat n n; char_poly A = (\<Prod>(na, a)\<leftarrow>n_as. [:- a, 1::'a:] ^ na); \<And>k. A ^\<^sub>m k = ?P * jordan_matrix n_as ^\<^sub>m k * ?Q\<rbrakk> \<Longrightarrow> thesis

goal (1 subgoal):
 1. (\<And>P Q. \<lbrakk>P \<in> carrier_mat n n; Q \<in> carrier_mat n n; char_poly A = (\<Prod>(na, a)\<leftarrow>n_as. [:- a, 1::'a:] ^ na); \<And>k. A ^\<^sub>m k = P * jordan_matrix n_as ^\<^sub>m k * Q\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from jnf[unfolded jordan_nf_def]
[PROOF STATE]
proof (chain)
picking this:
0 \<notin> fst ` set n_as \<and> similar_mat A (jordan_matrix n_as)
[PROOF STEP]
obtain P Q where
    simw: "similar_mat_wit A (jordan_matrix n_as) P Q"
    and sim: "similar_mat A (jordan_matrix n_as)"
[PROOF STATE]
proof (prove)
using this:
0 \<notin> fst ` set n_as \<and> similar_mat A (jordan_matrix n_as)

goal (1 subgoal):
 1. (\<And>P Q. \<lbrakk>similar_mat_wit A (jordan_matrix n_as) P Q; similar_mat A (jordan_matrix n_as)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding similar_mat_def
[PROOF STATE]
proof (prove)
using this:
0 \<notin> fst ` set n_as \<and> (\<exists>P. Ex (similar_mat_wit A (jordan_matrix n_as) P))

goal (1 subgoal):
 1. (\<And>P Q. \<lbrakk>similar_mat_wit A (jordan_matrix n_as) P Q; \<exists>P. Ex (similar_mat_wit A (jordan_matrix n_as) P)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
similar_mat_wit A (jordan_matrix n_as) P Q
similar_mat A (jordan_matrix n_as)

goal (1 subgoal):
 1. (\<And>P Q. \<lbrakk>P \<in> carrier_mat n n; Q \<in> carrier_mat n n; char_poly A = (\<Prod>(na, a)\<leftarrow>n_as. [:- a, 1::'a:] ^ na); \<And>k. A ^\<^sub>m k = P * jordan_matrix n_as ^\<^sub>m k * Q\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
show thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. thesis
[PROOF STEP]
proof (rule obt)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. ?P \<in> carrier_mat n n
 2. ?Q \<in> carrier_mat n n
 3. char_poly A = (\<Prod>(na, a)\<leftarrow>n_as. [:- a, 1::'a:] ^ na)
 4. \<And>k. A ^\<^sub>m k = ?P * jordan_matrix n_as ^\<^sub>m k * ?Q
[PROOF STEP]
show "\<And> k. A ^\<^sub>m k = P * jordan_matrix n_as ^\<^sub>m k * Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>k. A ^\<^sub>m k = P * jordan_matrix n_as ^\<^sub>m k * Q
[PROOF STEP]
by (rule similar_mat_wit_pow_id[OF simw])
[PROOF STATE]
proof (state)
this:
A ^\<^sub>m ?k = P * jordan_matrix n_as ^\<^sub>m ?k * Q

goal (3 subgoals):
 1. P \<in> carrier_mat n n
 2. Q \<in> carrier_mat n n
 3. char_poly A = (\<Prod>(na, a)\<leftarrow>n_as. [:- a, 1::'a:] ^ na)
[PROOF STEP]
show "char_poly A = (\<Prod>(na, a)\<leftarrow>n_as. [:- a, 1:] ^ na)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. char_poly A = (\<Prod>(na, a)\<leftarrow>n_as. [:- a, 1::'a:] ^ na)
[PROOF STEP]
unfolding char_poly_similar[OF sim] jordan_matrix_char_poly
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>(n, a)\<leftarrow>n_as. [:- a, 1::'a:] ^ n) = (\<Prod>(na, a)\<leftarrow>n_as. [:- a, 1::'a:] ^ na)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
char_poly A = (\<Prod>(na, a)\<leftarrow>n_as. [:- a, 1::'a:] ^ na)

goal (2 subgoals):
 1. P \<in> carrier_mat n n
 2. Q \<in> carrier_mat n n
[PROOF STEP]
qed (insert simw[unfolded similar_mat_wit_def Let_def dim], auto)
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma word_pred_0_n1: "word_pred 0 = word_of_int (- 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. word_pred 0 = word_of_int (- 1)
[PROOF STEP]
unfolding word_pred_m1
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 - 1 = word_of_int (- 1)
[PROOF STEP]
by simp


[STATEMENT]
lemma listrel_eq_len:  "(xs, ys) \<in> listrel r \<Longrightarrow> length xs = length ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (xs, ys) \<in> listrel r \<Longrightarrow> length xs = length ys
[PROOF STEP]
by(induct rule: listrel.induct) auto


[STATEMENT]
lemma split_paired_Ball_mset_Sigma_mset[simp]:
  "(\<forall>z\<in>#Sigma_mset A B. P z) \<longleftrightarrow> (\<forall>x\<in>#A. \<forall>y\<in>#B x. P (x, y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>z\<in>#Sigma_mset A B. P z) = (\<forall>x\<in>#A. \<forall>y\<in>#B x. P (x, y))
[PROOF STEP]
by blast


[STATEMENT]
lemma inversion_unit_circle [simp]:
  assumes "on_circline unit_circle x"
  shows "inversion x = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inversion x = x
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inversion x = x
[PROOF STEP]
obtain x' where "x = of_complex x'" "x' \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x'. \<lbrakk>x = of_complex x'; x' \<noteq> 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using inf_or_of_complex[of x]
[PROOF STATE]
proof (prove)
using this:
x = \<infinity>\<^sub>h \<or> (\<exists>xa. x = of_complex xa)

goal (1 subgoal):
 1. (\<And>x'. \<lbrakk>x = of_complex x'; x' \<noteq> 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x = \<infinity>\<^sub>h \<or> (\<exists>xa. x = of_complex xa)
on_circline unit_circle x

goal (1 subgoal):
 1. (\<And>x'. \<lbrakk>x = of_complex x'; x' \<noteq> 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
x = of_complex x'
x' \<noteq> 0

goal (1 subgoal):
 1. inversion x = x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
x = of_complex x'
x' \<noteq> 0

goal (1 subgoal):
 1. inversion x = x
[PROOF STEP]
hence "x' * cnj x' = 1"
[PROOF STATE]
proof (prove)
using this:
x = of_complex x'
x' \<noteq> 0

goal (1 subgoal):
 1. x' * cnj x' = 1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x = of_complex x'
x' \<noteq> 0
on_circline unit_circle x

goal (1 subgoal):
 1. x' * cnj x' = 1
[PROOF STEP]
using circline_set_unit_circle
[PROOF STATE]
proof (prove)
using this:
x = of_complex x'
x' \<noteq> 0
on_circline unit_circle x
circline_set unit_circle = of_complex ` {z. cmod z = 1}

goal (1 subgoal):
 1. x' * cnj x' = 1
[PROOF STEP]
unfolding circline_set_def
[PROOF STATE]
proof (prove)
using this:
x = of_complex x'
x' \<noteq> 0
on_circline unit_circle x
Collect (on_circline unit_circle) = of_complex ` {z. cmod z = 1}

goal (1 subgoal):
 1. x' * cnj x' = 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x' * cnj x' = 1

goal (1 subgoal):
 1. inversion x = x
[PROOF STEP]
hence "1 / cnj x' = x'"
[PROOF STATE]
proof (prove)
using this:
x' * cnj x' = 1

goal (1 subgoal):
 1. 1 / cnj x' = x'
[PROOF STEP]
using \<open>x' \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
x' * cnj x' = 1
x' \<noteq> 0

goal (1 subgoal):
 1. 1 / cnj x' = x'
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
1 / cnj x' = x'

goal (1 subgoal):
 1. inversion x = x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
x = of_complex x'
x' \<noteq> 0
1 / cnj x' = x'
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x = of_complex x'
x' \<noteq> 0
1 / cnj x' = x'

goal (1 subgoal):
 1. inversion x = x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x = of_complex x'
x' \<noteq> 0
1 / cnj x' = x'
on_circline unit_circle x

goal (1 subgoal):
 1. inversion x = x
[PROOF STEP]
unfolding inversion_def
[PROOF STATE]
proof (prove)
using this:
x = of_complex x'
x' \<noteq> 0
1 / cnj x' = x'
on_circline unit_circle x

goal (1 subgoal):
 1. (conjugate \<circ> reciprocal) x = x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
inversion x = x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma continuous_arcosh_strong [continuous_intros]:
  assumes "continuous F f" "eventually (\<lambda>x. f x \<ge> 1) F"
  shows   "continuous F (\<lambda>x. arcosh (f x :: real))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous F (\<lambda>x. arcosh (f x))
[PROOF STEP]
proof (cases "F = bot")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. F = bot \<Longrightarrow> continuous F (\<lambda>x. arcosh (f x))
 2. F \<noteq> bot \<Longrightarrow> continuous F (\<lambda>x. arcosh (f x))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
F \<noteq> bot

goal (2 subgoals):
 1. F = bot \<Longrightarrow> continuous F (\<lambda>x. arcosh (f x))
 2. F \<noteq> bot \<Longrightarrow> continuous F (\<lambda>x. arcosh (f x))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous F (\<lambda>x. arcosh (f x))
[PROOF STEP]
unfolding continuous_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. arcosh (f x)) \<longlongrightarrow> arcosh (f (Lim F (\<lambda>x. x)))) F
[PROOF STEP]
proof (intro tendsto_arcosh_strong)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. (f \<longlongrightarrow> f (Lim F (\<lambda>x. x))) F
 2. 1 \<le> f (Lim F (\<lambda>x. x))
 3. \<forall>\<^sub>F x in F. 1 \<le> f x
[PROOF STEP]
show "1 \<le> f (Lim F (\<lambda>x. x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> f (Lim F (\<lambda>x. x))
[PROOF STEP]
using assms False
[PROOF STATE]
proof (prove)
using this:
continuous F f
\<forall>\<^sub>F x in F. 1 \<le> f x
F \<noteq> bot

goal (1 subgoal):
 1. 1 \<le> f (Lim F (\<lambda>x. x))
[PROOF STEP]
unfolding continuous_def
[PROOF STATE]
proof (prove)
using this:
(f \<longlongrightarrow> f (Lim F (\<lambda>x. x))) F
\<forall>\<^sub>F x in F. 1 \<le> f x
F \<noteq> bot

goal (1 subgoal):
 1. 1 \<le> f (Lim F (\<lambda>x. x))
[PROOF STEP]
by (rule tendsto_lowerbound)
[PROOF STATE]
proof (state)
this:
1 \<le> f (Lim F (\<lambda>x. x))

goal (2 subgoals):
 1. (f \<longlongrightarrow> f (Lim F (\<lambda>x. x))) F
 2. \<forall>\<^sub>F x in F. 1 \<le> f x
[PROOF STEP]
qed (insert assms, auto simp: continuous_def)
[PROOF STATE]
proof (state)
this:
continuous F (\<lambda>x. arcosh (f x))

goal (1 subgoal):
 1. F = bot \<Longrightarrow> continuous F (\<lambda>x. arcosh (f x))
[PROOF STEP]
qed auto


[STATEMENT]
lemma cyclic_path_shift :
  assumes "path M q p"
  and     "target q p = q"
shows "path M (target q (take i p)) ((drop i p) @ (take i p))"
  and "target (target q (take i p)) ((drop i p) @ (take i p)) = (target q (take i p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path M (target q (take i p)) (drop i p @ take i p) &&& target (target q (take i p)) (drop i p @ take i p) = target q (take i p)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. path M (target q (take i p)) (drop i p @ take i p)
 2. target (target q (take i p)) (drop i p @ take i p) = target q (take i p)
[PROOF STEP]
show "path M (target q (take i p)) ((drop i p) @ (take i p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path M (target q (take i p)) (drop i p @ take i p)
[PROOF STEP]
by (metis append_take_drop_id assms(1) assms(2) path_append path_append_elim path_append_target)
[PROOF STATE]
proof (state)
this:
path M (target q (take i p)) (drop i p @ take i p)

goal (1 subgoal):
 1. target (target q (take i p)) (drop i p @ take i p) = target q (take i p)
[PROOF STEP]
show "target (target q (take i p)) ((drop i p) @ (take i p)) = (target q (take i p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. target (target q (take i p)) (drop i p @ take i p) = target q (take i p)
[PROOF STEP]
by (metis append_take_drop_id assms(2) path_append_target)
[PROOF STATE]
proof (state)
this:
target (target q (take i p)) (drop i p @ take i p) = target q (take i p)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma type_definition_Domainp: "Domainp T = (\<lambda>x. x \<in> A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Domainp T = (\<lambda>x. x \<in> A)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Domainp T = (\<lambda>x. x \<in> A)
[PROOF STEP]
interpret type_definition Rep Abs A
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. type_definition Rep Abs A
[PROOF STEP]
by(rule type)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Domainp T = (\<lambda>x. x \<in> A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Domainp T = (\<lambda>x. x \<in> A)
[PROOF STEP]
unfolding Domainp_iff[abs_def] T_def fun_eq_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. (\<exists>y. x = Rep y) = (x \<in> A)
[PROOF STEP]
by (metis Abs_inverse Rep)
[PROOF STATE]
proof (state)
this:
Domainp T = (\<lambda>x. x \<in> A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma not_cong_3421:
  assumes "\<not> Cong A B C D"
  shows "\<not> Cong C D B A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> Cong C D B A
[PROOF STEP]
using assms cong_4312
[PROOF STATE]
proof (prove)
using this:
\<not> Cong A B C D
Cong ?A ?B ?C ?D \<Longrightarrow> Cong ?D ?C ?A ?B

goal (1 subgoal):
 1. \<not> Cong C D B A
[PROOF STEP]
by blast


[STATEMENT]
lemma rel_fset_image:
  assumes "rel_fset P A B"
  assumes "\<And>a b. a |\<in>| A \<Longrightarrow> b |\<in>| B \<Longrightarrow> P a b \<Longrightarrow> Q (f a) (g b)"
  shows "rel_fset Q (f |`| A) (g |`| B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_fset Q (f |`| A) (g |`| B)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
rel_fset P A B
\<lbrakk>?a |\<in>| A; ?b |\<in>| B; P ?a ?b\<rbrakk> \<Longrightarrow> Q (f ?a) (g ?b)

goal (1 subgoal):
 1. rel_fset Q (f |`| A) (g |`| B)
[PROOF STEP]
by transfer' (rule rel_set_image)


[STATEMENT]
lemma reflects_isomorphic:
    assumes "A.ide f" and "A.ide f'" and "B.isomorphic (F f) (F f')"
    shows "A.isomorphic f f'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A.isomorphic f f'
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A.isomorphic f f'
[PROOF STEP]
obtain \<psi> where \<psi>: "B.in_hom \<psi> (F f) (F f') \<and> B.iso \<psi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>\<psi>. \<guillemotleft>\<psi> : F f \<rightarrow>\<^sub>B F f'\<guillemotright> \<and> B.iso \<psi> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms B.isomorphic_def
[PROOF STATE]
proof (prove)
using this:
A.ide f
A.ide f'
B.isomorphic (F f) (F f')
B.isomorphic ?a ?a' = (\<exists>f. \<guillemotleft>f : ?a \<rightarrow>\<^sub>B ?a'\<guillemotright> \<and> B.iso f)

goal (1 subgoal):
 1. (\<And>\<psi>. \<guillemotleft>\<psi> : F f \<rightarrow>\<^sub>B F f'\<guillemotright> \<and> B.iso \<psi> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<guillemotleft>\<psi> : F f \<rightarrow>\<^sub>B F f'\<guillemotright> \<and> B.iso \<psi>

goal (1 subgoal):
 1. A.isomorphic f f'
[PROOF STEP]
obtain \<phi> where \<phi>: "A.in_hom \<phi> f f' \<and> F \<phi> = \<psi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>\<phi>. \<guillemotleft>\<phi> : f \<rightarrow>\<^sub>A f'\<guillemotright> \<and> F \<phi> = \<psi> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms \<psi> is_full
[PROOF STATE]
proof (prove)
using this:
A.ide f
A.ide f'
B.isomorphic (F f) (F f')
\<guillemotleft>\<psi> : F f \<rightarrow>\<^sub>B F f'\<guillemotright> \<and> B.iso \<psi>
\<lbrakk>A.ide ?a; A.ide ?a'; \<guillemotleft>?g : F ?a' \<rightarrow>\<^sub>B F ?a\<guillemotright>\<rbrakk> \<Longrightarrow> \<exists>f. \<guillemotleft>f : ?a' \<rightarrow>\<^sub>A ?a\<guillemotright> \<and> F f = ?g

goal (1 subgoal):
 1. (\<And>\<phi>. \<guillemotleft>\<phi> : f \<rightarrow>\<^sub>A f'\<guillemotright> \<and> F \<phi> = \<psi> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<guillemotleft>\<phi> : f \<rightarrow>\<^sub>A f'\<guillemotright> \<and> F \<phi> = \<psi>

goal (1 subgoal):
 1. A.isomorphic f f'
[PROOF STEP]
have "A.iso \<phi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A.iso \<phi>
[PROOF STEP]
using \<phi> \<psi> reflects_iso
[PROOF STATE]
proof (prove)
using this:
\<guillemotleft>\<phi> : f \<rightarrow>\<^sub>A f'\<guillemotright> \<and> F \<phi> = \<psi>
\<guillemotleft>\<psi> : F f \<rightarrow>\<^sub>B F f'\<guillemotright> \<and> B.iso \<psi>
\<lbrakk>\<guillemotleft>?f : ?a' \<rightarrow>\<^sub>A ?a\<guillemotright>; B.iso (F ?f)\<rbrakk> \<Longrightarrow> A.iso ?f

goal (1 subgoal):
 1. A.iso \<phi>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A.iso \<phi>

goal (1 subgoal):
 1. A.isomorphic f f'
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
A.iso \<phi>

goal (1 subgoal):
 1. A.isomorphic f f'
[PROOF STEP]
using \<phi> A.isomorphic_def
[PROOF STATE]
proof (prove)
using this:
A.iso \<phi>
\<guillemotleft>\<phi> : f \<rightarrow>\<^sub>A f'\<guillemotright> \<and> F \<phi> = \<psi>
A.isomorphic ?a ?a' = (\<exists>f. \<guillemotleft>f : ?a \<rightarrow>\<^sub>A ?a'\<guillemotright> \<and> A.iso f)

goal (1 subgoal):
 1. A.isomorphic f f'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A.isomorphic f f'

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Cons_nth_drop_Suc:
  "i < length xs \<Longrightarrow> (xs!i) # (drop (Suc i) xs) = drop i xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < length xs \<Longrightarrow> xs ! i # drop (Suc i) xs = drop i xs
[PROOF STEP]
proof (induct xs arbitrary: i)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. i < length [] \<Longrightarrow> [] ! i # drop (Suc i) [] = drop i []
 2. \<And>a xs i. \<lbrakk>\<And>i. i < length xs \<Longrightarrow> xs ! i # drop (Suc i) xs = drop i xs; i < length (a # xs)\<rbrakk> \<Longrightarrow> (a # xs) ! i # drop (Suc i) (a # xs) = drop i (a # xs)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
i < length []

goal (2 subgoals):
 1. \<And>i. i < length [] \<Longrightarrow> [] ! i # drop (Suc i) [] = drop i []
 2. \<And>a xs i. \<lbrakk>\<And>i. i < length xs \<Longrightarrow> xs ! i # drop (Suc i) xs = drop i xs; i < length (a # xs)\<rbrakk> \<Longrightarrow> (a # xs) ! i # drop (Suc i) (a # xs) = drop i (a # xs)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i < length []
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
i < length []

goal (1 subgoal):
 1. [] ! i # drop (Suc i) [] = drop i []
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
[] ! i # drop (Suc i) [] = drop i []

goal (1 subgoal):
 1. \<And>a xs i. \<lbrakk>\<And>i. i < length xs \<Longrightarrow> xs ! i # drop (Suc i) xs = drop i xs; i < length (a # xs)\<rbrakk> \<Longrightarrow> (a # xs) ! i # drop (Suc i) (a # xs) = drop i (a # xs)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a xs i. \<lbrakk>\<And>i. i < length xs \<Longrightarrow> xs ! i # drop (Suc i) xs = drop i xs; i < length (a # xs)\<rbrakk> \<Longrightarrow> (a # xs) ! i # drop (Suc i) (a # xs) = drop i (a # xs)
[PROOF STEP]
case Cons
[PROOF STATE]
proof (state)
this:
?i < length xs_ \<Longrightarrow> xs_ ! ?i # drop (Suc ?i) xs_ = drop ?i xs_
i < length (a_ # xs_)

goal (1 subgoal):
 1. \<And>a xs i. \<lbrakk>\<And>i. i < length xs \<Longrightarrow> xs ! i # drop (Suc i) xs = drop i xs; i < length (a # xs)\<rbrakk> \<Longrightarrow> (a # xs) ! i # drop (Suc i) (a # xs) = drop i (a # xs)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?i < length xs_ \<Longrightarrow> xs_ ! ?i # drop (Suc ?i) xs_ = drop ?i xs_
i < length (a_ # xs_)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
?i < length xs_ \<Longrightarrow> xs_ ! ?i # drop (Suc ?i) xs_ = drop ?i xs_
i < length (a_ # xs_)

goal (1 subgoal):
 1. (a_ # xs_) ! i # drop (Suc i) (a_ # xs_) = drop i (a_ # xs_)
[PROOF STEP]
by (cases i) auto
[PROOF STATE]
proof (state)
this:
(a_ # xs_) ! i # drop (Suc i) (a_ # xs_) = drop i (a_ # xs_)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_option_finite[simp]:
  assumes "finite (UNIV :: 'k set)"
  shows "card (UNIV :: 'k option set) = Suc (card (UNIV :: 'k set))"
  (is "card ?L = Suc (card ?R)")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card UNIV = Suc (card UNIV)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card UNIV = Suc (card UNIV)
[PROOF STEP]
have "card ?L = Suc (card (?L - {None}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card UNIV = Suc (card (UNIV - {None}))
[PROOF STEP]
by (rule card.remove) (auto simp: assms)
[PROOF STATE]
proof (state)
this:
card UNIV = Suc (card (UNIV - {None}))

goal (1 subgoal):
 1. card UNIV = Suc (card UNIV)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card UNIV = Suc (card (UNIV - {None}))

goal (1 subgoal):
 1. card UNIV = Suc (card UNIV)
[PROOF STEP]
have "card (?L - {None}) = card ?R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (UNIV - {None}) = card UNIV
[PROOF STEP]
by (rule bij_betw_same_card[of the])
      (auto simp: bij_betw_def inj_on_def image_iff intro!: bexI[of _ "Some x" for x])
[PROOF STATE]
proof (state)
this:
card (UNIV - {None}) = card UNIV

goal (1 subgoal):
 1. card UNIV = Suc (card UNIV)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
card UNIV = Suc (card UNIV)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card UNIV = Suc (card UNIV)

goal (1 subgoal):
 1. card UNIV = Suc (card UNIV)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
card UNIV = Suc (card UNIV)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma projection_rank1:
  fixes t x :: \<open>'a::complex_inner\<close>
  shows \<open>projection (cspan {t}) x = ((t \<bullet>\<^sub>C x) / (t \<bullet>\<^sub>C t)) *\<^sub>C t\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. projection (cspan {t}) x = (t \<bullet>\<^sub>C x / (t \<bullet>\<^sub>C t)) *\<^sub>C t
[PROOF STEP]
apply (rule fun_cong, rule projection_eqI', simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_projection_on (\<lambda>a. (t \<bullet>\<^sub>C a / (t \<bullet>\<^sub>C t)) *\<^sub>C t) (cspan {t})
[PROOF STEP]
by (rule is_projection_on_rank1)