[STATEMENT]
theorem Holder_inequality:
  assumes "p > (0::real)" "q > 0" "1/p + 1/q = 1"
      and [measurable]: "f \<in> borel_measurable M" "g \<in> borel_measurable M"
          "integrable M (\<lambda>x. \<bar>f x\<bar> powr p)"
          "integrable M (\<lambda>x. \<bar>g x\<bar> powr q)"
  shows "integrable M (\<lambda>x. f x * g x)"
        "(\<integral>x. \<bar>f x * g x\<bar> \<partial>M) \<le> (\<integral>x. \<bar>f x\<bar> powr p \<partial>M) powr (1/p) * (\<integral>x. \<bar>g x\<bar> powr q \<partial>M) powr (1/q)"
        "abs(\<integral>x. f x * g x \<partial>M) \<le> (\<integral>x. \<bar>f x\<bar> powr p \<partial>M) powr (1/p) * (\<integral>x. \<bar>g x\<bar> powr q \<partial>M) powr (1/q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable M (\<lambda>x. f x * g x) &&& LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q) &&& \<bar>LINT x|M. f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. integrable M (\<lambda>x. f x * g x)
 2. LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
 3. \<bar>LINT x|M. f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
have "p > 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < p
[PROOF STEP]
using conjugate_exponent_realI(1)[OF \<open>p>0\<close> \<open>q>0\<close> \<open>1/p+1/q=1\<close>]
[PROOF STATE]
proof (prove)
using this:
1 < p

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

goal (3 subgoals):
 1. integrable M (\<lambda>x. f x * g x)
 2. LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
 3. \<bar>LINT x|M. f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
have *: "x * y \<le> x powr p + y powr q" if "x \<ge> 0" "y \<ge> 0" for x y
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * y \<le> x powr p + y powr q
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x * y \<le> x powr p + y powr q
[PROOF STEP]
have "x * y = (x powr p) powr (1/p) * (y powr q) powr (1/q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * y = (x powr p) powr (1 / p) * (y powr q) powr (1 / q)
[PROOF STEP]
using \<open>p > 0\<close> \<open>q > 0\<close> powr_powr that(1) that(2)
[PROOF STATE]
proof (prove)
using this:
0 < p
0 < q
(?x powr ?a) powr ?b = ?x powr (?a * ?b)
0 \<le> x
0 \<le> y

goal (1 subgoal):
 1. x * y = (x powr p) powr (1 / p) * (y powr q) powr (1 / q)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x * y = (x powr p) powr (1 / p) * (y powr q) powr (1 / q)

goal (1 subgoal):
 1. x * y \<le> x powr p + y powr q
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x * y = (x powr p) powr (1 / p) * (y powr q) powr (1 / q)

goal (1 subgoal):
 1. x * y \<le> x powr p + y powr q
[PROOF STEP]
have "... \<le> (max (x powr p) (y powr q)) powr (1/p) * (max (x powr p) (y powr q)) powr (1/q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x powr p) powr (1 / p) * (y powr q) powr (1 / q) \<le> max (x powr p) (y powr q) powr (1 / p) * max (x powr p) (y powr q) powr (1 / q)
[PROOF STEP]
apply (rule mult_mono, auto)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (x powr p) powr (1 / p) \<le> max (x powr p) (y powr q) powr (1 / p)
 2. (y powr q) powr (1 / q) \<le> max (x powr p) (y powr q) powr (1 / q)
[PROOF STEP]
using assms(1) assms(2) powr_mono2
[PROOF STATE]
proof (prove)
using this:
0 < p
0 < q
\<lbrakk>0 \<le> ?a; 0 \<le> ?x; ?x \<le> ?y\<rbrakk> \<Longrightarrow> ?x powr ?a \<le> ?y powr ?a

goal (2 subgoals):
 1. (x powr p) powr (1 / p) \<le> max (x powr p) (y powr q) powr (1 / p)
 2. (y powr q) powr (1 / q) \<le> max (x powr p) (y powr q) powr (1 / q)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(x powr p) powr (1 / p) * (y powr q) powr (1 / q) \<le> max (x powr p) (y powr q) powr (1 / p) * max (x powr p) (y powr q) powr (1 / q)

goal (1 subgoal):
 1. x * y \<le> x powr p + y powr q
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(x powr p) powr (1 / p) * (y powr q) powr (1 / q) \<le> max (x powr p) (y powr q) powr (1 / p) * max (x powr p) (y powr q) powr (1 / q)

goal (1 subgoal):
 1. x * y \<le> x powr p + y powr q
[PROOF STEP]
have "... = max (x powr p) (y powr q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. max (x powr p) (y powr q) powr (1 / p) * max (x powr p) (y powr q) powr (1 / q) = max (x powr p) (y powr q)
[PROOF STEP]
by (metis max_def mult.right_neutral powr_add powr_powr assms(3))
[PROOF STATE]
proof (state)
this:
max (x powr p) (y powr q) powr (1 / p) * max (x powr p) (y powr q) powr (1 / q) = max (x powr p) (y powr q)

goal (1 subgoal):
 1. x * y \<le> x powr p + y powr q
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
max (x powr p) (y powr q) powr (1 / p) * max (x powr p) (y powr q) powr (1 / q) = max (x powr p) (y powr q)

goal (1 subgoal):
 1. x * y \<le> x powr p + y powr q
[PROOF STEP]
have "... \<le> x powr p + y powr q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. max (x powr p) (y powr q) \<le> x powr p + y powr q
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
max (x powr p) (y powr q) \<le> x powr p + y powr q

goal (1 subgoal):
 1. x * y \<le> x powr p + y powr q
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x * y \<le> x powr p + y powr q
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x * y \<le> x powr p + y powr q

goal (1 subgoal):
 1. x * y \<le> x powr p + y powr q
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x * y \<le> x powr p + y powr q

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>0 \<le> ?x; 0 \<le> ?y\<rbrakk> \<Longrightarrow> ?x * ?y \<le> ?x powr p + ?y powr q

goal (3 subgoals):
 1. integrable M (\<lambda>x. f x * g x)
 2. LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
 3. \<bar>LINT x|M. f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
show [simp]: "integrable M (\<lambda>x. f x * g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable M (\<lambda>x. f x * g x)
[PROOF STEP]
apply (rule Bochner_Integration.integrable_bound[of _ "\<lambda>x. \<bar>f x\<bar> powr p + \<bar>g x\<bar> powr q"], auto)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. integrable M (\<lambda>x. \<bar>f x\<bar> powr p + \<bar>g x\<bar> powr q)
 2. AE x in M. \<bar>f x * g x\<bar> \<le> \<bar>f x\<bar> powr p + \<bar>g x\<bar> powr q
[PROOF STEP]
by (rule Bochner_Integration.integrable_add, auto simp add: assms * abs_mult)
[PROOF STATE]
proof (state)
this:
integrable M (\<lambda>x. f x * g x)

goal (2 subgoals):
 1. LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
 2. \<bar>LINT x|M. f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
text \<open>The proof of the main inequality is done by applying the inequality
        $(\int |h| d\mu \leq \int |h|^p d\mu)^{1/p}$ to the right function $h$ in the right
        probability space. One should take $h = f \cdot |g|^{1-q}$, and $d\mu = |g|^q dM / I$,
        where $I = \int |g|^q$. This readily gives the result.\<close>
[PROOF STATE]
proof (state)
this:
integrable M (\<lambda>x. f x * g x)

goal (2 subgoals):
 1. LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
 2. \<bar>LINT x|M. f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
show *: "(\<integral>x. \<bar>f x * g x\<bar> \<partial>M) \<le> (\<integral>x. \<bar>f x\<bar> powr p \<partial>M) powr (1/p) * (\<integral>x. \<bar>g x\<bar> powr q \<partial>M) powr (1/q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
proof (cases "(\<integral>x. \<bar>g x\<bar> powr q \<partial>M) = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. LINT x|M. \<bar>g x\<bar> powr q = 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
 2. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
LINT x|M. \<bar>g x\<bar> powr q = 0

goal (2 subgoals):
 1. LINT x|M. \<bar>g x\<bar> powr q = 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
 2. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
LINT x|M. \<bar>g x\<bar> powr q = 0
[PROOF STEP]
have "AE x in M. \<bar>g x\<bar> powr q = 0"
[PROOF STATE]
proof (prove)
using this:
LINT x|M. \<bar>g x\<bar> powr q = 0

goal (1 subgoal):
 1. AE x in M. \<bar>g x\<bar> powr q = 0
[PROOF STEP]
by (subst integral_nonneg_eq_0_iff_AE[symmetric], auto simp add: assms)
[PROOF STATE]
proof (state)
this:
AE x in M. \<bar>g x\<bar> powr q = 0

goal (2 subgoals):
 1. LINT x|M. \<bar>g x\<bar> powr q = 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
 2. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
AE x in M. \<bar>g x\<bar> powr q = 0
[PROOF STEP]
have *: "AE x in M. f x * g x = 0"
[PROOF STATE]
proof (prove)
using this:
AE x in M. \<bar>g x\<bar> powr q = 0

goal (1 subgoal):
 1. AE x in M. f x * g x = 0
[PROOF STEP]
using \<open>q > 0\<close>
[PROOF STATE]
proof (prove)
using this:
AE x in M. \<bar>g x\<bar> powr q = 0
0 < q

goal (1 subgoal):
 1. AE x in M. f x * g x = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
AE x in M. f x * g x = 0

goal (2 subgoals):
 1. LINT x|M. \<bar>g x\<bar> powr q = 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
 2. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
have "(\<integral>x. \<bar>f x * g x\<bar> \<partial>M) = (\<integral>x. 0 \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LINT x|M. \<bar>f x * g x\<bar> = LINT x|M. 0
[PROOF STEP]
apply (rule integral_cong_AE)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. (\<lambda>x. \<bar>f x * g x\<bar>) \<in> borel_measurable M
 2. (\<lambda>x. 0) \<in> borel_measurable M
 3. AE x in M. \<bar>f x * g x\<bar> = 0
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
AE x in M. f x * g x = 0

goal (3 subgoals):
 1. (\<lambda>x. \<bar>f x * g x\<bar>) \<in> borel_measurable M
 2. (\<lambda>x. 0) \<in> borel_measurable M
 3. AE x in M. \<bar>f x * g x\<bar> = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
LINT x|M. \<bar>f x * g x\<bar> = LINT x|M. 0

goal (2 subgoals):
 1. LINT x|M. \<bar>g x\<bar> powr q = 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
 2. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
LINT x|M. \<bar>f x * g x\<bar> = LINT x|M. 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
LINT x|M. \<bar>f x * g x\<bar> = LINT x|M. 0

goal (1 subgoal):
 1. LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)

goal (1 subgoal):
 1. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0

goal (1 subgoal):
 1. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0

goal (1 subgoal):
 1. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
have "(\<integral>x. \<bar>g x\<bar> powr q \<partial>M) \<ge> (\<integral>x. 0 \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LINT x|M. 0 \<le> LINT x|M. \<bar>g x\<bar> powr q
[PROOF STEP]
by (rule integral_mono, auto simp add: assms)
[PROOF STATE]
proof (state)
this:
LINT x|M. 0 \<le> LINT x|M. \<bar>g x\<bar> powr q

goal (1 subgoal):
 1. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0
LINT x|M. 0 \<le> LINT x|M. \<bar>g x\<bar> powr q
[PROOF STEP]
have *: "(\<integral>x. \<bar>g x\<bar> powr q \<partial>M) > 0"
[PROOF STATE]
proof (prove)
using this:
LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0
LINT x|M. 0 \<le> LINT x|M. \<bar>g x\<bar> powr q

goal (1 subgoal):
 1. 0 < LINT x|M. \<bar>g x\<bar> powr q
[PROOF STEP]
by (simp add: le_less)
[PROOF STATE]
proof (state)
this:
0 < LINT x|M. \<bar>g x\<bar> powr q

goal (1 subgoal):
 1. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
define I where "I = (\<integral>x. \<bar>g x\<bar> powr q \<partial>M)"
[PROOF STATE]
proof (state)
this:
I = LINT x|M. \<bar>g x\<bar> powr q

goal (1 subgoal):
 1. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
have [simp]: "I > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < I
[PROOF STEP]
unfolding I_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < LINT x|M. \<bar>g x\<bar> powr q
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
0 < LINT x|M. \<bar>g x\<bar> powr q

goal (1 subgoal):
 1. 0 < LINT x|M. \<bar>g x\<bar> powr q
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < I

goal (1 subgoal):
 1. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
define M2 where "M2 = density M (\<lambda>x. \<bar>g x\<bar> powr q / I)"
[PROOF STATE]
proof (state)
this:
M2 = density M (\<lambda>x. ennreal (\<bar>g x\<bar> powr q / I))

goal (1 subgoal):
 1. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
interpret prob_space M2
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob_space M2
[PROOF STEP]
apply (standard, unfold M2_def, auto, subst emeasure_density, auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (\<bar>g x\<bar> powr q / I) \<partial>M = 1
[PROOF STEP]
apply (subst divide_ennreal[symmetric], auto, subst nn_integral_divide, auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (\<bar>g x\<bar> powr q) \<partial>M / ennreal I = 1
[PROOF STEP]
apply (subst nn_integral_eq_integral, auto simp add: assms, unfold I_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ennreal (LINT x|M. \<bar>g x\<bar> powr q) / ennreal (LINT x|M. \<bar>g x\<bar> powr q) = 1
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
0 < LINT x|M. \<bar>g x\<bar> powr q

goal (1 subgoal):
 1. ennreal (LINT x|M. \<bar>g x\<bar> powr q) / ennreal (LINT x|M. \<bar>g x\<bar> powr q) = 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
have [simp]: "p \<ge> 1" "p \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> p &&& 0 \<le> p
[PROOF STEP]
using \<open>p > 1\<close>
[PROOF STATE]
proof (prove)
using this:
1 < p

goal (1 subgoal):
 1. 1 \<le> p &&& 0 \<le> p
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 \<le> p
0 \<le> p

goal (1 subgoal):
 1. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
have A: "q + (1 - q) * p = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. q + (1 - q) * p = 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < p
0 < q
1 / p + 1 / q = 1
f \<in> borel_measurable M
g \<in> borel_measurable M
integrable M (\<lambda>x. \<bar>f x\<bar> powr p)
integrable M (\<lambda>x. \<bar>g x\<bar> powr q)

goal (1 subgoal):
 1. q + (1 - q) * p = 0
[PROOF STEP]
by (auto simp add: divide_simps algebra_simps)
[PROOF STATE]
proof (state)
this:
q + (1 - q) * p = 0

goal (1 subgoal):
 1. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
have B: "1 - 1/p = 1/q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 - 1 / p = 1 / q
[PROOF STEP]
using \<open>1/p + 1/q = 1\<close>
[PROOF STATE]
proof (prove)
using this:
1 / p + 1 / q = 1

goal (1 subgoal):
 1. 1 - 1 / p = 1 / q
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 - 1 / p = 1 / q

goal (1 subgoal):
 1. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
define f2 where "f2 = (\<lambda>x. f x * indicator {y\<in> space M. g y \<noteq> 0} x)"
[PROOF STATE]
proof (state)
this:
f2 = (\<lambda>x. f x * indicat_real {y \<in> space M. g y \<noteq> 0} x)

goal (1 subgoal):
 1. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
have [measurable]: "f2 \<in> borel_measurable M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f2 \<in> borel_measurable M
[PROOF STEP]
unfolding f2_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. f x * indicat_real {y \<in> space M. g y \<noteq> 0} x) \<in> borel_measurable M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f2 \<in> borel_measurable M

goal (1 subgoal):
 1. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
define h where "h = (\<lambda>x. \<bar>f2 x\<bar> * \<bar>g x\<bar> powr (1-q))"
[PROOF STATE]
proof (state)
this:
h = (\<lambda>x. \<bar>f2 x\<bar> * \<bar>g x\<bar> powr (1 - q))

goal (1 subgoal):
 1. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
have [measurable]: "h \<in> borel_measurable M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h \<in> borel_measurable M
[PROOF STEP]
unfolding h_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<bar>f2 x\<bar> * \<bar>g x\<bar> powr (1 - q)) \<in> borel_measurable M
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
h \<in> borel_measurable M

goal (1 subgoal):
 1. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
have [measurable]: "h \<in> borel_measurable M2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. random_variable borel h
[PROOF STEP]
unfolding M2_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h \<in> borel_measurable (density M (\<lambda>x. ennreal (\<bar>g x\<bar> powr q / I)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
random_variable borel h

goal (1 subgoal):
 1. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
have Eq: "(\<bar>g x\<bar> powr q / I) *\<^sub>R \<bar>h x\<bar> powr p = \<bar>f2 x\<bar> powr p / I" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<bar>g x\<bar> powr q / I) *\<^sub>R \<bar>h x\<bar> powr p = \<bar>f2 x\<bar> powr p / I
[PROOF STEP]
apply (insert \<open>I>0\<close>, auto simp add: divide_simps, unfold h_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. I \<noteq> 0 \<Longrightarrow> \<bar>g x\<bar> powr q * \<bar>\<bar>f2 x\<bar> * \<bar>g x\<bar> powr (1 - q)\<bar> powr p = \<bar>f2 x\<bar> powr p
[PROOF STEP]
apply (auto simp add: divide_nonneg_pos divide_simps powr_mult powr_powr powr_add[symmetric] A)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>I \<noteq> 0; g x = 0\<rbrakk> \<Longrightarrow> f2 x = 0
[PROOF STEP]
unfolding f2_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>I \<noteq> 0; g x = 0\<rbrakk> \<Longrightarrow> f x * indicat_real {y \<in> space M. g y \<noteq> 0} x = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<bar>g ?x1\<bar> powr q / I) *\<^sub>R \<bar>h ?x1\<bar> powr p = \<bar>f2 ?x1\<bar> powr p / I

goal (1 subgoal):
 1. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
have "integrable M2 (\<lambda>x. \<bar>h x\<bar> powr p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable M2 (\<lambda>x. \<bar>h x\<bar> powr p)
[PROOF STEP]
unfolding M2_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable (density M (\<lambda>x. ennreal (\<bar>g x\<bar> powr q / I))) (\<lambda>x. \<bar>h x\<bar> powr p)
[PROOF STEP]
apply (subst integrable_density, simp, simp, simp add: divide_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable M (\<lambda>x. (\<bar>g x\<bar> powr q / I) *\<^sub>R \<bar>h x\<bar> powr p)
[PROOF STEP]
apply (subst Eq, rule integrable_divide, rule Bochner_Integration.integrable_bound[of _ "\<lambda>x. \<bar>f x\<bar> powr p"], unfold f2_def)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. integrable M (\<lambda>x. \<bar>f x\<bar> powr p)
 2. (\<lambda>x. \<bar>f x * indicat_real {y \<in> space M. g y \<noteq> 0} x\<bar> powr p) \<in> borel_measurable M
 3. AE x in M. norm (\<bar>f x * indicat_real {y \<in> space M. g y \<noteq> 0} x\<bar> powr p) \<le> norm (\<bar>f x\<bar> powr p)
[PROOF STEP]
by (unfold indicator_def, auto simp add: \<open>integrable M (\<lambda>x. \<bar>f x\<bar> powr p)\<close>)
[PROOF STATE]
proof (state)
this:
integrable M2 (\<lambda>x. \<bar>h x\<bar> powr p)

goal (1 subgoal):
 1. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
integrable M2 (\<lambda>x. \<bar>h x\<bar> powr p)
[PROOF STEP]
have "integrable M2 (\<lambda>x. \<bar>h x\<bar>)"
[PROOF STATE]
proof (prove)
using this:
integrable M2 (\<lambda>x. \<bar>h x\<bar> powr p)

goal (1 subgoal):
 1. integrable M2 (\<lambda>x. \<bar>h x\<bar>)
[PROOF STEP]
by (metis bound_L1_Lp(1) \<open>random_variable borel h\<close> \<open>p > 1\<close> integrable_abs le_less)
[PROOF STATE]
proof (state)
this:
integrable M2 (\<lambda>x. \<bar>h x\<bar>)

goal (1 subgoal):
 1. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
have "(\<integral>x. \<bar>h x\<bar> powr p \<partial>M2) = (\<integral>x. (\<bar>g x\<bar> powr q / I) *\<^sub>R (\<bar>h x\<bar> powr p) \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. expectation (\<lambda>x. \<bar>h x\<bar> powr p) = LINT x|M. (\<bar>g x\<bar> powr q / I) *\<^sub>R \<bar>h x\<bar> powr p
[PROOF STEP]
unfolding M2_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LINT x|density M (\<lambda>x. ennreal (\<bar>g x\<bar> powr q / I)). \<bar>h x\<bar> powr p = LINT x|M. (\<bar>g x\<bar> powr q / I) *\<^sub>R \<bar>h x\<bar> powr p
[PROOF STEP]
by (rule integral_density[of "\<lambda>x. \<bar>h x\<bar> powr p" M "\<lambda>x. \<bar>g x\<bar> powr q / I"], auto simp add: divide_simps)
[PROOF STATE]
proof (state)
this:
expectation (\<lambda>x. \<bar>h x\<bar> powr p) = LINT x|M. (\<bar>g x\<bar> powr q / I) *\<^sub>R \<bar>h x\<bar> powr p

goal (1 subgoal):
 1. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
expectation (\<lambda>x. \<bar>h x\<bar> powr p) = LINT x|M. (\<bar>g x\<bar> powr q / I) *\<^sub>R \<bar>h x\<bar> powr p

goal (1 subgoal):
 1. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
have "... = (\<integral>x. \<bar>f2 x\<bar> powr p / I \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LINT x|M. (\<bar>g x\<bar> powr q / I) *\<^sub>R \<bar>h x\<bar> powr p = LINT x|M. \<bar>f2 x\<bar> powr p / I
[PROOF STEP]
apply (rule Bochner_Integration.integral_cong)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. M = M
 2. \<And>x. x \<in> space M \<Longrightarrow> (\<bar>g x\<bar> powr q / I) *\<^sub>R \<bar>h x\<bar> powr p = \<bar>f2 x\<bar> powr p / I
[PROOF STEP]
using Eq
[PROOF STATE]
proof (prove)
using this:
(\<bar>g ?x1\<bar> powr q / I) *\<^sub>R \<bar>h ?x1\<bar> powr p = \<bar>f2 ?x1\<bar> powr p / I

goal (2 subgoals):
 1. M = M
 2. \<And>x. x \<in> space M \<Longrightarrow> (\<bar>g x\<bar> powr q / I) *\<^sub>R \<bar>h x\<bar> powr p = \<bar>f2 x\<bar> powr p / I
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
LINT x|M. (\<bar>g x\<bar> powr q / I) *\<^sub>R \<bar>h x\<bar> powr p = LINT x|M. \<bar>f2 x\<bar> powr p / I

goal (1 subgoal):
 1. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
LINT x|M. (\<bar>g x\<bar> powr q / I) *\<^sub>R \<bar>h x\<bar> powr p = LINT x|M. \<bar>f2 x\<bar> powr p / I

goal (1 subgoal):
 1. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
have "... \<le> (\<integral>x. \<bar>f x\<bar> powr p / I \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LINT x|M. \<bar>f2 x\<bar> powr p / I \<le> LINT x|M. \<bar>f x\<bar> powr p / I
[PROOF STEP]
apply (rule integral_mono', rule integrable_divide[OF \<open>integrable M (\<lambda>x. \<bar>f x\<bar> powr p)\<close>])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x \<in> space M \<Longrightarrow> \<bar>f2 x\<bar> powr p / I \<le> \<bar>f x\<bar> powr p / I
 2. \<And>x. x \<in> space M \<Longrightarrow> 0 \<le> \<bar>f x\<bar> powr p / I
[PROOF STEP]
unfolding f2_def indicator_def
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x \<in> space M \<Longrightarrow> \<bar>f x * of_bool (x \<in> {y \<in> space M. g y \<noteq> 0})\<bar> powr p / I \<le> \<bar>f x\<bar> powr p / I
 2. \<And>x. x \<in> space M \<Longrightarrow> 0 \<le> \<bar>f x\<bar> powr p / I
[PROOF STEP]
using \<open>I > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < I

goal (2 subgoals):
 1. \<And>x. x \<in> space M \<Longrightarrow> \<bar>f x * of_bool (x \<in> {y \<in> space M. g y \<noteq> 0})\<bar> powr p / I \<le> \<bar>f x\<bar> powr p / I
 2. \<And>x. x \<in> space M \<Longrightarrow> 0 \<le> \<bar>f x\<bar> powr p / I
[PROOF STEP]
by (auto simp add: divide_simps)
[PROOF STATE]
proof (state)
this:
LINT x|M. \<bar>f2 x\<bar> powr p / I \<le> LINT x|M. \<bar>f x\<bar> powr p / I

goal (1 subgoal):
 1. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
expectation (\<lambda>x. \<bar>h x\<bar> powr p) \<le> LINT x|M. \<bar>f x\<bar> powr p / I
[PROOF STEP]
have C: "(\<integral>x. \<bar>h x\<bar> powr p \<partial>M2) \<le> (\<integral>x. \<bar>f x\<bar> powr p / I \<partial>M)"
[PROOF STATE]
proof (prove)
using this:
expectation (\<lambda>x. \<bar>h x\<bar> powr p) \<le> LINT x|M. \<bar>f x\<bar> powr p / I

goal (1 subgoal):
 1. expectation (\<lambda>x. \<bar>h x\<bar> powr p) \<le> LINT x|M. \<bar>f x\<bar> powr p / I
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
expectation (\<lambda>x. \<bar>h x\<bar> powr p) \<le> LINT x|M. \<bar>f x\<bar> powr p / I

goal (1 subgoal):
 1. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
have "(\<integral>x. \<bar>f x * g x\<bar> \<partial>M) / I = (\<integral>x. \<bar>f x * g x\<bar> / I \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LINT x|M. \<bar>f x * g x\<bar>) / I = LINT x|M. \<bar>f x * g x\<bar> / I
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(LINT x|M. \<bar>f x * g x\<bar>) / I = LINT x|M. \<bar>f x * g x\<bar> / I

goal (1 subgoal):
 1. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(LINT x|M. \<bar>f x * g x\<bar>) / I = LINT x|M. \<bar>f x * g x\<bar> / I

goal (1 subgoal):
 1. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
have "... = (\<integral>x. \<bar>f2 x * g x\<bar> / I \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LINT x|M. \<bar>f x * g x\<bar> / I = LINT x|M. \<bar>f2 x * g x\<bar> / I
[PROOF STEP]
by (auto simp add: divide_simps, rule Bochner_Integration.integral_cong, unfold f2_def indicator_def, auto)
[PROOF STATE]
proof (state)
this:
LINT x|M. \<bar>f x * g x\<bar> / I = LINT x|M. \<bar>f2 x * g x\<bar> / I

goal (1 subgoal):
 1. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
LINT x|M. \<bar>f x * g x\<bar> / I = LINT x|M. \<bar>f2 x * g x\<bar> / I

goal (1 subgoal):
 1. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
have "... = (\<integral>x. \<bar>h x\<bar> \<partial>M2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LINT x|M. \<bar>f2 x * g x\<bar> / I = expectation (\<lambda>x. \<bar>h x\<bar>)
[PROOF STEP]
apply (unfold M2_def, subst integral_density, simp, simp, simp add: divide_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LINT x|M. \<bar>f2 x * g x\<bar> / I = LINT x|M. (\<bar>g x\<bar> powr q / I) *\<^sub>R \<bar>h x\<bar>
[PROOF STEP]
by (rule Bochner_Integration.integral_cong, unfold h_def, auto simp add: divide_simps algebra_simps powr_add[symmetric] abs_mult)
[PROOF STATE]
proof (state)
this:
LINT x|M. \<bar>f2 x * g x\<bar> / I = expectation (\<lambda>x. \<bar>h x\<bar>)

goal (1 subgoal):
 1. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
LINT x|M. \<bar>f2 x * g x\<bar> / I = expectation (\<lambda>x. \<bar>h x\<bar>)

goal (1 subgoal):
 1. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
have "... \<le> abs (\<integral>x. \<bar>h x\<bar> \<partial>M2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. expectation (\<lambda>x. \<bar>h x\<bar>) \<le> \<bar>expectation (\<lambda>x. \<bar>h x\<bar>)\<bar>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
expectation (\<lambda>x. \<bar>h x\<bar>) \<le> \<bar>expectation (\<lambda>x. \<bar>h x\<bar>)\<bar>

goal (1 subgoal):
 1. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
expectation (\<lambda>x. \<bar>h x\<bar>) \<le> \<bar>expectation (\<lambda>x. \<bar>h x\<bar>)\<bar>

goal (1 subgoal):
 1. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
have "... \<le> (\<integral>x. abs(\<bar>h x\<bar>) powr p \<partial>M2) powr (1/p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>expectation (\<lambda>x. \<bar>h x\<bar>)\<bar> \<le> expectation (\<lambda>x. \<bar>\<bar>h x\<bar>\<bar> powr p) powr (1 / p)
[PROOF STEP]
apply (rule bound_L1_Lp(3)[of p "\<lambda>x. \<bar>h x\<bar>"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. 1 \<le> p
 2. random_variable borel (\<lambda>x. \<bar>h x\<bar>)
 3. integrable M2 (\<lambda>x. \<bar>\<bar>h x\<bar>\<bar> powr p)
[PROOF STEP]
by (auto simp add: \<open>integrable M2 (\<lambda>x. \<bar>h x\<bar> powr p)\<close>)
[PROOF STATE]
proof (state)
this:
\<bar>expectation (\<lambda>x. \<bar>h x\<bar>)\<bar> \<le> expectation (\<lambda>x. \<bar>\<bar>h x\<bar>\<bar> powr p) powr (1 / p)

goal (1 subgoal):
 1. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<bar>expectation (\<lambda>x. \<bar>h x\<bar>)\<bar> \<le> expectation (\<lambda>x. \<bar>\<bar>h x\<bar>\<bar> powr p) powr (1 / p)

goal (1 subgoal):
 1. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
have "... \<le> (\<integral>x. \<bar>f x\<bar> powr p / I \<partial>M) powr (1/p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. expectation (\<lambda>x. \<bar>\<bar>h x\<bar>\<bar> powr p) powr (1 / p) \<le> (LINT x|M. \<bar>f x\<bar> powr p / I) powr (1 / p)
[PROOF STEP]
by (rule powr_mono2, insert C, auto)
[PROOF STATE]
proof (state)
this:
expectation (\<lambda>x. \<bar>\<bar>h x\<bar>\<bar> powr p) powr (1 / p) \<le> (LINT x|M. \<bar>f x\<bar> powr p / I) powr (1 / p)

goal (1 subgoal):
 1. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
expectation (\<lambda>x. \<bar>\<bar>h x\<bar>\<bar> powr p) powr (1 / p) \<le> (LINT x|M. \<bar>f x\<bar> powr p / I) powr (1 / p)

goal (1 subgoal):
 1. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
have "... \<le> ((\<integral>x. \<bar>f x\<bar> powr p \<partial>M) / I) powr (1/p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LINT x|M. \<bar>f x\<bar> powr p / I) powr (1 / p) \<le> ((LINT x|M. \<bar>f x\<bar> powr p) / I) powr (1 / p)
[PROOF STEP]
apply (rule powr_mono2, auto simp add: divide_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p < 0 \<Longrightarrow> False
[PROOF STEP]
using \<open>p \<ge> 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 \<le> p

goal (1 subgoal):
 1. p < 0 \<Longrightarrow> False
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(LINT x|M. \<bar>f x\<bar> powr p / I) powr (1 / p) \<le> ((LINT x|M. \<bar>f x\<bar> powr p) / I) powr (1 / p)

goal (1 subgoal):
 1. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(LINT x|M. \<bar>f x\<bar> powr p / I) powr (1 / p) \<le> ((LINT x|M. \<bar>f x\<bar> powr p) / I) powr (1 / p)

goal (1 subgoal):
 1. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
have "... = (\<integral>x. \<bar>f x\<bar> powr p \<partial>M) powr (1/p) * I powr(-1/p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((LINT x|M. \<bar>f x\<bar> powr p) / I) powr (1 / p) = (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * I powr (- 1 / p)
[PROOF STEP]
by (auto simp add: less_imp_le powr_divide powr_minus_divide)
[PROOF STATE]
proof (state)
this:
((LINT x|M. \<bar>f x\<bar> powr p) / I) powr (1 / p) = (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * I powr (- 1 / p)

goal (1 subgoal):
 1. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(LINT x|M. \<bar>f x * g x\<bar>) / I \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * I powr (- 1 / p)
[PROOF STEP]
have "(\<integral>x. \<bar>f x * g x\<bar> \<partial>M) \<le> (\<integral>x. \<bar>f x\<bar> powr p \<partial>M) powr (1/p) * I * I powr(-1/p)"
[PROOF STATE]
proof (prove)
using this:
(LINT x|M. \<bar>f x * g x\<bar>) / I \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * I powr (- 1 / p)

goal (1 subgoal):
 1. LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * I * I powr (- 1 / p)
[PROOF STEP]
by (auto simp add: divide_simps algebra_simps)
[PROOF STATE]
proof (state)
this:
LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * I * I powr (- 1 / p)

goal (1 subgoal):
 1. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * I * I powr (- 1 / p)

goal (1 subgoal):
 1. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
have "... = (\<integral>x. \<bar>f x\<bar> powr p \<partial>M) powr (1/p) * I powr (1-1/p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * I * I powr (- 1 / p) = (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * I powr (1 - 1 / p)
[PROOF STEP]
by (auto simp add: powr_mult_base less_imp_le)
[PROOF STATE]
proof (state)
this:
(LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * I * I powr (- 1 / p) = (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * I powr (1 - 1 / p)

goal (1 subgoal):
 1. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * I * I powr (- 1 / p) = (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * I powr (1 - 1 / p)

goal (1 subgoal):
 1. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
have "... = (\<integral>x. \<bar>f x\<bar> powr p \<partial>M) powr (1/p) * (\<integral>x. \<bar>g x\<bar> powr q \<partial>M) powr (1/q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * I powr (1 - 1 / p) = (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
unfolding I_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 - 1 / p) = (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
using B
[PROOF STATE]
proof (prove)
using this:
1 - 1 / p = 1 / q

goal (1 subgoal):
 1. (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 - 1 / p) = (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * I powr (1 - 1 / p) = (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)

goal (1 subgoal):
 1. LINT x|M. \<bar>g x\<bar> powr q \<noteq> 0 \<Longrightarrow> LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)

goal (1 subgoal):
 1. LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)

goal (1 subgoal):
 1. \<bar>LINT x|M. f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
have "abs(\<integral>x. f x * g x \<partial>M) \<le> (\<integral>x. \<bar>f x * g x\<bar> \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>LINT x|M. f x * g x\<bar> \<le> LINT x|M. \<bar>f x * g x\<bar>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<bar>LINT x|M. f x * g x\<bar> \<le> LINT x|M. \<bar>f x * g x\<bar>

goal (1 subgoal):
 1. \<bar>LINT x|M. f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<bar>LINT x|M. f x * g x\<bar> \<le> LINT x|M. \<bar>f x * g x\<bar>
[PROOF STEP]
show "abs(\<integral>x. f x * g x \<partial>M) \<le> (\<integral>x. \<bar>f x\<bar> powr p \<partial>M) powr (1/p) * (\<integral>x. \<bar>g x\<bar> powr q \<partial>M) powr (1/q)"
[PROOF STATE]
proof (prove)
using this:
\<bar>LINT x|M. f x * g x\<bar> \<le> LINT x|M. \<bar>f x * g x\<bar>

goal (1 subgoal):
 1. \<bar>LINT x|M. f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
\<bar>LINT x|M. f x * g x\<bar> \<le> LINT x|M. \<bar>f x * g x\<bar>
LINT x|M. \<bar>f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)

goal (1 subgoal):
 1. \<bar>LINT x|M. f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
\<bar>LINT x|M. f x * g x\<bar> \<le> (LINT x|M. \<bar>f x\<bar> powr p) powr (1 / p) * (LINT x|M. \<bar>g x\<bar> powr q) powr (1 / q)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma incseq_Suc_iff: "incseq f \<longleftrightarrow> (\<forall>n. f n \<le> f (Suc n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. incseq f = (\<forall>n. f n \<le> f (Suc n))
[PROOF STEP]
by (auto intro: incseq_SucI dest: incseq_SucD)


[STATEMENT]
lemma Ivl_simps[simp]: "lower (Ivl a b) = min a b" "upper (Ivl a b) = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lower (Ivl a b) = min a b &&& upper (Ivl a b) = b
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lower (Ivl a b) = min a b
[PROOF STEP]
by transfer simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. upper (Ivl a b) = b
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. upper (Ivl a b) = b
[PROOF STEP]
by transfer simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma CauchyD: "Cauchy X \<Longrightarrow> 0 < e \<Longrightarrow> \<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. norm (X m - X n) < e"
  for X :: "nat \<Rightarrow> 'a::real_normed_vector"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Cauchy X; 0 < e\<rbrakk> \<Longrightarrow> \<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. norm (X m - X n) < e
[PROOF STEP]
by (simp add: Cauchy_iff)


[STATEMENT]
lemma dirichlet_inverse_gt_1':
  assumes "n > 1"
  shows   "dirichlet_inverse f i n =
             -i * dirichlet_prod (\<lambda>n. if n = 1 then 0 else f n) (dirichlet_inverse f i) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dirichlet_inverse f i n = - i * dirichlet_prod (\<lambda>n. if n = 1 then 0::'a else f n) (dirichlet_inverse f i) n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dirichlet_inverse f i n = - i * dirichlet_prod (\<lambda>n. if n = 1 then 0::'a else f n) (dirichlet_inverse f i) n
[PROOF STEP]
have "dirichlet_prod (\<lambda>n. if n = 1 then 0 else f n) (dirichlet_inverse f i) n =
          (\<Sum>d | d dvd n. (if n div d = Suc 0 then 0 else f (n div d)) * dirichlet_inverse f i d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dirichlet_prod (\<lambda>n. if n = 1 then 0::'a else f n) (dirichlet_inverse f i) n = (\<Sum>d | d dvd n. (if n div d = Suc 0 then 0::'a else f (n div d)) * dirichlet_inverse f i d)
[PROOF STEP]
by (simp add: dirichlet_prod_altdef1)
[PROOF STATE]
proof (state)
this:
dirichlet_prod (\<lambda>n. if n = 1 then 0::'a else f n) (dirichlet_inverse f i) n = (\<Sum>d | d dvd n. (if n div d = Suc 0 then 0::'a else f (n div d)) * dirichlet_inverse f i d)

goal (1 subgoal):
 1. dirichlet_inverse f i n = - i * dirichlet_prod (\<lambda>n. if n = 1 then 0::'a else f n) (dirichlet_inverse f i) n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dirichlet_prod (\<lambda>n. if n = 1 then 0::'a else f n) (dirichlet_inverse f i) n = (\<Sum>d | d dvd n. (if n div d = Suc 0 then 0::'a else f (n div d)) * dirichlet_inverse f i d)

goal (1 subgoal):
 1. dirichlet_inverse f i n = - i * dirichlet_prod (\<lambda>n. if n = 1 then 0::'a else f n) (dirichlet_inverse f i) n
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
1 < n
[PROOF STEP]
have "\<dots> = (\<Sum>d | d dvd n \<and> d \<noteq> n. f (n div d) * dirichlet_inverse f i d)"
[PROOF STATE]
proof (prove)
using this:
1 < n

goal (1 subgoal):
 1. (\<Sum>d | d dvd n. (if n div d = Suc 0 then 0::'a else f (n div d)) * dirichlet_inverse f i d) = (\<Sum>d | d dvd n \<and> d \<noteq> n. f (n div d) * dirichlet_inverse f i d)
[PROOF STEP]
by (intro sum.mono_neutral_cong_right) (auto elim: dvdE)
[PROOF STATE]
proof (state)
this:
(\<Sum>d | d dvd n. (if n div d = Suc 0 then 0::'a else f (n div d)) * dirichlet_inverse f i d) = (\<Sum>d | d dvd n \<and> d \<noteq> n. f (n div d) * dirichlet_inverse f i d)

goal (1 subgoal):
 1. dirichlet_inverse f i n = - i * dirichlet_prod (\<lambda>n. if n = 1 then 0::'a else f n) (dirichlet_inverse f i) n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>d | d dvd n. (if n div d = Suc 0 then 0::'a else f (n div d)) * dirichlet_inverse f i d) = (\<Sum>d | d dvd n \<and> d \<noteq> n. f (n div d) * dirichlet_inverse f i d)

goal (1 subgoal):
 1. dirichlet_inverse f i n = - i * dirichlet_prod (\<lambda>n. if n = 1 then 0::'a else f n) (dirichlet_inverse f i) n
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
1 < n
[PROOF STEP]
have "{d. d dvd n \<and> d \<noteq> n} = {d. d dvd n \<and> d < n}"
[PROOF STATE]
proof (prove)
using this:
1 < n

goal (1 subgoal):
 1. {d. d dvd n \<and> d \<noteq> n} = {d. d dvd n \<and> d < n}
[PROOF STEP]
by (auto dest: dvd_imp_le)
[PROOF STATE]
proof (state)
this:
{d. d dvd n \<and> d \<noteq> n} = {d. d dvd n \<and> d < n}

goal (1 subgoal):
 1. dirichlet_inverse f i n = - i * dirichlet_prod (\<lambda>n. if n = 1 then 0::'a else f n) (dirichlet_inverse f i) n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{d. d dvd n \<and> d \<noteq> n} = {d. d dvd n \<and> d < n}

goal (1 subgoal):
 1. dirichlet_inverse f i n = - i * dirichlet_prod (\<lambda>n. if n = 1 then 0::'a else f n) (dirichlet_inverse f i) n
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
1 < n
[PROOF STEP]
have "-i * (\<Sum>d\<in>\<dots>. f (n div d) * dirichlet_inverse f i d) =
                          dirichlet_inverse f i n"
[PROOF STATE]
proof (prove)
using this:
1 < n

goal (1 subgoal):
 1. - i * (\<Sum>d | d dvd n \<and> d < n. f (n div d) * dirichlet_inverse f i d) = dirichlet_inverse f i n
[PROOF STEP]
by (simp add: dirichlet_inverse_gt_1)
[PROOF STATE]
proof (state)
this:
- i * (\<Sum>d | d dvd n \<and> d < n. f (n div d) * dirichlet_inverse f i d) = dirichlet_inverse f i n

goal (1 subgoal):
 1. dirichlet_inverse f i n = - i * dirichlet_prod (\<lambda>n. if n = 1 then 0::'a else f n) (dirichlet_inverse f i) n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
- i * dirichlet_prod (\<lambda>n. if n = 1 then 0::'a else f n) (dirichlet_inverse f i) n = dirichlet_inverse f i n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
- i * dirichlet_prod (\<lambda>n. if n = 1 then 0::'a else f n) (dirichlet_inverse f i) n = dirichlet_inverse f i n

goal (1 subgoal):
 1. dirichlet_inverse f i n = - i * dirichlet_prod (\<lambda>n. if n = 1 then 0::'a else f n) (dirichlet_inverse f i) n
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
dirichlet_inverse f i n = - i * dirichlet_prod (\<lambda>n. if n = 1 then 0::'a else f n) (dirichlet_inverse f i) n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma event_ex_aux_a: "a 0 = (0::int) \<Longrightarrow> \<forall>n. xa (Suc n) = (\<not> xa n) \<Longrightarrow>
        \<forall>n. (xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0) \<Longrightarrow>
        (a n = -1 \<longrightarrow> xa n) \<and> (a n = 1 \<longrightarrow> \<not> xa n) \<and> -1 \<le> a n \<and> a n \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a n = - 1 \<longrightarrow> xa n) \<and> (a n = 1 \<longrightarrow> \<not> xa n) \<and> - 1 \<le> a n \<and> a n \<le> 1
[PROOF STEP]
proof (induction n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a 0 = - 1 \<longrightarrow> xa 0) \<and> (a 0 = 1 \<longrightarrow> \<not> xa 0) \<and> - 1 \<le> a 0 \<and> a 0 \<le> 1
 2. \<And>n. \<lbrakk>\<lbrakk>a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a n = - 1 \<longrightarrow> xa n) \<and> (a n = 1 \<longrightarrow> \<not> xa n) \<and> - 1 \<le> a n \<and> a n \<le> 1; a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a (Suc n) = - 1 \<longrightarrow> xa (Suc n)) \<and> (a (Suc n) = 1 \<longrightarrow> \<not> xa (Suc n)) \<and> - 1 \<le> a (Suc n) \<and> a (Suc n) \<le> 1
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
a 0 = 0
\<forall>n. xa (Suc n) = (\<not> xa n)
\<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0

goal (2 subgoals):
 1. \<lbrakk>a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a 0 = - 1 \<longrightarrow> xa 0) \<and> (a 0 = 1 \<longrightarrow> \<not> xa 0) \<and> - 1 \<le> a 0 \<and> a 0 \<le> 1
 2. \<And>n. \<lbrakk>\<lbrakk>a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a n = - 1 \<longrightarrow> xa n) \<and> (a n = 1 \<longrightarrow> \<not> xa n) \<and> - 1 \<le> a n \<and> a n \<le> 1; a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a (Suc n) = - 1 \<longrightarrow> xa (Suc n)) \<and> (a (Suc n) = 1 \<longrightarrow> \<not> xa (Suc n)) \<and> - 1 \<le> a (Suc n) \<and> a (Suc n) \<le> 1
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a 0 = - 1 \<longrightarrow> xa 0) \<and> (a 0 = 1 \<longrightarrow> \<not> xa 0) \<and> - 1 \<le> a 0 \<and> a 0 \<le> 1
[PROOF STEP]
by (metis "0.prems"(1) le_minus_one_simps(1) minus_zero zero_le_one zero_neq_neg_one)
[PROOF STATE]
proof (state)
this:
(a 0 = - 1 \<longrightarrow> xa 0) \<and> (a 0 = 1 \<longrightarrow> \<not> xa 0) \<and> - 1 \<le> a 0 \<and> a 0 \<le> 1

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a n = - 1 \<longrightarrow> xa n) \<and> (a n = 1 \<longrightarrow> \<not> xa n) \<and> - 1 \<le> a n \<and> a n \<le> 1; a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a (Suc n) = - 1 \<longrightarrow> xa (Suc n)) \<and> (a (Suc n) = 1 \<longrightarrow> \<not> xa (Suc n)) \<and> - 1 \<le> a (Suc n) \<and> a (Suc n) \<le> 1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a n = - 1 \<longrightarrow> xa n) \<and> (a n = 1 \<longrightarrow> \<not> xa n) \<and> - 1 \<le> a n \<and> a n \<le> 1; a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a (Suc n) = - 1 \<longrightarrow> xa (Suc n)) \<and> (a (Suc n) = 1 \<longrightarrow> \<not> xa (Suc n)) \<and> - 1 \<le> a (Suc n) \<and> a (Suc n) \<le> 1
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
\<lbrakk>a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a n = - 1 \<longrightarrow> xa n) \<and> (a n = 1 \<longrightarrow> \<not> xa n) \<and> - 1 \<le> a n \<and> a n \<le> 1
a 0 = 0
\<forall>n. xa (Suc n) = (\<not> xa n)
\<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a n = - 1 \<longrightarrow> xa n) \<and> (a n = 1 \<longrightarrow> \<not> xa n) \<and> - 1 \<le> a n \<and> a n \<le> 1; a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a (Suc n) = - 1 \<longrightarrow> xa (Suc n)) \<and> (a (Suc n) = 1 \<longrightarrow> \<not> xa (Suc n)) \<and> - 1 \<le> a (Suc n) \<and> a (Suc n) \<le> 1
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
\<lbrakk>a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a n = - 1 \<longrightarrow> xa n) \<and> (a n = 1 \<longrightarrow> \<not> xa n) \<and> - 1 \<le> a n \<and> a n \<le> 1
a 0 = 0
\<forall>n. xa (Suc n) = (\<not> xa n)
\<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a n = - 1 \<longrightarrow> xa n) \<and> (a n = 1 \<longrightarrow> \<not> xa n) \<and> - 1 \<le> a n \<and> a n \<le> 1; a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a (Suc n) = - 1 \<longrightarrow> xa (Suc n)) \<and> (a (Suc n) = 1 \<longrightarrow> \<not> xa (Suc n)) \<and> - 1 \<le> a (Suc n) \<and> a (Suc n) \<le> 1
[PROOF STEP]
assume "a (Suc n) = - (1::int)"
[PROOF STATE]
proof (state)
this:
a (Suc n) = - 1

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a n = - 1 \<longrightarrow> xa n) \<and> (a n = 1 \<longrightarrow> \<not> xa n) \<and> - 1 \<le> a n \<and> a n \<le> 1; a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a (Suc n) = - 1 \<longrightarrow> xa (Suc n)) \<and> (a (Suc n) = 1 \<longrightarrow> \<not> xa (Suc n)) \<and> - 1 \<le> a (Suc n) \<and> a (Suc n) \<le> 1
[PROOF STEP]
from this and Suc
[PROOF STATE]
proof (chain)
picking this:
a (Suc n) = - 1
\<lbrakk>a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a n = - 1 \<longrightarrow> xa n) \<and> (a n = 1 \<longrightarrow> \<not> xa n) \<and> - 1 \<le> a n \<and> a n \<le> 1
a 0 = 0
\<forall>n. xa (Suc n) = (\<not> xa n)
\<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0
[PROOF STEP]
have "xa (Suc n)"
[PROOF STATE]
proof (prove)
using this:
a (Suc n) = - 1
\<lbrakk>a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a n = - 1 \<longrightarrow> xa n) \<and> (a n = 1 \<longrightarrow> \<not> xa n) \<and> - 1 \<le> a n \<and> a n \<le> 1
a 0 = 0
\<forall>n. xa (Suc n) = (\<not> xa n)
\<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0

goal (1 subgoal):
 1. xa (Suc n)
[PROOF STEP]
by (metis add.commute add_le_same_cancel2 not_one_le_zero zero_neq_neg_one)
[PROOF STATE]
proof (state)
this:
xa (Suc n)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a n = - 1 \<longrightarrow> xa n) \<and> (a n = 1 \<longrightarrow> \<not> xa n) \<and> - 1 \<le> a n \<and> a n \<le> 1; a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a (Suc n) = - 1 \<longrightarrow> xa (Suc n)) \<and> (a (Suc n) = 1 \<longrightarrow> \<not> xa (Suc n)) \<and> - 1 \<le> a (Suc n) \<and> a (Suc n) \<le> 1
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
a (Suc n) = - 1 \<Longrightarrow> xa (Suc n)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a n = - 1 \<longrightarrow> xa n) \<and> (a n = 1 \<longrightarrow> \<not> xa n) \<and> - 1 \<le> a n \<and> a n \<le> 1; a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a (Suc n) = - 1 \<longrightarrow> xa (Suc n)) \<and> (a (Suc n) = 1 \<longrightarrow> \<not> xa (Suc n)) \<and> - 1 \<le> a (Suc n) \<and> a (Suc n) \<le> 1
[PROOF STEP]
note A = this
[PROOF STATE]
proof (state)
this:
a (Suc n) = - 1 \<Longrightarrow> xa (Suc n)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a n = - 1 \<longrightarrow> xa n) \<and> (a n = 1 \<longrightarrow> \<not> xa n) \<and> - 1 \<le> a n \<and> a n \<le> 1; a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a (Suc n) = - 1 \<longrightarrow> xa (Suc n)) \<and> (a (Suc n) = 1 \<longrightarrow> \<not> xa (Suc n)) \<and> - 1 \<le> a (Suc n) \<and> a (Suc n) \<le> 1
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
a (Suc n) = - 1 \<Longrightarrow> xa (Suc n)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a n = - 1 \<longrightarrow> xa n) \<and> (a n = 1 \<longrightarrow> \<not> xa n) \<and> - 1 \<le> a n \<and> a n \<le> 1; a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a (Suc n) = - 1 \<longrightarrow> xa (Suc n)) \<and> (a (Suc n) = 1 \<longrightarrow> \<not> xa (Suc n)) \<and> - 1 \<le> a (Suc n) \<and> a (Suc n) \<le> 1
[PROOF STEP]
assume "a (Suc n) = (1::int)" and "xa (Suc n)"
[PROOF STATE]
proof (state)
this:
a (Suc n) = 1
xa (Suc n)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a n = - 1 \<longrightarrow> xa n) \<and> (a n = 1 \<longrightarrow> \<not> xa n) \<and> - 1 \<le> a n \<and> a n \<le> 1; a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a (Suc n) = - 1 \<longrightarrow> xa (Suc n)) \<and> (a (Suc n) = 1 \<longrightarrow> \<not> xa (Suc n)) \<and> - 1 \<le> a (Suc n) \<and> a (Suc n) \<le> 1
[PROOF STEP]
from this and Suc
[PROOF STATE]
proof (chain)
picking this:
a (Suc n) = 1
xa (Suc n)
\<lbrakk>a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a n = - 1 \<longrightarrow> xa n) \<and> (a n = 1 \<longrightarrow> \<not> xa n) \<and> - 1 \<le> a n \<and> a n \<le> 1
a 0 = 0
\<forall>n. xa (Suc n) = (\<not> xa n)
\<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0
[PROOF STEP]
have "False"
[PROOF STATE]
proof (prove)
using this:
a (Suc n) = 1
xa (Suc n)
\<lbrakk>a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a n = - 1 \<longrightarrow> xa n) \<and> (a n = 1 \<longrightarrow> \<not> xa n) \<and> - 1 \<le> a n \<and> a n \<le> 1
a 0 = 0
\<forall>n. xa (Suc n) = (\<not> xa n)
\<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0

goal (1 subgoal):
 1. False
[PROOF STEP]
by (metis eq_iff le_iff_diff_le_0 not_one_le_zero)
[PROOF STATE]
proof (state)
this:
False

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a n = - 1 \<longrightarrow> xa n) \<and> (a n = 1 \<longrightarrow> \<not> xa n) \<and> - 1 \<le> a n \<and> a n \<le> 1; a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a (Suc n) = - 1 \<longrightarrow> xa (Suc n)) \<and> (a (Suc n) = 1 \<longrightarrow> \<not> xa (Suc n)) \<and> - 1 \<le> a (Suc n) \<and> a (Suc n) \<le> 1
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>a (Suc n) = 1; xa (Suc n)\<rbrakk> \<Longrightarrow> False

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a n = - 1 \<longrightarrow> xa n) \<and> (a n = 1 \<longrightarrow> \<not> xa n) \<and> - 1 \<le> a n \<and> a n \<le> 1; a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a (Suc n) = - 1 \<longrightarrow> xa (Suc n)) \<and> (a (Suc n) = 1 \<longrightarrow> \<not> xa (Suc n)) \<and> - 1 \<le> a (Suc n) \<and> a (Suc n) \<le> 1
[PROOF STEP]
note B = this
[PROOF STATE]
proof (state)
this:
\<lbrakk>a (Suc n) = 1; xa (Suc n)\<rbrakk> \<Longrightarrow> False

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a n = - 1 \<longrightarrow> xa n) \<and> (a n = 1 \<longrightarrow> \<not> xa n) \<and> - 1 \<le> a n \<and> a n \<le> 1; a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a (Suc n) = - 1 \<longrightarrow> xa (Suc n)) \<and> (a (Suc n) = 1 \<longrightarrow> \<not> xa (Suc n)) \<and> - 1 \<le> a (Suc n) \<and> a (Suc n) \<le> 1
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
\<lbrakk>a (Suc n) = 1; xa (Suc n)\<rbrakk> \<Longrightarrow> False

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a n = - 1 \<longrightarrow> xa n) \<and> (a n = 1 \<longrightarrow> \<not> xa n) \<and> - 1 \<le> a n \<and> a n \<le> 1; a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a (Suc n) = - 1 \<longrightarrow> xa (Suc n)) \<and> (a (Suc n) = 1 \<longrightarrow> \<not> xa (Suc n)) \<and> - 1 \<le> a (Suc n) \<and> a (Suc n) \<le> 1
[PROOF STEP]
assume "a n \<noteq> - (1::int)"
[PROOF STATE]
proof (state)
this:
a n \<noteq> - 1

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a n = - 1 \<longrightarrow> xa n) \<and> (a n = 1 \<longrightarrow> \<not> xa n) \<and> - 1 \<le> a n \<and> a n \<le> 1; a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a (Suc n) = - 1 \<longrightarrow> xa (Suc n)) \<and> (a (Suc n) = 1 \<longrightarrow> \<not> xa (Suc n)) \<and> - 1 \<le> a (Suc n) \<and> a (Suc n) \<le> 1
[PROOF STEP]
from this and Suc
[PROOF STATE]
proof (chain)
picking this:
a n \<noteq> - 1
\<lbrakk>a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a n = - 1 \<longrightarrow> xa n) \<and> (a n = 1 \<longrightarrow> \<not> xa n) \<and> - 1 \<le> a n \<and> a n \<le> 1
a 0 = 0
\<forall>n. xa (Suc n) = (\<not> xa n)
\<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0
[PROOF STEP]
have " - (1::int) \<le> a (Suc n)"
[PROOF STATE]
proof (prove)
using this:
a n \<noteq> - 1
\<lbrakk>a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a n = - 1 \<longrightarrow> xa n) \<and> (a n = 1 \<longrightarrow> \<not> xa n) \<and> - 1 \<le> a n \<and> a n \<le> 1
a 0 = 0
\<forall>n. xa (Suc n) = (\<not> xa n)
\<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0

goal (1 subgoal):
 1. - 1 \<le> a (Suc n)
[PROOF STEP]
by (metis add.commute monoid_add_class.add.left_neutral le_less not_le right_minus uminus_add_conv_diff zle_add1_eq_le)
[PROOF STATE]
proof (state)
this:
- 1 \<le> a (Suc n)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a n = - 1 \<longrightarrow> xa n) \<and> (a n = 1 \<longrightarrow> \<not> xa n) \<and> - 1 \<le> a n \<and> a n \<le> 1; a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a (Suc n) = - 1 \<longrightarrow> xa (Suc n)) \<and> (a (Suc n) = 1 \<longrightarrow> \<not> xa (Suc n)) \<and> - 1 \<le> a (Suc n) \<and> a (Suc n) \<le> 1
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
a n \<noteq> - 1 \<Longrightarrow> - 1 \<le> a (Suc n)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a n = - 1 \<longrightarrow> xa n) \<and> (a n = 1 \<longrightarrow> \<not> xa n) \<and> - 1 \<le> a n \<and> a n \<le> 1; a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a (Suc n) = - 1 \<longrightarrow> xa (Suc n)) \<and> (a (Suc n) = 1 \<longrightarrow> \<not> xa (Suc n)) \<and> - 1 \<le> a (Suc n) \<and> a (Suc n) \<le> 1
[PROOF STEP]
note C = this
[PROOF STATE]
proof (state)
this:
a n \<noteq> - 1 \<Longrightarrow> - 1 \<le> a (Suc n)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a n = - 1 \<longrightarrow> xa n) \<and> (a n = 1 \<longrightarrow> \<not> xa n) \<and> - 1 \<le> a n \<and> a n \<le> 1; a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a (Suc n) = - 1 \<longrightarrow> xa (Suc n)) \<and> (a (Suc n) = 1 \<longrightarrow> \<not> xa (Suc n)) \<and> - 1 \<le> a (Suc n) \<and> a (Suc n) \<le> 1
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
a n \<noteq> - 1 \<Longrightarrow> - 1 \<le> a (Suc n)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a n = - 1 \<longrightarrow> xa n) \<and> (a n = 1 \<longrightarrow> \<not> xa n) \<and> - 1 \<le> a n \<and> a n \<le> 1; a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a (Suc n) = - 1 \<longrightarrow> xa (Suc n)) \<and> (a (Suc n) = 1 \<longrightarrow> \<not> xa (Suc n)) \<and> - 1 \<le> a (Suc n) \<and> a (Suc n) \<le> 1
[PROOF STEP]
assume "a n = - (1::int)"
[PROOF STATE]
proof (state)
this:
a n = - 1

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a n = - 1 \<longrightarrow> xa n) \<and> (a n = 1 \<longrightarrow> \<not> xa n) \<and> - 1 \<le> a n \<and> a n \<le> 1; a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a (Suc n) = - 1 \<longrightarrow> xa (Suc n)) \<and> (a (Suc n) = 1 \<longrightarrow> \<not> xa (Suc n)) \<and> - 1 \<le> a (Suc n) \<and> a (Suc n) \<le> 1
[PROOF STEP]
from this and Suc
[PROOF STATE]
proof (chain)
picking this:
a n = - 1
\<lbrakk>a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a n = - 1 \<longrightarrow> xa n) \<and> (a n = 1 \<longrightarrow> \<not> xa n) \<and> - 1 \<le> a n \<and> a n \<le> 1
a 0 = 0
\<forall>n. xa (Suc n) = (\<not> xa n)
\<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0
[PROOF STEP]
have " - (1::int) \<le> a (Suc n)"
[PROOF STATE]
proof (prove)
using this:
a n = - 1
\<lbrakk>a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a n = - 1 \<longrightarrow> xa n) \<and> (a n = 1 \<longrightarrow> \<not> xa n) \<and> - 1 \<le> a n \<and> a n \<le> 1
a 0 = 0
\<forall>n. xa (Suc n) = (\<not> xa n)
\<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0

goal (1 subgoal):
 1. - 1 \<le> a (Suc n)
[PROOF STEP]
by (metis add.commute le_minus_one_simps(4) monoid_add_class.add.right_neutral not_le right_minus zle_add1_eq_le)
[PROOF STATE]
proof (state)
this:
- 1 \<le> a (Suc n)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a n = - 1 \<longrightarrow> xa n) \<and> (a n = 1 \<longrightarrow> \<not> xa n) \<and> - 1 \<le> a n \<and> a n \<le> 1; a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a (Suc n) = - 1 \<longrightarrow> xa (Suc n)) \<and> (a (Suc n) = 1 \<longrightarrow> \<not> xa (Suc n)) \<and> - 1 \<le> a (Suc n) \<and> a (Suc n) \<le> 1
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
a n = - 1 \<Longrightarrow> - 1 \<le> a (Suc n)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a n = - 1 \<longrightarrow> xa n) \<and> (a n = 1 \<longrightarrow> \<not> xa n) \<and> - 1 \<le> a n \<and> a n \<le> 1; a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a (Suc n) = - 1 \<longrightarrow> xa (Suc n)) \<and> (a (Suc n) = 1 \<longrightarrow> \<not> xa (Suc n)) \<and> - 1 \<le> a (Suc n) \<and> a (Suc n) \<le> 1
[PROOF STEP]
note D = this
[PROOF STATE]
proof (state)
this:
a n = - 1 \<Longrightarrow> - 1 \<le> a (Suc n)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a n = - 1 \<longrightarrow> xa n) \<and> (a n = 1 \<longrightarrow> \<not> xa n) \<and> - 1 \<le> a n \<and> a n \<le> 1; a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a (Suc n) = - 1 \<longrightarrow> xa (Suc n)) \<and> (a (Suc n) = 1 \<longrightarrow> \<not> xa (Suc n)) \<and> - 1 \<le> a (Suc n) \<and> a (Suc n) \<le> 1
[PROOF STEP]
from C and D and Suc
[PROOF STATE]
proof (chain)
picking this:
a n \<noteq> - 1 \<Longrightarrow> - 1 \<le> a (Suc n)
a n = - 1 \<Longrightarrow> - 1 \<le> a (Suc n)
\<lbrakk>a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a n = - 1 \<longrightarrow> xa n) \<and> (a n = 1 \<longrightarrow> \<not> xa n) \<and> - 1 \<le> a n \<and> a n \<le> 1
a 0 = 0
\<forall>n. xa (Suc n) = (\<not> xa n)
\<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0
[PROOF STEP]
have  E: " - (1::int) \<le> a (Suc n)"
[PROOF STATE]
proof (prove)
using this:
a n \<noteq> - 1 \<Longrightarrow> - 1 \<le> a (Suc n)
a n = - 1 \<Longrightarrow> - 1 \<le> a (Suc n)
\<lbrakk>a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a n = - 1 \<longrightarrow> xa n) \<and> (a n = 1 \<longrightarrow> \<not> xa n) \<and> - 1 \<le> a n \<and> a n \<le> 1
a 0 = 0
\<forall>n. xa (Suc n) = (\<not> xa n)
\<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0

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

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a n = - 1 \<longrightarrow> xa n) \<and> (a n = 1 \<longrightarrow> \<not> xa n) \<and> - 1 \<le> a n \<and> a n \<le> 1; a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a (Suc n) = - 1 \<longrightarrow> xa (Suc n)) \<and> (a (Suc n) = 1 \<longrightarrow> \<not> xa (Suc n)) \<and> - 1 \<le> a (Suc n) \<and> a (Suc n) \<le> 1
[PROOF STEP]
from Suc
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a n = - 1 \<longrightarrow> xa n) \<and> (a n = 1 \<longrightarrow> \<not> xa n) \<and> - 1 \<le> a n \<and> a n \<le> 1
a 0 = 0
\<forall>n. xa (Suc n) = (\<not> xa n)
\<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0
[PROOF STEP]
have F: "a (Suc n) \<le> (1::int)"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a n = - 1 \<longrightarrow> xa n) \<and> (a n = 1 \<longrightarrow> \<not> xa n) \<and> - 1 \<le> a n \<and> a n \<le> 1
a 0 = 0
\<forall>n. xa (Suc n) = (\<not> xa n)
\<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0

goal (1 subgoal):
 1. a (Suc n) \<le> 1
[PROOF STEP]
by (metis eq_iff int_one_le_iff_zero_less le_iff_diff_le_0 le_less not_le zle_add1_eq_le)
[PROOF STATE]
proof (state)
this:
a (Suc n) \<le> 1

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a n = - 1 \<longrightarrow> xa n) \<and> (a n = 1 \<longrightarrow> \<not> xa n) \<and> - 1 \<le> a n \<and> a n \<le> 1; a 0 = 0; \<forall>n. xa (Suc n) = (\<not> xa n); \<forall>n. xa n \<and> a (Suc n) = a n + 1 \<or> \<not> xa n \<and> a (Suc n) = a n - 1 \<or> a (Suc n) = 0\<rbrakk> \<Longrightarrow> (a (Suc n) = - 1 \<longrightarrow> xa (Suc n)) \<and> (a (Suc n) = 1 \<longrightarrow> \<not> xa (Suc n)) \<and> - 1 \<le> a (Suc n) \<and> a (Suc n) \<le> 1
[PROOF STEP]
from A B E F
[PROOF STATE]
proof (chain)
picking this:
a (Suc n) = - 1 \<Longrightarrow> xa (Suc n)
\<lbrakk>a (Suc n) = 1; xa (Suc n)\<rbrakk> \<Longrightarrow> False
- 1 \<le> a (Suc n)
a (Suc n) \<le> 1
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
a (Suc n) = - 1 \<Longrightarrow> xa (Suc n)
\<lbrakk>a (Suc n) = 1; xa (Suc n)\<rbrakk> \<Longrightarrow> False
- 1 \<le> a (Suc n)
a (Suc n) \<le> 1

goal (1 subgoal):
 1. (a (Suc n) = - 1 \<longrightarrow> xa (Suc n)) \<and> (a (Suc n) = 1 \<longrightarrow> \<not> xa (Suc n)) \<and> - 1 \<le> a (Suc n) \<and> a (Suc n) \<le> 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(a (Suc n) = - 1 \<longrightarrow> xa (Suc n)) \<and> (a (Suc n) = 1 \<longrightarrow> \<not> xa (Suc n)) \<and> - 1 \<le> a (Suc n) \<and> a (Suc n) \<le> 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma VLambda_vunion: "(\<lambda>a\<in>\<^sub>\<circ>A \<union>\<^sub>\<circ> B. f a) = (\<lambda>a\<in>\<^sub>\<circ>A. f a) \<union>\<^sub>\<circ> (\<lambda>a\<in>\<^sub>\<circ>B. f a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. VLambda (A \<union>\<^sub>\<circ> B) f = VLambda A f \<union>\<^sub>\<circ> VLambda B f
[PROOF STEP]
by auto


[STATEMENT]
lemma lemma_2_6_20_a:
  "a l\<rightarrow> (b \<sqinter> c) = (a l\<rightarrow> b) \<sqinter> (a l\<rightarrow> c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a l\<rightarrow> b \<sqinter> c = (a l\<rightarrow> b) \<sqinter> (a l\<rightarrow> c)
[PROOF STEP]
apply (subgoal_tac "b \<sqinter> c \<in> infimum {x . x = b \<or> x = c}")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. b \<sqinter> c \<in> infimum {x. x = b \<or> x = c} \<Longrightarrow> a l\<rightarrow> b \<sqinter> c = (a l\<rightarrow> b) \<sqinter> (a l\<rightarrow> c)
 2. b \<sqinter> c \<in> infimum {x. x = b \<or> x = c}
[PROOF STEP]
apply (drule_tac b = a in lemma_2_6_20)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. a l\<rightarrow> b \<sqinter> c \<in> infimum ((l\<rightarrow>) a ` {x. x = b \<or> x = c}) \<Longrightarrow> a l\<rightarrow> b \<sqinter> c = (a l\<rightarrow> b) \<sqinter> (a l\<rightarrow> c)
 2. b \<sqinter> c \<in> infimum {x. x = b \<or> x = c}
[PROOF STEP]
apply (case_tac "((l\<rightarrow>) a) ` {x . ((x = b) \<or> (x = c))} = {x . x = a l\<rightarrow> b \<or> x = a l\<rightarrow> c}")
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>a l\<rightarrow> b \<sqinter> c \<in> infimum ((l\<rightarrow>) a ` {x. x = b \<or> x = c}); (l\<rightarrow>) a ` {x. x = b \<or> x = c} = {x. x = a l\<rightarrow> b \<or> x = a l\<rightarrow> c}\<rbrakk> \<Longrightarrow> a l\<rightarrow> b \<sqinter> c = (a l\<rightarrow> b) \<sqinter> (a l\<rightarrow> c)
 2. \<lbrakk>a l\<rightarrow> b \<sqinter> c \<in> infimum ((l\<rightarrow>) a ` {x. x = b \<or> x = c}); (l\<rightarrow>) a ` {x. x = b \<or> x = c} \<noteq> {x. x = a l\<rightarrow> b \<or> x = a l\<rightarrow> c}\<rbrakk> \<Longrightarrow> a l\<rightarrow> b \<sqinter> c = (a l\<rightarrow> b) \<sqinter> (a l\<rightarrow> c)
 3. b \<sqinter> c \<in> infimum {x. x = b \<or> x = c}
[PROOF STEP]
apply (simp_all add: infimum_pair)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a l\<rightarrow> b \<sqinter> c \<in> infimum ((l\<rightarrow>) a ` {x. x = b \<or> x = c}); (l\<rightarrow>) a ` {x. x = b \<or> x = c} \<noteq> {x. x = a l\<rightarrow> b \<or> x = a l\<rightarrow> c}\<rbrakk> \<Longrightarrow> a l\<rightarrow> b \<sqinter> c = (a l\<rightarrow> b) \<sqinter> (a l\<rightarrow> c)
[PROOF STEP]
by auto


[STATEMENT]
lemma poly_cutoff_1 [simp]: "poly_cutoff n 1 = (if n = 0 then 0 else 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_cutoff n 1 = (if n = 0 then 0 else 1)
[PROOF STEP]
by (simp add: poly_eq_iff coeff_poly_cutoff)


[STATEMENT]
lemma degree_of_sum_diff_degree:
  assumes "p \<in> carrier P"
  assumes "q \<in> carrier P"
  assumes "degree q < degree p"
  shows "degree (p \<oplus>\<^bsub>P\<^esub> q) = degree p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deg R (p \<oplus>\<^bsub>P\<^esub> q) = deg R p
[PROOF STEP]
by(rule equal_deg_sum', auto simp: assms)


[STATEMENT]
lemma length_cut_same: "length (cut_same x s) = (LEAST n. sdrop n s = sconst x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (cut_same x s) = (LEAST n. sdrop n s = sconst x)
[PROOF STEP]
unfolding cut_same_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (stake (LEAST n. sdrop n s = sconst x) s) = (LEAST n. sdrop n s = sconst x)
[PROOF STEP]
by simp


[STATEMENT]
lemma mult_vec_assoc: "(p ** q) ** r = p ** (q ** r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p ** q ** r = p ** (q ** r)
[PROOF STEP]
by (rule poly_mapping_eqI_proj, simp add: ac_simps term_simps)