[STATEMENT]
lemma Dirichlet_L_0_even [simp]:
  assumes "\<chi> (n - 1) = 1"
  shows   "Dirichlet_L n \<chi> 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Dirichlet_L n \<chi> 0 = 0
[PROOF STEP]
proof (cases "\<chi> = \<chi>\<^sub>0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<chi> = \<chi>\<^sub>0 \<Longrightarrow> Dirichlet_L n \<chi> 0 = 0
 2. \<chi> \<noteq> \<chi>\<^sub>0 \<Longrightarrow> Dirichlet_L n \<chi> 0 = 0
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<chi> \<noteq> \<chi>\<^sub>0

goal (2 subgoals):
 1. \<chi> = \<chi>\<^sub>0 \<Longrightarrow> Dirichlet_L n \<chi> 0 = 0
 2. \<chi> \<noteq> \<chi>\<^sub>0 \<Longrightarrow> Dirichlet_L n \<chi> 0 = 0
[PROOF STEP]
hence "Dirichlet_L n \<chi> 0 = -(\<Sum>k=Suc 0..<n. of_nat k * \<chi> k) / of_nat n"
[PROOF STATE]
proof (prove)
using this:
\<chi> \<noteq> \<chi>\<^sub>0

goal (1 subgoal):
 1. Dirichlet_L n \<chi> 0 = - (\<Sum>k = Suc 0..<n. of_nat k * \<chi> k) / of_nat n
[PROOF STEP]
by (simp add: Dirichlet_L_0_nonprincipal)
[PROOF STATE]
proof (state)
this:
Dirichlet_L n \<chi> 0 = - (\<Sum>k = Suc 0..<n. of_nat k * \<chi> k) / of_nat n

goal (2 subgoals):
 1. \<chi> = \<chi>\<^sub>0 \<Longrightarrow> Dirichlet_L n \<chi> 0 = 0
 2. \<chi> \<noteq> \<chi>\<^sub>0 \<Longrightarrow> Dirichlet_L n \<chi> 0 = 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Dirichlet_L n \<chi> 0 = - (\<Sum>k = Suc 0..<n. of_nat k * \<chi> k) / of_nat n

goal (2 subgoals):
 1. \<chi> = \<chi>\<^sub>0 \<Longrightarrow> Dirichlet_L n \<chi> 0 = 0
 2. \<chi> \<noteq> \<chi>\<^sub>0 \<Longrightarrow> Dirichlet_L n \<chi> 0 = 0
[PROOF STEP]
have "\<dots> = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (\<Sum>k = Suc 0..<n. of_nat k * \<chi> k) / of_nat n = 0
[PROOF STEP]
using assms False
[PROOF STATE]
proof (prove)
using this:
\<chi> (n - 1) = 1
\<chi> \<noteq> \<chi>\<^sub>0

goal (1 subgoal):
 1. - (\<Sum>k = Suc 0..<n. of_nat k * \<chi> k) / of_nat n = 0
[PROOF STEP]
by (subst even_dcharacter_linear_sum_eq_0) auto
[PROOF STATE]
proof (state)
this:
- (\<Sum>k = Suc 0..<n. of_nat k * \<chi> k) / of_nat n = 0

goal (2 subgoals):
 1. \<chi> = \<chi>\<^sub>0 \<Longrightarrow> Dirichlet_L n \<chi> 0 = 0
 2. \<chi> \<noteq> \<chi>\<^sub>0 \<Longrightarrow> Dirichlet_L n \<chi> 0 = 0
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Dirichlet_L n \<chi> 0 = 0
[PROOF STEP]
show "Dirichlet_L n \<chi> 0 = 0"
[PROOF STATE]
proof (prove)
using this:
Dirichlet_L n \<chi> 0 = 0

goal (1 subgoal):
 1. Dirichlet_L n \<chi> 0 = 0
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Dirichlet_L n \<chi> 0 = 0

goal (1 subgoal):
 1. \<chi> = \<chi>\<^sub>0 \<Longrightarrow> Dirichlet_L n \<chi> 0 = 0
[PROOF STEP]
qed auto


[STATEMENT]
lemma norm_le_infnorm:
  fixes x :: "'a::euclidean_space"
  shows "norm x \<le> sqrt DIM('a) * infnorm x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm x \<le> sqrt (real DIM('a)) * infnorm x
[PROOF STEP]
unfolding norm_eq_sqrt_inner id_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrt (x \<bullet> x) \<le> sqrt (real DIM('a)) * infnorm x
[PROOF STEP]
proof (rule real_le_lsqrt[OF inner_ge_zero])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 \<le> sqrt (real DIM('a)) * infnorm x
 2. x \<bullet> x \<le> (sqrt (real DIM('a)) * infnorm x)\<^sup>2
[PROOF STEP]
show "sqrt DIM('a) * infnorm x \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> sqrt (real DIM('a)) * infnorm x
[PROOF STEP]
by (simp add: zero_le_mult_iff infnorm_pos_le)
[PROOF STATE]
proof (state)
this:
0 \<le> sqrt (real DIM('a)) * infnorm x

goal (1 subgoal):
 1. x \<bullet> x \<le> (sqrt (real DIM('a)) * infnorm x)\<^sup>2
[PROOF STEP]
have "x \<bullet> x \<le> (\<Sum>b\<in>Basis. x \<bullet> b * (x \<bullet> b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<bullet> x \<le> (\<Sum>b\<in>Basis. x \<bullet> b * (x \<bullet> b))
[PROOF STEP]
by (metis euclidean_inner order_refl)
[PROOF STATE]
proof (state)
this:
x \<bullet> x \<le> (\<Sum>b\<in>Basis. x \<bullet> b * (x \<bullet> b))

goal (1 subgoal):
 1. x \<bullet> x \<le> (sqrt (real DIM('a)) * infnorm x)\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x \<bullet> x \<le> (\<Sum>b\<in>Basis. x \<bullet> b * (x \<bullet> b))

goal (1 subgoal):
 1. x \<bullet> x \<le> (sqrt (real DIM('a)) * infnorm x)\<^sup>2
[PROOF STEP]
have "... \<le> DIM('a) * \<bar>infnorm x\<bar>\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>b\<in>Basis. x \<bullet> b * (x \<bullet> b)) \<le> real DIM('a) * \<bar>infnorm x\<bar>\<^sup>2
[PROOF STEP]
by (rule sum_bounded_above) (metis Basis_le_infnorm abs_le_square_iff power2_eq_square real_abs_infnorm)
[PROOF STATE]
proof (state)
this:
(\<Sum>b\<in>Basis. x \<bullet> b * (x \<bullet> b)) \<le> real DIM('a) * \<bar>infnorm x\<bar>\<^sup>2

goal (1 subgoal):
 1. x \<bullet> x \<le> (sqrt (real DIM('a)) * infnorm x)\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>b\<in>Basis. x \<bullet> b * (x \<bullet> b)) \<le> real DIM('a) * \<bar>infnorm x\<bar>\<^sup>2

goal (1 subgoal):
 1. x \<bullet> x \<le> (sqrt (real DIM('a)) * infnorm x)\<^sup>2
[PROOF STEP]
have "... \<le> (sqrt DIM('a) * infnorm x)\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real DIM('a) * \<bar>infnorm x\<bar>\<^sup>2 \<le> (sqrt (real DIM('a)) * infnorm x)\<^sup>2
[PROOF STEP]
by (simp add: power_mult_distrib)
[PROOF STATE]
proof (state)
this:
real DIM('a) * \<bar>infnorm x\<bar>\<^sup>2 \<le> (sqrt (real DIM('a)) * infnorm x)\<^sup>2

goal (1 subgoal):
 1. x \<bullet> x \<le> (sqrt (real DIM('a)) * infnorm x)\<^sup>2
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x \<bullet> x \<le> (sqrt (real DIM('a)) * infnorm x)\<^sup>2
[PROOF STEP]
show "x \<bullet> x \<le> (sqrt DIM('a) * infnorm x)\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
x \<bullet> x \<le> (sqrt (real DIM('a)) * infnorm x)\<^sup>2

goal (1 subgoal):
 1. x \<bullet> x \<le> (sqrt (real DIM('a)) * infnorm x)\<^sup>2
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
x \<bullet> x \<le> (sqrt (real DIM('a)) * infnorm x)\<^sup>2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ctermsl_subterms:
  "ctermsl p = {q. q \<in> subterms p \<and> not_choice q }" (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ctermsl p = {q \<in> subterms p. not_choice q}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ctermsl p \<subseteq> {q \<in> subterms p. not_choice q}
 2. {q \<in> subterms p. not_choice q} \<subseteq> ctermsl p
[PROOF STEP]
show "?lhs \<subseteq> ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ctermsl p \<subseteq> {q \<in> subterms p. not_choice q}
[PROOF STEP]
by (induct p, auto)
[PROOF STATE]
proof (state)
this:
ctermsl p \<subseteq> {q \<in> subterms p. not_choice q}

goal (1 subgoal):
 1. {q \<in> subterms p. not_choice q} \<subseteq> ctermsl p
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {q \<in> subterms p. not_choice q} \<subseteq> ctermsl p
[PROOF STEP]
show "?rhs \<subseteq> ?lhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {q \<in> subterms p. not_choice q} \<subseteq> ctermsl p
[PROOF STEP]
by (induct p, auto)
[PROOF STATE]
proof (state)
this:
{q \<in> subterms p. not_choice q} \<subseteq> ctermsl p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma index_oddpart:
  assumes "odd m"
  shows "index (2 ^ i * m) = i" "oddpart (2 ^ i * m) = m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. index (2 ^ i * m) = i &&& oddpart (2 ^ i * m) = m
[PROOF STEP]
using index_oddpart_unique[where i=i and m=m and m'="oddpart (2 ^ i * m)" and i'="index (2 ^ i * m)"]
  assms odd_oddpart index_oddpart_decomposition
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>odd m; odd (oddpart (2 ^ i * m))\<rbrakk> \<Longrightarrow> (2 ^ i * m = 2 ^ index (2 ^ i * m) * oddpart (2 ^ i * m)) = (i = index (2 ^ i * m) \<and> m = oddpart (2 ^ i * m))
odd m
odd (oddpart ?n) = (?n \<noteq> 0)
?n = 2 ^ index ?n * oddpart ?n

goal (1 subgoal):
 1. index (2 ^ i * m) = i &&& oddpart (2 ^ i * m) = m
[PROOF STEP]
by force+


[STATEMENT]
lemma vec_times_polys_to_mat:
  assumes "Keys (set ps) \<subseteq> set ts" and "v \<in> carrier_vec (length ps)"
  shows "row_to_poly ts (v \<^sub>v* (polys_to_mat ts ps)) = (\<Sum>(c, p)\<leftarrow>zip (list_of_vec v) ps. c \<cdot> p)"
    (is "?l = ?r")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row_to_poly ts (v \<^sub>v* polys_to_mat ts ps) = sum_list (map2 (\<cdot>) (list_of_vec v) ps)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. row_to_poly ts (v \<^sub>v* polys_to_mat ts ps) = sum_list (map2 (\<cdot>) (list_of_vec v) ps)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
Keys (set ps) \<subseteq> set ts
v \<in> carrier_vec (length ps)
[PROOF STEP]
have *: "dim_vec v = length ps"
[PROOF STATE]
proof (prove)
using this:
Keys (set ps) \<subseteq> set ts
v \<in> carrier_vec (length ps)

goal (1 subgoal):
 1. dim_vec v = length ps
[PROOF STEP]
by (simp only: carrier_dim_vec)
[PROOF STATE]
proof (state)
this:
dim_vec v = length ps

goal (1 subgoal):
 1. row_to_poly ts (v \<^sub>v* polys_to_mat ts ps) = sum_list (map2 (\<cdot>) (list_of_vec v) ps)
[PROOF STEP]
have eq: "map (\<lambda>i. v \<bullet> col (polys_to_mat ts ps) i) [0..<length ts] =
            map (\<lambda>s. v \<bullet> (vec_of_list (map (\<lambda>p. lookup p s) ps))) ts"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (\<lambda>i. v \<bullet> col (polys_to_mat ts ps) i) [0..<length ts] = map (\<lambda>s. v \<bullet> vec_of_list (map (\<lambda>p. lookup p s) ps)) ts
[PROOF STEP]
proof (rule nth_equalityI, simp_all)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < length ts \<Longrightarrow> v \<bullet> col (polys_to_mat ts ps) i = v \<bullet> map_vec (\<lambda>p. lookup p (ts ! i)) (vec_of_list ps)
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i. i < length ts \<Longrightarrow> v \<bullet> col (polys_to_mat ts ps) i = v \<bullet> map_vec (\<lambda>p. lookup p (ts ! i)) (vec_of_list ps)
[PROOF STEP]
assume "i < length ts"
[PROOF STATE]
proof (state)
this:
i < length ts

goal (1 subgoal):
 1. \<And>i. i < length ts \<Longrightarrow> v \<bullet> col (polys_to_mat ts ps) i = v \<bullet> map_vec (\<lambda>p. lookup p (ts ! i)) (vec_of_list ps)
[PROOF STEP]
hence "col (polys_to_mat ts ps) i = vec_of_list (map (\<lambda>p. lookup p (ts ! i)) ps)"
[PROOF STATE]
proof (prove)
using this:
i < length ts

goal (1 subgoal):
 1. col (polys_to_mat ts ps) i = vec_of_list (map (\<lambda>p. lookup p (ts ! i)) ps)
[PROOF STEP]
by (rule col_polys_to_mat)
[PROOF STATE]
proof (state)
this:
col (polys_to_mat ts ps) i = vec_of_list (map (\<lambda>p. lookup p (ts ! i)) ps)

goal (1 subgoal):
 1. \<And>i. i < length ts \<Longrightarrow> v \<bullet> col (polys_to_mat ts ps) i = v \<bullet> map_vec (\<lambda>p. lookup p (ts ! i)) (vec_of_list ps)
[PROOF STEP]
thus "v \<bullet> col (polys_to_mat ts ps) i = v \<bullet> map_vec (\<lambda>p. lookup p (ts ! i)) (vec_of_list ps)"
[PROOF STATE]
proof (prove)
using this:
col (polys_to_mat ts ps) i = vec_of_list (map (\<lambda>p. lookup p (ts ! i)) ps)

goal (1 subgoal):
 1. v \<bullet> col (polys_to_mat ts ps) i = v \<bullet> map_vec (\<lambda>p. lookup p (ts ! i)) (vec_of_list ps)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
v \<bullet> col (polys_to_mat ts ps) i = v \<bullet> map_vec (\<lambda>p. lookup p (ts ! i)) (vec_of_list ps)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
map (\<lambda>i. v \<bullet> col (polys_to_mat ts ps) i) [0..<length ts] = map (\<lambda>s. v \<bullet> vec_of_list (map (\<lambda>p. lookup p s) ps)) ts

goal (1 subgoal):
 1. row_to_poly ts (v \<^sub>v* polys_to_mat ts ps) = sum_list (map2 (\<cdot>) (list_of_vec v) ps)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row_to_poly ts (v \<^sub>v* polys_to_mat ts ps) = sum_list (map2 (\<cdot>) (list_of_vec v) ps)
[PROOF STEP]
proof (rule poly_mapping_eqI, simp add: mult_vec_mat_def row_to_poly_def lookup_list_to_poly
      eq list_to_fun_def map_of_zip_map lookup_sum_list o_def, intro conjI impI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>k. k \<in> set ts \<Longrightarrow> v \<bullet> map_vec (\<lambda>p. lookup p k) (vec_of_list ps) = (\<Sum>x\<leftarrow>zip (list_of_vec v) ps. lookup (case x of (x, xa) \<Rightarrow> x \<cdot> xa) k)
 2. \<And>k. k \<notin> set ts \<Longrightarrow> (\<Sum>x\<leftarrow>zip (list_of_vec v) ps. lookup (case x of (x, xa) \<Rightarrow> x \<cdot> xa) k) = (0::'c)
[PROOF STEP]
fix t
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>k. k \<in> set ts \<Longrightarrow> v \<bullet> map_vec (\<lambda>p. lookup p k) (vec_of_list ps) = (\<Sum>x\<leftarrow>zip (list_of_vec v) ps. lookup (case x of (x, xa) \<Rightarrow> x \<cdot> xa) k)
 2. \<And>k. k \<notin> set ts \<Longrightarrow> (\<Sum>x\<leftarrow>zip (list_of_vec v) ps. lookup (case x of (x, xa) \<Rightarrow> x \<cdot> xa) k) = (0::'c)
[PROOF STEP]
assume "t \<in> set ts"
[PROOF STATE]
proof (state)
this:
t \<in> set ts

goal (2 subgoals):
 1. \<And>k. k \<in> set ts \<Longrightarrow> v \<bullet> map_vec (\<lambda>p. lookup p k) (vec_of_list ps) = (\<Sum>x\<leftarrow>zip (list_of_vec v) ps. lookup (case x of (x, xa) \<Rightarrow> x \<cdot> xa) k)
 2. \<And>k. k \<notin> set ts \<Longrightarrow> (\<Sum>x\<leftarrow>zip (list_of_vec v) ps. lookup (case x of (x, xa) \<Rightarrow> x \<cdot> xa) k) = (0::'c)
[PROOF STEP]
have "v \<bullet> vec_of_list (map (\<lambda>p. lookup p t) ps) =
          (\<Sum>(c, p)\<leftarrow>zip (list_of_vec v) ps. lookup (c \<cdot> p) t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<bullet> vec_of_list (map (\<lambda>p. lookup p t) ps) = sum_list (map2 (\<lambda>c p. lookup (c \<cdot> p) t) (list_of_vec v) ps)
[PROOF STEP]
proof (simp add: scalar_prod_def vec_of_list_index)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>i = 0..<length ps. v $ i * lookup (ps ! i) t) = sum_list (map2 (\<lambda>c p. c * lookup p t) (list_of_vec v) ps)
[PROOF STEP]
have "(\<Sum>i = 0..<length ps. v $ i * lookup (ps ! i) t) =
            (\<Sum>i = 0..<length ps. (list_of_vec v) ! i * lookup (ps ! i) t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<length ps. v $ i * lookup (ps ! i) t) = (\<Sum>i = 0..<length ps. list_of_vec v ! i * lookup (ps ! i) t)
[PROOF STEP]
by (rule sum.cong, rule refl, simp add: *)
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<length ps. v $ i * lookup (ps ! i) t) = (\<Sum>i = 0..<length ps. list_of_vec v ! i * lookup (ps ! i) t)

goal (1 subgoal):
 1. (\<Sum>i = 0..<length ps. v $ i * lookup (ps ! i) t) = sum_list (map2 (\<lambda>c p. c * lookup p t) (list_of_vec v) ps)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<length ps. v $ i * lookup (ps ! i) t) = (\<Sum>i = 0..<length ps. list_of_vec v ! i * lookup (ps ! i) t)

goal (1 subgoal):
 1. (\<Sum>i = 0..<length ps. v $ i * lookup (ps ! i) t) = sum_list (map2 (\<lambda>c p. c * lookup p t) (list_of_vec v) ps)
[PROOF STEP]
have "... = (\<Sum>(c, p)\<leftarrow>zip (list_of_vec v) ps. c * lookup p t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<length ps. list_of_vec v ! i * lookup (ps ! i) t) = sum_list (map2 (\<lambda>c p. c * lookup p t) (list_of_vec v) ps)
[PROOF STEP]
by (simp only: sum_set_upt_eq_sum_list, rule sum_list_upt_zip, simp only: length_list_of_vec *)
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<length ps. list_of_vec v ! i * lookup (ps ! i) t) = sum_list (map2 (\<lambda>c p. c * lookup p t) (list_of_vec v) ps)

goal (1 subgoal):
 1. (\<Sum>i = 0..<length ps. v $ i * lookup (ps ! i) t) = sum_list (map2 (\<lambda>c p. c * lookup p t) (list_of_vec v) ps)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>i = 0..<length ps. v $ i * lookup (ps ! i) t) = sum_list (map2 (\<lambda>c p. c * lookup p t) (list_of_vec v) ps)
[PROOF STEP]
show "(\<Sum>i = 0..<length ps. v $ i * lookup (ps ! i) t) =
                    (\<Sum>(c, p)\<leftarrow>zip (list_of_vec v) ps. c * lookup p t)"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i = 0..<length ps. v $ i * lookup (ps ! i) t) = sum_list (map2 (\<lambda>c p. c * lookup p t) (list_of_vec v) ps)

goal (1 subgoal):
 1. (\<Sum>i = 0..<length ps. v $ i * lookup (ps ! i) t) = sum_list (map2 (\<lambda>c p. c * lookup p t) (list_of_vec v) ps)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<length ps. v $ i * lookup (ps ! i) t) = sum_list (map2 (\<lambda>c p. c * lookup p t) (list_of_vec v) ps)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
v \<bullet> vec_of_list (map (\<lambda>p. lookup p t) ps) = sum_list (map2 (\<lambda>c p. lookup (c \<cdot> p) t) (list_of_vec v) ps)

goal (2 subgoals):
 1. \<And>k. k \<in> set ts \<Longrightarrow> v \<bullet> map_vec (\<lambda>p. lookup p k) (vec_of_list ps) = (\<Sum>x\<leftarrow>zip (list_of_vec v) ps. lookup (case x of (x, xa) \<Rightarrow> x \<cdot> xa) k)
 2. \<And>k. k \<notin> set ts \<Longrightarrow> (\<Sum>x\<leftarrow>zip (list_of_vec v) ps. lookup (case x of (x, xa) \<Rightarrow> x \<cdot> xa) k) = (0::'c)
[PROOF STEP]
thus "v \<bullet> map_vec (\<lambda>p. lookup p t) (vec_of_list ps) =
          (\<Sum>x\<leftarrow>zip (list_of_vec v) ps. lookup (case x of (c, x) \<Rightarrow> c \<cdot> x) t)"
[PROOF STATE]
proof (prove)
using this:
v \<bullet> vec_of_list (map (\<lambda>p. lookup p t) ps) = sum_list (map2 (\<lambda>c p. lookup (c \<cdot> p) t) (list_of_vec v) ps)

goal (1 subgoal):
 1. v \<bullet> map_vec (\<lambda>p. lookup p t) (vec_of_list ps) = (\<Sum>x\<leftarrow>zip (list_of_vec v) ps. lookup (case x of (c, x) \<Rightarrow> c \<cdot> x) t)
[PROOF STEP]
by (metis (mono_tags, lifting) case_prod_conv cond_case_prod_eta vec_of_list_map)
[PROOF STATE]
proof (state)
this:
v \<bullet> map_vec (\<lambda>p. lookup p t) (vec_of_list ps) = (\<Sum>x\<leftarrow>zip (list_of_vec v) ps. lookup (case x of (c, x) \<Rightarrow> c \<cdot> x) t)

goal (1 subgoal):
 1. \<And>k. k \<notin> set ts \<Longrightarrow> (\<Sum>x\<leftarrow>zip (list_of_vec v) ps. lookup (case x of (x, xa) \<Rightarrow> x \<cdot> xa) k) = (0::'c)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k. k \<notin> set ts \<Longrightarrow> (\<Sum>x\<leftarrow>zip (list_of_vec v) ps. lookup (case x of (x, xa) \<Rightarrow> x \<cdot> xa) k) = (0::'c)
[PROOF STEP]
fix t
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k. k \<notin> set ts \<Longrightarrow> (\<Sum>x\<leftarrow>zip (list_of_vec v) ps. lookup (case x of (x, xa) \<Rightarrow> x \<cdot> xa) k) = (0::'c)
[PROOF STEP]
assume "t \<notin> set ts"
[PROOF STATE]
proof (state)
this:
t \<notin> set ts

goal (1 subgoal):
 1. \<And>k. k \<notin> set ts \<Longrightarrow> (\<Sum>x\<leftarrow>zip (list_of_vec v) ps. lookup (case x of (x, xa) \<Rightarrow> x \<cdot> xa) k) = (0::'c)
[PROOF STEP]
with assms(1)
[PROOF STATE]
proof (chain)
picking this:
Keys (set ps) \<subseteq> set ts
t \<notin> set ts
[PROOF STEP]
have "t \<notin> Keys (set ps)"
[PROOF STATE]
proof (prove)
using this:
Keys (set ps) \<subseteq> set ts
t \<notin> set ts

goal (1 subgoal):
 1. t \<notin> Keys (set ps)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
t \<notin> Keys (set ps)

goal (1 subgoal):
 1. \<And>k. k \<notin> set ts \<Longrightarrow> (\<Sum>x\<leftarrow>zip (list_of_vec v) ps. lookup (case x of (x, xa) \<Rightarrow> x \<cdot> xa) k) = (0::'c)
[PROOF STEP]
have "(\<Sum>(c, p)\<leftarrow>zip (list_of_vec v) ps. lookup (c \<cdot> p) t) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (map2 (\<lambda>c p. lookup (c \<cdot> p) t) (list_of_vec v) ps) = (0::'c)
[PROOF STEP]
proof (rule sum_list_zeroI, rule, simp)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>x. case x of (c, p) \<Rightarrow> c * lookup p t) ` set (zip (list_of_vec v) ps) \<Longrightarrow> x = (0::'c)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>x. case x of (c, p) \<Rightarrow> c * lookup p t) ` set (zip (list_of_vec v) ps) \<Longrightarrow> x = (0::'c)
[PROOF STEP]
assume "x \<in> (\<lambda>(c, p). c * lookup p t) ` set (zip (list_of_vec v) ps)"
[PROOF STATE]
proof (state)
this:
x \<in> (\<lambda>(c, p). c * lookup p t) ` set (zip (list_of_vec v) ps)

goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>x. case x of (c, p) \<Rightarrow> c * lookup p t) ` set (zip (list_of_vec v) ps) \<Longrightarrow> x = (0::'c)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> (\<lambda>(c, p). c * lookup p t) ` set (zip (list_of_vec v) ps)
[PROOF STEP]
obtain c p where cp: "(c, p) \<in> set (zip (list_of_vec v) ps)"
        and x: "x = c * lookup p t"
[PROOF STATE]
proof (prove)
using this:
x \<in> (\<lambda>(c, p). c * lookup p t) ` set (zip (list_of_vec v) ps)

goal (1 subgoal):
 1. (\<And>c p. \<lbrakk>(c, p) \<in> set (zip (list_of_vec v) ps); x = c * lookup p t\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(c, p) \<in> set (zip (list_of_vec v) ps)
x = c * lookup p t

goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>x. case x of (c, p) \<Rightarrow> c * lookup p t) ` set (zip (list_of_vec v) ps) \<Longrightarrow> x = (0::'c)
[PROOF STEP]
from cp
[PROOF STATE]
proof (chain)
picking this:
(c, p) \<in> set (zip (list_of_vec v) ps)
[PROOF STEP]
have "p \<in> set ps"
[PROOF STATE]
proof (prove)
using this:
(c, p) \<in> set (zip (list_of_vec v) ps)

goal (1 subgoal):
 1. p \<in> set ps
[PROOF STEP]
by (rule set_zip_rightD)
[PROOF STATE]
proof (state)
this:
p \<in> set ps

goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>x. case x of (c, p) \<Rightarrow> c * lookup p t) ` set (zip (list_of_vec v) ps) \<Longrightarrow> x = (0::'c)
[PROOF STEP]
with \<open>t \<notin> Keys (set ps)\<close>
[PROOF STATE]
proof (chain)
picking this:
t \<notin> Keys (set ps)
p \<in> set ps
[PROOF STEP]
have "t \<notin> keys p"
[PROOF STATE]
proof (prove)
using this:
t \<notin> Keys (set ps)
p \<in> set ps

goal (1 subgoal):
 1. t \<notin> keys p
[PROOF STEP]
by (auto intro: in_KeysI)
[PROOF STATE]
proof (state)
this:
t \<notin> keys p

goal (1 subgoal):
 1. \<And>x. x \<in> (\<lambda>x. case x of (c, p) \<Rightarrow> c * lookup p t) ` set (zip (list_of_vec v) ps) \<Longrightarrow> x = (0::'c)
[PROOF STEP]
thus "x = 0"
[PROOF STATE]
proof (prove)
using this:
t \<notin> keys p

goal (1 subgoal):
 1. x = (0::'c)
[PROOF STEP]
by (simp add: x in_keys_iff)
[PROOF STATE]
proof (state)
this:
x = (0::'c)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
sum_list (map2 (\<lambda>c p. lookup (c \<cdot> p) t) (list_of_vec v) ps) = (0::'c)

goal (1 subgoal):
 1. \<And>k. k \<notin> set ts \<Longrightarrow> (\<Sum>x\<leftarrow>zip (list_of_vec v) ps. lookup (case x of (x, xa) \<Rightarrow> x \<cdot> xa) k) = (0::'c)
[PROOF STEP]
thus "(\<Sum>x\<leftarrow>zip (list_of_vec v) ps. lookup (case x of (c, x) \<Rightarrow> c \<cdot> x) t) = 0"
[PROOF STATE]
proof (prove)
using this:
sum_list (map2 (\<lambda>c p. lookup (c \<cdot> p) t) (list_of_vec v) ps) = (0::'c)

goal (1 subgoal):
 1. (\<Sum>x\<leftarrow>zip (list_of_vec v) ps. lookup (case x of (c, x) \<Rightarrow> c \<cdot> x) t) = (0::'c)
[PROOF STEP]
by (metis (mono_tags, lifting) case_prod_conv cond_case_prod_eta)
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<leftarrow>zip (list_of_vec v) ps. lookup (case x of (c, x) \<Rightarrow> c \<cdot> x) t) = (0::'c)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
row_to_poly ts (v \<^sub>v* polys_to_mat ts ps) = sum_list (map2 (\<cdot>) (list_of_vec v) ps)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma continuous_on_components_gen:
 fixes f :: "'a::topological_space \<Rightarrow> 'b::topological_space"
  assumes "\<And>C. C \<in> components S \<Longrightarrow>
              openin (top_of_set S) C \<and> continuous_on C f"
    shows "continuous_on S f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on S f
[PROOF STEP]
proof (clarsimp simp: continuous_openin_preimage_eq)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>T. open T \<Longrightarrow> openin (top_of_set S) (S \<inter> f -` T)
[PROOF STEP]
fix t :: "'b set"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>T. open T \<Longrightarrow> openin (top_of_set S) (S \<inter> f -` T)
[PROOF STEP]
assume "open t"
[PROOF STATE]
proof (state)
this:
open t

goal (1 subgoal):
 1. \<And>T. open T \<Longrightarrow> openin (top_of_set S) (S \<inter> f -` T)
[PROOF STEP]
have *: "S \<inter> f -` t = (\<Union>c \<in> components S. c \<inter> f -` t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<inter> f -` t = (\<Union>c\<in>components S. c \<inter> f -` t)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
S \<inter> f -` t = (\<Union>c\<in>components S. c \<inter> f -` t)

goal (1 subgoal):
 1. \<And>T. open T \<Longrightarrow> openin (top_of_set S) (S \<inter> f -` T)
[PROOF STEP]
show "openin (top_of_set S) (S \<inter> f -` t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. openin (top_of_set S) (S \<inter> f -` t)
[PROOF STEP]
unfolding *
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. openin (top_of_set S) (\<Union>c\<in>components S. c \<inter> f -` t)
[PROOF STEP]
using \<open>open t\<close> assms continuous_openin_preimage_gen openin_trans openin_Union
[PROOF STATE]
proof (prove)
using this:
open t
?C \<in> components S \<Longrightarrow> openin (top_of_set S) ?C \<and> continuous_on ?C f
\<lbrakk>continuous_on ?S ?f; open ?T\<rbrakk> \<Longrightarrow> openin (top_of_set ?S) (?S \<inter> ?f -` ?T)
\<lbrakk>openin (top_of_set ?T) ?S; openin (top_of_set ?U) ?T\<rbrakk> \<Longrightarrow> openin (top_of_set ?U) ?S
(\<And>S. S \<in> ?K \<Longrightarrow> openin ?U S) \<Longrightarrow> openin ?U (\<Union> ?K)

goal (1 subgoal):
 1. openin (top_of_set S) (\<Union>c\<in>components S. c \<inter> f -` t)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
openin (top_of_set S) (S \<inter> f -` t)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma det_rows_mul:
  assumes a: "a \<in> {0..<n} \<rightarrow> carrier_vec n"
  shows "det(mat\<^sub>r n n (\<lambda> i. c i \<cdot>\<^sub>v a i)) =
    prod c {0..<n} * det(mat\<^sub>r n n (\<lambda> i. a i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (mat\<^sub>r n n (\<lambda>i. c i \<cdot>\<^sub>v a i)) = prod c {0..<n} * det (mat\<^sub>r n n a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. det (mat\<^sub>r n n (\<lambda>i. c i \<cdot>\<^sub>v a i)) = prod c {0..<n} * det (mat\<^sub>r n n a)
[PROOF STEP]
have A: "mat\<^sub>r n n (\<lambda> i. c i \<cdot>\<^sub>v a i) \<in> carrier_mat n n"
  and A': "mat\<^sub>r n n (\<lambda> i. a i) \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat\<^sub>r n n (\<lambda>i. c i \<cdot>\<^sub>v a i) \<in> carrier_mat n n &&& mat\<^sub>r n n a \<in> carrier_mat n n
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
a \<in> {0..<n} \<rightarrow> carrier_vec n

goal (1 subgoal):
 1. mat\<^sub>r n n (\<lambda>i. c i \<cdot>\<^sub>v a i) \<in> carrier_mat n n &&& mat\<^sub>r n n a \<in> carrier_mat n n
[PROOF STEP]
unfolding carrier_mat_def
[PROOF STATE]
proof (prove)
using this:
a \<in> {0..<n} \<rightarrow> carrier_vec n

goal (1 subgoal):
 1. mat\<^sub>r n n (\<lambda>i. c i \<cdot>\<^sub>v a i) \<in> {m. dim_row m = n \<and> dim_col m = n} &&& mat\<^sub>r n n a \<in> {m. dim_row m = n \<and> dim_col m = n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mat\<^sub>r n n (\<lambda>i. c i \<cdot>\<^sub>v a i) \<in> carrier_mat n n
mat\<^sub>r n n a \<in> carrier_mat n n

goal (1 subgoal):
 1. det (mat\<^sub>r n n (\<lambda>i. c i \<cdot>\<^sub>v a i)) = prod c {0..<n} * det (mat\<^sub>r n n a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (mat\<^sub>r n n (\<lambda>i. c i \<cdot>\<^sub>v a i)) = prod c {0..<n} * det (mat\<^sub>r n n a)
[PROOF STEP]
unfolding det_def'[OF A] det_def'[OF A']
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>p | p permutes {0..<n}. of_int (sign p) * (\<Prod>i = 0..<n. mat\<^sub>r n n (\<lambda>i. c i \<cdot>\<^sub>v a i) $$ (i, p i))) = prod c {0..<n} * (\<Sum>p | p permutes {0..<n}. of_int (sign p) * (\<Prod>i = 0..<n. mat\<^sub>r n n a $$ (i, p i)))
[PROOF STEP]
proof (rule trans[OF sum.cong sum_distrib_left[symmetric]])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {p. p permutes {0..<n}} = {p. p permutes {0..<n}}
 2. \<And>x. x \<in> {p. p permutes {0..<n}} \<Longrightarrow> of_int (sign x) * (\<Prod>i = 0..<n. mat\<^sub>r n n (\<lambda>i. c i \<cdot>\<^sub>v a i) $$ (i, x i)) = prod c {0..<n} * (of_int (sign x) * (\<Prod>i = 0..<n. mat\<^sub>r n n a $$ (i, x i)))
[PROOF STEP]
fix p
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {p. p permutes {0..<n}} = {p. p permutes {0..<n}}
 2. \<And>x. x \<in> {p. p permutes {0..<n}} \<Longrightarrow> of_int (sign x) * (\<Prod>i = 0..<n. mat\<^sub>r n n (\<lambda>i. c i \<cdot>\<^sub>v a i) $$ (i, x i)) = prod c {0..<n} * (of_int (sign x) * (\<Prod>i = 0..<n. mat\<^sub>r n n a $$ (i, x i)))
[PROOF STEP]
assume p: "p \<in> {p. p permutes {0..<n}}"
[PROOF STATE]
proof (state)
this:
p \<in> {p. p permutes {0..<n}}

goal (2 subgoals):
 1. {p. p permutes {0..<n}} = {p. p permutes {0..<n}}
 2. \<And>x. x \<in> {p. p permutes {0..<n}} \<Longrightarrow> of_int (sign x) * (\<Prod>i = 0..<n. mat\<^sub>r n n (\<lambda>i. c i \<cdot>\<^sub>v a i) $$ (i, x i)) = prod c {0..<n} * (of_int (sign x) * (\<Prod>i = 0..<n. mat\<^sub>r n n a $$ (i, x i)))
[PROOF STEP]
have id: "(\<Prod>ia\<in>{0..<n}. mat\<^sub>r n n (\<lambda>i. c i \<cdot>\<^sub>v a i) $$ (ia, p ia))
      = prod c {0..<n} * (\<Prod>ia\<in>{0..<n}. mat\<^sub>r n n a $$ (ia, p ia))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>ia = 0..<n. mat\<^sub>r n n (\<lambda>i. c i \<cdot>\<^sub>v a i) $$ (ia, p ia)) = prod c {0..<n} * (\<Prod>ia = 0..<n. mat\<^sub>r n n a $$ (ia, p ia))
[PROOF STEP]
unfolding prod.distrib[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>ia = 0..<n. mat\<^sub>r n n (\<lambda>i. c i \<cdot>\<^sub>v a i) $$ (ia, p ia)) = (\<Prod>x = 0..<n. c x * mat\<^sub>r n n a $$ (x, p x))
[PROOF STEP]
by (rule prod.cong, insert p a, force+)
[PROOF STATE]
proof (state)
this:
(\<Prod>ia = 0..<n. mat\<^sub>r n n (\<lambda>i. c i \<cdot>\<^sub>v a i) $$ (ia, p ia)) = prod c {0..<n} * (\<Prod>ia = 0..<n. mat\<^sub>r n n a $$ (ia, p ia))

goal (2 subgoals):
 1. {p. p permutes {0..<n}} = {p. p permutes {0..<n}}
 2. \<And>x. x \<in> {p. p permutes {0..<n}} \<Longrightarrow> of_int (sign x) * (\<Prod>i = 0..<n. mat\<^sub>r n n (\<lambda>i. c i \<cdot>\<^sub>v a i) $$ (i, x i)) = prod c {0..<n} * (of_int (sign x) * (\<Prod>i = 0..<n. mat\<^sub>r n n a $$ (i, x i)))
[PROOF STEP]
show "signof p * (\<Prod>ia\<in>{0..<n}. mat\<^sub>r n n (\<lambda>i. c i \<cdot>\<^sub>v a i) $$ (ia, p ia)) =
           prod c {0..<n} * (signof p * (\<Prod>ia\<in>{0..<n}. mat\<^sub>r n n a $$ (ia, p ia)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int (sign p) * (\<Prod>ia = 0..<n. mat\<^sub>r n n (\<lambda>i. c i \<cdot>\<^sub>v a i) $$ (ia, p ia)) = prod c {0..<n} * (of_int (sign p) * (\<Prod>ia = 0..<n. mat\<^sub>r n n a $$ (ia, p ia)))
[PROOF STEP]
unfolding id
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int (sign p) * (prod c {0..<n} * (\<Prod>ia = 0..<n. mat\<^sub>r n n a $$ (ia, p ia))) = prod c {0..<n} * (of_int (sign p) * (\<Prod>ia = 0..<n. mat\<^sub>r n n a $$ (ia, p ia)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
of_int (sign p) * (\<Prod>ia = 0..<n. mat\<^sub>r n n (\<lambda>i. c i \<cdot>\<^sub>v a i) $$ (ia, p ia)) = prod c {0..<n} * (of_int (sign p) * (\<Prod>ia = 0..<n. mat\<^sub>r n n a $$ (ia, p ia)))

goal (1 subgoal):
 1. {p. p permutes {0..<n}} = {p. p permutes {0..<n}}
[PROOF STEP]
qed simp
[PROOF STATE]
proof (state)
this:
det (mat\<^sub>r n n (\<lambda>i. c i \<cdot>\<^sub>v a i)) = prod c {0..<n} * det (mat\<^sub>r n n a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inj_onI_pair:
  assumes "inj_on f S" "T \<subseteq> S \<times> S"
  shows "inj_on (\<lambda>(u,v). (f u, f v)) T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (\<lambda>(u, v). (f u, f v)) T
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
inj_on f S
T \<subseteq> S \<times> S

goal (1 subgoal):
 1. inj_on (\<lambda>(u, v). (f u, f v)) T
[PROOF STEP]
by (intro inj_onI) (auto dest: inj_onD)


[STATEMENT]
lemma basis_finite:
  fixes B :: "('a::{field}^'n) set"
  assumes "is_basis B"
  shows "finite B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite B
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite B
[PROOF STEP]
from independent_is_basis [of B] and \<open>is_basis B\<close>
[PROOF STATE]
proof (chain)
picking this:
(vec.independent B \<and> card B = CARD('n)) = is_basis B
is_basis B
[PROOF STEP]
have "card B = CARD('n)"
[PROOF STATE]
proof (prove)
using this:
(vec.independent B \<and> card B = CARD('n)) = is_basis B
is_basis B

goal (1 subgoal):
 1. card B = CARD('n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card B = CARD('n)

goal (1 subgoal):
 1. finite B
[PROOF STEP]
with card_finite [of B, where 'n = 'n]
[PROOF STATE]
proof (chain)
picking this:
card B = CARD('n) \<Longrightarrow> finite B
card B = CARD('n)
[PROOF STEP]
show "finite B"
[PROOF STATE]
proof (prove)
using this:
card B = CARD('n) \<Longrightarrow> finite B
card B = CARD('n)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prod_mset_subset_imp_dvd:
  assumes "A \<subseteq># B"
  shows   "prod_mset A dvd prod_mset B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod_mset A dvd prod_mset B
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. prod_mset A dvd prod_mset B
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
A \<subseteq># B
[PROOF STEP]
have "B = (B - A) + A"
[PROOF STATE]
proof (prove)
using this:
A \<subseteq># B

goal (1 subgoal):
 1. B = B - A + A
[PROOF STEP]
by (simp add: subset_mset.diff_add)
[PROOF STATE]
proof (state)
this:
B = B - A + A

goal (1 subgoal):
 1. prod_mset A dvd prod_mset B
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
B = B - A + A

goal (1 subgoal):
 1. prod_mset A dvd prod_mset B
[PROOF STEP]
have "prod_mset \<dots> = prod_mset (B - A) * prod_mset A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod_mset (B - A + A) = prod_mset (B - A) * prod_mset A
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
prod_mset (B - A + A) = prod_mset (B - A) * prod_mset A

goal (1 subgoal):
 1. prod_mset A dvd prod_mset B
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
prod_mset (B - A + A) = prod_mset (B - A) * prod_mset A

goal (1 subgoal):
 1. prod_mset A dvd prod_mset B
[PROOF STEP]
have "prod_mset A dvd \<dots>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod_mset A dvd prod_mset (B - A) * prod_mset A
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
prod_mset A dvd prod_mset (B - A) * prod_mset A

goal (1 subgoal):
 1. prod_mset A dvd prod_mset B
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
prod_mset A dvd prod_mset B
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
prod_mset A dvd prod_mset B

goal (1 subgoal):
 1. prod_mset A dvd prod_mset B
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
prod_mset A dvd prod_mset B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma unique_eigen_vector_real: assumes ord: "order lam (charpoly A :: real poly) = 1"
  and ev: "eigen_vector A v lam" "eigen_vector A w lam"
shows "\<exists> a. v = a *s w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>a. v = a *s w
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
order lam (charpoly A) = 1
eigen_vector A v lam
eigen_vector A w lam

goal (1 subgoal):
 1. \<exists>a. v = a *s w
[PROOF STEP]
proof (transfer, goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>lam A v w. \<lbrakk>A \<in> carrier_mat CARD('a) CARD('a); order lam (char_poly A) = 1; v \<in> carrier_vec CARD('a); eigenvector A v lam; w \<in> carrier_vec CARD('a); eigenvector A w lam\<rbrakk> \<Longrightarrow> \<exists>a. v = a \<cdot>\<^sub>v w
[PROOF STEP]
case (1 lam A v w)
[PROOF STATE]
proof (state)
this:
A \<in> carrier_mat CARD('a) CARD('a)
order lam (char_poly A) = 1
v \<in> carrier_vec CARD('a)
eigenvector A v lam
w \<in> carrier_vec CARD('a)
eigenvector A w lam

goal (1 subgoal):
 1. \<And>lam A v w. \<lbrakk>A \<in> carrier_mat CARD('a) CARD('a); order lam (char_poly A) = 1; v \<in> carrier_vec CARD('a); eigenvector A v lam; w \<in> carrier_vec CARD('a); eigenvector A w lam\<rbrakk> \<Longrightarrow> \<exists>a. v = a \<cdot>\<^sub>v w
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>a. v = a \<cdot>\<^sub>v w
[PROOF STEP]
by (rule unique_eigenvector_real[OF 1(1-2,4,6)])
[PROOF STATE]
proof (state)
this:
\<exists>a. v = a \<cdot>\<^sub>v w

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma temp_dyn_down_real_arith:
  assumes "a > 0" and Thyps: "0 < Tmin" "Tmin \<le> T" "T \<le> Tmax"
    and thyps: "0 \<le> (t::real)" "\<forall>\<tau>\<in>{0..t}. \<tau> \<le> - (ln (Tmin / T) / a) "
  shows "Tmin \<le> exp (-a * t) * T" and "exp (-a * t) * T \<le> Tmax"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Tmin \<le> exp (- a * t) * T &&& exp (- a * t) * T \<le> Tmax
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Tmin \<le> exp (- a * t) * T
 2. exp (- a * t) * T \<le> Tmax
[PROOF STEP]
have "0 \<le> t \<and> t \<le> - (ln (Tmin / T) / a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> t \<and> t \<le> - (ln (Tmin / T) / a)
[PROOF STEP]
using thyps
[PROOF STATE]
proof (prove)
using this:
0 \<le> t
\<forall>\<tau>\<in>{0..t}. \<tau> \<le> - (ln (Tmin / T) / a)

goal (1 subgoal):
 1. 0 \<le> t \<and> t \<le> - (ln (Tmin / T) / a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> t \<and> t \<le> - (ln (Tmin / T) / a)

goal (2 subgoals):
 1. Tmin \<le> exp (- a * t) * T
 2. exp (- a * t) * T \<le> Tmax
[PROOF STEP]
hence "ln (Tmin / T) \<le> - a * t \<and> - a * t \<le> 0"
[PROOF STATE]
proof (prove)
using this:
0 \<le> t \<and> t \<le> - (ln (Tmin / T) / a)

goal (1 subgoal):
 1. ln (Tmin / T) \<le> - a * t \<and> - a * t \<le> 0
[PROOF STEP]
using assms(1) divide_le_cancel
[PROOF STATE]
proof (prove)
using this:
0 \<le> t \<and> t \<le> - (ln (Tmin / T) / a)
0 < a
(?a / ?c \<le> ?b / ?c) = (((0::?'a) < ?c \<longrightarrow> ?a \<le> ?b) \<and> (?c < (0::?'a) \<longrightarrow> ?b \<le> ?a))

goal (1 subgoal):
 1. ln (Tmin / T) \<le> - a * t \<and> - a * t \<le> 0
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
ln (Tmin / T) \<le> - a * t \<and> - a * t \<le> 0

goal (2 subgoals):
 1. Tmin \<le> exp (- a * t) * T
 2. exp (- a * t) * T \<le> Tmax
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ln (Tmin / T) \<le> - a * t \<and> - a * t \<le> 0

goal (2 subgoals):
 1. Tmin \<le> exp (- a * t) * T
 2. exp (- a * t) * T \<le> Tmax
[PROOF STEP]
have "Tmin / T > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < Tmin / T
[PROOF STEP]
using Thyps
[PROOF STATE]
proof (prove)
using this:
0 < Tmin
Tmin \<le> T
T \<le> Tmax

goal (1 subgoal):
 1. 0 < Tmin / T
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < Tmin / T

goal (2 subgoals):
 1. Tmin \<le> exp (- a * t) * T
 2. exp (- a * t) * T \<le> Tmax
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
ln (Tmin / T) \<le> - a * t \<and> - a * t \<le> 0
0 < Tmin / T
[PROOF STEP]
have obs: "Tmin / T \<le> exp (-a * t)" "exp (-a * t) \<le> 1"
[PROOF STATE]
proof (prove)
using this:
ln (Tmin / T) \<le> - a * t \<and> - a * t \<le> 0
0 < Tmin / T

goal (1 subgoal):
 1. Tmin / T \<le> exp (- a * t) &&& exp (- a * t) \<le> 1
[PROOF STEP]
using exp_ln exp_le_one_iff
[PROOF STATE]
proof (prove)
using this:
ln (Tmin / T) \<le> - a * t \<and> - a * t \<le> 0
0 < Tmin / T
0 < ?x \<Longrightarrow> exp (ln ?x) = ?x
(exp ?x \<le> 1) = (?x \<le> 0)

goal (1 subgoal):
 1. Tmin / T \<le> exp (- a * t) &&& exp (- a * t) \<le> 1
[PROOF STEP]
by (metis exp_less_cancel_iff not_less, simp)
[PROOF STATE]
proof (state)
this:
Tmin / T \<le> exp (- a * t)
exp (- a * t) \<le> 1

goal (2 subgoals):
 1. Tmin \<le> exp (- a * t) * T
 2. exp (- a * t) * T \<le> Tmax
[PROOF STEP]
thus "Tmin \<le> exp (-a * t) * T"
[PROOF STATE]
proof (prove)
using this:
Tmin / T \<le> exp (- a * t)
exp (- a * t) \<le> 1

goal (1 subgoal):
 1. Tmin \<le> exp (- a * t) * T
[PROOF STEP]
using Thyps
[PROOF STATE]
proof (prove)
using this:
Tmin / T \<le> exp (- a * t)
exp (- a * t) \<le> 1
0 < Tmin
Tmin \<le> T
T \<le> Tmax

goal (1 subgoal):
 1. Tmin \<le> exp (- a * t) * T
[PROOF STEP]
by (simp add: pos_divide_le_eq)
[PROOF STATE]
proof (state)
this:
Tmin \<le> exp (- a * t) * T

goal (1 subgoal):
 1. exp (- a * t) * T \<le> Tmax
[PROOF STEP]
show "exp (-a * t) * T \<le> Tmax"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp (- a * t) * T \<le> Tmax
[PROOF STEP]
using Thyps mult_left_le_one_le[OF _ exp_ge_zero obs(2), of T]
      less_eq_real_def order_trans_rules(23)
[PROOF STATE]
proof (prove)
using this:
0 < Tmin
Tmin \<le> T
T \<le> Tmax
0 \<le> T \<Longrightarrow> exp (- a * t) * T \<le> T
(?x \<le> ?y) = (?x < ?y \<or> ?x = ?y)
\<lbrakk>?x \<le> ?y; ?y \<le> ?z\<rbrakk> \<Longrightarrow> ?x \<le> ?z

goal (1 subgoal):
 1. exp (- a * t) * T \<le> Tmax
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
exp (- a * t) * T \<le> Tmax

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma minus_in_Ints_vec_iff[simp]: "(-x) \<in> \<int>\<^sub>v \<longleftrightarrow> (x :: 'a :: ring_1 vec) \<in> \<int>\<^sub>v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- x \<in> \<int>\<^sub>v) = (x \<in> \<int>\<^sub>v)
[PROOF STEP]
unfolding Ints_vec_vec_set
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (set\<^sub>v (- x) \<subseteq> \<int>) = (set\<^sub>v x \<subseteq> \<int>)
[PROOF STEP]
by (auto simp: minus_in_Ints_iff)


[STATEMENT]
lemma Liminf_mono:
  assumes ev: "eventually (\<lambda>x. f x \<le> g x) F"
  shows "Liminf F f \<le> Liminf F g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Liminf F f \<le> Liminf F g
[PROOF STEP]
unfolding Liminf_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SUP P\<in>{P. eventually P F}. Inf (f ` Collect P)) \<le> (SUP P\<in>{P. eventually P F}. Inf (g ` Collect P))
[PROOF STEP]
proof (safe intro!: SUP_mono)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>P. eventually P F \<Longrightarrow> \<exists>m\<in>{P. eventually P F}. Inf (f ` Collect P) \<le> Inf (g ` Collect m)
[PROOF STEP]
fix P
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>P. eventually P F \<Longrightarrow> \<exists>m\<in>{P. eventually P F}. Inf (f ` Collect P) \<le> Inf (g ` Collect m)
[PROOF STEP]
assume "eventually P F"
[PROOF STATE]
proof (state)
this:
eventually P F

goal (1 subgoal):
 1. \<And>P. eventually P F \<Longrightarrow> \<exists>m\<in>{P. eventually P F}. Inf (f ` Collect P) \<le> Inf (g ` Collect m)
[PROOF STEP]
with ev
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in F. f x \<le> g x
eventually P F
[PROOF STEP]
have "eventually (\<lambda>x. f x \<le> g x \<and> P x) F" (is "eventually ?Q F")
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. f x \<le> g x
eventually P F

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. f x \<le> g x \<and> P x
[PROOF STEP]
by (rule eventually_conj)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. f x \<le> g x \<and> P x

goal (1 subgoal):
 1. \<And>P. eventually P F \<Longrightarrow> \<exists>m\<in>{P. eventually P F}. Inf (f ` Collect P) \<le> Inf (g ` Collect m)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in F. f x \<le> g x \<and> P x
[PROOF STEP]
show "\<exists>Q\<in>{P. eventually P F}. Inf (f ` (Collect P)) \<le> Inf (g ` (Collect Q))"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. f x \<le> g x \<and> P x

goal (1 subgoal):
 1. \<exists>Q\<in>{P. eventually P F}. Inf (f ` Collect P) \<le> Inf (g ` Collect Q)
[PROOF STEP]
by (intro bexI[of _ ?Q]) (auto intro!: INF_mono)
[PROOF STATE]
proof (state)
this:
\<exists>Q\<in>{P. eventually P F}. Inf (f ` Collect P) \<le> Inf (g ` Collect Q)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma borel_integrable_atLeastAtMost:
  fixes f :: "real \<Rightarrow> real"
  assumes f: "\<And>x. a \<le> x \<Longrightarrow> x \<le> b \<Longrightarrow> isCont f x"
  shows "integrable lborel (\<lambda>x. f x * indicator {a .. b} x)" (is "integrable _ ?f")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable lborel (\<lambda>x. f x * indicat_real {a..b} x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integrable lborel (\<lambda>x. f x * indicat_real {a..b} x)
[PROOF STEP]
have "integrable lborel (\<lambda>x. indicator {a .. b} x *\<^sub>R f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable lborel (\<lambda>x. indicat_real {a..b} x *\<^sub>R f x)
[PROOF STEP]
proof (rule borel_integrable_compact)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. compact {a..b}
 2. continuous_on {a..b} f
[PROOF STEP]
from f
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>a \<le> ?x; ?x \<le> b\<rbrakk> \<Longrightarrow> isCont f ?x
[PROOF STEP]
show "continuous_on {a..b} f"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>a \<le> ?x; ?x \<le> b\<rbrakk> \<Longrightarrow> isCont f ?x

goal (1 subgoal):
 1. continuous_on {a..b} f
[PROOF STEP]
by (auto intro: continuous_at_imp_continuous_on)
[PROOF STATE]
proof (state)
this:
continuous_on {a..b} f

goal (1 subgoal):
 1. compact {a..b}
[PROOF STEP]
qed simp
[PROOF STATE]
proof (state)
this:
integrable lborel (\<lambda>x. indicat_real {a..b} x *\<^sub>R f x)

goal (1 subgoal):
 1. integrable lborel (\<lambda>x. f x * indicat_real {a..b} x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
integrable lborel (\<lambda>x. indicat_real {a..b} x *\<^sub>R f x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
integrable lborel (\<lambda>x. indicat_real {a..b} x *\<^sub>R f x)

goal (1 subgoal):
 1. integrable lborel (\<lambda>x. f x * indicat_real {a..b} x)
[PROOF STEP]
by (auto simp: mult.commute)
[PROOF STATE]
proof (state)
this:
integrable lborel (\<lambda>x. f x * indicat_real {a..b} x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma homeomorphic_frontiers:
  fixes S :: "'a::euclidean_space set" and T :: "'b::euclidean_space set"
  assumes "S homeomorphic T" "closed S" "closed T"
          "interior S = {} \<longleftrightarrow> interior T = {}"
    shows "(frontier S) homeomorphic (frontier T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. frontier S homeomorphic frontier T
[PROOF STEP]
proof (cases "interior T = {}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. interior T = {} \<Longrightarrow> frontier S homeomorphic frontier T
 2. interior T \<noteq> {} \<Longrightarrow> frontier S homeomorphic frontier T
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
interior T = {}

goal (2 subgoals):
 1. interior T = {} \<Longrightarrow> frontier S homeomorphic frontier T
 2. interior T \<noteq> {} \<Longrightarrow> frontier S homeomorphic frontier T
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
interior T = {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
interior T = {}

goal (1 subgoal):
 1. frontier S homeomorphic frontier T
[PROOF STEP]
by (metis Diff_empty assms closure_eq frontier_def)
[PROOF STATE]
proof (state)
this:
frontier S homeomorphic frontier T

goal (1 subgoal):
 1. interior T \<noteq> {} \<Longrightarrow> frontier S homeomorphic frontier T
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. interior T \<noteq> {} \<Longrightarrow> frontier S homeomorphic frontier T
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
interior T \<noteq> {}

goal (1 subgoal):
 1. interior T \<noteq> {} \<Longrightarrow> frontier S homeomorphic frontier T
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
interior T \<noteq> {}
[PROOF STEP]
have "DIM('a) = DIM('b)"
[PROOF STATE]
proof (prove)
using this:
interior T \<noteq> {}

goal (1 subgoal):
 1. DIM('a) = DIM('b)
[PROOF STEP]
using assms homeomorphic_interiors homeomorphic_open_imp_same_dimension
[PROOF STATE]
proof (prove)
using this:
interior T \<noteq> {}
S homeomorphic T
closed S
closed T
(interior S = {}) = (interior T = {})
\<lbrakk>?S homeomorphic ?T; (interior ?S = {}) = (interior ?T = {})\<rbrakk> \<Longrightarrow> interior ?S homeomorphic interior ?T
\<lbrakk>?S homeomorphic ?T; open ?S; ?S \<noteq> {}; open ?T; ?T \<noteq> {}\<rbrakk> \<Longrightarrow> DIM(?'a) = DIM(?'b)

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

goal (1 subgoal):
 1. interior T \<noteq> {} \<Longrightarrow> frontier S homeomorphic frontier T
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
DIM('a) = DIM('b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
DIM('a) = DIM('b)

goal (1 subgoal):
 1. frontier S homeomorphic frontier T
[PROOF STEP]
using assms homeomorphic_frontiers_same_dimension
[PROOF STATE]
proof (prove)
using this:
DIM('a) = DIM('b)
S homeomorphic T
closed S
closed T
(interior S = {}) = (interior T = {})
\<lbrakk>?S homeomorphic ?T; closed ?S; closed ?T; DIM(?'a) = DIM(?'b)\<rbrakk> \<Longrightarrow> frontier ?S homeomorphic frontier ?T

goal (1 subgoal):
 1. frontier S homeomorphic frontier T
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
frontier S homeomorphic frontier T

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma quadratic_shape2a:
  fixes a b c x y::"real"
  assumes "a < 0"
  assumes "x < y \<and> a*x^2 + b*x + c = 0 \<and> a*y^2 + b*y + c = 0"
  shows "\<And>z. (z > x \<and> z < y \<Longrightarrow> a*z^2 + b*z + c > 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>z. x < z \<and> z < y \<Longrightarrow> 0 < a * z\<^sup>2 + b * z + c
[PROOF STEP]
using quadratic_shape1a[where a= "-a", where b = "-b", where c = "-c", where x = "x", where y = "y"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < - a; x < y \<and> - a * x\<^sup>2 + - b * x + - c = 0 \<and> - a * y\<^sup>2 + - b * y + - c = 0; x < ?z \<and> ?z < y\<rbrakk> \<Longrightarrow> - a * ?z\<^sup>2 + - b * ?z + - c < 0

goal (1 subgoal):
 1. \<And>z. x < z \<and> z < y \<Longrightarrow> 0 < a * z\<^sup>2 + b * z + c
[PROOF STEP]
using assms(1) assms(2)
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < - a; x < y \<and> - a * x\<^sup>2 + - b * x + - c = 0 \<and> - a * y\<^sup>2 + - b * y + - c = 0; x < ?z \<and> ?z < y\<rbrakk> \<Longrightarrow> - a * ?z\<^sup>2 + - b * ?z + - c < 0
a < 0
x < y \<and> a * x\<^sup>2 + b * x + c = 0 \<and> a * y\<^sup>2 + b * y + c = 0

goal (1 subgoal):
 1. \<And>z. x < z \<and> z < y \<Longrightarrow> 0 < a * z\<^sup>2 + b * z + c
[PROOF STEP]
by fastforce


[STATEMENT]
lemma rtrancl_listrel1_ConsI1:
  "(xs,ys) \<in> (listrel1 r)\<^sup>* \<Longrightarrow> (x#xs,x#ys) \<in> (listrel1 r)\<^sup>*"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (xs, ys) \<in> (listrel1 r)\<^sup>* \<Longrightarrow> (x # xs, x # ys) \<in> (listrel1 r)\<^sup>*
[PROOF STEP]
proof (induction rule: rtrancl.induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>a. (x # a, x # a) \<in> (listrel1 r)\<^sup>*
 2. \<And>a b c. \<lbrakk>(a, b) \<in> (listrel1 r)\<^sup>*; (x # a, x # b) \<in> (listrel1 r)\<^sup>*; (b, c) \<in> listrel1 r\<rbrakk> \<Longrightarrow> (x # a, x # c) \<in> (listrel1 r)\<^sup>*
[PROOF STEP]
case (rtrancl_into_rtrancl a b c)
[PROOF STATE]
proof (state)
this:
(a, b) \<in> (listrel1 r)\<^sup>*
(b, c) \<in> listrel1 r
(x # a, x # b) \<in> (listrel1 r)\<^sup>*

goal (2 subgoals):
 1. \<And>a. (x # a, x # a) \<in> (listrel1 r)\<^sup>*
 2. \<And>a b c. \<lbrakk>(a, b) \<in> (listrel1 r)\<^sup>*; (x # a, x # b) \<in> (listrel1 r)\<^sup>*; (b, c) \<in> listrel1 r\<rbrakk> \<Longrightarrow> (x # a, x # c) \<in> (listrel1 r)\<^sup>*
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(a, b) \<in> (listrel1 r)\<^sup>*
(b, c) \<in> listrel1 r
(x # a, x # b) \<in> (listrel1 r)\<^sup>*
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(a, b) \<in> (listrel1 r)\<^sup>*
(b, c) \<in> listrel1 r
(x # a, x # b) \<in> (listrel1 r)\<^sup>*

goal (1 subgoal):
 1. (x # a, x # c) \<in> (listrel1 r)\<^sup>*
[PROOF STEP]
by (metis listrel1I2 rtrancl.rtrancl_into_rtrancl)
[PROOF STATE]
proof (state)
this:
(x # a, x # c) \<in> (listrel1 r)\<^sup>*

goal (1 subgoal):
 1. \<And>a. (x # a, x # a) \<in> (listrel1 r)\<^sup>*
[PROOF STEP]
qed auto


[STATEMENT]
lemma binary_expression_leeq1:
  assumes "\<And>n. a n \<in> {0,1 :: nat}"
  shows "(\<Sum>n. real (a (n + k)) * (1 / 2) ^ Suc (n + k)) \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n. real (a (n + k)) * (1 / 2) ^ Suc (n + k)) \<le> 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>n. real (a (n + k)) * (1 / 2) ^ Suc (n + k)) \<le> 1
[PROOF STEP]
have "(\<Sum>n. real (a (n + k)) * (1 / 2) ^ Suc (n + k)) \<le> (\<Sum>n. (1/2)^(Suc n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n. real (a (n + k)) * (1 / 2) ^ Suc (n + k)) \<le> (\<Sum>n. (1 / 2) ^ Suc n)
[PROOF STEP]
proof(rule suminf_le)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>n. real (a (n + k)) * (1 / 2) ^ Suc (n + k) \<le> (1 / 2) ^ Suc n
 2. summable (\<lambda>n. real (a (n + k)) * (1 / 2) ^ Suc (n + k))
 3. summable (\<lambda>n. (1 / 2) ^ Suc n)
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>n. real (a (n + k)) * (1 / 2) ^ Suc (n + k) \<le> (1 / 2) ^ Suc n
 2. summable (\<lambda>n. real (a (n + k)) * (1 / 2) ^ Suc (n + k))
 3. summable (\<lambda>n. (1 / 2) ^ Suc n)
[PROOF STEP]
have 1:"real (a (n + k)) * (1 / 2) ^ Suc (n + k) \<le> (1 / 2) ^ Suc (n + k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (a (n + k)) * (1 / 2) ^ Suc (n + k) \<le> (1 / 2) ^ Suc (n + k)
[PROOF STEP]
using assms[of "n+k"]
[PROOF STATE]
proof (prove)
using this:
a (n + k) \<in> {0, 1}

goal (1 subgoal):
 1. real (a (n + k)) * (1 / 2) ^ Suc (n + k) \<le> (1 / 2) ^ Suc (n + k)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real (a (n + k)) * (1 / 2) ^ Suc (n + k) \<le> (1 / 2) ^ Suc (n + k)

goal (3 subgoals):
 1. \<And>n. real (a (n + k)) * (1 / 2) ^ Suc (n + k) \<le> (1 / 2) ^ Suc n
 2. summable (\<lambda>n. real (a (n + k)) * (1 / 2) ^ Suc (n + k))
 3. summable (\<lambda>n. (1 / 2) ^ Suc n)
[PROOF STEP]
have 2:"((1::real) / 2) ^ Suc (n + k) \<le> (1 / 2) ^ Suc n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 / 2) ^ Suc (n + k) \<le> (1 / 2) ^ Suc n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(1 / 2) ^ Suc (n + k) \<le> (1 / 2) ^ Suc n

goal (3 subgoals):
 1. \<And>n. real (a (n + k)) * (1 / 2) ^ Suc (n + k) \<le> (1 / 2) ^ Suc n
 2. summable (\<lambda>n. real (a (n + k)) * (1 / 2) ^ Suc (n + k))
 3. summable (\<lambda>n. (1 / 2) ^ Suc n)
[PROOF STEP]
show "real (a (n + k)) * (1 / 2) ^ Suc (n + k) \<le> (1 / 2) ^ Suc n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (a (n + k)) * (1 / 2) ^ Suc (n + k) \<le> (1 / 2) ^ Suc n
[PROOF STEP]
by(rule order.trans[OF 1 2])
[PROOF STATE]
proof (state)
this:
real (a (n + k)) * (1 / 2) ^ Suc (n + k) \<le> (1 / 2) ^ Suc n

goal (2 subgoals):
 1. summable (\<lambda>n. real (a (n + k)) * (1 / 2) ^ Suc (n + k))
 2. summable (\<lambda>n. (1 / 2) ^ Suc n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. summable (\<lambda>n. real (a (n + k)) * (1 / 2) ^ Suc (n + k))
 2. summable (\<lambda>n. (1 / 2) ^ Suc n)
[PROOF STEP]
show "summable (\<lambda>n. real (a (n + k)) * (1 / 2) ^ Suc (n + k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. real (a (n + k)) * (1 / 2) ^ Suc (n + k))
[PROOF STEP]
using binary_expression_summable[of a] summable_iff_shift[of "\<lambda>n. real (a n) * (1 / 2) ^ Suc n" k] assms
[PROOF STATE]
proof (prove)
using this:
(\<And>n. a n \<in> {0, 1}) \<Longrightarrow> summable (\<lambda>n. real (a n) * (1 / 2) ^ Suc n)
summable (\<lambda>n. real (a (n + k)) * (1 / 2) ^ Suc (n + k)) = summable (\<lambda>n. real (a n) * (1 / 2) ^ Suc n)
a ?n \<in> {0, 1}

goal (1 subgoal):
 1. summable (\<lambda>n. real (a (n + k)) * (1 / 2) ^ Suc (n + k))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. real (a (n + k)) * (1 / 2) ^ Suc (n + k))

goal (1 subgoal):
 1. summable (\<lambda>n. (1 / 2) ^ Suc n)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. summable (\<lambda>n. (1 / 2) ^ Suc n)
[PROOF STEP]
show "summable (\<lambda>n. ((1::real) / 2) ^ Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. (1 / 2) ^ Suc n)
[PROOF STEP]
using power_half_summable
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>n. (1 / 2) ^ Suc n)

goal (1 subgoal):
 1. summable (\<lambda>n. (1 / 2) ^ Suc n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. (1 / 2) ^ Suc n)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>n. real (a (n + k)) * (1 / 2) ^ Suc (n + k)) \<le> (\<Sum>n. (1 / 2) ^ Suc n)

goal (1 subgoal):
 1. (\<Sum>n. real (a (n + k)) * (1 / 2) ^ Suc (n + k)) \<le> 1
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>n. real (a (n + k)) * (1 / 2) ^ Suc (n + k)) \<le> (\<Sum>n. (1 / 2) ^ Suc n)

goal (1 subgoal):
 1. (\<Sum>n. real (a (n + k)) * (1 / 2) ^ Suc (n + k)) \<le> 1
[PROOF STEP]
using power_half_series sums_unique
[PROOF STATE]
proof (prove)
using this:
(\<Sum>n. real (a (n + k)) * (1 / 2) ^ Suc (n + k)) \<le> (\<Sum>n. (1 / 2) ^ Suc n)
(\<lambda>n. (1 / 2) ^ Suc n) sums 1
?f sums ?s \<Longrightarrow> ?s = suminf ?f

goal (1 subgoal):
 1. (\<Sum>n. real (a (n + k)) * (1 / 2) ^ Suc (n + k)) \<le> 1
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(\<Sum>n. real (a (n + k)) * (1 / 2) ^ Suc (n + k)) \<le> 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma add_set_elem:
  "\<phi> \<in> A \<otimes> B \<longleftrightarrow> (\<exists>a b. Some \<phi> = a \<oplus> b \<and> a \<in> A \<and> b \<in> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<phi> \<in> A \<otimes> B) = (\<exists>a b. Some \<phi> = a \<oplus> b \<and> a \<in> A \<and> b \<in> B)
[PROOF STEP]
using add_set_def
[PROOF STATE]
proof (prove)
using this:
?A \<otimes> ?B = {uu_. \<exists>\<phi> a b. uu_ = \<phi> \<and> a \<in> ?A \<and> b \<in> ?B \<and> Some \<phi> = a \<oplus> b}

goal (1 subgoal):
 1. (\<phi> \<in> A \<otimes> B) = (\<exists>a b. Some \<phi> = a \<oplus> b \<and> a \<in> A \<and> b \<in> B)
[PROOF STEP]
by auto


[STATEMENT]
lemma zhmset_of_plus: "zhmset_of (A + B) = zhmset_of A + zhmset_of B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zhmset_of (A + B) = zhmset_of A + zhmset_of B
[PROOF STEP]
by (simp add: hmsetmset_plus ZHMSet_plus zmset_of_plus)


[STATEMENT]
lemma division_of_Union:
  assumes "finite f"
    and "\<And>p. p \<in> f \<Longrightarrow> p division_of (\<Union>p)"
    and "\<And>k1 k2. k1 \<in> \<Union>f \<Longrightarrow> k2 \<in> \<Union>f \<Longrightarrow> k1 \<noteq> k2 \<Longrightarrow> interior k1 \<inter> interior k2 = {}"
  shows "\<Union>f division_of \<Union>(\<Union>f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> f division_of \<Union> (\<Union> f)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite f
?p \<in> f \<Longrightarrow> ?p division_of \<Union> ?p
\<lbrakk>?k1.0 \<in> \<Union> f; ?k2.0 \<in> \<Union> f; ?k1.0 \<noteq> ?k2.0\<rbrakk> \<Longrightarrow> interior ?k1.0 \<inter> interior ?k2.0 = {}

goal (1 subgoal):
 1. \<Union> f division_of \<Union> (\<Union> f)
[PROOF STEP]
by (auto intro!: division_ofI)


[STATEMENT]
theorem wls_fresh_subst:
assumes "wls s X" and "wls (asSort ys) Y"
shows "fresh zs z (X #[Y / y]_ys) =
       (((zs = ys \<and> z = y) \<or> fresh zs z X) \<and> (fresh ys y X \<or> fresh zs z Y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fresh zs z (X #[Y / y]_ys) = ((zs = ys \<and> z = y \<or> fresh zs z X) \<and> (fresh ys y X \<or> fresh zs z Y))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
wls s X
wls (asSort ys) Y

goal (1 subgoal):
 1. fresh zs z (X #[Y / y]_ys) = ((zs = ys \<and> z = y \<or> fresh zs z X) \<and> (fresh ys y X \<or> fresh zs z Y))
[PROOF STEP]
by(simp add: fresh_subst)


[STATEMENT]
lemma tensor_op_jnf_dim[simp]:
  \<open>dim_row (tensor_op_jnf a b) = dim_row a * dim_row b\<close>
  \<open>dim_col (tensor_op_jnf a b) = dim_col a * dim_col b\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (tensor_op_jnf a b) = dim_row a * dim_row b &&& dim_col (tensor_op_jnf a b) = dim_col a * dim_col b
[PROOF STEP]
unfolding tensor_op_jnf_def Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (mat (dim_row a * dim_row b) (dim_col a * dim_col b) (\<lambda>(i, j). case tensor_unpack (dim_row a) (dim_row b) i of (i1, i2) \<Rightarrow> case tensor_unpack (dim_col a) (dim_col b) j of (j1, j2) \<Rightarrow> a $$ (i1, j1) * b $$ (i2, j2))) = dim_row a * dim_row b &&& dim_col (mat (dim_row a * dim_row b) (dim_col a * dim_col b) (\<lambda>(i, j). case tensor_unpack (dim_row a) (dim_row b) i of (i1, i2) \<Rightarrow> case tensor_unpack (dim_col a) (dim_col b) j of (j1, j2) \<Rightarrow> a $$ (i1, j1) * b $$ (i2, j2))) = dim_col a * dim_col b
[PROOF STEP]
by simp_all


[STATEMENT]
lemma commutativity2:
  assumes leadsTo: "F \<in> A leadsTo B"
      and dcommutes:
        "\<forall>act \<in> Acts F.
         \<forall>s \<in> T. \<forall>t. (s,t) \<in> relcl L -->
                      s \<in> B | t \<in> B | (funof act s, funof act t) \<in> relcl L"
      and determ: "!!act. act \<in> Acts F ==> single_valued act"
      and total: "!!act. act \<in> Acts F ==> Domain act = UNIV"
      and lattice:  "lattice L"
      and BL: "B \<in> L"
      and TL: "T \<in> L"
      and Fstable: "F \<in> stable T"
      and Gco: "!!X. X\<in>L ==> G \<in> X-B co X"
  shows "F\<squnion>G \<in> T\<inter>A leadsTo B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F \<squnion> G \<in> T \<inter> A \<longmapsto> B
[PROOF STEP]
apply (rule commutativity1 [OF leadsTo lattice])
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. B \<in> L
 2. T \<in> L
 3. F \<in> UNITY.stable T
 4. \<And>X. X \<in> L \<Longrightarrow> G \<in> X - B co X
 5. commutes F T B L
[PROOF STEP]
apply (simp_all add: Gco commutativity2_lemma dcommutes determ total
                     lattice BL TL Fstable)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma some_neq_not_eq [simp]: "\<not>((SOME x :: nat. x \<noteq> i) = i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SOME x. x \<noteq> i) \<noteq> i
[PROOF STEP]
by (subst some_eq_ex) (metis zero_neq_numeral)


[STATEMENT]
lemma tendsto_inf[tendsto_intros]:
  fixes X :: "'a \<Rightarrow> 'b::ordered_euclidean_space"
  assumes "(X \<longlongrightarrow> x) net" "(Y \<longlongrightarrow> y) net"
  shows "((\<lambda>i. inf (X i) (Y i)) \<longlongrightarrow> inf x y) net"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>i. inf (X i) (Y i)) \<longlongrightarrow> inf x y) net
[PROOF STEP]
unfolding inf_min eucl_inf
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>i. \<Sum>ia\<in>Basis. min (X i \<bullet> ia) (Y i \<bullet> ia) *\<^sub>R ia) \<longlongrightarrow> (\<Sum>i\<in>Basis. min (x \<bullet> i) (y \<bullet> i) *\<^sub>R i)) net
[PROOF STEP]
by (intro assms tendsto_intros)


[STATEMENT]
lemma derivative_component_fun_component_at_within_gen:
  assumes gamma_differentiable: "\<forall>x \<in> s. \<gamma> differentiable at x" and s_subset: "s \<subseteq> {0..1}"
  shows "\<forall>x \<in> s. vector_derivative (\<lambda>x. \<gamma> x) (at x within {0..1}) \<bullet> (i::'a:: euclidean_space)
           =  vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>s. vector_derivative \<gamma> (at x within {0..1}) \<bullet> i = vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1})
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>x\<in>s. vector_derivative \<gamma> (at x within {0..1}) \<bullet> i = vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1})
[PROOF STEP]
have gamma_i_component_smooth:
    "\<forall>x \<in> s. (\<lambda>x. \<gamma> x \<bullet> i) differentiable at x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>s. (\<lambda>x. \<gamma> x \<bullet> i) differentiable at x
[PROOF STEP]
using gamma_differentiable
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>s. \<gamma> differentiable at x

goal (1 subgoal):
 1. \<forall>x\<in>s. (\<lambda>x. \<gamma> x \<bullet> i) differentiable at x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>s. (\<lambda>x. \<gamma> x \<bullet> i) differentiable at x

goal (1 subgoal):
 1. \<forall>x\<in>s. vector_derivative \<gamma> (at x within {0..1}) \<bullet> i = vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1})
[PROOF STEP]
show "\<forall>x \<in> s. vector_derivative (\<lambda>x. \<gamma> x) (at x within {0..1}) \<bullet> i
                                  =  vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>s. vector_derivative \<gamma> (at x within {0..1}) \<bullet> i = vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1})
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> s \<Longrightarrow> vector_derivative \<gamma> (at x within {0..1}) \<bullet> i = vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1})
[PROOF STEP]
fix x::real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> s \<Longrightarrow> vector_derivative \<gamma> (at x within {0..1}) \<bullet> i = vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1})
[PROOF STEP]
assume x_within_bounds: "x \<in> s"
[PROOF STATE]
proof (state)
this:
x \<in> s

goal (1 subgoal):
 1. \<And>x. x \<in> s \<Longrightarrow> vector_derivative \<gamma> (at x within {0..1}) \<bullet> i = vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1})
[PROOF STEP]
have gamma_deriv_at_within:
        "vector_derivative (\<lambda>x. \<gamma> x) (at x within {0..1}) = vector_derivative (\<lambda>x. \<gamma> x) (at x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vector_derivative \<gamma> (at x within {0..1}) = vector_derivative \<gamma> (at x)
[PROOF STEP]
using gamma_deriv_at_within_gen[of "0" "1"] x_within_bounds
        gamma_differentiable s_subset
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < 1; ?x \<in> ?s; ?s \<subseteq> {0..1}; \<forall>x\<in>?s. ?\<gamma> differentiable at x\<rbrakk> \<Longrightarrow> vector_derivative ?\<gamma> (at ?x within {0..1}) = vector_derivative ?\<gamma> (at ?x)
x \<in> s
\<forall>x\<in>s. \<gamma> differentiable at x
s \<subseteq> {0..1}

goal (1 subgoal):
 1. vector_derivative \<gamma> (at x within {0..1}) = vector_derivative \<gamma> (at x)
[PROOF STEP]
by (auto simp add: vector_derivative_works)
[PROOF STATE]
proof (state)
this:
vector_derivative \<gamma> (at x within {0..1}) = vector_derivative \<gamma> (at x)

goal (1 subgoal):
 1. \<And>x. x \<in> s \<Longrightarrow> vector_derivative \<gamma> (at x within {0..1}) \<bullet> i = vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1})
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vector_derivative \<gamma> (at x within {0..1}) = vector_derivative \<gamma> (at x)
[PROOF STEP]
have gamma_component_deriv_at_within:
      "vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x)
       = vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1})"
[PROOF STATE]
proof (prove)
using this:
vector_derivative \<gamma> (at x within {0..1}) = vector_derivative \<gamma> (at x)

goal (1 subgoal):
 1. vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x) = vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1})
[PROOF STEP]
using gamma_deriv_at_within_gen[of "0" "1", where \<gamma> = "(\<lambda>x. \<gamma> x \<bullet> i)"] x_within_bounds
        gamma_i_component_smooth s_subset
[PROOF STATE]
proof (prove)
using this:
vector_derivative \<gamma> (at x within {0..1}) = vector_derivative \<gamma> (at x)
\<lbrakk>0 < 1; ?x \<in> ?s; ?s \<subseteq> {0..1}; \<forall>x\<in>?s. (\<lambda>x. \<gamma> x \<bullet> i) differentiable at x\<rbrakk> \<Longrightarrow> vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at ?x within {0..1}) = vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at ?x)
x \<in> s
\<forall>x\<in>s. (\<lambda>x. \<gamma> x \<bullet> i) differentiable at x
s \<subseteq> {0..1}

goal (1 subgoal):
 1. vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x) = vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1})
[PROOF STEP]
by (auto simp add: vector_derivative_works)
[PROOF STATE]
proof (state)
this:
vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x) = vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1})

goal (1 subgoal):
 1. \<And>x. x \<in> s \<Longrightarrow> vector_derivative \<gamma> (at x within {0..1}) \<bullet> i = vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1})
[PROOF STEP]
have gamma_component_deriv_eq_gamma_deriv_component:
      "vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x) = vector_derivative (\<lambda>x. \<gamma> x) (at x) \<bullet> i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x) = vector_derivative \<gamma> (at x) \<bullet> i
[PROOF STEP]
using derivative_component_fun_component[of "\<gamma>" "x" "i"] gamma_differentiable x_within_bounds
[PROOF STATE]
proof (prove)
using this:
\<gamma> differentiable at x \<Longrightarrow> vector_derivative \<gamma> (at x) \<bullet> i = vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x)
\<forall>x\<in>s. \<gamma> differentiable at x
x \<in> s

goal (1 subgoal):
 1. vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x) = vector_derivative \<gamma> (at x) \<bullet> i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x) = vector_derivative \<gamma> (at x) \<bullet> i

goal (1 subgoal):
 1. \<And>x. x \<in> s \<Longrightarrow> vector_derivative \<gamma> (at x within {0..1}) \<bullet> i = vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1})
[PROOF STEP]
show "vector_derivative \<gamma> (at x within {0..1}) \<bullet> i = vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vector_derivative \<gamma> (at x within {0..1}) \<bullet> i = vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1})
[PROOF STEP]
using gamma_component_deriv_eq_gamma_deriv_component gamma_component_deriv_at_within gamma_deriv_at_within
[PROOF STATE]
proof (prove)
using this:
vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x) = vector_derivative \<gamma> (at x) \<bullet> i
vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x) = vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1})
vector_derivative \<gamma> (at x within {0..1}) = vector_derivative \<gamma> (at x)

goal (1 subgoal):
 1. vector_derivative \<gamma> (at x within {0..1}) \<bullet> i = vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vector_derivative \<gamma> (at x within {0..1}) \<bullet> i = vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1})

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>s. vector_derivative \<gamma> (at x within {0..1}) \<bullet> i = vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x within {0..1})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem vebt_buildup_bound: "u = 2^n \<Longrightarrow> T\<^sub>b\<^sub>u\<^sub>i\<^sub>l\<^sub>d\<^sub>u\<^sub>p  n \<le> 26 * u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u = 2 ^ n \<Longrightarrow> T\<^sub>b\<^sub>u\<^sub>i\<^sub>l\<^sub>d\<^sub>u\<^sub>p n \<le> 26 * u
[PROOF STEP]
using count_buildup'[of n] t_buildup_cnt[of n]
[PROOF STATE]
proof (prove)
using this:
cnt (vebt_buildup n) \<le> real (2 * 2 ^ n)
real (T\<^sub>b\<^sub>u\<^sub>i\<^sub>l\<^sub>d\<^sub>u\<^sub>p n) \<le> cnt (vebt_buildup n) * 13

goal (1 subgoal):
 1. u = 2 ^ n \<Longrightarrow> T\<^sub>b\<^sub>u\<^sub>i\<^sub>l\<^sub>d\<^sub>u\<^sub>p n \<le> 26 * u
[PROOF STEP]
by linarith


[STATEMENT]
lemma Detects_eq_Un: "(A<==>B) = (A \<inter> B) \<union> (-A \<inter> -B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A <==> B = A \<inter> B \<union> - A \<inter> - B
[PROOF STEP]
by (unfold Equality_def, blast)


[STATEMENT]
lemma gbinomial_absorb_comp: "(a - of_nat k) * (a gchoose k) = a * ((a - 1) gchoose k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a - of_nat k) * (a gchoose k) = a * (a - (1::'a) gchoose k)
[PROOF STEP]
using pochhammer_absorb_comp[of a k]
[PROOF STATE]
proof (prove)
using this:
(a - of_nat k) * pochhammer (- a) k = a * pochhammer (- a + (1::'a)) k

goal (1 subgoal):
 1. (a - of_nat k) * (a gchoose k) = a * (a - (1::'a) gchoose k)
[PROOF STEP]
by (simp add: gbinomial_pochhammer)


[STATEMENT]
lemma prod_mset_prime_factorization_nat [simp]:
  "(n::nat) > 0 \<Longrightarrow> prod_mset (prime_factorization n) = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n \<Longrightarrow> \<Prod>\<^sub># (prime_factorization n) = n
[PROOF STEP]
by (subst prod_mset_prime_factorization) simp_all


[STATEMENT]
lemma det_Gauss_Jordan_upt_k_det_P:
fixes A::"'a::{field}^'n::{mod_type}^'n::{mod_type}"
shows "(fst (Gauss_Jordan_upt_k_det_P A k)) * det A = det (snd (Gauss_Jordan_upt_k_det_P A k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (Gauss_Jordan_upt_k_det_P A k) * det A = det (snd (Gauss_Jordan_upt_k_det_P A k))
[PROOF STEP]
proof (induct k)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. fst (Gauss_Jordan_upt_k_det_P A 0) * det A = det (snd (Gauss_Jordan_upt_k_det_P A 0))
 2. \<And>k. fst (Gauss_Jordan_upt_k_det_P A k) * det A = det (snd (Gauss_Jordan_upt_k_det_P A k)) \<Longrightarrow> fst (Gauss_Jordan_upt_k_det_P A (Suc k)) * det A = det (snd (Gauss_Jordan_upt_k_det_P A (Suc k)))
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. fst (Gauss_Jordan_upt_k_det_P A 0) * det A = det (snd (Gauss_Jordan_upt_k_det_P A 0))
 2. \<And>k. fst (Gauss_Jordan_upt_k_det_P A k) * det A = det (snd (Gauss_Jordan_upt_k_det_P A k)) \<Longrightarrow> fst (Gauss_Jordan_upt_k_det_P A (Suc k)) * det A = det (snd (Gauss_Jordan_upt_k_det_P A (Suc k)))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (Gauss_Jordan_upt_k_det_P A 0) * det A = det (snd (Gauss_Jordan_upt_k_det_P A 0))
[PROOF STEP]
unfolding Gauss_Jordan_upt_k_det_P_def Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (fst (foldl Gauss_Jordan_column_k_det_P (1::'a, 0, A) [0..<Suc 0]), snd (snd (foldl Gauss_Jordan_column_k_det_P (1::'a, 0, A) [0..<Suc 0]))) * det A = det (snd (fst (foldl Gauss_Jordan_column_k_det_P (1::'a, 0, A) [0..<Suc 0]), snd (snd (foldl Gauss_Jordan_column_k_det_P (1::'a, 0, A) [0..<Suc 0]))))
[PROOF STEP]
unfolding fst_conv snd_conv
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (foldl Gauss_Jordan_column_k_det_P (1::'a, 0, A) [0..<Suc 0]) * det A = det (snd (snd (foldl Gauss_Jordan_column_k_det_P (1::'a, 0, A) [0..<Suc 0])))
[PROOF STEP]
by (simp add:det_Gauss_Jordan_column_k_det_P)
[PROOF STATE]
proof (state)
this:
fst (Gauss_Jordan_upt_k_det_P A 0) * det A = det (snd (Gauss_Jordan_upt_k_det_P A 0))

goal (1 subgoal):
 1. \<And>k. fst (Gauss_Jordan_upt_k_det_P A k) * det A = det (snd (Gauss_Jordan_upt_k_det_P A k)) \<Longrightarrow> fst (Gauss_Jordan_upt_k_det_P A (Suc k)) * det A = det (snd (Gauss_Jordan_upt_k_det_P A (Suc k)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k. fst (Gauss_Jordan_upt_k_det_P A k) * det A = det (snd (Gauss_Jordan_upt_k_det_P A k)) \<Longrightarrow> fst (Gauss_Jordan_upt_k_det_P A (Suc k)) * det A = det (snd (Gauss_Jordan_upt_k_det_P A (Suc k)))
[PROOF STEP]
case (Suc k)
[PROOF STATE]
proof (state)
this:
fst (Gauss_Jordan_upt_k_det_P A k) * det A = det (snd (Gauss_Jordan_upt_k_det_P A k))

goal (1 subgoal):
 1. \<And>k. fst (Gauss_Jordan_upt_k_det_P A k) * det A = det (snd (Gauss_Jordan_upt_k_det_P A k)) \<Longrightarrow> fst (Gauss_Jordan_upt_k_det_P A (Suc k)) * det A = det (snd (Gauss_Jordan_upt_k_det_P A (Suc k)))
[PROOF STEP]
have suc_rw: "[0..<Suc (Suc k)] = [0..<Suc k] @ [Suc k]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [0..<Suc (Suc k)] = [0..<Suc k] @ [Suc k]
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
[0..<Suc (Suc k)] = [0..<Suc k] @ [Suc k]

goal (1 subgoal):
 1. \<And>k. fst (Gauss_Jordan_upt_k_det_P A k) * det A = det (snd (Gauss_Jordan_upt_k_det_P A k)) \<Longrightarrow> fst (Gauss_Jordan_upt_k_det_P A (Suc k)) * det A = det (snd (Gauss_Jordan_upt_k_det_P A (Suc k)))
[PROOF STEP]
have fold_expand: "(foldl Gauss_Jordan_column_k_det_P (1, 0, A) [0..<Suc k])
= (fst (foldl Gauss_Jordan_column_k_det_P (1, 0, A) [0..<Suc k]), fst (snd (foldl Gauss_Jordan_column_k_det_P (1, 0, A) [0..<Suc k])),
  snd (snd (foldl Gauss_Jordan_column_k_det_P (1, 0, A) [0..<Suc k])))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldl Gauss_Jordan_column_k_det_P (1::'a, 0, A) [0..<Suc k] = (fst (foldl Gauss_Jordan_column_k_det_P (1::'a, 0, A) [0..<Suc k]), fst (snd (foldl Gauss_Jordan_column_k_det_P (1::'a, 0, A) [0..<Suc k])), snd (snd (foldl Gauss_Jordan_column_k_det_P (1::'a, 0, A) [0..<Suc k])))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
foldl Gauss_Jordan_column_k_det_P (1::'a, 0, A) [0..<Suc k] = (fst (foldl Gauss_Jordan_column_k_det_P (1::'a, 0, A) [0..<Suc k]), fst (snd (foldl Gauss_Jordan_column_k_det_P (1::'a, 0, A) [0..<Suc k])), snd (snd (foldl Gauss_Jordan_column_k_det_P (1::'a, 0, A) [0..<Suc k])))

goal (1 subgoal):
 1. \<And>k. fst (Gauss_Jordan_upt_k_det_P A k) * det A = det (snd (Gauss_Jordan_upt_k_det_P A k)) \<Longrightarrow> fst (Gauss_Jordan_upt_k_det_P A (Suc k)) * det A = det (snd (Gauss_Jordan_upt_k_det_P A (Suc k)))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (Gauss_Jordan_upt_k_det_P A (Suc k)) * det A = det (snd (Gauss_Jordan_upt_k_det_P A (Suc k)))
[PROOF STEP]
unfolding Gauss_Jordan_upt_k_det_P_def Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (fst (foldl Gauss_Jordan_column_k_det_P (1::'a, 0, A) [0..<Suc (Suc k)]), snd (snd (foldl Gauss_Jordan_column_k_det_P (1::'a, 0, A) [0..<Suc (Suc k)]))) * det A = det (snd (fst (foldl Gauss_Jordan_column_k_det_P (1::'a, 0, A) [0..<Suc (Suc k)]), snd (snd (foldl Gauss_Jordan_column_k_det_P (1::'a, 0, A) [0..<Suc (Suc k)]))))
[PROOF STEP]
unfolding suc_rw foldl_append List.foldl.simps fst_conv snd_conv
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (Gauss_Jordan_column_k_det_P (foldl Gauss_Jordan_column_k_det_P (1::'a, 0, A) [0..<Suc k]) (Suc k)) * det A = det (snd (snd (Gauss_Jordan_column_k_det_P (foldl Gauss_Jordan_column_k_det_P (1::'a, 0, A) [0..<Suc k]) (Suc k))))
[PROOF STEP]
by(subst (1 2) fold_expand, rule det_Gauss_Jordan_column_k_det_P, rule Suc.hyps[unfolded Gauss_Jordan_upt_k_det_P_def Let_def fst_conv snd_conv])
[PROOF STATE]
proof (state)
this:
fst (Gauss_Jordan_upt_k_det_P A (Suc k)) * det A = det (snd (Gauss_Jordan_upt_k_det_P A (Suc k)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma qfN_mult1: "((a::int)^2 + N*b^2)*(c^2 + N*d^2)
  = (a*c+N*b*d)^2 + N*(a*d-b*c)^2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a\<^sup>2 + N * b\<^sup>2) * (c\<^sup>2 + N * d\<^sup>2) = (a * c + N * b * d)\<^sup>2 + N * (a * d - b * c)\<^sup>2
[PROOF STEP]
by (simp add: eval_nat_numeral field_simps)


[STATEMENT]
lemma finite_set_ins_swap:
  assumes "finite A"
  shows "max a (Max (Set.insert b A)) = max b (Max (Set.insert a A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. max a (Max (insert b A)) = max b (Max (insert a A))
[PROOF STEP]
using Max_insert assms max.commute max.left_commute
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite ?A; ?A \<noteq> {}\<rbrakk> \<Longrightarrow> Max (insert ?x ?A) = max ?x (Max ?A)
finite A
max ?a ?b = max ?b ?a
max ?b (max ?a ?c) = max ?a (max ?b ?c)

goal (1 subgoal):
 1. max a (Max (insert b A)) = max b (Max (insert a A))
[PROOF STEP]
by fastforce


[STATEMENT]
lemma sum_4: "sum f (UNIV::4 set) = f 1 + f 2 + f 3 + f 4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f UNIV = f 1 + f 2 + f 3 + f 4
[PROOF STEP]
unfolding UNIV_4
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {1, 2, 3, 4} = f 1 + f 2 + f 3 + f 4
[PROOF STEP]
by (simp add: ac_simps)


[STATEMENT]
lemma of_nat_eq_1_iff: "of_nat x = (1 :: 'a :: {semiring_1, semiring_char_0}) \<longleftrightarrow> x = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (of_nat x = (1::'a)) = (x = 1)
[PROOF STEP]
by (fact of_nat_eq_1_iff)


[STATEMENT]
lemma sin_times_pi_eq_0: "sin (x * pi) = 0 \<longleftrightarrow> x \<in> \<int>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sin (x * pi) = 0) = (x \<in> \<int>)
[PROOF STEP]
by (simp add: sin_zero_iff_int2) (metis Ints_cases Ints_of_int)


[STATEMENT]
lemma expand_case_formula:
  "Q(case_formula fatom fconj fall F) = (
  (! z P vs  . F = FAtom z P vs  --> Q (fatom z P vs)) &
  (! z A0 A1 . F = FConj z A0 A1 --> Q (fconj z A0 A1)) &
  (! z A     . F = FAll  z A     --> Q (fall  z A))
 )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Q (case F of FAtom x xa xb \<Rightarrow> fatom x xa xb | FConj x xa xb \<Rightarrow> fconj x xa xb | FAll x xa \<Rightarrow> fall x xa) = ((\<forall>z P vs. F = FAtom z P vs \<longrightarrow> Q (fatom z P vs)) \<and> (\<forall>z A0 A1. F = FConj z A0 A1 \<longrightarrow> Q (fconj z A0 A1)) \<and> (\<forall>z A. F = FAll z A \<longrightarrow> Q (fall z A)))
[PROOF STEP]
apply(cases F)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x11 x12 x13. F = FAtom x11 x12 x13 \<Longrightarrow> Q (case F of FAtom x xa xb \<Rightarrow> fatom x xa xb | FConj x xa xb \<Rightarrow> fconj x xa xb | FAll x xa \<Rightarrow> fall x xa) = ((\<forall>z P vs. F = FAtom z P vs \<longrightarrow> Q (fatom z P vs)) \<and> (\<forall>z A0 A1. F = FConj z A0 A1 \<longrightarrow> Q (fconj z A0 A1)) \<and> (\<forall>z A. F = FAll z A \<longrightarrow> Q (fall z A)))
 2. \<And>x21 x22 x23. F = FConj x21 x22 x23 \<Longrightarrow> Q (case F of FAtom x xa xb \<Rightarrow> fatom x xa xb | FConj x xa xb \<Rightarrow> fconj x xa xb | FAll x xa \<Rightarrow> fall x xa) = ((\<forall>z P vs. F = FAtom z P vs \<longrightarrow> Q (fatom z P vs)) \<and> (\<forall>z A0 A1. F = FConj z A0 A1 \<longrightarrow> Q (fconj z A0 A1)) \<and> (\<forall>z A. F = FAll z A \<longrightarrow> Q (fall z A)))
 3. \<And>x31 x32. F = FAll x31 x32 \<Longrightarrow> Q (case F of FAtom x xa xb \<Rightarrow> fatom x xa xb | FConj x xa xb \<Rightarrow> fconj x xa xb | FAll x xa \<Rightarrow> fall x xa) = ((\<forall>z P vs. F = FAtom z P vs \<longrightarrow> Q (fatom z P vs)) \<and> (\<forall>z A0 A1. F = FConj z A0 A1 \<longrightarrow> Q (fconj z A0 A1)) \<and> (\<forall>z A. F = FAll z A \<longrightarrow> Q (fall z A)))
[PROOF STEP]
apply simp_all
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem ln_upper_5: "0<x \<Longrightarrow> ln(x) \<le> ln_upper_5 x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x \<Longrightarrow> ln x \<le> ln_upper_5 x
[PROOF STEP]
by (metis le_less_linear less_eq_real_def ln_upper_5_neg ln_upper_5_pos)


[STATEMENT]
lemma "(\<lambda>x::real. (1 - x^2 / 2 - cos (x / (1 - x^2))) / x^4) \<midarrow>0\<rightarrow> 23/24"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. (1 - x\<^sup>2 / 2 - cos (x / (1 - x\<^sup>2))) / x ^ 4) \<midarrow>0\<rightarrow> 23 / 24
[PROOF STEP]
by real_asymp


[STATEMENT]
lemma "((P\<or>Q) \<and> (\<not>P\<or>Q) \<and> (P\<or> \<not>Q)) \<longrightarrow> \<not> (\<not>P \<or> \<not>Q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (P \<or> Q) \<and> (\<not> P \<or> Q) \<and> (P \<or> \<not> Q) \<longrightarrow> \<not> (\<not> P \<or> \<not> Q)
[PROOF STEP]
by blast


[STATEMENT]
lemma HMSet_plus: "HMSet (A + B) = HMSet A + HMSet B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. HMSet (A + B) = HMSet A + HMSet B
[PROOF STEP]
by (simp add: plus_hmultiset_def)


[STATEMENT]
lemma "((P|Q) & (~P|Q) & (P| ~Q)) --> ~ (~P | ~Q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (P \<or> Q) \<and> (\<not> P \<or> Q) \<and> (P \<or> \<not> Q) \<longrightarrow> \<not> (\<not> P \<or> \<not> Q)
[PROOF STEP]
by iprover


[STATEMENT]
lemma map_inj_on:
  assumes map: "map f xs = map f ys" and inj: "inj_on f (set xs Un set ys)"
  shows "xs = ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs = ys
[PROOF STEP]
using map_eq_imp_length_eq [OF map] assms
[PROOF STATE]
proof (prove)
using this:
length xs = length ys
map f xs = map f ys
inj_on f (set xs \<union> set ys)

goal (1 subgoal):
 1. xs = ys
[PROOF STEP]
proof (induct rule: list_induct2)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>map f [] = map f []; inj_on f (set [] \<union> set [])\<rbrakk> \<Longrightarrow> [] = []
 2. \<And>x xs y ys. \<lbrakk>length xs = length ys; \<lbrakk>map f xs = map f ys; inj_on f (set xs \<union> set ys)\<rbrakk> \<Longrightarrow> xs = ys; map f (x # xs) = map f (y # ys); inj_on f (set (x # xs) \<union> set (y # ys))\<rbrakk> \<Longrightarrow> x # xs = y # ys
[PROOF STEP]
case (Cons x xs y ys)
[PROOF STATE]
proof (state)
this:
length xs = length ys
\<lbrakk>map f xs = map f ys; inj_on f (set xs \<union> set ys)\<rbrakk> \<Longrightarrow> xs = ys
map f (x # xs) = map f (y # ys)
inj_on f (set (x # xs) \<union> set (y # ys))

goal (2 subgoals):
 1. \<lbrakk>map f [] = map f []; inj_on f (set [] \<union> set [])\<rbrakk> \<Longrightarrow> [] = []
 2. \<And>x xs y ys. \<lbrakk>length xs = length ys; \<lbrakk>map f xs = map f ys; inj_on f (set xs \<union> set ys)\<rbrakk> \<Longrightarrow> xs = ys; map f (x # xs) = map f (y # ys); inj_on f (set (x # xs) \<union> set (y # ys))\<rbrakk> \<Longrightarrow> x # xs = y # ys
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
length xs = length ys
\<lbrakk>map f xs = map f ys; inj_on f (set xs \<union> set ys)\<rbrakk> \<Longrightarrow> xs = ys
map f (x # xs) = map f (y # ys)
inj_on f (set (x # xs) \<union> set (y # ys))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
length xs = length ys
\<lbrakk>map f xs = map f ys; inj_on f (set xs \<union> set ys)\<rbrakk> \<Longrightarrow> xs = ys
map f (x # xs) = map f (y # ys)
inj_on f (set (x # xs) \<union> set (y # ys))

goal (1 subgoal):
 1. x # xs = y # ys
[PROOF STEP]
by (auto intro: sym)
[PROOF STATE]
proof (state)
this:
x # xs = y # ys

goal (1 subgoal):
 1. \<lbrakk>map f [] = map f []; inj_on f (set [] \<union> set [])\<rbrakk> \<Longrightarrow> [] = []
[PROOF STEP]
qed auto


[STATEMENT]
lemma gen_sqrt_lower_scaled:
  assumes "0 \<le> x" "0 < u"
    shows "sqrtl (x*u^2) n / u \<le> sqrt x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrtl (x * u\<^sup>2) n / u \<le> sqrt x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sqrtl (x * u\<^sup>2) n / u \<le> sqrt x
[PROOF STEP]
have "sqrtl (x*u^2) n / u \<le> sqrt (x*u^2) / u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrtl (x * u\<^sup>2) n / u \<le> sqrt (x * u\<^sup>2) / u
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 \<le> x
0 < u

goal (1 subgoal):
 1. sqrtl (x * u\<^sup>2) n / u \<le> sqrt (x * u\<^sup>2) / u
[PROOF STEP]
by (simp add: divide_simps) (metis gen_sqrt_lower zero_le_mult_iff zero_le_power2)
[PROOF STATE]
proof (state)
this:
sqrtl (x * u\<^sup>2) n / u \<le> sqrt (x * u\<^sup>2) / u

goal (1 subgoal):
 1. sqrtl (x * u\<^sup>2) n / u \<le> sqrt x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sqrtl (x * u\<^sup>2) n / u \<le> sqrt (x * u\<^sup>2) / u

goal (1 subgoal):
 1. sqrtl (x * u\<^sup>2) n / u \<le> sqrt x
[PROOF STEP]
have "... = sqrt x * sqrt (u^2) / u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrt (x * u\<^sup>2) / u = sqrt x * sqrt (u\<^sup>2) / u
[PROOF STEP]
by (metis real_sqrt_mult)
[PROOF STATE]
proof (state)
this:
sqrt (x * u\<^sup>2) / u = sqrt x * sqrt (u\<^sup>2) / u

goal (1 subgoal):
 1. sqrtl (x * u\<^sup>2) n / u \<le> sqrt x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sqrt (x * u\<^sup>2) / u = sqrt x * sqrt (u\<^sup>2) / u

goal (1 subgoal):
 1. sqrtl (x * u\<^sup>2) n / u \<le> sqrt x
[PROOF STEP]
have "... = sqrt x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrt x * sqrt (u\<^sup>2) / u = sqrt x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 \<le> x
0 < u

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

goal (1 subgoal):
 1. sqrtl (x * u\<^sup>2) n / u \<le> sqrt x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sqrtl (x * u\<^sup>2) n / u \<le> sqrt x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sqrtl (x * u\<^sup>2) n / u \<le> sqrt x

goal (1 subgoal):
 1. sqrtl (x * u\<^sup>2) n / u \<le> sqrt x
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
sqrtl (x * u\<^sup>2) n / u \<le> sqrt x

goal:
No subgoals!
[PROOF STEP]
qed