[STATEMENT]
lemma prv_prv_imp_trans:
assumes phi: "\<phi> \<in> fmla" and chi: "\<chi> \<in> fmla" and psi: "\<psi> \<in> fmla"
assumes 1: "prv (imp \<phi> \<chi>)" and 2: "prv (imp \<chi> \<psi>)"
shows "prv (imp \<phi> \<psi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prv (imp \<phi> \<psi>)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. prv (imp \<phi> \<psi>)
[PROOF STEP]
have "prv (imp \<phi> (imp \<chi> \<psi>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prv (imp \<phi> (imp \<chi> \<psi>))
[PROOF STEP]
by (simp add: 2 chi prv_imp_triv phi psi)
[PROOF STATE]
proof (state)
this:
prv (imp \<phi> (imp \<chi> \<psi>))

goal (1 subgoal):
 1. prv (imp \<phi> \<psi>)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
prv (imp \<phi> (imp \<chi> \<psi>))

goal (1 subgoal):
 1. prv (imp \<phi> \<psi>)
[PROOF STEP]
by (metis 1 chi prv_imp_mp prv_imp_trans imp phi psi)
[PROOF STATE]
proof (state)
this:
prv (imp \<phi> \<psi>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma unitary_ex_mat_Ph:
  "unitary (tensor_P mat_Ph (1\<^sub>m K))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unitary (tensor_P mat_Ph (1\<^sub>m K))
[PROOF STEP]
unfolding ps2_P.ptensor_mat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unitary (ps_P.tensor_mat mat_Ph (1\<^sub>m K))
[PROOF STEP]
apply (subst ps_P.tensor_mat_unitary)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. mat_Ph \<in> carrier_mat ps_P.d1 ps_P.d1
 2. 1\<^sub>m K \<in> carrier_mat ps_P.d2 ps_P.d2
 3. unitary mat_Ph
 4. unitary (1\<^sub>m K)
 5. True
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_Ph \<in> carrier_mat ps_P.d1 ps_P.d1
[PROOF STEP]
using ps_P_d1 mat_Ph_def
[PROOF STATE]
proof (prove)
using this:
ps_P.d1 = N
mat_Ph = mat N N (\<lambda>(i, j). if i = j then if i = 0 then 1 else - 1 else 0)

goal (1 subgoal):
 1. mat_Ph \<in> carrier_mat ps_P.d1 ps_P.d1
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. 1\<^sub>m K \<in> carrier_mat ps_P.d2 ps_P.d2
 2. unitary mat_Ph
 3. unitary (1\<^sub>m K)
 4. True
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1\<^sub>m K \<in> carrier_mat ps_P.d2 ps_P.d2
[PROOF STEP]
using ps_P_d2
[PROOF STATE]
proof (prove)
using this:
ps_P.d2 = K

goal (1 subgoal):
 1. 1\<^sub>m K \<in> carrier_mat ps_P.d2 ps_P.d2
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. unitary mat_Ph
 2. unitary (1\<^sub>m K)
 3. True
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unitary mat_Ph
[PROOF STEP]
using unitary_mat_Ph
[PROOF STATE]
proof (prove)
using this:
unitary mat_Ph

goal (1 subgoal):
 1. unitary mat_Ph
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. unitary (1\<^sub>m K)
 2. True
[PROOF STEP]
using unitary_one
[PROOF STATE]
proof (prove)
using this:
unitary (1\<^sub>m ?n)

goal (2 subgoals):
 1. unitary (1\<^sub>m K)
 2. True
[PROOF STEP]
by auto


[STATEMENT]
lemma rbt_sorted_rbtreeify:
  "\<lbrakk> sorted (map fst kvs); distinct (map fst kvs) \<rbrakk> \<Longrightarrow> rbt_sorted (rbtreeify kvs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>sorted (map fst kvs); distinct (map fst kvs)\<rbrakk> \<Longrightarrow> rbt_sorted (rbtreeify kvs)
[PROOF STEP]
by(simp add: rbtreeify_def rbt_sorted_rbtreeify_g)


[STATEMENT]
lemma ideal_generated_dvd_subset:
  assumes x: "\<forall>x \<in> S. d dvd x" and S: "finite S"
  shows "ideal_generated S \<subseteq> ideal_generated {d}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ideal_generated S \<subseteq> ideal_generated {d}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> ideal_generated S \<Longrightarrow> x \<in> ideal_generated {d}
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> ideal_generated S \<Longrightarrow> x \<in> ideal_generated {d}
[PROOF STEP]
assume "x\<in> ideal_generated S"
[PROOF STATE]
proof (state)
this:
x \<in> ideal_generated S

goal (1 subgoal):
 1. \<And>x. x \<in> ideal_generated S \<Longrightarrow> x \<in> ideal_generated {d}
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
x \<in> ideal_generated S
[PROOF STEP]
obtain f where f: "(\<Sum>i\<in>S. f i * i) = x"
[PROOF STATE]
proof (prove)
using this:
x \<in> ideal_generated S

goal (1 subgoal):
 1. (\<And>f. (\<Sum>i\<in>S. f i * i) = x \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using ideal_explicit2[OF S]
[PROOF STATE]
proof (prove)
using this:
x \<in> ideal_generated S
ideal_generated S = {y. \<exists>f. (\<Sum>i\<in>S. f i * i) = y}

goal (1 subgoal):
 1. (\<And>f. (\<Sum>i\<in>S. f i * i) = x \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>S. f i * i) = x

goal (1 subgoal):
 1. \<And>x. x \<in> ideal_generated S \<Longrightarrow> x \<in> ideal_generated {d}
[PROOF STEP]
have "d dvd (\<Sum>i\<in>S. f i * i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d dvd (\<Sum>i\<in>S. f i * i)
[PROOF STEP]
by (rule dvd_sum, insert x, auto)
[PROOF STATE]
proof (state)
this:
d dvd (\<Sum>i\<in>S. f i * i)

goal (1 subgoal):
 1. \<And>x. x \<in> ideal_generated S \<Longrightarrow> x \<in> ideal_generated {d}
[PROOF STEP]
thus "x \<in> ideal_generated {d}"
[PROOF STATE]
proof (prove)
using this:
d dvd (\<Sum>i\<in>S. f i * i)

goal (1 subgoal):
 1. x \<in> ideal_generated {d}
[PROOF STEP]
using f dvd_ideal_generated_singleton' ideal_generated_in singletonI
[PROOF STATE]
proof (prove)
using this:
d dvd (\<Sum>i\<in>S. f i * i)
(\<Sum>i\<in>S. f i * i) = x
?b dvd ?a \<Longrightarrow> ideal_generated {?a} \<subseteq> ideal_generated {?b}
?a \<in> ?A \<Longrightarrow> ?a \<in> ideal_generated ?A
?a \<in> {?a}

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma zeta_partial_sum_le':
  fixes x :: real and m :: nat
  assumes x: "x > 0" and m: "m > 0"
  shows   "(\<Sum>n=1..m. real n powr (x - 1)) \<le> m powr x * (1 / x + 1 / m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n = 1..m. real n powr (x - 1)) \<le> real m powr x * (1 / x + 1 / real m)
[PROOF STEP]
proof (cases "x > 1")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 1 < x \<Longrightarrow> (\<Sum>n = 1..m. real n powr (x - 1)) \<le> real m powr x * (1 / x + 1 / real m)
 2. \<not> 1 < x \<Longrightarrow> (\<Sum>n = 1..m. real n powr (x - 1)) \<le> real m powr x * (1 / x + 1 / real m)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> 1 < x

goal (2 subgoals):
 1. 1 < x \<Longrightarrow> (\<Sum>n = 1..m. real n powr (x - 1)) \<le> real m powr x * (1 / x + 1 / real m)
 2. \<not> 1 < x \<Longrightarrow> (\<Sum>n = 1..m. real n powr (x - 1)) \<le> real m powr x * (1 / x + 1 / real m)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
0 < x
0 < m
\<not> 1 < x
[PROOF STEP]
have "(\<Sum>n=1..m. real n powr (x - 1)) \<le> m powr x / x"
[PROOF STATE]
proof (prove)
using this:
0 < x
0 < m
\<not> 1 < x

goal (1 subgoal):
 1. (\<Sum>n = 1..m. real n powr (x - 1)) \<le> real m powr x / x
[PROOF STEP]
by (intro zeta_partial_sum_le) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>n = 1..m. real n powr (x - 1)) \<le> real m powr x / x

goal (2 subgoals):
 1. 1 < x \<Longrightarrow> (\<Sum>n = 1..m. real n powr (x - 1)) \<le> real m powr x * (1 / x + 1 / real m)
 2. \<not> 1 < x \<Longrightarrow> (\<Sum>n = 1..m. real n powr (x - 1)) \<le> real m powr x * (1 / x + 1 / real m)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>n = 1..m. real n powr (x - 1)) \<le> real m powr x / x

goal (2 subgoals):
 1. 1 < x \<Longrightarrow> (\<Sum>n = 1..m. real n powr (x - 1)) \<le> real m powr x * (1 / x + 1 / real m)
 2. \<not> 1 < x \<Longrightarrow> (\<Sum>n = 1..m. real n powr (x - 1)) \<le> real m powr x * (1 / x + 1 / real m)
[PROOF STEP]
have "\<dots> \<le> m powr x * (1 / x + 1 / m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real m powr x / x \<le> real m powr x * (1 / x + 1 / real m)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < x
0 < m

goal (1 subgoal):
 1. real m powr x / x \<le> real m powr x * (1 / x + 1 / real m)
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
real m powr x / x \<le> real m powr x * (1 / x + 1 / real m)

goal (2 subgoals):
 1. 1 < x \<Longrightarrow> (\<Sum>n = 1..m. real n powr (x - 1)) \<le> real m powr x * (1 / x + 1 / real m)
 2. \<not> 1 < x \<Longrightarrow> (\<Sum>n = 1..m. real n powr (x - 1)) \<le> real m powr x * (1 / x + 1 / real m)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>n = 1..m. real n powr (x - 1)) \<le> real m powr x * (1 / x + 1 / real m)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>n = 1..m. real n powr (x - 1)) \<le> real m powr x * (1 / x + 1 / real m)

goal (1 subgoal):
 1. (\<Sum>n = 1..m. real n powr (x - 1)) \<le> real m powr x * (1 / x + 1 / real m)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>n = 1..m. real n powr (x - 1)) \<le> real m powr x * (1 / x + 1 / real m)

goal (1 subgoal):
 1. 1 < x \<Longrightarrow> (\<Sum>n = 1..m. real n powr (x - 1)) \<le> real m powr x * (1 / x + 1 / real m)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 1 < x \<Longrightarrow> (\<Sum>n = 1..m. real n powr (x - 1)) \<le> real m powr x * (1 / x + 1 / real m)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
1 < x

goal (1 subgoal):
 1. 1 < x \<Longrightarrow> (\<Sum>n = 1..m. real n powr (x - 1)) \<le> real m powr x * (1 / x + 1 / real m)
[PROOF STEP]
have "(\<Sum>n\<in>{1..m}. n powr (x - 1)) = (\<Sum>n\<in>insert m {0..<m}. n powr (x - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n = 1..m. real n powr (x - 1)) = (\<Sum>n\<in>insert m {0..<m}. real n powr (x - 1))
[PROOF STEP]
by (intro sum.mono_neutral_left) auto
[PROOF STATE]
proof (state)
this:
(\<Sum>n = 1..m. real n powr (x - 1)) = (\<Sum>n\<in>insert m {0..<m}. real n powr (x - 1))

goal (1 subgoal):
 1. 1 < x \<Longrightarrow> (\<Sum>n = 1..m. real n powr (x - 1)) \<le> real m powr x * (1 / x + 1 / real m)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>n = 1..m. real n powr (x - 1)) = (\<Sum>n\<in>insert m {0..<m}. real n powr (x - 1))

goal (1 subgoal):
 1. 1 < x \<Longrightarrow> (\<Sum>n = 1..m. real n powr (x - 1)) \<le> real m powr x * (1 / x + 1 / real m)
[PROOF STEP]
have "\<dots> = m powr (x - 1) + (\<Sum>n\<in>{0..<m}. n powr (x - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n\<in>insert m {0..<m}. real n powr (x - 1)) = real m powr (x - 1) + (\<Sum>n = 0..<m. real n powr (x - 1))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>n\<in>insert m {0..<m}. real n powr (x - 1)) = real m powr (x - 1) + (\<Sum>n = 0..<m. real n powr (x - 1))

goal (1 subgoal):
 1. 1 < x \<Longrightarrow> (\<Sum>n = 1..m. real n powr (x - 1)) \<le> real m powr x * (1 / x + 1 / real m)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>n\<in>insert m {0..<m}. real n powr (x - 1)) = real m powr (x - 1) + (\<Sum>n = 0..<m. real n powr (x - 1))

goal (1 subgoal):
 1. 1 < x \<Longrightarrow> (\<Sum>n = 1..m. real n powr (x - 1)) \<le> real m powr x * (1 / x + 1 / real m)
[PROOF STEP]
have "(\<Sum>n\<in>{0..<m}. n powr (x - 1)) \<le> real m powr x / x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n = 0..<m. real n powr (x - 1)) \<le> real m powr x / x
[PROOF STEP]
proof (rule has_integral_le)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. (?f has_integral (\<Sum>n = 0..<m. real n powr (x - 1))) ?S
 2. (?g has_integral real m powr x / x) ?S
 3. \<And>x. x \<in> ?S \<Longrightarrow> ?f x \<le> ?g x
[PROOF STEP]
show "((\<lambda>t. (nat \<lfloor>t\<rfloor>) powr (x - 1)) has_integral (\<Sum>n\<in>{0..<m}. n powr (x - 1))) {real 0..m}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>t. real (nat \<lfloor>t\<rfloor>) powr (x - 1)) has_integral (\<Sum>n = 0..<m. real n powr (x - 1))) {real 0..real m}
[PROOF STEP]
using m
[PROOF STATE]
proof (prove)
using this:
0 < m

goal (1 subgoal):
 1. ((\<lambda>t. real (nat \<lfloor>t\<rfloor>) powr (x - 1)) has_integral (\<Sum>n = 0..<m. real n powr (x - 1))) {real 0..real m}
[PROOF STEP]
by (intro nat_sum_has_integral_floor) auto
[PROOF STATE]
proof (state)
this:
((\<lambda>t. real (nat \<lfloor>t\<rfloor>) powr (x - 1)) has_integral (\<Sum>n = 0..<m. real n powr (x - 1))) {real 0..real m}

goal (2 subgoals):
 1. (?g has_integral real m powr x / x) {real 0..real m}
 2. \<And>xa. xa \<in> {real 0..real m} \<Longrightarrow> real (nat \<lfloor>xa\<rfloor>) powr (x - 1) \<le> ?g xa
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (?g has_integral real m powr x / x) {real 0..real m}
 2. \<And>xa. xa \<in> {real 0..real m} \<Longrightarrow> real (nat \<lfloor>xa\<rfloor>) powr (x - 1) \<le> ?g xa
[PROOF STEP]
show "((\<lambda>t. t powr (x - 1)) has_integral (real m powr x / x)) {real 0..real m}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>t. t powr (x - 1)) has_integral real m powr x / x) {real 0..real m}
[PROOF STEP]
using has_integral_powr_from_0[of "x - 1"] x
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>- 1 < x - 1; 0 \<le> ?c\<rbrakk> \<Longrightarrow> ((\<lambda>xa. xa powr (x - 1)) has_integral ?c powr (x - 1 + 1) / (x - 1 + 1)) {0..?c}
0 < x

goal (1 subgoal):
 1. ((\<lambda>t. t powr (x - 1)) has_integral real m powr x / x) {real 0..real m}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
((\<lambda>t. t powr (x - 1)) has_integral real m powr x / x) {real 0..real m}

goal (1 subgoal):
 1. \<And>xa. xa \<in> {real 0..real m} \<Longrightarrow> real (nat \<lfloor>xa\<rfloor>) powr (x - 1) \<le> xa powr (x - 1)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. xa \<in> {real 0..real m} \<Longrightarrow> real (nat \<lfloor>xa\<rfloor>) powr (x - 1) \<le> xa powr (x - 1)
[PROOF STEP]
fix t
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>xa. xa \<in> {real 0..real m} \<Longrightarrow> real (nat \<lfloor>xa\<rfloor>) powr (x - 1) \<le> xa powr (x - 1)
[PROOF STEP]
assume "t \<in> {real 0..real m}"
[PROOF STATE]
proof (state)
this:
t \<in> {real 0..real m}

goal (1 subgoal):
 1. \<And>xa. xa \<in> {real 0..real m} \<Longrightarrow> real (nat \<lfloor>xa\<rfloor>) powr (x - 1) \<le> xa powr (x - 1)
[PROOF STEP]
with \<open>x > 1\<close>
[PROOF STATE]
proof (chain)
picking this:
1 < x
t \<in> {real 0..real m}
[PROOF STEP]
show "real (nat \<lfloor>t\<rfloor>) powr (x - 1) \<le> t powr (x - 1)"
[PROOF STATE]
proof (prove)
using this:
1 < x
t \<in> {real 0..real m}

goal (1 subgoal):
 1. real (nat \<lfloor>t\<rfloor>) powr (x - 1) \<le> t powr (x - 1)
[PROOF STEP]
by (cases "t = 0") (auto intro: powr_mono2)
[PROOF STATE]
proof (state)
this:
real (nat \<lfloor>t\<rfloor>) powr (x - 1) \<le> t powr (x - 1)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>n = 0..<m. real n powr (x - 1)) \<le> real m powr x / x

goal (1 subgoal):
 1. 1 < x \<Longrightarrow> (\<Sum>n = 1..m. real n powr (x - 1)) \<le> real m powr x * (1 / x + 1 / real m)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>n = 0..<m. real n powr (x - 1)) \<le> real m powr x / x

goal (1 subgoal):
 1. 1 < x \<Longrightarrow> (\<Sum>n = 1..m. real n powr (x - 1)) \<le> real m powr x * (1 / x + 1 / real m)
[PROOF STEP]
have "m powr (x - 1) + m powr x / x = m powr x * (1 / x + 1 / m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real m powr (x - 1) + real m powr x / x = real m powr x * (1 / x + 1 / real m)
[PROOF STEP]
using m x
[PROOF STATE]
proof (prove)
using this:
0 < m
0 < x

goal (1 subgoal):
 1. real m powr (x - 1) + real m powr x / x = real m powr x * (1 / x + 1 / real m)
[PROOF STEP]
by (simp add: powr_diff field_simps)
[PROOF STATE]
proof (state)
this:
real m powr (x - 1) + real m powr x / x = real m powr x * (1 / x + 1 / real m)

goal (1 subgoal):
 1. 1 < x \<Longrightarrow> (\<Sum>n = 1..m. real n powr (x - 1)) \<le> real m powr x * (1 / x + 1 / real m)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<And>xa y. xa \<le> y \<Longrightarrow> real m powr (x - 1) + xa \<le> real m powr (x - 1) + y) \<Longrightarrow> (\<Sum>n = 1..m. real n powr (x - 1)) \<le> real m powr x * (1 / x + 1 / real m)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<And>xa y. xa \<le> y \<Longrightarrow> real m powr (x - 1) + xa \<le> real m powr (x - 1) + y) \<Longrightarrow> (\<Sum>n = 1..m. real n powr (x - 1)) \<le> real m powr x * (1 / x + 1 / real m)

goal (1 subgoal):
 1. (\<Sum>n = 1..m. real n powr (x - 1)) \<le> real m powr x * (1 / x + 1 / real m)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>n = 1..m. real n powr (x - 1)) \<le> real m powr x * (1 / x + 1 / real m)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ln_less_zero_iff [simp]: "0 < x \<Longrightarrow> ln x < 0 \<longleftrightarrow> x < 1"
  for x :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x \<Longrightarrow> (ln x < 0) = (x < 1)
[PROOF STEP]
using ln_less_cancel_iff [of x 1]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < x; 0 < 1\<rbrakk> \<Longrightarrow> (ln x < ln 1) = (x < 1)

goal (1 subgoal):
 1. 0 < x \<Longrightarrow> (ln x < 0) = (x < 1)
[PROOF STEP]
by simp


[STATEMENT]
lemma complement_one_vector_zero_vector_iff:
  "one_vector x \<longleftrightarrow> zero_vector (-x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. one_vector x = zero_vector (- x)
[PROOF STEP]
using complement_zero_vector_one_vector complement_one_vector_zero_vector
[PROOF STATE]
proof (prove)
using this:
zero_vector ?x \<Longrightarrow> one_vector (- ?x)
one_vector ?x \<Longrightarrow> zero_vector (- ?x)

goal (1 subgoal):
 1. one_vector x = zero_vector (- x)
[PROOF STEP]
by force


[STATEMENT]
lemma Amicable_pair_deficient: assumes "m > n" and  "m Amic n"
  shows "deficient_number m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deficient_number m
[PROOF STEP]
using assms deficient_number_def Amicable_pair_def
[PROOF STATE]
proof (prove)
using this:
n < m
m Amic n
deficient_number ?n \<equiv> aliquot_sum ?n < ?n
?m Amic ?n \<equiv> ?m = aliquot_sum ?n \<and> ?n = aliquot_sum ?m

goal (1 subgoal):
 1. deficient_number m
[PROOF STEP]
by metis


[STATEMENT]
lemma replace_coeff_add:
assumes "f 0 = 0"
assumes "\<And>a b. f (a+b) = f a + f b"
shows "replace_coeff f (p1 + p2) = replace_coeff f p1 + replace_coeff f p2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. replace_coeff f (p1 + p2) = replace_coeff f p1 + replace_coeff f p2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. replace_coeff f (p1 + p2) = replace_coeff f p1 + replace_coeff f p2
[PROOF STEP]
have "finite {m. f (lookup (mapping_of p1) m) \<noteq> 0}"
       "finite {m. f (lookup (mapping_of p2) m) \<noteq> 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {m. f (lookup (mapping_of p1) m) \<noteq> (0::'a)} &&& finite {m. f (lookup (mapping_of p2) m) \<noteq> (0::'a)}
[PROOF STEP]
unfolding coeff_def[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {m. f (coeff p1 m) \<noteq> (0::'a)} &&& finite {m. f (coeff p2 m) \<noteq> (0::'a)}
[PROOF STEP]
by (metis (mono_tags, lifting) Collect_mono assms(1) coeff_def finite_lookup finite_subset)+
[PROOF STATE]
proof (state)
this:
finite {m. f (lookup (mapping_of p1) m) \<noteq> (0::'a)}
finite {m. f (lookup (mapping_of p2) m) \<noteq> (0::'a)}

goal (1 subgoal):
 1. replace_coeff f (p1 + p2) = replace_coeff f p1 + replace_coeff f p2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite {m. f (lookup (mapping_of p1) m) \<noteq> (0::'a)}
finite {m. f (lookup (mapping_of p2) m) \<noteq> (0::'a)}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite {m. f (lookup (mapping_of p1) m) \<noteq> (0::'a)}
finite {m. f (lookup (mapping_of p2) m) \<noteq> (0::'a)}

goal (1 subgoal):
 1. replace_coeff f (p1 + p2) = replace_coeff f p1 + replace_coeff f p2
[PROOF STEP]
unfolding replace_coeff_def plus_mpoly.rep_eq
[PROOF STATE]
proof (prove)
using this:
finite {m. f (lookup (mapping_of p1) m) \<noteq> (0::'a)}
finite {m. f (lookup (mapping_of p2) m) \<noteq> (0::'a)}

goal (1 subgoal):
 1. MPoly (Abs_poly_mapping (\<lambda>m. f (lookup (mapping_of p1 + mapping_of p2) m))) = MPoly (Abs_poly_mapping (\<lambda>m. f (lookup (mapping_of p1) m))) + MPoly (Abs_poly_mapping (\<lambda>m. f (lookup (mapping_of p2) m)))
[PROOF STEP]
unfolding Poly_Mapping.plus_poly_mapping.rep_eq
[PROOF STATE]
proof (prove)
using this:
finite {m. f (lookup (mapping_of p1) m) \<noteq> (0::'a)}
finite {m. f (lookup (mapping_of p2) m) \<noteq> (0::'a)}

goal (1 subgoal):
 1. MPoly (Abs_poly_mapping (\<lambda>m. f (lookup (mapping_of p1) m + lookup (mapping_of p2) m))) = MPoly (Abs_poly_mapping (\<lambda>m. f (lookup (mapping_of p1) m))) + MPoly (Abs_poly_mapping (\<lambda>m. f (lookup (mapping_of p2) m)))
[PROOF STEP]
unfolding assms(2) plus_mpoly.abs_eq
[PROOF STATE]
proof (prove)
using this:
finite {m. f (lookup (mapping_of p1) m) \<noteq> (0::'a)}
finite {m. f (lookup (mapping_of p2) m) \<noteq> (0::'a)}

goal (1 subgoal):
 1. MPoly (Abs_poly_mapping (\<lambda>m. f (lookup (mapping_of p1) m) + f (lookup (mapping_of p2) m))) = MPoly (Abs_poly_mapping (\<lambda>m. f (lookup (mapping_of p1) m)) + Abs_poly_mapping (\<lambda>m. f (lookup (mapping_of p2) m)))
[PROOF STEP]
using Poly_Mapping.plus_poly_mapping.abs_eq[unfolded eq_onp_def]
[PROOF STATE]
proof (prove)
using this:
finite {m. f (lookup (mapping_of p1) m) \<noteq> (0::'a)}
finite {m. f (lookup (mapping_of p2) m) \<noteq> (0::'a)}
\<lbrakk>finite {x. ?xa x \<noteq> (0::?'b)} \<and> ?xa = ?xa; finite {x. ?x x \<noteq> (0::?'b)} \<and> ?x = ?x\<rbrakk> \<Longrightarrow> Abs_poly_mapping ?xa + Abs_poly_mapping ?x = Abs_poly_mapping (\<lambda>k. ?xa k + ?x k)

goal (1 subgoal):
 1. MPoly (Abs_poly_mapping (\<lambda>m. f (lookup (mapping_of p1) m) + f (lookup (mapping_of p2) m))) = MPoly (Abs_poly_mapping (\<lambda>m. f (lookup (mapping_of p1) m)) + Abs_poly_mapping (\<lambda>m. f (lookup (mapping_of p2) m)))
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
replace_coeff f (p1 + p2) = replace_coeff f p1 + replace_coeff f p2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in linorder_topology) tendsto_le:
  assumes F: "\<not> trivial_limit F"
    and x: "(f \<longlongrightarrow> x) F"
    and y: "(g \<longlongrightarrow> y) F"
    and ev: "eventually (\<lambda>x. g x \<le> f x) F"
  shows "y \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<le> x
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> y \<le> x \<Longrightarrow> False
[PROOF STEP]
assume "\<not> y \<le> x"
[PROOF STATE]
proof (state)
this:
\<not> y \<le> x

goal (1 subgoal):
 1. \<not> y \<le> x \<Longrightarrow> False
[PROOF STEP]
with less_separate[of x y]
[PROOF STATE]
proof (chain)
picking this:
x < y \<Longrightarrow> \<exists>a b. x \<in> {..<a} \<and> y \<in> {b<..} \<and> {..<a} \<inter> {b<..} = {}
\<not> y \<le> x
[PROOF STEP]
obtain a b where xy: "x < a" "b < y" "{..<a} \<inter> {b<..} = {}"
[PROOF STATE]
proof (prove)
using this:
x < y \<Longrightarrow> \<exists>a b. x \<in> {..<a} \<and> y \<in> {b<..} \<and> {..<a} \<inter> {b<..} = {}
\<not> y \<le> x

goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>x < a; b < y; {..<a} \<inter> {b<..} = {}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: not_le)
[PROOF STATE]
proof (state)
this:
x < a
b < y
{..<a} \<inter> {b<..} = {}

goal (1 subgoal):
 1. \<not> y \<le> x \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x < a
b < y
{..<a} \<inter> {b<..} = {}
[PROOF STEP]
have "eventually (\<lambda>x. f x < a) F" "eventually (\<lambda>x. b < g x) F"
[PROOF STATE]
proof (prove)
using this:
x < a
b < y
{..<a} \<inter> {b<..} = {}

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. f x < a &&& \<forall>\<^sub>F x in F. b < g x
[PROOF STEP]
using x y
[PROOF STATE]
proof (prove)
using this:
x < a
b < y
{..<a} \<inter> {b<..} = {}
(f \<longlongrightarrow> x) F
(g \<longlongrightarrow> y) F

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. f x < a &&& \<forall>\<^sub>F x in F. b < g x
[PROOF STEP]
by (auto intro: order_tendstoD)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. f x < a
\<forall>\<^sub>F x in F. b < g x

goal (1 subgoal):
 1. \<not> y \<le> x \<Longrightarrow> False
[PROOF STEP]
with ev
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in F. g x \<le> f x
\<forall>\<^sub>F x in F. f x < a
\<forall>\<^sub>F x in F. b < g x
[PROOF STEP]
have "eventually (\<lambda>x. False) F"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. g x \<le> f x
\<forall>\<^sub>F x in F. f x < a
\<forall>\<^sub>F x in F. b < g x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. False
[PROOF STEP]
by eventually_elim (insert xy, fastforce)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. False

goal (1 subgoal):
 1. \<not> y \<le> x \<Longrightarrow> False
[PROOF STEP]
with F
[PROOF STATE]
proof (chain)
picking this:
F \<noteq> bot
\<forall>\<^sub>F x in F. False
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
F \<noteq> bot
\<forall>\<^sub>F x in F. False

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma summable_If_finite[simp, intro]: "finite {r. P r} \<Longrightarrow> summable (\<lambda>r. if P r then f r else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {r. P r} \<Longrightarrow> summable (\<lambda>r. if P r then f r else (0::'a))
[PROOF STEP]
by (rule sums_summable) (rule sums_If_finite)


[STATEMENT]
lemma ceiling_le_numeral [simp]: "\<lceil>x\<rceil> \<le> numeral v \<longleftrightarrow> x \<le> numeral v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lceil>x\<rceil> \<le> numeral v) = (x \<le> numeral v)
[PROOF STEP]
by (simp add: ceiling_le_iff)


[STATEMENT]
lemma has_field_derivative_eval_fps:
  fixes z :: "'a :: {banach, real_normed_field}"
  assumes "norm z < fps_conv_radius f"
  shows   "(eval_fps f has_field_derivative eval_fps (fps_deriv f) z) (at z within A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (eval_fps f has_field_derivative eval_fps (fps_deriv f) z) (at z within A)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (eval_fps f has_field_derivative eval_fps (fps_deriv f) z) (at z within A)
[PROOF STEP]
have "(eval_fps f has_field_derivative eval_fps (Abs_fps (diffs (fps_nth f))) z) (at z within A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (eval_fps f has_field_derivative eval_fps (Abs_fps (diffs (fps_nth f))) z) (at z within A)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
ereal (norm z) < fps_conv_radius f

goal (1 subgoal):
 1. (eval_fps f has_field_derivative eval_fps (Abs_fps (diffs (fps_nth f))) z) (at z within A)
[PROOF STEP]
unfolding eval_fps_def fps_nth_Abs_fps fps_conv_radius_def
[PROOF STATE]
proof (prove)
using this:
ereal (norm z) < conv_radius (fps_nth f)

goal (1 subgoal):
 1. ((\<lambda>z. \<Sum>n. fps_nth f n * z ^ n) has_field_derivative (\<Sum>n. diffs (fps_nth f) n * z ^ n)) (at z within A)
[PROOF STEP]
by (intro has_field_derivative_powser) auto
[PROOF STATE]
proof (state)
this:
(eval_fps f has_field_derivative eval_fps (Abs_fps (diffs (fps_nth f))) z) (at z within A)

goal (1 subgoal):
 1. (eval_fps f has_field_derivative eval_fps (fps_deriv f) z) (at z within A)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(eval_fps f has_field_derivative eval_fps (Abs_fps (diffs (fps_nth f))) z) (at z within A)

goal (1 subgoal):
 1. (eval_fps f has_field_derivative eval_fps (fps_deriv f) z) (at z within A)
[PROOF STEP]
have "Abs_fps (diffs (fps_nth f)) = fps_deriv f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs_fps (diffs (fps_nth f)) = fps_deriv f
[PROOF STEP]
by (simp add: fps_eq_iff diffs_def)
[PROOF STATE]
proof (state)
this:
Abs_fps (diffs (fps_nth f)) = fps_deriv f

goal (1 subgoal):
 1. (eval_fps f has_field_derivative eval_fps (fps_deriv f) z) (at z within A)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(eval_fps f has_field_derivative eval_fps (fps_deriv f) z) (at z within A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(eval_fps f has_field_derivative eval_fps (fps_deriv f) z) (at z within A)

goal (1 subgoal):
 1. (eval_fps f has_field_derivative eval_fps (fps_deriv f) z) (at z within A)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(eval_fps f has_field_derivative eval_fps (fps_deriv f) z) (at z within A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma q_eq2: "int q = (2 * ((int q - 1) div 2)) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int q = 2 * ((int q - 1) div 2) + 1
[PROOF STEP]
using odd_q
[PROOF STATE]
proof (prove)
using this:
odd q

goal (1 subgoal):
 1. int q = 2 * ((int q - 1) div 2) + 1
[PROOF STEP]
by simp


[STATEMENT]
lemma gtr_empty_conf1[simp]: "(({#},w,c')\<in>trcl (gtr S)) \<longleftrightarrow> (w=[] \<and> c'={#})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (({#}, w, c') \<in> trcl (gtr S)) = (w = [] \<and> c' = {#})
[PROOF STEP]
by (induct w) (auto dest: trcl_uncons)


[STATEMENT]
theorem wls_psubstEnv_substEnv_compose:
assumes "wlsEnv rho" and "wls (asSort ys) Y" and "wlsEnv rho'"
shows "((rho &[Y / y]_ys) &[rho']) = (rho &[(rho' [y \<leftarrow> (Y #[rho'])]_ys)])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rho &[Y / y]_ys &[rho'] = rho &[rho' [y \<leftarrow> Y #[rho']]_ys]
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
wlsEnv rho
wls (asSort ys) Y
wlsEnv rho'

goal (1 subgoal):
 1. rho &[Y / y]_ys &[rho'] = rho &[rho' [y \<leftarrow> Y #[rho']]_ys]
[PROOF STEP]
by(simp add: psubstEnv_substEnv_compose)


[STATEMENT]
lemma landau_ceil:
  assumes "(\<lambda>_. 1) \<in> O[F'](g)"
  assumes "f \<in> O[F'](g)"
  shows "(\<lambda>x. real_of_int \<lceil>f x\<rceil>) \<in> O[F'](g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. real_of_int \<lceil>f x\<rceil>) \<in> O[F'](g)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. real_of_int \<lceil>f x\<rceil>) \<in> O[F'](g)
[PROOF STEP]
have "(\<lambda>x. real_of_int \<lceil>f x\<rceil>) \<in> O[F'](\<lambda>x. 1 + abs (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. real_of_int \<lceil>f x\<rceil>) \<in> O[F'](\<lambda>x. 1 + \<bar>f x\<bar>)
[PROOF STEP]
by (intro landau_o.big_mono always_eventually allI, simp, linarith)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. real_of_int \<lceil>f x\<rceil>) \<in> O[F'](\<lambda>x. 1 + \<bar>f x\<bar>)

goal (1 subgoal):
 1. (\<lambda>x. real_of_int \<lceil>f x\<rceil>) \<in> O[F'](g)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>x. real_of_int \<lceil>f x\<rceil>) \<in> O[F'](\<lambda>x. 1 + \<bar>f x\<bar>)

goal (1 subgoal):
 1. (\<lambda>x. real_of_int \<lceil>f x\<rceil>) \<in> O[F'](g)
[PROOF STEP]
have "(\<lambda>x. 1 + abs(f x)) \<in> O[F'](g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. 1 + \<bar>f x\<bar>) \<in> O[F'](g)
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
f \<in> O[F'](g)

goal (1 subgoal):
 1. (\<lambda>x. 1 + \<bar>f x\<bar>) \<in> O[F'](g)
[PROOF STEP]
by (intro sum_in_bigo assms(1), auto)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. 1 + \<bar>f x\<bar>) \<in> O[F'](g)

goal (1 subgoal):
 1. (\<lambda>x. real_of_int \<lceil>f x\<rceil>) \<in> O[F'](g)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. real_of_int \<lceil>f x\<rceil>) \<in> O[F'](g)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. real_of_int \<lceil>f x\<rceil>) \<in> O[F'](g)

goal (1 subgoal):
 1. (\<lambda>x. real_of_int \<lceil>f x\<rceil>) \<in> O[F'](g)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>x. real_of_int \<lceil>f x\<rceil>) \<in> O[F'](g)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma degree_isovarspar : "MPoly_Type.degree (isolate_variable_sparse (p::real mpoly) x i) x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. MPoly_Type.degree (isolate_variable_sparse p x i) x = 0
[PROOF STEP]
using not_in_isovarspar varNotIn_degree
[PROOF STATE]
proof (prove)
using this:
isolate_variable_sparse ?p ?var ?x = ?q \<Longrightarrow> ?var \<notin> vars ?q
?var \<notin> vars ?p \<Longrightarrow> MPoly_Type.degree ?p ?var = 0

goal (1 subgoal):
 1. MPoly_Type.degree (isolate_variable_sparse p x i) x = 0
[PROOF STEP]
by blast


[STATEMENT]
lemma strt'_lemma: "\<lbrakk>length xs = vl; n \<le> vl\<rbrakk> \<Longrightarrow>
  rec_exec (rec_strt' vl n) xs = strt' xs n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length xs = vl; n \<le> vl\<rbrakk> \<Longrightarrow> rec_exec (rec_strt' vl n) xs = strt' xs n
[PROOF STEP]
apply(induct n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>length xs = vl; 0 \<le> vl\<rbrakk> \<Longrightarrow> rec_exec (rec_strt' vl 0) xs = strt' xs 0
 2. \<And>n. \<lbrakk>\<lbrakk>length xs = vl; n \<le> vl\<rbrakk> \<Longrightarrow> rec_exec (rec_strt' vl n) xs = strt' xs n; length xs = vl; Suc n \<le> vl\<rbrakk> \<Longrightarrow> rec_exec (rec_strt' vl (Suc n)) xs = strt' xs (Suc n)
[PROOF STEP]
apply(simp_all add: rec_exec.simps rec_strt'.simps strt'.simps
      Let_def power_lemma listsum2_lemma)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma mangoldt_nonneg: "0 \<le> (mangoldt d :: real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> mangoldt d
[PROOF STEP]
using aprimedivisor_gt_Suc_0_nat[of d]
[PROOF STATE]
proof (prove)
using this:
Suc 0 < d \<Longrightarrow> Suc 0 < aprimedivisor d

goal (1 subgoal):
 1. 0 \<le> mangoldt d
[PROOF STEP]
by (auto simp: mangoldt_def of_nat_le_iff[of 1 x for x, unfolded of_nat_1] Suc_le_eq
           intro!: ln_ge_zero dest: primepow_gt_Suc_0)


[STATEMENT]
lemma square_pos_mult_le:
  assumes "finite I"
  and "\<And>i. i \<in> I \<Longrightarrow> ((0::real) \<le> f i \<and> f i \<le> 1)"
shows "sum (\<lambda>x. f x * f x) I \<le> sum f I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>I. f x * f x) \<le> sum f I
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite I
?i \<in> I \<Longrightarrow> 0 \<le> f ?i \<and> f ?i \<le> 1

goal (1 subgoal):
 1. (\<Sum>x\<in>I. f x * f x) \<le> sum f I
[PROOF STEP]
proof (induct rule:finite_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<And>i. i \<in> {} \<Longrightarrow> 0 \<le> f i \<and> f i \<le> 1) \<Longrightarrow> (\<Sum>x\<in>{}. f x * f x) \<le> sum f {}
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> 0 \<le> f i \<and> f i \<le> 1) \<Longrightarrow> (\<Sum>x\<in>F. f x * f x) \<le> sum f F; \<And>i. i \<in> insert x F \<Longrightarrow> 0 \<le> f i \<and> f i \<le> 1\<rbrakk> \<Longrightarrow> (\<Sum>x\<in>insert x F. f x * f x) \<le> sum f (insert x F)
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:
?i \<in> {} \<Longrightarrow> 0 \<le> f ?i \<and> f ?i \<le> 1

goal (2 subgoals):
 1. (\<And>i. i \<in> {} \<Longrightarrow> 0 \<le> f i \<and> f i \<le> 1) \<Longrightarrow> (\<Sum>x\<in>{}. f x * f x) \<le> sum f {}
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> 0 \<le> f i \<and> f i \<le> 1) \<Longrightarrow> (\<Sum>x\<in>F. f x * f x) \<le> sum f F; \<And>i. i \<in> insert x F \<Longrightarrow> 0 \<le> f i \<and> f i \<le> 1\<rbrakk> \<Longrightarrow> (\<Sum>x\<in>insert x F. f x * f x) \<le> sum f (insert x F)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?i \<in> {} \<Longrightarrow> 0 \<le> f ?i \<and> f ?i \<le> 1
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
?i \<in> {} \<Longrightarrow> 0 \<le> f ?i \<and> f ?i \<le> 1

goal (1 subgoal):
 1. (\<Sum>x\<in>{}. f x * f x) \<le> sum f {}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>{}. f x * f x) \<le> sum f {}

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> 0 \<le> f i \<and> f i \<le> 1) \<Longrightarrow> (\<Sum>x\<in>F. f x * f x) \<le> sum f F; \<And>i. i \<in> insert x F \<Longrightarrow> 0 \<le> f i \<and> f i \<le> 1\<rbrakk> \<Longrightarrow> (\<Sum>x\<in>insert x F. f x * f x) \<le> sum f (insert x F)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> 0 \<le> f i \<and> f i \<le> 1) \<Longrightarrow> (\<Sum>x\<in>F. f x * f x) \<le> sum f F; \<And>i. i \<in> insert x F \<Longrightarrow> 0 \<le> f i \<and> f i \<le> 1\<rbrakk> \<Longrightarrow> (\<Sum>x\<in>insert x F. f x * f x) \<le> sum f (insert x F)
[PROOF STEP]
case (insert x F)
[PROOF STATE]
proof (state)
this:
finite F
x \<notin> F
(\<And>i. i \<in> F \<Longrightarrow> 0 \<le> f i \<and> f i \<le> 1) \<Longrightarrow> (\<Sum>x\<in>F. f x * f x) \<le> sum f F
?i \<in> insert x F \<Longrightarrow> 0 \<le> f ?i \<and> f ?i \<le> 1

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> 0 \<le> f i \<and> f i \<le> 1) \<Longrightarrow> (\<Sum>x\<in>F. f x * f x) \<le> sum f F; \<And>i. i \<in> insert x F \<Longrightarrow> 0 \<le> f i \<and> f i \<le> 1\<rbrakk> \<Longrightarrow> (\<Sum>x\<in>insert x F. f x * f x) \<le> sum f (insert x F)
[PROOF STEP]
have "sum (\<lambda>x. f x * f x) (insert x F) = f x * f x + sum (\<lambda>x. f x * f x) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>insert x F. f x * f x) = f x * f x + (\<Sum>x\<in>F. f x * f x)
[PROOF STEP]
by (simp add: insert)
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>insert x F. f x * f x) = f x * f x + (\<Sum>x\<in>F. f x * f x)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> 0 \<le> f i \<and> f i \<le> 1) \<Longrightarrow> (\<Sum>x\<in>F. f x * f x) \<le> sum f F; \<And>i. i \<in> insert x F \<Longrightarrow> 0 \<le> f i \<and> f i \<le> 1\<rbrakk> \<Longrightarrow> (\<Sum>x\<in>insert x F. f x * f x) \<le> sum f (insert x F)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>insert x F. f x * f x) = f x * f x + (\<Sum>x\<in>F. f x * f x)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> 0 \<le> f i \<and> f i \<le> 1) \<Longrightarrow> (\<Sum>x\<in>F. f x * f x) \<le> sum f F; \<And>i. i \<in> insert x F \<Longrightarrow> 0 \<le> f i \<and> f i \<le> 1\<rbrakk> \<Longrightarrow> (\<Sum>x\<in>insert x F. f x * f x) \<le> sum f (insert x F)
[PROOF STEP]
have "... \<le> f x * f x + sum f F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f x * f x + (\<Sum>x\<in>F. f x * f x) \<le> f x * f x + sum f F
[PROOF STEP]
using insert
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
(\<And>i. i \<in> F \<Longrightarrow> 0 \<le> f i \<and> f i \<le> 1) \<Longrightarrow> (\<Sum>x\<in>F. f x * f x) \<le> sum f F
?i \<in> insert x F \<Longrightarrow> 0 \<le> f ?i \<and> f ?i \<le> 1

goal (1 subgoal):
 1. f x * f x + (\<Sum>x\<in>F. f x * f x) \<le> f x * f x + sum f F
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f x * f x + (\<Sum>x\<in>F. f x * f x) \<le> f x * f x + sum f F

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> 0 \<le> f i \<and> f i \<le> 1) \<Longrightarrow> (\<Sum>x\<in>F. f x * f x) \<le> sum f F; \<And>i. i \<in> insert x F \<Longrightarrow> 0 \<le> f i \<and> f i \<le> 1\<rbrakk> \<Longrightarrow> (\<Sum>x\<in>insert x F. f x * f x) \<le> sum f (insert x F)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f x * f x + (\<Sum>x\<in>F. f x * f x) \<le> f x * f x + sum f F

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> 0 \<le> f i \<and> f i \<le> 1) \<Longrightarrow> (\<Sum>x\<in>F. f x * f x) \<le> sum f F; \<And>i. i \<in> insert x F \<Longrightarrow> 0 \<le> f i \<and> f i \<le> 1\<rbrakk> \<Longrightarrow> (\<Sum>x\<in>insert x F. f x * f x) \<le> sum f (insert x F)
[PROOF STEP]
have "... \<le> f x + sum f F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f x * f x + sum f F \<le> f x + sum f F
[PROOF STEP]
using insert mult_left_le[of "f x" "f x"]
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
(\<And>i. i \<in> F \<Longrightarrow> 0 \<le> f i \<and> f i \<le> 1) \<Longrightarrow> (\<Sum>x\<in>F. f x * f x) \<le> sum f F
?i \<in> insert x F \<Longrightarrow> 0 \<le> f ?i \<and> f ?i \<le> 1
\<lbrakk>f x \<le> 1; 0 \<le> f x\<rbrakk> \<Longrightarrow> f x * f x \<le> f x

goal (1 subgoal):
 1. f x * f x + sum f F \<le> f x + sum f F
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f x * f x + sum f F \<le> f x + sum f F

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> 0 \<le> f i \<and> f i \<le> 1) \<Longrightarrow> (\<Sum>x\<in>F. f x * f x) \<le> sum f F; \<And>i. i \<in> insert x F \<Longrightarrow> 0 \<le> f i \<and> f i \<le> 1\<rbrakk> \<Longrightarrow> (\<Sum>x\<in>insert x F. f x * f x) \<le> sum f (insert x F)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f x * f x + sum f F \<le> f x + sum f F

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> 0 \<le> f i \<and> f i \<le> 1) \<Longrightarrow> (\<Sum>x\<in>F. f x * f x) \<le> sum f F; \<And>i. i \<in> insert x F \<Longrightarrow> 0 \<le> f i \<and> f i \<le> 1\<rbrakk> \<Longrightarrow> (\<Sum>x\<in>insert x F. f x * f x) \<le> sum f (insert x F)
[PROOF STEP]
have "... = sum f (insert x F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f x + sum f F = sum f (insert x F)
[PROOF STEP]
using insert
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
(\<And>i. i \<in> F \<Longrightarrow> 0 \<le> f i \<and> f i \<le> 1) \<Longrightarrow> (\<Sum>x\<in>F. f x * f x) \<le> sum f F
?i \<in> insert x F \<Longrightarrow> 0 \<le> f ?i \<and> f ?i \<le> 1

goal (1 subgoal):
 1. f x + sum f F = sum f (insert x F)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f x + sum f F = sum f (insert x F)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>i. i \<in> F \<Longrightarrow> 0 \<le> f i \<and> f i \<le> 1) \<Longrightarrow> (\<Sum>x\<in>F. f x * f x) \<le> sum f F; \<And>i. i \<in> insert x F \<Longrightarrow> 0 \<le> f i \<and> f i \<le> 1\<rbrakk> \<Longrightarrow> (\<Sum>x\<in>insert x F. f x * f x) \<le> sum f (insert x F)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>x\<in>insert x F. f x * f x) \<le> sum f (insert x F)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(\<Sum>x\<in>insert x F. f x * f x) \<le> sum f (insert x F)

goal (1 subgoal):
 1. (\<Sum>x\<in>insert x F. f x * f x) \<le> sum f (insert x F)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>insert x F. f x * f x) \<le> sum f (insert x F)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma quantale_homset_iff: "f \<in> quantale_homset = (comp_pres f \<and> Sup_pres f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<in> quantale_homset) = (comp_pres f \<and> Sup_pres f)
[PROOF STEP]
unfolding quantale_homset_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<in> {f. comp_pres f \<and> Sup_pres f}) = (comp_pres f \<and> Sup_pres f)
[PROOF STEP]
by clarsimp


[STATEMENT]
lemma makespan_def': "makespan T = Max (T ` {1..m})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. makespan T = Max (T ` {1..m})
[PROOF STEP]
using m_gt_0
[PROOF STATE]
proof (prove)
using this:
0 < m

goal (1 subgoal):
 1. makespan T = Max (T ` {1..m})
[PROOF STEP]
by (simp add: f_Max\<^sub>0_equiv)


[STATEMENT]
lemma vectorize_zero [term_simps]: "vectorize_poly 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vectorize_poly 0 = 0
[PROOF STEP]
by (rule poly_mapping_eqI, simp add: lookup_vectorize_poly term_simps)


[STATEMENT]
lemma closure_Un_frontier: "closure S = S \<union> frontier S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure S = S \<union> frontier S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. closure S = S \<union> frontier S
[PROOF STEP]
have "S \<union> interior S = S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<union> interior S = S
[PROOF STEP]
using interior_subset
[PROOF STATE]
proof (prove)
using this:
interior ?S \<subseteq> ?S

goal (1 subgoal):
 1. S \<union> interior S = S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
S \<union> interior S = S

goal (1 subgoal):
 1. closure S = S \<union> frontier S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
S \<union> interior S = S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
S \<union> interior S = S

goal (1 subgoal):
 1. closure S = S \<union> frontier S
[PROOF STEP]
using closure_subset
[PROOF STATE]
proof (prove)
using this:
S \<union> interior S = S
?S \<subseteq> closure ?S

goal (1 subgoal):
 1. closure S = S \<union> frontier S
[PROOF STEP]
by (auto simp: frontier_def)
[PROOF STATE]
proof (state)
this:
closure S = S \<union> frontier S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rel_interior_open_segment:
  fixes a :: "'a :: euclidean_space"
  shows "rel_interior(open_segment a b) = open_segment a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_interior (open_segment a b) = open_segment a b
[PROOF STEP]
proof (cases "a = b")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a = b \<Longrightarrow> rel_interior (open_segment a b) = open_segment a b
 2. a \<noteq> b \<Longrightarrow> rel_interior (open_segment a b) = open_segment a b
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
a = b

goal (2 subgoals):
 1. a = b \<Longrightarrow> rel_interior (open_segment a b) = open_segment a b
 2. a \<noteq> b \<Longrightarrow> rel_interior (open_segment a b) = open_segment a b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a = b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a = b

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

goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> rel_interior (open_segment a b) = open_segment a b
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> rel_interior (open_segment a b) = open_segment a b
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
a \<noteq> b

goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> rel_interior (open_segment a b) = open_segment a b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<noteq> b
[PROOF STEP]
have "open_segment a b = affine hull {a, b} \<inter> ball ((a + b) /\<^sub>R 2) (norm (b - a) / 2)"
[PROOF STATE]
proof (prove)
using this:
a \<noteq> b

goal (1 subgoal):
 1. open_segment a b = affine hull {a, b} \<inter> ball ((a + b) /\<^sub>R 2) (norm (b - a) / 2)
[PROOF STEP]
by (simp add: open_segment_as_ball)
[PROOF STATE]
proof (state)
this:
open_segment a b = affine hull {a, b} \<inter> ball ((a + b) /\<^sub>R 2) (norm (b - a) / 2)

goal (1 subgoal):
 1. a \<noteq> b \<Longrightarrow> rel_interior (open_segment a b) = open_segment a b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
open_segment a b = affine hull {a, b} \<inter> ball ((a + b) /\<^sub>R 2) (norm (b - a) / 2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
open_segment a b = affine hull {a, b} \<inter> ball ((a + b) /\<^sub>R 2) (norm (b - a) / 2)

goal (1 subgoal):
 1. rel_interior (open_segment a b) = open_segment a b
[PROOF STEP]
unfolding rel_interior_eq openin_open
[PROOF STATE]
proof (prove)
using this:
open_segment a b = affine hull {a, b} \<inter> ball ((a + b) /\<^sub>R 2) (norm (b - a) / 2)

goal (1 subgoal):
 1. \<exists>T. open T \<and> open_segment a b = affine hull open_segment a b \<inter> T
[PROOF STEP]
by (metis Elementary_Metric_Spaces.open_ball False affine_hull_open_segment)
[PROOF STATE]
proof (state)
this:
rel_interior (open_segment a b) = open_segment a b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in linorder_topology) tendsto_le:
  assumes F: "\<not> trivial_limit F"
    and x: "(f \<longlongrightarrow> x) F"
    and y: "(g \<longlongrightarrow> y) F"
    and ev: "eventually (\<lambda>x. g x \<le> f x) F"
  shows "y \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<le> x
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> y \<le> x \<Longrightarrow> False
[PROOF STEP]
assume "\<not> y \<le> x"
[PROOF STATE]
proof (state)
this:
\<not> y \<le> x

goal (1 subgoal):
 1. \<not> y \<le> x \<Longrightarrow> False
[PROOF STEP]
with less_separate[of x y]
[PROOF STATE]
proof (chain)
picking this:
x < y \<Longrightarrow> \<exists>a b. x \<in> {..<a} \<and> y \<in> {b<..} \<and> {..<a} \<inter> {b<..} = {}
\<not> y \<le> x
[PROOF STEP]
obtain a b where xy: "x < a" "b < y" "{..<a} \<inter> {b<..} = {}"
[PROOF STATE]
proof (prove)
using this:
x < y \<Longrightarrow> \<exists>a b. x \<in> {..<a} \<and> y \<in> {b<..} \<and> {..<a} \<inter> {b<..} = {}
\<not> y \<le> x

goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>x < a; b < y; {..<a} \<inter> {b<..} = {}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: not_le)
[PROOF STATE]
proof (state)
this:
x < a
b < y
{..<a} \<inter> {b<..} = {}

goal (1 subgoal):
 1. \<not> y \<le> x \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x < a
b < y
{..<a} \<inter> {b<..} = {}
[PROOF STEP]
have "eventually (\<lambda>x. f x < a) F" "eventually (\<lambda>x. b < g x) F"
[PROOF STATE]
proof (prove)
using this:
x < a
b < y
{..<a} \<inter> {b<..} = {}

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. f x < a &&& \<forall>\<^sub>F x in F. b < g x
[PROOF STEP]
using x y
[PROOF STATE]
proof (prove)
using this:
x < a
b < y
{..<a} \<inter> {b<..} = {}
(f \<longlongrightarrow> x) F
(g \<longlongrightarrow> y) F

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. f x < a &&& \<forall>\<^sub>F x in F. b < g x
[PROOF STEP]
by (auto intro: order_tendstoD)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. f x < a
\<forall>\<^sub>F x in F. b < g x

goal (1 subgoal):
 1. \<not> y \<le> x \<Longrightarrow> False
[PROOF STEP]
with ev
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in F. g x \<le> f x
\<forall>\<^sub>F x in F. f x < a
\<forall>\<^sub>F x in F. b < g x
[PROOF STEP]
have "eventually (\<lambda>x. False) F"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. g x \<le> f x
\<forall>\<^sub>F x in F. f x < a
\<forall>\<^sub>F x in F. b < g x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. False
[PROOF STEP]
by eventually_elim (insert xy, fastforce)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. False

goal (1 subgoal):
 1. \<not> y \<le> x \<Longrightarrow> False
[PROOF STEP]
with F
[PROOF STATE]
proof (chain)
picking this:
F \<noteq> bot
\<forall>\<^sub>F x in F. False
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
F \<noteq> bot
\<forall>\<^sub>F x in F. False

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma round_up_correct: "round_up e f - f \<in> {0..2 powr -e}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. round_up e f - f \<in> {0..2 powr - real_of_int e}
[PROOF STEP]
unfolding atLeastAtMost_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> round_up e f - f \<and> round_up e f - f \<le> 2 powr - real_of_int e
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 \<le> round_up e f - f
 2. round_up e f - f \<le> 2 powr - real_of_int e
[PROOF STEP]
have "round_up e f - f \<le> round_up e f - round_down e f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. round_up e f - f \<le> round_up e f - round_down e f
[PROOF STEP]
using round_down
[PROOF STATE]
proof (prove)
using this:
round_down ?prec ?x \<le> ?x

goal (1 subgoal):
 1. round_up e f - f \<le> round_up e f - round_down e f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
round_up e f - f \<le> round_up e f - round_down e f

goal (2 subgoals):
 1. 0 \<le> round_up e f - f
 2. round_up e f - f \<le> 2 powr - real_of_int e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
round_up e f - f \<le> round_up e f - round_down e f

goal (2 subgoals):
 1. 0 \<le> round_up e f - f
 2. round_up e f - f \<le> 2 powr - real_of_int e
[PROOF STEP]
have "\<dots> \<le> 2 powr -e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. round_up e f - round_down e f \<le> 2 powr real_of_int (- e)
[PROOF STEP]
using round_up_diff_round_down
[PROOF STATE]
proof (prove)
using this:
round_up ?prec ?x - round_down ?prec ?x \<le> 2 powr - real_of_int ?prec

goal (1 subgoal):
 1. round_up e f - round_down e f \<le> 2 powr real_of_int (- e)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
round_up e f - round_down e f \<le> 2 powr real_of_int (- e)

goal (2 subgoals):
 1. 0 \<le> round_up e f - f
 2. round_up e f - f \<le> 2 powr - real_of_int e
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
round_up e f - f \<le> 2 powr real_of_int (- e)
[PROOF STEP]
show "round_up e f - f \<le> 2 powr - (real_of_int e)"
[PROOF STATE]
proof (prove)
using this:
round_up e f - f \<le> 2 powr real_of_int (- e)

goal (1 subgoal):
 1. round_up e f - f \<le> 2 powr - real_of_int e
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
round_up e f - f \<le> 2 powr - real_of_int e

goal (1 subgoal):
 1. 0 \<le> round_up e f - f
[PROOF STEP]
qed (simp add: algebra_simps round_up)


[STATEMENT]
lemma VInter_lower:
  assumes "x \<in>\<^sub>\<circ> A"
  shows "\<Inter>\<^sub>\<circ> A \<subseteq>\<^sub>\<circ> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Inter>\<^sub>\<circ> A \<subseteq>\<^sub>\<circ> x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in>\<^sub>\<circ> A

goal (1 subgoal):
 1. \<Inter>\<^sub>\<circ> A \<subseteq>\<^sub>\<circ> x
[PROOF STEP]
by auto


[STATEMENT]
lemma sum_arb:
  assumes A_fin: "finite A"
      and x_mem: "x \<in> A"
      and x_dif: "\<forall>y\<in>A. y \<noteq> x \<longrightarrow> g y = h y"
    shows "(\<Sum>a\<in>A. g a) = (\<Sum>a\<in>A - {x}. h a) + g x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum g A = sum h (A - {x}) + g x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum g A = sum h (A - {x}) + g x
[PROOF STEP]
have "A = (A - {x}) \<union> {x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = A - {x} \<union> {x}
[PROOF STEP]
using x_mem
[PROOF STATE]
proof (prove)
using this:
x \<in> A

goal (1 subgoal):
 1. A = A - {x} \<union> {x}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A = A - {x} \<union> {x}

goal (1 subgoal):
 1. sum g A = sum h (A - {x}) + g x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
A = A - {x} \<union> {x}

goal (1 subgoal):
 1. sum g A = sum h (A - {x}) + g x
[PROOF STEP]
note sum.union_disjoint[of "A - {x}" "{x}" g]
[PROOF STATE]
proof (state)
this:
\<lbrakk>finite (A - {x}); finite {x}; (A - {x}) \<inter> {x} = {}\<rbrakk> \<Longrightarrow> sum g (A - {x} \<union> {x}) = sum g (A - {x}) + sum g {x}

goal (1 subgoal):
 1. sum g A = sum h (A - {x}) + g x
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<lbrakk>finite (A - {x}); finite {x}; (A - {x}) \<inter> {x} = {}\<rbrakk> \<Longrightarrow> sum g (A - {x} \<union> {x}) = sum g (A - {x}) + sum g {x}

goal (1 subgoal):
 1. sum g A = sum h (A - {x}) + g x
[PROOF STEP]
note sum.cong[of "A - {x}" "A - {x}" g h]
[PROOF STATE]
proof (state)
this:
\<lbrakk>A - {x} = A - {x}; \<And>xa. xa \<in> A - {x} \<Longrightarrow> g xa = h xa\<rbrakk> \<Longrightarrow> sum g (A - {x}) = sum h (A - {x})

goal (1 subgoal):
 1. sum g A = sum h (A - {x}) + g x
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
A = A - {x} \<union> {x}
\<lbrakk>finite (A - {x}); finite {x}; (A - {x}) \<inter> {x} = {}\<rbrakk> \<Longrightarrow> sum g (A - {x} \<union> {x}) = sum g (A - {x}) + sum g {x}
\<lbrakk>A - {x} = A - {x}; \<And>xa. xa \<in> A - {x} \<Longrightarrow> g xa = h xa\<rbrakk> \<Longrightarrow> sum g (A - {x}) = sum h (A - {x})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
A = A - {x} \<union> {x}
\<lbrakk>finite (A - {x}); finite {x}; (A - {x}) \<inter> {x} = {}\<rbrakk> \<Longrightarrow> sum g (A - {x} \<union> {x}) = sum g (A - {x}) + sum g {x}
\<lbrakk>A - {x} = A - {x}; \<And>xa. xa \<in> A - {x} \<Longrightarrow> g xa = h xa\<rbrakk> \<Longrightarrow> sum g (A - {x}) = sum h (A - {x})

goal (1 subgoal):
 1. sum g A = sum h (A - {x}) + g x
[PROOF STEP]
using A_fin x_dif
[PROOF STATE]
proof (prove)
using this:
A = A - {x} \<union> {x}
\<lbrakk>finite (A - {x}); finite {x}; (A - {x}) \<inter> {x} = {}\<rbrakk> \<Longrightarrow> sum g (A - {x} \<union> {x}) = sum g (A - {x}) + sum g {x}
\<lbrakk>A - {x} = A - {x}; \<And>xa. xa \<in> A - {x} \<Longrightarrow> g xa = h xa\<rbrakk> \<Longrightarrow> sum g (A - {x}) = sum h (A - {x})
finite A
\<forall>y\<in>A. y \<noteq> x \<longrightarrow> g y = h y

goal (1 subgoal):
 1. sum g A = sum h (A - {x}) + g x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sum g A = sum h (A - {x}) + g x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ceiling_le_numeral [simp]: "\<lceil>x\<rceil> \<le> numeral v \<longleftrightarrow> x \<le> numeral v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lceil>x\<rceil> \<le> numeral v) = (x \<le> numeral v)
[PROOF STEP]
by (simp add: ceiling_le_iff)


[STATEMENT]
lemma euclid_Col_cart2_incident:
  assumes "z_non_zero p" and "z_non_zero q" and "z_non_zero r" and "p \<noteq> q"
  and "proj2_incident p l" and "proj2_incident q l"
  and "real_euclid.Col (cart2_pt p) (cart2_pt q) (cart2_pt r)"
  (is "real_euclid.Col ?cp ?cq ?cr")
  shows "proj2_incident r l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. proj2_incident r l
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. proj2_incident r l
[PROOF STEP]
from \<open>z_non_zero p\<close> and \<open>z_non_zero q\<close> and \<open>z_non_zero r\<close>
    and \<open>real_euclid.Col ?cp ?cq ?cr\<close>
[PROOF STATE]
proof (chain)
picking this:
z_non_zero p
z_non_zero q
z_non_zero r
real_euclid.Col (cart2_pt p) (cart2_pt q) (cart2_pt r)
[PROOF STEP]
have "proj2_Col p q r"
[PROOF STATE]
proof (prove)
using this:
z_non_zero p
z_non_zero q
z_non_zero r
real_euclid.Col (cart2_pt p) (cart2_pt q) (cart2_pt r)

goal (1 subgoal):
 1. proj2_Col p q r
[PROOF STEP]
by (subst proj2_Col_iff_euclid_cart2, simp_all)
[PROOF STATE]
proof (state)
this:
proj2_Col p q r

goal (1 subgoal):
 1. proj2_incident r l
[PROOF STEP]
hence "proj2_set_Col {p,q,r}"
[PROOF STATE]
proof (prove)
using this:
proj2_Col p q r

goal (1 subgoal):
 1. proj2_set_Col {p, q, r}
[PROOF STEP]
by (simp add: proj2_Col_iff_set_Col)
[PROOF STATE]
proof (state)
this:
proj2_set_Col {p, q, r}

goal (1 subgoal):
 1. proj2_incident r l
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
proj2_set_Col {p, q, r}
[PROOF STEP]
obtain m where
    "proj2_incident p m" and "proj2_incident q m" and "proj2_incident r m"
[PROOF STATE]
proof (prove)
using this:
proj2_set_Col {p, q, r}

goal (1 subgoal):
 1. (\<And>m. \<lbrakk>proj2_incident p m; proj2_incident q m; proj2_incident r m\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (unfold proj2_set_Col_def, auto)
[PROOF STATE]
proof (state)
this:
proj2_incident p m
proj2_incident q m
proj2_incident r m

goal (1 subgoal):
 1. proj2_incident r l
[PROOF STEP]
from \<open>p \<noteq> q\<close> and \<open>proj2_incident p l\<close> and \<open>proj2_incident q l\<close>
    and \<open>proj2_incident p m\<close> and \<open>proj2_incident q m\<close> and proj2_incident_unique
[PROOF STATE]
proof (chain)
picking this:
p \<noteq> q
proj2_incident p l
proj2_incident q l
proj2_incident p m
proj2_incident q m
\<lbrakk>proj2_incident ?p ?l; proj2_incident ?q ?l; proj2_incident ?p ?m; proj2_incident ?q ?m\<rbrakk> \<Longrightarrow> ?p = ?q \<or> ?l = ?m
[PROOF STEP]
have "l = m"
[PROOF STATE]
proof (prove)
using this:
p \<noteq> q
proj2_incident p l
proj2_incident q l
proj2_incident p m
proj2_incident q m
\<lbrakk>proj2_incident ?p ?l; proj2_incident ?q ?l; proj2_incident ?p ?m; proj2_incident ?q ?m\<rbrakk> \<Longrightarrow> ?p = ?q \<or> ?l = ?m

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

goal (1 subgoal):
 1. proj2_incident r l
[PROOF STEP]
with \<open>proj2_incident r m\<close>
[PROOF STATE]
proof (chain)
picking this:
proj2_incident r m
l = m
[PROOF STEP]
show "proj2_incident r l"
[PROOF STATE]
proof (prove)
using this:
proj2_incident r m
l = m

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma par_comm: "a * b = b * a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * b = b * a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a * b = b * a
[PROOF STEP]
have "(b*a) ; (1*1) \<le>\<^sub>\<K> (a;1) * (b;1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b * a ; ((1::'a) * (1::'a)) \<le> a ; (1::'a) * (b ; (1::'a))
[PROOF STEP]
by (simp only:  exchange)
[PROOF STATE]
proof (state)
this:
b * a ; ((1::'a) * (1::'a)) \<le> a ; (1::'a) * (b ; (1::'a))

goal (1 subgoal):
 1. a * b = b * a
[PROOF STEP]
hence "b * a \<le>\<^sub>\<K> a * b"
[PROOF STATE]
proof (prove)
using this:
b * a ; ((1::'a) * (1::'a)) \<le> a ; (1::'a) * (b ; (1::'a))

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

goal (1 subgoal):
 1. a * b = b * a
[PROOF STEP]
hence "a * b \<le>\<^sub>\<K> b * a \<longleftrightarrow> a * b  = b * a"
[PROOF STATE]
proof (prove)
using this:
b * a \<le> a * b

goal (1 subgoal):
 1. (a * b \<le> b * a) = (a * b = b * a)
[PROOF STEP]
by (rule antisym_conv)
[PROOF STATE]
proof (state)
this:
(a * b \<le> b * a) = (a * b = b * a)

goal (1 subgoal):
 1. a * b = b * a
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(a * b \<le> b * a) = (a * b = b * a)

goal (1 subgoal):
 1. a * b = b * a
[PROOF STEP]
have "a * b \<le>\<^sub>\<K> b * a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * b \<le> b * a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a * b \<le> b * a
[PROOF STEP]
have "(a*b) ; (1*1) \<le>\<^sub>\<K> (b;1) * (a;1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * b ; ((1::'a) * (1::'a)) \<le> b ; (1::'a) * (a ; (1::'a))
[PROOF STEP]
by (rule  exchange)
[PROOF STATE]
proof (state)
this:
a * b ; ((1::'a) * (1::'a)) \<le> b ; (1::'a) * (a ; (1::'a))

goal (1 subgoal):
 1. a * b \<le> b * a
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
a * b ; ((1::'a) * (1::'a)) \<le> b ; (1::'a) * (a ; (1::'a))

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
a * b \<le> b * a

goal (1 subgoal):
 1. a * b = b * a
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(a * b \<le> b * a) = (a * b = b * a)
a * b \<le> b * a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(a * b \<le> b * a) = (a * b = b * a)
a * b \<le> b * a

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma quad_form_hermitean_real:
  assumes "hermitean H"
  shows "is_real (quad_form z H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_real (quad_form z H)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
hermitean H

goal (1 subgoal):
 1. is_real (quad_form z H)
[PROOF STEP]
by (subst eq_cnj_iff_real[symmetric])  (simp del: quad_form_def add: hermitean_def)


[STATEMENT]
theorem sup_state_trans [trans]:
  "\<lbrakk>G \<turnstile> a <=s b; G \<turnstile> b <=s c\<rbrakk> \<Longrightarrow> G \<turnstile> a <=s c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>G \<turnstile> a <=s b; G \<turnstile> b <=s c\<rbrakk> \<Longrightarrow> G \<turnstile> a <=s c
[PROOF STEP]
by (auto intro: sup_loc_trans simp add: sup_state_def stk_convert Product.le_def lesub_def)


[STATEMENT]
lemma sparse_identity:
  assumes "sparse \<delta> (set ps)" "\<forall>p \<in> set ps. \<delta> \<le> dist p\<^sub>0 p"
  shows "sparse \<delta> (set (p\<^sub>0 # ps))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sparse \<delta> (set (p\<^sub>0 # ps))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
sparse \<delta> (set ps)
\<forall>p\<in>set ps. \<delta> \<le> dist (case p\<^sub>0 of (x, y) \<Rightarrow> (real_of_int x, real_of_int y)) (case p of (x, y) \<Rightarrow> (real_of_int x, real_of_int y))

goal (1 subgoal):
 1. sparse \<delta> (set (p\<^sub>0 # ps))
[PROOF STEP]
by (simp add: dist_commute sparse_def)


[STATEMENT]
lemma summable_If_finite[simp, intro]: "finite {r. P r} \<Longrightarrow> summable (\<lambda>r. if P r then f r else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {r. P r} \<Longrightarrow> summable (\<lambda>r. if P r then f r else (0::'a))
[PROOF STEP]
by (rule sums_summable) (rule sums_If_finite)


[STATEMENT]
lemma mult_mod_cancel_right:
  fixes m :: "'a::{euclidean_ring_cancel,semiring_gcd}"
  assumes eq: "(a * n) mod m = (b * n) mod m" and "coprime m n"
  shows "a mod m = b mod m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a mod m = b mod m
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a mod m = b mod m
[PROOF STEP]
have "m dvd (a*n - b*n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m dvd a * n - b * n
[PROOF STEP]
using eq mod_eq_dvd_iff
[PROOF STATE]
proof (prove)
using this:
a * n mod m = b * n mod m
(?a mod ?c = ?b mod ?c) = (?c dvd ?a - ?b)

goal (1 subgoal):
 1. m dvd a * n - b * n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
m dvd a * n - b * n

goal (1 subgoal):
 1. a mod m = b mod m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
m dvd a * n - b * n
[PROOF STEP]
have "m dvd a-b"
[PROOF STATE]
proof (prove)
using this:
m dvd a * n - b * n

goal (1 subgoal):
 1. m dvd a - b
[PROOF STEP]
by (metis \<open>coprime m n\<close> coprime_dvd_mult_left_iff left_diff_distrib')
[PROOF STATE]
proof (state)
this:
m dvd a - b

goal (1 subgoal):
 1. a mod m = b mod m
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
m dvd a - b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
m dvd a - b

goal (1 subgoal):
 1. a mod m = b mod m
[PROOF STEP]
using mod_eq_dvd_iff
[PROOF STATE]
proof (prove)
using this:
m dvd a - b
(?a mod ?c = ?b mod ?c) = (?c dvd ?a - ?b)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in is_functor) is_functor_op'[cat_op_intros]:
  assumes "\<AA>' = op_cat \<AA>" and "\<BB>' = op_cat \<BB>"
  shows "op_cf \<FF> : \<AA>' \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<BB>'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. op_cf \<FF> : \<AA>' \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<BB>'
[PROOF STEP]
unfolding assms(1,2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. op_cf \<FF> : op_cat \<AA> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> op_cat \<BB>
[PROOF STEP]
by (rule is_functor_op)


[STATEMENT]
lemma has_contour_integral_linepath_Reals_iff:
  fixes a b :: complex and f :: "complex \<Rightarrow> complex"
  assumes "a \<in> Reals" "b \<in> Reals" "Re a < Re b"
  shows   "(f has_contour_integral I) (linepath a b) \<longleftrightarrow>
             ((\<lambda>x. f (of_real x)) has_integral I) {Re a..Re b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_contour_integral I) (linepath a b) = ((\<lambda>x. f (complex_of_real x)) has_integral I) {Re a..Re b}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (f has_contour_integral I) (linepath a b) = ((\<lambda>x. f (complex_of_real x)) has_integral I) {Re a..Re b}
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
a \<in> \<real>
b \<in> \<real>
Re a < Re b
[PROOF STEP]
have [simp]: "of_real (Re a) = a" "of_real (Re b) = b"
[PROOF STATE]
proof (prove)
using this:
a \<in> \<real>
b \<in> \<real>
Re a < Re b

goal (1 subgoal):
 1. complex_of_real (Re a) = a &&& complex_of_real (Re b) = b
[PROOF STEP]
by (simp_all add: complex_eq_iff)
[PROOF STATE]
proof (state)
this:
complex_of_real (Re a) = a
complex_of_real (Re b) = b

goal (1 subgoal):
 1. (f has_contour_integral I) (linepath a b) = ((\<lambda>x. f (complex_of_real x)) has_integral I) {Re a..Re b}
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
a \<in> \<real>
b \<in> \<real>
Re a < Re b
[PROOF STEP]
have "a \<noteq> b"
[PROOF STATE]
proof (prove)
using this:
a \<in> \<real>
b \<in> \<real>
Re a < Re b

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

goal (1 subgoal):
 1. (f has_contour_integral I) (linepath a b) = ((\<lambda>x. f (complex_of_real x)) has_integral I) {Re a..Re b}
[PROOF STEP]
have "((\<lambda>x. f (of_real x)) has_integral I) (cbox (Re a) (Re b)) \<longleftrightarrow>
          ((\<lambda>x. f (a + b * of_real x - a * of_real x)) has_integral I /\<^sub>R (Re b - Re a)) {0..1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f (complex_of_real x)) has_integral I) (cbox (Re a) (Re b)) = ((\<lambda>x. f (a + b * complex_of_real x - a * complex_of_real x)) has_integral I /\<^sub>R (Re b - Re a)) {0..1}
[PROOF STEP]
by (subst has_integral_affinity_iff [of "Re b - Re a" _ "Re a", symmetric])
       (insert assms, simp_all add: field_simps scaleR_conv_of_real)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. f (complex_of_real x)) has_integral I) (cbox (Re a) (Re b)) = ((\<lambda>x. f (a + b * complex_of_real x - a * complex_of_real x)) has_integral I /\<^sub>R (Re b - Re a)) {0..1}

goal (1 subgoal):
 1. (f has_contour_integral I) (linepath a b) = ((\<lambda>x. f (complex_of_real x)) has_integral I) {Re a..Re b}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<lambda>x. f (complex_of_real x)) has_integral I) (cbox (Re a) (Re b)) = ((\<lambda>x. f (a + b * complex_of_real x - a * complex_of_real x)) has_integral I /\<^sub>R (Re b - Re a)) {0..1}

goal (1 subgoal):
 1. (f has_contour_integral I) (linepath a b) = ((\<lambda>x. f (complex_of_real x)) has_integral I) {Re a..Re b}
[PROOF STEP]
have "(\<lambda>x. f (a + b * of_real x - a * of_real x)) =
               (\<lambda>x. (f (a + b * of_real x - a * of_real x) * (b - a)) /\<^sub>R (Re b - Re a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. f (a + b * complex_of_real x - a * complex_of_real x)) = (\<lambda>x. f (a + b * complex_of_real x - a * complex_of_real x) * (b - a) /\<^sub>R (Re b - Re a))
[PROOF STEP]
using \<open>a \<noteq> b\<close>
[PROOF STATE]
proof (prove)
using this:
a \<noteq> b

goal (1 subgoal):
 1. (\<lambda>x. f (a + b * complex_of_real x - a * complex_of_real x)) = (\<lambda>x. f (a + b * complex_of_real x - a * complex_of_real x) * (b - a) /\<^sub>R (Re b - Re a))
[PROOF STEP]
by (auto simp: field_simps fun_eq_iff scaleR_conv_of_real)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. f (a + b * complex_of_real x - a * complex_of_real x)) = (\<lambda>x. f (a + b * complex_of_real x - a * complex_of_real x) * (b - a) /\<^sub>R (Re b - Re a))

goal (1 subgoal):
 1. (f has_contour_integral I) (linepath a b) = ((\<lambda>x. f (complex_of_real x)) has_integral I) {Re a..Re b}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>x. f (a + b * complex_of_real x - a * complex_of_real x)) = (\<lambda>x. f (a + b * complex_of_real x - a * complex_of_real x) * (b - a) /\<^sub>R (Re b - Re a))

goal (1 subgoal):
 1. (f has_contour_integral I) (linepath a b) = ((\<lambda>x. f (complex_of_real x)) has_integral I) {Re a..Re b}
[PROOF STEP]
have "(\<dots> has_integral I /\<^sub>R (Re b - Re a)) {0..1} \<longleftrightarrow>
               ((\<lambda>x. f (linepath a b x) * (b - a)) has_integral I) {0..1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f (a + b * complex_of_real x - a * complex_of_real x) * (b - a) /\<^sub>R (Re b - Re a)) has_integral I /\<^sub>R (Re b - Re a)) {0..1} = ((\<lambda>x. f (linepath a b x) * (b - a)) has_integral I) {0..1}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<in> \<real>
b \<in> \<real>
Re a < Re b

goal (1 subgoal):
 1. ((\<lambda>x. f (a + b * complex_of_real x - a * complex_of_real x) * (b - a) /\<^sub>R (Re b - Re a)) has_integral I /\<^sub>R (Re b - Re a)) {0..1} = ((\<lambda>x. f (linepath a b x) * (b - a)) has_integral I) {0..1}
[PROOF STEP]
by (subst has_integral_cmul_iff) (auto simp: linepath_def scaleR_conv_of_real algebra_simps)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. f (a + b * complex_of_real x - a * complex_of_real x) * (b - a) /\<^sub>R (Re b - Re a)) has_integral I /\<^sub>R (Re b - Re a)) {0..1} = ((\<lambda>x. f (linepath a b x) * (b - a)) has_integral I) {0..1}

goal (1 subgoal):
 1. (f has_contour_integral I) (linepath a b) = ((\<lambda>x. f (complex_of_real x)) has_integral I) {Re a..Re b}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<lambda>x. f (a + b * complex_of_real x - a * complex_of_real x) * (b - a) /\<^sub>R (Re b - Re a)) has_integral I /\<^sub>R (Re b - Re a)) {0..1} = ((\<lambda>x. f (linepath a b x) * (b - a)) has_integral I) {0..1}

goal (1 subgoal):
 1. (f has_contour_integral I) (linepath a b) = ((\<lambda>x. f (complex_of_real x)) has_integral I) {Re a..Re b}
[PROOF STEP]
have "\<dots> \<longleftrightarrow> (f has_contour_integral I) (linepath a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f (linepath a b x) * (b - a)) has_integral I) {0..1} = (f has_contour_integral I) (linepath a b)
[PROOF STEP]
unfolding has_contour_integral_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f (linepath a b x) * (b - a)) has_integral I) {0..1} = ((\<lambda>x. f (linepath a b x) * vector_derivative (linepath a b) (at x within {0..1})) has_integral I) {0..1}
[PROOF STEP]
by (intro has_integral_cong) (simp add: vector_derivative_linepath_within)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. f (linepath a b x) * (b - a)) has_integral I) {0..1} = (f has_contour_integral I) (linepath a b)

goal (1 subgoal):
 1. (f has_contour_integral I) (linepath a b) = ((\<lambda>x. f (complex_of_real x)) has_integral I) {Re a..Re b}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. f (complex_of_real x)) has_integral I) (cbox (Re a) (Re b)) = (f has_contour_integral I) (linepath a b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. f (complex_of_real x)) has_integral I) (cbox (Re a) (Re b)) = (f has_contour_integral I) (linepath a b)

goal (1 subgoal):
 1. (f has_contour_integral I) (linepath a b) = ((\<lambda>x. f (complex_of_real x)) has_integral I) {Re a..Re b}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(f has_contour_integral I) (linepath a b) = ((\<lambda>x. f (complex_of_real x)) has_integral I) {Re a..Re b}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma take_bit_unset_bit_eq:
  \<open>take_bit n (unset_bit m a) = (if n \<le> m then take_bit n a else unset_bit m (take_bit n a))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. take_bit n (unset_bit m a) = (if n \<le> m then take_bit n a else unset_bit m (take_bit n a))
[PROOF STEP]
by (rule bit_eqI) (auto simp add: bit_take_bit_iff bit_unset_bit_iff)


[STATEMENT]
lemma orth_symmetry:
  assumes "A B C Orth U V"
  shows "A B C Orth V U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A B C Orth V U
[PROOF STEP]
by (meson Orth_def assms orth_at_symmetry)


[STATEMENT]
lemma flat_pm_of_poly_of_focus [simp]: "flat_pm_of_poly x (poly_of_focus x p) = p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. flat_pm_of_poly x (poly_of_focus x p) = p
[PROOF STEP]
by (simp add: flat_pm_of_poly_def poly_of_focus_def pm_of_poly_of_pm focus_in_Polys)


[STATEMENT]
lemma Set_filter_cong [cong]:
    "(\<And>x. x \<in> A \<Longrightarrow> P x \<longleftrightarrow> Q x) \<Longrightarrow> A = B \<Longrightarrow>  Set.filter P A = Set.filter Q B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x. x \<in> A \<Longrightarrow> P x = Q x; A = B\<rbrakk> \<Longrightarrow> Set.filter P A = Set.filter Q B
[PROOF STEP]
by (auto simp: Set.filter_def)


[STATEMENT]
lemma blinfunpow_assoc: "(F::'a::real_normed_vector \<Rightarrow>\<^sub>L 'a) ^^ (Suc n) =(F ^^n) o\<^sub>L F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F ^^ Suc n = F ^^ n o\<^sub>L F
[PROOF STEP]
by (induction n) (auto simp: blinfun_compose_assoc[symmetric])


[STATEMENT]
lemma (in finite_measure) integrable_measure:
  assumes I: "disjoint_family_on X I" "countable I"
  shows "integrable (count_space I) (\<lambda>i. measure M (X i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable (count_space I) (\<lambda>i. Sigma_Algebra.measure M (X i))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integrable (count_space I) (\<lambda>i. Sigma_Algebra.measure M (X i))
[PROOF STEP]
have "(\<integral>\<^sup>+i. measure M (X i) \<partial>count_space I) = (\<integral>\<^sup>+i. measure M (if X i \<in> sets M then X i else {}) \<partial>count_space I)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (Sigma_Algebra.measure M (X x)) \<partial>count_space I = \<integral>\<^sup>+ x. ennreal (Sigma_Algebra.measure M (if X x \<in> sets M then X x else {})) \<partial>count_space I
[PROOF STEP]
by (auto intro!: nn_integral_cong measure_notin_sets)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (Sigma_Algebra.measure M (X x)) \<partial>count_space I = \<integral>\<^sup>+ x. ennreal (Sigma_Algebra.measure M (if X x \<in> sets M then X x else {})) \<partial>count_space I

goal (1 subgoal):
 1. integrable (count_space I) (\<lambda>i. Sigma_Algebra.measure M (X i))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (Sigma_Algebra.measure M (X x)) \<partial>count_space I = \<integral>\<^sup>+ x. ennreal (Sigma_Algebra.measure M (if X x \<in> sets M then X x else {})) \<partial>count_space I

goal (1 subgoal):
 1. integrable (count_space I) (\<lambda>i. Sigma_Algebra.measure M (X i))
[PROOF STEP]
have "\<dots> = measure M (\<Union>i\<in>I. if X i \<in> sets M then X i else {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (Sigma_Algebra.measure M (if X x \<in> sets M then X x else {})) \<partial>count_space I = ennreal (Sigma_Algebra.measure M (\<Union>i\<in>I. if X i \<in> sets M then X i else {}))
[PROOF STEP]
using I
[PROOF STATE]
proof (prove)
using this:
disjoint_family_on X I
countable I

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (Sigma_Algebra.measure M (if X x \<in> sets M then X x else {})) \<partial>count_space I = ennreal (Sigma_Algebra.measure M (\<Union>i\<in>I. if X i \<in> sets M then X i else {}))
[PROOF STEP]
unfolding emeasure_eq_measure[symmetric]
[PROOF STATE]
proof (prove)
using this:
disjoint_family_on X I
countable I

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. emeasure M (if X x \<in> sets M then X x else {}) \<partial>count_space I = emeasure M (\<Union>i\<in>I. if X i \<in> sets M then X i else {})
[PROOF STEP]
by (subst emeasure_UN_countable) (auto simp: disjoint_family_on_def)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (Sigma_Algebra.measure M (if X x \<in> sets M then X x else {})) \<partial>count_space I = ennreal (Sigma_Algebra.measure M (\<Union>i\<in>I. if X i \<in> sets M then X i else {}))

goal (1 subgoal):
 1. integrable (count_space I) (\<lambda>i. Sigma_Algebra.measure M (X i))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<integral>\<^sup>+ x. ennreal (Sigma_Algebra.measure M (X x)) \<partial>count_space I = ennreal (Sigma_Algebra.measure M (\<Union>i\<in>I. if X i \<in> sets M then X i else {}))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+ x. ennreal (Sigma_Algebra.measure M (X x)) \<partial>count_space I = ennreal (Sigma_Algebra.measure M (\<Union>i\<in>I. if X i \<in> sets M then X i else {}))

goal (1 subgoal):
 1. integrable (count_space I) (\<lambda>i. Sigma_Algebra.measure M (X i))
[PROOF STEP]
by (auto intro!: integrableI_bounded)
[PROOF STATE]
proof (state)
this:
integrable (count_space I) (\<lambda>i. Sigma_Algebra.measure M (X i))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nonneg_mat_ge_zero: "0 \<le> Q \<Longrightarrow> 0 \<le> v \<Longrightarrow> 0 \<le> Q *v (v :: real^'c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> Q; 0 \<le> v\<rbrakk> \<Longrightarrow> 0 \<le> Q *v v
[PROOF STEP]
unfolding Finite_Cartesian_Product.less_eq_vec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>i ia. 0 $ i $ ia \<le> Q $ i $ ia; \<forall>i. 0 $ i \<le> v $ i\<rbrakk> \<Longrightarrow> \<forall>i. 0 $ i \<le> (Q *v v) $ i
[PROOF STEP]
by (auto intro!: sum_nonneg simp: matrix_vector_mult_def)


[STATEMENT]
lemma iteration_mono_lesseq: assumes x: "x \<ge> 0" and n: "n \<ge> 0" and xn: "x ^ p \<ge> (n :: int)"
  shows "(n div x ^ pm + x * int pm) div int p \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (n div x ^ pm + x * int pm) div int p \<le> x
[PROOF STEP]
proof (cases "x ^ p = n")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x ^ p = n \<Longrightarrow> (n div x ^ pm + x * int pm) div int p \<le> x
 2. x ^ p \<noteq> n \<Longrightarrow> (n div x ^ pm + x * int pm) div int p \<le> x
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x ^ p = n

goal (2 subgoals):
 1. x ^ p = n \<Longrightarrow> (n div x ^ pm + x * int pm) div int p \<le> x
 2. x ^ p \<noteq> n \<Longrightarrow> (n div x ^ pm + x * int pm) div int p \<le> x
[PROOF STEP]
from iteration_mono_eq[OF this]
[PROOF STATE]
proof (chain)
picking this:
(n div x ^ pm + x * int pm) div int p = x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(n div x ^ pm + x * int pm) div int p = x

goal (1 subgoal):
 1. (n div x ^ pm + x * int pm) div int p \<le> x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(n div x ^ pm + x * int pm) div int p \<le> x

goal (1 subgoal):
 1. x ^ p \<noteq> n \<Longrightarrow> (n div x ^ pm + x * int pm) div int p \<le> x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x ^ p \<noteq> n \<Longrightarrow> (n div x ^ pm + x * int pm) div int p \<le> x
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
x ^ p \<noteq> n

goal (1 subgoal):
 1. x ^ p \<noteq> n \<Longrightarrow> (n div x ^ pm + x * int pm) div int p \<le> x
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
0 \<le> x
0 \<le> n
n \<le> x ^ p
x ^ p \<noteq> n
[PROOF STEP]
have "x ^ p > n"
[PROOF STATE]
proof (prove)
using this:
0 \<le> x
0 \<le> n
n \<le> x ^ p
x ^ p \<noteq> n

goal (1 subgoal):
 1. n < x ^ p
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n < x ^ p

goal (1 subgoal):
 1. x ^ p \<noteq> n \<Longrightarrow> (n div x ^ pm + x * int pm) div int p \<le> x
[PROOF STEP]
from iteration_mono_less[OF x n this]
[PROOF STATE]
proof (chain)
picking this:
(n div x ^ pm + x * int pm) div int p < x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(n div x ^ pm + x * int pm) div int p < x

goal (1 subgoal):
 1. (n div x ^ pm + x * int pm) div int p \<le> x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(n div x ^ pm + x * int pm) div int p \<le> x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sorted_wrt_take_drop:
  "sorted_wrt f xs \<Longrightarrow> \<forall>x \<in> set (take n xs). \<forall>y \<in> set (drop n xs). f x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted_wrt f xs \<Longrightarrow> \<forall>x\<in>set (take n xs). \<forall>y\<in>set (drop n xs). f x y
[PROOF STEP]
using sorted_wrt_append[of f "take n xs" "drop n xs"]
[PROOF STATE]
proof (prove)
using this:
sorted_wrt f (take n xs @ drop n xs) = (sorted_wrt f (take n xs) \<and> sorted_wrt f (drop n xs) \<and> (\<forall>x\<in>set (take n xs). \<forall>y\<in>set (drop n xs). f x y))

goal (1 subgoal):
 1. sorted_wrt f xs \<Longrightarrow> \<forall>x\<in>set (take n xs). \<forall>y\<in>set (drop n xs). f x y
[PROOF STEP]
by simp


[STATEMENT]
lemma fv_Conjs_disjoint[simp]: "distinct xys \<Longrightarrow> fv (Conjs_disjoint Q xys) = fv Q \<union> Field (set xys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct xys \<Longrightarrow> fv (Conjs_disjoint Q xys) = fv Q \<union> Field (set xys)
[PROOF STEP]
proof (induct Q xys rule: Conjs_disjoint.induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>Q xys. \<lbrakk>\<And>x2 x y. \<lbrakk>find (\<lambda>(x, y). {x, y} \<inter> fv Q \<noteq> {}) xys = Some x2; (x, y) = x2; distinct (remove1 (x, y) xys)\<rbrakk> \<Longrightarrow> fv (Conjs_disjoint (Conj Q (x \<approx> y)) (remove1 (x, y) xys)) = fv (Conj Q (x \<approx> y)) \<union> Field (set (remove1 (x, y) xys)); distinct xys\<rbrakk> \<Longrightarrow> fv (Conjs_disjoint Q xys) = fv Q \<union> Field (set xys)
[PROOF STEP]
case (1 Q xys)
[PROOF STATE]
proof (state)
this:
\<lbrakk>find (\<lambda>(x, y). {x, y} \<inter> fv Q \<noteq> {}) xys = Some ?x2.0; (?x, ?y) = ?x2.0; distinct (remove1 (?x, ?y) xys)\<rbrakk> \<Longrightarrow> fv (Conjs_disjoint (Conj Q (?x \<approx> ?y)) (remove1 (?x, ?y) xys)) = fv (Conj Q (?x \<approx> ?y)) \<union> Field (set (remove1 (?x, ?y) xys))
distinct xys

goal (1 subgoal):
 1. \<And>Q xys. \<lbrakk>\<And>x2 x y. \<lbrakk>find (\<lambda>(x, y). {x, y} \<inter> fv Q \<noteq> {}) xys = Some x2; (x, y) = x2; distinct (remove1 (x, y) xys)\<rbrakk> \<Longrightarrow> fv (Conjs_disjoint (Conj Q (x \<approx> y)) (remove1 (x, y) xys)) = fv (Conj Q (x \<approx> y)) \<union> Field (set (remove1 (x, y) xys)); distinct xys\<rbrakk> \<Longrightarrow> fv (Conjs_disjoint Q xys) = fv Q \<union> Field (set xys)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>find (\<lambda>(x, y). {x, y} \<inter> fv Q \<noteq> {}) xys = Some ?x2.0; (?x, ?y) = ?x2.0; distinct (remove1 (?x, ?y) xys)\<rbrakk> \<Longrightarrow> fv (Conjs_disjoint (Conj Q (?x \<approx> ?y)) (remove1 (?x, ?y) xys)) = fv (Conj Q (?x \<approx> ?y)) \<union> Field (set (remove1 (?x, ?y) xys))
distinct xys
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>find (\<lambda>(x, y). {x, y} \<inter> fv Q \<noteq> {}) xys = Some ?x2.0; (?x, ?y) = ?x2.0; distinct (remove1 (?x, ?y) xys)\<rbrakk> \<Longrightarrow> fv (Conjs_disjoint (Conj Q (?x \<approx> ?y)) (remove1 (?x, ?y) xys)) = fv (Conj Q (?x \<approx> ?y)) \<union> Field (set (remove1 (?x, ?y) xys))
distinct xys

goal (1 subgoal):
 1. fv (Conjs_disjoint Q xys) = fv Q \<union> Field (set xys)
[PROOF STEP]
by (subst Conjs_disjoint.simps)
      (auto split: option.splits simp: Field_def subset_eq dest: find_SomeD(2))
[PROOF STATE]
proof (state)
this:
fv (Conjs_disjoint Q xys) = fv Q \<union> Field (set xys)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma acyclic_6_symmetric:
  "acyclic_6 x \<Longrightarrow> symmetric x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. acyclic_6 x \<Longrightarrow> symmetric x
[PROOF STEP]
by (simp add: acyclic_6_1_injectively_orientable injectively_orientable_orientable orientable_symmetric)


[STATEMENT]
lemma fls_divide_diff:
  fixes f g h :: "'a::{ring,inverse} fls"
  shows "(f - g) / h = f / h - g / h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f - g) / h = f / h - g / h
[PROOF STEP]
by    (simp add: fls_divide_convert_times_inverse algebra_simps)


[STATEMENT]
lemma fds_nth_const: "fds_nth (fds_const c) = (\<lambda>n. if n = 1 then c else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_nth (fds_const c) = (\<lambda>n. if n = 1 then c else (0::'a))
[PROOF STEP]
by (simp add: fds_const_def fds_nth_fds fun_eq_iff)


[STATEMENT]
lemma Sup_trans_upper2:
  "\<lbrakk> t \<in> S; \<forall>u\<in>S. \<forall>P. (nneg P \<and> bounded_by b P) \<longrightarrow> (nneg (u P) \<and> bounded_by b (u P));
     nneg P; bounded_by b P \<rbrakk> \<Longrightarrow> t P \<tturnstile> Sup_trans S P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>t \<in> S; \<forall>u\<in>S. \<forall>P. nneg P \<and> bounded_by b P \<longrightarrow> nneg (u P) \<and> bounded_by b (u P); nneg P; bounded_by b P\<rbrakk> \<Longrightarrow> t P \<tturnstile> Sup_trans S P
[PROOF STEP]
unfolding Sup_trans_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>t \<in> S; \<forall>u\<in>S. \<forall>P. nneg P \<and> bounded_by b P \<longrightarrow> nneg (u P) \<and> bounded_by b (u P); nneg P; bounded_by b P\<rbrakk> \<Longrightarrow> t P \<tturnstile> Sup_exp {t P |t. t \<in> S}
[PROOF STEP]
by(blast intro:Sup_exp_upper)


[STATEMENT]
lemma not_iRelease: "
  (\<not> (P t'. t' \<R> t I. Q t)) =
  ((\<diamond> t I. \<not> Q t) \<and> (\<box> t I. P t \<longrightarrow> (\<diamond> t I \<down>\<le> t. \<not> Q t)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<not> (P t'. t' \<R> t I. Q t)) = ((\<diamond> t I. \<not> Q t) \<and> (\<box> t I. P t \<longrightarrow> (\<diamond> t I \<down>\<le> t. \<not> Q t)))
[PROOF STEP]
by (simp add: iRelease_def)


[STATEMENT]
lemma sublist_append_exists_2:
  fixes l1 l2 l3
  assumes "subseq (h # l1) l2"
  shows "(\<exists>l3 l4. (l2 = l3 @ [h] @ l4) \<and> (subseq l1 l4))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>l3 l4. l2 = l3 @ [h] @ l4 \<and> subseq l1 l4
[PROOF STEP]
using assms sublist_cons_exists
[PROOF STATE]
proof (prove)
using this:
subseq (h # l1) l2
subseq (?h # ?l1.0) ?l2.0 = (\<exists>l2a l2b. ?l2.0 = l2a @ [?h] @ l2b \<and> \<not> ListMem ?h l2a \<and> subseq ?l1.0 l2b)

goal (1 subgoal):
 1. \<exists>l3 l4. l2 = l3 @ [h] @ l4 \<and> subseq l1 l4
[PROOF STEP]
by metis


[STATEMENT]
lemma random_bst_code [code]:
  "random_bst (set xs) = map_pmf bst_of_list (pmf_of_set (permutations_of_set (set xs)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. random_bst (set xs) = map_pmf bst_of_list (pmf_of_set (permutations_of_set (set xs)))
[PROOF STEP]
by (rule random_bst_altdef) simp_all


[STATEMENT]
lemma cpoly_of_decompose:
    "p = cpoly_of (map_poly Re p) (map_poly Im p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p = cpoly_of (map_poly Re p) (map_poly Im p)
[PROOF STEP]
unfolding cpoly_of_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p = map_poly complex_of_real (map_poly Re p) + smult \<i> (map_poly complex_of_real (map_poly Im p))
[PROOF STEP]
apply (induct p)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 0 = map_poly complex_of_real (map_poly Re 0) + smult \<i> (map_poly complex_of_real (map_poly Im 0))
 2. \<And>a p. \<lbrakk>a \<noteq> 0 \<or> p \<noteq> 0; p = map_poly complex_of_real (map_poly Re p) + smult \<i> (map_poly complex_of_real (map_poly Im p))\<rbrakk> \<Longrightarrow> pCons a p = map_poly complex_of_real (map_poly Re (pCons a p)) + smult \<i> (map_poly complex_of_real (map_poly Im (pCons a p)))
[PROOF STEP]
by (auto simp add:map_poly_pCons map_poly_map_poly complex_eq)


[STATEMENT]
lemma HNatInfinite_inverse_Infinitesimal [simp]:
  assumes "n \<in> HNatInfinite"
  shows "inverse (hypreal_of_hypnat n) \<in> Infinitesimal"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse (hypreal_of_hypnat n) \<in> Infinitesimal
[PROOF STEP]
proof (cases n)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>X. n = star_n X \<Longrightarrow> inverse (hypreal_of_hypnat n) \<in> Infinitesimal
[PROOF STEP]
case (star_n X)
[PROOF STATE]
proof (state)
this:
n = star_n X

goal (1 subgoal):
 1. \<And>X. n = star_n X \<Longrightarrow> inverse (hypreal_of_hypnat n) \<in> Infinitesimal
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n = star_n X
[PROOF STEP]
have *: "\<And>k. \<forall>\<^sub>F n in \<U>. k < X n"
[PROOF STATE]
proof (prove)
using this:
n = star_n X

goal (1 subgoal):
 1. \<And>k. \<forall>\<^sub>F n in \<U>. k < X n
[PROOF STEP]
using HNatInfinite_FreeUltrafilterNat assms
[PROOF STATE]
proof (prove)
using this:
n = star_n X
star_n ?X \<in> HNatInfinite \<Longrightarrow> \<forall>u. \<forall>\<^sub>F n in \<U>. u < ?X n
n \<in> HNatInfinite

goal (1 subgoal):
 1. \<And>k. \<forall>\<^sub>F n in \<U>. k < X n
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in \<U>. ?k < X n

goal (1 subgoal):
 1. \<And>X. n = star_n X \<Longrightarrow> inverse (hypreal_of_hypnat n) \<in> Infinitesimal
[PROOF STEP]
have "\<forall>\<^sub>F n in \<U>. inverse (real (X n)) < inverse (1 + real m)" for m
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F n in \<U>. inverse (real (X n)) < inverse (1 + real m)
[PROOF STEP]
using * [of "Suc m"]
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in \<U>. Suc m < X n

goal (1 subgoal):
 1. \<forall>\<^sub>F n in \<U>. inverse (real (X n)) < inverse (1 + real m)
[PROOF STEP]
by (auto elim!: eventually_mono)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F n in \<U>. inverse (real (X n)) < inverse (1 + real ?m)

goal (1 subgoal):
 1. \<And>X. n = star_n X \<Longrightarrow> inverse (hypreal_of_hypnat n) \<in> Infinitesimal
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F n in \<U>. inverse (real (X n)) < inverse (1 + real ?m)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in \<U>. inverse (real (X n)) < inverse (1 + real ?m)

goal (1 subgoal):
 1. inverse (hypreal_of_hypnat n) \<in> Infinitesimal
[PROOF STEP]
using star_n
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F n in \<U>. inverse (real (X n)) < inverse (1 + real ?m)
n = star_n X

goal (1 subgoal):
 1. inverse (hypreal_of_hypnat n) \<in> Infinitesimal
[PROOF STEP]
by (auto simp: of_hypnat_def starfun_star_n star_n_inverse Infinitesimal_FreeUltrafilterNat_iff2)
[PROOF STATE]
proof (state)
this:
inverse (hypreal_of_hypnat n) \<in> Infinitesimal

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma unitary_mult_square_eq:
  assumes "A\<in> carrier_mat n n"
  and "U\<in> carrier_mat n n"
  and "B \<in> carrier_mat n n"
  and "A = mat_conj U B"
  and "(Complex_Matrix.adjoint U) * U = 1\<^sub>m n"
shows "A * A = mat_conj U (B*B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A * A = mat_conj U (B * B)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A * A = mat_conj U (B * B)
[PROOF STEP]
have "A * A = U * B * (Complex_Matrix.adjoint U) * (U * B * (Complex_Matrix.adjoint U))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A * A = U * B * Complex_Matrix.adjoint U * (U * B * Complex_Matrix.adjoint U)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
U \<in> carrier_mat n n
B \<in> carrier_mat n n
A = mat_conj U B
Complex_Matrix.adjoint U * U = 1\<^sub>m n

goal (1 subgoal):
 1. A * A = U * B * Complex_Matrix.adjoint U * (U * B * Complex_Matrix.adjoint U)
[PROOF STEP]
unfolding mat_conj_def
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
U \<in> carrier_mat n n
B \<in> carrier_mat n n
A = U * B * Complex_Matrix.adjoint U
Complex_Matrix.adjoint U * U = 1\<^sub>m n

goal (1 subgoal):
 1. A * A = U * B * Complex_Matrix.adjoint U * (U * B * Complex_Matrix.adjoint U)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
A * A = U * B * Complex_Matrix.adjoint U * (U * B * Complex_Matrix.adjoint U)

goal (1 subgoal):
 1. A * A = mat_conj U (B * B)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A * A = U * B * Complex_Matrix.adjoint U * (U * B * Complex_Matrix.adjoint U)

goal (1 subgoal):
 1. A * A = mat_conj U (B * B)
[PROOF STEP]
have "... = U * B * ((Complex_Matrix.adjoint U) * U) * (B * (Complex_Matrix.adjoint U))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. U * B * Complex_Matrix.adjoint U * (U * B * Complex_Matrix.adjoint U) = U * B * (Complex_Matrix.adjoint U * U) * (B * Complex_Matrix.adjoint U)
[PROOF STEP]
by (smt (z3) adjoint_dim_col adjoint_dim_row assms(3) assms(5) assoc_mult_mat carrier_matD(2)
        carrier_mat_triv index_mult_mat(2) index_mult_mat(3) right_mult_one_mat')
[PROOF STATE]
proof (state)
this:
U * B * Complex_Matrix.adjoint U * (U * B * Complex_Matrix.adjoint U) = U * B * (Complex_Matrix.adjoint U * U) * (B * Complex_Matrix.adjoint U)

goal (1 subgoal):
 1. A * A = mat_conj U (B * B)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
U * B * Complex_Matrix.adjoint U * (U * B * Complex_Matrix.adjoint U) = U * B * (Complex_Matrix.adjoint U * U) * (B * Complex_Matrix.adjoint U)

goal (1 subgoal):
 1. A * A = mat_conj U (B * B)
[PROOF STEP]
have "... = U * B * (B * (Complex_Matrix.adjoint U))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. U * B * (Complex_Matrix.adjoint U * U) * (B * Complex_Matrix.adjoint U) = U * B * (B * Complex_Matrix.adjoint U)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
U \<in> carrier_mat n n
B \<in> carrier_mat n n
A = mat_conj U B
Complex_Matrix.adjoint U * U = 1\<^sub>m n

goal (1 subgoal):
 1. U * B * (Complex_Matrix.adjoint U * U) * (B * Complex_Matrix.adjoint U) = U * B * (B * Complex_Matrix.adjoint U)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
U * B * (Complex_Matrix.adjoint U * U) * (B * Complex_Matrix.adjoint U) = U * B * (B * Complex_Matrix.adjoint U)

goal (1 subgoal):
 1. A * A = mat_conj U (B * B)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
U * B * (Complex_Matrix.adjoint U * U) * (B * Complex_Matrix.adjoint U) = U * B * (B * Complex_Matrix.adjoint U)

goal (1 subgoal):
 1. A * A = mat_conj U (B * B)
[PROOF STEP]
have "... = U * (B * B) * (Complex_Matrix.adjoint U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. U * B * (B * Complex_Matrix.adjoint U) = U * (B * B) * Complex_Matrix.adjoint U
[PROOF STEP]
by (smt (z3) adjoint_dim_row assms(2) assms(3) assoc_mult_mat carrier_matD(2)
        carrier_mat_triv index_mult_mat(3))
[PROOF STATE]
proof (state)
this:
U * B * (B * Complex_Matrix.adjoint U) = U * (B * B) * Complex_Matrix.adjoint U

goal (1 subgoal):
 1. A * A = mat_conj U (B * B)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
A * A = U * (B * B) * Complex_Matrix.adjoint U
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
A * A = U * (B * B) * Complex_Matrix.adjoint U

goal (1 subgoal):
 1. A * A = mat_conj U (B * B)
[PROOF STEP]
unfolding mat_conj_def
[PROOF STATE]
proof (prove)
using this:
A * A = U * (B * B) * Complex_Matrix.adjoint U

goal (1 subgoal):
 1. A * A = U * (B * B) * Complex_Matrix.adjoint U
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
A * A = mat_conj U (B * B)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma min_pconj:
  "(min a b) .& (min c d) \<le> min (a .& c) (b .& d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min a b .& min c d \<le> min (a .& c) (b .& d)
[PROOF STEP]
by(cases "a \<le> b",
     (cases "c \<le> d",
      simp_all add:min.absorb1 min.absorb2 pconj_mono)[],
     (cases "c \<le> d",
      simp_all add:min.absorb1 min.absorb2 pconj_mono))