[STATEMENT]
lemma has_derivative_compose:
  "(f has_derivative f') (at x within s) \<Longrightarrow> (g has_derivative g') (at (f x)) \<Longrightarrow>
  ((\<lambda>x. g (f x)) has_derivative (\<lambda>x. g' (f' x))) (at x within s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(f has_derivative f') (at x within s); (g has_derivative g') (at (f x))\<rbrakk> \<Longrightarrow> ((\<lambda>x. g (f x)) has_derivative (\<lambda>x. g' (f' x))) (at x within s)
[PROOF STEP]
by (blast intro: has_derivative_in_compose has_derivative_subset)


[STATEMENT]
lemma wfP_multp: "wfP r \<Longrightarrow> wfP (multp r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wfP r \<Longrightarrow> wfP (multp r)
[PROOF STEP]
unfolding multp_def wfP_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf {(x, y). r x y} \<Longrightarrow> wf {(M, N). (M, N) \<in> mult {(x, y). r x y}}
[PROOF STEP]
by (simp add: wf_mult)


[STATEMENT]
lemma wfP_lstrict_prefix: "wfP lstrict_prefix"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wfP lstrict_prefix
[PROOF STEP]
proof(unfold wfP_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. wf {(x, y). lstrict_prefix x y}
[PROOF STEP]
have "wf {(x :: enat, y). x < y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf {(x, y). x < y}
[PROOF STEP]
unfolding wf_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>P. (\<forall>x. (\<forall>y. (y, x) \<in> {(x, y). x < y} \<longrightarrow> P y) \<longrightarrow> P x) \<longrightarrow> All P
[PROOF STEP]
by(blast intro: less_induct)
[PROOF STATE]
proof (state)
this:
wf {(x, y). x < y}

goal (1 subgoal):
 1. wf {(x, y). lstrict_prefix x y}
[PROOF STEP]
hence "wf (inv_image {(x, y). x < y} llength)"
[PROOF STATE]
proof (prove)
using this:
wf {(x, y). x < y}

goal (1 subgoal):
 1. wf (inv_image {(x, y). x < y} llength)
[PROOF STEP]
by(rule wf_inv_image)
[PROOF STATE]
proof (state)
this:
wf (inv_image {(x, y). x < y} llength)

goal (1 subgoal):
 1. wf {(x, y). lstrict_prefix x y}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
wf (inv_image {(x, y). x < y} llength)

goal (1 subgoal):
 1. wf {(x, y). lstrict_prefix x y}
[PROOF STEP]
have "{(xs, ys). lstrict_prefix xs ys} \<subseteq> inv_image {(x, y). x < y} llength"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(xs, ys). lstrict_prefix xs ys} \<subseteq> inv_image {(x, y). x < y} llength
[PROOF STEP]
by(auto intro: lstrict_prefix_llength_less)
[PROOF STATE]
proof (state)
this:
{(xs, ys). lstrict_prefix xs ys} \<subseteq> inv_image {(x, y). x < y} llength

goal (1 subgoal):
 1. wf {(x, y). lstrict_prefix x y}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
wf (inv_image {(x, y). x < y} llength)
{(xs, ys). lstrict_prefix xs ys} \<subseteq> inv_image {(x, y). x < y} llength
[PROOF STEP]
show "wf {(xs, ys). lstrict_prefix xs ys}"
[PROOF STATE]
proof (prove)
using this:
wf (inv_image {(x, y). x < y} llength)
{(xs, ys). lstrict_prefix xs ys} \<subseteq> inv_image {(x, y). x < y} llength

goal (1 subgoal):
 1. wf {(xs, ys). lstrict_prefix xs ys}
[PROOF STEP]
by(rule wf_subset)
[PROOF STATE]
proof (state)
this:
wf {(xs, ys). lstrict_prefix xs ys}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ideal_field_cases:
  obtains "ideal B = {0}" | "ideal (B::'a::field set) = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ideal B = {0::'a} \<Longrightarrow> thesis; ideal B = UNIV \<Longrightarrow> thesis\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
proof (cases "ideal B = {0}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>ideal B = {0::'a} \<Longrightarrow> thesis; ideal B = UNIV \<Longrightarrow> thesis; ideal B = {0::'a}\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>ideal B = {0::'a} \<Longrightarrow> thesis; ideal B = UNIV \<Longrightarrow> thesis; ideal B \<noteq> {0::'a}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
ideal B = {0::'a}

goal (2 subgoals):
 1. \<lbrakk>ideal B = {0::'a} \<Longrightarrow> thesis; ideal B = UNIV \<Longrightarrow> thesis; ideal B = {0::'a}\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>ideal B = {0::'a} \<Longrightarrow> thesis; ideal B = UNIV \<Longrightarrow> thesis; ideal B \<noteq> {0::'a}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
ideal B = {0::'a}

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

goal (1 subgoal):
 1. \<lbrakk>ideal B = {0::'a} \<Longrightarrow> thesis; ideal B = UNIV \<Longrightarrow> thesis; ideal B \<noteq> {0::'a}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>ideal B = {0::'a} \<Longrightarrow> thesis; ideal B = UNIV \<Longrightarrow> thesis; ideal B \<noteq> {0::'a}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
ideal B \<noteq> {0::'a}

goal (1 subgoal):
 1. \<lbrakk>ideal B = {0::'a} \<Longrightarrow> thesis; ideal B = UNIV \<Longrightarrow> thesis; ideal B \<noteq> {0::'a}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
hence "\<not> B \<subseteq> {0}"
[PROOF STATE]
proof (prove)
using this:
ideal B \<noteq> {0::'a}

goal (1 subgoal):
 1. \<not> B \<subseteq> {0::'a}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<not> B \<subseteq> {0::'a}

goal (1 subgoal):
 1. \<lbrakk>ideal B = {0::'a} \<Longrightarrow> thesis; ideal B = UNIV \<Longrightarrow> thesis; ideal B \<noteq> {0::'a}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> B \<subseteq> {0::'a}
[PROOF STEP]
obtain b where "b \<in> B" and "b \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
\<not> B \<subseteq> {0::'a}

goal (1 subgoal):
 1. (\<And>b. \<lbrakk>b \<in> B; b \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
b \<in> B
b \<noteq> (0::'a)

goal (1 subgoal):
 1. \<lbrakk>ideal B = {0::'a} \<Longrightarrow> thesis; ideal B = UNIV \<Longrightarrow> thesis; ideal B \<noteq> {0::'a}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
from this(1)
[PROOF STATE]
proof (chain)
picking this:
b \<in> B
[PROOF STEP]
have "b \<in> ideal B"
[PROOF STATE]
proof (prove)
using this:
b \<in> B

goal (1 subgoal):
 1. b \<in> ideal B
[PROOF STEP]
by (rule ideal.span_base)
[PROOF STATE]
proof (state)
this:
b \<in> ideal B

goal (1 subgoal):
 1. \<lbrakk>ideal B = {0::'a} \<Longrightarrow> thesis; ideal B = UNIV \<Longrightarrow> thesis; ideal B \<noteq> {0::'a}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
hence "inverse b * b \<in> ideal B"
[PROOF STATE]
proof (prove)
using this:
b \<in> ideal B

goal (1 subgoal):
 1. inverse b * b \<in> ideal B
[PROOF STEP]
by (rule ideal.span_scale)
[PROOF STATE]
proof (state)
this:
inverse b * b \<in> ideal B

goal (1 subgoal):
 1. \<lbrakk>ideal B = {0::'a} \<Longrightarrow> thesis; ideal B = UNIV \<Longrightarrow> thesis; ideal B \<noteq> {0::'a}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
with \<open>b \<noteq> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
b \<noteq> (0::'a)
inverse b * b \<in> ideal B
[PROOF STEP]
have "ideal B = UNIV"
[PROOF STATE]
proof (prove)
using this:
b \<noteq> (0::'a)
inverse b * b \<in> ideal B

goal (1 subgoal):
 1. ideal B = UNIV
[PROOF STEP]
by (simp add: ideal_eq_UNIV_iff_contains_one)
[PROOF STATE]
proof (state)
this:
ideal B = UNIV

goal (1 subgoal):
 1. \<lbrakk>ideal B = {0::'a} \<Longrightarrow> thesis; ideal B = UNIV \<Longrightarrow> thesis; ideal B \<noteq> {0::'a}\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
ideal B = UNIV

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma unbounded_Greater:
  assumes "valid_region X k I r" "c \<in> X" "unbounded c (region X I r)"
  shows "I c = Greater (k c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. I c = Regions.intv.Greater (k c)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Regions.valid_region X k I r
c \<in> X
unbounded c (Regions.region X I r)

goal (1 subgoal):
 1. I c = Regions.intv.Greater (k c)
[PROOF STEP]
unfolding unbounded_def
[PROOF STATE]
proof (prove)
using this:
Regions.valid_region X k I r
c \<in> X
\<forall>t. \<exists>u\<in>Regions.region X I r. t < u c

goal (1 subgoal):
 1. I c = Regions.intv.Greater (k c)
[PROOF STEP]
by (auto intro: gt_GreaterD)


[STATEMENT]
lemma iSPEC_rule: "(\<And>x. \<Phi> x \<Longrightarrow> \<Psi> x) \<Longrightarrow> SPEC \<Phi> \<le> SPEC \<Psi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. \<Phi> x \<Longrightarrow> \<Psi> x) \<Longrightarrow> SPEC \<Phi> \<le> SPEC \<Psi>
[PROOF STEP]
unfolding iSPEC_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. \<Phi> x \<Longrightarrow> \<Psi> x) \<Longrightarrow> Sup {return x |x. \<Phi> x} \<le> Sup {return x |x. \<Psi> x}
[PROOF STEP]
by (auto intro: Sup_mono)


[STATEMENT]
lemma betweenI:
  assumes "0 \<le> u" "u \<le> 1" "x = (1 - u) *\<^sub>R a + u *\<^sub>R b"
  shows "between (a, b) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. between (a, b) x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 \<le> u
u \<le> 1
x = (1 - u) *\<^sub>R a + u *\<^sub>R b

goal (1 subgoal):
 1. between (a, b) x
[PROOF STEP]
unfolding between_def closed_segment_def
[PROOF STATE]
proof (prove)
using this:
0 \<le> u
u \<le> 1
x = (1 - u) *\<^sub>R a + u *\<^sub>R b

goal (1 subgoal):
 1. (case (a, b) of (a, b) \<Rightarrow> \<lambda>x. x \<in> {(1 - u) *\<^sub>R a + u *\<^sub>R b |u. 0 \<le> u \<and> u \<le> 1}) x
[PROOF STEP]
by auto


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

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

goal (1 subgoal):
 1. lc (monom_mult c t p) = c * lc p
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
lc (monom_mult c t p) = c * lc p

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

goal (1 subgoal):
 1. c \<noteq> (0::'b) \<Longrightarrow> lc (monom_mult c t p) = c * lc p
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lc (monom_mult c t p) = c * lc p
[PROOF STEP]
proof (cases "p = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. p = 0 \<Longrightarrow> lc (monom_mult c t p) = c * lc p
 2. p \<noteq> 0 \<Longrightarrow> lc (monom_mult c t p) = c * lc p
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
p = 0

goal (2 subgoals):
 1. p = 0 \<Longrightarrow> lc (monom_mult c t p) = c * lc p
 2. p \<noteq> 0 \<Longrightarrow> lc (monom_mult c t p) = c * lc p
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
p = 0

goal (1 subgoal):
 1. lc (monom_mult c t p) = c * lc p
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
lc (monom_mult c t p) = c * lc p

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> lc (monom_mult c t p) = c * lc p
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> lc (monom_mult c t p) = c * lc p
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
p \<noteq> 0

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> lc (monom_mult c t p) = c * lc p
[PROOF STEP]
with \<open>c \<noteq> 0\<close>
[PROOF STATE]
proof (chain)
picking this:
c \<noteq> (0::'b)
p \<noteq> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
c \<noteq> (0::'b)
p \<noteq> 0

goal (1 subgoal):
 1. lc (monom_mult c t p) = c * lc p
[PROOF STEP]
by (simp add: lc_def lt_monom_mult lookup_monom_mult_plus)
[PROOF STATE]
proof (state)
this:
lc (monom_mult c t p) = c * lc p

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
lc (monom_mult c t p) = c * lc p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma connected_Un: "connected s \<Longrightarrow> connected t \<Longrightarrow> s \<inter> t \<noteq> {} \<Longrightarrow> connected (s \<union> t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>connected s; connected t; s \<inter> t \<noteq> {}\<rbrakk> \<Longrightarrow> connected (s \<union> t)
[PROOF STEP]
using connected_Union [of "{s,t}"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>sa. sa \<in> {s, t} \<Longrightarrow> connected sa; \<Inter> {s, t} \<noteq> {}\<rbrakk> \<Longrightarrow> connected (\<Union> {s, t})

goal (1 subgoal):
 1. \<lbrakk>connected s; connected t; s \<inter> t \<noteq> {}\<rbrakk> \<Longrightarrow> connected (s \<union> t)
[PROOF STEP]
by auto


[STATEMENT]
lemma set_update_with_aux:
  "distinct (map fst xs) \<Longrightarrow>
    set (update_with_aux v k f xs) =
      (set xs - {k} \<times> UNIV \<union> {(k, f (case map_of xs k of None \<Rightarrow> v | Some v \<Rightarrow> v))})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (map fst xs) \<Longrightarrow> set (update_with_aux v k f xs) = set xs - {k} \<times> UNIV \<union> {(k, f (case map_of xs k of None \<Rightarrow> v | Some v \<Rightarrow> v))}
[PROOF STEP]
by (induct xs) (auto intro: rev_image_eqI)


[STATEMENT]
lemma res_ring_car:
"carrier (Zp_res_ring k) = {0..p ^ k - 1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. carrier (residue_ring (p ^ k)) = {0..p ^ k - 1}
[PROOF STEP]
unfolding residue_ring_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. carrier \<lparr>carrier = {0..p ^ k - 1}, monoid.mult = \<lambda>x y. x * y mod p ^ k, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod p ^ k\<rparr> = {0..p ^ k - 1}
[PROOF STEP]
by simp


[STATEMENT]
lemma find_min_idx_SomeD_complete:
    "find_min_idx P l = Some i \<Longrightarrow> (P (l!i) \<and> i < length l \<and> (\<forall>j<i. \<not>P (l!j)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. find_min_idx P l = Some i \<Longrightarrow> P (l ! i) \<and> i < length l \<and> (\<forall>j<i. \<not> P (l ! j))
[PROOF STEP]
apply (induction l arbitrary: i)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i. find_min_idx P [] = Some i \<Longrightarrow> P ([] ! i) \<and> i < length [] \<and> (\<forall>j<i. \<not> P ([] ! j))
 2. \<And>a l i. \<lbrakk>\<And>i. find_min_idx P l = Some i \<Longrightarrow> P (l ! i) \<and> i < length l \<and> (\<forall>j<i. \<not> P (l ! j)); find_min_idx P (a # l) = Some i\<rbrakk> \<Longrightarrow> P ((a # l) ! i) \<and> i < length (a # l) \<and> (\<forall>j<i. \<not> P ((a # l) ! j))
[PROOF STEP]
apply (auto split: if_split_asm)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a l z j. \<lbrakk>\<not> P a; find_min_idx P l = Some z; j < Suc z; P ((a # l) ! j); P (l ! z); z < length l; \<forall>j<z. \<not> P (l ! j)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (case_tac j)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a l z j. \<lbrakk>\<not> P a; find_min_idx P l = Some z; j < Suc z; P ((a # l) ! j); P (l ! z); z < length l; \<forall>j<z. \<not> P (l ! j); j = 0\<rbrakk> \<Longrightarrow> False
 2. \<And>a l z j nat. \<lbrakk>\<not> P a; find_min_idx P l = Some z; j < Suc z; P ((a # l) ! j); P (l ! z); z < length l; \<forall>j<z. \<not> P (l ! j); j = Suc nat\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma inv_tr_card_min:
  assumes "inv_translation r"
  shows "card r \<ge> 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 \<le> card r
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 2 \<le> card r
[PROOF STEP]
note [simp] = inv_translation_def
[PROOF STATE]
proof (state)
this:
inv_translation ?r \<equiv> {0..<card ?r} = ?r \<and> {0, 1} \<subseteq> ?r

goal (1 subgoal):
 1. 2 \<le> card r
[PROOF STEP]
have "{0..<x} = r \<Longrightarrow> 2 \<le> x \<longleftrightarrow> 0 \<in> r \<and> 1 \<in> r" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {0..<x} = r \<Longrightarrow> (2 \<le> x) = (0 \<in> r \<and> 1 \<in> r)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{0..<?x} = r \<Longrightarrow> (2 \<le> ?x) = (0 \<in> r \<and> 1 \<in> r)

goal (1 subgoal):
 1. 2 \<le> card r
[PROOF STEP]
thus ge2:"card r\<ge>2"
[PROOF STATE]
proof (prove)
using this:
{0..<?x} = r \<Longrightarrow> (2 \<le> ?x) = (0 \<in> r \<and> 1 \<in> r)

goal (1 subgoal):
 1. 2 \<le> card r
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
{0..<?x} = r \<Longrightarrow> (2 \<le> ?x) = (0 \<in> r \<and> 1 \<in> r)
inv_translation r

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma AbstFormP_subst [simp]:
     "(AbstFormP v i x x')(j::=t) = AbstFormP (subst j t v) (subst j t i) (subst j t x) (subst j t x')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (AbstFormP v i x x')(j::=t) = AbstFormP (subst j t v) (subst j t i) (subst j t x) (subst j t x')
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (AbstFormP v i x x')(j::=t) = AbstFormP (subst j t v) (subst j t i) (subst j t x) (subst j t x')
[PROOF STEP]
obtain s::name and k::name  where "atom s \<sharp> (v,i,x,x',t,j,k)" "atom k \<sharp> (v,i,x,x',t,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>s k. \<lbrakk>atom s \<sharp> (v, i, x, x', t, j, k); atom k \<sharp> (v, i, x, x', t, j)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis obtain_fresh)
[PROOF STATE]
proof (state)
this:
atom s \<sharp> (v, i, x, x', t, j, k)
atom k \<sharp> (v, i, x, x', t, j)

goal (1 subgoal):
 1. (AbstFormP v i x x')(j::=t) = AbstFormP (subst j t v) (subst j t i) (subst j t x) (subst j t x')
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
atom s \<sharp> (v, i, x, x', t, j, k)
atom k \<sharp> (v, i, x, x', t, j)

goal (1 subgoal):
 1. (AbstFormP v i x x')(j::=t) = AbstFormP (subst j t v) (subst j t i) (subst j t x) (subst j t x')
[PROOF STEP]
by (auto simp: AbstFormP.simps [of s _ _ _ _ k])
[PROOF STATE]
proof (state)
this:
(AbstFormP v i x x')(j::=t) = AbstFormP (subst j t v) (subst j t i) (subst j t x) (subst j t x')

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lists_length_eq_Suc_eq_image_Cons:
  "{xs. set xs \<subseteq> A \<and> length xs = Suc n} = (\<lambda>(x, xs). x#xs) ` (A \<times> {xs. set xs \<subseteq> A \<and> length xs = n})"
  (is "?A = ?B")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {xs. set xs \<subseteq> A \<and> length xs = Suc n} = (\<lambda>(x, xs). x # xs) ` (A \<times> {xs. set xs \<subseteq> A \<and> length xs = n})
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {xs. set xs \<subseteq> A \<and> length xs = Suc n} \<subseteq> (\<lambda>(x, xs). x # xs) ` (A \<times> {xs. set xs \<subseteq> A \<and> length xs = n})
 2. (\<lambda>(x, xs). x # xs) ` (A \<times> {xs. set xs \<subseteq> A \<and> length xs = n}) \<subseteq> {xs. set xs \<subseteq> A \<and> length xs = Suc n}
[PROOF STEP]
show "?A \<subseteq> ?B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {xs. set xs \<subseteq> A \<and> length xs = Suc n} \<subseteq> (\<lambda>(x, xs). x # xs) ` (A \<times> {xs. set xs \<subseteq> A \<and> length xs = n})
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {xs. set xs \<subseteq> A \<and> length xs = Suc n} \<Longrightarrow> x \<in> (\<lambda>(x, xs). x # xs) ` (A \<times> {xs. set xs \<subseteq> A \<and> length xs = n})
[PROOF STEP]
fix xs
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {xs. set xs \<subseteq> A \<and> length xs = Suc n} \<Longrightarrow> x \<in> (\<lambda>(x, xs). x # xs) ` (A \<times> {xs. set xs \<subseteq> A \<and> length xs = n})
[PROOF STEP]
assume "xs \<in> ?A"
[PROOF STATE]
proof (state)
this:
xs \<in> {xs. set xs \<subseteq> A \<and> length xs = Suc n}

goal (1 subgoal):
 1. \<And>x. x \<in> {xs. set xs \<subseteq> A \<and> length xs = Suc n} \<Longrightarrow> x \<in> (\<lambda>(x, xs). x # xs) ` (A \<times> {xs. set xs \<subseteq> A \<and> length xs = n})
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
xs \<in> {xs. set xs \<subseteq> A \<and> length xs = Suc n}
[PROOF STEP]
show "xs \<in> ?B"
[PROOF STATE]
proof (prove)
using this:
xs \<in> {xs. set xs \<subseteq> A \<and> length xs = Suc n}

goal (1 subgoal):
 1. xs \<in> (\<lambda>(x, xs). x # xs) ` (A \<times> {xs. set xs \<subseteq> A \<and> length xs = n})
[PROOF STEP]
by (cases xs) auto
[PROOF STATE]
proof (state)
this:
xs \<in> (\<lambda>(x, xs). x # xs) ` (A \<times> {xs. set xs \<subseteq> A \<and> length xs = n})

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
{xs. set xs \<subseteq> A \<and> length xs = Suc n} \<subseteq> (\<lambda>(x, xs). x # xs) ` (A \<times> {xs. set xs \<subseteq> A \<and> length xs = n})

goal (1 subgoal):
 1. (\<lambda>(x, xs). x # xs) ` (A \<times> {xs. set xs \<subseteq> A \<and> length xs = n}) \<subseteq> {xs. set xs \<subseteq> A \<and> length xs = Suc n}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>(x, xs). x # xs) ` (A \<times> {xs. set xs \<subseteq> A \<and> length xs = n}) \<subseteq> {xs. set xs \<subseteq> A \<and> length xs = Suc n}
[PROOF STEP]
show "?B \<subseteq> ?A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>(x, xs). x # xs) ` (A \<times> {xs. set xs \<subseteq> A \<and> length xs = n}) \<subseteq> {xs. set xs \<subseteq> A \<and> length xs = Suc n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>(x, xs). x # xs) ` (A \<times> {xs. set xs \<subseteq> A \<and> length xs = n}) \<subseteq> {xs. set xs \<subseteq> A \<and> length xs = Suc n}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Rdual:
  assumes major: "\<And>S. S \<subseteq> A \<Longrightarrow> \<exists>L. isLub S po L" and "S \<subseteq> A" and "A = pset po"
  shows "\<exists>G. isGlb S po G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>G. isGlb S po G
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. isGlb S po ?G
[PROOF STEP]
show "isGlb S po (lub {y \<in> A. \<forall>k\<in>S. (y, k) \<in> order po} po)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isGlb S po (lub {y \<in> A. \<forall>k\<in>S. (y, k) \<in> order po} po)
[PROOF STEP]
using major [of "{y. y \<in> A \<and> (\<forall>k \<in> S. (y, k) \<in> order po)}"] \<open>S \<subseteq> A\<close> \<open>A = pset po\<close>
[PROOF STATE]
proof (prove)
using this:
{y \<in> A. \<forall>k\<in>S. (y, k) \<in> order po} \<subseteq> A \<Longrightarrow> \<exists>L. isLub {y \<in> A. \<forall>k\<in>S. (y, k) \<in> order po} po L
S \<subseteq> A
A = pset po

goal (1 subgoal):
 1. isGlb S po (lub {y \<in> A. \<forall>k\<in>S. (y, k) \<in> order po} po)
[PROOF STEP]
apply (simp add: isLub_lub isGlb_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>isLub {y \<in> pset po. \<forall>k\<in>S. (y, k) \<in> order po} po (lub {y \<in> pset po. \<forall>k\<in>S. (y, k) \<in> order po} po); S \<subseteq> pset po; A = pset po\<rbrakk> \<Longrightarrow> lub {y \<in> pset po. \<forall>k\<in>S. (y, k) \<in> order po} po \<in> pset po \<and> (\<forall>y\<in>S. (lub {y \<in> pset po. \<forall>k\<in>S. (y, k) \<in> order po} po, y) \<in> order po) \<and> (\<forall>z\<in>pset po. (\<forall>y\<in>S. (z, y) \<in> order po) \<longrightarrow> (z, lub {y \<in> pset po. \<forall>k\<in>S. (y, k) \<in> order po} po) \<in> order po)
[PROOF STEP]
apply (auto simp add: isLub_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
isGlb S po (lub {y \<in> A. \<forall>k\<in>S. (y, k) \<in> order po} po)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma S_O_S: "S O S \<subseteq> S" "S O S O T \<subseteq> S O T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S O S \<subseteq> S &&& S O S O T \<subseteq> S O T
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. S O S \<subseteq> S
 2. S O S O T \<subseteq> S O T
[PROOF STEP]
show "S O S \<subseteq> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S O S \<subseteq> S
[PROOF STEP]
by (fact trans_O_subset[OF trans_S])
[PROOF STATE]
proof (state)
this:
S O S \<subseteq> S

goal (1 subgoal):
 1. S O S O T \<subseteq> S O T
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
S O S \<subseteq> S
[PROOF STEP]
show "S O S O T \<subseteq> S O T"
[PROOF STATE]
proof (prove)
using this:
S O S \<subseteq> S

goal (1 subgoal):
 1. S O S O T \<subseteq> S O T
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
S O S O T \<subseteq> S O T

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma natural_eqI:
  "nat_of_natural m = nat_of_natural n \<Longrightarrow> m = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat_of_natural m = nat_of_natural n \<Longrightarrow> m = n
[PROOF STEP]
using natural_eq_iff [of m n]
[PROOF STATE]
proof (prove)
using this:
(m = n) = (nat_of_natural m = nat_of_natural n)

goal (1 subgoal):
 1. nat_of_natural m = nat_of_natural n \<Longrightarrow> m = n
[PROOF STEP]
by simp


[STATEMENT]
theorem Cantor: "\<nexists>f :: 'a \<Rightarrow> 'a set. \<forall>A. \<exists>x. A = f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<nexists>f. \<forall>A. \<exists>x. A = f x
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f. \<forall>A. \<exists>x. A = f x \<Longrightarrow> False
[PROOF STEP]
assume "\<exists>f :: 'a \<Rightarrow> 'a set. \<forall>A. \<exists>x. A = f x"
[PROOF STATE]
proof (state)
this:
\<exists>f. \<forall>A. \<exists>x. A = f x

goal (1 subgoal):
 1. \<exists>f. \<forall>A. \<exists>x. A = f x \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>f. \<forall>A. \<exists>x. A = f x
[PROOF STEP]
obtain f :: "'a \<Rightarrow> 'a set" where *: "\<forall>A. \<exists>x. A = f x"
[PROOF STATE]
proof (prove)
using this:
\<exists>f. \<forall>A. \<exists>x. A = f x

goal (1 subgoal):
 1. (\<And>f. \<forall>A. \<exists>x. A = f x \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<forall>A. \<exists>x. A = f x

goal (1 subgoal):
 1. \<exists>f. \<forall>A. \<exists>x. A = f x \<Longrightarrow> False
[PROOF STEP]
let ?D = "{x. x \<notin> f x}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f. \<forall>A. \<exists>x. A = f x \<Longrightarrow> False
[PROOF STEP]
from *
[PROOF STATE]
proof (chain)
picking this:
\<forall>A. \<exists>x. A = f x
[PROOF STEP]
obtain a where "?D = f a"
[PROOF STATE]
proof (prove)
using this:
\<forall>A. \<exists>x. A = f x

goal (1 subgoal):
 1. (\<And>a. {x. x \<notin> f x} = f a \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
{x. x \<notin> f x} = f a

goal (1 subgoal):
 1. \<exists>f. \<forall>A. \<exists>x. A = f x \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{x. x \<notin> f x} = f a

goal (1 subgoal):
 1. \<exists>f. \<forall>A. \<exists>x. A = f x \<Longrightarrow> False
[PROOF STEP]
have "a \<in> ?D \<longleftrightarrow> a \<notin> f a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<in> {x. x \<notin> f x}) = (a \<notin> f a)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(a \<in> {x. x \<notin> f x}) = (a \<notin> f a)

goal (1 subgoal):
 1. \<exists>f. \<forall>A. \<exists>x. A = f x \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
{x. x \<notin> f x} = f a
(a \<in> {x. x \<notin> f x}) = (a \<notin> f a)
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
{x. x \<notin> f x} = f a
(a \<in> {x. x \<notin> f x}) = (a \<notin> f a)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pochhammer_minus:
  "pochhammer (- b) k = ((- 1) ^ k :: 'a::comm_ring_1) * pochhammer (b - of_nat k + 1) k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pochhammer (- b) k = (- (1::'a)) ^ k * pochhammer (b - of_nat k + (1::'a)) k
[PROOF STEP]
proof (cases k)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. k = 0 \<Longrightarrow> pochhammer (- b) k = (- (1::'a)) ^ k * pochhammer (b - of_nat k + (1::'a)) k
 2. \<And>nat. k = Suc nat \<Longrightarrow> pochhammer (- b) k = (- (1::'a)) ^ k * pochhammer (b - of_nat k + (1::'a)) k
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
k = 0

goal (2 subgoals):
 1. k = 0 \<Longrightarrow> pochhammer (- b) k = (- (1::'a)) ^ k * pochhammer (b - of_nat k + (1::'a)) k
 2. \<And>nat. k = Suc nat \<Longrightarrow> pochhammer (- b) k = (- (1::'a)) ^ k * pochhammer (b - of_nat k + (1::'a)) k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
k = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
k = 0

goal (1 subgoal):
 1. pochhammer (- b) k = (- (1::'a)) ^ k * pochhammer (b - of_nat k + (1::'a)) k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
pochhammer (- b) k = (- (1::'a)) ^ k * pochhammer (b - of_nat k + (1::'a)) k

goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> pochhammer (- b) k = (- (1::'a)) ^ k * pochhammer (b - of_nat k + (1::'a)) k
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> pochhammer (- b) k = (- (1::'a)) ^ k * pochhammer (b - of_nat k + (1::'a)) k
[PROOF STEP]
case (Suc h)
[PROOF STATE]
proof (state)
this:
k = Suc h

goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> pochhammer (- b) k = (- (1::'a)) ^ k * pochhammer (b - of_nat k + (1::'a)) k
[PROOF STEP]
have eq: "((- 1) ^ Suc h :: 'a) = (\<Prod>i = 0..h. - 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- (1::'a)) ^ Suc h = (\<Prod>i = 0..h. - (1::'a))
[PROOF STEP]
using prod_constant [where A="{0.. h}" and y="- 1 :: 'a"]
[PROOF STATE]
proof (prove)
using this:
(\<Prod>x = 0..h. - (1::'a)) = (- (1::'a)) ^ card {0..h}

goal (1 subgoal):
 1. (- (1::'a)) ^ Suc h = (\<Prod>i = 0..h. - (1::'a))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(- (1::'a)) ^ Suc h = (\<Prod>i = 0..h. - (1::'a))

goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> pochhammer (- b) k = (- (1::'a)) ^ k * pochhammer (b - of_nat k + (1::'a)) k
[PROOF STEP]
with Suc
[PROOF STATE]
proof (chain)
picking this:
k = Suc h
(- (1::'a)) ^ Suc h = (\<Prod>i = 0..h. - (1::'a))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
k = Suc h
(- (1::'a)) ^ Suc h = (\<Prod>i = 0..h. - (1::'a))

goal (1 subgoal):
 1. pochhammer (- b) k = (- (1::'a)) ^ k * pochhammer (b - of_nat k + (1::'a)) k
[PROOF STEP]
using pochhammer_Suc_prod_rev [of "b - of_nat k + 1"]
[PROOF STATE]
proof (prove)
using this:
k = Suc h
(- (1::'a)) ^ Suc h = (\<Prod>i = 0..h. - (1::'a))
pochhammer (b - of_nat k + (1::'a)) (Suc ?n) = (\<Prod>i = 0..?n. b - of_nat k + (1::'a) + of_nat (?n - i))

goal (1 subgoal):
 1. pochhammer (- b) k = (- (1::'a)) ^ k * pochhammer (b - of_nat k + (1::'a)) k
[PROOF STEP]
by (auto simp add: pochhammer_Suc_prod prod.distrib [symmetric] eq of_nat_diff simp del: prod_constant)
[PROOF STATE]
proof (state)
this:
pochhammer (- b) k = (- (1::'a)) ^ k * pochhammer (b - of_nat k + (1::'a)) k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma metric_LIM_I:
  "(\<And>r. 0 < r \<Longrightarrow> \<exists>s>0. \<forall>x. x \<noteq> a \<and> dist x a < s \<longrightarrow> dist (f x) L < r) \<Longrightarrow> f \<midarrow>a\<rightarrow> L"
  for a :: "'a::metric_space" and L :: "'b::metric_space"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>r. 0 < r \<Longrightarrow> \<exists>s>0. \<forall>x. x \<noteq> a \<and> dist x a < s \<longrightarrow> dist (f x) L < r) \<Longrightarrow> f \<midarrow>a\<rightarrow> L
[PROOF STEP]
by (simp add: LIM_def)


[STATEMENT]
lemma Mapping_lookup_None_intro: "x \<notin> mmap_keys f \<Longrightarrow> mmap_lookup f x = None"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<notin> mmap_keys f \<Longrightarrow> mmap_lookup f x = None
[PROOF STEP]
unfolding mmap_lookup_def mmap_keys_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<notin> set (map fst f) \<Longrightarrow> map_of f x = None
[PROOF STEP]
by (simp add: map_of_eq_None_iff)


[STATEMENT]
lemma poly_translate_correct:
  assumes "num_params p \<le> length x"
  assumes "length x = length v"
  shows "Ipoly x (poly_translate v p) = Ipoly (map2 (+) x v) p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ipoly x (poly_translate v p) = Ipoly (map2 (+) x v) p
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
num_params p \<le> length x
length x = length v

goal (1 subgoal):
 1. Ipoly x (poly_translate v p) = Ipoly (map2 (+) x v) p
[PROOF STEP]
by (induction p, simp_all)


[STATEMENT]
lemma lsl_Sup_closed_var [simp]: "\<nu> (\<Squnion>x \<in> X. \<nu> x) = (\<Squnion>x \<in> X. \<nu> (x::'a::unital_quantale))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<nu> (\<Squnion> (\<nu> ` X)) = \<Squnion> (\<nu> ` X)
[PROOF STEP]
unfolding lsl_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<top> \<cdot> \<Squnion> ((\<cdot>) \<top> ` X) = \<Squnion> ((\<cdot>) \<top> ` X)
[PROOF STEP]
by (metis Sup_distl mult.assoc top_times_top)


[STATEMENT]
lemma space_PiM_not_empty[simp]: "space (PiM UNIV M) \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. space (Pi\<^sub>M UNIV M) \<noteq> {}
[PROOF STEP]
unfolding space_PiM_empty_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> (\<exists>i\<in>UNIV. space (M i) = {})
[PROOF STEP]
by auto


[STATEMENT]
lemma prv_scnj_mono_imp:
  assumes "F1 \<subseteq> fmla" "F2 \<subseteq> fmla" "finite F1" "finite F2"
    and "\<forall> \<phi>2 \<in> F2. \<exists> \<phi>1 \<in> F1. prv (imp \<phi>1 \<phi>2)"
  shows "prv (imp (scnj F1) (scnj F2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prv (imp (scnj F1) (scnj F2))
[PROOF STEP]
unfolding scnj_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prv (imp (lcnj (asList F1)) (lcnj (asList F2)))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
F1 \<subseteq> fmla
F2 \<subseteq> fmla
finite F1
finite F2
\<forall>\<phi>2\<in>F2. \<exists>\<phi>1\<in>F1. prv (imp \<phi>1 \<phi>2)

goal (1 subgoal):
 1. prv (imp (lcnj (asList F1)) (lcnj (asList F2)))
[PROOF STEP]
by (intro prv_lcnj_mono_imp) auto


[STATEMENT]
lemma fps_XDp_fps_integral [simp]:
  fixes  a :: "'a::{division_ring,ring_char_0} fps"
  shows  "fps_XDp 0 (fps_integral a c) = fps_X * a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_XDp (0::'a) (fps_integral a c) = fps_X * a
[PROOF STEP]
using  fps_deriv_fps_integral[of a c]
[PROOF STATE]
proof (prove)
using this:
fps_deriv (fps_integral a c) = a

goal (1 subgoal):
 1. fps_XDp (0::'a) (fps_integral a c) = fps_X * a
[PROOF STEP]
by     (simp add: fps_XD_def)


[STATEMENT]
lemma llist_inf_simps [simp, code, nitpick_simp]:
  "inf LNil xs = LNil"
  "inf xs LNil = LNil"
  "inf (LCons x xs) (LCons y ys) = (if x = y then LCons x (inf xs ys) else LNil)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LNil \<sqinter> xs = LNil &&& xs \<sqinter> LNil = LNil &&& LCons x xs \<sqinter> LCons y ys = (if x = y then LCons x (xs \<sqinter> ys) else LNil)
[PROOF STEP]
unfolding inf_llist_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unfold_llist (\<lambda>(xs, ys). xs \<noteq> LNil \<longrightarrow> ys \<noteq> LNil \<longrightarrow> lhd xs \<noteq> lhd ys) (lhd \<circ> snd) (map_prod ltl ltl) (LNil, xs) = LNil &&& unfold_llist (\<lambda>(xs, ys). xs \<noteq> LNil \<longrightarrow> ys \<noteq> LNil \<longrightarrow> lhd xs \<noteq> lhd ys) (lhd \<circ> snd) (map_prod ltl ltl) (xs, LNil) = LNil &&& unfold_llist (\<lambda>(xs, ys). xs \<noteq> LNil \<longrightarrow> ys \<noteq> LNil \<longrightarrow> lhd xs \<noteq> lhd ys) (lhd \<circ> snd) (map_prod ltl ltl) (LCons x xs, LCons y ys) = (if x = y then LCons x (unfold_llist (\<lambda>(xs, ys). xs \<noteq> LNil \<longrightarrow> ys \<noteq> LNil \<longrightarrow> lhd xs \<noteq> lhd ys) (lhd \<circ> snd) (map_prod ltl ltl) (xs, ys)) else LNil)
[PROOF STEP]
by simp_all


[STATEMENT]
lemma distinct_finite_subset:
  assumes "finite x"
  shows "finite {ys. set ys \<subseteq> x \<and> distinct ys}" (is "finite ?S")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {ys. set ys \<subseteq> x \<and> distinct ys}
[PROOF STEP]
proof (rule finite_subset)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {ys. set ys \<subseteq> x \<and> distinct ys} \<subseteq> ?B
 2. finite ?B
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
finite x
[PROOF STEP]
show "?S \<subseteq> {ys. set ys \<subseteq> x \<and> length ys \<le> card x}"
[PROOF STATE]
proof (prove)
using this:
finite x

goal (1 subgoal):
 1. {ys. set ys \<subseteq> x \<and> distinct ys} \<subseteq> {ys. set ys \<subseteq> x \<and> length ys \<le> card x}
[PROOF STEP]
by clarsimp (metis distinct_card card_mono)
[PROOF STATE]
proof (state)
this:
{ys. set ys \<subseteq> x \<and> distinct ys} \<subseteq> {ys. set ys \<subseteq> x \<and> length ys \<le> card x}

goal (1 subgoal):
 1. finite {ys. set ys \<subseteq> x \<and> length ys \<le> card x}
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
finite x
[PROOF STEP]
show "finite ..."
[PROOF STATE]
proof (prove)
using this:
finite x

goal (1 subgoal):
 1. finite {ys. set ys \<subseteq> x \<and> length ys \<le> card x}
[PROOF STEP]
by (rule finite_lists_length_le)
[PROOF STATE]
proof (state)
this:
finite {ys. set ys \<subseteq> x \<and> length ys \<le> card x}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma length_rotate[simp]: "length(rotate n xs) = length xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (rotate n xs) = length xs
[PROOF STEP]
by (induct n arbitrary: xs) (simp_all add:rotate_def)


[STATEMENT]
lemma higher_deriv_lnGamma_stirling:
  assumes m: "m > 0"
  shows   "(\<lambda>x::real. (deriv ^^ j) ln_Gamma x - Polygamma_approx j m x) \<in> O(\<lambda>x. 1 / x ^ (m + j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. (deriv ^^ j) ln_Gamma x - Polygamma_approx j m x) \<in> O(\<lambda>x. 1 / x ^ (m + j))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. (deriv ^^ j) ln_Gamma x - Polygamma_approx j m x) \<in> O(\<lambda>x. 1 / x ^ (m + j))
[PROOF STEP]
have "eventually (\<lambda>x. \<bar>(deriv ^^ j) ln_Gamma x - Polygamma_approx j m x\<bar> =
                          inverse (real m) * \<bar>(deriv ^^ j) (stirling_integral m) x\<bar>) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. \<bar>(deriv ^^ j) ln_Gamma x - Polygamma_approx j m x\<bar> = inverse (real m) * \<bar>(deriv ^^ j) (stirling_integral m) x\<bar>
[PROOF STEP]
using eventually_gt_at_top[of "0::real"]
[PROOF STATE]
proof (prove)
using this:
eventually ((<) 0) at_top

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. \<bar>(deriv ^^ j) ln_Gamma x - Polygamma_approx j m x\<bar> = inverse (real m) * \<bar>(deriv ^^ j) (stirling_integral m) x\<bar>
[PROOF STEP]
proof eventually_elim
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. 0 < x \<Longrightarrow> \<bar>(deriv ^^ j) ln_Gamma x - Polygamma_approx j m x\<bar> = inverse (real m) * \<bar>(deriv ^^ j) (stirling_integral m) x\<bar>
[PROOF STEP]
case (elim x)
[PROOF STATE]
proof (state)
this:
0 < x

goal (1 subgoal):
 1. \<And>x. 0 < x \<Longrightarrow> \<bar>(deriv ^^ j) ln_Gamma x - Polygamma_approx j m x\<bar> = inverse (real m) * \<bar>(deriv ^^ j) (stirling_integral m) x\<bar>
[PROOF STEP]
note x = this
[PROOF STATE]
proof (state)
this:
0 < x

goal (1 subgoal):
 1. \<And>x. 0 < x \<Longrightarrow> \<bar>(deriv ^^ j) ln_Gamma x - Polygamma_approx j m x\<bar> = inverse (real m) * \<bar>(deriv ^^ j) (stirling_integral m) x\<bar>
[PROOF STEP]
have "\<forall>\<^sub>F y in nhds (complex_of_real x). y \<in> - \<real>\<^sub>\<le>\<^sub>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F y in nhds (complex_of_real x). y \<in> - \<real>\<^sub>\<le>\<^sub>0
[PROOF STEP]
using elim
[PROOF STATE]
proof (prove)
using this:
0 < x

goal (1 subgoal):
 1. \<forall>\<^sub>F y in nhds (complex_of_real x). y \<in> - \<real>\<^sub>\<le>\<^sub>0
[PROOF STEP]
by (intro eventually_nhds_in_open) auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F y in nhds (complex_of_real x). y \<in> - \<real>\<^sub>\<le>\<^sub>0

goal (1 subgoal):
 1. \<And>x. 0 < x \<Longrightarrow> \<bar>(deriv ^^ j) ln_Gamma x - Polygamma_approx j m x\<bar> = inverse (real m) * \<bar>(deriv ^^ j) (stirling_integral m) x\<bar>
[PROOF STEP]
hence "(deriv ^^ j) (\<lambda>x. ln_Gamma x - Polygamma_approx 0 m x) (complex_of_real x) =
            (deriv ^^ j) (\<lambda>x. (-inverse (of_nat m)) * stirling_integral m x) (complex_of_real x)"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F y in nhds (complex_of_real x). y \<in> - \<real>\<^sub>\<le>\<^sub>0

goal (1 subgoal):
 1. (deriv ^^ j) (\<lambda>x. ln_Gamma x - Polygamma_approx 0 m x) (complex_of_real x) = (deriv ^^ j) (\<lambda>x. - inverse (of_nat m) * stirling_integral m x) (complex_of_real x)
[PROOF STEP]
using x m
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F y in nhds (complex_of_real x). y \<in> - \<real>\<^sub>\<le>\<^sub>0
0 < x
0 < m

goal (1 subgoal):
 1. (deriv ^^ j) (\<lambda>x. ln_Gamma x - Polygamma_approx 0 m x) (complex_of_real x) = (deriv ^^ j) (\<lambda>x. - inverse (of_nat m) * stirling_integral m x) (complex_of_real x)
[PROOF STEP]
by (intro higher_deriv_cong_ev refl)
         (auto elim!: eventually_mono simp: ln_Gamma_stirling_complex Polygamma_approx_def
            field_simps open_halfspace_Re_gt stirling_sum_def)
[PROOF STATE]
proof (state)
this:
(deriv ^^ j) (\<lambda>x. ln_Gamma x - Polygamma_approx 0 m x) (complex_of_real x) = (deriv ^^ j) (\<lambda>x. - inverse (of_nat m) * stirling_integral m x) (complex_of_real x)

goal (1 subgoal):
 1. \<And>x. 0 < x \<Longrightarrow> \<bar>(deriv ^^ j) ln_Gamma x - Polygamma_approx j m x\<bar> = inverse (real m) * \<bar>(deriv ^^ j) (stirling_integral m) x\<bar>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(deriv ^^ j) (\<lambda>x. ln_Gamma x - Polygamma_approx 0 m x) (complex_of_real x) = (deriv ^^ j) (\<lambda>x. - inverse (of_nat m) * stirling_integral m x) (complex_of_real x)

goal (1 subgoal):
 1. \<And>x. 0 < x \<Longrightarrow> \<bar>(deriv ^^ j) ln_Gamma x - Polygamma_approx j m x\<bar> = inverse (real m) * \<bar>(deriv ^^ j) (stirling_integral m) x\<bar>
[PROOF STEP]
have "\<dots> = - inverse (of_nat m) * (deriv ^^ j) (stirling_integral m) (of_real x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (deriv ^^ j) (\<lambda>x. - inverse (of_nat m) * stirling_integral m x) (complex_of_real x) = - inverse (of_nat m) * (deriv ^^ j) (stirling_integral m) (complex_of_real x)
[PROOF STEP]
using x m
[PROOF STATE]
proof (prove)
using this:
0 < x
0 < m

goal (1 subgoal):
 1. (deriv ^^ j) (\<lambda>x. - inverse (of_nat m) * stirling_integral m x) (complex_of_real x) = - inverse (of_nat m) * (deriv ^^ j) (stirling_integral m) (complex_of_real x)
[PROOF STEP]
by (intro higher_deriv_cmult[of _ "-\<real>\<^sub>\<le>\<^sub>0"] stirling_integral_holomorphic)
         (auto simp: open_halfspace_Re_gt)
[PROOF STATE]
proof (state)
this:
(deriv ^^ j) (\<lambda>x. - inverse (of_nat m) * stirling_integral m x) (complex_of_real x) = - inverse (of_nat m) * (deriv ^^ j) (stirling_integral m) (complex_of_real x)

goal (1 subgoal):
 1. \<And>x. 0 < x \<Longrightarrow> \<bar>(deriv ^^ j) ln_Gamma x - Polygamma_approx j m x\<bar> = inverse (real m) * \<bar>(deriv ^^ j) (stirling_integral m) x\<bar>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(deriv ^^ j) (\<lambda>x. - inverse (of_nat m) * stirling_integral m x) (complex_of_real x) = - inverse (of_nat m) * (deriv ^^ j) (stirling_integral m) (complex_of_real x)

goal (1 subgoal):
 1. \<And>x. 0 < x \<Longrightarrow> \<bar>(deriv ^^ j) ln_Gamma x - Polygamma_approx j m x\<bar> = inverse (real m) * \<bar>(deriv ^^ j) (stirling_integral m) x\<bar>
[PROOF STEP]
have "(deriv ^^ j) (\<lambda>x. ln_Gamma x - Polygamma_approx 0 m x) (complex_of_real x) =
                 (deriv ^^ j) ln_Gamma (of_real x) - (deriv ^^ j) (Polygamma_approx 0 m) (of_real x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (deriv ^^ j) (\<lambda>x. ln_Gamma x - Polygamma_approx 0 m x) (complex_of_real x) = (deriv ^^ j) ln_Gamma (complex_of_real x) - (deriv ^^ j) (Polygamma_approx 0 m) (complex_of_real x)
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
0 < x

goal (1 subgoal):
 1. (deriv ^^ j) (\<lambda>x. ln_Gamma x - Polygamma_approx 0 m x) (complex_of_real x) = (deriv ^^ j) ln_Gamma (complex_of_real x) - (deriv ^^ j) (Polygamma_approx 0 m) (complex_of_real x)
[PROOF STEP]
by (intro higher_deriv_diff[of _ "{s. Re s > 0}"])
         (auto intro!: holomorphic_intros elim!: nonpos_Reals_cases simp: open_halfspace_Re_gt)
[PROOF STATE]
proof (state)
this:
(deriv ^^ j) (\<lambda>x. ln_Gamma x - Polygamma_approx 0 m x) (complex_of_real x) = (deriv ^^ j) ln_Gamma (complex_of_real x) - (deriv ^^ j) (Polygamma_approx 0 m) (complex_of_real x)

goal (1 subgoal):
 1. \<And>x. 0 < x \<Longrightarrow> \<bar>(deriv ^^ j) ln_Gamma x - Polygamma_approx j m x\<bar> = inverse (real m) * \<bar>(deriv ^^ j) (stirling_integral m) x\<bar>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(deriv ^^ j) (\<lambda>x. ln_Gamma x - Polygamma_approx 0 m x) (complex_of_real x) = (deriv ^^ j) ln_Gamma (complex_of_real x) - (deriv ^^ j) (Polygamma_approx 0 m) (complex_of_real x)

goal (1 subgoal):
 1. \<And>x. 0 < x \<Longrightarrow> \<bar>(deriv ^^ j) ln_Gamma x - Polygamma_approx j m x\<bar> = inverse (real m) * \<bar>(deriv ^^ j) (stirling_integral m) x\<bar>
[PROOF STEP]
have "(deriv ^^ j) (Polygamma_approx 0 m) (complex_of_real x) =
                 of_real (Polygamma_approx j m x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (deriv ^^ j) (Polygamma_approx 0 m) (complex_of_real x) = complex_of_real (Polygamma_approx j m x)
[PROOF STEP]
using x m
[PROOF STATE]
proof (prove)
using this:
0 < x
0 < m

goal (1 subgoal):
 1. (deriv ^^ j) (Polygamma_approx 0 m) (complex_of_real x) = complex_of_real (Polygamma_approx j m x)
[PROOF STEP]
by (simp add: Polygamma_approx_complex_of_real)
[PROOF STATE]
proof (state)
this:
(deriv ^^ j) (Polygamma_approx 0 m) (complex_of_real x) = complex_of_real (Polygamma_approx j m x)

goal (1 subgoal):
 1. \<And>x. 0 < x \<Longrightarrow> \<bar>(deriv ^^ j) ln_Gamma x - Polygamma_approx j m x\<bar> = inverse (real m) * \<bar>(deriv ^^ j) (stirling_integral m) x\<bar>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(deriv ^^ j) (Polygamma_approx 0 m) (complex_of_real x) = complex_of_real (Polygamma_approx j m x)

goal (1 subgoal):
 1. \<And>x. 0 < x \<Longrightarrow> \<bar>(deriv ^^ j) ln_Gamma x - Polygamma_approx j m x\<bar> = inverse (real m) * \<bar>(deriv ^^ j) (stirling_integral m) x\<bar>
[PROOF STEP]
have "norm (- inverse (of_nat m) * (deriv ^^ j) (stirling_integral m) (complex_of_real x)) =
                 inverse (real m) * \<bar>(deriv ^^ j) (stirling_integral m) x\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (- inverse (of_nat m) * (deriv ^^ j) (stirling_integral m) (complex_of_real x)) = inverse (real m) * \<bar>(deriv ^^ j) (stirling_integral m) x\<bar>
[PROOF STEP]
using x m
[PROOF STATE]
proof (prove)
using this:
0 < x
0 < m

goal (1 subgoal):
 1. cmod (- inverse (of_nat m) * (deriv ^^ j) (stirling_integral m) (complex_of_real x)) = inverse (real m) * \<bar>(deriv ^^ j) (stirling_integral m) x\<bar>
[PROOF STEP]
by (simp add: norm_mult norm_inverse deriv_stirling_integral_complex_of_real)
[PROOF STATE]
proof (state)
this:
cmod (- inverse (of_nat m) * (deriv ^^ j) (stirling_integral m) (complex_of_real x)) = inverse (real m) * \<bar>(deriv ^^ j) (stirling_integral m) x\<bar>

goal (1 subgoal):
 1. \<And>x. 0 < x \<Longrightarrow> \<bar>(deriv ^^ j) ln_Gamma x - Polygamma_approx j m x\<bar> = inverse (real m) * \<bar>(deriv ^^ j) (stirling_integral m) x\<bar>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod (- inverse (of_nat m) * (deriv ^^ j) (stirling_integral m) (complex_of_real x)) = inverse (real m) * \<bar>(deriv ^^ j) (stirling_integral m) x\<bar>

goal (1 subgoal):
 1. \<And>x. 0 < x \<Longrightarrow> \<bar>(deriv ^^ j) ln_Gamma x - Polygamma_approx j m x\<bar> = inverse (real m) * \<bar>(deriv ^^ j) (stirling_integral m) x\<bar>
[PROOF STEP]
have "(deriv ^^ j) ln_Gamma (complex_of_real x) = of_real ((deriv ^^ j) ln_Gamma x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (deriv ^^ j) ln_Gamma (complex_of_real x) = complex_of_real ((deriv ^^ j) ln_Gamma x)
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
0 < x

goal (1 subgoal):
 1. (deriv ^^ j) ln_Gamma (complex_of_real x) = complex_of_real ((deriv ^^ j) ln_Gamma x)
[PROOF STEP]
by (simp add: higher_deriv_ln_Gamma_complex_of_real)
[PROOF STATE]
proof (state)
this:
(deriv ^^ j) ln_Gamma (complex_of_real x) = complex_of_real ((deriv ^^ j) ln_Gamma x)

goal (1 subgoal):
 1. \<And>x. 0 < x \<Longrightarrow> \<bar>(deriv ^^ j) ln_Gamma x - Polygamma_approx j m x\<bar> = inverse (real m) * \<bar>(deriv ^^ j) (stirling_integral m) x\<bar>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(deriv ^^ j) ln_Gamma (complex_of_real x) = complex_of_real ((deriv ^^ j) ln_Gamma x)

goal (1 subgoal):
 1. \<And>x. 0 < x \<Longrightarrow> \<bar>(deriv ^^ j) ln_Gamma x - Polygamma_approx j m x\<bar> = inverse (real m) * \<bar>(deriv ^^ j) (stirling_integral m) x\<bar>
[PROOF STEP]
have "norm (\<dots> - of_real (Polygamma_approx j m x)) =
                 \<bar>(deriv ^^ j) ln_Gamma x - Polygamma_approx j m x\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (complex_of_real ((deriv ^^ j) ln_Gamma x) - complex_of_real (Polygamma_approx j m x)) = \<bar>(deriv ^^ j) ln_Gamma x - Polygamma_approx j m x\<bar>
[PROOF STEP]
by (simp only: of_real_diff [symmetric] norm_of_real)
[PROOF STATE]
proof (state)
this:
cmod (complex_of_real ((deriv ^^ j) ln_Gamma x) - complex_of_real (Polygamma_approx j m x)) = \<bar>(deriv ^^ j) ln_Gamma x - Polygamma_approx j m x\<bar>

goal (1 subgoal):
 1. \<And>x. 0 < x \<Longrightarrow> \<bar>(deriv ^^ j) ln_Gamma x - Polygamma_approx j m x\<bar> = inverse (real m) * \<bar>(deriv ^^ j) (stirling_integral m) x\<bar>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<bar>(deriv ^^ j) ln_Gamma x - Polygamma_approx j m x\<bar> = inverse (real m) * \<bar>(deriv ^^ j) (stirling_integral m) x\<bar>
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<bar>(deriv ^^ j) ln_Gamma x - Polygamma_approx j m x\<bar> = inverse (real m) * \<bar>(deriv ^^ j) (stirling_integral m) x\<bar>

goal (1 subgoal):
 1. \<bar>(deriv ^^ j) ln_Gamma x - Polygamma_approx j m x\<bar> = inverse (real m) * \<bar>(deriv ^^ j) (stirling_integral m) x\<bar>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<bar>(deriv ^^ j) ln_Gamma x - Polygamma_approx j m x\<bar> = inverse (real m) * \<bar>(deriv ^^ j) (stirling_integral m) x\<bar>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. \<bar>(deriv ^^ j) ln_Gamma x - Polygamma_approx j m x\<bar> = inverse (real m) * \<bar>(deriv ^^ j) (stirling_integral m) x\<bar>

goal (1 subgoal):
 1. (\<lambda>x. (deriv ^^ j) ln_Gamma x - Polygamma_approx j m x) \<in> O(\<lambda>x. 1 / x ^ (m + j))
[PROOF STEP]
from bigthetaI_cong[OF this] m
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. \<bar>(deriv ^^ j) ln_Gamma x - Polygamma_approx j m x\<bar>) \<in> \<Theta>(\<lambda>x. inverse (real m) * \<bar>(deriv ^^ j) (stirling_integral m) x\<bar>)
0 < m
[PROOF STEP]
have "(\<lambda>x::real. (deriv ^^ j) ln_Gamma x - Polygamma_approx j m x) \<in>
             \<Theta>(\<lambda>x. (deriv ^^ j) (stirling_integral m) x)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. \<bar>(deriv ^^ j) ln_Gamma x - Polygamma_approx j m x\<bar>) \<in> \<Theta>(\<lambda>x. inverse (real m) * \<bar>(deriv ^^ j) (stirling_integral m) x\<bar>)
0 < m

goal (1 subgoal):
 1. (\<lambda>x. (deriv ^^ j) ln_Gamma x - Polygamma_approx j m x) \<in> \<Theta>((deriv ^^ j) (stirling_integral m))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (deriv ^^ j) ln_Gamma x - Polygamma_approx j m x) \<in> \<Theta>((deriv ^^ j) (stirling_integral m))

goal (1 subgoal):
 1. (\<lambda>x. (deriv ^^ j) ln_Gamma x - Polygamma_approx j m x) \<in> O(\<lambda>x. 1 / x ^ (m + j))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (deriv ^^ j) ln_Gamma x - Polygamma_approx j m x) \<in> \<Theta>((deriv ^^ j) (stirling_integral m))

goal (1 subgoal):
 1. (\<lambda>x. (deriv ^^ j) ln_Gamma x - Polygamma_approx j m x) \<in> O(\<lambda>x. 1 / x ^ (m + j))
[PROOF STEP]
have "(\<lambda>x::real. (deriv ^^ j) (stirling_integral m) x) \<in> O(\<lambda>x. 1 / x ^ (m + j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (deriv ^^ j) (stirling_integral m) \<in> O(\<lambda>x. 1 / x ^ (m + j))
[PROOF STEP]
using m
[PROOF STATE]
proof (prove)
using this:
0 < m

goal (1 subgoal):
 1. (deriv ^^ j) (stirling_integral m) \<in> O(\<lambda>x. 1 / x ^ (m + j))
[PROOF STEP]
by (rule deriv_stirling_integral_real_bound)
[PROOF STATE]
proof (state)
this:
(deriv ^^ j) (stirling_integral m) \<in> O(\<lambda>x. 1 / x ^ (m + j))

goal (1 subgoal):
 1. (\<lambda>x. (deriv ^^ j) ln_Gamma x - Polygamma_approx j m x) \<in> O(\<lambda>x. 1 / x ^ (m + j))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. (deriv ^^ j) ln_Gamma x - Polygamma_approx j m x) \<in> O(\<lambda>x. 1 / x ^ (m + j))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. (deriv ^^ j) ln_Gamma x - Polygamma_approx j m x) \<in> O(\<lambda>x. 1 / x ^ (m + j))

goal (1 subgoal):
 1. (\<lambda>x. (deriv ^^ j) ln_Gamma x - Polygamma_approx j m x) \<in> O(\<lambda>x. 1 / x ^ (m + j))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (deriv ^^ j) ln_Gamma x - Polygamma_approx j m x) \<in> O(\<lambda>x. 1 / x ^ (m + j))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma continuous_sqrt_imp_simply_connected:
  assumes "connected S"
    and prev: "\<And>f::complex\<Rightarrow>complex. \<lbrakk>continuous_on S f; \<forall>z \<in> S. f z \<noteq> 0\<rbrakk>
                \<Longrightarrow> \<exists>g. continuous_on S g \<and> (\<forall>z \<in> S. f z = (g z)\<^sup>2)"
  shows "simply_connected S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. simply_connected S
[PROOF STEP]
proof (clarsimp simp add: simply_connected_eq_holomorphic_sqrt [OF openS] \<open>connected S\<close>)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f. \<lbrakk>f holomorphic_on S; \<forall>z\<in>S. f z \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>g. g holomorphic_on S \<and> (\<forall>z\<in>S. f z = (g z)\<^sup>2)
[PROOF STEP]
fix f
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f. \<lbrakk>f holomorphic_on S; \<forall>z\<in>S. f z \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>g. g holomorphic_on S \<and> (\<forall>z\<in>S. f z = (g z)\<^sup>2)
[PROOF STEP]
assume "f holomorphic_on S" and nz: "\<forall>z\<in>S. f z \<noteq> 0"
[PROOF STATE]
proof (state)
this:
f holomorphic_on S
\<forall>z\<in>S. f z \<noteq> 0

goal (1 subgoal):
 1. \<And>f. \<lbrakk>f holomorphic_on S; \<forall>z\<in>S. f z \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>g. g holomorphic_on S \<and> (\<forall>z\<in>S. f z = (g z)\<^sup>2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f holomorphic_on S
\<forall>z\<in>S. f z \<noteq> 0
[PROOF STEP]
obtain g where contg: "continuous_on S g" and geq: "\<And>z. z \<in> S \<Longrightarrow> f z = (g z)\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
f holomorphic_on S
\<forall>z\<in>S. f z \<noteq> 0

goal (1 subgoal):
 1. (\<And>g. \<lbrakk>continuous_on S g; \<And>z. z \<in> S \<Longrightarrow> f z = (g z)\<^sup>2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis holomorphic_on_imp_continuous_on prev)
[PROOF STATE]
proof (state)
this:
continuous_on S g
?z \<in> S \<Longrightarrow> f ?z = (g ?z)\<^sup>2

goal (1 subgoal):
 1. \<And>f. \<lbrakk>f holomorphic_on S; \<forall>z\<in>S. f z \<noteq> 0\<rbrakk> \<Longrightarrow> \<exists>g. g holomorphic_on S \<and> (\<forall>z\<in>S. f z = (g z)\<^sup>2)
[PROOF STEP]
show "\<exists>g. g holomorphic_on S \<and> (\<forall>z\<in>S. f z = (g z)\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>g. g holomorphic_on S \<and> (\<forall>z\<in>S. f z = (g z)\<^sup>2)
[PROOF STEP]
proof (intro exI ballI conjI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?g holomorphic_on S
 2. \<And>z. z \<in> S \<Longrightarrow> f z = (?g z)\<^sup>2
[PROOF STEP]
show "g holomorphic_on S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g holomorphic_on S
[PROOF STEP]
proof (clarsimp simp add: holomorphic_on_open [OF openS])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> \<exists>f'. (g has_field_derivative f') (at x)
[PROOF STEP]
fix z
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> \<exists>f'. (g has_field_derivative f') (at x)
[PROOF STEP]
assume "z \<in> S"
[PROOF STATE]
proof (state)
this:
z \<in> S

goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> \<exists>f'. (g has_field_derivative f') (at x)
[PROOF STEP]
with nz geq
[PROOF STATE]
proof (chain)
picking this:
\<forall>z\<in>S. f z \<noteq> 0
?z \<in> S \<Longrightarrow> f ?z = (g ?z)\<^sup>2
z \<in> S
[PROOF STEP]
have "g z \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
\<forall>z\<in>S. f z \<noteq> 0
?z \<in> S \<Longrightarrow> f ?z = (g ?z)\<^sup>2
z \<in> S

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

goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> \<exists>f'. (g has_field_derivative f') (at x)
[PROOF STEP]
obtain \<delta> where "0 < \<delta>" "\<And>w. \<lbrakk>w \<in> S; dist w z < \<delta>\<rbrakk> \<Longrightarrow> dist (g w) (g z) < cmod (g z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>\<delta>. \<lbrakk>0 < \<delta>; \<And>w. \<lbrakk>w \<in> S; dist w z < \<delta>\<rbrakk> \<Longrightarrow> dist (g w) (g z) < cmod (g z)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using contg [unfolded continuous_on_iff]
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>S. \<forall>e>0. \<exists>d>0. \<forall>x'\<in>S. dist x' x < d \<longrightarrow> dist (g x') (g x) < e

goal (1 subgoal):
 1. (\<And>\<delta>. \<lbrakk>0 < \<delta>; \<And>w. \<lbrakk>w \<in> S; dist w z < \<delta>\<rbrakk> \<Longrightarrow> dist (g w) (g z) < cmod (g z)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis \<open>g z \<noteq> 0\<close> \<open>z \<in> S\<close> zero_less_norm_iff)
[PROOF STATE]
proof (state)
this:
0 < \<delta>
\<lbrakk>?w \<in> S; dist ?w z < \<delta>\<rbrakk> \<Longrightarrow> dist (g ?w) (g z) < cmod (g z)

goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> \<exists>f'. (g has_field_derivative f') (at x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < \<delta>
\<lbrakk>?w \<in> S; dist ?w z < \<delta>\<rbrakk> \<Longrightarrow> dist (g ?w) (g z) < cmod (g z)
[PROOF STEP]
have \<delta>: "\<And>w. \<lbrakk>w \<in> S; w \<in> ball z \<delta>\<rbrakk> \<Longrightarrow> g w + g z \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
0 < \<delta>
\<lbrakk>?w \<in> S; dist ?w z < \<delta>\<rbrakk> \<Longrightarrow> dist (g ?w) (g z) < cmod (g z)

goal (1 subgoal):
 1. \<And>w. \<lbrakk>w \<in> S; w \<in> ball z \<delta>\<rbrakk> \<Longrightarrow> g w + g z \<noteq> 0
[PROOF STEP]
apply (clarsimp simp: dist_norm)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>w. \<lbrakk>w \<in> S; cmod (z - w) < \<delta>; 0 < \<delta>; \<And>w. \<lbrakk>w \<in> S; cmod (w - z) < \<delta>\<rbrakk> \<Longrightarrow> cmod (g w - g z) < cmod (g z); g w + g z = 0\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
by (metis \<open>g z \<noteq> 0\<close> add_diff_cancel_left' diff_0_right norm_eq_zero norm_increases_online norm_minus_commute norm_not_less_zero not_less_iff_gr_or_eq)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?w \<in> S; ?w \<in> ball z \<delta>\<rbrakk> \<Longrightarrow> g ?w + g z \<noteq> 0

goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> \<exists>f'. (g has_field_derivative f') (at x)
[PROOF STEP]
have *: "(\<lambda>x. (f x - f z) / (x - z) / (g x + g z)) \<midarrow>z\<rightarrow> deriv f z / (g z + g z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. (f x - f z) / (x - z) / (g x + g z)) \<midarrow>z\<rightarrow> deriv f z / (g z + g z)
[PROOF STEP]
apply (intro tendsto_intros)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. (\<lambda>x. (f x - f z) / (x - z)) \<midarrow>z\<rightarrow> deriv f z
 2. g \<midarrow>z\<rightarrow> g z
 3. g z + g z \<noteq> 0
[PROOF STEP]
using SC_Chain.openS SC_Chain_axioms \<open>f holomorphic_on S\<close> \<open>z \<in> S\<close> has_field_derivativeD holomorphic_derivI
[PROOF STATE]
proof (prove)
using this:
SC_Chain ?S \<Longrightarrow> open ?S
SC_Chain S
f holomorphic_on S
z \<in> S
(?f has_field_derivative ?D) (at ?x within ?S) \<Longrightarrow> ((\<lambda>y. (?f y - ?f ?x) / (y - ?x)) \<longlongrightarrow> ?D) (at ?x within ?S)
\<lbrakk>?f holomorphic_on ?S; open ?S; ?x \<in> ?S\<rbrakk> \<Longrightarrow> (?f has_field_derivative deriv ?f ?x) (at ?x within ?T)

goal (3 subgoals):
 1. (\<lambda>x. (f x - f z) / (x - z)) \<midarrow>z\<rightarrow> deriv f z
 2. g \<midarrow>z\<rightarrow> g z
 3. g z + g z \<noteq> 0
[PROOF STEP]
apply fastforce
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. g \<midarrow>z\<rightarrow> g z
 2. g z + g z \<noteq> 0
[PROOF STEP]
using \<open>z \<in> S\<close> contg continuous_on_eq_continuous_at isCont_def openS
[PROOF STATE]
proof (prove)
using this:
z \<in> S
continuous_on S g
open ?s \<Longrightarrow> continuous_on ?s ?f = (\<forall>x\<in>?s. isCont ?f x)
isCont ?f ?a = ?f \<midarrow>?a\<rightarrow> ?f ?a
open S

goal (2 subgoals):
 1. g \<midarrow>z\<rightarrow> g z
 2. g z + g z \<noteq> 0
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g z + g z \<noteq> 0
[PROOF STEP]
by (simp add: \<open>g z \<noteq> 0\<close>)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (f x - f z) / (x - z) / (g x + g z)) \<midarrow>z\<rightarrow> deriv f z / (g z + g z)

goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> \<exists>f'. (g has_field_derivative f') (at x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. (f x - f z) / (x - z) / (g x + g z)) \<midarrow>z\<rightarrow> deriv f z / (g z + g z)
[PROOF STEP]
have "(g has_field_derivative deriv f z / (g z + g z)) (at z)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. (f x - f z) / (x - z) / (g x + g z)) \<midarrow>z\<rightarrow> deriv f z / (g z + g z)

goal (1 subgoal):
 1. (g has_field_derivative deriv f z / (g z + g z)) (at z)
[PROOF STEP]
unfolding has_field_derivative_iff
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. (f x - f z) / (x - z) / (g x + g z)) \<midarrow>z\<rightarrow> deriv f z / (g z + g z)

goal (1 subgoal):
 1. (\<lambda>y. (g y - g z) / (y - z)) \<midarrow>z\<rightarrow> deriv f z / (g z + g z)
[PROOF STEP]
proof (rule Lim_transform_within_open)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. open ?s
 2. z \<in> ?s
 3. \<And>x. \<lbrakk>x \<in> ?s; x \<noteq> z\<rbrakk> \<Longrightarrow> (f x - f z) / (x - z) / (g x + g z) = (g x - g z) / (x - z)
[PROOF STEP]
show "open (ball z \<delta> \<inter> S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open (ball z \<delta> \<inter> S)
[PROOF STEP]
by (simp add: openS open_Int)
[PROOF STATE]
proof (state)
this:
open (ball z \<delta> \<inter> S)

goal (2 subgoals):
 1. z \<in> ball z \<delta> \<inter> S
 2. \<And>x. \<lbrakk>x \<in> ball z \<delta> \<inter> S; x \<noteq> z\<rbrakk> \<Longrightarrow> (f x - f z) / (x - z) / (g x + g z) = (g x - g z) / (x - z)
[PROOF STEP]
show "z \<in> ball z \<delta> \<inter> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<in> ball z \<delta> \<inter> S
[PROOF STEP]
using \<open>z \<in> S\<close> \<open>0 < \<delta>\<close>
[PROOF STATE]
proof (prove)
using this:
z \<in> S
0 < \<delta>

goal (1 subgoal):
 1. z \<in> ball z \<delta> \<inter> S
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
z \<in> ball z \<delta> \<inter> S

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> ball z \<delta> \<inter> S; x \<noteq> z\<rbrakk> \<Longrightarrow> (f x - f z) / (x - z) / (g x + g z) = (g x - g z) / (x - z)
[PROOF STEP]
show "\<And>x. \<lbrakk>x \<in> ball z \<delta> \<inter> S; x \<noteq> z\<rbrakk>
                  \<Longrightarrow> (f x - f z) / (x - z) / (g x + g z) = (g x - g z) / (x - z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> ball z \<delta> \<inter> S; x \<noteq> z\<rbrakk> \<Longrightarrow> (f x - f z) / (x - z) / (g x + g z) = (g x - g z) / (x - z)
[PROOF STEP]
using \<delta>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?w \<in> S; ?w \<in> ball z \<delta>\<rbrakk> \<Longrightarrow> g ?w + g z \<noteq> 0

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> ball z \<delta> \<inter> S; x \<noteq> z\<rbrakk> \<Longrightarrow> (f x - f z) / (x - z) / (g x + g z) = (g x - g z) / (x - z)
[PROOF STEP]
apply (simp add: geq \<open>z \<in> S\<close> divide_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>dist z x < \<delta> \<and> x \<in> S; x \<noteq> z; \<And>w. \<lbrakk>w \<in> S; dist z w < \<delta>\<rbrakk> \<Longrightarrow> g w + g z \<noteq> 0\<rbrakk> \<Longrightarrow> (g x)\<^sup>2 - (g z)\<^sup>2 = (g x - g z) * (g x + g z)
[PROOF STEP]
apply (auto simp: algebra_simps power2_eq_square)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x \<in> ball z \<delta> \<inter> S; ?x \<noteq> z\<rbrakk> \<Longrightarrow> (f ?x - f z) / (?x - z) / (g ?x + g z) = (g ?x - g z) / (?x - z)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(g has_field_derivative deriv f z / (g z + g z)) (at z)

goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> \<exists>f'. (g has_field_derivative f') (at x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(g has_field_derivative deriv f z / (g z + g z)) (at z)
[PROOF STEP]
show "\<exists>f'. (g has_field_derivative f') (at z)"
[PROOF STATE]
proof (prove)
using this:
(g has_field_derivative deriv f z / (g z + g z)) (at z)

goal (1 subgoal):
 1. \<exists>f'. (g has_field_derivative f') (at z)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<exists>f'. (g has_field_derivative f') (at z)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
g holomorphic_on S

goal (1 subgoal):
 1. \<And>z. z \<in> S \<Longrightarrow> f z = (g z)\<^sup>2
[PROOF STEP]
qed (use geq in auto)
[PROOF STATE]
proof (state)
this:
\<exists>g. g holomorphic_on S \<and> (\<forall>z\<in>S. f z = (g z)\<^sup>2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mono_Mu:
  assumes A : "mono P"
  and     B : "\<And> X. mono (P X)"
  shows  "mono (lfp P)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mono (lfp P)
[PROOF STEP]
apply (subst lfp_unfold)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. mono P
 2. mono (P (lfp P))
[PROOF STEP]
apply (auto simp: A B)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma winding_number_negatepath:
  assumes \<gamma>: "valid_path \<gamma>" and 0: "0 \<notin> path_image \<gamma>"
  shows "winding_number(uminus \<circ> \<gamma>) 0 = winding_number \<gamma> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. winding_number (uminus \<circ> \<gamma>) 0 = winding_number \<gamma> 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. winding_number (uminus \<circ> \<gamma>) 0 = winding_number \<gamma> 0
[PROOF STEP]
have "(/) 1 contour_integrable_on \<gamma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (/) 1 contour_integrable_on \<gamma>
[PROOF STEP]
using "0" \<gamma> contour_integrable_inversediff
[PROOF STATE]
proof (prove)
using this:
0 \<notin> path_image \<gamma>
valid_path \<gamma>
\<lbrakk>valid_path ?g; ?z \<notin> path_image ?g\<rbrakk> \<Longrightarrow> (\<lambda>w. 1 / (w - ?z)) contour_integrable_on ?g

goal (1 subgoal):
 1. (/) 1 contour_integrable_on \<gamma>
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(/) 1 contour_integrable_on \<gamma>

goal (1 subgoal):
 1. winding_number (uminus \<circ> \<gamma>) 0 = winding_number \<gamma> 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(/) 1 contour_integrable_on \<gamma>
[PROOF STEP]
have "((\<lambda>z. 1/z) has_contour_integral contour_integral \<gamma> ((/) 1)) \<gamma>"
[PROOF STATE]
proof (prove)
using this:
(/) 1 contour_integrable_on \<gamma>

goal (1 subgoal):
 1. ((/) 1 has_contour_integral contour_integral \<gamma> ((/) 1)) \<gamma>
[PROOF STEP]
by (rule has_contour_integral_integral)
[PROOF STATE]
proof (state)
this:
((/) 1 has_contour_integral contour_integral \<gamma> ((/) 1)) \<gamma>

goal (1 subgoal):
 1. winding_number (uminus \<circ> \<gamma>) 0 = winding_number \<gamma> 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((/) 1 has_contour_integral contour_integral \<gamma> ((/) 1)) \<gamma>
[PROOF STEP]
have "((\<lambda>z. 1 / - z) has_contour_integral - contour_integral \<gamma> ((/) 1)) \<gamma>"
[PROOF STATE]
proof (prove)
using this:
((/) 1 has_contour_integral contour_integral \<gamma> ((/) 1)) \<gamma>

goal (1 subgoal):
 1. ((\<lambda>z. 1 / - z) has_contour_integral - contour_integral \<gamma> ((/) 1)) \<gamma>
[PROOF STEP]
using has_contour_integral_neg
[PROOF STATE]
proof (prove)
using this:
((/) 1 has_contour_integral contour_integral \<gamma> ((/) 1)) \<gamma>
(?f has_contour_integral ?i) ?g \<Longrightarrow> ((\<lambda>x. - ?f x) has_contour_integral - ?i) ?g

goal (1 subgoal):
 1. ((\<lambda>z. 1 / - z) has_contour_integral - contour_integral \<gamma> ((/) 1)) \<gamma>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((\<lambda>z. 1 / - z) has_contour_integral - contour_integral \<gamma> ((/) 1)) \<gamma>

goal (1 subgoal):
 1. winding_number (uminus \<circ> \<gamma>) 0 = winding_number \<gamma> 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>z. 1 / - z) has_contour_integral - contour_integral \<gamma> ((/) 1)) \<gamma>
[PROOF STEP]
have "contour_integral (uminus \<circ> \<gamma>) ((/) 1) =
        contour_integral \<gamma> ((/) 1)"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>z. 1 / - z) has_contour_integral - contour_integral \<gamma> ((/) 1)) \<gamma>

goal (1 subgoal):
 1. contour_integral (uminus \<circ> \<gamma>) ((/) 1) = contour_integral \<gamma> ((/) 1)
[PROOF STEP]
using \<gamma>
[PROOF STATE]
proof (prove)
using this:
((\<lambda>z. 1 / - z) has_contour_integral - contour_integral \<gamma> ((/) 1)) \<gamma>
valid_path \<gamma>

goal (1 subgoal):
 1. contour_integral (uminus \<circ> \<gamma>) ((/) 1) = contour_integral \<gamma> ((/) 1)
[PROOF STEP]
by (simp add: contour_integral_unique has_contour_integral_negatepath)
[PROOF STATE]
proof (state)
this:
contour_integral (uminus \<circ> \<gamma>) ((/) 1) = contour_integral \<gamma> ((/) 1)

goal (1 subgoal):
 1. winding_number (uminus \<circ> \<gamma>) 0 = winding_number \<gamma> 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
contour_integral (uminus \<circ> \<gamma>) ((/) 1) = contour_integral \<gamma> ((/) 1)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
contour_integral (uminus \<circ> \<gamma>) ((/) 1) = contour_integral \<gamma> ((/) 1)

goal (1 subgoal):
 1. winding_number (uminus \<circ> \<gamma>) 0 = winding_number \<gamma> 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
contour_integral (uminus \<circ> \<gamma>) ((/) 1) = contour_integral \<gamma> ((/) 1)
valid_path \<gamma>
0 \<notin> path_image \<gamma>

goal (1 subgoal):
 1. winding_number (uminus \<circ> \<gamma>) 0 = winding_number \<gamma> 0
[PROOF STEP]
by (simp add: winding_number_valid_path valid_path_negatepath image_def path_defs)
[PROOF STATE]
proof (state)
this:
winding_number (uminus \<circ> \<gamma>) 0 = winding_number \<gamma> 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma filter_inf_right_dist_sup:
  assumes "filter F"
      and "filter G"
      and "filter H"
    shows "filter_sup F G \<inter> H = filter_sup (F \<inter> H) (G \<inter> H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filter_sup F G \<inter> H = filter_sup (F \<inter> H) (G \<inter> H)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. filter_sup F G \<inter> H = filter_sup (F \<inter> H) (G \<inter> H)
[PROOF STEP]
have "filter_sup (F \<inter> H) (G \<inter> H) = filter_sup (F \<inter> H) G \<inter> filter_sup (F \<inter> H) H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filter_sup (F \<inter> H) (G \<inter> H) = filter_sup (F \<inter> H) G \<inter> filter_sup (F \<inter> H) H
[PROOF STEP]
by (simp add: assms filter_sup_left_dist_inf filter_inf)
[PROOF STATE]
proof (state)
this:
filter_sup (F \<inter> H) (G \<inter> H) = filter_sup (F \<inter> H) G \<inter> filter_sup (F \<inter> H) H

goal (1 subgoal):
 1. filter_sup F G \<inter> H = filter_sup (F \<inter> H) (G \<inter> H)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
filter_sup (F \<inter> H) (G \<inter> H) = filter_sup (F \<inter> H) G \<inter> filter_sup (F \<inter> H) H

goal (1 subgoal):
 1. filter_sup F G \<inter> H = filter_sup (F \<inter> H) (G \<inter> H)
[PROOF STEP]
have "... = filter_sup (F \<inter> H) G \<inter> H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filter_sup (F \<inter> H) G \<inter> filter_sup (F \<inter> H) H = filter_sup (F \<inter> H) G \<inter> H
[PROOF STEP]
using assms(1,3) filter_sup_absorb_inf
[PROOF STATE]
proof (prove)
using this:
ord_class.filter F
ord_class.filter H
\<lbrakk>ord_class.filter ?F; ord_class.filter ?G\<rbrakk> \<Longrightarrow> filter_sup (?F \<inter> ?G) ?G = ?G

goal (1 subgoal):
 1. filter_sup (F \<inter> H) G \<inter> filter_sup (F \<inter> H) H = filter_sup (F \<inter> H) G \<inter> H
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
filter_sup (F \<inter> H) G \<inter> filter_sup (F \<inter> H) H = filter_sup (F \<inter> H) G \<inter> H

goal (1 subgoal):
 1. filter_sup F G \<inter> H = filter_sup (F \<inter> H) (G \<inter> H)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
filter_sup (F \<inter> H) G \<inter> filter_sup (F \<inter> H) H = filter_sup (F \<inter> H) G \<inter> H

goal (1 subgoal):
 1. filter_sup F G \<inter> H = filter_sup (F \<inter> H) (G \<inter> H)
[PROOF STEP]
have "... = filter_sup F G \<inter> filter_sup G H \<inter> H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filter_sup (F \<inter> H) G \<inter> H = filter_sup F G \<inter> filter_sup G H \<inter> H
[PROOF STEP]
using assms filter_sup_left_dist_inf filter_sup_symmetric
[PROOF STATE]
proof (prove)
using this:
ord_class.filter F
ord_class.filter G
ord_class.filter H
\<lbrakk>ord_class.filter ?F; ord_class.filter ?G; ord_class.filter ?H\<rbrakk> \<Longrightarrow> filter_sup ?F (?G \<inter> ?H) = filter_sup ?F ?G \<inter> filter_sup ?F ?H
filter_sup ?F ?G = filter_sup ?G ?F

goal (1 subgoal):
 1. filter_sup (F \<inter> H) G \<inter> H = filter_sup F G \<inter> filter_sup G H \<inter> H
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
filter_sup (F \<inter> H) G \<inter> H = filter_sup F G \<inter> filter_sup G H \<inter> H

goal (1 subgoal):
 1. filter_sup F G \<inter> H = filter_sup (F \<inter> H) (G \<inter> H)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
filter_sup (F \<inter> H) G \<inter> H = filter_sup F G \<inter> filter_sup G H \<inter> H

goal (1 subgoal):
 1. filter_sup F G \<inter> H = filter_sup (F \<inter> H) (G \<inter> H)
[PROOF STEP]
have "... = filter_sup F G \<inter> H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filter_sup F G \<inter> filter_sup G H \<inter> H = filter_sup F G \<inter> H
[PROOF STEP]
by (simp add: assms(2-3) filter_inf_absorb_sup semilattice_inf_class.inf_assoc)
[PROOF STATE]
proof (state)
this:
filter_sup F G \<inter> filter_sup G H \<inter> H = filter_sup F G \<inter> H

goal (1 subgoal):
 1. filter_sup F G \<inter> H = filter_sup (F \<inter> H) (G \<inter> H)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
filter_sup (F \<inter> H) (G \<inter> H) = filter_sup F G \<inter> H
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
filter_sup (F \<inter> H) (G \<inter> H) = filter_sup F G \<inter> H

goal (1 subgoal):
 1. filter_sup F G \<inter> H = filter_sup (F \<inter> H) (G \<inter> H)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
filter_sup F G \<inter> H = filter_sup (F \<inter> H) (G \<inter> H)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_categoryI'':
  assumes "tiny_category \<alpha> \<CC>" and "vfinite (\<CC>\<lparr>Obj\<rparr>)" and "vfinite (\<CC>\<lparr>Arr\<rparr>)"
  shows "finite_category \<alpha> \<CC>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_category \<alpha> \<CC>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
tiny_category \<alpha> \<CC>
vfinite (\<CC>\<lparr>Obj\<rparr>)
vfinite (\<CC>\<lparr>Arr\<rparr>)

goal (1 subgoal):
 1. finite_category \<alpha> \<CC>
[PROOF STEP]
by (intro finite_categoryI') (auto intro: cat_small_cs_intros)


[STATEMENT]
lemma totalize_Join: "totalize F\<squnion>totalize G = totalize (F\<squnion>G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. totalize F \<squnion> totalize G = totalize (F \<squnion> G)
[PROOF STEP]
by (simp add: program_equalityI totalize_def Join_def image_Un)


[STATEMENT]
lemma (in product_sigma_finite) product_nn_integral_prod:
  assumes "finite I" "\<And>i. i \<in> I \<Longrightarrow> f i \<in> borel_measurable (M i)"
  shows "(\<integral>\<^sup>+ x. (\<Prod>i\<in>I. f i (x i)) \<partial>Pi\<^sub>M I M) = (\<Prod>i\<in>I. integral\<^sup>N (M i) (f i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (\<Prod>i\<in>I. f i (x i)) \<partial>Pi\<^sub>M I M = (\<Prod>i\<in>I. integral\<^sup>N (M i) (f i))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite I
?i \<in> I \<Longrightarrow> f ?i \<in> borel_measurable (M ?i)

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (\<Prod>i\<in>I. f i (x i)) \<partial>Pi\<^sub>M I M = (\<Prod>i\<in>I. integral\<^sup>N (M i) (f i))
[PROOF STEP]
proof (induction I)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<And>i. i \<in> {} \<Longrightarrow> f i \<in> borel_measurable (M i)) \<Longrightarrow> \<integral>\<^sup>+ x. (\<Prod>i\<in>{}. f i (x i)) \<partial>Pi\<^sub>M {} M = (\<Prod>i\<in>{}. integral\<^sup>N (M i) (f i))
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> f i \<in> borel_measurable (M i)) \<Longrightarrow> \<integral>\<^sup>+ x. (\<Prod>i\<in>F. f i (x i)) \<partial>Pi\<^sub>M F M = (\<Prod>i\<in>F. integral\<^sup>N (M i) (f i)); \<And>i. i \<in> insert x F \<Longrightarrow> f i \<in> borel_measurable (M i)\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+ xa. (\<Prod>i\<in>insert x F. f i (xa i)) \<partial>Pi\<^sub>M (insert x F) M = (\<Prod>i\<in>insert x F. integral\<^sup>N (M i) (f i))
[PROOF STEP]
case (insert i I)
[PROOF STATE]
proof (state)
this:
finite I
i \<notin> I
(\<And>i. i \<in> I \<Longrightarrow> f i \<in> borel_measurable (M i)) \<Longrightarrow> \<integral>\<^sup>+ x. (\<Prod>i\<in>I. f i (x i)) \<partial>Pi\<^sub>M I M = (\<Prod>i\<in>I. integral\<^sup>N (M i) (f i))
?i \<in> insert i I \<Longrightarrow> f ?i \<in> borel_measurable (M ?i)

goal (2 subgoals):
 1. (\<And>i. i \<in> {} \<Longrightarrow> f i \<in> borel_measurable (M i)) \<Longrightarrow> \<integral>\<^sup>+ x. (\<Prod>i\<in>{}. f i (x i)) \<partial>Pi\<^sub>M {} M = (\<Prod>i\<in>{}. integral\<^sup>N (M i) (f i))
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> f i \<in> borel_measurable (M i)) \<Longrightarrow> \<integral>\<^sup>+ x. (\<Prod>i\<in>F. f i (x i)) \<partial>Pi\<^sub>M F M = (\<Prod>i\<in>F. integral\<^sup>N (M i) (f i)); \<And>i. i \<in> insert x F \<Longrightarrow> f i \<in> borel_measurable (M i)\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+ xa. (\<Prod>i\<in>insert x F. f i (xa i)) \<partial>Pi\<^sub>M (insert x F) M = (\<Prod>i\<in>insert x F. integral\<^sup>N (M i) (f i))
[PROOF STEP]
note insert.prems[measurable]
[PROOF STATE]
proof (state)
this:
?i \<in> insert i I \<Longrightarrow> f ?i \<in> borel_measurable (M ?i)

goal (2 subgoals):
 1. (\<And>i. i \<in> {} \<Longrightarrow> f i \<in> borel_measurable (M i)) \<Longrightarrow> \<integral>\<^sup>+ x. (\<Prod>i\<in>{}. f i (x i)) \<partial>Pi\<^sub>M {} M = (\<Prod>i\<in>{}. integral\<^sup>N (M i) (f i))
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> f i \<in> borel_measurable (M i)) \<Longrightarrow> \<integral>\<^sup>+ x. (\<Prod>i\<in>F. f i (x i)) \<partial>Pi\<^sub>M F M = (\<Prod>i\<in>F. integral\<^sup>N (M i) (f i)); \<And>i. i \<in> insert x F \<Longrightarrow> f i \<in> borel_measurable (M i)\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+ xa. (\<Prod>i\<in>insert x F. f i (xa i)) \<partial>Pi\<^sub>M (insert x F) M = (\<Prod>i\<in>insert x F. integral\<^sup>N (M i) (f i))
[PROOF STEP]
note \<open>finite I\<close>[intro, simp]
[PROOF STATE]
proof (state)
this:
finite I

goal (2 subgoals):
 1. (\<And>i. i \<in> {} \<Longrightarrow> f i \<in> borel_measurable (M i)) \<Longrightarrow> \<integral>\<^sup>+ x. (\<Prod>i\<in>{}. f i (x i)) \<partial>Pi\<^sub>M {} M = (\<Prod>i\<in>{}. integral\<^sup>N (M i) (f i))
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> f i \<in> borel_measurable (M i)) \<Longrightarrow> \<integral>\<^sup>+ x. (\<Prod>i\<in>F. f i (x i)) \<partial>Pi\<^sub>M F M = (\<Prod>i\<in>F. integral\<^sup>N (M i) (f i)); \<And>i. i \<in> insert x F \<Longrightarrow> f i \<in> borel_measurable (M i)\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+ xa. (\<Prod>i\<in>insert x F. f i (xa i)) \<partial>Pi\<^sub>M (insert x F) M = (\<Prod>i\<in>insert x F. integral\<^sup>N (M i) (f i))
[PROOF STEP]
interpret I: finite_product_sigma_finite M I
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_product_sigma_finite M I
[PROOF STEP]
by standard auto
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<And>i. i \<in> {} \<Longrightarrow> f i \<in> borel_measurable (M i)) \<Longrightarrow> \<integral>\<^sup>+ x. (\<Prod>i\<in>{}. f i (x i)) \<partial>Pi\<^sub>M {} M = (\<Prod>i\<in>{}. integral\<^sup>N (M i) (f i))
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> f i \<in> borel_measurable (M i)) \<Longrightarrow> \<integral>\<^sup>+ x. (\<Prod>i\<in>F. f i (x i)) \<partial>Pi\<^sub>M F M = (\<Prod>i\<in>F. integral\<^sup>N (M i) (f i)); \<And>i. i \<in> insert x F \<Longrightarrow> f i \<in> borel_measurable (M i)\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+ xa. (\<Prod>i\<in>insert x F. f i (xa i)) \<partial>Pi\<^sub>M (insert x F) M = (\<Prod>i\<in>insert x F. integral\<^sup>N (M i) (f i))
[PROOF STEP]
have *: "\<And>x y. (\<Prod>j\<in>I. f j (if j = i then y else x j)) = (\<Prod>j\<in>I. f j (x j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. (\<Prod>j\<in>I. f j (if j = i then y else x j)) = (\<Prod>j\<in>I. f j (x j))
[PROOF STEP]
using insert
[PROOF STATE]
proof (prove)
using this:
finite I
i \<notin> I
(\<And>i. i \<in> I \<Longrightarrow> f i \<in> borel_measurable (M i)) \<Longrightarrow> \<integral>\<^sup>+ x. (\<Prod>i\<in>I. f i (x i)) \<partial>Pi\<^sub>M I M = (\<Prod>i\<in>I. integral\<^sup>N (M i) (f i))
?i \<in> insert i I \<Longrightarrow> f ?i \<in> borel_measurable (M ?i)

goal (1 subgoal):
 1. \<And>x y. (\<Prod>j\<in>I. f j (if j = i then y else x j)) = (\<Prod>j\<in>I. f j (x j))
[PROOF STEP]
by (auto intro!: prod.cong)
[PROOF STATE]
proof (state)
this:
(\<Prod>j\<in>I. f j (if j = i then ?y else ?x j)) = (\<Prod>j\<in>I. f j (?x j))

goal (2 subgoals):
 1. (\<And>i. i \<in> {} \<Longrightarrow> f i \<in> borel_measurable (M i)) \<Longrightarrow> \<integral>\<^sup>+ x. (\<Prod>i\<in>{}. f i (x i)) \<partial>Pi\<^sub>M {} M = (\<Prod>i\<in>{}. integral\<^sup>N (M i) (f i))
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> f i \<in> borel_measurable (M i)) \<Longrightarrow> \<integral>\<^sup>+ x. (\<Prod>i\<in>F. f i (x i)) \<partial>Pi\<^sub>M F M = (\<Prod>i\<in>F. integral\<^sup>N (M i) (f i)); \<And>i. i \<in> insert x F \<Longrightarrow> f i \<in> borel_measurable (M i)\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+ xa. (\<Prod>i\<in>insert x F. f i (xa i)) \<partial>Pi\<^sub>M (insert x F) M = (\<Prod>i\<in>insert x F. integral\<^sup>N (M i) (f i))
[PROOF STEP]
have prod: "\<And>J. J \<subseteq> insert i I \<Longrightarrow> (\<lambda>x. (\<Prod>i\<in>J. f i (x i))) \<in> borel_measurable (Pi\<^sub>M J M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>J. J \<subseteq> insert i I \<Longrightarrow> (\<lambda>x. \<Prod>i\<in>J. f i (x i)) \<in> borel_measurable (Pi\<^sub>M J M)
[PROOF STEP]
using sets.sets_into_space insert
[PROOF STATE]
proof (prove)
using this:
?x \<in> sets ?M \<Longrightarrow> ?x \<subseteq> space ?M
finite I
i \<notin> I
(\<And>i. i \<in> I \<Longrightarrow> f i \<in> borel_measurable (M i)) \<Longrightarrow> \<integral>\<^sup>+ x. (\<Prod>i\<in>I. f i (x i)) \<partial>Pi\<^sub>M I M = (\<Prod>i\<in>I. integral\<^sup>N (M i) (f i))
?i \<in> insert i I \<Longrightarrow> f ?i \<in> borel_measurable (M ?i)

goal (1 subgoal):
 1. \<And>J. J \<subseteq> insert i I \<Longrightarrow> (\<lambda>x. \<Prod>i\<in>J. f i (x i)) \<in> borel_measurable (Pi\<^sub>M J M)
[PROOF STEP]
by (intro borel_measurable_prod_ennreal
              measurable_comp[OF measurable_component_singleton, unfolded comp_def])
       auto
[PROOF STATE]
proof (state)
this:
?J \<subseteq> insert i I \<Longrightarrow> (\<lambda>x. \<Prod>i\<in>?J. f i (x i)) \<in> borel_measurable (Pi\<^sub>M ?J M)

goal (2 subgoals):
 1. (\<And>i. i \<in> {} \<Longrightarrow> f i \<in> borel_measurable (M i)) \<Longrightarrow> \<integral>\<^sup>+ x. (\<Prod>i\<in>{}. f i (x i)) \<partial>Pi\<^sub>M {} M = (\<Prod>i\<in>{}. integral\<^sup>N (M i) (f i))
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> f i \<in> borel_measurable (M i)) \<Longrightarrow> \<integral>\<^sup>+ x. (\<Prod>i\<in>F. f i (x i)) \<partial>Pi\<^sub>M F M = (\<Prod>i\<in>F. integral\<^sup>N (M i) (f i)); \<And>i. i \<in> insert x F \<Longrightarrow> f i \<in> borel_measurable (M i)\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+ xa. (\<Prod>i\<in>insert x F. f i (xa i)) \<partial>Pi\<^sub>M (insert x F) M = (\<Prod>i\<in>insert x F. integral\<^sup>N (M i) (f i))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?J \<subseteq> insert i I \<Longrightarrow> (\<lambda>x. \<Prod>i\<in>?J. f i (x i)) \<in> borel_measurable (Pi\<^sub>M ?J M)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
?J \<subseteq> insert i I \<Longrightarrow> (\<lambda>x. \<Prod>i\<in>?J. f i (x i)) \<in> borel_measurable (Pi\<^sub>M ?J M)

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. (\<Prod>i\<in>insert i I. f i (x i)) \<partial>Pi\<^sub>M (insert i I) M = (\<Prod>i\<in>insert i I. integral\<^sup>N (M i) (f i))
[PROOF STEP]
apply (simp add: product_nn_integral_insert[OF insert(1,2)])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>J. J \<subseteq> insert i I \<Longrightarrow> (\<lambda>x. \<Prod>i\<in>J. f i (x i)) \<in> borel_measurable (Pi\<^sub>M J M)) \<Longrightarrow> \<integral>\<^sup>+ x. \<integral>\<^sup>+ y. (\<Prod>ia\<in>insert i I. f ia (if ia = i then y else x ia)) \<partial>M i \<partial>Pi\<^sub>M I M = (\<Prod>i\<in>insert i I. integral\<^sup>N (M i) (f i))
[PROOF STEP]
apply (simp add: insert(2-) * nn_integral_multc)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>J. J \<subseteq> insert i I \<Longrightarrow> (\<lambda>x. \<Prod>i\<in>J. f i (x i)) \<in> borel_measurable (Pi\<^sub>M J M)) \<Longrightarrow> \<integral>\<^sup>+ x. integral\<^sup>N (M i) (f i) * (\<Prod>i\<in>I. f i (x i)) \<partial>Pi\<^sub>M I M = integral\<^sup>N (M i) (f i) * (\<Prod>i\<in>I. integral\<^sup>N (M i) (f i))
[PROOF STEP]
apply (subst nn_integral_cmult)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<And>J. J \<subseteq> insert i I \<Longrightarrow> (\<lambda>x. \<Prod>i\<in>J. f i (x i)) \<in> borel_measurable (Pi\<^sub>M J M)) \<Longrightarrow> (\<lambda>x. \<Prod>i\<in>I. f i (x i)) \<in> borel_measurable (Pi\<^sub>M I M)
 2. (\<And>J. J \<subseteq> insert i I \<Longrightarrow> (\<lambda>x. \<Prod>i\<in>J. f i (x i)) \<in> borel_measurable (Pi\<^sub>M J M)) \<Longrightarrow> integral\<^sup>N (M i) (f i) * \<integral>\<^sup>+ x. (\<Prod>i\<in>I. f i (x i)) \<partial>Pi\<^sub>M I M = integral\<^sup>N (M i) (f i) * (\<Prod>i\<in>I. integral\<^sup>N (M i) (f i))
[PROOF STEP]
apply (auto simp add: insert(2-))
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. (\<Prod>i\<in>insert i I. f i (x i)) \<partial>Pi\<^sub>M (insert i I) M = (\<Prod>i\<in>insert i I. integral\<^sup>N (M i) (f i))

goal (1 subgoal):
 1. (\<And>i. i \<in> {} \<Longrightarrow> f i \<in> borel_measurable (M i)) \<Longrightarrow> \<integral>\<^sup>+ x. (\<Prod>i\<in>{}. f i (x i)) \<partial>Pi\<^sub>M {} M = (\<Prod>i\<in>{}. integral\<^sup>N (M i) (f i))
[PROOF STEP]
qed (simp add: space_PiM)


[STATEMENT]
lemma TOP001_2:
 "(\<forall>Vf U. element_of_set(U::'a,union_of_members(Vf)) --> element_of_set(U::'a,f1(Vf::'a,U))) &
  (\<forall>U Vf. element_of_set(U::'a,union_of_members(Vf)) --> element_of_collection(f1(Vf::'a,U),Vf)) &
  (\<forall>U Uu1 Vf. element_of_set(U::'a,Uu1) & element_of_collection(Uu1::'a,Vf) --> element_of_set(U::'a,union_of_members(Vf))) &
  (\<forall>Vf X. basis(X::'a,Vf) --> equal_sets(union_of_members(Vf),X)) &
  (\<forall>Vf U X. element_of_collection(U::'a,top_of_basis(Vf)) & element_of_set(X::'a,U) --> element_of_set(X::'a,f10(Vf::'a,U,X))) &
  (\<forall>U X Vf. element_of_collection(U::'a,top_of_basis(Vf)) & element_of_set(X::'a,U) --> element_of_collection(f10(Vf::'a,U,X),Vf)) &
  (\<forall>X. subset_sets(X::'a,X)) &
  (\<forall>X U Y. subset_sets(X::'a,Y) & element_of_set(U::'a,X) --> element_of_set(U::'a,Y)) &
  (\<forall>X Y. equal_sets(X::'a,Y) --> subset_sets(X::'a,Y)) &
  (\<forall>Y X. subset_sets(X::'a,Y) | element_of_set(in_1st_set(X::'a,Y),X)) &
  (\<forall>X Y. element_of_set(in_1st_set(X::'a,Y),Y) --> subset_sets(X::'a,Y)) &
  (basis(cx::'a,f)) &
  (~subset_sets(union_of_members(top_of_basis(f)),cx)) --> False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>Vf U. element_of_set (U, union_of_members Vf) \<longrightarrow> element_of_set (U, f1 (Vf, U))) \<and> (\<forall>U Vf. element_of_set (U, union_of_members Vf) \<longrightarrow> element_of_collection (f1 (Vf, U), Vf)) \<and> (\<forall>U Uu1 Vf. element_of_set (U, Uu1) \<and> element_of_collection (Uu1, Vf) \<longrightarrow> element_of_set (U, union_of_members Vf)) \<and> (\<forall>Vf X. basis (X, Vf) \<longrightarrow> equal_sets (union_of_members Vf, X)) \<and> (\<forall>Vf U X. element_of_collection (U, top_of_basis Vf) \<and> element_of_set (X, U) \<longrightarrow> element_of_set (X, f10 (Vf, U, X))) \<and> (\<forall>U X Vf. element_of_collection (U, top_of_basis Vf) \<and> element_of_set (X, U) \<longrightarrow> element_of_collection (f10 (Vf, U, X), Vf)) \<and> (\<forall>X. subset_sets (X, X)) \<and> (\<forall>X U Y. subset_sets (X, Y) \<and> element_of_set (U, X) \<longrightarrow> element_of_set (U, Y)) \<and> (\<forall>X Y. equal_sets (X, Y) \<longrightarrow> subset_sets (X, Y)) \<and> (\<forall>Y X. subset_sets (X, Y) \<or> element_of_set (in_1st_set (X, Y), X)) \<and> (\<forall>X Y. element_of_set (in_1st_set (X, Y), Y) \<longrightarrow> subset_sets (X, Y)) \<and> basis (cx, f) \<and> \<not> subset_sets (union_of_members (top_of_basis f), cx) \<longrightarrow> False
[PROOF STEP]
by meson


[STATEMENT]
lemma funcset_vimage_diff:
  "f : A \<rightarrow> B \<Longrightarrow> A - f-`(B - C) = A \<inter> f-`C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> A \<rightarrow> B \<Longrightarrow> A - f -` (B - C) = A \<inter> f -` C
[PROOF STEP]
by (auto intro: funcset_mem)


[STATEMENT]
lemma reduced_labelling_unique:
  "r \<le> n \<Longrightarrow> \<forall>i<r. x i = 0 \<Longrightarrow> r = n \<or> x r \<noteq> 0 \<Longrightarrow> reduced n x = r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>r \<le> n; \<forall>i<r. x i = 0; r = n \<or> x r \<noteq> 0\<rbrakk> \<Longrightarrow> reduced n x = r
[PROOF STEP]
unfolding reduced_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>r \<le> n; \<forall>i<r. x i = 0; r = n \<or> x r \<noteq> 0\<rbrakk> \<Longrightarrow> (LEAST k. k = n \<or> x k \<noteq> 0) = r
[PROOF STEP]
by (rule LeastI2_wellorder[where a=n]) (metis le_less not_le)+


[STATEMENT]
lemma hcomplex_of_hypreal_mult_HComplex:
  "\<And>r x y. hcomplex_of_hypreal r * HComplex x y = HComplex (r * x) (r * y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>r x y. hcomplex_of_hypreal r * HComplex x y = HComplex (r * x) (r * y)
[PROOF STEP]
by transfer (rule complex_of_real_mult_Complex)


[STATEMENT]
lemma ordinal_plus_left_cancel [simp]:
"(w + x = w + y) = (x = (y::ordinal))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (w + x = w + y) = (x = y)
[PROOF STEP]
by (rule normal.cancel_eq[OF normal_plus])


[STATEMENT]
lemma upto_join: "\<lbrakk> i \<le> j; j \<le> k \<rbrakk> \<Longrightarrow> [i..j-1] @ j # [j+1..k] = [i..k]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i \<le> j; j \<le> k\<rbrakk> \<Longrightarrow> [i..j - 1] @ j # [j + 1..k] = [i..k]
[PROOF STEP]
using upto_rec1 upto_split1
[PROOF STATE]
proof (prove)
using this:
?i \<le> ?j \<Longrightarrow> [?i..?j] = ?i # [?i + 1..?j]
\<lbrakk>?i \<le> ?j; ?j \<le> ?k\<rbrakk> \<Longrightarrow> [?i..?k] = [?i..?j - 1] @ [?j..?k]

goal (1 subgoal):
 1. \<lbrakk>i \<le> j; j \<le> k\<rbrakk> \<Longrightarrow> [i..j - 1] @ j # [j + 1..k] = [i..k]
[PROOF STEP]
by auto


[STATEMENT]
lemma Inf_par_distrib: "D \<noteq> {} \<Longrightarrow> (\<Sqinter> D) \<parallel> c = (\<Sqinter>d\<in>D. d \<parallel> c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. D \<noteq> {} \<Longrightarrow> \<Sqinter> D \<parallel> c = (\<Sqinter>d::'a\<in>D. d \<parallel> c)
variables:
c :: 'a
(\<parallel>) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
D :: 'a set
type variables:
'a :: refinement_lattice
[PROOF STEP]
using par_Inf_distrib par_commute
[PROOF STATE]
proof (prove)
using this:
(?D::'a::refinement_lattice set) \<noteq> {} \<Longrightarrow> (?c::'a::refinement_lattice) \<parallel> \<Sqinter> ?D = \<Sqinter> ((\<parallel>) ?c ` ?D)
(?a::'a::refinement_lattice) \<parallel> (?b::'a::refinement_lattice) = ?b \<parallel> ?a

goal (1 subgoal):
 1. D \<noteq> {} \<Longrightarrow> \<Sqinter> D \<parallel> c = (\<Sqinter>d::'a\<in>D. d \<parallel> c)
variables:
c :: 'a
(\<parallel>) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
D :: 'a set
type variables:
'a :: refinement_lattice
[PROOF STEP]
by simp