[STATEMENT]
lemma ereal_SUP_uminus_eq:
  fixes f :: "'a \<Rightarrow> ereal"
  shows "(SUP x\<in>S. uminus (f x)) = - (INF x\<in>S. f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SUP x\<in>S. - f x) = - Inf (f ` S)
[PROOF STEP]
using ereal_Sup_uminus_image_eq [of "f ` S"]
[PROOF STATE]
proof (prove)
using this:
Sup (uminus ` f ` S) = - Inf (f ` S)

goal (1 subgoal):
 1. (SUP x\<in>S. - f x) = - Inf (f ` S)
[PROOF STEP]
by (simp add: image_comp)


[STATEMENT]
lemma prob_long:
  "\<P>((x,\<phi>) in Buffon. needle l x \<phi> \<inter> {-d/2, d/2} \<noteq> {}) =
     2 / pi * ((l / d) - sqrt ((l / d)\<^sup>2 - 1) + arccos (d / l))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob {(x, \<phi>). (x, \<phi>) \<in> space local.Buffon \<and> needle l x \<phi> \<inter> {- d / 2, d / 2} \<noteq> {}} = 2 / pi * (l / d - sqrt ((l / d)\<^sup>2 - 1) + arccos (d / l))
[PROOF STEP]
using prob_long_aux
[PROOF STATE]
proof (prove)
using this:
0 \<le> 2 / pi * (l / d - sqrt ((l / d)\<^sup>2 - 1) + arccos (d / l))
emeasure local.Buffon {(x, \<phi>). needle l x \<phi> \<inter> {- d / 2, d / 2} \<noteq> {}} = ennreal (2 / pi * (l / d - sqrt ((l / d)\<^sup>2 - 1) + arccos (d / l)))

goal (1 subgoal):
 1. prob {(x, \<phi>). (x, \<phi>) \<in> space local.Buffon \<and> needle l x \<phi> \<inter> {- d / 2, d / 2} \<noteq> {}} = 2 / pi * (l / d - sqrt ((l / d)\<^sup>2 - 1) + arccos (d / l))
[PROOF STEP]
unfolding emeasure_eq_measure
[PROOF STATE]
proof (prove)
using this:
0 \<le> 2 / pi * (l / d - sqrt ((l / d)\<^sup>2 - 1) + arccos (d / l))
ennreal (prob {(x, \<phi>). needle l x \<phi> \<inter> {- d / 2, d / 2} \<noteq> {}}) = ennreal (2 / pi * (l / d - sqrt ((l / d)\<^sup>2 - 1) + arccos (d / l)))

goal (1 subgoal):
 1. prob {(x, \<phi>). (x, \<phi>) \<in> space local.Buffon \<and> needle l x \<phi> \<inter> {- d / 2, d / 2} \<noteq> {}} = 2 / pi * (l / d - sqrt ((l / d)\<^sup>2 - 1) + arccos (d / l))
[PROOF STEP]
by (subst (asm) ennreal_inj) simp_all


[STATEMENT]
lemma assumes "q \<noteq> (0::nat)" shows "p \<le> p + q - gcd p q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<le> p + q - gcd p q
[PROOF STEP]
using gcd_le2_nat[OF \<open>q \<noteq> 0\<close>, of p]
[PROOF STATE]
proof (prove)
using this:
gcd p q \<le> q

goal (1 subgoal):
 1. p \<le> p + q - gcd p q
[PROOF STEP]
by linarith


[STATEMENT]
lemma powr_add: "x powr (a + b) = (x powr a) * (x powr b)"
  for a b x :: "'a::{ln,real_normed_field}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x powr (a + b) = x powr a * x powr b
[PROOF STEP]
by (simp add: powr_def exp_add [symmetric] distrib_right)


[STATEMENT]
lemma differentiable_power [simp, derivative_intros]:
  fixes f g :: "'a::real_normed_vector \<Rightarrow> 'b::real_normed_field"
  shows "f differentiable (at x within s) \<Longrightarrow> (\<lambda>x. f x ^ n) differentiable (at x within s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f differentiable at x within s \<Longrightarrow> (\<lambda>x. f x ^ n) differentiable at x within s
[PROOF STEP]
unfolding differentiable_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>D. (f has_derivative D) (at x within s) \<Longrightarrow> \<exists>D. ((\<lambda>x. f x ^ n) has_derivative D) (at x within s)
[PROOF STEP]
by (blast intro: has_derivative_power)


[STATEMENT]
lemma subspace_Inter: "\<forall>s \<in> f. subspace s \<Longrightarrow> subspace (\<Inter>f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ball f subspace \<Longrightarrow> subspace (\<Inter> f)
[PROOF STEP]
unfolding subspace_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>s\<in>f. (0::'b) \<in> s \<and> (\<forall>x\<in>s. \<forall>y\<in>s. x + y \<in> s) \<and> (\<forall>c. \<forall>x\<in>s. c *s x \<in> s) \<Longrightarrow> (0::'b) \<in> \<Inter> f \<and> (\<forall>x\<in>\<Inter> f. \<forall>y\<in>\<Inter> f. x + y \<in> \<Inter> f) \<and> (\<forall>c. \<forall>x\<in>\<Inter> f. c *s x \<in> \<Inter> f)
[PROOF STEP]
by auto


[STATEMENT]
lemma infinity_evalUni_LessUni : "(\<exists>x. \<forall>y<x. aEvalUni (LessUni p) y) = (evalUni (substNegInfinityUni (LessUni p)) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x. \<forall>y<x. aEvalUni (LessUni p) y) = evalUni (substNegInfinityUni (LessUni p)) x
[PROOF STEP]
proof(cases p)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b c. p = (a, b, c) \<Longrightarrow> (\<exists>x. \<forall>y<x. aEvalUni (LessUni p) y) = evalUni (substNegInfinityUni (LessUni p)) x
[PROOF STEP]
case (fields a b c)
[PROOF STATE]
proof (state)
this:
p = (a, b, c)

goal (1 subgoal):
 1. \<And>a b c. p = (a, b, c) \<Longrightarrow> (\<exists>x. \<forall>y<x. aEvalUni (LessUni p) y) = evalUni (substNegInfinityUni (LessUni p)) x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x. \<forall>y<x. aEvalUni (LessUni p) y) = evalUni (substNegInfinityUni (LessUni p)) x
[PROOF STEP]
unfolding fields
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x. \<forall>y<x. aEvalUni (LessUni (a, b, c)) y) = evalUni (substNegInfinityUni (LessUni (a, b, c))) x
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x. \<forall>y<x. a * y\<^sup>2 + b * y + c < 0) = (a < 0 \<or> a = 0 \<and> (0 < b \<or> b = 0 \<and> c < 0))
[PROOF STEP]
using inequality_case[of a b c]
[PROOF STATE]
proof (prove)
using this:
(\<exists>x. \<forall>y<x. a * y\<^sup>2 + b * y + c < 0) = (a < 0 \<or> a = 0 \<and> (0 < b \<or> b = 0 \<and> c < 0))

goal (1 subgoal):
 1. (\<exists>x. \<forall>y<x. a * y\<^sup>2 + b * y + c < 0) = (a < 0 \<or> a = 0 \<and> (0 < b \<or> b = 0 \<and> c < 0))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<exists>x. \<forall>y<x. aEvalUni (LessUni p) y) = evalUni (substNegInfinityUni (LessUni p)) x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma arith2:
  shows "(y::real) \<le> 751/100 \<and> x + (y::real) = 812/100 \<Longrightarrow> 3/5 - (x::real) < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<le> 751 / 100 \<and> x + y = 812 / 100 \<Longrightarrow> 3 / 5 - x < 0
[PROOF STEP]
by linarith


[STATEMENT]
lemma arctan_le_pi4: "\<bar>x\<bar> \<le> 1 \<Longrightarrow> \<bar>arctan x\<bar> \<le> pi/4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>x\<bar> \<le> 1 \<Longrightarrow> \<bar>arctan x\<bar> \<le> pi / 4
[PROOF STEP]
by (metis abs_le_iff arctan_le_iff arctan_minus arctan_one)


[STATEMENT]
lemma in_list_Suc_iff:
  "(xs \<in> list (Suc n) A) = (\<exists>y\<in> A. \<exists>ys\<in> list n A. xs = y#ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (xs \<in> list (Suc n) A) = (\<exists>y\<in>A. \<exists>ys\<in>list n A. xs = y # ys)
[PROOF STEP]
apply (unfold list_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (xs \<in> {xs. length xs = Suc n \<and> set xs \<subseteq> A}) = (\<exists>y\<in>A. \<exists>ys\<in>{xs. length xs = n \<and> set xs \<subseteq> A}. xs = y # ys)
[PROOF STEP]
apply (case_tac "xs")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. xs = [] \<Longrightarrow> (xs \<in> {xs. length xs = Suc n \<and> set xs \<subseteq> A}) = (\<exists>y\<in>A. \<exists>ys\<in>{xs. length xs = n \<and> set xs \<subseteq> A}. xs = y # ys)
 2. \<And>a list. xs = a # list \<Longrightarrow> (xs \<in> {xs. length xs = Suc n \<and> set xs \<subseteq> A}) = (\<exists>y\<in>A. \<exists>ys\<in>{xs. length xs = n \<and> set xs \<subseteq> A}. xs = y # ys)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma norm_cmul_rule_thm:
  fixes x :: "'a::real_normed_vector"
  shows "b \<ge> norm x \<Longrightarrow> \<bar>c\<bar> * b \<ge> norm (scaleR c x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm x \<le> b \<Longrightarrow> norm (c *\<^sub>R x) \<le> \<bar>c\<bar> * b
[PROOF STEP]
unfolding norm_scaleR
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm x \<le> b \<Longrightarrow> \<bar>c\<bar> * norm x \<le> \<bar>c\<bar> * b
[PROOF STEP]
apply (erule mult_left_mono)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> \<bar>c\<bar>
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma open_fls_def:
  "open (S :: 'a::group_add fls set) = (\<forall>a \<in> S. \<exists>r. r >0 \<and> {y. dist y a < r} \<subseteq> S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open S = (\<forall>a\<in>S. \<exists>r>0. {y. dist y a < r} \<subseteq> S)
[PROOF STEP]
unfolding open_dist subset_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x\<in>S. \<exists>e>0. \<forall>y. dist y x < e \<longrightarrow> y \<in> S) = (\<forall>a\<in>S. \<exists>r>0. \<forall>x\<in>{y. dist y a < r}. x \<in> S)
[PROOF STEP]
by simp


[STATEMENT]
lemma poly_scalar_mult_comm:
  assumes "\<one> \<noteq>\<zero>"
  assumes "P \<in> Pring_set R I"
  assumes "a \<in> carrier R"
  assumes "b \<in> carrier R"
  shows "poly_scalar_mult R a (poly_scalar_mult R b P) = poly_scalar_mult R b (poly_scalar_mult R a P)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_scalar_mult R a (poly_scalar_mult R b P) = poly_scalar_mult R b (poly_scalar_mult R a P)
[PROOF STEP]
using assms  poly_scalar_mult_iter m_comm[of a b]
[PROOF STATE]
proof (prove)
using this:
\<one> \<noteq> \<zero>
P \<in> carrier R [\<X>\<^bsub>I\<^esub>]
a \<in> carrier R
b \<in> carrier R
\<lbrakk>\<one> \<noteq> \<zero>; ?P \<in> carrier R [\<X>\<^bsub>?I\<^esub>]; ?k \<in> carrier R; ?n \<in> carrier R\<rbrakk> \<Longrightarrow> poly_scalar_mult R ?k (poly_scalar_mult R ?n ?P) = poly_scalar_mult R (?k \<otimes> ?n) ?P
\<lbrakk>a \<in> carrier R; b \<in> carrier R\<rbrakk> \<Longrightarrow> a \<otimes> b = b \<otimes> a

goal (1 subgoal):
 1. poly_scalar_mult R a (poly_scalar_mult R b P) = poly_scalar_mult R b (poly_scalar_mult R a P)
[PROOF STEP]
by metis


[STATEMENT]
lemma mset_subset_eq_add_mset_cancel: \<open>add_mset a A \<subseteq># add_mset a B \<longleftrightarrow> A \<subseteq># B\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (add_mset a A \<subseteq># add_mset a B) = (A \<subseteq># B)
[PROOF STEP]
unfolding add_mset_add_single[of _ A] add_mset_add_single[of _ B]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A + {#a#} \<subseteq># B + {#a#}) = (A \<subseteq># B)
[PROOF STEP]
by (rule mset_subset_eq_mono_add_right_cancel)


[STATEMENT]
lemma span_sum: "(\<And>x. x \<in> A \<Longrightarrow> f x \<in> span S) \<Longrightarrow> sum f A \<in> span S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> A \<Longrightarrow> f x \<in> span S) \<Longrightarrow> sum f A \<in> span S
[PROOF STEP]
by (rule subspace_sum, rule subspace_span)


[STATEMENT]
lemma setdist_Lipschitz: "\<bar>setdist {x} S - setdist {y} S\<bar> \<le> dist x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>setdist {x} S - setdist {y} S\<bar> \<le> dist x y
[PROOF STEP]
apply (subst setdist_singletons [symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>setdist {x} S - setdist {y} S\<bar> \<le> setdist {x} {y}
[PROOF STEP]
by (metis abs_diff_le_iff diff_le_eq setdist_triangle setdist_sym)


[STATEMENT]
lemma Smith_zero_imp_zero:
  fixes A::"'a::comm_ring_1 mat"
  assumes  A: "A \<in> carrier_mat m n"
    and SNF: "Smith_normal_form_mat A"
    and Aii: "A$$(i,i) = 0"
    and j: "j<min m n"
    and ij: "i\<le>j"
  shows "A$$(j,j) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A $$ (j, j) = (0::'a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A $$ (j, j) = (0::'a)
[PROOF STEP]
have "A$$(i,i) dvd A$$(j,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A $$ (i, i) dvd A $$ (j, j)
[PROOF STEP]
by (rule SNF_divides_diagonal[OF A SNF j ij])
[PROOF STATE]
proof (state)
this:
A $$ (i, i) dvd A $$ (j, j)

goal (1 subgoal):
 1. A $$ (j, j) = (0::'a)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
A $$ (i, i) dvd A $$ (j, j)

goal (1 subgoal):
 1. A $$ (j, j) = (0::'a)
[PROOF STEP]
using Aii
[PROOF STATE]
proof (prove)
using this:
A $$ (i, i) dvd A $$ (j, j)
A $$ (i, i) = (0::'a)

goal (1 subgoal):
 1. A $$ (j, j) = (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A $$ (j, j) = (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma seq_mono_lemma:
  assumes "\<forall>(n::nat) \<ge> m. (d n :: real) < e n"
    and "\<forall>n \<ge> m. e n \<le> e m"
  shows "\<forall>n \<ge> m. d n < e m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n\<ge>m. d n < e m
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>n\<ge>m. d n < e n
\<forall>n\<ge>m. e n \<le> e m

goal (1 subgoal):
 1. \<forall>n\<ge>m. d n < e m
[PROOF STEP]
by force


[STATEMENT]
lemma var_ub:
assumes "matching A M" "M \<subseteq> {<n}" "M \<noteq> {<n}" "\<forall>a<n. preferred A a \<subseteq> match A ` M"
shows "(\<Sum>a<n. A!a) + card M  < n^2 - n + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum ((!) A) {..<n} + card M < n\<^sup>2 - n + 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum ((!) A) {..<n} + card M < n\<^sup>2 - n + 1
[PROOF STEP]
have 1: "M \<subset> {<n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M \<subset> {<n}
[PROOF STEP]
using assms(2,3)
[PROOF STATE]
proof (prove)
using this:
M \<subseteq> {<n}
M \<noteq> {<n}

goal (1 subgoal):
 1. M \<subset> {<n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
M \<subset> {<n}

goal (1 subgoal):
 1. sum ((!) A) {..<n} + card M < n\<^sup>2 - n + 1
[PROOF STEP]
have 2: "card M < n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card M < n
[PROOF STEP]
using psubset_card_mono[OF _ 1]
[PROOF STATE]
proof (prove)
using this:
finite {<n} \<Longrightarrow> card M < card {<n}

goal (1 subgoal):
 1. card M < n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card M < n

goal (1 subgoal):
 1. sum ((!) A) {..<n} + card M < n\<^sup>2 - n + 1
[PROOF STEP]
have 3: "sum ((!) A) {..<n} \<le> n^2 + 1 - 2*n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum ((!) A) {..<n} \<le> n\<^sup>2 + 1 - 2 * n
[PROOF STEP]
using sumA_UB[OF assms(1-4)]
[PROOF STATE]
proof (prove)
using this:
sum ((!) A) {..<n} \<le> (n - 1)\<^sup>2

goal (1 subgoal):
 1. sum ((!) A) {..<n} \<le> n\<^sup>2 + 1 - 2 * n
[PROOF STEP]
by (simp add: power2_eq_square algebra_simps)
[PROOF STATE]
proof (state)
this:
sum ((!) A) {..<n} \<le> n\<^sup>2 + 1 - 2 * n

goal (1 subgoal):
 1. sum ((!) A) {..<n} + card M < n\<^sup>2 - n + 1
[PROOF STEP]
have 4: "2*n \<le> Suc (n^2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * n \<le> Suc (n\<^sup>2)
[PROOF STEP]
using le_square[of n]
[PROOF STATE]
proof (prove)
using this:
n \<le> n * n

goal (1 subgoal):
 1. 2 * n \<le> Suc (n\<^sup>2)
[PROOF STEP]
unfolding power2_eq_square
[PROOF STATE]
proof (prove)
using this:
n \<le> n * n

goal (1 subgoal):
 1. 2 * n \<le> Suc (n * n)
[PROOF STEP]
by (metis Suc_1 add_mono_thms_linordered_semiring(1) le_SucI mult_2 mult_le_mono1 not_less_eq_eq plus_1_eq_Suc)
[PROOF STATE]
proof (state)
this:
2 * n \<le> Suc (n\<^sup>2)

goal (1 subgoal):
 1. sum ((!) A) {..<n} + card M < n\<^sup>2 - n + 1
[PROOF STEP]
show "(\<Sum>a<n. A!a) + card M  < n^2 - n + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum ((!) A) {..<n} + card M < n\<^sup>2 - n + 1
[PROOF STEP]
using 2 3 4
[PROOF STATE]
proof (prove)
using this:
card M < n
sum ((!) A) {..<n} \<le> n\<^sup>2 + 1 - 2 * n
2 * n \<le> Suc (n\<^sup>2)

goal (1 subgoal):
 1. sum ((!) A) {..<n} + card M < n\<^sup>2 - n + 1
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
sum ((!) A) {..<n} + card M < n\<^sup>2 - n + 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma hlog_inverse: "0 < a \<Longrightarrow> a \<noteq> 1 \<Longrightarrow> 0 < x \<Longrightarrow> hlog a (inverse x) = - hlog a x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < a; a \<noteq> 1; 0 < x\<rbrakk> \<Longrightarrow> hlog a (inverse x) = - hlog a x
[PROOF STEP]
by (rule add_left_cancel [of "hlog a x", THEN iffD1]) (simp add: hlog_mult [symmetric])


[STATEMENT]
lemma connected_space_eq:
     "connected_space X \<longleftrightarrow>
      (\<nexists>E1 E2. openin X E1 \<and> openin X E2 \<and> E1 \<union> E2 = topspace X \<and> E1 \<inter> E2 = {} \<and> E1 \<noteq> {} \<and> E2 \<noteq> {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connected_space X = (\<nexists>E1 E2. openin X E1 \<and> openin X E2 \<and> E1 \<union> E2 = topspace X \<and> E1 \<inter> E2 = {} \<and> E1 \<noteq> {} \<and> E2 \<noteq> {})
[PROOF STEP]
unfolding connected_space_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<nexists>E1 E2. openin X E1 \<and> openin X E2 \<and> topspace X \<subseteq> E1 \<union> E2 \<and> E1 \<inter> E2 = {} \<and> E1 \<noteq> {} \<and> E2 \<noteq> {}) = (\<nexists>E1 E2. openin X E1 \<and> openin X E2 \<and> E1 \<union> E2 = topspace X \<and> E1 \<inter> E2 = {} \<and> E1 \<noteq> {} \<and> E2 \<noteq> {})
[PROOF STEP]
by (metis openin_Un openin_subset subset_antisym)


[STATEMENT]
lemma of_int_divide_in_Ints_iff:
  assumes "b \<noteq> 0"
  shows   "(of_int a / of_int b :: 'a :: field_char_0) \<in> \<int> \<longleftrightarrow> b dvd a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (of_int a / of_int b \<in> \<int>) = (b dvd a)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. of_int a / of_int b \<in> \<int> \<Longrightarrow> b dvd a
 2. b dvd a \<Longrightarrow> of_int a / of_int b \<in> \<int>
[PROOF STEP]
assume *: "(of_int a / of_int b :: 'a :: field_char_0) \<in> \<int>"
[PROOF STATE]
proof (state)
this:
of_int a / of_int b \<in> \<int>

goal (2 subgoals):
 1. of_int a / of_int b \<in> \<int> \<Longrightarrow> b dvd a
 2. b dvd a \<Longrightarrow> of_int a / of_int b \<in> \<int>
[PROOF STEP]
from *
[PROOF STATE]
proof (chain)
picking this:
of_int a / of_int b \<in> \<int>
[PROOF STEP]
obtain n where "of_int a / of_int b = (of_int n :: 'a)"
[PROOF STATE]
proof (prove)
using this:
of_int a / of_int b \<in> \<int>

goal (1 subgoal):
 1. (\<And>n. of_int a / of_int b = of_int n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (elim Ints_cases)
[PROOF STATE]
proof (state)
this:
of_int a / of_int b = of_int n

goal (2 subgoals):
 1. of_int a / of_int b \<in> \<int> \<Longrightarrow> b dvd a
 2. b dvd a \<Longrightarrow> of_int a / of_int b \<in> \<int>
[PROOF STEP]
hence "of_int (b * n) = (of_int a :: 'a)"
[PROOF STATE]
proof (prove)
using this:
of_int a / of_int b = of_int n

goal (1 subgoal):
 1. of_int (b * n) = of_int a
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
of_int a / of_int b = of_int n
b \<noteq> 0

goal (1 subgoal):
 1. of_int (b * n) = of_int a
[PROOF STEP]
by (subst of_int_mult) (auto simp: field_simps)
[PROOF STATE]
proof (state)
this:
of_int (b * n) = of_int a

goal (2 subgoals):
 1. of_int a / of_int b \<in> \<int> \<Longrightarrow> b dvd a
 2. b dvd a \<Longrightarrow> of_int a / of_int b \<in> \<int>
[PROOF STEP]
hence "b * n = a"
[PROOF STATE]
proof (prove)
using this:
of_int (b * n) = of_int a

goal (1 subgoal):
 1. b * n = a
[PROOF STEP]
by (subst (asm) of_int_eq_iff)
[PROOF STATE]
proof (state)
this:
b * n = a

goal (2 subgoals):
 1. of_int a / of_int b \<in> \<int> \<Longrightarrow> b dvd a
 2. b dvd a \<Longrightarrow> of_int a / of_int b \<in> \<int>
[PROOF STEP]
thus "b dvd a"
[PROOF STATE]
proof (prove)
using this:
b * n = a

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

goal (1 subgoal):
 1. b dvd a \<Longrightarrow> of_int a / of_int b \<in> \<int>
[PROOF STEP]
qed auto


[STATEMENT]
lemma intersection_number_empty_iff:
  assumes "finite b1"
  shows "b1 \<inter> b2 = {} \<longleftrightarrow> b1 |\<inter>| b2 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (b1 \<inter> b2 = {}) = (b1 |\<inter>| b2 = 0)
[PROOF STEP]
by (simp add: intersection_number_def assms)


[STATEMENT]
lemma integral_reflect[simp]: "integral (cbox (-b) (-a)) (\<lambda>x. f (-x)) = integral (cbox a b) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral (cbox (- b) (- a)) (\<lambda>x. f (- x)) = integral (cbox a b) f
[PROOF STEP]
unfolding integral_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SOME y. ((\<lambda>x. f (- x)) has_integral y) (cbox (- b) (- a)) \<or> \<not> (\<lambda>x. f (- x)) integrable_on cbox (- b) (- a) \<and> y = (0::'a)) = (SOME y. (f has_integral y) (cbox a b) \<or> \<not> f integrable_on cbox a b \<and> y = (0::'a))
[PROOF STEP]
by auto


[STATEMENT]
lemma has_vderiv_on_compose2:
  assumes "(f has_vderiv_on f') S"
  assumes "(g has_vderiv_on g') T"
  assumes "\<And>t. t \<in> T \<Longrightarrow> g t \<in> S"
  shows "((\<lambda>x. f (g x)) has_vderiv_on (\<lambda>x. g' x *\<^sub>R f' (g x))) T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f (g x)) has_vderiv_on (\<lambda>x. g' x *\<^sub>R f' (g x))) T
[PROOF STEP]
using has_vderiv_on_compose[OF has_vderiv_on_subset[OF assms(1)] assms(2)] assms(3)
[PROOF STATE]
proof (prove)
using this:
g ` T \<subseteq> S \<Longrightarrow> (f \<circ> g has_vderiv_on (\<lambda>x. g' x *\<^sub>R f' (g x))) T
?t \<in> T \<Longrightarrow> g ?t \<in> S

goal (1 subgoal):
 1. ((\<lambda>x. f (g x)) has_vderiv_on (\<lambda>x. g' x *\<^sub>R f' (g x))) T
[PROOF STEP]
by force


[STATEMENT]
lemma  f_g_map_foldr_bound:" (\<forall> x \<in> set xs.  f x \<le> c * g x)
 \<Longrightarrow> foldr (\<lambda> a b. a+b) (map f xs) d \<le> c * foldr (\<lambda> a b. a+b) (map g xs) (0::real) + d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>set xs. f x \<le> c * g x \<Longrightarrow> foldr (+) (map f xs) d \<le> c * foldr (+) (map g xs) 0 + d
[PROOF STEP]
by(induction xs) (auto simp add: algebra_simps)


[STATEMENT]
lemma sin_pi_divide_n_gt_0:
  assumes "2 \<le> n"
  shows "0 < sin (pi / real n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < sin (pi / real n)
[PROOF STEP]
by (rule sin_gt_zero) (use assms in \<open>simp_all add: field_split_simps\<close>)


[STATEMENT]
lemma frequently_at: "frequently P (at a within S) \<longleftrightarrow> (\<forall>d>0. \<exists>x\<in>S. x \<noteq> a \<and> dist x a < d \<and> P x)"
  for a :: "'a :: metric_space"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frequently P (at a within S) = (\<forall>d>0. \<exists>x\<in>S. x \<noteq> a \<and> dist x a < d \<and> P x)
[PROOF STEP]
unfolding frequently_def eventually_at
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<not> (\<exists>d>0. \<forall>x\<in>S. x \<noteq> a \<and> dist x a < d \<longrightarrow> \<not> P x)) = (\<forall>d>0. \<exists>x\<in>S. x \<noteq> a \<and> dist x a < d \<and> P x)
[PROOF STEP]
by auto


[STATEMENT]
lemma closed_approachable:
  fixes S :: "'a::metric_space set"
  shows "closed S \<Longrightarrow> (\<forall>e>0. \<exists>y\<in>S. dist y x < e) \<longleftrightarrow> x \<in> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed S \<Longrightarrow> (\<forall>e>0. \<exists>y\<in>S. dist y x < e) = (x \<in> S)
[PROOF STEP]
by (metis closure_closed closure_approachable)


[STATEMENT]
lemma AND_mod: "x AND (2 ^ n - 1) = x mod 2 ^ n"
  for x :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x AND 2 ^ n - 1 = x mod 2 ^ n
[PROOF STEP]
by (simp flip: take_bit_eq_mod add: take_bit_eq_mask mask_eq_exp_minus_1)


[STATEMENT]
lemma calc_ideal_point1_sq:
  assumes "(z1, z2) = calc_ideal_point1_cvec A B" "is_real A" "(cmod B)\<^sup>2 > (cmod A)\<^sup>2"
  shows "z1 * cnj z1 + z2 * cnj z2 = 2 * (B * cnj B)\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z1 * cnj z1 + z2 * cnj z2 = 2 * (B * cnj B)\<^sup>2
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. z1 * cnj z1 + z2 * cnj z2 = 2 * (B * cnj B)\<^sup>2
[PROOF STEP]
let ?discr = "Re ((cmod B)\<^sup>2 - (Re A)\<^sup>2)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. z1 * cnj z1 + z2 * cnj z2 = 2 * (B * cnj B)\<^sup>2
[PROOF STEP]
have "?discr > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < Re (cor ((cmod B)\<^sup>2 - (Re A)\<^sup>2))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(z1, z2) = calc_ideal_point1_cvec A B
is_real A
(cmod A)\<^sup>2 < (cmod B)\<^sup>2

goal (1 subgoal):
 1. 0 < Re (cor ((cmod B)\<^sup>2 - (Re A)\<^sup>2))
[PROOF STEP]
by (simp add: cmod_power2)
[PROOF STATE]
proof (state)
this:
0 < Re (cor ((cmod B)\<^sup>2 - (Re A)\<^sup>2))

goal (1 subgoal):
 1. z1 * cnj z1 + z2 * cnj z2 = 2 * (B * cnj B)\<^sup>2
[PROOF STEP]
have "z1 * cnj z1 = (B * cnj B) * (-A + \<i>*sqrt(?discr))*(-A - \<i>*sqrt(?discr))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z1 * cnj z1 = B * cnj B * (- A + \<i> * cor (sqrt (Re (cor ((cmod B)\<^sup>2 - (Re A)\<^sup>2))))) * (- A - \<i> * cor (sqrt (Re (cor ((cmod B)\<^sup>2 - (Re A)\<^sup>2)))))
[PROOF STEP]
using assms eq_cnj_iff_real[of A]
[PROOF STATE]
proof (prove)
using this:
(z1, z2) = calc_ideal_point1_cvec A B
is_real A
(cmod A)\<^sup>2 < (cmod B)\<^sup>2
(cnj A = A) = is_real A

goal (1 subgoal):
 1. z1 * cnj z1 = B * cnj B * (- A + \<i> * cor (sqrt (Re (cor ((cmod B)\<^sup>2 - (Re A)\<^sup>2))))) * (- A - \<i> * cor (sqrt (Re (cor ((cmod B)\<^sup>2 - (Re A)\<^sup>2)))))
[PROOF STEP]
by (simp)
[PROOF STATE]
proof (state)
this:
z1 * cnj z1 = B * cnj B * (- A + \<i> * cor (sqrt (Re (cor ((cmod B)\<^sup>2 - (Re A)\<^sup>2))))) * (- A - \<i> * cor (sqrt (Re (cor ((cmod B)\<^sup>2 - (Re A)\<^sup>2)))))

goal (1 subgoal):
 1. z1 * cnj z1 + z2 * cnj z2 = 2 * (B * cnj B)\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
z1 * cnj z1 = B * cnj B * (- A + \<i> * cor (sqrt (Re (cor ((cmod B)\<^sup>2 - (Re A)\<^sup>2))))) * (- A - \<i> * cor (sqrt (Re (cor ((cmod B)\<^sup>2 - (Re A)\<^sup>2)))))

goal (1 subgoal):
 1. z1 * cnj z1 + z2 * cnj z2 = 2 * (B * cnj B)\<^sup>2
[PROOF STEP]
have "... = (B * cnj B) * (A\<^sup>2 + ?discr)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B * cnj B * (- A + \<i> * cor (sqrt (Re (cor ((cmod B)\<^sup>2 - (Re A)\<^sup>2))))) * (- A - \<i> * cor (sqrt (Re (cor ((cmod B)\<^sup>2 - (Re A)\<^sup>2))))) = B * cnj B * (A\<^sup>2 + cor (Re (cor ((cmod B)\<^sup>2 - (Re A)\<^sup>2))))
[PROOF STEP]
using complex_of_real_Re[of A] \<open>is_real A\<close> \<open>?discr > 0\<close>
[PROOF STATE]
proof (prove)
using this:
is_real A \<Longrightarrow> cor (Re A) = A
is_real A
0 < Re (cor ((cmod B)\<^sup>2 - (Re A)\<^sup>2))

goal (1 subgoal):
 1. B * cnj B * (- A + \<i> * cor (sqrt (Re (cor ((cmod B)\<^sup>2 - (Re A)\<^sup>2))))) * (- A - \<i> * cor (sqrt (Re (cor ((cmod B)\<^sup>2 - (Re A)\<^sup>2))))) = B * cnj B * (A\<^sup>2 + cor (Re (cor ((cmod B)\<^sup>2 - (Re A)\<^sup>2))))
[PROOF STEP]
by (simp add: power2_eq_square field_simps)
[PROOF STATE]
proof (state)
this:
B * cnj B * (- A + \<i> * cor (sqrt (Re (cor ((cmod B)\<^sup>2 - (Re A)\<^sup>2))))) * (- A - \<i> * cor (sqrt (Re (cor ((cmod B)\<^sup>2 - (Re A)\<^sup>2))))) = B * cnj B * (A\<^sup>2 + cor (Re (cor ((cmod B)\<^sup>2 - (Re A)\<^sup>2))))

goal (1 subgoal):
 1. z1 * cnj z1 + z2 * cnj z2 = 2 * (B * cnj B)\<^sup>2
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
z1 * cnj z1 = B * cnj B * (A\<^sup>2 + cor (Re (cor ((cmod B)\<^sup>2 - (Re A)\<^sup>2))))
[PROOF STEP]
have "z1 * cnj z1 = (B * cnj B)\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
z1 * cnj z1 = B * cnj B * (A\<^sup>2 + cor (Re (cor ((cmod B)\<^sup>2 - (Re A)\<^sup>2))))

goal (1 subgoal):
 1. z1 * cnj z1 = (B * cnj B)\<^sup>2
[PROOF STEP]
using complex_of_real_Re[of "(cmod B)\<^sup>2 - (Re A)\<^sup>2"] complex_of_real_Re[of A] \<open>is_real A\<close>
[PROOF STATE]
proof (prove)
using this:
z1 * cnj z1 = B * cnj B * (A\<^sup>2 + cor (Re (cor ((cmod B)\<^sup>2 - (Re A)\<^sup>2))))
is_real (cor ((cmod B)\<^sup>2 - (Re A)\<^sup>2)) \<Longrightarrow> cor (Re (cor ((cmod B)\<^sup>2 - (Re A)\<^sup>2))) = cor ((cmod B)\<^sup>2 - (Re A)\<^sup>2)
is_real A \<Longrightarrow> cor (Re A) = A
is_real A

goal (1 subgoal):
 1. z1 * cnj z1 = (B * cnj B)\<^sup>2
[PROOF STEP]
using complex_mult_cnj_cmod[of B]
[PROOF STATE]
proof (prove)
using this:
z1 * cnj z1 = B * cnj B * (A\<^sup>2 + cor (Re (cor ((cmod B)\<^sup>2 - (Re A)\<^sup>2))))
is_real (cor ((cmod B)\<^sup>2 - (Re A)\<^sup>2)) \<Longrightarrow> cor (Re (cor ((cmod B)\<^sup>2 - (Re A)\<^sup>2))) = cor ((cmod B)\<^sup>2 - (Re A)\<^sup>2)
is_real A \<Longrightarrow> cor (Re A) = A
is_real A
B * cnj B = cor ((cmod B)\<^sup>2)

goal (1 subgoal):
 1. z1 * cnj z1 = (B * cnj B)\<^sup>2
[PROOF STEP]
by (simp add: power2_eq_square)
[PROOF STATE]
proof (state)
this:
z1 * cnj z1 = (B * cnj B)\<^sup>2

goal (1 subgoal):
 1. z1 * cnj z1 + z2 * cnj z2 = 2 * (B * cnj B)\<^sup>2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
z1 * cnj z1 = (B * cnj B)\<^sup>2

goal (1 subgoal):
 1. z1 * cnj z1 + z2 * cnj z2 = 2 * (B * cnj B)\<^sup>2
[PROOF STEP]
have "z2 * cnj z2 = (B * cnj B)\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z2 * cnj z2 = (B * cnj B)\<^sup>2
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(z1, z2) = calc_ideal_point1_cvec A B
is_real A
(cmod A)\<^sup>2 < (cmod B)\<^sup>2

goal (1 subgoal):
 1. z2 * cnj z2 = (B * cnj B)\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
z2 * cnj z2 = (B * cnj B)\<^sup>2

goal (1 subgoal):
 1. z1 * cnj z1 + z2 * cnj z2 = 2 * (B * cnj B)\<^sup>2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
z1 * cnj z1 = (B * cnj B)\<^sup>2
z2 * cnj z2 = (B * cnj B)\<^sup>2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
z1 * cnj z1 = (B * cnj B)\<^sup>2
z2 * cnj z2 = (B * cnj B)\<^sup>2

goal (1 subgoal):
 1. z1 * cnj z1 + z2 * cnj z2 = 2 * (B * cnj B)\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
z1 * cnj z1 + z2 * cnj z2 = 2 * (B * cnj B)\<^sup>2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem CK_card:
  shows "card {f. CK f} \<le> 14"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {f. CK f} \<le> 14
[PROOF STEP]
by (auto simp: CK_nf CK_nf_set card.insert_remove intro!: le_trans[OF card_Diff1_le])


[STATEMENT]
lemma quat_of_real_inverse_collapse [simp]:
  assumes "c \<noteq> 0"
  shows "quat_of_real c * quat_of_real (inverse c) = 1" "quat_of_real (inverse c) * quat_of_real c = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. quat_of_real c * quat_of_real (inverse c) = 1 &&& quat_of_real (inverse c) * quat_of_real c = 1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
c \<noteq> 0

goal (1 subgoal):
 1. quat_of_real c * quat_of_real (inverse c) = 1 &&& quat_of_real (inverse c) * quat_of_real c = 1
[PROOF STEP]
by auto


[STATEMENT]
lemma tendsto_rabs_zero_cancel: "((\<lambda>x. \<bar>f x\<bar>) \<longlongrightarrow> (0::real)) F \<Longrightarrow> (f \<longlongrightarrow> 0) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. \<bar>f x\<bar>) \<longlongrightarrow> 0) F \<Longrightarrow> (f \<longlongrightarrow> 0) F
[PROOF STEP]
by (fold real_norm_def) (rule tendsto_norm_zero_cancel)


[STATEMENT]
lemma exp_integer_2pi:
  assumes "n \<in> \<int>"
  shows "exp((2 * n * pi) * \<i>) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp (complex_of_real (2 * n * pi) * \<i>) = 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. exp (complex_of_real (2 * n * pi) * \<i>) = 1
[PROOF STEP]
have "exp((2 * n * pi) * \<i>) = exp 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp (complex_of_real (2 * n * pi) * \<i>) = exp 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
n \<in> \<int>

goal (1 subgoal):
 1. exp (complex_of_real (2 * n * pi) * \<i>) = exp 0
[PROOF STEP]
unfolding Ints_def exp_eq
[PROOF STATE]
proof (prove)
using this:
n \<in> range real_of_int

goal (1 subgoal):
 1. \<exists>na. complex_of_real (2 * n * pi) * \<i> = 0 + complex_of_real (real_of_int (2 * na) * pi) * \<i>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
exp (complex_of_real (2 * n * pi) * \<i>) = exp 0

goal (1 subgoal):
 1. exp (complex_of_real (2 * n * pi) * \<i>) = 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
exp (complex_of_real (2 * n * pi) * \<i>) = exp 0

goal (1 subgoal):
 1. exp (complex_of_real (2 * n * pi) * \<i>) = 1
[PROOF STEP]
have "\<dots> = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp 0 = 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
exp 0 = 1

goal (1 subgoal):
 1. exp (complex_of_real (2 * n * pi) * \<i>) = 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
exp (complex_of_real (2 * n * pi) * \<i>) = 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
exp (complex_of_real (2 * n * pi) * \<i>) = 1

goal (1 subgoal):
 1. exp (complex_of_real (2 * n * pi) * \<i>) = 1
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
exp (complex_of_real (2 * n * pi) * \<i>) = 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lcm_gcd_prod: "lcm a b * gcd a b = normalize (a * b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lcm a b * gcd a b = normalize (a * b)
[PROOF STEP]
by (simp add: lcm_gcd dvd_normalize_div normalize_mult)


[STATEMENT]
lemma mat1_vert_wall_right:
assumes "is_tangle_diagram b"
shows
"rat_poly.matrix_mult  (kauff_mat b) (blockmat (make_vert_block (nat (codomain_wall b))))
             = (kauff_mat b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_poly.matrix_mult (kauff_mat b) (blockmat (make_vert_block (nat (codomain_wall b)))) = kauff_mat b
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rat_poly.matrix_mult (kauff_mat b) (blockmat (make_vert_block (nat (codomain_wall b)))) = kauff_mat b
[PROOF STEP]
have "mat (rat_poly.row_length (kauff_mat b)) (2^(nat (codomain_wall b))) (kauff_mat b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat (rat_poly.row_length (kauff_mat b)) (2 ^ nat (codomain_wall b)) (kauff_mat b)
[PROOF STEP]
by (metis assms matrix_kauff_mat)
[PROOF STATE]
proof (state)
this:
mat (rat_poly.row_length (kauff_mat b)) (2 ^ nat (codomain_wall b)) (kauff_mat b)

goal (1 subgoal):
 1. rat_poly.matrix_mult (kauff_mat b) (blockmat (make_vert_block (nat (codomain_wall b)))) = kauff_mat b
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
mat (rat_poly.row_length (kauff_mat b)) (2 ^ nat (codomain_wall b)) (kauff_mat b)

goal (1 subgoal):
 1. rat_poly.matrix_mult (kauff_mat b) (blockmat (make_vert_block (nat (codomain_wall b)))) = kauff_mat b
[PROOF STEP]
have "(blockmat (make_vert_block (nat (codomain_wall b))))
                       = mat1 (2^(nat (codomain_wall b)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. blockmat (make_vert_block (nat (codomain_wall b))) = mat1 (2 ^ nat (codomain_wall b))
[PROOF STEP]
using make_vert_block_map_blockmat
[PROOF STATE]
proof (prove)
using this:
blockmat (make_vert_block ?n) = mat1 (2 ^ ?n)

goal (1 subgoal):
 1. blockmat (make_vert_block (nat (codomain_wall b))) = mat1 (2 ^ nat (codomain_wall b))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
blockmat (make_vert_block (nat (codomain_wall b))) = mat1 (2 ^ nat (codomain_wall b))

goal (1 subgoal):
 1. rat_poly.matrix_mult (kauff_mat b) (blockmat (make_vert_block (nat (codomain_wall b)))) = kauff_mat b
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
mat (rat_poly.row_length (kauff_mat b)) (2 ^ nat (codomain_wall b)) (kauff_mat b)
blockmat (make_vert_block (nat (codomain_wall b))) = mat1 (2 ^ nat (codomain_wall b))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
mat (rat_poly.row_length (kauff_mat b)) (2 ^ nat (codomain_wall b)) (kauff_mat b)
blockmat (make_vert_block (nat (codomain_wall b))) = mat1 (2 ^ nat (codomain_wall b))

goal (1 subgoal):
 1. rat_poly.matrix_mult (kauff_mat b) (blockmat (make_vert_block (nat (codomain_wall b)))) = kauff_mat b
[PROOF STEP]
by (metis mat1_rt_mult)
[PROOF STATE]
proof (state)
this:
rat_poly.matrix_mult (kauff_mat b) (blockmat (make_vert_block (nat (codomain_wall b)))) = kauff_mat b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma isometry_subset_subspace:
  fixes S :: "'a::euclidean_space set"
    and T :: "'b::euclidean_space set"
  assumes S: "subspace S"
      and T: "subspace T"
      and d: "dim S \<le> dim T"
  obtains f where "linear f" "f ` S \<subseteq> T" "\<And>x. x \<in> S \<Longrightarrow> norm(f x) = norm x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>f. \<lbrakk>linear f; f ` S \<subseteq> T; \<And>x. x \<in> S \<Longrightarrow> norm (f x) = norm x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>f. \<lbrakk>linear f; f ` S \<subseteq> T; \<And>x. x \<in> S \<Longrightarrow> norm (f x) = norm x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
obtain B where "B \<subseteq> S" and Borth: "pairwise orthogonal B"
             and B1: "\<And>x. x \<in> B \<Longrightarrow> norm x = 1"
             and "independent B" "finite B" "card B = dim S" "span B = S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>B. \<lbrakk>B \<subseteq> S; pairwise orthogonal B; \<And>x. x \<in> B \<Longrightarrow> norm x = 1; independent B; finite B; card B = dim S; span B = S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis orthonormal_basis_subspace [OF S] independent_finite)
[PROOF STATE]
proof (state)
this:
B \<subseteq> S
pairwise orthogonal B
?x \<in> B \<Longrightarrow> norm ?x = 1
independent B
finite B
card B = dim S
span B = S

goal (1 subgoal):
 1. (\<And>f. \<lbrakk>linear f; f ` S \<subseteq> T; \<And>x. x \<in> S \<Longrightarrow> norm (f x) = norm x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
obtain C where "C \<subseteq> T" and Corth: "pairwise orthogonal C"
             and C1:"\<And>x. x \<in> C \<Longrightarrow> norm x = 1"
             and "independent C" "finite C" "card C = dim T" "span C = T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>C. \<lbrakk>C \<subseteq> T; pairwise orthogonal C; \<And>x. x \<in> C \<Longrightarrow> norm x = 1; independent C; finite C; card C = dim T; span C = T\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis orthonormal_basis_subspace [OF T] independent_finite)
[PROOF STATE]
proof (state)
this:
C \<subseteq> T
pairwise orthogonal C
?x \<in> C \<Longrightarrow> norm ?x = 1
independent C
finite C
card C = dim T
span C = T

goal (1 subgoal):
 1. (\<And>f. \<lbrakk>linear f; f ` S \<subseteq> T; \<And>x. x \<in> S \<Longrightarrow> norm (f x) = norm x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
obtain fb where "fb ` B \<subseteq> C" "inj_on fb B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>fb. \<lbrakk>fb ` B \<subseteq> C; inj_on fb B\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis \<open>card B = dim S\<close> \<open>card C = dim T\<close> \<open>finite B\<close> \<open>finite C\<close> card_le_inj d)
[PROOF STATE]
proof (state)
this:
fb ` B \<subseteq> C
inj_on fb B

goal (1 subgoal):
 1. (\<And>f. \<lbrakk>linear f; f ` S \<subseteq> T; \<And>x. x \<in> S \<Longrightarrow> norm (f x) = norm x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
fb ` B \<subseteq> C
inj_on fb B
[PROOF STEP]
have pairwise_orth_fb: "pairwise (\<lambda>v j. orthogonal (fb v) (fb j)) B"
[PROOF STATE]
proof (prove)
using this:
fb ` B \<subseteq> C
inj_on fb B

goal (1 subgoal):
 1. pairwise (\<lambda>v j. orthogonal (fb v) (fb j)) B
[PROOF STEP]
using Corth
[PROOF STATE]
proof (prove)
using this:
fb ` B \<subseteq> C
inj_on fb B
pairwise orthogonal C

goal (1 subgoal):
 1. pairwise (\<lambda>v j. orthogonal (fb v) (fb j)) B
[PROOF STEP]
unfolding pairwise_def inj_on_def
[PROOF STATE]
proof (prove)
using this:
fb ` B \<subseteq> C
\<forall>x\<in>B. \<forall>y\<in>B. fb x = fb y \<longrightarrow> x = y
\<forall>x\<in>C. \<forall>y\<in>C. x \<noteq> y \<longrightarrow> orthogonal x y

goal (1 subgoal):
 1. \<forall>x\<in>B. \<forall>y\<in>B. x \<noteq> y \<longrightarrow> orthogonal (fb x) (fb y)
[PROOF STEP]
by (blast intro: orthogonal_clauses)
[PROOF STATE]
proof (state)
this:
pairwise (\<lambda>v j. orthogonal (fb v) (fb j)) B

goal (1 subgoal):
 1. (\<And>f. \<lbrakk>linear f; f ` S \<subseteq> T; \<And>x. x \<in> S \<Longrightarrow> norm (f x) = norm x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
obtain f where "linear f" and ffb: "\<And>x. x \<in> B \<Longrightarrow> f x = fb x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>f. \<lbrakk>linear f; \<And>x. x \<in> B \<Longrightarrow> f x = fb x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using linear_independent_extend \<open>independent B\<close>
[PROOF STATE]
proof (prove)
using this:
independent ?B \<Longrightarrow> \<exists>g. linear g \<and> (\<forall>x\<in>?B. g x = ?f x)
independent B

goal (1 subgoal):
 1. (\<And>f. \<lbrakk>linear f; \<And>x. x \<in> B \<Longrightarrow> f x = fb x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
linear f
?x \<in> B \<Longrightarrow> f ?x = fb ?x

goal (1 subgoal):
 1. (\<And>f. \<lbrakk>linear f; f ` S \<subseteq> T; \<And>x. x \<in> S \<Longrightarrow> norm (f x) = norm x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "span (f ` B) \<subseteq> span C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. span (f ` B) \<subseteq> span C
[PROOF STEP]
by (metis \<open>fb ` B \<subseteq> C\<close> ffb image_cong span_mono)
[PROOF STATE]
proof (state)
this:
span (f ` B) \<subseteq> span C

goal (1 subgoal):
 1. (\<And>f. \<lbrakk>linear f; f ` S \<subseteq> T; \<And>x. x \<in> S \<Longrightarrow> norm (f x) = norm x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
span (f ` B) \<subseteq> span C
[PROOF STEP]
have "f ` S \<subseteq> T"
[PROOF STATE]
proof (prove)
using this:
span (f ` B) \<subseteq> span C

goal (1 subgoal):
 1. f ` S \<subseteq> T
[PROOF STEP]
unfolding \<open>span B = S\<close> \<open>span C = T\<close> span_linear_image[OF \<open>linear f\<close>]
[PROOF STATE]
proof (prove)
using this:
f ` S \<subseteq> T

goal (1 subgoal):
 1. f ` S \<subseteq> T
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
f ` S \<subseteq> T

goal (1 subgoal):
 1. (\<And>f. \<lbrakk>linear f; f ` S \<subseteq> T; \<And>x. x \<in> S \<Longrightarrow> norm (f x) = norm x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have [simp]: "\<And>x. x \<in> B \<Longrightarrow> norm (fb x) = norm x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> B \<Longrightarrow> norm (fb x) = norm x
[PROOF STEP]
using B1 C1 \<open>fb ` B \<subseteq> C\<close>
[PROOF STATE]
proof (prove)
using this:
?x \<in> B \<Longrightarrow> norm ?x = 1
?x \<in> C \<Longrightarrow> norm ?x = 1
fb ` B \<subseteq> C

goal (1 subgoal):
 1. \<And>x. x \<in> B \<Longrightarrow> norm (fb x) = norm x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?x \<in> B \<Longrightarrow> norm (fb ?x) = norm ?x

goal (1 subgoal):
 1. (\<And>f. \<lbrakk>linear f; f ` S \<subseteq> T; \<And>x. x \<in> S \<Longrightarrow> norm (f x) = norm x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "norm (f x) = norm x" if "x \<in> S" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (f x) = norm x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. norm (f x) = norm x
[PROOF STEP]
interpret linear f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. linear f
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. norm (f x) = norm x
[PROOF STEP]
obtain a where x: "x = (\<Sum>v \<in> B. a v *\<^sub>R v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a. x = (\<Sum>v\<in>B. a v *\<^sub>R v) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>finite B\<close> \<open>span B = S\<close> \<open>x \<in> S\<close> span_finite
[PROOF STATE]
proof (prove)
using this:
finite B
span B = S
x \<in> S
finite ?S \<Longrightarrow> span ?S = range (\<lambda>u. \<Sum>v\<in>?S. u v *\<^sub>R v)

goal (1 subgoal):
 1. (\<And>a. x = (\<Sum>v\<in>B. a v *\<^sub>R v) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
x = (\<Sum>v\<in>B. a v *\<^sub>R v)

goal (1 subgoal):
 1. norm (f x) = norm x
[PROOF STEP]
have "norm (f x)^2 = norm (\<Sum>v\<in>B. a v *\<^sub>R fb v)^2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (norm (f x))\<^sup>2 = (norm (\<Sum>v\<in>B. a v *\<^sub>R fb v))\<^sup>2
[PROOF STEP]
by (simp add: sum scale ffb x)
[PROOF STATE]
proof (state)
this:
(norm (f x))\<^sup>2 = (norm (\<Sum>v\<in>B. a v *\<^sub>R fb v))\<^sup>2

goal (1 subgoal):
 1. norm (f x) = norm x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(norm (f x))\<^sup>2 = (norm (\<Sum>v\<in>B. a v *\<^sub>R fb v))\<^sup>2

goal (1 subgoal):
 1. norm (f x) = norm x
[PROOF STEP]
have "\<dots> = (\<Sum>v\<in>B. norm ((a v *\<^sub>R fb v))^2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (norm (\<Sum>v\<in>B. a v *\<^sub>R fb v))\<^sup>2 = (\<Sum>v\<in>B. (norm (a v *\<^sub>R fb v))\<^sup>2)
[PROOF STEP]
proof (rule norm_sum_Pythagorean [OF \<open>finite B\<close>])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pairwise (\<lambda>v j. orthogonal (a v *\<^sub>R fb v) (a j *\<^sub>R fb j)) B
[PROOF STEP]
show "pairwise (\<lambda>v j. orthogonal (a v *\<^sub>R fb v) (a j *\<^sub>R fb j)) B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pairwise (\<lambda>v j. orthogonal (a v *\<^sub>R fb v) (a j *\<^sub>R fb j)) B
[PROOF STEP]
by (rule pairwise_ortho_scaleR [OF pairwise_orth_fb])
[PROOF STATE]
proof (state)
this:
pairwise (\<lambda>v j. orthogonal (a v *\<^sub>R fb v) (a j *\<^sub>R fb j)) B

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(norm (\<Sum>v\<in>B. a v *\<^sub>R fb v))\<^sup>2 = (\<Sum>v\<in>B. (norm (a v *\<^sub>R fb v))\<^sup>2)

goal (1 subgoal):
 1. norm (f x) = norm x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(norm (\<Sum>v\<in>B. a v *\<^sub>R fb v))\<^sup>2 = (\<Sum>v\<in>B. (norm (a v *\<^sub>R fb v))\<^sup>2)

goal (1 subgoal):
 1. norm (f x) = norm x
[PROOF STEP]
have "\<dots> = norm x ^2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>v\<in>B. (norm (a v *\<^sub>R fb v))\<^sup>2) = (norm x)\<^sup>2
[PROOF STEP]
by (simp add: x pairwise_ortho_scaleR Borth norm_sum_Pythagorean [OF \<open>finite B\<close>])
[PROOF STATE]
proof (state)
this:
(\<Sum>v\<in>B. (norm (a v *\<^sub>R fb v))\<^sup>2) = (norm x)\<^sup>2

goal (1 subgoal):
 1. norm (f x) = norm x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(norm (f x))\<^sup>2 = (norm x)\<^sup>2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(norm (f x))\<^sup>2 = (norm x)\<^sup>2

goal (1 subgoal):
 1. norm (f x) = norm x
[PROOF STEP]
by (simp add: norm_eq_sqrt_inner)
[PROOF STATE]
proof (state)
this:
norm (f x) = norm x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?x \<in> S \<Longrightarrow> norm (f ?x) = norm ?x

goal (1 subgoal):
 1. (\<And>f. \<lbrakk>linear f; f ` S \<subseteq> T; \<And>x. x \<in> S \<Longrightarrow> norm (f x) = norm x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?x \<in> S \<Longrightarrow> norm (f ?x) = norm ?x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
?x \<in> S \<Longrightarrow> norm (f ?x) = norm ?x

goal (1 subgoal):
 1. thesis
[PROOF STEP]
by (rule that [OF \<open>linear f\<close> \<open>f ` S \<subseteq> T\<close>])
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma all_countable_subset_image:
   "(\<forall>T. countable T \<and> T \<subseteq> f ` S \<longrightarrow> P T) \<longleftrightarrow> (\<forall>T. countable T \<and> T \<subseteq> S \<longrightarrow> P(f ` T))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>T. countable T \<and> T \<subseteq> f ` S \<longrightarrow> P T) = (\<forall>T. countable T \<and> T \<subseteq> S \<longrightarrow> P (f ` T))
[PROOF STEP]
by (metis countable_subset_image)


[STATEMENT]
lemma card_stabilizer_le:
  assumes "A \<subseteq> G" and "finite A" and "A \<noteq> {}"
  shows "card (stabilizer A) \<le> card A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (stabilizer A) \<le> card A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> G
finite A
A \<noteq> {}

goal (1 subgoal):
 1. card (stabilizer A) \<le> card A
[PROOF STEP]
by (metis card_le_sumset finite.cases insertCI insert_subset stabilizer_finite
    stabilizer_subset_group sumset_commute sumset_stabilizer_eq_self)


[STATEMENT]
lemma emeasure_std_simplex_aux:
  fixes t :: real
  assumes "finite (A :: 'a set)" "t \<ge> 0"
  shows   "emeasure (Pi\<^sub>M A (\<lambda>_. lborel))
             (S A t \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) = t ^ card A / fact (card A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure (Pi\<^sub>M A (\<lambda>_. lborel)) (S A t \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) = ennreal (t ^ card A / fact (card A))
[PROOF STEP]
using assms(1,2)
[PROOF STATE]
proof (prove)
using this:
finite A
0 \<le> t

goal (1 subgoal):
 1. emeasure (Pi\<^sub>M A (\<lambda>_. lborel)) (S A t \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) = ennreal (t ^ card A / fact (card A))
[PROOF STEP]
proof (induction arbitrary: t rule: finite_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>t. 0 \<le> t \<Longrightarrow> emeasure (Pi\<^sub>M {} (\<lambda>_. lborel)) (S {} t \<inter> space (Pi\<^sub>M {} (\<lambda>_. lborel))) = ennreal (t ^ card {} / fact (card {}))
 2. \<And>x F t. \<lbrakk>finite F; x \<notin> F; \<And>t. 0 \<le> t \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) (S F t \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (t ^ card F / fact (card F)); 0 \<le> t\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) (S (insert x F) t \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (t ^ card (insert x F) / fact (card (insert x F)))
[PROOF STEP]
case (empty t)
[PROOF STATE]
proof (state)
this:
0 \<le> t

goal (2 subgoals):
 1. \<And>t. 0 \<le> t \<Longrightarrow> emeasure (Pi\<^sub>M {} (\<lambda>_. lborel)) (S {} t \<inter> space (Pi\<^sub>M {} (\<lambda>_. lborel))) = ennreal (t ^ card {} / fact (card {}))
 2. \<And>x F t. \<lbrakk>finite F; x \<notin> F; \<And>t. 0 \<le> t \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) (S F t \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (t ^ card F / fact (card F)); 0 \<le> t\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) (S (insert x F) t \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (t ^ card (insert x F) / fact (card (insert x F)))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
0 \<le> t

goal (1 subgoal):
 1. emeasure (Pi\<^sub>M {} (\<lambda>_. lborel)) (S {} t \<inter> space (Pi\<^sub>M {} (\<lambda>_. lborel))) = ennreal (t ^ card {} / fact (card {}))
[PROOF STEP]
by (simp add: PiM_empty S_def)
[PROOF STATE]
proof (state)
this:
emeasure (Pi\<^sub>M {} (\<lambda>_. lborel)) (S {} t \<inter> space (Pi\<^sub>M {} (\<lambda>_. lborel))) = ennreal (t ^ card {} / fact (card {}))

goal (1 subgoal):
 1. \<And>x F t. \<lbrakk>finite F; x \<notin> F; \<And>t. 0 \<le> t \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) (S F t \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (t ^ card F / fact (card F)); 0 \<le> t\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) (S (insert x F) t \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (t ^ card (insert x F) / fact (card (insert x F)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F t. \<lbrakk>finite F; x \<notin> F; \<And>t. 0 \<le> t \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) (S F t \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (t ^ card F / fact (card F)); 0 \<le> t\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) (S (insert x F) t \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (t ^ card (insert x F) / fact (card (insert x F)))
[PROOF STEP]
case (insert b A t)
[PROOF STATE]
proof (state)
this:
finite A
b \<notin> A
0 \<le> ?t \<Longrightarrow> emeasure (Pi\<^sub>M A (\<lambda>_. lborel)) (S A ?t \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) = ennreal (?t ^ card A / fact (card A))
0 \<le> t

goal (1 subgoal):
 1. \<And>x F t. \<lbrakk>finite F; x \<notin> F; \<And>t. 0 \<le> t \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) (S F t \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (t ^ card F / fact (card F)); 0 \<le> t\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) (S (insert x F) t \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (t ^ card (insert x F) / fact (card (insert x F)))
[PROOF STEP]
define n where "n = Suc (card A)"
[PROOF STATE]
proof (state)
this:
n = Suc (card A)

goal (1 subgoal):
 1. \<And>x F t. \<lbrakk>finite F; x \<notin> F; \<And>t. 0 \<le> t \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) (S F t \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (t ^ card F / fact (card F)); 0 \<le> t\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) (S (insert x F) t \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (t ^ card (insert x F) / fact (card (insert x F)))
[PROOF STEP]
have n_pos: "n > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n
[PROOF STEP]
by (simp add: n_def)
[PROOF STATE]
proof (state)
this:
0 < n

goal (1 subgoal):
 1. \<And>x F t. \<lbrakk>finite F; x \<notin> F; \<And>t. 0 \<le> t \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) (S F t \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (t ^ card F / fact (card F)); 0 \<le> t\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) (S (insert x F) t \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (t ^ card (insert x F) / fact (card (insert x F)))
[PROOF STEP]
let ?M = "\<lambda>A. (Pi\<^sub>M A (\<lambda>_. lborel))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F t. \<lbrakk>finite F; x \<notin> F; \<And>t. 0 \<le> t \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) (S F t \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (t ^ card F / fact (card F)); 0 \<le> t\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) (S (insert x F) t \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (t ^ card (insert x F) / fact (card (insert x F)))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F t. \<lbrakk>finite F; x \<notin> F; \<And>t. 0 \<le> t \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) (S F t \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (t ^ card F / fact (card F)); 0 \<le> t\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) (S (insert x F) t \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (t ^ card (insert x F) / fact (card (insert x F)))
[PROOF STEP]
fix A :: "'a set" and t :: real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F t. \<lbrakk>finite F; x \<notin> F; \<And>t. 0 \<le> t \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) (S F t \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (t ^ card F / fact (card F)); 0 \<le> t\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) (S (insert x F) t \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (t ^ card (insert x F) / fact (card (insert x F)))
[PROOF STEP]
assume "finite A"
[PROOF STATE]
proof (state)
this:
finite A

goal (1 subgoal):
 1. \<And>x F t. \<lbrakk>finite F; x \<notin> F; \<And>t. 0 \<le> t \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) (S F t \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (t ^ card F / fact (card F)); 0 \<le> t\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) (S (insert x F) t \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (t ^ card (insert x F) / fact (card (insert x F)))
[PROOF STEP]
have "S A t \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel)) =
            Pi\<^sub>E A (\<lambda>_. {0..}) \<inter> (\<lambda>x. sum x A) -` {..t} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S A t \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel)) = (A \<rightarrow>\<^sub>E {0..}) \<inter> (\<lambda>x. sum x A) -` {..t} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))
[PROOF STEP]
by (auto simp: S_def space_PiM)
[PROOF STATE]
proof (state)
this:
S A t \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel)) = (A \<rightarrow>\<^sub>E {0..}) \<inter> (\<lambda>x. sum x A) -` {..t} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))

goal (1 subgoal):
 1. \<And>x F t. \<lbrakk>finite F; x \<notin> F; \<And>t. 0 \<le> t \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) (S F t \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (t ^ card F / fact (card F)); 0 \<le> t\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) (S (insert x F) t \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (t ^ card (insert x F) / fact (card (insert x F)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
S A t \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel)) = (A \<rightarrow>\<^sub>E {0..}) \<inter> (\<lambda>x. sum x A) -` {..t} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))

goal (1 subgoal):
 1. \<And>x F t. \<lbrakk>finite F; x \<notin> F; \<And>t. 0 \<le> t \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) (S F t \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (t ^ card F / fact (card F)); 0 \<le> t\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) (S (insert x F) t \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (t ^ card (insert x F) / fact (card (insert x F)))
[PROOF STEP]
have "\<dots> \<in> sets (Pi\<^sub>M A (\<lambda>_. lborel))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A \<rightarrow>\<^sub>E {0..}) \<inter> (\<lambda>x. sum x A) -` {..t} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel)) \<in> sets (Pi\<^sub>M A (\<lambda>_. lborel))
[PROOF STEP]
using \<open>finite A\<close>
[PROOF STATE]
proof (prove)
using this:
finite A

goal (1 subgoal):
 1. (A \<rightarrow>\<^sub>E {0..}) \<inter> (\<lambda>x. sum x A) -` {..t} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel)) \<in> sets (Pi\<^sub>M A (\<lambda>_. lborel))
[PROOF STEP]
by measurable
[PROOF STATE]
proof (state)
this:
(A \<rightarrow>\<^sub>E {0..}) \<inter> (\<lambda>x. sum x A) -` {..t} \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel)) \<in> sets (Pi\<^sub>M A (\<lambda>_. lborel))

goal (1 subgoal):
 1. \<And>x F t. \<lbrakk>finite F; x \<notin> F; \<And>t. 0 \<le> t \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) (S F t \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (t ^ card F / fact (card F)); 0 \<le> t\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) (S (insert x F) t \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (t ^ card (insert x F) / fact (card (insert x F)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
S A t \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel)) \<in> sets (Pi\<^sub>M A (\<lambda>_. lborel))
[PROOF STEP]
have "S A t \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel)) \<in> sets (Pi\<^sub>M A (\<lambda>_. lborel))"
[PROOF STATE]
proof (prove)
using this:
S A t \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel)) \<in> sets (Pi\<^sub>M A (\<lambda>_. lborel))

goal (1 subgoal):
 1. S A t \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel)) \<in> sets (Pi\<^sub>M A (\<lambda>_. lborel))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
S A t \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel)) \<in> sets (Pi\<^sub>M A (\<lambda>_. lborel))

goal (1 subgoal):
 1. \<And>x F t. \<lbrakk>finite F; x \<notin> F; \<And>t. 0 \<le> t \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) (S F t \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (t ^ card F / fact (card F)); 0 \<le> t\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) (S (insert x F) t \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (t ^ card (insert x F) / fact (card (insert x F)))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
finite ?Ab3 \<Longrightarrow> S ?Ab3 ?tb3 \<inter> space (Pi\<^sub>M ?Ab3 (\<lambda>_. lborel)) \<in> sets (Pi\<^sub>M ?Ab3 (\<lambda>_. lborel))

goal (1 subgoal):
 1. \<And>x F t. \<lbrakk>finite F; x \<notin> F; \<And>t. 0 \<le> t \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) (S F t \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (t ^ card F / fact (card F)); 0 \<le> t\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) (S (insert x F) t \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (t ^ card (insert x F) / fact (card (insert x F)))
[PROOF STEP]
note meas [measurable] = this
[PROOF STATE]
proof (state)
this:
finite ?Ab3 \<Longrightarrow> S ?Ab3 ?tb3 \<inter> space (Pi\<^sub>M ?Ab3 (\<lambda>_. lborel)) \<in> sets (Pi\<^sub>M ?Ab3 (\<lambda>_. lborel))

goal (1 subgoal):
 1. \<And>x F t. \<lbrakk>finite F; x \<notin> F; \<And>t. 0 \<le> t \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) (S F t \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (t ^ card F / fact (card F)); 0 \<le> t\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) (S (insert x F) t \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (t ^ card (insert x F) / fact (card (insert x F)))
[PROOF STEP]
interpret product_sigma_finite "\<lambda>_. lborel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. product_sigma_finite (\<lambda>_. lborel)
[PROOF STEP]
by standard
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F t. \<lbrakk>finite F; x \<notin> F; \<And>t. 0 \<le> t \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) (S F t \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (t ^ card F / fact (card F)); 0 \<le> t\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) (S (insert x F) t \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (t ^ card (insert x F) / fact (card (insert x F)))
[PROOF STEP]
have "emeasure (?M (insert b A)) (S (insert b A) t \<inter> space (?M (insert b A))) =
        nn_integral (?M (insert b A))
          (\<lambda>x. indicator (S (insert b A) t \<inter> space (?M (insert b A))) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure (Pi\<^sub>M (insert b A) (\<lambda>_. lborel)) (S (insert b A) t \<inter> space (Pi\<^sub>M (insert b A) (\<lambda>_. lborel))) = integral\<^sup>N (Pi\<^sub>M (insert b A) (\<lambda>_. lborel)) (indicator (S (insert b A) t \<inter> space (Pi\<^sub>M (insert b A) (\<lambda>_. lborel))))
[PROOF STEP]
using insert.hyps
[PROOF STATE]
proof (prove)
using this:
finite A
b \<notin> A

goal (1 subgoal):
 1. emeasure (Pi\<^sub>M (insert b A) (\<lambda>_. lborel)) (S (insert b A) t \<inter> space (Pi\<^sub>M (insert b A) (\<lambda>_. lborel))) = integral\<^sup>N (Pi\<^sub>M (insert b A) (\<lambda>_. lborel)) (indicator (S (insert b A) t \<inter> space (Pi\<^sub>M (insert b A) (\<lambda>_. lborel))))
[PROOF STEP]
by (subst nn_integral_indicator) auto
[PROOF STATE]
proof (state)
this:
emeasure (Pi\<^sub>M (insert b A) (\<lambda>_. lborel)) (S (insert b A) t \<inter> space (Pi\<^sub>M (insert b A) (\<lambda>_. lborel))) = integral\<^sup>N (Pi\<^sub>M (insert b A) (\<lambda>_. lborel)) (indicator (S (insert b A) t \<inter> space (Pi\<^sub>M (insert b A) (\<lambda>_. lborel))))

goal (1 subgoal):
 1. \<And>x F t. \<lbrakk>finite F; x \<notin> F; \<And>t. 0 \<le> t \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) (S F t \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (t ^ card F / fact (card F)); 0 \<le> t\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) (S (insert x F) t \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (t ^ card (insert x F) / fact (card (insert x F)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
emeasure (Pi\<^sub>M (insert b A) (\<lambda>_. lborel)) (S (insert b A) t \<inter> space (Pi\<^sub>M (insert b A) (\<lambda>_. lborel))) = integral\<^sup>N (Pi\<^sub>M (insert b A) (\<lambda>_. lborel)) (indicator (S (insert b A) t \<inter> space (Pi\<^sub>M (insert b A) (\<lambda>_. lborel))))

goal (1 subgoal):
 1. \<And>x F t. \<lbrakk>finite F; x \<notin> F; \<And>t. 0 \<le> t \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) (S F t \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (t ^ card F / fact (card F)); 0 \<le> t\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) (S (insert x F) t \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (t ^ card (insert x F) / fact (card (insert x F)))
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+ y. \<integral>\<^sup>+ x. indicator (S (insert b A) t \<inter> space (?M (insert b A)))
                    (x(b := y)) \<partial>?M A \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N (Pi\<^sub>M (insert b A) (\<lambda>_. lborel)) (indicator (S (insert b A) t \<inter> space (Pi\<^sub>M (insert b A) (\<lambda>_. lborel)))) = \<integral>\<^sup>+ y. \<integral>\<^sup>+ x. indicator (S (insert b A) t \<inter> space (Pi\<^sub>M (insert b A) (\<lambda>_. lborel))) (x(b := y)) \<partial>Pi\<^sub>M A (\<lambda>_. lborel) \<partial>lborel
[PROOF STEP]
using insert.prems insert.hyps
[PROOF STATE]
proof (prove)
using this:
0 \<le> t
finite A
b \<notin> A

goal (1 subgoal):
 1. integral\<^sup>N (Pi\<^sub>M (insert b A) (\<lambda>_. lborel)) (indicator (S (insert b A) t \<inter> space (Pi\<^sub>M (insert b A) (\<lambda>_. lborel)))) = \<integral>\<^sup>+ y. \<integral>\<^sup>+ x. indicator (S (insert b A) t \<inter> space (Pi\<^sub>M (insert b A) (\<lambda>_. lborel))) (x(b := y)) \<partial>Pi\<^sub>M A (\<lambda>_. lborel) \<partial>lborel
[PROOF STEP]
by (intro product_nn_integral_insert_rev) auto
[PROOF STATE]
proof (state)
this:
integral\<^sup>N (Pi\<^sub>M (insert b A) (\<lambda>_. lborel)) (indicator (S (insert b A) t \<inter> space (Pi\<^sub>M (insert b A) (\<lambda>_. lborel)))) = \<integral>\<^sup>+ y. \<integral>\<^sup>+ x. indicator (S (insert b A) t \<inter> space (Pi\<^sub>M (insert b A) (\<lambda>_. lborel))) (x(b := y)) \<partial>Pi\<^sub>M A (\<lambda>_. lborel) \<partial>lborel

goal (1 subgoal):
 1. \<And>x F t. \<lbrakk>finite F; x \<notin> F; \<And>t. 0 \<le> t \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) (S F t \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (t ^ card F / fact (card F)); 0 \<le> t\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) (S (insert x F) t \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (t ^ card (insert x F) / fact (card (insert x F)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
integral\<^sup>N (Pi\<^sub>M (insert b A) (\<lambda>_. lborel)) (indicator (S (insert b A) t \<inter> space (Pi\<^sub>M (insert b A) (\<lambda>_. lborel)))) = \<integral>\<^sup>+ y. \<integral>\<^sup>+ x. indicator (S (insert b A) t \<inter> space (Pi\<^sub>M (insert b A) (\<lambda>_. lborel))) (x(b := y)) \<partial>Pi\<^sub>M A (\<lambda>_. lborel) \<partial>lborel

goal (1 subgoal):
 1. \<And>x F t. \<lbrakk>finite F; x \<notin> F; \<And>t. 0 \<le> t \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) (S F t \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (t ^ card F / fact (card F)); 0 \<le> t\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) (S (insert x F) t \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (t ^ card (insert x F) / fact (card (insert x F)))
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+ y. \<integral>\<^sup>+ x. indicator {0..t} y * indicator (S A (t - y) \<inter> space (?M A)) x
                    \<partial>?M A \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ y. \<integral>\<^sup>+ x. indicator (S (insert b A) t \<inter> space (Pi\<^sub>M (insert b A) (\<lambda>_. lborel))) (x(b := y)) \<partial>Pi\<^sub>M A (\<lambda>_. lborel) \<partial>lborel = \<integral>\<^sup>+ y. (\<integral>\<^sup>+x\<in>S A (t - y) \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel)). indicator {0..t} y\<partial>Pi\<^sub>M A (\<lambda>_. lborel)) \<partial>lborel
[PROOF STEP]
using insert.hyps insert.prems emeasure_std_simplex_aux_step[of b A]
[PROOF STATE]
proof (prove)
using this:
finite A
b \<notin> A
0 \<le> t
\<lbrakk>b \<notin> A; finite A\<rbrakk> \<Longrightarrow> (?x(b := ?y) \<in> S (insert b A) ?t) = (?y \<in> {0..?t} \<and> ?x \<in> S A (?t - ?y))

goal (1 subgoal):
 1. \<integral>\<^sup>+ y. \<integral>\<^sup>+ x. indicator (S (insert b A) t \<inter> space (Pi\<^sub>M (insert b A) (\<lambda>_. lborel))) (x(b := y)) \<partial>Pi\<^sub>M A (\<lambda>_. lborel) \<partial>lborel = \<integral>\<^sup>+ y. (\<integral>\<^sup>+x\<in>S A (t - y) \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel)). indicator {0..t} y\<partial>Pi\<^sub>M A (\<lambda>_. lborel)) \<partial>lborel
[PROOF STEP]
by (intro nn_integral_cong)
       (auto simp: fun_eq_iff indicator_def space_PiM PiE_def extensional_def)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ y. \<integral>\<^sup>+ x. indicator (S (insert b A) t \<inter> space (Pi\<^sub>M (insert b A) (\<lambda>_. lborel))) (x(b := y)) \<partial>Pi\<^sub>M A (\<lambda>_. lborel) \<partial>lborel = \<integral>\<^sup>+ y. (\<integral>\<^sup>+x\<in>S A (t - y) \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel)). indicator {0..t} y\<partial>Pi\<^sub>M A (\<lambda>_. lborel)) \<partial>lborel

goal (1 subgoal):
 1. \<And>x F t. \<lbrakk>finite F; x \<notin> F; \<And>t. 0 \<le> t \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) (S F t \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (t ^ card F / fact (card F)); 0 \<le> t\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) (S (insert x F) t \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (t ^ card (insert x F) / fact (card (insert x F)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ y. \<integral>\<^sup>+ x. indicator (S (insert b A) t \<inter> space (Pi\<^sub>M (insert b A) (\<lambda>_. lborel))) (x(b := y)) \<partial>Pi\<^sub>M A (\<lambda>_. lborel) \<partial>lborel = \<integral>\<^sup>+ y. (\<integral>\<^sup>+x\<in>S A (t - y) \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel)). indicator {0..t} y\<partial>Pi\<^sub>M A (\<lambda>_. lborel)) \<partial>lborel

goal (1 subgoal):
 1. \<And>x F t. \<lbrakk>finite F; x \<notin> F; \<And>t. 0 \<le> t \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) (S F t \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (t ^ card F / fact (card F)); 0 \<le> t\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) (S (insert x F) t \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (t ^ card (insert x F) / fact (card (insert x F)))
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+ y. indicator {0..t} y * (\<integral>\<^sup>+ x. indicator (S A (t - y) \<inter> space (?M A)) x
                    \<partial>?M A) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ y. (\<integral>\<^sup>+x\<in>S A (t - y) \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel)). indicator {0..t} y\<partial>Pi\<^sub>M A (\<lambda>_. lborel)) \<partial>lborel = \<integral>\<^sup>+ y. indicator {0..t} y * integral\<^sup>N (Pi\<^sub>M A (\<lambda>_. lborel)) (indicator (S A (t - y) \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel)))) \<partial>lborel
[PROOF STEP]
using \<open>finite A\<close>
[PROOF STATE]
proof (prove)
using this:
finite A

goal (1 subgoal):
 1. \<integral>\<^sup>+ y. (\<integral>\<^sup>+x\<in>S A (t - y) \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel)). indicator {0..t} y\<partial>Pi\<^sub>M A (\<lambda>_. lborel)) \<partial>lborel = \<integral>\<^sup>+ y. indicator {0..t} y * integral\<^sup>N (Pi\<^sub>M A (\<lambda>_. lborel)) (indicator (S A (t - y) \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel)))) \<partial>lborel
[PROOF STEP]
by (subst nn_integral_cmult) auto
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ y. (\<integral>\<^sup>+x\<in>S A (t - y) \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel)). indicator {0..t} y\<partial>Pi\<^sub>M A (\<lambda>_. lborel)) \<partial>lborel = \<integral>\<^sup>+ y. indicator {0..t} y * integral\<^sup>N (Pi\<^sub>M A (\<lambda>_. lborel)) (indicator (S A (t - y) \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel)))) \<partial>lborel

goal (1 subgoal):
 1. \<And>x F t. \<lbrakk>finite F; x \<notin> F; \<And>t. 0 \<le> t \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) (S F t \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (t ^ card F / fact (card F)); 0 \<le> t\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) (S (insert x F) t \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (t ^ card (insert x F) / fact (card (insert x F)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ y. (\<integral>\<^sup>+x\<in>S A (t - y) \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel)). indicator {0..t} y\<partial>Pi\<^sub>M A (\<lambda>_. lborel)) \<partial>lborel = \<integral>\<^sup>+ y. indicator {0..t} y * integral\<^sup>N (Pi\<^sub>M A (\<lambda>_. lborel)) (indicator (S A (t - y) \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel)))) \<partial>lborel

goal (1 subgoal):
 1. \<And>x F t. \<lbrakk>finite F; x \<notin> F; \<And>t. 0 \<le> t \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) (S F t \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (t ^ card F / fact (card F)); 0 \<le> t\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) (S (insert x F) t \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (t ^ card (insert x F) / fact (card (insert x F)))
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+ y. indicator {0..t} y * emeasure (?M A) (S A (t - y) \<inter> space (?M A)) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ y. indicator {0..t} y * integral\<^sup>N (Pi\<^sub>M A (\<lambda>_. lborel)) (indicator (S A (t - y) \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel)))) \<partial>lborel = \<integral>\<^sup>+ y. indicator {0..t} y * emeasure (Pi\<^sub>M A (\<lambda>_. lborel)) (S A (t - y) \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) \<partial>lborel
[PROOF STEP]
using \<open>finite A\<close>
[PROOF STATE]
proof (prove)
using this:
finite A

goal (1 subgoal):
 1. \<integral>\<^sup>+ y. indicator {0..t} y * integral\<^sup>N (Pi\<^sub>M A (\<lambda>_. lborel)) (indicator (S A (t - y) \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel)))) \<partial>lborel = \<integral>\<^sup>+ y. indicator {0..t} y * emeasure (Pi\<^sub>M A (\<lambda>_. lborel)) (S A (t - y) \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) \<partial>lborel
[PROOF STEP]
by (subst nn_integral_indicator) auto
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ y. indicator {0..t} y * integral\<^sup>N (Pi\<^sub>M A (\<lambda>_. lborel)) (indicator (S A (t - y) \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel)))) \<partial>lborel = \<integral>\<^sup>+ y. indicator {0..t} y * emeasure (Pi\<^sub>M A (\<lambda>_. lborel)) (S A (t - y) \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) \<partial>lborel

goal (1 subgoal):
 1. \<And>x F t. \<lbrakk>finite F; x \<notin> F; \<And>t. 0 \<le> t \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) (S F t \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (t ^ card F / fact (card F)); 0 \<le> t\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) (S (insert x F) t \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (t ^ card (insert x F) / fact (card (insert x F)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ y. indicator {0..t} y * integral\<^sup>N (Pi\<^sub>M A (\<lambda>_. lborel)) (indicator (S A (t - y) \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel)))) \<partial>lborel = \<integral>\<^sup>+ y. indicator {0..t} y * emeasure (Pi\<^sub>M A (\<lambda>_. lborel)) (S A (t - y) \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) \<partial>lborel

goal (1 subgoal):
 1. \<And>x F t. \<lbrakk>finite F; x \<notin> F; \<And>t. 0 \<le> t \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) (S F t \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (t ^ card F / fact (card F)); 0 \<le> t\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) (S (insert x F) t \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (t ^ card (insert x F) / fact (card (insert x F)))
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+ y. indicator {0..t} y * (t - y) ^ card A / ennreal (fact (card A)) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ y. indicator {0..t} y * emeasure (Pi\<^sub>M A (\<lambda>_. lborel)) (S A (t - y) \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) \<partial>lborel = \<integral>\<^sup>+ y. ennreal (indicat_real {0..t} y * (t - y) ^ card A) / ennreal (fact (card A)) \<partial>lborel
[PROOF STEP]
using insert.IH
[PROOF STATE]
proof (prove)
using this:
0 \<le> ?t \<Longrightarrow> emeasure (Pi\<^sub>M A (\<lambda>_. lborel)) (S A ?t \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) = ennreal (?t ^ card A / fact (card A))

goal (1 subgoal):
 1. \<integral>\<^sup>+ y. indicator {0..t} y * emeasure (Pi\<^sub>M A (\<lambda>_. lborel)) (S A (t - y) \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) \<partial>lborel = \<integral>\<^sup>+ y. ennreal (indicat_real {0..t} y * (t - y) ^ card A) / ennreal (fact (card A)) \<partial>lborel
[PROOF STEP]
by (intro nn_integral_cong) (auto simp: indicator_def divide_ennreal)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ y. indicator {0..t} y * emeasure (Pi\<^sub>M A (\<lambda>_. lborel)) (S A (t - y) \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) \<partial>lborel = \<integral>\<^sup>+ y. ennreal (indicat_real {0..t} y * (t - y) ^ card A) / ennreal (fact (card A)) \<partial>lborel

goal (1 subgoal):
 1. \<And>x F t. \<lbrakk>finite F; x \<notin> F; \<And>t. 0 \<le> t \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) (S F t \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (t ^ card F / fact (card F)); 0 \<le> t\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) (S (insert x F) t \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (t ^ card (insert x F) / fact (card (insert x F)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ y. indicator {0..t} y * emeasure (Pi\<^sub>M A (\<lambda>_. lborel)) (S A (t - y) \<inter> space (Pi\<^sub>M A (\<lambda>_. lborel))) \<partial>lborel = \<integral>\<^sup>+ y. ennreal (indicat_real {0..t} y * (t - y) ^ card A) / ennreal (fact (card A)) \<partial>lborel

goal (1 subgoal):
 1. \<And>x F t. \<lbrakk>finite F; x \<notin> F; \<And>t. 0 \<le> t \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) (S F t \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (t ^ card F / fact (card F)); 0 \<le> t\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) (S (insert x F) t \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (t ^ card (insert x F) / fact (card (insert x F)))
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+ y. indicator {0..t} y * (t - y) ^ card A \<partial>lborel) / ennreal (fact (card A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ y. ennreal (indicat_real {0..t} y * (t - y) ^ card A) / ennreal (fact (card A)) \<partial>lborel = \<integral>\<^sup>+ x. ennreal (indicat_real {0..t} x * (t - x) ^ card A) \<partial>lborel / ennreal (fact (card A))
[PROOF STEP]
using \<open>finite A\<close>
[PROOF STATE]
proof (prove)
using this:
finite A

goal (1 subgoal):
 1. \<integral>\<^sup>+ y. ennreal (indicat_real {0..t} y * (t - y) ^ card A) / ennreal (fact (card A)) \<partial>lborel = \<integral>\<^sup>+ x. ennreal (indicat_real {0..t} x * (t - x) ^ card A) \<partial>lborel / ennreal (fact (card A))
[PROOF STEP]
by (subst nn_integral_divide) auto
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ y. ennreal (indicat_real {0..t} y * (t - y) ^ card A) / ennreal (fact (card A)) \<partial>lborel = \<integral>\<^sup>+ x. ennreal (indicat_real {0..t} x * (t - x) ^ card A) \<partial>lborel / ennreal (fact (card A))

goal (1 subgoal):
 1. \<And>x F t. \<lbrakk>finite F; x \<notin> F; \<And>t. 0 \<le> t \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) (S F t \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (t ^ card F / fact (card F)); 0 \<le> t\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) (S (insert x F) t \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (t ^ card (insert x F) / fact (card (insert x F)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ y. ennreal (indicat_real {0..t} y * (t - y) ^ card A) / ennreal (fact (card A)) \<partial>lborel = \<integral>\<^sup>+ x. ennreal (indicat_real {0..t} x * (t - x) ^ card A) \<partial>lborel / ennreal (fact (card A))

goal (1 subgoal):
 1. \<And>x F t. \<lbrakk>finite F; x \<notin> F; \<And>t. 0 \<le> t \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) (S F t \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (t ^ card F / fact (card F)); 0 \<le> t\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) (S (insert x F) t \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (t ^ card (insert x F) / fact (card (insert x F)))
[PROOF STEP]
have "(\<integral>\<^sup>+ y. indicator {0..t} y * (t - y) ^ card A \<partial>lborel) =
               (\<integral>\<^sup>+y\<in>{0..t}. ennreal ((t - y) ^ (n - 1)) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real {0..t} x * (t - x) ^ card A) \<partial>lborel = \<integral>\<^sup>+x\<in>{0..t}. ennreal ((t - x) ^ (n - 1))\<partial>lborel
[PROOF STEP]
by (intro nn_integral_cong) (auto simp: indicator_def n_def)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (indicat_real {0..t} x * (t - x) ^ card A) \<partial>lborel = \<integral>\<^sup>+x\<in>{0..t}. ennreal ((t - x) ^ (n - 1))\<partial>lborel

goal (1 subgoal):
 1. \<And>x F t. \<lbrakk>finite F; x \<notin> F; \<And>t. 0 \<le> t \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) (S F t \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (t ^ card F / fact (card F)); 0 \<le> t\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) (S (insert x F) t \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (t ^ card (insert x F) / fact (card (insert x F)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (indicat_real {0..t} x * (t - x) ^ card A) \<partial>lborel = \<integral>\<^sup>+x\<in>{0..t}. ennreal ((t - x) ^ (n - 1))\<partial>lborel

goal (1 subgoal):
 1. \<And>x F t. \<lbrakk>finite F; x \<notin> F; \<And>t. 0 \<le> t \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) (S F t \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (t ^ card F / fact (card F)); 0 \<le> t\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) (S (insert x F) t \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (t ^ card (insert x F) / fact (card (insert x F)))
[PROOF STEP]
have "((\<lambda>x. - ((t - x) ^ n / n)) has_real_derivative (t - x) ^ (n - 1)) (at x)"
    if "x \<in> {0..t}" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. - ((t - x) ^ n / real n)) has_real_derivative (t - x) ^ (n - 1)) (at x)
[PROOF STEP]
by (rule derivative_eq_intros refl | simp add: n_pos)+
[PROOF STATE]
proof (state)
this:
?x1 \<in> {0..t} \<Longrightarrow> ((\<lambda>x. - ((t - x) ^ n / real n)) has_real_derivative (t - ?x1) ^ (n - 1)) (at ?x1)

goal (1 subgoal):
 1. \<And>x F t. \<lbrakk>finite F; x \<notin> F; \<And>t. 0 \<le> t \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) (S F t \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (t ^ card F / fact (card F)); 0 \<le> t\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) (S (insert x F) t \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (t ^ card (insert x F) / fact (card (insert x F)))
[PROOF STEP]
hence "(\<integral>\<^sup>+y\<in>{0..t}. ennreal ((t - y) ^ (n - 1)) \<partial>lborel) =
           ennreal (-((t - t) ^ n / n) - (-((t - 0) ^ n / n)))"
[PROOF STATE]
proof (prove)
using this:
?x1 \<in> {0..t} \<Longrightarrow> ((\<lambda>x. - ((t - x) ^ n / real n)) has_real_derivative (t - ?x1) ^ (n - 1)) (at ?x1)

goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>{0..t}. ennreal ((t - x) ^ (n - 1))\<partial>lborel = ennreal (- ((t - t) ^ n / real n) - - ((t - 0) ^ n / real n))
[PROOF STEP]
using insert.prems insert.hyps
[PROOF STATE]
proof (prove)
using this:
?x1 \<in> {0..t} \<Longrightarrow> ((\<lambda>x. - ((t - x) ^ n / real n)) has_real_derivative (t - ?x1) ^ (n - 1)) (at ?x1)
0 \<le> t
finite A
b \<notin> A

goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>{0..t}. ennreal ((t - x) ^ (n - 1))\<partial>lborel = ennreal (- ((t - t) ^ n / real n) - - ((t - 0) ^ n / real n))
[PROOF STEP]
by (intro nn_integral_FTC_Icc) auto
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>{0..t}. ennreal ((t - x) ^ (n - 1))\<partial>lborel = ennreal (- ((t - t) ^ n / real n) - - ((t - 0) ^ n / real n))

goal (1 subgoal):
 1. \<And>x F t. \<lbrakk>finite F; x \<notin> F; \<And>t. 0 \<le> t \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) (S F t \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (t ^ card F / fact (card F)); 0 \<le> t\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) (S (insert x F) t \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (t ^ card (insert x F) / fact (card (insert x F)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>{0..t}. ennreal ((t - x) ^ (n - 1))\<partial>lborel = ennreal (- ((t - t) ^ n / real n) - - ((t - 0) ^ n / real n))

goal (1 subgoal):
 1. \<And>x F t. \<lbrakk>finite F; x \<notin> F; \<And>t. 0 \<le> t \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) (S F t \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (t ^ card F / fact (card F)); 0 \<le> t\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) (S (insert x F) t \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (t ^ card (insert x F) / fact (card (insert x F)))
[PROOF STEP]
have "\<dots> = ennreal (t ^ n / n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ennreal (- ((t - t) ^ n / real n) - - ((t - 0) ^ n / real n)) = ennreal (t ^ n / real n)
[PROOF STEP]
using n_pos
[PROOF STATE]
proof (prove)
using this:
0 < n

goal (1 subgoal):
 1. ennreal (- ((t - t) ^ n / real n) - - ((t - 0) ^ n / real n)) = ennreal (t ^ n / real n)
[PROOF STEP]
by (simp add: zero_power)
[PROOF STATE]
proof (state)
this:
ennreal (- ((t - t) ^ n / real n) - - ((t - 0) ^ n / real n)) = ennreal (t ^ n / real n)

goal (1 subgoal):
 1. \<And>x F t. \<lbrakk>finite F; x \<notin> F; \<And>t. 0 \<le> t \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) (S F t \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (t ^ card F / fact (card F)); 0 \<le> t\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) (S (insert x F) t \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (t ^ card (insert x F) / fact (card (insert x F)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ennreal (- ((t - t) ^ n / real n) - - ((t - 0) ^ n / real n)) = ennreal (t ^ n / real n)

goal (1 subgoal):
 1. \<And>x F t. \<lbrakk>finite F; x \<notin> F; \<And>t. 0 \<le> t \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) (S F t \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (t ^ card F / fact (card F)); 0 \<le> t\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) (S (insert x F) t \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (t ^ card (insert x F) / fact (card (insert x F)))
[PROOF STEP]
have "\<dots> / ennreal (fact (card A)) = ennreal (t ^ n / n / fact (card A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ennreal (t ^ n / real n) / ennreal (fact (card A)) = ennreal (t ^ n / real n / fact (card A))
[PROOF STEP]
using n_pos \<open>t \<ge> 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < n
0 \<le> t

goal (1 subgoal):
 1. ennreal (t ^ n / real n) / ennreal (fact (card A)) = ennreal (t ^ n / real n / fact (card A))
[PROOF STEP]
by (subst divide_ennreal) auto
[PROOF STATE]
proof (state)
this:
ennreal (t ^ n / real n) / ennreal (fact (card A)) = ennreal (t ^ n / real n / fact (card A))

goal (1 subgoal):
 1. \<And>x F t. \<lbrakk>finite F; x \<notin> F; \<And>t. 0 \<le> t \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) (S F t \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (t ^ card F / fact (card F)); 0 \<le> t\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) (S (insert x F) t \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (t ^ card (insert x F) / fact (card (insert x F)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ennreal (t ^ n / real n) / ennreal (fact (card A)) = ennreal (t ^ n / real n / fact (card A))

goal (1 subgoal):
 1. \<And>x F t. \<lbrakk>finite F; x \<notin> F; \<And>t. 0 \<le> t \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) (S F t \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (t ^ card F / fact (card F)); 0 \<le> t\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) (S (insert x F) t \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (t ^ card (insert x F) / fact (card (insert x F)))
[PROOF STEP]
have "t ^ n / n / fact (card A) = t ^ n / fact n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t ^ n / real n / fact (card A) = t ^ n / fact n
[PROOF STEP]
by (simp add: n_def)
[PROOF STATE]
proof (state)
this:
t ^ n / real n / fact (card A) = t ^ n / fact n

goal (1 subgoal):
 1. \<And>x F t. \<lbrakk>finite F; x \<notin> F; \<And>t. 0 \<le> t \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) (S F t \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (t ^ card F / fact (card F)); 0 \<le> t\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) (S (insert x F) t \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (t ^ card (insert x F) / fact (card (insert x F)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
t ^ n / real n / fact (card A) = t ^ n / fact n

goal (1 subgoal):
 1. \<And>x F t. \<lbrakk>finite F; x \<notin> F; \<And>t. 0 \<le> t \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) (S F t \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (t ^ card F / fact (card F)); 0 \<le> t\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) (S (insert x F) t \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (t ^ card (insert x F) / fact (card (insert x F)))
[PROOF STEP]
have "n = card (insert b A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n = card (insert b A)
[PROOF STEP]
using insert.hyps
[PROOF STATE]
proof (prove)
using this:
finite A
b \<notin> A

goal (1 subgoal):
 1. n = card (insert b A)
[PROOF STEP]
by (subst card.insert_remove) (auto simp: n_def)
[PROOF STATE]
proof (state)
this:
n = card (insert b A)

goal (1 subgoal):
 1. \<And>x F t. \<lbrakk>finite F; x \<notin> F; \<And>t. 0 \<le> t \<Longrightarrow> emeasure (Pi\<^sub>M F (\<lambda>_. lborel)) (S F t \<inter> space (Pi\<^sub>M F (\<lambda>_. lborel))) = ennreal (t ^ card F / fact (card F)); 0 \<le> t\<rbrakk> \<Longrightarrow> emeasure (Pi\<^sub>M (insert x F) (\<lambda>_. lborel)) (S (insert x F) t \<inter> space (Pi\<^sub>M (insert x F) (\<lambda>_. lborel))) = ennreal (t ^ card (insert x F) / fact (card (insert x F)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
emeasure (Pi\<^sub>M (insert b A) (\<lambda>_. lborel)) (S (insert b A) t \<inter> space (Pi\<^sub>M (insert b A) (\<lambda>_. lborel))) = ennreal (t ^ card (insert b A) / fact (card (insert b A)))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
emeasure (Pi\<^sub>M (insert b A) (\<lambda>_. lborel)) (S (insert b A) t \<inter> space (Pi\<^sub>M (insert b A) (\<lambda>_. lborel))) = ennreal (t ^ card (insert b A) / fact (card (insert b A)))

goal (1 subgoal):
 1. emeasure (Pi\<^sub>M (insert b A) (\<lambda>_. lborel)) (S (insert b A) t \<inter> space (Pi\<^sub>M (insert b A) (\<lambda>_. lborel))) = ennreal (t ^ card (insert b A) / fact (card (insert b A)))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
emeasure (Pi\<^sub>M (insert b A) (\<lambda>_. lborel)) (S (insert b A) t \<inter> space (Pi\<^sub>M (insert b A) (\<lambda>_. lborel))) = ennreal (t ^ card (insert b A) / fact (card (insert b A)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mono_lfp_eqI:
  assumes MONO: "mono f"
  assumes FIXP: "f a \<le> a"
  assumes LEAST: "\<And>x. f x = x \<Longrightarrow> a\<le>x"
  shows "lfp f = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lfp f = a
[PROOF STEP]
apply (rule antisym)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. lfp f \<le> a
 2. a \<le> lfp f
[PROOF STEP]
apply (rule lfp_lowerbound)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. f a \<le> a
 2. a \<le> lfp f
[PROOF STEP]
apply (rule FIXP)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<le> lfp f
[PROOF STEP]
by (metis LEAST MONO lfp_unfold)