[STATEMENT]
lemma ex_replicate_mset_if_all_elems_eq:
  assumes "\<forall>x \<in># M. x = y"
  shows "\<exists>n. M = replicate_mset n y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n. M = replicate_mset n y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>#M. x = y

goal (1 subgoal):
 1. \<exists>n. M = replicate_mset n y
[PROOF STEP]
by (metis count_replicate_mset mem_Collect_eq multiset_eqI neq0_conv set_mset_def)


[STATEMENT]
lemma Lim_bilinear:
  assumes "(f \<longlongrightarrow> l) net"
    and "(g \<longlongrightarrow> m) net"
    and "bounded_bilinear h"
  shows "((\<lambda>x. h (f x) (g x)) \<longlongrightarrow> (h l m)) net"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. h (f x) (g x)) \<longlongrightarrow> h l m) net
[PROOF STEP]
using \<open>bounded_bilinear h\<close> \<open>(f \<longlongrightarrow> l) net\<close> \<open>(g \<longlongrightarrow> m) net\<close>
[PROOF STATE]
proof (prove)
using this:
bounded_bilinear h
(f \<longlongrightarrow> l) net
(g \<longlongrightarrow> m) net

goal (1 subgoal):
 1. ((\<lambda>x. h (f x) (g x)) \<longlongrightarrow> h l m) net
[PROOF STEP]
by (rule bounded_bilinear.tendsto)


[STATEMENT]
lemma is_contraction_L: "is_contraction (L p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_contraction (L p)
[PROOF STEP]
unfolding is_contraction_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>l\<ge>0. l < 1 \<and> (\<forall>v u. dist (L p v) (L p u) \<le> l * dist v u)
[PROOF STEP]
using contraction_L disc_lt_one zero_le_disc
[PROOF STATE]
proof (prove)
using this:
dist (L ?p ?v) (L ?p ?u) \<le> l * dist ?v ?u
l < 1
0 \<le> l

goal (1 subgoal):
 1. \<exists>l\<ge>0. l < 1 \<and> (\<forall>v u. dist (L p v) (L p u) \<le> l * dist v u)
[PROOF STEP]
by blast


[STATEMENT]
lemma indets_map_indets_subset: "indets (map_indets f (p::_ \<Rightarrow>\<^sub>0 'a::comm_semiring_1)) \<subseteq> f ` indets p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indets (map_indets f p) \<subseteq> f ` indets p
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> indets (map_indets f p) \<Longrightarrow> x \<in> f ` indets p
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> indets (map_indets f p) \<Longrightarrow> x \<in> f ` indets p
[PROOF STEP]
assume "x \<in> indets (map_indets f p)"
[PROOF STATE]
proof (state)
this:
x \<in> indets (map_indets f p)

goal (1 subgoal):
 1. \<And>x. x \<in> indets (map_indets f p) \<Longrightarrow> x \<in> f ` indets p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> indets (map_indets f p)
[PROOF STEP]
obtain y where "y \<in> indets p" and "x \<in> indets (monomial (1::'a) (Poly_Mapping.single (f y) 1))"
[PROOF STATE]
proof (prove)
using this:
x \<in> indets (map_indets f p)

goal (1 subgoal):
 1. (\<And>y. \<lbrakk>y \<in> indets p; x \<in> indets (monomial (1::'a) (monomial 1 (f y)))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding map_indets_def
[PROOF STATE]
proof (prove)
using this:
x \<in> indets (poly_subst (\<lambda>x. monomial (1::'a) (monomial 1 (f x))) p)

goal (1 subgoal):
 1. (\<And>y. \<lbrakk>y \<in> indets p; x \<in> indets (monomial (1::'a) (monomial 1 (f y)))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (rule in_indets_poly_substE)
[PROOF STATE]
proof (state)
this:
y \<in> indets p
x \<in> indets (monomial (1::'a) (monomial 1 (f y)))

goal (1 subgoal):
 1. \<And>x. x \<in> indets (map_indets f p) \<Longrightarrow> x \<in> f ` indets p
[PROOF STEP]
from this(2)
[PROOF STATE]
proof (chain)
picking this:
x \<in> indets (monomial (1::'a) (monomial 1 (f y)))
[PROOF STEP]
have x: "x = f y"
[PROOF STATE]
proof (prove)
using this:
x \<in> indets (monomial (1::'a) (monomial 1 (f y)))

goal (1 subgoal):
 1. x = f y
[PROOF STEP]
by (simp add: indets_monomial)
[PROOF STATE]
proof (state)
this:
x = f y

goal (1 subgoal):
 1. \<And>x. x \<in> indets (map_indets f p) \<Longrightarrow> x \<in> f ` indets p
[PROOF STEP]
from \<open>y \<in> indets p\<close>
[PROOF STATE]
proof (chain)
picking this:
y \<in> indets p
[PROOF STEP]
show "x \<in> f ` indets p"
[PROOF STATE]
proof (prove)
using this:
y \<in> indets p

goal (1 subgoal):
 1. x \<in> f ` indets p
[PROOF STEP]
unfolding x
[PROOF STATE]
proof (prove)
using this:
y \<in> indets p

goal (1 subgoal):
 1. f y \<in> f ` indets p
[PROOF STEP]
by (rule imageI)
[PROOF STATE]
proof (state)
this:
x \<in> f ` indets p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma newton_sqrt_aux_correct:
  assumes "x \<ge> Discrete.sqrt n"
  shows   "newton_sqrt_aux x n = Discrete.sqrt n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. newton_sqrt_aux x n = Discrete.sqrt n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Discrete.sqrt n \<le> x

goal (1 subgoal):
 1. newton_sqrt_aux x n = Discrete.sqrt n
[PROOF STEP]
proof (induction x n rule: newton_sqrt_aux.induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x n. \<lbrakk>\<And>xa. \<lbrakk>xa = (x + n div x) div 2; xa < x; Discrete.sqrt n \<le> xa\<rbrakk> \<Longrightarrow> newton_sqrt_aux xa n = Discrete.sqrt n; Discrete.sqrt n \<le> x\<rbrakk> \<Longrightarrow> newton_sqrt_aux x n = Discrete.sqrt n
[PROOF STEP]
case (1 x n)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?xa = (x + n div x) div 2; ?xa < x; Discrete.sqrt n \<le> ?xa\<rbrakk> \<Longrightarrow> newton_sqrt_aux ?xa n = Discrete.sqrt n
Discrete.sqrt n \<le> x

goal (1 subgoal):
 1. \<And>x n. \<lbrakk>\<And>xa. \<lbrakk>xa = (x + n div x) div 2; xa < x; Discrete.sqrt n \<le> xa\<rbrakk> \<Longrightarrow> newton_sqrt_aux xa n = Discrete.sqrt n; Discrete.sqrt n \<le> x\<rbrakk> \<Longrightarrow> newton_sqrt_aux x n = Discrete.sqrt n
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. newton_sqrt_aux x n = Discrete.sqrt n
[PROOF STEP]
proof (cases "x = Discrete.sqrt n")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x = Discrete.sqrt n \<Longrightarrow> newton_sqrt_aux x n = Discrete.sqrt n
 2. x \<noteq> Discrete.sqrt n \<Longrightarrow> newton_sqrt_aux x n = Discrete.sqrt n
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
x = Discrete.sqrt n

goal (2 subgoals):
 1. x = Discrete.sqrt n \<Longrightarrow> newton_sqrt_aux x n = Discrete.sqrt n
 2. x \<noteq> Discrete.sqrt n \<Longrightarrow> newton_sqrt_aux x n = Discrete.sqrt n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x = Discrete.sqrt n
[PROOF STEP]
have "(x ^ 2) div x \<le> n div x"
[PROOF STATE]
proof (prove)
using this:
x = Discrete.sqrt n

goal (1 subgoal):
 1. x\<^sup>2 div x \<le> n div x
[PROOF STEP]
by (intro div_le_mono) simp_all
[PROOF STATE]
proof (state)
this:
x\<^sup>2 div x \<le> n div x

goal (2 subgoals):
 1. x = Discrete.sqrt n \<Longrightarrow> newton_sqrt_aux x n = Discrete.sqrt n
 2. x \<noteq> Discrete.sqrt n \<Longrightarrow> newton_sqrt_aux x n = Discrete.sqrt n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x\<^sup>2 div x \<le> n div x

goal (2 subgoals):
 1. x = Discrete.sqrt n \<Longrightarrow> newton_sqrt_aux x n = Discrete.sqrt n
 2. x \<noteq> Discrete.sqrt n \<Longrightarrow> newton_sqrt_aux x n = Discrete.sqrt n
[PROOF STEP]
have "(x ^ 2) div x = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x\<^sup>2 div x = x
[PROOF STEP]
by (simp add: power2_eq_square)
[PROOF STATE]
proof (state)
this:
x\<^sup>2 div x = x

goal (2 subgoals):
 1. x = Discrete.sqrt n \<Longrightarrow> newton_sqrt_aux x n = Discrete.sqrt n
 2. x \<noteq> Discrete.sqrt n \<Longrightarrow> newton_sqrt_aux x n = Discrete.sqrt n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x \<le> n div x
[PROOF STEP]
have "(x + n div x) div 2 \<ge> x"
[PROOF STATE]
proof (prove)
using this:
x \<le> n div x

goal (1 subgoal):
 1. x \<le> (x + n div x) div 2
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
x \<le> (x + n div x) div 2

goal (2 subgoals):
 1. x = Discrete.sqrt n \<Longrightarrow> newton_sqrt_aux x n = Discrete.sqrt n
 2. x \<noteq> Discrete.sqrt n \<Longrightarrow> newton_sqrt_aux x n = Discrete.sqrt n
[PROOF STEP]
with True
[PROOF STATE]
proof (chain)
picking this:
x = Discrete.sqrt n
x \<le> (x + n div x) div 2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x = Discrete.sqrt n
x \<le> (x + n div x) div 2

goal (1 subgoal):
 1. newton_sqrt_aux x n = Discrete.sqrt n
[PROOF STEP]
by (auto simp: newton_sqrt_aux_simps)
[PROOF STATE]
proof (state)
this:
newton_sqrt_aux x n = Discrete.sqrt n

goal (1 subgoal):
 1. x \<noteq> Discrete.sqrt n \<Longrightarrow> newton_sqrt_aux x n = Discrete.sqrt n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<noteq> Discrete.sqrt n \<Longrightarrow> newton_sqrt_aux x n = Discrete.sqrt n
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
x \<noteq> Discrete.sqrt n

goal (1 subgoal):
 1. x \<noteq> Discrete.sqrt n \<Longrightarrow> newton_sqrt_aux x n = Discrete.sqrt n
[PROOF STEP]
with "1.prems"
[PROOF STATE]
proof (chain)
picking this:
Discrete.sqrt n \<le> x
x \<noteq> Discrete.sqrt n
[PROOF STEP]
have x_gt_sqrt: "x > Discrete.sqrt n"
[PROOF STATE]
proof (prove)
using this:
Discrete.sqrt n \<le> x
x \<noteq> Discrete.sqrt n

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

goal (1 subgoal):
 1. x \<noteq> Discrete.sqrt n \<Longrightarrow> newton_sqrt_aux x n = Discrete.sqrt n
[PROOF STEP]
with Discrete.le_sqrt_iff[of x n]
[PROOF STATE]
proof (chain)
picking this:
(x \<le> Discrete.sqrt n) = (x\<^sup>2 \<le> n)
Discrete.sqrt n < x
[PROOF STEP]
have "n < x ^ 2"
[PROOF STATE]
proof (prove)
using this:
(x \<le> Discrete.sqrt n) = (x\<^sup>2 \<le> n)
Discrete.sqrt n < x

goal (1 subgoal):
 1. n < x\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
n < x\<^sup>2

goal (1 subgoal):
 1. x \<noteq> Discrete.sqrt n \<Longrightarrow> newton_sqrt_aux x n = Discrete.sqrt n
[PROOF STEP]
have "x * (n div x) \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x * (n div x) \<le> n
[PROOF STEP]
using mult_div_mod_eq[of x n]
[PROOF STATE]
proof (prove)
using this:
x * (n div x) + n mod x = n

goal (1 subgoal):
 1. x * (n div x) \<le> n
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
x * (n div x) \<le> n

goal (1 subgoal):
 1. x \<noteq> Discrete.sqrt n \<Longrightarrow> newton_sqrt_aux x n = Discrete.sqrt n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x * (n div x) \<le> n

goal (1 subgoal):
 1. x \<noteq> Discrete.sqrt n \<Longrightarrow> newton_sqrt_aux x n = Discrete.sqrt n
[PROOF STEP]
have "\<dots> < x ^ 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < x\<^sup>2
[PROOF STEP]
using Discrete.le_sqrt_iff[of x n] and x_gt_sqrt
[PROOF STATE]
proof (prove)
using this:
(x \<le> Discrete.sqrt n) = (x\<^sup>2 \<le> n)
Discrete.sqrt n < x

goal (1 subgoal):
 1. n < x\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
n < x\<^sup>2

goal (1 subgoal):
 1. x \<noteq> Discrete.sqrt n \<Longrightarrow> newton_sqrt_aux x n = Discrete.sqrt n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
n < x\<^sup>2

goal (1 subgoal):
 1. x \<noteq> Discrete.sqrt n \<Longrightarrow> newton_sqrt_aux x n = Discrete.sqrt n
[PROOF STEP]
have "\<dots> = x * x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x\<^sup>2 = x * x
[PROOF STEP]
by (simp add: power2_eq_square)
[PROOF STATE]
proof (state)
this:
x\<^sup>2 = x * x

goal (1 subgoal):
 1. x \<noteq> Discrete.sqrt n \<Longrightarrow> newton_sqrt_aux x n = Discrete.sqrt n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x * (n div x) < x * x
[PROOF STEP]
have "n div x < x"
[PROOF STATE]
proof (prove)
using this:
x * (n div x) < x * x

goal (1 subgoal):
 1. n div x < x
[PROOF STEP]
by (subst (asm) mult_less_cancel1) auto
[PROOF STATE]
proof (state)
this:
n div x < x

goal (1 subgoal):
 1. x \<noteq> Discrete.sqrt n \<Longrightarrow> newton_sqrt_aux x n = Discrete.sqrt n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n div x < x
[PROOF STEP]
have step_decreasing: "(x + n div x) div 2 < x"
[PROOF STATE]
proof (prove)
using this:
n div x < x

goal (1 subgoal):
 1. (x + n div x) div 2 < x
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
(x + n div x) div 2 < x

goal (1 subgoal):
 1. x \<noteq> Discrete.sqrt n \<Longrightarrow> newton_sqrt_aux x n = Discrete.sqrt n
[PROOF STEP]
with x_gt_sqrt
[PROOF STATE]
proof (chain)
picking this:
Discrete.sqrt n < x
(x + n div x) div 2 < x
[PROOF STEP]
have step_ge_sqrt: "(x + n div x) div 2 \<ge> Discrete.sqrt n"
[PROOF STATE]
proof (prove)
using this:
Discrete.sqrt n < x
(x + n div x) div 2 < x

goal (1 subgoal):
 1. Discrete.sqrt n \<le> (x + n div x) div 2
[PROOF STEP]
by (simp add: heron_step)
[PROOF STATE]
proof (state)
this:
Discrete.sqrt n \<le> (x + n div x) div 2

goal (1 subgoal):
 1. x \<noteq> Discrete.sqrt n \<Longrightarrow> newton_sqrt_aux x n = Discrete.sqrt n
[PROOF STEP]
from step_decreasing
[PROOF STATE]
proof (chain)
picking this:
(x + n div x) div 2 < x
[PROOF STEP]
have "newton_sqrt_aux x n = newton_sqrt_aux ((x + n div x) div 2) n"
[PROOF STATE]
proof (prove)
using this:
(x + n div x) div 2 < x

goal (1 subgoal):
 1. newton_sqrt_aux x n = newton_sqrt_aux ((x + n div x) div 2) n
[PROOF STEP]
by (simp add: newton_sqrt_aux_simps)
[PROOF STATE]
proof (state)
this:
newton_sqrt_aux x n = newton_sqrt_aux ((x + n div x) div 2) n

goal (1 subgoal):
 1. x \<noteq> Discrete.sqrt n \<Longrightarrow> newton_sqrt_aux x n = Discrete.sqrt n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
newton_sqrt_aux x n = newton_sqrt_aux ((x + n div x) div 2) n

goal (1 subgoal):
 1. x \<noteq> Discrete.sqrt n \<Longrightarrow> newton_sqrt_aux x n = Discrete.sqrt n
[PROOF STEP]
have "\<dots> = Discrete.sqrt n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. newton_sqrt_aux ((x + n div x) div 2) n = Discrete.sqrt n
[PROOF STEP]
by (intro "1.IH" step_decreasing step_ge_sqrt) simp_all
[PROOF STATE]
proof (state)
this:
newton_sqrt_aux ((x + n div x) div 2) n = Discrete.sqrt n

goal (1 subgoal):
 1. x \<noteq> Discrete.sqrt n \<Longrightarrow> newton_sqrt_aux x n = Discrete.sqrt n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
newton_sqrt_aux x n = Discrete.sqrt n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
newton_sqrt_aux x n = Discrete.sqrt n

goal (1 subgoal):
 1. newton_sqrt_aux x n = Discrete.sqrt n
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
newton_sqrt_aux x n = Discrete.sqrt n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
newton_sqrt_aux x n = Discrete.sqrt n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma list_of_lconcat:
  assumes "lfinite xss"
  and "\<forall>xs \<in> lset xss. lfinite xs"
  shows "list_of (lconcat xss) = concat (list_of (lmap list_of xss))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_of (lconcat xss) = concat (list_of (lmap list_of xss))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
lfinite xss
\<forall>xs\<in>lset xss. lfinite xs

goal (1 subgoal):
 1. list_of (lconcat xss) = concat (list_of (lmap list_of xss))
[PROOF STEP]
by induct(simp_all add: list_of_lappend)


[STATEMENT]
lemma bv_mapzip_Cons [simp]: "length w1 = length w2 ==>
    bv_mapzip f (x#w1) (y#w2) = f x y # bv_mapzip f w1 w2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length w1 = length w2 \<Longrightarrow> bv_mapzip f (x # w1) (y # w2) = f x y # bv_mapzip f w1 w2
[PROOF STEP]
by (simp add: bv_mapzip_def Let_def)


[STATEMENT]
lemma floor_of_int [simp]: "\<lfloor>of_int z\<rfloor> = z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lfloor>of_int z\<rfloor> = z
[PROOF STEP]
by (rule floor_unique) simp_all


[STATEMENT]
lemma lim_log_over_n [tendsto_intros]:
  "(\<lambda>n. log k n/n) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. log k (real x) / real x) \<longlonglongrightarrow> 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. log k (real x) / real x) \<longlonglongrightarrow> 0
[PROOF STEP]
have *: "log k n/n = (1/ln k) * (ln n / n)" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. log k n / n = 1 / ln k * (ln n / n)
[PROOF STEP]
unfolding log_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ln n / ln k / n = 1 / ln k * (ln n / n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
log k ?n / ?n = 1 / ln k * (ln ?n / ?n)

goal (1 subgoal):
 1. (\<lambda>x. log k (real x) / real x) \<longlonglongrightarrow> 0
[PROOF STEP]
have "(\<lambda>n. (1/ln k) * (ln n / n)) \<longlonglongrightarrow> (1/ln k) * 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. 1 / ln k * (ln (real x) / real x)) \<longlonglongrightarrow> 1 / ln k * 0
[PROOF STEP]
by (intro tendsto_intros)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. 1 / ln k * (ln (real x) / real x)) \<longlonglongrightarrow> 1 / ln k * 0

goal (1 subgoal):
 1. (\<lambda>x. log k (real x) / real x) \<longlonglongrightarrow> 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. 1 / ln k * (ln (real x) / real x)) \<longlonglongrightarrow> 1 / ln k * 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. 1 / ln k * (ln (real x) / real x)) \<longlonglongrightarrow> 1 / ln k * 0

goal (1 subgoal):
 1. (\<lambda>x. log k (real x) / real x) \<longlonglongrightarrow> 0
[PROOF STEP]
unfolding *
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. 1 / ln k * (ln (real x) / real x)) \<longlonglongrightarrow> 1 / ln k * 0

goal (1 subgoal):
 1. (\<lambda>x. 1 / ln k * (ln (real x) / real x)) \<longlonglongrightarrow> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. log k (real x) / real x) \<longlonglongrightarrow> 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mset_contains_eq: "(m \<in># M) = ({#m#}+(M-{#m#})=M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (m \<in># M) = ({#m#} + (M - {#m#}) = M)
[PROOF STEP]
using diff_single_trivial
[PROOF STATE]
proof (prove)
using this:
?x \<notin># ?M \<Longrightarrow> ?M - {#?x#} = ?M

goal (1 subgoal):
 1. (m \<in># M) = ({#m#} + (M - {#m#}) = M)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma matrix_left_right_inverse:
  fixes A A' :: "'a::{field}^'n^'n"
  shows "A ** A' = mat 1 \<longleftrightarrow> A' ** A = mat 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A ** A' = mat (1::'a)) = (A' ** A = mat (1::'a))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (A ** A' = mat (1::'a)) = (A' ** A = mat (1::'a))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (A ** A' = mat (1::'a)) = (A' ** A = mat (1::'a))
[PROOF STEP]
fix A A' :: "'a ^'n^'n"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (A ** A' = mat (1::'a)) = (A' ** A = mat (1::'a))
[PROOF STEP]
assume AA': "A ** A' = mat 1"
[PROOF STATE]
proof (state)
this:
A ** A' = mat (1::'a)

goal (1 subgoal):
 1. (A ** A' = mat (1::'a)) = (A' ** A = mat (1::'a))
[PROOF STEP]
have sA: "surj ((*v) A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. surj ((*v) A)
[PROOF STEP]
using AA' matrix_right_invertible_surjective
[PROOF STATE]
proof (prove)
using this:
A ** A' = mat (1::'a)
(\<exists>B. ?A ** B = mat (1::?'a)) = surj ((*v) ?A)

goal (1 subgoal):
 1. surj ((*v) A)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
surj ((*v) A)

goal (1 subgoal):
 1. (A ** A' = mat (1::'a)) = (A' ** A = mat (1::'a))
[PROOF STEP]
from vec.linear_surjective_isomorphism[OF matrix_vector_mul_linear_gen sA]
[PROOF STATE]
proof (chain)
picking this:
vec.dim UNIV = vec.dim UNIV \<Longrightarrow> \<exists>f'. Vector_Spaces.linear (*s) (*s) f' \<and> (\<forall>x. f' (A *v x) = x) \<and> (\<forall>x. A *v f' x = x)
[PROOF STEP]
obtain f' :: "'a ^'n \<Rightarrow> 'a ^'n"
      where f': "Vector_Spaces.linear (*s) (*s) f'" "\<forall>x. f' (A *v x) = x" "\<forall>x. A *v f' x = x"
[PROOF STATE]
proof (prove)
using this:
vec.dim UNIV = vec.dim UNIV \<Longrightarrow> \<exists>f'. Vector_Spaces.linear (*s) (*s) f' \<and> (\<forall>x. f' (A *v x) = x) \<and> (\<forall>x. A *v f' x = x)

goal (1 subgoal):
 1. (\<And>f'. \<lbrakk>Vector_Spaces.linear (*s) (*s) f'; \<forall>x. f' (A *v x) = x; \<forall>x. A *v f' x = x\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Vector_Spaces.linear (*s) (*s) f'
\<forall>x. f' (A *v x) = x
\<forall>x. A *v f' x = x

goal (1 subgoal):
 1. (A ** A' = mat (1::'a)) = (A' ** A = mat (1::'a))
[PROOF STEP]
have th: "matrix f' ** A = mat 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix f' ** A = mat (1::'a)
[PROOF STEP]
by (simp add: matrix_eq matrix_works[OF f'(1)]
          matrix_vector_mul_assoc[symmetric] f'(2)[rule_format])
[PROOF STATE]
proof (state)
this:
matrix f' ** A = mat (1::'a)

goal (1 subgoal):
 1. (A ** A' = mat (1::'a)) = (A' ** A = mat (1::'a))
[PROOF STEP]
hence "(matrix f' ** A) ** A' = mat 1 ** A'"
[PROOF STATE]
proof (prove)
using this:
matrix f' ** A = mat (1::'a)

goal (1 subgoal):
 1. matrix f' ** A ** A' = mat (1::'a) ** A'
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
matrix f' ** A ** A' = mat (1::'a) ** A'

goal (1 subgoal):
 1. (A ** A' = mat (1::'a)) = (A' ** A = mat (1::'a))
[PROOF STEP]
hence "matrix f' = A'"
[PROOF STATE]
proof (prove)
using this:
matrix f' ** A ** A' = mat (1::'a) ** A'

goal (1 subgoal):
 1. matrix f' = A'
[PROOF STEP]
by (simp add: matrix_mul_assoc[symmetric] AA')
[PROOF STATE]
proof (state)
this:
matrix f' = A'

goal (1 subgoal):
 1. (A ** A' = mat (1::'a)) = (A' ** A = mat (1::'a))
[PROOF STEP]
hence "matrix f' ** A = A' ** A"
[PROOF STATE]
proof (prove)
using this:
matrix f' = A'

goal (1 subgoal):
 1. matrix f' ** A = A' ** A
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
matrix f' ** A = A' ** A

goal (1 subgoal):
 1. (A ** A' = mat (1::'a)) = (A' ** A = mat (1::'a))
[PROOF STEP]
hence "A' ** A = mat 1"
[PROOF STATE]
proof (prove)
using this:
matrix f' ** A = A' ** A

goal (1 subgoal):
 1. A' ** A = mat (1::'a)
[PROOF STEP]
by (simp add: th)
[PROOF STATE]
proof (state)
this:
A' ** A = mat (1::'a)

goal (1 subgoal):
 1. (A ** A' = mat (1::'a)) = (A' ** A = mat (1::'a))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?Aa2 ** ?A'a2 = mat (1::'a) \<Longrightarrow> ?A'a2 ** ?Aa2 = mat (1::'a)

goal (1 subgoal):
 1. (A ** A' = mat (1::'a)) = (A' ** A = mat (1::'a))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?Aa2 ** ?A'a2 = mat (1::'a) \<Longrightarrow> ?A'a2 ** ?Aa2 = mat (1::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
?Aa2 ** ?A'a2 = mat (1::'a) \<Longrightarrow> ?A'a2 ** ?Aa2 = mat (1::'a)

goal (1 subgoal):
 1. (A ** A' = mat (1::'a)) = (A' ** A = mat (1::'a))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(A ** A' = mat (1::'a)) = (A' ** A = mat (1::'a))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma top_scene_space: "\<top>\<^sub>S \<in> scene_space"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<top>\<^sub>S \<in> scene_space
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<top>\<^sub>S \<in> scene_space
[PROOF STEP]
have "\<top>\<^sub>S = foldr (\<squnion>\<^sub>S) Vars \<bottom>\<^sub>S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<top>\<^sub>S = \<Squnion>\<^sub>S Vars
[PROOF STEP]
using span_Vars
[PROOF STATE]
proof (prove)
using this:
scene_span Vars

goal (1 subgoal):
 1. \<top>\<^sub>S = \<Squnion>\<^sub>S Vars
[PROOF STEP]
by (simp add: scene_span_def)
[PROOF STATE]
proof (state)
this:
\<top>\<^sub>S = \<Squnion>\<^sub>S Vars

goal (1 subgoal):
 1. \<top>\<^sub>S \<in> scene_space
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<top>\<^sub>S = \<Squnion>\<^sub>S Vars

goal (1 subgoal):
 1. \<top>\<^sub>S \<in> scene_space
[PROOF STEP]
have "... \<in> scene_space"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Squnion>\<^sub>S Vars \<in> scene_space
[PROOF STEP]
by (simp add: scene_space_foldr)
[PROOF STATE]
proof (state)
this:
\<Squnion>\<^sub>S Vars \<in> scene_space

goal (1 subgoal):
 1. \<top>\<^sub>S \<in> scene_space
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<top>\<^sub>S \<in> scene_space
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<top>\<^sub>S \<in> scene_space

goal (1 subgoal):
 1. \<top>\<^sub>S \<in> scene_space
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<top>\<^sub>S \<in> scene_space

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rel_interior_rel_interior:
  fixes S :: "'n::euclidean_space set"
  assumes "convex S"
  shows "rel_interior (rel_interior S) = rel_interior S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_interior (rel_interior S) = rel_interior S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. rel_interior (rel_interior S) = rel_interior S
[PROOF STEP]
have "openin (top_of_set (affine hull (rel_interior S))) (rel_interior S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. openin (top_of_set (affine hull rel_interior S)) (rel_interior S)
[PROOF STEP]
using openin_rel_interior[of S] rel_interior_same_affine_hull[of S] assms
[PROOF STATE]
proof (prove)
using this:
openin (top_of_set (affine hull S)) (rel_interior S)
convex S \<Longrightarrow> affine hull rel_interior S = affine hull S
convex S

goal (1 subgoal):
 1. openin (top_of_set (affine hull rel_interior S)) (rel_interior S)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
openin (top_of_set (affine hull rel_interior S)) (rel_interior S)

goal (1 subgoal):
 1. rel_interior (rel_interior S) = rel_interior S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
openin (top_of_set (affine hull rel_interior S)) (rel_interior S)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
openin (top_of_set (affine hull rel_interior S)) (rel_interior S)

goal (1 subgoal):
 1. rel_interior (rel_interior S) = rel_interior S
[PROOF STEP]
using rel_interior_def
[PROOF STATE]
proof (prove)
using this:
openin (top_of_set (affine hull rel_interior S)) (rel_interior S)
rel_interior ?S = {x. \<exists>T. openin (top_of_set (affine hull ?S)) T \<and> x \<in> T \<and> T \<subseteq> ?S}

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vector_uminus_component [simp]: "(- x)$i = - (x$i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- x) $ i = - x $ i
[PROOF STEP]
unfolding uminus_vec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<chi>i. - x $ i) $ i = - x $ i
[PROOF STEP]
by simp


[STATEMENT]
lemma indets_times_subset: "indets (p * q) \<subseteq> indets p \<union> indets (q::(_ \<Rightarrow>\<^sub>0 _::cancel_comm_monoid_add) \<Rightarrow>\<^sub>0 _)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indets (p * q) \<subseteq> indets p \<union> indets q
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> indets (p * q) \<Longrightarrow> x \<in> indets p \<union> indets q
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> indets (p * q) \<Longrightarrow> x \<in> indets p \<union> indets q
[PROOF STEP]
assume "x \<in> indets (p * q)"
[PROOF STATE]
proof (state)
this:
x \<in> indets (p * q)

goal (1 subgoal):
 1. \<And>x. x \<in> indets (p * q) \<Longrightarrow> x \<in> indets p \<union> indets q
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> indets (p * q)
[PROOF STEP]
obtain t where "t \<in> keys (p * q)" and "x \<in> keys t"
[PROOF STATE]
proof (prove)
using this:
x \<in> indets (p * q)

goal (1 subgoal):
 1. (\<And>t. \<lbrakk>t \<in> keys (p * q); x \<in> keys t\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding indets_def
[PROOF STATE]
proof (prove)
using this:
x \<in> \<Union> (keys ` keys (p * q))

goal (1 subgoal):
 1. (\<And>t. \<lbrakk>t \<in> keys (p * q); x \<in> keys t\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
t \<in> keys (p * q)
x \<in> keys t

goal (1 subgoal):
 1. \<And>x. x \<in> indets (p * q) \<Longrightarrow> x \<in> indets p \<union> indets q
[PROOF STEP]
from this(1)
[PROOF STATE]
proof (chain)
picking this:
t \<in> keys (p * q)
[PROOF STEP]
obtain u v where "u \<in> keys p" "v \<in> keys q" and "t = u + v"
[PROOF STATE]
proof (prove)
using this:
t \<in> keys (p * q)

goal (1 subgoal):
 1. (\<And>u v. \<lbrakk>u \<in> keys p; v \<in> keys q; t = u + v\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (rule in_keys_timesE)
[PROOF STATE]
proof (state)
this:
u \<in> keys p
v \<in> keys q
t = u + v

goal (1 subgoal):
 1. \<And>x. x \<in> indets (p * q) \<Longrightarrow> x \<in> indets p \<union> indets q
[PROOF STEP]
hence "x \<in> keys u \<union> keys v"
[PROOF STATE]
proof (prove)
using this:
u \<in> keys p
v \<in> keys q
t = u + v

goal (1 subgoal):
 1. x \<in> keys u \<union> keys v
[PROOF STEP]
by (metis \<open>x \<in> keys t\<close> Poly_Mapping.keys_add subsetCE)
[PROOF STATE]
proof (state)
this:
x \<in> keys u \<union> keys v

goal (1 subgoal):
 1. \<And>x. x \<in> indets (p * q) \<Longrightarrow> x \<in> indets p \<union> indets q
[PROOF STEP]
thus "x \<in> indets p \<union> indets q"
[PROOF STATE]
proof (prove)
using this:
x \<in> keys u \<union> keys v

goal (1 subgoal):
 1. x \<in> indets p \<union> indets q
[PROOF STEP]
unfolding indets_def
[PROOF STATE]
proof (prove)
using this:
x \<in> keys u \<union> keys v

goal (1 subgoal):
 1. x \<in> \<Union> (keys ` keys p) \<union> \<Union> (keys ` keys q)
[PROOF STEP]
using \<open>u \<in> keys p\<close> \<open>v \<in> keys q\<close>
[PROOF STATE]
proof (prove)
using this:
x \<in> keys u \<union> keys v
u \<in> keys p
v \<in> keys q

goal (1 subgoal):
 1. x \<in> \<Union> (keys ` keys p) \<union> \<Union> (keys ` keys q)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<in> indets p \<union> indets q

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prime_factors_prod:
  assumes "finite A" and "0 \<notin> f ` A"
  shows "prime_factors (prod f A) = \<Union>((prime_factors \<circ> f) ` A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime_factors (prod f A) = \<Union> ((prime_factors \<circ> f) ` A)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A
(0::'b) \<notin> f ` A

goal (1 subgoal):
 1. prime_factors (prod f A) = \<Union> ((prime_factors \<circ> f) ` A)
[PROOF STEP]
by (simp add: prod_unfold_prod_mset prime_factorization_prod_mset)


[STATEMENT]
lemma prodinf_inverse: "convergent_prod f \<Longrightarrow> (\<Prod>n. inverse (f n)) = inverse (\<Prod>n. f n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convergent_prod f \<Longrightarrow> (\<Prod>n. inverse (f n)) = inverse (\<Prod>n. f n)
[PROOF STEP]
by (intro has_prod_unique [symmetric] has_prod_inverse convergent_prod_has_prod)


[STATEMENT]
lemma mset_le_incr_right1: "(a::'a multiset)\<subseteq>#b \<Longrightarrow> a\<subseteq>#b+c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<subseteq># b \<Longrightarrow> a \<subseteq># b + c
[PROOF STEP]
using mset_subset_eq_mono_add[of a b "{#}" c, simplified]
[PROOF STATE]
proof (prove)
using this:
a \<subseteq># b \<Longrightarrow> a \<subseteq># b + c

goal (1 subgoal):
 1. a \<subseteq># b \<Longrightarrow> a \<subseteq># b + c
[PROOF STEP]
.


[STATEMENT]
lemma finite_image_of_finite2:
  fixes f :: "'a::finite \<Rightarrow> 'b::finite \<Rightarrow> 'c"
  shows "finite {f x y |x y. P x y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {f x y |x y. P x y}
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {f x y |x y. P x y}
[PROOF STEP]
have "finite (\<Union>x. {f x y|y. P x y})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (\<Union>x. {f x y |y. P x y})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite (\<Union>x. {f x y |y. P x y})

goal (1 subgoal):
 1. finite {f x y |x y. P x y}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite (\<Union>x. {f x y |y. P x y})

goal (1 subgoal):
 1. finite {f x y |x y. P x y}
[PROOF STEP]
have "{f x y|x y. P x y} = (\<Union>x. {f x y|y. P x y})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {f x y |x y. P x y} = (\<Union>x. {f x y |y. P x y})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{f x y |x y. P x y} = (\<Union>x. {f x y |y. P x y})

goal (1 subgoal):
 1. finite {f x y |x y. P x y}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
finite (\<Union>x. {f x y |y. P x y})
{f x y |x y. P x y} = (\<Union>x. {f x y |y. P x y})
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite (\<Union>x. {f x y |y. P x y})
{f x y |x y. P x y} = (\<Union>x. {f x y |y. P x y})

goal (1 subgoal):
 1. finite {f x y |x y. P x y}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite {f x y |x y. P x y}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in group) generate_idem_fim_Un:
  assumes "\<Union>(f ` A) \<subseteq> carrier G"
  shows "generate G (\<Union>S \<in> A. generate G (f S)) = generate G (\<Union> {generate G {x} |x. x \<in> \<Union> (f ` A)})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. generate G (\<Union>S\<in>A. generate G (f S)) = generate G (\<Union> {generate G {x} |x. x \<in> \<Union> (f ` A)})
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. generate G (\<Union>S\<in>A. generate G (f S)) \<subseteq> generate G (\<Union> {generate G {x} |x. x \<in> \<Union> (f ` A)})
 2. generate G (\<Union> {generate G {x} |x. x \<in> \<Union> (f ` A)}) \<subseteq> generate G (\<Union>S\<in>A. generate G (f S))
[PROOF STEP]
have "\<And>S. S \<in> A \<Longrightarrow> generate G (f S) = generate G (\<Union> {generate G {x} |x. x \<in> f S})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>S. S \<in> A \<Longrightarrow> generate G (f S) = generate G (\<Union> {generate G {x} |x. x \<in> f S})
[PROOF STEP]
using generate_idem_fUn[of f] assms
[PROOF STATE]
proof (prove)
using this:
f ?A \<subseteq> carrier G \<Longrightarrow> generate G (\<Union> {generate G {x} |x. x \<in> f ?A}) = generate G (f ?A)
\<Union> (f ` A) \<subseteq> carrier G

goal (1 subgoal):
 1. \<And>S. S \<in> A \<Longrightarrow> generate G (f S) = generate G (\<Union> {generate G {x} |x. x \<in> f S})
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
?S \<in> A \<Longrightarrow> generate G (f ?S) = generate G (\<Union> {generate G {x} |x. x \<in> f ?S})

goal (2 subgoals):
 1. generate G (\<Union>S\<in>A. generate G (f S)) \<subseteq> generate G (\<Union> {generate G {x} |x. x \<in> \<Union> (f ` A)})
 2. generate G (\<Union> {generate G {x} |x. x \<in> \<Union> (f ` A)}) \<subseteq> generate G (\<Union>S\<in>A. generate G (f S))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?S \<in> A \<Longrightarrow> generate G (f ?S) = generate G (\<Union> {generate G {x} |x. x \<in> f ?S})
[PROOF STEP]
have "generate G (\<Union>S \<in> A. generate G (f S))
           = generate G (\<Union>S \<in> A. generate G (\<Union> {generate G {x} |x. x \<in> f S}))"
[PROOF STATE]
proof (prove)
using this:
?S \<in> A \<Longrightarrow> generate G (f ?S) = generate G (\<Union> {generate G {x} |x. x \<in> f ?S})

goal (1 subgoal):
 1. generate G (\<Union>S\<in>A. generate G (f S)) = generate G (\<Union>S\<in>A. generate G (\<Union> {generate G {x} |x. x \<in> f S}))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
generate G (\<Union>S\<in>A. generate G (f S)) = generate G (\<Union>S\<in>A. generate G (\<Union> {generate G {x} |x. x \<in> f S}))

goal (2 subgoals):
 1. generate G (\<Union>S\<in>A. generate G (f S)) \<subseteq> generate G (\<Union> {generate G {x} |x. x \<in> \<Union> (f ` A)})
 2. generate G (\<Union> {generate G {x} |x. x \<in> \<Union> (f ` A)}) \<subseteq> generate G (\<Union>S\<in>A. generate G (f S))
[PROOF STEP]
have "\<Union> {generate G {x} |x. x \<in> \<Union> (f ` A)} \<subseteq> (\<Union>S\<in>A. generate G (f S))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> {generate G {x} |x. x \<in> \<Union> (f ` A)} \<subseteq> (\<Union>S\<in>A. generate G (f S))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> \<Union> {generate G {x} |x. x \<in> \<Union> (f ` A)} \<Longrightarrow> x \<in> (\<Union>S\<in>A. generate G (f S))
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> \<Union> {generate G {x} |x. x \<in> \<Union> (f ` A)} \<Longrightarrow> x \<in> (\<Union>S\<in>A. generate G (f S))
[PROOF STEP]
assume x: "x \<in> \<Union> {generate G {x} |x. x \<in> \<Union> (f ` A)}"
[PROOF STATE]
proof (state)
this:
x \<in> \<Union> {generate G {x} |x. x \<in> \<Union> (f ` A)}

goal (1 subgoal):
 1. \<And>x. x \<in> \<Union> {generate G {x} |x. x \<in> \<Union> (f ` A)} \<Longrightarrow> x \<in> (\<Union>S\<in>A. generate G (f S))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> \<Union> {generate G {x} |x. x \<in> \<Union> (f ` A)}
[PROOF STEP]
obtain a where a: "x \<in> generate G {a}" "a \<in> \<Union> (f ` A)"
[PROOF STATE]
proof (prove)
using this:
x \<in> \<Union> {generate G {x} |x. x \<in> \<Union> (f ` A)}

goal (1 subgoal):
 1. (\<And>a. \<lbrakk>x \<in> generate G {a}; a \<in> \<Union> (f ` A)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<in> generate G {a}
a \<in> \<Union> (f ` A)

goal (1 subgoal):
 1. \<And>x. x \<in> \<Union> {generate G {x} |x. x \<in> \<Union> (f ` A)} \<Longrightarrow> x \<in> (\<Union>S\<in>A. generate G (f S))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> generate G {a}
a \<in> \<Union> (f ` A)
[PROOF STEP]
obtain M where M: "a \<in> f M" "M \<in> A"
[PROOF STATE]
proof (prove)
using this:
x \<in> generate G {a}
a \<in> \<Union> (f ` A)

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

goal (1 subgoal):
 1. \<And>x. x \<in> \<Union> {generate G {x} |x. x \<in> \<Union> (f ` A)} \<Longrightarrow> x \<in> (\<Union>S\<in>A. generate G (f S))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<in> f M
M \<in> A
[PROOF STEP]
have "generate G {a} \<subseteq> generate G (f M)"
[PROOF STATE]
proof (prove)
using this:
a \<in> f M
M \<in> A

goal (1 subgoal):
 1. generate G {a} \<subseteq> generate G (f M)
[PROOF STEP]
using generate.incl[OF M(1), of G] mono_generate[of "{a}" "generate G (f M)"]
            generate_idem assms
[PROOF STATE]
proof (prove)
using this:
a \<in> f M
M \<in> A
a \<in> generate G (f M)
{a} \<subseteq> generate G (f M) \<Longrightarrow> generate G {a} \<subseteq> generate G (generate G (f M))
?A \<subseteq> carrier G \<Longrightarrow> generate G (generate G ?A) = generate G ?A
\<Union> (f ` A) \<subseteq> carrier G

goal (1 subgoal):
 1. generate G {a} \<subseteq> generate G (f M)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
generate G {a} \<subseteq> generate G (f M)

goal (1 subgoal):
 1. \<And>x. x \<in> \<Union> {generate G {x} |x. x \<in> \<Union> (f ` A)} \<Longrightarrow> x \<in> (\<Union>S\<in>A. generate G (f S))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
generate G {a} \<subseteq> generate G (f M)
[PROOF STEP]
have "x \<in> generate G (f M)"
[PROOF STATE]
proof (prove)
using this:
generate G {a} \<subseteq> generate G (f M)

goal (1 subgoal):
 1. x \<in> generate G (f M)
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
generate G {a} \<subseteq> generate G (f M)
x \<in> generate G {a}
a \<in> \<Union> (f ` A)

goal (1 subgoal):
 1. x \<in> generate G (f M)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<in> generate G (f M)

goal (1 subgoal):
 1. \<And>x. x \<in> \<Union> {generate G {x} |x. x \<in> \<Union> (f ` A)} \<Longrightarrow> x \<in> (\<Union>S\<in>A. generate G (f S))
[PROOF STEP]
thus "x \<in> (\<Union>S\<in>A. generate G (f S))"
[PROOF STATE]
proof (prove)
using this:
x \<in> generate G (f M)

goal (1 subgoal):
 1. x \<in> (\<Union>S\<in>A. generate G (f S))
[PROOF STEP]
using M
[PROOF STATE]
proof (prove)
using this:
x \<in> generate G (f M)
a \<in> f M
M \<in> A

goal (1 subgoal):
 1. x \<in> (\<Union>S\<in>A. generate G (f S))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<in> (\<Union>S\<in>A. generate G (f S))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<Union> {generate G {x} |x. x \<in> \<Union> (f ` A)} \<subseteq> (\<Union>S\<in>A. generate G (f S))

goal (2 subgoals):
 1. generate G (\<Union>S\<in>A. generate G (f S)) \<subseteq> generate G (\<Union> {generate G {x} |x. x \<in> \<Union> (f ` A)})
 2. generate G (\<Union> {generate G {x} |x. x \<in> \<Union> (f ` A)}) \<subseteq> generate G (\<Union>S\<in>A. generate G (f S))
[PROOF STEP]
thus "generate G (\<Union> {generate G {x} |x. x \<in> \<Union> (f ` A)}) \<subseteq> generate G (\<Union>S\<in>A. generate G (f S))"
[PROOF STATE]
proof (prove)
using this:
\<Union> {generate G {x} |x. x \<in> \<Union> (f ` A)} \<subseteq> (\<Union>S\<in>A. generate G (f S))

goal (1 subgoal):
 1. generate G (\<Union> {generate G {x} |x. x \<in> \<Union> (f ` A)}) \<subseteq> generate G (\<Union>S\<in>A. generate G (f S))
[PROOF STEP]
using mono_generate
[PROOF STATE]
proof (prove)
using this:
\<Union> {generate G {x} |x. x \<in> \<Union> (f ` A)} \<subseteq> (\<Union>S\<in>A. generate G (f S))
?K \<subseteq> ?H \<Longrightarrow> generate G ?K \<subseteq> generate G ?H

goal (1 subgoal):
 1. generate G (\<Union> {generate G {x} |x. x \<in> \<Union> (f ` A)}) \<subseteq> generate G (\<Union>S\<in>A. generate G (f S))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
generate G (\<Union> {generate G {x} |x. x \<in> \<Union> (f ` A)}) \<subseteq> generate G (\<Union>S\<in>A. generate G (f S))

goal (1 subgoal):
 1. generate G (\<Union>S\<in>A. generate G (f S)) \<subseteq> generate G (\<Union> {generate G {x} |x. x \<in> \<Union> (f ` A)})
[PROOF STEP]
have a: "generate G (\<Union>S\<in>A. generate G (f S)) \<subseteq> generate G (\<Union> (f ` A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. generate G (\<Union>S\<in>A. generate G (f S)) \<subseteq> generate G (\<Union> (f ` A))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. generate G (\<Union>S\<in>A. generate G (f S)) \<subseteq> generate G (\<Union> (f ` A))
[PROOF STEP]
have "\<And>S. S \<in> A \<Longrightarrow> generate G (f S) \<subseteq> generate G (\<Union> (f ` A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>S. S \<in> A \<Longrightarrow> generate G (f S) \<subseteq> generate G (\<Union> (f ` A))
[PROOF STEP]
using mono_generate[of _ "\<Union> (f ` A)"]
[PROOF STATE]
proof (prove)
using this:
?K \<subseteq> \<Union> (f ` A) \<Longrightarrow> generate G ?K \<subseteq> generate G (\<Union> (f ` A))

goal (1 subgoal):
 1. \<And>S. S \<in> A \<Longrightarrow> generate G (f S) \<subseteq> generate G (\<Union> (f ` A))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
?S \<in> A \<Longrightarrow> generate G (f ?S) \<subseteq> generate G (\<Union> (f ` A))

goal (1 subgoal):
 1. generate G (\<Union>S\<in>A. generate G (f S)) \<subseteq> generate G (\<Union> (f ` A))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?S \<in> A \<Longrightarrow> generate G (f ?S) \<subseteq> generate G (\<Union> (f ` A))
[PROOF STEP]
have "(\<Union>S\<in>A. generate G (f S)) \<subseteq> generate G (\<Union> (f ` A))"
[PROOF STATE]
proof (prove)
using this:
?S \<in> A \<Longrightarrow> generate G (f ?S) \<subseteq> generate G (\<Union> (f ` A))

goal (1 subgoal):
 1. (\<Union>S\<in>A. generate G (f S)) \<subseteq> generate G (\<Union> (f ` A))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<Union>S\<in>A. generate G (f S)) \<subseteq> generate G (\<Union> (f ` A))

goal (1 subgoal):
 1. generate G (\<Union>S\<in>A. generate G (f S)) \<subseteq> generate G (\<Union> (f ` A))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Union>S\<in>A. generate G (f S)) \<subseteq> generate G (\<Union> (f ` A))
[PROOF STEP]
have "generate G (\<Union>S\<in>A. generate G (f S)) \<subseteq> generate G (generate G (\<Union> (f ` A)))"
[PROOF STATE]
proof (prove)
using this:
(\<Union>S\<in>A. generate G (f S)) \<subseteq> generate G (\<Union> (f ` A))

goal (1 subgoal):
 1. generate G (\<Union>S\<in>A. generate G (f S)) \<subseteq> generate G (generate G (\<Union> (f ` A)))
[PROOF STEP]
using mono_generate
[PROOF STATE]
proof (prove)
using this:
(\<Union>S\<in>A. generate G (f S)) \<subseteq> generate G (\<Union> (f ` A))
?K \<subseteq> ?H \<Longrightarrow> generate G ?K \<subseteq> generate G ?H

goal (1 subgoal):
 1. generate G (\<Union>S\<in>A. generate G (f S)) \<subseteq> generate G (generate G (\<Union> (f ` A)))
[PROOF STEP]
by meson
[PROOF STATE]
proof (state)
this:
generate G (\<Union>S\<in>A. generate G (f S)) \<subseteq> generate G (generate G (\<Union> (f ` A)))

goal (1 subgoal):
 1. generate G (\<Union>S\<in>A. generate G (f S)) \<subseteq> generate G (\<Union> (f ` A))
[PROOF STEP]
thus "generate G (\<Union>S\<in>A. generate G (f S)) \<subseteq>  generate G (\<Union> (f ` A))"
[PROOF STATE]
proof (prove)
using this:
generate G (\<Union>S\<in>A. generate G (f S)) \<subseteq> generate G (generate G (\<Union> (f ` A)))

goal (1 subgoal):
 1. generate G (\<Union>S\<in>A. generate G (f S)) \<subseteq> generate G (\<Union> (f ` A))
[PROOF STEP]
using generate_idem assms
[PROOF STATE]
proof (prove)
using this:
generate G (\<Union>S\<in>A. generate G (f S)) \<subseteq> generate G (generate G (\<Union> (f ` A)))
?A \<subseteq> carrier G \<Longrightarrow> generate G (generate G ?A) = generate G ?A
\<Union> (f ` A) \<subseteq> carrier G

goal (1 subgoal):
 1. generate G (\<Union>S\<in>A. generate G (f S)) \<subseteq> generate G (\<Union> (f ` A))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
generate G (\<Union>S\<in>A. generate G (f S)) \<subseteq> generate G (\<Union> (f ` A))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
generate G (\<Union>S\<in>A. generate G (f S)) \<subseteq> generate G (\<Union> (f ` A))

goal (1 subgoal):
 1. generate G (\<Union>S\<in>A. generate G (f S)) \<subseteq> generate G (\<Union> {generate G {x} |x. x \<in> \<Union> (f ` A)})
[PROOF STEP]
have "\<Union> {generate G {x} |x. x \<in> \<Union> (f ` A)} = (\<Union>x\<in>\<Union> (f ` A). generate G {x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> {generate G {x} |x. x \<in> \<Union> (f ` A)} = (\<Union>x\<in>\<Union> (f ` A). generate G {x})
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<Union> {generate G {x} |x. x \<in> \<Union> (f ` A)} = (\<Union>x\<in>\<Union> (f ` A). generate G {x})

goal (1 subgoal):
 1. generate G (\<Union>S\<in>A. generate G (f S)) \<subseteq> generate G (\<Union> {generate G {x} |x. x \<in> \<Union> (f ` A)})
[PROOF STEP]
with generate_idem_Un[OF assms]
[PROOF STATE]
proof (chain)
picking this:
generate G (\<Union>x\<in>\<Union> (f ` A). generate G {x}) = generate G (\<Union> (f ` A))
\<Union> {generate G {x} |x. x \<in> \<Union> (f ` A)} = (\<Union>x\<in>\<Union> (f ` A). generate G {x})
[PROOF STEP]
have "generate G (\<Union> {generate G {x} |x. x \<in> \<Union> (f ` A)}) = generate G (\<Union> (f ` A))"
[PROOF STATE]
proof (prove)
using this:
generate G (\<Union>x\<in>\<Union> (f ` A). generate G {x}) = generate G (\<Union> (f ` A))
\<Union> {generate G {x} |x. x \<in> \<Union> (f ` A)} = (\<Union>x\<in>\<Union> (f ` A). generate G {x})

goal (1 subgoal):
 1. generate G (\<Union> {generate G {x} |x. x \<in> \<Union> (f ` A)}) = generate G (\<Union> (f ` A))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
generate G (\<Union> {generate G {x} |x. x \<in> \<Union> (f ` A)}) = generate G (\<Union> (f ` A))

goal (1 subgoal):
 1. generate G (\<Union>S\<in>A. generate G (f S)) \<subseteq> generate G (\<Union> {generate G {x} |x. x \<in> \<Union> (f ` A)})
[PROOF STEP]
with a
[PROOF STATE]
proof (chain)
picking this:
generate G (\<Union>S\<in>A. generate G (f S)) \<subseteq> generate G (\<Union> (f ` A))
generate G (\<Union> {generate G {x} |x. x \<in> \<Union> (f ` A)}) = generate G (\<Union> (f ` A))
[PROOF STEP]
show "generate G (\<Union>S\<in>A. generate G (f S))
             \<subseteq> generate G (\<Union> {generate G {x} |x. x \<in> \<Union> (f ` A)})"
[PROOF STATE]
proof (prove)
using this:
generate G (\<Union>S\<in>A. generate G (f S)) \<subseteq> generate G (\<Union> (f ` A))
generate G (\<Union> {generate G {x} |x. x \<in> \<Union> (f ` A)}) = generate G (\<Union> (f ` A))

goal (1 subgoal):
 1. generate G (\<Union>S\<in>A. generate G (f S)) \<subseteq> generate G (\<Union> {generate G {x} |x. x \<in> \<Union> (f ` A)})
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
generate G (\<Union>S\<in>A. generate G (f S)) \<subseteq> generate G (\<Union> {generate G {x} |x. x \<in> \<Union> (f ` A)})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma idem_map2: assumes "(\<And>x. f x x = x)" shows "map2 f l l = l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map2 f l l = l
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. map2 f l l = l
[PROOF STEP]
have "length l = length l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length l = length l
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length l = length l

goal (1 subgoal):
 1. map2 f l l = l
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
length l = length l
[PROOF STEP]
show "map2 f l l = l"
[PROOF STATE]
proof (prove)
using this:
length l = length l

goal (1 subgoal):
 1. map2 f l l = l
[PROOF STEP]
by (induction l l rule: list_induct2) (use assms in auto)
[PROOF STATE]
proof (state)
this:
map2 f l l = l

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma measurable_on_cdivide:
  fixes c :: real
  assumes "f measurable_on S"
  shows "(\<lambda>x. f x / c) measurable_on S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. f x / c) measurable_on S
[PROOF STEP]
proof (cases "c=0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. c = 0 \<Longrightarrow> (\<lambda>x. f x / c) measurable_on S
 2. c \<noteq> 0 \<Longrightarrow> (\<lambda>x. f x / c) measurable_on S
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
c \<noteq> 0

goal (2 subgoals):
 1. c = 0 \<Longrightarrow> (\<lambda>x. f x / c) measurable_on S
 2. c \<noteq> 0 \<Longrightarrow> (\<lambda>x. f x / c) measurable_on S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c \<noteq> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
c \<noteq> 0

goal (1 subgoal):
 1. (\<lambda>x. f x / c) measurable_on S
[PROOF STEP]
using measurable_on_cmul [of f S "1/c"]
[PROOF STATE]
proof (prove)
using this:
c \<noteq> 0
f measurable_on S \<Longrightarrow> (\<lambda>x. 1 / c * f x) measurable_on S

goal (1 subgoal):
 1. (\<lambda>x. f x / c) measurable_on S
[PROOF STEP]
by (simp add: assms)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. f x / c) measurable_on S

goal (1 subgoal):
 1. c = 0 \<Longrightarrow> (\<lambda>x. f x / c) measurable_on S
[PROOF STEP]
qed auto


[STATEMENT]
lemma subst_fm_ShiftP [simp]:
  "(ShiftP f k del g)(i::=u) = ShiftP (subst i u f) (subst i u k) (subst i u del) (subst i u g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ShiftP f k del g)(i::=u) = ShiftP (subst i u f) (subst i u k) (subst i u del) (subst i u g)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (ShiftP f k del g)(i::=u) = ShiftP (subst i u f) (subst i u k) (subst i u del) (subst i u g)
[PROOF STEP]
obtain x::name and x'::name and y::name and z::name
  where "atom x \<sharp> (x',y,z,f,del,k,i,u)" "atom x' \<sharp> (y,z,f,del,k,i,u)"
        "atom y \<sharp> (z,f,del,k,i,u)" "atom z \<sharp> (f,del,g,k,i,u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x x' y z. \<lbrakk>atom x \<sharp> (x', y, z, f, del, k, i, u); atom x' \<sharp> (y, z, f, del, k, i, u); atom y \<sharp> (z, f, del, k, i, u); atom z \<sharp> (f, del, g, k, i, u)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis obtain_fresh)
[PROOF STATE]
proof (state)
this:
atom x \<sharp> (x', y, z, f, del, k, i, u)
atom x' \<sharp> (y, z, f, del, k, i, u)
atom y \<sharp> (z, f, del, k, i, u)
atom z \<sharp> (f, del, g, k, i, u)

goal (1 subgoal):
 1. (ShiftP f k del g)(i::=u) = ShiftP (subst i u f) (subst i u k) (subst i u del) (subst i u g)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
atom x \<sharp> (x', y, z, f, del, k, i, u)
atom x' \<sharp> (y, z, f, del, k, i, u)
atom y \<sharp> (z, f, del, k, i, u)
atom z \<sharp> (f, del, g, k, i, u)

goal (1 subgoal):
 1. (ShiftP f k del g)(i::=u) = ShiftP (subst i u f) (subst i u k) (subst i u del) (subst i u g)
[PROOF STEP]
by (auto simp: ShiftP.simps [of x x' y z])
[PROOF STATE]
proof (state)
this:
(ShiftP f k del g)(i::=u) = ShiftP (subst i u f) (subst i u k) (subst i u del) (subst i u g)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inj_oI: "inj f \<Longrightarrow> inj (\<lambda>g. f \<circ> g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj f \<Longrightarrow> inj ((\<circ>) f)
[PROOF STEP]
apply (simp add: inj_on_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. f x = f y \<longrightarrow> x = y \<Longrightarrow> \<forall>x y. f \<circ> x = f \<circ> y \<longrightarrow> x = y
[PROOF STEP]
apply (blast intro: o_inj_on[unfolded inj_on_def])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma inf_prefix_length_commute[rule_format]:
  "inf_prefix_length xs ys = inf_prefix_length ys xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inf_prefix_length xs ys = inf_prefix_length ys xs
[PROOF STEP]
apply (unfold inf_prefix_length_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. equal_pair_count (zip xs ys) = equal_pair_count (zip ys xs)
[PROOF STEP]
apply (insert equal_pair_count_mirror_pairwise[of "zip xs ys" "zip ys xs"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lbrakk>length (zip xs ys) = length (zip ys xs); \<And>i. i < length (zip ys xs) \<Longrightarrow> zip xs ys ! i = mirror_pair (zip ys xs ! i)\<rbrakk> \<Longrightarrow> equal_pair_count (zip xs ys) = equal_pair_count (zip ys xs)) \<Longrightarrow> equal_pair_count (zip xs ys) = equal_pair_count (zip ys xs)
[PROOF STEP]
apply (simp add: equal_pair_count_mirror_pairwise[of "zip xs ys" "zip ys xs"] mirror_pair_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma in_subterms_eq: "\<lbrakk>x \<in> subterms y; y \<in> subterms x\<rbrakk> \<Longrightarrow> subterms x = subterms y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<sqsubseteq> y; y \<sqsubseteq> x\<rbrakk> \<Longrightarrow> subterms x = subterms y
[PROOF STEP]
using term.order.antisym
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?a \<sqsubseteq> ?b; ?b \<sqsubseteq> ?a\<rbrakk> \<Longrightarrow> ?a = ?b

goal (1 subgoal):
 1. \<lbrakk>x \<sqsubseteq> y; y \<sqsubseteq> x\<rbrakk> \<Longrightarrow> subterms x = subterms y
[PROOF STEP]
by auto


[STATEMENT]
lemma varsPrefixValuation:
  fixes valuation1 :: Valuation and valuation2 :: Valuation
  assumes "isPrefix valuation1 valuation2"
  shows "vars valuation1 \<subseteq> vars valuation2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vars valuation1 \<subseteq> vars valuation2
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vars valuation1 \<subseteq> vars valuation2
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
isPrefix valuation1 valuation2
[PROOF STEP]
have "set valuation1 \<subseteq> set valuation2"
[PROOF STATE]
proof (prove)
using this:
isPrefix valuation1 valuation2

goal (1 subgoal):
 1. set valuation1 \<subseteq> set valuation2
[PROOF STEP]
by (auto simp add:isPrefix_def)
[PROOF STATE]
proof (state)
this:
set valuation1 \<subseteq> set valuation2

goal (1 subgoal):
 1. vars valuation1 \<subseteq> vars valuation2
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
set valuation1 \<subseteq> set valuation2

goal (1 subgoal):
 1. vars valuation1 \<subseteq> vars valuation2
[PROOF STEP]
by (rule varsSubsetValuation)
[PROOF STATE]
proof (state)
this:
vars valuation1 \<subseteq> vars valuation2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sorted_wrt_conv_nth:
  "sorted_wrt R xs \<longleftrightarrow> (\<forall>i j. i < j \<and> j < length xs \<longrightarrow> (xs!i, xs!j) \<in> R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Linorder_Relations.sorted_wrt R xs = (\<forall>i j. i < j \<and> j < length xs \<longrightarrow> (xs ! i, xs ! j) \<in> R)
[PROOF STEP]
by (induction xs) (auto simp: sorted_wrt_Cons nth_Cons set_conv_nth split: nat.splits)


[STATEMENT]
lemma uncurry_curry_id[simp]: "uncurry (curry f) = f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. uncurry (curry f) = f
[PROOF STEP]
unfolding uncurry_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>(a, b). curry f a b) = f
[PROOF STEP]
by simp


[STATEMENT]
lemma vdiff_vinsert_left_nin:
  assumes "a \<notin>\<^sub>\<circ> B"
  shows "(vinsert a A) -\<^sub>\<circ> B = vinsert a (A -\<^sub>\<circ> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vinsert a A -\<^sub>\<circ> B = vinsert a (A -\<^sub>\<circ> B)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<notin>\<^sub>\<circ> B

goal (1 subgoal):
 1. vinsert a A -\<^sub>\<circ> B = vinsert a (A -\<^sub>\<circ> B)
[PROOF STEP]
by auto


[STATEMENT]
lemma finite_set_of_finite_maps:
  assumes "finite A" "finite B"
  shows "finite {m. dom m = A \<and> ran m \<subseteq> B}" (is "finite ?S")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {m. dom m = A \<and> ran m \<subseteq> B}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {m. dom m = A \<and> ran m \<subseteq> B}
[PROOF STEP]
let ?S' = "{m. \<forall>x. (x \<in> A \<longrightarrow> m x \<in> Some ` B) \<and> (x \<notin> A \<longrightarrow> m x = None)}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {m. dom m = A \<and> ran m \<subseteq> B}
[PROOF STEP]
have "?S = ?S'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {m. dom m = A \<and> ran m \<subseteq> B} = {m. \<forall>x. (x \<in> A \<longrightarrow> m x \<in> Some ` B) \<and> (x \<notin> A \<longrightarrow> m x = None)}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {m. dom m = A \<and> ran m \<subseteq> B} \<subseteq> {m. \<forall>x. (x \<in> A \<longrightarrow> m x \<in> Some ` B) \<and> (x \<notin> A \<longrightarrow> m x = None)}
 2. {m. \<forall>x. (x \<in> A \<longrightarrow> m x \<in> Some ` B) \<and> (x \<notin> A \<longrightarrow> m x = None)} \<subseteq> {m. dom m = A \<and> ran m \<subseteq> B}
[PROOF STEP]
show "?S \<subseteq> ?S'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {m. dom m = A \<and> ran m \<subseteq> B} \<subseteq> {m. \<forall>x. (x \<in> A \<longrightarrow> m x \<in> Some ` B) \<and> (x \<notin> A \<longrightarrow> m x = None)}
[PROOF STEP]
by (auto simp: dom_def ran_def image_def)
[PROOF STATE]
proof (state)
this:
{m. dom m = A \<and> ran m \<subseteq> B} \<subseteq> {m. \<forall>x. (x \<in> A \<longrightarrow> m x \<in> Some ` B) \<and> (x \<notin> A \<longrightarrow> m x = None)}

goal (1 subgoal):
 1. {m. \<forall>x. (x \<in> A \<longrightarrow> m x \<in> Some ` B) \<and> (x \<notin> A \<longrightarrow> m x = None)} \<subseteq> {m. dom m = A \<and> ran m \<subseteq> B}
[PROOF STEP]
show "?S' \<subseteq> ?S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {m. \<forall>x. (x \<in> A \<longrightarrow> m x \<in> Some ` B) \<and> (x \<notin> A \<longrightarrow> m x = None)} \<subseteq> {m. dom m = A \<and> ran m \<subseteq> B}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {m. \<forall>x. (x \<in> A \<longrightarrow> m x \<in> Some ` B) \<and> (x \<notin> A \<longrightarrow> m x = None)} \<Longrightarrow> x \<in> {m. dom m = A \<and> ran m \<subseteq> B}
[PROOF STEP]
fix m
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {m. \<forall>x. (x \<in> A \<longrightarrow> m x \<in> Some ` B) \<and> (x \<notin> A \<longrightarrow> m x = None)} \<Longrightarrow> x \<in> {m. dom m = A \<and> ran m \<subseteq> B}
[PROOF STEP]
assume "m \<in> ?S'"
[PROOF STATE]
proof (state)
this:
m \<in> {m. \<forall>x. (x \<in> A \<longrightarrow> m x \<in> Some ` B) \<and> (x \<notin> A \<longrightarrow> m x = None)}

goal (1 subgoal):
 1. \<And>x. x \<in> {m. \<forall>x. (x \<in> A \<longrightarrow> m x \<in> Some ` B) \<and> (x \<notin> A \<longrightarrow> m x = None)} \<Longrightarrow> x \<in> {m. dom m = A \<and> ran m \<subseteq> B}
[PROOF STEP]
hence 1: "dom m = A"
[PROOF STATE]
proof (prove)
using this:
m \<in> {m. \<forall>x. (x \<in> A \<longrightarrow> m x \<in> Some ` B) \<and> (x \<notin> A \<longrightarrow> m x = None)}

goal (1 subgoal):
 1. dom m = A
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
dom m = A

goal (1 subgoal):
 1. \<And>x. x \<in> {m. \<forall>x. (x \<in> A \<longrightarrow> m x \<in> Some ` B) \<and> (x \<notin> A \<longrightarrow> m x = None)} \<Longrightarrow> x \<in> {m. dom m = A \<and> ran m \<subseteq> B}
[PROOF STEP]
hence 2: "ran m \<subseteq> B"
[PROOF STATE]
proof (prove)
using this:
dom m = A

goal (1 subgoal):
 1. ran m \<subseteq> B
[PROOF STEP]
using \<open>m \<in> ?S'\<close>
[PROOF STATE]
proof (prove)
using this:
dom m = A
m \<in> {m. \<forall>x. (x \<in> A \<longrightarrow> m x \<in> Some ` B) \<and> (x \<notin> A \<longrightarrow> m x = None)}

goal (1 subgoal):
 1. ran m \<subseteq> B
[PROOF STEP]
by (auto simp: dom_def ran_def)
[PROOF STATE]
proof (state)
this:
ran m \<subseteq> B

goal (1 subgoal):
 1. \<And>x. x \<in> {m. \<forall>x. (x \<in> A \<longrightarrow> m x \<in> Some ` B) \<and> (x \<notin> A \<longrightarrow> m x = None)} \<Longrightarrow> x \<in> {m. dom m = A \<and> ran m \<subseteq> B}
[PROOF STEP]
from 1 2
[PROOF STATE]
proof (chain)
picking this:
dom m = A
ran m \<subseteq> B
[PROOF STEP]
show "m \<in> ?S"
[PROOF STATE]
proof (prove)
using this:
dom m = A
ran m \<subseteq> B

goal (1 subgoal):
 1. m \<in> {m. dom m = A \<and> ran m \<subseteq> B}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
m \<in> {m. dom m = A \<and> ran m \<subseteq> B}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
{m. \<forall>x. (x \<in> A \<longrightarrow> m x \<in> Some ` B) \<and> (x \<notin> A \<longrightarrow> m x = None)} \<subseteq> {m. dom m = A \<and> ran m \<subseteq> B}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
{m. dom m = A \<and> ran m \<subseteq> B} = {m. \<forall>x. (x \<in> A \<longrightarrow> m x \<in> Some ` B) \<and> (x \<notin> A \<longrightarrow> m x = None)}

goal (1 subgoal):
 1. finite {m. dom m = A \<and> ran m \<subseteq> B}
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
finite A
finite B
{m. dom m = A \<and> ran m \<subseteq> B} = {m. \<forall>x. (x \<in> A \<longrightarrow> m x \<in> Some ` B) \<and> (x \<notin> A \<longrightarrow> m x = None)}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite A
finite B
{m. dom m = A \<and> ran m \<subseteq> B} = {m. \<forall>x. (x \<in> A \<longrightarrow> m x \<in> Some ` B) \<and> (x \<notin> A \<longrightarrow> m x = None)}

goal (1 subgoal):
 1. finite {m. dom m = A \<and> ran m \<subseteq> B}
[PROOF STEP]
by(simp add: finite_set_of_finite_funs)
[PROOF STATE]
proof (state)
this:
finite {m. dom m = A \<and> ran m \<subseteq> B}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sdrop_cycle_eq_mod_0[simp]: "\<lbrakk>u \<noteq> []; n mod length u = 0\<rbrakk> \<Longrightarrow>
   sdrop n (cycle u) = cycle u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>u \<noteq> []; n mod length u = 0\<rbrakk> \<Longrightarrow> sdrop n (cycle u) = cycle u
[PROOF STEP]
by (induct "n div length u" arbitrary: n u)
    (auto simp: sdrop_add [symmetric] mod_eq_0_iff_dvd elim!: dvdE)


[STATEMENT]
lemma (in wf_digraph) set_awalk_verts_append:
  assumes "awalk u p v" "awalk v q w"
  shows "set (awalk_verts u (p @ q)) = set (awalk_verts u p) \<union> set (awalk_verts v q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (awalk_verts u (p @ q)) = set (awalk_verts u p) \<union> set (awalk_verts v q)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. set (awalk_verts u (p @ q)) = set (awalk_verts u p) \<union> set (awalk_verts v q)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
awalk u p v
awalk v q w
[PROOF STEP]
have "awalk u (p @ q) w"
[PROOF STATE]
proof (prove)
using this:
awalk u p v
awalk v q w

goal (1 subgoal):
 1. awalk u (p @ q) w
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
awalk u (p @ q) w

goal (1 subgoal):
 1. set (awalk_verts u (p @ q)) = set (awalk_verts u p) \<union> set (awalk_verts v q)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
awalk u (p @ q) w

goal (1 subgoal):
 1. set (awalk_verts u (p @ q)) = set (awalk_verts u p) \<union> set (awalk_verts v q)
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
awalk u p v
awalk v q w
awalk u (p @ q) w
[PROOF STEP]
have "v \<in> set (awalk_verts u (p @ q))"
[PROOF STATE]
proof (prove)
using this:
awalk u p v
awalk v q w
awalk u (p @ q) w

goal (1 subgoal):
 1. v \<in> set (awalk_verts u (p @ q))
[PROOF STEP]
by (auto simp: awalk_verts_append)
[PROOF STATE]
proof (state)
this:
v \<in> set (awalk_verts u (p @ q))

goal (1 subgoal):
 1. set (awalk_verts u (p @ q)) = set (awalk_verts u p) \<union> set (awalk_verts v q)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
awalk u (p @ q) w
v \<in> set (awalk_verts u (p @ q))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
awalk u (p @ q) w
v \<in> set (awalk_verts u (p @ q))

goal (1 subgoal):
 1. set (awalk_verts u (p @ q)) = set (awalk_verts u p) \<union> set (awalk_verts v q)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
awalk u (p @ q) w
v \<in> set (awalk_verts u (p @ q))
awalk u p v
awalk v q w

goal (1 subgoal):
 1. set (awalk_verts u (p @ q)) = set (awalk_verts u p) \<union> set (awalk_verts v q)
[PROOF STEP]
by (auto simp: set_awalk_verts)
[PROOF STATE]
proof (state)
this:
set (awalk_verts u (p @ q)) = set (awalk_verts u p) \<union> set (awalk_verts v q)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma hull_mono: "A \<subseteq> B \<Longrightarrow> \<langle>A\<rangle> \<subseteq> \<langle>B\<rangle>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<subseteq> B \<Longrightarrow> \<langle>A\<rangle> \<subseteq> \<langle>B\<rangle>
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>A \<subseteq> B; x \<in> \<langle>A\<rangle>\<rbrakk> \<Longrightarrow> x \<in> \<langle>B\<rangle>
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>A \<subseteq> B; x \<in> \<langle>A\<rangle>\<rbrakk> \<Longrightarrow> x \<in> \<langle>B\<rangle>
[PROOF STEP]
assume "A \<subseteq> B" "x \<in> \<langle>A\<rangle>"
[PROOF STATE]
proof (state)
this:
A \<subseteq> B
x \<in> \<langle>A\<rangle>

goal (1 subgoal):
 1. \<And>x. \<lbrakk>A \<subseteq> B; x \<in> \<langle>A\<rangle>\<rbrakk> \<Longrightarrow> x \<in> \<langle>B\<rangle>
[PROOF STEP]
thus "x \<in> \<langle>B\<rangle>"
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> B
x \<in> \<langle>A\<rangle>

goal (1 subgoal):
 1. x \<in> \<langle>B\<rangle>
[PROOF STEP]
unfolding image_def hull_concat_lists
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> B
x \<in> {y. \<exists>x\<in>lists A. y = concat x}

goal (1 subgoal):
 1. x \<in> {y. \<exists>x\<in>lists B. y = concat x}
[PROOF STEP]
using sub_lists_mono[OF \<open>A \<subseteq> B\<close>]
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> B
x \<in> {y. \<exists>x\<in>lists A. y = concat x}
?x \<in> lists A \<Longrightarrow> ?x \<in> lists B

goal (1 subgoal):
 1. x \<in> {y. \<exists>x\<in>lists B. y = concat x}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<in> \<langle>B\<rangle>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lfilled_size:
  assumes "Lfilled j lholed es LI"
  shows "size_list size LI \<ge> size_list size es"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size_list size es \<le> size_list size LI
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Lfilled j lholed es LI

goal (1 subgoal):
 1. size_list size es \<le> size_list size LI
[PROOF STEP]
by (induction rule: Lfilled.induct) auto


[STATEMENT]
lemma power_series_conv_imp_absconv_weak:
  fixes a:: "nat \<Rightarrow> 'a::{real_normed_div_algebra,banach}" and w :: 'a
  assumes sum: "summable (\<lambda>n. a n * z ^ n)" and no: "norm w < norm z"
    shows "summable (\<lambda>n. of_real(norm(a n)) * w ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. of_real (norm (a n)) * w ^ n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. summable (\<lambda>n. of_real (norm (a n)) * w ^ n)
[PROOF STEP]
obtain M where M: "\<And>x. norm (a x * z ^ x) \<le> M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>M. (\<And>x. norm (a x * z ^ x) \<le> M) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using summable_imp_bounded [OF sum]
[PROOF STATE]
proof (prove)
using this:
bounded (range (\<lambda>n. a n * z ^ n))

goal (1 subgoal):
 1. (\<And>M. (\<And>x. norm (a x * z ^ x) \<le> M) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (force simp: bounded_iff)
[PROOF STATE]
proof (state)
this:
norm (a ?x * z ^ ?x) \<le> M

goal (1 subgoal):
 1. summable (\<lambda>n. of_real (norm (a n)) * w ^ n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. of_real (norm (a n)) * w ^ n)
[PROOF STEP]
proof (rule series_comparison_complex)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. summable ?g
 2. \<And>n. ?g n \<in> \<real>
 3. \<And>n. 0 \<le> Re (?g n)
 4. \<And>n. ?N \<le> n \<Longrightarrow> norm (of_real (norm (a n)) * w ^ n) \<le> cmod (?g n)
[PROOF STEP]
have "\<And>n. norm (a n) * norm z ^ n \<le> M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. norm (a n) * norm z ^ n \<le> M
[PROOF STEP]
by (metis (no_types) M norm_mult norm_power)
[PROOF STATE]
proof (state)
this:
norm (a ?n) * norm z ^ ?n \<le> M

goal (4 subgoals):
 1. summable ?g
 2. \<And>n. ?g n \<in> \<real>
 3. \<And>n. 0 \<le> Re (?g n)
 4. \<And>n. ?N \<le> n \<Longrightarrow> norm (of_real (norm (a n)) * w ^ n) \<le> cmod (?g n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
norm (a ?n) * norm z ^ ?n \<le> M
[PROOF STEP]
show "summable (\<lambda>n. complex_of_real (norm (a n) * norm w ^ n))"
[PROOF STATE]
proof (prove)
using this:
norm (a ?n) * norm z ^ ?n \<le> M

goal (1 subgoal):
 1. summable (\<lambda>n. complex_of_real (norm (a n) * norm w ^ n))
[PROOF STEP]
using Abel_lemma no norm_ge_zero summable_of_real
[PROOF STATE]
proof (prove)
using this:
norm (a ?n) * norm z ^ ?n \<le> M
\<lbrakk>0 \<le> ?r; ?r < ?r0.0; \<And>n. norm (?a n) * ?r0.0 ^ n \<le> ?M\<rbrakk> \<Longrightarrow> summable (\<lambda>n. norm (?a n) * ?r ^ n)
norm w < norm z
0 \<le> norm ?x
summable ?X \<Longrightarrow> summable (\<lambda>n. of_real (?X n))

goal (1 subgoal):
 1. summable (\<lambda>n. complex_of_real (norm (a n) * norm w ^ n))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. complex_of_real (norm (a n) * norm w ^ n))

goal (3 subgoals):
 1. \<And>n. complex_of_real (norm (a n) * norm w ^ n) \<in> \<real>
 2. \<And>n. 0 \<le> Re (complex_of_real (norm (a n) * norm w ^ n))
 3. \<And>n. ?N \<le> n \<Longrightarrow> norm (of_real (norm (a n)) * w ^ n) \<le> cmod (complex_of_real (norm (a n) * norm w ^ n))
[PROOF STEP]
qed (auto simp: norm_mult norm_power)
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. of_real (norm (a n)) * w ^ n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tensor_one_from_lookup: "1 = tensor_from_lookup [] (\<lambda>_. 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 = tensor_from_lookup [] (\<lambda>_. 1::'a)
[PROOF STEP]
unfolding tensor_one_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tensor_from_vec [] [1::'a] = tensor_from_lookup [] (\<lambda>_. 1::'a)
[PROOF STEP]
by (rule tensor_eqI; simp_all add: tensor_from_lookup_def )


[STATEMENT]
lemma pvar_list_is_poly_tuple:
  shows "is_poly_tuple n (pvar_list R n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_poly_tuple n (pvar_list R n)
[PROOF STEP]
unfolding is_poly_tuple_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (pvar_list R n) \<subseteq> carrier (R [\<X>\<^bsub>n\<^esub>])
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> set (pvar_list R n) \<Longrightarrow> x \<in> carrier (R [\<X>\<^bsub>n\<^esub>])
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> set (pvar_list R n) \<Longrightarrow> x \<in> carrier (R [\<X>\<^bsub>n\<^esub>])
[PROOF STEP]
assume A: "x \<in> set (pvar_list R n)"
[PROOF STATE]
proof (state)
this:
x \<in> set (pvar_list R n)

goal (1 subgoal):
 1. \<And>x. x \<in> set (pvar_list R n) \<Longrightarrow> x \<in> carrier (R [\<X>\<^bsub>n\<^esub>])
[PROOF STEP]
have "set (index_list n) = {..<n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (index_list n) = {..<n}
[PROOF STEP]
by (simp add: index_list_set)
[PROOF STATE]
proof (state)
this:
set (index_list n) = {..<n}

goal (1 subgoal):
 1. \<And>x. x \<in> set (pvar_list R n) \<Longrightarrow> x \<in> carrier (R [\<X>\<^bsub>n\<^esub>])
[PROOF STEP]
obtain i where "i < n \<and> x = pvar R i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. i < n \<and> x = pvar R i \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using A  pvar_list_elements[of _ n R] pvar_list_length[of R n]
[PROOF STATE]
proof (prove)
using this:
x \<in> set (pvar_list R n)
?i < n \<Longrightarrow> pvar_list R n ! ?i = pvar R ?i
length (pvar_list R n) = n

goal (1 subgoal):
 1. (\<And>i. i < n \<and> x = pvar R i \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis in_set_conv_nth)
[PROOF STATE]
proof (state)
this:
i < n \<and> x = pvar R i

goal (1 subgoal):
 1. \<And>x. x \<in> set (pvar_list R n) \<Longrightarrow> x \<in> carrier (R [\<X>\<^bsub>n\<^esub>])
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i < n \<and> x = pvar R i
[PROOF STEP]
show "x \<in> carrier (R[\<X>\<^bsub>n\<^esub>])"
[PROOF STATE]
proof (prove)
using this:
i < n \<and> x = pvar R i

goal (1 subgoal):
 1. x \<in> carrier (R [\<X>\<^bsub>n\<^esub>])
[PROOF STEP]
using pvar_closed
[PROOF STATE]
proof (prove)
using this:
i < n \<and> x = pvar R i
?i < ?n \<Longrightarrow> pvar R ?i \<in> carrier (R [\<X>\<^bsub>?n\<^esub>])

goal (1 subgoal):
 1. x \<in> carrier (R [\<X>\<^bsub>n\<^esub>])
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<in> carrier (R [\<X>\<^bsub>n\<^esub>])

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma div_left_ineq:
 assumes "(x::nat) < y*z"
 shows " (x div z) < y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x div z < y
[PROOF STEP]
proof(rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> x div z < y \<Longrightarrow> False
[PROOF STEP]
assume 0: " \<not>((x div z) < y)"
[PROOF STATE]
proof (state)
this:
\<not> x div z < y

goal (1 subgoal):
 1. \<not> x div z < y \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> x div z < y
[PROOF STEP]
have 1:" x div z \<ge> y"
[PROOF STATE]
proof (prove)
using this:
\<not> x div z < y

goal (1 subgoal):
 1. y \<le> x div z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y \<le> x div z

goal (1 subgoal):
 1. \<not> x div z < y \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y \<le> x div z
[PROOF STEP]
have 2:"(x div z)*z \<ge> y*z"
[PROOF STATE]
proof (prove)
using this:
y \<le> x div z

goal (1 subgoal):
 1. y * z \<le> x div z * z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y * z \<le> x div z * z

goal (1 subgoal):
 1. \<not> x div z < y \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y * z \<le> x div z * z
[PROOF STEP]
have 3:"(x div z)*z + (x mod z) = z"
[PROOF STATE]
proof (prove)
using this:
y * z \<le> x div z * z

goal (1 subgoal):
 1. x div z * z + x mod z = z
[PROOF STEP]
using div_mult_mod_eq
          add_leD1 assms minus_mod_eq_div_mult [symmetric] le_diff_conv2 mod_less_eq_dividend not_less
[PROOF STATE]
proof (prove)
using this:
y * z \<le> x div z * z
?a div ?b * ?b + ?a mod ?b = ?a
?m + ?k \<le> ?n \<Longrightarrow> ?m \<le> ?n
x < y * z
?a div ?b * ?b = ?a - ?a mod ?b
?k \<le> ?j \<Longrightarrow> (?i \<le> ?j - ?k) = (?i + ?k \<le> ?j)
?m mod ?n \<le> ?m
(\<not> ?x < ?y) = (?y \<le> ?x)

goal (1 subgoal):
 1. x div z * z + x mod z = z
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
x div z * z + x mod z = z

goal (1 subgoal):
 1. \<not> x div z < y \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x div z * z + x mod z = z
[PROOF STEP]
have 4:"(x div z)*z \<le> z"
[PROOF STATE]
proof (prove)
using this:
x div z * z + x mod z = z

goal (1 subgoal):
 1. x div z * z \<le> z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x div z * z \<le> z

goal (1 subgoal):
 1. \<not> x div z < y \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x div z * z \<le> z
[PROOF STEP]
have 5:"z \<ge> y*z"
[PROOF STATE]
proof (prove)
using this:
x div z * z \<le> z

goal (1 subgoal):
 1. y * z \<le> z
[PROOF STEP]
using 2
[PROOF STATE]
proof (prove)
using this:
x div z * z \<le> z
y * z \<le> x div z * z

goal (1 subgoal):
 1. y * z \<le> z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y * z \<le> z

goal (1 subgoal):
 1. \<not> x div z < y \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y * z \<le> z
[PROOF STEP]
have 6:"z div z \<ge> (y*z) div z"
[PROOF STATE]
proof (prove)
using this:
y * z \<le> z

goal (1 subgoal):
 1. y * z div z \<le> z div z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y * z div z \<le> z div z

goal (1 subgoal):
 1. \<not> x div z < y \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y * z div z \<le> z div z
[PROOF STEP]
have "(y*z) div z \<le> 1"
[PROOF STATE]
proof (prove)
using this:
y * z div z \<le> z div z

goal (1 subgoal):
 1. y * z div z \<le> 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y * z div z \<le> 1

goal (1 subgoal):
 1. \<not> x div z < y \<Longrightarrow> False
[PROOF STEP]
with 6
[PROOF STATE]
proof (chain)
picking this:
y * z div z \<le> z div z
y * z div z \<le> 1
[PROOF STEP]
have "1 \<ge> y"
[PROOF STATE]
proof (prove)
using this:
y * z div z \<le> z div z
y * z div z \<le> 1

goal (1 subgoal):
 1. y \<le> 1
[PROOF STEP]
using 1 3 assms div_self less_nat_zero_code mult_zero_left
          mult.commute mod_div_mult_eq
[PROOF STATE]
proof (prove)
using this:
y * z div z \<le> z div z
y * z div z \<le> 1
y \<le> x div z
x div z * z + x mod z = z
x < y * z
?a \<noteq> (0::?'a) \<Longrightarrow> ?a div ?a = (1::?'a)
(?n < 0) = False
(0::?'a) * ?a = (0::?'a)
?a * ?b = ?b * ?a
?a mod ?b + ?a div ?b * ?b = ?a

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

goal (1 subgoal):
 1. \<not> x div z < y \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y \<le> 1
[PROOF STEP]
have 7:"(y = 0) \<or> (y = 1)"
[PROOF STATE]
proof (prove)
using this:
y \<le> 1

goal (1 subgoal):
 1. y = 0 \<or> y = 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y = 0 \<or> y = 1

goal (1 subgoal):
 1. \<not> x div z < y \<Longrightarrow> False
[PROOF STEP]
have "(y = 0 ) \<Longrightarrow> x<0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y = 0 \<Longrightarrow> x < 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x < y * z

goal (1 subgoal):
 1. y = 0 \<Longrightarrow> x < 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y = 0 \<Longrightarrow> x < 0

goal (1 subgoal):
 1. \<not> x div z < y \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y = 0 \<Longrightarrow> x < 0

goal (1 subgoal):
 1. \<not> x div z < y \<Longrightarrow> False
[PROOF STEP]
have "x \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> x

goal (1 subgoal):
 1. \<not> x div z < y \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 \<le> x
[PROOF STEP]
have 8:"(y = 0) \<Longrightarrow> False"
[PROOF STATE]
proof (prove)
using this:
0 \<le> x

goal (1 subgoal):
 1. y = 0 \<Longrightarrow> False
[PROOF STEP]
using calculation  less_nat_zero_code
[PROOF STATE]
proof (prove)
using this:
0 \<le> x
y = 0 \<Longrightarrow> x < 0
(?n < 0) = False

goal (1 subgoal):
 1. y = 0 \<Longrightarrow> False
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y = 0 \<Longrightarrow> False

goal (1 subgoal):
 1. \<not> x div z < y \<Longrightarrow> False
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
y = 0 \<Longrightarrow> False

goal (1 subgoal):
 1. \<not> x div z < y \<Longrightarrow> False
[PROOF STEP]
have "(y = 1) \<Longrightarrow> ( x < z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y = 1 \<Longrightarrow> x < z
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x < y * z

goal (1 subgoal):
 1. y = 1 \<Longrightarrow> x < z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y = 1 \<Longrightarrow> x < z

goal (1 subgoal):
 1. \<not> x div z < y \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y = 1 \<Longrightarrow> x < z
[PROOF STEP]
have "(y = 1) \<Longrightarrow> (x div z) = 0"
[PROOF STATE]
proof (prove)
using this:
y = 1 \<Longrightarrow> x < z

goal (1 subgoal):
 1. y = 1 \<Longrightarrow> x div z = 0
[PROOF STEP]
by (metis div_less)
[PROOF STATE]
proof (state)
this:
y = 1 \<Longrightarrow> x div z = 0

goal (1 subgoal):
 1. \<not> x div z < y \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y = 1 \<Longrightarrow> x div z = 0
[PROOF STEP]
have "(y = 1) \<Longrightarrow>(x div z) < y"
[PROOF STATE]
proof (prove)
using this:
y = 1 \<Longrightarrow> x div z = 0

goal (1 subgoal):
 1. y = 1 \<Longrightarrow> x div z < y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y = 1 \<Longrightarrow> x div z < y

goal (1 subgoal):
 1. \<not> x div z < y \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y = 1 \<Longrightarrow> x div z < y
[PROOF STEP]
have "(y = 1) \<Longrightarrow> False"
[PROOF STATE]
proof (prove)
using this:
y = 1 \<Longrightarrow> x div z < y

goal (1 subgoal):
 1. y = 1 \<Longrightarrow> False
[PROOF STEP]
using 0
[PROOF STATE]
proof (prove)
using this:
y = 1 \<Longrightarrow> x div z < y
\<not> x div z < y

goal (1 subgoal):
 1. y = 1 \<Longrightarrow> False
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y = 1 \<Longrightarrow> False

goal (1 subgoal):
 1. \<not> x div z < y \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y = 1 \<Longrightarrow> False
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
y = 1 \<Longrightarrow> False

goal (1 subgoal):
 1. False
[PROOF STEP]
using 7 8
[PROOF STATE]
proof (prove)
using this:
y = 1 \<Longrightarrow> False
y = 0 \<or> y = 1
y = 0 \<Longrightarrow> False

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dot_right_diff_distrib:
  fixes u v x :: "real^'n"
  shows "x \<bullet> (u - v) = (x \<bullet> u) - (x \<bullet> v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<bullet> (u - v) = x \<bullet> u - x \<bullet> v
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<bullet> (u - v) = x \<bullet> u - x \<bullet> v
[PROOF STEP]
from inner_commute
[PROOF STATE]
proof (chain)
picking this:
?x \<bullet> ?y = ?y \<bullet> ?x
[PROOF STEP]
have "x \<bullet> (u - v) = (u - v) \<bullet> x"
[PROOF STATE]
proof (prove)
using this:
?x \<bullet> ?y = ?y \<bullet> ?x

goal (1 subgoal):
 1. x \<bullet> (u - v) = (u - v) \<bullet> x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<bullet> (u - v) = (u - v) \<bullet> x

goal (1 subgoal):
 1. x \<bullet> (u - v) = x \<bullet> u - x \<bullet> v
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x \<bullet> (u - v) = (u - v) \<bullet> x

goal (1 subgoal):
 1. x \<bullet> (u - v) = x \<bullet> u - x \<bullet> v
[PROOF STEP]
from dot_left_diff_distrib [of u v x]
[PROOF STATE]
proof (chain)
picking this:
(u - v) \<bullet> x = u \<bullet> x - v \<bullet> x
[PROOF STEP]
have
    "\<dots> = u \<bullet> x - v \<bullet> x"
[PROOF STATE]
proof (prove)
using this:
(u - v) \<bullet> x = u \<bullet> x - v \<bullet> x

goal (1 subgoal):
 1. (u - v) \<bullet> x = u \<bullet> x - v \<bullet> x
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(u - v) \<bullet> x = u \<bullet> x - v \<bullet> x

goal (1 subgoal):
 1. x \<bullet> (u - v) = x \<bullet> u - x \<bullet> v
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(u - v) \<bullet> x = u \<bullet> x - v \<bullet> x

goal (1 subgoal):
 1. x \<bullet> (u - v) = x \<bullet> u - x \<bullet> v
[PROOF STEP]
from inner_commute [of x]
[PROOF STATE]
proof (chain)
picking this:
x \<bullet> ?y = ?y \<bullet> x
[PROOF STEP]
have
    "\<dots> = x \<bullet> u - x \<bullet> v"
[PROOF STATE]
proof (prove)
using this:
x \<bullet> ?y = ?y \<bullet> x

goal (1 subgoal):
 1. u \<bullet> x - v \<bullet> x = x \<bullet> u - x \<bullet> v
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
u \<bullet> x - v \<bullet> x = x \<bullet> u - x \<bullet> v

goal (1 subgoal):
 1. x \<bullet> (u - v) = x \<bullet> u - x \<bullet> v
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x \<bullet> (u - v) = x \<bullet> u - x \<bullet> v
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<bullet> (u - v) = x \<bullet> u - x \<bullet> v

goal (1 subgoal):
 1. x \<bullet> (u - v) = x \<bullet> u - x \<bullet> v
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
x \<bullet> (u - v) = x \<bullet> u - x \<bullet> v

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma real_of_rat_of_float: "real_of_rat (rat_of_float x) = real_of_float x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_rat (rat_of_float x) = real_of_float x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. real_of_rat (rat_of_float x) = real_of_float x
[PROOF STEP]
have "real_of_rat (rat_of_float x) = mantissa x * (2 powr (exponent x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_rat (rat_of_float x) = real_of_int (mantissa x) * 2 powr real_of_int (exponent x)
[PROOF STEP]
by (simp add:rat_of_float_def of_rat_mult of_rat_divide of_rat_power powr_realpow[symmetric] powr_minus_divide)
[PROOF STATE]
proof (state)
this:
real_of_rat (rat_of_float x) = real_of_int (mantissa x) * 2 powr real_of_int (exponent x)

goal (1 subgoal):
 1. real_of_rat (rat_of_float x) = real_of_float x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real_of_rat (rat_of_float x) = real_of_int (mantissa x) * 2 powr real_of_int (exponent x)

goal (1 subgoal):
 1. real_of_rat (rat_of_float x) = real_of_float x
[PROOF STEP]
have "... = real_of_float x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (mantissa x) * 2 powr real_of_int (exponent x) = real_of_float x
[PROOF STEP]
using mantissa_exponent
[PROOF STATE]
proof (prove)
using this:
real_of_float ?f = real_of_int (mantissa ?f) * 2 powr real_of_int (exponent ?f)

goal (1 subgoal):
 1. real_of_int (mantissa x) * 2 powr real_of_int (exponent x) = real_of_float x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real_of_int (mantissa x) * 2 powr real_of_int (exponent x) = real_of_float x

goal (1 subgoal):
 1. real_of_rat (rat_of_float x) = real_of_float x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
real_of_rat (rat_of_float x) = real_of_float x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
real_of_rat (rat_of_float x) = real_of_float x

goal (1 subgoal):
 1. real_of_rat (rat_of_float x) = real_of_float x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real_of_rat (rat_of_float x) = real_of_float x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma asymp_powser_compose:
  assumes "asymp_powser h F f cs" assumes "filterlim g F G"
  shows   "asymp_powser (\<lambda>x. h (g x)) G (\<lambda>x. f (g x)) cs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. asymp_powser (\<lambda>x. h (g x)) G (\<lambda>x. f (g x)) cs
[PROOF STEP]
using asymp_powser_o[OF assms]
[PROOF STATE]
proof (prove)
using this:
asymp_powser (h \<circ> g) G (f \<circ> g) cs

goal (1 subgoal):
 1. asymp_powser (\<lambda>x. h (g x)) G (\<lambda>x. f (g x)) cs
[PROOF STEP]
by (simp add: o_def)


[STATEMENT]
lemma independence_obtains:
  assumes "V \<noteq> {}"
  obtains vs where "is_independent_set vs" and "card vs = \<alpha>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>vs. \<lbrakk>is_independent_set vs; enat (card vs) = \<alpha>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>vs. \<lbrakk>is_independent_set vs; enat (card vs) = \<alpha>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "\<alpha> = Max ((\<lambda> vs . enat (card vs)) ` independent_sets)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<alpha> = (MAX vs\<in>independent_sets. enat (card vs))
[PROOF STEP]
using independence_max_alt assms
[PROOF STATE]
proof (prove)
using this:
V \<noteq> {} \<Longrightarrow> \<alpha> = (MAX vs\<in>independent_sets. enat (card vs))
V \<noteq> {}

goal (1 subgoal):
 1. \<alpha> = (MAX vs\<in>independent_sets. enat (card vs))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<alpha> = (MAX vs\<in>independent_sets. enat (card vs))

goal (1 subgoal):
 1. (\<And>vs. \<lbrakk>is_independent_set vs; enat (card vs) = \<alpha>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<alpha> = (MAX vs\<in>independent_sets. enat (card vs))
[PROOF STEP]
obtain vs where "vs \<in> independent_sets" and "enat (card vs) = \<alpha>"
[PROOF STATE]
proof (prove)
using this:
\<alpha> = (MAX vs\<in>independent_sets. enat (card vs))

goal (1 subgoal):
 1. (\<And>vs. \<lbrakk>vs \<in> independent_sets; enat (card vs) = \<alpha>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using obtains_MIN[of "independent_sets" "\<lambda> vs . enat (card vs)"] assms fin_independent_sets independent_sets_ne
[PROOF STATE]
proof (prove)
using this:
\<alpha> = (MAX vs\<in>independent_sets. enat (card vs))
\<lbrakk>finite independent_sets; independent_sets \<noteq> {}; \<And>x. \<lbrakk>x \<in> independent_sets; (MIN vs\<in>independent_sets. enat (card vs)) = enat (card x)\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
V \<noteq> {}
finite independent_sets
V \<noteq> {} \<Longrightarrow> independent_sets \<noteq> {}

goal (1 subgoal):
 1. (\<And>vs. \<lbrakk>vs \<in> independent_sets; enat (card vs) = \<alpha>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis (no_types, lifting) Max_in finite_imageI imageE image_is_empty)
[PROOF STATE]
proof (state)
this:
vs \<in> independent_sets
enat (card vs) = \<alpha>

goal (1 subgoal):
 1. (\<And>vs. \<lbrakk>is_independent_set vs; enat (card vs) = \<alpha>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
vs \<in> independent_sets
enat (card vs) = \<alpha>

goal (1 subgoal):
 1. thesis
[PROOF STEP]
using independent_sets_def that
[PROOF STATE]
proof (prove)
using this:
vs \<in> independent_sets
enat (card vs) = \<alpha>
independent_sets \<equiv> Collect is_independent_set
\<lbrakk>is_independent_set ?vs; enat (card ?vs) = \<alpha>\<rbrakk> \<Longrightarrow> thesis

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

goal:
No subgoals!
[PROOF STEP]
qed