[STATEMENT]
theorem kingman_theorem_AE_aux2:
  assumes "subcocycle u"
  shows "\<exists>(g::'a\<Rightarrow>ereal). (g\<in>borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>n. u n x / n) \<longlonglongrightarrow> g x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
define v where "v = (\<lambda>n x. u n x + birkhoff_sum (\<lambda>x. - u 1 x) n x)"
[PROOF STATE]
proof (state)
this:
v = (\<lambda>n x. u n x + birkhoff_sum (\<lambda>x. - u 1 x) n x)

goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
have "subcocycle v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subcocycle v
[PROOF STEP]
unfolding v_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subcocycle (\<lambda>n x. u n x + birkhoff_sum (\<lambda>x. - u 1 x) n x)
[PROOF STEP]
apply (rule subcocycle_add[OF assms], rule subcocycle_birkhoff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable M (\<lambda>x. - u 1 x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
subcocycle u

goal (1 subgoal):
 1. integrable M (\<lambda>x. - u 1 x)
[PROOF STEP]
unfolding subcocycle_def
[PROOF STATE]
proof (prove)
using this:
(\<forall>n. integrable M (u n)) \<and> (\<forall>n m x. u (n + m) x \<le> u n x + u m ((T ^^ n) x))

goal (1 subgoal):
 1. integrable M (\<lambda>x. - u 1 x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
subcocycle v

goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
have "\<exists>(gv::'a\<Rightarrow>ereal). (gv\<in>borel_measurable Invariants \<and> (\<forall>x. gv x < \<infinity>) \<and> (AE x in M. (\<lambda>n. v n x / n) \<longlonglongrightarrow> gv x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>gv. gv \<in> borel_measurable Invariants \<and> (\<forall>x. gv x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (v xa x / real xa)) \<longlonglongrightarrow> gv x)
[PROOF STEP]
apply (rule kingman_theorem_AE_aux1[OF \<open>subcocycle v\<close>])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. v 1 x \<le> 0
[PROOF STEP]
unfolding v_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. u 1 x + birkhoff_sum (\<lambda>x. - u 1 x) 1 x \<le> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>gv. gv \<in> borel_measurable Invariants \<and> (\<forall>x. gv x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (v xa x / real xa)) \<longlonglongrightarrow> gv x)

goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>gv. gv \<in> borel_measurable Invariants \<and> (\<forall>x. gv x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (v xa x / real xa)) \<longlonglongrightarrow> gv x)
[PROOF STEP]
obtain gv where gv: "gv \<in> borel_measurable Invariants" "AE x in M. (\<lambda>n. v n x / n) \<longlonglongrightarrow> (gv x::ereal)" "\<And>x. gv x < \<infinity>"
[PROOF STATE]
proof (prove)
using this:
\<exists>gv. gv \<in> borel_measurable Invariants \<and> (\<forall>x. gv x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (v xa x / real xa)) \<longlonglongrightarrow> gv x)

goal (1 subgoal):
 1. (\<And>gv. \<lbrakk>gv \<in> borel_measurable Invariants; AE x in M. (\<lambda>xa. ereal (v xa x / real xa)) \<longlonglongrightarrow> gv x; \<And>x. gv x < \<infinity>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
gv \<in> borel_measurable Invariants
AE x in M. (\<lambda>xa. ereal (v xa x / real xa)) \<longlonglongrightarrow> gv x
gv ?x3 < \<infinity>

goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
define g where "g = (\<lambda>x. gv x + ereal(real_cond_exp M Invariants (u 1) x))"
[PROOF STATE]
proof (state)
this:
g = (\<lambda>x. gv x + ereal (real_cond_exp M Invariants (u 1) x))

goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
have g_meas: "g \<in> borel_measurable Invariants"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g \<in> borel_measurable Invariants
[PROOF STEP]
unfolding g_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. gv x + ereal (real_cond_exp M Invariants (u 1) x)) \<in> borel_measurable Invariants
[PROOF STEP]
using gv(1)
[PROOF STATE]
proof (prove)
using this:
gv \<in> borel_measurable Invariants

goal (1 subgoal):
 1. (\<lambda>x. gv x + ereal (real_cond_exp M Invariants (u 1) x)) \<in> borel_measurable Invariants
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
g \<in> borel_measurable Invariants

goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
have g_fin: "\<And>x. g x < \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. g x < \<infinity>
[PROOF STEP]
unfolding g_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. gv x + ereal (real_cond_exp M Invariants (u 1) x) < \<infinity>
[PROOF STEP]
using gv(3)
[PROOF STATE]
proof (prove)
using this:
gv ?x3 < \<infinity>

goal (1 subgoal):
 1. \<And>x. gv x + ereal (real_cond_exp M Invariants (u 1) x) < \<infinity>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
g ?x3 < \<infinity>

goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
have "AE x in M. (\<lambda>n. birkhoff_sum (u 1) n x / n) \<longlonglongrightarrow> real_cond_exp M Invariants (u 1) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AE x in M. (\<lambda>n. birkhoff_sum (u 1) n x / real n) \<longlonglongrightarrow> real_cond_exp M Invariants (u 1) x
[PROOF STEP]
apply (rule birkhoff_theorem_AE_nonergodic)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable M (u 1)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
subcocycle u

goal (1 subgoal):
 1. integrable M (u 1)
[PROOF STEP]
unfolding subcocycle_def
[PROOF STATE]
proof (prove)
using this:
(\<forall>n. integrable M (u n)) \<and> (\<forall>n m x. u (n + m) x \<le> u n x + u m ((T ^^ n) x))

goal (1 subgoal):
 1. integrable M (u 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
AE x in M. (\<lambda>n. birkhoff_sum (u 1) n x / real n) \<longlonglongrightarrow> real_cond_exp M Invariants (u 1) x

goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
AE x in M. (\<lambda>n. birkhoff_sum (u 1) n x / real n) \<longlonglongrightarrow> real_cond_exp M Invariants (u 1) x

goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
AE x in M. (\<lambda>n. birkhoff_sum (u 1) n x / real n) \<longlonglongrightarrow> real_cond_exp M Invariants (u 1) x

goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
assume H: "(\<lambda>n. v n x / n) \<longlonglongrightarrow> (gv x)"
                    "(\<lambda>n. birkhoff_sum (u 1) n x / n) \<longlonglongrightarrow> real_cond_exp M Invariants (u 1) x"
[PROOF STATE]
proof (state)
this:
(\<lambda>xa. ereal (v xa x / real xa)) \<longlonglongrightarrow> gv x
(\<lambda>n. birkhoff_sum (u 1) n x / real n) \<longlonglongrightarrow> real_cond_exp M Invariants (u 1) x

goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>xa. ereal (v xa x / real xa)) \<longlonglongrightarrow> gv x
(\<lambda>n. birkhoff_sum (u 1) n x / real n) \<longlonglongrightarrow> real_cond_exp M Invariants (u 1) x
[PROOF STEP]
have "(\<lambda>n. ereal(birkhoff_sum (u 1) n x / n)) \<longlonglongrightarrow> ereal(real_cond_exp M Invariants (u 1) x)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>xa. ereal (v xa x / real xa)) \<longlonglongrightarrow> gv x
(\<lambda>n. birkhoff_sum (u 1) n x / real n) \<longlonglongrightarrow> real_cond_exp M Invariants (u 1) x

goal (1 subgoal):
 1. (\<lambda>n. ereal (birkhoff_sum (u 1) n x / real n)) \<longlonglongrightarrow> ereal (real_cond_exp M Invariants (u 1) x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>n. ereal (birkhoff_sum (u 1) n x / real n)) \<longlonglongrightarrow> ereal (real_cond_exp M Invariants (u 1) x)

goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
(\<lambda>n. ereal (birkhoff_sum (u 1) n x / real n)) \<longlonglongrightarrow> ereal (real_cond_exp M Invariants (u 1) x)

goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
have "u n x = v n x + birkhoff_sum (u 1) n x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u n x = v n x + birkhoff_sum (u 1) n x
[PROOF STEP]
unfolding v_def birkhoff_sum_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u n x = u n x + (\<Sum>i<n. - u 1 ((T ^^ i) x)) + (\<Sum>i<n. u 1 ((T ^^ i) x))
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<n. - u (Suc 0) ((T ^^ i) x)) + (\<Sum>i<n. u (Suc 0) ((T ^^ i) x)) = 0
[PROOF STEP]
by (simp add: sum_negf)
[PROOF STATE]
proof (state)
this:
u n x = v n x + birkhoff_sum (u 1) n x

goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u n x = v n x + birkhoff_sum (u 1) n x
[PROOF STEP]
have "u n x / n = v n x / n + birkhoff_sum (u 1) n x / n"
[PROOF STATE]
proof (prove)
using this:
u n x = v n x + birkhoff_sum (u 1) n x

goal (1 subgoal):
 1. u n x / real n = v n x / real n + birkhoff_sum (u 1) n x / real n
[PROOF STEP]
by (simp add: add_divide_distrib)
[PROOF STATE]
proof (state)
this:
u n x / real n = v n x / real n + birkhoff_sum (u 1) n x / real n

goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u n x / real n = v n x / real n + birkhoff_sum (u 1) n x / real n
[PROOF STEP]
have "ereal(u n x / n) = ereal(v n x / n) + ereal(birkhoff_sum (u 1) n x / n)"
[PROOF STATE]
proof (prove)
using this:
u n x / real n = v n x / real n + birkhoff_sum (u 1) n x / real n

goal (1 subgoal):
 1. ereal (u n x / real n) = ereal (v n x / real n) + ereal (birkhoff_sum (u 1) n x / real n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ereal (u n x / real n) = ereal (v n x / real n) + ereal (birkhoff_sum (u 1) n x / real n)

goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
ereal (u ?n5 x / real ?n5) = ereal (v ?n5 x / real ?n5) + ereal (birkhoff_sum (u 1) ?n5 x / real ?n5)

goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
note * = this
[PROOF STATE]
proof (state)
this:
ereal (u ?n5 x / real ?n5) = ereal (v ?n5 x / real ?n5) + ereal (birkhoff_sum (u 1) ?n5 x / real ?n5)

goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
have "(\<lambda>n. ereal(u n x / n)) \<longlonglongrightarrow> g x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. ereal (u n x / real n)) \<longlonglongrightarrow> g x
[PROOF STEP]
unfolding * g_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. ereal (v n x / real n) + ereal (birkhoff_sum (u 1) n x / real n)) \<longlonglongrightarrow> gv x + ereal (real_cond_exp M Invariants (u 1) x)
[PROOF STEP]
apply (intro tendsto_intros)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<not> (gv x = \<infinity> \<and> ereal (real_cond_exp M Invariants (u 1) x) = - \<infinity> \<or> gv x = - \<infinity> \<and> ereal (real_cond_exp M Invariants (u 1) x) = \<infinity>)
 2. (\<lambda>xa. ereal (v xa x / real xa)) \<longlonglongrightarrow> gv x
 3. (\<lambda>xa. birkhoff_sum (u 1) xa x / real xa) \<longlonglongrightarrow> real_cond_exp M Invariants (u 1) x
[PROOF STEP]
using H
[PROOF STATE]
proof (prove)
using this:
(\<lambda>xa. ereal (v xa x / real xa)) \<longlonglongrightarrow> gv x
(\<lambda>n. birkhoff_sum (u 1) n x / real n) \<longlonglongrightarrow> real_cond_exp M Invariants (u 1) x

goal (3 subgoals):
 1. \<not> (gv x = \<infinity> \<and> ereal (real_cond_exp M Invariants (u 1) x) = - \<infinity> \<or> gv x = - \<infinity> \<and> ereal (real_cond_exp M Invariants (u 1) x) = \<infinity>)
 2. (\<lambda>xa. ereal (v xa x / real xa)) \<longlonglongrightarrow> gv x
 3. (\<lambda>xa. birkhoff_sum (u 1) xa x / real xa) \<longlonglongrightarrow> real_cond_exp M Invariants (u 1) x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>n. ereal (u n x / real n)) \<longlonglongrightarrow> g x

goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>(\<lambda>x. ereal (v x ?x5 / real x)) \<longlonglongrightarrow> gv ?x5; (\<lambda>n. birkhoff_sum (u 1) n ?x5 / real n) \<longlonglongrightarrow> real_cond_exp M Invariants (u 1) ?x5\<rbrakk> \<Longrightarrow> (\<lambda>n. ereal (u n ?x5 / real n)) \<longlonglongrightarrow> g ?x5

goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
AE x in M. (\<lambda>n. birkhoff_sum (u 1) n x / real n) \<longlonglongrightarrow> real_cond_exp M Invariants (u 1) x
\<lbrakk>(\<lambda>x. ereal (v x ?x5 / real x)) \<longlonglongrightarrow> gv ?x5; (\<lambda>n. birkhoff_sum (u 1) n ?x5 / real n) \<longlonglongrightarrow> real_cond_exp M Invariants (u 1) ?x5\<rbrakk> \<Longrightarrow> (\<lambda>n. ereal (u n ?x5 / real n)) \<longlonglongrightarrow> g ?x5
[PROOF STEP]
have "AE x in M. (\<lambda>n. ereal(u n x / n)) \<longlonglongrightarrow> g x"
[PROOF STATE]
proof (prove)
using this:
AE x in M. (\<lambda>n. birkhoff_sum (u 1) n x / real n) \<longlonglongrightarrow> real_cond_exp M Invariants (u 1) x
\<lbrakk>(\<lambda>x. ereal (v x ?x5 / real x)) \<longlonglongrightarrow> gv ?x5; (\<lambda>n. birkhoff_sum (u 1) n ?x5 / real n) \<longlonglongrightarrow> real_cond_exp M Invariants (u 1) ?x5\<rbrakk> \<Longrightarrow> (\<lambda>n. ereal (u n ?x5 / real n)) \<longlonglongrightarrow> g ?x5

goal (1 subgoal):
 1. AE x in M. (\<lambda>n. ereal (u n x / real n)) \<longlonglongrightarrow> g x
[PROOF STEP]
using gv(2)
[PROOF STATE]
proof (prove)
using this:
AE x in M. (\<lambda>n. birkhoff_sum (u 1) n x / real n) \<longlonglongrightarrow> real_cond_exp M Invariants (u 1) x
\<lbrakk>(\<lambda>x. ereal (v x ?x5 / real x)) \<longlonglongrightarrow> gv ?x5; (\<lambda>n. birkhoff_sum (u 1) n ?x5 / real n) \<longlonglongrightarrow> real_cond_exp M Invariants (u 1) ?x5\<rbrakk> \<Longrightarrow> (\<lambda>n. ereal (u n ?x5 / real n)) \<longlonglongrightarrow> g ?x5
AE x in M. (\<lambda>xa. ereal (v xa x / real xa)) \<longlonglongrightarrow> gv x

goal (1 subgoal):
 1. AE x in M. (\<lambda>n. ereal (u n x / real n)) \<longlonglongrightarrow> g x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
AE x in M. (\<lambda>n. ereal (u n x / real n)) \<longlonglongrightarrow> g x

goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
AE x in M. (\<lambda>n. ereal (u n x / real n)) \<longlonglongrightarrow> g x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
AE x in M. (\<lambda>n. ereal (u n x / real n)) \<longlonglongrightarrow> g x

goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
using g_meas g_fin
[PROOF STATE]
proof (prove)
using this:
AE x in M. (\<lambda>n. ereal (u n x / real n)) \<longlonglongrightarrow> g x
g \<in> borel_measurable Invariants
g ?x3 < \<infinity>

goal (1 subgoal):
 1. \<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>g. g \<in> borel_measurable Invariants \<and> (\<forall>x. g x < \<infinity>) \<and> (AE x in M. (\<lambda>xa. ereal (u xa x / real xa)) \<longlonglongrightarrow> g x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fpair_vcpower2I[intro]:
  assumes "a \<in>\<^sub>\<circ> A ^\<^sub>\<times> 1\<^sub>\<nat>" and "b \<in>\<^sub>\<circ> A ^\<^sub>\<times> 1\<^sub>\<nat>"
  shows "vconcat [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> A ^\<^sub>\<times> 2\<^sub>\<nat>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vconcat [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> A ^\<^sub>\<times> 2\<^sub>\<nat>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vconcat [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> A ^\<^sub>\<times> 2\<^sub>\<nat>
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
a \<in>\<^sub>\<circ> A ^\<^sub>\<times> 1\<^sub>\<nat>
b \<in>\<^sub>\<circ> A ^\<^sub>\<times> 1\<^sub>\<nat>
[PROOF STEP]
obtain a' b'
    where a_def: "a = [a']\<^sub>\<circ>" and b_def: "b = [b']\<^sub>\<circ>" and "a'\<in>\<^sub>\<circ> A" and "b'\<in>\<^sub>\<circ> A"
[PROOF STATE]
proof (prove)
using this:
a \<in>\<^sub>\<circ> A ^\<^sub>\<times> 1\<^sub>\<nat>
b \<in>\<^sub>\<circ> A ^\<^sub>\<times> 1\<^sub>\<nat>

goal (1 subgoal):
 1. (\<And>a' b'. \<lbrakk>a = [a']\<^sub>\<circ>; b = [b']\<^sub>\<circ>; a' \<in>\<^sub>\<circ> A; b' \<in>\<^sub>\<circ> A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (force elim: vcons_vcpower1E)
[PROOF STATE]
proof (state)
this:
a = [a']\<^sub>\<circ>
b = [b']\<^sub>\<circ>
a' \<in>\<^sub>\<circ> A
b' \<in>\<^sub>\<circ> A

goal (1 subgoal):
 1. vconcat [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> A ^\<^sub>\<times> 2\<^sub>\<nat>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a = [a']\<^sub>\<circ>
b = [b']\<^sub>\<circ>
a' \<in>\<^sub>\<circ> A
b' \<in>\<^sub>\<circ> A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a = [a']\<^sub>\<circ>
b = [b']\<^sub>\<circ>
a' \<in>\<^sub>\<circ> A
b' \<in>\<^sub>\<circ> A

goal (1 subgoal):
 1. vconcat [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> A ^\<^sub>\<times> 2\<^sub>\<nat>
[PROOF STEP]
by (auto simp: nat_omega_simps)
[PROOF STATE]
proof (state)
this:
vconcat [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> A ^\<^sub>\<times> 2\<^sub>\<nat>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem explosion_not_valid: "\<not> valid (Explosion (Pro ''p'') (Pro ''q''))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> valid (Imp' (Con' (Pro ''p'') (Neg' (Pro ''p''))) (Pro ''q''))
[PROOF STEP]
using explosion_counterexample transfer
[PROOF STATE]
proof (prove)
using this:
\<not> valid_in {1} (Imp' (Con' (Pro ''p'') (Neg' (Pro ''p''))) (Pro ''q''))
\<not> valid_in ?U ?p \<Longrightarrow> \<not> valid ?p

goal (1 subgoal):
 1. \<not> valid (Imp' (Con' (Pro ''p'') (Neg' (Pro ''p''))) (Pro ''q''))
[PROOF STEP]
by simp


[STATEMENT]
lemma n_distrib2_opp: "n x \<cdot> n y \<oplus> n z = (n x \<oplus> n z) \<cdot> (n y \<oplus> n z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n x \<cdot> n y \<oplus> n z = (n x \<oplus> n z) \<cdot> (n y \<oplus> n z)
[PROOF STEP]
by (metis de_morgan1 mult_t_closed n_distrib1_opp n_add_op_def)


[STATEMENT]
lemma Bolzano_Weierstrass_complex_disc:
  assumes r: "\<forall>n. cmod (s n) \<le> r"
  shows "\<exists>f z. strict_mono (f :: nat \<Rightarrow> nat) \<and> (\<forall>e >0. \<exists>N. \<forall>n \<ge> N. cmod (s (f n) - z) < e)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f z. strict_mono f \<and> (\<forall>e>0. \<exists>N. \<forall>n\<ge>N. cmod (s (f n) - z) < e)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f z. strict_mono f \<and> (\<forall>e>0. \<exists>N. \<forall>n\<ge>N. cmod (s (f n) - z) < e)
[PROOF STEP]
from seq_monosub[of "Re \<circ> s"]
[PROOF STATE]
proof (chain)
picking this:
\<exists>f. strict_mono f \<and> monoseq (\<lambda>n. (Re \<circ> s) (f n))
[PROOF STEP]
obtain f where f: "strict_mono f" "monoseq (\<lambda>n. Re (s (f n)))"
[PROOF STATE]
proof (prove)
using this:
\<exists>f. strict_mono f \<and> monoseq (\<lambda>n. (Re \<circ> s) (f n))

goal (1 subgoal):
 1. (\<And>f. \<lbrakk>strict_mono f; monoseq (\<lambda>n. Re (s (f n)))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding o_def
[PROOF STATE]
proof (prove)
using this:
\<exists>f. strict_mono f \<and> monoseq (\<lambda>n. Re (s (f n)))

goal (1 subgoal):
 1. (\<And>f. \<lbrakk>strict_mono f; monoseq (\<lambda>n. Re (s (f n)))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
strict_mono f
monoseq (\<lambda>n. Re (s (f n)))

goal (1 subgoal):
 1. \<exists>f z. strict_mono f \<and> (\<forall>e>0. \<exists>N. \<forall>n\<ge>N. cmod (s (f n) - z) < e)
[PROOF STEP]
from seq_monosub[of "Im \<circ> s \<circ> f"]
[PROOF STATE]
proof (chain)
picking this:
\<exists>fa. strict_mono fa \<and> monoseq (\<lambda>n. (Im \<circ> s \<circ> f) (fa n))
[PROOF STEP]
obtain g where g: "strict_mono g" "monoseq (\<lambda>n. Im (s (f (g n))))"
[PROOF STATE]
proof (prove)
using this:
\<exists>fa. strict_mono fa \<and> monoseq (\<lambda>n. (Im \<circ> s \<circ> f) (fa n))

goal (1 subgoal):
 1. (\<And>g. \<lbrakk>strict_mono g; monoseq (\<lambda>n. Im (s (f (g n))))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding o_def
[PROOF STATE]
proof (prove)
using this:
\<exists>fa. strict_mono fa \<and> monoseq (\<lambda>n. Im (s (f (fa n))))

goal (1 subgoal):
 1. (\<And>g. \<lbrakk>strict_mono g; monoseq (\<lambda>n. Im (s (f (g n))))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
strict_mono g
monoseq (\<lambda>n. Im (s (f (g n))))

goal (1 subgoal):
 1. \<exists>f z. strict_mono f \<and> (\<forall>e>0. \<exists>N. \<forall>n\<ge>N. cmod (s (f n) - z) < e)
[PROOF STEP]
let ?h = "f \<circ> g"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f z. strict_mono f \<and> (\<forall>e>0. \<exists>N. \<forall>n\<ge>N. cmod (s (f n) - z) < e)
[PROOF STEP]
from r[rule_format, of 0]
[PROOF STATE]
proof (chain)
picking this:
cmod (s 0) \<le> r
[PROOF STEP]
have rp: "r \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
cmod (s 0) \<le> r

goal (1 subgoal):
 1. 0 \<le> r
[PROOF STEP]
using norm_ge_zero[of "s 0"]
[PROOF STATE]
proof (prove)
using this:
cmod (s 0) \<le> r
0 \<le> cmod (s 0)

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

goal (1 subgoal):
 1. \<exists>f z. strict_mono f \<and> (\<forall>e>0. \<exists>N. \<forall>n\<ge>N. cmod (s (f n) - z) < e)
[PROOF STEP]
have th: "\<forall>n. r + 1 \<ge> \<bar>Re (s n)\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n. \<bar>Re (s n)\<bar> \<le> r + 1
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<bar>Re (s n)\<bar> \<le> r + 1
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<bar>Re (s n)\<bar> \<le> r + 1
[PROOF STEP]
from abs_Re_le_cmod[of "s n"] r[rule_format, of n]
[PROOF STATE]
proof (chain)
picking this:
\<bar>Re (s n)\<bar> \<le> cmod (s n)
cmod (s n) \<le> r
[PROOF STEP]
show "\<bar>Re (s n)\<bar> \<le> r + 1"
[PROOF STATE]
proof (prove)
using this:
\<bar>Re (s n)\<bar> \<le> cmod (s n)
cmod (s n) \<le> r

goal (1 subgoal):
 1. \<bar>Re (s n)\<bar> \<le> r + 1
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
\<bar>Re (s n)\<bar> \<le> r + 1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>n. \<bar>Re (s n)\<bar> \<le> r + 1

goal (1 subgoal):
 1. \<exists>f z. strict_mono f \<and> (\<forall>e>0. \<exists>N. \<forall>n\<ge>N. cmod (s (f n) - z) < e)
[PROOF STEP]
have conv1: "convergent (\<lambda>n. Re (s (f n)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convergent (\<lambda>n. Re (s (f n)))
[PROOF STEP]
apply (rule Bseq_monoseq_convergent)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. Bseq (\<lambda>n. Re (s (f n)))
 2. monoseq (\<lambda>n. Re (s (f n)))
[PROOF STEP]
apply (simp add: Bseq_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<exists>K>0. \<forall>n. \<bar>Re (s (f n))\<bar> \<le> K
 2. monoseq (\<lambda>n. Re (s (f n)))
[PROOF STEP]
apply (metis gt_ex le_less_linear less_trans order.trans th)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monoseq (\<lambda>n. Re (s (f n)))
[PROOF STEP]
apply (rule f(2))
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
convergent (\<lambda>n. Re (s (f n)))

goal (1 subgoal):
 1. \<exists>f z. strict_mono f \<and> (\<forall>e>0. \<exists>N. \<forall>n\<ge>N. cmod (s (f n) - z) < e)
[PROOF STEP]
have th: "\<forall>n. r + 1 \<ge> \<bar>Im (s n)\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n. \<bar>Im (s n)\<bar> \<le> r + 1
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<bar>Im (s n)\<bar> \<le> r + 1
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<bar>Im (s n)\<bar> \<le> r + 1
[PROOF STEP]
from abs_Im_le_cmod[of "s n"] r[rule_format, of n]
[PROOF STATE]
proof (chain)
picking this:
\<bar>Im (s n)\<bar> \<le> cmod (s n)
cmod (s n) \<le> r
[PROOF STEP]
show "\<bar>Im (s n)\<bar> \<le> r + 1"
[PROOF STATE]
proof (prove)
using this:
\<bar>Im (s n)\<bar> \<le> cmod (s n)
cmod (s n) \<le> r

goal (1 subgoal):
 1. \<bar>Im (s n)\<bar> \<le> r + 1
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
\<bar>Im (s n)\<bar> \<le> r + 1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>n. \<bar>Im (s n)\<bar> \<le> r + 1

goal (1 subgoal):
 1. \<exists>f z. strict_mono f \<and> (\<forall>e>0. \<exists>N. \<forall>n\<ge>N. cmod (s (f n) - z) < e)
[PROOF STEP]
have conv2: "convergent (\<lambda>n. Im (s (f (g n))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convergent (\<lambda>n. Im (s (f (g n))))
[PROOF STEP]
apply (rule Bseq_monoseq_convergent)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. Bseq (\<lambda>n. Im (s (f (g n))))
 2. monoseq (\<lambda>n. Im (s (f (g n))))
[PROOF STEP]
apply (simp add: Bseq_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<exists>K>0. \<forall>n. \<bar>Im (s (f (g n)))\<bar> \<le> K
 2. monoseq (\<lambda>n. Im (s (f (g n))))
[PROOF STEP]
apply (metis gt_ex le_less_linear less_trans order.trans th)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monoseq (\<lambda>n. Im (s (f (g n))))
[PROOF STEP]
apply (rule g(2))
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
convergent (\<lambda>n. Im (s (f (g n))))

goal (1 subgoal):
 1. \<exists>f z. strict_mono f \<and> (\<forall>e>0. \<exists>N. \<forall>n\<ge>N. cmod (s (f n) - z) < e)
[PROOF STEP]
from conv1[unfolded convergent_def]
[PROOF STATE]
proof (chain)
picking this:
\<exists>L. (\<lambda>n. Re (s (f n))) \<longlonglongrightarrow> L
[PROOF STEP]
obtain x where "LIMSEQ (\<lambda>n. Re (s (f n))) x"
[PROOF STATE]
proof (prove)
using this:
\<exists>L. (\<lambda>n. Re (s (f n))) \<longlonglongrightarrow> L

goal (1 subgoal):
 1. (\<And>x. (\<lambda>n. Re (s (f n))) \<longlonglongrightarrow> x \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<lambda>n. Re (s (f n))) \<longlonglongrightarrow> x

goal (1 subgoal):
 1. \<exists>f z. strict_mono f \<and> (\<forall>e>0. \<exists>N. \<forall>n\<ge>N. cmod (s (f n) - z) < e)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. Re (s (f n))) \<longlonglongrightarrow> x
[PROOF STEP]
have x: "\<forall>r>0. \<exists>n0. \<forall>n\<ge>n0. \<bar>Re (s (f n)) - x\<bar> < r"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. Re (s (f n))) \<longlonglongrightarrow> x

goal (1 subgoal):
 1. \<forall>r>0. \<exists>n0. \<forall>n\<ge>n0. \<bar>Re (s (f n)) - x\<bar> < r
[PROOF STEP]
unfolding LIMSEQ_iff real_norm_def
[PROOF STATE]
proof (prove)
using this:
\<forall>r>0. \<exists>no. \<forall>n\<ge>no. \<bar>Re (s (f n)) - x\<bar> < r

goal (1 subgoal):
 1. \<forall>r>0. \<exists>n0. \<forall>n\<ge>n0. \<bar>Re (s (f n)) - x\<bar> < r
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<forall>r>0. \<exists>n0. \<forall>n\<ge>n0. \<bar>Re (s (f n)) - x\<bar> < r

goal (1 subgoal):
 1. \<exists>f z. strict_mono f \<and> (\<forall>e>0. \<exists>N. \<forall>n\<ge>N. cmod (s (f n) - z) < e)
[PROOF STEP]
from conv2[unfolded convergent_def]
[PROOF STATE]
proof (chain)
picking this:
\<exists>L. (\<lambda>n. Im (s (f (g n)))) \<longlonglongrightarrow> L
[PROOF STEP]
obtain y where "LIMSEQ (\<lambda>n. Im (s (f (g n)))) y"
[PROOF STATE]
proof (prove)
using this:
\<exists>L. (\<lambda>n. Im (s (f (g n)))) \<longlonglongrightarrow> L

goal (1 subgoal):
 1. (\<And>y. (\<lambda>n. Im (s (f (g n)))) \<longlonglongrightarrow> y \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<lambda>n. Im (s (f (g n)))) \<longlonglongrightarrow> y

goal (1 subgoal):
 1. \<exists>f z. strict_mono f \<and> (\<forall>e>0. \<exists>N. \<forall>n\<ge>N. cmod (s (f n) - z) < e)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. Im (s (f (g n)))) \<longlonglongrightarrow> y
[PROOF STEP]
have y: "\<forall>r>0. \<exists>n0. \<forall>n\<ge>n0. \<bar>Im (s (f (g n))) - y\<bar> < r"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. Im (s (f (g n)))) \<longlonglongrightarrow> y

goal (1 subgoal):
 1. \<forall>r>0. \<exists>n0. \<forall>n\<ge>n0. \<bar>Im (s (f (g n))) - y\<bar> < r
[PROOF STEP]
unfolding LIMSEQ_iff real_norm_def
[PROOF STATE]
proof (prove)
using this:
\<forall>r>0. \<exists>no. \<forall>n\<ge>no. \<bar>Im (s (f (g n))) - y\<bar> < r

goal (1 subgoal):
 1. \<forall>r>0. \<exists>n0. \<forall>n\<ge>n0. \<bar>Im (s (f (g n))) - y\<bar> < r
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<forall>r>0. \<exists>n0. \<forall>n\<ge>n0. \<bar>Im (s (f (g n))) - y\<bar> < r

goal (1 subgoal):
 1. \<exists>f z. strict_mono f \<and> (\<forall>e>0. \<exists>N. \<forall>n\<ge>N. cmod (s (f n) - z) < e)
[PROOF STEP]
let ?w = "Complex x y"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f z. strict_mono f \<and> (\<forall>e>0. \<exists>N. \<forall>n\<ge>N. cmod (s (f n) - z) < e)
[PROOF STEP]
from f(1) g(1)
[PROOF STATE]
proof (chain)
picking this:
strict_mono f
strict_mono g
[PROOF STEP]
have hs: "strict_mono ?h"
[PROOF STATE]
proof (prove)
using this:
strict_mono f
strict_mono g

goal (1 subgoal):
 1. strict_mono (f \<circ> g)
[PROOF STEP]
unfolding strict_mono_def
[PROOF STATE]
proof (prove)
using this:
\<forall>x y. x < y \<longrightarrow> f x < f y
\<forall>x y. x < y \<longrightarrow> g x < g y

goal (1 subgoal):
 1. \<forall>x y. x < y \<longrightarrow> (f \<circ> g) x < (f \<circ> g) y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
strict_mono (f \<circ> g)

goal (1 subgoal):
 1. \<exists>f z. strict_mono f \<and> (\<forall>e>0. \<exists>N. \<forall>n\<ge>N. cmod (s (f n) - z) < e)
[PROOF STEP]
have "\<exists>N. \<forall>n\<ge>N. cmod (s (?h n) - ?w) < e" if "e > 0" for e
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. cmod (s ((f \<circ> g) n) - Complex x y) < e
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. cmod (s ((f \<circ> g) n) - Complex x y) < e
[PROOF STEP]
from that
[PROOF STATE]
proof (chain)
picking this:
0 < e
[PROOF STEP]
have e2: "e/2 > 0"
[PROOF STATE]
proof (prove)
using this:
0 < e

goal (1 subgoal):
 1. 0 < e / 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < e / 2

goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. cmod (s ((f \<circ> g) n) - Complex x y) < e
[PROOF STEP]
from x[rule_format, OF e2] y[rule_format, OF e2]
[PROOF STATE]
proof (chain)
picking this:
\<exists>n0. \<forall>n\<ge>n0. \<bar>Re (s (f n)) - x\<bar> < e / 2
\<exists>n0. \<forall>n\<ge>n0. \<bar>Im (s (f (g n))) - y\<bar> < e / 2
[PROOF STEP]
obtain N1 N2 where N1: "\<forall>n\<ge>N1. \<bar>Re (s (f n)) - x\<bar> < e / 2"
      and N2: "\<forall>n\<ge>N2. \<bar>Im (s (f (g n))) - y\<bar> < e / 2"
[PROOF STATE]
proof (prove)
using this:
\<exists>n0. \<forall>n\<ge>n0. \<bar>Re (s (f n)) - x\<bar> < e / 2
\<exists>n0. \<forall>n\<ge>n0. \<bar>Im (s (f (g n))) - y\<bar> < e / 2

goal (1 subgoal):
 1. (\<And>N1 N2. \<lbrakk>\<forall>n\<ge>N1. \<bar>Re (s (f n)) - x\<bar> < e / 2; \<forall>n\<ge>N2. \<bar>Im (s (f (g n))) - y\<bar> < e / 2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>n\<ge>N1. \<bar>Re (s (f n)) - x\<bar> < e / 2
\<forall>n\<ge>N2. \<bar>Im (s (f (g n))) - y\<bar> < e / 2

goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. cmod (s ((f \<circ> g) n) - Complex x y) < e
[PROOF STEP]
have "cmod (s (?h n) - ?w) < e" if "n \<ge> N1 + N2" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (s ((f \<circ> g) n) - Complex x y) < e
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cmod (s ((f \<circ> g) n) - Complex x y) < e
[PROOF STEP]
from that
[PROOF STATE]
proof (chain)
picking this:
N1 + N2 \<le> n
[PROOF STEP]
have nN1: "g n \<ge> N1" and nN2: "n \<ge> N2"
[PROOF STATE]
proof (prove)
using this:
N1 + N2 \<le> n

goal (1 subgoal):
 1. N1 \<le> g n &&& N2 \<le> n
[PROOF STEP]
using seq_suble[OF g(1), of n]
[PROOF STATE]
proof (prove)
using this:
N1 + N2 \<le> n
n \<le> g n

goal (1 subgoal):
 1. N1 \<le> g n &&& N2 \<le> n
[PROOF STEP]
by arith+
[PROOF STATE]
proof (state)
this:
N1 \<le> g n
N2 \<le> n

goal (1 subgoal):
 1. cmod (s ((f \<circ> g) n) - Complex x y) < e
[PROOF STEP]
from add_strict_mono[OF N1[rule_format, OF nN1] N2[rule_format, OF nN2]]
[PROOF STATE]
proof (chain)
picking this:
\<bar>Re (s (f (g n))) - x\<bar> + \<bar>Im (s (f (g n))) - y\<bar> < e / 2 + e / 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<bar>Re (s (f (g n))) - x\<bar> + \<bar>Im (s (f (g n))) - y\<bar> < e / 2 + e / 2

goal (1 subgoal):
 1. cmod (s ((f \<circ> g) n) - Complex x y) < e
[PROOF STEP]
using metric_bound_lemma[of "s (f (g n))" ?w]
[PROOF STATE]
proof (prove)
using this:
\<bar>Re (s (f (g n))) - x\<bar> + \<bar>Im (s (f (g n))) - y\<bar> < e / 2 + e / 2
cmod (s (f (g n)) - Complex x y) \<le> \<bar>Re (s (f (g n))) - Re (Complex x y)\<bar> + \<bar>Im (s (f (g n))) - Im (Complex x y)\<bar>

goal (1 subgoal):
 1. cmod (s ((f \<circ> g) n) - Complex x y) < e
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cmod (s ((f \<circ> g) n) - Complex x y) < e

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
N1 + N2 \<le> ?n \<Longrightarrow> cmod (s ((f \<circ> g) ?n) - Complex x y) < e

goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. cmod (s ((f \<circ> g) n) - Complex x y) < e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
N1 + N2 \<le> ?n \<Longrightarrow> cmod (s ((f \<circ> g) ?n) - Complex x y) < e
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
N1 + N2 \<le> ?n \<Longrightarrow> cmod (s ((f \<circ> g) ?n) - Complex x y) < e

goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. cmod (s ((f \<circ> g) n) - Complex x y) < e
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>N. \<forall>n\<ge>N. cmod (s ((f \<circ> g) n) - Complex x y) < e

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 < ?e \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. cmod (s ((f \<circ> g) n) - Complex x y) < ?e

goal (1 subgoal):
 1. \<exists>f z. strict_mono f \<and> (\<forall>e>0. \<exists>N. \<forall>n\<ge>N. cmod (s (f n) - z) < e)
[PROOF STEP]
with hs
[PROOF STATE]
proof (chain)
picking this:
strict_mono (f \<circ> g)
0 < ?e \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. cmod (s ((f \<circ> g) n) - Complex x y) < ?e
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
strict_mono (f \<circ> g)
0 < ?e \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. cmod (s ((f \<circ> g) n) - Complex x y) < ?e

goal (1 subgoal):
 1. \<exists>f z. strict_mono f \<and> (\<forall>e>0. \<exists>N. \<forall>n\<ge>N. cmod (s (f n) - z) < e)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>f z. strict_mono f \<and> (\<forall>e>0. \<exists>N. \<forall>n\<ge>N. cmod (s (f n) - z) < e)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ts_tuple_rel_mono: "ys \<subseteq> zs \<Longrightarrow> ts_tuple_rel ys \<subseteq> ts_tuple_rel zs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ys \<subseteq> zs \<Longrightarrow> ts_tuple_rel ys \<subseteq> ts_tuple_rel zs
[PROOF STEP]
by (auto simp add: ts_tuple_rel_def)


[STATEMENT]
lemma homeomorphic_map_eq:
   "\<lbrakk>homeomorphic_map X Y f; \<And>x. x \<in> topspace X \<Longrightarrow> f x = g x\<rbrakk> \<Longrightarrow> homeomorphic_map X Y g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>homeomorphic_map X Y f; \<And>x. x \<in> topspace X \<Longrightarrow> f x = g x\<rbrakk> \<Longrightarrow> homeomorphic_map X Y g
[PROOF STEP]
by (meson homeomorphic_map_def inj_on_cong quotient_map_eq)


[STATEMENT]
lemma children_deg1_fset_id[simp]: "fset (Abs_fset (children_deg1 xs)) = children_deg1 xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fset (Abs_fset (children_deg1 xs)) = children_deg1 xs
[PROOF STEP]
using Abs_fset_inverse[OF finite_children_deg1']
[PROOF STATE]
proof (prove)
using this:
fset (Abs_fset {(t, e). (t, e) \<in> fset ?xs1 \<and> max_deg t \<le> 1}) = {(t, e). (t, e) \<in> fset ?xs1 \<and> max_deg t \<le> 1}

goal (1 subgoal):
 1. fset (Abs_fset (children_deg1 xs)) = children_deg1 xs
[PROOF STEP]
by auto


[STATEMENT]
lemma maddux1a: "a\<cdot>(x \<sqinter> -(a \<rhd> y)) \<le> a\<cdot>x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<cdot> (x \<sqinter> - (a \<rhd> y)) \<le> a \<cdot> x
[PROOF STEP]
by (insert maddux1 [of "\<lambda>x. a\<cdot>x"]) simp


[STATEMENT]
lemma Sup_pres_Inf_pres:
  fixes f :: "'a::complete_boolean_algebra_alt_with_dual \<Rightarrow> 'b::complete_boolean_algebra_alt_with_dual"
  shows "(Sup_pres f) = (Inf_pres (\<partial>\<^sub>F f))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sup_pres f = Inf_pres (\<partial>\<^sub>F f)
[PROOF STEP]
by (simp add: Sup_pres_map_dual_var)


[STATEMENT]
lemma norm_blinfun_id_le:
  "norm (id_blinfun::'a::real_normed_vector \<Rightarrow>\<^sub>L 'a) \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm id_blinfun \<le> 1
[PROOF STEP]
by transfer (auto simp: onorm_id_le)


[STATEMENT]
lemma monomial_mp: "monomial c (pp::'a\<Rightarrow>\<^sub>0nat) = Const\<^sub>0 c * monomial1 pp"
  for c::"'b::comm_semiring_1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monomial c pp = Const\<^sub>0 c * monomial1 pp
[PROOF STEP]
by (auto intro!: poly_mapping_eqI simp: monomial1_def Const\<^sub>0_def mult_single)


[STATEMENT]
lemma map_cons: "map f (Cons x xs) = Cons (f x) (map f xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map f (x # xs) = f x # map f xs
[PROOF STEP]
by (rule List.list.map)


[STATEMENT]
lemma Crypt_Spy_analz_bad:
  "\<lbrakk> Crypt (pin A) X \<in> analz (knows Spy evs);  A\<in>bad \<rbrakk>
      \<Longrightarrow> X \<in> analz (knows Spy evs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Crypt (pin A) X \<in> analz (knows Spy evs); A \<in> bad\<rbrakk> \<Longrightarrow> X \<in> analz (knows Spy evs)
[PROOF STEP]
apply (force dest!: analz.Decrypt)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma ex_nat_less [code_unfold]:
  "(\<exists>m\<le>n::nat. P m) \<longleftrightarrow> (\<exists>m \<in> {0..n}. P m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>m\<le>n. P m) = (\<exists>m\<in>{0..n}. P m)
[PROOF STEP]
by auto


[STATEMENT]
lemma append_cols_carrier[simp,intro]:
  "A \<in> carrier_mat n a \<Longrightarrow> B \<in> carrier_mat n b \<Longrightarrow> (A @\<^sub>c B) \<in> carrier_mat n (a+b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<in> carrier_mat n a; B \<in> carrier_mat n b\<rbrakk> \<Longrightarrow> A @\<^sub>c B \<in> carrier_mat n (a + b)
[PROOF STEP]
unfolding append_cols_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<in> carrier_mat n a; B \<in> carrier_mat n b\<rbrakk> \<Longrightarrow> four_block_mat A B (0\<^sub>m 0 (dim_col A)) (0\<^sub>m 0 (dim_col B)) \<in> carrier_mat n (a + b)
[PROOF STEP]
by auto


[STATEMENT]
lemma moebius_rotation_plus [simp]:
  shows "(moebius_rotation \<phi>1) + (moebius_rotation \<phi>2) = moebius_rotation (\<phi>1 + \<phi>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. moebius_rotation \<phi>1 + moebius_rotation \<phi>2 = moebius_rotation (\<phi>1 + \<phi>2)
[PROOF STEP]
by simp


[STATEMENT]
lemma union_list_nodes_finite:
    assumes "list_all (finite \<circ> DCA.nodes) AA"
    shows "finite (DCA.nodes (union_list AA))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (DCA.nodes (union_list AA))
[PROOF STEP]
using union_list'_nodes_finite assms
[PROOF STATE]
proof (prove)
using this:
list_all (finite \<circ> DCA.nodes) ?AA \<Longrightarrow> finite (DGCA.nodes (union_list' ?AA))
list_all (finite \<circ> DCA.nodes) AA

goal (1 subgoal):
 1. finite (DCA.nodes (union_list AA))
[PROOF STEP]
by simp


[STATEMENT]
lemma prod_as_plus: "X \<times>\<^sub>L Y = X ;\<^sub>L fst\<^sub>L +\<^sub>L Y ;\<^sub>L snd\<^sub>L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X \<times>\<^sub>L Y = X ;\<^sub>L fst\<^sub>L +\<^sub>L Y ;\<^sub>L snd\<^sub>L
[PROOF STEP]
by (auto simp add: lens_prod_def fst_lens_def snd_lens_def lens_comp_def lens_plus_def)


[STATEMENT]
lemma limsup_finite_then_bounded:
  fixes u::"nat \<Rightarrow> real"
  assumes "limsup u < \<infinity>"
  shows "\<exists>C. \<forall>n. u n \<le> C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>C. \<forall>n. u n \<le> C
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>C. \<forall>n. u n \<le> C
[PROOF STEP]
obtain C where C: "limsup u < C" "C < \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>C. \<lbrakk>limsup (\<lambda>x. ereal (u x)) < C; C < \<infinity>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms ereal_dense2
[PROOF STATE]
proof (prove)
using this:
limsup (\<lambda>x. ereal (u x)) < \<infinity>
?x < ?y \<Longrightarrow> \<exists>z. ?x < ereal z \<and> ereal z < ?y

goal (1 subgoal):
 1. (\<And>C. \<lbrakk>limsup (\<lambda>x. ereal (u x)) < C; C < \<infinity>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
limsup (\<lambda>x. ereal (u x)) < C
C < \<infinity>

goal (1 subgoal):
 1. \<exists>C. \<forall>n. u n \<le> C
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
limsup (\<lambda>x. ereal (u x)) < C
C < \<infinity>
[PROOF STEP]
have "C = ereal(real_of_ereal C)"
[PROOF STATE]
proof (prove)
using this:
limsup (\<lambda>x. ereal (u x)) < C
C < \<infinity>

goal (1 subgoal):
 1. C = ereal (real_of_ereal C)
[PROOF STEP]
using ereal_real
[PROOF STATE]
proof (prove)
using this:
limsup (\<lambda>x. ereal (u x)) < C
C < \<infinity>
ereal (real_of_ereal ?x) = (if \<bar>?x\<bar> = \<infinity> then 0 else ?x)

goal (1 subgoal):
 1. C = ereal (real_of_ereal C)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
C = ereal (real_of_ereal C)

goal (1 subgoal):
 1. \<exists>C. \<forall>n. u n \<le> C
[PROOF STEP]
have "eventually (\<lambda>n. u n < C) sequentially"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. ereal (u n) < C
[PROOF STEP]
using C(1)
[PROOF STATE]
proof (prove)
using this:
limsup (\<lambda>x. ereal (u x)) < C

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. ereal (u n) < C
[PROOF STEP]
unfolding Limsup_def
[PROOF STATE]
proof (prove)
using this:
(INF P\<in>{P. eventually P sequentially}. SUP x\<in>Collect P. ereal (u x)) < C

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. ereal (u n) < C
[PROOF STEP]
apply (auto simp add: INF_less_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>eventually x sequentially; (SUP x\<in>Collect x. ereal (u x)) < C\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F n in sequentially. ereal (u n) < C
[PROOF STEP]
using SUP_lessD eventually_mono
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Sup (?f ` ?A) < ?y; ?i \<in> ?A\<rbrakk> \<Longrightarrow> ?f ?i < ?y
\<lbrakk>eventually ?P ?F; \<And>x. ?P x \<Longrightarrow> ?Q x\<rbrakk> \<Longrightarrow> eventually ?Q ?F

goal (1 subgoal):
 1. \<And>x. \<lbrakk>eventually x sequentially; (SUP x\<in>Collect x. ereal (u x)) < C\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F n in sequentially. ereal (u n) < C
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. ereal (u n) < C

goal (1 subgoal):
 1. \<exists>C. \<forall>n. u n \<le> C
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. ereal (u n) < C
[PROOF STEP]
obtain N where N: "\<And>n. n \<ge> N \<Longrightarrow> u n < C"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. ereal (u n) < C

goal (1 subgoal):
 1. (\<And>N. (\<And>n. N \<le> n \<Longrightarrow> ereal (u n) < C) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using eventually_sequentially
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. ereal (u n) < C
eventually ?P sequentially = (\<exists>N. \<forall>n\<ge>N. ?P n)

goal (1 subgoal):
 1. (\<And>N. (\<And>n. N \<le> n \<Longrightarrow> ereal (u n) < C) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
N \<le> ?n \<Longrightarrow> ereal (u ?n) < C

goal (1 subgoal):
 1. \<exists>C. \<forall>n. u n \<le> C
[PROOF STEP]
define D where "D = max (real_of_ereal C) (Max {u n |n. n \<le> N})"
[PROOF STATE]
proof (state)
this:
D = max (real_of_ereal C) (Max {u n |n. n \<le> N})

goal (1 subgoal):
 1. \<exists>C. \<forall>n. u n \<le> C
[PROOF STEP]
have "\<And>n. u n \<le> D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. u n \<le> D
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. u n \<le> D
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. u n \<le> D
[PROOF STEP]
show "u n \<le> D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u n \<le> D
[PROOF STEP]
proof (cases)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> u n \<le> D
 2. \<not> ?P \<Longrightarrow> u n \<le> D
[PROOF STEP]
assume *: "n \<le> N"
[PROOF STATE]
proof (state)
this:
n \<le> N

goal (2 subgoals):
 1. ?P \<Longrightarrow> u n \<le> D
 2. \<not> ?P \<Longrightarrow> u n \<le> D
[PROOF STEP]
have "u n \<le> Max {u n |n. n \<le> N}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u n \<le> Max {u n |n. n \<le> N}
[PROOF STEP]
by (rule Max_ge, auto simp add: *)
[PROOF STATE]
proof (state)
this:
u n \<le> Max {u n |n. n \<le> N}

goal (2 subgoals):
 1. ?P \<Longrightarrow> u n \<le> D
 2. \<not> ?P \<Longrightarrow> u n \<le> D
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u n \<le> Max {u n |n. n \<le> N}
[PROOF STEP]
show "u n \<le> D"
[PROOF STATE]
proof (prove)
using this:
u n \<le> Max {u n |n. n \<le> N}

goal (1 subgoal):
 1. u n \<le> D
[PROOF STEP]
unfolding D_def
[PROOF STATE]
proof (prove)
using this:
u n \<le> Max {u n |n. n \<le> N}

goal (1 subgoal):
 1. u n \<le> max (real_of_ereal C) (Max {u n |n. n \<le> N})
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
u n \<le> D

goal (1 subgoal):
 1. \<not> n \<le> N \<Longrightarrow> u n \<le> D
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> n \<le> N \<Longrightarrow> u n \<le> D
[PROOF STEP]
assume "\<not>(n \<le> N)"
[PROOF STATE]
proof (state)
this:
\<not> n \<le> N

goal (1 subgoal):
 1. \<not> n \<le> N \<Longrightarrow> u n \<le> D
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> n \<le> N
[PROOF STEP]
have "n \<ge> N"
[PROOF STATE]
proof (prove)
using this:
\<not> n \<le> N

goal (1 subgoal):
 1. N \<le> n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
N \<le> n

goal (1 subgoal):
 1. \<not> n \<le> N \<Longrightarrow> u n \<le> D
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
N \<le> n
[PROOF STEP]
have "u n < C"
[PROOF STATE]
proof (prove)
using this:
N \<le> n

goal (1 subgoal):
 1. ereal (u n) < C
[PROOF STEP]
using N
[PROOF STATE]
proof (prove)
using this:
N \<le> n
N \<le> ?n \<Longrightarrow> ereal (u ?n) < C

goal (1 subgoal):
 1. ereal (u n) < C
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ereal (u n) < C

goal (1 subgoal):
 1. \<not> n \<le> N \<Longrightarrow> u n \<le> D
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ereal (u n) < C
[PROOF STEP]
have "u n < real_of_ereal C"
[PROOF STATE]
proof (prove)
using this:
ereal (u n) < C

goal (1 subgoal):
 1. u n < real_of_ereal C
[PROOF STEP]
using \<open>C = ereal(real_of_ereal C)\<close> less_ereal.simps(1)
[PROOF STATE]
proof (prove)
using this:
ereal (u n) < C
C = ereal (real_of_ereal C)
(ereal ?x < ereal ?y) = (?x < ?y)

goal (1 subgoal):
 1. u n < real_of_ereal C
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
u n < real_of_ereal C

goal (1 subgoal):
 1. \<not> n \<le> N \<Longrightarrow> u n \<le> D
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u n < real_of_ereal C
[PROOF STEP]
show "u n \<le> D"
[PROOF STATE]
proof (prove)
using this:
u n < real_of_ereal C

goal (1 subgoal):
 1. u n \<le> D
[PROOF STEP]
unfolding D_def
[PROOF STATE]
proof (prove)
using this:
u n < real_of_ereal C

goal (1 subgoal):
 1. u n \<le> max (real_of_ereal C) (Max {u n |n. n \<le> N})
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
u n \<le> D

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
u n \<le> D

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
u ?n \<le> D

goal (1 subgoal):
 1. \<exists>C. \<forall>n. u n \<le> C
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u ?n \<le> D
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
u ?n \<le> D

goal (1 subgoal):
 1. \<exists>C. \<forall>n. u n \<le> C
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>C. \<forall>n. u n \<le> C

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma P5_a: "x l\<rightarrow> y = 1 \<Longrightarrow> y l\<rightarrow> z = 1 \<Longrightarrow> x l\<rightarrow> z = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x l\<rightarrow> y = (1::'a); y l\<rightarrow> z = (1::'a)\<rbrakk> \<Longrightarrow> x l\<rightarrow> z = (1::'a)
[PROOF STEP]
apply (cut_tac a = x and b = y and c = z in W3a)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x l\<rightarrow> y = (1::'a); y l\<rightarrow> z = (1::'a); (x l\<rightarrow> y) l\<rightarrow> (y l\<rightarrow> z) r\<rightarrow> x l\<rightarrow> z = (1::'a)\<rbrakk> \<Longrightarrow> x l\<rightarrow> z = (1::'a)
[PROOF STEP]
by simp


[STATEMENT]
lemma fmap_of_nsAppend[simp]: "fmap_of_ns (nsAppend ns1 ns2) = fmap_of_ns ns2 ++\<^sub>f fmap_of_ns ns1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmap_of_ns (nsAppend ns1 ns2) = fmap_of_ns ns2 ++\<^sub>f fmap_of_ns ns1
[PROOF STEP]
by (cases ns1; cases ns2) simp


[STATEMENT]
lemma dg_prod_2_ObjI'[dg_prod_cs_intros]:
  assumes "ab = [a, b]\<^sub>\<circ>" and "a \<in>\<^sub>\<circ> \<AA>\<lparr>Obj\<rparr>" and "b \<in>\<^sub>\<circ> \<BB>\<lparr>Obj\<rparr>"
  shows "ab \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Obj\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ab \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Obj\<rparr>
[PROOF STEP]
using assms(2,3)
[PROOF STATE]
proof (prove)
using this:
a \<in>\<^sub>\<circ> \<AA>\<lparr>Obj\<rparr>
b \<in>\<^sub>\<circ> \<BB>\<lparr>Obj\<rparr>

goal (1 subgoal):
 1. ab \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Obj\<rparr>
[PROOF STEP]
unfolding assms(1)
[PROOF STATE]
proof (prove)
using this:
a \<in>\<^sub>\<circ> \<AA>\<lparr>Obj\<rparr>
b \<in>\<^sub>\<circ> \<BB>\<lparr>Obj\<rparr>

goal (1 subgoal):
 1. [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G \<BB>)\<lparr>Obj\<rparr>
[PROOF STEP]
by (rule dg_prod_2_ObjI)


[STATEMENT]
lemma takeWhile_take_has_property_nth:
  "\<lbrakk> n < length (takeWhile P xs) \<rbrakk> \<Longrightarrow> P (xs ! n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < length (takeWhile P xs) \<Longrightarrow> P (xs ! n)
[PROOF STEP]
by (induct xs arbitrary: n; simp split: if_split_asm) (case_tac n, simp_all)


[STATEMENT]
lemma darcs_snds_count_ge2:
  "\<lbrakk>(t1,e1) \<in> fset xs; (t2,e2) \<in> fset xs; (t1,e1) \<noteq> (t2,e2); e1 = e2\<rbrakk>
    \<Longrightarrow> count (darcs_mset (Node r xs)) e2 \<ge> 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(t1, e1) \<in> fset xs; (t2, e2) \<in> fset xs; (t1, e1) \<noteq> (t2, e2); e1 = e2\<rbrakk> \<Longrightarrow> 2 \<le> count (darcs_mset (Node r xs)) e2
[PROOF STEP]
using darcs_snds_count_ge2_aux
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(?t1.0, ?e1.0) \<in> fset ?xs; (?t2.0, ?e2.0) \<in> fset ?xs; (?t1.0, ?e1.0) \<noteq> (?t2.0, ?e2.0); ?e1.0 = ?e2.0\<rbrakk> \<Longrightarrow> 2 \<le> count (\<Sum>(t, e)\<in>fset ?xs. {#e#}) ?e2.0

goal (1 subgoal):
 1. \<lbrakk>(t1, e1) \<in> fset xs; (t2, e2) \<in> fset xs; (t1, e1) \<noteq> (t2, e2); e1 = e2\<rbrakk> \<Longrightarrow> 2 \<le> count (darcs_mset (Node r xs)) e2
[PROOF STEP]
unfolding darcs_mset_alt
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(?t1.0, ?e1.0) \<in> fset ?xs; (?t2.0, ?e2.0) \<in> fset ?xs; (?t1.0, ?e1.0) \<noteq> (?t2.0, ?e2.0); ?e1.0 = ?e2.0\<rbrakk> \<Longrightarrow> 2 \<le> count (\<Sum>(t, e)\<in>fset ?xs. {#e#}) ?e2.0

goal (1 subgoal):
 1. \<lbrakk>(t1, e1) \<in> fset xs; (t2, e2) \<in> fset xs; (t1, e1) \<noteq> (t2, e2); e1 = e2\<rbrakk> \<Longrightarrow> 2 \<le> count ((\<Sum>(t, e)\<in>fset xs. {#e#}) + (\<Sum>(t, e)\<in>fset xs. darcs_mset t)) e2
[PROOF STEP]
by fastforce


[STATEMENT]
lemma (in domain) ring_primeE:
  assumes "p \<in> carrier R" "ring_prime p"
  shows "p \<noteq> \<zero>" "prime (mult_of R) p" "prime R p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<noteq> \<zero> &&& prime (Ring_Divisibility.mult_of R) p &&& prime R p
[PROOF STEP]
using assms prime_eq_prime_mult
[PROOF STATE]
proof (prove)
using this:
p \<in> carrier R
ring_prime p
?p \<in> carrier R \<Longrightarrow> prime R ?p = prime (Ring_Divisibility.mult_of R) ?p

goal (1 subgoal):
 1. p \<noteq> \<zero> &&& prime (Ring_Divisibility.mult_of R) p &&& prime R p
[PROOF STEP]
unfolding ring_prime_def
[PROOF STATE]
proof (prove)
using this:
p \<in> carrier R
p \<noteq> \<zero> \<and> prime R p
?p \<in> carrier R \<Longrightarrow> prime R ?p = prime (Ring_Divisibility.mult_of R) ?p

goal (1 subgoal):
 1. p \<noteq> \<zero> &&& prime (Ring_Divisibility.mult_of R) p &&& prime R p
[PROOF STEP]
by auto


[STATEMENT]
lemma splitting_eq: "d \<in> D\<^sub>D \<Longrightarrow> Q d - R d = (id_blinfun - l *\<^sub>R \<P>\<^sub>1 (mk_dec_det d))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d \<in> D\<^sub>D \<Longrightarrow> Q d - R d = id_blinfun - l *\<^sub>R \<P>\<^sub>1 (mk_dec_det d)
[PROOF STEP]
using is_splitting
[PROOF STATE]
proof (prove)
using this:
?d \<in> D\<^sub>D \<Longrightarrow> is_splitting_blin (id_blinfun - l *\<^sub>R \<P>\<^sub>1 (mk_dec_det ?d)) (Q ?d) (R ?d)

goal (1 subgoal):
 1. d \<in> D\<^sub>D \<Longrightarrow> Q d - R d = id_blinfun - l *\<^sub>R \<P>\<^sub>1 (mk_dec_det d)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma extend_inv: "bij h
      ==> extend (%(x,u::'c). inv h x) = project (%(x,u::'c). h x) UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij h \<Longrightarrow> extend (\<lambda>(x, u). inv h x) = project (\<lambda>(x, u). h x) UNIV
[PROOF STEP]
apply (frule bij_imp_bij_inv)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>bij h; bij (inv h)\<rbrakk> \<Longrightarrow> extend (\<lambda>(x, u). inv h x) = project (\<lambda>(x, u). h x) UNIV
[PROOF STEP]
apply (rule ext)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>bij h; bij (inv h)\<rbrakk> \<Longrightarrow> extend (\<lambda>(x, u). inv h x) x = project (\<lambda>(x, u). h x) UNIV x
[PROOF STEP]
apply (rule program_equalityI)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x. \<lbrakk>bij h; bij (inv h)\<rbrakk> \<Longrightarrow> Init (extend (\<lambda>(x, u). inv h x) x) = Init (project (\<lambda>(x, u). h x) UNIV x)
 2. \<And>x. \<lbrakk>bij h; bij (inv h)\<rbrakk> \<Longrightarrow> Acts (extend (\<lambda>(x, u). inv h x) x) = Acts (project (\<lambda>(x, u). h x) UNIV x)
 3. \<And>x. \<lbrakk>bij h; bij (inv h)\<rbrakk> \<Longrightarrow> AllowedActs (extend (\<lambda>(x, u). inv h x) x) = AllowedActs (project (\<lambda>(x, u). h x) UNIV x)
[PROOF STEP]
apply (simp (no_asm_simp) add: extend_set_inv)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>bij h; bij (inv h)\<rbrakk> \<Longrightarrow> Acts (extend (\<lambda>(x, u). inv h x) x) = Acts (project (\<lambda>(x, u). h x) UNIV x)
 2. \<And>x. \<lbrakk>bij h; bij (inv h)\<rbrakk> \<Longrightarrow> AllowedActs (extend (\<lambda>(x, u). inv h x) x) = AllowedActs (project (\<lambda>(x, u). h x) UNIV x)
[PROOF STEP]
apply (simp add: Extend.project_act_Id Extend.Acts_extend
          insert_Id_image_Acts bij_extend_act_eq_project_act inv_inv_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>bij h; bij (inv h)\<rbrakk> \<Longrightarrow> AllowedActs (extend (\<lambda>(x, u). inv h x) x) = AllowedActs (project (\<lambda>(x, u). h x) UNIV x)
[PROOF STEP]
apply (simp add: Extend.AllowedActs_extend Extend.AllowedActs_project
             bij_project_act bij_vimage_eq_inv_image bij_inv_project_act_eq)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma stepC_dec:
  "n \<noteq> C [] \<Longrightarrow> Suc (evalC (Suc (Suc c)) (stepC c n)) = evalC (Suc (Suc c)) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<noteq> C [] \<Longrightarrow> Suc (evalC (Suc (Suc c)) (stepC c n)) = evalC (Suc (Suc c)) n
[PROOF STEP]
by (induct c n rule: stepC.induct) simp_all


[STATEMENT]
lemma remdups_wrt_append:
  "remdups_wrt f (xs @ ys) = (filter (\<lambda>a. f a \<notin> f ` set ys) (remdups_wrt f xs)) @ (remdups_wrt f ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. remdups_wrt f (xs @ ys) = filter (\<lambda>a. f a \<notin> f ` set ys) (remdups_wrt f xs) @ remdups_wrt f ys
[PROOF STEP]
by (induct xs, auto)


[STATEMENT]
lemma ideal_mult_right_in2:
  \<open>a \<in> ideal A \<Longrightarrow> b * a \<in> More_Modules.ideal A\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> More_Modules.ideal A \<Longrightarrow> b * a \<in> More_Modules.ideal A
[PROOF STEP]
by (metis ideal.span_scale)


[STATEMENT]
lemma subset_mset_zmsetE:
  assumes "M \<subset>#\<^sub>z N"
  obtains A B C where
    "M = zmset_of A + C" and "N = zmset_of B + C" and "A \<subset># B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>A C B. \<lbrakk>M = zmset_of A + C; N = zmset_of B + C; A \<subset># B\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis assms decompose_zmset_of2 subset_zmset.add_less_cancel_right zmset_of_subset_iff)


[STATEMENT]
lemma bijective_mult_closed:
  "bijective x \<Longrightarrow> bijective y \<Longrightarrow> bijective (x * y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>bijective x; bijective y\<rbrakk> \<Longrightarrow> bijective (x * y)
[PROOF STEP]
by (metis injective_mult_closed comp_associative)


[STATEMENT]
lemma degree_eq_degreen0: "degree p = degreen p 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Reflected_Multivariate_Polynomial.degree p = degreen p 0
[PROOF STEP]
by (induct p rule: degree.induct) simp_all


[STATEMENT]
lemma eval_wp_SetDC:
  "wp (SetDC p S) R s = Inf ((\<lambda>a. wp (p a) R s) ` S s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wp (SetDC p S) R s = (INF a\<in>S s. wp (p a) R s)
[PROOF STEP]
unfolding wp_def SetDC_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (INF a\<in>S s. p a True R s) = (INF a\<in>S s. p a True R s)
[PROOF STEP]
by(simp)


[STATEMENT]
lemma quat_trad: "Quat x y z w = of_real x + \<i> * of_real y + \<j> * of_real z + \<k> * of_real w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Quat x y z w = quat_of_real x + \<i> * quat_of_real y + \<j> * quat_of_real z + \<k> * quat_of_real w
[PROOF STEP]
by (simp add: quat_eq_iff)


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


[STATEMENT]
lemma bin_to_bl_aux_bintr:
  "bin_to_bl_aux n (take_bit m bin) bl =
    replicate (n - m) False @ bin_to_bl_aux (min n m) bin bl"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bin_to_bl_aux n (take_bit m bin) bl = replicate (n - m) False @ bin_to_bl_aux (min n m) bin bl
[PROOF STEP]
apply (induct n arbitrary: m bin bl)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>m bin bl. bin_to_bl_aux 0 (take_bit m bin) bl = replicate (0 - m) False @ bin_to_bl_aux (min 0 m) bin bl
 2. \<And>n m bin bl. (\<And>m bin bl. bin_to_bl_aux n (take_bit m bin) bl = replicate (n - m) False @ bin_to_bl_aux (min n m) bin bl) \<Longrightarrow> bin_to_bl_aux (Suc n) (take_bit m bin) bl = replicate (Suc n - m) False @ bin_to_bl_aux (min (Suc n) m) bin bl
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n m bin bl. (\<And>m bin bl. bin_to_bl_aux n (take_bit m bin) bl = replicate (n - m) False @ bin_to_bl_aux (min n m) bin bl) \<Longrightarrow> bin_to_bl_aux (Suc n) (take_bit m bin) bl = replicate (Suc n - m) False @ bin_to_bl_aux (min (Suc n) m) bin bl
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n m bin bl. (\<And>m bin bl. bin_to_bl_aux n (take_bit m bin) bl = replicate (n - m) False @ bin_to_bl_aux (min n m) bin bl) \<Longrightarrow> bin_to_bl_aux n (take_bit m bin div 2) ((0 < m \<and> odd bin) # bl) = replicate (Suc n - m) False @ bin_to_bl_aux (min (Suc n) m) bin bl
[PROOF STEP]
apply (case_tac "m")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n m bin bl. \<lbrakk>\<And>m bin bl. bin_to_bl_aux n (take_bit m bin) bl = replicate (n - m) False @ bin_to_bl_aux (min n m) bin bl; m = 0\<rbrakk> \<Longrightarrow> bin_to_bl_aux n (take_bit m bin div 2) ((0 < m \<and> odd bin) # bl) = replicate (Suc n - m) False @ bin_to_bl_aux (min (Suc n) m) bin bl
 2. \<And>n m bin bl nat. \<lbrakk>\<And>m bin bl. bin_to_bl_aux n (take_bit m bin) bl = replicate (n - m) False @ bin_to_bl_aux (min n m) bin bl; m = Suc nat\<rbrakk> \<Longrightarrow> bin_to_bl_aux n (take_bit m bin div 2) ((0 < m \<and> odd bin) # bl) = replicate (Suc n - m) False @ bin_to_bl_aux (min (Suc n) m) bin bl
[PROOF STEP]
apply (clarsimp simp: bin_to_bl_zero_aux)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n. (\<And>m bin bl. bin_to_bl_aux n (take_bit m bin) bl = replicate (n - m) False @ bin_to_bl_aux (min n m) bin bl) \<Longrightarrow> replicate n False @ [False] = False # replicate n False
 2. \<And>n m bin bl nat. \<lbrakk>\<And>m bin bl. bin_to_bl_aux n (take_bit m bin) bl = replicate (n - m) False @ bin_to_bl_aux (min n m) bin bl; m = Suc nat\<rbrakk> \<Longrightarrow> bin_to_bl_aux n (take_bit m bin div 2) ((0 < m \<and> odd bin) # bl) = replicate (Suc n - m) False @ bin_to_bl_aux (min (Suc n) m) bin bl
[PROOF STEP]
apply (erule thin_rl)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n. replicate n False @ [False] = False # replicate n False
 2. \<And>n m bin bl nat. \<lbrakk>\<And>m bin bl. bin_to_bl_aux n (take_bit m bin) bl = replicate (n - m) False @ bin_to_bl_aux (min n m) bin bl; m = Suc nat\<rbrakk> \<Longrightarrow> bin_to_bl_aux n (take_bit m bin div 2) ((0 < m \<and> odd bin) # bl) = replicate (Suc n - m) False @ bin_to_bl_aux (min (Suc n) m) bin bl
[PROOF STEP]
apply (induct_tac n)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>n. replicate 0 False @ [False] = False # replicate 0 False
 2. \<And>n na. replicate na False @ [False] = False # replicate na False \<Longrightarrow> replicate (Suc na) False @ [False] = False # replicate (Suc na) False
 3. \<And>n m bin bl nat. \<lbrakk>\<And>m bin bl. bin_to_bl_aux n (take_bit m bin) bl = replicate (n - m) False @ bin_to_bl_aux (min n m) bin bl; m = Suc nat\<rbrakk> \<Longrightarrow> bin_to_bl_aux n (take_bit m bin div 2) ((0 < m \<and> odd bin) # bl) = replicate (Suc n - m) False @ bin_to_bl_aux (min (Suc n) m) bin bl
[PROOF STEP]
apply (auto simp add: take_bit_Suc)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma szip_smap2: "szip xs (smap g ys) = smap (apsnd g) (szip xs ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. szip xs (smap g ys) = smap (apsnd g) (szip xs ys)
[PROOF STEP]
by(coinduction arbitrary: xs ys) auto


[STATEMENT]
lemma closest_point_refl: "closed S \<Longrightarrow> S \<noteq> {} \<Longrightarrow> closest_point S x = x \<longleftrightarrow> x \<in> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>closed S; S \<noteq> {}\<rbrakk> \<Longrightarrow> (closest_point S x = x) = (x \<in> S)
[PROOF STEP]
using closest_point_in_set[of S x] closest_point_self[of x S]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>closed S; S \<noteq> {}\<rbrakk> \<Longrightarrow> closest_point S x \<in> S
x \<in> S \<Longrightarrow> closest_point S x = x

goal (1 subgoal):
 1. \<lbrakk>closed S; S \<noteq> {}\<rbrakk> \<Longrightarrow> (closest_point S x = x) = (x \<in> S)
[PROOF STEP]
by auto


[STATEMENT]
lemma is_Eq_iff: "(\<forall>i j. a \<noteq> Less i j) = (\<exists>i j. a = Eq i j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>i j. a \<noteq> Less i j) = (\<exists>i j. a = Eq i j)
[PROOF STEP]
by(cases a) auto


[STATEMENT]
lemma Always_tokens_giv_le_allocGiv: "System \<in> Always (INT i: lessThan Nclients.
                          {s. (tokens o giv o sub i o client) s
                           \<le> (tokens o sub i o allocGiv) s})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. System \<in> Always (\<Inter>i<Nclients. {s. (sum_list \<circ> giv \<circ> sub i \<circ> client) s \<le> (sum_list \<circ> sub i \<circ> allocGiv) s})
[PROOF STEP]
apply (rule Always_giv_le_allocGiv [THEN Always_weaken])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Inter>i<Nclients. {s. (giv \<circ> sub i \<circ> client) s \<le> (sub i \<circ> allocGiv) s}) \<subseteq> (\<Inter>i<Nclients. {s. (sum_list \<circ> giv \<circ> sub i \<circ> client) s \<le> (sum_list \<circ> sub i \<circ> allocGiv) s})
[PROOF STEP]
apply (auto intro: tokens_mono_prefix simp add: o_apply)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma mult_vec_distrib_right: "(p + q) ** r = p ** r + q ** r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (p + q) ** r = p ** r + q ** r
[PROOF STEP]
by (rule poly_mapping_eqI_proj, simp add: algebra_simps proj_plus term_simps)


[STATEMENT]
lemma ordinal_oLogI2:
"\<lbrakk>oSuc 0 < b; x = b ** y * q + r; 0 < q; q < b; r < b ** y\<rbrakk> \<Longrightarrow> oLog b x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>oSuc 0 < b; x = b ** y * q + r; 0 < q; q < b; r < b ** y\<rbrakk> \<Longrightarrow> oLog b x = y
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>oSuc 0 < b; x = b ** y * q + r; 0 < q; q < b; r < b ** y\<rbrakk> \<Longrightarrow> oLog b (b ** y * q + r) = y
[PROOF STEP]
apply (rule ordinal_oLogI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>oSuc 0 < b; x = b ** y * q + r; 0 < q; q < b; r < b ** y\<rbrakk> \<Longrightarrow> b ** y \<le> b ** y * q + r
 2. \<lbrakk>oSuc 0 < b; x = b ** y * q + r; 0 < q; q < b; r < b ** y\<rbrakk> \<Longrightarrow> b ** y * q + r < b ** y * b
[PROOF STEP]
apply (rule_tac y="b ** y * q" in order_trans, simp, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>oSuc 0 < b; x = b ** y * q + r; 0 < q; q < b; r < b ** y\<rbrakk> \<Longrightarrow> b ** y * q + r < b ** y * b
[PROOF STEP]
apply (rule order_less_le_trans)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>oSuc 0 < b; x = b ** y * q + r; 0 < q; q < b; r < b ** y\<rbrakk> \<Longrightarrow> b ** y * q + r < ?y5
 2. \<lbrakk>oSuc 0 < b; x = b ** y * q + r; 0 < q; q < b; r < b ** y\<rbrakk> \<Longrightarrow> ?y5 \<le> b ** y * b
[PROOF STEP]
apply (erule ordinal_plus_strict_monoR)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>oSuc 0 < b; x = b ** y * q + r; 0 < q; q < b; r < b ** y\<rbrakk> \<Longrightarrow> b ** y * q + b ** y \<le> b ** y * b
[PROOF STEP]
apply (subst ordinal_times_oSuc[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>oSuc 0 < b; x = b ** y * q + r; 0 < q; q < b; r < b ** y\<rbrakk> \<Longrightarrow> b ** y * oSuc q \<le> b ** y * b
[PROOF STEP]
apply (rule ordinal_times_monoR)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>oSuc 0 < b; x = b ** y * q + r; 0 < q; q < b; r < b ** y\<rbrakk> \<Longrightarrow> oSuc q \<le> b
[PROOF STEP]
apply (erule oSuc_leI)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma swap_UNIV: "{a,1-a} = binUNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {a, 1 - a} = binUNIV
[PROOF STEP]
unfolding bin_UNIV_iff[of "{a,1-a}" a]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> {a, 1 - a} \<and> 1 - a \<in> {a, 1 - a}
[PROOF STEP]
by fast


[STATEMENT]
lemma strict_mono_setsD:
  assumes "strict_mono_sets A f" "x < y" "x \<in> A" "y \<in> A"
  shows "less_sets (f x) (f y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f x \<lless> f y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
strict_mono_sets A f
x < y
x \<in> A
y \<in> A

goal (1 subgoal):
 1. f x \<lless> f y
[PROOF STEP]
by (auto simp: strict_mono_sets_def)


[STATEMENT]
lemma iT_Div_mem_iff_0: "x \<in> (I \<oslash> 0) = (I \<noteq> {} \<and> x = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> I \<oslash> 0) = (I \<noteq> {} \<and> x = 0)
[PROOF STEP]
by (force simp: iT_Div_0_if)


[STATEMENT]
lemma ntcf_const_is_ntcf'[cat_cs_intros]:
  assumes "category \<alpha> \<JJ>"
    and "category \<alpha> \<CC>"
    and "f : a \<mapsto>\<^bsub>\<CC>\<^esub> b"
    and "\<AA> = cf_const \<JJ> \<CC> a"
    and "\<BB> = cf_const \<JJ> \<CC> b"
    and "\<JJ>' = \<JJ>"
    and "\<CC>' = \<CC>"
  shows "ntcf_const \<JJ> \<CC> f : \<AA> \<mapsto>\<^sub>C\<^sub>F \<BB> : \<JJ>' \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ntcf_const \<JJ> \<CC> f : \<AA> \<mapsto>\<^sub>C\<^sub>F \<BB> : \<JJ>' \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>'
[PROOF STEP]
using assms(1-3)
[PROOF STATE]
proof (prove)
using this:
category \<alpha> \<JJ>
category \<alpha> \<CC>
f : a \<mapsto>\<^bsub>\<CC>\<^esub> b

goal (1 subgoal):
 1. ntcf_const \<JJ> \<CC> f : \<AA> \<mapsto>\<^sub>C\<^sub>F \<BB> : \<JJ>' \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>'
[PROOF STEP]
unfolding assms(4-7)
[PROOF STATE]
proof (prove)
using this:
category \<alpha> \<JJ>
category \<alpha> \<CC>
f : a \<mapsto>\<^bsub>\<CC>\<^esub> b

goal (1 subgoal):
 1. ntcf_const \<JJ> \<CC> f : dghm_const \<JJ> \<CC> a (\<CC>\<lparr>CId\<rparr>\<lparr>a\<rparr>) \<mapsto>\<^sub>C\<^sub>F dghm_const \<JJ> \<CC> b (\<CC>\<lparr>CId\<rparr>\<lparr>b\<rparr>) : \<JJ> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>
[PROOF STEP]
by (rule ntcf_const_is_ntcf)


[STATEMENT]
lemma iEx_cong: "\<box> t I. f t = g t \<Longrightarrow> (\<diamond> t I. P (f t) t) = (\<diamond> t I. P (g t) t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<box> t I. f t = g t \<Longrightarrow> (\<diamond> t I. P (f t) t) = (\<diamond> t I. P (g t) t)
[PROOF STEP]
unfolding iTL_defs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>t\<in>I. f t = g t \<Longrightarrow> (\<exists>t\<in>I. P (f t) t) = (\<exists>t\<in>I. P (g t) t)
[PROOF STEP]
by simp


[STATEMENT]
lemma ln2_ge_two_thirds: "2/3 \<le> ln (2::real)"
  and ln2_le_25_over_36: "ln (2::real) \<le> 25/36"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 / 3 \<le> ln 2 &&& ln 2 \<le> 25 / 36
[PROOF STEP]
using ln_approx_bounds[of 2 1, simplified, simplified eval_nat_numeral, simplified]
[PROOF STATE]
proof (prove)
using this:
2 \<le> ln 2 * 3 \<and> ln 2 * 36 \<le> 25

goal (1 subgoal):
 1. 2 / 3 \<le> ln 2 &&& ln 2 \<le> 25 / 36
[PROOF STEP]
by simp_all


[STATEMENT]
lemma nat_add_less_by_max:
  "\<lbrakk> (x::nat) \<le> xmax ; y < k - xmax \<rbrakk> \<Longrightarrow> x + y < k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<le> xmax; y < k - xmax\<rbrakk> \<Longrightarrow> x + y < k
[PROOF STEP]
by simp


[STATEMENT]
lemma poly_card_roots_less_less:
  "card {x. a < x \<and> x < b \<and> poly p x = 0} =
      ( count_roots_between p a b -
              (if poly p b = 0 \<and> a < b \<and> p \<noteq> 0 then 1 else 0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {x. a < x \<and> x < b \<and> poly p x = 0} = count_roots_between p a b - (if poly p b = 0 \<and> a < b \<and> p \<noteq> 0 then 1 else 0)
[PROOF STEP]
proof (cases "poly p b = 0 \<and> a < b \<and> p \<noteq> 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. poly p b = 0 \<and> a < b \<and> p \<noteq> 0 \<Longrightarrow> card {x. a < x \<and> x < b \<and> poly p x = 0} = count_roots_between p a b - (if poly p b = 0 \<and> a < b \<and> p \<noteq> 0 then 1 else 0)
 2. \<not> (poly p b = 0 \<and> a < b \<and> p \<noteq> 0) \<Longrightarrow> card {x. a < x \<and> x < b \<and> poly p x = 0} = count_roots_between p a b - (if poly p b = 0 \<and> a < b \<and> p \<noteq> 0 then 1 else 0)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (poly p b = 0 \<and> a < b \<and> p \<noteq> 0)

goal (2 subgoals):
 1. poly p b = 0 \<and> a < b \<and> p \<noteq> 0 \<Longrightarrow> card {x. a < x \<and> x < b \<and> poly p x = 0} = count_roots_between p a b - (if poly p b = 0 \<and> a < b \<and> p \<noteq> 0 then 1 else 0)
 2. \<not> (poly p b = 0 \<and> a < b \<and> p \<noteq> 0) \<Longrightarrow> card {x. a < x \<and> x < b \<and> poly p x = 0} = count_roots_between p a b - (if poly p b = 0 \<and> a < b \<and> p \<noteq> 0 then 1 else 0)
[PROOF STEP]
note False' = this
[PROOF STATE]
proof (state)
this:
\<not> (poly p b = 0 \<and> a < b \<and> p \<noteq> 0)

goal (2 subgoals):
 1. poly p b = 0 \<and> a < b \<and> p \<noteq> 0 \<Longrightarrow> card {x. a < x \<and> x < b \<and> poly p x = 0} = count_roots_between p a b - (if poly p b = 0 \<and> a < b \<and> p \<noteq> 0 then 1 else 0)
 2. \<not> (poly p b = 0 \<and> a < b \<and> p \<noteq> 0) \<Longrightarrow> card {x. a < x \<and> x < b \<and> poly p x = 0} = count_roots_between p a b - (if poly p b = 0 \<and> a < b \<and> p \<noteq> 0 then 1 else 0)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {x. a < x \<and> x < b \<and> poly p x = 0} = count_roots_between p a b - (if poly p b = 0 \<and> a < b \<and> p \<noteq> 0 then 1 else 0)
[PROOF STEP]
proof (cases "p = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. p = 0 \<Longrightarrow> card {x. a < x \<and> x < b \<and> poly p x = 0} = count_roots_between p a b - (if poly p b = 0 \<and> a < b \<and> p \<noteq> 0 then 1 else 0)
 2. p \<noteq> 0 \<Longrightarrow> card {x. a < x \<and> x < b \<and> poly p x = 0} = count_roots_between p a b - (if poly p b = 0 \<and> a < b \<and> p \<noteq> 0 then 1 else 0)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
p = 0

goal (2 subgoals):
 1. p = 0 \<Longrightarrow> card {x. a < x \<and> x < b \<and> poly p x = 0} = count_roots_between p a b - (if poly p b = 0 \<and> a < b \<and> p \<noteq> 0 then 1 else 0)
 2. p \<noteq> 0 \<Longrightarrow> card {x. a < x \<and> x < b \<and> poly p x = 0} = count_roots_between p a b - (if poly p b = 0 \<and> a < b \<and> p \<noteq> 0 then 1 else 0)
[PROOF STEP]
have [simp]: "{x. a < x \<and> x < b} = {a<..<b}"
                     "{x. a < x \<and> x \<le> b} = {a<..b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. a < x \<and> x < b} = {a<..<b} &&& {x. a < x \<and> x \<le> b} = {a<..b}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{x. a < x \<and> x < b} = {a<..<b}
{x. a < x \<and> x \<le> b} = {a<..b}

goal (2 subgoals):
 1. p = 0 \<Longrightarrow> card {x. a < x \<and> x < b \<and> poly p x = 0} = count_roots_between p a b - (if poly p b = 0 \<and> a < b \<and> p \<noteq> 0 then 1 else 0)
 2. p \<noteq> 0 \<Longrightarrow> card {x. a < x \<and> x < b \<and> poly p x = 0} = count_roots_between p a b - (if poly p b = 0 \<and> a < b \<and> p \<noteq> 0 then 1 else 0)
[PROOF STEP]
with True False
[PROOF STATE]
proof (chain)
picking this:
p = 0
\<not> (poly p b = 0 \<and> a < b \<and> p \<noteq> 0)
{x. a < x \<and> x < b} = {a<..<b}
{x. a < x \<and> x \<le> b} = {a<..b}
[PROOF STEP]
have "card {x. a < x \<and> x \<le> b} = 0" "card {x. a < x \<and> x < b} = 0"
[PROOF STATE]
proof (prove)
using this:
p = 0
\<not> (poly p b = 0 \<and> a < b \<and> p \<noteq> 0)
{x. a < x \<and> x < b} = {a<..<b}
{x. a < x \<and> x \<le> b} = {a<..b}

goal (1 subgoal):
 1. card {x. a < x \<and> x \<le> b} = 0 &&& card {x. a < x \<and> x < b} = 0
[PROOF STEP]
by (auto simp add: card_eq_0_iff infinite_Ioo infinite_Ioc)
[PROOF STATE]
proof (state)
this:
card {x. a < x \<and> x \<le> b} = 0
card {x. a < x \<and> x < b} = 0

goal (2 subgoals):
 1. p = 0 \<Longrightarrow> card {x. a < x \<and> x < b \<and> poly p x = 0} = count_roots_between p a b - (if poly p b = 0 \<and> a < b \<and> p \<noteq> 0 then 1 else 0)
 2. p \<noteq> 0 \<Longrightarrow> card {x. a < x \<and> x < b \<and> poly p x = 0} = count_roots_between p a b - (if poly p b = 0 \<and> a < b \<and> p \<noteq> 0 then 1 else 0)
[PROOF STEP]
with True False'
[PROOF STATE]
proof (chain)
picking this:
p = 0
\<not> (poly p b = 0 \<and> a < b \<and> p \<noteq> 0)
card {x. a < x \<and> x \<le> b} = 0
card {x. a < x \<and> x < b} = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
p = 0
\<not> (poly p b = 0 \<and> a < b \<and> p \<noteq> 0)
card {x. a < x \<and> x \<le> b} = 0
card {x. a < x \<and> x < b} = 0

goal (1 subgoal):
 1. card {x. a < x \<and> x < b \<and> poly p x = 0} = count_roots_between p a b - (if poly p b = 0 \<and> a < b \<and> p \<noteq> 0 then 1 else 0)
[PROOF STEP]
by (auto simp: count_roots_between_correct)
[PROOF STATE]
proof (state)
this:
card {x. a < x \<and> x < b \<and> poly p x = 0} = count_roots_between p a b - (if poly p b = 0 \<and> a < b \<and> p \<noteq> 0 then 1 else 0)

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> card {x. a < x \<and> x < b \<and> poly p x = 0} = count_roots_between p a b - (if poly p b = 0 \<and> a < b \<and> p \<noteq> 0 then 1 else 0)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> card {x. a < x \<and> x < b \<and> poly p x = 0} = count_roots_between p a b - (if poly p b = 0 \<and> a < b \<and> p \<noteq> 0 then 1 else 0)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
p \<noteq> 0

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> card {x. a < x \<and> x < b \<and> poly p x = 0} = count_roots_between p a b - (if poly p b = 0 \<and> a < b \<and> p \<noteq> 0 then 1 else 0)
[PROOF STEP]
with False'
[PROOF STATE]
proof (chain)
picking this:
\<not> (poly p b = 0 \<and> a < b \<and> p \<noteq> 0)
p \<noteq> 0
[PROOF STEP]
have "{x. a < x \<and> x < b \<and> poly p x = 0} =
                          {x. a < x \<and> x \<le> b \<and> poly p x = 0}"
[PROOF STATE]
proof (prove)
using this:
\<not> (poly p b = 0 \<and> a < b \<and> p \<noteq> 0)
p \<noteq> 0

goal (1 subgoal):
 1. {x. a < x \<and> x < b \<and> poly p x = 0} = {x. a < x \<and> x \<le> b \<and> poly p x = 0}
[PROOF STEP]
by (auto simp: less_eq_real_def)
[PROOF STATE]
proof (state)
this:
{x. a < x \<and> x < b \<and> poly p x = 0} = {x. a < x \<and> x \<le> b \<and> poly p x = 0}

goal (1 subgoal):
 1. p \<noteq> 0 \<Longrightarrow> card {x. a < x \<and> x < b \<and> poly p x = 0} = count_roots_between p a b - (if poly p b = 0 \<and> a < b \<and> p \<noteq> 0 then 1 else 0)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
{x. a < x \<and> x < b \<and> poly p x = 0} = {x. a < x \<and> x \<le> b \<and> poly p x = 0}

goal (1 subgoal):
 1. card {x. a < x \<and> x < b \<and> poly p x = 0} = count_roots_between p a b - (if poly p b = 0 \<and> a < b \<and> p \<noteq> 0 then 1 else 0)
[PROOF STEP]
using poly_card_roots_less_leq False
[PROOF STATE]
proof (prove)
using this:
{x. a < x \<and> x < b \<and> poly p x = 0} = {x. a < x \<and> x \<le> b \<and> poly p x = 0}
card {x. ?a < x \<and> x \<le> ?b \<and> poly ?p x = 0} = count_roots_between ?p ?a ?b
p \<noteq> 0

goal (1 subgoal):
 1. card {x. a < x \<and> x < b \<and> poly p x = 0} = count_roots_between p a b - (if poly p b = 0 \<and> a < b \<and> p \<noteq> 0 then 1 else 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card {x. a < x \<and> x < b \<and> poly p x = 0} = count_roots_between p a b - (if poly p b = 0 \<and> a < b \<and> p \<noteq> 0 then 1 else 0)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
card {x. a < x \<and> x < b \<and> poly p x = 0} = count_roots_between p a b - (if poly p b = 0 \<and> a < b \<and> p \<noteq> 0 then 1 else 0)

goal (1 subgoal):
 1. poly p b = 0 \<and> a < b \<and> p \<noteq> 0 \<Longrightarrow> card {x. a < x \<and> x < b \<and> poly p x = 0} = count_roots_between p a b - (if poly p b = 0 \<and> a < b \<and> p \<noteq> 0 then 1 else 0)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. poly p b = 0 \<and> a < b \<and> p \<noteq> 0 \<Longrightarrow> card {x. a < x \<and> x < b \<and> poly p x = 0} = count_roots_between p a b - (if poly p b = 0 \<and> a < b \<and> p \<noteq> 0 then 1 else 0)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
poly p b = 0 \<and> a < b \<and> p \<noteq> 0

goal (1 subgoal):
 1. poly p b = 0 \<and> a < b \<and> p \<noteq> 0 \<Longrightarrow> card {x. a < x \<and> x < b \<and> poly p x = 0} = count_roots_between p a b - (if poly p b = 0 \<and> a < b \<and> p \<noteq> 0 then 1 else 0)
[PROOF STEP]
with poly_roots_finite
[PROOF STATE]
proof (chain)
picking this:
?p \<noteq> 0 \<Longrightarrow> finite {x. poly ?p x = (0::?'a)}
poly p b = 0 \<and> a < b \<and> p \<noteq> 0
[PROOF STEP]
have fin: "finite {x. a < x \<and> x < b \<and> poly p x = 0}"
[PROOF STATE]
proof (prove)
using this:
?p \<noteq> 0 \<Longrightarrow> finite {x. poly ?p x = (0::?'a)}
poly p b = 0 \<and> a < b \<and> p \<noteq> 0

goal (1 subgoal):
 1. finite {x. a < x \<and> x < b \<and> poly p x = 0}
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
finite {x. a < x \<and> x < b \<and> poly p x = 0}

goal (1 subgoal):
 1. poly p b = 0 \<and> a < b \<and> p \<noteq> 0 \<Longrightarrow> card {x. a < x \<and> x < b \<and> poly p x = 0} = count_roots_between p a b - (if poly p b = 0 \<and> a < b \<and> p \<noteq> 0 then 1 else 0)
[PROOF STEP]
from True
[PROOF STATE]
proof (chain)
picking this:
poly p b = 0 \<and> a < b \<and> p \<noteq> 0
[PROOF STEP]
have "{x. a < x \<and> x \<le> b \<and> poly p x = 0} =
        insert b {x. a < x \<and> x < b \<and> poly p x = 0}"
[PROOF STATE]
proof (prove)
using this:
poly p b = 0 \<and> a < b \<and> p \<noteq> 0

goal (1 subgoal):
 1. {x. a < x \<and> x \<le> b \<and> poly p x = 0} = insert b {x. a < x \<and> x < b \<and> poly p x = 0}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{x. a < x \<and> x \<le> b \<and> poly p x = 0} = insert b {x. a < x \<and> x < b \<and> poly p x = 0}

goal (1 subgoal):
 1. poly p b = 0 \<and> a < b \<and> p \<noteq> 0 \<Longrightarrow> card {x. a < x \<and> x < b \<and> poly p x = 0} = count_roots_between p a b - (if poly p b = 0 \<and> a < b \<and> p \<noteq> 0 then 1 else 0)
[PROOF STEP]
hence "Suc (card {x. a < x \<and> x < b \<and> poly p x = 0}) =
           card {x. a < x \<and> x \<le> b \<and> poly p x = 0}"
[PROOF STATE]
proof (prove)
using this:
{x. a < x \<and> x \<le> b \<and> poly p x = 0} = insert b {x. a < x \<and> x < b \<and> poly p x = 0}

goal (1 subgoal):
 1. Suc (card {x. a < x \<and> x < b \<and> poly p x = 0}) = card {x. a < x \<and> x \<le> b \<and> poly p x = 0}
[PROOF STEP]
using fin
[PROOF STATE]
proof (prove)
using this:
{x. a < x \<and> x \<le> b \<and> poly p x = 0} = insert b {x. a < x \<and> x < b \<and> poly p x = 0}
finite {x. a < x \<and> x < b \<and> poly p x = 0}

goal (1 subgoal):
 1. Suc (card {x. a < x \<and> x < b \<and> poly p x = 0}) = card {x. a < x \<and> x \<le> b \<and> poly p x = 0}
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
Suc (card {x. a < x \<and> x < b \<and> poly p x = 0}) = card {x. a < x \<and> x \<le> b \<and> poly p x = 0}

goal (1 subgoal):
 1. poly p b = 0 \<and> a < b \<and> p \<noteq> 0 \<Longrightarrow> card {x. a < x \<and> x < b \<and> poly p x = 0} = count_roots_between p a b - (if poly p b = 0 \<and> a < b \<and> p \<noteq> 0 then 1 else 0)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Suc (card {x. a < x \<and> x < b \<and> poly p x = 0}) = card {x. a < x \<and> x \<le> b \<and> poly p x = 0}

goal (1 subgoal):
 1. poly p b = 0 \<and> a < b \<and> p \<noteq> 0 \<Longrightarrow> card {x. a < x \<and> x < b \<and> poly p x = 0} = count_roots_between p a b - (if poly p b = 0 \<and> a < b \<and> p \<noteq> 0 then 1 else 0)
[PROOF STEP]
note count_roots_between_correct[symmetric]
[PROOF STATE]
proof (state)
this:
card {x. ?a < x \<and> x \<le> ?b \<and> poly ?p x = 0} = count_roots_between ?p ?a ?b

goal (1 subgoal):
 1. poly p b = 0 \<and> a < b \<and> p \<noteq> 0 \<Longrightarrow> card {x. a < x \<and> x < b \<and> poly p x = 0} = count_roots_between p a b - (if poly p b = 0 \<and> a < b \<and> p \<noteq> 0 then 1 else 0)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Suc (card {x. a < x \<and> x < b \<and> poly p x = 0}) = count_roots_between p a b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Suc (card {x. a < x \<and> x < b \<and> poly p x = 0}) = count_roots_between p a b

goal (1 subgoal):
 1. card {x. a < x \<and> x < b \<and> poly p x = 0} = count_roots_between p a b - (if poly p b = 0 \<and> a < b \<and> p \<noteq> 0 then 1 else 0)
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
Suc (card {x. a < x \<and> x < b \<and> poly p x = 0}) = count_roots_between p a b
poly p b = 0 \<and> a < b \<and> p \<noteq> 0

goal (1 subgoal):
 1. card {x. a < x \<and> x < b \<and> poly p x = 0} = count_roots_between p a b - (if poly p b = 0 \<and> a < b \<and> p \<noteq> 0 then 1 else 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card {x. a < x \<and> x < b \<and> poly p x = 0} = count_roots_between p a b - (if poly p b = 0 \<and> a < b \<and> p \<noteq> 0 then 1 else 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma in_proj_in_GSMP: "t \<in> GSMP (trms_proj\<^sub>l\<^sub>s\<^sub>t n A) \<Longrightarrow> t \<in> GSMP (trms\<^sub>l\<^sub>s\<^sub>t A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t \<in> GSMP (trms\<^sub>l\<^sub>s\<^sub>t (proj n A)) \<Longrightarrow> t \<in> GSMP (trms\<^sub>l\<^sub>s\<^sub>t A)
[PROOF STEP]
using GSMP_Union[of A]
[PROOF STATE]
proof (prove)
using this:
GSMP (trms\<^sub>l\<^sub>s\<^sub>t A) = (\<Union>l. GSMP (trms\<^sub>l\<^sub>s\<^sub>t (proj l A)))

goal (1 subgoal):
 1. t \<in> GSMP (trms\<^sub>l\<^sub>s\<^sub>t (proj n A)) \<Longrightarrow> t \<in> GSMP (trms\<^sub>l\<^sub>s\<^sub>t A)
[PROOF STEP]
by blast


[STATEMENT]
lemma gbinomial_0_left: "0 gchoose k = (if k = 0 then 1 else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) gchoose k = (if k = 0 then 1::'a else (0::'a))
[PROOF STEP]
by (cases k) simp_all


[STATEMENT]
lemma gcd_ge_0_int [simp]: "gcd (x::int) y >= 0"
  for x y :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> gcd x y
[PROOF STEP]
by (simp add: gcd_int_def)


[STATEMENT]
theorem JF1map_id: "JF1map id = id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. JF1map id = id
[PROOF STEP]
apply (rule trans)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. JF1map id = ?s
 2. ?s = id
[PROOF STEP]
apply (rule conjunct1)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. JF1map id = ?s \<and> ?Q3
 2. ?s = id
[PROOF STEP]
apply (rule unfold_unique)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. F1map id (JF1map id) ?f2.5 \<circ> ?s1.5 = dtor1 \<circ> JF1map id
 2. F2map id (JF1map id) ?f2.5 \<circ> ?s2.5 = dtor2 \<circ> ?f2.5
 3. unfold1 ?s1.5 ?s2.5 = id
[PROOF STEP]
apply (rule sym[OF JF1map])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. F2map id (JF1map id) (JF2map id) \<circ> ?s2.5 = dtor2 \<circ> JF2map id
 2. unfold1 dtor1 ?s2.5 = id
[PROOF STEP]
apply (rule sym[OF JF2map])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unfold1 dtor1 dtor2 = id
[PROOF STEP]
apply (rule unfold1_dtor)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma leadsTo_Union_distrib:
     "F \<in> (\<Union>S) leadsTo B  =  (\<forall>A \<in> S. F \<in> A leadsTo B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (F \<in> \<Union> S \<longmapsto> B) = (\<forall>A\<in>S. F \<in> A \<longmapsto> B)
[PROOF STEP]
by (blast intro: leadsTo_Union leadsTo_weaken_L)


[STATEMENT]
theorem E15b[simp_unl]: "\<turnstile> \<diamond>\<not>#F = \<not>#F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<turnstile> \<diamond>\<not> #F = \<not> #F
[PROOF STEP]
by (simp add: eventually_def)


[STATEMENT]
lemma Not_Rex: "\<turnstile> (\<not> (\<exists>x. F x)) = (\<forall>x. \<not> F x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<turnstile> (\<not> (\<exists>x. F x)) = (\<forall>x. \<not> F x)
[PROOF STEP]
by (simp add: Valid_def)


[STATEMENT]
lemma iT_Div_finite_iff: "0 < k \<Longrightarrow> finite (I \<oslash> k) = finite I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < k \<Longrightarrow> finite (I \<oslash> k) = finite I
[PROOF STEP]
by (insert iT_Div_infinite_iff, simp)


[STATEMENT]
lemma classes_changed_cons_eq:
 "classes_changed (t # P) P' = (classes_changed P P' - {fst t})
                     \<union> (if class_changed [t] P' (fst t) then {fst t} else {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. classes_changed (t # P) P' = classes_changed P P' - {fst t} \<union> (if class_changed [t] P' (fst t) then {fst t} else {})
[PROOF STEP]
by (auto simp: classes_changed_def class_changed_def class_def)


[STATEMENT]
lemma diff_invariant_nleq_rule:
  fixes \<mu>::"'a::banach \<Rightarrow> real"
  shows "diff_invariant (\<lambda>s. \<not> \<nu> s \<le> \<mu> s) f U S t\<^sub>0 G \<longleftrightarrow> diff_invariant (\<lambda>s. \<nu> s > \<mu> s) f U S t\<^sub>0 G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diff_invariant (\<lambda>s. \<not> \<nu> s \<le> \<mu> s) f U S t\<^sub>0 G = diff_invariant (\<lambda>s. \<mu> s < \<nu> s) f U S t\<^sub>0 G
[PROOF STEP]
unfolding diff_invariant_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>s. \<not> \<nu> s \<le> \<mu> s \<longrightarrow> (\<forall>X\<in>Sols f U S t\<^sub>0 s. \<forall>t\<in>U s. (\<forall>\<tau>\<in>down (U s) t. G (X \<tau>)) \<longrightarrow> \<not> \<nu> (X t) \<le> \<mu> (X t))) = (\<forall>s. \<mu> s < \<nu> s \<longrightarrow> (\<forall>X\<in>Sols f U S t\<^sub>0 s. \<forall>t\<in>U s. (\<forall>\<tau>\<in>down (U s) t. G (X \<tau>)) \<longrightarrow> \<mu> (X t) < \<nu> (X t)))
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>s X t. \<lbrakk>\<forall>s. \<not> \<nu> s \<le> \<mu> s \<longrightarrow> (\<forall>X\<in>Sols f U S t\<^sub>0 s. \<forall>t\<in>U s. (\<forall>\<tau>\<in>down (U s) t. G (X \<tau>)) \<longrightarrow> \<not> \<nu> (X t) \<le> \<mu> (X t)); \<mu> s < \<nu> s; X \<in> Sols f U S t\<^sub>0 s; t \<in> U s; \<forall>\<tau>\<in>down (U s) t. G (X \<tau>)\<rbrakk> \<Longrightarrow> \<mu> (X t) < \<nu> (X t)
 2. \<And>s X t. \<lbrakk>\<forall>s. \<mu> s < \<nu> s \<longrightarrow> (\<forall>X\<in>Sols f U S t\<^sub>0 s. \<forall>t\<in>U s. (\<forall>\<tau>\<in>down (U s) t. G (X \<tau>)) \<longrightarrow> \<mu> (X t) < \<nu> (X t)); \<not> \<nu> s \<le> \<mu> s; X \<in> Sols f U S t\<^sub>0 s; t \<in> U s; \<forall>\<tau>\<in>down (U s) t. G (X \<tau>); \<nu> (X t) \<le> \<mu> (X t)\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
by (clarsimp, erule_tac x=s in allE, simp, erule_tac x=X in ballE, force, force)+


[STATEMENT]
lemma N_pos[simp]: "N > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < N
[PROOF STEP]
using N_g1 neq0_conv
[PROOF STATE]
proof (prove)
using this:
1 < N
(?n \<noteq> 0) = (0 < ?n)

goal (1 subgoal):
 1. 0 < N
[PROOF STEP]
by blast


[STATEMENT]
lemma Sublists_insert: "Sublists (insert w A) = set (sublists w) \<union> Sublists A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sublists (insert w A) = set (sublists w) \<union> Sublists A
[PROOF STEP]
by (auto simp: Sublists_altdef)


[STATEMENT]
lemma acc_iff: "(x, y) \<in> acc \<longleftrightarrow> (\<exists>n. 0 < p x y n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((x, y) \<in> acc) = (\<exists>n. 0 < p x y n)
[PROOF STEP]
by (blast intro: accD_pos accI_pos)


[STATEMENT]
lemma face_of_polytope_insert:
     "\<lbrakk>polytope S; a \<notin> affine hull S; F face_of S\<rbrakk> \<Longrightarrow> F face_of convex hull (insert a S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>polytope S; a \<notin> affine hull S; F face_of S\<rbrakk> \<Longrightarrow> F face_of convex hull insert a S
[PROOF STEP]
by (metis (no_types, lifting) affine_hull_convex_hull face_of_convex_hull_insert hull_insert polytope_def)


[STATEMENT]
lemma unit_circle_fix_moebius_add [simp]:
  assumes "unit_circle_fix M1" and "unit_circle_fix M2"
  shows "unit_circle_fix (M1 + M2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unit_circle_fix (M1 + M2)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
unit_circle_fix M1
unit_circle_fix M2

goal (1 subgoal):
 1. unit_circle_fix (M1 + M2)
[PROOF STEP]
unfolding unit_circle_fix_iff
[PROOF STATE]
proof (prove)
using this:
moebius_circline M1 unit_circle = unit_circle
moebius_circline M2 unit_circle = unit_circle

goal (1 subgoal):
 1. moebius_circline (M1 + M2) unit_circle = unit_circle
[PROOF STEP]
by auto


[STATEMENT]
lemma ninequarters: "2.25 = FloatR 9 (-2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 225 / 10\<^sup>2 = FloatR 9 (- 2)
[PROOF STEP]
by auto


[STATEMENT]
lemma ordinal_plus_strict_monoR: "y < y' \<Longrightarrow> x + y < x + (y'::ordinal)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y < y' \<Longrightarrow> x + y < x + y'
[PROOF STEP]
by (rule normal.strict_monoD[OF normal_plus])


[STATEMENT]
lemma Some_add2:
  "(Some x ++ y = Some z) = (\<exists>y'. y = Some y' \<and> x \<oplus> y' = Some z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Some x ++ y = Some z) = (\<exists>y'. y = Some y' \<and> x \<oplus> y' = Some z)
[PROOF STEP]
by (simp add: lift2_def split: option.splits)


[STATEMENT]
lemma fv_regex_alt: "safe_regex m g r \<Longrightarrow> Formula.fv_regex r = (\<Union>\<phi> \<in> atms r. Formula.fv \<phi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. safe_regex m g r \<Longrightarrow> fv_regex r = \<Union> (fv ` atms r)
[PROOF STEP]
unfolding fv_regex_alt atms_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. safe_regex m g r \<Longrightarrow> \<Union> (fv ` regex.atms r) = \<Union> (fv ` (\<Union>\<phi>\<in>regex.atms r. if safe_formula \<phi> then {\<phi>} else case \<phi> of formula.Neg \<phi>' \<Rightarrow> {\<phi>'} | _ \<Rightarrow> {}))
[PROOF STEP]
by (auto 0 3 dest: safe_regex_safe_formula)