[STATEMENT]
lemma sum_closed : "finite A \<Longrightarrow> f ` A \<subseteq> G \<Longrightarrow> (\<Sum>a\<in>A. f a) \<in> G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; f ` A \<subseteq> G\<rbrakk> \<Longrightarrow> sum f A \<in> G
[PROOF STEP]
proof (induct set: finite)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f ` {} \<subseteq> G \<Longrightarrow> sum f {} \<in> G
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; f ` F \<subseteq> G \<Longrightarrow> sum f F \<in> G; f ` insert x F \<subseteq> G\<rbrakk> \<Longrightarrow> sum f (insert x F) \<in> G
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:
f ` {} \<subseteq> G

goal (2 subgoals):
 1. f ` {} \<subseteq> G \<Longrightarrow> sum f {} \<in> G
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; f ` F \<subseteq> G \<Longrightarrow> sum f F \<in> G; f ` insert x F \<subseteq> G\<rbrakk> \<Longrightarrow> sum f (insert x F) \<in> G
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {} \<in> G
[PROOF STEP]
using zero_closed
[PROOF STATE]
proof (prove)
using this:
(0::'g) \<in> G

goal (1 subgoal):
 1. sum f {} \<in> G
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum f {} \<in> G

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; f ` F \<subseteq> G \<Longrightarrow> sum f F \<in> G; f ` insert x F \<subseteq> G\<rbrakk> \<Longrightarrow> sum f (insert x F) \<in> G
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; f ` F \<subseteq> G \<Longrightarrow> sum f F \<in> G; f ` insert x F \<subseteq> G\<rbrakk> \<Longrightarrow> sum f (insert x F) \<in> G
[PROOF STEP]
case (insert a A)
[PROOF STATE]
proof (state)
this:
finite A
a \<notin> A
f ` A \<subseteq> G \<Longrightarrow> sum f A \<in> G
f ` insert a A \<subseteq> G

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; f ` F \<subseteq> G \<Longrightarrow> sum f F \<in> G; f ` insert x F \<subseteq> G\<rbrakk> \<Longrightarrow> sum f (insert x F) \<in> G
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
finite A
a \<notin> A
f ` A \<subseteq> G \<Longrightarrow> sum f A \<in> G
f ` insert a A \<subseteq> G

goal (1 subgoal):
 1. sum f (insert a A) \<in> G
[PROOF STEP]
using add_closed
[PROOF STATE]
proof (prove)
using this:
finite A
a \<notin> A
f ` A \<subseteq> G \<Longrightarrow> sum f A \<in> G
f ` insert a A \<subseteq> G
\<lbrakk>?g \<in> G; ?h \<in> G\<rbrakk> \<Longrightarrow> ?g + ?h \<in> G

goal (1 subgoal):
 1. sum f (insert a A) \<in> G
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum f (insert a A) \<in> G

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_nat_le_single:
  fixes x :: nat
  assumes y: "y \<in> S" and x: "x \<le> f y" and finite: "finite S"
  shows "x \<le> sum f S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> sum f S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<le> sum f S
[PROOF STEP]
have "sum f S = sum f (insert y S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f S = sum f (insert y S)
[PROOF STEP]
using y
[PROOF STATE]
proof (prove)
using this:
y \<in> S

goal (1 subgoal):
 1. sum f S = sum f (insert y S)
[PROOF STEP]
by (metis insert_absorb)
[PROOF STATE]
proof (state)
this:
sum f S = sum f (insert y S)

goal (1 subgoal):
 1. x \<le> sum f S
[PROOF STEP]
with finite
[PROOF STATE]
proof (chain)
picking this:
finite S
sum f S = sum f (insert y S)
[PROOF STEP]
have "sum f S = f y + sum f (S - {y})"
[PROOF STATE]
proof (prove)
using this:
finite S
sum f S = sum f (insert y S)

goal (1 subgoal):
 1. sum f S = f y + sum f (S - {y})
[PROOF STEP]
by (metis sum.insert_remove)
[PROOF STATE]
proof (state)
this:
sum f S = f y + sum f (S - {y})

goal (1 subgoal):
 1. x \<le> sum f S
[PROOF STEP]
with x
[PROOF STATE]
proof (chain)
picking this:
x \<le> f y
sum f S = f y + sum f (S - {y})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<le> f y
sum f S = f y + sum f (S - {y})

goal (1 subgoal):
 1. x \<le> sum f S
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
x \<le> sum f S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_comp_image_cong:
  assumes "\<And>x. P x \<Longrightarrow> f x = h (g x)"
  shows "{f x| x. P x} = h ` {g x| x. P x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {f x |x. P x} = h ` {g x |x. P x}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
P ?x \<Longrightarrow> f ?x = h (g ?x)

goal (1 subgoal):
 1. {f x |x. P x} = h ` {g x |x. P x}
[PROOF STEP]
by (auto simp: setcompr_eq_image)


[STATEMENT]
lemma weak_ranking_unique:
  assumes "is_weak_ranking As" "of_weak_ranking As = le"
  shows   "As = weak_ranking le"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. As = weak_ranking le
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_weak_ranking As
of_weak_ranking As = le

goal (1 subgoal):
 1. As = weak_ranking le
[PROOF STEP]
unfolding weak_ranking_altdef
[PROOF STATE]
proof (prove)
using this:
is_weak_ranking As
of_weak_ranking As = le

goal (1 subgoal):
 1. As = weak_ranking_aux carrier
[PROOF STEP]
by (rule weak_ranking_aux_unique)


[STATEMENT]
lemma floor_exists1: "\<exists>!z. of_int z \<le> x \<and> x < of_int (z + 1)"
  for x :: "'a::archimedean_field"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>!z. of_int z \<le> x \<and> x < of_int (z + 1)
[PROOF STEP]
proof (rule ex_ex1I)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>z. of_int z \<le> x \<and> x < of_int (z + 1)
 2. \<And>z y. \<lbrakk>of_int z \<le> x \<and> x < of_int (z + 1); of_int y \<le> x \<and> x < of_int (y + 1)\<rbrakk> \<Longrightarrow> z = y
[PROOF STEP]
show "\<exists>z. of_int z \<le> x \<and> x < of_int (z + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>z. of_int z \<le> x \<and> x < of_int (z + 1)
[PROOF STEP]
by (rule floor_exists)
[PROOF STATE]
proof (state)
this:
\<exists>z. of_int z \<le> x \<and> x < of_int (z + 1)

goal (1 subgoal):
 1. \<And>z y. \<lbrakk>of_int z \<le> x \<and> x < of_int (z + 1); of_int y \<le> x \<and> x < of_int (y + 1)\<rbrakk> \<Longrightarrow> z = y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>z y. \<lbrakk>of_int z \<le> x \<and> x < of_int (z + 1); of_int y \<le> x \<and> x < of_int (y + 1)\<rbrakk> \<Longrightarrow> z = y
[PROOF STEP]
fix y z
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>z y. \<lbrakk>of_int z \<le> x \<and> x < of_int (z + 1); of_int y \<le> x \<and> x < of_int (y + 1)\<rbrakk> \<Longrightarrow> z = y
[PROOF STEP]
assume "of_int y \<le> x \<and> x < of_int (y + 1)"
    and "of_int z \<le> x \<and> x < of_int (z + 1)"
[PROOF STATE]
proof (state)
this:
of_int y \<le> x \<and> x < of_int (y + 1)
of_int z \<le> x \<and> x < of_int (z + 1)

goal (1 subgoal):
 1. \<And>z y. \<lbrakk>of_int z \<le> x \<and> x < of_int (z + 1); of_int y \<le> x \<and> x < of_int (y + 1)\<rbrakk> \<Longrightarrow> z = y
[PROOF STEP]
with le_less_trans [of "of_int y" "x" "of_int (z + 1)"]
       le_less_trans [of "of_int z" "x" "of_int (y + 1)"]
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>of_int y \<le> x; x < of_int (z + 1)\<rbrakk> \<Longrightarrow> of_int y < of_int (z + 1)
\<lbrakk>of_int z \<le> x; x < of_int (y + 1)\<rbrakk> \<Longrightarrow> of_int z < of_int (y + 1)
of_int y \<le> x \<and> x < of_int (y + 1)
of_int z \<le> x \<and> x < of_int (z + 1)
[PROOF STEP]
show "y = z"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>of_int y \<le> x; x < of_int (z + 1)\<rbrakk> \<Longrightarrow> of_int y < of_int (z + 1)
\<lbrakk>of_int z \<le> x; x < of_int (y + 1)\<rbrakk> \<Longrightarrow> of_int z < of_int (y + 1)
of_int y \<le> x \<and> x < of_int (y + 1)
of_int z \<le> x \<and> x < of_int (z + 1)

goal (1 subgoal):
 1. y = z
[PROOF STEP]
by (simp del: of_int_add)
[PROOF STATE]
proof (state)
this:
y = z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma minus_in_Bounded_vec[simp]:
  "(-x) \<in> Bounded_vec b \<longleftrightarrow> x \<in> Bounded_vec b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- x \<in> Bounded_vec b) = (x \<in> Bounded_vec b)
[PROOF STEP]
unfolding Bounded_vec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- x \<in> {x. \<forall>i<dim_vec x. \<bar>x $ i\<bar> \<le> b}) = (x \<in> {x. \<forall>i<dim_vec x. \<bar>x $ i\<bar> \<le> b})
[PROOF STEP]
by auto


[STATEMENT]
lemma Cons_listrel1_Cons [iff]:
  "(x # xs, y # ys) \<in> listrel1 r \<longleftrightarrow>
   (x,y) \<in> r \<and> xs = ys \<or> x = y \<and> (xs, ys) \<in> listrel1 r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((x # xs, y # ys) \<in> listrel1 r) = ((x, y) \<in> r \<and> xs = ys \<or> x = y \<and> (xs, ys) \<in> listrel1 r)
[PROOF STEP]
by (simp add: listrel1_def Cons_eq_append_conv) (blast)


[STATEMENT]
lemma power_in_totatives:
  assumes "m > 1" "coprime m g"
  shows   "g ^ i mod m \<in> totatives m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g ^ i mod m \<in> totatives m
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. g ^ i mod m \<in> totatives m
[PROOF STEP]
have "\<not>m dvd g ^ i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> m dvd g ^ i
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. m dvd g ^ i \<Longrightarrow> False
[PROOF STEP]
assume "m dvd g ^ i"
[PROOF STATE]
proof (state)
this:
m dvd g ^ i

goal (1 subgoal):
 1. m dvd g ^ i \<Longrightarrow> False
[PROOF STEP]
hence "\<not>coprime m (g ^ i)"
[PROOF STATE]
proof (prove)
using this:
m dvd g ^ i

goal (1 subgoal):
 1. \<not> coprime m (g ^ i)
[PROOF STEP]
using \<open>m > 1\<close>
[PROOF STATE]
proof (prove)
using this:
m dvd g ^ i
1 < m

goal (1 subgoal):
 1. \<not> coprime m (g ^ i)
[PROOF STEP]
by (subst coprime_absorb_left) auto
[PROOF STATE]
proof (state)
this:
\<not> coprime m (g ^ i)

goal (1 subgoal):
 1. m dvd g ^ i \<Longrightarrow> False
[PROOF STEP]
with \<open>coprime m g\<close>
[PROOF STATE]
proof (chain)
picking this:
coprime m g
\<not> coprime m (g ^ i)
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
coprime m g
\<not> coprime m (g ^ i)

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<not> m dvd g ^ i

goal (1 subgoal):
 1. g ^ i mod m \<in> totatives m
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
1 < m
coprime m g
\<not> m dvd g ^ i
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
1 < m
coprime m g
\<not> m dvd g ^ i

goal (1 subgoal):
 1. g ^ i mod m \<in> totatives m
[PROOF STEP]
by (auto simp: totatives_def coprime_commute intro!: Nat.gr0I)
[PROOF STATE]
proof (state)
this:
g ^ i mod m \<in> totatives m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma real_bounded_linear: "bounded_linear f \<longleftrightarrow> (\<exists>c::real. f = (\<lambda>x. x * c))"
  for f :: "real \<Rightarrow> real"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_linear f = (\<exists>c. f = (\<lambda>x. x * c))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bounded_linear f = (\<exists>c. f = (\<lambda>x. x * c))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bounded_linear f = (\<exists>c. f = (\<lambda>x. x * c))
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bounded_linear f = (\<exists>c. f = (\<lambda>x. x * c))
[PROOF STEP]
assume "bounded_linear f"
[PROOF STATE]
proof (state)
this:
bounded_linear f

goal (1 subgoal):
 1. bounded_linear f = (\<exists>c. f = (\<lambda>x. x * c))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
bounded_linear f
[PROOF STEP]
interpret bounded_linear f
[PROOF STATE]
proof (prove)
using this:
bounded_linear f

goal (1 subgoal):
 1. bounded_linear f
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bounded_linear f = (\<exists>c. f = (\<lambda>x. x * c))
[PROOF STEP]
from scaleR[of x 1]
[PROOF STATE]
proof (chain)
picking this:
f (x *\<^sub>R 1) = x *\<^sub>R f 1
[PROOF STEP]
have "f x = x * f 1"
[PROOF STATE]
proof (prove)
using this:
f (x *\<^sub>R 1) = x *\<^sub>R f 1

goal (1 subgoal):
 1. f x = x * f 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f x = x * f 1

goal (1 subgoal):
 1. bounded_linear f = (\<exists>c. f = (\<lambda>x. x * c))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
bounded_linear f \<Longrightarrow> f ?x2 = ?x2 * f 1

goal (1 subgoal):
 1. bounded_linear f = (\<exists>c. f = (\<lambda>x. x * c))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
bounded_linear f \<Longrightarrow> f ?x2 = ?x2 * f 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
bounded_linear f \<Longrightarrow> f ?x2 = ?x2 * f 1

goal (1 subgoal):
 1. bounded_linear f = (\<exists>c. f = (\<lambda>x. x * c))
[PROOF STEP]
by (auto intro: exI[of _ "f 1"] bounded_linear_mult_left)
[PROOF STATE]
proof (state)
this:
bounded_linear f = (\<exists>c. f = (\<lambda>x. x * c))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem M7: "\<turnstile> \<box>[F]_v \<and> \<box>[G]_v \<longrightarrow> \<box>[F \<and> G]_v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<turnstile> \<box>[F]_v \<and> \<box>[G]_v \<longrightarrow> \<box>[F \<and> G]_v
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<turnstile> \<box>[F]_v \<and> \<box>[G]_v \<longrightarrow> \<box>[F \<and> G]_v
[PROOF STEP]
have "|~ F \<longrightarrow> G \<longrightarrow> F \<and> G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |~ F \<longrightarrow> G \<longrightarrow> F \<and> G
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
|~ F \<longrightarrow> G \<longrightarrow> F \<and> G

goal (1 subgoal):
 1. \<turnstile> \<box>[F]_v \<and> \<box>[G]_v \<longrightarrow> \<box>[F \<and> G]_v
[PROOF STEP]
hence "\<turnstile> \<box>[F]_v \<longrightarrow> \<box>[G \<longrightarrow> F \<and> G]_v"
[PROOF STATE]
proof (prove)
using this:
|~ F \<longrightarrow> G \<longrightarrow> F \<and> G

goal (1 subgoal):
 1. \<turnstile> \<box>[F]_v \<longrightarrow> \<box>[G \<longrightarrow> F \<and> G]_v
[PROOF STEP]
by (rule M2)
[PROOF STATE]
proof (state)
this:
\<turnstile> \<box>[F]_v \<longrightarrow> \<box>[G \<longrightarrow> F \<and> G]_v

goal (1 subgoal):
 1. \<turnstile> \<box>[F]_v \<and> \<box>[G]_v \<longrightarrow> \<box>[F \<and> G]_v
[PROOF STEP]
with ax4
[PROOF STATE]
proof (chain)
picking this:
\<turnstile> \<box>[?P \<longrightarrow> ?Q]_?v \<longrightarrow> \<box>[?P]_?v \<longrightarrow> \<box>[?Q]_?v
\<turnstile> \<box>[F]_v \<longrightarrow> \<box>[G \<longrightarrow> F \<and> G]_v
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<turnstile> \<box>[?P \<longrightarrow> ?Q]_?v \<longrightarrow> \<box>[?P]_?v \<longrightarrow> \<box>[?Q]_?v
\<turnstile> \<box>[F]_v \<longrightarrow> \<box>[G \<longrightarrow> F \<and> G]_v

goal (1 subgoal):
 1. \<turnstile> \<box>[F]_v \<and> \<box>[G]_v \<longrightarrow> \<box>[F \<and> G]_v
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<turnstile> \<box>[F]_v \<and> \<box>[G]_v \<longrightarrow> \<box>[F \<and> G]_v

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma det_mult_row:
shows "det (mult_row A a k) = k * det A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (mult_row A a k) = k * det A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. det (mult_row A a k) = k * det A
[PROOF STEP]
have A_rw: "(\<chi> i. if i = a then A$a else A$i) = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<chi>i. if i = a then A $ a else A $ i) = A
[PROOF STEP]
by vector
[PROOF STATE]
proof (state)
this:
(\<chi>i. if i = a then A $ a else A $ i) = A

goal (1 subgoal):
 1. det (mult_row A a k) = k * det A
[PROOF STEP]
have "(mult_row A a k) = (\<chi> i. if i = a then k *s A $ a else A $ i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mult_row A a k = (\<chi>i. if i = a then k *s A $ a else A $ i)
[PROOF STEP]
unfolding mult_row_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<chi>i j. if i = a then k * A $ a $ j else A $ i $ j) = (\<chi>i. if i = a then k *s A $ a else A $ i)
[PROOF STEP]
by vector
[PROOF STATE]
proof (state)
this:
mult_row A a k = (\<chi>i. if i = a then k *s A $ a else A $ i)

goal (1 subgoal):
 1. det (mult_row A a k) = k * det A
[PROOF STEP]
hence "det(mult_row A a k) = det(\<chi> i. if i = a then k *s A $ a else A $ i)"
[PROOF STATE]
proof (prove)
using this:
mult_row A a k = (\<chi>i. if i = a then k *s A $ a else A $ i)

goal (1 subgoal):
 1. det (mult_row A a k) = det (\<chi>i. if i = a then k *s A $ a else A $ i)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
det (mult_row A a k) = det (\<chi>i. if i = a then k *s A $ a else A $ i)

goal (1 subgoal):
 1. det (mult_row A a k) = k * det A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
det (mult_row A a k) = det (\<chi>i. if i = a then k *s A $ a else A $ i)

goal (1 subgoal):
 1. det (mult_row A a k) = k * det A
[PROOF STEP]
have "... =  k * det(\<chi> i. if i = a then A$a else A$i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (\<chi>i. if i = a then k *s A $ a else A $ i) = k * det (\<chi>i. if i = a then A $ a else A $ i)
[PROOF STEP]
unfolding det_row_mul
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k * det (\<chi>i. if i = a then A $ a else A $ i) = k * det (\<chi>i. if i = a then A $ a else A $ i)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
det (\<chi>i. if i = a then k *s A $ a else A $ i) = k * det (\<chi>i. if i = a then A $ a else A $ i)

goal (1 subgoal):
 1. det (mult_row A a k) = k * det A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
det (\<chi>i. if i = a then k *s A $ a else A $ i) = k * det (\<chi>i. if i = a then A $ a else A $ i)

goal (1 subgoal):
 1. det (mult_row A a k) = k * det A
[PROOF STEP]
have "... = k * det A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k * det (\<chi>i. if i = a then A $ a else A $ i) = k * det A
[PROOF STEP]
unfolding A_rw
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k * det A = k * det A
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
k * det (\<chi>i. if i = a then A $ a else A $ i) = k * det A

goal (1 subgoal):
 1. det (mult_row A a k) = k * det A
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
det (mult_row A a k) = k * det A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
det (mult_row A a k) = k * det A

goal (1 subgoal):
 1. det (mult_row A a k) = k * det A
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
det (mult_row A a k) = k * det A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma int_relprime_odd_power_divisors:
  assumes "odd n" and "(a::int) * b = c ^ n" and "coprime a b"
  shows "\<exists>k. a = k^n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>k. a = k ^ n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>k. a = k ^ n
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
odd n
a * b = c ^ n
coprime a b
[PROOF STEP]
have "\<bar>a\<bar> * \<bar>b\<bar> = \<bar>c\<bar> ^ n"
[PROOF STATE]
proof (prove)
using this:
odd n
a * b = c ^ n
coprime a b

goal (1 subgoal):
 1. \<bar>a\<bar> * \<bar>b\<bar> = \<bar>c\<bar> ^ n
[PROOF STEP]
by (simp add: abs_mult [symmetric] power_abs)
[PROOF STATE]
proof (state)
this:
\<bar>a\<bar> * \<bar>b\<bar> = \<bar>c\<bar> ^ n

goal (1 subgoal):
 1. \<exists>k. a = k ^ n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<bar>a\<bar> * \<bar>b\<bar> = \<bar>c\<bar> ^ n
[PROOF STEP]
have "nat \<bar>a\<bar> * nat \<bar>b\<bar> = nat \<bar>c\<bar> ^ n"
[PROOF STATE]
proof (prove)
using this:
\<bar>a\<bar> * \<bar>b\<bar> = \<bar>c\<bar> ^ n

goal (1 subgoal):
 1. nat \<bar>a\<bar> * nat \<bar>b\<bar> = nat \<bar>c\<bar> ^ n
[PROOF STEP]
by (simp add: nat_mult_distrib [of "\<bar>a\<bar>" "\<bar>b\<bar>", symmetric] nat_power_eq)
[PROOF STATE]
proof (state)
this:
nat \<bar>a\<bar> * nat \<bar>b\<bar> = nat \<bar>c\<bar> ^ n

goal (1 subgoal):
 1. \<exists>k. a = k ^ n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
nat \<bar>a\<bar> * nat \<bar>b\<bar> = nat \<bar>c\<bar> ^ n

goal (1 subgoal):
 1. \<exists>k. a = k ^ n
[PROOF STEP]
have "coprime (nat \<bar>a\<bar>) (nat \<bar>b\<bar>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coprime (nat \<bar>a\<bar>) (nat \<bar>b\<bar>)
[PROOF STEP]
using assms(3) gcd_int_def
[PROOF STATE]
proof (prove)
using this:
coprime a b
gcd ?x ?y = int (gcd (nat \<bar>?x\<bar>) (nat \<bar>?y\<bar>))

goal (1 subgoal):
 1. coprime (nat \<bar>a\<bar>) (nat \<bar>b\<bar>)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
coprime (nat \<bar>a\<bar>) (nat \<bar>b\<bar>)

goal (1 subgoal):
 1. \<exists>k. a = k ^ n
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
nat \<bar>a\<bar> * nat \<bar>b\<bar> = nat \<bar>c\<bar> ^ n
coprime (nat \<bar>a\<bar>) (nat \<bar>b\<bar>)
[PROOF STEP]
have "\<exists> k. nat \<bar>a\<bar> = k^n"
[PROOF STATE]
proof (prove)
using this:
nat \<bar>a\<bar> * nat \<bar>b\<bar> = nat \<bar>c\<bar> ^ n
coprime (nat \<bar>a\<bar>) (nat \<bar>b\<bar>)

goal (1 subgoal):
 1. \<exists>k. nat \<bar>a\<bar> = k ^ n
[PROOF STEP]
using nat_relprime_power_divisors[of n "nat \<bar>a\<bar>" "nat \<bar>b\<bar>" "nat \<bar>c\<bar>"] assms(1)
[PROOF STATE]
proof (prove)
using this:
nat \<bar>a\<bar> * nat \<bar>b\<bar> = nat \<bar>c\<bar> ^ n
coprime (nat \<bar>a\<bar>) (nat \<bar>b\<bar>)
\<lbrakk>0 < n; nat \<bar>a\<bar> * nat \<bar>b\<bar> = nat \<bar>c\<bar> ^ n; coprime (nat \<bar>a\<bar>) (nat \<bar>b\<bar>)\<rbrakk> \<Longrightarrow> \<exists>k. nat \<bar>a\<bar> = k ^ n
odd n

goal (1 subgoal):
 1. \<exists>k. nat \<bar>a\<bar> = k ^ n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>k. nat \<bar>a\<bar> = k ^ n

goal (1 subgoal):
 1. \<exists>k. a = k ^ n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>k. nat \<bar>a\<bar> = k ^ n
[PROOF STEP]
obtain k' where k': "nat \<bar>a\<bar> = k'^n"
[PROOF STATE]
proof (prove)
using this:
\<exists>k. nat \<bar>a\<bar> = k ^ n

goal (1 subgoal):
 1. (\<And>k'. nat \<bar>a\<bar> = k' ^ n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
nat \<bar>a\<bar> = k' ^ n

goal (1 subgoal):
 1. \<exists>k. a = k ^ n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
nat \<bar>a\<bar> = k' ^ n

goal (1 subgoal):
 1. \<exists>k. a = k ^ n
[PROOF STEP]
define k where "k = int k'"
[PROOF STATE]
proof (state)
this:
k = int k'

goal (1 subgoal):
 1. \<exists>k. a = k ^ n
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
nat \<bar>a\<bar> = k' ^ n
k = int k'
[PROOF STEP]
have k: "\<bar>a\<bar> = k^n"
[PROOF STATE]
proof (prove)
using this:
nat \<bar>a\<bar> = k' ^ n
k = int k'

goal (1 subgoal):
 1. \<bar>a\<bar> = k ^ n
[PROOF STEP]
using int_nat_eq[of "\<bar>a\<bar>"] of_nat_power[of k' n]
[PROOF STATE]
proof (prove)
using this:
nat \<bar>a\<bar> = k' ^ n
k = int k'
int (nat \<bar>a\<bar>) = (if 0 \<le> \<bar>a\<bar> then \<bar>a\<bar> else 0)
of_nat (k' ^ n) = of_nat k' ^ n

goal (1 subgoal):
 1. \<bar>a\<bar> = k ^ n
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<bar>a\<bar> = k ^ n

goal (1 subgoal):
 1. \<exists>k. a = k ^ n
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
\<bar>a\<bar> = k ^ n

goal (1 subgoal):
 1. \<exists>k. a = k ^ n
[PROOF STEP]
assume "a \<noteq> k^n"
[PROOF STATE]
proof (state)
this:
a \<noteq> k ^ n

goal (1 subgoal):
 1. \<exists>k. a = k ^ n
[PROOF STEP]
with k
[PROOF STATE]
proof (chain)
picking this:
\<bar>a\<bar> = k ^ n
a \<noteq> k ^ n
[PROOF STEP]
have "a = -(k^n)"
[PROOF STATE]
proof (prove)
using this:
\<bar>a\<bar> = k ^ n
a \<noteq> k ^ n

goal (1 subgoal):
 1. a = - (k ^ n)
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
a = - (k ^ n)

goal (1 subgoal):
 1. \<exists>k. a = k ^ n
[PROOF STEP]
hence "a = (-k)^n"
[PROOF STATE]
proof (prove)
using this:
a = - (k ^ n)

goal (1 subgoal):
 1. a = (- k) ^ n
[PROOF STEP]
using assms(1) power_minus_odd
[PROOF STATE]
proof (prove)
using this:
a = - (k ^ n)
odd n
odd ?n \<Longrightarrow> (- ?a) ^ ?n = - (?a ^ ?n)

goal (1 subgoal):
 1. a = (- k) ^ n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a = (- k) ^ n

goal (1 subgoal):
 1. \<exists>k. a = k ^ n
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
a \<noteq> k ^ n \<Longrightarrow> a = (- k) ^ n

goal (1 subgoal):
 1. \<exists>k. a = k ^ n
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
a \<noteq> k ^ n \<Longrightarrow> a = (- k) ^ n

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vec_mod_dim[simp]: "dim_vec (vec_mod v) = dim_vec v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec (vec_mod v) = dim_vec v
[PROOF STEP]
using vec_mod_def
[PROOF STATE]
proof (prove)
using this:
vec_mod ?v \<equiv> map_vec (\<lambda>x. x mod m) ?v

goal (1 subgoal):
 1. dim_vec (vec_mod v) = dim_vec v
[PROOF STEP]
by simp


[STATEMENT]
lemma polarity_switch [rule_format]:
  "(\<not> P) = True \<Longrightarrow> P = False"
  "(\<not> P) = False \<Longrightarrow> P = True"
  "P = False \<Longrightarrow> (\<not> P) = True"
  "P = True \<Longrightarrow> (\<not> P) = False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (((\<not> P) = True \<Longrightarrow> P = False) &&& ((\<not> P) = False \<Longrightarrow> P = True)) &&& (P = False \<Longrightarrow> (\<not> P) = True) &&& (P = True \<Longrightarrow> (\<not> P) = False)
[PROOF STEP]
by auto


[STATEMENT]
lemma nn_transfer_operator_cmult:
  assumes [measurable]: "g \<in> borel_measurable M"
  shows "AE x in M. nn_transfer_operator (\<lambda>x. c * g x) x = c * nn_transfer_operator g x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in M. nn_transfer_operator (\<lambda>x. c * g x) x = c * nn_transfer_operator g x
[PROOF STEP]
apply (rule nn_transfer_operator_foT_g)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<lambda>x. c) \<in> borel_measurable M
 2. g \<in> borel_measurable M
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
g \<in> borel_measurable M

goal (2 subgoals):
 1. (\<lambda>x. c) \<in> borel_measurable M
 2. g \<in> borel_measurable M
[PROOF STEP]
by auto


[STATEMENT]
lemma eventually_nonzero_mult [eventually_nonzero_simps]:
  "eventually_nonzero F (\<lambda>x. f x * g x) \<longleftrightarrow> eventually_nonzero F f \<and> eventually_nonzero F g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eventually_nonzero F (\<lambda>x. f x * g x) = (eventually_nonzero F f \<and> eventually_nonzero F g)
[PROOF STEP]
unfolding eventually_nonzero_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>\<^sub>F x in F. f x * g x \<noteq> (0::'b)) = ((\<forall>\<^sub>F x in F. f x \<noteq> (0::'b)) \<and> (\<forall>\<^sub>F x in F. g x \<noteq> (0::'b)))
[PROOF STEP]
by (simp_all add: eventually_conj_iff[symmetric])


[STATEMENT]
lemma twice_field_differentiable_at_linear [simp, intro]:
  "(\<lambda>x. k * x + a) twice_field_differentiable_at x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. k * x + a) twice_field_differentiable_at x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. k * x + a) twice_field_differentiable_at x
[PROOF STEP]
have "\<forall>x\<in>UNIV. (\<lambda>x. k * x + a) field_differentiable at x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>UNIV. (\<lambda>x. k * x + a) field_differentiable at x
[PROOF STEP]
by (simp add: field_differentiable_add)
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>UNIV. (\<lambda>x. k * x + a) field_differentiable at x

goal (1 subgoal):
 1. (\<lambda>x. k * x + a) twice_field_differentiable_at x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>UNIV. (\<lambda>x. k * x + a) field_differentiable at x

goal (1 subgoal):
 1. (\<lambda>x. k * x + a) twice_field_differentiable_at x
[PROOF STEP]
have "deriv ((\<lambda>x. k * x + a)) field_differentiable at x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deriv (\<lambda>x. k * x + a) field_differentiable at x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. deriv (\<lambda>x. k * x + a) field_differentiable at x
[PROOF STEP]
have "deriv ((\<lambda>x. k * x + a)) = (\<lambda>x. k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deriv (\<lambda>x. k * x + a) = (\<lambda>x. k)
[PROOF STEP]
by (simp add: ext)
[PROOF STATE]
proof (state)
this:
deriv (\<lambda>x. k * x + a) = (\<lambda>x. k)

goal (1 subgoal):
 1. deriv (\<lambda>x. k * x + a) field_differentiable at x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
deriv (\<lambda>x. k * x + a) = (\<lambda>x. k)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
deriv (\<lambda>x. k * x + a) = (\<lambda>x. k)

goal (1 subgoal):
 1. deriv (\<lambda>x. k * x + a) field_differentiable at x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
deriv (\<lambda>x. k * x + a) field_differentiable at x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
deriv (\<lambda>x. k * x + a) field_differentiable at x

goal (1 subgoal):
 1. (\<lambda>x. k * x + a) twice_field_differentiable_at x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>UNIV. (\<lambda>x. k * x + a) field_differentiable at x
deriv (\<lambda>x. k * x + a) field_differentiable at x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>UNIV. (\<lambda>x. k * x + a) field_differentiable at x
deriv (\<lambda>x. k * x + a) field_differentiable at x

goal (1 subgoal):
 1. (\<lambda>x. k * x + a) twice_field_differentiable_at x
[PROOF STEP]
unfolding twice_field_differentiable_at_def field_differentiable_on_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>UNIV. (\<lambda>x. k * x + a) field_differentiable at x
deriv (\<lambda>x. k * x + a) field_differentiable at x

goal (1 subgoal):
 1. \<exists>S. (\<forall>x\<in>S. (\<lambda>x. k * x + a) field_differentiable at x within S) \<and> x \<in> interior S \<and> deriv (\<lambda>x. k * x + a) field_differentiable at x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. k * x + a) twice_field_differentiable_at x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma harm_aux_ineq_1:
  fixes k :: real
  assumes "k > 1"
  shows "1 / k < ln (1 + 1 / (k - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / k < ln (1 + 1 / (k - 1))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 1 / k < ln (1 + 1 / (k - 1))
[PROOF STEP]
have "k-1 > 0" \<open>k > 0\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < k - 1 &&& 0 < k
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
1 < k

goal (1 subgoal):
 1. 0 < k - 1 &&& 0 < k
[PROOF STEP]
by simp+
[PROOF STATE]
proof (state)
this:
0 < k - 1
0 < k

goal (1 subgoal):
 1. 1 / k < ln (1 + 1 / (k - 1))
[PROOF STEP]
from exp_1_bounds(2)[OF \<open>k-1 > 0\<close>]
[PROOF STATE]
proof (chain)
picking this:
exp 1 < (1 + 1 / (k - 1)) powr (k - 1 + 1)
[PROOF STEP]
have "exp 1 < (1 + 1 / (k - 1)) powr k"
[PROOF STATE]
proof (prove)
using this:
exp 1 < (1 + 1 / (k - 1)) powr (k - 1 + 1)

goal (1 subgoal):
 1. exp 1 < (1 + 1 / (k - 1)) powr k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
exp 1 < (1 + 1 / (k - 1)) powr k

goal (1 subgoal):
 1. 1 / k < ln (1 + 1 / (k - 1))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
exp 1 < (1 + 1 / (k - 1)) powr k
[PROOF STEP]
have n_z: "(1 + 1 / (k - 1)) powr k > 0"
[PROOF STATE]
proof (prove)
using this:
exp 1 < (1 + 1 / (k - 1)) powr k

goal (1 subgoal):
 1. 0 < (1 + 1 / (k - 1)) powr k
[PROOF STEP]
using assms not_exp_less_zero
[PROOF STATE]
proof (prove)
using this:
exp 1 < (1 + 1 / (k - 1)) powr k
1 < k
\<not> exp ?x < 0

goal (1 subgoal):
 1. 0 < (1 + 1 / (k - 1)) powr k
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < (1 + 1 / (k - 1)) powr k

goal (1 subgoal):
 1. 1 / k < ln (1 + 1 / (k - 1))
[PROOF STEP]
have "(1::real) = ln (exp(1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 = ln (exp 1)
[PROOF STEP]
using ln_exp
[PROOF STATE]
proof (prove)
using this:
ln (exp ?x) = ?x

goal (1 subgoal):
 1. 1 = ln (exp 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 = ln (exp 1)

goal (1 subgoal):
 1. 1 / k < ln (1 + 1 / (k - 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 = ln (exp 1)

goal (1 subgoal):
 1. 1 / k < ln (1 + 1 / (k - 1))
[PROOF STEP]
have "\<dots> < ln ((1 + 1 / (k - 1)) powr k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ln (exp 1) < ln ((1 + 1 / (k - 1)) powr k)
[PROOF STEP]
using ln_less_cancel_iff[of "exp(1)",simplified,OF \<open>(1 + 1 / (k - 1)) powr k > 0\<close>]
          exp_1_bounds[OF \<open>k - 1 > 0\<close>]
[PROOF STATE]
proof (prove)
using this:
(1 < ln ((1 + 1 / (k - 1)) powr k)) = (exp 1 < (1 + 1 / (k - 1)) powr k)
(1 + 1 / (k - 1)) powr (k - 1) < exp 1
exp 1 < (1 + 1 / (k - 1)) powr (k - 1 + 1)

goal (1 subgoal):
 1. ln (exp 1) < ln ((1 + 1 / (k - 1)) powr k)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ln (exp 1) < ln ((1 + 1 / (k - 1)) powr k)

goal (1 subgoal):
 1. 1 / k < ln (1 + 1 / (k - 1))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ln (exp 1) < ln ((1 + 1 / (k - 1)) powr k)

goal (1 subgoal):
 1. 1 / k < ln (1 + 1 / (k - 1))
[PROOF STEP]
have "\<dots> = k * ln (1 + 1 / (k - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ln ((1 + 1 / (k - 1)) powr k) = k * ln (1 + 1 / (k - 1))
[PROOF STEP]
using ln_powr n_z
[PROOF STATE]
proof (prove)
using this:
?x \<noteq> 0 \<Longrightarrow> ln (?x powr ?y) = ?y * ln ?x
0 < (1 + 1 / (k - 1)) powr k

goal (1 subgoal):
 1. ln ((1 + 1 / (k - 1)) powr k) = k * ln (1 + 1 / (k - 1))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ln ((1 + 1 / (k - 1)) powr k) = k * ln (1 + 1 / (k - 1))

goal (1 subgoal):
 1. 1 / k < ln (1 + 1 / (k - 1))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
1 < k * ln (1 + 1 / (k - 1))
[PROOF STEP]
have "1 < k * ln (1 + 1 / (k - 1))"
[PROOF STATE]
proof (prove)
using this:
1 < k * ln (1 + 1 / (k - 1))

goal (1 subgoal):
 1. 1 < k * ln (1 + 1 / (k - 1))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
1 < k * ln (1 + 1 / (k - 1))

goal (1 subgoal):
 1. 1 / k < ln (1 + 1 / (k - 1))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 < k * ln (1 + 1 / (k - 1))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
1 < k * ln (1 + 1 / (k - 1))

goal (1 subgoal):
 1. 1 / k < ln (1 + 1 / (k - 1))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
1 < k * ln (1 + 1 / (k - 1))
1 < k

goal (1 subgoal):
 1. 1 / k < ln (1 + 1 / (k - 1))
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
1 / k < ln (1 + 1 / (k - 1))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma stieltjes_gamma_aux4: "fps_nth G k = (\<Sum>i=1..k+1. (-ln 2)^i * A (k-(i-1)) / fact i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. G $ k = (\<Sum>i = 1..k + 1. (- Ln 2) ^ i * A (k - (i - 1)) / fact i)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. G $ k = (\<Sum>i = 1..k + 1. (- Ln 2) ^ i * A (k - (i - 1)) / fact i)
[PROOF STEP]
have "fps_nth G k = (\<Sum>i\<le>k. fps_nth G1 i * A (k - i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. G $ k = (\<Sum>i\<le>k. G1 $ i * A (k - i))
[PROOF STEP]
unfolding G_def fps_mult_nth A_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..k. G1 $ i * G2 $ (k - i)) = (\<Sum>i\<le>k. G1 $ i * G2 $ (k - i))
[PROOF STEP]
by (intro sum.cong) auto
[PROOF STATE]
proof (state)
this:
G $ k = (\<Sum>i\<le>k. G1 $ i * A (k - i))

goal (1 subgoal):
 1. G $ k = (\<Sum>i = 1..k + 1. (- Ln 2) ^ i * A (k - (i - 1)) / fact i)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
G $ k = (\<Sum>i\<le>k. G1 $ i * A (k - i))

goal (1 subgoal):
 1. G $ k = (\<Sum>i = 1..k + 1. (- Ln 2) ^ i * A (k - (i - 1)) / fact i)
[PROOF STEP]
have "\<dots> = (\<Sum>i\<le>k. (-ln 2)^(i+1) * A (k - i) / fact (i+1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>k. G1 $ i * A (k - i)) = (\<Sum>i\<le>k. (- Ln 2) ^ (i + 1) * A (k - i) / fact (i + 1))
[PROOF STEP]
by (simp add: G1_def algebra_simps)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>k. G1 $ i * A (k - i)) = (\<Sum>i\<le>k. (- Ln 2) ^ (i + 1) * A (k - i) / fact (i + 1))

goal (1 subgoal):
 1. G $ k = (\<Sum>i = 1..k + 1. (- Ln 2) ^ i * A (k - (i - 1)) / fact i)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>k. G1 $ i * A (k - i)) = (\<Sum>i\<le>k. (- Ln 2) ^ (i + 1) * A (k - i) / fact (i + 1))

goal (1 subgoal):
 1. G $ k = (\<Sum>i = 1..k + 1. (- Ln 2) ^ i * A (k - (i - 1)) / fact i)
[PROOF STEP]
have "\<dots> = (\<Sum>i=1..k+1. (-ln 2)^i * A (k-(i-1)) / fact i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>k. (- Ln 2) ^ (i + 1) * A (k - i) / fact (i + 1)) = (\<Sum>i = 1..k + 1. (- Ln 2) ^ i * A (k - (i - 1)) / fact i)
[PROOF STEP]
by (intro sum.reindex_bij_witness[of _ "\<lambda>i. i-1" Suc]) (auto simp: Suc_diff_Suc)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>k. (- Ln 2) ^ (i + 1) * A (k - i) / fact (i + 1)) = (\<Sum>i = 1..k + 1. (- Ln 2) ^ i * A (k - (i - 1)) / fact i)

goal (1 subgoal):
 1. G $ k = (\<Sum>i = 1..k + 1. (- Ln 2) ^ i * A (k - (i - 1)) / fact i)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
G $ k = (\<Sum>i = 1..k + 1. (- Ln 2) ^ i * A (k - (i - 1)) / fact i)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
G $ k = (\<Sum>i = 1..k + 1. (- Ln 2) ^ i * A (k - (i - 1)) / fact i)

goal (1 subgoal):
 1. G $ k = (\<Sum>i = 1..k + 1. (- Ln 2) ^ i * A (k - (i - 1)) / fact i)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
G $ k = (\<Sum>i = 1..k + 1. (- Ln 2) ^ i * A (k - (i - 1)) / fact i)

goal:
No subgoals!
[PROOF STEP]
qed


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

goal (1 subgoal):
 1. inner (- x) y = - inner x y
[PROOF STEP]
by simp


[STATEMENT]
lemma mult_apx_left_isotone:
  assumes "x \<sqsubseteq> y"
    shows "x * z \<sqsubseteq> y * z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * z \<sqsubseteq> y * z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x * z \<sqsubseteq> y * z
[PROOF STEP]
have "x * z \<le> y * z \<squnion> L * z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * z \<le> y * z \<squnion> L * z
[PROOF STEP]
by (metis assms apx_def mult_left_isotone mult_right_dist_sup)
[PROOF STATE]
proof (state)
this:
x * z \<le> y * z \<squnion> L * z

goal (1 subgoal):
 1. x * z \<sqsubseteq> y * z
[PROOF STEP]
hence 1: "x * z \<le> y * z \<squnion> L"
[PROOF STATE]
proof (prove)
using this:
x * z \<le> y * z \<squnion> L * z

goal (1 subgoal):
 1. x * z \<le> y * z \<squnion> L
[PROOF STEP]
using l40 order_lesseq_imp semiring.add_left_mono
[PROOF STATE]
proof (prove)
using this:
x * z \<le> y * z \<squnion> L * z
L * ?x \<le> L
(\<forall>z\<ge>?x. ?y \<le> z) = (?y \<le> ?x)
?a \<le> ?b \<Longrightarrow> ?c \<squnion> ?a \<le> ?c \<squnion> ?b

goal (1 subgoal):
 1. x * z \<le> y * z \<squnion> L
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x * z \<le> y * z \<squnion> L

goal (1 subgoal):
 1. x * z \<sqsubseteq> y * z
[PROOF STEP]
have "d(L) * y * z \<le> x * z \<squnion> d(x * bot) * top * z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d L * y * z \<le> x * z \<squnion> d (x * bot) * top * z
[PROOF STEP]
by (metis assms apx_def mult_left_isotone mult_right_dist_sup)
[PROOF STATE]
proof (state)
this:
d L * y * z \<le> x * z \<squnion> d (x * bot) * top * z

goal (1 subgoal):
 1. x * z \<sqsubseteq> y * z
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d L * y * z \<le> x * z \<squnion> d (x * bot) * top * z

goal (1 subgoal):
 1. x * z \<sqsubseteq> y * z
[PROOF STEP]
have "... \<le> x * z \<squnion> d(x * z * bot) * top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * z \<squnion> d (x * bot) * top * z \<le> x * z \<squnion> d (x * z * bot) * top
[PROOF STEP]
by (metis sup_right_isotone d_isotone mult_assoc mult_isotone mult_right_isotone top_greatest bot_least)
[PROOF STATE]
proof (state)
this:
x * z \<squnion> d (x * bot) * top * z \<le> x * z \<squnion> d (x * z * bot) * top

goal (1 subgoal):
 1. x * z \<sqsubseteq> y * z
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
d L * y * z \<le> x * z \<squnion> d (x * z * bot) * top
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
d L * y * z \<le> x * z \<squnion> d (x * z * bot) * top

goal (1 subgoal):
 1. x * z \<sqsubseteq> y * z
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
d L * y * z \<le> x * z \<squnion> d (x * z * bot) * top
x * z \<le> y * z \<squnion> L

goal (1 subgoal):
 1. x * z \<sqsubseteq> y * z
[PROOF STEP]
by (simp add: apx_def mult_assoc)
[PROOF STATE]
proof (state)
this:
x * z \<sqsubseteq> y * z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma topspace_nsphere_minus1:
  assumes x: "x \<in> topspace (nsphere n)" and "x n = 0"
  shows "x \<in> topspace (nsphere (n - Suc 0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> topspace (nsphere (n - Suc 0))
[PROOF STEP]
proof (cases "n = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> x \<in> topspace (nsphere (n - Suc 0))
 2. n \<noteq> 0 \<Longrightarrow> x \<in> topspace (nsphere (n - Suc 0))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
n = 0

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> x \<in> topspace (nsphere (n - Suc 0))
 2. n \<noteq> 0 \<Longrightarrow> x \<in> topspace (nsphere (n - Suc 0))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n = 0

goal (1 subgoal):
 1. x \<in> topspace (nsphere (n - Suc 0))
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
n = 0
x \<in> topspace (nsphere n)

goal (1 subgoal):
 1. x \<in> topspace (nsphere (n - Suc 0))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> topspace (nsphere (n - Suc 0))

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> x \<in> topspace (nsphere (n - Suc 0))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> x \<in> topspace (nsphere (n - Suc 0))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
n \<noteq> 0

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> x \<in> topspace (nsphere (n - Suc 0))
[PROOF STEP]
have subt_eq: "nsphere (n - Suc 0) = subtopology (nsphere n) {x. x n = 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nsphere (n - Suc 0) = subtopology (nsphere n) {x. x n = 0}
[PROOF STEP]
by (metis False Suc_pred le_zero_eq not_le subtopology_nsphere_equator)
[PROOF STATE]
proof (state)
this:
nsphere (n - Suc 0) = subtopology (nsphere n) {x. x n = 0}

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> x \<in> topspace (nsphere (n - Suc 0))
[PROOF STEP]
with x
[PROOF STATE]
proof (chain)
picking this:
x \<in> topspace (nsphere n)
nsphere (n - Suc 0) = subtopology (nsphere n) {x. x n = 0}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<in> topspace (nsphere n)
nsphere (n - Suc 0) = subtopology (nsphere n) {x. x n = 0}

goal (1 subgoal):
 1. x \<in> topspace (nsphere (n - Suc 0))
[PROOF STEP]
by (simp add: assms)
[PROOF STATE]
proof (state)
this:
x \<in> topspace (nsphere (n - Suc 0))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma diag_compat_extract_subdiag:
  assumes "B\<in> carrier_mat n n"
  and "diag_compat B l"
  shows "B = diag_block_mat (extract_subdiags B l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B = diag_block_mat (extract_subdiags B l)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
B \<in> carrier_mat n n
diag_compat B l

goal (1 subgoal):
 1. B = diag_block_mat (extract_subdiags B l)
[PROOF STEP]
proof (induct l arbitrary:B n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>B n. \<lbrakk>B \<in> carrier_mat n n; diag_compat B []\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B [])
 2. \<And>a l B n. \<lbrakk>\<And>B n. \<lbrakk>B \<in> carrier_mat n n; diag_compat B l\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B l); B \<in> carrier_mat n n; diag_compat B (a # l)\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B (a # l))
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
B \<in> carrier_mat n n
diag_compat B []

goal (2 subgoals):
 1. \<And>B n. \<lbrakk>B \<in> carrier_mat n n; diag_compat B []\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B [])
 2. \<And>a l B n. \<lbrakk>\<And>B n. \<lbrakk>B \<in> carrier_mat n n; diag_compat B l\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B l); B \<in> carrier_mat n n; diag_compat B (a # l)\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B (a # l))
[PROOF STEP]
have "extract_subdiags B Nil = []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. extract_subdiags B [] = []
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
extract_subdiags B [] = []

goal (2 subgoals):
 1. \<And>B n. \<lbrakk>B \<in> carrier_mat n n; diag_compat B []\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B [])
 2. \<And>a l B n. \<lbrakk>\<And>B n. \<lbrakk>B \<in> carrier_mat n n; diag_compat B l\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B l); B \<in> carrier_mat n n; diag_compat B (a # l)\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B (a # l))
[PROOF STEP]
have "B = 0\<^sub>m 0 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B = 0\<^sub>m 0 0
[PROOF STEP]
proof (rule eq_matI, auto simp add: assms)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. dim_row B = 0
 2. dim_col B = 0
[PROOF STEP]
show "dim_row B = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row B = 0
[PROOF STEP]
using Nil
[PROOF STATE]
proof (prove)
using this:
B \<in> carrier_mat n n
diag_compat B []

goal (1 subgoal):
 1. dim_row B = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dim_row B = 0

goal (1 subgoal):
 1. dim_col B = 0
[PROOF STEP]
show "dim_col B = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_col B = 0
[PROOF STEP]
using Nil
[PROOF STATE]
proof (prove)
using this:
B \<in> carrier_mat n n
diag_compat B []

goal (1 subgoal):
 1. dim_col B = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dim_col B = 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
B = 0\<^sub>m 0 0

goal (2 subgoals):
 1. \<And>B n. \<lbrakk>B \<in> carrier_mat n n; diag_compat B []\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B [])
 2. \<And>a l B n. \<lbrakk>\<And>B n. \<lbrakk>B \<in> carrier_mat n n; diag_compat B l\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B l); B \<in> carrier_mat n n; diag_compat B (a # l)\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B (a # l))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
B = 0\<^sub>m 0 0
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
B = 0\<^sub>m 0 0

goal (1 subgoal):
 1. B = diag_block_mat (extract_subdiags B [])
[PROOF STEP]
using diag_block_mat_singleton[of B]
[PROOF STATE]
proof (prove)
using this:
B = 0\<^sub>m 0 0
diag_block_mat [B] = B

goal (1 subgoal):
 1. B = diag_block_mat (extract_subdiags B [])
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
B = diag_block_mat (extract_subdiags B [])

goal (1 subgoal):
 1. \<And>a l B n. \<lbrakk>\<And>B n. \<lbrakk>B \<in> carrier_mat n n; diag_compat B l\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B l); B \<in> carrier_mat n n; diag_compat B (a # l)\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B (a # l))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a l B n. \<lbrakk>\<And>B n. \<lbrakk>B \<in> carrier_mat n n; diag_compat B l\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B l); B \<in> carrier_mat n n; diag_compat B (a # l)\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B (a # l))
[PROOF STEP]
case (Cons a l)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?B \<in> carrier_mat ?n ?n; diag_compat ?B l\<rbrakk> \<Longrightarrow> ?B = diag_block_mat (extract_subdiags ?B l)
B \<in> carrier_mat n n
diag_compat B (a # l)

goal (1 subgoal):
 1. \<And>a l B n. \<lbrakk>\<And>B n. \<lbrakk>B \<in> carrier_mat n n; diag_compat B l\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B l); B \<in> carrier_mat n n; diag_compat B (a # l)\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B (a # l))
[PROOF STEP]
define B1 where "B1 = fst (split_block B a a)"
[PROOF STATE]
proof (state)
this:
B1 = fst (split_block B a a)

goal (1 subgoal):
 1. \<And>a l B n. \<lbrakk>\<And>B n. \<lbrakk>B \<in> carrier_mat n n; diag_compat B l\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B l); B \<in> carrier_mat n n; diag_compat B (a # l)\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B (a # l))
[PROOF STEP]
define B2 where "B2 = fst (snd (split_block B a a))"
[PROOF STATE]
proof (state)
this:
B2 = fst (snd (split_block B a a))

goal (1 subgoal):
 1. \<And>a l B n. \<lbrakk>\<And>B n. \<lbrakk>B \<in> carrier_mat n n; diag_compat B l\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B l); B \<in> carrier_mat n n; diag_compat B (a # l)\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B (a # l))
[PROOF STEP]
define B3 where "B3 = fst (snd (snd (split_block B a a)))"
[PROOF STATE]
proof (state)
this:
B3 = fst (snd (snd (split_block B a a)))

goal (1 subgoal):
 1. \<And>a l B n. \<lbrakk>\<And>B n. \<lbrakk>B \<in> carrier_mat n n; diag_compat B l\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B l); B \<in> carrier_mat n n; diag_compat B (a # l)\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B (a # l))
[PROOF STEP]
define B4 where "B4 = snd (snd (snd (split_block B a a)))"
[PROOF STATE]
proof (state)
this:
B4 = snd (snd (snd (split_block B a a)))

goal (1 subgoal):
 1. \<And>a l B n. \<lbrakk>\<And>B n. \<lbrakk>B \<in> carrier_mat n n; diag_compat B l\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B l); B \<in> carrier_mat n n; diag_compat B (a # l)\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B (a # l))
[PROOF STEP]
have sp: "split_block B a a = (B1, B2, B3, B4)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. split_block B a a = (B1, B2, B3, B4)
[PROOF STEP]
using fst_conv snd_conv
[PROOF STATE]
proof (prove)
using this:
fst (?x1.0, ?x2.0) = ?x1.0
snd (?x1.0, ?x2.0) = ?x2.0

goal (1 subgoal):
 1. split_block B a a = (B1, B2, B3, B4)
[PROOF STEP]
unfolding B1_def B2_def B3_def B4_def
[PROOF STATE]
proof (prove)
using this:
fst (?x1.0, ?x2.0) = ?x1.0
snd (?x1.0, ?x2.0) = ?x2.0

goal (1 subgoal):
 1. split_block B a a = (fst (split_block B a a), fst (snd (split_block B a a)), fst (snd (snd (split_block B a a))), snd (snd (snd (split_block B a a))))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
split_block B a a = (B1, B2, B3, B4)

goal (1 subgoal):
 1. \<And>a l B n. \<lbrakk>\<And>B n. \<lbrakk>B \<in> carrier_mat n n; diag_compat B l\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B l); B \<in> carrier_mat n n; diag_compat B (a # l)\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B (a # l))
[PROOF STEP]
have "a \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<le> n
[PROOF STEP]
using assms Cons
[PROOF STATE]
proof (prove)
using this:
B \<in> carrier_mat n n
diag_compat B l
\<lbrakk>?B \<in> carrier_mat ?n ?n; diag_compat ?B l\<rbrakk> \<Longrightarrow> ?B = diag_block_mat (extract_subdiags ?B l)
B \<in> carrier_mat n n
diag_compat B (a # l)

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

goal (1 subgoal):
 1. \<And>a l B n. \<lbrakk>\<And>B n. \<lbrakk>B \<in> carrier_mat n n; diag_compat B l\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B l); B \<in> carrier_mat n n; diag_compat B (a # l)\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B (a # l))
[PROOF STEP]
have "diag_compat B4 l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diag_compat B4 l
[PROOF STEP]
using sp Cons
[PROOF STATE]
proof (prove)
using this:
split_block B a a = (B1, B2, B3, B4)
\<lbrakk>?B \<in> carrier_mat ?n ?n; diag_compat ?B l\<rbrakk> \<Longrightarrow> ?B = diag_block_mat (extract_subdiags ?B l)
B \<in> carrier_mat n n
diag_compat B (a # l)

goal (1 subgoal):
 1. diag_compat B4 l
[PROOF STEP]
by (simp add: Let_def)
[PROOF STATE]
proof (state)
this:
diag_compat B4 l

goal (1 subgoal):
 1. \<And>a l B n. \<lbrakk>\<And>B n. \<lbrakk>B \<in> carrier_mat n n; diag_compat B l\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B l); B \<in> carrier_mat n n; diag_compat B (a # l)\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B (a # l))
[PROOF STEP]
have "B1 \<in> carrier_mat a a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B1 \<in> carrier_mat a a
[PROOF STEP]
using sp Cons split_block(1)[OF sp]
[PROOF STATE]
proof (prove)
using this:
split_block B a a = (B1, B2, B3, B4)
\<lbrakk>?B \<in> carrier_mat ?n ?n; diag_compat ?B l\<rbrakk> \<Longrightarrow> ?B = diag_block_mat (extract_subdiags ?B l)
B \<in> carrier_mat n n
diag_compat B (a # l)
\<lbrakk>dim_row B = a + ?sr2.0; dim_col B = a + ?sc2.0\<rbrakk> \<Longrightarrow> B1 \<in> carrier_mat a a

goal (1 subgoal):
 1. B1 \<in> carrier_mat a a
[PROOF STEP]
by (metis \<open>a \<le> n\<close> carrier_matD(1) carrier_matD(2) le_add_diff_inverse)
[PROOF STATE]
proof (state)
this:
B1 \<in> carrier_mat a a

goal (1 subgoal):
 1. \<And>a l B n. \<lbrakk>\<And>B n. \<lbrakk>B \<in> carrier_mat n n; diag_compat B l\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B l); B \<in> carrier_mat n n; diag_compat B (a # l)\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B (a # l))
[PROOF STEP]
have "B2 \<in> carrier_mat a (n-a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B2 \<in> carrier_mat a (n - a)
[PROOF STEP]
using sp Cons
[PROOF STATE]
proof (prove)
using this:
split_block B a a = (B1, B2, B3, B4)
\<lbrakk>?B \<in> carrier_mat ?n ?n; diag_compat ?B l\<rbrakk> \<Longrightarrow> ?B = diag_block_mat (extract_subdiags ?B l)
B \<in> carrier_mat n n
diag_compat B (a # l)

goal (1 subgoal):
 1. B2 \<in> carrier_mat a (n - a)
[PROOF STEP]
by (simp add: Let_def)
[PROOF STATE]
proof (state)
this:
B2 \<in> carrier_mat a (n - a)

goal (1 subgoal):
 1. \<And>a l B n. \<lbrakk>\<And>B n. \<lbrakk>B \<in> carrier_mat n n; diag_compat B l\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B l); B \<in> carrier_mat n n; diag_compat B (a # l)\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B (a # l))
[PROOF STEP]
have "B3 \<in> carrier_mat (n-a) a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B3 \<in> carrier_mat (n - a) a
[PROOF STEP]
using sp Cons
[PROOF STATE]
proof (prove)
using this:
split_block B a a = (B1, B2, B3, B4)
\<lbrakk>?B \<in> carrier_mat ?n ?n; diag_compat ?B l\<rbrakk> \<Longrightarrow> ?B = diag_block_mat (extract_subdiags ?B l)
B \<in> carrier_mat n n
diag_compat B (a # l)

goal (1 subgoal):
 1. B3 \<in> carrier_mat (n - a) a
[PROOF STEP]
by (simp add: Let_def)
[PROOF STATE]
proof (state)
this:
B3 \<in> carrier_mat (n - a) a

goal (1 subgoal):
 1. \<And>a l B n. \<lbrakk>\<And>B n. \<lbrakk>B \<in> carrier_mat n n; diag_compat B l\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B l); B \<in> carrier_mat n n; diag_compat B (a # l)\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B (a # l))
[PROOF STEP]
have "B4 \<in> carrier_mat (n-a) (n-a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B4 \<in> carrier_mat (n - a) (n - a)
[PROOF STEP]
using assms \<open>a \<le> n\<close> Cons
      split_block(4)[OF sp]
[PROOF STATE]
proof (prove)
using this:
B \<in> carrier_mat n n
diag_compat B l
a \<le> n
\<lbrakk>?B \<in> carrier_mat ?n ?n; diag_compat ?B l\<rbrakk> \<Longrightarrow> ?B = diag_block_mat (extract_subdiags ?B l)
B \<in> carrier_mat n n
diag_compat B (a # l)
\<lbrakk>dim_row B = a + ?sr2.0; dim_col B = a + ?sc2.0\<rbrakk> \<Longrightarrow> B4 \<in> carrier_mat ?sr2.0 ?sc2.0

goal (1 subgoal):
 1. B4 \<in> carrier_mat (n - a) (n - a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
B4 \<in> carrier_mat (n - a) (n - a)

goal (1 subgoal):
 1. \<And>a l B n. \<lbrakk>\<And>B n. \<lbrakk>B \<in> carrier_mat n n; diag_compat B l\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B l); B \<in> carrier_mat n n; diag_compat B (a # l)\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B (a # l))
[PROOF STEP]
have b2: "0\<^sub>m (dim_row B1) (dim_col B4) = B2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0\<^sub>m (dim_row B1) (dim_col B4) = B2
[PROOF STEP]
using diag_compat.simps(2)[THEN iffD1, OF \<open>diag_compat B (a#l)\<close>]
    \<open>B4 \<in> carrier_mat (n-a) (n-a)\<close> \<open>B1 \<in> carrier_mat a a\<close>
    \<open>B2 \<in> carrier_mat a (n-a)\<close> sp
[PROOF STATE]
proof (prove)
using this:
a \<le> dim_row B \<and> (let n = dim_row B; (B1, B2, B3, B4) = split_block B a a in B2 = 0\<^sub>m a (n - a) \<and> B3 = 0\<^sub>m (n - a) a \<and> diag_compat B4 l)
B4 \<in> carrier_mat (n - a) (n - a)
B1 \<in> carrier_mat a a
B2 \<in> carrier_mat a (n - a)
split_block B a a = (B1, B2, B3, B4)

goal (1 subgoal):
 1. 0\<^sub>m (dim_row B1) (dim_col B4) = B2
[PROOF STEP]
unfolding Let_def
    Cons(2)
[PROOF STATE]
proof (prove)
using this:
a \<le> dim_row B \<and> (case split_block B a a of (B1, B2, B3, B4) \<Rightarrow> B2 = 0\<^sub>m a (dim_row B - a) \<and> B3 = 0\<^sub>m (dim_row B - a) a \<and> diag_compat B4 l)
B4 \<in> carrier_mat (n - a) (n - a)
B1 \<in> carrier_mat a a
B2 \<in> carrier_mat a (n - a)
split_block B a a = (B1, B2, B3, B4)

goal (1 subgoal):
 1. 0\<^sub>m (dim_row B1) (dim_col B4) = B2
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
0\<^sub>m (dim_row B1) (dim_col B4) = B2

goal (1 subgoal):
 1. \<And>a l B n. \<lbrakk>\<And>B n. \<lbrakk>B \<in> carrier_mat n n; diag_compat B l\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B l); B \<in> carrier_mat n n; diag_compat B (a # l)\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B (a # l))
[PROOF STEP]
have b3: "0\<^sub>m (dim_row B4) (dim_col B1) = B3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0\<^sub>m (dim_row B4) (dim_col B1) = B3
[PROOF STEP]
using diag_compat.simps(2)[THEN iffD1, OF \<open>diag_compat B (a#l)\<close>]
    \<open>B4 \<in> carrier_mat (n-a) (n-a)\<close> \<open>B1 \<in> carrier_mat a a\<close>
    \<open>B2 \<in> carrier_mat a (n-a)\<close> sp
[PROOF STATE]
proof (prove)
using this:
a \<le> dim_row B \<and> (let n = dim_row B; (B1, B2, B3, B4) = split_block B a a in B2 = 0\<^sub>m a (n - a) \<and> B3 = 0\<^sub>m (n - a) a \<and> diag_compat B4 l)
B4 \<in> carrier_mat (n - a) (n - a)
B1 \<in> carrier_mat a a
B2 \<in> carrier_mat a (n - a)
split_block B a a = (B1, B2, B3, B4)

goal (1 subgoal):
 1. 0\<^sub>m (dim_row B4) (dim_col B1) = B3
[PROOF STEP]
unfolding Let_def
    Cons(2)
[PROOF STATE]
proof (prove)
using this:
a \<le> dim_row B \<and> (case split_block B a a of (B1, B2, B3, B4) \<Rightarrow> B2 = 0\<^sub>m a (dim_row B - a) \<and> B3 = 0\<^sub>m (dim_row B - a) a \<and> diag_compat B4 l)
B4 \<in> carrier_mat (n - a) (n - a)
B1 \<in> carrier_mat a a
B2 \<in> carrier_mat a (n - a)
split_block B a a = (B1, B2, B3, B4)

goal (1 subgoal):
 1. 0\<^sub>m (dim_row B4) (dim_col B1) = B3
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
0\<^sub>m (dim_row B4) (dim_col B1) = B3

goal (1 subgoal):
 1. \<And>a l B n. \<lbrakk>\<And>B n. \<lbrakk>B \<in> carrier_mat n n; diag_compat B l\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B l); B \<in> carrier_mat n n; diag_compat B (a # l)\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B (a # l))
[PROOF STEP]
have "extract_subdiags B (a#l) = B1 # (extract_subdiags B4 l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. extract_subdiags B (a # l) = B1 # extract_subdiags B4 l
[PROOF STEP]
using fst_conv snd_conv extract_subdiags.simps(2)[of B]
[PROOF STATE]
proof (prove)
using this:
fst (?x1.0, ?x2.0) = ?x1.0
snd (?x1.0, ?x2.0) = ?x2.0
extract_subdiags B (?x # ?xs) = (let (B1, B2, B3, B4) = split_block B ?x ?x in B1 # extract_subdiags B4 ?xs)

goal (1 subgoal):
 1. extract_subdiags B (a # l) = B1 # extract_subdiags B4 l
[PROOF STEP]
unfolding B1_def B4_def Let_def
[PROOF STATE]
proof (prove)
using this:
fst (?x1.0, ?x2.0) = ?x1.0
snd (?x1.0, ?x2.0) = ?x2.0
extract_subdiags B (?x # ?xs) = (case split_block B ?x ?x of (B1, B2, B3, B4) \<Rightarrow> B1 # extract_subdiags B4 ?xs)

goal (1 subgoal):
 1. extract_subdiags B (a # l) = fst (split_block B a a) # extract_subdiags (snd (snd (snd (split_block B a a)))) l
[PROOF STEP]
by (simp add: split_def)
[PROOF STATE]
proof (state)
this:
extract_subdiags B (a # l) = B1 # extract_subdiags B4 l

goal (1 subgoal):
 1. \<And>a l B n. \<lbrakk>\<And>B n. \<lbrakk>B \<in> carrier_mat n n; diag_compat B l\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B l); B \<in> carrier_mat n n; diag_compat B (a # l)\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B (a # l))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
extract_subdiags B (a # l) = B1 # extract_subdiags B4 l

goal (1 subgoal):
 1. \<And>a l B n. \<lbrakk>\<And>B n. \<lbrakk>B \<in> carrier_mat n n; diag_compat B l\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B l); B \<in> carrier_mat n n; diag_compat B (a # l)\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B (a # l))
[PROOF STEP]
have "diag_block_mat ... =
    (let
     C = diag_block_mat (extract_subdiags B4 l)
     in four_block_mat B1 (0\<^sub>m (dim_row B1) (dim_col C))
        (0\<^sub>m (dim_row C) (dim_col B1)) C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diag_block_mat (B1 # extract_subdiags B4 l) = Let (diag_block_mat (extract_subdiags B4 l)) (four_block_diag B1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
diag_block_mat (B1 # extract_subdiags B4 l) = Let (diag_block_mat (extract_subdiags B4 l)) (four_block_diag B1)

goal (1 subgoal):
 1. \<And>a l B n. \<lbrakk>\<And>B n. \<lbrakk>B \<in> carrier_mat n n; diag_compat B l\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B l); B \<in> carrier_mat n n; diag_compat B (a # l)\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B (a # l))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
diag_block_mat (B1 # extract_subdiags B4 l) = Let (diag_block_mat (extract_subdiags B4 l)) (four_block_diag B1)

goal (1 subgoal):
 1. \<And>a l B n. \<lbrakk>\<And>B n. \<lbrakk>B \<in> carrier_mat n n; diag_compat B l\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B l); B \<in> carrier_mat n n; diag_compat B (a # l)\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B (a # l))
[PROOF STEP]
have "... = four_block_mat B1 (0\<^sub>m (dim_row B1) (dim_col B4))
    (0\<^sub>m (dim_row B4) (dim_col B1)) B4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Let (diag_block_mat (extract_subdiags B4 l)) (four_block_diag B1) = four_block_diag B1 B4
[PROOF STEP]
using Cons \<open>diag_compat B4 l\<close>
    \<open>B4 \<in> carrier_mat (n-a) (n-a)\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?B \<in> carrier_mat ?n ?n; diag_compat ?B l\<rbrakk> \<Longrightarrow> ?B = diag_block_mat (extract_subdiags ?B l)
B \<in> carrier_mat n n
diag_compat B (a # l)
diag_compat B4 l
B4 \<in> carrier_mat (n - a) (n - a)

goal (1 subgoal):
 1. Let (diag_block_mat (extract_subdiags B4 l)) (four_block_diag B1) = four_block_diag B1 B4
[PROOF STEP]
by (simp add:Let_def)
[PROOF STATE]
proof (state)
this:
Let (diag_block_mat (extract_subdiags B4 l)) (four_block_diag B1) = four_block_diag B1 B4

goal (1 subgoal):
 1. \<And>a l B n. \<lbrakk>\<And>B n. \<lbrakk>B \<in> carrier_mat n n; diag_compat B l\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B l); B \<in> carrier_mat n n; diag_compat B (a # l)\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B (a # l))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Let (diag_block_mat (extract_subdiags B4 l)) (four_block_diag B1) = four_block_diag B1 B4

goal (1 subgoal):
 1. \<And>a l B n. \<lbrakk>\<And>B n. \<lbrakk>B \<in> carrier_mat n n; diag_compat B l\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B l); B \<in> carrier_mat n n; diag_compat B (a # l)\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B (a # l))
[PROOF STEP]
have "... = four_block_mat B1 B2 B3 B4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_diag B1 B4 = four_block_mat B1 B2 B3 B4
[PROOF STEP]
using b2 b3
[PROOF STATE]
proof (prove)
using this:
0\<^sub>m (dim_row B1) (dim_col B4) = B2
0\<^sub>m (dim_row B4) (dim_col B1) = B3

goal (1 subgoal):
 1. four_block_diag B1 B4 = four_block_mat B1 B2 B3 B4
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
four_block_diag B1 B4 = four_block_mat B1 B2 B3 B4

goal (1 subgoal):
 1. \<And>a l B n. \<lbrakk>\<And>B n. \<lbrakk>B \<in> carrier_mat n n; diag_compat B l\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B l); B \<in> carrier_mat n n; diag_compat B (a # l)\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B (a # l))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
four_block_diag B1 B4 = four_block_mat B1 B2 B3 B4

goal (1 subgoal):
 1. \<And>a l B n. \<lbrakk>\<And>B n. \<lbrakk>B \<in> carrier_mat n n; diag_compat B l\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B l); B \<in> carrier_mat n n; diag_compat B (a # l)\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B (a # l))
[PROOF STEP]
have "... = B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_mat B1 B2 B3 B4 = B
[PROOF STEP]
using split_block(5)[OF sp, of "n-a" "n-a"] Cons
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>dim_row B = a + (n - a); dim_col B = a + (n - a)\<rbrakk> \<Longrightarrow> B = four_block_mat B1 B2 B3 B4
\<lbrakk>?B \<in> carrier_mat ?n ?n; diag_compat ?B l\<rbrakk> \<Longrightarrow> ?B = diag_block_mat (extract_subdiags ?B l)
B \<in> carrier_mat n n
diag_compat B (a # l)

goal (1 subgoal):
 1. four_block_mat B1 B2 B3 B4 = B
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
four_block_mat B1 B2 B3 B4 = B

goal (1 subgoal):
 1. \<And>a l B n. \<lbrakk>\<And>B n. \<lbrakk>B \<in> carrier_mat n n; diag_compat B l\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B l); B \<in> carrier_mat n n; diag_compat B (a # l)\<rbrakk> \<Longrightarrow> B = diag_block_mat (extract_subdiags B (a # l))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
diag_block_mat (extract_subdiags B (a # l)) = B
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
diag_block_mat (extract_subdiags B (a # l)) = B

goal (1 subgoal):
 1. B = diag_block_mat (extract_subdiags B (a # l))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
B = diag_block_mat (extract_subdiags B (a # l))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lm093:
  assumes "x\<in>X"
  shows "toFunction (graph X f) x = f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. toFunction (graph X f) x = f x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in> X

goal (1 subgoal):
 1. toFunction (graph X f) x = f x
[PROOF STEP]
by (metis graphEqImage toFunction_def)


[STATEMENT]
lemma finite_fset_map: "finite (set_fmap (F::(('a::finite) -~> 'b)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (set_fmap F)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite (set_fmap F)
[PROOF STEP]
from finite_cartesian_product[OF finite_dom_fmap finite_fmap_ran]
[PROOF STATE]
proof (chain)
picking this:
finite (dom ?F2 \<times> ran ?F1)
[PROOF STEP]
have "finite (dom F \<times> ran F)"
[PROOF STATE]
proof (prove)
using this:
finite (dom ?F2 \<times> ran ?F1)

goal (1 subgoal):
 1. finite (dom F \<times> ran F)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
finite (dom F \<times> ran F)

goal (1 subgoal):
 1. finite (set_fmap F)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite (dom F \<times> ran F)

goal (1 subgoal):
 1. finite (set_fmap F)
[PROOF STEP]
have "set_fmap F \<subseteq> dom F \<times> ran F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_fmap F \<subseteq> dom F \<times> ran F
[PROOF STEP]
unfolding set_fmap_def dom_def ran_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(x, y). x \<in> {a. F a \<noteq> None} \<and> F x = Some y} \<subseteq> {a. F a \<noteq> None} \<times> {b. \<exists>a. F a = Some b}
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
set_fmap F \<subseteq> dom F \<times> ran F

goal (1 subgoal):
 1. finite (set_fmap F)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
finite (dom F \<times> ran F)
set_fmap F \<subseteq> dom F \<times> ran F
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite (dom F \<times> ran F)
set_fmap F \<subseteq> dom F \<times> ran F

goal (1 subgoal):
 1. finite (set_fmap F)
[PROOF STEP]
using finite_subset
[PROOF STATE]
proof (prove)
using this:
finite (dom F \<times> ran F)
set_fmap F \<subseteq> dom F \<times> ran F
\<lbrakk>?A \<subseteq> ?B; finite ?B\<rbrakk> \<Longrightarrow> finite ?A

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vpairwise_vsubset:
  assumes "vpairwise P S" and "T \<subseteq>\<^sub>\<circ> S"
  shows "vpairwise P T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vpairwise P T
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
vpairwise P S
T \<subseteq>\<^sub>\<circ> S

goal (1 subgoal):
 1. vpairwise P T
[PROOF STEP]
by (metis less_eq_V_def subset_eq vpairwiseD(2) vpairwiseI)


[STATEMENT]
lemma abs_convergent_prod_imp_LIMSEQ:
  fixes f :: "nat \<Rightarrow> 'a :: {comm_ring_1,real_normed_div_algebra}"
  assumes "abs_convergent_prod f"
  shows   "f \<longlonglongrightarrow> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<longlonglongrightarrow> (1::'a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f \<longlonglongrightarrow> (1::'a)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
abs_convergent_prod f
[PROOF STEP]
have "summable (\<lambda>n. norm (f n - 1))"
[PROOF STATE]
proof (prove)
using this:
abs_convergent_prod f

goal (1 subgoal):
 1. summable (\<lambda>n. norm (f n - (1::'a)))
[PROOF STEP]
by (rule abs_convergent_prod_imp_summable)
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. norm (f n - (1::'a)))

goal (1 subgoal):
 1. f \<longlonglongrightarrow> (1::'a)
[PROOF STEP]
from summable_LIMSEQ_zero[OF this]
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. norm (f n - (1::'a))) \<longlonglongrightarrow> 0
[PROOF STEP]
have "(\<lambda>n. f n - 1) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. norm (f n - (1::'a))) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>n. f n - (1::'a)) \<longlonglongrightarrow> (0::'a)
[PROOF STEP]
by (simp add: tendsto_norm_zero_iff)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. f n - (1::'a)) \<longlonglongrightarrow> (0::'a)

goal (1 subgoal):
 1. f \<longlonglongrightarrow> (1::'a)
[PROOF STEP]
from tendsto_add[OF this tendsto_const[of 1]]
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. f x - (1::'a) + (1::'a)) \<longlonglongrightarrow> (0::'a) + (1::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. f x - (1::'a) + (1::'a)) \<longlonglongrightarrow> (0::'a) + (1::'a)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma j_gt_m_pigeonhole:
  assumes "lb T A j" "j > m"
  shows "\<exists>x \<in> {1..j}. \<exists>y \<in> {1..j}. \<exists>z \<in> {1..m}. x \<noteq> y \<and> x \<in> A z \<and> y \<in> A z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x\<in>{1..j}. \<exists>y\<in>{1..j}. \<exists>z\<in>{1..m}. x \<noteq> y \<and> x \<in> A z \<and> y \<in> A z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>x\<in>{1..j}. \<exists>y\<in>{1..j}. \<exists>z\<in>{1..m}. x \<noteq> y \<and> x \<in> A z \<and> y \<in> A z
[PROOF STEP]
have "\<forall>x \<in> {1..j}. \<exists>y \<in> {1..m}. x \<in> A y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>{1..j}. \<exists>y\<in>{1..m}. x \<in> A y
[PROOF STEP]
using lbE(2)[OF assms(1)]
[PROOF STATE]
proof (prove)
using this:
\<Union> (A ` {1..m}) = {1..j}

goal (1 subgoal):
 1. \<forall>x\<in>{1..j}. \<exists>y\<in>{1..m}. x \<in> A y
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>{1..j}. \<exists>y\<in>{1..m}. x \<in> A y

goal (1 subgoal):
 1. \<exists>x\<in>{1..j}. \<exists>y\<in>{1..j}. \<exists>z\<in>{1..m}. x \<noteq> y \<and> x \<in> A z \<and> y \<in> A z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>{1..j}. \<exists>y\<in>{1..m}. x \<in> A y
[PROOF STEP]
have "\<exists>f. \<forall>x \<in> {1..j}. x \<in> A (f x) \<and> f x \<in> {1..m}"
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>{1..j}. \<exists>y\<in>{1..m}. x \<in> A y

goal (1 subgoal):
 1. \<exists>f. \<forall>x\<in>{1..j}. x \<in> A (f x) \<and> f x \<in> {1..m}
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<exists>f. \<forall>x\<in>{1..j}. x \<in> A (f x) \<and> f x \<in> {1..m}

goal (1 subgoal):
 1. \<exists>x\<in>{1..j}. \<exists>y\<in>{1..j}. \<exists>z\<in>{1..m}. x \<noteq> y \<and> x \<in> A z \<and> y \<in> A z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>f. \<forall>x\<in>{1..j}. x \<in> A (f x) \<and> f x \<in> {1..m}
[PROOF STEP]
obtain f where f_def: "\<forall>x \<in> {1..j}. x \<in> A (f x) \<and> f x \<in> {1..m}"
[PROOF STATE]
proof (prove)
using this:
\<exists>f. \<forall>x\<in>{1..j}. x \<in> A (f x) \<and> f x \<in> {1..m}

goal (1 subgoal):
 1. (\<And>f. \<forall>x\<in>{1..j}. x \<in> A (f x) \<and> f x \<in> {1..m} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>{1..j}. x \<in> A (f x) \<and> f x \<in> {1..m}

goal (1 subgoal):
 1. \<exists>x\<in>{1..j}. \<exists>y\<in>{1..j}. \<exists>z\<in>{1..m}. x \<noteq> y \<and> x \<in> A z \<and> y \<in> A z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>{1..j}. x \<in> A (f x) \<and> f x \<in> {1..m}
[PROOF STEP]
have "card (f ` {1..j}) \<le> card {1..m}"
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>{1..j}. x \<in> A (f x) \<and> f x \<in> {1..m}

goal (1 subgoal):
 1. card (f ` {1..j}) \<le> card {1..m}
[PROOF STEP]
by (meson card_mono finite_atLeastAtMost image_subset_iff)
[PROOF STATE]
proof (state)
this:
card (f ` {1..j}) \<le> card {1..m}

goal (1 subgoal):
 1. \<exists>x\<in>{1..j}. \<exists>y\<in>{1..j}. \<exists>z\<in>{1..m}. x \<noteq> y \<and> x \<in> A z \<and> y \<in> A z
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card (f ` {1..j}) \<le> card {1..m}

goal (1 subgoal):
 1. \<exists>x\<in>{1..j}. \<exists>y\<in>{1..j}. \<exists>z\<in>{1..m}. x \<noteq> y \<and> x \<in> A z \<and> y \<in> A z
[PROOF STEP]
have "... < card {1..j}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {1..m} < card {1..j}
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
m < j

goal (1 subgoal):
 1. card {1..m} < card {1..j}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card {1..m} < card {1..j}

goal (1 subgoal):
 1. \<exists>x\<in>{1..j}. \<exists>y\<in>{1..j}. \<exists>z\<in>{1..m}. x \<noteq> y \<and> x \<in> A z \<and> y \<in> A z
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
card (f ` {1..j}) < card {1..j}
[PROOF STEP]
have "card (f ` {1..j}) < card {1..j}"
[PROOF STATE]
proof (prove)
using this:
card (f ` {1..j}) < card {1..j}

goal (1 subgoal):
 1. card (f ` {1..j}) < card {1..j}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
card (f ` {1..j}) < card {1..j}

goal (1 subgoal):
 1. \<exists>x\<in>{1..j}. \<exists>y\<in>{1..j}. \<exists>z\<in>{1..m}. x \<noteq> y \<and> x \<in> A z \<and> y \<in> A z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card (f ` {1..j}) < card {1..j}
[PROOF STEP]
have "\<not> inj_on f {1..j}"
[PROOF STATE]
proof (prove)
using this:
card (f ` {1..j}) < card {1..j}

goal (1 subgoal):
 1. \<not> inj_on f {1..j}
[PROOF STEP]
using pigeonhole
[PROOF STATE]
proof (prove)
using this:
card (f ` {1..j}) < card {1..j}
card (?f ` ?A) < card ?A \<Longrightarrow> \<not> inj_on ?f ?A

goal (1 subgoal):
 1. \<not> inj_on f {1..j}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<not> inj_on f {1..j}

goal (1 subgoal):
 1. \<exists>x\<in>{1..j}. \<exists>y\<in>{1..j}. \<exists>z\<in>{1..m}. x \<noteq> y \<and> x \<in> A z \<and> y \<in> A z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> inj_on f {1..j}
[PROOF STEP]
have "\<exists>x \<in> {1..j}. \<exists>y \<in> {1..j}. x \<noteq> y \<and> f x = f y"
[PROOF STATE]
proof (prove)
using this:
\<not> inj_on f {1..j}

goal (1 subgoal):
 1. \<exists>x\<in>{1..j}. \<exists>y\<in>{1..j}. x \<noteq> y \<and> f x = f y
[PROOF STEP]
unfolding inj_on_def
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>x\<in>{1..j}. \<forall>y\<in>{1..j}. f x = f y \<longrightarrow> x = y)

goal (1 subgoal):
 1. \<exists>x\<in>{1..j}. \<exists>y\<in>{1..j}. x \<noteq> y \<and> f x = f y
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>x\<in>{1..j}. \<exists>y\<in>{1..j}. x \<noteq> y \<and> f x = f y

goal (1 subgoal):
 1. \<exists>x\<in>{1..j}. \<exists>y\<in>{1..j}. \<exists>z\<in>{1..m}. x \<noteq> y \<and> x \<in> A z \<and> y \<in> A z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>x\<in>{1..j}. \<exists>y\<in>{1..j}. x \<noteq> y \<and> f x = f y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>x\<in>{1..j}. \<exists>y\<in>{1..j}. x \<noteq> y \<and> f x = f y

goal (1 subgoal):
 1. \<exists>x\<in>{1..j}. \<exists>y\<in>{1..j}. \<exists>z\<in>{1..m}. x \<noteq> y \<and> x \<in> A z \<and> y \<in> A z
[PROOF STEP]
using f_def
[PROOF STATE]
proof (prove)
using this:
\<exists>x\<in>{1..j}. \<exists>y\<in>{1..j}. x \<noteq> y \<and> f x = f y
\<forall>x\<in>{1..j}. x \<in> A (f x) \<and> f x \<in> {1..m}

goal (1 subgoal):
 1. \<exists>x\<in>{1..j}. \<exists>y\<in>{1..j}. \<exists>z\<in>{1..m}. x \<noteq> y \<and> x \<in> A z \<and> y \<in> A z
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<exists>x\<in>{1..j}. \<exists>y\<in>{1..j}. \<exists>z\<in>{1..m}. x \<noteq> y \<and> x \<in> A z \<and> y \<in> A z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_ImageI:
  assumes "finite A"
  assumes "\<And>a. a\<in>A \<Longrightarrow> finite (R``{a})"
  shows "finite (R``A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (R `` A)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite (R `` A)
[PROOF STEP]
note [[simproc add: finite_Collect]]
[PROOF STATE]
proof (state)
this:
TERM _

goal (1 subgoal):
 1. finite (R `` A)
[PROOF STEP]
have "R``A = \<Union>{R``{a} | a. a:A}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R `` A = \<Union> {R `` {a} |a. a \<in> A}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
R `` A = \<Union> {R `` {a} |a. a \<in> A}

goal (1 subgoal):
 1. finite (R `` A)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
R `` A = \<Union> {R `` {a} |a. a \<in> A}

goal (1 subgoal):
 1. finite (R `` A)
[PROOF STEP]
have "finite (\<Union>{R``{a} | a. a:A})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (\<Union> {R `` {a} |a. a \<in> A})
[PROOF STEP]
apply (rule finite_Union)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. finite {R `` {a} |a. a \<in> A}
 2. \<And>M. M \<in> {R `` {a} |a. a \<in> A} \<Longrightarrow> finite M
[PROOF STEP]
apply (simp add: assms)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>M. M \<in> {R `` {a} |a. a \<in> A} \<Longrightarrow> finite M
[PROOF STEP]
apply (clarsimp simp: assms)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
finite (\<Union> {R `` {a} |a. a \<in> A})

goal (1 subgoal):
 1. finite (R `` A)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
finite (R `` A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite (R `` A)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dia_eq_fin_dia_if_finite: "diameter f < \<infinity> \<Longrightarrow> diameter f = fin_diameter f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diameter f < \<infinity> \<Longrightarrow> diameter f = fin_diameter f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. diameter f < \<infinity> \<Longrightarrow> diameter f = fin_diameter f
[PROOF STEP]
assume "diameter f < \<infinity>"
[PROOF STATE]
proof (state)
this:
diameter f < \<infinity>

goal (1 subgoal):
 1. diameter f < \<infinity> \<Longrightarrow> diameter f = fin_diameter f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
diameter f < \<infinity>
[PROOF STEP]
have "\<infinity> \<notin> sp_costs f"
[PROOF STATE]
proof (prove)
using this:
diameter f < \<infinity>

goal (1 subgoal):
 1. \<infinity> \<notin> sp_costs f
[PROOF STEP]
unfolding diameter_def
[PROOF STATE]
proof (prove)
using this:
Sup (sp_costs f) < \<infinity>

goal (1 subgoal):
 1. \<infinity> \<notin> sp_costs f
[PROOF STEP]
using Sup_eq_PInfty
[PROOF STATE]
proof (prove)
using this:
Sup (sp_costs f) < \<infinity>
\<infinity> \<in> ?S \<Longrightarrow> Sup ?S = \<infinity>

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

goal (1 subgoal):
 1. diameter f < \<infinity> \<Longrightarrow> diameter f = fin_diameter f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<infinity> \<notin> sp_costs f
[PROOF STEP]
have "sp_costs f = fin_sp_costs f"
[PROOF STATE]
proof (prove)
using this:
\<infinity> \<notin> sp_costs f

goal (1 subgoal):
 1. sp_costs f = fin_sp_costs f
[PROOF STEP]
unfolding sp_costs_def fin_sp_costs_def
[PROOF STATE]
proof (prove)
using this:
\<infinity> \<notin> {uu_. \<exists>u v c. uu_ = c \<and> u \<in> verts G \<and> v \<in> verts G \<and> \<mu> f u v = c}

goal (1 subgoal):
 1. {uu_. \<exists>u v c. uu_ = c \<and> u \<in> verts G \<and> v \<in> verts G \<and> \<mu> f u v = c} = {uu_. \<exists>u v c. uu_ = c \<and> u \<in> verts G \<and> v \<in> verts G \<and> \<mu> f u v = c \<and> c < \<infinity>}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sp_costs f = fin_sp_costs f

goal (1 subgoal):
 1. diameter f < \<infinity> \<Longrightarrow> diameter f = fin_diameter f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
sp_costs f = fin_sp_costs f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sp_costs f = fin_sp_costs f

goal (1 subgoal):
 1. diameter f = fin_diameter f
[PROOF STEP]
unfolding diameter_def fin_diameter_def
[PROOF STATE]
proof (prove)
using this:
sp_costs f = fin_sp_costs f

goal (1 subgoal):
 1. Sup (sp_costs f) = Sup (fin_sp_costs f)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
diameter f = fin_diameter f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mpoly_to_mpoly_poly_Var:
  "mpoly_to_mpoly_poly x (Var y) = (if x = y then [:0, 1:] else [:Var y:])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mpoly_to_mpoly_poly x (Var y) = (if x = y then [:0, 1:] else [:Var y:])
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mpoly_to_mpoly_poly x (Var y) = (if x = y then [:0, 1:] else [:Var y:])
[PROOF STEP]
have "mpoly_to_mpoly_poly x (Var y) =
          (\<Sum>a. Polynomial.monom (MPoly_Type.monom (remove_key x a) 1) (lookup a x)
             when a = Poly_Mapping.single y 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mpoly_to_mpoly_poly x (Var y) = (\<Sum>a. Polynomial.monom (MPoly_Type.monom (remove_key x a) (1::'b)) (lookup a x) when a = monomial 1 y)
[PROOF STEP]
unfolding mpoly_to_mpoly_poly_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>m. Polynomial.monom (MPoly_Type.monom (remove_key x m) (MPoly_Type.coeff (Var y) m)) (lookup m x)) = (\<Sum>a. Polynomial.monom (MPoly_Type.monom (remove_key x a) (1::'b)) (lookup a x) when a = monomial 1 y)
[PROOF STEP]
by (intro Sum_any.cong) (auto simp: when_def coeff_Var)
[PROOF STATE]
proof (state)
this:
mpoly_to_mpoly_poly x (Var y) = (\<Sum>a. Polynomial.monom (MPoly_Type.monom (remove_key x a) (1::?'b1)) (lookup a x) when a = monomial 1 y)

goal (1 subgoal):
 1. mpoly_to_mpoly_poly x (Var y) = (if x = y then [:0, 1:] else [:Var y:])
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mpoly_to_mpoly_poly x (Var y) = (\<Sum>a. Polynomial.monom (MPoly_Type.monom (remove_key x a) (1::?'b1)) (lookup a x) when a = monomial 1 y)

goal (1 subgoal):
 1. mpoly_to_mpoly_poly x (Var y) = (if x = y then [:0, 1:] else [:Var y:])
[PROOF STEP]
have "\<dots> = (if x = y then [:0, 1:] else [:Var y:])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>a. Polynomial.monom (MPoly_Type.monom (remove_key x a) (1::'b)) (lookup a x) when a = monomial 1 y) = (if x = y then [:0, 1:] else [:Var y:])
[PROOF STEP]
by (auto simp: Polynomial.monom_altdef lookup_single Var_altdef)
[PROOF STATE]
proof (state)
this:
(\<Sum>a. Polynomial.monom (MPoly_Type.monom (remove_key x a) (1::?'b2)) (lookup a x) when a = monomial 1 y) = (if x = y then [:0, 1:] else [:Var y:])

goal (1 subgoal):
 1. mpoly_to_mpoly_poly x (Var y) = (if x = y then [:0, 1:] else [:Var y:])
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
mpoly_to_mpoly_poly x (Var y) = (if x = y then [:0, 1:] else [:Var y:])
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
mpoly_to_mpoly_poly x (Var y) = (if x = y then [:0, 1:] else [:Var y:])

goal (1 subgoal):
 1. mpoly_to_mpoly_poly x (Var y) = (if x = y then [:0, 1:] else [:Var y:])
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
mpoly_to_mpoly_poly x (Var y) = (if x = y then [:0, 1:] else [:Var y:])

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fun_ex: "a \<in> A \<Longrightarrow> b \<in> B \<Longrightarrow> \<exists>f \<in> A
\<rightarrow>\<^sub>E B. f a = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> A; b \<in> B\<rbrakk> \<Longrightarrow> \<exists>f\<in>A \<rightarrow>\<^sub>E B. f a = b
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>a \<in> A; b \<in> B\<rbrakk> \<Longrightarrow> \<exists>f\<in>A \<rightarrow>\<^sub>E B. f a = b
[PROOF STEP]
assume assms: "a \<in> A" "b \<in> B"
[PROOF STATE]
proof (state)
this:
a \<in> A
b \<in> B

goal (1 subgoal):
 1. \<lbrakk>a \<in> A; b \<in> B\<rbrakk> \<Longrightarrow> \<exists>f\<in>A \<rightarrow>\<^sub>E B. f a = b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<in> A
b \<in> B
[PROOF STEP]
obtain g where g_def: "g \<in> A \<rightarrow> B \<and> g a = b"
[PROOF STATE]
proof (prove)
using this:
a \<in> A
b \<in> B

goal (1 subgoal):
 1. (\<And>g. g \<in> A \<rightarrow> B \<and> g a = b \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
g \<in> A \<rightarrow> B \<and> g a = b

goal (1 subgoal):
 1. \<lbrakk>a \<in> A; b \<in> B\<rbrakk> \<Longrightarrow> \<exists>f\<in>A \<rightarrow>\<^sub>E B. f a = b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
g \<in> A \<rightarrow> B \<and> g a = b
[PROOF STEP]
have "restrict g A \<in> A \<rightarrow>\<^sub>E B \<and> (restrict g A) a = b"
[PROOF STATE]
proof (prove)
using this:
g \<in> A \<rightarrow> B \<and> g a = b

goal (1 subgoal):
 1. restrict g A \<in> A \<rightarrow>\<^sub>E B \<and> restrict g A a = b
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
g \<in> A \<rightarrow> B \<and> g a = b
a \<in> A

goal (1 subgoal):
 1. restrict g A \<in> A \<rightarrow>\<^sub>E B \<and> restrict g A a = b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
restrict g A \<in> A \<rightarrow>\<^sub>E B \<and> restrict g A a = b

goal (1 subgoal):
 1. \<lbrakk>a \<in> A; b \<in> B\<rbrakk> \<Longrightarrow> \<exists>f\<in>A \<rightarrow>\<^sub>E B. f a = b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
restrict g A \<in> A \<rightarrow>\<^sub>E B \<and> restrict g A a = b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
restrict g A \<in> A \<rightarrow>\<^sub>E B \<and> restrict g A a = b

goal (1 subgoal):
 1. \<exists>f\<in>A \<rightarrow>\<^sub>E B. f a = b
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>f\<in>A \<rightarrow>\<^sub>E B. f a = b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_divisors_int [simp]:
  fixes i :: int
  assumes "i \<noteq> 0"
  shows "finite {d. d dvd i}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {d. d dvd i}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {d. d dvd i}
[PROOF STEP]
have "{d. \<bar>d\<bar> \<le> \<bar>i\<bar>} = {- \<bar>i\<bar>..\<bar>i\<bar>}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {d. \<bar>d\<bar> \<le> \<bar>i\<bar>} = {- \<bar>i\<bar>..\<bar>i\<bar>}
[PROOF STEP]
by (auto simp: abs_if)
[PROOF STATE]
proof (state)
this:
{d. \<bar>d\<bar> \<le> \<bar>i\<bar>} = {- \<bar>i\<bar>..\<bar>i\<bar>}

goal (1 subgoal):
 1. finite {d. d dvd i}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{d. \<bar>d\<bar> \<le> \<bar>i\<bar>} = {- \<bar>i\<bar>..\<bar>i\<bar>}
[PROOF STEP]
have "finite {d. \<bar>d\<bar> \<le> \<bar>i\<bar>}"
[PROOF STATE]
proof (prove)
using this:
{d. \<bar>d\<bar> \<le> \<bar>i\<bar>} = {- \<bar>i\<bar>..\<bar>i\<bar>}

goal (1 subgoal):
 1. finite {d. \<bar>d\<bar> \<le> \<bar>i\<bar>}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite {d. \<bar>d\<bar> \<le> \<bar>i\<bar>}

goal (1 subgoal):
 1. finite {d. d dvd i}
[PROOF STEP]
from finite_subset [OF _ this]
[PROOF STATE]
proof (chain)
picking this:
?A \<subseteq> {d. \<bar>d\<bar> \<le> \<bar>i\<bar>} \<Longrightarrow> finite ?A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
?A \<subseteq> {d. \<bar>d\<bar> \<le> \<bar>i\<bar>} \<Longrightarrow> finite ?A

goal (1 subgoal):
 1. finite {d. d dvd i}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?A \<subseteq> {d. \<bar>d\<bar> \<le> \<bar>i\<bar>} \<Longrightarrow> finite ?A
i \<noteq> 0

goal (1 subgoal):
 1. finite {d. d dvd i}
[PROOF STEP]
by (simp add: dvd_imp_le_int subset_iff)
[PROOF STATE]
proof (state)
this:
finite {d. d dvd i}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ordertype_UU_ge_\<omega>2:  "ordertype UNIV pair_less \<le> ordertype UU pair_less"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ordertype UNIV pair_less \<le> ordertype UU pair_less
[PROOF STEP]
proof (rule ordertype_inc_le)
[PROOF STATE]
proof (state)
goal (8 subgoals):
 1. small UNIV
 2. small UU
 3. \<And>x y. \<lbrakk>x \<in> UNIV; y \<in> UNIV; (x, y) \<in> pair_less\<rbrakk> \<Longrightarrow> (?\<pi> x, ?\<pi> y) \<in> pair_less
 4. wf pair_less
 5. total pair_less
 6. wf pair_less
 7. trans pair_less
 8. range ?\<pi> \<subseteq> UU
[PROOF STEP]
define \<pi> where "\<pi> \<equiv> \<lambda>(m,n). (m, Suc (m+n))"
[PROOF STATE]
proof (state)
this:
\<pi> \<equiv> \<lambda>(m, n). (m, Suc (m + n))

goal (8 subgoals):
 1. small UNIV
 2. small UU
 3. \<And>x y. \<lbrakk>x \<in> UNIV; y \<in> UNIV; (x, y) \<in> pair_less\<rbrakk> \<Longrightarrow> (?\<pi> x, ?\<pi> y) \<in> pair_less
 4. wf pair_less
 5. total pair_less
 6. wf pair_less
 7. trans pair_less
 8. range ?\<pi> \<subseteq> UU
[PROOF STEP]
show "(\<pi> (x::nat \<times> nat), \<pi> y) \<in> pair_less" if "(x, y) \<in> pair_less" for x y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<pi> x, \<pi> y) \<in> pair_less
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
(x, y) \<in> pair_less

goal (1 subgoal):
 1. (\<pi> x, \<pi> y) \<in> pair_less
[PROOF STEP]
by (auto simp: \<pi>_def pair_less_def split: prod.split)
[PROOF STATE]
proof (state)
this:
(?x, ?y) \<in> pair_less \<Longrightarrow> (\<pi> ?x, \<pi> ?y) \<in> pair_less

goal (7 subgoals):
 1. small UNIV
 2. small UU
 3. wf pair_less
 4. total pair_less
 5. wf pair_less
 6. trans pair_less
 7. range (\<lambda>x. case x of (m, n) \<Rightarrow> (m, Suc (m + n))) \<subseteq> UU
[PROOF STEP]
show "range \<pi> \<subseteq> UU"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. range \<pi> \<subseteq> UU
[PROOF STEP]
by (auto simp: \<pi>_def UU_def)
[PROOF STATE]
proof (state)
this:
range \<pi> \<subseteq> UU

goal (6 subgoals):
 1. small UNIV
 2. small UU
 3. wf pair_less
 4. total pair_less
 5. wf pair_less
 6. trans pair_less
[PROOF STEP]
qed auto


[STATEMENT]
lemma unitary_times_unitary:
  fixes P Q :: "'a:: conjugatable_field mat"
  assumes dim: "P \<in> carrier_mat n n" "Q \<in> carrier_mat n n"
    and uP: "unitary P" and uQ: "unitary Q"
  shows "unitary (P * Q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unitary (P * Q)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. unitary (P * Q)
[PROOF STEP]
have dim_pq: "P * Q \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P * Q \<in> carrier_mat n n
[PROOF STEP]
using dim
[PROOF STATE]
proof (prove)
using this:
P \<in> carrier_mat n n
Q \<in> carrier_mat n n

goal (1 subgoal):
 1. P * Q \<in> carrier_mat n n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
P * Q \<in> carrier_mat n n

goal (1 subgoal):
 1. unitary (P * Q)
[PROOF STEP]
have "(P * Q) * adjoint (P * Q) = P * (Q * adjoint Q) * adjoint P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P * Q * adjoint (P * Q) = P * (Q * adjoint Q) * adjoint P
[PROOF STEP]
using dim
[PROOF STATE]
proof (prove)
using this:
P \<in> carrier_mat n n
Q \<in> carrier_mat n n

goal (1 subgoal):
 1. P * Q * adjoint (P * Q) = P * (Q * adjoint Q) * adjoint P
[PROOF STEP]
by (mat_assoc n)
[PROOF STATE]
proof (state)
this:
P * Q * adjoint (P * Q) = P * (Q * adjoint Q) * adjoint P

goal (1 subgoal):
 1. unitary (P * Q)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
P * Q * adjoint (P * Q) = P * (Q * adjoint Q) * adjoint P

goal (1 subgoal):
 1. unitary (P * Q)
[PROOF STEP]
have "\<dots> = P * (1\<^sub>m n) * adjoint P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P * (Q * adjoint Q) * adjoint P = P * 1\<^sub>m n * adjoint P
[PROOF STEP]
using uQ dim
[PROOF STATE]
proof (prove)
using this:
unitary Q
P \<in> carrier_mat n n
Q \<in> carrier_mat n n

goal (1 subgoal):
 1. P * (Q * adjoint Q) * adjoint P = P * 1\<^sub>m n * adjoint P
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
P * (Q * adjoint Q) * adjoint P = P * 1\<^sub>m n * adjoint P

goal (1 subgoal):
 1. unitary (P * Q)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
P * (Q * adjoint Q) * adjoint P = P * 1\<^sub>m n * adjoint P

goal (1 subgoal):
 1. unitary (P * Q)
[PROOF STEP]
have "\<dots> = P * adjoint P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P * 1\<^sub>m n * adjoint P = P * adjoint P
[PROOF STEP]
using dim
[PROOF STATE]
proof (prove)
using this:
P \<in> carrier_mat n n
Q \<in> carrier_mat n n

goal (1 subgoal):
 1. P * 1\<^sub>m n * adjoint P = P * adjoint P
[PROOF STEP]
by (mat_assoc n)
[PROOF STATE]
proof (state)
this:
P * 1\<^sub>m n * adjoint P = P * adjoint P

goal (1 subgoal):
 1. unitary (P * Q)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
P * 1\<^sub>m n * adjoint P = P * adjoint P

goal (1 subgoal):
 1. unitary (P * Q)
[PROOF STEP]
have "\<dots> = 1\<^sub>m n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P * adjoint P = 1\<^sub>m n
[PROOF STEP]
using uP dim
[PROOF STATE]
proof (prove)
using this:
unitary P
P \<in> carrier_mat n n
Q \<in> carrier_mat n n

goal (1 subgoal):
 1. P * adjoint P = 1\<^sub>m n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
P * adjoint P = 1\<^sub>m n

goal (1 subgoal):
 1. unitary (P * Q)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
P * Q * adjoint (P * Q) = 1\<^sub>m n
[PROOF STEP]
have "(P * Q) * adjoint (P * Q) = 1\<^sub>m n"
[PROOF STATE]
proof (prove)
using this:
P * Q * adjoint (P * Q) = 1\<^sub>m n

goal (1 subgoal):
 1. P * Q * adjoint (P * Q) = 1\<^sub>m n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
P * Q * adjoint (P * Q) = 1\<^sub>m n

goal (1 subgoal):
 1. unitary (P * Q)
[PROOF STEP]
hence "inverts_mat (P * Q) (adjoint (P * Q))"
[PROOF STATE]
proof (prove)
using this:
P * Q * adjoint (P * Q) = 1\<^sub>m n

goal (1 subgoal):
 1. inverts_mat (P * Q) (adjoint (P * Q))
[PROOF STEP]
using inverts_mat_def dim_pq
[PROOF STATE]
proof (prove)
using this:
P * Q * adjoint (P * Q) = 1\<^sub>m n
inverts_mat ?A ?B \<equiv> ?A * ?B = 1\<^sub>m (dim_row ?A)
P * Q \<in> carrier_mat n n

goal (1 subgoal):
 1. inverts_mat (P * Q) (adjoint (P * Q))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inverts_mat (P * Q) (adjoint (P * Q))

goal (1 subgoal):
 1. unitary (P * Q)
[PROOF STEP]
thus "unitary (P*Q)"
[PROOF STATE]
proof (prove)
using this:
inverts_mat (P * Q) (adjoint (P * Q))

goal (1 subgoal):
 1. unitary (P * Q)
[PROOF STEP]
using unitary_def dim_pq
[PROOF STATE]
proof (prove)
using this:
inverts_mat (P * Q) (adjoint (P * Q))
unitary ?A = (?A \<in> carrier_mat (dim_row ?A) (dim_row ?A) \<and> inverts_mat ?A (adjoint ?A))
P * Q \<in> carrier_mat n n

goal (1 subgoal):
 1. unitary (P * Q)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
unitary (P * Q)

goal:
No subgoals!
[PROOF STEP]
qed