[STATEMENT]
lemma filterlim_tendsto_add_at_top_iff:
  assumes f: "(f \<longlongrightarrow> c) F"
  shows "(LIM x F. (f x + g x :: real) :> at_top) \<longleftrightarrow> (LIM x F. g x :> at_top)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LIM x F. f x + g x :> at_top) = filterlim g at_top F
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. LIM x F. f x + g x :> at_top \<Longrightarrow> filterlim g at_top F
 2. filterlim g at_top F \<Longrightarrow> LIM x F. f x + g x :> at_top
[PROOF STEP]
assume "LIM x F. f x + g x :> at_top"
[PROOF STATE]
proof (state)
this:
LIM x F. f x + g x :> at_top

goal (2 subgoals):
 1. LIM x F. f x + g x :> at_top \<Longrightarrow> filterlim g at_top F
 2. filterlim g at_top F \<Longrightarrow> LIM x F. f x + g x :> at_top
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
LIM x F. f x + g x :> at_top

goal (2 subgoals):
 1. LIM x F. f x + g x :> at_top \<Longrightarrow> filterlim g at_top F
 2. filterlim g at_top F \<Longrightarrow> LIM x F. f x + g x :> at_top
[PROOF STEP]
have "((\<lambda>x. - f x) \<longlongrightarrow> - c) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. - f x) \<longlongrightarrow> - c) F
[PROOF STEP]
using f
[PROOF STATE]
proof (prove)
using this:
(f \<longlongrightarrow> c) F

goal (1 subgoal):
 1. ((\<lambda>x. - f x) \<longlongrightarrow> - c) F
[PROOF STEP]
by (intro tendsto_intros,simp)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. - f x) \<longlongrightarrow> - c) F

goal (2 subgoals):
 1. LIM x F. f x + g x :> at_top \<Longrightarrow> filterlim g at_top F
 2. filterlim g at_top F \<Longrightarrow> LIM x F. f x + g x :> at_top
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
LIM x F. f x + g x :> at_top
((\<lambda>x. - f x) \<longlongrightarrow> - c) F
[PROOF STEP]
show "filterlim g at_top F"
[PROOF STATE]
proof (prove)
using this:
LIM x F. f x + g x :> at_top
((\<lambda>x. - f x) \<longlongrightarrow> - c) F

goal (1 subgoal):
 1. filterlim g at_top F
[PROOF STEP]
using filterlim_tendsto_add_at_top
[PROOF STATE]
proof (prove)
using this:
LIM x F. f x + g x :> at_top
((\<lambda>x. - f x) \<longlongrightarrow> - c) F
\<lbrakk>(?f \<longlongrightarrow> ?c) ?F; filterlim ?g at_top ?F\<rbrakk> \<Longrightarrow> LIM x ?F. ?f x + ?g x :> at_top

goal (1 subgoal):
 1. filterlim g at_top F
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
filterlim g at_top F

goal (1 subgoal):
 1. filterlim g at_top F \<Longrightarrow> LIM x F. f x + g x :> at_top
[PROOF STEP]
qed (auto simp add:filterlim_tendsto_add_at_top[OF f])


[STATEMENT]
lemma lset_lconcat_subset: "lset (lconcat xss) \<subseteq> (\<Union>xs\<in>lset xss. lset xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lset (lconcat xss) \<subseteq> \<Union> (lset ` lset xss)
[PROOF STEP]
by(induct xss)(auto dest: subsetD[OF lset_lappend])


[STATEMENT]
lemma nonpos_Ints_subset_Ints: "\<int>\<^sub>\<le>\<^sub>0 \<subseteq> \<int>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<int>\<^sub>\<le>\<^sub>0 \<subseteq> \<int>
[PROOF STEP]
unfolding nonpos_Ints_def Ints_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {of_int n |n. n \<le> 0} \<subseteq> range of_int
[PROOF STEP]
by blast


[STATEMENT]
lemma invh_join:
  "\<lbrakk> invh l; invh r; bheight l = bheight r \<rbrakk>
  \<Longrightarrow> invh (join l r) \<and> bheight (join l r) = bheight l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>invh l; invh r; bheight l = bheight r\<rbrakk> \<Longrightarrow> invh (join l r) \<and> bheight (join l r) = bheight l
[PROOF STEP]
by (induct l r rule: join.induct)
   (auto simp: invh_baldL_Black split: tree.splits color.splits)


[STATEMENT]
lemma (in Module) linmap_im_linspan1:"\<lbrakk>ideal R A; R module N; f \<in> mHom R M N;
      H \<subseteq> carrier M; h \<in> linear_span R M A H\<rbrakk> \<Longrightarrow>
                              f h \<in> linear_span R N A (f ` H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ideal R A; R module N; f \<in> mHom R M N; H \<subseteq> carrier M; h \<in> linear_span R M A H\<rbrakk> \<Longrightarrow> f h \<in> linear_span R N A (f ` H)
[PROOF STEP]
apply (simp add:linear_span_def [of "R" "M"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ideal R A; R module N; f \<in> mHom R M N; H \<subseteq> carrier M; h \<in> (if H = {} then {\<zero>} else {x. \<exists>n. \<exists>f\<in>{j. j \<le> n} \<rightarrow> H. \<exists>s\<in>{j. j \<le> n} \<rightarrow> A. x = l_comb R M n s f})\<rbrakk> \<Longrightarrow> f h \<in> linear_span R N A (f ` H)
[PROOF STEP]
apply (case_tac "H = {}", simp add:linear_span_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>ideal R A; R module N; f \<in> mHom R M N; h = \<zero>; H = {}\<rbrakk> \<Longrightarrow> f \<zero> = \<zero>\<^bsub>N\<^esub>
 2. \<lbrakk>ideal R A; R module N; f \<in> mHom R M N; H \<subseteq> carrier M; h \<in> (if H = {} then {\<zero>} else {x. \<exists>n. \<exists>f\<in>{j. j \<le> n} \<rightarrow> H. \<exists>s\<in>{j. j \<le> n} \<rightarrow> A. x = l_comb R M n s f}); H \<noteq> {}\<rbrakk> \<Longrightarrow> f h \<in> linear_span R N A (f ` H)
[PROOF STEP]
apply (simp add:mHom_0, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ideal R A; R module N; f \<in> mHom R M N; H \<subseteq> carrier M; \<exists>n. \<exists>f\<in>{j. j \<le> n} \<rightarrow> H. \<exists>s\<in>{j. j \<le> n} \<rightarrow> A. h = l_comb R M n s f; H \<noteq> {}\<rbrakk> \<Longrightarrow> f h \<in> linear_span R N A (f ` H)
[PROOF STEP]
apply (erule exE, (erule bexE)+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n fa s. \<lbrakk>ideal R A; R module N; f \<in> mHom R M N; H \<subseteq> carrier M; H \<noteq> {}; fa \<in> {j. j \<le> n} \<rightarrow> H; s \<in> {j. j \<le> n} \<rightarrow> A; h = l_comb R M n s fa\<rbrakk> \<Longrightarrow> f h \<in> linear_span R N A (f ` H)
[PROOF STEP]
apply (simp add:linmap_im_linspan)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma [simp]: "length (evens_odds True vc) < Suc (length vc)"
              "length (evens_odds False vc) < Suc (length vc)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (evens_odds True vc) < Suc (length vc) &&& length (evens_odds False vc) < Suc (length vc)
[PROOF STEP]
by (metis filter_compehension_evens_odds le_imp_less_Suc length_filter_le length_map map_nth)+


[STATEMENT]
lemma Jacobi_prod_mset[simp]: "n \<noteq> 0 \<Longrightarrow> Jacobi (prod_mset M) n = (\<Prod>q\<in>#M. Jacobi q n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> Jacobi (\<Prod>\<^sub># M) n = (\<Prod>q\<in>#M. Jacobi q n)
[PROOF STEP]
by (induction M) simp_all


[STATEMENT]
lemma is_unit_Gcd_fin_iff [simp]:
  "is_unit (Gcd\<^sub>f\<^sub>i\<^sub>n A) \<longleftrightarrow> Gcd\<^sub>f\<^sub>i\<^sub>n A = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_unit (Gcd\<^sub>f\<^sub>i\<^sub>n A) = (Gcd\<^sub>f\<^sub>i\<^sub>n A = (1::'a))
[PROOF STEP]
by (rule normalize_idem_imp_is_unit_iff) simp


[STATEMENT]
lemma starfun_n_mult: "( *fn* f) z * ( *fn* g) z = ( *fn* (\<lambda>i x. f i x * g i x)) z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (*fn* f) z * (*fn* g) z = (*fn* (\<lambda>i x. f i x * g i x)) z
[PROOF STEP]
by (cases z) (simp add: starfun_n star_n_mult)


[STATEMENT]
lemma setdist_sing_in_set:
   "x \<in> S \<Longrightarrow> setdist {x} S = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> S \<Longrightarrow> setdist {x} S = 0
[PROOF STEP]
by (simp add: setdist_eq_0I)


[STATEMENT]
theorem wls_subst_compose1:
assumes "wls s X" and "wls (asSort ys) Y1" and "wls (asSort ys) Y2"
shows "((X #[Y1 / y]_ys) #[Y2 / y]_ys) = (X #[(Y1 #[Y2 / y]_ys) / y]_ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X #[Y1 / y]_ys #[Y2 / y]_ys = X #[Y1 #[Y2 / y]_ys / y]_ys
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
wls s X
wls (asSort ys) Y1
wls (asSort ys) Y2

goal (1 subgoal):
 1. X #[Y1 / y]_ys #[Y2 / y]_ys = X #[Y1 #[Y2 / y]_ys / y]_ys
[PROOF STEP]
by(simp add: subst_compose1)


[STATEMENT]
lemma distinct3_def:
  "distinct [A,B,C] = ((A \<noteq> B) \<and> (A \<noteq> C) \<and> (B \<noteq> C))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct [A, B, C] = (A \<noteq> B \<and> A \<noteq> C \<and> B \<noteq> C)
[PROOF STEP]
by auto


[STATEMENT]
lemma proj_setI:
  assumes "y \<in> A" "dist x y \<le> infdist x A"
  shows "y \<in> proj_set x A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<in> proj_set x A
[PROOF STEP]
using assms infdist_le[OF \<open>y \<in> A\<close>, of x]
[PROOF STATE]
proof (prove)
using this:
y \<in> A
dist x y \<le> infdist x A
infdist x A \<le> dist x y

goal (1 subgoal):
 1. y \<in> proj_set x A
[PROOF STEP]
unfolding proj_set_def
[PROOF STATE]
proof (prove)
using this:
y \<in> A
dist x y \<le> infdist x A
infdist x A \<le> dist x y

goal (1 subgoal):
 1. y \<in> {y \<in> A. dist x y = infdist x A}
[PROOF STEP]
by auto


[STATEMENT]
lemma matchers_vars_term_eq:
  assumes "\<sigma> \<in> matchers P" and "\<tau> \<in> matchers P"
    and "(s, t) \<in> P"
  shows "\<forall>x\<in>vars_term s. \<sigma> x = \<tau> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>vars_term s. \<sigma> x = \<tau> x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<sigma> \<in> matchers P
\<tau> \<in> matchers P
(s, t) \<in> P

goal (1 subgoal):
 1. \<forall>x\<in>vars_term s. \<sigma> x = \<tau> x
[PROOF STEP]
unfolding term_subst_eq_conv [symmetric]
[PROOF STATE]
proof (prove)
using this:
\<sigma> \<in> matchers P
\<tau> \<in> matchers P
(s, t) \<in> P

goal (1 subgoal):
 1. s \<cdot> \<sigma> = s \<cdot> \<tau>
[PROOF STEP]
by (force simp: matchers_def)


[STATEMENT]
lemma valid_countings_eq[code]:
  "valid_countings a b = (if a + b = 0 then 1 else ((a - b) * ((a + b) choose a)) div (a + b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valid_countings a b = (if a + b = 0 then 1 else (a - b) * (a + b choose a) div (a + b))
[PROOF STEP]
by (simp add: valid_countings[symmetric] valid_countings_a_0)


[STATEMENT]
lemma vec_vs: "vectorspace (class_ring :: 'a :: field ring) (module_vec TYPE('a) n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vectorspace class_ring (module_vec TYPE('a) n)
[PROOF STEP]
unfolding vectorspace_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. module class_ring (module_vec TYPE('a) n) \<and> field class_ring
[PROOF STEP]
using vec_module class_field
[PROOF STATE]
proof (prove)
using this:
module class_ring (module_vec TYPE(?'a) ?n)
field class_ring

goal (1 subgoal):
 1. module class_ring (module_vec TYPE('a) n) \<and> field class_ring
[PROOF STEP]
by (auto simp: class_field_def)


[STATEMENT]
lemma EM_remainder_of_real:
  assumes "continuous_on {a..} f"
  shows   "EM_remainder n (\<lambda>x. of_real (f x) ::
             'a :: {banach, real_normed_algebra_1, real_inner}) a =
             of_real (EM_remainder n f a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. EM_remainder n (\<lambda>x. of_real (f x)) a = of_real (EM_remainder n f a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. EM_remainder n (\<lambda>x. of_real (f x)) a = of_real (EM_remainder n f a)
[PROOF STEP]
have eq: "EM_remainder' n (\<lambda>x. of_real (f x) :: 'a) (real_of_int a) =
              (\<lambda>x::int. of_real (EM_remainder' n f a x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. EM_remainder' n (\<lambda>x. of_real (f x)) (real_of_int a) (real_of_int x)) = (\<lambda>x. of_real (EM_remainder' n f (real_of_int a) (real_of_int x)))
[PROOF STEP]
by (intro ext EM_remainder'_bounded_linear[OF bounded_linear_of_real]
            continuous_on_subset[OF assms]) auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. EM_remainder' n (\<lambda>x. of_real (f x)) (real_of_int a) (real_of_int x)) = (\<lambda>x. of_real (EM_remainder' n f (real_of_int a) (real_of_int x)))

goal (1 subgoal):
 1. EM_remainder n (\<lambda>x. of_real (f x)) a = of_real (EM_remainder n f a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. EM_remainder n (\<lambda>x. of_real (f x)) a = of_real (EM_remainder n f a)
[PROOF STEP]
proof (cases "EM_remainder_converges n f a")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. EM_remainder_converges n f a \<Longrightarrow> EM_remainder n (\<lambda>x. of_real (f x)) a = of_real (EM_remainder n f a)
 2. \<not> EM_remainder_converges n f a \<Longrightarrow> EM_remainder n (\<lambda>x. of_real (f x)) a = of_real (EM_remainder n f a)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> EM_remainder_converges n f a

goal (2 subgoals):
 1. EM_remainder_converges n f a \<Longrightarrow> EM_remainder n (\<lambda>x. of_real (f x)) a = of_real (EM_remainder n f a)
 2. \<not> EM_remainder_converges n f a \<Longrightarrow> EM_remainder n (\<lambda>x. of_real (f x)) a = of_real (EM_remainder n f a)
[PROOF STEP]
with EM_remainder_converges_of_real_iff[OF assms, of n]
[PROOF STATE]
proof (chain)
picking this:
EM_remainder_converges n (\<lambda>x. of_real (f x)) a = EM_remainder_converges n f a
\<not> EM_remainder_converges n f a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
EM_remainder_converges n (\<lambda>x. of_real (f x)) a = EM_remainder_converges n f a
\<not> EM_remainder_converges n f a

goal (1 subgoal):
 1. EM_remainder n (\<lambda>x. of_real (f x)) a = of_real (EM_remainder n f a)
[PROOF STEP]
by (auto simp: EM_remainder_def)
[PROOF STATE]
proof (state)
this:
EM_remainder n (\<lambda>x. of_real (f x)) a = of_real (EM_remainder n f a)

goal (1 subgoal):
 1. EM_remainder_converges n f a \<Longrightarrow> EM_remainder n (\<lambda>x. of_real (f x)) a = of_real (EM_remainder n f a)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. EM_remainder_converges n f a \<Longrightarrow> EM_remainder n (\<lambda>x. of_real (f x)) a = of_real (EM_remainder n f a)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
EM_remainder_converges n f a

goal (1 subgoal):
 1. EM_remainder_converges n f a \<Longrightarrow> EM_remainder n (\<lambda>x. of_real (f x)) a = of_real (EM_remainder n f a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
EM_remainder_converges n f a
[PROOF STEP]
obtain L where L: "((\<lambda>x. EM_remainder' n f a (real_of_int x)) \<longlongrightarrow> L) at_top"
[PROOF STATE]
proof (prove)
using this:
EM_remainder_converges n f a

goal (1 subgoal):
 1. (\<And>L. ((\<lambda>x. EM_remainder' n f (real_of_int a) (real_of_int x)) \<longlongrightarrow> L) at_top \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: EM_remainder_converges_def)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. EM_remainder' n f (real_of_int a) (real_of_int x)) \<longlongrightarrow> L) at_top

goal (1 subgoal):
 1. EM_remainder_converges n f a \<Longrightarrow> EM_remainder n (\<lambda>x. of_real (f x)) a = of_real (EM_remainder n f a)
[PROOF STEP]
have L': "((\<lambda>x. EM_remainder' n (\<lambda>x. of_real (f x) :: 'a) a
                (real_of_int x)) \<longlongrightarrow> of_real L) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. EM_remainder' n (\<lambda>x. of_real (f x)) (real_of_int a) (real_of_int x)) \<longlongrightarrow> of_real L) at_top
[PROOF STEP]
unfolding eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. of_real (EM_remainder' n f (real_of_int a) (real_of_int x))) \<longlongrightarrow> of_real L) at_top
[PROOF STEP]
by (intro tendsto_of_real L)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. EM_remainder' n (\<lambda>x. of_real (f x)) (real_of_int a) (real_of_int x)) \<longlongrightarrow> of_real L) at_top

goal (1 subgoal):
 1. EM_remainder_converges n f a \<Longrightarrow> EM_remainder n (\<lambda>x. of_real (f x)) a = of_real (EM_remainder n f a)
[PROOF STEP]
from L L' tendsto_Lim[OF _ L] tendsto_Lim[OF _ L']
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. EM_remainder' n f (real_of_int a) (real_of_int x)) \<longlongrightarrow> L) at_top
((\<lambda>x. EM_remainder' n (\<lambda>x. of_real (f x)) (real_of_int a) (real_of_int x)) \<longlongrightarrow> of_real L) at_top
at_top \<noteq> bot \<Longrightarrow> Lim at_top (\<lambda>x. EM_remainder' n f (real_of_int a) (real_of_int x)) = L
at_top \<noteq> bot \<Longrightarrow> Lim at_top (\<lambda>x. EM_remainder' n (\<lambda>x. of_real (f x)) (real_of_int a) (real_of_int x)) = of_real L
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. EM_remainder' n f (real_of_int a) (real_of_int x)) \<longlongrightarrow> L) at_top
((\<lambda>x. EM_remainder' n (\<lambda>x. of_real (f x)) (real_of_int a) (real_of_int x)) \<longlongrightarrow> of_real L) at_top
at_top \<noteq> bot \<Longrightarrow> Lim at_top (\<lambda>x. EM_remainder' n f (real_of_int a) (real_of_int x)) = L
at_top \<noteq> bot \<Longrightarrow> Lim at_top (\<lambda>x. EM_remainder' n (\<lambda>x. of_real (f x)) (real_of_int a) (real_of_int x)) = of_real L

goal (1 subgoal):
 1. EM_remainder n (\<lambda>x. of_real (f x)) a = of_real (EM_remainder n f a)
[PROOF STEP]
by (auto simp: EM_remainder_def EM_remainder_converges_def)
[PROOF STATE]
proof (state)
this:
EM_remainder n (\<lambda>x. of_real (f x)) a = of_real (EM_remainder n f a)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
EM_remainder n (\<lambda>x. of_real (f x)) a = of_real (EM_remainder n f a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma carrier_intersect: "carrier (t \<inter>\<inter> t') \<subseteq> carrier t \<inter> carrier t'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. carrier (t \<inter>\<inter> t') \<subseteq> carrier t \<inter> carrier t'
[PROOF STEP]
unfolding Union_paths_carrier[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (set ` paths (t \<inter>\<inter> t')) \<subseteq> \<Union> (set ` paths t) \<inter> \<Union> (set ` paths t')
[PROOF STEP]
by auto


[STATEMENT]
lemma powsum_split_var6: "x\<^bsub>0\<^esub>\<^bsup>(Suc k)+Suc n\<^esup> = x\<^bsub>0\<^esub>\<^bsup>Suc k \<^esup>+ x\<^bsub>0+Suc (Suc k)\<^esub>\<^bsup>n\<^esup>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x\<^bsub>0\<^esub>\<^bsup>Suc k + Suc n\<^esup> = x\<^bsub>0\<^esub>\<^bsup>Suc k\<^esup> + x\<^bsub>0 + Suc (Suc k)\<^esub>\<^bsup>n\<^esup>
[PROOF STEP]
by (metis powsum_split_var3)


[STATEMENT]
lemma intersects_x_axis_mk_circline:
  assumes "is_real A" and "A \<noteq> 0 \<or> B \<noteq> 0"
  shows "intersects_x_axis (mk_circline A B (cnj B) A) \<longleftrightarrow> A = 0 \<or> (Re B)\<^sup>2 > (Re A)\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. intersects_x_axis (mk_circline A B (cnj B) A) = (A = 0 \<or> (Re A)\<^sup>2 < (Re B)\<^sup>2)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. intersects_x_axis (mk_circline A B (cnj B) A) = (A = 0 \<or> (Re A)\<^sup>2 < (Re B)\<^sup>2)
[PROOF STEP]
let ?H = "(A, B, (cnj B),  A)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. intersects_x_axis (mk_circline A B (cnj B) A) = (A = 0 \<or> (Re A)\<^sup>2 < (Re B)\<^sup>2)
[PROOF STEP]
have "hermitean ?H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hermitean (A, B, cnj B, A)
[PROOF STEP]
using \<open>is_real A\<close>
[PROOF STATE]
proof (prove)
using this:
is_real A

goal (1 subgoal):
 1. hermitean (A, B, cnj B, A)
[PROOF STEP]
unfolding hermitean_def mat_adj_def mat_cnj_def
[PROOF STATE]
proof (prove)
using this:
is_real A

goal (1 subgoal):
 1. mat_map cnj (mat_transpose (A, B, cnj B, A)) = (A, B, cnj B, A)
[PROOF STEP]
using eq_cnj_iff_real
[PROOF STATE]
proof (prove)
using this:
is_real A
(cnj ?z = ?z) = is_real ?z

goal (1 subgoal):
 1. mat_map cnj (mat_transpose (A, B, cnj B, A)) = (A, B, cnj B, A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
hermitean (A, B, cnj B, A)

goal (1 subgoal):
 1. intersects_x_axis (mk_circline A B (cnj B) A) = (A = 0 \<or> (Re A)\<^sup>2 < (Re B)\<^sup>2)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
hermitean (A, B, cnj B, A)

goal (1 subgoal):
 1. intersects_x_axis (mk_circline A B (cnj B) A) = (A = 0 \<or> (Re A)\<^sup>2 < (Re B)\<^sup>2)
[PROOF STEP]
have "?H \<noteq> mat_zero"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A, B, cnj B, A) \<noteq> mat_zero
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_real A
A \<noteq> 0 \<or> B \<noteq> 0

goal (1 subgoal):
 1. (A, B, cnj B, A) \<noteq> mat_zero
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(A, B, cnj B, A) \<noteq> mat_zero

goal (1 subgoal):
 1. intersects_x_axis (mk_circline A B (cnj B) A) = (A = 0 \<or> (Re A)\<^sup>2 < (Re B)\<^sup>2)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
hermitean (A, B, cnj B, A)
(A, B, cnj B, A) \<noteq> mat_zero
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
hermitean (A, B, cnj B, A)
(A, B, cnj B, A) \<noteq> mat_zero

goal (1 subgoal):
 1. intersects_x_axis (mk_circline A B (cnj B) A) = (A = 0 \<or> (Re A)\<^sup>2 < (Re B)\<^sup>2)
[PROOF STEP]
by (transfer, transfer, auto simp add: Let_def)
[PROOF STATE]
proof (state)
this:
intersects_x_axis (mk_circline A B (cnj B) A) = (A = 0 \<or> (Re A)\<^sup>2 < (Re B)\<^sup>2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Sigma_Suc1: "m = n + 1 \<Longrightarrow> below m \<times> B = ({n} \<times> B) \<union> (below n \<times> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m = n + 1 \<Longrightarrow> below m \<times> B = {n} \<times> B \<union> below n \<times> B
[PROOF STEP]
by (simp add: below_def less_Suc_eq) blast


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


[STATEMENT]
lemma coeff_minus [simp]: "coeff (lp1 - lp2) var = coeff lp1 var - coeff lp2 var"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff (lp1 - lp2) var = coeff lp1 var - coeff lp2 var
[PROOF STEP]
unfolding minus_linear_poly_def uminus_linear_poly_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff (lp1 + - 1 *R lp2) var = coeff lp1 var - coeff lp2 var
[PROOF STEP]
by transfer auto


[STATEMENT]
lemma cop_F_RH:
  assumes "d \<in> ds"
  assumes "x \<in> Field (Pd d)"
  assumes "aboveS (Pd d) x \<subseteq> RH fp"
  shows "x \<in> cop_F ds fp"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> cop_F ds fp
[PROOF STEP]
using %invisible assms Pd_linear
[PROOF STATE]
proof (prove)
using this:
d \<in> ds
x \<in> Field (Pd d)
aboveS (Pd d) x \<subseteq> Rf CH fp
\<forall>d. Linear_order (Pd d)

goal (1 subgoal):
 1. x \<in> cop_F ds fp
[PROOF STEP]
unfolding cop_F_def
[PROOF STATE]
proof (prove)
using this:
d \<in> ds
x \<in> Field (Pd d)
aboveS (Pd d) x \<subseteq> Rf CH fp
\<forall>d. Linear_order (Pd d)

goal (1 subgoal):
 1. x \<in> fp \<union> CD_on ds (- Rf CH fp)
[PROOF STEP]
by (clarsimp simp: mem_CD_on_Cd Cd_greatest greatest_def aboveS_def order_on_defs total_on_def subset_iff)
   (metis Compl_Diff_eq Compl_iff Diff_iff IntE Pd_Xd refl_onD)


[STATEMENT]
lemma linear_componentwise_iff:
     "(linear f') \<longleftrightarrow> (\<forall>i\<in>Basis. linear (\<lambda>x. f' x \<bullet> i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. linear f' = (\<forall>i\<in>Basis. linear (\<lambda>x. f' x \<bullet> i))
[PROOF STEP]
apply (auto simp: linear_iff inner_left_distrib)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x y. \<forall>i\<in>Basis. (\<forall>x y. f' (x + y) \<bullet> i = f' x \<bullet> i + f' y \<bullet> i) \<and> (\<forall>c x. f' (c *\<^sub>R x) \<bullet> i = c * (f' x \<bullet> i)) \<Longrightarrow> f' (x + y) = f' x + f' y
 2. \<And>c x. \<forall>i\<in>Basis. (\<forall>x y. f' (x + y) \<bullet> i = f' x \<bullet> i + f' y \<bullet> i) \<and> (\<forall>c x. f' (c *\<^sub>R x) \<bullet> i = c * (f' x \<bullet> i)) \<Longrightarrow> f' (c *\<^sub>R x) = c *\<^sub>R f' x
[PROOF STEP]
apply (metis inner_left_distrib euclidean_eq_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>c x. \<forall>i\<in>Basis. (\<forall>x y. f' (x + y) \<bullet> i = f' x \<bullet> i + f' y \<bullet> i) \<and> (\<forall>c x. f' (c *\<^sub>R x) \<bullet> i = c * (f' x \<bullet> i)) \<Longrightarrow> f' (c *\<^sub>R x) = c *\<^sub>R f' x
[PROOF STEP]
by (metis euclidean_eqI inner_scaleR_left)


[STATEMENT]
lemma luckyFind_eval_augment : "amount \<le> var+1 \<Longrightarrow>
      (\<exists>xs. (length xs = var + 1) \<and> eval (list_conj (map fm.Atom L @ F)) (xs @ \<Gamma>)) =
      (\<exists>xs. (length xs = var + 1) \<and> eval (step_augment luckyFind' IdentityHeuristic amount var L F) (xs @ \<Gamma>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. amount \<le> var + 1 \<Longrightarrow> (\<exists>xs. length xs = var + 1 \<and> eval (list_conj (map fm.Atom L @ F)) (xs @ \<Gamma>)) = (\<exists>xs. length xs = var + 1 \<and> eval (step_augment luckyFind' IdentityHeuristic amount var L F) (xs @ \<Gamma>))
[PROOF STEP]
apply(rule step_augmenter_eval[of luckyFind' IdentityHeuristic amount var L F \<Gamma>])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>xs vara L F \<Gamma>. \<lbrakk>amount \<le> var + 1; length xs = vara\<rbrakk> \<Longrightarrow> (\<exists>x. eval (list_conj (map fm.Atom L @ F)) (xs @ x # \<Gamma>)) = (\<exists>x. eval (luckyFind' vara L F) (xs @ x # \<Gamma>))
 2. \<And>n vara L F. \<lbrakk>amount \<le> var + 1; IdentityHeuristic n L F = vara\<rbrakk> \<Longrightarrow> vara \<le> n
 3. amount \<le> var + 1 \<Longrightarrow> amount \<le> var + 1
[PROOF STEP]
using luckyFind'_eval
[PROOF STATE]
proof (prove)
using this:
length ?xs = ?var \<Longrightarrow> (\<exists>x. eval (list_conj (map fm.Atom ?L @ ?F)) (?xs @ x # ?\<Gamma>)) = (\<exists>x. eval (luckyFind' ?var ?L ?F) (?xs @ x # ?\<Gamma>))

goal (3 subgoals):
 1. \<And>xs vara L F \<Gamma>. \<lbrakk>amount \<le> var + 1; length xs = vara\<rbrakk> \<Longrightarrow> (\<exists>x. eval (list_conj (map fm.Atom L @ F)) (xs @ x # \<Gamma>)) = (\<exists>x. eval (luckyFind' vara L F) (xs @ x # \<Gamma>))
 2. \<And>n vara L F. \<lbrakk>amount \<le> var + 1; IdentityHeuristic n L F = vara\<rbrakk> \<Longrightarrow> vara \<le> n
 3. amount \<le> var + 1 \<Longrightarrow> amount \<le> var + 1
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n vara L F. \<lbrakk>amount \<le> var + 1; IdentityHeuristic n L F = vara\<rbrakk> \<Longrightarrow> vara \<le> n
 2. amount \<le> var + 1 \<Longrightarrow> amount \<le> var + 1
[PROOF STEP]
by auto


[STATEMENT]
lemma bij_betw_from_nat_into: "countable S \<Longrightarrow> infinite S \<Longrightarrow> bij_betw (from_nat_into S) UNIV S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>countable S; infinite S\<rbrakk> \<Longrightarrow> bij_betw (from_nat_into S) UNIV S
[PROOF STEP]
unfolding from_nat_into_def[abs_def]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>countable S; infinite S\<rbrakk> \<Longrightarrow> bij_betw (\<lambda>n. if n \<in> to_nat_on S ` S then inv_into S (to_nat_on S) n else SOME s. s \<in> S) UNIV S
[PROOF STEP]
using to_nat_on_infinite[of S, unfolded bij_betw_def]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>countable S; infinite S\<rbrakk> \<Longrightarrow> inj_on (to_nat_on S) S \<and> to_nat_on S ` S = UNIV

goal (1 subgoal):
 1. \<lbrakk>countable S; infinite S\<rbrakk> \<Longrightarrow> bij_betw (\<lambda>n. if n \<in> to_nat_on S ` S then inv_into S (to_nat_on S) n else SOME s. s \<in> S) UNIV S
[PROOF STEP]
by (auto cong: bij_betw_cong intro: bij_betw_inv_into to_nat_on_infinite)


[STATEMENT]
lemma reachable_s_finite_thm:
  fixes s :: "'a state"
  assumes "finite (PROB :: 'a problem)" "(s \<in> valid_states PROB)"
  shows "finite (reachable_s PROB s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (reachable_s PROB s)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite PROB
s \<in> valid_states PROB

goal (1 subgoal):
 1. finite (reachable_s PROB s)
[PROOF STEP]
by (meson FINITE_valid_states reachable_s_finite_thm_1 rev_finite_subset)


[STATEMENT]
lemma drop_bit_numeral_bit1 [simp]:
  \<open>drop_bit (numeral l) (numeral (Num.Bit1 k)) = drop_bit (pred_numeral l) (numeral k)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. drop_bit (numeral l) (numeral (num.Bit1 k)) = drop_bit (pred_numeral l) (numeral k)
[PROOF STEP]
by (simp add: drop_bit_rec numeral_Bit1_div_2)


[STATEMENT]
lemma nonempty_Fix:
  fixes f :: "'a::complete_lattice \<Rightarrow> 'a"
  shows "mono f \<Longrightarrow> Fix f \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mono f \<Longrightarrow> Fix f \<noteq> {}
[PROOF STEP]
using lfp_in_Fix
[PROOF STATE]
proof (prove)
using this:
mono ?f \<Longrightarrow> lfp ?f \<in> Fix ?f

goal (1 subgoal):
 1. mono f \<Longrightarrow> Fix f \<noteq> {}
[PROOF STEP]
by fastforce


[STATEMENT]
lemma poly_poly_lift[simp]:
  fixes p :: "'a :: comm_semiring_0 poly"
  shows "poly (poly_lift p) [:x:] = [: poly p x :]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (poly_lift p) [:x:] = [:poly p x:]
[PROOF STEP]
proof (induct p)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. poly (poly_lift 0) [:x:] = [:poly 0 x:]
 2. \<And>a p. \<lbrakk>a \<noteq> (0::'a) \<or> p \<noteq> 0; poly (poly_lift p) [:x:] = [:poly p x:]\<rbrakk> \<Longrightarrow> poly (poly_lift (pCons a p)) [:x:] = [:poly (pCons a p) x:]
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. poly (poly_lift 0) [:x:] = [:poly 0 x:]
 2. \<And>a p. \<lbrakk>a \<noteq> (0::'a) \<or> p \<noteq> 0; poly (poly_lift p) [:x:] = [:poly p x:]\<rbrakk> \<Longrightarrow> poly (poly_lift (pCons a p)) [:x:] = [:poly (pCons a p) x:]
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (poly_lift 0) [:x:] = [:poly 0 x:]
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
poly (poly_lift 0) [:x:] = [:poly 0 x:]

goal (1 subgoal):
 1. \<And>a p. \<lbrakk>a \<noteq> (0::'a) \<or> p \<noteq> 0; poly (poly_lift p) [:x:] = [:poly p x:]\<rbrakk> \<Longrightarrow> poly (poly_lift (pCons a p)) [:x:] = [:poly (pCons a p) x:]
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a p. \<lbrakk>a \<noteq> (0::'a) \<or> p \<noteq> 0; poly (poly_lift p) [:x:] = [:poly p x:]\<rbrakk> \<Longrightarrow> poly (poly_lift (pCons a p)) [:x:] = [:poly (pCons a p) x:]
[PROOF STEP]
case (pCons a p)
[PROOF STATE]
proof (state)
this:
a \<noteq> (0::'a) \<or> p \<noteq> 0
poly (poly_lift p) [:x:] = [:poly p x:]

goal (1 subgoal):
 1. \<And>a p. \<lbrakk>a \<noteq> (0::'a) \<or> p \<noteq> 0; poly (poly_lift p) [:x:] = [:poly p x:]\<rbrakk> \<Longrightarrow> poly (poly_lift (pCons a p)) [:x:] = [:poly (pCons a p) x:]
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (poly_lift (pCons a p)) [:x:] = [:poly (pCons a p) x:]
[PROOF STEP]
unfolding poly_lift_pCons
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (pCons [:a:] (poly_lift p)) [:x:] = [:poly (pCons a p) x:]
[PROOF STEP]
unfolding poly_pCons
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [:a:] + [:x:] * poly (poly_lift p) [:x:] = [:a + x * poly p x:]
[PROOF STEP]
unfolding pCons
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [:a:] + [:x:] * [:poly p x:] = [:a + x * poly p x:]
[PROOF STEP]
apply (subst mult.commute)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [:a:] + [:poly p x:] * [:x:] = [:a + x * poly p x:]
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
poly (poly_lift (pCons a p)) [:x:] = [:poly (pCons a p) x:]

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_cong_aux:
  "(\<And>x. x \<in> A \<Longrightarrow> f x = g x) \<Longrightarrow> sum f A = sum g A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> A \<Longrightarrow> f x = g x) \<Longrightarrow> sum f A = sum g A
[PROOF STEP]
by (auto intro: sum.cong)


[STATEMENT]
lemma Eps2_hypext_inverse [simp]:
  "Base (x::'a::real_normed_field hyperdual) \<noteq> 0 \<Longrightarrow> Eps2 (inverse x) = - Eps2 x * (1 / (Base x)\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Base x \<noteq> (0::'a) \<Longrightarrow> Eps2 (inverse x) = - Eps2 x * ((1::'a) / (Base x)\<^sup>2)
[PROOF STEP]
by simp


[STATEMENT]
theorem integral_char:
  assumes ms: "measure_space M" and mA: "A \<in> measurable_sets M"
  shows "\<integral> \<chi> A \<partial> M = measure M A" and "integrable \<chi> A M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral> \<chi> A \<partial>M = Measure.measure M A &&& integrable \<chi> A M
[PROOF STEP]
(*<*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral> \<chi> A \<partial>M = Measure.measure M A &&& integrable \<chi> A M
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<integral> \<chi> A \<partial>M = Measure.measure M A
 2. integrable \<chi> A M
[PROOF STEP]
from ms mA
[PROOF STATE]
proof (chain)
picking this:
measure_space M
A \<in> measurable_sets M
[PROOF STEP]
have "measure M A \<in> sfis \<chi> A M"
[PROOF STATE]
proof (prove)
using this:
measure_space M
A \<in> measurable_sets M

goal (1 subgoal):
 1. Measure.measure M A \<in> sfis \<chi> A M
[PROOF STEP]
by (rule sfis_char)
[PROOF STATE]
proof (state)
this:
Measure.measure M A \<in> sfis \<chi> A M

goal (2 subgoals):
 1. \<integral> \<chi> A \<partial>M = Measure.measure M A
 2. integrable \<chi> A M
[PROOF STEP]
hence nnfis: "measure M A \<in> nnfis \<chi> A M"
[PROOF STATE]
proof (prove)
using this:
Measure.measure M A \<in> sfis \<chi> A M

goal (1 subgoal):
 1. Measure.measure M A \<in> nnfis \<chi> A M
[PROOF STEP]
by (rule sfis_nnfis)
[PROOF STATE]
proof (state)
this:
Measure.measure M A \<in> nnfis \<chi> A M

goal (2 subgoals):
 1. \<integral> \<chi> A \<partial>M = Measure.measure M A
 2. integrable \<chi> A M
[PROOF STEP]
from this and ms
[PROOF STATE]
proof (chain)
picking this:
Measure.measure M A \<in> nnfis \<chi> A M
measure_space M
[PROOF STEP]
show "\<integral> \<chi> A \<partial> M = measure M A"
[PROOF STATE]
proof (prove)
using this:
Measure.measure M A \<in> nnfis \<chi> A M
measure_space M

goal (1 subgoal):
 1. \<integral> \<chi> A \<partial>M = Measure.measure M A
[PROOF STEP]
by (rule nnfis_integral)
[PROOF STATE]
proof (state)
this:
\<integral> \<chi> A \<partial>M = Measure.measure M A

goal (1 subgoal):
 1. integrable \<chi> A M
[PROOF STEP]
from nnfis and ms
[PROOF STATE]
proof (chain)
picking this:
Measure.measure M A \<in> nnfis \<chi> A M
measure_space M
[PROOF STEP]
show "integrable \<chi> A M"
[PROOF STATE]
proof (prove)
using this:
Measure.measure M A \<in> nnfis \<chi> A M
measure_space M

goal (1 subgoal):
 1. integrable \<chi> A M
[PROOF STEP]
by (rule nnfis_integral)
[PROOF STATE]
proof (state)
this:
integrable \<chi> A M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma iT_Mult_Int: "0 < k \<Longrightarrow> (A \<inter> B) \<otimes> k = (A \<otimes> k) \<inter> (B \<otimes> k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < k \<Longrightarrow> A \<inter> B \<otimes> k = (A \<otimes> k) \<inter> (B \<otimes> k)
[PROOF STEP]
by (simp add: iT_Mult_def image_Int mult_right_inj)


[STATEMENT]
lemma permI:
  assumes "bij f" and "MOST x. f x = x" and "\<And>a. sort_of (f a) = sort_of a"
  shows "f \<in> perm"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> perm
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
bij f
\<forall>\<^sub>\<infinity>x. f x = x
sort_of (f ?a) = sort_of ?a

goal (1 subgoal):
 1. f \<in> perm
[PROOF STEP]
unfolding perm_def MOST_iff_cofinite
[PROOF STATE]
proof (prove)
using this:
bij f
finite {x. f x \<noteq> x}
sort_of (f ?a) = sort_of ?a

goal (1 subgoal):
 1. f \<in> {f. bij f \<and> finite {a. f a \<noteq> a} \<and> (\<forall>a. sort_of (f a) = sort_of a)}
[PROOF STEP]
by simp


[STATEMENT]
lemma measurable_stopping_time:
  fixes T :: "'a \<Rightarrow> 't::{linorder_topology, second_countable_topology}"
  assumes T: "stopping_time F T"
    and M: "\<And>t. sets (F t) \<subseteq> sets M" "\<And>t. space (F t) = space M"
  shows "T \<in> M \<rightarrow>\<^sub>M borel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T \<in> borel_measurable M
[PROOF STEP]
proof (rule borel_measurableI_le)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. {x \<in> space M. T x \<le> y} \<in> sets M
[PROOF STEP]
show "{x \<in> space M. T x \<le> t} \<in> sets M" for t
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> space M. T x \<le> t} \<in> sets M
[PROOF STEP]
using stopping_timeD[OF T] M
[PROOF STATE]
proof (prove)
using this:
Measurable.pred (F ?t) (\<lambda>x. T x \<le> ?t)
sets (F ?t) \<subseteq> sets M
space (F ?t) = space M

goal (1 subgoal):
 1. {x \<in> space M. T x \<le> t} \<in> sets M
[PROOF STEP]
by (auto simp: Measurable.pred_def)
[PROOF STATE]
proof (state)
this:
{x \<in> space M. T x \<le> ?t} \<in> sets M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fps_const_mult[simp]:
  fixes c d :: "'a::{comm_monoid_add,mult_zero}"
  shows "fps_const c * fps_const d = fps_const (c * d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_const c * fps_const d = fps_const (c * d)
[PROOF STEP]
by    (simp add: fps_eq_iff fps_mult_nth sum.neutral)


[STATEMENT]
lemma surj_Sup_pres_inj_on:
  fixes f :: "'a::complete_lattice_with_dual \<Rightarrow> 'b::complete_lattice_with_dual"
  assumes "surj f"
  and "Sup_pres f"
  shows "inj_on f (range (radj f \<circ> f))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on f (range (radj f \<circ> f))
[PROOF STEP]
by (smt Sup_pres_ladj_aux adj_idem2 assms(2) comp_apply inj_on_def retraction_prop)


[STATEMENT]
lemma add_nonneg_pos_ne_zero: "a \<ge> 0 \<Longrightarrow> b > 0 \<Longrightarrow> a + b \<noteq> 0" for a b::real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> a; 0 < b\<rbrakk> \<Longrightarrow> a + b \<noteq> 0
[PROOF STEP]
by arith


[STATEMENT]
lemma nodes_ins_edge[simp]: "nodes (ins_edge e g) = {fst e, snd e} \<union> nodes g"
  and edges_ins_edge:
    "edges (ins_edge e g)
      = (if fst e = snd e then edges g else {e,prod.swap e}\<union>(edges g))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nodes (ins_edge e g) = {fst e, snd e} \<union> nodes g &&& edges (ins_edge e g) = (if fst e = snd e then edges g else {e, prod.swap e} \<union> edges g)
[PROOF STEP]
unfolding ins_edge_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nodes (graph (nodes g) (insert e (edges g))) = {fst e, snd e} \<union> nodes g &&& edges (graph (nodes g) (insert e (edges g))) = (if fst e = snd e then edges g else {e, prod.swap e} \<union> edges g)
[PROOF STEP]
apply (all \<open>cases e\<close>)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a b. e = (a, b) \<Longrightarrow> nodes (graph (nodes g) (insert e (edges g))) = {fst e, snd e} \<union> nodes g
 2. \<And>a b. e = (a, b) \<Longrightarrow> edges (graph (nodes g) (insert e (edges g))) = (if fst e = snd e then edges g else {e, prod.swap e} \<union> edges g)
[PROOF STEP]
by (auto simp: graph_accs dest: edges_sym')


[STATEMENT]
lemma sdiv_neg_neg: "a < 0 \<Longrightarrow> b < 0 \<Longrightarrow> a sdiv b = - a div - b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a < 0; b < 0\<rbrakk> \<Longrightarrow> a sdiv b = - a div - b
[PROOF STEP]
by (simp add: sdiv_def sgn_if)


[STATEMENT]
lemma (in Ring) nsumMulEleL: "\<And> n. \<lbrakk> \<forall> i. f i \<in> carrier R; x \<in> carrier R \<rbrakk>
        \<Longrightarrow> x \<cdot>\<^sub>r (nsum R f n) = nsum R (\<lambda> i. x \<cdot>\<^sub>r (f i)) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<forall>i. f i \<in> carrier R; x \<in> carrier R\<rbrakk> \<Longrightarrow> x \<cdot>\<^sub>r \<Sigma>\<^sub>e R f n = \<Sigma>\<^sub>e R (\<lambda>i. x \<cdot>\<^sub>r f i) n
[PROOF STEP]
apply (cut_tac ring_is_ag)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<forall>i. f i \<in> carrier R; x \<in> carrier R; aGroup R\<rbrakk> \<Longrightarrow> x \<cdot>\<^sub>r \<Sigma>\<^sub>e R f n = \<Sigma>\<^sub>e R (\<lambda>i. x \<cdot>\<^sub>r f i) n
[PROOF STEP]
apply (induct_tac "n")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n. \<lbrakk>\<forall>i. f i \<in> carrier R; x \<in> carrier R; aGroup R\<rbrakk> \<Longrightarrow> x \<cdot>\<^sub>r \<Sigma>\<^sub>e R f 0 = \<Sigma>\<^sub>e R (\<lambda>i. x \<cdot>\<^sub>r f i) 0
 2. \<And>n na. \<lbrakk>\<forall>i. f i \<in> carrier R; x \<in> carrier R; aGroup R; x \<cdot>\<^sub>r \<Sigma>\<^sub>e R f na = \<Sigma>\<^sub>e R (\<lambda>i. x \<cdot>\<^sub>r f i) na\<rbrakk> \<Longrightarrow> x \<cdot>\<^sub>r \<Sigma>\<^sub>e R f Suc na = \<Sigma>\<^sub>e R (\<lambda>i. x \<cdot>\<^sub>r f i) Suc na
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n na. \<lbrakk>\<forall>i. f i \<in> carrier R; x \<in> carrier R; aGroup R; x \<cdot>\<^sub>r \<Sigma>\<^sub>e R f na = \<Sigma>\<^sub>e R (\<lambda>i. x \<cdot>\<^sub>r f i) na\<rbrakk> \<Longrightarrow> x \<cdot>\<^sub>r \<Sigma>\<^sub>e R f Suc na = \<Sigma>\<^sub>e R (\<lambda>i. x \<cdot>\<^sub>r f i) Suc na
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>na. \<lbrakk>\<forall>i. f i \<in> carrier R; x \<in> carrier R; aGroup R; x \<cdot>\<^sub>r \<Sigma>\<^sub>e R f na = \<Sigma>\<^sub>e R (\<lambda>i. x \<cdot>\<^sub>r f i) na\<rbrakk> \<Longrightarrow> x \<cdot>\<^sub>r (\<Sigma>\<^sub>e R f na \<plusminus> f (Suc na)) = \<Sigma>\<^sub>e R (\<lambda>i. x \<cdot>\<^sub>r f i) na \<plusminus> x \<cdot>\<^sub>r f (Suc na)
[PROOF STEP]
apply (subst ring_distrib1, assumption)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>na. \<lbrakk>\<forall>i. f i \<in> carrier R; x \<in> carrier R; aGroup R; x \<cdot>\<^sub>r \<Sigma>\<^sub>e R f na = \<Sigma>\<^sub>e R (\<lambda>i. x \<cdot>\<^sub>r f i) na\<rbrakk> \<Longrightarrow> \<Sigma>\<^sub>e R f na \<in> carrier R
 2. \<And>na. \<lbrakk>\<forall>i. f i \<in> carrier R; x \<in> carrier R; aGroup R; x \<cdot>\<^sub>r \<Sigma>\<^sub>e R f na = \<Sigma>\<^sub>e R (\<lambda>i. x \<cdot>\<^sub>r f i) na\<rbrakk> \<Longrightarrow> f (Suc na) \<in> carrier R
 3. \<And>na. \<lbrakk>\<forall>i. f i \<in> carrier R; x \<in> carrier R; aGroup R; x \<cdot>\<^sub>r \<Sigma>\<^sub>e R f na = \<Sigma>\<^sub>e R (\<lambda>i. x \<cdot>\<^sub>r f i) na\<rbrakk> \<Longrightarrow> x \<cdot>\<^sub>r \<Sigma>\<^sub>e R f na \<plusminus> x \<cdot>\<^sub>r f (Suc na) = \<Sigma>\<^sub>e R (\<lambda>i. x \<cdot>\<^sub>r f i) na \<plusminus> x \<cdot>\<^sub>r f (Suc na)
[PROOF STEP]
apply (rule aGroup.nsum_mem, assumption)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>na. \<lbrakk>\<forall>i. f i \<in> carrier R; x \<in> carrier R; aGroup R; x \<cdot>\<^sub>r \<Sigma>\<^sub>e R f na = \<Sigma>\<^sub>e R (\<lambda>i. x \<cdot>\<^sub>r f i) na\<rbrakk> \<Longrightarrow> \<forall>j\<le>na. f j \<in> carrier R
 2. \<And>na. \<lbrakk>\<forall>i. f i \<in> carrier R; x \<in> carrier R; aGroup R; x \<cdot>\<^sub>r \<Sigma>\<^sub>e R f na = \<Sigma>\<^sub>e R (\<lambda>i. x \<cdot>\<^sub>r f i) na\<rbrakk> \<Longrightarrow> f (Suc na) \<in> carrier R
 3. \<And>na. \<lbrakk>\<forall>i. f i \<in> carrier R; x \<in> carrier R; aGroup R; x \<cdot>\<^sub>r \<Sigma>\<^sub>e R f na = \<Sigma>\<^sub>e R (\<lambda>i. x \<cdot>\<^sub>r f i) na\<rbrakk> \<Longrightarrow> x \<cdot>\<^sub>r \<Sigma>\<^sub>e R f na \<plusminus> x \<cdot>\<^sub>r f (Suc na) = \<Sigma>\<^sub>e R (\<lambda>i. x \<cdot>\<^sub>r f i) na \<plusminus> x \<cdot>\<^sub>r f (Suc na)
[PROOF STEP]
apply (rule allI, simp+)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma vintersection_vunion_left: "(A \<union>\<^sub>\<circ> B) \<inter>\<^sub>\<circ> C = (A \<inter>\<^sub>\<circ> C) \<union>\<^sub>\<circ> (B \<inter>\<^sub>\<circ> C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A \<union>\<^sub>\<circ> B) \<inter>\<^sub>\<circ> C = A \<inter>\<^sub>\<circ> C \<union>\<^sub>\<circ> B \<inter>\<^sub>\<circ> C
[PROOF STEP]
by auto


[STATEMENT]
lemma cfun_join_below:
  fixes f :: "('a::Finite_Join_cpo) \<rightarrow> ('b::Finite_Join_cpo)"
  shows "f\<cdot>x \<squnion> f\<cdot>y \<sqsubseteq> f\<cdot>(x \<squnion> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f\<cdot>x \<squnion> f\<cdot>y \<sqsubseteq> f\<cdot>(x \<squnion> y)
[PROOF STEP]
by (intro join_below monofun_cfun_arg join_above1 join_above2)


[STATEMENT]
lemma chromatic_lb:
  assumes wf_G: "uwellformed G"
    and fin_G: "finite (uverts G)"
    and neG: "uverts G \<noteq> {}"
  shows "card (uverts G) / \<alpha> G \<le> chromatic_number G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ereal (real (card (uverts G))) / ereal_of_enat (\<alpha> G) \<le> ereal_of_enat (chromatic_number G)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ereal (real (card (uverts G))) / ereal_of_enat (\<alpha> G) \<le> ereal_of_enat (chromatic_number G)
[PROOF STEP]
from wf_G
[PROOF STATE]
proof (chain)
picking this:
uwellformed G
[PROOF STEP]
have "(\<lambda>v. {v}) ` uverts G \<in> vertex_colorings G"
[PROOF STATE]
proof (prove)
using this:
uwellformed G

goal (1 subgoal):
 1. (\<lambda>v. {v}) ` uverts G \<in> vertex_colorings G
[PROOF STEP]
by (auto simp: vertex_colorings_def uwellformed_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>v. {v}) ` uverts G \<in> vertex_colorings G

goal (1 subgoal):
 1. ereal (real (card (uverts G))) / ereal_of_enat (\<alpha> G) \<le> ereal_of_enat (chromatic_number G)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>v. {v}) ` uverts G \<in> vertex_colorings G
[PROOF STEP]
have "chromatic_number G \<noteq> top"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>v. {v}) ` uverts G \<in> vertex_colorings G

goal (1 subgoal):
 1. chromatic_number G \<noteq> top
[PROOF STEP]
by (simp add: chromatic_number_def) (auto simp: top_enat_def)
[PROOF STATE]
proof (state)
this:
chromatic_number G \<noteq> top

goal (1 subgoal):
 1. ereal (real (card (uverts G))) / ereal_of_enat (\<alpha> G) \<le> ereal_of_enat (chromatic_number G)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
chromatic_number G \<noteq> top
[PROOF STEP]
obtain vc where vc_vc: "vc \<in> vertex_colorings G"
    and vc_size:"chromatic_number G = card vc"
[PROOF STATE]
proof (prove)
using this:
chromatic_number G \<noteq> top

goal (1 subgoal):
 1. (\<And>vc. \<lbrakk>vc \<in> vertex_colorings G; chromatic_number G = enat (card vc)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding chromatic_number_def
[PROOF STATE]
proof (prove)
using this:
(INF c\<in>vertex_colorings G. enat (card c)) \<noteq> top

goal (1 subgoal):
 1. (\<And>vc. \<lbrakk>vc \<in> vertex_colorings G; (INF c\<in>vertex_colorings G. enat (card c)) = enat (card vc)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (rule enat_in_INF)
[PROOF STATE]
proof (state)
this:
vc \<in> vertex_colorings G
chromatic_number G = enat (card vc)

goal (1 subgoal):
 1. ereal (real (card (uverts G))) / ereal_of_enat (\<alpha> G) \<le> ereal_of_enat (chromatic_number G)
[PROOF STEP]
have fin_vc_elems: "\<And>c. c \<in> vc \<Longrightarrow> finite c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>c. c \<in> vc \<Longrightarrow> finite c
[PROOF STEP]
using vc_vc
[PROOF STATE]
proof (prove)
using this:
vc \<in> vertex_colorings G

goal (1 subgoal):
 1. \<And>c. c \<in> vc \<Longrightarrow> finite c
[PROOF STEP]
by (intro finite_subset[OF _ fin_G]) (auto simp: vertex_colorings_def)
[PROOF STATE]
proof (state)
this:
?c \<in> vc \<Longrightarrow> finite ?c

goal (1 subgoal):
 1. ereal (real (card (uverts G))) / ereal_of_enat (\<alpha> G) \<le> ereal_of_enat (chromatic_number G)
[PROOF STEP]
have sum_vc_card: "(\<Sum>c \<in> vc. card c) = card (uverts G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum card vc = card (uverts G)
[PROOF STEP]
using fin_vc_elems vc_vc
[PROOF STATE]
proof (prove)
using this:
?c \<in> vc \<Longrightarrow> finite ?c
vc \<in> vertex_colorings G

goal (1 subgoal):
 1. sum card vc = card (uverts G)
[PROOF STEP]
unfolding vertex_colorings_def
[PROOF STATE]
proof (prove)
using this:
?c \<in> vc \<Longrightarrow> finite ?c
vc \<in> {C. \<Union> C = uverts G \<and> (\<forall>c1\<in>C. \<forall>c2\<in>C. c1 \<noteq> c2 \<longrightarrow> c1 \<inter> c2 = {}) \<and> (\<forall>c\<in>C. c \<noteq> {} \<and> (\<forall>u\<in>c. \<forall>v\<in>c. {u, v} \<notin> uedges G))}

goal (1 subgoal):
 1. sum card vc = card (uverts G)
[PROOF STEP]
by (simp add: card_Union_disjoint[symmetric] pairwise_def disjnt_def)
[PROOF STATE]
proof (state)
this:
sum card vc = card (uverts G)

goal (1 subgoal):
 1. ereal (real (card (uverts G))) / ereal_of_enat (\<alpha> G) \<le> ereal_of_enat (chromatic_number G)
[PROOF STEP]
have "\<And>c. c \<in> vc \<Longrightarrow> c \<in> independent_sets G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>c. c \<in> vc \<Longrightarrow> c \<in> independent_sets G
[PROOF STEP]
using vc_vc
[PROOF STATE]
proof (prove)
using this:
vc \<in> vertex_colorings G

goal (1 subgoal):
 1. \<And>c. c \<in> vc \<Longrightarrow> c \<in> independent_sets G
[PROOF STEP]
by (auto simp: vertex_colorings_def independent_sets_def all_edges_def)
[PROOF STATE]
proof (state)
this:
?c \<in> vc \<Longrightarrow> ?c \<in> independent_sets G

goal (1 subgoal):
 1. ereal (real (card (uverts G))) / ereal_of_enat (\<alpha> G) \<le> ereal_of_enat (chromatic_number G)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?c \<in> vc \<Longrightarrow> ?c \<in> independent_sets G
[PROOF STEP]
have "\<And>c. c \<in> vc \<Longrightarrow> card c \<le> \<alpha> G"
[PROOF STATE]
proof (prove)
using this:
?c \<in> vc \<Longrightarrow> ?c \<in> independent_sets G

goal (1 subgoal):
 1. \<And>c. c \<in> vc \<Longrightarrow> enat (card c) \<le> \<alpha> G
[PROOF STEP]
using vc_vc fin_vc_elems
[PROOF STATE]
proof (prove)
using this:
?c \<in> vc \<Longrightarrow> ?c \<in> independent_sets G
vc \<in> vertex_colorings G
?c \<in> vc \<Longrightarrow> finite ?c

goal (1 subgoal):
 1. \<And>c. c \<in> vc \<Longrightarrow> enat (card c) \<le> \<alpha> G
[PROOF STEP]
by (subst le_\<alpha>_iff) (auto simp add: vertex_colorings_def)
[PROOF STATE]
proof (state)
this:
?c \<in> vc \<Longrightarrow> enat (card ?c) \<le> \<alpha> G

goal (1 subgoal):
 1. ereal (real (card (uverts G))) / ereal_of_enat (\<alpha> G) \<le> ereal_of_enat (chromatic_number G)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?c \<in> vc \<Longrightarrow> enat (card ?c) \<le> \<alpha> G
[PROOF STEP]
have "(\<Sum>c\<in>vc. card c) \<le> card vc * \<alpha> G"
[PROOF STATE]
proof (prove)
using this:
?c \<in> vc \<Longrightarrow> enat (card ?c) \<le> \<alpha> G

goal (1 subgoal):
 1. enat (sum card vc) \<le> enat (card vc) * \<alpha> G
[PROOF STEP]
using sum_bounded_above[of vc card "\<alpha> G"]
[PROOF STATE]
proof (prove)
using this:
?c \<in> vc \<Longrightarrow> enat (card ?c) \<le> \<alpha> G
(\<And>i. i \<in> vc \<Longrightarrow> enat (card i) \<le> \<alpha> G) \<Longrightarrow> (\<Sum>x\<in>vc. enat (card x)) \<le> of_nat (card vc) * \<alpha> G

goal (1 subgoal):
 1. enat (sum card vc) \<le> enat (card vc) * \<alpha> G
[PROOF STEP]
by (simp add: of_nat_eq_enat[symmetric] of_nat_sum)
[PROOF STATE]
proof (state)
this:
enat (sum card vc) \<le> enat (card vc) * \<alpha> G

goal (1 subgoal):
 1. ereal (real (card (uverts G))) / ereal_of_enat (\<alpha> G) \<le> ereal_of_enat (chromatic_number G)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
enat (sum card vc) \<le> enat (card vc) * \<alpha> G
[PROOF STEP]
have "ereal_of_enat (card (uverts G)) \<le> ereal_of_enat (\<alpha> G) * ereal_of_enat (card vc)"
[PROOF STATE]
proof (prove)
using this:
enat (sum card vc) \<le> enat (card vc) * \<alpha> G

goal (1 subgoal):
 1. ereal_of_enat (enat (card (uverts G))) \<le> ereal_of_enat (\<alpha> G) * ereal_of_enat (enat (card vc))
[PROOF STEP]
by (simp add: sum_vc_card ereal_of_enat_pushout ac_simps del: ereal_of_enat_simps)
[PROOF STATE]
proof (state)
this:
ereal_of_enat (enat (card (uverts G))) \<le> ereal_of_enat (\<alpha> G) * ereal_of_enat (enat (card vc))

goal (1 subgoal):
 1. ereal (real (card (uverts G))) / ereal_of_enat (\<alpha> G) \<le> ereal_of_enat (chromatic_number G)
[PROOF STEP]
with zero_less_\<alpha>[OF neG] \<alpha>_fin[OF fin_G] vc_size
[PROOF STATE]
proof (chain)
picking this:
0 < \<alpha> G
\<alpha> G \<noteq> \<infinity>
chromatic_number G = enat (card vc)
ereal_of_enat (enat (card (uverts G))) \<le> ereal_of_enat (\<alpha> G) * ereal_of_enat (enat (card vc))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < \<alpha> G
\<alpha> G \<noteq> \<infinity>
chromatic_number G = enat (card vc)
ereal_of_enat (enat (card (uverts G))) \<le> ereal_of_enat (\<alpha> G) * ereal_of_enat (enat (card vc))

goal (1 subgoal):
 1. ereal (real (card (uverts G))) / ereal_of_enat (\<alpha> G) \<le> ereal_of_enat (chromatic_number G)
[PROOF STEP]
by (simp add: ereal_divide_le_pos)
[PROOF STATE]
proof (state)
this:
ereal (real (card (uverts G))) / ereal_of_enat (\<alpha> G) \<le> ereal_of_enat (chromatic_number G)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ccsubspace_Sup_empty: "Sup {} = (0::_ ccsubspace)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Squnion> {} = 0
[PROOF STEP]
unfolding zero_ccsubspace_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Squnion> {} = \<bottom>
[PROOF STEP]
by auto


[STATEMENT]
lemma subst_word_conc [simp]: "subst_word f ` (A @@ B) = subst_word f ` A @@ subst_word f ` B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subst_word f ` (A @@ B) = subst_word f ` A @@ subst_word f ` B
[PROOF STEP]
unfolding conc_def image_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {y. \<exists>x\<in>{xs @ ys |xs ys. xs \<in> A \<and> ys \<in> B}. y = subst_word f x} = {xs @ ys |xs ys. xs \<in> {y. \<exists>x\<in>A. y = subst_word f x} \<and> ys \<in> {y. \<exists>x\<in>B. y = subst_word f x}}
[PROOF STEP]
by force


[STATEMENT]
lemma non_span_det_zero:
  assumes len: "length G = n"
  and nonb:"\<not> (carrier_vec n \<subseteq> span (set G))"
  and carr:"set G \<subseteq> carrier_vec n"
  shows "det (mat_of_rows n G) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (mat_of_rows n G) = (0::'a)
[PROOF STEP]
unfolding det_0_iff_vec_prod_zero
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (mat_of_rows n G) = (0::'a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. det (mat_of_rows n G) = (0::'a)
[PROOF STEP]
let ?A = "(mat_of_rows n G)\<^sup>T"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. det (mat_of_rows n G) = (0::'a)
[PROOF STEP]
let ?B = "1\<^sub>m n"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. det (mat_of_rows n G) = (0::'a)
[PROOF STEP]
from carr
[PROOF STATE]
proof (chain)
picking this:
set G \<subseteq> carrier_vec n
[PROOF STEP]
have carr_mat:"?A \<in> carrier_mat n n" "?B \<in> carrier_mat n n" "mat_of_rows n G \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
using this:
set G \<subseteq> carrier_vec n

goal (1 subgoal):
 1. (mat_of_rows n G)\<^sup>T \<in> carrier_mat n n &&& 1\<^sub>m n \<in> carrier_mat n n &&& mat_of_rows n G \<in> carrier_mat n n
[PROOF STEP]
using len mat_of_rows_carrier(1)
[PROOF STATE]
proof (prove)
using this:
set G \<subseteq> carrier_vec n
length G = n
mat_of_rows ?n ?vs \<in> carrier_mat (length ?vs) ?n

goal (1 subgoal):
 1. (mat_of_rows n G)\<^sup>T \<in> carrier_mat n n &&& 1\<^sub>m n \<in> carrier_mat n n &&& mat_of_rows n G \<in> carrier_mat n n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(mat_of_rows n G)\<^sup>T \<in> carrier_mat n n
1\<^sub>m n \<in> carrier_mat n n
mat_of_rows n G \<in> carrier_mat n n

goal (1 subgoal):
 1. det (mat_of_rows n G) = (0::'a)
[PROOF STEP]
from carr
[PROOF STATE]
proof (chain)
picking this:
set G \<subseteq> carrier_vec n
[PROOF STEP]
have g_len:"\<And> i. i < length G \<Longrightarrow> G ! i \<in> carrier_vec n"
[PROOF STATE]
proof (prove)
using this:
set G \<subseteq> carrier_vec n

goal (1 subgoal):
 1. \<And>i. i < length G \<Longrightarrow> G ! i \<in> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?i5 < length G \<Longrightarrow> G ! ?i5 \<in> carrier_vec n

goal (1 subgoal):
 1. det (mat_of_rows n G) = (0::'a)
[PROOF STEP]
from nonb
[PROOF STATE]
proof (chain)
picking this:
\<not> carrier_vec n \<subseteq> local.span (set G)
[PROOF STEP]
obtain v where v:"v \<in> carrier_vec n" "v \<notin> span (set G)"
[PROOF STATE]
proof (prove)
using this:
\<not> carrier_vec n \<subseteq> local.span (set G)

goal (1 subgoal):
 1. (\<And>v. \<lbrakk>v \<in> carrier_vec n; v \<notin> local.span (set G)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
v \<in> carrier_vec n
v \<notin> local.span (set G)

goal (1 subgoal):
 1. det (mat_of_rows n G) = (0::'a)
[PROOF STEP]
hence "v \<noteq> 0\<^sub>v n"
[PROOF STATE]
proof (prove)
using this:
v \<in> carrier_vec n
v \<notin> local.span (set G)

goal (1 subgoal):
 1. v \<noteq> 0\<^sub>v n
[PROOF STEP]
using span_zero
[PROOF STATE]
proof (prove)
using this:
v \<in> carrier_vec n
v \<notin> local.span (set G)
0\<^sub>v n \<in> local.span ?U

goal (1 subgoal):
 1. v \<noteq> 0\<^sub>v n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v \<noteq> 0\<^sub>v n

goal (1 subgoal):
 1. det (mat_of_rows n G) = (0::'a)
[PROOF STEP]
obtain B C where gj:"gauss_jordan ?A ?B = (B,C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>B C. gauss_jordan (mat_of_rows n G)\<^sup>T (1\<^sub>m n) = (B, C) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
gauss_jordan (mat_of_rows n G)\<^sup>T (1\<^sub>m n) = (B, C)

goal (1 subgoal):
 1. det (mat_of_rows n G) = (0::'a)
[PROOF STEP]
note gj = carr_mat(1,2) gj
[PROOF STATE]
proof (state)
this:
(mat_of_rows n G)\<^sup>T \<in> carrier_mat n n
1\<^sub>m n \<in> carrier_mat n n
gauss_jordan (mat_of_rows n G)\<^sup>T (1\<^sub>m n) = (B, C)

goal (1 subgoal):
 1. det (mat_of_rows n G) = (0::'a)
[PROOF STEP]
hence B:"B = fst (gauss_jordan ?A ?B)"
[PROOF STATE]
proof (prove)
using this:
(mat_of_rows n G)\<^sup>T \<in> carrier_mat n n
1\<^sub>m n \<in> carrier_mat n n
gauss_jordan (mat_of_rows n G)\<^sup>T (1\<^sub>m n) = (B, C)

goal (1 subgoal):
 1. B = fst (gauss_jordan (mat_of_rows n G)\<^sup>T (1\<^sub>m n))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
B = fst (gauss_jordan (mat_of_rows n G)\<^sup>T (1\<^sub>m n))

goal (1 subgoal):
 1. det (mat_of_rows n G) = (0::'a)
[PROOF STEP]
from gauss_jordan[OF gj]
[PROOF STATE]
proof (chain)
picking this:
?x \<in> carrier_vec n \<Longrightarrow> ((mat_of_rows n G)\<^sup>T *\<^sub>v ?x = 0\<^sub>v n) = (B *\<^sub>v ?x = 0\<^sub>v n)
?X \<in> carrier_mat n n \<Longrightarrow> ((mat_of_rows n G)\<^sup>T * ?X = 1\<^sub>m n) = (B * ?X = C)
B \<in> carrier_mat n n
C \<in> carrier_mat n n
[PROOF STEP]
have BC:"B \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
using this:
?x \<in> carrier_vec n \<Longrightarrow> ((mat_of_rows n G)\<^sup>T *\<^sub>v ?x = 0\<^sub>v n) = (B *\<^sub>v ?x = 0\<^sub>v n)
?X \<in> carrier_mat n n \<Longrightarrow> ((mat_of_rows n G)\<^sup>T * ?X = 1\<^sub>m n) = (B * ?X = C)
B \<in> carrier_mat n n
C \<in> carrier_mat n n

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

goal (1 subgoal):
 1. det (mat_of_rows n G) = (0::'a)
[PROOF STEP]
from gauss_jordan_transform[OF gj]
[PROOF STATE]
proof (chain)
picking this:
\<exists>P\<in>Units (ring_mat TYPE('a) n ?b). B = P * (mat_of_rows n G)\<^sup>T \<and> C = P * 1\<^sub>m n
[PROOF STEP]
obtain P where
   P:"P\<in>Units (ring_mat TYPE('a) n ?B)"  "B = P * ?A"
[PROOF STATE]
proof (prove)
using this:
\<exists>P\<in>Units (ring_mat TYPE('a) n ?b). B = P * (mat_of_rows n G)\<^sup>T \<and> C = P * 1\<^sub>m n

goal (1 subgoal):
 1. (\<And>P. \<lbrakk>P \<in> Units (ring_mat TYPE('a) n (1\<^sub>m n)); B = P * (mat_of_rows n G)\<^sup>T\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
P \<in> Units (ring_mat TYPE('a) n (1\<^sub>m n))
B = P * (mat_of_rows n G)\<^sup>T

goal (1 subgoal):
 1. det (mat_of_rows n G) = (0::'a)
[PROOF STEP]
hence PC:"P \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
using this:
P \<in> Units (ring_mat TYPE('a) n (1\<^sub>m n))
B = P * (mat_of_rows n G)\<^sup>T

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

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

goal (1 subgoal):
 1. det (mat_of_rows n G) = (0::'a)
[PROOF STEP]
from mat_inverse[OF PC] P
[PROOF STATE]
proof (chain)
picking this:
mat_inverse P = None \<Longrightarrow> P \<notin> Units (ring_mat TYPE('a) n ?b)
mat_inverse P = Some ?B \<Longrightarrow> P * ?B = 1\<^sub>m n \<and> ?B * P = 1\<^sub>m n \<and> ?B \<in> carrier_mat n n
P \<in> Units (ring_mat TYPE('a) n (1\<^sub>m n))
B = P * (mat_of_rows n G)\<^sup>T
[PROOF STEP]
obtain PI where "mat_inverse P = Some PI"
[PROOF STATE]
proof (prove)
using this:
mat_inverse P = None \<Longrightarrow> P \<notin> Units (ring_mat TYPE('a) n ?b)
mat_inverse P = Some ?B \<Longrightarrow> P * ?B = 1\<^sub>m n \<and> ?B * P = 1\<^sub>m n \<and> ?B \<in> carrier_mat n n
P \<in> Units (ring_mat TYPE('a) n (1\<^sub>m n))
B = P * (mat_of_rows n G)\<^sup>T

goal (1 subgoal):
 1. (\<And>PI. mat_inverse P = Some PI \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
mat_inverse P = Some PI

goal (1 subgoal):
 1. det (mat_of_rows n G) = (0::'a)
[PROOF STEP]
from mat_inverse(2)[OF PC this]
[PROOF STATE]
proof (chain)
picking this:
P * PI = 1\<^sub>m n \<and> PI * P = 1\<^sub>m n \<and> PI \<in> carrier_mat n n
[PROOF STEP]
have PI:"P * PI = 1\<^sub>m n" "PI * P = 1\<^sub>m n" "PI \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
using this:
P * PI = 1\<^sub>m n \<and> PI * P = 1\<^sub>m n \<and> PI \<in> carrier_mat n n

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

goal (1 subgoal):
 1. det (mat_of_rows n G) = (0::'a)
[PROOF STEP]
have "B \<noteq> 1\<^sub>m n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B \<noteq> 1\<^sub>m n
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. B = 1\<^sub>m n \<Longrightarrow> False
[PROOF STEP]
assume "B = ?B"
[PROOF STATE]
proof (state)
this:
B = 1\<^sub>m n

goal (1 subgoal):
 1. B = 1\<^sub>m n \<Longrightarrow> False
[PROOF STEP]
hence "?A * P = ?B"
[PROOF STATE]
proof (prove)
using this:
B = 1\<^sub>m n

goal (1 subgoal):
 1. (mat_of_rows n G)\<^sup>T * P = 1\<^sub>m n
[PROOF STEP]
unfolding P
[PROOF STATE]
proof (prove)
using this:
P * (mat_of_rows n G)\<^sup>T = 1\<^sub>m n

goal (1 subgoal):
 1. (mat_of_rows n G)\<^sup>T * P = 1\<^sub>m n
[PROOF STEP]
using PC P(2) carr_mat(1) mat_mult_left_right_inverse
[PROOF STATE]
proof (prove)
using this:
P * (mat_of_rows n G)\<^sup>T = 1\<^sub>m n
P \<in> carrier_mat n n
B = P * (mat_of_rows n G)\<^sup>T
(mat_of_rows n G)\<^sup>T \<in> carrier_mat n n
\<lbrakk>?A \<in> carrier_mat ?n ?n; ?B \<in> carrier_mat ?n ?n; ?A * ?B = 1\<^sub>m ?n\<rbrakk> \<Longrightarrow> ?B * ?A = 1\<^sub>m ?n

goal (1 subgoal):
 1. (mat_of_rows n G)\<^sup>T * P = 1\<^sub>m n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(mat_of_rows n G)\<^sup>T * P = 1\<^sub>m n

goal (1 subgoal):
 1. B = 1\<^sub>m n \<Longrightarrow> False
[PROOF STEP]
hence "?A * P *\<^sub>v v = v"
[PROOF STATE]
proof (prove)
using this:
(mat_of_rows n G)\<^sup>T * P = 1\<^sub>m n

goal (1 subgoal):
 1. (mat_of_rows n G)\<^sup>T * P *\<^sub>v v = v
[PROOF STEP]
using v
[PROOF STATE]
proof (prove)
using this:
(mat_of_rows n G)\<^sup>T * P = 1\<^sub>m n
v \<in> carrier_vec n
v \<notin> local.span (set G)

goal (1 subgoal):
 1. (mat_of_rows n G)\<^sup>T * P *\<^sub>v v = v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(mat_of_rows n G)\<^sup>T * P *\<^sub>v v = v

goal (1 subgoal):
 1. B = 1\<^sub>m n \<Longrightarrow> False
[PROOF STEP]
hence "?A *\<^sub>v (P *\<^sub>v v) = v"
[PROOF STATE]
proof (prove)
using this:
(mat_of_rows n G)\<^sup>T * P *\<^sub>v v = v

goal (1 subgoal):
 1. (mat_of_rows n G)\<^sup>T *\<^sub>v (P *\<^sub>v v) = v
[PROOF STEP]
unfolding assoc_mult_mat_vec[OF carr_mat(1) PC v(1)]
[PROOF STATE]
proof (prove)
using this:
(mat_of_rows n G)\<^sup>T *\<^sub>v (P *\<^sub>v v) = v

goal (1 subgoal):
 1. (mat_of_rows n G)\<^sup>T *\<^sub>v (P *\<^sub>v v) = v
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(mat_of_rows n G)\<^sup>T *\<^sub>v (P *\<^sub>v v) = v

goal (1 subgoal):
 1. B = 1\<^sub>m n \<Longrightarrow> False
[PROOF STEP]
hence v_eq:"mat_of_cols n G *\<^sub>v (P *\<^sub>v v) = v"
[PROOF STATE]
proof (prove)
using this:
(mat_of_rows n G)\<^sup>T *\<^sub>v (P *\<^sub>v v) = v

goal (1 subgoal):
 1. mat_of_cols n G *\<^sub>v (P *\<^sub>v v) = v
[PROOF STEP]
unfolding transpose_mat_of_rows
[PROOF STATE]
proof (prove)
using this:
mat_of_cols n G *\<^sub>v (P *\<^sub>v v) = v

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

goal (1 subgoal):
 1. B = 1\<^sub>m n \<Longrightarrow> False
[PROOF STEP]
have pvc:"P *\<^sub>v v \<in> carrier_vec (length G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P *\<^sub>v v \<in> carrier_vec (length G)
[PROOF STEP]
using PC v len
[PROOF STATE]
proof (prove)
using this:
P \<in> carrier_mat n n
v \<in> carrier_vec n
v \<notin> local.span (set G)
length G = n

goal (1 subgoal):
 1. P *\<^sub>v v \<in> carrier_vec (length G)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
P *\<^sub>v v \<in> carrier_vec (length G)

goal (1 subgoal):
 1. B = 1\<^sub>m n \<Longrightarrow> False
[PROOF STEP]
from mat_of_cols_mult_as_finsum[OF pvc g_len,unfolded v_eq]
[PROOF STATE]
proof (chain)
picking this:
(\<And>i. i < length G \<Longrightarrow> i < length G) \<Longrightarrow> v = lincomb (\<lambda>l. \<Sum>i = 0..<length G. if l = G ! i then (P *\<^sub>v v) $ i else (0::'a)) (set G)
[PROOF STEP]
obtain a where
      "v = lincomb a (set G)"
[PROOF STATE]
proof (prove)
using this:
(\<And>i. i < length G \<Longrightarrow> i < length G) \<Longrightarrow> v = lincomb (\<lambda>l. \<Sum>i = 0..<length G. if l = G ! i then (P *\<^sub>v v) $ i else (0::'a)) (set G)

goal (1 subgoal):
 1. (\<And>a. v = lincomb a (set G) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v = lincomb a (set G)

goal (1 subgoal):
 1. B = 1\<^sub>m n \<Longrightarrow> False
[PROOF STEP]
hence "v \<in> span (set G)"
[PROOF STATE]
proof (prove)
using this:
v = lincomb a (set G)

goal (1 subgoal):
 1. v \<in> local.span (set G)
[PROOF STEP]
by (intro in_spanI[OF _ finite_set subset_refl])
[PROOF STATE]
proof (state)
this:
v \<in> local.span (set G)

goal (1 subgoal):
 1. B = 1\<^sub>m n \<Longrightarrow> False
[PROOF STEP]
thus False
[PROOF STATE]
proof (prove)
using this:
v \<in> local.span (set G)

goal (1 subgoal):
 1. False
[PROOF STEP]
using v
[PROOF STATE]
proof (prove)
using this:
v \<in> local.span (set G)
v \<in> carrier_vec n
v \<notin> local.span (set G)

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

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

goal (1 subgoal):
 1. det (mat_of_rows n G) = (0::'a)
[PROOF STEP]
with det_non_zero_imp_unit[OF carr_mat(1)]
[PROOF STATE]
proof (chain)
picking this:
det (mat_of_rows n G)\<^sup>T \<noteq> (0::'a) \<Longrightarrow> (mat_of_rows n G)\<^sup>T \<in> Units (ring_mat TYPE('a) n ?b)
B \<noteq> 1\<^sub>m n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
det (mat_of_rows n G)\<^sup>T \<noteq> (0::'a) \<Longrightarrow> (mat_of_rows n G)\<^sup>T \<in> Units (ring_mat TYPE('a) n ?b)
B \<noteq> 1\<^sub>m n

goal (1 subgoal):
 1. det (mat_of_rows n G) = (0::'a)
[PROOF STEP]
unfolding gauss_jordan_check_invertable[OF carr_mat(1,2)] B det_transpose[OF carr_mat(3)]
[PROOF STATE]
proof (prove)
using this:
det (mat_of_rows n G) \<noteq> (0::'a) \<Longrightarrow> fst (gauss_jordan (mat_of_rows n G)\<^sup>T (1\<^sub>m n)) = 1\<^sub>m n
fst (gauss_jordan (mat_of_rows n G)\<^sup>T (1\<^sub>m n)) \<noteq> 1\<^sub>m n

goal (1 subgoal):
 1. det (mat_of_rows n G) = (0::'a)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
det (mat_of_rows n G) = (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma proj2_Col_iff_set_Col:
  "proj2_Col p q r \<longleftrightarrow> proj2_set_Col {p,q,r}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proj2_Col p q r = proj2_set_Col {p, q, r}
[PROOF STEP]
by (simp add: proj2_Col_iff_not_invertible
    not_invertible_iff_proj2_set_Col)


[STATEMENT]
lemma ereal_all_split: "\<And>P. (\<forall>x::ereal. P x) \<longleftrightarrow> P \<infinity> \<and> (\<forall>x. P (ereal x)) \<and> P (-\<infinity>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>P. (\<forall>x. P x) = (P \<infinity> \<and> (\<forall>x. P (ereal x)) \<and> P (- \<infinity>))
[PROOF STEP]
by (metis ereal_cases)


[STATEMENT]
lemma rcis_in_complex_cone [intro]:
  assumes "\<alpha> \<in> {a..b}" "r \<ge> 0"
  shows   "rcis r \<alpha> \<in> complex_cone a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rcis r \<alpha> \<in> complex_cone a b
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<alpha> \<in> {a..b}
0 \<le> r

goal (1 subgoal):
 1. rcis r \<alpha> \<in> complex_cone a b
[PROOF STEP]
by (auto simp: complex_cone_def)


[STATEMENT]
lemma unitarily_equiv_smult:
  assumes "A\<in> carrier_mat n n"
  and "unitarily_equiv A B U"
  shows "unitarily_equiv (x \<cdot>\<^sub>m A) (x \<cdot>\<^sub>m B) U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unitarily_equiv (x \<cdot>\<^sub>m A) (x \<cdot>\<^sub>m B) U
[PROOF STEP]
proof (rule unitarily_equivI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. similar_mat_wit (x \<cdot>\<^sub>m A) (x \<cdot>\<^sub>m B) U (Complex_Matrix.adjoint U)
 2. Complex_Matrix.unitary U
[PROOF STEP]
show "similar_mat_wit (x \<cdot>\<^sub>m A) (x \<cdot>\<^sub>m B) U (Complex_Matrix.adjoint U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. similar_mat_wit (x \<cdot>\<^sub>m A) (x \<cdot>\<^sub>m B) U (Complex_Matrix.adjoint U)
[PROOF STEP]
using mat_conj_smult assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?A \<in> carrier_mat ?n ?n; ?U \<in> carrier_mat ?n ?n; ?B \<in> carrier_mat ?n ?n; ?A = ?U * ?B * Complex_Matrix.adjoint ?U\<rbrakk> \<Longrightarrow> ?x \<cdot>\<^sub>m ?A = ?U * (?x \<cdot>\<^sub>m ?B) * Complex_Matrix.adjoint ?U
A \<in> carrier_mat n n
unitarily_equiv A B U

goal (1 subgoal):
 1. similar_mat_wit (x \<cdot>\<^sub>m A) (x \<cdot>\<^sub>m B) U (Complex_Matrix.adjoint U)
[PROOF STEP]
by (simp add: similar_mat_wit_smult unitarily_equivD(2))
[PROOF STATE]
proof (state)
this:
similar_mat_wit (x \<cdot>\<^sub>m A) (x \<cdot>\<^sub>m B) U (Complex_Matrix.adjoint U)

goal (1 subgoal):
 1. Complex_Matrix.unitary U
[PROOF STEP]
show "unitary U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.unitary U
[PROOF STEP]
using assms unitarily_equivD(1)[of A]
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
unitarily_equiv A B U
unitarily_equiv A ?B ?U \<Longrightarrow> Complex_Matrix.unitary ?U

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sinh_real_at_top: "filterlim (sinh :: real \<Rightarrow> real) at_top at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filterlim sinh at_top at_top
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. filterlim sinh at_top at_top
[PROOF STEP]
have *: "((\<lambda>x. - exp (- x)) \<longlongrightarrow> (-0::real)) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. - exp (- x)) \<longlongrightarrow> - 0) at_top
[PROOF STEP]
by (intro tendsto_minus filterlim_compose[OF exp_at_bot] filterlim_uminus_at_bot_at_top)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. - exp (- x)) \<longlongrightarrow> - 0) at_top

goal (1 subgoal):
 1. filterlim sinh at_top at_top
[PROOF STEP]
have "filterlim (\<lambda>x. (1 / 2) * (-exp (-x) + exp x) :: real) at_top at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LIM x at_top. 1 / 2 * (- exp (- x) + exp x) :> at_top
[PROOF STEP]
by (rule filterlim_tendsto_pos_mult_at_top[OF _ _
               filterlim_tendsto_add_at_top[OF *]] tendsto_const)+ (auto simp: exp_at_top)
[PROOF STATE]
proof (state)
this:
LIM x at_top. 1 / 2 * (- exp (- x) + exp x) :> at_top

goal (1 subgoal):
 1. filterlim sinh at_top at_top
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
LIM x at_top. 1 / 2 * (- exp (- x) + exp x) :> at_top

goal (1 subgoal):
 1. filterlim sinh at_top at_top
[PROOF STEP]
have "(\<lambda>x. (1 / 2) * (-exp (-x) + exp x) :: real) = sinh"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. 1 / 2 * (- exp (- x) + exp x)) = sinh
[PROOF STEP]
by (simp add: fun_eq_iff sinh_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. 1 / 2 * (- exp (- x) + exp x)) = sinh

goal (1 subgoal):
 1. filterlim sinh at_top at_top
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
filterlim sinh at_top at_top
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
filterlim sinh at_top at_top

goal (1 subgoal):
 1. filterlim sinh at_top at_top
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
filterlim sinh at_top at_top

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma length_gt_zero_butlast_concat:
  assumes "length ys > 0"
  shows "butlast (xs @ ys) = xs @ (butlast ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. butlast (xs @ ys) = xs @ butlast ys
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < length ys

goal (1 subgoal):
 1. butlast (xs @ ys) = xs @ butlast ys
[PROOF STEP]
by (metis butlast_append length_greater_0_conv)


[STATEMENT]
lemma div_Tr2:"\<lbrakk>(0::nat) < r; 0 < s; l < s * r\<rbrakk> \<Longrightarrow> l div s \<le> r - Suc 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < r; 0 < s; l < s * r\<rbrakk> \<Longrightarrow> l div s \<le> r - Suc 0
[PROOF STEP]
apply (rule contrapos_pp, simp+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < r; 0 < s; l < s * r; \<not> l div s \<le> r - Suc 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (simp add: not_less [symmetric, of "l div s" "r - Suc 0"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < r; 0 < s; l < s * r; r - Suc 0 < l div s\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (frule Suc_leI [of "r - Suc 0" "l div s"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < r; 0 < s; l < s * r; r - Suc 0 < l div s; Suc (r - Suc 0) \<le> l div s\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < r; 0 < s; l < s * r; r \<le> l div s\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (frule less_imp_le [of "l" "s * r"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < r; 0 < s; l < s * r; r \<le> l div s; l \<le> s * r\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (frule div_le_mono [of "l" "s * r" "s"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < r; 0 < s; l < s * r; r \<le> l div s; l \<le> s * r; l div s \<le> s * r div s\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < r; 0 < s; l < s * r; l div s = r\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (insert div_mult_mod_eq [THEN sym, of "l" "s"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < r; 0 < s; l < s * r; l div s = r; l = l div s * s + l mod s\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (frule sym)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < r; 0 < s; l < s * r; l div s = r; l = l div s * s + l mod s; r = l div s\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (thin_tac "r = l div s")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < r; 0 < s; l < s * r; l div s = r; l = l div s * s + l mod s\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < r; 0 < s; l < s * r; l div s = r; l = r * s + l mod s\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (simp add:mult.commute [of "r" "s"])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma cnf_to_bool_set: "cnf_to_bool f cnf \<longleftrightarrow> (\<forall> c \<in> set cnf. (case c of Pos a \<Rightarrow> f a | Neg a \<Rightarrow> \<not> f a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnf_to_bool f cnf = (\<forall>c\<in>set cnf. case c of Pos a \<Rightarrow> f a | Neg a \<Rightarrow> \<not> f a)
[PROOF STEP]
proof(induction cnf)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. cnf_to_bool f [] = (\<forall>c\<in>set []. case c of Pos a \<Rightarrow> f a | Neg a \<Rightarrow> \<not> f a)
 2. \<And>a cnf. cnf_to_bool f cnf = (\<forall>c\<in>set cnf. case c of Pos a \<Rightarrow> f a | Neg a \<Rightarrow> \<not> f a) \<Longrightarrow> cnf_to_bool f (a # cnf) = (\<forall>c\<in>set (a # cnf). case c of Pos a \<Rightarrow> f a | Neg a \<Rightarrow> \<not> f a)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. cnf_to_bool f [] = (\<forall>c\<in>set []. case c of Pos a \<Rightarrow> f a | Neg a \<Rightarrow> \<not> f a)
 2. \<And>a cnf. cnf_to_bool f cnf = (\<forall>c\<in>set cnf. case c of Pos a \<Rightarrow> f a | Neg a \<Rightarrow> \<not> f a) \<Longrightarrow> cnf_to_bool f (a # cnf) = (\<forall>c\<in>set (a # cnf). case c of Pos a \<Rightarrow> f a | Neg a \<Rightarrow> \<not> f a)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnf_to_bool f [] = (\<forall>c\<in>set []. case c of Pos a \<Rightarrow> f a | Neg a \<Rightarrow> \<not> f a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cnf_to_bool f [] = (\<forall>c\<in>set []. case c of Pos a \<Rightarrow> f a | Neg a \<Rightarrow> \<not> f a)

goal (1 subgoal):
 1. \<And>a cnf. cnf_to_bool f cnf = (\<forall>c\<in>set cnf. case c of Pos a \<Rightarrow> f a | Neg a \<Rightarrow> \<not> f a) \<Longrightarrow> cnf_to_bool f (a # cnf) = (\<forall>c\<in>set (a # cnf). case c of Pos a \<Rightarrow> f a | Neg a \<Rightarrow> \<not> f a)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a cnf. cnf_to_bool f cnf = (\<forall>c\<in>set cnf. case c of Pos a \<Rightarrow> f a | Neg a \<Rightarrow> \<not> f a) \<Longrightarrow> cnf_to_bool f (a # cnf) = (\<forall>c\<in>set (a # cnf). case c of Pos a \<Rightarrow> f a | Neg a \<Rightarrow> \<not> f a)
[PROOF STEP]
case Cons
[PROOF STATE]
proof (state)
this:
cnf_to_bool f cnf_ = (\<forall>c\<in>set cnf_. case c of Pos a \<Rightarrow> f a | Neg a \<Rightarrow> \<not> f a)

goal (1 subgoal):
 1. \<And>a cnf. cnf_to_bool f cnf = (\<forall>c\<in>set cnf. case c of Pos a \<Rightarrow> f a | Neg a \<Rightarrow> \<not> f a) \<Longrightarrow> cnf_to_bool f (a # cnf) = (\<forall>c\<in>set (a # cnf). case c of Pos a \<Rightarrow> f a | Neg a \<Rightarrow> \<not> f a)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
cnf_to_bool f cnf_ = (\<forall>c\<in>set cnf_. case c of Pos a \<Rightarrow> f a | Neg a \<Rightarrow> \<not> f a)

goal (1 subgoal):
 1. cnf_to_bool f (a_ # cnf_) = (\<forall>c\<in>set (a_ # cnf_). case c of Pos a \<Rightarrow> f a | Neg a \<Rightarrow> \<not> f a)
[PROOF STEP]
by (simp split: negation_type.split)
[PROOF STATE]
proof (state)
this:
cnf_to_bool f (a_ # cnf_) = (\<forall>c\<in>set (a_ # cnf_). case c of Pos a \<Rightarrow> f a | Neg a \<Rightarrow> \<not> f a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma find_indices_distinct:
  assumes "distinct ss"
  assumes "i < length ss"
  shows "find_indices (ss ! i) ss = [i]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. find_indices (ss ! i) ss = [i]
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. find_indices (ss ! i) ss = [i]
[PROOF STEP]
have "set (find_indices (ss ! i) ss) = {i}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (find_indices (ss ! i) ss) = {i}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
distinct ss
i < length ss

goal (1 subgoal):
 1. set (find_indices (ss ! i) ss) = {i}
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>distinct ss; i < length ss; x < length ss; ss ! x = ss ! i\<rbrakk> \<Longrightarrow> x = i
[PROOF STEP]
by (simp add: assms(1) assms(2) nth_eq_iff_index_eq)
[PROOF STATE]
proof (state)
this:
set (find_indices (ss ! i) ss) = {i}

goal (1 subgoal):
 1. find_indices (ss ! i) ss = [i]
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
set (find_indices (ss ! i) ss) = {i}

goal (1 subgoal):
 1. find_indices (ss ! i) ss = [i]
[PROOF STEP]
by (metis distinct.simps(2) distinct_find_indices empty_iff empty_set insert_iff list.exhaust list.simps(15))
[PROOF STATE]
proof (state)
this:
find_indices (ss ! i) ss = [i]

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eventually_nonneg_diff1 [eventually_nonzero_simps]:
  assumes "eventually_nonneg F f" "g \<in> o[F](f)"
  shows   "eventually_nonneg F (\<lambda>x. f x - g x :: real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eventually_nonneg F (\<lambda>x. f x - g x)
[PROOF STEP]
using  landau_o.smallD[OF assms(2) zero_less_one] assms(1)
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. norm (g x) \<le> 1 * norm (f x)
eventually_nonneg F f

goal (1 subgoal):
 1. eventually_nonneg F (\<lambda>x. f x - g x)
[PROOF STEP]
unfolding eventually_nonneg_def
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. norm (g x) \<le> 1 * norm (f x)
\<forall>\<^sub>F x in F. 0 \<le> f x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. 0 \<le> f x - g x
[PROOF STEP]
by eventually_elim simp_all


[STATEMENT]
lemma chain_iterates: fixes f :: "'a set \<Rightarrow> 'a set"
  assumes "mono f" shows "chain(\<lambda>n. (f^^n) {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. chain (\<lambda>n. (f ^^ n) {})
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. chain (\<lambda>n. (f ^^ n) {})
[PROOF STEP]
have "(f ^^ n) {} \<subseteq> (f ^^ Suc n) {}" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f ^^ n) {} \<subseteq> (f ^^ Suc n) {}
[PROOF STEP]
proof (induction n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (f ^^ 0) {} \<subseteq> (f ^^ Suc 0) {}
 2. \<And>n. (f ^^ n) {} \<subseteq> (f ^^ Suc n) {} \<Longrightarrow> (f ^^ Suc n) {} \<subseteq> (f ^^ Suc (Suc n)) {}
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. (f ^^ 0) {} \<subseteq> (f ^^ Suc 0) {}
 2. \<And>n. (f ^^ n) {} \<subseteq> (f ^^ Suc n) {} \<Longrightarrow> (f ^^ Suc n) {} \<subseteq> (f ^^ Suc (Suc n)) {}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f ^^ 0) {} \<subseteq> (f ^^ Suc 0) {}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(f ^^ 0) {} \<subseteq> (f ^^ Suc 0) {}

goal (1 subgoal):
 1. \<And>n. (f ^^ n) {} \<subseteq> (f ^^ Suc n) {} \<Longrightarrow> (f ^^ Suc n) {} \<subseteq> (f ^^ Suc (Suc n)) {}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. (f ^^ n) {} \<subseteq> (f ^^ Suc n) {} \<Longrightarrow> (f ^^ Suc n) {} \<subseteq> (f ^^ Suc (Suc n)) {}
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
(f ^^ n) {} \<subseteq> (f ^^ Suc n) {}

goal (1 subgoal):
 1. \<And>n. (f ^^ n) {} \<subseteq> (f ^^ Suc n) {} \<Longrightarrow> (f ^^ Suc n) {} \<subseteq> (f ^^ Suc (Suc n)) {}
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
(f ^^ n) {} \<subseteq> (f ^^ Suc n) {}

goal (1 subgoal):
 1. (f ^^ Suc n) {} \<subseteq> (f ^^ Suc (Suc n)) {}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(f ^^ n) {} \<subseteq> (f ^^ Suc n) {}
mono f

goal (1 subgoal):
 1. (f ^^ Suc n) {} \<subseteq> (f ^^ Suc (Suc n)) {}
[PROOF STEP]
by (auto simp: mono_def)
[PROOF STATE]
proof (state)
this:
(f ^^ Suc n) {} \<subseteq> (f ^^ Suc (Suc n)) {}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(f ^^ ?n) {} \<subseteq> (f ^^ Suc ?n) {}

goal (1 subgoal):
 1. chain (\<lambda>n. (f ^^ n) {})
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(f ^^ ?n) {} \<subseteq> (f ^^ Suc ?n) {}

goal (1 subgoal):
 1. chain (\<lambda>n. (f ^^ n) {})
[PROOF STEP]
by(auto simp: chain_def assms)
[PROOF STATE]
proof (state)
this:
chain (\<lambda>n. (f ^^ n) {})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma
  fixes f :: "nat \<Rightarrow> 'a::real_normed_vector"
  assumes f: "summable f"
  and X: "finite X"
  shows summable_zero_on [simp]: "summable (zero_on f X)" (is ?thesis1)
  and suminf_zero_on: "suminf (zero_on f X) = suminf f - sum f X" (is ?thesis2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (zero_on f X) &&& suminf (zero_on f X) = suminf f - sum f X
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. summable (zero_on f X)
 2. suminf (zero_on f X) = suminf f - sum f X
[PROOF STEP]
from f
[PROOF STATE]
proof (chain)
picking this:
summable f
[PROOF STEP]
obtain s where "f sums s"
[PROOF STATE]
proof (prove)
using this:
summable f

goal (1 subgoal):
 1. (\<And>s. f sums s \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding summable_def
[PROOF STATE]
proof (prove)
using this:
Ex ((sums) f)

goal (1 subgoal):
 1. (\<And>s. f sums s \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
f sums s

goal (2 subgoals):
 1. summable (zero_on f X)
 2. suminf (zero_on f X) = suminf f - sum f X
[PROOF STEP]
with sums_zero_on[OF this X]
[PROOF STATE]
proof (chain)
picking this:
zero_on f X sums (s - sum f X)
f sums s
[PROOF STEP]
show ?thesis1 ?thesis2
[PROOF STATE]
proof (prove)
using this:
zero_on f X sums (s - sum f X)
f sums s

goal (1 subgoal):
 1. summable (zero_on f X) &&& suminf (zero_on f X) = suminf f - sum f X
[PROOF STEP]
by(auto simp add: summable_def sums_unique[symmetric])
[PROOF STATE]
proof (state)
this:
summable (zero_on f X)
suminf (zero_on f X) = suminf f - sum f X

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cInf_abs_ge:
  fixes S :: "'a::{linordered_idom,conditionally_complete_linorder} set"
  assumes "S \<noteq> {}"
    and bdd: "\<And>x. x\<in>S \<Longrightarrow> \<bar>x\<bar> \<le> a"
  shows "\<bar>Inf S\<bar> \<le> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>Inf S\<bar> \<le> a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<bar>Inf S\<bar> \<le> a
[PROOF STEP]
have "Sup (uminus ` S) = - (Inf S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sup (uminus ` S) = - Inf S
[PROOF STEP]
proof (rule antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Sup (uminus ` S) \<le> - Inf S
 2. - Inf S \<le> Sup (uminus ` S)
[PROOF STEP]
show "- (Inf S) \<le> Sup (uminus ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - Inf S \<le> Sup (uminus ` S)
[PROOF STEP]
apply (subst minus_le_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - Sup (uminus ` S) \<le> Inf S
[PROOF STEP]
apply (rule cInf_greatest [OF \<open>S \<noteq> {}\<close>])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> - Sup (uminus ` S) \<le> x
[PROOF STEP]
apply (subst minus_le_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> - x \<le> Sup (uminus ` S)
[PROOF STEP]
apply (rule cSup_upper)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x \<in> S \<Longrightarrow> - x \<in> uminus ` S
 2. \<And>x. x \<in> S \<Longrightarrow> bdd_above (uminus ` S)
[PROOF STEP]
apply force
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> bdd_above (uminus ` S)
[PROOF STEP]
using bdd
[PROOF STATE]
proof (prove)
using this:
?x \<in> S \<Longrightarrow> \<bar>?x\<bar> \<le> a

goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> bdd_above (uminus ` S)
[PROOF STEP]
apply (force simp: abs_le_iff bdd_above_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
- Inf S \<le> Sup (uminus ` S)

goal (1 subgoal):
 1. Sup (uminus ` S) \<le> - Inf S
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Sup (uminus ` S) \<le> - Inf S
[PROOF STEP]
have *: "\<And>x. x \<in> S \<Longrightarrow> Inf S \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> Inf S \<le> x
[PROOF STEP]
by (meson abs_le_iff bdd bdd_below_def cInf_lower minus_le_iff)
[PROOF STATE]
proof (state)
this:
?x \<in> S \<Longrightarrow> Inf S \<le> ?x

goal (1 subgoal):
 1. Sup (uminus ` S) \<le> - Inf S
[PROOF STEP]
show "Sup (uminus ` S) \<le> - Inf S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sup (uminus ` S) \<le> - Inf S
[PROOF STEP]
using \<open>S \<noteq> {}\<close>
[PROOF STATE]
proof (prove)
using this:
S \<noteq> {}

goal (1 subgoal):
 1. Sup (uminus ` S) \<le> - Inf S
[PROOF STEP]
by (force intro: * cSup_least)
[PROOF STATE]
proof (state)
this:
Sup (uminus ` S) \<le> - Inf S

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Sup (uminus ` S) = - Inf S

goal (1 subgoal):
 1. \<bar>Inf S\<bar> \<le> a
[PROOF STEP]
with cSup_abs_le [of "uminus ` S"] assms
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>uminus ` S \<noteq> {}; \<And>x. x \<in> uminus ` S \<Longrightarrow> \<bar>x\<bar> \<le> ?a\<rbrakk> \<Longrightarrow> \<bar>Sup (uminus ` S)\<bar> \<le> ?a
S \<noteq> {}
?x \<in> S \<Longrightarrow> \<bar>?x\<bar> \<le> a
Sup (uminus ` S) = - Inf S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>uminus ` S \<noteq> {}; \<And>x. x \<in> uminus ` S \<Longrightarrow> \<bar>x\<bar> \<le> ?a\<rbrakk> \<Longrightarrow> \<bar>Sup (uminus ` S)\<bar> \<le> ?a
S \<noteq> {}
?x \<in> S \<Longrightarrow> \<bar>?x\<bar> \<le> a
Sup (uminus ` S) = - Inf S

goal (1 subgoal):
 1. \<bar>Inf S\<bar> \<le> a
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<bar>Inf S\<bar> \<le> a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rref_condition1_explicit:
assumes rref_A: "reduced_row_echelon_form A"
and "is_zero_row i A"
shows "\<forall>j>i. is_zero_row j A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>j>i. is_zero_row j A
[PROOF STEP]
using rref_condition1 assms
[PROOF STATE]
proof (prove)
using this:
reduced_row_echelon_form ?A \<Longrightarrow> \<forall>i. is_zero_row i ?A \<longrightarrow> \<not> (\<exists>j>i. \<not> is_zero_row j ?A)
reduced_row_echelon_form A
is_zero_row i A

goal (1 subgoal):
 1. \<forall>j>i. is_zero_row j A
[PROOF STEP]
by blast


[STATEMENT]
lemma fin_gamma_set[intro,simp]: "finite gamma_set"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite gamma_set
[PROOF STEP]
unfolding gamma_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (UNIV \<rightarrow> NO_HAT ` \<Gamma> \<union> HAT ` \<Gamma>)
[PROOF STEP]
using fin_\<Gamma>
[PROOF STATE]
proof (prove)
using this:
finite \<Gamma>

goal (1 subgoal):
 1. finite (UNIV \<rightarrow> NO_HAT ` \<Gamma> \<union> HAT ` \<Gamma>)
[PROOF STEP]
by (intro fin_funcsetI, auto)


[STATEMENT]
lemma continuous_on_imp_continuous_within:
  "continuous_on s f \<Longrightarrow> t \<subseteq> s \<Longrightarrow> x \<in> s \<Longrightarrow> continuous (at x within t) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>continuous_on s f; t \<subseteq> s; x \<in> s\<rbrakk> \<Longrightarrow> continuous (at x within t) f
[PROOF STEP]
unfolding continuous_on_eq_continuous_within
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x\<in>s. continuous (at x within s) f; t \<subseteq> s; x \<in> s\<rbrakk> \<Longrightarrow> continuous (at x within t) f
[PROOF STEP]
by (auto simp: continuous_within intro: tendsto_within_subset)


[STATEMENT]
lemma rbt_max_opt_in_set:
  fixes t :: "('a :: linorder, unit) RBT_Impl.rbt"
  assumes "t \<noteq> rbt.Empty"
  shows "rbt_max_opt t \<in> set (RBT_Impl.keys t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rbt_max_opt t \<in> set (RBT_Impl.keys t)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
t \<noteq> rbt.Empty

goal (1 subgoal):
 1. rbt_max_opt t \<in> set (RBT_Impl.keys t)
[PROOF STEP]
by (induction t rule: rbt_max_opt.induct) (auto)


[STATEMENT]
lemma foldr_assoc:
  assumes "\<And>f g h. b (b f g) h = b f (b g h)"
  shows "foldr b xs (b y z) = b (foldr b xs y) z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldr b xs (b y z) = b (foldr b xs y) z
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
b (b ?f ?g) ?h = b ?f (b ?g ?h)

goal (1 subgoal):
 1. foldr b xs (b y z) = b (foldr b xs y) z
[PROOF STEP]
by (induct xs) simp_all


[STATEMENT]
lemma conjuncts_NFAND:
  "\<lbrakk>finite X; X \<noteq> {}; \<forall>x \<in> X. \<not> is_FAnd x\<rbrakk> \<Longrightarrow> conjuncts (NFAND X) = X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite X; X \<noteq> {}; \<forall>x\<in>X. \<not> is_FAnd x\<rbrakk> \<Longrightarrow> conjuncts (NFAND X) = X
[PROOF STEP]
unfolding NFAND_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite X; X \<noteq> {}; \<forall>x\<in>X. \<not> is_FAnd x\<rbrakk> \<Longrightarrow> conjuncts ((nFAND \<circ> sorted_list_of_set) X) = X
[PROOF STEP]
by (auto simp: juncts_eq_set_juncts_list list_all_iff conjuncts_list_nFAND)


[STATEMENT]
lemma infinite_nat: "\<not>finite (UNIV::nat set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite UNIV
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite UNIV \<Longrightarrow> False
[PROOF STEP]
assume fin: "finite (UNIV::nat set)"
[PROOF STATE]
proof (state)
this:
finite UNIV

goal (1 subgoal):
 1. finite UNIV \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite UNIV
[PROOF STEP]
obtain m::nat where "\<forall>n\<in>UNIV. n < m"
[PROOF STATE]
proof (prove)
using this:
finite UNIV

goal (1 subgoal):
 1. (\<And>m. \<forall>n\<in>UNIV. n < m \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (rule finite_nat_ex_max [elim_format] ) auto
[PROOF STATE]
proof (state)
this:
\<forall>n\<in>UNIV. n < m

goal (1 subgoal):
 1. finite UNIV \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>n\<in>UNIV. n < m

goal (1 subgoal):
 1. finite UNIV \<Longrightarrow> False
[PROOF STEP]
have "m\<in>UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<in> UNIV
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
m \<in> UNIV

goal (1 subgoal):
 1. finite UNIV \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>n\<in>UNIV. n < m
m \<in> UNIV
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
\<forall>n\<in>UNIV. n < m
m \<in> UNIV

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fds_right_inverse_unique:
  assumes "f * g = (1 :: 'a :: field fds)"
  shows   "g = inverse f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g = inverse f
[PROOF STEP]
using fds_left_inverse_unique[of g f] assms
[PROOF STATE]
proof (prove)
using this:
g * f = 1 \<Longrightarrow> g = inverse f
f * g = 1

goal (1 subgoal):
 1. g = inverse f
[PROOF STEP]
by (simp add: mult.commute)