[STATEMENT]
theorem Lambert_W'_asymp_equiv_at_right_minus_exp_minus1:
  defines "e \<equiv> exp 1"
  defines "a \<equiv> -exp (-1)"
  defines "C1 \<equiv> sqrt (2 * exp 1)"
  defines "f \<equiv> (\<lambda>x. -1 - C1 * sqrt (x - a))"
  shows   "(\<lambda>x. Lambert_W' x - f x) \<sim>[at_right a] (\<lambda>x. -2/3 * e * (x - a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. Lambert_W' x - f x) \<sim>[at_right a] (\<lambda>x. - 2 / 3 * e * (x - a))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. Lambert_W' x - f x) \<sim>[at_right a] (\<lambda>x. - 2 / 3 * e * (x - a))
[PROOF STEP]
define C :: "real \<Rightarrow> real" where "C = (\<lambda>c. -sqrt (2/e)/3 * (2*e+3*c))"
[PROOF STATE]
proof (state)
this:
C = (\<lambda>c. - sqrt (2 / e) / 3 * (2 * e + 3 * c))

goal (1 subgoal):
 1. (\<lambda>x. Lambert_W' x - f x) \<sim>[at_right a] (\<lambda>x. - 2 / 3 * e * (x - a))
[PROOF STEP]
have asymp_equiv: "(\<lambda>x. (f x + c * (x - a)) * exp (f x + c * (x - a)) - x)
                       \<sim>[at_right a] (\<lambda>x. C c * (x - a) powr (3/2))" if "c \<noteq> -2/3 * e" for c
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. (f x + c * (x - a)) * exp (f x + c * (x - a)) - x) \<sim>[at_right a] (\<lambda>x. C c * (x - a) powr (3 / 2))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. (f x + c * (x - a)) * exp (f x + c * (x - a)) - x) \<sim>[at_right a] (\<lambda>x. C c * (x - a) powr (3 / 2))
[PROOF STEP]
from that
[PROOF STATE]
proof (chain)
picking this:
c \<noteq> - 2 / 3 * e
[PROOF STEP]
have "C c \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
c \<noteq> - 2 / 3 * e

goal (1 subgoal):
 1. C c \<noteq> 0
[PROOF STEP]
by (auto simp: C_def e_def)
[PROOF STATE]
proof (state)
this:
C c \<noteq> 0

goal (1 subgoal):
 1. (\<lambda>x. (f x + c * (x - a)) * exp (f x + c * (x - a)) - x) \<sim>[at_right a] (\<lambda>x. C c * (x - a) powr (3 / 2))
[PROOF STEP]
have "(\<lambda>x. (f x + c * (x - a)) * exp (f x + c * (x - a)) - x - C c * (x - a) powr (3/2))
            \<in> o[at_right a](\<lambda>x. (x - a) powr (3/2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. (f x + c * (x - a)) * exp (f x + c * (x - a)) - x - C c * (x - a) powr (3 / 2)) \<in> o[at_right a](\<lambda>x. (x - a) powr (3 / 2))
[PROOF STEP]
unfolding f_def a_def C_def C1_def e_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. (- 1 - sqrt (2 * exp 1) * sqrt (x - - exp (- 1)) + c * (x - - exp (- 1))) * exp (- 1 - sqrt (2 * exp 1) * sqrt (x - - exp (- 1)) + c * (x - - exp (- 1))) - x - - sqrt (2 / exp 1) / 3 * (2 * exp 1 + 3 * c) * (x - - exp (- 1)) powr (3 / 2)) \<in> o[at_right (- exp (- 1))](\<lambda>x. (x - - exp (- 1)) powr (3 / 2))
[PROOF STEP]
by (real_asymp simp: field_simps real_sqrt_mult real_sqrt_divide sqrt_sqrt_mult
                           exp_minus simp flip: sqrt_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (f x + c * (x - a)) * exp (f x + c * (x - a)) - x - C c * (x - a) powr (3 / 2)) \<in> o[at_right a](\<lambda>x. (x - a) powr (3 / 2))

goal (1 subgoal):
 1. (\<lambda>x. (f x + c * (x - a)) * exp (f x + c * (x - a)) - x) \<sim>[at_right a] (\<lambda>x. C c * (x - a) powr (3 / 2))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. (f x + c * (x - a)) * exp (f x + c * (x - a)) - x - C c * (x - a) powr (3 / 2)) \<in> o[at_right a](\<lambda>x. (x - a) powr (3 / 2))

goal (1 subgoal):
 1. (\<lambda>x. (f x + c * (x - a)) * exp (f x + c * (x - a)) - x) \<sim>[at_right a] (\<lambda>x. C c * (x - a) powr (3 / 2))
[PROOF STEP]
using \<open>C c \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. (f x + c * (x - a)) * exp (f x + c * (x - a)) - x - C c * (x - a) powr (3 / 2)) \<in> o[at_right a](\<lambda>x. (x - a) powr (3 / 2))
C c \<noteq> 0

goal (1 subgoal):
 1. (\<lambda>x. (f x + c * (x - a)) * exp (f x + c * (x - a)) - x) \<sim>[at_right a] (\<lambda>x. C c * (x - a) powr (3 / 2))
[PROOF STEP]
by (intro smallo_imp_asymp_equiv) auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (f x + c * (x - a)) * exp (f x + c * (x - a)) - x) \<sim>[at_right a] (\<lambda>x. C c * (x - a) powr (3 / 2))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?c \<noteq> - 2 / 3 * e \<Longrightarrow> (\<lambda>x. (f x + ?c * (x - a)) * exp (f x + ?c * (x - a)) - x) \<sim>[at_right a] (\<lambda>x. C ?c * (x - a) powr (3 / 2))

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

goal (5 subgoals):
 1. \<And>c'. c' \<in> {?l<..<- 2 / 3 * e} \<Longrightarrow> \<forall>\<^sub>F x in at_right a. c' * (x - a) \<le> Lambert_W' x - f x
 2. \<And>c'. c' \<in> {- 2 / 3 * e<..<?u} \<Longrightarrow> \<forall>\<^sub>F x in at_right a. Lambert_W' x - f x \<le> c' * (x - a)
 3. ?l < - 2 / 3 * e
 4. - 2 / 3 * e < ?u
 5. - 2 / 3 * e \<noteq> 0
[PROOF STEP]
hence neq: "c' \<noteq> -2/3 * e"
[PROOF STATE]
proof (prove)
using this:
c' \<in> {- e<..<- 2 / 3 * e}

goal (1 subgoal):
 1. c' \<noteq> - 2 / 3 * e
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c' \<noteq> - 2 / 3 * e

goal (5 subgoals):
 1. \<And>c'. c' \<in> {?l<..<- 2 / 3 * e} \<Longrightarrow> \<forall>\<^sub>F x in at_right a. c' * (x - a) \<le> Lambert_W' x - f x
 2. \<And>c'. c' \<in> {- 2 / 3 * e<..<?u} \<Longrightarrow> \<forall>\<^sub>F x in at_right a. Lambert_W' x - f x \<le> c' * (x - a)
 3. ?l < - 2 / 3 * e
 4. - 2 / 3 * e < ?u
 5. - 2 / 3 * e \<noteq> 0
[PROOF STEP]
from c'
[PROOF STATE]
proof (chain)
picking this:
c' \<in> {- e<..<- 2 / 3 * e}
[PROOF STEP]
have pos: "C c' > 0"
[PROOF STATE]
proof (prove)
using this:
c' \<in> {- e<..<- 2 / 3 * e}

goal (1 subgoal):
 1. 0 < C c'
[PROOF STEP]
unfolding C_def
[PROOF STATE]
proof (prove)
using this:
c' \<in> {- e<..<- 2 / 3 * e}

goal (1 subgoal):
 1. 0 < - sqrt (2 / e) / 3 * (2 * e + 3 * c')
[PROOF STEP]
by (auto intro!: mult_pos_neg)
[PROOF STATE]
proof (state)
this:
0 < C c'

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

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_right a. 0 < C c' * (x - a) powr (3 / 2)
[PROOF STEP]
by real_asymp
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_right a. 0 < C c' * (x - a) powr (3 / 2)

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

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_right a. 0 < (f x + c' * (x - a)) * exp (f x + c' * (x - a)) - x
[PROOF STEP]
using asymp_equiv_eventually_pos_iff[OF asymp_equiv[OF neq]]
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_right a. 0 < C c' * (x - a) powr (3 / 2)
\<forall>\<^sub>F x in at_right a. (0 < (f x + c' * (x - a)) * exp (f x + c' * (x - a)) - x) = (0 < C c' * (x - a) powr (3 / 2))

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_right a. 0 < (f x + c' * (x - a)) * exp (f x + c' * (x - a)) - x
[PROOF STEP]
by eventually_elim (use pos in auto)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_right a. 0 < (f x + c' * (x - a)) * exp (f x + c' * (x - a)) - x

goal (5 subgoals):
 1. \<And>c'. c' \<in> {?l<..<- 2 / 3 * e} \<Longrightarrow> \<forall>\<^sub>F x in at_right a. c' * (x - a) \<le> Lambert_W' x - f x
 2. \<And>c'. c' \<in> {- 2 / 3 * e<..<?u} \<Longrightarrow> \<forall>\<^sub>F x in at_right a. Lambert_W' x - f x \<le> c' * (x - a)
 3. ?l < - 2 / 3 * e
 4. - 2 / 3 * e < ?u
 5. - 2 / 3 * e \<noteq> 0
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_right a. 0 < (f x + c' * (x - a)) * exp (f x + c' * (x - a)) - x

goal (5 subgoals):
 1. \<And>c'. c' \<in> {?l<..<- 2 / 3 * e} \<Longrightarrow> \<forall>\<^sub>F x in at_right a. c' * (x - a) \<le> Lambert_W' x - f x
 2. \<And>c'. c' \<in> {- 2 / 3 * e<..<?u} \<Longrightarrow> \<forall>\<^sub>F x in at_right a. Lambert_W' x - f x \<le> c' * (x - a)
 3. ?l < - 2 / 3 * e
 4. - 2 / 3 * e < ?u
 5. - 2 / 3 * e \<noteq> 0
[PROOF STEP]
have "eventually (\<lambda>x. x > a) (at_right a)"
                  "eventually (\<lambda>x. f x + c' * (x - a) \<le> -1) (at_right a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eventually ((<) a) (at_right a) &&& \<forall>\<^sub>F x in at_right a. f x + c' * (x - a) \<le> - 1
[PROOF STEP]
unfolding a_def f_def C1_def c'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eventually ((<) (- exp (- 1))) (at_right (- exp (- 1))) &&& \<forall>\<^sub>F x in at_right (- exp (- 1)). - 1 - sqrt (2 * exp 1) * sqrt (x - - exp (- 1)) + c' * (x - - exp (- 1)) \<le> - 1
[PROOF STEP]
by real_asymp+
[PROOF STATE]
proof (state)
this:
eventually ((<) a) (at_right a)
\<forall>\<^sub>F x in at_right a. f x + c' * (x - a) \<le> - 1

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

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

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

goal (1 subgoal):
 1. f x + c' * (x - a) \<le> Lambert_W' x
[PROOF STEP]
by (intro Lambert_W'_geI) (auto simp: a_def)
[PROOF STATE]
proof (state)
this:
f x + c' * (x - a) \<le> Lambert_W' x

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

goal (1 subgoal):
 1. c' * (x - a) \<le> Lambert_W' x - f x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
c' * (x - a) \<le> Lambert_W' x - f x

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

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

goal (4 subgoals):
 1. \<And>c'. c' \<in> {- 2 / 3 * e<..<?u} \<Longrightarrow> \<forall>\<^sub>F x in at_right a. Lambert_W' x - f x \<le> c' * (x - a)
 2. - e < - 2 / 3 * e
 3. - 2 / 3 * e < ?u
 4. - 2 / 3 * e \<noteq> 0
[PROOF STEP]
hence neq: "c' \<noteq> -2/3 * e"
[PROOF STATE]
proof (prove)
using this:
c' \<in> {- 2 / 3 * e<..<0}

goal (1 subgoal):
 1. c' \<noteq> - 2 / 3 * e
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c' \<noteq> - 2 / 3 * e

goal (4 subgoals):
 1. \<And>c'. c' \<in> {- 2 / 3 * e<..<?u} \<Longrightarrow> \<forall>\<^sub>F x in at_right a. Lambert_W' x - f x \<le> c' * (x - a)
 2. - e < - 2 / 3 * e
 3. - 2 / 3 * e < ?u
 4. - 2 / 3 * e \<noteq> 0
[PROOF STEP]
from c'
[PROOF STATE]
proof (chain)
picking this:
c' \<in> {- 2 / 3 * e<..<0}
[PROOF STEP]
have neg: "C c' < 0"
[PROOF STATE]
proof (prove)
using this:
c' \<in> {- 2 / 3 * e<..<0}

goal (1 subgoal):
 1. C c' < 0
[PROOF STEP]
unfolding C_def
[PROOF STATE]
proof (prove)
using this:
c' \<in> {- 2 / 3 * e<..<0}

goal (1 subgoal):
 1. - sqrt (2 / e) / 3 * (2 * e + 3 * c') < 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
C c' < 0

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

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_right a. C c' * (x - a) powr (3 / 2) < 0
[PROOF STEP]
by real_asymp
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_right a. C c' * (x - a) powr (3 / 2) < 0

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

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_right a. (f x + c' * (x - a)) * exp (f x + c' * (x - a)) - x < 0
[PROOF STEP]
using asymp_equiv_eventually_neg_iff[OF asymp_equiv[OF neq]]
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_right a. C c' * (x - a) powr (3 / 2) < 0
\<forall>\<^sub>F x in at_right a. ((f x + c' * (x - a)) * exp (f x + c' * (x - a)) - x < 0) = (C c' * (x - a) powr (3 / 2) < 0)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_right a. (f x + c' * (x - a)) * exp (f x + c' * (x - a)) - x < 0
[PROOF STEP]
by eventually_elim (use neg in auto)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_right a. (f x + c' * (x - a)) * exp (f x + c' * (x - a)) - x < 0

goal (4 subgoals):
 1. \<And>c'. c' \<in> {- 2 / 3 * e<..<?u} \<Longrightarrow> \<forall>\<^sub>F x in at_right a. Lambert_W' x - f x \<le> c' * (x - a)
 2. - e < - 2 / 3 * e
 3. - 2 / 3 * e < ?u
 4. - 2 / 3 * e \<noteq> 0
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_right a. (f x + c' * (x - a)) * exp (f x + c' * (x - a)) - x < 0

goal (4 subgoals):
 1. \<And>c'. c' \<in> {- 2 / 3 * e<..<?u} \<Longrightarrow> \<forall>\<^sub>F x in at_right a. Lambert_W' x - f x \<le> c' * (x - a)
 2. - e < - 2 / 3 * e
 3. - 2 / 3 * e < ?u
 4. - 2 / 3 * e \<noteq> 0
[PROOF STEP]
have "eventually (\<lambda>x. x < 0) (at_right a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_right a. x < 0
[PROOF STEP]
unfolding a_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_right (- exp (- 1)). x < 0
[PROOF STEP]
by real_asymp
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_right a. x < 0

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

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

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

goal (1 subgoal):
 1. Lambert_W' x \<le> f x + c' * (x - a)
[PROOF STEP]
by (intro Lambert_W'_leI) auto
[PROOF STATE]
proof (state)
this:
Lambert_W' x \<le> f x + c' * (x - a)

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

goal (1 subgoal):
 1. Lambert_W' x - f x \<le> c' * (x - a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Lambert_W' x - f x \<le> c' * (x - a)

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

goal (3 subgoals):
 1. - e < - 2 / 3 * e
 2. - 2 / 3 * e < 0
 3. - 2 / 3 * e \<noteq> 0
[PROOF STEP]
qed (auto simp: e_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. Lambert_W' x - f x) \<sim>[at_right a] (\<lambda>x. - 2 / 3 * e * (x - a))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma singular_subdivision_add:
   "singular_subdivision p (a + b) = singular_subdivision p a + singular_subdivision p b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. singular_subdivision p (a + b) = singular_subdivision p a + singular_subdivision p b
[PROOF STEP]
by (simp add: singular_subdivision_def frag_extend_add)


[STATEMENT]
theorem hyp2_not_tarski: "\<not> (tarski real_hyp2_C real_hyp2_B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> tarski real_hyp2_C real_hyp2_B
[PROOF STEP]
using hyp2_axiom10_false
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>a b c d t. B\<^sub>K a d t \<and> B\<^sub>K b d c \<and> a \<noteq> d \<longrightarrow> (\<exists>x y. B\<^sub>K a b x \<and> B\<^sub>K a c y \<and> B\<^sub>K x t y))

goal (1 subgoal):
 1. \<not> tarski real_hyp2_C real_hyp2_B
[PROOF STEP]
by (unfold tarski_def tarski_space_def tarski_space_axioms_def) simp


[STATEMENT]
lemma (in Module) l_comb_jointfun_jf1:"\<lbrakk>H \<subseteq> carrier M; ideal R A;
        s \<in> {j. j \<le> (n::nat)} \<rightarrow> A; f \<in> {j. j \<le> Suc (n + m)} \<rightarrow> H;
        t \<in> {j. j \<le> (m::nat)} \<rightarrow> A\<rbrakk> \<Longrightarrow>
        l_comb R M n (jointfun n s m t) f = l_comb R M n s f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>H \<subseteq> carrier M; ideal R A; s \<in> {j. j \<le> n} \<rightarrow> A; f \<in> {j. j \<le> Suc (n + m)} \<rightarrow> H; t \<in> {j. j \<le> m} \<rightarrow> A\<rbrakk> \<Longrightarrow> l_comb R M n (jointfun n s m t) f = l_comb R M n s f
[PROOF STEP]
by (simp add:l_comb_def l_comb_jointfun_jf)


[STATEMENT]
lemma power_numeral_reduce: "a ^ numeral n = a * a ^ pred_numeral n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a ^ numeral n = a * a ^ pred_numeral n
[PROOF STEP]
by (simp only: numeral_eq_Suc power_Suc)


[STATEMENT]
lemma mult_gcd_left: "c * gcd a b = unit_factor c * gcd (c * a) (c * b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c * gcd a b = unit_factor c * gcd (c * a) (c * b)
[PROOF STEP]
by (simp add: gcd_mult_left normalize_mult mult.assoc [symmetric])


[STATEMENT]
lemma i: "i < n" and P_ij0: "P $$ (i, j - (m - 1)) \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < n &&& P $$ (i, j - (m - 1)) \<noteq> 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. i < n
 2. P $$ (i, j - (m - 1)) \<noteq> 0
[PROOF STEP]
from j_n
[PROOF STATE]
proof (chain)
picking this:
j < n
[PROOF STEP]
have lt: "j - (m - 1) < n"
[PROOF STATE]
proof (prove)
using this:
j < n

goal (1 subgoal):
 1. j - (m - 1) < n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
j - (m - 1) < n

goal (2 subgoals):
 1. i < n
 2. P $$ (i, j - (m - 1)) \<noteq> 0
[PROOF STEP]
show "i < n" "P $$ (i, j - (m - 1)) \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < n &&& P $$ (i, j - (m - 1)) \<noteq> 0
[PROOF STEP]
unfolding i_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SOME i. i < n \<and> P $$ (i, j - (m - 1)) \<noteq> 0) < n &&& P $$ (SOME i. i < n \<and> P $$ (i, j - (m - 1)) \<noteq> 0, j - (m - 1)) \<noteq> 0
[PROOF STEP]
using someI_ex[OF P_nonzero_entry[OF lt]]
[PROOF STATE]
proof (prove)
using this:
(SOME x. x < n \<and> P $$ (x, j - (m - 1)) \<noteq> 0) < n \<and> P $$ (SOME x. x < n \<and> P $$ (x, j - (m - 1)) \<noteq> 0, j - (m - 1)) \<noteq> 0

goal (1 subgoal):
 1. (SOME i. i < n \<and> P $$ (i, j - (m - 1)) \<noteq> 0) < n &&& P $$ (SOME i. i < n \<and> P $$ (i, j - (m - 1)) \<noteq> 0, j - (m - 1)) \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i < n
P $$ (i, j - (m - 1)) \<noteq> 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma gauge_reflect:
  fixes \<gamma> :: "'a::euclidean_space \<Rightarrow> 'a set"
  shows "gauge \<gamma> \<Longrightarrow> gauge (\<lambda>x. uminus ` \<gamma> (- x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gauge \<gamma> \<Longrightarrow> gauge (\<lambda>x. uminus ` \<gamma> (- x))
[PROOF STEP]
using equation_minus_iff
[PROOF STATE]
proof (prove)
using this:
(?a = - ?b) = (?b = - ?a)

goal (1 subgoal):
 1. gauge \<gamma> \<Longrightarrow> gauge (\<lambda>x. uminus ` \<gamma> (- x))
[PROOF STEP]
by (auto simp: gauge_def surj_def intro!: open_surjective_linear_image linear_uminus)


[STATEMENT]
lemma simple_bochner_integral_add:
  assumes f: "simple_bochner_integrable M f" and g: "simple_bochner_integrable M g"
  shows "simple_bochner_integral M (\<lambda>x. f x + g x) =
    simple_bochner_integral M f + simple_bochner_integral M g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. simple_bochner_integral M (\<lambda>x. f x + g x) = simple_bochner_integral M f + simple_bochner_integral M g
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. simple_bochner_integral M (\<lambda>x. f x + g x) = simple_bochner_integral M f + simple_bochner_integral M g
[PROOF STEP]
from f g
[PROOF STATE]
proof (chain)
picking this:
simple_bochner_integrable M f
simple_bochner_integrable M g
[PROOF STEP]
have "simple_bochner_integral M (\<lambda>x. f x + g x) =
    (\<Sum>y\<in>(\<lambda>x. (f x, g x)) ` space M. measure M {x \<in> space M. (f x, g x) = y} *\<^sub>R (fst y + snd y))"
[PROOF STATE]
proof (prove)
using this:
simple_bochner_integrable M f
simple_bochner_integrable M g

goal (1 subgoal):
 1. simple_bochner_integral M (\<lambda>x. f x + g x) = (\<Sum>y\<in>(\<lambda>x. (f x, g x)) ` space M. Sigma_Algebra.measure M {x \<in> space M. (f x, g x) = y} *\<^sub>R (fst y + snd y))
[PROOF STEP]
by (intro simple_bochner_integral_partition)
       (auto simp: simple_bochner_integrable_compose2 elim: simple_bochner_integrable.cases)
[PROOF STATE]
proof (state)
this:
simple_bochner_integral M (\<lambda>x. f x + g x) = (\<Sum>y\<in>(\<lambda>x. (f x, g x)) ` space M. Sigma_Algebra.measure M {x \<in> space M. (f x, g x) = y} *\<^sub>R (fst y + snd y))

goal (1 subgoal):
 1. simple_bochner_integral M (\<lambda>x. f x + g x) = simple_bochner_integral M f + simple_bochner_integral M g
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
simple_bochner_integral M (\<lambda>x. f x + g x) = (\<Sum>y\<in>(\<lambda>x. (f x, g x)) ` space M. Sigma_Algebra.measure M {x \<in> space M. (f x, g x) = y} *\<^sub>R (fst y + snd y))

goal (1 subgoal):
 1. simple_bochner_integral M (\<lambda>x. f x + g x) = simple_bochner_integral M f + simple_bochner_integral M g
[PROOF STEP]
from f g
[PROOF STATE]
proof (chain)
picking this:
simple_bochner_integrable M f
simple_bochner_integrable M g
[PROOF STEP]
have "simple_bochner_integral M f =
    (\<Sum>y\<in>(\<lambda>x. (f x, g x)) ` space M. measure M {x \<in> space M. (f x, g x) = y} *\<^sub>R fst y)"
[PROOF STATE]
proof (prove)
using this:
simple_bochner_integrable M f
simple_bochner_integrable M g

goal (1 subgoal):
 1. simple_bochner_integral M f = (\<Sum>y\<in>(\<lambda>x. (f x, g x)) ` space M. Sigma_Algebra.measure M {x \<in> space M. (f x, g x) = y} *\<^sub>R fst y)
[PROOF STEP]
by (intro simple_bochner_integral_partition)
       (auto simp: simple_bochner_integrable_compose2 elim: simple_bochner_integrable.cases)
[PROOF STATE]
proof (state)
this:
simple_bochner_integral M f = (\<Sum>y\<in>(\<lambda>x. (f x, g x)) ` space M. Sigma_Algebra.measure M {x \<in> space M. (f x, g x) = y} *\<^sub>R fst y)

goal (1 subgoal):
 1. simple_bochner_integral M (\<lambda>x. f x + g x) = simple_bochner_integral M f + simple_bochner_integral M g
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
simple_bochner_integral M f = (\<Sum>y\<in>(\<lambda>x. (f x, g x)) ` space M. Sigma_Algebra.measure M {x \<in> space M. (f x, g x) = y} *\<^sub>R fst y)

goal (1 subgoal):
 1. simple_bochner_integral M (\<lambda>x. f x + g x) = simple_bochner_integral M f + simple_bochner_integral M g
[PROOF STEP]
from f g
[PROOF STATE]
proof (chain)
picking this:
simple_bochner_integrable M f
simple_bochner_integrable M g
[PROOF STEP]
have "simple_bochner_integral M g =
    (\<Sum>y\<in>(\<lambda>x. (f x, g x)) ` space M. measure M {x \<in> space M. (f x, g x) = y} *\<^sub>R snd y)"
[PROOF STATE]
proof (prove)
using this:
simple_bochner_integrable M f
simple_bochner_integrable M g

goal (1 subgoal):
 1. simple_bochner_integral M g = (\<Sum>y\<in>(\<lambda>x. (f x, g x)) ` space M. Sigma_Algebra.measure M {x \<in> space M. (f x, g x) = y} *\<^sub>R snd y)
[PROOF STEP]
by (intro simple_bochner_integral_partition)
       (auto simp: simple_bochner_integrable_compose2 elim: simple_bochner_integrable.cases)
[PROOF STATE]
proof (state)
this:
simple_bochner_integral M g = (\<Sum>y\<in>(\<lambda>x. (f x, g x)) ` space M. Sigma_Algebra.measure M {x \<in> space M. (f x, g x) = y} *\<^sub>R snd y)

goal (1 subgoal):
 1. simple_bochner_integral M (\<lambda>x. f x + g x) = simple_bochner_integral M f + simple_bochner_integral M g
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
simple_bochner_integral M (\<lambda>x. f x + g x) = (\<Sum>y\<in>(\<lambda>x. (f x, g x)) ` space M. Sigma_Algebra.measure M {x \<in> space M. (f x, g x) = y} *\<^sub>R (fst y + snd y))
simple_bochner_integral M f = (\<Sum>y\<in>(\<lambda>x. (f x, g x)) ` space M. Sigma_Algebra.measure M {x \<in> space M. (f x, g x) = y} *\<^sub>R fst y)
simple_bochner_integral M g = (\<Sum>y\<in>(\<lambda>x. (f x, g x)) ` space M. Sigma_Algebra.measure M {x \<in> space M. (f x, g x) = y} *\<^sub>R snd y)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
simple_bochner_integral M (\<lambda>x. f x + g x) = (\<Sum>y\<in>(\<lambda>x. (f x, g x)) ` space M. Sigma_Algebra.measure M {x \<in> space M. (f x, g x) = y} *\<^sub>R (fst y + snd y))
simple_bochner_integral M f = (\<Sum>y\<in>(\<lambda>x. (f x, g x)) ` space M. Sigma_Algebra.measure M {x \<in> space M. (f x, g x) = y} *\<^sub>R fst y)
simple_bochner_integral M g = (\<Sum>y\<in>(\<lambda>x. (f x, g x)) ` space M. Sigma_Algebra.measure M {x \<in> space M. (f x, g x) = y} *\<^sub>R snd y)

goal (1 subgoal):
 1. simple_bochner_integral M (\<lambda>x. f x + g x) = simple_bochner_integral M f + simple_bochner_integral M g
[PROOF STEP]
by (simp add: sum.distrib[symmetric] scaleR_add_right)
[PROOF STATE]
proof (state)
this:
simple_bochner_integral M (\<lambda>x. f x + g x) = simple_bochner_integral M f + simple_bochner_integral M g

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma zero_le_Log_cancel_iff[simp]:
  "1 < a \<Longrightarrow> 0 < x \<Longrightarrow> 0 \<le> Log a x \<longleftrightarrow> 1 \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>1 < a; 0 < x\<rbrakk> \<Longrightarrow> (0 \<le> Log a x) = (1 \<le> x)
[PROOF STEP]
using Log_le_cancel_iff[of a 1 x]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>1 < a; 0 < 1; 0 < x\<rbrakk> \<Longrightarrow> (Log a 1 \<le> Log a x) = (1 \<le> x)

goal (1 subgoal):
 1. \<lbrakk>1 < a; 0 < x\<rbrakk> \<Longrightarrow> (0 \<le> Log a x) = (1 \<le> x)
[PROOF STEP]
by simp


[STATEMENT]
lemma restrict_singleton_product:
  fixes f g :: "('a::finite,'b::kleene_algebra) square"
  shows "([k]\<langle>f\<rangle>[l] \<odot> [m]\<langle>g\<rangle>[n]) (i,j) = (if i = k \<and> l = m \<and> j = n then f (i,l) * g (m,j) else bot)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ([k] \<langle>f\<rangle> [l] \<odot> [m] \<langle>g\<rangle> [n]) (i, j) = (if i = k \<and> l = m \<and> j = n then f (i, l) * g (m, j) else bot)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ([k] \<langle>f\<rangle> [l] \<odot> [m] \<langle>g\<rangle> [n]) (i, j) = (if i = k \<and> l = m \<and> j = n then f (i, l) * g (m, j) else bot)
[PROOF STEP]
have "([k]\<langle>f\<rangle>[l] \<odot> [m]\<langle>g\<rangle>[n]) (i,j) = (\<Squnion>\<^sub>h ([k]\<langle>f\<rangle>[l]) (i,h) * ([m]\<langle>g\<rangle>[n]) (h,j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ([k] \<langle>f\<rangle> [l] \<odot> [m] \<langle>g\<rangle> [n]) (i, j) = sup_monoid.sum (\<lambda>h. ([k] \<langle>f\<rangle> [l]) (i, h) * ([m] \<langle>g\<rangle> [n]) (h, j)) {h. True}
[PROOF STEP]
by (simp add: times_matrix_def)
[PROOF STATE]
proof (state)
this:
([k] \<langle>f\<rangle> [l] \<odot> [m] \<langle>g\<rangle> [n]) (i, j) = sup_monoid.sum (\<lambda>h. ([k] \<langle>f\<rangle> [l]) (i, h) * ([m] \<langle>g\<rangle> [n]) (h, j)) {h. True}

goal (1 subgoal):
 1. ([k] \<langle>f\<rangle> [l] \<odot> [m] \<langle>g\<rangle> [n]) (i, j) = (if i = k \<and> l = m \<and> j = n then f (i, l) * g (m, j) else bot)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
([k] \<langle>f\<rangle> [l] \<odot> [m] \<langle>g\<rangle> [n]) (i, j) = sup_monoid.sum (\<lambda>h. ([k] \<langle>f\<rangle> [l]) (i, h) * ([m] \<langle>g\<rangle> [n]) (h, j)) {h. True}

goal (1 subgoal):
 1. ([k] \<langle>f\<rangle> [l] \<odot> [m] \<langle>g\<rangle> [n]) (i, j) = (if i = k \<and> l = m \<and> j = n then f (i, l) * g (m, j) else bot)
[PROOF STEP]
have "... = (\<Squnion>\<^sub>h (if i = k \<and> h = l then f (i,h) else bot) * (if h = m \<and> j = n then g (h,j) else bot))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sup_monoid.sum (\<lambda>h. ([k] \<langle>f\<rangle> [l]) (i, h) * ([m] \<langle>g\<rangle> [n]) (h, j)) {h. True} = sup_monoid.sum (\<lambda>h. (if i = k \<and> h = l then f (i, h) else bot) * (if h = m \<and> j = n then g (h, j) else bot)) {h. True}
[PROOF STEP]
by (simp add: restrict_singleton)
[PROOF STATE]
proof (state)
this:
sup_monoid.sum (\<lambda>h. ([k] \<langle>f\<rangle> [l]) (i, h) * ([m] \<langle>g\<rangle> [n]) (h, j)) {h. True} = sup_monoid.sum (\<lambda>h. (if i = k \<and> h = l then f (i, h) else bot) * (if h = m \<and> j = n then g (h, j) else bot)) {h. True}

goal (1 subgoal):
 1. ([k] \<langle>f\<rangle> [l] \<odot> [m] \<langle>g\<rangle> [n]) (i, j) = (if i = k \<and> l = m \<and> j = n then f (i, l) * g (m, j) else bot)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sup_monoid.sum (\<lambda>h. ([k] \<langle>f\<rangle> [l]) (i, h) * ([m] \<langle>g\<rangle> [n]) (h, j)) {h. True} = sup_monoid.sum (\<lambda>h. (if i = k \<and> h = l then f (i, h) else bot) * (if h = m \<and> j = n then g (h, j) else bot)) {h. True}

goal (1 subgoal):
 1. ([k] \<langle>f\<rangle> [l] \<odot> [m] \<langle>g\<rangle> [n]) (i, j) = (if i = k \<and> l = m \<and> j = n then f (i, l) * g (m, j) else bot)
[PROOF STEP]
have "... = (\<Squnion>\<^sub>h if h = l then (if i = k then f (i,h) else bot) * (if h = m \<and> j = n then g (h,j) else bot) else bot)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sup_monoid.sum (\<lambda>h. (if i = k \<and> h = l then f (i, h) else bot) * (if h = m \<and> j = n then g (h, j) else bot)) {h. True} = sup_monoid.sum (\<lambda>h. if h = l then (if i = k then f (i, h) else bot) * (if h = m \<and> j = n then g (h, j) else bot) else bot) {h. True}
[PROOF STEP]
by (rule sup_monoid.sum.cong) auto
[PROOF STATE]
proof (state)
this:
sup_monoid.sum (\<lambda>h. (if i = k \<and> h = l then f (i, h) else bot) * (if h = m \<and> j = n then g (h, j) else bot)) {h. True} = sup_monoid.sum (\<lambda>h. if h = l then (if i = k then f (i, h) else bot) * (if h = m \<and> j = n then g (h, j) else bot) else bot) {h. True}

goal (1 subgoal):
 1. ([k] \<langle>f\<rangle> [l] \<odot> [m] \<langle>g\<rangle> [n]) (i, j) = (if i = k \<and> l = m \<and> j = n then f (i, l) * g (m, j) else bot)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sup_monoid.sum (\<lambda>h. (if i = k \<and> h = l then f (i, h) else bot) * (if h = m \<and> j = n then g (h, j) else bot)) {h. True} = sup_monoid.sum (\<lambda>h. if h = l then (if i = k then f (i, h) else bot) * (if h = m \<and> j = n then g (h, j) else bot) else bot) {h. True}

goal (1 subgoal):
 1. ([k] \<langle>f\<rangle> [l] \<odot> [m] \<langle>g\<rangle> [n]) (i, j) = (if i = k \<and> l = m \<and> j = n then f (i, l) * g (m, j) else bot)
[PROOF STEP]
have "... = (if i = k then f (i,l) else bot) * (if l = m \<and> j = n then g (l,j) else bot)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sup_monoid.sum (\<lambda>h. if h = l then (if i = k then f (i, h) else bot) * (if h = m \<and> j = n then g (h, j) else bot) else bot) {h. True} = (if i = k then f (i, l) else bot) * (if l = m \<and> j = n then g (l, j) else bot)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sup_monoid.sum (\<lambda>h. if h = l then (if i = k then f (i, h) else bot) * (if h = m \<and> j = n then g (h, j) else bot) else bot) {h. True} = (if i = k then f (i, l) else bot) * (if l = m \<and> j = n then g (l, j) else bot)

goal (1 subgoal):
 1. ([k] \<langle>f\<rangle> [l] \<odot> [m] \<langle>g\<rangle> [n]) (i, j) = (if i = k \<and> l = m \<and> j = n then f (i, l) * g (m, j) else bot)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sup_monoid.sum (\<lambda>h. if h = l then (if i = k then f (i, h) else bot) * (if h = m \<and> j = n then g (h, j) else bot) else bot) {h. True} = (if i = k then f (i, l) else bot) * (if l = m \<and> j = n then g (l, j) else bot)

goal (1 subgoal):
 1. ([k] \<langle>f\<rangle> [l] \<odot> [m] \<langle>g\<rangle> [n]) (i, j) = (if i = k \<and> l = m \<and> j = n then f (i, l) * g (m, j) else bot)
[PROOF STEP]
have "... = (if i = k \<and> l = m \<and> j = n then f (i,l) * g (m,j) else bot)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if i = k then f (i, l) else bot) * (if l = m \<and> j = n then g (l, j) else bot) = (if i = k \<and> l = m \<and> j = n then f (i, l) * g (m, j) else bot)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(if i = k then f (i, l) else bot) * (if l = m \<and> j = n then g (l, j) else bot) = (if i = k \<and> l = m \<and> j = n then f (i, l) * g (m, j) else bot)

goal (1 subgoal):
 1. ([k] \<langle>f\<rangle> [l] \<odot> [m] \<langle>g\<rangle> [n]) (i, j) = (if i = k \<and> l = m \<and> j = n then f (i, l) * g (m, j) else bot)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
([k] \<langle>f\<rangle> [l] \<odot> [m] \<langle>g\<rangle> [n]) (i, j) = (if i = k \<and> l = m \<and> j = n then f (i, l) * g (m, j) else bot)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
([k] \<langle>f\<rangle> [l] \<odot> [m] \<langle>g\<rangle> [n]) (i, j) = (if i = k \<and> l = m \<and> j = n then f (i, l) * g (m, j) else bot)

goal (1 subgoal):
 1. ([k] \<langle>f\<rangle> [l] \<odot> [m] \<langle>g\<rangle> [n]) (i, j) = (if i = k \<and> l = m \<and> j = n then f (i, l) * g (m, j) else bot)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
([k] \<langle>f\<rangle> [l] \<odot> [m] \<langle>g\<rangle> [n]) (i, j) = (if i = k \<and> l = m \<and> j = n then f (i, l) * g (m, j) else bot)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma d_delta_lnexp_cf6_nonpos: "diff_delta_lnexp_cf6 x \<le> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diff_delta_lnexp_cf6 x \<le> 0
[PROOF STEP]
unfolding diff_delta_lnexp_cf6_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (x ^ 12) / (numer_cf6 (- x) * numer_cf6 x) \<le> 0
[PROOF STEP]
using numer_cf6_pos [of x]  numer_cf6_pos [of "-x"]
[PROOF STATE]
proof (prove)
using this:
0 < numer_cf6 x
0 < numer_cf6 (- x)

goal (1 subgoal):
 1. - (x ^ 12) / (numer_cf6 (- x) * numer_cf6 x) \<le> 0
[PROOF STEP]
by (simp add: zero_le_divide_iff zero_le_mult_iff)


[STATEMENT]
lemma subdegree_div_unit:
  fixes   p q :: "'a :: division_ring fps"
  assumes "q $ 0 \<noteq> 0"
  shows   "subdegree (p div q) = subdegree p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subdegree (p / q) = subdegree p
[PROOF STEP]
by      (intro subdegree_div_unit'') (simp_all add: assms)


[STATEMENT]
lemma hequiv_sym: \<open>Hintikka A H \<Longrightarrow> i \<in> A \<Longrightarrow> j \<in> A \<Longrightarrow> hequiv H i j \<longleftrightarrow> hequiv H j i\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Hintikka A H; i \<in> A; j \<in> A\<rbrakk> \<Longrightarrow> hequiv H i j = hequiv H j i
[PROOF STEP]
by (meson hequiv_sym')


[STATEMENT]
lemma degree_lagrange_basis_poly: "degree (lagrange_basis_poly xs xj) \<le> length (filter (\<lambda> x. x \<noteq> xj) xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (lagrange_basis_poly xs xj) \<le> length (filter (\<lambda>x. x \<noteq> xj) xs)
[PROOF STEP]
unfolding lagrange_basis_poly_def Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. degree (\<Prod>xi\<leftarrow>filter (\<lambda>x. x \<noteq> xj) xs. smult (inverse (xj - xi)) [:- xi, 1::'a:]) \<le> length (filter (\<lambda>x. x \<noteq> xj) xs)
[PROOF STEP]
by (rule order.trans[OF degree_prod_list_le], rule order_trans[OF sum_list_mono[of _ _ "\<lambda> _. 1"]],
  auto simp: o_def, induct xs, auto)


[STATEMENT]
lemma analytic_on_open: "open S \<Longrightarrow> f analytic_on S \<longleftrightarrow> f holomorphic_on S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open S \<Longrightarrow> (f analytic_on S) = (f holomorphic_on S)
[PROOF STEP]
apply (auto simp: analytic_imp_holomorphic)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>open S; f holomorphic_on S\<rbrakk> \<Longrightarrow> f analytic_on S
[PROOF STEP]
apply (auto simp: analytic_on_def holomorphic_on_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>open S; \<forall>x\<in>S. f field_differentiable at x within S; x \<in> S\<rbrakk> \<Longrightarrow> \<exists>e>0. \<forall>xa\<in>ball x e. f field_differentiable at xa within ball x e
[PROOF STEP]
by (metis holomorphic_on_def holomorphic_on_subset open_contains_ball)


[STATEMENT]
lemma hpowr_0 [simp]: "r ^ 0 = (1::hypreal)"
  for r :: hypreal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r ^ 0 = 1
[PROOF STEP]
by (rule power_0)


[STATEMENT]
lemma inext_atMost: "t < n \<Longrightarrow> inext t {..n} = Suc t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t < n \<Longrightarrow> inext t {..n} = Suc t
[PROOF STEP]
apply (unfold inext_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t < n \<Longrightarrow> (if t \<in> {..n} \<and> {..n} \<down>> t \<noteq> {} then iMin ({..n} \<down>> t) else t) = Suc t
[PROOF STEP]
apply (subgoal_tac "Suc t \<in> {..n} \<down>> t")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>t < n; Suc t \<in> {..n} \<down>> t\<rbrakk> \<Longrightarrow> (if t \<in> {..n} \<and> {..n} \<down>> t \<noteq> {} then iMin ({..n} \<down>> t) else t) = Suc t
 2. t < n \<Longrightarrow> Suc t \<in> {..n} \<down>> t
[PROOF STEP]
prefer 2
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. t < n \<Longrightarrow> Suc t \<in> {..n} \<down>> t
 2. \<lbrakk>t < n; Suc t \<in> {..n} \<down>> t\<rbrakk> \<Longrightarrow> (if t \<in> {..n} \<and> {..n} \<down>> t \<noteq> {} then iMin ({..n} \<down>> t) else t) = Suc t
[PROOF STEP]
apply (simp add: cut_greater_mem_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>t < n; Suc t \<in> {..n} \<down>> t\<rbrakk> \<Longrightarrow> (if t \<in> {..n} \<and> {..n} \<down>> t \<noteq> {} then iMin ({..n} \<down>> t) else t) = Suc t
[PROOF STEP]
apply (simp add: in_imp_not_empty)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>t < n; Suc t \<in> {..n} \<down>> t\<rbrakk> \<Longrightarrow> iMin ({..n} \<down>> t) = Suc t
[PROOF STEP]
apply (rule iMin_equality, assumption)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>t < n; Suc t \<in> {..n} \<down>> t; x \<in> {..n} \<down>> t\<rbrakk> \<Longrightarrow> Suc t \<le> x
[PROOF STEP]
apply (simp add: cut_greater_mem_iff)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma nextl_path_to: "q \<in> accessible \<Longrightarrow> nextl (dfa.init M) (path_to q) = q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. q \<in> accessible \<Longrightarrow> nextl (init M) (path_to q) = q
[PROOF STEP]
using path_to_left_lang
[PROOF STATE]
proof (prove)
using this:
?q \<in> accessible \<Longrightarrow> path_to ?q \<in> left_lang ?q

goal (1 subgoal):
 1. q \<in> accessible \<Longrightarrow> nextl (init M) (path_to q) = q
[PROOF STEP]
unfolding left_lang_def
[PROOF STATE]
proof (prove)
using this:
?q \<in> accessible \<Longrightarrow> path_to ?q \<in> {u. nextl (init M) u = ?q}

goal (1 subgoal):
 1. q \<in> accessible \<Longrightarrow> nextl (init M) (path_to q) = q
[PROOF STEP]
by auto


[STATEMENT]
lemma transpose_alt_def:
"transpose a b x = (if x = a then b else if x = b then a else x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.transpose a b x = (if x = a then b else if x = b then a else x)
[PROOF STEP]
using swap_id_eq
[PROOF STATE]
proof (prove)
using this:
(id \<circ> Transposition.transpose ?a ?b) ?x = (if ?x = ?a then ?b else if ?x = ?b then ?a else ?x)

goal (1 subgoal):
 1. local.transpose a b x = (if x = a then b else if x = b then a else x)
[PROOF STEP]
by (simp add: transpose_def)


[STATEMENT]
lemma select_mset_cong: "mset xs = mset ys \<Longrightarrow> select k xs = select k ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset xs = mset ys \<Longrightarrow> select k xs = select k ys
[PROOF STEP]
using sort_mset_cong[of xs ys]
[PROOF STATE]
proof (prove)
using this:
mset xs = mset ys \<Longrightarrow> sort xs = sort ys

goal (1 subgoal):
 1. mset xs = mset ys \<Longrightarrow> select k xs = select k ys
[PROOF STEP]
unfolding select_def
[PROOF STATE]
proof (prove)
using this:
mset xs = mset ys \<Longrightarrow> sort xs = sort ys

goal (1 subgoal):
 1. mset xs = mset ys \<Longrightarrow> sort xs ! k = sort ys ! k
[PROOF STEP]
by auto


[STATEMENT]
lemma drop_bit_Suc_bit0 [simp]:
  \<open>drop_bit (Suc n) (numeral (Num.Bit0 k)) = drop_bit n (numeral k)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. drop_bit (Suc n) (numeral (num.Bit0 k)) = drop_bit n (numeral k)
[PROOF STEP]
by (simp add: drop_bit_Suc numeral_Bit0_div_2)


[STATEMENT]
lemma ccSUP_empty [simp]: "(SUP x\<in>{}. f x) = bot"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sup (f ` {}) = bot
[PROOF STEP]
unfolding image_empty
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sup {} = bot
[PROOF STEP]
by simp


[STATEMENT]
lemma COMP_case:
  assumes 1: "\<forall>l. g l < ack kg (sum_list l)"
      and 2: "\<forall>f \<in> set fs. \<exists>kf. \<forall>l. f l < ack kf (sum_list l)"
  shows "\<exists>k. \<forall>l. COMP g fs  l < ack k (sum_list l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>k. \<forall>l. COMP g fs l < ack k (sum_list l)
[PROOF STEP]
unfolding COMP_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>k. \<forall>l. g (map (\<lambda>f. f l) fs) < ack k (sum_list l)
[PROOF STEP]
using 1 COMP_map_aux [OF 2]
[PROOF STATE]
proof (prove)
using this:
\<forall>l. g l < ack kg (sum_list l)
\<exists>k. \<forall>l. (\<Sum>f\<leftarrow>fs. f l) < ack k (sum_list l)

goal (1 subgoal):
 1. \<exists>k. \<forall>l. g (map (\<lambda>f. f l) fs) < ack k (sum_list l)
[PROOF STEP]
by (meson ack_less_mono2 ack_nest_bound less_trans)


[STATEMENT]
lemma ln_smallo_powr:
  assumes "(e::real) > 0"
  shows   "(\<lambda>x. ln x) \<in> o(\<lambda>x. x powr e)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ln \<in> o(\<lambda>x. x powr e)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ln \<in> o(\<lambda>x. x powr e)
[PROOF STEP]
have *: "ln \<in> o(\<lambda>x::real. x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ln \<in> o(\<lambda>x. x)
[PROOF STEP]
using ln_x_over_x_tendsto_0
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. ln x / x) \<longlongrightarrow> 0) at_top

goal (1 subgoal):
 1. ln \<in> o(\<lambda>x. x)
[PROOF STEP]
by (intro smalloI_tendsto) auto
[PROOF STATE]
proof (state)
this:
ln \<in> o(\<lambda>x. x)

goal (1 subgoal):
 1. ln \<in> o(\<lambda>x. x powr e)
[PROOF STEP]
have "(\<lambda>x. ln x) \<in> \<Theta>(\<lambda>x::real. ln x powr 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ln \<in> \<Theta>(\<lambda>x. ln x powr 1)
[PROOF STEP]
by (intro bigthetaI_cong eventually_mono[OF eventually_gt_at_top[of 1]]) auto
[PROOF STATE]
proof (state)
this:
ln \<in> \<Theta>(\<lambda>x. ln x powr 1)

goal (1 subgoal):
 1. ln \<in> o(\<lambda>x. x powr e)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ln \<in> \<Theta>(\<lambda>x. ln x powr 1)

goal (1 subgoal):
 1. ln \<in> o(\<lambda>x. x powr e)
[PROOF STEP]
have "(\<lambda>x::real. ln x powr 1) \<in> o(\<lambda>x. x powr e)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. ln x powr 1) \<in> o(\<lambda>x. x powr e)
[PROOF STEP]
by (intro ln_smallo_imp_flat filterlim_ident ln_at_top assms
              landau_o.small.compose[of _ at_top _ ln] *)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. ln x powr 1) \<in> o(\<lambda>x. x powr e)

goal (1 subgoal):
 1. ln \<in> o(\<lambda>x. x powr e)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
ln \<in> o(\<lambda>x. x powr e)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ln \<in> o(\<lambda>x. x powr e)

goal (1 subgoal):
 1. ln \<in> o(\<lambda>x. x powr e)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
ln \<in> o(\<lambda>x. x powr e)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in cpx_sq_mat)  mult_sum_mat_distrib_right:
  shows "finite I \<Longrightarrow> (\<And>i. i \<in> I \<Longrightarrow> (A i)\<in> fc_mats) \<Longrightarrow> B \<in> fc_mats \<Longrightarrow>
  (sum_mat (\<lambda>i. (A i) * B) I) = (sum_mat A I) * B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite I; \<And>i. i \<in> I \<Longrightarrow> A i \<in> fc_mats; B \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. A i * B) I = local.sum_mat A I * B
[PROOF STEP]
proof (induct rule: finite_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<And>i. i \<in> {} \<Longrightarrow> A i \<in> fc_mats; B \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. A i * B) {} = local.sum_mat A {} * B
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats; B \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. A i * B) F = local.sum_mat A F * B; \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> fc_mats; B \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. A i * B) (insert x F) = local.sum_mat A (insert x F) * B
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:
?i1 \<in> {} \<Longrightarrow> A ?i1 \<in> fc_mats
B \<in> fc_mats

goal (2 subgoals):
 1. \<lbrakk>\<And>i. i \<in> {} \<Longrightarrow> A i \<in> fc_mats; B \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. A i * B) {} = local.sum_mat A {} * B
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats; B \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. A i * B) F = local.sum_mat A F * B; \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> fc_mats; B \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. A i * B) (insert x F) = local.sum_mat A (insert x F) * B
[PROOF STEP]
hence "sum_mat A {} = 0\<^sub>m dimR dimC"
[PROOF STATE]
proof (prove)
using this:
?i1 \<in> {} \<Longrightarrow> A ?i1 \<in> fc_mats
B \<in> fc_mats

goal (1 subgoal):
 1. local.sum_mat A {} = 0\<^sub>m dimR dimC
[PROOF STEP]
using sum_mat_empty
[PROOF STATE]
proof (prove)
using this:
?i1 \<in> {} \<Longrightarrow> A ?i1 \<in> fc_mats
B \<in> fc_mats
local.sum_mat ?A {} = 0\<^sub>m dimR dimC

goal (1 subgoal):
 1. local.sum_mat A {} = 0\<^sub>m dimR dimC
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
local.sum_mat A {} = 0\<^sub>m dimR dimC

goal (2 subgoals):
 1. \<lbrakk>\<And>i. i \<in> {} \<Longrightarrow> A i \<in> fc_mats; B \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. A i * B) {} = local.sum_mat A {} * B
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats; B \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. A i * B) F = local.sum_mat A F * B; \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> fc_mats; B \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. A i * B) (insert x F) = local.sum_mat A (insert x F) * B
[PROOF STEP]
hence "(sum_mat A {}) * B = 0\<^sub>m dimR dimC"
[PROOF STATE]
proof (prove)
using this:
local.sum_mat A {} = 0\<^sub>m dimR dimC

goal (1 subgoal):
 1. local.sum_mat A {} * B = 0\<^sub>m dimR dimC
[PROOF STEP]
using empty
[PROOF STATE]
proof (prove)
using this:
local.sum_mat A {} = 0\<^sub>m dimR dimC
?i1 \<in> {} \<Longrightarrow> A ?i1 \<in> fc_mats
B \<in> fc_mats

goal (1 subgoal):
 1. local.sum_mat A {} * B = 0\<^sub>m dimR dimC
[PROOF STEP]
by (simp add: fc_mats_carrier dim_eq)
[PROOF STATE]
proof (state)
this:
local.sum_mat A {} * B = 0\<^sub>m dimR dimC

goal (2 subgoals):
 1. \<lbrakk>\<And>i. i \<in> {} \<Longrightarrow> A i \<in> fc_mats; B \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. A i * B) {} = local.sum_mat A {} * B
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats; B \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. A i * B) F = local.sum_mat A F * B; \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> fc_mats; B \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. A i * B) (insert x F) = local.sum_mat A (insert x F) * B
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
local.sum_mat A {} * B = 0\<^sub>m dimR dimC

goal (2 subgoals):
 1. \<lbrakk>\<And>i. i \<in> {} \<Longrightarrow> A i \<in> fc_mats; B \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. A i * B) {} = local.sum_mat A {} * B
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats; B \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. A i * B) F = local.sum_mat A F * B; \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> fc_mats; B \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. A i * B) (insert x F) = local.sum_mat A (insert x F) * B
[PROOF STEP]
have "sum_mat (\<lambda>i. (A i) * B) {} = 0\<^sub>m dimR dimC"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.sum_mat (\<lambda>i. A i * B) {} = 0\<^sub>m dimR dimC
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
local.sum_mat (\<lambda>i. A i * B) {} = 0\<^sub>m dimR dimC

goal (2 subgoals):
 1. \<lbrakk>\<And>i. i \<in> {} \<Longrightarrow> A i \<in> fc_mats; B \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. A i * B) {} = local.sum_mat A {} * B
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats; B \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. A i * B) F = local.sum_mat A F * B; \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> fc_mats; B \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. A i * B) (insert x F) = local.sum_mat A (insert x F) * B
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
local.sum_mat A {} * B = 0\<^sub>m dimR dimC
local.sum_mat (\<lambda>i. A i * B) {} = 0\<^sub>m dimR dimC
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
local.sum_mat A {} * B = 0\<^sub>m dimR dimC
local.sum_mat (\<lambda>i. A i * B) {} = 0\<^sub>m dimR dimC

goal (1 subgoal):
 1. local.sum_mat (\<lambda>i. A i * B) {} = local.sum_mat A {} * B
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
local.sum_mat (\<lambda>i. A i * B) {} = local.sum_mat A {} * B

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats; B \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. A i * B) F = local.sum_mat A F * B; \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> fc_mats; B \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. A i * B) (insert x F) = local.sum_mat A (insert x F) * B
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats; B \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. A i * B) F = local.sum_mat A F * B; \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> fc_mats; B \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. A i * B) (insert x F) = local.sum_mat A (insert x F) * B
[PROOF STEP]
case (insert x F)
[PROOF STATE]
proof (state)
this:
finite F
x \<notin> F
\<lbrakk>\<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats; B \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. A i * B) F = local.sum_mat A F * B
?i1 \<in> insert x F \<Longrightarrow> A ?i1 \<in> fc_mats
B \<in> fc_mats

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats; B \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. A i * B) F = local.sum_mat A F * B; \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> fc_mats; B \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. A i * B) (insert x F) = local.sum_mat A (insert x F) * B
[PROOF STEP]
have "sum_mat (\<lambda>i. (A i) * B) (insert x F) = (A x) * B + sum_mat (\<lambda>i. (A i) * B) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.sum_mat (\<lambda>i. A i * B) (insert x F) = A x * B + local.sum_mat (\<lambda>i. A i * B) F
[PROOF STEP]
using sum_with_insert[of "\<lambda>i. (A i) * B" x F] insert
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>A x * B \<in> fc_mats; (\<lambda>i. A i * B) ` F \<subseteq> fc_mats; finite F; x \<notin> F\<rbrakk> \<Longrightarrow> sum_with (+) (0\<^sub>m dimR dimC) (\<lambda>i. A i * B) (insert x F) = A x * B + sum_with (+) (0\<^sub>m dimR dimC) (\<lambda>i. A i * B) F
finite F
x \<notin> F
\<lbrakk>\<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats; B \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. A i * B) F = local.sum_mat A F * B
?i1 \<in> insert x F \<Longrightarrow> A ?i1 \<in> fc_mats
B \<in> fc_mats

goal (1 subgoal):
 1. local.sum_mat (\<lambda>i. A i * B) (insert x F) = A x * B + local.sum_mat (\<lambda>i. A i * B) F
[PROOF STEP]
by (simp add: image_subset_iff local.sum_mat_def cpx_sq_mat_mult)
[PROOF STATE]
proof (state)
this:
local.sum_mat (\<lambda>i. A i * B) (insert x F) = A x * B + local.sum_mat (\<lambda>i. A i * B) F

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats; B \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. A i * B) F = local.sum_mat A F * B; \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> fc_mats; B \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. A i * B) (insert x F) = local.sum_mat A (insert x F) * B
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
local.sum_mat (\<lambda>i. A i * B) (insert x F) = A x * B + local.sum_mat (\<lambda>i. A i * B) F

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats; B \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. A i * B) F = local.sum_mat A F * B; \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> fc_mats; B \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. A i * B) (insert x F) = local.sum_mat A (insert x F) * B
[PROOF STEP]
have "... = (A x) * B + (sum_mat A F) * B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A x * B + local.sum_mat (\<lambda>i. A i * B) F = A x * B + local.sum_mat A F * B
[PROOF STEP]
using insert
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
\<lbrakk>\<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats; B \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. A i * B) F = local.sum_mat A F * B
?i1 \<in> insert x F \<Longrightarrow> A ?i1 \<in> fc_mats
B \<in> fc_mats

goal (1 subgoal):
 1. A x * B + local.sum_mat (\<lambda>i. A i * B) F = A x * B + local.sum_mat A F * B
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
A x * B + local.sum_mat (\<lambda>i. A i * B) F = A x * B + local.sum_mat A F * B

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats; B \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. A i * B) F = local.sum_mat A F * B; \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> fc_mats; B \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. A i * B) (insert x F) = local.sum_mat A (insert x F) * B
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A x * B + local.sum_mat (\<lambda>i. A i * B) F = A x * B + local.sum_mat A F * B

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats; B \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. A i * B) F = local.sum_mat A F * B; \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> fc_mats; B \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. A i * B) (insert x F) = local.sum_mat A (insert x F) * B
[PROOF STEP]
have "... = (A x + (sum_mat A F)) * B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A x * B + local.sum_mat A F * B = (A x + local.sum_mat A F) * B
[PROOF STEP]
proof (rule mult_add_distrib_left[symmetric])
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. B \<in> fc_mats
 2. A x \<in> fc_mats
 3. local.sum_mat A F \<in> fc_mats
[PROOF STEP]
show "B\<in> fc_mats"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B \<in> fc_mats
[PROOF STEP]
using insert
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
\<lbrakk>\<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats; B \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. A i * B) F = local.sum_mat A F * B
?i1 \<in> insert x F \<Longrightarrow> A ?i1 \<in> fc_mats
B \<in> fc_mats

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

goal (2 subgoals):
 1. A x \<in> fc_mats
 2. local.sum_mat A F \<in> fc_mats
[PROOF STEP]
show "A x \<in> fc_mats"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A x \<in> fc_mats
[PROOF STEP]
using insert
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
\<lbrakk>\<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats; B \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. A i * B) F = local.sum_mat A F * B
?i1 \<in> insert x F \<Longrightarrow> A ?i1 \<in> fc_mats
B \<in> fc_mats

goal (1 subgoal):
 1. A x \<in> fc_mats
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
A x \<in> fc_mats

goal (1 subgoal):
 1. local.sum_mat A F \<in> fc_mats
[PROOF STEP]
show "sum_mat A F \<in> fc_mats"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.sum_mat A F \<in> fc_mats
[PROOF STEP]
using insert
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
\<lbrakk>\<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats; B \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. A i * B) F = local.sum_mat A F * B
?i1 \<in> insert x F \<Longrightarrow> A ?i1 \<in> fc_mats
B \<in> fc_mats

goal (1 subgoal):
 1. local.sum_mat A F \<in> fc_mats
[PROOF STEP]
by (simp add: fc_mats_carrier sum_mat_carrier)
[PROOF STATE]
proof (state)
this:
local.sum_mat A F \<in> fc_mats

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
A x * B + local.sum_mat A F * B = (A x + local.sum_mat A F) * B

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats; B \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. A i * B) F = local.sum_mat A F * B; \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> fc_mats; B \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. A i * B) (insert x F) = local.sum_mat A (insert x F) * B
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A x * B + local.sum_mat A F * B = (A x + local.sum_mat A F) * B

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats; B \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. A i * B) F = local.sum_mat A F * B; \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> fc_mats; B \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. A i * B) (insert x F) = local.sum_mat A (insert x F) * B
[PROOF STEP]
have "... = (sum_mat A (insert x F)) * B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A x + local.sum_mat A F) * B = local.sum_mat A (insert x F) * B
[PROOF STEP]
using sum_with_insert[of A x F] insert
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>A x \<in> fc_mats; A ` F \<subseteq> fc_mats; finite F; x \<notin> F\<rbrakk> \<Longrightarrow> sum_with (+) (0\<^sub>m dimR dimC) A (insert x F) = A x + sum_with (+) (0\<^sub>m dimR dimC) A F
finite F
x \<notin> F
\<lbrakk>\<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats; B \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. A i * B) F = local.sum_mat A F * B
?i1 \<in> insert x F \<Longrightarrow> A ?i1 \<in> fc_mats
B \<in> fc_mats

goal (1 subgoal):
 1. (A x + local.sum_mat A F) * B = local.sum_mat A (insert x F) * B
[PROOF STEP]
by (simp add: image_subset_iff sum_mat_def)
[PROOF STATE]
proof (state)
this:
(A x + local.sum_mat A F) * B = local.sum_mat A (insert x F) * B

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; \<lbrakk>\<And>i. i \<in> F \<Longrightarrow> A i \<in> fc_mats; B \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. A i * B) F = local.sum_mat A F * B; \<And>i. i \<in> insert x F \<Longrightarrow> A i \<in> fc_mats; B \<in> fc_mats\<rbrakk> \<Longrightarrow> local.sum_mat (\<lambda>i. A i * B) (insert x F) = local.sum_mat A (insert x F) * B
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
local.sum_mat (\<lambda>i. A i * B) (insert x F) = local.sum_mat A (insert x F) * B
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
local.sum_mat (\<lambda>i. A i * B) (insert x F) = local.sum_mat A (insert x F) * B

goal (1 subgoal):
 1. local.sum_mat (\<lambda>i. A i * B) (insert x F) = local.sum_mat A (insert x F) * B
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
local.sum_mat (\<lambda>i. A i * B) (insert x F) = local.sum_mat A (insert x F) * B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inorder_combine:
  "inorder(combine l r) = inorder l @ inorder r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Tree2.inorder (combine l r) = Tree2.inorder l @ Tree2.inorder r
[PROOF STEP]
by(induction l r rule: combine.induct)
  (auto simp: del_maxD split_minD inorder_rotateL inorder_rotateR not_Leaf_if_not_balanced1
    simp del: rotateL.simps rotateR.simps split: prod.splits)


[STATEMENT]
lemma T_composition_borel [measurable]:
  assumes "f \<in> borel_measurable M"
  shows "(\<lambda>x. f(T x)) \<in> borel_measurable M" "(\<lambda>x. f((T^^k) x)) \<in> borel_measurable M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. f (T x)) \<in> borel_measurable M &&& (\<lambda>x. f ((T ^^ k) x)) \<in> borel_measurable M
[PROOF STEP]
using T_meas Tn_meas assms measurable_compose
[PROOF STATE]
proof (prove)
using this:
T \<in> M \<rightarrow>\<^sub>M M
T ^^ ?n \<in> M \<rightarrow>\<^sub>M M
f \<in> borel_measurable M
\<lbrakk>?f \<in> ?M \<rightarrow>\<^sub>M ?N; ?g \<in> ?N \<rightarrow>\<^sub>M ?L\<rbrakk> \<Longrightarrow> (\<lambda>x. ?g (?f x)) \<in> ?M \<rightarrow>\<^sub>M ?L

goal (1 subgoal):
 1. (\<lambda>x. f (T x)) \<in> borel_measurable M &&& (\<lambda>x. f ((T ^^ k) x)) \<in> borel_measurable M
[PROOF STEP]
by auto


[STATEMENT]
lemma bl_and_mask:
  fixes w :: "'a::len word"
    and n :: nat
  defines "n' \<equiv> LENGTH('a) - n"
  shows "to_bl (w AND mask n) = replicate n' False @ drop n' (to_bl w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_bl (w AND mask n) = replicate n' False @ drop n' (to_bl w)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. to_bl (w AND mask n) = replicate n' False @ drop n' (to_bl w)
[PROOF STEP]
note [simp] = map_replicate_True map_replicate_False
[PROOF STATE]
proof (state)
this:
?n = length ?xs \<Longrightarrow> map2 (\<and>) ?xs (replicate ?n True) = ?xs
?n = length ?xs \<Longrightarrow> map2 (\<and>) ?xs (replicate ?n False) = replicate ?n False

goal (1 subgoal):
 1. to_bl (w AND mask n) = replicate n' False @ drop n' (to_bl w)
[PROOF STEP]
have "to_bl (w AND mask n) = map2 (\<and>) (to_bl w) (to_bl (mask n::'a::len word))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_bl (w AND mask n) = map2 (\<and>) (to_bl w) (to_bl (mask n))
[PROOF STEP]
by (simp add: bl_word_and)
[PROOF STATE]
proof (state)
this:
to_bl (w AND mask n) = map2 (\<and>) (to_bl w) (to_bl (mask n))

goal (1 subgoal):
 1. to_bl (w AND mask n) = replicate n' False @ drop n' (to_bl w)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
to_bl (w AND mask n) = map2 (\<and>) (to_bl w) (to_bl (mask n))

goal (1 subgoal):
 1. to_bl (w AND mask n) = replicate n' False @ drop n' (to_bl w)
[PROOF STEP]
have "to_bl w = take n' (to_bl w) @ drop n' (to_bl w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_bl w = take n' (to_bl w) @ drop n' (to_bl w)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
to_bl w = take n' (to_bl w) @ drop n' (to_bl w)

goal (1 subgoal):
 1. to_bl (w AND mask n) = replicate n' False @ drop n' (to_bl w)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
to_bl w = take n' (to_bl w) @ drop n' (to_bl w)

goal (1 subgoal):
 1. to_bl (w AND mask n) = replicate n' False @ drop n' (to_bl w)
[PROOF STEP]
have "map2 (\<and>) \<dots> (to_bl (mask n::'a::len word)) =
      replicate n' False @ drop n' (to_bl w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map2 (\<and>) (take n' (to_bl w) @ drop n' (to_bl w)) (to_bl (mask n)) = replicate n' False @ drop n' (to_bl w)
[PROOF STEP]
unfolding to_bl_mask n'_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map2 (\<and>) (take (LENGTH('a) - n) (to_bl w) @ drop (LENGTH('a) - n) (to_bl w)) (replicate (LENGTH('a) - n) False @ replicate (min LENGTH('a) n) True) = replicate (LENGTH('a) - n) False @ drop (LENGTH('a) - n) (to_bl w)
[PROOF STEP]
by (subst zip_append) auto
[PROOF STATE]
proof (state)
this:
map2 (\<and>) (take n' (to_bl w) @ drop n' (to_bl w)) (to_bl (mask n)) = replicate n' False @ drop n' (to_bl w)

goal (1 subgoal):
 1. to_bl (w AND mask n) = replicate n' False @ drop n' (to_bl w)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
to_bl (w AND mask n) = replicate n' False @ drop n' (to_bl w)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
to_bl (w AND mask n) = replicate n' False @ drop n' (to_bl w)

goal (1 subgoal):
 1. to_bl (w AND mask n) = replicate n' False @ drop n' (to_bl w)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
to_bl (w AND mask n) = replicate n' False @ drop n' (to_bl w)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vfinite_vcard_omega_iff: "vfinite A \<longleftrightarrow> vcard A \<in>\<^sub>\<circ> \<omega>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vfinite A = (vcard A \<in>\<^sub>\<circ> \<omega>)
[PROOF STEP]
using vfinite_vcard_vfinite
[PROOF STATE]
proof (prove)
using this:
vfinite (vcard ?A) = vfinite ?A

goal (1 subgoal):
 1. vfinite A = (vcard A \<in>\<^sub>\<circ> \<omega>)
[PROOF STEP]
by auto


[STATEMENT]
lemma pth_8:
  fixes x :: "'a::real_normed_vector"
  shows "scaleR c x + scaleR d x \<equiv> scaleR (c + d) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c *\<^sub>R x + d *\<^sub>R x \<equiv> (c + d) *\<^sub>R x
[PROOF STEP]
by (simp add: scaleR_left_distrib)


[STATEMENT]
lemma independent_columns_fst_QR_decomposition:
  fixes A::"real^'n::{mod_type}^'m::{mod_type}"
  assumes b: "vec.independent (columns A)"
  and c: "card (columns A) = ncols A"
  shows "vec.independent (columns (fst (QR_decomposition A)))
  \<and> card (columns (fst (QR_decomposition A))) = ncols A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec.independent (columns (fst (QR_decomposition A))) \<and> card (columns (fst (QR_decomposition A))) = ncols A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vec.independent (columns (fst (QR_decomposition A))) \<and> card (columns (fst (QR_decomposition A))) = ncols A
[PROOF STEP]
have r: "rank A = ncols A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rank A = ncols A
[PROOF STEP]
thm is_basis_imp_full_rank
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rank A = ncols A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rank A = ncols A
[PROOF STEP]
have "rank A = col_rank A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rank A = col_rank A
[PROOF STEP]
unfolding rank_col_rank
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. col_rank A = col_rank A
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
rank A = col_rank A

goal (1 subgoal):
 1. rank A = ncols A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
rank A = col_rank A

goal (1 subgoal):
 1. rank A = ncols A
[PROOF STEP]
have "... = vec.dim (col_space A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. col_rank A = vec.dim (col_space A)
[PROOF STEP]
unfolding col_rank_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec.dim (col_space A) = vec.dim (col_space A)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
col_rank A = vec.dim (col_space A)

goal (1 subgoal):
 1. rank A = ncols A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
col_rank A = vec.dim (col_space A)

goal (1 subgoal):
 1. rank A = ncols A
[PROOF STEP]
have "... = card (columns A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec.dim (col_space A) = card (columns A)
[PROOF STEP]
unfolding col_space_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec.dim (vec.span (columns A)) = card (columns A)
[PROOF STEP]
using b
[PROOF STATE]
proof (prove)
using this:
vec.independent (columns A)

goal (1 subgoal):
 1. vec.dim (vec.span (columns A)) = card (columns A)
[PROOF STEP]
by (rule vec.dim_span_eq_card_independent)
[PROOF STATE]
proof (state)
this:
vec.dim (col_space A) = card (columns A)

goal (1 subgoal):
 1. rank A = ncols A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
vec.dim (col_space A) = card (columns A)

goal (1 subgoal):
 1. rank A = ncols A
[PROOF STEP]
have "... = ncols A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (columns A) = ncols A
[PROOF STEP]
using c
[PROOF STATE]
proof (prove)
using this:
card (columns A) = ncols A

goal (1 subgoal):
 1. card (columns A) = ncols A
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
card (columns A) = ncols A

goal (1 subgoal):
 1. rank A = ncols A
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
rank A = ncols A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
rank A = ncols A

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
rank A = ncols A

goal (1 subgoal):
 1. vec.independent (columns (fst (QR_decomposition A))) \<and> card (columns (fst (QR_decomposition A))) = ncols A
[PROOF STEP]
have "vec.independent (columns (fst (QR_decomposition A)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec.independent (columns (fst (QR_decomposition A)))
[PROOF STEP]
by (metis b c col_rank_def col_space_QR_decomposition col_space_def
      full_rank_imp_is_basis2 vec.indep_card_eq_dim_span ncols_def rank_col_rank)
[PROOF STATE]
proof (state)
this:
vec.independent (columns (fst (QR_decomposition A)))

goal (1 subgoal):
 1. vec.independent (columns (fst (QR_decomposition A))) \<and> card (columns (fst (QR_decomposition A))) = ncols A
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
vec.independent (columns (fst (QR_decomposition A)))

goal (1 subgoal):
 1. vec.independent (columns (fst (QR_decomposition A))) \<and> card (columns (fst (QR_decomposition A))) = ncols A
[PROOF STEP]
have "card (columns (fst (QR_decomposition A))) = ncols A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (columns (fst (QR_decomposition A))) = ncols A
[PROOF STEP]
by (metis col_space_QR_decomposition full_rank_imp_is_basis2 ncols_def r rank_eq_dim_col_space')
[PROOF STATE]
proof (state)
this:
card (columns (fst (QR_decomposition A))) = ncols A

goal (1 subgoal):
 1. vec.independent (columns (fst (QR_decomposition A))) \<and> card (columns (fst (QR_decomposition A))) = ncols A
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
vec.independent (columns (fst (QR_decomposition A)))
card (columns (fst (QR_decomposition A))) = ncols A
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vec.independent (columns (fst (QR_decomposition A)))
card (columns (fst (QR_decomposition A))) = ncols A

goal (1 subgoal):
 1. vec.independent (columns (fst (QR_decomposition A))) \<and> card (columns (fst (QR_decomposition A))) = ncols A
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
vec.independent (columns (fst (QR_decomposition A))) \<and> card (columns (fst (QR_decomposition A))) = ncols A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_sequence_of:
  assumes "bij_betw enum {0..<card A} A"
  assumes "f \<in> A \<rightarrow>\<^sub>E B"
  shows "set (sequence_of A enum f) \<subseteq> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (sequence_of A enum f) \<subseteq> B
[PROOF STEP]
using PiE bij_betwE assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?f \<in> Pi ?A ?B; ?f ?x \<in> ?B ?x \<Longrightarrow> ?Q; ?x \<notin> ?A \<Longrightarrow> ?Q\<rbrakk> \<Longrightarrow> ?Q
bij_betw ?f ?A ?B \<Longrightarrow> \<forall>a\<in>?A. ?f a \<in> ?B
bij_betw enum {0..<card A} A
f \<in> A \<rightarrow>\<^sub>E B

goal (1 subgoal):
 1. set (sequence_of A enum f) \<subseteq> B
[PROOF STEP]
unfolding sequence_of_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?f \<in> Pi ?A ?B; ?f ?x \<in> ?B ?x \<Longrightarrow> ?Q; ?x \<notin> ?A \<Longrightarrow> ?Q\<rbrakk> \<Longrightarrow> ?Q
bij_betw ?f ?A ?B \<Longrightarrow> \<forall>a\<in>?A. ?f a \<in> ?B
bij_betw enum {0..<card A} A
f \<in> A \<rightarrow>\<^sub>E B

goal (1 subgoal):
 1. set (map (\<lambda>n. f (enum n)) [0..<card A]) \<subseteq> B
[PROOF STEP]
by fastforce


[STATEMENT]
theorem for_rec_eq:
  "for_rec f a n = nfoldli [0..<n + 1] (\<lambda>x. True) (\<lambda>k a. f a k) a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. for_rec f a n = nfoldli [0..<n + 1] (\<lambda>x. True) (\<lambda>k a. f a k) a
[PROOF STEP]
using for_comb_for_rec[unfolded for_comb_def, symmetric]
[PROOF STATE]
proof (prove)
using this:
for_rec ?f ?a ?n = nfoldli [0..<?n + 1] (\<lambda>x. True) (\<lambda>k a. ?f a k) ?a

goal (1 subgoal):
 1. for_rec f a n = nfoldli [0..<n + 1] (\<lambda>x. True) (\<lambda>k a. f a k) a
[PROOF STEP]
.


[STATEMENT]
lemma finite_Image_subset:
  "finite (A `` B) \<Longrightarrow> C \<subseteq> A \<Longrightarrow> finite (C `` B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite (A `` B); C \<subseteq> A\<rbrakk> \<Longrightarrow> finite (C `` B)
[PROOF STEP]
by (metis Image_mono order_refl rev_finite_subset)


[STATEMENT]
lemma foldr_refine:
  assumes "I s"
  assumes "\<And>s x. I s \<Longrightarrow> x\<in>set l \<Longrightarrow> I (f x s) \<and> \<alpha> (f x s) = f' x (\<alpha> s)"
  shows "I (foldr f l s) \<and> \<alpha> (foldr f l s) = foldr f' l (\<alpha> s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. I (foldr f l s) \<and> \<alpha> (foldr f l s) = foldr f' l (\<alpha> s)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
I s
\<lbrakk>I ?s; ?x \<in> set l\<rbrakk> \<Longrightarrow> I (f ?x ?s) \<and> \<alpha> (f ?x ?s) = f' ?x (\<alpha> ?s)

goal (1 subgoal):
 1. I (foldr f l s) \<and> \<alpha> (foldr f l s) = foldr f' l (\<alpha> s)
[PROOF STEP]
by (induction l arbitrary: s) auto


[STATEMENT]
lemma integral_0 [simp]:
  "integral S (\<lambda>x::'n::euclidean_space. 0::'m::real_normed_vector) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral S (\<lambda>x. 0::'m) = (0::'m)
[PROOF STEP]
by (rule integral_unique has_integral_0)+


[STATEMENT]
lemma fmdom_fmap_of_list[simp]: "fmdom (fmap_of_list xs) = fset_of_list (map fst xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmdom (fmap_of_list xs) = fset_of_list (map fst xs)
[PROOF STEP]
apply transfer'
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xs. dom (map_of xs) = set (map fst xs)
[PROOF STEP]
apply (subst dom_map_of_conv_image_fst)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>xs. fst ` set xs = set (map fst xs)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma an_omega_induct:
  "an(x * y \<squnion> z) \<le> an(y) \<Longrightarrow> an(x\<^sup>\<omega> \<squnion> x\<^sup>\<star> * z) \<le> an(y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. an (x * y \<squnion> z) \<le> an y \<Longrightarrow> an (x\<^sup>\<omega> \<squnion> x\<^sup>\<star> * z) \<le> an y
[PROOF STEP]
by (simp add: an_n_order n_omega_induct)


[STATEMENT]
lemma one_less_numeral[simp]: "1 < (numeral n::ennreal) \<longleftrightarrow> (num.One < n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 < numeral n) = (num.One < n)
[PROOF STEP]
by (simp flip: ennreal_1 ennreal_numeral add: ennreal_less_iff)


[STATEMENT]
lemma swap_typeI_is_typeII:
  assumes "typeI_twoCube C"
  shows "typeII_twoCube (prod.swap o C o prod.swap)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. typeII_twoCube (prod.swap \<circ> C \<circ> prod.swap)
[PROOF STEP]
proof (simp add: typeI_twoCube_def typeII_twoCube_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>a b. a < b \<and> (\<exists>g1 g2. (\<forall>x\<in>{a..b}. g2 x \<le> g1 x) \<and> prod.swap \<circ> C \<circ> prod.swap = (\<lambda>(y, x). ((1 - y) * g2 ((1 - x) * a + x * b) + y * g1 ((1 - x) * a + x * b), (1 - x) * a + x * b)) \<and> g1 piecewise_C1_differentiable_on {a..b} \<and> g2 piecewise_C1_differentiable_on {a..b})
[PROOF STEP]
obtain a b g1 g2 where C: " a < b "
    "(\<forall>x\<in>{a..b}. g2 x \<le> g1 x) "
    "cubeImage C = {(x, y). x \<in> {a..b} \<and> y \<in> {g2 x..g1 x}} "
    "C = (\<lambda>(x, y). ((1 - x) * a + x * b, (1 - y) * g2 ((1 - x) * a + x * b) + y * g1 ((1 - x) * a + x * b))) "
    "g1 piecewise_C1_differentiable_on {a..b} "
    "g2 piecewise_C1_differentiable_on {a..b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a b g2 g1. \<lbrakk>a < b; \<forall>x\<in>{a..b}. g2 x \<le> g1 x; cubeImage C = {(x, y). x \<in> {a..b} \<and> y \<in> {g2 x..g1 x}}; C = (\<lambda>(x, y). ((1 - x) * a + x * b, (1 - y) * g2 ((1 - x) * a + x * b) + y * g1 ((1 - x) * a + x * b))); g1 piecewise_C1_differentiable_on {a..b}; g2 piecewise_C1_differentiable_on {a..b}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using typeI_cube_explicit_spec[OF assms]
[PROOF STATE]
proof (prove)
using this:
\<exists>a b g1 g2. a < b \<and> (\<forall>x\<in>{a..b}. g2 x \<le> g1 x) \<and> cubeImage C = {(x, y). x \<in> {a..b} \<and> y \<in> {g2 x..g1 x}} \<and> C = (\<lambda>(x, y). ((1 - x) * a + x * b, (1 - y) * g2 ((1 - x) * a + x * b) + y * g1 ((1 - x) * a + x * b))) \<and> g1 piecewise_C1_differentiable_on {a..b} \<and> g2 piecewise_C1_differentiable_on {a..b} \<and> (\<lambda>x. C (x, 0)) = (\<lambda>x. (a + (b - a) * x, g2 (a + (b - a) * x))) \<and> (\<lambda>y. C (1, y)) = (\<lambda>x. (b, g2 b + x *\<^sub>R (g1 b - g2 b))) \<and> (\<lambda>x. C (x, 1)) = (\<lambda>x. (a + (b - a) * x, g1 (a + (b - a) * x))) \<and> (\<lambda>y. C (0, y)) = (\<lambda>x. (a, g2 a + x *\<^sub>R (g1 a - g2 a)))

goal (1 subgoal):
 1. (\<And>a b g2 g1. \<lbrakk>a < b; \<forall>x\<in>{a..b}. g2 x \<le> g1 x; cubeImage C = {(x, y). x \<in> {a..b} \<and> y \<in> {g2 x..g1 x}}; C = (\<lambda>(x, y). ((1 - x) * a + x * b, (1 - y) * g2 ((1 - x) * a + x * b) + y * g1 ((1 - x) * a + x * b))); g1 piecewise_C1_differentiable_on {a..b}; g2 piecewise_C1_differentiable_on {a..b}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
a < b
\<forall>x\<in>{a..b}. g2 x \<le> g1 x
cubeImage C = {(x, y). x \<in> {a..b} \<and> y \<in> {g2 x..g1 x}}
C = (\<lambda>(x, y). ((1 - x) * a + x * b, (1 - y) * g2 ((1 - x) * a + x * b) + y * g1 ((1 - x) * a + x * b)))
g1 piecewise_C1_differentiable_on {a..b}
g2 piecewise_C1_differentiable_on {a..b}

goal (1 subgoal):
 1. \<exists>a b. a < b \<and> (\<exists>g1 g2. (\<forall>x\<in>{a..b}. g2 x \<le> g1 x) \<and> prod.swap \<circ> C \<circ> prod.swap = (\<lambda>(y, x). ((1 - y) * g2 ((1 - x) * a + x * b) + y * g1 ((1 - x) * a + x * b), (1 - x) * a + x * b)) \<and> g1 piecewise_C1_differentiable_on {a..b} \<and> g2 piecewise_C1_differentiable_on {a..b})
[PROOF STEP]
show "\<exists>a b. a < b \<and>
              (\<exists>g1 g2. (\<forall>x\<in>{a..b}. g2 x \<le> g1 x) \<and>
                  prod.swap \<circ> C \<circ> prod.swap =
                  (\<lambda>(y, x). ((1 - y) * g2 ((1 - x) * a + x * b) + y * g1 ((1 - x) * a + x * b), (1 - x) * a + x * b)) \<and>
                  g1 piecewise_C1_differentiable_on {a..b} \<and> g2 piecewise_C1_differentiable_on {a..b})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>a b. a < b \<and> (\<exists>g1 g2. (\<forall>x\<in>{a..b}. g2 x \<le> g1 x) \<and> prod.swap \<circ> C \<circ> prod.swap = (\<lambda>(y, x). ((1 - y) * g2 ((1 - x) * a + x * b) + y * g1 ((1 - x) * a + x * b), (1 - x) * a + x * b)) \<and> g1 piecewise_C1_differentiable_on {a..b} \<and> g2 piecewise_C1_differentiable_on {a..b})
[PROOF STEP]
using C
[PROOF STATE]
proof (prove)
using this:
a < b
\<forall>x\<in>{a..b}. g2 x \<le> g1 x
cubeImage C = {(x, y). x \<in> {a..b} \<and> y \<in> {g2 x..g1 x}}
C = (\<lambda>(x, y). ((1 - x) * a + x * b, (1 - y) * g2 ((1 - x) * a + x * b) + y * g1 ((1 - x) * a + x * b)))
g1 piecewise_C1_differentiable_on {a..b}
g2 piecewise_C1_differentiable_on {a..b}

goal (1 subgoal):
 1. \<exists>a b. a < b \<and> (\<exists>g1 g2. (\<forall>x\<in>{a..b}. g2 x \<le> g1 x) \<and> prod.swap \<circ> C \<circ> prod.swap = (\<lambda>(y, x). ((1 - y) * g2 ((1 - x) * a + x * b) + y * g1 ((1 - x) * a + x * b), (1 - x) * a + x * b)) \<and> g1 piecewise_C1_differentiable_on {a..b} \<and> g2 piecewise_C1_differentiable_on {a..b})
[PROOF STEP]
by (fastforce simp add: prod.swap_def o_def)
[PROOF STATE]
proof (state)
this:
\<exists>a b. a < b \<and> (\<exists>g1 g2. (\<forall>x\<in>{a..b}. g2 x \<le> g1 x) \<and> prod.swap \<circ> C \<circ> prod.swap = (\<lambda>(y, x). ((1 - y) * g2 ((1 - x) * a + x * b) + y * g1 ((1 - x) * a + x * b), (1 - x) * a + x * b)) \<and> g1 piecewise_C1_differentiable_on {a..b} \<and> g2 piecewise_C1_differentiable_on {a..b})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma continuous_tanh [continuous_intros]:
  fixes f :: "_ \<Rightarrow>'a::{real_normed_field,banach}"
  assumes "continuous F f" "cosh (f (Lim F (\<lambda>x. x))) \<noteq> 0"
  shows   "continuous F (\<lambda>x. tanh (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous F (\<lambda>x. tanh (f x))
[PROOF STEP]
unfolding tanh_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous F (\<lambda>x. sinh (f x) / cosh (f x))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
continuous F f
cosh (f (Lim F (\<lambda>x. x))) \<noteq> (0::'a)

goal (1 subgoal):
 1. continuous F (\<lambda>x. sinh (f x) / cosh (f x))
[PROOF STEP]
by (intro continuous_intros continuous_divide) auto


[STATEMENT]
lemma T_Mprefix:
 "T(\<box> x \<in> A \<rightarrow> P x)={s. s=[] \<or> (\<exists> a. a\<in>A \<and> s\<noteq>[] \<and> hd s = ev a \<and> tl s \<in> T(P a))}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. T (Mprefix A P) = {s. s = [] \<or> (\<exists>a. a \<in> A \<and> s \<noteq> [] \<and> hd s = ev a \<and> tl s \<in> T (P a))}
[PROOF STEP]
by(auto simp: T_F_spec[symmetric] F_Mprefix)


[STATEMENT]
lemma poly_pullbackE:
  assumes "is_poly_tuple n fs"
  assumes "length fs = m"
  assumes "S \<subseteq> carrier (R\<^bsup>m\<^esup>)"
  shows "poly_tuple_pullback n S fs \<subseteq> carrier (R\<^bsup>n\<^esup>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_tuple_pullback n S fs \<subseteq> carrier (R\<^bsup>n\<^esup>)
[PROOF STEP]
using poly_tuple_pullback_def assms
[PROOF STATE]
proof (prove)
using this:
poly_tuple_pullback ?n ?S ?fs = poly_tuple_eval ?fs -` ?S \<inter> carrier (R\<^bsup>?n\<^esup>)
is_poly_tuple n fs
length fs = m
S \<subseteq> carrier (R\<^bsup>m\<^esup>)

goal (1 subgoal):
 1. poly_tuple_pullback n S fs \<subseteq> carrier (R\<^bsup>n\<^esup>)
[PROOF STEP]
by blast


[STATEMENT]
lemma tendsto_Sup_at':
  fixes f :: "'a llist \<Rightarrow> 'b::ccpo_topology"
  assumes f: "\<And>x y. x \<le> y \<Longrightarrow> lfinite x \<Longrightarrow> lfinite y \<Longrightarrow> f x \<le> f y"
  shows "(f \<longlongrightarrow> (Sup (f`{xs. lfinite xs \<and> xs \<le> l}))) (at' l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<longlongrightarrow> \<Squnion> (f ` {xs. lfinite xs \<and> xs \<le> l})) (at' l)
[PROOF STEP]
proof (rule topological_tendstoI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; \<Squnion> (f ` {xs. lfinite xs \<and> xs \<le> l}) \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in at' l. f x \<in> S
[PROOF STEP]
let ?F = "{xs. lfinite xs \<and> xs \<le> l}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; \<Squnion> (f ` {xs. lfinite xs \<and> xs \<le> l}) \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in at' l. f x \<in> S
[PROOF STEP]
have ch_F: "chain (f`?F)" "f`?F \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. chain (f ` {xs. lfinite xs \<and> xs \<le> l}) &&& f ` {xs. lfinite xs \<and> xs \<le> l} \<noteq> {}
[PROOF STEP]
by (rule chain_imageI[OF chain_subset, OF lprefixes_chain]) (auto simp: f)
[PROOF STATE]
proof (state)
this:
chain (f ` {xs. lfinite xs \<and> xs \<le> l})
f ` {xs. lfinite xs \<and> xs \<le> l} \<noteq> {}

goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; \<Squnion> (f ` {xs. lfinite xs \<and> xs \<le> l}) \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in at' l. f x \<in> S
[PROOF STEP]
fix A
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; \<Squnion> (f ` {xs. lfinite xs \<and> xs \<le> l}) \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in at' l. f x \<in> S
[PROOF STEP]
assume A: "open A" "Sup (f`?F) \<in> A"
[PROOF STATE]
proof (state)
this:
open A
\<Squnion> (f ` {xs. lfinite xs \<and> xs \<le> l}) \<in> A

goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; \<Squnion> (f ` {xs. lfinite xs \<and> xs \<le> l}) \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in at' l. f x \<in> S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
open A
\<Squnion> (f ` {xs. lfinite xs \<and> xs \<le> l}) \<in> A
[PROOF STEP]
show "eventually (\<lambda>x. f x \<in> A) (at' l)"
[PROOF STATE]
proof (prove)
using this:
open A
\<Squnion> (f ` {xs. lfinite xs \<and> xs \<le> l}) \<in> A

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at' l. f x \<in> A
[PROOF STEP]
using open_ccpoD[OF _ ch_F, OF A]
[PROOF STATE]
proof (prove)
using this:
open A
\<Squnion> (f ` {xs. lfinite xs \<and> xs \<le> l}) \<in> A
\<exists>c\<in>f ` {xs. lfinite xs \<and> xs \<le> l}. \<forall>c'\<in>f ` {xs. lfinite xs \<and> xs \<le> l}. c \<le> c' \<longrightarrow> c' \<in> A

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at' l. f x \<in> A
[PROOF STEP]
by (auto simp: eventually_at'_llist f simp del: le_llist_conv_lprefix)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at' l. f x \<in> A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_length_filter_compl:
  "length(filter P xs) + length(filter (\<lambda>x. \<not>P x) xs) = length xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (filter P xs) + length (filter (\<lambda>x. \<not> P x) xs) = length xs
[PROOF STEP]
by(induct xs) simp_all


[STATEMENT]
lemma distinct_alt2:
  "distinct_relations (Join l r)
    \<longleftrightarrow> distinct_relations l \<and> distinct_relations r \<and> relations l \<inter> relations r = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct_relations (Join l r) = (distinct_relations l \<and> distinct_relations r \<and> relations l \<inter> relations r = {})
[PROOF STEP]
using distinct_relations_disjoint distinct_trans_l distinct_trans_r
[PROOF STATE]
proof (prove)
using this:
distinct_relations (Join ?l ?r) \<Longrightarrow> relations ?l \<inter> relations ?r = {}
distinct_relations (Join ?l ?r) \<Longrightarrow> distinct_relations ?l
distinct_relations (Join ?l ?r) \<Longrightarrow> distinct_relations ?r

goal (1 subgoal):
 1. distinct_relations (Join l r) = (distinct_relations l \<and> distinct_relations r \<and> relations l \<inter> relations r = {})
[PROOF STEP]
by (auto elim: distinct_and_disjoint_impl_distinct)


[STATEMENT]
lemma (in abelian_group) a_setmult_rcos_assoc:
     "\<lbrakk>H \<subseteq> carrier G; K \<subseteq> carrier G; x \<in> carrier G\<rbrakk>
      \<Longrightarrow> H <+> (K +> x) = (H <+> K) +> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>H \<subseteq> carrier G; K \<subseteq> carrier G; x \<in> carrier G\<rbrakk> \<Longrightarrow> H <+> (K +> x) = H <+> K +> x
[PROOF STEP]
by (rule group.setmult_rcos_assoc [OF a_group,
    folded set_add_def a_r_coset_def, simplified monoid_record_simps])


[STATEMENT]
lemma ns_mul_ext_intro:
  assumes "xs = mset xs1 + mset xs2"
  and "ys = mset ys1 + mset ys2"
  and "length xs1 = length ys1"
  and "\<And>i. i < length ys1 \<Longrightarrow> (xs1 ! i, ys1 ! i) \<in> NS"
  and "\<And>y. y \<in> set ys2 \<Longrightarrow> \<exists>x \<in> set xs2. (x, y) \<in> S"
shows "(xs, ys) \<in> ns_mul_ext NS S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (xs, ys) \<in> ns_mul_ext NS S
[PROOF STEP]
by (rule ns_mul_extI[OF assms(1-2) multpw_listI[OF assms(3)]], insert assms(4-), auto)


[STATEMENT]
lemma dom_char:
    shows "dom \<mu> = (if arr \<mu> then
                      MkCell (Src \<mu>) (Trg \<mu>) (partial_magma.dom (Hom (Src \<mu>) (Trg \<mu>)) (Map \<mu>))
                    else Null)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.dom \<mu> = (if arr \<mu> then MkCell (Src \<mu>) (Trg \<mu>) (partial_magma.dom (Hom (Src \<mu>) (Trg \<mu>)) (Map \<mu>)) else Null)
[PROOF STEP]
by (metis MkCell_in_domains arr_char dom_in_domains domain_unique has_domain_iff_arr
          dom_def null_char)


[STATEMENT]
lemma foldr_conj_map: "Ifm bs (foldr conj (map f xs) T) = (\<forall> x \<in> set xs. Ifm bs (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ifm bs (foldr MIR.conj (map f xs) T) = (\<forall>x\<in>set xs. Ifm bs (f x))
[PROOF STEP]
by(induct xs, simp_all)


[STATEMENT]
lemma unbounded_line_closed_segment: "closed_segment a b \<subseteq> unbounded_line a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed_segment a b \<subseteq> unbounded_line a b
[PROOF STEP]
unfolding unbounded_line_def closed_segment_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(1 - u) *\<^sub>R a + u *\<^sub>R b |u. 0 \<le> u \<and> u \<le> 1} \<subseteq> {x. \<exists>u. x = (1 - u) *\<^sub>R a + u *\<^sub>R b}
[PROOF STEP]
by auto


[STATEMENT]
lemma (in Corps) npowf_exp_1_add:"\<lbrakk>x \<in> carrier K; x \<noteq> \<zero>\<rbrakk> \<Longrightarrow>
                                        x\<^bsub>K\<^esub>\<^bsup>(1 + j)\<^esup> = x \<cdot>\<^sub>r x\<^bsub>K\<^esub>\<^bsup>j\<^esup>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier K; x \<noteq> \<zero>\<rbrakk> \<Longrightarrow> x\<^bsub>K\<^esub>\<^bsup>(1 + j)\<^esup> = x \<cdot>\<^sub>r x\<^bsub>K\<^esub>\<^bsup>j\<^esup>
[PROOF STEP]
apply (simp add:npowf_exp_add[of "x" "1" "j"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier K; x \<noteq> \<zero>\<rbrakk> \<Longrightarrow> x\<^bsub>K\<^esub>\<^bsup>1\<^esup> \<cdot>\<^sub>r x\<^bsub>K\<^esub>\<^bsup>j\<^esup> = x \<cdot>\<^sub>r x\<^bsub>K\<^esub>\<^bsup>j\<^esup>
[PROOF STEP]
apply (cut_tac field_is_ring)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier K; x \<noteq> \<zero>; Ring K\<rbrakk> \<Longrightarrow> x\<^bsub>K\<^esub>\<^bsup>1\<^esup> \<cdot>\<^sub>r x\<^bsub>K\<^esub>\<^bsup>j\<^esup> = x \<cdot>\<^sub>r x\<^bsub>K\<^esub>\<^bsup>j\<^esup>
[PROOF STEP]
apply (simp add:npowf_def, simp add:Ring.ring_l_one)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma set_integral_uminus: "set_integrable M A f \<Longrightarrow> LINT x:A|M. - f x = - (LINT x:A|M. f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_integrable M A f \<Longrightarrow> LINT x:A|M. - f x = - set_lebesgue_integral M A f
[PROOF STEP]
unfolding set_integrable_def set_lebesgue_integral_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable M (\<lambda>x. indicat_real A x *\<^sub>R f x) \<Longrightarrow> LINT x|M. indicat_real A x *\<^sub>R - f x = - (LINT x|M. indicat_real A x *\<^sub>R f x)
[PROOF STEP]
by (subst integral_minus[symmetric]) simp_all


[STATEMENT]
lemma basis_for_Span_ex : "set vs \<subseteq> V \<Longrightarrow> \<exists>us. basis_for (Span vs) us"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set vs \<subseteq> V \<Longrightarrow> \<exists>us. set us \<subseteq> RSpan vs \<and> RSpan vs = RSpan us \<and> R_lin_independent us
[PROOF STEP]
using spanset_contains_basis
[PROOF STATE]
proof (prove)
using this:
set ?vs \<subseteq> V \<Longrightarrow> \<exists>us. set us \<subseteq> set ?vs \<and> set us \<subseteq> RSpan ?vs \<and> RSpan ?vs = RSpan us \<and> R_lin_independent us

goal (1 subgoal):
 1. set vs \<subseteq> V \<Longrightarrow> \<exists>us. set us \<subseteq> RSpan vs \<and> RSpan vs = RSpan us \<and> R_lin_independent us
[PROOF STEP]
by fastforce


[STATEMENT]
lemma total_onI:
  "(\<And>x y. \<lbrakk> x \<in> A; y \<in> A \<rbrakk> \<Longrightarrow> (x, y) \<in> r \<or> x = y \<or> (y, x) \<in> r) \<Longrightarrow> total_on A r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x y. \<lbrakk>x \<in> A; y \<in> A\<rbrakk> \<Longrightarrow> (x, y) \<in> r \<or> x = y \<or> (y, x) \<in> r) \<Longrightarrow> total_on A r
[PROOF STEP]
unfolding total_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x y. \<lbrakk>x \<in> A; y \<in> A\<rbrakk> \<Longrightarrow> (x, y) \<in> r \<or> x = y \<or> (y, x) \<in> r) \<Longrightarrow> \<forall>x\<in>A. \<forall>y\<in>A. x \<noteq> y \<longrightarrow> (x, y) \<in> r \<or> (y, x) \<in> r
[PROOF STEP]
by blast


[STATEMENT]
lemma mat_trace_mult_sm [simp]:
  shows "mat_trace (k *\<^sub>s\<^sub>m M) = k * mat_trace M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_trace (k *\<^sub>s\<^sub>m M) = k * mat_trace M
[PROOF STEP]
by (cases M) (simp add: field_simps)