[STATEMENT]
lemma f_nth_derivative_is_poly:
  "higher_differentiable_on {0<..} f k \<and>
   (\<exists>p. real_polynomial_function p \<and> (\<forall>t>0. nth_derivative k f t 1 = p t / (t ^ (2 * k)) * exp(-inverse t)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. higher_differentiable_on {0<..} f k \<and> (\<exists>p. real_polynomial_function p \<and> (\<forall>t>0. nth_derivative k f t 1 = p t / t ^ (2 * k) * exp (- inverse t)))
[PROOF STEP]
proof (induction k)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. higher_differentiable_on {0<..} f 0 \<and> (\<exists>p. real_polynomial_function p \<and> (\<forall>t>0. nth_derivative 0 f t 1 = p t / t ^ (2 * 0) * exp (- inverse t)))
 2. \<And>k. higher_differentiable_on {0<..} f k \<and> (\<exists>p. real_polynomial_function p \<and> (\<forall>t>0. nth_derivative k f t 1 = p t / t ^ (2 * k) * exp (- inverse t))) \<Longrightarrow> higher_differentiable_on {0<..} f (Suc k) \<and> (\<exists>p. real_polynomial_function p \<and> (\<forall>t>0. nth_derivative (Suc k) f t 1 = p t / t ^ (2 * Suc k) * exp (- inverse t)))
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. higher_differentiable_on {0<..} f 0 \<and> (\<exists>p. real_polynomial_function p \<and> (\<forall>t>0. nth_derivative 0 f t 1 = p t / t ^ (2 * 0) * exp (- inverse t)))
 2. \<And>k. higher_differentiable_on {0<..} f k \<and> (\<exists>p. real_polynomial_function p \<and> (\<forall>t>0. nth_derivative k f t 1 = p t / t ^ (2 * k) * exp (- inverse t))) \<Longrightarrow> higher_differentiable_on {0<..} f (Suc k) \<and> (\<exists>p. real_polynomial_function p \<and> (\<forall>t>0. nth_derivative (Suc k) f t 1 = p t / t ^ (2 * Suc k) * exp (- inverse t)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. higher_differentiable_on {0<..} f 0 \<and> (\<exists>p. real_polynomial_function p \<and> (\<forall>t>0. nth_derivative 0 f t 1 = p t / t ^ (2 * 0) * exp (- inverse t)))
[PROOF STEP]
apply (auto simp: higher_differentiable_on.simps f_continuous)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>p. real_polynomial_function p \<and> (\<forall>t>0. f t = p t * exp (- inverse t))
[PROOF STEP]
by (auto simp: f_def)
[PROOF STATE]
proof (state)
this:
higher_differentiable_on {0<..} f 0 \<and> (\<exists>p. real_polynomial_function p \<and> (\<forall>t>0. nth_derivative 0 f t 1 = p t / t ^ (2 * 0) * exp (- inverse t)))

goal (1 subgoal):
 1. \<And>k. higher_differentiable_on {0<..} f k \<and> (\<exists>p. real_polynomial_function p \<and> (\<forall>t>0. nth_derivative k f t 1 = p t / t ^ (2 * k) * exp (- inverse t))) \<Longrightarrow> higher_differentiable_on {0<..} f (Suc k) \<and> (\<exists>p. real_polynomial_function p \<and> (\<forall>t>0. nth_derivative (Suc k) f t 1 = p t / t ^ (2 * Suc k) * exp (- inverse t)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k. higher_differentiable_on {0<..} f k \<and> (\<exists>p. real_polynomial_function p \<and> (\<forall>t>0. nth_derivative k f t 1 = p t / t ^ (2 * k) * exp (- inverse t))) \<Longrightarrow> higher_differentiable_on {0<..} f (Suc k) \<and> (\<exists>p. real_polynomial_function p \<and> (\<forall>t>0. nth_derivative (Suc k) f t 1 = p t / t ^ (2 * Suc k) * exp (- inverse t)))
[PROOF STEP]
case (Suc k)
[PROOF STATE]
proof (state)
this:
higher_differentiable_on {0<..} f k \<and> (\<exists>p. real_polynomial_function p \<and> (\<forall>t>0. nth_derivative k f t 1 = p t / t ^ (2 * k) * exp (- inverse t)))

goal (1 subgoal):
 1. \<And>k. higher_differentiable_on {0<..} f k \<and> (\<exists>p. real_polynomial_function p \<and> (\<forall>t>0. nth_derivative k f t 1 = p t / t ^ (2 * k) * exp (- inverse t))) \<Longrightarrow> higher_differentiable_on {0<..} f (Suc k) \<and> (\<exists>p. real_polynomial_function p \<and> (\<forall>t>0. nth_derivative (Suc k) f t 1 = p t / t ^ (2 * Suc k) * exp (- inverse t)))
[PROOF STEP]
obtain p where fk: "higher_differentiable_on {0<..} f k"
    and p1: "real_polynomial_function p"
    and p2: "\<forall>t>0. nth_derivative k f t 1 = p t / t ^ (2 * k) * exp (- inverse t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>p. \<lbrakk>higher_differentiable_on {0<..} f k; real_polynomial_function p; \<forall>t>0. nth_derivative k f t 1 = p t / t ^ (2 * k) * exp (- inverse t)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using Suc
[PROOF STATE]
proof (prove)
using this:
higher_differentiable_on {0<..} f k \<and> (\<exists>p. real_polynomial_function p \<and> (\<forall>t>0. nth_derivative k f t 1 = p t / t ^ (2 * k) * exp (- inverse t)))

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>higher_differentiable_on {0<..} f k; real_polynomial_function p; \<forall>t>0. nth_derivative k f t 1 = p t / t ^ (2 * k) * exp (- inverse t)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
higher_differentiable_on {0<..} f k
real_polynomial_function p
\<forall>t>0. nth_derivative k f t 1 = p t / t ^ (2 * k) * exp (- inverse t)

goal (1 subgoal):
 1. \<And>k. higher_differentiable_on {0<..} f k \<and> (\<exists>p. real_polynomial_function p \<and> (\<forall>t>0. nth_derivative k f t 1 = p t / t ^ (2 * k) * exp (- inverse t))) \<Longrightarrow> higher_differentiable_on {0<..} f (Suc k) \<and> (\<exists>p. real_polynomial_function p \<and> (\<forall>t>0. nth_derivative (Suc k) f t 1 = p t / t ^ (2 * Suc k) * exp (- inverse t)))
[PROOF STEP]
obtain p' where p'1: "real_polynomial_function p'"
    and p'2: "\<forall>t. (p has_real_derivative (p' t)) (at t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>p'. \<lbrakk>real_polynomial_function p'; \<forall>t. (p has_real_derivative p' t) (at t)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using has_real_derivative_polynomial_function[of p] p1
[PROOF STATE]
proof (prove)
using this:
real_polynomial_function p \<Longrightarrow> \<exists>p'. real_polynomial_function p' \<and> (\<forall>x. (p has_real_derivative p' x) (at x))
real_polynomial_function p

goal (1 subgoal):
 1. (\<And>p'. \<lbrakk>real_polynomial_function p'; \<forall>t. (p has_real_derivative p' t) (at t)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real_polynomial_function p'
\<forall>t. (p has_real_derivative p' t) (at t)

goal (1 subgoal):
 1. \<And>k. higher_differentiable_on {0<..} f k \<and> (\<exists>p. real_polynomial_function p \<and> (\<forall>t>0. nth_derivative k f t 1 = p t / t ^ (2 * k) * exp (- inverse t))) \<Longrightarrow> higher_differentiable_on {0<..} f (Suc k) \<and> (\<exists>p. real_polynomial_function p \<and> (\<forall>t>0. nth_derivative (Suc k) f t 1 = p t / t ^ (2 * Suc k) * exp (- inverse t)))
[PROOF STEP]
define rp where "rp t = (t\<^sup>2 * p' t - 2 * real k * t * p t + p t)" for t
[PROOF STATE]
proof (state)
this:
rp ?t = ?t\<^sup>2 * p' ?t - 2 * real k * ?t * p ?t + p ?t

goal (1 subgoal):
 1. \<And>k. higher_differentiable_on {0<..} f k \<and> (\<exists>p. real_polynomial_function p \<and> (\<forall>t>0. nth_derivative k f t 1 = p t / t ^ (2 * k) * exp (- inverse t))) \<Longrightarrow> higher_differentiable_on {0<..} f (Suc k) \<and> (\<exists>p. real_polynomial_function p \<and> (\<forall>t>0. nth_derivative (Suc k) f t 1 = p t / t ^ (2 * Suc k) * exp (- inverse t)))
[PROOF STEP]
have rp: "real_polynomial_function rp"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_polynomial_function rp
[PROOF STEP]
unfolding rp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_polynomial_function (\<lambda>t. t\<^sup>2 * p' t - 2 * real k * t * p t + p t)
[PROOF STEP]
by (auto intro!: real_polynomial_function.intros(2-) real_polynomial_function_diff
        p1 p'1 simp: power2_eq_square)
[PROOF STATE]
proof (state)
this:
real_polynomial_function rp

goal (1 subgoal):
 1. \<And>k. higher_differentiable_on {0<..} f k \<and> (\<exists>p. real_polynomial_function p \<and> (\<forall>t>0. nth_derivative k f t 1 = p t / t ^ (2 * k) * exp (- inverse t))) \<Longrightarrow> higher_differentiable_on {0<..} f (Suc k) \<and> (\<exists>p. real_polynomial_function p \<and> (\<forall>t>0. nth_derivative (Suc k) f t 1 = p t / t ^ (2 * Suc k) * exp (- inverse t)))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
real_polynomial_function rp

goal (1 subgoal):
 1. \<And>k. higher_differentiable_on {0<..} f k \<and> (\<exists>p. real_polynomial_function p \<and> (\<forall>t>0. nth_derivative k f t 1 = p t / t ^ (2 * k) * exp (- inverse t))) \<Longrightarrow> higher_differentiable_on {0<..} f (Suc k) \<and> (\<exists>p. real_polynomial_function p \<and> (\<forall>t>0. nth_derivative (Suc k) f t 1 = p t / t ^ (2 * Suc k) * exp (- inverse t)))
[PROOF STEP]
have fk': "(\<lambda>x. nth_derivative k f x 1) differentiable at t" (is ?a)
    "frechet_derivative (\<lambda>x. nth_derivative k f x 1) (at t) 1 =
        rp t * (exp (-inverse t) / t^(2*k+2))" (is ?b)
    if "0 < t" for t
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. nth_derivative k f x 1) differentiable at t &&& frechet_derivative (\<lambda>x. nth_derivative k f x 1) (at t) 1 = rp t * (exp (- inverse t) / t ^ (2 * k + 2))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<lambda>x. nth_derivative k f x 1) differentiable at t
 2. frechet_derivative (\<lambda>x. nth_derivative k f x 1) (at t) 1 = rp t * (exp (- inverse t) / t ^ (2 * k + 2))
[PROOF STEP]
from p'2 that
[PROOF STATE]
proof (chain)
picking this:
\<forall>t. (p has_real_derivative p' t) (at t)
0 < t
[PROOF STEP]
have dp: "(p has_derivative ((*) (p' t))) (at t within {0<..})"
[PROOF STATE]
proof (prove)
using this:
\<forall>t. (p has_real_derivative p' t) (at t)
0 < t

goal (1 subgoal):
 1. (p has_derivative (*) (p' t)) (at t within {0<..})
[PROOF STEP]
by (auto simp: at_within_open[of _ "{0<..}"] has_field_derivative_def ac_simps)
[PROOF STATE]
proof (state)
this:
(p has_derivative (*) (p' t)) (at t within {0<..})

goal (2 subgoals):
 1. (\<lambda>x. nth_derivative k f x 1) differentiable at t
 2. frechet_derivative (\<lambda>x. nth_derivative k f x 1) (at t) 1 = rp t * (exp (- inverse t) / t ^ (2 * k + 2))
[PROOF STEP]
have "((\<lambda>t. p t / t ^ (2 * k) * exp (- inverse t)) has_derivative
      (\<lambda>v. v * rp t * (exp (-inverse t) / t^(2*k+2)))) (at t within {0<..})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>t. p t / t ^ (2 * k) * exp (- inverse t)) has_derivative (\<lambda>v. v * rp t * (exp (- inverse t) / t ^ (2 * k + 2)))) (at t within {0<..})
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
0 < t

goal (1 subgoal):
 1. ((\<lambda>t. p t / t ^ (2 * k) * exp (- inverse t)) has_derivative (\<lambda>v. v * rp t * (exp (- inverse t) / t ^ (2 * k + 2)))) (at t within {0<..})
[PROOF STEP]
apply (auto intro!: derivative_eq_intros dp ext)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>h. 0 < t \<Longrightarrow> ((p t * (inverse t * h * inverse t * exp (- inverse t)) + p' t * h * exp (- inverse t)) * t ^ (2 * k) - p t * exp (- inverse t) * (2 * real k * h * t ^ (2 * k - Suc 0))) / (t ^ (2 * k) * t ^ (2 * k)) = h * rp t * exp (- inverse t) / (t * (t * t ^ (2 * k)))
[PROOF STEP]
apply (simp add: divide_simps algebra_simps rp_def power2_eq_square)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>h. 0 < t \<Longrightarrow> h = 0 \<or> k = 0 \<or> p t = 0 \<or> t ^ (k * 2) = t * t ^ (k * 2 - Suc 0)
[PROOF STEP]
by (metis Suc_pred mult_is_0 neq0_conv power_Suc zero_neq_numeral)
[PROOF STATE]
proof (state)
this:
((\<lambda>t. p t / t ^ (2 * k) * exp (- inverse t)) has_derivative (\<lambda>v. v * rp t * (exp (- inverse t) / t ^ (2 * k + 2)))) (at t within {0<..})

goal (2 subgoals):
 1. (\<lambda>x. nth_derivative k f x 1) differentiable at t
 2. frechet_derivative (\<lambda>x. nth_derivative k f x 1) (at t) 1 = rp t * (exp (- inverse t) / t ^ (2 * k + 2))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>t. p t / t ^ (2 * k) * exp (- inverse t)) has_derivative (\<lambda>v. v * rp t * (exp (- inverse t) / t ^ (2 * k + 2)))) (at t within {0<..})
[PROOF STEP]
have "((\<lambda>x. nth_derivative k f x 1) has_derivative
      (\<lambda>v. v * rp t * (exp (-inverse t) / t^(2*k+2)))) (at t within {0<..})"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>t. p t / t ^ (2 * k) * exp (- inverse t)) has_derivative (\<lambda>v. v * rp t * (exp (- inverse t) / t ^ (2 * k + 2)))) (at t within {0<..})

goal (1 subgoal):
 1. ((\<lambda>x. nth_derivative k f x 1) has_derivative (\<lambda>v. v * rp t * (exp (- inverse t) / t ^ (2 * k + 2)))) (at t within {0<..})
[PROOF STEP]
apply (rule has_derivative_transform_within[OF _ zero_less_one])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. t \<in> {0<..}
 2. \<And>x'. \<lbrakk>x' \<in> {0<..}; dist x' t < 1\<rbrakk> \<Longrightarrow> p x' / x' ^ (2 * k) * exp (- inverse x') = nth_derivative k f x' 1
[PROOF STEP]
using that p2
[PROOF STATE]
proof (prove)
using this:
0 < t
\<forall>t>0. nth_derivative k f t 1 = p t / t ^ (2 * k) * exp (- inverse t)

goal (2 subgoals):
 1. t \<in> {0<..}
 2. \<And>x'. \<lbrakk>x' \<in> {0<..}; dist x' t < 1\<rbrakk> \<Longrightarrow> p x' / x' ^ (2 * k) * exp (- inverse x') = nth_derivative k f x' 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((\<lambda>x. nth_derivative k f x 1) has_derivative (\<lambda>v. v * rp t * (exp (- inverse t) / t ^ (2 * k + 2)))) (at t within {0<..})

goal (2 subgoals):
 1. (\<lambda>x. nth_derivative k f x 1) differentiable at t
 2. frechet_derivative (\<lambda>x. nth_derivative k f x 1) (at t) 1 = rp t * (exp (- inverse t) / t ^ (2 * k + 2))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. nth_derivative k f x 1) has_derivative (\<lambda>v. v * rp t * (exp (- inverse t) / t ^ (2 * k + 2)))) (at t within {0<..})
[PROOF STEP]
have "((\<lambda>x. nth_derivative k f x 1) has_derivative
      (\<lambda>v. v * rp t * (exp (-inverse t) / t^(2*k+2)))) (at t)"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. nth_derivative k f x 1) has_derivative (\<lambda>v. v * rp t * (exp (- inverse t) / t ^ (2 * k + 2)))) (at t within {0<..})

goal (1 subgoal):
 1. ((\<lambda>x. nth_derivative k f x 1) has_derivative (\<lambda>v. v * rp t * (exp (- inverse t) / t ^ (2 * k + 2)))) (at t)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. nth_derivative k f x 1) has_derivative (\<lambda>v. v * rp t * (exp (- inverse t) / t ^ (2 * k + 2)))) (at t within {0<..})
0 < t

goal (1 subgoal):
 1. ((\<lambda>x. nth_derivative k f x 1) has_derivative (\<lambda>v. v * rp t * (exp (- inverse t) / t ^ (2 * k + 2)))) (at t)
[PROOF STEP]
by (auto simp: at_within_open[of _ "{0<..}"])
[PROOF STATE]
proof (state)
this:
((\<lambda>x. nth_derivative k f x 1) has_derivative (\<lambda>v. v * rp t * (exp (- inverse t) / t ^ (2 * k + 2)))) (at t)

goal (2 subgoals):
 1. (\<lambda>x. nth_derivative k f x 1) differentiable at t
 2. frechet_derivative (\<lambda>x. nth_derivative k f x 1) (at t) 1 = rp t * (exp (- inverse t) / t ^ (2 * k + 2))
[PROOF STEP]
from frechet_derivative_at'[OF this] this
[PROOF STATE]
proof (chain)
picking this:
frechet_derivative (\<lambda>x. nth_derivative k f x 1) (at t) = (\<lambda>v. v * rp t * (exp (- inverse t) / t ^ (2 * k + 2)))
((\<lambda>x. nth_derivative k f x 1) has_derivative (\<lambda>v. v * rp t * (exp (- inverse t) / t ^ (2 * k + 2)))) (at t)
[PROOF STEP]
show ?a ?b
[PROOF STATE]
proof (prove)
using this:
frechet_derivative (\<lambda>x. nth_derivative k f x 1) (at t) = (\<lambda>v. v * rp t * (exp (- inverse t) / t ^ (2 * k + 2)))
((\<lambda>x. nth_derivative k f x 1) has_derivative (\<lambda>v. v * rp t * (exp (- inverse t) / t ^ (2 * k + 2)))) (at t)

goal (1 subgoal):
 1. (\<lambda>x. nth_derivative k f x 1) differentiable at t &&& frechet_derivative (\<lambda>x. nth_derivative k f x 1) (at t) 1 = rp t * (exp (- inverse t) / t ^ (2 * k + 2))
[PROOF STEP]
by (auto simp: differentiable_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. nth_derivative k f x 1) differentiable at t
frechet_derivative (\<lambda>x. nth_derivative k f x 1) (at t) 1 = rp t * (exp (- inverse t) / t ^ (2 * k + 2))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 < ?t \<Longrightarrow> (\<lambda>x. nth_derivative k f x 1) differentiable at ?t
0 < ?t \<Longrightarrow> frechet_derivative (\<lambda>x. nth_derivative k f x 1) (at ?t) 1 = rp ?t * (exp (- inverse ?t) / ?t ^ (2 * k + 2))

goal (1 subgoal):
 1. \<And>k. higher_differentiable_on {0<..} f k \<and> (\<exists>p. real_polynomial_function p \<and> (\<forall>t>0. nth_derivative k f t 1 = p t / t ^ (2 * k) * exp (- inverse t))) \<Longrightarrow> higher_differentiable_on {0<..} f (Suc k) \<and> (\<exists>p. real_polynomial_function p \<and> (\<forall>t>0. nth_derivative (Suc k) f t 1 = p t / t ^ (2 * Suc k) * exp (- inverse t)))
[PROOF STEP]
have hdS: "higher_differentiable_on {0<..} f (Suc k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. higher_differentiable_on {0<..} f (Suc k)
[PROOF STEP]
apply (subst higher_differentiable_on_real_Suc')
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. open {0<..}
 2. (\<forall>v. continuous_on {0<..} (\<lambda>x. nth_derivative (Suc k) f x 1)) \<and> (\<forall>x\<in>{0<..}. \<forall>v. (\<lambda>x. nth_derivative k f x 1) differentiable at x) \<and> higher_differentiable_on {0<..} f k
[PROOF STEP]
apply (auto simp: fk fk' frechet_derivative_nth_derivative_commute[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {0<..} (\<lambda>x. frechet_derivative (\<lambda>x. nth_derivative k f x 1) (at x) 1)
[PROOF STEP]
apply (subst continuous_on_cong[OF refl])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x \<in> {0<..} \<Longrightarrow> frechet_derivative (\<lambda>x. nth_derivative k f x 1) (at x) 1 = ?g9 x
 2. continuous_on {0<..} ?g9
[PROOF STEP]
apply (rule fk')
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x \<in> {0<..} \<Longrightarrow> 0 < x
 2. continuous_on {0<..} (\<lambda>x. rp x * (exp (- inverse x) / x ^ (2 * k + 2)))
[PROOF STEP]
by (auto intro!: continuous_intros p'1 p1 rp
        intro: continuous_on_real_polynomial_function)
[PROOF STATE]
proof (state)
this:
higher_differentiable_on {0<..} f (Suc k)

goal (1 subgoal):
 1. \<And>k. higher_differentiable_on {0<..} f k \<and> (\<exists>p. real_polynomial_function p \<and> (\<forall>t>0. nth_derivative k f t 1 = p t / t ^ (2 * k) * exp (- inverse t))) \<Longrightarrow> higher_differentiable_on {0<..} f (Suc k) \<and> (\<exists>p. real_polynomial_function p \<and> (\<forall>t>0. nth_derivative (Suc k) f t 1 = p t / t ^ (2 * Suc k) * exp (- inverse t)))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
higher_differentiable_on {0<..} f (Suc k)

goal (1 subgoal):
 1. \<And>k. higher_differentiable_on {0<..} f k \<and> (\<exists>p. real_polynomial_function p \<and> (\<forall>t>0. nth_derivative k f t 1 = p t / t ^ (2 * k) * exp (- inverse t))) \<Longrightarrow> higher_differentiable_on {0<..} f (Suc k) \<and> (\<exists>p. real_polynomial_function p \<and> (\<forall>t>0. nth_derivative (Suc k) f t 1 = p t / t ^ (2 * Suc k) * exp (- inverse t)))
[PROOF STEP]
have "nth_derivative (Suc k) f t 1 = rp t / t ^ (2 * (Suc k)) * exp (- inverse t)"
    if "t > 0" for t
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nth_derivative (Suc k) f t 1 = rp t / t ^ (2 * Suc k) * exp (- inverse t)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. nth_derivative (Suc k) f t 1 = rp t / t ^ (2 * Suc k) * exp (- inverse t)
[PROOF STEP]
have "nth_derivative (Suc k) f t 1 = frechet_derivative (\<lambda>x. nth_derivative k f x 1) (at t) 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nth_derivative (Suc k) f t 1 = frechet_derivative (\<lambda>x. nth_derivative k f x 1) (at t) 1
[PROOF STEP]
by (simp add: frechet_derivative_nth_derivative_commute)
[PROOF STATE]
proof (state)
this:
nth_derivative (Suc k) f t 1 = frechet_derivative (\<lambda>x. nth_derivative k f x 1) (at t) 1

goal (1 subgoal):
 1. nth_derivative (Suc k) f t 1 = rp t / t ^ (2 * Suc k) * exp (- inverse t)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
nth_derivative (Suc k) f t 1 = frechet_derivative (\<lambda>x. nth_derivative k f x 1) (at t) 1

goal (1 subgoal):
 1. nth_derivative (Suc k) f t 1 = rp t / t ^ (2 * Suc k) * exp (- inverse t)
[PROOF STEP]
have "\<dots> = rp t / t^(2*k+2) * (exp (-inverse t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frechet_derivative (\<lambda>x. nth_derivative k f x 1) (at t) 1 = rp t / t ^ (2 * k + 2) * exp (- inverse t)
[PROOF STEP]
using fk'[OF \<open>t > 0\<close>]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. nth_derivative k f x 1) differentiable at t
frechet_derivative (\<lambda>x. nth_derivative k f x 1) (at t) 1 = rp t * (exp (- inverse t) / t ^ (2 * k + 2))

goal (1 subgoal):
 1. frechet_derivative (\<lambda>x. nth_derivative k f x 1) (at t) 1 = rp t / t ^ (2 * k + 2) * exp (- inverse t)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
frechet_derivative (\<lambda>x. nth_derivative k f x 1) (at t) 1 = rp t / t ^ (2 * k + 2) * exp (- inverse t)

goal (1 subgoal):
 1. nth_derivative (Suc k) f t 1 = rp t / t ^ (2 * Suc k) * exp (- inverse t)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
nth_derivative (Suc k) f t 1 = rp t / t ^ (2 * k + 2) * exp (- inverse t)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
nth_derivative (Suc k) f t 1 = rp t / t ^ (2 * k + 2) * exp (- inverse t)

goal (1 subgoal):
 1. nth_derivative (Suc k) f t 1 = rp t / t ^ (2 * Suc k) * exp (- inverse t)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
nth_derivative (Suc k) f t 1 = rp t / t ^ (2 * Suc k) * exp (- inverse t)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 < ?t \<Longrightarrow> nth_derivative (Suc k) f ?t 1 = rp ?t / ?t ^ (2 * Suc k) * exp (- inverse ?t)

goal (1 subgoal):
 1. \<And>k. higher_differentiable_on {0<..} f k \<and> (\<exists>p. real_polynomial_function p \<and> (\<forall>t>0. nth_derivative k f t 1 = p t / t ^ (2 * k) * exp (- inverse t))) \<Longrightarrow> higher_differentiable_on {0<..} f (Suc k) \<and> (\<exists>p. real_polynomial_function p \<and> (\<forall>t>0. nth_derivative (Suc k) f t 1 = p t / t ^ (2 * Suc k) * exp (- inverse t)))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
real_polynomial_function rp
higher_differentiable_on {0<..} f (Suc k)
0 < ?t \<Longrightarrow> nth_derivative (Suc k) f ?t 1 = rp ?t / ?t ^ (2 * Suc k) * exp (- inverse ?t)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
real_polynomial_function rp
higher_differentiable_on {0<..} f (Suc k)
0 < ?t \<Longrightarrow> nth_derivative (Suc k) f ?t 1 = rp ?t / ?t ^ (2 * Suc k) * exp (- inverse ?t)

goal (1 subgoal):
 1. higher_differentiable_on {0<..} f (Suc k) \<and> (\<exists>p. real_polynomial_function p \<and> (\<forall>t>0. nth_derivative (Suc k) f t 1 = p t / t ^ (2 * Suc k) * exp (- inverse t)))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
higher_differentiable_on {0<..} f (Suc k) \<and> (\<exists>p. real_polynomial_function p \<and> (\<forall>t>0. nth_derivative (Suc k) f t 1 = p t / t ^ (2 * Suc k) * exp (- inverse t)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma \<beta>_boundedness_ge:
  fixes m :: int
  assumes "m \<le> k x" "x \<in> X"
  shows "\<exists> U \<subseteq> \<R>. \<Union> U = {u \<in> V. u x \<ge> m}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>U\<subseteq>\<R>. \<Union> U = {u \<in> V. real_of_int m \<le> u x}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>U\<subseteq>\<R>. \<Union> U = {u \<in> V. real_of_int m \<le> u x}
[PROOF STEP]
from \<beta>_boundedness_gt[OF assms] \<beta>_boundedness_eq[OF assms]
[PROOF STATE]
proof (chain)
picking this:
\<exists>U\<subseteq>\<R>. \<Union> U = {u \<in> V. real_of_int m < u x}
\<exists>U\<subseteq>\<R>. \<Union> U = {u \<in> V. u x = real_of_int m}
[PROOF STEP]
obtain U1 U2 where A:
    "U1 \<subseteq> \<R>" "\<Union> U1 = {u \<in> V. u x  > m}" "U2 \<subseteq> \<R>" "\<Union> U2 = {u \<in> V. u x = m}"
[PROOF STATE]
proof (prove)
using this:
\<exists>U\<subseteq>\<R>. \<Union> U = {u \<in> V. real_of_int m < u x}
\<exists>U\<subseteq>\<R>. \<Union> U = {u \<in> V. u x = real_of_int m}

goal (1 subgoal):
 1. (\<And>U1 U2. \<lbrakk>U1 \<subseteq> \<R>; \<Union> U1 = {u \<in> V. real_of_int m < u x}; U2 \<subseteq> \<R>; \<Union> U2 = {u \<in> V. u x = real_of_int m}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
U1 \<subseteq> \<R>
\<Union> U1 = {u \<in> V. real_of_int m < u x}
U2 \<subseteq> \<R>
\<Union> U2 = {u \<in> V. u x = real_of_int m}

goal (1 subgoal):
 1. \<exists>U\<subseteq>\<R>. \<Union> U = {u \<in> V. real_of_int m \<le> u x}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
U1 \<subseteq> \<R>
\<Union> U1 = {u \<in> V. real_of_int m < u x}
U2 \<subseteq> \<R>
\<Union> U2 = {u \<in> V. u x = real_of_int m}
[PROOF STEP]
have "{u \<in> V. u x \<ge> m} = \<Union> (U1 \<union> U2)" "U1 \<union> U2 \<subseteq> \<R>"
[PROOF STATE]
proof (prove)
using this:
U1 \<subseteq> \<R>
\<Union> U1 = {u \<in> V. real_of_int m < u x}
U2 \<subseteq> \<R>
\<Union> U2 = {u \<in> V. u x = real_of_int m}

goal (1 subgoal):
 1. {u \<in> V. real_of_int m \<le> u x} = \<Union> (U1 \<union> U2) &&& U1 \<union> U2 \<subseteq> \<R>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{u \<in> V. real_of_int m \<le> u x} = \<Union> (U1 \<union> U2)
U1 \<union> U2 \<subseteq> \<R>

goal (1 subgoal):
 1. \<exists>U\<subseteq>\<R>. \<Union> U = {u \<in> V. real_of_int m \<le> u x}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{u \<in> V. real_of_int m \<le> u x} = \<Union> (U1 \<union> U2)
U1 \<union> U2 \<subseteq> \<R>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
{u \<in> V. real_of_int m \<le> u x} = \<Union> (U1 \<union> U2)
U1 \<union> U2 \<subseteq> \<R>

goal (1 subgoal):
 1. \<exists>U\<subseteq>\<R>. \<Union> U = {u \<in> V. real_of_int m \<le> u x}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>U\<subseteq>\<R>. \<Union> U = {u \<in> V. real_of_int m \<le> u x}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma suminf_finite:
  assumes N: "finite N"
    and f: "\<And>n. n \<notin> N \<Longrightarrow> f n = 0"
  shows "suminf f = (\<Sum>n\<in>N. f n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. suminf f = sum f N
[PROOF STEP]
using sums_finite[OF assms, THEN sums_unique]
[PROOF STATE]
proof (prove)
using this:
(\<And>n. n \<notin> N \<Longrightarrow> n \<notin> N) \<Longrightarrow> sum f N = suminf f

goal (1 subgoal):
 1. suminf f = sum f N
[PROOF STEP]
by simp


[STATEMENT]
lemma homeomorphic_space_sym:
   "X homeomorphic_space Y \<longleftrightarrow> Y homeomorphic_space X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (X homeomorphic_space Y) = (Y homeomorphic_space X)
[PROOF STEP]
unfolding homeomorphic_space_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>f g. homeomorphic_maps X Y f g) = (\<exists>f g. homeomorphic_maps Y X f g)
[PROOF STEP]
by (metis homeomorphic_maps_sym)


[STATEMENT]
lemma paths_up_to_length_or_condition_with_witness_finite :
  "finite (paths_up_to_length_or_condition_with_witness M P k q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (paths_up_to_length_or_condition_with_witness M P k q)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite (paths_up_to_length_or_condition_with_witness M P k q)
[PROOF STEP]
have "paths_up_to_length_or_condition_with_witness M P k q
          \<subseteq> {(p, the (P p)) | p . path M q p \<and> length p \<le> k}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. paths_up_to_length_or_condition_with_witness M P k q \<subseteq> {(p, the (P p)) |p. path M q p \<and> length p \<le> k}
[PROOF STEP]
unfolding paths_up_to_length_or_condition_with_witness_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(p, x) |p x. path M q p \<and> length p \<le> k \<and> P p = Some x \<and> (\<forall>p' p''. p = p' @ p'' \<and> p'' \<noteq> [] \<longrightarrow> P p' = None)} \<subseteq> {(p, the (P p)) |p. path M q p \<and> length p \<le> k}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
paths_up_to_length_or_condition_with_witness M P k q \<subseteq> {(p, the (P p)) |p. path M q p \<and> length p \<le> k}

goal (1 subgoal):
 1. finite (paths_up_to_length_or_condition_with_witness M P k q)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
paths_up_to_length_or_condition_with_witness M P k q \<subseteq> {(p, the (P p)) |p. path M q p \<and> length p \<le> k}

goal (1 subgoal):
 1. finite (paths_up_to_length_or_condition_with_witness M P k q)
[PROOF STEP]
have "finite {(p, the (P p)) | p . path M q p \<and> length p \<le> k}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {(p, the (P p)) |p. path M q p \<and> length p \<le> k}
[PROOF STEP]
using paths_finite[of M q k]
[PROOF STATE]
proof (prove)
using this:
finite {p. path M q p \<and> length p \<le> k}

goal (1 subgoal):
 1. finite {(p, the (P p)) |p. path M q p \<and> length p \<le> k}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite {(p, the (P p)) |p. path M q p \<and> length p \<le> k}

goal (1 subgoal):
 1. finite (paths_up_to_length_or_condition_with_witness M P k q)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
paths_up_to_length_or_condition_with_witness M P k q \<subseteq> {(p, the (P p)) |p. path M q p \<and> length p \<le> k}
finite {(p, the (P p)) |p. path M q p \<and> length p \<le> k}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
paths_up_to_length_or_condition_with_witness M P k q \<subseteq> {(p, the (P p)) |p. path M q p \<and> length p \<le> k}
finite {(p, the (P p)) |p. path M q p \<and> length p \<le> k}

goal (1 subgoal):
 1. finite (paths_up_to_length_or_condition_with_witness M P k q)
[PROOF STEP]
using rev_finite_subset
[PROOF STATE]
proof (prove)
using this:
paths_up_to_length_or_condition_with_witness M P k q \<subseteq> {(p, the (P p)) |p. path M q p \<and> length p \<le> k}
finite {(p, the (P p)) |p. path M q p \<and> length p \<le> k}
\<lbrakk>finite ?B; ?A \<subseteq> ?B\<rbrakk> \<Longrightarrow> finite ?A

goal (1 subgoal):
 1. finite (paths_up_to_length_or_condition_with_witness M P k q)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite (paths_up_to_length_or_condition_with_witness M P k q)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ffold_ord_cons: assumes sorted: "sorted (h#t)"
    and distinct: "distinct (h#t)"
  shows "ffold_ord f (fset_of_list (h#t)) b = ffold_ord f (fset_of_list t) (f h b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ffold_ord f (fset_of_list (h # t)) b = ffold_ord f (fset_of_list t) (f h b)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ffold_ord f (fset_of_list (h # t)) b = ffold_ord f (fset_of_list t) (f h b)
[PROOF STEP]
have h_is_min: "h = fMin (fset_of_list (h#t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h = fMin (fset_of_list (h # t))
[PROOF STEP]
by (metis sorted fMin_Min list.sel(1) list.simps(3) sorted_hd_Min)
[PROOF STATE]
proof (state)
this:
h = fMin (fset_of_list (h # t))

goal (1 subgoal):
 1. ffold_ord f (fset_of_list (h # t)) b = ffold_ord f (fset_of_list t) (f h b)
[PROOF STEP]
have remove_min: "fset_of_list t = (fset_of_list (h#t)) - {|h|}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fset_of_list t = fset_of_list (h # t) |-| {|h|}
[PROOF STEP]
using distinct fset_of_list_elem
[PROOF STATE]
proof (prove)
using this:
distinct (h # t)
(?x |\<in>| fset_of_list ?xs) = (?x \<in> set ?xs)

goal (1 subgoal):
 1. fset_of_list t = fset_of_list (h # t) |-| {|h|}
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
fset_of_list t = fset_of_list (h # t) |-| {|h|}

goal (1 subgoal):
 1. ffold_ord f (fset_of_list (h # t)) b = ffold_ord f (fset_of_list t) (f h b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ffold_ord f (fset_of_list (h # t)) b = ffold_ord f (fset_of_list t) (f h b)
[PROOF STEP]
apply (simp only: ffold_ord.simps[of f "fset_of_list (h#t)"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if fset_of_list (h # t) = {||} then b else let ha = fMin (fset_of_list (h # t)); t = fset_of_list (h # t) |-| {|ha|} in ffold_ord f t (f ha b)) = ffold_ord f (fset_of_list t) (f h b)
[PROOF STEP]
by (metis h_is_min remove_min fset_of_list_empty list.distinct(1))
[PROOF STATE]
proof (state)
this:
ffold_ord f (fset_of_list (h # t)) b = ffold_ord f (fset_of_list t) (f h b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mult_apx_left_isotone_2:
  assumes "x \<sqsubseteq> y"
    shows "x * z \<sqsubseteq> y * z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * z \<sqsubseteq> y * z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x * z \<sqsubseteq> y * z
[PROOF STEP]
have "x * z \<le> y * z \<squnion> L * z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * z \<le> y * z \<squnion> L * z
[PROOF STEP]
by (metis assms apx_def mult_left_isotone mult_right_dist_sup)
[PROOF STATE]
proof (state)
this:
x * z \<le> y * z \<squnion> L * z

goal (1 subgoal):
 1. x * z \<sqsubseteq> y * z
[PROOF STEP]
hence 1: "x * z \<le> y * z \<squnion> L"
[PROOF STATE]
proof (prove)
using this:
x * z \<le> y * z \<squnion> L * z

goal (1 subgoal):
 1. x * z \<le> y * z \<squnion> L
[PROOF STEP]
using n_L_below_L order_lesseq_imp semiring.add_left_mono
[PROOF STATE]
proof (prove)
using this:
x * z \<le> y * z \<squnion> L * z
L * ?x \<le> L
(\<forall>z\<ge>?x. ?y \<le> z) = (?y \<le> ?x)
?a \<le> ?b \<Longrightarrow> ?c \<squnion> ?a \<le> ?c \<squnion> ?b

goal (1 subgoal):
 1. x * z \<le> y * z \<squnion> L
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x * z \<le> y * z \<squnion> L

goal (1 subgoal):
 1. x * z \<sqsubseteq> y * z
[PROOF STEP]
have "y * z \<le> x * z \<squnion> n(x) * top * z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y * z \<le> x * z \<squnion> n x * top * z
[PROOF STEP]
by (metis assms apx_def mult_left_isotone mult_right_dist_sup)
[PROOF STATE]
proof (state)
this:
y * z \<le> x * z \<squnion> n x * top * z

goal (1 subgoal):
 1. x * z \<sqsubseteq> y * z
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
y * z \<le> x * z \<squnion> n x * top * z

goal (1 subgoal):
 1. x * z \<sqsubseteq> y * z
[PROOF STEP]
have "... \<le> x * z \<squnion> n(x * z) * top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * z \<squnion> n x * top * z \<le> x * z \<squnion> n (x * z) * top
[PROOF STEP]
by (simp add: n_top_split)
[PROOF STATE]
proof (state)
this:
x * z \<squnion> n x * top * z \<le> x * z \<squnion> n (x * z) * top

goal (1 subgoal):
 1. x * z \<sqsubseteq> y * z
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
y * z \<le> x * z \<squnion> n (x * z) * top
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
y * z \<le> x * z \<squnion> n (x * z) * top

goal (1 subgoal):
 1. x * z \<sqsubseteq> y * z
[PROOF STEP]
using 1
[PROOF STATE]
proof (prove)
using this:
y * z \<le> x * z \<squnion> n (x * z) * top
x * z \<le> y * z \<squnion> L

goal (1 subgoal):
 1. x * z \<sqsubseteq> y * z
[PROOF STEP]
by (simp add: apx_def)
[PROOF STATE]
proof (state)
this:
x * z \<sqsubseteq> y * z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_union_of_singletons :
  assumes "\<And> S . S \<in> SS \<Longrightarrow> (\<exists> t . S = {t})"
shows "card (\<Union> SS) = card SS"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (\<Union> SS) = card SS
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card (\<Union> SS) = card SS
[PROOF STEP]
let ?f = "\<lambda> x . {x}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card (\<Union> SS) = card SS
[PROOF STEP]
have "bij_betw ?f (\<Union> SS) SS"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw (\<lambda>x. {x}) (\<Union> SS) SS
[PROOF STEP]
unfolding bij_betw_def inj_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x\<in>\<Union> SS. \<forall>y\<in>\<Union> SS. {x} = {y} \<longrightarrow> x = y) \<and> (\<lambda>x. {x}) ` \<Union> SS = SS
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?S \<in> SS \<Longrightarrow> \<exists>t. ?S = {t}

goal (1 subgoal):
 1. (\<forall>x\<in>\<Union> SS. \<forall>y\<in>\<Union> SS. {x} = {y} \<longrightarrow> x = y) \<and> (\<lambda>x. {x}) ` \<Union> SS = SS
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
bij_betw (\<lambda>x. {x}) (\<Union> SS) SS

goal (1 subgoal):
 1. card (\<Union> SS) = card SS
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
bij_betw (\<lambda>x. {x}) (\<Union> SS) SS
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
bij_betw (\<lambda>x. {x}) (\<Union> SS) SS

goal (1 subgoal):
 1. card (\<Union> SS) = card SS
[PROOF STEP]
using bij_betw_same_card
[PROOF STATE]
proof (prove)
using this:
bij_betw (\<lambda>x. {x}) (\<Union> SS) SS
bij_betw ?f ?A ?B \<Longrightarrow> card ?A = card ?B

goal (1 subgoal):
 1. card (\<Union> SS) = card SS
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
card (\<Union> SS) = card SS

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma simple_function_compose1:
  assumes "simple_function M f"
  shows "simple_function M (\<lambda>x. g (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. simple_function M (\<lambda>x. g (f x))
[PROOF STEP]
using simple_function_compose[OF assms, of g]
[PROOF STATE]
proof (prove)
using this:
simple_function M (g \<circ> f)

goal (1 subgoal):
 1. simple_function M (\<lambda>x. g (f x))
[PROOF STEP]
by (simp add: comp_def)


[STATEMENT]
lemma field_abs_le_zero_epsilon:
  fixes x :: "'a::{linordered_field}"
  assumes epsilon: "\<And>e. 0 < e \<Longrightarrow> \<bar>x\<bar> \<le> e"
  shows "\<bar>x\<bar> = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>x\<bar> = (0::'a)
[PROOF STEP]
proof (rule antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<bar>x\<bar> \<le> (0::'a)
 2. (0::'a) \<le> \<bar>x\<bar>
[PROOF STEP]
show "\<bar>x\<bar> \<le> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>x\<bar> \<le> (0::'a)
[PROOF STEP]
proof (rule field_le_epsilon)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>e. (0::'a) < e \<Longrightarrow> \<bar>x\<bar> \<le> (0::'a) + e
[PROOF STEP]
fix e :: 'a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>e. (0::'a) < e \<Longrightarrow> \<bar>x\<bar> \<le> (0::'a) + e
[PROOF STEP]
assume "0 < e"
[PROOF STATE]
proof (state)
this:
(0::'a) < e

goal (1 subgoal):
 1. \<And>e. (0::'a) < e \<Longrightarrow> \<bar>x\<bar> \<le> (0::'a) + e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(0::'a) < e
[PROOF STEP]
show "\<bar>x\<bar> \<le> 0 + e"
[PROOF STATE]
proof (prove)
using this:
(0::'a) < e

goal (1 subgoal):
 1. \<bar>x\<bar> \<le> (0::'a) + e
[PROOF STEP]
by simp fact
[PROOF STATE]
proof (state)
this:
\<bar>x\<bar> \<le> (0::'a) + e

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<bar>x\<bar> \<le> (0::'a)

goal (1 subgoal):
 1. (0::'a) \<le> \<bar>x\<bar>
[PROOF STEP]
qed simp


[STATEMENT]
lemma CARD_sdim [simp]: "CARD(sdim) = 7"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. CARD(sdim) = 7
[PROOF STEP]
by (simp add: sdim_UNIV)


[STATEMENT]
lemma binomial_eq_0_iff [simp]: "n choose k = 0 \<longleftrightarrow> n < k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (n choose k = 0) = (n < k)
[PROOF STEP]
by (metis binomial_eq_0 less_numeral_extra(3) not_less zero_less_binomial)


[STATEMENT]
lemma times0_left [simp]: "(0::'a::semiring_1^'n^'m) ** (A::'a ^'p^'n) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 ** A = 0
[PROOF STEP]
by (simp add: matrix_matrix_mult_def zero_vec_def)


[STATEMENT]
lemma Ints_det: assumes "\<And> i j. i < dim_row A \<Longrightarrow> j < dim_col A
  \<Longrightarrow> A $$ (i,j) \<in> \<int>"
  shows "det A \<in> \<int>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det A \<in> \<int>
[PROOF STEP]
proof (cases "dim_row A = dim_col A")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. dim_row A = dim_col A \<Longrightarrow> det A \<in> \<int>
 2. dim_row A \<noteq> dim_col A \<Longrightarrow> det A \<in> \<int>
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
dim_row A = dim_col A

goal (2 subgoals):
 1. dim_row A = dim_col A \<Longrightarrow> det A \<in> \<int>
 2. dim_row A \<noteq> dim_col A \<Longrightarrow> det A \<in> \<int>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det A \<in> \<int>
[PROOF STEP]
unfolding Determinant.det_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if dim_row A = dim_col A then \<Sum>p | p permutes {0..<dim_row A}. of_int (sign p) * (\<Prod>i = 0..<dim_row A. A $$ (i, p i)) else (0::'a)) \<in> \<int>
[PROOF STEP]
using True assms
[PROOF STATE]
proof (prove)
using this:
dim_row A = dim_col A
\<lbrakk>?i < dim_row A; ?j < dim_col A\<rbrakk> \<Longrightarrow> A $$ (?i, ?j) \<in> \<int>

goal (1 subgoal):
 1. (if dim_row A = dim_col A then \<Sum>p | p permutes {0..<dim_row A}. of_int (sign p) * (\<Prod>i = 0..<dim_row A. A $$ (i, p i)) else (0::'a)) \<in> \<int>
[PROOF STEP]
by (auto intro!: Ints_mult Ints_prod)
[PROOF STATE]
proof (state)
this:
det A \<in> \<int>

goal (1 subgoal):
 1. dim_row A \<noteq> dim_col A \<Longrightarrow> det A \<in> \<int>
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dim_row A \<noteq> dim_col A \<Longrightarrow> det A \<in> \<int>
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
dim_row A \<noteq> dim_col A

goal (1 subgoal):
 1. dim_row A \<noteq> dim_col A \<Longrightarrow> det A \<in> \<int>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det A \<in> \<int>
[PROOF STEP]
unfolding Determinant.det_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if dim_row A = dim_col A then \<Sum>p | p permutes {0..<dim_row A}. of_int (sign p) * (\<Prod>i = 0..<dim_row A. A $$ (i, p i)) else (0::'a)) \<in> \<int>
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
dim_row A \<noteq> dim_col A

goal (1 subgoal):
 1. (if dim_row A = dim_col A then \<Sum>p | p permutes {0..<dim_row A}. of_int (sign p) * (\<Prod>i = 0..<dim_row A. A $$ (i, p i)) else (0::'a)) \<in> \<int>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
det A \<in> \<int>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_subset: "\<lbrakk>card Y = n; Y \<subseteq> X\<rbrakk> \<Longrightarrow> card X \<ge> n \<or> infinite X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>card Y = n; Y \<subseteq> X\<rbrakk> \<Longrightarrow> n \<le> card X \<or> infinite X
[PROOF STEP]
using card_mono
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite ?B; ?A \<subseteq> ?B\<rbrakk> \<Longrightarrow> card ?A \<le> card ?B

goal (1 subgoal):
 1. \<lbrakk>card Y = n; Y \<subseteq> X\<rbrakk> \<Longrightarrow> n \<le> card X \<or> infinite X
[PROOF STEP]
by blast


[STATEMENT]
lemma convergent_add:
  fixes X Y :: "nat \<Rightarrow> 'a::topological_monoid_add"
  assumes "convergent (\<lambda>n. X n)"
    and "convergent (\<lambda>n. Y n)"
  shows "convergent (\<lambda>n. X n + Y n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convergent (\<lambda>n. X n + Y n)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
convergent X
convergent Y

goal (1 subgoal):
 1. convergent (\<lambda>n. X n + Y n)
[PROOF STEP]
unfolding convergent_def
[PROOF STATE]
proof (prove)
using this:
\<exists>L. X \<longlonglongrightarrow> L
\<exists>L. Y \<longlonglongrightarrow> L

goal (1 subgoal):
 1. \<exists>L. (\<lambda>n. X n + Y n) \<longlonglongrightarrow> L
[PROOF STEP]
by (blast intro: tendsto_add)


[STATEMENT]
lemma encode12_inv:
  assumes "k < d"
  shows "encode12 (encode1 k, encode2 k) = k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. encode12 (encode1 k, encode2 k) = k
[PROOF STEP]
unfolding encode12.simps encode1_def encode2_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. digit_decode dims (weave vars (digit_encode dims1 (digit_decode dims1 (nths (digit_encode dims k) vars))) (digit_encode dims2 (digit_decode dims2 (nths (digit_encode dims k) (- vars))))) = k
[PROOF STEP]
using assms d_def digit_encode_valid_index dims1_def dims2_def valid_index_nths
[PROOF STATE]
proof (prove)
using this:
k < d
d = prod_list dims
?a < prod_list ?ds \<Longrightarrow> digit_encode ?ds ?a \<lhd> ?ds
dims1 = nths dims vars
dims2 = nths dims (- vars)
?is \<lhd> ?ds \<Longrightarrow> nths ?is ?A \<lhd> nths ?ds ?A

goal (1 subgoal):
 1. digit_decode dims (weave vars (digit_encode dims1 (digit_decode dims1 (nths (digit_encode dims k) vars))) (digit_encode dims2 (digit_decode dims2 (nths (digit_encode dims k) (- vars))))) = k
[PROOF STEP]
by auto


[STATEMENT]
theorem normal_form_length_upper_bound:
  "normal_form_with_flatten_sigma_2_length \<phi> \<le> normal_form_length_upper_bound \<phi>" (is "?thesis1")
  "normal_form_with_flatten_pi_2_length \<phi> \<le> normal_form_length_upper_bound \<phi>" (is "?thesis2")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. normal_form_with_flatten_sigma_2_length \<phi> \<le> normal_form_length_upper_bound \<phi> &&& normal_form_with_flatten_pi_2_length \<phi> \<le> normal_form_length_upper_bound \<phi>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. normal_form_with_flatten_sigma_2_length \<phi> \<le> normal_form_length_upper_bound \<phi>
 2. normal_form_with_flatten_pi_2_length \<phi> \<le> normal_form_length_upper_bound \<phi>
[PROOF STEP]
let ?n = "size \<phi>"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. normal_form_with_flatten_sigma_2_length \<phi> \<le> normal_form_length_upper_bound \<phi>
 2. normal_form_with_flatten_pi_2_length \<phi> \<le> normal_form_length_upper_bound \<phi>
[PROOF STEP]
let ?b = "2 ^ (size \<phi> + 1) + 2 * (size \<phi> + 2) ^ 2"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. normal_form_with_flatten_sigma_2_length \<phi> \<le> normal_form_length_upper_bound \<phi>
 2. normal_form_with_flatten_pi_2_length \<phi> \<le> normal_form_length_upper_bound \<phi>
[PROOF STEP]
have "{(M, N) | M N. M \<subseteq> subformulas\<^sub>\<mu> \<phi> \<and> N \<subseteq> subformulas\<^sub>\<nu> \<phi>} = {M. M \<subseteq> subformulas\<^sub>\<mu> \<phi>} \<times> {N. N \<subseteq> subformulas\<^sub>\<nu> \<phi>}" (is "?choices = _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(M, N) |M N. M \<subseteq> subformulas\<^sub>\<mu> \<phi> \<and> N \<subseteq> subformulas\<^sub>\<nu> \<phi>} = {M. M \<subseteq> subformulas\<^sub>\<mu> \<phi>} \<times> {N. N \<subseteq> subformulas\<^sub>\<nu> \<phi>}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
{(M, N) |M N. M \<subseteq> subformulas\<^sub>\<mu> \<phi> \<and> N \<subseteq> subformulas\<^sub>\<nu> \<phi>} = {M. M \<subseteq> subformulas\<^sub>\<mu> \<phi>} \<times> {N. N \<subseteq> subformulas\<^sub>\<nu> \<phi>}

goal (2 subgoals):
 1. normal_form_with_flatten_sigma_2_length \<phi> \<le> normal_form_length_upper_bound \<phi>
 2. normal_form_with_flatten_pi_2_length \<phi> \<le> normal_form_length_upper_bound \<phi>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{(M, N) |M N. M \<subseteq> subformulas\<^sub>\<mu> \<phi> \<and> N \<subseteq> subformulas\<^sub>\<nu> \<phi>} = {M. M \<subseteq> subformulas\<^sub>\<mu> \<phi>} \<times> {N. N \<subseteq> subformulas\<^sub>\<nu> \<phi>}

goal (2 subgoals):
 1. normal_form_with_flatten_sigma_2_length \<phi> \<le> normal_form_length_upper_bound \<phi>
 2. normal_form_with_flatten_pi_2_length \<phi> \<le> normal_form_length_upper_bound \<phi>
[PROOF STEP]
have "card {M. M \<subseteq> subformulas\<^sub>\<mu> \<phi>} = (2 :: nat) ^ (card (subformulas\<^sub>\<mu> \<phi>))"
    and "card {N. N \<subseteq> subformulas\<^sub>\<nu> \<phi>} = (2 :: nat) ^ (card (subformulas\<^sub>\<nu> \<phi>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {M. M \<subseteq> subformulas\<^sub>\<mu> \<phi>} = 2 ^ card (subformulas\<^sub>\<mu> \<phi>) &&& card {N. N \<subseteq> subformulas\<^sub>\<nu> \<phi>} = 2 ^ card (subformulas\<^sub>\<nu> \<phi>)
[PROOF STEP]
using card_Pow
[PROOF STATE]
proof (prove)
using this:
finite ?A \<Longrightarrow> card (Pow ?A) = 2 ^ card ?A

goal (1 subgoal):
 1. card {M. M \<subseteq> subformulas\<^sub>\<mu> \<phi>} = 2 ^ card (subformulas\<^sub>\<mu> \<phi>) &&& card {N. N \<subseteq> subformulas\<^sub>\<nu> \<phi>} = 2 ^ card (subformulas\<^sub>\<nu> \<phi>)
[PROOF STEP]
unfolding Pow_def
[PROOF STATE]
proof (prove)
using this:
finite ?A \<Longrightarrow> card {B. B \<subseteq> ?A} = 2 ^ card ?A

goal (1 subgoal):
 1. card {M. M \<subseteq> subformulas\<^sub>\<mu> \<phi>} = 2 ^ card (subformulas\<^sub>\<mu> \<phi>) &&& card {N. N \<subseteq> subformulas\<^sub>\<nu> \<phi>} = 2 ^ card (subformulas\<^sub>\<nu> \<phi>)
[PROOF STEP]
using subformulas\<^sub>\<mu>_finite subformulas\<^sub>\<nu>_finite
[PROOF STATE]
proof (prove)
using this:
finite ?A \<Longrightarrow> card {B. B \<subseteq> ?A} = 2 ^ card ?A
finite (subformulas\<^sub>\<mu> ?\<phi>)
finite (subformulas\<^sub>\<nu> ?\<phi>)

goal (1 subgoal):
 1. card {M. M \<subseteq> subformulas\<^sub>\<mu> \<phi>} = 2 ^ card (subformulas\<^sub>\<mu> \<phi>) &&& card {N. N \<subseteq> subformulas\<^sub>\<nu> \<phi>} = 2 ^ card (subformulas\<^sub>\<nu> \<phi>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card {M. M \<subseteq> subformulas\<^sub>\<mu> \<phi>} = 2 ^ card (subformulas\<^sub>\<mu> \<phi>)
card {N. N \<subseteq> subformulas\<^sub>\<nu> \<phi>} = 2 ^ card (subformulas\<^sub>\<nu> \<phi>)

goal (2 subgoals):
 1. normal_form_with_flatten_sigma_2_length \<phi> \<le> normal_form_length_upper_bound \<phi>
 2. normal_form_with_flatten_pi_2_length \<phi> \<le> normal_form_length_upper_bound \<phi>
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
{(M, N) |M N. M \<subseteq> subformulas\<^sub>\<mu> \<phi> \<and> N \<subseteq> subformulas\<^sub>\<nu> \<phi>} = {M. M \<subseteq> subformulas\<^sub>\<mu> \<phi>} \<times> {N. N \<subseteq> subformulas\<^sub>\<nu> \<phi>}
card {M. M \<subseteq> subformulas\<^sub>\<mu> \<phi>} = 2 ^ card (subformulas\<^sub>\<mu> \<phi>)
card {N. N \<subseteq> subformulas\<^sub>\<nu> \<phi>} = 2 ^ card (subformulas\<^sub>\<nu> \<phi>)
[PROOF STEP]
have "card ?choices \<le> 2 ^ (card (subfrmlsn \<phi>))" (is "?f \<le> _")
[PROOF STATE]
proof (prove)
using this:
{(M, N) |M N. M \<subseteq> subformulas\<^sub>\<mu> \<phi> \<and> N \<subseteq> subformulas\<^sub>\<nu> \<phi>} = {M. M \<subseteq> subformulas\<^sub>\<mu> \<phi>} \<times> {N. N \<subseteq> subformulas\<^sub>\<nu> \<phi>}
card {M. M \<subseteq> subformulas\<^sub>\<mu> \<phi>} = 2 ^ card (subformulas\<^sub>\<mu> \<phi>)
card {N. N \<subseteq> subformulas\<^sub>\<nu> \<phi>} = 2 ^ card (subformulas\<^sub>\<nu> \<phi>)

goal (1 subgoal):
 1. card {(M, N) |M N. M \<subseteq> subformulas\<^sub>\<mu> \<phi> \<and> N \<subseteq> subformulas\<^sub>\<nu> \<phi>} \<le> 2 ^ card (subfrmlsn \<phi>)
[PROOF STEP]
by (metis subformulas\<^sub>\<mu>\<^sub>\<nu>_card card_cartesian_product subformulas\<^sub>\<mu>\<^sub>\<nu>_subfrmlsn subfrmlsn_finite Suc_1 card_mono lessI power_add power_increasing_iff)
[PROOF STATE]
proof (state)
this:
card {(M, N) |M N. M \<subseteq> subformulas\<^sub>\<mu> \<phi> \<and> N \<subseteq> subformulas\<^sub>\<nu> \<phi>} \<le> 2 ^ card (subfrmlsn \<phi>)

goal (2 subgoals):
 1. normal_form_with_flatten_sigma_2_length \<phi> \<le> normal_form_length_upper_bound \<phi>
 2. normal_form_with_flatten_pi_2_length \<phi> \<le> normal_form_length_upper_bound \<phi>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
card {(M, N) |M N. M \<subseteq> subformulas\<^sub>\<mu> \<phi> \<and> N \<subseteq> subformulas\<^sub>\<nu> \<phi>} \<le> 2 ^ card (subfrmlsn \<phi>)

goal (2 subgoals):
 1. normal_form_with_flatten_sigma_2_length \<phi> \<le> normal_form_length_upper_bound \<phi>
 2. normal_form_with_flatten_pi_2_length \<phi> \<le> normal_form_length_upper_bound \<phi>
[PROOF STEP]
have "(2 :: nat) ^ (card (subfrmlsn \<phi>)) \<le> 2 ^ ?n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ card (subfrmlsn \<phi>) \<le> 2 ^ size \<phi>
[PROOF STEP]
using power_increasing[of _ _ "2 :: nat"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?n \<le> ?N; 1 \<le> 2\<rbrakk> \<Longrightarrow> 2 ^ ?n \<le> 2 ^ ?N

goal (1 subgoal):
 1. 2 ^ card (subfrmlsn \<phi>) \<le> 2 ^ size \<phi>
[PROOF STEP]
by (simp add: subfrmlsn_card)
[PROOF STATE]
proof (state)
this:
2 ^ card (subfrmlsn \<phi>) \<le> 2 ^ size \<phi>

goal (2 subgoals):
 1. normal_form_with_flatten_sigma_2_length \<phi> \<le> normal_form_length_upper_bound \<phi>
 2. normal_form_with_flatten_pi_2_length \<phi> \<le> normal_form_length_upper_bound \<phi>
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
card {(M, N) |M N. M \<subseteq> subformulas\<^sub>\<mu> \<phi> \<and> N \<subseteq> subformulas\<^sub>\<nu> \<phi>} \<le> 2 ^ card (subfrmlsn \<phi>)
2 ^ card (subfrmlsn \<phi>) \<le> 2 ^ size \<phi>
[PROOF STEP]
have bar: "of_nat (card ?choices) \<le> (2 :: nat) ^ ?n"
[PROOF STATE]
proof (prove)
using this:
card {(M, N) |M N. M \<subseteq> subformulas\<^sub>\<mu> \<phi> \<and> N \<subseteq> subformulas\<^sub>\<nu> \<phi>} \<le> 2 ^ card (subfrmlsn \<phi>)
2 ^ card (subfrmlsn \<phi>) \<le> 2 ^ size \<phi>

goal (1 subgoal):
 1. of_nat (card {(M, N) |M N. M \<subseteq> subformulas\<^sub>\<mu> \<phi> \<and> N \<subseteq> subformulas\<^sub>\<nu> \<phi>}) \<le> 2 ^ size \<phi>
[PROOF STEP]
using of_nat_id
[PROOF STATE]
proof (prove)
using this:
card {(M, N) |M N. M \<subseteq> subformulas\<^sub>\<mu> \<phi> \<and> N \<subseteq> subformulas\<^sub>\<nu> \<phi>} \<le> 2 ^ card (subfrmlsn \<phi>)
2 ^ card (subfrmlsn \<phi>) \<le> 2 ^ size \<phi>
of_nat ?n = ?n

goal (1 subgoal):
 1. of_nat (card {(M, N) |M N. M \<subseteq> subformulas\<^sub>\<mu> \<phi> \<and> N \<subseteq> subformulas\<^sub>\<nu> \<phi>}) \<le> 2 ^ size \<phi>
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
of_nat (card {(M, N) |M N. M \<subseteq> subformulas\<^sub>\<mu> \<phi> \<and> N \<subseteq> subformulas\<^sub>\<nu> \<phi>}) \<le> 2 ^ size \<phi>

goal (2 subgoals):
 1. normal_form_with_flatten_sigma_2_length \<phi> \<le> normal_form_length_upper_bound \<phi>
 2. normal_form_with_flatten_pi_2_length \<phi> \<le> normal_form_length_upper_bound \<phi>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
of_nat (card {(M, N) |M N. M \<subseteq> subformulas\<^sub>\<mu> \<phi> \<and> N \<subseteq> subformulas\<^sub>\<nu> \<phi>}) \<le> 2 ^ size \<phi>

goal (2 subgoals):
 1. normal_form_with_flatten_sigma_2_length \<phi> \<le> normal_form_length_upper_bound \<phi>
 2. normal_form_with_flatten_pi_2_length \<phi> \<le> normal_form_length_upper_bound \<phi>
[PROOF STEP]
have "normal_form_with_flatten_sigma_2_length \<phi> \<le> of_nat (card ?choices) * ?b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. normal_form_with_flatten_sigma_2_length \<phi> \<le> of_nat (card {(M, N) |M N. M \<subseteq> subformulas\<^sub>\<mu> \<phi> \<and> N \<subseteq> subformulas\<^sub>\<nu> \<phi>}) * (2 ^ (size \<phi> + 1) + 2 * (size \<phi> + 2)\<^sup>2)
[PROOF STEP]
unfolding normal_form_with_flatten_sigma_2_length_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>(M, N)\<in>{(M, N) |M N. M \<subseteq> subformulas\<^sub>\<mu> \<phi> \<and> N \<subseteq> subformulas\<^sub>\<nu> \<phi>}. normal_form_disjunct_with_flatten_sigma_2_length \<phi> M N) \<le> of_nat (card {(M, N) |M N. M \<subseteq> subformulas\<^sub>\<mu> \<phi> \<and> N \<subseteq> subformulas\<^sub>\<nu> \<phi>}) * (2 ^ (size \<phi> + 1) + 2 * (size \<phi> + 2)\<^sup>2)
[PROOF STEP]
by (rule sum_bounded_above) (insert normal_form_disjunct_length_upper_bound, auto)
[PROOF STATE]
proof (state)
this:
normal_form_with_flatten_sigma_2_length \<phi> \<le> of_nat (card {(M, N) |M N. M \<subseteq> subformulas\<^sub>\<mu> \<phi> \<and> N \<subseteq> subformulas\<^sub>\<nu> \<phi>}) * (2 ^ (size \<phi> + 1) + 2 * (size \<phi> + 2)\<^sup>2)

goal (2 subgoals):
 1. normal_form_with_flatten_sigma_2_length \<phi> \<le> normal_form_length_upper_bound \<phi>
 2. normal_form_with_flatten_pi_2_length \<phi> \<le> normal_form_length_upper_bound \<phi>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
normal_form_with_flatten_sigma_2_length \<phi> \<le> of_nat (card {(M, N) |M N. M \<subseteq> subformulas\<^sub>\<mu> \<phi> \<and> N \<subseteq> subformulas\<^sub>\<nu> \<phi>}) * (2 ^ (size \<phi> + 1) + 2 * (size \<phi> + 2)\<^sup>2)

goal (2 subgoals):
 1. normal_form_with_flatten_sigma_2_length \<phi> \<le> normal_form_length_upper_bound \<phi>
 2. normal_form_with_flatten_pi_2_length \<phi> \<le> normal_form_length_upper_bound \<phi>
[PROOF STEP]
have "normal_form_with_flatten_pi_2_length \<phi> \<le> of_nat (card ?choices) * ?b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. normal_form_with_flatten_pi_2_length \<phi> \<le> of_nat (card {(M, N) |M N. M \<subseteq> subformulas\<^sub>\<mu> \<phi> \<and> N \<subseteq> subformulas\<^sub>\<nu> \<phi>}) * (2 ^ (size \<phi> + 1) + 2 * (size \<phi> + 2)\<^sup>2)
[PROOF STEP]
unfolding normal_form_with_flatten_pi_2_length_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>(M, N)\<in>{(M, N) |M N. M \<subseteq> subformulas\<^sub>\<mu> \<phi> \<and> N \<subseteq> subformulas\<^sub>\<nu> \<phi>}. normal_form_disjunct_with_flatten_pi_2_length \<phi> M N) \<le> of_nat (card {(M, N) |M N. M \<subseteq> subformulas\<^sub>\<mu> \<phi> \<and> N \<subseteq> subformulas\<^sub>\<nu> \<phi>}) * (2 ^ (size \<phi> + 1) + 2 * (size \<phi> + 2)\<^sup>2)
[PROOF STEP]
by (rule sum_bounded_above) (insert normal_form_disjunct_length_upper_bound, auto)
[PROOF STATE]
proof (state)
this:
normal_form_with_flatten_pi_2_length \<phi> \<le> of_nat (card {(M, N) |M N. M \<subseteq> subformulas\<^sub>\<mu> \<phi> \<and> N \<subseteq> subformulas\<^sub>\<nu> \<phi>}) * (2 ^ (size \<phi> + 1) + 2 * (size \<phi> + 2)\<^sup>2)

goal (2 subgoals):
 1. normal_form_with_flatten_sigma_2_length \<phi> \<le> normal_form_length_upper_bound \<phi>
 2. normal_form_with_flatten_pi_2_length \<phi> \<le> normal_form_length_upper_bound \<phi>
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
of_nat (card {(M, N) |M N. M \<subseteq> subformulas\<^sub>\<mu> \<phi> \<and> N \<subseteq> subformulas\<^sub>\<nu> \<phi>}) \<le> 2 ^ size \<phi>
normal_form_with_flatten_sigma_2_length \<phi> \<le> of_nat (card {(M, N) |M N. M \<subseteq> subformulas\<^sub>\<mu> \<phi> \<and> N \<subseteq> subformulas\<^sub>\<nu> \<phi>}) * (2 ^ (size \<phi> + 1) + 2 * (size \<phi> + 2)\<^sup>2)
normal_form_with_flatten_pi_2_length \<phi> \<le> of_nat (card {(M, N) |M N. M \<subseteq> subformulas\<^sub>\<mu> \<phi> \<and> N \<subseteq> subformulas\<^sub>\<nu> \<phi>}) * (2 ^ (size \<phi> + 1) + 2 * (size \<phi> + 2)\<^sup>2)
[PROOF STEP]
show ?thesis1 and ?thesis2
[PROOF STATE]
proof (prove)
using this:
of_nat (card {(M, N) |M N. M \<subseteq> subformulas\<^sub>\<mu> \<phi> \<and> N \<subseteq> subformulas\<^sub>\<nu> \<phi>}) \<le> 2 ^ size \<phi>
normal_form_with_flatten_sigma_2_length \<phi> \<le> of_nat (card {(M, N) |M N. M \<subseteq> subformulas\<^sub>\<mu> \<phi> \<and> N \<subseteq> subformulas\<^sub>\<nu> \<phi>}) * (2 ^ (size \<phi> + 1) + 2 * (size \<phi> + 2)\<^sup>2)
normal_form_with_flatten_pi_2_length \<phi> \<le> of_nat (card {(M, N) |M N. M \<subseteq> subformulas\<^sub>\<mu> \<phi> \<and> N \<subseteq> subformulas\<^sub>\<nu> \<phi>}) * (2 ^ (size \<phi> + 1) + 2 * (size \<phi> + 2)\<^sup>2)

goal (1 subgoal):
 1. normal_form_with_flatten_sigma_2_length \<phi> \<le> normal_form_length_upper_bound \<phi> &&& normal_form_with_flatten_pi_2_length \<phi> \<le> normal_form_length_upper_bound \<phi>
[PROOF STEP]
unfolding normal_form_length_upper_bound_def
[PROOF STATE]
proof (prove)
using this:
of_nat (card {(M, N) |M N. M \<subseteq> subformulas\<^sub>\<mu> \<phi> \<and> N \<subseteq> subformulas\<^sub>\<nu> \<phi>}) \<le> 2 ^ size \<phi>
normal_form_with_flatten_sigma_2_length \<phi> \<le> of_nat (card {(M, N) |M N. M \<subseteq> subformulas\<^sub>\<mu> \<phi> \<and> N \<subseteq> subformulas\<^sub>\<nu> \<phi>}) * (2 ^ (size \<phi> + 1) + 2 * (size \<phi> + 2)\<^sup>2)
normal_form_with_flatten_pi_2_length \<phi> \<le> of_nat (card {(M, N) |M N. M \<subseteq> subformulas\<^sub>\<mu> \<phi> \<and> N \<subseteq> subformulas\<^sub>\<nu> \<phi>}) * (2 ^ (size \<phi> + 1) + 2 * (size \<phi> + 2)\<^sup>2)

goal (1 subgoal):
 1. normal_form_with_flatten_sigma_2_length \<phi> \<le> 2 ^ size \<phi> * (2 ^ (size \<phi> + 1) + 2 * (size \<phi> + 2)\<^sup>2) &&& normal_form_with_flatten_pi_2_length \<phi> \<le> 2 ^ size \<phi> * (2 ^ (size \<phi> + 1) + 2 * (size \<phi> + 2)\<^sup>2)
[PROOF STEP]
using mult_le_mono1 order_trans
[PROOF STATE]
proof (prove)
using this:
of_nat (card {(M, N) |M N. M \<subseteq> subformulas\<^sub>\<mu> \<phi> \<and> N \<subseteq> subformulas\<^sub>\<nu> \<phi>}) \<le> 2 ^ size \<phi>
normal_form_with_flatten_sigma_2_length \<phi> \<le> of_nat (card {(M, N) |M N. M \<subseteq> subformulas\<^sub>\<mu> \<phi> \<and> N \<subseteq> subformulas\<^sub>\<nu> \<phi>}) * (2 ^ (size \<phi> + 1) + 2 * (size \<phi> + 2)\<^sup>2)
normal_form_with_flatten_pi_2_length \<phi> \<le> of_nat (card {(M, N) |M N. M \<subseteq> subformulas\<^sub>\<mu> \<phi> \<and> N \<subseteq> subformulas\<^sub>\<nu> \<phi>}) * (2 ^ (size \<phi> + 1) + 2 * (size \<phi> + 2)\<^sup>2)
?i \<le> ?j \<Longrightarrow> ?i * ?k \<le> ?j * ?k
\<lbrakk>?x \<le> ?y; ?y \<le> ?z\<rbrakk> \<Longrightarrow> ?x \<le> ?z

goal (1 subgoal):
 1. normal_form_with_flatten_sigma_2_length \<phi> \<le> 2 ^ size \<phi> * (2 ^ (size \<phi> + 1) + 2 * (size \<phi> + 2)\<^sup>2) &&& normal_form_with_flatten_pi_2_length \<phi> \<le> 2 ^ size \<phi> * (2 ^ (size \<phi> + 1) + 2 * (size \<phi> + 2)\<^sup>2)
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
normal_form_with_flatten_sigma_2_length \<phi> \<le> normal_form_length_upper_bound \<phi>
normal_form_with_flatten_pi_2_length \<phi> \<le> normal_form_length_upper_bound \<phi>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma compute_scaleR_pdves[code]: "scaleR_pdevs r (Pdevs xs) = Pdevs (map_slist (\<lambda>x. r *\<^sub>R x) xs)"
  and compute_pdevs_scaleR[code]: "pdevs_scaleR (Pdevs rs) x = Pdevs (map_slist (\<lambda>r. r *\<^sub>R x) rs)"
  and compute_uminus_pdevs[code]: "uminus_pdevs (Pdevs xs) = Pdevs (map_slist (\<lambda>x. - x) xs)"
  and compute_abs_pdevs[code]: "abs_pdevs (Pdevs xs) = Pdevs (map_slist abs xs)"
  and compute_pdevs_inner[code]: "pdevs_inner (Pdevs xs) b = Pdevs (map_slist (\<lambda>x. x \<bullet> b) xs)"
  and compute_pdevs_inner2[code]:
    "pdevs_inner2 (Pdevs xs) b c = Pdevs (map_slist (\<lambda>x. (x \<bullet> b, x \<bullet> c)) xs)"
  and compute_inner_scaleR_pdevs[code]:
    "inner_scaleR_pdevs x (Pdevs ys) = Pdevs (map_slist (\<lambda>y. (x \<bullet> y) *\<^sub>R y) ys)"
  and compute_trunc_pdevs[code]:
    "trunc_pdevs p (Pdevs xs) = Pdevs (map_slist (\<lambda>x. eucl_truncate_down p x) xs)"
  and compute_trunc_err_pdevs[code]:
    "trunc_err_pdevs p (Pdevs xs) = Pdevs (map_slist (\<lambda>x. eucl_truncate_down p x - x) xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((scaleR_pdevs r (Pdevs xs) = Pdevs (map_slist ((*\<^sub>R) r) xs) &&& pdevs_scaleR (Pdevs rs) x = Pdevs (map_slist (\<lambda>r. r *\<^sub>R x) rs)) &&& uminus_pdevs (Pdevs xs) = Pdevs (map_slist uminus xs) &&& abs_pdevs (Pdevs xs) = Pdevs (map_slist abs xs)) &&& (pdevs_inner (Pdevs xs) b = Pdevs (map_slist (\<lambda>x. x \<bullet> b) xs) &&& pdevs_inner2 (Pdevs xs) b c = Pdevs (map_slist (\<lambda>x. (x \<bullet> b, x \<bullet> c)) xs)) &&& inner_scaleR_pdevs x (Pdevs ys) = Pdevs (map_slist (\<lambda>y. (x \<bullet> y) *\<^sub>R y) ys) &&& trunc_pdevs p (Pdevs xs) = Pdevs (map_slist (eucl_truncate_down p) xs) &&& trunc_err_pdevs p (Pdevs xs) = Pdevs (map_slist (\<lambda>x. eucl_truncate_down p x - x) xs)
[PROOF STEP]
by (auto intro!: pdevs_eqI simp: pdevs_apply_map_slist zero_prod_def abs_pdevs_def)


[STATEMENT]
lemma tendsto_tanh [tendsto_intros]:
  fixes f :: "_ \<Rightarrow>'a::{real_normed_field,banach}"
  shows "(f \<longlongrightarrow> a) F \<Longrightarrow> cosh a \<noteq> 0 \<Longrightarrow> ((\<lambda>x. tanh (f x)) \<longlongrightarrow> tanh a) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(f \<longlongrightarrow> a) F; cosh a \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> ((\<lambda>x. tanh (f x)) \<longlongrightarrow> tanh a) F
[PROOF STEP]
by (rule isCont_tendsto_compose [OF isCont_tanh])


[STATEMENT]
lemma power2_e:
 "\<And>e::real. 0 < e \<Longrightarrow> \<exists>n::nat. real_of_rat (1/2)^n < e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<exists>n. real_of_rat (1 / 2) ^ n < e
[PROOF STEP]
by (simp add: real_arch_pow_inv)


[STATEMENT]
lemma finite_power_dvd:
  "\<lbrakk>(a::nat) > Suc 0; y \<noteq> 0\<rbrakk> \<Longrightarrow> finite {u. a^u dvd y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Suc 0 < a; y \<noteq> 0\<rbrakk> \<Longrightarrow> finite {u. a ^ u dvd y}
[PROOF STEP]
apply(auto simp: dvd_def simp:gr0_conv_Suc intro!:bounded_nat_set_is_finite[of _ y])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i m k. \<lbrakk>Suc 0 < a; y = a ^ i * k; Suc m = a ^ i * k\<rbrakk> \<Longrightarrow> i < a ^ i * k
[PROOF STEP]
by (metis le_less_trans mod_less mod_mult_self1_is_0 not_le Suc_lessD less_trans_Suc
      mult.right_neutral n_less_n_mult_m x_less_exp
      zero_less_Suc zero_less_mult_pos)


[STATEMENT]
lemma infinite_chain_function_iff_infinite_chain_llist:
  "(\<exists>f. \<forall>i. r (f (Suc i)) (f i)) \<longleftrightarrow> (\<exists>c. \<not> lfinite c \<and> chain r\<inverse>\<inverse> c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>f. \<forall>i. r (f (Suc i)) (f i)) = (\<exists>c. \<not> lfinite c \<and> chain r\<inverse>\<inverse> c)
[PROOF STEP]
using chain_inf_llist_if_infinite_chain_function infinite_chain_lnth_rel
[PROOF STATE]
proof (prove)
using this:
\<forall>i. ?r (?f (Suc i)) (?f i) \<Longrightarrow> \<not> lfinite (inf_llist ?f) \<and> chain ?r\<inverse>\<inverse> (inf_llist ?f)
\<lbrakk>\<not> lfinite ?c; chain ?r ?c\<rbrakk> \<Longrightarrow> ?r (lnth ?c ?i) (lnth ?c (Suc ?i))

goal (1 subgoal):
 1. (\<exists>f. \<forall>i. r (f (Suc i)) (f i)) = (\<exists>c. \<not> lfinite c \<and> chain r\<inverse>\<inverse> c)
[PROOF STEP]
by blast


[STATEMENT]
lemma word_and_not [simp]: "x AND NOT x = 0"
  for x :: "'a::len word"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x AND NOT x = 0
[PROOF STEP]
by (fact bit.conj_cancel_right)


[STATEMENT]
lemma fun_relD:
  shows " ((f,f')\<in>(A\<rightarrow>B)) \<Longrightarrow>
  (\<And>x x'. \<lbrakk> (x,x')\<in>A \<rbrakk> \<Longrightarrow> (f x, f' x')\<in>B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f, f') \<in> A \<rightarrow> B \<Longrightarrow> (\<And>x x'. (x, x') \<in> A \<Longrightarrow> (f x, f' x') \<in> B)
[PROOF STEP]
apply rule
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x x'. \<lbrakk>(f, f') \<in> A \<rightarrow> B; (x, x') \<in> A\<rbrakk> \<Longrightarrow> (f x, f' x') \<in> ?A x x'
 2. \<And>x x'. \<lbrakk>(f, f') \<in> A \<rightarrow> B; (x, x') \<in> A\<rbrakk> \<Longrightarrow> ?A x x' \<subseteq> B
[PROOF STEP]
by (auto simp: fun_rel_def)


[STATEMENT]
lemma vec_sub: "vec(x - y) = vec x - vec y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec (x - y) = vec x - vec y
[PROOF STEP]
by vector


[STATEMENT]
lemma bigo_fix: "(\<lambda>x. f ((x::nat) + 1)) =o O(\<lambda>x. h(x + 1)) \<Longrightarrow> f 0 = 0 \<Longrightarrow>
    f =o O(h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(\<lambda>x. f (x + 1)) \<in> O(\<lambda>x. h (x + 1)); f 0 = (0::'a)\<rbrakk> \<Longrightarrow> f \<in> O(h)
[PROOF STEP]
apply (simp add: bigo_alt_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<exists>c>0::'a. \<forall>x. \<bar>f (Suc x)\<bar> \<le> c * \<bar>h (Suc x)\<bar>; f 0 = (0::'a)\<rbrakk> \<Longrightarrow> \<exists>c>0::'a. \<forall>x. \<bar>f x\<bar> \<le> c * \<bar>h x\<bar>
[PROOF STEP]
by (metis abs_ge_zero abs_mult abs_of_pos abs_zero not0_implies_Suc)


[STATEMENT]
lemma i_cut_absorb_disj: "
  \<lbrakk> cut_op = (\<down><) \<or> cut_op = (\<down>\<le>) \<or>
    cut_op = (\<down>>) \<or> cut_op = (\<down>\<ge>) \<rbrakk>
  \<Longrightarrow> cut_op (cut_op I t) t = cut_op I t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cut_op = (\<down><) \<or> cut_op = (\<down>\<le>) \<or> cut_op = (\<down>>) \<or> cut_op = (\<down>\<ge>) \<Longrightarrow> cut_op (cut_op I t) t = cut_op I t
[PROOF STEP]
apply (drule i_cut_set_restriction_disj[where f="\<lambda>I. cut_op I t"], blast)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_restriction (\<lambda>I. cut_op I t) \<Longrightarrow> cut_op (cut_op I t) t = cut_op I t
[PROOF STEP]
apply (blast dest: set_restriction_absorb)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma mult_right_strict_mono: "0 < n \<Longrightarrow> strict_mono (\<lambda>x. x * (n::nat))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n \<Longrightarrow> strict_mono (\<lambda>x. x * n)
[PROOF STEP]
by (unfold strict_mono_def, clarify, simp)


[STATEMENT]
lemma "(x + y = (0::real)) = (y = -x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x + y = 0) = (y = - x)
[PROOF STEP]
by arith


[STATEMENT]
lemma ln_2_128:
  "\<bar>ln 2 - 235865763225513294137944142764154484399 / 2 ^ 128\<bar> \<le> inverse (2 ^ 128 :: real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>ln 2 - 235865763225513294137944142764154484399 / 2 ^ 128\<bar> \<le> inverse (2 ^ 128)
[PROOF STEP]
by (rule approx_coarsen[OF ln_2_40_decimals]) simp_all


[STATEMENT]
lemma gcd_mult_div_cancel_left1 [simp]:
  "gcd a b * (a div gcd a b)  = (a::'a::semiring_gcd)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd a b * (a div gcd a b) = a
[PROOF STEP]
by simp


[STATEMENT]
lemma open_unresolvable_not_ed_ou_card:
  assumes "open_unresolvable (X :: 'a::topological_space set)"
  assumes "\<not>ed_ou X"
  shows "card {f. CK_nf_pos (f::'a set \<Rightarrow> 'a set)} = 5"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {f. CK_nf_pos f} = 5
[PROOF STEP]
using open_unresolvable_eqs[OF \<open>open_unresolvable X\<close>] not_ed_ou_neqs[OF \<open>\<not>ed_ou X\<close>] \<open>\<not>ed_ou X\<close>
[PROOF STATE]
proof (prove)
using this:
I \<circ> K \<circ> I = I \<circ> K
K \<circ> I \<circ> K = K \<circ> I
I \<noteq> I \<circ> K
K \<noteq> K \<circ> I
\<not> ed_ou X

goal (1 subgoal):
 1. card {f. CK_nf_pos f} = 5
[PROOF STEP]
unfolding ed_ou_def
[PROOF STATE]
proof (prove)
using this:
I \<circ> K \<circ> I = I \<circ> K
K \<circ> I \<circ> K = K \<circ> I
I \<noteq> I \<circ> K
K \<noteq> K \<circ> I
I \<circ> K \<noteq> K \<circ> I

goal (1 subgoal):
 1. card {f. CK_nf_pos f} = 5
[PROOF STEP]
by (auto simp: CK_nf_pos_set card_insert_if)


[STATEMENT]
lemma succ_tran_subseteq_nodes: "\<lbrakk> wf_graph G \<rbrakk> \<Longrightarrow> succ_tran G v \<subseteq> nodes G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf_graph G \<Longrightarrow> succ_tran G v \<subseteq> nodes G
[PROOF STEP]
unfolding succ_tran_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf_graph G \<Longrightarrow> {e2. (v, e2) \<in> (edges G)\<^sup>+} \<subseteq> nodes G
[PROOF STEP]
using tranclD2 wf_graph.E_wfD(2)
[PROOF STATE]
proof (prove)
using this:
(?x, ?y) \<in> ?R\<^sup>+ \<Longrightarrow> \<exists>z. (?x, z) \<in> ?R\<^sup>* \<and> (z, ?y) \<in> ?R
\<lbrakk>wf_graph ?G; (?v, ?v') \<in> edges ?G\<rbrakk> \<Longrightarrow> ?v' \<in> nodes ?G

goal (1 subgoal):
 1. wf_graph G \<Longrightarrow> {e2. (v, e2) \<in> (edges G)\<^sup>+} \<subseteq> nodes G
[PROOF STEP]
by fastforce


[STATEMENT]
lemma has_integral_bound_spike_finite:
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::real_normed_vector"
  assumes "0 \<le> B" "finite S"
      and f: "(f has_integral i) (cbox a b)"
      and leB: "\<And>x. x \<in> cbox a b - S \<Longrightarrow> norm (f x) \<le> B"
    shows "norm i \<le> B * content (cbox a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm i \<le> B * content (cbox a b)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. norm i \<le> B * content (cbox a b)
[PROOF STEP]
define g where "g \<equiv> (\<lambda>x. if x \<in> S then 0 else f x)"
[PROOF STATE]
proof (state)
this:
g \<equiv> \<lambda>x. if x \<in> S then 0::'b else f x

goal (1 subgoal):
 1. norm i \<le> B * content (cbox a b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
g \<equiv> \<lambda>x. if x \<in> S then 0::'b else f x
[PROOF STEP]
have "\<And>x. x \<in> cbox a b - S \<Longrightarrow> norm (g x) \<le> B"
[PROOF STATE]
proof (prove)
using this:
g \<equiv> \<lambda>x. if x \<in> S then 0::'b else f x

goal (1 subgoal):
 1. \<And>x. x \<in> cbox a b - S \<Longrightarrow> norm (g x) \<le> B
[PROOF STEP]
using leB
[PROOF STATE]
proof (prove)
using this:
g \<equiv> \<lambda>x. if x \<in> S then 0::'b else f x
?x \<in> cbox a b - S \<Longrightarrow> norm (f ?x) \<le> B

goal (1 subgoal):
 1. \<And>x. x \<in> cbox a b - S \<Longrightarrow> norm (g x) \<le> B
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
?x \<in> cbox a b - S \<Longrightarrow> norm (g ?x) \<le> B

goal (1 subgoal):
 1. norm i \<le> B * content (cbox a b)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
?x \<in> cbox a b - S \<Longrightarrow> norm (g ?x) \<le> B

goal (1 subgoal):
 1. norm i \<le> B * content (cbox a b)
[PROOF STEP]
have "(g has_integral i) (cbox a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g has_integral i) (cbox a b)
[PROOF STEP]
using has_integral_spike_finite [OF \<open>finite S\<close> _ f]
[PROOF STATE]
proof (prove)
using this:
(\<And>x. x \<in> cbox a b - S \<Longrightarrow> ?g x = f x) \<Longrightarrow> (?g has_integral i) (cbox a b)

goal (1 subgoal):
 1. (g has_integral i) (cbox a b)
[PROOF STEP]
by (simp add: g_def)
[PROOF STATE]
proof (state)
this:
(g has_integral i) (cbox a b)

goal (1 subgoal):
 1. norm i \<le> B * content (cbox a b)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
?x \<in> cbox a b - S \<Longrightarrow> norm (g ?x) \<le> B
(g has_integral i) (cbox a b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
?x \<in> cbox a b - S \<Longrightarrow> norm (g ?x) \<le> B
(g has_integral i) (cbox a b)

goal (1 subgoal):
 1. norm i \<le> B * content (cbox a b)
[PROOF STEP]
by (simp add: \<open>0 \<le> B\<close> g_def has_integral_bound)
[PROOF STATE]
proof (state)
this:
norm i \<le> B * content (cbox a b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lfp_in_Fix:
  fixes f :: "'a::complete_lattice \<Rightarrow> 'a"
  shows "mono f \<Longrightarrow> lfp f \<in> Fix f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mono f \<Longrightarrow> lfp f \<in> Fix f
[PROOF STEP]
using Fix_def lfp_unfold
[PROOF STATE]
proof (prove)
using this:
Fix ?f = {x. ?f x = x}
mono ?f \<Longrightarrow> lfp ?f = ?f (lfp ?f)

goal (1 subgoal):
 1. mono f \<Longrightarrow> lfp f \<in> Fix f
[PROOF STEP]
by fastforce


[STATEMENT]
lemma length_col_mat_to_cols_list [simp]:
  assumes "j < dim_col A"
  shows "length (col (mat_to_cols_list A) j) = dim_row A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (Matrix_Legacy.col (mat_to_cols_list A) j) = dim_row A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
j < dim_col A

goal (1 subgoal):
 1. length (Matrix_Legacy.col (mat_to_cols_list A) j) = dim_row A
[PROOF STEP]
by (simp add: col_def mat_to_cols_list_def)


[STATEMENT]
lemma tdev_eq_zero_iff: fixes X::"real pdevs" shows "tdev X = 0 \<longleftrightarrow> (\<forall>e. pdevs_val e X = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (tdev X = 0) = (\<forall>e. pdevs_val e X = 0)
[PROOF STEP]
by (force simp add: pdevs_val_sum tdev_def sum_nonneg_eq_0_iff
    dest!: spec[where x="\<lambda>i. if pdevs_apply X i \<ge> 0 then 1 else -1"] split: if_split_asm)


[STATEMENT]
lemma jordan_nf_via_factored_charpoly: assumes A: "A \<in> carrier_mat n n"
  and linear: "char_poly A = (\<Prod> a \<leftarrow> es. [:- a, 1:])"
  shows "jordan_nf A (jordan_nf_via_factored_charpoly A es)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jordan_nf A (jordan_nf_via_factored_charpoly A es)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. jordan_nf A (jordan_nf_via_factored_charpoly A es)
[PROOF STEP]
let ?B = "schur_upper_triangular A es"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. jordan_nf A (jordan_nf_via_factored_charpoly A es)
[PROOF STEP]
let ?J = "jordan_nf_via_factored_charpoly A es"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. jordan_nf A (jordan_nf_via_factored_charpoly A es)
[PROOF STEP]
from schur_upper_triangular[OF A linear]
[PROOF STATE]
proof (chain)
picking this:
schur_upper_triangular A es \<in> carrier_mat n n
upper_triangular (schur_upper_triangular A es)
similar_mat A (schur_upper_triangular A es)
[PROOF STEP]
have B: "?B \<in> carrier_mat n n" "upper_triangular ?B" and AB: "similar_mat A ?B"
[PROOF STATE]
proof (prove)
using this:
schur_upper_triangular A es \<in> carrier_mat n n
upper_triangular (schur_upper_triangular A es)
similar_mat A (schur_upper_triangular A es)

goal (1 subgoal):
 1. (schur_upper_triangular A es \<in> carrier_mat n n &&& upper_triangular (schur_upper_triangular A es)) &&& similar_mat A (schur_upper_triangular A es)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
schur_upper_triangular A es \<in> carrier_mat n n
upper_triangular (schur_upper_triangular A es)
similar_mat A (schur_upper_triangular A es)

goal (1 subgoal):
 1. jordan_nf A (jordan_nf_via_factored_charpoly A es)
[PROOF STEP]
from triangular_to_jnf_vector[OF B]
[PROOF STATE]
proof (chain)
picking this:
jordan_nf (schur_upper_triangular A es) (triangular_to_jnf_vector (schur_upper_triangular A es))
[PROOF STEP]
have "jordan_nf ?B ?J"
[PROOF STATE]
proof (prove)
using this:
jordan_nf (schur_upper_triangular A es) (triangular_to_jnf_vector (schur_upper_triangular A es))

goal (1 subgoal):
 1. jordan_nf (schur_upper_triangular A es) (jordan_nf_via_factored_charpoly A es)
[PROOF STEP]
unfolding jordan_nf_via_factored_charpoly_def
[PROOF STATE]
proof (prove)
using this:
jordan_nf (schur_upper_triangular A es) (triangular_to_jnf_vector (schur_upper_triangular A es))

goal (1 subgoal):
 1. jordan_nf (schur_upper_triangular A es) (triangular_to_jnf_vector (schur_upper_triangular A es))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
jordan_nf (schur_upper_triangular A es) (jordan_nf_via_factored_charpoly A es)

goal (1 subgoal):
 1. jordan_nf A (jordan_nf_via_factored_charpoly A es)
[PROOF STEP]
with similar_mat_trans[OF AB]
[PROOF STATE]
proof (chain)
picking this:
similar_mat (schur_upper_triangular A es) ?C \<Longrightarrow> similar_mat A ?C
jordan_nf (schur_upper_triangular A es) (jordan_nf_via_factored_charpoly A es)
[PROOF STEP]
show "jordan_nf A ?J"
[PROOF STATE]
proof (prove)
using this:
similar_mat (schur_upper_triangular A es) ?C \<Longrightarrow> similar_mat A ?C
jordan_nf (schur_upper_triangular A es) (jordan_nf_via_factored_charpoly A es)

goal (1 subgoal):
 1. jordan_nf A (jordan_nf_via_factored_charpoly A es)
[PROOF STEP]
unfolding jordan_nf_def
[PROOF STATE]
proof (prove)
using this:
similar_mat (schur_upper_triangular A es) ?C \<Longrightarrow> similar_mat A ?C
0 \<notin> fst ` set (jordan_nf_via_factored_charpoly A es) \<and> similar_mat (schur_upper_triangular A es) (jordan_matrix (jordan_nf_via_factored_charpoly A es))

goal (1 subgoal):
 1. 0 \<notin> fst ` set (jordan_nf_via_factored_charpoly A es) \<and> similar_mat A (jordan_matrix (jordan_nf_via_factored_charpoly A es))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
jordan_nf A (jordan_nf_via_factored_charpoly A es)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma implic:
 assumes "\<forall>i j.((P i j) \<longrightarrow> (Q i j))"
        and "\<forall>i j.((Q i j) \<longrightarrow> (R i j))"
 shows "\<forall>i j.((P i j) \<longrightarrow> (R i j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i j. P i j \<longrightarrow> R i j
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>i j. P i j \<longrightarrow> Q i j
\<forall>i j. Q i j \<longrightarrow> R i j

goal (1 subgoal):
 1. \<forall>i j. P i j \<longrightarrow> R i j
[PROOF STEP]
by auto


[STATEMENT]
lemma Icc_Un_Ici[simp]:
  shows "{a..b} \<union> {b..} = {min a b..}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {a..b} \<union> {b..} = {min a b..}
[PROOF STEP]
unfolding atLeastAtMost_def atLeast_def atMost_def min_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. a \<le> x} \<inter> {x. x \<le> b} \<union> {x. b \<le> x} = {x. (if a \<le> b then a else b) \<le> x}
[PROOF STEP]
by auto


[STATEMENT]
lemma sum_nonpos_eq_0_iff:
  fixes f :: "'a \<Rightarrow> 'b::ordered_ab_group_add"
  shows "\<lbrakk>finite A; \<forall>x\<in>A. f x \<le> 0\<rbrakk> \<Longrightarrow> sum f A = 0 \<longleftrightarrow> (\<forall>x\<in>A. f x = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; \<forall>x\<in>A. f x \<le> (0::'b)\<rbrakk> \<Longrightarrow> (sum f A = (0::'b)) = (\<forall>x\<in>A. f x = (0::'b))
[PROOF STEP]
by (induct set: finite) (simp_all add: add_nonpos_eq_0_iff sum_nonpos)


[STATEMENT]
lemma tensor_prod_2 [simp]:
"mult.vec_vec_Tensor (*) [x1::complex,x2] [x3, x4] = [x1 * x3, x1 * x4, x2 * x3, x2 * x4]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mult.vec_vec_Tensor (*) [x1, x2] [x3, x4] = [x1 * x3, x1 * x4, x2 * x3, x2 * x4]
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mult.vec_vec_Tensor (*) [x1, x2] [x3, x4] = [x1 * x3, x1 * x4, x2 * x3, x2 * x4]
[PROOF STEP]
have "Matrix_Tensor.mult (1::complex) (*)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Matrix_Tensor.mult 1 (*)
[PROOF STEP]
by (simp add: Matrix_Tensor.mult_def)
[PROOF STATE]
proof (state)
this:
Matrix_Tensor.mult 1 (*)

goal (1 subgoal):
 1. mult.vec_vec_Tensor (*) [x1, x2] [x3, x4] = [x1 * x3, x1 * x4, x2 * x3, x2 * x4]
[PROOF STEP]
thus "mult.vec_vec_Tensor (*) [x1::complex,x2] [x3,x4] = [x1*x3,x1*x4,x2*x3,x2*x4]"
[PROOF STATE]
proof (prove)
using this:
Matrix_Tensor.mult 1 (*)

goal (1 subgoal):
 1. mult.vec_vec_Tensor (*) [x1, x2] [x3, x4] = [x1 * x3, x1 * x4, x2 * x3, x2 * x4]
[PROOF STEP]
using mult.vec_vec_Tensor_def[of "(1::complex)" "(*)"] mult.times_def[of "(1::complex)" "(*)"]
[PROOF STATE]
proof (prove)
using this:
Matrix_Tensor.mult 1 (*)
Matrix_Tensor.mult 1 (*) \<Longrightarrow> mult.vec_vec_Tensor (*) \<equiv> rec_list (\<lambda>ys. []) (\<lambda>x xs xsa ys. mult.times (*) x ys @ xsa ys)
Matrix_Tensor.mult 1 (*) \<Longrightarrow> mult.times (*) \<equiv> \<lambda>uu uua. rec_list (\<lambda>n. []) (\<lambda>y ys ysa n. n * y # ysa n) uua uu

goal (1 subgoal):
 1. mult.vec_vec_Tensor (*) [x1, x2] [x3, x4] = [x1 * x3, x1 * x4, x2 * x3, x2 * x4]
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
mult.vec_vec_Tensor (*) [x1, x2] [x3, x4] = [x1 * x3, x1 * x4, x2 * x3, x2 * x4]

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma islimpt_approachable_le: "x islimpt S \<longleftrightarrow> (\<forall>e>0. \<exists>x'\<in> S. x' \<noteq> x \<and> dist x' x \<le> e)"
  for x :: "'a::metric_space"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x islimpt S = (\<forall>e>0. \<exists>x'\<in>S. x' \<noteq> x \<and> dist x' x \<le> e)
[PROOF STEP]
unfolding islimpt_approachable
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>e>0. \<exists>x'\<in>S. x' \<noteq> x \<and> dist x' x < e) = (\<forall>e>0. \<exists>x'\<in>S. x' \<noteq> x \<and> dist x' x \<le> e)
[PROOF STEP]
using approachable_lt_le2 [where f="\<lambda>y. dist y x" and P="\<lambda>y. y \<notin> S \<or> y = x" and Q="\<lambda>x. True"]
[PROOF STATE]
proof (prove)
using this:
(\<exists>d>0. \<forall>xa. True \<longrightarrow> dist xa x < d \<longrightarrow> xa \<notin> S \<or> xa = x) = (\<exists>d>0. \<forall>xa. dist xa x \<le> d \<longrightarrow> True \<longrightarrow> xa \<notin> S \<or> xa = x)

goal (1 subgoal):
 1. (\<forall>e>0. \<exists>x'\<in>S. x' \<noteq> x \<and> dist x' x < e) = (\<forall>e>0. \<exists>x'\<in>S. x' \<noteq> x \<and> dist x' x \<le> e)
[PROOF STEP]
by auto


[STATEMENT]
lemma conv_abscissa_perzeta: "conv_abscissa (fds_perzeta q) \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conv_abscissa (fds_perzeta q) \<le> 1
[PROOF STEP]
by (rule order.trans[OF conv_le_abs_conv_abscissa abs_conv_abscissa_perzeta])


[STATEMENT]
lemma frac_in_Ints_iff [simp]: "frac x \<in> \<int> \<longleftrightarrow> x \<in> \<int>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (frac x \<in> \<int>) = (x \<in> \<int>)
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. frac x \<in> \<int> \<Longrightarrow> x \<in> \<int>
 2. x \<in> \<int> \<Longrightarrow> frac x \<in> \<int>
[PROOF STEP]
assume "frac x \<in> \<int>"
[PROOF STATE]
proof (state)
this:
frac x \<in> \<int>

goal (2 subgoals):
 1. frac x \<in> \<int> \<Longrightarrow> x \<in> \<int>
 2. x \<in> \<int> \<Longrightarrow> frac x \<in> \<int>
[PROOF STEP]
hence "of_int \<lfloor>x\<rfloor> + frac x \<in> \<int>"
[PROOF STATE]
proof (prove)
using this:
frac x \<in> \<int>

goal (1 subgoal):
 1. of_int \<lfloor>x\<rfloor> + frac x \<in> \<int>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
of_int \<lfloor>x\<rfloor> + frac x \<in> \<int>

goal (2 subgoals):
 1. frac x \<in> \<int> \<Longrightarrow> x \<in> \<int>
 2. x \<in> \<int> \<Longrightarrow> frac x \<in> \<int>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
of_int \<lfloor>x\<rfloor> + frac x \<in> \<int>

goal (2 subgoals):
 1. frac x \<in> \<int> \<Longrightarrow> x \<in> \<int>
 2. x \<in> \<int> \<Longrightarrow> frac x \<in> \<int>
[PROOF STEP]
have "of_int \<lfloor>x\<rfloor> + frac x = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int \<lfloor>x\<rfloor> + frac x = x
[PROOF STEP]
by (simp add: frac_def)
[PROOF STATE]
proof (state)
this:
of_int \<lfloor>x\<rfloor> + frac x = x

goal (2 subgoals):
 1. frac x \<in> \<int> \<Longrightarrow> x \<in> \<int>
 2. x \<in> \<int> \<Longrightarrow> frac x \<in> \<int>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x \<in> \<int>
[PROOF STEP]
show "x \<in> \<int>"
[PROOF STATE]
proof (prove)
using this:
x \<in> \<int>

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

goal (1 subgoal):
 1. x \<in> \<int> \<Longrightarrow> frac x \<in> \<int>
[PROOF STEP]
qed (auto simp: frac_def)


[STATEMENT]
lemma add_0_right_vecset:
  assumes "(A :: 'a :: monoid_add vec set) \<subseteq> carrier_vec n"
  shows "A + {0\<^sub>v n} = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A + {0\<^sub>v n} = A
[PROOF STEP]
unfolding set_plus_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {c. \<exists>a\<in>A. \<exists>b\<in>{0\<^sub>v n}. c = a + b} = A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> carrier_vec n

goal (1 subgoal):
 1. {c. \<exists>a\<in>A. \<exists>b\<in>{0\<^sub>v n}. c = a + b} = A
[PROOF STEP]
by force


[STATEMENT]
lemma ord_minus:
  assumes "a \<in>  nonzero Q\<^sub>p"
  shows "ord a = ord (\<ominus>a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ord a = ord (\<ominus> a)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ord a = ord (\<ominus> a)
[PROOF STEP]
have "\<ominus> a = \<ominus> (frac (numer a) (denom a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<ominus> a = \<ominus> fraction Z\<^sub>p (numerator Z\<^sub>p a) (denominator Z\<^sub>p a)
[PROOF STEP]
using assms Qp.nonzero_closed local.numer_denom_facts(5)
[PROOF STATE]
proof (prove)
using this:
a \<in> nonzero Q\<^sub>p
?a \<in> nonzero Q\<^sub>p \<Longrightarrow> ?a \<in> carrier Q\<^sub>p
?a \<in> carrier Q\<^sub>p \<Longrightarrow> ?a = fraction Z\<^sub>p (numerator Z\<^sub>p ?a) (denominator Z\<^sub>p ?a)

goal (1 subgoal):
 1. \<ominus> a = \<ominus> fraction Z\<^sub>p (numerator Z\<^sub>p a) (denominator Z\<^sub>p a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<ominus> a = \<ominus> fraction Z\<^sub>p (numerator Z\<^sub>p a) (denominator Z\<^sub>p a)

goal (1 subgoal):
 1. ord a = ord (\<ominus> a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<ominus> a = \<ominus> fraction Z\<^sub>p (numerator Z\<^sub>p a) (denominator Z\<^sub>p a)
[PROOF STEP]
have "\<ominus> a = (frac (\<ominus>\<^bsub>Z\<^sub>p\<^esub> (numer a)) (denom a))"
[PROOF STATE]
proof (prove)
using this:
\<ominus> a = \<ominus> fraction Z\<^sub>p (numerator Z\<^sub>p a) (denominator Z\<^sub>p a)

goal (1 subgoal):
 1. \<ominus> a = fraction Z\<^sub>p (\<ominus>\<^bsub>Z\<^sub>p\<^esub> numerator Z\<^sub>p a) (denominator Z\<^sub>p a)
[PROOF STEP]
by (simp add: Qp.nonzero_closed assms local.frac_uminus local.numer_denom_facts(1) local.numer_denom_facts(2))
[PROOF STATE]
proof (state)
this:
\<ominus> a = fraction Z\<^sub>p (\<ominus>\<^bsub>Z\<^sub>p\<^esub> numerator Z\<^sub>p a) (denominator Z\<^sub>p a)

goal (1 subgoal):
 1. ord a = ord (\<ominus> a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<ominus> a = fraction Z\<^sub>p (\<ominus>\<^bsub>Z\<^sub>p\<^esub> numerator Z\<^sub>p a) (denominator Z\<^sub>p a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<ominus> a = fraction Z\<^sub>p (\<ominus>\<^bsub>Z\<^sub>p\<^esub> numerator Z\<^sub>p a) (denominator Z\<^sub>p a)

goal (1 subgoal):
 1. ord a = ord (\<ominus> a)
[PROOF STEP]
by (metis Q\<^sub>p_def Qp.add.inv_eq_1_iff Qp.nonzero_closed Zp.add.inv_closed assms
        local.numer_denom_facts(1) local.numer_denom_facts(2) nonzero_fraction_imp_nonzero_numer
        numer_nonzero ord_Zp_of_a_inv ord_def ord_of_frac)
[PROOF STATE]
proof (state)
this:
ord a = ord (\<ominus> a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_lattice_complete_Inf_lower:
  "(x::'a::finite_lattice_complete) \<in> A \<Longrightarrow> Inf A \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> A \<Longrightarrow> Inf A \<le> x
[PROOF STEP]
using finite [of A]
[PROOF STATE]
proof (prove)
using this:
finite A

goal (1 subgoal):
 1. x \<in> A \<Longrightarrow> Inf A \<le> x
[PROOF STEP]
by (induct A) (auto simp add: finite_lattice_complete_Inf_insert intro: le_infI2)


[STATEMENT]
lemma powr_neg_real_complex:
  "(- of_real x) powr a = (-1) powr (of_real (sgn x) * a) * of_real x powr (a :: complex)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- complex_of_real x) powr a = (- 1) powr (complex_of_real (sgn x) * a) * complex_of_real x powr a
[PROOF STEP]
proof (cases "x = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x = 0 \<Longrightarrow> (- complex_of_real x) powr a = (- 1) powr (complex_of_real (sgn x) * a) * complex_of_real x powr a
 2. x \<noteq> 0 \<Longrightarrow> (- complex_of_real x) powr a = (- 1) powr (complex_of_real (sgn x) * a) * complex_of_real x powr a
[PROOF STEP]
assume x: "x \<noteq> 0"
[PROOF STATE]
proof (state)
this:
x \<noteq> 0

goal (2 subgoals):
 1. x = 0 \<Longrightarrow> (- complex_of_real x) powr a = (- 1) powr (complex_of_real (sgn x) * a) * complex_of_real x powr a
 2. x \<noteq> 0 \<Longrightarrow> (- complex_of_real x) powr a = (- 1) powr (complex_of_real (sgn x) * a) * complex_of_real x powr a
[PROOF STEP]
hence "(-x) powr a = exp (a * ln (-of_real x))"
[PROOF STATE]
proof (prove)
using this:
x \<noteq> 0

goal (1 subgoal):
 1. complex_of_real (- x) powr a = exp (a * Ln (- complex_of_real x))
[PROOF STEP]
by (simp add: powr_def)
[PROOF STATE]
proof (state)
this:
complex_of_real (- x) powr a = exp (a * Ln (- complex_of_real x))

goal (2 subgoals):
 1. x = 0 \<Longrightarrow> (- complex_of_real x) powr a = (- 1) powr (complex_of_real (sgn x) * a) * complex_of_real x powr a
 2. x \<noteq> 0 \<Longrightarrow> (- complex_of_real x) powr a = (- 1) powr (complex_of_real (sgn x) * a) * complex_of_real x powr a
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
complex_of_real (- x) powr a = exp (a * Ln (- complex_of_real x))

goal (2 subgoals):
 1. x = 0 \<Longrightarrow> (- complex_of_real x) powr a = (- 1) powr (complex_of_real (sgn x) * a) * complex_of_real x powr a
 2. x \<noteq> 0 \<Longrightarrow> (- complex_of_real x) powr a = (- 1) powr (complex_of_real (sgn x) * a) * complex_of_real x powr a
[PROOF STEP]
from x
[PROOF STATE]
proof (chain)
picking this:
x \<noteq> 0
[PROOF STEP]
have "ln (-of_real x) = Ln (of_real x) + of_real (sgn x) * pi * \<i>"
[PROOF STATE]
proof (prove)
using this:
x \<noteq> 0

goal (1 subgoal):
 1. Ln (- complex_of_real x) = Ln (complex_of_real x) + complex_of_real (of_real (sgn x) * pi) * \<i>
[PROOF STEP]
by (simp add: Ln_minus Ln_of_real)
[PROOF STATE]
proof (state)
this:
Ln (- complex_of_real x) = Ln (complex_of_real x) + complex_of_real (of_real (sgn x) * pi) * \<i>

goal (2 subgoals):
 1. x = 0 \<Longrightarrow> (- complex_of_real x) powr a = (- 1) powr (complex_of_real (sgn x) * a) * complex_of_real x powr a
 2. x \<noteq> 0 \<Longrightarrow> (- complex_of_real x) powr a = (- 1) powr (complex_of_real (sgn x) * a) * complex_of_real x powr a
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Ln (- complex_of_real x) = Ln (complex_of_real x) + complex_of_real (of_real (sgn x) * pi) * \<i>

goal (2 subgoals):
 1. x = 0 \<Longrightarrow> (- complex_of_real x) powr a = (- 1) powr (complex_of_real (sgn x) * a) * complex_of_real x powr a
 2. x \<noteq> 0 \<Longrightarrow> (- complex_of_real x) powr a = (- 1) powr (complex_of_real (sgn x) * a) * complex_of_real x powr a
[PROOF STEP]
from x
[PROOF STATE]
proof (chain)
picking this:
x \<noteq> 0
[PROOF STEP]
have "exp (a * \<dots>) = cis pi powr (of_real (sgn x) * a) * of_real x powr a"
[PROOF STATE]
proof (prove)
using this:
x \<noteq> 0

goal (1 subgoal):
 1. exp (a * (Ln (complex_of_real x) + complex_of_real (of_real (sgn x) * pi) * \<i>)) = cis pi powr (complex_of_real (sgn x) * a) * complex_of_real x powr a
[PROOF STEP]
by (simp add: powr_def exp_add algebra_simps Ln_of_real cis_conv_exp)
[PROOF STATE]
proof (state)
this:
exp (a * (Ln (complex_of_real x) + complex_of_real (of_real (sgn x) * pi) * \<i>)) = cis pi powr (complex_of_real (sgn x) * a) * complex_of_real x powr a

goal (2 subgoals):
 1. x = 0 \<Longrightarrow> (- complex_of_real x) powr a = (- 1) powr (complex_of_real (sgn x) * a) * complex_of_real x powr a
 2. x \<noteq> 0 \<Longrightarrow> (- complex_of_real x) powr a = (- 1) powr (complex_of_real (sgn x) * a) * complex_of_real x powr a
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
exp (a * (Ln (complex_of_real x) + complex_of_real (of_real (sgn x) * pi) * \<i>)) = cis pi powr (complex_of_real (sgn x) * a) * complex_of_real x powr a

goal (2 subgoals):
 1. x = 0 \<Longrightarrow> (- complex_of_real x) powr a = (- 1) powr (complex_of_real (sgn x) * a) * complex_of_real x powr a
 2. x \<noteq> 0 \<Longrightarrow> (- complex_of_real x) powr a = (- 1) powr (complex_of_real (sgn x) * a) * complex_of_real x powr a
[PROOF STEP]
note cis_pi
[PROOF STATE]
proof (state)
this:
cis pi = - 1

goal (2 subgoals):
 1. x = 0 \<Longrightarrow> (- complex_of_real x) powr a = (- 1) powr (complex_of_real (sgn x) * a) * complex_of_real x powr a
 2. x \<noteq> 0 \<Longrightarrow> (- complex_of_real x) powr a = (- 1) powr (complex_of_real (sgn x) * a) * complex_of_real x powr a
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
complex_of_real (- x) powr a = (- 1) powr (complex_of_real (sgn x) * a) * complex_of_real x powr a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
complex_of_real (- x) powr a = (- 1) powr (complex_of_real (sgn x) * a) * complex_of_real x powr a

goal (1 subgoal):
 1. (- complex_of_real x) powr a = (- 1) powr (complex_of_real (sgn x) * a) * complex_of_real x powr a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(- complex_of_real x) powr a = (- 1) powr (complex_of_real (sgn x) * a) * complex_of_real x powr a

goal (1 subgoal):
 1. x = 0 \<Longrightarrow> (- complex_of_real x) powr a = (- 1) powr (complex_of_real (sgn x) * a) * complex_of_real x powr a
[PROOF STEP]
qed simp_all


[STATEMENT]
lemma permutations_of_list_impl_nonempty:
  "xs \<noteq> [] \<Longrightarrow> permutations_of_list_impl xs =
     List.bind (remdups xs) (\<lambda>x. map ((#) x) (permutations_of_list_impl (remove1 x xs)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs \<noteq> [] \<Longrightarrow> permutations_of_list_impl xs = List.bind (remdups xs) (\<lambda>x. map ((#) x) (permutations_of_list_impl (remove1 x xs)))
[PROOF STEP]
by (subst permutations_of_list_impl.simps) simp_all