[STATEMENT]
lemma "NegPos_map (\<lambda>x::nat. x+1) [Pos 0, Neg 1] = [Pos 1, Neg 2]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. NegPos_map (\<lambda>x. x + 1) [Pos 0, Neg 1] = [Pos 1, Neg 2]
[PROOF STEP]
by eval


[STATEMENT]
lemma toCard_inj: "\<lbrakk>|A| \<le>o r; Card_order r; x \<in> A; y \<in> A\<rbrakk> \<Longrightarrow> toCard A r x = toCard A r y \<longleftrightarrow> x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>|A| \<le>o r; Card_order r; x \<in> A; y \<in> A\<rbrakk> \<Longrightarrow> (toCard A r x = toCard A r y) = (x = y)
[PROOF STEP]
using toCard_pred_toCard
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>|?A| \<le>o ?r; Card_order ?r\<rbrakk> \<Longrightarrow> toCard_pred ?A ?r (toCard ?A ?r)

goal (1 subgoal):
 1. \<lbrakk>|A| \<le>o r; Card_order r; x \<in> A; y \<in> A\<rbrakk> \<Longrightarrow> (toCard A r x = toCard A r y) = (x = y)
[PROOF STEP]
unfolding inj_on_def toCard_pred_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>|?A| \<le>o ?r; Card_order ?r\<rbrakk> \<Longrightarrow> (\<forall>x\<in>?A. \<forall>y\<in>?A. toCard ?A ?r x = toCard ?A ?r y \<longrightarrow> x = y) \<and> toCard ?A ?r ` ?A \<subseteq> Field ?r \<and> Card_order ?r

goal (1 subgoal):
 1. \<lbrakk>|A| \<le>o r; Card_order r; x \<in> A; y \<in> A\<rbrakk> \<Longrightarrow> (toCard A r x = toCard A r y) = (x = y)
[PROOF STEP]
by blast


[STATEMENT]
lemma if_then_1_else_0:
  "((if P then 1 else 0) = (0 :: machine_word)) = (\<not> P)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((if P then 1 else 0) = 0) = (\<not> P)
[PROOF STEP]
by simp


[STATEMENT]
theorem ta_union_correct:
  fixes TA TA'
  assumes TA: "tree_automaton TA"
  assumes TA': "tree_automaton TA'"
  assumes DJ: "ta_rstates TA \<inter> ta_rstates TA' = {}"
  shows "ta_lang (ta_union TA TA') = ta_lang TA \<union> ta_lang TA'"
        "tree_automaton (ta_union TA TA')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ta_lang (ta_union TA TA') = ta_lang TA \<union> ta_lang TA' &&& tree_automaton (ta_union TA TA')
[PROOF STEP]
using ta_union_correct_aux1[OF TA TA' DJ]
        ta_union_correct_aux2[OF TA TA']
[PROOF STATE]
proof (prove)
using this:
ta_lang (ta_union TA TA') = ta_lang TA \<union> ta_lang TA'
tree_automaton (ta_union TA TA')

goal (1 subgoal):
 1. ta_lang (ta_union TA TA') = ta_lang TA \<union> ta_lang TA' &&& tree_automaton (ta_union TA TA')
[PROOF STEP]
by auto


[STATEMENT]
lemma s_calc_i_0: "$s^{m}_n = n" if "m \<noteq> 0" "i = 0" for n m :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. $s^{m}_n = real n
[PROOF STEP]
unfolding acc_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k<n * m. (1 + i) .^ (real k / real m) / real m) = real n
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
m \<noteq> 0
i = 0

goal (1 subgoal):
 1. (\<Sum>k<n * m. (1 + i) .^ (real k / real m) / real m) = real n
[PROOF STEP]
by simp


[STATEMENT]
lemma finite_imp_g_le_Aleph0: "finite X \<Longrightarrow> gcard X < \<aleph>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite X \<Longrightarrow> gcard X < \<aleph>0
[PROOF STEP]
by (meson finite_iff_g_le_Aleph0 finite_imp_small)


[STATEMENT]
lemma Liminf_le:
  assumes F: "F \<noteq> bot" and x: "\<forall>\<^sub>F x in F. f x \<le> l"
  shows "Liminf F f \<le> l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Liminf F f \<le> l
[PROOF STEP]
using F Liminf_le_Limsup Limsup_bounded order.trans x
[PROOF STATE]
proof (prove)
using this:
F \<noteq> bot
?F \<noteq> bot \<Longrightarrow> Liminf ?F ?f \<le> Limsup ?F ?f
\<forall>\<^sub>F n in ?F. ?X n \<le> ?C \<Longrightarrow> Limsup ?F ?X \<le> ?C
\<lbrakk>?a \<le> ?b; ?b \<le> ?c\<rbrakk> \<Longrightarrow> ?a \<le> ?c
\<forall>\<^sub>F x in F. f x \<le> l

goal (1 subgoal):
 1. Liminf F f \<le> l
[PROOF STEP]
by blast


[STATEMENT]
lemma oprod_Preorder: "\<lbrakk>Preorder r; Preorder r'; antisym r; antisym r'\<rbrakk> \<Longrightarrow> Preorder (r *o r')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Preorder r; Preorder r'; antisym r; antisym r'\<rbrakk> \<Longrightarrow> Preorder (r *o r')
[PROOF STEP]
unfolding preorder_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Refl r \<and> trans r; Refl r' \<and> trans r'; antisym r; antisym r'\<rbrakk> \<Longrightarrow> Refl (r *o r') \<and> trans (r *o r')
[PROOF STEP]
using oprod_Refl oprod_trans
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Refl ?r; Refl ?r'\<rbrakk> \<Longrightarrow> Refl (?r *o ?r')
\<lbrakk>trans ?r; trans ?r'; antisym ?r; antisym ?r'\<rbrakk> \<Longrightarrow> trans (?r *o ?r')

goal (1 subgoal):
 1. \<lbrakk>Refl r \<and> trans r; Refl r' \<and> trans r'; antisym r; antisym r'\<rbrakk> \<Longrightarrow> Refl (r *o r') \<and> trans (r *o r')
[PROOF STEP]
by blast


[STATEMENT]
lemma coprime_gcd:
  fixes h::"'a mod_ring poly"
  assumes "Rings.coprime (h-[:c1:]) (h-[:c2:])"
  shows "Rings.coprime (gcd f(h-[:c1:])) (gcd f (h-[:c2:]))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. algebraic_semidom_class.coprime (gcd f (h - [:c1:])) (gcd f (h - [:c2:]))
[PROOF STEP]
using assms coprime_divisors
[PROOF STATE]
proof (prove)
using this:
algebraic_semidom_class.coprime (h - [:c1:]) (h - [:c2:])
\<lbrakk>?a dvd ?c; ?b dvd ?d; algebraic_semidom_class.coprime ?c ?d\<rbrakk> \<Longrightarrow> algebraic_semidom_class.coprime ?a ?b

goal (1 subgoal):
 1. algebraic_semidom_class.coprime (gcd f (h - [:c1:])) (gcd f (h - [:c2:]))
[PROOF STEP]
by blast


[STATEMENT]
lemma fps_of_poly_monom': "fps_of_poly (monom (1 :: 'a :: comm_ring_1) n) = fps_X ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_of_poly (monom (1::'a) n) = fps_X ^ n
[PROOF STEP]
by (simp add: fps_of_poly_monom)


[STATEMENT]
lemma lemma_4_5_a: "a \<le> c \<Longrightarrow> b \<le> c \<Longrightarrow> a \<squnion>1 b \<le> c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> c; b \<le> c\<rbrakk> \<Longrightarrow> a \<squnion>1 b \<le> c
[PROOF STEP]
apply (subst left_lesseq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> c; b \<le> c\<rbrakk> \<Longrightarrow> a \<squnion>1 b l\<rightarrow> c = (1::'a)
[PROOF STEP]
apply (subst lemma_4_5_v)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> c; b \<le> c\<rbrakk> \<Longrightarrow> (a l\<rightarrow> c) \<sqinter> (b l\<rightarrow> c) = (1::'a)
[PROOF STEP]
by simp


[STATEMENT]
lemma power: "f (n ^ m) = f n ^ m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (n ^ m) = f n ^ m
[PROOF STEP]
by (induction m) (simp_all add: mult)


[STATEMENT]
lemma  fun_tuple_to_univ_poly_degree:
  assumes "is_function_tuple R n fs"
  assumes "x \<in> carrier (R\<^bsup>n\<^esup>)"
  assumes "length fs = Suc m"
  assumes "(fs!m) x \<noteq>\<zero>"
  shows "deg R (fun_tuple_to_univ_poly R n m fs x) = m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deg R (fun_tuple_to_univ_poly R n m fs x) = m
[PROOF STEP]
unfolding fun_tuple_to_univ_poly_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deg R (ring_cfs_to_univ_poly m (function_tuple_eval R n fs x)) = m
[PROOF STEP]
using ring_cfs_to_univ_poly_degree[of "function_tuple_eval R n fs x" m]
        assms
        function_tuple_eval_def
        function_tuple_eval_closed[of R n fs x]
[PROOF STATE]
proof (prove)
using this:
function_tuple_eval R n fs x \<in> carrier (R\<^bsup>Suc m\<^esup>) \<Longrightarrow> deg R (ring_cfs_to_univ_poly m (function_tuple_eval R n fs x)) \<le> m
\<lbrakk>function_tuple_eval R n fs x \<in> carrier (R\<^bsup>Suc m\<^esup>); function_tuple_eval R n fs x ! m \<noteq> \<zero>\<rbrakk> \<Longrightarrow> deg R (ring_cfs_to_univ_poly m (function_tuple_eval R n fs x)) = m
is_function_tuple R n fs
x \<in> carrier (R\<^bsup>n\<^esup>)
length fs = Suc m
(fs ! m) x \<noteq> \<zero>
function_tuple_eval ?R ?n ?fs ?x = map (\<lambda>f. f ?x) ?fs
\<lbrakk>is_function_tuple R n fs; x \<in> carrier (R\<^bsup>n\<^esup>)\<rbrakk> \<Longrightarrow> function_tuple_eval R n fs x \<in> carrier (R\<^bsup>length fs\<^esup>)

goal (1 subgoal):
 1. deg R (ring_cfs_to_univ_poly m (function_tuple_eval R n fs x)) = m
[PROOF STEP]
by (metis lessI nth_map)


[STATEMENT]
lemma (in domain) properfactor_imp_properfactor_mult:
  "\<lbrakk> a \<in> carrier R - { \<zero> }; b \<in> carrier R \<rbrakk> \<Longrightarrow> properfactor R b a \<Longrightarrow> properfactor (mult_of R) b a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier R - {\<zero>}; b \<in> carrier R; properfactor R b a\<rbrakk> \<Longrightarrow> properfactor (Ring_Divisibility.mult_of R) b a
[PROOF STEP]
unfolding properfactor_def factor_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier R - {\<zero>}; b \<in> carrier R; (\<exists>c\<in>carrier R. a = b \<otimes> c) \<and> \<not> (\<exists>c\<in>carrier R. b = a \<otimes> c)\<rbrakk> \<Longrightarrow> (\<exists>c\<in>carrier (Ring_Divisibility.mult_of R). a = b \<otimes>\<^bsub>Ring_Divisibility.mult_of R\<^esub> c) \<and> \<not> (\<exists>c\<in>carrier (Ring_Divisibility.mult_of R). b = a \<otimes>\<^bsub>Ring_Divisibility.mult_of R\<^esub> c)
[PROOF STEP]
by auto


[STATEMENT]
lemma sqmatrix_mult_distrib_right:
  "((A::('a::{comm_monoid_add,semiring},'m::len) sqmatrix) + B) * C = A * C + B * C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A + B) \<cdot> C = A \<cdot> C + B \<cdot> C
[PROOF STEP]
by (cases A, cases B, cases C, simp add: distrib_right sum.distrib)


[STATEMENT]
lemma arcsin_minus: "- 1 \<le> x \<Longrightarrow> x \<le> 1 \<Longrightarrow> arcsin (- x) = - arcsin x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>- 1 \<le> x; x \<le> 1\<rbrakk> \<Longrightarrow> arcsin (- x) = - arcsin x
[PROOF STEP]
by (metis (no_types, opaque_lifting) arcsin arcsin_sin minus_minus neg_le_iff_le sin_minus)


[STATEMENT]
lemma adj_inj_surj:
  fixes f :: "'a::order \<Rightarrow> 'b::order"
  shows "f \<stileturn> g \<Longrightarrow> ((inj f) = (surj g))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<stileturn> g \<Longrightarrow> inj f = top_pres ((`) g)
[PROOF STEP]
unfolding adj_def inj_def surj_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. (f x \<le> y) = (x \<le> g y) \<Longrightarrow> (\<forall>x y. f x = f y \<longrightarrow> x = y) = (\<forall>y. \<exists>x. y = g x)
[PROOF STEP]
by (metis eq_iff order_trans)


[STATEMENT]
lemma powr_le_cancel_iff [simp]: "1 < x \<Longrightarrow> x powr a \<le> x powr b \<longleftrightarrow> a \<le> b"
  for a b x :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < x \<Longrightarrow> (x powr a \<le> x powr b) = (a \<le> b)
[PROOF STEP]
by (simp add: linorder_not_less [symmetric])


[STATEMENT]
lemma approx_FreeUltrafilterNat_iff:
  "star_n X \<approx> star_n Y \<longleftrightarrow> (\<forall>r>0. eventually (\<lambda>n. norm (X n - Y n) < r) \<U>)"
  (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (star_n X \<approx> star_n Y) = (\<forall>r>0. \<forall>\<^sub>F n in \<U>. norm (X n - Y n) < r)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (star_n X \<approx> star_n Y) = (\<forall>r>0. \<forall>\<^sub>F n in \<U>. norm (X n - Y n) < r)
[PROOF STEP]
have "?lhs = (star_n X - star_n Y \<approx> 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (star_n X \<approx> star_n Y) = (star_n X - star_n Y \<approx> 0)
[PROOF STEP]
using approx_minus_iff
[PROOF STATE]
proof (prove)
using this:
(?x \<approx> ?y) = (?x - ?y \<approx> 0)

goal (1 subgoal):
 1. (star_n X \<approx> star_n Y) = (star_n X - star_n Y \<approx> 0)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(star_n X \<approx> star_n Y) = (star_n X - star_n Y \<approx> 0)

goal (1 subgoal):
 1. (star_n X \<approx> star_n Y) = (\<forall>r>0. \<forall>\<^sub>F n in \<U>. norm (X n - Y n) < r)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(star_n X \<approx> star_n Y) = (star_n X - star_n Y \<approx> 0)

goal (1 subgoal):
 1. (star_n X \<approx> star_n Y) = (\<forall>r>0. \<forall>\<^sub>F n in \<U>. norm (X n - Y n) < r)
[PROOF STEP]
have "... = ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (star_n X - star_n Y \<approx> 0) = (\<forall>r>0. \<forall>\<^sub>F n in \<U>. norm (X n - Y n) < r)
[PROOF STEP]
by (metis (full_types) Infinitesimal_FreeUltrafilterNat_iff mem_infmal_iff star_n_diff)
[PROOF STATE]
proof (state)
this:
(star_n X - star_n Y \<approx> 0) = (\<forall>r>0. \<forall>\<^sub>F n in \<U>. norm (X n - Y n) < r)

goal (1 subgoal):
 1. (star_n X \<approx> star_n Y) = (\<forall>r>0. \<forall>\<^sub>F n in \<U>. norm (X n - Y n) < r)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(star_n X \<approx> star_n Y) = (\<forall>r>0. \<forall>\<^sub>F n in \<U>. norm (X n - Y n) < r)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(star_n X \<approx> star_n Y) = (\<forall>r>0. \<forall>\<^sub>F n in \<U>. norm (X n - Y n) < r)

goal (1 subgoal):
 1. (star_n X \<approx> star_n Y) = (\<forall>r>0. \<forall>\<^sub>F n in \<U>. norm (X n - Y n) < r)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(star_n X \<approx> star_n Y) = (\<forall>r>0. \<forall>\<^sub>F n in \<U>. norm (X n - Y n) < r)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma DERIV_power_int [derivative_intros]:
  assumes [derivative_intros]: "(f has_field_derivative d) (at x within s)" and [simp]: "f x \<noteq> 0"
  shows   "((\<lambda>x. power_int (f x) n) has_field_derivative
             (of_int n * power_int (f x) (n - 1) * d)) (at x within s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f x powi n) has_field_derivative of_int n * f x powi (n - 1) * d) (at x within s)
[PROOF STEP]
proof (cases n rule: int_cases4)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>na. n = int na \<Longrightarrow> ((\<lambda>x. f x powi n) has_field_derivative of_int n * f x powi (n - 1) * d) (at x within s)
 2. \<And>na. \<lbrakk>0 < na; n = - int na\<rbrakk> \<Longrightarrow> ((\<lambda>x. f x powi n) has_field_derivative of_int n * f x powi (n - 1) * d) (at x within s)
[PROOF STEP]
case (nonneg n)
[PROOF STATE]
proof (state)
this:
n = int n

goal (2 subgoals):
 1. \<And>na. n = int na \<Longrightarrow> ((\<lambda>x. f x powi n) has_field_derivative of_int n * f x powi (n - 1) * d) (at x within s)
 2. \<And>na. \<lbrakk>0 < na; n = - int na\<rbrakk> \<Longrightarrow> ((\<lambda>x. f x powi n) has_field_derivative of_int n * f x powi (n - 1) * d) (at x within s)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
n = int n

goal (1 subgoal):
 1. ((\<lambda>x. f x powi n) has_field_derivative of_int n * f x powi (n - 1) * d) (at x within s)
[PROOF STEP]
by (cases "n = 0")
       (auto intro!: derivative_eq_intros simp: field_simps power_int_diff
             simp flip: power_Suc power_Suc2 power_add)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. f x powi n) has_field_derivative of_int n * f x powi (n - 1) * d) (at x within s)

goal (1 subgoal):
 1. \<And>na. \<lbrakk>0 < na; n = - int na\<rbrakk> \<Longrightarrow> ((\<lambda>x. f x powi n) has_field_derivative of_int n * f x powi (n - 1) * d) (at x within s)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>na. \<lbrakk>0 < na; n = - int na\<rbrakk> \<Longrightarrow> ((\<lambda>x. f x powi n) has_field_derivative of_int n * f x powi (n - 1) * d) (at x within s)
[PROOF STEP]
case (neg n)
[PROOF STATE]
proof (state)
this:
0 < n
n = - int n

goal (1 subgoal):
 1. \<And>na. \<lbrakk>0 < na; n = - int na\<rbrakk> \<Longrightarrow> ((\<lambda>x. f x powi n) has_field_derivative of_int n * f x powi (n - 1) * d) (at x within s)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < n
n = - int n

goal (1 subgoal):
 1. ((\<lambda>x. f x powi n) has_field_derivative of_int n * f x powi (n - 1) * d) (at x within s)
[PROOF STEP]
by (auto intro!: derivative_eq_intros simp: field_simps power_int_diff power_int_minus
             simp flip: power_Suc power_Suc2 power_add)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. f x powi n) has_field_derivative of_int n * f x powi (n - 1) * d) (at x within s)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma linorder_lattice_sup_inf_distrib1:
  "sup (x::'a::linorder_lattice) (inf y z) = inf (sup x y) (sup x z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sup x (inf y z) = inf (sup x y) (sup x z)
[PROOF STEP]
by (auto simp: inf_def sup_def)


[STATEMENT]
theorem strong_duality_theorem_dual_sat_bounded:
  fixes bound :: "'a :: trivial_conjugatable_linordered_field"
  assumes A: "A \<in> carrier_mat nr nc"
    and b: "b \<in> carrier_vec nr"
    and c: "c \<in> carrier_vec nc"
    and sat: "\<exists> y. y \<ge> 0\<^sub>v nr \<and> A\<^sup>T *\<^sub>v y = c"
    and bounded: "\<forall> y. y \<ge> 0\<^sub>v nr \<and> A\<^sup>T *\<^sub>v y = c \<longrightarrow> bound \<le> b \<bullet> y"
  shows "\<exists> x y.
       x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and>
       y \<ge> 0\<^sub>v nr \<and> A\<^sup>T *\<^sub>v y = c \<and>
       c \<bullet> x = b \<bullet> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
proof (rule strong_duality_theorem_both_sat[OF A b c _ sat])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
show "\<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (\<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b) \<Longrightarrow> False
[PROOF STEP]
assume "\<not> ?thesis"
[PROOF STATE]
proof (state)
this:
\<not> (\<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b)

goal (1 subgoal):
 1. \<not> (\<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b) \<Longrightarrow> False
[PROOF STEP]
hence "\<not> (\<exists>x. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b)"
[PROOF STATE]
proof (prove)
using this:
\<not> (\<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b)

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

goal (1 subgoal):
 1. \<not> (\<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b) \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<nexists>x. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b
[PROOF STEP]
obtain y where y0: "y \<ge> 0\<^sub>v nr" and Ay0: "A\<^sup>T *\<^sub>v y = 0\<^sub>v nc" and yb: "y \<bullet> b < 0"
[PROOF STATE]
proof (prove)
using this:
\<nexists>x. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b

goal (1 subgoal):
 1. (\<And>y. \<lbrakk>0\<^sub>v nr \<le> y; A\<^sup>T *\<^sub>v y = 0\<^sub>v nc; y \<bullet> b < (0::'a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (subst (asm) gram_schmidt.Farkas_Lemma'[OF A b], auto)
[PROOF STATE]
proof (state)
this:
0\<^sub>v nr \<le> y
A\<^sup>T *\<^sub>v y = 0\<^sub>v nc
y \<bullet> b < (0::'a)

goal (1 subgoal):
 1. \<not> (\<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b) \<Longrightarrow> False
[PROOF STEP]
from sat
[PROOF STATE]
proof (chain)
picking this:
\<exists>y\<ge>0\<^sub>v nr. A\<^sup>T *\<^sub>v y = c
[PROOF STEP]
obtain x where x0: "x \<ge> 0\<^sub>v nr" and Axc: "A\<^sup>T *\<^sub>v x = c"
[PROOF STATE]
proof (prove)
using this:
\<exists>y\<ge>0\<^sub>v nr. A\<^sup>T *\<^sub>v y = c

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>0\<^sub>v nr \<le> x; A\<^sup>T *\<^sub>v x = c\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0\<^sub>v nr \<le> x
A\<^sup>T *\<^sub>v x = c

goal (1 subgoal):
 1. \<not> (\<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b) \<Longrightarrow> False
[PROOF STEP]
define diff where "diff = b \<bullet> x - (bound - 1)"
[PROOF STATE]
proof (state)
this:
diff = b \<bullet> x - (bound - (1::'a))

goal (1 subgoal):
 1. \<not> (\<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b) \<Longrightarrow> False
[PROOF STEP]
from x0 Axc bounded
[PROOF STATE]
proof (chain)
picking this:
0\<^sub>v nr \<le> x
A\<^sup>T *\<^sub>v x = c
\<forall>y. 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<longrightarrow> bound \<le> b \<bullet> y
[PROOF STEP]
have "bound \<le> b \<bullet> x"
[PROOF STATE]
proof (prove)
using this:
0\<^sub>v nr \<le> x
A\<^sup>T *\<^sub>v x = c
\<forall>y. 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<longrightarrow> bound \<le> b \<bullet> y

goal (1 subgoal):
 1. bound \<le> b \<bullet> x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
bound \<le> b \<bullet> x

goal (1 subgoal):
 1. \<not> (\<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b) \<Longrightarrow> False
[PROOF STEP]
hence diff: "diff > 0"
[PROOF STATE]
proof (prove)
using this:
bound \<le> b \<bullet> x

goal (1 subgoal):
 1. (0::'a) < diff
[PROOF STEP]
unfolding diff_def
[PROOF STATE]
proof (prove)
using this:
bound \<le> b \<bullet> x

goal (1 subgoal):
 1. (0::'a) < b \<bullet> x - (bound - (1::'a))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(0::'a) < diff

goal (1 subgoal):
 1. \<not> (\<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b) \<Longrightarrow> False
[PROOF STEP]
define fact where "fact = - inverse (y \<bullet> b) * diff"
[PROOF STATE]
proof (state)
this:
fact = - inverse (y \<bullet> b) * diff

goal (1 subgoal):
 1. \<not> (\<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b) \<Longrightarrow> False
[PROOF STEP]
have fact: "fact > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) < fact
[PROOF STEP]
unfolding fact_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) < - inverse (y \<bullet> b) * diff
[PROOF STEP]
using diff yb
[PROOF STATE]
proof (prove)
using this:
(0::'a) < diff
y \<bullet> b < (0::'a)

goal (1 subgoal):
 1. (0::'a) < - inverse (y \<bullet> b) * diff
[PROOF STEP]
by (auto intro: mult_neg_pos)
[PROOF STATE]
proof (state)
this:
(0::'a) < fact

goal (1 subgoal):
 1. \<not> (\<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b) \<Longrightarrow> False
[PROOF STEP]
define z where "z = x + fact \<cdot>\<^sub>v y"
[PROOF STATE]
proof (state)
this:
z = x + fact \<cdot>\<^sub>v y

goal (1 subgoal):
 1. \<not> (\<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b) \<Longrightarrow> False
[PROOF STEP]
from x0
[PROOF STATE]
proof (chain)
picking this:
0\<^sub>v nr \<le> x
[PROOF STEP]
have x: "x \<in> carrier_vec nr"
[PROOF STATE]
proof (prove)
using this:
0\<^sub>v nr \<le> x

goal (1 subgoal):
 1. x \<in> carrier_vec nr
[PROOF STEP]
unfolding less_eq_vec_def
[PROOF STATE]
proof (prove)
using this:
dim_vec (0\<^sub>v nr) = dim_vec x \<and> (\<forall>i<dim_vec x. 0\<^sub>v nr $ i \<le> x $ i)

goal (1 subgoal):
 1. x \<in> carrier_vec nr
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> carrier_vec nr

goal (1 subgoal):
 1. \<not> (\<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b) \<Longrightarrow> False
[PROOF STEP]
from y0
[PROOF STATE]
proof (chain)
picking this:
0\<^sub>v nr \<le> y
[PROOF STEP]
have y: "y \<in> carrier_vec nr"
[PROOF STATE]
proof (prove)
using this:
0\<^sub>v nr \<le> y

goal (1 subgoal):
 1. y \<in> carrier_vec nr
[PROOF STEP]
unfolding less_eq_vec_def
[PROOF STATE]
proof (prove)
using this:
dim_vec (0\<^sub>v nr) = dim_vec y \<and> (\<forall>i<dim_vec y. 0\<^sub>v nr $ i \<le> y $ i)

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

goal (1 subgoal):
 1. \<not> (\<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b) \<Longrightarrow> False
[PROOF STEP]
have "A\<^sup>T *\<^sub>v z = A\<^sup>T *\<^sub>v x + A\<^sup>T *\<^sub>v (fact \<cdot>\<^sub>v y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A\<^sup>T *\<^sub>v z = A\<^sup>T *\<^sub>v x + A\<^sup>T *\<^sub>v (fact \<cdot>\<^sub>v y)
[PROOF STEP]
unfolding z_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A\<^sup>T *\<^sub>v (x + fact \<cdot>\<^sub>v y) = A\<^sup>T *\<^sub>v x + A\<^sup>T *\<^sub>v (fact \<cdot>\<^sub>v y)
[PROOF STEP]
using A x y
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat nr nc
x \<in> carrier_vec nr
y \<in> carrier_vec nr

goal (1 subgoal):
 1. A\<^sup>T *\<^sub>v (x + fact \<cdot>\<^sub>v y) = A\<^sup>T *\<^sub>v x + A\<^sup>T *\<^sub>v (fact \<cdot>\<^sub>v y)
[PROOF STEP]
by (simp add: mult_add_distrib_mat_vec)
[PROOF STATE]
proof (state)
this:
A\<^sup>T *\<^sub>v z = A\<^sup>T *\<^sub>v x + A\<^sup>T *\<^sub>v (fact \<cdot>\<^sub>v y)

goal (1 subgoal):
 1. \<not> (\<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b) \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A\<^sup>T *\<^sub>v z = A\<^sup>T *\<^sub>v x + A\<^sup>T *\<^sub>v (fact \<cdot>\<^sub>v y)

goal (1 subgoal):
 1. \<not> (\<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b) \<Longrightarrow> False
[PROOF STEP]
have "\<dots> = A\<^sup>T *\<^sub>v x + fact \<cdot>\<^sub>v (A\<^sup>T *\<^sub>v y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A\<^sup>T *\<^sub>v x + A\<^sup>T *\<^sub>v (fact \<cdot>\<^sub>v y) = A\<^sup>T *\<^sub>v x + fact \<cdot>\<^sub>v (A\<^sup>T *\<^sub>v y)
[PROOF STEP]
using A y
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat nr nc
y \<in> carrier_vec nr

goal (1 subgoal):
 1. A\<^sup>T *\<^sub>v x + A\<^sup>T *\<^sub>v (fact \<cdot>\<^sub>v y) = A\<^sup>T *\<^sub>v x + fact \<cdot>\<^sub>v (A\<^sup>T *\<^sub>v y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A\<^sup>T *\<^sub>v x + A\<^sup>T *\<^sub>v (fact \<cdot>\<^sub>v y) = A\<^sup>T *\<^sub>v x + fact \<cdot>\<^sub>v (A\<^sup>T *\<^sub>v y)

goal (1 subgoal):
 1. \<not> (\<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b) \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A\<^sup>T *\<^sub>v x + A\<^sup>T *\<^sub>v (fact \<cdot>\<^sub>v y) = A\<^sup>T *\<^sub>v x + fact \<cdot>\<^sub>v (A\<^sup>T *\<^sub>v y)

goal (1 subgoal):
 1. \<not> (\<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b) \<Longrightarrow> False
[PROOF STEP]
have "\<dots> = c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A\<^sup>T *\<^sub>v x + fact \<cdot>\<^sub>v (A\<^sup>T *\<^sub>v y) = c
[PROOF STEP]
unfolding Ay0 Axc
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c + fact \<cdot>\<^sub>v 0\<^sub>v nc = c
[PROOF STEP]
using c
[PROOF STATE]
proof (prove)
using this:
c \<in> carrier_vec nc

goal (1 subgoal):
 1. c + fact \<cdot>\<^sub>v 0\<^sub>v nc = c
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A\<^sup>T *\<^sub>v x + fact \<cdot>\<^sub>v (A\<^sup>T *\<^sub>v y) = c

goal (1 subgoal):
 1. \<not> (\<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b) \<Longrightarrow> False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
A\<^sup>T *\<^sub>v z = c
[PROOF STEP]
have Azc: "A\<^sup>T *\<^sub>v z = c"
[PROOF STATE]
proof (prove)
using this:
A\<^sup>T *\<^sub>v z = c

goal (1 subgoal):
 1. A\<^sup>T *\<^sub>v z = c
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
A\<^sup>T *\<^sub>v z = c

goal (1 subgoal):
 1. \<not> (\<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b) \<Longrightarrow> False
[PROOF STEP]
have z0: "z \<ge> 0\<^sub>v nr"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0\<^sub>v nr \<le> z
[PROOF STEP]
unfolding z_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0\<^sub>v nr \<le> x + fact \<cdot>\<^sub>v y
[PROOF STEP]
by (intro lesseq_vecI[of _ nr], insert x y lesseq_vecD[OF _ x0, of nr] lesseq_vecD[OF _ y0, of nr] fact,
          auto intro!: add_nonneg_nonneg)
[PROOF STATE]
proof (state)
this:
0\<^sub>v nr \<le> z

goal (1 subgoal):
 1. \<not> (\<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b) \<Longrightarrow> False
[PROOF STEP]
from bounded Azc z0
[PROOF STATE]
proof (chain)
picking this:
\<forall>y. 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<longrightarrow> bound \<le> b \<bullet> y
A\<^sup>T *\<^sub>v z = c
0\<^sub>v nr \<le> z
[PROOF STEP]
have bz: "bound \<le> b \<bullet> z"
[PROOF STATE]
proof (prove)
using this:
\<forall>y. 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<longrightarrow> bound \<le> b \<bullet> y
A\<^sup>T *\<^sub>v z = c
0\<^sub>v nr \<le> z

goal (1 subgoal):
 1. bound \<le> b \<bullet> z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
bound \<le> b \<bullet> z

goal (1 subgoal):
 1. \<not> (\<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b) \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
bound \<le> b \<bullet> z

goal (1 subgoal):
 1. \<not> (\<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b) \<Longrightarrow> False
[PROOF STEP]
have "\<dots> = b \<bullet> x + fact * (b \<bullet> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<bullet> z = b \<bullet> x + fact * (b \<bullet> y)
[PROOF STEP]
unfolding z_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<bullet> (x + fact \<cdot>\<^sub>v y) = b \<bullet> x + fact * (b \<bullet> y)
[PROOF STEP]
using b x y
[PROOF STATE]
proof (prove)
using this:
b \<in> carrier_vec nr
x \<in> carrier_vec nr
y \<in> carrier_vec nr

goal (1 subgoal):
 1. b \<bullet> (x + fact \<cdot>\<^sub>v y) = b \<bullet> x + fact * (b \<bullet> y)
[PROOF STEP]
by (simp add: scalar_prod_add_distrib)
[PROOF STATE]
proof (state)
this:
b \<bullet> z = b \<bullet> x + fact * (b \<bullet> y)

goal (1 subgoal):
 1. \<not> (\<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b) \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
b \<bullet> z = b \<bullet> x + fact * (b \<bullet> y)

goal (1 subgoal):
 1. \<not> (\<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b) \<Longrightarrow> False
[PROOF STEP]
have "\<dots> = diff + (bound - 1) + fact * (b \<bullet> y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<bullet> x + fact * (b \<bullet> y) = diff + (bound - (1::'a)) + fact * (b \<bullet> y)
[PROOF STEP]
unfolding diff_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<bullet> x + fact * (b \<bullet> y) = b \<bullet> x - (bound - (1::'a)) + (bound - (1::'a)) + fact * (b \<bullet> y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
b \<bullet> x + fact * (b \<bullet> y) = diff + (bound - (1::'a)) + fact * (b \<bullet> y)

goal (1 subgoal):
 1. \<not> (\<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b) \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
b \<bullet> x + fact * (b \<bullet> y) = diff + (bound - (1::'a)) + fact * (b \<bullet> y)

goal (1 subgoal):
 1. \<not> (\<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b) \<Longrightarrow> False
[PROOF STEP]
have "fact * (b \<bullet> y) = - diff"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fact * (b \<bullet> y) = - diff
[PROOF STEP]
using yb
[PROOF STATE]
proof (prove)
using this:
y \<bullet> b < (0::'a)

goal (1 subgoal):
 1. fact * (b \<bullet> y) = - diff
[PROOF STEP]
unfolding fact_def comm_scalar_prod[OF y b]
[PROOF STATE]
proof (prove)
using this:
b \<bullet> y < (0::'a)

goal (1 subgoal):
 1. - inverse (b \<bullet> y) * diff * (b \<bullet> y) = - diff
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
fact * (b \<bullet> y) = - diff

goal (1 subgoal):
 1. \<not> (\<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b) \<Longrightarrow> False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
bound \<le> diff + (bound - (1::'a)) + - diff
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
bound \<le> diff + (bound - (1::'a)) + - diff

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma iT_Mult_Max: "\<lbrakk> finite I; I \<noteq> {} \<rbrakk> \<Longrightarrow> Max (I \<otimes> k) = Max I * k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; I \<noteq> {}\<rbrakk> \<Longrightarrow> Max (I \<otimes> k) = Max I * k
[PROOF STEP]
by (simp add: iT_Mult_def Max_mono2 mono_def)


[STATEMENT]
lemma mset_set_image_inj:
  assumes "inj_on f A"
  shows   "mset_set (f ` A) = image_mset f (mset_set A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset_set (f ` A) = image_mset f (mset_set A)
[PROOF STEP]
proof (cases "finite A")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite A \<Longrightarrow> mset_set (f ` A) = image_mset f (mset_set A)
 2. infinite A \<Longrightarrow> mset_set (f ` A) = image_mset f (mset_set A)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
finite A

goal (2 subgoals):
 1. finite A \<Longrightarrow> mset_set (f ` A) = image_mset f (mset_set A)
 2. infinite A \<Longrightarrow> mset_set (f ` A) = image_mset f (mset_set A)
[PROOF STEP]
from this and assms
[PROOF STATE]
proof (chain)
picking this:
finite A
inj_on f A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite A
inj_on f A

goal (1 subgoal):
 1. mset_set (f ` A) = image_mset f (mset_set A)
[PROOF STEP]
by (induction A) auto
[PROOF STATE]
proof (state)
this:
mset_set (f ` A) = image_mset f (mset_set A)

goal (1 subgoal):
 1. infinite A \<Longrightarrow> mset_set (f ` A) = image_mset f (mset_set A)
[PROOF STEP]
qed (insert assms, simp add: finite_image_iff)


[STATEMENT]
lemma matrix_vector_mult_scaleR[algebra_simps]:
  fixes A :: "real^'n^'m"
  shows "A *v (c *\<^sub>R x) = c *\<^sub>R (A *v x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *v c *\<^sub>R x = c *\<^sub>R (A *v x)
[PROOF STEP]
using linear_iff matrix_vector_mul_linear
[PROOF STATE]
proof (prove)
using this:
linear ?f = ((\<forall>x y. ?f (x + y) = ?f x + ?f y) \<and> (\<forall>c x. ?f (c *\<^sub>R x) = c *\<^sub>R ?f x))
linear ((*v) ?A)

goal (1 subgoal):
 1. A *v c *\<^sub>R x = c *\<^sub>R (A *v x)
[PROOF STEP]
by blast


[STATEMENT]
lemma (in order_topology) order_tendstoD:
  assumes "(f \<longlongrightarrow> y) F"
  shows "a < y \<Longrightarrow> eventually (\<lambda>x. a < f x) F"
    and "y < a \<Longrightarrow> eventually (\<lambda>x. f x < a) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a < y \<Longrightarrow> \<forall>\<^sub>F x in F. a < f x) &&& (y < a \<Longrightarrow> \<forall>\<^sub>F x in F. f x < a)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(f \<longlongrightarrow> y) F

goal (1 subgoal):
 1. (a < y \<Longrightarrow> \<forall>\<^sub>F x in F. a < f x) &&& (y < a \<Longrightarrow> \<forall>\<^sub>F x in F. f x < a)
[PROOF STEP]
by (auto simp: order_tendsto_iff)


[STATEMENT]
lemma p2_eq_1: "2 ^ n = (1::'a::len word) \<longleftrightarrow> n = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2 ^ n = 1) = (n = 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (2 ^ n = 1) = (n = 0)
[PROOF STEP]
have "2 ^ n = (1::'a word) \<Longrightarrow> n = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ n = 1 \<Longrightarrow> n = 0
[PROOF STEP]
by (metis One_nat_def not_less one_less_numeral_iff p2_eq_0 p2_gt_0 power_0 power_0
        power_inject_exp semiring_norm(76) unat_power_lower zero_neq_one)
[PROOF STATE]
proof (state)
this:
2 ^ n = 1 \<Longrightarrow> n = 0

goal (1 subgoal):
 1. (2 ^ n = 1) = (n = 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
2 ^ n = 1 \<Longrightarrow> n = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
2 ^ n = 1 \<Longrightarrow> n = 0

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma range_to_nat: "range (to_nat :: 'a :: mod_type \<Rightarrow> nat) = {0 ..< CARD('a)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. range mod_type_class.to_nat = {0..<CARD('a)}
[PROOF STEP]
by (simp add: bij_betw_imp_surj_on mod_type_class.bij_to_nat)


[STATEMENT]
lemma ln_powr: "x \<noteq> 0 \<Longrightarrow> ln (x powr y) = y * ln x"
  for x :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> ln (x powr y) = y * ln x
[PROOF STEP]
by (simp add: powr_def)


[STATEMENT]
theorem (in ergodic_pmpt) birkhoff_theorem_AE:
  fixes f::"'a \<Rightarrow> real"
  assumes "integrable M f"
  shows "AE x in M. (\<lambda>n. birkhoff_sum f n x / n) \<longlonglongrightarrow> (\<integral> x. f x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in M. (\<lambda>n. birkhoff_sum f n x / real n) \<longlonglongrightarrow> expectation f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. AE x in M. (\<lambda>n. birkhoff_sum f n x / real n) \<longlonglongrightarrow> expectation f
[PROOF STEP]
have "AE x in M. (\<lambda>n. birkhoff_sum f n x / n) \<longlonglongrightarrow> real_cond_exp M Invariants f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in M. (\<lambda>n. birkhoff_sum f n x / real n) \<longlonglongrightarrow> real_cond_exp M Invariants f x
[PROOF STEP]
using birkhoff_theorem_AE_nonergodic[OF assms]
[PROOF STATE]
proof (prove)
using this:
AE x in M. (\<lambda>n. birkhoff_sum f n x / real n) \<longlonglongrightarrow> real_cond_exp M Invariants f x

goal (1 subgoal):
 1. AE x in M. (\<lambda>n. birkhoff_sum f n x / real n) \<longlonglongrightarrow> real_cond_exp M Invariants f x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
AE x in M. (\<lambda>n. birkhoff_sum f n x / real n) \<longlonglongrightarrow> real_cond_exp M Invariants f x

goal (1 subgoal):
 1. AE x in M. (\<lambda>n. birkhoff_sum f n x / real n) \<longlonglongrightarrow> expectation f
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
AE x in M. (\<lambda>n. birkhoff_sum f n x / real n) \<longlonglongrightarrow> real_cond_exp M Invariants f x

goal (1 subgoal):
 1. AE x in M. (\<lambda>n. birkhoff_sum f n x / real n) \<longlonglongrightarrow> expectation f
[PROOF STEP]
have "AE x in M. real_cond_exp M Invariants f x = (\<integral> x. f x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in M. real_cond_exp M Invariants f x = expectation f
[PROOF STEP]
using Invariants_cond_exp_is_integral[OF assms]
[PROOF STATE]
proof (prove)
using this:
AE x in M. real_cond_exp M Invariants f x = expectation f

goal (1 subgoal):
 1. AE x in M. real_cond_exp M Invariants f x = expectation f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
AE x in M. real_cond_exp M Invariants f x = expectation f

goal (1 subgoal):
 1. AE x in M. (\<lambda>n. birkhoff_sum f n x / real n) \<longlonglongrightarrow> expectation f
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
AE x in M. (\<lambda>n. birkhoff_sum f n x / real n) \<longlonglongrightarrow> real_cond_exp M Invariants f x
AE x in M. real_cond_exp M Invariants f x = expectation f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
AE x in M. (\<lambda>n. birkhoff_sum f n x / real n) \<longlonglongrightarrow> real_cond_exp M Invariants f x
AE x in M. real_cond_exp M Invariants f x = expectation f

goal (1 subgoal):
 1. AE x in M. (\<lambda>n. birkhoff_sum f n x / real n) \<longlonglongrightarrow> expectation f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
AE x in M. (\<lambda>n. birkhoff_sum f n x / real n) \<longlonglongrightarrow> expectation f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lformula_conjuncts: "(\<forall>\<psi> \<in> conjuncts \<phi>. lformula \<psi>) = lformula \<phi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ball (conjuncts \<phi>) lformula = lformula \<phi>
[PROOF STEP]
by (induct \<phi> rule: conjuncts.induct) fastforce+


[STATEMENT]
lemma sinh_le_cosh_real: "sinh (x :: real) \<le> cosh x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sinh x \<le> cosh x
[PROOF STEP]
by (simp add: sinh_def cosh_def)


[STATEMENT]
lemma of_nat_less_hmset[simp]: "(of_nat M :: hmultiset) < of_nat N \<longleftrightarrow> M < N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (of_nat M < of_nat N) = (M < N)
[PROOF STEP]
unfolding of_nat_hmset less_multiset_ext\<^sub>D\<^sub>M_less
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (HMSet (replicate_mset M 0) < HMSet (replicate_mset N 0)) = (M < N)
[PROOF STEP]
by simp


[STATEMENT]
lemma vifunion_disjoint: "(\<Union>\<^sub>\<circ>C \<inter>\<^sub>\<circ> A = 0) \<longleftrightarrow> (\<forall>B\<in>\<^sub>\<circ>C. vdisjnt B A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vdisjnt (\<Union>\<^sub>\<circ> C) A = (\<forall>B\<in>elts C. vdisjnt B A)
[PROOF STEP]
by (intro iffI)
    (auto intro!: vsubset_antisym simp: Sup_upper vdisjnt_vsubset_left)


[STATEMENT]
lemma ereal_liminf_limsup_minus:
  fixes u v::"nat \<Rightarrow> ereal"
  shows "liminf (\<lambda>n. u n - v n) \<le> limsup u - limsup v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. liminf (\<lambda>n. u n - v n) \<le> limsup u - limsup v
[PROOF STEP]
unfolding minus_ereal_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. liminf (\<lambda>n. u n + - v n) \<le> limsup u + - limsup v
[PROOF STEP]
apply (subst add.commute)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. liminf (\<lambda>n. - v n + u n) \<le> limsup u + - limsup v
[PROOF STEP]
apply (rule order_trans[OF ereal_liminf_limsup_add])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. liminf (\<lambda>n. - v n) + limsup u \<le> limsup u + - limsup v
[PROOF STEP]
using ereal_Limsup_uminus[of sequentially "\<lambda>n. - v n"]
[PROOF STATE]
proof (prove)
using this:
limsup (\<lambda>x. - (- v x)) = - liminf (\<lambda>n. - v n)

goal (1 subgoal):
 1. liminf (\<lambda>n. - v n) + limsup u \<le> limsup u + - limsup v
[PROOF STEP]
apply (simp add: add.commute)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma continuous_min [continuous_intros]:
  fixes f :: "'a::t2_space \<Rightarrow> 'b::linorder_topology"
  shows "\<lbrakk>continuous F f; continuous F g\<rbrakk> \<Longrightarrow> continuous F (\<lambda>x. (min (f x) (g x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>continuous F f; continuous F g\<rbrakk> \<Longrightarrow> continuous F (\<lambda>x. min (f x) (g x))
[PROOF STEP]
by (simp add: tendsto_min continuous_def)


[STATEMENT]
lemma ubs_ex_n_maxTr:"\<lbrakk>(a::nat) \<in> A; \<not> (\<exists>m. m\<in>A \<and> (\<forall>x\<in>A. x \<le> m))\<rbrakk>
      \<Longrightarrow>  (a + n) \<le> (nasc_seq A a n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> A; \<nexists>m. m \<in> A \<and> (\<forall>x\<in>A. x \<le> m)\<rbrakk> \<Longrightarrow> a + n \<le> nasc_seq A a n
[PROOF STEP]
apply (induct_tac n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>a \<in> A; \<nexists>m. m \<in> A \<and> (\<forall>x\<in>A. x \<le> m)\<rbrakk> \<Longrightarrow> a + 0 \<le> nasc_seq A a 0
 2. \<And>n. \<lbrakk>a \<in> A; \<nexists>m. m \<in> A \<and> (\<forall>x\<in>A. x \<le> m); a + n \<le> nasc_seq A a n\<rbrakk> \<Longrightarrow> a + Suc n \<le> nasc_seq A a (Suc n)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>a \<in> A; \<nexists>m. m \<in> A \<and> (\<forall>x\<in>A. x \<le> m); a + n \<le> nasc_seq A a n\<rbrakk> \<Longrightarrow> a + Suc n \<le> nasc_seq A a (Suc n)
[PROOF STEP]
apply (frule_tac n = n in nasc_seqn1[of "a" "A"], assumption+,
       subgoal_tac "Suc (a + n) \<le> Suc (nasc_seq A a n)",
       frule_tac i = "Suc (a + n)" and j = "Suc (nasc_seq A a n)" and
                  k = "nasc_seq A a (Suc n)" in le_trans, assumption+,
       simp, thin_tac "Suc (nasc_seq A a n) \<le> nasc_seq A a (Suc n)",
       subst Suc_le_mono, assumption+)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma P_err_start: "P_err start = (q * p ^ Suc N) / (1 - q * (1 - p ^ Suc N))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P_err start = q * p ^ Suc N / (1 - q * (1 - p ^ Suc N))
[PROOF STEP]
by (simp add: P_err)


[STATEMENT]
lemma SEval_cong: "(\<forall>x. x \<in> set (sfv s) --> e1 x = e2 x) --> SEval m e1 s = SEval m e2 s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. x \<in> set (sfv s) \<longrightarrow> e1 x = e2 x) \<longrightarrow> SEval m e1 s = SEval m e2 s
[PROOF STEP]
apply(induct s)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<forall>x. x \<in> set (sfv []) \<longrightarrow> e1 x = e2 x) \<longrightarrow> SEval m e1 [] = SEval m e2 []
 2. \<And>a s. (\<forall>x. x \<in> set (sfv s) \<longrightarrow> e1 x = e2 x) \<longrightarrow> SEval m e1 s = SEval m e2 s \<Longrightarrow> (\<forall>x. x \<in> set (sfv (a # s)) \<longrightarrow> e1 x = e2 x) \<longrightarrow> SEval m e1 (a # s) = SEval m e2 (a # s)
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a s. (\<forall>x. x \<in> set (sfv s) \<longrightarrow> e1 x = e2 x) \<longrightarrow> SEval m e1 s = SEval m e2 s \<Longrightarrow> (\<forall>x. x \<in> set (sfv (a # s)) \<longrightarrow> e1 x = e2 x) \<longrightarrow> SEval m e1 (a # s) = SEval m e2 (a # s)
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a s. (\<forall>x. x \<in> set (sfv s) \<longrightarrow> e1 x = e2 x) \<longrightarrow> SEval m e1 s = SEval m e2 s \<Longrightarrow> (\<forall>x. x \<in> set (sfv (a # s)) \<longrightarrow> e1 x = e2 x) \<longrightarrow> (FEval m e1 a \<or> SEval m e1 s) = (FEval m e2 a \<or> SEval m e2 s)
[PROOF STEP]
apply(intro allI impI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a s. \<lbrakk>(\<forall>x. x \<in> set (sfv s) \<longrightarrow> e1 x = e2 x) \<longrightarrow> SEval m e1 s = SEval m e2 s; \<forall>x. x \<in> set (sfv (a # s)) \<longrightarrow> e1 x = e2 x\<rbrakk> \<Longrightarrow> (FEval m e1 a \<or> SEval m e1 s) = (FEval m e2 a \<or> SEval m e2 s)
[PROOF STEP]
apply(rule or_lem)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a s. \<lbrakk>(\<forall>x. x \<in> set (sfv s) \<longrightarrow> e1 x = e2 x) \<longrightarrow> SEval m e1 s = SEval m e2 s; \<forall>x. x \<in> set (sfv (a # s)) \<longrightarrow> e1 x = e2 x\<rbrakk> \<Longrightarrow> FEval m e1 a = FEval m e2 a
 2. \<And>a s. \<lbrakk>(\<forall>x. x \<in> set (sfv s) \<longrightarrow> e1 x = e2 x) \<longrightarrow> SEval m e1 s = SEval m e2 s; \<forall>x. x \<in> set (sfv (a # s)) \<longrightarrow> e1 x = e2 x\<rbrakk> \<Longrightarrow> SEval m e1 s = SEval m e2 s
[PROOF STEP]
apply(simp add: sfv_cons)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a s. \<lbrakk>SEval m e1 s = SEval m e2 s; \<forall>x. (x \<in> set (fv a) \<longrightarrow> e1 x = e2 x) \<and> (x \<in> set (sfv s) \<longrightarrow> e1 x = e2 x)\<rbrakk> \<Longrightarrow> FEval m e1 a = FEval m e2 a
 2. \<And>a s. \<lbrakk>(\<forall>x. x \<in> set (sfv s) \<longrightarrow> e1 x = e2 x) \<longrightarrow> SEval m e1 s = SEval m e2 s; \<forall>x. x \<in> set (sfv (a # s)) \<longrightarrow> e1 x = e2 x\<rbrakk> \<Longrightarrow> SEval m e1 s = SEval m e2 s
[PROOF STEP]
apply(simp add: FEval_cong)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a s. \<lbrakk>(\<forall>x. x \<in> set (sfv s) \<longrightarrow> e1 x = e2 x) \<longrightarrow> SEval m e1 s = SEval m e2 s; \<forall>x. x \<in> set (sfv (a # s)) \<longrightarrow> e1 x = e2 x\<rbrakk> \<Longrightarrow> SEval m e1 s = SEval m e2 s
[PROOF STEP]
apply(simp add: sfv_cons)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma ideal_generated_triple_pair_rewrite:
  assumes i1: "ideal_generated {a, b, c} = ideal_generated {d}"
    and i2: "ideal_generated {a, b} = ideal_generated {d'}"
  shows "ideal_generated{d',c} = ideal_generated {d}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ideal_generated {d', c} = ideal_generated {d}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ideal_generated {d', c} \<subseteq> ideal_generated {d}
 2. ideal_generated {d} \<subseteq> ideal_generated {d', c}
[PROOF STEP]
have d': "d' \<in> ideal_generated {a,b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d' \<in> ideal_generated {a, b}
[PROOF STEP]
using i2
[PROOF STATE]
proof (prove)
using this:
ideal_generated {a, b} = ideal_generated {d'}

goal (1 subgoal):
 1. d' \<in> ideal_generated {a, b}
[PROOF STEP]
by (simp add: ideal_generated_in)
[PROOF STATE]
proof (state)
this:
d' \<in> ideal_generated {a, b}

goal (2 subgoals):
 1. ideal_generated {d', c} \<subseteq> ideal_generated {d}
 2. ideal_generated {d} \<subseteq> ideal_generated {d', c}
[PROOF STEP]
show "ideal_generated {d', c} \<subseteq> ideal_generated {d}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ideal_generated {d', c} \<subseteq> ideal_generated {d}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> ideal_generated {d', c} \<Longrightarrow> x \<in> ideal_generated {d}
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> ideal_generated {d', c} \<Longrightarrow> x \<in> ideal_generated {d}
[PROOF STEP]
assume x: "x \<in> ideal_generated {d', c}"
[PROOF STATE]
proof (state)
this:
x \<in> ideal_generated {d', c}

goal (1 subgoal):
 1. \<And>x. x \<in> ideal_generated {d', c} \<Longrightarrow> x \<in> ideal_generated {d}
[PROOF STEP]
obtain f1 f2 where f: "f1*d' + f2*c = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>f1 f2. f1 * d' + f2 * c = x \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using obtain_ideal_generated_pair[OF x]
[PROOF STATE]
proof (prove)
using this:
(\<And>p q. p * d' + q * c = x \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>f1 f2. f1 * d' + f2 * c = x \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f1 * d' + f2 * c = x

goal (1 subgoal):
 1. \<And>x. x \<in> ideal_generated {d', c} \<Longrightarrow> x \<in> ideal_generated {d}
[PROOF STEP]
obtain g1 g2 where g: "g1*a + g2*b = d'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>g1 g2. g1 * a + g2 * b = d' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using obtain_ideal_generated_pair[OF d']
[PROOF STATE]
proof (prove)
using this:
(\<And>p q. p * a + q * b = d' \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>g1 g2. g1 * a + g2 * b = d' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
g1 * a + g2 * b = d'

goal (1 subgoal):
 1. \<And>x. x \<in> ideal_generated {d', c} \<Longrightarrow> x \<in> ideal_generated {d}
[PROOF STEP]
have 1: "f1*g1*a + f1*g2*b + f2*c = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f1 * g1 * a + f1 * g2 * b + f2 * c = x
[PROOF STEP]
using f g local.ring_distribs(1) local.semiring_normalization_rules(18)
[PROOF STATE]
proof (prove)
using this:
f1 * d' + f2 * c = x
g1 * a + g2 * b = d'
?a * (?b + ?c) = ?a * ?b + ?a * ?c
?lx * (?rx * ?ry) = ?lx * ?rx * ?ry

goal (1 subgoal):
 1. f1 * g1 * a + f1 * g2 * b + f2 * c = x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f1 * g1 * a + f1 * g2 * b + f2 * c = x

goal (1 subgoal):
 1. \<And>x. x \<in> ideal_generated {d', c} \<Longrightarrow> x \<in> ideal_generated {d}
[PROOF STEP]
have "x \<in> ideal_generated {a, b, c}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> ideal_generated {a, b, c}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<in> ideal_generated {a, b, c}
[PROOF STEP]
obtain f where "(\<Sum>i\<in>{a,b,c}. f i * i) = f1*g1*a + f1*g2*b + f2*c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>f. (\<Sum>i\<in>{a, b, c}. f i * i) = f1 * g1 * a + f1 * g2 * b + f2 * c \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using sum_three_elements' 1
[PROOF STATE]
proof (prove)
using this:
\<exists>f. (\<Sum>i\<in>{?a, ?b, ?c}. f i * i) = ?x * ?a + ?y * ?b + ?z * ?c
f1 * g1 * a + f1 * g2 * b + f2 * c = x

goal (1 subgoal):
 1. (\<And>f. (\<Sum>i\<in>{a, b, c}. f i * i) = f1 * g1 * a + f1 * g2 * b + f2 * c \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>{a, b, c}. f i * i) = f1 * g1 * a + f1 * g2 * b + f2 * c

goal (1 subgoal):
 1. x \<in> ideal_generated {a, b, c}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>{a, b, c}. f i * i) = f1 * g1 * a + f1 * g2 * b + f2 * c

goal (1 subgoal):
 1. x \<in> ideal_generated {a, b, c}
[PROOF STEP]
have "ideal_generated {a,b,c} = {y. \<exists>f. (\<Sum>i\<in>{a,b,c}. f i * i) = y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ideal_generated {a, b, c} = {y. \<exists>f. (\<Sum>i\<in>{a, b, c}. f i * i) = y}
[PROOF STEP]
using ideal_explicit2[of "{a,b,c}"]
[PROOF STATE]
proof (prove)
using this:
finite {a, b, c} \<Longrightarrow> ideal_generated {a, b, c} = {y. \<exists>f. (\<Sum>i\<in>{a, b, c}. f i * i) = y}

goal (1 subgoal):
 1. ideal_generated {a, b, c} = {y. \<exists>f. (\<Sum>i\<in>{a, b, c}. f i * i) = y}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ideal_generated {a, b, c} = {y. \<exists>f. (\<Sum>i\<in>{a, b, c}. f i * i) = y}

goal (1 subgoal):
 1. x \<in> ideal_generated {a, b, c}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>i\<in>{a, b, c}. f i * i) = f1 * g1 * a + f1 * g2 * b + f2 * c
ideal_generated {a, b, c} = {y. \<exists>f. (\<Sum>i\<in>{a, b, c}. f i * i) = y}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<in>{a, b, c}. f i * i) = f1 * g1 * a + f1 * g2 * b + f2 * c
ideal_generated {a, b, c} = {y. \<exists>f. (\<Sum>i\<in>{a, b, c}. f i * i) = y}

goal (1 subgoal):
 1. x \<in> ideal_generated {a, b, c}
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<in>{a, b, c}. f i * i) = f1 * g1 * a + f1 * g2 * b + f2 * c
ideal_generated {a, b, c} = {y. \<exists>f. (\<Sum>i\<in>{a, b, c}. f i * i) = y}
f1 * g1 * a + f1 * g2 * b + f2 * c = x

goal (1 subgoal):
 1. x \<in> ideal_generated {a, b, c}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> ideal_generated {a, b, c}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<in> ideal_generated {a, b, c}

goal (1 subgoal):
 1. \<And>x. x \<in> ideal_generated {d', c} \<Longrightarrow> x \<in> ideal_generated {d}
[PROOF STEP]
thus "x \<in> ideal_generated {d}"
[PROOF STATE]
proof (prove)
using this:
x \<in> ideal_generated {a, b, c}

goal (1 subgoal):
 1. x \<in> ideal_generated {d}
[PROOF STEP]
using i1
[PROOF STATE]
proof (prove)
using this:
x \<in> ideal_generated {a, b, c}
ideal_generated {a, b, c} = ideal_generated {d}

goal (1 subgoal):
 1. x \<in> ideal_generated {d}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> ideal_generated {d}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
ideal_generated {d', c} \<subseteq> ideal_generated {d}

goal (1 subgoal):
 1. ideal_generated {d} \<subseteq> ideal_generated {d', c}
[PROOF STEP]
show "ideal_generated {d} \<subseteq> ideal_generated {d', c}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ideal_generated {d} \<subseteq> ideal_generated {d', c}
[PROOF STEP]
proof (rule ideal_generated_singleton_subset)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. d \<in> ideal_generated {d', c}
 2. finite {d', c}
[PROOF STEP]
obtain f1 f2 f3 where f: "f1*a + f2*b + f3*c = d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>f1 f2 f3. f1 * a + f2 * b + f3 * c = d \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>f1 f2 f3. f1 * a + f2 * b + f3 * c = d \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "d \<in> ideal_generated {a,b,c}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d \<in> ideal_generated {a, b, c}
[PROOF STEP]
using i1
[PROOF STATE]
proof (prove)
using this:
ideal_generated {a, b, c} = ideal_generated {d}

goal (1 subgoal):
 1. d \<in> ideal_generated {a, b, c}
[PROOF STEP]
by (simp add: ideal_generated_in)
[PROOF STATE]
proof (state)
this:
d \<in> ideal_generated {a, b, c}

goal (1 subgoal):
 1. (\<And>f1 f2 f3. f1 * a + f2 * b + f3 * c = d \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
d \<in> ideal_generated {a, b, c}
[PROOF STEP]
obtain f where d: "(\<Sum>i\<in>{a,b,c}. f i * i) = d"
[PROOF STATE]
proof (prove)
using this:
d \<in> ideal_generated {a, b, c}

goal (1 subgoal):
 1. (\<And>f. (\<Sum>i\<in>{a, b, c}. f i * i) = d \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using ideal_explicit2[of "{a,b,c}"]
[PROOF STATE]
proof (prove)
using this:
d \<in> ideal_generated {a, b, c}
finite {a, b, c} \<Longrightarrow> ideal_generated {a, b, c} = {y. \<exists>f. (\<Sum>i\<in>{a, b, c}. f i * i) = y}

goal (1 subgoal):
 1. (\<And>f. (\<Sum>i\<in>{a, b, c}. f i * i) = d \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>{a, b, c}. f i * i) = d

goal (1 subgoal):
 1. (\<And>f1 f2 f3. f1 * a + f2 * b + f3 * c = d \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
obtain x y z where "(\<Sum>i\<in>{a,b,c}. f i * i) = x * a + y * b + z * c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x y z. (\<Sum>i\<in>{a, b, c}. f i * i) = x * a + y * b + z * c \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using sum_three_elements
[PROOF STATE]
proof (prove)
using this:
\<exists>x y z. (\<Sum>i\<in>{?a, ?b, ?c}. ?f i * i) = x * ?a + y * ?b + z * ?c

goal (1 subgoal):
 1. (\<And>x y z. (\<Sum>i\<in>{a, b, c}. f i * i) = x * a + y * b + z * c \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>{a, b, c}. f i * i) = x * a + y * b + z * c

goal (1 subgoal):
 1. (\<And>f1 f2 f3. f1 * a + f2 * b + f3 * c = d \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<in>{a, b, c}. f i * i) = x * a + y * b + z * c

goal (1 subgoal):
 1. thesis
[PROOF STEP]
using d that
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<in>{a, b, c}. f i * i) = x * a + y * b + z * c
(\<Sum>i\<in>{a, b, c}. f i * i) = d
?f1.1 * a + ?f2.1 * b + ?f3.1 * c = d \<Longrightarrow> thesis

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
f1 * a + f2 * b + f3 * c = d

goal (2 subgoals):
 1. d \<in> ideal_generated {d', c}
 2. finite {d', c}
[PROOF STEP]
obtain k where k: "f1*a + f2*b = k*d'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>k. f1 * a + f2 * b = k * d' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>k. f1 * a + f2 * b = k * d' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "f1*a + f2*b \<in> ideal_generated{a,b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f1 * a + f2 * b \<in> ideal_generated {a, b}
[PROOF STEP]
using ideal_generated_pair
[PROOF STATE]
proof (prove)
using this:
ideal_generated {?a, ?b} = {p * ?a + q * ?b |p q. True}

goal (1 subgoal):
 1. f1 * a + f2 * b \<in> ideal_generated {a, b}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f1 * a + f2 * b \<in> ideal_generated {a, b}

goal (1 subgoal):
 1. (\<And>k. f1 * a + f2 * b = k * d' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f1 * a + f2 * b \<in> ideal_generated {a, b}

goal (1 subgoal):
 1. (\<And>k. f1 * a + f2 * b = k * d' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "... = ideal_generated {d'}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ideal_generated {a, b} = ideal_generated {d'}
[PROOF STEP]
using i2
[PROOF STATE]
proof (prove)
using this:
ideal_generated {a, b} = ideal_generated {d'}

goal (1 subgoal):
 1. ideal_generated {a, b} = ideal_generated {d'}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ideal_generated {a, b} = ideal_generated {d'}

goal (1 subgoal):
 1. (\<And>k. f1 * a + f2 * b = k * d' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ideal_generated {a, b} = ideal_generated {d'}

goal (1 subgoal):
 1. (\<And>k. f1 * a + f2 * b = k * d' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "... = {k*d' |k. k\<in>UNIV}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ideal_generated {d'} = {k * d' |k. k \<in> UNIV}
[PROOF STEP]
using ideal_generated_singleton
[PROOF STATE]
proof (prove)
using this:
ideal_generated {?a} = {k * ?a |k. k \<in> UNIV}

goal (1 subgoal):
 1. ideal_generated {d'} = {k * d' |k. k \<in> UNIV}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ideal_generated {d'} = {k * d' |k. k \<in> UNIV}

goal (1 subgoal):
 1. (\<And>k. f1 * a + f2 * b = k * d' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
f1 * a + f2 * b \<in> {k * d' |k. k \<in> UNIV}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f1 * a + f2 * b \<in> {k * d' |k. k \<in> UNIV}

goal (1 subgoal):
 1. thesis
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
f1 * a + f2 * b \<in> {k * d' |k. k \<in> UNIV}
f1 * a + f2 * b = ?k1 * d' \<Longrightarrow> thesis

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
f1 * a + f2 * b = k * d'

goal (2 subgoals):
 1. d \<in> ideal_generated {d', c}
 2. finite {d', c}
[PROOF STEP]
have "k*d'+f3*c=d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k * d' + f3 * c = d
[PROOF STEP]
using f k
[PROOF STATE]
proof (prove)
using this:
f1 * a + f2 * b + f3 * c = d
f1 * a + f2 * b = k * d'

goal (1 subgoal):
 1. k * d' + f3 * c = d
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
k * d' + f3 * c = d

goal (2 subgoals):
 1. d \<in> ideal_generated {d', c}
 2. finite {d', c}
[PROOF STEP]
thus "d \<in> ideal_generated {d', c}"
[PROOF STATE]
proof (prove)
using this:
k * d' + f3 * c = d

goal (1 subgoal):
 1. d \<in> ideal_generated {d', c}
[PROOF STEP]
using ideal_generated_pair
[PROOF STATE]
proof (prove)
using this:
k * d' + f3 * c = d
ideal_generated {?a, ?b} = {p * ?a + q * ?b |p q. True}

goal (1 subgoal):
 1. d \<in> ideal_generated {d', c}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
d \<in> ideal_generated {d', c}

goal (1 subgoal):
 1. finite {d', c}
[PROOF STEP]
qed (simp)
[PROOF STATE]
proof (state)
this:
ideal_generated {d} \<subseteq> ideal_generated {d', c}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nths'_front: "\<lbrakk> i < j; i < length xs \<rbrakk> \<Longrightarrow> nths' i j xs = xs ! i # nths' (Suc i) j xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i < j; i < length xs\<rbrakk> \<Longrightarrow> nths' i j xs = xs ! i # nths' (Suc i) j xs
[PROOF STEP]
apply (induct xs arbitrary: i j)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i j. \<lbrakk>i < j; i < length []\<rbrakk> \<Longrightarrow> nths' i j [] = [] ! i # nths' (Suc i) j []
 2. \<And>a xs i j. \<lbrakk>\<And>i j. \<lbrakk>i < j; i < length xs\<rbrakk> \<Longrightarrow> nths' i j xs = xs ! i # nths' (Suc i) j xs; i < j; i < length (a # xs)\<rbrakk> \<Longrightarrow> nths' i j (a # xs) = (a # xs) ! i # nths' (Suc i) j (a # xs)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a xs i j. \<lbrakk>\<And>i j. \<lbrakk>i < j; i < length xs\<rbrakk> \<Longrightarrow> nths' i j xs = xs ! i # nths' (Suc i) j xs; i < j; i < length (a # xs)\<rbrakk> \<Longrightarrow> nths' i j (a # xs) = (a # xs) ! i # nths' (Suc i) j (a # xs)
[PROOF STEP]
apply (case_tac j)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a xs i j. \<lbrakk>\<And>i j. \<lbrakk>i < j; i < length xs\<rbrakk> \<Longrightarrow> nths' i j xs = xs ! i # nths' (Suc i) j xs; i < j; i < length (a # xs); j = 0\<rbrakk> \<Longrightarrow> nths' i j (a # xs) = (a # xs) ! i # nths' (Suc i) j (a # xs)
 2. \<And>a xs i j nat. \<lbrakk>\<And>i j. \<lbrakk>i < j; i < length xs\<rbrakk> \<Longrightarrow> nths' i j xs = xs ! i # nths' (Suc i) j xs; i < j; i < length (a # xs); j = Suc nat\<rbrakk> \<Longrightarrow> nths' i j (a # xs) = (a # xs) ! i # nths' (Suc i) j (a # xs)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a xs i j nat. \<lbrakk>\<And>i j. \<lbrakk>i < j; i < length xs\<rbrakk> \<Longrightarrow> nths' i j xs = xs ! i # nths' (Suc i) j xs; i < j; i < length (a # xs); j = Suc nat\<rbrakk> \<Longrightarrow> nths' i j (a # xs) = (a # xs) ! i # nths' (Suc i) j (a # xs)
[PROOF STEP]
apply (case_tac i)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a xs i j nat. \<lbrakk>\<And>i j. \<lbrakk>i < j; i < length xs\<rbrakk> \<Longrightarrow> nths' i j xs = xs ! i # nths' (Suc i) j xs; i < j; i < length (a # xs); j = Suc nat; i = 0\<rbrakk> \<Longrightarrow> nths' i j (a # xs) = (a # xs) ! i # nths' (Suc i) j (a # xs)
 2. \<And>a xs i j nat nata. \<lbrakk>\<And>i j. \<lbrakk>i < j; i < length xs\<rbrakk> \<Longrightarrow> nths' i j xs = xs ! i # nths' (Suc i) j xs; i < j; i < length (a # xs); j = Suc nat; i = Suc nata\<rbrakk> \<Longrightarrow> nths' i j (a # xs) = (a # xs) ! i # nths' (Suc i) j (a # xs)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a xs i j nat nata. \<lbrakk>\<And>i j. \<lbrakk>i < j; i < length xs\<rbrakk> \<Longrightarrow> nths' i j xs = xs ! i # nths' (Suc i) j xs; i < j; i < length (a # xs); j = Suc nat; i = Suc nata\<rbrakk> \<Longrightarrow> nths' i j (a # xs) = (a # xs) ! i # nths' (Suc i) j (a # xs)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma remove_Min_eq: "\<lbrakk> finite I; I \<noteq> {}; n \<noteq> Min I \<rbrakk> \<Longrightarrow> Min (I - {n}) = Min I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; I \<noteq> {}; n \<noteq> Min I\<rbrakk> \<Longrightarrow> Min (I - {n}) = Min I
[PROOF STEP]
by (rule Min_eqI, simp+)


[STATEMENT]
lemma rtrancl_image_idem[simp]: "R\<^sup>* `` R\<^sup>* `` s = R\<^sup>* `` s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R\<^sup>* `` R\<^sup>* `` s = R\<^sup>* `` s
[PROOF STEP]
by (metis relcomp_Image rtrancl_idemp_self_comp)


[STATEMENT]
lemma plus_complex_interval: "x \<in>\<^sub>c X \<Longrightarrow> y \<in>\<^sub>c Y \<Longrightarrow> x + y \<in>\<^sub>c X + Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in>\<^sub>c X; y \<in>\<^sub>c Y\<rbrakk> \<Longrightarrow> x + y \<in>\<^sub>c X + Y
[PROOF STEP]
unfolding in_complex_interval_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>case X of Complex_Interval r i \<Rightarrow> Re x \<in>\<^sub>i r \<and> Im x \<in>\<^sub>i i; case Y of Complex_Interval r i \<Rightarrow> Re y \<in>\<^sub>i r \<and> Im y \<in>\<^sub>i i\<rbrakk> \<Longrightarrow> case X + Y of Complex_Interval r i \<Rightarrow> Re (x + y) \<in>\<^sub>i r \<and> Im (x + y) \<in>\<^sub>i i
[PROOF STEP]
using plus_in_interval
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in>\<^sub>i ?X; ?y \<in>\<^sub>i ?Y\<rbrakk> \<Longrightarrow> ?x + ?y \<in>\<^sub>i ?X + ?Y

goal (1 subgoal):
 1. \<lbrakk>case X of Complex_Interval r i \<Rightarrow> Re x \<in>\<^sub>i r \<and> Im x \<in>\<^sub>i i; case Y of Complex_Interval r i \<Rightarrow> Re y \<in>\<^sub>i r \<and> Im y \<in>\<^sub>i i\<rbrakk> \<Longrightarrow> case X + Y of Complex_Interval r i \<Rightarrow> Re (x + y) \<in>\<^sub>i r \<and> Im (x + y) \<in>\<^sub>i i
[PROOF STEP]
by (cases X, cases Y, auto)


[STATEMENT]
lemma mu_bound_Gramian_determinant:
  assumes "l < k" "k < m"
  shows "(\<mu> k l)\<^sup>2 \<le> Gramian_determinant fs l * \<parallel>fs ! k\<parallel>\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<mu> k l)\<^sup>2 \<le> Gramian_determinant fs l * \<parallel>fs ! k\<parallel>\<^sup>2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<mu> k l)\<^sup>2 \<le> Gramian_determinant fs l * \<parallel>fs ! k\<parallel>\<^sup>2
[PROOF STEP]
have "(\<mu> k l)\<^sup>2  = (fs ! k \<bullet> gso l)\<^sup>2 / (\<parallel>gso l\<parallel>\<^sup>2)\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<mu> k l)\<^sup>2 = (fs ! k \<bullet> gso l)\<^sup>2 / \<parallel>gso l\<parallel>\<^sup>2\<^sup>2
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
l < k
k < length fs

goal (1 subgoal):
 1. (\<mu> k l)\<^sup>2 = (fs ! k \<bullet> gso l)\<^sup>2 / \<parallel>gso l\<parallel>\<^sup>2\<^sup>2
[PROOF STEP]
by (simp add: power_divide \<mu>.simps)
[PROOF STATE]
proof (state)
this:
(\<mu> k l)\<^sup>2 = (fs ! k \<bullet> gso l)\<^sup>2 / \<parallel>gso l\<parallel>\<^sup>2\<^sup>2

goal (1 subgoal):
 1. (\<mu> k l)\<^sup>2 \<le> Gramian_determinant fs l * \<parallel>fs ! k\<parallel>\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<mu> k l)\<^sup>2 = (fs ! k \<bullet> gso l)\<^sup>2 / \<parallel>gso l\<parallel>\<^sup>2\<^sup>2

goal (1 subgoal):
 1. (\<mu> k l)\<^sup>2 \<le> Gramian_determinant fs l * \<parallel>fs ! k\<parallel>\<^sup>2
[PROOF STEP]
have "\<dots> \<le> (\<parallel>fs ! k\<parallel>\<^sup>2 * \<parallel>gso l\<parallel>\<^sup>2) / (\<parallel>gso l\<parallel>\<^sup>2)\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (fs ! k \<bullet> gso l)\<^sup>2 / \<parallel>gso l\<parallel>\<^sup>2\<^sup>2 \<le> \<parallel>fs ! k\<parallel>\<^sup>2 * \<parallel>gso l\<parallel>\<^sup>2 / \<parallel>gso l\<parallel>\<^sup>2\<^sup>2
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
l < k
k < length fs

goal (1 subgoal):
 1. (fs ! k \<bullet> gso l)\<^sup>2 / \<parallel>gso l\<parallel>\<^sup>2\<^sup>2 \<le> \<parallel>fs ! k\<parallel>\<^sup>2 * \<parallel>gso l\<parallel>\<^sup>2 / \<parallel>gso l\<parallel>\<^sup>2\<^sup>2
[PROOF STEP]
by (auto intro!: scalar_prod_Cauchy divide_right_mono)
[PROOF STATE]
proof (state)
this:
(fs ! k \<bullet> gso l)\<^sup>2 / \<parallel>gso l\<parallel>\<^sup>2\<^sup>2 \<le> \<parallel>fs ! k\<parallel>\<^sup>2 * \<parallel>gso l\<parallel>\<^sup>2 / \<parallel>gso l\<parallel>\<^sup>2\<^sup>2

goal (1 subgoal):
 1. (\<mu> k l)\<^sup>2 \<le> Gramian_determinant fs l * \<parallel>fs ! k\<parallel>\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(fs ! k \<bullet> gso l)\<^sup>2 / \<parallel>gso l\<parallel>\<^sup>2\<^sup>2 \<le> \<parallel>fs ! k\<parallel>\<^sup>2 * \<parallel>gso l\<parallel>\<^sup>2 / \<parallel>gso l\<parallel>\<^sup>2\<^sup>2

goal (1 subgoal):
 1. (\<mu> k l)\<^sup>2 \<le> Gramian_determinant fs l * \<parallel>fs ! k\<parallel>\<^sup>2
[PROOF STEP]
have "\<dots> = \<parallel>fs ! k\<parallel>\<^sup>2 / \<parallel>gso l\<parallel>\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>fs ! k\<parallel>\<^sup>2 * \<parallel>gso l\<parallel>\<^sup>2 / \<parallel>gso l\<parallel>\<^sup>2\<^sup>2 = \<parallel>fs ! k\<parallel>\<^sup>2 / \<parallel>gso l\<parallel>\<^sup>2
[PROOF STEP]
by (auto simp add: field_simps power2_eq_square)
[PROOF STATE]
proof (state)
this:
\<parallel>fs ! k\<parallel>\<^sup>2 * \<parallel>gso l\<parallel>\<^sup>2 / \<parallel>gso l\<parallel>\<^sup>2\<^sup>2 = \<parallel>fs ! k\<parallel>\<^sup>2 / \<parallel>gso l\<parallel>\<^sup>2

goal (1 subgoal):
 1. (\<mu> k l)\<^sup>2 \<le> Gramian_determinant fs l * \<parallel>fs ! k\<parallel>\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<parallel>fs ! k\<parallel>\<^sup>2 * \<parallel>gso l\<parallel>\<^sup>2 / \<parallel>gso l\<parallel>\<^sup>2\<^sup>2 = \<parallel>fs ! k\<parallel>\<^sup>2 / \<parallel>gso l\<parallel>\<^sup>2

goal (1 subgoal):
 1. (\<mu> k l)\<^sup>2 \<le> Gramian_determinant fs l * \<parallel>fs ! k\<parallel>\<^sup>2
[PROOF STEP]
have "\<dots> =  \<parallel>fs ! k\<parallel>\<^sup>2 / (Gramian_determinant fs (Suc l) / Gramian_determinant fs l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>fs ! k\<parallel>\<^sup>2 / \<parallel>gso l\<parallel>\<^sup>2 = \<parallel>fs ! k\<parallel>\<^sup>2 / (Gramian_determinant fs (Suc l) / Gramian_determinant fs l)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
l < k
k < length fs

goal (1 subgoal):
 1. \<parallel>fs ! k\<parallel>\<^sup>2 / \<parallel>gso l\<parallel>\<^sup>2 = \<parallel>fs ! k\<parallel>\<^sup>2 / (Gramian_determinant fs (Suc l) / Gramian_determinant fs l)
[PROOF STEP]
by (subst Gramian_determinant_div[symmetric]) auto
[PROOF STATE]
proof (state)
this:
\<parallel>fs ! k\<parallel>\<^sup>2 / \<parallel>gso l\<parallel>\<^sup>2 = \<parallel>fs ! k\<parallel>\<^sup>2 / (Gramian_determinant fs (Suc l) / Gramian_determinant fs l)

goal (1 subgoal):
 1. (\<mu> k l)\<^sup>2 \<le> Gramian_determinant fs l * \<parallel>fs ! k\<parallel>\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<parallel>fs ! k\<parallel>\<^sup>2 / \<parallel>gso l\<parallel>\<^sup>2 = \<parallel>fs ! k\<parallel>\<^sup>2 / (Gramian_determinant fs (Suc l) / Gramian_determinant fs l)

goal (1 subgoal):
 1. (\<mu> k l)\<^sup>2 \<le> Gramian_determinant fs l * \<parallel>fs ! k\<parallel>\<^sup>2
[PROOF STEP]
have "\<dots> =  Gramian_determinant fs l * \<parallel>fs ! k\<parallel>\<^sup>2 / Gramian_determinant fs (Suc l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>fs ! k\<parallel>\<^sup>2 / (Gramian_determinant fs (Suc l) / Gramian_determinant fs l) = Gramian_determinant fs l * \<parallel>fs ! k\<parallel>\<^sup>2 / Gramian_determinant fs (Suc l)
[PROOF STEP]
by (auto simp add: field_simps)
[PROOF STATE]
proof (state)
this:
\<parallel>fs ! k\<parallel>\<^sup>2 / (Gramian_determinant fs (Suc l) / Gramian_determinant fs l) = Gramian_determinant fs l * \<parallel>fs ! k\<parallel>\<^sup>2 / Gramian_determinant fs (Suc l)

goal (1 subgoal):
 1. (\<mu> k l)\<^sup>2 \<le> Gramian_determinant fs l * \<parallel>fs ! k\<parallel>\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<parallel>fs ! k\<parallel>\<^sup>2 / (Gramian_determinant fs (Suc l) / Gramian_determinant fs l) = Gramian_determinant fs l * \<parallel>fs ! k\<parallel>\<^sup>2 / Gramian_determinant fs (Suc l)

goal (1 subgoal):
 1. (\<mu> k l)\<^sup>2 \<le> Gramian_determinant fs l * \<parallel>fs ! k\<parallel>\<^sup>2
[PROOF STEP]
have "\<dots> \<le> Gramian_determinant fs l * \<parallel>fs ! k\<parallel>\<^sup>2 / 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gramian_determinant fs l * \<parallel>fs ! k\<parallel>\<^sup>2 / Gramian_determinant fs (Suc l) \<le> Gramian_determinant fs l * \<parallel>fs ! k\<parallel>\<^sup>2 / (1::'a)
[PROOF STEP]
by (rule divide_left_mono, insert Gramian_determinant_ge1[of l] Gramian_determinant_ge1[of "Suc l"] assms,
    auto intro!: mult_nonneg_nonneg)
[PROOF STATE]
proof (state)
this:
Gramian_determinant fs l * \<parallel>fs ! k\<parallel>\<^sup>2 / Gramian_determinant fs (Suc l) \<le> Gramian_determinant fs l * \<parallel>fs ! k\<parallel>\<^sup>2 / (1::'a)

goal (1 subgoal):
 1. (\<mu> k l)\<^sup>2 \<le> Gramian_determinant fs l * \<parallel>fs ! k\<parallel>\<^sup>2
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<mu> k l)\<^sup>2 \<le> Gramian_determinant fs l * \<parallel>fs ! k\<parallel>\<^sup>2 / (1::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<mu> k l)\<^sup>2 \<le> Gramian_determinant fs l * \<parallel>fs ! k\<parallel>\<^sup>2 / (1::'a)

goal (1 subgoal):
 1. (\<mu> k l)\<^sup>2 \<le> Gramian_determinant fs l * \<parallel>fs ! k\<parallel>\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<mu> k l)\<^sup>2 \<le> Gramian_determinant fs l * \<parallel>fs ! k\<parallel>\<^sup>2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma meet_def': "(x::'a::Finite_Meet_cpo) \<sqinter> y = glb {x, y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqinter> y = \<Sqinter>{x, y}
[PROOF STEP]
unfolding meet_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if Ex ((>>|) {x, y}) then \<Sqinter>{x, y} else x) = \<Sqinter>{x, y}
[PROOF STEP]
by (metis binary_meet_exists')


[STATEMENT]
lemma bounded_apply_blinfun:
  assumes "bounded ((F :: 'c \<Rightarrow> 'd::real_normed_vector \<Rightarrow>\<^sub>L 'b::real_normed_vector) ` S)"
  shows "bounded ((\<lambda>b. blinfun_apply (F b) x) ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded ((\<lambda>b. blinfun_apply (F b) x) ` S)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bounded ((\<lambda>b. blinfun_apply (F b) x) ` S)
[PROOF STEP]
obtain b where "\<forall>x\<in>S. norm (F x) \<le> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>b. \<forall>x\<in>S. norm (F x) \<le> b \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (meson \<open>bounded (F ` S)\<close> bounded_pos image_eqI)
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>S. norm (F x) \<le> b

goal (1 subgoal):
 1. bounded ((\<lambda>b. blinfun_apply (F b) x) ` S)
[PROOF STEP]
thus "bounded ((\<lambda>b. (F b) x) ` S)"
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>S. norm (F x) \<le> b

goal (1 subgoal):
 1. bounded ((\<lambda>b. blinfun_apply (F b) x) ` S)
[PROOF STEP]
by (auto simp: mult_right_mono mult.commute[of _ b]
        intro!: boundedI[of _ "norm x * b"] dual_order.trans[OF _ norm_blinfun])
[PROOF STATE]
proof (state)
this:
bounded ((\<lambda>b. blinfun_apply (F b) x) ` S)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma All_Ex_refl_eq1 [simp]: "(\<forall>x. (\<exists>b. x = f b) \<longrightarrow> P x) = (\<forall>b. P (f b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. (\<exists>b. x = f b) \<longrightarrow> P x) = (\<forall>b. P (f b))
[PROOF STEP]
by auto


[STATEMENT]
lemma lcm_div_le':
  fixes a :: nat
  shows "lcm a b div a \<le> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lcm a b div a \<le> b
[PROOF STEP]
by (metis lcm.commute lcm_div_le)


[STATEMENT]
lemma lm029:
  "x \<in> X = ({x} \<in> finestpart X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> X) = ({x} \<in> finestpart X)
[PROOF STEP]
using finestpart_def
[PROOF STATE]
proof (prove)
using this:
finestpart ?X = (\<lambda>x. {x}) ` ?X

goal (1 subgoal):
 1. (x \<in> X) = ({x} \<in> finestpart X)
[PROOF STEP]
by force


[STATEMENT]
lemma fcard_finsert_le: "fcard A \<le> fcard (finsert x A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fcard A \<le> fcard (finsert x A)
[PROOF STEP]
by transfer (rule card_insert_le)


[STATEMENT]
lemma fds_shift_minus [simp]:
  fixes f g :: "'a :: {comm_semiring_1_cancel, nat_power} fds"
  shows "fds_shift c (f - g) = fds_shift c f - fds_shift c g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_shift c (f - g) = fds_shift c f - fds_shift c g
[PROOF STEP]
by (rule fds_eqI) (simp add: algebra_simps)


[STATEMENT]
lemma eq_fps_sin:
  assumes a0: "a $ 0 = 0"
    and a1: "a $ 1 = c"
    and a2: "fps_deriv (fps_deriv a) = - (fps_const c * fps_const c * a)"
  shows "fps_sin c = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_sin c = a
[PROOF STEP]
proof (rule fps_ext)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. fps_sin c $ n = a $ n
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. fps_sin c $ n = a $ n
[PROOF STEP]
show "fps_sin c $ n = a $ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_sin c $ n = a $ n
[PROOF STEP]
proof (induction n rule: nat_induct2)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. fps_sin c $ 0 = a $ 0
 2. fps_sin c $ 1 = a $ 1
 3. \<And>n. fps_sin c $ n = a $ n \<Longrightarrow> fps_sin c $ (n + 2) = a $ (n + 2)
[PROOF STEP]
case (step n)
[PROOF STATE]
proof (state)
this:
fps_sin c $ n = a $ n

goal (3 subgoals):
 1. fps_sin c $ 0 = a $ 0
 2. fps_sin c $ 1 = a $ 1
 3. \<And>n. fps_sin c $ n = a $ n \<Longrightarrow> fps_sin c $ (n + 2) = a $ (n + 2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
fps_sin c $ n = a $ n
[PROOF STEP]
have "of_nat (n + 1) * (of_nat (n + 2) * a $ (n + 2)) =
     - (c * c * fps_sin c $ n)"
[PROOF STATE]
proof (prove)
using this:
fps_sin c $ n = a $ n

goal (1 subgoal):
 1. of_nat (n + 1) * (of_nat (n + 2) * a $ (n + 2)) = - (c * c * fps_sin c $ n)
[PROOF STEP]
using a2
[PROOF STATE]
proof (prove)
using this:
fps_sin c $ n = a $ n
fps_deriv (fps_deriv a) = - (fps_const c * fps_const c * a)

goal (1 subgoal):
 1. of_nat (n + 1) * (of_nat (n + 2) * a $ (n + 2)) = - (c * c * fps_sin c $ n)
[PROOF STEP]
by (metis fps_const_mult fps_deriv_nth fps_mult_left_const_nth fps_neg_nth nat_add_1_add_1)
[PROOF STATE]
proof (state)
this:
of_nat (n + 1) * (of_nat (n + 2) * a $ (n + 2)) = - (c * c * fps_sin c $ n)

goal (3 subgoals):
 1. fps_sin c $ 0 = a $ 0
 2. fps_sin c $ 1 = a $ 1
 3. \<And>n. fps_sin c $ n = a $ n \<Longrightarrow> fps_sin c $ (n + 2) = a $ (n + 2)
[PROOF STEP]
with step
[PROOF STATE]
proof (chain)
picking this:
fps_sin c $ n = a $ n
of_nat (n + 1) * (of_nat (n + 2) * a $ (n + 2)) = - (c * c * fps_sin c $ n)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
fps_sin c $ n = a $ n
of_nat (n + 1) * (of_nat (n + 2) * a $ (n + 2)) = - (c * c * fps_sin c $ n)

goal (1 subgoal):
 1. fps_sin c $ (n + 2) = a $ (n + 2)
[PROOF STEP]
by (metis (no_types, lifting) a0 add.commute add.inverse_inverse fps_sin_nth_0 fps_sin_nth_add_2 mult_divide_mult_cancel_left_if mult_minus_right nonzero_mult_div_cancel_left not_less_zero of_nat_eq_0_iff plus_1_eq_Suc zero_less_Suc)
[PROOF STATE]
proof (state)
this:
fps_sin c $ (n + 2) = a $ (n + 2)

goal (2 subgoals):
 1. fps_sin c $ 0 = a $ 0
 2. fps_sin c $ 1 = a $ 1
[PROOF STEP]
qed (use assms in auto)
[PROOF STATE]
proof (state)
this:
fps_sin c $ n = a $ n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma image_subset_iff_subset_evimage: "A \<subseteq> carrier (R\<^bsup>n\<^esup>) \<Longrightarrow> f ` A \<subseteq> B \<longleftrightarrow> A \<subseteq> f \<inverse>\<^bsub>n\<^esub> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<subseteq> carrier (R\<^bsup>n\<^esup>) \<Longrightarrow> (f ` A \<subseteq> B) = (A \<subseteq> f \<inverse>\<^bsub>n\<^esub> B)
[PROOF STEP]
by blast


[STATEMENT]
lemma word_neg_numeral_alt: "- numeral b = word_of_int (- numeral b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - numeral b = word_of_int (- numeral b)
[PROOF STEP]
by (simp only: word_numeral_alt wi_hom_neg)


[STATEMENT]
lemma perp_comm:
  assumes "A B Perp C D"
  shows "B A Perp D C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B A Perp D C
[PROOF STEP]
by (simp add: assms perp_left_comm perp_right_comm)


[STATEMENT]
lemma tiling_UnI [intro]:
  "\<lbrakk> t \<in> tiling A; u \<in> tiling A; t \<inter> u = {} \<rbrakk> \<Longrightarrow>  t \<union> u \<in> tiling A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>t \<in> tiling A; u \<in> tiling A; t \<inter> u = {}\<rbrakk> \<Longrightarrow> t \<union> u \<in> tiling A
[PROOF STEP]
apply (induct set: tiling)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>u \<in> tiling A; {} \<inter> u = {}\<rbrakk> \<Longrightarrow> {} \<union> u \<in> tiling A
 2. \<And>a t. \<lbrakk>a \<in> A; t \<in> tiling A; \<lbrakk>u \<in> tiling A; t \<inter> u = {}\<rbrakk> \<Longrightarrow> t \<union> u \<in> tiling A; a \<inter> t = {}; u \<in> tiling A; (a \<union> t) \<inter> u = {}\<rbrakk> \<Longrightarrow> a \<union> t \<union> u \<in> tiling A
[PROOF STEP]
apply (auto simp add: Un_assoc)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma conv_radius_leI_ex':
  fixes f :: "nat \<Rightarrow> 'a :: {banach, real_normed_div_algebra}"
  assumes "R \<ge> 0"
  assumes "\<And>r. 0 < r \<Longrightarrow> ereal r > R \<Longrightarrow> \<not>summable (\<lambda>n. f n * of_real r^n)"
  shows   "conv_radius f \<le> R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conv_radius f \<le> R
[PROOF STEP]
proof (rule conv_radius_leI_ex)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 \<le> R
 2. \<And>r. \<lbrakk>0 < r; R < ereal r\<rbrakk> \<Longrightarrow> \<exists>z. norm z = r \<and> \<not> summable (\<lambda>n. norm (f n * z ^ n))
[PROOF STEP]
fix r
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 \<le> R
 2. \<And>r. \<lbrakk>0 < r; R < ereal r\<rbrakk> \<Longrightarrow> \<exists>z. norm z = r \<and> \<not> summable (\<lambda>n. norm (f n * z ^ n))
[PROOF STEP]
assume "0 < r" "ereal r > R"
[PROOF STATE]
proof (state)
this:
0 < r
R < ereal r

goal (2 subgoals):
 1. 0 \<le> R
 2. \<And>r. \<lbrakk>0 < r; R < ereal r\<rbrakk> \<Longrightarrow> \<exists>z. norm z = r \<and> \<not> summable (\<lambda>n. norm (f n * z ^ n))
[PROOF STEP]
with assms(2)[of r]
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>0 < r; R < ereal r\<rbrakk> \<Longrightarrow> \<not> summable (\<lambda>n. f n * of_real r ^ n)
0 < r
R < ereal r
[PROOF STEP]
show "\<exists>z. norm z = r \<and> \<not>summable (\<lambda>n. norm (f n * z ^ n))"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < r; R < ereal r\<rbrakk> \<Longrightarrow> \<not> summable (\<lambda>n. f n * of_real r ^ n)
0 < r
R < ereal r

goal (1 subgoal):
 1. \<exists>z. norm z = r \<and> \<not> summable (\<lambda>n. norm (f n * z ^ n))
[PROOF STEP]
by (intro exI[of _ "of_real r :: 'a"]) (auto dest: summable_norm_cancel)
[PROOF STATE]
proof (state)
this:
\<exists>z. norm z = r \<and> \<not> summable (\<lambda>n. norm (f n * z ^ n))

goal (1 subgoal):
 1. 0 \<le> R
[PROOF STEP]
qed fact+


[STATEMENT]
lemma Inf_comp_fun:
  "\<Sqinter>M \<circ> f = (\<Sqinter>m\<in>M. m \<circ> f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sqinter> M \<circ> f = (\<Sqinter>m\<in>M. m \<circ> f)
[PROOF STEP]
by (simp add: fun_eq_iff image_comp)


[STATEMENT]
lemma unit_disc_fix_f_moebius_pt [simp]:
  assumes "unit_disc_fix M"
  shows "unit_disc_fix_f (moebius_pt M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unit_disc_fix_f (moebius_pt M)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
unit_disc_fix M

goal (1 subgoal):
 1. unit_disc_fix_f (moebius_pt M)
[PROOF STEP]
unfolding unit_disc_fix_f_def
[PROOF STATE]
proof (prove)
using this:
unit_disc_fix M

goal (1 subgoal):
 1. \<exists>Ma. unit_disc_fix Ma \<and> (moebius_pt M = moebius_pt Ma \<or> moebius_pt M = moebius_pt Ma \<circ> conjugate)
[PROOF STEP]
by auto


[STATEMENT]
lemma sgn_of_real: "sgn (of_real r :: 'a::real_normed_algebra_1) = of_real (sgn r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sgn (of_real r) = of_real (sgn r)
[PROOF STEP]
unfolding of_real_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sgn (r *\<^sub>R (1::'a)) = sgn r *\<^sub>R (1::'a)
[PROOF STEP]
by (simp only: sgn_scaleR sgn_one)


[STATEMENT]
lemma coreflexive_linorder_matrix_1:
  fixes f :: "('a::finite,'b::linorder_stone_relation_algebra_expansion) square"
  assumes "matrix_idempotent_semiring.coreflexive f"
      and "i \<noteq> j"
    shows "f (i,j) = bot"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (i, j) = bot
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f (i, j) = bot
[PROOF STEP]
have "f (i,j) \<le> mone (i,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (i, j) \<le> mone (i, j)
[PROOF STEP]
using assms less_eq_matrix_def
[PROOF STATE]
proof (prove)
using this:
matrix_idempotent_semiring.coreflexive f
i \<noteq> j
(?f \<preceq> ?g) = (\<forall>e. ?f e \<le> ?g e)

goal (1 subgoal):
 1. f (i, j) \<le> mone (i, j)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f (i, j) \<le> mone (i, j)

goal (1 subgoal):
 1. f (i, j) = bot
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f (i, j) \<le> mone (i, j)

goal (1 subgoal):
 1. f (i, j) = bot
[PROOF STEP]
have "... = bot"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mone (i, j) = bot
[PROOF STEP]
by (simp add: assms one_matrix_def)
[PROOF STATE]
proof (state)
this:
mone (i, j) = bot

goal (1 subgoal):
 1. f (i, j) = bot
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
f (i, j) \<le> bot
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f (i, j) \<le> bot

goal (1 subgoal):
 1. f (i, j) = bot
[PROOF STEP]
by (simp add: bot.extremum_unique)
[PROOF STATE]
proof (state)
this:
f (i, j) = bot

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma insertion_sum : "\<forall>(n::nat). ((insertion f (\<Sum>i\<in>{0..<n}.g(i))) = (\<Sum>i\<in>{0..<n}. insertion f (g i)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n. insertion f (sum g {0..<n}) = (\<Sum>i = 0..<n. insertion f (g i))
[PROOF STEP]
using insertion_sum_var
[PROOF STATE]
proof (prove)
using this:
insertion ?f (sum ?g {0..<?n}) = (\<Sum>i = 0..<?n. insertion ?f (?g i))

goal (1 subgoal):
 1. \<forall>n. insertion f (sum g {0..<n}) = (\<Sum>i = 0..<n. insertion f (g i))
[PROOF STEP]
by blast


[STATEMENT]
lemma vifunion_vintersection:
  "(\<Union>\<^sub>\<circ>i\<in>\<^sub>\<circ>I. f i) \<inter>\<^sub>\<circ> (\<Union>\<^sub>\<circ>j\<in>\<^sub>\<circ>J. g j) = (\<Union>\<^sub>\<circ>i\<in>\<^sub>\<circ>I. \<Union>\<^sub>\<circ>j\<in>\<^sub>\<circ>J. f i \<inter>\<^sub>\<circ> g j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union>\<^sub>\<circ> (VLambda I f `\<^sub>\<circ> I) \<inter>\<^sub>\<circ> \<Union>\<^sub>\<circ> (VLambda J g `\<^sub>\<circ> J) = \<Union>\<^sub>\<circ> ((\<lambda>a\<in>\<^sub>\<circ>I. \<Union>\<^sub>\<circ> ((\<lambda>aa\<in>\<^sub>\<circ>J. f a \<inter>\<^sub>\<circ> g aa) `\<^sub>\<circ> J)) `\<^sub>\<circ> I)
[PROOF STEP]
by (force simp: vrange_VLambda vimage_VLambda_vrange_rep)


[STATEMENT]
lemma A_simps[simp]: "A a (Node l a r) = 1"
 "a<b \<Longrightarrow> A a (Node (Node ll a lr) b r) = \<phi> lr r - \<phi> lr ll + 1"
 "b<a \<Longrightarrow> A a (Node l b (Node rl a rr)) = \<phi> rl l - \<phi> rr rl + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A a \<langle>l, a, r\<rangle> = 1 &&& (a < b \<Longrightarrow> A a \<langle>\<langle>ll, a, lr\<rangle>, b, r\<rangle> = local.\<phi> lr r - local.\<phi> lr ll + 1) &&& (b < a \<Longrightarrow> A a \<langle>l, b, \<langle>rl, a, rr\<rangle>\<rangle> = local.\<phi> rl l - local.\<phi> rr rl + 1)
[PROOF STEP]
by(auto simp add: A_def \<phi>_def algebra_simps)


[STATEMENT]
lemma stirling_Suc_n_1: "stirling (Suc n) (Suc 0) = fact n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. stirling (Suc n) (Suc 0) = fact n
[PROOF STEP]
by (induct n) auto


[STATEMENT]
lemma word_le_plus_1: "\<lbrakk> (y::('a::len) word) < y + n; a < n \<rbrakk> \<Longrightarrow> y + a \<le> y + a + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>y < y + n; a < n\<rbrakk> \<Longrightarrow> y + a \<le> y + a + 1
[PROOF STEP]
by unat_arith


[STATEMENT]
lemma qbs_prob_integral_Markov_inequality:
  assumes "qbs_prob_space_qbs s = X"
      and "qbs_integrable s f"
          "\<And>x. x \<in> qbs_space X \<Longrightarrow> 0 \<le> f x"
      and "0 < c"
    shows "qbs_emeasure s {x \<in> qbs_space X. c \<le> f x} \<le> ennreal (1/c * qbs_prob_integral s f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. qbs_emeasure s {x \<in> qbs_space X. c \<le> f x} \<le> ennreal (1 / c * qbs_prob_integral s f)
[PROOF STEP]
using integral_Markov_inequality[OF integrable_if_qbs_integrable[OF assms(2)] _ assms(4)] assms(3)
[PROOF STATE]
proof (prove)
using this:
AE x in qbs_prob_measure s. 0 \<le> f x \<Longrightarrow> emeasure (qbs_prob_measure s) {x \<in> space (qbs_prob_measure s). c \<le> f x} \<le> ennreal (1 / c * qbs_prob_measure_prob_space.expectation s f)
?x \<in> qbs_space X \<Longrightarrow> 0 \<le> f ?x

goal (1 subgoal):
 1. qbs_emeasure s {x \<in> qbs_space X. c \<le> f x} \<le> ennreal (1 / c * qbs_prob_integral s f)
[PROOF STEP]
by(force simp add: qbs_prob_integral_def2 qbs_prob_measure_space qbs_emeasure_def assms(1) qbs_prob_measure_space[symmetric])


[STATEMENT]
lemma gcd_neg_numeral_1_int [simp]: "gcd (- numeral n :: int) x = gcd (numeral n) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd (- numeral n) x = gcd (numeral n) x
[PROOF STEP]
by (fact gcd_neg1_int)


[STATEMENT]
lemma all_nat_less_eq [code_unfold]:
  "(\<forall>m<n::nat. P m) \<longleftrightarrow> (\<forall>m \<in> {0..<n}. P m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>m<n. P m) = (\<forall>m\<in>{0..<n}. P m)
[PROOF STEP]
by auto


[STATEMENT]
lemma sphere_eq_empty [simp]:
  fixes a :: "'a::{real_normed_vector, perfect_space}"
  shows "sphere a r = {} \<longleftrightarrow> r < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sphere a r = {}) = (r < 0)
[PROOF STEP]
by (auto simp: sphere_def dist_norm) (metis dist_norm le_less_linear vector_choose_dist)


[STATEMENT]
lemma less_Suc_iff_disj: "i < Suc x \<longleftrightarrow> i = x \<or> i < x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (i < Suc x) = (i = x \<or> i < x)
[PROOF STEP]
by auto


[STATEMENT]
lemma minus_numeral_inc_eq:
  \<open>- numeral (Num.inc n) = NOT (numeral n)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - numeral (Num.inc n) = NOT (numeral n)
[PROOF STEP]
by (simp add: not_eq_complement sub_inc_One_eq add_One)


[STATEMENT]
lemma real_affinity_lt: "0 < m \<Longrightarrow> m * x + c < y \<longleftrightarrow> x < inverse m * y + - (c / m)"
  for m :: "'a::linordered_field"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) < m \<Longrightarrow> (m * x + c < y) = (x < inverse m * y + - (c / m))
[PROOF STEP]
by (simp add: field_simps)


[STATEMENT]
lemma size_Union_distinct_cart_prod: "distinct_mset M \<Longrightarrow>
    size (\<Sum>p\<in>#M. ({#p#} \<times># B)) = size (M) * size (B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct_mset M \<Longrightarrow> size (\<Sum>p\<in>#M. {#p#} \<times># B) = size M * size B
[PROOF STEP]
by (induction M) auto


[STATEMENT]
lemma powhr_less_cancel: "\<And>a b x. x powhr a < x powhr b \<Longrightarrow> 1 < x \<Longrightarrow> a < b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b x. \<lbrakk>x powhr a < x powhr b; 1 < x\<rbrakk> \<Longrightarrow> a < b
[PROOF STEP]
by transfer simp


[STATEMENT]
lemma p2prop:
  "left_unique P = IS_LEFT_UNIQUE (p2rel P)"
  "right_unique P = IS_RIGHT_UNIQUE (p2rel P)"
  "left_total P = IS_LEFT_TOTAL (p2rel P)"
  "right_total P = IS_RIGHT_TOTAL (p2rel P)"
  "bi_unique P \<longleftrightarrow> left_unique P \<and> right_unique P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (left_unique P = IS_LEFT_UNIQUE (p2rel P) &&& right_unique P = single_valued (p2rel P)) &&& left_total P = IS_LEFT_TOTAL (p2rel P) &&& right_total P = IS_RIGHT_TOTAL (p2rel P) &&& bi_unique P = (left_unique P \<and> right_unique P)
[PROOF STEP]
by (auto
    simp: IS_LEFT_UNIQUE_def left_unique_def single_valued_def
    simp: right_unique_def bi_unique_alt_def
    simp: IS_LEFT_TOTAL_def left_total_def
    simp: IS_RIGHT_TOTAL_def right_total_def
    simp: p2rel_def
    )


[STATEMENT]
lemma create_opt_sol_satisfies_leq:
  assumes "create_optimal_solutions A b c = Sat X"
  assumes "(x, y) = split_n_m_x (dim_vec c) (dim_vec b) X"
  shows "x \<bullet> c \<ge> y \<bullet> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<bullet> b \<le> x \<bullet> c
[PROOF STEP]
using create_opt_sol_satisfies[of A b c X]
[PROOF STATE]
proof (prove)
using this:
create_optimal_solutions A b c = Inr X \<Longrightarrow> \<langle>X\<rangle> \<Turnstile>\<^sub>c\<^sub>s set (x_times_c_geq_y_times_b c b # mat_leqb_eqc A b c @ from_index_geq0_vector (dim_vec c) (0\<^sub>v (dim_vec b)))

goal (1 subgoal):
 1. y \<bullet> b \<le> x \<bullet> c
[PROOF STEP]
by (metis assms(1) assms(2) carrier_vec_dim_vec comm_scalar_prod list.set_intros(1)
      split_n_m_x_abbrev_dims(2) split_vec_dims(1) x_times_c_geq_y_times_b_split_dotP)


[STATEMENT]
lemma up_set_idem [simp]: "\<Up> \<circ> \<Up> = \<Up>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Up> \<circ> \<Up> = \<Up>
[PROOF STEP]
by (metis comp_assoc downset_set_idem upset_set_downset_set_dual upset_set_to_downset_set)


[STATEMENT]
lemma index_mat_addrow_mat[simp]:
  "i < n \<Longrightarrow> j < n \<Longrightarrow> addrow_mat n a k l $$ (i,j) =
    (if k = i \<and> l = j then (+) a else id) (if i = j then 1 else 0)"
  "dim_row (addrow_mat n a k l) = n" "dim_col (addrow_mat n a k l) = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lbrakk>i < n; j < n\<rbrakk> \<Longrightarrow> addrow_mat n a k l $$ (i, j) = (if k = i \<and> l = j then (+) a else id) (if i = j then 1::'a else (0::'a))) &&& dim_row (addrow_mat n a k l) = n &&& dim_col (addrow_mat n a k l) = n
[PROOF STEP]
unfolding addrow_mat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lbrakk>i < n; j < n\<rbrakk> \<Longrightarrow> mat n n (\<lambda>(i, j). (if k = i \<and> l = j then (+) a else id) (if i = j then 1::'a else (0::'a))) $$ (i, j) = (if k = i \<and> l = j then (+) a else id) (if i = j then 1::'a else (0::'a))) &&& dim_row (mat n n (\<lambda>(i, j). (if k = i \<and> l = j then (+) a else id) (if i = j then 1::'a else (0::'a)))) = n &&& dim_col (mat n n (\<lambda>(i, j). (if k = i \<and> l = j then (+) a else id) (if i = j then 1::'a else (0::'a)))) = n
[PROOF STEP]
by auto


[STATEMENT]
lemma degree_X[simp]:
  assumes "\<one> \<noteq>\<zero>"
  shows"degree X = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deg R (X_poly R) = 1
[PROOF STEP]
unfolding X_poly_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deg R (monom (UP R) \<one> 1) = 1
[PROOF STEP]
using assms P_def deg_monom[of \<one> 1]
[PROOF STATE]
proof (prove)
using this:
\<one> \<noteq> \<zero>
P \<equiv> UP R
\<lbrakk>\<one> \<noteq> \<zero>; \<one> \<in> carrier R\<rbrakk> \<Longrightarrow> deg R (monom P \<one> 1) = 1

goal (1 subgoal):
 1. deg R (monom (UP R) \<one> 1) = 1
[PROOF STEP]
by blast


[STATEMENT]
lemma eval_euler_approx_aux:
  "euler_approx_aux 0 = 1"
  "euler_approx_aux 1 = 2"
  "euler_approx_aux (Suc 0) = 2"
  "euler_approx_aux (numeral n) = 1 + numeral n * euler_approx_aux (pred_numeral n)" (is "?th")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (euler_approx_aux 0 = 1 &&& euler_approx_aux 1 = 2) &&& euler_approx_aux (Suc 0) = 2 &&& euler_approx_aux (numeral n) = 1 + numeral n * euler_approx_aux (pred_numeral n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. euler_approx_aux 0 = 1
 2. euler_approx_aux 1 = 2
 3. euler_approx_aux (Suc 0) = 2
 4. euler_approx_aux (numeral n) = 1 + numeral n * euler_approx_aux (pred_numeral n)
[PROOF STEP]
have A: "euler_approx_aux (Suc m) = 1 + Suc m * euler_approx_aux m" for m :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. euler_approx_aux (Suc m) = 1 + Suc m * euler_approx_aux m
[PROOF STEP]
unfolding euler_approx_aux_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<le>Suc m. \<Prod>{k + 1..Suc m}) = 1 + Suc m * (\<Sum>k\<le>m. \<Prod>{k + 1..m})
[PROOF STEP]
by (subst sum_distrib_left) (simp add: atLeastAtMostSuc_conv mult.commute)
[PROOF STATE]
proof (state)
this:
euler_approx_aux (Suc ?m) = 1 + Suc ?m * euler_approx_aux ?m

goal (4 subgoals):
 1. euler_approx_aux 0 = 1
 2. euler_approx_aux 1 = 2
 3. euler_approx_aux (Suc 0) = 2
 4. euler_approx_aux (numeral n) = 1 + numeral n * euler_approx_aux (pred_numeral n)
[PROOF STEP]
show ?th
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. euler_approx_aux (numeral n) = 1 + numeral n * euler_approx_aux (pred_numeral n)
[PROOF STEP]
by (subst numeral_eq_Suc, subst A, subst numeral_eq_Suc [symmetric]) simp
[PROOF STATE]
proof (state)
this:
euler_approx_aux (numeral n) = 1 + numeral n * euler_approx_aux (pred_numeral n)

goal (3 subgoals):
 1. euler_approx_aux 0 = 1
 2. euler_approx_aux 1 = 2
 3. euler_approx_aux (Suc 0) = 2
[PROOF STEP]
qed (simp_all add: euler_approx_aux_def)