[STATEMENT]
lemma cost_from_start:
  "R' start =
    (q * (r + p^Suc N * e + r * p * (1 - p^N) / (1 - p)) + (1 - q) * (r * Suc N)) /
    (1 - q + q * p^Suc N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R' start = (q * (r + p ^ Suc N * e + r * p * (1 - p ^ N) / (1 - p)) + (1 - q) * (r * real (Suc N))) / (1 - q + q * p ^ Suc N)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. R' start = (q * (r + p ^ Suc N * e + r * p * (1 - p ^ N) / (1 - p)) + (1 - q) * (r * real (Suc N))) / (1 - q + q * p ^ Suc N)
[PROOF STEP]
have ok_error: "R' ok = 0 \<and> R' error = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R' ok = 0 \<and> R' error = 0
[PROOF STEP]
unfolding R'_def R_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enn2real (integral\<^sup>N (T ok) (reward_until {error, ok} ok)) = 0 \<and> enn2real (integral\<^sup>N (T error) (reward_until {error, ok} error)) = 0
[PROOF STEP]
by (subst (1 2) reward_until_unfold[abs_def]) simp
[PROOF STATE]
proof (state)
this:
R' ok = 0 \<and> R' error = 0

goal (1 subgoal):
 1. R' start = (q * (r + p ^ Suc N * e + r * p * (1 - p ^ N) / (1 - p)) + (1 - q) * (r * real (Suc N))) / (1 - q + q * p ^ Suc N)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
R' ok = 0 \<and> R' error = 0
[PROOF STEP]
have R_start: "R' start = q * (r + R' (probe 0)) + (1 - q) * (r * (N + 1))"
[PROOF STATE]
proof (prove)
using this:
R' ok = 0 \<and> R' error = 0

goal (1 subgoal):
 1. R' start = q * (r + R' (probe 0)) + (1 - q) * (r * real (N + 1))
[PROOF STEP]
using q r
[PROOF STATE]
proof (prove)
using this:
R' ok = 0 \<and> R' error = 0
0 < q
q < 1
0 \<le> r

goal (1 subgoal):
 1. R' start = q * (r + R' (probe 0)) + (1 - q) * (r * real (N + 1))
[PROOF STEP]
by (subst R'_iter) (simp_all add: field_simps)
[PROOF STATE]
proof (state)
this:
R' start = q * (r + R' (probe 0)) + (1 - q) * (r * real (N + 1))

goal (1 subgoal):
 1. R' start = (q * (r + p ^ Suc N * e + r * p * (1 - p ^ N) / (1 - p)) + (1 - q) * (r * real (Suc N))) / (1 - q + q * p ^ Suc N)
[PROOF STEP]
have R_probe: "\<And>n. n < N \<Longrightarrow> R' (probe n) = p * R' (probe (Suc n)) + p * r + (1 - p) * R' start"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. n < N \<Longrightarrow> R' (probe n) = p * R' (probe (Suc n)) + p * r + (1 - p) * R' start
[PROOF STEP]
using p r
[PROOF STATE]
proof (prove)
using this:
0 < p
p < 1
0 \<le> r

goal (1 subgoal):
 1. \<And>n. n < N \<Longrightarrow> R' (probe n) = p * R' (probe (Suc n)) + p * r + (1 - p) * R' start
[PROOF STEP]
by (subst R'_iter) (simp_all add: field_simps distrib_right)
[PROOF STATE]
proof (state)
this:
?n1 < N \<Longrightarrow> R' (probe ?n1) = p * R' (probe (Suc ?n1)) + p * r + (1 - p) * R' start

goal (1 subgoal):
 1. R' start = (q * (r + p ^ Suc N * e + r * p * (1 - p ^ N) / (1 - p)) + (1 - q) * (r * real (Suc N))) / (1 - q + q * p ^ Suc N)
[PROOF STEP]
have R_N: "R' (probe N) = p * e + (1 - p) * R' start"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R' (probe N) = p * e + (1 - p) * R' start
[PROOF STEP]
using p e ok_error
[PROOF STATE]
proof (prove)
using this:
0 < p
p < 1
0 \<le> e
R' ok = 0 \<and> R' error = 0

goal (1 subgoal):
 1. R' (probe N) = p * e + (1 - p) * R' start
[PROOF STEP]
by (subst R'_iter) (auto simp: mult.commute )
[PROOF STATE]
proof (state)
this:
R' (probe N) = p * e + (1 - p) * R' start

goal (1 subgoal):
 1. R' start = (q * (r + p ^ Suc N * e + r * p * (1 - p ^ N) / (1 - p)) + (1 - q) * (r * real (Suc N))) / (1 - q + q * p ^ Suc N)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
R' (probe N) = p * e + (1 - p) * R' start

goal (1 subgoal):
 1. R' start = (q * (r + p ^ Suc N * e + r * p * (1 - p ^ N) / (1 - p)) + (1 - q) * (r * real (Suc N))) / (1 - q + q * p ^ Suc N)
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. R' start = (q * (r + p ^ Suc N * e + r * p * (1 - p ^ N) / (1 - p)) + (1 - q) * (r * real (Suc N))) / (1 - q + q * p ^ Suc N)
[PROOF STEP]
assume "n \<le> N"
[PROOF STATE]
proof (state)
this:
n \<le> N

goal (1 subgoal):
 1. R' start = (q * (r + p ^ Suc N * e + r * p * (1 - p ^ N) / (1 - p)) + (1 - q) * (r * real (Suc N))) / (1 - q + q * p ^ Suc N)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n \<le> N
[PROOF STEP]
have "R' (probe (N - n)) =
      p ^ Suc n * e + (1 - p^n) * r * p / (1 - p) + (1 - p^Suc n) * R' start"
[PROOF STATE]
proof (prove)
using this:
n \<le> N

goal (1 subgoal):
 1. R' (probe (N - n)) = p ^ Suc n * e + (1 - p ^ n) * r * p / (1 - p) + (1 - p ^ Suc n) * R' start
[PROOF STEP]
proof (induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 \<le> N \<Longrightarrow> R' (probe (N - 0)) = p ^ Suc 0 * e + (1 - p ^ 0) * r * p / (1 - p) + (1 - p ^ Suc 0) * R' start
 2. \<And>n. \<lbrakk>n \<le> N \<Longrightarrow> R' (probe (N - n)) = p ^ Suc n * e + (1 - p ^ n) * r * p / (1 - p) + (1 - p ^ Suc n) * R' start; Suc n \<le> N\<rbrakk> \<Longrightarrow> R' (probe (N - Suc n)) = p ^ Suc (Suc n) * e + (1 - p ^ Suc n) * r * p / (1 - p) + (1 - p ^ Suc (Suc n)) * R' start
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
0 \<le> N

goal (2 subgoals):
 1. 0 \<le> N \<Longrightarrow> R' (probe (N - 0)) = p ^ Suc 0 * e + (1 - p ^ 0) * r * p / (1 - p) + (1 - p ^ Suc 0) * R' start
 2. \<And>n. \<lbrakk>n \<le> N \<Longrightarrow> R' (probe (N - n)) = p ^ Suc n * e + (1 - p ^ n) * r * p / (1 - p) + (1 - p ^ Suc n) * R' start; Suc n \<le> N\<rbrakk> \<Longrightarrow> R' (probe (N - Suc n)) = p ^ Suc (Suc n) * e + (1 - p ^ Suc n) * r * p / (1 - p) + (1 - p ^ Suc (Suc n)) * R' start
[PROOF STEP]
with R_N
[PROOF STATE]
proof (chain)
picking this:
R' (probe N) = p * e + (1 - p) * R' start
0 \<le> N
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
R' (probe N) = p * e + (1 - p) * R' start
0 \<le> N

goal (1 subgoal):
 1. R' (probe (N - 0)) = p ^ Suc 0 * e + (1 - p ^ 0) * r * p / (1 - p) + (1 - p ^ Suc 0) * R' start
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
R' (probe (N - 0)) = p ^ Suc 0 * e + (1 - p ^ 0) * r * p / (1 - p) + (1 - p ^ Suc 0) * R' start

goal (1 subgoal):
 1. \<And>n. \<lbrakk>n \<le> N \<Longrightarrow> R' (probe (N - n)) = p ^ Suc n * e + (1 - p ^ n) * r * p / (1 - p) + (1 - p ^ Suc n) * R' start; Suc n \<le> N\<rbrakk> \<Longrightarrow> R' (probe (N - Suc n)) = p ^ Suc (Suc n) * e + (1 - p ^ Suc n) * r * p / (1 - p) + (1 - p ^ Suc (Suc n)) * R' start
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>n \<le> N \<Longrightarrow> R' (probe (N - n)) = p ^ Suc n * e + (1 - p ^ n) * r * p / (1 - p) + (1 - p ^ Suc n) * R' start; Suc n \<le> N\<rbrakk> \<Longrightarrow> R' (probe (N - Suc n)) = p ^ Suc (Suc n) * e + (1 - p ^ Suc n) * r * p / (1 - p) + (1 - p ^ Suc (Suc n)) * R' start
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
n \<le> N \<Longrightarrow> R' (probe (N - n)) = p ^ Suc n * e + (1 - p ^ n) * r * p / (1 - p) + (1 - p ^ Suc n) * R' start
Suc n \<le> N

goal (1 subgoal):
 1. \<And>n. \<lbrakk>n \<le> N \<Longrightarrow> R' (probe (N - n)) = p ^ Suc n * e + (1 - p ^ n) * r * p / (1 - p) + (1 - p ^ Suc n) * R' start; Suc n \<le> N\<rbrakk> \<Longrightarrow> R' (probe (N - Suc n)) = p ^ Suc (Suc n) * e + (1 - p ^ Suc n) * r * p / (1 - p) + (1 - p ^ Suc (Suc n)) * R' start
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
n \<le> N \<Longrightarrow> R' (probe (N - n)) = p ^ Suc n * e + (1 - p ^ n) * r * p / (1 - p) + (1 - p ^ Suc n) * R' start
Suc n \<le> N

goal (1 subgoal):
 1. \<And>n. \<lbrakk>n \<le> N \<Longrightarrow> R' (probe (N - n)) = p ^ Suc n * e + (1 - p ^ n) * r * p / (1 - p) + (1 - p ^ Suc n) * R' start; Suc n \<le> N\<rbrakk> \<Longrightarrow> R' (probe (N - Suc n)) = p ^ Suc (Suc n) * e + (1 - p ^ Suc n) * r * p / (1 - p) + (1 - p ^ Suc (Suc n)) * R' start
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n \<le> N \<Longrightarrow> R' (probe (N - n)) = p ^ Suc n * e + (1 - p ^ n) * r * p / (1 - p) + (1 - p ^ Suc n) * R' start
Suc n \<le> N
[PROOF STEP]
have "Suc (N - Suc n) = N - n"
[PROOF STATE]
proof (prove)
using this:
n \<le> N \<Longrightarrow> R' (probe (N - n)) = p ^ Suc n * e + (1 - p ^ n) * r * p / (1 - p) + (1 - p ^ Suc n) * R' start
Suc n \<le> N

goal (1 subgoal):
 1. Suc (N - Suc n) = N - n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Suc (N - Suc n) = N - n

goal (1 subgoal):
 1. \<And>n. \<lbrakk>n \<le> N \<Longrightarrow> R' (probe (N - n)) = p ^ Suc n * e + (1 - p ^ n) * r * p / (1 - p) + (1 - p ^ Suc n) * R' start; Suc n \<le> N\<rbrakk> \<Longrightarrow> R' (probe (N - Suc n)) = p ^ Suc (Suc n) * e + (1 - p ^ Suc n) * r * p / (1 - p) + (1 - p ^ Suc (Suc n)) * R' start
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
n \<le> N \<Longrightarrow> R' (probe (N - n)) = p ^ Suc n * e + (1 - p ^ n) * r * p / (1 - p) + (1 - p ^ Suc n) * R' start
Suc n \<le> N
Suc (N - Suc n) = N - n
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
n \<le> N \<Longrightarrow> R' (probe (N - n)) = p ^ Suc n * e + (1 - p ^ n) * r * p / (1 - p) + (1 - p ^ Suc n) * R' start
Suc n \<le> N
Suc (N - Suc n) = N - n

goal (1 subgoal):
 1. R' (probe (N - Suc n)) = p ^ Suc (Suc n) * e + (1 - p ^ Suc n) * r * p / (1 - p) + (1 - p ^ Suc (Suc n)) * R' start
[PROOF STEP]
using R_probe[of "N - Suc n"] p
[PROOF STATE]
proof (prove)
using this:
n \<le> N \<Longrightarrow> R' (probe (N - n)) = p ^ Suc n * e + (1 - p ^ n) * r * p / (1 - p) + (1 - p ^ Suc n) * R' start
Suc n \<le> N
Suc (N - Suc n) = N - n
N - Suc n < N \<Longrightarrow> R' (probe (N - Suc n)) = p * R' (probe (Suc (N - Suc n))) + p * r + (1 - p) * R' start
0 < p
p < 1

goal (1 subgoal):
 1. R' (probe (N - Suc n)) = p ^ Suc (Suc n) * e + (1 - p ^ Suc n) * r * p / (1 - p) + (1 - p ^ Suc (Suc n)) * R' start
[PROOF STEP]
by (simp_all add: field_simps Suc)
[PROOF STATE]
proof (state)
this:
R' (probe (N - Suc n)) = p ^ Suc (Suc n) * e + (1 - p ^ Suc n) * r * p / (1 - p) + (1 - p ^ Suc (Suc n)) * R' start

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
R' (probe (N - n)) = p ^ Suc n * e + (1 - p ^ n) * r * p / (1 - p) + (1 - p ^ Suc n) * R' start

goal (1 subgoal):
 1. R' start = (q * (r + p ^ Suc N * e + r * p * (1 - p ^ N) / (1 - p)) + (1 - q) * (r * real (Suc N))) / (1 - q + q * p ^ Suc N)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?n3 \<le> N \<Longrightarrow> R' (probe (N - ?n3)) = p ^ Suc ?n3 * e + (1 - p ^ ?n3) * r * p / (1 - p) + (1 - p ^ Suc ?n3) * R' start

goal (1 subgoal):
 1. R' start = (q * (r + p ^ Suc N * e + r * p * (1 - p ^ N) / (1 - p)) + (1 - q) * (r * real (Suc N))) / (1 - q + q * p ^ Suc N)
[PROOF STEP]
from this[of N]
[PROOF STATE]
proof (chain)
picking this:
N \<le> N \<Longrightarrow> R' (probe (N - N)) = p ^ Suc N * e + (1 - p ^ N) * r * p / (1 - p) + (1 - p ^ Suc N) * R' start
[PROOF STEP]
have [simp]: "R' (probe 0) = p ^ Suc N * e + (1 - p^N) * r * p / (1 - p) + (1 - p^Suc N) * R' start"
[PROOF STATE]
proof (prove)
using this:
N \<le> N \<Longrightarrow> R' (probe (N - N)) = p ^ Suc N * e + (1 - p ^ N) * r * p / (1 - p) + (1 - p ^ Suc N) * R' start

goal (1 subgoal):
 1. R' (probe 0) = p ^ Suc N * e + (1 - p ^ N) * r * p / (1 - p) + (1 - p ^ Suc N) * R' start
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
R' (probe 0) = p ^ Suc N * e + (1 - p ^ N) * r * p / (1 - p) + (1 - p ^ Suc N) * R' start

goal (1 subgoal):
 1. R' start = (q * (r + p ^ Suc N * e + r * p * (1 - p ^ N) / (1 - p)) + (1 - q) * (r * real (Suc N))) / (1 - q + q * p ^ Suc N)
[PROOF STEP]
have "R' start - q * (1 - p^Suc N) * R' start =
    q * (r + p^Suc N * e + (1 - p^N) * r * p / (1 - p)) + (1 - q) * (r * (N + 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R' start - q * (1 - p ^ Suc N) * R' start = q * (r + p ^ Suc N * e + (1 - p ^ N) * r * p / (1 - p)) + (1 - q) * (r * real (N + 1))
[PROOF STEP]
by (subst R_start) (simp_all add: field_simps)
[PROOF STATE]
proof (state)
this:
R' start - q * (1 - p ^ Suc N) * R' start = q * (r + p ^ Suc N * e + (1 - p ^ N) * r * p / (1 - p)) + (1 - q) * (r * real (N + 1))

goal (1 subgoal):
 1. R' start = (q * (r + p ^ Suc N * e + r * p * (1 - p ^ N) / (1 - p)) + (1 - q) * (r * real (Suc N))) / (1 - q + q * p ^ Suc N)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
R' start - q * (1 - p ^ Suc N) * R' start = q * (r + p ^ Suc N * e + (1 - p ^ N) * r * p / (1 - p)) + (1 - q) * (r * real (N + 1))
[PROOF STEP]
have "R' start = (q * (r + p^Suc N * e + (1 - p^N) * r * p / (1 - p)) + (1 - q) * (r * Suc N)) /
    (1 - q * (1 - p^Suc N))"
[PROOF STATE]
proof (prove)
using this:
R' start - q * (1 - p ^ Suc N) * R' start = q * (r + p ^ Suc N * e + (1 - p ^ N) * r * p / (1 - p)) + (1 - q) * (r * real (N + 1))

goal (1 subgoal):
 1. R' start = (q * (r + p ^ Suc N * e + (1 - p ^ N) * r * p / (1 - p)) + (1 - q) * (r * real (Suc N))) / (1 - q * (1 - p ^ Suc N))
[PROOF STEP]
using pos_neg_q_pn
[PROOF STATE]
proof (prove)
using this:
R' start - q * (1 - p ^ Suc N) * R' start = q * (r + p ^ Suc N * e + (1 - p ^ N) * r * p / (1 - p)) + (1 - q) * (r * real (N + 1))
0 < 1 - q * (1 - p ^ Suc N)

goal (1 subgoal):
 1. R' start = (q * (r + p ^ Suc N * e + (1 - p ^ N) * r * p / (1 - p)) + (1 - q) * (r * real (Suc N))) / (1 - q * (1 - p ^ Suc N))
[PROOF STEP]
by (simp_all add: field_simps)
[PROOF STATE]
proof (state)
this:
R' start = (q * (r + p ^ Suc N * e + (1 - p ^ N) * r * p / (1 - p)) + (1 - q) * (r * real (Suc N))) / (1 - q * (1 - p ^ Suc N))

goal (1 subgoal):
 1. R' start = (q * (r + p ^ Suc N * e + r * p * (1 - p ^ N) / (1 - p)) + (1 - q) * (r * real (Suc N))) / (1 - q + q * p ^ Suc N)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
R' start = (q * (r + p ^ Suc N * e + (1 - p ^ N) * r * p / (1 - p)) + (1 - q) * (r * real (Suc N))) / (1 - q * (1 - p ^ Suc N))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
R' start = (q * (r + p ^ Suc N * e + (1 - p ^ N) * r * p / (1 - p)) + (1 - q) * (r * real (Suc N))) / (1 - q * (1 - p ^ Suc N))

goal (1 subgoal):
 1. R' start = (q * (r + p ^ Suc N * e + r * p * (1 - p ^ N) / (1 - p)) + (1 - q) * (r * real (Suc N))) / (1 - q + q * p ^ Suc N)
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
R' start = (q * (r + p ^ Suc N * e + r * p * (1 - p ^ N) / (1 - p)) + (1 - q) * (r * real (Suc N))) / (1 - q + q * p ^ Suc N)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma complex_algebraic_numbers_are_algebraically_closed:
  assumes nc: "\<not> constant (poly p)"
    and alg: "Ball (set (coeffs p)) algebraic"
  shows "\<exists> z :: complex. algebraic z \<and> poly p z = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>z. algebraic z \<and> poly p z = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>z. algebraic z \<and> poly p z = 0
[PROOF STEP]
from fundamental_theorem_of_algebra[OF nc]
[PROOF STATE]
proof (chain)
picking this:
\<exists>z. poly p z = 0
[PROOF STEP]
obtain z where
    root: "poly p z = 0"
[PROOF STATE]
proof (prove)
using this:
\<exists>z. poly p z = 0

goal (1 subgoal):
 1. (\<And>z. poly p z = 0 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
poly p z = 0

goal (1 subgoal):
 1. \<exists>z. algebraic z \<and> poly p z = 0
[PROOF STEP]
from algebraic_representsI[OF representative_poly_complex[OF _ alg root]] nc root
[PROOF STATE]
proof (chain)
picking this:
p \<noteq> 0 \<Longrightarrow> algebraic z
\<not> constant (poly p)
poly p z = 0
[PROOF STEP]
have "algebraic z \<and> poly p z = 0"
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0 \<Longrightarrow> algebraic z
\<not> constant (poly p)
poly p z = 0

goal (1 subgoal):
 1. algebraic z \<and> poly p z = 0
[PROOF STEP]
using constant_degree degree_0
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0 \<Longrightarrow> algebraic z
\<not> constant (poly p)
poly p z = 0
constant (poly ?p) = (degree ?p = 0)
degree 0 = 0

goal (1 subgoal):
 1. algebraic z \<and> poly p z = 0
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
algebraic z \<and> poly p z = 0

goal (1 subgoal):
 1. \<exists>z. algebraic z \<and> poly p z = 0
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
algebraic z \<and> poly p z = 0

goal (1 subgoal):
 1. \<exists>z. algebraic z \<and> poly p z = 0
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<exists>z. algebraic z \<and> poly p z = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma already_in_lattice_subset:
  assumes fs: "set fs \<subseteq> carrier_vec n" and inlattice: "v \<in> lattice_of fs"
  and v: "v \<in> carrier_vec n"
  shows "lattice_of (v # fs) \<subseteq> lattice_of fs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lattice_of (v # fs) \<subseteq> lattice_of fs
[PROOF STEP]
proof (cases "v\<in>set fs")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. v \<in> set fs \<Longrightarrow> lattice_of (v # fs) \<subseteq> lattice_of fs
 2. v \<notin> set fs \<Longrightarrow> lattice_of (v # fs) \<subseteq> lattice_of fs
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
v \<in> set fs

goal (2 subgoals):
 1. v \<in> set fs \<Longrightarrow> lattice_of (v # fs) \<subseteq> lattice_of fs
 2. v \<notin> set fs \<Longrightarrow> lattice_of (v # fs) \<subseteq> lattice_of fs
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
v \<in> set fs
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
v \<in> set fs

goal (1 subgoal):
 1. lattice_of (v # fs) \<subseteq> lattice_of fs
[PROOF STEP]
by (metis fs lattice_is_monotone set_ConsD subset_code(1))
[PROOF STATE]
proof (state)
this:
lattice_of (v # fs) \<subseteq> lattice_of fs

goal (1 subgoal):
 1. v \<notin> set fs \<Longrightarrow> lattice_of (v # fs) \<subseteq> lattice_of fs
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. v \<notin> set fs \<Longrightarrow> lattice_of (v # fs) \<subseteq> lattice_of fs
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
v \<notin> set fs

goal (1 subgoal):
 1. v \<notin> set fs \<Longrightarrow> lattice_of (v # fs) \<subseteq> lattice_of fs
[PROOF STEP]
note v_notin_fs = False
[PROOF STATE]
proof (state)
this:
v \<notin> set fs

goal (1 subgoal):
 1. v \<notin> set fs \<Longrightarrow> lattice_of (v # fs) \<subseteq> lattice_of fs
[PROOF STEP]
obtain g where v_g: "lincomb g (set fs) = v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>g. lincomb g (set fs) = v \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using lattice_of_altdef_lincomb[OF fs] inlattice
[PROOF STATE]
proof (prove)
using this:
lattice_of fs = {y. \<exists>f. lincomb (of_int \<circ> f) (set fs) = y}
v \<in> lattice_of fs

goal (1 subgoal):
 1. (\<And>g. lincomb g (set fs) = v \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lincomb g (set fs) = v

goal (1 subgoal):
 1. v \<notin> set fs \<Longrightarrow> lattice_of (v # fs) \<subseteq> lattice_of fs
[PROOF STEP]
have v_fs: "set (v # fs) \<subseteq> carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (v # fs) \<subseteq> carrier_vec n
[PROOF STEP]
using v fs
[PROOF STATE]
proof (prove)
using this:
v \<in> carrier_vec n
set fs \<subseteq> carrier_vec n

goal (1 subgoal):
 1. set (v # fs) \<subseteq> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set (v # fs) \<subseteq> carrier_vec n

goal (1 subgoal):
 1. v \<notin> set fs \<Longrightarrow> lattice_of (v # fs) \<subseteq> lattice_of fs
[PROOF STEP]
have "\<exists>fa. lincomb fa (set fs) = lincomb f (insert v (set fs))" for f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>fa. lincomb fa (set fs) = lincomb f (insert v (set fs))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>fa. lincomb fa (set fs) = lincomb f (insert v (set fs))
[PROOF STEP]
have smult_rw: "f v \<cdot>\<^sub>v (lincomb g (set fs)) = lincomb (\<lambda>w. f v * g w) (set fs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f v \<cdot>\<^sub>v lincomb g (set fs) = lincomb (\<lambda>w. f v * g w) (set fs)
[PROOF STEP]
by (rule lincomb_smult[symmetric, OF fs])
[PROOF STATE]
proof (state)
this:
f v \<cdot>\<^sub>v lincomb g (set fs) = lincomb (\<lambda>w. f v * g w) (set fs)

goal (1 subgoal):
 1. \<exists>fa. lincomb fa (set fs) = lincomb f (insert v (set fs))
[PROOF STEP]
have "lincomb f (insert v (set fs)) =  f v \<cdot>\<^sub>v v + lincomb f (set fs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb f (insert v (set fs)) = f v \<cdot>\<^sub>v v + lincomb f (set fs)
[PROOF STEP]
by (rule lincomb_insert2[OF _ fs _ v_notin_fs v], auto)
[PROOF STATE]
proof (state)
this:
lincomb f (insert v (set fs)) = f v \<cdot>\<^sub>v v + lincomb f (set fs)

goal (1 subgoal):
 1. \<exists>fa. lincomb fa (set fs) = lincomb f (insert v (set fs))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lincomb f (insert v (set fs)) = f v \<cdot>\<^sub>v v + lincomb f (set fs)

goal (1 subgoal):
 1. \<exists>fa. lincomb fa (set fs) = lincomb f (insert v (set fs))
[PROOF STEP]
have "... = f v \<cdot>\<^sub>v (lincomb g (set fs)) + lincomb f (set fs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f v \<cdot>\<^sub>v v + lincomb f (set fs) = f v \<cdot>\<^sub>v lincomb g (set fs) + lincomb f (set fs)
[PROOF STEP]
using v_g
[PROOF STATE]
proof (prove)
using this:
lincomb g (set fs) = v

goal (1 subgoal):
 1. f v \<cdot>\<^sub>v v + lincomb f (set fs) = f v \<cdot>\<^sub>v lincomb g (set fs) + lincomb f (set fs)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f v \<cdot>\<^sub>v v + lincomb f (set fs) = f v \<cdot>\<^sub>v lincomb g (set fs) + lincomb f (set fs)

goal (1 subgoal):
 1. \<exists>fa. lincomb fa (set fs) = lincomb f (insert v (set fs))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f v \<cdot>\<^sub>v v + lincomb f (set fs) = f v \<cdot>\<^sub>v lincomb g (set fs) + lincomb f (set fs)

goal (1 subgoal):
 1. \<exists>fa. lincomb fa (set fs) = lincomb f (insert v (set fs))
[PROOF STEP]
have "... = lincomb (\<lambda>w. f v * g w) (set fs)  + lincomb f (set fs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f v \<cdot>\<^sub>v lincomb g (set fs) + lincomb f (set fs) = lincomb (\<lambda>w. f v * g w) (set fs) + lincomb f (set fs)
[PROOF STEP]
unfolding smult_rw
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb (\<lambda>w. f v * g w) (set fs) + lincomb f (set fs) = lincomb (\<lambda>w. f v * g w) (set fs) + lincomb f (set fs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f v \<cdot>\<^sub>v lincomb g (set fs) + lincomb f (set fs) = lincomb (\<lambda>w. f v * g w) (set fs) + lincomb f (set fs)

goal (1 subgoal):
 1. \<exists>fa. lincomb fa (set fs) = lincomb f (insert v (set fs))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f v \<cdot>\<^sub>v lincomb g (set fs) + lincomb f (set fs) = lincomb (\<lambda>w. f v * g w) (set fs) + lincomb f (set fs)

goal (1 subgoal):
 1. \<exists>fa. lincomb fa (set fs) = lincomb f (insert v (set fs))
[PROOF STEP]
have "... = lincomb (\<lambda>w. (\<lambda>w. f v * g w) w + f w) (set fs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb (\<lambda>w. f v * g w) (set fs) + lincomb f (set fs) = lincomb (\<lambda>w. f v * g w + f w) (set fs)
[PROOF STEP]
by (rule lincomb_sum[symmetric, OF _ fs], simp)
[PROOF STATE]
proof (state)
this:
lincomb (\<lambda>w. f v * g w) (set fs) + lincomb f (set fs) = lincomb (\<lambda>w. f v * g w + f w) (set fs)

goal (1 subgoal):
 1. \<exists>fa. lincomb fa (set fs) = lincomb f (insert v (set fs))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
lincomb f (insert v (set fs)) = lincomb (\<lambda>w. f v * g w + f w) (set fs)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
lincomb f (insert v (set fs)) = lincomb (\<lambda>w. f v * g w + f w) (set fs)

goal (1 subgoal):
 1. \<exists>fa. lincomb fa (set fs) = lincomb f (insert v (set fs))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>fa. lincomb fa (set fs) = lincomb f (insert v (set fs))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>fa. lincomb fa (set fs) = lincomb ?f1 (insert v (set fs))

goal (1 subgoal):
 1. v \<notin> set fs \<Longrightarrow> lattice_of (v # fs) \<subseteq> lattice_of fs
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>fa. lincomb fa (set fs) = lincomb ?f1 (insert v (set fs))

goal (1 subgoal):
 1. lattice_of (v # fs) \<subseteq> lattice_of fs
[PROOF STEP]
unfolding lattice_of_altdef_lincomb[OF v_fs] lattice_of_altdef_lincomb[OF fs]
[PROOF STATE]
proof (prove)
using this:
\<exists>fa. lincomb fa (set fs) = lincomb ?f1 (insert v (set fs))

goal (1 subgoal):
 1. {y. \<exists>f. lincomb (of_int \<circ> f) (set (v # fs)) = y} \<subseteq> {y. \<exists>f. lincomb (of_int \<circ> f) (set fs) = y}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lattice_of (v # fs) \<subseteq> lattice_of fs

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in cring)
  assumes "a \<in> carrier R" "b \<in> carrier R" "c \<in> carrier R"
  shows " (a \<oplus> b \<oplus> c) [^] (2::nat) =
    a [^] (2::nat) \<oplus> b [^] (2::nat) \<oplus> c [^] (2::nat) \<oplus> \<guillemotleft>2\<guillemotright> \<otimes> a \<otimes> b \<oplus> \<guillemotleft>2\<guillemotright> \<otimes> b \<otimes> c \<oplus> \<guillemotleft>2\<guillemotright> \<otimes> a \<otimes> c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<oplus> b \<oplus> c) [^] 2 = a [^] 2 \<oplus> b [^] 2 \<oplus> c [^] 2 \<oplus> \<guillemotleft>2\<guillemotright> \<otimes> a \<otimes> b \<oplus> \<guillemotleft>2\<guillemotright> \<otimes> b \<otimes> c \<oplus> \<guillemotleft>2\<guillemotright> \<otimes> a \<otimes> c
[PROOF STEP]
by ring


[STATEMENT]
lemma ennreal_SUP_sum:
  fixes f :: "'a \<Rightarrow> nat \<Rightarrow> ennreal"
  shows "(\<And>i. i \<in> I \<Longrightarrow> incseq (f i)) \<Longrightarrow> (SUP n. \<Sum>i\<in>I. f i n) = (\<Sum>i\<in>I. SUP n. f i n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. i \<in> I \<Longrightarrow> incseq (f i)) \<Longrightarrow> (SUP n. \<Sum>i\<in>I. f i n) = (\<Sum>i\<in>I. Sup (range (f i)))
[PROOF STEP]
unfolding incseq_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. i \<in> I \<Longrightarrow> \<forall>m n. m \<le> n \<longrightarrow> f i m \<le> f i n) \<Longrightarrow> (SUP n. \<Sum>i\<in>I. f i n) = (\<Sum>i\<in>I. Sup (range (f i)))
[PROOF STEP]
by transfer
     (simp add: SUP_ereal_sum incseq_def SUP_upper2 max_absorb2 sum_nonneg)


[STATEMENT]
lemma nu_fusion_1:
  assumes "galois l u"
      and "isotone h"
      and "has_greatest_postfixpoint g"
      and "has_greatest_fixpoint h"
      and "h (u (l (\<nu> h))) \<le> u (g (l (\<nu> h)))"
    shows "\<nu> h \<le> u (p\<nu> g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<nu> h \<le> u (p\<nu> g)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<nu> h \<le> u (p\<nu> g)
[PROOF STEP]
have "\<nu> h \<le> u (g (l (\<nu> h)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<nu> h \<le> u (g (l (\<nu> h)))
[PROOF STEP]
by (metis assms(1,2,4,5) order_trans galois_char isotone_def nu_unfold)
[PROOF STATE]
proof (state)
this:
\<nu> h \<le> u (g (l (\<nu> h)))

goal (1 subgoal):
 1. \<nu> h \<le> u (p\<nu> g)
[PROOF STEP]
thus "\<nu> h \<le> u (p\<nu> g)"
[PROOF STATE]
proof (prove)
using this:
\<nu> h \<le> u (g (l (\<nu> h)))

goal (1 subgoal):
 1. \<nu> h \<le> u (p\<nu> g)
[PROOF STEP]
by (metis assms(1,3) greatest_postfixpoint is_greatest_postfixpoint_def ord.galois_def)
[PROOF STATE]
proof (state)
this:
\<nu> h \<le> u (p\<nu> g)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Suc_0_lt_2p_len_of: "Suc 0 < 2 ^ LENGTH('a :: len)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc 0 < 2 ^ LENGTH('a)
[PROOF STEP]
by (metis One_nat_def len_gt_0 lessI numeral_2_eq_2 one_less_power)


[STATEMENT]
lemma ev_ex_nxt:
assumes "ev \<phi> xs"
shows "\<exists> n. (nxt ^^ n) \<phi> xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n. (nxt ^^ n) \<phi> xs
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
ev \<phi> xs

goal (1 subgoal):
 1. \<exists>n. (nxt ^^ n) \<phi> xs
[PROOF STEP]
proof induct
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>xs. \<phi> xs \<Longrightarrow> \<exists>n. (nxt ^^ n) \<phi> xs
 2. \<And>xs. \<lbrakk>ev \<phi> (stl xs); \<exists>n. (nxt ^^ n) \<phi> (stl xs)\<rbrakk> \<Longrightarrow> \<exists>n. (nxt ^^ n) \<phi> xs
[PROOF STEP]
case (base xs)
[PROOF STATE]
proof (state)
this:
\<phi> xs

goal (2 subgoals):
 1. \<And>xs. \<phi> xs \<Longrightarrow> \<exists>n. (nxt ^^ n) \<phi> xs
 2. \<And>xs. \<lbrakk>ev \<phi> (stl xs); \<exists>n. (nxt ^^ n) \<phi> (stl xs)\<rbrakk> \<Longrightarrow> \<exists>n. (nxt ^^ n) \<phi> xs
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
\<phi> xs

goal (1 subgoal):
 1. \<exists>n. (nxt ^^ n) \<phi> xs
[PROOF STEP]
by (intro exI[of _ 0]) auto
[PROOF STATE]
proof (state)
this:
\<exists>n. (nxt ^^ n) \<phi> xs

goal (1 subgoal):
 1. \<And>xs. \<lbrakk>ev \<phi> (stl xs); \<exists>n. (nxt ^^ n) \<phi> (stl xs)\<rbrakk> \<Longrightarrow> \<exists>n. (nxt ^^ n) \<phi> xs
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xs. \<lbrakk>ev \<phi> (stl xs); \<exists>n. (nxt ^^ n) \<phi> (stl xs)\<rbrakk> \<Longrightarrow> \<exists>n. (nxt ^^ n) \<phi> xs
[PROOF STEP]
case (step xs)
[PROOF STATE]
proof (state)
this:
ev \<phi> (stl xs)
\<exists>n. (nxt ^^ n) \<phi> (stl xs)

goal (1 subgoal):
 1. \<And>xs. \<lbrakk>ev \<phi> (stl xs); \<exists>n. (nxt ^^ n) \<phi> (stl xs)\<rbrakk> \<Longrightarrow> \<exists>n. (nxt ^^ n) \<phi> xs
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ev \<phi> (stl xs)
\<exists>n. (nxt ^^ n) \<phi> (stl xs)
[PROOF STEP]
obtain n where "(nxt ^^ n) \<phi> (stl xs)"
[PROOF STATE]
proof (prove)
using this:
ev \<phi> (stl xs)
\<exists>n. (nxt ^^ n) \<phi> (stl xs)

goal (1 subgoal):
 1. (\<And>n. (nxt ^^ n) \<phi> (stl xs) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(nxt ^^ n) \<phi> (stl xs)

goal (1 subgoal):
 1. \<And>xs. \<lbrakk>ev \<phi> (stl xs); \<exists>n. (nxt ^^ n) \<phi> (stl xs)\<rbrakk> \<Longrightarrow> \<exists>n. (nxt ^^ n) \<phi> xs
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
(nxt ^^ n) \<phi> (stl xs)

goal (1 subgoal):
 1. \<exists>n. (nxt ^^ n) \<phi> xs
[PROOF STEP]
by (intro exI[of _ "Suc n"]) (metis funpow.simps(2) nxt.simps o_def)
[PROOF STATE]
proof (state)
this:
\<exists>n. (nxt ^^ n) \<phi> xs

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem dual_join [intro?]: "dual (x \<squnion> y) = dual x \<sqinter> dual y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dual (x \<squnion> y) = dual x \<sqinter> dual y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dual (x \<squnion> y) = dual x \<sqinter> dual y
[PROOF STEP]
from is_sup_join
[PROOF STATE]
proof (chain)
picking this:
is_sup ?x ?y (?x \<squnion> ?y)
[PROOF STEP]
have "is_inf (dual x) (dual y) (dual (x \<squnion> y))"
[PROOF STATE]
proof (prove)
using this:
is_sup ?x ?y (?x \<squnion> ?y)

goal (1 subgoal):
 1. is_inf (dual x) (dual y) (dual (x \<squnion> y))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
is_inf (dual x) (dual y) (dual (x \<squnion> y))

goal (1 subgoal):
 1. dual (x \<squnion> y) = dual x \<sqinter> dual y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_inf (dual x) (dual y) (dual (x \<squnion> y))
[PROOF STEP]
have "dual x \<sqinter> dual y = dual (x \<squnion> y)"
[PROOF STATE]
proof (prove)
using this:
is_inf (dual x) (dual y) (dual (x \<squnion> y))

goal (1 subgoal):
 1. dual x \<sqinter> dual y = dual (x \<squnion> y)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
dual x \<sqinter> dual y = dual (x \<squnion> y)

goal (1 subgoal):
 1. dual (x \<squnion> y) = dual x \<sqinter> dual y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
dual x \<sqinter> dual y = dual (x \<squnion> y)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
dual x \<sqinter> dual y = dual (x \<squnion> y)

goal (1 subgoal):
 1. dual (x \<squnion> y) = dual x \<sqinter> dual y
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
dual (x \<squnion> y) = dual x \<sqinter> dual y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma closure_halfspace_lt [simp]:
  assumes "a \<noteq> 0"
    shows "closure {x. a \<bullet> x < b} = {x. a \<bullet> x \<le> b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure {x. a \<bullet> x < b} = {x. a \<bullet> x \<le> b}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. closure {x. a \<bullet> x < b} = {x. a \<bullet> x \<le> b}
[PROOF STEP]
have [simp]: "-{x. a \<bullet> x < b} = {x. a \<bullet> x \<ge> b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - {x. a \<bullet> x < b} = {x. b \<le> a \<bullet> x}
[PROOF STEP]
by (force simp:)
[PROOF STATE]
proof (state)
this:
- {x. a \<bullet> x < b} = {x. b \<le> a \<bullet> x}

goal (1 subgoal):
 1. closure {x. a \<bullet> x < b} = {x. a \<bullet> x \<le> b}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
- {x. a \<bullet> x < b} = {x. b \<le> a \<bullet> x}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
- {x. a \<bullet> x < b} = {x. b \<le> a \<bullet> x}

goal (1 subgoal):
 1. closure {x. a \<bullet> x < b} = {x. a \<bullet> x \<le> b}
[PROOF STEP]
using interior_halfspace_ge [of a b] assms
[PROOF STATE]
proof (prove)
using this:
- {x. a \<bullet> x < b} = {x. b \<le> a \<bullet> x}
a \<noteq> (0::'a) \<Longrightarrow> interior {x. b \<le> a \<bullet> x} = {x. b < a \<bullet> x}
a \<noteq> (0::'a)

goal (1 subgoal):
 1. closure {x. a \<bullet> x < b} = {x. a \<bullet> x \<le> b}
[PROOF STEP]
by (force simp: closure_interior)
[PROOF STATE]
proof (state)
this:
closure {x. a \<bullet> x < b} = {x. a \<bullet> x \<le> b}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lincomb_list_snoc[simp]:
  shows "set Vs \<subseteq> carrier_vec n \<Longrightarrow> x \<in> carrier_vec n \<Longrightarrow>
          lincomb_list f (Vs @ [x]) = lincomb_list f Vs + f (length Vs) \<cdot>\<^sub>v x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>set Vs \<subseteq> carrier_vec n; x \<in> carrier_vec n\<rbrakk> \<Longrightarrow> lincomb_list f (Vs @ [x]) = lincomb_list f Vs + f (length Vs) \<cdot>\<^sub>v x
[PROOF STEP]
using lincomb_list_append
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>set ?Ws \<subseteq> carrier_vec n; set ?Vs \<subseteq> carrier_vec n\<rbrakk> \<Longrightarrow> lincomb_list ?f (?Vs @ ?Ws) = lincomb_list ?f ?Vs + lincomb_list (\<lambda>i. ?f (i + length ?Vs)) ?Ws

goal (1 subgoal):
 1. \<lbrakk>set Vs \<subseteq> carrier_vec n; x \<in> carrier_vec n\<rbrakk> \<Longrightarrow> lincomb_list f (Vs @ [x]) = lincomb_list f Vs + f (length Vs) \<cdot>\<^sub>v x
[PROOF STEP]
by auto


[STATEMENT]
lemma list_all_map: "list_all f (map g l) = list_all (f \<circ> g) l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_all f (map g l) = list_all (f \<circ> g) l
[PROOF STEP]
unfolding comp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_all f (map g l) = list_all (\<lambda>x. f (g x)) l
[PROOF STEP]
by (simp add: list_all_length)


[STATEMENT]
lemma lm042:
  "omega pair = {fst pair} \<times> {{y}| y. y \<in> snd pair}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. omega pair = {fst pair} \<times> {{y} |y. y \<in> snd pair}
[PROOF STEP]
using finestpart_def finestPart
[PROOF STATE]
proof (prove)
using this:
finestpart ?X = (\<lambda>x. {x}) ` ?X
finestpart ?X = {{x} |x. x \<in> ?X}

goal (1 subgoal):
 1. omega pair = {fst pair} \<times> {{y} |y. y \<in> snd pair}
[PROOF STEP]
by auto


[STATEMENT]
lemma top_sorted_abs_mem:
  assumes "(top_sorted_abs R (h # l))" "(ListMem x l)"
  shows "(\<not> R x h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> R x h
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
top_sorted_abs R (h # l)
ListMem x l

goal (1 subgoal):
 1. \<not> R x h
[PROOF STEP]
by (auto simp add: ListMem_iff list.pred_set)


[STATEMENT]
lemma fls_X_inv_power_base_factor_to_fps: "fls_base_factor_to_fps (fls_X_inv ^ n) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_base_factor_to_fps (fls_X_inv ^ n) = 1
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fls_base_factor_to_fps (fls_X_inv ^ n) = 1
[PROOF STEP]
define iX where "iX \<equiv> fls_X_inv :: 'a::semiring_1 fls"
[PROOF STATE]
proof (state)
this:
iX \<equiv> fls_X_inv

goal (1 subgoal):
 1. fls_base_factor_to_fps (fls_X_inv ^ n) = 1
[PROOF STEP]
hence "fls_base_factor (iX ^ n) = 1"
[PROOF STATE]
proof (prove)
using this:
iX \<equiv> fls_X_inv

goal (1 subgoal):
 1. fls_base_factor (iX ^ n) = 1
[PROOF STEP]
using fls_X_inv_power_base_factor
[PROOF STATE]
proof (prove)
using this:
iX \<equiv> fls_X_inv
fls_base_factor (fls_X_inv ^ ?n) = 1

goal (1 subgoal):
 1. fls_base_factor (iX ^ n) = 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fls_base_factor (iX ^ n) = 1

goal (1 subgoal):
 1. fls_base_factor_to_fps (fls_X_inv ^ n) = 1
[PROOF STEP]
thus "fls_base_factor_to_fps (iX^n) = 1"
[PROOF STATE]
proof (prove)
using this:
fls_base_factor (iX ^ n) = 1

goal (1 subgoal):
 1. fls_base_factor_to_fps (iX ^ n) = 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fls_base_factor_to_fps (iX ^ n) = 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma closedin_diff[intro]:
  assumes oS: "closedin U S"
    and cT: "openin U T"
  shows "closedin U (S - T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closedin U (S - T)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. closedin U (S - T)
[PROOF STEP]
have "S - T = S \<inter> (topspace U - T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S - T = S \<inter> (topspace U - T)
[PROOF STEP]
using closedin_subset[of U S] oS cT
[PROOF STATE]
proof (prove)
using this:
closedin U S \<Longrightarrow> S \<subseteq> topspace U
closedin U S
openin U T

goal (1 subgoal):
 1. S - T = S \<inter> (topspace U - T)
[PROOF STEP]
by (auto simp: topspace_def)
[PROOF STATE]
proof (state)
this:
S - T = S \<inter> (topspace U - T)

goal (1 subgoal):
 1. closedin U (S - T)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
S - T = S \<inter> (topspace U - T)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
S - T = S \<inter> (topspace U - T)

goal (1 subgoal):
 1. closedin U (S - T)
[PROOF STEP]
using oS cT
[PROOF STATE]
proof (prove)
using this:
S - T = S \<inter> (topspace U - T)
closedin U S
openin U T

goal (1 subgoal):
 1. closedin U (S - T)
[PROOF STEP]
by (auto simp: openin_closedin_eq)
[PROOF STATE]
proof (state)
this:
closedin U (S - T)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma module_hom_eq_on_span: "f x = g x"
  if "module_hom s1 s2 f" "module_hom s1 s2 g"
  and "(\<And>x. x \<in> B \<Longrightarrow> f x = g x)" "x \<in> m1.span B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f x = g x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f x = g x
[PROOF STEP]
interpret module_hom s1 s2 "\<lambda>x. f x - g x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. module_hom s1 s2 (\<lambda>x. f x - g x)
[PROOF STEP]
by (rule module_hom_sub that)+
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f x = g x
[PROOF STEP]
from eq_0_on_span[OF _ that(4)] that(3)
[PROOF STATE]
proof (chain)
picking this:
(\<And>x. x \<in> B \<Longrightarrow> f x - g x = (0::'c)) \<Longrightarrow> f x - g x = (0::'c)
?x \<in> B \<Longrightarrow> f ?x = g ?x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<And>x. x \<in> B \<Longrightarrow> f x - g x = (0::'c)) \<Longrightarrow> f x - g x = (0::'c)
?x \<in> B \<Longrightarrow> f ?x = g ?x

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma basis_finite:
  fixes B :: "(real^'n) set"
  assumes "is_basis B"
  shows "finite B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite B
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite B
[PROOF STEP]
from independent_is_basis [of B] and \<open>is_basis B\<close>
[PROOF STATE]
proof (chain)
picking this:
(independent B \<and> card B = CARD('n)) = is_basis B
is_basis B
[PROOF STEP]
have "card B = CARD('n)"
[PROOF STATE]
proof (prove)
using this:
(independent B \<and> card B = CARD('n)) = is_basis B
is_basis B

goal (1 subgoal):
 1. card B = CARD('n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card B = CARD('n)

goal (1 subgoal):
 1. finite B
[PROOF STEP]
with card_finite [of B, where 'n = 'n]
[PROOF STATE]
proof (chain)
picking this:
card B = CARD('n) \<Longrightarrow> finite B
card B = CARD('n)
[PROOF STEP]
show "finite B"
[PROOF STATE]
proof (prove)
using this:
card B = CARD('n) \<Longrightarrow> finite B
card B = CARD('n)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dif_digit_formula:"a \<ge> b \<longrightarrow> (a - b)\<exclamdown>k = (a\<exclamdown>k + b\<exclamdown>k + bin_narry a b k) mod 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<le> a \<longrightarrow> (a - b) \<exclamdown> k = (a \<exclamdown> k + b \<exclamdown> k + bin_narry a b k) mod 2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. b \<le> a \<longrightarrow> (a - b) \<exclamdown> k = (a \<exclamdown> k + b \<exclamdown> k + bin_narry a b k) mod 2
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. b \<le> a \<longrightarrow> (a - b) \<exclamdown> k = (a \<exclamdown> k + b \<exclamdown> k + bin_narry a b k) mod 2
[PROOF STEP]
presume asm: "a\<ge>b" "a mod 2 ^ k < b mod 2 ^ k"
[PROOF STATE]
proof (state)
this:
b \<le> a
a mod 2 ^ k < b mod 2 ^ k

goal (1 subgoal):
 1. b \<le> a \<longrightarrow> (a - b) \<exclamdown> k = (a \<exclamdown> k + b \<exclamdown> k + bin_narry a b k) mod 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b \<le> a
a mod 2 ^ k < b mod 2 ^ k
[PROOF STEP]
have "Suc((a - b) div 2 ^ k) = a div 2 ^ k - b div 2 ^ k"
[PROOF STATE]
proof (prove)
using this:
b \<le> a
a mod 2 ^ k < b mod 2 ^ k

goal (1 subgoal):
 1. Suc ((a - b) div 2 ^ k) = a div 2 ^ k - b div 2 ^ k
[PROOF STEP]
by (smt Nat.add_diff_assoc One_nat_def Suc_pred add.commute diff_is_0_eq div_add_self1
          div_le_mono div_sub mod_add_self1 nat_le_linear neq0_conv plus_1_eq_Suc power_not_zero
          zero_neq_numeral)
[PROOF STATE]
proof (state)
this:
Suc ((a - b) div 2 ^ k) = a div 2 ^ k - b div 2 ^ k

goal (1 subgoal):
 1. b \<le> a \<longrightarrow> (a - b) \<exclamdown> k = (a \<exclamdown> k + b \<exclamdown> k + bin_narry a b k) mod 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Suc ((a - b) div 2 ^ k) = a div 2 ^ k - b div 2 ^ k
[PROOF STEP]
have "(a - b) div 2 ^ k mod 2 = Suc (a div 2 ^ k mod 2 + b div 2 ^ k mod 2) mod 2"
[PROOF STATE]
proof (prove)
using this:
Suc ((a - b) div 2 ^ k) = a div 2 ^ k - b div 2 ^ k

goal (1 subgoal):
 1. (a - b) div 2 ^ k mod 2 = Suc (a div 2 ^ k mod 2 + b div 2 ^ k mod 2) mod 2
[PROOF STEP]
by (smt diff_is_0_eq even_Suc even_diff_nat even_iff_mod_2_eq_zero le_less mod_add_eq
          nat.simps(3) not_mod_2_eq_1_eq_0)
[PROOF STATE]
proof (state)
this:
(a - b) div 2 ^ k mod 2 = Suc (a div 2 ^ k mod 2 + b div 2 ^ k mod 2) mod 2

goal (1 subgoal):
 1. b \<le> a \<longrightarrow> (a - b) \<exclamdown> k = (a \<exclamdown> k + b \<exclamdown> k + bin_narry a b k) mod 2
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>b \<le> a; a mod 2 ^ k < b mod 2 ^ k\<rbrakk> \<Longrightarrow> (a - b) div 2 ^ k mod 2 = Suc (a div 2 ^ k mod 2 + b div 2 ^ k mod 2) mod 2

goal (1 subgoal):
 1. b \<le> a \<longrightarrow> (a - b) \<exclamdown> k = (a \<exclamdown> k + b \<exclamdown> k + bin_narry a b k) mod 2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<lbrakk>b \<le> a; a mod 2 ^ k < b mod 2 ^ k\<rbrakk> \<Longrightarrow> (a - b) div 2 ^ k mod 2 = Suc (a div 2 ^ k mod 2 + b div 2 ^ k mod 2) mod 2

goal (1 subgoal):
 1. b \<le> a \<longrightarrow> (a - b) \<exclamdown> k = (a \<exclamdown> k + b \<exclamdown> k + bin_narry a b k) mod 2
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
\<lbrakk>b \<le> a; a mod 2 ^ k < b mod 2 ^ k\<rbrakk> \<Longrightarrow> (a - b) div 2 ^ k mod 2 = Suc (a div 2 ^ k mod 2 + b div 2 ^ k mod 2) mod 2

goal (1 subgoal):
 1. b \<le> a \<longrightarrow> (a - b) \<exclamdown> k = (a \<exclamdown> k + b \<exclamdown> k + bin_narry a b k) mod 2
[PROOF STEP]
presume asm2: "\<not> a mod 2 ^ k < b mod 2 ^ k" "b \<le> a"
[PROOF STATE]
proof (state)
this:
\<not> a mod 2 ^ k < b mod 2 ^ k
b \<le> a

goal (1 subgoal):
 1. b \<le> a \<longrightarrow> (a - b) \<exclamdown> k = (a \<exclamdown> k + b \<exclamdown> k + bin_narry a b k) mod 2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> a mod 2 ^ k < b mod 2 ^ k
b \<le> a
[PROOF STEP]
have "(a - b) div 2 ^ k mod 2 = (a div 2 ^ k mod 2 + b div 2 ^ k mod 2) mod 2"
[PROOF STATE]
proof (prove)
using this:
\<not> a mod 2 ^ k < b mod 2 ^ k
b \<le> a

goal (1 subgoal):
 1. (a - b) div 2 ^ k mod 2 = (a div 2 ^ k mod 2 + b div 2 ^ k mod 2) mod 2
[PROOF STEP]
using div_sub[of b "2^k" a] div_le_mono even_add even_iff_mod_2_eq_zero
        le_add_diff_inverse2[of "b div 2 ^ k" "a div 2 ^ k"] mod_mod_trivial[of _ 2]
        not_less[of "a mod 2 ^ k" "b mod 2 ^ k"] not_mod_2_eq_1_eq_0 div_sub
[PROOF STATE]
proof (prove)
using this:
\<not> a mod 2 ^ k < b mod 2 ^ k
b \<le> a
(b - 2 ^ k) div a = (if b mod a < 2 ^ k mod a then b div a - 2 ^ k div a - 1 else b div a - 2 ^ k div a)
?m \<le> ?n \<Longrightarrow> ?m div ?k \<le> ?n div ?k
even (?a + ?b) = (even ?a = even ?b)
even ?a = (?a mod (2::?'a) = (0::?'a))
b div 2 ^ k \<le> a div 2 ^ k \<Longrightarrow> a div 2 ^ k - b div 2 ^ k + b div 2 ^ k = a div 2 ^ k
?a mod (2::?'a1) mod (2::?'a1) = ?a mod (2::?'a1)
(\<not> a mod 2 ^ k < b mod 2 ^ k) = (b mod 2 ^ k \<le> a mod 2 ^ k)
(?a mod (2::?'a) \<noteq> (1::?'a)) = (?a mod (2::?'a) = (0::?'a))
(?a - ?b) div ?c = (if ?a mod ?c < ?b mod ?c then ?a div ?c - ?b div ?c - 1 else ?a div ?c - ?b div ?c)

goal (1 subgoal):
 1. (a - b) div 2 ^ k mod 2 = (a div 2 ^ k mod 2 + b div 2 ^ k mod 2) mod 2
[PROOF STEP]
by smt
[PROOF STATE]
proof (state)
this:
(a - b) div 2 ^ k mod 2 = (a div 2 ^ k mod 2 + b div 2 ^ k mod 2) mod 2

goal (1 subgoal):
 1. b \<le> a \<longrightarrow> (a - b) \<exclamdown> k = (a \<exclamdown> k + b \<exclamdown> k + bin_narry a b k) mod 2
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<not> a mod 2 ^ k < b mod 2 ^ k; b \<le> a\<rbrakk> \<Longrightarrow> (a - b) div 2 ^ k mod 2 = (a div 2 ^ k mod 2 + b div 2 ^ k mod 2) mod 2

goal (1 subgoal):
 1. b \<le> a \<longrightarrow> (a - b) \<exclamdown> k = (a \<exclamdown> k + b \<exclamdown> k + bin_narry a b k) mod 2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>b \<le> a; a mod 2 ^ k < b mod 2 ^ k\<rbrakk> \<Longrightarrow> (a - b) div 2 ^ k mod 2 = Suc (a div 2 ^ k mod 2 + b div 2 ^ k mod 2) mod 2
\<lbrakk>\<not> a mod 2 ^ k < b mod 2 ^ k; b \<le> a\<rbrakk> \<Longrightarrow> (a - b) div 2 ^ k mod 2 = (a div 2 ^ k mod 2 + b div 2 ^ k mod 2) mod 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>b \<le> a; a mod 2 ^ k < b mod 2 ^ k\<rbrakk> \<Longrightarrow> (a - b) div 2 ^ k mod 2 = Suc (a div 2 ^ k mod 2 + b div 2 ^ k mod 2) mod 2
\<lbrakk>\<not> a mod 2 ^ k < b mod 2 ^ k; b \<le> a\<rbrakk> \<Longrightarrow> (a - b) div 2 ^ k mod 2 = (a div 2 ^ k mod 2 + b div 2 ^ k mod 2) mod 2

goal (1 subgoal):
 1. b \<le> a \<longrightarrow> (a - b) \<exclamdown> k = (a \<exclamdown> k + b \<exclamdown> k + bin_narry a b k) mod 2
[PROOF STEP]
by (auto simp add: bin_narry_def nth_bit_def)
[PROOF STATE]
proof (state)
this:
b \<le> a \<longrightarrow> (a - b) \<exclamdown> k = (a \<exclamdown> k + b \<exclamdown> k + bin_narry a b k) mod 2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma of_rat_le_0_iff [simp]: "(of_rat r :: 'a::linordered_field) \<le> 0 \<longleftrightarrow> r \<le> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (of_rat r \<le> (0::'a)) = (r \<le> 0)
[PROOF STEP]
using of_rat_less_eq [of r 0, where 'a = 'a]
[PROOF STATE]
proof (prove)
using this:
(of_rat r \<le> of_rat 0) = (r \<le> 0)

goal (1 subgoal):
 1. (of_rat r \<le> (0::'a)) = (r \<le> 0)
[PROOF STEP]
by simp


[STATEMENT]
lemma n_bool_lists_correct: "set (n_bool_lists n x) = {xs. length xs = x \<and> count_list xs True = n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (n_bool_lists n x) = {xs. length xs = x \<and> count_list xs True = n}
[PROOF STEP]
proof(standard)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. set (n_bool_lists n x) \<subseteq> {xs. length xs = x \<and> count_list xs True = n}
 2. {xs. length xs = x \<and> count_list xs True = n} \<subseteq> set (n_bool_lists n x)
[PROOF STEP]
show "set (n_bool_lists n x) \<subseteq> {xs. length xs = x \<and> count_list xs True = n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (n_bool_lists n x) \<subseteq> {xs. length xs = x \<and> count_list xs True = n}
[PROOF STEP]
proof(cases x)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x = 0 \<Longrightarrow> set (n_bool_lists n x) \<subseteq> {xs. length xs = x \<and> count_list xs True = n}
 2. \<And>nat. x = Suc nat \<Longrightarrow> set (n_bool_lists n x) \<subseteq> {xs. length xs = x \<and> count_list xs True = n}
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
x = 0

goal (2 subgoals):
 1. x = 0 \<Longrightarrow> set (n_bool_lists n x) \<subseteq> {xs. length xs = x \<and> count_list xs True = n}
 2. \<And>nat. x = Suc nat \<Longrightarrow> set (n_bool_lists n x) \<subseteq> {xs. length xs = x \<and> count_list xs True = n}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x = 0

goal (1 subgoal):
 1. set (n_bool_lists n x) \<subseteq> {xs. length xs = x \<and> count_list xs True = n}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
set (n_bool_lists n x) \<subseteq> {xs. length xs = x \<and> count_list xs True = n}

goal (1 subgoal):
 1. \<And>nat. x = Suc nat \<Longrightarrow> set (n_bool_lists n x) \<subseteq> {xs. length xs = x \<and> count_list xs True = n}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>nat. x = Suc nat \<Longrightarrow> set (n_bool_lists n x) \<subseteq> {xs. length xs = x \<and> count_list xs True = n}
[PROOF STEP]
case (Suc x)
[PROOF STATE]
proof (state)
this:
x = Suc x

goal (1 subgoal):
 1. \<And>nat. x = Suc nat \<Longrightarrow> set (n_bool_lists n x) \<subseteq> {xs. length xs = x \<and> count_list xs True = n}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x = Suc x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x = Suc x

goal (1 subgoal):
 1. set (n_bool_lists n x) \<subseteq> {xs. length xs = x \<and> count_list xs True = n}
[PROOF STEP]
using n_bool_lists_True_count n_bool_lists_length
[PROOF STATE]
proof (prove)
using this:
x = Suc x
?xs \<in> set (n_bool_lists ?n ?x) \<Longrightarrow> count_list ?xs True = ?n
?xs \<in> set (n_bool_lists ?n ?x) \<Longrightarrow> length ?xs = ?x

goal (1 subgoal):
 1. set (n_bool_lists n x) \<subseteq> {xs. length xs = x \<and> count_list xs True = n}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
set (n_bool_lists n x) \<subseteq> {xs. length xs = x \<and> count_list xs True = n}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
set (n_bool_lists n x) \<subseteq> {xs. length xs = x \<and> count_list xs True = n}

goal (1 subgoal):
 1. {xs. length xs = x \<and> count_list xs True = n} \<subseteq> set (n_bool_lists n x)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {xs. length xs = x \<and> count_list xs True = n} \<subseteq> set (n_bool_lists n x)
[PROOF STEP]
show "{xs. length xs = x \<and> count_list xs True = n} \<subseteq> set (n_bool_lists n x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {xs. length xs = x \<and> count_list xs True = n} \<subseteq> set (n_bool_lists n x)
[PROOF STEP]
using n_bool_lists_correct_aux
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>length ?xs = ?x; count_list ?xs True = ?n\<rbrakk> \<Longrightarrow> ?xs \<in> set (n_bool_lists ?n ?x)

goal (1 subgoal):
 1. {xs. length xs = x \<and> count_list xs True = n} \<subseteq> set (n_bool_lists n x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{xs. length xs = x \<and> count_list xs True = n} \<subseteq> set (n_bool_lists n x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma singleton_set_union:
 "(\<Union>Y \<in> singleton_set X. Y) = X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>Y\<in>singleton_set X. Y) = X
[PROOF STEP]
proof (subst singleton_set_def, rule equalityI, rule_tac [!] subsetI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> (\<Union>Y\<in>{Y. \<exists>x\<in>X. Y = {x}}. Y) \<Longrightarrow> x \<in> X
 2. \<And>x. x \<in> X \<Longrightarrow> x \<in> (\<Union>Y\<in>{Y. \<exists>x\<in>X. Y = {x}}. Y)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> (\<Union>Y\<in>{Y. \<exists>x\<in>X. Y = {x}}. Y) \<Longrightarrow> x \<in> X
 2. \<And>x. x \<in> X \<Longrightarrow> x \<in> (\<Union>Y\<in>{Y. \<exists>x\<in>X. Y = {x}}. Y)
[PROOF STEP]
assume A: "x \<in> (\<Union>Y \<in> {Y'. \<exists>x' \<in> X. Y' = {x'}}. Y)"
[PROOF STATE]
proof (state)
this:
x \<in> (\<Union>Y\<in>{Y'. \<exists>x'\<in>X. Y' = {x'}}. Y)

goal (2 subgoals):
 1. \<And>x. x \<in> (\<Union>Y\<in>{Y. \<exists>x\<in>X. Y = {x}}. Y) \<Longrightarrow> x \<in> X
 2. \<And>x. x \<in> X \<Longrightarrow> x \<in> (\<Union>Y\<in>{Y. \<exists>x\<in>X. Y = {x}}. Y)
[PROOF STEP]
show "x \<in> X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> X
[PROOF STEP]
proof (rule UN_E [OF A], simp)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. \<lbrakk>\<exists>x'\<in>X. xa = {x'}; x \<in> xa\<rbrakk> \<Longrightarrow> x \<in> X
[PROOF STEP]
qed (erule bexE, simp)
[PROOF STATE]
proof (state)
this:
x \<in> X

goal (1 subgoal):
 1. \<And>x. x \<in> X \<Longrightarrow> x \<in> (\<Union>Y\<in>{Y. \<exists>x\<in>X. Y = {x}}. Y)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> X \<Longrightarrow> x \<in> (\<Union>Y\<in>{Y. \<exists>x\<in>X. Y = {x}}. Y)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> X \<Longrightarrow> x \<in> (\<Union>Y\<in>{Y. \<exists>x\<in>X. Y = {x}}. Y)
[PROOF STEP]
assume A: "x \<in> X"
[PROOF STATE]
proof (state)
this:
x \<in> X

goal (1 subgoal):
 1. \<And>x. x \<in> X \<Longrightarrow> x \<in> (\<Union>Y\<in>{Y. \<exists>x\<in>X. Y = {x}}. Y)
[PROOF STEP]
show "x \<in> (\<Union>Y \<in> {Y'. \<exists>x' \<in> X. Y' = {x'}}. Y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> (\<Union>Y\<in>{Y'. \<exists>x'\<in>X. Y' = {x'}}. Y)
[PROOF STEP]
proof (rule UN_I [of "{x}"])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {x} \<in> {Y'. \<exists>x'\<in>X. Y' = {x'}}
 2. x \<in> {x}
[PROOF STEP]
qed (simp_all add: A)
[PROOF STATE]
proof (state)
this:
x \<in> (\<Union>Y\<in>{Y'. \<exists>x'\<in>X. Y' = {x'}}. Y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma image_filter_cong:
  assumes \<open>\<And>C. C \<in># M \<Longrightarrow> P C \<Longrightarrow> f C = g C\<close>
  shows \<open>{#f C. C \<in># {#C \<in># M. P C#}#} = {#g C | C\<in># M. P C#}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. image_mset f (filter_mset P M) = image_mset g (filter_mset P M)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?C \<in># M; P ?C\<rbrakk> \<Longrightarrow> f ?C = g ?C

goal (1 subgoal):
 1. image_mset f (filter_mset P M) = image_mset g (filter_mset P M)
[PROOF STEP]
by (induction M) auto


[STATEMENT]
lemma compute_mod_twopow[code]:
  "mod_twopow x n = (if n = 0 then 0 else x mod 2 + 2 * mod_twopow (x div 2) (n - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mod_twopow x n = (if n = 0 then 0 else x mod 2 + 2 * mod_twopow (x div 2) (n - 1))
[PROOF STEP]
by (cases n) (auto simp: zmod_zmult2_eq)


[STATEMENT]
lemma from_list_correct: "get (from_list xs) = map_of xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. get (from_list xs) = map_of xs
[PROOF STEP]
proof (induction xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. get (from_list []) = map_of []
 2. \<And>a xs. get (from_list xs) = map_of xs \<Longrightarrow> get (from_list (a # xs)) = map_of (a # xs)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. get (from_list []) = map_of []
 2. \<And>a xs. get (from_list xs) = map_of xs \<Longrightarrow> get (from_list (a # xs)) = map_of (a # xs)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. get (from_list []) = map_of []
[PROOF STEP]
using get_empty
[PROOF STATE]
proof (prove)
using this:
get empty ?x = None

goal (1 subgoal):
 1. get (from_list []) = map_of []
[PROOF STEP]
by (simp add: from_list_def)
[PROOF STATE]
proof (state)
this:
get (from_list []) = map_of []

goal (1 subgoal):
 1. \<And>a xs. get (from_list xs) = map_of xs \<Longrightarrow> get (from_list (a # xs)) = map_of (a # xs)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a xs. get (from_list xs) = map_of xs \<Longrightarrow> get (from_list (a # xs)) = map_of (a # xs)
[PROOF STEP]
case (Cons x xs)
[PROOF STATE]
proof (state)
this:
get (from_list xs) = map_of xs

goal (1 subgoal):
 1. \<And>a xs. get (from_list xs) = map_of xs \<Longrightarrow> get (from_list (a # xs)) = map_of (a # xs)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. get (from_list (x # xs)) = map_of (x # xs)
[PROOF STEP]
using get_add_eq get_add_neq Cons.IH
[PROOF STATE]
proof (prove)
using this:
get (add ?e ?x ?v) ?x = Some ?v
?x \<noteq> ?y \<Longrightarrow> get (add ?e ?x ?v) ?y = get ?e ?y
get (from_list xs) = map_of xs

goal (1 subgoal):
 1. get (from_list (x # xs)) = map_of (x # xs)
[PROOF STEP]
by (auto simp: from_list_def)
[PROOF STATE]
proof (state)
this:
get (from_list (x # xs)) = map_of (x # xs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma affine_independent_span_eq:
  fixes S :: "'a::euclidean_space set"
  assumes "\<not> affine_dependent S" "card S = Suc (DIM ('a))"
    shows "affine hull S = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. affine hull S = UNIV
[PROOF STEP]
proof (cases "S = {}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. S = {} \<Longrightarrow> affine hull S = UNIV
 2. S \<noteq> {} \<Longrightarrow> affine hull S = UNIV
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
S = {}

goal (2 subgoals):
 1. S = {} \<Longrightarrow> affine hull S = UNIV
 2. S \<noteq> {} \<Longrightarrow> affine hull S = UNIV
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
S = {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
S = {}

goal (1 subgoal):
 1. affine hull S = UNIV
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
S = {}
\<not> affine_dependent S
card S = Suc DIM('a)

goal (1 subgoal):
 1. affine hull S = UNIV
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
affine hull S = UNIV

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> affine hull S = UNIV
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> affine hull S = UNIV
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
S \<noteq> {}

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> affine hull S = UNIV
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
S \<noteq> {}
[PROOF STEP]
obtain a T where T: "a \<notin> T" "S = insert a T"
[PROOF STATE]
proof (prove)
using this:
S \<noteq> {}

goal (1 subgoal):
 1. (\<And>a T. \<lbrakk>a \<notin> T; S = insert a T\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
a \<notin> T
S = insert a T

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> affine hull S = UNIV
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<notin> T
S = insert a T
[PROOF STEP]
have fin: "finite T"
[PROOF STATE]
proof (prove)
using this:
a \<notin> T
S = insert a T

goal (1 subgoal):
 1. finite T
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<notin> T
S = insert a T
\<not> affine_dependent S
card S = Suc DIM('a)

goal (1 subgoal):
 1. finite T
[PROOF STEP]
by (metis finite_insert aff_independent_finite)
[PROOF STATE]
proof (state)
this:
finite T

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> affine hull S = UNIV
[PROOF STEP]
have "UNIV \<subseteq> (+) a ` span ((\<lambda>x. x - a) ` T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. UNIV \<subseteq> (+) a ` span ((\<lambda>x. x - a) ` T)
[PROOF STEP]
proof (intro card_ge_dim_independent Fun.vimage_subsetD)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. surj ((+) a)
 2. (\<lambda>x. x - a) ` T \<subseteq> (+) a -` UNIV
 3. independent ((\<lambda>x. x - a) ` T)
 4. dim ((+) a -` UNIV) \<le> card ((\<lambda>x. x - a) ` T)
[PROOF STEP]
show "independent ((\<lambda>x. x - a) ` T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. independent ((\<lambda>x. x - a) ` T)
[PROOF STEP]
using T affine_dependent_iff_dependent assms(1)
[PROOF STATE]
proof (prove)
using this:
a \<notin> T
S = insert a T
?a \<notin> ?S \<Longrightarrow> affine_dependent (insert ?a ?S) = dependent ((+) (- ?a) ` ?S)
\<not> affine_dependent S

goal (1 subgoal):
 1. independent ((\<lambda>x. x - a) ` T)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
independent ((\<lambda>x. x - a) ` T)

goal (3 subgoals):
 1. surj ((+) a)
 2. (\<lambda>x. x - a) ` T \<subseteq> (+) a -` UNIV
 3. dim ((+) a -` UNIV) \<le> card ((\<lambda>x. x - a) ` T)
[PROOF STEP]
show "dim ((+) a -` UNIV) \<le> card ((\<lambda>x. x - a) ` T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim ((+) a -` UNIV) \<le> card ((\<lambda>x. x - a) ` T)
[PROOF STEP]
using assms T fin
[PROOF STATE]
proof (prove)
using this:
\<not> affine_dependent S
card S = Suc DIM('a)
a \<notin> T
S = insert a T
finite T

goal (1 subgoal):
 1. dim ((+) a -` UNIV) \<le> card ((\<lambda>x. x - a) ` T)
[PROOF STEP]
by (auto simp: card_image inj_on_def)
[PROOF STATE]
proof (state)
this:
dim ((+) a -` UNIV) \<le> card ((\<lambda>x. x - a) ` T)

goal (2 subgoals):
 1. surj ((+) a)
 2. (\<lambda>x. x - a) ` T \<subseteq> (+) a -` UNIV
[PROOF STEP]
qed (use surj_plus in auto)
[PROOF STATE]
proof (state)
this:
UNIV \<subseteq> (+) a ` span ((\<lambda>x. x - a) ` T)

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> affine hull S = UNIV
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
UNIV \<subseteq> (+) a ` span ((\<lambda>x. x - a) ` T)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
UNIV \<subseteq> (+) a ` span ((\<lambda>x. x - a) ` T)

goal (1 subgoal):
 1. affine hull S = UNIV
[PROOF STEP]
using T(2) affine_hull_insert_span_gen equalityI
[PROOF STATE]
proof (prove)
using this:
UNIV \<subseteq> (+) a ` span ((\<lambda>x. x - a) ` T)
S = insert a T
affine hull insert ?a ?s = (+) ?a ` span ((+) (- ?a) ` ?s)
\<lbrakk>?A \<subseteq> ?B; ?B \<subseteq> ?A\<rbrakk> \<Longrightarrow> ?A = ?B

goal (1 subgoal):
 1. affine hull S = UNIV
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
affine hull S = UNIV

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma deg_eqI:
  "[| \<And>m. n < m \<Longrightarrow> coeff P p m = \<zero>;
      \<And>n. n \<noteq> 0 \<Longrightarrow> coeff P p n \<noteq> \<zero>; p \<in> carrier P |] ==> deg R p = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>m. n < m \<Longrightarrow> coeff P p m = \<zero>; \<And>n. n \<noteq> 0 \<Longrightarrow> coeff P p n \<noteq> \<zero>; p \<in> carrier P\<rbrakk> \<Longrightarrow> deg R p = n
[PROOF STEP]
by (fast intro: le_antisym deg_aboveI deg_belowI)


[STATEMENT]
lemma iter_tensor_suc:
  fixes n
  assumes "n \<ge> 1"
  shows " A \<otimes>\<^bsup>(Suc n)\<^esup> = A \<Otimes> (A \<otimes>\<^bsup>n\<^esup>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<otimes>\<^bsup>Suc n\<^esup> = A \<Otimes> A \<otimes>\<^bsup>n\<^esup>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
1 \<le> n

goal (1 subgoal):
 1. A \<otimes>\<^bsup>Suc n\<^esup> = A \<Otimes> A \<otimes>\<^bsup>n\<^esup>
[PROOF STEP]
by (metis Deutsch_Jozsa.iter_tensor.simps(2) One_nat_def Suc_le_D)


[STATEMENT]
lemma param_array_set[param]:
  "(array_set,array_set)\<in>\<langle>R\<rangle>array_rel\<rightarrow>nat_rel\<rightarrow>R\<rightarrow>\<langle>R\<rangle>array_rel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (array_set, array_set) \<in> \<langle>R\<rangle>array_rel \<rightarrow> nat_rel \<rightarrow> R \<rightarrow> \<langle>R\<rangle>array_rel
[PROOF STEP]
unfolding array_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (rec_array (\<lambda>A n a. Array (A[n := a])), rec_array (\<lambda>A n a. Array (A[n := a]))) \<in> \<langle>R\<rangle>array_rel \<rightarrow> nat_rel \<rightarrow> R \<rightarrow> \<langle>R\<rangle>array_rel
[PROOF STEP]
by parametricity


[STATEMENT]
lemma vector_7 [simp]:
 "(vector [x1,x2,x3,x4,x5,x6,x7] ::('a::zero)^7)$1 = x1"
 "(vector [x1,x2,x3,x4,x5,x6,x7] ::('a::zero)^7)$2 = x2"
 "(vector [x1,x2,x3,x4,x5,x6,x7] ::('a::zero)^7)$3 = x3"
 "(vector [x1,x2,x3,x4,x5,x6,x7] ::('a::zero)^7)$4 = x4"
 "(vector [x1,x2,x3,x4,x5,x6,x7] ::('a::zero)^7)$5 = x5"
 "(vector [x1,x2,x3,x4,x5,x6,x7] ::('a::zero)^7)$6 = x6"
 "(vector [x1,x2,x3,x4,x5,x6,x7] ::('a::zero)^7)$7 = x7"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (vector [x1, x2, x3, x4, x5, x6, x7] $ 1 = x1 &&& vector [x1, x2, x3, x4, x5, x6, x7] $ 2 = x2 &&& vector [x1, x2, x3, x4, x5, x6, x7] $ 3 = x3) &&& (vector [x1, x2, x3, x4, x5, x6, x7] $ 4 = x4 &&& vector [x1, x2, x3, x4, x5, x6, x7] $ 5 = x5) &&& vector [x1, x2, x3, x4, x5, x6, x7] $ 6 = x6 &&& vector [x1, x2, x3, x4, x5, x6, x7] $ 7 = x7
[PROOF STEP]
unfolding vector_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (vec_lambda (foldr (\<lambda>x f n. (f (n + 1))(n := x)) [x1, x2, x3, x4, x5, x6, x7] (\<lambda>n x. 0::'a) 1) $ 1 = x1 &&& vec_lambda (foldr (\<lambda>x f n. (f (n + 1))(n := x)) [x1, x2, x3, x4, x5, x6, x7] (\<lambda>n x. 0::'a) 1) $ 2 = x2 &&& vec_lambda (foldr (\<lambda>x f n. (f (n + 1))(n := x)) [x1, x2, x3, x4, x5, x6, x7] (\<lambda>n x. 0::'a) 1) $ 3 = x3) &&& (vec_lambda (foldr (\<lambda>x f n. (f (n + 1))(n := x)) [x1, x2, x3, x4, x5, x6, x7] (\<lambda>n x. 0::'a) 1) $ 4 = x4 &&& vec_lambda (foldr (\<lambda>x f n. (f (n + 1))(n := x)) [x1, x2, x3, x4, x5, x6, x7] (\<lambda>n x. 0::'a) 1) $ 5 = x5) &&& vec_lambda (foldr (\<lambda>x f n. (f (n + 1))(n := x)) [x1, x2, x3, x4, x5, x6, x7] (\<lambda>n x. 0::'a) 1) $ 6 = x6 &&& vec_lambda (foldr (\<lambda>x f n. (f (n + 1))(n := x)) [x1, x2, x3, x4, x5, x6, x7] (\<lambda>n x. 0::'a) 1) $ 7 = x7
[PROOF STEP]
by auto


[STATEMENT]
lemma contour_integral_join [simp]:
    "\<lbrakk>f contour_integrable_on g1; f contour_integrable_on g2; valid_path g1; valid_path g2\<rbrakk>
        \<Longrightarrow> contour_integral (g1 +++ g2) f = contour_integral g1 f + contour_integral g2 f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f contour_integrable_on g1; f contour_integrable_on g2; valid_path g1; valid_path g2\<rbrakk> \<Longrightarrow> contour_integral (g1 +++ g2) f = contour_integral g1 f + contour_integral g2 f
[PROOF STEP]
by (simp add: has_contour_integral_integral has_contour_integral_join contour_integral_unique)


[STATEMENT]
lemma (in semiring_hom) mat_hom_pow: assumes A: "A \<in> carrier_mat n n"
  shows "mat\<^sub>h (A ^\<^sub>m k) = (mat\<^sub>h A) ^\<^sub>m k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat\<^sub>h (A ^\<^sub>m k) = mat\<^sub>h A ^\<^sub>m k
[PROOF STEP]
proof (induct k)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. mat\<^sub>h (A ^\<^sub>m 0) = mat\<^sub>h A ^\<^sub>m 0
 2. \<And>k. mat\<^sub>h (A ^\<^sub>m k) = mat\<^sub>h A ^\<^sub>m k \<Longrightarrow> mat\<^sub>h (A ^\<^sub>m Suc k) = mat\<^sub>h A ^\<^sub>m Suc k
[PROOF STEP]
case (Suc k)
[PROOF STATE]
proof (state)
this:
mat\<^sub>h (A ^\<^sub>m k) = mat\<^sub>h A ^\<^sub>m k

goal (2 subgoals):
 1. mat\<^sub>h (A ^\<^sub>m 0) = mat\<^sub>h A ^\<^sub>m 0
 2. \<And>k. mat\<^sub>h (A ^\<^sub>m k) = mat\<^sub>h A ^\<^sub>m k \<Longrightarrow> mat\<^sub>h (A ^\<^sub>m Suc k) = mat\<^sub>h A ^\<^sub>m Suc k
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
mat\<^sub>h (A ^\<^sub>m k) = mat\<^sub>h A ^\<^sub>m k

goal (1 subgoal):
 1. mat\<^sub>h (A ^\<^sub>m Suc k) = mat\<^sub>h A ^\<^sub>m Suc k
[PROOF STEP]
using mat_hom_mult[OF pow_carrier_mat[OF A, of k] A]
[PROOF STATE]
proof (prove)
using this:
mat\<^sub>h (A ^\<^sub>m k) = mat\<^sub>h A ^\<^sub>m k
mat\<^sub>h (A ^\<^sub>m k * A) = mat\<^sub>h (A ^\<^sub>m k) * mat\<^sub>h A

goal (1 subgoal):
 1. mat\<^sub>h (A ^\<^sub>m Suc k) = mat\<^sub>h A ^\<^sub>m Suc k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
mat\<^sub>h (A ^\<^sub>m Suc k) = mat\<^sub>h A ^\<^sub>m Suc k

goal (1 subgoal):
 1. mat\<^sub>h (A ^\<^sub>m 0) = mat\<^sub>h A ^\<^sub>m 0
[PROOF STEP]
qed (simp add: mat_hom_one)


[STATEMENT]
lemma inext_iprev_nth_pred: "
  \<lbrakk> finite I; iMin I \<noteq> I \<leftarrow> (n - Suc 0) \<rbrakk> \<Longrightarrow>
  inext (I \<leftarrow> n) I = I \<leftarrow> (n - Suc 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; iMin I \<noteq> I \<leftarrow> (n - Suc 0)\<rbrakk> \<Longrightarrow> inext (I \<leftarrow> n) I = I \<leftarrow> (n - Suc 0)
[PROOF STEP]
apply (case_tac n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>finite I; iMin I \<noteq> I \<leftarrow> (n - Suc 0); n = 0\<rbrakk> \<Longrightarrow> inext (I \<leftarrow> n) I = I \<leftarrow> (n - Suc 0)
 2. \<And>nat. \<lbrakk>finite I; iMin I \<noteq> I \<leftarrow> (n - Suc 0); n = Suc nat\<rbrakk> \<Longrightarrow> inext (I \<leftarrow> n) I = I \<leftarrow> (n - Suc 0)
[PROOF STEP]
apply (simp add: inext_Max)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>nat. \<lbrakk>finite I; iMin I \<noteq> I \<leftarrow> (n - Suc 0); n = Suc nat\<rbrakk> \<Longrightarrow> inext (I \<leftarrow> n) I = I \<leftarrow> (n - Suc 0)
[PROOF STEP]
apply (simp add: inext_iprev)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma zero_less_Fract_iff: "0 < b \<Longrightarrow> 0 < Fract a b \<longleftrightarrow> 0 < a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) < b \<Longrightarrow> (0 < Fract a b) = ((0::'a) < a)
[PROOF STEP]
by (auto simp add: Zero_fract_def zero_less_mult_iff)


[STATEMENT]
lemma true_cls_mset_mono: "set_mset DD \<subseteq> set_mset CC \<Longrightarrow> I \<Turnstile>m CC \<Longrightarrow> I \<Turnstile>m DD"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>set_mset DD \<subseteq> set_mset CC; I \<Turnstile>m CC\<rbrakk> \<Longrightarrow> I \<Turnstile>m DD
[PROOF STEP]
unfolding true_cls_mset_def subset_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>t. t \<in># DD \<longrightarrow> t \<in># CC; Multiset.Ball CC ((\<Turnstile>) I)\<rbrakk> \<Longrightarrow> Multiset.Ball DD ((\<Turnstile>) I)
[PROOF STEP]
by auto


[STATEMENT]
lemma poly_subst_prod: "poly_subst f (prod p A) = (\<Prod>a\<in>A. poly_subst f (p a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_subst f (prod p A) = (\<Prod>a\<in>A. poly_subst f (p a))
[PROOF STEP]
by (rule fun_prod_commute, simp_all add: poly_subst_times)


[STATEMENT]
lemma set_sort: "set (sort xs) = set xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (local.sort xs) = set xs
[PROOF STEP]
using arg_cong[OF multiset_of_sort[of xs], of "set_mset"]
[PROOF STATE]
proof (prove)
using this:
set_mset (mset (local.sort xs)) = set_mset (mset xs)

goal (1 subgoal):
 1. set (local.sort xs) = set xs
[PROOF STEP]
by (simp only: set_mset_mset)


[STATEMENT]
lemma param_list_equals[param]:
  "\<lbrakk> ((=), (=)) \<in> R\<rightarrow>R\<rightarrow>Id \<rbrakk>
  \<Longrightarrow> ((=), (=)) \<in> \<langle>R\<rangle>list_rel \<rightarrow> \<langle>R\<rangle>list_rel \<rightarrow> Id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((=), (=)) \<in> R \<rightarrow> R \<rightarrow> bool_rel \<Longrightarrow> ((=), (=)) \<in> \<langle>R\<rangle>list_rel \<rightarrow> \<langle>R\<rangle>list_rel \<rightarrow> bool_rel
[PROOF STEP]
unfolding id_list_eq_aux[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((=), (=)) \<in> R \<rightarrow> R \<rightarrow> bool_rel \<Longrightarrow> (list_eq (=), list_eq (=)) \<in> \<langle>R\<rangle>list_rel \<rightarrow> \<langle>R\<rangle>list_rel \<rightarrow> bool_rel
[PROOF STEP]
by (parametricity)


[STATEMENT]
lemma start_of_Suc1: "\<lbrakk>ly = layout_of ap;
       abc_fetch as ap = Some (Inc n)\<rbrakk>
       \<Longrightarrow> start_of ly (Suc as) = start_of ly as + 2 * n + 9"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ly = layout_of ap; abc_fetch as ap = Some (Inc n)\<rbrakk> \<Longrightarrow> start_of ly (Suc as) = start_of ly as + 2 * n + 9
[PROOF STEP]
apply(auto simp: start_of.simps layout_of.simps
      length_of.simps abc_fetch.simps
      take_Suc_conv_app_nth split: if_splits)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma Meet_greatest [intro?]: "(\<And>a. a \<in> A \<Longrightarrow> x \<sqsubseteq> a) \<Longrightarrow> x \<sqsubseteq> \<Sqinter>A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a. a \<in> A \<Longrightarrow> x \<sqsubseteq> a) \<Longrightarrow> x \<sqsubseteq> \<Sqinter>A
[PROOF STEP]
by (rule is_Inf_greatest, rule is_Inf_Meet) blast


[STATEMENT]
lemma finite_nat_iff_bounded_le2: "
  finite S = (\<exists>(k::nat).\<forall>n\<in>S. n \<le> k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite S = (\<exists>k. \<forall>n\<in>S. n \<le> k)
[PROOF STEP]
by (simp only: finite_nat_iff_bounded_le, blast)


[STATEMENT]
lemma init2 :
"(init G w k = None) =
 (w = [] \<or> (\<exists>a \<in> set w. init_match G a = []))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (init G w k = None) = (w = [] \<or> (\<exists>a\<in>set w. init_match G a = []))
[PROOF STEP]
by(induct_tac G w k rule: init.induct, simp, simp split: list.split,
   simp split: list.split option.split, force)


[STATEMENT]
lemma param_curry[param]:
  "(curry,curry) \<in> (\<langle>Ra,Rb\<rangle>prod_rel \<rightarrow> Rc) \<rightarrow> Ra \<rightarrow> Rb \<rightarrow> Rc"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (curry, curry) \<in> (Ra \<times>\<^sub>r Rb \<rightarrow> Rc) \<rightarrow> Ra \<rightarrow> Rb \<rightarrow> Rc
[PROOF STEP]
unfolding curry_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>c x y. c (x, y), \<lambda>c x y. c (x, y)) \<in> (Ra \<times>\<^sub>r Rb \<rightarrow> Rc) \<rightarrow> Ra \<rightarrow> Rb \<rightarrow> Rc
[PROOF STEP]
by parametricity


[STATEMENT]
lemma norm_bound_CBasis_lt: "b \<in> CBasis \<Longrightarrow> norm x < e \<Longrightarrow> cmod (inner x b) < e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>b \<in> CBasis; norm x < e\<rbrakk> \<Longrightarrow> cmod (complex_of_real (x \<bullet> b)) < e
[PROOF STEP]
by (metis inner_commute le_less_trans mult.left_neutral norm_CBasis norm_of_real real_inner_class.Cauchy_Schwarz_ineq2)


[STATEMENT]
lemma leadsTo_iff_wens_set: "(F \<in> A leadsTo B) = (\<exists>C \<in> wens_set F B. A \<subseteq> C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (F \<in> A \<longmapsto> B) = (\<exists>C\<in>wens_set F B. A \<subseteq> C)
[PROOF STEP]
by (blast intro: leadsTo_imp_wens_set leadsTo_weaken_L wens_set_imp_leadsTo)


[STATEMENT]
lemma gen_analz_insert_eq [rule_format]:
     "X \<in> analz H ==> \<forall>G. H \<subseteq> G \<longrightarrow> analz (insert X G) = analz G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X \<in> analz H \<Longrightarrow> \<forall>G. H \<subseteq> G \<longrightarrow> analz (insert X G) = analz G
[PROOF STEP]
by (blast intro: analz_cut analz_insertI analz_mono [THEN [2] rev_subsetD])


[STATEMENT]
lemma (in mpt) birkhoff_sum_nn_integral:
  fixes f :: "'a \<Rightarrow> ennreal"
  assumes [measurable]: "f \<in> borel_measurable M" and pos: "\<And>x. f x \<ge> 0"
  shows "(\<integral>\<^sup>+x. birkhoff_sum f n x \<partial>M) = n * (\<integral>\<^sup>+x. f x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N M (birkhoff_sum f n) = of_nat n * integral\<^sup>N M f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integral\<^sup>N M (birkhoff_sum f n) = of_nat n * integral\<^sup>N M f
[PROOF STEP]
have [measurable]: "\<And>k. (\<lambda>x. f((T^^k)x)) \<in> borel_measurable M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>k. (\<lambda>x. f ((T ^^ k) x)) \<in> borel_measurable M
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>x. f ((T ^^ ?k1) x)) \<in> borel_measurable M

goal (1 subgoal):
 1. integral\<^sup>N M (birkhoff_sum f n) = of_nat n * integral\<^sup>N M f
[PROOF STEP]
have posk: "\<And>k x. f((T^^k)x) \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>k x. 0 \<le> f ((T ^^ k) x)
[PROOF STEP]
using pos
[PROOF STATE]
proof (prove)
using this:
0 \<le> f ?x1

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

goal (1 subgoal):
 1. integral\<^sup>N M (birkhoff_sum f n) = of_nat n * integral\<^sup>N M f
[PROOF STEP]
have b: "\<And>k. (\<integral>\<^sup>+x. f((T^^k)x) \<partial>M) = (\<integral>\<^sup>+x. f x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>k. \<integral>\<^sup>+ x. f ((T ^^ k) x) \<partial>M = integral\<^sup>N M f
[PROOF STEP]
using Tn_nn_integral_preserving assms
[PROOF STATE]
proof (prove)
using this:
?f \<in> borel_measurable M \<Longrightarrow> \<integral>\<^sup>+ x. ?f ((T ^^ ?n) x) \<partial>M = integral\<^sup>N M ?f
f \<in> borel_measurable M
0 \<le> f ?x1

goal (1 subgoal):
 1. \<And>k. \<integral>\<^sup>+ x. f ((T ^^ k) x) \<partial>M = integral\<^sup>N M f
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. f ((T ^^ ?k1) x) \<partial>M = integral\<^sup>N M f

goal (1 subgoal):
 1. integral\<^sup>N M (birkhoff_sum f n) = of_nat n * integral\<^sup>N M f
[PROOF STEP]
have "(\<integral>\<^sup>+x. birkhoff_sum f n x \<partial>M) = (\<integral>\<^sup>+x. (\<Sum>k\<in>{..<n}. f((T^^k) x)) \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>N M (birkhoff_sum f n) = \<integral>\<^sup>+ x. (\<Sum>k<n. f ((T ^^ k) x)) \<partial>M
[PROOF STEP]
unfolding birkhoff_sum_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (\<Sum>i<n. f ((T ^^ i) x)) \<partial>M = \<integral>\<^sup>+ x. (\<Sum>k<n. f ((T ^^ k) x)) \<partial>M
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
integral\<^sup>N M (birkhoff_sum f n) = \<integral>\<^sup>+ x. (\<Sum>k<n. f ((T ^^ k) x)) \<partial>M

goal (1 subgoal):
 1. integral\<^sup>N M (birkhoff_sum f n) = of_nat n * integral\<^sup>N M f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
integral\<^sup>N M (birkhoff_sum f n) = \<integral>\<^sup>+ x. (\<Sum>k<n. f ((T ^^ k) x)) \<partial>M

goal (1 subgoal):
 1. integral\<^sup>N M (birkhoff_sum f n) = of_nat n * integral\<^sup>N M f
[PROOF STEP]
have "... = (\<Sum>k\<in>{..<n}. (\<integral>\<^sup>+x. f((T^^k) x) \<partial>M))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (\<Sum>k<n. f ((T ^^ k) x)) \<partial>M = (\<Sum>k<n. \<integral>\<^sup>+ x. f ((T ^^ k) x) \<partial>M)
[PROOF STEP]
by (rule nn_integral_sum, auto simp add: posk)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. (\<Sum>k<n. f ((T ^^ k) x)) \<partial>M = (\<Sum>k<n. \<integral>\<^sup>+ x. f ((T ^^ k) x) \<partial>M)

goal (1 subgoal):
 1. integral\<^sup>N M (birkhoff_sum f n) = of_nat n * integral\<^sup>N M f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. (\<Sum>k<n. f ((T ^^ k) x)) \<partial>M = (\<Sum>k<n. \<integral>\<^sup>+ x. f ((T ^^ k) x) \<partial>M)

goal (1 subgoal):
 1. integral\<^sup>N M (birkhoff_sum f n) = of_nat n * integral\<^sup>N M f
[PROOF STEP]
have "... = (\<Sum>k\<in>{..<n}. (\<integral>\<^sup>+x. f x \<partial>M))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k<n. \<integral>\<^sup>+ x. f ((T ^^ k) x) \<partial>M) = (\<Sum>k<n. integral\<^sup>N M f)
[PROOF STEP]
using b
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. f ((T ^^ ?k1) x) \<partial>M = integral\<^sup>N M f

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

goal (1 subgoal):
 1. integral\<^sup>N M (birkhoff_sum f n) = of_nat n * integral\<^sup>N M f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k<n. \<integral>\<^sup>+ x. f ((T ^^ k) x) \<partial>M) = (\<Sum>k<n. integral\<^sup>N M f)

goal (1 subgoal):
 1. integral\<^sup>N M (birkhoff_sum f n) = of_nat n * integral\<^sup>N M f
[PROOF STEP]
have "... = n * (\<integral>\<^sup>+x. f x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k<n. integral\<^sup>N M f) = of_nat n * integral\<^sup>N M f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>k<n. integral\<^sup>N M f) = of_nat n * integral\<^sup>N M f

goal (1 subgoal):
 1. integral\<^sup>N M (birkhoff_sum f n) = of_nat n * integral\<^sup>N M f
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
integral\<^sup>N M (birkhoff_sum f n) = of_nat n * integral\<^sup>N M f
[PROOF STEP]
show "(\<integral>\<^sup>+x. birkhoff_sum f n x \<partial>M) = n * (\<integral>\<^sup>+x. f x \<partial>M)"
[PROOF STATE]
proof (prove)
using this:
integral\<^sup>N M (birkhoff_sum f n) = of_nat n * integral\<^sup>N M f

goal (1 subgoal):
 1. integral\<^sup>N M (birkhoff_sum f n) = of_nat n * integral\<^sup>N M f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
integral\<^sup>N M (birkhoff_sum f n) = of_nat n * integral\<^sup>N M f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_to_zero:
  "(a :: 'a :: ring) + b = 0 \<Longrightarrow> a = (- b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a + b = (0::'a) \<Longrightarrow> a = - b
[PROOF STEP]
by (drule arg_cong[where f="\<lambda> x. x - a"], simp)


[STATEMENT]
lemma open_discrete: "open (S :: 'a discrete set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open S
[PROOF STEP]
unfolding open_dist dist_discrete_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>S. \<exists>e>0. \<forall>y. (if y = x then 0 else 1) < e \<longrightarrow> y \<in> S
[PROOF STEP]
by (auto intro!: exI[of _ "1 / 2"])


[STATEMENT]
lemma sigma_le_iff: "\<A> \<subseteq> Pow \<Omega> \<Longrightarrow> sigma \<Omega> \<A> \<le> x \<longleftrightarrow> (\<Omega> \<subseteq> space x \<and> (space x = \<Omega> \<longrightarrow> \<A> \<subseteq> sets x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<A> \<subseteq> Pow \<Omega> \<Longrightarrow> (sigma \<Omega> \<A> \<le> x) = (\<Omega> \<subseteq> space x \<and> (space x = \<Omega> \<longrightarrow> \<A> \<subseteq> sets x))
[PROOF STEP]
by (cases "\<Omega> = space x")
     (simp_all add: eq_commute[of _ "sets x"] le_measure_iff emeasure_sigma le_fun_def
                    sigma_sets_superset_generator sigma_sets_le_sets_iff)


[STATEMENT]
lemma mod_ring_uminus32: "(mod_ring_rel32 ===> mod_ring_rel32) (uminus_p32 pp) uminus"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (mod_ring_rel32 ===> mod_ring_rel32) (uminus_p32 pp) uminus
[PROOF STEP]
using urel32_uminus mod_ring_uminus
[PROOF STATE]
proof (prove)
using this:
urel32 ?x ?y \<Longrightarrow> urel32 (uminus_p32 pp ?x) (uminus_p p ?y)
(mod_ring_rel ===> mod_ring_rel) (uminus_p p) uminus

goal (1 subgoal):
 1. (mod_ring_rel32 ===> mod_ring_rel32) (uminus_p32 pp) uminus
[PROOF STEP]
unfolding mod_ring_rel32_def rel_fun_def
[PROOF STATE]
proof (prove)
using this:
urel32 ?x ?y \<Longrightarrow> urel32 (uminus_p32 pp ?x) (uminus_p p ?y)
\<forall>x y. mod_ring_rel x y \<longrightarrow> mod_ring_rel (uminus_p p x) (- y)

goal (1 subgoal):
 1. \<forall>x y. (\<exists>z. urel32 x z \<and> mod_ring_rel z y) \<longrightarrow> (\<exists>z. urel32 (uminus_p32 pp x) z \<and> mod_ring_rel z (- y))
[PROOF STEP]
by blast