[STATEMENT]
lemma rbt_split_size: "(l2,\<beta>,r2) = rbt_split t2 a \<Longrightarrow> size l2 + size r2 \<le> size t2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (l2, \<beta>, r2) = rbt_split t2 a \<Longrightarrow> size l2 + size r2 \<le> size t2
[PROOF STEP]
by (induction t2 a arbitrary: l2 r2 rule: rbt_split.induct) (auto split: if_splits prod.splits)


[STATEMENT]
lemma compact_Int_closed [intro]:
  assumes "compact S"
    and "closed T"
  shows "compact (S \<inter> T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compact (S \<inter> T)
[PROOF STEP]
proof (rule compactI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>C. \<lbrakk>Ball C open; S \<inter> T \<subseteq> \<Union> C\<rbrakk> \<Longrightarrow> \<exists>C'\<subseteq>C. finite C' \<and> S \<inter> T \<subseteq> \<Union> C'
[PROOF STEP]
fix C
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>C. \<lbrakk>Ball C open; S \<inter> T \<subseteq> \<Union> C\<rbrakk> \<Longrightarrow> \<exists>C'\<subseteq>C. finite C' \<and> S \<inter> T \<subseteq> \<Union> C'
[PROOF STEP]
assume C: "\<forall>c\<in>C. open c"
[PROOF STATE]
proof (state)
this:
Ball C open

goal (1 subgoal):
 1. \<And>C. \<lbrakk>Ball C open; S \<inter> T \<subseteq> \<Union> C\<rbrakk> \<Longrightarrow> \<exists>C'\<subseteq>C. finite C' \<and> S \<inter> T \<subseteq> \<Union> C'
[PROOF STEP]
assume cover: "S \<inter> T \<subseteq> \<Union>C"
[PROOF STATE]
proof (state)
this:
S \<inter> T \<subseteq> \<Union> C

goal (1 subgoal):
 1. \<And>C. \<lbrakk>Ball C open; S \<inter> T \<subseteq> \<Union> C\<rbrakk> \<Longrightarrow> \<exists>C'\<subseteq>C. finite C' \<and> S \<inter> T \<subseteq> \<Union> C'
[PROOF STEP]
from C \<open>closed T\<close>
[PROOF STATE]
proof (chain)
picking this:
Ball C open
closed T
[PROOF STEP]
have "\<forall>c\<in>C \<union> {- T}. open c"
[PROOF STATE]
proof (prove)
using this:
Ball C open
closed T

goal (1 subgoal):
 1. Ball (C \<union> {- T}) open
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Ball (C \<union> {- T}) open

goal (1 subgoal):
 1. \<And>C. \<lbrakk>Ball C open; S \<inter> T \<subseteq> \<Union> C\<rbrakk> \<Longrightarrow> \<exists>C'\<subseteq>C. finite C' \<and> S \<inter> T \<subseteq> \<Union> C'
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Ball (C \<union> {- T}) open

goal (1 subgoal):
 1. \<And>C. \<lbrakk>Ball C open; S \<inter> T \<subseteq> \<Union> C\<rbrakk> \<Longrightarrow> \<exists>C'\<subseteq>C. finite C' \<and> S \<inter> T \<subseteq> \<Union> C'
[PROOF STEP]
from cover
[PROOF STATE]
proof (chain)
picking this:
S \<inter> T \<subseteq> \<Union> C
[PROOF STEP]
have "S \<subseteq> \<Union>(C \<union> {- T})"
[PROOF STATE]
proof (prove)
using this:
S \<inter> T \<subseteq> \<Union> C

goal (1 subgoal):
 1. S \<subseteq> \<Union> (C \<union> {- T})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
S \<subseteq> \<Union> (C \<union> {- T})

goal (1 subgoal):
 1. \<And>C. \<lbrakk>Ball C open; S \<inter> T \<subseteq> \<Union> C\<rbrakk> \<Longrightarrow> \<exists>C'\<subseteq>C. finite C' \<and> S \<inter> T \<subseteq> \<Union> C'
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Ball (C \<union> {- T}) open
S \<subseteq> \<Union> (C \<union> {- T})
[PROOF STEP]
have "\<exists>D\<subseteq>C \<union> {- T}. finite D \<and> S \<subseteq> \<Union>D"
[PROOF STATE]
proof (prove)
using this:
Ball (C \<union> {- T}) open
S \<subseteq> \<Union> (C \<union> {- T})

goal (1 subgoal):
 1. \<exists>D\<subseteq>C \<union> {- T}. finite D \<and> S \<subseteq> \<Union> D
[PROOF STEP]
using \<open>compact S\<close>
[PROOF STATE]
proof (prove)
using this:
Ball (C \<union> {- T}) open
S \<subseteq> \<Union> (C \<union> {- T})
compact S

goal (1 subgoal):
 1. \<exists>D\<subseteq>C \<union> {- T}. finite D \<and> S \<subseteq> \<Union> D
[PROOF STEP]
unfolding compact_eq_Heine_Borel
[PROOF STATE]
proof (prove)
using this:
Ball (C \<union> {- T}) open
S \<subseteq> \<Union> (C \<union> {- T})
\<forall>C. Ball C open \<and> S \<subseteq> \<Union> C \<longrightarrow> (\<exists>D\<subseteq>C. finite D \<and> S \<subseteq> \<Union> D)

goal (1 subgoal):
 1. \<exists>D\<subseteq>C \<union> {- T}. finite D \<and> S \<subseteq> \<Union> D
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>D\<subseteq>C \<union> {- T}. finite D \<and> S \<subseteq> \<Union> D

goal (1 subgoal):
 1. \<And>C. \<lbrakk>Ball C open; S \<inter> T \<subseteq> \<Union> C\<rbrakk> \<Longrightarrow> \<exists>C'\<subseteq>C. finite C' \<and> S \<inter> T \<subseteq> \<Union> C'
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>D\<subseteq>C \<union> {- T}. finite D \<and> S \<subseteq> \<Union> D
[PROOF STEP]
obtain D where "D \<subseteq> C \<union> {- T} \<and> finite D \<and> S \<subseteq> \<Union>D"
[PROOF STATE]
proof (prove)
using this:
\<exists>D\<subseteq>C \<union> {- T}. finite D \<and> S \<subseteq> \<Union> D

goal (1 subgoal):
 1. (\<And>D. D \<subseteq> C \<union> {- T} \<and> finite D \<and> S \<subseteq> \<Union> D \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
D \<subseteq> C \<union> {- T} \<and> finite D \<and> S \<subseteq> \<Union> D

goal (1 subgoal):
 1. \<And>C. \<lbrakk>Ball C open; S \<inter> T \<subseteq> \<Union> C\<rbrakk> \<Longrightarrow> \<exists>C'\<subseteq>C. finite C' \<and> S \<inter> T \<subseteq> \<Union> C'
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
D \<subseteq> C \<union> {- T} \<and> finite D \<and> S \<subseteq> \<Union> D
[PROOF STEP]
show "\<exists>D\<subseteq>C. finite D \<and> S \<inter> T \<subseteq> \<Union>D"
[PROOF STATE]
proof (prove)
using this:
D \<subseteq> C \<union> {- T} \<and> finite D \<and> S \<subseteq> \<Union> D

goal (1 subgoal):
 1. \<exists>D\<subseteq>C. finite D \<and> S \<inter> T \<subseteq> \<Union> D
[PROOF STEP]
by (intro exI[of _ "D - {-T}"]) auto
[PROOF STATE]
proof (state)
this:
\<exists>D\<subseteq>C. finite D \<and> S \<inter> T \<subseteq> \<Union> D

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma remove_monom_monomials:
  assumes "P \<in> Pring_set R I"
  shows "monomials_of R (remove_monom R m P) = monomials_of R P - {m}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monomials_of R (remove_monom R m P) = monomials_of R P - {m}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. monomials_of R (remove_monom R m P) \<subseteq> monomials_of R P - {m}
 2. monomials_of R P - {m} \<subseteq> monomials_of R (remove_monom R m P)
[PROOF STEP]
show "monomials_of R (remove_monom R m P) \<subseteq> monomials_of R P - {m}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monomials_of R (remove_monom R m P) \<subseteq> monomials_of R P - {m}
[PROOF STEP]
using assms remove_monom_alt_def[of P I m]
[PROOF STATE]
proof (prove)
using this:
P \<in> carrier R [\<X>\<^bsub>I\<^esub>]
P \<in> carrier R [\<X>\<^bsub>I\<^esub>] \<Longrightarrow> remove_monom R m P ?n = (if ?n = m then \<zero> else P ?n)

goal (1 subgoal):
 1. monomials_of R (remove_monom R m P) \<subseteq> monomials_of R P - {m}
[PROOF STEP]
unfolding monomials_of_def
[PROOF STATE]
proof (prove)
using this:
P \<in> carrier R [\<X>\<^bsub>I\<^esub>]
P \<in> carrier R [\<X>\<^bsub>I\<^esub>] \<Longrightarrow> remove_monom R m P ?n = (if ?n = m then \<zero> else P ?n)

goal (1 subgoal):
 1. {ma. remove_monom R m P ma \<noteq> \<zero>} \<subseteq> {m. P m \<noteq> \<zero>} - {m}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
monomials_of R (remove_monom R m P) \<subseteq> monomials_of R P - {m}

goal (1 subgoal):
 1. monomials_of R P - {m} \<subseteq> monomials_of R (remove_monom R m P)
[PROOF STEP]
show "monomials_of R P - {m} \<subseteq> monomials_of R (remove_monom R m P)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monomials_of R P - {m} \<subseteq> monomials_of R (remove_monom R m P)
[PROOF STEP]
using assms remove_monom_alt_def[of P I m]
[PROOF STATE]
proof (prove)
using this:
P \<in> carrier R [\<X>\<^bsub>I\<^esub>]
P \<in> carrier R [\<X>\<^bsub>I\<^esub>] \<Longrightarrow> remove_monom R m P ?n = (if ?n = m then \<zero> else P ?n)

goal (1 subgoal):
 1. monomials_of R P - {m} \<subseteq> monomials_of R (remove_monom R m P)
[PROOF STEP]
unfolding monomials_of_def
[PROOF STATE]
proof (prove)
using this:
P \<in> carrier R [\<X>\<^bsub>I\<^esub>]
P \<in> carrier R [\<X>\<^bsub>I\<^esub>] \<Longrightarrow> remove_monom R m P ?n = (if ?n = m then \<zero> else P ?n)

goal (1 subgoal):
 1. {m. P m \<noteq> \<zero>} - {m} \<subseteq> {ma. remove_monom R m P ma \<noteq> \<zero>}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
monomials_of R P - {m} \<subseteq> monomials_of R (remove_monom R m P)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma not_AE_zero_int_ennreal_E:
  fixes f::"'a \<Rightarrow> ennreal"
  assumes "(\<integral>\<^sup>+x. f x \<partial>M) > 0"
      and [measurable]: "f \<in> borel_measurable M"
  shows "\<exists>A\<in>sets M. \<exists>e::real>0. emeasure M A > 0 \<and> (\<forall>x \<in> A. f x \<ge> e)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>A\<in>sets M. \<exists>e>0. 0 < emeasure M A \<and> (\<forall>x\<in>A. ennreal e \<le> f x)
[PROOF STEP]
proof (rule not_AE_zero_ennreal_E, auto simp add: assms)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. AE x in M. f x = 0 \<Longrightarrow> False
[PROOF STEP]
assume *: "AE x in M. f x = 0"
[PROOF STATE]
proof (state)
this:
AE x in M. f x = 0

goal (1 subgoal):
 1. AE x in M. f x = 0 \<Longrightarrow> False
[PROOF STEP]
have "(\<integral>\<^sup>+x. f x \<partial>M) = (\<integral>\<^sup>+x. 0 \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N M f = \<integral>\<^sup>+ x. 0 \<partial>M
[PROOF STEP]
by (rule nn_integral_cong_AE, simp add: *)
[PROOF STATE]
proof (state)
this:
integral\<^sup>N M f = \<integral>\<^sup>+ x. 0 \<partial>M

goal (1 subgoal):
 1. AE x in M. f x = 0 \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
integral\<^sup>N M f = \<integral>\<^sup>+ x. 0 \<partial>M
[PROOF STEP]
have "(\<integral>\<^sup>+x. f x \<partial>M) = 0"
[PROOF STATE]
proof (prove)
using this:
integral\<^sup>N M f = \<integral>\<^sup>+ x. 0 \<partial>M

goal (1 subgoal):
 1. integral\<^sup>N M f = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
integral\<^sup>N M f = 0

goal (1 subgoal):
 1. AE x in M. f x = 0 \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
integral\<^sup>N M f = 0
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
integral\<^sup>N M f = 0

goal (1 subgoal):
 1. False
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
integral\<^sup>N M f = 0
0 < integral\<^sup>N M f
f \<in> borel_measurable M

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma commute_sym: "commute R S ==> commute S R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. commute R S \<Longrightarrow> commute S R
[PROOF STEP]
apply (unfold commute_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. square R S S R \<Longrightarrow> square S R R S
[PROOF STEP]
apply (blast intro: square_sym)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma l7_9_bis:
  assumes "A Midpoint P X" and
    "A Midpoint X Q"
  shows "P = Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P = Q
[PROOF STEP]
using assms(1) assms(2) l7_2 symmetric_point_uniqueness
[PROOF STATE]
proof (prove)
using this:
A Midpoint P X
A Midpoint X Q
?M Midpoint ?A ?B \<Longrightarrow> ?M Midpoint ?B ?A
\<lbrakk>?P Midpoint ?A ?P1.0; ?P Midpoint ?A ?P2.0\<rbrakk> \<Longrightarrow> ?P1.0 = ?P2.0

goal (1 subgoal):
 1. P = Q
[PROOF STEP]
by blast


[STATEMENT]
lemma HComplex_eq_0 [simp]: "\<And>x y. HComplex x y = 0 \<longleftrightarrow> x = 0 \<and> y = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. (HComplex x y = 0) = (x = 0 \<and> y = 0)
[PROOF STEP]
by transfer (rule Complex_eq_0)


[STATEMENT]
lemma gbinomial_partial_sum_poly_xpos:
    "(\<Sum>k\<le>m. (of_nat m + a gchoose k) * x^k * y^(m-k)) =
     (\<Sum>k\<le>m. (of_nat k + a - 1 gchoose k) * x^k * (x + y)^(m-k))" (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<le>m. (of_nat m + a gchoose k) * x ^ k * y ^ (m - k)) = (\<Sum>k\<le>m. (of_nat k + a - (1::'a) gchoose k) * x ^ k * (x + y) ^ (m - k))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>k\<le>m. (of_nat m + a gchoose k) * x ^ k * y ^ (m - k)) = (\<Sum>k\<le>m. (of_nat k + a - (1::'a) gchoose k) * x ^ k * (x + y) ^ (m - k))
[PROOF STEP]
have "?lhs = (\<Sum>k\<le>m. (- a gchoose k) * (- x) ^ k * (x + y) ^ (m - k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<le>m. (of_nat m + a gchoose k) * x ^ k * y ^ (m - k)) = (\<Sum>k\<le>m. (- a gchoose k) * (- x) ^ k * (x + y) ^ (m - k))
[PROOF STEP]
by (simp add: gbinomial_partial_sum_poly)
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<le>m. (of_nat m + a gchoose k) * x ^ k * y ^ (m - k)) = (\<Sum>k\<le>m. (- a gchoose k) * (- x) ^ k * (x + y) ^ (m - k))

goal (1 subgoal):
 1. (\<Sum>k\<le>m. (of_nat m + a gchoose k) * x ^ k * y ^ (m - k)) = (\<Sum>k\<le>m. (of_nat k + a - (1::'a) gchoose k) * x ^ k * (x + y) ^ (m - k))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<le>m. (of_nat m + a gchoose k) * x ^ k * y ^ (m - k)) = (\<Sum>k\<le>m. (- a gchoose k) * (- x) ^ k * (x + y) ^ (m - k))

goal (1 subgoal):
 1. (\<Sum>k\<le>m. (of_nat m + a gchoose k) * x ^ k * y ^ (m - k)) = (\<Sum>k\<le>m. (of_nat k + a - (1::'a) gchoose k) * x ^ k * (x + y) ^ (m - k))
[PROOF STEP]
have "... = (\<Sum>k\<le>m. (-1) ^ k * (of_nat k - - a - 1 gchoose k) * (- x) ^ k * (x + y) ^ (m - k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<le>m. (- a gchoose k) * (- x) ^ k * (x + y) ^ (m - k)) = (\<Sum>k\<le>m. (- (1::'a)) ^ k * (of_nat k - - a - (1::'a) gchoose k) * (- x) ^ k * (x + y) ^ (m - k))
[PROOF STEP]
by (metis (no_types, opaque_lifting) gbinomial_negated_upper)
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<le>m. (- a gchoose k) * (- x) ^ k * (x + y) ^ (m - k)) = (\<Sum>k\<le>m. (- (1::'a)) ^ k * (of_nat k - - a - (1::'a) gchoose k) * (- x) ^ k * (x + y) ^ (m - k))

goal (1 subgoal):
 1. (\<Sum>k\<le>m. (of_nat m + a gchoose k) * x ^ k * y ^ (m - k)) = (\<Sum>k\<le>m. (of_nat k + a - (1::'a) gchoose k) * x ^ k * (x + y) ^ (m - k))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<le>m. (- a gchoose k) * (- x) ^ k * (x + y) ^ (m - k)) = (\<Sum>k\<le>m. (- (1::'a)) ^ k * (of_nat k - - a - (1::'a) gchoose k) * (- x) ^ k * (x + y) ^ (m - k))

goal (1 subgoal):
 1. (\<Sum>k\<le>m. (of_nat m + a gchoose k) * x ^ k * y ^ (m - k)) = (\<Sum>k\<le>m. (of_nat k + a - (1::'a) gchoose k) * x ^ k * (x + y) ^ (m - k))
[PROOF STEP]
have "... = ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<le>m. (- (1::'a)) ^ k * (of_nat k - - a - (1::'a) gchoose k) * (- x) ^ k * (x + y) ^ (m - k)) = (\<Sum>k\<le>m. (of_nat k + a - (1::'a) gchoose k) * x ^ k * (x + y) ^ (m - k))
[PROOF STEP]
by (intro sum.cong) (auto simp flip: power_mult_distrib)
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<le>m. (- (1::'a)) ^ k * (of_nat k - - a - (1::'a) gchoose k) * (- x) ^ k * (x + y) ^ (m - k)) = (\<Sum>k\<le>m. (of_nat k + a - (1::'a) gchoose k) * x ^ k * (x + y) ^ (m - k))

goal (1 subgoal):
 1. (\<Sum>k\<le>m. (of_nat m + a gchoose k) * x ^ k * y ^ (m - k)) = (\<Sum>k\<le>m. (of_nat k + a - (1::'a) gchoose k) * x ^ k * (x + y) ^ (m - k))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>k\<le>m. (of_nat m + a gchoose k) * x ^ k * y ^ (m - k)) = (\<Sum>k\<le>m. (of_nat k + a - (1::'a) gchoose k) * x ^ k * (x + y) ^ (m - k))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>k\<le>m. (of_nat m + a gchoose k) * x ^ k * y ^ (m - k)) = (\<Sum>k\<le>m. (of_nat k + a - (1::'a) gchoose k) * x ^ k * (x + y) ^ (m - k))

goal (1 subgoal):
 1. (\<Sum>k\<le>m. (of_nat m + a gchoose k) * x ^ k * y ^ (m - k)) = (\<Sum>k\<le>m. (of_nat k + a - (1::'a) gchoose k) * x ^ k * (x + y) ^ (m - k))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<le>m. (of_nat m + a gchoose k) * x ^ k * y ^ (m - k)) = (\<Sum>k\<le>m. (of_nat k + a - (1::'a) gchoose k) * x ^ k * (x + y) ^ (m - k))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ge_one_powr_ge_zero: "1 \<le> x \<Longrightarrow> 0 \<le> a \<Longrightarrow> 1 \<le> x powr a"
  for x :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>1 \<le> x; 0 \<le> a\<rbrakk> \<Longrightarrow> 1 \<le> x powr a
[PROOF STEP]
using powr_mono
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?a \<le> ?b; 1 \<le> ?x\<rbrakk> \<Longrightarrow> ?x powr ?a \<le> ?x powr ?b

goal (1 subgoal):
 1. \<lbrakk>1 \<le> x; 0 \<le> a\<rbrakk> \<Longrightarrow> 1 \<le> x powr a
[PROOF STEP]
by fastforce


[STATEMENT]
lemma (in domain) lagrange_aux_degree:
  assumes "finite S"
  assumes "S \<subseteq> carrier R"
  shows "degree (lagrange_basis_polynomial_aux S) \<le> card S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (lagrange_basis_polynomial_aux S) \<le> card S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. degree (lagrange_basis_polynomial_aux S) \<le> card S
[PROOF STEP]
interpret x:cring "poly_ring R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cring (poly_ring R)
[PROOF STEP]
using carrier_is_subring domain.univ_poly_is_cring domain_axioms
[PROOF STATE]
proof (prove)
using this:
subring (carrier R) R
\<lbrakk>domain ?R; subring ?K ?R\<rbrakk> \<Longrightarrow> cring (?K [X]\<^bsub>?R\<^esub>)
domain R

goal (1 subgoal):
 1. cring (poly_ring R)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. degree (lagrange_basis_polynomial_aux S) \<le> card S
[PROOF STEP]
have "degree X \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree X \<le> 1
[PROOF STEP]
by (simp add:var_def)
[PROOF STATE]
proof (state)
this:
degree X \<le> 1

goal (1 subgoal):
 1. degree (lagrange_basis_polynomial_aux S) \<le> card S
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
degree X \<le> 1

goal (1 subgoal):
 1. degree (lagrange_basis_polynomial_aux S) \<le> card S
[PROOF STEP]
have "\<And>y. y\<in> S \<Longrightarrow> degree (poly_of_const y) \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y. y \<in> S \<Longrightarrow> degree (poly_of_const y) \<le> 1
[PROOF STEP]
by (simp add:poly_of_const_def)
[PROOF STATE]
proof (state)
this:
?y \<in> S \<Longrightarrow> degree (poly_of_const ?y) \<le> 1

goal (1 subgoal):
 1. degree (lagrange_basis_polynomial_aux S) \<le> card S
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
degree X \<le> 1
?y \<in> S \<Longrightarrow> degree (poly_of_const ?y) \<le> 1
[PROOF STEP]
have a: "\<And>y. y\<in> S \<Longrightarrow> degree (X \<ominus>\<^bsub>poly_ring R\<^esub> poly_of_const y) \<le> 1"
[PROOF STATE]
proof (prove)
using this:
degree X \<le> 1
?y \<in> S \<Longrightarrow> degree (poly_of_const ?y) \<le> 1

goal (1 subgoal):
 1. \<And>y. y \<in> S \<Longrightarrow> degree (X \<ominus>\<^bsub>poly_ring R\<^esub> poly_of_const y) \<le> 1
[PROOF STEP]
by (meson assms(2) in_mono poly_of_const_in_carrier poly_sub_degree_le var_closed[OF carrier_is_subring])
[PROOF STATE]
proof (state)
this:
?y \<in> S \<Longrightarrow> degree (X \<ominus>\<^bsub>poly_ring R\<^esub> poly_of_const ?y) \<le> 1

goal (1 subgoal):
 1. degree (lagrange_basis_polynomial_aux S) \<le> card S
[PROOF STEP]
have b:"\<And>y. y \<in> S \<Longrightarrow> (X \<ominus>\<^bsub>poly_ring R\<^esub> poly_of_const y) \<in> carrier (poly_ring R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y. y \<in> S \<Longrightarrow> X \<ominus>\<^bsub>poly_ring R\<^esub> poly_of_const y \<in> carrier (poly_ring R)
[PROOF STEP]
by (meson subsetD x.minus_closed var_closed(1)[OF carrier_is_subring] poly_of_const_in_carrier assms(2))
[PROOF STATE]
proof (state)
this:
?y \<in> S \<Longrightarrow> X \<ominus>\<^bsub>poly_ring R\<^esub> poly_of_const ?y \<in> carrier (poly_ring R)

goal (1 subgoal):
 1. degree (lagrange_basis_polynomial_aux S) \<le> card S
[PROOF STEP]
have "degree (lagrange_basis_polynomial_aux S) \<le> (\<Sum>y \<in> S. degree (X \<ominus>\<^bsub>poly_ring R\<^esub> poly_of_const y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (lagrange_basis_polynomial_aux S) \<le> (\<Sum>y\<in>S. degree (X \<ominus>\<^bsub>poly_ring R\<^esub> poly_of_const y))
[PROOF STEP]
using lagrange_basis_polynomial_aux_def b poly_prod_degree_le[OF assms(1)]
[PROOF STATE]
proof (prove)
using this:
lagrange_basis_polynomial_aux ?S = (\<Otimes>\<^bsub>poly_ring R\<^esub>s\<in>?S. X \<ominus>\<^bsub>poly_ring R\<^esub> poly_of_const s)
?y \<in> S \<Longrightarrow> X \<ominus>\<^bsub>poly_ring R\<^esub> poly_of_const ?y \<in> carrier (poly_ring R)
(\<And>x. x \<in> S \<Longrightarrow> ?f x \<in> carrier (poly_ring R)) \<Longrightarrow> degree (finprod (poly_ring R) ?f S) \<le> (\<Sum>x\<in>S. degree (?f x))

goal (1 subgoal):
 1. degree (lagrange_basis_polynomial_aux S) \<le> (\<Sum>y\<in>S. degree (X \<ominus>\<^bsub>poly_ring R\<^esub> poly_of_const y))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
degree (lagrange_basis_polynomial_aux S) \<le> (\<Sum>y\<in>S. degree (X \<ominus>\<^bsub>poly_ring R\<^esub> poly_of_const y))

goal (1 subgoal):
 1. degree (lagrange_basis_polynomial_aux S) \<le> card S
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
degree (lagrange_basis_polynomial_aux S) \<le> (\<Sum>y\<in>S. degree (X \<ominus>\<^bsub>poly_ring R\<^esub> poly_of_const y))

goal (1 subgoal):
 1. degree (lagrange_basis_polynomial_aux S) \<le> card S
[PROOF STEP]
have "... \<le> (\<Sum>y \<in> S. 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>y\<in>S. degree (X \<ominus>\<^bsub>poly_ring R\<^esub> poly_of_const y)) \<le> (\<Sum>y\<in>S. 1)
[PROOF STEP]
using sum_mono a
[PROOF STATE]
proof (prove)
using this:
(\<And>i. i \<in> ?K \<Longrightarrow> ?f i \<le> ?g i) \<Longrightarrow> sum ?f ?K \<le> sum ?g ?K
?y \<in> S \<Longrightarrow> degree (X \<ominus>\<^bsub>poly_ring R\<^esub> poly_of_const ?y) \<le> 1

goal (1 subgoal):
 1. (\<Sum>y\<in>S. degree (X \<ominus>\<^bsub>poly_ring R\<^esub> poly_of_const y)) \<le> (\<Sum>y\<in>S. 1)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
(\<Sum>y\<in>S. degree (X \<ominus>\<^bsub>poly_ring R\<^esub> poly_of_const y)) \<le> (\<Sum>y\<in>S. 1)

goal (1 subgoal):
 1. degree (lagrange_basis_polynomial_aux S) \<le> card S
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>y\<in>S. degree (X \<ominus>\<^bsub>poly_ring R\<^esub> poly_of_const y)) \<le> (\<Sum>y\<in>S. 1)

goal (1 subgoal):
 1. degree (lagrange_basis_polynomial_aux S) \<le> card S
[PROOF STEP]
have "... = card S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>y\<in>S. 1) = card S
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>y\<in>S. 1) = card S

goal (1 subgoal):
 1. degree (lagrange_basis_polynomial_aux S) \<le> card S
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
degree (lagrange_basis_polynomial_aux S) \<le> card S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
degree (lagrange_basis_polynomial_aux S) \<le> card S

goal (1 subgoal):
 1. degree (lagrange_basis_polynomial_aux S) \<le> card S
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
degree (lagrange_basis_polynomial_aux S) \<le> card S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma split_vars_vars_term_list: "snd (split_vars t) = vars_term_list t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (split_vars t) = vars_term_list t
[PROOF STEP]
proof (induct t)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. snd (split_vars (Var x)) = vars_term_list (Var x)
 2. \<And>x1a x2. (\<And>x2a. x2a \<in> set x2 \<Longrightarrow> snd (split_vars x2a) = vars_term_list x2a) \<Longrightarrow> snd (split_vars (Fun x1a x2)) = vars_term_list (Fun x1a x2)
[PROOF STEP]
case (Fun f ts)
[PROOF STATE]
proof (state)
this:
?x2a \<in> set ts \<Longrightarrow> snd (split_vars ?x2a) = vars_term_list ?x2a

goal (2 subgoals):
 1. \<And>x. snd (split_vars (Var x)) = vars_term_list (Var x)
 2. \<And>x1a x2. (\<And>x2a. x2a \<in> set x2 \<Longrightarrow> snd (split_vars x2a) = vars_term_list x2a) \<Longrightarrow> snd (split_vars (Fun x1a x2)) = vars_term_list (Fun x1a x2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?x2a \<in> set ts \<Longrightarrow> snd (split_vars ?x2a) = vars_term_list ?x2a
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
?x2a \<in> set ts \<Longrightarrow> snd (split_vars ?x2a) = vars_term_list ?x2a

goal (1 subgoal):
 1. snd (split_vars (Fun f ts)) = vars_term_list (Fun f ts)
[PROOF STEP]
by (auto simp: vars_term_list.simps o_def, induct ts, auto)
[PROOF STATE]
proof (state)
this:
snd (split_vars (Fun f ts)) = vars_term_list (Fun f ts)

goal (1 subgoal):
 1. \<And>x. snd (split_vars (Var x)) = vars_term_list (Var x)
[PROOF STEP]
qed (auto simp: vars_term_list.simps)


[STATEMENT]
lemma deriv_left_inverse:
  assumes "f holomorphic_on S" and "g holomorphic_on T"
      and "open S" and "open T"
      and "f ` S \<subseteq> T"
      and [simp]: "\<And>z. z \<in> S \<Longrightarrow> g (f z) = z"
      and "w \<in> S"
    shows "deriv f w * deriv g (f w) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deriv f w * deriv g (f w) = 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. deriv f w * deriv g (f w) = 1
[PROOF STEP]
have "deriv f w * deriv g (f w) = deriv g (f w) * deriv f w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deriv f w * deriv g (f w) = deriv g (f w) * deriv f w
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
deriv f w * deriv g (f w) = deriv g (f w) * deriv f w

goal (1 subgoal):
 1. deriv f w * deriv g (f w) = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
deriv f w * deriv g (f w) = deriv g (f w) * deriv f w

goal (1 subgoal):
 1. deriv f w * deriv g (f w) = 1
[PROOF STEP]
have "... = deriv (g o f) w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deriv g (f w) * deriv f w = deriv (g \<circ> f) w
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f holomorphic_on S
g holomorphic_on T
open S
open T
f ` S \<subseteq> T
?z \<in> S \<Longrightarrow> g (f ?z) = ?z
w \<in> S

goal (1 subgoal):
 1. deriv g (f w) * deriv f w = deriv (g \<circ> f) w
[PROOF STEP]
by (metis analytic_on_imp_differentiable_at analytic_on_open deriv_chain image_subset_iff)
[PROOF STATE]
proof (state)
this:
deriv g (f w) * deriv f w = deriv (g \<circ> f) w

goal (1 subgoal):
 1. deriv f w * deriv g (f w) = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
deriv g (f w) * deriv f w = deriv (g \<circ> f) w

goal (1 subgoal):
 1. deriv f w * deriv g (f w) = 1
[PROOF STEP]
have "... = deriv id w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deriv (g \<circ> f) w = deriv id w
[PROOF STEP]
apply (rule complex_derivative_transform_within_open [where s=S])
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. g \<circ> f holomorphic_on S
 2. id holomorphic_on S
 3. open S
 4. w \<in> S
 5. \<And>w. w \<in> S \<Longrightarrow> (g \<circ> f) w = id w
[PROOF STEP]
apply (rule assms holomorphic_on_compose_gen holomorphic_intros)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>w. w \<in> S \<Longrightarrow> (g \<circ> f) w = id w
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
deriv (g \<circ> f) w = deriv id w

goal (1 subgoal):
 1. deriv f w * deriv g (f w) = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
deriv (g \<circ> f) w = deriv id w

goal (1 subgoal):
 1. deriv f w * deriv g (f w) = 1
[PROOF STEP]
have "... = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deriv id w = 1
[PROOF STEP]
using higher_deriv_id [of 1]
[PROOF STATE]
proof (prove)
using this:
(deriv ^^ 1) id ?z = (if 1 = 0 then ?z else if 1 = 1 then 1::?'a else (0::?'a))

goal (1 subgoal):
 1. deriv id w = 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
deriv id w = 1

goal (1 subgoal):
 1. deriv f w * deriv g (f w) = 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
deriv f w * deriv g (f w) = 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
deriv f w * deriv g (f w) = 1

goal (1 subgoal):
 1. deriv f w * deriv g (f w) = 1
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
deriv f w * deriv g (f w) = 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vlrestriction_vcomp[simp]: "(r \<circ>\<^sub>\<circ> s) \<restriction>\<^sup>l\<^sub>\<circ> A = r \<circ>\<^sub>\<circ> (s \<restriction>\<^sup>l\<^sub>\<circ> A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (r \<circ>\<^sub>\<circ> s) \<restriction>\<^sup>l\<^sub>\<circ> A = r \<circ>\<^sub>\<circ> s \<restriction>\<^sup>l\<^sub>\<circ> A
[PROOF STEP]
by auto


[STATEMENT]
lemma fcard_finsert_disjoint:
  "x |\<notin>| A \<Longrightarrow> fcard (finsert x A) = Suc (fcard A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x |\<notin>| A \<Longrightarrow> fcard (finsert x A) = Suc (fcard A)
[PROOF STEP]
by transfer (rule card_insert_disjoint)


[STATEMENT]
lemma coeff_of_qr_zero:
assumes "i\<ge>n"
shows "poly.coeff (of_qr (f :: 'a qr)) i = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly.coeff (of_qr f) i = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. poly.coeff (of_qr f) i = 0
[PROOF STEP]
have "degree (of_qr f) < i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (of_qr f) < i
[PROOF STEP]
using deg_of_qr deg_qr_n assms order_less_le_trans
[PROOF STATE]
proof (prove)
using this:
degree (of_qr ?x) < deg_qr TYPE('a)
int (deg_qr TYPE('a)) = int n
n \<le> i
\<lbrakk>?x < ?y; ?y \<le> ?z\<rbrakk> \<Longrightarrow> ?x < ?z

goal (1 subgoal):
 1. degree (of_qr f) < i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
degree (of_qr f) < i

goal (1 subgoal):
 1. poly.coeff (of_qr f) i = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
degree (of_qr f) < i
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
degree (of_qr f) < i

goal (1 subgoal):
 1. poly.coeff (of_qr f) i = 0
[PROOF STEP]
by (subst coeff_eq_0, auto)
[PROOF STATE]
proof (state)
this:
poly.coeff (of_qr f) i = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma isMaxim_zero: "isMaxim A zero \<Longrightarrow> A = {zero}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isMaxim A local.zero \<Longrightarrow> A = {local.zero}
[PROOF STEP]
unfolding isMaxim_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.zero \<in> A \<and> (\<forall>a\<in>A. (a, local.zero) \<in> r) \<Longrightarrow> A = {local.zero}
[PROOF STEP]
by auto


[STATEMENT]
lemma is_zero_row_imp_is_zero_row_upt:
assumes "is_zero_row i A"
shows "is_zero_row_upt_k i k A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_zero_row_upt_k i k A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_zero_row i A

goal (1 subgoal):
 1. is_zero_row_upt_k i k A
[PROOF STEP]
unfolding  is_zero_row_def is_zero_row_upt_k_def ncols_def
[PROOF STATE]
proof (prove)
using this:
\<forall>j. mod_type_class.to_nat j < CARD('c) \<longrightarrow> A $ i $ j = (0::'b)

goal (1 subgoal):
 1. \<forall>j. mod_type_class.to_nat j < k \<longrightarrow> A $ i $ j = (0::'b)
[PROOF STEP]
by simp


[STATEMENT]
lemma diff_fract [simp]:
  "\<lbrakk> b \<noteq> 0; d \<noteq> 0 \<rbrakk> \<Longrightarrow> Fract a b - Fract c d = Fract (a * d - c * b) (b * d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>b \<noteq> (0::'a); d \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> Fract a b - Fract c d = Fract (a * d - c * b) (b * d)
[PROOF STEP]
by (simp add: diff_fract_def)


[STATEMENT]
lemma bounded_subset_ballD:
  assumes "bounded S" shows "\<exists>r. 0 < r \<and> S \<subseteq> ball x r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>r>0. S \<subseteq> ball x r
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>r>0. S \<subseteq> ball x r
[PROOF STEP]
obtain e::real and y where "S \<subseteq> cball y e" "0 \<le> e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>y e. \<lbrakk>S \<subseteq> cball y e; 0 \<le> e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
bounded S

goal (1 subgoal):
 1. (\<And>y e. \<lbrakk>S \<subseteq> cball y e; 0 \<le> e\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: bounded_subset_cball)
[PROOF STATE]
proof (state)
this:
S \<subseteq> cball y e
0 \<le> e

goal (1 subgoal):
 1. \<exists>r>0. S \<subseteq> ball x r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
S \<subseteq> cball y e
0 \<le> e
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
S \<subseteq> cball y e
0 \<le> e

goal (1 subgoal):
 1. \<exists>r>0. S \<subseteq> ball x r
[PROOF STEP]
by (intro exI[where x="dist x y + e + 1"]) metric
[PROOF STATE]
proof (state)
this:
\<exists>r>0. S \<subseteq> ball x r

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma absolutely_integrable_on_scaleR_iff:
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
  shows
   "(\<lambda>x. c *\<^sub>R f x) absolutely_integrable_on S \<longleftrightarrow>
      c = 0 \<or> f absolutely_integrable_on S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. c *\<^sub>R f x) absolutely_integrable_on S) = (c = 0 \<or> f absolutely_integrable_on S)
[PROOF STEP]
proof (cases "c=0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. c = 0 \<Longrightarrow> ((\<lambda>x. c *\<^sub>R f x) absolutely_integrable_on S) = (c = 0 \<or> f absolutely_integrable_on S)
 2. c \<noteq> 0 \<Longrightarrow> ((\<lambda>x. c *\<^sub>R f x) absolutely_integrable_on S) = (c = 0 \<or> f absolutely_integrable_on S)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
c \<noteq> 0

goal (2 subgoals):
 1. c = 0 \<Longrightarrow> ((\<lambda>x. c *\<^sub>R f x) absolutely_integrable_on S) = (c = 0 \<or> f absolutely_integrable_on S)
 2. c \<noteq> 0 \<Longrightarrow> ((\<lambda>x. c *\<^sub>R f x) absolutely_integrable_on S) = (c = 0 \<or> f absolutely_integrable_on S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c \<noteq> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
c \<noteq> 0

goal (1 subgoal):
 1. ((\<lambda>x. c *\<^sub>R f x) absolutely_integrable_on S) = (c = 0 \<or> f absolutely_integrable_on S)
[PROOF STEP]
unfolding absolutely_integrable_on_def
[PROOF STATE]
proof (prove)
using this:
c \<noteq> 0

goal (1 subgoal):
 1. ((\<lambda>x. c *\<^sub>R f x) integrable_on S \<and> (\<lambda>x. norm (c *\<^sub>R f x)) integrable_on S) = (c = 0 \<or> f integrable_on S \<and> (\<lambda>x. norm (f x)) integrable_on S)
[PROOF STEP]
by (simp add: norm_mult)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. c *\<^sub>R f x) absolutely_integrable_on S) = (c = 0 \<or> f absolutely_integrable_on S)

goal (1 subgoal):
 1. c = 0 \<Longrightarrow> ((\<lambda>x. c *\<^sub>R f x) absolutely_integrable_on S) = (c = 0 \<or> f absolutely_integrable_on S)
[PROOF STEP]
qed auto


[STATEMENT]
lemma square_part_odd_power:
  "odd n \<Longrightarrow> square_part (x ^ n) = normalize (x ^ (n div 2) * square_part x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. odd n \<Longrightarrow> square_part (x ^ n) = normalize (x ^ (n div 2) * square_part x)
[PROOF STEP]
by (subst square_part_odd_power' [symmetric]) auto


[STATEMENT]
lemma (in group_action) inj_prop:
  "\<And> g. g \<in> carrier G \<Longrightarrow> inj_on (\<phi> g) E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>g. g \<in> carrier G \<Longrightarrow> inj_on (\<phi> g) E
[PROOF STEP]
using bij_prop0
[PROOF STATE]
proof (prove)
using this:
?g \<in> carrier G \<Longrightarrow> \<phi> ?g \<in> Bij E

goal (1 subgoal):
 1. \<And>g. g \<in> carrier G \<Longrightarrow> inj_on (\<phi> g) E
[PROOF STEP]
by (simp add: Bij_def bij_betw_def)


[STATEMENT]
lemma Lambert_W_times_exp_self':
  assumes "x \<ge> -exp (-1)"
  shows   "exp (Lambert_W x) * Lambert_W x = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp (Lambert_W x) * Lambert_W x = x
[PROOF STEP]
using Lambert_W_times_exp_self[of x] assms
[PROOF STATE]
proof (prove)
using this:
- exp (- 1) \<le> x \<Longrightarrow> Lambert_W x * exp (Lambert_W x) = x
- exp (- 1) \<le> x

goal (1 subgoal):
 1. exp (Lambert_W x) * Lambert_W x = x
[PROOF STEP]
by (simp add: mult_ac)


[STATEMENT]
lemma aff_dim_UNIV [simp]: "aff_dim (UNIV :: 'n::euclidean_space set) = int(DIM('n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aff_dim UNIV = int DIM('n)
[PROOF STEP]
using aff_dim_subspace[of "(UNIV :: 'n::euclidean_space set)"]
    dim_UNIV[where 'a="'n::euclidean_space"]
[PROOF STATE]
proof (prove)
using this:
subspace UNIV \<Longrightarrow> aff_dim UNIV = int (dim UNIV)
dim UNIV = DIM('n)

goal (1 subgoal):
 1. aff_dim UNIV = int DIM('n)
[PROOF STEP]
by auto


[STATEMENT]
lemma Rep_zimage_eq: "Rep_zet (zimage f A) = image f (Rep_zet A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Rep_zet (zimage f A) = f ` Rep_zet A
[PROOF STEP]
apply (simp add: zimage_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Rep_zet (Abs_zet (f ` Rep_zet A)) = f ` Rep_zet A
[PROOF STEP]
apply (subst Abs_zet_inverse)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. f ` Rep_zet A \<in> zet
 2. f ` Rep_zet A = f ` Rep_zet A
[PROOF STEP]
apply (simp_all add: Rep_zet zet_image_mem)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma cauchy_not_vanishes:
  assumes X: "cauchy X"
    and nz: "\<not> vanishes X"
  shows "\<exists>b>0. \<exists>k. \<forall>n\<ge>k. b < \<bar>X n\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>b>0. \<exists>k. \<forall>n\<ge>k. b < \<bar>X n\<bar>
[PROOF STEP]
using cauchy_not_vanishes_cases [OF assms]
[PROOF STATE]
proof (prove)
using this:
\<exists>b>0. \<exists>k. (\<forall>n\<ge>k. b < - X n) \<or> (\<forall>n\<ge>k. b < X n)

goal (1 subgoal):
 1. \<exists>b>0. \<exists>k. \<forall>n\<ge>k. b < \<bar>X n\<bar>
[PROOF STEP]
by (elim ex_forward conj_forward asm_rl) auto


[STATEMENT]
lemma less_eq_multiset\<^sub>H\<^sub>O:
  "M \<le> N \<longleftrightarrow> (\<forall>y. count N y < count M y \<longrightarrow> (\<exists>x. y < x \<and> count M x < count N x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (M \<le> N) = (\<forall>y. count N y < count M y \<longrightarrow> (\<exists>x>y. count M x < count N x))
[PROOF STEP]
by (auto simp: less_eq_multiset_def less_multiset\<^sub>H\<^sub>O)


[STATEMENT]
lemma inj_on_hom_induced_inclusion:
  assumes "S = {} \<or> S retract_of_space X"
  shows "inj_on (hom_induced p (subtopology X S) {} X {} id) (carrier (homology_group p (subtopology X S)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (hom_induced p (subtopology X S) {} X {} id) (carrier (homology_group p (subtopology X S)))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
S = {} \<or> S retract_of_space X

goal (1 subgoal):
 1. inj_on (hom_induced p (subtopology X S) {} X {} id) (carrier (homology_group p (subtopology X S)))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. S = {} \<Longrightarrow> inj_on (hom_induced p (subtopology X S) {} X {} id) (carrier (homology_group p (subtopology X S)))
 2. S retract_of_space X \<Longrightarrow> inj_on (hom_induced p (subtopology X S) {} X {} id) (carrier (homology_group p (subtopology X S)))
[PROOF STEP]
assume "S = {}"
[PROOF STATE]
proof (state)
this:
S = {}

goal (2 subgoals):
 1. S = {} \<Longrightarrow> inj_on (hom_induced p (subtopology X S) {} X {} id) (carrier (homology_group p (subtopology X S)))
 2. S retract_of_space X \<Longrightarrow> inj_on (hom_induced p (subtopology X S) {} X {} id) (carrier (homology_group p (subtopology X S)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
S = {}
[PROOF STEP]
have "trivial_group(homology_group p (subtopology X S))"
[PROOF STATE]
proof (prove)
using this:
S = {}

goal (1 subgoal):
 1. trivial_group (homology_group p (subtopology X S))
[PROOF STEP]
by (auto simp: topspace_subtopology intro: trivial_homology_group_empty)
[PROOF STATE]
proof (state)
this:
trivial_group (homology_group p (subtopology X S))

goal (2 subgoals):
 1. S = {} \<Longrightarrow> inj_on (hom_induced p (subtopology X S) {} X {} id) (carrier (homology_group p (subtopology X S)))
 2. S retract_of_space X \<Longrightarrow> inj_on (hom_induced p (subtopology X S) {} X {} id) (carrier (homology_group p (subtopology X S)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
trivial_group (homology_group p (subtopology X S))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
trivial_group (homology_group p (subtopology X S))

goal (1 subgoal):
 1. inj_on (hom_induced p (subtopology X S) {} X {} id) (carrier (homology_group p (subtopology X S)))
[PROOF STEP]
by (auto simp: inj_on_def trivial_group_def)
[PROOF STATE]
proof (state)
this:
inj_on (hom_induced p (subtopology X S) {} X {} id) (carrier (homology_group p (subtopology X S)))

goal (1 subgoal):
 1. S retract_of_space X \<Longrightarrow> inj_on (hom_induced p (subtopology X S) {} X {} id) (carrier (homology_group p (subtopology X S)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. S retract_of_space X \<Longrightarrow> inj_on (hom_induced p (subtopology X S) {} X {} id) (carrier (homology_group p (subtopology X S)))
[PROOF STEP]
assume "S retract_of_space X"
[PROOF STATE]
proof (state)
this:
S retract_of_space X

goal (1 subgoal):
 1. S retract_of_space X \<Longrightarrow> inj_on (hom_induced p (subtopology X S) {} X {} id) (carrier (homology_group p (subtopology X S)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
S retract_of_space X
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
S retract_of_space X

goal (1 subgoal):
 1. inj_on (hom_induced p (subtopology X S) {} X {} id) (carrier (homology_group p (subtopology X S)))
[PROOF STEP]
by (simp add: retract_of_space_section_map inj_on_hom_induced_section_map)
[PROOF STATE]
proof (state)
this:
inj_on (hom_induced p (subtopology X S) {} X {} id) (carrier (homology_group p (subtopology X S)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma choose_mult_lemma:
  "((m + r + k) choose (m + k)) * ((m + k) choose k) = ((m + r + k) choose k) * ((m + r) choose m)"
  (is "?lhs = _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (m + r + k choose (m + k)) * (m + k choose k) = (m + r + k choose k) * (m + r choose m)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (m + r + k choose (m + k)) * (m + k choose k) = (m + r + k choose k) * (m + r choose m)
[PROOF STEP]
have "?lhs =
      fact (m + r + k) div (fact (m + k) * fact (m + r - m)) * (fact (m + k) div (fact k * fact m))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (m + r + k choose (m + k)) * (m + k choose k) = fact (m + r + k) div (fact (m + k) * fact (m + r - m)) * (fact (m + k) div (fact k * fact m))
[PROOF STEP]
by (simp add: binomial_altdef_nat)
[PROOF STATE]
proof (state)
this:
(m + r + k choose (m + k)) * (m + k choose k) = fact (m + r + k) div (fact (m + k) * fact (m + r - m)) * (fact (m + k) div (fact k * fact m))

goal (1 subgoal):
 1. (m + r + k choose (m + k)) * (m + k choose k) = (m + r + k choose k) * (m + r choose m)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(m + r + k choose (m + k)) * (m + k choose k) = fact (m + r + k) div (fact (m + k) * fact (m + r - m)) * (fact (m + k) div (fact k * fact m))

goal (1 subgoal):
 1. (m + r + k choose (m + k)) * (m + k choose k) = (m + r + k choose k) * (m + r choose m)
[PROOF STEP]
have "... = fact (m + r + k) * fact (m + k) div
                 (fact (m + k) * fact (m + r - m) * (fact k * fact m))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fact (m + r + k) div (fact (m + k) * fact (m + r - m)) * (fact (m + k) div (fact k * fact m)) = fact (m + r + k) * fact (m + k) div (fact (m + k) * fact (m + r - m) * (fact k * fact m))
[PROOF STEP]
by (metis add_implies_diff add_le_mono1 choose_dvd diff_cancel2 div_mult_div_if_dvd le_add1 le_add2)
[PROOF STATE]
proof (state)
this:
fact (m + r + k) div (fact (m + k) * fact (m + r - m)) * (fact (m + k) div (fact k * fact m)) = fact (m + r + k) * fact (m + k) div (fact (m + k) * fact (m + r - m) * (fact k * fact m))

goal (1 subgoal):
 1. (m + r + k choose (m + k)) * (m + k choose k) = (m + r + k choose k) * (m + r choose m)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fact (m + r + k) div (fact (m + k) * fact (m + r - m)) * (fact (m + k) div (fact k * fact m)) = fact (m + r + k) * fact (m + k) div (fact (m + k) * fact (m + r - m) * (fact k * fact m))

goal (1 subgoal):
 1. (m + r + k choose (m + k)) * (m + k choose k) = (m + r + k choose k) * (m + r choose m)
[PROOF STEP]
have "\<dots> = fact (m + r + k) div (fact r * (fact k * fact m))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fact (m + r + k) * fact (m + k) div (fact (m + k) * fact (m + r - m) * (fact k * fact m)) = fact (m + r + k) div (fact r * (fact k * fact m))
[PROOF STEP]
by (auto simp: algebra_simps fact_fact_dvd_fact)
[PROOF STATE]
proof (state)
this:
fact (m + r + k) * fact (m + k) div (fact (m + k) * fact (m + r - m) * (fact k * fact m)) = fact (m + r + k) div (fact r * (fact k * fact m))

goal (1 subgoal):
 1. (m + r + k choose (m + k)) * (m + k choose k) = (m + r + k choose k) * (m + r choose m)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fact (m + r + k) * fact (m + k) div (fact (m + k) * fact (m + r - m) * (fact k * fact m)) = fact (m + r + k) div (fact r * (fact k * fact m))

goal (1 subgoal):
 1. (m + r + k choose (m + k)) * (m + k choose k) = (m + r + k choose k) * (m + r choose m)
[PROOF STEP]
have "\<dots> = (fact (m + r + k) * fact (m + r)) div (fact r * (fact k * fact m) * fact (m + r))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fact (m + r + k) div (fact r * (fact k * fact m)) = fact (m + r + k) * fact (m + r) div (fact r * (fact k * fact m) * fact (m + r))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fact (m + r + k) div (fact r * (fact k * fact m)) = fact (m + r + k) * fact (m + r) div (fact r * (fact k * fact m) * fact (m + r))

goal (1 subgoal):
 1. (m + r + k choose (m + k)) * (m + k choose k) = (m + r + k choose k) * (m + r choose m)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fact (m + r + k) div (fact r * (fact k * fact m)) = fact (m + r + k) * fact (m + r) div (fact r * (fact k * fact m) * fact (m + r))

goal (1 subgoal):
 1. (m + r + k choose (m + k)) * (m + k choose k) = (m + r + k choose k) * (m + r choose m)
[PROOF STEP]
have "\<dots> =
      (fact (m + r + k) div (fact k * fact (m + r)) * (fact (m + r) div (fact r * fact m)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fact (m + r + k) * fact (m + r) div (fact r * (fact k * fact m) * fact (m + r)) = fact (m + r + k) div (fact k * fact (m + r)) * (fact (m + r) div (fact r * fact m))
[PROOF STEP]
by (auto simp: div_mult_div_if_dvd fact_fact_dvd_fact algebra_simps)
[PROOF STATE]
proof (state)
this:
fact (m + r + k) * fact (m + r) div (fact r * (fact k * fact m) * fact (m + r)) = fact (m + r + k) div (fact k * fact (m + r)) * (fact (m + r) div (fact r * fact m))

goal (1 subgoal):
 1. (m + r + k choose (m + k)) * (m + k choose k) = (m + r + k choose k) * (m + r choose m)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(m + r + k choose (m + k)) * (m + k choose k) = fact (m + r + k) div (fact k * fact (m + r)) * (fact (m + r) div (fact r * fact m))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(m + r + k choose (m + k)) * (m + k choose k) = fact (m + r + k) div (fact k * fact (m + r)) * (fact (m + r) div (fact r * fact m))

goal (1 subgoal):
 1. (m + r + k choose (m + k)) * (m + k choose k) = (m + r + k choose k) * (m + r choose m)
[PROOF STEP]
by (simp add: binomial_altdef_nat mult.commute)
[PROOF STATE]
proof (state)
this:
(m + r + k choose (m + k)) * (m + k choose k) = (m + r + k choose k) * (m + r choose m)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma soundI:"(\<And>I. is_interp I \<Longrightarrow> (\<And>i. i \<ge> 0 \<Longrightarrow> i < length SG \<Longrightarrow> seq_sem I (nth SG i) = UNIV) \<Longrightarrow> seq_sem I G = UNIV) \<Longrightarrow> sound (SG,G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>I. \<lbrakk>is_interp I; \<And>i. \<lbrakk>0 \<le> i; i < length SG\<rbrakk> \<Longrightarrow> seq_sem I (SG ! i) = UNIV\<rbrakk> \<Longrightarrow> seq_sem I G = UNIV) \<Longrightarrow> sound (SG, G)
[PROOF STEP]
unfolding sound_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>I. \<lbrakk>is_interp I; \<And>i. \<lbrakk>0 \<le> i; i < length SG\<rbrakk> \<Longrightarrow> seq_sem I (SG ! i) = UNIV\<rbrakk> \<Longrightarrow> seq_sem I G = UNIV) \<Longrightarrow> \<forall>I. is_interp I \<longrightarrow> (\<forall>i\<ge>0. i < length (fst (SG, G)) \<longrightarrow> seq_sem I (fst (SG, G) ! i) = UNIV) \<longrightarrow> seq_sem I (snd (SG, G)) = UNIV
[PROOF STEP]
by auto


[STATEMENT]
lemma RDirProd_list_iso2:
  "Hilbert_Choice.inv (\<lambda>(a, as). a # as) \<in> ring_iso (RDirProd_list (R # Rs)) (RDirProd R (RDirProd_list Rs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv (\<lambda>(a, as). a # as) \<in> ring_iso (RDirProd_list (R # Rs)) (RDirProd R (RDirProd_list Rs))
[PROOF STEP]
unfolding RDirProd_list_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv (\<lambda>(a, as). a # as) \<in> ring_iso (foldr (\<lambda>R S. image_ring (\<lambda>(x, y). x # y) (RDirProd R S)) (R # Rs) nil_ring) (RDirProd R (foldr (\<lambda>R S. image_ring (\<lambda>(x, y). x # y) (RDirProd R S)) Rs nil_ring))
[PROOF STEP]
by (auto intro: inj_imp_image_ring_inv_iso simp add: inj_def)


[STATEMENT]
lemma Conversion_invs [simp]: "LengthF (inv\<^sub>C x) = inverse (LengthF x)" "MassF (inv\<^sub>C x) = inverse (MassF x)"
  "TimeF (inv\<^sub>C x) = inverse (TimeF x)" "CurrentF (inv\<^sub>C x) = inverse (CurrentF x)"
  "TemperatureF (inv\<^sub>C x) = inverse (TemperatureF x)" "AmountF (inv\<^sub>C x) = inverse (AmountF x)"
  "IntensityF (inv\<^sub>C x) = inverse (IntensityF x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LengthF (inv\<^sub>C x) = inverse (LengthF x) &&& MassF (inv\<^sub>C x) = inverse (MassF x) &&& TimeF (inv\<^sub>C x) = inverse (TimeF x)) &&& (CurrentF (inv\<^sub>C x) = inverse (CurrentF x) &&& TemperatureF (inv\<^sub>C x) = inverse (TemperatureF x)) &&& AmountF (inv\<^sub>C x) = inverse (AmountF x) &&& IntensityF (inv\<^sub>C x) = inverse (IntensityF x)
[PROOF STEP]
by (transfer, simp)+


[STATEMENT]
lemma [code_abbrev]:
 "(of_rat (- 1) :: real) = - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_rat (- 1) = - 1
[PROOF STEP]
by simp


[STATEMENT]
lemma (in category) cat_cf_hom_cat_Set_is_arr':
  assumes "gf : [a, b]\<^sub>\<circ> \<mapsto>\<^bsub>op_cat \<CC> \<times>\<^sub>C \<CC>\<^esub> [c, d]\<^sub>\<circ>"
    and "\<AA>' = Hom \<CC> a b"
    and "\<BB>' = Hom \<CC> c d"
    and "\<CC>' = cat_Set \<alpha>"
  shows "cf_hom \<CC> gf : \<AA>' \<mapsto>\<^bsub>\<CC>'\<^esub> \<BB>'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cf_hom \<CC> gf : \<AA>' \<mapsto>\<^bsub>\<CC>'\<^esub> \<BB>'
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
gf : [a, b]\<^sub>\<circ> \<mapsto>\<^bsub>op_cat \<CC> \<times>\<^sub>C \<CC>\<^esub> [c, d]\<^sub>\<circ>

goal (1 subgoal):
 1. cf_hom \<CC> gf : \<AA>' \<mapsto>\<^bsub>\<CC>'\<^esub> \<BB>'
[PROOF STEP]
unfolding assms(2-4)
[PROOF STATE]
proof (prove)
using this:
gf : [a, b]\<^sub>\<circ> \<mapsto>\<^bsub>op_cat \<CC> \<times>\<^sub>C \<CC>\<^esub> [c, d]\<^sub>\<circ>

goal (1 subgoal):
 1. cf_hom \<CC> gf : Hom \<CC> a b \<mapsto>\<^bsub>cat_Set \<alpha>\<^esub> Hom \<CC> c d
[PROOF STEP]
by (rule cat_cf_hom_cat_Set_is_arr)


[STATEMENT]
lemma increasing_nat2Nat[rule_format]: "0 < n \<longrightarrow> Elem (nat2Nat (n - 1)) (nat2Nat n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n \<longrightarrow> Elem (nat2Nat (n - 1)) (nat2Nat n)
[PROOF STEP]
apply (case_tac "\<exists>m. n = Suc m")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<exists>m. n = Suc m \<Longrightarrow> 0 < n \<longrightarrow> Elem (nat2Nat (n - 1)) (nat2Nat n)
 2. \<nexists>m. n = Suc m \<Longrightarrow> 0 < n \<longrightarrow> Elem (nat2Nat (n - 1)) (nat2Nat n)
[PROOF STEP]
apply (auto simp add: SucNat_def union Singleton)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>m. n \<noteq> Suc m; 0 < n\<rbrakk> \<Longrightarrow> Elem (nat2Nat (n - Suc 0)) (nat2Nat n)
[PROOF STEP]
apply (drule spec[where x="n - 1"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < n; n \<noteq> Suc (n - 1)\<rbrakk> \<Longrightarrow> Elem (nat2Nat (n - Suc 0)) (nat2Nat n)
[PROOF STEP]
apply arith
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma inorder_splay: "inorder(splay x t) = inorder t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inorder (Splay_Map.splay x t) = inorder t
[PROOF STEP]
by(induction x t rule: splay.induct)
  (auto simp: neq_Leaf_iff split: tree.split)


[STATEMENT]
lemma msetext_dersh_mono_strong:
  "(\<forall>y \<in> set ys. \<forall>x \<in> set xs. gt y x \<longrightarrow> gt' y x) \<Longrightarrow> msetext_dersh gt ys xs \<Longrightarrow>
  msetext_dersh gt' ys xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>y\<in>set ys. \<forall>x\<in>set xs. gt y x \<longrightarrow> gt' y x; msetext_dersh gt ys xs\<rbrakk> \<Longrightarrow> msetext_dersh gt' ys xs
[PROOF STEP]
unfolding msetext_dersh_def Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>y\<in>set ys. \<forall>x\<in>set xs. gt y x \<longrightarrow> gt' y x; \<exists>Y X. Y \<noteq> {#} \<and> Y \<subseteq># mset ys \<and> mset xs = mset ys - Y + X \<and> (\<forall>x. x \<in># X \<longrightarrow> (\<exists>y. y \<in># Y \<and> gt y x))\<rbrakk> \<Longrightarrow> \<exists>Y X. Y \<noteq> {#} \<and> Y \<subseteq># mset ys \<and> mset xs = mset ys - Y + X \<and> (\<forall>x. x \<in># X \<longrightarrow> (\<exists>y. y \<in># Y \<and> gt' y x))
[PROOF STEP]
by (metis mset_subset_eqD mset_subset_eq_add_right set_mset_mset)


[STATEMENT]
lemma S00_dvd_all_A:
  assumes A: "(A::'a::comm_ring_1 mat) \<in> carrier_mat m n"
  and P: "P \<in> carrier_mat m m"
  and Q: "Q \<in> carrier_mat n n"
  and inv_P: "invertible_mat P"
  and inv_Q: "invertible_mat Q"
  and S_PAQ: "S = P*A*Q"
  and SNF_S: "Smith_normal_form_mat S"
  and i: "i<m" and j: "j<n"
shows "S$$(0,0) dvd A $$ (i,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S $$ (0, 0) dvd A $$ (i, j)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. S $$ (0, 0) dvd A $$ (i, j)
[PROOF STEP]
have S00: "(\<forall>i j. i<m \<and> j<n \<longrightarrow> S$$(0,0) dvd S$$(i,j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i j. i < m \<and> j < n \<longrightarrow> S $$ (0, 0) dvd S $$ (i, j)
[PROOF STEP]
using SNF_S
[PROOF STATE]
proof (prove)
using this:
Smith_normal_form_mat S

goal (1 subgoal):
 1. \<forall>i j. i < m \<and> j < n \<longrightarrow> S $$ (0, 0) dvd S $$ (i, j)
[PROOF STEP]
unfolding Smith_normal_form_mat_def isDiagonal_mat_def
[PROOF STATE]
proof (prove)
using this:
(\<forall>a. a + 1 < min (dim_row S) (dim_col S) \<longrightarrow> S $$ (a, a) dvd S $$ (a + 1, a + 1)) \<and> (\<forall>i j. i \<noteq> j \<and> i < dim_row S \<and> j < dim_col S \<longrightarrow> S $$ (i, j) = (0::'a))

goal (1 subgoal):
 1. \<forall>i j. i < m \<and> j < n \<longrightarrow> S $$ (0, 0) dvd S $$ (i, j)
[PROOF STEP]
by (smt P Q SNF_first_divides A S_PAQ SNF_S carrier_matD
        dvd_0_right min_less_iff_conj mult_carrier_mat)
[PROOF STATE]
proof (state)
this:
\<forall>i j. i < m \<and> j < n \<longrightarrow> S $$ (0, 0) dvd S $$ (i, j)

goal (1 subgoal):
 1. S $$ (0, 0) dvd A $$ (i, j)
[PROOF STEP]
obtain P' where PP': "inverts_mat P P'" and P'P: "inverts_mat P' P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>P'. \<lbrakk>inverts_mat P P'; inverts_mat P' P\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using inv_P
[PROOF STATE]
proof (prove)
using this:
invertible_mat P

goal (1 subgoal):
 1. (\<And>P'. \<lbrakk>inverts_mat P P'; inverts_mat P' P\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding invertible_mat_def
[PROOF STATE]
proof (prove)
using this:
square_mat P \<and> (\<exists>B. inverts_mat P B \<and> inverts_mat B P)

goal (1 subgoal):
 1. (\<And>P'. \<lbrakk>inverts_mat P P'; inverts_mat P' P\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inverts_mat P P'
inverts_mat P' P

goal (1 subgoal):
 1. S $$ (0, 0) dvd A $$ (i, j)
[PROOF STEP]
obtain Q' where QQ': "inverts_mat Q Q'" and Q'Q: "inverts_mat Q' Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>Q'. \<lbrakk>inverts_mat Q Q'; inverts_mat Q' Q\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using inv_Q
[PROOF STATE]
proof (prove)
using this:
invertible_mat Q

goal (1 subgoal):
 1. (\<And>Q'. \<lbrakk>inverts_mat Q Q'; inverts_mat Q' Q\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding invertible_mat_def
[PROOF STATE]
proof (prove)
using this:
square_mat Q \<and> (\<exists>B. inverts_mat Q B \<and> inverts_mat B Q)

goal (1 subgoal):
 1. (\<And>Q'. \<lbrakk>inverts_mat Q Q'; inverts_mat Q' Q\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inverts_mat Q Q'
inverts_mat Q' Q

goal (1 subgoal):
 1. S $$ (0, 0) dvd A $$ (i, j)
[PROOF STEP]
have A_P'SQ': "P'*S*Q' = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P' * S * Q' = A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. P' * S * Q' = A
[PROOF STEP]
have "P'*S*Q' = P'*(P*A*Q)*Q'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P' * S * Q' = P' * (P * A * Q) * Q'
[PROOF STEP]
unfolding S_PAQ
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P' * (P * A * Q) * Q' = P' * (P * A * Q) * Q'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
P' * S * Q' = P' * (P * A * Q) * Q'

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

goal (1 subgoal):
 1. P' * S * Q' = A
[PROOF STEP]
have "... = (P'*P)*A*(Q*Q')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P' * (P * A * Q) * Q' = P' * P * A * (Q * Q')
[PROOF STEP]
by (smt A PP' Q Q'Q P assoc_mult_mat carrier_mat_triv index_mult_mat(2) index_mult_mat(3)
            index_one_mat(3) inverts_mat_def right_mult_one_mat)
[PROOF STATE]
proof (state)
this:
P' * (P * A * Q) * Q' = P' * P * A * (Q * Q')

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

goal (1 subgoal):
 1. P' * S * Q' = A
[PROOF STEP]
have "... = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P' * P * A * (Q * Q') = A
[PROOF STEP]
by (metis A P'P QQ' A Q P carrier_matD(1) index_mult_mat(3) index_one_mat(3) inverts_mat_def
            left_mult_one_mat right_mult_one_mat)
[PROOF STATE]
proof (state)
this:
P' * P * A * (Q * Q') = A

goal (1 subgoal):
 1. P' * S * Q' = A
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
P' * S * Q' = A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
P' * S * Q' = A

goal (1 subgoal):
 1. P' * S * Q' = A
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
P' * S * Q' = A

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
P' * S * Q' = A

goal (1 subgoal):
 1. S $$ (0, 0) dvd A $$ (i, j)
[PROOF STEP]
have "(\<forall>i j. i<m \<and> j<n \<longrightarrow> S$$(0,0) dvd (P'*S*Q')$$(i,j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i j. i < m \<and> j < n \<longrightarrow> S $$ (0, 0) dvd (P' * S * Q') $$ (i, j)
[PROOF STEP]
proof (rule dvd_elements_mult_matrix_left_right[OF _ _ _ S00])
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. S \<in> carrier_mat m n
 2. P' \<in> carrier_mat m m
 3. Q' \<in> carrier_mat n n
[PROOF STEP]
show "S \<in> carrier_mat m n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<in> carrier_mat m n
[PROOF STEP]
using P A Q S_PAQ
[PROOF STATE]
proof (prove)
using this:
P \<in> carrier_mat m m
A \<in> carrier_mat m n
Q \<in> carrier_mat n n
S = P * A * Q

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

goal (2 subgoals):
 1. P' \<in> carrier_mat m m
 2. Q' \<in> carrier_mat n n
[PROOF STEP]
show "P' \<in> carrier_mat m m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P' \<in> carrier_mat m m
[PROOF STEP]
by (metis (mono_tags, lifting) A_P'SQ' PP' P A carrier_matD carrier_matI index_mult_mat(2)
            index_mult_mat(3) inverts_mat_def one_carrier_mat)
[PROOF STATE]
proof (state)
this:
P' \<in> carrier_mat m m

goal (1 subgoal):
 1. Q' \<in> carrier_mat n n
[PROOF STEP]
show "Q' \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Q' \<in> carrier_mat n n
[PROOF STEP]
by (metis (mono_tags, lifting) A_P'SQ' Q'Q Q A carrier_matD(2) carrier_matI
            index_mult_mat(3) inverts_mat_def one_carrier_mat)
[PROOF STATE]
proof (state)
this:
Q' \<in> carrier_mat n n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>i j. i < m \<and> j < n \<longrightarrow> S $$ (0, 0) dvd (P' * S * Q') $$ (i, j)

goal (1 subgoal):
 1. S $$ (0, 0) dvd A $$ (i, j)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>i j. i < m \<and> j < n \<longrightarrow> S $$ (0, 0) dvd (P' * S * Q') $$ (i, j)

goal (1 subgoal):
 1. S $$ (0, 0) dvd A $$ (i, j)
[PROOF STEP]
using A_P'SQ' i j
[PROOF STATE]
proof (prove)
using this:
\<forall>i j. i < m \<and> j < n \<longrightarrow> S $$ (0, 0) dvd (P' * S * Q') $$ (i, j)
P' * S * Q' = A
i < m
j < n

goal (1 subgoal):
 1. S $$ (0, 0) dvd A $$ (i, j)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
S $$ (0, 0) dvd A $$ (i, j)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma GuardK_Un [iff]: "GuardK n Ks (G Un H) = (GuardK n Ks G & GuardK n Ks H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. GuardK n Ks (G \<union> H) = (GuardK n Ks G \<and> GuardK n Ks H)
[PROOF STEP]
by (auto simp: GuardK_def)


[STATEMENT]
lemma ht_size_delete1:
  assumes size: "ht_size l n"
  assumes i: "i < length l"
  assumes snd: "snd (ls_delete k (l ! i))"
  shows "ht_size (l[i := fst (ls_delete k (l!i))]) (n - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ht_size (l[i := fst (ls_delete k (l ! i))]) (n - 1)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ht_size (l[i := fst (ls_delete k (l ! i))]) (n - 1)
[PROOF STEP]
have "(map length (l[i := fst (ls_delete k (l ! i))]))
    = (map length l)[i := length (fst (ls_delete k (l ! i)))]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map length (l[i := fst (ls_delete k (l ! i))]) = (map length l)[i := length (fst (ls_delete k (l ! i)))]
[PROOF STEP]
by (simp add: map_update)
[PROOF STATE]
proof (state)
this:
map length (l[i := fst (ls_delete k (l ! i))]) = (map length l)[i := length (fst (ls_delete k (l ! i)))]

goal (1 subgoal):
 1. ht_size (l[i := fst (ls_delete k (l ! i))]) (n - 1)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
map length (l[i := fst (ls_delete k (l ! i))]) = (map length l)[i := length (fst (ls_delete k (l ! i)))]

goal (1 subgoal):
 1. ht_size (l[i := fst (ls_delete k (l ! i))]) (n - 1)
[PROOF STEP]
from sum_list_update[of i "map length l", simplified, OF i,
    of "length (fst (ls_delete k (l ! i)))"]
    ls_delete_length_snd_True[OF snd] snd
[PROOF STATE]
proof (chain)
picking this:
sum_list ((map length l)[i := length (fst (ls_delete k (l ! i)))]) = sum_list (map length l) + length (fst (ls_delete k (l ! i))) - length (l ! i)
length (fst (ls_delete k (l ! i))) = length (l ! i) - 1
snd (ls_delete k (l ! i))
[PROOF STEP]
have "sum_list ((map length l)[i := length (fst (ls_delete k (l ! i)))])
    = sum_list (map length l) - 1"
[PROOF STATE]
proof (prove)
using this:
sum_list ((map length l)[i := length (fst (ls_delete k (l ! i)))]) = sum_list (map length l) + length (fst (ls_delete k (l ! i))) - length (l ! i)
length (fst (ls_delete k (l ! i))) = length (l ! i) - 1
snd (ls_delete k (l ! i))

goal (1 subgoal):
 1. sum_list ((map length l)[i := length (fst (ls_delete k (l ! i)))]) = sum_list (map length l) - 1
[PROOF STEP]
by (cases "length (l ! i)") (simp_all add: ls_delete_snd_set)
[PROOF STATE]
proof (state)
this:
sum_list ((map length l)[i := length (fst (ls_delete k (l ! i)))]) = sum_list (map length l) - 1

goal (1 subgoal):
 1. ht_size (l[i := fst (ls_delete k (l ! i))]) (n - 1)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sum_list (map length (l[i := fst (ls_delete k (l ! i))])) = sum_list (map length l) - 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sum_list (map length (l[i := fst (ls_delete k (l ! i))])) = sum_list (map length l) - 1

goal (1 subgoal):
 1. ht_size (l[i := fst (ls_delete k (l ! i))]) (n - 1)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
sum_list (map length (l[i := fst (ls_delete k (l ! i))])) = sum_list (map length l) - 1
ht_size l n
i < length l
snd (ls_delete k (l ! i))

goal (1 subgoal):
 1. ht_size (l[i := fst (ls_delete k (l ! i))]) (n - 1)
[PROOF STEP]
by (simp add: ht_size_def assms)
[PROOF STATE]
proof (state)
this:
ht_size (l[i := fst (ls_delete k (l ! i))]) (n - 1)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma isDERIV_mvmult_fa_nth:
  assumes "\<And>j. j < D * E \<Longrightarrow> isDERIV i (A ! j) xs"
  assumes "\<And>j. j < E \<Longrightarrow> isDERIV i (B ! j) xs"
  assumes [simp]: "length A = D * E" "length B = E" "j < D"
  shows "isDERIV i (mvmult_fa D E A B ! j) xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isDERIV i (mvmult_fa D E A B ! j) xs
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?j < D * E \<Longrightarrow> isDERIV i (A ! ?j) xs
?j < E \<Longrightarrow> isDERIV i (B ! ?j) xs
length A = D * E
length B = E
j < D

goal (1 subgoal):
 1. isDERIV i (mvmult_fa D E A B ! j) xs
[PROOF STEP]
apply (auto simp: mvmult_fa_def concat_map_map_index isDERIV_inner_iff ac_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>k. \<lbrakk>\<And>j. j < D * E \<Longrightarrow> isDERIV i (A ! j) xs; \<And>j. j < E \<Longrightarrow> isDERIV i (B ! j) xs; k < E\<rbrakk> \<Longrightarrow> isDERIV i (A ! (k + E * j)) xs
[PROOF STEP]
by (metis assms(5) in_square_lemma semiring_normalization_rules(24) semiring_normalization_rules(7))


[STATEMENT]
lemma leadsTo_Un_Un:
     "[| F \<in> A leadsTo A'; F \<in> B leadsTo B' |]
      ==> F \<in> (A \<union> B) leadsTo (A' \<union> B')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>F \<in> A \<longmapsto> A'; F \<in> B \<longmapsto> B'\<rbrakk> \<Longrightarrow> F \<in> A \<union> B \<longmapsto> A' \<union> B'
[PROOF STEP]
by (blast intro: leadsTo_Un leadsTo_weaken_R)


[STATEMENT]
lemma LIMSEQ_le_const: "X \<longlonglongrightarrow> x \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. a \<le> X n \<Longrightarrow> a \<le> x"
  for a x :: "'a::linorder_topology"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>X \<longlonglongrightarrow> x; \<exists>N. \<forall>n\<ge>N. a \<le> X n\<rbrakk> \<Longrightarrow> a \<le> x
[PROOF STEP]
by (simp add: eventually_at_top_linorder tendsto_lowerbound)


[STATEMENT]
lemma lang_eq_ext_Nil_fold_Deriv:
  fixes r s
  defines "\<BB> \<equiv> {(fold Deriv w (lang r), fold Deriv w (lang s))| w. w\<in>lists (atoms r \<union> atoms s)}"
  shows "lang r = lang s \<longleftrightarrow> (\<forall>(K, L) \<in> \<BB>. [] \<in> K \<longleftrightarrow> [] \<in> L)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (lang r = lang s) = (\<forall>(K, L)\<in>\<BB>. ([] \<in> K) = ([] \<in> L))
[PROOF STEP]
unfolding lang_eq_ext \<BB>_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>w\<in>lists (atoms r \<union> atoms s). (w \<in> lang r) = (w \<in> lang s)) = (\<forall>(K, L)\<in>{(fold Deriv w (lang r), fold Deriv w (lang s)) |w. w \<in> lists (atoms r \<union> atoms s)}. ([] \<in> K) = ([] \<in> L))
[PROOF STEP]
by (subst (1 2) in_fold_Deriv[of "[]", simplified, symmetric]) auto


[STATEMENT]
lemma (in ceuclidean_space) cinner_sum_left_CBasis[simp]:
  "b \<in> CBasis \<Longrightarrow> cinner (\<Sum>i\<in>CBasis. f i *\<^sub>C i) b = cnj (f b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<in> CBasis \<Longrightarrow> (\<Sum>i\<in>CBasis. f i *\<^sub>C i) \<bullet>\<^sub>C b = cnj (f b)
[PROOF STEP]
by (simp add: cinner_sum_left cinner_CBasis if_distrib comm_monoid_add_class.sum.If_cases)


[STATEMENT]
lemma scalar_product_Nil[simp]: "scalar_product [] xs = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. scalar_product [] xs = 0
[PROOF STEP]
by (induct xs) (auto simp: scalar_product_def)


[STATEMENT]
lemma zimage_zexplode_eq: "zimage f (zexplode z) = zexplode (Repl z f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zimage f (zexplode z) = zexplode (Repl z f)
[PROOF STEP]
by (simp add: zet_ext_eq zin_zexplode_eq Repl zimage_iff)


[STATEMENT]
lemma weakly_fair_weaken:
  assumes "(enabled' \<^bold>\<hookrightarrow> enabled) \<sigma>"
  assumes "(taken \<^bold>\<hookrightarrow> taken') \<sigma>"
  shows "(weakly_fair enabled taken \<^bold>\<hookrightarrow>  weakly_fair enabled' taken') \<sigma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<box>(\<lambda>s. weakly_fair enabled taken s \<longrightarrow> weakly_fair enabled' taken' s)) \<sigma>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(\<box>(\<lambda>s. enabled' s \<longrightarrow> enabled s)) \<sigma>
(\<box>(\<lambda>s. taken s \<longrightarrow> taken' s)) \<sigma>

goal (1 subgoal):
 1. (\<box>(\<lambda>s. weakly_fair enabled taken s \<longrightarrow> weakly_fair enabled' taken' s)) \<sigma>
[PROOF STEP]
unfolding weakly_fair_def defs
[PROOF STATE]
proof (prove)
using this:
\<forall>i. enabled' (\<sigma> |\<^sub>s i) \<longrightarrow> enabled (\<sigma> |\<^sub>s i)
\<forall>i. taken (\<sigma> |\<^sub>s i) \<longrightarrow> taken' (\<sigma> |\<^sub>s i)

goal (1 subgoal):
 1. \<forall>i. (\<forall>ia. (\<forall>ib. enabled (\<sigma> |\<^sub>s i |\<^sub>s ia |\<^sub>s ib)) \<longrightarrow> (\<exists>ib. taken (\<sigma> |\<^sub>s i |\<^sub>s ia |\<^sub>s ib) \<and> (\<forall>k<ib. True))) \<longrightarrow> (\<forall>ia. (\<forall>ib. enabled' (\<sigma> |\<^sub>s i |\<^sub>s ia |\<^sub>s ib)) \<longrightarrow> (\<exists>ib. taken' (\<sigma> |\<^sub>s i |\<^sub>s ia |\<^sub>s ib) \<and> (\<forall>k<ib. True)))
[PROOF STEP]
by simp blast


[STATEMENT]
lemma inversions_between_Cons_Cons:
  assumes "sorted_wrt less_eq (x # xs)" and "sorted_wrt less_eq (y # ys)"
  shows   "inversions_between (x # xs) (y # ys) =
             (if \<not>less y x then
                map_prod Suc id ` inversions_between xs (y # ys)
              else
                {..<length (x#xs)} \<times> {0} \<union>
                map_prod id Suc ` inversions_between (x # xs) ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inversions_between (x # xs) (y # ys) = (if \<not> y < x then map_prod Suc id ` inversions_between xs (y # ys) else {..<length (x # xs)} \<times> {0} \<union> map_prod id Suc ` inversions_between (x # xs) ys)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
sorted_wrt (\<le>) (x # xs)
sorted_wrt (\<le>) (y # ys)

goal (1 subgoal):
 1. inversions_between (x # xs) (y # ys) = (if \<not> y < x then map_prod Suc id ` inversions_between xs (y # ys) else {..<length (x # xs)} \<times> {0} \<union> map_prod id Suc ` inversions_between (x # xs) ys)
[PROOF STEP]
unfolding inversions_between_def map_prod_def
[PROOF STATE]
proof (prove)
using this:
sorted_wrt (\<le>) (x # xs)
sorted_wrt (\<le>) (y # ys)

goal (1 subgoal):
 1. {(i, j). (i, j) \<in> {..<length (x # xs)} \<times> {..<length (y # ys)} \<and> (y # ys) ! j < (x # xs) ! i} = (if \<not> y < x then (\<lambda>(x, y). (Suc x, id y)) ` {(i, j). (i, j) \<in> {..<length xs} \<times> {..<length (y # ys)} \<and> (y # ys) ! j < xs ! i} else {..<length (x # xs)} \<times> {0} \<union> (\<lambda>(x, y). (id x, Suc y)) ` {(i, j). (i, j) \<in> {..<length (x # xs)} \<times> {..<length ys} \<and> ys ! j < (x # xs) ! i})
[PROOF STEP]
by (auto, (auto simp: set_conv_nth nth_Cons less_le_not_le image_iff
                  intro: order_trans split: nat.splits)?)


[STATEMENT]
lemma pdevs_of_list_sum:
  assumes "distinct xs"
  assumes "e \<in> UNIV \<rightarrow> I"
  obtains f where "f \<in> UNIV \<rightarrow> I" "pdevs_val e (pdevs_of_list xs) = (\<Sum>P\<in>set xs. f P *\<^sub>R P)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>f. \<lbrakk>f \<in> UNIV \<rightarrow> I; pdevs_val e (pdevs_of_list xs) = (\<Sum>P\<in>set xs. f P *\<^sub>R P)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>f. \<lbrakk>f \<in> UNIV \<rightarrow> I; pdevs_val e (pdevs_of_list xs) = (\<Sum>P\<in>set xs. f P *\<^sub>R P)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
define f where "f X = e (the (map_of (zip xs [0..<length xs]) X))" for X
[PROOF STATE]
proof (state)
this:
f ?X = e (the (map_of (zip xs [0..<length xs]) ?X))

goal (1 subgoal):
 1. (\<And>f. \<lbrakk>f \<in> UNIV \<rightarrow> I; pdevs_val e (pdevs_of_list xs) = (\<Sum>P\<in>set xs. f P *\<^sub>R P)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
distinct xs
e \<in> UNIV \<rightarrow> I
[PROOF STEP]
have "f \<in> UNIV \<rightarrow> I"
[PROOF STATE]
proof (prove)
using this:
distinct xs
e \<in> UNIV \<rightarrow> I

goal (1 subgoal):
 1. f \<in> UNIV \<rightarrow> I
[PROOF STEP]
by (auto simp: f_def)
[PROOF STATE]
proof (state)
this:
f \<in> UNIV \<rightarrow> I

goal (1 subgoal):
 1. (\<And>f. \<lbrakk>f \<in> UNIV \<rightarrow> I; pdevs_val e (pdevs_of_list xs) = (\<Sum>P\<in>set xs. f P *\<^sub>R P)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
f \<in> UNIV \<rightarrow> I

goal (1 subgoal):
 1. (\<And>f. \<lbrakk>f \<in> UNIV \<rightarrow> I; pdevs_val e (pdevs_of_list xs) = (\<Sum>P\<in>set xs. f P *\<^sub>R P)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "pdevs_val e (pdevs_of_list xs) = (\<Sum>P\<in>set xs. f P *\<^sub>R P)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pdevs_val e (pdevs_of_list xs) = (\<Sum>P\<in>set xs. f P *\<^sub>R P)
[PROOF STEP]
by (auto simp add: pdevs_val_zip f_def assms sum_list_distinct_conv_sum_set[symmetric]
      in_set_zip map_of_zip_upto2_length_eq_nth
      intro!: sum_list_nth_eqI)
[PROOF STATE]
proof (state)
this:
pdevs_val e (pdevs_of_list xs) = (\<Sum>P\<in>set xs. f P *\<^sub>R P)

goal (1 subgoal):
 1. (\<And>f. \<lbrakk>f \<in> UNIV \<rightarrow> I; pdevs_val e (pdevs_of_list xs) = (\<Sum>P\<in>set xs. f P *\<^sub>R P)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
f \<in> UNIV \<rightarrow> I
pdevs_val e (pdevs_of_list xs) = (\<Sum>P\<in>set xs. f P *\<^sub>R P)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f \<in> UNIV \<rightarrow> I
pdevs_val e (pdevs_of_list xs) = (\<Sum>P\<in>set xs. f P *\<^sub>R P)

goal (1 subgoal):
 1. thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_supp_map_bset_tau_steps [simp]:
    "finite (supp (map_bset (tau_steps x) (Abs_bset UNIV :: nat set['idx])))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (supp (map_bset (tau_steps x) (Abs_bset UNIV)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite (supp (map_bset (tau_steps x) (Abs_bset UNIV)))
[PROOF STEP]
have "eqvt map_bset" and "eqvt tau_steps"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eqvt map_bset &&& eqvt tau_steps
[PROOF STEP]
by (simp add: eqvtI)+
[PROOF STATE]
proof (state)
this:
eqvt map_bset
eqvt tau_steps

goal (1 subgoal):
 1. finite (supp (map_bset (tau_steps x) (Abs_bset UNIV)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
eqvt map_bset
eqvt tau_steps
[PROOF STEP]
have "supp (map_bset (tau_steps x)) \<subseteq> supp x"
[PROOF STATE]
proof (prove)
using this:
eqvt map_bset
eqvt tau_steps

goal (1 subgoal):
 1. supp (map_bset (tau_steps x)) \<subseteq> supp x
[PROOF STEP]
using supp_fun_eqvt supp_fun_app supp_fun_app_eqvt
[PROOF STATE]
proof (prove)
using this:
eqvt map_bset
eqvt tau_steps
eqvt ?f \<Longrightarrow> supp ?f = {}
supp (?f ?x) \<subseteq> supp ?f \<union> supp ?x
eqvt ?f \<Longrightarrow> supp (?f ?x) \<subseteq> supp ?x

goal (1 subgoal):
 1. supp (map_bset (tau_steps x)) \<subseteq> supp x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
supp (map_bset (tau_steps x)) \<subseteq> supp x

goal (1 subgoal):
 1. finite (supp (map_bset (tau_steps x) (Abs_bset UNIV)))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
supp (map_bset (tau_steps x)) \<subseteq> supp x

goal (1 subgoal):
 1. finite (supp (map_bset (tau_steps x) (Abs_bset UNIV)))
[PROOF STEP]
have "supp (Abs_bset UNIV :: nat set['idx]) = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. supp (Abs_bset UNIV) = {}
[PROOF STEP]
by (simp add: eqvtI supp_fun_eqvt)
[PROOF STATE]
proof (state)
this:
supp (Abs_bset UNIV) = {}

goal (1 subgoal):
 1. finite (supp (map_bset (tau_steps x) (Abs_bset UNIV)))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
supp (map_bset (tau_steps x)) \<subseteq> supp x
supp (Abs_bset UNIV) = {}
[PROOF STEP]
have "supp (map_bset (tau_steps x) (Abs_bset UNIV :: nat set['idx])) \<subseteq> supp x"
[PROOF STATE]
proof (prove)
using this:
supp (map_bset (tau_steps x)) \<subseteq> supp x
supp (Abs_bset UNIV) = {}

goal (1 subgoal):
 1. supp (map_bset (tau_steps x) (Abs_bset UNIV)) \<subseteq> supp x
[PROOF STEP]
using supp_fun_app
[PROOF STATE]
proof (prove)
using this:
supp (map_bset (tau_steps x)) \<subseteq> supp x
supp (Abs_bset UNIV) = {}
supp (?f ?x) \<subseteq> supp ?f \<union> supp ?x

goal (1 subgoal):
 1. supp (map_bset (tau_steps x) (Abs_bset UNIV)) \<subseteq> supp x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
supp (map_bset (tau_steps x) (Abs_bset UNIV)) \<subseteq> supp x

goal (1 subgoal):
 1. finite (supp (map_bset (tau_steps x) (Abs_bset UNIV)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
supp (map_bset (tau_steps x) (Abs_bset UNIV)) \<subseteq> supp x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
supp (map_bset (tau_steps x) (Abs_bset UNIV)) \<subseteq> supp x

goal (1 subgoal):
 1. finite (supp (map_bset (tau_steps x) (Abs_bset UNIV)))
[PROOF STEP]
by (metis finite_subset finite_supp)
[PROOF STATE]
proof (state)
this:
finite (supp (map_bset (tau_steps x) (Abs_bset UNIV)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem prefix_length:
  assumes "prefix sbc (bc n')" and "\<not> prefix sbc (bc n'')" and "n'\<le>n''"
  shows "\<exists>n'''>n'. n'''\<le>n'' \<and> length (bc n''') < length sbc"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n'''>n'. n''' \<le> n'' \<and> length (bc n''') < length sbc
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (\<exists>n'''>n'. n''' \<le> n'' \<and> length (bc n''') < length sbc) \<Longrightarrow> False
[PROOF STEP]
assume "\<not> (\<exists>n'''>n'. n'''\<le>n'' \<and> length (bc n''') < length sbc)"
[PROOF STATE]
proof (state)
this:
\<not> (\<exists>n'''>n'. n''' \<le> n'' \<and> length (bc n''') < length sbc)

goal (1 subgoal):
 1. \<not> (\<exists>n'''>n'. n''' \<le> n'' \<and> length (bc n''') < length sbc) \<Longrightarrow> False
[PROOF STEP]
hence "\<forall>n'''>n'. n'''\<le>n'' \<longrightarrow> length (bc n''') \<ge> length sbc"
[PROOF STATE]
proof (prove)
using this:
\<not> (\<exists>n'''>n'. n''' \<le> n'' \<and> length (bc n''') < length sbc)

goal (1 subgoal):
 1. \<forall>n'''>n'. n''' \<le> n'' \<longrightarrow> length sbc \<le> length (bc n''')
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>n'''>n'. n''' \<le> n'' \<longrightarrow> length sbc \<le> length (bc n''')

goal (1 subgoal):
 1. \<not> (\<exists>n'''>n'. n''' \<le> n'' \<and> length (bc n''') < length sbc) \<Longrightarrow> False
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
prefix sbc (bc n')
\<not> prefix sbc (bc n'')
n' \<le> n''
\<forall>n'''>n'. n''' \<le> n'' \<longrightarrow> length sbc \<le> length (bc n''')
[PROOF STEP]
have "prefix sbc (bc n'')"
[PROOF STATE]
proof (prove)
using this:
prefix sbc (bc n')
\<not> prefix sbc (bc n'')
n' \<le> n''
\<forall>n'''>n'. n''' \<le> n'' \<longrightarrow> length sbc \<le> length (bc n''')

goal (1 subgoal):
 1. prefix sbc (bc n'')
[PROOF STEP]
using prefix_save[of sbc n' n'']
[PROOF STATE]
proof (prove)
using this:
prefix sbc (bc n')
\<not> prefix sbc (bc n'')
n' \<le> n''
\<forall>n'''>n'. n''' \<le> n'' \<longrightarrow> length sbc \<le> length (bc n''')
\<lbrakk>prefix sbc (bc n'); \<forall>n'''>n'. n''' \<le> n'' \<longrightarrow> length sbc \<le> length (bc n'''); n' \<le> n''\<rbrakk> \<Longrightarrow> prefix sbc (bc n'')

goal (1 subgoal):
 1. prefix sbc (bc n'')
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
prefix sbc (bc n'')

goal (1 subgoal):
 1. \<not> (\<exists>n'''>n'. n''' \<le> n'' \<and> length (bc n''') < length sbc) \<Longrightarrow> False
[PROOF STEP]
with assms (2)
[PROOF STATE]
proof (chain)
picking this:
\<not> prefix sbc (bc n'')
prefix sbc (bc n'')
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
\<not> prefix sbc (bc n'')
prefix sbc (bc n'')

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma filterlim_at_left_to_right:
  "filterlim f F (at_left a) \<longleftrightarrow> filterlim (\<lambda>x. f (- x)) F (at_right (-a))"
  for a :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filterlim f F (at_left a) = (LIM x at_right (- a). f (- x) :> F)
[PROOF STEP]
unfolding filterlim_def filtermap_filtermap at_left_minus[of a]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (filtermap (\<lambda>x. f (- x)) (at_right (- a)) \<le> F) = (filtermap (\<lambda>x. f (- x)) (at_right (- a)) \<le> F)
[PROOF STEP]
..


[STATEMENT]
lemma foldli_ball_aux:
    "foldli l (\<lambda>x. x) (\<lambda>x _. P x) b \<longleftrightarrow> b \<and> Ball (set l) P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldli l (\<lambda>x. x) (\<lambda>x _. P x) b = (b \<and> Ball (set l) P)
[PROOF STEP]
by (induct l arbitrary: b) auto


[STATEMENT]
lemma preserves_inv:
    assumes "A.iso f"
    shows "F (A.inv f) = B.inv (F f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F (A.inv f) = B.inv (F f)
[PROOF STEP]
using assms preserves_inverse_arrows A.inv_is_inverse B.inv_is_inverse
            B.inverse_arrow_unique
[PROOF STATE]
proof (prove)
using this:
A.iso f
A.inverse_arrows ?f ?g \<Longrightarrow> B.inverse_arrows (F ?f) (F ?g)
A.iso ?f \<Longrightarrow> A.inverse_arrows ?f (A.inv ?f)
B.iso ?f \<Longrightarrow> B.inverse_arrows ?f (B.inv ?f)
\<lbrakk>B.inverse_arrows ?f ?g; B.inverse_arrows ?f ?g'\<rbrakk> \<Longrightarrow> ?g = ?g'

goal (1 subgoal):
 1. F (A.inv f) = B.inv (F f)
[PROOF STEP]
by blast


[STATEMENT]
lemma Ex1_bij_conv' [reversal_rule]: assumes "bij f" shows "Ex1 (P o f) \<longleftrightarrow> Ex1 P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ex1 (P \<circ> f) = Ex1 P
[PROOF STEP]
unfolding comp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>!x. P (f x)) = Ex1 P
[PROOF STEP]
using Ex1_bij_conv[OF assms]
[PROOF STATE]
proof (prove)
using this:
(\<exists>!x. ?P (f x)) = (\<exists>!y. ?P y)

goal (1 subgoal):
 1. (\<exists>!x. P (f x)) = Ex1 P
[PROOF STEP]
.

  \<comment> \<open>\<^const>\<open>If\<close>\<close>


[STATEMENT]
lemma mat_leqb_eqc_split_correct1:
  assumes "dim_vec b = dim_row A"
  assumes "\<langle>X\<rangle> \<Turnstile>\<^sub>c\<^sub>s set (mat_leqb_eqc A b c)"
  assumes "(x,y) = split_i_j_x (dim_col A) l X"
  shows "[A *\<^sub>v x]\<le>b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [A*\<^sub>vx]\<le>b
[PROOF STEP]
proof (standard, goal_cases)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. dim_row A = dim_vec b
 2. dim_col A = dim_vec x
 3. \<And>i. i < dim_vec b \<Longrightarrow> (A *\<^sub>v x) $ i \<le> b $ i
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:

goal (3 subgoals):
 1. dim_row A = dim_vec b
 2. dim_col A = dim_vec x
 3. \<And>i. i < dim_vec b \<Longrightarrow> (A *\<^sub>v x) $ i \<le> b $ i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row A = dim_vec b
[PROOF STEP]
using assms(1)[symmetric]
[PROOF STATE]
proof (prove)
using this:
dim_row A = dim_vec b

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

goal (2 subgoals):
 1. dim_col A = dim_vec x
 2. \<And>i. i < dim_vec b \<Longrightarrow> (A *\<^sub>v x) $ i \<le> b $ i
[PROOF STEP]
case 2
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. dim_col A = dim_vec x
 2. \<And>i. i < dim_vec b \<Longrightarrow> (A *\<^sub>v x) $ i \<le> b $ i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_col A = dim_vec x
[PROOF STEP]
using assms(3)
[PROOF STATE]
proof (prove)
using this:
(x, y) = split_i_j_x (dim_col A) l X

goal (1 subgoal):
 1. dim_col A = dim_vec x
[PROOF STEP]
unfolding split_i_j_x_def
[PROOF STATE]
proof (prove)
using this:
(x, y) = (vec (dim_col A) \<langle>X\<rangle>, vec (l - dim_col A) (\<lambda>y. \<langle>X\<rangle> (y + dim_col A)))

goal (1 subgoal):
 1. dim_col A = dim_vec x
[PROOF STEP]
using split_vec_dims[of  0 "dim_col A" X x y]
[PROOF STATE]
proof (prove)
using this:
(x, y) = (vec (dim_col A) \<langle>X\<rangle>, vec (l - dim_col A) (\<lambda>y. \<langle>X\<rangle> (y + dim_col A)))
split_i_j_x 0 (dim_col A) X = (x, y) \<Longrightarrow> dim_vec x = 0
split_i_j_x 0 (dim_col A) X = (x, y) \<Longrightarrow> dim_vec y = dim_col A - 0

goal (1 subgoal):
 1. dim_col A = dim_vec x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dim_col A = dim_vec x

goal (1 subgoal):
 1. \<And>i. i < dim_vec b \<Longrightarrow> (A *\<^sub>v x) $ i \<le> b $ i
[PROOF STEP]
case (3 i)
[PROOF STATE]
proof (state)
this:
i < dim_vec b

goal (1 subgoal):
 1. \<And>i. i < dim_vec b \<Longrightarrow> (A *\<^sub>v x) $ i \<le> b $ i
[PROOF STEP]
with mat_leqb_eqc_satisfies1[of A b c "\<langle>X\<rangle>" i]
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>\<langle>X\<rangle> \<Turnstile>\<^sub>c\<^sub>s set (mat_leqb_eqc A b c); i < dim_vec b; i < dim_row A\<rbrakk> \<Longrightarrow> matrix_to_lpolies A ! i \<lbrace> \<langle>X\<rangle> \<rbrace> \<le> b $ i
i < dim_vec b
[PROOF STEP]
have m: "(matrix_to_lpolies A ! i) \<lbrace> \<langle>X\<rangle> \<rbrace> \<le> b $ i"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<langle>X\<rangle> \<Turnstile>\<^sub>c\<^sub>s set (mat_leqb_eqc A b c); i < dim_vec b; i < dim_row A\<rbrakk> \<Longrightarrow> matrix_to_lpolies A ! i \<lbrace> \<langle>X\<rangle> \<rbrace> \<le> b $ i
i < dim_vec b

goal (1 subgoal):
 1. matrix_to_lpolies A ! i \<lbrace> \<langle>X\<rangle> \<rbrace> \<le> b $ i
[PROOF STEP]
using assms(1) assms(2)
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<langle>X\<rangle> \<Turnstile>\<^sub>c\<^sub>s set (mat_leqb_eqc A b c); i < dim_vec b; i < dim_row A\<rbrakk> \<Longrightarrow> matrix_to_lpolies A ! i \<lbrace> \<langle>X\<rangle> \<rbrace> \<le> b $ i
i < dim_vec b
dim_vec b = dim_row A
\<langle>X\<rangle> \<Turnstile>\<^sub>c\<^sub>s set (mat_leqb_eqc A b c)

goal (1 subgoal):
 1. matrix_to_lpolies A ! i \<lbrace> \<langle>X\<rangle> \<rbrace> \<le> b $ i
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
matrix_to_lpolies A ! i \<lbrace> \<langle>X\<rangle> \<rbrace> \<le> b $ i

goal (1 subgoal):
 1. \<And>i. i < dim_vec b \<Longrightarrow> (A *\<^sub>v x) $ i \<le> b $ i
[PROOF STEP]
have leq: "dim_poly (vec_to_lpoly (row A i)) \<le> dim_col A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_poly (vec_to_lpoly (row A i)) \<le> dim_col A
[PROOF STEP]
using vec_to_poly_dim_less[of "row A i"]
[PROOF STATE]
proof (prove)
using this:
dim_poly (vec_to_lpoly (row A i)) \<le> dim_vec (row A i)

goal (1 subgoal):
 1. dim_poly (vec_to_lpoly (row A i)) \<le> dim_col A
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dim_poly (vec_to_lpoly (row A i)) \<le> dim_col A

goal (1 subgoal):
 1. \<And>i. i < dim_vec b \<Longrightarrow> (A *\<^sub>v x) $ i \<le> b $ i
[PROOF STEP]
have i: "i < dim_row A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < dim_row A
[PROOF STEP]
using "3" assms(1)
[PROOF STATE]
proof (prove)
using this:
i < dim_vec b
dim_vec b = dim_row A

goal (1 subgoal):
 1. i < dim_row A
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
i < dim_row A

goal (1 subgoal):
 1. \<And>i. i < dim_vec b \<Longrightarrow> (A *\<^sub>v x) $ i \<le> b $ i
[PROOF STEP]
from two_block_non_interfering_row_comp1[of i A "A\<^sup>T"]
[PROOF STATE]
proof (chain)
picking this:
i < dim_row A \<Longrightarrow> row (two_block_non_interfering A A\<^sup>T) i = row A i @\<^sub>v 0\<^sub>v (dim_col A\<^sup>T)
[PROOF STEP]
have "row (two_block_non_interfering A A\<^sup>T) i = row A i @\<^sub>v 0\<^sub>v (dim_col A\<^sup>T)"
[PROOF STATE]
proof (prove)
using this:
i < dim_row A \<Longrightarrow> row (two_block_non_interfering A A\<^sup>T) i = row A i @\<^sub>v 0\<^sub>v (dim_col A\<^sup>T)

goal (1 subgoal):
 1. row (two_block_non_interfering A A\<^sup>T) i = row A i @\<^sub>v 0\<^sub>v (dim_col A\<^sup>T)
[PROOF STEP]
using "3" assms(1)
[PROOF STATE]
proof (prove)
using this:
i < dim_row A \<Longrightarrow> row (two_block_non_interfering A A\<^sup>T) i = row A i @\<^sub>v 0\<^sub>v (dim_col A\<^sup>T)
i < dim_vec b
dim_vec b = dim_row A

goal (1 subgoal):
 1. row (two_block_non_interfering A A\<^sup>T) i = row A i @\<^sub>v 0\<^sub>v (dim_col A\<^sup>T)
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
row (two_block_non_interfering A A\<^sup>T) i = row A i @\<^sub>v 0\<^sub>v (dim_col A\<^sup>T)

goal (1 subgoal):
 1. \<And>i. i < dim_vec b \<Longrightarrow> (A *\<^sub>v x) $ i \<le> b $ i
[PROOF STEP]
have "(vec_to_lpoly (row A i @\<^sub>v 0\<^sub>v (dim_col A\<^sup>T))) \<lbrace>\<langle>X\<rangle>\<rbrace> = ((vec_to_lpoly (row A i)) \<lbrace>\<langle>X\<rangle>\<rbrace>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_to_lpoly (row A i @\<^sub>v 0\<^sub>v (dim_col A\<^sup>T)) \<lbrace> \<langle>X\<rangle> \<rbrace> = vec_to_lpoly (row A i) \<lbrace> \<langle>X\<rangle> \<rbrace>
[PROOF STEP]
using lpoly_of_v_equals_v_append0
[PROOF STATE]
proof (prove)
using this:
vec_to_lpoly ?v = vec_to_lpoly (?v @\<^sub>v 0\<^sub>v ?a)

goal (1 subgoal):
 1. vec_to_lpoly (row A i @\<^sub>v 0\<^sub>v (dim_col A\<^sup>T)) \<lbrace> \<langle>X\<rangle> \<rbrace> = vec_to_lpoly (row A i) \<lbrace> \<langle>X\<rangle> \<rbrace>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vec_to_lpoly (row A i @\<^sub>v 0\<^sub>v (dim_col A\<^sup>T)) \<lbrace> \<langle>X\<rangle> \<rbrace> = vec_to_lpoly (row A i) \<lbrace> \<langle>X\<rangle> \<rbrace>

goal (1 subgoal):
 1. \<And>i. i < dim_vec b \<Longrightarrow> (A *\<^sub>v x) $ i \<le> b $ i
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
vec_to_lpoly (row A i @\<^sub>v 0\<^sub>v (dim_col A\<^sup>T)) \<lbrace> \<langle>X\<rangle> \<rbrace> = vec_to_lpoly (row A i) \<lbrace> \<langle>X\<rangle> \<rbrace>

goal (1 subgoal):
 1. \<And>i. i < dim_vec b \<Longrightarrow> (A *\<^sub>v x) $ i \<le> b $ i
[PROOF STEP]
have "... = (\<Sum>a = 0..<dim_poly (vec_to_lpoly (row A i)).
                      Abstract_Linear_Poly.coeff (vec_to_lpoly (row A i)) a * \<langle>X\<rangle> a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_to_lpoly (row A i) \<lbrace> \<langle>X\<rangle> \<rbrace> = (\<Sum>a = 0..<dim_poly (vec_to_lpoly (row A i)). Abstract_Linear_Poly.coeff (vec_to_lpoly (row A i)) a * \<langle>X\<rangle> a)
[PROOF STEP]
using valuate_with_dim_poly[of "vec_to_lpoly (row A i)" "\<langle>X\<rangle>"]
[PROOF STATE]
proof (prove)
using this:
vec_to_lpoly (row A i) \<lbrace> \<langle>X\<rangle> \<rbrace> = (\<Sum>ia = 0..<dim_poly (vec_to_lpoly (row A i)). Abstract_Linear_Poly.coeff (vec_to_lpoly (row A i)) ia * \<langle>X\<rangle> ia)

goal (1 subgoal):
 1. vec_to_lpoly (row A i) \<lbrace> \<langle>X\<rangle> \<rbrace> = (\<Sum>a = 0..<dim_poly (vec_to_lpoly (row A i)). Abstract_Linear_Poly.coeff (vec_to_lpoly (row A i)) a * \<langle>X\<rangle> a)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
vec_to_lpoly (row A i) \<lbrace> \<langle>X\<rangle> \<rbrace> = (\<Sum>a = 0..<dim_poly (vec_to_lpoly (row A i)). Abstract_Linear_Poly.coeff (vec_to_lpoly (row A i)) a * \<langle>X\<rangle> a)

goal (1 subgoal):
 1. \<And>i. i < dim_vec b \<Longrightarrow> (A *\<^sub>v x) $ i \<le> b $ i
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
vec_to_lpoly (row A i) \<lbrace> \<langle>X\<rangle> \<rbrace> = (\<Sum>a = 0..<dim_poly (vec_to_lpoly (row A i)). Abstract_Linear_Poly.coeff (vec_to_lpoly (row A i)) a * \<langle>X\<rangle> a)

goal (1 subgoal):
 1. \<And>i. i < dim_vec b \<Longrightarrow> (A *\<^sub>v x) $ i \<le> b $ i
[PROOF STEP]
have "... = (\<Sum>a = 0..<dim_col A. Abstract_Linear_Poly.coeff (vec_to_lpoly (row A i)) a * \<langle>X\<rangle> a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>a = 0..<dim_poly (vec_to_lpoly (row A i)). Abstract_Linear_Poly.coeff (vec_to_lpoly (row A i)) a * \<langle>X\<rangle> a) = (\<Sum>a = 0..<dim_col A. Abstract_Linear_Poly.coeff (vec_to_lpoly (row A i)) a * \<langle>X\<rangle> a)
[PROOF STEP]
using split_coeff_vec_index_sum[of x y]
      sum_dim_vec_equals_sum_dim_poly[of "row A i" "\<langle>X\<rangle>"]
[PROOF STATE]
proof (prove)
using this:
(x, y) = split_i_j_x (dim_vec (lpoly_to_vec ?v)) ?l ?X \<Longrightarrow> (\<Sum>i = 0..<dim_vec x. Abstract_Linear_Poly.coeff ?v i * \<langle>?X\<rangle> i) = (\<Sum>i = 0..<dim_vec x. lpoly_to_vec ?v $ i * x $ i)
(\<Sum>a = 0..<dim_vec (row A i). Abstract_Linear_Poly.coeff (vec_to_lpoly (row A i)) a * \<langle>X\<rangle> a) = (\<Sum>a = 0..<dim_poly (vec_to_lpoly (row A i)). Abstract_Linear_Poly.coeff (vec_to_lpoly (row A i)) a * \<langle>X\<rangle> a)

goal (1 subgoal):
 1. (\<Sum>a = 0..<dim_poly (vec_to_lpoly (row A i)). Abstract_Linear_Poly.coeff (vec_to_lpoly (row A i)) a * \<langle>X\<rangle> a) = (\<Sum>a = 0..<dim_col A. Abstract_Linear_Poly.coeff (vec_to_lpoly (row A i)) a * \<langle>X\<rangle> a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>a = 0..<dim_poly (vec_to_lpoly (row A i)). Abstract_Linear_Poly.coeff (vec_to_lpoly (row A i)) a * \<langle>X\<rangle> a) = (\<Sum>a = 0..<dim_col A. Abstract_Linear_Poly.coeff (vec_to_lpoly (row A i)) a * \<langle>X\<rangle> a)

goal (1 subgoal):
 1. \<And>i. i < dim_vec b \<Longrightarrow> (A *\<^sub>v x) $ i \<le> b $ i
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>a = 0..<dim_poly (vec_to_lpoly (row A i)). Abstract_Linear_Poly.coeff (vec_to_lpoly (row A i)) a * \<langle>X\<rangle> a) = (\<Sum>a = 0..<dim_col A. Abstract_Linear_Poly.coeff (vec_to_lpoly (row A i)) a * \<langle>X\<rangle> a)

goal (1 subgoal):
 1. \<And>i. i < dim_vec b \<Longrightarrow> (A *\<^sub>v x) $ i \<le> b $ i
[PROOF STEP]
have "... = row A i \<bullet> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>a = 0..<dim_col A. Abstract_Linear_Poly.coeff (vec_to_lpoly (row A i)) a * \<langle>X\<rangle> a) = row A i \<bullet> x
[PROOF STEP]
unfolding scalar_prod_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>a = 0..<dim_col A. Abstract_Linear_Poly.coeff (vec_to_lpoly (row A i)) a * \<langle>X\<rangle> a) = (\<Sum>ia = 0..<dim_vec x. row A i $ ia * x $ ia)
[PROOF STEP]
using \<open>dim_col A = dim_vec x\<close> i assms(3)
[PROOF STATE]
proof (prove)
using this:
dim_col A = dim_vec x
i < dim_row A
(x, y) = split_i_j_x (dim_col A) l X

goal (1 subgoal):
 1. (\<Sum>a = 0..<dim_col A. Abstract_Linear_Poly.coeff (vec_to_lpoly (row A i)) a * \<langle>X\<rangle> a) = (\<Sum>ia = 0..<dim_vec x. row A i $ ia * x $ ia)
[PROOF STEP]
using matrix_to_lpolies_coeff_access[of i A] matrix_to_lp_vec_to_lpoly_row[of i A]
      split_access_fst_1[of _ "(dim_col A)" l X x y]
[PROOF STATE]
proof (prove)
using this:
dim_col A = dim_vec x
i < dim_row A
(x, y) = split_i_j_x (dim_col A) l X
\<lbrakk>i < dim_row A; ?j < dim_col A\<rbrakk> \<Longrightarrow> Abstract_Linear_Poly.coeff (matrix_to_lpolies A ! i) ?j = A $$ (i, ?j)
i < dim_row A \<Longrightarrow> matrix_to_lpolies A ! i = vec_to_lpoly (row A i)
\<lbrakk>?k < dim_col A; split_i_j_x (dim_col A) l X = (x, y)\<rbrakk> \<Longrightarrow> x $ ?k = \<langle>X\<rangle> ?k

goal (1 subgoal):
 1. (\<Sum>a = 0..<dim_col A. Abstract_Linear_Poly.coeff (vec_to_lpoly (row A i)) a * \<langle>X\<rangle> a) = (\<Sum>ia = 0..<dim_vec x. row A i $ ia * x $ ia)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(\<Sum>a = 0..<dim_col A. Abstract_Linear_Poly.coeff (vec_to_lpoly (row A i)) a * \<langle>X\<rangle> a) = row A i \<bullet> x

goal (1 subgoal):
 1. \<And>i. i < dim_vec b \<Longrightarrow> (A *\<^sub>v x) $ i \<le> b $ i
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
vec_to_lpoly (row A i @\<^sub>v 0\<^sub>v (dim_col A\<^sup>T)) \<lbrace> \<langle>X\<rangle> \<rbrace> = row A i \<bullet> x
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
vec_to_lpoly (row A i @\<^sub>v 0\<^sub>v (dim_col A\<^sup>T)) \<lbrace> \<langle>X\<rangle> \<rbrace> = row A i \<bullet> x

goal (1 subgoal):
 1. (A *\<^sub>v x) $ i \<le> b $ i
[PROOF STEP]
using m i lpoly_of_v_equals_v_append0
[PROOF STATE]
proof (prove)
using this:
vec_to_lpoly (row A i @\<^sub>v 0\<^sub>v (dim_col A\<^sup>T)) \<lbrace> \<langle>X\<rangle> \<rbrace> = row A i \<bullet> x
matrix_to_lpolies A ! i \<lbrace> \<langle>X\<rangle> \<rbrace> \<le> b $ i
i < dim_row A
vec_to_lpoly ?v = vec_to_lpoly (?v @\<^sub>v 0\<^sub>v ?a)

goal (1 subgoal):
 1. (A *\<^sub>v x) $ i \<le> b $ i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(A *\<^sub>v x) $ i \<le> b $ i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_inverse\<^sub>L_ex1': "\<exists>x. is_inverse\<^sub>L f x \<Longrightarrow> \<exists>!x. is_inverse\<^sub>L f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invertible\<^sub>L f \<Longrightarrow> \<exists>!x. is_inverse\<^sub>L f x
[PROOF STEP]
using is_inverse\<^sub>L_ex1
[PROOF STATE]
proof (prove)
using this:
is_inverse\<^sub>L ?f ?g \<Longrightarrow> \<exists>!h. is_inverse\<^sub>L ?f h

goal (1 subgoal):
 1. invertible\<^sub>L f \<Longrightarrow> \<exists>!x. is_inverse\<^sub>L f x
[PROOF STEP]
by auto