[STATEMENT]
lemma det_transpose: "det (transpose A) = det A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Square_Matrix.det (Square_Matrix.transpose A) = Square_Matrix.det A
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>A. (\<Sum>p | p permutes UNIV. of_int (sign p) * (\<Prod>i\<in>UNIV. A (p i) i)) = (\<Sum>p | p permutes UNIV. of_int (sign p) * (\<Prod>i\<in>UNIV. A i (p i)))
[PROOF STEP]
apply (subst sum_permutations_inverse)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>A. (\<Sum>p | p permutes UNIV. of_int (sign (inv p)) * (\<Prod>i\<in>UNIV. A (inv p i) i)) = (\<Sum>p | p permutes UNIV. of_int (sign p) * (\<Prod>i\<in>UNIV. A i (p i)))
[PROOF STEP]
apply (rule sum.cong[OF refl])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>A x. x \<in> {p. p permutes UNIV} \<Longrightarrow> of_int (sign (inv x)) * (\<Prod>i\<in>UNIV. A (inv x i) i) = of_int (sign x) * (\<Prod>i\<in>UNIV. A i (x i))
[PROOF STEP]
apply (simp add: sign_inverse permutes_UNIV_permutation)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>A x. x permutes UNIV \<Longrightarrow> of_int (sign x) * (\<Prod>i\<in>UNIV. A (inv x i) i) = of_int (sign x) * (\<Prod>i\<in>UNIV. A i (x i))
[PROOF STEP]
apply (subst prod.reindex_bij_betw[symmetric])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>A x. x permutes UNIV \<Longrightarrow> bij_betw (?h36 A x) (?S36 A x) UNIV
 2. \<And>A x. x permutes UNIV \<Longrightarrow> of_int (sign x) * (\<Prod>xa\<in>?S36 A x. A (inv x (?h36 A x xa)) (?h36 A x xa)) = of_int (sign x) * (\<Prod>i\<in>UNIV. A i (x i))
[PROOF STEP]
apply (rule permutes_imp_bij)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>A x. x permutes UNIV \<Longrightarrow> ?h36 A x permutes UNIV
 2. \<And>A x. x permutes UNIV \<Longrightarrow> of_int (sign x) * (\<Prod>xa\<in>UNIV. A (inv x (?h36 A x xa)) (?h36 A x xa)) = of_int (sign x) * (\<Prod>i\<in>UNIV. A i (x i))
[PROOF STEP]
apply assumption
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>A x. x permutes UNIV \<Longrightarrow> of_int (sign x) * (\<Prod>xa\<in>UNIV. A (inv x (x xa)) (x xa)) = of_int (sign x) * (\<Prod>i\<in>UNIV. A i (x i))
[PROOF STEP]
apply (simp add: permutes_inverses)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma permutes_inv_o:
  shows "p \<circ> inv p = id"
    and "inv p \<circ> p = id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<circ> inv p = id &&& inv p \<circ> p = id
[PROOF STEP]
using permutes_inj permutes_surj
[PROOF STATE]
proof (prove)
using this:
inj p
surj p

goal (1 subgoal):
 1. p \<circ> inv p = id &&& inv p \<circ> p = id
[PROOF STEP]
unfolding inj_iff [symmetric] surj_iff [symmetric]
[PROOF STATE]
proof (prove)
using this:
inj p
surj p

goal (1 subgoal):
 1. surj p &&& inj p
[PROOF STEP]
by auto


[STATEMENT]
lemma complex_mod_cnj [simp]: "cmod (cnj z) = cmod z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (cnj z) = cmod z
[PROOF STEP]
by (simp add: norm_complex_def)


[STATEMENT]
lemma agree_on_trans:
  assumes "agree_on X f g" "agree_on X g h"
  shows "agree_on X f h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. agree_on X f h
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
agree_on X f g
agree_on X g h

goal (1 subgoal):
 1. agree_on X f h
[PROOF STEP]
unfolding agree_on_def
[PROOF STATE]
proof (prove)
using this:
\<forall>v\<in>vertices X. f `` {v} = g `` {v}
\<forall>v\<in>vertices X. g `` {v} = h `` {v}

goal (1 subgoal):
 1. \<forall>v\<in>vertices X. f `` {v} = h `` {v}
[PROOF STEP]
by auto


[STATEMENT]
lemma groups_of_size_alt_def_count: "groups_of_size g = count {# card G . G \<in># mset_set \<G> #} g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. groups_of_size g = count (image_mset card (mset_set \<G>)) g
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. groups_of_size g = count (image_mset card (mset_set \<G>)) g
[PROOF STEP]
have a: "groups_of_size g =  card { G \<in> \<G> . card G = g }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. groups_of_size g = card {G \<in> \<G>. card G = g}
[PROOF STEP]
unfolding groups_of_size_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {G \<in> \<G>. card G = g} = card {G \<in> \<G>. card G = g}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
groups_of_size g = card {G \<in> \<G>. card G = g}

goal (1 subgoal):
 1. groups_of_size g = count (image_mset card (mset_set \<G>)) g
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
groups_of_size g = card {G \<in> \<G>. card G = g}
[PROOF STEP]
have "groups_of_size g =  size {# G \<in># (mset_set \<G>) . card G = g #}"
[PROOF STATE]
proof (prove)
using this:
groups_of_size g = card {G \<in> \<G>. card G = g}

goal (1 subgoal):
 1. groups_of_size g = size {#G \<in># mset_set \<G>. card G = g#}
[PROOF STEP]
using groups_finite
[PROOF STATE]
proof (prove)
using this:
groups_of_size g = card {G \<in> \<G>. card G = g}
finite \<G>

goal (1 subgoal):
 1. groups_of_size g = size {#G \<in># mset_set \<G>. card G = g#}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
groups_of_size g = size {#G \<in># mset_set \<G>. card G = g#}

goal (1 subgoal):
 1. groups_of_size g = count (image_mset card (mset_set \<G>)) g
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
groups_of_size g = size {#G \<in># mset_set \<G>. card G = g#}
[PROOF STEP]
have size_repr: "groups_of_size g =  size {# x \<in># {# card G . G \<in># mset_set \<G> #} . x = g #}"
[PROOF STATE]
proof (prove)
using this:
groups_of_size g = size {#G \<in># mset_set \<G>. card G = g#}

goal (1 subgoal):
 1. groups_of_size g = size {#x \<in># image_mset card (mset_set \<G>). x = g#}
[PROOF STEP]
using groups_finite
[PROOF STATE]
proof (prove)
using this:
groups_of_size g = size {#G \<in># mset_set \<G>. card G = g#}
finite \<G>

goal (1 subgoal):
 1. groups_of_size g = size {#x \<in># image_mset card (mset_set \<G>). x = g#}
[PROOF STEP]
by (simp add: filter_mset_image_mset)
[PROOF STATE]
proof (state)
this:
groups_of_size g = size {#x \<in># image_mset card (mset_set \<G>). x = g#}

goal (1 subgoal):
 1. groups_of_size g = count (image_mset card (mset_set \<G>)) g
[PROOF STEP]
have "group_sizes = set_mset ({# card G . G \<in># mset_set \<G> #})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. group_sizes = set_mset (image_mset card (mset_set \<G>))
[PROOF STEP]
using group_sizes_def groups_finite
[PROOF STATE]
proof (prove)
using this:
group_sizes \<equiv> {card G |G. G \<in> \<G>}
finite \<G>

goal (1 subgoal):
 1. group_sizes = set_mset (image_mset card (mset_set \<G>))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
group_sizes = set_mset (image_mset card (mset_set \<G>))

goal (1 subgoal):
 1. groups_of_size g = count (image_mset card (mset_set \<G>)) g
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
group_sizes = set_mset (image_mset card (mset_set \<G>))

goal (1 subgoal):
 1. groups_of_size g = count (image_mset card (mset_set \<G>)) g
[PROOF STEP]
using size_repr
[PROOF STATE]
proof (prove)
using this:
group_sizes = set_mset (image_mset card (mset_set \<G>))
groups_of_size g = size {#x \<in># image_mset card (mset_set \<G>). x = g#}

goal (1 subgoal):
 1. groups_of_size g = count (image_mset card (mset_set \<G>)) g
[PROOF STEP]
by (simp add: count_size_set_repr)
[PROOF STATE]
proof (state)
this:
groups_of_size g = count (image_mset card (mset_set \<G>)) g

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bernoulli_denom_0 [simp]:   "bernoulli_denom 0 = 1"
  and bernoulli_denom_1 [simp]:   "bernoulli_denom 1 = 2"
  and bernoulli_denom_Suc_0 [simp]:   "bernoulli_denom (Suc 0) = 2"
  and bernoulli_denom_odd [simp]: "n \<noteq> 1 \<Longrightarrow> odd n \<Longrightarrow> bernoulli_denom n = 1"
  and bernoulli_denom_even:
    "n > 0 \<Longrightarrow> even n \<Longrightarrow> bernoulli_denom n = \<Prod>{p. prime p \<and> (p - 1) dvd n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (bernoulli_denom 0 = 1 &&& bernoulli_denom 1 = 2) &&& bernoulli_denom (Suc 0) = 2 &&& (\<lbrakk>n \<noteq> 1; odd n\<rbrakk> \<Longrightarrow> bernoulli_denom n = 1) &&& (\<lbrakk>0 < n; even n\<rbrakk> \<Longrightarrow> bernoulli_denom n = \<Prod>{p. prime p \<and> p - 1 dvd n})
[PROOF STEP]
by (auto simp: bernoulli_denom_def)


[STATEMENT]
lemma choose_mono: "n \<le> m \<Longrightarrow> n choose k \<le> m choose k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<le> m \<Longrightarrow> n choose k \<le> m choose k
[PROOF STEP]
unfolding binomial_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<le> m \<Longrightarrow> card {K \<in> Pow {0..<n}. card K = k} \<le> card {K \<in> Pow {0..<m}. card K = k}
[PROOF STEP]
by (rule card_mono, auto)


[STATEMENT]
lemma bind_spmf_of_set:  "\<lbrakk> finite A; A \<noteq> {} \<rbrakk> \<Longrightarrow> bind_spmf (spmf_of_set A) f = bind_pmf (pmf_of_set A) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; A \<noteq> {}\<rbrakk> \<Longrightarrow> spmf_of_set A \<bind> f = pmf_of_set A \<bind> f
[PROOF STEP]
by(simp add: spmf_of_set_def del: spmf_of_pmf_pmf_of_set)


[STATEMENT]
lemma set_incr_disjoint_family:
  assumes "disjoint_family_on B {..k}"
  shows " disjoint_family_on (\<lambda>i. set_incr n (B i)) {..k}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. disjoint_family_on (\<lambda>i. set_incr n (B i)) {..k}
[PROOF STEP]
using assms set_incr_disjnt
[PROOF STATE]
proof (prove)
using this:
disjoint_family_on B {..k}
disjnt ?A ?B \<Longrightarrow> disjnt (set_incr ?n ?A) (set_incr ?n ?B)

goal (1 subgoal):
 1. disjoint_family_on (\<lambda>i. set_incr n (B i)) {..k}
[PROOF STEP]
unfolding disjoint_family_on_def
[PROOF STATE]
proof (prove)
using this:
\<forall>m\<in>{..k}. \<forall>n\<in>{..k}. m \<noteq> n \<longrightarrow> B m \<inter> B n = {}
disjnt ?A ?B \<Longrightarrow> disjnt (set_incr ?n ?A) (set_incr ?n ?B)

goal (1 subgoal):
 1. \<forall>m\<in>{..k}. \<forall>na\<in>{..k}. m \<noteq> na \<longrightarrow> set_incr n (B m) \<inter> set_incr n (B na) = {}
[PROOF STEP]
by (meson disjnt_def)


[STATEMENT]
lemma card_wellformed[intro?, simp]:
    fixes k :: "'a :: wellorder"
    assumes "k \<in> A"
    shows "enat (card {i \<in> A. i < k}) < esize A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enat (card {i \<in> A. i < k}) < esize A
[PROOF STEP]
proof (cases "finite A")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite A \<Longrightarrow> enat (card {i \<in> A. i < k}) < esize A
 2. infinite A \<Longrightarrow> enat (card {i \<in> A. i < k}) < esize A
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
infinite A

goal (2 subgoals):
 1. finite A \<Longrightarrow> enat (card {i \<in> A. i < k}) < esize A
 2. infinite A \<Longrightarrow> enat (card {i \<in> A. i < k}) < esize A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enat (card {i \<in> A. i < k}) < esize A
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
infinite A

goal (1 subgoal):
 1. enat (card {i \<in> A. i < k}) < esize A
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
enat (card {i \<in> A. i < k}) < esize A

goal (1 subgoal):
 1. finite A \<Longrightarrow> enat (card {i \<in> A. i < k}) < esize A
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite A \<Longrightarrow> enat (card {i \<in> A. i < k}) < esize A
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
finite A

goal (1 subgoal):
 1. finite A \<Longrightarrow> enat (card {i \<in> A. i < k}) < esize A
[PROOF STEP]
have 1: "esize {i \<in> A. i < k} < esize A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. esize {i \<in> A. i < k} < esize A
[PROOF STEP]
using True assms
[PROOF STATE]
proof (prove)
using this:
finite A
k \<in> A

goal (1 subgoal):
 1. esize {i \<in> A. i < k} < esize A
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
esize {i \<in> A. i < k} < esize A

goal (1 subgoal):
 1. finite A \<Longrightarrow> enat (card {i \<in> A. i < k}) < esize A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enat (card {i \<in> A. i < k}) < esize A
[PROOF STEP]
using True 1
[PROOF STATE]
proof (prove)
using this:
finite A
esize {i \<in> A. i < k} < esize A

goal (1 subgoal):
 1. enat (card {i \<in> A. i < k}) < esize A
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
enat (card {i \<in> A. i < k}) < esize A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ideal_generated_subset:
  assumes "S \<subseteq> T"
  shows "ideal_generated S \<subseteq> ideal_generated T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ideal_generated S \<subseteq> ideal_generated T
[PROOF STEP]
unfolding ideal_generated_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Inter> {I. ideal I \<and> S \<subseteq> I} \<subseteq> \<Inter> {I. ideal I \<and> T \<subseteq> I}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
S \<subseteq> T

goal (1 subgoal):
 1. \<Inter> {I. ideal I \<and> S \<subseteq> I} \<subseteq> \<Inter> {I. ideal I \<and> T \<subseteq> I}
[PROOF STEP]
by auto


[STATEMENT]
lemma sig_of_spair_commute: "sig_of_pair (Inl (p, q)) = sig_of_pair (Inl (q, p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sig_of_pair (Inl (p, q)) = sig_of_pair (Inl (q, p))
[PROOF STEP]
by (simp add: spair_sigs_def Let_def lcs_comm ord_term_lin.max.commute)


[STATEMENT]
lemma diff_of_aezfun_is_aezfun :
  fixes     f g :: "'a\<Rightarrow>'b::group_add"
  shows     "f \<in> aezfun_set \<Longrightarrow> g \<in> aezfun_set \<Longrightarrow> f - g \<in> aezfun_set"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> aezfun_set; g \<in> aezfun_set\<rbrakk> \<Longrightarrow> f - g \<in> aezfun_set
[PROOF STEP]
using     supp_diff_subset_union_supp[of f g] finite_subset[of _ "supp f \<union> supp g"]
[PROOF STATE]
proof (prove)
using this:
supp (f - g) \<subseteq> supp f \<union> supp g
\<lbrakk>?A \<subseteq> supp f \<union> supp g; finite (supp f \<union> supp g)\<rbrakk> \<Longrightarrow> finite ?A

goal (1 subgoal):
 1. \<lbrakk>f \<in> aezfun_set; g \<in> aezfun_set\<rbrakk> \<Longrightarrow> f - g \<in> aezfun_set
[PROOF STEP]
unfolding aezfun_set_def
[PROOF STATE]
proof (prove)
using this:
supp (f - g) \<subseteq> supp f \<union> supp g
\<lbrakk>?A \<subseteq> supp f \<union> supp g; finite (supp f \<union> supp g)\<rbrakk> \<Longrightarrow> finite ?A

goal (1 subgoal):
 1. \<lbrakk>f \<in> {f. finite (supp f)}; g \<in> {f. finite (supp f)}\<rbrakk> \<Longrightarrow> f - g \<in> {f. finite (supp f)}
[PROOF STEP]
by        fastforce


[STATEMENT]
lemma algebraic_int_csqrt_iff [simp]: "algebraic_int (csqrt x) \<longleftrightarrow> algebraic_int x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. algebraic_int (csqrt x) = algebraic_int x
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. algebraic_int (csqrt x) \<Longrightarrow> algebraic_int x
 2. algebraic_int x \<Longrightarrow> algebraic_int (csqrt x)
[PROOF STEP]
assume "algebraic_int (csqrt x)"
[PROOF STATE]
proof (state)
this:
algebraic_int (csqrt x)

goal (2 subgoals):
 1. algebraic_int (csqrt x) \<Longrightarrow> algebraic_int x
 2. algebraic_int x \<Longrightarrow> algebraic_int (csqrt x)
[PROOF STEP]
hence "algebraic_int (csqrt x ^ 2)"
[PROOF STATE]
proof (prove)
using this:
algebraic_int (csqrt x)

goal (1 subgoal):
 1. algebraic_int ((csqrt x)\<^sup>2)
[PROOF STEP]
by (rule algebraic_int_power)
[PROOF STATE]
proof (state)
this:
algebraic_int ((csqrt x)\<^sup>2)

goal (2 subgoals):
 1. algebraic_int (csqrt x) \<Longrightarrow> algebraic_int x
 2. algebraic_int x \<Longrightarrow> algebraic_int (csqrt x)
[PROOF STEP]
thus "algebraic_int x"
[PROOF STATE]
proof (prove)
using this:
algebraic_int ((csqrt x)\<^sup>2)

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

goal (1 subgoal):
 1. algebraic_int x \<Longrightarrow> algebraic_int (csqrt x)
[PROOF STEP]
qed auto


[STATEMENT]
lemma segment_convex_hull:
  "closed_segment a b = convex hull {a,b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed_segment a b = convex hull {a, b}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. closed_segment a b = convex hull {a, b}
[PROOF STEP]
have *: "\<And>x. {x} \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. {x} \<noteq> {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{?x} \<noteq> {}

goal (1 subgoal):
 1. closed_segment a b = convex hull {a, b}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed_segment a b = convex hull {a, b}
[PROOF STEP]
unfolding segment convex_hull_insert[OF *] convex_hull_singleton
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(1 - u) *\<^sub>R a + u *\<^sub>R b |u. 0 \<le> u \<and> u \<le> 1} = {x. \<exists>u\<ge>0. \<exists>v\<ge>0. \<exists>ba. u + v = 1 \<and> ba \<in> {b} \<and> x = u *\<^sub>R a + v *\<^sub>R ba}
[PROOF STEP]
by (safe; rule_tac x="1 - u" in exI; force)
[PROOF STATE]
proof (state)
this:
closed_segment a b = convex hull {a, b}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma has_vector_derivative_cnj [derivative_intros]:
  assumes "(f has_vector_derivative f') (at z within A)"
  shows   "((\<lambda>z. cnj (f z)) has_vector_derivative cnj f') (at z within A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>z. cnj (f z)) has_vector_derivative cnj f') (at z within A)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(f has_vector_derivative f') (at z within A)

goal (1 subgoal):
 1. ((\<lambda>z. cnj (f z)) has_vector_derivative cnj f') (at z within A)
[PROOF STEP]
by (auto simp: has_vector_derivative_complex_iff intro: derivative_intros)


[STATEMENT]
lemma compact_differences':
  fixes S :: "'a::real_normed_vector set"
  assumes "compact S" and "compact T"
  shows "compact (\<Union>x\<in> S. \<Union>y \<in> T. {x - y})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compact (\<Union>x\<in>S. \<Union>y\<in>T. {x - y})
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. compact (\<Union>x\<in>S. \<Union>y\<in>T. {x - y})
[PROOF STEP]
have "(\<Union>x\<in>S. \<Union>y\<in>T. {x - y}) = {x - y |x y. x \<in> S \<and> y \<in> T}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>x\<in>S. \<Union>y\<in>T. {x - y}) = {x - y |x y. x \<in> S \<and> y \<in> T}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<Union>x\<in>S. \<Union>y\<in>T. {x - y}) = {x - y |x y. x \<in> S \<and> y \<in> T}

goal (1 subgoal):
 1. compact (\<Union>x\<in>S. \<Union>y\<in>T. {x - y})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Union>x\<in>S. \<Union>y\<in>T. {x - y}) = {x - y |x y. x \<in> S \<and> y \<in> T}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Union>x\<in>S. \<Union>y\<in>T. {x - y}) = {x - y |x y. x \<in> S \<and> y \<in> T}

goal (1 subgoal):
 1. compact (\<Union>x\<in>S. \<Union>y\<in>T. {x - y})
[PROOF STEP]
using compact_differences [OF assms]
[PROOF STATE]
proof (prove)
using this:
(\<Union>x\<in>S. \<Union>y\<in>T. {x - y}) = {x - y |x y. x \<in> S \<and> y \<in> T}
compact {x - y |x y. x \<in> S \<and> y \<in> T}

goal (1 subgoal):
 1. compact (\<Union>x\<in>S. \<Union>y\<in>T. {x - y})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
compact (\<Union>x\<in>S. \<Union>y\<in>T. {x - y})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma qtmset_append_union[simp]: "queue_to_multiset (q @ q') =
  queue_to_multiset q + queue_to_multiset q'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. queue_to_multiset (q @ q') = queue_to_multiset q + queue_to_multiset q'
[PROOF STEP]
apply(induct q)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. queue_to_multiset ([] @ q') = queue_to_multiset [] + queue_to_multiset q'
 2. \<And>a q. queue_to_multiset (q @ q') = queue_to_multiset q + queue_to_multiset q' \<Longrightarrow> queue_to_multiset ((a # q) @ q') = queue_to_multiset (a # q) + queue_to_multiset q'
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a q. queue_to_multiset (q @ q') = queue_to_multiset q + queue_to_multiset q' \<Longrightarrow> queue_to_multiset ((a # q) @ q') = queue_to_multiset (a # q) + queue_to_multiset q'
[PROOF STEP]
apply(simp add: union_ac)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma nn_integral_disjoint_pair_countspace:
  assumes "B \<inter> C = {}"
  shows "(\<integral>\<^sup>+x \<in> B \<union> C. f x \<partial>count_space UNIV) = (\<integral>\<^sup>+x \<in> B. f x \<partial>count_space UNIV) + (\<integral>\<^sup>+x \<in> C. f x \<partial>count_space UNIV)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_nn_integral (count_space UNIV) (B \<union> C) f = set_nn_integral (count_space UNIV) B f + set_nn_integral (count_space UNIV) C f
[PROOF STEP]
by (rule nn_integral_disjoint_pair) (simp_all add: assms)


[STATEMENT]
lemma nodes_root_height_upper_bound_simp:
  assumes "root_order k t"
    and "bal t"
  shows "nodes t \<le> ((2*k+1)^(height t) - 1) div (2*k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nodes t \<le> bound (2 * k) (height t) div (2 * k)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. nodes t \<le> bound (2 * k) (height t) div (2 * k)
[PROOF STEP]
have "nodes t = (nodes t * (2*k)) div (2*k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nodes t = nodes t * (2 * k) div (2 * k)
[PROOF STEP]
using root_order_imp_divmuleq[OF assms(1)]
[PROOF STATE]
proof (prove)
using this:
nodes t * k div k = nodes t

goal (1 subgoal):
 1. nodes t = nodes t * (2 * k) div (2 * k)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
nodes t = nodes t * (2 * k) div (2 * k)

goal (1 subgoal):
 1. nodes t \<le> bound (2 * k) (height t) div (2 * k)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
nodes t = nodes t * (2 * k) div (2 * k)

goal (1 subgoal):
 1. nodes t \<le> bound (2 * k) (height t) div (2 * k)
[PROOF STEP]
have "\<dots> \<le> ((2*k+1)^(height t) - 1) div (2*k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nodes t * (2 * k) div (2 * k) \<le> bound (2 * k) (height t) div (2 * k)
[PROOF STEP]
using div_le_mono nodes_root_height_upper_bound[OF assms]
[PROOF STATE]
proof (prove)
using this:
?m \<le> ?n \<Longrightarrow> ?m div ?k \<le> ?n div ?k
nodes t * (2 * k) \<le> bound (2 * k) (height t)

goal (1 subgoal):
 1. nodes t * (2 * k) div (2 * k) \<le> bound (2 * k) (height t) div (2 * k)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
nodes t * (2 * k) div (2 * k) \<le> bound (2 * k) (height t) div (2 * k)

goal (1 subgoal):
 1. nodes t \<le> bound (2 * k) (height t) div (2 * k)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
nodes t \<le> bound (2 * k) (height t) div (2 * k)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
nodes t \<le> bound (2 * k) (height t) div (2 * k)

goal (1 subgoal):
 1. nodes t \<le> bound (2 * k) (height t) div (2 * k)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
nodes t \<le> bound (2 * k) (height t) div (2 * k)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma convex_imp_locally_connected:
  fixes S :: "'a:: real_normed_vector set"
  shows "convex S \<Longrightarrow> locally connected S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex S \<Longrightarrow> locally connected S
[PROOF STEP]
by (simp add: locally_path_connected_imp_locally_connected convex_imp_locally_path_connected)


[STATEMENT]
lemma aff_dim_zero:
  fixes S :: "'n::euclidean_space set"
  assumes "0 \<in> affine hull S"
  shows "aff_dim S = int (dim S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aff_dim S = int (dim S)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. aff_dim S = int (dim S)
[PROOF STEP]
have "subspace (affine hull S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subspace (affine hull S)
[PROOF STEP]
using subspace_affine[of "affine hull S"] affine_affine_hull assms
[PROOF STATE]
proof (prove)
using this:
subspace (affine hull S) = (affine (affine hull S) \<and> (0::'n) \<in> affine hull S)
affine (affine hull ?s)
(0::'n) \<in> affine hull S

goal (1 subgoal):
 1. subspace (affine hull S)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
subspace (affine hull S)

goal (1 subgoal):
 1. aff_dim S = int (dim S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
subspace (affine hull S)
[PROOF STEP]
have "aff_dim (affine hull S) = int (dim (affine hull S))"
[PROOF STATE]
proof (prove)
using this:
subspace (affine hull S)

goal (1 subgoal):
 1. aff_dim (affine hull S) = int (dim (affine hull S))
[PROOF STEP]
using assms aff_dim_subspace[of "affine hull S"]
[PROOF STATE]
proof (prove)
using this:
subspace (affine hull S)
(0::'n) \<in> affine hull S
subspace (affine hull S) \<Longrightarrow> aff_dim (affine hull S) = int (dim (affine hull S))

goal (1 subgoal):
 1. aff_dim (affine hull S) = int (dim (affine hull S))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
aff_dim (affine hull S) = int (dim (affine hull S))

goal (1 subgoal):
 1. aff_dim S = int (dim S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
aff_dim (affine hull S) = int (dim (affine hull S))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
aff_dim (affine hull S) = int (dim (affine hull S))

goal (1 subgoal):
 1. aff_dim S = int (dim S)
[PROOF STEP]
using aff_dim_affine_hull[of S] dim_affine_hull[of S]
[PROOF STATE]
proof (prove)
using this:
aff_dim (affine hull S) = int (dim (affine hull S))
aff_dim (affine hull S) = aff_dim S
dim (affine hull S) = dim S

goal (1 subgoal):
 1. aff_dim S = int (dim S)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
aff_dim S = int (dim S)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma binomial_le_pow2: "n choose k \<le> 2^n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n choose k \<le> 2 ^ n
[PROOF STEP]
proof (induction n arbitrary: k)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>k. 0 choose k \<le> 2 ^ 0
 2. \<And>n k. (\<And>k. n choose k \<le> 2 ^ n) \<Longrightarrow> Suc n choose k \<le> 2 ^ Suc n
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>k. 0 choose k \<le> 2 ^ 0
 2. \<And>n k. (\<And>k. n choose k \<le> 2 ^ n) \<Longrightarrow> Suc n choose k \<le> 2 ^ Suc n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 choose k \<le> 2 ^ 0
[PROOF STEP]
using le_less less_le_trans
[PROOF STATE]
proof (prove)
using this:
(?x \<le> ?y) = (?x < ?y \<or> ?x = ?y)
\<lbrakk>?x < ?y; ?y \<le> ?z\<rbrakk> \<Longrightarrow> ?x < ?z

goal (1 subgoal):
 1. 0 choose k \<le> 2 ^ 0
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
0 choose k \<le> 2 ^ 0

goal (1 subgoal):
 1. \<And>n k. (\<And>k. n choose k \<le> 2 ^ n) \<Longrightarrow> Suc n choose k \<le> 2 ^ Suc n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n k. (\<And>k. n choose k \<le> 2 ^ n) \<Longrightarrow> Suc n choose k \<le> 2 ^ Suc n
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
n choose ?k \<le> 2 ^ n

goal (1 subgoal):
 1. \<And>n k. (\<And>k. n choose k \<le> 2 ^ n) \<Longrightarrow> Suc n choose k \<le> 2 ^ Suc n
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc n choose k \<le> 2 ^ Suc n
[PROOF STEP]
proof (cases k)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. k = 0 \<Longrightarrow> Suc n choose k \<le> 2 ^ Suc n
 2. \<And>nat. k = Suc nat \<Longrightarrow> Suc n choose k \<le> 2 ^ Suc n
[PROOF STEP]
case (Suc k')
[PROOF STATE]
proof (state)
this:
k = Suc k'

goal (2 subgoals):
 1. k = 0 \<Longrightarrow> Suc n choose k \<le> 2 ^ Suc n
 2. \<And>nat. k = Suc nat \<Longrightarrow> Suc n choose k \<le> 2 ^ Suc n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
k = Suc k'
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
k = Suc k'

goal (1 subgoal):
 1. Suc n choose k \<le> 2 ^ Suc n
[PROOF STEP]
using Suc.IH
[PROOF STATE]
proof (prove)
using this:
k = Suc k'
n choose ?k \<le> 2 ^ n

goal (1 subgoal):
 1. Suc n choose k \<le> 2 ^ Suc n
[PROOF STEP]
by (simp add: add_le_mono mult_2)
[PROOF STATE]
proof (state)
this:
Suc n choose k \<le> 2 ^ Suc n

goal (1 subgoal):
 1. k = 0 \<Longrightarrow> Suc n choose k \<le> 2 ^ Suc n
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
Suc n choose k \<le> 2 ^ Suc n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma oppositeUniqueness [simp]:
  fixes literal1::Literal and literal2::Literal
  shows "(opposite literal1 = opposite literal2) = (literal1 = literal2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (opposite literal1 = opposite literal2) = (literal1 = literal2)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. opposite literal1 = opposite literal2 \<Longrightarrow> literal1 = literal2
 2. literal1 = literal2 \<Longrightarrow> opposite literal1 = opposite literal2
[PROOF STEP]
assume "opposite literal1 = opposite literal2"
[PROOF STATE]
proof (state)
this:
opposite literal1 = opposite literal2

goal (2 subgoals):
 1. opposite literal1 = opposite literal2 \<Longrightarrow> literal1 = literal2
 2. literal1 = literal2 \<Longrightarrow> opposite literal1 = opposite literal2
[PROOF STEP]
hence "opposite (opposite literal1) = opposite (opposite literal2)"
[PROOF STATE]
proof (prove)
using this:
opposite literal1 = opposite literal2

goal (1 subgoal):
 1. opposite (opposite literal1) = opposite (opposite literal2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
opposite (opposite literal1) = opposite (opposite literal2)

goal (2 subgoals):
 1. opposite literal1 = opposite literal2 \<Longrightarrow> literal1 = literal2
 2. literal1 = literal2 \<Longrightarrow> opposite literal1 = opposite literal2
[PROOF STEP]
thus "literal1 = literal2"
[PROOF STATE]
proof (prove)
using this:
opposite (opposite literal1) = opposite (opposite literal2)

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

goal (1 subgoal):
 1. literal1 = literal2 \<Longrightarrow> opposite literal1 = opposite literal2
[PROOF STEP]
qed simp


[STATEMENT]
lemma ln_Gamma_real_strict_mono:
  assumes "x \<ge> 3/2" "x < y"
  shows   "ln_Gamma (x :: real) < ln_Gamma y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ln_Gamma x < ln_Gamma y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ln_Gamma x < ln_Gamma y
[PROOF STEP]
have "\<exists>\<xi>. x < \<xi> \<and> \<xi> < y \<and> ln_Gamma y - ln_Gamma x = (y - x) * Digamma \<xi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>\<xi>>x. \<xi> < y \<and> ln_Gamma y - ln_Gamma x = (y - x) * Digamma \<xi>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
3 / 2 \<le> x
x < y

goal (1 subgoal):
 1. \<exists>\<xi>>x. \<xi> < y \<and> ln_Gamma y - ln_Gamma x = (y - x) * Digamma \<xi>
[PROOF STEP]
by (intro MVT2 derivative_intros impI allI) (auto elim!: nonpos_Ints_cases)
[PROOF STATE]
proof (state)
this:
\<exists>\<xi>>x. \<xi> < y \<and> ln_Gamma y - ln_Gamma x = (y - x) * Digamma \<xi>

goal (1 subgoal):
 1. ln_Gamma x < ln_Gamma y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>\<xi>>x. \<xi> < y \<and> ln_Gamma y - ln_Gamma x = (y - x) * Digamma \<xi>
[PROOF STEP]
obtain \<xi> where \<xi>: "x < \<xi>" "\<xi> < y"
    and ln_Gamma: "ln_Gamma y - ln_Gamma x = (y - x) * Digamma \<xi>"
[PROOF STATE]
proof (prove)
using this:
\<exists>\<xi>>x. \<xi> < y \<and> ln_Gamma y - ln_Gamma x = (y - x) * Digamma \<xi>

goal (1 subgoal):
 1. (\<And>\<xi>. \<lbrakk>x < \<xi>; \<xi> < y; ln_Gamma y - ln_Gamma x = (y - x) * Digamma \<xi>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x < \<xi>
\<xi> < y
ln_Gamma y - ln_Gamma x = (y - x) * Digamma \<xi>

goal (1 subgoal):
 1. ln_Gamma x < ln_Gamma y
[PROOF STEP]
note ln_Gamma
[PROOF STATE]
proof (state)
this:
ln_Gamma y - ln_Gamma x = (y - x) * Digamma \<xi>

goal (1 subgoal):
 1. ln_Gamma x < ln_Gamma y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ln_Gamma y - ln_Gamma x = (y - x) * Digamma \<xi>

goal (1 subgoal):
 1. ln_Gamma x < ln_Gamma y
[PROOF STEP]
from \<xi> assms
[PROOF STATE]
proof (chain)
picking this:
x < \<xi>
\<xi> < y
3 / 2 \<le> x
x < y
[PROOF STEP]
have "(y - x) * Digamma \<xi> > 0"
[PROOF STATE]
proof (prove)
using this:
x < \<xi>
\<xi> < y
3 / 2 \<le> x
x < y

goal (1 subgoal):
 1. 0 < (y - x) * Digamma \<xi>
[PROOF STEP]
by (intro mult_pos_pos Digamma_real_ge_three_halves_pos) simp_all
[PROOF STATE]
proof (state)
this:
0 < (y - x) * Digamma \<xi>

goal (1 subgoal):
 1. ln_Gamma x < ln_Gamma y
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
0 < ln_Gamma y - ln_Gamma x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < ln_Gamma y - ln_Gamma x

goal (1 subgoal):
 1. ln_Gamma x < ln_Gamma y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ln_Gamma x < ln_Gamma y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nths_map:
"nths (map f xs) A = map f (nths xs A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nths (map f xs) A = map f (nths xs A)
[PROOF STEP]
proof (induction xs arbitrary:A)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>A. nths (map f []) A = map f (nths [] A)
 2. \<And>a xs A. (\<And>A. nths (map f xs) A = map f (nths xs A)) \<Longrightarrow> nths (map f (a # xs)) A = map f (nths (a # xs) A)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>A. nths (map f []) A = map f (nths [] A)
 2. \<And>a xs A. (\<And>A. nths (map f xs) A = map f (nths xs A)) \<Longrightarrow> nths (map f (a # xs)) A = map f (nths (a # xs) A)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nths (map f []) A = map f (nths [] A)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
nths (map f []) A = map f (nths [] A)

goal (1 subgoal):
 1. \<And>a xs A. (\<And>A. nths (map f xs) A = map f (nths xs A)) \<Longrightarrow> nths (map f (a # xs)) A = map f (nths (a # xs) A)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a xs A. (\<And>A. nths (map f xs) A = map f (nths xs A)) \<Longrightarrow> nths (map f (a # xs)) A = map f (nths (a # xs) A)
[PROOF STEP]
case (Cons x xs)
[PROOF STATE]
proof (state)
this:
nths (map f xs) ?A = map f (nths xs ?A)

goal (1 subgoal):
 1. \<And>a xs A. (\<And>A. nths (map f xs) A = map f (nths xs A)) \<Longrightarrow> nths (map f (a # xs)) A = map f (nths (a # xs) A)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
nths (map f xs) ?A = map f (nths xs ?A)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
nths (map f xs) ?A = map f (nths xs ?A)

goal (1 subgoal):
 1. nths (map f (x # xs)) A = map f (nths (x # xs) A)
[PROOF STEP]
by (simp add: nths_Cons)
[PROOF STATE]
proof (state)
this:
nths (map f (x # xs)) A = map f (nths (x # xs) A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma split_block_diag_carrier:
  assumes "D \<in> carrier_mat n n"
  and "a \<le> n"
  and "split_block D a a = (D1, D2, D3, D4)"
shows "D1\<in> carrier_mat a a" "D4\<in> carrier_mat (n-a) (n-a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. D1 \<in> carrier_mat a a &&& D4 \<in> carrier_mat (n - a) (n - a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. D1 \<in> carrier_mat a a
 2. D4 \<in> carrier_mat (n - a) (n - a)
[PROOF STEP]
show "D1\<in> carrier_mat a a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. D1 \<in> carrier_mat a a
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
D \<in> carrier_mat n n
a \<le> n
split_block D a a = (D1, D2, D3, D4)

goal (1 subgoal):
 1. D1 \<in> carrier_mat a a
[PROOF STEP]
unfolding split_block_def
[PROOF STATE]
proof (prove)
using this:
D \<in> carrier_mat n n
a \<le> n
(let nr = dim_row D; nc = dim_col D; nr2 = nr - a; nc2 = nc - a; A1 = Matrix.mat a a (($$) D); A2 = Matrix.mat a nc2 (\<lambda>(i, j). D $$ (i, j + a)); A3 = Matrix.mat nr2 a (\<lambda>(i, j). D $$ (i + a, j)); A4 = Matrix.mat nr2 nc2 (\<lambda>(i, j). D $$ (i + a, j + a)) in (A1, A2, A3, A4)) = (D1, D2, D3, D4)

goal (1 subgoal):
 1. D1 \<in> carrier_mat a a
[PROOF STEP]
by (metis Pair_inject mat_carrier)
[PROOF STATE]
proof (state)
this:
D1 \<in> carrier_mat a a

goal (1 subgoal):
 1. D4 \<in> carrier_mat (n - a) (n - a)
[PROOF STEP]
show "D4 \<in> carrier_mat (n-a) (n-a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. D4 \<in> carrier_mat (n - a) (n - a)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
D \<in> carrier_mat n n
a \<le> n
split_block D a a = (D1, D2, D3, D4)

goal (1 subgoal):
 1. D4 \<in> carrier_mat (n - a) (n - a)
[PROOF STEP]
unfolding split_block_def
[PROOF STATE]
proof (prove)
using this:
D \<in> carrier_mat n n
a \<le> n
(let nr = dim_row D; nc = dim_col D; nr2 = nr - a; nc2 = nc - a; A1 = Matrix.mat a a (($$) D); A2 = Matrix.mat a nc2 (\<lambda>(i, j). D $$ (i, j + a)); A3 = Matrix.mat nr2 a (\<lambda>(i, j). D $$ (i + a, j)); A4 = Matrix.mat nr2 nc2 (\<lambda>(i, j). D $$ (i + a, j + a)) in (A1, A2, A3, A4)) = (D1, D2, D3, D4)

goal (1 subgoal):
 1. D4 \<in> carrier_mat (n - a) (n - a)
[PROOF STEP]
by (metis Pair_inject carrier_matD(1) carrier_matD(2) mat_carrier)
[PROOF STATE]
proof (state)
this:
D4 \<in> carrier_mat (n - a) (n - a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma SA_one_not_zero:
  shows "\<one>\<^bsub>SA n\<^esub> \<noteq> \<zero>\<^bsub> SA n\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<one>\<^bsub>SA n\<^esub> \<noteq> \<zero>\<^bsub>SA n\<^esub>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<one>\<^bsub>SA n\<^esub> \<noteq> \<zero>\<^bsub>SA n\<^esub>
[PROOF STEP]
obtain a where a_def: "a \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a. a \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using Qp_n_nonempty
[PROOF STATE]
proof (prove)
using this:
carrier (Q\<^sub>p\<^bsup>?n\<^esup>) \<noteq> {}

goal (1 subgoal):
 1. (\<And>a. a \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
a \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)

goal (1 subgoal):
 1. \<one>\<^bsub>SA n\<^esub> \<noteq> \<zero>\<^bsub>SA n\<^esub>
[PROOF STEP]
have "\<one>\<^bsub>SA n\<^esub> a  \<noteq> \<zero>\<^bsub> SA n\<^esub> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<one>\<^bsub>SA n\<^esub> a \<noteq> \<zero>\<^bsub>SA n\<^esub> a
[PROOF STEP]
using function_one_eval function_zero_eval SA_one SA_zero a_def local.one_neq_zero
[PROOF STATE]
proof (prove)
using this:
?a \<in> carrier (Q\<^sub>p\<^bsup>?n\<^esup>) \<Longrightarrow> \<one>\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>?n\<^esup>)) Q\<^sub>p\<^esub> ?a = \<one>
?a \<in> carrier (Q\<^sub>p\<^bsup>?n\<^esup>) \<Longrightarrow> \<zero>\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>?n\<^esup>)) Q\<^sub>p\<^esub> ?a = \<zero>
\<one>\<^bsub>SA ?n\<^esub> = \<one>\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>?n\<^esup>)) Q\<^sub>p\<^esub>
\<zero>\<^bsub>SA ?n\<^esub> = \<zero>\<^bsub>function_ring (carrier (Q\<^sub>p\<^bsup>?n\<^esup>)) Q\<^sub>p\<^esub>
a \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)
\<one> \<noteq> \<zero>

goal (1 subgoal):
 1. \<one>\<^bsub>SA n\<^esub> a \<noteq> \<zero>\<^bsub>SA n\<^esub> a
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
\<one>\<^bsub>SA n\<^esub> a \<noteq> \<zero>\<^bsub>SA n\<^esub> a

goal (1 subgoal):
 1. \<one>\<^bsub>SA n\<^esub> \<noteq> \<zero>\<^bsub>SA n\<^esub>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<one>\<^bsub>SA n\<^esub> a \<noteq> \<zero>\<^bsub>SA n\<^esub> a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<one>\<^bsub>SA n\<^esub> a \<noteq> \<zero>\<^bsub>SA n\<^esub> a

goal (1 subgoal):
 1. \<one>\<^bsub>SA n\<^esub> \<noteq> \<zero>\<^bsub>SA n\<^esub>
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<one>\<^bsub>SA n\<^esub> \<noteq> \<zero>\<^bsub>SA n\<^esub>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma potential:
fixes t :: "nat \<Rightarrow> 'a::linordered_ab_group_add" and p :: "nat \<Rightarrow> 'a"
assumes p0: "p 0 = 0" and ppos: "\<And>n. p n \<ge> 0"
and ub: "\<And>n. t n + p(n+1) - p n \<le> u n"
shows "(\<Sum>i<n. t i) \<le> (\<Sum>i<n. u i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum t {..<n} \<le> sum u {..<n}
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum t {..<n} \<le> sum u {..<n}
[PROOF STEP]
let ?a = "\<lambda>n. t n + p(n+1) - p n"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum t {..<n} \<le> sum u {..<n}
[PROOF STEP]
have 1: "(\<Sum>i<n. t i) = (\<Sum>i<n. ?a i) - p(n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum t {..<n} = (\<Sum>i<n. t i + p (i + 1) - p i) - p n
[PROOF STEP]
by(induction n) (simp_all add: p0)
[PROOF STATE]
proof (state)
this:
sum t {..<n} = (\<Sum>i<n. t i + p (i + 1) - p i) - p n

goal (1 subgoal):
 1. sum t {..<n} \<le> sum u {..<n}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
sum t {..<n} = (\<Sum>i<n. t i + p (i + 1) - p i) - p n

goal (1 subgoal):
 1. sum t {..<n} \<le> sum u {..<n}
[PROOF STEP]
by (metis (erased, lifting) add.commute diff_add_cancel le_add_same_cancel2 order.trans ppos sum_mono ub)
[PROOF STATE]
proof (state)
this:
sum t {..<n} \<le> sum u {..<n}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nat_diff_mod_right:
  fixes a b c :: nat
  assumes "b < a"
  shows "(a - b) mod c = (a - b mod c) mod c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a - b) mod c = (a - b mod c) mod c
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (a - b) mod c = (a - b mod c) mod c
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
b < a
[PROOF STEP]
have b_mod: "b mod c \<le> a"
[PROOF STATE]
proof (prove)
using this:
b < a

goal (1 subgoal):
 1. b mod c \<le> a
[PROOF STEP]
by (metis mod_less_eq_dividend linear not_le order_trans)
[PROOF STATE]
proof (state)
this:
b mod c \<le> a

goal (1 subgoal):
 1. (a - b) mod c = (a - b mod c) mod c
[PROOF STEP]
have "int ((a - b) mod c) = (int a - int b mod int c) mod int c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int ((a - b) mod c) = (int a - int b mod int c) mod int c
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
b < a

goal (1 subgoal):
 1. int ((a - b) mod c) = (int a - int b mod int c) mod int c
[PROOF STEP]
by (simp add: zmod_int of_nat_diff mod_simps)
[PROOF STATE]
proof (state)
this:
int ((a - b) mod c) = (int a - int b mod int c) mod int c

goal (1 subgoal):
 1. (a - b) mod c = (a - b mod c) mod c
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
int ((a - b) mod c) = (int a - int b mod int c) mod int c

goal (1 subgoal):
 1. (a - b) mod c = (a - b mod c) mod c
[PROOF STEP]
have "\<dots> = int ((a - b mod c) mod c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (int a - int b mod int c) mod int c = int ((a - b mod c) mod c)
[PROOF STEP]
using assms b_mod
[PROOF STATE]
proof (prove)
using this:
b < a
b mod c \<le> a

goal (1 subgoal):
 1. (int a - int b mod int c) mod int c = int ((a - b mod c) mod c)
[PROOF STEP]
by (simp add: zmod_int [symmetric] of_nat_diff [symmetric])
[PROOF STATE]
proof (state)
this:
(int a - int b mod int c) mod int c = int ((a - b mod c) mod c)

goal (1 subgoal):
 1. (a - b) mod c = (a - b mod c) mod c
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
int ((a - b) mod c) = int ((a - b mod c) mod c)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
int ((a - b) mod c) = int ((a - b mod c) mod c)

goal (1 subgoal):
 1. (a - b) mod c = (a - b mod c) mod c
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(a - b) mod c = (a - b mod c) mod c

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma irreducible_pos_gcd:
  fixes p :: "int poly"
  assumes ir: "irreducible p" and pos: "lead_coeff p > 0" shows "gcd p q \<in> {1,p}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd p q \<in> {1, p}
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. gcd p q \<in> {1, p}
[PROOF STEP]
from pos
[PROOF STATE]
proof (chain)
picking this:
0 < lead_coeff p
[PROOF STEP]
have "[:sgn (lead_coeff p):] = 1"
[PROOF STATE]
proof (prove)
using this:
0 < lead_coeff p

goal (1 subgoal):
 1. [:sgn (lead_coeff p):] = 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
[:sgn (lead_coeff p):] = 1

goal (1 subgoal):
 1. gcd p q \<in> {1, p}
[PROOF STEP]
with prime_elem_imp_gcd_eq[of p, unfolded prime_elem_iff_irreducible, OF ir, of q]
[PROOF STATE]
proof (chain)
picking this:
gcd p q = normalize p \<or> gcd p q = 1
[:sgn (lead_coeff p):] = 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
gcd p q = normalize p \<or> gcd p q = 1
[:sgn (lead_coeff p):] = 1

goal (1 subgoal):
 1. gcd p q \<in> {1, p}
[PROOF STEP]
by (auto simp: normalize_poly_def)
[PROOF STATE]
proof (state)
this:
gcd p q \<in> {1, p}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma convex_le_Inf_differential:
  fixes f :: "real \<Rightarrow> real"
  assumes "convex_on I f"
    and "x \<in> interior I"
    and "y \<in> I"
  shows "f y \<ge> f x + Inf ((\<lambda>t. (f x - f t) / (x - t)) ` ({x<..} \<inter> I)) * (y - x)"
  (is "_ \<ge> _ + Inf (?F x) * (y - x)")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
[PROOF STEP]
proof (cases rule: linorder_cases)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. ?x < ?y \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
 2. ?x = ?y \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
 3. ?y < ?x \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
[PROOF STEP]
assume "x < y"
[PROOF STATE]
proof (state)
this:
x < y

goal (3 subgoals):
 1. ?x < ?y \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
 2. ?x = ?y \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
 3. ?y < ?x \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
x < y

goal (3 subgoals):
 1. ?x < ?y \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
 2. ?x = ?y \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
 3. ?y < ?x \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
[PROOF STEP]
have "open (interior I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open (interior I)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
open (interior I)

goal (3 subgoals):
 1. ?x < ?y \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
 2. ?x = ?y \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
 3. ?y < ?x \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
[PROOF STEP]
from openE[OF this \<open>x \<in> interior I\<close>]
[PROOF STATE]
proof (chain)
picking this:
(\<And>e. \<lbrakk>0 < e; ball x e \<subseteq> interior I\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis
[PROOF STEP]
obtain e where e: "0 < e" "ball x e \<subseteq> interior I"
[PROOF STATE]
proof (prove)
using this:
(\<And>e. \<lbrakk>0 < e; ball x e \<subseteq> interior I\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; ball x e \<subseteq> interior I\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
0 < e
ball x e \<subseteq> interior I

goal (3 subgoals):
 1. ?x < ?y \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
 2. ?x = ?y \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
 3. ?y < ?x \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 < e
ball x e \<subseteq> interior I

goal (3 subgoals):
 1. ?x < ?y \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
 2. ?x = ?y \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
 3. ?y < ?x \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
[PROOF STEP]
define t where "t = min (x + e / 2) ((x + y) / 2)"
[PROOF STATE]
proof (state)
this:
t = min (x + e / 2) ((x + y) / 2)

goal (3 subgoals):
 1. ?x < ?y \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
 2. ?x = ?y \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
 3. ?y < ?x \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
x < y
0 < e
ball x e \<subseteq> interior I
t = min (x + e / 2) ((x + y) / 2)
[PROOF STEP]
have "x < t" "t < y" "t \<in> ball x e"
[PROOF STATE]
proof (prove)
using this:
x < y
0 < e
ball x e \<subseteq> interior I
t = min (x + e / 2) ((x + y) / 2)

goal (1 subgoal):
 1. x < t &&& t < y &&& t \<in> ball x e
[PROOF STEP]
by (auto simp: dist_real_def field_simps split: split_min)
[PROOF STATE]
proof (state)
this:
x < t
t < y
t \<in> ball x e

goal (3 subgoals):
 1. ?x < ?y \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
 2. ?x = ?y \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
 3. ?y < ?x \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
[PROOF STEP]
with \<open>x \<in> interior I\<close> e interior_subset[of I]
[PROOF STATE]
proof (chain)
picking this:
x \<in> interior I
0 < e
ball x e \<subseteq> interior I
interior I \<subseteq> I
x < t
t < y
t \<in> ball x e
[PROOF STEP]
have "t \<in> I" "x \<in> I"
[PROOF STATE]
proof (prove)
using this:
x \<in> interior I
0 < e
ball x e \<subseteq> interior I
interior I \<subseteq> I
x < t
t < y
t \<in> ball x e

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

goal (3 subgoals):
 1. ?x < ?y \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
 2. ?x = ?y \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
 3. ?y < ?x \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
[PROOF STEP]
define K where "K = x - e / 2"
[PROOF STATE]
proof (state)
this:
K = x - e / 2

goal (3 subgoals):
 1. ?x < ?y \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
 2. ?x = ?y \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
 3. ?y < ?x \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
[PROOF STEP]
with \<open>0 < e\<close>
[PROOF STATE]
proof (chain)
picking this:
0 < e
K = x - e / 2
[PROOF STEP]
have "K \<in> ball x e" "K < x"
[PROOF STATE]
proof (prove)
using this:
0 < e
K = x - e / 2

goal (1 subgoal):
 1. K \<in> ball x e &&& K < x
[PROOF STEP]
by (auto simp: dist_real_def)
[PROOF STATE]
proof (state)
this:
K \<in> ball x e
K < x

goal (3 subgoals):
 1. ?x < ?y \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
 2. ?x = ?y \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
 3. ?y < ?x \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
K \<in> ball x e
K < x
[PROOF STEP]
have "K \<in> I"
[PROOF STATE]
proof (prove)
using this:
K \<in> ball x e
K < x

goal (1 subgoal):
 1. K \<in> I
[PROOF STEP]
using \<open>interior I \<subseteq> I\<close> e(2)
[PROOF STATE]
proof (prove)
using this:
K \<in> ball x e
K < x
interior I \<subseteq> I
ball x e \<subseteq> interior I

goal (1 subgoal):
 1. K \<in> I
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
K \<in> I

goal (3 subgoals):
 1. ?x < ?y \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
 2. ?x = ?y \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
 3. ?y < ?x \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
[PROOF STEP]
have "Inf (?F x) \<le> (f x - f y) / (x - y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) \<le> (f x - f y) / (x - y)
[PROOF STEP]
proof (intro bdd_belowI cInf_lower2)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. ?x \<in> (\<lambda>t. (f x - f t) / (x - t)) ` ({x<..} \<inter> I)
 2. ?x \<le> (f x - f y) / (x - y)
 3. \<And>xa. xa \<in> (\<lambda>t. (f x - f t) / (x - t)) ` ({x<..} \<inter> I) \<Longrightarrow> ?m1 \<le> xa
[PROOF STEP]
show "(f x - f t) / (x - t) \<in> ?F x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f x - f t) / (x - t) \<in> (\<lambda>t. (f x - f t) / (x - t)) ` ({x<..} \<inter> I)
[PROOF STEP]
using \<open>t \<in> I\<close> \<open>x < t\<close>
[PROOF STATE]
proof (prove)
using this:
t \<in> I
x < t

goal (1 subgoal):
 1. (f x - f t) / (x - t) \<in> (\<lambda>t. (f x - f t) / (x - t)) ` ({x<..} \<inter> I)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(f x - f t) / (x - t) \<in> (\<lambda>t. (f x - f t) / (x - t)) ` ({x<..} \<inter> I)

goal (2 subgoals):
 1. (f x - f t) / (x - t) \<le> (f x - f y) / (x - y)
 2. \<And>xa. xa \<in> (\<lambda>t. (f x - f t) / (x - t)) ` ({x<..} \<inter> I) \<Longrightarrow> ?m1 \<le> xa
[PROOF STEP]
show "(f x - f t) / (x - t) \<le> (f x - f y) / (x - y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f x - f t) / (x - t) \<le> (f x - f y) / (x - y)
[PROOF STEP]
using \<open>convex_on I f\<close> \<open>x \<in> I\<close> \<open>y \<in> I\<close> \<open>x < t\<close> \<open>t < y\<close>
[PROOF STATE]
proof (prove)
using this:
convex_on I f
x \<in> I
y \<in> I
x < t
t < y

goal (1 subgoal):
 1. (f x - f t) / (x - t) \<le> (f x - f y) / (x - y)
[PROOF STEP]
by (rule convex_on_diff)
[PROOF STATE]
proof (state)
this:
(f x - f t) / (x - t) \<le> (f x - f y) / (x - y)

goal (1 subgoal):
 1. \<And>xa. xa \<in> (\<lambda>t. (f x - f t) / (x - t)) ` ({x<..} \<inter> I) \<Longrightarrow> ?m1 \<le> xa
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. xa \<in> (\<lambda>t. (f x - f t) / (x - t)) ` ({x<..} \<inter> I) \<Longrightarrow> ?m1 \<le> xa
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. xa \<in> (\<lambda>t. (f x - f t) / (x - t)) ` ({x<..} \<inter> I) \<Longrightarrow> ?m1 \<le> xa
[PROOF STEP]
assume "y \<in> ?F x"
[PROOF STATE]
proof (state)
this:
y \<in> (\<lambda>t. (f x - f t) / (x - t)) ` ({x<..} \<inter> I)

goal (1 subgoal):
 1. \<And>xa. xa \<in> (\<lambda>t. (f x - f t) / (x - t)) ` ({x<..} \<inter> I) \<Longrightarrow> ?m1 \<le> xa
[PROOF STEP]
with order_trans[OF convex_on_diff[OF \<open>convex_on I f\<close> \<open>K \<in> I\<close> _ \<open>K < x\<close> _]]
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?y1 \<in> I; x < ?y1; ?y1 \<in> I; x < ?y1\<rbrakk> \<Longrightarrow> (f K - f x) / (K - x) \<le> (f x - f ?y1) / (x - ?y1)
y \<in> (\<lambda>t. (f x - f t) / (x - t)) ` ({x<..} \<inter> I)
[PROOF STEP]
show "(f K - f x) / (K - x) \<le> y"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?y1 \<in> I; x < ?y1; ?y1 \<in> I; x < ?y1\<rbrakk> \<Longrightarrow> (f K - f x) / (K - x) \<le> (f x - f ?y1) / (x - ?y1)
y \<in> (\<lambda>t. (f x - f t) / (x - t)) ` ({x<..} \<inter> I)

goal (1 subgoal):
 1. (f K - f x) / (K - x) \<le> y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(f K - f x) / (K - x) \<le> y

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) \<le> (f x - f y) / (x - y)

goal (3 subgoals):
 1. ?x < ?y \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
 2. ?x = ?y \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
 3. ?y < ?x \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) \<le> (f x - f y) / (x - y)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) \<le> (f x - f y) / (x - y)

goal (1 subgoal):
 1. f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
[PROOF STEP]
using \<open>x < y\<close>
[PROOF STATE]
proof (prove)
using this:
(INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) \<le> (f x - f y) / (x - y)
x < y

goal (1 subgoal):
 1. f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y

goal (2 subgoals):
 1. x = y \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
 2. y < x \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x = y \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
 2. y < x \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
[PROOF STEP]
assume "y < x"
[PROOF STATE]
proof (state)
this:
y < x

goal (2 subgoals):
 1. x = y \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
 2. y < x \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y < x

goal (2 subgoals):
 1. x = y \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
 2. y < x \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
[PROOF STEP]
have "open (interior I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open (interior I)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
open (interior I)

goal (2 subgoals):
 1. x = y \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
 2. y < x \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
[PROOF STEP]
from openE[OF this \<open>x \<in> interior I\<close>]
[PROOF STATE]
proof (chain)
picking this:
(\<And>e. \<lbrakk>0 < e; ball x e \<subseteq> interior I\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis
[PROOF STEP]
obtain e where e: "0 < e" "ball x e \<subseteq> interior I"
[PROOF STATE]
proof (prove)
using this:
(\<And>e. \<lbrakk>0 < e; ball x e \<subseteq> interior I\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>e. \<lbrakk>0 < e; ball x e \<subseteq> interior I\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
0 < e
ball x e \<subseteq> interior I

goal (2 subgoals):
 1. x = y \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
 2. y < x \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 < e
ball x e \<subseteq> interior I

goal (2 subgoals):
 1. x = y \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
 2. y < x \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
[PROOF STEP]
define t where "t = x + e / 2"
[PROOF STATE]
proof (state)
this:
t = x + e / 2

goal (2 subgoals):
 1. x = y \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
 2. y < x \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
y < x
0 < e
ball x e \<subseteq> interior I
t = x + e / 2
[PROOF STEP]
have "x < t" "t \<in> ball x e"
[PROOF STATE]
proof (prove)
using this:
y < x
0 < e
ball x e \<subseteq> interior I
t = x + e / 2

goal (1 subgoal):
 1. x < t &&& t \<in> ball x e
[PROOF STEP]
by (auto simp: dist_real_def field_simps)
[PROOF STATE]
proof (state)
this:
x < t
t \<in> ball x e

goal (2 subgoals):
 1. x = y \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
 2. y < x \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
[PROOF STEP]
with \<open>x \<in> interior I\<close> e interior_subset[of I]
[PROOF STATE]
proof (chain)
picking this:
x \<in> interior I
0 < e
ball x e \<subseteq> interior I
interior I \<subseteq> I
x < t
t \<in> ball x e
[PROOF STEP]
have "t \<in> I" "x \<in> I"
[PROOF STATE]
proof (prove)
using this:
x \<in> interior I
0 < e
ball x e \<subseteq> interior I
interior I \<subseteq> I
x < t
t \<in> ball x e

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

goal (2 subgoals):
 1. x = y \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
 2. y < x \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
[PROOF STEP]
have "(f x - f y) / (x - y) \<le> Inf (?F x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f x - f y) / (x - y) \<le> (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t))
[PROOF STEP]
proof (rule cInf_greatest)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<lambda>t. (f x - f t) / (x - t)) ` ({x<..} \<inter> I) \<noteq> {}
 2. \<And>xa. xa \<in> (\<lambda>t. (f x - f t) / (x - t)) ` ({x<..} \<inter> I) \<Longrightarrow> (f x - f y) / (x - y) \<le> xa
[PROOF STEP]
have "(f x - f y) / (x - y) = (f y - f x) / (y - x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f x - f y) / (x - y) = (f y - f x) / (y - x)
[PROOF STEP]
using \<open>y < x\<close>
[PROOF STATE]
proof (prove)
using this:
y < x

goal (1 subgoal):
 1. (f x - f y) / (x - y) = (f y - f x) / (y - x)
[PROOF STEP]
by (auto simp: field_simps)
[PROOF STATE]
proof (state)
this:
(f x - f y) / (x - y) = (f y - f x) / (y - x)

goal (2 subgoals):
 1. (\<lambda>t. (f x - f t) / (x - t)) ` ({x<..} \<inter> I) \<noteq> {}
 2. \<And>xa. xa \<in> (\<lambda>t. (f x - f t) / (x - t)) ` ({x<..} \<inter> I) \<Longrightarrow> (f x - f y) / (x - y) \<le> xa
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(f x - f y) / (x - y) = (f y - f x) / (y - x)

goal (2 subgoals):
 1. (\<lambda>t. (f x - f t) / (x - t)) ` ({x<..} \<inter> I) \<noteq> {}
 2. \<And>xa. xa \<in> (\<lambda>t. (f x - f t) / (x - t)) ` ({x<..} \<inter> I) \<Longrightarrow> (f x - f y) / (x - y) \<le> xa
[PROOF STEP]
fix z
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<lambda>t. (f x - f t) / (x - t)) ` ({x<..} \<inter> I) \<noteq> {}
 2. \<And>xa. xa \<in> (\<lambda>t. (f x - f t) / (x - t)) ` ({x<..} \<inter> I) \<Longrightarrow> (f x - f y) / (x - y) \<le> xa
[PROOF STEP]
assume "z \<in> ?F x"
[PROOF STATE]
proof (state)
this:
z \<in> (\<lambda>t. (f x - f t) / (x - t)) ` ({x<..} \<inter> I)

goal (2 subgoals):
 1. (\<lambda>t. (f x - f t) / (x - t)) ` ({x<..} \<inter> I) \<noteq> {}
 2. \<And>xa. xa \<in> (\<lambda>t. (f x - f t) / (x - t)) ` ({x<..} \<inter> I) \<Longrightarrow> (f x - f y) / (x - y) \<le> xa
[PROOF STEP]
with order_trans[OF convex_on_diff[OF \<open>convex_on I f\<close> \<open>y \<in> I\<close> _ \<open>y < x\<close>]]
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?y1 \<in> I; x < ?y1; ?y1 \<in> I; x < ?y1\<rbrakk> \<Longrightarrow> (f y - f x) / (y - x) \<le> (f x - f ?y1) / (x - ?y1)
z \<in> (\<lambda>t. (f x - f t) / (x - t)) ` ({x<..} \<inter> I)
[PROOF STEP]
have "(f y - f x) / (y - x) \<le> z"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?y1 \<in> I; x < ?y1; ?y1 \<in> I; x < ?y1\<rbrakk> \<Longrightarrow> (f y - f x) / (y - x) \<le> (f x - f ?y1) / (x - ?y1)
z \<in> (\<lambda>t. (f x - f t) / (x - t)) ` ({x<..} \<inter> I)

goal (1 subgoal):
 1. (f y - f x) / (y - x) \<le> z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(f y - f x) / (y - x) \<le> z

goal (2 subgoals):
 1. (\<lambda>t. (f x - f t) / (x - t)) ` ({x<..} \<inter> I) \<noteq> {}
 2. \<And>xa. xa \<in> (\<lambda>t. (f x - f t) / (x - t)) ` ({x<..} \<inter> I) \<Longrightarrow> (f x - f y) / (x - y) \<le> xa
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(f x - f y) / (x - y) \<le> z
[PROOF STEP]
show "(f x - f y) / (x - y) \<le> z"
[PROOF STATE]
proof (prove)
using this:
(f x - f y) / (x - y) \<le> z

goal (1 subgoal):
 1. (f x - f y) / (x - y) \<le> z
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(f x - f y) / (x - y) \<le> z

goal (1 subgoal):
 1. (\<lambda>t. (f x - f t) / (x - t)) ` ({x<..} \<inter> I) \<noteq> {}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>t. (f x - f t) / (x - t)) ` ({x<..} \<inter> I) \<noteq> {}
[PROOF STEP]
have "x + e / 2 \<in> ball x e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x + e / 2 \<in> ball x e
[PROOF STEP]
using e
[PROOF STATE]
proof (prove)
using this:
0 < e
ball x e \<subseteq> interior I

goal (1 subgoal):
 1. x + e / 2 \<in> ball x e
[PROOF STEP]
by (auto simp: dist_real_def)
[PROOF STATE]
proof (state)
this:
x + e / 2 \<in> ball x e

goal (1 subgoal):
 1. (\<lambda>t. (f x - f t) / (x - t)) ` ({x<..} \<inter> I) \<noteq> {}
[PROOF STEP]
with e interior_subset[of I]
[PROOF STATE]
proof (chain)
picking this:
0 < e
ball x e \<subseteq> interior I
interior I \<subseteq> I
x + e / 2 \<in> ball x e
[PROOF STEP]
have "x + e / 2 \<in> {x<..} \<inter> I"
[PROOF STATE]
proof (prove)
using this:
0 < e
ball x e \<subseteq> interior I
interior I \<subseteq> I
x + e / 2 \<in> ball x e

goal (1 subgoal):
 1. x + e / 2 \<in> {x<..} \<inter> I
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x + e / 2 \<in> {x<..} \<inter> I

goal (1 subgoal):
 1. (\<lambda>t. (f x - f t) / (x - t)) ` ({x<..} \<inter> I) \<noteq> {}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x + e / 2 \<in> {x<..} \<inter> I
[PROOF STEP]
show "?F x \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
x + e / 2 \<in> {x<..} \<inter> I

goal (1 subgoal):
 1. (\<lambda>t. (f x - f t) / (x - t)) ` ({x<..} \<inter> I) \<noteq> {}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<lambda>t. (f x - f t) / (x - t)) ` ({x<..} \<inter> I) \<noteq> {}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(f x - f y) / (x - y) \<le> (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t))

goal (2 subgoals):
 1. x = y \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
 2. y < x \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(f x - f y) / (x - y) \<le> (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(f x - f y) / (x - y) \<le> (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t))

goal (1 subgoal):
 1. f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
[PROOF STEP]
using \<open>y < x\<close>
[PROOF STATE]
proof (prove)
using this:
(f x - f y) / (x - y) \<le> (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t))
y < x

goal (1 subgoal):
 1. f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y

goal (1 subgoal):
 1. x = y \<Longrightarrow> f x + (INF t\<in>{x<..} \<inter> I. (f x - f t) / (x - t)) * (y - x) \<le> f y
[PROOF STEP]
qed simp


[STATEMENT]
lemma ct_list_eq_length:
  assumes "ct_list_eq xs ys"
  shows "length xs = length ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length xs = length ys
[PROOF STEP]
using assms list_all2_lengthD
[PROOF STATE]
proof (prove)
using this:
ct_list_eq xs ys
list_all2 ?P ?xs ?ys \<Longrightarrow> length ?xs = length ?ys

goal (1 subgoal):
 1. length xs = length ys
[PROOF STEP]
unfolding ct_list_eq_def
[PROOF STATE]
proof (prove)
using this:
list_all2 ct_eq xs ys
list_all2 ?P ?xs ?ys \<Longrightarrow> length ?xs = length ?ys

goal (1 subgoal):
 1. length xs = length ys
[PROOF STEP]
by blast


[STATEMENT]
lemma dom_subset_ran_iff:
  assumes "finite (ran m)"
  shows "dom m \<subseteq> ran m \<longleftrightarrow> dom m = ran m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (dom m \<subseteq> ran m) = (dom m = ran m)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. dom m \<subseteq> ran m \<Longrightarrow> dom m = ran m
 2. dom m = ran m \<Longrightarrow> dom m \<subseteq> ran m
[PROOF STEP]
assume le: "dom m \<subseteq> ran m"
[PROOF STATE]
proof (state)
this:
dom m \<subseteq> ran m

goal (2 subgoals):
 1. dom m \<subseteq> ran m \<Longrightarrow> dom m = ran m
 2. dom m = ran m \<Longrightarrow> dom m \<subseteq> ran m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
dom m \<subseteq> ran m
[PROOF STEP]
have "card (dom m) \<le> card (ran m)"
[PROOF STATE]
proof (prove)
using this:
dom m \<subseteq> ran m

goal (1 subgoal):
 1. card (dom m) \<le> card (ran m)
[PROOF STEP]
by(simp add: card_mono assms)
[PROOF STATE]
proof (state)
this:
card (dom m) \<le> card (ran m)

goal (2 subgoals):
 1. dom m \<subseteq> ran m \<Longrightarrow> dom m = ran m
 2. dom m = ran m \<Longrightarrow> dom m \<subseteq> ran m
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
card (dom m) \<le> card (ran m)

goal (2 subgoals):
 1. dom m \<subseteq> ran m \<Longrightarrow> dom m = ran m
 2. dom m = ran m \<Longrightarrow> dom m \<subseteq> ran m
[PROOF STEP]
have "card (ran m) \<le> card (dom m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (ran m) \<le> card (dom m)
[PROOF STEP]
by(simp add: finite_subset[OF le assms] card_ran_le_dom)
[PROOF STATE]
proof (state)
this:
card (ran m) \<le> card (dom m)

goal (2 subgoals):
 1. dom m \<subseteq> ran m \<Longrightarrow> dom m = ran m
 2. dom m = ran m \<Longrightarrow> dom m \<subseteq> ran m
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
card (dom m) \<le> card (ran m)
card (ran m) \<le> card (dom m)
[PROOF STEP]
show "dom m = ran m"
[PROOF STATE]
proof (prove)
using this:
card (dom m) \<le> card (ran m)
card (ran m) \<le> card (dom m)

goal (1 subgoal):
 1. dom m = ran m
[PROOF STEP]
using card_subset_eq[OF assms le]
[PROOF STATE]
proof (prove)
using this:
card (dom m) \<le> card (ran m)
card (ran m) \<le> card (dom m)
card (dom m) = card (ran m) \<Longrightarrow> dom m = ran m

goal (1 subgoal):
 1. dom m = ran m
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dom m = ran m

goal (1 subgoal):
 1. dom m = ran m \<Longrightarrow> dom m \<subseteq> ran m
[PROOF STEP]
qed simp


[STATEMENT]
lemma mono_ctble_discont:
  fixes f :: "real \<Rightarrow> real"
  assumes "mono f"
  shows "countable {a. \<not> isCont f a}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable {a. \<not> isCont f a}
[PROOF STEP]
using assms mono_on_ctble_discont [of UNIV f]
[PROOF STATE]
proof (prove)
using this:
mono f
mono f \<Longrightarrow> countable {a \<in> UNIV. \<not> isCont f a}

goal (1 subgoal):
 1. countable {a. \<not> isCont f a}
[PROOF STEP]
unfolding mono_on_def mono_def
[PROOF STATE]
proof (prove)
using this:
\<forall>r s. r \<in> UNIV \<and> s \<in> UNIV \<and> r \<le> s \<longrightarrow> f r \<le> f s
\<forall>r s. r \<in> UNIV \<and> s \<in> UNIV \<and> r \<le> s \<longrightarrow> f r \<le> f s \<Longrightarrow> countable {a \<in> UNIV. \<not> isCont f a}

goal (1 subgoal):
 1. countable {a. \<not> isCont f a}
[PROOF STEP]
by auto


[STATEMENT]
lemma Jacobi_neg_left:
  assumes "odd n" "1 < n"
  shows   "Jacobi (-a) n = (if n mod 4 = 1 then 1 else -1) * Jacobi a n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Jacobi (- a) n = (if n mod 4 = 1 then 1 else - 1) * Jacobi a n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Jacobi (- a) n = (if n mod 4 = 1 then 1 else - 1) * Jacobi a n
[PROOF STEP]
have * : "-a = (-1) * a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - a = - 1 * a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
- a = - 1 * a

goal (1 subgoal):
 1. Jacobi (- a) n = (if n mod 4 = 1 then 1 else - 1) * Jacobi a n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Jacobi (- a) n = (if n mod 4 = 1 then 1 else - 1) * Jacobi a n
[PROOF STEP]
unfolding * Jacobi_mult_left supplement1_Jacobi'[OF assms]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if n mod 4 = 1 then 1 else - 1) * Jacobi a n = (if n mod 4 = 1 then 1 else - 1) * Jacobi a n
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
Jacobi (- a) n = (if n mod 4 = 1 then 1 else - 1) * Jacobi a n

goal:
No subgoals!
[PROOF STEP]
qed


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

goal (2 subgoals):
 1. \<And>x. num_vars (Var x) \<le> num_syms (Var x)
 2. \<And>x1a x2. (\<And>x2a. x2a \<in> set x2 \<Longrightarrow> num_vars x2a \<le> num_syms x2a) \<Longrightarrow> num_vars (Fun x1a x2) \<le> num_syms (Fun x1a x2)
[PROOF STEP]
with sum_list_mono [of ts num_vars num_syms]
[PROOF STATE]
proof (chain)
picking this:
(\<And>x. x \<in> set ts \<Longrightarrow> num_vars x \<le> num_syms x) \<Longrightarrow> sum_list (map num_vars ts) \<le> sum_list (map num_syms ts)
?x2a \<in> set ts \<Longrightarrow> num_vars ?x2a \<le> num_syms ?x2a
[PROOF STEP]
have "sum_list (map num_vars ts) \<le> sum_list (map num_syms ts)"
[PROOF STATE]
proof (prove)
using this:
(\<And>x. x \<in> set ts \<Longrightarrow> num_vars x \<le> num_syms x) \<Longrightarrow> sum_list (map num_vars ts) \<le> sum_list (map num_syms ts)
?x2a \<in> set ts \<Longrightarrow> num_vars ?x2a \<le> num_syms ?x2a

goal (1 subgoal):
 1. sum_list (map num_vars ts) \<le> sum_list (map num_syms ts)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum_list (map num_vars ts) \<le> sum_list (map num_syms ts)

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

goal (1 subgoal):
 1. num_vars (Fun f ts) \<le> num_syms (Fun f ts)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
num_vars (Fun f ts) \<le> num_syms (Fun f ts)

goal (1 subgoal):
 1. \<And>x. num_vars (Var x) \<le> num_syms (Var x)
[PROOF STEP]
qed simp


[STATEMENT]
lemma complex_of_real_pos_iff[simp]:
  "0 < complex_of_real y \<longleftrightarrow> 0 < y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 < complex_of_real y) = (0 < y)
[PROOF STEP]
unfolding less_complex_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Re 0 < Re (complex_of_real y) \<and> Im 0 = Im (complex_of_real y)) = (0 < y)
[PROOF STEP]
by auto


[STATEMENT]
lemma distinct_sorted_list_of_fmap[simp, intro]: "distinct (sorted_list_of_fmap m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (sorted_list_of_fmap m)
[PROOF STEP]
unfolding sorted_list_of_fmap_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (map (\<lambda>k. (k, the (fmlookup m k))) (sorted_list_of_fset (fmdom m)))
[PROOF STEP]
apply (subst distinct_map)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (sorted_list_of_fset (fmdom m)) \<and> inj_on (\<lambda>k. (k, the (fmlookup m k))) (set (sorted_list_of_fset (fmdom m)))
[PROOF STEP]
apply rule
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. distinct (sorted_list_of_fset (fmdom m))
 2. inj_on (\<lambda>k. (k, the (fmlookup m k))) (set (sorted_list_of_fset (fmdom m)))
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (sorted_list_of_fset (fmdom m))
[PROOF STEP]
by simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (\<lambda>k. (k, the (fmlookup m k))) (set (sorted_list_of_fset (fmdom m)))
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (\<lambda>k. (k, the (fmlookup m k))) (set (sorted_list_of_fset (fmdom m)))
[PROOF STEP]
by (rule inj_on_convol_ident)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma cball_in_cbox:
  fixes y::"'a::euclidean_space"
  shows "cball y r \<subseteq> cbox (y - r *\<^sub>R One) (y + r *\<^sub>R One)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cball y r \<subseteq> cbox (y - r *\<^sub>R One) (y + r *\<^sub>R One)
[PROOF STEP]
unfolding scaleR_sum_right interval_cbox cbox_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cball y r \<subseteq> {x. \<forall>i\<in>Basis. (y - sum ((*\<^sub>R) r) Basis) \<bullet> i \<le> x \<bullet> i \<and> x \<bullet> i \<le> (y + sum ((*\<^sub>R) r) Basis) \<bullet> i}
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x i. \<lbrakk>x \<in> cball y r; i \<in> Basis\<rbrakk> \<Longrightarrow> (y - sum ((*\<^sub>R) r) Basis) \<bullet> i \<le> x \<bullet> i
 2. \<And>x i. \<lbrakk>x \<in> cball y r; i \<in> Basis\<rbrakk> \<Longrightarrow> x \<bullet> i \<le> (y + sum ((*\<^sub>R) r) Basis) \<bullet> i
[PROOF STEP]
fix x i::'a
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x i. \<lbrakk>x \<in> cball y r; i \<in> Basis\<rbrakk> \<Longrightarrow> (y - sum ((*\<^sub>R) r) Basis) \<bullet> i \<le> x \<bullet> i
 2. \<And>x i. \<lbrakk>x \<in> cball y r; i \<in> Basis\<rbrakk> \<Longrightarrow> x \<bullet> i \<le> (y + sum ((*\<^sub>R) r) Basis) \<bullet> i
[PROOF STEP]
assume "i \<in> Basis" "x \<in> cball y r"
[PROOF STATE]
proof (state)
this:
i \<in> Basis
x \<in> cball y r

goal (2 subgoals):
 1. \<And>x i. \<lbrakk>x \<in> cball y r; i \<in> Basis\<rbrakk> \<Longrightarrow> (y - sum ((*\<^sub>R) r) Basis) \<bullet> i \<le> x \<bullet> i
 2. \<And>x i. \<lbrakk>x \<in> cball y r; i \<in> Basis\<rbrakk> \<Longrightarrow> x \<bullet> i \<le> (y + sum ((*\<^sub>R) r) Basis) \<bullet> i
[PROOF STEP]
with dist_component_le[OF \<open>i \<in> Basis\<close>, of y x]
[PROOF STATE]
proof (chain)
picking this:
dist (y \<bullet> i) (x \<bullet> i) \<le> dist y x
i \<in> Basis
x \<in> cball y r
[PROOF STEP]
have "dist (y \<bullet> i) (x \<bullet> i) \<le> r"
[PROOF STATE]
proof (prove)
using this:
dist (y \<bullet> i) (x \<bullet> i) \<le> dist y x
i \<in> Basis
x \<in> cball y r

goal (1 subgoal):
 1. dist (y \<bullet> i) (x \<bullet> i) \<le> r
[PROOF STEP]
by (simp add: mem_cball)
[PROOF STATE]
proof (state)
this:
dist (y \<bullet> i) (x \<bullet> i) \<le> r

goal (2 subgoals):
 1. \<And>x i. \<lbrakk>x \<in> cball y r; i \<in> Basis\<rbrakk> \<Longrightarrow> (y - sum ((*\<^sub>R) r) Basis) \<bullet> i \<le> x \<bullet> i
 2. \<And>x i. \<lbrakk>x \<in> cball y r; i \<in> Basis\<rbrakk> \<Longrightarrow> x \<bullet> i \<le> (y + sum ((*\<^sub>R) r) Basis) \<bullet> i
[PROOF STEP]
thus "(y - sum ((*\<^sub>R) r) Basis) \<bullet> i \<le> x \<bullet> i"
    "x \<bullet> i \<le> (y + sum ((*\<^sub>R) r) Basis) \<bullet> i"
[PROOF STATE]
proof (prove)
using this:
dist (y \<bullet> i) (x \<bullet> i) \<le> r

goal (1 subgoal):
 1. (y - sum ((*\<^sub>R) r) Basis) \<bullet> i \<le> x \<bullet> i &&& x \<bullet> i \<le> (y + sum ((*\<^sub>R) r) Basis) \<bullet> i
[PROOF STEP]
by (auto simp add: inner_diff_left inner_add_left inner_sum_left
      sum_distrib_left[symmetric] sum_inner_Basis_one \<open>i\<in>Basis\<close> dist_real_def)
[PROOF STATE]
proof (state)
this:
(y - sum ((*\<^sub>R) r) Basis) \<bullet> i \<le> x \<bullet> i
x \<bullet> i \<le> (y + sum ((*\<^sub>R) r) Basis) \<bullet> i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem disjoint_product_over_sum:
  "O x y \<Longrightarrow> \<not> O x z \<Longrightarrow> x \<otimes> (y \<oplus> z) = x \<otimes> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>O x y; \<not> O x z\<rbrakk> \<Longrightarrow> x \<otimes> (y \<oplus> z) = x \<otimes> y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>O x y; \<not> O x z\<rbrakk> \<Longrightarrow> x \<otimes> (y \<oplus> z) = x \<otimes> y
[PROOF STEP]
assume "O x y"
[PROOF STATE]
proof (state)
this:
O x y

goal (1 subgoal):
 1. \<lbrakk>O x y; \<not> O x z\<rbrakk> \<Longrightarrow> x \<otimes> (y \<oplus> z) = x \<otimes> y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
O x y

goal (1 subgoal):
 1. \<lbrakk>O x y; \<not> O x z\<rbrakk> \<Longrightarrow> x \<otimes> (y \<oplus> z) = x \<otimes> y
[PROOF STEP]
assume "\<not> O x z"
[PROOF STATE]
proof (state)
this:
\<not> O x z

goal (1 subgoal):
 1. \<lbrakk>O x y; \<not> O x z\<rbrakk> \<Longrightarrow> x \<otimes> (y \<oplus> z) = x \<otimes> y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
O x y
\<not> O x z
[PROOF STEP]
have "P (x \<otimes> (y \<oplus> z)) (x \<otimes> y)"
[PROOF STATE]
proof (prove)
using this:
O x y
\<not> O x z

goal (1 subgoal):
 1. P (x \<otimes> (y \<oplus> z)) (x \<otimes> y)
[PROOF STEP]
by (rule product_of_first_summand)
[PROOF STATE]
proof (state)
this:
P (x \<otimes> (y \<oplus> z)) (x \<otimes> y)

goal (1 subgoal):
 1. \<lbrakk>O x y; \<not> O x z\<rbrakk> \<Longrightarrow> x \<otimes> (y \<oplus> z) = x \<otimes> y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
P (x \<otimes> (y \<oplus> z)) (x \<otimes> y)

goal (1 subgoal):
 1. \<lbrakk>O x y; \<not> O x z\<rbrakk> \<Longrightarrow> x \<otimes> (y \<oplus> z) = x \<otimes> y
[PROOF STEP]
have "P (x \<otimes> y)(x \<otimes> (y \<oplus> z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P (x \<otimes> y) (x \<otimes> (y \<oplus> z))
[PROOF STEP]
using \<open>O x y\<close>
[PROOF STATE]
proof (prove)
using this:
O x y

goal (1 subgoal):
 1. P (x \<otimes> y) (x \<otimes> (y \<oplus> z))
[PROOF STEP]
by (rule product_in_factor_by_sum)
[PROOF STATE]
proof (state)
this:
P (x \<otimes> y) (x \<otimes> (y \<oplus> z))

goal (1 subgoal):
 1. \<lbrakk>O x y; \<not> O x z\<rbrakk> \<Longrightarrow> x \<otimes> (y \<oplus> z) = x \<otimes> y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
P (x \<otimes> (y \<oplus> z)) (x \<otimes> y)
P (x \<otimes> y) (x \<otimes> (y \<oplus> z))
[PROOF STEP]
show "x \<otimes> (y \<oplus> z) = x \<otimes> y"
[PROOF STATE]
proof (prove)
using this:
P (x \<otimes> (y \<oplus> z)) (x \<otimes> y)
P (x \<otimes> y) (x \<otimes> (y \<oplus> z))

goal (1 subgoal):
 1. x \<otimes> (y \<oplus> z) = x \<otimes> y
[PROOF STEP]
by (rule part_antisymmetry)
[PROOF STATE]
proof (state)
this:
x \<otimes> (y \<oplus> z) = x \<otimes> y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma integral_exp_minus_squared_real:
  assumes "a \<le> b"
  shows   "((\<lambda>t. exp (-(t^2))) has_integral (sqrt pi / 2 * (erf b - erf a))) {a..b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>t. exp (- t\<^sup>2)) has_integral sqrt pi / 2 * (erf b - erf a)) {a..b}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>t. exp (- t\<^sup>2)) has_integral sqrt pi / 2 * (erf b - erf a)) {a..b}
[PROOF STEP]
have "((\<lambda>t. exp (-(t^2))) has_integral (sqrt pi / 2 * erf b - sqrt pi / 2 * erf a)) {a..b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>t. exp (- t\<^sup>2)) has_integral sqrt pi / 2 * erf b - sqrt pi / 2 * erf a) {a..b}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<le> b

goal (1 subgoal):
 1. ((\<lambda>t. exp (- t\<^sup>2)) has_integral sqrt pi / 2 * erf b - sqrt pi / 2 * erf a) {a..b}
[PROOF STEP]
by (intro fundamental_theorem_of_calculus)
       (auto intro!: derivative_eq_intros
             simp: has_real_derivative_iff_has_vector_derivative [symmetric])
[PROOF STATE]
proof (state)
this:
((\<lambda>t. exp (- t\<^sup>2)) has_integral sqrt pi / 2 * erf b - sqrt pi / 2 * erf a) {a..b}

goal (1 subgoal):
 1. ((\<lambda>t. exp (- t\<^sup>2)) has_integral sqrt pi / 2 * (erf b - erf a)) {a..b}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>t. exp (- t\<^sup>2)) has_integral sqrt pi / 2 * erf b - sqrt pi / 2 * erf a) {a..b}

goal (1 subgoal):
 1. ((\<lambda>t. exp (- t\<^sup>2)) has_integral sqrt pi / 2 * (erf b - erf a)) {a..b}
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
((\<lambda>t. exp (- t\<^sup>2)) has_integral sqrt pi / 2 * (erf b - erf a)) {a..b}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sq_mtx_norm_1: "\<parallel>(1::'a sq_mtx)\<parallel> = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>1\<parallel> = 1
[PROOF STEP]
unfolding one_sq_mtx_def norm_sq_mtx_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>to_vec (id (to_mtx (mat 1)))\<parallel>\<^sub>o\<^sub>p = 1
[PROOF STEP]
apply(simp add: op_norm_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sup {\<parallel>x\<parallel> |x. \<parallel>x\<parallel> = 1} = 1
[PROOF STEP]
apply(subst cSup_eq[of _ 1])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<forall>x\<in>{\<parallel>x\<parallel> |x. \<parallel>x\<parallel> = 1}. x \<le> 1
 2. Bex {\<parallel>x\<parallel> |x. \<parallel>x\<parallel> = 1} ((\<le>) 1)
 3. 1 = 1
[PROOF STEP]
using ex_norm_eq_1
[PROOF STATE]
proof (prove)
using this:
\<exists>x. \<parallel>x\<parallel> = 1

goal (3 subgoals):
 1. \<forall>x\<in>{\<parallel>x\<parallel> |x. \<parallel>x\<parallel> = 1}. x \<le> 1
 2. Bex {\<parallel>x\<parallel> |x. \<parallel>x\<parallel> = 1} ((\<le>) 1)
 3. 1 = 1
[PROOF STEP]
by auto


[STATEMENT]
lemma scaleC_le_cancel_left_pos: "0 < c \<Longrightarrow> c *\<^sub>C a \<le> c *\<^sub>C b \<longleftrightarrow> a \<le> b"
  for b :: "'a::ordered_complex_vector"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < c \<Longrightarrow> (c *\<^sub>C a \<le> c *\<^sub>C b) = (a \<le> b)
[PROOF STEP]
by (simp add: complex_is_Real_iff less_complex_def scaleC_le_cancel_left)


[STATEMENT]
lemma fdia_sup_fun: "fdia R (f \<squnion> g) = fdia R f \<squnion> fdia R g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fdia R (f \<squnion> g) = fdia R f \<squnion> fdia R g
[PROOF STEP]
by (simp add: fun_eq_iff fdia_im complete_lattice_class.SUP_sup_distrib)


[STATEMENT]
lemma leadsETo_UN:
    "(\<And>i. i \<in> I \<Longrightarrow> F \<in> (A i) leadsTo[CC] B)
     ==> F \<in> (UN i:I. A i) leadsTo[CC] B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. i \<in> I \<Longrightarrow> F \<in> A i leadsTo[CC] B) \<Longrightarrow> F \<in> \<Union> (A ` I) leadsTo[CC] B
[PROOF STEP]
apply (blast intro: leadsETo_Union)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma len_lexext_rev_total: "(\<forall>y \<in> B. \<forall>x \<in> A. gt y x \<or> gt x y \<or> y = x) \<Longrightarrow> ys \<in> lists B \<Longrightarrow>
  xs \<in> lists A \<Longrightarrow> len_lexext_rev gt ys xs \<or> len_lexext_rev gt xs ys \<or> ys = xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>y\<in>B. \<forall>x\<in>A. gt y x \<or> gt x y \<or> y = x; ys \<in> lists B; xs \<in> lists A\<rbrakk> \<Longrightarrow> len_lexext_rev gt ys xs \<or> len_lexext_rev gt xs ys \<or> ys = xs
[PROOF STEP]
by (rule lenext_total[OF lexext_rev_total])


[STATEMENT]
lemma unitary_inv:
  assumes "unitary M"
  shows "unitary (mat_inv M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unitary (mat_inv M)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
unitary M

goal (1 subgoal):
 1. unitary (mat_inv M)
[PROOF STEP]
unfolding unitary_adj_eq_inv
[PROOF STATE]
proof (prove)
using this:
mat_det M \<noteq> 0 \<and> mat_adj M = mat_inv M

goal (1 subgoal):
 1. mat_det (mat_inv M) \<noteq> 0 \<and> mat_adj (mat_inv M) = mat_inv (mat_inv M)
[PROOF STEP]
using mat_adj_inv[of M] mat_det_inv[of M]
[PROOF STATE]
proof (prove)
using this:
mat_det M \<noteq> 0 \<and> mat_adj M = mat_inv M
mat_det M \<noteq> 0 \<Longrightarrow> mat_adj (mat_inv M) = mat_inv (mat_adj M)
mat_det M \<noteq> 0 \<Longrightarrow> mat_det (mat_inv M) = 1 / mat_det M

goal (1 subgoal):
 1. mat_det (mat_inv M) \<noteq> 0 \<and> mat_adj (mat_inv M) = mat_inv (mat_inv M)
[PROOF STEP]
by simp


[STATEMENT]
lemma coeffs_sdiv: "coeffs (sdiv_poly p a) = (strip_while ((=) 0) (map (\<lambda> x. x div a) (coeffs p)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeffs (sdiv_poly p a) = strip_while ((=) (0::'a)) (map (\<lambda>x. x div a) (coeffs p))
[PROOF STEP]
unfolding sdiv_poly_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeffs (map_poly (\<lambda>c. c div a) p) = strip_while ((=) (0::'a)) (map (\<lambda>x. x div a) (coeffs p))
[PROOF STEP]
by (rule coeffs_map_poly)


[STATEMENT]
lemma up_to_iff: "finite J \<Longrightarrow> up_to J \<le> n \<longleftrightarrow> (\<forall>i\<in>J. i < n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite J \<Longrightarrow> (up_to J \<le> n) = (\<forall>i\<in>J. i < n)
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. \<lbrakk>finite J; up_to J \<le> n; i \<in> J\<rbrakk> \<Longrightarrow> i < n
 2. \<lbrakk>finite J; \<forall>i\<in>J. i < n\<rbrakk> \<Longrightarrow> up_to J \<le> n
[PROOF STEP]
show "finite J \<Longrightarrow> up_to J \<le> n \<Longrightarrow> i \<in> J \<Longrightarrow> i < n" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite J; up_to J \<le> n; i \<in> J\<rbrakk> \<Longrightarrow> i < n
[PROOF STEP]
using up_to_less[of J i]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite J; i \<in> J\<rbrakk> \<Longrightarrow> i < up_to J

goal (1 subgoal):
 1. \<lbrakk>finite J; up_to J \<le> n; i \<in> J\<rbrakk> \<Longrightarrow> i < n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<lbrakk>finite J; up_to J \<le> n; ?i \<in> J\<rbrakk> \<Longrightarrow> ?i < n

goal (1 subgoal):
 1. \<lbrakk>finite J; \<forall>i\<in>J. i < n\<rbrakk> \<Longrightarrow> up_to J \<le> n
[PROOF STEP]
qed (auto simp: up_to_def intro!: Least_le)


[STATEMENT]
lemma sqrt_int_floor_code[code]: "sqrt_int_floor x = (if x \<ge> 0 then sqrt_int_floor_pos x else - sqrt_int_ceiling_pos (- x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrt_int_floor x = (if 0 \<le> x then sqrt_int_floor_pos x else - sqrt_int_ceiling_pos (- x))
[PROOF STEP]
unfolding sqrt_int_floor_def root_int_floor_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if 0 \<le> x then root_int_floor_pos 2 x else - root_int_ceiling_pos 2 (- x)) = (if 0 \<le> x then sqrt_int_floor_pos x else - sqrt_int_ceiling_pos (- x))
[PROOF STEP]
by simp


[STATEMENT]
lemma powr_mono':
  assumes "(x::real) > 0" "x \<le> 1" "a \<le> b"
  shows   "x powr b \<le> x powr a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x powr b \<le> x powr a
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x powr b \<le> x powr a
[PROOF STEP]
have "inverse x powr a \<le> inverse x powr b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse x powr a \<le> inverse x powr b
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < x
x \<le> 1
a \<le> b

goal (1 subgoal):
 1. inverse x powr a \<le> inverse x powr b
[PROOF STEP]
by (intro powr_mono) (simp_all add: field_simps)
[PROOF STATE]
proof (state)
this:
inverse x powr a \<le> inverse x powr b

goal (1 subgoal):
 1. x powr b \<le> x powr a
[PROOF STEP]
hence "inverse (x powr a) \<le> inverse (x powr b)"
[PROOF STATE]
proof (prove)
using this:
inverse x powr a \<le> inverse x powr b

goal (1 subgoal):
 1. inverse (x powr a) \<le> inverse (x powr b)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
inverse x powr a \<le> inverse x powr b
0 < x
x \<le> 1
a \<le> b

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

goal (1 subgoal):
 1. x powr b \<le> x powr a
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
0 < x
x \<le> 1
a \<le> b
inverse (x powr a) \<le> inverse (x powr b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < x
x \<le> 1
a \<le> b
inverse (x powr a) \<le> inverse (x powr b)

goal (1 subgoal):
 1. x powr b \<le> x powr a
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
x powr b \<le> x powr a

goal:
No subgoals!
[PROOF STEP]
qed