[STATEMENT]
lemma induced_function_nn_integral_aux:
  fixes f::"'a \<Rightarrow> ennreal"
  assumes A_meas [measurable]: "A \<in> sets M"
      and f_meas [measurable]: "f \<in> borel_measurable M"
      and f_bound: "\<And>x. f x \<le> ennreal C" "0 \<le> C"
      and f_supp: "emeasure M {x \<in> space M. f x > 0} < \<infinity>"
  shows "(\<integral>\<^sup>+y. induced_function A f y \<partial>M) = (\<integral>\<^sup>+ x \<in> (\<Union>n. (T^^n)--`A). f x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
define B where "B = (\<lambda>n. first_entrance_set A n)"
[PROOF STATE]
proof (state)
this:
B = first_entrance_set A

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
have B_meas [measurable]: "\<And>n. B n \<in> sets M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. B n \<in> sets M
[PROOF STEP]
by (simp add: B_def)
[PROOF STATE]
proof (state)
this:
B ?n3 \<in> sets M

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
B ?n3 \<in> sets M
[PROOF STEP]
have B2 [measurable]: "(\<Union>n. B (n+1)) \<in> sets M"
[PROOF STATE]
proof (prove)
using this:
B ?n3 \<in> sets M

goal (1 subgoal):
 1. (\<Union>n. B (n + 1)) \<in> sets M
[PROOF STEP]
by measurable
[PROOF STATE]
proof (state)
this:
(\<Union>n. B (n + 1)) \<in> sets M

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
have *: "B = disjointed (\<lambda>i. (T^^i)--`A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B = disjointed (\<lambda>i. (T ^^ i) --` A)
[PROOF STEP]
by (auto simp add: B_def disjointed_def first_entrance_set_def)
[PROOF STATE]
proof (state)
this:
B = disjointed (\<lambda>i. (T ^^ i) --` A)

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
B = disjointed (\<lambda>i. (T ^^ i) --` A)
[PROOF STEP]
have "disjoint_family B"
[PROOF STATE]
proof (prove)
using this:
B = disjointed (\<lambda>i. (T ^^ i) --` A)

goal (1 subgoal):
 1. disjoint_family B
[PROOF STEP]
by (simp add: disjoint_family_disjointed)
[PROOF STATE]
proof (state)
this:
disjoint_family B

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
have "(\<Union>n. (T^^n)--`A) = (\<Union>n. disjointed (\<lambda>i. (T^^i)--`A) n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>n. (T ^^ n) --` A) = \<Union> (range (disjointed (\<lambda>i. (T ^^ i) --` A)))
[PROOF STEP]
by (simp add: UN_disjointed_eq)
[PROOF STATE]
proof (state)
this:
(\<Union>n. (T ^^ n) --` A) = \<Union> (range (disjointed (\<lambda>i. (T ^^ i) --` A)))

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Union>n. (T ^^ n) --` A) = \<Union> (range (disjointed (\<lambda>i. (T ^^ i) --` A)))
[PROOF STEP]
have "(\<Union>n. (T^^n)--`A) = (\<Union>n. B n)"
[PROOF STATE]
proof (prove)
using this:
(\<Union>n. (T ^^ n) --` A) = \<Union> (range (disjointed (\<lambda>i. (T ^^ i) --` A)))

goal (1 subgoal):
 1. (\<Union>n. (T ^^ n) --` A) = \<Union> (range B)
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
(\<Union>n. (T ^^ n) --` A) = \<Union> (range (disjointed (\<lambda>i. (T ^^ i) --` A)))
B = disjointed (\<lambda>i. (T ^^ i) --` A)

goal (1 subgoal):
 1. (\<Union>n. (T ^^ n) --` A) = \<Union> (range B)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Union>n. (T ^^ n) --` A) = \<Union> (range B)

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Union>n. (T ^^ n) --` A) = \<Union> (range B)
[PROOF STEP]
have "(\<Union>n. (T^^n)--`A) = B 0 \<union> (\<Union>n. B (n+1))"
[PROOF STATE]
proof (prove)
using this:
(\<Union>n. (T ^^ n) --` A) = \<Union> (range B)

goal (1 subgoal):
 1. (\<Union>n. (T ^^ n) --` A) = B 0 \<union> (\<Union>n. B (n + 1))
[PROOF STEP]
by (auto) (metis not0_implies_Suc)
[PROOF STATE]
proof (state)
this:
(\<Union>n. (T ^^ n) --` A) = B 0 \<union> (\<Union>n. B (n + 1))

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Union>n. (T ^^ n) --` A) = B 0 \<union> (\<Union>n. B (n + 1))
[PROOF STEP]
have "(\<integral>\<^sup>+ x \<in> (\<Union>n. (T^^n)--`A). f x \<partial>M) = (\<integral>\<^sup>+ x \<in> (B 0 \<union> (\<Union>n. B (n+1))). f x \<partial>M)"
[PROOF STATE]
proof (prove)
using this:
(\<Union>n. (T ^^ n) --` A) = B 0 \<union> (\<Union>n. B (n + 1))

goal (1 subgoal):
 1. set_nn_integral M (\<Union>n. (T ^^ n) --` A) f = set_nn_integral M (B 0 \<union> (\<Union>n. B (n + 1))) f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
set_nn_integral M (\<Union>n. (T ^^ n) --` A) f = set_nn_integral M (B 0 \<union> (\<Union>n. B (n + 1))) f

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
set_nn_integral M (\<Union>n. (T ^^ n) --` A) f = set_nn_integral M (B 0 \<union> (\<Union>n. B (n + 1))) f

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
have "... = (\<integral>\<^sup>+ x \<in> B 0. f x \<partial>M) + (\<integral>\<^sup>+ x \<in> (\<Union>n. B (n+1)). f x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_nn_integral M (B 0 \<union> (\<Union>n. B (n + 1))) f = set_nn_integral M (B 0) f + set_nn_integral M (\<Union>n. B (n + 1)) f
[PROOF STEP]
proof (rule nn_integral_disjoint_pair)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. f \<in> borel_measurable M
 2. B 0 \<in> sets M
 3. (\<Union>n. B (n + 1)) \<in> sets M
 4. B 0 \<inter> (\<Union>n. B (n + 1)) = {}
[PROOF STEP]
show "B 0 \<inter> (\<Union>n. B (n+1)) = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B 0 \<inter> (\<Union>n. B (n + 1)) = {}
[PROOF STEP]
by (auto) (metis IntI Suc_neq_Zero UNIV_I empty_iff \<open>disjoint_family B\<close> disjoint_family_on_def)
[PROOF STATE]
proof (state)
this:
B 0 \<inter> (\<Union>n. B (n + 1)) = {}

goal (3 subgoals):
 1. f \<in> borel_measurable M
 2. B 0 \<in> sets M
 3. (\<Union>n. B (n + 1)) \<in> sets M
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
set_nn_integral M (B 0 \<union> (\<Union>n. B (n + 1))) f = set_nn_integral M (B 0) f + set_nn_integral M (\<Union>n. B (n + 1)) f

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
set_nn_integral M (\<Union>n. (T ^^ n) --` A) f = set_nn_integral M (B 0) f + set_nn_integral M (\<Union>n. B (n + 1)) f
[PROOF STEP]
have "(\<integral>\<^sup>+ x \<in> (\<Union>n. (T^^n)--`A). f x \<partial>M) = (\<integral>\<^sup>+ x \<in> B 0. f x \<partial>M) + (\<integral>\<^sup>+ x \<in> (\<Union>n. B (n+1)). f x \<partial>M)"
[PROOF STATE]
proof (prove)
using this:
set_nn_integral M (\<Union>n. (T ^^ n) --` A) f = set_nn_integral M (B 0) f + set_nn_integral M (\<Union>n. B (n + 1)) f

goal (1 subgoal):
 1. set_nn_integral M (\<Union>n. (T ^^ n) --` A) f = set_nn_integral M (B 0) f + set_nn_integral M (\<Union>n. B (n + 1)) f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
set_nn_integral M (\<Union>n. (T ^^ n) --` A) f = set_nn_integral M (B 0) f + set_nn_integral M (\<Union>n. B (n + 1)) f

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
set_nn_integral M (\<Union>n. (T ^^ n) --` A) f = set_nn_integral M (B 0) f + set_nn_integral M (\<Union>n. B (n + 1)) f

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
have "(\<integral>\<^sup>+ x \<in> (\<Union>n. B (n+1)). f x \<partial>M) = (\<Sum>n. (\<integral>\<^sup>+ x \<in> B (n+1). f x \<partial>M))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_nn_integral M (\<Union>n. B (n + 1)) f = (\<Sum>n. set_nn_integral M (B (n + 1)) f)
[PROOF STEP]
apply (rule nn_integral_disjoint_family)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. f \<in> borel_measurable M
 2. \<And>n. B (n + 1) \<in> sets M
 3. disjoint_family (\<lambda>n. B (n + 1))
[PROOF STEP]
using \<open>disjoint_family B\<close>
[PROOF STATE]
proof (prove)
using this:
disjoint_family B

goal (3 subgoals):
 1. f \<in> borel_measurable M
 2. \<And>n. B (n + 1) \<in> sets M
 3. disjoint_family (\<lambda>n. B (n + 1))
[PROOF STEP]
by (auto simp add: disjoint_family_on_def)
[PROOF STATE]
proof (state)
this:
set_nn_integral M (\<Union>n. B (n + 1)) f = (\<Sum>n. set_nn_integral M (B (n + 1)) f)

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
set_nn_integral M (\<Union>n. (T ^^ n) --` A) f = set_nn_integral M (B 0) f + set_nn_integral M (\<Union>n. B (n + 1)) f
set_nn_integral M (\<Union>n. B (n + 1)) f = (\<Sum>n. set_nn_integral M (B (n + 1)) f)
[PROOF STEP]
have Bdec: "(\<integral>\<^sup>+ x \<in> (\<Union>n. (T^^n)--`A). f x \<partial>M) = (\<integral>\<^sup>+ x \<in> B 0. f x \<partial>M) + (\<Sum>n. \<integral>\<^sup>+ x \<in> B (n+1). f x \<partial>M)"
[PROOF STATE]
proof (prove)
using this:
set_nn_integral M (\<Union>n. (T ^^ n) --` A) f = set_nn_integral M (B 0) f + set_nn_integral M (\<Union>n. B (n + 1)) f
set_nn_integral M (\<Union>n. B (n + 1)) f = (\<Sum>n. set_nn_integral M (B (n + 1)) f)

goal (1 subgoal):
 1. set_nn_integral M (\<Union>n. (T ^^ n) --` A) f = set_nn_integral M (B 0) f + (\<Sum>n. set_nn_integral M (B (n + 1)) f)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
set_nn_integral M (\<Union>n. (T ^^ n) --` A) f = set_nn_integral M (B 0) f + (\<Sum>n. set_nn_integral M (B (n + 1)) f)

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
define D where "D = (\<lambda>n. (return_time_function A)-` {n+1})"
[PROOF STATE]
proof (state)
this:
D = (\<lambda>n. return_time_function A -` {n + 1})

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
D = (\<lambda>n. return_time_function A -` {n + 1})
[PROOF STEP]
have "disjoint_family D"
[PROOF STATE]
proof (prove)
using this:
D = (\<lambda>n. return_time_function A -` {n + 1})

goal (1 subgoal):
 1. disjoint_family D
[PROOF STEP]
by (auto simp add: disjoint_family_on_def)
[PROOF STATE]
proof (state)
this:
disjoint_family D

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
have *: "\<And>n. D n = T--`(B n) \<inter> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. D n = T --` B n \<inter> A
[PROOF STEP]
using D_def B_def return_time_rec[OF assms(1)]
[PROOF STATE]
proof (prove)
using this:
D = (\<lambda>n. return_time_function A -` {n + 1})
B = first_entrance_set A
return_time_function A -` {Suc ?n} = T --` first_entrance_set A ?n \<inter> A

goal (1 subgoal):
 1. \<And>n. D n = T --` B n \<inter> A
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
D ?n3 = T --` B ?n3 \<inter> A

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
D ?n3 = T --` B ?n3 \<inter> A
[PROOF STEP]
have [measurable]: "\<And>n. D n \<in> sets M"
[PROOF STATE]
proof (prove)
using this:
D ?n3 = T --` B ?n3 \<inter> A

goal (1 subgoal):
 1. \<And>n. D n \<in> sets M
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
D ?n3 \<in> sets M

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
have **: "\<And>n. B (n+1) = T--`(B n) - A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. B (n + 1) = T --` B n - A
[PROOF STEP]
using first_entrance_rec[OF assms(1)] B_def
[PROOF STATE]
proof (prove)
using this:
first_entrance_set A (Suc ?n) = T --` first_entrance_set A ?n - A
B = first_entrance_set A

goal (1 subgoal):
 1. \<And>n. B (n + 1) = T --` B n - A
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
B (?n3 + 1) = T --` B ?n3 - A

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
have pos0: "\<And>i x. f((T^^i)x) \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i x. 0 \<le> f ((T ^^ i) x)
[PROOF STEP]
using assms(3)
[PROOF STATE]
proof (prove)
using this:
f ?x3 \<le> ennreal C

goal (1 subgoal):
 1. \<And>i x. 0 \<le> f ((T ^^ i) x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 \<le> f ((T ^^ ?i3) ?x3)

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
have pos:"\<And> i C x. f((T^^i)x) * indicator (C) x \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i C x. 0 \<le> f ((T ^^ i) x) * indicator C x
[PROOF STEP]
using assms(3)
[PROOF STATE]
proof (prove)
using this:
f ?x3 \<le> ennreal C

goal (1 subgoal):
 1. \<And>i C x. 0 \<le> f ((T ^^ i) x) * indicator C x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 \<le> f ((T ^^ ?i3) ?x3) * indicator ?C3 ?x3

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
have mes0 [measurable]: "\<And> i. (\<lambda>x. f((T^^i)x)) \<in> borel_measurable M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. (\<lambda>x. f ((T ^^ i) x)) \<in> borel_measurable M
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>x. f ((T ^^ ?i3) x)) \<in> borel_measurable M

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. f ((T ^^ ?i3) x)) \<in> borel_measurable M
[PROOF STEP]
have [measurable]: "\<And> i C. C \<in> sets M \<Longrightarrow> (\<lambda>x. f((T^^i)x) * indicator C x) \<in> borel_measurable M"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. f ((T ^^ ?i3) x)) \<in> borel_measurable M

goal (1 subgoal):
 1. \<And>i C. C \<in> sets M \<Longrightarrow> (\<lambda>x. f ((T ^^ i) x) * indicator C x) \<in> borel_measurable M
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
?C3 \<in> sets M \<Longrightarrow> (\<lambda>x. f ((T ^^ ?i3) x) * indicator ?C3 x) \<in> borel_measurable M

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
have "\<And>y. induced_function A f y = induced_function A f y * indicator ((return_time_function A)-`{1..}) y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y. induced_function A f y = induced_function A f y * indicator (return_time_function A -` {1..}) y
[PROOF STEP]
by (rule induced_function_support)
[PROOF STATE]
proof (state)
this:
induced_function A f ?y3 = induced_function A f ?y3 * indicator (return_time_function A -` {1..}) ?y3

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
induced_function A f ?y3 = induced_function A f ?y3 * indicator (return_time_function A -` {1..}) ?y3

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
have "(return_time_function A)-`{(1::nat)..} = (\<Union>n. D n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. return_time_function A -` {1..} = \<Union> (range D)
[PROOF STEP]
by (auto simp add: D_def Suc_le_D)
[PROOF STATE]
proof (state)
this:
return_time_function A -` {1..} = \<Union> (range D)

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
induced_function A f ?y3 = induced_function A f ?y3 * indicator (return_time_function A -` {1..}) ?y3
return_time_function A -` {1..} = \<Union> (range D)
[PROOF STEP]
have "\<And>y. induced_function A f y = induced_function A f y * indicator (\<Union>n. D n) y"
[PROOF STATE]
proof (prove)
using this:
induced_function A f ?y3 = induced_function A f ?y3 * indicator (return_time_function A -` {1..}) ?y3
return_time_function A -` {1..} = \<Union> (range D)

goal (1 subgoal):
 1. \<And>y. induced_function A f y = induced_function A f y * indicator (\<Union> (range D)) y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
induced_function A f ?y3 = induced_function A f ?y3 * indicator (\<Union> (range D)) ?y3

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
induced_function A f ?y3 = induced_function A f ?y3 * indicator (\<Union> (range D)) ?y3
[PROOF STEP]
have "(\<integral>\<^sup>+y. induced_function A f y \<partial>M) = (\<integral>\<^sup>+y \<in> (\<Union>n. D n). induced_function A f y \<partial>M)"
[PROOF STATE]
proof (prove)
using this:
induced_function A f ?y3 = induced_function A f ?y3 * indicator (\<Union> (range D)) ?y3

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union> (range D)) (induced_function A f)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union> (range D)) (induced_function A f)

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union> (range D)) (induced_function A f)

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
have "... = (\<Sum>n. (\<integral>\<^sup>+y \<in> D n. induced_function A f y \<partial>M))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_nn_integral M (\<Union> (range D)) (induced_function A f) = (\<Sum>n. set_nn_integral M (D n) (induced_function A f))
[PROOF STEP]
apply (rule nn_integral_disjoint_family)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. induced_function A f \<in> borel_measurable M
 2. \<And>n. D n \<in> sets M
 3. disjoint_family D
[PROOF STEP]
unfolding induced_function_def
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. (\<lambda>x. \<Sum>i<return_time_function A x. f ((T ^^ i) x)) \<in> borel_measurable M
 2. \<And>n. D n \<in> sets M
 3. disjoint_family D
[PROOF STEP]
by (auto simp add: pos0 sum_nonneg \<open>disjoint_family D\<close>)
[PROOF STATE]
proof (state)
this:
set_nn_integral M (\<Union> (range D)) (induced_function A f) = (\<Sum>n. set_nn_integral M (D n) (induced_function A f))

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
integral\<^sup>N M (induced_function A f) = (\<Sum>n. set_nn_integral M (D n) (induced_function A f))
[PROOF STEP]
have a: "(\<integral>\<^sup>+y. induced_function A f y \<partial>M) = (\<Sum>n. (\<integral>\<^sup>+y \<in> D n. induced_function A f y \<partial>M))"
[PROOF STATE]
proof (prove)
using this:
integral\<^sup>N M (induced_function A f) = (\<Sum>n. set_nn_integral M (D n) (induced_function A f))

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = (\<Sum>n. set_nn_integral M (D n) (induced_function A f))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
integral\<^sup>N M (induced_function A f) = (\<Sum>n. set_nn_integral M (D n) (induced_function A f))

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
define d where "d = (\<lambda>i n. (\<integral>\<^sup>+y \<in> D n. f((T^^i)y) \<partial>M))"
[PROOF STATE]
proof (state)
this:
d = (\<lambda>i n. \<integral>\<^sup>+x\<in>D n. f ((T ^^ i) x)\<partial>M)

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
have "(\<integral>\<^sup>+y \<in> D n. induced_function A f y \<partial>M) = (\<Sum>i\<in>{..n}. d i n)" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_nn_integral M (D n) (induced_function A f) = (\<Sum>i\<le>n. d i n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. set_nn_integral M (D n) (induced_function A f) = (\<Sum>i\<le>n. d i n)
[PROOF STEP]
have "induced_function A f y * indicator (D n) y = (\<Sum>i\<in>{..<n+1}. f((T^^i)y) * indicator (D n) y)" for y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. induced_function A f y * indicator (D n) y = (\<Sum>i<n + 1. f ((T ^^ i) y) * indicator (D n) y)
[PROOF STEP]
by (auto simp add: induced_function_def D_def indicator_def)
[PROOF STATE]
proof (state)
this:
induced_function A f ?y3 * indicator (D n) ?y3 = (\<Sum>i<n + 1. f ((T ^^ i) ?y3) * indicator (D n) ?y3)

goal (1 subgoal):
 1. set_nn_integral M (D n) (induced_function A f) = (\<Sum>i\<le>n. d i n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
induced_function A f ?y3 * indicator (D n) ?y3 = (\<Sum>i<n + 1. f ((T ^^ i) ?y3) * indicator (D n) ?y3)
[PROOF STEP]
have "(\<integral>\<^sup>+y \<in> D n. induced_function A f y \<partial>M) = (\<Sum>i\<in>{..<n+1}. (\<integral>\<^sup>+y \<in> D n. f((T^^i)y) \<partial>M))"
[PROOF STATE]
proof (prove)
using this:
induced_function A f ?y3 * indicator (D n) ?y3 = (\<Sum>i<n + 1. f ((T ^^ i) ?y3) * indicator (D n) ?y3)

goal (1 subgoal):
 1. set_nn_integral M (D n) (induced_function A f) = (\<Sum>i<n + 1. \<integral>\<^sup>+x\<in>D n. f ((T ^^ i) x)\<partial>M)
[PROOF STEP]
using pos nn_integral_sum[of "{..<n+1}", of "\<lambda>i y. f((T^^i)y) * indicator (D n) y"]
[PROOF STATE]
proof (prove)
using this:
induced_function A f ?y3 * indicator (D n) ?y3 = (\<Sum>i<n + 1. f ((T ^^ i) ?y3) * indicator (D n) ?y3)
0 \<le> f ((T ^^ ?i3) ?x3) * indicator ?C3 ?x3
(\<And>i. i \<in> {..<n + 1} \<Longrightarrow> (\<lambda>y. f ((T ^^ i) y) * indicator (D n) y) \<in> borel_measurable ?M) \<Longrightarrow> \<integral>\<^sup>+ x. (\<Sum>i<n + 1. f ((T ^^ i) x) * indicator (D n) x) \<partial>?M = (\<Sum>i<n + 1. \<integral>\<^sup>+y\<in>D n. f ((T ^^ i) y)\<partial>?M)

goal (1 subgoal):
 1. set_nn_integral M (D n) (induced_function A f) = (\<Sum>i<n + 1. \<integral>\<^sup>+x\<in>D n. f ((T ^^ i) x)\<partial>M)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
set_nn_integral M (D n) (induced_function A f) = (\<Sum>i<n + 1. \<integral>\<^sup>+x\<in>D n. f ((T ^^ i) x)\<partial>M)

goal (1 subgoal):
 1. set_nn_integral M (D n) (induced_function A f) = (\<Sum>i\<le>n. d i n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
set_nn_integral M (D n) (induced_function A f) = (\<Sum>i<n + 1. \<integral>\<^sup>+x\<in>D n. f ((T ^^ i) x)\<partial>M)

goal (1 subgoal):
 1. set_nn_integral M (D n) (induced_function A f) = (\<Sum>i\<le>n. d i n)
[PROOF STEP]
have "... = (\<Sum>i\<in>{..n}. (\<integral>\<^sup>+y \<in> D n. f((T^^i)y) \<partial>M))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<n + 1. \<integral>\<^sup>+x\<in>D n. f ((T ^^ i) x)\<partial>M) = (\<Sum>i\<le>n. \<integral>\<^sup>+x\<in>D n. f ((T ^^ i) x)\<partial>M)
[PROOF STEP]
using lessThan_Suc_atMost
[PROOF STATE]
proof (prove)
using this:
{..<Suc ?k} = {..?k}

goal (1 subgoal):
 1. (\<Sum>i<n + 1. \<integral>\<^sup>+x\<in>D n. f ((T ^^ i) x)\<partial>M) = (\<Sum>i\<le>n. \<integral>\<^sup>+x\<in>D n. f ((T ^^ i) x)\<partial>M)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i<n + 1. \<integral>\<^sup>+x\<in>D n. f ((T ^^ i) x)\<partial>M) = (\<Sum>i\<le>n. \<integral>\<^sup>+x\<in>D n. f ((T ^^ i) x)\<partial>M)

goal (1 subgoal):
 1. set_nn_integral M (D n) (induced_function A f) = (\<Sum>i\<le>n. d i n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
set_nn_integral M (D n) (induced_function A f) = (\<Sum>i\<le>n. \<integral>\<^sup>+x\<in>D n. f ((T ^^ i) x)\<partial>M)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
set_nn_integral M (D n) (induced_function A f) = (\<Sum>i\<le>n. \<integral>\<^sup>+x\<in>D n. f ((T ^^ i) x)\<partial>M)

goal (1 subgoal):
 1. set_nn_integral M (D n) (induced_function A f) = (\<Sum>i\<le>n. d i n)
[PROOF STEP]
using d_def
[PROOF STATE]
proof (prove)
using this:
set_nn_integral M (D n) (induced_function A f) = (\<Sum>i\<le>n. \<integral>\<^sup>+x\<in>D n. f ((T ^^ i) x)\<partial>M)
d = (\<lambda>i n. \<integral>\<^sup>+x\<in>D n. f ((T ^^ i) x)\<partial>M)

goal (1 subgoal):
 1. set_nn_integral M (D n) (induced_function A f) = (\<Sum>i\<le>n. d i n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
set_nn_integral M (D n) (induced_function A f) = (\<Sum>i\<le>n. d i n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
set_nn_integral M (D ?n3) (induced_function A f) = (\<Sum>i\<le>?n3. d i ?n3)

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
set_nn_integral M (D ?n3) (induced_function A f) = (\<Sum>i\<le>?n3. d i ?n3)
[PROOF STEP]
have induced_dec: "(\<integral>\<^sup>+y. induced_function A f y \<partial>M) = (\<Sum>n. (\<Sum>i\<in>{..n}. d i n))"
[PROOF STATE]
proof (prove)
using this:
set_nn_integral M (D ?n3) (induced_function A f) = (\<Sum>i\<le>?n3. d i ?n3)

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = (\<Sum>n. \<Sum>i\<le>n. d i n)
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
set_nn_integral M (D ?n3) (induced_function A f) = (\<Sum>i\<le>?n3. d i ?n3)
integral\<^sup>N M (induced_function A f) = (\<Sum>n. set_nn_integral M (D n) (induced_function A f))

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = (\<Sum>n. \<Sum>i\<le>n. d i n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
integral\<^sup>N M (induced_function A f) = (\<Sum>n. \<Sum>i\<le>n. d i n)

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
have "(\<Union>n\<in>{1..}. (return_time_function A)-` {n}) = UNIV - (return_time_function A)-` {0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>n\<in>{1..}. return_time_function A -` {n}) = UNIV - return_time_function A -` {0}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Union>n\<in>{1..}. return_time_function A -` {n}) = UNIV - return_time_function A -` {0}

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Union>n\<in>{1..}. return_time_function A -` {n}) = UNIV - return_time_function A -` {0}
[PROOF STEP]
have "(\<Union>n\<in>{1..}. (return_time_function A)-` {n}) = recurrent_subset A"
[PROOF STATE]
proof (prove)
using this:
(\<Union>n\<in>{1..}. return_time_function A -` {n}) = UNIV - return_time_function A -` {0}

goal (1 subgoal):
 1. (\<Union>n\<in>{1..}. return_time_function A -` {n}) = recurrent_subset A
[PROOF STEP]
using return_time0
[PROOF STATE]
proof (prove)
using this:
(\<Union>n\<in>{1..}. return_time_function A -` {n}) = UNIV - return_time_function A -` {0}
return_time_function ?A -` {0} = UNIV - recurrent_subset ?A

goal (1 subgoal):
 1. (\<Union>n\<in>{1..}. return_time_function A -` {n}) = recurrent_subset A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Union>n\<in>{1..}. return_time_function A -` {n}) = recurrent_subset A

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<Union>n\<in>{1..}. return_time_function A -` {n}) = recurrent_subset A

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
have "(\<Union>n. (return_time_function A)-` {n+1}) = (\<Union>n\<in>{1..}. (return_time_function A)-` {n})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>n. return_time_function A -` {n + 1}) = (\<Union>n\<in>{1..}. return_time_function A -` {n})
[PROOF STEP]
by (auto simp add: Suc_le_D)
[PROOF STATE]
proof (state)
this:
(\<Union>n. return_time_function A -` {n + 1}) = (\<Union>n\<in>{1..}. return_time_function A -` {n})

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<Union>n\<in>{1..}. return_time_function A -` {n}) = recurrent_subset A
(\<Union>n. return_time_function A -` {n + 1}) = (\<Union>n\<in>{1..}. return_time_function A -` {n})
[PROOF STEP]
have "(\<Union>n. D n) = recurrent_subset A"
[PROOF STATE]
proof (prove)
using this:
(\<Union>n\<in>{1..}. return_time_function A -` {n}) = recurrent_subset A
(\<Union>n. return_time_function A -` {n + 1}) = (\<Union>n\<in>{1..}. return_time_function A -` {n})

goal (1 subgoal):
 1. \<Union> (range D) = recurrent_subset A
[PROOF STEP]
using D_def
[PROOF STATE]
proof (prove)
using this:
(\<Union>n\<in>{1..}. return_time_function A -` {n}) = recurrent_subset A
(\<Union>n. return_time_function A -` {n + 1}) = (\<Union>n\<in>{1..}. return_time_function A -` {n})
D = (\<lambda>n. return_time_function A -` {n + 1})

goal (1 subgoal):
 1. \<Union> (range D) = recurrent_subset A
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<Union> (range D) = recurrent_subset A

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<Union> (range D) = recurrent_subset A

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
have "(\<integral>\<^sup>+x \<in> A. f x \<partial>M) = (\<integral>\<^sup>+x \<in> recurrent_subset A. f x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_nn_integral M A f = set_nn_integral M (recurrent_subset A) f
[PROOF STEP]
by (rule nn_integral_null_delta, auto simp add: Diff_mono Un_absorb2 recurrent_subset_incl(1)[of A] Poincare_recurrence_thm(1)[OF assms(1)])
[PROOF STATE]
proof (state)
this:
set_nn_integral M A f = set_nn_integral M (recurrent_subset A) f

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
set_nn_integral M A f = set_nn_integral M (recurrent_subset A) f

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
have "B 0 = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B 0 = A
[PROOF STEP]
using B_def first_entrance_set_def
[PROOF STATE]
proof (prove)
using this:
B = first_entrance_set A
first_entrance_set ?A ?n = (T ^^ ?n) --` ?A - (\<Union>i<?n. (T ^^ i) --` ?A)

goal (1 subgoal):
 1. B 0 = A
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
B 0 = A

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<Union> (range D) = recurrent_subset A
set_nn_integral M A f = set_nn_integral M (recurrent_subset A) f
B 0 = A
[PROOF STEP]
have "(\<integral>\<^sup>+x \<in> B 0. f x \<partial>M) = (\<integral>\<^sup>+x \<in> (\<Union>n. D n). f x \<partial>M)"
[PROOF STATE]
proof (prove)
using this:
\<Union> (range D) = recurrent_subset A
set_nn_integral M A f = set_nn_integral M (recurrent_subset A) f
B 0 = A

goal (1 subgoal):
 1. set_nn_integral M (B 0) f = set_nn_integral M (\<Union> (range D)) f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
set_nn_integral M (B 0) f = set_nn_integral M (\<Union> (range D)) f

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
set_nn_integral M (B 0) f = set_nn_integral M (\<Union> (range D)) f

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
have "... = (\<Sum>n. (\<integral>\<^sup>+x \<in> D n. f x \<partial>M))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_nn_integral M (\<Union> (range D)) f = (\<Sum>n. set_nn_integral M (D n) f)
[PROOF STEP]
by (rule nn_integral_disjoint_family, auto simp add: \<open>disjoint_family D\<close>)
[PROOF STATE]
proof (state)
this:
set_nn_integral M (\<Union> (range D)) f = (\<Sum>n. set_nn_integral M (D n) f)

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
set_nn_integral M (B 0) f = (\<Sum>n. set_nn_integral M (D n) f)
[PROOF STEP]
have B0dec: "(\<integral>\<^sup>+x \<in> B 0. f x \<partial>M) = (\<Sum>n. d 0 n)"
[PROOF STATE]
proof (prove)
using this:
set_nn_integral M (B 0) f = (\<Sum>n. set_nn_integral M (D n) f)

goal (1 subgoal):
 1. set_nn_integral M (B 0) f = (\<Sum>n. d 0 n)
[PROOF STEP]
using d_def
[PROOF STATE]
proof (prove)
using this:
set_nn_integral M (B 0) f = (\<Sum>n. set_nn_integral M (D n) f)
d = (\<lambda>i n. \<integral>\<^sup>+x\<in>D n. f ((T ^^ i) x)\<partial>M)

goal (1 subgoal):
 1. set_nn_integral M (B 0) f = (\<Sum>n. d 0 n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
set_nn_integral M (B 0) f = (\<Sum>n. d 0 n)

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
have *: "(\<integral>\<^sup>+x \<in> B n. f x \<partial>M) = (\<Sum>i<k. (\<integral>\<^sup>+x \<in> D(n+i). f((T^^(i+1))x) \<partial>M)) + (\<integral>\<^sup>+x \<in> B(n+k). f((T^^k)x) \<partial>M)" for n k
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_nn_integral M (B n) f = (\<Sum>i<k. \<integral>\<^sup>+x\<in>D (n + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M)
[PROOF STEP]
proof (induction k)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. set_nn_integral M (B n) f = (\<Sum>i<0. \<integral>\<^sup>+x\<in>D (n + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (n + 0). f ((T ^^ 0) x)\<partial>M)
 2. \<And>k. set_nn_integral M (B n) f = (\<Sum>i<k. \<integral>\<^sup>+x\<in>D (n + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M) \<Longrightarrow> set_nn_integral M (B n) f = (\<Sum>i<Suc k. \<integral>\<^sup>+x\<in>D (n + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (n + Suc k). f ((T ^^ Suc k) x)\<partial>M)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. set_nn_integral M (B n) f = (\<Sum>i<0. \<integral>\<^sup>+x\<in>D (n + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (n + 0). f ((T ^^ 0) x)\<partial>M)
 2. \<And>k. set_nn_integral M (B n) f = (\<Sum>i<k. \<integral>\<^sup>+x\<in>D (n + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M) \<Longrightarrow> set_nn_integral M (B n) f = (\<Sum>i<Suc k. \<integral>\<^sup>+x\<in>D (n + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (n + Suc k). f ((T ^^ Suc k) x)\<partial>M)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_nn_integral M (B n) f = (\<Sum>i<0. \<integral>\<^sup>+x\<in>D (n + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (n + 0). f ((T ^^ 0) x)\<partial>M)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
set_nn_integral M (B n) f = (\<Sum>i<0. \<integral>\<^sup>+x\<in>D (n + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (n + 0). f ((T ^^ 0) x)\<partial>M)

goal (1 subgoal):
 1. \<And>k. set_nn_integral M (B n) f = (\<Sum>i<k. \<integral>\<^sup>+x\<in>D (n + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M) \<Longrightarrow> set_nn_integral M (B n) f = (\<Sum>i<Suc k. \<integral>\<^sup>+x\<in>D (n + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (n + Suc k). f ((T ^^ Suc k) x)\<partial>M)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k. set_nn_integral M (B n) f = (\<Sum>i<k. \<integral>\<^sup>+x\<in>D (n + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M) \<Longrightarrow> set_nn_integral M (B n) f = (\<Sum>i<Suc k. \<integral>\<^sup>+x\<in>D (n + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (n + Suc k). f ((T ^^ Suc k) x)\<partial>M)
[PROOF STEP]
case (Suc k)
[PROOF STATE]
proof (state)
this:
set_nn_integral M (B n) f = (\<Sum>i<k. \<integral>\<^sup>+x\<in>D (n + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M)

goal (1 subgoal):
 1. \<And>k. set_nn_integral M (B n) f = (\<Sum>i<k. \<integral>\<^sup>+x\<in>D (n + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M) \<Longrightarrow> set_nn_integral M (B n) f = (\<Sum>i<Suc k. \<integral>\<^sup>+x\<in>D (n + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (n + Suc k). f ((T ^^ Suc k) x)\<partial>M)
[PROOF STEP]
have "T--`(B(n+k)) = B(n+k+1) \<union> D(n+k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T --` B (n + k) = B (n + k + 1) \<union> D (n + k)
[PROOF STEP]
using * **
[PROOF STATE]
proof (prove)
using this:
D ?n3 = T --` B ?n3 \<inter> A
B (?n3 + 1) = T --` B ?n3 - A

goal (1 subgoal):
 1. T --` B (n + k) = B (n + k + 1) \<union> D (n + k)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
T --` B (n + k) = B (n + k + 1) \<union> D (n + k)

goal (1 subgoal):
 1. \<And>k. set_nn_integral M (B n) f = (\<Sum>i<k. \<integral>\<^sup>+x\<in>D (n + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M) \<Longrightarrow> set_nn_integral M (B n) f = (\<Sum>i<Suc k. \<integral>\<^sup>+x\<in>D (n + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (n + Suc k). f ((T ^^ Suc k) x)\<partial>M)
[PROOF STEP]
have "(\<integral>\<^sup>+x \<in> B(n+k). f((T^^k)x) \<partial>M) = (\<integral>\<^sup>+x. (\<lambda>x. f((T^^k)x) * indicator (B (n+k)) x)(T x) \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M = \<integral>\<^sup>+ x. f ((T ^^ k) (T x)) * indicator (B (n + k)) (T x) \<partial>M
[PROOF STEP]
by (rule measure_preserving_preserves_nn_integral[OF Tm], auto simp add: pos)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M = \<integral>\<^sup>+ x. f ((T ^^ k) (T x)) * indicator (B (n + k)) (T x) \<partial>M

goal (1 subgoal):
 1. \<And>k. set_nn_integral M (B n) f = (\<Sum>i<k. \<integral>\<^sup>+x\<in>D (n + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M) \<Longrightarrow> set_nn_integral M (B n) f = (\<Sum>i<Suc k. \<integral>\<^sup>+x\<in>D (n + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (n + Suc k). f ((T ^^ Suc k) x)\<partial>M)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M = \<integral>\<^sup>+ x. f ((T ^^ k) (T x)) * indicator (B (n + k)) (T x) \<partial>M

goal (1 subgoal):
 1. \<And>k. set_nn_integral M (B n) f = (\<Sum>i<k. \<integral>\<^sup>+x\<in>D (n + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M) \<Longrightarrow> set_nn_integral M (B n) f = (\<Sum>i<Suc k. \<integral>\<^sup>+x\<in>D (n + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (n + Suc k). f ((T ^^ Suc k) x)\<partial>M)
[PROOF STEP]
have "... = (\<integral>\<^sup>+x. f((T^^(k+1))x) * indicator (T--`(B (n+k))) x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. f ((T ^^ k) (T x)) * indicator (B (n + k)) (T x) \<partial>M = \<integral>\<^sup>+x\<in>T --` B (n + k). f ((T ^^ (k + 1)) x)\<partial>M
[PROOF STEP]
proof (rule nn_integral_cong_AE)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. AE x in M. f ((T ^^ k) (T x)) * indicator (B (n + k)) (T x) = f ((T ^^ (k + 1)) x) * indicator (T --` B (n + k)) x
[PROOF STEP]
have "(T^^k)(T x) = (T^^(k+1))x" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (T ^^ k) (T x) = (T ^^ (k + 1)) x
[PROOF STEP]
using comp_eq_dest_lhs
[PROOF STATE]
proof (prove)
using this:
?a \<circ> ?b = ?c \<Longrightarrow> ?a (?b ?v) = ?c ?v

goal (1 subgoal):
 1. (T ^^ k) (T x) = (T ^^ (k + 1)) x
[PROOF STEP]
by (metis Suc_eq_plus1 funpow.simps(2) funpow_swap1)
[PROOF STATE]
proof (state)
this:
(T ^^ k) (T ?x3) = (T ^^ (k + 1)) ?x3

goal (1 subgoal):
 1. AE x in M. f ((T ^^ k) (T x)) * indicator (B (n + k)) (T x) = f ((T ^^ (k + 1)) x) * indicator (T --` B (n + k)) x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(T ^^ k) (T ?x3) = (T ^^ (k + 1)) ?x3

goal (1 subgoal):
 1. AE x in M. f ((T ^^ k) (T x)) * indicator (B (n + k)) (T x) = f ((T ^^ (k + 1)) x) * indicator (T --` B (n + k)) x
[PROOF STEP]
have "AE x in M. f((T^^k)(T x)) * indicator (B (n+k)) (T x) = f((T^^k)(T x)) * indicator (T--`(B (n+k))) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in M. f ((T ^^ k) (T x)) * indicator (B (n + k)) (T x) = f ((T ^^ k) (T x)) * indicator (T --` B (n + k)) x
[PROOF STEP]
by (simp add: indicator_def \<open>\<And>n. B n \<in> sets M\<close>)
[PROOF STATE]
proof (state)
this:
AE x in M. f ((T ^^ k) (T x)) * indicator (B (n + k)) (T x) = f ((T ^^ k) (T x)) * indicator (T --` B (n + k)) x

goal (1 subgoal):
 1. AE x in M. f ((T ^^ k) (T x)) * indicator (B (n + k)) (T x) = f ((T ^^ (k + 1)) x) * indicator (T --` B (n + k)) x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(T ^^ k) (T ?x3) = (T ^^ (k + 1)) ?x3
AE x in M. f ((T ^^ k) (T x)) * indicator (B (n + k)) (T x) = f ((T ^^ k) (T x)) * indicator (T --` B (n + k)) x
[PROOF STEP]
show "AE x in M. f((T^^k)(T x)) * indicator (B (n+k)) (T x) = f((T^^(k+1))x) * indicator (T--`(B (n+k))) x"
[PROOF STATE]
proof (prove)
using this:
(T ^^ k) (T ?x3) = (T ^^ (k + 1)) ?x3
AE x in M. f ((T ^^ k) (T x)) * indicator (B (n + k)) (T x) = f ((T ^^ k) (T x)) * indicator (T --` B (n + k)) x

goal (1 subgoal):
 1. AE x in M. f ((T ^^ k) (T x)) * indicator (B (n + k)) (T x) = f ((T ^^ (k + 1)) x) * indicator (T --` B (n + k)) x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
AE x in M. f ((T ^^ k) (T x)) * indicator (B (n + k)) (T x) = f ((T ^^ (k + 1)) x) * indicator (T --` B (n + k)) x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. f ((T ^^ k) (T x)) * indicator (B (n + k)) (T x) \<partial>M = \<integral>\<^sup>+x\<in>T --` B (n + k). f ((T ^^ (k + 1)) x)\<partial>M

goal (1 subgoal):
 1. \<And>k. set_nn_integral M (B n) f = (\<Sum>i<k. \<integral>\<^sup>+x\<in>D (n + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M) \<Longrightarrow> set_nn_integral M (B n) f = (\<Sum>i<Suc k. \<integral>\<^sup>+x\<in>D (n + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (n + Suc k). f ((T ^^ Suc k) x)\<partial>M)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. f ((T ^^ k) (T x)) * indicator (B (n + k)) (T x) \<partial>M = \<integral>\<^sup>+x\<in>T --` B (n + k). f ((T ^^ (k + 1)) x)\<partial>M

goal (1 subgoal):
 1. \<And>k. set_nn_integral M (B n) f = (\<Sum>i<k. \<integral>\<^sup>+x\<in>D (n + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M) \<Longrightarrow> set_nn_integral M (B n) f = (\<Sum>i<Suc k. \<integral>\<^sup>+x\<in>D (n + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (n + Suc k). f ((T ^^ Suc k) x)\<partial>M)
[PROOF STEP]
have "... = (\<integral>\<^sup>+x \<in> B(n+k+1) \<union> D(n+k). f((T^^(k+1))x) \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>T --` B (n + k). f ((T ^^ (k + 1)) x)\<partial>M = \<integral>\<^sup>+x\<in>B (n + k + 1) \<union> D (n + k). f ((T ^^ (k + 1)) x)\<partial>M
[PROOF STEP]
using \<open>T--`(B(n+k)) = B(n+k+1) \<union> D(n+k)\<close>
[PROOF STATE]
proof (prove)
using this:
T --` B (n + k) = B (n + k + 1) \<union> D (n + k)

goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>T --` B (n + k). f ((T ^^ (k + 1)) x)\<partial>M = \<integral>\<^sup>+x\<in>B (n + k + 1) \<union> D (n + k). f ((T ^^ (k + 1)) x)\<partial>M
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>T --` B (n + k). f ((T ^^ (k + 1)) x)\<partial>M = \<integral>\<^sup>+x\<in>B (n + k + 1) \<union> D (n + k). f ((T ^^ (k + 1)) x)\<partial>M

goal (1 subgoal):
 1. \<And>k. set_nn_integral M (B n) f = (\<Sum>i<k. \<integral>\<^sup>+x\<in>D (n + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M) \<Longrightarrow> set_nn_integral M (B n) f = (\<Sum>i<Suc k. \<integral>\<^sup>+x\<in>D (n + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (n + Suc k). f ((T ^^ Suc k) x)\<partial>M)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>T --` B (n + k). f ((T ^^ (k + 1)) x)\<partial>M = \<integral>\<^sup>+x\<in>B (n + k + 1) \<union> D (n + k). f ((T ^^ (k + 1)) x)\<partial>M

goal (1 subgoal):
 1. \<And>k. set_nn_integral M (B n) f = (\<Sum>i<k. \<integral>\<^sup>+x\<in>D (n + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M) \<Longrightarrow> set_nn_integral M (B n) f = (\<Sum>i<Suc k. \<integral>\<^sup>+x\<in>D (n + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (n + Suc k). f ((T ^^ Suc k) x)\<partial>M)
[PROOF STEP]
have "... = (\<integral>\<^sup>+x \<in> B(n+k+1). f((T^^(k+1))x) \<partial>M) + (\<integral>\<^sup>+x \<in> D(n+k). f((T^^(k+1))x) \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>B (n + k + 1) \<union> D (n + k). f ((T ^^ (k + 1)) x)\<partial>M = (\<integral>\<^sup>+x\<in>B (n + k + 1). f ((T ^^ (k + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>D (n + k). f ((T ^^ (k + 1)) x)\<partial>M)
[PROOF STEP]
proof (rule nn_integral_disjoint_pair[OF mes0[of "k+1"]])
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. B (n + k + 1) \<in> sets M
 2. D (n + k) \<in> sets M
 3. B (n + k + 1) \<inter> D (n + k) = {}
[PROOF STEP]
show "B(n+k+1) \<inter> D(n+k) = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B (n + k + 1) \<inter> D (n + k) = {}
[PROOF STEP]
using * **
[PROOF STATE]
proof (prove)
using this:
D ?n3 = T --` B ?n3 \<inter> A
B (?n3 + 1) = T --` B ?n3 - A

goal (1 subgoal):
 1. B (n + k + 1) \<inter> D (n + k) = {}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
B (n + k + 1) \<inter> D (n + k) = {}

goal (2 subgoals):
 1. B (n + k + 1) \<in> sets M
 2. D (n + k) \<in> sets M
[PROOF STEP]
qed (auto)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>B (n + k + 1) \<union> D (n + k). f ((T ^^ (k + 1)) x)\<partial>M = (\<integral>\<^sup>+x\<in>B (n + k + 1). f ((T ^^ (k + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>D (n + k). f ((T ^^ (k + 1)) x)\<partial>M)

goal (1 subgoal):
 1. \<And>k. set_nn_integral M (B n) f = (\<Sum>i<k. \<integral>\<^sup>+x\<in>D (n + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M) \<Longrightarrow> set_nn_integral M (B n) f = (\<Sum>i<Suc k. \<integral>\<^sup>+x\<in>D (n + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (n + Suc k). f ((T ^^ Suc k) x)\<partial>M)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M = (\<integral>\<^sup>+x\<in>B (n + k + 1). f ((T ^^ (k + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>D (n + k). f ((T ^^ (k + 1)) x)\<partial>M)
[PROOF STEP]
have "(\<integral>\<^sup>+x \<in> B(n+k). f((T^^k)x) \<partial>M) = (\<integral>\<^sup>+x \<in> B(n+k+1). f((T^^(k+1))x) \<partial>M) + (\<integral>\<^sup>+x \<in> D(n+k). f((T^^(k+1))x) \<partial>M)"
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M = (\<integral>\<^sup>+x\<in>B (n + k + 1). f ((T ^^ (k + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>D (n + k). f ((T ^^ (k + 1)) x)\<partial>M)

goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M = (\<integral>\<^sup>+x\<in>B (n + k + 1). f ((T ^^ (k + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>D (n + k). f ((T ^^ (k + 1)) x)\<partial>M)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M = (\<integral>\<^sup>+x\<in>B (n + k + 1). f ((T ^^ (k + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>D (n + k). f ((T ^^ (k + 1)) x)\<partial>M)

goal (1 subgoal):
 1. \<And>k. set_nn_integral M (B n) f = (\<Sum>i<k. \<integral>\<^sup>+x\<in>D (n + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M) \<Longrightarrow> set_nn_integral M (B n) f = (\<Sum>i<Suc k. \<integral>\<^sup>+x\<in>D (n + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (n + Suc k). f ((T ^^ Suc k) x)\<partial>M)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M = (\<integral>\<^sup>+x\<in>B (n + k + 1). f ((T ^^ (k + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>D (n + k). f ((T ^^ (k + 1)) x)\<partial>M)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M = (\<integral>\<^sup>+x\<in>B (n + k + 1). f ((T ^^ (k + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>D (n + k). f ((T ^^ (k + 1)) x)\<partial>M)

goal (1 subgoal):
 1. set_nn_integral M (B n) f = (\<Sum>i<Suc k. \<integral>\<^sup>+x\<in>D (n + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (n + Suc k). f ((T ^^ Suc k) x)\<partial>M)
[PROOF STEP]
by (simp add: Suc.IH add.commute add.left_commute)
[PROOF STATE]
proof (state)
this:
set_nn_integral M (B n) f = (\<Sum>i<Suc k. \<integral>\<^sup>+x\<in>D (n + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (n + Suc k). f ((T ^^ Suc k) x)\<partial>M)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
set_nn_integral M (B ?n3) f = (\<Sum>i<?k3. \<integral>\<^sup>+x\<in>D (?n3 + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (?n3 + ?k3). f ((T ^^ ?k3) x)\<partial>M)

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
have a: "(\<lambda>k. (\<integral>\<^sup>+x \<in> B(n+k). f((T^^k)x) \<partial>M)) \<longlonglongrightarrow> 0" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>k. \<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M) \<longlonglongrightarrow> 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>k. \<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M) \<longlonglongrightarrow> 0
[PROOF STEP]
define W where "W = {x \<in> space M. f x > 0} \<inter> (T^^n)--`A"
[PROOF STATE]
proof (state)
this:
W = {x \<in> space M. 0 < f x} \<inter> (T ^^ n) --` A

goal (1 subgoal):
 1. (\<lambda>k. \<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M) \<longlonglongrightarrow> 0
[PROOF STEP]
have "emeasure M W \<le> emeasure M {x \<in> space M. f x > 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure M W \<le> emeasure M {x \<in> space M. 0 < f x}
[PROOF STEP]
by (intro emeasure_mono, auto simp add: W_def)
[PROOF STATE]
proof (state)
this:
emeasure M W \<le> emeasure M {x \<in> space M. 0 < f x}

goal (1 subgoal):
 1. (\<lambda>k. \<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M) \<longlonglongrightarrow> 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
emeasure M W \<le> emeasure M {x \<in> space M. 0 < f x}
[PROOF STEP]
have W_fin: "emeasure M W < \<infinity>"
[PROOF STATE]
proof (prove)
using this:
emeasure M W \<le> emeasure M {x \<in> space M. 0 < f x}

goal (1 subgoal):
 1. emeasure M W < \<infinity>
[PROOF STEP]
using f_supp
[PROOF STATE]
proof (prove)
using this:
emeasure M W \<le> emeasure M {x \<in> space M. 0 < f x}
emeasure M {x \<in> space M. 0 < f x} < \<infinity>

goal (1 subgoal):
 1. emeasure M W < \<infinity>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
emeasure M W < \<infinity>

goal (1 subgoal):
 1. (\<lambda>k. \<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M) \<longlonglongrightarrow> 0
[PROOF STEP]
have W_meas [measurable]: "W \<in> sets M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. W \<in> sets M
[PROOF STEP]
unfolding W_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> space M. 0 < f x} \<inter> (T ^^ n) --` A \<in> sets M
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
W \<in> sets M

goal (1 subgoal):
 1. (\<lambda>k. \<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M) \<longlonglongrightarrow> 0
[PROOF STEP]
have W_incl: "W \<subseteq> (T^^n)--`A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. W \<subseteq> (T ^^ n) --` A
[PROOF STEP]
unfolding W_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> space M. 0 < f x} \<inter> (T ^^ n) --` A \<subseteq> (T ^^ n) --` A
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
W \<subseteq> (T ^^ n) --` A

goal (1 subgoal):
 1. (\<lambda>k. \<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M) \<longlonglongrightarrow> 0
[PROOF STEP]
define V where "V = (\<lambda>k. {x \<in> (T^^k)--`W. local_time A k x = 0})"
[PROOF STATE]
proof (state)
this:
V = (\<lambda>k. {x \<in> (T ^^ k) --` W. local_time A k x = 0})

goal (1 subgoal):
 1. (\<lambda>k. \<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M) \<longlonglongrightarrow> 0
[PROOF STEP]
have V_meas [measurable]: "V k \<in> sets M" for k
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. V k \<in> sets M
[PROOF STEP]
unfolding V_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> (T ^^ k) --` W. local_time A k x = 0} \<in> sets M
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
V ?k3 \<in> sets M

goal (1 subgoal):
 1. (\<lambda>k. \<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M) \<longlonglongrightarrow> 0
[PROOF STEP]
have a: "(\<integral>\<^sup>+x \<in> B(n+k). f((T^^k)x) \<partial>M) \<le> C * emeasure M (V k)" for k
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M \<le> ennreal C * emeasure M (V k)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M \<le> ennreal C * emeasure M (V k)
[PROOF STEP]
have "f((T^^k)x) * indicator (B(n+k)) x = f((T^^k)x) * indicator (B(n+k) \<inter> (T^^k)--`W) x" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ((T ^^ k) x) * indicator (B (n + k)) x = f ((T ^^ k) x) * indicator (B (n + k) \<inter> (T ^^ k) --` W) x
[PROOF STEP]
proof (cases)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> f ((T ^^ k) x) * indicator (B (n + k)) x = f ((T ^^ k) x) * indicator (B (n + k) \<inter> (T ^^ k) --` W) x
 2. \<not> ?P \<Longrightarrow> f ((T ^^ k) x) * indicator (B (n + k)) x = f ((T ^^ k) x) * indicator (B (n + k) \<inter> (T ^^ k) --` W) x
[PROOF STEP]
assume "f((T^^k)x) * indicator (B(n+k)) x = 0"
[PROOF STATE]
proof (state)
this:
f ((T ^^ k) x) * indicator (B (n + k)) x = 0

goal (2 subgoals):
 1. ?P \<Longrightarrow> f ((T ^^ k) x) * indicator (B (n + k)) x = f ((T ^^ k) x) * indicator (B (n + k) \<inter> (T ^^ k) --` W) x
 2. \<not> ?P \<Longrightarrow> f ((T ^^ k) x) * indicator (B (n + k)) x = f ((T ^^ k) x) * indicator (B (n + k) \<inter> (T ^^ k) --` W) x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f ((T ^^ k) x) * indicator (B (n + k)) x = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f ((T ^^ k) x) * indicator (B (n + k)) x = 0

goal (1 subgoal):
 1. f ((T ^^ k) x) * indicator (B (n + k)) x = f ((T ^^ k) x) * indicator (B (n + k) \<inter> (T ^^ k) --` W) x
[PROOF STEP]
by (simp add: indicator_def)
[PROOF STATE]
proof (state)
this:
f ((T ^^ k) x) * indicator (B (n + k)) x = f ((T ^^ k) x) * indicator (B (n + k) \<inter> (T ^^ k) --` W) x

goal (1 subgoal):
 1. f ((T ^^ k) x) * indicator (B (n + k)) x \<noteq> 0 \<Longrightarrow> f ((T ^^ k) x) * indicator (B (n + k)) x = f ((T ^^ k) x) * indicator (B (n + k) \<inter> (T ^^ k) --` W) x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f ((T ^^ k) x) * indicator (B (n + k)) x \<noteq> 0 \<Longrightarrow> f ((T ^^ k) x) * indicator (B (n + k)) x = f ((T ^^ k) x) * indicator (B (n + k) \<inter> (T ^^ k) --` W) x
[PROOF STEP]
assume "\<not>(f((T^^k)x) * indicator (B(n+k)) x = 0)"
[PROOF STATE]
proof (state)
this:
f ((T ^^ k) x) * indicator (B (n + k)) x \<noteq> 0

goal (1 subgoal):
 1. f ((T ^^ k) x) * indicator (B (n + k)) x \<noteq> 0 \<Longrightarrow> f ((T ^^ k) x) * indicator (B (n + k)) x = f ((T ^^ k) x) * indicator (B (n + k) \<inter> (T ^^ k) --` W) x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f ((T ^^ k) x) * indicator (B (n + k)) x \<noteq> 0
[PROOF STEP]
have H: "f((T^^k)x) * indicator (B(n+k)) x \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
f ((T ^^ k) x) * indicator (B (n + k)) x \<noteq> 0

goal (1 subgoal):
 1. f ((T ^^ k) x) * indicator (B (n + k)) x \<noteq> 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f ((T ^^ k) x) * indicator (B (n + k)) x \<noteq> 0

goal (1 subgoal):
 1. f ((T ^^ k) x) * indicator (B (n + k)) x \<noteq> 0 \<Longrightarrow> f ((T ^^ k) x) * indicator (B (n + k)) x = f ((T ^^ k) x) * indicator (B (n + k) \<inter> (T ^^ k) --` W) x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f ((T ^^ k) x) * indicator (B (n + k)) x \<noteq> 0
[PROOF STEP]
have inB: "x \<in> B(n+k)"
[PROOF STATE]
proof (prove)
using this:
f ((T ^^ k) x) * indicator (B (n + k)) x \<noteq> 0

goal (1 subgoal):
 1. x \<in> B (n + k)
[PROOF STEP]
using H
[PROOF STATE]
proof (prove)
using this:
f ((T ^^ k) x) * indicator (B (n + k)) x \<noteq> 0
f ((T ^^ k) x) * indicator (B (n + k)) x \<noteq> 0

goal (1 subgoal):
 1. x \<in> B (n + k)
[PROOF STEP]
using indicator_simps(2)
[PROOF STATE]
proof (prove)
using this:
f ((T ^^ k) x) * indicator (B (n + k)) x \<noteq> 0
f ((T ^^ k) x) * indicator (B (n + k)) x \<noteq> 0
?x \<notin> ?S \<Longrightarrow> indicator ?S ?x = (0::?'c)

goal (1 subgoal):
 1. x \<in> B (n + k)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
x \<in> B (n + k)

goal (1 subgoal):
 1. f ((T ^^ k) x) * indicator (B (n + k)) x \<noteq> 0 \<Longrightarrow> f ((T ^^ k) x) * indicator (B (n + k)) x = f ((T ^^ k) x) * indicator (B (n + k) \<inter> (T ^^ k) --` W) x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> B (n + k)
[PROOF STEP]
have s: "x \<in> space M"
[PROOF STATE]
proof (prove)
using this:
x \<in> B (n + k)

goal (1 subgoal):
 1. x \<in> space M
[PROOF STEP]
using B_meas[of "n+k"] sets.sets_into_space
[PROOF STATE]
proof (prove)
using this:
x \<in> B (n + k)
B (n + k) \<in> sets M
?x \<in> sets ?M \<Longrightarrow> ?x \<subseteq> space ?M

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

goal (1 subgoal):
 1. f ((T ^^ k) x) * indicator (B (n + k)) x \<noteq> 0 \<Longrightarrow> f ((T ^^ k) x) * indicator (B (n + k)) x = f ((T ^^ k) x) * indicator (B (n + k) \<inter> (T ^^ k) --` W) x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> space M
[PROOF STEP]
have a: "(T^^k)x \<in> space M"
[PROOF STATE]
proof (prove)
using this:
x \<in> space M

goal (1 subgoal):
 1. (T ^^ k) x \<in> space M
[PROOF STEP]
by (metis measurable_space Tn_meas[of k])
[PROOF STATE]
proof (state)
this:
(T ^^ k) x \<in> space M

goal (1 subgoal):
 1. f ((T ^^ k) x) * indicator (B (n + k)) x \<noteq> 0 \<Longrightarrow> f ((T ^^ k) x) * indicator (B (n + k)) x = f ((T ^^ k) x) * indicator (B (n + k) \<inter> (T ^^ k) --` W) x
[PROOF STEP]
have "f((T^^k)x) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < f ((T ^^ k) x)
[PROOF STEP]
using H
[PROOF STATE]
proof (prove)
using this:
f ((T ^^ k) x) * indicator (B (n + k)) x \<noteq> 0

goal (1 subgoal):
 1. 0 < f ((T ^^ k) x)
[PROOF STEP]
by (simp add: le_neq_trans)
[PROOF STATE]
proof (state)
this:
0 < f ((T ^^ k) x)

goal (1 subgoal):
 1. f ((T ^^ k) x) * indicator (B (n + k)) x \<noteq> 0 \<Longrightarrow> f ((T ^^ k) x) * indicator (B (n + k)) x = f ((T ^^ k) x) * indicator (B (n + k) \<inter> (T ^^ k) --` W) x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < f ((T ^^ k) x)
[PROOF STEP]
have *: "(T^^k)x \<in> {y \<in> space M. f y > 0}"
[PROOF STATE]
proof (prove)
using this:
0 < f ((T ^^ k) x)

goal (1 subgoal):
 1. (T ^^ k) x \<in> {y \<in> space M. 0 < f y}
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
0 < f ((T ^^ k) x)
(T ^^ k) x \<in> space M

goal (1 subgoal):
 1. (T ^^ k) x \<in> {y \<in> space M. 0 < f y}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(T ^^ k) x \<in> {y \<in> space M. 0 < f y}

goal (1 subgoal):
 1. f ((T ^^ k) x) * indicator (B (n + k)) x \<noteq> 0 \<Longrightarrow> f ((T ^^ k) x) * indicator (B (n + k)) x = f ((T ^^ k) x) * indicator (B (n + k) \<inter> (T ^^ k) --` W) x
[PROOF STEP]
have "(T^^(n+k))x \<in> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (T ^^ (n + k)) x \<in> A
[PROOF STEP]
using inB B_def first_entrance_set_def
[PROOF STATE]
proof (prove)
using this:
x \<in> B (n + k)
B = first_entrance_set A
first_entrance_set ?A ?n = (T ^^ ?n) --` ?A - (\<Union>i<?n. (T ^^ i) --` ?A)

goal (1 subgoal):
 1. (T ^^ (n + k)) x \<in> A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(T ^^ (n + k)) x \<in> A

goal (1 subgoal):
 1. f ((T ^^ k) x) * indicator (B (n + k)) x \<noteq> 0 \<Longrightarrow> f ((T ^^ k) x) * indicator (B (n + k)) x = f ((T ^^ k) x) * indicator (B (n + k) \<inter> (T ^^ k) --` W) x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(T ^^ (n + k)) x \<in> A
[PROOF STEP]
have "(T^^n)((T^^k)x) \<in> A"
[PROOF STATE]
proof (prove)
using this:
(T ^^ (n + k)) x \<in> A

goal (1 subgoal):
 1. (T ^^ n) ((T ^^ k) x) \<in> A
[PROOF STEP]
by (simp add: funpow_add)
[PROOF STATE]
proof (state)
this:
(T ^^ n) ((T ^^ k) x) \<in> A

goal (1 subgoal):
 1. f ((T ^^ k) x) * indicator (B (n + k)) x \<noteq> 0 \<Longrightarrow> f ((T ^^ k) x) * indicator (B (n + k)) x = f ((T ^^ k) x) * indicator (B (n + k) \<inter> (T ^^ k) --` W) x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(T ^^ n) ((T ^^ k) x) \<in> A
[PROOF STEP]
have "(T^^k)x \<in> (T^^n)--`A"
[PROOF STATE]
proof (prove)
using this:
(T ^^ n) ((T ^^ k) x) \<in> A

goal (1 subgoal):
 1. (T ^^ k) x \<in> (T ^^ n) --` A
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
(T ^^ n) ((T ^^ k) x) \<in> A
(T ^^ k) x \<in> space M

goal (1 subgoal):
 1. (T ^^ k) x \<in> (T ^^ n) --` A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(T ^^ k) x \<in> (T ^^ n) --` A

goal (1 subgoal):
 1. f ((T ^^ k) x) * indicator (B (n + k)) x \<noteq> 0 \<Longrightarrow> f ((T ^^ k) x) * indicator (B (n + k)) x = f ((T ^^ k) x) * indicator (B (n + k) \<inter> (T ^^ k) --` W) x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(T ^^ k) x \<in> (T ^^ n) --` A
[PROOF STEP]
have "(T^^k)x \<in> W"
[PROOF STATE]
proof (prove)
using this:
(T ^^ k) x \<in> (T ^^ n) --` A

goal (1 subgoal):
 1. (T ^^ k) x \<in> W
[PROOF STEP]
using * W_def
[PROOF STATE]
proof (prove)
using this:
(T ^^ k) x \<in> (T ^^ n) --` A
(T ^^ k) x \<in> {y \<in> space M. 0 < f y}
W = {x \<in> space M. 0 < f x} \<inter> (T ^^ n) --` A

goal (1 subgoal):
 1. (T ^^ k) x \<in> W
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(T ^^ k) x \<in> W

goal (1 subgoal):
 1. f ((T ^^ k) x) * indicator (B (n + k)) x \<noteq> 0 \<Longrightarrow> f ((T ^^ k) x) * indicator (B (n + k)) x = f ((T ^^ k) x) * indicator (B (n + k) \<inter> (T ^^ k) --` W) x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(T ^^ k) x \<in> W
[PROOF STEP]
have "x \<in> (T^^k)--`W"
[PROOF STATE]
proof (prove)
using this:
(T ^^ k) x \<in> W

goal (1 subgoal):
 1. x \<in> (T ^^ k) --` W
[PROOF STEP]
using s a
[PROOF STATE]
proof (prove)
using this:
(T ^^ k) x \<in> W
x \<in> space M
(T ^^ k) x \<in> space M

goal (1 subgoal):
 1. x \<in> (T ^^ k) --` W
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x \<in> (T ^^ k) --` W

goal (1 subgoal):
 1. f ((T ^^ k) x) * indicator (B (n + k)) x \<noteq> 0 \<Longrightarrow> f ((T ^^ k) x) * indicator (B (n + k)) x = f ((T ^^ k) x) * indicator (B (n + k) \<inter> (T ^^ k) --` W) x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> (T ^^ k) --` W
[PROOF STEP]
have "x \<in> (B(n+k) \<inter> (T^^k)--`W)"
[PROOF STATE]
proof (prove)
using this:
x \<in> (T ^^ k) --` W

goal (1 subgoal):
 1. x \<in> B (n + k) \<inter> (T ^^ k) --` W
[PROOF STEP]
using inB
[PROOF STATE]
proof (prove)
using this:
x \<in> (T ^^ k) --` W
x \<in> B (n + k)

goal (1 subgoal):
 1. x \<in> B (n + k) \<inter> (T ^^ k) --` W
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x \<in> B (n + k) \<inter> (T ^^ k) --` W

goal (1 subgoal):
 1. f ((T ^^ k) x) * indicator (B (n + k)) x \<noteq> 0 \<Longrightarrow> f ((T ^^ k) x) * indicator (B (n + k)) x = f ((T ^^ k) x) * indicator (B (n + k) \<inter> (T ^^ k) --` W) x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> B (n + k) \<inter> (T ^^ k) --` W
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<in> B (n + k) \<inter> (T ^^ k) --` W

goal (1 subgoal):
 1. f ((T ^^ k) x) * indicator (B (n + k)) x = f ((T ^^ k) x) * indicator (B (n + k) \<inter> (T ^^ k) --` W) x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f ((T ^^ k) x) * indicator (B (n + k)) x = f ((T ^^ k) x) * indicator (B (n + k) \<inter> (T ^^ k) --` W) x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
f ((T ^^ k) ?x3) * indicator (B (n + k)) ?x3 = f ((T ^^ k) ?x3) * indicator (B (n + k) \<inter> (T ^^ k) --` W) ?x3

goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M \<le> ennreal C * emeasure M (V k)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f ((T ^^ k) ?x3) * indicator (B (n + k)) ?x3 = f ((T ^^ k) ?x3) * indicator (B (n + k) \<inter> (T ^^ k) --` W) ?x3
[PROOF STEP]
have *: "(\<integral>\<^sup>+x \<in> B(n+k). f((T^^k)x) \<partial>M) = (\<integral>\<^sup>+x \<in> B(n+k) \<inter> (T^^k)--`W. f((T^^k)x) \<partial>M)"
[PROOF STATE]
proof (prove)
using this:
f ((T ^^ k) ?x3) * indicator (B (n + k)) ?x3 = f ((T ^^ k) ?x3) * indicator (B (n + k) \<inter> (T ^^ k) --` W) ?x3

goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M = \<integral>\<^sup>+x\<in>B (n + k) \<inter> (T ^^ k) --` W. f ((T ^^ k) x)\<partial>M
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M = \<integral>\<^sup>+x\<in>B (n + k) \<inter> (T ^^ k) --` W. f ((T ^^ k) x)\<partial>M

goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M \<le> ennreal C * emeasure M (V k)
[PROOF STEP]
have "B(n+k) \<subseteq> {x \<in> space M. local_time A k x = 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B (n + k) \<subseteq> {x \<in> space M. local_time A k x = 0}
[PROOF STEP]
unfolding local_time_def B_def first_entrance_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (T ^^ (n + k)) --` A - (\<Union>i<n + k. (T ^^ i) --` A) \<subseteq> {x \<in> space M. card {i \<in> {..<k}. (T ^^ i) x \<in> A} = 0}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
B (n + k) \<subseteq> {x \<in> space M. local_time A k x = 0}

goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M \<le> ennreal C * emeasure M (V k)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
B (n + k) \<subseteq> {x \<in> space M. local_time A k x = 0}
[PROOF STEP]
have "B(n+k) \<inter> (T^^k)--`W \<subseteq> V k"
[PROOF STATE]
proof (prove)
using this:
B (n + k) \<subseteq> {x \<in> space M. local_time A k x = 0}

goal (1 subgoal):
 1. B (n + k) \<inter> (T ^^ k) --` W \<subseteq> V k
[PROOF STEP]
unfolding V_def
[PROOF STATE]
proof (prove)
using this:
B (n + k) \<subseteq> {x \<in> space M. local_time A k x = 0}

goal (1 subgoal):
 1. B (n + k) \<inter> (T ^^ k) --` W \<subseteq> {x \<in> (T ^^ k) --` W. local_time A k x = 0}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
B (n + k) \<inter> (T ^^ k) --` W \<subseteq> V k

goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M \<le> ennreal C * emeasure M (V k)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
B (n + k) \<inter> (T ^^ k) --` W \<subseteq> V k
[PROOF STEP]
have "f((T^^k)x) * indicator (B(n+k) \<inter> (T^^k)--`W) x \<le> ennreal C * indicator (V k) x" for x
[PROOF STATE]
proof (prove)
using this:
B (n + k) \<inter> (T ^^ k) --` W \<subseteq> V k

goal (1 subgoal):
 1. f ((T ^^ k) x) * indicator (B (n + k) \<inter> (T ^^ k) --` W) x \<le> ennreal C * indicator (V k) x
[PROOF STEP]
using f_bound
[PROOF STATE]
proof (prove)
using this:
B (n + k) \<inter> (T ^^ k) --` W \<subseteq> V k
f ?x3 \<le> ennreal C
0 \<le> C

goal (1 subgoal):
 1. f ((T ^^ k) x) * indicator (B (n + k) \<inter> (T ^^ k) --` W) x \<le> ennreal C * indicator (V k) x
[PROOF STEP]
by (auto split: split_indicator)
[PROOF STATE]
proof (state)
this:
f ((T ^^ k) ?x3) * indicator (B (n + k) \<inter> (T ^^ k) --` W) ?x3 \<le> ennreal C * indicator (V k) ?x3

goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M \<le> ennreal C * emeasure M (V k)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f ((T ^^ k) ?x3) * indicator (B (n + k) \<inter> (T ^^ k) --` W) ?x3 \<le> ennreal C * indicator (V k) ?x3
[PROOF STEP]
have "(\<integral>\<^sup>+x \<in> B(n+k) \<inter> (T^^k)--`W. f((T^^k)x) \<partial>M) \<le> (\<integral>\<^sup>+x. ennreal C * indicator (V k) x \<partial>M)"
[PROOF STATE]
proof (prove)
using this:
f ((T ^^ k) ?x3) * indicator (B (n + k) \<inter> (T ^^ k) --` W) ?x3 \<le> ennreal C * indicator (V k) ?x3

goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>B (n + k) \<inter> (T ^^ k) --` W. f ((T ^^ k) x)\<partial>M \<le> \<integral>\<^sup>+x\<in>V k. ennreal C\<partial>M
[PROOF STEP]
by (simp add: nn_integral_mono)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>B (n + k) \<inter> (T ^^ k) --` W. f ((T ^^ k) x)\<partial>M \<le> \<integral>\<^sup>+x\<in>V k. ennreal C\<partial>M

goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M \<le> ennreal C * emeasure M (V k)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>B (n + k) \<inter> (T ^^ k) --` W. f ((T ^^ k) x)\<partial>M \<le> \<integral>\<^sup>+x\<in>V k. ennreal C\<partial>M

goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M \<le> ennreal C * emeasure M (V k)
[PROOF STEP]
have "... = ennreal C * emeasure M (V k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>V k. ennreal C\<partial>M = ennreal C * emeasure M (V k)
[PROOF STEP]
by (simp add: \<open>0 \<le> C\<close> nn_integral_cmult)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>V k. ennreal C\<partial>M = ennreal C * emeasure M (V k)

goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M \<le> ennreal C * emeasure M (V k)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<integral>\<^sup>+x\<in>B (n + k) \<inter> (T ^^ k) --` W. f ((T ^^ k) x)\<partial>M \<le> ennreal C * emeasure M (V k)
[PROOF STEP]
show "(\<integral>\<^sup>+x \<in> B(n+k). f((T^^k)x) \<partial>M) \<le> C * emeasure M (V k)"
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+x\<in>B (n + k) \<inter> (T ^^ k) --` W. f ((T ^^ k) x)\<partial>M \<le> ennreal C * emeasure M (V k)

goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M \<le> ennreal C * emeasure M (V k)
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+x\<in>B (n + k) \<inter> (T ^^ k) --` W. f ((T ^^ k) x)\<partial>M \<le> ennreal C * emeasure M (V k)
\<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M = \<integral>\<^sup>+x\<in>B (n + k) \<inter> (T ^^ k) --` W. f ((T ^^ k) x)\<partial>M

goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M \<le> ennreal C * emeasure M (V k)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M \<le> ennreal C * emeasure M (V k)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>B (n + ?k3). f ((T ^^ ?k3) x)\<partial>M \<le> ennreal C * emeasure M (V ?k3)

goal (1 subgoal):
 1. (\<lambda>k. \<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M) \<longlonglongrightarrow> 0
[PROOF STEP]
have "(\<lambda>k. emeasure M (V k)) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>k. emeasure M (V k)) \<longlonglongrightarrow> 0
[PROOF STEP]
unfolding V_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>k. emeasure M {x \<in> (T ^^ k) --` W. local_time A k x = 0}) \<longlonglongrightarrow> 0
[PROOF STEP]
using local_time_unbounded2[OF W_meas, OF W_fin, OF W_incl, of 1]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. emeasure M {x \<in> (T ^^ n) --` W. local_time A n x < 1}) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>k. emeasure M {x \<in> (T ^^ k) --` W. local_time A k x = 0}) \<longlonglongrightarrow> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>k. emeasure M (V k)) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>k. \<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M) \<longlonglongrightarrow> 0
[PROOF STEP]
from ennreal_tendsto_cmult[OF _ this, of C]
[PROOF STATE]
proof (chain)
picking this:
ennreal C < \<top> \<Longrightarrow> (\<lambda>x. ennreal C * emeasure M (V x)) \<longlonglongrightarrow> ennreal C * 0
[PROOF STEP]
have t0: "(\<lambda>k. C * emeasure M (V k)) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
using this:
ennreal C < \<top> \<Longrightarrow> (\<lambda>x. ennreal C * emeasure M (V x)) \<longlonglongrightarrow> ennreal C * 0

goal (1 subgoal):
 1. (\<lambda>k. ennreal C * emeasure M (V k)) \<longlonglongrightarrow> 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>k. ennreal C * emeasure M (V k)) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>k. \<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M) \<longlonglongrightarrow> 0
[PROOF STEP]
from a
[PROOF STATE]
proof (chain)
picking this:
\<integral>\<^sup>+x\<in>B (n + ?k3). f ((T ^^ ?k3) x)\<partial>M \<le> ennreal C * emeasure M (V ?k3)
[PROOF STEP]
show "(\<lambda>k. (\<integral>\<^sup>+x \<in> B(n+k). f((T^^k)x) \<partial>M)) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+x\<in>B (n + ?k3). f ((T ^^ ?k3) x)\<partial>M \<le> ennreal C * emeasure M (V ?k3)

goal (1 subgoal):
 1. (\<lambda>k. \<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M) \<longlonglongrightarrow> 0
[PROOF STEP]
by (intro tendsto_sandwich[OF _ _ tendsto_const t0]) auto
[PROOF STATE]
proof (state)
this:
(\<lambda>k. \<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M) \<longlonglongrightarrow> 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>k. \<integral>\<^sup>+x\<in>B (?n3 + k). f ((T ^^ k) x)\<partial>M) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
have b: "(\<lambda>k. (\<Sum>i<k.(\<integral>\<^sup>+x \<in> D(n+i). f((T^^(i+1))x) \<partial>M))) \<longlonglongrightarrow> (\<Sum>i. d (i+1) (n+i))" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>k. \<Sum>i<k. \<integral>\<^sup>+x\<in>D (n + i). f ((T ^^ (i + 1)) x)\<partial>M) \<longlonglongrightarrow> (\<Sum>i. d (i + 1) (n + i))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>k. \<Sum>i<k. \<integral>\<^sup>+x\<in>D (n + i). f ((T ^^ (i + 1)) x)\<partial>M) \<longlonglongrightarrow> (\<Sum>i. d (i + 1) (n + i))
[PROOF STEP]
define e where "e = (\<lambda>i. d (i+1) (n+i))"
[PROOF STATE]
proof (state)
this:
e = (\<lambda>i. d (i + 1) (n + i))

goal (1 subgoal):
 1. (\<lambda>k. \<Sum>i<k. \<integral>\<^sup>+x\<in>D (n + i). f ((T ^^ (i + 1)) x)\<partial>M) \<longlonglongrightarrow> (\<Sum>i. d (i + 1) (n + i))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
e = (\<lambda>i. d (i + 1) (n + i))
[PROOF STEP]
have "(\<lambda>k. (\<Sum>i<k. e i)) \<longlonglongrightarrow> (\<Sum>i. e i)"
[PROOF STATE]
proof (prove)
using this:
e = (\<lambda>i. d (i + 1) (n + i))

goal (1 subgoal):
 1. (\<lambda>k. sum e {..<k}) \<longlonglongrightarrow> (\<Sum>i. e i)
[PROOF STEP]
by (intro summable_LIMSEQ) simp
[PROOF STATE]
proof (state)
this:
(\<lambda>k. sum e {..<k}) \<longlonglongrightarrow> (\<Sum>i. e i)

goal (1 subgoal):
 1. (\<lambda>k. \<Sum>i<k. \<integral>\<^sup>+x\<in>D (n + i). f ((T ^^ (i + 1)) x)\<partial>M) \<longlonglongrightarrow> (\<Sum>i. d (i + 1) (n + i))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>k. sum e {..<k}) \<longlonglongrightarrow> (\<Sum>i. e i)
[PROOF STEP]
show "(\<lambda>k. (\<Sum>i<k.(\<integral>\<^sup>+x \<in> D(n+i). f((T^^(i+1))x) \<partial>M))) \<longlonglongrightarrow> (\<Sum>i. d (i+1) (n+i))"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>k. sum e {..<k}) \<longlonglongrightarrow> (\<Sum>i. e i)

goal (1 subgoal):
 1. (\<lambda>k. \<Sum>i<k. \<integral>\<^sup>+x\<in>D (n + i). f ((T ^^ (i + 1)) x)\<partial>M) \<longlonglongrightarrow> (\<Sum>i. d (i + 1) (n + i))
[PROOF STEP]
using e_def d_def
[PROOF STATE]
proof (prove)
using this:
(\<lambda>k. sum e {..<k}) \<longlonglongrightarrow> (\<Sum>i. e i)
e = (\<lambda>i. d (i + 1) (n + i))
d = (\<lambda>i n. \<integral>\<^sup>+x\<in>D n. f ((T ^^ i) x)\<partial>M)

goal (1 subgoal):
 1. (\<lambda>k. \<Sum>i<k. \<integral>\<^sup>+x\<in>D (n + i). f ((T ^^ (i + 1)) x)\<partial>M) \<longlonglongrightarrow> (\<Sum>i. d (i + 1) (n + i))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>k. \<Sum>i<k. \<integral>\<^sup>+x\<in>D (n + i). f ((T ^^ (i + 1)) x)\<partial>M) \<longlonglongrightarrow> (\<Sum>i. d (i + 1) (n + i))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>k. \<Sum>i<k. \<integral>\<^sup>+x\<in>D (?n3 + i). f ((T ^^ (i + 1)) x)\<partial>M) \<longlonglongrightarrow> (\<Sum>i. d (i + 1) (?n3 + i))

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
have "(\<lambda>k. (\<Sum>i<k. (\<integral>\<^sup>+x \<in> D(n+i). f((T^^(i+1))x) \<partial>M)) + (\<integral>\<^sup>+x \<in> B(n+k). f((T^^k)x) \<partial>M))
                \<longlonglongrightarrow> (\<Sum>i. d (i+1) (n+i))" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>k. (\<Sum>i<k. \<integral>\<^sup>+x\<in>D (n + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M)) \<longlonglongrightarrow> (\<Sum>i. d (i + 1) (n + i))
[PROOF STEP]
using tendsto_add[OF b a]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. (\<Sum>i<x. \<integral>\<^sup>+x\<in>D (?n8 + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+xa\<in>B (?n4 + x). f ((T ^^ x) xa)\<partial>M)) \<longlonglongrightarrow> (\<Sum>i. d (i + 1) (?n8 + i)) + 0

goal (1 subgoal):
 1. (\<lambda>k. (\<Sum>i<k. \<integral>\<^sup>+x\<in>D (n + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M)) \<longlonglongrightarrow> (\<Sum>i. d (i + 1) (n + i))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>k. (\<Sum>i<k. \<integral>\<^sup>+x\<in>D (?n3 + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (?n3 + k). f ((T ^^ k) x)\<partial>M)) \<longlonglongrightarrow> (\<Sum>i. d (i + 1) (?n3 + i))

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>k. (\<Sum>i<k. \<integral>\<^sup>+x\<in>D (?n3 + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (?n3 + k). f ((T ^^ k) x)\<partial>M)) \<longlonglongrightarrow> (\<Sum>i. d (i + 1) (?n3 + i))

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
have "(\<lambda>k. (\<Sum>i<k. (\<integral>\<^sup>+x \<in> D(n+i). f((T^^(i+1))x) \<partial>M)) + (\<integral>\<^sup>+x \<in> B(n+k). f((T^^k)x) \<partial>M))
                \<longlonglongrightarrow> (\<integral>\<^sup>+x \<in> B n. f x \<partial>M)" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>k. (\<Sum>i<k. \<integral>\<^sup>+x\<in>D (n + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M)) \<longlonglongrightarrow> set_nn_integral M (B n) f
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
set_nn_integral M (B ?n3) f = (\<Sum>i<?k3. \<integral>\<^sup>+x\<in>D (?n3 + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (?n3 + ?k3). f ((T ^^ ?k3) x)\<partial>M)

goal (1 subgoal):
 1. (\<lambda>k. (\<Sum>i<k. \<integral>\<^sup>+x\<in>D (n + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (n + k). f ((T ^^ k) x)\<partial>M)) \<longlonglongrightarrow> set_nn_integral M (B n) f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>k. (\<Sum>i<k. \<integral>\<^sup>+x\<in>D (?n3 + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (?n3 + k). f ((T ^^ k) x)\<partial>M)) \<longlonglongrightarrow> set_nn_integral M (B ?n3) f

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>k. (\<Sum>i<k. \<integral>\<^sup>+x\<in>D (?n3 + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (?n3 + k). f ((T ^^ k) x)\<partial>M)) \<longlonglongrightarrow> (\<Sum>i. d (i + 1) (?n3 + i))
(\<lambda>k. (\<Sum>i<k. \<integral>\<^sup>+x\<in>D (?n3 + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (?n3 + k). f ((T ^^ k) x)\<partial>M)) \<longlonglongrightarrow> set_nn_integral M (B ?n3) f
[PROOF STEP]
have "(\<integral>\<^sup>+x \<in> B n. f x \<partial>M) = (\<Sum>i. d (i+1) (n+i))" for n
[PROOF STATE]
proof (prove)
using this:
(\<lambda>k. (\<Sum>i<k. \<integral>\<^sup>+x\<in>D (?n3 + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (?n3 + k). f ((T ^^ k) x)\<partial>M)) \<longlonglongrightarrow> (\<Sum>i. d (i + 1) (?n3 + i))
(\<lambda>k. (\<Sum>i<k. \<integral>\<^sup>+x\<in>D (?n3 + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (?n3 + k). f ((T ^^ k) x)\<partial>M)) \<longlonglongrightarrow> set_nn_integral M (B ?n3) f

goal (1 subgoal):
 1. set_nn_integral M (B n) f = (\<Sum>i. d (i + 1) (n + i))
[PROOF STEP]
using LIMSEQ_unique
[PROOF STATE]
proof (prove)
using this:
(\<lambda>k. (\<Sum>i<k. \<integral>\<^sup>+x\<in>D (?n3 + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (?n3 + k). f ((T ^^ k) x)\<partial>M)) \<longlonglongrightarrow> (\<Sum>i. d (i + 1) (?n3 + i))
(\<lambda>k. (\<Sum>i<k. \<integral>\<^sup>+x\<in>D (?n3 + i). f ((T ^^ (i + 1)) x)\<partial>M) + (\<integral>\<^sup>+x\<in>B (?n3 + k). f ((T ^^ k) x)\<partial>M)) \<longlonglongrightarrow> set_nn_integral M (B ?n3) f
\<lbrakk>?X \<longlonglongrightarrow> ?a; ?X \<longlonglongrightarrow> ?b\<rbrakk> \<Longrightarrow> ?a = ?b

goal (1 subgoal):
 1. set_nn_integral M (B n) f = (\<Sum>i. d (i + 1) (n + i))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
set_nn_integral M (B ?n3) f = (\<Sum>i. d (i + 1) (?n3 + i))

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
set_nn_integral M (B ?n3) f = (\<Sum>i. d (i + 1) (?n3 + i))
[PROOF STEP]
have "(\<Sum>n. (\<integral>\<^sup>+x \<in> B (n+1). f x \<partial>M)) = (\<Sum>n. (\<Sum>i. d (i+1) (n+1+i)))"
[PROOF STATE]
proof (prove)
using this:
set_nn_integral M (B ?n3) f = (\<Sum>i. d (i + 1) (?n3 + i))

goal (1 subgoal):
 1. (\<Sum>n. set_nn_integral M (B (n + 1)) f) = (\<Sum>n i. d (i + 1) (n + 1 + i))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>n. set_nn_integral M (B (n + 1)) f) = (\<Sum>n i. d (i + 1) (n + 1 + i))

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>n. set_nn_integral M (B (n + 1)) f) = (\<Sum>n i. d (i + 1) (n + 1 + i))
[PROOF STEP]
have "(\<integral>\<^sup>+ x \<in> (\<Union>n. (T^^n)--`A). f x \<partial>M) = (\<Sum>n. d 0 n) + (\<Sum>n. (\<Sum>i. d (i+1) (n+1+i)))"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>n. set_nn_integral M (B (n + 1)) f) = (\<Sum>n i. d (i + 1) (n + 1 + i))

goal (1 subgoal):
 1. set_nn_integral M (\<Union>n. (T ^^ n) --` A) f = (\<Sum>n. d 0 n) + (\<Sum>n i. d (i + 1) (n + 1 + i))
[PROOF STEP]
using Bdec B0dec
[PROOF STATE]
proof (prove)
using this:
(\<Sum>n. set_nn_integral M (B (n + 1)) f) = (\<Sum>n i. d (i + 1) (n + 1 + i))
set_nn_integral M (\<Union>n. (T ^^ n) --` A) f = set_nn_integral M (B 0) f + (\<Sum>n. set_nn_integral M (B (n + 1)) f)
set_nn_integral M (B 0) f = (\<Sum>n. d 0 n)

goal (1 subgoal):
 1. set_nn_integral M (\<Union>n. (T ^^ n) --` A) f = (\<Sum>n. d 0 n) + (\<Sum>n i. d (i + 1) (n + 1 + i))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
set_nn_integral M (\<Union>n. (T ^^ n) --` A) f = (\<Sum>n. d 0 n) + (\<Sum>n i. d (i + 1) (n + 1 + i))

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
set_nn_integral M (\<Union>n. (T ^^ n) --` A) f = (\<Sum>n. d 0 n) + (\<Sum>n i. d (i + 1) (n + 1 + i))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
set_nn_integral M (\<Union>n. (T ^^ n) --` A) f = (\<Sum>n. d 0 n) + (\<Sum>n i. d (i + 1) (n + 1 + i))

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
using induced_dec kac_series_aux
[PROOF STATE]
proof (prove)
using this:
set_nn_integral M (\<Union>n. (T ^^ n) --` A) f = (\<Sum>n. d 0 n) + (\<Sum>n i. d (i + 1) (n + 1 + i))
integral\<^sup>N M (induced_function A f) = (\<Sum>n. \<Sum>i\<le>n. d i n)
(\<Sum>n. \<Sum>i\<le>n. ?d i n) = (\<Sum>n. ?d 0 n) + (\<Sum>n i. ?d (i + 1) (n + 1 + i))

goal (1 subgoal):
 1. integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
integral\<^sup>N M (induced_function A f) = set_nn_integral M (\<Union>n. (T ^^ n) --` A) f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma integrable_on_cmult_iff [simp]:
  fixes c :: real
  assumes "c \<noteq> 0"
  shows "(\<lambda>x. c * f x) integrable_on S \<longleftrightarrow> f integrable_on S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. c * f x) integrable_on S) = (f integrable_on S)
[PROOF STEP]
using integrable_on_scaleR_iff [of c f] assms
[PROOF STATE]
proof (prove)
using this:
c \<noteq> 0 \<Longrightarrow> ((\<lambda>x. c *\<^sub>R f x) integrable_on ?S) = (f integrable_on ?S)
c \<noteq> 0

goal (1 subgoal):
 1. ((\<lambda>x. c * f x) integrable_on S) = (f integrable_on S)
[PROOF STEP]
by simp


[STATEMENT]
lemma stern_brocot_loopless_siterate: "stern_brocot_loopless = siterate step (1, 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. stern_brocot_loopless = siterate step (1, 1)
[PROOF STEP]
by(rule stern_brocot_loopless.unique[symmetric])(rule stream.expand; simp add: smap_siterate[symmetric])


[STATEMENT]
lemma inv_into_map_sum:
  "inv_into (A <+> B) (map_sum f g) x = map_sum (inv_into A f) (inv_into B g) x"
  if "x \<in> f ` A <+> g ` B" "inj_on f A" "inj_on g B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv_into (A <+> B) (map_sum f g) x = map_sum (inv_into A f) (inv_into B g) x
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
x \<in> f ` A <+> g ` B
inj_on f A
inj_on g B

goal (1 subgoal):
 1. inv_into (A <+> B) (map_sum f g) x = map_sum (inv_into A f) (inv_into B g) x
[PROOF STEP]
by(cases rule: PlusE[consumes 1])(auto simp add: inv_into_f_eq f_inv_into_f)


[STATEMENT]
lemma valid_prefix_alt: fixes p::"'a::len prefix_match"
  shows "valid_prefix p = (pfxm_prefix p AND (2 ^ ((len_of TYPE ('a)) - pfxm_length p) - 1) = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valid_prefix p = (pfxm_prefix p && 2 ^ (LENGTH('a) - pfxm_length p) - 1 = 0)
[PROOF STEP]
unfolding valid_prefix_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (pfxm_mask p && pfxm_prefix p = 0) = (pfxm_prefix p && 2 ^ (LENGTH('a) - pfxm_length p) - 1 = 0)
[PROOF STEP]
unfolding mask_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (pfxm_mask p && pfxm_prefix p = 0) = (pfxm_prefix p && 2 ^ (LENGTH('a) - pfxm_length p) - 1 = 0)
[PROOF STEP]
using word_bw_comms(1)
   arg_cong[where f = "\<lambda>x. (pfxm_prefix p AND x - 1 = 0)"]
   shiftl_1
[PROOF STATE]
proof (prove)
using this:
?x && ?y = ?y && ?x
?x = ?y \<Longrightarrow> (pfxm_prefix p && ?x - 1 = 0) = (pfxm_prefix p && ?y - 1 = 0)
(1::?'a) << ?n = (2::?'a) ^ ?n

goal (1 subgoal):
 1. (pfxm_mask p && pfxm_prefix p = 0) = (pfxm_prefix p && 2 ^ (LENGTH('a) - pfxm_length p) - 1 = 0)
[PROOF STEP]
unfolding pfxm_prefix_def pfxm_mask_def mask_eq
[PROOF STATE]
proof (prove)
using this:
?x && ?y = ?y && ?x
?x = ?y \<Longrightarrow> ((case p of PrefixMatch x1 x2 \<Rightarrow> x1) && ?x - 1 = 0) = ((case p of PrefixMatch x1 x2 \<Rightarrow> x1) && ?y - 1 = 0)
(1::?'a) << ?n = (2::?'a) ^ ?n

goal (1 subgoal):
 1. ((1 << LENGTH('a) - pfxm_length p) - 1 && (case p of PrefixMatch x1 x2 \<Rightarrow> x1) = 0) = ((case p of PrefixMatch x1 x2 \<Rightarrow> x1) && 2 ^ (LENGTH('a) - pfxm_length p) - 1 = 0)
[PROOF STEP]
apply (cases p)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x1 x2. \<lbrakk>\<And>x y. x && y = y && x; \<And>x y. x = y \<Longrightarrow> ((case p of PrefixMatch x1 x2 \<Rightarrow> x1) && x - 1 = 0) = ((case p of PrefixMatch x1 x2 \<Rightarrow> x1) && y - 1 = 0); \<And>n. (1::?'a4) << n = (2::?'a4) ^ n; p = PrefixMatch x1 x2\<rbrakk> \<Longrightarrow> ((1 << LENGTH('a) - pfxm_length p) - 1 && (case p of PrefixMatch x1 x2 \<Rightarrow> x1) = 0) = ((case p of PrefixMatch x1 x2 \<Rightarrow> x1) && 2 ^ (LENGTH('a) - pfxm_length p) - 1 = 0)
[PROOF STEP]
apply (simp add: ac_simps push_bit_of_1)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma swap_image_eq:
  assumes "a \<in> A" "b \<in> A"
  shows "Fun.swap a b f ` A = f ` A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<circ> Transposition.transpose a b) ` A = f ` A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<in> A
b \<in> A

goal (1 subgoal):
 1. (f \<circ> Transposition.transpose a b) ` A = f ` A
[PROOF STEP]
by (metis image_comp transpose_image_eq)


[STATEMENT]
lemma dist_nz: "x \<noteq> y \<longleftrightarrow> 0 < dist x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<noteq> y) = (0 < dist x y)
[PROOF STEP]
by (simp add: zero_less_dist_iff)


[STATEMENT]
lemma proj_lift_poly_fun_2_homogenous:
  assumes "f 0 0 = 0"
  shows "proj_poly k (lift_poly_fun_2 f p q) = f (proj_poly k p) (proj_poly k q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proj_poly k (lift_poly_fun_2 f p q) = f (proj_poly k p) (proj_poly k q)
[PROOF STEP]
by (rule poly_mapping_eqI,
      simp add: lookup_proj_poly lookup_lift_poly_fun_2_homogenous[of f, OF assms] term_simps)


[STATEMENT]
lemma Ln_minus:
  assumes "z \<noteq> 0"
    shows "Ln(-z) = (if Im(z) \<le> 0 \<and> \<not>(Re(z) < 0 \<and> Im(z) = 0)
                     then Ln(z) + \<i> * pi
                     else Ln(z) - \<i> * pi)" (is "_ = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ln (- z) = (if Im z \<le> 0 \<and> \<not> (Re z < 0 \<and> Im z = 0) then Ln z + \<i> * complex_of_real pi else Ln z - \<i> * complex_of_real pi)
[PROOF STEP]
using Im_Ln_le_pi [of z] mpi_less_Im_Ln [of z] assms
        Im_Ln_eq_pi [of z] Im_Ln_pos_lt [of z]
[PROOF STATE]
proof (prove)
using this:
z \<noteq> 0 \<Longrightarrow> Im (Ln z) \<le> pi
z \<noteq> 0 \<Longrightarrow> - pi < Im (Ln z)
z \<noteq> 0
z \<noteq> 0 \<Longrightarrow> (Im (Ln z) = pi) = (Re z < 0 \<and> Im z = 0)
z \<noteq> 0 \<Longrightarrow> (0 < Im (Ln z) \<and> Im (Ln z) < pi) = (0 < Im z)

goal (1 subgoal):
 1. Ln (- z) = (if Im z \<le> 0 \<and> \<not> (Re z < 0 \<and> Im z = 0) then Ln z + \<i> * complex_of_real pi else Ln z - \<i> * complex_of_real pi)
[PROOF STEP]
by (fastforce simp: exp_add exp_diff exp_Euler intro!: Ln_unique)


[STATEMENT]
lemma mapAssoc:
shows "map (extend S) (map (extend R) c) = map (extend (extend S R)) c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (extend S) (map (extend R) c) = map (extend (extend S R)) c
[PROOF STEP]
by (induct_tac c) (auto simp add:extendAssoc)


[STATEMENT]
lemma ratfps_nth_code [code]:
  "ratfps_nth x n =
    (let (a,b) = quot_of_ratfps x
     in  \<Sum>i = 0..n. coeff a i * ratfps_nth_aux b (n - i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ratfps_nth x n = (let (a, b) = local.quot_of_ratfps x in \<Sum>i = 0..n. coeff a i * ratfps_nth_aux b (n - i))
[PROOF STEP]
by transfer' simp


[STATEMENT]
lemma tpart1_Un_tpart2[simp]:
assumes "tinfinite V" shows "tpart1 V \<union> tpart2 V = V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tpart1 V \<union> tpart2 V = V
[PROOF STEP]
using assms part1_Un_part2
[PROOF STATE]
proof (prove)
using this:
tinfinite V
infinite ?V \<Longrightarrow> part1 ?V \<union> part2 ?V = ?V

goal (1 subgoal):
 1. tpart1 V \<union> tpart2 V = V
[PROOF STEP]
unfolding tinfinite_def tpart1_def tpart2_def
[PROOF STATE]
proof (prove)
using this:
\<forall>\<sigma>. infinite (V \<inter> tpOfV -` {\<sigma>})
infinite ?V \<Longrightarrow> part1 ?V \<union> part2 ?V = ?V

goal (1 subgoal):
 1. (\<Union>\<sigma>. part1 (V \<inter> tpOfV -` {\<sigma>})) \<union> (\<Union>\<sigma>. part2 (V \<inter> tpOfV -` {\<sigma>})) = V
[PROOF STEP]
unfolding UN_Un_distrib[symmetric]
[PROOF STATE]
proof (prove)
using this:
\<forall>\<sigma>. infinite (V \<inter> tpOfV -` {\<sigma>})
infinite ?V \<Longrightarrow> part1 ?V \<union> part2 ?V = ?V

goal (1 subgoal):
 1. (\<Union>i. part1 (V \<inter> tpOfV -` {i}) \<union> part2 (V \<inter> tpOfV -` {i})) = V
[PROOF STEP]
by blast


[STATEMENT]
lemma possafetyI:
  "(\<And>t. \<lbrakk>t \<in>  A\<^sup>\<spadesuit>; \<forall> r \<in> pfinpref A t. \<exists> s \<in> A\<^sup>\<infinity>. r @@ s \<in> P\<rbrakk> \<Longrightarrow> t \<in> P)
  \<Longrightarrow> possafety A P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>t. \<lbrakk>t \<in> A\<^sup>\<spadesuit>; \<forall>r\<in>pfinpref A t. \<exists>s\<in>A\<^sup>\<infinity>. r @@ s \<in> P\<rbrakk> \<Longrightarrow> t \<in> P) \<Longrightarrow> possafety A P
[PROOF STEP]
by (unfold possafety_def) blast


[STATEMENT]
lemma span_finite_subset:
  assumes "p \<in> span B"
  obtains A where "finite A" and "A \<subseteq> B" and "p \<in> span A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>A. \<lbrakk>finite A; A \<subseteq> B; p \<in> span A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>A. \<lbrakk>finite A; A \<subseteq> B; p \<in> span A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
p \<in> span B
[PROOF STEP]
obtain A q where "finite A" and "A \<subseteq> B" and p: "p = (\<Sum>a\<in>A. q a *s a)"
[PROOF STATE]
proof (prove)
using this:
p \<in> span B

goal (1 subgoal):
 1. (\<And>A q. \<lbrakk>finite A; A \<subseteq> B; p = (\<Sum>a\<in>A. q a *s a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (rule spanE)
[PROOF STATE]
proof (state)
this:
finite A
A \<subseteq> B
p = (\<Sum>a\<in>A. q a *s a)

goal (1 subgoal):
 1. (\<And>A. \<lbrakk>finite A; A \<subseteq> B; p \<in> span A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
note this(1, 2)
[PROOF STATE]
proof (state)
this:
finite A
A \<subseteq> B

goal (1 subgoal):
 1. (\<And>A. \<lbrakk>finite A; A \<subseteq> B; p \<in> span A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite A
A \<subseteq> B

goal (1 subgoal):
 1. (\<And>A. \<lbrakk>finite A; A \<subseteq> B; p \<in> span A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "p \<in> span A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<in> span A
[PROOF STEP]
unfolding p
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>a\<in>A. q a *s a) \<in> span A
[PROOF STEP]
by (rule sum_in_spanI)
[PROOF STATE]
proof (state)
this:
p \<in> span A

goal (1 subgoal):
 1. (\<And>A. \<lbrakk>finite A; A \<subseteq> B; p \<in> span A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
finite A
A \<subseteq> B
p \<in> span A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite A
A \<subseteq> B
p \<in> span A

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma snoc_eq_iff_butlast:
  "xs @ [x] = ys \<longleftrightarrow> (ys \<noteq> [] \<and> butlast ys = xs \<and> last ys = x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (xs @ [x] = ys) = (ys \<noteq> [] \<and> butlast ys = xs \<and> last ys = x)
[PROOF STEP]
by fastforce