[STATEMENT]
lemma Lyndon_rec_all: assumes "Lyndon_rec (a # w) (\<^bold>|w\<^bold>|)"
  shows "n < \<^bold>|a#w\<^bold>| \<Longrightarrow> 0 < n \<Longrightarrow> Lyndon_rec (a#w) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>n < \<^bold>|a # w\<^bold>|; 0 < n\<rbrakk> \<Longrightarrow> Lyndon_rec (a # w) n
[PROOF STEP]
proof(induction n rule: strict_inc_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. \<lbrakk>\<^bold>|a # w\<^bold>| = Suc i; 0 < i\<rbrakk> \<Longrightarrow> Lyndon_rec (a # w) i
 2. \<And>i. \<lbrakk>i < \<^bold>|a # w\<^bold>|; 0 < Suc i \<Longrightarrow> Lyndon_rec (a # w) (Suc i); 0 < i\<rbrakk> \<Longrightarrow> Lyndon_rec (a # w) i
[PROOF STEP]
case (base i)
[PROOF STATE]
proof (state)
this:
\<^bold>|a # w\<^bold>| = Suc i
0 < i

goal (2 subgoals):
 1. \<And>i. \<lbrakk>\<^bold>|a # w\<^bold>| = Suc i; 0 < i\<rbrakk> \<Longrightarrow> Lyndon_rec (a # w) i
 2. \<And>i. \<lbrakk>i < \<^bold>|a # w\<^bold>|; 0 < Suc i \<Longrightarrow> Lyndon_rec (a # w) (Suc i); 0 < i\<rbrakk> \<Longrightarrow> Lyndon_rec (a # w) i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<^bold>|a # w\<^bold>| = Suc i
0 < i
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<^bold>|a # w\<^bold>| = Suc i
0 < i

goal (1 subgoal):
 1. Lyndon_rec (a # w) i
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<^bold>|a # w\<^bold>| = Suc i
0 < i
Lyndon_rec (a # w) \<^bold>|w\<^bold>|

goal (1 subgoal):
 1. Lyndon_rec (a # w) i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Lyndon_rec (a # w) i

goal (1 subgoal):
 1. \<And>i. \<lbrakk>i < \<^bold>|a # w\<^bold>|; 0 < Suc i \<Longrightarrow> Lyndon_rec (a # w) (Suc i); 0 < i\<rbrakk> \<Longrightarrow> Lyndon_rec (a # w) i
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>i < \<^bold>|a # w\<^bold>|; 0 < Suc i \<Longrightarrow> Lyndon_rec (a # w) (Suc i); 0 < i\<rbrakk> \<Longrightarrow> Lyndon_rec (a # w) i
[PROOF STEP]
case (step i)
[PROOF STATE]
proof (state)
this:
i < \<^bold>|a # w\<^bold>|
0 < Suc i \<Longrightarrow> Lyndon_rec (a # w) (Suc i)
0 < i

goal (1 subgoal):
 1. \<And>i. \<lbrakk>i < \<^bold>|a # w\<^bold>|; 0 < Suc i \<Longrightarrow> Lyndon_rec (a # w) (Suc i); 0 < i\<rbrakk> \<Longrightarrow> Lyndon_rec (a # w) i
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i < \<^bold>|a # w\<^bold>|
0 < Suc i \<Longrightarrow> Lyndon_rec (a # w) (Suc i)
0 < i
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
i < \<^bold>|a # w\<^bold>|
0 < Suc i \<Longrightarrow> Lyndon_rec (a # w) (Suc i)
0 < i

goal (1 subgoal):
 1. Lyndon_rec (a # w) i
[PROOF STEP]
by (meson Lyndon_rec.simps(2) zero_less_Suc)
[PROOF STATE]
proof (state)
this:
Lyndon_rec (a # w) i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eexp_lt_eexp_iff_lt:
  "eexp x < eexp y \<longleftrightarrow> x < y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (eexp x < eexp y) = (x < y)
[PROOF STEP]
using eexp_mono2 not_le
[PROOF STATE]
proof (prove)
using this:
?x \<le> ?y \<Longrightarrow> eexp ?x \<le> eexp ?y
(\<not> ?x \<le> ?y) = (?y < ?x)

goal (1 subgoal):
 1. (eexp x < eexp y) = (x < y)
[PROOF STEP]
by (auto intro: mono_intros)


[STATEMENT]
lemma det_minor_row: "det (minor B i j) = det (upd_row B i (axis j 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Square_Matrix.det (minor B i j) = Square_Matrix.det (upd_row B i (axis j (1::'a)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Square_Matrix.det (minor B i j) = Square_Matrix.det (upd_row B i (axis j (1::'a)))
[PROOF STEP]
have "det (minor (upd_row B i (axis j 1)) i j) = det (upd_row B i (axis j 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Square_Matrix.det (minor (upd_row B i (axis j (1::'a))) i j) = Square_Matrix.det (upd_row B i (axis j (1::'a)))
[PROOF STEP]
by (rule det_minor_row') simp
[PROOF STATE]
proof (state)
this:
Square_Matrix.det (minor (upd_row B i (axis j (1::'a))) i j) = Square_Matrix.det (upd_row B i (axis j (1::'a)))

goal (1 subgoal):
 1. Square_Matrix.det (minor B i j) = Square_Matrix.det (upd_row B i (axis j (1::'a)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Square_Matrix.det (minor (upd_row B i (axis j (1::'a))) i j) = Square_Matrix.det (upd_row B i (axis j (1::'a)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Square_Matrix.det (minor (upd_row B i (axis j (1::'a))) i j) = Square_Matrix.det (upd_row B i (axis j (1::'a)))

goal (1 subgoal):
 1. Square_Matrix.det (minor B i j) = Square_Matrix.det (upd_row B i (axis j (1::'a)))
[PROOF STEP]
by (simp add: minor_eq_col_row)
[PROOF STATE]
proof (state)
this:
Square_Matrix.det (minor B i j) = Square_Matrix.det (upd_row B i (axis j (1::'a)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma PiE_dflt_empty_iff [simp]: "PiE_dflt A dflt B = {} \<longleftrightarrow> (\<exists>x\<in>A. B x = {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (PiE_dflt A dflt B = {}) = (\<exists>x\<in>A. B x = {})
[PROOF STEP]
by (simp add: dflt_image_PiE [symmetric] PiE_eq_empty_iff)


[STATEMENT]
lemma closure_of_subtopology_mono:
   "T \<subseteq> U \<Longrightarrow> (subtopology X T) closure_of S \<subseteq> (subtopology X U) closure_of S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T \<subseteq> U \<Longrightarrow> subtopology X T closure_of S \<subseteq> subtopology X U closure_of S
[PROOF STEP]
unfolding closure_of_subtopology
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T \<subseteq> U \<Longrightarrow> T \<inter> X closure_of (T \<inter> S) \<subseteq> U \<inter> X closure_of (U \<inter> S)
[PROOF STEP]
by auto (meson closure_of_mono inf_mono subset_iff)


[STATEMENT]
lemma gbinomial_code [code]:
  "a gchoose k =
    (if k = 0 then 1
     else fold_atLeastAtMost_nat (\<lambda>k acc. (a - of_nat k) * acc) 0 (k - 1) 1 / fact k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a gchoose k = (if k = 0 then 1::'a else fold_atLeastAtMost_nat (\<lambda>k. (*) (a - of_nat k)) 0 (k - 1) (1::'a) / fact k)
[PROOF STEP]
by (cases k)
    (simp_all add: gbinomial_prod_rev prod_atLeastAtMost_code [symmetric]
      atLeastLessThanSuc_atLeastAtMost)


[STATEMENT]
lemma of_rat_eq_0_iff [simp]: "of_rat a = 0 \<longleftrightarrow> a = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (of_rat a = (0::'a)) = (a = 0)
[PROOF STEP]
using of_rat_eq_iff [of _ 0]
[PROOF STATE]
proof (prove)
using this:
(of_rat ?a = of_rat 0) = (?a = 0)

goal (1 subgoal):
 1. (of_rat a = (0::'a)) = (a = 0)
[PROOF STEP]
by simp


[STATEMENT]
lemma distinct_quicksort_acc:
  "distinct (quicksort_acc ac xs) = distinct (ac @ xs)"
  and distinct_quicksort_part:
  "distinct (quicksort_part ac x lts eqs gts zs) = distinct (ac @ [x] @ lts @ eqs @ gts @ zs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (quicksort_acc ac xs) = distinct (ac @ xs) &&& distinct (quicksort_part ac x lts eqs gts zs) = distinct (ac @ [x] @ lts @ eqs @ gts @ zs)
[PROOF STEP]
by(induct ac xs and ac x lts eqs gts zs rule: quicksort_acc_quicksort_part.induct) auto


[STATEMENT]
lemma fds_nth_norm_mult_nonneg [simp]: "fds_nth (fds_norm f * fds_norm g) n \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> fds_nth (fds_norm f * fds_norm g) n
[PROOF STEP]
by (auto simp: fds_nth_mult dirichlet_prod_def intro!: sum_nonneg)


[STATEMENT]
lemma basis_list_basis: assumes "basis_list fs"
  shows "distinct fs" "lin_indpt (set fs)" "basis (set fs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct fs &&& lin_indpt (set fs) &&& basis (set fs)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. distinct fs
 2. lin_indpt (set fs)
 3. basis (set fs)
[PROOF STEP]
from assms[unfolded basis_list_def]
[PROOF STATE]
proof (chain)
picking this:
set fs \<subseteq> carrier_vec n \<and> length fs = n \<and> carrier_vec n \<subseteq> local.span (set fs)
[PROOF STEP]
have len: "length fs = n" and C: "set fs \<subseteq> carrier_vec n"
    and span: "carrier_vec n \<subseteq> span (set fs)"
[PROOF STATE]
proof (prove)
using this:
set fs \<subseteq> carrier_vec n \<and> length fs = n \<and> carrier_vec n \<subseteq> local.span (set fs)

goal (1 subgoal):
 1. length fs = n &&& set fs \<subseteq> carrier_vec n &&& carrier_vec n \<subseteq> local.span (set fs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length fs = n
set fs \<subseteq> carrier_vec n
carrier_vec n \<subseteq> local.span (set fs)

goal (3 subgoals):
 1. distinct fs
 2. lin_indpt (set fs)
 3. basis (set fs)
[PROOF STEP]
show b: "basis (set fs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. basis (set fs)
[PROOF STEP]
proof (rule dim_gen_is_basis[OF finite_set C])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. local.span (set fs) = carrier_vec n
 2. card (set fs) \<le> local.dim
[PROOF STEP]
show "card (set fs) \<le> dim"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (set fs) \<le> local.dim
[PROOF STEP]
unfolding dim_is_n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (set fs) \<le> n
[PROOF STEP]
unfolding len[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (set fs) \<le> length fs
[PROOF STEP]
by (rule card_length)
[PROOF STATE]
proof (state)
this:
card (set fs) \<le> local.dim

goal (1 subgoal):
 1. local.span (set fs) = carrier_vec n
[PROOF STEP]
show "span (set fs) = carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.span (set fs) = carrier_vec n
[PROOF STEP]
using span C
[PROOF STATE]
proof (prove)
using this:
carrier_vec n \<subseteq> local.span (set fs)
set fs \<subseteq> carrier_vec n

goal (1 subgoal):
 1. local.span (set fs) = carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
local.span (set fs) = carrier_vec n

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

goal (2 subgoals):
 1. distinct fs
 2. lin_indpt (set fs)
[PROOF STEP]
thus "lin_indpt (set fs)"
[PROOF STATE]
proof (prove)
using this:
basis (set fs)

goal (1 subgoal):
 1. lin_indpt (set fs)
[PROOF STEP]
unfolding basis_def
[PROOF STATE]
proof (prove)
using this:
lin_indpt (set fs) \<and> local.span (set fs) = carrier_vec n \<and> set fs \<subseteq> carrier_vec n

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

goal (1 subgoal):
 1. distinct fs
[PROOF STEP]
show "distinct fs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct fs
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> distinct fs \<Longrightarrow> False
[PROOF STEP]
assume "\<not> distinct fs"
[PROOF STATE]
proof (state)
this:
\<not> distinct fs

goal (1 subgoal):
 1. \<not> distinct fs \<Longrightarrow> False
[PROOF STEP]
hence "card (set fs) < length fs"
[PROOF STATE]
proof (prove)
using this:
\<not> distinct fs

goal (1 subgoal):
 1. card (set fs) < length fs
[PROOF STEP]
using antisym_conv1 card_distinct card_length
[PROOF STATE]
proof (prove)
using this:
\<not> distinct fs
\<not> ?x < ?y \<Longrightarrow> (?x \<le> ?y) = (?x = ?y)
card (set ?xs) = length ?xs \<Longrightarrow> distinct ?xs
card (set ?xs) \<le> length ?xs

goal (1 subgoal):
 1. card (set fs) < length fs
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card (set fs) < length fs

goal (1 subgoal):
 1. \<not> distinct fs \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card (set fs) < length fs

goal (1 subgoal):
 1. \<not> distinct fs \<Longrightarrow> False
[PROOF STEP]
have "\<dots> = dim"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length fs = local.dim
[PROOF STEP]
unfolding len dim_is_n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n = n
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
length fs = local.dim

goal (1 subgoal):
 1. \<not> distinct fs \<Longrightarrow> False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
card (set fs) < local.dim
[PROOF STEP]
have "card (set fs) < dim"
[PROOF STATE]
proof (prove)
using this:
card (set fs) < local.dim

goal (1 subgoal):
 1. card (set fs) < local.dim
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card (set fs) < local.dim

goal (1 subgoal):
 1. \<not> distinct fs \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card (set fs) < local.dim

goal (1 subgoal):
 1. \<not> distinct fs \<Longrightarrow> False
[PROOF STEP]
have "\<dots> \<le> card (set fs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.dim \<le> card (set fs)
[PROOF STEP]
using span finite_set[of fs]
[PROOF STATE]
proof (prove)
using this:
carrier_vec n \<subseteq> local.span (set fs)
finite (set fs)

goal (1 subgoal):
 1. local.dim \<le> card (set fs)
[PROOF STEP]
using b basis_def gen_ge_dim
[PROOF STATE]
proof (prove)
using this:
carrier_vec n \<subseteq> local.span (set fs)
finite (set fs)
basis (set fs)
basis ?A = (lin_indpt ?A \<and> local.span ?A = carrier_vec n \<and> ?A \<subseteq> carrier_vec n)
\<lbrakk>finite ?A; ?A \<subseteq> carrier_vec n; local.span ?A = carrier_vec n\<rbrakk> \<Longrightarrow> local.dim \<le> card ?A

goal (1 subgoal):
 1. local.dim \<le> card (set fs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
local.dim \<le> card (set fs)

goal (1 subgoal):
 1. \<not> distinct fs \<Longrightarrow> False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
card (set fs) < card (set fs)
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
card (set fs) < card (set fs)

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

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma exi_ren: "y \<notin> Fvars \<phi> \<Longrightarrow> exi x \<phi> = exi y (\<phi>(x::=Var y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<notin> Fvars \<phi> \<Longrightarrow> exi x \<phi> = exi y (\<phi>(x::=Var y))
[PROOF STEP]
using exi_ren_subst_fresh Fvars_def
[PROOF STATE]
proof (prove)
using this:
atom ?y \<sharp> ?\<phi> \<Longrightarrow> exi ?x ?\<phi> = exi ?y (?\<phi>(?x::=Var ?y))
Fvars ?t = {a. \<not> atom a \<sharp> ?t}

goal (1 subgoal):
 1. y \<notin> Fvars \<phi> \<Longrightarrow> exi x \<phi> = exi y (\<phi>(x::=Var y))
[PROOF STEP]
by blast


[STATEMENT]
lemma bij_betw_compose_left_perm_Pi:
  assumes "\<pi> permutes B"
  shows   "bij_betw (\<lambda>f. (\<pi> \<circ> f)) (A \<rightarrow> B) (A \<rightarrow> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw ((\<circ>) \<pi>) (A \<rightarrow> B) (A \<rightarrow> B)
[PROOF STEP]
proof (rule bij_betwI)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. (\<circ>) \<pi> \<in> (A \<rightarrow> B) \<rightarrow> A \<rightarrow> B
 2. ?g \<in> (A \<rightarrow> B) \<rightarrow> A \<rightarrow> B
 3. \<And>x. x \<in> A \<rightarrow> B \<Longrightarrow> ?g (\<pi> \<circ> x) = x
 4. \<And>y. y \<in> A \<rightarrow> B \<Longrightarrow> \<pi> \<circ> ?g y = y
[PROOF STEP]
have *: "(\<lambda>f. (\<pi> \<circ> f)) \<in> (A \<rightarrow> B) \<rightarrow> A \<rightarrow> B" if \<pi>: "\<pi> permutes B" for \<pi>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<circ>) \<pi> \<in> (A \<rightarrow> B) \<rightarrow> A \<rightarrow> B
[PROOF STEP]
by (auto simp: permutes_in_image[OF \<pi>])
[PROOF STATE]
proof (state)
this:
?\<pi> permutes B \<Longrightarrow> (\<circ>) ?\<pi> \<in> (A \<rightarrow> B) \<rightarrow> A \<rightarrow> B

goal (4 subgoals):
 1. (\<circ>) \<pi> \<in> (A \<rightarrow> B) \<rightarrow> A \<rightarrow> B
 2. ?g \<in> (A \<rightarrow> B) \<rightarrow> A \<rightarrow> B
 3. \<And>x. x \<in> A \<rightarrow> B \<Longrightarrow> ?g (\<pi> \<circ> x) = x
 4. \<And>y. y \<in> A \<rightarrow> B \<Longrightarrow> \<pi> \<circ> ?g y = y
[PROOF STEP]
show "(\<lambda>f. (\<pi> \<circ> f)) \<in> (A \<rightarrow> B) \<rightarrow> A \<rightarrow> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<circ>) \<pi> \<in> (A \<rightarrow> B) \<rightarrow> A \<rightarrow> B
[PROOF STEP]
by (rule *) fact
[PROOF STATE]
proof (state)
this:
(\<circ>) \<pi> \<in> (A \<rightarrow> B) \<rightarrow> A \<rightarrow> B

goal (3 subgoals):
 1. ?g \<in> (A \<rightarrow> B) \<rightarrow> A \<rightarrow> B
 2. \<And>x. x \<in> A \<rightarrow> B \<Longrightarrow> ?g (\<pi> \<circ> x) = x
 3. \<And>y. y \<in> A \<rightarrow> B \<Longrightarrow> \<pi> \<circ> ?g y = y
[PROOF STEP]
show "(\<lambda>f. (inv_into UNIV \<pi> \<circ> f)) \<in> (A \<rightarrow> B) \<rightarrow> A \<rightarrow> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<circ>) (inv \<pi>) \<in> (A \<rightarrow> B) \<rightarrow> A \<rightarrow> B
[PROOF STEP]
by (intro * permutes_inv) fact
[PROOF STATE]
proof (state)
this:
(\<circ>) (inv \<pi>) \<in> (A \<rightarrow> B) \<rightarrow> A \<rightarrow> B

goal (2 subgoals):
 1. \<And>x. x \<in> A \<rightarrow> B \<Longrightarrow> inv \<pi> \<circ> (\<pi> \<circ> x) = x
 2. \<And>y. y \<in> A \<rightarrow> B \<Longrightarrow> \<pi> \<circ> (inv \<pi> \<circ> y) = y
[PROOF STEP]
qed (auto simp: permutes_inverses[OF assms] fun_eq_iff)


[STATEMENT]
lemma Hadjicostas_Chapman_aux:
  fixes z :: real
  assumes z: "z > -1"
  defines "f \<equiv> (\<lambda>u. ((-ln u) powr z / (1 - u) * (-ln u + u - 1)))"
  shows   "(f has_integral (Gamma (z + 2) * (Re (zeta (z + 2)) - 1 / (z + 1)))) {0<..<1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_integral Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))) {0<..<1}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (f has_integral Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))) {0<..<1}
[PROOF STEP]
let ?I = "Gamma (z + 2) * (Re (zeta (z + 2)) - 1 / (z + 1))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (f has_integral Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))) {0<..<1}
[PROOF STEP]
have nonneg: "1 \<le> x + exp (- x)" if "x \<ge> 0" for x :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> x + exp (- x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 1 \<le> x + exp (- x)
[PROOF STEP]
have "x + (1 + (-x)) \<le> x + exp (-x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x + (1 + - x) \<le> x + exp (- x)
[PROOF STEP]
by (intro add_left_mono exp_ge_add_one_self)
[PROOF STATE]
proof (state)
this:
x + (1 + - x) \<le> x + exp (- x)

goal (1 subgoal):
 1. 1 \<le> x + exp (- x)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
x + (1 + - x) \<le> x + exp (- x)

goal (1 subgoal):
 1. 1 \<le> x + exp (- x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
1 \<le> x + exp (- x)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 \<le> ?x \<Longrightarrow> 1 \<le> ?x + exp (- ?x)

goal (1 subgoal):
 1. (f has_integral Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))) {0<..<1}
[PROOF STEP]
have eq: "((\<lambda>t::real. exp (-t)) ` {0<..}) = {0<..<1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>t. exp (- t)) ` {0<..} = {0<..<1}
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x t. 0 < t \<Longrightarrow> exp (- t) \<in> {0<..<1}
 2. \<And>x. x \<in> {0<..<1} \<Longrightarrow> x \<in> (\<lambda>t. exp (- t)) ` {0<..}
[PROOF STEP]
fix x :: real
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x t. 0 < t \<Longrightarrow> exp (- t) \<in> {0<..<1}
 2. \<And>x. x \<in> {0<..<1} \<Longrightarrow> x \<in> (\<lambda>t. exp (- t)) ` {0<..}
[PROOF STEP]
assume x: "x \<in> {0<..<1}"
[PROOF STATE]
proof (state)
this:
x \<in> {0<..<1}

goal (2 subgoals):
 1. \<And>x t. 0 < t \<Longrightarrow> exp (- t) \<in> {0<..<1}
 2. \<And>x. x \<in> {0<..<1} \<Longrightarrow> x \<in> (\<lambda>t. exp (- t)) ` {0<..}
[PROOF STEP]
hence "x = exp (-(-ln x))" and "-ln x \<in> {0<..}"
[PROOF STATE]
proof (prove)
using this:
x \<in> {0<..<1}

goal (1 subgoal):
 1. x = exp (- (- ln x)) &&& - ln x \<in> {0<..}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x = exp (- (- ln x))
- ln x \<in> {0<..}

goal (2 subgoals):
 1. \<And>x t. 0 < t \<Longrightarrow> exp (- t) \<in> {0<..<1}
 2. \<And>x. x \<in> {0<..<1} \<Longrightarrow> x \<in> (\<lambda>t. exp (- t)) ` {0<..}
[PROOF STEP]
thus "x \<in> (\<lambda>t. exp (-t)) ` {0<..}"
[PROOF STATE]
proof (prove)
using this:
x = exp (- (- ln x))
- ln x \<in> {0<..}

goal (1 subgoal):
 1. x \<in> (\<lambda>t. exp (- t)) ` {0<..}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<in> (\<lambda>t. exp (- t)) ` {0<..}

goal (1 subgoal):
 1. \<And>x t. 0 < t \<Longrightarrow> exp (- t) \<in> {0<..<1}
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
(\<lambda>t. exp (- t)) ` {0<..} = {0<..<1}

goal (1 subgoal):
 1. (f has_integral Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))) {0<..<1}
[PROOF STEP]
have I: "((\<lambda>x. x powr (z+1) / (exp x - 1) - x powr z / exp x) has_integral ?I) {0<..}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. x powr (z + 1) / (exp x - 1) - x powr z / exp x) has_integral Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))) {0<..}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>x. x powr (z + 1) / (exp x - 1) - x powr z / exp x) has_integral Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))) {0<..}
[PROOF STEP]
from z
[PROOF STATE]
proof (chain)
picking this:
- 1 < z
[PROOF STEP]
have "z + 1 \<notin> \<real>\<^sub>\<le>\<^sub>0"
[PROOF STATE]
proof (prove)
using this:
- 1 < z

goal (1 subgoal):
 1. z + 1 \<notin> \<real>\<^sub>\<le>\<^sub>0
[PROOF STEP]
by (auto simp: nonpos_Reals_def)
[PROOF STATE]
proof (state)
this:
z + 1 \<notin> \<real>\<^sub>\<le>\<^sub>0

goal (1 subgoal):
 1. ((\<lambda>x. x powr (z + 1) / (exp x - 1) - x powr z / exp x) has_integral Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))) {0<..}
[PROOF STEP]
hence z': "z + 1 \<notin> \<int>\<^sub>\<le>\<^sub>0"
[PROOF STATE]
proof (prove)
using this:
z + 1 \<notin> \<real>\<^sub>\<le>\<^sub>0

goal (1 subgoal):
 1. z + 1 \<notin> \<int>\<^sub>\<le>\<^sub>0
[PROOF STEP]
using nonpos_Ints_subset_nonpos_Reals
[PROOF STATE]
proof (prove)
using this:
z + 1 \<notin> \<real>\<^sub>\<le>\<^sub>0
\<int>\<^sub>\<le>\<^sub>0 \<subseteq> \<real>\<^sub>\<le>\<^sub>0

goal (1 subgoal):
 1. z + 1 \<notin> \<int>\<^sub>\<le>\<^sub>0
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
z + 1 \<notin> \<int>\<^sub>\<le>\<^sub>0

goal (1 subgoal):
 1. ((\<lambda>x. x powr (z + 1) / (exp x - 1) - x powr z / exp x) has_integral Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))) {0<..}
[PROOF STEP]
have "((\<lambda>x. x powr (z + 2 - 1) / (exp x - 1) - x powr (z + 1 - 1) / exp x)
            has_integral (Gamma (z + 2) * Re (zeta (z + 2)) - Gamma (z + 1))) {0<..}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. x powr (z + 2 - 1) / (exp x - 1) - x powr (z + 1 - 1) / exp x) has_integral Gamma (z + 2) * Re (zeta (complex_of_real (z + 2))) - Gamma (z + 1)) {0<..}
[PROOF STEP]
using z
[PROOF STATE]
proof (prove)
using this:
- 1 < z

goal (1 subgoal):
 1. ((\<lambda>x. x powr (z + 2 - 1) / (exp x - 1) - x powr (z + 1 - 1) / exp x) has_integral Gamma (z + 2) * Re (zeta (complex_of_real (z + 2))) - Gamma (z + 1)) {0<..}
[PROOF STEP]
by (intro has_integral_diff Gamma_integral_real' Gamma_times_zeta_has_integral_real) auto
[PROOF STATE]
proof (state)
this:
((\<lambda>x. x powr (z + 2 - 1) / (exp x - 1) - x powr (z + 1 - 1) / exp x) has_integral Gamma (z + 2) * Re (zeta (complex_of_real (z + 2))) - Gamma (z + 1)) {0<..}

goal (1 subgoal):
 1. ((\<lambda>x. x powr (z + 1) / (exp x - 1) - x powr z / exp x) has_integral Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))) {0<..}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<lambda>x. x powr (z + 2 - 1) / (exp x - 1) - x powr (z + 1 - 1) / exp x) has_integral Gamma (z + 2) * Re (zeta (complex_of_real (z + 2))) - Gamma (z + 1)) {0<..}

goal (1 subgoal):
 1. ((\<lambda>x. x powr (z + 1) / (exp x - 1) - x powr z / exp x) has_integral Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))) {0<..}
[PROOF STEP]
have "Gamma (z + 2) * Re (zeta (z + 2)) - Gamma (z + 1) =
                 Gamma (z + 2) * (Re (zeta (z + 2)) - 1 / (z + 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gamma (z + 2) * Re (zeta (complex_of_real (z + 2))) - Gamma (z + 1) = Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))
[PROOF STEP]
using Gamma_plus1[of "z+1"] z z'
[PROOF STATE]
proof (prove)
using this:
z + 1 \<notin> \<int>\<^sub>\<le>\<^sub>0 \<Longrightarrow> Gamma (z + 1 + 1) = (z + 1) * Gamma (z + 1)
- 1 < z
z + 1 \<notin> \<int>\<^sub>\<le>\<^sub>0

goal (1 subgoal):
 1. Gamma (z + 2) * Re (zeta (complex_of_real (z + 2))) - Gamma (z + 1) = Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))
[PROOF STEP]
by (auto simp: field_simps)
[PROOF STATE]
proof (state)
this:
Gamma (z + 2) * Re (zeta (complex_of_real (z + 2))) - Gamma (z + 1) = Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))

goal (1 subgoal):
 1. ((\<lambda>x. x powr (z + 1) / (exp x - 1) - x powr z / exp x) has_integral Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))) {0<..}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. x powr (z + 2 - 1) / (exp x - 1) - x powr (z + 1 - 1) / exp x) has_integral Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))) {0<..}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. x powr (z + 2 - 1) / (exp x - 1) - x powr (z + 1 - 1) / exp x) has_integral Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))) {0<..}

goal (1 subgoal):
 1. ((\<lambda>x. x powr (z + 1) / (exp x - 1) - x powr z / exp x) has_integral Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))) {0<..}
[PROOF STEP]
by (simp add: add_ac)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. x powr (z + 1) / (exp x - 1) - x powr z / exp x) has_integral Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))) {0<..}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
((\<lambda>x. x powr (z + 1) / (exp x - 1) - x powr z / exp x) has_integral Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))) {0<..}

goal (1 subgoal):
 1. (f has_integral Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))) {0<..<1}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<lambda>x. x powr (z + 1) / (exp x - 1) - x powr z / exp x) has_integral Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))) {0<..}

goal (1 subgoal):
 1. (f has_integral Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))) {0<..<1}
[PROOF STEP]
have "?this \<longleftrightarrow> ((\<lambda>x. \<bar>-exp (-x)\<bar> * f (exp (-x))) has_integral ?I) {0<..}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. x powr (z + 1) / (exp x - 1) - x powr z / exp x) has_integral Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))) {0<..} = ((\<lambda>x. \<bar>- exp (- x)\<bar> * f (exp (- x))) has_integral Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))) {0<..}
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. x powr (z + 1) / (exp x - 1) - x powr z / exp x) has_integral Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))) {0<..} = ((\<lambda>x. \<bar>- exp (- x)\<bar> * ((- ln (exp (- x))) powr z / (1 - exp (- x)) * (- ln (exp (- x)) + exp (- x) - 1))) has_integral Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))) {0<..}
[PROOF STEP]
apply (intro has_integral_cong)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> {0<..} \<Longrightarrow> x powr (z + 1) / (exp x - 1) - x powr z / exp x = \<bar>- exp (- x)\<bar> * ((- ln (exp (- x))) powr z / (1 - exp (- x)) * (- ln (exp (- x)) + exp (- x) - 1))
[PROOF STEP]
apply (auto simp: field_simps powr_add powr_def exp_add)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. 0 < x \<Longrightarrow> exp (z * ln x) + (x * (exp x * exp (z * ln x)) + (exp x * (exp x * (exp (- x) * exp (z * ln x))) + exp x * (exp (- x) * (exp (- x) * exp (z * ln x))))) = exp x * exp (z * ln x) + (exp (- x) * exp (z * ln x) + (x * (exp x * (exp x * (exp (- x) * exp (z * ln x)))) + exp x * (exp x * (exp (- x) * (exp (- x) * exp (z * ln x))))))
[PROOF STEP]
apply (simp flip: exp_add)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
((\<lambda>x. x powr (z + 1) / (exp x - 1) - x powr z / exp x) has_integral Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))) {0<..} = ((\<lambda>x. \<bar>- exp (- x)\<bar> * f (exp (- x))) has_integral Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))) {0<..}

goal (1 subgoal):
 1. (f has_integral Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))) {0<..<1}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. \<bar>- exp (- x)\<bar> * f (exp (- x))) has_integral Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))) {0<..}
[PROOF STEP]
have *: "((\<lambda>x. \<bar>-exp (-x)\<bar> * f (exp (-x))) has_integral ?I) {0<..}"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. \<bar>- exp (- x)\<bar> * f (exp (- x))) has_integral Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))) {0<..}

goal (1 subgoal):
 1. ((\<lambda>x. \<bar>- exp (- x)\<bar> * f (exp (- x))) has_integral Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))) {0<..}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<bar>- exp (- x)\<bar> * f (exp (- x))) has_integral Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))) {0<..}

goal (1 subgoal):
 1. (f has_integral Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))) {0<..<1}
[PROOF STEP]
have "((\<lambda>x. \<bar>-exp (-x)\<bar> *\<^sub>R f (exp (-x))) absolutely_integrable_on {0<..}) \<and>
                  integral {0<..} (\<lambda>x. \<bar>-exp (-x)\<bar> *\<^sub>R f (exp (-x))) = ?I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<bar>- exp (- x)\<bar> *\<^sub>R f (exp (- x))) absolutely_integrable_on {0<..} \<and> integral {0<..} (\<lambda>x. \<bar>- exp (- x)\<bar> *\<^sub>R f (exp (- x))) = Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))
[PROOF STEP]
proof (intro conjI nonnegative_absolutely_integrable_1)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. (\<lambda>x. \<bar>- exp (- x)\<bar> *\<^sub>R f (exp (- x))) integrable_on {0<..}
 2. \<And>x. x \<in> {0<..} \<Longrightarrow> 0 \<le> \<bar>- exp (- x)\<bar> *\<^sub>R f (exp (- x))
 3. integral {0<..} (\<lambda>x. \<bar>- exp (- x)\<bar> *\<^sub>R f (exp (- x))) = Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))
[PROOF STEP]
fix x :: real
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. (\<lambda>x. \<bar>- exp (- x)\<bar> *\<^sub>R f (exp (- x))) integrable_on {0<..}
 2. \<And>x. x \<in> {0<..} \<Longrightarrow> 0 \<le> \<bar>- exp (- x)\<bar> *\<^sub>R f (exp (- x))
 3. integral {0<..} (\<lambda>x. \<bar>- exp (- x)\<bar> *\<^sub>R f (exp (- x))) = Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))
[PROOF STEP]
assume x: "x \<in> {0<..}"
[PROOF STATE]
proof (state)
this:
x \<in> {0<..}

goal (3 subgoals):
 1. (\<lambda>x. \<bar>- exp (- x)\<bar> *\<^sub>R f (exp (- x))) integrable_on {0<..}
 2. \<And>x. x \<in> {0<..} \<Longrightarrow> 0 \<le> \<bar>- exp (- x)\<bar> *\<^sub>R f (exp (- x))
 3. integral {0<..} (\<lambda>x. \<bar>- exp (- x)\<bar> *\<^sub>R f (exp (- x))) = Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))
[PROOF STEP]
thus "\<bar>-exp (-x)\<bar> *\<^sub>R f (exp (-x)) \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
x \<in> {0<..}

goal (1 subgoal):
 1. 0 \<le> \<bar>- exp (- x)\<bar> *\<^sub>R f (exp (- x))
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
using this:
x \<in> {0<..}

goal (1 subgoal):
 1. 0 \<le> \<bar>- exp (- x)\<bar> *\<^sub>R ((- ln (exp (- x))) powr z / (1 - exp (- x)) * (- ln (exp (- x)) + exp (- x) - 1))
[PROOF STEP]
using nonneg
[PROOF STATE]
proof (prove)
using this:
x \<in> {0<..}
0 \<le> ?x \<Longrightarrow> 1 \<le> ?x + exp (- ?x)

goal (1 subgoal):
 1. 0 \<le> \<bar>- exp (- x)\<bar> *\<^sub>R ((- ln (exp (- x))) powr z / (1 - exp (- x)) * (- ln (exp (- x)) + exp (- x) - 1))
[PROOF STEP]
by (intro scaleR_nonneg_nonneg mult_nonneg_nonneg divide_nonneg_nonneg) auto
[PROOF STATE]
proof (state)
this:
0 \<le> \<bar>- exp (- x)\<bar> *\<^sub>R f (exp (- x))

goal (2 subgoals):
 1. (\<lambda>x. \<bar>- exp (- x)\<bar> *\<^sub>R f (exp (- x))) integrable_on {0<..}
 2. integral {0<..} (\<lambda>x. \<bar>- exp (- x)\<bar> *\<^sub>R f (exp (- x))) = Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))
[PROOF STEP]
qed (use * in \<open>simp_all add: has_integral_iff\<close>)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<bar>- exp (- x)\<bar> *\<^sub>R f (exp (- x))) absolutely_integrable_on {0<..} \<and> integral {0<..} (\<lambda>x. \<bar>- exp (- x)\<bar> *\<^sub>R f (exp (- x))) = Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))

goal (1 subgoal):
 1. (f has_integral Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))) {0<..<1}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<bar>- exp (- x)\<bar> *\<^sub>R f (exp (- x))) absolutely_integrable_on {0<..} \<and> integral {0<..} (\<lambda>x. \<bar>- exp (- x)\<bar> *\<^sub>R f (exp (- x))) = Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))

goal (1 subgoal):
 1. (f has_integral Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))) {0<..<1}
[PROOF STEP]
have "?this \<longleftrightarrow> f absolutely_integrable_on (\<lambda>x. exp (- x)) ` {0<..} \<and>
                       integral ((\<lambda>x. exp (- x)) ` {0<..}) f = ?I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. \<bar>- exp (- x)\<bar> *\<^sub>R f (exp (- x))) absolutely_integrable_on {0<..} \<and> integral {0<..} (\<lambda>x. \<bar>- exp (- x)\<bar> *\<^sub>R f (exp (- x))) = Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))) = (f absolutely_integrable_on (\<lambda>x. exp (- x)) ` {0<..} \<and> integral ((\<lambda>x. exp (- x)) ` {0<..}) f = Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1)))
[PROOF STEP]
by (intro has_absolute_integral_change_of_variables_1')
       (auto intro!: derivative_eq_intros inj_onI)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<bar>- exp (- x)\<bar> *\<^sub>R f (exp (- x))) absolutely_integrable_on {0<..} \<and> integral {0<..} (\<lambda>x. \<bar>- exp (- x)\<bar> *\<^sub>R f (exp (- x))) = Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))) = (f absolutely_integrable_on (\<lambda>x. exp (- x)) ` {0<..} \<and> integral ((\<lambda>x. exp (- x)) ` {0<..}) f = Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1)))

goal (1 subgoal):
 1. (f has_integral Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))) {0<..<1}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<bar>- exp (- x)\<bar> *\<^sub>R f (exp (- x))) absolutely_integrable_on {0<..} \<and> integral {0<..} (\<lambda>x. \<bar>- exp (- x)\<bar> *\<^sub>R f (exp (- x))) = Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))) = (f absolutely_integrable_on (\<lambda>x. exp (- x)) ` {0<..} \<and> integral ((\<lambda>x. exp (- x)) ` {0<..}) f = Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1)))

goal (1 subgoal):
 1. (f has_integral Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))) {0<..<1}
[PROOF STEP]
have "(\<lambda>x::real. exp (- x)) ` {0<..} = {0<..<1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. exp (- x)) ` {0<..} = {0<..<1}
[PROOF STEP]
by (fact eq)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. exp (- x)) ` {0<..} = {0<..<1}

goal (1 subgoal):
 1. (f has_integral Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))) {0<..<1}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
f absolutely_integrable_on {0<..<1} \<and> integral {0<..<1} f = Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))
[PROOF STEP]
show "(f has_integral ?I) {0<..<1}"
[PROOF STATE]
proof (prove)
using this:
f absolutely_integrable_on {0<..<1} \<and> integral {0<..<1} f = Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))

goal (1 subgoal):
 1. (f has_integral Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))) {0<..<1}
[PROOF STEP]
by (auto simp: has_integral_iff dest: set_lebesgue_integral_eq_integral)
[PROOF STATE]
proof (state)
this:
(f has_integral Gamma (z + 2) * (Re (zeta (complex_of_real (z + 2))) - 1 / (z + 1))) {0<..<1}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eval_liftFm :
  assumes "length I = amount"
  assumes "length L \<ge> d"
  shows "eval F L = eval (liftFm d amount F) (insert_into L d I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval F L = eval (liftFm d amount F) (insert_into L d I)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. eval F L = eval (liftFm d amount F) (insert_into L d I)
[PROOF STEP]
define init where "init = take d L"
[PROOF STATE]
proof (state)
this:
init = take d L

goal (1 subgoal):
 1. eval F L = eval (liftFm d amount F) (insert_into L d I)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
init = take d L
[PROOF STEP]
have "length init = d"
[PROOF STATE]
proof (prove)
using this:
init = take d L

goal (1 subgoal):
 1. length init = d
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
init = take d L
length I = amount
d \<le> length L

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

goal (1 subgoal):
 1. eval F L = eval (liftFm d amount F) (insert_into L d I)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
length init = d
[PROOF STEP]
have "(eval F (init @ (drop d L)) = eval (liftFm d amount F) (init @ I @ (drop d L)))"
[PROOF STATE]
proof (prove)
using this:
length init = d

goal (1 subgoal):
 1. eval F (init @ drop d L) = eval (liftFm d amount F) (init @ I @ drop d L)
[PROOF STEP]
using eval_liftFm_helper[of init d I amount  F "(drop d L)"] assms
[PROOF STATE]
proof (prove)
using this:
length init = d
\<lbrakk>length init = d; length I = amount\<rbrakk> \<Longrightarrow> eval F (init @ drop d L) = eval (liftFm d amount F) (init @ I @ drop d L)
length I = amount
d \<le> length L

goal (1 subgoal):
 1. eval F (init @ drop d L) = eval (liftFm d amount F) (init @ I @ drop d L)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
eval F (init @ drop d L) = eval (liftFm d amount F) (init @ I @ drop d L)

goal (1 subgoal):
 1. eval F L = eval (liftFm d amount F) (insert_into L d I)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
eval F (init @ drop d L) = eval (liftFm d amount F) (init @ I @ drop d L)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
eval F (init @ drop d L) = eval (liftFm d amount F) (init @ I @ drop d L)

goal (1 subgoal):
 1. eval F L = eval (liftFm d amount F) (insert_into L d I)
[PROOF STEP]
unfolding insert_into.simps assms init_def
[PROOF STATE]
proof (prove)
using this:
eval F (take d L @ drop d L) = eval (liftFm d amount F) (take d L @ I @ drop d L)

goal (1 subgoal):
 1. eval F L = eval (liftFm d amount F) (take d L @ I @ drop d L)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
eval F L = eval (liftFm d amount F) (insert_into L d I)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma deleteMin_mset:
  assumes "queue_invar q"
    and "queue_to_multiset q \<noteq> {#}"
  shows "queue_to_multiset (deleteMin q) = queue_to_multiset q - {# (findMin q) #}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. queue_to_multiset (deleteMin q) = queue_to_multiset q - {#findMin q#}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. queue_to_multiset (deleteMin q) = queue_to_multiset q - {#findMin q#}
[PROOF STEP]
from assms(2)
[PROOF STATE]
proof (chain)
picking this:
queue_to_multiset q \<noteq> {#}
[PROOF STEP]
have q_ne: "q \<noteq> []"
[PROOF STATE]
proof (prove)
using this:
queue_to_multiset q \<noteq> {#}

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

goal (1 subgoal):
 1. queue_to_multiset (deleteMin q) = queue_to_multiset q - {#findMin q#}
[PROOF STEP]
with mintree_exists[of q]
[PROOF STATE]
proof (chain)
picking this:
(q \<noteq> []) = (getMinTree q \<in> set q)
q \<noteq> []
[PROOF STEP]
have min_in_q: "getMinTree q \<in> set q"
[PROOF STATE]
proof (prove)
using this:
(q \<noteq> []) = (getMinTree q \<in> set q)
q \<noteq> []

goal (1 subgoal):
 1. getMinTree q \<in> set q
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
getMinTree q \<in> set q

goal (1 subgoal):
 1. queue_to_multiset (deleteMin q) = queue_to_multiset q - {#findMin q#}
[PROOF STEP]
with assms(1)
[PROOF STATE]
proof (chain)
picking this:
queue_invar q
getMinTree q \<in> set q
[PROOF STEP]
have inv_min: "tree_invar (getMinTree q)"
[PROOF STATE]
proof (prove)
using this:
queue_invar q
getMinTree q \<in> set q

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

goal (1 subgoal):
 1. queue_to_multiset (deleteMin q) = queue_to_multiset q - {#findMin q#}
[PROOF STEP]
note inv_rem = invar_remove1[OF assms(1), of "getMinTree q"]
[PROOF STATE]
proof (state)
this:
queue_invar (remove1 (getMinTree q) q)

goal (1 subgoal):
 1. queue_to_multiset (deleteMin q) = queue_to_multiset q - {#findMin q#}
[PROOF STEP]
note inv_children = invar_children'[OF inv_min]
[PROOF STATE]
proof (state)
this:
queue_invar (children (getMinTree q))

goal (1 subgoal):
 1. queue_to_multiset (deleteMin q) = queue_to_multiset q - {#findMin q#}
[PROOF STEP]
note inv_filter = invar_filter[OF inv_children, of "\<lambda>t. 0 < rank t"]
[PROOF STATE]
proof (state)
this:
queue_invar (filter (\<lambda>t. 0 < rank t) (children (getMinTree q)))

goal (1 subgoal):
 1. queue_to_multiset (deleteMin q) = queue_to_multiset q - {#findMin q#}
[PROOF STEP]
note inv_rev = iffD2[OF invar_rev inv_filter]
[PROOF STATE]
proof (state)
this:
queue_invar (rev (filter (\<lambda>t. 0 < rank t) (children (getMinTree q))))

goal (1 subgoal):
 1. queue_to_multiset (deleteMin q) = queue_to_multiset q - {#findMin q#}
[PROOF STEP]
note inv_meld = meld_queue_invar[OF inv_rev inv_rem]
[PROOF STATE]
proof (state)
this:
queue_invar (meld (rev (filter (\<lambda>t. 0 < rank t) (children (getMinTree q)))) (remove1 (getMinTree q) q))

goal (1 subgoal):
 1. queue_to_multiset (deleteMin q) = queue_to_multiset q - {#findMin q#}
[PROOF STEP]
note mset_rem = mset_remove1[OF min_in_q]
[PROOF STATE]
proof (state)
this:
queue_to_multiset (remove1 (getMinTree q) q) = queue_to_multiset q - tree_to_multiset (getMinTree q)

goal (1 subgoal):
 1. queue_to_multiset (deleteMin q) = queue_to_multiset q - {#findMin q#}
[PROOF STEP]
note mset_rev = mset_rev[of "[t\<leftarrow>children (getMinTree q). 0 < rank t]"]
[PROOF STATE]
proof (state)
this:
queue_to_multiset (rev (filter (\<lambda>t. 0 < rank t) (children (getMinTree q)))) = queue_to_multiset (filter (\<lambda>t. 0 < rank t) (children (getMinTree q)))

goal (1 subgoal):
 1. queue_to_multiset (deleteMin q) = queue_to_multiset q - {#findMin q#}
[PROOF STEP]
note mset_meld = meld_mset[OF inv_rev inv_rem]
[PROOF STATE]
proof (state)
this:
queue_to_multiset (meld (rev (filter (\<lambda>t. 0 < rank t) (children (getMinTree q)))) (remove1 (getMinTree q) q)) = queue_to_multiset (rev (filter (\<lambda>t. 0 < rank t) (children (getMinTree q)))) + queue_to_multiset (remove1 (getMinTree q) q)

goal (1 subgoal):
 1. queue_to_multiset (deleteMin q) = queue_to_multiset q - {#findMin q#}
[PROOF STEP]
note mset_children = mset_children[of "getMinTree q"]
[PROOF STATE]
proof (state)
this:
queue_to_multiset (children (getMinTree q)) = tree_to_multiset (getMinTree q) - {#(val (getMinTree q), prio (getMinTree q))#}

goal (1 subgoal):
 1. queue_to_multiset (deleteMin q) = queue_to_multiset q - {#findMin q#}
[PROOF STEP]
thm mset_insertList[of "[t\<leftarrow>children (getMinTree q) .
             rank t = 0]"]
[PROOF STATE]
proof (state)
this:
queue_to_multiset (children (getMinTree q)) = tree_to_multiset (getMinTree q) - {#(val (getMinTree q), prio (getMinTree q))#}

goal (1 subgoal):
 1. queue_to_multiset (deleteMin q) = queue_to_multiset q - {#findMin q#}
[PROOF STEP]
have "\<lbrakk>tree_invar t; rank t = 0\<rbrakk> \<Longrightarrow> children t = []" for t
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>tree_invar t; rank t = 0\<rbrakk> \<Longrightarrow> children t = []
[PROOF STEP]
by (cases t) simp
[PROOF STATE]
proof (state)
this:
\<lbrakk>tree_invar ?t1; rank ?t1 = 0\<rbrakk> \<Longrightarrow> children ?t1 = []

goal (1 subgoal):
 1. queue_to_multiset (deleteMin q) = queue_to_multiset q - {#findMin q#}
[PROOF STEP]
with inv_children
[PROOF STATE]
proof (chain)
picking this:
queue_invar (children (getMinTree q))
\<lbrakk>tree_invar ?t1; rank ?t1 = 0\<rbrakk> \<Longrightarrow> children ?t1 = []
[PROOF STEP]
have ball_min: "\<forall>t\<in>set [t\<leftarrow>children (getMinTree q). rank t = 0].
    rank t = 0 \<and> children t = []"
[PROOF STATE]
proof (prove)
using this:
queue_invar (children (getMinTree q))
\<lbrakk>tree_invar ?t1; rank ?t1 = 0\<rbrakk> \<Longrightarrow> children ?t1 = []

goal (1 subgoal):
 1. \<forall>t\<in>set (filter (\<lambda>t. rank t = 0) (children (getMinTree q))). rank t = 0 \<and> children t = []
[PROOF STEP]
by (unfold queue_invar_def) auto
[PROOF STATE]
proof (state)
this:
\<forall>t\<in>set (filter (\<lambda>t. rank t = 0) (children (getMinTree q))). rank t = 0 \<and> children t = []

goal (1 subgoal):
 1. queue_to_multiset (deleteMin q) = queue_to_multiset q - {#findMin q#}
[PROOF STEP]
note mset_insertList = mset_insertList[OF ball_min inv_meld]
[PROOF STATE]
proof (state)
this:
queue_to_multiset (insertList (filter (\<lambda>t. rank t = 0) (children (getMinTree q))) (meld (rev (filter (\<lambda>t. 0 < rank t) (children (getMinTree q)))) (remove1 (getMinTree q) q))) = queue_to_multiset (filter (\<lambda>t. rank t = 0) (children (getMinTree q))) + queue_to_multiset (meld (rev (filter (\<lambda>t. 0 < rank t) (children (getMinTree q)))) (remove1 (getMinTree q) q))

goal (1 subgoal):
 1. queue_to_multiset (deleteMin q) = queue_to_multiset q - {#findMin q#}
[PROOF STEP]
note mset_filter = mset_filter[of "children (getMinTree q)"]
[PROOF STATE]
proof (state)
this:
queue_to_multiset (filter (\<lambda>t. rank t = 0) (children (getMinTree q))) + queue_to_multiset (filter (\<lambda>t. 0 < rank t) (children (getMinTree q))) = queue_to_multiset (children (getMinTree q))

goal (1 subgoal):
 1. queue_to_multiset (deleteMin q) = queue_to_multiset q - {#findMin q#}
[PROOF STEP]
let ?Q = "queue_to_multiset q"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. queue_to_multiset (deleteMin q) = queue_to_multiset q - {#findMin q#}
[PROOF STEP]
let ?MT = "tree_to_multiset (getMinTree q)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. queue_to_multiset (deleteMin q) = queue_to_multiset q - {#findMin q#}
[PROOF STEP]
from q_ne
[PROOF STATE]
proof (chain)
picking this:
q \<noteq> []
[PROOF STEP]
have head_subset_min:
    "{# (val (getMinTree q), prio (getMinTree q)) #} \<subseteq># ?MT"
[PROOF STATE]
proof (prove)
using this:
q \<noteq> []

goal (1 subgoal):
 1. {#(val (getMinTree q), prio (getMinTree q))#} \<subseteq># tree_to_multiset (getMinTree q)
[PROOF STEP]
by(cases "getMinTree q") simp
[PROOF STATE]
proof (state)
this:
{#(val (getMinTree q), prio (getMinTree q))#} \<subseteq># tree_to_multiset (getMinTree q)

goal (1 subgoal):
 1. queue_to_multiset (deleteMin q) = queue_to_multiset q - {#findMin q#}
[PROOF STEP]
note min_subset_q = in_set_subset[OF min_in_q]
[PROOF STATE]
proof (state)
this:
tree_to_multiset (getMinTree q) \<subseteq># queue_to_multiset q

goal (1 subgoal):
 1. queue_to_multiset (deleteMin q) = queue_to_multiset q - {#findMin q#}
[PROOF STEP]
from mset_insertList mset_meld mset_rev mset_rem mset_filter mset_children
    multiset_diff_union_assoc[OF head_subset_min, of "?Q - ?MT"]
    mset_subset_eq_multiset_union_diff_commute[OF min_subset_q, of "?MT"]
[PROOF STATE]
proof (chain)
picking this:
queue_to_multiset (insertList (filter (\<lambda>t. rank t = 0) (children (getMinTree q))) (meld (rev (filter (\<lambda>t. 0 < rank t) (children (getMinTree q)))) (remove1 (getMinTree q) q))) = queue_to_multiset (filter (\<lambda>t. rank t = 0) (children (getMinTree q))) + queue_to_multiset (meld (rev (filter (\<lambda>t. 0 < rank t) (children (getMinTree q)))) (remove1 (getMinTree q) q))
queue_to_multiset (meld (rev (filter (\<lambda>t. 0 < rank t) (children (getMinTree q)))) (remove1 (getMinTree q) q)) = queue_to_multiset (rev (filter (\<lambda>t. 0 < rank t) (children (getMinTree q)))) + queue_to_multiset (remove1 (getMinTree q) q)
queue_to_multiset (rev (filter (\<lambda>t. 0 < rank t) (children (getMinTree q)))) = queue_to_multiset (filter (\<lambda>t. 0 < rank t) (children (getMinTree q)))
queue_to_multiset (remove1 (getMinTree q) q) = queue_to_multiset q - tree_to_multiset (getMinTree q)
queue_to_multiset (filter (\<lambda>t. rank t = 0) (children (getMinTree q))) + queue_to_multiset (filter (\<lambda>t. 0 < rank t) (children (getMinTree q))) = queue_to_multiset (children (getMinTree q))
queue_to_multiset (children (getMinTree q)) = tree_to_multiset (getMinTree q) - {#(val (getMinTree q), prio (getMinTree q))#}
queue_to_multiset q - tree_to_multiset (getMinTree q) + tree_to_multiset (getMinTree q) - {#(val (getMinTree q), prio (getMinTree q))#} = queue_to_multiset q - tree_to_multiset (getMinTree q) + (tree_to_multiset (getMinTree q) - {#(val (getMinTree q), prio (getMinTree q))#})
queue_to_multiset q - tree_to_multiset (getMinTree q) + tree_to_multiset (getMinTree q) = queue_to_multiset q + tree_to_multiset (getMinTree q) - tree_to_multiset (getMinTree q)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
queue_to_multiset (insertList (filter (\<lambda>t. rank t = 0) (children (getMinTree q))) (meld (rev (filter (\<lambda>t. 0 < rank t) (children (getMinTree q)))) (remove1 (getMinTree q) q))) = queue_to_multiset (filter (\<lambda>t. rank t = 0) (children (getMinTree q))) + queue_to_multiset (meld (rev (filter (\<lambda>t. 0 < rank t) (children (getMinTree q)))) (remove1 (getMinTree q) q))
queue_to_multiset (meld (rev (filter (\<lambda>t. 0 < rank t) (children (getMinTree q)))) (remove1 (getMinTree q) q)) = queue_to_multiset (rev (filter (\<lambda>t. 0 < rank t) (children (getMinTree q)))) + queue_to_multiset (remove1 (getMinTree q) q)
queue_to_multiset (rev (filter (\<lambda>t. 0 < rank t) (children (getMinTree q)))) = queue_to_multiset (filter (\<lambda>t. 0 < rank t) (children (getMinTree q)))
queue_to_multiset (remove1 (getMinTree q) q) = queue_to_multiset q - tree_to_multiset (getMinTree q)
queue_to_multiset (filter (\<lambda>t. rank t = 0) (children (getMinTree q))) + queue_to_multiset (filter (\<lambda>t. 0 < rank t) (children (getMinTree q))) = queue_to_multiset (children (getMinTree q))
queue_to_multiset (children (getMinTree q)) = tree_to_multiset (getMinTree q) - {#(val (getMinTree q), prio (getMinTree q))#}
queue_to_multiset q - tree_to_multiset (getMinTree q) + tree_to_multiset (getMinTree q) - {#(val (getMinTree q), prio (getMinTree q))#} = queue_to_multiset q - tree_to_multiset (getMinTree q) + (tree_to_multiset (getMinTree q) - {#(val (getMinTree q), prio (getMinTree q))#})
queue_to_multiset q - tree_to_multiset (getMinTree q) + tree_to_multiset (getMinTree q) = queue_to_multiset q + tree_to_multiset (getMinTree q) - tree_to_multiset (getMinTree q)

goal (1 subgoal):
 1. queue_to_multiset (deleteMin q) = queue_to_multiset q - {#findMin q#}
[PROOF STEP]
by (auto simp add: deleteMin_def Let_def union_ac findMin_def)
[PROOF STATE]
proof (state)
this:
queue_to_multiset (deleteMin q) = queue_to_multiset q - {#findMin q#}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eventually_going_to_nhds:
  "eventually P (f going_to nhds a within A) \<longleftrightarrow>
     (\<exists>S. open S \<and> a \<in> S \<and> (\<forall>x\<in>A. f x \<in> S \<longrightarrow> P x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eventually P (f going_to nhds a within A) = (\<exists>S. open S \<and> a \<in> S \<and> (\<forall>x\<in>A. f x \<in> S \<longrightarrow> P x))
[PROOF STEP]
unfolding going_to_within_def eventually_filtercomap eventually_inf_principal
    eventually_nhds
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>Q. (\<exists>S. open S \<and> a \<in> S \<and> Ball S Q) \<and> (\<forall>x. Q (f x) \<longrightarrow> x \<in> A \<longrightarrow> P x)) = (\<exists>S. open S \<and> a \<in> S \<and> (\<forall>x\<in>A. f x \<in> S \<longrightarrow> P x))
[PROOF STEP]
by fast


[STATEMENT]
lemma ordinal_of_nat_less [simp]:
"(ordinal_of_nat x < ordinal_of_nat y) = (x < y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ordinal_of_nat x < ordinal_of_nat y) = (x < y)
[PROOF STEP]
by (rule strict_mono_cancel_less[OF strict_mono_ordinal_of_nat])


[STATEMENT]
lemma sorted_inorder_list_subtrees:
  "sorted_less (inorder_list ts) \<Longrightarrow> \<forall> sub \<in> set (subtrees ts). sorted_less (inorder sub)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted_less (inorder_list ts) \<Longrightarrow> \<forall>sub\<in>set (subtrees ts). sorted_less (inorder sub)
[PROOF STEP]
apply(induction ts)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. sorted_less (inorder_list []) \<Longrightarrow> \<forall>sub\<in>set (subtrees []). sorted_less (inorder sub)
 2. \<And>a ts. \<lbrakk>sorted_less (inorder_list ts) \<Longrightarrow> \<forall>sub\<in>set (subtrees ts). sorted_less (inorder sub); sorted_less (inorder_list (a # ts))\<rbrakk> \<Longrightarrow> \<forall>sub\<in>set (subtrees (a # ts)). sorted_less (inorder sub)
[PROOF STEP]
apply (auto simp add: sorted_lems)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma integrableD[dest]:
  assumes "integrable M f"
  shows "f \<in> borel_measurable M" "(\<integral>\<^sup>+ x. ennreal (f x) \<partial>M) \<noteq> \<infinity>" "(\<integral>\<^sup>+ x. ennreal (- f x) \<partial>M) \<noteq> \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> borel_measurable M &&& \<integral>\<^sup>+ x. ennreal (f x) \<partial>M \<noteq> \<infinity> &&& \<integral>\<^sup>+ x. ennreal (- f x) \<partial>M \<noteq> \<infinity>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
integrable M f

goal (1 subgoal):
 1. f \<in> borel_measurable M &&& \<integral>\<^sup>+ x. ennreal (f x) \<partial>M \<noteq> \<infinity> &&& \<integral>\<^sup>+ x. ennreal (- f x) \<partial>M \<noteq> \<infinity>
[PROOF STEP]
unfolding real_integrable_def
[PROOF STATE]
proof (prove)
using this:
f \<in> borel_measurable M \<and> \<integral>\<^sup>+ x. ennreal (f x) \<partial>M \<noteq> \<infinity> \<and> \<integral>\<^sup>+ x. ennreal (- f x) \<partial>M \<noteq> \<infinity>

goal (1 subgoal):
 1. f \<in> borel_measurable M &&& \<integral>\<^sup>+ x. ennreal (f x) \<partial>M \<noteq> \<infinity> &&& \<integral>\<^sup>+ x. ennreal (- f x) \<partial>M \<noteq> \<infinity>
[PROOF STEP]
by auto


[STATEMENT]
lemma lfp_Siml:
  assumes A: "\<And> X. (X \<preceq>S Q) \<Longrightarrow> ((P X) \<preceq>S Q)" and B: "mono P"
  shows "(lfp P) \<preceq>S Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lfp P \<preceq>S Q
[PROOF STEP]
apply (rule lfp_ordinal_induct, auto simp: B A)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>M. \<forall>Sa\<in>M. Sa \<preceq>S Q \<Longrightarrow> Sup M \<preceq>S Q
[PROOF STEP]
apply (auto simp add: Simulation_def Sup_action relation_of_bot relation_of_Sup[simplified])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. action.relation_of Q (a, b) \<Longrightarrow> R true (Simul S a, Simul S b)
[PROOF STEP]
apply (subst (asm) CSP_is_rd[OF relation_of_CSP])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. R (\<not> action.relation_of Q\<^sup>f\<^sub>f \<turnstile> action.relation_of Q\<^sup>t\<^sub>f) (a, b) \<Longrightarrow> R true (Simul S a, Simul S b)
[PROOF STEP]
apply (auto simp: rp_defs fun_eq_iff Simul_def alpha_rp.defs decrease_def split: cond_splits)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma min_Length_fMax[simp]: "x |\<in>| m1\<^bsup>\<AA>\<^esup>k \<Longrightarrow> min (Length \<AA>) (fMax (m1\<^bsup>\<AA>\<^esup>k)) = fMax (m1\<^bsup>\<AA>\<^esup>k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x |\<in>| m1\<^bsup>\<AA>\<^esup>k \<Longrightarrow> min (Length \<AA>) (fMax (m1\<^bsup>\<AA>\<^esup>k)) = fMax (m1\<^bsup>\<AA>\<^esup>k)
[PROOF STEP]
using fMax_less_Length[of x m1 \<AA> k]
[PROOF STATE]
proof (prove)
using this:
x |\<in>| m1\<^bsup>\<AA>\<^esup>k \<Longrightarrow> fMax (m1\<^bsup>\<AA>\<^esup>k) < Length \<AA>

goal (1 subgoal):
 1. x |\<in>| m1\<^bsup>\<AA>\<^esup>k \<Longrightarrow> min (Length \<AA>) (fMax (m1\<^bsup>\<AA>\<^esup>k)) = fMax (m1\<^bsup>\<AA>\<^esup>k)
[PROOF STEP]
unfolding fMax_def
[PROOF STATE]
proof (prove)
using this:
x |\<in>| m1\<^bsup>\<AA>\<^esup>k \<Longrightarrow> semilattice_fset.F max (m1\<^bsup>\<AA>\<^esup>k) < Length \<AA>

goal (1 subgoal):
 1. x |\<in>| m1\<^bsup>\<AA>\<^esup>k \<Longrightarrow> min (Length \<AA>) (semilattice_fset.F max (m1\<^bsup>\<AA>\<^esup>k)) = semilattice_fset.F max (m1\<^bsup>\<AA>\<^esup>k)
[PROOF STEP]
by auto


[STATEMENT]
lemma hypreal_inverse_sqrt_pow2:
     "0 < x \<Longrightarrow> inverse (( *f* sqrt)(x)) ^ 2 = inverse x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x \<Longrightarrow> (inverse ((*f* sqrt) x))\<^sup>2 = inverse x
[PROOF STEP]
by (simp add: hypreal_sqrt_gt_zero_pow2 power_inverse)


[STATEMENT]
lemma (in cring)
  assumes "a \<in> carrier R" "b \<in> carrier R" "c \<in> carrier R"
  shows "a \<otimes> b \<oplus> a \<otimes> c = a \<otimes> (b \<oplus> c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<otimes> b \<oplus> a \<otimes> c = a \<otimes> (b \<oplus> c)
[PROOF STEP]
by ring


[STATEMENT]
lemma "\<exists>(x::'a::linordered_field) y. \<forall>z\<ge>0. \<bar>3 * x + 7 * y\<bar> \<le> 2 * z + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x y. \<forall>z\<ge>0::'a. \<bar>(3::'a) * x + (7::'a) * y\<bar> \<le> (2::'a) * z + (1::'a)
[PROOF STEP]
by ferrack


[STATEMENT]
lemma integral_shift:
  fixes f :: "real \<Rightarrow> 'a::euclidean_space"
  assumes cont: "continuous_on {a + c..b + c} f"
  shows "integral {a..b} (f \<circ> (\<lambda>x. x + c)) = integral {a + c..b + c} f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral {a..b} (f \<circ> (\<lambda>x. x + c)) = integral {a + c..b + c} f
[PROOF STEP]
proof (cases "a \<le> b")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a \<le> b \<Longrightarrow> integral {a..b} (f \<circ> (\<lambda>x. x + c)) = integral {a + c..b + c} f
 2. \<not> a \<le> b \<Longrightarrow> integral {a..b} (f \<circ> (\<lambda>x. x + c)) = integral {a + c..b + c} f
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
a \<le> b

goal (2 subgoals):
 1. a \<le> b \<Longrightarrow> integral {a..b} (f \<circ> (\<lambda>x. x + c)) = integral {a + c..b + c} f
 2. \<not> a \<le> b \<Longrightarrow> integral {a..b} (f \<circ> (\<lambda>x. x + c)) = integral {a + c..b + c} f
[PROOF STEP]
have "((\<lambda>x. 1 *\<^sub>R f (x + c)) has_integral integral {a+c..b+c} f) {a..b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. 1 *\<^sub>R f (x + c)) has_integral integral {a + c..b + c} f) {a..b}
[PROOF STEP]
using True cont
[PROOF STATE]
proof (prove)
using this:
a \<le> b
continuous_on {a + c..b + c} f

goal (1 subgoal):
 1. ((\<lambda>x. 1 *\<^sub>R f (x + c)) has_integral integral {a + c..b + c} f) {a..b}
[PROOF STEP]
by (intro has_integral_substitution[where c = "a + c" and d = "b + c"])
       (auto intro!: derivative_eq_intros)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. 1 *\<^sub>R f (x + c)) has_integral integral {a + c..b + c} f) {a..b}

goal (2 subgoals):
 1. a \<le> b \<Longrightarrow> integral {a..b} (f \<circ> (\<lambda>x. x + c)) = integral {a + c..b + c} f
 2. \<not> a \<le> b \<Longrightarrow> integral {a..b} (f \<circ> (\<lambda>x. x + c)) = integral {a + c..b + c} f
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. 1 *\<^sub>R f (x + c)) has_integral integral {a + c..b + c} f) {a..b}

goal (1 subgoal):
 1. integral {a..b} (f \<circ> (\<lambda>x. x + c)) = integral {a + c..b + c} f
[PROOF STEP]
by (simp add: has_integral_iff o_def)
[PROOF STATE]
proof (state)
this:
integral {a..b} (f \<circ> (\<lambda>x. x + c)) = integral {a + c..b + c} f

goal (1 subgoal):
 1. \<not> a \<le> b \<Longrightarrow> integral {a..b} (f \<circ> (\<lambda>x. x + c)) = integral {a + c..b + c} f
[PROOF STEP]
qed auto


[STATEMENT]
lemma dagger_subdist_var_3: "x\<^sup>\<dagger> \<cdot> y\<^sup>\<dagger> \<le> (x + y)\<^sup>\<dagger>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x\<^sup>\<dagger> \<cdot> y\<^sup>\<dagger> \<le> (x + y)\<^sup>\<dagger>
[PROOF STEP]
using local.dagger_subdist_var local.mult_isol_var
[PROOF STATE]
proof (prove)
using this:
?x\<^sup>\<dagger> + ?y\<^sup>\<dagger> \<le> (?x + ?y)\<^sup>\<dagger>
\<lbrakk>?u \<le> ?x; ?v \<le> ?y\<rbrakk> \<Longrightarrow> ?u \<cdot> ?v \<le> ?x \<cdot> ?y

goal (1 subgoal):
 1. x\<^sup>\<dagger> \<cdot> y\<^sup>\<dagger> \<le> (x + y)\<^sup>\<dagger>
[PROOF STEP]
by fastforce


[STATEMENT]
lemma simply_connected_eq_Borsukian:
  fixes S :: "complex set"
  shows "open S \<Longrightarrow> (simply_connected S \<longleftrightarrow> connected S \<and> Borsukian S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open S \<Longrightarrow> simply_connected S = (connected S \<and> Borsukian S)
[PROOF STEP]
by (auto simp: simply_connected_eq_continuous_log Borsukian_continuous_logarithm)


[STATEMENT]
lemma lborel_real_affine:
  "c \<noteq> 0 \<Longrightarrow> lborel = density (distr lborel borel (\<lambda>x. t + c * x)) (\<lambda>_. ennreal (abs c))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<noteq> 0 \<Longrightarrow> lborel = density (distr lborel borel (\<lambda>x. t + c * x)) (\<lambda>_. ennreal \<bar>c\<bar>)
[PROOF STEP]
using lborel_affine[of c t]
[PROOF STATE]
proof (prove)
using this:
c \<noteq> 0 \<Longrightarrow> lborel = density (distr lborel borel (\<lambda>x. t + c *\<^sub>R x)) (\<lambda>x. ennreal (\<bar>c\<bar> ^ DIM(real)))

goal (1 subgoal):
 1. c \<noteq> 0 \<Longrightarrow> lborel = density (distr lborel borel (\<lambda>x. t + c * x)) (\<lambda>_. ennreal \<bar>c\<bar>)
[PROOF STEP]
by simp


[STATEMENT]
lemma const_smallo_inverse_powr:
  assumes "filterlim f at_top at_top"
  shows "(\<lambda>_ :: _ :: linorder. c :: real) \<in> o(\<lambda>x. inverse (f x powr p)) \<longleftrightarrow> (p \<ge> 0 \<longrightarrow> c = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
[PROOF STEP]
proof(cases p "0 :: real" rule: linorder_cases)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. p < 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
 2. p = 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
 3. 0 < p \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
[PROOF STEP]
case p: greater
[PROOF STATE]
proof (state)
this:
0 < p

goal (3 subgoals):
 1. p < 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
 2. p = 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
 3. 0 < p \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
[PROOF STEP]
have "(\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p)) \<longleftrightarrow> (\<lambda>_. \<bar>c\<bar>) \<in> o(\<lambda>x. inverse (f x powr p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = ((\<lambda>_. \<bar>c\<bar>) \<in> o(\<lambda>x. inverse (f x powr p)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = ((\<lambda>_. \<bar>c\<bar>) \<in> o(\<lambda>x. inverse (f x powr p)))

goal (3 subgoals):
 1. p < 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
 2. p = 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
 3. 0 < p \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = ((\<lambda>_. \<bar>c\<bar>) \<in> o(\<lambda>x. inverse (f x powr p)))

goal (3 subgoals):
 1. p < 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
 2. p = 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
 3. 0 < p \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
[PROOF STEP]
have "\<bar>c\<bar> = \<bar>(\<bar>c\<bar> powr (inverse p))\<bar> powr p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>c\<bar> = \<bar>\<bar>c\<bar> powr inverse p\<bar> powr p
[PROOF STEP]
using p
[PROOF STATE]
proof (prove)
using this:
0 < p

goal (1 subgoal):
 1. \<bar>c\<bar> = \<bar>\<bar>c\<bar> powr inverse p\<bar> powr p
[PROOF STEP]
by(simp add: powr_powr)
[PROOF STATE]
proof (state)
this:
\<bar>c\<bar> = \<bar>\<bar>c\<bar> powr inverse p\<bar> powr p

goal (3 subgoals):
 1. p < 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
 2. p = 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
 3. 0 < p \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<bar>c\<bar> = \<bar>\<bar>c\<bar> powr inverse p\<bar> powr p

goal (3 subgoals):
 1. p < 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
 2. p = 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
 3. 0 < p \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
\<bar>c\<bar> = \<bar>\<bar>c\<bar> powr inverse p\<bar> powr p

goal (3 subgoals):
 1. p < 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
 2. p = 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
 3. 0 < p \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
[PROOF STEP]
have "eventually (\<lambda>x. f x \<ge> 0) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. 0 \<le> f x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
filterlim f at_top at_top

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

goal (3 subgoals):
 1. p < 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
 2. p = 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
 3. 0 < p \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in at_top. 0 \<le> f x
[PROOF STEP]
have "o(\<lambda>x. inverse (f x powr p)) = o(\<lambda>x. \<bar>inverse (f x)\<bar> powr p)"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. 0 \<le> f x

goal (1 subgoal):
 1. o(\<lambda>x. inverse (f x powr p)) = o(\<lambda>x. \<bar>inverse (f x)\<bar> powr p)
[PROOF STEP]
by(intro landau_o.small.cong)(auto elim!: eventually_rev_mp)
[PROOF STATE]
proof (state)
this:
o(\<lambda>x. inverse (f x powr p)) = o(\<lambda>x. \<bar>inverse (f x)\<bar> powr p)

goal (3 subgoals):
 1. p < 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
 2. p = 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
 3. 0 < p \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
o(\<lambda>x. inverse (f x powr p)) = o(\<lambda>x. \<bar>inverse (f x)\<bar> powr p)

goal (3 subgoals):
 1. p < 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
 2. p = 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
 3. 0 < p \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
[PROOF STEP]
have "(\<lambda>_. \<bar>(\<bar>c\<bar> powr inverse p)\<bar> powr p) \<in> \<dots> \<longleftrightarrow> (\<lambda>_. \<bar>c\<bar> powr (inverse p)) \<in> o(\<lambda>x. inverse (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>_. \<bar>\<bar>c\<bar> powr inverse p\<bar> powr p) \<in> o(\<lambda>x. \<bar>inverse (f x)\<bar> powr p)) = ((\<lambda>_. \<bar>c\<bar> powr inverse p) \<in> o(\<lambda>x. inverse (f x)))
[PROOF STEP]
using p
[PROOF STATE]
proof (prove)
using this:
0 < p

goal (1 subgoal):
 1. ((\<lambda>_. \<bar>\<bar>c\<bar> powr inverse p\<bar> powr p) \<in> o(\<lambda>x. \<bar>inverse (f x)\<bar> powr p)) = ((\<lambda>_. \<bar>c\<bar> powr inverse p) \<in> o(\<lambda>x. inverse (f x)))
[PROOF STEP]
by(rule smallo_abs_powr_iff)
[PROOF STATE]
proof (state)
this:
((\<lambda>_. \<bar>\<bar>c\<bar> powr inverse p\<bar> powr p) \<in> o(\<lambda>x. \<bar>inverse (f x)\<bar> powr p)) = ((\<lambda>_. \<bar>c\<bar> powr inverse p) \<in> o(\<lambda>x. inverse (f x)))

goal (3 subgoals):
 1. p < 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
 2. p = 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
 3. 0 < p \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<lambda>_. \<bar>\<bar>c\<bar> powr inverse p\<bar> powr p) \<in> o(\<lambda>x. \<bar>inverse (f x)\<bar> powr p)) = ((\<lambda>_. \<bar>c\<bar> powr inverse p) \<in> o(\<lambda>x. inverse (f x)))

goal (3 subgoals):
 1. p < 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
 2. p = 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
 3. 0 < p \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
[PROOF STEP]
note calculation
[PROOF STATE]
proof (state)
this:
((\<lambda>_. \<bar>\<bar>c\<bar> powr inverse p\<bar> powr p) \<in> o(\<lambda>x. inverse (f x powr p))) = ((\<lambda>_. \<bar>c\<bar> powr inverse p) \<in> o(\<lambda>x. inverse (f x)))

goal (3 subgoals):
 1. p < 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
 2. p = 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
 3. 0 < p \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
((\<lambda>_. \<bar>\<bar>c\<bar> powr inverse p\<bar> powr p) \<in> o(\<lambda>x. inverse (f x powr p))) = ((\<lambda>_. \<bar>c\<bar> powr inverse p) \<in> o(\<lambda>x. inverse (f x)))

goal (3 subgoals):
 1. p < 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
 2. p = 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
 3. 0 < p \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<lambda>_. \<bar>\<bar>c\<bar> powr inverse p\<bar> powr p) \<in> o(\<lambda>x. inverse (f x powr p))) = ((\<lambda>_. \<bar>c\<bar> powr inverse p) \<in> o(\<lambda>x. inverse (f x)))

goal (3 subgoals):
 1. p < 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
 2. p = 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
 3. 0 < p \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
[PROOF STEP]
have "(\<lambda>_. \<bar>c\<bar> powr (inverse p)) \<in> o(\<lambda>x. inverse (f x)) \<longleftrightarrow> c = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>_. \<bar>c\<bar> powr inverse p) \<in> o(\<lambda>x. inverse (f x))) = (c = 0)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
filterlim f at_top at_top

goal (1 subgoal):
 1. ((\<lambda>_. \<bar>c\<bar> powr inverse p) \<in> o(\<lambda>x. inverse (f x))) = (c = 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
((\<lambda>_. \<bar>c\<bar> powr inverse p) \<in> o(\<lambda>x. inverse (f x))) = (c = 0)

goal (3 subgoals):
 1. p < 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
 2. p = 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
 3. 0 < p \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (c = 0)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (c = 0)

goal (1 subgoal):
 1. ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
[PROOF STEP]
using p
[PROOF STATE]
proof (prove)
using this:
((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (c = 0)
0 < p

goal (1 subgoal):
 1. ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)

goal (2 subgoals):
 1. p < 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
 2. p = 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. p < 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
 2. p = 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
[PROOF STEP]
case equal
[PROOF STATE]
proof (state)
this:
p = 0

goal (2 subgoals):
 1. p < 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
 2. p = 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
filterlim f at_top at_top
[PROOF STEP]
have "eventually (\<lambda>x. f x \<ge> 1) at_top"
[PROOF STATE]
proof (prove)
using this:
filterlim f at_top at_top

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. 1 \<le> f x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
filterlim f at_top at_top
filterlim f at_top at_top

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

goal (2 subgoals):
 1. p < 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
 2. p = 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in at_top. 1 \<le> f x
[PROOF STEP]
have "o(\<lambda>x. inverse (f x powr p)) = o(\<lambda>x. 1)"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. 1 \<le> f x

goal (1 subgoal):
 1. o(\<lambda>x. inverse (f x powr p)) = o(\<lambda>x. 1)
[PROOF STEP]
by(intro landau_o.small.cong)(auto simp add: equal elim!: eventually_rev_mp)
[PROOF STATE]
proof (state)
this:
o(\<lambda>x. inverse (f x powr p)) = o(\<lambda>x. 1)

goal (2 subgoals):
 1. p < 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
 2. p = 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
o(\<lambda>x. inverse (f x powr p)) = o(\<lambda>x. 1)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
o(\<lambda>x. inverse (f x powr p)) = o(\<lambda>x. 1)

goal (1 subgoal):
 1. ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
[PROOF STEP]
using equal
[PROOF STATE]
proof (prove)
using this:
o(\<lambda>x. inverse (f x powr p)) = o(\<lambda>x. 1)
p = 0

goal (1 subgoal):
 1. ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)

goal (1 subgoal):
 1. p < 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p < 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
[PROOF STEP]
case less
[PROOF STATE]
proof (state)
this:
p < 0

goal (1 subgoal):
 1. p < 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
filterlim f at_top at_top
[PROOF STEP]
have nonneg: "\<forall>\<^sub>F x in at_top. 0 \<le> f x"
[PROOF STATE]
proof (prove)
using this:
filterlim f at_top at_top

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

goal (1 subgoal):
 1. p < 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
filterlim f at_top at_top
\<forall>\<^sub>F x in at_top. 0 \<le> f x
[PROOF STEP]
have "\<forall>\<^sub>F x in at_top. \<bar>\<bar>c\<bar> powr (1 / - p)\<bar> / d \<le> \<bar>f x\<bar>" (is "\<forall>\<^sub>F x in _. ?c \<le> _") if "d > 0" for d
[PROOF STATE]
proof (prove)
using this:
filterlim f at_top at_top
\<forall>\<^sub>F x in at_top. 0 \<le> f x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. \<bar>\<bar>c\<bar> powr (1 / - p)\<bar> / d \<le> \<bar>f x\<bar>
[PROOF STEP]
by(fastforce dest!: spec[where x="?c"] simp add: filterlim_at_top elim: eventually_rev_mp)
[PROOF STATE]
proof (state)
this:
0 < ?d \<Longrightarrow> \<forall>\<^sub>F x in at_top. \<bar>\<bar>c\<bar> powr (1 / - p)\<bar> / ?d \<le> \<bar>f x\<bar>

goal (1 subgoal):
 1. p < 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < ?d \<Longrightarrow> \<forall>\<^sub>F x in at_top. \<bar>\<bar>c\<bar> powr (1 / - p)\<bar> / ?d \<le> \<bar>f x\<bar>
[PROOF STEP]
have "(\<lambda>_. \<bar>c\<bar> powr (1 / - p)) \<in> o(f)"
[PROOF STATE]
proof (prove)
using this:
0 < ?d \<Longrightarrow> \<forall>\<^sub>F x in at_top. \<bar>\<bar>c\<bar> powr (1 / - p)\<bar> / ?d \<le> \<bar>f x\<bar>

goal (1 subgoal):
 1. (\<lambda>_. \<bar>c\<bar> powr (1 / - p)) \<in> o(f)
[PROOF STEP]
by(intro landau_o.smallI)(simp add: field_simps)
[PROOF STATE]
proof (state)
this:
(\<lambda>_. \<bar>c\<bar> powr (1 / - p)) \<in> o(f)

goal (1 subgoal):
 1. p < 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>_. \<bar>c\<bar> powr (1 / - p)) \<in> o(f)
[PROOF STEP]
have "(\<lambda>_. \<bar>\<bar>c\<bar> powr (1 / - p)\<bar> powr - p) \<in> o(\<lambda>x. \<bar>f x\<bar> powr - p)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>_. \<bar>c\<bar> powr (1 / - p)) \<in> o(f)

goal (1 subgoal):
 1. (\<lambda>_. \<bar>\<bar>c\<bar> powr (1 / - p)\<bar> powr - p) \<in> o(\<lambda>x. \<bar>f x\<bar> powr - p)
[PROOF STEP]
using less
[PROOF STATE]
proof (prove)
using this:
(\<lambda>_. \<bar>c\<bar> powr (1 / - p)) \<in> o(f)
p < 0

goal (1 subgoal):
 1. (\<lambda>_. \<bar>\<bar>c\<bar> powr (1 / - p)\<bar> powr - p) \<in> o(\<lambda>x. \<bar>f x\<bar> powr - p)
[PROOF STEP]
by(subst smallo_powr_iff) simp_all
[PROOF STATE]
proof (state)
this:
(\<lambda>_. \<bar>\<bar>c\<bar> powr (1 / - p)\<bar> powr - p) \<in> o(\<lambda>x. \<bar>f x\<bar> powr - p)

goal (1 subgoal):
 1. p < 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>_. \<bar>\<bar>c\<bar> powr (1 / - p)\<bar> powr - p) \<in> o(\<lambda>x. \<bar>f x\<bar> powr - p)

goal (1 subgoal):
 1. p < 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
[PROOF STEP]
have "(\<lambda>_. \<bar>\<bar>c\<bar> powr (1 / - p)\<bar> powr - p) = (\<lambda>_. \<bar>c\<bar>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>_. \<bar>\<bar>c\<bar> powr (1 / - p)\<bar> powr - p) = (\<lambda>_. \<bar>c\<bar>)
[PROOF STEP]
using less
[PROOF STATE]
proof (prove)
using this:
p < 0

goal (1 subgoal):
 1. (\<lambda>_. \<bar>\<bar>c\<bar> powr (1 / - p)\<bar> powr - p) = (\<lambda>_. \<bar>c\<bar>)
[PROOF STEP]
by(simp add: powr_powr)
[PROOF STATE]
proof (state)
this:
(\<lambda>_. \<bar>\<bar>c\<bar> powr (1 / - p)\<bar> powr - p) = (\<lambda>_. \<bar>c\<bar>)

goal (1 subgoal):
 1. p < 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>_. \<bar>\<bar>c\<bar> powr (1 / - p)\<bar> powr - p) = (\<lambda>_. \<bar>c\<bar>)

goal (1 subgoal):
 1. p < 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
[PROOF STEP]
have "o(\<lambda>x. \<bar>f x\<bar> powr - p) = o(\<lambda>x. f x powr - p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. o(\<lambda>x. \<bar>f x\<bar> powr - p) = o(\<lambda>x. f x powr - p)
[PROOF STEP]
using nonneg
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. 0 \<le> f x

goal (1 subgoal):
 1. o(\<lambda>x. \<bar>f x\<bar> powr - p) = o(\<lambda>x. f x powr - p)
[PROOF STEP]
by(auto intro!: landau_o.small.cong elim: eventually_rev_mp)
[PROOF STATE]
proof (state)
this:
o(\<lambda>x. \<bar>f x\<bar> powr - p) = o(\<lambda>x. f x powr - p)

goal (1 subgoal):
 1. p < 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>_. \<bar>c\<bar>) \<in> o(\<lambda>x. f x powr - p)
[PROOF STEP]
have "(\<lambda>_. c) \<in> o(\<lambda>x. f x powr - p)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>_. \<bar>c\<bar>) \<in> o(\<lambda>x. f x powr - p)

goal (1 subgoal):
 1. (\<lambda>_. c) \<in> o(\<lambda>x. f x powr - p)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>_. c) \<in> o(\<lambda>x. f x powr - p)

goal (1 subgoal):
 1. p < 0 \<Longrightarrow> ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
[PROOF STEP]
with less
[PROOF STATE]
proof (chain)
picking this:
p < 0
(\<lambda>_. c) \<in> o(\<lambda>x. f x powr - p)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
p < 0
(\<lambda>_. c) \<in> o(\<lambda>x. f x powr - p)

goal (1 subgoal):
 1. ((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)
[PROOF STEP]
by(simp add: powr_minus[symmetric])
[PROOF STATE]
proof (state)
this:
((\<lambda>_. c) \<in> o(\<lambda>x. inverse (f x powr p))) = (0 \<le> p \<longrightarrow> c = 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma snd_snd_snd_foldl_echelon_form_of_column_k_det_iarrays:
  "snd (snd (snd (foldl echelon_form_of_column_k_det_iarrays (n, A, 0, bezout) [0..<k]))) = bezout"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (snd (snd (foldl echelon_form_of_column_k_det_iarrays (n, A, 0, bezout) [0..<k]))) = bezout
[PROOF STEP]
proof (induct k)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. snd (snd (snd (foldl echelon_form_of_column_k_det_iarrays (n, A, 0, bezout) [0..<0]))) = bezout
 2. \<And>k. snd (snd (snd (foldl echelon_form_of_column_k_det_iarrays (n, A, 0, bezout) [0..<k]))) = bezout \<Longrightarrow> snd (snd (snd (foldl echelon_form_of_column_k_det_iarrays (n, A, 0, bezout) [0..<Suc k]))) = bezout
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. snd (snd (snd (foldl echelon_form_of_column_k_det_iarrays (n, A, 0, bezout) [0..<0]))) = bezout
 2. \<And>k. snd (snd (snd (foldl echelon_form_of_column_k_det_iarrays (n, A, 0, bezout) [0..<k]))) = bezout \<Longrightarrow> snd (snd (snd (foldl echelon_form_of_column_k_det_iarrays (n, A, 0, bezout) [0..<Suc k]))) = bezout
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (snd (snd (foldl echelon_form_of_column_k_det_iarrays (n, A, 0, bezout) [0..<0]))) = bezout
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
snd (snd (snd (foldl echelon_form_of_column_k_det_iarrays (n, A, 0, bezout) [0..<0]))) = bezout

goal (1 subgoal):
 1. \<And>k. snd (snd (snd (foldl echelon_form_of_column_k_det_iarrays (n, A, 0, bezout) [0..<k]))) = bezout \<Longrightarrow> snd (snd (snd (foldl echelon_form_of_column_k_det_iarrays (n, A, 0, bezout) [0..<Suc k]))) = bezout
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k. snd (snd (snd (foldl echelon_form_of_column_k_det_iarrays (n, A, 0, bezout) [0..<k]))) = bezout \<Longrightarrow> snd (snd (snd (foldl echelon_form_of_column_k_det_iarrays (n, A, 0, bezout) [0..<Suc k]))) = bezout
[PROOF STEP]
case (Suc k)
[PROOF STATE]
proof (state)
this:
snd (snd (snd (foldl echelon_form_of_column_k_det_iarrays (n, A, 0, bezout) [0..<k]))) = bezout

goal (1 subgoal):
 1. \<And>k. snd (snd (snd (foldl echelon_form_of_column_k_det_iarrays (n, A, 0, bezout) [0..<k]))) = bezout \<Longrightarrow> snd (snd (snd (foldl echelon_form_of_column_k_det_iarrays (n, A, 0, bezout) [0..<Suc k]))) = bezout
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (snd (snd (foldl echelon_form_of_column_k_det_iarrays (n, A, 0, bezout) [0..<Suc k]))) = bezout
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (snd (snd (echelon_form_of_column_k_det_iarrays (foldl echelon_form_of_column_k_det_iarrays (n, A, 0, bezout) [0..<k]) k))) = bezout
[PROOF STEP]
apply (simp only: echelon_form_of_column_k_det_iarrays_def Let_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (snd (snd (case foldl echelon_form_of_column_k_det_iarrays (n, A, 0, bezout) [0..<k] of (det_P, A, i, bezout) \<Rightarrow> if i \<noteq> nrows_iarray A \<and> A !! i !! k = (0::'a) \<and> \<not> vector_all_zero_from_index (i + 1, column_iarray k A) then (- (1::'a) * det_P, echelon_form_of_column_k_iarrays (A, i, bezout) k) else (det_P, echelon_form_of_column_k_iarrays (A, i, bezout) k)))) = bezout
[PROOF STEP]
apply (auto simp add: split_beta echelon_form_of_column_k_iarrays_def Let_def Suc.hyps)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
snd (snd (snd (foldl echelon_form_of_column_k_det_iarrays (n, A, 0, bezout) [0..<Suc k]))) = bezout

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma no_infinite_subset_chain2:
  assumes "finite (UNIV :: 'a set)" and "mono (\<tau> :: ('a set \<Rightarrow> 'a set))"
      and "\<forall>i :: nat. (\<tau> ^^ i) UNIV \<supset> (\<tau> ^^ (i + (1 :: nat))) UNIV"
  shows "False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. False
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. False
[PROOF STEP]
have "\<exists> j :: nat. (\<tau> ^^ j) UNIV = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>j. (\<tau> ^^ j) UNIV = {}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite UNIV
mono \<tau>
\<forall>i. (\<tau> ^^ (i + 1)) UNIV \<subset> (\<tau> ^^ i) UNIV

goal (1 subgoal):
 1. \<exists>j. (\<tau> ^^ j) UNIV = {}
[PROOF STEP]
by (rule down_chain_reaches_empty)
[PROOF STATE]
proof (state)
this:
\<exists>j. (\<tau> ^^ j) UNIV = {}

goal (1 subgoal):
 1. False
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
\<exists>j. (\<tau> ^^ j) UNIV = {}
[PROOF STEP]
obtain j where a: "(\<tau> ^^ j) UNIV = {}"
[PROOF STATE]
proof (prove)
using this:
\<exists>j. (\<tau> ^^ j) UNIV = {}

goal (1 subgoal):
 1. (\<And>j. (\<tau> ^^ j) UNIV = {} \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (erule exE)
[PROOF STATE]
proof (state)
this:
(\<tau> ^^ j) UNIV = {}

goal (1 subgoal):
 1. False
[PROOF STEP]
have "(\<tau> ^^ (j + (1))) UNIV \<subset> (\<tau> ^^ j) UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<tau> ^^ (j + 1)) UNIV \<subset> (\<tau> ^^ j) UNIV
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite UNIV
mono \<tau>
\<forall>i. (\<tau> ^^ (i + 1)) UNIV \<subset> (\<tau> ^^ i) UNIV

goal (1 subgoal):
 1. (\<tau> ^^ (j + 1)) UNIV \<subset> (\<tau> ^^ j) UNIV
[PROOF STEP]
by (erule_tac x = j in spec)
[PROOF STATE]
proof (state)
this:
(\<tau> ^^ (j + 1)) UNIV \<subset> (\<tau> ^^ j) UNIV

goal (1 subgoal):
 1. False
[PROOF STEP]
thus False
[PROOF STATE]
proof (prove)
using this:
(\<tau> ^^ (j + 1)) UNIV \<subset> (\<tau> ^^ j) UNIV

goal (1 subgoal):
 1. False
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
(\<tau> ^^ (j + 1)) UNIV \<subset> (\<tau> ^^ j) UNIV
(\<tau> ^^ j) UNIV = {}

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem cubic_root_radical_sqrt_rational:
  assumes a: "a \<in> \<rat>" and b: "b \<in> \<rat>" and c: "c \<in> \<rat>"
  and x: "x \<in> radical_sqrt"
  and x_eqn: "x^3 + a * x^2 + b * x + c = 0"
  shows c: "\<exists>x \<in> \<rat>. x^3 + a * x^2 + b * x + c = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x\<in>\<rat>. x ^ 3 + a * x\<^sup>2 + b * x + c = 0
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>x\<in>\<rat>. x ^ 3 + a * x\<^sup>2 + b * x + c = 0
[PROOF STEP]
obtain e n
    where "\<lbrace>e\<rbrace> = x & (\<lbrace>e\<rbrace>^ 3 + a * \<lbrace>e\<rbrace>^2 + b * \<lbrace>e\<rbrace> + c = 0)" "n = card (radicals e)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>e n. \<lbrakk>\<lbrace>e\<rbrace> = x \<and> \<lbrace>e\<rbrace> ^ 3 + a * \<lbrace>e\<rbrace>\<^sup>2 + b * \<lbrace>e\<rbrace> + c = 0; n = card (radicals e)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using x x_eqn radical_sqrt_correct_expr [of x]
[PROOF STATE]
proof (prove)
using this:
x \<in> radical_sqrt
x ^ 3 + a * x\<^sup>2 + b * x + c = 0
x \<in> radical_sqrt \<Longrightarrow> \<exists>e. \<lbrace>e\<rbrace> = x

goal (1 subgoal):
 1. (\<And>e n. \<lbrakk>\<lbrace>e\<rbrace> = x \<and> \<lbrace>e\<rbrace> ^ 3 + a * \<lbrace>e\<rbrace>\<^sup>2 + b * \<lbrace>e\<rbrace> + c = 0; n = card (radicals e)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<lbrace>e\<rbrace> = x \<and> \<lbrace>e\<rbrace> ^ 3 + a * \<lbrace>e\<rbrace>\<^sup>2 + b * \<lbrace>e\<rbrace> + c = 0
n = card (radicals e)

goal (1 subgoal):
 1. \<exists>x\<in>\<rat>. x ^ 3 + a * x\<^sup>2 + b * x + c = 0
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrace>e\<rbrace> = x \<and> \<lbrace>e\<rbrace> ^ 3 + a * \<lbrace>e\<rbrace>\<^sup>2 + b * \<lbrace>e\<rbrace> + c = 0
n = card (radicals e)

goal (1 subgoal):
 1. \<exists>x\<in>\<rat>. x ^ 3 + a * x\<^sup>2 + b * x + c = 0
[PROOF STEP]
using cubic_root_radical_sqrt [OF a b c]
[PROOF STATE]
proof (prove)
using this:
\<lbrace>e\<rbrace> = x \<and> \<lbrace>e\<rbrace> ^ 3 + a * \<lbrace>e\<rbrace>\<^sup>2 + b * \<lbrace>e\<rbrace> + c = 0
n = card (radicals e)
\<lbrakk>card (radicals ?e) = ?n; \<lbrace>?e\<rbrace> ^ 3 + a * \<lbrace>?e\<rbrace>\<^sup>2 + b * \<lbrace>?e\<rbrace> + c = 0\<rbrakk> \<Longrightarrow> \<exists>x\<in>\<rat>. x ^ 3 + a * x\<^sup>2 + b * x + c = 0

goal (1 subgoal):
 1. \<exists>x\<in>\<rat>. x ^ 3 + a * x\<^sup>2 + b * x + c = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>x\<in>\<rat>. x ^ 3 + a * x\<^sup>2 + b * x + c = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma matT_vec_mult_to_scalar:
  assumes "mat nr nc m"
  and "vec nr v"
  and "i < nc"
  shows "matT_vec_multI ze pl ti m v ! i = scalar_prodI ze pl ti (col m i) v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matT_vec_multI ze pl ti m v ! i = scalar_prodI ze pl ti (col m i) v
[PROOF STEP]
unfolding matT_vec_multI_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (\<lambda>w. scalar_prodI ze pl ti w v) m ! i = scalar_prodI ze pl ti (col m i) v
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
mat nr nc m
vec nr v
i < nc

goal (1 subgoal):
 1. map (\<lambda>w. scalar_prodI ze pl ti w v) m ! i = scalar_prodI ze pl ti (col m i) v
[PROOF STEP]
unfolding mat_def col_def
[PROOF STATE]
proof (prove)
using this:
length m = nc \<and> Ball (set m) (vec nr)
vec nr v
i < nc

goal (1 subgoal):
 1. map (\<lambda>w. scalar_prodI ze pl ti w v) m ! i = scalar_prodI ze pl ti (m ! i) v
[PROOF STEP]
by (auto simp: vec_def)


[STATEMENT]
lemma Infinitesimal_less_SComplex:
  "\<lbrakk>x \<in> SComplex; y \<in> Infinitesimal; 0 < hcmod x\<rbrakk> \<Longrightarrow> hcmod y < hcmod x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> SComplex; y \<in> Infinitesimal; 0 < hcmod x\<rbrakk> \<Longrightarrow> hcmod y < hcmod x
[PROOF STEP]
by (auto intro: Infinitesimal_less_SReal SReal_hcmod_SComplex simp add: Infinitesimal_hcmod_iff)


[STATEMENT]
lemma measure_cond_spmf:
  "measure (measure_spmf (cond_spmf p A)) B = measure (measure_spmf p) (A \<inter> B) / measure (measure_spmf p) A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sigma_Algebra.measure (measure_spmf (cond_spmf p A)) B = Sigma_Algebra.measure (measure_spmf p) (A \<inter> B) / Sigma_Algebra.measure (measure_spmf p) A
[PROOF STEP]
apply(clarsimp simp add: cond_spmf_def measure_measure_spmf_conv_measure_pmf measure_pmf_zero_iff set_pmf_Int_Some split!: if_split)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>measure_pmf.prob (cond_pmf p (Some ` A)) (Some ` B) \<noteq> measure_pmf.prob p (Some ` (A \<inter> B)) / measure_pmf.prob p (Some ` A); x \<in> set_spmf p; x \<in> A\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply(subst (asm) measure_cond_pmf)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>x \<in> set_spmf p; x \<in> A\<rbrakk> \<Longrightarrow> set_pmf p \<inter> Some ` A \<noteq> {}
 2. \<And>x. \<lbrakk>measure_pmf.prob p (Some ` A \<inter> Some ` B) / measure_pmf.prob p (Some ` A) \<noteq> measure_pmf.prob p (Some ` (A \<inter> B)) / measure_pmf.prob p (Some ` A); x \<in> set_spmf p; x \<in> A\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
by(auto simp add: image_Int set_pmf_Int_Some)