[STATEMENT]
lemma hypreal_of_real_isLub_iff:
  "isLub \<real> (hypreal_of_real ` Q) (hypreal_of_real Y) = isLub (UNIV :: real set) Q Y"  (is "?lhs = ?rhs")
  for Q :: "real set" and Y :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isLub \<real> (hypreal_of_real ` Q) (hypreal_of_real Y) = isLub UNIV Q Y
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. isLub \<real> (hypreal_of_real ` Q) (hypreal_of_real Y) \<Longrightarrow> isLub UNIV Q Y
 2. isLub UNIV Q Y \<Longrightarrow> isLub \<real> (hypreal_of_real ` Q) (hypreal_of_real Y)
[PROOF STEP]
assume ?lhs
[PROOF STATE]
proof (state)
this:
isLub \<real> (hypreal_of_real ` Q) (hypreal_of_real Y)

goal (2 subgoals):
 1. isLub \<real> (hypreal_of_real ` Q) (hypreal_of_real Y) \<Longrightarrow> isLub UNIV Q Y
 2. isLub UNIV Q Y \<Longrightarrow> isLub \<real> (hypreal_of_real ` Q) (hypreal_of_real Y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
isLub \<real> (hypreal_of_real ` Q) (hypreal_of_real Y)
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
isLub \<real> (hypreal_of_real ` Q) (hypreal_of_real Y)

goal (1 subgoal):
 1. isLub UNIV Q Y
[PROOF STEP]
by (simp add: isLub_def leastP_def) (metis hypreal_of_real_isUb_iff mem_Collect_eq setge_def star_of_le)
[PROOF STATE]
proof (state)
this:
isLub UNIV Q Y

goal (1 subgoal):
 1. isLub UNIV Q Y \<Longrightarrow> isLub \<real> (hypreal_of_real ` Q) (hypreal_of_real Y)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. isLub UNIV Q Y \<Longrightarrow> isLub \<real> (hypreal_of_real ` Q) (hypreal_of_real Y)
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
isLub UNIV Q Y

goal (1 subgoal):
 1. isLub UNIV Q Y \<Longrightarrow> isLub \<real> (hypreal_of_real ` Q) (hypreal_of_real Y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
isLub UNIV Q Y
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
using this:
isLub UNIV Q Y

goal (1 subgoal):
 1. isLub \<real> (hypreal_of_real ` Q) (hypreal_of_real Y)
[PROOF STEP]
apply (simp add: isLub_def leastP_def hypreal_of_real_isUb_iff setge_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isUb UNIV Q Y \<and> (\<forall>x. isUb UNIV Q x \<longrightarrow> Y \<le> x) \<Longrightarrow> \<forall>x. isUb \<real> (hypreal_of_real ` Q) x \<longrightarrow> hypreal_of_real Y \<le> x
[PROOF STEP]
by (metis SReal_iff hypreal_of_real_isUb_iff isUb_def star_of_le)
[PROOF STATE]
proof (state)
this:
isLub \<real> (hypreal_of_real ` Q) (hypreal_of_real Y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lexord_fusion_code:
  "lexord_fusion g1 g2 s1 s2 \<longleftrightarrow>
  (case generator g1 s1 of
     Done \<Rightarrow> \<not> null_cons g2 s2
   | Skip s1' \<Rightarrow> lexord_fusion g1 g2 s1' s2
   | Yield x s1' \<Rightarrow>
     (case force g2 s2 of
        None \<Rightarrow> False
      | Some (y, s2') \<Rightarrow> x < y \<or> \<not> y < x \<and> lexord_fusion g1 g2 s1' s2'))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lexord_fusion g1 g2 s1 s2 = (case generator g1 s1 of Done \<Rightarrow> \<not> null_cons g2 s2 | Skip s1' \<Rightarrow> lexord_fusion g1 g2 s1' s2 | Yield x s1' \<Rightarrow> case force g2 s2 of None \<Rightarrow> False | Some (y, s2') \<Rightarrow> x < y \<or> \<not> y < x \<and> lexord_fusion g1 g2 s1' s2')
[PROOF STEP]
unfolding lexord_fusion_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ord_class.lexordp (unstream g1 s1) (unstream g2 s2) = (case generator g1 s1 of Done \<Rightarrow> \<not> null_cons g2 s2 | Skip s1' \<Rightarrow> ord_class.lexordp (unstream g1 s1') (unstream g2 s2) | Yield x s1' \<Rightarrow> case force g2 s2 of None \<Rightarrow> False | Some (y, s2') \<Rightarrow> x < y \<or> \<not> y < x \<and> ord_class.lexordp (unstream g1 s1') (unstream g2 s2'))
[PROOF STEP]
by(cases "generator g1 s1" "force g2 s2" rule: step.exhaust[case_product option.exhaust])(auto simp add: null_cons_def null_def)


[STATEMENT]
lemma ns_mul_extE:
  assumes "(A, B) \<in> ns_mul_ext ns s"
  obtains A1 A2 B1 B2 where "A = A1 + A2" and "B = B1 + B2"
    and "(A1, B1) \<in> multpw ns"
    and "\<And>b. b \<in># B2 \<Longrightarrow> \<exists>a. a \<in># A2 \<and> (a, b) \<in> s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>A1 A2 B1 B2. \<lbrakk>A = A1 + A2; B = B1 + B2; (A1, B1) \<in> multpw ns; \<And>b. b \<in># B2 \<Longrightarrow> \<exists>a. a \<in># A2 \<and> (a, b) \<in> s\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(A, B) \<in> ns_mul_ext ns s

goal (1 subgoal):
 1. (\<And>A1 A2 B1 B2. \<lbrakk>A = A1 + A2; B = B1 + B2; (A1, B1) \<in> multpw ns; \<And>b. b \<in># B2 \<Longrightarrow> \<exists>a. a \<in># A2 \<and> (a, b) \<in> s\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: ns_mul_ext_def multpw_converse elim!: mult2_alt_nsE)


[STATEMENT]
lemma Gamma_Gamma_Beta:
  assumes "x + y \<notin> \<int>\<^sub>\<le>\<^sub>0"
  shows   "Gamma x * Gamma y = Beta x y * Gamma (x + y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gamma x * Gamma y = Beta x y * Gamma (x + y)
[PROOF STEP]
unfolding Beta_altdef
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gamma x * Gamma y = Gamma x * Gamma y * rGamma (x + y) * Gamma (x + y)
[PROOF STEP]
using assms Gamma_eq_zero_iff[of "x+y"]
[PROOF STATE]
proof (prove)
using this:
x + y \<notin> \<int>\<^sub>\<le>\<^sub>0
(Gamma (x + y) = (0::'a)) = (x + y \<in> \<int>\<^sub>\<le>\<^sub>0)

goal (1 subgoal):
 1. Gamma x * Gamma y = Gamma x * Gamma y * rGamma (x + y) * Gamma (x + y)
[PROOF STEP]
by (simp add: rGamma_inverse_Gamma)


[STATEMENT]
lemma infsum_bounded_linear:
  assumes \<open>bounded_linear f\<close>
  assumes \<open>g summable_on S\<close>
  shows \<open>infsum (f \<circ> g) S = f (infsum g S)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infsum (f \<circ> g) S = f (infsum g S)
[PROOF STEP]
apply (rule infsum_comm_additive)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. additive f
 2. isCont f (infsum g S)
 3. g summable_on S
[PROOF STEP]
using assms blinfun_apply_induct blinfun.additive_right
[PROOF STATE]
proof (prove)
using this:
bounded_linear f
g summable_on S
\<lbrakk>?y \<in> {f. bounded_linear f}; \<And>x. ?P (blinfun_apply x)\<rbrakk> \<Longrightarrow> ?P ?y
additive (blinfun_apply ?a)

goal (3 subgoals):
 1. additive f
 2. isCont f (infsum g S)
 3. g summable_on S
[PROOF STEP]
by (auto simp: linear_continuous_within)


[STATEMENT]
lemma lemma1: "Key (invKey K) \<in> analz H \<Longrightarrow>
               analz (insert (Crypt K X) H) \<subseteq>
               insert (Crypt K X) (analz (insert X H))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Key (invKey K) \<in> analz H \<Longrightarrow> analz (insert (Crypt K X) H) \<subseteq> insert (Crypt K X) (analz (insert X H))
[PROOF STEP]
apply (rule subsetI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>Key (invKey K) \<in> analz H; x \<in> analz (insert (Crypt K X) H)\<rbrakk> \<Longrightarrow> x \<in> insert (Crypt K X) (analz (insert X H))
[PROOF STEP]
apply (erule_tac x = x in analz.induct, auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma UN_derivations_eq_derivable: "(\<Union>{P. derivation P}) = {x. derivable x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (Collect derivation) = Collect derivable
[PROOF STEP]
by (auto simp: derivable_def)


[STATEMENT]
lemma first_less: "rank_invar (t # bq) \<Longrightarrow> \<forall>t' \<in> set bq. rank t < rank t'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rank_invar (t # bq) \<Longrightarrow> \<forall>t'\<in>set bq. rank t < rank t'
[PROOF STEP]
apply(induct bq arbitrary: t)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>t. rank_invar [t] \<Longrightarrow> \<forall>t'\<in>set []. rank t < rank t'
 2. \<And>a bq t. \<lbrakk>\<And>t. rank_invar (t # bq) \<Longrightarrow> \<forall>t'\<in>set bq. rank t < rank t'; rank_invar (t # a # bq)\<rbrakk> \<Longrightarrow> \<forall>t'\<in>set (a # bq). rank t < rank t'
[PROOF STEP]
apply (simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a bq t. \<lbrakk>\<And>t. rank_invar (t # bq) \<Longrightarrow> \<forall>t'\<in>set bq. rank t < rank t'; rank_invar (t # a # bq)\<rbrakk> \<Longrightarrow> \<forall>t'\<in>set (a # bq). rank t < rank t'
[PROOF STEP]
apply (metis order_le_less rank_invar.simps(3) set_ConsD xt1(7))
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma ksup_assoc: "((f::'a \<Rightarrow> 'b set) \<squnion> g) \<squnion> h = f \<squnion> (g \<squnion> h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<squnion> g \<squnion> h = f \<squnion> (g \<squnion> h)
[PROOF STEP]
unfolding sup.assoc
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<squnion> (g \<squnion> h) = f \<squnion> (g \<squnion> h)
[PROOF STEP]
by simp


[STATEMENT]
lemma trace_minus[simp]: "trace (A - B) = (trace A - trace B::_::ab_group_add)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Square_Matrix.trace (A - B) = Square_Matrix.trace A - Square_Matrix.trace B
[PROOF STEP]
by transfer (simp add: sum_subtractf)


[STATEMENT]
lemma Ya_arr:
    assumes g: "C.arr g"
    shows "Y a g = S.mkArr (Hom.set (C.cod g, a)) (Hom.set (C.dom g, a))
                           (\<phi> (C.dom g, a) o Cop.comp g o \<psi> (C.cod g, a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Y a g = S.mkArr (Hom.set (C.cod g, a)) (Hom.set (C.dom g, a)) (S.arr_of \<circ> inl \<circ> (\<cdot>\<^sup>o\<^sup>p) g \<circ> \<psi> (C.cod g, a))
[PROOF STEP]
using ide_apex g Y.Y_ide_arr [of a g "C.dom g" "C.cod g"]
[PROOF STATE]
proof (prove)
using this:
C.ide a
C.arr g
\<lbrakk>C.ide a; \<guillemotleft>g : C.dom g \<rightarrow> C.cod g\<guillemotright>\<rbrakk> \<Longrightarrow> \<guillemotleft>Y a g : Hom.map (C.cod g, a) \<rightarrow>\<^sub>S Hom.map (C.dom g, a)\<guillemotright>
\<lbrakk>C.ide a; \<guillemotleft>g : C.dom g \<rightarrow> C.cod g\<guillemotright>\<rbrakk> \<Longrightarrow> Y a g = S.mkArr (Hom.set (C.cod g, a)) (Hom.set (C.dom g, a)) (S.arr_of \<circ> inl \<circ> (\<cdot>\<^sup>o\<^sup>p) g \<circ> \<psi> (C.cod g, a))

goal (1 subgoal):
 1. Y a g = S.mkArr (Hom.set (C.cod g, a)) (Hom.set (C.dom g, a)) (S.arr_of \<circ> inl \<circ> (\<cdot>\<^sup>o\<^sup>p) g \<circ> \<psi> (C.cod g, a))
[PROOF STEP]
by auto


[STATEMENT]
lemma msetext_dersh_wf:
  assumes wf_gt: "wfP (\<lambda>x y. gt y x)"
  shows "wfP (\<lambda>xs ys. msetext_dersh gt ys xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wfP (\<lambda>xs ys. msetext_dersh gt ys xs)
[PROOF STEP]
proof (rule wfP_subset, rule wfP_app[of "\<lambda>xs ys. (xs, ys) \<in> mult {(x, y). gt y x}" mset])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. wfP (\<lambda>xs ys. (xs, ys) \<in> mult {(x, y). gt y x})
 2. (\<lambda>xs ys. msetext_dersh gt ys xs) \<le> (\<lambda>x y. (mset x, mset y) \<in> mult {(x, y). gt y x})
[PROOF STEP]
show "wfP (\<lambda>xs ys. (xs, ys) \<in> mult {(x, y). gt y x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wfP (\<lambda>xs ys. (xs, ys) \<in> mult {(x, y). gt y x})
[PROOF STEP]
using wf_gt
[PROOF STATE]
proof (prove)
using this:
wfP (\<lambda>x y. gt y x)

goal (1 subgoal):
 1. wfP (\<lambda>xs ys. (xs, ys) \<in> mult {(x, y). gt y x})
[PROOF STEP]
unfolding wfP_def
[PROOF STATE]
proof (prove)
using this:
wf {(x, y). gt y x}

goal (1 subgoal):
 1. wf {(xs, ys). (xs, ys) \<in> mult {(x, y). gt y x}}
[PROOF STEP]
by (auto intro: wf_mult)
[PROOF STATE]
proof (state)
this:
wfP (\<lambda>xs ys. (xs, ys) \<in> mult {(x, y). gt y x})

goal (1 subgoal):
 1. (\<lambda>xs ys. msetext_dersh gt ys xs) \<le> (\<lambda>x y. (mset x, mset y) \<in> mult {(x, y). gt y x})
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>xs ys. msetext_dersh gt ys xs) \<le> (\<lambda>x y. (mset x, mset y) \<in> mult {(x, y). gt y x})
[PROOF STEP]
show "(\<lambda>xs ys. msetext_dersh gt ys xs) \<le> (\<lambda>x y. (mset x, mset y) \<in> mult {(x, y). gt y x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>xs ys. msetext_dersh gt ys xs) \<le> (\<lambda>x y. (mset x, mset y) \<in> mult {(x, y). gt y x})
[PROOF STEP]
using msetext_dersh_imp_mult
[PROOF STATE]
proof (prove)
using this:
msetext_dersh ?gt ?ys ?xs \<Longrightarrow> (mset ?xs, mset ?ys) \<in> mult {(x, y). ?gt y x}

goal (1 subgoal):
 1. (\<lambda>xs ys. msetext_dersh gt ys xs) \<le> (\<lambda>x y. (mset x, mset y) \<in> mult {(x, y). gt y x})
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<lambda>xs ys. msetext_dersh gt ys xs) \<le> (\<lambda>x y. (mset x, mset y) \<in> mult {(x, y). gt y x})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma qbs_morphism_pair_iff:
 "f \<in> X \<rightarrow>\<^sub>Q Y \<Otimes>\<^sub>Q Z \<longleftrightarrow> fst \<circ> f \<in> X \<rightarrow>\<^sub>Q Y \<and> snd \<circ> f \<in> X \<rightarrow>\<^sub>Q Z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<in> X \<rightarrow>\<^sub>Q Y \<Otimes>\<^sub>Q Z) = (fst \<circ> f \<in> X \<rightarrow>\<^sub>Q Y \<and> snd \<circ> f \<in> X \<rightarrow>\<^sub>Q Z)
[PROOF STEP]
by(auto intro!: qbs_morphismI qbs_morphism_comp[OF _ fst_qbs_morphism,of f X Y Z ]qbs_morphism_comp[OF _ snd_qbs_morphism,of f X Y Z]
            simp: pair_qbs_Mx_def comp_assoc[symmetric])


[STATEMENT]
lemma pmf_bind_pmf_of_set:
  assumes "A \<noteq> {}" "finite A"
  shows   "pmf (bind_pmf (pmf_of_set A) f) x =
             (\<Sum>xa\<in>A. pmf (f xa) x) / real_of_nat (card A)" (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pmf (local.pmf_of_set A \<bind> f) x = (\<Sum>xa\<in>A. pmf (f xa) x) / real (card A)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. pmf (local.pmf_of_set A \<bind> f) x = (\<Sum>xa\<in>A. pmf (f xa) x) / real (card A)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
A \<noteq> {}
finite A
[PROOF STEP]
have "card A > 0"
[PROOF STATE]
proof (prove)
using this:
A \<noteq> {}
finite A

goal (1 subgoal):
 1. 0 < card A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < card A

goal (1 subgoal):
 1. pmf (local.pmf_of_set A \<bind> f) x = (\<Sum>xa\<in>A. pmf (f xa) x) / real (card A)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
A \<noteq> {}
finite A
0 < card A
[PROOF STEP]
have "ennreal ?lhs = ennreal ?rhs"
[PROOF STATE]
proof (prove)
using this:
A \<noteq> {}
finite A
0 < card A

goal (1 subgoal):
 1. ennreal (pmf (local.pmf_of_set A \<bind> f) x) = ennreal ((\<Sum>xa\<in>A. pmf (f xa) x) / real (card A))
[PROOF STEP]
by (subst ennreal_pmf_bind)
       (simp_all add: nn_integral_pmf_of_set max_def pmf_nonneg divide_ennreal [symmetric]
        sum_nonneg ennreal_of_nat_eq_real_of_nat)
[PROOF STATE]
proof (state)
this:
ennreal (pmf (local.pmf_of_set A \<bind> f) x) = ennreal ((\<Sum>xa\<in>A. pmf (f xa) x) / real (card A))

goal (1 subgoal):
 1. pmf (local.pmf_of_set A \<bind> f) x = (\<Sum>xa\<in>A. pmf (f xa) x) / real (card A)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
ennreal (pmf (local.pmf_of_set A \<bind> f) x) = ennreal ((\<Sum>xa\<in>A. pmf (f xa) x) / real (card A))

goal (1 subgoal):
 1. pmf (local.pmf_of_set A \<bind> f) x = (\<Sum>xa\<in>A. pmf (f xa) x) / real (card A)
[PROOF STEP]
by (subst (asm) ennreal_inj) (auto intro!: sum_nonneg divide_nonneg_nonneg)
[PROOF STATE]
proof (state)
this:
pmf (local.pmf_of_set A \<bind> f) x = (\<Sum>xa\<in>A. pmf (f xa) x) / real (card A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma jumpF_poly_bot_code:
  "jumpF_poly_bot q p = (if p\<noteq>0 \<and> q\<noteq>0 \<and> degree q>degree p then
          if sgn_neg_inf q * sgn_neg_inf p > 0 then 1/2 else -1/2 else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_poly_bot q p = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
proof (cases "p\<noteq>0 \<and> q\<noteq>0 \<and> degree q>degree p")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q \<Longrightarrow> jumpF_poly_bot q p = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)
 2. \<not> (p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q) \<Longrightarrow> jumpF_poly_bot q p = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q

goal (2 subgoals):
 1. p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q \<Longrightarrow> jumpF_poly_bot q p = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)
 2. \<not> (p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q) \<Longrightarrow> jumpF_poly_bot q p = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
have ?thesis when "sgn_neg_inf q * sgn_neg_inf p > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_poly_bot q p = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. jumpF_poly_bot q p = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
have "LIM x at_bot. poly q x / poly p x :> at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LIM x at_bot. poly q x / poly p x :> at_top
[PROOF STEP]
using poly_divide_filterlim_at_bot[of p q] True that
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>p \<noteq> 0; q \<noteq> 0\<rbrakk> \<Longrightarrow> LIM x at_bot. poly q x / poly p x :> if degree q < degree p then at 0 else if degree q = degree p then nhds (lead_coeff q / lead_coeff p) else if 0 < sgn_neg_inf q * sgn_neg_inf p then at_top else at_bot
p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q
0 < sgn_neg_inf q * sgn_neg_inf p

goal (1 subgoal):
 1. LIM x at_bot. poly q x / poly p x :> at_top
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
LIM x at_bot. poly q x / poly p x :> at_top

goal (1 subgoal):
 1. jumpF_poly_bot q p = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
LIM x at_bot. poly q x / poly p x :> at_top
[PROOF STEP]
have "jumpF (\<lambda>x. poly q x / poly p x) at_bot = 1/2"
[PROOF STATE]
proof (prove)
using this:
LIM x at_bot. poly q x / poly p x :> at_top

goal (1 subgoal):
 1. jumpF (\<lambda>x. poly q x / poly p x) at_bot = 1 / 2
[PROOF STEP]
unfolding jumpF_def
[PROOF STATE]
proof (prove)
using this:
LIM x at_bot. poly q x / poly p x :> at_top

goal (1 subgoal):
 1. (if LIM x at_bot. poly q x / poly p x :> at_top then 1 / 2 else if LIM x at_bot. poly q x / poly p x :> at_bot then - 1 / 2 else 0) = 1 / 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
jumpF (\<lambda>x. poly q x / poly p x) at_bot = 1 / 2

goal (1 subgoal):
 1. jumpF_poly_bot q p = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
jumpF (\<lambda>x. poly q x / poly p x) at_bot = 1 / 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
jumpF (\<lambda>x. poly q x / poly p x) at_bot = 1 / 2

goal (1 subgoal):
 1. jumpF_poly_bot q p = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
unfolding jumpF_poly_bot_def
[PROOF STATE]
proof (prove)
using this:
jumpF (\<lambda>x. poly q x / poly p x) at_bot = 1 / 2

goal (1 subgoal):
 1. jumpF (\<lambda>x. poly q x / poly p x) at_bot = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
using that True
[PROOF STATE]
proof (prove)
using this:
jumpF (\<lambda>x. poly q x / poly p x) at_bot = 1 / 2
0 < sgn_neg_inf q * sgn_neg_inf p
p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q

goal (1 subgoal):
 1. jumpF (\<lambda>x. poly q x / poly p x) at_bot = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
jumpF_poly_bot q p = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 < sgn_neg_inf q * sgn_neg_inf p \<Longrightarrow> jumpF_poly_bot q p = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)

goal (2 subgoals):
 1. p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q \<Longrightarrow> jumpF_poly_bot q p = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)
 2. \<not> (p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q) \<Longrightarrow> jumpF_poly_bot q p = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 < sgn_neg_inf q * sgn_neg_inf p \<Longrightarrow> jumpF_poly_bot q p = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)

goal (2 subgoals):
 1. p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q \<Longrightarrow> jumpF_poly_bot q p = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)
 2. \<not> (p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q) \<Longrightarrow> jumpF_poly_bot q p = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
have ?thesis when "\<not> sgn_neg_inf q * sgn_neg_inf p > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_poly_bot q p = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. jumpF_poly_bot q p = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
have "LIM x at_bot. poly q x / poly p x :> at_bot"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LIM x at_bot. poly q x / poly p x :> at_bot
[PROOF STEP]
using poly_divide_filterlim_at_bot[of p q] True that
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>p \<noteq> 0; q \<noteq> 0\<rbrakk> \<Longrightarrow> LIM x at_bot. poly q x / poly p x :> if degree q < degree p then at 0 else if degree q = degree p then nhds (lead_coeff q / lead_coeff p) else if 0 < sgn_neg_inf q * sgn_neg_inf p then at_top else at_bot
p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q
\<not> 0 < sgn_neg_inf q * sgn_neg_inf p

goal (1 subgoal):
 1. LIM x at_bot. poly q x / poly p x :> at_bot
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
LIM x at_bot. poly q x / poly p x :> at_bot

goal (1 subgoal):
 1. jumpF_poly_bot q p = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
LIM x at_bot. poly q x / poly p x :> at_bot
[PROOF STEP]
have "jumpF (\<lambda>x. poly q x / poly p x) at_bot = - 1/2"
[PROOF STATE]
proof (prove)
using this:
LIM x at_bot. poly q x / poly p x :> at_bot

goal (1 subgoal):
 1. jumpF (\<lambda>x. poly q x / poly p x) at_bot = - 1 / 2
[PROOF STEP]
unfolding jumpF_def
[PROOF STATE]
proof (prove)
using this:
LIM x at_bot. poly q x / poly p x :> at_bot

goal (1 subgoal):
 1. (if LIM x at_bot. poly q x / poly p x :> at_top then 1 / 2 else if LIM x at_bot. poly q x / poly p x :> at_bot then - 1 / 2 else 0) = - 1 / 2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
jumpF (\<lambda>x. poly q x / poly p x) at_bot = - 1 / 2

goal (1 subgoal):
 1. jumpF_poly_bot q p = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
jumpF (\<lambda>x. poly q x / poly p x) at_bot = - 1 / 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
jumpF (\<lambda>x. poly q x / poly p x) at_bot = - 1 / 2

goal (1 subgoal):
 1. jumpF_poly_bot q p = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
unfolding jumpF_poly_bot_def
[PROOF STATE]
proof (prove)
using this:
jumpF (\<lambda>x. poly q x / poly p x) at_bot = - 1 / 2

goal (1 subgoal):
 1. jumpF (\<lambda>x. poly q x / poly p x) at_bot = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
using that True
[PROOF STATE]
proof (prove)
using this:
jumpF (\<lambda>x. poly q x / poly p x) at_bot = - 1 / 2
\<not> 0 < sgn_neg_inf q * sgn_neg_inf p
p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q

goal (1 subgoal):
 1. jumpF (\<lambda>x. poly q x / poly p x) at_bot = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
jumpF_poly_bot q p = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<not> 0 < sgn_neg_inf q * sgn_neg_inf p \<Longrightarrow> jumpF_poly_bot q p = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)

goal (2 subgoals):
 1. p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q \<Longrightarrow> jumpF_poly_bot q p = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)
 2. \<not> (p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q) \<Longrightarrow> jumpF_poly_bot q p = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
0 < sgn_neg_inf q * sgn_neg_inf p \<Longrightarrow> jumpF_poly_bot q p = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)
\<not> 0 < sgn_neg_inf q * sgn_neg_inf p \<Longrightarrow> jumpF_poly_bot q p = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < sgn_neg_inf q * sgn_neg_inf p \<Longrightarrow> jumpF_poly_bot q p = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)
\<not> 0 < sgn_neg_inf q * sgn_neg_inf p \<Longrightarrow> jumpF_poly_bot q p = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)

goal (1 subgoal):
 1. jumpF_poly_bot q p = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
jumpF_poly_bot q p = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)

goal (1 subgoal):
 1. \<not> (p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q) \<Longrightarrow> jumpF_poly_bot q p = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q) \<Longrightarrow> jumpF_poly_bot q p = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q)

goal (1 subgoal):
 1. \<not> (p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q) \<Longrightarrow> jumpF_poly_bot q p = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
define P where "P= (\<not> (LIM x at_bot. poly q x / poly p x :> at_bot)
                      \<and> \<not> (LIM x at_bot. poly q x / poly p x :> at_top))"
[PROOF STATE]
proof (state)
this:
P = (\<not> (LIM x at_bot. poly q x / poly p x :> at_bot) \<and> \<not> (LIM x at_bot. poly q x / poly p x :> at_top))

goal (1 subgoal):
 1. \<not> (p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q) \<Longrightarrow> jumpF_poly_bot q p = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
have P when "p=0 \<or> q=0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P
[PROOF STEP]
unfolding P_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> (LIM x at_bot. poly q x / poly p x :> at_bot) \<and> \<not> (LIM x at_bot. poly q x / poly p x :> at_top)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
p = 0 \<or> q = 0

goal (1 subgoal):
 1. \<not> (LIM x at_bot. poly q x / poly p x :> at_bot) \<and> \<not> (LIM x at_bot. poly q x / poly p x :> at_top)
[PROOF STEP]
by (auto elim!:filterlim_at_bot_nhds filterlim_at_top_nhds)
[PROOF STATE]
proof (state)
this:
p = 0 \<or> q = 0 \<Longrightarrow> P

goal (1 subgoal):
 1. \<not> (p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q) \<Longrightarrow> jumpF_poly_bot q p = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
p = 0 \<or> q = 0 \<Longrightarrow> P

goal (1 subgoal):
 1. \<not> (p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q) \<Longrightarrow> jumpF_poly_bot q p = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
have P when "p\<noteq>0" "q\<noteq>0" "degree p> degree q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. P
[PROOF STEP]
have "LIM x at_bot. poly q x / poly p x :> at 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LIM x at_bot. poly q x / poly p x :> at 0
[PROOF STEP]
using poly_divide_filterlim_at_bot[OF that(1,2)] that(3)
[PROOF STATE]
proof (prove)
using this:
LIM x at_bot. poly q x / poly p x :> if degree q < degree p then at 0 else if degree q = degree p then nhds (lead_coeff q / lead_coeff p) else if 0 < sgn_neg_inf q * sgn_neg_inf p then at_top else at_bot
degree q < degree p

goal (1 subgoal):
 1. LIM x at_bot. poly q x / poly p x :> at 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
LIM x at_bot. poly q x / poly p x :> at 0

goal (1 subgoal):
 1. P
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
LIM x at_bot. poly q x / poly p x :> at 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
LIM x at_bot. poly q x / poly p x :> at 0

goal (1 subgoal):
 1. P
[PROOF STEP]
unfolding P_def
[PROOF STATE]
proof (prove)
using this:
LIM x at_bot. poly q x / poly p x :> at 0

goal (1 subgoal):
 1. \<not> (LIM x at_bot. poly q x / poly p x :> at_bot) \<and> \<not> (LIM x at_bot. poly q x / poly p x :> at_top)
[PROOF STEP]
by (auto elim!:filterlim_at_bot_nhds filterlim_at_top_nhds simp:filterlim_at)
[PROOF STATE]
proof (state)
this:
P

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>p \<noteq> 0; q \<noteq> 0; degree q < degree p\<rbrakk> \<Longrightarrow> P

goal (1 subgoal):
 1. \<not> (p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q) \<Longrightarrow> jumpF_poly_bot q p = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<lbrakk>p \<noteq> 0; q \<noteq> 0; degree q < degree p\<rbrakk> \<Longrightarrow> P

goal (1 subgoal):
 1. \<not> (p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q) \<Longrightarrow> jumpF_poly_bot q p = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
have P when "p\<noteq>0" "q\<noteq>0" "degree p = degree q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. P
[PROOF STEP]
have "((\<lambda>x. poly q x / poly p x) \<longlongrightarrow> lead_coeff q / lead_coeff p) at_bot"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. poly q x / poly p x) \<longlongrightarrow> lead_coeff q / lead_coeff p) at_bot
[PROOF STEP]
using poly_divide_filterlim_at_bot[OF that(1,2)]
[PROOF STATE]
proof (prove)
using this:
LIM x at_bot. poly q x / poly p x :> if degree q < degree p then at 0 else if degree q = degree p then nhds (lead_coeff q / lead_coeff p) else if 0 < sgn_neg_inf q * sgn_neg_inf p then at_top else at_bot

goal (1 subgoal):
 1. ((\<lambda>x. poly q x / poly p x) \<longlongrightarrow> lead_coeff q / lead_coeff p) at_bot
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
LIM x at_bot. poly q x / poly p x :> if degree q < degree p then at 0 else if degree q = degree p then nhds (lead_coeff q / lead_coeff p) else if 0 < sgn_neg_inf q * sgn_neg_inf p then at_top else at_bot
p \<noteq> 0
q \<noteq> 0
degree p = degree q

goal (1 subgoal):
 1. ((\<lambda>x. poly q x / poly p x) \<longlongrightarrow> lead_coeff q / lead_coeff p) at_bot
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((\<lambda>x. poly q x / poly p x) \<longlongrightarrow> lead_coeff q / lead_coeff p) at_bot

goal (1 subgoal):
 1. P
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. poly q x / poly p x) \<longlongrightarrow> lead_coeff q / lead_coeff p) at_bot
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. poly q x / poly p x) \<longlongrightarrow> lead_coeff q / lead_coeff p) at_bot

goal (1 subgoal):
 1. P
[PROOF STEP]
unfolding P_def
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. poly q x / poly p x) \<longlongrightarrow> lead_coeff q / lead_coeff p) at_bot

goal (1 subgoal):
 1. \<not> (LIM x at_bot. poly q x / poly p x :> at_bot) \<and> \<not> (LIM x at_bot. poly q x / poly p x :> at_top)
[PROOF STEP]
by (auto elim!:filterlim_at_bot_nhds filterlim_at_top_nhds)
[PROOF STATE]
proof (state)
this:
P

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>p \<noteq> 0; q \<noteq> 0; degree p = degree q\<rbrakk> \<Longrightarrow> P

goal (1 subgoal):
 1. \<not> (p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q) \<Longrightarrow> jumpF_poly_bot q p = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
p = 0 \<or> q = 0 \<Longrightarrow> P
\<lbrakk>p \<noteq> 0; q \<noteq> 0; degree q < degree p\<rbrakk> \<Longrightarrow> P
\<lbrakk>p \<noteq> 0; q \<noteq> 0; degree p = degree q\<rbrakk> \<Longrightarrow> P
[PROOF STEP]
have P
[PROOF STATE]
proof (prove)
using this:
p = 0 \<or> q = 0 \<Longrightarrow> P
\<lbrakk>p \<noteq> 0; q \<noteq> 0; degree q < degree p\<rbrakk> \<Longrightarrow> P
\<lbrakk>p \<noteq> 0; q \<noteq> 0; degree p = degree q\<rbrakk> \<Longrightarrow> P

goal (1 subgoal):
 1. P
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
p = 0 \<or> q = 0 \<Longrightarrow> P
\<lbrakk>p \<noteq> 0; q \<noteq> 0; degree q < degree p\<rbrakk> \<Longrightarrow> P
\<lbrakk>p \<noteq> 0; q \<noteq> 0; degree p = degree q\<rbrakk> \<Longrightarrow> P
\<not> (p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q)

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

goal (1 subgoal):
 1. \<not> (p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q) \<Longrightarrow> jumpF_poly_bot q p = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
P
[PROOF STEP]
have "jumpF (\<lambda>x. poly q x / poly p x) at_bot = 0"
[PROOF STATE]
proof (prove)
using this:
P

goal (1 subgoal):
 1. jumpF (\<lambda>x. poly q x / poly p x) at_bot = 0
[PROOF STEP]
unfolding jumpF_def P_def
[PROOF STATE]
proof (prove)
using this:
\<not> (LIM x at_bot. poly q x / poly p x :> at_bot) \<and> \<not> (LIM x at_bot. poly q x / poly p x :> at_top)

goal (1 subgoal):
 1. (if LIM x at_bot. poly q x / poly p x :> at_top then 1 / 2 else if LIM x at_bot. poly q x / poly p x :> at_bot then - 1 / 2 else 0) = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
jumpF (\<lambda>x. poly q x / poly p x) at_bot = 0

goal (1 subgoal):
 1. \<not> (p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q) \<Longrightarrow> jumpF_poly_bot q p = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
jumpF (\<lambda>x. poly q x / poly p x) at_bot = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
jumpF (\<lambda>x. poly q x / poly p x) at_bot = 0

goal (1 subgoal):
 1. jumpF_poly_bot q p = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
unfolding jumpF_poly_bot_def
[PROOF STATE]
proof (prove)
using this:
jumpF (\<lambda>x. poly q x / poly p x) at_bot = 0

goal (1 subgoal):
 1. jumpF (\<lambda>x. poly q x / poly p x) at_bot = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
jumpF (\<lambda>x. poly q x / poly p x) at_bot = 0
\<not> (p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q)

goal (1 subgoal):
 1. jumpF (\<lambda>x. poly q x / poly p x) at_bot = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
jumpF_poly_bot q p = (if p \<noteq> 0 \<and> q \<noteq> 0 \<and> degree p < degree q then if 0 < sgn_neg_inf q * sgn_neg_inf p then 1 / 2 else - 1 / 2 else 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ereal_distrib_left:
  fixes a b c :: ereal
  assumes "a \<noteq> \<infinity> \<or> b \<noteq> -\<infinity>"
    and "a \<noteq> -\<infinity> \<or> b \<noteq> \<infinity>"
    and "\<bar>c\<bar> \<noteq> \<infinity>"
  shows "c * (a + b) = c * a + c * b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c * (a + b) = c * a + c * b
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<noteq> \<infinity> \<or> b \<noteq> - \<infinity>
a \<noteq> - \<infinity> \<or> b \<noteq> \<infinity>
\<bar>c\<bar> \<noteq> \<infinity>

goal (1 subgoal):
 1. c * (a + b) = c * a + c * b
[PROOF STEP]
by (cases rule: ereal3_cases[of a b c]) (simp_all add: field_simps)


[STATEMENT]
lemma after_summary_union: "after_summary (M + N) S = after_summary M S + after_summary N S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. after_summary (M + N) S = after_summary M S + after_summary N S
[PROOF STEP]
by (simp add: sum.distrib after_summary_def)


[STATEMENT]
lemma subcocycle_AE:
  fixes u::"nat \<Rightarrow> 'a \<Rightarrow> real"
  assumes "\<And>m n. AE x in M. u (n+m) x \<le> u n x + u m ((T^^n) x)"
          "\<And>n. integrable M (u n)"
  shows "\<exists>w. subcocycle w \<and> (AE x in M. \<forall>n. w n x = u n x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>w. subcocycle w \<and> (AE x in M. \<forall>n. w n x = u n x)
[PROOF STEP]
using subcocycle_AE_in_context assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>m n. AE x in M. ?u (n + m) x \<le> ?u n x + ?u m ((T ^^ n) x); \<And>n. integrable M (?u n)\<rbrakk> \<Longrightarrow> \<exists>w. subcocycle w \<and> (AE x in M. \<forall>n. w n x = ?u n x)
AE x in M. u (?n3 + ?m3) x \<le> u ?n3 x + u ?m3 ((T ^^ ?n3) x)
integrable M (u ?n3)

goal (1 subgoal):
 1. \<exists>w. subcocycle w \<and> (AE x in M. \<forall>n. w n x = u n x)
[PROOF STEP]
by blast


[STATEMENT]
lemma arc_linorder_matrix_unique:
  fixes f :: "('a::finite,'b::non_trivial_linorder_stone_relation_algebra_expansion) square"
  shows "matrix_stone_relation_algebra.arc f \<longleftrightarrow> (\<exists>!e . f e = top \<and> (\<forall>d . e \<noteq> d \<longrightarrow> f d = bot))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_stone_relation_algebra.arc f = (\<exists>!e. f e = top \<and> (\<forall>d. e \<noteq> d \<longrightarrow> f d = bot))
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. matrix_stone_relation_algebra.arc f \<Longrightarrow> \<exists>!e. f e = top \<and> (\<forall>d. e \<noteq> d \<longrightarrow> f d = bot)
 2. \<exists>!e. f e = top \<and> (\<forall>d. e \<noteq> d \<longrightarrow> f d = bot) \<Longrightarrow> matrix_stone_relation_algebra.arc f
[PROOF STEP]
apply (metis (no_types, opaque_lifting) arc_linorder_matrix bot_not_top)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>!e. f e = top \<and> (\<forall>d. e \<noteq> d \<longrightarrow> f d = bot) \<Longrightarrow> matrix_stone_relation_algebra.arc f
[PROOF STEP]
using arc_linorder_matrix
[PROOF STATE]
proof (prove)
using this:
matrix_stone_relation_algebra.arc ?f = (\<exists>e. ?f e = top \<and> (\<forall>d. e \<noteq> d \<longrightarrow> ?f d = bot))

goal (1 subgoal):
 1. \<exists>!e. f e = top \<and> (\<forall>d. e \<noteq> d \<longrightarrow> f d = bot) \<Longrightarrow> matrix_stone_relation_algebra.arc f
[PROOF STEP]
by blast


[STATEMENT]
lemma finite_stable_completion:
     "[| finite I;
         !!i. i \<in> I ==> F \<in> (A i) leadsTo (A' i);
         !!i. i \<in> I ==> F \<in> stable (A' i) |]
      ==> F \<in> (\<Inter>i \<in> I. A i) leadsTo (\<Inter>i \<in> I. A' i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; \<And>i. i \<in> I \<Longrightarrow> F \<in> A i \<longmapsto> A' i; \<And>i. i \<in> I \<Longrightarrow> F \<in> UNITY.stable (A' i)\<rbrakk> \<Longrightarrow> F \<in> \<Inter> (A ` I) \<longmapsto> \<Inter> (A' ` I)
[PROOF STEP]
apply (unfold stable_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; \<And>i. i \<in> I \<Longrightarrow> F \<in> A i \<longmapsto> A' i; \<And>i. i \<in> I \<Longrightarrow> F \<in> A' i co A' i\<rbrakk> \<Longrightarrow> F \<in> \<Inter> (A ` I) \<longmapsto> \<Inter> (A' ` I)
[PROOF STEP]
apply (rule_tac C1 = "{}" in finite_completion [THEN leadsTo_weaken_R])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<lbrakk>finite I; \<And>i. i \<in> I \<Longrightarrow> F \<in> A i \<longmapsto> A' i; \<And>i. i \<in> I \<Longrightarrow> F \<in> A' i co A' i\<rbrakk> \<Longrightarrow> finite I
 2. \<And>i. \<lbrakk>finite I; \<And>i. i \<in> I \<Longrightarrow> F \<in> A i \<longmapsto> A' i; \<And>i. i \<in> I \<Longrightarrow> F \<in> A' i co A' i; i \<in> I\<rbrakk> \<Longrightarrow> F \<in> A i \<longmapsto> ?A'1 i \<union> {}
 3. \<And>i. \<lbrakk>finite I; \<And>i. i \<in> I \<Longrightarrow> F \<in> A i \<longmapsto> A' i; \<And>i. i \<in> I \<Longrightarrow> F \<in> A' i co A' i; i \<in> I\<rbrakk> \<Longrightarrow> F \<in> ?A'1 i co ?A'1 i \<union> {}
 4. \<lbrakk>finite I; \<And>i. i \<in> I \<Longrightarrow> F \<in> A i \<longmapsto> A' i; \<And>i. i \<in> I \<Longrightarrow> F \<in> A' i co A' i\<rbrakk> \<Longrightarrow> \<Inter> (?A'1 ` I) \<union> {} \<subseteq> \<Inter> (A' ` I)
[PROOF STEP]
apply (simp_all (no_asm_simp))
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>i. \<lbrakk>finite I; \<And>i. i \<in> I \<Longrightarrow> F \<in> A i \<longmapsto> A' i; \<And>i. i \<in> I \<Longrightarrow> F \<in> A' i co A' i; i \<in> I\<rbrakk> \<Longrightarrow> F \<in> A i \<longmapsto> ?A'1 i
 2. \<And>i. \<lbrakk>finite I; \<And>i. i \<in> I \<Longrightarrow> F \<in> A i \<longmapsto> A' i; \<And>i. i \<in> I \<Longrightarrow> F \<in> A' i co A' i; i \<in> I\<rbrakk> \<Longrightarrow> F \<in> ?A'1 i co ?A'1 i
 3. \<lbrakk>finite I; \<And>i. i \<in> I \<Longrightarrow> F \<in> A i \<longmapsto> A' i; \<And>i. i \<in> I \<Longrightarrow> F \<in> A' i co A' i\<rbrakk> \<Longrightarrow> \<Inter> (?A'1 ` I) \<subseteq> \<Inter> (A' ` I)
[PROOF STEP]
apply blast+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma int_simps:
  "\<turnstile> (x=x) = #True"
  "\<turnstile> (\<not> #True) = #False"
  "\<turnstile> (\<not> #False) = #True"
  "\<turnstile> (\<not>\<not> P) = P"
  "\<turnstile> ((\<not> P) = P) = #False"
  "\<turnstile> (P = (\<not>P)) = #False"
  "\<turnstile> (P \<noteq> Q) = (P = (\<not> Q))"
  "\<turnstile> (#True=P) = P"
  "\<turnstile> (P=#True) = P"
  "\<turnstile> (#True \<longrightarrow> P) = P"
  "\<turnstile> (#False \<longrightarrow> P) = #True"
  "\<turnstile> (P \<longrightarrow> #True) = #True"
  "\<turnstile> (P \<longrightarrow> P) = #True"
  "\<turnstile> (P \<longrightarrow> #False) = (\<not>P)"
  "\<turnstile> (P \<longrightarrow> ~P) = (\<not>P)"
  "\<turnstile> (P \<and> #True) = P"
  "\<turnstile> (#True \<and> P) = P"
  "\<turnstile> (P \<and> #False) = #False"
  "\<turnstile> (#False \<and> P) = #False"
  "\<turnstile> (P \<and> P) = P"
  "\<turnstile> (P \<and> ~P) = #False"
  "\<turnstile> (\<not>P \<and> P) = #False"
  "\<turnstile> (P \<or> #True) = #True"
  "\<turnstile> (#True \<or> P) = #True"
  "\<turnstile> (P \<or> #False) = P"
  "\<turnstile> (#False \<or> P) = P"
  "\<turnstile> (P \<or> P) = P"
  "\<turnstile> (P \<or> \<not>P) = #True"
  "\<turnstile> (\<not>P \<or> P) = #True"
  "\<turnstile> (\<forall> x. P) = P"
  "\<turnstile> (\<exists> x. P) = P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (((\<turnstile> x = x = #True &&& \<turnstile> \<not> #True = #False &&& \<turnstile> \<not> #False = #True) &&& (\<turnstile> \<not> \<not> P = P &&& \<turnstile> \<not> P = P = #False) &&& \<turnstile> P = \<not> P = #False &&& \<turnstile> P \<noteq> Q = (P = \<not> Q)) &&& ((\<turnstile> #True = P = P &&& \<turnstile> P = #True = P) &&& \<turnstile> (#True \<longrightarrow> P) = P &&& \<turnstile> (#False \<longrightarrow> P) = #True) &&& (\<turnstile> (P \<longrightarrow> #True) = #True &&& \<turnstile> (P \<longrightarrow> P) = #True) &&& \<turnstile> (P \<longrightarrow> #False) = \<not> P &&& \<turnstile> (P \<longrightarrow> \<not> P) = \<not> P) &&& (((\<turnstile> (P \<and> #True) = P &&& \<turnstile> (#True \<and> P) = P) &&& \<turnstile> (P \<and> #False) = #False &&& \<turnstile> (#False \<and> P) = #False) &&& (\<turnstile> (P \<and> P) = P &&& \<turnstile> (P \<and> \<not> P) = #False) &&& \<turnstile> (\<not> P \<and> P) = #False &&& \<turnstile> (P \<or> #True) = #True) &&& ((\<turnstile> (#True \<or> P) = #True &&& \<turnstile> (P \<or> #False) = P) &&& \<turnstile> (#False \<or> P) = P &&& \<turnstile> (P \<or> P) = P) &&& (\<turnstile> (P \<or> \<not> P) = #True &&& \<turnstile> (\<not> P \<or> P) = #True) &&& \<turnstile> (\<forall>x. P) = P &&& \<turnstile> (\<exists>x. P) = P
[PROOF STEP]
by auto


[STATEMENT]
lemma prime_decomposition: "unit_factor x * prod_mset (prime_factorization x) = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unit_factor x * \<Prod>\<^sub># (prime_factorization x) = x
[PROOF STEP]
by (cases "x = 0") (simp_all add: prod_mset_prime_factorization)


[STATEMENT]
lemma graph_minus_set_aimpl:
  fixes E1 E2 :: "'a rel"
  shows "E1-E2 = E_of_succ (\<lambda>u. {v\<in>E1``{u}. (u,v)\<notin>E2})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. E1 - E2 = E_of_succ (\<lambda>u. {v \<in> E1 `` {u}. (u, v) \<notin> E2})
[PROOF STEP]
by (auto simp: E_of_succ_def)


[STATEMENT]
lemma spectral_radius_mem_max: assumes A: "A \<in> carrier_mat n n"
  and n: "n > 0"
  shows "spectral_radius A \<in> norm ` spectrum A" (is ?one)
  "a \<in> norm ` spectrum A \<Longrightarrow> a \<le> spectral_radius A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. spectral_radius A \<in> cmod ` spectrum A &&& (a \<in> cmod ` spectrum A \<Longrightarrow> a \<le> spectral_radius A)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. spectral_radius A \<in> cmod ` spectrum A
 2. a \<in> cmod ` spectrum A \<Longrightarrow> a \<le> spectral_radius A
[PROOF STEP]
define SA where "SA = norm ` spectrum A"
[PROOF STATE]
proof (state)
this:
SA = cmod ` spectrum A

goal (2 subgoals):
 1. spectral_radius A \<in> cmod ` spectrum A
 2. a \<in> cmod ` spectrum A \<Longrightarrow> a \<le> spectral_radius A
[PROOF STEP]
from card_finite_spectrum[OF A]
[PROOF STATE]
proof (chain)
picking this:
finite (spectrum A)
card (spectrum A) \<le> n
[PROOF STEP]
have fin: "finite SA"
[PROOF STATE]
proof (prove)
using this:
finite (spectrum A)
card (spectrum A) \<le> n

goal (1 subgoal):
 1. finite SA
[PROOF STEP]
unfolding SA_def
[PROOF STATE]
proof (prove)
using this:
finite (spectrum A)
card (spectrum A) \<le> n

goal (1 subgoal):
 1. finite (cmod ` spectrum A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite SA

goal (2 subgoals):
 1. spectral_radius A \<in> cmod ` spectrum A
 2. a \<in> cmod ` spectrum A \<Longrightarrow> a \<le> spectral_radius A
[PROOF STEP]
from spectrum_non_empty[OF A n]
[PROOF STATE]
proof (chain)
picking this:
spectrum A \<noteq> {}
[PROOF STEP]
have ne: "SA \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
spectrum A \<noteq> {}

goal (1 subgoal):
 1. SA \<noteq> {}
[PROOF STEP]
unfolding SA_def
[PROOF STATE]
proof (prove)
using this:
spectrum A \<noteq> {}

goal (1 subgoal):
 1. cmod ` spectrum A \<noteq> {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
SA \<noteq> {}

goal (2 subgoals):
 1. spectral_radius A \<in> cmod ` spectrum A
 2. a \<in> cmod ` spectrum A \<Longrightarrow> a \<le> spectral_radius A
[PROOF STEP]
note d = spectral_radius_def SA_def[symmetric] Sup_fin_Max[symmetric]
[PROOF STATE]
proof (state)
this:
spectral_radius ?A = Max (cmod ` spectrum ?A)
cmod ` spectrum A = SA
Max = Sup_fin

goal (2 subgoals):
 1. spectral_radius A \<in> cmod ` spectrum A
 2. a \<in> cmod ` spectrum A \<Longrightarrow> a \<le> spectral_radius A
[PROOF STEP]
show ?one
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. spectral_radius A \<in> cmod ` spectrum A
[PROOF STEP]
unfolding d
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Squnion>\<^sub>f\<^sub>i\<^sub>n SA \<in> SA
[PROOF STEP]
by (rule Sup_fin.closed[OF fin ne], auto simp: sup_real_def)
[PROOF STATE]
proof (state)
this:
spectral_radius A \<in> cmod ` spectrum A

goal (1 subgoal):
 1. a \<in> cmod ` spectrum A \<Longrightarrow> a \<le> spectral_radius A
[PROOF STEP]
assume "a \<in> norm ` spectrum A"
[PROOF STATE]
proof (state)
this:
a \<in> cmod ` spectrum A

goal (1 subgoal):
 1. a \<in> cmod ` spectrum A \<Longrightarrow> a \<le> spectral_radius A
[PROOF STEP]
thus "a \<le> spectral_radius A"
[PROOF STATE]
proof (prove)
using this:
a \<in> cmod ` spectrum A

goal (1 subgoal):
 1. a \<le> spectral_radius A
[PROOF STEP]
unfolding d
[PROOF STATE]
proof (prove)
using this:
a \<in> SA

goal (1 subgoal):
 1. a \<le> \<Squnion>\<^sub>f\<^sub>i\<^sub>n SA
[PROOF STEP]
by (intro Sup_fin.coboundedI[OF fin])
[PROOF STATE]
proof (state)
this:
a \<le> spectral_radius A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma is_subseq_ofE:
  assumes "s \<in> closed_seqs Zp"
  assumes "is_subseq_of s s'"
  shows "\<exists>k. k \<ge> n \<and> s' n = s k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>k\<ge>n. s' n = s k
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>k\<ge>n. s' n = s k
[PROOF STEP]
obtain f where "is_increasing f \<and> s' = take_subseq s f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>f. is_increasing f \<and> s' = take_subseq s f \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms(2) is_subseq_of_def
[PROOF STATE]
proof (prove)
using this:
is_subseq_of s s'
is_subseq_of ?s ?s' = (\<exists>f. is_increasing f \<and> ?s' = take_subseq ?s f)

goal (1 subgoal):
 1. (\<And>f. is_increasing f \<and> s' = take_subseq s f \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
is_increasing f \<and> s' = take_subseq s f

goal (1 subgoal):
 1. \<exists>k\<ge>n. s' n = s k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_increasing f \<and> s' = take_subseq s f
[PROOF STEP]
have  " f n \<ge> n \<and> s' n = s (f n)"
[PROOF STATE]
proof (prove)
using this:
is_increasing f \<and> s' = take_subseq s f

goal (1 subgoal):
 1. n \<le> f n \<and> s' n = s (f n)
[PROOF STEP]
unfolding take_subseq_def
[PROOF STATE]
proof (prove)
using this:
is_increasing f \<and> s' = (\<lambda>k. s (f k))

goal (1 subgoal):
 1. n \<le> f n \<and> s' n = s (f n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
n \<le> f n \<and> s' n = s (f n)

goal (1 subgoal):
 1. \<exists>k\<ge>n. s' n = s k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n \<le> f n \<and> s' n = s (f n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n \<le> f n \<and> s' n = s (f n)

goal (1 subgoal):
 1. \<exists>k\<ge>n. s' n = s k
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>k\<ge>n. s' n = s k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma transfer_set_eq [transfer_intro]:
  "a \<equiv> Iset (star_n A) \<Longrightarrow> b \<equiv> Iset (star_n B) \<Longrightarrow> a = b \<equiv> eventually (\<lambda>n. A n = B n) \<U>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<equiv> Iset (star_n A); b \<equiv> Iset (star_n B)\<rbrakk> \<Longrightarrow> a = b \<equiv> \<forall>\<^sub>F n in \<U>. A n = B n
[PROOF STEP]
by (simp only: set_eq_iff transfer_all transfer_iff transfer_mem)


[STATEMENT]
lemma vrat_inverses_law_addition:
  assumes [simp]: "x \<in>\<^sub>\<circ> \<rat>\<^sub>\<circ>"
  shows "x +\<^sub>\<rat> (-\<^sub>\<rat> x) = 0\<^sub>\<rat>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x +\<^sub>\<rat> -\<^sub>\<rat> x = 0\<^sub>\<rat>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x +\<^sub>\<rat> -\<^sub>\<rat> x = 0\<^sub>\<rat>
[PROOF STEP]
have "x' + (-x') = 0" for x' :: rat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x' + - x' = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
?x' + - ?x' = 0

goal (1 subgoal):
 1. x +\<^sub>\<rat> -\<^sub>\<rat> x = 0\<^sub>\<rat>
[PROOF STEP]
from this[untransferred, OF assms]
[PROOF STATE]
proof (chain)
picking this:
x +\<^sub>\<rat> -\<^sub>\<rat> x = 0\<^sub>\<rat>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x +\<^sub>\<rat> -\<^sub>\<rat> x = 0\<^sub>\<rat>

goal (1 subgoal):
 1. x +\<^sub>\<rat> -\<^sub>\<rat> x = 0\<^sub>\<rat>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
x +\<^sub>\<rat> -\<^sub>\<rat> x = 0\<^sub>\<rat>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem regular_Compl:
  assumes S: "regular S" shows "regular (-S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. regular (- S)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. regular (- S)
[PROOF STEP]
obtain MS  where M: "dfa MS" and lang: "dfa.language MS = S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>MS. \<lbrakk>dfa MS; dfa.language MS = S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using S
[PROOF STATE]
proof (prove)
using this:
regular S

goal (1 subgoal):
 1. (\<And>MS. \<lbrakk>dfa MS; dfa.language MS = S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: regular_def)
[PROOF STATE]
proof (state)
this:
dfa MS
dfa.language MS = S

goal (1 subgoal):
 1. regular (- S)
[PROOF STEP]
interpret ST: dfa "\<lparr>dfa.states= dfa.states MS,
                     init= dfa.init MS, final= dfa.states MS - dfa.final MS,
                     nxt= \<lambda>q x. dfa.nxt MS q x\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dfa \<lparr>dfa.states = dfa.states MS, init = dfa.init MS, final = dfa.states MS - dfa.final MS, nxt = dfa.nxt MS\<rparr>
[PROOF STEP]
using M
[PROOF STATE]
proof (prove)
using this:
dfa MS

goal (1 subgoal):
 1. dfa \<lparr>dfa.states = dfa.states MS, init = dfa.init MS, final = dfa.states MS - dfa.final MS, nxt = dfa.nxt MS\<rparr>
[PROOF STEP]
by (force simp add: dfa_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. regular (- S)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. regular (- S)
[PROOF STEP]
fix u
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. regular (- S)
[PROOF STEP]
have "ST.nextl (dfa.init MS) u = dfa.nextl MS (dfa.init MS) u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ST.nextl (dfa.init MS) u = dfa.nextl MS (dfa.init MS) u
[PROOF STEP]
by (induct u rule: List.rev_induct) (auto simp: dfa.nextl_snoc dfa.nextl.simps M)
[PROOF STATE]
proof (state)
this:
ST.nextl (dfa.init MS) u = dfa.nextl MS (dfa.init MS) u

goal (1 subgoal):
 1. regular (- S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ST.nextl (dfa.init MS) u = dfa.nextl MS (dfa.init MS) u
[PROOF STEP]
have "u \<in> ST.language \<longleftrightarrow> u \<notin> dfa.language MS"
[PROOF STATE]
proof (prove)
using this:
ST.nextl (dfa.init MS) u = dfa.nextl MS (dfa.init MS) u

goal (1 subgoal):
 1. (u \<in> ST.language) = (u \<notin> dfa.language MS)
[PROOF STEP]
by (auto simp: M dfa.nextl_init_state ST.language_def dfa.language_def)
[PROOF STATE]
proof (state)
this:
(u \<in> ST.language) = (u \<notin> dfa.language MS)

goal (1 subgoal):
 1. regular (- S)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
(?u2 \<in> ST.language) = (?u2 \<notin> dfa.language MS)

goal (1 subgoal):
 1. regular (- S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(?u2 \<in> ST.language) = (?u2 \<notin> dfa.language MS)
[PROOF STEP]
have eq_L: "ST.language = -S"
[PROOF STATE]
proof (prove)
using this:
(?u2 \<in> ST.language) = (?u2 \<notin> dfa.language MS)

goal (1 subgoal):
 1. ST.language = - S
[PROOF STEP]
using lang
[PROOF STATE]
proof (prove)
using this:
(?u2 \<in> ST.language) = (?u2 \<notin> dfa.language MS)
dfa.language MS = S

goal (1 subgoal):
 1. ST.language = - S
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
ST.language = - S

goal (1 subgoal):
 1. regular (- S)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. regular (- S)
[PROOF STEP]
unfolding regular_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>M. dfa M \<and> dfa.language M = - S
[PROOF STEP]
by (intro exI conjI, unfold_locales) (rule eq_L)
[PROOF STATE]
proof (state)
this:
regular (- S)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prio_add_abc2:
  assumes "(a::('e,'a::linorder)Prio) \<le> a + b"
  shows "a \<le> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<le> b
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> a \<le> b \<Longrightarrow> False
[PROOF STEP]
assume ann: "\<not> a \<le> b"
[PROOF STATE]
proof (state)
this:
\<not> a \<le> b

goal (1 subgoal):
 1. \<not> a \<le> b \<Longrightarrow> False
[PROOF STEP]
hence "a + b = b"
[PROOF STATE]
proof (prove)
using this:
\<not> a \<le> b

goal (1 subgoal):
 1. a + b = b
[PROOF STEP]
apply (auto simp add: plus_def plesseq_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> p_less_eq a b \<Longrightarrow> p_min a b = b
[PROOF STEP]
apply (cases "(a,b)" rule: p_min.cases)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<lbrakk>\<not> p_less_eq a b; (a, b) = (Infty, Infty)\<rbrakk> \<Longrightarrow> p_min a b = b
 2. \<And>e aa. \<lbrakk>\<not> p_less_eq a b; (a, b) = (Infty, Prio e aa)\<rbrakk> \<Longrightarrow> p_min a b = b
 3. \<And>e aa. \<lbrakk>\<not> p_less_eq a b; (a, b) = (Prio e aa, Infty)\<rbrakk> \<Longrightarrow> p_min a b = b
 4. \<And>e1 aa e2 ba. \<lbrakk>\<not> p_less_eq a b; (a, b) = (Prio e1 aa, Prio e2 ba)\<rbrakk> \<Longrightarrow> p_min a b = b
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
a + b = b

goal (1 subgoal):
 1. \<not> a \<le> b \<Longrightarrow> False
[PROOF STEP]
thus False
[PROOF STATE]
proof (prove)
using this:
a + b = b

goal (1 subgoal):
 1. False
[PROOF STEP]
using assms ann
[PROOF STATE]
proof (prove)
using this:
a + b = b
a \<le> a + b
\<not> a \<le> b

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma star_unfoldl_eq [simp]: "1 + x \<cdot> x\<^sup>\<star> = x\<^sup>\<star>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1::'a) + x \<cdot> x\<^sup>\<star> = x\<^sup>\<star>
[PROOF STEP]
proof (rule order.antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (1::'a) + x \<cdot> x\<^sup>\<star> \<le> x\<^sup>\<star>
 2. x\<^sup>\<star> \<le> (1::'a) + x \<cdot> x\<^sup>\<star>
[PROOF STEP]
show "1 + x \<cdot> x\<^sup>\<star> \<le> x\<^sup>\<star>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1::'a) + x \<cdot> x\<^sup>\<star> \<le> x\<^sup>\<star>
[PROOF STEP]
by (fact star_unfoldl)
[PROOF STATE]
proof (state)
this:
(1::'a) + x \<cdot> x\<^sup>\<star> \<le> x\<^sup>\<star>

goal (1 subgoal):
 1. x\<^sup>\<star> \<le> (1::'a) + x \<cdot> x\<^sup>\<star>
[PROOF STEP]
have "1 + x \<cdot> (1 + x \<cdot> x\<^sup>\<star>) \<le> 1 + x \<cdot> x\<^sup>\<star>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1::'a) + x \<cdot> ((1::'a) + x \<cdot> x\<^sup>\<star>) \<le> (1::'a) + x \<cdot> x\<^sup>\<star>
[PROOF STEP]
by (meson join.sup_mono eq_refl mult_isol star_unfoldl)
[PROOF STATE]
proof (state)
this:
(1::'a) + x \<cdot> ((1::'a) + x \<cdot> x\<^sup>\<star>) \<le> (1::'a) + x \<cdot> x\<^sup>\<star>

goal (1 subgoal):
 1. x\<^sup>\<star> \<le> (1::'a) + x \<cdot> x\<^sup>\<star>
[PROOF STEP]
thus "x\<^sup>\<star> \<le> 1 + x \<cdot> x\<^sup>\<star>"
[PROOF STATE]
proof (prove)
using this:
(1::'a) + x \<cdot> ((1::'a) + x \<cdot> x\<^sup>\<star>) \<le> (1::'a) + x \<cdot> x\<^sup>\<star>

goal (1 subgoal):
 1. x\<^sup>\<star> \<le> (1::'a) + x \<cdot> x\<^sup>\<star>
[PROOF STEP]
by (simp add: star_inductl_one)
[PROOF STATE]
proof (state)
this:
x\<^sup>\<star> \<le> (1::'a) + x \<cdot> x\<^sup>\<star>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma continuous_on_product_then_coordinatewise:
  assumes "continuous_on S f"
  shows "continuous_on S (\<lambda>x. f x i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on S (\<lambda>x. f x i)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. continuous_on S (\<lambda>x. f x i)
[PROOF STEP]
have "continuous_on S ((\<lambda>q. q i) \<circ> f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on S ((\<lambda>q. q i) \<circ> f)
[PROOF STEP]
by (metis assms continuous_on_compose continuous_on_id
        continuous_on_product_then_coordinatewise_UNIV continuous_on_subset subset_UNIV)
[PROOF STATE]
proof (state)
this:
continuous_on S ((\<lambda>q. q i) \<circ> f)

goal (1 subgoal):
 1. continuous_on S (\<lambda>x. f x i)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
continuous_on S ((\<lambda>q. q i) \<circ> f)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
continuous_on S ((\<lambda>q. q i) \<circ> f)

goal (1 subgoal):
 1. continuous_on S (\<lambda>x. f x i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
continuous_on S (\<lambda>x. f x i)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma multi_take_drop:
  assumes "multi_plus l \<omega>"
      and "length l \<ge> 2"
    shows "\<exists>n a b. n > 0 \<and> n < length l \<and> multi_plus (take n l) a \<and> multi_plus (drop n l) b \<and> Some \<omega> = a \<oplus> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n a b. 0 < n \<and> n < length l \<and> multi_plus (take n l) a \<and> multi_plus (drop n l) b \<and> Some \<omega> = a \<oplus> b
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>n a b. 0 < n \<and> n < length l \<and> multi_plus (take n l) a \<and> multi_plus (drop n l) b \<and> Some \<omega> = a \<oplus> b
[PROOF STEP]
obtain a b la lb where asm0: "l = la @ lb \<and> length la > 0 \<and> length lb > 0 \<and> multi_plus la a \<and> multi_plus lb b \<and> Some \<omega> = a \<oplus> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>la lb a b. l = la @ lb \<and> 0 < length la \<and> 0 < length lb \<and> multi_plus la a \<and> multi_plus lb b \<and> Some \<omega> = a \<oplus> b \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms(1) assms(2) multi_decompose
[PROOF STATE]
proof (prove)
using this:
multi_plus l \<omega>
2 \<le> length l
\<lbrakk>multi_plus ?l ?\<omega>; 2 \<le> length ?l\<rbrakk> \<Longrightarrow> \<exists>a b la lb. ?l = la @ lb \<and> 0 < length la \<and> 0 < length lb \<and> multi_plus la a \<and> multi_plus lb b \<and> Some ?\<omega> = a \<oplus> b

goal (1 subgoal):
 1. (\<And>la lb a b. l = la @ lb \<and> 0 < length la \<and> 0 < length lb \<and> multi_plus la a \<and> multi_plus lb b \<and> Some \<omega> = a \<oplus> b \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
l = la @ lb \<and> 0 < length la \<and> 0 < length lb \<and> multi_plus la a \<and> multi_plus lb b \<and> Some \<omega> = a \<oplus> b

goal (1 subgoal):
 1. \<exists>n a b. 0 < n \<and> n < length l \<and> multi_plus (take n l) a \<and> multi_plus (drop n l) b \<and> Some \<omega> = a \<oplus> b
[PROOF STEP]
let ?n = "length la"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>n a b. 0 < n \<and> n < length l \<and> multi_plus (take n l) a \<and> multi_plus (drop n l) b \<and> Some \<omega> = a \<oplus> b
[PROOF STEP]
have "la = take ?n l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. la = take (length la) l
[PROOF STEP]
by (simp add: asm0)
[PROOF STATE]
proof (state)
this:
la = take (length la) l

goal (1 subgoal):
 1. \<exists>n a b. 0 < n \<and> n < length l \<and> multi_plus (take n l) a \<and> multi_plus (drop n l) b \<and> Some \<omega> = a \<oplus> b
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
la = take (length la) l

goal (1 subgoal):
 1. \<exists>n a b. 0 < n \<and> n < length l \<and> multi_plus (take n l) a \<and> multi_plus (drop n l) b \<and> Some \<omega> = a \<oplus> b
[PROOF STEP]
have "lb = drop ?n l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lb = drop (length la) l
[PROOF STEP]
by (simp add: asm0)
[PROOF STATE]
proof (state)
this:
lb = drop (length la) l

goal (1 subgoal):
 1. \<exists>n a b. 0 < n \<and> n < length l \<and> multi_plus (take n l) a \<and> multi_plus (drop n l) b \<and> Some \<omega> = a \<oplus> b
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
la = take (length la) l
lb = drop (length la) l
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
la = take (length la) l
lb = drop (length la) l

goal (1 subgoal):
 1. \<exists>n a b. 0 < n \<and> n < length l \<and> multi_plus (take n l) a \<and> multi_plus (drop n l) b \<and> Some \<omega> = a \<oplus> b
[PROOF STEP]
by (metis asm0 length_drop zero_less_diff)
[PROOF STATE]
proof (state)
this:
\<exists>n a b. 0 < n \<and> n < length l \<and> multi_plus (take n l) a \<and> multi_plus (drop n l) b \<and> Some \<omega> = a \<oplus> b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma upper:
  "turn_into_distance f x y \<le> f x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. turn_into_distance f x y \<le> f x y
[PROOF STEP]
unfolding turn_into_distance_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Inf {\<Sum>i = 0..<n. f (u i) (u (Suc i)) |u n. u 0 = x \<and> u n = y} \<le> f x y
[PROOF STEP]
proof (rule cInf_lower, auto)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>u n. f x y = (\<Sum>i = 0..<n. f (u i) (u (Suc i))) \<and> u 0 = x \<and> u n = y
[PROOF STEP]
define u::"nat \<Rightarrow> 'a" where "u = (\<lambda>n. if n = 0 then x else y)"
[PROOF STATE]
proof (state)
this:
u = (\<lambda>n. if n = 0 then x else y)

goal (1 subgoal):
 1. \<exists>u n. f x y = (\<Sum>i = 0..<n. f (u i) (u (Suc i))) \<and> u 0 = x \<and> u n = y
[PROOF STEP]
define n::nat where "n = 1"
[PROOF STATE]
proof (state)
this:
n = 1

goal (1 subgoal):
 1. \<exists>u n. f x y = (\<Sum>i = 0..<n. f (u i) (u (Suc i))) \<and> u 0 = x \<and> u n = y
[PROOF STEP]
have "u 0 = x \<and> u n = y \<and> f x y = (\<Sum>i = 0..<n. f (u i) (u (Suc i)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u 0 = x \<and> u n = y \<and> f x y = (\<Sum>i = 0..<n. f (u i) (u (Suc i)))
[PROOF STEP]
unfolding u_def n_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if 0 = 0 then x else y) = x \<and> (if 1 = 0 then x else y) = y \<and> f x y = (\<Sum>i = 0..<1. f (if i = 0 then x else y) (if Suc i = 0 then x else y))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u 0 = x \<and> u n = y \<and> f x y = (\<Sum>i = 0..<n. f (u i) (u (Suc i)))

goal (1 subgoal):
 1. \<exists>u n. f x y = (\<Sum>i = 0..<n. f (u i) (u (Suc i))) \<and> u 0 = x \<and> u n = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u 0 = x \<and> u n = y \<and> f x y = (\<Sum>i = 0..<n. f (u i) (u (Suc i)))
[PROOF STEP]
show "\<exists>u n. f x y = (\<Sum>i = 0..<n. f (u i) (u (Suc i))) \<and> u 0 = x \<and> u n = y"
[PROOF STATE]
proof (prove)
using this:
u 0 = x \<and> u n = y \<and> f x y = (\<Sum>i = 0..<n. f (u i) (u (Suc i)))

goal (1 subgoal):
 1. \<exists>u n. f x y = (\<Sum>i = 0..<n. f (u i) (u (Suc i))) \<and> u 0 = x \<and> u n = y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>u n. f x y = (\<Sum>i = 0..<n. f (u i) (u (Suc i))) \<and> u 0 = x \<and> u n = y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lub_is_union: "lub S = \<Union>S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lub S = \<Union> S
[PROOF STEP]
using is_lub_set
[PROOF STATE]
proof (prove)
using this:
?S <<| \<Union> ?S

goal (1 subgoal):
 1. lub S = \<Union> S
[PROOF STEP]
by (rule lub_eqI)


[STATEMENT]
lemma primepow_odd_imp_primepow:
  assumes "primepow_odd n"
  shows   "primepow n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. primepow n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. primepow n
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
primepow_odd n
[PROOF STEP]
obtain p k where "1 \<le> k" "prime p" "n = p ^ (2 * k + 1)"
[PROOF STATE]
proof (prove)
using this:
primepow_odd n

goal (1 subgoal):
 1. (\<And>k p. \<lbrakk>1 \<le> k; prime p; n = p ^ (2 * k + 1)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding primepow_odd_def
[PROOF STATE]
proof (prove)
using this:
\<exists>p k. 1 \<le> k \<and> prime p \<and> n = p ^ (2 * k + 1)

goal (1 subgoal):
 1. (\<And>k p. \<lbrakk>1 \<le> k; prime p; n = p ^ (2 * k + 1)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
1 \<le> k
prime p
n = p ^ (2 * k + 1)

goal (1 subgoal):
 1. primepow n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
1 \<le> k
prime p
n = p ^ (2 * k + 1)

goal (1 subgoal):
 1. primepow n
[PROOF STEP]
from \<open>1 \<le> k\<close>
[PROOF STATE]
proof (chain)
picking this:
1 \<le> k
[PROOF STEP]
have "Suc (2 * k) > 0"
[PROOF STATE]
proof (prove)
using this:
1 \<le> k

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

goal (1 subgoal):
 1. primepow n
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
1 \<le> k
prime p
n = p ^ (2 * k + 1)
0 < Suc (2 * k)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
1 \<le> k
prime p
n = p ^ (2 * k + 1)
0 < Suc (2 * k)

goal (1 subgoal):
 1. primepow n
[PROOF STEP]
unfolding primepow_def
[PROOF STATE]
proof (prove)
using this:
1 \<le> k
prime p
n = p ^ (2 * k + 1)
0 < Suc (2 * k)

goal (1 subgoal):
 1. \<exists>p k. prime p \<and> 0 < k \<and> n = p ^ k
[PROOF STEP]
by (auto simp del: power_Suc)
[PROOF STATE]
proof (state)
this:
primepow n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma of_int_poly_power [simp]: "of_int_poly (p ^ n) = of_int_poly p ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int_poly (p ^ n) = of_int_poly p ^ n
[PROOF STEP]
by (induction n) simp_all


[STATEMENT]
lemma minGraphProps_facesAt_eq: "minGraphProps g \<Longrightarrow>
  v \<in> \<V> g \<Longrightarrow> set (facesAt g v) = {f \<in> \<F> g. v \<in> \<V> f}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>minGraphProps g; v \<in> \<V> g\<rbrakk> \<Longrightarrow> set (facesAt g v) = {f \<in> \<F> g. v \<in> \<V> f}
[PROOF STEP]
by (simp add: minGraphProps_def facesAt_eq_def)


[STATEMENT]
lemma valid_path_shiftpath [intro]:
  assumes "valid_path g" "pathfinish g = pathstart g" "a \<in> {0..1}"
    shows "valid_path(shiftpath a g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valid_path (shiftpath a g)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
valid_path g
pathfinish g = pathstart g
a \<in> {0..1}

goal (1 subgoal):
 1. valid_path (shiftpath a g)
[PROOF STEP]
apply (auto simp: valid_path_def shiftpath_alt_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>g piecewise_C1_differentiable_on {0..1}; pathfinish g = pathstart g; 0 \<le> a; a \<le> 1\<rbrakk> \<Longrightarrow> (\<lambda>x. if x \<le> 1 - a then g (a + x) else g (a + x - 1)) piecewise_C1_differentiable_on {0..1}
[PROOF STEP]
apply (rule piecewise_C1_differentiable_cases)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<lbrakk>g piecewise_C1_differentiable_on {0..1}; pathfinish g = pathstart g; 0 \<le> a; a \<le> 1\<rbrakk> \<Longrightarrow> (\<lambda>x. g (a + x)) piecewise_C1_differentiable_on {0..1 - a}
 2. \<lbrakk>g piecewise_C1_differentiable_on {0..1}; pathfinish g = pathstart g; 0 \<le> a; a \<le> 1\<rbrakk> \<Longrightarrow> (\<lambda>x. g (a + x - 1)) piecewise_C1_differentiable_on {1 - a..1}
 3. \<lbrakk>g piecewise_C1_differentiable_on {0..1}; pathfinish g = pathstart g; 0 \<le> a; a \<le> 1\<rbrakk> \<Longrightarrow> 0 \<le> 1 - a
 4. \<lbrakk>g piecewise_C1_differentiable_on {0..1}; pathfinish g = pathstart g; 0 \<le> a; a \<le> 1\<rbrakk> \<Longrightarrow> 1 - a \<le> 1
 5. \<lbrakk>g piecewise_C1_differentiable_on {0..1}; pathfinish g = pathstart g; 0 \<le> a; a \<le> 1\<rbrakk> \<Longrightarrow> g (a + (1 - a)) = g (a + (1 - a) - 1)
[PROOF STEP]
apply (auto simp: algebra_simps)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>g piecewise_C1_differentiable_on {0..1}; pathfinish g = pathstart g; 0 \<le> a; a \<le> 1\<rbrakk> \<Longrightarrow> (\<lambda>x. g (x + a)) piecewise_C1_differentiable_on {0..1 - a}
 2. \<lbrakk>g piecewise_C1_differentiable_on {0..1}; pathfinish g = pathstart g; 0 \<le> a; a \<le> 1\<rbrakk> \<Longrightarrow> (\<lambda>x. g (x + a - 1)) piecewise_C1_differentiable_on {1 - a..1}
 3. \<lbrakk>g piecewise_C1_differentiable_on {0..1}; pathfinish g = pathstart g; 0 \<le> a; a \<le> 1\<rbrakk> \<Longrightarrow> g 1 = g 0
[PROOF STEP]
apply (rule piecewise_C1_differentiable_affine [of g 1 a, simplified o_def scaleR_one])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>g piecewise_C1_differentiable_on {0..1}; pathfinish g = pathstart g; 0 \<le> a; a \<le> 1\<rbrakk> \<Longrightarrow> g piecewise_C1_differentiable_on (\<lambda>x. 1 * x + a) ` {0..1 - a}
 2. \<lbrakk>g piecewise_C1_differentiable_on {0..1}; pathfinish g = pathstart g; 0 \<le> a; a \<le> 1\<rbrakk> \<Longrightarrow> (\<lambda>x. g (x + a - 1)) piecewise_C1_differentiable_on {1 - a..1}
 3. \<lbrakk>g piecewise_C1_differentiable_on {0..1}; pathfinish g = pathstart g; 0 \<le> a; a \<le> 1\<rbrakk> \<Longrightarrow> g 1 = g 0
[PROOF STEP]
apply (auto simp: pathfinish_def pathstart_def elim: piecewise_C1_differentiable_on_subset)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>g piecewise_C1_differentiable_on {0..1}; g 1 = g 0; 0 \<le> a; a \<le> 1\<rbrakk> \<Longrightarrow> (\<lambda>x. g (x + a - 1)) piecewise_C1_differentiable_on {1 - a..1}
[PROOF STEP]
apply (rule piecewise_C1_differentiable_affine [of g 1 "a-1", simplified o_def scaleR_one algebra_simps])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>g piecewise_C1_differentiable_on {0..1}; g 1 = g 0; 0 \<le> a; a \<le> 1\<rbrakk> \<Longrightarrow> g piecewise_C1_differentiable_on (\<lambda>x. a + x * 1 - 1) ` {1 - a..1}
[PROOF STEP]
apply (auto simp: pathfinish_def pathstart_def elim: piecewise_C1_differentiable_on_subset)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma set_permute_list [simp]:
  assumes "f permutes {..<length xs}"
  shows "set (permute_list f xs) = set xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (permute_list f xs) = set xs
[PROOF STEP]
by (rule mset_eq_setD[OF mset_permute_list]) fact


[STATEMENT]
lemma wlp_measure_expand_m:
  assumes m: "m \<le> n" and wc: "well_com (Measure n M S)"
  shows "wlp (Measure m M S) P = matrix_sum d (\<lambda>k. adjoint (M k) * (wlp (S!k) P) * (M k)) m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wlp (Measure m M S) P = matrix_sum d (\<lambda>k. adjoint (M k) * wlp (S ! k) P * M k) m
[PROOF STEP]
unfolding wlp.simps wlp_measure_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_sum d (\<lambda>k. adjoint (M k) * (map wlp S ! k) P * M k) m = matrix_sum d (\<lambda>k. adjoint (M k) * wlp (S ! k) P * M k) m
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. matrix_sum d (\<lambda>k. adjoint (M k) * (map wlp S ! k) P * M k) m = matrix_sum d (\<lambda>k. adjoint (M k) * wlp (S ! k) P * M k) m
[PROOF STEP]
have "k < m \<Longrightarrow> map wlp S ! k = wlp (S!k)" for k
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k < m \<Longrightarrow> map wlp S ! k = wlp (S ! k)
[PROOF STEP]
using wc m
[PROOF STATE]
proof (prove)
using this:
well_com (Measure n M S)
m \<le> n

goal (1 subgoal):
 1. k < m \<Longrightarrow> map wlp S ! k = wlp (S ! k)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?k < m \<Longrightarrow> map wlp S ! ?k = wlp (S ! ?k)

goal (1 subgoal):
 1. matrix_sum d (\<lambda>k. adjoint (M k) * (map wlp S ! k) P * M k) m = matrix_sum d (\<lambda>k. adjoint (M k) * wlp (S ! k) P * M k) m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?k < m \<Longrightarrow> map wlp S ! ?k = wlp (S ! ?k)
[PROOF STEP]
have "k < m \<Longrightarrow> (map wlp S ! k) P = wlp (S!k) P" for k
[PROOF STATE]
proof (prove)
using this:
?k < m \<Longrightarrow> map wlp S ! ?k = wlp (S ! ?k)

goal (1 subgoal):
 1. k < m \<Longrightarrow> (map wlp S ! k) P = wlp (S ! k) P
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?k < m \<Longrightarrow> (map wlp S ! ?k) P = wlp (S ! ?k) P

goal (1 subgoal):
 1. matrix_sum d (\<lambda>k. adjoint (M k) * (map wlp S ! k) P * M k) m = matrix_sum d (\<lambda>k. adjoint (M k) * wlp (S ! k) P * M k) m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?k < m \<Longrightarrow> (map wlp S ! ?k) P = wlp (S ! ?k) P
[PROOF STEP]
show "matrix_sum d (\<lambda>k. adjoint (M k) * ((map wlp S ! k) P) * (M k)) m
    = matrix_sum d (\<lambda>k. adjoint (M k) * (wlp (S!k) P) * (M k)) m"
[PROOF STATE]
proof (prove)
using this:
?k < m \<Longrightarrow> (map wlp S ! ?k) P = wlp (S ! ?k) P

goal (1 subgoal):
 1. matrix_sum d (\<lambda>k. adjoint (M k) * (map wlp S ! k) P * M k) m = matrix_sum d (\<lambda>k. adjoint (M k) * wlp (S ! k) P * M k) m
[PROOF STEP]
using matrix_sum_cong[of m "\<lambda>k. adjoint (M k) * ((map wlp S ! k) P) * (M k)" "\<lambda>k. adjoint (M k) * (wlp (S!k) P) * (M k)"]
[PROOF STATE]
proof (prove)
using this:
?k < m \<Longrightarrow> (map wlp S ! ?k) P = wlp (S ! ?k) P
(\<And>k. k < m \<Longrightarrow> adjoint (M k) * (map wlp S ! k) P * M k = adjoint (M k) * wlp (S ! k) P * M k) \<Longrightarrow> matrix_sum ?d (\<lambda>k. adjoint (M k) * (map wlp S ! k) P * M k) m = matrix_sum ?d (\<lambda>k. adjoint (M k) * wlp (S ! k) P * M k) m

goal (1 subgoal):
 1. matrix_sum d (\<lambda>k. adjoint (M k) * (map wlp S ! k) P * M k) m = matrix_sum d (\<lambda>k. adjoint (M k) * wlp (S ! k) P * M k) m
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
matrix_sum d (\<lambda>k. adjoint (M k) * (map wlp S ! k) P * M k) m = matrix_sum d (\<lambda>k. adjoint (M k) * wlp (S ! k) P * M k) m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma subset_sublist_exists:
  "ys \<subseteq> set xs \<Longrightarrow> \<exists>zs. set zs = ys \<and> zs \<in> set (subseqs xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ys \<subseteq> set xs \<Longrightarrow> \<exists>zs. set zs = ys \<and> zs \<in> set (subseqs xs)
[PROOF STEP]
proof (induction xs arbitrary: ys)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>ys. ys \<subseteq> set [] \<Longrightarrow> \<exists>zs. set zs = ys \<and> zs \<in> set (subseqs [])
 2. \<And>a xs ys. \<lbrakk>\<And>ys. ys \<subseteq> set xs \<Longrightarrow> \<exists>zs. set zs = ys \<and> zs \<in> set (subseqs xs); ys \<subseteq> set (a # xs)\<rbrakk> \<Longrightarrow> \<exists>zs. set zs = ys \<and> zs \<in> set (subseqs (a # xs))
[PROOF STEP]
case Cons
[PROOF STATE]
proof (state)
this:
?ys \<subseteq> set xs_ \<Longrightarrow> \<exists>zs. set zs = ?ys \<and> zs \<in> set (subseqs xs_)
ys \<subseteq> set (a_ # xs_)

goal (2 subgoals):
 1. \<And>ys. ys \<subseteq> set [] \<Longrightarrow> \<exists>zs. set zs = ys \<and> zs \<in> set (subseqs [])
 2. \<And>a xs ys. \<lbrakk>\<And>ys. ys \<subseteq> set xs \<Longrightarrow> \<exists>zs. set zs = ys \<and> zs \<in> set (subseqs xs); ys \<subseteq> set (a # xs)\<rbrakk> \<Longrightarrow> \<exists>zs. set zs = ys \<and> zs \<in> set (subseqs (a # xs))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
?ys \<subseteq> set xs_ \<Longrightarrow> \<exists>zs. set zs = ?ys \<and> zs \<in> set (subseqs xs_)
ys \<subseteq> set (a_ # xs_)

goal (1 subgoal):
 1. \<exists>zs. set zs = ys \<and> zs \<in> set (subseqs (a_ # xs_))
[PROOF STEP]
by (metis (no_types, lifting) Pow_iff imageE subseqs_powset)
[PROOF STATE]
proof (state)
this:
\<exists>zs. set zs = ys \<and> zs \<in> set (subseqs (a_ # xs_))

goal (1 subgoal):
 1. \<And>ys. ys \<subseteq> set [] \<Longrightarrow> \<exists>zs. set zs = ys \<and> zs \<in> set (subseqs [])
[PROOF STEP]
qed simp


[STATEMENT]
lemma degree_add_less: "degree p < n \<Longrightarrow> degree q < n \<Longrightarrow> degree (p + q) < n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>degree p < n; degree q < n\<rbrakk> \<Longrightarrow> degree (p + q) < n
[PROOF STEP]
by (auto intro: le_less_trans degree_add_le_max)


[STATEMENT]
lemma bitxor_cancel [simp]: "(b \<oplus>\<^sub>b b) = \<zero>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (b \<oplus>\<^sub>b b) = \<zero>
[PROOF STEP]
by (cases b) simp_all


[STATEMENT]
lemma fls_subdegree_lt_fls_regpart_subdegree:
  "fls_subdegree f \<le> int (subdegree (fls_regpart f))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_subdegree f \<le> int (subdegree (fls_regpart f))
[PROOF STEP]
using fls_subdegree_leI nth_subdegree_nonzero[of "fls_regpart f"]
[PROOF STATE]
proof (prove)
using this:
?f $$ ?n \<noteq> (0::?'a) \<Longrightarrow> fls_subdegree ?f \<le> ?n
fls_regpart f \<noteq> 0 \<Longrightarrow> fls_regpart f $ subdegree (fls_regpart f) \<noteq> (0::'a)

goal (1 subgoal):
 1. fls_subdegree f \<le> int (subdegree (fls_regpart f))
[PROOF STEP]
by    (cases "(fls_regpart f) = 0")
        (simp_all add: fls_regpart_eq0_imp_nonpos_subdegree)


[STATEMENT]
lemma mono_arctan_real: "mono (arctan :: real \<Rightarrow> real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mono arctan
[PROOF STEP]
by (auto intro!: monoI arctan_monotone')


[STATEMENT]
lemma Range_outside_sub:
  assumes "Range R \<subseteq> Y"
  shows "Range (R outside X) \<subseteq> Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Range (R outside X) \<subseteq> Y
[PROOF STEP]
using assms outside_union_restrict
[PROOF STATE]
proof (prove)
using this:
Range R \<subseteq> Y
?P = ?P outside ?X \<union> ?P || ?X

goal (1 subgoal):
 1. Range (R outside X) \<subseteq> Y
[PROOF STEP]
by (metis Range_mono inf_sup_ord(3) subset_trans)


[STATEMENT]
lemma us_inj: "inj (us::'a::order_with_dual \<Rightarrow> 'a upset)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj us
[PROOF STEP]
unfolding inj_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. us x = us y \<longrightarrow> x = y
[PROOF STEP]
by (simp add: us_faithful dual_order.antisym)


[STATEMENT]
lemma (in Ring) ring_inv1_3:"\<lbrakk>a \<in> carrier R; b \<in> carrier R\<rbrakk> \<Longrightarrow>
                           a \<cdot>\<^sub>r b = (-\<^sub>a a) \<cdot>\<^sub>r (-\<^sub>a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier R; b \<in> carrier R\<rbrakk> \<Longrightarrow> a \<cdot>\<^sub>r b = (-\<^sub>a a) \<cdot>\<^sub>r (-\<^sub>a b)
[PROOF STEP]
apply (cut_tac ring_is_ag)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier R; b \<in> carrier R; aGroup R\<rbrakk> \<Longrightarrow> a \<cdot>\<^sub>r b = (-\<^sub>a a) \<cdot>\<^sub>r (-\<^sub>a b)
[PROOF STEP]
apply (subst  aGroup.ag_inv_inv[THEN sym], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier R; b \<in> carrier R; aGroup R\<rbrakk> \<Longrightarrow> (-\<^sub>a (-\<^sub>a a)) \<cdot>\<^sub>r b = (-\<^sub>a a) \<cdot>\<^sub>r (-\<^sub>a b)
[PROOF STEP]
apply (frule aGroup.ag_mOp_closed[of "R" "a"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier R; b \<in> carrier R; aGroup R; -\<^sub>a a \<in> carrier R\<rbrakk> \<Longrightarrow> (-\<^sub>a (-\<^sub>a a)) \<cdot>\<^sub>r b = (-\<^sub>a a) \<cdot>\<^sub>r (-\<^sub>a b)
[PROOF STEP]
apply (subst ring_inv1_1[THEN sym, of "-\<^sub>a a" "b"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier R; b \<in> carrier R; aGroup R; -\<^sub>a a \<in> carrier R\<rbrakk> \<Longrightarrow> -\<^sub>a (-\<^sub>a a) \<cdot>\<^sub>r b = (-\<^sub>a a) \<cdot>\<^sub>r (-\<^sub>a b)
[PROOF STEP]
apply (subst ring_inv1_2[of "-\<^sub>a a" "b"], assumption+, simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma unit_vec_carrier[simp]: "unit_vec n i \<in> carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unit_vec n i \<in> carrier_vec n
[PROOF STEP]
unfolding unit_vec_def carrier_vec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec n (\<lambda>j. if j = i then 1::'a else (0::'a)) \<in> {v. dim_vec v = n}
[PROOF STEP]
by auto


[STATEMENT]
lemma (in Torder) less_in_Iod:"\<lbrakk>a \<in> carrier D; b \<in> carrier D; a \<prec> b\<rbrakk>
      \<Longrightarrow> (a \<prec> b) = (a \<in> carrier (Iod D (segment D b)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier D; b \<in> carrier D; a \<prec> b\<rbrakk> \<Longrightarrow> a \<prec> b = (a \<in> carrier (Iod D (segment D b)))
[PROOF STEP]
apply (simp add:Iod_def segment_inc)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma comp_of_ords: assumes "class.linorder le lt"
  shows "comparator (comp_of_ords le lt)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. comparator (comp_of_ords le lt)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. comparator (comp_of_ords le lt)
[PROOF STEP]
interpret linorder le lt
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. class.linorder le lt
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. comparator (comp_of_ords le lt)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. comparator (comp_of_ords le lt)
[PROOF STEP]
by (unfold_locales, auto simp: comp_of_ords_def split: if_splits)
[PROOF STATE]
proof (state)
this:
comparator (comp_of_ords le lt)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma iT_Plus_neg_iRelease_conv: "(P t1. t1 \<R> t2 (I \<oplus>- k). Q t2) = (P (t1 - k). t1 \<R> t2 (I \<down>\<ge> k). Q (t2 - k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (P t1. t1 \<R> t2 I \<oplus>- k. Q t2) = (P (t1 - k). t1 \<R> t2 I \<down>\<ge> k. Q (t2 - k))
[PROOF STEP]
by (simp add: iRelease_iWeakUntil_conv iT_Plus_neg_iWeakUntil_conv)


[STATEMENT]
theorem \<pi>_upper_bound:
  fixes x :: real
  assumes "x \<ge> 2"
  shows   "\<pi> x < 3 * (exp (-1) + ln 2) * x / ln x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
proof (cases "x \<ge> 3")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
 2. \<not> 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> 3 \<le> x

goal (2 subgoals):
 1. 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
 2. \<not> 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
have "\<pi> x = \<pi> (nat \<lfloor>x\<rfloor>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi> x = \<pi> (real (nat \<lfloor>x\<rfloor>))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<pi> x = \<pi> (real (nat \<lfloor>x\<rfloor>))

goal (2 subgoals):
 1. 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
 2. \<not> 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<pi> x = \<pi> (real (nat \<lfloor>x\<rfloor>))

goal (2 subgoals):
 1. 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
 2. \<not> 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
from False and assms
[PROOF STATE]
proof (chain)
picking this:
\<not> 3 \<le> x
2 \<le> x
[PROOF STEP]
have "nat \<lfloor>x\<rfloor> = 2"
[PROOF STATE]
proof (prove)
using this:
\<not> 3 \<le> x
2 \<le> x

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

goal (2 subgoals):
 1. 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
 2. \<not> 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<pi> x = \<pi> (real 2)
[PROOF STEP]
have "\<pi> x = 1"
[PROOF STATE]
proof (prove)
using this:
\<pi> x = \<pi> (real 2)

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

goal (2 subgoals):
 1. 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
 2. \<not> 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<pi> x = 1

goal (2 subgoals):
 1. 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
 2. \<not> 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
have "\<dots> < 3 * (exp (-1) + ln 2) * exp 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 < 3 * (exp (- 1) + ln 2) * exp 1
[PROOF STEP]
by (simp add: exp_minus field_simps add_pos_pos
             del: div_mult_self3 div_mult_self4 div_mult_self2 div_mult_self1)
[PROOF STATE]
proof (state)
this:
1 < 3 * (exp (- 1) + ln 2) * exp 1

goal (2 subgoals):
 1. 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
 2. \<not> 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 < 3 * (exp (- 1) + ln 2) * exp 1

goal (2 subgoals):
 1. 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
 2. \<not> 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
have "\<dots> \<le> 3 * (exp (-1) + ln 2) * (x / ln x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3 * (exp (- 1) + ln 2) * exp 1 \<le> 3 * (exp (- 1) + ln 2) * (x / ln x)
[PROOF STEP]
using \<pi>_upper_bound_aux[of 1 x]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < 1; 0 < x\<rbrakk> \<Longrightarrow> x powr - 1 * ln x \<le> 1 / (1 * exp 1)

goal (1 subgoal):
 1. 3 * (exp (- 1) + ln 2) * exp 1 \<le> 3 * (exp (- 1) + ln 2) * (x / ln x)
[PROOF STEP]
by (intro mult_left_mono) (use assms in \<open>auto simp: field_simps powr_minus\<close>)
[PROOF STATE]
proof (state)
this:
3 * (exp (- 1) + ln 2) * exp 1 \<le> 3 * (exp (- 1) + ln 2) * (x / ln x)

goal (2 subgoals):
 1. 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
 2. \<not> 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<pi> x < 3 * (exp (- 1) + ln 2) * (x / ln x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<pi> x < 3 * (exp (- 1) + ln 2) * (x / ln x)

goal (1 subgoal):
 1. \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<pi> x < 3 * (exp (- 1) + ln 2) * (x / ln x)
2 \<le> x

goal (1 subgoal):
 1. \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
\<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x

goal (1 subgoal):
 1. 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
3 \<le> x

goal (1 subgoal):
 1. 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
define n where "n = nat \<lfloor>x\<rfloor>"
[PROOF STATE]
proof (state)
this:
n = nat \<lfloor>x\<rfloor>

goal (1 subgoal):
 1. 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
from True
[PROOF STATE]
proof (chain)
picking this:
3 \<le> x
[PROOF STEP]
have n: "n \<ge> 3"
[PROOF STATE]
proof (prove)
using this:
3 \<le> x

goal (1 subgoal):
 1. 3 \<le> n
[PROOF STEP]
by (simp add: n_def le_nat_iff le_floor_iff)
[PROOF STATE]
proof (state)
this:
3 \<le> n

goal (1 subgoal):
 1. 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
have "\<pi> x = \<pi> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi> x = \<pi> (real n)
[PROOF STEP]
by (simp add: n_def)
[PROOF STATE]
proof (state)
this:
\<pi> x = \<pi> (real n)

goal (1 subgoal):
 1. 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<pi> x = \<pi> (real n)

goal (1 subgoal):
 1. 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
have "\<pi> n < 3 * (exp (-1) + ln 2) * (n / ln n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pi> (real n) < 3 * (exp (- 1) + ln 2) * (real n / ln (real n))
[PROOF STEP]
using \<pi>_upper_bound_strong[of n "2 / 3"] ln_realpow[of 2 2] n
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>2 \<le> n; 2 / 3 \<in> {0<..<1}\<rbrakk> \<Longrightarrow> \<pi> (real n) < (1 / ((1 - 2 / 3) * exp 1) + ln 4 / (2 / 3)) * real n / ln (real n)
0 < 2 \<Longrightarrow> ln (2\<^sup>2) = real 2 * ln 2
3 \<le> n

goal (1 subgoal):
 1. \<pi> (real n) < 3 * (exp (- 1) + ln 2) * (real n / ln (real n))
[PROOF STEP]
by (simp add: field_simps exp_minus
             del: div_mult_self3 div_mult_self4 div_mult_self2 div_mult_self1)
[PROOF STATE]
proof (state)
this:
\<pi> (real n) < 3 * (exp (- 1) + ln 2) * (real n / ln (real n))

goal (1 subgoal):
 1. 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<pi> (real n) < 3 * (exp (- 1) + ln 2) * (real n / ln (real n))

goal (1 subgoal):
 1. 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
have "\<dots> \<le> 3 * (exp (-1) + ln 2) * (x / ln x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3 * (exp (- 1) + ln 2) * (real n / ln (real n)) \<le> 3 * (exp (- 1) + ln 2) * (x / ln x)
[PROOF STEP]
using n True
[PROOF STATE]
proof (prove)
using this:
3 \<le> n
3 \<le> x

goal (1 subgoal):
 1. 3 * (exp (- 1) + ln 2) * (real n / ln (real n)) \<le> 3 * (exp (- 1) + ln 2) * (x / ln x)
[PROOF STEP]
by (intro mult_left_mono divide_ln_mono) (auto simp: n_def)
[PROOF STATE]
proof (state)
this:
3 * (exp (- 1) + ln 2) * (real n / ln (real n)) \<le> 3 * (exp (- 1) + ln 2) * (x / ln x)

goal (1 subgoal):
 1. 3 \<le> x \<Longrightarrow> \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<pi> x < 3 * (exp (- 1) + ln 2) * (x / ln x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<pi> x < 3 * (exp (- 1) + ln 2) * (x / ln x)

goal (1 subgoal):
 1. \<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x
[PROOF STEP]
by (simp add: divide_simps)
[PROOF STATE]
proof (state)
this:
\<pi> x < 3 * (exp (- 1) + ln 2) * x / ln x

goal:
No subgoals!
[PROOF STEP]
qed