[STATEMENT]
lemma nat_mirror_less: "
  \<lbrakk> a < b; a < l + r \<rbrakk> \<Longrightarrow>
  nat_mirror b l r < nat_mirror a l r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a < b; a < l + r\<rbrakk> \<Longrightarrow> nat_mirror b l r < nat_mirror a l r
[PROOF STEP]
unfolding nat_mirror_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a < b; a < l + r\<rbrakk> \<Longrightarrow> l + r - b < l + r - a
[PROOF STEP]
by simp


[STATEMENT]
lemma L10:
  assumes "\<And> (f :: three \<Rightarrow> three \<Rightarrow> three) h. associative f
             \<Longrightarrow> foldl1 f (map h js) = foldl1 f (map h [0..<k + 1])"
      and "i < k"
  shows "foldl1 f2 (map (h2 i) js) = Two"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldl1 f2 (map (h2 i) js) = Two
[PROOF STEP]
using assms and f2_assoc and Figure_3
[PROOF STATE]
proof (prove)
using this:
associative ?f \<Longrightarrow> foldl1 ?f (map ?h js) = foldl1 ?f (map ?h [0..<k + 1])
i < k
associative f2
?i < ?k \<Longrightarrow> foldl1 f2 (map (h2 ?i) [0..<?k + 1]) = Two

goal (1 subgoal):
 1. foldl1 f2 (map (h2 i) js) = Two
[PROOF STEP]
by auto


[STATEMENT]
lemma R_mult_left_mono: "R a b \<Longrightarrow> c \<ge> 0 \<Longrightarrow> R (c*a) (c*b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R a b; 0 \<le> c\<rbrakk> \<Longrightarrow> R (c * a) (c * b)
[PROOF STEP]
using R
[PROOF STATE]
proof (prove)
using this:
R = (\<le>) \<or> R = (\<lambda>x y. y \<le> x)

goal (1 subgoal):
 1. \<lbrakk>R a b; 0 \<le> c\<rbrakk> \<Longrightarrow> R (c * a) (c * b)
[PROOF STEP]
by (auto simp: mult_left_mono)


[STATEMENT]
lemma Vfin_imp_Efin[simp, intro]: assumes "finite V" shows "finite E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite E
[PROOF STEP]
using E_ss_VxV assms
[PROOF STATE]
proof (prove)
using this:
E \<subseteq> V \<times> V
finite V

goal (1 subgoal):
 1. finite E
[PROOF STEP]
by (auto intro: finite_subset)


[STATEMENT]
lemma cat_Set_obj_prod_up_ArrVal_app_vrange:
  assumes "a \<in>\<^sub>\<circ> A" and "\<And>i. i \<in>\<^sub>\<circ> I \<Longrightarrow> \<phi> i : A \<mapsto>\<^bsub>cat_Set \<alpha>\<^esub> F i"
  shows "\<R>\<^sub>\<circ> (cat_Set_obj_prod_up I F A \<phi>\<lparr>ArrVal\<rparr>\<lparr>a\<rparr>) \<subseteq>\<^sub>\<circ> (\<Union>\<^sub>\<circ>i\<in>\<^sub>\<circ>I. F i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<R>\<^sub>\<circ> (cat_Set_obj_prod_up I F A \<phi>\<lparr>ArrVal\<rparr>\<lparr>a\<rparr>) \<subseteq>\<^sub>\<circ> \<Union>\<^sub>\<circ> (VLambda I F `\<^sub>\<circ> I)
[PROOF STEP]
proof(intro vsubsetI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> \<R>\<^sub>\<circ> (cat_Set_obj_prod_up I F A \<phi>\<lparr>ArrVal\<rparr>\<lparr>a\<rparr>) \<Longrightarrow> x \<in>\<^sub>\<circ> \<Union>\<^sub>\<circ> (VLambda I F `\<^sub>\<circ> I)
[PROOF STEP]
fix b
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> \<R>\<^sub>\<circ> (cat_Set_obj_prod_up I F A \<phi>\<lparr>ArrVal\<rparr>\<lparr>a\<rparr>) \<Longrightarrow> x \<in>\<^sub>\<circ> \<Union>\<^sub>\<circ> (VLambda I F `\<^sub>\<circ> I)
[PROOF STEP]
assume prems: "b \<in>\<^sub>\<circ> \<R>\<^sub>\<circ> (cat_Set_obj_prod_up I F A \<phi>\<lparr>ArrVal\<rparr>\<lparr>a\<rparr>)"
[PROOF STATE]
proof (state)
this:
b \<in>\<^sub>\<circ> \<R>\<^sub>\<circ> (cat_Set_obj_prod_up I F A \<phi>\<lparr>ArrVal\<rparr>\<lparr>a\<rparr>)

goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> \<R>\<^sub>\<circ> (cat_Set_obj_prod_up I F A \<phi>\<lparr>ArrVal\<rparr>\<lparr>a\<rparr>) \<Longrightarrow> x \<in>\<^sub>\<circ> \<Union>\<^sub>\<circ> (VLambda I F `\<^sub>\<circ> I)
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
a \<in>\<^sub>\<circ> A
[PROOF STEP]
have "vsv (cat_Set_obj_prod_up I F A \<phi>\<lparr>ArrVal\<rparr>\<lparr>a\<rparr>)"
[PROOF STATE]
proof (prove)
using this:
a \<in>\<^sub>\<circ> A

goal (1 subgoal):
 1. vsv (cat_Set_obj_prod_up I F A \<phi>\<lparr>ArrVal\<rparr>\<lparr>a\<rparr>)
[PROOF STEP]
by (auto simp: cat_Set_obj_prod_up_components)
[PROOF STATE]
proof (state)
this:
vsv (cat_Set_obj_prod_up I F A \<phi>\<lparr>ArrVal\<rparr>\<lparr>a\<rparr>)

goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> \<R>\<^sub>\<circ> (cat_Set_obj_prod_up I F A \<phi>\<lparr>ArrVal\<rparr>\<lparr>a\<rparr>) \<Longrightarrow> x \<in>\<^sub>\<circ> \<Union>\<^sub>\<circ> (VLambda I F `\<^sub>\<circ> I)
[PROOF STEP]
with prems
[PROOF STATE]
proof (chain)
picking this:
b \<in>\<^sub>\<circ> \<R>\<^sub>\<circ> (cat_Set_obj_prod_up I F A \<phi>\<lparr>ArrVal\<rparr>\<lparr>a\<rparr>)
vsv (cat_Set_obj_prod_up I F A \<phi>\<lparr>ArrVal\<rparr>\<lparr>a\<rparr>)
[PROOF STEP]
obtain i
    where b_def: "b = cat_Set_obj_prod_up I F A \<phi>\<lparr>ArrVal\<rparr>\<lparr>a\<rparr>\<lparr>i\<rparr>"
      and i: "i \<in>\<^sub>\<circ> I"
[PROOF STATE]
proof (prove)
using this:
b \<in>\<^sub>\<circ> \<R>\<^sub>\<circ> (cat_Set_obj_prod_up I F A \<phi>\<lparr>ArrVal\<rparr>\<lparr>a\<rparr>)
vsv (cat_Set_obj_prod_up I F A \<phi>\<lparr>ArrVal\<rparr>\<lparr>a\<rparr>)

goal (1 subgoal):
 1. (\<And>i. \<lbrakk>b = cat_Set_obj_prod_up I F A \<phi>\<lparr>ArrVal\<rparr>\<lparr>a\<rparr>\<lparr>i\<rparr>; i \<in>\<^sub>\<circ> I\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by
      (
        auto
          elim: vsv.vrange_atE
          simp: cat_Set_obj_prod_up_ArrVal_app[OF assms(1)]
      )
[PROOF STATE]
proof (state)
this:
b = cat_Set_obj_prod_up I F A \<phi>\<lparr>ArrVal\<rparr>\<lparr>a\<rparr>\<lparr>i\<rparr>
i \<in>\<^sub>\<circ> I

goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> \<R>\<^sub>\<circ> (cat_Set_obj_prod_up I F A \<phi>\<lparr>ArrVal\<rparr>\<lparr>a\<rparr>) \<Longrightarrow> x \<in>\<^sub>\<circ> \<Union>\<^sub>\<circ> (VLambda I F `\<^sub>\<circ> I)
[PROOF STEP]
from cat_Set_obj_prod_up_ArrVal_app_component[OF assms(1) i] b_def
[PROOF STATE]
proof (chain)
picking this:
cat_Set_obj_prod_up I ?F A ?\<phi>\<lparr>ArrVal\<rparr>\<lparr>a\<rparr>\<lparr>i\<rparr> = ?\<phi> i\<lparr>ArrVal\<rparr>\<lparr>a\<rparr>
b = cat_Set_obj_prod_up I F A \<phi>\<lparr>ArrVal\<rparr>\<lparr>a\<rparr>\<lparr>i\<rparr>
[PROOF STEP]
have b_def':
    "b = \<phi> i\<lparr>ArrVal\<rparr>\<lparr>a\<rparr>"
[PROOF STATE]
proof (prove)
using this:
cat_Set_obj_prod_up I ?F A ?\<phi>\<lparr>ArrVal\<rparr>\<lparr>a\<rparr>\<lparr>i\<rparr> = ?\<phi> i\<lparr>ArrVal\<rparr>\<lparr>a\<rparr>
b = cat_Set_obj_prod_up I F A \<phi>\<lparr>ArrVal\<rparr>\<lparr>a\<rparr>\<lparr>i\<rparr>

goal (1 subgoal):
 1. b = \<phi> i\<lparr>ArrVal\<rparr>\<lparr>a\<rparr>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
b = \<phi> i\<lparr>ArrVal\<rparr>\<lparr>a\<rparr>

goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> \<R>\<^sub>\<circ> (cat_Set_obj_prod_up I F A \<phi>\<lparr>ArrVal\<rparr>\<lparr>a\<rparr>) \<Longrightarrow> x \<in>\<^sub>\<circ> \<Union>\<^sub>\<circ> (VLambda I F `\<^sub>\<circ> I)
[PROOF STEP]
from assms(1) assms(2)[OF i]
[PROOF STATE]
proof (chain)
picking this:
a \<in>\<^sub>\<circ> A
\<phi> i : A \<mapsto>\<^bsub>cat_Set \<alpha>\<^esub> F i
[PROOF STEP]
have "b \<in>\<^sub>\<circ> F i"
[PROOF STATE]
proof (prove)
using this:
a \<in>\<^sub>\<circ> A
\<phi> i : A \<mapsto>\<^bsub>cat_Set \<alpha>\<^esub> F i

goal (1 subgoal):
 1. b \<in>\<^sub>\<circ> F i
[PROOF STEP]
unfolding b_def'
[PROOF STATE]
proof (prove)
using this:
a \<in>\<^sub>\<circ> A
\<phi> i : A \<mapsto>\<^bsub>cat_Set \<alpha>\<^esub> F i

goal (1 subgoal):
 1. \<phi> i\<lparr>ArrVal\<rparr>\<lparr>a\<rparr> \<in>\<^sub>\<circ> F i
[PROOF STEP]
by (cs_concl cs_shallow cs_intro: cat_Set_cs_intros)
[PROOF STATE]
proof (state)
this:
b \<in>\<^sub>\<circ> F i

goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> \<R>\<^sub>\<circ> (cat_Set_obj_prod_up I F A \<phi>\<lparr>ArrVal\<rparr>\<lparr>a\<rparr>) \<Longrightarrow> x \<in>\<^sub>\<circ> \<Union>\<^sub>\<circ> (VLambda I F `\<^sub>\<circ> I)
[PROOF STEP]
with i
[PROOF STATE]
proof (chain)
picking this:
i \<in>\<^sub>\<circ> I
b \<in>\<^sub>\<circ> F i
[PROOF STEP]
show "b \<in>\<^sub>\<circ> (\<Union>\<^sub>\<circ>i\<in>\<^sub>\<circ>I. F i)"
[PROOF STATE]
proof (prove)
using this:
i \<in>\<^sub>\<circ> I
b \<in>\<^sub>\<circ> F i

goal (1 subgoal):
 1. b \<in>\<^sub>\<circ> \<Union>\<^sub>\<circ> (VLambda I F `\<^sub>\<circ> I)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
b \<in>\<^sub>\<circ> \<Union>\<^sub>\<circ> (VLambda I F `\<^sub>\<circ> I)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ac_cong_set3_is_semialgebraic:
  assumes "n > 0"
  shows "is_semialgebraic 2 (ac_cong_set3 n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_semialgebraic 2 (ac_cong_set3 n)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_semialgebraic 2 (ac_cong_set3 n)
[PROOF STEP]
have 0: "finite (ac_cong_set2 n ` (Units (Zp_res_ring n)) )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (ac_cong_set2 n ` Units (residue_ring (p ^ n)))
[PROOF STEP]
using assms residues.finite_Units[of "p^n"]
[PROOF STATE]
proof (prove)
using this:
0 < n
residues (p ^ n) \<Longrightarrow> finite (Units (residue_ring (p ^ n)))

goal (1 subgoal):
 1. finite (ac_cong_set2 n ` Units (residue_ring (p ^ n)))
[PROOF STEP]
unfolding residues_def
[PROOF STATE]
proof (prove)
using this:
0 < n
1 < p ^ n \<Longrightarrow> finite (Units (residue_ring (p ^ n)))

goal (1 subgoal):
 1. finite (ac_cong_set2 n ` Units (residue_ring (p ^ n)))
[PROOF STEP]
using p_residues residues.finite_Units
[PROOF STATE]
proof (prove)
using this:
0 < n
1 < p ^ n \<Longrightarrow> finite (Units (residue_ring (p ^ n)))
0 < ?m \<Longrightarrow> residues (p ^ ?m)
residues ?m \<Longrightarrow> finite (Units (residue_ring ?m))

goal (1 subgoal):
 1. finite (ac_cong_set2 n ` Units (residue_ring (p ^ n)))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
finite (ac_cong_set2 n ` Units (residue_ring (p ^ n)))

goal (1 subgoal):
 1. is_semialgebraic 2 (ac_cong_set3 n)
[PROOF STEP]
have 1: "are_semialgebraic 2 (ac_cong_set2 n ` (Units (Zp_res_ring n)) )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. are_semialgebraic 2 (ac_cong_set2 n ` Units (residue_ring (p ^ n)))
[PROOF STEP]
apply(rule are_semialgebraicI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> ac_cong_set2 n ` Units (residue_ring (p ^ n)) \<Longrightarrow> is_semialgebraic 2 x
[PROOF STEP]
using ac_cong_set2_is_semialg assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?k \<in> Units (residue_ring (p ^ ?n)); 0 < ?n\<rbrakk> \<Longrightarrow> is_semialgebraic 2 (ac_cong_set2 ?n ?k)
0 < n

goal (1 subgoal):
 1. \<And>x. x \<in> ac_cong_set2 n ` Units (residue_ring (p ^ n)) \<Longrightarrow> is_semialgebraic 2 x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
are_semialgebraic 2 (ac_cong_set2 n ` Units (residue_ring (p ^ n)))

goal (1 subgoal):
 1. is_semialgebraic 2 (ac_cong_set3 n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_semialgebraic 2 (ac_cong_set3 n)
[PROOF STEP]
using 0 1 ac_cong_set3_as_union
[PROOF STATE]
proof (prove)
using this:
finite (ac_cong_set2 n ` Units (residue_ring (p ^ n)))
are_semialgebraic 2 (ac_cong_set2 n ` Units (residue_ring (p ^ n)))
0 < ?n \<Longrightarrow> ac_cong_set3 ?n = \<Union> (ac_cong_set2 ?n ` Units (residue_ring (p ^ ?n)))

goal (1 subgoal):
 1. is_semialgebraic 2 (ac_cong_set3 n)
[PROOF STEP]
by (metis (no_types, lifting) are_semialgebraicE assms finite_union_is_semialgebraic' is_semialgebraicE subsetI)
[PROOF STATE]
proof (state)
this:
is_semialgebraic 2 (ac_cong_set3 n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Red_I_of_subset: "N \<subseteq> N' \<Longrightarrow> Red_I N \<subseteq> Red_I N'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. N \<subseteq> N' \<Longrightarrow> Red_I N \<subseteq> Red_I N'
[PROOF STEP]
unfolding Red_I_conv
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. N \<subseteq> N' \<Longrightarrow> fin_std_red.Red_I N \<subseteq> fin_std_red.Red_I N'
[PROOF STEP]
by (rule fin_std_red.Red_I_of_subset)


[STATEMENT]
lemma open_interior [simp, intro]: "open (interior S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open (interior S)
[PROOF STEP]
by (simp add: interior_def open_Union)


[STATEMENT]
lemma limsup_shift_k:
  "limsup (\<lambda>n. u (n+k)) = limsup u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. limsup (\<lambda>n. u (n + k)) = limsup u
[PROOF STEP]
proof (induction k)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. limsup (\<lambda>n. u (n + 0)) = limsup u
 2. \<And>k. limsup (\<lambda>n. u (n + k)) = limsup u \<Longrightarrow> limsup (\<lambda>n. u (n + Suc k)) = limsup u
[PROOF STEP]
case (Suc k)
[PROOF STATE]
proof (state)
this:
limsup (\<lambda>n. u (n + k)) = limsup u

goal (2 subgoals):
 1. limsup (\<lambda>n. u (n + 0)) = limsup u
 2. \<And>k. limsup (\<lambda>n. u (n + k)) = limsup u \<Longrightarrow> limsup (\<lambda>n. u (n + Suc k)) = limsup u
[PROOF STEP]
have "limsup (\<lambda>n. u (n+k+1)) = limsup (\<lambda>n. u (n+k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. limsup (\<lambda>n. u (n + k + 1)) = limsup (\<lambda>n. u (n + k))
[PROOF STEP]
using limsup_shift[where ?u="\<lambda>n. u(n+k)"]
[PROOF STATE]
proof (prove)
using this:
limsup (\<lambda>n. u (n + 1 + k)) = limsup (\<lambda>n. u (n + k))

goal (1 subgoal):
 1. limsup (\<lambda>n. u (n + k + 1)) = limsup (\<lambda>n. u (n + k))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
limsup (\<lambda>n. u (n + k + 1)) = limsup (\<lambda>n. u (n + k))

goal (2 subgoals):
 1. limsup (\<lambda>n. u (n + 0)) = limsup u
 2. \<And>k. limsup (\<lambda>n. u (n + k)) = limsup u \<Longrightarrow> limsup (\<lambda>n. u (n + Suc k)) = limsup u
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
limsup (\<lambda>n. u (n + k + 1)) = limsup (\<lambda>n. u (n + k))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
limsup (\<lambda>n. u (n + k + 1)) = limsup (\<lambda>n. u (n + k))

goal (1 subgoal):
 1. limsup (\<lambda>n. u (n + Suc k)) = limsup u
[PROOF STEP]
using Suc.IH
[PROOF STATE]
proof (prove)
using this:
limsup (\<lambda>n. u (n + k + 1)) = limsup (\<lambda>n. u (n + k))
limsup (\<lambda>n. u (n + k)) = limsup u

goal (1 subgoal):
 1. limsup (\<lambda>n. u (n + Suc k)) = limsup u
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
limsup (\<lambda>n. u (n + Suc k)) = limsup u

goal (1 subgoal):
 1. limsup (\<lambda>n. u (n + 0)) = limsup u
[PROOF STEP]
qed (auto)


[STATEMENT]
theorem regular_nullstr:  "regular {[]}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. regular {[]}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. regular {[]}
[PROOF STEP]
interpret N: nfa "\<lparr>states = {0}, init = {0}, final = {0}, nxt = \<lambda>q x. {}, eps = {} \<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nfa \<lparr>nfa.states = {0}, init = {0}, final = {0}, nxt = \<lambda>q x. {}, eps = {}\<rparr>
[PROOF STEP]
by (auto simp: nfa_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. regular {[]}
[PROOF STEP]
have "\<And>u. 0 \<in> N.nextl {0} u \<Longrightarrow> u = []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>u. 0 \<in> N.nextl {0} u \<Longrightarrow> u = []
[PROOF STEP]
by (rule list.exhaust, auto)
[PROOF STATE]
proof (state)
this:
0 \<in> N.nextl {0} ?u1 \<Longrightarrow> ?u1 = []

goal (1 subgoal):
 1. regular {[]}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 \<in> N.nextl {0} ?u1 \<Longrightarrow> ?u1 = []
[PROOF STEP]
have "N.language = {[]}"
[PROOF STATE]
proof (prove)
using this:
0 \<in> N.nextl {0} ?u1 \<Longrightarrow> ?u1 = []

goal (1 subgoal):
 1. N.language = {[]}
[PROOF STEP]
by (auto simp: N.language_def)
[PROOF STATE]
proof (state)
this:
N.language = {[]}

goal (1 subgoal):
 1. regular {[]}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
N.language = {[]}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
N.language = {[]}

goal (1 subgoal):
 1. regular {[]}
[PROOF STEP]
by (metis N.imp_regular)
[PROOF STATE]
proof (state)
this:
regular {[]}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma enat_Suc_ltl:
  assumes "enat (Suc n) < llength xs"
  shows "enat n < llength (ltl xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enat n < llength (ltl xs)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. enat n < llength (ltl xs)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
enat (Suc n) < llength xs
[PROOF STEP]
have "eSuc (enat n) < llength xs"
[PROOF STATE]
proof (prove)
using this:
enat (Suc n) < llength xs

goal (1 subgoal):
 1. eSuc (enat n) < llength xs
[PROOF STEP]
by (simp add: eSuc_enat)
[PROOF STATE]
proof (state)
this:
eSuc (enat n) < llength xs

goal (1 subgoal):
 1. enat n < llength (ltl xs)
[PROOF STEP]
hence "enat n < epred (llength xs)"
[PROOF STATE]
proof (prove)
using this:
eSuc (enat n) < llength xs

goal (1 subgoal):
 1. enat n < epred (llength xs)
[PROOF STEP]
using eSuc_le_iff ileI1
[PROOF STATE]
proof (prove)
using this:
eSuc (enat n) < llength xs
(eSuc ?x \<le> ?y) = (\<exists>y'. ?y = eSuc y' \<and> ?x \<le> y')
?m < ?n \<Longrightarrow> eSuc ?m \<le> ?n

goal (1 subgoal):
 1. enat n < epred (llength xs)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
enat n < epred (llength xs)

goal (1 subgoal):
 1. enat n < llength (ltl xs)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
enat n < epred (llength xs)

goal (1 subgoal):
 1. enat n < llength (ltl xs)
[PROOF STEP]
by (simp add: epred_llength)
[PROOF STATE]
proof (state)
this:
enat n < llength (ltl xs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nonseparation_by_component_eq:
  fixes S :: "'a :: euclidean_space set"
  assumes "open S \<or> closed S"
  shows "((\<forall>C \<in> components S. connected(-C)) \<longleftrightarrow> connected(- S))" (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>C\<in>components S. connected (- C)) = connected (- S)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>C\<in>components S. connected (- C) \<Longrightarrow> connected (- S)
 2. connected (- S) \<Longrightarrow> \<forall>C\<in>components S. connected (- C)
[PROOF STEP]
assume ?lhs
[PROOF STATE]
proof (state)
this:
\<forall>C\<in>components S. connected (- C)

goal (2 subgoals):
 1. \<forall>C\<in>components S. connected (- C) \<Longrightarrow> connected (- S)
 2. connected (- S) \<Longrightarrow> \<forall>C\<in>components S. connected (- C)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
open S \<or> closed S
\<forall>C\<in>components S. connected (- C)
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
open S \<or> closed S
\<forall>C\<in>components S. connected (- C)

goal (1 subgoal):
 1. connected (- S)
[PROOF STEP]
by (meson separation_by_component_closed separation_by_component_open)
[PROOF STATE]
proof (state)
this:
connected (- S)

goal (1 subgoal):
 1. connected (- S) \<Longrightarrow> \<forall>C\<in>components S. connected (- C)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. connected (- S) \<Longrightarrow> \<forall>C\<in>components S. connected (- C)
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
connected (- S)

goal (1 subgoal):
 1. connected (- S) \<Longrightarrow> \<forall>C\<in>components S. connected (- C)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
open S \<or> closed S
connected (- S)
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
using this:
open S \<or> closed S
connected (- S)

goal (1 subgoal):
 1. \<forall>C\<in>components S. connected (- C)
[PROOF STEP]
using component_complement_connected
[PROOF STATE]
proof (prove)
using this:
open S \<or> closed S
connected (- S)
\<lbrakk>connected ?S; ?C \<in> components (- ?S)\<rbrakk> \<Longrightarrow> connected (- ?C)

goal (1 subgoal):
 1. \<forall>C\<in>components S. connected (- C)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<forall>C\<in>components S. connected (- C)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Abs_finfun_inject_finite_class:
  fixes x y :: "('a :: finite) \<Rightarrow> 'b"
  shows "Abs_finfun x = Abs_finfun y \<longleftrightarrow> x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Abs_finfun x = Abs_finfun y) = (x = y)
[PROOF STEP]
using finite_UNIV
[PROOF STATE]
proof (prove)
using this:
finite_UNIV = Phantom(?'a) (finite UNIV)

goal (1 subgoal):
 1. (Abs_finfun x = Abs_finfun y) = (x = y)
[PROOF STEP]
by(simp add: Abs_finfun_inject_finite)


[STATEMENT]
lemma fps_inverse_unique:
  fixes   f g :: "'a :: division_ring fps"
  assumes fg: "f * g = 1"
  shows   "inverse f = g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse f = g
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inverse f = g
[PROOF STEP]
from fg
[PROOF STATE]
proof (chain)
picking this:
f * g = 1
[PROOF STEP]
have if0: "inverse (f$0) = g$0" "f$0 \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
f * g = 1

goal (1 subgoal):
 1. inverse (f $ 0) = g $ 0 &&& f $ 0 \<noteq> (0::'a)
[PROOF STEP]
using inverse_unique[of "f$0"] fps_mult_nth_0[of f g]
[PROOF STATE]
proof (prove)
using this:
f * g = 1
f $ 0 * ?b = (1::'a) \<Longrightarrow> inverse (f $ 0) = ?b
(f * g) $ 0 = f $ 0 * g $ 0

goal (1 subgoal):
 1. inverse (f $ 0) = g $ 0 &&& f $ 0 \<noteq> (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inverse (f $ 0) = g $ 0
f $ 0 \<noteq> (0::'a)

goal (1 subgoal):
 1. inverse f = g
[PROOF STEP]
with fg
[PROOF STATE]
proof (chain)
picking this:
f * g = 1
inverse (f $ 0) = g $ 0
f $ 0 \<noteq> (0::'a)
[PROOF STEP]
have "fps_right_inverse f (g$0) = g"
[PROOF STATE]
proof (prove)
using this:
f * g = 1
inverse (f $ 0) = g $ 0
f $ 0 \<noteq> (0::'a)

goal (1 subgoal):
 1. fps_right_inverse f (g $ 0) = g
[PROOF STEP]
using left_inverse[of "f$0"]
[PROOF STATE]
proof (prove)
using this:
f * g = 1
inverse (f $ 0) = g $ 0
f $ 0 \<noteq> (0::'a)
f $ 0 \<noteq> (0::'a) \<Longrightarrow> inverse (f $ 0) * f $ 0 = (1::'a)

goal (1 subgoal):
 1. fps_right_inverse f (g $ 0) = g
[PROOF STEP]
by (intro fps_lr_inverse_unique_ring1(2)) simp_all
[PROOF STATE]
proof (state)
this:
fps_right_inverse f (g $ 0) = g

goal (1 subgoal):
 1. inverse f = g
[PROOF STEP]
with if0(1)
[PROOF STATE]
proof (chain)
picking this:
inverse (f $ 0) = g $ 0
fps_right_inverse f (g $ 0) = g
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
inverse (f $ 0) = g $ 0
fps_right_inverse f (g $ 0) = g

goal (1 subgoal):
 1. inverse f = g
[PROOF STEP]
by (simp add: fps_inverse_def)
[PROOF STATE]
proof (state)
this:
inverse f = g

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dg_prod_3_Dom_vrange:
  "\<R>\<^sub>\<circ> ((\<AA> \<times>\<^sub>D\<^sub>G\<^sub>3 \<BB> \<times>\<^sub>D\<^sub>G\<^sub>3 \<CC>)\<lparr>Dom\<rparr>) \<subseteq>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G\<^sub>3 \<BB> \<times>\<^sub>D\<^sub>G\<^sub>3 \<CC>)\<lparr>Obj\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<R>\<^sub>\<circ> ((\<AA> \<times>\<^sub>D\<^sub>G\<^sub>3 \<BB> \<times>\<^sub>D\<^sub>G\<^sub>3 \<CC>)\<lparr>Dom\<rparr>) \<subseteq>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G\<^sub>3 \<BB> \<times>\<^sub>D\<^sub>G\<^sub>3 \<CC>)\<lparr>Obj\<rparr>
[PROOF STEP]
proof(rule vsv.vsv_vrange_vsubset, unfold dg_cs_simps)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. vsv ((\<AA> \<times>\<^sub>D\<^sub>G\<^sub>3 \<BB> \<times>\<^sub>D\<^sub>G\<^sub>3 \<CC>)\<lparr>Dom\<rparr>)
 2. \<And>x. x \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G\<^sub>3 \<BB> \<times>\<^sub>D\<^sub>G\<^sub>3 \<CC>)\<lparr>Arr\<rparr> \<Longrightarrow> (\<AA> \<times>\<^sub>D\<^sub>G\<^sub>3 \<BB> \<times>\<^sub>D\<^sub>G\<^sub>3 \<CC>)\<lparr>Dom\<rparr>\<lparr>x\<rparr> \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G\<^sub>3 \<BB> \<times>\<^sub>D\<^sub>G\<^sub>3 \<CC>)\<lparr>Obj\<rparr>
[PROOF STEP]
show "vsv ((\<AA> \<times>\<^sub>D\<^sub>G\<^sub>3 \<BB> \<times>\<^sub>D\<^sub>G\<^sub>3 \<CC>)\<lparr>Dom\<rparr>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vsv ((\<AA> \<times>\<^sub>D\<^sub>G\<^sub>3 \<BB> \<times>\<^sub>D\<^sub>G\<^sub>3 \<CC>)\<lparr>Dom\<rparr>)
[PROOF STEP]
by (rule dg_prod_3_Dom_vsv)
[PROOF STATE]
proof (state)
this:
vsv ((\<AA> \<times>\<^sub>D\<^sub>G\<^sub>3 \<BB> \<times>\<^sub>D\<^sub>G\<^sub>3 \<CC>)\<lparr>Dom\<rparr>)

goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G\<^sub>3 \<BB> \<times>\<^sub>D\<^sub>G\<^sub>3 \<CC>)\<lparr>Arr\<rparr> \<Longrightarrow> (\<AA> \<times>\<^sub>D\<^sub>G\<^sub>3 \<BB> \<times>\<^sub>D\<^sub>G\<^sub>3 \<CC>)\<lparr>Dom\<rparr>\<lparr>x\<rparr> \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G\<^sub>3 \<BB> \<times>\<^sub>D\<^sub>G\<^sub>3 \<CC>)\<lparr>Obj\<rparr>
[PROOF STEP]
fix F
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G\<^sub>3 \<BB> \<times>\<^sub>D\<^sub>G\<^sub>3 \<CC>)\<lparr>Arr\<rparr> \<Longrightarrow> (\<AA> \<times>\<^sub>D\<^sub>G\<^sub>3 \<BB> \<times>\<^sub>D\<^sub>G\<^sub>3 \<CC>)\<lparr>Dom\<rparr>\<lparr>x\<rparr> \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G\<^sub>3 \<BB> \<times>\<^sub>D\<^sub>G\<^sub>3 \<CC>)\<lparr>Obj\<rparr>
[PROOF STEP]
assume prems: "F \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G\<^sub>3 \<BB> \<times>\<^sub>D\<^sub>G\<^sub>3 \<CC>)\<lparr>Arr\<rparr>"
[PROOF STATE]
proof (state)
this:
F \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G\<^sub>3 \<BB> \<times>\<^sub>D\<^sub>G\<^sub>3 \<CC>)\<lparr>Arr\<rparr>

goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G\<^sub>3 \<BB> \<times>\<^sub>D\<^sub>G\<^sub>3 \<CC>)\<lparr>Arr\<rparr> \<Longrightarrow> (\<AA> \<times>\<^sub>D\<^sub>G\<^sub>3 \<BB> \<times>\<^sub>D\<^sub>G\<^sub>3 \<CC>)\<lparr>Dom\<rparr>\<lparr>x\<rparr> \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G\<^sub>3 \<BB> \<times>\<^sub>D\<^sub>G\<^sub>3 \<CC>)\<lparr>Obj\<rparr>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
F \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G\<^sub>3 \<BB> \<times>\<^sub>D\<^sub>G\<^sub>3 \<CC>)\<lparr>Arr\<rparr>
[PROOF STEP]
obtain f f' f'' where F_def: "F = [f, f', f'']\<^sub>\<circ>"
    and f: "f \<in>\<^sub>\<circ> \<AA>\<lparr>Arr\<rparr>"
    and f': "f' \<in>\<^sub>\<circ> \<BB>\<lparr>Arr\<rparr>"
    and f'': "f'' \<in>\<^sub>\<circ> \<CC>\<lparr>Arr\<rparr>"
[PROOF STATE]
proof (prove)
using this:
F \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G\<^sub>3 \<BB> \<times>\<^sub>D\<^sub>G\<^sub>3 \<CC>)\<lparr>Arr\<rparr>

goal (1 subgoal):
 1. (\<And>f f' f''. \<lbrakk>F = [f, f', f'']\<^sub>\<circ>; f \<in>\<^sub>\<circ> \<AA>\<lparr>Arr\<rparr>; f' \<in>\<^sub>\<circ> \<BB>\<lparr>Arr\<rparr>; f'' \<in>\<^sub>\<circ> \<CC>\<lparr>Arr\<rparr>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (elim dg_prod_3_ArrE[OF \<AA> \<BB> \<CC>]) simp
[PROOF STATE]
proof (state)
this:
F = [f, f', f'']\<^sub>\<circ>
f \<in>\<^sub>\<circ> \<AA>\<lparr>Arr\<rparr>
f' \<in>\<^sub>\<circ> \<BB>\<lparr>Arr\<rparr>
f'' \<in>\<^sub>\<circ> \<CC>\<lparr>Arr\<rparr>

goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G\<^sub>3 \<BB> \<times>\<^sub>D\<^sub>G\<^sub>3 \<CC>)\<lparr>Arr\<rparr> \<Longrightarrow> (\<AA> \<times>\<^sub>D\<^sub>G\<^sub>3 \<BB> \<times>\<^sub>D\<^sub>G\<^sub>3 \<CC>)\<lparr>Dom\<rparr>\<lparr>x\<rparr> \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G\<^sub>3 \<BB> \<times>\<^sub>D\<^sub>G\<^sub>3 \<CC>)\<lparr>Obj\<rparr>
[PROOF STEP]
from f f' f''
[PROOF STATE]
proof (chain)
picking this:
f \<in>\<^sub>\<circ> \<AA>\<lparr>Arr\<rparr>
f' \<in>\<^sub>\<circ> \<BB>\<lparr>Arr\<rparr>
f'' \<in>\<^sub>\<circ> \<CC>\<lparr>Arr\<rparr>
[PROOF STEP]
obtain a a' a'' b b' b''
    where f: "f : a \<mapsto>\<^bsub>\<AA>\<^esub> b"
      and f': "f' : a' \<mapsto>\<^bsub>\<BB>\<^esub> b'"
      and f'': "f'' : a'' \<mapsto>\<^bsub>\<CC>\<^esub> b''"
[PROOF STATE]
proof (prove)
using this:
f \<in>\<^sub>\<circ> \<AA>\<lparr>Arr\<rparr>
f' \<in>\<^sub>\<circ> \<BB>\<lparr>Arr\<rparr>
f'' \<in>\<^sub>\<circ> \<CC>\<lparr>Arr\<rparr>

goal (1 subgoal):
 1. (\<And>a b a' b' a'' b''. \<lbrakk>f : a \<mapsto>\<^bsub>\<AA>\<^esub> b; f' : a' \<mapsto>\<^bsub>\<BB>\<^esub> b'; f'' : a'' \<mapsto>\<^bsub>\<CC>\<^esub> b''\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (meson is_arrI)
[PROOF STATE]
proof (state)
this:
f : a \<mapsto>\<^bsub>\<AA>\<^esub> b
f' : a' \<mapsto>\<^bsub>\<BB>\<^esub> b'
f'' : a'' \<mapsto>\<^bsub>\<CC>\<^esub> b''

goal (1 subgoal):
 1. \<And>x. x \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G\<^sub>3 \<BB> \<times>\<^sub>D\<^sub>G\<^sub>3 \<CC>)\<lparr>Arr\<rparr> \<Longrightarrow> (\<AA> \<times>\<^sub>D\<^sub>G\<^sub>3 \<BB> \<times>\<^sub>D\<^sub>G\<^sub>3 \<CC>)\<lparr>Dom\<rparr>\<lparr>x\<rparr> \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G\<^sub>3 \<BB> \<times>\<^sub>D\<^sub>G\<^sub>3 \<CC>)\<lparr>Obj\<rparr>
[PROOF STEP]
from \<AA> \<BB> f f' f''
[PROOF STATE]
proof (chain)
picking this:
digraph \<alpha> \<AA>
digraph \<alpha> \<BB>
f : a \<mapsto>\<^bsub>\<AA>\<^esub> b
f' : a' \<mapsto>\<^bsub>\<BB>\<^esub> b'
f'' : a'' \<mapsto>\<^bsub>\<CC>\<^esub> b''
[PROOF STEP]
show "(\<AA> \<times>\<^sub>D\<^sub>G\<^sub>3 \<BB> \<times>\<^sub>D\<^sub>G\<^sub>3 \<CC>)\<lparr>Dom\<rparr>\<lparr>F\<rparr> \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G\<^sub>3 \<BB> \<times>\<^sub>D\<^sub>G\<^sub>3 \<CC>)\<lparr>Obj\<rparr>"
[PROOF STATE]
proof (prove)
using this:
digraph \<alpha> \<AA>
digraph \<alpha> \<BB>
f : a \<mapsto>\<^bsub>\<AA>\<^esub> b
f' : a' \<mapsto>\<^bsub>\<BB>\<^esub> b'
f'' : a'' \<mapsto>\<^bsub>\<CC>\<^esub> b''

goal (1 subgoal):
 1. (\<AA> \<times>\<^sub>D\<^sub>G\<^sub>3 \<BB> \<times>\<^sub>D\<^sub>G\<^sub>3 \<CC>)\<lparr>Dom\<rparr>\<lparr>F\<rparr> \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G\<^sub>3 \<BB> \<times>\<^sub>D\<^sub>G\<^sub>3 \<CC>)\<lparr>Obj\<rparr>
[PROOF STEP]
unfolding F_def dg_prod_3_Dom_app[OF prems[unfolded F_def]]
[PROOF STATE]
proof (prove)
using this:
digraph \<alpha> \<AA>
digraph \<alpha> \<BB>
f : a \<mapsto>\<^bsub>\<AA>\<^esub> b
f' : a' \<mapsto>\<^bsub>\<BB>\<^esub> b'
f'' : a'' \<mapsto>\<^bsub>\<CC>\<^esub> b''

goal (1 subgoal):
 1. [\<AA>\<lparr>Dom\<rparr>\<lparr>f\<rparr>, \<BB>\<lparr>Dom\<rparr>\<lparr>f'\<rparr>, \<CC>\<lparr>Dom\<rparr>\<lparr>f''\<rparr>]\<^sub>\<circ> \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G\<^sub>3 \<BB> \<times>\<^sub>D\<^sub>G\<^sub>3 \<CC>)\<lparr>Obj\<rparr>
[PROOF STEP]
by (cs_concl cs_simp: dg_cs_simps cs_intro: dg_cs_intros dg_prod_cs_intros)
[PROOF STATE]
proof (state)
this:
(\<AA> \<times>\<^sub>D\<^sub>G\<^sub>3 \<BB> \<times>\<^sub>D\<^sub>G\<^sub>3 \<CC>)\<lparr>Dom\<rparr>\<lparr>F\<rparr> \<in>\<^sub>\<circ> (\<AA> \<times>\<^sub>D\<^sub>G\<^sub>3 \<BB> \<times>\<^sub>D\<^sub>G\<^sub>3 \<CC>)\<lparr>Obj\<rparr>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ordLeq_card_Bpow:
assumes rc: "Card_order r" and r: "Field r \<noteq> {}"
shows "|A| \<le>o |Bpow r A|"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |A| \<le>o |Bpow r A|
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. |A| \<le>o |Bpow r A|
[PROOF STEP]
have "inj_on (\<lambda> a. {a}) A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (\<lambda>a. {a}) A
[PROOF STEP]
unfolding inj_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>A. \<forall>y\<in>A. {x} = {y} \<longrightarrow> x = y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inj_on (\<lambda>a. {a}) A

goal (1 subgoal):
 1. |A| \<le>o |Bpow r A|
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
inj_on (\<lambda>a. {a}) A

goal (1 subgoal):
 1. |A| \<le>o |Bpow r A|
[PROOF STEP]
have "(\<lambda> a. {a}) ` A \<subseteq> Bpow r A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>a. {a}) ` A \<subseteq> Bpow r A
[PROOF STEP]
using singl_in_Bpow[OF assms]
[PROOF STATE]
proof (prove)
using this:
?a \<in> ?A \<Longrightarrow> {?a} \<in> Bpow r ?A

goal (1 subgoal):
 1. (\<lambda>a. {a}) ` A \<subseteq> Bpow r A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>a. {a}) ` A \<subseteq> Bpow r A

goal (1 subgoal):
 1. |A| \<le>o |Bpow r A|
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
inj_on (\<lambda>a. {a}) A
(\<lambda>a. {a}) ` A \<subseteq> Bpow r A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
inj_on (\<lambda>a. {a}) A
(\<lambda>a. {a}) ` A \<subseteq> Bpow r A

goal (1 subgoal):
 1. |A| \<le>o |Bpow r A|
[PROOF STEP]
unfolding card_of_ordLeq[symmetric]
[PROOF STATE]
proof (prove)
using this:
inj_on (\<lambda>a. {a}) A
(\<lambda>a. {a}) ` A \<subseteq> Bpow r A

goal (1 subgoal):
 1. \<exists>f. inj_on f A \<and> f ` A \<subseteq> Bpow r A
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
|A| \<le>o |Bpow r A|

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma All_surj_conv: assumes "surj f" shows "(\<forall>x. P (f x)) \<longleftrightarrow> (\<forall>y. P y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. P (f x)) = (\<forall>y. P y)
[PROOF STEP]
proof (intro iffI allI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>y. \<forall>x. P (f x) \<Longrightarrow> P y
 2. \<And>x. \<forall>y. P y \<Longrightarrow> P (f x)
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>y. \<forall>x. P (f x) \<Longrightarrow> P y
 2. \<And>x. \<forall>y. P y \<Longrightarrow> P (f x)
[PROOF STEP]
assume "\<forall>x. P (f x)"
[PROOF STATE]
proof (state)
this:
\<forall>x. P (f x)

goal (2 subgoals):
 1. \<And>y. \<forall>x. P (f x) \<Longrightarrow> P y
 2. \<And>x. \<forall>y. P y \<Longrightarrow> P (f x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x. P (f x)
[PROOF STEP]
have "P (f (inv f y))"
[PROOF STATE]
proof (prove)
using this:
\<forall>x. P (f x)

goal (1 subgoal):
 1. P (f (inv f y))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
P (f (inv f y))

goal (2 subgoals):
 1. \<And>y. \<forall>x. P (f x) \<Longrightarrow> P y
 2. \<And>x. \<forall>y. P y \<Longrightarrow> P (f x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
P (f (inv f y))
[PROOF STEP]
show "P y"
[PROOF STATE]
proof (prove)
using this:
P (f (inv f y))

goal (1 subgoal):
 1. P y
[PROOF STEP]
unfolding surj_f_inv_f[OF assms]
[PROOF STATE]
proof (prove)
using this:
P y

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

goal (1 subgoal):
 1. \<And>x. \<forall>y. P y \<Longrightarrow> P (f x)
[PROOF STEP]
qed simp


[STATEMENT]
lemma "Apply.conjunctive = Comp.conjunctive"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Apply.conjunctive = Comp.conjunctive
[PROOF STEP]
apply (simp add: Apply.conjunctive_def Comp.conjunctive_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. \<forall>y z. x (inf y z) = inf (x y) (x z)} = {x. \<forall>y z. x \<circ> inf y z = inf (x \<circ> y) (x \<circ> z)}
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x y z. \<forall>y z. x (inf y z) = inf (x y) (x z) \<Longrightarrow> x \<circ> inf y z = inf (x \<circ> y) (x \<circ> z)
 2. \<And>x y z. \<forall>y z. x \<circ> inf y z = inf (x \<circ> y) (x \<circ> z) \<Longrightarrow> x (inf y z) = inf (x y) (x z)
[PROOF STEP]
apply (simp_all add: fun_eq_iff inf_fun_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y z. \<forall>y z xa. x (inf (y xa) (z xa)) = inf (x (y xa)) (x (z xa)) \<Longrightarrow> x (inf y z) = inf (x y) (x z)
[PROOF STEP]
apply (drule_tac x = "\<lambda> u . y" in spec)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y z. \<forall>z xa. x (inf y (z xa)) = inf (x y) (x (z xa)) \<Longrightarrow> x (inf y z) = inf (x y) (x z)
[PROOF STEP]
apply (drule_tac x = "\<lambda> u . z" in spec)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y z. \<forall>xa. x (inf y z) = inf (x y) (x z) \<Longrightarrow> x (inf y z) = inf (x y) (x z)
[PROOF STEP]
by simp


[STATEMENT]
lemma measure_preserving_total_measure:
  assumes "f \<in> measure_preserving M N"
  shows "emeasure M (space M) = emeasure N (space N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure M (space M) = emeasure N (space N)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. emeasure M (space M) = emeasure N (space N)
[PROOF STEP]
have "f \<in> measurable M N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> M \<rightarrow>\<^sub>M N
[PROOF STEP]
by (rule measure_preservingE(1)[OF assms(1)])
[PROOF STATE]
proof (state)
this:
f \<in> M \<rightarrow>\<^sub>M N

goal (1 subgoal):
 1. emeasure M (space M) = emeasure N (space N)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f \<in> M \<rightarrow>\<^sub>M N
[PROOF STEP]
have "f-`(space N) \<inter> space M = space M"
[PROOF STATE]
proof (prove)
using this:
f \<in> M \<rightarrow>\<^sub>M N

goal (1 subgoal):
 1. f -` space N \<inter> space M = space M
[PROOF STEP]
by (meson Int_absorb1 measurable_space subsetI vimageI)
[PROOF STATE]
proof (state)
this:
f -` space N \<inter> space M = space M

goal (1 subgoal):
 1. emeasure M (space M) = emeasure N (space N)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f -` space N \<inter> space M = space M
[PROOF STEP]
show "emeasure M (space M) = emeasure N (space N)"
[PROOF STATE]
proof (prove)
using this:
f -` space N \<inter> space M = space M

goal (1 subgoal):
 1. emeasure M (space M) = emeasure N (space N)
[PROOF STEP]
by (metis (mono_tags, lifting) measure_preservingE(2)[OF assms(1)] sets.top)
[PROOF STATE]
proof (state)
this:
emeasure M (space M) = emeasure N (space N)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma precedesAntisymmetry:
  assumes
  "a \<in> set l" and "b \<in> set l" and
  "precedes a b l" and "precedes b a l"
  shows
  "a = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a = b
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a = b
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
a \<in> set l
b \<in> set l
precedes a b l
precedes b a l
[PROOF STEP]
have "firstPos a l = firstPos b l"
[PROOF STATE]
proof (prove)
using this:
a \<in> set l
b \<in> set l
precedes a b l
precedes b a l

goal (1 subgoal):
 1. firstPos a l = firstPos b l
[PROOF STEP]
unfolding precedes_def
[PROOF STATE]
proof (prove)
using this:
a \<in> set l
b \<in> set l
a \<in> set l \<and> b \<in> set l \<and> firstPos a l \<le> firstPos b l
b \<in> set l \<and> a \<in> set l \<and> firstPos b l \<le> firstPos a l

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

goal (1 subgoal):
 1. a = b
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
firstPos a l = firstPos b l

goal (1 subgoal):
 1. a = b
[PROOF STEP]
using firstPosEqual[of "a" "l" "b"]
[PROOF STATE]
proof (prove)
using this:
firstPos a l = firstPos b l
\<lbrakk>a \<in> set l; b \<in> set l\<rbrakk> \<Longrightarrow> (firstPos a l = firstPos b l) = (a = b)

goal (1 subgoal):
 1. a = b
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
firstPos a l = firstPos b l
\<lbrakk>a \<in> set l; b \<in> set l\<rbrakk> \<Longrightarrow> (firstPos a l = firstPos b l) = (a = b)
a \<in> set l
b \<in> set l
precedes a b l
precedes b a l

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mat_mod_index_same[simp]: "i < dim_row M \<Longrightarrow> j < dim_col M \<Longrightarrow> M $$ (i, j) < m \<Longrightarrow>
    M $$ (i, j) \<ge> 0 \<Longrightarrow> mat_mod M $$ (i, j) = M $$ (i, j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i < dim_row M; j < dim_col M; M $$ (i, j) < m; 0 \<le> M $$ (i, j)\<rbrakk> \<Longrightarrow> local.mat_mod M $$ (i, j) = M $$ (i, j)
[PROOF STEP]
by (simp add: mat_mod_def)


[STATEMENT]
lemma homeomorphism_grouping_point_1:
  fixes a::real and c::real
  assumes "a < b" "c < d"
  obtains f g where "homeomorphism (cbox a b) (cbox c d) f g" "f a = c" "f b = d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>f g. \<lbrakk>homeomorphism (cbox a b) (cbox c d) f g; f a = c; f b = d\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>f g. \<lbrakk>homeomorphism (cbox a b) (cbox c d) f g; f a = c; f b = d\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
define f where "f \<equiv> \<lambda>x. ((d - c) / (b - a)) * x + (c - a * ((d - c) / (b - a)))"
[PROOF STATE]
proof (state)
this:
f \<equiv> \<lambda>x. (d - c) / (b - a) * x + (c - a * ((d - c) / (b - a)))

goal (1 subgoal):
 1. (\<And>f g. \<lbrakk>homeomorphism (cbox a b) (cbox c d) f g; f a = c; f b = d\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "\<exists>g. homeomorphism (cbox a b) (cbox c d) f g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>g. homeomorphism (cbox a b) (cbox c d) f g
[PROOF STEP]
proof (rule homeomorphism_compact)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. compact (cbox a b)
 2. continuous_on (cbox a b) f
 3. f ` cbox a b = cbox c d
 4. inj_on f (cbox a b)
[PROOF STEP]
show "continuous_on (cbox a b) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (cbox a b) f
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (cbox a b) (\<lambda>x. (d - c) / (b - a) * x + (c - a * ((d - c) / (b - a))))
[PROOF STEP]
by (intro continuous_intros)
[PROOF STATE]
proof (state)
this:
continuous_on (cbox a b) f

goal (3 subgoals):
 1. compact (cbox a b)
 2. f ` cbox a b = cbox c d
 3. inj_on f (cbox a b)
[PROOF STEP]
have "f ` {a..b} = {c..d}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` {a..b} = {c..d}
[PROOF STEP]
unfolding f_def image_affinity_atLeastAtMost
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if {a..b} = {} then {} else if 0 \<le> (d - c) / (b - a) then {(d - c) / (b - a) * a + (c - a * ((d - c) / (b - a)))..(d - c) / (b - a) * b + (c - a * ((d - c) / (b - a)))} else {(d - c) / (b - a) * b + (c - a * ((d - c) / (b - a)))..(d - c) / (b - a) * a + (c - a * ((d - c) / (b - a)))}) = {c..d}
[PROOF STEP]
using assms sum_sqs_eq
[PROOF STATE]
proof (prove)
using this:
a < b
c < d
?x * ?x + ?y * ?y = ?x * (?y * (2::?'a)) \<Longrightarrow> ?y = ?x

goal (1 subgoal):
 1. (if {a..b} = {} then {} else if 0 \<le> (d - c) / (b - a) then {(d - c) / (b - a) * a + (c - a * ((d - c) / (b - a)))..(d - c) / (b - a) * b + (c - a * ((d - c) / (b - a)))} else {(d - c) / (b - a) * b + (c - a * ((d - c) / (b - a)))..(d - c) / (b - a) * a + (c - a * ((d - c) / (b - a)))}) = {c..d}
[PROOF STEP]
by (auto simp: field_split_simps)
[PROOF STATE]
proof (state)
this:
f ` {a..b} = {c..d}

goal (3 subgoals):
 1. compact (cbox a b)
 2. f ` cbox a b = cbox c d
 3. inj_on f (cbox a b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f ` {a..b} = {c..d}
[PROOF STEP]
show "f ` cbox a b = cbox c d"
[PROOF STATE]
proof (prove)
using this:
f ` {a..b} = {c..d}

goal (1 subgoal):
 1. f ` cbox a b = cbox c d
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f ` cbox a b = cbox c d

goal (2 subgoals):
 1. compact (cbox a b)
 2. inj_on f (cbox a b)
[PROOF STEP]
show "inj_on f (cbox a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on f (cbox a b)
[PROOF STEP]
unfolding f_def inj_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>cbox a b. \<forall>y\<in>cbox a b. (d - c) / (b - a) * x + (c - a * ((d - c) / (b - a))) = (d - c) / (b - a) * y + (c - a * ((d - c) / (b - a))) \<longrightarrow> x = y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a < b
c < d

goal (1 subgoal):
 1. \<forall>x\<in>cbox a b. \<forall>y\<in>cbox a b. (d - c) / (b - a) * x + (c - a * ((d - c) / (b - a))) = (d - c) / (b - a) * y + (c - a * ((d - c) / (b - a))) \<longrightarrow> x = y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inj_on f (cbox a b)

goal (1 subgoal):
 1. compact (cbox a b)
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
\<exists>g. homeomorphism (cbox a b) (cbox c d) f g

goal (1 subgoal):
 1. (\<And>f g. \<lbrakk>homeomorphism (cbox a b) (cbox c d) f g; f a = c; f b = d\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>g. homeomorphism (cbox a b) (cbox c d) f g
[PROOF STEP]
obtain g where "homeomorphism (cbox a b) (cbox c d) f g"
[PROOF STATE]
proof (prove)
using this:
\<exists>g. homeomorphism (cbox a b) (cbox c d) f g

goal (1 subgoal):
 1. (\<And>g. homeomorphism (cbox a b) (cbox c d) f g \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
homeomorphism (cbox a b) (cbox c d) f g

goal (1 subgoal):
 1. (\<And>f g. \<lbrakk>homeomorphism (cbox a b) (cbox c d) f g; f a = c; f b = d\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
homeomorphism (cbox a b) (cbox c d) f g
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
homeomorphism (cbox a b) (cbox c d) f g

goal (1 subgoal):
 1. thesis
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f a = c
 2. f b = d
[PROOF STEP]
show "f a = c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f a = c
[PROOF STEP]
by (simp add: f_def)
[PROOF STATE]
proof (state)
this:
f a = c

goal (1 subgoal):
 1. f b = d
[PROOF STEP]
show "f b = d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f b = d
[PROOF STEP]
using assms sum_sqs_eq [of a b]
[PROOF STATE]
proof (prove)
using this:
a < b
c < d
a * a + b * b = a * (b * 2) \<Longrightarrow> b = a

goal (1 subgoal):
 1. f b = d
[PROOF STEP]
by (auto simp: f_def field_split_simps)
[PROOF STATE]
proof (state)
this:
f b = d

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma genuine_roots_finish:
  fixes p :: "'a :: field_char_0 poly"
  assumes "{z. poly p z = 0} \<subseteq> set xs" "distinct xs"
  assumes "length xs = card {z. poly p z = 0}"
  shows   "genuine_roots p xs = xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. genuine_roots p xs = xs
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. genuine_roots p xs = xs
[PROOF STEP]
have [simp]: "p \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p \<noteq> 0
[PROOF STEP]
using finite_subset[OF assms(1) finite_set] infinite_UNIV_char_0
[PROOF STATE]
proof (prove)
using this:
finite {z. poly p z = (0::'a)}
infinite UNIV

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

goal (1 subgoal):
 1. genuine_roots p xs = xs
[PROOF STEP]
have "length (genuine_roots p xs) = length xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (genuine_roots p xs) = length xs
[PROOF STEP]
unfolding genuine_roots_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (filter (\<lambda>x. poly p x = (0::'a)) xs) = length xs
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
{z. poly p z = (0::'a)} \<subseteq> set xs
distinct xs
length xs = card {z. poly p z = (0::'a)}

goal (1 subgoal):
 1. length (filter (\<lambda>x. poly p x = (0::'a)) xs) = length xs
[PROOF STEP]
by (simp add: Int_absorb2 distinct_length_filter)
[PROOF STATE]
proof (state)
this:
length (genuine_roots p xs) = length xs

goal (1 subgoal):
 1. genuine_roots p xs = xs
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
length (genuine_roots p xs) = length xs

goal (1 subgoal):
 1. genuine_roots p xs = xs
[PROOF STEP]
unfolding genuine_roots_def
[PROOF STATE]
proof (prove)
using this:
length (filter (\<lambda>x. poly p x = (0::'a)) xs) = length xs

goal (1 subgoal):
 1. filter (\<lambda>x. poly p x = (0::'a)) xs = xs
[PROOF STEP]
by (metis filter_True length_filter_less linorder_not_less order_eq_iff)
[PROOF STATE]
proof (state)
this:
genuine_roots p xs = xs

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma has_sgnx_divide[sgnx_intros]:
  assumes "(f has_sgnx c1) F" "(g has_sgnx c2) F"
  shows "((\<lambda>x. f x / g x) has_sgnx c1 / c2) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f x / g x) has_sgnx c1 / c2) F
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>x. f x / g x) has_sgnx c1 / c2) F
[PROOF STEP]
have "\<forall>\<^sub>F x in F. sgn (f x) = c1 \<and> sgn (g x) = c2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. sgn (f x) = c1 \<and> sgn (g x) = c2
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(f has_sgnx c1) F
(g has_sgnx c2) F

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. sgn (f x) = c1 \<and> sgn (g x) = c2
[PROOF STEP]
unfolding has_sgnx_def
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. sgn (f x) = c1
\<forall>\<^sub>F x in F. sgn (g x) = c2

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. sgn (f x) = c1 \<and> sgn (g x) = c2
[PROOF STEP]
by (intro eventually_conj,auto)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. sgn (f x) = c1 \<and> sgn (g x) = c2

goal (1 subgoal):
 1. ((\<lambda>x. f x / g x) has_sgnx c1 / c2) F
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in F. sgn (f x) = c1 \<and> sgn (g x) = c2
[PROOF STEP]
have "\<forall>\<^sub>F x in F. sgn (f x / g x) = c1 / c2"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. sgn (f x) = c1 \<and> sgn (g x) = c2

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. sgn (f x / g x) = c1 / c2
[PROOF STEP]
apply (elim eventually_mono)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. sgn (f x) = c1 \<and> sgn (g x) = c2 \<Longrightarrow> sgn (f x / g x) = c1 / c2
[PROOF STEP]
by (simp add: sgn_mult sgn_divide)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. sgn (f x / g x) = c1 / c2

goal (1 subgoal):
 1. ((\<lambda>x. f x / g x) has_sgnx c1 / c2) F
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in F. sgn (f x / g x) = c1 / c2
[PROOF STEP]
show "((\<lambda>x. f x / g x) has_sgnx c1 / c2) F"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. sgn (f x / g x) = c1 / c2

goal (1 subgoal):
 1. ((\<lambda>x. f x / g x) has_sgnx c1 / c2) F
[PROOF STEP]
unfolding has_sgnx_def
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. sgn (f x / g x) = c1 / c2

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. sgn (f x / g x) = c1 / c2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((\<lambda>x. f x / g x) has_sgnx c1 / c2) F

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in group) set_mult_finite:
  assumes "finite H" "finite J" "H \<subseteq> carrier G" "J \<subseteq> carrier G"
  shows "finite (H <#> J)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (H <#> J)
[PROOF STEP]
using assms set_mult_def[of G H J]
[PROOF STATE]
proof (prove)
using this:
finite H
finite J
H \<subseteq> carrier G
J \<subseteq> carrier G
H <#> J = (\<Union>h\<in>H. \<Union>k\<in>J. {h \<otimes> k})

goal (1 subgoal):
 1. finite (H <#> J)
[PROOF STEP]
by auto


[STATEMENT]
lemma map_eq_const_coin_spmf: "map_spmf ((=) c) coin_spmf = coin_spmf"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_spmf ((=) c) coin_spmf = coin_spmf
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. map_spmf ((=) c) coin_spmf = coin_spmf
[PROOF STEP]
have "inj ((\<longleftrightarrow>) c)" "range ((\<longleftrightarrow>) c) = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj ((=) c) &&& surj ((=) c)
[PROOF STEP]
by(auto intro: inj_onI)
[PROOF STATE]
proof (state)
this:
inj ((=) c)
surj ((=) c)

goal (1 subgoal):
 1. map_spmf ((=) c) coin_spmf = coin_spmf
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inj ((=) c)
surj ((=) c)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
inj ((=) c)
surj ((=) c)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma A_0_imp_Gauss_Jordan_0:
  fixes A::"'a::{field}^'n::{mod_type}^'m::{mod_type}"
  assumes "A=0"
  shows "Gauss_Jordan A = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gauss_Jordan A = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Gauss_Jordan A = 0
[PROOF STEP]
obtain P where PA: "Gauss_Jordan A = P ** A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>P. Gauss_Jordan A = P ** A \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using invertible_Gauss_Jordan
[PROOF STATE]
proof (prove)
using this:
\<exists>P. invertible P \<and> Gauss_Jordan ?A = P ** ?A

goal (1 subgoal):
 1. (\<And>P. Gauss_Jordan A = P ** A \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Gauss_Jordan A = P ** A

goal (1 subgoal):
 1. Gauss_Jordan A = 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Gauss_Jordan A = P ** A

goal (1 subgoal):
 1. Gauss_Jordan A = 0
[PROOF STEP]
have "... = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P ** A = 0
[PROOF STEP]
unfolding assms
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P ** 0 = 0
[PROOF STEP]
by (metis eq_add_iff matrix_add_ldistrib)
[PROOF STATE]
proof (state)
this:
P ** A = 0

goal (1 subgoal):
 1. Gauss_Jordan A = 0
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Gauss_Jordan A = 0
[PROOF STEP]
show "Gauss_Jordan A = 0"
[PROOF STATE]
proof (prove)
using this:
Gauss_Jordan A = 0

goal (1 subgoal):
 1. Gauss_Jordan A = 0
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Gauss_Jordan A = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma points_inter_num_rep:
  assumes "b1 \<in># \<B>" and "b2 \<in># \<B> - {#b1#}"
  shows "card {v \<in> \<V> . v \<in> b1 \<and> v \<in> b2} = b1 |\<inter>| b2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {v \<in> \<V>. v \<in> b1 \<and> v \<in> b2} = b1 |\<inter>| b2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card {v \<in> \<V>. v \<in> b1 \<and> v \<in> b2} = b1 |\<inter>| b2
[PROOF STEP]
have "\<And> x. x \<in> b1 \<inter> b2 \<Longrightarrow> x \<in> \<V>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> b1 \<inter> b2 \<Longrightarrow> x \<in> \<V>
[PROOF STEP]
using wellformed assms
[PROOF STATE]
proof (prove)
using this:
?b \<in># \<B> \<Longrightarrow> ?b \<subseteq> \<V>
b1 \<in># \<B>
b2 \<in># remove1_mset b1 \<B>

goal (1 subgoal):
 1. \<And>x. x \<in> b1 \<inter> b2 \<Longrightarrow> x \<in> \<V>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?x \<in> b1 \<inter> b2 \<Longrightarrow> ?x \<in> \<V>

goal (1 subgoal):
 1. card {v \<in> \<V>. v \<in> b1 \<and> v \<in> b2} = b1 |\<inter>| b2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?x \<in> b1 \<inter> b2 \<Longrightarrow> ?x \<in> \<V>
[PROOF STEP]
have "{v \<in> \<V> . v \<in> (b1 \<inter> b2)} = (b1 \<inter> b2)"
[PROOF STATE]
proof (prove)
using this:
?x \<in> b1 \<inter> b2 \<Longrightarrow> ?x \<in> \<V>

goal (1 subgoal):
 1. {v \<in> \<V>. v \<in> b1 \<inter> b2} = b1 \<inter> b2
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
{v \<in> \<V>. v \<in> b1 \<inter> b2} = b1 \<inter> b2

goal (1 subgoal):
 1. card {v \<in> \<V>. v \<in> b1 \<and> v \<in> b2} = b1 |\<inter>| b2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{v \<in> \<V>. v \<in> b1 \<inter> b2} = b1 \<inter> b2
[PROOF STEP]
have "card {v \<in> \<V> . v \<in> b1 \<and> v \<in> b2} = card (b1 \<inter> b2)"
[PROOF STATE]
proof (prove)
using this:
{v \<in> \<V>. v \<in> b1 \<inter> b2} = b1 \<inter> b2

goal (1 subgoal):
 1. card {v \<in> \<V>. v \<in> b1 \<and> v \<in> b2} = card (b1 \<inter> b2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card {v \<in> \<V>. v \<in> b1 \<and> v \<in> b2} = card (b1 \<inter> b2)

goal (1 subgoal):
 1. card {v \<in> \<V>. v \<in> b1 \<and> v \<in> b2} = b1 |\<inter>| b2
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
card {v \<in> \<V>. v \<in> b1 \<and> v \<in> b2} = card (b1 \<inter> b2)

goal (1 subgoal):
 1. card {v \<in> \<V>. v \<in> b1 \<and> v \<in> b2} = b1 |\<inter>| b2
[PROOF STEP]
using assms intersection_number_def
[PROOF STATE]
proof (prove)
using this:
card {v \<in> \<V>. v \<in> b1 \<and> v \<in> b2} = card (b1 \<inter> b2)
b1 \<in># \<B>
b2 \<in># remove1_mset b1 \<B>
?b1.0 |\<inter>| ?b2.0 \<equiv> card (?b1.0 \<inter> ?b2.0)

goal (1 subgoal):
 1. card {v \<in> \<V>. v \<in> b1 \<and> v \<in> b2} = b1 |\<inter>| b2
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
card {v \<in> \<V>. v \<in> b1 \<and> v \<in> b2} = b1 |\<inter>| b2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma gf_U_le_1: assumes z: "0 < z" "z < 1" shows "gf_U x y z \<le> (1::real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gf_U x y z \<le> 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. gf_U x y z \<le> 1
[PROOF STEP]
note u = u_sums_U[of x y, THEN sums_summable]
[PROOF STATE]
proof (state)
this:
summable (u x y)

goal (1 subgoal):
 1. gf_U x y z \<le> 1
[PROOF STEP]
have "gf_U x y z \<le> gf_U x y 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gf_U x y z \<le> gf_U x y 1
[PROOF STEP]
using z
[PROOF STATE]
proof (prove)
using this:
0 < z
z < 1

goal (1 subgoal):
 1. gf_U x y z \<le> gf_U x y 1
[PROOF STEP]
unfolding gf_U_def real_scaleR_def
[PROOF STATE]
proof (prove)
using this:
0 < z
z < 1

goal (1 subgoal):
 1. (\<Sum>n. u x y n * z ^ Suc n) \<le> (\<Sum>n. u x y n * 1 ^ Suc n)
[PROOF STEP]
by (intro suminf_le allI mult_mono power_mono summable_comparison_test_ev[OF _ u] always_eventually)
       (auto simp: u_nonneg intro!: mult_left_le mult_le_one power_le_one)
[PROOF STATE]
proof (state)
this:
gf_U x y z \<le> gf_U x y 1

goal (1 subgoal):
 1. gf_U x y z \<le> 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
gf_U x y z \<le> gf_U x y 1

goal (1 subgoal):
 1. gf_U x y z \<le> 1
[PROOF STEP]
have "\<dots> \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gf_U x y 1 \<le> 1
[PROOF STEP]
unfolding gf_U_eq_U
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. U x y \<le> 1
[PROOF STEP]
by (rule U_le_1)
[PROOF STATE]
proof (state)
this:
gf_U x y 1 \<le> 1

goal (1 subgoal):
 1. gf_U x y z \<le> 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
gf_U x y z \<le> 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
gf_U x y z \<le> 1

goal (1 subgoal):
 1. gf_U x y z \<le> 1
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
gf_U x y z \<le> 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eq_upto_lexmin_non_empty:
  assumes "C \<subseteq> SEQ A" and "C \<noteq> {}"
  shows "eq_upto C (lexmin C) i \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eq_upto C (lexmin C) i \<noteq> {}
[PROOF STEP]
proof (induct i)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. eq_upto C (lexmin C) 0 \<noteq> {}
 2. \<And>i. eq_upto C (lexmin C) i \<noteq> {} \<Longrightarrow> eq_upto C (lexmin C) (Suc i) \<noteq> {}
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. eq_upto C (lexmin C) 0 \<noteq> {}
 2. \<And>i. eq_upto C (lexmin C) i \<noteq> {} \<Longrightarrow> eq_upto C (lexmin C) (Suc i) \<noteq> {}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eq_upto C (lexmin C) 0 \<noteq> {}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
C \<subseteq> SEQ A
C \<noteq> {}

goal (1 subgoal):
 1. eq_upto C (lexmin C) 0 \<noteq> {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
eq_upto C (lexmin C) 0 \<noteq> {}

goal (1 subgoal):
 1. \<And>i. eq_upto C (lexmin C) i \<noteq> {} \<Longrightarrow> eq_upto C (lexmin C) (Suc i) \<noteq> {}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. eq_upto C (lexmin C) i \<noteq> {} \<Longrightarrow> eq_upto C (lexmin C) (Suc i) \<noteq> {}
[PROOF STEP]
let ?A = "\<lambda>i. ith (eq_upto C (lexmin C) i) i"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. eq_upto C (lexmin C) i \<noteq> {} \<Longrightarrow> eq_upto C (lexmin C) (Suc i) \<noteq> {}
[PROOF STEP]
case (Suc i)
[PROOF STATE]
proof (state)
this:
eq_upto C (lexmin C) i \<noteq> {}

goal (1 subgoal):
 1. \<And>i. eq_upto C (lexmin C) i \<noteq> {} \<Longrightarrow> eq_upto C (lexmin C) (Suc i) \<noteq> {}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
eq_upto C (lexmin C) i \<noteq> {}
[PROOF STEP]
have "?A i \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
eq_upto C (lexmin C) i \<noteq> {}

goal (1 subgoal):
 1. ith (eq_upto C (lexmin C) i) i \<noteq> {}
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
ith (eq_upto C (lexmin C) i) i \<noteq> {}

goal (1 subgoal):
 1. \<And>i. eq_upto C (lexmin C) i \<noteq> {} \<Longrightarrow> eq_upto C (lexmin C) (Suc i) \<noteq> {}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
ith (eq_upto C (lexmin C) i) i \<noteq> {}

goal (1 subgoal):
 1. \<And>i. eq_upto C (lexmin C) i \<noteq> {} \<Longrightarrow> eq_upto C (lexmin C) (Suc i) \<noteq> {}
[PROOF STEP]
have "eq_upto C (lexmin C) i \<subseteq> eq_upto C (lexmin C) 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eq_upto C (lexmin C) i \<subseteq> eq_upto C (lexmin C) 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
eq_upto C (lexmin C) i \<subseteq> eq_upto C (lexmin C) 0

goal (1 subgoal):
 1. \<And>i. eq_upto C (lexmin C) i \<noteq> {} \<Longrightarrow> eq_upto C (lexmin C) (Suc i) \<noteq> {}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
ith (eq_upto C (lexmin C) i) i \<noteq> {}
eq_upto C (lexmin C) i \<subseteq> eq_upto C (lexmin C) 0
[PROOF STEP]
have "?A i \<subseteq> A" and "?A i \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
ith (eq_upto C (lexmin C) i) i \<noteq> {}
eq_upto C (lexmin C) i \<subseteq> eq_upto C (lexmin C) 0

goal (1 subgoal):
 1. ith (eq_upto C (lexmin C) i) i \<subseteq> A &&& ith (eq_upto C (lexmin C) i) i \<noteq> {}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
ith (eq_upto C (lexmin C) i) i \<noteq> {}
eq_upto C (lexmin C) i \<subseteq> eq_upto C (lexmin C) 0
C \<subseteq> SEQ A
C \<noteq> {}

goal (1 subgoal):
 1. ith (eq_upto C (lexmin C) i) i \<subseteq> A &&& ith (eq_upto C (lexmin C) i) i \<noteq> {}
[PROOF STEP]
by (auto simp: ith_def)
[PROOF STATE]
proof (state)
this:
ith (eq_upto C (lexmin C) i) i \<subseteq> A
ith (eq_upto C (lexmin C) i) i \<noteq> {}

goal (1 subgoal):
 1. \<And>i. eq_upto C (lexmin C) i \<noteq> {} \<Longrightarrow> eq_upto C (lexmin C) (Suc i) \<noteq> {}
[PROOF STEP]
from min_elt_mem [OF this, folded lexmin]
[PROOF STATE]
proof (chain)
picking this:
lexmin C i \<in> ith (eq_upto C (lexmin C) i) i
[PROOF STEP]
obtain f where "f \<in> eq_upto C (lexmin C) (Suc i)"
[PROOF STATE]
proof (prove)
using this:
lexmin C i \<in> ith (eq_upto C (lexmin C) i) i

goal (1 subgoal):
 1. (\<And>f. f \<in> eq_upto C (lexmin C) (Suc i) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto dest: eq_upto_Suc)
[PROOF STATE]
proof (state)
this:
f \<in> eq_upto C (lexmin C) (Suc i)

goal (1 subgoal):
 1. \<And>i. eq_upto C (lexmin C) i \<noteq> {} \<Longrightarrow> eq_upto C (lexmin C) (Suc i) \<noteq> {}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f \<in> eq_upto C (lexmin C) (Suc i)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
f \<in> eq_upto C (lexmin C) (Suc i)

goal (1 subgoal):
 1. eq_upto C (lexmin C) (Suc i) \<noteq> {}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
eq_upto C (lexmin C) (Suc i) \<noteq> {}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem log_lin_time:
  assumes "length numbers = 2^l"
  shows "T\<^sub>F\<^sub>N\<^sub>T\<^sub>T  numbers \<le> 30 * l * length numbers + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T\<^sub>F\<^sub>N\<^sub>T\<^sub>T numbers \<le> 30 * l * length numbers + 1
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. T\<^sub>F\<^sub>N\<^sub>T\<^sub>T numbers \<le> 30 * l * length numbers + 1
[PROOF STEP]
have 00: "T\<^sub>F\<^sub>N\<^sub>T\<^sub>T  numbers  = (2 ^ l - 1) * 14 + l * 15 * 2 ^ (l - 1) + 2 ^ l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T\<^sub>F\<^sub>N\<^sub>T\<^sub>T numbers = (2 ^ l - 1) * 14 + l * 15 * 2 ^ (l - 1) + 2 ^ l
[PROOF STEP]
using tight_bound[of "\<lambda> xs. (length xs - 1) * 14 + (Discrete.log (length xs)) * 15 *
                            2 ^ ( (Discrete.log (length xs)) - 1) + length xs" numbers l]
          assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>numbers l. \<lbrakk>length numbers = 2 ^ l; 0 < l\<rbrakk> \<Longrightarrow> (length numbers - 1) * 14 + Discrete.log (length numbers) * 15 * 2 ^ (Discrete.log (length numbers) - 1) + length numbers = (2 ^ l - 1) * 14 + l * 15 * 2 ^ (l - 1) + 2 ^ l; \<And>numbers l. \<lbrakk>l = 0; length numbers = 2 ^ l\<rbrakk> \<Longrightarrow> (length numbers - 1) * 14 + Discrete.log (length numbers) * 15 * 2 ^ (Discrete.log (length numbers) - 1) + length numbers = 1; length numbers = 2 ^ l\<rbrakk> \<Longrightarrow> T\<^sub>F\<^sub>N\<^sub>T\<^sub>T numbers = (length numbers - 1) * 14 + Discrete.log (length numbers) * 15 * 2 ^ (Discrete.log (length numbers) - 1) + length numbers
length numbers = 2 ^ l

goal (1 subgoal):
 1. T\<^sub>F\<^sub>N\<^sub>T\<^sub>T numbers = (2 ^ l - 1) * 14 + l * 15 * 2 ^ (l - 1) + 2 ^ l
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
T\<^sub>F\<^sub>N\<^sub>T\<^sub>T numbers = (2 ^ l - 1) * 14 + l * 15 * 2 ^ (l - 1) + 2 ^ l

goal (1 subgoal):
 1. T\<^sub>F\<^sub>N\<^sub>T\<^sub>T numbers \<le> 30 * l * length numbers + 1
[PROOF STEP]
have " l * 15 * 2 ^ (l - 1) \<le> 15 * l * length numbers"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l * 15 * 2 ^ (l - 1) \<le> 15 * l * length numbers
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
length numbers = 2 ^ l

goal (1 subgoal):
 1. l * 15 * 2 ^ (l - 1) \<le> 15 * l * length numbers
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
l * 15 * 2 ^ (l - 1) \<le> 15 * l * length numbers

goal (1 subgoal):
 1. T\<^sub>F\<^sub>N\<^sub>T\<^sub>T numbers \<le> 30 * l * length numbers + 1
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
l * 15 * 2 ^ (l - 1) \<le> 15 * l * length numbers

goal (1 subgoal):
 1. T\<^sub>F\<^sub>N\<^sub>T\<^sub>T numbers \<le> 30 * l * length numbers + 1
[PROOF STEP]
have "(2 ^ l - 1) * 14  + 2^l\<le> 15 * length numbers "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2 ^ l - 1) * 14 + 2 ^ l \<le> 15 * length numbers
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
length numbers = 2 ^ l

goal (1 subgoal):
 1. (2 ^ l - 1) * 14 + 2 ^ l \<le> 15 * length numbers
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
(2 ^ l - 1) * 14 + 2 ^ l \<le> 15 * length numbers

goal (1 subgoal):
 1. T\<^sub>F\<^sub>N\<^sub>T\<^sub>T numbers \<le> 30 * l * length numbers + 1
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(2 ^ l - 1) * 14 + 2 ^ l \<le> 15 * length numbers

goal (1 subgoal):
 1. T\<^sub>F\<^sub>N\<^sub>T\<^sub>T numbers \<le> 30 * l * length numbers + 1
[PROOF STEP]
hence "(2 ^ l - 1) * 14 + 2^l \<le> 15 * l * length numbers +1"
[PROOF STATE]
proof (prove)
using this:
(2 ^ l - 1) * 14 + 2 ^ l \<le> 15 * length numbers

goal (1 subgoal):
 1. (2 ^ l - 1) * 14 + 2 ^ l \<le> 15 * l * length numbers + 1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(2 ^ l - 1) * 14 + 2 ^ l \<le> 15 * length numbers
length numbers = 2 ^ l

goal (1 subgoal):
 1. (2 ^ l - 1) * 14 + 2 ^ l \<le> 15 * l * length numbers + 1
[PROOF STEP]
apply(cases l)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>(2 ^ l - 1) * 14 + 2 ^ l \<le> 15 * length numbers; length numbers = 2 ^ l; l = 0\<rbrakk> \<Longrightarrow> (2 ^ l - 1) * 14 + 2 ^ l \<le> 15 * l * length numbers + 1
 2. \<And>nat. \<lbrakk>(2 ^ l - 1) * 14 + 2 ^ l \<le> 15 * length numbers; length numbers = 2 ^ l; l = Suc nat\<rbrakk> \<Longrightarrow> (2 ^ l - 1) * 14 + 2 ^ l \<le> 15 * l * length numbers + 1
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(2 ^ l - 1) * 14 + 2 ^ l \<le> 15 * length numbers; length numbers = 2 ^ l; l = 0\<rbrakk> \<Longrightarrow> (2 ^ l - 1) * 14 + 2 ^ l \<le> 15 * l * length numbers + 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>nat. \<lbrakk>(2 ^ l - 1) * 14 + 2 ^ l \<le> 15 * length numbers; length numbers = 2 ^ l; l = Suc nat\<rbrakk> \<Longrightarrow> (2 ^ l - 1) * 14 + 2 ^ l \<le> 15 * l * length numbers + 1
[PROOF STEP]
by (metis (no_types) add.commute le_add1 mult.assoc mult.commute
          mult_le_mono nat_mult_1 plus_1_eq_Suc trans_le_add2)
[PROOF STATE]
proof (state)
this:
(2 ^ l - 1) * 14 + 2 ^ l \<le> 15 * l * length numbers + 1

goal (1 subgoal):
 1. T\<^sub>F\<^sub>N\<^sub>T\<^sub>T numbers \<le> 30 * l * length numbers + 1
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
l * 15 * 2 ^ (l - 1) \<le> 15 * l * length numbers
(2 ^ l - 1) * 14 + 2 ^ l \<le> 15 * length numbers
(2 ^ l - 1) * 14 + 2 ^ l \<le> 15 * l * length numbers + 1
[PROOF STEP]
have " (2 ^ l - 1) * 14 + l * 15 * 2 ^ (l - 1) + 2 ^ l \<le>  30 * l * length numbers +1"
[PROOF STATE]
proof (prove)
using this:
l * 15 * 2 ^ (l - 1) \<le> 15 * l * length numbers
(2 ^ l - 1) * 14 + 2 ^ l \<le> 15 * length numbers
(2 ^ l - 1) * 14 + 2 ^ l \<le> 15 * l * length numbers + 1

goal (1 subgoal):
 1. (2 ^ l - 1) * 14 + l * 15 * 2 ^ (l - 1) + 2 ^ l \<le> 30 * l * length numbers + 1
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
(2 ^ l - 1) * 14 + l * 15 * 2 ^ (l - 1) + 2 ^ l \<le> 30 * l * length numbers + 1

goal (1 subgoal):
 1. T\<^sub>F\<^sub>N\<^sub>T\<^sub>T numbers \<le> 30 * l * length numbers + 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(2 ^ l - 1) * 14 + l * 15 * 2 ^ (l - 1) + 2 ^ l \<le> 30 * l * length numbers + 1
[PROOF STEP]
show  ?thesis
[PROOF STATE]
proof (prove)
using this:
(2 ^ l - 1) * 14 + l * 15 * 2 ^ (l - 1) + 2 ^ l \<le> 30 * l * length numbers + 1

goal (1 subgoal):
 1. T\<^sub>F\<^sub>N\<^sub>T\<^sub>T numbers \<le> 30 * l * length numbers + 1
[PROOF STEP]
using 00
[PROOF STATE]
proof (prove)
using this:
(2 ^ l - 1) * 14 + l * 15 * 2 ^ (l - 1) + 2 ^ l \<le> 30 * l * length numbers + 1
T\<^sub>F\<^sub>N\<^sub>T\<^sub>T numbers = (2 ^ l - 1) * 14 + l * 15 * 2 ^ (l - 1) + 2 ^ l

goal (1 subgoal):
 1. T\<^sub>F\<^sub>N\<^sub>T\<^sub>T numbers \<le> 30 * l * length numbers + 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
T\<^sub>F\<^sub>N\<^sub>T\<^sub>T numbers \<le> 30 * l * length numbers + 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in infinite_cts_filtration) proj_stoch_set_finite_range:
  fixes X::"nat \<Rightarrow> bool stream \<Rightarrow> 'b::{t0_space}"
  assumes "borel_adapt_stoch_proc F X"
  shows "finite (range (proj_stoch_proc X n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (range (proj_stoch_proc X n))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite (range (proj_stoch_proc X n))
[PROOF STEP]
have "finite (range (pseudo_proj_True n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (range (pseudo_proj_True n))
[PROOF STEP]
using pseudo_proj_True_finite_image
[PROOF STATE]
proof (prove)
using this:
finite (range (pseudo_proj_True ?n))

goal (1 subgoal):
 1. finite (range (pseudo_proj_True n))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite (range (pseudo_proj_True n))

goal (1 subgoal):
 1. finite (range (proj_stoch_proc X n))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite (range (pseudo_proj_True n))

goal (1 subgoal):
 1. finite (range (proj_stoch_proc X n))
[PROOF STEP]
have "proj_stoch_proc X n = (proj_stoch_proc X n) \<circ> (pseudo_proj_True n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proj_stoch_proc X n = proj_stoch_proc X n \<circ> pseudo_proj_True n
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. proj_stoch_proc X n x = (proj_stoch_proc X n \<circ> pseudo_proj_True n) x
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. proj_stoch_proc X n x = (proj_stoch_proc X n \<circ> pseudo_proj_True n) x
[PROOF STEP]
show "proj_stoch_proc X n x = (proj_stoch_proc X n \<circ> pseudo_proj_True n) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proj_stoch_proc X n x = (proj_stoch_proc X n \<circ> pseudo_proj_True n) x
[PROOF STEP]
using assms proj_stoch_proj_invariant
[PROOF STATE]
proof (prove)
using this:
borel_adapt_stoch_proc F X
borel_adapt_stoch_proc F ?X \<Longrightarrow> proj_stoch_proc ?X ?n ?w = proj_stoch_proc ?X ?n (pseudo_proj_True ?n ?w)

goal (1 subgoal):
 1. proj_stoch_proc X n x = (proj_stoch_proc X n \<circ> pseudo_proj_True n) x
[PROOF STEP]
by (metis comp_apply)
[PROOF STATE]
proof (state)
this:
proj_stoch_proc X n x = (proj_stoch_proc X n \<circ> pseudo_proj_True n) x

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
proj_stoch_proc X n = proj_stoch_proc X n \<circ> pseudo_proj_True n

goal (1 subgoal):
 1. finite (range (proj_stoch_proc X n))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
finite (range (pseudo_proj_True n))
proj_stoch_proc X n = proj_stoch_proc X n \<circ> pseudo_proj_True n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite (range (pseudo_proj_True n))
proj_stoch_proc X n = proj_stoch_proc X n \<circ> pseudo_proj_True n

goal (1 subgoal):
 1. finite (range (proj_stoch_proc X n))
[PROOF STEP]
by (metis finite_imageI fun.set_map)
[PROOF STATE]
proof (state)
this:
finite (range (proj_stoch_proc X n))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dtree_children_fset_id:
  assumes "to_dtree_aux r = Node r xs"
    shows "fset xs = {(x,e). (if e \<in> out_arcs T r then x = to_dtree_aux (head T e) else False)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fset xs = {(x, e). if e \<in> out_arcs T r then x = to_dtree_aux (head T e) else False}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fset xs = {(x, e). if e \<in> out_arcs T r then x = to_dtree_aux (head T e) else False}
[PROOF STEP]
let ?xs = "{(x,e). (if e \<in> out_arcs T r then x = to_dtree_aux (head T e) else False)}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fset xs = {(x, e). if e \<in> out_arcs T r then x = to_dtree_aux (head T e) else False}
[PROOF STEP]
have "finite ?xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {(x, e). if e \<in> out_arcs T r then x = to_dtree_aux (head T e) else False}
[PROOF STEP]
using dtree_children_fin
[PROOF STATE]
proof (prove)
using this:
finite {(x, e). if e \<in> out_arcs T ?r then x = to_dtree_aux (head T e) else False}

goal (1 subgoal):
 1. finite {(x, e). if e \<in> out_arcs T r then x = to_dtree_aux (head T e) else False}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite {(x, e). if e \<in> out_arcs T r then x = to_dtree_aux (head T e) else False}

goal (1 subgoal):
 1. fset xs = {(x, e). if e \<in> out_arcs T r then x = to_dtree_aux (head T e) else False}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite {(x, e). if e \<in> out_arcs T r then x = to_dtree_aux (head T e) else False}
[PROOF STEP]
have "fset (Abs_fset ?xs) = ?xs"
[PROOF STATE]
proof (prove)
using this:
finite {(x, e). if e \<in> out_arcs T r then x = to_dtree_aux (head T e) else False}

goal (1 subgoal):
 1. fset (Abs_fset {(x, e). if e \<in> out_arcs T r then x = to_dtree_aux (head T e) else False}) = {(x, e). if e \<in> out_arcs T r then x = to_dtree_aux (head T e) else False}
[PROOF STEP]
using Abs_fset_inverse
[PROOF STATE]
proof (prove)
using this:
finite {(x, e). if e \<in> out_arcs T r then x = to_dtree_aux (head T e) else False}
?y \<in> {A. finite A} \<Longrightarrow> fset (Abs_fset ?y) = ?y

goal (1 subgoal):
 1. fset (Abs_fset {(x, e). if e \<in> out_arcs T r then x = to_dtree_aux (head T e) else False}) = {(x, e). if e \<in> out_arcs T r then x = to_dtree_aux (head T e) else False}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
fset (Abs_fset {(x, e). if e \<in> out_arcs T r then x = to_dtree_aux (head T e) else False}) = {(x, e). if e \<in> out_arcs T r then x = to_dtree_aux (head T e) else False}

goal (1 subgoal):
 1. fset xs = {(x, e). if e \<in> out_arcs T r then x = to_dtree_aux (head T e) else False}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
fset (Abs_fset {(x, e). if e \<in> out_arcs T r then x = to_dtree_aux (head T e) else False}) = {(x, e). if e \<in> out_arcs T r then x = to_dtree_aux (head T e) else False}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
fset (Abs_fset {(x, e). if e \<in> out_arcs T r then x = to_dtree_aux (head T e) else False}) = {(x, e). if e \<in> out_arcs T r then x = to_dtree_aux (head T e) else False}

goal (1 subgoal):
 1. fset xs = {(x, e). if e \<in> out_arcs T r then x = to_dtree_aux (head T e) else False}
[PROOF STEP]
using assms Abs_fset_inverse
[PROOF STATE]
proof (prove)
using this:
fset (Abs_fset {(x, e). if e \<in> out_arcs T r then x = to_dtree_aux (head T e) else False}) = {(x, e). if e \<in> out_arcs T r then x = to_dtree_aux (head T e) else False}
to_dtree_aux r = Node r xs
?y \<in> {A. finite A} \<Longrightarrow> fset (Abs_fset ?y) = ?y

goal (1 subgoal):
 1. fset xs = {(x, e). if e \<in> out_arcs T r then x = to_dtree_aux (head T e) else False}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fset xs = {(x, e). if e \<in> out_arcs T r then x = to_dtree_aux (head T e) else False}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem kummers_test_divergence:
  fixes f p :: "nat \<Rightarrow> real"
  assumes pos_f: "eventually (\<lambda>n. f n > 0) sequentially"
  assumes pos_p: "eventually (\<lambda>n. p n > 0) sequentially"
  assumes divergent_p: "\<not>summable (\<lambda>n. inverse (p n))"
  defines "l \<equiv> limsup (\<lambda>n. ereal (p n * f n / f (Suc n) - p (Suc n)))"
  assumes l: "l < 0"
  shows   "\<not>summable f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> summable f
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. summable f \<Longrightarrow> False
[PROOF STEP]
assume "summable f"
[PROOF STATE]
proof (state)
this:
summable f

goal (1 subgoal):
 1. summable f \<Longrightarrow> False
[PROOF STEP]
from eventually_conj[OF pos_f eventually_conj[OF pos_p Limsup_lessD[OF l[unfolded l_def]]]]
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in sequentially. 0 < f x \<and> 0 < p x \<and> ereal (p x * f x / f (Suc x) - p (Suc x)) < 0
[PROOF STEP]
obtain N where N: "\<And>n. n \<ge> N \<Longrightarrow> p n > 0" "\<And>n. n \<ge> N \<Longrightarrow> f n > 0"
                      "\<And>n. n \<ge> N \<Longrightarrow> p n * f n / f (Suc n) - p (Suc n) < 0"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in sequentially. 0 < f x \<and> 0 < p x \<and> ereal (p x * f x / f (Suc x) - p (Suc x)) < 0

goal (1 subgoal):
 1. (\<And>N. \<lbrakk>\<And>n. N \<le> n \<Longrightarrow> 0 < p n; \<And>n. N \<le> n \<Longrightarrow> 0 < f n; \<And>n. N \<le> n \<Longrightarrow> p n * f n / f (Suc n) - p (Suc n) < 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: eventually_at_top_linorder)
[PROOF STATE]
proof (state)
this:
N \<le> ?n \<Longrightarrow> 0 < p ?n
N \<le> ?n \<Longrightarrow> 0 < f ?n
N \<le> ?n \<Longrightarrow> p ?n * f ?n / f (Suc ?n) - p (Suc ?n) < 0

goal (1 subgoal):
 1. summable f \<Longrightarrow> False
[PROOF STEP]
hence A: "p n * f n < p (Suc n) * f (Suc n)" if "n \<ge> N" for n
[PROOF STATE]
proof (prove)
using this:
N \<le> ?n \<Longrightarrow> 0 < p ?n
N \<le> ?n \<Longrightarrow> 0 < f ?n
N \<le> ?n \<Longrightarrow> p ?n * f ?n / f (Suc ?n) - p (Suc ?n) < 0

goal (1 subgoal):
 1. p n * f n < p (Suc n) * f (Suc n)
[PROOF STEP]
using that N[of n] N[of "Suc n"]
[PROOF STATE]
proof (prove)
using this:
N \<le> ?n \<Longrightarrow> 0 < p ?n
N \<le> ?n \<Longrightarrow> 0 < f ?n
N \<le> ?n \<Longrightarrow> p ?n * f ?n / f (Suc ?n) - p (Suc ?n) < 0
N \<le> n
N \<le> n \<Longrightarrow> 0 < p n
N \<le> n \<Longrightarrow> 0 < f n
N \<le> n \<Longrightarrow> p n * f n / f (Suc n) - p (Suc n) < 0
N \<le> Suc n \<Longrightarrow> 0 < p (Suc n)
N \<le> Suc n \<Longrightarrow> 0 < f (Suc n)
N \<le> Suc n \<Longrightarrow> p (Suc n) * f (Suc n) / f (Suc (Suc n)) - p (Suc (Suc n)) < 0

goal (1 subgoal):
 1. p n * f n < p (Suc n) * f (Suc n)
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
N \<le> ?n \<Longrightarrow> p ?n * f ?n < p (Suc ?n) * f (Suc ?n)

goal (1 subgoal):
 1. summable f \<Longrightarrow> False
[PROOF STEP]
have B: "p n * f n \<ge> p N * f N" if "n \<ge> N" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p N * f N \<le> p n * f n
[PROOF STEP]
using that and A
[PROOF STATE]
proof (prove)
using this:
N \<le> n
N \<le> ?n \<Longrightarrow> p ?n * f ?n < p (Suc ?n) * f (Suc ?n)

goal (1 subgoal):
 1. p N * f N \<le> p n * f n
[PROOF STEP]
by (induction n rule: dec_induct) (auto intro!: less_imp_le elim!: order.trans)
[PROOF STATE]
proof (state)
this:
N \<le> ?n \<Longrightarrow> p N * f N \<le> p ?n * f ?n

goal (1 subgoal):
 1. summable f \<Longrightarrow> False
[PROOF STEP]
have "eventually (\<lambda>n. norm (p N * f N * inverse (p n)) \<le> f n) sequentially"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. norm (p N * f N * inverse (p n)) \<le> f n
[PROOF STEP]
apply (rule eventually_mono [OF eventually_ge_at_top[of N]])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. N \<le> x \<Longrightarrow> norm (p N * f N * inverse (p x)) \<le> f x
[PROOF STEP]
using B N
[PROOF STATE]
proof (prove)
using this:
N \<le> ?n \<Longrightarrow> p N * f N \<le> p ?n * f ?n
N \<le> ?n \<Longrightarrow> 0 < p ?n
N \<le> ?n \<Longrightarrow> 0 < f ?n
N \<le> ?n \<Longrightarrow> p ?n * f ?n / f (Suc ?n) - p (Suc ?n) < 0

goal (1 subgoal):
 1. \<And>x. N \<le> x \<Longrightarrow> norm (p N * f N * inverse (p x)) \<le> f x
[PROOF STEP]
by (auto  simp: field_simps abs_of_pos)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. norm (p N * f N * inverse (p n)) \<le> f n

goal (1 subgoal):
 1. summable f \<Longrightarrow> False
[PROOF STEP]
from this and \<open>summable f\<close>
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in sequentially. norm (p N * f N * inverse (p n)) \<le> f n
summable f
[PROOF STEP]
have "summable (\<lambda>n. p N * f N * inverse (p n))"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in sequentially. norm (p N * f N * inverse (p n)) \<le> f n
summable f

goal (1 subgoal):
 1. summable (\<lambda>n. p N * f N * inverse (p n))
[PROOF STEP]
by (rule summable_comparison_test_ev)
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. p N * f N * inverse (p n))

goal (1 subgoal):
 1. summable f \<Longrightarrow> False
[PROOF STEP]
from summable_mult[OF this, of "inverse (p N * f N)"] N[OF le_refl]
[PROOF STATE]
proof (chain)
picking this:
summable (\<lambda>n. inverse (p N * f N) * (p N * f N * inverse (p n)))
0 < p N
0 < f N
p N * f N / f (Suc N) - p (Suc N) < 0
[PROOF STEP]
have "summable (\<lambda>n. inverse (p n))"
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>n. inverse (p N * f N) * (p N * f N * inverse (p n)))
0 < p N
0 < f N
p N * f N / f (Suc N) - p (Suc N) < 0

goal (1 subgoal):
 1. summable (\<lambda>n. inverse (p n))
[PROOF STEP]
by (simp add: field_split_simps)
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. inverse (p n))

goal (1 subgoal):
 1. summable f \<Longrightarrow> False
[PROOF STEP]
with divergent_p
[PROOF STATE]
proof (chain)
picking this:
\<not> summable (\<lambda>n. inverse (p n))
summable (\<lambda>n. inverse (p n))
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
\<not> summable (\<lambda>n. inverse (p n))
summable (\<lambda>n. inverse (p n))

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma coeff_int_prod_const: assumes "finite xs" and "y \<notin> xs"
  and "\<And> x. x \<in> xs \<Longrightarrow> degree (f x) = 0"
shows "coeff_int (prod f (insert y xs)) i = prod (\<lambda> x. coeff_int (f x) 0) xs * coeff_int (f y) i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. coeff_int (prod f (insert y xs)) i = (\<Prod>x\<in>xs. coeff_int (f x) 0) * coeff_int (f y) i
[PROOF STEP]
using coeff_prod_const[OF assms]
[PROOF STATE]
proof (prove)
using this:
(\<And>x. x \<in> xs \<Longrightarrow> ?x1 x \<in> xs) \<Longrightarrow> coeff (\<Prod>x\<in>insert y xs. f (?x1 x)) ?i = (\<Prod>x\<in>xs. coeff (f (?x1 x)) 0) * coeff (f (?x1 y)) ?i

goal (1 subgoal):
 1. coeff_int (prod f (insert y xs)) i = (\<Prod>x\<in>xs. coeff_int (f x) 0) * coeff_int (f y) i
[PROOF STEP]
unfolding coeff_int_def
[PROOF STATE]
proof (prove)
using this:
(\<And>x. x \<in> xs \<Longrightarrow> ?x1 x \<in> xs) \<Longrightarrow> coeff (\<Prod>x\<in>insert y xs. f (?x1 x)) ?i = (\<Prod>x\<in>xs. coeff (f (?x1 x)) 0) * coeff (f (?x1 y)) ?i

goal (1 subgoal):
 1. (if i < 0 then 0::'b else coeff (prod f (insert y xs)) (nat i)) = (\<Prod>x\<in>xs. if 0 < 0 then 0::'b else coeff (f x) (nat 0)) * (if i < 0 then 0::'b else coeff (f y) (nat i))
[PROOF STEP]
by (cases "i < 0", auto)


[STATEMENT]
lemma inner_minus_right [simp]: "inner x (- y) = - inner x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner x (- y) = - inner x y
[PROOF STEP]
using inner_minus_left [of y x]
[PROOF STATE]
proof (prove)
using this:
inner (- y) x = - inner y x

goal (1 subgoal):
 1. inner x (- y) = - inner x y
[PROOF STEP]
by (metis (no_types) add_eq_0_iff local.inner_add_right local.inner_zero_right)


[STATEMENT]
lemma bound_of_leI:
  assumes "\<And>x. P x \<le> (c::real)"
  shows "bound_of P \<le> c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bound_of P \<le> c
[PROOF STEP]
unfolding bound_of_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sup (range P) \<le> c
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
P ?x \<le> c

goal (1 subgoal):
 1. Sup (range P) \<le> c
[PROOF STEP]
by(intro cSup_least, auto)


[STATEMENT]
lemma bool14: "(P \<longrightarrow> False) = (\<not> P)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (P \<longrightarrow> False) = (\<not> P)
[PROOF STEP]
by blast


[STATEMENT]
lemma sqr_fix_nat :
  assumes "(n::nat) = n\<^sup>2"
  shows "n = 0 \<or> n = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n = 0 \<or> n = 1
[PROOF STEP]
using assms numeral_2_eq_2
[PROOF STATE]
proof (prove)
using this:
n = n\<^sup>2
2 = Suc (Suc 0)

goal (1 subgoal):
 1. n = 0 \<or> n = 1
[PROOF STEP]
by fastforce


[STATEMENT]
lemma set_spmf_of_set: "set_spmf (spmf_of_set A) = (if finite A then A else {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_spmf (spmf_of_set A) = (if finite A then A else {})
[PROOF STEP]
by(simp add: spmf_of_set_def)


[STATEMENT]
lemma orthogonal_matD[elim]:
  "orthogonal_mat A \<Longrightarrow>
   i < dim_col A \<Longrightarrow> j < dim_col A \<Longrightarrow> (col A i \<bullet> col A j = 0) = (i \<noteq> j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>orthogonal_mat A; i < dim_col A; j < dim_col A\<rbrakk> \<Longrightarrow> (col A i \<bullet> col A j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
unfolding orthogonal_mat_def diagonal_mat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>let B = transpose_mat A * A in (\<forall>i<dim_row B. \<forall>j<dim_col B. i \<noteq> j \<longrightarrow> B $$ (i, j) = (0::'a)) \<and> (\<forall>i<dim_col A. B $$ (i, i) \<noteq> (0::'a)); i < dim_col A; j < dim_col A\<rbrakk> \<Longrightarrow> (col A i \<bullet> col A j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
by auto


[STATEMENT]
lemma Re_Arccos_bounds: "-pi < Re(Arccos z) \<and> Re(Arccos z) \<le> pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - pi < Re (Arccos z) \<and> Re (Arccos z) \<le> pi
[PROOF STEP]
unfolding Re_Arccos
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - pi < Im (Ln (z + \<i> * csqrt (1 - z\<^sup>2))) \<and> Im (Ln (z + \<i> * csqrt (1 - z\<^sup>2))) \<le> pi
[PROOF STEP]
by (blast intro!: mpi_less_Im_Ln Im_Ln_le_pi Arccos_body_lemma)


[STATEMENT]
lemma disjoint_cballI: "dist x y > r + s \<Longrightarrow> cball x r \<inter> cball y s = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r + s < dist x y \<Longrightarrow> cball x r \<inter> cball y s = {}
[PROOF STEP]
by (metis add_mono disjoint_iff_not_equal dist_triangle2 dual_order.trans leD mem_cball)


[STATEMENT]
lemma Gamma_gbinomial:
  "(\<lambda>n. ((z + of_nat n) gchoose n) * exp (-z * of_real (ln (of_nat n)))) \<longlonglongrightarrow> rGamma (z+1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. (z + of_nat n gchoose n) * exp (- z * of_real (ln (real n)))) \<longlonglongrightarrow> rGamma (z + (1::'a))
[PROOF STEP]
proof (cases "z = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. z = (0::'a) \<Longrightarrow> (\<lambda>n. (z + of_nat n gchoose n) * exp (- z * of_real (ln (real n)))) \<longlonglongrightarrow> rGamma (z + (1::'a))
 2. z \<noteq> (0::'a) \<Longrightarrow> (\<lambda>n. (z + of_nat n gchoose n) * exp (- z * of_real (ln (real n)))) \<longlonglongrightarrow> rGamma (z + (1::'a))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
z \<noteq> (0::'a)

goal (2 subgoals):
 1. z = (0::'a) \<Longrightarrow> (\<lambda>n. (z + of_nat n gchoose n) * exp (- z * of_real (ln (real n)))) \<longlonglongrightarrow> rGamma (z + (1::'a))
 2. z \<noteq> (0::'a) \<Longrightarrow> (\<lambda>n. (z + of_nat n gchoose n) * exp (- z * of_real (ln (real n)))) \<longlonglongrightarrow> rGamma (z + (1::'a))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. (z + of_nat n gchoose n) * exp (- z * of_real (ln (real n)))) \<longlonglongrightarrow> rGamma (z + (1::'a))
[PROOF STEP]
proof (rule Lim_transform_eventually)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?f \<longlonglongrightarrow> rGamma (z + (1::'a))
 2. \<forall>\<^sub>F x in sequentially. ?f x = (z + of_nat x gchoose x) * exp (- z * of_real (ln (real x)))
[PROOF STEP]
let ?powr = "\<lambda>a b. exp (b * of_real (ln (of_nat a)))"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?f \<longlonglongrightarrow> rGamma (z + (1::'a))
 2. \<forall>\<^sub>F x in sequentially. ?f x = (z + of_nat x gchoose x) * exp (- z * of_real (ln (real x)))
[PROOF STEP]
show "eventually (\<lambda>n. rGamma_series z n / z =
            ((z + of_nat n) gchoose n) * ?powr n (-z)) sequentially"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in sequentially. rGamma_series z n / z = (z + of_nat n gchoose n) * exp (- z * of_real (ln (real n)))
[PROOF STEP]
proof (intro always_eventually allI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. rGamma_series z x / z = (z + of_nat x gchoose x) * exp (- z * of_real (ln (real x)))
[PROOF STEP]
fix n :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. rGamma_series z x / z = (z + of_nat x gchoose x) * exp (- z * of_real (ln (real x)))
[PROOF STEP]
from False
[PROOF STATE]
proof (chain)
picking this:
z \<noteq> (0::'a)
[PROOF STEP]
have "((z + of_nat n) gchoose n) = pochhammer z (Suc n) / z / fact n"
[PROOF STATE]
proof (prove)
using this:
z \<noteq> (0::'a)

goal (1 subgoal):
 1. z + of_nat n gchoose n = pochhammer z (Suc n) / z / fact n
[PROOF STEP]
by (simp add: gbinomial_pochhammer' pochhammer_rec)
[PROOF STATE]
proof (state)
this:
z + of_nat n gchoose n = pochhammer z (Suc n) / z / fact n

goal (1 subgoal):
 1. \<And>x. rGamma_series z x / z = (z + of_nat x gchoose x) * exp (- z * of_real (ln (real x)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
z + of_nat n gchoose n = pochhammer z (Suc n) / z / fact n

goal (1 subgoal):
 1. \<And>x. rGamma_series z x / z = (z + of_nat x gchoose x) * exp (- z * of_real (ln (real x)))
[PROOF STEP]
have "pochhammer z (Suc n) / z / fact n * ?powr n (-z) = rGamma_series z n / z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pochhammer z (Suc n) / z / fact n * exp (- z * of_real (ln (real n))) = rGamma_series z n / z
[PROOF STEP]
by (simp add: rGamma_series_def field_split_simps exp_minus)
[PROOF STATE]
proof (state)
this:
pochhammer z (Suc n) / z / fact n * exp (- z * of_real (ln (real n))) = rGamma_series z n / z

goal (1 subgoal):
 1. \<And>x. rGamma_series z x / z = (z + of_nat x gchoose x) * exp (- z * of_real (ln (real x)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(z + of_nat n gchoose n) * exp (- z * of_real (ln (real n))) = rGamma_series z n / z
[PROOF STEP]
show "rGamma_series z n / z = ((z + of_nat n) gchoose n) * ?powr n (-z)"
[PROOF STATE]
proof (prove)
using this:
(z + of_nat n gchoose n) * exp (- z * of_real (ln (real n))) = rGamma_series z n / z

goal (1 subgoal):
 1. rGamma_series z n / z = (z + of_nat n gchoose n) * exp (- z * of_real (ln (real n)))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
rGamma_series z n / z = (z + of_nat n gchoose n) * exp (- z * of_real (ln (real n)))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in sequentially. rGamma_series z n / z = (z + of_nat n gchoose n) * exp (- z * of_real (ln (real n)))

goal (1 subgoal):
 1. (\<lambda>n. rGamma_series z n / z) \<longlonglongrightarrow> rGamma (z + (1::'a))
[PROOF STEP]
from False
[PROOF STATE]
proof (chain)
picking this:
z \<noteq> (0::'a)
[PROOF STEP]
have "(\<lambda>n. rGamma_series z n / z) \<longlonglongrightarrow> rGamma z / z"
[PROOF STATE]
proof (prove)
using this:
z \<noteq> (0::'a)

goal (1 subgoal):
 1. (\<lambda>n. rGamma_series z n / z) \<longlonglongrightarrow> rGamma z / z
[PROOF STEP]
by (intro tendsto_intros)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. rGamma_series z n / z) \<longlonglongrightarrow> rGamma z / z

goal (1 subgoal):
 1. (\<lambda>n. rGamma_series z n / z) \<longlonglongrightarrow> rGamma (z + (1::'a))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>n. rGamma_series z n / z) \<longlonglongrightarrow> rGamma z / z

goal (1 subgoal):
 1. (\<lambda>n. rGamma_series z n / z) \<longlonglongrightarrow> rGamma (z + (1::'a))
[PROOF STEP]
from False
[PROOF STATE]
proof (chain)
picking this:
z \<noteq> (0::'a)
[PROOF STEP]
have "rGamma z / z = rGamma (z + 1)"
[PROOF STATE]
proof (prove)
using this:
z \<noteq> (0::'a)

goal (1 subgoal):
 1. rGamma z / z = rGamma (z + (1::'a))
[PROOF STEP]
using rGamma_plus1[of z]
[PROOF STATE]
proof (prove)
using this:
z \<noteq> (0::'a)
z * rGamma (z + (1::'a)) = rGamma z

goal (1 subgoal):
 1. rGamma z / z = rGamma (z + (1::'a))
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
rGamma z / z = rGamma (z + (1::'a))

goal (1 subgoal):
 1. (\<lambda>n. rGamma_series z n / z) \<longlonglongrightarrow> rGamma (z + (1::'a))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. rGamma_series z n / z) \<longlonglongrightarrow> rGamma (z + (1::'a))
[PROOF STEP]
show "(\<lambda>n. rGamma_series z n / z) \<longlonglongrightarrow> rGamma (z+1)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. rGamma_series z n / z) \<longlonglongrightarrow> rGamma (z + (1::'a))

goal (1 subgoal):
 1. (\<lambda>n. rGamma_series z n / z) \<longlonglongrightarrow> rGamma (z + (1::'a))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<lambda>n. rGamma_series z n / z) \<longlonglongrightarrow> rGamma (z + (1::'a))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (z + of_nat n gchoose n) * exp (- z * of_real (ln (real n)))) \<longlonglongrightarrow> rGamma (z + (1::'a))

goal (1 subgoal):
 1. z = (0::'a) \<Longrightarrow> (\<lambda>n. (z + of_nat n gchoose n) * exp (- z * of_real (ln (real n)))) \<longlonglongrightarrow> rGamma (z + (1::'a))
[PROOF STEP]
qed (simp_all add: binomial_gbinomial [symmetric])


[STATEMENT]
lemma const_smallo_powr:
  assumes "filterlim f at_top F" "F \<noteq> bot"
  shows "(\<lambda>_. c :: real) \<in> o[F](\<lambda>x. f x powr p) \<longleftrightarrow> p > 0 \<or> c = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>_. c) \<in> o[F](\<lambda>x. f x powr p)) = (0 < p \<or> c = 0)
[PROOF STEP]
by (rule linorder_cases[of p 0]; cases "c = 0")
     (insert assms smallo_powr_iff[of p "\<lambda>_. 1" F f] smallo_neg_powr_iff[of p f F "\<lambda>_. 1"],
      auto simp: landau_simps eventually_nonzero_simps smallo_1_iff[of F f] not_less
           dest: landau_o.small_asymmetric simp: eventually_False landau_o.small_refl_iff)


[STATEMENT]
lemma mult_hv_eq_cross_dot: "Hv x * Hv y = Hv(x  \<times>\<^sub>7 y) - octo_of_real (inner x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Hv x * Hv y = Hv (x \<times>\<^sub>7 y) - octo_of_real (x \<bullet> y)
[PROOF STEP]
by (simp add: octo_eq_iff inner_octo_def cross7_components octo_mult_components
                inner_vec_def sum_7)


[STATEMENT]
lemma if_eq_eq: "(if v = 1 then (0 :: nat) else 1) = 0 \<Longrightarrow> v = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if v = (1::'a) then 0 else 1) = 0 \<Longrightarrow> v = (1::'a)
[PROOF STEP]
by presburger


[STATEMENT]
lemma i_Exec_Stream_Acc_Output_causal: "
  input1 \<Down> n = input2 \<Down> n \<Longrightarrow>
  i_Exec_Comp_Stream_Acc_Output k output_fun trans_fun input1 c \<Down> n =
  i_Exec_Comp_Stream_Acc_Output k output_fun trans_fun input2 c \<Down> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. input1 \<Down> n = input2 \<Down> n \<Longrightarrow> i_Exec_Comp_Stream_Acc_Output k output_fun trans_fun input1 c \<Down> n = i_Exec_Comp_Stream_Acc_Output k output_fun trans_fun input2 c \<Down> n
[PROOF STEP]
apply (case_tac "k = 0")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>input1 \<Down> n = input2 \<Down> n; k = 0\<rbrakk> \<Longrightarrow> i_Exec_Comp_Stream_Acc_Output k output_fun trans_fun input1 c \<Down> n = i_Exec_Comp_Stream_Acc_Output k output_fun trans_fun input2 c \<Down> n
 2. \<lbrakk>input1 \<Down> n = input2 \<Down> n; k \<noteq> 0\<rbrakk> \<Longrightarrow> i_Exec_Comp_Stream_Acc_Output k output_fun trans_fun input1 c \<Down> n = i_Exec_Comp_Stream_Acc_Output k output_fun trans_fun input2 c \<Down> n
[PROOF STEP]
apply (simp add: i_Exec_Comp_Stream_Acc_Output_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>input1 \<Down> n = input2 \<Down> n; k \<noteq> 0\<rbrakk> \<Longrightarrow> i_Exec_Comp_Stream_Acc_Output k output_fun trans_fun input1 c \<Down> n = i_Exec_Comp_Stream_Acc_Output k output_fun trans_fun input2 c \<Down> n
[PROOF STEP]
apply (simp add: i_Exec_Stream_Acc_Output_take)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma InfCard_cmult_eq: "\<lbrakk>InfCard \<kappa>; InfCard \<mu>\<rbrakk> \<Longrightarrow> \<kappa> \<otimes> \<mu> = \<kappa> \<squnion> \<mu>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>InfCard \<kappa>; InfCard \<mu>\<rbrakk> \<Longrightarrow> \<kappa> \<otimes> \<mu> = \<kappa> \<squnion> \<mu>
[PROOF STEP]
by (metis Card_is_Ord InfCard_def InfCard_le_cmult_eq Ord_linear_le cmult_commute inf_sup_aci(5) mem_not_refl sup.orderE sup_V_0_right zero_in_omega)