[STATEMENT]
lemma flatten_set_group_hom:
  assumes group:"group G"
  assumes inj:"inj_on rep (carrier G)"
  shows "rep \<in> hom G (flatten G rep)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rep \<in> hom G (flatten G rep)
[PROOF STEP]
unfolding hom_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rep \<in> {h \<in> carrier G \<rightarrow> carrier (flatten G rep). \<forall>x\<in>carrier G. \<forall>y\<in>carrier G. h (x \<otimes>\<^bsub>G\<^esub> y) = h x \<otimes>\<^bsub>flatten G rep\<^esub> h y}
[PROOF STEP]
proof auto
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> carrier G \<Longrightarrow> rep x \<in> carrier (flatten G rep)
 2. \<And>x y. \<lbrakk>x \<in> carrier G; y \<in> carrier G\<rbrakk> \<Longrightarrow> rep (x \<otimes>\<^bsub>G\<^esub> y) = rep x \<otimes>\<^bsub>flatten G rep\<^esub> rep y
[PROOF STEP]
fix g
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> carrier G \<Longrightarrow> rep x \<in> carrier (flatten G rep)
 2. \<And>x y. \<lbrakk>x \<in> carrier G; y \<in> carrier G\<rbrakk> \<Longrightarrow> rep (x \<otimes>\<^bsub>G\<^esub> y) = rep x \<otimes>\<^bsub>flatten G rep\<^esub> rep y
[PROOF STEP]
assume g:"g \<in> carrier G"
[PROOF STATE]
proof (state)
this:
g \<in> carrier G

goal (2 subgoals):
 1. \<And>x. x \<in> carrier G \<Longrightarrow> rep x \<in> carrier (flatten G rep)
 2. \<And>x y. \<lbrakk>x \<in> carrier G; y \<in> carrier G\<rbrakk> \<Longrightarrow> rep (x \<otimes>\<^bsub>G\<^esub> y) = rep x \<otimes>\<^bsub>flatten G rep\<^esub> rep y
[PROOF STEP]
thus "rep g \<in> carrier (flatten G rep)"
[PROOF STATE]
proof (prove)
using this:
g \<in> carrier G

goal (1 subgoal):
 1. rep g \<in> carrier (flatten G rep)
[PROOF STEP]
unfolding flatten_def
[PROOF STATE]
proof (prove)
using this:
g \<in> carrier G

goal (1 subgoal):
 1. rep g \<in> carrier \<lparr>carrier = rep ` carrier G, monoid.mult = \<lambda>x y. rep (the_inv_into (carrier G) rep x \<otimes>\<^bsub>G\<^esub> the_inv_into (carrier G) rep y), one = rep \<one>\<^bsub>G\<^esub>\<rparr>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rep g \<in> carrier (flatten G rep)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier G; y \<in> carrier G\<rbrakk> \<Longrightarrow> rep (x \<otimes>\<^bsub>G\<^esub> y) = rep x \<otimes>\<^bsub>flatten G rep\<^esub> rep y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier G; y \<in> carrier G\<rbrakk> \<Longrightarrow> rep (x \<otimes>\<^bsub>G\<^esub> y) = rep x \<otimes>\<^bsub>flatten G rep\<^esub> rep y
[PROOF STEP]
fix g h
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier G; y \<in> carrier G\<rbrakk> \<Longrightarrow> rep (x \<otimes>\<^bsub>G\<^esub> y) = rep x \<otimes>\<^bsub>flatten G rep\<^esub> rep y
[PROOF STEP]
assume g:"g \<in> carrier G" and h:"h \<in> carrier G"
[PROOF STATE]
proof (state)
this:
g \<in> carrier G
h \<in> carrier G

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier G; y \<in> carrier G\<rbrakk> \<Longrightarrow> rep (x \<otimes>\<^bsub>G\<^esub> y) = rep x \<otimes>\<^bsub>flatten G rep\<^esub> rep y
[PROOF STEP]
hence "rep g \<in> carrier (flatten G rep)" "rep h \<in> carrier (flatten G rep)"
[PROOF STATE]
proof (prove)
using this:
g \<in> carrier G
h \<in> carrier G

goal (1 subgoal):
 1. rep g \<in> carrier (flatten G rep) &&& rep h \<in> carrier (flatten G rep)
[PROOF STEP]
unfolding flatten_def
[PROOF STATE]
proof (prove)
using this:
g \<in> carrier G
h \<in> carrier G

goal (1 subgoal):
 1. rep g \<in> carrier \<lparr>carrier = rep ` carrier G, monoid.mult = \<lambda>x y. rep (the_inv_into (carrier G) rep x \<otimes>\<^bsub>G\<^esub> the_inv_into (carrier G) rep y), one = rep \<one>\<^bsub>G\<^esub>\<rparr> &&& rep h \<in> carrier \<lparr>carrier = rep ` carrier G, monoid.mult = \<lambda>x y. rep (the_inv_into (carrier G) rep x \<otimes>\<^bsub>G\<^esub> the_inv_into (carrier G) rep y), one = rep \<one>\<^bsub>G\<^esub>\<rparr>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rep g \<in> carrier (flatten G rep)
rep h \<in> carrier (flatten G rep)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier G; y \<in> carrier G\<rbrakk> \<Longrightarrow> rep (x \<otimes>\<^bsub>G\<^esub> y) = rep x \<otimes>\<^bsub>flatten G rep\<^esub> rep y
[PROOF STEP]
hence "rep g \<otimes>\<^bsub>flatten G rep\<^esub> rep h
    = rep (the_inv_into (carrier G) rep (rep g) \<otimes>\<^bsub>G\<^esub> the_inv_into (carrier G) rep (rep h))"
[PROOF STATE]
proof (prove)
using this:
rep g \<in> carrier (flatten G rep)
rep h \<in> carrier (flatten G rep)

goal (1 subgoal):
 1. rep g \<otimes>\<^bsub>flatten G rep\<^esub> rep h = rep (the_inv_into (carrier G) rep (rep g) \<otimes>\<^bsub>G\<^esub> the_inv_into (carrier G) rep (rep h))
[PROOF STEP]
unfolding flatten_def
[PROOF STATE]
proof (prove)
using this:
rep g \<in> carrier \<lparr>carrier = rep ` carrier G, monoid.mult = \<lambda>x y. rep (the_inv_into (carrier G) rep x \<otimes>\<^bsub>G\<^esub> the_inv_into (carrier G) rep y), one = rep \<one>\<^bsub>G\<^esub>\<rparr>
rep h \<in> carrier \<lparr>carrier = rep ` carrier G, monoid.mult = \<lambda>x y. rep (the_inv_into (carrier G) rep x \<otimes>\<^bsub>G\<^esub> the_inv_into (carrier G) rep y), one = rep \<one>\<^bsub>G\<^esub>\<rparr>

goal (1 subgoal):
 1. rep g \<otimes>\<^bsub>\<lparr>carrier = rep ` carrier G, monoid.mult = \<lambda>x y. rep (the_inv_into (carrier G) rep x \<otimes>\<^bsub>G\<^esub> the_inv_into (carrier G) rep y), one = rep \<one>\<^bsub>G\<^esub>\<rparr>\<^esub> rep h = rep (the_inv_into (carrier G) rep (rep g) \<otimes>\<^bsub>G\<^esub> the_inv_into (carrier G) rep (rep h))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rep g \<otimes>\<^bsub>flatten G rep\<^esub> rep h = rep (the_inv_into (carrier G) rep (rep g) \<otimes>\<^bsub>G\<^esub> the_inv_into (carrier G) rep (rep h))

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier G; y \<in> carrier G\<rbrakk> \<Longrightarrow> rep (x \<otimes>\<^bsub>G\<^esub> y) = rep x \<otimes>\<^bsub>flatten G rep\<^esub> rep y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
rep g \<otimes>\<^bsub>flatten G rep\<^esub> rep h = rep (the_inv_into (carrier G) rep (rep g) \<otimes>\<^bsub>G\<^esub> the_inv_into (carrier G) rep (rep h))

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier G; y \<in> carrier G\<rbrakk> \<Longrightarrow> rep (x \<otimes>\<^bsub>G\<^esub> y) = rep x \<otimes>\<^bsub>flatten G rep\<^esub> rep y
[PROOF STEP]
have "\<dots> = rep (g \<otimes>\<^bsub>G\<^esub> h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rep (the_inv_into (carrier G) rep (rep g) \<otimes>\<^bsub>G\<^esub> the_inv_into (carrier G) rep (rep h)) = rep (g \<otimes>\<^bsub>G\<^esub> h)
[PROOF STEP]
using inj g h
[PROOF STATE]
proof (prove)
using this:
inj_on rep (carrier G)
g \<in> carrier G
h \<in> carrier G

goal (1 subgoal):
 1. rep (the_inv_into (carrier G) rep (rep g) \<otimes>\<^bsub>G\<^esub> the_inv_into (carrier G) rep (rep h)) = rep (g \<otimes>\<^bsub>G\<^esub> h)
[PROOF STEP]
by (metis the_inv_into_f_f)
[PROOF STATE]
proof (state)
this:
rep (the_inv_into (carrier G) rep (rep g) \<otimes>\<^bsub>G\<^esub> the_inv_into (carrier G) rep (rep h)) = rep (g \<otimes>\<^bsub>G\<^esub> h)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier G; y \<in> carrier G\<rbrakk> \<Longrightarrow> rep (x \<otimes>\<^bsub>G\<^esub> y) = rep x \<otimes>\<^bsub>flatten G rep\<^esub> rep y
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
rep g \<otimes>\<^bsub>flatten G rep\<^esub> rep h = rep (g \<otimes>\<^bsub>G\<^esub> h)
[PROOF STEP]
show "rep (g \<otimes>\<^bsub>G\<^esub> h) = rep g \<otimes>\<^bsub>flatten G rep\<^esub> rep h"
[PROOF STATE]
proof (prove)
using this:
rep g \<otimes>\<^bsub>flatten G rep\<^esub> rep h = rep (g \<otimes>\<^bsub>G\<^esub> h)

goal (1 subgoal):
 1. rep (g \<otimes>\<^bsub>G\<^esub> h) = rep g \<otimes>\<^bsub>flatten G rep\<^esub> rep h
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
rep (g \<otimes>\<^bsub>G\<^esub> h) = rep g \<otimes>\<^bsub>flatten G rep\<^esub> rep h

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Sup_upto_llist_Suc[simp]:
  "Sup_upto_llist Xs (enat (Suc j)) =
   Sup_upto_llist Xs (enat j) \<union> (if enat (Suc j) < llength Xs then lnth Xs (Suc j) else {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sup_upto_llist Xs (enat (Suc j)) = Sup_upto_llist Xs (enat j) \<union> (if enat (Suc j) < llength Xs then lnth Xs (Suc j) else {})
[PROOF STEP]
unfolding Sup_upto_llist_def image_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> {y. \<exists>x\<in>{i. enat i < llength Xs \<and> enat i \<le> enat (Suc j)}. y = lnth Xs x} = \<Union> {y. \<exists>x\<in>{i. enat i < llength Xs \<and> enat i \<le> enat j}. y = lnth Xs x} \<union> (if enat (Suc j) < llength Xs then lnth Xs (Suc j) else {})
[PROOF STEP]
by (auto intro: le_SucI elim: le_SucE)


[STATEMENT]
lemma el_gt0_imp_prod_gt0 [rule_format]:
  fixes xs::"'a :: archimedean_field list"
  shows "\<forall>y. y : set xs \<longrightarrow> y > 0 \<Longrightarrow> \<Prod>:xs > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>y. y \<in> set xs \<longrightarrow> (0::'a) < y \<Longrightarrow> (0::'a) < prod_list xs
[PROOF STEP]
proof (induct xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>y. y \<in> set [] \<longrightarrow> (0::'a) < y \<Longrightarrow> (0::'a) < prod_list []
 2. \<And>a xs. \<lbrakk>\<forall>y. y \<in> set xs \<longrightarrow> (0::'a) < y \<Longrightarrow> (0::'a) < prod_list xs; \<forall>y. y \<in> set (a # xs) \<longrightarrow> (0::'a) < y\<rbrakk> \<Longrightarrow> (0::'a) < prod_list (a # xs)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
\<forall>y. y \<in> set [] \<longrightarrow> (0::'a) < y

goal (2 subgoals):
 1. \<forall>y. y \<in> set [] \<longrightarrow> (0::'a) < y \<Longrightarrow> (0::'a) < prod_list []
 2. \<And>a xs. \<lbrakk>\<forall>y. y \<in> set xs \<longrightarrow> (0::'a) < y \<Longrightarrow> (0::'a) < prod_list xs; \<forall>y. y \<in> set (a # xs) \<longrightarrow> (0::'a) < y\<rbrakk> \<Longrightarrow> (0::'a) < prod_list (a # xs)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) < prod_list []
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(0::'a) < prod_list []

goal (1 subgoal):
 1. \<And>a xs. \<lbrakk>\<forall>y. y \<in> set xs \<longrightarrow> (0::'a) < y \<Longrightarrow> (0::'a) < prod_list xs; \<forall>y. y \<in> set (a # xs) \<longrightarrow> (0::'a) < y\<rbrakk> \<Longrightarrow> (0::'a) < prod_list (a # xs)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a xs. \<lbrakk>\<forall>y. y \<in> set xs \<longrightarrow> (0::'a) < y \<Longrightarrow> (0::'a) < prod_list xs; \<forall>y. y \<in> set (a # xs) \<longrightarrow> (0::'a) < y\<rbrakk> \<Longrightarrow> (0::'a) < prod_list (a # xs)
[PROOF STEP]
case (Cons a xs)
[PROOF STATE]
proof (state)
this:
\<forall>y. y \<in> set xs \<longrightarrow> (0::'a) < y \<Longrightarrow> (0::'a) < prod_list xs
\<forall>y. y \<in> set (a # xs) \<longrightarrow> (0::'a) < y

goal (1 subgoal):
 1. \<And>a xs. \<lbrakk>\<forall>y. y \<in> set xs \<longrightarrow> (0::'a) < y \<Longrightarrow> (0::'a) < prod_list xs; \<forall>y. y \<in> set (a # xs) \<longrightarrow> (0::'a) < y\<rbrakk> \<Longrightarrow> (0::'a) < prod_list (a # xs)
[PROOF STEP]
have exp: "\<Prod>:(a#xs) = \<Prod>:xs * a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod_list (a # xs) = prod_list xs * a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
prod_list (a # xs) = prod_list xs * a

goal (1 subgoal):
 1. \<And>a xs. \<lbrakk>\<forall>y. y \<in> set xs \<longrightarrow> (0::'a) < y \<Longrightarrow> (0::'a) < prod_list xs; \<forall>y. y \<in> set (a # xs) \<longrightarrow> (0::'a) < y\<rbrakk> \<Longrightarrow> (0::'a) < prod_list (a # xs)
[PROOF STEP]
with Cons
[PROOF STATE]
proof (chain)
picking this:
\<forall>y. y \<in> set xs \<longrightarrow> (0::'a) < y \<Longrightarrow> (0::'a) < prod_list xs
\<forall>y. y \<in> set (a # xs) \<longrightarrow> (0::'a) < y
prod_list (a # xs) = prod_list xs * a
[PROOF STEP]
have "a > 0"
[PROOF STATE]
proof (prove)
using this:
\<forall>y. y \<in> set xs \<longrightarrow> (0::'a) < y \<Longrightarrow> (0::'a) < prod_list xs
\<forall>y. y \<in> set (a # xs) \<longrightarrow> (0::'a) < y
prod_list (a # xs) = prod_list xs * a

goal (1 subgoal):
 1. (0::'a) < a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(0::'a) < a

goal (1 subgoal):
 1. \<And>a xs. \<lbrakk>\<forall>y. y \<in> set xs \<longrightarrow> (0::'a) < y \<Longrightarrow> (0::'a) < prod_list xs; \<forall>y. y \<in> set (a # xs) \<longrightarrow> (0::'a) < y\<rbrakk> \<Longrightarrow> (0::'a) < prod_list (a # xs)
[PROOF STEP]
with exp Cons
[PROOF STATE]
proof (chain)
picking this:
prod_list (a # xs) = prod_list xs * a
\<forall>y. y \<in> set xs \<longrightarrow> (0::'a) < y \<Longrightarrow> (0::'a) < prod_list xs
\<forall>y. y \<in> set (a # xs) \<longrightarrow> (0::'a) < y
(0::'a) < a
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
prod_list (a # xs) = prod_list xs * a
\<forall>y. y \<in> set xs \<longrightarrow> (0::'a) < y \<Longrightarrow> (0::'a) < prod_list xs
\<forall>y. y \<in> set (a # xs) \<longrightarrow> (0::'a) < y
(0::'a) < a

goal (1 subgoal):
 1. (0::'a) < prod_list (a # xs)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(0::'a) < prod_list (a # xs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma adds_except_fun_singleton: "s adds t = (except_fun s {v} adds except_fun t {v} \<and> s v adds t v)"
  for s t :: "'a \<Rightarrow> 'b::add_linorder"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (s adds t) = (except_fun s {v} adds except_fun t {v} \<and> s v adds t v)
[PROOF STEP]
by (auto simp: supp_fun_def except_fun_def adds_fun_iff when_def)


[STATEMENT]
lemma nn_transfer_operator_cong:
  assumes "AE x in M. f x = g x"
      and [measurable]: "f \<in> borel_measurable M" "g \<in> borel_measurable M"
  shows "AE x in M. nn_transfer_operator f x = nn_transfer_operator g x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in M. nn_transfer_operator f x = nn_transfer_operator g x
[PROOF STEP]
apply (rule nn_transfer_operator_charact)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>A. A \<in> sets M \<Longrightarrow> \<integral>\<^sup>+ x. indicator A x * nn_transfer_operator g x \<partial>M = \<integral>\<^sup>+ x. indicator A (T x) * f x \<partial>M
 2. f \<in> borel_measurable M
 3. nn_transfer_operator g \<in> borel_measurable M
[PROOF STEP]
apply (auto simp add: nn_transfer_operator_intg assms intro!: nn_integral_cong_AE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>A. A \<in> sets M \<Longrightarrow> AE x in M. indicator A (T x) * g x = indicator A (T x) * f x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
AE x in M. f x = g x
f \<in> borel_measurable M
g \<in> borel_measurable M

goal (1 subgoal):
 1. \<And>A. A \<in> sets M \<Longrightarrow> AE x in M. indicator A (T x) * g x = indicator A (T x) * f x
[PROOF STEP]
by auto


[STATEMENT]
lemma union_left_cancel: "K + M = K + N \<longleftrightarrow> M = (N::'a multiset)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (K + M = K + N) = (M = N)
[PROOF STEP]
by (fact add_left_cancel)


[STATEMENT]
lemma length_akiyama_tanigawa_row [simp]: "length (akiyama_tanigawa_row n l u) = u - l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (akiyama_tanigawa_row n l u) = u - l
[PROOF STEP]
by (simp add: akiyama_tanigawa_row_def)


[STATEMENT]
lemma val_ringI:
  assumes "a \<in> carrier Q\<^sub>p"
  assumes "val a \<ge>0"
  shows " a \<in> \<O>\<^sub>p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> \<O>\<^sub>p
[PROOF STEP]
apply(rule val_ring_val_criterion)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. a \<in> carrier Q\<^sub>p
 2. 0 \<le> val a
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier Q\<^sub>p
0 \<le> val a

goal (2 subgoals):
 1. a \<in> carrier Q\<^sub>p
 2. 0 \<le> val a
[PROOF STEP]
by auto


[STATEMENT]
lemma qbs_morphism_pair_assoc1:
 "(\<lambda>((x,y),z). (x,(y,z))) \<in> (X \<Otimes>\<^sub>Q Y) \<Otimes>\<^sub>Q Z \<rightarrow>\<^sub>Q X \<Otimes>\<^sub>Q (Y \<Otimes>\<^sub>Q Z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>((x, y), z). (x, y, z)) \<in> (X \<Otimes>\<^sub>Q Y) \<Otimes>\<^sub>Q Z \<rightarrow>\<^sub>Q X \<Otimes>\<^sub>Q Y \<Otimes>\<^sub>Q Z
[PROOF STEP]
by(auto intro!: qbs_morphismI simp: pair_qbs_Mx_def split_beta' comp_def)


[STATEMENT]
lemma subarray_all: "subarray 0 (Array.length h a) a h = Array.get h a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subarray 0 (Array.length h a) a h = Array.get h a
[PROOF STEP]
unfolding Array.length_def subarray_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nths' 0 (length (Array.get h a)) (Array.get h a) = Array.get h a
[PROOF STEP]
by (simp add: nths'_all)


[STATEMENT]
lemma while_decompose_6:
  "x \<star> ((y * (x \<star> 1)) \<star> z) = y \<star> ((x * (y \<star> 1)) \<star> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<star> y * (x \<star> (1::'a)) \<star> z = y \<star> x * (y \<star> (1::'a)) \<star> z
[PROOF STEP]
by (metis sup_commute while_sumstar_2)


[STATEMENT]
lemma mem_uminus: "x \<in> S \<Longrightarrow> -x \<in> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> S \<Longrightarrow> - x \<in> S
[PROOF STEP]
by (metis mem_scale scale_minus_left_on scale_one_on)


[STATEMENT]
lemma ball_subset_ball_iff:
  fixes a :: "'a :: euclidean_space"
  shows "ball a r \<subseteq> ball a' r' \<longleftrightarrow> dist a a' + r \<le> r' \<or> r \<le> 0"
        (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ball a r \<subseteq> ball a' r') = (dist a a' + r \<le> r' \<or> r \<le> 0)
[PROOF STEP]
proof (cases "r \<le> 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. r \<le> 0 \<Longrightarrow> (ball a r \<subseteq> ball a' r') = (dist a a' + r \<le> r' \<or> r \<le> 0)
 2. \<not> r \<le> 0 \<Longrightarrow> (ball a r \<subseteq> ball a' r') = (dist a a' + r \<le> r' \<or> r \<le> 0)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
r \<le> 0

goal (2 subgoals):
 1. r \<le> 0 \<Longrightarrow> (ball a r \<subseteq> ball a' r') = (dist a a' + r \<le> r' \<or> r \<le> 0)
 2. \<not> r \<le> 0 \<Longrightarrow> (ball a r \<subseteq> ball a' r') = (dist a a' + r \<le> r' \<or> r \<le> 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
r \<le> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
r \<le> 0

goal (1 subgoal):
 1. (ball a r \<subseteq> ball a' r') = (dist a a' + r \<le> r' \<or> r \<le> 0)
[PROOF STEP]
by metric
[PROOF STATE]
proof (state)
this:
(ball a r \<subseteq> ball a' r') = (dist a a' + r \<le> r' \<or> r \<le> 0)

goal (1 subgoal):
 1. \<not> r \<le> 0 \<Longrightarrow> (ball a r \<subseteq> ball a' r') = (dist a a' + r \<le> r' \<or> r \<le> 0)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> r \<le> 0 \<Longrightarrow> (ball a r \<subseteq> ball a' r') = (dist a a' + r \<le> r' \<or> r \<le> 0)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> r \<le> 0

goal (1 subgoal):
 1. \<not> r \<le> 0 \<Longrightarrow> (ball a r \<subseteq> ball a' r') = (dist a a' + r \<le> r' \<or> r \<le> 0)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ball a r \<subseteq> ball a' r') = (dist a a' + r \<le> r' \<or> r \<le> 0)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ball a r \<subseteq> ball a' r' \<Longrightarrow> dist a a' + r \<le> r' \<or> r \<le> 0
 2. dist a a' + r \<le> r' \<or> r \<le> 0 \<Longrightarrow> ball a r \<subseteq> ball a' r'
[PROOF STEP]
assume ?lhs
[PROOF STATE]
proof (state)
this:
ball a r \<subseteq> ball a' r'

goal (2 subgoals):
 1. ball a r \<subseteq> ball a' r' \<Longrightarrow> dist a a' + r \<le> r' \<or> r \<le> 0
 2. dist a a' + r \<le> r' \<or> r \<le> 0 \<Longrightarrow> ball a r \<subseteq> ball a' r'
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ball a r \<subseteq> ball a' r'
[PROOF STEP]
have "0 < r'"
[PROOF STATE]
proof (prove)
using this:
ball a r \<subseteq> ball a' r'

goal (1 subgoal):
 1. 0 < r'
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
ball a r \<subseteq> ball a' r'
\<not> r \<le> 0

goal (1 subgoal):
 1. 0 < r'
[PROOF STEP]
by metric
[PROOF STATE]
proof (state)
this:
0 < r'

goal (2 subgoals):
 1. ball a r \<subseteq> ball a' r' \<Longrightarrow> dist a a' + r \<le> r' \<or> r \<le> 0
 2. dist a a' + r \<le> r' \<or> r \<le> 0 \<Longrightarrow> ball a r \<subseteq> ball a' r'
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < r'
[PROOF STEP]
have "(cball a r \<subseteq> cball a' r')"
[PROOF STATE]
proof (prove)
using this:
0 < r'

goal (1 subgoal):
 1. cball a r \<subseteq> cball a' r'
[PROOF STEP]
by (metis False\<open>?lhs\<close> closure_ball closure_mono not_less)
[PROOF STATE]
proof (state)
this:
cball a r \<subseteq> cball a' r'

goal (2 subgoals):
 1. ball a r \<subseteq> ball a' r' \<Longrightarrow> dist a a' + r \<le> r' \<or> r \<le> 0
 2. dist a a' + r \<le> r' \<or> r \<le> 0 \<Longrightarrow> ball a r \<subseteq> ball a' r'
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
cball a r \<subseteq> cball a' r'
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
cball a r \<subseteq> cball a' r'

goal (1 subgoal):
 1. dist a a' + r \<le> r' \<or> r \<le> 0
[PROOF STEP]
using False cball_subset_cball_iff
[PROOF STATE]
proof (prove)
using this:
cball a r \<subseteq> cball a' r'
\<not> r \<le> 0
(cball ?a ?r \<subseteq> cball ?a' ?r') = (dist ?a ?a' + ?r \<le> ?r' \<or> ?r < 0)

goal (1 subgoal):
 1. dist a a' + r \<le> r' \<or> r \<le> 0
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
dist a a' + r \<le> r' \<or> r \<le> 0

goal (1 subgoal):
 1. dist a a' + r \<le> r' \<or> r \<le> 0 \<Longrightarrow> ball a r \<subseteq> ball a' r'
[PROOF STEP]
qed metric
[PROOF STATE]
proof (state)
this:
(ball a r \<subseteq> ball a' r') = (dist a a' + r \<le> r' \<or> r \<le> 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_subcls1: "finite (subcls1 P)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (subcls1 P)
[PROOF STEP]
(*<*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (subcls1 P)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite (subcls1 P)
[PROOF STEP]
let ?SIG = "SIGMA C:{C. is_class P C}. {D. fst (the (class P C)) = D \<and> C \<noteq> Object}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite (subcls1 P)
[PROOF STEP]
have "subcls1 P = ?SIG"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subcls1 P = (SIGMA C:{C. is_class P C}. {D. fst (the (class P C)) = D \<and> C \<noteq> Object})
[PROOF STEP]
by(simp add: subcls1_def2)
[PROOF STATE]
proof (state)
this:
subcls1 P = (SIGMA C:{C. is_class P C}. {D. fst (the (class P C)) = D \<and> C \<noteq> Object})

goal (1 subgoal):
 1. finite (subcls1 P)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
subcls1 P = (SIGMA C:{C. is_class P C}. {D. fst (the (class P C)) = D \<and> C \<noteq> Object})

goal (1 subgoal):
 1. finite (subcls1 P)
[PROOF STEP]
have "finite ?SIG"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (SIGMA C:{C. is_class P C}. {D. fst (the (class P C)) = D \<and> C \<noteq> Object})
[PROOF STEP]
proof(rule finite_SigmaI [OF finite_is_class])
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>C. C \<in> {C. is_class P C} \<Longrightarrow> finite {D. fst (the (class P C)) = D \<and> C \<noteq> Object}
[PROOF STEP]
fix C
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>C. C \<in> {C. is_class P C} \<Longrightarrow> finite {D. fst (the (class P C)) = D \<and> C \<noteq> Object}
[PROOF STEP]
assume C_in: "C \<in> {C. is_class P C}"
[PROOF STATE]
proof (state)
this:
C \<in> {C. is_class P C}

goal (1 subgoal):
 1. \<And>C. C \<in> {C. is_class P C} \<Longrightarrow> finite {D. fst (the (class P C)) = D \<and> C \<noteq> Object}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
C \<in> {C. is_class P C}
[PROOF STEP]
show "finite {D. fst (the (class P C)) = D \<and> C \<noteq> Object}"
[PROOF STATE]
proof (prove)
using this:
C \<in> {C. is_class P C}

goal (1 subgoal):
 1. finite {D. fst (the (class P C)) = D \<and> C \<noteq> Object}
[PROOF STEP]
by(rule_tac finite_subset[where B = "{fst (the (class P C))}"]) auto
[PROOF STATE]
proof (state)
this:
finite {D. fst (the (class P C)) = D \<and> C \<noteq> Object}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
finite (SIGMA C:{C. is_class P C}. {D. fst (the (class P C)) = D \<and> C \<noteq> Object})

goal (1 subgoal):
 1. finite (subcls1 P)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
subcls1 P = (SIGMA C:{C. is_class P C}. {D. fst (the (class P C)) = D \<and> C \<noteq> Object})
finite (SIGMA C:{C. is_class P C}. {D. fst (the (class P C)) = D \<and> C \<noteq> Object})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
subcls1 P = (SIGMA C:{C. is_class P C}. {D. fst (the (class P C)) = D \<and> C \<noteq> Object})
finite (SIGMA C:{C. is_class P C}. {D. fst (the (class P C)) = D \<and> C \<noteq> Object})

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma real_qbs_prob_integral_def:
  assumes "qbs_integrable (s::'a qbs_prob_space) f"
  shows "qbs_prob_integral s f = enn2real (qbs_prob_ennintegral s (\<lambda>x. ennreal (f x))) - enn2real (qbs_prob_ennintegral s (\<lambda>x. ennreal (- f x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. qbs_prob_integral s f = enn2real (\<integral>\<^sup>+\<^sub>Q x. ennreal (f x) \<partial>s) - enn2real (\<integral>\<^sup>+\<^sub>Q x. ennreal (- f x) \<partial>s)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
qbs_integrable s f

goal (1 subgoal):
 1. qbs_prob_integral s f = enn2real (\<integral>\<^sup>+\<^sub>Q x. ennreal (f x) \<partial>s) - enn2real (\<integral>\<^sup>+\<^sub>Q x. ennreal (- f x) \<partial>s)
[PROOF STEP]
proof(transfer,auto)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a aa b fa. \<lbrakk>qbs_prob_eq (a, aa, b) (a, aa, b); qbs_prob_t_integrable (a, aa, b) fa; qbs_integrable s f\<rbrakk> \<Longrightarrow> qbs_prob_t_integral (a, aa, b) fa = enn2real (qbs_prob_t_ennintegral (a, aa, b) (\<lambda>x. ennreal (fa x))) - enn2real (qbs_prob_t_ennintegral (a, aa, b) (\<lambda>x. ennreal (- fa x)))
[PROOF STEP]
fix X :: "'a quasi_borel"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a aa b fa. \<lbrakk>qbs_prob_eq (a, aa, b) (a, aa, b); qbs_prob_t_integrable (a, aa, b) fa; qbs_integrable s f\<rbrakk> \<Longrightarrow> qbs_prob_t_integral (a, aa, b) fa = enn2real (qbs_prob_t_ennintegral (a, aa, b) (\<lambda>x. ennreal (fa x))) - enn2real (qbs_prob_t_ennintegral (a, aa, b) (\<lambda>x. ennreal (- fa x)))
[PROOF STEP]
fix \<alpha> \<mu> f
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a aa b fa. \<lbrakk>qbs_prob_eq (a, aa, b) (a, aa, b); qbs_prob_t_integrable (a, aa, b) fa; qbs_integrable s f\<rbrakk> \<Longrightarrow> qbs_prob_t_integral (a, aa, b) fa = enn2real (qbs_prob_t_ennintegral (a, aa, b) (\<lambda>x. ennreal (fa x))) - enn2real (qbs_prob_t_ennintegral (a, aa, b) (\<lambda>x. ennreal (- fa x)))
[PROOF STEP]
assume H:"qbs_prob_eq (X,\<alpha>,\<mu>) (X,\<alpha>,\<mu>)"
           "qbs_prob_t_integrable (X,\<alpha>,\<mu>) f"
[PROOF STATE]
proof (state)
this:
qbs_prob_eq (X, \<alpha>, \<mu>) (X, \<alpha>, \<mu>)
qbs_prob_t_integrable (X, \<alpha>, \<mu>) f

goal (1 subgoal):
 1. \<And>a aa b fa. \<lbrakk>qbs_prob_eq (a, aa, b) (a, aa, b); qbs_prob_t_integrable (a, aa, b) fa; qbs_integrable s f\<rbrakk> \<Longrightarrow> qbs_prob_t_integral (a, aa, b) fa = enn2real (qbs_prob_t_ennintegral (a, aa, b) (\<lambda>x. ennreal (fa x))) - enn2real (qbs_prob_t_ennintegral (a, aa, b) (\<lambda>x. ennreal (- fa x)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
qbs_prob_eq (X, \<alpha>, \<mu>) (X, \<alpha>, \<mu>)
qbs_prob_t_integrable (X, \<alpha>, \<mu>) f
[PROOF STEP]
interpret qp: qbs_prob X \<alpha> \<mu>
[PROOF STATE]
proof (prove)
using this:
qbs_prob_eq (X, \<alpha>, \<mu>) (X, \<alpha>, \<mu>)
qbs_prob_t_integrable (X, \<alpha>, \<mu>) f

goal (1 subgoal):
 1. qbs_prob X \<alpha> \<mu>
[PROOF STEP]
by(simp add: qbs_prob_eq_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a aa b fa. \<lbrakk>qbs_prob_eq (a, aa, b) (a, aa, b); qbs_prob_t_integrable (a, aa, b) fa; qbs_integrable s f\<rbrakk> \<Longrightarrow> qbs_prob_t_integral (a, aa, b) fa = enn2real (qbs_prob_t_ennintegral (a, aa, b) (\<lambda>x. ennreal (fa x))) - enn2real (qbs_prob_t_ennintegral (a, aa, b) (\<lambda>x. ennreal (- fa x)))
[PROOF STEP]
show "qbs_prob_t_integral (X,\<alpha>,\<mu>) f = enn2real (qbs_prob_t_ennintegral (X,\<alpha>,\<mu>) (\<lambda>x. ennreal (f x))) - enn2real (qbs_prob_t_ennintegral (X,\<alpha>,\<mu>) (\<lambda>x. ennreal (- f x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. qbs_prob_t_integral (X, \<alpha>, \<mu>) f = enn2real (qbs_prob_t_ennintegral (X, \<alpha>, \<mu>) (\<lambda>x. ennreal (f x))) - enn2real (qbs_prob_t_ennintegral (X, \<alpha>, \<mu>) (\<lambda>x. ennreal (- f x)))
[PROOF STEP]
using H(2) real_lebesgue_integral_def[of \<mu> "f \<circ> \<alpha>"]
[PROOF STATE]
proof (prove)
using this:
qbs_prob_t_integrable (X, \<alpha>, \<mu>) f
integrable \<mu> (f \<circ> \<alpha>) \<Longrightarrow> qp.expectation (f \<circ> \<alpha>) = enn2real (\<integral>\<^sup>+ x. ennreal ((f \<circ> \<alpha>) x) \<partial>\<mu>) - enn2real (\<integral>\<^sup>+ x. ennreal (- (f \<circ> \<alpha>) x) \<partial>\<mu>)

goal (1 subgoal):
 1. qbs_prob_t_integral (X, \<alpha>, \<mu>) f = enn2real (qbs_prob_t_ennintegral (X, \<alpha>, \<mu>) (\<lambda>x. ennreal (f x))) - enn2real (qbs_prob_t_ennintegral (X, \<alpha>, \<mu>) (\<lambda>x. ennreal (- f x)))
[PROOF STEP]
by(auto simp add: comp_def qbs_prob_t_integrable_def qbs_prob_t_integral_def qbs_prob_t_ennintegral_def)
[PROOF STATE]
proof (state)
this:
qbs_prob_t_integral (X, \<alpha>, \<mu>) f = enn2real (qbs_prob_t_ennintegral (X, \<alpha>, \<mu>) (\<lambda>x. ennreal (f x))) - enn2real (qbs_prob_t_ennintegral (X, \<alpha>, \<mu>) (\<lambda>x. ennreal (- f x)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in ring) poly_add_coeff:
  assumes "x \<in> carrier (poly_ring R)"
  assumes "y \<in> carrier (poly_ring R)"
  shows "coeff (x \<oplus>\<^bsub>poly_ring R\<^esub> y) k = coeff x k \<oplus> coeff y k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.coeff (x \<oplus>\<^bsub>poly_ring R\<^esub> y) k = local.coeff x k \<oplus> local.coeff y k
[PROOF STEP]
by (metis assms univ_poly_carrier polynomial_incl univ_poly_add poly_add_coeff)


[STATEMENT]
lemma mask_AND_NOT_mask:
  "(w AND NOT (mask n)) AND mask n = 0"
  for w :: \<open>'a::len word\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (w AND NOT (mask n)) AND mask n = 0
[PROOF STEP]
by (rule bit_word_eqI) (simp add: bit_simps)


[STATEMENT]
lemma LeadsTo_cancel1:
     "[| F \<in> A LeadsTo (B \<union> A'); F \<in> B LeadsTo B' |]
      ==> F \<in> A LeadsTo (B' \<union> A')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>F \<in> A \<longmapsto>w B \<union> A'; F \<in> B \<longmapsto>w B'\<rbrakk> \<Longrightarrow> F \<in> A \<longmapsto>w B' \<union> A'
[PROOF STEP]
apply (simp add: Un_commute)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>F \<in> A \<longmapsto>w A' \<union> B; F \<in> B \<longmapsto>w B'\<rbrakk> \<Longrightarrow> F \<in> A \<longmapsto>w A' \<union> B'
[PROOF STEP]
apply (blast intro!: LeadsTo_cancel2)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma ri_runs2sigs_upd_init [simp]:
  "\<lbrakk> runz Ra = Some (Init, [A, B], [aKey Kab]); finite (dom runz) \<rbrakk>
  \<Longrightarrow> ri_runs2sigs (runz(Ra \<mapsto> (Init, [A, B], [aKey Kab, aNon Nb]))) =
     (ri_runs2sigs runz)
       (Running [B, A] (Kab, Nb) := Suc (card (ri_running runz A B Kab Nb)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>runz Ra = Some (Init, [A, B], [aKey Kab]); finite (dom runz)\<rbrakk> \<Longrightarrow> ri_runs2sigs (runz(Ra \<mapsto> (Init, [A, B], [aKey Kab, aNon Nb]))) = (ri_runs2sigs runz)(Running [B, A] (Kab, Nb) := Suc (card (ri_running runz A B Kab Nb)))
[PROOF STEP]
apply (rule ext, erule rev_mp, erule rev_mp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. finite (dom runz) \<longrightarrow> runz Ra = Some (Init, [A, B], [aKey Kab]) \<longrightarrow> ri_runs2sigs (runz(Ra \<mapsto> (Init, [A, B], [aKey Kab, aNon Nb]))) x = ((ri_runs2sigs runz)(Running [B, A] (Kab, Nb) := Suc (card (ri_running runz A B Kab Nb)))) x
[PROOF STEP]
apply (rule_tac ?a0.0=runz in ri_runs2sigs.induct, auto)
\<comment> \<open>1 subgoal, solved using @{thm "card_insert_disjoint"}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>runz. \<lbrakk>finite (dom runz); runz Ra = Some (Init, [A, B], [aKey Kab])\<rbrakk> \<Longrightarrow> card {Raa. Raa \<noteq> Ra \<longrightarrow> runz Raa = Some (Init, [A, B], [aKey Kab, aNon Nb])} = Suc (card (ri_running runz A B Kab Nb))
[PROOF STEP]
apply (rename_tac runz)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>runz. \<lbrakk>finite (dom runz); runz Ra = Some (Init, [A, B], [aKey Kab])\<rbrakk> \<Longrightarrow> card {Raa. Raa \<noteq> Ra \<longrightarrow> runz Raa = Some (Init, [A, B], [aKey Kab, aNon Nb])} = Suc (card (ri_running runz A B Kab Nb))
[PROOF STEP]
apply (rule_tac
         s="card (insert Ra (ri_running runz A B Kab Nb))"
       in trans, fast, auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma bigtheta_const_ln_pow [simp]: "a > 0 \<Longrightarrow> (\<lambda>x::real. ln (a*x) ^ d) \<in> \<Theta>(\<lambda>x. ln x ^ d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < a \<Longrightarrow> (\<lambda>x. ln (a * x) ^ d) \<in> \<Theta>(\<lambda>x. ln x ^ d)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < a \<Longrightarrow> (\<lambda>x. ln (a * x) ^ d) \<in> \<Theta>(\<lambda>x. ln x ^ d)
[PROOF STEP]
assume a: "a > 0"
[PROOF STATE]
proof (state)
this:
0 < a

goal (1 subgoal):
 1. 0 < a \<Longrightarrow> (\<lambda>x. ln (a * x) ^ d) \<in> \<Theta>(\<lambda>x. ln x ^ d)
[PROOF STEP]
have "\<forall>\<^sub>F x in at_top. ln (a * x) ^ d = ln (a * x) powr real d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. ln (a * x) ^ d = ln (a * x) powr real d
[PROOF STEP]
using eventually_gt_at_top[of "1/a"]
[PROOF STATE]
proof (prove)
using this:
eventually ((<) (1 / a)) at_top

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. ln (a * x) ^ d = ln (a * x) powr real d
[PROOF STEP]
by eventually_elim (insert a, subst powr_realpow, auto simp: field_simps)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. ln (a * x) ^ d = ln (a * x) powr real d

goal (1 subgoal):
 1. 0 < a \<Longrightarrow> (\<lambda>x. ln (a * x) ^ d) \<in> \<Theta>(\<lambda>x. ln x ^ d)
[PROOF STEP]
hence "(\<lambda>x::real. ln (a*x) ^ d) \<in> \<Theta>(\<lambda>x. ln (a*x) powr real d)"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. ln (a * x) ^ d = ln (a * x) powr real d

goal (1 subgoal):
 1. (\<lambda>x. ln (a * x) ^ d) \<in> \<Theta>(\<lambda>x. ln (a * x) powr real d)
[PROOF STEP]
by (rule bigthetaI_cong)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. ln (a * x) ^ d) \<in> \<Theta>(\<lambda>x. ln (a * x) powr real d)

goal (1 subgoal):
 1. 0 < a \<Longrightarrow> (\<lambda>x. ln (a * x) ^ d) \<in> \<Theta>(\<lambda>x. ln x ^ d)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>x. ln (a * x) ^ d) \<in> \<Theta>(\<lambda>x. ln (a * x) powr real d)

goal (1 subgoal):
 1. 0 < a \<Longrightarrow> (\<lambda>x. ln (a * x) ^ d) \<in> \<Theta>(\<lambda>x. ln x ^ d)
[PROOF STEP]
from a
[PROOF STATE]
proof (chain)
picking this:
0 < a
[PROOF STEP]
have "(\<lambda>x. ln (a*x) powr real d) \<in> \<Theta>(\<lambda>x. ln x powr real d)"
[PROOF STATE]
proof (prove)
using this:
0 < a

goal (1 subgoal):
 1. (\<lambda>x. ln (a * x) powr real d) \<in> \<Theta>(\<lambda>x. ln x powr real d)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>x. ln (a * x) powr real d) \<in> \<Theta>(\<lambda>x. ln x powr real d)

goal (1 subgoal):
 1. 0 < a \<Longrightarrow> (\<lambda>x. ln (a * x) ^ d) \<in> \<Theta>(\<lambda>x. ln x ^ d)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>x. ln (a * x) powr real d) \<in> \<Theta>(\<lambda>x. ln x powr real d)

goal (1 subgoal):
 1. 0 < a \<Longrightarrow> (\<lambda>x. ln (a * x) ^ d) \<in> \<Theta>(\<lambda>x. ln x ^ d)
[PROOF STEP]
have "\<forall>\<^sub>F x in at_top. ln x powr real d = ln x ^ d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. ln x powr real d = ln x ^ d
[PROOF STEP]
using eventually_gt_at_top[of 1]
[PROOF STATE]
proof (prove)
using this:
eventually ((<) (1::?'a1)) at_top

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. ln x powr real d = ln x ^ d
[PROOF STEP]
by eventually_elim (subst powr_realpow, auto simp: field_simps)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. ln x powr real d = ln x ^ d

goal (1 subgoal):
 1. 0 < a \<Longrightarrow> (\<lambda>x. ln (a * x) ^ d) \<in> \<Theta>(\<lambda>x. ln x ^ d)
[PROOF STEP]
hence "(\<lambda>x. ln x powr real d) \<in> \<Theta>(\<lambda>x. ln x ^ d)"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. ln x powr real d = ln x ^ d

goal (1 subgoal):
 1. (\<lambda>x. ln x powr real d) \<in> \<Theta>(\<lambda>x. ln x ^ d)
[PROOF STEP]
by (rule bigthetaI_cong)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. ln x powr real d) \<in> \<Theta>(\<lambda>x. ln x ^ d)

goal (1 subgoal):
 1. 0 < a \<Longrightarrow> (\<lambda>x. ln (a * x) ^ d) \<in> \<Theta>(\<lambda>x. ln x ^ d)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. ln (a * x) ^ d) \<in> \<Theta>(\<lambda>x. ln x ^ d)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. ln (a * x) ^ d) \<in> \<Theta>(\<lambda>x. ln x ^ d)

goal (1 subgoal):
 1. (\<lambda>x. ln (a * x) ^ d) \<in> \<Theta>(\<lambda>x. ln x ^ d)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<lambda>x. ln (a * x) ^ d) \<in> \<Theta>(\<lambda>x. ln x ^ d)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma deg_pp_eq_0_iff [simp]: "deg_pp s = 0 \<longleftrightarrow> s = 0" for s::"('a, 'b::add_linorder_min) pp"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (deg_pp s = (0::'b)) = (s = 0)
[PROOF STEP]
by (transfer, fact deg_pm_eq_0_iff)


[STATEMENT]
lemma abs_div_pos: "0 < y \<Longrightarrow>
    \<bar>x\<bar> / y = \<bar>x / y\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) < y \<Longrightarrow> \<bar>x\<bar> / y = \<bar>x / y\<bar>
[PROOF STEP]
by (simp add: local.abs_pos)


[STATEMENT]
lemma parcs_mk_symmetric_symcl: "parcs (mk_symmetric G) = (arcs_ends G)\<^sup>s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. parcs (mk_symmetric G) = (arcs_ends G)\<^sup>s
[PROOF STEP]
by (auto simp: parcs_mk_symmetric symcl_def arcs_ends_conv)


[STATEMENT]
lemma partition_by_nth_less:
  assumes "k < i" and "i < length zs"
    and "length xs = sum_list (take i zs) + j"
  shows "partition_by (xs @ y # ys) zs ! k = take (zs ! k) (drop (sum_list (take k zs)) xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. partition_by (xs @ y # ys) zs ! k = take (zs ! k) (drop (sum_list (take k zs)) xs)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. partition_by (xs @ y # ys) zs ! k = take (zs ! k) (drop (sum_list (take k zs)) xs)
[PROOF STEP]
have "partition_by (xs @ y # ys) zs ! k =
    take (zs ! k) (drop (sum_list (take k zs)) (xs @ y # ys))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. partition_by (xs @ y # ys) zs ! k = take (zs ! k) (drop (sum_list (take k zs)) (xs @ y # ys))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
k < i
i < length zs
length xs = sum_list (take i zs) + j

goal (1 subgoal):
 1. partition_by (xs @ y # ys) zs ! k = take (zs ! k) (drop (sum_list (take k zs)) (xs @ y # ys))
[PROOF STEP]
by (auto simp: partition_by_nth)
[PROOF STATE]
proof (state)
this:
partition_by (xs @ y # ys) zs ! k = take (zs ! k) (drop (sum_list (take k zs)) (xs @ y # ys))

goal (1 subgoal):
 1. partition_by (xs @ y # ys) zs ! k = take (zs ! k) (drop (sum_list (take k zs)) xs)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
partition_by (xs @ y # ys) zs ! k = take (zs ! k) (drop (sum_list (take k zs)) (xs @ y # ys))

goal (1 subgoal):
 1. partition_by (xs @ y # ys) zs ! k = take (zs ! k) (drop (sum_list (take k zs)) xs)
[PROOF STEP]
have "zs ! k + sum_list (take k zs) \<le> length xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zs ! k + sum_list (take k zs) \<le> length xs
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
k < i
i < length zs
length xs = sum_list (take i zs) + j

goal (1 subgoal):
 1. zs ! k + sum_list (take k zs) \<le> length xs
[PROOF STEP]
by (simp add: sum_list_take_eq)
[PROOF STATE]
proof (state)
this:
zs ! k + sum_list (take k zs) \<le> length xs

goal (1 subgoal):
 1. partition_by (xs @ y # ys) zs ! k = take (zs ! k) (drop (sum_list (take k zs)) xs)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
partition_by (xs @ y # ys) zs ! k = take (zs ! k) (drop (sum_list (take k zs)) (xs @ y # ys))
zs ! k + sum_list (take k zs) \<le> length xs
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
partition_by (xs @ y # ys) zs ! k = take (zs ! k) (drop (sum_list (take k zs)) (xs @ y # ys))
zs ! k + sum_list (take k zs) \<le> length xs

goal (1 subgoal):
 1. partition_by (xs @ y # ys) zs ! k = take (zs ! k) (drop (sum_list (take k zs)) xs)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
partition_by (xs @ y # ys) zs ! k = take (zs ! k) (drop (sum_list (take k zs)) xs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "(\<forall>x y. f(x)=g(y)) \<longrightarrow> (\<forall>x y. f(f(x))=f(g(y)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x y. f x = g y) \<longrightarrow> (\<forall>x y. f (f x) = f (g y))
[PROOF STEP]
by (fast intro: arg_cong [of concl: f])


[STATEMENT]
lemma lim_zero_infinity:
  fixes l :: "'a::{real_normed_field,field}"
  shows "((\<lambda>x. f(1 / x)) \<longlongrightarrow> l) (at (0::'a)) \<Longrightarrow> (f \<longlongrightarrow> l) at_infinity"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. f ((1::'a) / x)) \<midarrow>0::'a\<rightarrow> l \<Longrightarrow> (f \<longlongrightarrow> l) at_infinity
[PROOF STEP]
by (simp add: inverse_eq_divide lim_at_infinity_0 comp_def)


[STATEMENT]
lemma normalize_quot_idem [simp]: "normalize_quot (normalize_quot x) = normalize_quot x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. normalize_quot (normalize_quot x) = normalize_quot x
[PROOF STEP]
by (rule normalize_quot_id) simp_all


[STATEMENT]
lemma cis_add_pi[simp]: "cis (pi + x) = - cis x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cis (pi + x) = - cis x
[PROOF STEP]
by (auto simp: complex_eq_iff)


[STATEMENT]
lemma components_iff: "S \<in> components U \<longleftrightarrow> (\<exists>x. x \<in> U \<and> S = connected_component_set U x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (S \<in> components U) = (\<exists>x. x \<in> U \<and> S = connected_component_set U x)
[PROOF STEP]
by (auto simp: components_def)


[STATEMENT]
lemma deriv_stirling_integral_real_bound:
  assumes m: "m > 0"
  shows   "(deriv ^^ j) (stirling_integral m) \<in> O(\<lambda>x::real. 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]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (deriv ^^ j) (stirling_integral m) \<in> O(\<lambda>x. 1 / x ^ (m + j))
[PROOF STEP]
obtain c where c: "\<And>s. 0 < Re s \<Longrightarrow> cmod (stirling_integral m s) \<le> c / Re s ^ m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>c. (\<And>s. 0 < Re s \<Longrightarrow> cmod (stirling_integral m s) \<le> c / Re s ^ m) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using stirling_integral_bound[OF m]
[PROOF STATE]
proof (prove)
using this:
(\<And>c. (\<And>s. 0 < Re s \<Longrightarrow> cmod (stirling_integral m s) \<le> c / Re s ^ m) \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>c. (\<And>s. 0 < Re s \<Longrightarrow> cmod (stirling_integral m s) \<le> c / Re s ^ m) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < Re ?s \<Longrightarrow> cmod (stirling_integral m ?s) \<le> c / Re ?s ^ m

goal (1 subgoal):
 1. (deriv ^^ j) (stirling_integral m) \<in> O(\<lambda>x. 1 / x ^ (m + j))
[PROOF STEP]
have "0 \<le> cmod (stirling_integral m 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> cmod (stirling_integral m 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 \<le> cmod (stirling_integral m 1)

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

goal (1 subgoal):
 1. (deriv ^^ j) (stirling_integral m) \<in> O(\<lambda>x. 1 / x ^ (m + j))
[PROOF STEP]
have "\<dots> \<le> c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (stirling_integral m 1) \<le> c
[PROOF STEP]
using c[of 1]
[PROOF STATE]
proof (prove)
using this:
0 < Re 1 \<Longrightarrow> cmod (stirling_integral m 1) \<le> c / Re 1 ^ m

goal (1 subgoal):
 1. cmod (stirling_integral m 1) \<le> c
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cmod (stirling_integral m 1) \<le> c

goal (1 subgoal):
 1. (deriv ^^ j) (stirling_integral m) \<in> O(\<lambda>x. 1 / x ^ (m + j))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
0 \<le> c
[PROOF STEP]
have c_nonneg: "c \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
0 \<le> c

goal (1 subgoal):
 1. 0 \<le> c
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
0 \<le> c

goal (1 subgoal):
 1. (deriv ^^ j) (stirling_integral m) \<in> O(\<lambda>x. 1 / x ^ (m + j))
[PROOF STEP]
define B where "B = c * 2 ^ (m + Suc j)"
[PROOF STATE]
proof (state)
this:
B = c * 2 ^ (m + Suc j)

goal (1 subgoal):
 1. (deriv ^^ j) (stirling_integral m) \<in> O(\<lambda>x. 1 / x ^ (m + j))
[PROOF STEP]
define B' where "B' = B * fact j / 2"
[PROOF STATE]
proof (state)
this:
B' = B * fact j / 2

goal (1 subgoal):
 1. (deriv ^^ j) (stirling_integral m) \<in> O(\<lambda>x. 1 / x ^ (m + j))
[PROOF STEP]
have "eventually (\<lambda>x::real. norm ((deriv ^^ j) (stirling_integral m) x) \<le>
          B' * norm (1 / x ^ (m+ j))) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. norm ((deriv ^^ j) (stirling_integral m) x) \<le> B' * norm (1 / x ^ (m + j))
[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. norm ((deriv ^^ j) (stirling_integral m) x) \<le> B' * norm (1 / x ^ (m + j))
[PROOF STEP]
proof eventually_elim
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. 0 < x \<Longrightarrow> norm ((deriv ^^ j) (stirling_integral m) x) \<le> B' * norm (1 / x ^ (m + j))
[PROOF STEP]
case (elim x)
[PROOF STATE]
proof (state)
this:
0 < x

goal (1 subgoal):
 1. \<And>x. 0 < x \<Longrightarrow> norm ((deriv ^^ j) (stirling_integral m) x) \<le> B' * norm (1 / x ^ (m + j))
[PROOF STEP]
have "s \<notin> \<real>\<^sub>\<le>\<^sub>0" if "s \<in> cball (of_real x) (x/2)" for s :: complex
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s \<notin> \<real>\<^sub>\<le>\<^sub>0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. s \<notin> \<real>\<^sub>\<le>\<^sub>0
[PROOF STEP]
have "x - Re s \<le> norm (of_real x - s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x - Re s \<le> cmod (complex_of_real x - s)
[PROOF STEP]
using complex_Re_le_cmod[of "of_real x - s"]
[PROOF STATE]
proof (prove)
using this:
Re (complex_of_real x - s) \<le> cmod (complex_of_real x - s)

goal (1 subgoal):
 1. x - Re s \<le> cmod (complex_of_real x - s)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x - Re s \<le> cmod (complex_of_real x - s)

goal (1 subgoal):
 1. s \<notin> \<real>\<^sub>\<le>\<^sub>0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x - Re s \<le> cmod (complex_of_real x - s)

goal (1 subgoal):
 1. s \<notin> \<real>\<^sub>\<le>\<^sub>0
[PROOF STEP]
from that
[PROOF STATE]
proof (chain)
picking this:
s \<in> cball (complex_of_real x) (x / 2)
[PROOF STEP]
have "\<dots> \<le> x/2"
[PROOF STATE]
proof (prove)
using this:
s \<in> cball (complex_of_real x) (x / 2)

goal (1 subgoal):
 1. cmod (complex_of_real x - s) \<le> x / 2
[PROOF STEP]
by (simp add: dist_complex_def)
[PROOF STATE]
proof (state)
this:
cmod (complex_of_real x - s) \<le> x / 2

goal (1 subgoal):
 1. s \<notin> \<real>\<^sub>\<le>\<^sub>0
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x - Re s \<le> x / 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x - Re s \<le> x / 2

goal (1 subgoal):
 1. s \<notin> \<real>\<^sub>\<le>\<^sub>0
[PROOF STEP]
using elim
[PROOF STATE]
proof (prove)
using this:
x - Re s \<le> x / 2
0 < x

goal (1 subgoal):
 1. s \<notin> \<real>\<^sub>\<le>\<^sub>0
[PROOF STEP]
by (auto simp: complex_nonpos_Reals_iff)
[PROOF STATE]
proof (state)
this:
s \<notin> \<real>\<^sub>\<le>\<^sub>0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?s \<in> cball (complex_of_real x) (x / 2) \<Longrightarrow> ?s \<notin> \<real>\<^sub>\<le>\<^sub>0

goal (1 subgoal):
 1. \<And>x. 0 < x \<Longrightarrow> norm ((deriv ^^ j) (stirling_integral m) x) \<le> B' * norm (1 / x ^ (m + j))
[PROOF STEP]
hence "((\<lambda>u. stirling_integral m u / (u - of_real x) ^ Suc j) has_contour_integral
            complex_of_real (2 * pi) * \<i> / fact j *
              (deriv ^^ j) (stirling_integral m) (of_real x)) (circlepath (of_real x) (x/2))"
[PROOF STATE]
proof (prove)
using this:
?s \<in> cball (complex_of_real x) (x / 2) \<Longrightarrow> ?s \<notin> \<real>\<^sub>\<le>\<^sub>0

goal (1 subgoal):
 1. ((\<lambda>u. stirling_integral m u / (u - complex_of_real x) ^ Suc j) has_contour_integral complex_of_real (2 * pi) * \<i> / fact j * (deriv ^^ j) (stirling_integral m) (complex_of_real x)) (circlepath (complex_of_real x) (x / 2))
[PROOF STEP]
using m elim
[PROOF STATE]
proof (prove)
using this:
?s \<in> cball (complex_of_real x) (x / 2) \<Longrightarrow> ?s \<notin> \<real>\<^sub>\<le>\<^sub>0
0 < m
0 < x

goal (1 subgoal):
 1. ((\<lambda>u. stirling_integral m u / (u - complex_of_real x) ^ Suc j) has_contour_integral complex_of_real (2 * pi) * \<i> / fact j * (deriv ^^ j) (stirling_integral m) (complex_of_real x)) (circlepath (complex_of_real x) (x / 2))
[PROOF STEP]
by (intro Cauchy_has_contour_integral_higher_derivative_circlepath
                stirling_integral_continuous_on_complex stirling_integral_holomorphic) auto
[PROOF STATE]
proof (state)
this:
((\<lambda>u. stirling_integral m u / (u - complex_of_real x) ^ Suc j) has_contour_integral complex_of_real (2 * pi) * \<i> / fact j * (deriv ^^ j) (stirling_integral m) (complex_of_real x)) (circlepath (complex_of_real x) (x / 2))

goal (1 subgoal):
 1. \<And>x. 0 < x \<Longrightarrow> norm ((deriv ^^ j) (stirling_integral m) x) \<le> B' * norm (1 / x ^ (m + j))
[PROOF STEP]
hence "norm (of_real (2 * pi) * \<i> / fact j * (deriv ^^ j) (stirling_integral m) (of_real x)) \<le>
            B / x ^ (m + Suc j) * (2 * pi * (x / 2))"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>u. stirling_integral m u / (u - complex_of_real x) ^ Suc j) has_contour_integral complex_of_real (2 * pi) * \<i> / fact j * (deriv ^^ j) (stirling_integral m) (complex_of_real x)) (circlepath (complex_of_real x) (x / 2))

goal (1 subgoal):
 1. cmod (complex_of_real (2 * pi) * \<i> / fact j * (deriv ^^ j) (stirling_integral m) (complex_of_real x)) \<le> B / x ^ (m + Suc j) * (2 * pi * (x / 2))
[PROOF STEP]
proof (rule has_contour_integral_bound_circlepath)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. 0 \<le> B / x ^ (m + Suc j)
 2. 0 < x / 2
 3. \<And>xa. cmod (xa - complex_of_real x) = x / 2 \<Longrightarrow> cmod (stirling_integral m xa / (xa - complex_of_real x) ^ Suc j) \<le> B / x ^ (m + Suc j)
[PROOF STEP]
fix u :: complex
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. 0 \<le> B / x ^ (m + Suc j)
 2. 0 < x / 2
 3. \<And>xa. cmod (xa - complex_of_real x) = x / 2 \<Longrightarrow> cmod (stirling_integral m xa / (xa - complex_of_real x) ^ Suc j) \<le> B / x ^ (m + Suc j)
[PROOF STEP]
assume dist: "norm (u - of_real x) = x / 2"
[PROOF STATE]
proof (state)
this:
cmod (u - complex_of_real x) = x / 2

goal (3 subgoals):
 1. 0 \<le> B / x ^ (m + Suc j)
 2. 0 < x / 2
 3. \<And>xa. cmod (xa - complex_of_real x) = x / 2 \<Longrightarrow> cmod (stirling_integral m xa / (xa - complex_of_real x) ^ Suc j) \<le> B / x ^ (m + Suc j)
[PROOF STEP]
have "Re (of_real x - u) \<le> norm (of_real x - u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Re (complex_of_real x - u) \<le> cmod (complex_of_real x - u)
[PROOF STEP]
by (rule complex_Re_le_cmod)
[PROOF STATE]
proof (state)
this:
Re (complex_of_real x - u) \<le> cmod (complex_of_real x - u)

goal (3 subgoals):
 1. 0 \<le> B / x ^ (m + Suc j)
 2. 0 < x / 2
 3. \<And>xa. cmod (xa - complex_of_real x) = x / 2 \<Longrightarrow> cmod (stirling_integral m xa / (xa - complex_of_real x) ^ Suc j) \<le> B / x ^ (m + Suc j)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Re (complex_of_real x - u) \<le> cmod (complex_of_real x - u)

goal (3 subgoals):
 1. 0 \<le> B / x ^ (m + Suc j)
 2. 0 < x / 2
 3. \<And>xa. cmod (xa - complex_of_real x) = x / 2 \<Longrightarrow> cmod (stirling_integral m xa / (xa - complex_of_real x) ^ Suc j) \<le> B / x ^ (m + Suc j)
[PROOF STEP]
have "\<dots> = x / 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (complex_of_real x - u) = x / 2
[PROOF STEP]
using dist
[PROOF STATE]
proof (prove)
using this:
cmod (u - complex_of_real x) = x / 2

goal (1 subgoal):
 1. cmod (complex_of_real x - u) = x / 2
[PROOF STEP]
by (simp add: norm_minus_commute)
[PROOF STATE]
proof (state)
this:
cmod (complex_of_real x - u) = x / 2

goal (3 subgoals):
 1. 0 \<le> B / x ^ (m + Suc j)
 2. 0 < x / 2
 3. \<And>xa. cmod (xa - complex_of_real x) = x / 2 \<Longrightarrow> cmod (stirling_integral m xa / (xa - complex_of_real x) ^ Suc j) \<le> B / x ^ (m + Suc j)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Re (complex_of_real x - u) \<le> x / 2
[PROOF STEP]
have Re_u: "Re u \<ge> x/2"
[PROOF STATE]
proof (prove)
using this:
Re (complex_of_real x - u) \<le> x / 2

goal (1 subgoal):
 1. x / 2 \<le> Re u
[PROOF STEP]
using elim
[PROOF STATE]
proof (prove)
using this:
Re (complex_of_real x - u) \<le> x / 2
0 < x

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

goal (3 subgoals):
 1. 0 \<le> B / x ^ (m + Suc j)
 2. 0 < x / 2
 3. \<And>xa. cmod (xa - complex_of_real x) = x / 2 \<Longrightarrow> cmod (stirling_integral m xa / (xa - complex_of_real x) ^ Suc j) \<le> B / x ^ (m + Suc j)
[PROOF STEP]
have "norm (stirling_integral m u / (u - of_real x) ^ Suc j) \<le>
              c / Re u ^ m / (x / 2) ^ Suc j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (stirling_integral m u / (u - complex_of_real x) ^ Suc j) \<le> c / Re u ^ m / (x / 2) ^ Suc j
[PROOF STEP]
using Re_u elim
[PROOF STATE]
proof (prove)
using this:
x / 2 \<le> Re u
0 < x

goal (1 subgoal):
 1. cmod (stirling_integral m u / (u - complex_of_real x) ^ Suc j) \<le> c / Re u ^ m / (x / 2) ^ Suc j
[PROOF STEP]
unfolding norm_divide norm_power dist
[PROOF STATE]
proof (prove)
using this:
x / 2 \<le> Re u
0 < x

goal (1 subgoal):
 1. cmod (stirling_integral m u) / (x / 2) ^ Suc j \<le> c / Re u ^ m / (x / 2) ^ Suc j
[PROOF STEP]
by (intro divide_right_mono zero_le_power c) simp_all
[PROOF STATE]
proof (state)
this:
cmod (stirling_integral m u / (u - complex_of_real x) ^ Suc j) \<le> c / Re u ^ m / (x / 2) ^ Suc j

goal (3 subgoals):
 1. 0 \<le> B / x ^ (m + Suc j)
 2. 0 < x / 2
 3. \<And>xa. cmod (xa - complex_of_real x) = x / 2 \<Longrightarrow> cmod (stirling_integral m xa / (xa - complex_of_real x) ^ Suc j) \<le> B / x ^ (m + Suc j)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod (stirling_integral m u / (u - complex_of_real x) ^ Suc j) \<le> c / Re u ^ m / (x / 2) ^ Suc j

goal (3 subgoals):
 1. 0 \<le> B / x ^ (m + Suc j)
 2. 0 < x / 2
 3. \<And>xa. cmod (xa - complex_of_real x) = x / 2 \<Longrightarrow> cmod (stirling_integral m xa / (xa - complex_of_real x) ^ Suc j) \<le> B / x ^ (m + Suc j)
[PROOF STEP]
have "\<dots> \<le> c / (x/2) ^ m / (x / 2) ^ Suc j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c / Re u ^ m / (x / 2) ^ Suc j \<le> c / (x / 2) ^ m / (x / 2) ^ Suc j
[PROOF STEP]
using c_nonneg elim Re_u
[PROOF STATE]
proof (prove)
using this:
0 \<le> c
0 < x
x / 2 \<le> Re u

goal (1 subgoal):
 1. c / Re u ^ m / (x / 2) ^ Suc j \<le> c / (x / 2) ^ m / (x / 2) ^ Suc j
[PROOF STEP]
by (intro divide_right_mono divide_left_mono power_mono) simp_all
[PROOF STATE]
proof (state)
this:
c / Re u ^ m / (x / 2) ^ Suc j \<le> c / (x / 2) ^ m / (x / 2) ^ Suc j

goal (3 subgoals):
 1. 0 \<le> B / x ^ (m + Suc j)
 2. 0 < x / 2
 3. \<And>xa. cmod (xa - complex_of_real x) = x / 2 \<Longrightarrow> cmod (stirling_integral m xa / (xa - complex_of_real x) ^ Suc j) \<le> B / x ^ (m + Suc j)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
c / Re u ^ m / (x / 2) ^ Suc j \<le> c / (x / 2) ^ m / (x / 2) ^ Suc j

goal (3 subgoals):
 1. 0 \<le> B / x ^ (m + Suc j)
 2. 0 < x / 2
 3. \<And>xa. cmod (xa - complex_of_real x) = x / 2 \<Longrightarrow> cmod (stirling_integral m xa / (xa - complex_of_real x) ^ Suc j) \<le> B / x ^ (m + Suc j)
[PROOF STEP]
have "\<dots> = B / x ^ (m + Suc j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c / (x / 2) ^ m / (x / 2) ^ Suc j = B / x ^ (m + Suc j)
[PROOF STEP]
using elim
[PROOF STATE]
proof (prove)
using this:
0 < x

goal (1 subgoal):
 1. c / (x / 2) ^ m / (x / 2) ^ Suc j = B / x ^ (m + Suc j)
[PROOF STEP]
by (simp add: B_def field_simps power_add)
[PROOF STATE]
proof (state)
this:
c / (x / 2) ^ m / (x / 2) ^ Suc j = B / x ^ (m + Suc j)

goal (3 subgoals):
 1. 0 \<le> B / x ^ (m + Suc j)
 2. 0 < x / 2
 3. \<And>xa. cmod (xa - complex_of_real x) = x / 2 \<Longrightarrow> cmod (stirling_integral m xa / (xa - complex_of_real x) ^ Suc j) \<le> B / x ^ (m + Suc j)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cmod (stirling_integral m u / (u - complex_of_real x) ^ Suc j) \<le> B / x ^ (m + Suc j)
[PROOF STEP]
show "norm (stirling_integral m u / (u - of_real x) ^ Suc j) \<le> B / x ^ (m + Suc j)"
[PROOF STATE]
proof (prove)
using this:
cmod (stirling_integral m u / (u - complex_of_real x) ^ Suc j) \<le> B / x ^ (m + Suc j)

goal (1 subgoal):
 1. cmod (stirling_integral m u / (u - complex_of_real x) ^ Suc j) \<le> B / x ^ (m + Suc j)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
cmod (stirling_integral m u / (u - complex_of_real x) ^ Suc j) \<le> B / x ^ (m + Suc j)

goal (2 subgoals):
 1. 0 \<le> B / x ^ (m + Suc j)
 2. 0 < x / 2
[PROOF STEP]
qed (insert elim c_nonneg, auto simp: B_def simp del: power_Suc)
[PROOF STATE]
proof (state)
this:
cmod (complex_of_real (2 * pi) * \<i> / fact j * (deriv ^^ j) (stirling_integral m) (complex_of_real x)) \<le> B / x ^ (m + Suc j) * (2 * pi * (x / 2))

goal (1 subgoal):
 1. \<And>x. 0 < x \<Longrightarrow> norm ((deriv ^^ j) (stirling_integral m) x) \<le> B' * norm (1 / x ^ (m + j))
[PROOF STEP]
hence "cmod ((deriv ^^ j) (stirling_integral m) (of_real x)) \<le> B' / x ^ (j + m)"
[PROOF STATE]
proof (prove)
using this:
cmod (complex_of_real (2 * pi) * \<i> / fact j * (deriv ^^ j) (stirling_integral m) (complex_of_real x)) \<le> B / x ^ (m + Suc j) * (2 * pi * (x / 2))

goal (1 subgoal):
 1. cmod ((deriv ^^ j) (stirling_integral m) (complex_of_real x)) \<le> B' / x ^ (j + m)
[PROOF STEP]
using elim
[PROOF STATE]
proof (prove)
using this:
cmod (complex_of_real (2 * pi) * \<i> / fact j * (deriv ^^ j) (stirling_integral m) (complex_of_real x)) \<le> B / x ^ (m + Suc j) * (2 * pi * (x / 2))
0 < x

goal (1 subgoal):
 1. cmod ((deriv ^^ j) (stirling_integral m) (complex_of_real x)) \<le> B' / x ^ (j + m)
[PROOF STEP]
by (simp add: field_simps norm_divide norm_mult norm_power B'_def)
[PROOF STATE]
proof (state)
this:
cmod ((deriv ^^ j) (stirling_integral m) (complex_of_real x)) \<le> B' / x ^ (j + m)

goal (1 subgoal):
 1. \<And>x. 0 < x \<Longrightarrow> norm ((deriv ^^ j) (stirling_integral m) x) \<le> B' * norm (1 / x ^ (m + j))
[PROOF STEP]
with elim m
[PROOF STATE]
proof (chain)
picking this:
0 < x
0 < m
cmod ((deriv ^^ j) (stirling_integral m) (complex_of_real x)) \<le> B' / x ^ (j + m)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
0 < x
0 < m
cmod ((deriv ^^ j) (stirling_integral m) (complex_of_real x)) \<le> B' / x ^ (j + m)

goal (1 subgoal):
 1. norm ((deriv ^^ j) (stirling_integral m) x) \<le> B' * norm (1 / x ^ (m + j))
[PROOF STEP]
by (simp_all add: add_ac deriv_stirling_integral_complex_of_real)
[PROOF STATE]
proof (state)
this:
norm ((deriv ^^ j) (stirling_integral m) x) \<le> B' * norm (1 / x ^ (m + j))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. norm ((deriv ^^ j) (stirling_integral m) x) \<le> B' * norm (1 / x ^ (m + j))

goal (1 subgoal):
 1. (deriv ^^ j) (stirling_integral m) \<in> O(\<lambda>x. 1 / x ^ (m + j))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. norm ((deriv ^^ j) (stirling_integral m) x) \<le> B' * norm (1 / x ^ (m + j))

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma size_mset_removeAll_mset_le_iff: "size (removeAll_mset x M) < size M \<longleftrightarrow> x \<in># M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (size (removeAll_mset x M) < size M) = (x \<in># M)
[PROOF STEP]
by (auto intro: count_inI mset_subset_size simp: subset_mset_def multiset_eq_iff)


[STATEMENT]
lemma zimplode_zexplode: "zimplode (zexplode z) = z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zimplode (zexplode z) = z
[PROOF STEP]
apply (simp add: zimplode_def zexplode_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. implode (Rep_zet (Abs_zet (explode z))) = z
[PROOF STEP]
apply (subst Abs_zet_inverse)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. explode z \<in> zet
 2. implode (explode z) = z
[PROOF STEP]
apply (auto simp add: explode_mem_zet)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma vrrestriction_Set_is_arr'[cat_cs_intros]:
  assumes "T : A \<mapsto>\<^bsub>cat_Set \<alpha>\<^esub> B"
    and "\<R>\<^sub>\<circ> (T\<lparr>ArrVal\<rparr>) \<subseteq>\<^sub>\<circ> C"
    and "C \<in>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>"
    and "C' = C"
    and "\<CC>' = cat_Set \<alpha>"
  shows "T \<restriction>\<^sup>r\<^sub>S\<^sub>e\<^sub>t C : A \<mapsto>\<^bsub>\<CC>'\<^esub> C'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T \<restriction>\<^sup>r\<^sub>S\<^sub>e\<^sub>t C : A \<mapsto>\<^bsub>\<CC>'\<^esub> C'
[PROOF STEP]
using assms(1-3)
[PROOF STATE]
proof (prove)
using this:
T : A \<mapsto>\<^bsub>cat_Set \<alpha>\<^esub> B
\<R>\<^sub>\<circ> (T\<lparr>ArrVal\<rparr>) \<subseteq>\<^sub>\<circ> C
C \<in>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>

goal (1 subgoal):
 1. T \<restriction>\<^sup>r\<^sub>S\<^sub>e\<^sub>t C : A \<mapsto>\<^bsub>\<CC>'\<^esub> C'
[PROOF STEP]
unfolding assms(4,5)
[PROOF STATE]
proof (prove)
using this:
T : A \<mapsto>\<^bsub>cat_Set \<alpha>\<^esub> B
\<R>\<^sub>\<circ> (T\<lparr>ArrVal\<rparr>) \<subseteq>\<^sub>\<circ> C
C \<in>\<^sub>\<circ> cat_Set \<alpha>\<lparr>Obj\<rparr>

goal (1 subgoal):
 1. T \<restriction>\<^sup>r\<^sub>S\<^sub>e\<^sub>t C : A \<mapsto>\<^bsub>cat_Set \<alpha>\<^esub> C
[PROOF STEP]
by (rule vrrestriction_Set_is_arr)


[STATEMENT]
lemma sumset_Int_carrier_eq [simp]: "sumset A (B \<inter> G) = sumset A B" "sumset (A \<inter> G) B = sumset A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sumset A (B \<inter> G) = sumset A B &&& sumset (A \<inter> G) B = sumset A B
[PROOF STEP]
by (auto simp: sumset_eq)


[STATEMENT]
lemma (in residues) sum_cong: "finite A \<Longrightarrow> (\<Oplus>i\<in>A. (f i) mod m) = (\<Sum>i\<in>A. f i) mod m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite A \<Longrightarrow> (\<Oplus>i\<in>A. f i mod m) = sum f A mod m
[PROOF STEP]
by (induct set: finite) (auto simp: zero_cong add_cong)


[STATEMENT]
lemma deformation_retract_imp_isomorphic_homology_groups:
   "\<lbrakk>retraction_maps X X' r id; homotopic_with (\<lambda>h. True) X X r id\<rbrakk>
        \<Longrightarrow> homology_group p X \<cong> homology_group p X'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>retraction_maps X X' r id; homotopic_with (\<lambda>h. True) X X r id\<rbrakk> \<Longrightarrow> homology_group p X \<cong> homology_group p X'
[PROOF STEP]
by (simp add: deformation_retraction_imp_isomorphic_homology_groups)


[STATEMENT]
lemma reachable_alt_def: "reachable p = {target r p |r. path r p}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. reachable p = {target r p |r. path r p}
[PROOF STEP]
by auto


[STATEMENT]
lemma directed_ub: "directed X \<Longrightarrow> (\<forall>x \<in> X. \<forall>y \<in> X. \<exists>z \<in> X. x \<le> z \<and> y \<le> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. directed X \<Longrightarrow> \<forall>x\<in>X. \<forall>y\<in>X. \<exists>z\<in>X. x \<le> z \<and> y \<le> z
[PROOF STEP]
by (meson empty_subsetI directed_def finite.emptyI finite_insert insert_subset order_refl)


[STATEMENT]
lemma "hierarchy_next [Department ''i20'' [], Department ''i8'' [Department ''CoffeeMachine'' [], Department ''TeaMachine'' []]]
        (''i8''--''whatsoever''--Leaf)
        =
        Some (Department ''i8'' [Department ''CoffeeMachine'' [], Department ''TeaMachine'' []])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hierarchy_next [Department ''i20'' [], Department ''i8'' [Department ''CoffeeMachine'' [], Department ''TeaMachine'' []]] (''i8'' -- ''whatsoever'' -- Leaf) = Some (Department ''i8'' [Department ''CoffeeMachine'' [], Department ''TeaMachine'' []])
[PROOF STEP]
by eval


[STATEMENT]
lemma ab_group_add_on_with[implicit_ab_group_add]:
  "ab_group_add_on_with S ((+)::_::ab_group_add \<Rightarrow> _) 0 (-) uminus \<longleftrightarrow>
    comm_monoid_add_on_with S (+) 0 \<and> (\<forall>a\<in>S. -a\<in>S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ab_group_add_on_with S (+) (0::'a) (-) uminus = (comm_monoid_add_on_with S (+) (0::'a) \<and> (\<forall>a\<in>S. - a \<in> S))
[PROOF STEP]
unfolding ab_group_add_on_with_Ball_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (comm_monoid_add_on_with S (+) (0::'a) \<and> (\<forall>a\<in>S. - a + a = (0::'a)) \<and> (\<forall>a\<in>S. \<forall>b\<in>S. a - b = a + - b) \<and> (\<forall>a\<in>S. - a \<in> S)) = (comm_monoid_add_on_with S (+) (0::'a) \<and> (\<forall>a\<in>S. - a \<in> S))
[PROOF STEP]
by simp


[STATEMENT]
lemma [synth_rules]: "\<lbrakk>INTRO_KD R1 R1'; INTRO_KD R2 R2'\<rbrakk> \<Longrightarrow> INTRO_KD (R1*\<^sub>aR2) (R1'*\<^sub>aR2')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>INTRO_KD R1 R1'; INTRO_KD R2 R2'\<rbrakk> \<Longrightarrow> INTRO_KD (R1 *\<^sub>a R2) (R1' *\<^sub>a R2')
[PROOF STEP]
by simp


[STATEMENT]
lemma has_white_path_to_step[intro]:
  "\<lbrakk>(x has_white_path_to y) s; (y points_to z) s; white z s\<rbrakk> \<Longrightarrow> (x has_white_path_to z) s"
  "\<lbrakk>(y has_white_path_to z) s; (x points_to y) s; white y s\<rbrakk> \<Longrightarrow> (x has_white_path_to z) s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lbrakk>(x has_white_path_to y) s; (y points_to z) s; white z s\<rbrakk> \<Longrightarrow> (x has_white_path_to z) s) &&& (\<lbrakk>(y has_white_path_to z) s; (x points_to y) s; white y s\<rbrakk> \<Longrightarrow> (x has_white_path_to z) s)
[PROOF STEP]
unfolding has_white_path_to_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lbrakk>(\<lambda>x y. (x points_to y) s \<and> white y s)\<^sup>*\<^sup>* x y; (y points_to z) s; white z s\<rbrakk> \<Longrightarrow> (\<lambda>x y. (x points_to y) s \<and> white y s)\<^sup>*\<^sup>* x z) &&& (\<lbrakk>(\<lambda>x y. (x points_to y) s \<and> white y s)\<^sup>*\<^sup>* y z; (x points_to y) s; white y s\<rbrakk> \<Longrightarrow> (\<lambda>x y. (x points_to y) s \<and> white y s)\<^sup>*\<^sup>* x z)
[PROOF STEP]
apply (simp add: rtranclp.rtrancl_into_rtrancl)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(\<lambda>x y. (x points_to y) s \<and> white y s)\<^sup>*\<^sup>* y z; (x points_to y) s; white y s\<rbrakk> \<Longrightarrow> (\<lambda>x y. (x points_to y) s \<and> white y s)\<^sup>*\<^sup>* x z
[PROOF STEP]
apply (simp add: converse_rtranclp_into_rtranclp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma ltl_lfilter: "ltl (lfilter P xs) = lfilter P (ltl (ldropWhile (Not \<circ> P) xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ltl (lfilter P xs) = lfilter P (ltl (ldropWhile (Not \<circ> P) xs))
[PROOF STEP]
by(induct xs) simp_all


[STATEMENT]
lemma listset: "listset xs = { ys. length ys = length xs \<and> (\<forall> i < length xs. ys ! i \<in> xs ! i)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. listset xs = {ys. length ys = length xs \<and> (\<forall>i<length xs. ys ! i \<in> xs ! i)}
[PROOF STEP]
proof (induct xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. listset [] = {ys. length ys = length [] \<and> (\<forall>i<length []. ys ! i \<in> [] ! i)}
 2. \<And>a xs. listset xs = {ys. length ys = length xs \<and> (\<forall>i<length xs. ys ! i \<in> xs ! i)} \<Longrightarrow> listset (a # xs) = {ys. length ys = length (a # xs) \<and> (\<forall>i<length (a # xs). ys ! i \<in> (a # xs) ! i)}
[PROOF STEP]
case (Cons x xs)
[PROOF STATE]
proof (state)
this:
listset xs = {ys. length ys = length xs \<and> (\<forall>i<length xs. ys ! i \<in> xs ! i)}

goal (2 subgoals):
 1. listset [] = {ys. length ys = length [] \<and> (\<forall>i<length []. ys ! i \<in> [] ! i)}
 2. \<And>a xs. listset xs = {ys. length ys = length xs \<and> (\<forall>i<length xs. ys ! i \<in> xs ! i)} \<Longrightarrow> listset (a # xs) = {ys. length ys = length (a # xs) \<and> (\<forall>i<length (a # xs). ys ! i \<in> (a # xs) ! i)}
[PROOF STEP]
let ?n = "length xs"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. listset [] = {ys. length ys = length [] \<and> (\<forall>i<length []. ys ! i \<in> [] ! i)}
 2. \<And>a xs. listset xs = {ys. length ys = length xs \<and> (\<forall>i<length xs. ys ! i \<in> xs ! i)} \<Longrightarrow> listset (a # xs) = {ys. length ys = length (a # xs) \<and> (\<forall>i<length (a # xs). ys ! i \<in> (a # xs) ! i)}
[PROOF STEP]
from Cons
[PROOF STATE]
proof (chain)
picking this:
listset xs = {ys. length ys = length xs \<and> (\<forall>i<length xs. ys ! i \<in> xs ! i)}
[PROOF STEP]
have "?case = (set_Cons x {ys. length ys = ?n \<and> (\<forall>i < ?n. ys ! i \<in> xs ! i)} =
    {ys. length ys = Suc ?n \<and> ys ! 0 \<in> x \<and> (\<forall>i < ?n. ys ! Suc i \<in> xs ! i)})"
    (is "_ = (?L = ?R)")
[PROOF STATE]
proof (prove)
using this:
listset xs = {ys. length ys = length xs \<and> (\<forall>i<length xs. ys ! i \<in> xs ! i)}

goal (1 subgoal):
 1. (listset (x # xs) = {ys. length ys = length (x # xs) \<and> (\<forall>i<length (x # xs). ys ! i \<in> (x # xs) ! i)}) = (set_Cons x {ys. length ys = length xs \<and> (\<forall>i<length xs. ys ! i \<in> xs ! i)} = {ys. length ys = Suc (length xs) \<and> ys ! 0 \<in> x \<and> (\<forall>i<length xs. ys ! Suc i \<in> xs ! i)})
[PROOF STEP]
by (auto simp: all_Suc_conv)
[PROOF STATE]
proof (state)
this:
(listset (x # xs) = {ys. length ys = length (x # xs) \<and> (\<forall>i<length (x # xs). ys ! i \<in> (x # xs) ! i)}) = (set_Cons x {ys. length ys = length xs \<and> (\<forall>i<length xs. ys ! i \<in> xs ! i)} = {ys. length ys = Suc (length xs) \<and> ys ! 0 \<in> x \<and> (\<forall>i<length xs. ys ! Suc i \<in> xs ! i)})

goal (2 subgoals):
 1. listset [] = {ys. length ys = length [] \<and> (\<forall>i<length []. ys ! i \<in> [] ! i)}
 2. \<And>a xs. listset xs = {ys. length ys = length xs \<and> (\<forall>i<length xs. ys ! i \<in> xs ! i)} \<Longrightarrow> listset (a # xs) = {ys. length ys = length (a # xs) \<and> (\<forall>i<length (a # xs). ys ! i \<in> (a # xs) ! i)}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(listset (x # xs) = {ys. length ys = length (x # xs) \<and> (\<forall>i<length (x # xs). ys ! i \<in> (x # xs) ! i)}) = (set_Cons x {ys. length ys = length xs \<and> (\<forall>i<length xs. ys ! i \<in> xs ! i)} = {ys. length ys = Suc (length xs) \<and> ys ! 0 \<in> x \<and> (\<forall>i<length xs. ys ! Suc i \<in> xs ! i)})

goal (2 subgoals):
 1. listset [] = {ys. length ys = length [] \<and> (\<forall>i<length []. ys ! i \<in> [] ! i)}
 2. \<And>a xs. listset xs = {ys. length ys = length xs \<and> (\<forall>i<length xs. ys ! i \<in> xs ! i)} \<Longrightarrow> listset (a # xs) = {ys. length ys = length (a # xs) \<and> (\<forall>i<length (a # xs). ys ! i \<in> (a # xs) ! i)}
[PROOF STEP]
have "?L = ?R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_Cons x {ys. length ys = length xs \<and> (\<forall>i<length xs. ys ! i \<in> xs ! i)} = {ys. length ys = Suc (length xs) \<and> ys ! 0 \<in> x \<and> (\<forall>i<length xs. ys ! Suc i \<in> xs ! i)}
[PROOF STEP]
by (auto simp: set_Cons_def, case_tac xa, auto)
[PROOF STATE]
proof (state)
this:
set_Cons x {ys. length ys = length xs \<and> (\<forall>i<length xs. ys ! i \<in> xs ! i)} = {ys. length ys = Suc (length xs) \<and> ys ! 0 \<in> x \<and> (\<forall>i<length xs. ys ! Suc i \<in> xs ! i)}

goal (2 subgoals):
 1. listset [] = {ys. length ys = length [] \<and> (\<forall>i<length []. ys ! i \<in> [] ! i)}
 2. \<And>a xs. listset xs = {ys. length ys = length xs \<and> (\<forall>i<length xs. ys ! i \<in> xs ! i)} \<Longrightarrow> listset (a # xs) = {ys. length ys = length (a # xs) \<and> (\<forall>i<length (a # xs). ys ! i \<in> (a # xs) ! i)}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(listset (x # xs) = {ys. length ys = length (x # xs) \<and> (\<forall>i<length (x # xs). ys ! i \<in> (x # xs) ! i)}) = ({ys. length ys = Suc (length xs) \<and> ys ! 0 \<in> x \<and> (\<forall>i<length xs. ys ! Suc i \<in> xs ! i)} = {ys. length ys = Suc (length xs) \<and> ys ! 0 \<in> x \<and> (\<forall>i<length xs. ys ! Suc i \<in> xs ! i)})
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(listset (x # xs) = {ys. length ys = length (x # xs) \<and> (\<forall>i<length (x # xs). ys ! i \<in> (x # xs) ! i)}) = ({ys. length ys = Suc (length xs) \<and> ys ! 0 \<in> x \<and> (\<forall>i<length xs. ys ! Suc i \<in> xs ! i)} = {ys. length ys = Suc (length xs) \<and> ys ! 0 \<in> x \<and> (\<forall>i<length xs. ys ! Suc i \<in> xs ! i)})

goal (1 subgoal):
 1. listset (x # xs) = {ys. length ys = length (x # xs) \<and> (\<forall>i<length (x # xs). ys ! i \<in> (x # xs) ! i)}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
listset (x # xs) = {ys. length ys = length (x # xs) \<and> (\<forall>i<length (x # xs). ys ! i \<in> (x # xs) ! i)}

goal (1 subgoal):
 1. listset [] = {ys. length ys = length [] \<and> (\<forall>i<length []. ys ! i \<in> [] ! i)}
[PROOF STEP]
qed auto


[STATEMENT]
lemma bdd_below_image_mono:
  assumes "mono\<^sub>a\<^sub>b f" and "ord\<^sub>a.bdd_below A"
  shows "ord\<^sub>b.bdd_below (f ` A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ord\<^sub>b.bdd_below (f ` A)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
mono\<^sub>a\<^sub>b f
ord\<^sub>a.bdd_below A

goal (1 subgoal):
 1. ord\<^sub>b.bdd_below (f ` A)
[PROOF STEP]
by (auto simp: bdd_def mono_def)


[STATEMENT]
lemma filter_mset_add_mset [simp]:
   "filter_mset P (add_mset x A) =
     (if P x then add_mset x (filter_mset P A) else filter_mset P A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filter_mset P (add_mset x A) = (if P x then add_mset x (filter_mset P A) else filter_mset P A)
[PROOF STEP]
by (auto simp: multiset_eq_iff)


[STATEMENT]
lemma space_stat[simp]: "space (stat C) = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. space (stat C) = UNIV
[PROOF STEP]
by (simp add: stat_def space_point_measure)


[STATEMENT]
lemma vcomp_VLambda:
  "(\<lambda>b\<in>\<^sub>\<circ>((\<lambda>a\<in>\<^sub>\<circ>A. g a) `\<^sub>\<circ> A). f b) \<circ>\<^sub>\<circ> (\<lambda>a\<in>\<^sub>\<circ>A. g a) = (\<lambda>a\<in>\<^sub>\<circ>A. (f \<circ> g) a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. VLambda (VLambda A g `\<^sub>\<circ> A) f \<circ>\<^sub>\<circ> VLambda A g = VLambda A (f \<circ> g)
[PROOF STEP]
using VLambda_iff1
[PROOF STATE]
proof (prove)
using this:
(?x \<in>\<^sub>\<circ> VLambda ?A ?f) = (\<exists>a\<in>elts ?A. ?x = \<langle>a, ?f a\<rangle>)

goal (1 subgoal):
 1. VLambda (VLambda A g `\<^sub>\<circ> A) f \<circ>\<^sub>\<circ> VLambda A g = VLambda A (f \<circ> g)
[PROOF STEP]
by (auto intro!: vsubset_antisym)+


[STATEMENT]
lemma rat_sgn_code [code abstract]: "quotient_of (sgn p) = (sgn (fst (quotient_of p)), 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. quotient_of (sgn p) = (sgn (fst (quotient_of p)), 1)
[PROOF STEP]
proof (cases p)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>p = Fract a b; 0 < b; coprime a b\<rbrakk> \<Longrightarrow> quotient_of (sgn p) = (sgn (fst (quotient_of p)), 1)
[PROOF STEP]
case (Fract a b)
[PROOF STATE]
proof (state)
this:
p = Fract a b
0 < b
coprime a b

goal (1 subgoal):
 1. \<And>a b. \<lbrakk>p = Fract a b; 0 < b; coprime a b\<rbrakk> \<Longrightarrow> quotient_of (sgn p) = (sgn (fst (quotient_of p)), 1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p = Fract a b
0 < b
coprime a b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
p = Fract a b
0 < b
coprime a b

goal (1 subgoal):
 1. quotient_of (sgn p) = (sgn (fst (quotient_of p)), 1)
[PROOF STEP]
by (cases "0::int" a rule: linorder_cases) (simp_all add: quotient_of_Fract)
[PROOF STATE]
proof (state)
this:
quotient_of (sgn p) = (sgn (fst (quotient_of p)), 1)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma count_lift_profile [simp]: "count (lift_profile A) x = l * count A x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count (lift_profile A) x = l * count A x
[PROOF STEP]
unfolding lift_profile_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count (\<Sum>\<^sub># (image_mset (replicate_mset l) A)) x = l * count A x
[PROOF STEP]
by (induction A) auto


[STATEMENT]
lemma indoc_append[simp]: "indoc a (u @ v) \<longleftrightarrow>
      indoc a u \<or> a \<notin> set u \<and> Ind {a} (set u) \<and> indoc a v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indoc a (u @ v) = (indoc a u \<or> a \<notin> set u \<and> Ind {a} (set u) \<and> indoc a v)
[PROOF STEP]
by blast


[STATEMENT]
lemma u_NotexpiredSK_NotexpiredAK:
     "\<lbrakk> \<not> expiredSK Ts evs; servKlife + Ts \<le> authKlife + Ta \<rbrakk>
      \<Longrightarrow> \<not> expiredAK Ta evs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<not> expiredSK Ts evs; servKlife + Ts \<le> authKlife + Ta\<rbrakk> \<Longrightarrow> \<not> expiredAK Ta evs
[PROOF STEP]
by (metis le_less_trans)


[STATEMENT]
lemma consistentI: "(\<And>x y. (x, y) \<in> r\<^sup>+ \<Longrightarrow> (y, x) \<notin> asym_factor r) \<Longrightarrow> consistent r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x y. (x, y) \<in> r\<^sup>+ \<Longrightarrow> (y, x) \<notin> asym_factor r) \<Longrightarrow> consistent r
[PROOF STEP]
unfolding consistent_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x y. (x, y) \<in> r\<^sup>+ \<Longrightarrow> (y, x) \<notin> asym_factor r) \<Longrightarrow> \<forall>(x, y)\<in>r\<^sup>+. (y, x) \<notin> asym_factor r
[PROOF STEP]
by blast


[STATEMENT]
lemma reachable_nodes_steps':
  assumes "u \<in> reachable_nodes g r" "(u, v) \<in> (edges g)\<^sup>*"
  shows "v\<in>reachable_nodes g r" "(u, v) \<in> (edges (component_of g r))\<^sup>*"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> reachable_nodes g r &&& (u, v) \<in> (edges (component_of g r))\<^sup>*
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. v \<in> reachable_nodes g r
 2. (u, v) \<in> (edges (component_of g r))\<^sup>*
[PROOF STEP]
show "v\<in>reachable_nodes g r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> reachable_nodes g r
[PROOF STEP]
using reachable_nodes_steps assms
[PROOF STATE]
proof (prove)
using this:
(edges ?g)\<^sup>* `` reachable_nodes ?g ?r \<subseteq> reachable_nodes ?g ?r
u \<in> reachable_nodes g r
(u, v) \<in> (edges g)\<^sup>*

goal (1 subgoal):
 1. v \<in> reachable_nodes g r
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
v \<in> reachable_nodes g r

goal (1 subgoal):
 1. (u, v) \<in> (edges (component_of g r))\<^sup>*
[PROOF STEP]
show "(u, v) \<in> (edges (component_of g r))\<^sup>*"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (u, v) \<in> (edges (component_of g r))\<^sup>*
[PROOF STEP]
using assms(2,1)
[PROOF STATE]
proof (prove)
using this:
(u, v) \<in> (edges g)\<^sup>*
u \<in> reachable_nodes g r

goal (1 subgoal):
 1. (u, v) \<in> (edges (component_of g r))\<^sup>*
[PROOF STEP]
apply (induction rule: converse_rtrancl_induct)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. v \<in> reachable_nodes g r \<Longrightarrow> (v, v) \<in> (edges (component_of g r))\<^sup>*
 2. \<And>y z. \<lbrakk>(y, z) \<in> edges g; (z, v) \<in> (edges g)\<^sup>*; z \<in> reachable_nodes g r \<Longrightarrow> (z, v) \<in> (edges (component_of g r))\<^sup>*; y \<in> reachable_nodes g r\<rbrakk> \<Longrightarrow> (y, v) \<in> (edges (component_of g r))\<^sup>*
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> reachable_nodes g r \<Longrightarrow> (v, v) \<in> (edges (component_of g r))\<^sup>*
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y z. \<lbrakk>(y, z) \<in> edges g; (z, v) \<in> (edges g)\<^sup>*; z \<in> reachable_nodes g r \<Longrightarrow> (z, v) \<in> (edges (component_of g r))\<^sup>*; y \<in> reachable_nodes g r\<rbrakk> \<Longrightarrow> (y, v) \<in> (edges (component_of g r))\<^sup>*
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(y_, z_) \<in> edges g; (z_, v) \<in> (edges g)\<^sup>*; z_ \<in> reachable_nodes g r \<Longrightarrow> (z_, v) \<in> (edges (component_of g r))\<^sup>*; y_ \<in> reachable_nodes g r\<rbrakk> \<Longrightarrow> (y_, v) \<in> (edges (component_of g r))\<^sup>*
[PROOF STEP]
by (smt converse_rtrancl_into_rtrancl reachable_nodes_step')
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(u, v) \<in> (edges (component_of g r))\<^sup>*

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma reflp_eq_onp: "reflp R \<longleftrightarrow> eq_onp (\<lambda>x. True) \<le> R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. reflp R = (eq_onp (\<lambda>x. True) \<le> R)
[PROOF STEP]
by(auto simp add: reflp_def eq_onp_def)


[STATEMENT]
lemma lens_plus_comm: "X \<bowtie> Y \<Longrightarrow> X +\<^sub>L Y \<approx>\<^sub>L Y +\<^sub>L X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X \<bowtie> Y \<Longrightarrow> X +\<^sub>L Y \<approx>\<^sub>L Y +\<^sub>L X
[PROOF STEP]
by (simp add: lens_equivI lens_indep_sym lens_plus_sub_comm)


[STATEMENT]
lemma catalan_aux_correct:
  assumes "k \<le> n"
  shows   "catalan_aux n k (catalan k) = catalan n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. catalan_aux n k (catalan k) = catalan n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
k \<le> n

goal (1 subgoal):
 1. catalan_aux n k (catalan k) = catalan n
[PROOF STEP]
proof (induction n k "catalan k" rule: catalan_aux.induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n k. \<lbrakk>\<lbrakk>\<not> n \<le> k; catalan k * (2 * (2 * k + 1)) div (k + 2) = catalan (Suc k); Suc k \<le> n\<rbrakk> \<Longrightarrow> catalan_aux n (Suc k) (catalan (Suc k)) = catalan n; k \<le> n\<rbrakk> \<Longrightarrow> catalan_aux n k (catalan k) = catalan n
[PROOF STEP]
case (1 n k)
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<not> n \<le> k; catalan k * (2 * (2 * k + 1)) div (k + 2) = catalan (Suc k); Suc k \<le> n\<rbrakk> \<Longrightarrow> catalan_aux n (Suc k) (catalan (Suc k)) = catalan n
k \<le> n

goal (1 subgoal):
 1. \<And>n k. \<lbrakk>\<lbrakk>\<not> n \<le> k; catalan k * (2 * (2 * k + 1)) div (k + 2) = catalan (Suc k); Suc k \<le> n\<rbrakk> \<Longrightarrow> catalan_aux n (Suc k) (catalan (Suc k)) = catalan n; k \<le> n\<rbrakk> \<Longrightarrow> catalan_aux n k (catalan k) = catalan n
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. catalan_aux n k (catalan k) = catalan n
[PROOF STEP]
proof (cases "k < n")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. k < n \<Longrightarrow> catalan_aux n k (catalan k) = catalan n
 2. \<not> k < n \<Longrightarrow> catalan_aux n k (catalan k) = catalan n
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
k < n

goal (2 subgoals):
 1. k < n \<Longrightarrow> catalan_aux n k (catalan k) = catalan n
 2. \<not> k < n \<Longrightarrow> catalan_aux n k (catalan k) = catalan n
[PROOF STEP]
hence "catalan_aux n k (catalan k) = catalan_aux n (Suc k) (catalan (Suc k))"
[PROOF STATE]
proof (prove)
using this:
k < n

goal (1 subgoal):
 1. catalan_aux n k (catalan k) = catalan_aux n (Suc k) (catalan (Suc k))
[PROOF STEP]
by (subst catalan_Suc') (simp_all add: catalan_aux_simps)
[PROOF STATE]
proof (state)
this:
catalan_aux n k (catalan k) = catalan_aux n (Suc k) (catalan (Suc k))

goal (2 subgoals):
 1. k < n \<Longrightarrow> catalan_aux n k (catalan k) = catalan n
 2. \<not> k < n \<Longrightarrow> catalan_aux n k (catalan k) = catalan n
[PROOF STEP]
with 1 True
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>\<not> n \<le> k; catalan k * (2 * (2 * k + 1)) div (k + 2) = catalan (Suc k); Suc k \<le> n\<rbrakk> \<Longrightarrow> catalan_aux n (Suc k) (catalan (Suc k)) = catalan n
k \<le> n
k < n
catalan_aux n k (catalan k) = catalan_aux n (Suc k) (catalan (Suc k))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<not> n \<le> k; catalan k * (2 * (2 * k + 1)) div (k + 2) = catalan (Suc k); Suc k \<le> n\<rbrakk> \<Longrightarrow> catalan_aux n (Suc k) (catalan (Suc k)) = catalan n
k \<le> n
k < n
catalan_aux n k (catalan k) = catalan_aux n (Suc k) (catalan (Suc k))

goal (1 subgoal):
 1. catalan_aux n k (catalan k) = catalan n
[PROOF STEP]
by (simp add: catalan_Suc')
[PROOF STATE]
proof (state)
this:
catalan_aux n k (catalan k) = catalan n

goal (1 subgoal):
 1. \<not> k < n \<Longrightarrow> catalan_aux n k (catalan k) = catalan n
[PROOF STEP]
qed (insert "1.prems", simp_all add: catalan_aux_simps)
[PROOF STATE]
proof (state)
this:
catalan_aux n k (catalan k) = catalan n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bij_betw_ball_uball:
  assumes "r>0"
  shows "bij_betw (\<lambda>x. complex_of_real r*x + z0) (ball 0 1) (ball z0 r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw (\<lambda>x. complex_of_real r * x + z0) (ball 0 1) (ball z0 r)
[PROOF STEP]
proof (rule bij_betw_imageI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. inj_on (\<lambda>x. complex_of_real r * x + z0) (ball 0 1)
 2. (\<lambda>x. complex_of_real r * x + z0) ` ball 0 1 = ball z0 r
[PROOF STEP]
show "inj_on (\<lambda>x. complex_of_real r * x + z0) (ball 0 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (\<lambda>x. complex_of_real r * x + z0) (ball 0 1)
[PROOF STEP]
unfolding inj_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>ball 0 1. \<forall>y\<in>ball 0 1. complex_of_real r * x + z0 = complex_of_real r * y + z0 \<longrightarrow> x = y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < r

goal (1 subgoal):
 1. \<forall>x\<in>ball 0 1. \<forall>y\<in>ball 0 1. complex_of_real r * x + z0 = complex_of_real r * y + z0 \<longrightarrow> x = y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
inj_on (\<lambda>x. complex_of_real r * x + z0) (ball 0 1)

goal (1 subgoal):
 1. (\<lambda>x. complex_of_real r * x + z0) ` ball 0 1 = ball z0 r
[PROOF STEP]
have "dist z0 (complex_of_real r * x + z0) < r" when "cmod x<1" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist z0 (complex_of_real r * x + z0) < r
[PROOF STEP]
using that assms
[PROOF STATE]
proof (prove)
using this:
cmod x < 1
0 < r

goal (1 subgoal):
 1. dist z0 (complex_of_real r * x + z0) < r
[PROOF STEP]
by (auto simp:dist_norm norm_mult abs_of_pos)
[PROOF STATE]
proof (state)
this:
cmod ?x < 1 \<Longrightarrow> dist z0 (complex_of_real r * ?x + z0) < r

goal (1 subgoal):
 1. (\<lambda>x. complex_of_real r * x + z0) ` ball 0 1 = ball z0 r
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
cmod ?x < 1 \<Longrightarrow> dist z0 (complex_of_real r * ?x + z0) < r

goal (1 subgoal):
 1. (\<lambda>x. complex_of_real r * x + z0) ` ball 0 1 = ball z0 r
[PROOF STEP]
have "x \<in> (\<lambda>x. complex_of_real r * x + z0) ` ball 0 1" when "dist z0 x < r" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> (\<lambda>x. complex_of_real r * x + z0) ` ball 0 1
[PROOF STEP]
apply (rule rev_image_eqI[of "(x-z0)/r"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (x - z0) / complex_of_real r \<in> ball 0 1
 2. x = complex_of_real r * ((x - z0) / complex_of_real r) + z0
[PROOF STEP]
using that assms
[PROOF STATE]
proof (prove)
using this:
dist z0 x < r
0 < r

goal (2 subgoals):
 1. (x - z0) / complex_of_real r \<in> ball 0 1
 2. x = complex_of_real r * ((x - z0) / complex_of_real r) + z0
[PROOF STEP]
by (auto simp add: dist_norm norm_divide norm_minus_commute)
[PROOF STATE]
proof (state)
this:
dist z0 ?x < r \<Longrightarrow> ?x \<in> (\<lambda>x. complex_of_real r * x + z0) ` ball 0 1

goal (1 subgoal):
 1. (\<lambda>x. complex_of_real r * x + z0) ` ball 0 1 = ball z0 r
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
cmod ?x < 1 \<Longrightarrow> dist z0 (complex_of_real r * ?x + z0) < r
dist z0 ?x < r \<Longrightarrow> ?x \<in> (\<lambda>x. complex_of_real r * x + z0) ` ball 0 1
[PROOF STEP]
show "(\<lambda>x. complex_of_real r  * x + z0) ` ball 0 1 = ball z0 r"
[PROOF STATE]
proof (prove)
using this:
cmod ?x < 1 \<Longrightarrow> dist z0 (complex_of_real r * ?x + z0) < r
dist z0 ?x < r \<Longrightarrow> ?x \<in> (\<lambda>x. complex_of_real r * x + z0) ` ball 0 1

goal (1 subgoal):
 1. (\<lambda>x. complex_of_real r * x + z0) ` ball 0 1 = ball z0 r
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. complex_of_real r * x + z0) ` ball 0 1 = ball z0 r

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma older_seniors_card:
  "card (older_seniors x n) = card (older_seniors y n) \<longleftrightarrow> older_seniors x n = older_seniors y n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (card (older_seniors x n) = card (older_seniors y n)) = (older_seniors x n = older_seniors y n)
[PROOF STEP]
by (metis less_not_refl older_seniors_cases_subset older_seniors_psubset_card_mono)


[STATEMENT]
lemma complement_p:
  "x \<sqinter> y = bot \<Longrightarrow> x \<squnion> y = top \<Longrightarrow> -x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<sqinter> y = bot; x \<squnion> y = top\<rbrakk> \<Longrightarrow> - x = y
[PROOF STEP]
by (metis pseudo_complement inf.commute inf_top.left_neutral sup.absorb_iff1 sup.commute sup_bot.right_neutral sup_inf_distrib2 p_inf)


[STATEMENT]
lemma lm008: "injections X Y = totalRels X Y \<inter> injectionsUniverse"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. injections X Y = totalRels X Y \<inter> injectionsUniverse
[PROOF STEP]
using injections_def
[PROOF STATE]
proof (prove)
using this:
injections ?X ?Y = {R. Domain R = ?X \<and> Range R \<subseteq> ?Y \<and> runiq R \<and> runiq (R\<inverse>)}

goal (1 subgoal):
 1. injections X Y = totalRels X Y \<inter> injectionsUniverse
[PROOF STEP]
by (simp add: Collect_conj_eq Int_assoc)


[STATEMENT]
lemma prob_space_uniform_measure:
  assumes A: "emeasure M A \<noteq> 0" "emeasure M A \<noteq> \<infinity>"
  shows "prob_space (uniform_measure M A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob_space (uniform_measure M A)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. emeasure (uniform_measure M A) (space (uniform_measure M A)) = 1
[PROOF STEP]
show "emeasure (uniform_measure M A) (space (uniform_measure M A)) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure (uniform_measure M A) (space (uniform_measure M A)) = 1
[PROOF STEP]
using emeasure_uniform_measure[OF emeasure_neq_0_sets[OF A(1)], of "space M"]
[PROOF STATE]
proof (prove)
using this:
space M \<in> sets M \<Longrightarrow> emeasure (uniform_measure M A) (space M) = emeasure M (A \<inter> space M) / emeasure M A

goal (1 subgoal):
 1. emeasure (uniform_measure M A) (space (uniform_measure M A)) = 1
[PROOF STEP]
using sets.sets_into_space[OF emeasure_neq_0_sets[OF A(1)]] A
[PROOF STATE]
proof (prove)
using this:
space M \<in> sets M \<Longrightarrow> emeasure (uniform_measure M A) (space M) = emeasure M (A \<inter> space M) / emeasure M A
A \<subseteq> space M
emeasure M A \<noteq> 0
emeasure M A \<noteq> \<infinity>

goal (1 subgoal):
 1. emeasure (uniform_measure M A) (space (uniform_measure M A)) = 1
[PROOF STEP]
by (simp add: Int_absorb2 less_top)
[PROOF STATE]
proof (state)
this:
emeasure (uniform_measure M A) (space (uniform_measure M A)) = 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma int_not_neginf:
  assumes b1:" real_of_int (sint ra) <  real_of_int (sint POS_INF)"
  assumes b2:" real_of_int (sint NEG_INF) <  real_of_int (sint ra)"
  shows "ra \<noteq> NEG_INF"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ra \<noteq> NEG_INF
[PROOF STEP]
using b1 b2
[PROOF STATE]
proof (prove)
using this:
real_of_int (sint ra) < real_of_int (sint POS_INF)
real_of_int (sint NEG_INF) < real_of_int (sint ra)

goal (1 subgoal):
 1. ra \<noteq> NEG_INF
[PROOF STEP]
by auto


[STATEMENT]
lemma append_rows_nth2:
  assumes A': "A' \<in> carrier_mat m n"
  and B: "B \<in> carrier_mat p n"
  and A_def: "A = (A' @\<^sub>r  B)"
  and a: "a<m" and ap: "a < p" and j: "j<n"
  shows "A $$ (a + m, j) = B $$ (a,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A $$ (a + m, j) = B $$ (a, j)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A $$ (a + m, j) = B $$ (a, j)
[PROOF STEP]
have "A $$ (a + m, j) = (if a + m < dim_row A' then A' $$ (a + m, j) else B $$ (a + m - m, j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A $$ (a + m, j) = (if a + m < dim_row A' then A' $$ (a + m, j) else B $$ (a + m - m, j))
[PROOF STEP]
unfolding A_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A' @\<^sub>r B) $$ (a + m, j) = (if a + m < dim_row A' then A' $$ (a + m, j) else B $$ (a + m - m, j))
[PROOF STEP]
by (rule append_rows_nth[OF A' B _ j], insert ap a, auto)
[PROOF STATE]
proof (state)
this:
A $$ (a + m, j) = (if a + m < dim_row A' then A' $$ (a + m, j) else B $$ (a + m - m, j))

goal (1 subgoal):
 1. A $$ (a + m, j) = B $$ (a, j)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A $$ (a + m, j) = (if a + m < dim_row A' then A' $$ (a + m, j) else B $$ (a + m - m, j))

goal (1 subgoal):
 1. A $$ (a + m, j) = B $$ (a, j)
[PROOF STEP]
have "... = B $$ (a,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if a + m < dim_row A' then A' $$ (a + m, j) else B $$ (a + m - m, j)) = B $$ (a, j)
[PROOF STEP]
using ap a A'
[PROOF STATE]
proof (prove)
using this:
a < p
a < m
A' \<in> carrier_mat m n

goal (1 subgoal):
 1. (if a + m < dim_row A' then A' $$ (a + m, j) else B $$ (a + m - m, j)) = B $$ (a, j)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(if a + m < dim_row A' then A' $$ (a + m, j) else B $$ (a + m - m, j)) = B $$ (a, j)

goal (1 subgoal):
 1. A $$ (a + m, j) = B $$ (a, j)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
A $$ (a + m, j) = B $$ (a, j)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
A $$ (a + m, j) = B $$ (a, j)

goal (1 subgoal):
 1. A $$ (a + m, j) = B $$ (a, j)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
A $$ (a + m, j) = B $$ (a, j)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pt_perm_compose_aux:
  fixes pi1 :: "'x prm"
  and   pi2 :: "'x prm"
  and   x  :: "'a"
  assumes pt: "pt TYPE('a) TYPE('x)"
  and     at: "at TYPE('x)"
  shows "pi2\<bullet>(pi1\<bullet>x) = perm_aux (pi2\<bullet>pi1) (pi2\<bullet>x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pi2 \<bullet> pi1 \<bullet> x = perm_aux (pi2 \<bullet> pi1) (pi2 \<bullet> x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pi2 \<bullet> pi1 \<bullet> x = perm_aux (pi2 \<bullet> pi1) (pi2 \<bullet> x)
[PROOF STEP]
have "(pi2@pi1) \<triangleq> ((pi2\<bullet>pi1)@pi2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1.  (pi2 @ pi1) \<triangleq> (pi2 \<bullet> pi1 @ pi2)
[PROOF STEP]
by (rule at_ds8[OF at])
[PROOF STATE]
proof (state)
this:
 (pi2 @ pi1) \<triangleq> (pi2 \<bullet> pi1 @ pi2)

goal (1 subgoal):
 1. pi2 \<bullet> pi1 \<bullet> x = perm_aux (pi2 \<bullet> pi1) (pi2 \<bullet> x)
[PROOF STEP]
hence "(pi2@pi1)\<bullet>x = ((pi2\<bullet>pi1)@pi2)\<bullet>x"
[PROOF STATE]
proof (prove)
using this:
 (pi2 @ pi1) \<triangleq> (pi2 \<bullet> pi1 @ pi2)

goal (1 subgoal):
 1. (pi2 @ pi1) \<bullet> x = (pi2 \<bullet> pi1 @ pi2) \<bullet> x
[PROOF STEP]
by (rule pt3[OF pt])
[PROOF STATE]
proof (state)
this:
(pi2 @ pi1) \<bullet> x = (pi2 \<bullet> pi1 @ pi2) \<bullet> x

goal (1 subgoal):
 1. pi2 \<bullet> pi1 \<bullet> x = perm_aux (pi2 \<bullet> pi1) (pi2 \<bullet> x)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(pi2 @ pi1) \<bullet> x = (pi2 \<bullet> pi1 @ pi2) \<bullet> x

goal (1 subgoal):
 1. pi2 \<bullet> pi1 \<bullet> x = perm_aux (pi2 \<bullet> pi1) (pi2 \<bullet> x)
[PROOF STEP]
by (simp add: pt2[OF pt] perm_aux_def)
[PROOF STATE]
proof (state)
this:
pi2 \<bullet> pi1 \<bullet> x = perm_aux (pi2 \<bullet> pi1) (pi2 \<bullet> x)

goal:
No subgoals!
[PROOF STEP]
qed