[STATEMENT]
lemma subcocycle_bounded_by_birkhoffN:
  assumes "subcocycle u" "n > 2*N" "N>0"
  shows "u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x
                + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>)
                + 2 * (\<Sum>i<2*N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
have Iar: "u (a*N+r) x \<le> u r x + (\<Sum>i<a. u N ((T^^(i * N + r))x))" for r a
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u (a * N + r) x \<le> u r x + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))
[PROOF STEP]
proof (induction a)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. u (0 * N + r) x \<le> u r x + (\<Sum>i<0. u N ((T ^^ (i * N + r)) x))
 2. \<And>a. u (a * N + r) x \<le> u r x + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x)) \<Longrightarrow> u (Suc a * N + r) x \<le> u r x + (\<Sum>i<Suc a. u N ((T ^^ (i * N + r)) x))
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. u (0 * N + r) x \<le> u r x + (\<Sum>i<0. u N ((T ^^ (i * N + r)) x))
 2. \<And>a. u (a * N + r) x \<le> u r x + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x)) \<Longrightarrow> u (Suc a * N + r) x \<le> u r x + (\<Sum>i<Suc a. u N ((T ^^ (i * N + r)) x))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u (0 * N + r) x \<le> u r x + (\<Sum>i<0. u N ((T ^^ (i * N + r)) x))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u (0 * N + r) x \<le> u r x + (\<Sum>i<0. u N ((T ^^ (i * N + r)) x))

goal (1 subgoal):
 1. \<And>a. u (a * N + r) x \<le> u r x + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x)) \<Longrightarrow> u (Suc a * N + r) x \<le> u r x + (\<Sum>i<Suc a. u N ((T ^^ (i * N + r)) x))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a. u (a * N + r) x \<le> u r x + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x)) \<Longrightarrow> u (Suc a * N + r) x \<le> u r x + (\<Sum>i<Suc a. u N ((T ^^ (i * N + r)) x))
[PROOF STEP]
case (Suc a)
[PROOF STATE]
proof (state)
this:
u (a * N + r) x \<le> u r x + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))

goal (1 subgoal):
 1. \<And>a. u (a * N + r) x \<le> u r x + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x)) \<Longrightarrow> u (Suc a * N + r) x \<le> u r x + (\<Sum>i<Suc a. u N ((T ^^ (i * N + r)) x))
[PROOF STEP]
have "u ((a+1)*N+r) x = u((a*N+r) + N) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u ((a + 1) * N + r) x = u (a * N + r + N) x
[PROOF STEP]
by (simp add: semiring_normalization_rules(2) semiring_normalization_rules(23))
[PROOF STATE]
proof (state)
this:
u ((a + 1) * N + r) x = u (a * N + r + N) x

goal (1 subgoal):
 1. \<And>a. u (a * N + r) x \<le> u r x + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x)) \<Longrightarrow> u (Suc a * N + r) x \<le> u r x + (\<Sum>i<Suc a. u N ((T ^^ (i * N + r)) x))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
u ((a + 1) * N + r) x = u (a * N + r + N) x

goal (1 subgoal):
 1. \<And>a. u (a * N + r) x \<le> u r x + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x)) \<Longrightarrow> u (Suc a * N + r) x \<le> u r x + (\<Sum>i<Suc a. u N ((T ^^ (i * N + r)) x))
[PROOF STEP]
have "... \<le> u(a*N+r) x + u N ((T^^(a*N+r))x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u (a * N + r + N) x \<le> u (a * N + r) x + u N ((T ^^ (a * N + r)) x)
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
subcocycle u

goal (1 subgoal):
 1. u (a * N + r + N) x \<le> u (a * N + r) x + u N ((T ^^ (a * N + r)) x)
[PROOF STEP]
unfolding subcocycle_def
[PROOF STATE]
proof (prove)
using this:
(\<forall>n. integrable M (u n)) \<and> (\<forall>n m x. u (n + m) x \<le> u n x + u m ((T ^^ n) x))

goal (1 subgoal):
 1. u (a * N + r + N) x \<le> u (a * N + r) x + u N ((T ^^ (a * N + r)) x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u (a * N + r + N) x \<le> u (a * N + r) x + u N ((T ^^ (a * N + r)) x)

goal (1 subgoal):
 1. \<And>a. u (a * N + r) x \<le> u r x + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x)) \<Longrightarrow> u (Suc a * N + r) x \<le> u r x + (\<Sum>i<Suc a. u N ((T ^^ (i * N + r)) x))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
u (a * N + r + N) x \<le> u (a * N + r) x + u N ((T ^^ (a * N + r)) x)

goal (1 subgoal):
 1. \<And>a. u (a * N + r) x \<le> u r x + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x)) \<Longrightarrow> u (Suc a * N + r) x \<le> u r x + (\<Sum>i<Suc a. u N ((T ^^ (i * N + r)) x))
[PROOF STEP]
have "... \<le> u r x + (\<Sum>i<a. u N ((T^^(i * N + r))x)) + u N ((T^^(a*N+r))x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u (a * N + r) x + u N ((T ^^ (a * N + r)) x) \<le> u r x + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x)) + u N ((T ^^ (a * N + r)) x)
[PROOF STEP]
using Suc.IH
[PROOF STATE]
proof (prove)
using this:
u (a * N + r) x \<le> u r x + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))

goal (1 subgoal):
 1. u (a * N + r) x + u N ((T ^^ (a * N + r)) x) \<le> u r x + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x)) + u N ((T ^^ (a * N + r)) x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u (a * N + r) x + u N ((T ^^ (a * N + r)) x) \<le> u r x + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x)) + u N ((T ^^ (a * N + r)) x)

goal (1 subgoal):
 1. \<And>a. u (a * N + r) x \<le> u r x + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x)) \<Longrightarrow> u (Suc a * N + r) x \<le> u r x + (\<Sum>i<Suc a. u N ((T ^^ (i * N + r)) x))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
u (a * N + r) x + u N ((T ^^ (a * N + r)) x) \<le> u r x + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x)) + u N ((T ^^ (a * N + r)) x)

goal (1 subgoal):
 1. \<And>a. u (a * N + r) x \<le> u r x + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x)) \<Longrightarrow> u (Suc a * N + r) x \<le> u r x + (\<Sum>i<Suc a. u N ((T ^^ (i * N + r)) x))
[PROOF STEP]
have "... = u r x + (\<Sum>i<a+1. u N ((T^^(i * N + r))x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u r x + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x)) + u N ((T ^^ (a * N + r)) x) = u r x + (\<Sum>i<a + 1. u N ((T ^^ (i * N + r)) x))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u r x + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x)) + u N ((T ^^ (a * N + r)) x) = u r x + (\<Sum>i<a + 1. u N ((T ^^ (i * N + r)) x))

goal (1 subgoal):
 1. \<And>a. u (a * N + r) x \<le> u r x + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x)) \<Longrightarrow> u (Suc a * N + r) x \<le> u r x + (\<Sum>i<Suc a. u N ((T ^^ (i * N + r)) x))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
u ((a + 1) * N + r) x \<le> u r x + (\<Sum>i<a + 1. u N ((T ^^ (i * N + r)) x))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
u ((a + 1) * N + r) x \<le> u r x + (\<Sum>i<a + 1. u N ((T ^^ (i * N + r)) x))

goal (1 subgoal):
 1. u (Suc a * N + r) x \<le> u r x + (\<Sum>i<Suc a. u N ((T ^^ (i * N + r)) x))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u (Suc a * N + r) x \<le> u r x + (\<Sum>i<Suc a. u N ((T ^^ (i * N + r)) x))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
u (?a3 * N + ?r3) x \<le> u ?r3 x + (\<Sum>i<?a3. u N ((T ^^ (i * N + ?r3)) x))

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
have Ia: "u (a*N) x \<le> (\<Sum>i<a. u N ((T^^(i * N))x))" if "a>0" for a
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u (a * N) x \<le> (\<Sum>i<a. u N ((T ^^ (i * N)) x))
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
0 < a

goal (1 subgoal):
 1. u (a * N) x \<le> (\<Sum>i<a. u N ((T ^^ (i * N)) x))
[PROOF STEP]
proof (induction rule: ind_from_1)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. u (1 * N) x \<le> (\<Sum>i<1. u N ((T ^^ (i * N)) x))
 2. \<And>n. \<lbrakk>0 < n; u (n * N) x \<le> (\<Sum>i<n. u N ((T ^^ (i * N)) x))\<rbrakk> \<Longrightarrow> u (Suc n * N) x \<le> (\<Sum>i<Suc n. u N ((T ^^ (i * N)) x))
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. u (1 * N) x \<le> (\<Sum>i<1. u N ((T ^^ (i * N)) x))
 2. \<And>n. \<lbrakk>0 < n; u (n * N) x \<le> (\<Sum>i<n. u N ((T ^^ (i * N)) x))\<rbrakk> \<Longrightarrow> u (Suc n * N) x \<le> (\<Sum>i<Suc n. u N ((T ^^ (i * N)) x))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u (1 * N) x \<le> (\<Sum>i<1. u N ((T ^^ (i * N)) x))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u (1 * N) x \<le> (\<Sum>i<1. u N ((T ^^ (i * N)) x))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < n; u (n * N) x \<le> (\<Sum>i<n. u N ((T ^^ (i * N)) x))\<rbrakk> \<Longrightarrow> u (Suc n * N) x \<le> (\<Sum>i<Suc n. u N ((T ^^ (i * N)) x))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < n; u (n * N) x \<le> (\<Sum>i<n. u N ((T ^^ (i * N)) x))\<rbrakk> \<Longrightarrow> u (Suc n * N) x \<le> (\<Sum>i<Suc n. u N ((T ^^ (i * N)) x))
[PROOF STEP]
case (Suc a)
[PROOF STATE]
proof (state)
this:
0 < a
u (a * N) x \<le> (\<Sum>i<a. u N ((T ^^ (i * N)) x))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < n; u (n * N) x \<le> (\<Sum>i<n. u N ((T ^^ (i * N)) x))\<rbrakk> \<Longrightarrow> u (Suc n * N) x \<le> (\<Sum>i<Suc n. u N ((T ^^ (i * N)) x))
[PROOF STEP]
have "u ((a+1)*N) x = u((a*N) + N) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u ((a + 1) * N) x = u (a * N + N) x
[PROOF STEP]
by (simp add: semiring_normalization_rules(2) semiring_normalization_rules(23))
[PROOF STATE]
proof (state)
this:
u ((a + 1) * N) x = u (a * N + N) x

goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < n; u (n * N) x \<le> (\<Sum>i<n. u N ((T ^^ (i * N)) x))\<rbrakk> \<Longrightarrow> u (Suc n * N) x \<le> (\<Sum>i<Suc n. u N ((T ^^ (i * N)) x))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
u ((a + 1) * N) x = u (a * N + N) x

goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < n; u (n * N) x \<le> (\<Sum>i<n. u N ((T ^^ (i * N)) x))\<rbrakk> \<Longrightarrow> u (Suc n * N) x \<le> (\<Sum>i<Suc n. u N ((T ^^ (i * N)) x))
[PROOF STEP]
have "... \<le> u(a*N) x + u N ((T^^(a*N))x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u (a * N + N) x \<le> u (a * N) x + u N ((T ^^ (a * N)) x)
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
subcocycle u

goal (1 subgoal):
 1. u (a * N + N) x \<le> u (a * N) x + u N ((T ^^ (a * N)) x)
[PROOF STEP]
unfolding subcocycle_def
[PROOF STATE]
proof (prove)
using this:
(\<forall>n. integrable M (u n)) \<and> (\<forall>n m x. u (n + m) x \<le> u n x + u m ((T ^^ n) x))

goal (1 subgoal):
 1. u (a * N + N) x \<le> u (a * N) x + u N ((T ^^ (a * N)) x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u (a * N + N) x \<le> u (a * N) x + u N ((T ^^ (a * N)) x)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < n; u (n * N) x \<le> (\<Sum>i<n. u N ((T ^^ (i * N)) x))\<rbrakk> \<Longrightarrow> u (Suc n * N) x \<le> (\<Sum>i<Suc n. u N ((T ^^ (i * N)) x))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
u (a * N + N) x \<le> u (a * N) x + u N ((T ^^ (a * N)) x)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < n; u (n * N) x \<le> (\<Sum>i<n. u N ((T ^^ (i * N)) x))\<rbrakk> \<Longrightarrow> u (Suc n * N) x \<le> (\<Sum>i<Suc n. u N ((T ^^ (i * N)) x))
[PROOF STEP]
have "... \<le> (\<Sum>i<a. u N ((T^^(i * N))x)) + u N ((T^^(a*N))x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u (a * N) x + u N ((T ^^ (a * N)) x) \<le> (\<Sum>i<a. u N ((T ^^ (i * N)) x)) + u N ((T ^^ (a * N)) x)
[PROOF STEP]
using Suc
[PROOF STATE]
proof (prove)
using this:
0 < a
u (a * N) x \<le> (\<Sum>i<a. u N ((T ^^ (i * N)) x))

goal (1 subgoal):
 1. u (a * N) x + u N ((T ^^ (a * N)) x) \<le> (\<Sum>i<a. u N ((T ^^ (i * N)) x)) + u N ((T ^^ (a * N)) x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u (a * N) x + u N ((T ^^ (a * N)) x) \<le> (\<Sum>i<a. u N ((T ^^ (i * N)) x)) + u N ((T ^^ (a * N)) x)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < n; u (n * N) x \<le> (\<Sum>i<n. u N ((T ^^ (i * N)) x))\<rbrakk> \<Longrightarrow> u (Suc n * N) x \<le> (\<Sum>i<Suc n. u N ((T ^^ (i * N)) x))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
u (a * N) x + u N ((T ^^ (a * N)) x) \<le> (\<Sum>i<a. u N ((T ^^ (i * N)) x)) + u N ((T ^^ (a * N)) x)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < n; u (n * N) x \<le> (\<Sum>i<n. u N ((T ^^ (i * N)) x))\<rbrakk> \<Longrightarrow> u (Suc n * N) x \<le> (\<Sum>i<Suc n. u N ((T ^^ (i * N)) x))
[PROOF STEP]
have "... = (\<Sum>i<a+1. u N ((T^^(i * N))x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<a. u N ((T ^^ (i * N)) x)) + u N ((T ^^ (a * N)) x) = (\<Sum>i<a + 1. u N ((T ^^ (i * N)) x))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i<a. u N ((T ^^ (i * N)) x)) + u N ((T ^^ (a * N)) x) = (\<Sum>i<a + 1. u N ((T ^^ (i * N)) x))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>0 < n; u (n * N) x \<le> (\<Sum>i<n. u N ((T ^^ (i * N)) x))\<rbrakk> \<Longrightarrow> u (Suc n * N) x \<le> (\<Sum>i<Suc n. u N ((T ^^ (i * N)) x))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
u ((a + 1) * N) x \<le> (\<Sum>i<a + 1. u N ((T ^^ (i * N)) x))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
u ((a + 1) * N) x \<le> (\<Sum>i<a + 1. u N ((T ^^ (i * N)) x))

goal (1 subgoal):
 1. u (Suc a * N) x \<le> (\<Sum>i<Suc a. u N ((T ^^ (i * N)) x))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u (Suc a * N) x \<le> (\<Sum>i<Suc a. u N ((T ^^ (i * N)) x))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 < ?a3 \<Longrightarrow> u (?a3 * N) x \<le> (\<Sum>i<?a3. u N ((T ^^ (i * N)) x))

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
define E1 where "E1 = (\<Sum>i<N. abs(u 1 ((T^^i)x)))"
[PROOF STATE]
proof (state)
this:
E1 = (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>)

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
define E2 where "E2 = (\<Sum>i<2*N. abs(u 1 ((T^^(n-(2*N-i))) x)))"
[PROOF STATE]
proof (state)
this:
E2 = (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
have "E2 \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> E2
[PROOF STEP]
unfolding E2_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> E2

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
obtain a0 s0 where 0: "s0 < N" "n = a0 * N + s0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>s0 a0. \<lbrakk>s0 < N; n = a0 * N + s0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>0 < N\<close> mod_div_decomp mod_less_divisor
[PROOF STATE]
proof (prove)
using this:
0 < N
(\<And>q r. \<lbrakk>q = ?a div ?b; r = ?a mod ?b; ?a = q * ?b + r\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis
0 < ?n \<Longrightarrow> ?m mod ?n < ?n

goal (1 subgoal):
 1. (\<And>s0 a0. \<lbrakk>s0 < N; n = a0 * N + s0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
s0 < N
n = a0 * N + s0

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
s0 < N
n = a0 * N + s0
[PROOF STEP]
have "a0 \<ge> 1"
[PROOF STATE]
proof (prove)
using this:
s0 < N
n = a0 * N + s0

goal (1 subgoal):
 1. 1 \<le> a0
[PROOF STEP]
using \<open>n > 2 * N\<close> \<open>N>0\<close>
[PROOF STATE]
proof (prove)
using this:
s0 < N
n = a0 * N + s0
2 * N < n
0 < N

goal (1 subgoal):
 1. 1 \<le> a0
[PROOF STEP]
by (metis Nat.add_0_right add.commute add_lessD1 add_mult_distrib comm_monoid_mult_class.mult_1 eq_imp_le
    less_imp_add_positive less_imp_le_nat less_one linorder_neqE_nat mult.left_neutral mult_not_zero not_add_less1 one_add_one)
[PROOF STATE]
proof (state)
this:
1 \<le> a0

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
define a s where "a = a0-1" and "s = s0+N"
[PROOF STATE]
proof (state)
this:
a = a0 - 1
s = s0 + N

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a = a0 - 1
s = s0 + N
[PROOF STEP]
have as: "n = a * N + s"
[PROOF STATE]
proof (prove)
using this:
a = a0 - 1
s = s0 + N

goal (1 subgoal):
 1. n = a * N + s
[PROOF STEP]
unfolding a_def s_def
[PROOF STATE]
proof (prove)
using this:
a0 - 1 = a0 - 1
s0 + N = s0 + N

goal (1 subgoal):
 1. n = (a0 - 1) * N + (s0 + N)
[PROOF STEP]
using \<open>a0 \<ge> 1\<close> 0
[PROOF STATE]
proof (prove)
using this:
a0 - 1 = a0 - 1
s0 + N = s0 + N
1 \<le> a0
s0 < N
n = a0 * N + s0

goal (1 subgoal):
 1. n = (a0 - 1) * N + (s0 + N)
[PROOF STEP]
by (simp add: mult_eq_if)
[PROOF STATE]
proof (state)
this:
n = a * N + s

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
have s: "s \<ge> N" "s < 2*N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. N \<le> s &&& s < 2 * N
[PROOF STEP]
using 0
[PROOF STATE]
proof (prove)
using this:
s0 < N
n = a0 * N + s0

goal (1 subgoal):
 1. N \<le> s &&& s < 2 * N
[PROOF STEP]
unfolding s_def
[PROOF STATE]
proof (prove)
using this:
s0 < N
n = a0 * N + s0

goal (1 subgoal):
 1. N \<le> s0 + N &&& s0 + N < 2 * N
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
N \<le> s
s < 2 * N

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
have a: "a*N > n - 2*N" "a*N \<le> n - N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n - 2 * N < a * N &&& a * N \<le> n - N
[PROOF STEP]
using as s \<open>n > 2*N\<close>
[PROOF STATE]
proof (prove)
using this:
n = a * N + s
N \<le> s
s < 2 * N
2 * N < n

goal (1 subgoal):
 1. n - 2 * N < a * N &&& a * N \<le> n - N
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n - 2 * N < a * N
a * N \<le> n - N

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n - 2 * N < a * N
a * N \<le> n - N
[PROOF STEP]
have "(a*N - (n-2*N)) \<le> N"
[PROOF STATE]
proof (prove)
using this:
n - 2 * N < a * N
a * N \<le> n - N

goal (1 subgoal):
 1. a * N - (n - 2 * N) \<le> N
[PROOF STEP]
using \<open>n > 2*N\<close>
[PROOF STATE]
proof (prove)
using this:
n - 2 * N < a * N
a * N \<le> n - N
2 * N < n

goal (1 subgoal):
 1. a * N - (n - 2 * N) \<le> N
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a * N - (n - 2 * N) \<le> N

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
have "a*N \<ge> n - 2*N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n - 2 * N \<le> a * N
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
n - 2 * N < a * N
a * N \<le> n - N

goal (1 subgoal):
 1. n - 2 * N \<le> a * N
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
n - 2 * N \<le> a * N

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
n - 2 * N \<le> a * N

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
fix r::nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
assume "r < N"
[PROOF STATE]
proof (state)
this:
r < N

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
have "a*N+r > n - 2*N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n - 2 * N < a * N + r
[PROOF STEP]
using \<open>n>2*N\<close> as s
[PROOF STATE]
proof (prove)
using this:
2 * N < n
n = a * N + s
N \<le> s
s < 2 * N

goal (1 subgoal):
 1. n - 2 * N < a * N + r
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n - 2 * N < a * N + r

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
define tr where "tr = n-(a*N+r)"
[PROOF STATE]
proof (state)
this:
tr = n - (a * N + r)

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
have "tr > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < tr
[PROOF STEP]
unfolding tr_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n - (a * N + r)
[PROOF STEP]
using as s \<open>r<N\<close>
[PROOF STATE]
proof (prove)
using this:
n = a * N + s
N \<le> s
s < 2 * N
r < N

goal (1 subgoal):
 1. 0 < n - (a * N + r)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < tr

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < tr
[PROOF STEP]
have *: "n = (a*N+r) + tr"
[PROOF STATE]
proof (prove)
using this:
0 < tr

goal (1 subgoal):
 1. n = a * N + r + tr
[PROOF STEP]
unfolding tr_def
[PROOF STATE]
proof (prove)
using this:
0 < n - (a * N + r)

goal (1 subgoal):
 1. n = a * N + r + (n - (a * N + r))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n = a * N + r + tr

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
have "birkhoff_sum (u 1) tr ((T^^(a*N+r))x) = (\<Sum>i<tr. u 1 ((T^^(a*N+r+i))x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. birkhoff_sum (u 1) tr ((T ^^ (a * N + r)) x) = (\<Sum>i<tr. u 1 ((T ^^ (a * N + r + i)) x))
[PROOF STEP]
unfolding birkhoff_sum_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<tr. u 1 ((T ^^ i) ((T ^^ (a * N + r)) x))) = (\<Sum>i<tr. u 1 ((T ^^ (a * N + r + i)) x))
[PROOF STEP]
by (simp add: add.commute funpow_add)
[PROOF STATE]
proof (state)
this:
birkhoff_sum (u 1) tr ((T ^^ (a * N + r)) x) = (\<Sum>i<tr. u 1 ((T ^^ (a * N + r + i)) x))

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
birkhoff_sum (u 1) tr ((T ^^ (a * N + r)) x) = (\<Sum>i<tr. u 1 ((T ^^ (a * N + r + i)) x))

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
have "... = (\<Sum>i\<in>{a*N+r..<a*N+r+tr}. u 1 ((T^^i) x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<tr. u 1 ((T ^^ (a * N + r + i)) x)) = (\<Sum>i = a * N + r..<a * N + r + tr. u 1 ((T ^^ i) x))
[PROOF STEP]
by (rule sum.reindex_bij_betw, rule bij_betw_byWitness[where ?f' = "\<lambda>i. i - (a * N + r)"], auto)
[PROOF STATE]
proof (state)
this:
(\<Sum>i<tr. u 1 ((T ^^ (a * N + r + i)) x)) = (\<Sum>i = a * N + r..<a * N + r + tr. u 1 ((T ^^ i) x))

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i<tr. u 1 ((T ^^ (a * N + r + i)) x)) = (\<Sum>i = a * N + r..<a * N + r + tr. u 1 ((T ^^ i) x))

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
have "... \<le> (\<Sum>i\<in>{a*N+r..<a*N+r+tr}. abs(u 1 ((T^^i) x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = a * N + r..<a * N + r + tr. u 1 ((T ^^ i) x)) \<le> (\<Sum>i = a * N + r..<a * N + r + tr. \<bar>u 1 ((T ^^ i) x)\<bar>)
[PROOF STEP]
by (simp add: sum_mono)
[PROOF STATE]
proof (state)
this:
(\<Sum>i = a * N + r..<a * N + r + tr. u 1 ((T ^^ i) x)) \<le> (\<Sum>i = a * N + r..<a * N + r + tr. \<bar>u 1 ((T ^^ i) x)\<bar>)

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i = a * N + r..<a * N + r + tr. u 1 ((T ^^ i) x)) \<le> (\<Sum>i = a * N + r..<a * N + r + tr. \<bar>u 1 ((T ^^ i) x)\<bar>)

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
have "... \<le> (\<Sum>i\<in>{n-2*N..<n}. abs(u 1 ((T^^i) x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = a * N + r..<a * N + r + tr. \<bar>u 1 ((T ^^ i) x)\<bar>) \<le> (\<Sum>i = n - 2 * N..<n. \<bar>u 1 ((T ^^ i) x)\<bar>)
[PROOF STEP]
apply (rule sum_mono2)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. finite {n - 2 * N..<n}
 2. {a * N + r..<a * N + r + tr} \<subseteq> {n - 2 * N..<n}
 3. \<And>b. b \<in> {n - 2 * N..<n} - {a * N + r..<a * N + r + tr} \<Longrightarrow> 0 \<le> \<bar>u 1 ((T ^^ b) x)\<bar>
[PROOF STEP]
using as s \<open>r<N\<close> tr_def
[PROOF STATE]
proof (prove)
using this:
n = a * N + s
N \<le> s
s < 2 * N
r < N
tr = n - (a * N + r)

goal (3 subgoals):
 1. finite {n - 2 * N..<n}
 2. {a * N + r..<a * N + r + tr} \<subseteq> {n - 2 * N..<n}
 3. \<And>b. b \<in> {n - 2 * N..<n} - {a * N + r..<a * N + r + tr} \<Longrightarrow> 0 \<le> \<bar>u 1 ((T ^^ b) x)\<bar>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i = a * N + r..<a * N + r + tr. \<bar>u 1 ((T ^^ i) x)\<bar>) \<le> (\<Sum>i = n - 2 * N..<n. \<bar>u 1 ((T ^^ i) x)\<bar>)

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i = a * N + r..<a * N + r + tr. \<bar>u 1 ((T ^^ i) x)\<bar>) \<le> (\<Sum>i = n - 2 * N..<n. \<bar>u 1 ((T ^^ i) x)\<bar>)

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
have "... = E2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = n - 2 * N..<n. \<bar>u 1 ((T ^^ i) x)\<bar>) = E2
[PROOF STEP]
unfolding E2_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = n - 2 * N..<n. \<bar>u 1 ((T ^^ i) x)\<bar>) = (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
apply (rule sum.reindex_bij_betw[symmetric], rule bij_betw_byWitness[where ?f' = "\<lambda>i. i - (n-2*N)"])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<forall>a\<in>{..<2 * N}. n - (2 * N - a) - (n - 2 * N) = a
 2. \<forall>a'\<in>{n - 2 * N..<n}. n - (2 * N - (a' - (n - 2 * N))) = a'
 3. (\<lambda>x. n - (2 * N - x)) ` {..<2 * N} \<subseteq> {n - 2 * N..<n}
 4. (\<lambda>i. i - (n - 2 * N)) ` {n - 2 * N..<n} \<subseteq> {..<2 * N}
[PROOF STEP]
using \<open>n > 2*N\<close>
[PROOF STATE]
proof (prove)
using this:
2 * N < n

goal (4 subgoals):
 1. \<forall>a\<in>{..<2 * N}. n - (2 * N - a) - (n - 2 * N) = a
 2. \<forall>a'\<in>{n - 2 * N..<n}. n - (2 * N - (a' - (n - 2 * N))) = a'
 3. (\<lambda>x. n - (2 * N - x)) ` {..<2 * N} \<subseteq> {n - 2 * N..<n}
 4. (\<lambda>i. i - (n - 2 * N)) ` {n - 2 * N..<n} \<subseteq> {..<2 * N}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i = n - 2 * N..<n. \<bar>u 1 ((T ^^ i) x)\<bar>) = E2

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
birkhoff_sum (u 1) tr ((T ^^ (a * N + r)) x) \<le> E2
[PROOF STEP]
have A: "birkhoff_sum (u 1) tr ((T^^(a*N+r))x) \<le> E2"
[PROOF STATE]
proof (prove)
using this:
birkhoff_sum (u 1) tr ((T ^^ (a * N + r)) x) \<le> E2

goal (1 subgoal):
 1. birkhoff_sum (u 1) tr ((T ^^ (a * N + r)) x) \<le> E2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
birkhoff_sum (u 1) tr ((T ^^ (a * N + r)) x) \<le> E2

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
have "u n x \<le> u (a*N+r) x + u tr ((T^^(a*N+r))x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u n x \<le> u (a * N + r) x + u tr ((T ^^ (a * N + r)) x)
[PROOF STEP]
using assms(1) *
[PROOF STATE]
proof (prove)
using this:
subcocycle u
n = a * N + r + tr

goal (1 subgoal):
 1. u n x \<le> u (a * N + r) x + u tr ((T ^^ (a * N + r)) x)
[PROOF STEP]
unfolding subcocycle_def
[PROOF STATE]
proof (prove)
using this:
(\<forall>n. integrable M (u n)) \<and> (\<forall>n m x. u (n + m) x \<le> u n x + u m ((T ^^ n) x))
n = a * N + r + tr

goal (1 subgoal):
 1. u n x \<le> u (a * N + r) x + u tr ((T ^^ (a * N + r)) x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u n x \<le> u (a * N + r) x + u tr ((T ^^ (a * N + r)) x)

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
u n x \<le> u (a * N + r) x + u tr ((T ^^ (a * N + r)) x)

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
have "... \<le> u (a*N+r) x + birkhoff_sum (u 1) tr ((T^^(a*N+r))x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u (a * N + r) x + u tr ((T ^^ (a * N + r)) x) \<le> u (a * N + r) x + birkhoff_sum (u 1) tr ((T ^^ (a * N + r)) x)
[PROOF STEP]
using subcocycle_bounded_by_birkhoff1[OF assms(1)] \<open>tr > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < ?n \<Longrightarrow> u ?n ?x \<le> birkhoff_sum (u 1) ?n ?x
0 < tr

goal (1 subgoal):
 1. u (a * N + r) x + u tr ((T ^^ (a * N + r)) x) \<le> u (a * N + r) x + birkhoff_sum (u 1) tr ((T ^^ (a * N + r)) x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u (a * N + r) x + u tr ((T ^^ (a * N + r)) x) \<le> u (a * N + r) x + birkhoff_sum (u 1) tr ((T ^^ (a * N + r)) x)

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
u n x \<le> u (a * N + r) x + birkhoff_sum (u 1) tr ((T ^^ (a * N + r)) x)
[PROOF STEP]
have B: "u n x \<le> u (a*N+r) x + E2"
[PROOF STATE]
proof (prove)
using this:
u n x \<le> u (a * N + r) x + birkhoff_sum (u 1) tr ((T ^^ (a * N + r)) x)

goal (1 subgoal):
 1. u n x \<le> u (a * N + r) x + E2
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
u n x \<le> u (a * N + r) x + birkhoff_sum (u 1) tr ((T ^^ (a * N + r)) x)
birkhoff_sum (u 1) tr ((T ^^ (a * N + r)) x) \<le> E2

goal (1 subgoal):
 1. u n x \<le> u (a * N + r) x + E2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u n x \<le> u (a * N + r) x + E2

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
have "u (a*N+r) x \<le> (\<Sum>i<N. abs(u 1 ((T^^i)x))) + (\<Sum>i<a. u N ((T^^(i*N+r))x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u (a * N + r) x \<le> (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))
[PROOF STEP]
proof (cases "r = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. r = 0 \<Longrightarrow> u (a * N + r) x \<le> (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))
 2. r \<noteq> 0 \<Longrightarrow> u (a * N + r) x \<le> (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
r = 0

goal (2 subgoals):
 1. r = 0 \<Longrightarrow> u (a * N + r) x \<le> (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))
 2. r \<noteq> 0 \<Longrightarrow> u (a * N + r) x \<le> (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
r = 0
[PROOF STEP]
have "a>0"
[PROOF STATE]
proof (prove)
using this:
r = 0

goal (1 subgoal):
 1. 0 < a
[PROOF STEP]
using \<open>a*N+r > n - 2*N\<close> not_less
[PROOF STATE]
proof (prove)
using this:
r = 0
n - 2 * N < a * N + r
(\<not> ?x < ?y) = (?y \<le> ?x)

goal (1 subgoal):
 1. 0 < a
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
0 < a

goal (2 subgoals):
 1. r = 0 \<Longrightarrow> u (a * N + r) x \<le> (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))
 2. r \<noteq> 0 \<Longrightarrow> u (a * N + r) x \<le> (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))
[PROOF STEP]
have "u(a*N+r) x \<le> (\<Sum>i<a. u N ((T^^(i*N+r))x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u (a * N + r) x \<le> (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))
[PROOF STEP]
using Ia[OF \<open>a>0\<close>] True
[PROOF STATE]
proof (prove)
using this:
u (a * N) x \<le> (\<Sum>i<a. u N ((T ^^ (i * N)) x))
r = 0

goal (1 subgoal):
 1. u (a * N + r) x \<le> (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u (a * N + r) x \<le> (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))

goal (2 subgoals):
 1. r = 0 \<Longrightarrow> u (a * N + r) x \<le> (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))
 2. r \<noteq> 0 \<Longrightarrow> u (a * N + r) x \<le> (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
u (a * N + r) x \<le> (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))

goal (2 subgoals):
 1. r = 0 \<Longrightarrow> u (a * N + r) x \<le> (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))
 2. r \<noteq> 0 \<Longrightarrow> u (a * N + r) x \<le> (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))
[PROOF STEP]
have "0 \<le> (\<Sum>i<N. abs(u 1 ((T^^i)x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>)

goal (2 subgoals):
 1. r = 0 \<Longrightarrow> u (a * N + r) x \<le> (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))
 2. r \<noteq> 0 \<Longrightarrow> u (a * N + r) x \<le> (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
u (a * N + r) x \<le> (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))
0 \<le> (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
u (a * N + r) x \<le> (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))
0 \<le> (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>)

goal (1 subgoal):
 1. u (a * N + r) x \<le> (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
u (a * N + r) x \<le> (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))

goal (1 subgoal):
 1. r \<noteq> 0 \<Longrightarrow> u (a * N + r) x \<le> (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. r \<noteq> 0 \<Longrightarrow> u (a * N + r) x \<le> (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
r \<noteq> 0

goal (1 subgoal):
 1. r \<noteq> 0 \<Longrightarrow> u (a * N + r) x \<le> (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
r \<noteq> 0
[PROOF STEP]
have I: "u (a*N+r) x \<le> u r x + (\<Sum>i<a. u N ((T^^(i * N + r))x))"
[PROOF STATE]
proof (prove)
using this:
r \<noteq> 0

goal (1 subgoal):
 1. u (a * N + r) x \<le> u r x + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))
[PROOF STEP]
using Iar
[PROOF STATE]
proof (prove)
using this:
r \<noteq> 0
u (?a3 * N + ?r3) x \<le> u ?r3 x + (\<Sum>i<?a3. u N ((T ^^ (i * N + ?r3)) x))

goal (1 subgoal):
 1. u (a * N + r) x \<le> u r x + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u (a * N + r) x \<le> u r x + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))

goal (1 subgoal):
 1. r \<noteq> 0 \<Longrightarrow> u (a * N + r) x \<le> (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))
[PROOF STEP]
have "u r x \<le> (\<Sum>i<r. u 1 ((T^^i)x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u r x \<le> (\<Sum>i<r. u 1 ((T ^^ i) x))
[PROOF STEP]
using subcocycle_bounded_by_birkhoff1[OF assms(1)] False
[PROOF STATE]
proof (prove)
using this:
0 < ?n \<Longrightarrow> u ?n ?x \<le> birkhoff_sum (u 1) ?n ?x
r \<noteq> 0

goal (1 subgoal):
 1. u r x \<le> (\<Sum>i<r. u 1 ((T ^^ i) x))
[PROOF STEP]
unfolding birkhoff_sum_def
[PROOF STATE]
proof (prove)
using this:
0 < ?n \<Longrightarrow> u ?n ?x \<le> (\<Sum>i<?n. u 1 ((T ^^ i) ?x))
r \<noteq> 0

goal (1 subgoal):
 1. u r x \<le> (\<Sum>i<r. u 1 ((T ^^ i) x))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u r x \<le> (\<Sum>i<r. u 1 ((T ^^ i) x))

goal (1 subgoal):
 1. r \<noteq> 0 \<Longrightarrow> u (a * N + r) x \<le> (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
u r x \<le> (\<Sum>i<r. u 1 ((T ^^ i) x))

goal (1 subgoal):
 1. r \<noteq> 0 \<Longrightarrow> u (a * N + r) x \<le> (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))
[PROOF STEP]
have "... \<le> (\<Sum>i<r. abs(u 1 ((T^^i)x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<r. u 1 ((T ^^ i) x)) \<le> (\<Sum>i<r. \<bar>u 1 ((T ^^ i) x)\<bar>)
[PROOF STEP]
by (simp add: sum_mono)
[PROOF STATE]
proof (state)
this:
(\<Sum>i<r. u 1 ((T ^^ i) x)) \<le> (\<Sum>i<r. \<bar>u 1 ((T ^^ i) x)\<bar>)

goal (1 subgoal):
 1. r \<noteq> 0 \<Longrightarrow> u (a * N + r) x \<le> (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i<r. u 1 ((T ^^ i) x)) \<le> (\<Sum>i<r. \<bar>u 1 ((T ^^ i) x)\<bar>)

goal (1 subgoal):
 1. r \<noteq> 0 \<Longrightarrow> u (a * N + r) x \<le> (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))
[PROOF STEP]
have "... \<le> (\<Sum>i<N. abs(u 1 ((T^^i)x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<r. \<bar>u 1 ((T ^^ i) x)\<bar>) \<le> (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>)
[PROOF STEP]
apply (rule sum_mono2)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. finite {..<N}
 2. {..<r} \<subseteq> {..<N}
 3. \<And>b. b \<in> {..<N} - {..<r} \<Longrightarrow> 0 \<le> \<bar>u 1 ((T ^^ b) x)\<bar>
[PROOF STEP]
using \<open>r<N\<close>
[PROOF STATE]
proof (prove)
using this:
r < N

goal (3 subgoals):
 1. finite {..<N}
 2. {..<r} \<subseteq> {..<N}
 3. \<And>b. b \<in> {..<N} - {..<r} \<Longrightarrow> 0 \<le> \<bar>u 1 ((T ^^ b) x)\<bar>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i<r. \<bar>u 1 ((T ^^ i) x)\<bar>) \<le> (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>)

goal (1 subgoal):
 1. r \<noteq> 0 \<Longrightarrow> u (a * N + r) x \<le> (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
u r x \<le> (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
u r x \<le> (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>)

goal (1 subgoal):
 1. u (a * N + r) x \<le> (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))
[PROOF STEP]
using I
[PROOF STATE]
proof (prove)
using this:
u r x \<le> (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>)
u (a * N + r) x \<le> u r x + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))

goal (1 subgoal):
 1. u (a * N + r) x \<le> (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u (a * N + r) x \<le> (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
u (a * N + r) x \<le> (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u (a * N + r) x \<le> (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))
[PROOF STEP]
have "u n x \<le> E1 + (\<Sum>i<a. u N ((T^^(i*N+r))x)) + E2"
[PROOF STATE]
proof (prove)
using this:
u (a * N + r) x \<le> (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))

goal (1 subgoal):
 1. u n x \<le> E1 + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x)) + E2
[PROOF STEP]
unfolding E1_def
[PROOF STATE]
proof (prove)
using this:
u (a * N + r) x \<le> (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))

goal (1 subgoal):
 1. u n x \<le> (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x)) + E2
[PROOF STEP]
using B
[PROOF STATE]
proof (prove)
using this:
u (a * N + r) x \<le> (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))
u n x \<le> u (a * N + r) x + E2

goal (1 subgoal):
 1. u n x \<le> (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x)) + E2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u n x \<le> E1 + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x)) + E2

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?r5 < N \<Longrightarrow> u n x \<le> E1 + (\<Sum>i<a. u N ((T ^^ (i * N + ?r5)) x)) + E2

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
note * = this
[PROOF STATE]
proof (state)
this:
?r5 < N \<Longrightarrow> u n x \<le> E1 + (\<Sum>i<a. u N ((T ^^ (i * N + ?r5)) x)) + E2

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
have I: "u N ((T^^j) x) \<le> E2" if "j\<in>{n-2*N..<a*N}" for j
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u N ((T ^^ j) x) \<le> E2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. u N ((T ^^ j) x) \<le> E2
[PROOF STEP]
have "u N ((T^^j) x) \<le> (\<Sum>i<N. u 1 ((T^^i) ((T^^j)x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u N ((T ^^ j) x) \<le> (\<Sum>i<N. u 1 ((T ^^ i) ((T ^^ j) x)))
[PROOF STEP]
using subcocycle_bounded_by_birkhoff1[OF assms(1) \<open>N>0\<close>]
[PROOF STATE]
proof (prove)
using this:
u N ?x \<le> birkhoff_sum (u 1) N ?x

goal (1 subgoal):
 1. u N ((T ^^ j) x) \<le> (\<Sum>i<N. u 1 ((T ^^ i) ((T ^^ j) x)))
[PROOF STEP]
unfolding birkhoff_sum_def
[PROOF STATE]
proof (prove)
using this:
u N ?x \<le> (\<Sum>i<N. u 1 ((T ^^ i) ?x))

goal (1 subgoal):
 1. u N ((T ^^ j) x) \<le> (\<Sum>i<N. u 1 ((T ^^ i) ((T ^^ j) x)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u N ((T ^^ j) x) \<le> (\<Sum>i<N. u 1 ((T ^^ i) ((T ^^ j) x)))

goal (1 subgoal):
 1. u N ((T ^^ j) x) \<le> E2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
u N ((T ^^ j) x) \<le> (\<Sum>i<N. u 1 ((T ^^ i) ((T ^^ j) x)))

goal (1 subgoal):
 1. u N ((T ^^ j) x) \<le> E2
[PROOF STEP]
have "... = (\<Sum>i<N. u 1 ((T^^(i+j))x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<N. u 1 ((T ^^ i) ((T ^^ j) x))) = (\<Sum>i<N. u 1 ((T ^^ (i + j)) x))
[PROOF STEP]
by (simp add: funpow_add)
[PROOF STATE]
proof (state)
this:
(\<Sum>i<N. u 1 ((T ^^ i) ((T ^^ j) x))) = (\<Sum>i<N. u 1 ((T ^^ (i + j)) x))

goal (1 subgoal):
 1. u N ((T ^^ j) x) \<le> E2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i<N. u 1 ((T ^^ i) ((T ^^ j) x))) = (\<Sum>i<N. u 1 ((T ^^ (i + j)) x))

goal (1 subgoal):
 1. u N ((T ^^ j) x) \<le> E2
[PROOF STEP]
have "... \<le> (\<Sum>i<N. abs(u 1 ((T^^(i+j))x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<N. u 1 ((T ^^ (i + j)) x)) \<le> (\<Sum>i<N. \<bar>u 1 ((T ^^ (i + j)) x)\<bar>)
[PROOF STEP]
by (rule sum_mono, auto)
[PROOF STATE]
proof (state)
this:
(\<Sum>i<N. u 1 ((T ^^ (i + j)) x)) \<le> (\<Sum>i<N. \<bar>u 1 ((T ^^ (i + j)) x)\<bar>)

goal (1 subgoal):
 1. u N ((T ^^ j) x) \<le> E2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i<N. u 1 ((T ^^ (i + j)) x)) \<le> (\<Sum>i<N. \<bar>u 1 ((T ^^ (i + j)) x)\<bar>)

goal (1 subgoal):
 1. u N ((T ^^ j) x) \<le> E2
[PROOF STEP]
have "... = (\<Sum>k\<in>{j..<N+j}. abs(u 1 ((T^^k)x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<N. \<bar>u 1 ((T ^^ (i + j)) x)\<bar>) = (\<Sum>k = j..<N + j. \<bar>u 1 ((T ^^ k) x)\<bar>)
[PROOF STEP]
by (rule sum.reindex_bij_betw, rule bij_betw_byWitness[where ?f' = "\<lambda>k. k-j"], auto)
[PROOF STATE]
proof (state)
this:
(\<Sum>i<N. \<bar>u 1 ((T ^^ (i + j)) x)\<bar>) = (\<Sum>k = j..<N + j. \<bar>u 1 ((T ^^ k) x)\<bar>)

goal (1 subgoal):
 1. u N ((T ^^ j) x) \<le> E2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i<N. \<bar>u 1 ((T ^^ (i + j)) x)\<bar>) = (\<Sum>k = j..<N + j. \<bar>u 1 ((T ^^ k) x)\<bar>)

goal (1 subgoal):
 1. u N ((T ^^ j) x) \<le> E2
[PROOF STEP]
have "... \<le> (\<Sum>i\<in>{n-2*N..<n}. abs(u 1 ((T^^i) x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = j..<N + j. \<bar>u 1 ((T ^^ k) x)\<bar>) \<le> (\<Sum>i = n - 2 * N..<n. \<bar>u 1 ((T ^^ i) x)\<bar>)
[PROOF STEP]
apply (rule sum_mono2)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. finite {n - 2 * N..<n}
 2. {j..<N + j} \<subseteq> {n - 2 * N..<n}
 3. \<And>b. b \<in> {n - 2 * N..<n} - {j..<N + j} \<Longrightarrow> 0 \<le> \<bar>u 1 ((T ^^ b) x)\<bar>
[PROOF STEP]
using \<open>j\<in>{n-2*N..<a*N}\<close> \<open>a*N \<le> n - N\<close>
[PROOF STATE]
proof (prove)
using this:
j \<in> {n - 2 * N..<a * N}
a * N \<le> n - N

goal (3 subgoals):
 1. finite {n - 2 * N..<n}
 2. {j..<N + j} \<subseteq> {n - 2 * N..<n}
 3. \<And>b. b \<in> {n - 2 * N..<n} - {j..<N + j} \<Longrightarrow> 0 \<le> \<bar>u 1 ((T ^^ b) x)\<bar>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>k = j..<N + j. \<bar>u 1 ((T ^^ k) x)\<bar>) \<le> (\<Sum>i = n - 2 * N..<n. \<bar>u 1 ((T ^^ i) x)\<bar>)

goal (1 subgoal):
 1. u N ((T ^^ j) x) \<le> E2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k = j..<N + j. \<bar>u 1 ((T ^^ k) x)\<bar>) \<le> (\<Sum>i = n - 2 * N..<n. \<bar>u 1 ((T ^^ i) x)\<bar>)

goal (1 subgoal):
 1. u N ((T ^^ j) x) \<le> E2
[PROOF STEP]
have "... = E2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = n - 2 * N..<n. \<bar>u 1 ((T ^^ i) x)\<bar>) = E2
[PROOF STEP]
unfolding E2_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = n - 2 * N..<n. \<bar>u 1 ((T ^^ i) x)\<bar>) = (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
apply (rule sum.reindex_bij_betw[symmetric], rule bij_betw_byWitness[where ?f' = "\<lambda>i. i - (n-2*N)"])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<forall>a\<in>{..<2 * N}. n - (2 * N - a) - (n - 2 * N) = a
 2. \<forall>a'\<in>{n - 2 * N..<n}. n - (2 * N - (a' - (n - 2 * N))) = a'
 3. (\<lambda>x. n - (2 * N - x)) ` {..<2 * N} \<subseteq> {n - 2 * N..<n}
 4. (\<lambda>i. i - (n - 2 * N)) ` {n - 2 * N..<n} \<subseteq> {..<2 * N}
[PROOF STEP]
using \<open>n > 2*N\<close>
[PROOF STATE]
proof (prove)
using this:
2 * N < n

goal (4 subgoals):
 1. \<forall>a\<in>{..<2 * N}. n - (2 * N - a) - (n - 2 * N) = a
 2. \<forall>a'\<in>{n - 2 * N..<n}. n - (2 * N - (a' - (n - 2 * N))) = a'
 3. (\<lambda>x. n - (2 * N - x)) ` {..<2 * N} \<subseteq> {n - 2 * N..<n}
 4. (\<lambda>i. i - (n - 2 * N)) ` {n - 2 * N..<n} \<subseteq> {..<2 * N}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i = n - 2 * N..<n. \<bar>u 1 ((T ^^ i) x)\<bar>) = E2

goal (1 subgoal):
 1. u N ((T ^^ j) x) \<le> E2
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
u N ((T ^^ j) x) \<le> E2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
u N ((T ^^ j) x) \<le> E2

goal (1 subgoal):
 1. u N ((T ^^ j) x) \<le> E2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u N ((T ^^ j) x) \<le> E2

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?j3 \<in> {n - 2 * N..<a * N} \<Longrightarrow> u N ((T ^^ ?j3) x) \<le> E2

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
have "(\<Sum>j<a*N. u N ((T^^j) x)) - (\<Sum>j<n-2*N. u N ((T^^j) x)) = (\<Sum>j\<in>{n-2*N..<a*N}. u N ((T^^j) x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j<a * N. u N ((T ^^ j) x)) - (\<Sum>j<n - 2 * N. u N ((T ^^ j) x)) = (\<Sum>j = n - 2 * N..<a * N. u N ((T ^^ j) x))
[PROOF STEP]
using sum.atLeastLessThan_concat[OF _ \<open>a*N \<ge> n - 2*N\<close>, of 0 "\<lambda>j. u N ((T^^j) x)", symmetric] atLeast0LessThan
[PROOF STATE]
proof (prove)
using this:
0 \<le> n - 2 * N \<Longrightarrow> (\<Sum>j = 0..<a * N. u N ((T ^^ j) x)) = (\<Sum>j = 0..<n - 2 * N. u N ((T ^^ j) x)) + (\<Sum>j = n - 2 * N..<a * N. u N ((T ^^ j) x))
{0..<?n} = {..<?n}

goal (1 subgoal):
 1. (\<Sum>j<a * N. u N ((T ^^ j) x)) - (\<Sum>j<n - 2 * N. u N ((T ^^ j) x)) = (\<Sum>j = n - 2 * N..<a * N. u N ((T ^^ j) x))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>j<a * N. u N ((T ^^ j) x)) - (\<Sum>j<n - 2 * N. u N ((T ^^ j) x)) = (\<Sum>j = n - 2 * N..<a * N. u N ((T ^^ j) x))

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>j<a * N. u N ((T ^^ j) x)) - (\<Sum>j<n - 2 * N. u N ((T ^^ j) x)) = (\<Sum>j = n - 2 * N..<a * N. u N ((T ^^ j) x))

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
have "... \<le> (\<Sum>j\<in>{n-2*N..<a*N}. E2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j = n - 2 * N..<a * N. u N ((T ^^ j) x)) \<le> (\<Sum>j = n - 2 * N..<a * N. E2)
[PROOF STEP]
by (rule sum_mono[OF I])
[PROOF STATE]
proof (state)
this:
(\<Sum>j = n - 2 * N..<a * N. u N ((T ^^ j) x)) \<le> (\<Sum>j = n - 2 * N..<a * N. E2)

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>j = n - 2 * N..<a * N. u N ((T ^^ j) x)) \<le> (\<Sum>j = n - 2 * N..<a * N. E2)

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
have "... = (a*N - (n-2*N)) * E2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j = n - 2 * N..<a * N. E2) = real (a * N - (n - 2 * N)) * E2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>j = n - 2 * N..<a * N. E2) = real (a * N - (n - 2 * N)) * E2

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>j = n - 2 * N..<a * N. E2) = real (a * N - (n - 2 * N)) * E2

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
have "... \<le> N * E2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (a * N - (n - 2 * N)) * E2 \<le> real N * E2
[PROOF STEP]
using \<open>(a*N - (n-2*N)) \<le> N\<close> \<open>E2 \<ge> 0\<close>
[PROOF STATE]
proof (prove)
using this:
a * N - (n - 2 * N) \<le> N
0 \<le> E2

goal (1 subgoal):
 1. real (a * N - (n - 2 * N)) * E2 \<le> real N * E2
[PROOF STEP]
by (simp add: mult_right_mono)
[PROOF STATE]
proof (state)
this:
real (a * N - (n - 2 * N)) * E2 \<le> real N * E2

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>j<a * N. u N ((T ^^ j) x)) - (\<Sum>j<n - 2 * N. u N ((T ^^ j) x)) \<le> real N * E2
[PROOF STEP]
have J: "(\<Sum>j<a*N. u N ((T^^j) x)) \<le> (\<Sum>j<n-2*N. u N ((T^^j) x)) + N * E2"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>j<a * N. u N ((T ^^ j) x)) - (\<Sum>j<n - 2 * N. u N ((T ^^ j) x)) \<le> real N * E2

goal (1 subgoal):
 1. (\<Sum>j<a * N. u N ((T ^^ j) x)) \<le> (\<Sum>j<n - 2 * N. u N ((T ^^ j) x)) + real N * E2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>j<a * N. u N ((T ^^ j) x)) \<le> (\<Sum>j<n - 2 * N. u N ((T ^^ j) x)) + real N * E2

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
have "N * u n x = (\<Sum>r<N. u n x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real N * u n x = (\<Sum>r<N. u n x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real N * u n x = (\<Sum>r<N. u n x)

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real N * u n x = (\<Sum>r<N. u n x)

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
have "... \<le> (\<Sum>r<N. E1 + E2 + (\<Sum>i<a. u N ((T^^(i*N+r))x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>r<N. u n x) \<le> (\<Sum>r<N. E1 + E2 + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x)))
[PROOF STEP]
apply (rule sum_mono)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>r. r \<in> {..<N} \<Longrightarrow> u n x \<le> E1 + E2 + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
?r5 < N \<Longrightarrow> u n x \<le> E1 + (\<Sum>i<a. u N ((T ^^ (i * N + ?r5)) x)) + E2

goal (1 subgoal):
 1. \<And>r. r \<in> {..<N} \<Longrightarrow> u n x \<le> E1 + E2 + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(\<Sum>r<N. u n x) \<le> (\<Sum>r<N. E1 + E2 + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x)))

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>r<N. u n x) \<le> (\<Sum>r<N. E1 + E2 + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x)))

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
have "... = (\<Sum>r<N. E1 + E2) + (\<Sum>r<N. (\<Sum>i<a. u N ((T^^(i*N+r))x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>r<N. E1 + E2 + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))) = (\<Sum>r<N. E1 + E2) + (\<Sum>r<N. \<Sum>i<a. u N ((T ^^ (i * N + r)) x))
[PROOF STEP]
by (rule sum.distrib)
[PROOF STATE]
proof (state)
this:
(\<Sum>r<N. E1 + E2 + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))) = (\<Sum>r<N. E1 + E2) + (\<Sum>r<N. \<Sum>i<a. u N ((T ^^ (i * N + r)) x))

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>r<N. E1 + E2 + (\<Sum>i<a. u N ((T ^^ (i * N + r)) x))) = (\<Sum>r<N. E1 + E2) + (\<Sum>r<N. \<Sum>i<a. u N ((T ^^ (i * N + r)) x))

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
have "... = N* (E1 + E2) + (\<Sum>j<a*N. u N ((T^^j) x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>r<N. E1 + E2) + (\<Sum>r<N. \<Sum>i<a. u N ((T ^^ (i * N + r)) x)) = real N * (E1 + E2) + (\<Sum>j<a * N. u N ((T ^^ j) x))
[PROOF STEP]
using sum_arith_progression
[PROOF STATE]
proof (prove)
using this:
(\<Sum>r<?N. \<Sum>i<?a. ?f (i * ?N + r)) = sum ?f {..<?a * ?N}

goal (1 subgoal):
 1. (\<Sum>r<N. E1 + E2) + (\<Sum>r<N. \<Sum>i<a. u N ((T ^^ (i * N + r)) x)) = real N * (E1 + E2) + (\<Sum>j<a * N. u N ((T ^^ j) x))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>r<N. E1 + E2) + (\<Sum>r<N. \<Sum>i<a. u N ((T ^^ (i * N + r)) x)) = real N * (E1 + E2) + (\<Sum>j<a * N. u N ((T ^^ j) x))

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>r<N. E1 + E2) + (\<Sum>r<N. \<Sum>i<a. u N ((T ^^ (i * N + r)) x)) = real N * (E1 + E2) + (\<Sum>j<a * N. u N ((T ^^ j) x))

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
have "... \<le> N *(E1+E2) + (\<Sum>j<n-2*N. u N ((T^^j) x)) + N*E2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real N * (E1 + E2) + (\<Sum>j<a * N. u N ((T ^^ j) x)) \<le> real N * (E1 + E2) + (\<Sum>j<n - 2 * N. u N ((T ^^ j) x)) + real N * E2
[PROOF STEP]
using J
[PROOF STATE]
proof (prove)
using this:
(\<Sum>j<a * N. u N ((T ^^ j) x)) \<le> (\<Sum>j<n - 2 * N. u N ((T ^^ j) x)) + real N * E2

goal (1 subgoal):
 1. real N * (E1 + E2) + (\<Sum>j<a * N. u N ((T ^^ j) x)) \<le> real N * (E1 + E2) + (\<Sum>j<n - 2 * N. u N ((T ^^ j) x)) + real N * E2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real N * (E1 + E2) + (\<Sum>j<a * N. u N ((T ^^ j) x)) \<le> real N * (E1 + E2) + (\<Sum>j<n - 2 * N. u N ((T ^^ j) x)) + real N * E2

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real N * (E1 + E2) + (\<Sum>j<a * N. u N ((T ^^ j) x)) \<le> real N * (E1 + E2) + (\<Sum>j<n - 2 * N. u N ((T ^^ j) x)) + real N * E2

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
have "... = N * (E1+E2) + N * (\<Sum>j<n-2*N. u N ((T^^j) x) / N) + N * E2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real N * (E1 + E2) + (\<Sum>j<n - 2 * N. u N ((T ^^ j) x)) + real N * E2 = real N * (E1 + E2) + real N * (\<Sum>j<n - 2 * N. u N ((T ^^ j) x) / real N) + real N * E2
[PROOF STEP]
using \<open>N>0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < N

goal (1 subgoal):
 1. real N * (E1 + E2) + (\<Sum>j<n - 2 * N. u N ((T ^^ j) x)) + real N * E2 = real N * (E1 + E2) + real N * (\<Sum>j<n - 2 * N. u N ((T ^^ j) x) / real N) + real N * E2
[PROOF STEP]
by (simp add: sum_distrib_left)
[PROOF STATE]
proof (state)
this:
real N * (E1 + E2) + (\<Sum>j<n - 2 * N. u N ((T ^^ j) x)) + real N * E2 = real N * (E1 + E2) + real N * (\<Sum>j<n - 2 * N. u N ((T ^^ j) x) / real N) + real N * E2

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real N * (E1 + E2) + (\<Sum>j<n - 2 * N. u N ((T ^^ j) x)) + real N * E2 = real N * (E1 + E2) + real N * (\<Sum>j<n - 2 * N. u N ((T ^^ j) x) / real N) + real N * E2

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
have "... = N*(E1 + E2 + (\<Sum>j<n-2*N. u N ((T^^j) x) / N) + E2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real N * (E1 + E2) + real N * (\<Sum>j<n - 2 * N. u N ((T ^^ j) x) / real N) + real N * E2 = real N * (E1 + E2 + (\<Sum>j<n - 2 * N. u N ((T ^^ j) x) / real N) + E2)
[PROOF STEP]
by (simp add: distrib_left)
[PROOF STATE]
proof (state)
this:
real N * (E1 + E2) + real N * (\<Sum>j<n - 2 * N. u N ((T ^^ j) x) / real N) + real N * E2 = real N * (E1 + E2 + (\<Sum>j<n - 2 * N. u N ((T ^^ j) x) / real N) + E2)

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
real N * u n x \<le> real N * (E1 + E2 + (\<Sum>j<n - 2 * N. u N ((T ^^ j) x) / real N) + E2)
[PROOF STEP]
have "u n x \<le> E1 + 2*E2 + birkhoff_sum (\<lambda>x. u N x / N) (n-2*N) x"
[PROOF STATE]
proof (prove)
using this:
real N * u n x \<le> real N * (E1 + E2 + (\<Sum>j<n - 2 * N. u N ((T ^^ j) x) / real N) + E2)

goal (1 subgoal):
 1. u n x \<le> E1 + 2 * E2 + birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x
[PROOF STEP]
unfolding birkhoff_sum_def
[PROOF STATE]
proof (prove)
using this:
real N * u n x \<le> real N * (E1 + E2 + (\<Sum>j<n - 2 * N. u N ((T ^^ j) x) / real N) + E2)

goal (1 subgoal):
 1. u n x \<le> E1 + 2 * E2 + (\<Sum>i<n - 2 * N. u N ((T ^^ i) x) / real N)
[PROOF STEP]
using \<open>N>0\<close>
[PROOF STATE]
proof (prove)
using this:
real N * u n x \<le> real N * (E1 + E2 + (\<Sum>j<n - 2 * N. u N ((T ^^ j) x) / real N) + E2)
0 < N

goal (1 subgoal):
 1. u n x \<le> E1 + 2 * E2 + (\<Sum>i<n - 2 * N. u N ((T ^^ i) x) / real N)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u n x \<le> E1 + 2 * E2 + birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u n x \<le> E1 + 2 * E2 + birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
u n x \<le> E1 + 2 * E2 + birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
unfolding E1_def E2_def
[PROOF STATE]
proof (prove)
using this:
u n x \<le> (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>) + birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x

goal (1 subgoal):
 1. u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u n x \<le> birkhoff_sum (\<lambda>x. u N x / real N) (n - 2 * N) x + (\<Sum>i<N. \<bar>u 1 ((T ^^ i) x)\<bar>) + 2 * (\<Sum>i<2 * N. \<bar>u 1 ((T ^^ (n - (2 * N - i))) x)\<bar>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in domain) freshmans_dream_ext:
  fixes m
  assumes "char R > 0"
  assumes [simp]: "x \<in> carrier R" "y \<in> carrier R"
  defines "n \<equiv> char R^m"
  shows "(x \<oplus> y) [^] n = x [^] n \<oplus> y [^] n"
    (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<oplus> y) [^] n = x [^] n \<oplus> y [^] n
[PROOF STEP]
unfolding n_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<oplus> y) [^] char R ^ m = x [^] char R ^ m \<oplus> y [^] char R ^ m
[PROOF STEP]
proof (induction m)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (x \<oplus> y) [^] char R ^ 0 = x [^] char R ^ 0 \<oplus> y [^] char R ^ 0
 2. \<And>m. (x \<oplus> y) [^] char R ^ m = x [^] char R ^ m \<oplus> y [^] char R ^ m \<Longrightarrow> (x \<oplus> y) [^] char R ^ Suc m = x [^] char R ^ Suc m \<oplus> y [^] char R ^ Suc m
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. (x \<oplus> y) [^] char R ^ 0 = x [^] char R ^ 0 \<oplus> y [^] char R ^ 0
 2. \<And>m. (x \<oplus> y) [^] char R ^ m = x [^] char R ^ m \<oplus> y [^] char R ^ m \<Longrightarrow> (x \<oplus> y) [^] char R ^ Suc m = x [^] char R ^ Suc m \<oplus> y [^] char R ^ Suc m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<oplus> y) [^] char R ^ 0 = x [^] char R ^ 0 \<oplus> y [^] char R ^ 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(x \<oplus> y) [^] char R ^ 0 = x [^] char R ^ 0 \<oplus> y [^] char R ^ 0

goal (1 subgoal):
 1. \<And>m. (x \<oplus> y) [^] char R ^ m = x [^] char R ^ m \<oplus> y [^] char R ^ m \<Longrightarrow> (x \<oplus> y) [^] char R ^ Suc m = x [^] char R ^ Suc m \<oplus> y [^] char R ^ Suc m
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m. (x \<oplus> y) [^] char R ^ m = x [^] char R ^ m \<oplus> y [^] char R ^ m \<Longrightarrow> (x \<oplus> y) [^] char R ^ Suc m = x [^] char R ^ Suc m \<oplus> y [^] char R ^ Suc m
[PROOF STEP]
case (Suc m)
[PROOF STATE]
proof (state)
this:
(x \<oplus> y) [^] char R ^ m = x [^] char R ^ m \<oplus> y [^] char R ^ m

goal (1 subgoal):
 1. \<And>m. (x \<oplus> y) [^] char R ^ m = x [^] char R ^ m \<oplus> y [^] char R ^ m \<Longrightarrow> (x \<oplus> y) [^] char R ^ Suc m = x [^] char R ^ Suc m \<oplus> y [^] char R ^ Suc m
[PROOF STEP]
have "(x \<oplus> y) [^] (char R^(m+1)) =
    (x \<oplus> y) [^] (char R^m * char R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<oplus> y) [^] char R ^ (m + 1) = (x \<oplus> y) [^] (char R ^ m * char R)
[PROOF STEP]
by (simp add:mult.commute)
[PROOF STATE]
proof (state)
this:
(x \<oplus> y) [^] char R ^ (m + 1) = (x \<oplus> y) [^] (char R ^ m * char R)

goal (1 subgoal):
 1. \<And>m. (x \<oplus> y) [^] char R ^ m = x [^] char R ^ m \<oplus> y [^] char R ^ m \<Longrightarrow> (x \<oplus> y) [^] char R ^ Suc m = x [^] char R ^ Suc m \<oplus> y [^] char R ^ Suc m
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(x \<oplus> y) [^] char R ^ (m + 1) = (x \<oplus> y) [^] (char R ^ m * char R)

goal (1 subgoal):
 1. \<And>m. (x \<oplus> y) [^] char R ^ m = x [^] char R ^ m \<oplus> y [^] char R ^ m \<Longrightarrow> (x \<oplus> y) [^] char R ^ Suc m = x [^] char R ^ Suc m \<oplus> y [^] char R ^ Suc m
[PROOF STEP]
have "... = ((x \<oplus> y) [^] (char R^m)) [^] char R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<oplus> y) [^] (char R ^ m * char R) = ((x \<oplus> y) [^] char R ^ m) [^] char R
[PROOF STEP]
using nat_pow_pow
[PROOF STATE]
proof (prove)
using this:
?x \<in> carrier R \<Longrightarrow> (?x [^] ?n) [^] ?m = ?x [^] (?n * ?m)

goal (1 subgoal):
 1. (x \<oplus> y) [^] (char R ^ m * char R) = ((x \<oplus> y) [^] char R ^ m) [^] char R
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(x \<oplus> y) [^] (char R ^ m * char R) = ((x \<oplus> y) [^] char R ^ m) [^] char R

goal (1 subgoal):
 1. \<And>m. (x \<oplus> y) [^] char R ^ m = x [^] char R ^ m \<oplus> y [^] char R ^ m \<Longrightarrow> (x \<oplus> y) [^] char R ^ Suc m = x [^] char R ^ Suc m \<oplus> y [^] char R ^ Suc m
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(x \<oplus> y) [^] (char R ^ m * char R) = ((x \<oplus> y) [^] char R ^ m) [^] char R

goal (1 subgoal):
 1. \<And>m. (x \<oplus> y) [^] char R ^ m = x [^] char R ^ m \<oplus> y [^] char R ^ m \<Longrightarrow> (x \<oplus> y) [^] char R ^ Suc m = x [^] char R ^ Suc m \<oplus> y [^] char R ^ Suc m
[PROOF STEP]
have "... = (x [^] (char R^m) \<oplus> y [^] (char R^m)) [^] char R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((x \<oplus> y) [^] char R ^ m) [^] char R = (x [^] char R ^ m \<oplus> y [^] char R ^ m) [^] char R
[PROOF STEP]
by (subst Suc, simp)
[PROOF STATE]
proof (state)
this:
((x \<oplus> y) [^] char R ^ m) [^] char R = (x [^] char R ^ m \<oplus> y [^] char R ^ m) [^] char R

goal (1 subgoal):
 1. \<And>m. (x \<oplus> y) [^] char R ^ m = x [^] char R ^ m \<oplus> y [^] char R ^ m \<Longrightarrow> (x \<oplus> y) [^] char R ^ Suc m = x [^] char R ^ Suc m \<oplus> y [^] char R ^ Suc m
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((x \<oplus> y) [^] char R ^ m) [^] char R = (x [^] char R ^ m \<oplus> y [^] char R ^ m) [^] char R

goal (1 subgoal):
 1. \<And>m. (x \<oplus> y) [^] char R ^ m = x [^] char R ^ m \<oplus> y [^] char R ^ m \<Longrightarrow> (x \<oplus> y) [^] char R ^ Suc m = x [^] char R ^ Suc m \<oplus> y [^] char R ^ Suc m
[PROOF STEP]
have "... =
    (x [^] (char R^m)) [^] char R \<oplus> (y [^] (char R^m)) [^] char R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x [^] char R ^ m \<oplus> y [^] char R ^ m) [^] char R = (x [^] char R ^ m) [^] char R \<oplus> (y [^] char R ^ m) [^] char R
[PROOF STEP]
by (subst freshmans_dream[OF assms(1), symmetric], simp_all)
[PROOF STATE]
proof (state)
this:
(x [^] char R ^ m \<oplus> y [^] char R ^ m) [^] char R = (x [^] char R ^ m) [^] char R \<oplus> (y [^] char R ^ m) [^] char R

goal (1 subgoal):
 1. \<And>m. (x \<oplus> y) [^] char R ^ m = x [^] char R ^ m \<oplus> y [^] char R ^ m \<Longrightarrow> (x \<oplus> y) [^] char R ^ Suc m = x [^] char R ^ Suc m \<oplus> y [^] char R ^ Suc m
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(x [^] char R ^ m \<oplus> y [^] char R ^ m) [^] char R = (x [^] char R ^ m) [^] char R \<oplus> (y [^] char R ^ m) [^] char R

goal (1 subgoal):
 1. \<And>m. (x \<oplus> y) [^] char R ^ m = x [^] char R ^ m \<oplus> y [^] char R ^ m \<Longrightarrow> (x \<oplus> y) [^] char R ^ Suc m = x [^] char R ^ Suc m \<oplus> y [^] char R ^ Suc m
[PROOF STEP]
have "... =
    x [^] (char R^m * char R) \<oplus> y [^] (char R^m * char R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x [^] char R ^ m) [^] char R \<oplus> (y [^] char R ^ m) [^] char R = x [^] (char R ^ m * char R) \<oplus> y [^] (char R ^ m * char R)
[PROOF STEP]
by (simp add:nat_pow_pow)
[PROOF STATE]
proof (state)
this:
(x [^] char R ^ m) [^] char R \<oplus> (y [^] char R ^ m) [^] char R = x [^] (char R ^ m * char R) \<oplus> y [^] (char R ^ m * char R)

goal (1 subgoal):
 1. \<And>m. (x \<oplus> y) [^] char R ^ m = x [^] char R ^ m \<oplus> y [^] char R ^ m \<Longrightarrow> (x \<oplus> y) [^] char R ^ Suc m = x [^] char R ^ Suc m \<oplus> y [^] char R ^ Suc m
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(x [^] char R ^ m) [^] char R \<oplus> (y [^] char R ^ m) [^] char R = x [^] (char R ^ m * char R) \<oplus> y [^] (char R ^ m * char R)

goal (1 subgoal):
 1. \<And>m. (x \<oplus> y) [^] char R ^ m = x [^] char R ^ m \<oplus> y [^] char R ^ m \<Longrightarrow> (x \<oplus> y) [^] char R ^ Suc m = x [^] char R ^ Suc m \<oplus> y [^] char R ^ Suc m
[PROOF STEP]
have "... = x [^] (char R^Suc m) \<oplus> y [^] (char R^Suc m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x [^] (char R ^ m * char R) \<oplus> y [^] (char R ^ m * char R) = x [^] char R ^ Suc m \<oplus> y [^] char R ^ Suc m
[PROOF STEP]
by (simp add:mult.commute)
[PROOF STATE]
proof (state)
this:
x [^] (char R ^ m * char R) \<oplus> y [^] (char R ^ m * char R) = x [^] char R ^ Suc m \<oplus> y [^] char R ^ Suc m

goal (1 subgoal):
 1. \<And>m. (x \<oplus> y) [^] char R ^ m = x [^] char R ^ m \<oplus> y [^] char R ^ m \<Longrightarrow> (x \<oplus> y) [^] char R ^ Suc m = x [^] char R ^ Suc m \<oplus> y [^] char R ^ Suc m
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(x \<oplus> y) [^] char R ^ (m + 1) = x [^] char R ^ Suc m \<oplus> y [^] char R ^ Suc m
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(x \<oplus> y) [^] char R ^ (m + 1) = x [^] char R ^ Suc m \<oplus> y [^] char R ^ Suc m

goal (1 subgoal):
 1. (x \<oplus> y) [^] char R ^ Suc m = x [^] char R ^ Suc m \<oplus> y [^] char R ^ Suc m
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(x \<oplus> y) [^] char R ^ Suc m = x [^] char R ^ Suc m \<oplus> y [^] char R ^ Suc m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma completely_specified_states :
  "completely_specified M = (\<forall> q \<in> states M . completely_specified_state M q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. completely_specified M = (\<forall>q\<in>FSM.states M. completely_specified_state M q)
[PROOF STEP]
unfolding completely_specified.simps completely_specified_state.simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>q\<in>FSM.states M. \<forall>x\<in>FSM.inputs M. \<exists>t\<in>FSM.transitions M. t_source t = q \<and> t_input t = x) = (\<forall>q\<in>FSM.states M. \<forall>x\<in>FSM.inputs M. \<exists>t\<in>FSM.transitions M. t_source t = q \<and> t_input t = x)
[PROOF STEP]
by force


[STATEMENT]
lemma tt_monomial:
  assumes "c \<noteq> 0"
  shows "tt (monomial c v) = v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tt (monomial c v) = v
[PROOF STEP]
proof (rule tt_eqI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. v \<in> keys (monomial c v)
 2. \<And>u. u \<in> keys (monomial c v) \<Longrightarrow> v \<preceq>\<^sub>t u
[PROOF STEP]
from keys_of_monomial[OF assms, of v]
[PROOF STATE]
proof (chain)
picking this:
keys (monomial c v) = {v}
[PROOF STEP]
show "v \<in> keys (monomial c v)"
[PROOF STATE]
proof (prove)
using this:
keys (monomial c v) = {v}

goal (1 subgoal):
 1. v \<in> keys (monomial c v)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
v \<in> keys (monomial c v)

goal (1 subgoal):
 1. \<And>u. u \<in> keys (monomial c v) \<Longrightarrow> v \<preceq>\<^sub>t u
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>u. u \<in> keys (monomial c v) \<Longrightarrow> v \<preceq>\<^sub>t u
[PROOF STEP]
fix u
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>u. u \<in> keys (monomial c v) \<Longrightarrow> v \<preceq>\<^sub>t u
[PROOF STEP]
assume "u \<in> keys (monomial c v)"
[PROOF STATE]
proof (state)
this:
u \<in> keys (monomial c v)

goal (1 subgoal):
 1. \<And>u. u \<in> keys (monomial c v) \<Longrightarrow> v \<preceq>\<^sub>t u
[PROOF STEP]
with keys_of_monomial[OF assms, of v]
[PROOF STATE]
proof (chain)
picking this:
keys (monomial c v) = {v}
u \<in> keys (monomial c v)
[PROOF STEP]
have "u = v"
[PROOF STATE]
proof (prove)
using this:
keys (monomial c v) = {v}
u \<in> keys (monomial c v)

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

goal (1 subgoal):
 1. \<And>u. u \<in> keys (monomial c v) \<Longrightarrow> v \<preceq>\<^sub>t u
[PROOF STEP]
thus "v \<preceq>\<^sub>t u"
[PROOF STATE]
proof (prove)
using this:
u = v

goal (1 subgoal):
 1. v \<preceq>\<^sub>t u
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
v \<preceq>\<^sub>t u

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tendsto_eventually: "eventually (\<lambda>x. f x = l) net \<Longrightarrow> ((\<lambda>x. f x) \<longlongrightarrow> l) net"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in net. f x = l \<Longrightarrow> (f \<longlongrightarrow> l) net
[PROOF STEP]
by (rule topological_tendstoI) (auto elim: eventually_mono)


[STATEMENT]
lemma continuous_map_add [continuous_intros]:
  fixes f :: "'a\<Rightarrow>'b::real_normed_vector"
  shows "\<lbrakk>continuous_map X euclidean f; continuous_map X euclidean g\<rbrakk> \<Longrightarrow> continuous_map X euclidean (\<lambda>x. f x + g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>continuous_map X euclidean f; continuous_map X euclidean g\<rbrakk> \<Longrightarrow> continuous_map X euclidean (\<lambda>x. f x + g x)
[PROOF STEP]
by (simp add: continuous_map_atin tendsto_add)


[STATEMENT]
lemma interleave_length[rule_format, simp]: "ALL x : a\<otimes>b . length x = length a + length b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>a \<otimes> b. length x = length a + length b
[PROOF STEP]
apply(induct rule: interleave.induct)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>b. \<forall>x\<in>[] \<otimes> b. length x = length [] + length b
 2. \<And>a. \<forall>x\<in>a \<otimes> []. length x = length a + length []
 3. \<And>a l b r. \<lbrakk>\<forall>x\<in>l \<otimes> b # r. length x = length l + length (b # r); \<forall>x\<in>a # l \<otimes> r. length x = length (a # l) + length r\<rbrakk> \<Longrightarrow> \<forall>x\<in>a # l \<otimes> b # r. length x = length (a # l) + length (b # r)
[PROOF STEP]
apply(auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma lipschitz_cond_affine:
  fixes A :: "real \<Rightarrow> 'a::real_normed_algebra_1^'n^'m" and T::"real set"
  defines "L \<equiv> Sup {\<parallel>A t\<parallel>\<^sub>o\<^sub>p |t. t \<in> T}"
  assumes "t \<in> T" and "bdd_above {\<parallel>A t\<parallel>\<^sub>o\<^sub>p |t. t \<in> T}"
  shows "\<parallel>A t *v x - A t *v y\<parallel> \<le> L * (\<parallel>x - y\<parallel>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>A t *v x - A t *v y\<parallel> \<le> L * \<parallel>x - y\<parallel>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<parallel>A t *v x - A t *v y\<parallel> \<le> L * \<parallel>x - y\<parallel>
[PROOF STEP]
have obs: "\<parallel>A t\<parallel>\<^sub>o\<^sub>p \<le> Sup {\<parallel>A t\<parallel>\<^sub>o\<^sub>p |t. t \<in> T}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>A t\<parallel>\<^sub>o\<^sub>p \<le> Sup {\<parallel>A t\<parallel>\<^sub>o\<^sub>p |t. t \<in> T}
[PROOF STEP]
apply(rule cSup_upper)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<parallel>A t\<parallel>\<^sub>o\<^sub>p \<in> {\<parallel>A t\<parallel>\<^sub>o\<^sub>p |t. t \<in> T}
 2. bdd_above {\<parallel>A t\<parallel>\<^sub>o\<^sub>p |t. t \<in> T}
[PROOF STEP]
using continuous_on_subset assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>continuous_on ?s ?f; ?t \<subseteq> ?s\<rbrakk> \<Longrightarrow> continuous_on ?t ?f
L \<equiv> Sup {\<parallel>A t\<parallel>\<^sub>o\<^sub>p |t. t \<in> T}
t \<in> T
bdd_above {\<parallel>A t\<parallel>\<^sub>o\<^sub>p |t. t \<in> T}

goal (2 subgoals):
 1. \<parallel>A t\<parallel>\<^sub>o\<^sub>p \<in> {\<parallel>A t\<parallel>\<^sub>o\<^sub>p |t. t \<in> T}
 2. bdd_above {\<parallel>A t\<parallel>\<^sub>o\<^sub>p |t. t \<in> T}
[PROOF STEP]
by (auto simp: dist_norm)
[PROOF STATE]
proof (state)
this:
\<parallel>A t\<parallel>\<^sub>o\<^sub>p \<le> Sup {\<parallel>A t\<parallel>\<^sub>o\<^sub>p |t. t \<in> T}

goal (1 subgoal):
 1. \<parallel>A t *v x - A t *v y\<parallel> \<le> L * \<parallel>x - y\<parallel>
[PROOF STEP]
have "\<parallel>A t *v x - A t *v y\<parallel> = \<parallel>A t *v (x - y)\<parallel>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>A t *v x - A t *v y\<parallel> = \<parallel>A t *v (x - y)\<parallel>
[PROOF STEP]
by (simp add: matrix_vector_mult_diff_distrib)
[PROOF STATE]
proof (state)
this:
\<parallel>A t *v x - A t *v y\<parallel> = \<parallel>A t *v (x - y)\<parallel>

goal (1 subgoal):
 1. \<parallel>A t *v x - A t *v y\<parallel> \<le> L * \<parallel>x - y\<parallel>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<parallel>A t *v x - A t *v y\<parallel> = \<parallel>A t *v (x - y)\<parallel>

goal (1 subgoal):
 1. \<parallel>A t *v x - A t *v y\<parallel> \<le> L * \<parallel>x - y\<parallel>
[PROOF STEP]
have "... \<le> (\<parallel>A t\<parallel>\<^sub>o\<^sub>p) * (\<parallel>x - y\<parallel>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>A t *v (x - y)\<parallel> \<le> (\<parallel>A t\<parallel>\<^sub>o\<^sub>p) * \<parallel>x - y\<parallel>
[PROOF STEP]
using norm_matrix_le_mult_op_norm
[PROOF STATE]
proof (prove)
using this:
\<parallel>?A *v ?x\<parallel> \<le> (\<parallel>?A\<parallel>\<^sub>o\<^sub>p) * \<parallel>?x\<parallel>

goal (1 subgoal):
 1. \<parallel>A t *v (x - y)\<parallel> \<le> (\<parallel>A t\<parallel>\<^sub>o\<^sub>p) * \<parallel>x - y\<parallel>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<parallel>A t *v (x - y)\<parallel> \<le> (\<parallel>A t\<parallel>\<^sub>o\<^sub>p) * \<parallel>x - y\<parallel>

goal (1 subgoal):
 1. \<parallel>A t *v x - A t *v y\<parallel> \<le> L * \<parallel>x - y\<parallel>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<parallel>A t *v (x - y)\<parallel> \<le> (\<parallel>A t\<parallel>\<^sub>o\<^sub>p) * \<parallel>x - y\<parallel>

goal (1 subgoal):
 1. \<parallel>A t *v x - A t *v y\<parallel> \<le> L * \<parallel>x - y\<parallel>
[PROOF STEP]
have "... \<le> Sup {\<parallel>A t\<parallel>\<^sub>o\<^sub>p |t. t \<in> T} * (\<parallel>x - y\<parallel>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<parallel>A t\<parallel>\<^sub>o\<^sub>p) * \<parallel>x - y\<parallel> \<le> Sup {\<parallel>A t\<parallel>\<^sub>o\<^sub>p |t. t \<in> T} * \<parallel>x - y\<parallel>
[PROOF STEP]
using obs mult_right_mono norm_ge_zero
[PROOF STATE]
proof (prove)
using this:
\<parallel>A t\<parallel>\<^sub>o\<^sub>p \<le> Sup {\<parallel>A t\<parallel>\<^sub>o\<^sub>p |t. t \<in> T}
\<lbrakk>?a \<le> ?b; (0::?'a) \<le> ?c\<rbrakk> \<Longrightarrow> ?a * ?c \<le> ?b * ?c
0 \<le> \<parallel>?x\<parallel>

goal (1 subgoal):
 1. (\<parallel>A t\<parallel>\<^sub>o\<^sub>p) * \<parallel>x - y\<parallel> \<le> Sup {\<parallel>A t\<parallel>\<^sub>o\<^sub>p |t. t \<in> T} * \<parallel>x - y\<parallel>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<parallel>A t\<parallel>\<^sub>o\<^sub>p) * \<parallel>x - y\<parallel> \<le> Sup {\<parallel>A t\<parallel>\<^sub>o\<^sub>p |t. t \<in> T} * \<parallel>x - y\<parallel>

goal (1 subgoal):
 1. \<parallel>A t *v x - A t *v y\<parallel> \<le> L * \<parallel>x - y\<parallel>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<parallel>A t *v x - A t *v y\<parallel> \<le> Sup {\<parallel>A t\<parallel>\<^sub>o\<^sub>p |t. t \<in> T} * \<parallel>x - y\<parallel>
[PROOF STEP]
show "\<parallel>A t *v x - A t *v y\<parallel> \<le> L * (\<parallel>x - y\<parallel>)"
[PROOF STATE]
proof (prove)
using this:
\<parallel>A t *v x - A t *v y\<parallel> \<le> Sup {\<parallel>A t\<parallel>\<^sub>o\<^sub>p |t. t \<in> T} * \<parallel>x - y\<parallel>

goal (1 subgoal):
 1. \<parallel>A t *v x - A t *v y\<parallel> \<le> L * \<parallel>x - y\<parallel>
[PROOF STEP]
unfolding assms
[PROOF STATE]
proof (prove)
using this:
\<parallel>A t *v x - A t *v y\<parallel> \<le> Sup {\<parallel>A t\<parallel>\<^sub>o\<^sub>p |t. t \<in> T} * \<parallel>x - y\<parallel>

goal (1 subgoal):
 1. \<parallel>A t *v x - A t *v y\<parallel> \<le> Sup {\<parallel>A t\<parallel>\<^sub>o\<^sub>p |t. t \<in> T} * \<parallel>x - y\<parallel>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<parallel>A t *v x - A t *v y\<parallel> \<le> L * \<parallel>x - y\<parallel>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tuple_partial_pullback_intersect:
"tuple_partial_pullback m f l (S1 \<inter> S2) = (tuple_partial_pullback m f l S1) \<inter> (tuple_partial_pullback m f l S2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tuple_partial_pullback m f l (S1 \<inter> S2) = tuple_partial_pullback m f l S1 \<inter> tuple_partial_pullback m f l S2
[PROOF STEP]
unfolding tuple_partial_pullback_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tuple_partial_image m f -` (S1 \<inter> S2) \<inter> carrier (Q\<^sub>p\<^bsup>m + l\<^esup>) = tuple_partial_image m f -` S1 \<inter> carrier (Q\<^sub>p\<^bsup>m + l\<^esup>) \<inter> (tuple_partial_image m f -` S2 \<inter> carrier (Q\<^sub>p\<^bsup>m + l\<^esup>))
[PROOF STEP]
by blast