[STATEMENT]
theorem Levy_uniqueness:
  fixes M1 M2 :: "real measure"
  assumes "real_distribution M1" "real_distribution M2" and
    "char M1 = char M2"
  shows "M1 = M2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M1 = M2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. M1 = M2
[PROOF STEP]
interpret M1: real_distribution M1
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_distribution M1
[PROOF STEP]
by (rule assms)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. M1 = M2
[PROOF STEP]
interpret M2: real_distribution M2
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_distribution M2
[PROOF STEP]
by (rule assms)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. M1 = M2
[PROOF STEP]
have "countable ({x. measure M1 {x} \<noteq> 0} \<union> {x. measure M2 {x} \<noteq> 0})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. countable ({x. M1.prob {x} \<noteq> 0} \<union> {x. M2.prob {x} \<noteq> 0})
[PROOF STEP]
by (intro countable_Un M2.countable_support M1.countable_support)
[PROOF STATE]
proof (state)
this:
countable ({x. M1.prob {x} \<noteq> 0} \<union> {x. M2.prob {x} \<noteq> 0})

goal (1 subgoal):
 1. M1 = M2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
countable ({x. M1.prob {x} \<noteq> 0} \<union> {x. M2.prob {x} \<noteq> 0})
[PROOF STEP]
have count: "countable {x. measure M1 {x} \<noteq> 0 \<or> measure M2 {x} \<noteq> 0}"
[PROOF STATE]
proof (prove)
using this:
countable ({x. M1.prob {x} \<noteq> 0} \<union> {x. M2.prob {x} \<noteq> 0})

goal (1 subgoal):
 1. countable {x. M1.prob {x} \<noteq> 0 \<or> M2.prob {x} \<noteq> 0}
[PROOF STEP]
by (simp add: Un_def)
[PROOF STATE]
proof (state)
this:
countable {x. M1.prob {x} \<noteq> 0 \<or> M2.prob {x} \<noteq> 0}

goal (1 subgoal):
 1. M1 = M2
[PROOF STEP]
have "cdf M1 = cdf M2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cdf M1 = cdf M2
[PROOF STEP]
proof (rule ext)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
let ?D = "\<lambda>x. \<bar>cdf M1 x - cdf M2 x\<bar>"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
fix \<epsilon> :: real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
assume "\<epsilon> > 0"
[PROOF STATE]
proof (state)
this:
0 < \<epsilon>

goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
have "(?D \<longlongrightarrow> 0) at_bot"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. \<bar>cdf M1 x - cdf M2 x\<bar>) \<longlongrightarrow> 0) at_bot
[PROOF STEP]
using M1.cdf_lim_at_bot M2.cdf_lim_at_bot
[PROOF STATE]
proof (prove)
using this:
(cdf M1 \<longlongrightarrow> 0) at_bot
(cdf M2 \<longlongrightarrow> 0) at_bot

goal (1 subgoal):
 1. ((\<lambda>x. \<bar>cdf M1 x - cdf M2 x\<bar>) \<longlongrightarrow> 0) at_bot
[PROOF STEP]
by (intro tendsto_eq_intros) auto
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<bar>cdf M1 x - cdf M2 x\<bar>) \<longlongrightarrow> 0) at_bot

goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. \<bar>cdf M1 x - cdf M2 x\<bar>) \<longlongrightarrow> 0) at_bot
[PROOF STEP]
have "eventually (\<lambda>y. ?D y < \<epsilon> / 2 \<and> y \<le> x) at_bot"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. \<bar>cdf M1 x - cdf M2 x\<bar>) \<longlongrightarrow> 0) at_bot

goal (1 subgoal):
 1. \<forall>\<^sub>F y in at_bot. \<bar>cdf M1 y - cdf M2 y\<bar> < \<epsilon> / 2 \<and> y \<le> x
[PROOF STEP]
using \<open>\<epsilon> > 0\<close>
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. \<bar>cdf M1 x - cdf M2 x\<bar>) \<longlongrightarrow> 0) at_bot
0 < \<epsilon>

goal (1 subgoal):
 1. \<forall>\<^sub>F y in at_bot. \<bar>cdf M1 y - cdf M2 y\<bar> < \<epsilon> / 2 \<and> y \<le> x
[PROOF STEP]
by (simp only: tendsto_iff dist_real_def diff_0_right eventually_conj eventually_le_at_bot abs_idempotent)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F y in at_bot. \<bar>cdf M1 y - cdf M2 y\<bar> < \<epsilon> / 2 \<and> y \<le> x

goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F y in at_bot. \<bar>cdf M1 y - cdf M2 y\<bar> < \<epsilon> / 2 \<and> y \<le> x
[PROOF STEP]
obtain M where "\<And>y. y \<le> M \<Longrightarrow> ?D y < \<epsilon> / 2" "M \<le> x"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F y in at_bot. \<bar>cdf M1 y - cdf M2 y\<bar> < \<epsilon> / 2 \<and> y \<le> x

goal (1 subgoal):
 1. (\<And>M. \<lbrakk>\<And>y. y \<le> M \<Longrightarrow> \<bar>cdf M1 y - cdf M2 y\<bar> < \<epsilon> / 2; M \<le> x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding eventually_at_bot_linorder
[PROOF STATE]
proof (prove)
using this:
\<exists>N. \<forall>n\<le>N. \<bar>cdf M1 n - cdf M2 n\<bar> < \<epsilon> / 2 \<and> n \<le> x

goal (1 subgoal):
 1. (\<And>M. \<lbrakk>\<And>y. y \<le> M \<Longrightarrow> \<bar>cdf M1 y - cdf M2 y\<bar> < \<epsilon> / 2; M \<le> x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?y1 \<le> M \<Longrightarrow> \<bar>cdf M1 ?y1 - cdf M2 ?y1\<bar> < \<epsilon> / 2
M \<le> x

goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
with open_minus_countable[OF count, of "{..< M}"]
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>{..<M} \<noteq> {}; open {..<M}\<rbrakk> \<Longrightarrow> \<exists>x\<in>{..<M}. x \<notin> {x. M1.prob {x} \<noteq> 0 \<or> M2.prob {x} \<noteq> 0}
?y1 \<le> M \<Longrightarrow> \<bar>cdf M1 ?y1 - cdf M2 ?y1\<bar> < \<epsilon> / 2
M \<le> x
[PROOF STEP]
obtain a where
        "measure M1 {a} = 0" "measure M2 {a} = 0" "a < M" "a \<le> x" and 1: "?D a < \<epsilon> / 2"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>{..<M} \<noteq> {}; open {..<M}\<rbrakk> \<Longrightarrow> \<exists>x\<in>{..<M}. x \<notin> {x. M1.prob {x} \<noteq> 0 \<or> M2.prob {x} \<noteq> 0}
?y1 \<le> M \<Longrightarrow> \<bar>cdf M1 ?y1 - cdf M2 ?y1\<bar> < \<epsilon> / 2
M \<le> x

goal (1 subgoal):
 1. (\<And>a. \<lbrakk>M1.prob {a} = 0; M2.prob {a} = 0; a < M; a \<le> x; \<bar>cdf M1 a - cdf M2 a\<bar> < \<epsilon> / 2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
M1.prob {a} = 0
M2.prob {a} = 0
a < M
a \<le> x
\<bar>cdf M1 a - cdf M2 a\<bar> < \<epsilon> / 2

goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
have "(?D \<longlongrightarrow> ?D x) (at_right x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. \<bar>cdf M1 x - cdf M2 x\<bar>) \<longlongrightarrow> \<bar>cdf M1 x - cdf M2 x\<bar>) (at_right x)
[PROOF STEP]
using M1.cdf_is_right_cont [of x] M2.cdf_is_right_cont [of x]
[PROOF STATE]
proof (prove)
using this:
continuous (at_right x) (cdf M1)
continuous (at_right x) (cdf M2)

goal (1 subgoal):
 1. ((\<lambda>x. \<bar>cdf M1 x - cdf M2 x\<bar>) \<longlongrightarrow> \<bar>cdf M1 x - cdf M2 x\<bar>) (at_right x)
[PROOF STEP]
by (intro tendsto_intros) (auto simp add: continuous_within)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<bar>cdf M1 x - cdf M2 x\<bar>) \<longlongrightarrow> \<bar>cdf M1 x - cdf M2 x\<bar>) (at_right x)

goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. \<bar>cdf M1 x - cdf M2 x\<bar>) \<longlongrightarrow> \<bar>cdf M1 x - cdf M2 x\<bar>) (at_right x)
[PROOF STEP]
have "eventually (\<lambda>y. \<bar>?D y - ?D x\<bar> < \<epsilon> / 2) (at_right x)"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. \<bar>cdf M1 x - cdf M2 x\<bar>) \<longlongrightarrow> \<bar>cdf M1 x - cdf M2 x\<bar>) (at_right x)

goal (1 subgoal):
 1. \<forall>\<^sub>F y in at_right x. \<bar>\<bar>cdf M1 y - cdf M2 y\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar>\<bar> < \<epsilon> / 2
[PROOF STEP]
using \<open>\<epsilon> > 0\<close>
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. \<bar>cdf M1 x - cdf M2 x\<bar>) \<longlongrightarrow> \<bar>cdf M1 x - cdf M2 x\<bar>) (at_right x)
0 < \<epsilon>

goal (1 subgoal):
 1. \<forall>\<^sub>F y in at_right x. \<bar>\<bar>cdf M1 y - cdf M2 y\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar>\<bar> < \<epsilon> / 2
[PROOF STEP]
by (simp only: tendsto_iff dist_real_def eventually_conj eventually_at_right_less)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F y in at_right x. \<bar>\<bar>cdf M1 y - cdf M2 y\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar>\<bar> < \<epsilon> / 2

goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F y in at_right x. \<bar>\<bar>cdf M1 y - cdf M2 y\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar>\<bar> < \<epsilon> / 2
[PROOF STEP]
obtain N where "N > x" "\<And>y. x < y \<Longrightarrow> y < N \<Longrightarrow> \<bar>?D y - ?D x\<bar> < \<epsilon> / 2"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F y in at_right x. \<bar>\<bar>cdf M1 y - cdf M2 y\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar>\<bar> < \<epsilon> / 2

goal (1 subgoal):
 1. (\<And>N. \<lbrakk>x < N; \<And>y. \<lbrakk>x < y; y < N\<rbrakk> \<Longrightarrow> \<bar>\<bar>cdf M1 y - cdf M2 y\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar>\<bar> < \<epsilon> / 2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp add: eventually_at_right[OF less_add_one])
[PROOF STATE]
proof (state)
this:
x < N
\<lbrakk>x < ?y1; ?y1 < N\<rbrakk> \<Longrightarrow> \<bar>\<bar>cdf M1 ?y1 - cdf M2 ?y1\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar>\<bar> < \<epsilon> / 2

goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
with open_minus_countable[OF count, of "{x <..< N}"]
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>{x<..<N} \<noteq> {}; open {x<..<N}\<rbrakk> \<Longrightarrow> \<exists>x\<in>{x<..<N}. x \<notin> {x. M1.prob {x} \<noteq> 0 \<or> M2.prob {x} \<noteq> 0}
x < N
\<lbrakk>x < ?y1; ?y1 < N\<rbrakk> \<Longrightarrow> \<bar>\<bar>cdf M1 ?y1 - cdf M2 ?y1\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar>\<bar> < \<epsilon> / 2
[PROOF STEP]
obtain b where "x < b" "b < N"
          "measure M1 {b} = 0" "measure M2 {b} = 0" and 2: "\<bar>?D b - ?D x\<bar> < \<epsilon> / 2"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>{x<..<N} \<noteq> {}; open {x<..<N}\<rbrakk> \<Longrightarrow> \<exists>x\<in>{x<..<N}. x \<notin> {x. M1.prob {x} \<noteq> 0 \<or> M2.prob {x} \<noteq> 0}
x < N
\<lbrakk>x < ?y1; ?y1 < N\<rbrakk> \<Longrightarrow> \<bar>\<bar>cdf M1 ?y1 - cdf M2 ?y1\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar>\<bar> < \<epsilon> / 2

goal (1 subgoal):
 1. (\<And>b. \<lbrakk>x < b; b < N; M1.prob {b} = 0; M2.prob {b} = 0; \<bar>\<bar>cdf M1 b - cdf M2 b\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar>\<bar> < \<epsilon> / 2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: abs_minus_commute)
[PROOF STATE]
proof (state)
this:
x < b
b < N
M1.prob {b} = 0
M2.prob {b} = 0
\<bar>\<bar>cdf M1 b - cdf M2 b\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar>\<bar> < \<epsilon> / 2

goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
from \<open>a \<le> x\<close> \<open>x < b\<close>
[PROOF STATE]
proof (chain)
picking this:
a \<le> x
x < b
[PROOF STEP]
have "a < b" "a \<le> b"
[PROOF STATE]
proof (prove)
using this:
a \<le> x
x < b

goal (1 subgoal):
 1. a < b &&& a \<le> b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a < b
a \<le> b

goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
from \<open>char M1 = char M2\<close>
        M1.Levy_Inversion [OF \<open>a \<le> b\<close> \<open>measure M1 {a} = 0\<close> \<open>measure M1 {b} = 0\<close>]
        M2.Levy_Inversion [OF \<open>a \<le> b\<close> \<open>measure M2 {a} = 0\<close> \<open>measure M2 {b} = 0\<close>]
[PROOF STATE]
proof (chain)
picking this:
char M1 = char M2
(\<lambda>T. complex_of_real (1 / (2 * pi)) * (CLBINT t=ereal (real_of_int (- int T))..ereal (real T). (iexp (- (t * a)) - iexp (- (t * b))) / (\<i> * complex_of_real t) * char M1 t)) \<longlonglongrightarrow> complex_of_real (M1.prob {a<..b})
(\<lambda>T. complex_of_real (1 / (2 * pi)) * (CLBINT t=ereal (real_of_int (- int T))..ereal (real T). (iexp (- (t * a)) - iexp (- (t * b))) / (\<i> * complex_of_real t) * char M2 t)) \<longlonglongrightarrow> complex_of_real (M2.prob {a<..b})
[PROOF STEP]
have "complex_of_real (measure M1 {a<..b}) = complex_of_real (measure M2 {a<..b})"
[PROOF STATE]
proof (prove)
using this:
char M1 = char M2
(\<lambda>T. complex_of_real (1 / (2 * pi)) * (CLBINT t=ereal (real_of_int (- int T))..ereal (real T). (iexp (- (t * a)) - iexp (- (t * b))) / (\<i> * complex_of_real t) * char M1 t)) \<longlonglongrightarrow> complex_of_real (M1.prob {a<..b})
(\<lambda>T. complex_of_real (1 / (2 * pi)) * (CLBINT t=ereal (real_of_int (- int T))..ereal (real T). (iexp (- (t * a)) - iexp (- (t * b))) / (\<i> * complex_of_real t) * char M2 t)) \<longlonglongrightarrow> complex_of_real (M2.prob {a<..b})

goal (1 subgoal):
 1. complex_of_real (M1.prob {a<..b}) = complex_of_real (M2.prob {a<..b})
[PROOF STEP]
by (intro LIMSEQ_unique) auto
[PROOF STATE]
proof (state)
this:
complex_of_real (M1.prob {a<..b}) = complex_of_real (M2.prob {a<..b})

goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
complex_of_real (M1.prob {a<..b}) = complex_of_real (M2.prob {a<..b})
[PROOF STEP]
have "?D a = ?D b"
[PROOF STATE]
proof (prove)
using this:
complex_of_real (M1.prob {a<..b}) = complex_of_real (M2.prob {a<..b})

goal (1 subgoal):
 1. \<bar>cdf M1 a - cdf M2 a\<bar> = \<bar>cdf M1 b - cdf M2 b\<bar>
[PROOF STEP]
unfolding of_real_eq_iff M1.cdf_diff_eq [OF \<open>a < b\<close>, symmetric] M2.cdf_diff_eq [OF \<open>a < b\<close>, symmetric]
[PROOF STATE]
proof (prove)
using this:
cdf M1 b - cdf M1 a = cdf M2 b - cdf M2 a

goal (1 subgoal):
 1. \<bar>cdf M1 a - cdf M2 a\<bar> = \<bar>cdf M1 b - cdf M2 b\<bar>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<bar>cdf M1 a - cdf M2 a\<bar> = \<bar>cdf M1 b - cdf M2 b\<bar>

goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<bar>cdf M1 a - cdf M2 a\<bar> = \<bar>cdf M1 b - cdf M2 b\<bar>
[PROOF STEP]
have "?D x = \<bar>(?D b - ?D x) - ?D a\<bar>"
[PROOF STATE]
proof (prove)
using this:
\<bar>cdf M1 a - cdf M2 a\<bar> = \<bar>cdf M1 b - cdf M2 b\<bar>

goal (1 subgoal):
 1. \<bar>cdf M1 x - cdf M2 x\<bar> = \<bar>\<bar>cdf M1 b - cdf M2 b\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar> - \<bar>cdf M1 a - cdf M2 a\<bar>\<bar>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<bar>cdf M1 x - cdf M2 x\<bar> = \<bar>\<bar>cdf M1 b - cdf M2 b\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar> - \<bar>cdf M1 a - cdf M2 a\<bar>\<bar>

goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<bar>cdf M1 x - cdf M2 x\<bar> = \<bar>\<bar>cdf M1 b - cdf M2 b\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar> - \<bar>cdf M1 a - cdf M2 a\<bar>\<bar>

goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
have "\<dots> \<le> \<bar>?D b - ?D x\<bar> + \<bar>?D a\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>\<bar>cdf M1 b - cdf M2 b\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar> - \<bar>cdf M1 a - cdf M2 a\<bar>\<bar> \<le> \<bar>\<bar>cdf M1 b - cdf M2 b\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar>\<bar> + \<bar>\<bar>cdf M1 a - cdf M2 a\<bar>\<bar>
[PROOF STEP]
by (rule abs_triangle_ineq4)
[PROOF STATE]
proof (state)
this:
\<bar>\<bar>cdf M1 b - cdf M2 b\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar> - \<bar>cdf M1 a - cdf M2 a\<bar>\<bar> \<le> \<bar>\<bar>cdf M1 b - cdf M2 b\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar>\<bar> + \<bar>\<bar>cdf M1 a - cdf M2 a\<bar>\<bar>

goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<bar>\<bar>cdf M1 b - cdf M2 b\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar> - \<bar>cdf M1 a - cdf M2 a\<bar>\<bar> \<le> \<bar>\<bar>cdf M1 b - cdf M2 b\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar>\<bar> + \<bar>\<bar>cdf M1 a - cdf M2 a\<bar>\<bar>

goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
have "\<dots> \<le> \<epsilon> / 2 + \<epsilon> / 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>\<bar>cdf M1 b - cdf M2 b\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar>\<bar> + \<bar>\<bar>cdf M1 a - cdf M2 a\<bar>\<bar> \<le> \<epsilon> / 2 + \<epsilon> / 2
[PROOF STEP]
using 1 2
[PROOF STATE]
proof (prove)
using this:
\<bar>cdf M1 a - cdf M2 a\<bar> < \<epsilon> / 2
\<bar>\<bar>cdf M1 b - cdf M2 b\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar>\<bar> < \<epsilon> / 2

goal (1 subgoal):
 1. \<bar>\<bar>cdf M1 b - cdf M2 b\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar>\<bar> + \<bar>\<bar>cdf M1 a - cdf M2 a\<bar>\<bar> \<le> \<epsilon> / 2 + \<epsilon> / 2
[PROOF STEP]
by (intro add_mono) auto
[PROOF STATE]
proof (state)
this:
\<bar>\<bar>cdf M1 b - cdf M2 b\<bar> - \<bar>cdf M1 x - cdf M2 x\<bar>\<bar> + \<bar>\<bar>cdf M1 a - cdf M2 a\<bar>\<bar> \<le> \<epsilon> / 2 + \<epsilon> / 2

goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<bar>cdf M1 x - cdf M2 x\<bar> \<le> \<epsilon> / 2 + \<epsilon> / 2
[PROOF STEP]
have "?D x \<le> \<epsilon>"
[PROOF STATE]
proof (prove)
using this:
\<bar>cdf M1 x - cdf M2 x\<bar> \<le> \<epsilon> / 2 + \<epsilon> / 2

goal (1 subgoal):
 1. \<bar>cdf M1 x - cdf M2 x\<bar> \<le> \<epsilon>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<bar>cdf M1 x - cdf M2 x\<bar> \<le> \<epsilon>

goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
0 < ?\<epsilon>3 \<Longrightarrow> \<bar>cdf M1 x - cdf M2 x\<bar> \<le> ?\<epsilon>3

goal (1 subgoal):
 1. \<And>x. cdf M1 x = cdf M2 x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < ?\<epsilon>3 \<Longrightarrow> \<bar>cdf M1 x - cdf M2 x\<bar> \<le> ?\<epsilon>3
[PROOF STEP]
show "cdf M1 x = cdf M2 x"
[PROOF STATE]
proof (prove)
using this:
0 < ?\<epsilon>3 \<Longrightarrow> \<bar>cdf M1 x - cdf M2 x\<bar> \<le> ?\<epsilon>3

goal (1 subgoal):
 1. cdf M1 x = cdf M2 x
[PROOF STEP]
by (metis abs_le_zero_iff dense_ge eq_iff_diff_eq_0)
[PROOF STATE]
proof (state)
this:
cdf M1 x = cdf M2 x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
cdf M1 = cdf M2

goal (1 subgoal):
 1. M1 = M2
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
cdf M1 = cdf M2

goal (1 subgoal):
 1. M1 = M2
[PROOF STEP]
by (rule cdf_unique [OF \<open>real_distribution M1\<close> \<open>real_distribution M2\<close>])
[PROOF STATE]
proof (state)
this:
M1 = M2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma word_upto_alt: "(a :: ('l :: len) word) \<le> b \<Longrightarrow>
  word_upto a b = map of_nat (upt (unat a) (Suc (unat b)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<le> b \<Longrightarrow> word_upto a b = map word_of_nat [unat a..<Suc (unat b)]
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<le> b \<Longrightarrow> word_upto a b = map word_of_nat [unat a..<Suc (unat b)]
[PROOF STEP]
let ?mmw = "- 1 :: 'l word"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<le> b \<Longrightarrow> word_upto a b = map word_of_nat [unat a..<Suc (unat b)]
[PROOF STEP]
assume le: "a \<le> b"
[PROOF STATE]
proof (state)
this:
a \<le> b

goal (1 subgoal):
 1. a \<le> b \<Longrightarrow> word_upto a b = map word_of_nat [unat a..<Suc (unat b)]
[PROOF STEP]
hence nle: "unat a \<le> unat b"
[PROOF STATE]
proof (prove)
using this:
a \<le> b

goal (1 subgoal):
 1. unat a \<le> unat b
[PROOF STEP]
by(unat_arith)
[PROOF STATE]
proof (state)
this:
unat a \<le> unat b

goal (1 subgoal):
 1. a \<le> b \<Longrightarrow> word_upto a b = map word_of_nat [unat a..<Suc (unat b)]
[PROOF STEP]
have lem: "unat b \<le> unat ?mmw"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unat b \<le> unat (- 1)
[PROOF STEP]
by (simp add: word_unat_less_le)
[PROOF STATE]
proof (state)
this:
unat b \<le> unat (- 1)

goal (1 subgoal):
 1. a \<le> b \<Longrightarrow> word_upto a b = map word_of_nat [unat a..<Suc (unat b)]
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
unat b \<le> unat (- 1)
[PROOF STEP]
show "word_upto a b = map of_nat [unat a..<Suc (unat b)]"
[PROOF STATE]
proof (prove)
using this:
unat b \<le> unat (- 1)

goal (1 subgoal):
 1. word_upto a b = map word_of_nat [unat a..<Suc (unat b)]
[PROOF STEP]
using word_upto_eq_upto [OF nle lem]
[PROOF STATE]
proof (prove)
using this:
unat b \<le> unat (- 1)
word_upto (word_of_nat (unat a)) (word_of_nat (unat b)) = map word_of_nat [unat a..<Suc (unat b)]

goal (1 subgoal):
 1. word_upto a b = map word_of_nat [unat a..<Suc (unat b)]
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
word_upto a b = map word_of_nat [unat a..<Suc (unat b)]

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem wls_swapEnv_preserves_freshEnv_distinct:
assumes "wlsEnv rho"
       "xs \<noteq> ys \<or> x \<notin> {y1,y2}"
shows "freshEnv xs x (rho &[y1 \<and> y2]_ys) = freshEnv xs x rho"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. freshEnv xs x (rho &[y1 \<and> y2]_ys) = freshEnv xs x rho
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
wlsEnv rho
xs \<noteq> ys \<or> x \<notin> {y1, y2}

goal (1 subgoal):
 1. freshEnv xs x (rho &[y1 \<and> y2]_ys) = freshEnv xs x rho
[PROOF STEP]
by (intro swapEnv_preserves_freshEnv_distinct) auto


[STATEMENT]
lemma (in group_hom) vimage_subset_generate_kern:
  assumes "A \<subseteq> carrier G"
  shows "{x \<in> carrier G. h x \<in> h ` A} \<subseteq> generate G (A \<union> kernel G H h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> carrier G. h x \<in> h ` A} \<subseteq> generate G (A \<union> kernel G H h)
[PROOF STEP]
using vimage_eq_set_mult_kern_right[of A] G.set_mult_subset_generate[of "A" "kernel G H h"] assms
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> carrier G \<Longrightarrow> {x \<in> carrier G. h x \<in> h ` A} = A <#> kernel G H h
\<lbrakk>A \<subseteq> carrier G; kernel G H h \<subseteq> carrier G\<rbrakk> \<Longrightarrow> A <#> kernel G H h \<subseteq> generate G (A \<union> kernel G H h)
A \<subseteq> carrier G

goal (1 subgoal):
 1. {x \<in> carrier G. h x \<in> h ` A} \<subseteq> generate G (A \<union> kernel G H h)
[PROOF STEP]
unfolding kernel_def
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> carrier G \<Longrightarrow> {x \<in> carrier G. h x \<in> h ` A} = A <#> {x \<in> carrier G. h x = \<one>\<^bsub>H\<^esub>}
\<lbrakk>A \<subseteq> carrier G; {x \<in> carrier G. h x = \<one>\<^bsub>H\<^esub>} \<subseteq> carrier G\<rbrakk> \<Longrightarrow> A <#> {x \<in> carrier G. h x = \<one>\<^bsub>H\<^esub>} \<subseteq> generate G (A \<union> {x \<in> carrier G. h x = \<one>\<^bsub>H\<^esub>})
A \<subseteq> carrier G

goal (1 subgoal):
 1. {x \<in> carrier G. h x \<in> h ` A} \<subseteq> generate G (A \<union> {x \<in> carrier G. h x = \<one>\<^bsub>H\<^esub>})
[PROOF STEP]
by blast


[STATEMENT]
lemma one_zeroD:
  assumes onezero: "\<one> = \<zero>"
  shows "carrier R = {\<zero>}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. carrier R = {\<zero>}
[PROOF STEP]
proof (rule, rule)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> carrier R \<Longrightarrow> x \<in> {\<zero>}
 2. {\<zero>} \<subseteq> carrier R
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> carrier R \<Longrightarrow> x \<in> {\<zero>}
 2. {\<zero>} \<subseteq> carrier R
[PROOF STEP]
assume xcarr: "x \<in> carrier R"
[PROOF STATE]
proof (state)
this:
x \<in> carrier R

goal (2 subgoals):
 1. \<And>x. x \<in> carrier R \<Longrightarrow> x \<in> {\<zero>}
 2. {\<zero>} \<subseteq> carrier R
[PROOF STEP]
from xcarr
[PROOF STATE]
proof (chain)
picking this:
x \<in> carrier R
[PROOF STEP]
have "x = x \<otimes> \<one>"
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier R

goal (1 subgoal):
 1. x = x \<otimes> \<one>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x = x \<otimes> \<one>

goal (2 subgoals):
 1. \<And>x. x \<in> carrier R \<Longrightarrow> x \<in> {\<zero>}
 2. {\<zero>} \<subseteq> carrier R
[PROOF STEP]
with onezero
[PROOF STATE]
proof (chain)
picking this:
\<one> = \<zero>
x = x \<otimes> \<one>
[PROOF STEP]
have "x = x \<otimes> \<zero>"
[PROOF STATE]
proof (prove)
using this:
\<one> = \<zero>
x = x \<otimes> \<one>

goal (1 subgoal):
 1. x = x \<otimes> \<zero>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x = x \<otimes> \<zero>

goal (2 subgoals):
 1. \<And>x. x \<in> carrier R \<Longrightarrow> x \<in> {\<zero>}
 2. {\<zero>} \<subseteq> carrier R
[PROOF STEP]
with xcarr
[PROOF STATE]
proof (chain)
picking this:
x \<in> carrier R
x = x \<otimes> \<zero>
[PROOF STEP]
have "x = \<zero>"
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier R
x = x \<otimes> \<zero>

goal (1 subgoal):
 1. x = \<zero>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x = \<zero>

goal (2 subgoals):
 1. \<And>x. x \<in> carrier R \<Longrightarrow> x \<in> {\<zero>}
 2. {\<zero>} \<subseteq> carrier R
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x = \<zero>
[PROOF STEP]
show "x \<in> {\<zero>}"
[PROOF STATE]
proof (prove)
using this:
x = \<zero>

goal (1 subgoal):
 1. x \<in> {\<zero>}
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
x \<in> {\<zero>}

goal (1 subgoal):
 1. {\<zero>} \<subseteq> carrier R
[PROOF STEP]
qed fast


[STATEMENT]
lemma ord_isom_Ssegment_mem:"\<lbrakk>Order D; Order E;
      ord_isom D E f; a \<in> carrier D; x \<in> Ssegment D a\<rbrakk> \<Longrightarrow>
                     (f x) \<in> Ssegment E (f a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Order D; Order E; ord_isom D E f; a \<in> carrier D; x \<in> Ssegment D a\<rbrakk> \<Longrightarrow> f x \<in> Ssegment E (f a)
[PROOF STEP]
apply (frule Ssegment_inc_if[of "D" "a" "x"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Order D; Order E; ord_isom D E f; a \<in> carrier D; x \<in> Ssegment D a; x \<prec>\<^bsub>D\<^esub> a\<rbrakk> \<Longrightarrow> f x \<in> Ssegment E (f a)
[PROOF STEP]
apply (frule Order.ord_isom_less[of "D" "E" "f" "x" "a"], assumption+)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>Order D; Order E; ord_isom D E f; a \<in> carrier D; x \<in> Ssegment D a; x \<prec>\<^bsub>D\<^esub> a\<rbrakk> \<Longrightarrow> x \<in> carrier D
 2. \<lbrakk>Order D; Order E; ord_isom D E f; a \<in> carrier D; x \<in> Ssegment D a; x \<prec>\<^bsub>D\<^esub> a\<rbrakk> \<Longrightarrow> a \<in> carrier D
 3. \<lbrakk>Order D; Order E; ord_isom D E f; a \<in> carrier D; x \<in> Ssegment D a; x \<prec>\<^bsub>D\<^esub> a; x \<prec>\<^bsub>D\<^esub> a = f x \<prec>\<^bsub>E\<^esub> f a\<rbrakk> \<Longrightarrow> f x \<in> Ssegment E (f a)
[PROOF STEP]
apply (simp add:Ssegment_def, assumption, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Order D; Order E; ord_isom D E f; a \<in> carrier D; x \<in> Ssegment D a; f x \<prec>\<^bsub>E\<^esub> f a; x \<prec>\<^bsub>D\<^esub> a\<rbrakk> \<Longrightarrow> f x \<in> Ssegment E (f a)
[PROOF STEP]
apply (frule Order.ord_isom_mem[of "D" "E" "f" "x"], assumption+,
       simp add:Ssegment_def,
       frule Order.ord_isom_mem[of "D" "E" "f" "a"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Order D; Order E; ord_isom D E f; a \<in> carrier D; x \<in> Ssegment D a; f x \<prec>\<^bsub>E\<^esub> f a; x \<prec>\<^bsub>D\<^esub> a; f x \<in> carrier E; f a \<in> carrier E\<rbrakk> \<Longrightarrow> f x \<in> Ssegment E (f a)
[PROOF STEP]
apply (simp add:Ssegment_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma older_seniors_monotonic:
  "x \<le> n \<Longrightarrow> older_seniors x n \<supseteq> older_seniors x (n + m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> n \<Longrightarrow> older_seniors x (n + m) \<subseteq> older_seniors x n
[PROOF STEP]
by (induction m) (simp, metis older_seniors_monotonic_Suc add_Suc_right dual_order.trans trans_le_add1)


[STATEMENT]
lemma imbal_split_min:
  "split_min t = (x,t') \<Longrightarrow> t \<noteq> Leaf \<Longrightarrow> real(imbal t') - imbal t \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Root_Balanced_Tree.split_min t = (x, t'); t \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal t) \<le> 1
[PROOF STEP]
proof(induction t arbitrary: t')
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>t'. \<lbrakk>Root_Balanced_Tree.split_min \<langle>\<rangle> = (x, t'); \<langle>\<rangle> \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal \<langle>\<rangle>) \<le> 1
 2. \<And>t1 x2 t2 t'. \<lbrakk>\<And>t'. \<lbrakk>Root_Balanced_Tree.split_min t1 = (x, t'); t1 \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal t1) \<le> 1; \<And>t'. \<lbrakk>Root_Balanced_Tree.split_min t2 = (x, t'); t2 \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal t2) \<le> 1; Root_Balanced_Tree.split_min \<langle>t1, x2, t2\<rangle> = (x, t'); \<langle>t1, x2, t2\<rangle> \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal \<langle>t1, x2, t2\<rangle>) \<le> 1
[PROOF STEP]
case Leaf
[PROOF STATE]
proof (state)
this:
Root_Balanced_Tree.split_min \<langle>\<rangle> = (x, t')
\<langle>\<rangle> \<noteq> \<langle>\<rangle>

goal (2 subgoals):
 1. \<And>t'. \<lbrakk>Root_Balanced_Tree.split_min \<langle>\<rangle> = (x, t'); \<langle>\<rangle> \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal \<langle>\<rangle>) \<le> 1
 2. \<And>t1 x2 t2 t'. \<lbrakk>\<And>t'. \<lbrakk>Root_Balanced_Tree.split_min t1 = (x, t'); t1 \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal t1) \<le> 1; \<And>t'. \<lbrakk>Root_Balanced_Tree.split_min t2 = (x, t'); t2 \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal t2) \<le> 1; Root_Balanced_Tree.split_min \<langle>t1, x2, t2\<rangle> = (x, t'); \<langle>t1, x2, t2\<rangle> \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal \<langle>t1, x2, t2\<rangle>) \<le> 1
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
Root_Balanced_Tree.split_min \<langle>\<rangle> = (x, t')
\<langle>\<rangle> \<noteq> \<langle>\<rangle>

goal (1 subgoal):
 1. real (imbal t') - real (imbal \<langle>\<rangle>) \<le> 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real (imbal t') - real (imbal \<langle>\<rangle>) \<le> 1

goal (1 subgoal):
 1. \<And>t1 x2 t2 t'. \<lbrakk>\<And>t'. \<lbrakk>Root_Balanced_Tree.split_min t1 = (x, t'); t1 \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal t1) \<le> 1; \<And>t'. \<lbrakk>Root_Balanced_Tree.split_min t2 = (x, t'); t2 \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal t2) \<le> 1; Root_Balanced_Tree.split_min \<langle>t1, x2, t2\<rangle> = (x, t'); \<langle>t1, x2, t2\<rangle> \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal \<langle>t1, x2, t2\<rangle>) \<le> 1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>t1 x2 t2 t'. \<lbrakk>\<And>t'. \<lbrakk>Root_Balanced_Tree.split_min t1 = (x, t'); t1 \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal t1) \<le> 1; \<And>t'. \<lbrakk>Root_Balanced_Tree.split_min t2 = (x, t'); t2 \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal t2) \<le> 1; Root_Balanced_Tree.split_min \<langle>t1, x2, t2\<rangle> = (x, t'); \<langle>t1, x2, t2\<rangle> \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal \<langle>t1, x2, t2\<rangle>) \<le> 1
[PROOF STEP]
case (Node l y r)
[PROOF STATE]
proof (state)
this:
\<lbrakk>Root_Balanced_Tree.split_min l = (x, ?t'); l \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal ?t') - real (imbal l) \<le> 1
\<lbrakk>Root_Balanced_Tree.split_min r = (x, ?t'); r \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal ?t') - real (imbal r) \<le> 1
Root_Balanced_Tree.split_min \<langle>l, y, r\<rangle> = (x, t')
\<langle>l, y, r\<rangle> \<noteq> \<langle>\<rangle>

goal (1 subgoal):
 1. \<And>t1 x2 t2 t'. \<lbrakk>\<And>t'. \<lbrakk>Root_Balanced_Tree.split_min t1 = (x, t'); t1 \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal t1) \<le> 1; \<And>t'. \<lbrakk>Root_Balanced_Tree.split_min t2 = (x, t'); t2 \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal t2) \<le> 1; Root_Balanced_Tree.split_min \<langle>t1, x2, t2\<rangle> = (x, t'); \<langle>t1, x2, t2\<rangle> \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal \<langle>t1, x2, t2\<rangle>) \<le> 1
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Root_Balanced_Tree.split_min l = (x, ?t'); l \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal ?t') - real (imbal l) \<le> 1
\<lbrakk>Root_Balanced_Tree.split_min r = (x, ?t'); r \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal ?t') - real (imbal r) \<le> 1
Root_Balanced_Tree.split_min \<langle>l, y, r\<rangle> = (x, t')
\<langle>l, y, r\<rangle> \<noteq> \<langle>\<rangle>

goal (1 subgoal):
 1. real (imbal t') - real (imbal \<langle>l, y, r\<rangle>) \<le> 1
[PROOF STEP]
using size_split_min[OF Node.prems]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Root_Balanced_Tree.split_min l = (x, ?t'); l \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal ?t') - real (imbal l) \<le> 1
\<lbrakk>Root_Balanced_Tree.split_min r = (x, ?t'); r \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal ?t') - real (imbal r) \<le> 1
Root_Balanced_Tree.split_min \<langle>l, y, r\<rangle> = (x, t')
\<langle>l, y, r\<rangle> \<noteq> \<langle>\<rangle>
size t' = size \<langle>l, y, r\<rangle> - 1

goal (1 subgoal):
 1. real (imbal t') - real (imbal \<langle>l, y, r\<rangle>) \<le> 1
[PROOF STEP]
apply(auto split: if_splits option.splits prod.splits)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>\<And>t'. \<lbrakk>Root_Balanced_Tree.split_min t' = (x, t'); t' \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal t') \<le> 1; l = \<langle>\<rangle>; y = x; r = t'\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal \<langle>\<langle>\<rangle>, x, t'\<rangle>) \<le> 1
 2. \<And>x2. \<lbrakk>Suc (size x2) = size l; real (imbal x2) - real (imbal l) \<le> 1; \<And>t'. \<lbrakk>Root_Balanced_Tree.split_min r = (x, t'); r \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal r) \<le> 1; l \<noteq> \<langle>\<rangle>; Root_Balanced_Tree.split_min l = (x, x2); t' = \<langle>x2, y, r\<rangle>\<rbrakk> \<Longrightarrow> real (imbal \<langle>x2, y, r\<rangle>) - real (imbal \<langle>l, y, r\<rangle>) \<le> 1
[PROOF STEP]
apply(auto simp: imbal.simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>t'. \<lbrakk>Root_Balanced_Tree.split_min t' = (x, t'); t' \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal t') \<le> 1; l = \<langle>\<rangle>; y = x; r = t'\<rbrakk> \<Longrightarrow> real (imbal t') - real (size t' - Suc 0) \<le> 1
[PROOF STEP]
apply(cases t')
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>\<And>t'. \<lbrakk>Root_Balanced_Tree.split_min t' = (x, t'); t' \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal t') \<le> 1; l = \<langle>\<rangle>; y = x; r = t'; t' = \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (size t' - Suc 0) \<le> 1
 2. \<And>x21 x22 x23. \<lbrakk>\<And>t'. \<lbrakk>Root_Balanced_Tree.split_min t' = (x, t'); t' \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal t') \<le> 1; l = \<langle>\<rangle>; y = x; r = t'; t' = \<langle>x21, x22, x23\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (size t' - Suc 0) \<le> 1
[PROOF STEP]
apply (simp add: imbal.simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x21 x22 x23. \<lbrakk>\<And>t'. \<lbrakk>Root_Balanced_Tree.split_min t' = (x, t'); t' \<noteq> \<langle>\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (imbal t') \<le> 1; l = \<langle>\<rangle>; y = x; r = t'; t' = \<langle>x21, x22, x23\<rangle>\<rbrakk> \<Longrightarrow> real (imbal t') - real (size t' - Suc 0) \<le> 1
[PROOF STEP]
apply (simp add: imbal.simps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
real (imbal t') - real (imbal \<langle>l, y, r\<rangle>) \<le> 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma conv_radius_eqI_smallomega_smallo:
  fixes f :: "nat \<Rightarrow> 'a :: {real_normed_div_algebra, banach}"
  assumes "\<And>\<epsilon>. \<epsilon> > l \<Longrightarrow> \<epsilon> < inverse C \<Longrightarrow> (\<lambda>n. norm (f n)) \<in> \<omega>(\<lambda>n. \<epsilon> ^ n)"
  assumes "\<And>\<epsilon>. \<epsilon> < u \<Longrightarrow> \<epsilon> > inverse C \<Longrightarrow> (\<lambda>n. norm (f n)) \<in> o(\<lambda>n. \<epsilon> ^ n)"
  assumes C: "C > 0" and lu: "l > 0" "l < inverse C" "u > inverse C"
  shows   "conv_radius f = ereal C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conv_radius f = ereal C
[PROOF STEP]
proof (intro antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. conv_radius f \<le> ereal C
 2. ereal C \<le> conv_radius f
[PROOF STEP]
have "0 < inverse C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < inverse C
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>l < ?\<epsilon>; ?\<epsilon> < inverse C\<rbrakk> \<Longrightarrow> (\<lambda>n. norm (f n)) \<in> \<omega>((^) ?\<epsilon>)
\<lbrakk>?\<epsilon> < u; inverse C < ?\<epsilon>\<rbrakk> \<Longrightarrow> (\<lambda>n. norm (f n)) \<in> o((^) ?\<epsilon>)
0 < C
0 < l
l < inverse C
inverse C < u

goal (1 subgoal):
 1. 0 < inverse C
[PROOF STEP]
by (auto simp: field_simps)
[PROOF STATE]
proof (state)
this:
0 < inverse C

goal (2 subgoals):
 1. conv_radius f \<le> ereal C
 2. ereal C \<le> conv_radius f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
0 < inverse C

goal (2 subgoals):
 1. conv_radius f \<le> ereal C
 2. ereal C \<le> conv_radius f
[PROOF STEP]
have "\<dots> < u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse C < u
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
inverse C < u

goal (2 subgoals):
 1. conv_radius f \<le> ereal C
 2. ereal C \<le> conv_radius f
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
0 < u
[PROOF STEP]
have "u > 0"
[PROOF STATE]
proof (prove)
using this:
0 < u

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

goal (2 subgoals):
 1. conv_radius f \<le> ereal C
 2. ereal C \<le> conv_radius f
[PROOF STEP]
show "conv_radius f \<ge> C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ereal C \<le> conv_radius f
[PROOF STEP]
unfolding conv_radius_altdef le_Liminf_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>y<ereal C. \<forall>\<^sub>F x in sequentially. y < inverse (ereal (root x (norm (f x))))
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. y < ereal C \<Longrightarrow> \<forall>\<^sub>F x in sequentially. y < inverse (ereal (root x (norm (f x))))
[PROOF STEP]
fix c :: ereal
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. y < ereal C \<Longrightarrow> \<forall>\<^sub>F x in sequentially. y < inverse (ereal (root x (norm (f x))))
[PROOF STEP]
assume c: "c < C"
[PROOF STATE]
proof (state)
this:
c < ereal C

goal (1 subgoal):
 1. \<And>y. y < ereal C \<Longrightarrow> \<forall>\<^sub>F x in sequentially. y < inverse (ereal (root x (norm (f x))))
[PROOF STEP]
hence "max c (inverse u) < ereal C"
[PROOF STATE]
proof (prove)
using this:
c < ereal C

goal (1 subgoal):
 1. max c (ereal (inverse u)) < ereal C
[PROOF STEP]
using lu C \<open>u > 0\<close>
[PROOF STATE]
proof (prove)
using this:
c < ereal C
0 < l
l < inverse C
inverse C < u
0 < C
0 < u

goal (1 subgoal):
 1. max c (ereal (inverse u)) < ereal C
[PROOF STEP]
by (auto simp: field_simps)
[PROOF STATE]
proof (state)
this:
max c (ereal (inverse u)) < ereal C

goal (1 subgoal):
 1. \<And>y. y < ereal C \<Longrightarrow> \<forall>\<^sub>F x in sequentially. y < inverse (ereal (root x (norm (f x))))
[PROOF STEP]
from ereal_dense2[OF this]
[PROOF STATE]
proof (chain)
picking this:
\<exists>z. max c (ereal (inverse u)) < ereal z \<and> ereal z < ereal C
[PROOF STEP]
obtain c' where c': "c < ereal c'" "inverse u < c'" "c' < C"
[PROOF STATE]
proof (prove)
using this:
\<exists>z. max c (ereal (inverse u)) < ereal z \<and> ereal z < ereal C

goal (1 subgoal):
 1. (\<And>c'. \<lbrakk>c < ereal c'; inverse u < c'; c' < C\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c < ereal c'
inverse u < c'
c' < C

goal (1 subgoal):
 1. \<And>y. y < ereal C \<Longrightarrow> \<forall>\<^sub>F x in sequentially. y < inverse (ereal (root x (norm (f x))))
[PROOF STEP]
have "inverse u > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < inverse u
[PROOF STEP]
using \<open>u > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < u

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

goal (1 subgoal):
 1. \<And>y. y < ereal C \<Longrightarrow> \<forall>\<^sub>F x in sequentially. y < inverse (ereal (root x (norm (f x))))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
0 < inverse u

goal (1 subgoal):
 1. \<And>y. y < ereal C \<Longrightarrow> \<forall>\<^sub>F x in sequentially. y < inverse (ereal (root x (norm (f x))))
[PROOF STEP]
have "\<dots> < c'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse u < c'
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
inverse u < c'

goal (1 subgoal):
 1. \<And>y. y < ereal C \<Longrightarrow> \<forall>\<^sub>F x in sequentially. y < inverse (ereal (root x (norm (f x))))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
0 < c'
[PROOF STEP]
have "c' > 0"
[PROOF STATE]
proof (prove)
using this:
0 < c'

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

goal (1 subgoal):
 1. \<And>y. y < ereal C \<Longrightarrow> \<forall>\<^sub>F x in sequentially. y < inverse (ereal (root x (norm (f x))))
[PROOF STEP]
have "\<forall>\<^sub>F x in sequentially. norm (norm (f x)) \<le> 1/2 * norm (inverse c' ^ x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. norm (norm (f x)) \<le> 1 / 2 * norm (inverse c' ^ x)
[PROOF STEP]
using landau_o.smallD[OF assms(2)[of "inverse c'"], of "1/2"] c' C lu \<open>c' > 0\<close> c
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>inverse c' < u; inverse C < inverse c'; 0 < 1 / 2\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in sequentially. norm (norm (f x)) \<le> 1 / 2 * norm (inverse c' ^ x)
c < ereal c'
inverse u < c'
c' < C
0 < C
0 < l
l < inverse C
inverse C < u
0 < c'
c < ereal C

goal (1 subgoal):
 1. \<forall>\<^sub>F x in sequentially. norm (norm (f x)) \<le> 1 / 2 * norm (inverse c' ^ x)
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in sequentially. norm (norm (f x)) \<le> 1 / 2 * norm (inverse c' ^ x)

goal (1 subgoal):
 1. \<And>y. y < ereal C \<Longrightarrow> \<forall>\<^sub>F x in sequentially. y < inverse (ereal (root x (norm (f x))))
[PROOF STEP]
thus "\<forall>\<^sub>F n in sequentially. c < inverse (ereal (root n (norm (f n))))"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in sequentially. norm (norm (f x)) \<le> 1 / 2 * norm (inverse c' ^ x)

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. c < inverse (ereal (root n (norm (f n))))
[PROOF STEP]
using eventually_gt_at_top[of 0]
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in sequentially. norm (norm (f x)) \<le> 1 / 2 * norm (inverse c' ^ x)
eventually ((<) (0::?'b1)) at_top

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. c < inverse (ereal (root n (norm (f n))))
[PROOF STEP]
proof eventually_elim
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>norm (norm (f n)) \<le> 1 / 2 * norm (inverse c' ^ n); 0 < n\<rbrakk> \<Longrightarrow> c < inverse (ereal (root n (norm (f n))))
[PROOF STEP]
case (elim n)
[PROOF STATE]
proof (state)
this:
norm (norm (f n)) \<le> 1 / 2 * norm (inverse c' ^ n)
0 < n

goal (1 subgoal):
 1. \<And>n. \<lbrakk>norm (norm (f n)) \<le> 1 / 2 * norm (inverse c' ^ n); 0 < n\<rbrakk> \<Longrightarrow> c < inverse (ereal (root n (norm (f n))))
[PROOF STEP]
have "norm (f n) \<le> 1/2 * norm (inverse c' ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (f n) \<le> 1 / 2 * norm (inverse c' ^ n)
[PROOF STEP]
using c'
[PROOF STATE]
proof (prove)
using this:
c < ereal c'
inverse u < c'
c' < C

goal (1 subgoal):
 1. norm (f n) \<le> 1 / 2 * norm (inverse c' ^ n)
[PROOF STEP]
using elim
[PROOF STATE]
proof (prove)
using this:
c < ereal c'
inverse u < c'
c' < C
norm (norm (f n)) \<le> 1 / 2 * norm (inverse c' ^ n)
0 < n

goal (1 subgoal):
 1. norm (f n) \<le> 1 / 2 * norm (inverse c' ^ n)
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
norm (f n) \<le> 1 / 2 * norm (inverse c' ^ n)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>norm (norm (f n)) \<le> 1 / 2 * norm (inverse c' ^ n); 0 < n\<rbrakk> \<Longrightarrow> c < inverse (ereal (root n (norm (f n))))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (f n) \<le> 1 / 2 * norm (inverse c' ^ n)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>norm (norm (f n)) \<le> 1 / 2 * norm (inverse c' ^ n); 0 < n\<rbrakk> \<Longrightarrow> c < inverse (ereal (root n (norm (f n))))
[PROOF STEP]
have "\<dots> < norm (inverse c' ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 / 2 * norm (inverse c' ^ n) < norm (inverse c' ^ n)
[PROOF STEP]
using \<open>c' > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < c'

goal (1 subgoal):
 1. 1 / 2 * norm (inverse c' ^ n) < norm (inverse c' ^ n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
1 / 2 * norm (inverse c' ^ n) < norm (inverse c' ^ n)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>norm (norm (f n)) \<le> 1 / 2 * norm (inverse c' ^ n); 0 < n\<rbrakk> \<Longrightarrow> c < inverse (ereal (root n (norm (f n))))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
norm (f n) < norm (inverse c' ^ n)
[PROOF STEP]
have "root n (norm (f n)) < root n (norm (inverse c' ^ n))"
[PROOF STATE]
proof (prove)
using this:
norm (f n) < norm (inverse c' ^ n)

goal (1 subgoal):
 1. root n (norm (f n)) < root n (norm (inverse c' ^ n))
[PROOF STEP]
using \<open>n > 0\<close> c'
[PROOF STATE]
proof (prove)
using this:
norm (f n) < norm (inverse c' ^ n)
0 < n
c < ereal c'
inverse u < c'
c' < C

goal (1 subgoal):
 1. root n (norm (f n)) < root n (norm (inverse c' ^ n))
[PROOF STEP]
by (intro real_root_less_mono) auto
[PROOF STATE]
proof (state)
this:
root n (norm (f n)) < root n (norm (inverse c' ^ n))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>norm (norm (f n)) \<le> 1 / 2 * norm (inverse c' ^ n); 0 < n\<rbrakk> \<Longrightarrow> c < inverse (ereal (root n (norm (f n))))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
root n (norm (f n)) < root n (norm (inverse c' ^ n))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>norm (norm (f n)) \<le> 1 / 2 * norm (inverse c' ^ n); 0 < n\<rbrakk> \<Longrightarrow> c < inverse (ereal (root n (norm (f n))))
[PROOF STEP]
have "root n (norm (inverse c' ^ n)) = inverse c'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. root n (norm (inverse c' ^ n)) = inverse c'
[PROOF STEP]
using \<open>n > 0\<close> \<open>c' > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < n
0 < c'

goal (1 subgoal):
 1. root n (norm (inverse c' ^ n)) = inverse c'
[PROOF STEP]
by (simp add: norm_power real_root_power)
[PROOF STATE]
proof (state)
this:
root n (norm (inverse c' ^ n)) = inverse c'

goal (1 subgoal):
 1. \<And>n. \<lbrakk>norm (norm (f n)) \<le> 1 / 2 * norm (inverse c' ^ n); 0 < n\<rbrakk> \<Longrightarrow> c < inverse (ereal (root n (norm (f n))))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
root n (norm (f n)) < inverse c'
[PROOF STEP]
have "ereal (root n (norm (f n))) < ereal (inverse c')"
[PROOF STATE]
proof (prove)
using this:
root n (norm (f n)) < inverse c'

goal (1 subgoal):
 1. ereal (root n (norm (f n))) < ereal (inverse c')
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ereal (root n (norm (f n))) < ereal (inverse c')

goal (1 subgoal):
 1. \<And>n. \<lbrakk>norm (norm (f n)) \<le> 1 / 2 * norm (inverse c' ^ n); 0 < n\<rbrakk> \<Longrightarrow> c < inverse (ereal (root n (norm (f n))))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ereal (root n (norm (f n))) < ereal (inverse c')

goal (1 subgoal):
 1. \<And>n. \<lbrakk>norm (norm (f n)) \<le> 1 / 2 * norm (inverse c' ^ n); 0 < n\<rbrakk> \<Longrightarrow> c < inverse (ereal (root n (norm (f n))))
[PROOF STEP]
have "\<dots> = inverse (ereal c')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ereal (inverse c') = inverse (ereal c')
[PROOF STEP]
using \<open>c' > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < c'

goal (1 subgoal):
 1. ereal (inverse c') = inverse (ereal c')
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ereal (inverse c') = inverse (ereal c')

goal (1 subgoal):
 1. \<And>n. \<lbrakk>norm (norm (f n)) \<le> 1 / 2 * norm (inverse c' ^ n); 0 < n\<rbrakk> \<Longrightarrow> c < inverse (ereal (root n (norm (f n))))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
ereal (root n (norm (f n))) < inverse (ereal c')
[PROOF STEP]
have "inverse (inverse (ereal c')) < inverse (ereal (root n (norm (f n))))"
[PROOF STATE]
proof (prove)
using this:
ereal (root n (norm (f n))) < inverse (ereal c')

goal (1 subgoal):
 1. inverse (inverse (ereal c')) < inverse (ereal (root n (norm (f n))))
[PROOF STEP]
using c' \<open>n > 0\<close>
[PROOF STATE]
proof (prove)
using this:
ereal (root n (norm (f n))) < inverse (ereal c')
c < ereal c'
inverse u < c'
c' < C
0 < n

goal (1 subgoal):
 1. inverse (inverse (ereal c')) < inverse (ereal (root n (norm (f n))))
[PROOF STEP]
by (intro ereal_inverse_antimono_strict) auto
[PROOF STATE]
proof (state)
this:
inverse (inverse (ereal c')) < inverse (ereal (root n (norm (f n))))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>norm (norm (f n)) \<le> 1 / 2 * norm (inverse c' ^ n); 0 < n\<rbrakk> \<Longrightarrow> c < inverse (ereal (root n (norm (f n))))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
inverse (inverse (ereal c')) < inverse (ereal (root n (norm (f n))))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>norm (norm (f n)) \<le> 1 / 2 * norm (inverse c' ^ n); 0 < n\<rbrakk> \<Longrightarrow> c < inverse (ereal (root n (norm (f n))))
[PROOF STEP]
have "inverse (inverse (ereal c')) = ereal c'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse (inverse (ereal c')) = ereal c'
[PROOF STEP]
using c'
[PROOF STATE]
proof (prove)
using this:
c < ereal c'
inverse u < c'
c' < C

goal (1 subgoal):
 1. inverse (inverse (ereal c')) = ereal c'
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
inverse (inverse (ereal c')) = ereal c'

goal (1 subgoal):
 1. \<And>n. \<lbrakk>norm (norm (f n)) \<le> 1 / 2 * norm (inverse c' ^ n); 0 < n\<rbrakk> \<Longrightarrow> c < inverse (ereal (root n (norm (f n))))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
ereal c' < inverse (ereal (root n (norm (f n))))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
ereal c' < inverse (ereal (root n (norm (f n))))

goal (1 subgoal):
 1. c < inverse (ereal (root n (norm (f n))))
[PROOF STEP]
using \<open>c < c'\<close>
[PROOF STATE]
proof (prove)
using this:
ereal c' < inverse (ereal (root n (norm (f n))))
c < ereal c'

goal (1 subgoal):
 1. c < inverse (ereal (root n (norm (f n))))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
c < inverse (ereal (root n (norm (f n))))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. c < inverse (ereal (root n (norm (f n))))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
ereal C \<le> conv_radius f

goal (1 subgoal):
 1. conv_radius f \<le> ereal C
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. conv_radius f \<le> ereal C
[PROOF STEP]
show "conv_radius f \<le> C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conv_radius f \<le> ereal C
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> conv_radius f \<le> ereal C \<Longrightarrow> False
[PROOF STEP]
assume "\<not>(conv_radius f \<le> C)"
[PROOF STATE]
proof (state)
this:
\<not> conv_radius f \<le> ereal C

goal (1 subgoal):
 1. \<not> conv_radius f \<le> ereal C \<Longrightarrow> False
[PROOF STEP]
hence "conv_radius f > C"
[PROOF STATE]
proof (prove)
using this:
\<not> conv_radius f \<le> ereal C

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

goal (1 subgoal):
 1. \<not> conv_radius f \<le> ereal C \<Longrightarrow> False
[PROOF STEP]
hence "min (conv_radius f) (inverse l) > ereal C"
[PROOF STATE]
proof (prove)
using this:
ereal C < conv_radius f

goal (1 subgoal):
 1. ereal C < min (conv_radius f) (ereal (inverse l))
[PROOF STEP]
using lu C \<open>l > 0\<close>
[PROOF STATE]
proof (prove)
using this:
ereal C < conv_radius f
0 < l
l < inverse C
inverse C < u
0 < C
0 < l

goal (1 subgoal):
 1. ereal C < min (conv_radius f) (ereal (inverse l))
[PROOF STEP]
by (auto simp: field_simps)
[PROOF STATE]
proof (state)
this:
ereal C < min (conv_radius f) (ereal (inverse l))

goal (1 subgoal):
 1. \<not> conv_radius f \<le> ereal C \<Longrightarrow> False
[PROOF STEP]
from ereal_dense2[OF this]
[PROOF STATE]
proof (chain)
picking this:
\<exists>z. ereal C < ereal z \<and> ereal z < min (conv_radius f) (ereal (inverse l))
[PROOF STEP]
obtain c where c: "C < ereal c" "inverse l > c" "c < conv_radius f"
[PROOF STATE]
proof (prove)
using this:
\<exists>z. ereal C < ereal z \<and> ereal z < min (conv_radius f) (ereal (inverse l))

goal (1 subgoal):
 1. (\<And>c. \<lbrakk>ereal C < ereal c; c < inverse l; ereal c < conv_radius f\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ereal C < ereal c
c < inverse l
ereal c < conv_radius f

goal (1 subgoal):
 1. \<not> conv_radius f \<le> ereal C \<Longrightarrow> False
[PROOF STEP]
hence "c > 0"
[PROOF STATE]
proof (prove)
using this:
ereal C < ereal c
c < inverse l
ereal c < conv_radius f

goal (1 subgoal):
 1. 0 < c
[PROOF STEP]
using lu C
[PROOF STATE]
proof (prove)
using this:
ereal C < ereal c
c < inverse l
ereal c < conv_radius f
0 < l
l < inverse C
inverse C < u
0 < C

goal (1 subgoal):
 1. 0 < c
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
0 < c

goal (1 subgoal):
 1. \<not> conv_radius f \<le> ereal C \<Longrightarrow> False
[PROOF STEP]
have "\<forall>\<^sub>F n in sequentially. ereal c < inverse (ereal (root n (norm (f n))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. ereal c < inverse (ereal (root n (norm (f n))))
[PROOF STEP]
using less_LiminfD[OF c(3)[unfolded conv_radius_altdef]]
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in sequentially. ereal c < inverse (ereal (root x (norm (f x))))

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. ereal c < inverse (ereal (root n (norm (f n))))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. ereal c < inverse (ereal (root n (norm (f n))))

goal (1 subgoal):
 1. \<not> conv_radius f \<le> ereal C \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. ereal c < inverse (ereal (root n (norm (f n))))

goal (1 subgoal):
 1. \<not> conv_radius f \<le> ereal C \<Longrightarrow> False
[PROOF STEP]
have "\<forall>\<^sub>F n in sequentially. norm (f n) \<ge> 2 * norm (inverse c ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 2 * norm (inverse c ^ n) \<le> norm (f n)
[PROOF STEP]
using landau_omega.smallD[OF assms(1)[of "inverse c"], of 2] c C \<open>c > 0\<close> lu
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>l < inverse c; inverse c < inverse C; 0 < 2\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in sequentially. 2 * norm (inverse c ^ x) \<le> norm (norm (f x))
ereal C < ereal c
c < inverse l
ereal c < conv_radius f
0 < C
0 < c
0 < l
l < inverse C
inverse C < u

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. 2 * norm (inverse c ^ n) \<le> norm (f n)
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. 2 * norm (inverse c ^ n) \<le> norm (f n)

goal (1 subgoal):
 1. \<not> conv_radius f \<le> ereal C \<Longrightarrow> False
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. ereal c < inverse (ereal (root n (norm (f n))))
\<forall>\<^sub>F n in sequentially. 2 * norm (inverse c ^ n) \<le> norm (f n)
[PROOF STEP]
have "eventually (\<lambda>n. False) sequentially"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. ereal c < inverse (ereal (root n (norm (f n))))
\<forall>\<^sub>F n in sequentially. 2 * norm (inverse c ^ n) \<le> norm (f n)

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. False
[PROOF STEP]
using eventually_gt_at_top[of 0]
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. ereal c < inverse (ereal (root n (norm (f n))))
\<forall>\<^sub>F n in sequentially. 2 * norm (inverse c ^ n) \<le> norm (f n)
eventually ((<) (0::?'b1)) at_top

goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. False
[PROOF STEP]
proof eventually_elim
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>ereal c < inverse (ereal (root n (norm (f n)))); 2 * norm (inverse c ^ n) \<le> norm (f n); 0 < n\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
case (elim n)
[PROOF STATE]
proof (state)
this:
ereal c < inverse (ereal (root n (norm (f n))))
2 * norm (inverse c ^ n) \<le> norm (f n)
0 < n

goal (1 subgoal):
 1. \<And>n. \<lbrakk>ereal c < inverse (ereal (root n (norm (f n)))); 2 * norm (inverse c ^ n) \<le> norm (f n); 0 < n\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
have "norm (inverse c ^ n) < 2 * norm (inverse c ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (inverse c ^ n) < 2 * norm (inverse c ^ n)
[PROOF STEP]
using c \<open>n > 0\<close> C
[PROOF STATE]
proof (prove)
using this:
ereal C < ereal c
c < inverse l
ereal c < conv_radius f
0 < n
0 < C

goal (1 subgoal):
 1. norm (inverse c ^ n) < 2 * norm (inverse c ^ n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
norm (inverse c ^ n) < 2 * norm (inverse c ^ n)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>ereal c < inverse (ereal (root n (norm (f n)))); 2 * norm (inverse c ^ n) \<le> norm (f n); 0 < n\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (inverse c ^ n) < 2 * norm (inverse c ^ n)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>ereal c < inverse (ereal (root n (norm (f n)))); 2 * norm (inverse c ^ n) \<le> norm (f n); 0 < n\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
have "\<dots> \<le> norm (f n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * norm (inverse c ^ n) \<le> norm (f n)
[PROOF STEP]
using elim
[PROOF STATE]
proof (prove)
using this:
ereal c < inverse (ereal (root n (norm (f n))))
2 * norm (inverse c ^ n) \<le> norm (f n)
0 < n

goal (1 subgoal):
 1. 2 * norm (inverse c ^ n) \<le> norm (f n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
2 * norm (inverse c ^ n) \<le> norm (f n)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>ereal c < inverse (ereal (root n (norm (f n)))); 2 * norm (inverse c ^ n) \<le> norm (f n); 0 < n\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
norm (inverse c ^ n) < norm (f n)
[PROOF STEP]
have "root n (inverse c ^ n) < root n (norm (f n))"
[PROOF STATE]
proof (prove)
using this:
norm (inverse c ^ n) < norm (f n)

goal (1 subgoal):
 1. root n (inverse c ^ n) < root n (norm (f n))
[PROOF STEP]
using \<open>n > 0\<close>
[PROOF STATE]
proof (prove)
using this:
norm (inverse c ^ n) < norm (f n)
0 < n

goal (1 subgoal):
 1. root n (inverse c ^ n) < root n (norm (f n))
[PROOF STEP]
by (intro real_root_less_mono) auto
[PROOF STATE]
proof (state)
this:
root n (inverse c ^ n) < root n (norm (f n))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>ereal c < inverse (ereal (root n (norm (f n)))); 2 * norm (inverse c ^ n) \<le> norm (f n); 0 < n\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
root n (inverse c ^ n) < root n (norm (f n))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>ereal c < inverse (ereal (root n (norm (f n)))); 2 * norm (inverse c ^ n) \<le> norm (f n); 0 < n\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
have "root n (inverse c ^ n) = inverse c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. root n (inverse c ^ n) = inverse c
[PROOF STEP]
using \<open>n > 0\<close> c C
[PROOF STATE]
proof (prove)
using this:
0 < n
ereal C < ereal c
c < inverse l
ereal c < conv_radius f
0 < C

goal (1 subgoal):
 1. root n (inverse c ^ n) = inverse c
[PROOF STEP]
by (subst real_root_power) auto
[PROOF STATE]
proof (state)
this:
root n (inverse c ^ n) = inverse c

goal (1 subgoal):
 1. \<And>n. \<lbrakk>ereal c < inverse (ereal (root n (norm (f n)))); 2 * norm (inverse c ^ n) \<le> norm (f n); 0 < n\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
inverse c < root n (norm (f n))
[PROOF STEP]
have "ereal (inverse c) < ereal (root n (norm (f n)))"
[PROOF STATE]
proof (prove)
using this:
inverse c < root n (norm (f n))

goal (1 subgoal):
 1. ereal (inverse c) < ereal (root n (norm (f n)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ereal (inverse c) < ereal (root n (norm (f n)))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>ereal c < inverse (ereal (root n (norm (f n)))); 2 * norm (inverse c ^ n) \<le> norm (f n); 0 < n\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ereal (inverse c) < ereal (root n (norm (f n)))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>ereal c < inverse (ereal (root n (norm (f n)))); 2 * norm (inverse c ^ n) \<le> norm (f n); 0 < n\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
have "ereal (inverse c) = inverse (ereal c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ereal (inverse c) = inverse (ereal c)
[PROOF STEP]
using c C
[PROOF STATE]
proof (prove)
using this:
ereal C < ereal c
c < inverse l
ereal c < conv_radius f
0 < C

goal (1 subgoal):
 1. ereal (inverse c) = inverse (ereal c)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ereal (inverse c) = inverse (ereal c)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>ereal c < inverse (ereal (root n (norm (f n)))); 2 * norm (inverse c ^ n) \<le> norm (f n); 0 < n\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
inverse (ereal c) < ereal (root n (norm (f n)))
[PROOF STEP]
have "inverse (ereal (root n (norm (f n)))) < inverse (inverse (ereal c))"
[PROOF STATE]
proof (prove)
using this:
inverse (ereal c) < ereal (root n (norm (f n)))

goal (1 subgoal):
 1. inverse (ereal (root n (norm (f n)))) < inverse (inverse (ereal c))
[PROOF STEP]
using c C
[PROOF STATE]
proof (prove)
using this:
inverse (ereal c) < ereal (root n (norm (f n)))
ereal C < ereal c
c < inverse l
ereal c < conv_radius f
0 < C

goal (1 subgoal):
 1. inverse (ereal (root n (norm (f n)))) < inverse (inverse (ereal c))
[PROOF STEP]
by (intro ereal_inverse_antimono_strict) auto
[PROOF STATE]
proof (state)
this:
inverse (ereal (root n (norm (f n)))) < inverse (inverse (ereal c))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>ereal c < inverse (ereal (root n (norm (f n)))); 2 * norm (inverse c ^ n) \<le> norm (f n); 0 < n\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
inverse (ereal (root n (norm (f n)))) < inverse (inverse (ereal c))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>ereal c < inverse (ereal (root n (norm (f n)))); 2 * norm (inverse c ^ n) \<le> norm (f n); 0 < n\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
have "\<dots> = ereal c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse (inverse (ereal c)) = ereal c
[PROOF STEP]
using c C
[PROOF STATE]
proof (prove)
using this:
ereal C < ereal c
c < inverse l
ereal c < conv_radius f
0 < C

goal (1 subgoal):
 1. inverse (inverse (ereal c)) = ereal c
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inverse (inverse (ereal c)) = ereal c

goal (1 subgoal):
 1. \<And>n. \<lbrakk>ereal c < inverse (ereal (root n (norm (f n)))); 2 * norm (inverse c ^ n) \<le> norm (f n); 0 < n\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
inverse (inverse (ereal c)) = ereal c

goal (1 subgoal):
 1. \<And>n. \<lbrakk>ereal c < inverse (ereal (root n (norm (f n)))); 2 * norm (inverse c ^ n) \<le> norm (f n); 0 < n\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
have "\<dots> < inverse (ereal (root n (norm (f n))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ereal c < inverse (ereal (root n (norm (f n))))
[PROOF STEP]
using elim
[PROOF STATE]
proof (prove)
using this:
ereal c < inverse (ereal (root n (norm (f n))))
2 * norm (inverse c ^ n) \<le> norm (f n)
0 < n

goal (1 subgoal):
 1. ereal c < inverse (ereal (root n (norm (f n))))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ereal c < inverse (ereal (root n (norm (f n))))

goal (1 subgoal):
 1. \<And>n. \<lbrakk>ereal c < inverse (ereal (root n (norm (f n)))); 2 * norm (inverse c ^ n) \<le> norm (f n); 0 < n\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
?P
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
?P

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. False

goal (1 subgoal):
 1. \<not> conv_radius f \<le> ereal C \<Longrightarrow> False
[PROOF STEP]
thus False
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. False

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
conv_radius f \<le> ereal C

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lconsts_freshen: "lconsts (freshen a f) = freshenLC a ` lconsts f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lconsts (freshen a f) = freshenLC a ` lconsts f
[PROOF STEP]
unfolding freshen_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lconsts (renameLCs (freshenLC a) f) = freshenLC a ` lconsts f
[PROOF STEP]
by (rule lconsts_renameLCs)


[STATEMENT]
lemma rel_sym:
  assumes "x \<sim> y" "x \<in> R \<times> S" "y \<in> R \<times> S" shows "y \<sim> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<sim> x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. y \<sim> x
[PROOF STEP]
obtain rx sx ry sy s
    where \<section>: "rx \<in> R" "sx \<in> S" "ry \<in> R" "s \<in> S" "sy \<in> S" "s \<cdot> (sy \<cdot> rx - sx \<cdot> ry) = \<zero>" "x = (rx,sx)" "y = (ry,sy)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>rx sx ry s sy. \<lbrakk>rx \<in> R; sx \<in> S; ry \<in> R; s \<in> S; sy \<in> S; s \<cdot> (sy \<cdot> rx - sx \<cdot> ry) = \<zero>; x = (rx, sx); y = (ry, sy)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<sim> y
x \<in> R \<times> S
y \<in> R \<times> S

goal (1 subgoal):
 1. (\<And>rx sx ry s sy. \<lbrakk>rx \<in> R; sx \<in> S; ry \<in> R; s \<in> S; sy \<in> S; s \<cdot> (sy \<cdot> rx - sx \<cdot> ry) = \<zero>; x = (rx, sx); y = (ry, sy)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: rel_def)
[PROOF STATE]
proof (state)
this:
rx \<in> R
sx \<in> S
ry \<in> R
s \<in> S
sy \<in> S
s \<cdot> (sy \<cdot> rx - sx \<cdot> ry) = \<zero>
x = (rx, sx)
y = (ry, sy)

goal (1 subgoal):
 1. y \<sim> x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rx \<in> R
sx \<in> S
ry \<in> R
s \<in> S
sy \<in> S
s \<cdot> (sy \<cdot> rx - sx \<cdot> ry) = \<zero>
x = (rx, sx)
y = (ry, sy)
[PROOF STEP]
have "s \<cdot> (sx \<cdot> ry - sy \<cdot> rx) = \<zero>"
[PROOF STATE]
proof (prove)
using this:
rx \<in> R
sx \<in> S
ry \<in> R
s \<in> S
sy \<in> S
s \<cdot> (sy \<cdot> rx - sx \<cdot> ry) = \<zero>
x = (rx, sx)
y = (ry, sy)

goal (1 subgoal):
 1. s \<cdot> (sx \<cdot> ry - sy \<cdot> rx) = \<zero>
[PROOF STEP]
by (metis sub comm.additive.cancel_imp_equal comm.inverse_distributive(1) comm.multiplicative.composition_closed)
[PROOF STATE]
proof (state)
this:
s \<cdot> (sx \<cdot> ry - sy \<cdot> rx) = \<zero>

goal (1 subgoal):
 1. y \<sim> x
[PROOF STEP]
with \<section>
[PROOF STATE]
proof (chain)
picking this:
rx \<in> R
sx \<in> S
ry \<in> R
s \<in> S
sy \<in> S
s \<cdot> (sy \<cdot> rx - sx \<cdot> ry) = \<zero>
x = (rx, sx)
y = (ry, sy)
s \<cdot> (sx \<cdot> ry - sy \<cdot> rx) = \<zero>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
rx \<in> R
sx \<in> S
ry \<in> R
s \<in> S
sy \<in> S
s \<cdot> (sy \<cdot> rx - sx \<cdot> ry) = \<zero>
x = (rx, sx)
y = (ry, sy)
s \<cdot> (sx \<cdot> ry - sy \<cdot> rx) = \<zero>

goal (1 subgoal):
 1. y \<sim> x
[PROOF STEP]
by (auto simp: rel_def)
[PROOF STATE]
proof (state)
this:
y \<sim> x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ex_incl_iff_subset:
    assumes "ide a" and "ide b"
    shows "(\<exists>f. \<guillemotleft>f : a \<rightarrow> b\<guillemotright> \<and> incl f) \<longleftrightarrow> set a \<subseteq> set b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>f. \<guillemotleft>f : a \<rightarrow> b\<guillemotright> \<and> incl f) = (local.set a \<subseteq> local.set b)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>f. \<guillemotleft>f : a \<rightarrow> b\<guillemotright> \<and> incl f \<Longrightarrow> local.set a \<subseteq> local.set b
 2. local.set a \<subseteq> local.set b \<Longrightarrow> \<exists>f. \<guillemotleft>f : a \<rightarrow> b\<guillemotright> \<and> incl f
[PROOF STEP]
show "\<exists>f. \<guillemotleft>f : a \<rightarrow> b\<guillemotright> \<and> incl f \<Longrightarrow> set a \<subseteq> set b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f. \<guillemotleft>f : a \<rightarrow> b\<guillemotright> \<and> incl f \<Longrightarrow> local.set a \<subseteq> local.set b
[PROOF STEP]
using incl_def
[PROOF STATE]
proof (prove)
using this:
incl ?f = (arr ?f \<and> local.set (local.dom ?f) \<subseteq> local.set (cod ?f) \<and> ?f = mkArr (local.set (local.dom ?f)) (local.set (cod ?f)) (\<lambda>x. x))

goal (1 subgoal):
 1. \<exists>f. \<guillemotleft>f : a \<rightarrow> b\<guillemotright> \<and> incl f \<Longrightarrow> local.set a \<subseteq> local.set b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>f. \<guillemotleft>f : a \<rightarrow> b\<guillemotright> \<and> incl f \<Longrightarrow> local.set a \<subseteq> local.set b

goal (1 subgoal):
 1. local.set a \<subseteq> local.set b \<Longrightarrow> \<exists>f. \<guillemotleft>f : a \<rightarrow> b\<guillemotright> \<and> incl f
[PROOF STEP]
show "set a \<subseteq> set b \<Longrightarrow> \<exists>f. \<guillemotleft>f : a \<rightarrow> b\<guillemotright> \<and> incl f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.set a \<subseteq> local.set b \<Longrightarrow> \<exists>f. \<guillemotleft>f : a \<rightarrow> b\<guillemotright> \<and> incl f
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. local.set a \<subseteq> local.set b \<Longrightarrow> \<guillemotleft>?f : a \<rightarrow> b\<guillemotright> \<and> incl ?f
[PROOF STEP]
assume 1: "set a \<subseteq> set b"
[PROOF STATE]
proof (state)
this:
local.set a \<subseteq> local.set b

goal (1 subgoal):
 1. local.set a \<subseteq> local.set b \<Longrightarrow> \<guillemotleft>?f : a \<rightarrow> b\<guillemotright> \<and> incl ?f
[PROOF STEP]
show "\<guillemotleft>mkArr (set a) (set b) (\<lambda>x. x) : a \<rightarrow> b\<guillemotright> \<and> incl (mkArr (set a) (set b) (\<lambda>x. x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<guillemotleft>mkArr (local.set a) (local.set b) (\<lambda>x. x) : a \<rightarrow> b\<guillemotright> \<and> incl (mkArr (local.set a) (local.set b) (\<lambda>x. x))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<guillemotleft>mkArr (local.set a) (local.set b) (\<lambda>x. x) : a \<rightarrow> b\<guillemotright>
 2. incl (mkArr (local.set a) (local.set b) (\<lambda>x. x))
[PROOF STEP]
show "\<guillemotleft>mkArr (set a) (set b) (\<lambda>x. x) : a \<rightarrow> b\<guillemotright>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<guillemotleft>mkArr (local.set a) (local.set b) (\<lambda>x. x) : a \<rightarrow> b\<guillemotright>
[PROOF STEP]
by (metis 1 assms image_ident image_subset_iff_funcset mkIde_set
                mkArr_in_hom setp_set_ide)
[PROOF STATE]
proof (state)
this:
\<guillemotleft>mkArr (local.set a) (local.set b) (\<lambda>x. x) : a \<rightarrow> b\<guillemotright>

goal (1 subgoal):
 1. incl (mkArr (local.set a) (local.set b) (\<lambda>x. x))
[PROOF STEP]
thus "incl (mkArr (set a) (set b) (\<lambda>x. x))"
[PROOF STATE]
proof (prove)
using this:
\<guillemotleft>mkArr (local.set a) (local.set b) (\<lambda>x. x) : a \<rightarrow> b\<guillemotright>

goal (1 subgoal):
 1. incl (mkArr (local.set a) (local.set b) (\<lambda>x. x))
[PROOF STEP]
using 1 incl_def
[PROOF STATE]
proof (prove)
using this:
\<guillemotleft>mkArr (local.set a) (local.set b) (\<lambda>x. x) : a \<rightarrow> b\<guillemotright>
local.set a \<subseteq> local.set b
incl ?f = (arr ?f \<and> local.set (local.dom ?f) \<subseteq> local.set (cod ?f) \<and> ?f = mkArr (local.set (local.dom ?f)) (local.set (cod ?f)) (\<lambda>x. x))

goal (1 subgoal):
 1. incl (mkArr (local.set a) (local.set b) (\<lambda>x. x))
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
incl (mkArr (local.set a) (local.set b) (\<lambda>x. x))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<guillemotleft>mkArr (local.set a) (local.set b) (\<lambda>x. x) : a \<rightarrow> b\<guillemotright> \<and> incl (mkArr (local.set a) (local.set b) (\<lambda>x. x))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
local.set a \<subseteq> local.set b \<Longrightarrow> \<exists>f. \<guillemotleft>f : a \<rightarrow> b\<guillemotright> \<and> incl f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma SUPSEQ_regular:
  fixes A::"'a::finite lang"
  assumes "regular A"
  shows "regular (SUPSEQ A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. regular (SUPSEQ A)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. regular (SUPSEQ A)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
regular A
[PROOF STEP]
obtain r::"'a::finite rexp" where "lang r = A"
[PROOF STATE]
proof (prove)
using this:
regular A

goal (1 subgoal):
 1. (\<And>r. lang r = A \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lang r = A

goal (1 subgoal):
 1. regular (SUPSEQ A)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
lang r = A
[PROOF STEP]
have "lang (UP r) = SUPSEQ A"
[PROOF STATE]
proof (prove)
using this:
lang r = A

goal (1 subgoal):
 1. lang (UP r) = SUPSEQ A
[PROOF STEP]
by (simp add: lang_UP)
[PROOF STATE]
proof (state)
this:
lang (UP r) = SUPSEQ A

goal (1 subgoal):
 1. regular (SUPSEQ A)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
lang (UP r) = SUPSEQ A
[PROOF STEP]
show "regular (SUPSEQ A)"
[PROOF STATE]
proof (prove)
using this:
lang (UP r) = SUPSEQ A

goal (1 subgoal):
 1. regular (SUPSEQ A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
regular (SUPSEQ A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prod_eq_linorder[intro?]:
  assumes "eq_linorder_on D1 cmp1"
  assumes "eq_linorder_on D2 cmp2"
  shows "eq_linorder_on (D1\<times>D2) (cmp_prod cmp1 cmp2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eq_linorder_on (D1 \<times> D2) (cmp_prod cmp1 cmp2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. eq_linorder_on (D1 \<times> D2) (cmp_prod cmp1 cmp2)
[PROOF STEP]
interpret A: eq_linorder_on D1 cmp1
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eq_linorder_on D1 cmp1
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. eq_linorder_on (D1 \<times> D2) (cmp_prod cmp1 cmp2)
[PROOF STEP]
interpret B: eq_linorder_on D2 cmp2
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eq_linorder_on D2 cmp2
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. eq_linorder_on (D1 \<times> D2) (cmp_prod cmp1 cmp2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eq_linorder_on (D1 \<times> D2) (cmp_prod cmp1 cmp2)
[PROOF STEP]
apply (rule eq_linorder_on.intro)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. linorder_on (D1 \<times> D2) (cmp_prod cmp1 cmp2)
 2. eq_linorder_on_axioms (D1 \<times> D2) (cmp_prod cmp1 cmp2)
[PROOF STEP]
apply rule
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. linorder_on D1 cmp1
 2. linorder_on D2 cmp2
 3. eq_linorder_on_axioms (D1 \<times> D2) (cmp_prod cmp1 cmp2)
[PROOF STEP]
apply unfold_locales
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> D1 \<times> D2; y \<in> D1 \<times> D2; cmp_prod cmp1 cmp2 x y = EQUAL\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
apply (auto split: comp_res.splits)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
eq_linorder_on (D1 \<times> D2) (cmp_prod cmp1 cmp2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem Decrypt_Decrypt_eq [iff]:
  shows "(Decrypt K X = Decrypt K X') = (X=X')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Decrypt K X = Decrypt K X') = (X = X')
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Decrypt K X = Decrypt K X' \<Longrightarrow> X = X'
 2. X = X' \<Longrightarrow> Decrypt K X = Decrypt K X'
[PROOF STEP]
assume "Decrypt K X = Decrypt K X'"
[PROOF STATE]
proof (state)
this:
Decrypt K X = Decrypt K X'

goal (2 subgoals):
 1. Decrypt K X = Decrypt K X' \<Longrightarrow> X = X'
 2. X = X' \<Longrightarrow> Decrypt K X = Decrypt K X'
[PROOF STEP]
hence "Crypt K (Decrypt K X) = Crypt K (Decrypt K X')"
[PROOF STATE]
proof (prove)
using this:
Decrypt K X = Decrypt K X'

goal (1 subgoal):
 1. Crypt K (Decrypt K X) = Crypt K (Decrypt K X')
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Crypt K (Decrypt K X) = Crypt K (Decrypt K X')

goal (2 subgoals):
 1. Decrypt K X = Decrypt K X' \<Longrightarrow> X = X'
 2. X = X' \<Longrightarrow> Decrypt K X = Decrypt K X'
[PROOF STEP]
thus "X = X'"
[PROOF STATE]
proof (prove)
using this:
Crypt K (Decrypt K X) = Crypt K (Decrypt K X')

goal (1 subgoal):
 1. X = X'
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
X = X'

goal (1 subgoal):
 1. X = X' \<Longrightarrow> Decrypt K X = Decrypt K X'
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. X = X' \<Longrightarrow> Decrypt K X = Decrypt K X'
[PROOF STEP]
assume "X = X'"
[PROOF STATE]
proof (state)
this:
X = X'

goal (1 subgoal):
 1. X = X' \<Longrightarrow> Decrypt K X = Decrypt K X'
[PROOF STEP]
thus "Decrypt K X = Decrypt K X'"
[PROOF STATE]
proof (prove)
using this:
X = X'

goal (1 subgoal):
 1. Decrypt K X = Decrypt K X'
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Decrypt K X = Decrypt K X'

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in group) cosets_finite:
     "\<lbrakk>c \<in> rcosets H;  H \<subseteq> carrier G;  finite (carrier G)\<rbrakk> \<Longrightarrow> finite c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>c \<in> rcosets H; H \<subseteq> carrier G; finite (carrier G)\<rbrakk> \<Longrightarrow> finite c
[PROOF STEP]
unfolding RCOSETS_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>c \<in> (\<Union>a\<in>carrier G. {H #> a}); H \<subseteq> carrier G; finite (carrier G)\<rbrakk> \<Longrightarrow> finite c
[PROOF STEP]
by (auto simp add: r_coset_subset_G [THEN finite_subset])


[STATEMENT]
lemma i_map2_cong: "
  \<lbrakk> xs1 = xs2; ys1 = ys2;
    \<And>x y. \<lbrakk> x \<in> range xs2; y \<in> range ys2 \<rbrakk> \<Longrightarrow> f x y = g x y \<rbrakk> \<Longrightarrow>
  i_map2 f xs1 ys1 = i_map2 g xs2 ys2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>xs1 = xs2; ys1 = ys2; \<And>x y. \<lbrakk>x \<in> range xs2; y \<in> range ys2\<rbrakk> \<Longrightarrow> f x y = g x y\<rbrakk> \<Longrightarrow> i_map2 f xs1 ys1 = i_map2 g xs2 ys2
[PROOF STEP]
by (simp add: fun_eq_iff i_map2_nth)


[STATEMENT]
lemma inj_on_funpow_dist1:
  assumes "y \<in> orbit f x" shows "inj_on (\<lambda>n. (f ^^ n) x) {0..<funpow_dist1 f x y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (\<lambda>n. (f ^^ n) x) {0..<funpow_dist1 f x y}
[PROOF STEP]
using funpow_neq_less_funpow_dist1[OF assms]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?m < funpow_dist1 f x y; ?n < funpow_dist1 f x y; ?m \<noteq> ?n\<rbrakk> \<Longrightarrow> (f ^^ ?m) x \<noteq> (f ^^ ?n) x

goal (1 subgoal):
 1. inj_on (\<lambda>n. (f ^^ n) x) {0..<funpow_dist1 f x y}
[PROOF STEP]
by (intro inj_onI) auto


[STATEMENT]
lemma block_sizes_non_empty:
  assumes "\<B> \<noteq> {#}"
  shows "card (sys_block_sizes) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < card sys_block_sizes
[PROOF STEP]
using finite_block_sizes block_sizes_non_empty_set
[PROOF STATE]
proof (prove)
using this:
finite sys_block_sizes
\<B> \<noteq> {#} \<Longrightarrow> sys_block_sizes \<noteq> {}

goal (1 subgoal):
 1. 0 < card sys_block_sizes
[PROOF STEP]
by (simp add: assms card_gt_0_iff)


[STATEMENT]
lemma ereal_divide_left_mono[simp]:
  fixes x y z :: ereal
  assumes "y \<le> x"
    and "0 < z"
    and "0 < x * y"
  shows "z / x \<le> z / y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z / x \<le> z / y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
y \<le> x
0 < z
0 < x * y

goal (1 subgoal):
 1. z / x \<le> z / y
[PROOF STEP]
by (cases x y z rule: ereal3_cases)
     (auto intro: divide_left_mono simp: field_simps zero_less_mult_iff mult_less_0_iff split: if_split_asm)


[STATEMENT]
lemma list_length_tl_neq_Nil: "1 < length (nl::nat list) \<Longrightarrow> tl nl \<noteq> []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < length nl \<Longrightarrow> tl nl \<noteq> []
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>1 < length nl; tl nl = []\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
assume "1 < length nl" and "tl nl = []"
[PROOF STATE]
proof (state)
this:
1 < length nl
tl nl = []

goal (1 subgoal):
 1. \<lbrakk>1 < length nl; tl nl = []\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
1 < length nl
tl nl = []
[PROOF STEP]
have "length (tl nl) = 0"
[PROOF STATE]
proof (prove)
using this:
1 < length nl
tl nl = []

goal (1 subgoal):
 1. length (tl nl) = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length (tl nl) = 0

goal (1 subgoal):
 1. \<lbrakk>1 < length nl; tl nl = []\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
with \<open>1 < length nl\<close> and length_tl
[PROOF STATE]
proof (chain)
picking this:
1 < length nl
length (tl ?xs) = length ?xs - 1
length (tl nl) = 0
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
1 < length nl
length (tl ?xs) = length ?xs - 1
length (tl nl) = 0

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bottom_weak_eq:
  "\<lbrakk> b \<in> carrier L; \<And> x. x \<in> carrier L \<Longrightarrow> b \<sqsubseteq> x \<rbrakk> \<Longrightarrow> b .= \<bottom>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>b \<in> carrier L; \<And>x. x \<in> carrier L \<Longrightarrow> b \<sqsubseteq> x\<rbrakk> \<Longrightarrow> b .= \<bottom>
[PROOF STEP]
by (metis bottom_closed bottom_lower weak_le_antisym)


[STATEMENT]
lemma sum_lower_bound_card:
  assumes "bp P"
  shows "(\<Sum>u \<in> U. w u) \<le> c * card P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. W U \<le> real (c * card P)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. W U \<le> real (c * card P)
[PROOF STEP]
have *: "\<forall>B \<in> P. 0 < W B \<and> W B \<le> c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>B\<in>P. 0 < W B \<and> W B \<le> real c
[PROOF STEP]
using bpE(2-4)[OF assms] weight
[PROOF STATE]
proof (prove)
using this:
{} \<notin> P
\<Union> P = U
\<forall>B\<in>P. W B \<le> real c
\<forall>u\<in>U. 0 < w u \<and> w u \<le> real c

goal (1 subgoal):
 1. \<forall>B\<in>P. 0 < W B \<and> W B \<le> real c
[PROOF STEP]
by (metis UnionI assms bp_bins_finite sum_pos)
[PROOF STATE]
proof (state)
this:
\<forall>B\<in>P. 0 < W B \<and> W B \<le> real c

goal (1 subgoal):
 1. W U \<le> real (c * card P)
[PROOF STEP]
have "(\<Sum>u \<in> U. w u) = (\<Sum>B \<in> P. W B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. W U = sum W P
[PROOF STEP]
using sum_Un_eq_sum_sum[OF assms]
[PROOF STATE]
proof (prove)
using this:
W U = sum W P

goal (1 subgoal):
 1. W U = sum W P
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
W U = sum W P

goal (1 subgoal):
 1. W U \<le> real (c * card P)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
W U = sum W P

goal (1 subgoal):
 1. W U \<le> real (c * card P)
[PROOF STEP]
have "... \<le> (\<Sum>B \<in> P. c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum W P \<le> real (\<Sum>B\<in>P. c)
[PROOF STEP]
using sum_mono *
[PROOF STATE]
proof (prove)
using this:
(\<And>i. i \<in> ?K \<Longrightarrow> ?f i \<le> ?g i) \<Longrightarrow> sum ?f ?K \<le> sum ?g ?K
\<forall>B\<in>P. 0 < W B \<and> W B \<le> real c

goal (1 subgoal):
 1. sum W P \<le> real (\<Sum>B\<in>P. c)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
sum W P \<le> real (\<Sum>B\<in>P. c)

goal (1 subgoal):
 1. W U \<le> real (c * card P)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum W P \<le> real (\<Sum>B\<in>P. c)

goal (1 subgoal):
 1. W U \<le> real (c * card P)
[PROOF STEP]
have "... = c * card P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (\<Sum>B\<in>P. c) = real (c * card P)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real (\<Sum>B\<in>P. c) = real (c * card P)

goal (1 subgoal):
 1. W U \<le> real (c * card P)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
W U \<le> real (c * card P)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
W U \<le> real (c * card P)

goal (1 subgoal):
 1. W U \<le> real (c * card P)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
W U \<le> real (c * card P)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nfoldli_map_inv:
  assumes "inj g"
  shows "nfoldli l c f = nfoldli (map g l) c (\<lambda>x s. f (the_inv g x) s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nfoldli l c f = nfoldli (map g l) c (\<lambda>x. f (the_inv g x))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
inj g

goal (1 subgoal):
 1. nfoldli l c f = nfoldli (map g l) c (\<lambda>x. f (the_inv g x))
[PROOF STEP]
apply (induction l)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. inj g \<Longrightarrow> nfoldli [] c f = nfoldli (map g []) c (\<lambda>x. f (the_inv g x))
 2. \<And>a l. \<lbrakk>inj g \<Longrightarrow> nfoldli l c f = nfoldli (map g l) c (\<lambda>x. f (the_inv g x)); inj g\<rbrakk> \<Longrightarrow> nfoldli (a # l) c f = nfoldli (map g (a # l)) c (\<lambda>x. f (the_inv g x))
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj g \<Longrightarrow> nfoldli [] c f = nfoldli (map g []) c (\<lambda>x. f (the_inv g x))
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a l. \<lbrakk>inj g \<Longrightarrow> nfoldli l c f = nfoldli (map g l) c (\<lambda>x. f (the_inv g x)); inj g\<rbrakk> \<Longrightarrow> nfoldli (a # l) c f = nfoldli (map g (a # l)) c (\<lambda>x. f (the_inv g x))
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>inj g \<Longrightarrow> nfoldli l_ c f = nfoldli (map g l_) c (\<lambda>x. f (the_inv g x)); inj g\<rbrakk> \<Longrightarrow> nfoldli (a_ # l_) c f = nfoldli (map g (a_ # l_)) c (\<lambda>x. f (the_inv g x))
[PROOF STEP]
by (auto simp: the_inv_f_f)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma incident_sedges_empty[simp]: "v \<notin> V \<Longrightarrow> incident_sedges v = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<notin> V \<Longrightarrow> incident_sedges v = {}
[PROOF STEP]
unfolding incident_sedges_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<notin> V \<Longrightarrow> {e \<in> E. incident v e \<and> card e = 2} = {}
[PROOF STEP]
using incident_def wellformed
[PROOF STATE]
proof (prove)
using this:
incident ?v ?e \<equiv> ?v \<in> ?e
?e \<in> E \<Longrightarrow> ?e \<subseteq> V

goal (1 subgoal):
 1. v \<notin> V \<Longrightarrow> {e \<in> E. incident v e \<and> card e = 2} = {}
[PROOF STEP]
by fastforce


[STATEMENT]
lemma poly_nate_poly:
  "poly (poly_nate bs p) = (\<lambda>x:: 'a ::field_char_0. \<lparr>p\<rparr>\<^sub>p\<^bsup>x # bs\<^esup>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly (poly_nate bs p) = (\<lambda>x. \<lparr>p\<rparr>\<^sub>p\<^bsup>x # bs\<^esup>)
[PROOF STEP]
using polypoly'_poly[OF polynate_norm[unfolded isnpoly_def], symmetric, of bs p]
[PROOF STATE]
proof (prove)
using this:
poly (polypoly' bs (polynate p)) ?x = \<lparr>polynate p\<rparr>\<^sub>p\<^bsup>?x # bs\<^esup>

goal (1 subgoal):
 1. poly (poly_nate bs p) = (\<lambda>x. \<lparr>p\<rparr>\<^sub>p\<^bsup>x # bs\<^esup>)
[PROOF STEP]
unfolding poly_nate_polypoly'
[PROOF STATE]
proof (prove)
using this:
poly (polypoly' bs (polynate p)) ?x = \<lparr>polynate p\<rparr>\<^sub>p\<^bsup>?x # bs\<^esup>

goal (1 subgoal):
 1. poly (polypoly' bs (polynate p)) = (\<lambda>x. \<lparr>p\<rparr>\<^sub>p\<^bsup>x # bs\<^esup>)
[PROOF STEP]
by auto


[STATEMENT]
lemma (in information_space) KL_nonneg:
  assumes "prob_space (density M D)"
  assumes D: "D \<in> borel_measurable M" "AE x in M. 0 \<le> D x"
  assumes int: "integrable M (\<lambda>x. D x * log b (D x))"
  shows "0 \<le> KL_divergence b M (density M D)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> KL_divergence b M (density M (\<lambda>x. ennreal (D x)))
[PROOF STEP]
using KL_gt_0[OF assms]
[PROOF STATE]
proof (prove)
using this:
density M (\<lambda>x. ennreal (D x)) \<noteq> M \<Longrightarrow> 0 < KL_divergence b M (density M (\<lambda>x. ennreal (D x)))

goal (1 subgoal):
 1. 0 \<le> KL_divergence b M (density M (\<lambda>x. ennreal (D x)))
[PROOF STEP]
by (cases "density M D = M") (auto simp: KL_same_eq_0)


[STATEMENT]
lemma tarski_omega_idempotent:
  "x\<^sup>\<omega>\<^sup>\<omega> = x\<^sup>\<omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x\<^sup>\<omega>\<^sup>\<omega> = x\<^sup>\<omega>
[PROOF STEP]
by (metis omega_vector tarski_top_omega)


[STATEMENT]
lemma dist_eq_dist_code_lt:
  fixes p\<^sub>0 :: point
  shows "dist p\<^sub>0 p\<^sub>1 < dist p\<^sub>2 p\<^sub>3 \<longleftrightarrow> dist_code p\<^sub>0 p\<^sub>1 < dist_code p\<^sub>2 p\<^sub>3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (dist (case p\<^sub>0 of (x, y) \<Rightarrow> (real_of_int x, real_of_int y)) (case p\<^sub>1 of (x, y) \<Rightarrow> (real_of_int x, real_of_int y)) < dist (case p\<^sub>2 of (x, y) \<Rightarrow> (real_of_int x, real_of_int y)) (case p\<^sub>3 of (x, y) \<Rightarrow> (real_of_int x, real_of_int y))) = (dist_code p\<^sub>0 p\<^sub>1 < dist_code p\<^sub>2 p\<^sub>3)
[PROOF STEP]
using dist_eq_sqrt_dist_code real_sqrt_less_iff
[PROOF STATE]
proof (prove)
using this:
dist (case ?p\<^sub>0 of (x, y) \<Rightarrow> (real_of_int x, real_of_int y)) (case ?p\<^sub>1 of (x, y) \<Rightarrow> (real_of_int x, real_of_int y)) = sqrt (real_of_int (dist_code ?p\<^sub>0 ?p\<^sub>1))
(sqrt ?x < sqrt ?y) = (?x < ?y)

goal (1 subgoal):
 1. (dist (case p\<^sub>0 of (x, y) \<Rightarrow> (real_of_int x, real_of_int y)) (case p\<^sub>1 of (x, y) \<Rightarrow> (real_of_int x, real_of_int y)) < dist (case p\<^sub>2 of (x, y) \<Rightarrow> (real_of_int x, real_of_int y)) (case p\<^sub>3 of (x, y) \<Rightarrow> (real_of_int x, real_of_int y))) = (dist_code p\<^sub>0 p\<^sub>1 < dist_code p\<^sub>2 p\<^sub>3)
[PROOF STEP]
by presburger


[STATEMENT]
lemma MapsToCompDef:
  assumes "f maps\<^bsub>C\<^esub> X to Y" and "g maps\<^bsub>C\<^esub> Y to Z"
  shows "f \<approx>>\<^bsub>C\<^esub> g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<approx>>\<^bsub>C\<^esub> g
[PROOF STEP]
proof(rule CompDefinedI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. f \<in> mor\<^bsub>C\<^esub>
 2. g \<in> mor\<^bsub>C\<^esub>
 3. cod\<^bsub>C\<^esub> f = dom\<^bsub>C\<^esub> g
[PROOF STEP]
show "f \<in> mor\<^bsub>C\<^esub>" and "g \<in> mor\<^bsub>C\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> mor\<^bsub>C\<^esub> &&& g \<in> mor\<^bsub>C\<^esub>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f maps\<^bsub>C\<^esub> X to Y
g maps\<^bsub>C\<^esub> Y to Z

goal (1 subgoal):
 1. f \<in> mor\<^bsub>C\<^esub> &&& g \<in> mor\<^bsub>C\<^esub>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f \<in> mor\<^bsub>C\<^esub>
g \<in> mor\<^bsub>C\<^esub>

goal (1 subgoal):
 1. cod\<^bsub>C\<^esub> f = dom\<^bsub>C\<^esub> g
[PROOF STEP]
have "cod\<^bsub>C\<^esub> f = Y" and "dom\<^bsub>C\<^esub> g = Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cod\<^bsub>C\<^esub> f = Y &&& dom\<^bsub>C\<^esub> g = Y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f maps\<^bsub>C\<^esub> X to Y
g maps\<^bsub>C\<^esub> Y to Z

goal (1 subgoal):
 1. cod\<^bsub>C\<^esub> f = Y &&& dom\<^bsub>C\<^esub> g = Y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cod\<^bsub>C\<^esub> f = Y
dom\<^bsub>C\<^esub> g = Y

goal (1 subgoal):
 1. cod\<^bsub>C\<^esub> f = dom\<^bsub>C\<^esub> g
[PROOF STEP]
thus "cod\<^bsub>C\<^esub> f = dom\<^bsub>C\<^esub> g"
[PROOF STATE]
proof (prove)
using this:
cod\<^bsub>C\<^esub> f = Y
dom\<^bsub>C\<^esub> g = Y

goal (1 subgoal):
 1. cod\<^bsub>C\<^esub> f = dom\<^bsub>C\<^esub> g
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cod\<^bsub>C\<^esub> f = dom\<^bsub>C\<^esub> g

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Limit_mk_doubleton_image_vsubset_Vset:
  assumes "Limit \<alpha>" and "X \<subseteq>\<^sub>\<circ> Y" and "Y \<in>\<^sub>\<circ> Vset \<alpha>"
  shows "mk_doubleton_image X Y \<subseteq>\<^sub>\<circ> Vset \<alpha>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mk_doubleton_image X Y \<subseteq>\<^sub>\<circ> Vset \<alpha>
[PROOF STEP]
proof(intro vsubsetI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> mk_doubleton_image X Y \<Longrightarrow> x \<in>\<^sub>\<circ> Vset \<alpha>
[PROOF STEP]
fix b
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> mk_doubleton_image X Y \<Longrightarrow> x \<in>\<^sub>\<circ> Vset \<alpha>
[PROOF STEP]
assume "b \<in>\<^sub>\<circ> mk_doubleton_image X Y"
[PROOF STATE]
proof (state)
this:
b \<in>\<^sub>\<circ> mk_doubleton_image X Y

goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> mk_doubleton_image X Y \<Longrightarrow> x \<in>\<^sub>\<circ> Vset \<alpha>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b \<in>\<^sub>\<circ> mk_doubleton_image X Y
[PROOF STEP]
obtain a where "b = mk_doubleton Y a" and "a \<in>\<^sub>\<circ> X"
[PROOF STATE]
proof (prove)
using this:
b \<in>\<^sub>\<circ> mk_doubleton_image X Y

goal (1 subgoal):
 1. (\<And>a. \<lbrakk>b = mk_doubleton Y a; a \<in>\<^sub>\<circ> X\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding mk_doubleton_image_def
[PROOF STATE]
proof (prove)
using this:
b \<in>\<^sub>\<circ> set (mk_doubleton Y ` elts X)

goal (1 subgoal):
 1. (\<And>a. \<lbrakk>b = mk_doubleton Y a; a \<in>\<^sub>\<circ> X\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by clarsimp
[PROOF STATE]
proof (state)
this:
b = mk_doubleton Y a
a \<in>\<^sub>\<circ> X

goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> mk_doubleton_image X Y \<Longrightarrow> x \<in>\<^sub>\<circ> Vset \<alpha>
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
Limit \<alpha>
X \<subseteq>\<^sub>\<circ> Y
Y \<in>\<^sub>\<circ> Vset \<alpha>
b = mk_doubleton Y a
a \<in>\<^sub>\<circ> X
[PROOF STEP]
have b_def: "b = set {a, Y}" and a\<alpha>: "a \<in>\<^sub>\<circ> Vset \<alpha>"
[PROOF STATE]
proof (prove)
using this:
Limit \<alpha>
X \<subseteq>\<^sub>\<circ> Y
Y \<in>\<^sub>\<circ> Vset \<alpha>
b = mk_doubleton Y a
a \<in>\<^sub>\<circ> X

goal (1 subgoal):
 1. b = set {a, Y} &&& a \<in>\<^sub>\<circ> Vset \<alpha>
[PROOF STEP]
by (auto simp: mk_doubleton_def)
[PROOF STATE]
proof (state)
this:
b = set {a, Y}
a \<in>\<^sub>\<circ> Vset \<alpha>

goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> mk_doubleton_image X Y \<Longrightarrow> x \<in>\<^sub>\<circ> Vset \<alpha>
[PROOF STEP]
from this(2) assms
[PROOF STATE]
proof (chain)
picking this:
a \<in>\<^sub>\<circ> Vset \<alpha>
Limit \<alpha>
X \<subseteq>\<^sub>\<circ> Y
Y \<in>\<^sub>\<circ> Vset \<alpha>
[PROOF STEP]
show "b \<in>\<^sub>\<circ> Vset \<alpha>"
[PROOF STATE]
proof (prove)
using this:
a \<in>\<^sub>\<circ> Vset \<alpha>
Limit \<alpha>
X \<subseteq>\<^sub>\<circ> Y
Y \<in>\<^sub>\<circ> Vset \<alpha>

goal (1 subgoal):
 1. b \<in>\<^sub>\<circ> Vset \<alpha>
[PROOF STEP]
unfolding b_def
[PROOF STATE]
proof (prove)
using this:
a \<in>\<^sub>\<circ> Vset \<alpha>
Limit \<alpha>
X \<subseteq>\<^sub>\<circ> Y
Y \<in>\<^sub>\<circ> Vset \<alpha>

goal (1 subgoal):
 1. set {a, Y} \<in>\<^sub>\<circ> Vset \<alpha>
[PROOF STEP]
by (simp add: Limit_vdoubleton_in_VsetI)
[PROOF STATE]
proof (state)
this:
b \<in>\<^sub>\<circ> Vset \<alpha>

goal:
No subgoals!
[PROOF STEP]
qed