[STATEMENT]
lemma totient_gcd: "totient (a * b) * totient (gcd a b) = totient a * totient b * gcd a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. totient (a * b) * totient (gcd a b) = totient a * totient b * gcd a b
[PROOF STEP]
proof (cases "a = 0 \<or> b = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a = 0 \<or> b = 0 \<Longrightarrow> totient (a * b) * totient (gcd a b) = totient a * totient b * gcd a b
 2. \<not> (a = 0 \<or> b = 0) \<Longrightarrow> totient (a * b) * totient (gcd a b) = totient a * totient b * gcd a b
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (a = 0 \<or> b = 0)

goal (2 subgoals):
 1. a = 0 \<or> b = 0 \<Longrightarrow> totient (a * b) * totient (gcd a b) = totient a * totient b * gcd a b
 2. \<not> (a = 0 \<or> b = 0) \<Longrightarrow> totient (a * b) * totient (gcd a b) = totient a * totient b * gcd a b
[PROOF STEP]
let ?P = "prime_factors :: nat \<Rightarrow> nat set"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a = 0 \<or> b = 0 \<Longrightarrow> totient (a * b) * totient (gcd a b) = totient a * totient b * gcd a b
 2. \<not> (a = 0 \<or> b = 0) \<Longrightarrow> totient (a * b) * totient (gcd a b) = totient a * totient b * gcd a b
[PROOF STEP]
have "real (totient a * totient b * gcd a b) = real (a * b * gcd a b) *
          ((\<Prod>p\<in>?P a. 1 - 1 / real p) * (\<Prod>p\<in>?P b. 1 - 1 / real p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (totient a * totient b * gcd a b) = real (a * b * gcd a b) * ((\<Prod>p\<in>prime_factors a. 1 - 1 / real p) * (\<Prod>p\<in>prime_factors b. 1 - 1 / real p))
[PROOF STEP]
by (simp add: totient_formula2)
[PROOF STATE]
proof (state)
this:
real (totient a * totient b * gcd a b) = real (a * b * gcd a b) * ((\<Prod>p\<in>prime_factors a. 1 - 1 / real p) * (\<Prod>p\<in>prime_factors b. 1 - 1 / real p))

goal (2 subgoals):
 1. a = 0 \<or> b = 0 \<Longrightarrow> totient (a * b) * totient (gcd a b) = totient a * totient b * gcd a b
 2. \<not> (a = 0 \<or> b = 0) \<Longrightarrow> totient (a * b) * totient (gcd a b) = totient a * totient b * gcd a b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real (totient a * totient b * gcd a b) = real (a * b * gcd a b) * ((\<Prod>p\<in>prime_factors a. 1 - 1 / real p) * (\<Prod>p\<in>prime_factors b. 1 - 1 / real p))

goal (2 subgoals):
 1. a = 0 \<or> b = 0 \<Longrightarrow> totient (a * b) * totient (gcd a b) = totient a * totient b * gcd a b
 2. \<not> (a = 0 \<or> b = 0) \<Longrightarrow> totient (a * b) * totient (gcd a b) = totient a * totient b * gcd a b
[PROOF STEP]
have "?P a = (?P a - ?P b) \<union> (?P a \<inter> ?P b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime_factors a = prime_factors a - prime_factors b \<union> prime_factors a \<inter> prime_factors b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
prime_factors a = prime_factors a - prime_factors b \<union> prime_factors a \<inter> prime_factors b

goal (2 subgoals):
 1. a = 0 \<or> b = 0 \<Longrightarrow> totient (a * b) * totient (gcd a b) = totient a * totient b * gcd a b
 2. \<not> (a = 0 \<or> b = 0) \<Longrightarrow> totient (a * b) * totient (gcd a b) = totient a * totient b * gcd a b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
prime_factors a = prime_factors a - prime_factors b \<union> prime_factors a \<inter> prime_factors b

goal (2 subgoals):
 1. a = 0 \<or> b = 0 \<Longrightarrow> totient (a * b) * totient (gcd a b) = totient a * totient b * gcd a b
 2. \<not> (a = 0 \<or> b = 0) \<Longrightarrow> totient (a * b) * totient (gcd a b) = totient a * totient b * gcd a b
[PROOF STEP]
have "(\<Prod>p\<in>\<dots>. 1 - 1 / real p) =
                 (\<Prod>p\<in>?P a - ?P b. 1 - 1 / real p) * (\<Prod>p\<in>?P a \<inter> ?P b. 1 - 1 / real p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>p\<in>prime_factors a - prime_factors b \<union> prime_factors a \<inter> prime_factors b. 1 - 1 / real p) = (\<Prod>p\<in>prime_factors a - prime_factors b. 1 - 1 / real p) * (\<Prod>p\<in>prime_factors a \<inter> prime_factors b. 1 - 1 / real p)
[PROOF STEP]
by (rule prod.union_disjoint) blast+
[PROOF STATE]
proof (state)
this:
(\<Prod>p\<in>prime_factors a - prime_factors b \<union> prime_factors a \<inter> prime_factors b. 1 - 1 / real p) = (\<Prod>p\<in>prime_factors a - prime_factors b. 1 - 1 / real p) * (\<Prod>p\<in>prime_factors a \<inter> prime_factors b. 1 - 1 / real p)

goal (2 subgoals):
 1. a = 0 \<or> b = 0 \<Longrightarrow> totient (a * b) * totient (gcd a b) = totient a * totient b * gcd a b
 2. \<not> (a = 0 \<or> b = 0) \<Longrightarrow> totient (a * b) * totient (gcd a b) = totient a * totient b * gcd a b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Prod>p\<in>prime_factors a - prime_factors b \<union> prime_factors a \<inter> prime_factors b. 1 - 1 / real p) = (\<Prod>p\<in>prime_factors a - prime_factors b. 1 - 1 / real p) * (\<Prod>p\<in>prime_factors a \<inter> prime_factors b. 1 - 1 / real p)

goal (2 subgoals):
 1. a = 0 \<or> b = 0 \<Longrightarrow> totient (a * b) * totient (gcd a b) = totient a * totient b * gcd a b
 2. \<not> (a = 0 \<or> b = 0) \<Longrightarrow> totient (a * b) * totient (gcd a b) = totient a * totient b * gcd a b
[PROOF STEP]
have "\<dots> * (\<Prod>p\<in>?P b. 1 - 1 / real p) = (\<Prod>p\<in>?P a - ?P b. 1 - 1 / real p) *
               (\<Prod>p\<in>?P b. 1 - 1 / real p) * (\<Prod>p\<in>?P a \<inter> ?P b. 1 - 1 / real p)" (is "_ = ?A * _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>p\<in>prime_factors a - prime_factors b. 1 - 1 / real p) * (\<Prod>p\<in>prime_factors a \<inter> prime_factors b. 1 - 1 / real p) * (\<Prod>p\<in>prime_factors b. 1 - 1 / real p) = (\<Prod>p\<in>prime_factors a - prime_factors b. 1 - 1 / real p) * (\<Prod>p\<in>prime_factors b. 1 - 1 / real p) * (\<Prod>p\<in>prime_factors a \<inter> prime_factors b. 1 - 1 / real p)
[PROOF STEP]
by (simp only: mult_ac)
[PROOF STATE]
proof (state)
this:
(\<Prod>p\<in>prime_factors a - prime_factors b. 1 - 1 / real p) * (\<Prod>p\<in>prime_factors a \<inter> prime_factors b. 1 - 1 / real p) * (\<Prod>p\<in>prime_factors b. 1 - 1 / real p) = (\<Prod>p\<in>prime_factors a - prime_factors b. 1 - 1 / real p) * (\<Prod>p\<in>prime_factors b. 1 - 1 / real p) * (\<Prod>p\<in>prime_factors a \<inter> prime_factors b. 1 - 1 / real p)

goal (2 subgoals):
 1. a = 0 \<or> b = 0 \<Longrightarrow> totient (a * b) * totient (gcd a b) = totient a * totient b * gcd a b
 2. \<not> (a = 0 \<or> b = 0) \<Longrightarrow> totient (a * b) * totient (gcd a b) = totient a * totient b * gcd a b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Prod>p\<in>prime_factors a - prime_factors b. 1 - 1 / real p) * (\<Prod>p\<in>prime_factors a \<inter> prime_factors b. 1 - 1 / real p) * (\<Prod>p\<in>prime_factors b. 1 - 1 / real p) = (\<Prod>p\<in>prime_factors a - prime_factors b. 1 - 1 / real p) * (\<Prod>p\<in>prime_factors b. 1 - 1 / real p) * (\<Prod>p\<in>prime_factors a \<inter> prime_factors b. 1 - 1 / real p)

goal (2 subgoals):
 1. a = 0 \<or> b = 0 \<Longrightarrow> totient (a * b) * totient (gcd a b) = totient a * totient b * gcd a b
 2. \<not> (a = 0 \<or> b = 0) \<Longrightarrow> totient (a * b) * totient (gcd a b) = totient a * totient b * gcd a b
[PROOF STEP]
have "?A = (\<Prod>p\<in>?P a - ?P b \<union> ?P b. 1 - 1 / real p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>p\<in>prime_factors a - prime_factors b. 1 - 1 / real p) * (\<Prod>p\<in>prime_factors b. 1 - 1 / real p) = (\<Prod>p\<in>prime_factors a - prime_factors b \<union> prime_factors b. 1 - 1 / real p)
[PROOF STEP]
by (rule prod.union_disjoint [symmetric]) blast+
[PROOF STATE]
proof (state)
this:
(\<Prod>p\<in>prime_factors a - prime_factors b. 1 - 1 / real p) * (\<Prod>p\<in>prime_factors b. 1 - 1 / real p) = (\<Prod>p\<in>prime_factors a - prime_factors b \<union> prime_factors b. 1 - 1 / real p)

goal (2 subgoals):
 1. a = 0 \<or> b = 0 \<Longrightarrow> totient (a * b) * totient (gcd a b) = totient a * totient b * gcd a b
 2. \<not> (a = 0 \<or> b = 0) \<Longrightarrow> totient (a * b) * totient (gcd a b) = totient a * totient b * gcd a b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Prod>p\<in>prime_factors a - prime_factors b. 1 - 1 / real p) * (\<Prod>p\<in>prime_factors b. 1 - 1 / real p) = (\<Prod>p\<in>prime_factors a - prime_factors b \<union> prime_factors b. 1 - 1 / real p)

goal (2 subgoals):
 1. a = 0 \<or> b = 0 \<Longrightarrow> totient (a * b) * totient (gcd a b) = totient a * totient b * gcd a b
 2. \<not> (a = 0 \<or> b = 0) \<Longrightarrow> totient (a * b) * totient (gcd a b) = totient a * totient b * gcd a b
[PROOF STEP]
have "?P a - ?P b \<union> ?P b = ?P a \<union> ?P b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime_factors a - prime_factors b \<union> prime_factors b = prime_factors a \<union> prime_factors b
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
prime_factors a - prime_factors b \<union> prime_factors b = prime_factors a \<union> prime_factors b

goal (2 subgoals):
 1. a = 0 \<or> b = 0 \<Longrightarrow> totient (a * b) * totient (gcd a b) = totient a * totient b * gcd a b
 2. \<not> (a = 0 \<or> b = 0) \<Longrightarrow> totient (a * b) * totient (gcd a b) = totient a * totient b * gcd a b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
prime_factors a - prime_factors b \<union> prime_factors b = prime_factors a \<union> prime_factors b

goal (2 subgoals):
 1. a = 0 \<or> b = 0 \<Longrightarrow> totient (a * b) * totient (gcd a b) = totient a * totient b * gcd a b
 2. \<not> (a = 0 \<or> b = 0) \<Longrightarrow> totient (a * b) * totient (gcd a b) = totient a * totient b * gcd a b
[PROOF STEP]
have "real (a * b * gcd a b) * ((\<Prod>p\<in>\<dots>. 1 - 1 / real p) *
                 (\<Prod>p\<in>?P a \<inter> ?P b. 1 - 1 / real p)) = real (totient (a * b) * totient (gcd a b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (a * b * gcd a b) * ((\<Prod>p\<in>prime_factors a \<union> prime_factors b. 1 - 1 / real p) * (\<Prod>p\<in>prime_factors a \<inter> prime_factors b. 1 - 1 / real p)) = real (totient (a * b) * totient (gcd a b))
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
\<not> (a = 0 \<or> b = 0)

goal (1 subgoal):
 1. real (a * b * gcd a b) * ((\<Prod>p\<in>prime_factors a \<union> prime_factors b. 1 - 1 / real p) * (\<Prod>p\<in>prime_factors a \<inter> prime_factors b. 1 - 1 / real p)) = real (totient (a * b) * totient (gcd a b))
[PROOF STEP]
by (simp add: totient_formula2 prime_factors_product prime_factorization_gcd)
[PROOF STATE]
proof (state)
this:
real (a * b * gcd a b) * ((\<Prod>p\<in>prime_factors a \<union> prime_factors b. 1 - 1 / real p) * (\<Prod>p\<in>prime_factors a \<inter> prime_factors b. 1 - 1 / real p)) = real (totient (a * b) * totient (gcd a b))

goal (2 subgoals):
 1. a = 0 \<or> b = 0 \<Longrightarrow> totient (a * b) * totient (gcd a b) = totient a * totient b * gcd a b
 2. \<not> (a = 0 \<or> b = 0) \<Longrightarrow> totient (a * b) * totient (gcd a b) = totient a * totient b * gcd a b
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
real (totient a * totient b * gcd a b) = real (totient (a * b) * totient (gcd a b))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
real (totient a * totient b * gcd a b) = real (totient (a * b) * totient (gcd a b))

goal (1 subgoal):
 1. totient (a * b) * totient (gcd a b) = totient a * totient b * gcd a b
[PROOF STEP]
by (simp only: of_nat_eq_iff)
[PROOF STATE]
proof (state)
this:
totient (a * b) * totient (gcd a b) = totient a * totient b * gcd a b

goal (1 subgoal):
 1. a = 0 \<or> b = 0 \<Longrightarrow> totient (a * b) * totient (gcd a b) = totient a * totient b * gcd a b
[PROOF STEP]
qed auto


[STATEMENT]
lemma pi_approx_32: "\<bar>pi - 13493037705/4294967296 :: real\<bar> \<le> inverse(2 ^ 32)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>pi - 13493037705 / 4294967296\<bar> \<le> inverse (2 ^ 32)
[PROOF STEP]
by (rule approx_coarsen[OF pi_approx_75]) simp


[STATEMENT]
theorem (in pair_sigma_finite) Fubini':
  assumes f: "case_prod f \<in> borel_measurable (M1 \<Otimes>\<^sub>M M2)"
  shows "(\<integral>\<^sup>+ y. (\<integral>\<^sup>+ x. f x y \<partial>M1) \<partial>M2) = (\<integral>\<^sup>+ x. (\<integral>\<^sup>+ y. f x y \<partial>M2) \<partial>M1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ y. \<integral>\<^sup>+ x. f x y \<partial>M1 \<partial>M2 = \<integral>\<^sup>+ x. integral\<^sup>N M2 (f x) \<partial>M1
[PROOF STEP]
using Fubini[OF f]
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ y. \<integral>\<^sup>+ x. (case (x, y) of (x, xa) \<Rightarrow> f x xa) \<partial>M1 \<partial>M2 = \<integral>\<^sup>+ x. \<integral>\<^sup>+ y. (case (x, y) of (x, xa) \<Rightarrow> f x xa) \<partial>M2 \<partial>M1

goal (1 subgoal):
 1. \<integral>\<^sup>+ y. \<integral>\<^sup>+ x. f x y \<partial>M1 \<partial>M2 = \<integral>\<^sup>+ x. integral\<^sup>N M2 (f x) \<partial>M1
[PROOF STEP]
by simp


[STATEMENT]
lemma less_mult_one: assumes "(m-1)*k < k" obtains "m = 0" | "m = (1::nat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>m = 0 \<Longrightarrow> thesis; m = 1 \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(m - 1) * k < k

goal (1 subgoal):
 1. \<lbrakk>m = 0 \<Longrightarrow> thesis; m = 1 \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
by fastforce


[STATEMENT]
lemma higher_pderiv_sum: "(pderiv ^^ n) (sum f A) = (\<Sum>x\<in>A. (pderiv ^^ n) (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (pderiv ^^ n) (sum f A) = (\<Sum>x\<in>A. (pderiv ^^ n) (f x))
[PROOF STEP]
by (induction A rule: infinite_finite_induct) (simp_all add: higher_pderiv_add)


[STATEMENT]
lemma dirichlet_prod_assoc_aux1:
  assumes "n > 0"
  shows "dirichlet_prod f (dirichlet_prod g h) n =
           (\<Sum>(a, b, c)\<in>{(a, b, c). a * b * c = n}. f a * g b * h c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dirichlet_prod f (dirichlet_prod g h) n = (\<Sum>(a, b, c)\<in>{(a, b, c). a * b * c = n}. f a * g b * h c)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dirichlet_prod f (dirichlet_prod g h) n = (\<Sum>(a, b, c)\<in>{(a, b, c). a * b * c = n}. f a * g b * h c)
[PROOF STEP]
have "dirichlet_prod f (dirichlet_prod g h) n =
          (\<Sum>x\<in>{(a,b). a * b = n}. (\<Sum>(c,d) | c * d = snd x. f (fst x) * g c * h d))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dirichlet_prod f (dirichlet_prod g h) n = (\<Sum>x\<in>{(a, b). a * b = n}. \<Sum>(c, d)\<in>{(c, d). c * d = snd x}. f (fst x) * g c * h d)
[PROOF STEP]
by (auto intro!: sum.cong simp: dirichlet_prod_altdef2 sum_distrib_left mult.assoc)
[PROOF STATE]
proof (state)
this:
dirichlet_prod f (dirichlet_prod g h) n = (\<Sum>x\<in>{(a, b). a * b = n}. \<Sum>(c, d)\<in>{(c, d). c * d = snd x}. f (fst x) * g c * h d)

goal (1 subgoal):
 1. dirichlet_prod f (dirichlet_prod g h) n = (\<Sum>(a, b, c)\<in>{(a, b, c). a * b * c = n}. f a * g b * h c)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dirichlet_prod f (dirichlet_prod g h) n = (\<Sum>x\<in>{(a, b). a * b = n}. \<Sum>(c, d)\<in>{(c, d). c * d = snd x}. f (fst x) * g c * h d)

goal (1 subgoal):
 1. dirichlet_prod f (dirichlet_prod g h) n = (\<Sum>(a, b, c)\<in>{(a, b, c). a * b * c = n}. f a * g b * h c)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
0 < n
[PROOF STEP]
have "\<dots> = (\<Sum>x\<in>(SIGMA x:{(a, b). a * b = n}. {(c, d). c * d = snd x}).
                               case x of (x, c, d) \<Rightarrow> f (fst x) * g c * h d)"
[PROOF STATE]
proof (prove)
using this:
0 < n

goal (1 subgoal):
 1. (\<Sum>x\<in>{(a, b). a * b = n}. \<Sum>(c, d)\<in>{(c, d). c * d = snd x}. f (fst x) * g c * h d) = (\<Sum>x\<in>(SIGMA x:{(a, b). a * b = n}. {(c, d). c * d = snd x}). case x of (x, c, d) \<Rightarrow> f (fst x) * g c * h d)
[PROOF STEP]
by (intro sum.Sigma finite_divisors_nat' ballI) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>{(a, b). a * b = n}. \<Sum>(c, d)\<in>{(c, d). c * d = snd x}. f (fst x) * g c * h d) = (\<Sum>x\<in>(SIGMA x:{(a, b). a * b = n}. {(c, d). c * d = snd x}). case x of (x, c, d) \<Rightarrow> f (fst x) * g c * h d)

goal (1 subgoal):
 1. dirichlet_prod f (dirichlet_prod g h) n = (\<Sum>(a, b, c)\<in>{(a, b, c). a * b * c = n}. f a * g b * h c)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>{(a, b). a * b = n}. \<Sum>(c, d)\<in>{(c, d). c * d = snd x}. f (fst x) * g c * h d) = (\<Sum>x\<in>(SIGMA x:{(a, b). a * b = n}. {(c, d). c * d = snd x}). case x of (x, c, d) \<Rightarrow> f (fst x) * g c * h d)

goal (1 subgoal):
 1. dirichlet_prod f (dirichlet_prod g h) n = (\<Sum>(a, b, c)\<in>{(a, b, c). a * b * c = n}. f a * g b * h c)
[PROOF STEP]
have "\<dots> = (\<Sum>(a,b,c) | a * b * c = n. f a * g b * h c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>(SIGMA x:{(a, b). a * b = n}. {(c, d). c * d = snd x}). case x of (x, c, d) \<Rightarrow> f (fst x) * g c * h d) = (\<Sum>(a, b, c)\<in>{(a, b, c). a * b * c = n}. f a * g b * h c)
[PROOF STEP]
by (rule sum.reindex_bij_witness
               [of _ "\<lambda>(a,b,c). ((a, b*c), (b,c))" "\<lambda>((a,b),(c,d)). (a, c, d)"])
       (auto simp: mult_ac)
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>(SIGMA x:{(a, b). a * b = n}. {(c, d). c * d = snd x}). case x of (x, c, d) \<Rightarrow> f (fst x) * g c * h d) = (\<Sum>(a, b, c)\<in>{(a, b, c). a * b * c = n}. f a * g b * h c)

goal (1 subgoal):
 1. dirichlet_prod f (dirichlet_prod g h) n = (\<Sum>(a, b, c)\<in>{(a, b, c). a * b * c = n}. f a * g b * h c)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
dirichlet_prod f (dirichlet_prod g h) n = (\<Sum>(a, b, c)\<in>{(a, b, c). a * b * c = n}. f a * g b * h c)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
dirichlet_prod f (dirichlet_prod g h) n = (\<Sum>(a, b, c)\<in>{(a, b, c). a * b * c = n}. f a * g b * h c)

goal (1 subgoal):
 1. dirichlet_prod f (dirichlet_prod g h) n = (\<Sum>(a, b, c)\<in>{(a, b, c). a * b * c = n}. f a * g b * h c)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
dirichlet_prod f (dirichlet_prod g h) n = (\<Sum>(a, b, c)\<in>{(a, b, c). a * b * c = n}. f a * g b * h c)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pcompose_add: "pcompose (p + q) r = pcompose p r + pcompose q r"
  for p q r :: "'a::{comm_semiring_0, ab_semigroup_add} poly"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (p + q) \<circ>\<^sub>p r = p \<circ>\<^sub>p r + q \<circ>\<^sub>p r
[PROOF STEP]
proof (induction p q rule: poly_induct2)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (0 + 0) \<circ>\<^sub>p r = 0 \<circ>\<^sub>p r + 0 \<circ>\<^sub>p r
 2. \<And>a p b q. (p + q) \<circ>\<^sub>p r = p \<circ>\<^sub>p r + q \<circ>\<^sub>p r \<Longrightarrow> (pCons a p + pCons b q) \<circ>\<^sub>p r = pCons a p \<circ>\<^sub>p r + pCons b q \<circ>\<^sub>p r
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. (0 + 0) \<circ>\<^sub>p r = 0 \<circ>\<^sub>p r + 0 \<circ>\<^sub>p r
 2. \<And>a p b q. (p + q) \<circ>\<^sub>p r = p \<circ>\<^sub>p r + q \<circ>\<^sub>p r \<Longrightarrow> (pCons a p + pCons b q) \<circ>\<^sub>p r = pCons a p \<circ>\<^sub>p r + pCons b q \<circ>\<^sub>p r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 + 0) \<circ>\<^sub>p r = 0 \<circ>\<^sub>p r + 0 \<circ>\<^sub>p r
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(0 + 0) \<circ>\<^sub>p r = 0 \<circ>\<^sub>p r + 0 \<circ>\<^sub>p r

goal (1 subgoal):
 1. \<And>a p b q. (p + q) \<circ>\<^sub>p r = p \<circ>\<^sub>p r + q \<circ>\<^sub>p r \<Longrightarrow> (pCons a p + pCons b q) \<circ>\<^sub>p r = pCons a p \<circ>\<^sub>p r + pCons b q \<circ>\<^sub>p r
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a p b q. (p + q) \<circ>\<^sub>p r = p \<circ>\<^sub>p r + q \<circ>\<^sub>p r \<Longrightarrow> (pCons a p + pCons b q) \<circ>\<^sub>p r = pCons a p \<circ>\<^sub>p r + pCons b q \<circ>\<^sub>p r
[PROOF STEP]
case (pCons a p b q)
[PROOF STATE]
proof (state)
this:
(p + q) \<circ>\<^sub>p r = p \<circ>\<^sub>p r + q \<circ>\<^sub>p r

goal (1 subgoal):
 1. \<And>a p b q. (p + q) \<circ>\<^sub>p r = p \<circ>\<^sub>p r + q \<circ>\<^sub>p r \<Longrightarrow> (pCons a p + pCons b q) \<circ>\<^sub>p r = pCons a p \<circ>\<^sub>p r + pCons b q \<circ>\<^sub>p r
[PROOF STEP]
have "pcompose (pCons a p + pCons b q) r = [:a + b:] + r * pcompose p r + r * pcompose q r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (pCons a p + pCons b q) \<circ>\<^sub>p r = [:a + b:] + r * p \<circ>\<^sub>p r + r * q \<circ>\<^sub>p r
[PROOF STEP]
by (simp_all add: pcompose_pCons pCons.IH algebra_simps)
[PROOF STATE]
proof (state)
this:
(pCons a p + pCons b q) \<circ>\<^sub>p r = [:a + b:] + r * p \<circ>\<^sub>p r + r * q \<circ>\<^sub>p r

goal (1 subgoal):
 1. \<And>a p b q. (p + q) \<circ>\<^sub>p r = p \<circ>\<^sub>p r + q \<circ>\<^sub>p r \<Longrightarrow> (pCons a p + pCons b q) \<circ>\<^sub>p r = pCons a p \<circ>\<^sub>p r + pCons b q \<circ>\<^sub>p r
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(pCons a p + pCons b q) \<circ>\<^sub>p r = [:a + b:] + r * p \<circ>\<^sub>p r + r * q \<circ>\<^sub>p r

goal (1 subgoal):
 1. \<And>a p b q. (p + q) \<circ>\<^sub>p r = p \<circ>\<^sub>p r + q \<circ>\<^sub>p r \<Longrightarrow> (pCons a p + pCons b q) \<circ>\<^sub>p r = pCons a p \<circ>\<^sub>p r + pCons b q \<circ>\<^sub>p r
[PROOF STEP]
have "[:a + b:] = [:a:] + [:b:]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [:a + b:] = [:a:] + [:b:]
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
[:a + b:] = [:a:] + [:b:]

goal (1 subgoal):
 1. \<And>a p b q. (p + q) \<circ>\<^sub>p r = p \<circ>\<^sub>p r + q \<circ>\<^sub>p r \<Longrightarrow> (pCons a p + pCons b q) \<circ>\<^sub>p r = pCons a p \<circ>\<^sub>p r + pCons b q \<circ>\<^sub>p r
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
[:a + b:] = [:a:] + [:b:]

goal (1 subgoal):
 1. \<And>a p b q. (p + q) \<circ>\<^sub>p r = p \<circ>\<^sub>p r + q \<circ>\<^sub>p r \<Longrightarrow> (pCons a p + pCons b q) \<circ>\<^sub>p r = pCons a p \<circ>\<^sub>p r + pCons b q \<circ>\<^sub>p r
[PROOF STEP]
have "\<dots> + r * pcompose p r + r * pcompose q r = pcompose (pCons a p) r + pcompose (pCons b q) r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [:a:] + [:b:] + r * p \<circ>\<^sub>p r + r * q \<circ>\<^sub>p r = pCons a p \<circ>\<^sub>p r + pCons b q \<circ>\<^sub>p r
[PROOF STEP]
by (simp only: pcompose_pCons add_ac)
[PROOF STATE]
proof (state)
this:
[:a:] + [:b:] + r * p \<circ>\<^sub>p r + r * q \<circ>\<^sub>p r = pCons a p \<circ>\<^sub>p r + pCons b q \<circ>\<^sub>p r

goal (1 subgoal):
 1. \<And>a p b q. (p + q) \<circ>\<^sub>p r = p \<circ>\<^sub>p r + q \<circ>\<^sub>p r \<Longrightarrow> (pCons a p + pCons b q) \<circ>\<^sub>p r = pCons a p \<circ>\<^sub>p r + pCons b q \<circ>\<^sub>p r
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(pCons a p + pCons b q) \<circ>\<^sub>p r = pCons a p \<circ>\<^sub>p r + pCons b q \<circ>\<^sub>p r
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(pCons a p + pCons b q) \<circ>\<^sub>p r = pCons a p \<circ>\<^sub>p r + pCons b q \<circ>\<^sub>p r

goal (1 subgoal):
 1. (pCons a p + pCons b q) \<circ>\<^sub>p r = pCons a p \<circ>\<^sub>p r + pCons b q \<circ>\<^sub>p r
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(pCons a p + pCons b q) \<circ>\<^sub>p r = pCons a p \<circ>\<^sub>p r + pCons b q \<circ>\<^sub>p r

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem goedel_first_classic_ex:
assumes "consistent"
shows "\<exists> \<phi>. \<phi> \<in> fmla \<and> \<not> prv \<phi> \<and> \<not> prv (neg \<phi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>\<phi>. \<phi> \<in> fmla \<and> \<not> prv \<phi> \<and> \<not> prv (neg \<phi>)
[PROOF STEP]
using assms goedel_first_classic
[PROOF STATE]
proof (prove)
using this:
consistent
consistent \<Longrightarrow> \<not> prv \<phi>G \<and> \<not> prv (neg \<phi>G)

goal (1 subgoal):
 1. \<exists>\<phi>. \<phi> \<in> fmla \<and> \<not> prv \<phi> \<and> \<not> prv (neg \<phi>)
[PROOF STEP]
by (intro exI[of _ \<phi>G]) blast


[STATEMENT]
lemma prod_mset_constant [simp]: "(\<Prod>_\<in>#A. c) = c ^ size A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>_\<in>#A. c) = c ^ size A
[PROOF STEP]
by (simp add: image_mset_const_eq)


[STATEMENT]
lemma DERIV_image_chain:
  "(f has_field_derivative Da) (at (g x) within (g ` s)) \<Longrightarrow>
    (g has_field_derivative Db) (at x within s) \<Longrightarrow>
    (f \<circ> g has_field_derivative Da * Db) (at x within s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(f has_field_derivative Da) (at (g x) within g ` s); (g has_field_derivative Db) (at x within s)\<rbrakk> \<Longrightarrow> (f \<circ> g has_field_derivative Da * Db) (at x within s)
[PROOF STEP]
using has_derivative_in_compose [of g "(*) Db" x s f "(*) Da "]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(g has_derivative (*) Db) (at x within s); (f has_derivative (*) Da) (at (g x) within g ` s)\<rbrakk> \<Longrightarrow> ((\<lambda>x. f (g x)) has_derivative (\<lambda>x. Da * (Db * x))) (at x within s)

goal (1 subgoal):
 1. \<lbrakk>(f has_field_derivative Da) (at (g x) within g ` s); (g has_field_derivative Db) (at x within s)\<rbrakk> \<Longrightarrow> (f \<circ> g has_field_derivative Da * Db) (at x within s)
[PROOF STEP]
by (simp add: has_field_derivative_def o_def mult_commute_abs ac_simps)


[STATEMENT]
lemma [termination_simp]:assumes "n > 1" and " odd n" shows" Suc (n div 2) < n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc (n div 2) < n
[PROOF STEP]
by (metis Suc_lessI add_diff_cancel_left' assms(1) assms(2) div_eq_dividend_iff div_less_dividend even_Suc even_Suc_div_two odd_pos one_less_numeral_iff plus_1_eq_Suc semiring_norm(76) zero_less_diff)


[STATEMENT]
lemma pochhammer_binomial_sum:
  fixes a b :: "'a::comm_ring_1"
  shows "pochhammer (a + b) n = (\<Sum>k\<le>n. of_nat (n choose k) * pochhammer a k * pochhammer b (n - k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pochhammer (a + b) n = (\<Sum>k\<le>n. of_nat (n choose k) * pochhammer a k * pochhammer b (n - k))
[PROOF STEP]
proof (induction n arbitrary: a b)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a b. pochhammer (a + b) 0 = (\<Sum>k\<le>0. of_nat (0 choose k) * pochhammer a k * pochhammer b (0 - k))
 2. \<And>n a b. (\<And>a b. pochhammer (a + b) n = (\<Sum>k\<le>n. of_nat (n choose k) * pochhammer a k * pochhammer b (n - k))) \<Longrightarrow> pochhammer (a + b) (Suc n) = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k))
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>a b. pochhammer (a + b) 0 = (\<Sum>k\<le>0. of_nat (0 choose k) * pochhammer a k * pochhammer b (0 - k))
 2. \<And>n a b. (\<And>a b. pochhammer (a + b) n = (\<Sum>k\<le>n. of_nat (n choose k) * pochhammer a k * pochhammer b (n - k))) \<Longrightarrow> pochhammer (a + b) (Suc n) = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pochhammer (a + b) 0 = (\<Sum>k\<le>0. of_nat (0 choose k) * pochhammer a k * pochhammer b (0 - k))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
pochhammer (a + b) 0 = (\<Sum>k\<le>0. of_nat (0 choose k) * pochhammer a k * pochhammer b (0 - k))

goal (1 subgoal):
 1. \<And>n a b. (\<And>a b. pochhammer (a + b) n = (\<Sum>k\<le>n. of_nat (n choose k) * pochhammer a k * pochhammer b (n - k))) \<Longrightarrow> pochhammer (a + b) (Suc n) = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n a b. (\<And>a b. pochhammer (a + b) n = (\<Sum>k\<le>n. of_nat (n choose k) * pochhammer a k * pochhammer b (n - k))) \<Longrightarrow> pochhammer (a + b) (Suc n) = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k))
[PROOF STEP]
case (Suc n a b)
[PROOF STATE]
proof (state)
this:
pochhammer (?a + ?b) n = (\<Sum>k\<le>n. of_nat (n choose k) * pochhammer ?a k * pochhammer ?b (n - k))

goal (1 subgoal):
 1. \<And>n a b. (\<And>a b. pochhammer (a + b) n = (\<Sum>k\<le>n. of_nat (n choose k) * pochhammer a k * pochhammer b (n - k))) \<Longrightarrow> pochhammer (a + b) (Suc n) = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k))
[PROOF STEP]
have "(\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k)) =
      (\<Sum>i\<le>n. of_nat (n choose i) * pochhammer a (Suc i) * pochhammer b (n - i)) +
      ((\<Sum>i\<le>n. of_nat (n choose Suc i) * pochhammer a (Suc i) * pochhammer b (n - i)) +
      pochhammer b (Suc n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k)) = (\<Sum>i\<le>n. of_nat (n choose i) * pochhammer a (Suc i) * pochhammer b (n - i)) + ((\<Sum>i\<le>n. of_nat (n choose Suc i) * pochhammer a (Suc i) * pochhammer b (n - i)) + pochhammer b (Suc n))
[PROOF STEP]
by (subst sum.atMost_Suc_shift) (simp add: ring_distribs sum.distrib)
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k)) = (\<Sum>i\<le>n. of_nat (n choose i) * pochhammer a (Suc i) * pochhammer b (n - i)) + ((\<Sum>i\<le>n. of_nat (n choose Suc i) * pochhammer a (Suc i) * pochhammer b (n - i)) + pochhammer b (Suc n))

goal (1 subgoal):
 1. \<And>n a b. (\<And>a b. pochhammer (a + b) n = (\<Sum>k\<le>n. of_nat (n choose k) * pochhammer a k * pochhammer b (n - k))) \<Longrightarrow> pochhammer (a + b) (Suc n) = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k)) = (\<Sum>i\<le>n. of_nat (n choose i) * pochhammer a (Suc i) * pochhammer b (n - i)) + ((\<Sum>i\<le>n. of_nat (n choose Suc i) * pochhammer a (Suc i) * pochhammer b (n - i)) + pochhammer b (Suc n))

goal (1 subgoal):
 1. \<And>n a b. (\<And>a b. pochhammer (a + b) n = (\<Sum>k\<le>n. of_nat (n choose k) * pochhammer a k * pochhammer b (n - k))) \<Longrightarrow> pochhammer (a + b) (Suc n) = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k))
[PROOF STEP]
have "(\<Sum>i\<le>n. of_nat (n choose i) * pochhammer a (Suc i) * pochhammer b (n - i)) =
      a * pochhammer ((a + 1) + b) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>n. of_nat (n choose i) * pochhammer a (Suc i) * pochhammer b (n - i)) = a * pochhammer (a + (1::'a) + b) n
[PROOF STEP]
by (subst Suc) (simp add: sum_distrib_left pochhammer_rec mult_ac)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n. of_nat (n choose i) * pochhammer a (Suc i) * pochhammer b (n - i)) = a * pochhammer (a + (1::'a) + b) n

goal (1 subgoal):
 1. \<And>n a b. (\<And>a b. pochhammer (a + b) n = (\<Sum>k\<le>n. of_nat (n choose k) * pochhammer a k * pochhammer b (n - k))) \<Longrightarrow> pochhammer (a + b) (Suc n) = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n. of_nat (n choose i) * pochhammer a (Suc i) * pochhammer b (n - i)) = a * pochhammer (a + (1::'a) + b) n

goal (1 subgoal):
 1. \<And>n a b. (\<And>a b. pochhammer (a + b) n = (\<Sum>k\<le>n. of_nat (n choose k) * pochhammer a k * pochhammer b (n - k))) \<Longrightarrow> pochhammer (a + b) (Suc n) = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k))
[PROOF STEP]
have "(\<Sum>i\<le>n. of_nat (n choose Suc i) * pochhammer a (Suc i) * pochhammer b (n - i)) +
        pochhammer b (Suc n) =
      (\<Sum>i=0..Suc n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc n - i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>n. of_nat (n choose Suc i) * pochhammer a (Suc i) * pochhammer b (n - i)) + pochhammer b (Suc n) = (\<Sum>i = 0..Suc n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc n - i))
[PROOF STEP]
apply (subst sum.atLeast_Suc_atMost, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>n. of_nat (n choose Suc i) * pochhammer a (Suc i) * pochhammer b (n - i)) + pochhammer b (Suc n) = of_nat (n choose 0) * pochhammer a 0 * pochhammer b (Suc n - 0) + (\<Sum>i = Suc 0..Suc n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc n - i))
[PROOF STEP]
apply (simp add: sum.shift_bounds_cl_Suc_ivl atLeast0AtMost del: sum.cl_ivl_Suc)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n. of_nat (n choose Suc i) * pochhammer a (Suc i) * pochhammer b (n - i)) + pochhammer b (Suc n) = (\<Sum>i = 0..Suc n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc n - i))

goal (1 subgoal):
 1. \<And>n a b. (\<And>a b. pochhammer (a + b) n = (\<Sum>k\<le>n. of_nat (n choose k) * pochhammer a k * pochhammer b (n - k))) \<Longrightarrow> pochhammer (a + b) (Suc n) = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n. of_nat (n choose Suc i) * pochhammer a (Suc i) * pochhammer b (n - i)) + pochhammer b (Suc n) = (\<Sum>i = 0..Suc n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc n - i))

goal (1 subgoal):
 1. \<And>n a b. (\<And>a b. pochhammer (a + b) n = (\<Sum>k\<le>n. of_nat (n choose k) * pochhammer a k * pochhammer b (n - k))) \<Longrightarrow> pochhammer (a + b) (Suc n) = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k))
[PROOF STEP]
have "\<dots> = (\<Sum>i\<le>n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc n - i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..Suc n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc n - i)) = (\<Sum>i\<le>n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc n - i))
[PROOF STEP]
using Suc
[PROOF STATE]
proof (prove)
using this:
pochhammer (?a + ?b) n = (\<Sum>k\<le>n. of_nat (n choose k) * pochhammer ?a k * pochhammer ?b (n - k))

goal (1 subgoal):
 1. (\<Sum>i = 0..Suc n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc n - i)) = (\<Sum>i\<le>n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc n - i))
[PROOF STEP]
by (intro sum.mono_neutral_right) (auto simp: not_le binomial_eq_0)
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..Suc n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc n - i)) = (\<Sum>i\<le>n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc n - i))

goal (1 subgoal):
 1. \<And>n a b. (\<And>a b. pochhammer (a + b) n = (\<Sum>k\<le>n. of_nat (n choose k) * pochhammer a k * pochhammer b (n - k))) \<Longrightarrow> pochhammer (a + b) (Suc n) = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..Suc n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc n - i)) = (\<Sum>i\<le>n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc n - i))

goal (1 subgoal):
 1. \<And>n a b. (\<And>a b. pochhammer (a + b) n = (\<Sum>k\<le>n. of_nat (n choose k) * pochhammer a k * pochhammer b (n - k))) \<Longrightarrow> pochhammer (a + b) (Suc n) = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k))
[PROOF STEP]
have "\<dots> = (\<Sum>i\<le>n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc (n - i)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc n - i)) = (\<Sum>i\<le>n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc (n - i)))
[PROOF STEP]
by (intro sum.cong) (simp_all add: Suc_diff_le)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc n - i)) = (\<Sum>i\<le>n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc (n - i)))

goal (1 subgoal):
 1. \<And>n a b. (\<And>a b. pochhammer (a + b) n = (\<Sum>k\<le>n. of_nat (n choose k) * pochhammer a k * pochhammer b (n - k))) \<Longrightarrow> pochhammer (a + b) (Suc n) = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc n - i)) = (\<Sum>i\<le>n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc (n - i)))

goal (1 subgoal):
 1. \<And>n a b. (\<And>a b. pochhammer (a + b) n = (\<Sum>k\<le>n. of_nat (n choose k) * pochhammer a k * pochhammer b (n - k))) \<Longrightarrow> pochhammer (a + b) (Suc n) = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k))
[PROOF STEP]
have "\<dots> = b * pochhammer (a + (b + 1)) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<le>n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc (n - i))) = b * pochhammer (a + (b + (1::'a))) n
[PROOF STEP]
by (subst Suc) (simp add: sum_distrib_left mult_ac pochhammer_rec)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc (n - i))) = b * pochhammer (a + (b + (1::'a))) n

goal (1 subgoal):
 1. \<And>n a b. (\<And>a b. pochhammer (a + b) n = (\<Sum>k\<le>n. of_nat (n choose k) * pochhammer a k * pochhammer b (n - k))) \<Longrightarrow> pochhammer (a + b) (Suc n) = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<le>n. of_nat (n choose i) * pochhammer a i * pochhammer b (Suc (n - i))) = b * pochhammer (a + (b + (1::'a))) n

goal (1 subgoal):
 1. \<And>n a b. (\<And>a b. pochhammer (a + b) n = (\<Sum>k\<le>n. of_nat (n choose k) * pochhammer a k * pochhammer b (n - k))) \<Longrightarrow> pochhammer (a + b) (Suc n) = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k))
[PROOF STEP]
have "a * pochhammer ((a + 1) + b) n + b * pochhammer (a + (b + 1)) n =
      pochhammer (a + b) (Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * pochhammer (a + (1::'a) + b) n + b * pochhammer (a + (b + (1::'a))) n = pochhammer (a + b) (Suc n)
[PROOF STEP]
by (simp add: pochhammer_rec algebra_simps)
[PROOF STATE]
proof (state)
this:
a * pochhammer (a + (1::'a) + b) n + b * pochhammer (a + (b + (1::'a))) n = pochhammer (a + b) (Suc n)

goal (1 subgoal):
 1. \<And>n a b. (\<And>a b. pochhammer (a + b) n = (\<Sum>k\<le>n. of_nat (n choose k) * pochhammer a k * pochhammer b (n - k))) \<Longrightarrow> pochhammer (a + b) (Suc n) = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k)) = pochhammer (a + b) (Suc n)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k)) = pochhammer (a + b) (Suc n)

goal (1 subgoal):
 1. pochhammer (a + b) (Suc n) = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
pochhammer (a + b) (Suc n) = (\<Sum>k\<le>Suc n. of_nat (Suc n choose k) * pochhammer a k * pochhammer b (Suc n - k))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fact_fact_dvd_fact:
  "fact k * fact n dvd (fact (k + n) :: 'a::linordered_semidom)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fact k * fact n dvd fact (k + n)
[PROOF STEP]
by (metis add.commute add_diff_cancel_left' choose_dvd le_add2)


[STATEMENT]
lemma Sup2: "(\<And>x::'a Assertion . x \<in> A \<Longrightarrow> x \<le> z) \<Longrightarrow> Sup A \<le> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> A \<Longrightarrow> x \<le> z) \<Longrightarrow> \<Squnion> A \<le> z
[PROOF STEP]
apply (simp add: Sup_Assertion_def less_eq_Assertion_def Abs_Assertion_inverse)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> A \<Longrightarrow> {\<cdot> x } \<le> {\<cdot> z }) \<Longrightarrow> \<Squnion> (assert ` A) \<le> {\<cdot> z }
[PROOF STEP]
apply (rule Sup_least)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>\<And>x. x \<in> A \<Longrightarrow> {\<cdot> x } \<le> {\<cdot> z }; x \<in> assert ` A\<rbrakk> \<Longrightarrow> x \<le> {\<cdot> z }
[PROOF STEP]
by blast


[STATEMENT]
lemma uncountable_cball:
  fixes a :: "'a::euclidean_space"
  assumes "r > 0"
  shows "uncountable (cball a r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uncountable (cball a r)
[PROOF STEP]
using assms countable_subset uncountable_ball
[PROOF STATE]
proof (prove)
using this:
0 < r
\<lbrakk>?A \<subseteq> ?B; countable ?B\<rbrakk> \<Longrightarrow> countable ?A
0 < ?r \<Longrightarrow> uncountable (ball ?a ?r)

goal (1 subgoal):
 1. uncountable (cball a r)
[PROOF STEP]
by auto


[STATEMENT]
lemma product_simps[simp]:
      "alphabet\<^sub>2 (product AA) = \<Inter> (alphabet\<^sub>1 ` set AA)"
      "initial\<^sub>2 (product AA) = map initial\<^sub>1 AA"
      "transition\<^sub>2 (product AA) a ps = map2 (\<lambda> A p. transition\<^sub>1 A a p) AA ps"
      "condition\<^sub>2 (product AA) = condition (map condition\<^sub>1 AA)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (alphabet\<^sub>2 (product AA) = \<Inter> (alphabet\<^sub>1 ` set AA) &&& initial\<^sub>2 (product AA) = map initial\<^sub>1 AA) &&& transition\<^sub>2 (product AA) a ps = map2 (\<lambda>x. transition\<^sub>1 x a) AA ps &&& condition\<^sub>2 (product AA) = condition (map condition\<^sub>1 AA)
[PROOF STEP]
unfolding product_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (alphabet\<^sub>2 (automaton\<^sub>2 (\<Inter> (alphabet\<^sub>1 ` set AA)) (map initial\<^sub>1 AA) (\<lambda>a. map2 (\<lambda>x. transition\<^sub>1 x a) AA) (condition (map condition\<^sub>1 AA))) = \<Inter> (alphabet\<^sub>1 ` set AA) &&& initial\<^sub>2 (automaton\<^sub>2 (\<Inter> (alphabet\<^sub>1 ` set AA)) (map initial\<^sub>1 AA) (\<lambda>a. map2 (\<lambda>x. transition\<^sub>1 x a) AA) (condition (map condition\<^sub>1 AA))) = map initial\<^sub>1 AA) &&& transition\<^sub>2 (automaton\<^sub>2 (\<Inter> (alphabet\<^sub>1 ` set AA)) (map initial\<^sub>1 AA) (\<lambda>a. map2 (\<lambda>x. transition\<^sub>1 x a) AA) (condition (map condition\<^sub>1 AA))) a ps = map2 (\<lambda>x. transition\<^sub>1 x a) AA ps &&& condition\<^sub>2 (automaton\<^sub>2 (\<Inter> (alphabet\<^sub>1 ` set AA)) (map initial\<^sub>1 AA) (\<lambda>a. map2 (\<lambda>x. transition\<^sub>1 x a) AA) (condition (map condition\<^sub>1 AA))) = condition (map condition\<^sub>1 AA)
[PROOF STEP]
by auto


[STATEMENT]
lemma fvi_less_nfv_regex: "\<forall>i\<in>fv_regex \<phi>. i < nfv_regex \<phi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i\<in>fv_regex \<phi>. i < nfv_regex \<phi>
[PROOF STEP]
unfolding Regex.nfv_regex_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i\<in>fv_regex \<phi>. i < Max (insert 0 (Suc ` fv_regex \<phi>))
[PROOF STEP]
by (auto simp add: Max_gr_iff intro: max.strict_coboundedI2)


[STATEMENT]
lemma eq_inter_and:
  "simplicial_complex_induced_by_monotone_boolean_function n (bool_fun_and n f g)
  = simplicial_complex_induced_by_monotone_boolean_function n f
    \<inter> simplicial_complex_induced_by_monotone_boolean_function n g"
  (is "?sc n (?bf_and n f g) = ?sc n f \<inter> ?sc n g")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. simplicial_complex_induced_by_monotone_boolean_function n (bool_fun_and n f g) = simplicial_complex_induced_by_monotone_boolean_function n f \<inter> simplicial_complex_induced_by_monotone_boolean_function n g
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. simplicial_complex_induced_by_monotone_boolean_function n (bool_fun_and n f g) \<subseteq> simplicial_complex_induced_by_monotone_boolean_function n f \<inter> simplicial_complex_induced_by_monotone_boolean_function n g
 2. simplicial_complex_induced_by_monotone_boolean_function n f \<inter> simplicial_complex_induced_by_monotone_boolean_function n g \<subseteq> simplicial_complex_induced_by_monotone_boolean_function n (bool_fun_and n f g)
[PROOF STEP]
show "?sc n f \<inter> ?sc n g \<subseteq> ?sc n (?bf_and n f g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. simplicial_complex_induced_by_monotone_boolean_function n f \<inter> simplicial_complex_induced_by_monotone_boolean_function n g \<subseteq> simplicial_complex_induced_by_monotone_boolean_function n (bool_fun_and n f g)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> simplicial_complex_induced_by_monotone_boolean_function n f \<inter> simplicial_complex_induced_by_monotone_boolean_function n g \<Longrightarrow> x \<in> simplicial_complex_induced_by_monotone_boolean_function n (bool_fun_and n f g)
[PROOF STEP]
fix \<sigma> :: "nat set"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> simplicial_complex_induced_by_monotone_boolean_function n f \<inter> simplicial_complex_induced_by_monotone_boolean_function n g \<Longrightarrow> x \<in> simplicial_complex_induced_by_monotone_boolean_function n (bool_fun_and n f g)
[PROOF STEP]
assume "\<sigma> \<in> (?sc n f \<inter> ?sc n g)"
[PROOF STATE]
proof (state)
this:
\<sigma> \<in> simplicial_complex_induced_by_monotone_boolean_function n f \<inter> simplicial_complex_induced_by_monotone_boolean_function n g

goal (1 subgoal):
 1. \<And>x. x \<in> simplicial_complex_induced_by_monotone_boolean_function n f \<inter> simplicial_complex_induced_by_monotone_boolean_function n g \<Longrightarrow> x \<in> simplicial_complex_induced_by_monotone_boolean_function n (bool_fun_and n f g)
[PROOF STEP]
hence sigma: "\<sigma> \<in> ?sc n f \<and> \<sigma> \<in> ?sc n g"
[PROOF STATE]
proof (prove)
using this:
\<sigma> \<in> simplicial_complex_induced_by_monotone_boolean_function n f \<inter> simplicial_complex_induced_by_monotone_boolean_function n g

goal (1 subgoal):
 1. \<sigma> \<in> simplicial_complex_induced_by_monotone_boolean_function n f \<and> \<sigma> \<in> simplicial_complex_induced_by_monotone_boolean_function n g
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<sigma> \<in> simplicial_complex_induced_by_monotone_boolean_function n f \<and> \<sigma> \<in> simplicial_complex_induced_by_monotone_boolean_function n g

goal (1 subgoal):
 1. \<And>x. x \<in> simplicial_complex_induced_by_monotone_boolean_function n f \<inter> simplicial_complex_induced_by_monotone_boolean_function n g \<Longrightarrow> x \<in> simplicial_complex_induced_by_monotone_boolean_function n (bool_fun_and n f g)
[PROOF STEP]
have "f (simplicial_complex.bool_vec_from_simplice n \<sigma>)
           \<and> g (simplicial_complex.bool_vec_from_simplice n \<sigma>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (simplicial_complex.bool_vec_from_simplice n \<sigma>) \<and> g (simplicial_complex.bool_vec_from_simplice n \<sigma>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f (simplicial_complex.bool_vec_from_simplice n \<sigma>) \<and> g (simplicial_complex.bool_vec_from_simplice n \<sigma>)
[PROOF STEP]
from sigma
[PROOF STATE]
proof (chain)
picking this:
\<sigma> \<in> simplicial_complex_induced_by_monotone_boolean_function n f \<and> \<sigma> \<in> simplicial_complex_induced_by_monotone_boolean_function n g
[PROOF STEP]
have sigmaf: "\<sigma> \<in> ?sc n f" and sigmag: "\<sigma> \<in> ?sc n g"
[PROOF STATE]
proof (prove)
using this:
\<sigma> \<in> simplicial_complex_induced_by_monotone_boolean_function n f \<and> \<sigma> \<in> simplicial_complex_induced_by_monotone_boolean_function n g

goal (1 subgoal):
 1. \<sigma> \<in> simplicial_complex_induced_by_monotone_boolean_function n f &&& \<sigma> \<in> simplicial_complex_induced_by_monotone_boolean_function n g
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<sigma> \<in> simplicial_complex_induced_by_monotone_boolean_function n f
\<sigma> \<in> simplicial_complex_induced_by_monotone_boolean_function n g

goal (1 subgoal):
 1. f (simplicial_complex.bool_vec_from_simplice n \<sigma>) \<and> g (simplicial_complex.bool_vec_from_simplice n \<sigma>)
[PROOF STEP]
have "f (simplicial_complex.bool_vec_from_simplice n \<sigma>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (simplicial_complex.bool_vec_from_simplice n \<sigma>)
[PROOF STEP]
using simplicial_complex.simplicial_complex_implies_true [OF sigmaf]
[PROOF STATE]
proof (prove)
using this:
f (simplicial_complex.bool_vec_from_simplice n \<sigma>)

goal (1 subgoal):
 1. f (simplicial_complex.bool_vec_from_simplice n \<sigma>)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
f (simplicial_complex.bool_vec_from_simplice n \<sigma>)

goal (1 subgoal):
 1. f (simplicial_complex.bool_vec_from_simplice n \<sigma>) \<and> g (simplicial_complex.bool_vec_from_simplice n \<sigma>)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
f (simplicial_complex.bool_vec_from_simplice n \<sigma>)

goal (1 subgoal):
 1. f (simplicial_complex.bool_vec_from_simplice n \<sigma>) \<and> g (simplicial_complex.bool_vec_from_simplice n \<sigma>)
[PROOF STEP]
have "g (simplicial_complex.bool_vec_from_simplice n \<sigma>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g (simplicial_complex.bool_vec_from_simplice n \<sigma>)
[PROOF STEP]
using simplicial_complex.simplicial_complex_implies_true [OF sigmag]
[PROOF STATE]
proof (prove)
using this:
g (simplicial_complex.bool_vec_from_simplice n \<sigma>)

goal (1 subgoal):
 1. g (simplicial_complex.bool_vec_from_simplice n \<sigma>)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
g (simplicial_complex.bool_vec_from_simplice n \<sigma>)

goal (1 subgoal):
 1. f (simplicial_complex.bool_vec_from_simplice n \<sigma>) \<and> g (simplicial_complex.bool_vec_from_simplice n \<sigma>)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
f (simplicial_complex.bool_vec_from_simplice n \<sigma>)
g (simplicial_complex.bool_vec_from_simplice n \<sigma>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f (simplicial_complex.bool_vec_from_simplice n \<sigma>)
g (simplicial_complex.bool_vec_from_simplice n \<sigma>)

goal (1 subgoal):
 1. f (simplicial_complex.bool_vec_from_simplice n \<sigma>) \<and> g (simplicial_complex.bool_vec_from_simplice n \<sigma>)
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
f (simplicial_complex.bool_vec_from_simplice n \<sigma>) \<and> g (simplicial_complex.bool_vec_from_simplice n \<sigma>)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
f (simplicial_complex.bool_vec_from_simplice n \<sigma>) \<and> g (simplicial_complex.bool_vec_from_simplice n \<sigma>)

goal (1 subgoal):
 1. \<And>x. x \<in> simplicial_complex_induced_by_monotone_boolean_function n f \<inter> simplicial_complex_induced_by_monotone_boolean_function n g \<Longrightarrow> x \<in> simplicial_complex_induced_by_monotone_boolean_function n (bool_fun_and n f g)
[PROOF STEP]
thus "\<sigma> \<in> ?sc n (?bf_and n f g)"
[PROOF STATE]
proof (prove)
using this:
f (simplicial_complex.bool_vec_from_simplice n \<sigma>) \<and> g (simplicial_complex.bool_vec_from_simplice n \<sigma>)

goal (1 subgoal):
 1. \<sigma> \<in> simplicial_complex_induced_by_monotone_boolean_function n (bool_fun_and n f g)
[PROOF STEP]
unfolding simplicial_complex_induced_by_monotone_boolean_function_def
[PROOF STATE]
proof (prove)
using this:
f (simplicial_complex.bool_vec_from_simplice n \<sigma>) \<and> g (simplicial_complex.bool_vec_from_simplice n \<sigma>)

goal (1 subgoal):
 1. \<sigma> \<in> {y. \<exists>x. dim_vec x = n \<and> bool_fun_and n f g x \<and> ceros_of_boolean_input x = y}
[PROOF STEP]
unfolding bool_fun_and_def
[PROOF STATE]
proof (prove)
using this:
f (simplicial_complex.bool_vec_from_simplice n \<sigma>) \<and> g (simplicial_complex.bool_vec_from_simplice n \<sigma>)

goal (1 subgoal):
 1. \<sigma> \<in> {y. \<exists>x. dim_vec x = n \<and> (f x \<and> g x) \<and> ceros_of_boolean_input x = y}
[PROOF STEP]
using sigma
[PROOF STATE]
proof (prove)
using this:
f (simplicial_complex.bool_vec_from_simplice n \<sigma>) \<and> g (simplicial_complex.bool_vec_from_simplice n \<sigma>)
\<sigma> \<in> simplicial_complex_induced_by_monotone_boolean_function n f \<and> \<sigma> \<in> simplicial_complex_induced_by_monotone_boolean_function n g

goal (1 subgoal):
 1. \<sigma> \<in> {y. \<exists>x. dim_vec x = n \<and> (f x \<and> g x) \<and> ceros_of_boolean_input x = y}
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f (simplicial_complex.bool_vec_from_simplice n \<sigma>); g (simplicial_complex.bool_vec_from_simplice n \<sigma>); \<sigma> \<in> simplicial_complex_induced_by_monotone_boolean_function n f; \<sigma> \<in> simplicial_complex_induced_by_monotone_boolean_function n g\<rbrakk> \<Longrightarrow> \<exists>x. dim_vec x = n \<and> f x \<and> g x \<and> ceros_of_boolean_input x = \<sigma>
[PROOF STEP]
by (smt (z3) Collect_cong ceros_of_boolean_input_def dim_vec index_vec mem_Collect_eq
          simplicial_complex.bool_vec_from_simplice_def
          simplicial_complex_induced_by_monotone_boolean_function_def)
[PROOF STATE]
proof (state)
this:
\<sigma> \<in> simplicial_complex_induced_by_monotone_boolean_function n (bool_fun_and n f g)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
simplicial_complex_induced_by_monotone_boolean_function n f \<inter> simplicial_complex_induced_by_monotone_boolean_function n g \<subseteq> simplicial_complex_induced_by_monotone_boolean_function n (bool_fun_and n f g)

goal (1 subgoal):
 1. simplicial_complex_induced_by_monotone_boolean_function n (bool_fun_and n f g) \<subseteq> simplicial_complex_induced_by_monotone_boolean_function n f \<inter> simplicial_complex_induced_by_monotone_boolean_function n g
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. simplicial_complex_induced_by_monotone_boolean_function n (bool_fun_and n f g) \<subseteq> simplicial_complex_induced_by_monotone_boolean_function n f \<inter> simplicial_complex_induced_by_monotone_boolean_function n g
[PROOF STEP]
show "?sc n (?bf_and n f g) \<subseteq> ?sc n f \<inter> ?sc n g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. simplicial_complex_induced_by_monotone_boolean_function n (bool_fun_and n f g) \<subseteq> simplicial_complex_induced_by_monotone_boolean_function n f \<inter> simplicial_complex_induced_by_monotone_boolean_function n g
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> simplicial_complex_induced_by_monotone_boolean_function n (bool_fun_and n f g) \<Longrightarrow> x \<in> simplicial_complex_induced_by_monotone_boolean_function n f \<inter> simplicial_complex_induced_by_monotone_boolean_function n g
[PROOF STEP]
fix \<sigma> :: "nat set"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> simplicial_complex_induced_by_monotone_boolean_function n (bool_fun_and n f g) \<Longrightarrow> x \<in> simplicial_complex_induced_by_monotone_boolean_function n f \<inter> simplicial_complex_induced_by_monotone_boolean_function n g
[PROOF STEP]
assume sigma: "\<sigma> \<in> ?sc n (?bf_and n f g)"
[PROOF STATE]
proof (state)
this:
\<sigma> \<in> simplicial_complex_induced_by_monotone_boolean_function n (bool_fun_and n f g)

goal (1 subgoal):
 1. \<And>x. x \<in> simplicial_complex_induced_by_monotone_boolean_function n (bool_fun_and n f g) \<Longrightarrow> x \<in> simplicial_complex_induced_by_monotone_boolean_function n f \<inter> simplicial_complex_induced_by_monotone_boolean_function n g
[PROOF STEP]
hence "bool_fun_and n f g (simplicial_complex.bool_vec_from_simplice n \<sigma>)"
[PROOF STATE]
proof (prove)
using this:
\<sigma> \<in> simplicial_complex_induced_by_monotone_boolean_function n (bool_fun_and n f g)

goal (1 subgoal):
 1. bool_fun_and n f g (simplicial_complex.bool_vec_from_simplice n \<sigma>)
[PROOF STEP]
unfolding simplicial_complex.bool_vec_from_simplice_def
[PROOF STATE]
proof (prove)
using this:
\<sigma> \<in> simplicial_complex_induced_by_monotone_boolean_function n (bool_fun_and n f g)

goal (1 subgoal):
 1. bool_fun_and n f g (vec n (\<lambda>i. i \<notin> \<sigma>))
[PROOF STEP]
unfolding simplicial_complex_induced_by_monotone_boolean_function_def
[PROOF STATE]
proof (prove)
using this:
\<sigma> \<in> {y. \<exists>x. dim_vec x = n \<and> bool_fun_and n f g x \<and> ceros_of_boolean_input x = y}

goal (1 subgoal):
 1. bool_fun_and n f g (vec n (\<lambda>i. i \<notin> \<sigma>))
[PROOF STEP]
unfolding ceros_of_boolean_input_def
[PROOF STATE]
proof (prove)
using this:
\<sigma> \<in> {y. \<exists>x. dim_vec x = n \<and> bool_fun_and n f g x \<and> {xa. xa < dim_vec x \<and> x $ xa = False} = y}

goal (1 subgoal):
 1. bool_fun_and n f g (vec n (\<lambda>i. i \<notin> \<sigma>))
[PROOF STEP]
by auto (smt (verit) dim_vec eq_vecI index_vec)+
[PROOF STATE]
proof (state)
this:
bool_fun_and n f g (simplicial_complex.bool_vec_from_simplice n \<sigma>)

goal (1 subgoal):
 1. \<And>x. x \<in> simplicial_complex_induced_by_monotone_boolean_function n (bool_fun_and n f g) \<Longrightarrow> x \<in> simplicial_complex_induced_by_monotone_boolean_function n f \<inter> simplicial_complex_induced_by_monotone_boolean_function n g
[PROOF STEP]
hence "(f (simplicial_complex.bool_vec_from_simplice n \<sigma>))
          \<and> (g (simplicial_complex.bool_vec_from_simplice n \<sigma>))"
[PROOF STATE]
proof (prove)
using this:
bool_fun_and n f g (simplicial_complex.bool_vec_from_simplice n \<sigma>)

goal (1 subgoal):
 1. f (simplicial_complex.bool_vec_from_simplice n \<sigma>) \<and> g (simplicial_complex.bool_vec_from_simplice n \<sigma>)
[PROOF STEP]
unfolding bool_fun_and_def
[PROOF STATE]
proof (prove)
using this:
f (simplicial_complex.bool_vec_from_simplice n \<sigma>) \<and> g (simplicial_complex.bool_vec_from_simplice n \<sigma>)

goal (1 subgoal):
 1. f (simplicial_complex.bool_vec_from_simplice n \<sigma>) \<and> g (simplicial_complex.bool_vec_from_simplice n \<sigma>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f (simplicial_complex.bool_vec_from_simplice n \<sigma>) \<and> g (simplicial_complex.bool_vec_from_simplice n \<sigma>)

goal (1 subgoal):
 1. \<And>x. x \<in> simplicial_complex_induced_by_monotone_boolean_function n (bool_fun_and n f g) \<Longrightarrow> x \<in> simplicial_complex_induced_by_monotone_boolean_function n f \<inter> simplicial_complex_induced_by_monotone_boolean_function n g
[PROOF STEP]
hence "\<sigma> \<in> ?sc n f \<and> \<sigma> \<in> ?sc n g"
[PROOF STATE]
proof (prove)
using this:
f (simplicial_complex.bool_vec_from_simplice n \<sigma>) \<and> g (simplicial_complex.bool_vec_from_simplice n \<sigma>)

goal (1 subgoal):
 1. \<sigma> \<in> simplicial_complex_induced_by_monotone_boolean_function n f \<and> \<sigma> \<in> simplicial_complex_induced_by_monotone_boolean_function n g
[PROOF STEP]
using bool_fun_and_def sigma simplicial_complex_induced_by_monotone_boolean_function_def
[PROOF STATE]
proof (prove)
using this:
f (simplicial_complex.bool_vec_from_simplice n \<sigma>) \<and> g (simplicial_complex.bool_vec_from_simplice n \<sigma>)
bool_fun_and ?n ?f ?g \<equiv> \<lambda>x. ?f x \<and> ?g x
\<sigma> \<in> simplicial_complex_induced_by_monotone_boolean_function n (bool_fun_and n f g)
simplicial_complex_induced_by_monotone_boolean_function ?n ?f = {y. \<exists>x. dim_vec x = ?n \<and> ?f x \<and> ceros_of_boolean_input x = y}

goal (1 subgoal):
 1. \<sigma> \<in> simplicial_complex_induced_by_monotone_boolean_function n f \<and> \<sigma> \<in> simplicial_complex_induced_by_monotone_boolean_function n g
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<sigma> \<in> simplicial_complex_induced_by_monotone_boolean_function n f \<and> \<sigma> \<in> simplicial_complex_induced_by_monotone_boolean_function n g

goal (1 subgoal):
 1. \<And>x. x \<in> simplicial_complex_induced_by_monotone_boolean_function n (bool_fun_and n f g) \<Longrightarrow> x \<in> simplicial_complex_induced_by_monotone_boolean_function n f \<inter> simplicial_complex_induced_by_monotone_boolean_function n g
[PROOF STEP]
thus "\<sigma> \<in> simplicial_complex_induced_by_monotone_boolean_function n f
          \<inter> simplicial_complex_induced_by_monotone_boolean_function n g"
[PROOF STATE]
proof (prove)
using this:
\<sigma> \<in> simplicial_complex_induced_by_monotone_boolean_function n f \<and> \<sigma> \<in> simplicial_complex_induced_by_monotone_boolean_function n g

goal (1 subgoal):
 1. \<sigma> \<in> simplicial_complex_induced_by_monotone_boolean_function n f \<inter> simplicial_complex_induced_by_monotone_boolean_function n g
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<sigma> \<in> simplicial_complex_induced_by_monotone_boolean_function n f \<inter> simplicial_complex_induced_by_monotone_boolean_function n g

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
simplicial_complex_induced_by_monotone_boolean_function n (bool_fun_and n f g) \<subseteq> simplicial_complex_induced_by_monotone_boolean_function n f \<inter> simplicial_complex_induced_by_monotone_boolean_function n g

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma NatMultiples_ex_divisor: "m \<in> NatMultiples F \<Longrightarrow> \<exists>k\<in>F. m mod k = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<in> NatMultiples F \<Longrightarrow> \<exists>k\<in>F. m mod k = 0
[PROOF STEP]
apply (induct m rule: NatMultiples.induct)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>k. k \<in> F \<Longrightarrow> \<exists>ka\<in>F. k mod ka = 0
 2. \<And>k m. \<lbrakk>k \<in> F; m \<in> NatMultiples F; \<exists>k\<in>F. m mod k = 0\<rbrakk> \<Longrightarrow> \<exists>ka\<in>F. k * m mod ka = 0
[PROOF STEP]
apply (rule_tac x=k in bexI, simp+)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma numeral_eq_one_mod_ring_iff [simp]:
  "numeral a = (1 :: 'a :: nontriv mod_ring) \<longleftrightarrow> (numeral a mod CARD('a)) = (1 mod CARD('a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (numeral a = 1) = (numeral a mod CARD('a) = 1 mod CARD('a))
[PROOF STEP]
using of_nat_mod_ring_eq_iff[of "numeral a" 1, where ?'a = 'a]
[PROOF STATE]
proof (prove)
using this:
(of_nat (numeral a) = of_nat 1) = (numeral a mod CARD('a) = 1 mod CARD('a))

goal (1 subgoal):
 1. (numeral a = 1) = (numeral a mod CARD('a) = 1 mod CARD('a))
[PROOF STEP]
by (simp del: of_nat_mod_ring_eq_iff)


[STATEMENT]
lemma map_us_func2:
  fixes f :: "'c::complete_lattice_with_dual \<Rightarrow> 'b::complete_lattice_with_dual"
  and g :: "'a::complete_lattice_with_dual \<Rightarrow> 'c"
  shows "map_us (f \<circ> g) = map_us f \<circ> map_us g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_us (f \<circ> g) = map_us f \<circ> map_us g
[PROOF STEP]
unfolding map_us_def fun_eq_iff comp_def us_def IInf_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. Abs_upset (\<up> (f (g (\<Sqinter> Rep_upset x)))) = Abs_upset (\<up> (f (\<Sqinter> Rep_upset (Abs_upset (\<up> (g (\<Sqinter> Rep_upset x)))))))
[PROOF STEP]
by (metis Abs_upset_inverse Sup_Inf_var Sup_atLeastAtMost Sup_dual_upset_var order_refl rangeI)


[STATEMENT]
lemma (in fin_bipartite_graph) sum_degree_normalized_X_density:
  "(\<Sum> x \<in> X. degree_normalized x Y) / card X = edge_density X Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>X. degree_normalized x Y) / real (card X) = local.density
[PROOF STEP]
by (smt (z3) card_all_edges_betw_neighbor card_edges_between_set degree_normalized_def
    divide_divide_eq_left' density_simp of_nat_mult of_nat_sum partitions_finite(1)
    partitions_finite(2) sum.cong sum_left_div_distrib)


[STATEMENT]
lemma crit_pair_swap: "crit_pair p q = (snd (crit_pair q p), fst (crit_pair q p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. crit_pair p q = (snd (crit_pair q p), fst (crit_pair q p))
[PROOF STEP]
by (simp add: crit_pair_def lcs_comm)


[STATEMENT]
lemma permutations_of_set_doubleton:
  "x \<noteq> y \<Longrightarrow> permutations_of_set {x,y} = {[x,y], [y,x]}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> y \<Longrightarrow> permutations_of_set {x, y} = {[x, y], [y, x]}
[PROOF STEP]
by (subst permutations_of_set_nonempty)
     (simp_all add: insert_Diff_if insert_commute)


[STATEMENT]
lemma matrix_add_assoc:
  "(A::('a::semigroup_add,'m,'n) matrix) + B + C = A + (B + C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A + B + C = A + (B + C)
[PROOF STEP]
by (cases A, cases B, cases C, simp add: add.assoc)


[STATEMENT]
lemma rbtreeify_g_code [code]:
  "rbtreeify_g n kvs =
   (if n = 0 \<or> n = 1 then (Empty, kvs)
    else let (n', r) = Euclidean_Division.divmod_nat n 2 in
      if r = 0 then
        case rbtreeify_g n' kvs of (t1, (k, v) # kvs') \<Rightarrow>
          apfst (Branch B t1 k v) (rbtreeify_g n' kvs')
      else case rbtreeify_f n' kvs of (t1, (k, v) # kvs') \<Rightarrow>
          apfst (Branch B t1 k v) (rbtreeify_g n' kvs'))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rbtreeify_g n kvs = (if n = 0 \<or> n = 1 then (Empty, kvs) else let (n', r) = Euclidean_Division.divmod_nat n 2 in if r = 0 then case rbtreeify_g n' kvs of (t1, (k, v) # kvs') \<Rightarrow> apfst (Branch B t1 k v) (rbtreeify_g n' kvs') else case rbtreeify_f n' kvs of (t1, (k, v) # kvs') \<Rightarrow> apfst (Branch B t1 k v) (rbtreeify_g n' kvs'))
[PROOF STEP]
by(subst rbtreeify_g.simps)(simp only: Let_def Euclidean_Division.divmod_nat_def prod.case)


[STATEMENT]
lemma mtx_invertibleD[simp]:
  assumes "mtx_invertible A"
  shows "A\<^sup>-\<^sup>1 * A = 1" and "A * A\<^sup>-\<^sup>1 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A\<^sup>-\<^sup>1 * A = 1 &&& A * A\<^sup>-\<^sup>1 = 1
[PROOF STEP]
apply (unfold sq_mtx_inv_def times_sq_mtx_def one_sq_mtx_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. map_fun to_vec (map_fun to_vec to_mtx) (**) (map_fun to_vec to_mtx matrix_inv A) A = id (to_mtx (mat 1))
 2. map_fun to_vec (map_fun to_vec to_mtx) (**) A (map_fun to_vec to_mtx matrix_inv A) = id (to_mtx (mat 1))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
mtx_invertible A

goal (2 subgoals):
 1. map_fun to_vec (map_fun to_vec to_mtx) (**) (map_fun to_vec to_mtx matrix_inv A) A = id (to_mtx (mat 1))
 2. map_fun to_vec (map_fun to_vec to_mtx) (**) A (map_fun to_vec to_mtx matrix_inv A) = id (to_mtx (mat 1))
[PROOF STEP]
by simp_all


[STATEMENT]
theorem p42: "\<not>(\<exists>y. \<forall>x. F(x,y) \<longleftrightarrow> \<not>(\<exists>z. F(x,z) \<and> F(z,x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<nexists>y. \<forall>x. F (x, y) = (\<nexists>z. F (x, z) \<and> F (z, x))
[PROOF STEP]
@proof
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<nexists>y. \<forall>x. F (x, y) = (\<nexists>z. F (x, z) \<and> F (z, x))
[PROOF STEP]
@contradiction
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<nexists>y. \<forall>x. F (x, y) = (\<nexists>z. F (x, z) \<and> F (z, x))
[PROOF STEP]
@obtain y where "\<forall>x. F(x,y) \<longleftrightarrow> \<not>(\<exists>z. F(x,z) \<and> F(z,x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<nexists>y. \<forall>x. F (x, y) = (\<nexists>z. F (x, z) \<and> F (z, x))
[PROOF STEP]
@case "F(y,y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<nexists>y. \<forall>x. F (x, y) = (\<nexists>z. F (x, z) \<and> F (z, x))
[PROOF STEP]
@qed


[STATEMENT]
lemma wp_g_ode_ivl: "t \<ge> 0 \<Longrightarrow> t \<in> T \<Longrightarrow> wp (x\<acute>= (\<lambda>t. f) & G on (\<lambda>s. {0..t}) S @ 0) \<lceil>Q\<rceil> =
  \<lceil>\<lambda>s. s \<in> S \<longrightarrow> (\<forall>t\<in>{0..t}. (\<forall>\<tau>\<in>{0..t}. G (\<phi> \<tau> s)) \<longrightarrow> Q (\<phi> t s))\<rceil>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> t; t \<in> T\<rbrakk> \<Longrightarrow> wp x\<acute>=\<lambda>t. f & G on \<lambda>s. {0..t} S @ 0 \<lceil>Q\<rceil> = \<lceil>\<lambda>s. s \<in> S \<longrightarrow> (\<forall>t\<in>{0..t}. (\<forall>\<tau>\<in>{0..t}. G (\<phi> \<tau> s)) \<longrightarrow> Q (\<phi> t s))\<rceil>
[PROOF STEP]
apply(subst wp_g_ode_subset, simp_all add: subintervalI init_time real_Icc_closed_segment)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> t; t \<in> T\<rbrakk> \<Longrightarrow> \<forall>s. (s \<in> S \<longrightarrow> (\<forall>ta\<in>{0--t}. (\<forall>\<tau>. \<tau> \<in> {0--t} \<and> \<tau> \<le> ta \<longrightarrow> G (\<phi> \<tau> s)) \<longrightarrow> Q (\<phi> ta s))) = (s \<in> S \<longrightarrow> (\<forall>t\<in>{0--t}. (\<forall>\<tau>\<in>{0..t}. G (\<phi> \<tau> s)) \<longrightarrow> Q (\<phi> t s)))
[PROOF STEP]
by (auto simp: closed_segment_eq_real_ivl)


[STATEMENT]
lemma space_tail_algebra [simp]: "space (tail_algebra n) = PiE UNIV (\<lambda>_. space M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. space (tail_algebra n) = UNIV \<rightarrow>\<^sub>E space M
[PROOF STEP]
by (simp add: tail_algebra_def space_PiM PiE_def Pi_def)


[STATEMENT]
lemma eventually_going_to_at_bot_linorder:
  fixes f :: "'a \<Rightarrow> 'b :: linorder"
  shows "eventually P (f going_to at_bot within A) \<longleftrightarrow> (\<exists>C. \<forall>x\<in>A. f x \<le> C \<longrightarrow> P x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eventually P (f going_to at_bot within A) = (\<exists>C. \<forall>x\<in>A. f x \<le> C \<longrightarrow> P x)
[PROOF STEP]
unfolding going_to_within_def eventually_filtercomap
    eventually_inf_principal eventually_at_bot_linorder
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>Q. (\<exists>N. \<forall>n\<le>N. Q n) \<and> (\<forall>x. Q (f x) \<longrightarrow> x \<in> A \<longrightarrow> P x)) = (\<exists>C. \<forall>x\<in>A. f x \<le> C \<longrightarrow> P x)
[PROOF STEP]
by fast


[STATEMENT]
lemma injective_into_1d_imp_open_map_UNIV:
  fixes f :: "'a::euclidean_space \<Rightarrow> real"
  assumes "open T" "continuous_on S f" "inj_on f S" "T \<subseteq> S"
    shows "open (f ` T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open (f ` T)
[PROOF STEP]
apply (rule invariance_of_domain_gen [OF \<open>open T\<close>])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. continuous_on T f
 2. inj_on f T
 3. DIM(real) \<le> DIM('a)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
open T
continuous_on S f
inj_on f S
T \<subseteq> S

goal (3 subgoals):
 1. continuous_on T f
 2. inj_on f T
 3. DIM(real) \<le> DIM('a)
[PROOF STEP]
by (auto simp: elim: continuous_on_subset subset_inj_on)


[STATEMENT]
lemma pderiv_monom':
  assumes "a \<in> carrier R"
  shows "pderiv (a \<odot>\<^bsub>P\<^esub> X[^]\<^bsub>P\<^esub>(n::nat)) = ([n]\<cdot>a)\<odot>\<^bsub>P\<^esub> X[^]\<^bsub>P\<^esub>(n-1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pderiv (a \<odot>\<^bsub>P\<^esub> X_poly R [^]\<^bsub>P\<^esub> n) = [n] \<cdot> a \<odot>\<^bsub>P\<^esub> X_poly R [^]\<^bsub>P\<^esub> (n - 1)
[PROOF STEP]
using assms pderiv_monom[of a n ]
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier R
a \<in> carrier R \<Longrightarrow> pderiv (monom P a n) = monom P ([n] \<cdot> a) (n - 1)

goal (1 subgoal):
 1. pderiv (a \<odot>\<^bsub>P\<^esub> X_poly R [^]\<^bsub>P\<^esub> n) = [n] \<cdot> a \<odot>\<^bsub>P\<^esub> X_poly R [^]\<^bsub>P\<^esub> (n - 1)
[PROOF STEP]
by (simp add: P_def UP_cring.monom_rep_X_pow UP_cring_axioms)


[STATEMENT]
lemma  fun_tuple_to_univ_poly_degree_bound:
  assumes "is_function_tuple R n fs"
  assumes "x \<in> carrier (R\<^bsup>n\<^esup>)"
  assumes "length fs = Suc m"
  shows "deg R (fun_tuple_to_univ_poly R n m fs x) \<le> m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deg R (fun_tuple_to_univ_poly R n m fs x) \<le> m
[PROOF STEP]
unfolding fun_tuple_to_univ_poly_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deg R (ring_cfs_to_univ_poly m (function_tuple_eval R n fs x)) \<le> m
[PROOF STEP]
using ring_cfs_to_univ_poly_degree assms
[PROOF STATE]
proof (prove)
using this:
?as \<in> carrier (R\<^bsup>Suc ?n\<^esup>) \<Longrightarrow> deg R (ring_cfs_to_univ_poly ?n ?as) \<le> ?n
\<lbrakk>?as \<in> carrier (R\<^bsup>Suc ?n\<^esup>); ?as ! ?n \<noteq> \<zero>\<rbrakk> \<Longrightarrow> deg R (ring_cfs_to_univ_poly ?n ?as) = ?n
is_function_tuple R n fs
x \<in> carrier (R\<^bsup>n\<^esup>)
length fs = Suc m

goal (1 subgoal):
 1. deg R (ring_cfs_to_univ_poly m (function_tuple_eval R n fs x)) \<le> m
[PROOF STEP]
by (metis function_tuple_eval_closed)


[STATEMENT]
lemma face_cycle_set_altdef: "face_cycle_set a = {(face_cycle_succ ^^ n) a | n. True}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. face_cycle_set a = {(face_cycle_succ ^^ n) a |n. True}
[PROOF STEP]
unfolding face_cycle_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. orbit face_cycle_succ a = {(face_cycle_succ ^^ n) a |n. True}
[PROOF STEP]
by (intro orbit_altdef_self_in permutation_self_in_orbit permutation_face_cycle_succ)


[STATEMENT]
lemma "max (Suc 0) 0 = Suc 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. max (Suc 0) 0 = Suc 0
[PROOF STEP]
by normalization


[STATEMENT]
lemma upper_asymptotic_density_meas [measurable]:
  assumes [measurable]: "\<And>(n::nat). Measurable.pred M (P n)"
  shows "(\<lambda>x. upper_asymptotic_density {n. P n x}) \<in> borel_measurable M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. upper_asymptotic_density {n. P n x}) \<in> borel_measurable M
[PROOF STEP]
unfolding upper_asymptotic_density_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. real_of_ereal (limsup (\<lambda>xa. ereal (real (card ({n. P n x} \<inter> {..<xa})) / real xa)))) \<in> borel_measurable M
[PROOF STEP]
by auto


[STATEMENT]
lemma algebraic_complex_code[code]:
  "algebraic_complex x = (algebraic (Re x) \<and> algebraic (Im x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. algebraic_complex x = (algebraic (Re x) \<and> algebraic (Im x))
[PROOF STEP]
unfolding algebraic_complex_def algebraic_complex_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (algebraic (Re x) \<and> algebraic (Im x)) = (algebraic (Re x) \<and> algebraic (Im x))
[PROOF STEP]
..


[STATEMENT]
lemma edge_density_commute: "edge_density X Y = edge_density Y X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. edge_density X Y = edge_density Y X
[PROOF STEP]
by (simp add: edge_density_def card_all_edges_between_commute mult.commute)


[STATEMENT]
lemma (in field) generate_field_min_subfield2:
  assumes "H \<subseteq> carrier R"
  shows "generate_field R H = \<Inter>{K. subfield K R \<and> H \<subseteq> K}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. generate_field R H = \<Inter> {K. subfield K R \<and> H \<subseteq> K}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. generate_field R H \<subseteq> \<Inter> {K. subfield K R \<and> H \<subseteq> K}
 2. \<Inter> {K. subfield K R \<and> H \<subseteq> K} \<subseteq> generate_field R H
[PROOF STEP]
have "subfield (generate_field R H) R \<and> H \<subseteq> generate_field R H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subfield (generate_field R H) R \<and> H \<subseteq> generate_field R H
[PROOF STEP]
by (simp add: assms generate_fieldE(2) generate_field_is_subfield)
[PROOF STATE]
proof (state)
this:
subfield (generate_field R H) R \<and> H \<subseteq> generate_field R H

goal (2 subgoals):
 1. generate_field R H \<subseteq> \<Inter> {K. subfield K R \<and> H \<subseteq> K}
 2. \<Inter> {K. subfield K R \<and> H \<subseteq> K} \<subseteq> generate_field R H
[PROOF STEP]
thus "\<Inter>{K. subfield K R \<and> H \<subseteq> K} \<subseteq> generate_field R H"
[PROOF STATE]
proof (prove)
using this:
subfield (generate_field R H) R \<and> H \<subseteq> generate_field R H

goal (1 subgoal):
 1. \<Inter> {K. subfield K R \<and> H \<subseteq> K} \<subseteq> generate_field R H
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<Inter> {K. subfield K R \<and> H \<subseteq> K} \<subseteq> generate_field R H

goal (1 subgoal):
 1. generate_field R H \<subseteq> \<Inter> {K. subfield K R \<and> H \<subseteq> K}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. generate_field R H \<subseteq> \<Inter> {K. subfield K R \<and> H \<subseteq> K}
[PROOF STEP]
have "\<And>K. subfield K R \<and> H \<subseteq> K \<Longrightarrow> generate_field R H \<subseteq> K"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>K. subfield K R \<and> H \<subseteq> K \<Longrightarrow> generate_field R H \<subseteq> K
[PROOF STEP]
by (simp add: assms generate_field_min_subfield1)
[PROOF STATE]
proof (state)
this:
subfield ?K R \<and> H \<subseteq> ?K \<Longrightarrow> generate_field R H \<subseteq> ?K

goal (1 subgoal):
 1. generate_field R H \<subseteq> \<Inter> {K. subfield K R \<and> H \<subseteq> K}
[PROOF STEP]
thus "generate_field R H \<subseteq> \<Inter>{K. subfield K R \<and> H \<subseteq> K}"
[PROOF STATE]
proof (prove)
using this:
subfield ?K R \<and> H \<subseteq> ?K \<Longrightarrow> generate_field R H \<subseteq> ?K

goal (1 subgoal):
 1. generate_field R H \<subseteq> \<Inter> {K. subfield K R \<and> H \<subseteq> K}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
generate_field R H \<subseteq> \<Inter> {K. subfield K R \<and> H \<subseteq> K}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma max_density_gr_zero:
  assumes "finite_graph G" and "nonempty_graph G" and "uwellformed G"
  shows "0 < max_density G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < max_density G
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < max_density G
[PROOF STEP]
have "0 < card (uverts G)" "0 < card (uedges G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < card (uverts G) &&& 0 < card (uedges G)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite_graph G
nonempty_graph G
uwellformed G

goal (1 subgoal):
 1. 0 < card (uverts G) &&& 0 < card (uedges G)
[PROOF STEP]
unfolding finite_graph_def nonempty_graph_def
[PROOF STATE]
proof (prove)
using this:
finite (uverts G) \<and> finite (uedges G)
uverts G \<noteq> {} \<and> uedges G \<noteq> {}
uwellformed G

goal (1 subgoal):
 1. 0 < card (uverts G) &&& 0 < card (uedges G)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < card (uverts G)
0 < card (uedges G)

goal (1 subgoal):
 1. 0 < max_density G
[PROOF STEP]
hence "0 < density G"
[PROOF STATE]
proof (prove)
using this:
0 < card (uverts G)
0 < card (uedges G)

goal (1 subgoal):
 1. 0 < Ugraph_Lemmas.density G
[PROOF STEP]
unfolding density_def
[PROOF STATE]
proof (prove)
using this:
0 < card (uverts G)
0 < card (uedges G)

goal (1 subgoal):
 1. 0 < real (card (uedges G)) / real (card (uverts G))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < Ugraph_Lemmas.density G

goal (1 subgoal):
 1. 0 < max_density G
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
0 < Ugraph_Lemmas.density G

goal (1 subgoal):
 1. 0 < max_density G
[PROOF STEP]
have "density G \<le> max_density G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ugraph_Lemmas.density G \<le> max_density G
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite_graph G
nonempty_graph G
uwellformed G

goal (1 subgoal):
 1. Ugraph_Lemmas.density G \<le> max_density G
[PROOF STEP]
by (simp add: max_density_is_max subgraph_refl)
[PROOF STATE]
proof (state)
this:
Ugraph_Lemmas.density G \<le> max_density G

goal (1 subgoal):
 1. 0 < max_density G
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
0 < max_density G
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < max_density G

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma list_all3_map_iff: "list_all3 P (map f xs) (map g ys) (map h zs) \<longleftrightarrow>
  list_all3 (\<lambda>x y z. P (f x) (g y) (h z)) xs ys zs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_all3 P (map f xs) (map g ys) (map h zs) = list_all3 (\<lambda>x y z. P (f x) (g y) (h z)) xs ys zs
[PROOF STEP]
using list_all3_mapD list_all3_mapI
[PROOF STATE]
proof (prove)
using this:
list_all3 ?P (map ?f ?xs) (map ?g ?ys) (map ?h ?zs) \<Longrightarrow> list_all3 (\<lambda>x y z. ?P (?f x) (?g y) (?h z)) ?xs ?ys ?zs
list_all3 (\<lambda>x y z. ?P (?f x) (?g y) (?h z)) ?xs ?ys ?zs \<Longrightarrow> list_all3 ?P (map ?f ?xs) (map ?g ?ys) (map ?h ?zs)

goal (1 subgoal):
 1. list_all3 P (map f xs) (map g ys) (map h zs) = list_all3 (\<lambda>x y z. P (f x) (g y) (h z)) xs ys zs
[PROOF STEP]
by blast


[STATEMENT]
lemma length_remdups_concat:
  "length (remdups (concat xss)) = card (\<Union>xs\<in>set xss. set xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (remdups (concat xss)) = card (\<Union> (set ` set xss))
[PROOF STEP]
by (simp add: distinct_card [symmetric])


[STATEMENT]
lemma fps_ln_deriv: "fps_deriv (fps_ln c) = fps_const (1/c) * inverse (1 + fps_X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_deriv (fps_ln c) = fps_const ((1::'a) / c) * inverse (1 + fps_X)
[PROOF STEP]
unfolding fps_inverse_fps_X_plus1
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_deriv (fps_ln c) = fps_const ((1::'a) / c) * Abs_fps ((^) (- (1::'a)))
[PROOF STEP]
by (simp add: fps_ln_def fps_eq_iff del: of_nat_Suc)


[STATEMENT]
lemma translation_assoc:
  fixes a b :: "'a::ab_group_add"
  shows "(\<lambda>x. b + x) ` ((\<lambda>x. a + x) ` S) = (\<lambda>x. (a + b) + x) ` S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (+) b ` (+) a ` S = (+) (a + b) ` S
[PROOF STEP]
by auto


[STATEMENT]
lemma fps_lr_inverse_one:
  fixes x :: "'a::{ab_group_add,mult_zero,one}"
  and   y :: "'b::{comm_monoid_add,mult_zero,uminus,one}"
  shows "fps_left_inverse 1 x = fps_const x"
  and   "fps_right_inverse 1 y = fps_const y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_left_inverse 1 x = fps_const x &&& fps_right_inverse 1 y = fps_const y
[PROOF STEP]
using fps_const_lr_inverse[of 1]
[PROOF STATE]
proof (prove)
using this:
fps_left_inverse (fps_const (1::?'c1)) ?x = fps_const ?x
fps_right_inverse (fps_const (1::?'c1)) ?y = fps_const ?y

goal (1 subgoal):
 1. fps_left_inverse 1 x = fps_const x &&& fps_right_inverse 1 y = fps_const y
[PROOF STEP]
by    simp_all


[STATEMENT]
theorem complement_closure:
  "(\<exists>w. \<not> O w x) \<Longrightarrow> (\<exists>z. \<forall>w. P w z \<longleftrightarrow> \<not> O w x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>w. \<not> O w x \<Longrightarrow> \<exists>z. \<forall>w. P w z = (\<not> O w x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>w. \<not> O w x \<Longrightarrow> \<exists>z. \<forall>w. P w z = (\<not> O w x)
[PROOF STEP]
assume "\<exists>w. \<not> O w x"
[PROOF STATE]
proof (state)
this:
\<exists>w. \<not> O w x

goal (1 subgoal):
 1. \<exists>w. \<not> O w x \<Longrightarrow> \<exists>z. \<forall>w. P w z = (\<not> O w x)
[PROOF STEP]
hence "\<forall>w. P w (u \<ominus> x) \<longleftrightarrow> \<not> O w x"
[PROOF STATE]
proof (prove)
using this:
\<exists>w. \<not> O w x

goal (1 subgoal):
 1. \<forall>w. P w (u \<ominus> x) = (\<not> O w x)
[PROOF STEP]
by (rule universe_difference)
[PROOF STATE]
proof (state)
this:
\<forall>w. P w (u \<ominus> x) = (\<not> O w x)

goal (1 subgoal):
 1. \<exists>w. \<not> O w x \<Longrightarrow> \<exists>z. \<forall>w. P w z = (\<not> O w x)
[PROOF STEP]
thus "\<exists>z. \<forall>w. P w z \<longleftrightarrow> \<not> O w x"
[PROOF STATE]
proof (prove)
using this:
\<forall>w. P w (u \<ominus> x) = (\<not> O w x)

goal (1 subgoal):
 1. \<exists>z. \<forall>w. P w z = (\<not> O w x)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<exists>z. \<forall>w. P w z = (\<not> O w x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma join_commute:  "compatible x y \<Longrightarrow> x \<squnion> y = y \<squnion> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compatible x y \<Longrightarrow> x \<squnion> y = y \<squnion> x
[PROOF STEP]
unfolding compatible_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ex ((<<|) {x, y}) \<Longrightarrow> x \<squnion> y = y \<squnion> x
[PROOF STEP]
unfolding join_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ex ((<<|) {x, y}) \<Longrightarrow> (if Ex ((<<|) {x, y}) then lub {x, y} else x) = (if Ex ((<<|) {y, x}) then lub {y, x} else y)
[PROOF STEP]
by (metis insert_commute)


[STATEMENT]
lemma sum_list_mono:
  fixes f g :: "'a \<Rightarrow> 'b::{monoid_add, ordered_ab_semigroup_add}"
  shows "(\<And>x. x \<in> set xs \<Longrightarrow> f x \<le> g x) \<Longrightarrow> (\<Sum>x\<leftarrow>xs. f x) \<le> (\<Sum>x\<leftarrow>xs. g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> set xs \<Longrightarrow> f x \<le> g x) \<Longrightarrow> sum_list (map f xs) \<le> sum_list (map g xs)
[PROOF STEP]
by (induct xs) (simp, simp add: add_mono)


[STATEMENT]
lemma append_fun_equiv:
   "\<lbrakk> t1' \<sim> t1; t2' \<sim> t2 \<rbrakk> \<Longrightarrow> t1' @ t2' \<sim> t1 @ t2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>t1' \<sim> t1; t2' \<sim> t2\<rbrakk> \<Longrightarrow> t1' @ t2' \<sim> t1 @ t2
[PROOF STEP]
apply (simp add: val_eq_def fun_eq_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>t1' \<lesssim> t1 \<and> t1 \<lesssim> t1'; t2' \<lesssim> t2 \<and> t2 \<lesssim> t2'\<rbrakk> \<Longrightarrow> t1' @ t2' \<lesssim> t1 @ t2 \<and> t1 @ t2 \<lesssim> t1' @ t2'
[PROOF STEP]
using append_fun_le
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?t1' \<lesssim> ?t1.0; ?t2' \<lesssim> ?t2.0\<rbrakk> \<Longrightarrow> ?t1' @ ?t2' \<lesssim> ?t1.0 @ ?t2.0

goal (1 subgoal):
 1. \<lbrakk>t1' \<lesssim> t1 \<and> t1 \<lesssim> t1'; t2' \<lesssim> t2 \<and> t2 \<lesssim> t2'\<rbrakk> \<Longrightarrow> t1' @ t2' \<lesssim> t1 @ t2 \<and> t1 @ t2 \<lesssim> t1' @ t2'
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma not_greater_Max: "\<lbrakk> finite A; Max A < k \<rbrakk>  \<Longrightarrow> k \<notin> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; Max A < k\<rbrakk> \<Longrightarrow> k \<notin> A
[PROOF STEP]
apply (rule ccontr, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; Max A < k; k \<in> A\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (frule Max_ge[of A k], blast)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; Max A < k; k \<in> A; k \<le> Max A\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (frule order_le_less_trans[of _ _ k], blast)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; Max A < k; k \<in> A; k \<le> Max A; k < k\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma image_mset_set_subst_inside:
  assumes "finite S"
  assumes "i\<in>S"
  shows "image_mset (f(i:=x)) (mset_set S) = image_mset f (mset_set S) + {#x#} - {#f i#} "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. image_mset (f(i := x)) (mset_set S) = image_mset f (mset_set S) + {#x#} - {#f i#}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite S
i \<in> S

goal (1 subgoal):
 1. image_mset (f(i := x)) (mset_set S) = image_mset f (mset_set S) + {#x#} - {#f i#}
[PROOF STEP]
by (induction rule: finite_induct) (auto simp: image_mset_subst_outside)


[STATEMENT]
lemma ceiling_less_iff: "\<lceil>x\<rceil> < z \<longleftrightarrow> x \<le> of_int z - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lceil>x\<rceil> < z) = (x \<le> of_int z - (1::'a))
[PROOF STEP]
using ceiling_le_iff [of x "z - 1"]
[PROOF STATE]
proof (prove)
using this:
(\<lceil>x\<rceil> \<le> z - 1) = (x \<le> of_int (z - 1))

goal (1 subgoal):
 1. (\<lceil>x\<rceil> < z) = (x \<le> of_int z - (1::'a))
[PROOF STEP]
by simp


[STATEMENT]
lemma continuous_on_arcsin [continuous_intros]:
  "continuous_on s f \<Longrightarrow> (\<forall>x\<in>s. -1 \<le> f x \<and> f x \<le> 1) \<Longrightarrow> continuous_on s (\<lambda>x. arcsin (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>continuous_on s f; \<forall>x\<in>s. - 1 \<le> f x \<and> f x \<le> 1\<rbrakk> \<Longrightarrow> continuous_on s (\<lambda>x. arcsin (f x))
[PROOF STEP]
using continuous_on_compose[of s f, OF _ continuous_on_subset[OF  continuous_on_arcsin']]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>continuous_on s f; f ` s \<subseteq> {- 1..1}\<rbrakk> \<Longrightarrow> continuous_on s (arcsin \<circ> f)

goal (1 subgoal):
 1. \<lbrakk>continuous_on s f; \<forall>x\<in>s. - 1 \<le> f x \<and> f x \<le> 1\<rbrakk> \<Longrightarrow> continuous_on s (\<lambda>x. arcsin (f x))
[PROOF STEP]
by (auto simp: comp_def subset_eq)


[STATEMENT]
lemma suminf_add: "summable f \<Longrightarrow> summable g \<Longrightarrow> suminf f + suminf g = (\<Sum>n. f n + g n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>summable f; summable g\<rbrakk> \<Longrightarrow> suminf f + suminf g = (\<Sum>n. f n + g n)
[PROOF STEP]
by (intro sums_unique sums_add summable_sums)


[STATEMENT]
lemma size_le_1: "size f \<le> 1 = (f = {||} \<or> (\<exists>e. f = {|e|}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (size f \<le> 1) = (f = {||} \<or> (\<exists>e. f = {|e|}))
[PROOF STEP]
apply standard
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. size f \<le> 1 \<Longrightarrow> f = {||} \<or> (\<exists>e. f = {|e|})
 2. f = {||} \<or> (\<exists>e. f = {|e|}) \<Longrightarrow> size f \<le> 1
[PROOF STEP]
apply (metis bot.not_eq_extremum gr_implies_not0 le_neq_implies_less less_one size_fsingleton size_fsubset)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f = {||} \<or> (\<exists>e. f = {|e|}) \<Longrightarrow> size f \<le> 1
[PROOF STEP]
by auto


[STATEMENT]
lemma insort_fst_delete: "\<lbrakk> fst x \<noteq> k2; sorted (List.map fst xs) \<rbrakk>
  \<Longrightarrow> insort_key fst x (AList.delete k2 xs) = AList.delete k2 (insort_key fst x xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>fst x \<noteq> k2; sorted (list.map fst xs)\<rbrakk> \<Longrightarrow> insort_key fst x (AList.delete k2 xs) = AList.delete k2 (insort_key fst x xs)
[PROOF STEP]
by (induction xs) (fastforce simp add: insort_is_Cons order_trans)+


[STATEMENT]
lemma valid_path_imp_reverse:
  assumes "valid_path g"
    shows "valid_path(reversepath g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valid_path (reversepath g)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. valid_path (reversepath g)
[PROOF STEP]
obtain S where "finite S" and S: "g C1_differentiable_on ({0..1} - S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>S. \<lbrakk>finite S; g C1_differentiable_on {0..1} - S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
valid_path g

goal (1 subgoal):
 1. (\<And>S. \<lbrakk>finite S; g C1_differentiable_on {0..1} - S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: valid_path_def piecewise_C1_differentiable_on_def)
[PROOF STATE]
proof (state)
this:
finite S
g C1_differentiable_on {0..1} - S

goal (1 subgoal):
 1. valid_path (reversepath g)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite S
g C1_differentiable_on {0..1} - S
[PROOF STEP]
have "finite ((-) 1 ` S)"
[PROOF STATE]
proof (prove)
using this:
finite S
g C1_differentiable_on {0..1} - S

goal (1 subgoal):
 1. finite ((-) 1 ` S)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite ((-) 1 ` S)

goal (1 subgoal):
 1. valid_path (reversepath g)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite ((-) 1 ` S)

goal (1 subgoal):
 1. valid_path (reversepath g)
[PROOF STEP]
have "(reversepath g C1_differentiable_on ({0..1} - (-) 1 ` S))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. reversepath g C1_differentiable_on {0..1} - (-) 1 ` S
[PROOF STEP]
unfolding reversepath_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. g (1 - x)) C1_differentiable_on {0..1} - (-) 1 ` S
[PROOF STEP]
apply (rule C1_differentiable_compose [of "\<lambda>x::real. 1-x" _ g, unfolded o_def])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. (-) 1 C1_differentiable_on {0..1} - (-) 1 ` S
 2. g C1_differentiable_on (-) 1 ` ({0..1} - (-) 1 ` S)
 3. \<And>x. finite (({0..1} - (-) 1 ` S) \<inter> (-) 1 -` {x})
[PROOF STEP]
using S
[PROOF STATE]
proof (prove)
using this:
g C1_differentiable_on {0..1} - S

goal (3 subgoals):
 1. (-) 1 C1_differentiable_on {0..1} - (-) 1 ` S
 2. g C1_differentiable_on (-) 1 ` ({0..1} - (-) 1 ` S)
 3. \<And>x. finite (({0..1} - (-) 1 ` S) \<inter> (-) 1 -` {x})
[PROOF STEP]
by (force simp: finite_vimageI inj_on_def C1_differentiable_on_eq elim!: continuous_on_subset)+
[PROOF STATE]
proof (state)
this:
reversepath g C1_differentiable_on {0..1} - (-) 1 ` S

goal (1 subgoal):
 1. valid_path (reversepath g)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
finite ((-) 1 ` S)
reversepath g C1_differentiable_on {0..1} - (-) 1 ` S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite ((-) 1 ` S)
reversepath g C1_differentiable_on {0..1} - (-) 1 ` S

goal (1 subgoal):
 1. valid_path (reversepath g)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite ((-) 1 ` S)
reversepath g C1_differentiable_on {0..1} - (-) 1 ` S
valid_path g

goal (1 subgoal):
 1. valid_path (reversepath g)
[PROOF STEP]
by (auto simp: valid_path_def piecewise_C1_differentiable_on_def path_def [symmetric])
[PROOF STATE]
proof (state)
this:
valid_path (reversepath g)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma quotient_map_product_projection:
  assumes "i \<in> I"
  shows "quotient_map(product_topology X I) (X i) (\<lambda>x. x i) \<longleftrightarrow>
           (topspace(product_topology X I) = {} \<longrightarrow> topspace(X i) = {})"
         (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. quotient_map (product_topology X I) (X i) (\<lambda>x. x i) = (topspace (product_topology X I) = {} \<longrightarrow> topspace (X i) = {})
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. quotient_map (product_topology X I) (X i) (\<lambda>x. x i) \<Longrightarrow> topspace (product_topology X I) = {} \<longrightarrow> topspace (X i) = {}
 2. topspace (product_topology X I) = {} \<longrightarrow> topspace (X i) = {} \<Longrightarrow> quotient_map (product_topology X I) (X i) (\<lambda>x. x i)
[PROOF STEP]
assume ?lhs
[PROOF STATE]
proof (state)
this:
quotient_map (product_topology X I) (X i) (\<lambda>x. x i)

goal (2 subgoals):
 1. quotient_map (product_topology X I) (X i) (\<lambda>x. x i) \<Longrightarrow> topspace (product_topology X I) = {} \<longrightarrow> topspace (X i) = {}
 2. topspace (product_topology X I) = {} \<longrightarrow> topspace (X i) = {} \<Longrightarrow> quotient_map (product_topology X I) (X i) (\<lambda>x. x i)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
i \<in> I
quotient_map (product_topology X I) (X i) (\<lambda>x. x i)
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
i \<in> I
quotient_map (product_topology X I) (X i) (\<lambda>x. x i)

goal (1 subgoal):
 1. topspace (product_topology X I) = {} \<longrightarrow> topspace (X i) = {}
[PROOF STEP]
by (auto simp: continuous_open_quotient_map open_map_product_projection)
[PROOF STATE]
proof (state)
this:
topspace (product_topology X I) = {} \<longrightarrow> topspace (X i) = {}

goal (1 subgoal):
 1. topspace (product_topology X I) = {} \<longrightarrow> topspace (X i) = {} \<Longrightarrow> quotient_map (product_topology X I) (X i) (\<lambda>x. x i)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. topspace (product_topology X I) = {} \<longrightarrow> topspace (X i) = {} \<Longrightarrow> quotient_map (product_topology X I) (X i) (\<lambda>x. x i)
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
topspace (product_topology X I) = {} \<longrightarrow> topspace (X i) = {}

goal (1 subgoal):
 1. topspace (product_topology X I) = {} \<longrightarrow> topspace (X i) = {} \<Longrightarrow> quotient_map (product_topology X I) (X i) (\<lambda>x. x i)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
i \<in> I
topspace (product_topology X I) = {} \<longrightarrow> topspace (X i) = {}
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
using this:
i \<in> I
topspace (product_topology X I) = {} \<longrightarrow> topspace (X i) = {}

goal (1 subgoal):
 1. quotient_map (product_topology X I) (X i) (\<lambda>x. x i)
[PROOF STEP]
by (auto simp: Abstract_Topology.retraction_imp_quotient_map retraction_map_product_projection)
[PROOF STATE]
proof (state)
this:
quotient_map (product_topology X I) (X i) (\<lambda>x. x i)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma times_iff [simp]: "\<langle>a,b\<rangle> \<in> elts (vtimes A B) \<longleftrightarrow> a \<in> elts A \<and> b \<in> elts B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<langle>a, b\<rangle> \<in> elts (vtimes A B)) = (a \<in> elts A \<and> b \<in> elts B)
[PROOF STEP]
by simp