[STATEMENT]
lemma sin_x_sin_y:
  fixes x :: "'a::{real_normed_field,banach}"
  shows
    "(\<lambda>p. \<Sum>n\<le>p.
        if even p \<and> odd n
        then - ((-1) ^ (p div 2) * (p choose n) / (fact p)) *\<^sub>R (x^n) * y^(p-n)
        else 0)
      sums (sin x * sin y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>p. \<Sum>n\<le>p. if even p \<and> odd n then - (real_of_int ((- 1) ^ (p div 2) * int (p choose n)) / fact p) *\<^sub>R x ^ n * y ^ (p - n) else (0::'a)) sums (sin x * sin y)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>p. \<Sum>n\<le>p. if even p \<and> odd n then - (real_of_int ((- 1) ^ (p div 2) * int (p choose n)) / fact p) *\<^sub>R x ^ n * y ^ (p - n) else (0::'a)) sums (sin x * sin y)
[PROOF STEP]
have "(sin_coeff n * sin_coeff (p - n)) *\<^sub>R (x^n * y^(p-n)) =
    (if even p \<and> odd n
     then -((-1) ^ (p div 2) * (p choose n) / (fact p)) *\<^sub>R (x^n) * y^(p-n)
     else 0)"
    if "n \<le> p" for n p :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sin_coeff n * sin_coeff (p - n)) *\<^sub>R (x ^ n * y ^ (p - n)) = (if even p \<and> odd n then - (real_of_int ((- 1) ^ (p div 2) * int (p choose n)) / fact p) *\<^sub>R x ^ n * y ^ (p - n) else (0::'a))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (sin_coeff n * sin_coeff (p - n)) *\<^sub>R (x ^ n * y ^ (p - n)) = (if even p \<and> odd n then - (real_of_int ((- 1) ^ (p div 2) * int (p choose n)) / fact p) *\<^sub>R x ^ n * y ^ (p - n) else (0::'a))
[PROOF STEP]
have "(-1) ^ ((n - Suc 0) div 2) * (-1) ^ ((p - Suc n) div 2) = - ((-1 :: real) ^ (p div 2))"
      if np: "odd n" "even p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- 1) ^ ((n - Suc 0) div 2) * (- 1) ^ ((p - Suc n) div 2) = - ((- 1) ^ (p div 2))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (- 1) ^ ((n - Suc 0) div 2) * (- 1) ^ ((p - Suc n) div 2) = - ((- 1) ^ (p div 2))
[PROOF STEP]
have "p > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < p
[PROOF STEP]
using \<open>n \<le> p\<close> neq0_conv that(1)
[PROOF STATE]
proof (prove)
using this:
n \<le> p
(?n \<noteq> 0) = (0 < ?n)
odd n

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

goal (1 subgoal):
 1. (- 1) ^ ((n - Suc 0) div 2) * (- 1) ^ ((p - Suc n) div 2) = - ((- 1) ^ (p div 2))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < p
[PROOF STEP]
have \<section>: "(- 1::real) ^ (p div 2 - Suc 0) = - ((- 1) ^ (p div 2))"
[PROOF STATE]
proof (prove)
using this:
0 < p

goal (1 subgoal):
 1. (- 1) ^ (p div 2 - Suc 0) = - ((- 1) ^ (p div 2))
[PROOF STEP]
using \<open>even p\<close>
[PROOF STATE]
proof (prove)
using this:
0 < p
even p

goal (1 subgoal):
 1. (- 1) ^ (p div 2 - Suc 0) = - ((- 1) ^ (p div 2))
[PROOF STEP]
by (auto simp add: dvd_def power_eq_if)
[PROOF STATE]
proof (state)
this:
(- 1) ^ (p div 2 - Suc 0) = - ((- 1) ^ (p div 2))

goal (1 subgoal):
 1. (- 1) ^ ((n - Suc 0) div 2) * (- 1) ^ ((p - Suc n) div 2) = - ((- 1) ^ (p div 2))
[PROOF STEP]
from \<open>n \<le> p\<close> np
[PROOF STATE]
proof (chain)
picking this:
n \<le> p
odd n
even p
[PROOF STEP]
have *: "n - Suc 0 + (p - Suc n) = p - Suc (Suc 0)" "Suc (Suc 0) \<le> p"
[PROOF STATE]
proof (prove)
using this:
n \<le> p
odd n
even p

goal (1 subgoal):
 1. n - Suc 0 + (p - Suc n) = p - Suc (Suc 0) &&& Suc (Suc 0) \<le> p
[PROOF STEP]
by arith+
[PROOF STATE]
proof (state)
this:
n - Suc 0 + (p - Suc n) = p - Suc (Suc 0)
Suc (Suc 0) \<le> p

goal (1 subgoal):
 1. (- 1) ^ ((n - Suc 0) div 2) * (- 1) ^ ((p - Suc n) div 2) = - ((- 1) ^ (p div 2))
[PROOF STEP]
have "(p - Suc (Suc 0)) div 2 = p div 2 - Suc 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (p - Suc (Suc 0)) div 2 = p div 2 - Suc 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(p - Suc (Suc 0)) div 2 = p div 2 - Suc 0

goal (1 subgoal):
 1. (- 1) ^ ((n - Suc 0) div 2) * (- 1) ^ ((p - Suc n) div 2) = - ((- 1) ^ (p div 2))
[PROOF STEP]
with \<open>n \<le> p\<close> np  \<section> *
[PROOF STATE]
proof (chain)
picking this:
n \<le> p
odd n
even p
(- 1) ^ (p div 2 - Suc 0) = - ((- 1) ^ (p div 2))
n - Suc 0 + (p - Suc n) = p - Suc (Suc 0)
Suc (Suc 0) \<le> p
(p - Suc (Suc 0)) div 2 = p div 2 - Suc 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n \<le> p
odd n
even p
(- 1) ^ (p div 2 - Suc 0) = - ((- 1) ^ (p div 2))
n - Suc 0 + (p - Suc n) = p - Suc (Suc 0)
Suc (Suc 0) \<le> p
(p - Suc (Suc 0)) div 2 = p div 2 - Suc 0

goal (1 subgoal):
 1. (- 1) ^ ((n - Suc 0) div 2) * (- 1) ^ ((p - Suc n) div 2) = - ((- 1) ^ (p div 2))
[PROOF STEP]
by (simp add: flip: div_add power_add)
[PROOF STATE]
proof (state)
this:
(- 1) ^ ((n - Suc 0) div 2) * (- 1) ^ ((p - Suc n) div 2) = - ((- 1) ^ (p div 2))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>odd n; even p\<rbrakk> \<Longrightarrow> (- 1) ^ ((n - Suc 0) div 2) * (- 1) ^ ((p - Suc n) div 2) = - ((- 1) ^ (p div 2))

goal (1 subgoal):
 1. (sin_coeff n * sin_coeff (p - n)) *\<^sub>R (x ^ n * y ^ (p - n)) = (if even p \<and> odd n then - (real_of_int ((- 1) ^ (p div 2) * int (p choose n)) / fact p) *\<^sub>R x ^ n * y ^ (p - n) else (0::'a))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>odd n; even p\<rbrakk> \<Longrightarrow> (- 1) ^ ((n - Suc 0) div 2) * (- 1) ^ ((p - Suc n) div 2) = - ((- 1) ^ (p div 2))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>odd n; even p\<rbrakk> \<Longrightarrow> (- 1) ^ ((n - Suc 0) div 2) * (- 1) ^ ((p - Suc n) div 2) = - ((- 1) ^ (p div 2))

goal (1 subgoal):
 1. (sin_coeff n * sin_coeff (p - n)) *\<^sub>R (x ^ n * y ^ (p - n)) = (if even p \<and> odd n then - (real_of_int ((- 1) ^ (p div 2) * int (p choose n)) / fact p) *\<^sub>R x ^ n * y ^ (p - n) else (0::'a))
[PROOF STEP]
using \<open>n\<le>p\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>odd n; even p\<rbrakk> \<Longrightarrow> (- 1) ^ ((n - Suc 0) div 2) * (- 1) ^ ((p - Suc n) div 2) = - ((- 1) ^ (p div 2))
n \<le> p

goal (1 subgoal):
 1. (sin_coeff n * sin_coeff (p - n)) *\<^sub>R (x ^ n * y ^ (p - n)) = (if even p \<and> odd n then - (real_of_int ((- 1) ^ (p div 2) * int (p choose n)) / fact p) *\<^sub>R x ^ n * y ^ (p - n) else (0::'a))
[PROOF STEP]
by (auto simp: algebra_simps sin_coeff_def binomial_fact)
[PROOF STATE]
proof (state)
this:
(sin_coeff n * sin_coeff (p - n)) *\<^sub>R (x ^ n * y ^ (p - n)) = (if even p \<and> odd n then - (real_of_int ((- 1) ^ (p div 2) * int (p choose n)) / fact p) *\<^sub>R x ^ n * y ^ (p - n) else (0::'a))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?n \<le> ?p \<Longrightarrow> (sin_coeff ?n * sin_coeff (?p - ?n)) *\<^sub>R (x ^ ?n * y ^ (?p - ?n)) = (if even ?p \<and> odd ?n then - (real_of_int ((- 1) ^ (?p div 2) * int (?p choose ?n)) / fact ?p) *\<^sub>R x ^ ?n * y ^ (?p - ?n) else (0::'a))

goal (1 subgoal):
 1. (\<lambda>p. \<Sum>n\<le>p. if even p \<and> odd n then - (real_of_int ((- 1) ^ (p div 2) * int (p choose n)) / fact p) *\<^sub>R x ^ n * y ^ (p - n) else (0::'a)) sums (sin x * sin y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?n \<le> ?p \<Longrightarrow> (sin_coeff ?n * sin_coeff (?p - ?n)) *\<^sub>R (x ^ ?n * y ^ (?p - ?n)) = (if even ?p \<and> odd ?n then - (real_of_int ((- 1) ^ (?p div 2) * int (?p choose ?n)) / fact ?p) *\<^sub>R x ^ ?n * y ^ (?p - ?n) else (0::'a))
[PROOF STEP]
have "(\<lambda>p. \<Sum>n\<le>p. if even p \<and> odd n
               then - ((-1) ^ (p div 2) * (p choose n) / (fact p)) *\<^sub>R (x^n) * y^(p-n) else 0) =
             (\<lambda>p. \<Sum>n\<le>p. (sin_coeff n * sin_coeff (p - n)) *\<^sub>R (x^n * y^(p-n)))"
[PROOF STATE]
proof (prove)
using this:
?n \<le> ?p \<Longrightarrow> (sin_coeff ?n * sin_coeff (?p - ?n)) *\<^sub>R (x ^ ?n * y ^ (?p - ?n)) = (if even ?p \<and> odd ?n then - (real_of_int ((- 1) ^ (?p div 2) * int (?p choose ?n)) / fact ?p) *\<^sub>R x ^ ?n * y ^ (?p - ?n) else (0::'a))

goal (1 subgoal):
 1. (\<lambda>p. \<Sum>n\<le>p. if even p \<and> odd n then - (real_of_int ((- 1) ^ (p div 2) * int (p choose n)) / fact p) *\<^sub>R x ^ n * y ^ (p - n) else (0::'a)) = (\<lambda>p. \<Sum>n\<le>p. (sin_coeff n * sin_coeff (p - n)) *\<^sub>R (x ^ n * y ^ (p - n)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>p. \<Sum>n\<le>p. if even p \<and> odd n then - (real_of_int ((- 1) ^ (p div 2) * int (p choose n)) / fact p) *\<^sub>R x ^ n * y ^ (p - n) else (0::'a)) = (\<lambda>p. \<Sum>n\<le>p. (sin_coeff n * sin_coeff (p - n)) *\<^sub>R (x ^ n * y ^ (p - n)))

goal (1 subgoal):
 1. (\<lambda>p. \<Sum>n\<le>p. if even p \<and> odd n then - (real_of_int ((- 1) ^ (p div 2) * int (p choose n)) / fact p) *\<^sub>R x ^ n * y ^ (p - n) else (0::'a)) sums (sin x * sin y)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>p. \<Sum>n\<le>p. if even p \<and> odd n then - (real_of_int ((- 1) ^ (p div 2) * int (p choose n)) / fact p) *\<^sub>R x ^ n * y ^ (p - n) else (0::'a)) = (\<lambda>p. \<Sum>n\<le>p. (sin_coeff n * sin_coeff (p - n)) *\<^sub>R (x ^ n * y ^ (p - n)))

goal (1 subgoal):
 1. (\<lambda>p. \<Sum>n\<le>p. if even p \<and> odd n then - (real_of_int ((- 1) ^ (p div 2) * int (p choose n)) / fact p) *\<^sub>R x ^ n * y ^ (p - n) else (0::'a)) sums (sin x * sin y)
[PROOF STEP]
have "\<dots> = (\<lambda>p. \<Sum>n\<le>p. (sin_coeff n *\<^sub>R x^n) * (sin_coeff (p - n) *\<^sub>R y^(p-n)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>p. \<Sum>n\<le>p. (sin_coeff n * sin_coeff (p - n)) *\<^sub>R (x ^ n * y ^ (p - n))) = (\<lambda>p. \<Sum>n\<le>p. sin_coeff n *\<^sub>R x ^ n * sin_coeff (p - n) *\<^sub>R y ^ (p - n))
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
(\<lambda>p. \<Sum>n\<le>p. (sin_coeff n * sin_coeff (p - n)) *\<^sub>R (x ^ n * y ^ (p - n))) = (\<lambda>p. \<Sum>n\<le>p. sin_coeff n *\<^sub>R x ^ n * sin_coeff (p - n) *\<^sub>R y ^ (p - n))

goal (1 subgoal):
 1. (\<lambda>p. \<Sum>n\<le>p. if even p \<and> odd n then - (real_of_int ((- 1) ^ (p div 2) * int (p choose n)) / fact p) *\<^sub>R x ^ n * y ^ (p - n) else (0::'a)) sums (sin x * sin y)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>p. \<Sum>n\<le>p. (sin_coeff n * sin_coeff (p - n)) *\<^sub>R (x ^ n * y ^ (p - n))) = (\<lambda>p. \<Sum>n\<le>p. sin_coeff n *\<^sub>R x ^ n * sin_coeff (p - n) *\<^sub>R y ^ (p - n))

goal (1 subgoal):
 1. (\<lambda>p. \<Sum>n\<le>p. if even p \<and> odd n then - (real_of_int ((- 1) ^ (p div 2) * int (p choose n)) / fact p) *\<^sub>R x ^ n * y ^ (p - n) else (0::'a)) sums (sin x * sin y)
[PROOF STEP]
have "\<dots> sums (sin x * sin y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>p. \<Sum>n\<le>p. sin_coeff n *\<^sub>R x ^ n * sin_coeff (p - n) *\<^sub>R y ^ (p - n)) sums (sin x * sin y)
[PROOF STEP]
using summable_norm_sin
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>n. norm (sin_coeff n *\<^sub>R ?x ^ n))

goal (1 subgoal):
 1. (\<lambda>p. \<Sum>n\<le>p. sin_coeff n *\<^sub>R x ^ n * sin_coeff (p - n) *\<^sub>R y ^ (p - n)) sums (sin x * sin y)
[PROOF STEP]
by (auto simp: sin_def scaleR_conv_of_real intro!: Cauchy_product_sums)
[PROOF STATE]
proof (state)
this:
(\<lambda>p. \<Sum>n\<le>p. sin_coeff n *\<^sub>R x ^ n * sin_coeff (p - n) *\<^sub>R y ^ (p - n)) sums (sin x * sin y)

goal (1 subgoal):
 1. (\<lambda>p. \<Sum>n\<le>p. if even p \<and> odd n then - (real_of_int ((- 1) ^ (p div 2) * int (p choose n)) / fact p) *\<^sub>R x ^ n * y ^ (p - n) else (0::'a)) sums (sin x * sin y)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>p. \<Sum>n\<le>p. if even p \<and> odd n then - (real_of_int ((- 1) ^ (p div 2) * int (p choose n)) / fact p) *\<^sub>R x ^ n * y ^ (p - n) else (0::'a)) sums (sin x * sin y)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>p. \<Sum>n\<le>p. if even p \<and> odd n then - (real_of_int ((- 1) ^ (p div 2) * int (p choose n)) / fact p) *\<^sub>R x ^ n * y ^ (p - n) else (0::'a)) sums (sin x * sin y)

goal (1 subgoal):
 1. (\<lambda>p. \<Sum>n\<le>p. if even p \<and> odd n then - (real_of_int ((- 1) ^ (p div 2) * int (p choose n)) / fact p) *\<^sub>R x ^ n * y ^ (p - n) else (0::'a)) sums (sin x * sin y)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<lambda>p. \<Sum>n\<le>p. if even p \<and> odd n then - (real_of_int ((- 1) ^ (p div 2) * int (p choose n)) / fact p) *\<^sub>R x ^ n * y ^ (p - n) else (0::'a)) sums (sin x * sin y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma r_append_zeros: "eval r_append_zeros [b, z] \<down>= e_append_zeros b z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval r_append_zeros [b, z] \<down>= e_append_zeros b z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. eval r_append_zeros [b, z] \<down>= e_append_zeros b z
[PROOF STEP]
let ?r = "Pr 1 (Id 1 0) (Cn 3 r_snoc [Id 3 1, r_constn 2 0])"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. eval r_append_zeros [b, z] \<down>= e_append_zeros b z
[PROOF STEP]
have "eval ?r [z, b] \<down>= e_append_zeros b z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval (Pr 1 (recf.Id 1 0) (Cn 3 r_snoc [recf.Id 3 1, r_constn 2 0])) [z, b] \<down>= e_append_zeros b z
[PROOF STEP]
using e_append_zeros_def e_append_def
[PROOF STATE]
proof (prove)
using this:
e_append_zeros ?b ?z \<equiv> e_append ?b (Partial_Recursive.list_encode (replicate ?z 0))
e_append ?xs ?ys \<equiv> Partial_Recursive.list_encode (Partial_Recursive.list_decode ?xs @ Partial_Recursive.list_decode ?ys)

goal (1 subgoal):
 1. eval (Pr 1 (recf.Id 1 0) (Cn 3 r_snoc [recf.Id 3 1, r_constn 2 0])) [z, b] \<down>= e_append_zeros b z
[PROOF STEP]
by (induction z) (simp_all add: replicate_append_same)
[PROOF STATE]
proof (state)
this:
eval (Pr 1 (recf.Id 1 0) (Cn 3 r_snoc [recf.Id 3 1, r_constn 2 0])) [z, b] \<down>= e_append_zeros b z

goal (1 subgoal):
 1. eval r_append_zeros [b, z] \<down>= e_append_zeros b z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
eval (Pr 1 (recf.Id 1 0) (Cn 3 r_snoc [recf.Id 3 1, r_constn 2 0])) [z, b] \<down>= e_append_zeros b z
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
eval (Pr 1 (recf.Id 1 0) (Cn 3 r_snoc [recf.Id 3 1, r_constn 2 0])) [z, b] \<down>= e_append_zeros b z

goal (1 subgoal):
 1. eval r_append_zeros [b, z] \<down>= e_append_zeros b z
[PROOF STEP]
by (simp add: r_append_zeros_def)
[PROOF STATE]
proof (state)
this:
eval r_append_zeros [b, z] \<down>= e_append_zeros b z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma irreducible_dvd_prod_mset:
  fixes p :: "'a :: field poly"
  assumes irr: "irreducible p" and dvd: "p dvd prod_mset as"
  shows "\<exists> a \<in># as. p dvd a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>a\<in>#as. p dvd a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>a\<in>#as. p dvd a
[PROOF STEP]
from irr[unfolded irreducible_def]
[PROOF STATE]
proof (chain)
picking this:
p \<noteq> 0 \<and> \<not> is_unit p \<and> (\<forall>a b. p = a * b \<longrightarrow> is_unit a \<or> is_unit b)
[PROOF STEP]
have deg: "degree p \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0 \<and> \<not> is_unit p \<and> (\<forall>a b. p = a * b \<longrightarrow> is_unit a \<or> is_unit b)

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

goal (1 subgoal):
 1. \<exists>a\<in>#as. p dvd a
[PROOF STEP]
hence p1: "\<not> p dvd 1"
[PROOF STATE]
proof (prove)
using this:
degree p \<noteq> 0

goal (1 subgoal):
 1. \<not> is_unit p
[PROOF STEP]
unfolding dvd_def
[PROOF STATE]
proof (prove)
using this:
degree p \<noteq> 0

goal (1 subgoal):
 1. \<nexists>k. 1 = p * k
[PROOF STEP]
by (metis degree_1 nonzero_mult_div_cancel_left div_poly_less linorder_neqE_nat mult_not_zero not_less0 zero_neq_one)
[PROOF STATE]
proof (state)
this:
\<not> is_unit p

goal (1 subgoal):
 1. \<exists>a\<in>#as. p dvd a
[PROOF STEP]
from dvd
[PROOF STATE]
proof (chain)
picking this:
p dvd \<Prod>\<^sub># as
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
p dvd \<Prod>\<^sub># as

goal (1 subgoal):
 1. \<exists>a\<in>#as. p dvd a
[PROOF STEP]
proof (induct as)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. p dvd \<Prod>\<^sub># {#} \<Longrightarrow> Multiset.Bex {#} ((dvd) p)
 2. \<And>x as. \<lbrakk>p dvd \<Prod>\<^sub># as \<Longrightarrow> Multiset.Bex as ((dvd) p); p dvd \<Prod>\<^sub># (add_mset x as)\<rbrakk> \<Longrightarrow> Multiset.Bex (add_mset x as) ((dvd) p)
[PROOF STEP]
case (add a as)
[PROOF STATE]
proof (state)
this:
p dvd \<Prod>\<^sub># as \<Longrightarrow> \<exists>a\<in>#as. p dvd a
p dvd \<Prod>\<^sub># (add_mset a as)

goal (2 subgoals):
 1. p dvd \<Prod>\<^sub># {#} \<Longrightarrow> Multiset.Bex {#} ((dvd) p)
 2. \<And>x as. \<lbrakk>p dvd \<Prod>\<^sub># as \<Longrightarrow> Multiset.Bex as ((dvd) p); p dvd \<Prod>\<^sub># (add_mset x as)\<rbrakk> \<Longrightarrow> Multiset.Bex (add_mset x as) ((dvd) p)
[PROOF STEP]
hence "prod_mset (add_mset a as) = a * prod_mset as"
[PROOF STATE]
proof (prove)
using this:
p dvd \<Prod>\<^sub># as \<Longrightarrow> \<exists>a\<in>#as. p dvd a
p dvd \<Prod>\<^sub># (add_mset a as)

goal (1 subgoal):
 1. \<Prod>\<^sub># (add_mset a as) = a * \<Prod>\<^sub># as
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<Prod>\<^sub># (add_mset a as) = a * \<Prod>\<^sub># as

goal (2 subgoals):
 1. p dvd \<Prod>\<^sub># {#} \<Longrightarrow> Multiset.Bex {#} ((dvd) p)
 2. \<And>x as. \<lbrakk>p dvd \<Prod>\<^sub># as \<Longrightarrow> Multiset.Bex as ((dvd) p); p dvd \<Prod>\<^sub># (add_mset x as)\<rbrakk> \<Longrightarrow> Multiset.Bex (add_mset x as) ((dvd) p)
[PROOF STEP]
from add(2)[unfolded this] add(1) irr
[PROOF STATE]
proof (chain)
picking this:
p dvd a * \<Prod>\<^sub># as
p dvd \<Prod>\<^sub># as \<Longrightarrow> \<exists>a\<in>#as. p dvd a
irreducible p
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
p dvd a * \<Prod>\<^sub># as
p dvd \<Prod>\<^sub># as \<Longrightarrow> \<exists>a\<in>#as. p dvd a
irreducible p

goal (1 subgoal):
 1. \<exists>a\<in>#add_mset a as. p dvd a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>a\<in>#add_mset a as. p dvd a

goal (1 subgoal):
 1. p dvd \<Prod>\<^sub># {#} \<Longrightarrow> Multiset.Bex {#} ((dvd) p)
[PROOF STEP]
qed (insert p1, auto)
[PROOF STATE]
proof (state)
this:
\<exists>a\<in>#as. p dvd a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Taylor_exp:
  "norm(exp z - (\<Sum>k\<le>n. z ^ k / (fact k))) \<le> exp\<bar>Re z\<bar> * (norm z) ^ (Suc n) / (fact n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (exp z - (\<Sum>k\<le>n. z ^ k / fact k)) \<le> exp \<bar>Re z\<bar> * cmod z ^ Suc n / fact n
[PROOF STEP]
proof (rule complex_Taylor [of _ n "\<lambda>k. exp" "exp\<bar>Re z\<bar>" 0 z, simplified])
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. convex ?S
 2. \<And>k x. \<lbrakk>x \<in> ?S; k \<le> n\<rbrakk> \<Longrightarrow> (exp has_field_derivative exp x) (at x within ?S)
 3. \<And>x. x \<in> ?S \<Longrightarrow> Re x \<le> \<bar>Re z\<bar>
 4. 0 \<in> ?S
 5. z \<in> ?S
[PROOF STEP]
show "convex (closed_segment 0 z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex (closed_segment 0 z)
[PROOF STEP]
by (rule convex_closed_segment [of 0 z])
[PROOF STATE]
proof (state)
this:
convex (closed_segment 0 z)

goal (4 subgoals):
 1. \<And>k x. \<lbrakk>x \<in> closed_segment 0 z; k \<le> n\<rbrakk> \<Longrightarrow> (exp has_field_derivative exp x) (at x within closed_segment 0 z)
 2. \<And>x. x \<in> closed_segment 0 z \<Longrightarrow> Re x \<le> \<bar>Re z\<bar>
 3. 0 \<in> closed_segment 0 z
 4. z \<in> closed_segment 0 z
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>k x. \<lbrakk>x \<in> closed_segment 0 z; k \<le> n\<rbrakk> \<Longrightarrow> (exp has_field_derivative exp x) (at x within closed_segment 0 z)
 2. \<And>x. x \<in> closed_segment 0 z \<Longrightarrow> Re x \<le> \<bar>Re z\<bar>
 3. 0 \<in> closed_segment 0 z
 4. z \<in> closed_segment 0 z
[PROOF STEP]
fix k x
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>k x. \<lbrakk>x \<in> closed_segment 0 z; k \<le> n\<rbrakk> \<Longrightarrow> (exp has_field_derivative exp x) (at x within closed_segment 0 z)
 2. \<And>x. x \<in> closed_segment 0 z \<Longrightarrow> Re x \<le> \<bar>Re z\<bar>
 3. 0 \<in> closed_segment 0 z
 4. z \<in> closed_segment 0 z
[PROOF STEP]
assume "x \<in> closed_segment 0 z" "k \<le> n"
[PROOF STATE]
proof (state)
this:
x \<in> closed_segment 0 z
k \<le> n

goal (4 subgoals):
 1. \<And>k x. \<lbrakk>x \<in> closed_segment 0 z; k \<le> n\<rbrakk> \<Longrightarrow> (exp has_field_derivative exp x) (at x within closed_segment 0 z)
 2. \<And>x. x \<in> closed_segment 0 z \<Longrightarrow> Re x \<le> \<bar>Re z\<bar>
 3. 0 \<in> closed_segment 0 z
 4. z \<in> closed_segment 0 z
[PROOF STEP]
show "(exp has_field_derivative exp x) (at x within closed_segment 0 z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (exp has_field_derivative exp x) (at x within closed_segment 0 z)
[PROOF STEP]
using DERIV_exp DERIV_subset
[PROOF STATE]
proof (prove)
using this:
(exp has_field_derivative exp ?x) (at ?x)
\<lbrakk>(?f has_field_derivative ?f') (at ?x within ?s); ?t \<subseteq> ?s\<rbrakk> \<Longrightarrow> (?f has_field_derivative ?f') (at ?x within ?t)

goal (1 subgoal):
 1. (exp has_field_derivative exp x) (at x within closed_segment 0 z)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(exp has_field_derivative exp x) (at x within closed_segment 0 z)

goal (3 subgoals):
 1. \<And>x. x \<in> closed_segment 0 z \<Longrightarrow> Re x \<le> \<bar>Re z\<bar>
 2. 0 \<in> closed_segment 0 z
 3. z \<in> closed_segment 0 z
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. x \<in> closed_segment 0 z \<Longrightarrow> Re x \<le> \<bar>Re z\<bar>
 2. 0 \<in> closed_segment 0 z
 3. z \<in> closed_segment 0 z
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>x. x \<in> closed_segment 0 z \<Longrightarrow> Re x \<le> \<bar>Re z\<bar>
 2. 0 \<in> closed_segment 0 z
 3. z \<in> closed_segment 0 z
[PROOF STEP]
assume "x \<in> closed_segment 0 z"
[PROOF STATE]
proof (state)
this:
x \<in> closed_segment 0 z

goal (3 subgoals):
 1. \<And>x. x \<in> closed_segment 0 z \<Longrightarrow> Re x \<le> \<bar>Re z\<bar>
 2. 0 \<in> closed_segment 0 z
 3. z \<in> closed_segment 0 z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> closed_segment 0 z
[PROOF STEP]
obtain u where u: "x = complex_of_real u * z" "0 \<le> u" "u \<le> 1"
[PROOF STATE]
proof (prove)
using this:
x \<in> closed_segment 0 z

goal (1 subgoal):
 1. (\<And>u. \<lbrakk>x = complex_of_real u * z; 0 \<le> u; u \<le> 1\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: closed_segment_def scaleR_conv_of_real)
[PROOF STATE]
proof (state)
this:
x = complex_of_real u * z
0 \<le> u
u \<le> 1

goal (3 subgoals):
 1. \<And>x. x \<in> closed_segment 0 z \<Longrightarrow> Re x \<le> \<bar>Re z\<bar>
 2. 0 \<in> closed_segment 0 z
 3. z \<in> closed_segment 0 z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x = complex_of_real u * z
0 \<le> u
u \<le> 1
[PROOF STEP]
have "u * Re z \<le> \<bar>Re z\<bar>"
[PROOF STATE]
proof (prove)
using this:
x = complex_of_real u * z
0 \<le> u
u \<le> 1

goal (1 subgoal):
 1. u * Re z \<le> \<bar>Re z\<bar>
[PROOF STEP]
by (metis abs_ge_self abs_ge_zero mult.commute mult.right_neutral mult_mono)
[PROOF STATE]
proof (state)
this:
u * Re z \<le> \<bar>Re z\<bar>

goal (3 subgoals):
 1. \<And>x. x \<in> closed_segment 0 z \<Longrightarrow> Re x \<le> \<bar>Re z\<bar>
 2. 0 \<in> closed_segment 0 z
 3. z \<in> closed_segment 0 z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u * Re z \<le> \<bar>Re z\<bar>
[PROOF STEP]
show "Re x \<le> \<bar>Re z\<bar>"
[PROOF STATE]
proof (prove)
using this:
u * Re z \<le> \<bar>Re z\<bar>

goal (1 subgoal):
 1. Re x \<le> \<bar>Re z\<bar>
[PROOF STEP]
by (simp add: u)
[PROOF STATE]
proof (state)
this:
Re x \<le> \<bar>Re z\<bar>

goal (2 subgoals):
 1. 0 \<in> closed_segment 0 z
 2. z \<in> closed_segment 0 z
[PROOF STEP]
qed auto


[STATEMENT]
lemma LIMSEQ_rat_real_ex:
    "\<exists>r. incseq r \<and> (\<lambda>n. of_rat (r n)) \<longlonglongrightarrow> (x::real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>r. incseq r \<and> (\<lambda>n. real_of_rat (r n)) \<longlonglongrightarrow> x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>r. incseq r \<and> (\<lambda>n. real_of_rat (r n)) \<longlonglongrightarrow> x
[PROOF STEP]
have squeeze_left:
       "\<forall>n. x - 1 / real (Suc n)
        \<le> real_of_rat (incratseq x n) \<and> real_of_rat (incratseq x n) \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n. x - 1 / real (Suc n) \<le> real_of_rat (incratseq x n) \<and> real_of_rat (incratseq x n) \<le> x
[PROOF STEP]
using incratseq_lb less_imp_le
[PROOF STATE]
proof (prove)
using this:
?x - 1 / real (Suc ?n) < real_of_rat (incratseq ?x ?n)
?x < ?y \<Longrightarrow> ?x \<le> ?y

goal (1 subgoal):
 1. \<forall>n. x - 1 / real (Suc n) \<le> real_of_rat (incratseq x n) \<and> real_of_rat (incratseq x n) \<le> x
[PROOF STEP]
by (simp add: less_imp_le)
[PROOF STATE]
proof (state)
this:
\<forall>n. x - 1 / real (Suc n) \<le> real_of_rat (incratseq x n) \<and> real_of_rat (incratseq x n) \<le> x

goal (1 subgoal):
 1. \<exists>r. incseq r \<and> (\<lambda>n. real_of_rat (r n)) \<longlonglongrightarrow> x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>n. x - 1 / real (Suc n) \<le> real_of_rat (incratseq x n) \<and> real_of_rat (incratseq x n) \<le> x

goal (1 subgoal):
 1. \<exists>r. incseq r \<and> (\<lambda>n. real_of_rat (r n)) \<longlonglongrightarrow> x
[PROOF STEP]
have "(\<lambda>n. x - 1 / real (Suc n)) \<longlonglongrightarrow> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. x - 1 / real (Suc n)) \<longlonglongrightarrow> x
[PROOF STEP]
by (simp only: minus_real_def LIMSEQ_inverse_real_of_nat_add_minus
           inverse_eq_divide [symmetric])
[PROOF STATE]
proof (state)
this:
(\<lambda>n. x - 1 / real (Suc n)) \<longlonglongrightarrow> x

goal (1 subgoal):
 1. \<exists>r. incseq r \<and> (\<lambda>n. real_of_rat (r n)) \<longlonglongrightarrow> x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>n. x - 1 / real (Suc n) \<le> real_of_rat (incratseq x n) \<and> real_of_rat (incratseq x n) \<le> x
(\<lambda>n. x - 1 / real (Suc n)) \<longlonglongrightarrow> x
[PROOF STEP]
have "(\<lambda>n. real_of_rat (incratseq x n)) \<longlonglongrightarrow> x"
[PROOF STATE]
proof (prove)
using this:
\<forall>n. x - 1 / real (Suc n) \<le> real_of_rat (incratseq x n) \<and> real_of_rat (incratseq x n) \<le> x
(\<lambda>n. x - 1 / real (Suc n)) \<longlonglongrightarrow> x

goal (1 subgoal):
 1. (\<lambda>n. real_of_rat (incratseq x n)) \<longlonglongrightarrow> x
[PROOF STEP]
using  LIMSEQ_squeeze tendsto_const
[PROOF STATE]
proof (prove)
using this:
\<forall>n. x - 1 / real (Suc n) \<le> real_of_rat (incratseq x n) \<and> real_of_rat (incratseq x n) \<le> x
(\<lambda>n. x - 1 / real (Suc n)) \<longlonglongrightarrow> x
\<lbrakk>\<forall>n. ?a n \<le> ?b n \<and> ?b n \<le> ?c n; ?a \<longlonglongrightarrow> ?L; ?c \<longlonglongrightarrow> ?L\<rbrakk> \<Longrightarrow> ?b \<longlonglongrightarrow> ?L
((\<lambda>x. ?k) \<longlongrightarrow> ?k) ?F

goal (1 subgoal):
 1. (\<lambda>n. real_of_rat (incratseq x n)) \<longlonglongrightarrow> x
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(\<lambda>n. real_of_rat (incratseq x n)) \<longlonglongrightarrow> x

goal (1 subgoal):
 1. \<exists>r. incseq r \<and> (\<lambda>n. real_of_rat (r n)) \<longlonglongrightarrow> x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. real_of_rat (incratseq x n)) \<longlonglongrightarrow> x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. real_of_rat (incratseq x n)) \<longlonglongrightarrow> x

goal (1 subgoal):
 1. \<exists>r. incseq r \<and> (\<lambda>n. real_of_rat (r n)) \<longlonglongrightarrow> x
[PROOF STEP]
using incseq_incratseq
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. real_of_rat (incratseq x n)) \<longlonglongrightarrow> x
incseq (incratseq ?x)

goal (1 subgoal):
 1. \<exists>r. incseq r \<and> (\<lambda>n. real_of_rat (r n)) \<longlonglongrightarrow> x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>r. incseq r \<and> (\<lambda>n. real_of_rat (r n)) \<longlonglongrightarrow> x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma weight_mono: "edges g \<subseteq> edges g' \<Longrightarrow> weight w g \<le> weight w g'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. edges g \<subseteq> edges g' \<Longrightarrow> weight w g \<le> weight w g'
[PROOF STEP]
unfolding weight_alt
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. edges g \<subseteq> edges g' \<Longrightarrow> sum w (uedge ` edges g) \<le> sum w (uedge ` edges g')
[PROOF STEP]
by (rule sum_mono2) auto


[STATEMENT]
lemma ka_blocks:
  "\<lbrakk> length pns = length Ts; length vs = length Ts \<rbrakk>
  \<Longrightarrow> ka (blocks pns Ts vs body) = \<Union>(ka_Val ` set vs) \<union> ka body"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length pns = length Ts; length vs = length Ts\<rbrakk> \<Longrightarrow> ka (blocks pns Ts vs body) = \<Union> (ka_Val ` set vs) \<union> ka body
[PROOF STEP]
by(induct pns Ts vs body rule: blocks.induct)(auto)


[STATEMENT]
theorem van_der_Waerden: assumes "l>0" "k>0" shows "\<exists>n. vdw k l n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n. vdw k l n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < l
0 < k

goal (1 subgoal):
 1. \<exists>n. vdw k l n
[PROOF STEP]
proof (induction l arbitrary: k rule: less_induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x k. \<lbrakk>\<And>y k. \<lbrakk>y < x; 0 < y; 0 < k\<rbrakk> \<Longrightarrow> Ex (vdw k y); 0 < x; 0 < k\<rbrakk> \<Longrightarrow> Ex (vdw k x)
[PROOF STEP]
case (less l)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?y < l; 0 < ?y; 0 < ?k\<rbrakk> \<Longrightarrow> \<exists>a. vdw ?k ?y a
0 < l
0 < k

goal (1 subgoal):
 1. \<And>x k. \<lbrakk>\<And>y k. \<lbrakk>y < x; 0 < y; 0 < k\<rbrakk> \<Longrightarrow> Ex (vdw k y); 0 < x; 0 < k\<rbrakk> \<Longrightarrow> Ex (vdw k x)
[PROOF STEP]
consider  "l=1" | "l=2" | "l>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>l = 1 \<Longrightarrow> thesis; l = 2 \<Longrightarrow> thesis; 2 < l \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
using less.prems
[PROOF STATE]
proof (prove)
using this:
0 < l
0 < k

goal (1 subgoal):
 1. \<lbrakk>l = 1 \<Longrightarrow> thesis; l = 2 \<Longrightarrow> thesis; 2 < l \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
\<lbrakk>l = 1 \<Longrightarrow> ?thesis; l = 2 \<Longrightarrow> ?thesis; 2 < l \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. \<And>x k. \<lbrakk>\<And>y k. \<lbrakk>y < x; 0 < y; 0 < k\<rbrakk> \<Longrightarrow> Ex (vdw k y); 0 < x; 0 < k\<rbrakk> \<Longrightarrow> Ex (vdw k x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>l = 1 \<Longrightarrow> ?thesis; l = 2 \<Longrightarrow> ?thesis; 2 < l \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>l = 1 \<Longrightarrow> ?thesis; l = 2 \<Longrightarrow> ?thesis; 2 < l \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. \<exists>a. vdw k l a
[PROOF STEP]
proof (cases)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. l = 1 \<Longrightarrow> \<exists>a. vdw k l a
 2. l = 2 \<Longrightarrow> \<exists>a. vdw k l a
 3. 2 < l \<Longrightarrow> \<exists>a. vdw k l a
[PROOF STEP]
assume "l=1"
[PROOF STATE]
proof (state)
this:
l = 1

goal (3 subgoals):
 1. l = 1 \<Longrightarrow> \<exists>a. vdw k l a
 2. l = 2 \<Longrightarrow> \<exists>a. vdw k l a
 3. 2 < l \<Longrightarrow> \<exists>a. vdw k l a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
l = 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
l = 1

goal (1 subgoal):
 1. \<exists>a. vdw k l a
[PROOF STEP]
using vdw_1_right
[PROOF STATE]
proof (prove)
using this:
l = 1
vdw ?k 1 1

goal (1 subgoal):
 1. \<exists>a. vdw k l a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>a. vdw k l a

goal (2 subgoals):
 1. l = 2 \<Longrightarrow> \<exists>a. vdw k l a
 2. 2 < l \<Longrightarrow> \<exists>a. vdw k l a
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. l = 2 \<Longrightarrow> \<exists>a. vdw k l a
 2. 2 < l \<Longrightarrow> \<exists>a. vdw k l a
[PROOF STEP]
assume "l=2"
[PROOF STATE]
proof (state)
this:
l = 2

goal (2 subgoals):
 1. l = 2 \<Longrightarrow> \<exists>a. vdw k l a
 2. 2 < l \<Longrightarrow> \<exists>a. vdw k l a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
l = 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
l = 2

goal (1 subgoal):
 1. \<exists>a. vdw k l a
[PROOF STEP]
using vdw_2_right
[PROOF STATE]
proof (prove)
using this:
l = 2
vdw ?k 2 (?k + 1)

goal (1 subgoal):
 1. \<exists>a. vdw k l a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>a. vdw k l a

goal (1 subgoal):
 1. 2 < l \<Longrightarrow> \<exists>a. vdw k l a
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 2 < l \<Longrightarrow> \<exists>a. vdw k l a
[PROOF STEP]
assume "l > 2"
[PROOF STATE]
proof (state)
this:
2 < l

goal (1 subgoal):
 1. 2 < l \<Longrightarrow> \<exists>a. vdw k l a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
2 < l
[PROOF STEP]
have "2\<le>l-1"
[PROOF STATE]
proof (prove)
using this:
2 < l

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

goal (1 subgoal):
 1. 2 < l \<Longrightarrow> \<exists>a. vdw k l a
[PROOF STEP]
from less.IH[of "l-1"] \<open>l>2\<close>
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>l - 1 < l; 0 < l - 1; 0 < ?k\<rbrakk> \<Longrightarrow> \<exists>a. vdw ?k (l - 1) a
2 < l
[PROOF STEP]
have "\<And>k'. k'>0 \<Longrightarrow> \<exists>n. vdw k' (l-1) n"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>l - 1 < l; 0 < l - 1; 0 < ?k\<rbrakk> \<Longrightarrow> \<exists>a. vdw ?k (l - 1) a
2 < l

goal (1 subgoal):
 1. \<And>k'. 0 < k' \<Longrightarrow> \<exists>n. vdw k' (l - 1) n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < ?k' \<Longrightarrow> \<exists>n. vdw ?k' (l - 1) n

goal (1 subgoal):
 1. 2 < l \<Longrightarrow> \<exists>a. vdw k l a
[PROOF STEP]
with vdw_imp_vdw_lemma[of "l-1" k k] \<open>l-1\<ge>2\<close> \<open>k>0\<close>
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>\<And>k'. 0 < k' \<Longrightarrow> \<exists>n_k'. vdw k' (l - 1) n_k'; 2 \<le> l - 1; 0 < k; 0 < k\<rbrakk> \<Longrightarrow> \<exists>N. vdw_lemma k k (l - 1) N
2 \<le> l - 1
0 < k
0 < ?k' \<Longrightarrow> \<exists>n. vdw ?k' (l - 1) n
[PROOF STEP]
obtain N where "vdw_lemma k k (l-1) N"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>k'. 0 < k' \<Longrightarrow> \<exists>n_k'. vdw k' (l - 1) n_k'; 2 \<le> l - 1; 0 < k; 0 < k\<rbrakk> \<Longrightarrow> \<exists>N. vdw_lemma k k (l - 1) N
2 \<le> l - 1
0 < k
0 < ?k' \<Longrightarrow> \<exists>n. vdw ?k' (l - 1) n

goal (1 subgoal):
 1. (\<And>N. vdw_lemma k k (l - 1) N \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vdw_lemma k k (l - 1) N

goal (1 subgoal):
 1. 2 < l \<Longrightarrow> \<exists>a. vdw k l a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vdw_lemma k k (l - 1) N
[PROOF STEP]
have "vdw k l N"
[PROOF STATE]
proof (prove)
using this:
vdw_lemma k k (l - 1) N

goal (1 subgoal):
 1. vdw k l N
[PROOF STEP]
using vdw_lemma_imp_vdw[of k "l-1" N]
[PROOF STATE]
proof (prove)
using this:
vdw_lemma k k (l - 1) N
vdw_lemma k k (l - 1) N \<Longrightarrow> vdw k (Suc (l - 1)) N

goal (1 subgoal):
 1. vdw k l N
[PROOF STEP]
by (simp add: less.prems(1))
[PROOF STATE]
proof (state)
this:
vdw k l N

goal (1 subgoal):
 1. 2 < l \<Longrightarrow> \<exists>a. vdw k l a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vdw k l N
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vdw k l N

goal (1 subgoal):
 1. \<exists>a. vdw k l a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>a. vdw k l a

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>a. vdw k l a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma homeomorphic_maps_id:
     "homeomorphic_maps X Y id id \<longleftrightarrow> Y = X"  (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homeomorphic_maps X Y id id = (Y = X)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. homeomorphic_maps X Y id id \<Longrightarrow> Y = X
 2. Y = X \<Longrightarrow> homeomorphic_maps X Y id id
[PROOF STEP]
assume L: ?lhs
[PROOF STATE]
proof (state)
this:
homeomorphic_maps X Y id id

goal (2 subgoals):
 1. homeomorphic_maps X Y id id \<Longrightarrow> Y = X
 2. Y = X \<Longrightarrow> homeomorphic_maps X Y id id
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
homeomorphic_maps X Y id id
[PROOF STEP]
have "topspace X = topspace Y"
[PROOF STATE]
proof (prove)
using this:
homeomorphic_maps X Y id id

goal (1 subgoal):
 1. topspace X = topspace Y
[PROOF STEP]
by (auto simp: homeomorphic_maps_def continuous_map_def)
[PROOF STATE]
proof (state)
this:
topspace X = topspace Y

goal (2 subgoals):
 1. homeomorphic_maps X Y id id \<Longrightarrow> Y = X
 2. Y = X \<Longrightarrow> homeomorphic_maps X Y id id
[PROOF STEP]
with L
[PROOF STATE]
proof (chain)
picking this:
homeomorphic_maps X Y id id
topspace X = topspace Y
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
homeomorphic_maps X Y id id
topspace X = topspace Y

goal (1 subgoal):
 1. Y = X
[PROOF STEP]
unfolding homeomorphic_maps_def
[PROOF STATE]
proof (prove)
using this:
continuous_map X Y id \<and> continuous_map Y X id \<and> (\<forall>x\<in>topspace X. id (id x) = x) \<and> (\<forall>y\<in>topspace Y. id (id y) = y)
topspace X = topspace Y

goal (1 subgoal):
 1. Y = X
[PROOF STEP]
by (metis topology_finer_continuous_id topology_eq)
[PROOF STATE]
proof (state)
this:
Y = X

goal (1 subgoal):
 1. Y = X \<Longrightarrow> homeomorphic_maps X Y id id
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Y = X \<Longrightarrow> homeomorphic_maps X Y id id
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
Y = X

goal (1 subgoal):
 1. Y = X \<Longrightarrow> homeomorphic_maps X Y id id
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Y = X
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
using this:
Y = X

goal (1 subgoal):
 1. homeomorphic_maps X Y id id
[PROOF STEP]
unfolding homeomorphic_maps_def
[PROOF STATE]
proof (prove)
using this:
Y = X

goal (1 subgoal):
 1. continuous_map X Y id \<and> continuous_map Y X id \<and> (\<forall>x\<in>topspace X. id (id x) = x) \<and> (\<forall>y\<in>topspace Y. id (id y) = y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
homeomorphic_maps X Y id id

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma le_Suc_cases: "\<lbrakk>\<And>i. \<lbrakk>i < k\<rbrakk> \<Longrightarrow> P i; P k\<rbrakk> \<Longrightarrow> \<forall>i<(Suc k). P i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>i. i < k \<Longrightarrow> P i; P k\<rbrakk> \<Longrightarrow> \<forall>i<Suc k. P i
[PROOF STEP]
apply clarify
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>\<And>i. i < k \<Longrightarrow> P i; P k; i < Suc k\<rbrakk> \<Longrightarrow> P i
[PROOF STEP]
apply (case_tac "i=k")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i. \<lbrakk>\<And>i. i < k \<Longrightarrow> P i; P k; i < Suc k; i = k\<rbrakk> \<Longrightarrow> P i
 2. \<And>i. \<lbrakk>\<And>i. i < k \<Longrightarrow> P i; P k; i < Suc k; i \<noteq> k\<rbrakk> \<Longrightarrow> P i
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma absolutely_integrable_abs_iff:
   "f absolutely_integrable_on S \<longleftrightarrow>
    f integrable_on S \<and> (\<lambda>x. \<Sum>i\<in>Basis. \<bar>f x \<bullet> i\<bar> *\<^sub>R i) integrable_on S"
    (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f absolutely_integrable_on S) = (f integrable_on S \<and> (\<lambda>x. \<Sum>i\<in>Basis. \<bar>f x \<bullet> i\<bar> *\<^sub>R i) integrable_on S)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f absolutely_integrable_on S \<Longrightarrow> f integrable_on S \<and> (\<lambda>x. \<Sum>i\<in>Basis. \<bar>f x \<bullet> i\<bar> *\<^sub>R i) integrable_on S
 2. f integrable_on S \<and> (\<lambda>x. \<Sum>i\<in>Basis. \<bar>f x \<bullet> i\<bar> *\<^sub>R i) integrable_on S \<Longrightarrow> f absolutely_integrable_on S
[PROOF STEP]
assume ?lhs
[PROOF STATE]
proof (state)
this:
f absolutely_integrable_on S

goal (2 subgoals):
 1. f absolutely_integrable_on S \<Longrightarrow> f integrable_on S \<and> (\<lambda>x. \<Sum>i\<in>Basis. \<bar>f x \<bullet> i\<bar> *\<^sub>R i) integrable_on S
 2. f integrable_on S \<and> (\<lambda>x. \<Sum>i\<in>Basis. \<bar>f x \<bullet> i\<bar> *\<^sub>R i) integrable_on S \<Longrightarrow> f absolutely_integrable_on S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f absolutely_integrable_on S
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
f absolutely_integrable_on S

goal (1 subgoal):
 1. f integrable_on S \<and> (\<lambda>x. \<Sum>i\<in>Basis. \<bar>f x \<bullet> i\<bar> *\<^sub>R i) integrable_on S
[PROOF STEP]
using absolutely_integrable_abs absolutely_integrable_on_def
[PROOF STATE]
proof (prove)
using this:
f absolutely_integrable_on S
?f absolutely_integrable_on ?S \<Longrightarrow> (\<lambda>x. \<Sum>i\<in>Basis. \<bar>?f x \<bullet> i\<bar> *\<^sub>R i) absolutely_integrable_on ?S
(?f absolutely_integrable_on ?S) = (?f integrable_on ?S \<and> (\<lambda>x. norm (?f x)) integrable_on ?S)

goal (1 subgoal):
 1. f integrable_on S \<and> (\<lambda>x. \<Sum>i\<in>Basis. \<bar>f x \<bullet> i\<bar> *\<^sub>R i) integrable_on S
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f integrable_on S \<and> (\<lambda>x. \<Sum>i\<in>Basis. \<bar>f x \<bullet> i\<bar> *\<^sub>R i) integrable_on S

goal (1 subgoal):
 1. f integrable_on S \<and> (\<lambda>x. \<Sum>i\<in>Basis. \<bar>f x \<bullet> i\<bar> *\<^sub>R i) integrable_on S \<Longrightarrow> f absolutely_integrable_on S
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f integrable_on S \<and> (\<lambda>x. \<Sum>i\<in>Basis. \<bar>f x \<bullet> i\<bar> *\<^sub>R i) integrable_on S \<Longrightarrow> f absolutely_integrable_on S
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
f integrable_on S \<and> (\<lambda>x. \<Sum>i\<in>Basis. \<bar>f x \<bullet> i\<bar> *\<^sub>R i) integrable_on S

goal (1 subgoal):
 1. f integrable_on S \<and> (\<lambda>x. \<Sum>i\<in>Basis. \<bar>f x \<bullet> i\<bar> *\<^sub>R i) integrable_on S \<Longrightarrow> f absolutely_integrable_on S
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
f integrable_on S \<and> (\<lambda>x. \<Sum>i\<in>Basis. \<bar>f x \<bullet> i\<bar> *\<^sub>R i) integrable_on S

goal (1 subgoal):
 1. f integrable_on S \<and> (\<lambda>x. \<Sum>i\<in>Basis. \<bar>f x \<bullet> i\<bar> *\<^sub>R i) integrable_on S \<Longrightarrow> f absolutely_integrable_on S
[PROOF STEP]
have "(\<lambda>x. if x \<in> S then \<Sum>i\<in>Basis. \<bar>f x \<bullet> i\<bar> *\<^sub>R i else 0) = (\<lambda>x. \<Sum>i\<in>Basis. \<bar>(if x \<in> S then f x else 0) \<bullet> i\<bar> *\<^sub>R i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. if x \<in> S then \<Sum>i\<in>Basis. \<bar>f x \<bullet> i\<bar> *\<^sub>R i else (0::'b)) = (\<lambda>x. \<Sum>i\<in>Basis. \<bar>(if x \<in> S then f x else (0::'b)) \<bullet> i\<bar> *\<^sub>R i)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
(\<lambda>x. if x \<in> S then \<Sum>i\<in>Basis. \<bar>f x \<bullet> i\<bar> *\<^sub>R i else (0::'b)) = (\<lambda>x. \<Sum>i\<in>Basis. \<bar>(if x \<in> S then f x else (0::'b)) \<bullet> i\<bar> *\<^sub>R i)

goal (1 subgoal):
 1. f integrable_on S \<and> (\<lambda>x. \<Sum>i\<in>Basis. \<bar>f x \<bullet> i\<bar> *\<^sub>R i) integrable_on S \<Longrightarrow> f absolutely_integrable_on S
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
f integrable_on S \<and> (\<lambda>x. \<Sum>i\<in>Basis. \<bar>f x \<bullet> i\<bar> *\<^sub>R i) integrable_on S
(\<lambda>x. if x \<in> S then \<Sum>i\<in>Basis. \<bar>f x \<bullet> i\<bar> *\<^sub>R i else (0::'b)) = (\<lambda>x. \<Sum>i\<in>Basis. \<bar>(if x \<in> S then f x else (0::'b)) \<bullet> i\<bar> *\<^sub>R i)
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
using this:
f integrable_on S \<and> (\<lambda>x. \<Sum>i\<in>Basis. \<bar>f x \<bullet> i\<bar> *\<^sub>R i) integrable_on S
(\<lambda>x. if x \<in> S then \<Sum>i\<in>Basis. \<bar>f x \<bullet> i\<bar> *\<^sub>R i else (0::'b)) = (\<lambda>x. \<Sum>i\<in>Basis. \<bar>(if x \<in> S then f x else (0::'b)) \<bullet> i\<bar> *\<^sub>R i)

goal (1 subgoal):
 1. f absolutely_integrable_on S
[PROOF STEP]
by (simp only: absolutely_integrable_restrict_UNIV [of S, symmetric] integrable_restrict_UNIV [of S, symmetric] abs_absolutely_integrableI)
[PROOF STATE]
proof (state)
this:
f absolutely_integrable_on S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma shiftl_integer_conv_mult_pow2:
  fixes x :: integer shows
  "push_bit n x = x * 2 ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. push_bit n x = x * 2 ^ n
[PROOF STEP]
by (fact push_bit_eq_mult)


[STATEMENT]
lemma denom_dvd_ints:
  fixes i::int
  assumes "quotient_of r = (z, n)" "of_int i * r \<in> \<int>"
  shows "n dvd i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n dvd i
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n dvd i
[PROOF STEP]
have "rat_of_int i * (rat_of_int z / rat_of_int n) \<in> \<int>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_of_int i * (rat_of_int z / rat_of_int n) \<in> \<int>
[PROOF STEP]
using assms quotient_of_div
[PROOF STATE]
proof (prove)
using this:
quotient_of r = (z, n)
rat_of_int i * r \<in> \<int>
quotient_of ?r = (?n, ?d) \<Longrightarrow> ?r = rat_of_int ?n / rat_of_int ?d

goal (1 subgoal):
 1. rat_of_int i * (rat_of_int z / rat_of_int n) \<in> \<int>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
rat_of_int i * (rat_of_int z / rat_of_int n) \<in> \<int>

goal (1 subgoal):
 1. n dvd i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rat_of_int i * (rat_of_int z / rat_of_int n) \<in> \<int>
[PROOF STEP]
have "n dvd i * z"
[PROOF STATE]
proof (prove)
using this:
rat_of_int i * (rat_of_int z / rat_of_int n) \<in> \<int>

goal (1 subgoal):
 1. n dvd i * z
[PROOF STEP]
using quotient_of_denom_pos assms
[PROOF STATE]
proof (prove)
using this:
rat_of_int i * (rat_of_int z / rat_of_int n) \<in> \<int>
quotient_of ?r = (?p, ?q) \<Longrightarrow> 0 < ?q
quotient_of r = (z, n)
rat_of_int i * r \<in> \<int>

goal (1 subgoal):
 1. n dvd i * z
[PROOF STEP]
by (auto intro!: of_int_dvd)
[PROOF STATE]
proof (state)
this:
n dvd i * z

goal (1 subgoal):
 1. n dvd i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n dvd i * z
[PROOF STEP]
show "n dvd i"
[PROOF STATE]
proof (prove)
using this:
n dvd i * z

goal (1 subgoal):
 1. n dvd i
[PROOF STEP]
using assms algebraic_semidom_class.coprime_commute
      quotient_of_coprime coprime_dvd_mult_left_iff
[PROOF STATE]
proof (prove)
using this:
n dvd i * z
quotient_of r = (z, n)
rat_of_int i * r \<in> \<int>
algebraic_semidom_class.coprime ?b ?a = algebraic_semidom_class.coprime ?a ?b
quotient_of ?r = (?p, ?q) \<Longrightarrow> algebraic_semidom_class.coprime ?p ?q
algebraic_semidom_class.coprime ?a ?c \<Longrightarrow> (?a dvd ?b * ?c) = (?a dvd ?b)

goal (1 subgoal):
 1. n dvd i
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
n dvd i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eq_omega_sum_eq_iff:
  assumes "length ms = length ns"
  shows "omega_sum ms = omega_sum ns \<longleftrightarrow> ms=ns"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (omega_sum ms = omega_sum ns) = (ms = ns)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. omega_sum ms = omega_sum ns \<Longrightarrow> ms = ns
 2. ms = ns \<Longrightarrow> omega_sum ms = omega_sum ns
[PROOF STEP]
assume "omega_sum ms = omega_sum ns"
[PROOF STATE]
proof (state)
this:
omega_sum ms = omega_sum ns

goal (2 subgoals):
 1. omega_sum ms = omega_sum ns \<Longrightarrow> ms = ns
 2. ms = ns \<Longrightarrow> omega_sum ms = omega_sum ns
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
omega_sum ms = omega_sum ns
[PROOF STEP]
have "(omega_sum ms, omega_sum ns) \<notin> VWF" "(omega_sum ns, omega_sum ms) \<notin> VWF"
[PROOF STATE]
proof (prove)
using this:
omega_sum ms = omega_sum ns

goal (1 subgoal):
 1. (omega_sum ms, omega_sum ns) \<notin> VWF &&& (omega_sum ns, omega_sum ms) \<notin> VWF
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(omega_sum ms, omega_sum ns) \<notin> VWF
(omega_sum ns, omega_sum ms) \<notin> VWF

goal (2 subgoals):
 1. omega_sum ms = omega_sum ns \<Longrightarrow> ms = ns
 2. ms = ns \<Longrightarrow> omega_sum ms = omega_sum ns
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(omega_sum ms, omega_sum ns) \<notin> VWF
(omega_sum ns, omega_sum ms) \<notin> VWF
[PROOF STEP]
obtain "(ms,ns) \<notin> lenlex less_than" "(ns,ms) \<notin> lenlex less_than"
[PROOF STATE]
proof (prove)
using this:
(omega_sum ms, omega_sum ns) \<notin> VWF
(omega_sum ns, omega_sum ms) \<notin> VWF

goal (1 subgoal):
 1. (\<lbrakk>(ms, ns) \<notin> lenlex less_than; (ns, ms) \<notin> lenlex less_than\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms eq_omega_sum_less_iff
[PROOF STATE]
proof (prove)
using this:
(omega_sum ms, omega_sum ns) \<notin> VWF
(omega_sum ns, omega_sum ms) \<notin> VWF
length ms = length ns
length ?ms = length ?ns \<Longrightarrow> ((omega_sum ?ms, omega_sum ?ns) \<in> VWF) = ((?ms, ?ns) \<in> lenlex less_than)

goal (1 subgoal):
 1. (\<lbrakk>(ms, ns) \<notin> lenlex less_than; (ns, ms) \<notin> lenlex less_than\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
(ms, ns) \<notin> lenlex less_than
(ns, ms) \<notin> lenlex less_than

goal (2 subgoals):
 1. omega_sum ms = omega_sum ns \<Longrightarrow> ms = ns
 2. ms = ns \<Longrightarrow> omega_sum ms = omega_sum ns
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(ms, ns) \<notin> lenlex less_than
(ns, ms) \<notin> lenlex less_than

goal (2 subgoals):
 1. omega_sum ms = omega_sum ns \<Longrightarrow> ms = ns
 2. ms = ns \<Longrightarrow> omega_sum ms = omega_sum ns
[PROOF STEP]
have "total (lenlex less_than)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. total (lenlex less_than)
[PROOF STEP]
by (simp add: total_lenlex total_less_than)
[PROOF STATE]
proof (state)
this:
total (lenlex less_than)

goal (2 subgoals):
 1. omega_sum ms = omega_sum ns \<Longrightarrow> ms = ns
 2. ms = ns \<Longrightarrow> omega_sum ms = omega_sum ns
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(ms, ns) \<notin> lenlex less_than
(ns, ms) \<notin> lenlex less_than
total (lenlex less_than)
[PROOF STEP]
show "ms=ns"
[PROOF STATE]
proof (prove)
using this:
(ms, ns) \<notin> lenlex less_than
(ns, ms) \<notin> lenlex less_than
total (lenlex less_than)

goal (1 subgoal):
 1. ms = ns
[PROOF STEP]
by (meson UNIV_I total_on_def)
[PROOF STATE]
proof (state)
this:
ms = ns

goal (1 subgoal):
 1. ms = ns \<Longrightarrow> omega_sum ms = omega_sum ns
[PROOF STEP]
qed auto


[STATEMENT]
lemma holomorphic_on_powr_of_int [holomorphic_intros]:
  assumes holf: "f holomorphic_on S" and 0: "\<And>z. z\<in>S \<Longrightarrow> f z \<noteq> 0"
  shows "(\<lambda>z. (f z) powr of_int n) holomorphic_on S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>z. f z powr of_int n) holomorphic_on S
[PROOF STEP]
proof (cases "n\<ge>0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 \<le> n \<Longrightarrow> (\<lambda>z. f z powr of_int n) holomorphic_on S
 2. \<not> 0 \<le> n \<Longrightarrow> (\<lambda>z. f z powr of_int n) holomorphic_on S
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
0 \<le> n

goal (2 subgoals):
 1. 0 \<le> n \<Longrightarrow> (\<lambda>z. f z powr of_int n) holomorphic_on S
 2. \<not> 0 \<le> n \<Longrightarrow> (\<lambda>z. f z powr of_int n) holomorphic_on S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 \<le> n
[PROOF STEP]
have "?thesis \<longleftrightarrow> (\<lambda>z. (f z) ^ nat n) holomorphic_on S"
[PROOF STATE]
proof (prove)
using this:
0 \<le> n

goal (1 subgoal):
 1. ((\<lambda>z. f z powr of_int n) holomorphic_on S) = ((\<lambda>z. f z ^ nat n) holomorphic_on S)
[PROOF STEP]
by (metis (no_types, lifting) 0 holomorphic_cong powr_of_int)
[PROOF STATE]
proof (state)
this:
((\<lambda>z. f z powr of_int n) holomorphic_on S) = ((\<lambda>z. f z ^ nat n) holomorphic_on S)

goal (2 subgoals):
 1. 0 \<le> n \<Longrightarrow> (\<lambda>z. f z powr of_int n) holomorphic_on S
 2. \<not> 0 \<le> n \<Longrightarrow> (\<lambda>z. f z powr of_int n) holomorphic_on S
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
((\<lambda>z. f z powr of_int n) holomorphic_on S) = ((\<lambda>z. f z ^ nat n) holomorphic_on S)

goal (2 subgoals):
 1. 0 \<le> n \<Longrightarrow> (\<lambda>z. f z powr of_int n) holomorphic_on S
 2. \<not> 0 \<le> n \<Longrightarrow> (\<lambda>z. f z powr of_int n) holomorphic_on S
[PROOF STEP]
have "(\<lambda>z. (f z) ^ nat n) holomorphic_on S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>z. f z ^ nat n) holomorphic_on S
[PROOF STEP]
using holf
[PROOF STATE]
proof (prove)
using this:
f holomorphic_on S

goal (1 subgoal):
 1. (\<lambda>z. f z ^ nat n) holomorphic_on S
[PROOF STEP]
by (auto intro: holomorphic_intros)
[PROOF STATE]
proof (state)
this:
(\<lambda>z. f z ^ nat n) holomorphic_on S

goal (2 subgoals):
 1. 0 \<le> n \<Longrightarrow> (\<lambda>z. f z powr of_int n) holomorphic_on S
 2. \<not> 0 \<le> n \<Longrightarrow> (\<lambda>z. f z powr of_int n) holomorphic_on S
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>z. f z powr of_int n) holomorphic_on S) = ((\<lambda>z. f z ^ nat n) holomorphic_on S)
(\<lambda>z. f z ^ nat n) holomorphic_on S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>z. f z powr of_int n) holomorphic_on S) = ((\<lambda>z. f z ^ nat n) holomorphic_on S)
(\<lambda>z. f z ^ nat n) holomorphic_on S

goal (1 subgoal):
 1. (\<lambda>z. f z powr of_int n) holomorphic_on S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>z. f z powr of_int n) holomorphic_on S

goal (1 subgoal):
 1. \<not> 0 \<le> n \<Longrightarrow> (\<lambda>z. f z powr of_int n) holomorphic_on S
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> 0 \<le> n \<Longrightarrow> (\<lambda>z. f z powr of_int n) holomorphic_on S
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> 0 \<le> n

goal (1 subgoal):
 1. \<not> 0 \<le> n \<Longrightarrow> (\<lambda>z. f z powr of_int n) holomorphic_on S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> 0 \<le> n
[PROOF STEP]
have "?thesis \<longleftrightarrow> (\<lambda>z. inverse (f z) ^ nat (-n)) holomorphic_on S"
[PROOF STATE]
proof (prove)
using this:
\<not> 0 \<le> n

goal (1 subgoal):
 1. ((\<lambda>z. f z powr of_int n) holomorphic_on S) = ((\<lambda>z. inverse (f z) ^ nat (- n)) holomorphic_on S)
[PROOF STEP]
by (metis (no_types, lifting) "0" holomorphic_cong power_inverse powr_of_int)
[PROOF STATE]
proof (state)
this:
((\<lambda>z. f z powr of_int n) holomorphic_on S) = ((\<lambda>z. inverse (f z) ^ nat (- n)) holomorphic_on S)

goal (1 subgoal):
 1. \<not> 0 \<le> n \<Longrightarrow> (\<lambda>z. f z powr of_int n) holomorphic_on S
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
((\<lambda>z. f z powr of_int n) holomorphic_on S) = ((\<lambda>z. inverse (f z) ^ nat (- n)) holomorphic_on S)

goal (1 subgoal):
 1. \<not> 0 \<le> n \<Longrightarrow> (\<lambda>z. f z powr of_int n) holomorphic_on S
[PROOF STEP]
have "(\<lambda>z. inverse (f z) ^ nat (-n)) holomorphic_on S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>z. inverse (f z) ^ nat (- n)) holomorphic_on S
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f holomorphic_on S
?z \<in> S \<Longrightarrow> f ?z \<noteq> 0

goal (1 subgoal):
 1. (\<lambda>z. inverse (f z) ^ nat (- n)) holomorphic_on S
[PROOF STEP]
by (auto intro!:holomorphic_intros)
[PROOF STATE]
proof (state)
this:
(\<lambda>z. inverse (f z) ^ nat (- n)) holomorphic_on S

goal (1 subgoal):
 1. \<not> 0 \<le> n \<Longrightarrow> (\<lambda>z. f z powr of_int n) holomorphic_on S
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>z. f z powr of_int n) holomorphic_on S) = ((\<lambda>z. inverse (f z) ^ nat (- n)) holomorphic_on S)
(\<lambda>z. inverse (f z) ^ nat (- n)) holomorphic_on S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>z. f z powr of_int n) holomorphic_on S) = ((\<lambda>z. inverse (f z) ^ nat (- n)) holomorphic_on S)
(\<lambda>z. inverse (f z) ^ nat (- n)) holomorphic_on S

goal (1 subgoal):
 1. (\<lambda>z. f z powr of_int n) holomorphic_on S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>z. f z powr of_int n) holomorphic_on S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma empty_rep: "t=empty \<longleftrightarrow> Rep_FingerTree t = Empty"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (t = local.empty) = (Rep_FingerTree t = Empty)
[PROOF STEP]
apply (auto simp add: empty_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Rep_FingerTree t = Empty \<Longrightarrow> t = Abs_FingerTree Empty
[PROOF STEP]
apply (metis Rep_FingerTree_inverse)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma cong_2_pow[intro]: "(-1 :: int)^a = (-1)^b" if "[a = b] (mod 2)" for a b :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- 1) ^ a = (- 1) ^ b
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (- 1) ^ a = (- 1) ^ b
[PROOF STEP]
have "even a = even b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. even a = even b
[PROOF STEP]
by (simp add: cong_dvd_iff that)
[PROOF STATE]
proof (state)
this:
even a = even b

goal (1 subgoal):
 1. (- 1) ^ a = (- 1) ^ b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
even a = even b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
even a = even b

goal (1 subgoal):
 1. (- 1) ^ a = (- 1) ^ b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(- 1) ^ a = (- 1) ^ b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma stable_ordIso1:
assumes ST: "stable r" and ISO: "r' =o r"
shows "stable r'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. stable r'
[PROOF STEP]
proof(unfold stable_def, auto)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>A F. \<lbrakk>|A| <o r'; \<forall>a\<in>A. |F a| <o r'\<rbrakk> \<Longrightarrow> |Sigma A F| <o r'
[PROOF STEP]
fix A::"'b set" and F::"'b \<Rightarrow> 'b set"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>A F. \<lbrakk>|A| <o r'; \<forall>a\<in>A. |F a| <o r'\<rbrakk> \<Longrightarrow> |Sigma A F| <o r'
[PROOF STEP]
assume "|A| <o r'" and "\<forall>a \<in> A. |F a| <o r'"
[PROOF STATE]
proof (state)
this:
|A| <o r'
\<forall>a\<in>A. |F a| <o r'

goal (1 subgoal):
 1. \<And>A F. \<lbrakk>|A| <o r'; \<forall>a\<in>A. |F a| <o r'\<rbrakk> \<Longrightarrow> |Sigma A F| <o r'
[PROOF STEP]
hence "( |A| <o r) \<and> (\<forall>a \<in> A. |F a| <o r)"
[PROOF STATE]
proof (prove)
using this:
|A| <o r'
\<forall>a\<in>A. |F a| <o r'

goal (1 subgoal):
 1. |A| <o r \<and> (\<forall>a\<in>A. |F a| <o r)
[PROOF STEP]
using ISO ordLess_ordIso_trans
[PROOF STATE]
proof (prove)
using this:
|A| <o r'
\<forall>a\<in>A. |F a| <o r'
r' =o r
\<lbrakk>?r <o ?r'; ?r' =o ?r''\<rbrakk> \<Longrightarrow> ?r <o ?r''

goal (1 subgoal):
 1. |A| <o r \<and> (\<forall>a\<in>A. |F a| <o r)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
|A| <o r \<and> (\<forall>a\<in>A. |F a| <o r)

goal (1 subgoal):
 1. \<And>A F. \<lbrakk>|A| <o r'; \<forall>a\<in>A. |F a| <o r'\<rbrakk> \<Longrightarrow> |Sigma A F| <o r'
[PROOF STEP]
hence "|SIGMA a : A. F a| <o r"
[PROOF STATE]
proof (prove)
using this:
|A| <o r \<and> (\<forall>a\<in>A. |F a| <o r)

goal (1 subgoal):
 1. |Sigma A F| <o r
[PROOF STEP]
using assms stable_elim
[PROOF STATE]
proof (prove)
using this:
|A| <o r \<and> (\<forall>a\<in>A. |F a| <o r)
stable r
r' =o r
\<lbrakk>stable ?r; |?A| <o ?r; \<And>a. a \<in> ?A \<Longrightarrow> |?F a| <o ?r\<rbrakk> \<Longrightarrow> |Sigma ?A ?F| <o ?r

goal (1 subgoal):
 1. |Sigma A F| <o r
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
|Sigma A F| <o r

goal (1 subgoal):
 1. \<And>A F. \<lbrakk>|A| <o r'; \<forall>a\<in>A. |F a| <o r'\<rbrakk> \<Longrightarrow> |Sigma A F| <o r'
[PROOF STEP]
thus "|SIGMA a : A. F a| <o r'"
[PROOF STATE]
proof (prove)
using this:
|Sigma A F| <o r

goal (1 subgoal):
 1. |Sigma A F| <o r'
[PROOF STEP]
using ISO ordIso_symmetric ordLess_ordIso_trans
[PROOF STATE]
proof (prove)
using this:
|Sigma A F| <o r
r' =o r
?r =o ?r' \<Longrightarrow> ?r' =o ?r
\<lbrakk>?r <o ?r'; ?r' =o ?r''\<rbrakk> \<Longrightarrow> ?r <o ?r''

goal (1 subgoal):
 1. |Sigma A F| <o r'
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
|Sigma A F| <o r'

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma subst_pp_alt: "subst_pp f t = (\<Prod>x. (f x) ^ (lookup t x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subst_pp f t = (\<Prod>x. f x ^ lookup t x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. subst_pp f t = (\<Prod>x. f x ^ lookup t x)
[PROOF STEP]
from finite_keys
[PROOF STATE]
proof (chain)
picking this:
finite (keys ?f)
[PROOF STEP]
have "subst_pp f t = (\<Prod>x. if x \<in> keys t then (f x) ^ (lookup t x) else 1)"
[PROOF STATE]
proof (prove)
using this:
finite (keys ?f)

goal (1 subgoal):
 1. subst_pp f t = (\<Prod>x. if x \<in> keys t then f x ^ lookup t x else 1)
[PROOF STEP]
unfolding subst_pp_def
[PROOF STATE]
proof (prove)
using this:
finite (keys ?f)

goal (1 subgoal):
 1. (\<Prod>x\<in>keys t. f x ^ lookup t x) = (\<Prod>x. if x \<in> keys t then f x ^ lookup t x else 1)
[PROOF STEP]
by (rule Prod_any.conditionalize)
[PROOF STATE]
proof (state)
this:
subst_pp f t = (\<Prod>x. if x \<in> keys t then f x ^ lookup t x else 1)

goal (1 subgoal):
 1. subst_pp f t = (\<Prod>x. f x ^ lookup t x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
subst_pp f t = (\<Prod>x. if x \<in> keys t then f x ^ lookup t x else 1)

goal (1 subgoal):
 1. subst_pp f t = (\<Prod>x. f x ^ lookup t x)
[PROOF STEP]
have "... = (\<Prod>x. (f x) ^ (lookup t x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>x. if x \<in> keys t then f x ^ lookup t x else 1) = (\<Prod>x. f x ^ lookup t x)
[PROOF STEP]
by (rule Prod_any.cong) (simp add: in_keys_iff)
[PROOF STATE]
proof (state)
this:
(\<Prod>x. if x \<in> keys t then f x ^ lookup t x else 1) = (\<Prod>x. f x ^ lookup t x)

goal (1 subgoal):
 1. subst_pp f t = (\<Prod>x. f x ^ lookup t x)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
subst_pp f t = (\<Prod>x. f x ^ lookup t x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
subst_pp f t = (\<Prod>x. f x ^ lookup t x)

goal (1 subgoal):
 1. subst_pp f t = (\<Prod>x. f x ^ lookup t x)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
subst_pp f t = (\<Prod>x. f x ^ lookup t x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_eq_1_iff_ex1: "x \<in> A \<Longrightarrow> card A = 1 \<longleftrightarrow> A = {x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> A \<Longrightarrow> (card A = 1) = (A = {x})
[PROOF STEP]
apply(rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>x \<in> A; card A = 1\<rbrakk> \<Longrightarrow> A = {x}
 2. \<lbrakk>x \<in> A; A = {x}\<rbrakk> \<Longrightarrow> card A = 1
[PROOF STEP]
apply(rule equalityI)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>x \<in> A; card A = 1\<rbrakk> \<Longrightarrow> A \<subseteq> {x}
 2. \<lbrakk>x \<in> A; card A = 1\<rbrakk> \<Longrightarrow> {x} \<subseteq> A
 3. \<lbrakk>x \<in> A; A = {x}\<rbrakk> \<Longrightarrow> card A = 1
[PROOF STEP]
apply(rule subsetI)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>xa. \<lbrakk>x \<in> A; card A = 1; xa \<in> A\<rbrakk> \<Longrightarrow> xa \<in> {x}
 2. \<lbrakk>x \<in> A; card A = 1\<rbrakk> \<Longrightarrow> {x} \<subseteq> A
 3. \<lbrakk>x \<in> A; A = {x}\<rbrakk> \<Longrightarrow> card A = 1
[PROOF STEP]
apply(subgoal_tac "card {x, xa} \<le> card A")
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>xa. \<lbrakk>x \<in> A; card A = 1; xa \<in> A; card {x, xa} \<le> card A\<rbrakk> \<Longrightarrow> xa \<in> {x}
 2. \<And>xa. \<lbrakk>x \<in> A; card A = 1; xa \<in> A\<rbrakk> \<Longrightarrow> card {x, xa} \<le> card A
 3. \<lbrakk>x \<in> A; card A = 1\<rbrakk> \<Longrightarrow> {x} \<subseteq> A
 4. \<lbrakk>x \<in> A; A = {x}\<rbrakk> \<Longrightarrow> card A = 1
[PROOF STEP]
apply(auto intro: ccontr)[1]
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>xa. \<lbrakk>x \<in> A; card A = 1; xa \<in> A\<rbrakk> \<Longrightarrow> card {x, xa} \<le> card A
 2. \<lbrakk>x \<in> A; card A = 1\<rbrakk> \<Longrightarrow> {x} \<subseteq> A
 3. \<lbrakk>x \<in> A; A = {x}\<rbrakk> \<Longrightarrow> card A = 1
[PROOF STEP]
apply(rule card_mono)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>xa. \<lbrakk>x \<in> A; card A = 1; xa \<in> A\<rbrakk> \<Longrightarrow> finite A
 2. \<And>xa. \<lbrakk>x \<in> A; card A = 1; xa \<in> A\<rbrakk> \<Longrightarrow> {x, xa} \<subseteq> A
 3. \<lbrakk>x \<in> A; card A = 1\<rbrakk> \<Longrightarrow> {x} \<subseteq> A
 4. \<lbrakk>x \<in> A; A = {x}\<rbrakk> \<Longrightarrow> card A = 1
[PROOF STEP]
apply simp_all
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. \<lbrakk>x \<in> A; card A = Suc 0; xa \<in> A\<rbrakk> \<Longrightarrow> finite A
[PROOF STEP]
apply(metis Suc_n_not_n card.infinite)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma cone_rel_interior:
  fixes S :: "'m::euclidean_space set"
  assumes "cone S"
  shows "cone ({0} \<union> rel_interior S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cone ({0::'m} \<union> rel_interior S)
[PROOF STEP]
proof (cases "S = {}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. S = {} \<Longrightarrow> cone ({0::'m} \<union> rel_interior S)
 2. S \<noteq> {} \<Longrightarrow> cone ({0::'m} \<union> rel_interior S)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
S = {}

goal (2 subgoals):
 1. S = {} \<Longrightarrow> cone ({0::'m} \<union> rel_interior S)
 2. S \<noteq> {} \<Longrightarrow> cone ({0::'m} \<union> rel_interior S)
[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. cone ({0::'m} \<union> rel_interior S)
[PROOF STEP]
by (simp add: cone_0)
[PROOF STATE]
proof (state)
this:
cone ({0::'m} \<union> rel_interior S)

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> cone ({0::'m} \<union> rel_interior S)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> cone ({0::'m} \<union> rel_interior S)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
S \<noteq> {}

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> cone ({0::'m} \<union> rel_interior S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
S \<noteq> {}
[PROOF STEP]
have *: "0 \<in> S \<and> (\<forall>c. c > 0 \<longrightarrow> (*\<^sub>R) c ` S = S)"
[PROOF STATE]
proof (prove)
using this:
S \<noteq> {}

goal (1 subgoal):
 1. (0::'m) \<in> S \<and> (\<forall>c>0. (*\<^sub>R) c ` S = S)
[PROOF STEP]
using cone_iff[of S] assms
[PROOF STATE]
proof (prove)
using this:
S \<noteq> {}
S \<noteq> {} \<Longrightarrow> cone S = ((0::'m) \<in> S \<and> (\<forall>c>0. (*\<^sub>R) c ` S = S))
cone S

goal (1 subgoal):
 1. (0::'m) \<in> S \<and> (\<forall>c>0. (*\<^sub>R) c ` S = S)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(0::'m) \<in> S \<and> (\<forall>c>0. (*\<^sub>R) c ` S = S)

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> cone ({0::'m} \<union> rel_interior S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(0::'m) \<in> S \<and> (\<forall>c>0. (*\<^sub>R) c ` S = S)
[PROOF STEP]
have *: "0 \<in> ({0} \<union> rel_interior S)"
    and "\<forall>c. c > 0 \<longrightarrow> (*\<^sub>R) c ` ({0} \<union> rel_interior S) = ({0} \<union> rel_interior S)"
[PROOF STATE]
proof (prove)
using this:
(0::'m) \<in> S \<and> (\<forall>c>0. (*\<^sub>R) c ` S = S)

goal (1 subgoal):
 1. (0::'m) \<in> {0::'m} \<union> rel_interior S &&& \<forall>c>0. (*\<^sub>R) c ` ({0::'m} \<union> rel_interior S) = {0::'m} \<union> rel_interior S
[PROOF STEP]
by (auto simp add: rel_interior_scaleR)
[PROOF STATE]
proof (state)
this:
(0::'m) \<in> {0::'m} \<union> rel_interior S
\<forall>c>0. (*\<^sub>R) c ` ({0::'m} \<union> rel_interior S) = {0::'m} \<union> rel_interior S

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> cone ({0::'m} \<union> rel_interior S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(0::'m) \<in> {0::'m} \<union> rel_interior S
\<forall>c>0. (*\<^sub>R) c ` ({0::'m} \<union> rel_interior S) = {0::'m} \<union> rel_interior S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(0::'m) \<in> {0::'m} \<union> rel_interior S
\<forall>c>0. (*\<^sub>R) c ` ({0::'m} \<union> rel_interior S) = {0::'m} \<union> rel_interior S

goal (1 subgoal):
 1. cone ({0::'m} \<union> rel_interior S)
[PROOF STEP]
using cone_iff[of "{0} \<union> rel_interior S"]
[PROOF STATE]
proof (prove)
using this:
(0::'m) \<in> {0::'m} \<union> rel_interior S
\<forall>c>0. (*\<^sub>R) c ` ({0::'m} \<union> rel_interior S) = {0::'m} \<union> rel_interior S
{0::'m} \<union> rel_interior S \<noteq> {} \<Longrightarrow> cone ({0::'m} \<union> rel_interior S) = ((0::'m) \<in> {0::'m} \<union> rel_interior S \<and> (\<forall>c>0. (*\<^sub>R) c ` ({0::'m} \<union> rel_interior S) = {0::'m} \<union> rel_interior S))

goal (1 subgoal):
 1. cone ({0::'m} \<union> rel_interior S)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cone ({0::'m} \<union> rel_interior S)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma red_uminus:
  assumes "red F p q"
  shows "red F (-p) (-q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. red F (- p) (- q)
[PROOF STEP]
using red_monom_mult[OF assms, of "-1" 0]
[PROOF STATE]
proof (prove)
using this:
- (1::'b) \<noteq> (0::'b) \<Longrightarrow> red F (monom_mult (- (1::'b)) (0::'a) p) (monom_mult (- (1::'b)) (0::'a) q)

goal (1 subgoal):
 1. red F (- p) (- q)
[PROOF STEP]
by (simp add: uminus_monom_mult)


[STATEMENT]
lemma six:  "6 \<times> x = x \<squnion> x \<squnion> x \<squnion> x \<squnion> x \<squnion> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 6 \<times> x = x \<squnion> x \<squnion> x \<squnion> x \<squnion> x \<squnion> x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 6 \<times> x = x \<squnion> x \<squnion> x \<squnion> x \<squnion> x \<squnion> x
[PROOF STEP]
have       "6 = Suc(Suc(Suc(Suc(Suc(Suc(0))))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 6 = Suc (Suc (Suc (Suc (Suc (Suc 0)))))
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
6 = Suc (Suc (Suc (Suc (Suc (Suc 0)))))

goal (1 subgoal):
 1. 6 \<times> x = x \<squnion> x \<squnion> x \<squnion> x \<squnion> x \<squnion> x
[PROOF STEP]
hence      "6 \<times> x = Suc(Suc(Suc(Suc(Suc(Suc(0)))))) \<times> x"
[PROOF STATE]
proof (prove)
using this:
6 = Suc (Suc (Suc (Suc (Suc (Suc 0)))))

goal (1 subgoal):
 1. 6 \<times> x = Suc (Suc (Suc (Suc (Suc (Suc 0))))) \<times> x
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
6 \<times> x = Suc (Suc (Suc (Suc (Suc (Suc 0))))) \<times> x

goal (1 subgoal):
 1. 6 \<times> x = x \<squnion> x \<squnion> x \<squnion> x \<squnion> x \<squnion> x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
6 \<times> x = Suc (Suc (Suc (Suc (Suc (Suc 0))))) \<times> x

goal (1 subgoal):
 1. 6 \<times> x = x \<squnion> x \<squnion> x \<squnion> x \<squnion> x \<squnion> x
[PROOF STEP]
have  "\<dots> = x \<squnion> x \<squnion> x \<squnion> x \<squnion> x \<squnion> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc (Suc (Suc (Suc (Suc (Suc 0))))) \<times> x = x \<squnion> x \<squnion> x \<squnion> x \<squnion> x \<squnion> x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Suc (Suc (Suc (Suc (Suc (Suc 0))))) \<times> x = x \<squnion> x \<squnion> x \<squnion> x \<squnion> x \<squnion> x

goal (1 subgoal):
 1. 6 \<times> x = x \<squnion> x \<squnion> x \<squnion> x \<squnion> x \<squnion> x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
6 \<times> x = x \<squnion> x \<squnion> x \<squnion> x \<squnion> x \<squnion> x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
6 \<times> x = x \<squnion> x \<squnion> x \<squnion> x \<squnion> x \<squnion> x

goal (1 subgoal):
 1. 6 \<times> x = x \<squnion> x \<squnion> x \<squnion> x \<squnion> x \<squnion> x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
6 \<times> x = x \<squnion> x \<squnion> x \<squnion> x \<squnion> x \<squnion> x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lcm_abs_mult_right_int [simp]:
  "lcm x (\<bar>a\<bar> * y) = lcm x (a * y)" for x y a :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lcm x (\<bar>a\<bar> * y) = lcm x (a * y)
[PROOF STEP]
using lcm_abs2_int [of _ "a * y"] lcm_abs2_int [of _ "\<bar>a\<bar> * y"]
[PROOF STATE]
proof (prove)
using this:
lcm ?x \<bar>a * y\<bar> = lcm ?x (a * y)
lcm ?x \<bar>\<bar>a\<bar> * y\<bar> = lcm ?x (\<bar>a\<bar> * y)

goal (1 subgoal):
 1. lcm x (\<bar>a\<bar> * y) = lcm x (a * y)
[PROOF STEP]
by (simp add: abs_mult)


[STATEMENT]
lemma canon_ang_pi_3pi:
  assumes "pi < \<alpha>" and "\<alpha> \<le> 3 * pi"
  shows "\<downharpoonright>\<alpha>\<downharpoonleft> = \<alpha> - 2*pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<downharpoonright>\<alpha>\<downharpoonleft> = \<alpha> - 2 * pi
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<downharpoonright>\<alpha>\<downharpoonleft> = \<alpha> - 2 * pi
[PROOF STEP]
have "\<exists>x. - pi = pi * real_of_int x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x. - pi = pi * real_of_int x
[PROOF STEP]
by (rule_tac x="-1" in exI, simp)
[PROOF STATE]
proof (state)
this:
\<exists>x. - pi = pi * real_of_int x

goal (1 subgoal):
 1. \<downharpoonright>\<alpha>\<downharpoonleft> = \<alpha> - 2 * pi
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>x. - pi = pi * real_of_int x

goal (1 subgoal):
 1. \<downharpoonright>\<alpha>\<downharpoonleft> = \<alpha> - 2 * pi
[PROOF STEP]
using assms canon_ang_eqI[of "\<alpha> - 2*pi" "\<alpha>"]
[PROOF STATE]
proof (prove)
using this:
\<exists>x. - pi = pi * real_of_int x
pi < \<alpha>
\<alpha> \<le> 3 * pi
\<lbrakk>\<exists>x. \<alpha> - 2 * pi - \<alpha> = 2 * real_of_int x * pi; - pi < \<alpha> - 2 * pi \<and> \<alpha> - 2 * pi \<le> pi\<rbrakk> \<Longrightarrow> \<downharpoonright>\<alpha>\<downharpoonleft> = \<alpha> - 2 * pi

goal (1 subgoal):
 1. \<downharpoonright>\<alpha>\<downharpoonleft> = \<alpha> - 2 * pi
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<downharpoonright>\<alpha>\<downharpoonleft> = \<alpha> - 2 * pi

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tc_monomial [simp]: "tc (monomial c t) = c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tc (monomial c t) = c
[PROOF STEP]
proof (cases "c = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. c = (0::'b) \<Longrightarrow> tc (monomial c t) = c
 2. c \<noteq> (0::'b) \<Longrightarrow> tc (monomial c t) = c
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
c = (0::'b)

goal (2 subgoals):
 1. c = (0::'b) \<Longrightarrow> tc (monomial c t) = c
 2. c \<noteq> (0::'b) \<Longrightarrow> tc (monomial c t) = c
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
c = (0::'b)

goal (1 subgoal):
 1. tc (monomial c t) = c
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
tc (monomial c t) = c

goal (1 subgoal):
 1. c \<noteq> (0::'b) \<Longrightarrow> tc (monomial c t) = c
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. c \<noteq> (0::'b) \<Longrightarrow> tc (monomial c t) = c
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
c \<noteq> (0::'b)

goal (1 subgoal):
 1. c \<noteq> (0::'b) \<Longrightarrow> tc (monomial c t) = c
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
c \<noteq> (0::'b)

goal (1 subgoal):
 1. tc (monomial c t) = c
[PROOF STEP]
by (simp add: tc_def tt_monomial)
[PROOF STATE]
proof (state)
this:
tc (monomial c t) = c

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma solve_code[code]:
  shows "solve A b = (let GJ_P=Gauss_Jordan_PA A;
                        P_times_b=fst(GJ_P) *v b;
                        rank_A = (if A = 0 then 0 else to_nat (GREATEST a. row a (snd GJ_P) \<noteq> 0) + 1);
                        consistent_Ab = (rank_A \<ge> (if (\<exists>a. (P_times_b) $ a \<noteq> 0) then (to_nat (GREATEST a. (P_times_b) $ a \<noteq> 0) + 1) else 0));
                        GJ_transpose = Gauss_Jordan_PA (transpose A);
                        basis = {row i (fst GJ_transpose) | i. to_nat i \<ge> rank_A}
                        in (if consistent_Ab then Some (solve_consistent_rref (snd GJ_P) P_times_b,basis) else None))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. solve A b = (let GJ_P = Gauss_Jordan_PA A; P_times_b = fst GJ_P *v b; rank_A = if A = 0 then 0 else mod_type_class.to_nat (GREATEST a. row a (snd GJ_P) \<noteq> 0) + 1; consistent_Ab = (if \<exists>a. P_times_b $ a \<noteq> (0::'a) then mod_type_class.to_nat (GREATEST a. P_times_b $ a \<noteq> (0::'a)) + 1 else 0) \<le> rank_A; GJ_transpose = Gauss_Jordan_PA (Finite_Cartesian_Product.transpose A); basis = {row i (fst GJ_transpose) |i. rank_A \<le> mod_type_class.to_nat i} in if consistent_Ab then Some (solve_consistent_rref (snd GJ_P) P_times_b, basis) else None)
[PROOF STEP]
unfolding Let_def solve_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if consistent A b then Some (solve_consistent_rref (fst (solve_system A b)) (snd (solve_system A b)), basis_null_space A) else None) = (if (if \<exists>a. (fst (Gauss_Jordan_PA A) *v b) $ a \<noteq> (0::'a) then mod_type_class.to_nat (GREATEST a. (fst (Gauss_Jordan_PA A) *v b) $ a \<noteq> (0::'a)) + 1 else 0) \<le> (if A = 0 then 0 else mod_type_class.to_nat (GREATEST a. row a (snd (Gauss_Jordan_PA A)) \<noteq> 0) + 1) then Some (solve_consistent_rref (snd (Gauss_Jordan_PA A)) (fst (Gauss_Jordan_PA A) *v b), {row i (fst (Gauss_Jordan_PA (Finite_Cartesian_Product.transpose A))) |i. (if A = 0 then 0 else mod_type_class.to_nat (GREATEST a. row a (snd (Gauss_Jordan_PA A)) \<noteq> 0) + 1) \<le> mod_type_class.to_nat i}) else None)
[PROOF STEP]
unfolding consistent_eq_rank_ge_code[unfolded Let_def,symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if consistent A b then Some (solve_consistent_rref (fst (solve_system A b)) (snd (solve_system A b)), basis_null_space A) else None) = (if consistent A b then Some (solve_consistent_rref (snd (Gauss_Jordan_PA A)) (fst (Gauss_Jordan_PA A) *v b), {row i (fst (Gauss_Jordan_PA (Finite_Cartesian_Product.transpose A))) |i. (if A = 0 then 0 else mod_type_class.to_nat (GREATEST a. row a (snd (Gauss_Jordan_PA A)) \<noteq> 0) + 1) \<le> mod_type_class.to_nat i}) else None)
[PROOF STEP]
unfolding basis_null_space_def Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if consistent A b then Some (solve_consistent_rref (fst (solve_system A b)) (snd (solve_system A b)), {row i (P_Gauss_Jordan (Finite_Cartesian_Product.transpose A)) |i. rank A \<le> mod_type_class.to_nat i}) else None) = (if consistent A b then Some (solve_consistent_rref (snd (Gauss_Jordan_PA A)) (fst (Gauss_Jordan_PA A) *v b), {row i (fst (Gauss_Jordan_PA (Finite_Cartesian_Product.transpose A))) |i. (if A = 0 then 0 else mod_type_class.to_nat (GREATEST a. row a (snd (Gauss_Jordan_PA A)) \<noteq> 0) + 1) \<le> mod_type_class.to_nat i}) else None)
[PROOF STEP]
unfolding P_Gauss_Jordan_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if consistent A b then Some (solve_consistent_rref (fst (solve_system A b)) (snd (solve_system A b)), {row i (fst (Gauss_Jordan_PA (Finite_Cartesian_Product.transpose A))) |i. rank A \<le> mod_type_class.to_nat i}) else None) = (if consistent A b then Some (solve_consistent_rref (snd (Gauss_Jordan_PA A)) (fst (Gauss_Jordan_PA A) *v b), {row i (fst (Gauss_Jordan_PA (Finite_Cartesian_Product.transpose A))) |i. (if A = 0 then 0 else mod_type_class.to_nat (GREATEST a. row a (snd (Gauss_Jordan_PA A)) \<noteq> 0) + 1) \<le> mod_type_class.to_nat i}) else None)
[PROOF STEP]
unfolding rank_Gauss_Jordan_code Let_def Gauss_Jordan_PA_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if consistent A b then Some (solve_consistent_rref (fst (solve_system A b)) (snd (solve_system A b)), {row i (fst (Gauss_Jordan_PA (Finite_Cartesian_Product.transpose A))) |i. (if A = 0 then 0 else mod_type_class.to_nat (GREATEST a. row a (Gauss_Jordan A) \<noteq> 0) + 1) \<le> mod_type_class.to_nat i}) else None) = (if consistent A b then Some (solve_consistent_rref (Gauss_Jordan A) (fst (Gauss_Jordan_PA A) *v b), {row i (fst (Gauss_Jordan_PA (Finite_Cartesian_Product.transpose A))) |i. (if A = 0 then 0 else mod_type_class.to_nat (GREATEST a. row a (Gauss_Jordan A) \<noteq> 0) + 1) \<le> mod_type_class.to_nat i}) else None)
[PROOF STEP]
unfolding solve_system_def Let_def fst_conv snd_conv
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if consistent A b then Some (solve_consistent_rref (snd (Gauss_Jordan_PA A)) (fst (Gauss_Jordan_PA A) *v b), {row i (fst (Gauss_Jordan_PA (Finite_Cartesian_Product.transpose A))) |i. (if A = 0 then 0 else mod_type_class.to_nat (GREATEST a. row a (Gauss_Jordan A) \<noteq> 0) + 1) \<le> mod_type_class.to_nat i}) else None) = (if consistent A b then Some (solve_consistent_rref (Gauss_Jordan A) (fst (Gauss_Jordan_PA A) *v b), {row i (fst (Gauss_Jordan_PA (Finite_Cartesian_Product.transpose A))) |i. (if A = 0 then 0 else mod_type_class.to_nat (GREATEST a. row a (Gauss_Jordan A) \<noteq> 0) + 1) \<le> mod_type_class.to_nat i}) else None)
[PROOF STEP]
unfolding Gauss_Jordan_PA_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if consistent A b then Some (solve_consistent_rref (Gauss_Jordan A) (fst (Gauss_Jordan_PA A) *v b), {row i (fst (Gauss_Jordan_PA (Finite_Cartesian_Product.transpose A))) |i. (if A = 0 then 0 else mod_type_class.to_nat (GREATEST a. row a (Gauss_Jordan A) \<noteq> 0) + 1) \<le> mod_type_class.to_nat i}) else None) = (if consistent A b then Some (solve_consistent_rref (Gauss_Jordan A) (fst (Gauss_Jordan_PA A) *v b), {row i (fst (Gauss_Jordan_PA (Finite_Cartesian_Product.transpose A))) |i. (if A = 0 then 0 else mod_type_class.to_nat (GREATEST a. row a (Gauss_Jordan A) \<noteq> 0) + 1) \<le> mod_type_class.to_nat i}) else None)
[PROOF STEP]
..


[STATEMENT]
lemma K_elem_pmf_map_repr:
  assumes A: "\<mu> \<in> \<K> (l, R)" "(l', R') \<in> \<mu>"
  defines "f \<equiv> \<lambda> (l, R). (l, SOME u. u \<in> R)"
  shows "pmf (map_pmf f \<mu>) (f (l', R')) = pmf \<mu> (l', R')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pmf (map_pmf f \<mu>) (f (l', R')) = pmf \<mu> (l', R')
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
\<mu> \<in> \<K> (l, R)
(l', R') \<in> set_pmf \<mu>

goal (1 subgoal):
 1. pmf (map_pmf f \<mu>) (f (l', R')) = pmf \<mu> (l', R')
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
using this:
\<mu> \<in> \<K> (l, R)
(l', R') \<in> set_pmf \<mu>

goal (1 subgoal):
 1. pmf (map_pmf (\<lambda>(l, R). (l, SOME u. u \<in> R)) \<mu>) (case (l', R') of (l, R) \<Rightarrow> (l, SOME u. u \<in> R)) = pmf \<mu> (l', R')
[PROOF STEP]
by (blast intro: pmf_map_inj K_elem_repr_inj)


[STATEMENT]
lemma alice_step_1:
  assumes "state 1 \<phi>" and "\<alpha> = \<phi> $$ (0,0)" and "\<beta> = \<phi> $$ (1,0)"
  shows "(\<phi> \<Otimes> |\<beta>\<^sub>0\<^sub>0\<rangle>) = mat_of_cols_list 8 [[\<alpha>/sqrt(2),0,0,\<alpha>/sqrt(2),\<beta>/sqrt(2),0,0,\<beta>/sqrt(2)]]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<phi> \<Otimes> |\<beta>\<^sub>0\<^sub>0\<rangle> = Tensor.mat_of_cols_list 8 [[\<alpha> / complex_of_real (sqrt 2), 0, 0, \<alpha> / complex_of_real (sqrt 2), \<beta> / complex_of_real (sqrt 2), 0, 0, \<beta> / complex_of_real (sqrt 2)]]
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (Tensor.mat_of_cols_list 8 [[\<alpha> / complex_of_real (sqrt 2), 0, 0, \<alpha> / complex_of_real (sqrt 2), \<beta> / complex_of_real (sqrt 2), 0, 0, \<beta> / complex_of_real (sqrt 2)]]); j < dim_col (Tensor.mat_of_cols_list 8 [[\<alpha> / complex_of_real (sqrt 2), 0, 0, \<alpha> / complex_of_real (sqrt 2), \<beta> / complex_of_real (sqrt 2), 0, 0, \<beta> / complex_of_real (sqrt 2)]])\<rbrakk> \<Longrightarrow> (\<phi> \<Otimes> |\<beta>\<^sub>0\<^sub>0\<rangle>) $$ (i, j) = Tensor.mat_of_cols_list 8 [[\<alpha> / complex_of_real (sqrt 2), 0, 0, \<alpha> / complex_of_real (sqrt 2), \<beta> / complex_of_real (sqrt 2), 0, 0, \<beta> / complex_of_real (sqrt 2)]] $$ (i, j)
 2. dim_row (\<phi> \<Otimes> |\<beta>\<^sub>0\<^sub>0\<rangle>) = dim_row (Tensor.mat_of_cols_list 8 [[\<alpha> / complex_of_real (sqrt 2), 0, 0, \<alpha> / complex_of_real (sqrt 2), \<beta> / complex_of_real (sqrt 2), 0, 0, \<beta> / complex_of_real (sqrt 2)]])
 3. dim_col (\<phi> \<Otimes> |\<beta>\<^sub>0\<^sub>0\<rangle>) = dim_col (Tensor.mat_of_cols_list 8 [[\<alpha> / complex_of_real (sqrt 2), 0, 0, \<alpha> / complex_of_real (sqrt 2), \<beta> / complex_of_real (sqrt 2), 0, 0, \<beta> / complex_of_real (sqrt 2)]])
[PROOF STEP]
define v where asm:"v = mat_of_cols_list 8 [[\<alpha>/sqrt(2),0,0,\<alpha>/sqrt(2),\<beta>/sqrt(2),0,0,\<beta>/sqrt(2)]]"
[PROOF STATE]
proof (state)
this:
v = Tensor.mat_of_cols_list 8 [[\<alpha> / complex_of_real (sqrt 2), 0, 0, \<alpha> / complex_of_real (sqrt 2), \<beta> / complex_of_real (sqrt 2), 0, 0, \<beta> / complex_of_real (sqrt 2)]]

goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (Tensor.mat_of_cols_list 8 [[\<alpha> / complex_of_real (sqrt 2), 0, 0, \<alpha> / complex_of_real (sqrt 2), \<beta> / complex_of_real (sqrt 2), 0, 0, \<beta> / complex_of_real (sqrt 2)]]); j < dim_col (Tensor.mat_of_cols_list 8 [[\<alpha> / complex_of_real (sqrt 2), 0, 0, \<alpha> / complex_of_real (sqrt 2), \<beta> / complex_of_real (sqrt 2), 0, 0, \<beta> / complex_of_real (sqrt 2)]])\<rbrakk> \<Longrightarrow> (\<phi> \<Otimes> |\<beta>\<^sub>0\<^sub>0\<rangle>) $$ (i, j) = Tensor.mat_of_cols_list 8 [[\<alpha> / complex_of_real (sqrt 2), 0, 0, \<alpha> / complex_of_real (sqrt 2), \<beta> / complex_of_real (sqrt 2), 0, 0, \<beta> / complex_of_real (sqrt 2)]] $$ (i, j)
 2. dim_row (\<phi> \<Otimes> |\<beta>\<^sub>0\<^sub>0\<rangle>) = dim_row (Tensor.mat_of_cols_list 8 [[\<alpha> / complex_of_real (sqrt 2), 0, 0, \<alpha> / complex_of_real (sqrt 2), \<beta> / complex_of_real (sqrt 2), 0, 0, \<beta> / complex_of_real (sqrt 2)]])
 3. dim_col (\<phi> \<Otimes> |\<beta>\<^sub>0\<^sub>0\<rangle>) = dim_col (Tensor.mat_of_cols_list 8 [[\<alpha> / complex_of_real (sqrt 2), 0, 0, \<alpha> / complex_of_real (sqrt 2), \<beta> / complex_of_real (sqrt 2), 0, 0, \<beta> / complex_of_real (sqrt 2)]])
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
v = Tensor.mat_of_cols_list 8 [[\<alpha> / complex_of_real (sqrt 2), 0, 0, \<alpha> / complex_of_real (sqrt 2), \<beta> / complex_of_real (sqrt 2), 0, 0, \<beta> / complex_of_real (sqrt 2)]]
[PROOF STEP]
show "dim_row (\<phi> \<Otimes> |\<beta>\<^sub>0\<^sub>0\<rangle>) = dim_row v"
[PROOF STATE]
proof (prove)
using this:
v = Tensor.mat_of_cols_list 8 [[\<alpha> / complex_of_real (sqrt 2), 0, 0, \<alpha> / complex_of_real (sqrt 2), \<beta> / complex_of_real (sqrt 2), 0, 0, \<beta> / complex_of_real (sqrt 2)]]

goal (1 subgoal):
 1. dim_row (\<phi> \<Otimes> |\<beta>\<^sub>0\<^sub>0\<rangle>) = dim_row v
[PROOF STEP]
using assms(1) alice_step_1_state state.dim_row mat_of_cols_list_def
[PROOF STATE]
proof (prove)
using this:
v = Tensor.mat_of_cols_list 8 [[\<alpha> / complex_of_real (sqrt 2), 0, 0, \<alpha> / complex_of_real (sqrt 2), \<beta> / complex_of_real (sqrt 2), 0, 0, \<beta> / complex_of_real (sqrt 2)]]
state 1 \<phi>
state 1 ?\<phi> \<Longrightarrow> state 3 (?\<phi> \<Otimes> |\<beta>\<^sub>0\<^sub>0\<rangle>)
state ?n ?v \<Longrightarrow> dim_row ?v = 2 ^ ?n
Tensor.mat_of_cols_list ?nr ?cs = Matrix.mat ?nr (length ?cs) (\<lambda>(i, j). ?cs ! j ! i)

goal (1 subgoal):
 1. dim_row (\<phi> \<Otimes> |\<beta>\<^sub>0\<^sub>0\<rangle>) = dim_row v
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
dim_row (\<phi> \<Otimes> |\<beta>\<^sub>0\<^sub>0\<rangle>) = dim_row v

goal (2 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (Tensor.mat_of_cols_list 8 [[\<alpha> / complex_of_real (sqrt 2), 0, 0, \<alpha> / complex_of_real (sqrt 2), \<beta> / complex_of_real (sqrt 2), 0, 0, \<beta> / complex_of_real (sqrt 2)]]); j < dim_col (Tensor.mat_of_cols_list 8 [[\<alpha> / complex_of_real (sqrt 2), 0, 0, \<alpha> / complex_of_real (sqrt 2), \<beta> / complex_of_real (sqrt 2), 0, 0, \<beta> / complex_of_real (sqrt 2)]])\<rbrakk> \<Longrightarrow> (\<phi> \<Otimes> |\<beta>\<^sub>0\<^sub>0\<rangle>) $$ (i, j) = Tensor.mat_of_cols_list 8 [[\<alpha> / complex_of_real (sqrt 2), 0, 0, \<alpha> / complex_of_real (sqrt 2), \<beta> / complex_of_real (sqrt 2), 0, 0, \<beta> / complex_of_real (sqrt 2)]] $$ (i, j)
 2. dim_col (\<phi> \<Otimes> |\<beta>\<^sub>0\<^sub>0\<rangle>) = dim_col (Tensor.mat_of_cols_list 8 [[\<alpha> / complex_of_real (sqrt 2), 0, 0, \<alpha> / complex_of_real (sqrt 2), \<beta> / complex_of_real (sqrt 2), 0, 0, \<beta> / complex_of_real (sqrt 2)]])
[PROOF STEP]
show "dim_col (\<phi> \<Otimes> |\<beta>\<^sub>0\<^sub>0\<rangle>) = dim_col v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_col (\<phi> \<Otimes> |\<beta>\<^sub>0\<^sub>0\<rangle>) = dim_col v
[PROOF STEP]
using assms(1) alice_step_1_state state.is_column asm mat_of_cols_list_def
[PROOF STATE]
proof (prove)
using this:
state 1 \<phi>
state 1 ?\<phi> \<Longrightarrow> state 3 (?\<phi> \<Otimes> |\<beta>\<^sub>0\<^sub>0\<rangle>)
state ?n ?v \<Longrightarrow> dim_col ?v = 1
v = Tensor.mat_of_cols_list 8 [[\<alpha> / complex_of_real (sqrt 2), 0, 0, \<alpha> / complex_of_real (sqrt 2), \<beta> / complex_of_real (sqrt 2), 0, 0, \<beta> / complex_of_real (sqrt 2)]]
Tensor.mat_of_cols_list ?nr ?cs = Matrix.mat ?nr (length ?cs) (\<lambda>(i, j). ?cs ! j ! i)

goal (1 subgoal):
 1. dim_col (\<phi> \<Otimes> |\<beta>\<^sub>0\<^sub>0\<rangle>) = dim_col v
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
dim_col (\<phi> \<Otimes> |\<beta>\<^sub>0\<^sub>0\<rangle>) = dim_col v

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (Tensor.mat_of_cols_list 8 [[\<alpha> / complex_of_real (sqrt 2), 0, 0, \<alpha> / complex_of_real (sqrt 2), \<beta> / complex_of_real (sqrt 2), 0, 0, \<beta> / complex_of_real (sqrt 2)]]); j < dim_col (Tensor.mat_of_cols_list 8 [[\<alpha> / complex_of_real (sqrt 2), 0, 0, \<alpha> / complex_of_real (sqrt 2), \<beta> / complex_of_real (sqrt 2), 0, 0, \<beta> / complex_of_real (sqrt 2)]])\<rbrakk> \<Longrightarrow> (\<phi> \<Otimes> |\<beta>\<^sub>0\<^sub>0\<rangle>) $$ (i, j) = Tensor.mat_of_cols_list 8 [[\<alpha> / complex_of_real (sqrt 2), 0, 0, \<alpha> / complex_of_real (sqrt 2), \<beta> / complex_of_real (sqrt 2), 0, 0, \<beta> / complex_of_real (sqrt 2)]] $$ (i, j)
[PROOF STEP]
show "\<And>i j. i < dim_row v \<Longrightarrow> j < dim_col v \<Longrightarrow> (\<phi> \<Otimes> |\<beta>\<^sub>0\<^sub>0\<rangle>) $$ (i,j) = v $$ (i,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row v; j < dim_col v\<rbrakk> \<Longrightarrow> (\<phi> \<Otimes> |\<beta>\<^sub>0\<^sub>0\<rangle>) $$ (i, j) = v $$ (i, j)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row v; j < dim_col v\<rbrakk> \<Longrightarrow> (\<phi> \<Otimes> |\<beta>\<^sub>0\<^sub>0\<rangle>) $$ (i, j) = v $$ (i, j)
[PROOF STEP]
fix i j
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row v; j < dim_col v\<rbrakk> \<Longrightarrow> (\<phi> \<Otimes> |\<beta>\<^sub>0\<^sub>0\<rangle>) $$ (i, j) = v $$ (i, j)
[PROOF STEP]
assume "i < dim_row v" and "j < dim_col v"
[PROOF STATE]
proof (state)
this:
i < dim_row v
j < dim_col v

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row v; j < dim_col v\<rbrakk> \<Longrightarrow> (\<phi> \<Otimes> |\<beta>\<^sub>0\<^sub>0\<rangle>) $$ (i, j) = v $$ (i, j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i < dim_row v
j < dim_col v
[PROOF STEP]
have "i \<in> {0..<8} \<and> j = 0"
[PROOF STATE]
proof (prove)
using this:
i < dim_row v
j < dim_col v

goal (1 subgoal):
 1. i \<in> {0..<8} \<and> j = 0
[PROOF STEP]
using asm
[PROOF STATE]
proof (prove)
using this:
i < dim_row v
j < dim_col v
v = Tensor.mat_of_cols_list 8 [[\<alpha> / complex_of_real (sqrt 2), 0, 0, \<alpha> / complex_of_real (sqrt 2), \<beta> / complex_of_real (sqrt 2), 0, 0, \<beta> / complex_of_real (sqrt 2)]]

goal (1 subgoal):
 1. i \<in> {0..<8} \<and> j = 0
[PROOF STEP]
by (auto simp add: mat_of_cols_list_def)
[PROOF STATE]
proof (state)
this:
i \<in> {0..<8} \<and> j = 0

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row v; j < dim_col v\<rbrakk> \<Longrightarrow> (\<phi> \<Otimes> |\<beta>\<^sub>0\<^sub>0\<rangle>) $$ (i, j) = v $$ (i, j)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
i \<in> {0..<8} \<and> j = 0

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row v; j < dim_col v\<rbrakk> \<Longrightarrow> (\<phi> \<Otimes> |\<beta>\<^sub>0\<^sub>0\<rangle>) $$ (i, j) = v $$ (i, j)
[PROOF STEP]
have "dim_row |\<beta>\<^sub>0\<^sub>0\<rangle> = 4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row |\<beta>\<^sub>0\<^sub>0\<rangle> = 4
[PROOF STEP]
using bell00_is_state state_def
[PROOF STATE]
proof (prove)
using this:
state 2 |\<beta>\<^sub>0\<^sub>0\<rangle>
state ?n ?v \<equiv> dim_col ?v = 1 \<and> dim_row ?v = 2 ^ ?n \<and> \<parallel>Matrix.col ?v 0\<parallel> = 1

goal (1 subgoal):
 1. dim_row |\<beta>\<^sub>0\<^sub>0\<rangle> = 4
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dim_row |\<beta>\<^sub>0\<^sub>0\<rangle> = 4

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row v; j < dim_col v\<rbrakk> \<Longrightarrow> (\<phi> \<Otimes> |\<beta>\<^sub>0\<^sub>0\<rangle>) $$ (i, j) = v $$ (i, j)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
dim_row |\<beta>\<^sub>0\<^sub>0\<rangle> = 4

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row v; j < dim_col v\<rbrakk> \<Longrightarrow> (\<phi> \<Otimes> |\<beta>\<^sub>0\<^sub>0\<rangle>) $$ (i, j) = v $$ (i, j)
[PROOF STEP]
have "dim_col |\<beta>\<^sub>0\<^sub>0\<rangle> = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_col |\<beta>\<^sub>0\<^sub>0\<rangle> = 1
[PROOF STEP]
using bell00_is_state state_def
[PROOF STATE]
proof (prove)
using this:
state 2 |\<beta>\<^sub>0\<^sub>0\<rangle>
state ?n ?v \<equiv> dim_col ?v = 1 \<and> dim_row ?v = 2 ^ ?n \<and> \<parallel>Matrix.col ?v 0\<parallel> = 1

goal (1 subgoal):
 1. dim_col |\<beta>\<^sub>0\<^sub>0\<rangle> = 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dim_col |\<beta>\<^sub>0\<^sub>0\<rangle> = 1

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row v; j < dim_col v\<rbrakk> \<Longrightarrow> (\<phi> \<Otimes> |\<beta>\<^sub>0\<^sub>0\<rangle>) $$ (i, j) = v $$ (i, j)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
i \<in> {0..<8} \<and> j = 0
dim_row |\<beta>\<^sub>0\<^sub>0\<rangle> = 4
dim_col |\<beta>\<^sub>0\<^sub>0\<rangle> = 1
[PROOF STEP]
show "(\<phi> \<Otimes> |\<beta>\<^sub>0\<^sub>0\<rangle>) $$ (i, j) = v $$ (i,j)"
[PROOF STATE]
proof (prove)
using this:
i \<in> {0..<8} \<and> j = 0
dim_row |\<beta>\<^sub>0\<^sub>0\<rangle> = 4
dim_col |\<beta>\<^sub>0\<^sub>0\<rangle> = 1

goal (1 subgoal):
 1. (\<phi> \<Otimes> |\<beta>\<^sub>0\<^sub>0\<rangle>) $$ (i, j) = v $$ (i, j)
[PROOF STEP]
using state_def assms asm
[PROOF STATE]
proof (prove)
using this:
i \<in> {0..<8} \<and> j = 0
dim_row |\<beta>\<^sub>0\<^sub>0\<rangle> = 4
dim_col |\<beta>\<^sub>0\<^sub>0\<rangle> = 1
state ?n ?v \<equiv> dim_col ?v = 1 \<and> dim_row ?v = 2 ^ ?n \<and> \<parallel>Matrix.col ?v 0\<parallel> = 1
state 1 \<phi>
\<alpha> = \<phi> $$ (0, 0)
\<beta> = \<phi> $$ (1, 0)
v = Tensor.mat_of_cols_list 8 [[\<alpha> / complex_of_real (sqrt 2), 0, 0, \<alpha> / complex_of_real (sqrt 2), \<beta> / complex_of_real (sqrt 2), 0, 0, \<beta> / complex_of_real (sqrt 2)]]

goal (1 subgoal):
 1. (\<phi> \<Otimes> |\<beta>\<^sub>0\<^sub>0\<rangle>) $$ (i, j) = v $$ (i, j)
[PROOF STEP]
by (auto simp add: bell00_def)
[PROOF STATE]
proof (state)
this:
(\<phi> \<Otimes> |\<beta>\<^sub>0\<^sub>0\<rangle>) $$ (i, j) = v $$ (i, j)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?i < dim_row v; ?j < dim_col v\<rbrakk> \<Longrightarrow> (\<phi> \<Otimes> |\<beta>\<^sub>0\<^sub>0\<rangle>) $$ (?i, ?j) = v $$ (?i, ?j)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma borel_measurable_vimage_halfspace_component_ge:
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
  shows "f \<in> borel_measurable (lebesgue_on S) \<longleftrightarrow>
         (\<forall>a i. i \<in> Basis \<longrightarrow> {x \<in> S. f x \<bullet> i \<ge> a} \<in> sets (lebesgue_on S))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<in> borel_measurable (lebesgue_on S)) = (\<forall>a i. i \<in> Basis \<longrightarrow> {x \<in> S. a \<le> f x \<bullet> i} \<in> sets (lebesgue_on S))
[PROOF STEP]
apply (rule trans [OF borel_measurable_iff_halfspace_ge])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>i\<in>Basis. \<forall>a. {w \<in> space (lebesgue_on S). a \<le> f w \<bullet> i} \<in> sets (lebesgue_on S)) = (\<forall>a i. i \<in> Basis \<longrightarrow> {x \<in> S. a \<le> f x \<bullet> i} \<in> sets (lebesgue_on S))
[PROOF STEP]
apply (fastforce simp add: space_restrict_space)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done