[STATEMENT]
lemma obs_singleton_disj:
  "(\<exists>m. obs n (backward_slice S) = {m}) \<or> obs n (backward_slice S) = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>m. obs n (backward_slice S) = {m}) \<or> obs n (backward_slice S) = {}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<exists>m. obs n (backward_slice S) = {m}) \<or> obs n (backward_slice S) = {}
[PROOF STEP]
have "finite(obs n (backward_slice S))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (obs n (backward_slice S))
[PROOF STEP]
by(rule obs_finite)
[PROOF STATE]
proof (state)
this:
finite (obs n (backward_slice S))

goal (1 subgoal):
 1. (\<exists>m. obs n (backward_slice S) = {m}) \<or> obs n (backward_slice S) = {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>m. obs n (backward_slice S) = {m}) \<or> obs n (backward_slice S) = {}
[PROOF STEP]
proof(cases "card(obs n (backward_slice S)) = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. card (obs n (backward_slice S)) = 0 \<Longrightarrow> (\<exists>m. obs n (backward_slice S) = {m}) \<or> obs n (backward_slice S) = {}
 2. card (obs n (backward_slice S)) \<noteq> 0 \<Longrightarrow> (\<exists>m. obs n (backward_slice S) = {m}) \<or> obs n (backward_slice S) = {}
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
card (obs n (backward_slice S)) = 0

goal (2 subgoals):
 1. card (obs n (backward_slice S)) = 0 \<Longrightarrow> (\<exists>m. obs n (backward_slice S) = {m}) \<or> obs n (backward_slice S) = {}
 2. card (obs n (backward_slice S)) \<noteq> 0 \<Longrightarrow> (\<exists>m. obs n (backward_slice S) = {m}) \<or> obs n (backward_slice S) = {}
[PROOF STEP]
with \<open>finite(obs n (backward_slice S))\<close>
[PROOF STATE]
proof (chain)
picking this:
finite (obs n (backward_slice S))
card (obs n (backward_slice S)) = 0
[PROOF STEP]
have "obs n (backward_slice S) = {}"
[PROOF STATE]
proof (prove)
using this:
finite (obs n (backward_slice S))
card (obs n (backward_slice S)) = 0

goal (1 subgoal):
 1. obs n (backward_slice S) = {}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
obs n (backward_slice S) = {}

goal (2 subgoals):
 1. card (obs n (backward_slice S)) = 0 \<Longrightarrow> (\<exists>m. obs n (backward_slice S) = {m}) \<or> obs n (backward_slice S) = {}
 2. card (obs n (backward_slice S)) \<noteq> 0 \<Longrightarrow> (\<exists>m. obs n (backward_slice S) = {m}) \<or> obs n (backward_slice S) = {}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
obs n (backward_slice S) = {}

goal (1 subgoal):
 1. (\<exists>m. obs n (backward_slice S) = {m}) \<or> obs n (backward_slice S) = {}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<exists>m. obs n (backward_slice S) = {m}) \<or> obs n (backward_slice S) = {}

goal (1 subgoal):
 1. card (obs n (backward_slice S)) \<noteq> 0 \<Longrightarrow> (\<exists>m. obs n (backward_slice S) = {m}) \<or> obs n (backward_slice S) = {}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card (obs n (backward_slice S)) \<noteq> 0 \<Longrightarrow> (\<exists>m. obs n (backward_slice S) = {m}) \<or> obs n (backward_slice S) = {}
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
card (obs n (backward_slice S)) \<noteq> 0

goal (1 subgoal):
 1. card (obs n (backward_slice S)) \<noteq> 0 \<Longrightarrow> (\<exists>m. obs n (backward_slice S) = {m}) \<or> obs n (backward_slice S) = {}
[PROOF STEP]
have "card(obs n (backward_slice S)) \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (obs n (backward_slice S)) \<le> 1
[PROOF STEP]
by(rule obs_singleton)
[PROOF STATE]
proof (state)
this:
card (obs n (backward_slice S)) \<le> 1

goal (1 subgoal):
 1. card (obs n (backward_slice S)) \<noteq> 0 \<Longrightarrow> (\<exists>m. obs n (backward_slice S) = {m}) \<or> obs n (backward_slice S) = {}
[PROOF STEP]
with False
[PROOF STATE]
proof (chain)
picking this:
card (obs n (backward_slice S)) \<noteq> 0
card (obs n (backward_slice S)) \<le> 1
[PROOF STEP]
have "card(obs n (backward_slice S)) = 1"
[PROOF STATE]
proof (prove)
using this:
card (obs n (backward_slice S)) \<noteq> 0
card (obs n (backward_slice S)) \<le> 1

goal (1 subgoal):
 1. card (obs n (backward_slice S)) = 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card (obs n (backward_slice S)) = 1

goal (1 subgoal):
 1. card (obs n (backward_slice S)) \<noteq> 0 \<Longrightarrow> (\<exists>m. obs n (backward_slice S) = {m}) \<or> obs n (backward_slice S) = {}
[PROOF STEP]
hence "\<exists>m. obs n (backward_slice S) = {m}"
[PROOF STATE]
proof (prove)
using this:
card (obs n (backward_slice S)) = 1

goal (1 subgoal):
 1. \<exists>m. obs n (backward_slice S) = {m}
[PROOF STEP]
by(fastforce dest:card_eq_SucD)
[PROOF STATE]
proof (state)
this:
\<exists>m. obs n (backward_slice S) = {m}

goal (1 subgoal):
 1. card (obs n (backward_slice S)) \<noteq> 0 \<Longrightarrow> (\<exists>m. obs n (backward_slice S) = {m}) \<or> obs n (backward_slice S) = {}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>m. obs n (backward_slice S) = {m}

goal (1 subgoal):
 1. (\<exists>m. obs n (backward_slice S) = {m}) \<or> obs n (backward_slice S) = {}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<exists>m. obs n (backward_slice S) = {m}) \<or> obs n (backward_slice S) = {}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<exists>m. obs n (backward_slice S) = {m}) \<or> obs n (backward_slice S) = {}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_Label: "finite Label"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite Label
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite Label
[PROOF STEP]
have "Label \<subseteq> {xs. set xs \<subseteq> (UNIV::Proc set) \<and> length xs \<le> Suc f}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Label \<subseteq> {xs. set xs \<subseteq> UNIV \<and> length xs \<le> Suc f}
[PROOF STEP]
by (auto simp: Label_def)
[PROOF STATE]
proof (state)
this:
Label \<subseteq> {xs. set xs \<subseteq> UNIV \<and> length xs \<le> Suc f}

goal (1 subgoal):
 1. finite Label
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Label \<subseteq> {xs. set xs \<subseteq> UNIV \<and> length xs \<le> Suc f}

goal (1 subgoal):
 1. finite Label
[PROOF STEP]
have "finite {xs. set xs \<subseteq> (UNIV::Proc set) \<and> length xs \<le> Suc f}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {xs. set xs \<subseteq> UNIV \<and> length xs \<le> Suc f}
[PROOF STEP]
by (rule finite_lists_length_le) auto
[PROOF STATE]
proof (state)
this:
finite {xs. set xs \<subseteq> UNIV \<and> length xs \<le> Suc f}

goal (1 subgoal):
 1. finite Label
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Label \<subseteq> {xs. set xs \<subseteq> UNIV \<and> length xs \<le> Suc f}
finite {xs. set xs \<subseteq> UNIV \<and> length xs \<le> Suc f}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Label \<subseteq> {xs. set xs \<subseteq> UNIV \<and> length xs \<le> Suc f}
finite {xs. set xs \<subseteq> UNIV \<and> length xs \<le> Suc f}

goal (1 subgoal):
 1. finite Label
[PROOF STEP]
by (auto elim: finite_subset)
[PROOF STATE]
proof (state)
this:
finite Label

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma log2_lm2: "u > 0 \<Longrightarrow> c_in (log2 u) u = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < u \<Longrightarrow> c_in (log2 u) u = 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < u \<Longrightarrow> c_in (log2 u) u = 1
[PROOF STEP]
assume A: "u > 0"
[PROOF STATE]
proof (state)
this:
0 < u

goal (1 subgoal):
 1. 0 < u \<Longrightarrow> c_in (log2 u) u = 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < u
[PROOF STEP]
have S1: "u div 2 ^ (log2 u) = 1"
[PROOF STATE]
proof (prove)
using this:
0 < u

goal (1 subgoal):
 1. u div 2 ^ log2 u = 1
[PROOF STEP]
by (rule log2_lm1)
[PROOF STATE]
proof (state)
this:
u div 2 ^ log2 u = 1

goal (1 subgoal):
 1. 0 < u \<Longrightarrow> c_in (log2 u) u = 1
[PROOF STEP]
have "c_in (log2 u) u = (u div 2 ^ (log2 u)) mod 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c_in (log2 u) u = u div 2 ^ log2 u mod 2
[PROOF STEP]
by (simp add: c_in_def)
[PROOF STATE]
proof (state)
this:
c_in (log2 u) u = u div 2 ^ log2 u mod 2

goal (1 subgoal):
 1. 0 < u \<Longrightarrow> c_in (log2 u) u = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
c_in (log2 u) u = u div 2 ^ log2 u mod 2

goal (1 subgoal):
 1. 0 < u \<Longrightarrow> c_in (log2 u) u = 1
[PROOF STEP]
from S1
[PROOF STATE]
proof (chain)
picking this:
u div 2 ^ log2 u = 1
[PROOF STEP]
have "\<dots> = 1 mod 2"
[PROOF STATE]
proof (prove)
using this:
u div 2 ^ log2 u = 1

goal (1 subgoal):
 1. u div 2 ^ log2 u mod 2 = 1 mod 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
u div 2 ^ log2 u mod 2 = 1 mod 2

goal (1 subgoal):
 1. 0 < u \<Longrightarrow> c_in (log2 u) u = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
u div 2 ^ log2 u mod 2 = 1 mod 2

goal (1 subgoal):
 1. 0 < u \<Longrightarrow> c_in (log2 u) u = 1
[PROOF STEP]
have "\<dots> = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 mod 2 = 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 mod 2 = 1

goal (1 subgoal):
 1. 0 < u \<Longrightarrow> c_in (log2 u) u = 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
c_in (log2 u) u = 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
c_in (log2 u) u = 1

goal (1 subgoal):
 1. c_in (log2 u) u = 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c_in (log2 u) u = 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma content_primitive_part [simp]:
  fixes p :: "'a :: {normalization_semidom_multiplicative, semiring_gcd} poly"
  assumes "p \<noteq> 0"
  shows "content (primitive_part p) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. content (primitive_part p) = (1::'a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. content (primitive_part p) = (1::'a)
[PROOF STEP]
have "p = smult (content p) (primitive_part p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p = smult (content p) (primitive_part p)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
p = smult (content p) (primitive_part p)

goal (1 subgoal):
 1. content (primitive_part p) = (1::'a)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
p = smult (content p) (primitive_part p)

goal (1 subgoal):
 1. content (primitive_part p) = (1::'a)
[PROOF STEP]
have "content \<dots> = content (primitive_part p) * content p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. content (smult (content p) (primitive_part p)) = content (primitive_part p) * content p
[PROOF STEP]
by (simp del: content_times_primitive_part add: ac_simps)
[PROOF STATE]
proof (state)
this:
content (smult (content p) (primitive_part p)) = content (primitive_part p) * content p

goal (1 subgoal):
 1. content (primitive_part p) = (1::'a)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
content p = content (primitive_part p) * content p
[PROOF STEP]
have "1 * content p = content (primitive_part p) * content p"
[PROOF STATE]
proof (prove)
using this:
content p = content (primitive_part p) * content p

goal (1 subgoal):
 1. (1::'a) * content p = content (primitive_part p) * content p
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(1::'a) * content p = content (primitive_part p) * content p

goal (1 subgoal):
 1. content (primitive_part p) = (1::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(1::'a) * content p = content (primitive_part p) * content p
[PROOF STEP]
have "1 * content p div content p = content (primitive_part p) * content p div content p"
[PROOF STATE]
proof (prove)
using this:
(1::'a) * content p = content (primitive_part p) * content p

goal (1 subgoal):
 1. (1::'a) * content p div content p = content (primitive_part p) * content p div content p
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(1::'a) * content p div content p = content (primitive_part p) * content p div content p

goal (1 subgoal):
 1. content (primitive_part p) = (1::'a)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
p \<noteq> 0
(1::'a) * content p div content p = content (primitive_part p) * content p div content p
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0
(1::'a) * content p div content p = content (primitive_part p) * content p div content p

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sup_eq_neg_inf: "sup a b = - inf (- a) (- b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sup a b = - inf (- a) (- b)
[PROOF STEP]
proof (rule sup_unique)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x y. x \<le> - inf (- x) (- y)
 2. \<And>x y. y \<le> - inf (- x) (- y)
 3. \<And>x y z. \<lbrakk>y \<le> x; z \<le> x\<rbrakk> \<Longrightarrow> - inf (- y) (- z) \<le> x
[PROOF STEP]
fix a b c :: 'a
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x y. x \<le> - inf (- x) (- y)
 2. \<And>x y. y \<le> - inf (- x) (- y)
 3. \<And>x y z. \<lbrakk>y \<le> x; z \<le> x\<rbrakk> \<Longrightarrow> - inf (- y) (- z) \<le> x
[PROOF STEP]
show "a \<le> - inf (- a) (- b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<le> - inf (- a) (- b)
[PROOF STEP]
by (rule add_le_imp_le_right [of _ "inf (uminus a) (uminus b)"])
      (simp, simp add: add_inf_distrib_left)
[PROOF STATE]
proof (state)
this:
a \<le> - inf (- a) (- b)

goal (2 subgoals):
 1. \<And>x y. y \<le> - inf (- x) (- y)
 2. \<And>x y z. \<lbrakk>y \<le> x; z \<le> x\<rbrakk> \<Longrightarrow> - inf (- y) (- z) \<le> x
[PROOF STEP]
show "b \<le> - inf (- a) (- b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<le> - inf (- a) (- b)
[PROOF STEP]
by (rule add_le_imp_le_right [of _ "inf (uminus a) (uminus b)"])
      (simp, simp add: add_inf_distrib_left)
[PROOF STATE]
proof (state)
this:
b \<le> - inf (- a) (- b)

goal (1 subgoal):
 1. \<And>x y z. \<lbrakk>y \<le> x; z \<le> x\<rbrakk> \<Longrightarrow> - inf (- y) (- z) \<le> x
[PROOF STEP]
show "- inf (- a) (- b) \<le> c" if "a \<le> c" "b \<le> c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - inf (- a) (- b) \<le> c
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
a \<le> c
b \<le> c

goal (1 subgoal):
 1. - inf (- a) (- b) \<le> c
[PROOF STEP]
by (subst neg_le_iff_le [symmetric]) (simp add: le_infI)
[PROOF STATE]
proof (state)
this:
\<lbrakk>a \<le> c; b \<le> c\<rbrakk> \<Longrightarrow> - inf (- a) (- b) \<le> c

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma closed_sum_assoc:
  fixes A B C::"'a::real_normed_vector set"
  shows \<open>A +\<^sub>M (B +\<^sub>M C) = (A +\<^sub>M B) +\<^sub>M C\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A +\<^sub>M (B +\<^sub>M C) = A +\<^sub>M B +\<^sub>M C
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A +\<^sub>M (B +\<^sub>M C) = A +\<^sub>M B +\<^sub>M C
[PROOF STEP]
have \<open>A + closure B \<subseteq> closure (A + B)\<close> for A B :: "'a set"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A + closure B \<subseteq> closure (A + B)
[PROOF STEP]
by (meson closure_subset closure_sum dual_order.trans order_refl set_plus_mono2)
[PROOF STATE]
proof (state)
this:
?A + closure ?B \<subseteq> closure (?A + ?B)

goal (1 subgoal):
 1. A +\<^sub>M (B +\<^sub>M C) = A +\<^sub>M B +\<^sub>M C
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?A + closure ?B \<subseteq> closure (?A + ?B)
[PROOF STEP]
have \<open>A +\<^sub>M (B +\<^sub>M C) = closure (A + (B + C))\<close>
[PROOF STATE]
proof (prove)
using this:
?A + closure ?B \<subseteq> closure (?A + ?B)

goal (1 subgoal):
 1. A +\<^sub>M (B +\<^sub>M C) = closure (A + (B + C))
[PROOF STEP]
unfolding closed_sum_def
[PROOF STATE]
proof (prove)
using this:
?A + closure ?B \<subseteq> closure (?A + ?B)

goal (1 subgoal):
 1. closure (A + closure (B + C)) = closure (A + (B + C))
[PROOF STEP]
by (meson antisym_conv closed_closure closure_minimal closure_mono closure_subset equalityD1 set_plus_mono2)
[PROOF STATE]
proof (state)
this:
A +\<^sub>M (B +\<^sub>M C) = closure (A + (B + C))

goal (1 subgoal):
 1. A +\<^sub>M (B +\<^sub>M C) = A +\<^sub>M B +\<^sub>M C
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
A +\<^sub>M (B +\<^sub>M C) = closure (A + (B + C))

goal (1 subgoal):
 1. A +\<^sub>M (B +\<^sub>M C) = A +\<^sub>M B +\<^sub>M C
[PROOF STEP]
have \<open>closure A + B \<subseteq> closure (A + B)\<close> for A B :: "'a set"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure A + B \<subseteq> closure (A + B)
[PROOF STEP]
by (meson closure_subset closure_sum dual_order.trans order_refl set_plus_mono2)
[PROOF STATE]
proof (state)
this:
closure ?A + ?B \<subseteq> closure (?A + ?B)

goal (1 subgoal):
 1. A +\<^sub>M (B +\<^sub>M C) = A +\<^sub>M B +\<^sub>M C
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
closure ?A + ?B \<subseteq> closure (?A + ?B)
[PROOF STEP]
have \<open>(A +\<^sub>M B) +\<^sub>M C = closure ((A + B) + C)\<close>
[PROOF STATE]
proof (prove)
using this:
closure ?A + ?B \<subseteq> closure (?A + ?B)

goal (1 subgoal):
 1. A +\<^sub>M B +\<^sub>M C = closure (A + B + C)
[PROOF STEP]
unfolding closed_sum_def
[PROOF STATE]
proof (prove)
using this:
closure ?A + ?B \<subseteq> closure (?A + ?B)

goal (1 subgoal):
 1. closure (closure (A + B) + C) = closure (A + B + C)
[PROOF STEP]
by (meson closed_closure closure_minimal closure_mono closure_subset eq_iff set_plus_mono2)
[PROOF STATE]
proof (state)
this:
A +\<^sub>M B +\<^sub>M C = closure (A + B + C)

goal (1 subgoal):
 1. A +\<^sub>M (B +\<^sub>M C) = A +\<^sub>M B +\<^sub>M C
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
A +\<^sub>M (B +\<^sub>M C) = closure (A + (B + C))
A +\<^sub>M B +\<^sub>M C = closure (A + B + C)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
A +\<^sub>M (B +\<^sub>M C) = closure (A + (B + C))
A +\<^sub>M B +\<^sub>M C = closure (A + B + C)

goal (1 subgoal):
 1. A +\<^sub>M (B +\<^sub>M C) = A +\<^sub>M B +\<^sub>M C
[PROOF STEP]
by (simp add: ab_semigroup_add_class.add_ac(1))
[PROOF STATE]
proof (state)
this:
A +\<^sub>M (B +\<^sub>M C) = A +\<^sub>M B +\<^sub>M C

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Ln_of_real:
  assumes "0 < z"
    shows "ln(of_real z::complex) = of_real(ln z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ln (complex_of_real z) = complex_of_real (ln z)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ln (complex_of_real z) = complex_of_real (ln z)
[PROOF STEP]
have "ln(of_real (exp (ln z))::complex) = ln (exp (of_real (ln z)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ln (complex_of_real (exp (ln z))) = ln (exp (complex_of_real (ln z)))
[PROOF STEP]
by (simp add: exp_of_real)
[PROOF STATE]
proof (state)
this:
ln (complex_of_real (exp (ln z))) = ln (exp (complex_of_real (ln z)))

goal (1 subgoal):
 1. ln (complex_of_real z) = complex_of_real (ln z)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ln (complex_of_real (exp (ln z))) = ln (exp (complex_of_real (ln z)))

goal (1 subgoal):
 1. ln (complex_of_real z) = complex_of_real (ln z)
[PROOF STEP]
have "\<dots> = of_real(ln z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ln (exp (complex_of_real (ln z))) = complex_of_real (ln z)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < z

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

goal (1 subgoal):
 1. ln (complex_of_real z) = complex_of_real (ln z)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
ln (complex_of_real (exp (ln z))) = complex_of_real (ln z)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ln (complex_of_real (exp (ln z))) = complex_of_real (ln z)

goal (1 subgoal):
 1. ln (complex_of_real z) = complex_of_real (ln z)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
ln (complex_of_real (exp (ln z))) = complex_of_real (ln z)
0 < z

goal (1 subgoal):
 1. ln (complex_of_real z) = complex_of_real (ln z)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ln (complex_of_real z) = complex_of_real (ln z)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma univalent_composes[intro]:assumes "univalent R" "univalent S"
 shows "univalent (R O S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. univalent (R O S)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
univalent R
univalent S

goal (1 subgoal):
 1. univalent (R O S)
[PROOF STEP]
unfolding univalent_char
[PROOF STATE]
proof (prove)
using this:
R\<inverse> O R \<subseteq> Id
S\<inverse> O S \<subseteq> Id

goal (1 subgoal):
 1. (R O S)\<inverse> O R O S \<subseteq> Id
[PROOF STEP]
by auto


[STATEMENT]
lemma local_lipschitz_sq_mtx_affine:
  fixes A :: "real \<Rightarrow> ('n::finite) sq_mtx"
  assumes "continuous_on T A" "open T" "open S"
  shows "local_lipschitz T S (\<lambda>t s. A t *\<^sub>V s + B t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local_lipschitz T S (\<lambda>t s. A t *\<^sub>V s + B t)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. local_lipschitz T S (\<lambda>t s. A t *\<^sub>V s + B t)
[PROOF STEP]
have obs: "\<And>\<tau> \<epsilon>. 0 < \<epsilon> \<Longrightarrow>  \<tau> \<in> T \<Longrightarrow> cball \<tau> \<epsilon> \<subseteq> T \<Longrightarrow> bdd_above {\<parallel>A t\<parallel> |t. t \<in> cball \<tau> \<epsilon>}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>\<tau> \<epsilon>. \<lbrakk>0 < \<epsilon>; \<tau> \<in> T; cball \<tau> \<epsilon> \<subseteq> T\<rbrakk> \<Longrightarrow> bdd_above {\<parallel>A t\<parallel> |t. t \<in> cball \<tau> \<epsilon>}
[PROOF STEP]
by (rule bdd_above_norm_cont_comp, rule continuous_on_subset[OF assms(1)], simp_all)
[PROOF STATE]
proof (state)
this:
\<lbrakk>0 < ?\<epsilon>; ?\<tau> \<in> T; cball ?\<tau> ?\<epsilon> \<subseteq> T\<rbrakk> \<Longrightarrow> bdd_above {\<parallel>A t\<parallel> |t. t \<in> cball ?\<tau> ?\<epsilon>}

goal (1 subgoal):
 1. local_lipschitz T S (\<lambda>t s. A t *\<^sub>V s + B t)
[PROOF STEP]
hence "\<And>\<tau> \<epsilon>. 0 < \<epsilon> \<Longrightarrow> \<tau> \<in> T \<Longrightarrow> cball \<tau> \<epsilon> \<subseteq> T \<Longrightarrow> bdd_above {\<parallel>to_vec (A t)\<parallel>\<^sub>o\<^sub>p |t. t \<in> cball \<tau> \<epsilon>}"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < ?\<epsilon>; ?\<tau> \<in> T; cball ?\<tau> ?\<epsilon> \<subseteq> T\<rbrakk> \<Longrightarrow> bdd_above {\<parallel>A t\<parallel> |t. t \<in> cball ?\<tau> ?\<epsilon>}

goal (1 subgoal):
 1. \<And>\<tau> \<epsilon>. \<lbrakk>0 < \<epsilon>; \<tau> \<in> T; cball \<tau> \<epsilon> \<subseteq> T\<rbrakk> \<Longrightarrow> bdd_above {\<parallel>to_vec (A t)\<parallel>\<^sub>o\<^sub>p |t. t \<in> cball \<tau> \<epsilon>}
[PROOF STEP]
by (simp add: norm_sq_mtx_def)
[PROOF STATE]
proof (state)
this:
\<lbrakk>0 < ?\<epsilon>; ?\<tau> \<in> T; cball ?\<tau> ?\<epsilon> \<subseteq> T\<rbrakk> \<Longrightarrow> bdd_above {\<parallel>to_vec (A t)\<parallel>\<^sub>o\<^sub>p |t. t \<in> cball ?\<tau> ?\<epsilon>}

goal (1 subgoal):
 1. local_lipschitz T S (\<lambda>t s. A t *\<^sub>V s + B t)
[PROOF STEP]
hence "local_lipschitz T S (\<lambda>t s. to_vec (A t) *v s + B t)"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < ?\<epsilon>; ?\<tau> \<in> T; cball ?\<tau> ?\<epsilon> \<subseteq> T\<rbrakk> \<Longrightarrow> bdd_above {\<parallel>to_vec (A t)\<parallel>\<^sub>o\<^sub>p |t. t \<in> cball ?\<tau> ?\<epsilon>}

goal (1 subgoal):
 1. local_lipschitz T S (\<lambda>t s. to_vec (A t) *v s + B t)
[PROOF STEP]
using local_lipschitz_affine[OF assms(2,3), of "\<lambda>t. to_vec (A t)"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < ?\<epsilon>; ?\<tau> \<in> T; cball ?\<tau> ?\<epsilon> \<subseteq> T\<rbrakk> \<Longrightarrow> bdd_above {\<parallel>to_vec (A t)\<parallel>\<^sub>o\<^sub>p |t. t \<in> cball ?\<tau> ?\<epsilon>}
(\<And>\<tau> \<epsilon>. \<lbrakk>0 < \<epsilon>; \<tau> \<in> T; cball \<tau> \<epsilon> \<subseteq> T\<rbrakk> \<Longrightarrow> bdd_above {\<parallel>to_vec (A t)\<parallel>\<^sub>o\<^sub>p |t. t \<in> cball \<tau> \<epsilon>}) \<Longrightarrow> local_lipschitz T S (\<lambda>t s. to_vec (A t) *v s + ?B t)

goal (1 subgoal):
 1. local_lipschitz T S (\<lambda>t s. to_vec (A t) *v s + B t)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
local_lipschitz T S (\<lambda>t s. to_vec (A t) *v s + B t)

goal (1 subgoal):
 1. local_lipschitz T S (\<lambda>t s. A t *\<^sub>V s + B t)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
local_lipschitz T S (\<lambda>t s. to_vec (A t) *v s + B t)

goal (1 subgoal):
 1. local_lipschitz T S (\<lambda>t s. A t *\<^sub>V s + B t)
[PROOF STEP]
by transfer
[PROOF STATE]
proof (state)
this:
local_lipschitz T S (\<lambda>t s. A t *\<^sub>V s + B t)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma find_index_eqI:
  assumes "i\<le>length xs"
  assumes "\<forall>j<i. \<not>P (xs!j)"
  assumes "i<length xs \<Longrightarrow> P (xs!i)"
  shows "find_index P xs = i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. find_index P xs = i
[PROOF STEP]
by (metis (mono_tags, lifting) antisym_conv2 assms find_index_eq_size_conv
  find_index_first find_index_less_size_conv linorder_neqE_nat nth_find_index)


[STATEMENT]
lemma dirichlet_prod_inversion_completely_multiplicative:
  fixes a :: "nat \<Rightarrow> 'a :: comm_ring_1"
  assumes "completely_multiplicative_function a"
  shows   "(\<forall>x\<ge>1. g x = dirichlet_prod' a f x) \<longleftrightarrow>
             (\<forall>x\<ge>1. f x = dirichlet_prod' (\<lambda>n. moebius_mu n * a n) g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x\<ge>1. g x = dirichlet_prod' a f x) = (\<forall>x\<ge>1. f x = dirichlet_prod' (\<lambda>n. moebius_mu n * a n) g x)
[PROOF STEP]
by (intro dirichlet_prod'_inversion ext completely_multiplicative_imp_moebius_mu_inverse assms)


[STATEMENT]
lemma totient_0 [simp]: "totient 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. totient 0 = 0
[PROOF STEP]
by (simp add: totient_def)


[STATEMENT]
lemma carrier_eq [simp]: "carrier R = {0..<n}"
  and mult_eq [simp]: "x \<otimes>\<^bsub>R\<^esub> y = (x * y) mod n"
  and add_eq [simp]: "x \<oplus>\<^bsub>R\<^esub> y = (x + y) mod n"
  and one_eq [simp]: "\<one>\<^bsub>R\<^esub> = 1"
  and zero_eq [simp]: "\<zero>\<^bsub>R\<^esub> = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (carrier R = {0..<n} &&& x \<otimes>\<^bsub>R\<^esub> y = x * y mod n) &&& x \<oplus>\<^bsub>R\<^esub> y = (x + y) mod n &&& \<one>\<^bsub>R\<^esub> = 1 &&& \<zero>\<^bsub>R\<^esub> = 0
[PROOF STEP]
by (simp_all add: Residues_nat_def R_def)


[STATEMENT]
lemma matrix_scaleR_left: "(a::'a::real_algebra_1^'n^'m) ** r *\<^sub>R b = r *\<^sub>R (a ** b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a ** r *\<^sub>R b = r *\<^sub>R (a ** b)
[PROOF STEP]
by (vector matrix_matrix_mult_def algebra_simps scaleR_sum_right)


[STATEMENT]
theorem sum_characters:
  assumes x: "x \<in> carrier G"
  shows   "(\<Sum>\<chi>\<in>characters G. \<chi> x) = (if x = \<one> then of_nat (order G) else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<chi>\<in>characters G. \<chi> x) = (if x = \<one> then of_nat (order G) else 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>\<chi>\<in>characters G. \<chi> x) = (if x = \<one> then of_nat (order G) else 0)
[PROOF STEP]
interpret G': finite_comm_group "Characters G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_comm_group (Characters G)
[PROOF STEP]
by (rule finite_comm_group_Characters)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>\<chi>\<in>characters G. \<chi> x) = (if x = \<one> then of_nat (order G) else 0)
[PROOF STEP]
interpret x: character "Characters G" "double_dual_iso x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. character (Characters G) (double_dual_iso x)
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier G

goal (1 subgoal):
 1. character (Characters G) (double_dual_iso x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>\<chi>\<in>characters G. \<chi> x) = (if x = \<one> then of_nat (order G) else 0)
[PROOF STEP]
from x.sum_character
[PROOF STATE]
proof (chain)
picking this:
sum (double_dual_iso x) (carrier (Characters G)) = (if double_dual_iso x = principal_char (Characters G) then of_nat (order (Characters G)) else 0)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sum (double_dual_iso x) (carrier (Characters G)) = (if double_dual_iso x = principal_char (Characters G) then of_nat (order (Characters G)) else 0)

goal (1 subgoal):
 1. (\<Sum>\<chi>\<in>characters G. \<chi> x) = (if x = \<one> then of_nat (order G) else 0)
[PROOF STEP]
using double_dual_iso_eq_iff[of x \<one>] x
[PROOF STATE]
proof (prove)
using this:
sum (double_dual_iso x) (carrier (Characters G)) = (if double_dual_iso x = principal_char (Characters G) then of_nat (order (Characters G)) else 0)
\<lbrakk>x \<in> carrier G; \<one> \<in> carrier G\<rbrakk> \<Longrightarrow> (double_dual_iso x = double_dual_iso \<one>) = (x = \<one>)
x \<in> carrier G

goal (1 subgoal):
 1. (\<Sum>\<chi>\<in>characters G. \<chi> x) = (if x = \<one> then of_nat (order G) else 0)
[PROOF STEP]
by (auto simp: characters_def carrier_Characters order_Characters simp del: double_dual_iso_eq_iff)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<chi>\<in>characters G. \<chi> x) = (if x = \<one> then of_nat (order G) else 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma one_less_int_card: "1 < int CARD('a::card2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < int CARD('a)
[PROOF STEP]
using one_less_card [where 'a='a]
[PROOF STATE]
proof (prove)
using this:
Suc 0 < CARD('a)

goal (1 subgoal):
 1. 1 < int CARD('a)
[PROOF STEP]
by simp


[STATEMENT]
lemma find_index_append: "find_index P (xs @ ys) =
  (if \<exists>x\<in>set xs. P x then find_index P xs else size xs + find_index P ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. find_index P (xs @ ys) = (if \<exists>x\<in>set xs. P x then find_index P xs else length xs + find_index P ys)
[PROOF STEP]
by (induct xs) simp_all


[STATEMENT]
lemma last_append [simp]: "last (p, xs @ ys) = last (last (p, xs), ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Dioid_Models.last (p, xs @ ys) = Dioid_Models.last (Dioid_Models.last (p, xs), ys)
[PROOF STEP]
proof (cases xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. xs = [] \<Longrightarrow> Dioid_Models.last (p, xs @ ys) = Dioid_Models.last (Dioid_Models.last (p, xs), ys)
 2. \<And>a list. xs = a # list \<Longrightarrow> Dioid_Models.last (p, xs @ ys) = Dioid_Models.last (Dioid_Models.last (p, xs), ys)
[PROOF STEP]
show "xs = [] \<Longrightarrow> last (p, xs @ ys) = last (last (p, xs), ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs = [] \<Longrightarrow> Dioid_Models.last (p, xs @ ys) = Dioid_Models.last (Dioid_Models.last (p, xs), ys)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
xs = [] \<Longrightarrow> Dioid_Models.last (p, xs @ ys) = Dioid_Models.last (Dioid_Models.last (p, xs), ys)

goal (1 subgoal):
 1. \<And>a list. xs = a # list \<Longrightarrow> Dioid_Models.last (p, xs @ ys) = Dioid_Models.last (Dioid_Models.last (p, xs), ys)
[PROOF STEP]
show "\<And>a list. xs = a # list \<Longrightarrow>
    last (p, xs @ ys) = last (last (p, xs), ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a list. xs = a # list \<Longrightarrow> Dioid_Models.last (p, xs @ ys) = Dioid_Models.last (Dioid_Models.last (p, xs), ys)
[PROOF STEP]
proof (cases ys)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a list. \<lbrakk>xs = a # list; ys = []\<rbrakk> \<Longrightarrow> Dioid_Models.last (p, xs @ ys) = Dioid_Models.last (Dioid_Models.last (p, xs), ys)
 2. \<And>a list aa lista. \<lbrakk>xs = a # list; ys = aa # lista\<rbrakk> \<Longrightarrow> Dioid_Models.last (p, xs @ ys) = Dioid_Models.last (Dioid_Models.last (p, xs), ys)
[PROOF STEP]
show "\<And>a list. \<lbrakk>xs = a # list; ys = []\<rbrakk>
      \<Longrightarrow> last (p, xs @ ys) = last (last (p, xs), ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a list. \<lbrakk>xs = a # list; ys = []\<rbrakk> \<Longrightarrow> Dioid_Models.last (p, xs @ ys) = Dioid_Models.last (Dioid_Models.last (p, xs), ys)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<lbrakk>xs = ?a # ?list; ys = []\<rbrakk> \<Longrightarrow> Dioid_Models.last (p, xs @ ys) = Dioid_Models.last (Dioid_Models.last (p, xs), ys)

goal (1 subgoal):
 1. \<And>a list aa lista. \<lbrakk>xs = a # list; ys = aa # lista\<rbrakk> \<Longrightarrow> Dioid_Models.last (p, xs @ ys) = Dioid_Models.last (Dioid_Models.last (p, xs), ys)
[PROOF STEP]
show "\<And>a list aa lista. \<lbrakk>xs = a # list; ys = aa # lista\<rbrakk>
      \<Longrightarrow> last (p, xs @ ys) = last (last (p, xs), ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a list aa lista. \<lbrakk>xs = a # list; ys = aa # lista\<rbrakk> \<Longrightarrow> Dioid_Models.last (p, xs @ ys) = Dioid_Models.last (Dioid_Models.last (p, xs), ys)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<lbrakk>xs = ?a # ?list; ys = ?aa # ?lista\<rbrakk> \<Longrightarrow> Dioid_Models.last (p, xs @ ys) = Dioid_Models.last (Dioid_Models.last (p, xs), ys)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
xs = ?a # ?list \<Longrightarrow> Dioid_Models.last (p, xs @ ys) = Dioid_Models.last (Dioid_Models.last (p, xs), ys)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma smult_pos_vec[simp]: fixes l :: "'a :: linordered_ring_strict"
  assumes l: "l > 0"
  shows "(l \<cdot>\<^sub>v v \<le> 0\<^sub>v n) = (v \<le> 0\<^sub>v n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (l \<cdot>\<^sub>v v \<le> 0\<^sub>v n) = (v \<le> 0\<^sub>v n)
[PROOF STEP]
proof (cases "dim_vec v = n")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. dim_vec v = n \<Longrightarrow> (l \<cdot>\<^sub>v v \<le> 0\<^sub>v n) = (v \<le> 0\<^sub>v n)
 2. dim_vec v \<noteq> n \<Longrightarrow> (l \<cdot>\<^sub>v v \<le> 0\<^sub>v n) = (v \<le> 0\<^sub>v n)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
dim_vec v = n

goal (2 subgoals):
 1. dim_vec v = n \<Longrightarrow> (l \<cdot>\<^sub>v v \<le> 0\<^sub>v n) = (v \<le> 0\<^sub>v n)
 2. dim_vec v \<noteq> n \<Longrightarrow> (l \<cdot>\<^sub>v v \<le> 0\<^sub>v n) = (v \<le> 0\<^sub>v n)
[PROOF STEP]
have "i < n \<Longrightarrow> ((l \<cdot>\<^sub>v v) $ i \<le> 0) \<longleftrightarrow> v $ i \<le> 0" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < n \<Longrightarrow> ((l \<cdot>\<^sub>v v) $ i \<le> (0::'a)) = (v $ i \<le> (0::'a))
[PROOF STEP]
using True
      mult_le_cancel_left_pos[OF l, of _ 0]
[PROOF STATE]
proof (prove)
using this:
dim_vec v = n
(l * ?a \<le> l * (0::'a)) = (?a \<le> (0::'a))

goal (1 subgoal):
 1. i < n \<Longrightarrow> ((l \<cdot>\<^sub>v v) $ i \<le> (0::'a)) = (v $ i \<le> (0::'a))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
?i < n \<Longrightarrow> ((l \<cdot>\<^sub>v v) $ ?i \<le> (0::'a)) = (v $ ?i \<le> (0::'a))

goal (2 subgoals):
 1. dim_vec v = n \<Longrightarrow> (l \<cdot>\<^sub>v v \<le> 0\<^sub>v n) = (v \<le> 0\<^sub>v n)
 2. dim_vec v \<noteq> n \<Longrightarrow> (l \<cdot>\<^sub>v v \<le> 0\<^sub>v n) = (v \<le> 0\<^sub>v n)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
?i < n \<Longrightarrow> ((l \<cdot>\<^sub>v v) $ ?i \<le> (0::'a)) = (v $ ?i \<le> (0::'a))

goal (1 subgoal):
 1. (l \<cdot>\<^sub>v v \<le> 0\<^sub>v n) = (v \<le> 0\<^sub>v n)
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
?i < n \<Longrightarrow> ((l \<cdot>\<^sub>v v) $ ?i \<le> (0::'a)) = (v $ ?i \<le> (0::'a))
dim_vec v = n

goal (1 subgoal):
 1. (l \<cdot>\<^sub>v v \<le> 0\<^sub>v n) = (v \<le> 0\<^sub>v n)
[PROOF STEP]
unfolding less_eq_vec_def
[PROOF STATE]
proof (prove)
using this:
?i < n \<Longrightarrow> ((l \<cdot>\<^sub>v v) $ ?i \<le> (0::'a)) = (v $ ?i \<le> (0::'a))
dim_vec v = n

goal (1 subgoal):
 1. (dim_vec (l \<cdot>\<^sub>v v) = dim_vec (0\<^sub>v n) \<and> (\<forall>i<dim_vec (0\<^sub>v n). (l \<cdot>\<^sub>v v) $ i \<le> 0\<^sub>v n $ i)) = (dim_vec v = dim_vec (0\<^sub>v n) \<and> (\<forall>i<dim_vec (0\<^sub>v n). v $ i \<le> 0\<^sub>v n $ i))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(l \<cdot>\<^sub>v v \<le> 0\<^sub>v n) = (v \<le> 0\<^sub>v n)

goal (1 subgoal):
 1. dim_vec v \<noteq> n \<Longrightarrow> (l \<cdot>\<^sub>v v \<le> 0\<^sub>v n) = (v \<le> 0\<^sub>v n)
[PROOF STEP]
qed (auto simp: less_eq_vec_def)


[STATEMENT]
theorem LT20: "\<turnstile> (A \<leadsto> (B \<or> D)) \<longrightarrow> (B \<leadsto> D) \<longrightarrow> (A \<leadsto> D)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<turnstile> (A \<leadsto> B \<or> D) \<longrightarrow> (B \<leadsto> D) \<longrightarrow> A \<leadsto> D
[PROOF STEP]
using LT18[of "A" "B" "D" "D"] LT1[of "D"]
[PROOF STATE]
proof (prove)
using this:
\<turnstile> (A \<leadsto> B \<or> D) \<longrightarrow> (B \<leadsto> D) \<longrightarrow> (D \<leadsto> D) \<longrightarrow> A \<leadsto> D
\<turnstile> D \<leadsto> D

goal (1 subgoal):
 1. \<turnstile> (A \<leadsto> B \<or> D) \<longrightarrow> (B \<leadsto> D) \<longrightarrow> A \<leadsto> D
[PROOF STEP]
by force


[STATEMENT]
lemma landau_nat_ceil:
  assumes "(\<lambda>_. 1) \<in> O[F'](g)"
  assumes "f \<in> O[F'](g)"
  shows "(\<lambda>x. real (nat \<lceil>f x\<rceil>)) \<in> O[F'](g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. real (nat \<lceil>f x\<rceil>)) \<in> O[F'](g)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(\<lambda>_. 1) \<in> O[F'](g)
f \<in> O[F'](g)

goal (1 subgoal):
 1. (\<lambda>x. real (nat \<lceil>f x\<rceil>)) \<in> O[F'](g)
[PROOF STEP]
by (intro landau_real_nat landau_ceil, auto)


[STATEMENT]
lemma mat_default_gt_mat0: assumes sd_pos: "sd > 0" and sd_n: "sd \<le> n"
  shows "mat_gt (\<succ>) sd (default\<^sub>m default n) (0\<^sub>m n n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_gt (\<succ>) sd (default\<^sub>m default n) (0\<^sub>m n n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mat_gt (\<succ>) sd (default\<^sub>m default n) (0\<^sub>m n n)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
0 < sd
sd \<le> n
[PROOF STEP]
have n: "n > 0"
[PROOF STATE]
proof (prove)
using this:
0 < sd
sd \<le> n

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

goal (1 subgoal):
 1. mat_gt (\<succ>) sd (default\<^sub>m default n) (0\<^sub>m n n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_gt (\<succ>) sd (default\<^sub>m default n) (0\<^sub>m n n)
[PROOF STEP]
by (intro mat_gtI[OF mat_default_ge_0 sd_pos sd_pos], insert sd_pos sd_n, auto simp: mat_default_def default_gt_zero)
[PROOF STATE]
proof (state)
this:
mat_gt (\<succ>) sd (default\<^sub>m default n) (0\<^sub>m n n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma t1_space_closedin_finite:
   "t1_space X \<longleftrightarrow> (\<forall>S. finite S \<and> S \<subseteq> topspace X \<longrightarrow> closedin X S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t1_space X = (\<forall>S. finite S \<and> S \<subseteq> topspace X \<longrightarrow> closedin X S)
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. t1_space X \<Longrightarrow> \<forall>S. finite S \<and> S \<subseteq> topspace X \<longrightarrow> closedin X S
 2. \<forall>S. finite S \<and> S \<subseteq> topspace X \<longrightarrow> closedin X S \<Longrightarrow> t1_space X
[PROOF STEP]
apply (simp add: closedin_contains_derived_set t1_space_derived_set_of_finite)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>S. finite S \<and> S \<subseteq> topspace X \<longrightarrow> closedin X S \<Longrightarrow> t1_space X
[PROOF STEP]
by (simp add: t1_space_closedin_singleton)


[STATEMENT]
lemma snd_Inf: "snd (Inf A) = (INF x\<in>A. snd x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (Inf A) = Inf (snd ` A)
[PROOF STEP]
by (simp add: Inf_prod_def)


[STATEMENT]
lemma Scons_UN1_x: "Scons (UN x. f x) M = (UN x. Scons (f x) M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Scons (\<Union> (range f)) M = (\<Union>x. Scons (f x) M)
[PROOF STEP]
by (simp add: Scons_def, blast)


[STATEMENT]
lemma insert_fset_left_idem:
  shows "insert_fset x (insert_fset x S) = insert_fset x S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insert_fset x (insert_fset x S) = insert_fset x S
[PROOF STEP]
by (descending) (auto)


[STATEMENT]
lemma snd_sum_list: "snd (sum_list xs) = sum_list (map snd xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (sum_list xs) = sum_list (map snd xs)
[PROOF STEP]
by (induct xs) auto


[STATEMENT]
lemma ack_1 [simp]: "ack (Suc 0) j = j + 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ack (Suc 0) j = j + 2
[PROOF STEP]
by (induct j) simp_all


[STATEMENT]
lemma fetch_left_moving_b:
  "(fetch (mopup_a n @ shift mopup_b (2 * n)) (2 * n + 5) Bk)
  = (L, 2*n + 5)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fetch (mopup_a n @ shift mopup_b (2 * n)) (2 * n + 5) Bk = (L, 2 * n + 5)
[PROOF STEP]
apply(subgoal_tac "length (mopup_a n) = 4 * n")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. length (mopup_a n) = 4 * n \<Longrightarrow> fetch (mopup_a n @ shift mopup_b (2 * n)) (2 * n + 5) Bk = (L, 2 * n + 5)
 2. length (mopup_a n) = 4 * n
[PROOF STEP]
apply(subgoal_tac "2*n + 5 = Suc (2*n + 4)", simp only: fetch.simps)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>length (mopup_a n) = 4 * n; 2 * n + 5 = Suc (2 * n + 4)\<rbrakk> \<Longrightarrow> (case nth_of (mopup_a n @ shift mopup_b (2 * n)) (2 * (2 * n + 4)) of None \<Rightarrow> (Nop, 0) | Some i \<Rightarrow> i) = (L, Suc (2 * n + 4))
 2. length (mopup_a n) = 4 * n \<Longrightarrow> 2 * n + 5 = Suc (2 * n + 4)
 3. length (mopup_a n) = 4 * n
[PROOF STEP]
apply(auto simp: mopup_b_def nth_append shift.simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma all_edges_betw_sigma_neighbor:
"uwellformed G \<Longrightarrow> all_edges_between X Y G = (SIGMA x:X. neighbors_ss x Y G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uwellformed G \<Longrightarrow> all_edges_between X Y G = (SIGMA x:X. neighbors_ss x Y G)
[PROOF STEP]
by (auto simp add: all_edges_between_def neighbors_ss_def neighbor_in_graph_def
      uwellformed_alt_fst uwellformed_alt_snd)


[STATEMENT]
lemma bouncing_ball_flow: "g < 0 \<Longrightarrow> h \<ge> 0 \<Longrightarrow>
  {s. s$1 = h \<and> s$2 = 0} \<le> fb\<^sub>\<F>
  (LOOP (
    (x\<acute>=(\<lambda>t. f g) & (\<lambda> s. s$1 \<ge> 0) on (\<lambda>s. UNIV) UNIV @ 0) ;
    (IF (\<lambda> s. s$1 = 0) THEN (2 ::= (\<lambda>s. - s$2)) ELSE skip))
  INV (\<lambda>s. 0 \<le> s$1 \<and> 2 * g * s$1 = 2 * g * h + s$2 * s$2))
  {s. 0 \<le> s$1 \<and> s$1 \<le> h}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>g < 0; 0 \<le> h\<rbrakk> \<Longrightarrow> {s. s $ 1 = h \<and> s $ 2 = 0} \<subseteq> fb\<^sub>\<F> (LOOP x\<acute>=\<lambda>t. f g & \<lambda>s. 0 \<le> s $ 1 on \<lambda>s. UNIV UNIV @ 0 ; (IF (\<lambda>s. s $ 1 = 0) THEN (2 ::= (\<lambda>s. - s $ 2)) ELSE skip) INV (\<lambda>s. 0 \<le> s $ 1 \<and> 2 \<cdot> g \<cdot> s $ 1 = 2 \<cdot> g \<cdot> h + s $ 2 \<cdot> s $ 2) ) {s. 0 \<le> s $ 1 \<and> s $ 1 \<le> h}
[PROOF STEP]
by (rule ffb_loopI) (auto simp: bb_real_arith local_flow.ffb_g_ode[OF local_flow_ball])


[STATEMENT]
lemma at_least_at_most_Inf: "\<lbrakk> a \<in> carrier L; b \<in> carrier L; a \<sqsubseteq> b \<rbrakk> \<Longrightarrow> \<Sqinter> \<lbrace>a..b\<rbrace> .= a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier L; b \<in> carrier L; a \<sqsubseteq> b\<rbrakk> \<Longrightarrow> \<Sqinter>\<lbrace>a..b\<rbrace> .= a
[PROOF STEP]
by (rule weak_le_antisym [OF inf_lower inf_greatest]) (auto simp add: at_least_at_most_closed)


[STATEMENT]
lemma ltl_to_dra_restricted_nodes_finite:
  "finite (DRA.nodes (ltl_to_dra_restricted \<phi>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (DRA.nodes (ltl_to_dra_restricted \<phi>))
[PROOF STEP]
unfolding ltl_to_dra_restricted_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (DRA.nodes (DRA_Combine.union_list (map (\<lambda>(x, y). \<AA>' \<phi> x y) (restricted_advice_sets \<phi>))))
[PROOF STEP]
apply (rule DRA_Combine.union_list_nodes_finite)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_all (finite \<circ> DRA.nodes) (map (\<lambda>(x, y). \<AA>' \<phi> x y) (restricted_advice_sets \<phi>))
[PROOF STEP]
apply (simp add: split_def \<AA>'_alphabet advice_sets_not_empty)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_all (finite \<circ> DRA.nodes) (map (\<lambda>p. \<AA>' \<phi> (fst p) (snd p)) (restricted_advice_sets \<phi>))
[PROOF STEP]
apply (simp add: list.pred_set split_def \<AA>'_nodes_finite)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Ord_not_less: "\<lbrakk>Ord x; Ord y\<rbrakk> \<Longrightarrow> \<not> x < y \<longleftrightarrow> y \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Ord x; Ord y\<rbrakk> \<Longrightarrow> (\<not> x < y) = (y \<le> x)
[PROOF STEP]
by (metis (no_types) Ord_linear2 leD)


[STATEMENT]
lemma "a \<noteq> 0 \<Longrightarrow> D (\<lambda>t. t/a) = (\<lambda>t. 1/a) on T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow>  D (\<lambda>t. t / a) = (\<lambda>t. 1 / a) on T
[PROOF STEP]
by (auto intro!: poly_derivatives simp: power2_eq_square)


[STATEMENT]
lemma homotopy_equivalent_space_refl:
   "X homotopy_equivalent_space X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X homotopy_equivalent_space X
[PROOF STEP]
by (simp add: homeomorphic_imp_homotopy_equivalent_space homeomorphic_space_refl)


[STATEMENT]
lemma index_smult_mat[simp]:
  "i < dim_row A \<Longrightarrow> j < dim_col A \<Longrightarrow> (a \<cdot>\<^sub>m A) $$ (i,j) = a * A $$ (i,j)"
  "dim_row (a \<cdot>\<^sub>m A) = dim_row A" "dim_col (a \<cdot>\<^sub>m A) = dim_col A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lbrakk>i < dim_row A; j < dim_col A\<rbrakk> \<Longrightarrow> (a \<cdot>\<^sub>m A) $$ (i, j) = a * A $$ (i, j)) &&& dim_row (a \<cdot>\<^sub>m A) = dim_row A &&& dim_col (a \<cdot>\<^sub>m A) = dim_col A
[PROOF STEP]
unfolding smult_mat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lbrakk>i < dim_row A; j < dim_col A\<rbrakk> \<Longrightarrow> map_mat ((*) a) A $$ (i, j) = a * A $$ (i, j)) &&& dim_row (map_mat ((*) a) A) = dim_row A &&& dim_col (map_mat ((*) a) A) = dim_col A
[PROOF STEP]
by auto


[STATEMENT]
lemma conjugation_conj: "(x \<lhd> y) \<sqinter> z = \<bottom> \<longleftrightarrow> y \<sqinter> (z \<rhd> x) = \<bottom>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((x \<lhd> y) \<sqinter> z = \<bottom>) = (y \<sqinter> (z \<rhd> x) = \<bottom>)
[PROOF STEP]
by (metis inf_commute conjugation_multr conjugation_multl)


[STATEMENT]
lemma quasinorm_subset_Norm_eNorm:
  assumes "f \<in> space\<^sub>N N1 \<Longrightarrow> Norm N2 f \<le> C * Norm N1 f"
          "N1 \<subseteq>\<^sub>N N2"
          "C > 0"
  shows "eNorm N2 f \<le> ennreal C * eNorm N1 f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eNorm N2 f \<le> ennreal C * eNorm N1 f
[PROOF STEP]
proof (cases "f \<in> space\<^sub>N N1")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f \<in> space\<^sub>N N1 \<Longrightarrow> eNorm N2 f \<le> ennreal C * eNorm N1 f
 2. f \<notin> space\<^sub>N N1 \<Longrightarrow> eNorm N2 f \<le> ennreal C * eNorm N1 f
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
f \<in> space\<^sub>N N1

goal (2 subgoals):
 1. f \<in> space\<^sub>N N1 \<Longrightarrow> eNorm N2 f \<le> ennreal C * eNorm N1 f
 2. f \<notin> space\<^sub>N N1 \<Longrightarrow> eNorm N2 f \<le> ennreal C * eNorm N1 f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f \<in> space\<^sub>N N1
[PROOF STEP]
have "f \<in> space\<^sub>N N2"
[PROOF STATE]
proof (prove)
using this:
f \<in> space\<^sub>N N1

goal (1 subgoal):
 1. f \<in> space\<^sub>N N2
[PROOF STEP]
using quasinorm_subset_space[OF \<open>N1 \<subseteq>\<^sub>N N2\<close>]
[PROOF STATE]
proof (prove)
using this:
f \<in> space\<^sub>N N1
space\<^sub>N N1 \<subseteq> space\<^sub>N N2

goal (1 subgoal):
 1. f \<in> space\<^sub>N N2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f \<in> space\<^sub>N N2

goal (2 subgoals):
 1. f \<in> space\<^sub>N N1 \<Longrightarrow> eNorm N2 f \<le> ennreal C * eNorm N1 f
 2. f \<notin> space\<^sub>N N1 \<Longrightarrow> eNorm N2 f \<le> ennreal C * eNorm N1 f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f \<in> space\<^sub>N N2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f \<in> space\<^sub>N N2

goal (1 subgoal):
 1. eNorm N2 f \<le> ennreal C * eNorm N1 f
[PROOF STEP]
using eNorm_Norm[OF True] eNorm_Norm assms(1)[OF True]
[PROOF STATE]
proof (prove)
using this:
f \<in> space\<^sub>N N2
eNorm N1 f = ennreal (Norm N1 f)
?x \<in> space\<^sub>N ?N \<Longrightarrow> eNorm ?N ?x = ennreal (Norm ?N ?x)
Norm N2 f \<le> C * Norm N1 f

goal (1 subgoal):
 1. eNorm N2 f \<le> ennreal C * eNorm N1 f
[PROOF STEP]
by (metis Norm_nonneg ennreal_leI ennreal_mult'')
[PROOF STATE]
proof (state)
this:
eNorm N2 f \<le> ennreal C * eNorm N1 f

goal (1 subgoal):
 1. f \<notin> space\<^sub>N N1 \<Longrightarrow> eNorm N2 f \<le> ennreal C * eNorm N1 f
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f \<notin> space\<^sub>N N1 \<Longrightarrow> eNorm N2 f \<le> ennreal C * eNorm N1 f
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
f \<notin> space\<^sub>N N1

goal (1 subgoal):
 1. f \<notin> space\<^sub>N N1 \<Longrightarrow> eNorm N2 f \<le> ennreal C * eNorm N1 f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f \<notin> space\<^sub>N N1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f \<notin> space\<^sub>N N1

goal (1 subgoal):
 1. eNorm N2 f \<le> ennreal C * eNorm N1 f
[PROOF STEP]
using \<open>C > 0\<close>
[PROOF STATE]
proof (prove)
using this:
f \<notin> space\<^sub>N N1
0 < C

goal (1 subgoal):
 1. eNorm N2 f \<le> ennreal C * eNorm N1 f
[PROOF STEP]
by (metis ennreal_eq_zero_iff ennreal_mult_eq_top_iff infinity_ennreal_def less_imp_le neq_top_trans not_le spaceN_iff)
[PROOF STATE]
proof (state)
this:
eNorm N2 f \<le> ennreal C * eNorm N1 f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bx_aux:
  shows "b>1 \<Longrightarrow> nth_digit (b^x) t' b = (if x=t' then 1 else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < b \<Longrightarrow> nth_digit (b ^ x) t' b = (if x = t' then 1 else 0)
[PROOF STEP]
by (cases "t' > x", auto simp: nth_digit_def)
     (metis dvd_imp_mod_0 dvd_power leI less_SucI nat_neq_iff power_diff zero_less_diff)


[STATEMENT]
lemma numeral_le_ceiling [simp]: "numeral v \<le> \<lceil>x\<rceil> \<longleftrightarrow> numeral v - 1 < x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (numeral v \<le> \<lceil>x\<rceil>) = (numeral v - (1::'a) < x)
[PROOF STEP]
by (simp add: le_ceiling_iff)


[STATEMENT]
lemma gauss_jordan_single_rank:
  fixes A::"'a mat"
  assumes A:"A \<in> carrier_mat n nc"
  assumes order: "nc \<ge> n"
  shows "rank (take_cols A (map snd (pivot_positions (gauss_jordan_single A)))) = rank A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rank (take_cols A (map snd (pivot_positions (gauss_jordan_single A)))) = rank A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rank (take_cols A (map snd (pivot_positions (gauss_jordan_single A)))) = rank A
[PROOF STEP]
let ?R = "gauss_jordan_single A"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rank (take_cols A (map snd (pivot_positions (gauss_jordan_single A)))) = rank A
[PROOF STEP]
obtain P where P:"P\<in>Units (ring_mat TYPE('a) n undefined)" and
    i: "?R = P * A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>P. \<lbrakk>P \<in> Units (ring_mat TYPE('a) n undefined); gauss_jordan_single A = P * A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using gauss_jordan_transform[OF A]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?B \<in> carrier_mat n ?nc'; gauss_jordan A ?B = (?A', ?B')\<rbrakk> \<Longrightarrow> \<exists>P\<in>Units (ring_mat TYPE('a) n ?b). ?A' = P * A \<and> ?B' = P * ?B

goal (1 subgoal):
 1. (\<And>P. \<lbrakk>P \<in> Units (ring_mat TYPE('a) n undefined); gauss_jordan_single A = P * A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using A assms det_mult det_non_zero_imp_unit det_one gauss_jordan_single(4) mult_not_zero one_neq_zero
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?B \<in> carrier_mat n ?nc'; gauss_jordan A ?B = (?A', ?B')\<rbrakk> \<Longrightarrow> \<exists>P\<in>Units (ring_mat TYPE('a) n ?b). ?A' = P * A \<and> ?B' = P * ?B
A \<in> carrier_mat n nc
A \<in> carrier_mat n nc
n \<le> nc
\<lbrakk>?A \<in> carrier_mat ?n ?n; ?B \<in> carrier_mat ?n ?n\<rbrakk> \<Longrightarrow> det (?A * ?B) = det ?A * det ?B
\<lbrakk>?A \<in> carrier_mat ?n ?n; det ?A \<noteq> (0::?'a)\<rbrakk> \<Longrightarrow> ?A \<in> Units (ring_mat TYPE(?'a) ?n ?b)
det (1\<^sub>m ?n) = (1::?'a)
\<lbrakk>?A \<in> carrier_mat ?nr ?nc; gauss_jordan_single ?A = ?C\<rbrakk> \<Longrightarrow> \<exists>P Q. ?C = P * ?A \<and> P \<in> carrier_mat ?nr ?nr \<and> Q \<in> carrier_mat ?nr ?nr \<and> P * Q = 1\<^sub>m ?nr \<and> Q * P = 1\<^sub>m ?nr
?a * ?b \<noteq> (0::?'a) \<Longrightarrow> ?a \<noteq> (0::?'a) \<and> ?b \<noteq> (0::?'a)
(1::?'a) \<noteq> (0::?'a)

goal (1 subgoal):
 1. (\<And>P. \<lbrakk>P \<in> Units (ring_mat TYPE('a) n undefined); gauss_jordan_single A = P * A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (smt A assms det_mult det_non_zero_imp_unit det_one gauss_jordan_single(4) mult_not_zero one_neq_zero)
[PROOF STATE]
proof (state)
this:
P \<in> Units (ring_mat TYPE('a) n undefined)
gauss_jordan_single A = P * A

goal (1 subgoal):
 1. rank (take_cols A (map snd (pivot_positions (gauss_jordan_single A)))) = rank A
[PROOF STEP]
have pcarrier: "P \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P \<in> carrier_mat n n
[PROOF STEP]
using P
[PROOF STATE]
proof (prove)
using this:
P \<in> Units (ring_mat TYPE('a) n undefined)

goal (1 subgoal):
 1. P \<in> carrier_mat n n
[PROOF STEP]
unfolding Units_def
[PROOF STATE]
proof (prove)
using this:
P \<in> {y \<in> carrier (ring_mat TYPE('a) n undefined). \<exists>x\<in>carrier (ring_mat TYPE('a) n undefined). x \<otimes>\<^bsub>ring_mat TYPE('a) n undefined\<^esub> y = \<one>\<^bsub>ring_mat TYPE('a) n undefined\<^esub> \<and> y \<otimes>\<^bsub>ring_mat TYPE('a) n undefined\<^esub> x = \<one>\<^bsub>ring_mat TYPE('a) n undefined\<^esub>}

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

goal (1 subgoal):
 1. rank (take_cols A (map snd (pivot_positions (gauss_jordan_single A)))) = rank A
[PROOF STEP]
have "invertible_mat P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invertible_mat P
[PROOF STEP]
using P
[PROOF STATE]
proof (prove)
using this:
P \<in> Units (ring_mat TYPE('a) n undefined)

goal (1 subgoal):
 1. invertible_mat P
[PROOF STEP]
unfolding invertible_mat_def Units_def inverts_mat_def
[PROOF STATE]
proof (prove)
using this:
P \<in> {y \<in> carrier (ring_mat TYPE('a) n undefined). \<exists>x\<in>carrier (ring_mat TYPE('a) n undefined). x \<otimes>\<^bsub>ring_mat TYPE('a) n undefined\<^esub> y = \<one>\<^bsub>ring_mat TYPE('a) n undefined\<^esub> \<and> y \<otimes>\<^bsub>ring_mat TYPE('a) n undefined\<^esub> x = \<one>\<^bsub>ring_mat TYPE('a) n undefined\<^esub>}

goal (1 subgoal):
 1. square_mat P \<and> (\<exists>B. P * B = 1\<^sub>m (dim_row P) \<and> B * P = 1\<^sub>m (dim_row B))
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>P \<in> carrier (ring_mat TYPE('a) n undefined); x \<in> carrier (ring_mat TYPE('a) n undefined); x \<otimes>\<^bsub>ring_mat TYPE('a) n undefined\<^esub> P = \<one>\<^bsub>ring_mat TYPE('a) n undefined\<^esub>; P \<otimes>\<^bsub>ring_mat TYPE('a) n undefined\<^esub> x = \<one>\<^bsub>ring_mat TYPE('a) n undefined\<^esub>\<rbrakk> \<Longrightarrow> dim_col P = dim_row P
 2. \<And>x. \<lbrakk>P \<in> carrier (ring_mat TYPE('a) n undefined); x \<in> carrier (ring_mat TYPE('a) n undefined); x \<otimes>\<^bsub>ring_mat TYPE('a) n undefined\<^esub> P = \<one>\<^bsub>ring_mat TYPE('a) n undefined\<^esub>; P \<otimes>\<^bsub>ring_mat TYPE('a) n undefined\<^esub> x = \<one>\<^bsub>ring_mat TYPE('a) n undefined\<^esub>\<rbrakk> \<Longrightarrow> \<exists>B. P * B = 1\<^sub>m (dim_row P) \<and> B * P = 1\<^sub>m (dim_row B)
[PROOF STEP]
apply (simp add: ring_mat_simps(5))
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>P \<in> carrier (ring_mat TYPE('a) n undefined); x \<in> carrier (ring_mat TYPE('a) n undefined); x \<otimes>\<^bsub>ring_mat TYPE('a) n undefined\<^esub> P = \<one>\<^bsub>ring_mat TYPE('a) n undefined\<^esub>; P \<otimes>\<^bsub>ring_mat TYPE('a) n undefined\<^esub> x = \<one>\<^bsub>ring_mat TYPE('a) n undefined\<^esub>\<rbrakk> \<Longrightarrow> \<exists>B. P * B = 1\<^sub>m (dim_row P) \<and> B * P = 1\<^sub>m (dim_row B)
[PROOF STEP]
by (metis index_mult_mat(2) index_one_mat(2) ring_mat_simps(1) ring_mat_simps(3))
[PROOF STATE]
proof (state)
this:
invertible_mat P

goal (1 subgoal):
 1. rank (take_cols A (map snd (pivot_positions (gauss_jordan_single A)))) = rank A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
invertible_mat P
[PROOF STEP]
obtain Pi where Pi: "invertible_mat Pi" "Pi * P = 1\<^sub>m n"
[PROOF STATE]
proof (prove)
using this:
invertible_mat P

goal (1 subgoal):
 1. (\<And>Pi. \<lbrakk>invertible_mat Pi; Pi * P = 1\<^sub>m n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<And>Pi. \<lbrakk>invertible_mat Pi; Pi * P = 1\<^sub>m n\<rbrakk> \<Longrightarrow> thesis; invertible_mat P\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
assume a1: "\<And>Pi. \<lbrakk>invertible_mat Pi; Pi * P = 1\<^sub>m n\<rbrakk> \<Longrightarrow> thesis"
[PROOF STATE]
proof (state)
this:
\<lbrakk>invertible_mat ?Pi2; ?Pi2 * P = 1\<^sub>m n\<rbrakk> \<Longrightarrow> thesis

goal (1 subgoal):
 1. \<lbrakk>\<And>Pi. \<lbrakk>invertible_mat Pi; Pi * P = 1\<^sub>m n\<rbrakk> \<Longrightarrow> thesis; invertible_mat P\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
have "dim_row P = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row P = n
[PROOF STEP]
by (metis (no_types) A assms(1) carrier_matD(1) gauss_jordan_single(2) i index_mult_mat(2))
[PROOF STATE]
proof (state)
this:
dim_row P = n

goal (1 subgoal):
 1. \<lbrakk>\<And>Pi. \<lbrakk>invertible_mat Pi; Pi * P = 1\<^sub>m n\<rbrakk> \<Longrightarrow> thesis; invertible_mat P\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
dim_row P = n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
dim_row P = n

goal (1 subgoal):
 1. thesis
[PROOF STEP]
using a1
[PROOF STATE]
proof (prove)
using this:
dim_row P = n
\<lbrakk>invertible_mat ?Pi2; ?Pi2 * P = 1\<^sub>m n\<rbrakk> \<Longrightarrow> thesis

goal (1 subgoal):
 1. thesis
[PROOF STEP]
by (metis (no_types) \<open>invertible_mat P\<close> index_mult_mat(3) index_one_mat(3) invertible_mat_def inverts_mat_def square_mat.simps)
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
invertible_mat Pi
Pi * P = 1\<^sub>m n

goal (1 subgoal):
 1. rank (take_cols A (map snd (pivot_positions (gauss_jordan_single A)))) = rank A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
invertible_mat Pi
Pi * P = 1\<^sub>m n
[PROOF STEP]
have pi_carrier:"Pi \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
using this:
invertible_mat Pi
Pi * P = 1\<^sub>m n

goal (1 subgoal):
 1. Pi \<in> carrier_mat n n
[PROOF STEP]
by (metis carrier_mat_triv index_mult_mat(2) index_one_mat(2) invertible_mat_def square_mat.simps)
[PROOF STATE]
proof (state)
this:
Pi \<in> carrier_mat n n

goal (1 subgoal):
 1. rank (take_cols A (map snd (pivot_positions (gauss_jordan_single A)))) = rank A
[PROOF STEP]
have R1:"row_echelon_form ?R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row_echelon_form (gauss_jordan_single A)
[PROOF STEP]
using assms(2) gauss_jordan_single(3)
[PROOF STATE]
proof (prove)
using this:
n \<le> nc
\<lbrakk>?A \<in> carrier_mat ?nr ?nc; gauss_jordan_single ?A = ?C\<rbrakk> \<Longrightarrow> row_echelon_form ?C

goal (1 subgoal):
 1. row_echelon_form (gauss_jordan_single A)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
row_echelon_form (gauss_jordan_single A)

goal (1 subgoal):
 1. rank (take_cols A (map snd (pivot_positions (gauss_jordan_single A)))) = rank A
[PROOF STEP]
have R2: "?R \<in> carrier_mat n nc"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gauss_jordan_single A \<in> carrier_mat n nc
[PROOF STEP]
using A assms(2) gauss_jordan_single(2)
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n nc
n \<le> nc
\<lbrakk>?A \<in> carrier_mat ?nr ?nc; gauss_jordan_single ?A = ?C\<rbrakk> \<Longrightarrow> ?C \<in> carrier_mat ?nr ?nc

goal (1 subgoal):
 1. gauss_jordan_single A \<in> carrier_mat n nc
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
gauss_jordan_single A \<in> carrier_mat n nc

goal (1 subgoal):
 1. rank (take_cols A (map snd (pivot_positions (gauss_jordan_single A)))) = rank A
[PROOF STEP]
have Rcm: "take_cols ?R (map snd (pivot_positions ?R))
    \<in> carrier_mat n (length (map snd (pivot_positions ?R)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. take_cols (gauss_jordan_single A) (map snd (pivot_positions (gauss_jordan_single A))) \<in> carrier_mat n (length (map snd (pivot_positions (gauss_jordan_single A))))
[PROOF STEP]
apply (rule take_cols_carrier_mat_strict[OF R2])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i \<in> set (map snd (pivot_positions (gauss_jordan_single A))) \<Longrightarrow> i < nc
[PROOF STEP]
using rref_pivot_positions[OF R1 R2]
[PROOF STATE]
proof (prove)
using this:
(?i, ?j) \<in> set (pivot_positions (gauss_jordan_single A)) \<Longrightarrow> ?i < n \<and> ?j < nc

goal (1 subgoal):
 1. \<And>i. i \<in> set (map snd (pivot_positions (gauss_jordan_single A))) \<Longrightarrow> i < nc
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
take_cols (gauss_jordan_single A) (map snd (pivot_positions (gauss_jordan_single A))) \<in> carrier_mat n (length (map snd (pivot_positions (gauss_jordan_single A))))

goal (1 subgoal):
 1. rank (take_cols A (map snd (pivot_positions (gauss_jordan_single A)))) = rank A
[PROOF STEP]
have "Pi * ?R = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Pi * gauss_jordan_single A = A
[PROOF STEP]
using i Pi
[PROOF STATE]
proof (prove)
using this:
gauss_jordan_single A = P * A
invertible_mat Pi
Pi * P = 1\<^sub>m n

goal (1 subgoal):
 1. Pi * gauss_jordan_single A = A
[PROOF STEP]
by (smt A \<open>invertible_mat P\<close> assoc_mult_mat carrier_mat_triv index_mult_mat(2) index_mult_mat(3) index_one_mat(3) invertible_mat_def left_mult_one_mat square_mat.simps)
[PROOF STATE]
proof (state)
this:
Pi * gauss_jordan_single A = A

goal (1 subgoal):
 1. rank (take_cols A (map snd (pivot_positions (gauss_jordan_single A)))) = rank A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Pi * gauss_jordan_single A = A
[PROOF STEP]
have "rank (take_cols A (map snd (pivot_positions ?R))) = rank (take_cols (Pi * ?R) (map snd (pivot_positions ?R)))"
[PROOF STATE]
proof (prove)
using this:
Pi * gauss_jordan_single A = A

goal (1 subgoal):
 1. rank (take_cols A (map snd (pivot_positions (gauss_jordan_single A)))) = rank (take_cols (Pi * gauss_jordan_single A) (map snd (pivot_positions (gauss_jordan_single A))))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rank (take_cols A (map snd (pivot_positions (gauss_jordan_single A)))) = rank (take_cols (Pi * gauss_jordan_single A) (map snd (pivot_positions (gauss_jordan_single A))))

goal (1 subgoal):
 1. rank (take_cols A (map snd (pivot_positions (gauss_jordan_single A)))) = rank A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
rank (take_cols A (map snd (pivot_positions (gauss_jordan_single A)))) = rank (take_cols (Pi * gauss_jordan_single A) (map snd (pivot_positions (gauss_jordan_single A))))

goal (1 subgoal):
 1. rank (take_cols A (map snd (pivot_positions (gauss_jordan_single A)))) = rank A
[PROOF STEP]
have "... = rank ( Pi * take_cols ?R (map snd (pivot_positions ?R)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rank (take_cols (Pi * gauss_jordan_single A) (map snd (pivot_positions (gauss_jordan_single A)))) = rank (Pi * take_cols (gauss_jordan_single A) (map snd (pivot_positions (gauss_jordan_single A))))
[PROOF STEP]
by (metis A gauss_jordan_single(2) pi_carrier take_cols_mat_mul)
[PROOF STATE]
proof (state)
this:
rank (take_cols (Pi * gauss_jordan_single A) (map snd (pivot_positions (gauss_jordan_single A)))) = rank (Pi * take_cols (gauss_jordan_single A) (map snd (pivot_positions (gauss_jordan_single A))))

goal (1 subgoal):
 1. rank (take_cols A (map snd (pivot_positions (gauss_jordan_single A)))) = rank A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
rank (take_cols (Pi * gauss_jordan_single A) (map snd (pivot_positions (gauss_jordan_single A)))) = rank (Pi * take_cols (gauss_jordan_single A) (map snd (pivot_positions (gauss_jordan_single A))))

goal (1 subgoal):
 1. rank (take_cols A (map snd (pivot_positions (gauss_jordan_single A)))) = rank A
[PROOF STEP]
have "... = rank (take_cols ?R (map snd (pivot_positions ?R)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rank (Pi * take_cols (gauss_jordan_single A) (map snd (pivot_positions (gauss_jordan_single A)))) = rank (take_cols (gauss_jordan_single A) (map snd (pivot_positions (gauss_jordan_single A))))
[PROOF STEP]
by (intro rank_mul_left_invertible_mat[OF Pi(1) pi_carrier Rcm])
[PROOF STATE]
proof (state)
this:
rank (Pi * take_cols (gauss_jordan_single A) (map snd (pivot_positions (gauss_jordan_single A)))) = rank (take_cols (gauss_jordan_single A) (map snd (pivot_positions (gauss_jordan_single A))))

goal (1 subgoal):
 1. rank (take_cols A (map snd (pivot_positions (gauss_jordan_single A)))) = rank A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
rank (Pi * take_cols (gauss_jordan_single A) (map snd (pivot_positions (gauss_jordan_single A)))) = rank (take_cols (gauss_jordan_single A) (map snd (pivot_positions (gauss_jordan_single A))))

goal (1 subgoal):
 1. rank (take_cols A (map snd (pivot_positions (gauss_jordan_single A)))) = rank A
[PROOF STEP]
have "... = rank ?R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rank (take_cols (gauss_jordan_single A) (map snd (pivot_positions (gauss_jordan_single A)))) = rank (gauss_jordan_single A)
[PROOF STEP]
using assms(2) conjugatable_vec_space.rref_drop_pivots gauss_jordan_single(3)
[PROOF STATE]
proof (prove)
using this:
n \<le> nc
\<lbrakk>row_echelon_form ?R; ?R \<in> carrier_mat ?n ?nc; ?n \<le> ?nc\<rbrakk> \<Longrightarrow> vec_space.rank ?n (take_cols ?R (map snd (pivot_positions ?R))) = vec_space.rank ?n ?R
\<lbrakk>?A \<in> carrier_mat ?nr ?nc; gauss_jordan_single ?A = ?C\<rbrakk> \<Longrightarrow> row_echelon_form ?C

goal (1 subgoal):
 1. rank (take_cols (gauss_jordan_single A) (map snd (pivot_positions (gauss_jordan_single A)))) = rank (gauss_jordan_single A)
[PROOF STEP]
using R1 R2
[PROOF STATE]
proof (prove)
using this:
n \<le> nc
\<lbrakk>row_echelon_form ?R; ?R \<in> carrier_mat ?n ?nc; ?n \<le> ?nc\<rbrakk> \<Longrightarrow> vec_space.rank ?n (take_cols ?R (map snd (pivot_positions ?R))) = vec_space.rank ?n ?R
\<lbrakk>?A \<in> carrier_mat ?nr ?nc; gauss_jordan_single ?A = ?C\<rbrakk> \<Longrightarrow> row_echelon_form ?C
row_echelon_form (gauss_jordan_single A)
gauss_jordan_single A \<in> carrier_mat n nc

goal (1 subgoal):
 1. rank (take_cols (gauss_jordan_single A) (map snd (pivot_positions (gauss_jordan_single A)))) = rank (gauss_jordan_single A)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
rank (take_cols (gauss_jordan_single A) (map snd (pivot_positions (gauss_jordan_single A)))) = rank (gauss_jordan_single A)

goal (1 subgoal):
 1. rank (take_cols A (map snd (pivot_positions (gauss_jordan_single A)))) = rank A
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
rank (take_cols A (map snd (pivot_positions (gauss_jordan_single A)))) = rank (take_cols (gauss_jordan_single A) (map snd (pivot_positions (gauss_jordan_single A))))
rank (take_cols (gauss_jordan_single A) (map snd (pivot_positions (gauss_jordan_single A)))) = rank (gauss_jordan_single A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
rank (take_cols A (map snd (pivot_positions (gauss_jordan_single A)))) = rank (take_cols (gauss_jordan_single A) (map snd (pivot_positions (gauss_jordan_single A))))
rank (take_cols (gauss_jordan_single A) (map snd (pivot_positions (gauss_jordan_single A)))) = rank (gauss_jordan_single A)

goal (1 subgoal):
 1. rank (take_cols A (map snd (pivot_positions (gauss_jordan_single A)))) = rank A
[PROOF STEP]
using A \<open>P \<in> carrier_mat n n\<close> \<open>invertible_mat P\<close> conjugatable_vec_space.rank_mul_left_invertible_mat i
[PROOF STATE]
proof (prove)
using this:
rank (take_cols A (map snd (pivot_positions (gauss_jordan_single A)))) = rank (take_cols (gauss_jordan_single A) (map snd (pivot_positions (gauss_jordan_single A))))
rank (take_cols (gauss_jordan_single A) (map snd (pivot_positions (gauss_jordan_single A)))) = rank (gauss_jordan_single A)
A \<in> carrier_mat n nc
P \<in> carrier_mat n n
invertible_mat P
\<lbrakk>invertible_mat ?A; ?A \<in> carrier_mat ?n ?n; ?B \<in> carrier_mat ?n ?nc\<rbrakk> \<Longrightarrow> vec_space.rank ?n (?A * ?B) = vec_space.rank ?n ?B
gauss_jordan_single A = P * A

goal (1 subgoal):
 1. rank (take_cols A (map snd (pivot_positions (gauss_jordan_single A)))) = rank A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rank (take_cols A (map snd (pivot_positions (gauss_jordan_single A)))) = rank A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_eq_dim: "B \<subseteq> V \<Longrightarrow> card B = dim V \<Longrightarrow> finite B \<Longrightarrow> independent B \<longleftrightarrow> V \<subseteq> span B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>B \<subseteq> V; card B = dim V; finite B\<rbrakk> \<Longrightarrow> independent B = (V \<subseteq> span B)
[PROOF STEP]
by (metis order_eq_iff card_le_dim_spanning card_ge_dim_independent)


[STATEMENT]
lemma num_reachable_zero: "\<lbrakk>wf_graph G; num_reachable G v = 0\<rbrakk> \<Longrightarrow> succ_tran G v = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>wf_graph G; num_reachable G v = 0\<rbrakk> \<Longrightarrow> succ_tran G v = {}
[PROOF STEP]
unfolding num_reachable_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>wf_graph G; card (succ_tran G v) = 0\<rbrakk> \<Longrightarrow> succ_tran G v = {}
[PROOF STEP]
apply(subgoal_tac "finite (succ_tran G v)")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>wf_graph G; card (succ_tran G v) = 0; finite (succ_tran G v)\<rbrakk> \<Longrightarrow> succ_tran G v = {}
 2. \<lbrakk>wf_graph G; card (succ_tran G v) = 0\<rbrakk> \<Longrightarrow> finite (succ_tran G v)
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>wf_graph G; card (succ_tran G v) = 0\<rbrakk> \<Longrightarrow> finite (succ_tran G v)
[PROOF STEP]
apply(blast intro: succ_tran_finite)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma word_or_zero:
  "(a OR b = 0) = (a = 0 \<and> b = 0)"
  for a b :: \<open>'a::len word\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a OR b = 0) = (a = 0 \<and> b = 0)
[PROOF STEP]
by (fact or_eq_0_iff)


[STATEMENT]
lemma fcard_fminus_fsingleton:
  "x |\<in>| A \<Longrightarrow> fcard (A |-| {|x|}) = fcard A - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x |\<in>| A \<Longrightarrow> fcard (A |-| {|x|}) = fcard A - 1
[PROOF STEP]
by transfer (rule card_Diff_singleton)


[STATEMENT]
theorem pr_2_to_1: "f \<in> PrimRec2 \<Longrightarrow> (\<lambda> z. f (c_fst z) (c_snd z)) \<in> PrimRec1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> PrimRec2 \<Longrightarrow> (\<lambda>z. f (c_fst z) (c_snd z)) \<in> PrimRec1
[PROOF STEP]
by prec


[STATEMENT]
lemma I_XpZ_unitary:
  shows "unitary I_XpZ"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.unitary I_XpZ
[PROOF STEP]
unfolding I_XpZ_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.unitary (1\<^sub>m 2 \<Otimes> XpZ)
[PROOF STEP]
using tensor_mat_unitary[of "1\<^sub>m 2" XpZ] XpZ_carrier
    unitary_XpZ
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Complex_Matrix.unitary (1\<^sub>m 2); Complex_Matrix.unitary XpZ; 0 < dim_row (1\<^sub>m 2); 0 < dim_row XpZ\<rbrakk> \<Longrightarrow> Complex_Matrix.unitary (1\<^sub>m 2 \<Otimes> XpZ)
XpZ \<in> carrier_mat 2 2
Complex_Matrix.unitary XpZ

goal (1 subgoal):
 1. Complex_Matrix.unitary (1\<^sub>m 2 \<Otimes> XpZ)
[PROOF STEP]
using unitary_one
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Complex_Matrix.unitary (1\<^sub>m 2); Complex_Matrix.unitary XpZ; 0 < dim_row (1\<^sub>m 2); 0 < dim_row XpZ\<rbrakk> \<Longrightarrow> Complex_Matrix.unitary (1\<^sub>m 2 \<Otimes> XpZ)
XpZ \<in> carrier_mat 2 2
Complex_Matrix.unitary XpZ
Complex_Matrix.unitary (1\<^sub>m ?n)

goal (1 subgoal):
 1. Complex_Matrix.unitary (1\<^sub>m 2 \<Otimes> XpZ)
[PROOF STEP]
by auto


[STATEMENT]
lemma \<omega>1_gt1 [simp]: "\<omega>1 > 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < \<omega>1
[PROOF STEP]
using Ord_\<omega>1 OrdmemD \<omega>_gt1 less_trans
[PROOF STATE]
proof (prove)
using this:
Ord \<omega>1
\<lbrakk>Ord ?k; ?j \<in> elts ?k\<rbrakk> \<Longrightarrow> ?j < ?k
1 < \<omega>
\<lbrakk>?x < ?y; ?y < ?z\<rbrakk> \<Longrightarrow> ?x < ?z

goal (1 subgoal):
 1. 1 < \<omega>1
[PROOF STEP]
by blast


[STATEMENT]
lemma concat_lists_listset: "set (concat_lists xs) = listset (map set xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (concat_lists xs) = listset (map set xs)
[PROOF STEP]
by (induct xs, auto simp: set_Cons_def)


[STATEMENT]
lemma forall_7: "(\<forall>i::7. P i) \<longleftrightarrow> P 1 \<and> P 2 \<and> P 3\<and> P 4 \<and> P 5 \<and> P 6\<and> P 7  "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>i. P i) = (P 1 \<and> P 2 \<and> P 3 \<and> P 4 \<and> P 5 \<and> P 6 \<and> P 7)
[PROOF STEP]
by (metis exhaust_7)


[STATEMENT]
lemma snd_pairs_VLambda: "snd ` pairs (VLambda A f) = f ` elts A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd ` pairs (VLambda A f) = f ` elts A
[PROOF STEP]
by (force simp: VLambda_def pairs_def)


[STATEMENT]
lemma dim_invertible:
  fixes A:: "'a::field mat"
  fixes n:: "nat"
  assumes assm: "invertible_mat A"
  assumes dim: "A \<in> carrier_mat n n"
  shows "matr_option (dim_row A)
     (mat_inverse (A)) \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matr_option (dim_row A) (mat_inverse A) \<in> carrier_mat n n
[PROOF STEP]
proof (cases "mat_inverse(A)")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. mat_inverse A = None \<Longrightarrow> matr_option (dim_row A) (mat_inverse A) \<in> carrier_mat n n
 2. \<And>a. mat_inverse A = Some a \<Longrightarrow> matr_option (dim_row A) (mat_inverse A) \<in> carrier_mat n n
[PROOF STEP]
obtain n where n: "A \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>n. A \<in> carrier_mat n n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms invertible_mat_def square_mat.simps
[PROOF STATE]
proof (prove)
using this:
invertible_mat A
A \<in> carrier_mat n n
invertible_mat ?A \<equiv> square_mat ?A \<and> (\<exists>B. inverts_mat ?A B \<and> inverts_mat B ?A)
square_mat ?A = (dim_col ?A = dim_row ?A)

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

goal (2 subgoals):
 1. mat_inverse A = None \<Longrightarrow> matr_option (dim_row A) (mat_inverse A) \<in> carrier_mat n n
 2. \<And>a. mat_inverse A = Some a \<Longrightarrow> matr_option (dim_row A) (mat_inverse A) \<in> carrier_mat n n
[PROOF STEP]
case None
[PROOF STATE]
proof (state)
this:
mat_inverse A = None

goal (2 subgoals):
 1. mat_inverse A = None \<Longrightarrow> matr_option (dim_row A) (mat_inverse A) \<in> carrier_mat n n
 2. \<And>a. mat_inverse A = Some a \<Longrightarrow> matr_option (dim_row A) (mat_inverse A) \<in> carrier_mat n n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
mat_inverse A = None
[PROOF STEP]
have "A \<notin> Units (ring_mat TYPE('a) n n)"
[PROOF STATE]
proof (prove)
using this:
mat_inverse A = None

goal (1 subgoal):
 1. A \<notin> Units (ring_mat TYPE('a) n n)
[PROOF STEP]
by (simp add: mat_inverse(1) n)
[PROOF STATE]
proof (state)
this:
A \<notin> Units (ring_mat TYPE('a) n n)

goal (2 subgoals):
 1. mat_inverse A = None \<Longrightarrow> matr_option (dim_row A) (mat_inverse A) \<in> carrier_mat n n
 2. \<And>a. mat_inverse A = Some a \<Longrightarrow> matr_option (dim_row A) (mat_inverse A) \<in> carrier_mat n n
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
A \<notin> Units (ring_mat TYPE('a) n n)

goal (1 subgoal):
 1. matr_option (dim_row A) (mat_inverse A) \<in> carrier_mat n n
[PROOF STEP]
by (meson assms det_non_zero_imp_unit invertible_Units n unit_imp_det_non_zero)
[PROOF STATE]
proof (state)
this:
matr_option (dim_row A) (mat_inverse A) \<in> carrier_mat n n

goal (1 subgoal):
 1. \<And>a. mat_inverse A = Some a \<Longrightarrow> matr_option (dim_row A) (mat_inverse A) \<in> carrier_mat n n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a. mat_inverse A = Some a \<Longrightarrow> matr_option (dim_row A) (mat_inverse A) \<in> carrier_mat n n
[PROOF STEP]
case (Some a)
[PROOF STATE]
proof (state)
this:
mat_inverse A = Some a

goal (1 subgoal):
 1. \<And>a. mat_inverse A = Some a \<Longrightarrow> matr_option (dim_row A) (mat_inverse A) \<in> carrier_mat n n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
mat_inverse A = Some a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
mat_inverse A = Some a

goal (1 subgoal):
 1. matr_option (dim_row A) (mat_inverse A) \<in> carrier_mat n n
[PROOF STEP]
using dim mat_inverse(2)
[PROOF STATE]
proof (prove)
using this:
mat_inverse A = Some a
A \<in> carrier_mat n n
\<lbrakk>?A \<in> carrier_mat ?n ?n; mat_inverse ?A = Some ?B\<rbrakk> \<Longrightarrow> ?A * ?B = 1\<^sub>m ?n \<and> ?B * ?A = 1\<^sub>m ?n \<and> ?B \<in> carrier_mat ?n ?n

goal (1 subgoal):
 1. matr_option (dim_row A) (mat_inverse A) \<in> carrier_mat n n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
matr_option (dim_row A) (mat_inverse A) \<in> carrier_mat n n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fps_deriv_radical:
  fixes a :: "'a::field_char_0 fps"
  assumes r0: "(r (Suc k) (a$0)) ^ Suc k = a$0"
    and a0: "a$0 \<noteq> 0"
  shows "fps_deriv (fps_radical r (Suc k) a) =
    fps_deriv a / (fps_const (of_nat (Suc k)) * (fps_radical r (Suc k) a) ^ k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_deriv (fps_radical r (Suc k) a) = fps_deriv a / (fps_const (of_nat (Suc k)) * fps_radical r (Suc k) a ^ k)
[PROOF STEP]
using fps_deriv_radical'[of r k a, OF r0 a0]
[PROOF STATE]
proof (prove)
using this:
fps_deriv (fps_radical r (Suc k) a) = fps_deriv a / (of_nat (Suc k) * fps_radical r (Suc k) a ^ k)

goal (1 subgoal):
 1. fps_deriv (fps_radical r (Suc k) a) = fps_deriv a / (fps_const (of_nat (Suc k)) * fps_radical r (Suc k) a ^ k)
[PROOF STEP]
by (simp add: fps_of_nat[symmetric])


[STATEMENT]
theorem paperIDs_equals:
assumes a: "reach s" and p: "papID \<in>\<in> paperIDs s confID1" "papID \<in>\<in> paperIDs s confID2"
shows "confID1 = confID2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. confID1 = confID2
[PROOF STEP]
using paperIDs_equals1[OF a] p
[PROOF STATE]
proof (prove)
using this:
paperIDs_equals s
papID \<in>\<in> paperIDs s confID1
papID \<in>\<in> paperIDs s confID2

goal (1 subgoal):
 1. confID1 = confID2
[PROOF STEP]
unfolding paperIDs_equals_def
[PROOF STATE]
proof (prove)
using this:
\<forall>confID1 confID2 papID. papID \<in>\<in> paperIDs s confID1 \<and> papID \<in>\<in> paperIDs s confID2 \<longrightarrow> confID1 = confID2
papID \<in>\<in> paperIDs s confID1
papID \<in>\<in> paperIDs s confID2

goal (1 subgoal):
 1. confID1 = confID2
[PROOF STEP]
by auto


[STATEMENT]
lemma Digamma_half_integer:
  "Digamma (of_nat n + 1/2 :: 'a :: {real_normed_field,banach}) =
      (\<Sum>k<n. 2 / (of_nat (2*k+1))) - euler_mascheroni - of_real (2 * ln 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Digamma (of_nat n + (1::'a) / (2::'a)) = (\<Sum>k<n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2)
[PROOF STEP]
proof (induction n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Digamma (of_nat 0 + (1::'a) / (2::'a)) = (\<Sum>k<0. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2)
 2. \<And>n. Digamma (of_nat n + (1::'a) / (2::'a)) = (\<Sum>k<n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2) \<Longrightarrow> Digamma (of_nat (Suc n) + (1::'a) / (2::'a)) = (\<Sum>k<Suc n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. Digamma (of_nat 0 + (1::'a) / (2::'a)) = (\<Sum>k<0. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2)
 2. \<And>n. Digamma (of_nat n + (1::'a) / (2::'a)) = (\<Sum>k<n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2) \<Longrightarrow> Digamma (of_nat (Suc n) + (1::'a) / (2::'a)) = (\<Sum>k<Suc n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2)
[PROOF STEP]
have "Digamma (1/2 :: 'a) = of_real (Digamma (1/2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Digamma ((1::'a) / (2::'a)) = of_real (Digamma (1 / 2))
[PROOF STEP]
by (simp add: Polygamma_of_real [symmetric])
[PROOF STATE]
proof (state)
this:
Digamma ((1::'a) / (2::'a)) = of_real (Digamma (1 / 2))

goal (2 subgoals):
 1. Digamma (of_nat 0 + (1::'a) / (2::'a)) = (\<Sum>k<0. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2)
 2. \<And>n. Digamma (of_nat n + (1::'a) / (2::'a)) = (\<Sum>k<n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2) \<Longrightarrow> Digamma (of_nat (Suc n) + (1::'a) / (2::'a)) = (\<Sum>k<Suc n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Digamma ((1::'a) / (2::'a)) = of_real (Digamma (1 / 2))

goal (2 subgoals):
 1. Digamma (of_nat 0 + (1::'a) / (2::'a)) = (\<Sum>k<0. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2)
 2. \<And>n. Digamma (of_nat n + (1::'a) / (2::'a)) = (\<Sum>k<n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2) \<Longrightarrow> Digamma (of_nat (Suc n) + (1::'a) / (2::'a)) = (\<Sum>k<Suc n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2)
[PROOF STEP]
have "Digamma (1/2::real) =
               (\<Sum>k. inverse (of_nat (Suc k)) - inverse (of_nat k + 1/2)) - euler_mascheroni"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Digamma (1 / 2) = (\<Sum>k. inverse (real (Suc k)) - inverse (real k + 1 / 2)) - euler_mascheroni
[PROOF STEP]
by (simp add: Digamma_def add_ac)
[PROOF STATE]
proof (state)
this:
Digamma (1 / 2) = (\<Sum>k. inverse (real (Suc k)) - inverse (real k + 1 / 2)) - euler_mascheroni

goal (2 subgoals):
 1. Digamma (of_nat 0 + (1::'a) / (2::'a)) = (\<Sum>k<0. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2)
 2. \<And>n. Digamma (of_nat n + (1::'a) / (2::'a)) = (\<Sum>k<n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2) \<Longrightarrow> Digamma (of_nat (Suc n) + (1::'a) / (2::'a)) = (\<Sum>k<Suc n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Digamma (1 / 2) = (\<Sum>k. inverse (real (Suc k)) - inverse (real k + 1 / 2)) - euler_mascheroni

goal (2 subgoals):
 1. Digamma (of_nat 0 + (1::'a) / (2::'a)) = (\<Sum>k<0. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2)
 2. \<And>n. Digamma (of_nat n + (1::'a) / (2::'a)) = (\<Sum>k<n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2) \<Longrightarrow> Digamma (of_nat (Suc n) + (1::'a) / (2::'a)) = (\<Sum>k<Suc n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2)
[PROOF STEP]
have "(\<Sum>k. inverse (of_nat (Suc k) :: real) - inverse (of_nat k + 1/2)) =
             (\<Sum>k. inverse (1/2) * (inverse (2 * of_nat (Suc k)) - inverse (2 * of_nat k + 1)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k. inverse (real (Suc k)) - inverse (real k + 1 / 2)) = (\<Sum>k. inverse (1 / 2) * (inverse (2 * real (Suc k)) - inverse (2 * real k + 1)))
[PROOF STEP]
by (simp_all add: add_ac inverse_mult_distrib[symmetric] ring_distribs del: inverse_divide)
[PROOF STATE]
proof (state)
this:
(\<Sum>k. inverse (real (Suc k)) - inverse (real k + 1 / 2)) = (\<Sum>k. inverse (1 / 2) * (inverse (2 * real (Suc k)) - inverse (2 * real k + 1)))

goal (2 subgoals):
 1. Digamma (of_nat 0 + (1::'a) / (2::'a)) = (\<Sum>k<0. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2)
 2. \<And>n. Digamma (of_nat n + (1::'a) / (2::'a)) = (\<Sum>k<n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2) \<Longrightarrow> Digamma (of_nat (Suc n) + (1::'a) / (2::'a)) = (\<Sum>k<Suc n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k. inverse (real (Suc k)) - inverse (real k + 1 / 2)) = (\<Sum>k. inverse (1 / 2) * (inverse (2 * real (Suc k)) - inverse (2 * real k + 1)))

goal (2 subgoals):
 1. Digamma (of_nat 0 + (1::'a) / (2::'a)) = (\<Sum>k<0. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2)
 2. \<And>n. Digamma (of_nat n + (1::'a) / (2::'a)) = (\<Sum>k<n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2) \<Longrightarrow> Digamma (of_nat (Suc n) + (1::'a) / (2::'a)) = (\<Sum>k<Suc n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2)
[PROOF STEP]
have "\<dots> = - 2 * ln 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k. inverse (1 / 2) * (inverse (2 * real (Suc k)) - inverse (2 * real k + 1))) = - 2 * ln 2
[PROOF STEP]
using sums_minus[OF alternating_harmonic_series_sums']
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. - (inverse (real (2 * n + 1)) - inverse (real (2 * n + 2)))) sums - ln 2

goal (1 subgoal):
 1. (\<Sum>k. inverse (1 / 2) * (inverse (2 * real (Suc k)) - inverse (2 * real k + 1))) = - 2 * ln 2
[PROOF STEP]
by (subst suminf_mult) (simp_all add: algebra_simps sums_iff)
[PROOF STATE]
proof (state)
this:
(\<Sum>k. inverse (1 / 2) * (inverse (2 * real (Suc k)) - inverse (2 * real k + 1))) = - 2 * ln 2

goal (2 subgoals):
 1. Digamma (of_nat 0 + (1::'a) / (2::'a)) = (\<Sum>k<0. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2)
 2. \<And>n. Digamma (of_nat n + (1::'a) / (2::'a)) = (\<Sum>k<n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2) \<Longrightarrow> Digamma (of_nat (Suc n) + (1::'a) / (2::'a)) = (\<Sum>k<Suc n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Digamma ((1::'a) / (2::'a)) = of_real (- 2 * ln 2 - euler_mascheroni)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
Digamma ((1::'a) / (2::'a)) = of_real (- 2 * ln 2 - euler_mascheroni)

goal (1 subgoal):
 1. Digamma (of_nat 0 + (1::'a) / (2::'a)) = (\<Sum>k<0. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Digamma (of_nat 0 + (1::'a) / (2::'a)) = (\<Sum>k<0. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2)

goal (1 subgoal):
 1. \<And>n. Digamma (of_nat n + (1::'a) / (2::'a)) = (\<Sum>k<n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2) \<Longrightarrow> Digamma (of_nat (Suc n) + (1::'a) / (2::'a)) = (\<Sum>k<Suc n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. Digamma (of_nat n + (1::'a) / (2::'a)) = (\<Sum>k<n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2) \<Longrightarrow> Digamma (of_nat (Suc n) + (1::'a) / (2::'a)) = (\<Sum>k<Suc n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2)
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
Digamma (of_nat n + (1::'a) / (2::'a)) = (\<Sum>k<n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2)

goal (1 subgoal):
 1. \<And>n. Digamma (of_nat n + (1::'a) / (2::'a)) = (\<Sum>k<n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2) \<Longrightarrow> Digamma (of_nat (Suc n) + (1::'a) / (2::'a)) = (\<Sum>k<Suc n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2)
[PROOF STEP]
have nz: "2 * of_nat n + (1:: 'a) \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2::'a) * of_nat n + (1::'a) \<noteq> (0::'a)
[PROOF STEP]
using of_nat_neq_0[of "2*n"]
[PROOF STATE]
proof (prove)
using this:
of_nat (Suc (2 * n)) \<noteq> (0::?'a)

goal (1 subgoal):
 1. (2::'a) * of_nat n + (1::'a) \<noteq> (0::'a)
[PROOF STEP]
by (simp only: of_nat_Suc) (simp add: add_ac)
[PROOF STATE]
proof (state)
this:
(2::'a) * of_nat n + (1::'a) \<noteq> (0::'a)

goal (1 subgoal):
 1. \<And>n. Digamma (of_nat n + (1::'a) / (2::'a)) = (\<Sum>k<n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2) \<Longrightarrow> Digamma (of_nat (Suc n) + (1::'a) / (2::'a)) = (\<Sum>k<Suc n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2)
[PROOF STEP]
hence nz': "of_nat n + (1/2::'a) \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
(2::'a) * of_nat n + (1::'a) \<noteq> (0::'a)

goal (1 subgoal):
 1. of_nat n + (1::'a) / (2::'a) \<noteq> (0::'a)
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
of_nat n + (1::'a) / (2::'a) \<noteq> (0::'a)

goal (1 subgoal):
 1. \<And>n. Digamma (of_nat n + (1::'a) / (2::'a)) = (\<Sum>k<n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2) \<Longrightarrow> Digamma (of_nat (Suc n) + (1::'a) / (2::'a)) = (\<Sum>k<Suc n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2)
[PROOF STEP]
have "Digamma (of_nat (Suc n) + 1/2 :: 'a) = Digamma (of_nat n + 1/2 + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Digamma (of_nat (Suc n) + (1::'a) / (2::'a)) = Digamma (of_nat n + (1::'a) / (2::'a) + (1::'a))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Digamma (of_nat (Suc n) + (1::'a) / (2::'a)) = Digamma (of_nat n + (1::'a) / (2::'a) + (1::'a))

goal (1 subgoal):
 1. \<And>n. Digamma (of_nat n + (1::'a) / (2::'a)) = (\<Sum>k<n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2) \<Longrightarrow> Digamma (of_nat (Suc n) + (1::'a) / (2::'a)) = (\<Sum>k<Suc n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Digamma (of_nat (Suc n) + (1::'a) / (2::'a)) = Digamma (of_nat n + (1::'a) / (2::'a) + (1::'a))

goal (1 subgoal):
 1. \<And>n. Digamma (of_nat n + (1::'a) / (2::'a)) = (\<Sum>k<n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2) \<Longrightarrow> Digamma (of_nat (Suc n) + (1::'a) / (2::'a)) = (\<Sum>k<Suc n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2)
[PROOF STEP]
from nz'
[PROOF STATE]
proof (chain)
picking this:
of_nat n + (1::'a) / (2::'a) \<noteq> (0::'a)
[PROOF STEP]
have "\<dots> = Digamma (of_nat n + 1/2) + 1 / (of_nat n + 1/2)"
[PROOF STATE]
proof (prove)
using this:
of_nat n + (1::'a) / (2::'a) \<noteq> (0::'a)

goal (1 subgoal):
 1. Digamma (of_nat n + (1::'a) / (2::'a) + (1::'a)) = Digamma (of_nat n + (1::'a) / (2::'a)) + (1::'a) / (of_nat n + (1::'a) / (2::'a))
[PROOF STEP]
by (rule Digamma_plus1)
[PROOF STATE]
proof (state)
this:
Digamma (of_nat n + (1::'a) / (2::'a) + (1::'a)) = Digamma (of_nat n + (1::'a) / (2::'a)) + (1::'a) / (of_nat n + (1::'a) / (2::'a))

goal (1 subgoal):
 1. \<And>n. Digamma (of_nat n + (1::'a) / (2::'a)) = (\<Sum>k<n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2) \<Longrightarrow> Digamma (of_nat (Suc n) + (1::'a) / (2::'a)) = (\<Sum>k<Suc n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Digamma (of_nat n + (1::'a) / (2::'a) + (1::'a)) = Digamma (of_nat n + (1::'a) / (2::'a)) + (1::'a) / (of_nat n + (1::'a) / (2::'a))

goal (1 subgoal):
 1. \<And>n. Digamma (of_nat n + (1::'a) / (2::'a)) = (\<Sum>k<n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2) \<Longrightarrow> Digamma (of_nat (Suc n) + (1::'a) / (2::'a)) = (\<Sum>k<Suc n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2)
[PROOF STEP]
from nz nz'
[PROOF STATE]
proof (chain)
picking this:
(2::'a) * of_nat n + (1::'a) \<noteq> (0::'a)
of_nat n + (1::'a) / (2::'a) \<noteq> (0::'a)
[PROOF STEP]
have "1 / (of_nat n + 1/2 :: 'a) = 2 / (2 * of_nat n + 1)"
[PROOF STATE]
proof (prove)
using this:
(2::'a) * of_nat n + (1::'a) \<noteq> (0::'a)
of_nat n + (1::'a) / (2::'a) \<noteq> (0::'a)

goal (1 subgoal):
 1. (1::'a) / (of_nat n + (1::'a) / (2::'a)) = (2::'a) / ((2::'a) * of_nat n + (1::'a))
[PROOF STEP]
by (subst divide_eq_eq) simp_all
[PROOF STATE]
proof (state)
this:
(1::'a) / (of_nat n + (1::'a) / (2::'a)) = (2::'a) / ((2::'a) * of_nat n + (1::'a))

goal (1 subgoal):
 1. \<And>n. Digamma (of_nat n + (1::'a) / (2::'a)) = (\<Sum>k<n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2) \<Longrightarrow> Digamma (of_nat (Suc n) + (1::'a) / (2::'a)) = (\<Sum>k<Suc n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(1::'a) / (of_nat n + (1::'a) / (2::'a)) = (2::'a) / ((2::'a) * of_nat n + (1::'a))

goal (1 subgoal):
 1. \<And>n. Digamma (of_nat n + (1::'a) / (2::'a)) = (\<Sum>k<n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2) \<Longrightarrow> Digamma (of_nat (Suc n) + (1::'a) / (2::'a)) = (\<Sum>k<Suc n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2)
[PROOF STEP]
note Suc
[PROOF STATE]
proof (state)
this:
Digamma (of_nat n + (1::'a) / (2::'a)) = (\<Sum>k<n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2)

goal (1 subgoal):
 1. \<And>n. Digamma (of_nat n + (1::'a) / (2::'a)) = (\<Sum>k<n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2) \<Longrightarrow> Digamma (of_nat (Suc n) + (1::'a) / (2::'a)) = (\<Sum>k<Suc n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Digamma (of_nat (Suc n) + (1::'a) / (2::'a)) = (\<Sum>k<n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2) + (2::'a) / ((2::'a) * of_nat n + (1::'a))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
Digamma (of_nat (Suc n) + (1::'a) / (2::'a)) = (\<Sum>k<n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2) + (2::'a) / ((2::'a) * of_nat n + (1::'a))

goal (1 subgoal):
 1. Digamma (of_nat (Suc n) + (1::'a) / (2::'a)) = (\<Sum>k<Suc n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2)
[PROOF STEP]
by (simp add: add_ac)
[PROOF STATE]
proof (state)
this:
Digamma (of_nat (Suc n) + (1::'a) / (2::'a)) = (\<Sum>k<Suc n. (2::'a) / of_nat (2 * k + 1)) - euler_mascheroni - of_real (2 * ln 2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma list_slice_1: "list_slice xs (Suc 0) = map (\<lambda>x. [x]) xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_slice xs (Suc 0) = map (\<lambda>x. [x]) xs
[PROOF STEP]
by (fastforce simp: list_eq_iff list_slice_def list_slice_aux_nth list_slice_aux_length)


[STATEMENT]
lemma lemma_3_5_iv_3: "(d3 a b) * (d3 b c) * (d3 a b) \<le> d3 a c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d3 a b * d3 b c * d3 a b \<le> d3 a c
[PROOF STEP]
by (simp add: d3_def lemma_3_5_iv_1)