[STATEMENT]
lemma subseq_diagseq: "strict_mono diagseq"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. strict_mono diagseq
[PROOF STEP]
using diagseq_mono
[PROOF STATE]
proof (prove)
using this:
diagseq ?n < diagseq (Suc ?n)

goal (1 subgoal):
 1. strict_mono diagseq
[PROOF STEP]
by (simp add: strict_mono_Suc_iff diagseq_def)


[STATEMENT]
lemma tensor_op_0_left[simp]: \<open>tensor_op 0 x = (0 :: ('a::finite*'b::finite) ell2 \<Rightarrow>\<^sub>C\<^sub>L ('c::finite*'d::finite) ell2)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<otimes>\<^sub>o x = 0
[PROOF STEP]
apply (rule equal_ket)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xa. (0 \<otimes>\<^sub>o x) *\<^sub>V ket xa = 0 *\<^sub>V ket xa
[PROOF STEP]
by (auto simp flip: tensor_ell2_ket simp: tensor_op_ell2)


[STATEMENT]
lemma set_sing_pow_hd: assumes "k \<noteq> 0" shows "a \<in> set ([a]\<^sup>@k \<cdot> u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> set ([a] \<^sup>@ k \<cdot> u)
[PROOF STEP]
unfolding set_append
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<in> set ([a] \<^sup>@ k) \<union> set u
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<in> set ([a] \<^sup>@ k) \<union> set u
[PROOF STEP]
have "set ([a] \<^sup>@ k) = set ([a] \<cdot> [a]\<^sup>@(k-1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set ([a] \<^sup>@ k) = set ([a] \<cdot> [a] \<^sup>@ (k - 1))
[PROOF STEP]
unfolding Suc_minus[OF \<open>k \<noteq> 0\<close>] pow_Suc[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set ([a] \<^sup>@ k) = set ([a] \<^sup>@ k)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
set ([a] \<^sup>@ k) = set ([a] \<cdot> [a] \<^sup>@ (k - 1))

goal (1 subgoal):
 1. a \<in> set ([a] \<^sup>@ k) \<union> set u
[PROOF STEP]
thus "a \<in> set ([a] \<^sup>@ k) \<union> set u"
[PROOF STATE]
proof (prove)
using this:
set ([a] \<^sup>@ k) = set ([a] \<cdot> [a] \<^sup>@ (k - 1))

goal (1 subgoal):
 1. a \<in> set ([a] \<^sup>@ k) \<union> set u
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
a \<in> set ([a] \<^sup>@ k) \<union> set u

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma find_largest_block: assumes bl: "blocks \<noteq> []"
  and find: "find_largest_block (hd blocks) (tl blocks) = (m_begin, m_end)"
  shows "(m_begin,m_end) \<in> set blocks"
  "\<And> i_begin i_end. (i_begin,i_end) \<in> set blocks \<Longrightarrow> m_end - m_begin \<ge> i_end - i_begin"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (m_begin, m_end) \<in> set blocks &&& (\<And>i_begin i_end. (i_begin, i_end) \<in> set blocks \<Longrightarrow> i_end - i_begin \<le> m_end - m_begin)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (m_begin, m_end) \<in> set blocks
 2. \<And>i_begin i_end. (i_begin, i_end) \<in> set blocks \<Longrightarrow> i_end - i_begin \<le> m_end - m_begin
[PROOF STEP]
from bl
[PROOF STATE]
proof (chain)
picking this:
blocks \<noteq> []
[PROOF STEP]
have id: "insert (hd blocks) (set (tl blocks)) = set blocks"
[PROOF STATE]
proof (prove)
using this:
blocks \<noteq> []

goal (1 subgoal):
 1. insert (hd blocks) (set (tl blocks)) = set blocks
[PROOF STEP]
by (cases blocks, auto)
[PROOF STATE]
proof (state)
this:
insert (hd blocks) (set (tl blocks)) = set blocks

goal (2 subgoals):
 1. (m_begin, m_end) \<in> set blocks
 2. \<And>i_begin i_end. (i_begin, i_end) \<in> set blocks \<Longrightarrow> i_end - i_begin \<le> m_end - m_begin
[PROOF STEP]
from find_largest_block_main[OF find, unfolded id]
[PROOF STATE]
proof (chain)
picking this:
(m_begin, m_end) \<in> set blocks \<and> (\<forall>b\<in>set blocks. snd b - fst b \<le> m_end - m_begin)
[PROOF STEP]
show "(m_begin,m_end) \<in> set blocks"
    "\<And> i_begin i_end. (i_begin,i_end) \<in> set blocks \<Longrightarrow> m_end - m_begin \<ge> i_end - i_begin"
[PROOF STATE]
proof (prove)
using this:
(m_begin, m_end) \<in> set blocks \<and> (\<forall>b\<in>set blocks. snd b - fst b \<le> m_end - m_begin)

goal (1 subgoal):
 1. (m_begin, m_end) \<in> set blocks &&& (\<And>i_begin i_end. (i_begin, i_end) \<in> set blocks \<Longrightarrow> i_end - i_begin \<le> m_end - m_begin)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(m_begin, m_end) \<in> set blocks
(?i_begin, ?i_end) \<in> set blocks \<Longrightarrow> ?i_end - ?i_begin \<le> m_end - m_begin

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bigtheta_mult_eq: "\<Theta>[F](\<lambda>x. f x * g x) = \<Theta>[F](f) * \<Theta>[F](g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Theta>[F](\<lambda>x. f x * g x) = \<Theta>[F](f) * \<Theta>[F](g)
[PROOF STEP]
proof (intro equalityI subsetI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> \<Theta>[F](\<lambda>x. f x * g x) \<Longrightarrow> x \<in> \<Theta>[F](f) * \<Theta>[F](g)
 2. \<And>x. x \<in> \<Theta>[F](f) * \<Theta>[F](g) \<Longrightarrow> x \<in> \<Theta>[F](\<lambda>x. f x * g x)
[PROOF STEP]
fix h
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> \<Theta>[F](\<lambda>x. f x * g x) \<Longrightarrow> x \<in> \<Theta>[F](f) * \<Theta>[F](g)
 2. \<And>x. x \<in> \<Theta>[F](f) * \<Theta>[F](g) \<Longrightarrow> x \<in> \<Theta>[F](\<lambda>x. f x * g x)
[PROOF STEP]
assume "h \<in> \<Theta>[F](f) * \<Theta>[F](g)"
[PROOF STATE]
proof (state)
this:
h \<in> \<Theta>[F](f) * \<Theta>[F](g)

goal (2 subgoals):
 1. \<And>x. x \<in> \<Theta>[F](\<lambda>x. f x * g x) \<Longrightarrow> x \<in> \<Theta>[F](f) * \<Theta>[F](g)
 2. \<And>x. x \<in> \<Theta>[F](f) * \<Theta>[F](g) \<Longrightarrow> x \<in> \<Theta>[F](\<lambda>x. f x * g x)
[PROOF STEP]
thus "h \<in> \<Theta>[F](\<lambda>x. f x * g x)"
[PROOF STATE]
proof (prove)
using this:
h \<in> \<Theta>[F](f) * \<Theta>[F](g)

goal (1 subgoal):
 1. h \<in> \<Theta>[F](\<lambda>x. f x * g x)
[PROOF STEP]
by (elim set_times_elim, hypsubst, unfold func_times) (erule (1) landau_theta.mult)
[PROOF STATE]
proof (state)
this:
h \<in> \<Theta>[F](\<lambda>x. f x * g x)

goal (1 subgoal):
 1. \<And>x. x \<in> \<Theta>[F](\<lambda>x. f x * g x) \<Longrightarrow> x \<in> \<Theta>[F](f) * \<Theta>[F](g)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> \<Theta>[F](\<lambda>x. f x * g x) \<Longrightarrow> x \<in> \<Theta>[F](f) * \<Theta>[F](g)
[PROOF STEP]
fix h
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> \<Theta>[F](\<lambda>x. f x * g x) \<Longrightarrow> x \<in> \<Theta>[F](f) * \<Theta>[F](g)
[PROOF STEP]
assume "h \<in> \<Theta>[F](\<lambda>x. f x * g x)"
[PROOF STATE]
proof (state)
this:
h \<in> \<Theta>[F](\<lambda>x. f x * g x)

goal (1 subgoal):
 1. \<And>x. x \<in> \<Theta>[F](\<lambda>x. f x * g x) \<Longrightarrow> x \<in> \<Theta>[F](f) * \<Theta>[F](g)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
h \<in> \<Theta>[F](\<lambda>x. f x * g x)
[PROOF STEP]
obtain c1 c2 :: real
    where c:
      "c1 > 0" "\<forall>\<^sub>F x in F. norm (h x) \<le> c1 * norm (f x * g x)"
      "c2 > 0" "\<forall>\<^sub>F x in F. c2 * norm (f x * g x) \<le> norm (h x)"
[PROOF STATE]
proof (prove)
using this:
h \<in> \<Theta>[F](\<lambda>x. f x * g x)

goal (1 subgoal):
 1. (\<And>c1 c2. \<lbrakk>0 < c1; \<forall>\<^sub>F x in F. norm (h x) \<le> c1 * norm (f x * g x); 0 < c2; \<forall>\<^sub>F x in F. c2 * norm (f x * g x) \<le> norm (h x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding bigtheta_def
[PROOF STATE]
proof (prove)
using this:
h \<in> O[F](\<lambda>x. f x * g x) \<inter> \<Omega>[F](\<lambda>x. f x * g x)

goal (1 subgoal):
 1. (\<And>c1 c2. \<lbrakk>0 < c1; \<forall>\<^sub>F x in F. norm (h x) \<le> c1 * norm (f x * g x); 0 < c2; \<forall>\<^sub>F x in F. c2 * norm (f x * g x) \<le> norm (h x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (blast elim: landau_o.bigE)
[PROOF STATE]
proof (state)
this:
0 < c1
\<forall>\<^sub>F x in F. norm (h x) \<le> c1 * norm (f x * g x)
0 < c2
\<forall>\<^sub>F x in F. c2 * norm (f x * g x) \<le> norm (h x)

goal (1 subgoal):
 1. \<And>x. x \<in> \<Theta>[F](\<lambda>x. f x * g x) \<Longrightarrow> x \<in> \<Theta>[F](f) * \<Theta>[F](g)
[PROOF STEP]
define h1 h2
    where "h1 x = (if g x = 0 then if f x = 0 then if h x = 0 then h x else 1 else f x else h x / g x)"
      and "h2 x = (if g x = 0 then if f x = 0 then h x else h x / f x else g x)"
    for x
[PROOF STATE]
proof (state)
this:
h1 ?x = (if g ?x = (0::'b) then if f ?x = (0::'b) then if h ?x = (0::'b) then h ?x else (1::'b) else f ?x else h ?x / g ?x)
h2 ?x = (if g ?x = (0::'b) then if f ?x = (0::'b) then h ?x else h ?x / f ?x else g ?x)

goal (1 subgoal):
 1. \<And>x. x \<in> \<Theta>[F](\<lambda>x. f x * g x) \<Longrightarrow> x \<in> \<Theta>[F](f) * \<Theta>[F](g)
[PROOF STEP]
have "h = h1 * h2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h = h1 * h2
[PROOF STEP]
by (intro ext) (auto simp: h1_def h2_def field_simps)
[PROOF STATE]
proof (state)
this:
h = h1 * h2

goal (1 subgoal):
 1. \<And>x. x \<in> \<Theta>[F](\<lambda>x. f x * g x) \<Longrightarrow> x \<in> \<Theta>[F](f) * \<Theta>[F](g)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
h = h1 * h2

goal (1 subgoal):
 1. \<And>x. x \<in> \<Theta>[F](\<lambda>x. f x * g x) \<Longrightarrow> x \<in> \<Theta>[F](f) * \<Theta>[F](g)
[PROOF STEP]
have "h1 \<in> \<Theta>[F](f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h1 \<in> \<Theta>[F](f)
[PROOF STEP]
proof (rule bigthetaI')
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. 0 < ?c1.0
 2. 0 < ?c2.0
 3. \<forall>\<^sub>F x in F. ?c1.0 * norm (f x) \<le> norm (h1 x) \<and> norm (h1 x) \<le> ?c2.0 * norm (f x)
[PROOF STEP]
from c(3)
[PROOF STATE]
proof (chain)
picking this:
0 < c2
[PROOF STEP]
show "min c2 1 > 0"
[PROOF STATE]
proof (prove)
using this:
0 < c2

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

goal (2 subgoals):
 1. 0 < ?c2.0
 2. \<forall>\<^sub>F x in F. min c2 1 * norm (f x) \<le> norm (h1 x) \<and> norm (h1 x) \<le> ?c2.0 * norm (f x)
[PROOF STEP]
from c(1)
[PROOF STATE]
proof (chain)
picking this:
0 < c1
[PROOF STEP]
show "max c1 1 > 0"
[PROOF STATE]
proof (prove)
using this:
0 < c1

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

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. min c2 1 * norm (f x) \<le> norm (h1 x) \<and> norm (h1 x) \<le> max c1 1 * norm (f x)
[PROOF STEP]
from c(2,4)
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in F. norm (h x) \<le> c1 * norm (f x * g x)
\<forall>\<^sub>F x in F. c2 * norm (f x * g x) \<le> norm (h x)
[PROOF STEP]
show "eventually (\<lambda>x. min c2 1 * (norm (f x)) \<le> norm (h1 x) \<and>
                            norm (h1 x) \<le> max c1 1 * (norm (f x))) F"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. norm (h x) \<le> c1 * norm (f x * g x)
\<forall>\<^sub>F x in F. c2 * norm (f x * g x) \<le> norm (h x)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. min c2 1 * norm (f x) \<le> norm (h1 x) \<and> norm (h1 x) \<le> max c1 1 * norm (f x)
[PROOF STEP]
apply eventually_elim
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>norm (h x) \<le> c1 * norm (f x * g x); c2 * norm (f x * g x) \<le> norm (h x)\<rbrakk> \<Longrightarrow> min c2 1 * norm (f x) \<le> norm (h1 x) \<and> norm (h1 x) \<le> max c1 1 * norm (f x)
[PROOF STEP]
proof (rule conjI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>norm (h x) \<le> c1 * norm (f x * g x); c2 * norm (f x * g x) \<le> norm (h x)\<rbrakk> \<Longrightarrow> min c2 1 * norm (f x) \<le> norm (h1 x)
 2. \<And>x. \<lbrakk>norm (h x) \<le> c1 * norm (f x * g x); c2 * norm (f x * g x) \<le> norm (h x)\<rbrakk> \<Longrightarrow> norm (h1 x) \<le> max c1 1 * norm (f x)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>norm (h x) \<le> c1 * norm (f x * g x); c2 * norm (f x * g x) \<le> norm (h x)\<rbrakk> \<Longrightarrow> min c2 1 * norm (f x) \<le> norm (h1 x)
 2. \<And>x. \<lbrakk>norm (h x) \<le> c1 * norm (f x * g x); c2 * norm (f x * g x) \<le> norm (h x)\<rbrakk> \<Longrightarrow> norm (h1 x) \<le> max c1 1 * norm (f x)
[PROOF STEP]
assume A: "(norm (h x)) \<le> c1 * norm (f x * g x)"
               and B: "(norm (h x)) \<ge> c2 * norm (f x * g x)"
[PROOF STATE]
proof (state)
this:
norm (h x) \<le> c1 * norm (f x * g x)
c2 * norm (f x * g x) \<le> norm (h x)

goal (2 subgoals):
 1. \<And>x. \<lbrakk>norm (h x) \<le> c1 * norm (f x * g x); c2 * norm (f x * g x) \<le> norm (h x)\<rbrakk> \<Longrightarrow> min c2 1 * norm (f x) \<le> norm (h1 x)
 2. \<And>x. \<lbrakk>norm (h x) \<le> c1 * norm (f x * g x); c2 * norm (f x * g x) \<le> norm (h x)\<rbrakk> \<Longrightarrow> norm (h1 x) \<le> max c1 1 * norm (f x)
[PROOF STEP]
have m: "min c2 1 * (norm (f x)) \<le> 1 * (norm (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min c2 1 * norm (f x) \<le> 1 * norm (f x)
[PROOF STEP]
by (rule mult_right_mono) simp_all
[PROOF STATE]
proof (state)
this:
min c2 1 * norm (f x) \<le> 1 * norm (f x)

goal (2 subgoals):
 1. \<And>x. \<lbrakk>norm (h x) \<le> c1 * norm (f x * g x); c2 * norm (f x * g x) \<le> norm (h x)\<rbrakk> \<Longrightarrow> min c2 1 * norm (f x) \<le> norm (h1 x)
 2. \<And>x. \<lbrakk>norm (h x) \<le> c1 * norm (f x * g x); c2 * norm (f x * g x) \<le> norm (h x)\<rbrakk> \<Longrightarrow> norm (h1 x) \<le> max c1 1 * norm (f x)
[PROOF STEP]
have "min c2 1 * norm (f x * g x) \<le> c2 * norm (f x * g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min c2 1 * norm (f x * g x) \<le> c2 * norm (f x * g x)
[PROOF STEP]
by (intro mult_right_mono) simp_all
[PROOF STATE]
proof (state)
this:
min c2 1 * norm (f x * g x) \<le> c2 * norm (f x * g x)

goal (2 subgoals):
 1. \<And>x. \<lbrakk>norm (h x) \<le> c1 * norm (f x * g x); c2 * norm (f x * g x) \<le> norm (h x)\<rbrakk> \<Longrightarrow> min c2 1 * norm (f x) \<le> norm (h1 x)
 2. \<And>x. \<lbrakk>norm (h x) \<le> c1 * norm (f x * g x); c2 * norm (f x * g x) \<le> norm (h x)\<rbrakk> \<Longrightarrow> norm (h1 x) \<le> max c1 1 * norm (f x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
min c2 1 * norm (f x * g x) \<le> c2 * norm (f x * g x)

goal (2 subgoals):
 1. \<And>x. \<lbrakk>norm (h x) \<le> c1 * norm (f x * g x); c2 * norm (f x * g x) \<le> norm (h x)\<rbrakk> \<Longrightarrow> min c2 1 * norm (f x) \<le> norm (h1 x)
 2. \<And>x. \<lbrakk>norm (h x) \<le> c1 * norm (f x * g x); c2 * norm (f x * g x) \<le> norm (h x)\<rbrakk> \<Longrightarrow> norm (h1 x) \<le> max c1 1 * norm (f x)
[PROOF STEP]
note B
[PROOF STATE]
proof (state)
this:
c2 * norm (f x * g x) \<le> norm (h x)

goal (2 subgoals):
 1. \<And>x. \<lbrakk>norm (h x) \<le> c1 * norm (f x * g x); c2 * norm (f x * g x) \<le> norm (h x)\<rbrakk> \<Longrightarrow> min c2 1 * norm (f x) \<le> norm (h1 x)
 2. \<And>x. \<lbrakk>norm (h x) \<le> c1 * norm (f x * g x); c2 * norm (f x * g x) \<le> norm (h x)\<rbrakk> \<Longrightarrow> norm (h1 x) \<le> max c1 1 * norm (f x)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
min c2 1 * norm (f x * g x) \<le> norm (h x)
[PROOF STEP]
show "norm (h1 x) \<ge> min c2 1 * (norm (f x))"
[PROOF STATE]
proof (prove)
using this:
min c2 1 * norm (f x * g x) \<le> norm (h x)

goal (1 subgoal):
 1. min c2 1 * norm (f x) \<le> norm (h1 x)
[PROOF STEP]
using m A
[PROOF STATE]
proof (prove)
using this:
min c2 1 * norm (f x * g x) \<le> norm (h x)
min c2 1 * norm (f x) \<le> 1 * norm (f x)
norm (h x) \<le> c1 * norm (f x * g x)

goal (1 subgoal):
 1. min c2 1 * norm (f x) \<le> norm (h1 x)
[PROOF STEP]
by (cases "g x = 0") (simp_all add: h1_def norm_mult norm_divide field_simps)+
[PROOF STATE]
proof (state)
this:
min c2 1 * norm (f x) \<le> norm (h1 x)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>norm (h x) \<le> c1 * norm (f x * g x); c2 * norm (f x * g x) \<le> norm (h x)\<rbrakk> \<Longrightarrow> norm (h1 x) \<le> max c1 1 * norm (f x)
[PROOF STEP]
have m: "1 * (norm (f x)) \<le> max c1 1 * (norm (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 * norm (f x) \<le> max c1 1 * norm (f x)
[PROOF STEP]
by (rule mult_right_mono) simp_all
[PROOF STATE]
proof (state)
this:
1 * norm (f x) \<le> max c1 1 * norm (f x)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>norm (h x) \<le> c1 * norm (f x * g x); c2 * norm (f x * g x) \<le> norm (h x)\<rbrakk> \<Longrightarrow> norm (h1 x) \<le> max c1 1 * norm (f x)
[PROOF STEP]
note A
[PROOF STATE]
proof (state)
this:
norm (h x) \<le> c1 * norm (f x * g x)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>norm (h x) \<le> c1 * norm (f x * g x); c2 * norm (f x * g x) \<le> norm (h x)\<rbrakk> \<Longrightarrow> norm (h1 x) \<le> max c1 1 * norm (f x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (h x) \<le> c1 * norm (f x * g x)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>norm (h x) \<le> c1 * norm (f x * g x); c2 * norm (f x * g x) \<le> norm (h x)\<rbrakk> \<Longrightarrow> norm (h1 x) \<le> max c1 1 * norm (f x)
[PROOF STEP]
have "c1 * norm (f x * g x) \<le> max c1 1 * norm (f x * g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c1 * norm (f x * g x) \<le> max c1 1 * norm (f x * g x)
[PROOF STEP]
by (intro mult_right_mono) simp_all
[PROOF STATE]
proof (state)
this:
c1 * norm (f x * g x) \<le> max c1 1 * norm (f x * g x)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>norm (h x) \<le> c1 * norm (f x * g x); c2 * norm (f x * g x) \<le> norm (h x)\<rbrakk> \<Longrightarrow> norm (h1 x) \<le> max c1 1 * norm (f x)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
norm (h x) \<le> max c1 1 * norm (f x * g x)
[PROOF STEP]
show "norm (h1 x) \<le> max c1 1 * (norm (f x))"
[PROOF STATE]
proof (prove)
using this:
norm (h x) \<le> max c1 1 * norm (f x * g x)

goal (1 subgoal):
 1. norm (h1 x) \<le> max c1 1 * norm (f x)
[PROOF STEP]
using m A
[PROOF STATE]
proof (prove)
using this:
norm (h x) \<le> max c1 1 * norm (f x * g x)
1 * norm (f x) \<le> max c1 1 * norm (f x)
norm (h x) \<le> c1 * norm (f x * g x)

goal (1 subgoal):
 1. norm (h1 x) \<le> max c1 1 * norm (f x)
[PROOF STEP]
by (cases "g x = 0") (simp_all add: h1_def norm_mult norm_divide field_simps)+
[PROOF STATE]
proof (state)
this:
norm (h1 x) \<le> max c1 1 * norm (f x)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. min c2 1 * norm (f x) \<le> norm (h1 x) \<and> norm (h1 x) \<le> max c1 1 * norm (f x)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
h1 \<in> \<Theta>[F](f)

goal (1 subgoal):
 1. \<And>x. x \<in> \<Theta>[F](\<lambda>x. f x * g x) \<Longrightarrow> x \<in> \<Theta>[F](f) * \<Theta>[F](g)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
h1 \<in> \<Theta>[F](f)

goal (1 subgoal):
 1. \<And>x. x \<in> \<Theta>[F](\<lambda>x. f x * g x) \<Longrightarrow> x \<in> \<Theta>[F](f) * \<Theta>[F](g)
[PROOF STEP]
have "h2 \<in> \<Theta>[F](g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h2 \<in> \<Theta>[F](g)
[PROOF STEP]
proof (rule bigthetaI')
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. 0 < ?c1.0
 2. 0 < ?c2.0
 3. \<forall>\<^sub>F x in F. ?c1.0 * norm (g x) \<le> norm (h2 x) \<and> norm (h2 x) \<le> ?c2.0 * norm (g x)
[PROOF STEP]
from c(3)
[PROOF STATE]
proof (chain)
picking this:
0 < c2
[PROOF STEP]
show "min c2 1 > 0"
[PROOF STATE]
proof (prove)
using this:
0 < c2

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

goal (2 subgoals):
 1. 0 < ?c2.0
 2. \<forall>\<^sub>F x in F. min c2 1 * norm (g x) \<le> norm (h2 x) \<and> norm (h2 x) \<le> ?c2.0 * norm (g x)
[PROOF STEP]
from c(1)
[PROOF STATE]
proof (chain)
picking this:
0 < c1
[PROOF STEP]
show "max c1 1 > 0"
[PROOF STATE]
proof (prove)
using this:
0 < c1

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

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. min c2 1 * norm (g x) \<le> norm (h2 x) \<and> norm (h2 x) \<le> max c1 1 * norm (g x)
[PROOF STEP]
from c(2,4)
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in F. norm (h x) \<le> c1 * norm (f x * g x)
\<forall>\<^sub>F x in F. c2 * norm (f x * g x) \<le> norm (h x)
[PROOF STEP]
show "eventually (\<lambda>x. min c2 1 * (norm (g x)) \<le> norm (h2 x) \<and>
                            norm (h2 x) \<le> max c1 1 * (norm (g x))) F"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. norm (h x) \<le> c1 * norm (f x * g x)
\<forall>\<^sub>F x in F. c2 * norm (f x * g x) \<le> norm (h x)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. min c2 1 * norm (g x) \<le> norm (h2 x) \<and> norm (h2 x) \<le> max c1 1 * norm (g x)
[PROOF STEP]
apply eventually_elim
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>norm (h x) \<le> c1 * norm (f x * g x); c2 * norm (f x * g x) \<le> norm (h x)\<rbrakk> \<Longrightarrow> min c2 1 * norm (g x) \<le> norm (h2 x) \<and> norm (h2 x) \<le> max c1 1 * norm (g x)
[PROOF STEP]
proof (rule conjI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>norm (h x) \<le> c1 * norm (f x * g x); c2 * norm (f x * g x) \<le> norm (h x)\<rbrakk> \<Longrightarrow> min c2 1 * norm (g x) \<le> norm (h2 x)
 2. \<And>x. \<lbrakk>norm (h x) \<le> c1 * norm (f x * g x); c2 * norm (f x * g x) \<le> norm (h x)\<rbrakk> \<Longrightarrow> norm (h2 x) \<le> max c1 1 * norm (g x)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>norm (h x) \<le> c1 * norm (f x * g x); c2 * norm (f x * g x) \<le> norm (h x)\<rbrakk> \<Longrightarrow> min c2 1 * norm (g x) \<le> norm (h2 x)
 2. \<And>x. \<lbrakk>norm (h x) \<le> c1 * norm (f x * g x); c2 * norm (f x * g x) \<le> norm (h x)\<rbrakk> \<Longrightarrow> norm (h2 x) \<le> max c1 1 * norm (g x)
[PROOF STEP]
assume A: "(norm (h x)) \<le> c1 * norm (f x * g x)"
               and B: "(norm (h x)) \<ge> c2 * norm (f x * g x)"
[PROOF STATE]
proof (state)
this:
norm (h x) \<le> c1 * norm (f x * g x)
c2 * norm (f x * g x) \<le> norm (h x)

goal (2 subgoals):
 1. \<And>x. \<lbrakk>norm (h x) \<le> c1 * norm (f x * g x); c2 * norm (f x * g x) \<le> norm (h x)\<rbrakk> \<Longrightarrow> min c2 1 * norm (g x) \<le> norm (h2 x)
 2. \<And>x. \<lbrakk>norm (h x) \<le> c1 * norm (f x * g x); c2 * norm (f x * g x) \<le> norm (h x)\<rbrakk> \<Longrightarrow> norm (h2 x) \<le> max c1 1 * norm (g x)
[PROOF STEP]
have m: "min c2 1 * (norm (f x)) \<le> 1 * (norm (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min c2 1 * norm (f x) \<le> 1 * norm (f x)
[PROOF STEP]
by (rule mult_right_mono) simp_all
[PROOF STATE]
proof (state)
this:
min c2 1 * norm (f x) \<le> 1 * norm (f x)

goal (2 subgoals):
 1. \<And>x. \<lbrakk>norm (h x) \<le> c1 * norm (f x * g x); c2 * norm (f x * g x) \<le> norm (h x)\<rbrakk> \<Longrightarrow> min c2 1 * norm (g x) \<le> norm (h2 x)
 2. \<And>x. \<lbrakk>norm (h x) \<le> c1 * norm (f x * g x); c2 * norm (f x * g x) \<le> norm (h x)\<rbrakk> \<Longrightarrow> norm (h2 x) \<le> max c1 1 * norm (g x)
[PROOF STEP]
have "min c2 1 * norm (f x * g x) \<le> c2 * norm (f x * g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min c2 1 * norm (f x * g x) \<le> c2 * norm (f x * g x)
[PROOF STEP]
by (intro mult_right_mono) simp_all
[PROOF STATE]
proof (state)
this:
min c2 1 * norm (f x * g x) \<le> c2 * norm (f x * g x)

goal (2 subgoals):
 1. \<And>x. \<lbrakk>norm (h x) \<le> c1 * norm (f x * g x); c2 * norm (f x * g x) \<le> norm (h x)\<rbrakk> \<Longrightarrow> min c2 1 * norm (g x) \<le> norm (h2 x)
 2. \<And>x. \<lbrakk>norm (h x) \<le> c1 * norm (f x * g x); c2 * norm (f x * g x) \<le> norm (h x)\<rbrakk> \<Longrightarrow> norm (h2 x) \<le> max c1 1 * norm (g x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
min c2 1 * norm (f x * g x) \<le> c2 * norm (f x * g x)

goal (2 subgoals):
 1. \<And>x. \<lbrakk>norm (h x) \<le> c1 * norm (f x * g x); c2 * norm (f x * g x) \<le> norm (h x)\<rbrakk> \<Longrightarrow> min c2 1 * norm (g x) \<le> norm (h2 x)
 2. \<And>x. \<lbrakk>norm (h x) \<le> c1 * norm (f x * g x); c2 * norm (f x * g x) \<le> norm (h x)\<rbrakk> \<Longrightarrow> norm (h2 x) \<le> max c1 1 * norm (g x)
[PROOF STEP]
note B
[PROOF STATE]
proof (state)
this:
c2 * norm (f x * g x) \<le> norm (h x)

goal (2 subgoals):
 1. \<And>x. \<lbrakk>norm (h x) \<le> c1 * norm (f x * g x); c2 * norm (f x * g x) \<le> norm (h x)\<rbrakk> \<Longrightarrow> min c2 1 * norm (g x) \<le> norm (h2 x)
 2. \<And>x. \<lbrakk>norm (h x) \<le> c1 * norm (f x * g x); c2 * norm (f x * g x) \<le> norm (h x)\<rbrakk> \<Longrightarrow> norm (h2 x) \<le> max c1 1 * norm (g x)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
min c2 1 * norm (f x * g x) \<le> norm (h x)
[PROOF STEP]
show "norm (h2 x) \<ge> min c2 1 * (norm (g x))"
[PROOF STATE]
proof (prove)
using this:
min c2 1 * norm (f x * g x) \<le> norm (h x)

goal (1 subgoal):
 1. min c2 1 * norm (g x) \<le> norm (h2 x)
[PROOF STEP]
using m A B
[PROOF STATE]
proof (prove)
using this:
min c2 1 * norm (f x * g x) \<le> norm (h x)
min c2 1 * norm (f x) \<le> 1 * norm (f x)
norm (h x) \<le> c1 * norm (f x * g x)
c2 * norm (f x * g x) \<le> norm (h x)

goal (1 subgoal):
 1. min c2 1 * norm (g x) \<le> norm (h2 x)
[PROOF STEP]
by (cases "g x = 0") (auto simp: h2_def abs_mult field_simps)+
[PROOF STATE]
proof (state)
this:
min c2 1 * norm (g x) \<le> norm (h2 x)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>norm (h x) \<le> c1 * norm (f x * g x); c2 * norm (f x * g x) \<le> norm (h x)\<rbrakk> \<Longrightarrow> norm (h2 x) \<le> max c1 1 * norm (g x)
[PROOF STEP]
have m: "1 * (norm (g x)) \<le> max c1 1 * (norm (g x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 * norm (g x) \<le> max c1 1 * norm (g x)
[PROOF STEP]
by (rule mult_right_mono) simp_all
[PROOF STATE]
proof (state)
this:
1 * norm (g x) \<le> max c1 1 * norm (g x)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>norm (h x) \<le> c1 * norm (f x * g x); c2 * norm (f x * g x) \<le> norm (h x)\<rbrakk> \<Longrightarrow> norm (h2 x) \<le> max c1 1 * norm (g x)
[PROOF STEP]
note A
[PROOF STATE]
proof (state)
this:
norm (h x) \<le> c1 * norm (f x * g x)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>norm (h x) \<le> c1 * norm (f x * g x); c2 * norm (f x * g x) \<le> norm (h x)\<rbrakk> \<Longrightarrow> norm (h2 x) \<le> max c1 1 * norm (g x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (h x) \<le> c1 * norm (f x * g x)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>norm (h x) \<le> c1 * norm (f x * g x); c2 * norm (f x * g x) \<le> norm (h x)\<rbrakk> \<Longrightarrow> norm (h2 x) \<le> max c1 1 * norm (g x)
[PROOF STEP]
have "c1 * norm (f x * g x) \<le> max c1 1 * norm (f x * g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c1 * norm (f x * g x) \<le> max c1 1 * norm (f x * g x)
[PROOF STEP]
by (intro mult_right_mono) simp_all
[PROOF STATE]
proof (state)
this:
c1 * norm (f x * g x) \<le> max c1 1 * norm (f x * g x)

goal (1 subgoal):
 1. \<And>x. \<lbrakk>norm (h x) \<le> c1 * norm (f x * g x); c2 * norm (f x * g x) \<le> norm (h x)\<rbrakk> \<Longrightarrow> norm (h2 x) \<le> max c1 1 * norm (g x)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
norm (h x) \<le> max c1 1 * norm (f x * g x)
[PROOF STEP]
show "norm (h2 x) \<le> max c1 1 * (norm (g x))"
[PROOF STATE]
proof (prove)
using this:
norm (h x) \<le> max c1 1 * norm (f x * g x)

goal (1 subgoal):
 1. norm (h2 x) \<le> max c1 1 * norm (g x)
[PROOF STEP]
using m A
[PROOF STATE]
proof (prove)
using this:
norm (h x) \<le> max c1 1 * norm (f x * g x)
1 * norm (g x) \<le> max c1 1 * norm (g x)
norm (h x) \<le> c1 * norm (f x * g x)

goal (1 subgoal):
 1. norm (h2 x) \<le> max c1 1 * norm (g x)
[PROOF STEP]
by (cases "g x = 0") (simp_all add: h2_def abs_mult field_simps)+
[PROOF STATE]
proof (state)
this:
norm (h2 x) \<le> max c1 1 * norm (g x)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. min c2 1 * norm (g x) \<le> norm (h2 x) \<and> norm (h2 x) \<le> max c1 1 * norm (g x)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
h2 \<in> \<Theta>[F](g)

goal (1 subgoal):
 1. \<And>x. x \<in> \<Theta>[F](\<lambda>x. f x * g x) \<Longrightarrow> x \<in> \<Theta>[F](f) * \<Theta>[F](g)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
h = h1 * h2
h1 \<in> \<Theta>[F](f)
h2 \<in> \<Theta>[F](g)
[PROOF STEP]
show "h \<in> \<Theta>[F](f) * \<Theta>[F](g)"
[PROOF STATE]
proof (prove)
using this:
h = h1 * h2
h1 \<in> \<Theta>[F](f)
h2 \<in> \<Theta>[F](g)

goal (1 subgoal):
 1. h \<in> \<Theta>[F](f) * \<Theta>[F](g)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
h \<in> \<Theta>[F](f) * \<Theta>[F](g)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma neg_until_always: "-(p until -p) = \<box> p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (p until - p) = \<box> p
[PROOF STEP]
proof (rule order.antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. - (p until - p) \<le> \<box> p
 2. \<box> p \<le> - (p until - p)
[PROOF STEP]
show "- (p until - p) \<le> \<box> p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (p until - p) \<le> \<box> p
[PROOF STEP]
by (simp add: until_def always_def uminus_SUP uminus_INF, rule INF_greatest, cut_tac p = "\<lambda> n . p !! n" in until_always, simp)
[PROOF STATE]
proof (state)
this:
- (p until - p) \<le> \<box> p

goal (1 subgoal):
 1. \<box> p \<le> - (p until - p)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<box> p \<le> - (p until - p)
[PROOF STEP]
have "\<And> n . \<box> p \<le> p !! n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<box> p \<le> p !! n
[PROOF STEP]
by (simp add: always_def INF_lower)
[PROOF STATE]
proof (state)
this:
\<box> p \<le> p !! ?n

goal (1 subgoal):
 1. \<box> p \<le> - (p until - p)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<box> p \<le> p !! ?n

goal (1 subgoal):
 1. \<box> p \<le> - (p until - p)
[PROOF STEP]
have "\<And> n . p !! n \<le> (SUP x\<in>{i. i < n}. (- p) !! x) \<squnion> p !! n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. p !! n \<le> Sup ((!!) (- p) ` {i. i < n}) \<squnion> p !! n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
p !! ?n \<le> Sup ((!!) (- p) ` {i. i < ?n}) \<squnion> p !! ?n

goal (1 subgoal):
 1. \<box> p \<le> - (p until - p)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<box> p \<le> Sup ((!!) (- p) ` {i. i < ?n1}) \<squnion> p !! ?n1
[PROOF STEP]
show "\<box> p \<le> -(p until -p)"
[PROOF STATE]
proof (prove)
using this:
\<box> p \<le> Sup ((!!) (- p) ` {i. i < ?n1}) \<squnion> p !! ?n1

goal (1 subgoal):
 1. \<box> p \<le> - (p until - p)
[PROOF STEP]
apply (simp add: until_def uminus_SUP uminus_INF)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>n. \<box> p \<le> Sup ((!!) (- p) ` {i. i < n}) \<squnion> p !! n) \<Longrightarrow> \<box> p \<le> (INF x. Sup ((!!) (- p) ` {i. i < x}) \<squnion> p !! x)
[PROOF STEP]
by (rule INF_greatest, simp)
[PROOF STATE]
proof (state)
this:
\<box> p \<le> - (p until - p)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma continuous_sqrt_on_simply_connected:
  fixes f :: "'a::real_normed_vector \<Rightarrow> complex"
  assumes contf: "continuous_on S f" and S: "simply_connected S" "locally path_connected S"
      and f: "\<And>z. z \<in> S \<Longrightarrow> f z \<noteq> 0"
  obtains g where "continuous_on S g" "\<And>x. x \<in> S \<Longrightarrow> f x = (g x) ^ 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>g. \<lbrakk>continuous_on S g; \<And>x. x \<in> S \<Longrightarrow> f x = (g x)\<^sup>2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>g. \<lbrakk>continuous_on S g; \<And>x. x \<in> S \<Longrightarrow> f x = (g x)\<^sup>2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
obtain g where contg: "continuous_on S g" and feq: "\<And>x. x \<in> S \<Longrightarrow> f x = exp(g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>g. \<lbrakk>continuous_on S g; \<And>x. x \<in> S \<Longrightarrow> f x = exp (g x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using continuous_logarithm_on_simply_connected [OF assms]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>z. z \<in> S \<Longrightarrow> z \<in> S; \<And>g. \<lbrakk>continuous_on S g; \<And>x. x \<in> S \<Longrightarrow> f x = exp (g x)\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>g. \<lbrakk>continuous_on S g; \<And>x. x \<in> S \<Longrightarrow> f x = exp (g x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
continuous_on S g
?x \<in> S \<Longrightarrow> f ?x = exp (g ?x)

goal (1 subgoal):
 1. (\<And>g. \<lbrakk>continuous_on S g; \<And>x. x \<in> S \<Longrightarrow> f x = (g x)\<^sup>2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. thesis
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. continuous_on S ?g
 2. \<And>x. x \<in> S \<Longrightarrow> f x = (?g x)\<^sup>2
[PROOF STEP]
show "continuous_on S (\<lambda>z. exp (g z / 2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on S (\<lambda>z. exp (g z / 2))
[PROOF STEP]
by (rule continuous_on_compose2 [of UNIV exp]; intro continuous_intros contg subset_UNIV) auto
[PROOF STATE]
proof (state)
this:
continuous_on S (\<lambda>z. exp (g z / 2))

goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> f x = (exp (g x / 2))\<^sup>2
[PROOF STEP]
show "\<And>x. x \<in> S \<Longrightarrow> f x = (exp (g x / 2))\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> S \<Longrightarrow> f x = (exp (g x / 2))\<^sup>2
[PROOF STEP]
by (metis exp_double feq nonzero_mult_div_cancel_left times_divide_eq_right zero_neq_numeral)
[PROOF STATE]
proof (state)
this:
?x \<in> S \<Longrightarrow> f ?x = (exp (g ?x / 2))\<^sup>2

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma diff_rat [simp]:
  "b \<noteq> 0 \<Longrightarrow> d \<noteq> 0 \<Longrightarrow> Fract a b - Fract c d = Fract (a * d - c * b) (b * d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>b \<noteq> 0; d \<noteq> 0\<rbrakk> \<Longrightarrow> Fract a b - Fract c d = Fract (a * d - c * b) (b * d)
[PROOF STEP]
by (simp add: diff_rat_def)


[STATEMENT]
lemma (in vectorspace) finite_basis_exists:
  assumes h1: "fin_dim"
  shows "\<exists>\<beta>. finite \<beta> \<and> basis \<beta>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>\<beta>. finite \<beta> \<and> basis \<beta>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>\<beta>. finite \<beta> \<and> basis \<beta>
[PROOF STEP]
from h1
[PROOF STATE]
proof (chain)
picking this:
fin_dim
[PROOF STEP]
obtain A where 1: "finite A \<and> A\<subseteq>carrier V \<and> gen_set A"
[PROOF STATE]
proof (prove)
using this:
fin_dim

goal (1 subgoal):
 1. (\<And>A. finite A \<and> A \<subseteq> carrier V \<and> gen_set A \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis fin_dim_def)
[PROOF STATE]
proof (state)
this:
finite A \<and> A \<subseteq> carrier V \<and> gen_set A

goal (1 subgoal):
 1. \<exists>\<beta>. finite \<beta> \<and> basis \<beta>
[PROOF STEP]
hence 2: "\<exists>\<beta>. \<beta>\<subseteq>A \<and> minimal \<beta> (\<lambda>S. S\<subseteq>carrier V \<and> gen_set S)"
[PROOF STATE]
proof (prove)
using this:
finite A \<and> A \<subseteq> carrier V \<and> gen_set A

goal (1 subgoal):
 1. \<exists>\<beta>\<subseteq>A. minimal \<beta> (\<lambda>S. S \<subseteq> carrier V \<and> gen_set S)
[PROOF STEP]
apply (intro minimal_exists)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. finite A \<and> A \<subseteq> carrier V \<and> gen_set A \<Longrightarrow> finite A
 2. finite A \<and> A \<subseteq> carrier V \<and> gen_set A \<Longrightarrow> A \<subseteq> carrier V \<and> gen_set A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>\<beta>\<subseteq>A. minimal \<beta> (\<lambda>S. S \<subseteq> carrier V \<and> gen_set S)

goal (1 subgoal):
 1. \<exists>\<beta>. finite \<beta> \<and> basis \<beta>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>\<beta>\<subseteq>A. minimal \<beta> (\<lambda>S. S \<subseteq> carrier V \<and> gen_set S)
[PROOF STEP]
obtain \<beta> where 3: "\<beta>\<subseteq>A \<and> minimal \<beta> (\<lambda>S. S\<subseteq>carrier V \<and> gen_set S)"
[PROOF STATE]
proof (prove)
using this:
\<exists>\<beta>\<subseteq>A. minimal \<beta> (\<lambda>S. S \<subseteq> carrier V \<and> gen_set S)

goal (1 subgoal):
 1. (\<And>\<beta>. \<beta> \<subseteq> A \<and> minimal \<beta> (\<lambda>S. S \<subseteq> carrier V \<and> gen_set S) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<beta> \<subseteq> A \<and> minimal \<beta> (\<lambda>S. S \<subseteq> carrier V \<and> gen_set S)

goal (1 subgoal):
 1. \<exists>\<beta>. finite \<beta> \<and> basis \<beta>
[PROOF STEP]
hence 4: "lin_indpt \<beta>"
[PROOF STATE]
proof (prove)
using this:
\<beta> \<subseteq> A \<and> minimal \<beta> (\<lambda>S. S \<subseteq> carrier V \<and> gen_set S)

goal (1 subgoal):
 1. lin_indpt \<beta>
[PROOF STEP]
apply (intro min_gen_is_li)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<beta> \<subseteq> A \<and> minimal \<beta> (\<lambda>S. S \<subseteq> carrier V \<and> gen_set S) \<Longrightarrow> minimal \<beta> (\<lambda>S. S \<subseteq> carrier V \<and> gen_set S)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lin_indpt \<beta>

goal (1 subgoal):
 1. \<exists>\<beta>. finite \<beta> \<and> basis \<beta>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
lin_indpt \<beta>

goal (1 subgoal):
 1. \<exists>\<beta>. finite \<beta> \<and> basis \<beta>
[PROOF STEP]
from 3
[PROOF STATE]
proof (chain)
picking this:
\<beta> \<subseteq> A \<and> minimal \<beta> (\<lambda>S. S \<subseteq> carrier V \<and> gen_set S)
[PROOF STEP]
have 5: "gen_set \<beta> \<and> \<beta>\<subseteq>carrier V"
[PROOF STATE]
proof (prove)
using this:
\<beta> \<subseteq> A \<and> minimal \<beta> (\<lambda>S. S \<subseteq> carrier V \<and> gen_set S)

goal (1 subgoal):
 1. gen_set \<beta> \<and> \<beta> \<subseteq> carrier V
[PROOF STEP]
apply (unfold minimal_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<beta> \<subseteq> A \<and> (\<beta> \<subseteq> carrier V \<and> gen_set \<beta>) \<and> (\<forall>B. B \<subseteq> \<beta> \<and> B \<subseteq> carrier V \<and> gen_set B \<longrightarrow> B = \<beta>) \<Longrightarrow> gen_set \<beta> \<and> \<beta> \<subseteq> carrier V
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
gen_set \<beta> \<and> \<beta> \<subseteq> carrier V

goal (1 subgoal):
 1. \<exists>\<beta>. finite \<beta> \<and> basis \<beta>
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
gen_set \<beta> \<and> \<beta> \<subseteq> carrier V

goal (1 subgoal):
 1. \<exists>\<beta>. finite \<beta> \<and> basis \<beta>
[PROOF STEP]
from 1 3
[PROOF STATE]
proof (chain)
picking this:
finite A \<and> A \<subseteq> carrier V \<and> gen_set A
\<beta> \<subseteq> A \<and> minimal \<beta> (\<lambda>S. S \<subseteq> carrier V \<and> gen_set S)
[PROOF STEP]
have 6: "finite \<beta>"
[PROOF STATE]
proof (prove)
using this:
finite A \<and> A \<subseteq> carrier V \<and> gen_set A
\<beta> \<subseteq> A \<and> minimal \<beta> (\<lambda>S. S \<subseteq> carrier V \<and> gen_set S)

goal (1 subgoal):
 1. finite \<beta>
[PROOF STEP]
by (auto simp add: finite_subset)
[PROOF STATE]
proof (state)
this:
finite \<beta>

goal (1 subgoal):
 1. \<exists>\<beta>. finite \<beta> \<and> basis \<beta>
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
lin_indpt \<beta>
gen_set \<beta> \<and> \<beta> \<subseteq> carrier V
finite \<beta>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
lin_indpt \<beta>
gen_set \<beta> \<and> \<beta> \<subseteq> carrier V
finite \<beta>

goal (1 subgoal):
 1. \<exists>\<beta>. finite \<beta> \<and> basis \<beta>
[PROOF STEP]
apply (unfold basis_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>lin_indpt \<beta>; gen_set \<beta> \<and> \<beta> \<subseteq> carrier V; finite \<beta>\<rbrakk> \<Longrightarrow> \<exists>\<beta>. finite \<beta> \<and> lin_indpt \<beta> \<and> gen_set \<beta> \<and> \<beta> \<subseteq> carrier V
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>\<beta>. finite \<beta> \<and> basis \<beta>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma resolveFalseClauses:
  fixes literal :: Literal and clause1 :: Clause and clause2 :: Clause and valuation :: Valuation
  assumes
  "clauseFalse (removeAll literal clause1) valuation" and
  "clauseFalse (removeAll (opposite literal) clause2) valuation"
  shows "clauseFalse (resolve clause1 clause2 literal) valuation"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. clauseFalse (resolve clause1 clause2 literal) valuation
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. clauseFalse (resolve clause1 clause2 literal) valuation
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. clauseFalse (resolve clause1 clause2 literal) valuation
[PROOF STEP]
fix l :: Literal
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. clauseFalse (resolve clause1 clause2 literal) valuation
[PROOF STEP]
assume "l el (resolve clause1 clause2 literal)"
[PROOF STATE]
proof (state)
this:
l el resolve clause1 clause2 literal

goal (1 subgoal):
 1. clauseFalse (resolve clause1 clause2 literal) valuation
[PROOF STEP]
have "literalFalse l valuation"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. literalFalse l valuation
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. literalFalse l valuation
[PROOF STEP]
from \<open>l el (resolve clause1 clause2 literal)\<close>
[PROOF STATE]
proof (chain)
picking this:
l el resolve clause1 clause2 literal
[PROOF STEP]
have "l el (removeAll literal clause1) \<or> l el (removeAll (opposite literal) clause2)"
[PROOF STATE]
proof (prove)
using this:
l el resolve clause1 clause2 literal

goal (1 subgoal):
 1. l el removeAll literal clause1 \<or> l el removeAll (opposite literal) clause2
[PROOF STEP]
unfolding resolve_def
[PROOF STATE]
proof (prove)
using this:
l el removeAll literal clause1 @ removeAll (opposite literal) clause2

goal (1 subgoal):
 1. l el removeAll literal clause1 \<or> l el removeAll (opposite literal) clause2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
l el removeAll literal clause1 \<or> l el removeAll (opposite literal) clause2

goal (1 subgoal):
 1. literalFalse l valuation
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
l el removeAll literal clause1 \<or> l el removeAll (opposite literal) clause2

goal (1 subgoal):
 1. literalFalse l valuation
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. l el removeAll literal clause1 \<Longrightarrow> literalFalse l valuation
 2. l el removeAll (opposite literal) clause2 \<Longrightarrow> literalFalse l valuation
[PROOF STEP]
assume "l el (removeAll literal clause1)"
[PROOF STATE]
proof (state)
this:
l el removeAll literal clause1

goal (2 subgoals):
 1. l el removeAll literal clause1 \<Longrightarrow> literalFalse l valuation
 2. l el removeAll (opposite literal) clause2 \<Longrightarrow> literalFalse l valuation
[PROOF STEP]
thus "literalFalse l valuation"
[PROOF STATE]
proof (prove)
using this:
l el removeAll literal clause1

goal (1 subgoal):
 1. literalFalse l valuation
[PROOF STEP]
using \<open>clauseFalse (removeAll literal clause1) valuation\<close>
[PROOF STATE]
proof (prove)
using this:
l el removeAll literal clause1
clauseFalse (removeAll literal clause1) valuation

goal (1 subgoal):
 1. literalFalse l valuation
[PROOF STEP]
by (simp add: clauseFalseIffAllLiteralsAreFalse)
[PROOF STATE]
proof (state)
this:
literalFalse l valuation

goal (1 subgoal):
 1. l el removeAll (opposite literal) clause2 \<Longrightarrow> literalFalse l valuation
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. l el removeAll (opposite literal) clause2 \<Longrightarrow> literalFalse l valuation
[PROOF STEP]
assume "l el (removeAll (opposite literal) clause2)"
[PROOF STATE]
proof (state)
this:
l el removeAll (opposite literal) clause2

goal (1 subgoal):
 1. l el removeAll (opposite literal) clause2 \<Longrightarrow> literalFalse l valuation
[PROOF STEP]
thus "literalFalse l valuation"
[PROOF STATE]
proof (prove)
using this:
l el removeAll (opposite literal) clause2

goal (1 subgoal):
 1. literalFalse l valuation
[PROOF STEP]
using \<open>clauseFalse (removeAll (opposite literal) clause2) valuation\<close>
[PROOF STATE]
proof (prove)
using this:
l el removeAll (opposite literal) clause2
clauseFalse (removeAll (opposite literal) clause2) valuation

goal (1 subgoal):
 1. literalFalse l valuation
[PROOF STEP]
by (simp add: clauseFalseIffAllLiteralsAreFalse)
[PROOF STATE]
proof (state)
this:
literalFalse l valuation

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
literalFalse l valuation

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
literalFalse l valuation

goal (1 subgoal):
 1. clauseFalse (resolve clause1 clause2 literal) valuation
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?l2 el resolve clause1 clause2 literal \<Longrightarrow> literalFalse ?l2 valuation

goal (1 subgoal):
 1. clauseFalse (resolve clause1 clause2 literal) valuation
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
?l2 el resolve clause1 clause2 literal \<Longrightarrow> literalFalse ?l2 valuation

goal (1 subgoal):
 1. clauseFalse (resolve clause1 clause2 literal) valuation
[PROOF STEP]
by (simp add: clauseFalseIffAllLiteralsAreFalse)
[PROOF STATE]
proof (state)
this:
clauseFalse (resolve clause1 clause2 literal) valuation

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Constrains_eq_constrains:
     "A Co B = {F. F \<in> (reachable F  \<inter>  A) co (reachable F  \<inter>  B)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A Co B = {F. F \<in> reachable F \<inter> A co reachable F \<inter> B}
[PROOF STEP]
apply (unfold Constrains_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {F. F \<in> reachable F \<inter> A co B} = {F. F \<in> reachable F \<inter> A co reachable F \<inter> B}
[PROOF STEP]
apply (blast dest: constrains_reachable_Int intro: constrains_weaken)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma sum_upto_mangoldt_le:
  assumes "x \<ge> 0"
  shows   "sum_upto mangoldt x \<le> 3 / 2 * x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_upto mangoldt x \<le> 3 / 2 * x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum_upto mangoldt x \<le> 3 / 2 * x
[PROOF STEP]
have "sum_upto mangoldt x = psi (nat \<lfloor>x\<rfloor>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_upto mangoldt x = psi (nat \<lfloor>x\<rfloor>)
[PROOF STEP]
by (simp add: sum_upto_altdef psi_def atLeastSucAtMost_greaterThanAtMost)
[PROOF STATE]
proof (state)
this:
sum_upto mangoldt x = psi (nat \<lfloor>x\<rfloor>)

goal (1 subgoal):
 1. sum_upto mangoldt x \<le> 3 / 2 * x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum_upto mangoldt x = psi (nat \<lfloor>x\<rfloor>)

goal (1 subgoal):
 1. sum_upto mangoldt x \<le> 3 / 2 * x
[PROOF STEP]
have "\<dots> \<le> 551 / 256 * ln 2 * real (nat \<lfloor>x\<rfloor>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. psi (nat \<lfloor>x\<rfloor>) \<le> 551 / 256 * ln 2 * real (nat \<lfloor>x\<rfloor>)
[PROOF STEP]
by (rule psi_ubound_log)
[PROOF STATE]
proof (state)
this:
psi (nat \<lfloor>x\<rfloor>) \<le> 551 / 256 * ln 2 * real (nat \<lfloor>x\<rfloor>)

goal (1 subgoal):
 1. sum_upto mangoldt x \<le> 3 / 2 * x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
psi (nat \<lfloor>x\<rfloor>) \<le> 551 / 256 * ln 2 * real (nat \<lfloor>x\<rfloor>)

goal (1 subgoal):
 1. sum_upto mangoldt x \<le> 3 / 2 * x
[PROOF STEP]
have "\<dots> \<le> 3 / 2 * real (nat \<lfloor>x\<rfloor>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 551 / 256 * ln 2 * real (nat \<lfloor>x\<rfloor>) \<le> 3 / 2 * real (nat \<lfloor>x\<rfloor>)
[PROOF STEP]
using Bertrand.ln_2_le
[PROOF STATE]
proof (prove)
using this:
ln 2 \<le> 355 / 512

goal (1 subgoal):
 1. 551 / 256 * ln 2 * real (nat \<lfloor>x\<rfloor>) \<le> 3 / 2 * real (nat \<lfloor>x\<rfloor>)
[PROOF STEP]
by (intro mult_right_mono) auto
[PROOF STATE]
proof (state)
this:
551 / 256 * ln 2 * real (nat \<lfloor>x\<rfloor>) \<le> 3 / 2 * real (nat \<lfloor>x\<rfloor>)

goal (1 subgoal):
 1. sum_upto mangoldt x \<le> 3 / 2 * x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
551 / 256 * ln 2 * real (nat \<lfloor>x\<rfloor>) \<le> 3 / 2 * real (nat \<lfloor>x\<rfloor>)

goal (1 subgoal):
 1. sum_upto mangoldt x \<le> 3 / 2 * x
[PROOF STEP]
have "\<dots> \<le> 3 / 2 * x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3 / 2 * real (nat \<lfloor>x\<rfloor>) \<le> 3 / 2 * x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 \<le> x

goal (1 subgoal):
 1. 3 / 2 * real (nat \<lfloor>x\<rfloor>) \<le> 3 / 2 * x
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
3 / 2 * real (nat \<lfloor>x\<rfloor>) \<le> 3 / 2 * x

goal (1 subgoal):
 1. sum_upto mangoldt x \<le> 3 / 2 * x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sum_upto mangoldt x \<le> 3 / 2 * x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sum_upto mangoldt x \<le> 3 / 2 * x

goal (1 subgoal):
 1. sum_upto mangoldt x \<le> 3 / 2 * x
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
sum_upto mangoldt x \<le> 3 / 2 * x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma index_smult_vec[simp]:
  "i < dim_vec v \<Longrightarrow> (a \<cdot>\<^sub>v v) $ i = a * v $ i" "dim_vec (a \<cdot>\<^sub>v v) = dim_vec v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (i < dim_vec v \<Longrightarrow> (a \<cdot>\<^sub>v v) $ i = a * v $ i) &&& dim_vec (a \<cdot>\<^sub>v v) = dim_vec v
[PROOF STEP]
unfolding smult_vec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (i < dim_vec v \<Longrightarrow> vec (dim_vec v) (\<lambda>i. a * v $ i) $ i = a * v $ i) &&& dim_vec (vec (dim_vec v) (\<lambda>i. a * v $ i)) = dim_vec v
[PROOF STEP]
by auto


[STATEMENT]
lemma rows_transpose[simp]: "rows A\<^sup>T = cols A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rows A\<^sup>T = cols A
[PROOF STEP]
unfolding cols_def rows_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (row A\<^sup>T) [0..<dim_row A\<^sup>T] = map (col A) [0..<dim_col A]
[PROOF STEP]
by auto


[STATEMENT]
lemma distr_bij_count_space:
  assumes f: "bij_betw f A B"
  shows "distr (count_space A) (count_space B) f = count_space B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distr (count_space A) (count_space B) f = count_space B
[PROOF STEP]
proof (rule measure_eqI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. sets (distr (count_space A) (count_space B) f) = sets (count_space B)
 2. \<And>Aa. Aa \<in> sets (distr (count_space A) (count_space B) f) \<Longrightarrow> emeasure (distr (count_space A) (count_space B) f) Aa = emeasure (count_space B) Aa
[PROOF STEP]
have f': "f \<in> measurable (count_space A) (count_space B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> count_space A \<rightarrow>\<^sub>M count_space B
[PROOF STEP]
using f
[PROOF STATE]
proof (prove)
using this:
bij_betw f A B

goal (1 subgoal):
 1. f \<in> count_space A \<rightarrow>\<^sub>M count_space B
[PROOF STEP]
unfolding Pi_def bij_betw_def
[PROOF STATE]
proof (prove)
using this:
inj_on f A \<and> f ` A = B

goal (1 subgoal):
 1. f \<in> count_space A \<rightarrow>\<^sub>M count_space B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f \<in> count_space A \<rightarrow>\<^sub>M count_space B

goal (2 subgoals):
 1. sets (distr (count_space A) (count_space B) f) = sets (count_space B)
 2. \<And>Aa. Aa \<in> sets (distr (count_space A) (count_space B) f) \<Longrightarrow> emeasure (distr (count_space A) (count_space B) f) Aa = emeasure (count_space B) Aa
[PROOF STEP]
fix X
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. sets (distr (count_space A) (count_space B) f) = sets (count_space B)
 2. \<And>Aa. Aa \<in> sets (distr (count_space A) (count_space B) f) \<Longrightarrow> emeasure (distr (count_space A) (count_space B) f) Aa = emeasure (count_space B) Aa
[PROOF STEP]
assume "X \<in> sets (distr (count_space A) (count_space B) f)"
[PROOF STATE]
proof (state)
this:
X \<in> sets (distr (count_space A) (count_space B) f)

goal (2 subgoals):
 1. sets (distr (count_space A) (count_space B) f) = sets (count_space B)
 2. \<And>Aa. Aa \<in> sets (distr (count_space A) (count_space B) f) \<Longrightarrow> emeasure (distr (count_space A) (count_space B) f) Aa = emeasure (count_space B) Aa
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
X \<in> sets (distr (count_space A) (count_space B) f)
[PROOF STEP]
have X: "X \<in> sets (count_space B)"
[PROOF STATE]
proof (prove)
using this:
X \<in> sets (distr (count_space A) (count_space B) f)

goal (1 subgoal):
 1. X \<in> sets (count_space B)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
X \<in> sets (count_space B)

goal (2 subgoals):
 1. sets (distr (count_space A) (count_space B) f) = sets (count_space B)
 2. \<And>Aa. Aa \<in> sets (distr (count_space A) (count_space B) f) \<Longrightarrow> emeasure (distr (count_space A) (count_space B) f) Aa = emeasure (count_space B) Aa
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
X \<in> sets (count_space B)

goal (2 subgoals):
 1. sets (distr (count_space A) (count_space B) f) = sets (count_space B)
 2. \<And>Aa. Aa \<in> sets (distr (count_space A) (count_space B) f) \<Longrightarrow> emeasure (distr (count_space A) (count_space B) f) Aa = emeasure (count_space B) Aa
[PROOF STEP]
from X
[PROOF STATE]
proof (chain)
picking this:
X \<in> sets (count_space B)
[PROOF STEP]
have "f -` X \<inter> A = the_inv_into A f ` X"
[PROOF STATE]
proof (prove)
using this:
X \<in> sets (count_space B)

goal (1 subgoal):
 1. f -` X \<inter> A = the_inv_into A f ` X
[PROOF STEP]
using f
[PROOF STATE]
proof (prove)
using this:
X \<in> sets (count_space B)
bij_betw f A B

goal (1 subgoal):
 1. f -` X \<inter> A = the_inv_into A f ` X
[PROOF STEP]
by (auto simp: bij_betw_def subset_image_iff image_iff the_inv_into_f_f intro: the_inv_into_f_f[symmetric])
[PROOF STATE]
proof (state)
this:
f -` X \<inter> A = the_inv_into A f ` X

goal (2 subgoals):
 1. sets (distr (count_space A) (count_space B) f) = sets (count_space B)
 2. \<And>Aa. Aa \<in> sets (distr (count_space A) (count_space B) f) \<Longrightarrow> emeasure (distr (count_space A) (count_space B) f) Aa = emeasure (count_space B) Aa
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
f -` X \<inter> A = the_inv_into A f ` X

goal (2 subgoals):
 1. sets (distr (count_space A) (count_space B) f) = sets (count_space B)
 2. \<And>Aa. Aa \<in> sets (distr (count_space A) (count_space B) f) \<Longrightarrow> emeasure (distr (count_space A) (count_space B) f) Aa = emeasure (count_space B) Aa
[PROOF STEP]
have "inj_on (the_inv_into A f) B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (the_inv_into A f) B
[PROOF STEP]
using X f
[PROOF STATE]
proof (prove)
using this:
X \<in> sets (count_space B)
bij_betw f A B

goal (1 subgoal):
 1. inj_on (the_inv_into A f) B
[PROOF STEP]
by (auto simp: bij_betw_def inj_on_the_inv_into)
[PROOF STATE]
proof (state)
this:
inj_on (the_inv_into A f) B

goal (2 subgoals):
 1. sets (distr (count_space A) (count_space B) f) = sets (count_space B)
 2. \<And>Aa. Aa \<in> sets (distr (count_space A) (count_space B) f) \<Longrightarrow> emeasure (distr (count_space A) (count_space B) f) Aa = emeasure (count_space B) Aa
[PROOF STEP]
with X
[PROOF STATE]
proof (chain)
picking this:
X \<in> sets (count_space B)
inj_on (the_inv_into A f) B
[PROOF STEP]
have "inj_on (the_inv_into A f) X"
[PROOF STATE]
proof (prove)
using this:
X \<in> sets (count_space B)
inj_on (the_inv_into A f) B

goal (1 subgoal):
 1. inj_on (the_inv_into A f) X
[PROOF STEP]
by (auto intro: subset_inj_on)
[PROOF STATE]
proof (state)
this:
inj_on (the_inv_into A f) X

goal (2 subgoals):
 1. sets (distr (count_space A) (count_space B) f) = sets (count_space B)
 2. \<And>Aa. Aa \<in> sets (distr (count_space A) (count_space B) f) \<Longrightarrow> emeasure (distr (count_space A) (count_space B) f) Aa = emeasure (count_space B) Aa
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
X \<in> sets (count_space B)
f -` X \<inter> A = the_inv_into A f ` X
inj_on (the_inv_into A f) X
[PROOF STEP]
show "emeasure (distr (count_space A) (count_space B) f) X = emeasure (count_space B) X"
[PROOF STATE]
proof (prove)
using this:
X \<in> sets (count_space B)
f -` X \<inter> A = the_inv_into A f ` X
inj_on (the_inv_into A f) X

goal (1 subgoal):
 1. emeasure (distr (count_space A) (count_space B) f) X = emeasure (count_space B) X
[PROOF STEP]
using f
[PROOF STATE]
proof (prove)
using this:
X \<in> sets (count_space B)
f -` X \<inter> A = the_inv_into A f ` X
inj_on (the_inv_into A f) X
bij_betw f A B

goal (1 subgoal):
 1. emeasure (distr (count_space A) (count_space B) f) X = emeasure (count_space B) X
[PROOF STEP]
unfolding emeasure_distr[OF f' X]
[PROOF STATE]
proof (prove)
using this:
X \<in> sets (count_space B)
f -` X \<inter> A = the_inv_into A f ` X
inj_on (the_inv_into A f) X
bij_betw f A B

goal (1 subgoal):
 1. emeasure (count_space A) (f -` X \<inter> space (count_space A)) = emeasure (count_space B) X
[PROOF STEP]
by (subst (1 2) emeasure_count_space) (auto simp: card_image dest: finite_imageD)
[PROOF STATE]
proof (state)
this:
emeasure (distr (count_space A) (count_space B) f) X = emeasure (count_space B) X

goal (1 subgoal):
 1. sets (distr (count_space A) (count_space B) f) = sets (count_space B)
[PROOF STEP]
qed simp


[STATEMENT]
lemma non_colinear_A'B'P :
  assumes "rk {A, B, P} = 3" and "rk {A, A', P} = 2" and "rk {B, B', P} = 2" and "rk {A', P} = 2"
and "rk {B', P} = 2"
  shows "rk {A', B', P} = 3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rk {A', B', P} = 3
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rk {A', B', P} = 3
[PROOF STEP]
have f1:"rk {A', B', P} \<le> 3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rk {A', B', P} \<le> 3
[PROOF STEP]
using rk_triple_le
[PROOF STATE]
proof (prove)
using this:
rk {?A, ?B, ?C} \<le> 3

goal (1 subgoal):
 1. rk {A', B', P} \<le> 3
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rk {A', B', P} \<le> 3

goal (1 subgoal):
 1. rk {A', B', P} = 3
[PROOF STEP]
have "rk {A, B, A', B', P} \<ge> 3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3 \<le> rk {A, B, A', B', P}
[PROOF STEP]
using assms(1) matroid_ax_2
[PROOF STATE]
proof (prove)
using this:
rk {A, B, P} = 3
?X \<subseteq> ?Y \<longrightarrow> rk ?X \<le> rk ?Y

goal (1 subgoal):
 1. 3 \<le> rk {A, B, A', B', P}
[PROOF STEP]
by (metis insert_mono insert_subset subset_insertI)
[PROOF STATE]
proof (state)
this:
3 \<le> rk {A, B, A', B', P}

goal (1 subgoal):
 1. rk {A', B', P} = 3
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
3 \<le> rk {A, B, A', B', P}
[PROOF STEP]
have f2:"rk {A, B, A', B', P} = 3"
[PROOF STATE]
proof (prove)
using this:
3 \<le> rk {A, B, A', B', P}

goal (1 subgoal):
 1. rk {A, B, A', B', P} = 3
[PROOF STEP]
using matroid_ax_3_alt[of "{P}" "{A, A', P}" "{B, B', P}"] assms(2) assms(3)
[PROOF STATE]
proof (prove)
using this:
3 \<le> rk {A, B, A', B', P}
{P} \<subseteq> {A, A', P} \<inter> {B, B', P} \<Longrightarrow> rk ({A, A', P} \<union> {B, B', P}) + rk {P} \<le> rk {A, A', P} + rk {B, B', P}
rk {A, A', P} = 2
rk {B, B', P} = 2

goal (1 subgoal):
 1. rk {A, B, A', B', P} = 3
[PROOF STEP]
by (simp add: insert_commute rk_singleton)
[PROOF STATE]
proof (state)
this:
rk {A, B, A', B', P} = 3

goal (1 subgoal):
 1. rk {A', B', P} = 3
[PROOF STEP]
have "rk {A, B, A', B', P} + rk {B', P} \<le> rk {A, A', B', P} + rk {B, B', P}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rk {A, B, A', B', P} + rk {B', P} \<le> rk {A, A', B', P} + rk {B, B', P}
[PROOF STEP]
using matroid_ax_3_alt[of "{B', P}" "{A, A', B', P}" "{B, B', P}"]
[PROOF STATE]
proof (prove)
using this:
{B', P} \<subseteq> {A, A', B', P} \<inter> {B, B', P} \<Longrightarrow> rk ({A, A', B', P} \<union> {B, B', P}) + rk {B', P} \<le> rk {A, A', B', P} + rk {B, B', P}

goal (1 subgoal):
 1. rk {A, B, A', B', P} + rk {B', P} \<le> rk {A, A', B', P} + rk {B, B', P}
[PROOF STEP]
by (simp add: insert_commute)
[PROOF STATE]
proof (state)
this:
rk {A, B, A', B', P} + rk {B', P} \<le> rk {A, A', B', P} + rk {B, B', P}

goal (1 subgoal):
 1. rk {A', B', P} = 3
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rk {A, B, A', B', P} + rk {B', P} \<le> rk {A, A', B', P} + rk {B, B', P}
[PROOF STEP]
have "rk {A, A', B', P} \<ge> 3"
[PROOF STATE]
proof (prove)
using this:
rk {A, B, A', B', P} + rk {B', P} \<le> rk {A, A', B', P} + rk {B, B', P}

goal (1 subgoal):
 1. 3 \<le> rk {A, A', B', P}
[PROOF STEP]
using f2 assms(3) assms(5)
[PROOF STATE]
proof (prove)
using this:
rk {A, B, A', B', P} + rk {B', P} \<le> rk {A, A', B', P} + rk {B, B', P}
rk {A, B, A', B', P} = 3
rk {B, B', P} = 2
rk {B', P} = 2

goal (1 subgoal):
 1. 3 \<le> rk {A, A', B', P}
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
3 \<le> rk {A, A', B', P}

goal (1 subgoal):
 1. rk {A', B', P} = 3
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
3 \<le> rk {A, A', B', P}
[PROOF STEP]
have f3:"rk {A, A', B', P} = 3"
[PROOF STATE]
proof (prove)
using this:
3 \<le> rk {A, A', B', P}

goal (1 subgoal):
 1. rk {A, A', B', P} = 3
[PROOF STEP]
using f2 matroid_ax_2
[PROOF STATE]
proof (prove)
using this:
3 \<le> rk {A, A', B', P}
rk {A, B, A', B', P} = 3
?X \<subseteq> ?Y \<longrightarrow> rk ?X \<le> rk ?Y

goal (1 subgoal):
 1. rk {A, A', B', P} = 3
[PROOF STEP]
by (metis eq_iff insert_commute subset_insertI)
[PROOF STATE]
proof (state)
this:
rk {A, A', B', P} = 3

goal (1 subgoal):
 1. rk {A', B', P} = 3
[PROOF STEP]
have "rk {A, A', B', P} + rk {A', P} \<le> rk {A', B', P} + rk {A, A', P}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rk {A, A', B', P} + rk {A', P} \<le> rk {A', B', P} + rk {A, A', P}
[PROOF STEP]
using matroid_ax_3_alt[of "{A', P}" "{A', B', P}" "{A, A', P}"]
[PROOF STATE]
proof (prove)
using this:
{A', P} \<subseteq> {A', B', P} \<inter> {A, A', P} \<Longrightarrow> rk ({A', B', P} \<union> {A, A', P}) + rk {A', P} \<le> rk {A', B', P} + rk {A, A', P}

goal (1 subgoal):
 1. rk {A, A', B', P} + rk {A', P} \<le> rk {A', B', P} + rk {A, A', P}
[PROOF STEP]
by (simp add: insert_commute)
[PROOF STATE]
proof (state)
this:
rk {A, A', B', P} + rk {A', P} \<le> rk {A', B', P} + rk {A, A', P}

goal (1 subgoal):
 1. rk {A', B', P} = 3
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
rk {A, A', B', P} + rk {A', P} \<le> rk {A', B', P} + rk {A, A', P}
[PROOF STEP]
have "rk {A', B', P} \<ge> 3"
[PROOF STATE]
proof (prove)
using this:
rk {A, A', B', P} + rk {A', P} \<le> rk {A', B', P} + rk {A, A', P}

goal (1 subgoal):
 1. 3 \<le> rk {A', B', P}
[PROOF STEP]
using f3 assms(2) assms(4)
[PROOF STATE]
proof (prove)
using this:
rk {A, A', B', P} + rk {A', P} \<le> rk {A', B', P} + rk {A, A', P}
rk {A, A', B', P} = 3
rk {A, A', P} = 2
rk {A', P} = 2

goal (1 subgoal):
 1. 3 \<le> rk {A', B', P}
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
3 \<le> rk {A', B', P}

goal (1 subgoal):
 1. rk {A', B', P} = 3
[PROOF STEP]
thus "rk {A', B', P} = 3"
[PROOF STATE]
proof (prove)
using this:
3 \<le> rk {A', B', P}

goal (1 subgoal):
 1. rk {A', B', P} = 3
[PROOF STEP]
using f1
[PROOF STATE]
proof (prove)
using this:
3 \<le> rk {A', B', P}
rk {A', B', P} \<le> 3

goal (1 subgoal):
 1. rk {A', B', P} = 3
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
rk {A', B', P} = 3

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_domain_partitions:
  assumes "f \<in> A \<rightarrow>\<^sub>E B"
  assumes "finite B"
  shows "card ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}) = card (f ` A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}) = card (f ` A)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}) = card (f ` A)
[PROOF STEP]
note [simp] = the_elem_eq[OF \<open>f \<in> A \<rightarrow>\<^sub>E B\<close>]
[PROOF STATE]
proof (state)
this:
?b \<in> f ` A \<Longrightarrow> the_elem (f ` {x' \<in> A. f x' = ?b}) = ?b

goal (1 subgoal):
 1. card ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}) = card (f ` A)
[PROOF STEP]
have "bij_betw (\<lambda>X. the_elem (f ` X)) ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}) (f ` A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw (\<lambda>X. the_elem (f ` X)) ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}) (f ` A)
[PROOF STEP]
proof (rule bij_betw_imageI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. inj_on (\<lambda>X. the_elem (f ` X)) ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}})
 2. (\<lambda>X. the_elem (f ` X)) ` ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}) = f ` A
[PROOF STEP]
show "inj_on (\<lambda>X. the_elem (f ` X)) ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (\<lambda>X. the_elem (f ` X)) ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}})
[PROOF STEP]
proof (rule inj_onI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> (\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}; y \<in> (\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}; the_elem (f ` x) = the_elem (f ` y)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
fix X X'
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> (\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}; y \<in> (\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}; the_elem (f ` x) = the_elem (f ` y)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
assume X: "X \<in> (\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}"
[PROOF STATE]
proof (state)
this:
X \<in> (\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> (\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}; y \<in> (\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}; the_elem (f ` x) = the_elem (f ` y)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
assume X': "X' \<in> (\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}"
[PROOF STATE]
proof (state)
this:
X' \<in> (\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> (\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}; y \<in> (\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}; the_elem (f ` x) = the_elem (f ` y)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
assume eq: "the_elem (f ` X) = the_elem (f ` X')"
[PROOF STATE]
proof (state)
this:
the_elem (f ` X) = the_elem (f ` X')

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> (\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}; y \<in> (\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}; the_elem (f ` x) = the_elem (f ` y)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
from X
[PROOF STATE]
proof (chain)
picking this:
X \<in> (\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}
[PROOF STEP]
obtain b where "b \<in> B" and X_eq: "X = {x \<in> A. f x = b}"
[PROOF STATE]
proof (prove)
using this:
X \<in> (\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}

goal (1 subgoal):
 1. (\<And>b. \<lbrakk>b \<in> B; X = {x \<in> A. f x = b}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
b \<in> B
X = {x \<in> A. f x = b}

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> (\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}; y \<in> (\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}; the_elem (f ` x) = the_elem (f ` y)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
from X this
[PROOF STATE]
proof (chain)
picking this:
X \<in> (\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}
b \<in> B
X = {x \<in> A. f x = b}
[PROOF STEP]
have "b \<in> f ` A"
[PROOF STATE]
proof (prove)
using this:
X \<in> (\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}
b \<in> B
X = {x \<in> A. f x = b}

goal (1 subgoal):
 1. b \<in> f ` A
[PROOF STEP]
using Collect_empty_eq Diff_iff image_iff insertCI
[PROOF STATE]
proof (prove)
using this:
X \<in> (\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}
b \<in> B
X = {x \<in> A. f x = b}
(Collect ?P = {}) = (\<forall>x. \<not> ?P x)
(?c \<in> ?A - ?B) = (?c \<in> ?A \<and> ?c \<notin> ?B)
(?z \<in> ?f ` ?A) = (\<exists>x\<in>?A. ?z = ?f x)
(?a \<notin> ?B \<Longrightarrow> ?a = ?b) \<Longrightarrow> ?a \<in> insert ?b ?B

goal (1 subgoal):
 1. b \<in> f ` A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
b \<in> f ` A

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> (\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}; y \<in> (\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}; the_elem (f ` x) = the_elem (f ` y)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
from X'
[PROOF STATE]
proof (chain)
picking this:
X' \<in> (\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}
[PROOF STEP]
obtain b' where "b' \<in> B" and X'_eq: "X' = {x \<in> A. f x = b'}"
[PROOF STATE]
proof (prove)
using this:
X' \<in> (\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}

goal (1 subgoal):
 1. (\<And>b'. \<lbrakk>b' \<in> B; X' = {x \<in> A. f x = b'}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
b' \<in> B
X' = {x \<in> A. f x = b'}

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> (\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}; y \<in> (\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}; the_elem (f ` x) = the_elem (f ` y)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
from X' this
[PROOF STATE]
proof (chain)
picking this:
X' \<in> (\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}
b' \<in> B
X' = {x \<in> A. f x = b'}
[PROOF STEP]
have "b' \<in> f ` A"
[PROOF STATE]
proof (prove)
using this:
X' \<in> (\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}
b' \<in> B
X' = {x \<in> A. f x = b'}

goal (1 subgoal):
 1. b' \<in> f ` A
[PROOF STEP]
using Collect_empty_eq Diff_iff image_iff insertCI
[PROOF STATE]
proof (prove)
using this:
X' \<in> (\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}
b' \<in> B
X' = {x \<in> A. f x = b'}
(Collect ?P = {}) = (\<forall>x. \<not> ?P x)
(?c \<in> ?A - ?B) = (?c \<in> ?A \<and> ?c \<notin> ?B)
(?z \<in> ?f ` ?A) = (\<exists>x\<in>?A. ?z = ?f x)
(?a \<notin> ?B \<Longrightarrow> ?a = ?b) \<Longrightarrow> ?a \<in> insert ?b ?B

goal (1 subgoal):
 1. b' \<in> f ` A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
b' \<in> f ` A

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> (\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}; y \<in> (\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}; the_elem (f ` x) = the_elem (f ` y)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
from X_eq X'_eq eq \<open>\<And>b. b \<in> f ` A \<Longrightarrow> the_elem (f ` {x' \<in> A. f x' = b}) = b\<close> \<open>b \<in> f ` A\<close> \<open>b' \<in> f ` A\<close>
[PROOF STATE]
proof (chain)
picking this:
X = {x \<in> A. f x = b}
X' = {x \<in> A. f x = b'}
the_elem (f ` X) = the_elem (f ` X')
?b \<in> f ` A \<Longrightarrow> the_elem (f ` {x' \<in> A. f x' = ?b}) = ?b
b \<in> f ` A
b' \<in> f ` A
[PROOF STEP]
have "b = b'"
[PROOF STATE]
proof (prove)
using this:
X = {x \<in> A. f x = b}
X' = {x \<in> A. f x = b'}
the_elem (f ` X) = the_elem (f ` X')
?b \<in> f ` A \<Longrightarrow> the_elem (f ` {x' \<in> A. f x' = ?b}) = ?b
b \<in> f ` A
b' \<in> f ` A

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

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> (\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}; y \<in> (\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}; the_elem (f ` x) = the_elem (f ` y)\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
b = b'
[PROOF STEP]
show "X = X'"
[PROOF STATE]
proof (prove)
using this:
b = b'

goal (1 subgoal):
 1. X = X'
[PROOF STEP]
using X_eq X'_eq
[PROOF STATE]
proof (prove)
using this:
b = b'
X = {x \<in> A. f x = b}
X' = {x \<in> A. f x = b'}

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
inj_on (\<lambda>X. the_elem (f ` X)) ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}})

goal (1 subgoal):
 1. (\<lambda>X. the_elem (f ` X)) ` ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}) = f ` A
[PROOF STEP]
show "(\<lambda>X. the_elem (f ` X)) ` ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}) = f ` A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>X. the_elem (f ` X)) ` ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}) = f ` A
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<lambda>X. the_elem (f ` X)) ` ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}) \<subseteq> f ` A
 2. f ` A \<subseteq> (\<lambda>X. the_elem (f ` X)) ` ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}})
[PROOF STEP]
show "(\<lambda>X. the_elem (f ` X)) ` ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}) \<subseteq> f ` A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>X. the_elem (f ` X)) ` ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}) \<subseteq> f ` A
[PROOF STEP]
using \<open>\<And>b. b \<in> f ` A \<Longrightarrow> the_elem (f ` {x' \<in> A. f x' = b}) = b\<close>
[PROOF STATE]
proof (prove)
using this:
?b \<in> f ` A \<Longrightarrow> the_elem (f ` {x' \<in> A. f x' = ?b}) = ?b

goal (1 subgoal):
 1. (\<lambda>X. the_elem (f ` X)) ` ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}) \<subseteq> f ` A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>X. the_elem (f ` X)) ` ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}) \<subseteq> f ` A

goal (1 subgoal):
 1. f ` A \<subseteq> (\<lambda>X. the_elem (f ` X)) ` ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}})
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f ` A \<subseteq> (\<lambda>X. the_elem (f ` X)) ` ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}})
[PROOF STEP]
show "f ` A \<subseteq> (\<lambda>X. the_elem (f ` X)) ` ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` A \<subseteq> (\<lambda>X. the_elem (f ` X)) ` ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}})
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> f ` A \<Longrightarrow> x \<in> (\<lambda>X. the_elem (f ` X)) ` ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}})
[PROOF STEP]
fix b
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> f ` A \<Longrightarrow> x \<in> (\<lambda>X. the_elem (f ` X)) ` ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}})
[PROOF STEP]
assume "b \<in> f ` A"
[PROOF STATE]
proof (state)
this:
b \<in> f ` A

goal (1 subgoal):
 1. \<And>x. x \<in> f ` A \<Longrightarrow> x \<in> (\<lambda>X. the_elem (f ` X)) ` ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}})
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
b \<in> f ` A
[PROOF STEP]
have "b = the_elem (f ` {x \<in> A. f x = b})"
[PROOF STATE]
proof (prove)
using this:
b \<in> f ` A

goal (1 subgoal):
 1. b = the_elem (f ` {x \<in> A. f x = b})
[PROOF STEP]
using \<open>\<And>b. b \<in> f ` A \<Longrightarrow> the_elem (f ` {x' \<in> A. f x' = b}) = b\<close>
[PROOF STATE]
proof (prove)
using this:
b \<in> f ` A
?b \<in> f ` A \<Longrightarrow> the_elem (f ` {x' \<in> A. f x' = ?b}) = ?b

goal (1 subgoal):
 1. b = the_elem (f ` {x \<in> A. f x = b})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
b = the_elem (f ` {x \<in> A. f x = b})

goal (1 subgoal):
 1. \<And>x. x \<in> f ` A \<Longrightarrow> x \<in> (\<lambda>X. the_elem (f ` X)) ` ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}})
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
b = the_elem (f ` {x \<in> A. f x = b})

goal (1 subgoal):
 1. \<And>x. x \<in> f ` A \<Longrightarrow> x \<in> (\<lambda>X. the_elem (f ` X)) ` ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}})
[PROOF STEP]
from \<open>b \<in> f ` A\<close>
[PROOF STATE]
proof (chain)
picking this:
b \<in> f ` A
[PROOF STEP]
have " {x \<in> A. f x = b} \<in> (\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}"
[PROOF STATE]
proof (prove)
using this:
b \<in> f ` A

goal (1 subgoal):
 1. {x \<in> A. f x = b} \<in> (\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}
[PROOF STEP]
using \<open>f \<in> A \<rightarrow>\<^sub>E B\<close>
[PROOF STATE]
proof (prove)
using this:
b \<in> f ` A
f \<in> A \<rightarrow>\<^sub>E B

goal (1 subgoal):
 1. {x \<in> A. f x = b} \<in> (\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{x \<in> A. f x = b} \<in> (\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}

goal (1 subgoal):
 1. \<And>x. x \<in> f ` A \<Longrightarrow> x \<in> (\<lambda>X. the_elem (f ` X)) ` ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}})
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
b = the_elem (f ` {x \<in> A. f x = b})
{x \<in> A. f x = b} \<in> (\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}
[PROOF STEP]
show "b \<in> (\<lambda>X. the_elem (f ` X)) ` ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}})"
[PROOF STATE]
proof (prove)
using this:
b = the_elem (f ` {x \<in> A. f x = b})
{x \<in> A. f x = b} \<in> (\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}

goal (1 subgoal):
 1. b \<in> (\<lambda>X. the_elem (f ` X)) ` ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}})
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
b \<in> (\<lambda>X. the_elem (f ` X)) ` ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}})

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
f ` A \<subseteq> (\<lambda>X. the_elem (f ` X)) ` ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}})

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>X. the_elem (f ` X)) ` ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}) = f ` A

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
bij_betw (\<lambda>X. the_elem (f ` X)) ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}) (f ` A)

goal (1 subgoal):
 1. card ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}) = card (f ` A)
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
bij_betw (\<lambda>X. the_elem (f ` X)) ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}) (f ` A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
bij_betw (\<lambda>X. the_elem (f ` X)) ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}) (f ` A)

goal (1 subgoal):
 1. card ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}) = card (f ` A)
[PROOF STEP]
by (rule bij_betw_same_card)
[PROOF STATE]
proof (state)
this:
card ((\<lambda>b. {x \<in> A. f x = b}) ` B - {{}}) = card (f ` A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_imp_ENR:
  fixes S :: "'a::euclidean_space set"
  shows "finite S \<Longrightarrow> ENR S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite S \<Longrightarrow> ENR S
[PROOF STEP]
by (simp add: ENR_ANR finite_imp_ANR finite_imp_closed closed_imp_locally_compact)


[STATEMENT]
lemma subst_apply_pairs_nil[simp]: "[] \<cdot>\<^sub>p\<^sub>a\<^sub>i\<^sub>r\<^sub>s \<delta> = []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [] \<cdot>\<^sub>p\<^sub>a\<^sub>i\<^sub>r\<^sub>s \<delta> = []
[PROOF STEP]
unfolding subst_apply_pairs_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (\<lambda>f. f \<cdot>\<^sub>p \<delta>) [] = []
[PROOF STEP]
by simp


[STATEMENT]
lemma (in comm_monoid) units_comm_group: "comm_group (units_of G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. comm_group (units_of G)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. comm_group (units_of G)
[PROOF STEP]
have "\<And>x y. \<lbrakk>x \<in> carrier (units_of G); y \<in> carrier (units_of G)\<rbrakk>
              \<Longrightarrow> x \<otimes>\<^bsub>units_of G\<^esub> y = y \<otimes>\<^bsub>units_of G\<^esub> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>x \<in> carrier (units_of G); y \<in> carrier (units_of G)\<rbrakk> \<Longrightarrow> x \<otimes>\<^bsub>units_of G\<^esub> y = y \<otimes>\<^bsub>units_of G\<^esub> x
[PROOF STEP]
by (simp add: Units_closed m_comm units_of_def)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x \<in> carrier (units_of G); ?y \<in> carrier (units_of G)\<rbrakk> \<Longrightarrow> ?x \<otimes>\<^bsub>units_of G\<^esub> ?y = ?y \<otimes>\<^bsub>units_of G\<^esub> ?x

goal (1 subgoal):
 1. comm_group (units_of G)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?x \<in> carrier (units_of G); ?y \<in> carrier (units_of G)\<rbrakk> \<Longrightarrow> ?x \<otimes>\<^bsub>units_of G\<^esub> ?y = ?y \<otimes>\<^bsub>units_of G\<^esub> ?x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> carrier (units_of G); ?y \<in> carrier (units_of G)\<rbrakk> \<Longrightarrow> ?x \<otimes>\<^bsub>units_of G\<^esub> ?y = ?y \<otimes>\<^bsub>units_of G\<^esub> ?x

goal (1 subgoal):
 1. comm_group (units_of G)
[PROOF STEP]
by (rule group.group_comm_groupI [OF units_group]) auto
[PROOF STATE]
proof (state)
this:
comm_group (units_of G)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nth_rev_equalityI:
  "\<lbrakk>length xs = length ys; \<forall>i<length xs. xs ! (length xs - Suc i) = ys ! (length ys - Suc i)\<rbrakk>
  \<Longrightarrow> xs = ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length xs = length ys; \<forall>i<length xs. xs ! (length xs - Suc i) = ys ! (length ys - Suc i)\<rbrakk> \<Longrightarrow> xs = ys
[PROOF STEP]
proof (induct xs ys rule: list_induct2)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>i<length []. [] ! (length [] - Suc i) = [] ! (length [] - Suc i) \<Longrightarrow> [] = []
 2. \<And>x xs y ys. \<lbrakk>length xs = length ys; \<forall>i<length xs. xs ! (length xs - Suc i) = ys ! (length ys - Suc i) \<Longrightarrow> xs = ys; \<forall>i<length (x # xs). (x # xs) ! (length (x # xs) - Suc i) = (y # ys) ! (length (y # ys) - Suc i)\<rbrakk> \<Longrightarrow> x # xs = y # ys
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
\<forall>i<length []. [] ! (length [] - Suc i) = [] ! (length [] - Suc i)

goal (2 subgoals):
 1. \<forall>i<length []. [] ! (length [] - Suc i) = [] ! (length [] - Suc i) \<Longrightarrow> [] = []
 2. \<And>x xs y ys. \<lbrakk>length xs = length ys; \<forall>i<length xs. xs ! (length xs - Suc i) = ys ! (length ys - Suc i) \<Longrightarrow> xs = ys; \<forall>i<length (x # xs). (x # xs) ! (length (x # xs) - Suc i) = (y # ys) ! (length (y # ys) - Suc i)\<rbrakk> \<Longrightarrow> x # xs = y # ys
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
\<forall>i<length []. [] ! (length [] - Suc i) = [] ! (length [] - Suc i)

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

goal (1 subgoal):
 1. \<And>x xs y ys. \<lbrakk>length xs = length ys; \<forall>i<length xs. xs ! (length xs - Suc i) = ys ! (length ys - Suc i) \<Longrightarrow> xs = ys; \<forall>i<length (x # xs). (x # xs) ! (length (x # xs) - Suc i) = (y # ys) ! (length (y # ys) - Suc i)\<rbrakk> \<Longrightarrow> x # xs = y # ys
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xs y ys. \<lbrakk>length xs = length ys; \<forall>i<length xs. xs ! (length xs - Suc i) = ys ! (length ys - Suc i) \<Longrightarrow> xs = ys; \<forall>i<length (x # xs). (x # xs) ! (length (x # xs) - Suc i) = (y # ys) ! (length (y # ys) - Suc i)\<rbrakk> \<Longrightarrow> x # xs = y # ys
[PROOF STEP]
case (Cons x xs y ys)
[PROOF STATE]
proof (state)
this:
length xs = length ys
\<forall>i<length xs. xs ! (length xs - Suc i) = ys ! (length ys - Suc i) \<Longrightarrow> xs = ys
\<forall>i<length (x # xs). (x # xs) ! (length (x # xs) - Suc i) = (y # ys) ! (length (y # ys) - Suc i)

goal (1 subgoal):
 1. \<And>x xs y ys. \<lbrakk>length xs = length ys; \<forall>i<length xs. xs ! (length xs - Suc i) = ys ! (length ys - Suc i) \<Longrightarrow> xs = ys; \<forall>i<length (x # xs). (x # xs) ! (length (x # xs) - Suc i) = (y # ys) ! (length (y # ys) - Suc i)\<rbrakk> \<Longrightarrow> x # xs = y # ys
[PROOF STEP]
hence "\<forall>i<length ys. xs ! (length ys - Suc i) = ys ! (length ys - Suc i)"
[PROOF STATE]
proof (prove)
using this:
length xs = length ys
\<forall>i<length xs. xs ! (length xs - Suc i) = ys ! (length ys - Suc i) \<Longrightarrow> xs = ys
\<forall>i<length (x # xs). (x # xs) ! (length (x # xs) - Suc i) = (y # ys) ! (length (y # ys) - Suc i)

goal (1 subgoal):
 1. \<forall>i<length ys. xs ! (length ys - Suc i) = ys ! (length ys - Suc i)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>length xs = length ys; \<forall>i<length ys. xs ! (length ys - Suc i) = ys ! (length ys - Suc i) \<Longrightarrow> xs = ys; \<forall>i<Suc (length ys). (x # xs) ! (length ys - i) = (y # ys) ! (length ys - i); i < length ys\<rbrakk> \<Longrightarrow> xs ! (length ys - Suc i) = ys ! (length ys - Suc i)
[PROOF STEP]
apply (erule_tac x="i" in allE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>length xs = length ys; \<forall>i<length ys. xs ! (length ys - Suc i) = ys ! (length ys - Suc i) \<Longrightarrow> xs = ys; i < length ys; i < Suc (length ys) \<longrightarrow> (x # xs) ! (length ys - i) = (y # ys) ! (length ys - i)\<rbrakk> \<Longrightarrow> xs ! (length ys - Suc i) = ys ! (length ys - Suc i)
[PROOF STEP]
by (auto simp: nth_Cons')
[PROOF STATE]
proof (state)
this:
\<forall>i<length ys. xs ! (length ys - Suc i) = ys ! (length ys - Suc i)

goal (1 subgoal):
 1. \<And>x xs y ys. \<lbrakk>length xs = length ys; \<forall>i<length xs. xs ! (length xs - Suc i) = ys ! (length ys - Suc i) \<Longrightarrow> xs = ys; \<forall>i<length (x # xs). (x # xs) ! (length (x # xs) - Suc i) = (y # ys) ! (length (y # ys) - Suc i)\<rbrakk> \<Longrightarrow> x # xs = y # ys
[PROOF STEP]
with Cons
[PROOF STATE]
proof (chain)
picking this:
length xs = length ys
\<forall>i<length xs. xs ! (length xs - Suc i) = ys ! (length ys - Suc i) \<Longrightarrow> xs = ys
\<forall>i<length (x # xs). (x # xs) ! (length (x # xs) - Suc i) = (y # ys) ! (length (y # ys) - Suc i)
\<forall>i<length ys. xs ! (length ys - Suc i) = ys ! (length ys - Suc i)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
length xs = length ys
\<forall>i<length xs. xs ! (length xs - Suc i) = ys ! (length ys - Suc i) \<Longrightarrow> xs = ys
\<forall>i<length (x # xs). (x # xs) ! (length (x # xs) - Suc i) = (y # ys) ! (length (y # ys) - Suc i)
\<forall>i<length ys. xs ! (length ys - Suc i) = ys ! (length ys - Suc i)

goal (1 subgoal):
 1. x # xs = y # ys
[PROOF STEP]
by (auto simp: nth_Cons)
[PROOF STATE]
proof (state)
this:
x # xs = y # ys

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_all_edges_between':
  assumes "finite (uverts G)" "uwellformed G"
  shows "finite (all_edges_between X Y G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (all_edges_between X Y G)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite (all_edges_between X Y G)
[PROOF STEP]
have "finite (\<Union>(uedges G))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (\<Union> (uedges G))
[PROOF STEP]
by (meson Pow_iff all_edges_subset_Pow assms finite_Sup subsetD wellformed_all_edges)
[PROOF STATE]
proof (state)
this:
finite (\<Union> (uedges G))

goal (1 subgoal):
 1. finite (all_edges_between X Y G)
[PROOF STEP]
with all_edges_between_subset_times
[PROOF STATE]
proof (chain)
picking this:
all_edges_between ?X ?Y ?G \<subseteq> (?X \<inter> \<Union> (uedges ?G)) \<times> (?Y \<inter> \<Union> (uedges ?G))
finite (\<Union> (uedges G))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
all_edges_between ?X ?Y ?G \<subseteq> (?X \<inter> \<Union> (uedges ?G)) \<times> (?Y \<inter> \<Union> (uedges ?G))
finite (\<Union> (uedges G))

goal (1 subgoal):
 1. finite (all_edges_between X Y G)
[PROOF STEP]
by (metis finite_Int finite_SigmaI finite_subset)
[PROOF STATE]
proof (state)
this:
finite (all_edges_between X Y G)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in sigma_algebra) sets_Collect_countable_All':
  assumes "\<And>i. i \<in> I \<Longrightarrow> {x\<in>\<Omega>. P i x} \<in> M"
  assumes "countable I"
  shows "{x\<in>\<Omega>. \<forall>i\<in>I. P i x} \<in> M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> \<Omega>. \<forall>i\<in>I. P i x} \<in> M
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {x \<in> \<Omega>. \<forall>i\<in>I. P i x} \<in> M
[PROOF STEP]
have "{x\<in>\<Omega>. \<forall>i\<in>I. P i x} = (\<Inter>i\<in>I. {x\<in>\<Omega>. P i x}) \<inter> \<Omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x \<in> \<Omega>. \<forall>i\<in>I. P i x} = (\<Inter>i\<in>I. {x \<in> \<Omega>. P i x}) \<inter> \<Omega>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{x \<in> \<Omega>. \<forall>i\<in>I. P i x} = (\<Inter>i\<in>I. {x \<in> \<Omega>. P i x}) \<inter> \<Omega>

goal (1 subgoal):
 1. {x \<in> \<Omega>. \<forall>i\<in>I. P i x} \<in> M
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
?i \<in> I \<Longrightarrow> {x \<in> \<Omega>. P ?i x} \<in> M
countable I
{x \<in> \<Omega>. \<forall>i\<in>I. P i x} = (\<Inter>i\<in>I. {x \<in> \<Omega>. P i x}) \<inter> \<Omega>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
?i \<in> I \<Longrightarrow> {x \<in> \<Omega>. P ?i x} \<in> M
countable I
{x \<in> \<Omega>. \<forall>i\<in>I. P i x} = (\<Inter>i\<in>I. {x \<in> \<Omega>. P i x}) \<inter> \<Omega>

goal (1 subgoal):
 1. {x \<in> \<Omega>. \<forall>i\<in>I. P i x} \<in> M
[PROOF STEP]
by (cases "I = {}") (auto intro!: countable_INT')
[PROOF STATE]
proof (state)
this:
{x \<in> \<Omega>. \<forall>i\<in>I. P i x} \<in> M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma continuous_real_sqrt [continuous_intros]:
  "continuous F f \<Longrightarrow> continuous F (\<lambda>x. sqrt (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous F f \<Longrightarrow> continuous F (\<lambda>x. sqrt (f x))
[PROOF STEP]
unfolding sqrt_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous F f \<Longrightarrow> continuous F (\<lambda>x. root 2 (f x))
[PROOF STEP]
by (rule continuous_real_root)


[STATEMENT]
lemma indep_not_basis:
  assumes "indep X"
  assumes "\<not> basis X"
  shows "\<exists>x \<in> carrier - X. indep (insert x X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x\<in>carrier - X. indep (insert x X)
[PROOF STEP]
using assms basisI
[PROOF STATE]
proof (prove)
using this:
indep X
\<not> basis X
\<lbrakk>indep ?X; \<And>x. x \<in> carrier - ?X \<Longrightarrow> \<not> indep (insert x ?X)\<rbrakk> \<Longrightarrow> basis ?X

goal (1 subgoal):
 1. \<exists>x\<in>carrier - X. indep (insert x X)
[PROOF STEP]
by auto


[STATEMENT]
lemma list_of_dlist_insert [simp]: "\<not> member dxs x \<Longrightarrow> list_of_dlist (insert x dxs) = x # list_of_dlist dxs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> member dxs x \<Longrightarrow> list_of_dlist (DList_Set.insert x dxs) = x # list_of_dlist dxs
[PROOF STEP]
by(cases dxs)(auto simp add: DList_Set.insert_def DList_Set.member_def Abs_dlist_inverse Abs_dlist_inject equal_base.list_insert_def List.member_def intro: Abs_dlist_inverse)


[STATEMENT]
lemma rt_Some_sqn [dest]:
    fixes rt and ip dsn dsk flag hops nhip
  assumes "rt ip = Some (dsn, dsk, flag, hops, nhip)"
    shows "sqn rt ip = dsn"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqn rt ip = dsn
[PROOF STEP]
unfolding sqn_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (case rt ip of None \<Rightarrow> 0 | Some r \<Rightarrow> \<pi>\<^sub>2 r) = dsn
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
rt ip = Some (dsn, dsk, flag, hops, nhip)

goal (1 subgoal):
 1. (case rt ip of None \<Rightarrow> 0 | Some r \<Rightarrow> \<pi>\<^sub>2 r) = dsn
[PROOF STEP]
by simp


[STATEMENT]
theorem aval_afold[simp]:
assumes "approx t s"
shows "aval (afold a t) s = aval a s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aval (afold a t) s = aval a s
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
approx t s

goal (1 subgoal):
 1. aval (afold a t) s = aval a s
[PROOF STEP]
by (induct a) (auto simp: approx_def split: aexp.split option.split)


[STATEMENT]
lemma uniform_limit_ge_const:
  fixes f::"'c \<Rightarrow> 'a \<Rightarrow> 'b::{metric_space, linorder_topology}"
  assumes I: "I \<noteq> bot"
  assumes u: "uniform_limit X f g I"
  assumes "\<forall>\<^sub>F i in I. \<forall>x \<in> X. h x \<le> f i x"
  assumes "x \<in> X"
  shows "h x \<le> g x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h x \<le> g x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. h x \<le> g x
[PROOF STEP]
have "\<forall>\<^sub>F i in I. h x \<le> f i x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F i in I. h x \<le> f i x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
I \<noteq> bot
uniform_limit X f g I
\<forall>\<^sub>F i in I. \<forall>x\<in>X. h x \<le> f i x
x \<in> X

goal (1 subgoal):
 1. \<forall>\<^sub>F i in I. h x \<le> f i x
[PROOF STEP]
by (simp add: eventually_mono)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F i in I. h x \<le> f i x

goal (1 subgoal):
 1. h x \<le> g x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F i in I. h x \<le> f i x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F i in I. h x \<le> f i x

goal (1 subgoal):
 1. h x \<le> g x
[PROOF STEP]
by (metis tendsto_lowerbound I tendsto_uniform_limitI[OF u \<open>x \<in> X\<close>])
[PROOF STATE]
proof (state)
this:
h x \<le> g x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma app_vlrestriction_def: "r \<restriction>\<^sup>l\<^sub>\<circ> A = set {\<langle>a, b\<rangle> | a b. a \<in>\<^sub>\<circ> A \<and> \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r \<restriction>\<^sup>l\<^sub>\<circ> A = set {\<langle>a, b\<rangle> |a b. a \<in>\<^sub>\<circ> A \<and> \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r}
[PROOF STEP]
unfolding vlrestriction_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>\<langle>r, A\<rangle>\<in>\<^sub>\<circ>set {\<langle>r, A\<rangle>}. set {\<langle>a, b\<rangle> |a b. a \<in>\<^sub>\<circ> A \<and> \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r})\<lparr>\<langle>r, A\<rangle>\<rparr> = set {\<langle>a, b\<rangle> |a b. a \<in>\<^sub>\<circ> A \<and> \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r}
[PROOF STEP]
by simp