[STATEMENT]
theorem Lambert_W_asymp_equiv_at_top'':
  "(\<lambda>x. Lambert_W x - ln x + ln (ln x)) \<sim>[at_top] (\<lambda>x. ln (ln x) / ln x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. Lambert_W x - ln x + ln (ln x)) \<sim>[at_top] (\<lambda>x. ln (ln x) / ln x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. Lambert_W x - ln x + ln (ln x)) \<sim>[at_top] (\<lambda>x. ln (ln x) / ln x)
[PROOF STEP]
have "(\<lambda>x. Lambert_W x - ln x + ln (ln x)) \<sim>[at_top] (\<lambda>x. 1 * (ln (ln x) / ln x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. Lambert_W x - ln x + ln (ln x)) \<sim>[at_top] (\<lambda>x. 1 * (ln (ln x) / ln x))
[PROOF STEP]
proof (rule asymp_equiv_sandwich')
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. \<And>c'. c' \<in> {?l<..<1} \<Longrightarrow> \<forall>\<^sub>F x in at_top. c' * (ln (ln x) / ln x) \<le> Lambert_W x - ln x + ln (ln x)
 2. \<And>c'. c' \<in> {1<..<?u} \<Longrightarrow> \<forall>\<^sub>F x in at_top. Lambert_W x - ln x + ln (ln x) \<le> c' * (ln (ln x) / ln x)
 3. ?l < 1
 4. 1 < ?u
 5. 1 \<noteq> 0
[PROOF STEP]
fix c' :: real
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. \<And>c'. c' \<in> {?l<..<1} \<Longrightarrow> \<forall>\<^sub>F x in at_top. c' * (ln (ln x) / ln x) \<le> Lambert_W x - ln x + ln (ln x)
 2. \<And>c'. c' \<in> {1<..<?u} \<Longrightarrow> \<forall>\<^sub>F x in at_top. Lambert_W x - ln x + ln (ln x) \<le> c' * (ln (ln x) / ln x)
 3. ?l < 1
 4. 1 < ?u
 5. 1 \<noteq> 0
[PROOF STEP]
assume c': "c' \<in> {0<..<1}"
[PROOF STATE]
proof (state)
this:
c' \<in> {0<..<1}

goal (5 subgoals):
 1. \<And>c'. c' \<in> {?l<..<1} \<Longrightarrow> \<forall>\<^sub>F x in at_top. c' * (ln (ln x) / ln x) \<le> Lambert_W x - ln x + ln (ln x)
 2. \<And>c'. c' \<in> {1<..<?u} \<Longrightarrow> \<forall>\<^sub>F x in at_top. Lambert_W x - ln x + ln (ln x) \<le> c' * (ln (ln x) / ln x)
 3. ?l < 1
 4. 1 < ?u
 5. 1 \<noteq> 0
[PROOF STEP]
define a where "a = (\<lambda>x::real. ln x - ln (ln x) + c' * (ln (ln x) / ln x))"
[PROOF STATE]
proof (state)
this:
a = (\<lambda>x. ln x - ln (ln x) + c' * (ln (ln x) / ln x))

goal (5 subgoals):
 1. \<And>c'. c' \<in> {?l<..<1} \<Longrightarrow> \<forall>\<^sub>F x in at_top. c' * (ln (ln x) / ln x) \<le> Lambert_W x - ln x + ln (ln x)
 2. \<And>c'. c' \<in> {1<..<?u} \<Longrightarrow> \<forall>\<^sub>F x in at_top. Lambert_W x - ln x + ln (ln x) \<le> c' * (ln (ln x) / ln x)
 3. ?l < 1
 4. 1 < ?u
 5. 1 \<noteq> 0
[PROOF STEP]
have "eventually (\<lambda>x. a x * exp (a x) \<le> x) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. a x * exp (a x) \<le> x
[PROOF STEP]
using c'
[PROOF STATE]
proof (prove)
using this:
c' \<in> {0<..<1}

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. a x * exp (a x) \<le> x
[PROOF STEP]
unfolding a_def
[PROOF STATE]
proof (prove)
using this:
c' \<in> {0<..<1}

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. (ln x - ln (ln x) + c' * (ln (ln x) / ln x)) * exp (ln x - ln (ln x) + c' * (ln (ln x) / ln x)) \<le> x
[PROOF STEP]
by real_asymp+
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. a x * exp (a x) \<le> x

goal (5 subgoals):
 1. \<And>c'. c' \<in> {?l<..<1} \<Longrightarrow> \<forall>\<^sub>F x in at_top. c' * (ln (ln x) / ln x) \<le> Lambert_W x - ln x + ln (ln x)
 2. \<And>c'. c' \<in> {1<..<?u} \<Longrightarrow> \<forall>\<^sub>F x in at_top. Lambert_W x - ln x + ln (ln x) \<le> c' * (ln (ln x) / ln x)
 3. ?l < 1
 4. 1 < ?u
 5. 1 \<noteq> 0
[PROOF STEP]
thus "eventually (\<lambda>x. Lambert_W x - ln x + ln (ln x) \<ge> c' * (ln (ln x) / ln x)) at_top"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. a x * exp (a x) \<le> x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. c' * (ln (ln x) / ln x) \<le> Lambert_W x - ln x + ln (ln x)
[PROOF STEP]
proof eventually_elim
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. a x * exp (a x) \<le> x \<Longrightarrow> c' * (ln (ln x) / ln x) \<le> Lambert_W x - ln x + ln (ln x)
[PROOF STEP]
case (elim x)
[PROOF STATE]
proof (state)
this:
a x * exp (a x) \<le> x

goal (1 subgoal):
 1. \<And>x. a x * exp (a x) \<le> x \<Longrightarrow> c' * (ln (ln x) / ln x) \<le> Lambert_W x - ln x + ln (ln x)
[PROOF STEP]
hence "Lambert_W x \<ge> a x"
[PROOF STATE]
proof (prove)
using this:
a x * exp (a x) \<le> x

goal (1 subgoal):
 1. a x \<le> Lambert_W x
[PROOF STEP]
by (intro Lambert_W_geI)
[PROOF STATE]
proof (state)
this:
a x \<le> Lambert_W x

goal (1 subgoal):
 1. \<And>x. a x * exp (a x) \<le> x \<Longrightarrow> c' * (ln (ln x) / ln x) \<le> Lambert_W x - ln x + ln (ln x)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
a x \<le> Lambert_W x

goal (1 subgoal):
 1. c' * (ln (ln x) / ln x) \<le> Lambert_W x - ln x + ln (ln x)
[PROOF STEP]
by (simp add: a_def)
[PROOF STATE]
proof (state)
this:
c' * (ln (ln x) / ln x) \<le> Lambert_W x - ln x + ln (ln x)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. c' * (ln (ln x) / ln x) \<le> Lambert_W x - ln x + ln (ln x)

goal (4 subgoals):
 1. \<And>c'. c' \<in> {1<..<?u} \<Longrightarrow> \<forall>\<^sub>F x in at_top. Lambert_W x - ln x + ln (ln x) \<le> c' * (ln (ln x) / ln x)
 2. 0 < 1
 3. 1 < ?u
 4. 1 \<noteq> 0
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>c'. c' \<in> {1<..<?u} \<Longrightarrow> \<forall>\<^sub>F x in at_top. Lambert_W x - ln x + ln (ln x) \<le> c' * (ln (ln x) / ln x)
 2. 0 < 1
 3. 1 < ?u
 4. 1 \<noteq> 0
[PROOF STEP]
fix c' :: real
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>c'. c' \<in> {1<..<?u} \<Longrightarrow> \<forall>\<^sub>F x in at_top. Lambert_W x - ln x + ln (ln x) \<le> c' * (ln (ln x) / ln x)
 2. 0 < 1
 3. 1 < ?u
 4. 1 \<noteq> 0
[PROOF STEP]
assume c': "c' \<in> {1<..<2}"
[PROOF STATE]
proof (state)
this:
c' \<in> {1<..<2}

goal (4 subgoals):
 1. \<And>c'. c' \<in> {1<..<?u} \<Longrightarrow> \<forall>\<^sub>F x in at_top. Lambert_W x - ln x + ln (ln x) \<le> c' * (ln (ln x) / ln x)
 2. 0 < 1
 3. 1 < ?u
 4. 1 \<noteq> 0
[PROOF STEP]
define a where "a = (\<lambda>x::real. ln x - ln (ln x) + c' * (ln (ln x) / ln x))"
[PROOF STATE]
proof (state)
this:
a = (\<lambda>x. ln x - ln (ln x) + c' * (ln (ln x) / ln x))

goal (4 subgoals):
 1. \<And>c'. c' \<in> {1<..<?u} \<Longrightarrow> \<forall>\<^sub>F x in at_top. Lambert_W x - ln x + ln (ln x) \<le> c' * (ln (ln x) / ln x)
 2. 0 < 1
 3. 1 < ?u
 4. 1 \<noteq> 0
[PROOF STEP]
have "eventually (\<lambda>x. a x * exp (a x) \<ge> x) at_top"
         "eventually (\<lambda>x. a x \<ge> -1) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. x \<le> a x * exp (a x) &&& \<forall>\<^sub>F x in at_top. - 1 \<le> a x
[PROOF STEP]
using c'
[PROOF STATE]
proof (prove)
using this:
c' \<in> {1<..<2}

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. x \<le> a x * exp (a x) &&& \<forall>\<^sub>F x in at_top. - 1 \<le> a x
[PROOF STEP]
unfolding a_def
[PROOF STATE]
proof (prove)
using this:
c' \<in> {1<..<2}

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. x \<le> (ln x - ln (ln x) + c' * (ln (ln x) / ln x)) * exp (ln x - ln (ln x) + c' * (ln (ln x) / ln x)) &&& \<forall>\<^sub>F x in at_top. - 1 \<le> ln x - ln (ln x) + c' * (ln (ln x) / ln x)
[PROOF STEP]
by real_asymp+
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. x \<le> a x * exp (a x)
\<forall>\<^sub>F x in at_top. - 1 \<le> a x

goal (4 subgoals):
 1. \<And>c'. c' \<in> {1<..<?u} \<Longrightarrow> \<forall>\<^sub>F x in at_top. Lambert_W x - ln x + ln (ln x) \<le> c' * (ln (ln x) / ln x)
 2. 0 < 1
 3. 1 < ?u
 4. 1 \<noteq> 0
[PROOF STEP]
thus "eventually (\<lambda>x. Lambert_W x - ln x + ln (ln x) \<le> c' * (ln (ln x) / ln x)) at_top"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. x \<le> a x * exp (a x)
\<forall>\<^sub>F x in at_top. - 1 \<le> a x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. Lambert_W x - ln x + ln (ln x) \<le> c' * (ln (ln x) / ln x)
[PROOF STEP]
using eventually_ge_at_top[of "-exp (-1)"]
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. x \<le> a x * exp (a x)
\<forall>\<^sub>F x in at_top. - 1 \<le> a x
eventually ((\<le>) (- exp (- (1::?'a1)))) at_top

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. Lambert_W x - ln x + ln (ln x) \<le> c' * (ln (ln x) / ln x)
[PROOF STEP]
proof eventually_elim
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<le> a x * exp (a x); - 1 \<le> a x; - exp (- 1) \<le> x\<rbrakk> \<Longrightarrow> Lambert_W x - ln x + ln (ln x) \<le> c' * (ln (ln x) / ln x)
[PROOF STEP]
case (elim x)
[PROOF STATE]
proof (state)
this:
x \<le> a x * exp (a x)
- 1 \<le> a x
- exp (- 1) \<le> x

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<le> a x * exp (a x); - 1 \<le> a x; - exp (- 1) \<le> x\<rbrakk> \<Longrightarrow> Lambert_W x - ln x + ln (ln x) \<le> c' * (ln (ln x) / ln x)
[PROOF STEP]
hence "Lambert_W x \<le> a x"
[PROOF STATE]
proof (prove)
using this:
x \<le> a x * exp (a x)
- 1 \<le> a x
- exp (- 1) \<le> x

goal (1 subgoal):
 1. Lambert_W x \<le> a x
[PROOF STEP]
by (intro Lambert_W_leI)
[PROOF STATE]
proof (state)
this:
Lambert_W x \<le> a x

goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<le> a x * exp (a x); - 1 \<le> a x; - exp (- 1) \<le> x\<rbrakk> \<Longrightarrow> Lambert_W x - ln x + ln (ln x) \<le> c' * (ln (ln x) / ln x)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
Lambert_W x \<le> a x

goal (1 subgoal):
 1. Lambert_W x - ln x + ln (ln x) \<le> c' * (ln (ln x) / ln x)
[PROOF STEP]
by (simp add: a_def)
[PROOF STATE]
proof (state)
this:
Lambert_W x - ln x + ln (ln x) \<le> c' * (ln (ln x) / ln x)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. Lambert_W x - ln x + ln (ln x) \<le> c' * (ln (ln x) / ln x)

goal (3 subgoals):
 1. 0 < 1
 2. 1 < 2
 3. 1 \<noteq> 0
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. Lambert_W x - ln x + ln (ln x)) \<sim>[at_top] (\<lambda>x. 1 * (ln (ln x) / ln x))

goal (1 subgoal):
 1. (\<lambda>x. Lambert_W x - ln x + ln (ln x)) \<sim>[at_top] (\<lambda>x. ln (ln x) / ln x)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. Lambert_W x - ln x + ln (ln x)) \<sim>[at_top] (\<lambda>x. 1 * (ln (ln x) / ln x))

goal (1 subgoal):
 1. (\<lambda>x. Lambert_W x - ln x + ln (ln x)) \<sim>[at_top] (\<lambda>x. ln (ln x) / ln x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>x. Lambert_W x - ln x + ln (ln x)) \<sim>[at_top] (\<lambda>x. ln (ln x) / ln x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma exp_approx:
  assumes "n > 0" "0 \<le> x" "x < 2"
  shows   "exp (x::real) - (\<Sum>k<n. x^k / fact k) \<in> {0..(2 * x^n / (2 - x)) / fact n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp x - (\<Sum>k<n. x ^ k / fact k) \<in> {0..2 * x ^ n / (2 - x) / fact n}
[PROOF STEP]
proof (unfold atLeastAtMost_iff, safe)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 \<le> exp x - (\<Sum>k<n. x ^ k / fact k)
 2. exp x - (\<Sum>k<n. x ^ k / fact k) \<le> 2 * x ^ n / (2 - x) / fact n
[PROOF STEP]
define approx where "approx = (\<Sum>k<n. x^k / fact k)"
[PROOF STATE]
proof (state)
this:
approx = (\<Sum>k<n. x ^ k / fact k)

goal (2 subgoals):
 1. 0 \<le> exp x - (\<Sum>k<n. x ^ k / fact k)
 2. exp x - (\<Sum>k<n. x ^ k / fact k) \<le> 2 * x ^ n / (2 - x) / fact n
[PROOF STEP]
have "(\<lambda>k. x^k / fact k) sums exp x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>k. x ^ k / fact k) sums exp x
[PROOF STEP]
using exp_converges[of x]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. x ^ n /\<^sub>R fact n) sums exp x

goal (1 subgoal):
 1. (\<lambda>k. x ^ k / fact k) sums exp x
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
(\<lambda>k. x ^ k / fact k) sums exp x

goal (2 subgoals):
 1. 0 \<le> exp x - (\<Sum>k<n. x ^ k / fact k)
 2. exp x - (\<Sum>k<n. x ^ k / fact k) \<le> 2 * x ^ n / (2 - x) / fact n
[PROOF STEP]
from sums_split_initial_segment[OF this, of n]
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>i. x ^ (i + n) / fact (i + n)) sums (exp x - (\<Sum>i<n. x ^ i / fact i))
[PROOF STEP]
have sums: "(\<lambda>k. x^n * (x^k / fact (n+k))) sums (exp x - approx)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>i. x ^ (i + n) / fact (i + n)) sums (exp x - (\<Sum>i<n. x ^ i / fact i))

goal (1 subgoal):
 1. (\<lambda>k. x ^ n * (x ^ k / fact (n + k))) sums (exp x - approx)
[PROOF STEP]
by (simp add: approx_def algebra_simps power_add)
[PROOF STATE]
proof (state)
this:
(\<lambda>k. x ^ n * (x ^ k / fact (n + k))) sums (exp x - approx)

goal (2 subgoals):
 1. 0 \<le> exp x - (\<Sum>k<n. x ^ k / fact k)
 2. exp x - (\<Sum>k<n. x ^ k / fact k) \<le> 2 * x ^ n / (2 - x) / fact n
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
0 < n
0 \<le> x
x < 2
[PROOF STEP]
show "(exp x - approx) \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
0 < n
0 \<le> x
x < 2

goal (1 subgoal):
 1. 0 \<le> exp x - approx
[PROOF STEP]
by (intro sums_le[OF _ sums_zero sums]) auto
[PROOF STATE]
proof (state)
this:
0 \<le> exp x - approx

goal (1 subgoal):
 1. exp x - (\<Sum>k<n. x ^ k / fact k) \<le> 2 * x ^ n / (2 - x) / fact n
[PROOF STEP]
have "x^n * (x^k / fact (n+k)) \<le> (x^n / fact n) * (x / 2)^k" for k::nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x ^ n * (x ^ k / fact (n + k)) \<le> x ^ n / fact n * (x / 2) ^ k
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x ^ n * (x ^ k / fact (n + k)) \<le> x ^ n / fact n * (x / 2) ^ k
[PROOF STEP]
have "x^n * (x^k / fact (n + k)) = x^(n+k) / fact (n + k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x ^ n * (x ^ k / fact (n + k)) = x ^ (n + k) / fact (n + k)
[PROOF STEP]
by (simp add: power_add)
[PROOF STATE]
proof (state)
this:
x ^ n * (x ^ k / fact (n + k)) = x ^ (n + k) / fact (n + k)

goal (1 subgoal):
 1. x ^ n * (x ^ k / fact (n + k)) \<le> x ^ n / fact n * (x / 2) ^ k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x ^ n * (x ^ k / fact (n + k)) = x ^ (n + k) / fact (n + k)

goal (1 subgoal):
 1. x ^ n * (x ^ k / fact (n + k)) \<le> x ^ n / fact n * (x / 2) ^ k
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
0 < n
0 \<le> x
x < 2
[PROOF STEP]
have "\<dots> \<le> x^(n+k) / (2^k * fact n)"
[PROOF STATE]
proof (prove)
using this:
0 < n
0 \<le> x
x < 2

goal (1 subgoal):
 1. x ^ (n + k) / fact (n + k) \<le> x ^ (n + k) / (2 ^ k * fact n)
[PROOF STEP]
by (intro divide_left_mono two_power_fact_le_fact zero_le_power) simp_all
[PROOF STATE]
proof (state)
this:
x ^ (n + k) / fact (n + k) \<le> x ^ (n + k) / (2 ^ k * fact n)

goal (1 subgoal):
 1. x ^ n * (x ^ k / fact (n + k)) \<le> x ^ n / fact n * (x / 2) ^ k
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x ^ (n + k) / fact (n + k) \<le> x ^ (n + k) / (2 ^ k * fact n)

goal (1 subgoal):
 1. x ^ n * (x ^ k / fact (n + k)) \<le> x ^ n / fact n * (x / 2) ^ k
[PROOF STEP]
have "\<dots> = (x^n / fact n) * (x / 2) ^ k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x ^ (n + k) / (2 ^ k * fact n) = x ^ n / fact n * (x / 2) ^ k
[PROOF STEP]
by (simp add: field_simps power_add)
[PROOF STATE]
proof (state)
this:
x ^ (n + k) / (2 ^ k * fact n) = x ^ n / fact n * (x / 2) ^ k

goal (1 subgoal):
 1. x ^ n * (x ^ k / fact (n + k)) \<le> x ^ n / fact n * (x / 2) ^ k
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x ^ n * (x ^ k / fact (n + k)) \<le> x ^ n / fact n * (x / 2) ^ k
[PROOF STEP]
show "x^n * (x^k / fact (n+k)) \<le> (x^n / fact n) * (x / 2)^k"
[PROOF STATE]
proof (prove)
using this:
x ^ n * (x ^ k / fact (n + k)) \<le> x ^ n / fact n * (x / 2) ^ k

goal (1 subgoal):
 1. x ^ n * (x ^ k / fact (n + k)) \<le> x ^ n / fact n * (x / 2) ^ k
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
x ^ n * (x ^ k / fact (n + k)) \<le> x ^ n / fact n * (x / 2) ^ k

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x ^ n * (x ^ ?k / fact (n + ?k)) \<le> x ^ n / fact n * (x / 2) ^ ?k

goal (1 subgoal):
 1. exp x - (\<Sum>k<n. x ^ k / fact k) \<le> 2 * x ^ n / (2 - x) / fact n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
x ^ n * (x ^ ?k / fact (n + ?k)) \<le> x ^ n / fact n * (x / 2) ^ ?k

goal (1 subgoal):
 1. exp x - (\<Sum>k<n. x ^ k / fact k) \<le> 2 * x ^ n / (2 - x) / fact n
[PROOF STEP]
note sums
[PROOF STATE]
proof (state)
this:
(\<lambda>k. x ^ n * (x ^ k / fact (n + k))) sums (exp x - approx)

goal (1 subgoal):
 1. exp x - (\<Sum>k<n. x ^ k / fact k) \<le> 2 * x ^ n / (2 - x) / fact n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>k. x ^ n * (x ^ k / fact (n + k))) sums (exp x - approx)

goal (1 subgoal):
 1. exp x - (\<Sum>k<n. x ^ k / fact k) \<le> 2 * x ^ n / (2 - x) / fact n
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
(\<lambda>k. x ^ n * (x ^ k / fact (n + k))) sums (exp x - approx)

goal (1 subgoal):
 1. exp x - (\<Sum>k<n. x ^ k / fact k) \<le> 2 * x ^ n / (2 - x) / fact n
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
0 < n
0 \<le> x
x < 2
[PROOF STEP]
have "(\<lambda>k. (x^n / fact n) * (x / 2)^k) sums ((x^n / fact n) * (1 / (1 - x / 2)))"
[PROOF STATE]
proof (prove)
using this:
0 < n
0 \<le> x
x < 2

goal (1 subgoal):
 1. (\<lambda>k. x ^ n / fact n * (x / 2) ^ k) sums (x ^ n / fact n * (1 / (1 - x / 2)))
[PROOF STEP]
by (intro sums_mult geometric_sums) simp_all
[PROOF STATE]
proof (state)
this:
(\<lambda>k. x ^ n / fact n * (x / 2) ^ k) sums (x ^ n / fact n * (1 / (1 - x / 2)))

goal (1 subgoal):
 1. exp x - (\<Sum>k<n. x ^ k / fact k) \<le> 2 * x ^ n / (2 - x) / fact n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>k. x ^ n / fact n * (x / 2) ^ k) sums (x ^ n / fact n * (1 / (1 - x / 2)))

goal (1 subgoal):
 1. exp x - (\<Sum>k<n. x ^ k / fact k) \<le> 2 * x ^ n / (2 - x) / fact n
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
0 < n
0 \<le> x
x < 2
[PROOF STEP]
have "((x^n / fact n) * (1 / (1 - x / 2))) = (2 * x^n / (2 - x)) / fact n"
[PROOF STATE]
proof (prove)
using this:
0 < n
0 \<le> x
x < 2

goal (1 subgoal):
 1. x ^ n / fact n * (1 / (1 - x / 2)) = 2 * x ^ n / (2 - x) / fact n
[PROOF STEP]
by (auto simp: field_split_simps)
[PROOF STATE]
proof (state)
this:
x ^ n / fact n * (1 / (1 - x / 2)) = 2 * x ^ n / (2 - x) / fact n

goal (1 subgoal):
 1. exp x - (\<Sum>k<n. x ^ k / fact k) \<le> 2 * x ^ n / (2 - x) / fact n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>k. x ^ n / fact n * (x / 2) ^ k) sums (2 * x ^ n / (2 - x) / fact n)
[PROOF STEP]
have "(\<lambda>k. (x^n / fact n) * (x / 2)^k) sums \<dots>"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>k. x ^ n / fact n * (x / 2) ^ k) sums (2 * x ^ n / (2 - x) / fact n)

goal (1 subgoal):
 1. (\<lambda>k. x ^ n / fact n * (x / 2) ^ k) sums (2 * x ^ n / (2 - x) / fact n)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<lambda>k. x ^ n / fact n * (x / 2) ^ k) sums (2 * x ^ n / (2 - x) / fact n)

goal (1 subgoal):
 1. exp x - (\<Sum>k<n. x ^ k / fact k) \<le> 2 * x ^ n / (2 - x) / fact n
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
(\<lambda>k. x ^ n / fact n * (x / 2) ^ k) sums (2 * x ^ n / (2 - x) / fact n)

goal (1 subgoal):
 1. exp x - (\<Sum>k<n. x ^ k / fact k) \<le> 2 * x ^ n / (2 - x) / fact n
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
x ^ n * (x ^ ?k / fact (n + ?k)) \<le> x ^ n / fact n * (x / 2) ^ ?k
(\<lambda>k. x ^ n * (x ^ k / fact (n + k))) sums (exp x - approx)
(\<lambda>k. x ^ n / fact n * (x / 2) ^ k) sums (2 * x ^ n / (2 - x) / fact n)
[PROOF STEP]
show "(exp x - approx) \<le> (2 * x^n / (2 - x)) / fact n"
[PROOF STATE]
proof (prove)
using this:
x ^ n * (x ^ ?k / fact (n + ?k)) \<le> x ^ n / fact n * (x / 2) ^ ?k
(\<lambda>k. x ^ n * (x ^ k / fact (n + k))) sums (exp x - approx)
(\<lambda>k. x ^ n / fact n * (x / 2) ^ k) sums (2 * x ^ n / (2 - x) / fact n)

goal (1 subgoal):
 1. exp x - approx \<le> 2 * x ^ n / (2 - x) / fact n
[PROOF STEP]
by (rule sums_le)
[PROOF STATE]
proof (state)
this:
exp x - approx \<le> 2 * x ^ n / (2 - x) / fact n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ereal_Liminf_uminus:
  fixes f :: "'a \<Rightarrow> ereal"
  shows "Liminf net (\<lambda>x. - (f x)) = - Limsup net f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Liminf net (\<lambda>x. - f x) = - Limsup net f
[PROOF STEP]
using ereal_Limsup_uminus[of _ "(\<lambda>x. - (f x))"]
[PROOF STATE]
proof (prove)
using this:
Limsup ?net (\<lambda>x. - (- f x)) = - Liminf ?net (\<lambda>x. - f x)

goal (1 subgoal):
 1. Liminf net (\<lambda>x. - f x) = - Limsup net f
[PROOF STEP]
by auto


[STATEMENT]
lemma min_height_size1_log: "min_height t \<le> log 2 (size1 t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (min_height t) \<le> log 2 (real (size1 t))
[PROOF STEP]
by (simp add: le_log2_of_power min_height_size1)


[STATEMENT]
lemma ac_inv':
  assumes "x \<in> nonzero Q\<^sub>p"
  assumes "n > 0"
  shows "ac n (inv x) \<otimes>\<^bsub>Zp_res_ring n\<^esub> (ac n x) = \<one>\<^bsub>Zp_res_ring n\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ac n (inv x) \<otimes>\<^bsub>residue_ring (p ^ n)\<^esub> ac n x = \<one>\<^bsub>residue_ring (p ^ n)\<^esub>
[PROOF STEP]
using ac_inv[of x n] ac_units[of x n] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>x \<in> nonzero Q\<^sub>p; 0 < n\<rbrakk> \<Longrightarrow> ac n (inv x) = inv\<^bsub>residue_ring (p ^ n)\<^esub> ac n x
\<lbrakk>x \<in> nonzero Q\<^sub>p; 0 < n\<rbrakk> \<Longrightarrow> ac n x \<in> Units (residue_ring (p ^ n))
x \<in> nonzero Q\<^sub>p
0 < n

goal (1 subgoal):
 1. ac n (inv x) \<otimes>\<^bsub>residue_ring (p ^ n)\<^esub> ac n x = \<one>\<^bsub>residue_ring (p ^ n)\<^esub>
[PROOF STEP]
by (metis (no_types, opaque_lifting) Qp.field_axioms Qp.nonzero_memE
      Qp.nonzero_memE Units_eq_nonzero Units_inverse_Qp ac_mult ac_one' field.field_inv(1))


[STATEMENT]
lemma function_mult_comp_is_seq_mult:
  assumes "s \<in> closed_seqs R"
  assumes "f \<in> carrier (Fun R)"
  assumes "g \<in> carrier (Fun R)"
  shows "(f \<otimes>\<^bsub>Fun R\<^esub> g) \<circ> s = (f \<circ> s) \<otimes>\<^bsub>R\<^bsup>\<omega>\<^esup>\<^esub> (g \<circ> s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<otimes>\<^bsub>function_ring (carrier R) R\<^esub> g \<circ> s = (f \<circ> s) \<otimes>\<^bsub>R\<^bsup>\<omega>\<^esup>\<^esub> (g \<circ> s)
[PROOF STEP]
apply(rule ring_functions.function_ring_car_eqI[of R _ "UNIV :: nat set"])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. ring_functions R
 2. f \<otimes>\<^bsub>function_ring (carrier R) R\<^esub> g \<circ> s \<in> carrier (function_ring UNIV R)
 3. (f \<circ> s) \<otimes>\<^bsub>R\<^bsup>\<omega>\<^esup>\<^esub> (g \<circ> s) \<in> carrier (function_ring UNIV R)
 4. \<And>a. a \<in> UNIV \<Longrightarrow> (f \<otimes>\<^bsub>function_ring (carrier R) R\<^esub> g \<circ> s) a = ((f \<circ> s) \<otimes>\<^bsub>R\<^bsup>\<omega>\<^esup>\<^esub> (g \<circ> s)) a
[PROOF STEP]
apply (simp add: ring_functions_axioms)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. f \<otimes>\<^bsub>function_ring (carrier R) R\<^esub> g \<circ> s \<in> carrier (function_ring UNIV R)
 2. (f \<circ> s) \<otimes>\<^bsub>R\<^bsup>\<omega>\<^esup>\<^esub> (g \<circ> s) \<in> carrier (function_ring UNIV R)
 3. \<And>a. a \<in> UNIV \<Longrightarrow> (f \<otimes>\<^bsub>function_ring (carrier R) R\<^esub> g \<circ> s) a = ((f \<circ> s) \<otimes>\<^bsub>R\<^bsup>\<omega>\<^esup>\<^esub> (g \<circ> s)) a
[PROOF STEP]
using function_comp_is_closed_seq
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?s \<in> carrier R\<^bsup>\<omega>\<^esup>; ?f \<in> carrier (function_ring (carrier R) R)\<rbrakk> \<Longrightarrow> ?f \<circ> ?s \<in> carrier R\<^bsup>\<omega>\<^esup>

goal (3 subgoals):
 1. f \<otimes>\<^bsub>function_ring (carrier R) R\<^esub> g \<circ> s \<in> carrier (function_ring UNIV R)
 2. (f \<circ> s) \<otimes>\<^bsub>R\<^bsup>\<omega>\<^esup>\<^esub> (g \<circ> s) \<in> carrier (function_ring UNIV R)
 3. \<And>a. a \<in> UNIV \<Longrightarrow> (f \<otimes>\<^bsub>function_ring (carrier R) R\<^esub> g \<circ> s) a = ((f \<circ> s) \<otimes>\<^bsub>R\<^bsup>\<omega>\<^esup>\<^esub> (g \<circ> s)) a
[PROOF STEP]
apply (metis assms(1) assms(2) assms(3) fun_mult_closed nat_seqs_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (f \<circ> s) \<otimes>\<^bsub>R\<^bsup>\<omega>\<^esup>\<^esub> (g \<circ> s) \<in> carrier (function_ring UNIV R)
 2. \<And>a. a \<in> UNIV \<Longrightarrow> (f \<otimes>\<^bsub>function_ring (carrier R) R\<^esub> g \<circ> s) a = ((f \<circ> s) \<otimes>\<^bsub>R\<^bsup>\<omega>\<^esup>\<^esub> (g \<circ> s)) a
[PROOF STEP]
apply (metis assms(1) assms(2) assms(3) function_comp_is_closed_seq nat_seqs_def seq_mult_closed)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. a \<in> UNIV \<Longrightarrow> (f \<otimes>\<^bsub>function_ring (carrier R) R\<^esub> g \<circ> s) a = ((f \<circ> s) \<otimes>\<^bsub>R\<^bsup>\<omega>\<^esup>\<^esub> (g \<circ> s)) a
[PROOF STEP]
by (metis (no_types, lifting) assms(1) assms(2) assms(3) comp_apply function_comp_is_closed_seq nat_seqs_def ring_functions.function_mult_eval_car ring_functions.function_ring_car_closed ring_functions_axioms)


[STATEMENT]
lemma confluentpI:
  "confluentp r" if "\<And>x y z. \<lbrakk> r\<^sup>*\<^sup>* x y; r\<^sup>*\<^sup>* x z \<rbrakk> \<Longrightarrow> \<exists>u. r\<^sup>*\<^sup>* y u \<and> r\<^sup>*\<^sup>* z u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. confluentp r
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>r\<^sup>*\<^sup>* ?x ?y; r\<^sup>*\<^sup>* ?x ?z\<rbrakk> \<Longrightarrow> \<exists>u. r\<^sup>*\<^sup>* ?y u \<and> r\<^sup>*\<^sup>* ?z u

goal (1 subgoal):
 1. confluentp r
[PROOF STEP]
unfolding confluentp_def rtranclp_conversep
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>r\<^sup>*\<^sup>* ?x ?y; r\<^sup>*\<^sup>* ?x ?z\<rbrakk> \<Longrightarrow> \<exists>u. r\<^sup>*\<^sup>* ?y u \<and> r\<^sup>*\<^sup>* ?z u

goal (1 subgoal):
 1. r\<^sup>*\<^sup>*\<inverse>\<inverse> OO r\<^sup>*\<^sup>* \<le> r\<^sup>*\<^sup>* OO r\<^sup>*\<^sup>*\<inverse>\<inverse>
[PROOF STEP]
by blast


[STATEMENT]
lemma measure_eq_0_null_sets: "S \<in> null_sets M \<Longrightarrow> measure M S = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<in> null_sets M \<Longrightarrow> Sigma_Algebra.measure M S = 0
[PROOF STEP]
by (auto simp: measure_def null_sets_def)


[STATEMENT]
lemma complement_mask:
  "complement (2 ^ n - 1) = not (mask n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. not (2 ^ n - 1) = not (mask n)
[PROOF STEP]
unfolding mask_eq_decr_exp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. not (2 ^ n - 1) = not (2 ^ n - 1)
[PROOF STEP]
by simp


[STATEMENT]
lemma of_int_mod_ring_mult:
  "of_int_mod_ring (a*b) = of_int_mod_ring a * of_int_mod_ring b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int_mod_ring (a * b) = of_int_mod_ring a * of_int_mod_ring b
[PROOF STEP]
unfolding of_int_mod_ring_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (id ---> Abs_mod_ring) (\<lambda>x. x mod int CARD('b)) (a * b) = (id ---> Abs_mod_ring) (\<lambda>x. x mod int CARD('b)) a * (id ---> Abs_mod_ring) (\<lambda>x. x mod int CARD('b)) b
[PROOF STEP]
by (metis (mono_tags, lifting) Rep_mod_ring_inverse mod_mult_eq
  of_int_mod_ring.rep_eq of_int_mod_ring_def times_mod_ring.rep_eq)


[STATEMENT]
lemma  npi_conj[no_atp]: "\<lbrakk>\<forall>x. \<not>P1' \<and> P1 x \<longrightarrow>  (\<exists>u\<in> U. x \<le> u) ;  \<forall>x. \<not>P2' \<and> P2 x \<longrightarrow>  (\<exists>u\<in> U. x \<le> u)\<rbrakk>
  \<Longrightarrow>  \<forall>x. \<not>(P1' \<and> P2') \<and> (P1 x \<and> P2 x) \<longrightarrow>  (\<exists>u\<in> U. x \<le> u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>x. \<not> P1' \<and> P1 x \<longrightarrow> (\<exists>u\<in>U. x \<le> u); \<forall>x. \<not> P2' \<and> P2 x \<longrightarrow> (\<exists>u\<in>U. x \<le> u)\<rbrakk> \<Longrightarrow> \<forall>x. \<not> (P1' \<and> P2') \<and> P1 x \<and> P2 x \<longrightarrow> (\<exists>u\<in>U. x \<le> u)
[PROOF STEP]
by auto


[STATEMENT]
lemma master1:
  assumes g_bigo: "g \<in> O(\<lambda>x. real x powr p')"
  assumes less_p': "(\<Sum>i<k. as!i * bs!i powr p') > 1"
  assumes f_pos:  "eventually (\<lambda>x. f x > 0) at_top"
  shows "f \<in> \<Theta>(\<lambda>x. real x powr p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> \<Theta>(\<lambda>x. real x powr p)
[PROOF STEP]
proof (rule bigthetaI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f \<in> O(\<lambda>x. real x powr p)
 2. f \<in> \<Omega>(\<lambda>x. real x powr p)
[PROOF STEP]
interpret akra_bazzi_lower x\<^sub>0 x\<^sub>1 k as bs ts f
    "\<lambda>f a b. f integrable_on {a..b}" "\<lambda>f a b. integral {a..b} f" g "\<lambda>_. 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. akra_bazzi_lower x\<^sub>0 x\<^sub>1 k as bs ts f (\<lambda>f a b. f integrable_on {a..b}) (\<lambda>f a b. integral {a..b} f) g (\<lambda>_. 0)
[PROOF STEP]
using assms(1,3) bs_lower_bound
[PROOF STATE]
proof (prove)
using this:
g \<in> O(\<lambda>x. real x powr p')
\<forall>\<^sub>F x in sequentially. 0 < f x
\<exists>C>0. \<forall>b\<in>set bs. C < b

goal (1 subgoal):
 1. akra_bazzi_lower x\<^sub>0 x\<^sub>1 k as bs ts f (\<lambda>f a b. f integrable_on {a..b}) (\<lambda>f a b. integral {a..b} f) g (\<lambda>_. 0)
[PROOF STEP]
by unfold_locales (auto intro: always_eventually)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f \<in> O(\<lambda>x. real x powr p)
 2. f \<in> \<Omega>(\<lambda>x. real x powr p)
[PROOF STEP]
from bigomega_f
[PROOF STATE]
proof (chain)
picking this:
(\<And>a. \<lbrakk>?A \<le> a; f \<in> \<Omega>(\<lambda>x. real x powr p * (1 + integral {a..real x} (\<lambda>u. 0 / u powr (p + 1))))\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis
[PROOF STEP]
show "f \<in> \<Omega>(\<lambda>x. real x powr p)"
[PROOF STATE]
proof (prove)
using this:
(\<And>a. \<lbrakk>?A \<le> a; f \<in> \<Omega>(\<lambda>x. real x powr p * (1 + integral {a..real x} (\<lambda>u. 0 / u powr (p + 1))))\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. f \<in> \<Omega>(\<lambda>x. real x powr p)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
f \<in> \<Omega>(\<lambda>x. real x powr p)

goal (1 subgoal):
 1. f \<in> O(\<lambda>x. real x powr p)
[PROOF STEP]
qed (fact master1_bigo[OF g_bigo less_p'])


[STATEMENT]
lemma gen_common_subdiv_imp_common_subdiv:
  shows "(common_sudiv_exists one_chain1 one_chain2) = (\<exists>ps1 ps2. (common_boundary_sudivision_exists (one_chain1 - ps1) (one_chain2 - ps2)) \<and> (\<forall>(k, \<gamma>)\<in>ps1. point_path \<gamma>) \<and> (\<forall>(k, \<gamma>)\<in>ps2. point_path \<gamma>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. common_sudiv_exists one_chain1 one_chain2 = (\<exists>ps1 ps2. common_boundary_sudivision_exists (one_chain1 - ps1) (one_chain2 - ps2) \<and> (\<forall>(k, \<gamma>)\<in>ps1. point_path \<gamma>) \<and> (\<forall>(k, \<gamma>)\<in>ps2. point_path \<gamma>))
[PROOF STEP]
by (auto simp add: common_sudiv_exists_def common_boundary_sudivision_exists_def)


[STATEMENT]
lemma scene_space_foldr_lb:
  "\<lbrakk> a \<in> scene_space; set xs \<subseteq> scene_space; \<forall> b\<in>set xs. b \<le> a \<rbrakk> \<Longrightarrow> \<Squnion>\<^sub>S xs \<subseteq>\<^sub>S a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> scene_space; set xs \<subseteq> scene_space; \<forall>b\<in>set xs. b \<subseteq>\<^sub>S a\<rbrakk> \<Longrightarrow> \<Squnion>\<^sub>S xs \<subseteq>\<^sub>S a
[PROOF STEP]
proof (induct xs arbitrary: a)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a. \<lbrakk>a \<in> scene_space; set [] \<subseteq> scene_space; \<forall>b\<in>set []. b \<subseteq>\<^sub>S a\<rbrakk> \<Longrightarrow> \<Squnion>\<^sub>S [] \<subseteq>\<^sub>S a
 2. \<And>a xs aa. \<lbrakk>\<And>a. \<lbrakk>a \<in> scene_space; set xs \<subseteq> scene_space; \<forall>b\<in>set xs. b \<subseteq>\<^sub>S a\<rbrakk> \<Longrightarrow> \<Squnion>\<^sub>S xs \<subseteq>\<^sub>S a; aa \<in> scene_space; set (a # xs) \<subseteq> scene_space; \<forall>b\<in>set (a # xs). b \<subseteq>\<^sub>S aa\<rbrakk> \<Longrightarrow> \<Squnion>\<^sub>S (a # xs) \<subseteq>\<^sub>S aa
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
a \<in> scene_space
set [] \<subseteq> scene_space
\<forall>b\<in>set []. b \<subseteq>\<^sub>S a

goal (2 subgoals):
 1. \<And>a. \<lbrakk>a \<in> scene_space; set [] \<subseteq> scene_space; \<forall>b\<in>set []. b \<subseteq>\<^sub>S a\<rbrakk> \<Longrightarrow> \<Squnion>\<^sub>S [] \<subseteq>\<^sub>S a
 2. \<And>a xs aa. \<lbrakk>\<And>a. \<lbrakk>a \<in> scene_space; set xs \<subseteq> scene_space; \<forall>b\<in>set xs. b \<subseteq>\<^sub>S a\<rbrakk> \<Longrightarrow> \<Squnion>\<^sub>S xs \<subseteq>\<^sub>S a; aa \<in> scene_space; set (a # xs) \<subseteq> scene_space; \<forall>b\<in>set (a # xs). b \<subseteq>\<^sub>S aa\<rbrakk> \<Longrightarrow> \<Squnion>\<^sub>S (a # xs) \<subseteq>\<^sub>S aa
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<in> scene_space
set [] \<subseteq> scene_space
\<forall>b\<in>set []. b \<subseteq>\<^sub>S a
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
a \<in> scene_space
set [] \<subseteq> scene_space
\<forall>b\<in>set []. b \<subseteq>\<^sub>S a

goal (1 subgoal):
 1. \<Squnion>\<^sub>S [] \<subseteq>\<^sub>S a
[PROOF STEP]
by (simp add: scene_bot_least)
[PROOF STATE]
proof (state)
this:
\<Squnion>\<^sub>S [] \<subseteq>\<^sub>S a

goal (1 subgoal):
 1. \<And>a xs aa. \<lbrakk>\<And>a. \<lbrakk>a \<in> scene_space; set xs \<subseteq> scene_space; \<forall>b\<in>set xs. b \<subseteq>\<^sub>S a\<rbrakk> \<Longrightarrow> \<Squnion>\<^sub>S xs \<subseteq>\<^sub>S a; aa \<in> scene_space; set (a # xs) \<subseteq> scene_space; \<forall>b\<in>set (a # xs). b \<subseteq>\<^sub>S aa\<rbrakk> \<Longrightarrow> \<Squnion>\<^sub>S (a # xs) \<subseteq>\<^sub>S aa
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a xs aa. \<lbrakk>\<And>a. \<lbrakk>a \<in> scene_space; set xs \<subseteq> scene_space; \<forall>b\<in>set xs. b \<subseteq>\<^sub>S a\<rbrakk> \<Longrightarrow> \<Squnion>\<^sub>S xs \<subseteq>\<^sub>S a; aa \<in> scene_space; set (a # xs) \<subseteq> scene_space; \<forall>b\<in>set (a # xs). b \<subseteq>\<^sub>S aa\<rbrakk> \<Longrightarrow> \<Squnion>\<^sub>S (a # xs) \<subseteq>\<^sub>S aa
[PROOF STEP]
case (Cons x xs)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?a \<in> scene_space; set xs \<subseteq> scene_space; \<forall>b\<in>set xs. b \<subseteq>\<^sub>S ?a\<rbrakk> \<Longrightarrow> \<Squnion>\<^sub>S xs \<subseteq>\<^sub>S ?a
a \<in> scene_space
set (x # xs) \<subseteq> scene_space
\<forall>b\<in>set (x # xs). b \<subseteq>\<^sub>S a

goal (1 subgoal):
 1. \<And>a xs aa. \<lbrakk>\<And>a. \<lbrakk>a \<in> scene_space; set xs \<subseteq> scene_space; \<forall>b\<in>set xs. b \<subseteq>\<^sub>S a\<rbrakk> \<Longrightarrow> \<Squnion>\<^sub>S xs \<subseteq>\<^sub>S a; aa \<in> scene_space; set (a # xs) \<subseteq> scene_space; \<forall>b\<in>set (a # xs). b \<subseteq>\<^sub>S aa\<rbrakk> \<Longrightarrow> \<Squnion>\<^sub>S (a # xs) \<subseteq>\<^sub>S aa
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?a \<in> scene_space; set xs \<subseteq> scene_space; \<forall>b\<in>set xs. b \<subseteq>\<^sub>S ?a\<rbrakk> \<Longrightarrow> \<Squnion>\<^sub>S xs \<subseteq>\<^sub>S ?a
a \<in> scene_space
set (x # xs) \<subseteq> scene_space
\<forall>b\<in>set (x # xs). b \<subseteq>\<^sub>S a
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?a \<in> scene_space; set xs \<subseteq> scene_space; \<forall>b\<in>set xs. b \<subseteq>\<^sub>S ?a\<rbrakk> \<Longrightarrow> \<Squnion>\<^sub>S xs \<subseteq>\<^sub>S ?a
a \<in> scene_space
set (x # xs) \<subseteq> scene_space
\<forall>b\<in>set (x # xs). b \<subseteq>\<^sub>S a

goal (1 subgoal):
 1. \<Squnion>\<^sub>S (x # xs) \<subseteq>\<^sub>S a
[PROOF STEP]
by (simp add: scene_space_compat scene_space_foldr scene_union_lb)
[PROOF STATE]
proof (state)
this:
\<Squnion>\<^sub>S (x # xs) \<subseteq>\<^sub>S a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mset_insort [simp]: "mset (insort x xs) = add_mset x (mset xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (insort x xs) = add_mset x (mset xs)
[PROOF STEP]
by (induct xs) simp_all


[STATEMENT]
lemma reflect_rtranclp:
  "(\<And>x y. S (f x) (f y) \<Longrightarrow> R x y) \<Longrightarrow>
   bij_on_trancl S f \<Longrightarrow>
   S\<^sup>*\<^sup>* (f x) (f y) \<Longrightarrow> R\<^sup>*\<^sup>* x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x y. S (f x) (f y) \<Longrightarrow> R x y; bij_on_trancl S f; S\<^sup>*\<^sup>* (f x) (f y)\<rbrakk> \<Longrightarrow> R\<^sup>*\<^sup>* x y
[PROOF STEP]
unfolding Nitpick.rtranclp_unfold
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x y. S (f x) (f y) \<Longrightarrow> R x y; bij_on_trancl S f; f x = f y \<or> S\<^sup>+\<^sup>+ (f x) (f y)\<rbrakk> \<Longrightarrow> x = y \<or> R\<^sup>+\<^sup>+ x y
[PROOF STEP]
by (metis (full_types) injD reflect_tranclp)


[STATEMENT]
lemma count_insert1:
  assumes "p partitions n"
  shows "sum (p(k := p k + 1)) {..n + k} = (\<Sum>i\<le>n. p i) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum (p(k := p k + 1)) {..n + k} = sum p {..n} + 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum (p(k := p k + 1)) {..n + k} = sum p {..n} + 1
[PROOF STEP]
have "(\<Sum>i\<le>n + k. (p(k := p k + 1)) i) = p k + (\<Sum>i\<in>{..n + k} - {k}. p i) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum (p(k := p k + 1)) {..n + k} = p k + sum p ({..n + k} - {k}) + 1
[PROOF STEP]
by (simp add: sum_atMost_remove_nat[of k])
[PROOF STATE]
proof (state)
this:
sum (p(k := p k + 1)) {..n + k} = p k + sum p ({..n + k} - {k}) + 1

goal (1 subgoal):
 1. sum (p(k := p k + 1)) {..n + k} = sum p {..n} + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum (p(k := p k + 1)) {..n + k} = p k + sum p ({..n + k} - {k}) + 1

goal (1 subgoal):
 1. sum (p(k := p k + 1)) {..n + k} = sum p {..n} + 1
[PROOF STEP]
have "... = p k + (\<Sum>i\<in>{..n} - {k}. p i) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p k + sum p ({..n + k} - {k}) + 1 = p k + sum p ({..n} - {k}) + 1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
p partitions n

goal (1 subgoal):
 1. p k + sum p ({..n + k} - {k}) + 1 = p k + sum p ({..n} - {k}) + 1
[PROOF STEP]
by (auto intro!: sum.mono_neutral_right elim!: partitionsE)
[PROOF STATE]
proof (state)
this:
p k + sum p ({..n + k} - {k}) + 1 = p k + sum p ({..n} - {k}) + 1

goal (1 subgoal):
 1. sum (p(k := p k + 1)) {..n + k} = sum p {..n} + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
p k + sum p ({..n + k} - {k}) + 1 = p k + sum p ({..n} - {k}) + 1

goal (1 subgoal):
 1. sum (p(k := p k + 1)) {..n + k} = sum p {..n} + 1
[PROOF STEP]
have "... = (\<Sum>i\<le>n. p i) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p k + sum p ({..n} - {k}) + 1 = sum p {..n} + 1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
p partitions n

goal (1 subgoal):
 1. p k + sum p ({..n} - {k}) + 1 = sum p {..n} + 1
[PROOF STEP]
by (cases "k \<le> n") (auto simp add: sum_atMost_remove_nat[of k] elim: partitionsE)
[PROOF STATE]
proof (state)
this:
p k + sum p ({..n} - {k}) + 1 = sum p {..n} + 1

goal (1 subgoal):
 1. sum (p(k := p k + 1)) {..n + k} = sum p {..n} + 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sum (p(k := p k + 1)) {..n + k} = sum p {..n} + 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sum (p(k := p k + 1)) {..n + k} = sum p {..n} + 1

goal (1 subgoal):
 1. sum (p(k := p k + 1)) {..n + k} = sum p {..n} + 1
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
sum (p(k := p k + 1)) {..n + k} = sum p {..n} + 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma from_nat_mono':
  assumes i_le_j: "i \<le> j" and "j<CARD ('a)"
  shows "(from_nat i::'a) \<le> from_nat j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mod_type_class.from_nat i \<le> mod_type_class.from_nat j
[PROOF STEP]
proof (cases "i=j")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. i = j \<Longrightarrow> mod_type_class.from_nat i \<le> mod_type_class.from_nat j
 2. i \<noteq> j \<Longrightarrow> mod_type_class.from_nat i \<le> mod_type_class.from_nat j
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
i = j

goal (2 subgoals):
 1. i = j \<Longrightarrow> mod_type_class.from_nat i \<le> mod_type_class.from_nat j
 2. i \<noteq> j \<Longrightarrow> mod_type_class.from_nat i \<le> mod_type_class.from_nat j
[PROOF STEP]
have "(from_nat i::'a) = from_nat j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mod_type_class.from_nat i = mod_type_class.from_nat j
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
i = j

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

goal (2 subgoals):
 1. i = j \<Longrightarrow> mod_type_class.from_nat i \<le> mod_type_class.from_nat j
 2. i \<noteq> j \<Longrightarrow> mod_type_class.from_nat i \<le> mod_type_class.from_nat j
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
mod_type_class.from_nat i = mod_type_class.from_nat j

goal (1 subgoal):
 1. mod_type_class.from_nat i \<le> mod_type_class.from_nat j
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
mod_type_class.from_nat i \<le> mod_type_class.from_nat j

goal (1 subgoal):
 1. i \<noteq> j \<Longrightarrow> mod_type_class.from_nat i \<le> mod_type_class.from_nat j
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. i \<noteq> j \<Longrightarrow> mod_type_class.from_nat i \<le> mod_type_class.from_nat j
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
i \<noteq> j

goal (1 subgoal):
 1. i \<noteq> j \<Longrightarrow> mod_type_class.from_nat i \<le> mod_type_class.from_nat j
[PROOF STEP]
hence "i<j"
[PROOF STATE]
proof (prove)
using this:
i \<noteq> j

goal (1 subgoal):
 1. i < j
[PROOF STEP]
using i_le_j
[PROOF STATE]
proof (prove)
using this:
i \<noteq> j
i \<le> j

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

goal (1 subgoal):
 1. i \<noteq> j \<Longrightarrow> mod_type_class.from_nat i \<le> mod_type_class.from_nat j
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
i < j

goal (1 subgoal):
 1. mod_type_class.from_nat i \<le> mod_type_class.from_nat j
[PROOF STEP]
by (metis assms(2) from_nat_mono less_imp_le)
[PROOF STATE]
proof (state)
this:
mod_type_class.from_nat i \<le> mod_type_class.from_nat j

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma poly_induct3:
  assumes "p \<in> carrier P"
  assumes add: "\<And>p q. q \<in> carrier P \<Longrightarrow> p \<in> carrier P \<Longrightarrow> Q p \<Longrightarrow> Q q  \<Longrightarrow> Q (p \<oplus>\<^bsub>P\<^esub> q)"
  assumes monom: "\<And>a n. a \<in> carrier R \<Longrightarrow> Q (monom P a n)"
  shows "Q p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Q p
[PROOF STEP]
apply(rule poly_induct2)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. p \<in> carrier P
 2. \<And>p. \<lbrakk>p \<in> carrier P; deg R p = 0\<rbrakk> \<Longrightarrow> Q p
 3. \<And>p. \<lbrakk>0 < deg R p; p \<in> carrier P; Q (Cring_Poly.truncate R p)\<rbrakk> \<Longrightarrow> Q p
[PROOF STEP]
apply (simp add: assms(1))
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>p. \<lbrakk>p \<in> carrier P; deg R p = 0\<rbrakk> \<Longrightarrow> Q p
 2. \<And>p. \<lbrakk>0 < deg R p; p \<in> carrier P; Q (Cring_Poly.truncate R p)\<rbrakk> \<Longrightarrow> Q p
[PROOF STEP]
apply (metis lcf_closed P_def coeff_simp deg_zero_impl_monom monom)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>p. \<lbrakk>0 < deg R p; p \<in> carrier P; Q (Cring_Poly.truncate R p)\<rbrakk> \<Longrightarrow> Q p
[PROOF STEP]
by (metis lcf_closed ltrm_closed add monom trunc_closed trunc_simps(1))


[STATEMENT]
lemma of_rat_ceiling [simp]:
  "\<lceil>of_rat r\<rceil> = \<lceil>r\<rceil>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lceil>of_rat r\<rceil> = \<lceil>r\<rceil>
[PROOF STEP]
using of_rat_floor [of "- r"]
[PROOF STATE]
proof (prove)
using this:
\<lfloor>of_rat (- r)\<rfloor> = \<lfloor>- r\<rfloor>

goal (1 subgoal):
 1. \<lceil>of_rat r\<rceil> = \<lceil>r\<rceil>
[PROOF STEP]
by (simp add: of_rat_minus ceiling_def)


[STATEMENT]
lemma rows_inj:
  assumes "dim_col A = dim_col B"
  assumes "rows A = rows B"
  shows "A = B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = B
[PROOF STEP]
unfolding mat_eq_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row A = dim_row B \<and> dim_col A = dim_col B \<and> (\<forall>i j. i < dim_row B \<longrightarrow> j < dim_col B \<longrightarrow> A $$ (i, j) = B $$ (i, j))
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. dim_row A = dim_row B
 2. dim_col A = dim_col B
 3. \<And>i j. \<lbrakk>i < dim_row B; j < dim_col B\<rbrakk> \<Longrightarrow> A $$ (i, j) = B $$ (i, j)
[PROOF STEP]
apply (metis assms(2) length_rows)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. dim_col A = dim_col B
 2. \<And>i j. \<lbrakk>i < dim_row B; j < dim_col B\<rbrakk> \<Longrightarrow> A $$ (i, j) = B $$ (i, j)
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
dim_col A = dim_col B

goal (2 subgoals):
 1. dim_col A = dim_col B
 2. \<And>i j. \<lbrakk>i < dim_row B; j < dim_col B\<rbrakk> \<Longrightarrow> A $$ (i, j) = B $$ (i, j)
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row B; j < dim_col B\<rbrakk> \<Longrightarrow> A $$ (i, j) = B $$ (i, j)
[PROOF STEP]
by (metis assms(1) assms(2) mat_of_rows_rows)


[STATEMENT]
lemma bifunctor_flip_ArrMap_vdomain[cat_cs_simps]:
  assumes "category \<alpha> \<AA>"
    and "category \<alpha> \<BB>"
    and "\<FF> : \<AA> \<times>\<^sub>C \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>"
  shows "\<D>\<^sub>\<circ> (bifunctor_flip \<AA> \<BB> \<FF>\<lparr>ArrMap\<rparr>) = (\<BB> \<times>\<^sub>C \<AA>)\<lparr>Arr\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (bifunctor_flip \<AA> \<BB> \<FF>\<lparr>ArrMap\<rparr>) = (\<BB> \<times>\<^sub>C \<AA>)\<lparr>Arr\<rparr>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
category \<alpha> \<AA>
category \<alpha> \<BB>
\<FF> : \<AA> \<times>\<^sub>C \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>

goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (bifunctor_flip \<AA> \<BB> \<FF>\<lparr>ArrMap\<rparr>) = (\<BB> \<times>\<^sub>C \<AA>)\<lparr>Arr\<rparr>
[PROOF STEP]
unfolding bifunctor_flip_components
[PROOF STATE]
proof (prove)
using this:
category \<alpha> \<AA>
category \<alpha> \<BB>
\<FF> : \<AA> \<times>\<^sub>C \<BB> \<mapsto>\<mapsto>\<^sub>C\<^bsub>\<alpha>\<^esub> \<CC>

goal (1 subgoal):
 1. \<D>\<^sub>\<circ> (fflip (\<FF>\<lparr>ArrMap\<rparr>)) = (\<BB> \<times>\<^sub>C \<AA>)\<lparr>Arr\<rparr>
[PROOF STEP]
by (cs_concl cs_shallow cs_simp: V_cs_simps cat_cs_simps)


[STATEMENT]
lemma tagged_partial_division_subset:
  assumes "s tagged_partial_division_of i"
    and "t \<subseteq> s"
  shows "t tagged_partial_division_of i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t tagged_partial_division_of i
[PROOF STEP]
using assms finite_subset[OF assms(2)]
[PROOF STATE]
proof (prove)
using this:
s tagged_partial_division_of i
t \<subseteq> s
finite s \<Longrightarrow> finite t

goal (1 subgoal):
 1. t tagged_partial_division_of i
[PROOF STEP]
unfolding tagged_partial_division_of_def
[PROOF STATE]
proof (prove)
using this:
finite s \<and> (\<forall>x K. (x, K) \<in> s \<longrightarrow> x \<in> K \<and> K \<subseteq> i \<and> (\<exists>a b. K = cbox a b)) \<and> (\<forall>x1 K1 x2 K2. (x1, K1) \<in> s \<and> (x2, K2) \<in> s \<and> (x1, K1) \<noteq> (x2, K2) \<longrightarrow> interior K1 \<inter> interior K2 = {})
t \<subseteq> s
finite s \<Longrightarrow> finite t

goal (1 subgoal):
 1. finite t \<and> (\<forall>x K. (x, K) \<in> t \<longrightarrow> x \<in> K \<and> K \<subseteq> i \<and> (\<exists>a b. K = cbox a b)) \<and> (\<forall>x1 K1 x2 K2. (x1, K1) \<in> t \<and> (x2, K2) \<in> t \<and> (x1, K1) \<noteq> (x2, K2) \<longrightarrow> interior K1 \<inter> interior K2 = {})
[PROOF STEP]
by blast


[STATEMENT]
lemma zmset_subset_add_zmset[simp]: "add_zmset x N \<subset>#\<^sub>z add_zmset x M \<longleftrightarrow> N \<subset>#\<^sub>z M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (add_zmset x N \<subset>#\<^sub>z add_zmset x M) = (N \<subset>#\<^sub>z M)
[PROOF STEP]
unfolding add_zmset_add_single[of _ N] add_zmset_add_single[of _ M]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (N + {#x#}\<^sub>z \<subset>#\<^sub>z M + {#x#}\<^sub>z) = (N \<subset>#\<^sub>z M)
[PROOF STEP]
by (fact subset_zmset.add_less_cancel_right)


[STATEMENT]
theorem wls_substAbs_psubstAbs_compose:
assumes "wlsAbs (us,s) A" and "wls (asSort ys) Y" and "wlsEnv rho"
shows "((A $[rho]) $[Y / y]_ys) = (A $[(rho &[Y / y]_ys)])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A $[rho] $[Y / y]_ys = A $[rho &[Y / y]_ys]
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
wlsAbs (us, s) A
wls (asSort ys) Y
wlsEnv rho

goal (1 subgoal):
 1. A $[rho] $[Y / y]_ys = A $[rho &[Y / y]_ys]
[PROOF STEP]
by(simp add: substAbs_psubstAbs_compose)


[STATEMENT]
lemma negGorbit_Cons :
  "negGorbit_list (g#gs) T as
        = (map (Gmult (-g) \<circ> T) as) # negGorbit_list gs T as"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. negGorbit_list (g # gs) T as = map ((*\<cdot>) (- g) \<circ> T) as # negGorbit_list gs T as
[PROOF STEP]
using negGorbit_list_def[of _ T as]
[PROOF STATE]
proof (prove)
using this:
negGorbit_list ?gs T as \<equiv> map (\<lambda>g. map ((*\<cdot>) (- g) \<circ> T) as) ?gs

goal (1 subgoal):
 1. negGorbit_list (g # gs) T as = map ((*\<cdot>) (- g) \<circ> T) as # negGorbit_list gs T as
[PROOF STEP]
by simp


[STATEMENT]
lemma edges_are_in_V: assumes "v\<rightarrow>w" shows "v \<in> V" "w \<in> V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> V &&& w \<in> V
[PROOF STEP]
using assms valid_edge_set
[PROOF STATE]
proof (prove)
using this:
v \<rightarrow> w
E \<subseteq> V \<times> V

goal (1 subgoal):
 1. v \<in> V &&& w \<in> V
[PROOF STEP]
by blast+


[STATEMENT]
lemma complex_powr_add_minus_powr_asymptotics:
  fixes s :: complex
  assumes a: "a > 0" and s: "Re s < 1"
  shows "filterlim (\<lambda>x. of_real (x + a) powr s - of_real x powr s) (nhds 0) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. complex_of_real (x + a) powr s - complex_of_real x powr s) \<longlongrightarrow> 0) at_top
[PROOF STEP]
proof (rule Lim_transform_eventually)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (?f \<longlongrightarrow> 0) at_top
 2. \<forall>\<^sub>F x in at_top. ?f x = complex_of_real (x + a) powr s - complex_of_real x powr s
[PROOF STEP]
show "eventually (\<lambda>x. ((1 + of_real (a / x)) powr s - 1) / of_real (a / x) *
                            of_real x powr (s - 1) * a =
                          of_real (x + a) powr s - of_real x powr s) at_top"
    (is "eventually (\<lambda>x. ?f x / ?g x * ?h x * _ = _) _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. ((1 + complex_of_real (a / x)) powr s - 1) / complex_of_real (a / x) * complex_of_real x powr (s - 1) * complex_of_real a = complex_of_real (x + a) powr s - complex_of_real x powr s
[PROOF STEP]
using eventually_gt_at_top[of a]
[PROOF STATE]
proof (prove)
using this:
eventually ((<) a) at_top

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. ((1 + complex_of_real (a / x)) powr s - 1) / complex_of_real (a / x) * complex_of_real x powr (s - 1) * complex_of_real a = complex_of_real (x + a) powr s - complex_of_real x powr s
[PROOF STEP]
proof eventually_elim
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. a < x \<Longrightarrow> ((1 + complex_of_real (a / x)) powr s - 1) / complex_of_real (a / x) * complex_of_real x powr (s - 1) * complex_of_real a = complex_of_real (x + a) powr s - complex_of_real x powr s
[PROOF STEP]
case (elim x)
[PROOF STATE]
proof (state)
this:
a < x

goal (1 subgoal):
 1. \<And>x. a < x \<Longrightarrow> ((1 + complex_of_real (a / x)) powr s - 1) / complex_of_real (a / x) * complex_of_real x powr (s - 1) * complex_of_real a = complex_of_real (x + a) powr s - complex_of_real x powr s
[PROOF STEP]
have "?f x / ?g x * ?h x * a = ?f x * (a * ?h x / ?g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((1 + complex_of_real (a / x)) powr s - 1) / complex_of_real (a / x) * complex_of_real x powr (s - 1) * complex_of_real a = ((1 + complex_of_real (a / x)) powr s - 1) * (complex_of_real a * complex_of_real x powr (s - 1) / complex_of_real (a / x))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
((1 + complex_of_real (a / x)) powr s - 1) / complex_of_real (a / x) * complex_of_real x powr (s - 1) * complex_of_real a = ((1 + complex_of_real (a / x)) powr s - 1) * (complex_of_real a * complex_of_real x powr (s - 1) / complex_of_real (a / x))

goal (1 subgoal):
 1. \<And>x. a < x \<Longrightarrow> ((1 + complex_of_real (a / x)) powr s - 1) / complex_of_real (a / x) * complex_of_real x powr (s - 1) * complex_of_real a = complex_of_real (x + a) powr s - complex_of_real x powr s
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((1 + complex_of_real (a / x)) powr s - 1) / complex_of_real (a / x) * complex_of_real x powr (s - 1) * complex_of_real a = ((1 + complex_of_real (a / x)) powr s - 1) * (complex_of_real a * complex_of_real x powr (s - 1) / complex_of_real (a / x))

goal (1 subgoal):
 1. \<And>x. a < x \<Longrightarrow> ((1 + complex_of_real (a / x)) powr s - 1) / complex_of_real (a / x) * complex_of_real x powr (s - 1) * complex_of_real a = complex_of_real (x + a) powr s - complex_of_real x powr s
[PROOF STEP]
have "a * ?h x / ?g x = of_real x powr s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. complex_of_real a * complex_of_real x powr (s - 1) / complex_of_real (a / x) = complex_of_real x powr s
[PROOF STEP]
using elim a
[PROOF STATE]
proof (prove)
using this:
a < x
0 < a

goal (1 subgoal):
 1. complex_of_real a * complex_of_real x powr (s - 1) / complex_of_real (a / x) = complex_of_real x powr s
[PROOF STEP]
by (simp add: powr_diff)
[PROOF STATE]
proof (state)
this:
complex_of_real a * complex_of_real x powr (s - 1) / complex_of_real (a / x) = complex_of_real x powr s

goal (1 subgoal):
 1. \<And>x. a < x \<Longrightarrow> ((1 + complex_of_real (a / x)) powr s - 1) / complex_of_real (a / x) * complex_of_real x powr (s - 1) * complex_of_real a = complex_of_real (x + a) powr s - complex_of_real x powr s
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
complex_of_real a * complex_of_real x powr (s - 1) / complex_of_real (a / x) = complex_of_real x powr s

goal (1 subgoal):
 1. \<And>x. a < x \<Longrightarrow> ((1 + complex_of_real (a / x)) powr s - 1) / complex_of_real (a / x) * complex_of_real x powr (s - 1) * complex_of_real a = complex_of_real (x + a) powr s - complex_of_real x powr s
[PROOF STEP]
have "?f x * \<dots> = of_real (x + a) powr s - of_real x powr s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((1 + complex_of_real (a / x)) powr s - 1) * complex_of_real x powr s = complex_of_real (x + a) powr s - complex_of_real x powr s
[PROOF STEP]
using a elim
[PROOF STATE]
proof (prove)
using this:
0 < a
a < x

goal (1 subgoal):
 1. ((1 + complex_of_real (a / x)) powr s - 1) * complex_of_real x powr s = complex_of_real (x + a) powr s - complex_of_real x powr s
[PROOF STEP]
by (simp add: algebra_simps powr_times_real [symmetric])
[PROOF STATE]
proof (state)
this:
((1 + complex_of_real (a / x)) powr s - 1) * complex_of_real x powr s = complex_of_real (x + a) powr s - complex_of_real x powr s

goal (1 subgoal):
 1. \<And>x. a < x \<Longrightarrow> ((1 + complex_of_real (a / x)) powr s - 1) / complex_of_real (a / x) * complex_of_real x powr (s - 1) * complex_of_real a = complex_of_real (x + a) powr s - complex_of_real x powr s
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
((1 + complex_of_real (a / x)) powr s - 1) / complex_of_real (a / x) * complex_of_real x powr (s - 1) * complex_of_real a = complex_of_real (x + a) powr s - complex_of_real x powr s
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
((1 + complex_of_real (a / x)) powr s - 1) / complex_of_real (a / x) * complex_of_real x powr (s - 1) * complex_of_real a = complex_of_real (x + a) powr s - complex_of_real x powr s

goal (1 subgoal):
 1. ((1 + complex_of_real (a / x)) powr s - 1) / complex_of_real (a / x) * complex_of_real x powr (s - 1) * complex_of_real a = complex_of_real (x + a) powr s - complex_of_real x powr s
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
((1 + complex_of_real (a / x)) powr s - 1) / complex_of_real (a / x) * complex_of_real x powr (s - 1) * complex_of_real a = complex_of_real (x + a) powr s - complex_of_real x powr s

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. ((1 + complex_of_real (a / x)) powr s - 1) / complex_of_real (a / x) * complex_of_real x powr (s - 1) * complex_of_real a = complex_of_real (x + a) powr s - complex_of_real x powr s

goal (1 subgoal):
 1. ((\<lambda>x. ((1 + complex_of_real (a / x)) powr s - 1) / complex_of_real (a / x) * complex_of_real x powr (s - 1) * complex_of_real a) \<longlongrightarrow> 0) at_top
[PROOF STEP]
have "filterlim (\<lambda>x. complex_of_real (a / x)) (nhds (complex_of_real 0)) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. complex_of_real (a / x)) \<longlongrightarrow> complex_of_real 0) at_top
[PROOF STEP]
by (intro tendsto_of_real real_tendsto_divide_at_top[OF tendsto_const] filterlim_ident)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. complex_of_real (a / x)) \<longlongrightarrow> complex_of_real 0) at_top

goal (1 subgoal):
 1. ((\<lambda>x. ((1 + complex_of_real (a / x)) powr s - 1) / complex_of_real (a / x) * complex_of_real x powr (s - 1) * complex_of_real a) \<longlongrightarrow> 0) at_top
[PROOF STEP]
hence "filterlim (\<lambda>x. complex_of_real (a / x)) (at 0) at_top"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. complex_of_real (a / x)) \<longlongrightarrow> complex_of_real 0) at_top

goal (1 subgoal):
 1. LIM x at_top. complex_of_real (a / x) :> at 0
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. complex_of_real (a / x)) \<longlongrightarrow> complex_of_real 0) at_top
0 < a

goal (1 subgoal):
 1. LIM x at_top. complex_of_real (a / x) :> at 0
[PROOF STEP]
by (intro filterlim_atI) auto
[PROOF STATE]
proof (state)
this:
LIM x at_top. complex_of_real (a / x) :> at 0

goal (1 subgoal):
 1. ((\<lambda>x. ((1 + complex_of_real (a / x)) powr s - 1) / complex_of_real (a / x) * complex_of_real x powr (s - 1) * complex_of_real a) \<longlongrightarrow> 0) at_top
[PROOF STEP]
hence "((\<lambda>x. ?f x / ?g x * ?h x * a) \<longlongrightarrow> s * 0 * a) at_top"
[PROOF STATE]
proof (prove)
using this:
LIM x at_top. complex_of_real (a / x) :> at 0

goal (1 subgoal):
 1. ((\<lambda>x. ((1 + complex_of_real (a / x)) powr s - 1) / complex_of_real (a / x) * complex_of_real x powr (s - 1) * complex_of_real a) \<longlongrightarrow> s * 0 * complex_of_real a) at_top
[PROOF STEP]
using s
[PROOF STATE]
proof (prove)
using this:
LIM x at_top. complex_of_real (a / x) :> at 0
Re s < 1

goal (1 subgoal):
 1. ((\<lambda>x. ((1 + complex_of_real (a / x)) powr s - 1) / complex_of_real (a / x) * complex_of_real x powr (s - 1) * complex_of_real a) \<longlongrightarrow> s * 0 * complex_of_real a) at_top
[PROOF STEP]
by (intro tendsto_mult filterlim_compose[OF powr_add_minus_powr_asymptotics]
              tendsto_const tendsto_neg_powr_complex_of_real filterlim_ident) auto
[PROOF STATE]
proof (state)
this:
((\<lambda>x. ((1 + complex_of_real (a / x)) powr s - 1) / complex_of_real (a / x) * complex_of_real x powr (s - 1) * complex_of_real a) \<longlongrightarrow> s * 0 * complex_of_real a) at_top

goal (1 subgoal):
 1. ((\<lambda>x. ((1 + complex_of_real (a / x)) powr s - 1) / complex_of_real (a / x) * complex_of_real x powr (s - 1) * complex_of_real a) \<longlongrightarrow> 0) at_top
[PROOF STEP]
thus "((\<lambda>x. ?f x / ?g x * ?h x * a) \<longlongrightarrow> 0) at_top"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. ((1 + complex_of_real (a / x)) powr s - 1) / complex_of_real (a / x) * complex_of_real x powr (s - 1) * complex_of_real a) \<longlongrightarrow> s * 0 * complex_of_real a) at_top

goal (1 subgoal):
 1. ((\<lambda>x. ((1 + complex_of_real (a / x)) powr s - 1) / complex_of_real (a / x) * complex_of_real x powr (s - 1) * complex_of_real a) \<longlongrightarrow> 0) at_top
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
((\<lambda>x. ((1 + complex_of_real (a / x)) powr s - 1) / complex_of_real (a / x) * complex_of_real x powr (s - 1) * complex_of_real a) \<longlongrightarrow> 0) at_top

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma gfp_exp_unfold:
  "(\<And>P. unitary P \<Longrightarrow> unitary (t P)) \<Longrightarrow> (\<And>P Q. \<lbrakk> unitary P; unitary Q; P \<tturnstile> Q \<rbrakk> \<Longrightarrow> t P \<tturnstile> t Q) \<Longrightarrow>
   gfp_exp t = t (gfp_exp t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>P. unitary P \<Longrightarrow> unitary (t P); \<And>P Q. \<lbrakk>unitary P; unitary Q; P \<tturnstile> Q\<rbrakk> \<Longrightarrow> t P \<tturnstile> t Q\<rbrakk> \<Longrightarrow> gfp_exp t = t (gfp_exp t)
[PROOF STEP]
by(iprover intro:antisym gfp_exp_lemma2 gfp_exp_lemma3)


[STATEMENT]
lemma inversion_of_complex [simp]:
  assumes "z \<noteq> 0"
  shows "inversion (of_complex z) = of_complex (1 / cnj z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inversion (of_complex z) = of_complex (1 / cnj z)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
z \<noteq> 0

goal (1 subgoal):
 1. inversion (of_complex z) = of_complex (1 / cnj z)
[PROOF STEP]
by (simp add: inversion_def)


[STATEMENT]
lemma lm155:
  assumes "runiq f" "X \<subseteq> Domain f"
  shows "graph X (toFunction f) = (f||X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. graph X (toFunction f) = f || X
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. graph X (toFunction f) = f || X
[PROOF STEP]
have "\<And>v w. (v::'a set) \<subseteq> w \<longrightarrow> w \<inter> v = v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>v w. v \<subseteq> w \<longrightarrow> w \<inter> v = v
[PROOF STEP]
by (simp add: Int_commute inf.absorb1)
[PROOF STATE]
proof (state)
this:
?v \<subseteq> ?w \<longrightarrow> ?w \<inter> ?v = ?v

goal (1 subgoal):
 1. graph X (toFunction f) = f || X
[PROOF STEP]
thus "graph X (toFunction f) = f || X"
[PROOF STATE]
proof (prove)
using this:
?v \<subseteq> ?w \<longrightarrow> ?w \<inter> ?v = ?v

goal (1 subgoal):
 1. graph X (toFunction f) = f || X
[PROOF STEP]
by (metis assms(1) assms(2) doubleRestriction lm004 lm153)
[PROOF STATE]
proof (state)
this:
graph X (toFunction f) = f || X

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma angular_component_p:
"angular_component \<pp> = \<one>\<^bsub>Z\<^sub>p\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. angular_component \<pp> = \<one>\<^bsub>Z\<^sub>p\<^esub>
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. angular_component \<pp> = \<one>\<^bsub>Z\<^sub>p\<^esub>
[PROOF STEP]
have "\<pp> = frac \<p> \<one>\<^bsub>Z\<^sub>p\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<pp> = fraction Z\<^sub>p ([p] \<cdot>\<^bsub>Z\<^sub>p\<^esub> \<one>\<^bsub>Z\<^sub>p\<^esub>) \<one>\<^bsub>Z\<^sub>p\<^esub>
[PROOF STEP]
by (simp add: Zp_nat_inc_closed local.inc_def p_inc)
[PROOF STATE]
proof (state)
this:
\<pp> = fraction Z\<^sub>p ([p] \<cdot>\<^bsub>Z\<^sub>p\<^esub> \<one>\<^bsub>Z\<^sub>p\<^esub>) \<one>\<^bsub>Z\<^sub>p\<^esub>

goal (1 subgoal):
 1. angular_component \<pp> = \<one>\<^bsub>Z\<^sub>p\<^esub>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<pp> = fraction Z\<^sub>p ([p] \<cdot>\<^bsub>Z\<^sub>p\<^esub> \<one>\<^bsub>Z\<^sub>p\<^esub>) \<one>\<^bsub>Z\<^sub>p\<^esub>
[PROOF STEP]
have 0: "angular_component \<pp> = (ac_Zp \<p>) \<otimes>\<^bsub>Z\<^sub>p\<^esub> inv\<^bsub>Z\<^sub>p\<^esub> (ac_Zp \<one>\<^bsub>Z\<^sub>p\<^esub>)"
[PROOF STATE]
proof (prove)
using this:
\<pp> = fraction Z\<^sub>p ([p] \<cdot>\<^bsub>Z\<^sub>p\<^esub> \<one>\<^bsub>Z\<^sub>p\<^esub>) \<one>\<^bsub>Z\<^sub>p\<^esub>

goal (1 subgoal):
 1. angular_component \<pp> = ac_Zp ([p] \<cdot>\<^bsub>Z\<^sub>p\<^esub> \<one>\<^bsub>Z\<^sub>p\<^esub>) \<otimes>\<^bsub>Z\<^sub>p\<^esub> inv\<^bsub>Z\<^sub>p\<^esub> ac_Zp \<one>\<^bsub>Z\<^sub>p\<^esub>
[PROOF STEP]
using ac_Zp_one
[PROOF STATE]
proof (prove)
using this:
\<pp> = fraction Z\<^sub>p ([p] \<cdot>\<^bsub>Z\<^sub>p\<^esub> \<one>\<^bsub>Z\<^sub>p\<^esub>) \<one>\<^bsub>Z\<^sub>p\<^esub>
ac_Zp \<one>\<^bsub>Z\<^sub>p\<^esub> = \<one>\<^bsub>Z\<^sub>p\<^esub>

goal (1 subgoal):
 1. angular_component \<pp> = ac_Zp ([p] \<cdot>\<^bsub>Z\<^sub>p\<^esub> \<one>\<^bsub>Z\<^sub>p\<^esub>) \<otimes>\<^bsub>Z\<^sub>p\<^esub> inv\<^bsub>Z\<^sub>p\<^esub> ac_Zp \<one>\<^bsub>Z\<^sub>p\<^esub>
[PROOF STEP]
unfolding angular_component_def
[PROOF STATE]
proof (prove)
using this:
\<pp> = fraction Z\<^sub>p ([p] \<cdot>\<^bsub>Z\<^sub>p\<^esub> \<one>\<^bsub>Z\<^sub>p\<^esub>) \<one>\<^bsub>Z\<^sub>p\<^esub>
ac_Zp \<one>\<^bsub>Z\<^sub>p\<^esub> = \<one>\<^bsub>Z\<^sub>p\<^esub>

goal (1 subgoal):
 1. ac_Zp (numerator Z\<^sub>p \<pp>) \<otimes>\<^bsub>Z\<^sub>p\<^esub> inv\<^bsub>Z\<^sub>p\<^esub> ac_Zp (denominator Z\<^sub>p \<pp>) = ac_Zp ([p] \<cdot>\<^bsub>Z\<^sub>p\<^esub> \<one>\<^bsub>Z\<^sub>p\<^esub>) \<otimes>\<^bsub>Z\<^sub>p\<^esub> inv\<^bsub>Z\<^sub>p\<^esub> ac_Zp \<one>\<^bsub>Z\<^sub>p\<^esub>
[PROOF STEP]
by (metis Q\<^sub>p_def Qp.int_inc_closed Zp.one_nonzero Zp_int_inc_closed ac_fract
        local.numer_denom_facts(2) local.numer_denom_facts(5) nonzero_fraction_imp_nonzero_numer
        nonzero_numer_imp_nonzero_fraction numer_nonzero p_nonzero)
[PROOF STATE]
proof (state)
this:
angular_component \<pp> = ac_Zp ([p] \<cdot>\<^bsub>Z\<^sub>p\<^esub> \<one>\<^bsub>Z\<^sub>p\<^esub>) \<otimes>\<^bsub>Z\<^sub>p\<^esub> inv\<^bsub>Z\<^sub>p\<^esub> ac_Zp \<one>\<^bsub>Z\<^sub>p\<^esub>

goal (1 subgoal):
 1. angular_component \<pp> = \<one>\<^bsub>Z\<^sub>p\<^esub>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
angular_component \<pp> = ac_Zp ([p] \<cdot>\<^bsub>Z\<^sub>p\<^esub> \<one>\<^bsub>Z\<^sub>p\<^esub>) \<otimes>\<^bsub>Z\<^sub>p\<^esub> inv\<^bsub>Z\<^sub>p\<^esub> ac_Zp \<one>\<^bsub>Z\<^sub>p\<^esub>
[PROOF STEP]
have "angular_component \<pp> = (ac_Zp \<p>) \<otimes>\<^bsub>Z\<^sub>p\<^esub> inv\<^bsub>Z\<^sub>p\<^esub> \<one>\<^bsub>Z\<^sub>p\<^esub>"
[PROOF STATE]
proof (prove)
using this:
angular_component \<pp> = ac_Zp ([p] \<cdot>\<^bsub>Z\<^sub>p\<^esub> \<one>\<^bsub>Z\<^sub>p\<^esub>) \<otimes>\<^bsub>Z\<^sub>p\<^esub> inv\<^bsub>Z\<^sub>p\<^esub> ac_Zp \<one>\<^bsub>Z\<^sub>p\<^esub>

goal (1 subgoal):
 1. angular_component \<pp> = ac_Zp ([p] \<cdot>\<^bsub>Z\<^sub>p\<^esub> \<one>\<^bsub>Z\<^sub>p\<^esub>) \<otimes>\<^bsub>Z\<^sub>p\<^esub> inv\<^bsub>Z\<^sub>p\<^esub> \<one>\<^bsub>Z\<^sub>p\<^esub>
[PROOF STEP]
by (simp add: ac_Zp_one)
[PROOF STATE]
proof (state)
this:
angular_component \<pp> = ac_Zp ([p] \<cdot>\<^bsub>Z\<^sub>p\<^esub> \<one>\<^bsub>Z\<^sub>p\<^esub>) \<otimes>\<^bsub>Z\<^sub>p\<^esub> inv\<^bsub>Z\<^sub>p\<^esub> \<one>\<^bsub>Z\<^sub>p\<^esub>

goal (1 subgoal):
 1. angular_component \<pp> = \<one>\<^bsub>Z\<^sub>p\<^esub>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
angular_component \<pp> = ac_Zp ([p] \<cdot>\<^bsub>Z\<^sub>p\<^esub> \<one>\<^bsub>Z\<^sub>p\<^esub>) \<otimes>\<^bsub>Z\<^sub>p\<^esub> inv\<^bsub>Z\<^sub>p\<^esub> \<one>\<^bsub>Z\<^sub>p\<^esub>
[PROOF STEP]
have "angular_component \<pp> = (ac_Zp \<p>)"
[PROOF STATE]
proof (prove)
using this:
angular_component \<pp> = ac_Zp ([p] \<cdot>\<^bsub>Z\<^sub>p\<^esub> \<one>\<^bsub>Z\<^sub>p\<^esub>) \<otimes>\<^bsub>Z\<^sub>p\<^esub> inv\<^bsub>Z\<^sub>p\<^esub> \<one>\<^bsub>Z\<^sub>p\<^esub>

goal (1 subgoal):
 1. angular_component \<pp> = ac_Zp ([p] \<cdot>\<^bsub>Z\<^sub>p\<^esub> \<one>\<^bsub>Z\<^sub>p\<^esub>)
[PROOF STEP]
by (simp add: ac_Zp_p)
[PROOF STATE]
proof (state)
this:
angular_component \<pp> = ac_Zp ([p] \<cdot>\<^bsub>Z\<^sub>p\<^esub> \<one>\<^bsub>Z\<^sub>p\<^esub>)

goal (1 subgoal):
 1. angular_component \<pp> = \<one>\<^bsub>Z\<^sub>p\<^esub>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
angular_component \<pp> = ac_Zp ([p] \<cdot>\<^bsub>Z\<^sub>p\<^esub> \<one>\<^bsub>Z\<^sub>p\<^esub>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
angular_component \<pp> = ac_Zp ([p] \<cdot>\<^bsub>Z\<^sub>p\<^esub> \<one>\<^bsub>Z\<^sub>p\<^esub>)

goal (1 subgoal):
 1. angular_component \<pp> = \<one>\<^bsub>Z\<^sub>p\<^esub>
[PROOF STEP]
using ac_Zp_p
[PROOF STATE]
proof (prove)
using this:
angular_component \<pp> = ac_Zp ([p] \<cdot>\<^bsub>Z\<^sub>p\<^esub> \<one>\<^bsub>Z\<^sub>p\<^esub>)
ac_Zp ([p] \<cdot>\<^bsub>Z\<^sub>p\<^esub> \<one>\<^bsub>Z\<^sub>p\<^esub>) = \<one>\<^bsub>Z\<^sub>p\<^esub>

goal (1 subgoal):
 1. angular_component \<pp> = \<one>\<^bsub>Z\<^sub>p\<^esub>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
angular_component \<pp> = \<one>\<^bsub>Z\<^sub>p\<^esub>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dnf_to_bool_set: "dnf_to_bool \<gamma> dnf \<longleftrightarrow> (\<exists> d \<in> set dnf. cnf_to_bool \<gamma> d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dnf_to_bool \<gamma> dnf = (\<exists>d\<in>set dnf. cnf_to_bool \<gamma> d)
[PROOF STEP]
proof(induction dnf)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. dnf_to_bool \<gamma> [] = (\<exists>d\<in>set []. cnf_to_bool \<gamma> d)
 2. \<And>a dnf. dnf_to_bool \<gamma> dnf = (\<exists>d\<in>set dnf. cnf_to_bool \<gamma> d) \<Longrightarrow> dnf_to_bool \<gamma> (a # dnf) = (\<exists>d\<in>set (a # dnf). cnf_to_bool \<gamma> d)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. dnf_to_bool \<gamma> [] = (\<exists>d\<in>set []. cnf_to_bool \<gamma> d)
 2. \<And>a dnf. dnf_to_bool \<gamma> dnf = (\<exists>d\<in>set dnf. cnf_to_bool \<gamma> d) \<Longrightarrow> dnf_to_bool \<gamma> (a # dnf) = (\<exists>d\<in>set (a # dnf). cnf_to_bool \<gamma> d)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dnf_to_bool \<gamma> [] = (\<exists>d\<in>set []. cnf_to_bool \<gamma> d)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dnf_to_bool \<gamma> [] = (\<exists>d\<in>set []. cnf_to_bool \<gamma> d)

goal (1 subgoal):
 1. \<And>a dnf. dnf_to_bool \<gamma> dnf = (\<exists>d\<in>set dnf. cnf_to_bool \<gamma> d) \<Longrightarrow> dnf_to_bool \<gamma> (a # dnf) = (\<exists>d\<in>set (a # dnf). cnf_to_bool \<gamma> d)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a dnf. dnf_to_bool \<gamma> dnf = (\<exists>d\<in>set dnf. cnf_to_bool \<gamma> d) \<Longrightarrow> dnf_to_bool \<gamma> (a # dnf) = (\<exists>d\<in>set (a # dnf). cnf_to_bool \<gamma> d)
[PROOF STEP]
case (Cons d d1)
[PROOF STATE]
proof (state)
this:
dnf_to_bool \<gamma> d1 = (\<exists>d\<in>set d1. cnf_to_bool \<gamma> d)

goal (1 subgoal):
 1. \<And>a dnf. dnf_to_bool \<gamma> dnf = (\<exists>d\<in>set dnf. cnf_to_bool \<gamma> d) \<Longrightarrow> dnf_to_bool \<gamma> (a # dnf) = (\<exists>d\<in>set (a # dnf). cnf_to_bool \<gamma> d)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
dnf_to_bool \<gamma> d1 = (\<exists>d\<in>set d1. cnf_to_bool \<gamma> d)

goal (1 subgoal):
 1. dnf_to_bool \<gamma> (d # d1) = (\<exists>d\<in>set (d # d1). cnf_to_bool \<gamma> d)
[PROOF STEP]
by(simp)
[PROOF STATE]
proof (state)
this:
dnf_to_bool \<gamma> (d # d1) = (\<exists>d\<in>set (d # d1). cnf_to_bool \<gamma> d)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Integral_eq_diff_bounds: "a \<le> b \<Longrightarrow> Integral(a,b) (\<lambda>x. 1) (b - a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<le> b \<Longrightarrow> Integral (a, b) (\<lambda>x. 1) (b - a)
[PROOF STEP]
using Integral_mult_const [of a b 1]
[PROOF STATE]
proof (prove)
using this:
a \<le> b \<Longrightarrow> Integral (a, b) (\<lambda>x. 1) (1 * (b - a))

goal (1 subgoal):
 1. a \<le> b \<Longrightarrow> Integral (a, b) (\<lambda>x. 1) (b - a)
[PROOF STEP]
by simp


[STATEMENT]
lemma unit_factor_prime: "prime x \<Longrightarrow> unit_factor x = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime x \<Longrightarrow> unit_factor x = (1::'a)
[PROOF STEP]
using unit_factor_normalize[of x]
[PROOF STATE]
proof (prove)
using this:
x \<noteq> (0::'a) \<Longrightarrow> unit_factor (normalize x) = (1::'a)

goal (1 subgoal):
 1. prime x \<Longrightarrow> unit_factor x = (1::'a)
[PROOF STEP]
unfolding prime_def
[PROOF STATE]
proof (prove)
using this:
x \<noteq> (0::'a) \<Longrightarrow> unit_factor (normalize x) = (1::'a)

goal (1 subgoal):
 1. prime_elem x \<and> normalize x = x \<Longrightarrow> unit_factor x = (1::'a)
[PROOF STEP]
by auto


[STATEMENT]
lemma monom_mult_sum_right: "monom_mult c t (sum f P) = (\<Sum>p\<in>P. monom_mult c t (f p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monom_mult c t (sum f P) = (\<Sum>p\<in>P. monom_mult c t (f p))
[PROOF STEP]
by (rule fun_sum_commute, simp_all add: monom_mult_dist_right)


[STATEMENT]
lemma float_val_ge_bottomfloat: "valof a \<ge> valof (bottomfloat::('e, 'f)float)"
  if "LENGTH('e) > 1" "is_finite a"
  for a::"('e,'f)float"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valof (- topfloat) \<le> valof a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. valof (- topfloat) \<le> valof a
[PROOF STEP]
have "- a \<le> topfloat"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - a \<le> topfloat
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
1 < LENGTH('e)
is_finite a

goal (1 subgoal):
 1. - a \<le> topfloat
[PROOF STEP]
by (auto intro: float_le_topfloat)
[PROOF STATE]
proof (state)
this:
- a \<le> topfloat

goal (1 subgoal):
 1. valof (- topfloat) \<le> valof a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
- a \<le> topfloat
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
- a \<le> topfloat

goal (1 subgoal):
 1. valof (- topfloat) \<le> valof a
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
- a \<le> topfloat
1 < LENGTH('e)
is_finite a

goal (1 subgoal):
 1. valof (- topfloat) \<le> valof a
[PROOF STEP]
by (auto simp: valof_uminus finite_topfloat)
[PROOF STATE]
proof (state)
this:
valof (- topfloat) \<le> valof a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cong_cop_per2_gen:
  assumes "A \<noteq> B" and
    "Per A B X" and
    "Per A B Y" and
    "Cong B X B Y" and
    "Coplanar A B X Y"
  shows "X = Y \<or> X Y Reflect A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X = Y \<or> X Y Reflect A B
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. X = Y \<or> X Y Reflect A B
[PROOF STEP]
have "X = Y \<or> B Midpoint X Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X = Y \<or> B Midpoint X Y
[PROOF STEP]
using assms(1) assms(2) assms(3) assms(4) assms(5) cong_cop_per2_1
[PROOF STATE]
proof (prove)
using this:
A \<noteq> B
Per A B X
Per A B Y
Cong B X B Y
Coplanar A B X Y
\<lbrakk>?A \<noteq> ?B; Per ?A ?B ?X; Per ?A ?B ?Y; Cong ?B ?X ?B ?Y; Coplanar ?A ?B ?X ?Y\<rbrakk> \<Longrightarrow> ?X = ?Y \<or> ?B Midpoint ?X ?Y

goal (1 subgoal):
 1. X = Y \<or> B Midpoint X Y
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
X = Y \<or> B Midpoint X Y

goal (1 subgoal):
 1. X = Y \<or> X Y Reflect A B
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
X = Y \<or> B Midpoint X Y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
X = Y \<or> B Midpoint X Y

goal (1 subgoal):
 1. X = Y \<or> X Y Reflect A B
[PROOF STEP]
using assms(2) cong_midpoint__image l10_4 per_double_cong
[PROOF STATE]
proof (prove)
using this:
X = Y \<or> B Midpoint X Y
Per A B X
\<lbrakk>Cong ?A ?X ?A ?Y; ?B Midpoint ?X ?Y\<rbrakk> \<Longrightarrow> ?Y ?X Reflect ?A ?B
?P ?P' Reflect ?A ?B \<Longrightarrow> ?P' ?P Reflect ?A ?B
\<lbrakk>Per ?A ?B ?C; ?B Midpoint ?C ?C'\<rbrakk> \<Longrightarrow> Cong ?A ?C ?A ?C'

goal (1 subgoal):
 1. X = Y \<or> X Y Reflect A B
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
X = Y \<or> X Y Reflect A B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma BfunI:
  assumes K: "eventually (\<lambda>x. norm (f x) \<le> K) F"
  shows "Bfun f F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Bfun f F
[PROOF STEP]
unfolding Bfun_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>K>0. \<forall>\<^sub>F x in F. norm (f x) \<le> K
[PROOF STEP]
proof (intro exI conjI allI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 < ?K
 2. \<forall>\<^sub>F x in F. norm (f x) \<le> ?K
[PROOF STEP]
show "0 < max K 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < max K 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < max K 1

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. norm (f x) \<le> max K 1
[PROOF STEP]
show "eventually (\<lambda>x. norm (f x) \<le> max K 1) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. norm (f x) \<le> max K 1
[PROOF STEP]
using K
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. norm (f x) \<le> K

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. norm (f x) \<le> max K 1
[PROOF STEP]
by (rule eventually_mono) simp
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. norm (f x) \<le> max K 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in aGroup) ag_eq_sol2:"\<lbrakk>a \<in> carrier A; x\<in> carrier A; b\<in> carrier A;
                                x \<plusminus> a = b\<rbrakk> \<Longrightarrow> x = b \<plusminus> (-\<^sub>a a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier A; x \<in> carrier A; b \<in> carrier A; x \<plusminus> a = b\<rbrakk> \<Longrightarrow> x = b \<plusminus> -\<^sub>a a
[PROOF STEP]
apply (frule ag_mOp_closed[of "a"],
       frule aassoc[of "x" "a" "-\<^sub>a a"], assumption+,
       simp add:ag_r_inv1 ag_r_zero)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma fds_shift_add [simp]:
  fixes f g :: "'a :: {monoid_add, nat_power} fds"
  shows "fds_shift c (f + g) = fds_shift c f + fds_shift c g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_shift c (f + g) = fds_shift c f + fds_shift c g
[PROOF STEP]
by (rule fds_eqI) (simp add: algebra_simps)


[STATEMENT]
lemma fds_converges_altdef:
  "fds_converges f s \<longleftrightarrow> (\<lambda>n. fds_nth f (Suc n) / nat_power (Suc n) s) sums eval_fds f s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_converges f s = (\<lambda>n. fds_nth f (Suc n) / nat_power (Suc n) s) sums eval_fds f s
[PROOF STEP]
unfolding fds_converges_def summable_sums_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. fds_nth f n / nat_power n s) sums (\<Sum>n. fds_nth f n / nat_power n s) = (\<lambda>n. fds_nth f (Suc n) / nat_power (Suc n) s) sums eval_fds f s
[PROOF STEP]
by (subst sums_Suc_iff) (simp_all add: eval_fds_def)


[STATEMENT]
lemma internal_induct:
  "X \<in> InternalSets \<Longrightarrow> (0::hypnat) \<in> X \<Longrightarrow> \<forall>n. n \<in> X \<longrightarrow> n + 1 \<in> X \<Longrightarrow> X = (UNIV:: hypnat set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>X \<in> InternalSets; 0 \<in> X; \<forall>n. n \<in> X \<longrightarrow> n + 1 \<in> X\<rbrakk> \<Longrightarrow> X = UNIV
[PROOF STEP]
apply (clarsimp simp add: InternalSets_def starset_n_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>As. \<lbrakk>0 \<in> Iset (star_n As); \<forall>n. n \<in> Iset (star_n As) \<longrightarrow> n + 1 \<in> Iset (star_n As); X = Iset (star_n As)\<rbrakk> \<Longrightarrow> Iset (star_n As) = UNIV
[PROOF STEP]
apply (erule (1) internal_induct_lemma)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma prime_factorization_prod_mset:
  assumes "0 \<notin># A"
  shows "prime_factorization (prod_mset A) = \<Sum>\<^sub>#(image_mset prime_factorization A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime_factorization (\<Prod>\<^sub># A) = \<Sum>\<^sub># (image_mset prime_factorization A)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(0::'a) \<notin># A

goal (1 subgoal):
 1. prime_factorization (\<Prod>\<^sub># A) = \<Sum>\<^sub># (image_mset prime_factorization A)
[PROOF STEP]
by (induct A) (auto simp add: prime_factorization_mult)


[STATEMENT]
lemma plus_minus_not_NULL_ab: "x \<le> ab - c \<Longrightarrow> c \<le> ab \<Longrightarrow> c \<noteq> 0 \<Longrightarrow> x + c \<noteq> 0"
  for x ab c :: "'a::len word"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<le> ab - c; c \<le> ab; c \<noteq> 0\<rbrakk> \<Longrightarrow> x + c \<noteq> 0
[PROOF STEP]
by uint_arith


[STATEMENT]
lemma prefix_drop:
  "\<lbrakk> drop (length xs) ys = zs; prefix xs ys \<rbrakk>
   \<Longrightarrow> ys = xs @ zs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>drop (length xs) ys = zs; prefix xs ys\<rbrakk> \<Longrightarrow> ys = xs @ zs
[PROOF STEP]
by (metis append_eq_conv_conj prefix_def)


[STATEMENT]
lemma pred_pmf_of_set [simp]: "\<lbrakk> finite A; A \<noteq> {} \<rbrakk> \<Longrightarrow> pred_pmf P (pmf_of_set A) = Ball A P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; A \<noteq> {}\<rbrakk> \<Longrightarrow> pred_pmf P (pmf_of_set A) = Ball A P
[PROOF STEP]
by(simp add: pred_pmf_def)


[STATEMENT]
lemma flatten_lists: "G \<subseteq> lists B \<Longrightarrow> xs \<in> lists G \<Longrightarrow> concat xs \<in> lists B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>G \<subseteq> lists B; xs \<in> lists G\<rbrakk> \<Longrightarrow> concat xs \<in> lists B
[PROOF STEP]
by (induct xs, simp_all add: subset_iff)


[STATEMENT]
lemma zero_matrix_def_ncols[simp]: "ncols 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ncols 0 = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ncols 0 = 0
[PROOF STEP]
have a:"!! (x::nat). x <= 0 \<Longrightarrow> x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<le> 0 \<Longrightarrow> x = 0
[PROOF STEP]
by (arith)
[PROOF STATE]
proof (state)
this:
?x \<le> 0 \<Longrightarrow> ?x = 0

goal (1 subgoal):
 1. ncols 0 = 0
[PROOF STEP]
show "ncols 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ncols 0 = 0
[PROOF STEP]
by (rule a, subst ncols_le, simp)
[PROOF STATE]
proof (state)
this:
ncols 0 = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma P_nonzero_entry: assumes j: "j < n"
  shows "\<exists> i < n. P $$ (i,j) \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>i<n. P $$ (i, j) \<noteq> 0
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (\<exists>i<n. P $$ (i, j) \<noteq> 0) \<Longrightarrow> False
[PROOF STEP]
assume "\<not> ?thesis"
[PROOF STATE]
proof (state)
this:
\<not> (\<exists>i<n. P $$ (i, j) \<noteq> 0)

goal (1 subgoal):
 1. \<not> (\<exists>i<n. P $$ (i, j) \<noteq> 0) \<Longrightarrow> False
[PROOF STEP]
hence 0: "\<And> i. i < n \<Longrightarrow> P $$ (i,j) = 0"
[PROOF STATE]
proof (prove)
using this:
\<not> (\<exists>i<n. P $$ (i, j) \<noteq> 0)

goal (1 subgoal):
 1. \<And>i. i < n \<Longrightarrow> P $$ (i, j) = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?i < n \<Longrightarrow> P $$ (?i, j) = 0

goal (1 subgoal):
 1. \<not> (\<exists>i<n. P $$ (i, j) \<noteq> 0) \<Longrightarrow> False
[PROOF STEP]
have "1 = (iP * P) $$ (j,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 = (iP * P) $$ (j, j)
[PROOF STEP]
using j
[PROOF STATE]
proof (prove)
using this:
j < n

goal (1 subgoal):
 1. 1 = (iP * P) $$ (j, j)
[PROOF STEP]
unfolding JNF
[PROOF STATE]
proof (prove)
using this:
j < n

goal (1 subgoal):
 1. 1 = 1\<^sub>m n $$ (j, j)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 = (iP * P) $$ (j, j)

goal (1 subgoal):
 1. \<not> (\<exists>i<n. P $$ (i, j) \<noteq> 0) \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 = (iP * P) $$ (j, j)

goal (1 subgoal):
 1. \<not> (\<exists>i<n. P $$ (i, j) \<noteq> 0) \<Longrightarrow> False
[PROOF STEP]
have "\<dots> = (\<Sum>i = 0..<n. iP $$ (j, i) * P $$ (i, j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (iP * P) $$ (j, j) = (\<Sum>i = 0..<n. iP $$ (j, i) * P $$ (i, j))
[PROOF STEP]
using j JNF(1-2)
[PROOF STATE]
proof (prove)
using this:
j < n
P \<in> carrier_mat n n
iP \<in> carrier_mat n n

goal (1 subgoal):
 1. (iP * P) $$ (j, j) = (\<Sum>i = 0..<n. iP $$ (j, i) * P $$ (i, j))
[PROOF STEP]
by (auto simp: scalar_prod_def)
[PROOF STATE]
proof (state)
this:
(iP * P) $$ (j, j) = (\<Sum>i = 0..<n. iP $$ (j, i) * P $$ (i, j))

goal (1 subgoal):
 1. \<not> (\<exists>i<n. P $$ (i, j) \<noteq> 0) \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(iP * P) $$ (j, j) = (\<Sum>i = 0..<n. iP $$ (j, i) * P $$ (i, j))

goal (1 subgoal):
 1. \<not> (\<exists>i<n. P $$ (i, j) \<noteq> 0) \<Longrightarrow> False
[PROOF STEP]
have "\<dots> = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<n. iP $$ (j, i) * P $$ (i, j)) = 0
[PROOF STEP]
by (rule sum.neutral, insert 0, auto)
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<n. iP $$ (j, i) * P $$ (i, j)) = 0

goal (1 subgoal):
 1. \<not> (\<exists>i<n. P $$ (i, j) \<noteq> 0) \<Longrightarrow> False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
1 = 0
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
1 = 0

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma in_refl:"(n::nat)  \<^bold>\<in> Abs_nat_int {n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<^bold>\<in> Abs_nat_int {n}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n \<^bold>\<in> Abs_nat_int {n}
[PROOF STEP]
have "(n::nat) \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<le> n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
n \<le> n

goal (1 subgoal):
 1. n \<^bold>\<in> Abs_nat_int {n}
[PROOF STEP]
hence "{n} \<in> {S . (\<exists> (m::nat) n . m \<le> n \<and> {m..n }=S) \<or> S={} }"
[PROOF STATE]
proof (prove)
using this:
n \<le> n

goal (1 subgoal):
 1. {n} \<in> {S. (\<exists>m n. m \<le> n \<and> {m..n} = S) \<or> S = {}}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{n} \<in> {S. (\<exists>m n. m \<le> n \<and> {m..n} = S) \<or> S = {}}

goal (1 subgoal):
 1. n \<^bold>\<in> Abs_nat_int {n}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{n} \<in> {S. (\<exists>m n. m \<le> n \<and> {m..n} = S) \<or> S = {}}
[PROOF STEP]
show "n \<^bold>\<in> Abs_nat_int {n}"
[PROOF STATE]
proof (prove)
using this:
{n} \<in> {S. (\<exists>m n. m \<le> n \<and> {m..n} = S) \<or> S = {}}

goal (1 subgoal):
 1. n \<^bold>\<in> Abs_nat_int {n}
[PROOF STEP]
by (simp add: Abs_nat_int_inverse el_def)
[PROOF STATE]
proof (state)
this:
n \<^bold>\<in> Abs_nat_int {n}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma map_indets_inverseE:
  assumes "inj f"
  obtains g where "g = the_inv f" and "g \<circ> f = id" and "map_indets g \<circ> map_indets f = id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>g. \<lbrakk>g = the_inv f; g \<circ> f = id; map_indets g \<circ> map_indets f = id\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>g. \<lbrakk>g = the_inv f; g \<circ> f = id; map_indets g \<circ> map_indets f = id\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
define g where "g = the_inv f"
[PROOF STATE]
proof (state)
this:
g = the_inv f

goal (1 subgoal):
 1. (\<And>g. \<lbrakk>g = the_inv f; g \<circ> f = id; map_indets g \<circ> map_indets f = id\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
g = the_inv f

goal (1 subgoal):
 1. (\<And>g. \<lbrakk>g = the_inv f; g \<circ> f = id; map_indets g \<circ> map_indets f = id\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
inj f
[PROOF STEP]
have eq: "g \<circ> f = id"
[PROOF STATE]
proof (prove)
using this:
inj f

goal (1 subgoal):
 1. g \<circ> f = id
[PROOF STEP]
by (auto intro!: ext the_inv_f_f simp: g_def)
[PROOF STATE]
proof (state)
this:
g \<circ> f = id

goal (1 subgoal):
 1. (\<And>g. \<lbrakk>g = the_inv f; g \<circ> f = id; map_indets g \<circ> map_indets f = id\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
g \<circ> f = id

goal (1 subgoal):
 1. (\<And>g. \<lbrakk>g = the_inv f; g \<circ> f = id; map_indets g \<circ> map_indets f = id\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "map_indets g \<circ> map_indets f = id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_indets g \<circ> map_indets f = id
[PROOF STEP]
by (rule ext) (simp add: map_indets_map_indets eq map_indets_id)
[PROOF STATE]
proof (state)
this:
map_indets g \<circ> map_indets f = id

goal (1 subgoal):
 1. (\<And>g. \<lbrakk>g = the_inv f; g \<circ> f = id; map_indets g \<circ> map_indets f = id\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
g = the_inv f
g \<circ> f = id
map_indets g \<circ> map_indets f = id
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
g = the_inv f
g \<circ> f = id
map_indets g \<circ> map_indets f = id

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma frac_add_leD:
  fixes a d :: real
  assumes "0 < d" "d < 1 - frac a" "d < 1 - frac b" "frac (a + d) \<le> frac (b + d)"
  shows "frac a \<le> frac b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frac a \<le> frac b
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. frac a \<le> frac b
[PROOF STEP]
from floor_frac_add_preservation assms
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>0 < ?d; ?d < 1 - frac ?a\<rbrakk> \<Longrightarrow> \<lfloor>?a\<rfloor> = \<lfloor>?a + ?d\<rfloor>
0 < d
d < 1 - frac a
d < 1 - frac b
frac (a + d) \<le> frac (b + d)
[PROOF STEP]
have
    "floor a = floor (a + d)" "floor b = floor (b + d)"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < ?d; ?d < 1 - frac ?a\<rbrakk> \<Longrightarrow> \<lfloor>?a\<rfloor> = \<lfloor>?a + ?d\<rfloor>
0 < d
d < 1 - frac a
d < 1 - frac b
frac (a + d) \<le> frac (b + d)

goal (1 subgoal):
 1. \<lfloor>a\<rfloor> = \<lfloor>a + d\<rfloor> &&& \<lfloor>b\<rfloor> = \<lfloor>b + d\<rfloor>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<lfloor>a\<rfloor> = \<lfloor>a + d\<rfloor>
\<lfloor>b\<rfloor> = \<lfloor>b + d\<rfloor>

goal (1 subgoal):
 1. frac a \<le> frac b
[PROOF STEP]
with assms(4)
[PROOF STATE]
proof (chain)
picking this:
frac (a + d) \<le> frac (b + d)
\<lfloor>a\<rfloor> = \<lfloor>a + d\<rfloor>
\<lfloor>b\<rfloor> = \<lfloor>b + d\<rfloor>
[PROOF STEP]
show "frac a \<le> frac b"
[PROOF STATE]
proof (prove)
using this:
frac (a + d) \<le> frac (b + d)
\<lfloor>a\<rfloor> = \<lfloor>a + d\<rfloor>
\<lfloor>b\<rfloor> = \<lfloor>b + d\<rfloor>

goal (1 subgoal):
 1. frac a \<le> frac b
[PROOF STEP]
unfolding frac_def
[PROOF STATE]
proof (prove)
using this:
a + d - real_of_int \<lfloor>a + d\<rfloor> \<le> b + d - real_of_int \<lfloor>b + d\<rfloor>
\<lfloor>a\<rfloor> = \<lfloor>a + d\<rfloor>
\<lfloor>b\<rfloor> = \<lfloor>b + d\<rfloor>

goal (1 subgoal):
 1. a - real_of_int \<lfloor>a\<rfloor> \<le> b - real_of_int \<lfloor>b\<rfloor>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
frac a \<le> frac b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma jumpF_polyL_smult_1:
  "jumpF_polyL (smult c q) p x = sgn c * jumpF_polyL q p x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_polyL (smult c q) p x = sgn c * jumpF_polyL q p x
[PROOF STEP]
proof (cases "c=0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. c = 0 \<Longrightarrow> jumpF_polyL (smult c q) p x = sgn c * jumpF_polyL q p x
 2. c \<noteq> 0 \<Longrightarrow> jumpF_polyL (smult c q) p x = sgn c * jumpF_polyL q p x
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
c = 0

goal (2 subgoals):
 1. c = 0 \<Longrightarrow> jumpF_polyL (smult c q) p x = sgn c * jumpF_polyL q p x
 2. c \<noteq> 0 \<Longrightarrow> jumpF_polyL (smult c q) p x = sgn c * jumpF_polyL q p x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
c = 0

goal (1 subgoal):
 1. jumpF_polyL (smult c q) p x = sgn c * jumpF_polyL q p x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
jumpF_polyL (smult c q) p x = sgn c * jumpF_polyL q p x

goal (1 subgoal):
 1. c \<noteq> 0 \<Longrightarrow> jumpF_polyL (smult c q) p x = sgn c * jumpF_polyL q p x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. c \<noteq> 0 \<Longrightarrow> jumpF_polyL (smult c q) p x = sgn c * jumpF_polyL q p x
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
c \<noteq> 0

goal (1 subgoal):
 1. c \<noteq> 0 \<Longrightarrow> jumpF_polyL (smult c q) p x = sgn c * jumpF_polyL q p x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c \<noteq> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
c \<noteq> 0

goal (1 subgoal):
 1. jumpF_polyL (smult c q) p x = sgn c * jumpF_polyL q p x
[PROOF STEP]
unfolding jumpF_polyL_def
[PROOF STATE]
proof (prove)
using this:
c \<noteq> 0

goal (1 subgoal):
 1. jumpF (\<lambda>x. poly (smult c q) x / poly p x) (at_left x) = sgn c * jumpF (\<lambda>x. poly q x / poly p x) (at_left x)
[PROOF STEP]
apply (subst jumpF_times[of "\<lambda>_. c",symmetric])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. c \<noteq> 0 \<Longrightarrow> ((\<lambda>_. c) \<longlongrightarrow> c) (at_left x)
 2. c \<noteq> 0 \<Longrightarrow> c \<noteq> 0
 3. c \<noteq> 0 \<Longrightarrow> at_left x \<noteq> bot
 4. c \<noteq> 0 \<Longrightarrow> jumpF (\<lambda>x. poly (smult c q) x / poly p x) (at_left x) = jumpF (\<lambda>x. c * (poly q x / poly p x)) (at_left x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
jumpF_polyL (smult c q) p x = sgn c * jumpF_polyL q p x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Sup_image_mono_le:
  fixes le_b (infix "\<sqsubseteq>" 60) and Sup_b ("\<Or>")
  assumes ccpo: "class.ccpo Sup_b (\<sqsubseteq>) lt_b"
  assumes chain: "Complete_Partial_Order.chain (\<sqsubseteq>) Y"
  and mono: "\<And>x y. \<lbrakk> x \<sqsubseteq> y; x \<in> Y \<rbrakk> \<Longrightarrow> f x \<le> f y"
  shows "Sup (f ` Y) \<le> f (\<Or>Y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Squnion> (f ` Y) \<le> f (\<Or> Y)
[PROOF STEP]
proof(rule ccpo_Sup_least)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Complete_Partial_Order.chain (\<le>) (f ` Y)
 2. \<And>x. x \<in> f ` Y \<Longrightarrow> x \<le> f (\<Or> Y)
[PROOF STEP]
show "Complete_Partial_Order.chain (\<le>) (f ` Y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complete_Partial_Order.chain (\<le>) (f ` Y)
[PROOF STEP]
using chain
[PROOF STATE]
proof (prove)
using this:
Complete_Partial_Order.chain (\<sqsubseteq>) Y

goal (1 subgoal):
 1. Complete_Partial_Order.chain (\<le>) (f ` Y)
[PROOF STEP]
by(rule chain_imageI)(rule mono)
[PROOF STATE]
proof (state)
this:
Complete_Partial_Order.chain (\<le>) (f ` Y)

goal (1 subgoal):
 1. \<And>x. x \<in> f ` Y \<Longrightarrow> x \<le> f (\<Or> Y)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> f ` Y \<Longrightarrow> x \<le> f (\<Or> Y)
[PROOF STEP]
assume "x \<in> f ` Y"
[PROOF STATE]
proof (state)
this:
x \<in> f ` Y

goal (1 subgoal):
 1. \<And>x. x \<in> f ` Y \<Longrightarrow> x \<le> f (\<Or> Y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> f ` Y
[PROOF STEP]
obtain y where "y \<in> Y" and "x = f y"
[PROOF STATE]
proof (prove)
using this:
x \<in> f ` Y

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

goal (1 subgoal):
 1. \<And>x. x \<in> f ` Y \<Longrightarrow> x \<le> f (\<Or> Y)
[PROOF STEP]
note this(2)
[PROOF STATE]
proof (state)
this:
x = f y

goal (1 subgoal):
 1. \<And>x. x \<in> f ` Y \<Longrightarrow> x \<le> f (\<Or> Y)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x = f y

goal (1 subgoal):
 1. \<And>x. x \<in> f ` Y \<Longrightarrow> x \<le> f (\<Or> Y)
[PROOF STEP]
have "y \<sqsubseteq> \<Or>Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<sqsubseteq> \<Or> Y
[PROOF STEP]
using ccpo chain \<open>y \<in> Y\<close>
[PROOF STATE]
proof (prove)
using this:
class.ccpo \<Or> (\<sqsubseteq>) lt_b
Complete_Partial_Order.chain (\<sqsubseteq>) Y
y \<in> Y

goal (1 subgoal):
 1. y \<sqsubseteq> \<Or> Y
[PROOF STEP]
by(rule ccpo.ccpo_Sup_upper)
[PROOF STATE]
proof (state)
this:
y \<sqsubseteq> \<Or> Y

goal (1 subgoal):
 1. \<And>x. x \<in> f ` Y \<Longrightarrow> x \<le> f (\<Or> Y)
[PROOF STEP]
hence "f y \<le> f (\<Or>Y)"
[PROOF STATE]
proof (prove)
using this:
y \<sqsubseteq> \<Or> Y

goal (1 subgoal):
 1. f y \<le> f (\<Or> Y)
[PROOF STEP]
using \<open>y \<in> Y\<close>
[PROOF STATE]
proof (prove)
using this:
y \<sqsubseteq> \<Or> Y
y \<in> Y

goal (1 subgoal):
 1. f y \<le> f (\<Or> Y)
[PROOF STEP]
by(rule mono)
[PROOF STATE]
proof (state)
this:
f y \<le> f (\<Or> Y)

goal (1 subgoal):
 1. \<And>x. x \<in> f ` Y \<Longrightarrow> x \<le> f (\<Or> Y)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x \<le> f (\<Or> Y)
[PROOF STEP]
show "x \<le> \<dots>"
[PROOF STATE]
proof (prove)
using this:
x \<le> f (\<Or> Y)

goal (1 subgoal):
 1. x \<le> f (\<Or> Y)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
x \<le> f (\<Or> Y)

goal:
No subgoals!
[PROOF STEP]
qed