[STATEMENT]
lemma beukers_integral1_same:
  assumes "r = s"
  shows   "beukers_integral1 r s = 2 * (Re (zeta 3) - (\<Sum>k=1..r. 1 / k ^ 3))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. beukers_integral1 r s = 2 * (Re (zeta 3) - (\<Sum>k = 1..r. 1 / real (k ^ 3)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. beukers_integral1 r s = 2 * (Re (zeta 3) - (\<Sum>k = 1..r. 1 / real (k ^ 3)))
[PROOF STEP]
have "ln (a * b) * a ^ r * b ^ s / (1 - a * b) \<le> 0" if "a \<in> {0<..<1}" "b \<in> {0<..<1}" for a b :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ln (a * b) * a ^ r * b ^ s / (1 - a * b) \<le> 0
[PROOF STEP]
using that mult_strict_mono[of a 1 b 1]
[PROOF STATE]
proof (prove)
using this:
a \<in> {0<..<1}
b \<in> {0<..<1}
\<lbrakk>a < 1; b < 1; 0 < 1; 0 \<le> b\<rbrakk> \<Longrightarrow> a * b < 1 * 1

goal (1 subgoal):
 1. ln (a * b) * a ^ r * b ^ s / (1 - a * b) \<le> 0
[PROOF STEP]
by (intro mult_nonpos_nonneg divide_nonpos_nonneg) auto
[PROOF STATE]
proof (state)
this:
\<lbrakk>?a \<in> {0<..<1}; ?b \<in> {0<..<1}\<rbrakk> \<Longrightarrow> ln (?a * ?b) * ?a ^ r * ?b ^ s / (1 - ?a * ?b) \<le> 0

goal (1 subgoal):
 1. beukers_integral1 r s = 2 * (Re (zeta 3) - (\<Sum>k = 1..r. 1 / real (k ^ 3)))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?a \<in> {0<..<1}; ?b \<in> {0<..<1}\<rbrakk> \<Longrightarrow> ln (?a * ?b) * ?a ^ r * ?b ^ s / (1 - ?a * ?b) \<le> 0

goal (1 subgoal):
 1. beukers_integral1 r s = 2 * (Re (zeta 3) - (\<Sum>k = 1..r. 1 / real (k ^ 3)))
[PROOF STEP]
using beukers_nn_integral1_same[OF assms]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?a \<in> {0<..<1}; ?b \<in> {0<..<1}\<rbrakk> \<Longrightarrow> ln (?a * ?b) * ?a ^ r * ?b ^ s / (1 - ?a * ?b) \<le> 0
beukers_nn_integral1 r s = ennreal (2 * (Re (zeta 3) - (\<Sum>k = 1..r. 1 / real (k ^ 3))))
0 \<le> 2 * (Re (zeta 3) - (\<Sum>k = 1..r. 1 / real (k ^ 3)))

goal (1 subgoal):
 1. beukers_integral1 r s = 2 * (Re (zeta 3) - (\<Sum>k = 1..r. 1 / real (k ^ 3)))
[PROOF STEP]
unfolding beukers_nn_integral1_def beukers_integral1_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?a \<in> {0<..<1}; ?b \<in> {0<..<1}\<rbrakk> \<Longrightarrow> ln (?a * ?b) * ?a ^ r * ?b ^ s / (1 - ?a * ?b) \<le> 0
\<integral>\<^sup>+x\<in>{0<..<1} \<times> {0<..<1}. (case x of (x, y) \<Rightarrow> ennreal (- ln (x * y) / (1 - x * y) * x ^ r * y ^ s))\<partial>lborel = ennreal (2 * (Re (zeta 3) - (\<Sum>k = 1..r. 1 / real (k ^ 3))))
0 \<le> 2 * (Re (zeta 3) - (\<Sum>k = 1..r. 1 / real (k ^ 3)))

goal (1 subgoal):
 1. LBINT (x, y):{0<..<1} \<times> {0<..<1}. - ln (x * y) / (1 - x * y) * x ^ r * y ^ s = 2 * (Re (zeta 3) - (\<Sum>k = 1..r. 1 / real (k ^ 3)))
[PROOF STEP]
by (intro set_integral_eq_nn_integral AE_I2)
       (auto simp flip: lborel_prod simp: case_prod_unfold set_borel_measurable_def
             intro: divide_nonpos_nonneg mult_nonpos_nonneg)
[PROOF STATE]
proof (state)
this:
beukers_integral1 r s = 2 * (Re (zeta 3) - (\<Sum>k = 1..r. 1 / real (k ^ 3)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma poly_of_vars_simps[simp]:
  shows
    \<open>poly_of_vars (add_mset x xs) = Var (\<phi> x) * (poly_of_vars xs :: ('a :: {comm_semiring_1}) mpoly)\<close> (is ?A) and
    \<open>poly_of_vars (xs + ys) = poly_of_vars xs * (poly_of_vars ys :: ('a :: {comm_semiring_1}) mpoly)\<close> (is ?B)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_of_vars (add_mset x xs) = Var (\<phi> x) * poly_of_vars xs &&& poly_of_vars (xs + ys) = poly_of_vars xs * poly_of_vars ys
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. poly_of_vars (add_mset x xs) = Var (\<phi> x) * poly_of_vars xs
 2. poly_of_vars (xs + ys) = poly_of_vars xs * poly_of_vars ys
[PROOF STEP]
interpret comp_fun_commute \<open>(\<lambda>a b. (b :: 'a :: {comm_semiring_1} mpoly) * Var (\<phi> a))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. comp_fun_commute (\<lambda>a b. b * Var (\<phi> a))
[PROOF STEP]
by standard
      (auto simp: algebra_simps ac_simps
         Var_def times_monomial_monomial intro!: ext)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. poly_of_vars (add_mset x xs) = Var (\<phi> x) * poly_of_vars xs
 2. poly_of_vars (xs + ys) = poly_of_vars xs * poly_of_vars ys
[PROOF STEP]
show ?A
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_of_vars (add_mset x xs) = Var (\<phi> x) * poly_of_vars xs
[PROOF STEP]
by (auto simp: poly_of_vars_def comp_fun_commute_axioms fold_mset_fusion
      ac_simps)
[PROOF STATE]
proof (state)
this:
poly_of_vars (add_mset x xs) = Var (\<phi> x) * poly_of_vars xs

goal (1 subgoal):
 1. poly_of_vars (xs + ys) = poly_of_vars xs * poly_of_vars ys
[PROOF STEP]
show ?B
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_of_vars (xs + ys) = poly_of_vars xs * poly_of_vars ys
[PROOF STEP]
apply (auto simp: poly_of_vars_def ac_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fold_mset (\<lambda>a b. b * Var (\<phi> a)) (fold_mset (\<lambda>a b. b * Var (\<phi> a)) 1 xs) ys = fold_mset (\<lambda>a b. b * Var (\<phi> a)) 1 xs * fold_mset (\<lambda>a b. b * Var (\<phi> a)) 1 ys
[PROOF STEP]
by (simp add: local.comp_fun_commute_axioms local.fold_mset_fusion
      semiring_normalization_rules(18))
[PROOF STATE]
proof (state)
this:
poly_of_vars (xs + ys) = poly_of_vars xs * poly_of_vars ys

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nonzero_divide_divide_eq_left:
  "a \<in> carrier R \<Longrightarrow> b \<in> carrier R \<Longrightarrow> c \<in> carrier R \<Longrightarrow> b \<noteq> \<zero> \<Longrightarrow> c \<noteq> \<zero> \<Longrightarrow>
    a \<oslash> b \<oslash> c = a \<oslash> (b \<otimes> c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier R; b \<in> carrier R; c \<in> carrier R; b \<noteq> \<zero>; c \<noteq> \<zero>\<rbrakk> \<Longrightarrow> a \<oslash> b \<oslash> c = a \<oslash> (b \<otimes> c)
[PROOF STEP]
by (simp add: m_div_def nonzero_inverse_mult_distrib m_ac integral_iff)


[STATEMENT]
lemma succ_pred [simp]: "Ord x \<Longrightarrow> x \<noteq> 0 \<Longrightarrow> succ (pred x) = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Ord x; x \<noteq> 0\<rbrakk> \<Longrightarrow> succ (pred x) = x
[PROOF STEP]
by (metis Ord_cases pred_succ)


[STATEMENT]
lemma exlitE: "(\<And>x. xe = Pos x \<Longrightarrow> P x) \<Longrightarrow> (\<And>x. xe = Neg x \<Longrightarrow> False) \<Longrightarrow> \<exists>x. xe = Pos x \<and> P x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x. xe = x\<^sup>+ \<Longrightarrow> P x; \<And>x. xe = x\<inverse> \<Longrightarrow> False\<rbrakk> \<Longrightarrow> \<exists>x. xe = x\<^sup>+ \<and> P x
[PROOF STEP]
by(cases xe) auto


[STATEMENT]
lemma CD_on_def2:
  shows "CD_on ds A = (\<Union>d\<in>ds. Cd d (A \<inter> Field (Pd d)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. CD_on ds A = (\<Union>d\<in>ds. Cd d (A \<inter> Field (Pd d)))
[PROOF STEP]
using Cd_domain
[PROOF STATE]
proof (prove)
using this:
Cd ?d (?X \<inter> Field (Pd ?d)) = Cd ?d ?X

goal (1 subgoal):
 1. CD_on ds A = (\<Union>d\<in>ds. Cd d (A \<inter> Field (Pd d)))
[PROOF STEP]
unfolding CD_on_def
[PROOF STATE]
proof (prove)
using this:
Cd ?d (?X \<inter> Field (Pd ?d)) = Cd ?d ?X

goal (1 subgoal):
 1. (\<Union>d\<in>ds. Cd d A) = (\<Union>d\<in>ds. Cd d (A \<inter> Field (Pd d)))
[PROOF STEP]
by blast


[STATEMENT]
lemma nth_rotate: "\<And> ls. 0 < length ls \<Longrightarrow> ls!((n+m) mod (length ls)) = (rotate m ls)!(n mod (length ls))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>ls. 0 < |ls| \<Longrightarrow> ls ! ((n + m) mod |ls|) = rotate m ls ! (n mod |ls|)
[PROOF STEP]
proof (induct m)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>ls. 0 < |ls| \<Longrightarrow> ls ! ((n + 0) mod |ls|) = rotate 0 ls ! (n mod |ls|)
 2. \<And>m ls. \<lbrakk>\<And>ls. 0 < |ls| \<Longrightarrow> ls ! ((n + m) mod |ls|) = rotate m ls ! (n mod |ls|); 0 < |ls|\<rbrakk> \<Longrightarrow> ls ! ((n + Suc m) mod |ls|) = rotate (Suc m) ls ! (n mod |ls|)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
0 < |ls|

goal (2 subgoals):
 1. \<And>ls. 0 < |ls| \<Longrightarrow> ls ! ((n + 0) mod |ls|) = rotate 0 ls ! (n mod |ls|)
 2. \<And>m ls. \<lbrakk>\<And>ls. 0 < |ls| \<Longrightarrow> ls ! ((n + m) mod |ls|) = rotate m ls ! (n mod |ls|); 0 < |ls|\<rbrakk> \<Longrightarrow> ls ! ((n + Suc m) mod |ls|) = rotate (Suc m) ls ! (n mod |ls|)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < |ls|
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
0 < |ls|

goal (1 subgoal):
 1. ls ! ((n + 0) mod |ls|) = rotate 0 ls ! (n mod |ls|)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ls ! ((n + 0) mod |ls|) = rotate 0 ls ! (n mod |ls|)

goal (1 subgoal):
 1. \<And>m ls. \<lbrakk>\<And>ls. 0 < |ls| \<Longrightarrow> ls ! ((n + m) mod |ls|) = rotate m ls ! (n mod |ls|); 0 < |ls|\<rbrakk> \<Longrightarrow> ls ! ((n + Suc m) mod |ls|) = rotate (Suc m) ls ! (n mod |ls|)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m ls. \<lbrakk>\<And>ls. 0 < |ls| \<Longrightarrow> ls ! ((n + m) mod |ls|) = rotate m ls ! (n mod |ls|); 0 < |ls|\<rbrakk> \<Longrightarrow> ls ! ((n + Suc m) mod |ls|) = rotate (Suc m) ls ! (n mod |ls|)
[PROOF STEP]
case (Suc m)
[PROOF STATE]
proof (state)
this:
0 < |?ls| \<Longrightarrow> ?ls ! ((n + m) mod |?ls|) = rotate m ?ls ! (n mod |?ls|)
0 < |ls|

goal (1 subgoal):
 1. \<And>m ls. \<lbrakk>\<And>ls. 0 < |ls| \<Longrightarrow> ls ! ((n + m) mod |ls|) = rotate m ls ! (n mod |ls|); 0 < |ls|\<rbrakk> \<Longrightarrow> ls ! ((n + Suc m) mod |ls|) = rotate (Suc m) ls ! (n mod |ls|)
[PROOF STEP]
define z where "z = n + m"
[PROOF STATE]
proof (state)
this:
z = n + m

goal (1 subgoal):
 1. \<And>m ls. \<lbrakk>\<And>ls. 0 < |ls| \<Longrightarrow> ls ! ((n + m) mod |ls|) = rotate m ls ! (n mod |ls|); 0 < |ls|\<rbrakk> \<Longrightarrow> ls ! ((n + Suc m) mod |ls|) = rotate (Suc m) ls ! (n mod |ls|)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
z = n + m
[PROOF STEP]
have "n + Suc m = Suc (z)"
[PROOF STATE]
proof (prove)
using this:
z = n + m

goal (1 subgoal):
 1. n + Suc m = Suc z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n + Suc m = Suc z

goal (1 subgoal):
 1. \<And>m ls. \<lbrakk>\<And>ls. 0 < |ls| \<Longrightarrow> ls ! ((n + m) mod |ls|) = rotate m ls ! (n mod |ls|); 0 < |ls|\<rbrakk> \<Longrightarrow> ls ! ((n + Suc m) mod |ls|) = rotate (Suc m) ls ! (n mod |ls|)
[PROOF STEP]
with Suc
[PROOF STATE]
proof (chain)
picking this:
0 < |?ls| \<Longrightarrow> ?ls ! ((n + m) mod |?ls|) = rotate m ?ls ! (n mod |?ls|)
0 < |ls|
n + Suc m = Suc z
[PROOF STEP]
have r1: "ls ! ((Suc z) mod length ls) = rotate1 ls ! (z mod length ls)"
[PROOF STATE]
proof (prove)
using this:
0 < |?ls| \<Longrightarrow> ?ls ! ((n + m) mod |?ls|) = rotate m ?ls ! (n mod |?ls|)
0 < |ls|
n + Suc m = Suc z

goal (1 subgoal):
 1. ls ! (Suc z mod |ls|) = rotate1 ls ! (z mod |ls|)
[PROOF STEP]
by (rule_tac nth_rotate1)
[PROOF STATE]
proof (state)
this:
ls ! (Suc z mod |ls|) = rotate1 ls ! (z mod |ls|)

goal (1 subgoal):
 1. \<And>m ls. \<lbrakk>\<And>ls. 0 < |ls| \<Longrightarrow> ls ! ((n + m) mod |ls|) = rotate m ls ! (n mod |ls|); 0 < |ls|\<rbrakk> \<Longrightarrow> ls ! ((n + Suc m) mod |ls|) = rotate (Suc m) ls ! (n mod |ls|)
[PROOF STEP]
from Suc
[PROOF STATE]
proof (chain)
picking this:
0 < |?ls| \<Longrightarrow> ?ls ! ((n + m) mod |?ls|) = rotate m ?ls ! (n mod |?ls|)
0 < |ls|
[PROOF STEP]
have "0 < length (rotate1 ls)"
[PROOF STATE]
proof (prove)
using this:
0 < |?ls| \<Longrightarrow> ?ls ! ((n + m) mod |?ls|) = rotate m ?ls ! (n mod |?ls|)
0 < |ls|

goal (1 subgoal):
 1. 0 < |rotate1 ls|
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < |rotate1 ls|

goal (1 subgoal):
 1. \<And>m ls. \<lbrakk>\<And>ls. 0 < |ls| \<Longrightarrow> ls ! ((n + m) mod |ls|) = rotate m ls ! (n mod |ls|); 0 < |ls|\<rbrakk> \<Longrightarrow> ls ! ((n + Suc m) mod |ls|) = rotate (Suc m) ls ! (n mod |ls|)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < |rotate1 ls|
[PROOF STEP]
have "(rotate1 ls) ! ((n + m) mod length (rotate1 ls))
    = rotate m (rotate1 ls) ! (n mod length (rotate1 ls))"
[PROOF STATE]
proof (prove)
using this:
0 < |rotate1 ls|

goal (1 subgoal):
 1. rotate1 ls ! ((n + m) mod |rotate1 ls|) = rotate m (rotate1 ls) ! (n mod |rotate1 ls|)
[PROOF STEP]
by (rule Suc)
[PROOF STATE]
proof (state)
this:
rotate1 ls ! ((n + m) mod |rotate1 ls|) = rotate m (rotate1 ls) ! (n mod |rotate1 ls|)

goal (1 subgoal):
 1. \<And>m ls. \<lbrakk>\<And>ls. 0 < |ls| \<Longrightarrow> ls ! ((n + m) mod |ls|) = rotate m ls ! (n mod |ls|); 0 < |ls|\<rbrakk> \<Longrightarrow> ls ! ((n + Suc m) mod |ls|) = rotate (Suc m) ls ! (n mod |ls|)
[PROOF STEP]
with r1 z_def
[PROOF STATE]
proof (chain)
picking this:
ls ! (Suc z mod |ls|) = rotate1 ls ! (z mod |ls|)
z = n + m
rotate1 ls ! ((n + m) mod |rotate1 ls|) = rotate m (rotate1 ls) ! (n mod |rotate1 ls|)
[PROOF STEP]
have "ls ! ((n + Suc m) mod length ls)
    = rotate m (rotate1 ls) ! (n mod length (rotate1 ls))"
[PROOF STATE]
proof (prove)
using this:
ls ! (Suc z mod |ls|) = rotate1 ls ! (z mod |ls|)
z = n + m
rotate1 ls ! ((n + m) mod |rotate1 ls|) = rotate m (rotate1 ls) ! (n mod |rotate1 ls|)

goal (1 subgoal):
 1. ls ! ((n + Suc m) mod |ls|) = rotate m (rotate1 ls) ! (n mod |rotate1 ls|)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ls ! ((n + Suc m) mod |ls|) = rotate m (rotate1 ls) ! (n mod |rotate1 ls|)

goal (1 subgoal):
 1. \<And>m ls. \<lbrakk>\<And>ls. 0 < |ls| \<Longrightarrow> ls ! ((n + m) mod |ls|) = rotate m ls ! (n mod |ls|); 0 < |ls|\<rbrakk> \<Longrightarrow> ls ! ((n + Suc m) mod |ls|) = rotate (Suc m) ls ! (n mod |ls|)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ls ! ((n + Suc m) mod |ls|) = rotate m (rotate1 ls) ! (n mod |rotate1 ls|)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
ls ! ((n + Suc m) mod |ls|) = rotate m (rotate1 ls) ! (n mod |rotate1 ls|)

goal (1 subgoal):
 1. ls ! ((n + Suc m) mod |ls|) = rotate (Suc m) ls ! (n mod |ls|)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ls ! ((n + Suc m) mod |ls|) = rotate (Suc m) ls ! (n mod |ls|)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma trans_lfp:
  assumes "mono f" and "\<And>R. trans R \<Longrightarrow> trans (f R)"
  shows "trans (lfp f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trans (lfp f)
[PROOF STEP]
by (metis lfp_chain_induct[of f trans] assms trans_Sup_of_chain)


[STATEMENT]
lemma of_nat_zhmset: "of_nat n = zhmset_of (of_nat n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat n = zhmset_of (of_nat n)
[PROOF STEP]
by (induct n) (auto simp: zero_zhmultiset_def zhmset_of_plus zhmset_of_1)


[STATEMENT]
lemma Im_express_cnj:
  shows "Im z = (z - cnj z) / (2 * \<i>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cor (Im z) = (z - cnj z) / (2 * \<i>)
[PROOF STEP]
by (simp add: complex_diff_cnj field_simps)


[STATEMENT]
lemma vdunion_vdoubleton:
  "(\<Coprod>\<^sub>\<circ>i\<in>\<^sub>\<circ>set{a, b}. A i) = set {a} \<times>\<^sub>\<circ> A a \<union>\<^sub>\<circ> set {b} \<times>\<^sub>\<circ> A b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. VSigma (set {a, b}) A = set {a} \<times>\<^sub>\<circ> A a \<union>\<^sub>\<circ> set {b} \<times>\<^sub>\<circ> A b
[PROOF STEP]
by auto


[STATEMENT]
lemma algebraic_mult_cancel_right [simp]:
  assumes "algebraic y" "y \<noteq> 0"
  shows   "algebraic (x * y) \<longleftrightarrow> algebraic x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. algebraic (x * y) = algebraic x
[PROOF STEP]
using algebraic_mult_cancel_left[of y x] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>algebraic y; y \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> algebraic (y * x) = algebraic x
algebraic y
y \<noteq> (0::'a)

goal (1 subgoal):
 1. algebraic (x * y) = algebraic x
[PROOF STEP]
by (simp add: mult.commute del: algebraic_mult_cancel_left)


[STATEMENT]
lemma project_set_iff [iff]:
     "(x \<in> project_set h C) = (\<exists>y. h(x,y) \<in> C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> project_set h C) = (\<exists>y. h (x, y) \<in> C)
[PROOF STEP]
by (simp add: project_set_def)


[STATEMENT]
lemma cos_Arcsin:
    "0 < Re z | Re z = 0 & 0 \<le> Im z \<Longrightarrow> cos(Arcsin z) = csqrt(1 - z\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < Re z \<or> Re z = 0 \<and> 0 \<le> Im z \<Longrightarrow> cos (Arcsin z) = csqrt (1 - z\<^sup>2)
[PROOF STEP]
by (simp add: Arcsin_Arccos_csqrt_pos)


[STATEMENT]
lemma concat_index_split_less_length_concat:
  assumes "i < length (concat xs)" and "concat_index_split (0, i) xs = (m, n)"
  shows "i = sum_list (map length (take m xs)) + n" "m < length xs" "n < length (xs ! m)"
    "concat xs ! i = xs ! m ! n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (i = sum_list (map length (take m xs)) + n &&& m < length xs) &&& n < length (xs ! m) &&& concat xs ! i = xs ! m ! n
[PROOF STEP]
using concat_index_split_sound[OF assms(1)] reconstr_1d_concat_index_split[OF assms(1), of 0]
[PROOF STATE]
proof (prove)
using this:
concat xs ! i = (case concat_index_split (0, i) xs of (k, j) \<Rightarrow> xs ! k ! j)
i = (case concat_index_split (0, i) xs of (m, j) \<Rightarrow> sum_list (map length (take (m - 0) xs)) + j)

goal (1 subgoal):
 1. (i = sum_list (map length (take m xs)) + n &&& m < length xs) &&& n < length (xs ! m) &&& concat xs ! i = xs ! m ! n
[PROOF STEP]
using concat_index_split_sound_fst_arg[OF assms(1)] concat_index_split_sound_snd_arg[OF assms(1)] assms(2)
[PROOF STATE]
proof (prove)
using this:
concat xs ! i = (case concat_index_split (0, i) xs of (k, j) \<Rightarrow> xs ! k ! j)
i = (case concat_index_split (0, i) xs of (m, j) \<Rightarrow> sum_list (map length (take (m - 0) xs)) + j)
fst (concat_index_split (0, i) xs) < length xs
snd (concat_index_split (0, i) xs) < length (xs ! fst (concat_index_split (0, i) xs))
concat_index_split (0, i) xs = (m, n)

goal (1 subgoal):
 1. (i = sum_list (map length (take m xs)) + n &&& m < length xs) &&& n < length (xs ! m) &&& concat xs ! i = xs ! m ! n
[PROOF STEP]
by auto


[STATEMENT]
lemma nn_integral_has_integral_lborel:
  fixes f :: "'a::euclidean_space \<Rightarrow> real"
  assumes f_borel: "f \<in> borel_measurable borel" and nonneg: "\<And>x. 0 \<le> f x"
  assumes I: "(f has_integral I) UNIV"
  shows "integral\<^sup>N lborel f = I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel = ennreal I
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel = ennreal I
[PROOF STEP]
from f_borel
[PROOF STATE]
proof (chain)
picking this:
f \<in> borel_measurable borel
[PROOF STEP]
have "(\<lambda>x. ennreal (f x)) \<in> borel_measurable lborel"
[PROOF STATE]
proof (prove)
using this:
f \<in> borel_measurable borel

goal (1 subgoal):
 1. (\<lambda>x. ennreal (f x)) \<in> borel_measurable lborel
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. ennreal (f x)) \<in> borel_measurable lborel

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel = ennreal I
[PROOF STEP]
from borel_measurable_implies_simple_function_sequence'[OF this]
[PROOF STATE]
proof (chain)
picking this:
(\<And>fa. \<lbrakk>\<And>i. simple_function lborel (fa i); incseq fa; \<And>i x. fa i x < top; \<And>x. (SUP i. fa i x) = ennreal (f x)\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis
[PROOF STEP]
obtain F where F: "\<And>i. simple_function lborel (F i)" "incseq F"
                 "\<And>i x. F i x < top" "\<And>x. (SUP i. F i x) = ennreal (f x)"
[PROOF STATE]
proof (prove)
using this:
(\<And>fa. \<lbrakk>\<And>i. simple_function lborel (fa i); incseq fa; \<And>i x. fa i x < top; \<And>x. (SUP i. fa i x) = ennreal (f x)\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>F. \<lbrakk>\<And>i. simple_function lborel (F i); incseq F; \<And>i x. F i x < top; \<And>x. (SUP i. F i x) = ennreal (f x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
simple_function lborel (F ?i)
incseq F
F ?i ?x < top
(SUP i. F i ?x) = ennreal (f ?x)

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel = ennreal I
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
simple_function lborel (F ?i)
incseq F
F ?i ?x < top
(SUP i. F i ?x) = ennreal (f ?x)
[PROOF STEP]
have [measurable]: "\<And>i. F i \<in> borel_measurable lborel"
[PROOF STATE]
proof (prove)
using this:
simple_function lborel (F ?i)
incseq F
F ?i ?x < top
(SUP i. F i ?x) = ennreal (f ?x)

goal (1 subgoal):
 1. \<And>i. F i \<in> borel_measurable lborel
[PROOF STEP]
by (metis borel_measurable_simple_function)
[PROOF STATE]
proof (state)
this:
F ?i \<in> borel_measurable lborel

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel = ennreal I
[PROOF STEP]
let ?B = "\<lambda>i::nat. box (- (real i *\<^sub>R One)) (real i *\<^sub>R One) :: 'a set"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel = ennreal I
[PROOF STEP]
have "0 \<le> I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> I
[PROOF STEP]
using I
[PROOF STATE]
proof (prove)
using this:
(f has_integral I) UNIV

goal (1 subgoal):
 1. 0 \<le> I
[PROOF STEP]
by (rule has_integral_nonneg) (simp add: nonneg)
[PROOF STATE]
proof (state)
this:
0 \<le> I

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel = ennreal I
[PROOF STEP]
have F_le_f: "enn2real (F i x) \<le> f x" for i x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enn2real (F i x) \<le> f x
[PROOF STEP]
using F(3,4)[where x=x] nonneg SUP_upper[of i UNIV "\<lambda>i. F i x"]
[PROOF STATE]
proof (prove)
using this:
F ?i x < top
(SUP i. F i x) = ennreal (f x)
0 \<le> f ?x
i \<in> UNIV \<Longrightarrow> F i x \<le> (SUP i. F i x)

goal (1 subgoal):
 1. enn2real (F i x) \<le> f x
[PROOF STEP]
by (cases "F i x" rule: ennreal_cases) auto
[PROOF STATE]
proof (state)
this:
enn2real (F ?i ?x) \<le> f ?x

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel = ennreal I
[PROOF STEP]
let ?F = "\<lambda>i x. F i x * indicator (?B i) x"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel = ennreal I
[PROOF STEP]
have "(\<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel) = (SUP i. integral\<^sup>N lborel (\<lambda>x. ?F i x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel = (SUP i. set_nn_integral lborel (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) (F i))
[PROOF STEP]
proof (subst nn_integral_monotone_convergence_SUP[symmetric])
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. incseq (\<lambda>i x. F i x * indicator (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x)
 2. \<And>i. (\<lambda>x. F i x * indicator (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x) \<in> borel_measurable lborel
 3. \<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel = \<integral>\<^sup>+ x. (SUP i. F i x * indicator (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x) \<partial>lborel
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. incseq (\<lambda>i x. F i x * indicator (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x)
 2. \<And>i. (\<lambda>x. F i x * indicator (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x) \<in> borel_measurable lborel
 3. \<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel = \<integral>\<^sup>+ x. (SUP i. F i x * indicator (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x) \<partial>lborel
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. incseq (\<lambda>i x. F i x * indicator (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x)
 2. \<And>i. (\<lambda>x. F i x * indicator (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x) \<in> borel_measurable lborel
 3. \<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel = \<integral>\<^sup>+ x. (SUP i. F i x * indicator (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x) \<partial>lborel
[PROOF STEP]
obtain j where j: "x \<in> ?B j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>j. x \<in> box (- (real j *\<^sub>R One)) (real j *\<^sub>R One) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using UN_box_eq_UNIV
[PROOF STATE]
proof (prove)
using this:
(\<Union>i. box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) = UNIV

goal (1 subgoal):
 1. (\<And>j. x \<in> box (- (real j *\<^sub>R One)) (real j *\<^sub>R One) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> box (- (real j *\<^sub>R One)) (real j *\<^sub>R One)

goal (3 subgoals):
 1. incseq (\<lambda>i x. F i x * indicator (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x)
 2. \<And>i. (\<lambda>x. F i x * indicator (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x) \<in> borel_measurable lborel
 3. \<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel = \<integral>\<^sup>+ x. (SUP i. F i x * indicator (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x) \<partial>lborel
[PROOF STEP]
have "ennreal (f x) = (SUP i. F i x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ennreal (f x) = (SUP i. F i x)
[PROOF STEP]
using F(4)[of x] nonneg[of x]
[PROOF STATE]
proof (prove)
using this:
(SUP i. F i x) = ennreal (f x)
0 \<le> f x

goal (1 subgoal):
 1. ennreal (f x) = (SUP i. F i x)
[PROOF STEP]
by (simp add: max_def)
[PROOF STATE]
proof (state)
this:
ennreal (f x) = (SUP i. F i x)

goal (3 subgoals):
 1. incseq (\<lambda>i x. F i x * indicator (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x)
 2. \<And>i. (\<lambda>x. F i x * indicator (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x) \<in> borel_measurable lborel
 3. \<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel = \<integral>\<^sup>+ x. (SUP i. F i x * indicator (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x) \<partial>lborel
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ennreal (f x) = (SUP i. F i x)

goal (3 subgoals):
 1. incseq (\<lambda>i x. F i x * indicator (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x)
 2. \<And>i. (\<lambda>x. F i x * indicator (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x) \<in> borel_measurable lborel
 3. \<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel = \<integral>\<^sup>+ x. (SUP i. F i x * indicator (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x) \<partial>lborel
[PROOF STEP]
have "\<dots> = (SUP i. ?F i x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SUP i. F i x) = (SUP i. F i x * indicator (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x)
[PROOF STEP]
proof (rule SUP_eq)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. i \<in> UNIV \<Longrightarrow> \<exists>j\<in>UNIV. F i x \<le> F j x * indicator (box (- (real j *\<^sub>R One)) (real j *\<^sub>R One)) x
 2. \<And>j. j \<in> UNIV \<Longrightarrow> \<exists>i\<in>UNIV. F j x * indicator (box (- (real j *\<^sub>R One)) (real j *\<^sub>R One)) x \<le> F i x
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. i \<in> UNIV \<Longrightarrow> \<exists>j\<in>UNIV. F i x \<le> F j x * indicator (box (- (real j *\<^sub>R One)) (real j *\<^sub>R One)) x
 2. \<And>j. j \<in> UNIV \<Longrightarrow> \<exists>i\<in>UNIV. F j x * indicator (box (- (real j *\<^sub>R One)) (real j *\<^sub>R One)) x \<le> F i x
[PROOF STEP]
show "\<exists>j\<in>UNIV. F i x \<le> ?F j x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>j\<in>UNIV. F i x \<le> F j x * indicator (box (- (real j *\<^sub>R One)) (real j *\<^sub>R One)) x
[PROOF STEP]
using j F(2)
[PROOF STATE]
proof (prove)
using this:
x \<in> box (- (real j *\<^sub>R One)) (real j *\<^sub>R One)
incseq F

goal (1 subgoal):
 1. \<exists>j\<in>UNIV. F i x \<le> F j x * indicator (box (- (real j *\<^sub>R One)) (real j *\<^sub>R One)) x
[PROOF STEP]
by (intro bexI[of _ "max i j"])
             (auto split: split_max split_indicator simp: incseq_def le_fun_def box_def)
[PROOF STATE]
proof (state)
this:
\<exists>j\<in>UNIV. F i x \<le> F j x * indicator (box (- (real j *\<^sub>R One)) (real j *\<^sub>R One)) x

goal (1 subgoal):
 1. \<And>j. j \<in> UNIV \<Longrightarrow> \<exists>i\<in>UNIV. F j x * indicator (box (- (real j *\<^sub>R One)) (real j *\<^sub>R One)) x \<le> F i x
[PROOF STEP]
qed (auto intro!: F split: split_indicator)
[PROOF STATE]
proof (state)
this:
(SUP i. F i x) = (SUP i. F i x * indicator (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x)

goal (3 subgoals):
 1. incseq (\<lambda>i x. F i x * indicator (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x)
 2. \<And>i. (\<lambda>x. F i x * indicator (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x) \<in> borel_measurable lborel
 3. \<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel = \<integral>\<^sup>+ x. (SUP i. F i x * indicator (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x) \<partial>lborel
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
ennreal (f x) = (SUP i. F i x * indicator (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x)
[PROOF STEP]
have "ennreal (f x) =  (SUP i. ?F i x)"
[PROOF STATE]
proof (prove)
using this:
ennreal (f x) = (SUP i. F i x * indicator (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x)

goal (1 subgoal):
 1. ennreal (f x) = (SUP i. F i x * indicator (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
ennreal (f x) = (SUP i. F i x * indicator (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x)

goal (3 subgoals):
 1. incseq (\<lambda>i x. F i x * indicator (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x)
 2. \<And>i. (\<lambda>x. F i x * indicator (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x) \<in> borel_measurable lborel
 3. \<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel = \<integral>\<^sup>+ x. (SUP i. F i x * indicator (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x) \<partial>lborel
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
ennreal (f ?x2) = (SUP i. F i ?x2 * indicator (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) ?x2)

goal (3 subgoals):
 1. incseq (\<lambda>i x. F i x * indicator (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x)
 2. \<And>i. (\<lambda>x. F i x * indicator (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x) \<in> borel_measurable lborel
 3. \<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel = \<integral>\<^sup>+ x. (SUP i. F i x * indicator (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x) \<partial>lborel
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ennreal (f ?x2) = (SUP i. F i ?x2 * indicator (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) ?x2)
[PROOF STEP]
show "(\<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel) = (\<integral>\<^sup>+ x. (SUP i. ?F i x) \<partial>lborel)"
[PROOF STATE]
proof (prove)
using this:
ennreal (f ?x2) = (SUP i. F i ?x2 * indicator (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) ?x2)

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel = \<integral>\<^sup>+ x. (SUP i. F i x * indicator (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x) \<partial>lborel
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel = \<integral>\<^sup>+ x. (SUP i. F i x * indicator (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x) \<partial>lborel

goal (2 subgoals):
 1. incseq (\<lambda>i x. F i x * indicator (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x)
 2. \<And>i. (\<lambda>x. F i x * indicator (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x) \<in> borel_measurable lborel
[PROOF STEP]
qed (insert F, auto simp: incseq_def le_fun_def box_def split: split_indicator)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel = (SUP i. set_nn_integral lborel (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) (F i))

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel = ennreal I
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel = (SUP i. set_nn_integral lborel (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) (F i))

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel = ennreal I
[PROOF STEP]
have "\<dots> \<le> ennreal I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SUP i. set_nn_integral lborel (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) (F i)) \<le> ennreal I
[PROOF STEP]
proof (rule SUP_least)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i \<in> UNIV \<Longrightarrow> set_nn_integral lborel (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) (F i) \<le> ennreal I
[PROOF STEP]
fix i :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i \<in> UNIV \<Longrightarrow> set_nn_integral lborel (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) (F i) \<le> ennreal I
[PROOF STEP]
have finite_F: "(\<integral>\<^sup>+ x. ennreal (enn2real (F i x) * indicator (?B i) x) \<partial>lborel) < \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (enn2real (F i x) * indicat_real (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x) \<partial>lborel < \<infinity>
[PROOF STEP]
proof (rule nn_integral_bound_simple_function)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. x \<in> space lborel \<Longrightarrow> ennreal (enn2real (F i x) * indicat_real (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x) < \<infinity>
 2. simple_function lborel (\<lambda>x. ennreal (enn2real (F i x) * indicat_real (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x))
 3. emeasure lborel {x \<in> space lborel. ennreal (enn2real (F i x) * indicat_real (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x) \<noteq> 0} < \<infinity>
[PROOF STEP]
have "emeasure lborel {x \<in> space lborel. ennreal (enn2real (F i x) * indicator (?B i) x) \<noteq> 0} \<le>
        emeasure lborel (?B i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure lborel {x \<in> space lborel. ennreal (enn2real (F i x) * indicat_real (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x) \<noteq> 0} \<le> emeasure lborel (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One))
[PROOF STEP]
by (intro emeasure_mono)  (auto split: split_indicator)
[PROOF STATE]
proof (state)
this:
emeasure lborel {x \<in> space lborel. ennreal (enn2real (F i x) * indicat_real (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x) \<noteq> 0} \<le> emeasure lborel (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One))

goal (3 subgoals):
 1. \<And>x. x \<in> space lborel \<Longrightarrow> ennreal (enn2real (F i x) * indicat_real (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x) < \<infinity>
 2. simple_function lborel (\<lambda>x. ennreal (enn2real (F i x) * indicat_real (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x))
 3. emeasure lborel {x \<in> space lborel. ennreal (enn2real (F i x) * indicat_real (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x) \<noteq> 0} < \<infinity>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
emeasure lborel {x \<in> space lborel. ennreal (enn2real (F i x) * indicat_real (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x) \<noteq> 0} \<le> emeasure lborel (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One))
[PROOF STEP]
show "emeasure lborel {x \<in> space lborel. ennreal (enn2real (F i x) * indicator (?B i) x) \<noteq> 0} < \<infinity>"
[PROOF STATE]
proof (prove)
using this:
emeasure lborel {x \<in> space lborel. ennreal (enn2real (F i x) * indicat_real (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x) \<noteq> 0} \<le> emeasure lborel (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One))

goal (1 subgoal):
 1. emeasure lborel {x \<in> space lborel. ennreal (enn2real (F i x) * indicat_real (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x) \<noteq> 0} < \<infinity>
[PROOF STEP]
by (auto simp: less_top[symmetric] top_unique)
[PROOF STATE]
proof (state)
this:
emeasure lborel {x \<in> space lborel. ennreal (enn2real (F i x) * indicat_real (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x) \<noteq> 0} < \<infinity>

goal (2 subgoals):
 1. \<And>x. x \<in> space lborel \<Longrightarrow> ennreal (enn2real (F i x) * indicat_real (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x) < \<infinity>
 2. simple_function lborel (\<lambda>x. ennreal (enn2real (F i x) * indicat_real (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x))
[PROOF STEP]
qed (auto split: split_indicator
              intro!: F simple_function_compose1[where g="enn2real"] simple_function_ennreal)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (enn2real (F i x) * indicat_real (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x) \<partial>lborel < \<infinity>

goal (1 subgoal):
 1. \<And>i. i \<in> UNIV \<Longrightarrow> set_nn_integral lborel (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) (F i) \<le> ennreal I
[PROOF STEP]
have int_F: "(\<lambda>x. enn2real (F i x) * indicator (?B i) x) integrable_on UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. enn2real (F i x) * indicat_real (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x) integrable_on UNIV
[PROOF STEP]
using F(4) finite_F
[PROOF STATE]
proof (prove)
using this:
(SUP i. F i ?x) = ennreal (f ?x)
\<integral>\<^sup>+ x. ennreal (enn2real (F i x) * indicat_real (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x) \<partial>lborel < \<infinity>

goal (1 subgoal):
 1. (\<lambda>x. enn2real (F i x) * indicat_real (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x) integrable_on UNIV
[PROOF STEP]
by (intro nn_integral_integrable_on) (auto split: split_indicator simp: enn2real_nonneg)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. enn2real (F i x) * indicat_real (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x) integrable_on UNIV

goal (1 subgoal):
 1. \<And>i. i \<in> UNIV \<Longrightarrow> set_nn_integral lborel (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) (F i) \<le> ennreal I
[PROOF STEP]
have "(\<integral>\<^sup>+ x. F i x * indicator (?B i) x \<partial>lborel) =
      (\<integral>\<^sup>+ x. ennreal (enn2real (F i x) * indicator (?B i) x) \<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_nn_integral lborel (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) (F i) = \<integral>\<^sup>+ x. ennreal (enn2real (F i x) * indicat_real (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x) \<partial>lborel
[PROOF STEP]
using F(3,4)
[PROOF STATE]
proof (prove)
using this:
F ?i ?x < top
(SUP i. F i ?x) = ennreal (f ?x)

goal (1 subgoal):
 1. set_nn_integral lborel (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) (F i) = \<integral>\<^sup>+ x. ennreal (enn2real (F i x) * indicat_real (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x) \<partial>lborel
[PROOF STEP]
by (intro nn_integral_cong) (auto simp: image_iff eq_commute split: split_indicator)
[PROOF STATE]
proof (state)
this:
set_nn_integral lborel (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) (F i) = \<integral>\<^sup>+ x. ennreal (enn2real (F i x) * indicat_real (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x) \<partial>lborel

goal (1 subgoal):
 1. \<And>i. i \<in> UNIV \<Longrightarrow> set_nn_integral lborel (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) (F i) \<le> ennreal I
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
set_nn_integral lborel (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) (F i) = \<integral>\<^sup>+ x. ennreal (enn2real (F i x) * indicat_real (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x) \<partial>lborel

goal (1 subgoal):
 1. \<And>i. i \<in> UNIV \<Longrightarrow> set_nn_integral lborel (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) (F i) \<le> ennreal I
[PROOF STEP]
have "\<dots> = ennreal (integral UNIV (\<lambda>x. enn2real (F i x) * indicator (?B i) x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (enn2real (F i x) * indicat_real (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x) \<partial>lborel = ennreal (integral UNIV (\<lambda>x. enn2real (F i x) * indicat_real (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x))
[PROOF STEP]
using F
[PROOF STATE]
proof (prove)
using this:
simple_function lborel (F ?i)
incseq F
F ?i ?x < top
(SUP i. F i ?x) = ennreal (f ?x)

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (enn2real (F i x) * indicat_real (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x) \<partial>lborel = ennreal (integral UNIV (\<lambda>x. enn2real (F i x) * indicat_real (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x))
[PROOF STEP]
by (intro nn_integral_lborel_eq_integral[OF _ _ finite_F])
         (auto split: split_indicator intro: enn2real_nonneg)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (enn2real (F i x) * indicat_real (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x) \<partial>lborel = ennreal (integral UNIV (\<lambda>x. enn2real (F i x) * indicat_real (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x))

goal (1 subgoal):
 1. \<And>i. i \<in> UNIV \<Longrightarrow> set_nn_integral lborel (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) (F i) \<le> ennreal I
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (enn2real (F i x) * indicat_real (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x) \<partial>lborel = ennreal (integral UNIV (\<lambda>x. enn2real (F i x) * indicat_real (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x))

goal (1 subgoal):
 1. \<And>i. i \<in> UNIV \<Longrightarrow> set_nn_integral lborel (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) (F i) \<le> ennreal I
[PROOF STEP]
have "\<dots> \<le> ennreal I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ennreal (integral UNIV (\<lambda>x. enn2real (F i x) * indicat_real (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x)) \<le> ennreal I
[PROOF STEP]
by (auto intro!: has_integral_le[OF integrable_integral[OF int_F] I] nonneg F_le_f
               simp: \<open>0 \<le> I\<close> split: split_indicator )
[PROOF STATE]
proof (state)
this:
ennreal (integral UNIV (\<lambda>x. enn2real (F i x) * indicat_real (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) x)) \<le> ennreal I

goal (1 subgoal):
 1. \<And>i. i \<in> UNIV \<Longrightarrow> set_nn_integral lborel (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) (F i) \<le> ennreal I
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
set_nn_integral lborel (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) (F i) \<le> ennreal I
[PROOF STEP]
show "(\<integral>\<^sup>+ x. F i x * indicator (?B i) x \<partial>lborel) \<le> ennreal I"
[PROOF STATE]
proof (prove)
using this:
set_nn_integral lborel (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) (F i) \<le> ennreal I

goal (1 subgoal):
 1. set_nn_integral lborel (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) (F i) \<le> ennreal I
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
set_nn_integral lborel (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) (F i) \<le> ennreal I

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(SUP i. set_nn_integral lborel (box (- (real i *\<^sub>R One)) (real i *\<^sub>R One)) (F i)) \<le> ennreal I

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel = ennreal I
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel \<le> ennreal I
[PROOF STEP]
have "(\<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel) < \<infinity>"
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel \<le> ennreal I

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel < \<infinity>
[PROOF STEP]
by (auto simp: less_top[symmetric] top_unique)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel < \<infinity>

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel = ennreal I
[PROOF STEP]
from nn_integral_lborel_eq_integral[OF assms(1,2) this] I
[PROOF STATE]
proof (chain)
picking this:
\<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel = ennreal (integral UNIV f)
(f has_integral I) UNIV
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel = ennreal (integral UNIV f)
(f has_integral I) UNIV

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel = ennreal I
[PROOF STEP]
by (simp add: integral_unique)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (f x) \<partial>lborel = ennreal I

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma span_Int: "span (span A \<inter> span B) = span A \<inter> span B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. span (span A \<inter> span B) = span A \<inter> span B
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. span (span A \<inter> span B) = span A \<inter> span B
[PROOF STEP]
have "span (span A \<inter> span B) = span (\<Inter>x\<in>{A, B}. span x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. span (span A \<inter> span B) = span (\<Inter> (span ` {A, B}))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
span (span A \<inter> span B) = span (\<Inter> (span ` {A, B}))

goal (1 subgoal):
 1. span (span A \<inter> span B) = span A \<inter> span B
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
span (span A \<inter> span B) = span (\<Inter> (span ` {A, B}))

goal (1 subgoal):
 1. span (span A \<inter> span B) = span A \<inter> span B
[PROOF STEP]
have "\<dots> = (\<Inter>x\<in>{A, B}. span x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. span (\<Inter> (span ` {A, B})) = \<Inter> (span ` {A, B})
[PROOF STEP]
by (fact span_INT)
[PROOF STATE]
proof (state)
this:
span (\<Inter> (span ` {A, B})) = \<Inter> (span ` {A, B})

goal (1 subgoal):
 1. span (span A \<inter> span B) = span A \<inter> span B
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
span (\<Inter> (span ` {A, B})) = \<Inter> (span ` {A, B})

goal (1 subgoal):
 1. span (span A \<inter> span B) = span A \<inter> span B
[PROOF STEP]
have "\<dots> = span A \<inter> span B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Inter> (span ` {A, B}) = span A \<inter> span B
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<Inter> (span ` {A, B}) = span A \<inter> span B

goal (1 subgoal):
 1. span (span A \<inter> span B) = span A \<inter> span B
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
span (span A \<inter> span B) = span A \<inter> span B
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
span (span A \<inter> span B) = span A \<inter> span B

goal (1 subgoal):
 1. span (span A \<inter> span B) = span A \<inter> span B
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
span (span A \<inter> span B) = span A \<inter> span B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_set_Cons_finite':
  "\<lbrakk>finite xs; finite ys\<rbrakk> \<Longrightarrow> finite {x # y |x y. x \<in> xs \<and> y \<in> ys}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite xs; finite ys\<rbrakk> \<Longrightarrow> finite {x # y |x y. x \<in> xs \<and> y \<in> ys}
[PROOF STEP]
by (auto simp add: finite_image_set2)


[STATEMENT]
lemma gso_norm_beta:
  assumes "j < m"
  shows "\<beta> fs j = sq_norm (gso j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<beta> fs j = \<parallel>gso j\<parallel>\<^sup>2
[PROOF STEP]
unfolding \<beta>_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d (Suc j) / d j = \<parallel>gso j\<parallel>\<^sup>2
[PROOF STEP]
using assms dist
[PROOF STATE]
proof (prove)
using this:
j < length fs
distinct fs

goal (1 subgoal):
 1. d (Suc j) / d j = \<parallel>gso j\<parallel>\<^sup>2
[PROOF STEP]
by (auto simp add: Gramian_determinant_div sq_norm_vec_as_cscalar_prod)


[STATEMENT]
lemma iT_Plus_neg_iAll_conv: "(\<box> t I \<oplus>- k. P t) = (\<box> t (I \<down>\<ge> k). P (t - k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<box> t I \<oplus>- k. P t) = (\<box> t I \<down>\<ge> k. P (t - k))
[PROOF STEP]
apply (unfold iAll_def Ball_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. x \<in> I \<oplus>- k \<longrightarrow> P x) = (\<forall>x. x \<in> I \<down>\<ge> k \<longrightarrow> P (x - k))
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>x. x \<in> I \<oplus>- k \<longrightarrow> P x \<Longrightarrow> \<forall>x. x \<in> I \<down>\<ge> k \<longrightarrow> P (x - k)
 2. \<forall>x. x \<in> I \<down>\<ge> k \<longrightarrow> P (x - k) \<Longrightarrow> \<forall>x. x \<in> I \<oplus>- k \<longrightarrow> P x
[PROOF STEP]
apply (clarify, rename_tac x)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>\<forall>x. x \<in> I \<oplus>- k \<longrightarrow> P x; x \<in> I; k \<le> x\<rbrakk> \<Longrightarrow> P (x - k)
 2. \<forall>x. x \<in> I \<down>\<ge> k \<longrightarrow> P (x - k) \<Longrightarrow> \<forall>x. x \<in> I \<oplus>- k \<longrightarrow> P x
[PROOF STEP]
apply (drule_tac x="x - k" in spec)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>x \<in> I; k \<le> x; x - k \<in> I \<oplus>- k \<longrightarrow> P (x - k)\<rbrakk> \<Longrightarrow> P (x - k)
 2. \<forall>x. x \<in> I \<down>\<ge> k \<longrightarrow> P (x - k) \<Longrightarrow> \<forall>x. x \<in> I \<oplus>- k \<longrightarrow> P x
[PROOF STEP]
apply (simp add: iT_Plus_neg_mem_iff2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. x \<in> I \<down>\<ge> k \<longrightarrow> P (x - k) \<Longrightarrow> \<forall>x. x \<in> I \<oplus>- k \<longrightarrow> P x
[PROOF STEP]
apply (clarify, rename_tac x)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<forall>x. x \<in> I \<down>\<ge> k \<longrightarrow> P (x - k); x \<in> I \<oplus>- k\<rbrakk> \<Longrightarrow> P x
[PROOF STEP]
apply (drule_tac x="x + k" in spec)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> I \<oplus>- k; x + k \<in> I \<down>\<ge> k \<longrightarrow> P (x + k - k)\<rbrakk> \<Longrightarrow> P x
[PROOF STEP]
apply (simp add: iT_Plus_neg_mem_iff cut_ge_mem_iff)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma prefix_less_le_not_le: "!!xs::'a list. (xs < zs) = (xs <= zs & \<not> zs \<le> xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xs. (xs < zs) = (xs \<le> zs \<and> \<not> zs \<le> xs)
[PROOF STEP]
by (unfold strict_prefix_def, auto)


[STATEMENT]
lemma interior_diff: "interior(S - T) = interior S - closure T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interior (S - T) = interior S - closure T
[PROOF STEP]
by (simp add: Diff_eq interior_complement)


[STATEMENT]
lemma nn_integral_has_integral_lebesgue:
  fixes f :: "'a::euclidean_space \<Rightarrow> real"
  assumes nonneg: "\<And>x. x \<in> \<Omega> \<Longrightarrow> 0 \<le> f x" and I: "(f has_integral I) \<Omega>"
  shows "integral\<^sup>N lborel (\<lambda>x. indicator \<Omega> x * f x) = I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real \<Omega> x * f x) \<partial>lborel = ennreal I
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real \<Omega> x * f x) \<partial>lborel = ennreal I
[PROOF STEP]
from I
[PROOF STATE]
proof (chain)
picking this:
(f has_integral I) \<Omega>
[PROOF STEP]
have "(\<lambda>x. indicator \<Omega> x *\<^sub>R f x) \<in> lebesgue \<rightarrow>\<^sub>M borel"
[PROOF STATE]
proof (prove)
using this:
(f has_integral I) \<Omega>

goal (1 subgoal):
 1. (\<lambda>x. indicat_real \<Omega> x *\<^sub>R f x) \<in> borel_measurable lebesgue
[PROOF STEP]
by (rule has_integral_implies_lebesgue_measurable)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. indicat_real \<Omega> x *\<^sub>R f x) \<in> borel_measurable lebesgue

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real \<Omega> x * f x) \<partial>lborel = ennreal I
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. indicat_real \<Omega> x *\<^sub>R f x) \<in> borel_measurable lebesgue
[PROOF STEP]
obtain f' :: "'a \<Rightarrow> real"
    where [measurable]: "f' \<in> borel \<rightarrow>\<^sub>M borel" and eq: "AE x in lborel. indicator \<Omega> x * f x = f' x"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. indicat_real \<Omega> x *\<^sub>R f x) \<in> borel_measurable lebesgue

goal (1 subgoal):
 1. (\<And>f'. \<lbrakk>f' \<in> borel_measurable borel; AE x in lborel. indicat_real \<Omega> x * f x = f' x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto dest: completion_ex_borel_measurable_real)
[PROOF STATE]
proof (state)
this:
f' \<in> borel_measurable borel
AE x in lborel. indicat_real \<Omega> x * f x = f' x

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real \<Omega> x * f x) \<partial>lborel = ennreal I
[PROOF STEP]
from I
[PROOF STATE]
proof (chain)
picking this:
(f has_integral I) \<Omega>
[PROOF STEP]
have "((\<lambda>x. abs (indicator \<Omega> x * f x)) has_integral I) UNIV"
[PROOF STATE]
proof (prove)
using this:
(f has_integral I) \<Omega>

goal (1 subgoal):
 1. ((\<lambda>x. \<bar>indicat_real \<Omega> x * f x\<bar>) has_integral I) UNIV
[PROOF STEP]
using nonneg
[PROOF STATE]
proof (prove)
using this:
(f has_integral I) \<Omega>
?x \<in> \<Omega> \<Longrightarrow> 0 \<le> f ?x

goal (1 subgoal):
 1. ((\<lambda>x. \<bar>indicat_real \<Omega> x * f x\<bar>) has_integral I) UNIV
[PROOF STEP]
by (simp add: indicator_def of_bool_def if_distrib[of "\<lambda>x. x * f y" for y] cong: if_cong)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<bar>indicat_real \<Omega> x * f x\<bar>) has_integral I) UNIV

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real \<Omega> x * f x) \<partial>lborel = ennreal I
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<bar>indicat_real \<Omega> x * f x\<bar>) has_integral I) UNIV

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real \<Omega> x * f x) \<partial>lborel = ennreal I
[PROOF STEP]
have "((\<lambda>x. abs (indicator \<Omega> x * f x)) has_integral I) UNIV \<longleftrightarrow> ((\<lambda>x. abs (f' x)) has_integral I) UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. \<bar>indicat_real \<Omega> x * f x\<bar>) has_integral I) UNIV = ((\<lambda>x. \<bar>f' x\<bar>) has_integral I) UNIV
[PROOF STEP]
using eq
[PROOF STATE]
proof (prove)
using this:
AE x in lborel. indicat_real \<Omega> x * f x = f' x

goal (1 subgoal):
 1. ((\<lambda>x. \<bar>indicat_real \<Omega> x * f x\<bar>) has_integral I) UNIV = ((\<lambda>x. \<bar>f' x\<bar>) has_integral I) UNIV
[PROOF STEP]
by (intro has_integral_AE) auto
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<bar>indicat_real \<Omega> x * f x\<bar>) has_integral I) UNIV = ((\<lambda>x. \<bar>f' x\<bar>) has_integral I) UNIV

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real \<Omega> x * f x) \<partial>lborel = ennreal I
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. \<bar>f' x\<bar>) has_integral I) UNIV
[PROOF STEP]
have "integral\<^sup>N lborel (\<lambda>x. abs (f' x)) = I"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. \<bar>f' x\<bar>) has_integral I) UNIV

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal \<bar>f' x\<bar> \<partial>lborel = ennreal I
[PROOF STEP]
by (rule nn_integral_has_integral_lborel[rotated 2]) auto
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal \<bar>f' x\<bar> \<partial>lborel = ennreal I

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real \<Omega> x * f x) \<partial>lborel = ennreal I
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal \<bar>f' x\<bar> \<partial>lborel = ennreal I

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real \<Omega> x * f x) \<partial>lborel = ennreal I
[PROOF STEP]
have "integral\<^sup>N lborel (\<lambda>x. abs (f' x)) = integral\<^sup>N lborel (\<lambda>x. abs (indicator \<Omega> x * f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal \<bar>f' x\<bar> \<partial>lborel = \<integral>\<^sup>+ x. ennreal \<bar>indicat_real \<Omega> x * f x\<bar> \<partial>lborel
[PROOF STEP]
using eq
[PROOF STATE]
proof (prove)
using this:
AE x in lborel. indicat_real \<Omega> x * f x = f' x

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal \<bar>f' x\<bar> \<partial>lborel = \<integral>\<^sup>+ x. ennreal \<bar>indicat_real \<Omega> x * f x\<bar> \<partial>lborel
[PROOF STEP]
by (intro nn_integral_cong_AE) auto
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal \<bar>f' x\<bar> \<partial>lborel = \<integral>\<^sup>+ x. ennreal \<bar>indicat_real \<Omega> x * f x\<bar> \<partial>lborel

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real \<Omega> x * f x) \<partial>lborel = ennreal I
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal \<bar>f' x\<bar> \<partial>lborel = \<integral>\<^sup>+ x. ennreal \<bar>indicat_real \<Omega> x * f x\<bar> \<partial>lborel

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real \<Omega> x * f x) \<partial>lborel = ennreal I
[PROOF STEP]
have "(\<lambda>x. abs (indicator \<Omega> x * f x)) = (\<lambda>x. indicator \<Omega> x * f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<bar>indicat_real \<Omega> x * f x\<bar>) = (\<lambda>x. indicat_real \<Omega> x * f x)
[PROOF STEP]
using nonneg
[PROOF STATE]
proof (prove)
using this:
?x \<in> \<Omega> \<Longrightarrow> 0 \<le> f ?x

goal (1 subgoal):
 1. (\<lambda>x. \<bar>indicat_real \<Omega> x * f x\<bar>) = (\<lambda>x. indicat_real \<Omega> x * f x)
[PROOF STEP]
by (auto simp: indicator_def fun_eq_iff)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<bar>indicat_real \<Omega> x * f x\<bar>) = (\<lambda>x. indicat_real \<Omega> x * f x)

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real \<Omega> x * f x) \<partial>lborel = ennreal I
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<integral>\<^sup>+ x. ennreal (indicat_real \<Omega> x * f x) \<partial>lborel = ennreal I
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. ennreal (indicat_real \<Omega> x * f x) \<partial>lborel = ennreal I

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (indicat_real \<Omega> x * f x) \<partial>lborel = ennreal I
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (indicat_real \<Omega> x * f x) \<partial>lborel = ennreal I

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma map_commutes: fixes f::"'a => 'b" fixes Q::"'b => bool" fixes xs::"'a list"
                    shows "[f n . n <- xs, Q (f n)] = [x <- (map f xs). Q x]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. concat (map (\<lambda>n. if Q (f n) then [f n] else []) xs) = filter Q (map f xs)
[PROOF STEP]
using map_commutes_a map_commutes_b structInduct
[PROOF STATE]
proof (prove)
using this:
concat (map (\<lambda>n. if ?Q (?f n) then [?f n] else []) []) = filter ?Q (map ?f [])
\<forall>x xs. concat (map (\<lambda>n. if ?Q (?f n) then [?f n] else []) xs) = filter ?Q (map ?f xs) \<longrightarrow> concat (map (\<lambda>n. if ?Q (?f n) then [?f n] else []) (x # xs)) = filter ?Q (map ?f (x # xs))
\<lbrakk>?P []; \<forall>x xs. ?P xs \<longrightarrow> ?P (x # xs)\<rbrakk> \<Longrightarrow> ?P ?l

goal (1 subgoal):
 1. concat (map (\<lambda>n. if Q (f n) then [f n] else []) xs) = filter Q (map f xs)
[PROOF STEP]
by fast


[STATEMENT]
lemma iprev_nth_imirror_inext_nth_conv: "
  \<lbrakk> finite I; I \<noteq> {} \<rbrakk> \<Longrightarrow>
  (imirror I) \<leftarrow> n = mirror_elem (I \<rightarrow> n) I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; I \<noteq> {}\<rbrakk> \<Longrightarrow> imirror I \<leftarrow> n = mirror_elem (I \<rightarrow> n) I
[PROOF STEP]
apply (induct n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>finite I; I \<noteq> {}\<rbrakk> \<Longrightarrow> imirror I \<leftarrow> 0 = mirror_elem (I \<rightarrow> 0) I
 2. \<And>n. \<lbrakk>\<lbrakk>finite I; I \<noteq> {}\<rbrakk> \<Longrightarrow> imirror I \<leftarrow> n = mirror_elem (I \<rightarrow> n) I; finite I; I \<noteq> {}\<rbrakk> \<Longrightarrow> imirror I \<leftarrow> Suc n = mirror_elem (I \<rightarrow> Suc n) I
[PROOF STEP]
apply (simp add: imirror_Max mirror_elem_Min)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>finite I; I \<noteq> {}\<rbrakk> \<Longrightarrow> imirror I \<leftarrow> n = mirror_elem (I \<rightarrow> n) I; finite I; I \<noteq> {}\<rbrakk> \<Longrightarrow> imirror I \<leftarrow> Suc n = mirror_elem (I \<rightarrow> Suc n) I
[PROOF STEP]
apply (simp add: iprev_imirror_inext_conv' inext_nth_closed)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma row_space_eq:
  fixes A::"'a::{field}^'m^'n::{finite, wellorder}"
  shows "row_space A = {w. \<exists>y. (transpose A) *v y = w}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row_space A = {w. \<exists>y. Finite_Cartesian_Product.transpose A *v y = w}
[PROOF STEP]
unfolding row_space_eq_col_space_transpose col_space_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {y. \<exists>x. Finite_Cartesian_Product.transpose A *v x = y} = {w. \<exists>y. Finite_Cartesian_Product.transpose A *v y = w}
[PROOF STEP]
..


[STATEMENT]
lemma pp_star_contl: "pp_prod X (pp_star Y) = (\<Union>n. pp_prod X (ppath_dioid.power Y n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pp_prod X (pp_star Y) = (\<Union>n. pp_prod X (ppath_dioid.power Y n))
[PROOF STEP]
by (auto simp add: pp_prod_def pp_star_elim)


[STATEMENT]
lemma (in euclidean_space) euclidean_representation_sum':
  "b = (\<Sum>i\<in>Basis. f i *\<^sub>R i) \<longleftrightarrow> (\<forall>i\<in>Basis. f i = inner b i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (b = (\<Sum>i\<in>Basis. f i *\<^sub>R i)) = (\<forall>i\<in>Basis. f i = inner b i)
[PROOF STEP]
by (auto simp add: euclidean_representation_sum[symmetric])


[STATEMENT]
lemma Arg_inverse_eq_0: "Arg(inverse z) = 0 \<longleftrightarrow> Arg z = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Arg (inverse z) = 0) = (Arg z = 0)
[PROOF STEP]
by (metis Arg_eq_0 Arg_inverse inverse_inverse_eq)


[STATEMENT]
lemma scaleR_mono:
  "a \<le> b \<Longrightarrow> x \<le> y \<Longrightarrow> 0 \<le> b \<Longrightarrow> 0 \<le> x \<Longrightarrow> a *\<^sub>R x \<le> b *\<^sub>R y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> b; x \<le> y; 0 \<le> b; (0::'a) \<le> x\<rbrakk> \<Longrightarrow> a *\<^sub>R x \<le> b *\<^sub>R y
[PROOF STEP]
by (meson order_trans scaleR_left_mono scaleR_right_mono)


[STATEMENT]
lemma range_inter: "range ((\<inter>) F) = Pow F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. range ((\<inter>) F) = Pow F
[PROOF STEP]
unfolding image_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {y. \<exists>x\<in>UNIV. y = F \<inter> x} = Pow F
[PROOF STEP]
by auto


[STATEMENT]
lemma expands_to_powr_nat_0_0:
  assumes "eventually (\<lambda>x. f x = 0) at_top" "eventually (\<lambda>x. g x = 0) at_top"
          "basis_wf basis" "length basis = expansion_level TYPE('a :: multiseries)"
  shows   "((\<lambda>x. powr_nat (f x) (g x)) expands_to (const_expansion 1 :: 'a)) basis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. powr_nat (f x) (g x)) expands_to const_expansion 1) basis
[PROOF STEP]
proof (rule expands_to_cong [OF expands_to_const])
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. basis_wf basis
 2. length basis = expansion_level TYPE('a)
 3. \<forall>\<^sub>F x in at_top. 1 = powr_nat (f x) (g x)
[PROOF STEP]
from assms(1,2)
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in at_top. f x = 0
\<forall>\<^sub>F x in at_top. g x = 0
[PROOF STEP]
show "eventually (\<lambda>x. 1 = powr_nat (f x) (g x)) at_top"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. f x = 0
\<forall>\<^sub>F x in at_top. g x = 0

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. 1 = powr_nat (f x) (g x)
[PROOF STEP]
by eventually_elim (simp add: powr_nat_def)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. 1 = powr_nat (f x) (g x)

goal (2 subgoals):
 1. basis_wf basis
 2. length basis = expansion_level TYPE('a)
[PROOF STEP]
qed fact+


[STATEMENT]
lemma perm_eq_lam:
  fixes f  :: "'a\<Rightarrow>'b"
  and   x  :: "'a"
  and   pi :: "'x prm"
  shows "((pi\<bullet>(\<lambda>x. f x))=y) = ((\<lambda>x. (pi\<bullet>(f ((rev pi)\<bullet>x))))=y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (pi \<bullet> f = y) = ((\<lambda>x. pi \<bullet> f (rev pi \<bullet> x)) = y)
[PROOF STEP]
by (simp add: perm_fun_def)


[STATEMENT]
lemma f_shrink_last_message[rule_format]: "
  length xs mod k = 0 \<longrightarrow> last_message (xs \<div>\<^sub>f k) = last_message xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length xs mod k = 0 \<longrightarrow> last_message (xs \<div> k) = last_message xs
[PROOF STEP]
apply (case_tac "k = 0", simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<noteq> 0 \<Longrightarrow> length xs mod k = 0 \<longrightarrow> last_message (xs \<div> k) = last_message xs
[PROOF STEP]
apply (rule append_constant_length_induct[of k])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>ys. \<lbrakk>k \<noteq> 0; k = 0 \<or> length ys < k\<rbrakk> \<Longrightarrow> length ys mod k = 0 \<longrightarrow> last_message (ys \<div> k) = last_message ys
 2. \<And>xs ys. \<lbrakk>k \<noteq> 0; length xs = k; length ys mod k = 0 \<longrightarrow> last_message (ys \<div> k) = last_message ys\<rbrakk> \<Longrightarrow> length (xs @ ys) mod k = 0 \<longrightarrow> last_message ((xs @ ys) \<div> k) = last_message (xs @ ys)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xs ys. \<lbrakk>k \<noteq> 0; length xs = k; length ys mod k = 0 \<longrightarrow> last_message (ys \<div> k) = last_message ys\<rbrakk> \<Longrightarrow> length (xs @ ys) mod k = 0 \<longrightarrow> last_message ((xs @ ys) \<div> k) = last_message (xs @ ys)
[PROOF STEP]
apply (simp add: f_shrink_Cons last_message_append)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma chain_boundary_simplicial_cone:
  "simplicial_chain p S c
   \<Longrightarrow> chain_boundary (Suc p) (simplicial_cone p v c) =
       c - (if p = 0 then frag_extend (\<lambda>f. frag_of (\<lambda>u\<in>standard_simplex p. v)) c
            else simplicial_cone (p -1) v (chain_boundary p c))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. simplicial_chain p S c \<Longrightarrow> chain_boundary (Suc p) (simplicial_cone p v c) = c - (if p = 0 then frag_extend (\<lambda>f. frag_of (\<lambda>u\<in>standard_simplex p. v)) c else simplicial_cone (p - 1) v (chain_boundary p c))
[PROOF STEP]
unfolding simplicial_chain_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Poly_Mapping.keys c \<subseteq> Collect (simplicial_simplex p S) \<Longrightarrow> chain_boundary (Suc p) (simplicial_cone p v c) = c - (if p = 0 then frag_extend (\<lambda>f. frag_of (\<lambda>u\<in>standard_simplex p. v)) c else simplicial_cone (p - 1) v (chain_boundary p c))
[PROOF STEP]
proof (induction rule: frag_induction)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. chain_boundary (Suc p) (simplicial_cone p v 0) = 0 - (if p = 0 then frag_extend (\<lambda>f. frag_of (\<lambda>u\<in>standard_simplex p. v)) 0 else simplicial_cone (p - 1) v (chain_boundary p 0))
 2. \<And>x. x \<in> Collect (simplicial_simplex p S) \<Longrightarrow> chain_boundary (Suc p) (simplicial_cone p v (frag_of x)) = frag_of x - (if p = 0 then frag_extend (\<lambda>f. frag_of (\<lambda>u\<in>standard_simplex p. v)) (frag_of x) else simplicial_cone (p - 1) v (chain_boundary p (frag_of x)))
 3. \<And>a b. \<lbrakk>chain_boundary (Suc p) (simplicial_cone p v a) = a - (if p = 0 then frag_extend (\<lambda>f. frag_of (\<lambda>u\<in>standard_simplex p. v)) a else simplicial_cone (p - 1) v (chain_boundary p a)); chain_boundary (Suc p) (simplicial_cone p v b) = b - (if p = 0 then frag_extend (\<lambda>f. frag_of (\<lambda>u\<in>standard_simplex p. v)) b else simplicial_cone (p - 1) v (chain_boundary p b))\<rbrakk> \<Longrightarrow> chain_boundary (Suc p) (simplicial_cone p v (a - b)) = a - b - (if p = 0 then frag_extend (\<lambda>f. frag_of (\<lambda>u\<in>standard_simplex p. v)) (a - b) else simplicial_cone (p - 1) v (chain_boundary p (a - b)))
[PROOF STEP]
case (one x)
[PROOF STATE]
proof (state)
this:
x \<in> Collect (simplicial_simplex p S)

goal (3 subgoals):
 1. chain_boundary (Suc p) (simplicial_cone p v 0) = 0 - (if p = 0 then frag_extend (\<lambda>f. frag_of (\<lambda>u\<in>standard_simplex p. v)) 0 else simplicial_cone (p - 1) v (chain_boundary p 0))
 2. \<And>x. x \<in> Collect (simplicial_simplex p S) \<Longrightarrow> chain_boundary (Suc p) (simplicial_cone p v (frag_of x)) = frag_of x - (if p = 0 then frag_extend (\<lambda>f. frag_of (\<lambda>u\<in>standard_simplex p. v)) (frag_of x) else simplicial_cone (p - 1) v (chain_boundary p (frag_of x)))
 3. \<And>a b. \<lbrakk>chain_boundary (Suc p) (simplicial_cone p v a) = a - (if p = 0 then frag_extend (\<lambda>f. frag_of (\<lambda>u\<in>standard_simplex p. v)) a else simplicial_cone (p - 1) v (chain_boundary p a)); chain_boundary (Suc p) (simplicial_cone p v b) = b - (if p = 0 then frag_extend (\<lambda>f. frag_of (\<lambda>u\<in>standard_simplex p. v)) b else simplicial_cone (p - 1) v (chain_boundary p b))\<rbrakk> \<Longrightarrow> chain_boundary (Suc p) (simplicial_cone p v (a - b)) = a - b - (if p = 0 then frag_extend (\<lambda>f. frag_of (\<lambda>u\<in>standard_simplex p. v)) (a - b) else simplicial_cone (p - 1) v (chain_boundary p (a - b)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> Collect (simplicial_simplex p S)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
x \<in> Collect (simplicial_simplex p S)

goal (1 subgoal):
 1. chain_boundary (Suc p) (simplicial_cone p v (frag_of x)) = frag_of x - (if p = 0 then frag_extend (\<lambda>f. frag_of (\<lambda>u\<in>standard_simplex p. v)) (frag_of x) else simplicial_cone (p - 1) v (chain_boundary p (frag_of x)))
[PROOF STEP]
by (auto simp: chain_boundary_simplicial_cone_of)
[PROOF STATE]
proof (state)
this:
chain_boundary (Suc p) (simplicial_cone p v (frag_of x)) = frag_of x - (if p = 0 then frag_extend (\<lambda>f. frag_of (\<lambda>u\<in>standard_simplex p. v)) (frag_of x) else simplicial_cone (p - 1) v (chain_boundary p (frag_of x)))

goal (2 subgoals):
 1. chain_boundary (Suc p) (simplicial_cone p v 0) = 0 - (if p = 0 then frag_extend (\<lambda>f. frag_of (\<lambda>u\<in>standard_simplex p. v)) 0 else simplicial_cone (p - 1) v (chain_boundary p 0))
 2. \<And>a b. \<lbrakk>chain_boundary (Suc p) (simplicial_cone p v a) = a - (if p = 0 then frag_extend (\<lambda>f. frag_of (\<lambda>u\<in>standard_simplex p. v)) a else simplicial_cone (p - 1) v (chain_boundary p a)); chain_boundary (Suc p) (simplicial_cone p v b) = b - (if p = 0 then frag_extend (\<lambda>f. frag_of (\<lambda>u\<in>standard_simplex p. v)) b else simplicial_cone (p - 1) v (chain_boundary p b))\<rbrakk> \<Longrightarrow> chain_boundary (Suc p) (simplicial_cone p v (a - b)) = a - b - (if p = 0 then frag_extend (\<lambda>f. frag_of (\<lambda>u\<in>standard_simplex p. v)) (a - b) else simplicial_cone (p - 1) v (chain_boundary p (a - b)))
[PROOF STEP]
qed (auto simp: chain_boundary_diff simplicial_cone_def frag_extend_diff)


[STATEMENT]
lemma lim_at_infinity_0:
  fixes l :: "'a::{real_normed_field,field}"
  shows "(f \<longlongrightarrow> l) at_infinity \<longleftrightarrow> ((f \<circ> inverse) \<longlongrightarrow> l) (at (0::'a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<longlongrightarrow> l) at_infinity = (f \<circ> inverse) \<midarrow>0::'a\<rightarrow> l
[PROOF STEP]
by (simp add: tendsto_compose_filtermap at_to_infinity filtermap_filtermap)


[STATEMENT]
lemma flat_empty_iff: "flat xss = [] \<longleftrightarrow> (\<forall>xs \<in> set xss. xs = [])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (flat xss = []) = (\<forall>xs\<in>set xss. xs = [])
[PROOF STEP]
by (auto simp: flat_def fold_union_empty_iff)


[STATEMENT]
lemma enat_less_INF_I:
  fixes f :: "'a \<Rightarrow> enat"
  assumes not_inf: "x \<noteq> \<infinity>" and less: "\<And>y. y \<in> S \<Longrightarrow> x < f y"
  shows "x < (INF y\<in>S. f y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < Inf (f ` S)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<noteq> \<infinity>
?y \<in> S \<Longrightarrow> x < f ?y

goal (1 subgoal):
 1. x < Inf (f ` S)
[PROOF STEP]
by (auto simp: Suc_ile_eq[symmetric] INF_greatest)


[STATEMENT]
theorem assumes ms: "measure_space M" shows
  rv_less_iff: "(f \<in> rv M) = (\<forall>a. {w. f w < a} \<in> measurable_sets M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<in> rv M) = (\<forall>a. {w. f w < a} \<in> measurable_sets M)
[PROOF STEP]
(*<*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<in> rv M) = (\<forall>a. {w. f w < a} \<in> measurable_sets M)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (f \<in> rv M) = (\<forall>a. {w. f w < a} \<in> measurable_sets M)
[PROOF STEP]
from ms
[PROOF STATE]
proof (chain)
picking this:
measure_space M
[PROOF STEP]
have "(f \<in> rv M) = (\<forall>a. {w. a \<le> f w} \<in> measurable_sets M)"
[PROOF STATE]
proof (prove)
using this:
measure_space M

goal (1 subgoal):
 1. (f \<in> rv M) = (\<forall>a. {w. a \<le> f w} \<in> measurable_sets M)
[PROOF STEP]
by (rule rv_ge_iff)
[PROOF STATE]
proof (state)
this:
(f \<in> rv M) = (\<forall>a. {w. a \<le> f w} \<in> measurable_sets M)

goal (1 subgoal):
 1. (f \<in> rv M) = (\<forall>a. {w. f w < a} \<in> measurable_sets M)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(f \<in> rv M) = (\<forall>a. {w. a \<le> f w} \<in> measurable_sets M)

goal (1 subgoal):
 1. (f \<in> rv M) = (\<forall>a. {w. f w < a} \<in> measurable_sets M)
[PROOF STEP]
have "\<dots> = (\<forall>a. {w. f w < a} \<in> measurable_sets M)" (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>a. {w. a \<le> f w} \<in> measurable_sets M) = (\<forall>a. {w. f w < a} \<in> measurable_sets M)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<forall>a. {w. a \<le> f w} \<in> measurable_sets M) = (\<forall>a. {w. f w < a} \<in> measurable_sets M)
[PROOF STEP]
from ms
[PROOF STATE]
proof (chain)
picking this:
measure_space M
[PROOF STEP]
have sigma: "sigma_algebra (measurable_sets M)"
[PROOF STATE]
proof (prove)
using this:
measure_space M

goal (1 subgoal):
 1. sigma_algebra (measurable_sets M)
[PROOF STEP]
by (simp only: measure_space_def)
[PROOF STATE]
proof (state)
this:
sigma_algebra (measurable_sets M)

goal (1 subgoal):
 1. (\<forall>a. {w. a \<le> f w} \<in> measurable_sets M) = (\<forall>a. {w. f w < a} \<in> measurable_sets M)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sigma_algebra (measurable_sets M)

goal (1 subgoal):
 1. (\<forall>a. {w. a \<le> f w} \<in> measurable_sets M) = (\<forall>a. {w. f w < a} \<in> measurable_sets M)
[PROOF STEP]
note le_less gr_le ge_gr
[PROOF STATE]
proof (state)
this:
\<lbrakk>sigma_algebra ?A; \<forall>a. {w. ?f w \<le> a} \<in> ?A\<rbrakk> \<Longrightarrow> \<forall>a. {w. ?f w < a} \<in> ?A
\<lbrakk>sigma_algebra ?A; \<forall>a. {w. a < ?f w} \<in> ?A\<rbrakk> \<Longrightarrow> \<forall>a. {w. ?f w \<le> a} \<in> ?A
\<lbrakk>sigma_algebra ?A; \<forall>a. {w. a \<le> ?f w} \<in> ?A\<rbrakk> \<Longrightarrow> \<forall>a. {w. a < ?f w} \<in> ?A

goal (1 subgoal):
 1. (\<forall>a. {w. a \<le> f w} \<in> measurable_sets M) = (\<forall>a. {w. f w < a} \<in> measurable_sets M)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
sigma_algebra (measurable_sets M)
\<lbrakk>sigma_algebra ?A; \<forall>a. {w. ?f w \<le> a} \<in> ?A\<rbrakk> \<Longrightarrow> \<forall>a. {w. ?f w < a} \<in> ?A
\<lbrakk>sigma_algebra ?A; \<forall>a. {w. a < ?f w} \<in> ?A\<rbrakk> \<Longrightarrow> \<forall>a. {w. ?f w \<le> a} \<in> ?A
\<lbrakk>sigma_algebra ?A; \<forall>a. {w. a \<le> ?f w} \<in> ?A\<rbrakk> \<Longrightarrow> \<forall>a. {w. a < ?f w} \<in> ?A
[PROOF STEP]
have "?lhs \<Longrightarrow> ?rhs"
[PROOF STATE]
proof (prove)
using this:
sigma_algebra (measurable_sets M)
\<lbrakk>sigma_algebra ?A; \<forall>a. {w. ?f w \<le> a} \<in> ?A\<rbrakk> \<Longrightarrow> \<forall>a. {w. ?f w < a} \<in> ?A
\<lbrakk>sigma_algebra ?A; \<forall>a. {w. a < ?f w} \<in> ?A\<rbrakk> \<Longrightarrow> \<forall>a. {w. ?f w \<le> a} \<in> ?A
\<lbrakk>sigma_algebra ?A; \<forall>a. {w. a \<le> ?f w} \<in> ?A\<rbrakk> \<Longrightarrow> \<forall>a. {w. a < ?f w} \<in> ?A

goal (1 subgoal):
 1. \<forall>a. {w. a \<le> f w} \<in> measurable_sets M \<Longrightarrow> \<forall>a. {w. f w < a} \<in> measurable_sets M
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>a. {w. a \<le> f w} \<in> measurable_sets M \<Longrightarrow> \<forall>a. {w. f w < a} \<in> measurable_sets M

goal (1 subgoal):
 1. (\<forall>a. {w. a \<le> f w} \<in> measurable_sets M) = (\<forall>a. {w. f w < a} \<in> measurable_sets M)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<forall>a. {w. a \<le> f w} \<in> measurable_sets M \<Longrightarrow> \<forall>a. {w. f w < a} \<in> measurable_sets M

goal (1 subgoal):
 1. (\<forall>a. {w. a \<le> f w} \<in> measurable_sets M) = (\<forall>a. {w. f w < a} \<in> measurable_sets M)
[PROOF STEP]
from sigma less_ge
[PROOF STATE]
proof (chain)
picking this:
sigma_algebra (measurable_sets M)
\<lbrakk>sigma_algebra ?A; \<forall>a. {w. ?f w < a} \<in> ?A\<rbrakk> \<Longrightarrow> \<forall>a. {w. a \<le> ?f w} \<in> ?A
[PROOF STEP]
have "?rhs \<Longrightarrow> ?lhs"
[PROOF STATE]
proof (prove)
using this:
sigma_algebra (measurable_sets M)
\<lbrakk>sigma_algebra ?A; \<forall>a. {w. ?f w < a} \<in> ?A\<rbrakk> \<Longrightarrow> \<forall>a. {w. a \<le> ?f w} \<in> ?A

goal (1 subgoal):
 1. \<forall>a. {w. f w < a} \<in> measurable_sets M \<Longrightarrow> \<forall>a. {w. a \<le> f w} \<in> measurable_sets M
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>a. {w. f w < a} \<in> measurable_sets M \<Longrightarrow> \<forall>a. {w. a \<le> f w} \<in> measurable_sets M

goal (1 subgoal):
 1. (\<forall>a. {w. a \<le> f w} \<in> measurable_sets M) = (\<forall>a. {w. f w < a} \<in> measurable_sets M)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>a. {w. a \<le> f w} \<in> measurable_sets M \<Longrightarrow> \<forall>a. {w. f w < a} \<in> measurable_sets M
\<forall>a. {w. f w < a} \<in> measurable_sets M \<Longrightarrow> \<forall>a. {w. a \<le> f w} \<in> measurable_sets M
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>a. {w. a \<le> f w} \<in> measurable_sets M \<Longrightarrow> \<forall>a. {w. f w < a} \<in> measurable_sets M
\<forall>a. {w. f w < a} \<in> measurable_sets M \<Longrightarrow> \<forall>a. {w. a \<le> f w} \<in> measurable_sets M

goal (1 subgoal):
 1. (\<forall>a. {w. a \<le> f w} \<in> measurable_sets M) = (\<forall>a. {w. f w < a} \<in> measurable_sets M)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
(\<forall>a. {w. a \<le> f w} \<in> measurable_sets M) = (\<forall>a. {w. f w < a} \<in> measurable_sets M)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<forall>a. {w. a \<le> f w} \<in> measurable_sets M) = (\<forall>a. {w. f w < a} \<in> measurable_sets M)

goal (1 subgoal):
 1. (f \<in> rv M) = (\<forall>a. {w. f w < a} \<in> measurable_sets M)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(f \<in> rv M) = (\<forall>a. {w. f w < a} \<in> measurable_sets M)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(f \<in> rv M) = (\<forall>a. {w. f w < a} \<in> measurable_sets M)

goal (1 subgoal):
 1. (f \<in> rv M) = (\<forall>a. {w. f w < a} \<in> measurable_sets M)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(f \<in> rv M) = (\<forall>a. {w. f w < a} \<in> measurable_sets M)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma PredicatePairFunctions2Inv:
fixes
  P::"'a \<Rightarrow> 'b \<Rightarrow> 'c \<Rightarrow> 'd \<Rightarrow> bool"
assumes
  A1: "\<forall>x1 x2 . \<exists>y1 y2 . (P x1 x2 y1 y2)"
obtains f1 f2  where
  "\<forall>x1 x2 . (P x1 x2 (f1 x1 x2) (f2 x1 x2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>f1 f2. \<forall>x1 x2. P x1 x2 (f1 x1 x2) (f2 x1 x2) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using PredicatePairFunctions2[OF A1]
[PROOF STATE]
proof (prove)
using this:
(\<And>f1 f2. \<forall>x1 x2. \<exists>y1 y2. f1 x1 x2 = y1 \<and> f2 x1 x2 = y2 \<and> P x1 x2 (f1 x1 x2) (f2 x1 x2) \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>f1 f2. \<forall>x1 x2. P x1 x2 (f1 x1 x2) (f2 x1 x2) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto


[STATEMENT]
lemma integrable_add[simp, intro]: "integrable M f \<Longrightarrow> integrable M g \<Longrightarrow> integrable M (\<lambda>x. f x + g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>integrable M f; integrable M g\<rbrakk> \<Longrightarrow> integrable M (\<lambda>x. f x + g x)
[PROOF STEP]
by (auto simp: integrable.simps)


[STATEMENT]
lemma LeastTr0:"\<lbrakk> (i::nat) < (LEAST l. P (l))\<rbrakk> \<Longrightarrow> \<not> P (i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < (LEAST l. P l) \<Longrightarrow> \<not> P i
[PROOF STEP]
apply (rule not_less_Least)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < (LEAST l. P l) \<Longrightarrow> i < (LEAST x. P x)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem non_empty_distribution:
 assumes "mat nr1 n1 A1"
     and "mat n1 nc1 A2"
     and "mat nr2 n2 B1"
     and "mat n2 nc2 B2"
     and "A1 \<noteq> []" and "B1 \<noteq> []" and "A2 \<noteq> []" and "B2 \<noteq> []"
 shows "((A1\<circ>A2)\<otimes>(B1\<circ>B2)) \<noteq> []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A1 \<circ> A2 \<otimes> B1 \<circ> B2 \<noteq> []
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A1 \<circ> A2 \<otimes> B1 \<circ> B2 \<noteq> []
[PROOF STEP]
have "A1 \<circ> A2 \<noteq> []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A1 \<circ> A2 \<noteq> []
[PROOF STEP]
using assms  non_empty_mat_mult
[PROOF STATE]
proof (prove)
using this:
mat nr1 n1 A1
mat n1 nc1 A2
mat nr2 n2 B1
mat n2 nc2 B2
A1 \<noteq> []
B1 \<noteq> []
A2 \<noteq> []
B2 \<noteq> []
\<lbrakk>mat ?nr ?n ?A; mat ?n ?nc ?B; ?A \<noteq> []; ?B \<noteq> []\<rbrakk> \<Longrightarrow> ?A \<circ> ?B \<noteq> []

goal (1 subgoal):
 1. A1 \<circ> A2 \<noteq> []
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A1 \<circ> A2 \<noteq> []

goal (1 subgoal):
 1. A1 \<circ> A2 \<otimes> B1 \<circ> B2 \<noteq> []
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
A1 \<circ> A2 \<noteq> []

goal (1 subgoal):
 1. A1 \<circ> A2 \<otimes> B1 \<circ> B2 \<noteq> []
[PROOF STEP]
have "B1 \<circ> B2 \<noteq> []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B1 \<circ> B2 \<noteq> []
[PROOF STEP]
using assms  non_empty_mat_mult
[PROOF STATE]
proof (prove)
using this:
mat nr1 n1 A1
mat n1 nc1 A2
mat nr2 n2 B1
mat n2 nc2 B2
A1 \<noteq> []
B1 \<noteq> []
A2 \<noteq> []
B2 \<noteq> []
\<lbrakk>mat ?nr ?n ?A; mat ?n ?nc ?B; ?A \<noteq> []; ?B \<noteq> []\<rbrakk> \<Longrightarrow> ?A \<circ> ?B \<noteq> []

goal (1 subgoal):
 1. B1 \<circ> B2 \<noteq> []
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
B1 \<circ> B2 \<noteq> []

goal (1 subgoal):
 1. A1 \<circ> A2 \<otimes> B1 \<circ> B2 \<noteq> []
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
A1 \<circ> A2 \<noteq> []
B1 \<circ> B2 \<noteq> []
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
A1 \<circ> A2 \<noteq> []
B1 \<circ> B2 \<noteq> []

goal (1 subgoal):
 1. A1 \<circ> A2 \<otimes> B1 \<circ> B2 \<noteq> []
[PROOF STEP]
using tensor_non_empty
[PROOF STATE]
proof (prove)
using this:
A1 \<circ> A2 \<noteq> []
B1 \<circ> B2 \<noteq> []
\<lbrakk>?A \<noteq> []; ?B \<noteq> []\<rbrakk> \<Longrightarrow> ?A \<otimes> ?B \<noteq> []

goal (1 subgoal):
 1. A1 \<circ> A2 \<otimes> B1 \<circ> B2 \<noteq> []
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A1 \<circ> A2 \<otimes> B1 \<circ> B2 \<noteq> []

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lexn_n:
  \<open>n > 0 \<Longrightarrow> (x # xs, y # ys) \<in> lexn r n \<longleftrightarrow>
  (length xs = n-1 \<and> length ys = n-1) \<and> ((x, y) \<in> r \<or> (x = y \<and> (xs, ys) \<in> lexn r (n - 1)))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n \<Longrightarrow> ((x # xs, y # ys) \<in> lexn r n) = ((length xs = n - 1 \<and> length ys = n - 1) \<and> ((x, y) \<in> r \<or> x = y \<and> (xs, ys) \<in> lexn r (n - 1)))
[PROOF STEP]
apply (cases n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>0 < n; n = 0\<rbrakk> \<Longrightarrow> ((x # xs, y # ys) \<in> lexn r n) = ((length xs = n - 1 \<and> length ys = n - 1) \<and> ((x, y) \<in> r \<or> x = y \<and> (xs, ys) \<in> lexn r (n - 1)))
 2. \<And>nat. \<lbrakk>0 < n; n = Suc nat\<rbrakk> \<Longrightarrow> ((x # xs, y # ys) \<in> lexn r n) = ((length xs = n - 1 \<and> length ys = n - 1) \<and> ((x, y) \<in> r \<or> x = y \<and> (xs, ys) \<in> lexn r (n - 1)))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>nat. \<lbrakk>0 < n; n = Suc nat\<rbrakk> \<Longrightarrow> ((x # xs, y # ys) \<in> lexn r n) = ((length xs = n - 1 \<and> length ys = n - 1) \<and> ((x, y) \<in> r \<or> x = y \<and> (xs, ys) \<in> lexn r (n - 1)))
[PROOF STEP]
by (auto simp: map_prod_def image_iff lex_prod_def)


[STATEMENT]
lemma nth_root_nat_aux_correct:
  assumes "k ^ m \<le> n" "m > 0"
  shows   "nth_root_nat_aux m k (k ^ m) n = nth_root_nat m n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nth_root_nat_aux m k (k ^ m) n = nth_root_nat m n
[PROOF STEP]
by (rule sym, intro nth_root_nat_unique nth_root_nat_aux_le nth_root_nat_aux_gt assms)


[STATEMENT]
lemma path_component_of_unique:
   "\<lbrakk>x \<in> C; path_connectedin X C; \<And>C'. \<lbrakk>x \<in> C'; path_connectedin X C'\<rbrakk> \<Longrightarrow> C' \<subseteq> C\<rbrakk>
        \<Longrightarrow> Collect (path_component_of X x) = C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> C; path_connectedin X C; \<And>C'. \<lbrakk>x \<in> C'; path_connectedin X C'\<rbrakk> \<Longrightarrow> C' \<subseteq> C\<rbrakk> \<Longrightarrow> path_component_of_set X x = C
[PROOF STEP]
by (meson subsetD eq_iff path_component_of_maximal path_connectedin_path_component_of)


[STATEMENT]
lemma compact_UNIV:
  "compact (UNIV :: 'a::{complete_linorder,linorder_topology,second_countable_topology} set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compact UNIV
[PROOF STEP]
using compact_complete_linorder
[PROOF STATE]
proof (prove)
using this:
\<exists>l r. strict_mono r \<and> (?X \<circ> r) \<longlonglongrightarrow> l

goal (1 subgoal):
 1. compact UNIV
[PROOF STEP]
by (auto simp: seq_compact_eq_compact[symmetric] seq_compact_def)


[STATEMENT]
lemma image2_Gr: "image2 A f g = (Gr A f)\<inverse> O (Gr A g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. image2 A f g = (Gr A f)\<inverse> O Gr A g
[PROOF STEP]
unfolding image2_def Gr_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(f a, g a) |a. a \<in> A} = {(a, f a) |a. a \<in> A}\<inverse> O {(a, g a) |a. a \<in> A}
[PROOF STEP]
by auto


[STATEMENT]
lemma mset_le_subtract_left: "A+B \<subseteq># (X::'a multiset) \<Longrightarrow> B \<subseteq># X-A \<and> A\<subseteq>#X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A + B \<subseteq># X \<Longrightarrow> B \<subseteq># X - A \<and> A \<subseteq># X
[PROOF STEP]
by (auto dest: mset_le_subtract[of "A+B" "X" "A"] mset_union_subset)


[STATEMENT]
lemma eventually_nhds_ball: "d > 0 \<Longrightarrow> eventually (\<lambda>x. x \<in> ball z d) (nhds z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < d \<Longrightarrow> \<forall>\<^sub>F x in nhds z. x \<in> ball z d
[PROOF STEP]
by (rule eventually_nhds_in_open) simp_all


[STATEMENT]
lemma "w \<le>p w \<Longrightarrow> w \<in> lists {a,b} \<and> \<^bold>|w\<^bold>| = 2 \<Longrightarrow> hd w = a \<Longrightarrow>  w = [a, b] \<or> w = [a, a]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>w \<le>p w; w \<in> lists {a, b} \<and> \<^bold>|w\<^bold>| = 2; hd w = a\<rbrakk> \<Longrightarrow> w = [a, b] \<or> w = [a, a]
[PROOF STEP]
by list_inspection


[STATEMENT]
lemma normal_form_normal_form: "normal_form F (normal_form F p) = normal_form F p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. normal_form F (normal_form F p) = normal_form F p
[PROOF STEP]
by (simp add: normal_form_id_iff normal_form)


[STATEMENT]
lemma unat_mask:
  "unat (mask n :: 'a :: len word) = 2 ^ (min n (LENGTH('a))) - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unat (mask n) = 2 ^ min n LENGTH('a) - 1
[PROOF STEP]
apply (subst min.commute)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unat (mask n) = 2 ^ min LENGTH('a) n - 1
[PROOF STEP]
apply (simp add: mask_eq_decr_exp not_less min_def  split: if_split_asm)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LENGTH('a) \<le> n \<longrightarrow> unat (2 ^ n - 1) = 2 ^ LENGTH('a) - Suc 0) \<and> (\<not> LENGTH('a) \<le> n \<longrightarrow> unat (2 ^ n - 1) = 2 ^ n - Suc 0)
[PROOF STEP]
apply (intro conjI impI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. LENGTH('a) \<le> n \<Longrightarrow> unat (2 ^ n - 1) = 2 ^ LENGTH('a) - Suc 0
 2. \<not> LENGTH('a) \<le> n \<Longrightarrow> unat (2 ^ n - 1) = 2 ^ n - Suc 0
[PROOF STEP]
apply (simp add: unat_sub_if_size)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. LENGTH('a) \<le> n \<Longrightarrow> (Suc 0 \<le> unat (2 ^ n) \<longrightarrow> unat (2 ^ n) - Suc 0 = 2 ^ LENGTH('a) - Suc 0) \<and> (\<not> Suc 0 \<le> unat (2 ^ n) \<longrightarrow> unat (2 ^ n) + 2 ^ size (2 ^ n) - Suc 0 = 2 ^ LENGTH('a) - Suc 0)
 2. \<not> LENGTH('a) \<le> n \<Longrightarrow> unat (2 ^ n - 1) = 2 ^ n - Suc 0
[PROOF STEP]
apply (simp add: power_overflow word_size)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> LENGTH('a) \<le> n \<Longrightarrow> unat (2 ^ n - 1) = 2 ^ n - Suc 0
[PROOF STEP]
apply (simp add: unat_sub_if_size)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma shortest_path_sym: "shortest_path u v = shortest_path v u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. shortest_path u v = shortest_path v u
[PROOF STEP]
unfolding shortest_path_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (INF p\<in>connecting_paths u v. enat (walk_length p)) = (INF p\<in>connecting_paths v u. enat (walk_length p))
[PROOF STEP]
by (intro INF_eq)(metis add.right_neutral le_iff_add connecting_paths_sym_length)+


[STATEMENT]
lemma ltln_of_dnf_semantics:
  assumes "finite \<A>"
  shows "w \<Turnstile>\<^sub>n ltln_of_dnf \<A> \<longleftrightarrow> (\<exists>\<Phi> \<in> \<A>. \<forall>\<phi>. \<phi> |\<in>| \<Phi> \<longrightarrow> w \<Turnstile>\<^sub>n \<phi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<Turnstile>\<^sub>n ltln_of_dnf \<A> = (\<exists>\<Phi>\<in>\<A>. \<forall>\<phi>. \<phi> |\<in>| \<Phi> \<longrightarrow> w \<Turnstile>\<^sub>n \<phi>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. w \<Turnstile>\<^sub>n ltln_of_dnf \<A> = (\<exists>\<Phi>\<in>\<A>. \<forall>\<phi>. \<phi> |\<in>| \<Phi> \<longrightarrow> w \<Turnstile>\<^sub>n \<phi>)
[PROOF STEP]
have "finite (fset ` \<A>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (fset ` \<A>)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite \<A>

goal (1 subgoal):
 1. finite (fset ` \<A>)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
finite (fset ` \<A>)

goal (1 subgoal):
 1. w \<Turnstile>\<^sub>n ltln_of_dnf \<A> = (\<exists>\<Phi>\<in>\<A>. \<forall>\<phi>. \<phi> |\<in>| \<Phi> \<longrightarrow> w \<Turnstile>\<^sub>n \<phi>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite (fset ` \<A>)
[PROOF STEP]
have "w \<Turnstile>\<^sub>n ltln_of_dnf \<A> \<longleftrightarrow> (\<exists>\<Phi> \<in> fset ` \<A>. \<forall>\<phi> \<in> \<Phi>. w \<Turnstile>\<^sub>n \<phi>)"
[PROOF STATE]
proof (prove)
using this:
finite (fset ` \<A>)

goal (1 subgoal):
 1. w \<Turnstile>\<^sub>n ltln_of_dnf \<A> = (\<exists>\<Phi>\<in>fset ` \<A>. \<forall>\<phi>\<in>\<Phi>. w \<Turnstile>\<^sub>n \<phi>)
[PROOF STEP]
unfolding ltln_of_dnf_def
[PROOF STATE]
proof (prove)
using this:
finite (fset ` \<A>)

goal (1 subgoal):
 1. w \<Turnstile>\<^sub>n Or\<^sub>n (And\<^sub>n ` fset ` \<A>) = (\<exists>\<Phi>\<in>fset ` \<A>. \<forall>\<phi>\<in>\<Phi>. w \<Turnstile>\<^sub>n \<phi>)
[PROOF STEP]
using Or\<^sub>n_And\<^sub>n_image_semantics
[PROOF STATE]
proof (prove)
using this:
finite (fset ` \<A>)
\<lbrakk>finite ?\<A>; \<And>\<Phi>. \<Phi> \<in> ?\<A> \<Longrightarrow> finite \<Phi>\<rbrakk> \<Longrightarrow> ?w \<Turnstile>\<^sub>n Or\<^sub>n (And\<^sub>n ` ?\<A>) = (\<exists>\<Phi>\<in>?\<A>. \<forall>\<phi>\<in>\<Phi>. ?w \<Turnstile>\<^sub>n \<phi>)

goal (1 subgoal):
 1. w \<Turnstile>\<^sub>n Or\<^sub>n (And\<^sub>n ` fset ` \<A>) = (\<exists>\<Phi>\<in>fset ` \<A>. \<forall>\<phi>\<in>\<Phi>. w \<Turnstile>\<^sub>n \<phi>)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
w \<Turnstile>\<^sub>n ltln_of_dnf \<A> = (\<exists>\<Phi>\<in>fset ` \<A>. \<forall>\<phi>\<in>\<Phi>. w \<Turnstile>\<^sub>n \<phi>)

goal (1 subgoal):
 1. w \<Turnstile>\<^sub>n ltln_of_dnf \<A> = (\<exists>\<Phi>\<in>\<A>. \<forall>\<phi>. \<phi> |\<in>| \<Phi> \<longrightarrow> w \<Turnstile>\<^sub>n \<phi>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
w \<Turnstile>\<^sub>n ltln_of_dnf \<A> = (\<exists>\<Phi>\<in>fset ` \<A>. \<forall>\<phi>\<in>\<Phi>. w \<Turnstile>\<^sub>n \<phi>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
w \<Turnstile>\<^sub>n ltln_of_dnf \<A> = (\<exists>\<Phi>\<in>fset ` \<A>. \<forall>\<phi>\<in>\<Phi>. w \<Turnstile>\<^sub>n \<phi>)

goal (1 subgoal):
 1. w \<Turnstile>\<^sub>n ltln_of_dnf \<A> = (\<exists>\<Phi>\<in>\<A>. \<forall>\<phi>. \<phi> |\<in>| \<Phi> \<longrightarrow> w \<Turnstile>\<^sub>n \<phi>)
[PROOF STEP]
by (metis image_iff notin_fset)
[PROOF STATE]
proof (state)
this:
w \<Turnstile>\<^sub>n ltln_of_dnf \<A> = (\<exists>\<Phi>\<in>\<A>. \<forall>\<phi>. \<phi> |\<in>| \<Phi> \<longrightarrow> w \<Turnstile>\<^sub>n \<phi>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mcont_ennreal_of_enat: "mcont Sup (\<le>) Sup (\<le>) ennreal_of_enat"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mcont Sup (\<le>) Sup (\<le>) ennreal_of_enat
[PROOF STEP]
by (auto intro!: mcontI monotoneI contI ennreal_of_enat_Sup)


[STATEMENT]
lemma fcard_finsert_if:
  "fcard (finsert x A) = (if x |\<in>| A then fcard A else Suc (fcard A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fcard (finsert x A) = (if x |\<in>| A then fcard A else Suc (fcard A))
[PROOF STEP]
by transfer (rule card_insert_if)


[STATEMENT]
lemma dom_preimage: "dom (m \<circ>\<^sub>m f) = preimage f (dom m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dom (m \<circ>\<^sub>m f) = preimage f (dom m)
[PROOF STEP]
apply (auto simp add: dom_def preimage_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x y. (m \<circ>\<^sub>m f) x = Some y \<Longrightarrow> \<exists>y. f x = Some y
 2. \<And>x y. (m \<circ>\<^sub>m f) x = Some y \<Longrightarrow> \<exists>y. m (the (f x)) = Some y
[PROOF STEP]
apply (meson map_comp_Some_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. (m \<circ>\<^sub>m f) x = Some y \<Longrightarrow> \<exists>y. m (the (f x)) = Some y
[PROOF STEP]
apply (metis map_comp_def option.case_eq_if option.distinct(1))
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma mono_r': "mono (\<lambda>F s. \<Sqinter>D\<in>step s. \<integral>\<^sup>+ t. (if fst t = Skip then f (snd t) else F t) \<partial>measure_pmf D)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mono (\<lambda>F s. \<Sqinter>D\<in>step s. \<integral>\<^sup>+ t. (if fst t = Skip then f (snd t) else F t) \<partial>measure_pmf D)
[PROOF STEP]
by (auto intro!: monoI le_funI INF_mono[OF bexI] nn_integral_mono simp: le_fun_def)


[STATEMENT]
lemma Gmult_add_diff:
  assumes "a \<in> G"
  shows "Gmult a (n+k) \<ominus> Gmult a n = Gmult a k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gmult a (n + k) \<ominus> Gmult a n = Gmult a k
[PROOF STEP]
by (metis Gmult_add_add Gmult_in_G assms commutative inverse_closed invertible invertible_left_inverse2)


[STATEMENT]
lemma EF_lem000: "(EF f) = (f \<union> EX' (EF f))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. EF f = f \<union> EX' (EF f)
[PROOF STEP]
by (metis EF_def EF_lem00)


[STATEMENT]
lemma isomorphism_sym:
  "\<lbrakk>f \<in> iso G1 G2; \<And>x. x \<in> carrier G1 \<Longrightarrow> r'(f x) = f(r x);
     \<And>x. x \<in> carrier G1 \<Longrightarrow> r x \<in> carrier G1; group G1; group G2\<rbrakk>
      \<Longrightarrow> \<exists>f \<in> iso G2 G1. \<forall>x \<in> carrier G2. r(f x) = f(r' x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> Group.iso G1 G2; \<And>x. x \<in> carrier G1 \<Longrightarrow> r' (f x) = f (r x); \<And>x. x \<in> carrier G1 \<Longrightarrow> r x \<in> carrier G1; Group.group G1; Group.group G2\<rbrakk> \<Longrightarrow> \<exists>f\<in>Group.iso G2 G1. \<forall>x\<in>carrier G2. r (f x) = f (r' x)
[PROOF STEP]
apply (clarsimp simp add: group.iso_iff_group_isomorphisms Bex_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>g. \<lbrakk>\<And>x. x \<in> carrier G1 \<Longrightarrow> r' (f x) = f (r x); \<And>x. x \<in> carrier G1 \<Longrightarrow> r x \<in> carrier G1; Group.group G1; Group.group G2; group_isomorphisms G1 G2 f g\<rbrakk> \<Longrightarrow> \<exists>x. (\<exists>g. group_isomorphisms G2 G1 x g) \<and> (\<forall>xa\<in>carrier G2. r (x xa) = x (r' xa))
[PROOF STEP]
by (metis (full_types) group_isomorphisms_def group_isomorphisms_sym hom_in_carrier)