[STATEMENT]
lemma trace_add_linear:
  fixes A B :: "'a::comm_ring mat"
  assumes A: "A \<in> carrier_mat n n" and B: "B \<in> carrier_mat n n"
  shows "trace (A + B) = trace A + trace B" (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trace (A + B) = trace A + trace B
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. trace (A + B) = trace A + trace B
[PROOF STEP]
have "?lhs = (\<Sum>i=0..<n. A$$(i, i) + B$$(i, i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trace (A + B) = (\<Sum>i = 0..<n. A $$ (i, i) + B $$ (i, i))
[PROOF STEP]
unfolding trace_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<dim_row (A + B). (A + B) $$ (i, i)) = (\<Sum>i = 0..<n. A $$ (i, i) + B $$ (i, i))
[PROOF STEP]
using A B
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
B \<in> carrier_mat n n

goal (1 subgoal):
 1. (\<Sum>i = 0..<dim_row (A + B). (A + B) $$ (i, i)) = (\<Sum>i = 0..<n. A $$ (i, i) + B $$ (i, i))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
trace (A + B) = (\<Sum>i = 0..<n. A $$ (i, i) + B $$ (i, i))

goal (1 subgoal):
 1. trace (A + B) = trace A + trace B
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
trace (A + B) = (\<Sum>i = 0..<n. A $$ (i, i) + B $$ (i, i))

goal (1 subgoal):
 1. trace (A + B) = trace A + trace B
[PROOF STEP]
have "\<dots> = (\<Sum>i=0..<n. A$$(i, i)) + (\<Sum>i=0..<n. B$$(i, i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<n. A $$ (i, i) + B $$ (i, i)) = (\<Sum>i = 0..<n. A $$ (i, i)) + (\<Sum>i = 0..<n. B $$ (i, i))
[PROOF STEP]
by (auto simp add: sum.distrib)
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<n. A $$ (i, i) + B $$ (i, i)) = (\<Sum>i = 0..<n. A $$ (i, i)) + (\<Sum>i = 0..<n. B $$ (i, i))

goal (1 subgoal):
 1. trace (A + B) = trace A + trace B
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
trace (A + B) = (\<Sum>i = 0..<n. A $$ (i, i)) + (\<Sum>i = 0..<n. B $$ (i, i))
[PROOF STEP]
have l: "?lhs = (\<Sum>i=0..<n. A$$(i, i)) + (\<Sum>i=0..<n. B$$(i, i))"
[PROOF STATE]
proof (prove)
using this:
trace (A + B) = (\<Sum>i = 0..<n. A $$ (i, i)) + (\<Sum>i = 0..<n. B $$ (i, i))

goal (1 subgoal):
 1. trace (A + B) = (\<Sum>i = 0..<n. A $$ (i, i)) + (\<Sum>i = 0..<n. B $$ (i, i))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
trace (A + B) = (\<Sum>i = 0..<n. A $$ (i, i)) + (\<Sum>i = 0..<n. B $$ (i, i))

goal (1 subgoal):
 1. trace (A + B) = trace A + trace B
[PROOF STEP]
have r: "?rhs = (\<Sum>i=0..<n. A$$(i, i)) + (\<Sum>i=0..<n. B$$(i, i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trace A + trace B = (\<Sum>i = 0..<n. A $$ (i, i)) + (\<Sum>i = 0..<n. B $$ (i, i))
[PROOF STEP]
unfolding trace_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<dim_row A. A $$ (i, i)) + (\<Sum>i = 0..<dim_row B. B $$ (i, i)) = (\<Sum>i = 0..<n. A $$ (i, i)) + (\<Sum>i = 0..<n. B $$ (i, i))
[PROOF STEP]
using A B
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
B \<in> carrier_mat n n

goal (1 subgoal):
 1. (\<Sum>i = 0..<dim_row A. A $$ (i, i)) + (\<Sum>i = 0..<dim_row B. B $$ (i, i)) = (\<Sum>i = 0..<n. A $$ (i, i)) + (\<Sum>i = 0..<n. B $$ (i, i))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
trace A + trace B = (\<Sum>i = 0..<n. A $$ (i, i)) + (\<Sum>i = 0..<n. B $$ (i, i))

goal (1 subgoal):
 1. trace (A + B) = trace A + trace B
[PROOF STEP]
from l r
[PROOF STATE]
proof (chain)
picking this:
trace (A + B) = (\<Sum>i = 0..<n. A $$ (i, i)) + (\<Sum>i = 0..<n. B $$ (i, i))
trace A + trace B = (\<Sum>i = 0..<n. A $$ (i, i)) + (\<Sum>i = 0..<n. B $$ (i, i))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
trace (A + B) = (\<Sum>i = 0..<n. A $$ (i, i)) + (\<Sum>i = 0..<n. B $$ (i, i))
trace A + trace B = (\<Sum>i = 0..<n. A $$ (i, i)) + (\<Sum>i = 0..<n. B $$ (i, i))

goal (1 subgoal):
 1. trace (A + B) = trace A + trace B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
trace (A + B) = trace A + trace B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sqrt_int_floor_pos: assumes x: "x \<ge> 0"
  shows "sqrt_int_floor_pos x = \<lfloor> sqrt (of_int x) \<rfloor>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrt_int_floor_pos x = \<lfloor>sqrt (real_of_int x)\<rfloor>
[PROOF STEP]
using root_int_floor_pos[OF x, of 2]
[PROOF STATE]
proof (prove)
using this:
root_int_floor_pos 2 x = \<lfloor>root 2 (real_of_int x)\<rfloor>

goal (1 subgoal):
 1. sqrt_int_floor_pos x = \<lfloor>sqrt (real_of_int x)\<rfloor>
[PROOF STEP]
by (simp add: sqrt_def)


[STATEMENT]
lemma f_diff_card_quadruple_set_additive_energy: assumes "A \<subseteq> G" and "finite A"
  shows "(\<Sum> d \<in> differenceset A A. (f_diff d A)^2) = additive_energy A * (card A)^3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real (\<Sum>d\<in>differenceset A A. (f_diff d A)\<^sup>2) = additive_energy A * real (card A ^ 3)
[PROOF STEP]
using assms f_diff_card_quadruple_set additive_energy_def
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> G
finite A
\<lbrakk>?A \<subseteq> G; finite ?A\<rbrakk> \<Longrightarrow> (\<Sum>d\<in>differenceset ?A ?A. (f_diff d ?A)\<^sup>2) = card (additive_quadruple_set ?A)
additive_energy ?A \<equiv> real (card (additive_quadruple_set ?A)) / real (card ?A ^ 3)

goal (1 subgoal):
 1. real (\<Sum>d\<in>differenceset A A. (f_diff d A)\<^sup>2) = additive_energy A * real (card A ^ 3)
[PROOF STEP]
by force


[STATEMENT]
lemma pow2_scaleR_mtx_cnst_acc: "(t *\<^sub>R K)\<^sup>2 = mtx (
  [0,0,t\<^sup>2] #
  [0,0,0] #
  [0,0,0] # [])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (t *\<^sub>R K)\<^sup>2 = mtx [[0, 0, t\<^sup>2], [0, 0, 0], [0, 0, 0]]
[PROOF STEP]
unfolding power2_eq_square
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t *\<^sub>R K * t *\<^sub>R K = mtx [[0, 0, t * t], [0, 0, 0], [0, 0, 0]]
[PROOF STEP]
apply(subst sq_mtx_eq_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i j. (t *\<^sub>R K * t *\<^sub>R K) $$ i $ j = mtx [[0, 0, t * t], [0, 0, 0], [0, 0, 0]] $$ i $ j
[PROOF STEP]
unfolding sq_mtx_times_eq UNIV_3
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i j. to_mtx (\<chi>i j. \<Sum>k\<in>insert 1 (insert 2 (skip 3)). (t *\<^sub>R K) $$ i $ k * (t *\<^sub>R K) $$ k $ j) $$ i $ j = mtx [[0, 0, t * t], [0, 0, 0], [0, 0, 0]] $$ i $ j
[PROOF STEP]
by auto


[STATEMENT]
lemma card_image_Nsetn_Suc
:"\<lbrakk>f \<in> {j. j \<le> Suc n} \<rightarrow> B;
      f (Suc n) \<notin> f ` {j. j \<le> n}\<rbrakk>  \<Longrightarrow>
       card (f ` {j. j \<le> Suc n}) - Suc 0 =
                     Suc (card (f ` {j. j \<le> n}) - Suc 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> {j. j \<le> Suc n} \<rightarrow> B; f (Suc n) \<notin> f ` {j. j \<le> n}\<rbrakk> \<Longrightarrow> card (f ` {j. j \<le> Suc n}) - Suc 0 = Suc (card (f ` {j. j \<le> n}) - Suc 0)
[PROOF STEP]
apply (simp add:image_Nset_Suc)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> {j. j \<le> Suc n} \<rightarrow> B; f (Suc n) \<notin> f ` {j. j \<le> n}\<rbrakk> \<Longrightarrow> card (f ` {j. j \<le> n}) = Suc (card (f ` {j. j \<le> n}) - Suc 0)
[PROOF STEP]
apply (cut_tac image_Nsetn_card_pos[of f n], simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma (in abelian_group) r_neg1:
  "\<lbrakk> x \<in> carrier G; y \<in> carrier G \<rbrakk> \<Longrightarrow> (\<ominus> x) \<oplus> (x \<oplus> y) = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier G; y \<in> carrier G\<rbrakk> \<Longrightarrow> \<ominus> x \<oplus> (x \<oplus> y) = y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier G; y \<in> carrier G\<rbrakk> \<Longrightarrow> \<ominus> x \<oplus> (x \<oplus> y) = y
[PROOF STEP]
assume G: "x \<in> carrier G" "y \<in> carrier G"
[PROOF STATE]
proof (state)
this:
x \<in> carrier G
y \<in> carrier G

goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier G; y \<in> carrier G\<rbrakk> \<Longrightarrow> \<ominus> x \<oplus> (x \<oplus> y) = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> carrier G
y \<in> carrier G
[PROOF STEP]
have "(\<ominus> x \<oplus> x) \<oplus> y = y"
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier G
y \<in> carrier G

goal (1 subgoal):
 1. \<ominus> x \<oplus> x \<oplus> y = y
[PROOF STEP]
by (simp only: l_neg l_zero)
[PROOF STATE]
proof (state)
this:
\<ominus> x \<oplus> x \<oplus> y = y

goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier G; y \<in> carrier G\<rbrakk> \<Longrightarrow> \<ominus> x \<oplus> (x \<oplus> y) = y
[PROOF STEP]
with G
[PROOF STATE]
proof (chain)
picking this:
x \<in> carrier G
y \<in> carrier G
\<ominus> x \<oplus> x \<oplus> y = y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier G
y \<in> carrier G
\<ominus> x \<oplus> x \<oplus> y = y

goal (1 subgoal):
 1. \<ominus> x \<oplus> (x \<oplus> y) = y
[PROOF STEP]
by (simp add: a_ac)
[PROOF STATE]
proof (state)
this:
\<ominus> x \<oplus> (x \<oplus> y) = y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem derangement_enum_correct: "distinct xs \<Longrightarrow> derangements xs = set (derangement_enum xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct xs \<Longrightarrow> derangements xs = set (derangement_enum xs)
[PROOF STEP]
proof(standard)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. distinct xs \<Longrightarrow> derangements xs \<subseteq> set (derangement_enum xs)
 2. distinct xs \<Longrightarrow> set (derangement_enum xs) \<subseteq> derangements xs
[PROOF STEP]
show "distinct xs \<Longrightarrow> derangements xs \<subseteq> set (derangement_enum xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct xs \<Longrightarrow> derangements xs \<subseteq> set (derangement_enum xs)
[PROOF STEP]
unfolding derangements_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct xs \<Longrightarrow> {ys. distinct ys \<and> length xs = length ys \<and> set xs = set ys \<and> no_overlap xs ys} \<subseteq> set (derangement_enum xs)
[PROOF STEP]
using derangement_enum_correct_aux1
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>distinct ?zs; length ?ys = length ?zs; length ?ys = length ?xs; set ?ys = set ?zs; no_overlap ?xs ?zs\<rbrakk> \<Longrightarrow> ?zs \<in> set (derangement_enum_aux ?xs ?ys)

goal (1 subgoal):
 1. distinct xs \<Longrightarrow> {ys. distinct ys \<and> length xs = length ys \<and> set xs = set ys \<and> no_overlap xs ys} \<subseteq> set (derangement_enum xs)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
distinct xs \<Longrightarrow> derangements xs \<subseteq> set (derangement_enum xs)

goal (1 subgoal):
 1. distinct xs \<Longrightarrow> set (derangement_enum xs) \<subseteq> derangements xs
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. distinct xs \<Longrightarrow> set (derangement_enum xs) \<subseteq> derangements xs
[PROOF STEP]
show "distinct xs \<Longrightarrow> set (derangement_enum xs) \<subseteq> derangements xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct xs \<Longrightarrow> set (derangement_enum xs) \<subseteq> derangements xs
[PROOF STEP]
unfolding derangements_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct xs \<Longrightarrow> set (derangement_enum xs) \<subseteq> {ys. distinct ys \<and> length xs = length ys \<and> set xs = set ys \<and> no_overlap xs ys}
[PROOF STEP]
using derangement_enum_aux_set derangement_enum_aux_distinct_elem derangement_enum_aux_elem_length derangement_enum_aux_no_overlap
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>length ?xs = length ?ys; ?zs \<in> set (derangement_enum_aux ?xs ?ys)\<rbrakk> \<Longrightarrow> set ?zs = set ?ys
\<lbrakk>distinct ?ys; ?zs \<in> set (derangement_enum_aux ?xs ?ys)\<rbrakk> \<Longrightarrow> distinct ?zs
?zs \<in> set (derangement_enum_aux ?xs ?ys) \<Longrightarrow> length ?xs = length ?zs
?zs \<in> set (derangement_enum_aux ?xs ?ys) \<Longrightarrow> no_overlap ?xs ?zs

goal (1 subgoal):
 1. distinct xs \<Longrightarrow> set (derangement_enum xs) \<subseteq> {ys. distinct ys \<and> length xs = length ys \<and> set xs = set ys \<and> no_overlap xs ys}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
distinct xs \<Longrightarrow> set (derangement_enum xs) \<subseteq> derangements xs

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma space_lebesgue_f: "space (lebesgue_f n) = Pi\<^sub>E {..<n} (\<lambda>_. UNIV)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. space (completion (lborel_f n)) = {..<n} \<rightarrow>\<^sub>E UNIV
[PROOF STEP]
by (simp add: space_lborel_f)


[STATEMENT]
lemma step_4_push_small_size_ok_3_aux: "\<lbrakk>
  4 \<le> remaining_steps (States dir big small);
  size_new small + remaining_steps (States dir big small) + 2 \<le> 3 * size_new big
\<rbrakk> \<Longrightarrow> Suc (size_new small) + (remaining_steps (States dir big small) - 4) + 2 \<le> 3 * size_new big"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>4 \<le> remaining_steps (States dir big small); size_new small + remaining_steps (States dir big small) + 2 \<le> 3 * size_new big\<rbrakk> \<Longrightarrow> Suc (size_new small) + (remaining_steps (States dir big small) - 4) + 2 \<le> 3 * size_new big
[PROOF STEP]
using distrib_left dual_order.trans le_add_diff_inverse2
[PROOF STATE]
proof (prove)
using this:
?a * (?b + ?c) = ?a * ?b + ?a * ?c
\<lbrakk>?b \<le> ?a; ?c \<le> ?b\<rbrakk> \<Longrightarrow> ?c \<le> ?a
?b \<le> ?a \<Longrightarrow> ?a - ?b + ?b = ?a

goal (1 subgoal):
 1. \<lbrakk>4 \<le> remaining_steps (States dir big small); size_new small + remaining_steps (States dir big small) + 2 \<le> 3 * size_new big\<rbrakk> \<Longrightarrow> Suc (size_new small) + (remaining_steps (States dir big small) - 4) + 2 \<le> 3 * size_new big
[PROOF STEP]
by force


[STATEMENT]
lemma deriv_deriv_power [simp]:
  "deriv (deriv (\<lambda>x. x ^ n)) x = of_nat n * of_nat (n - Suc 0) * x ^ (n - 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deriv (deriv (\<lambda>x. x ^ n)) x = of_nat n * of_nat (n - Suc 0) * x ^ (n - 2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. deriv (deriv (\<lambda>x. x ^ n)) x = of_nat n * of_nat (n - Suc 0) * x ^ (n - 2)
[PROOF STEP]
have "(\<lambda>x. x ^ (n - 1)) field_differentiable at x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. x ^ (n - 1)) field_differentiable at x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>x. x ^ (n - 1)) field_differentiable at x

goal (1 subgoal):
 1. deriv (deriv (\<lambda>x. x ^ n)) x = of_nat n * of_nat (n - Suc 0) * x ^ (n - 2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. x ^ (n - 1)) field_differentiable at x
[PROOF STEP]
have "deriv (\<lambda>x. of_nat n * x ^ (n - 1)) x = of_nat n * of_nat (n - Suc 0) * x ^ (n - 2)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. x ^ (n - 1)) field_differentiable at x

goal (1 subgoal):
 1. deriv (\<lambda>x. of_nat n * x ^ (n - 1)) x = of_nat n * of_nat (n - Suc 0) * x ^ (n - 2)
[PROOF STEP]
by (simp add: diff_diff_add mult.assoc numeral_2_eq_2)
[PROOF STATE]
proof (state)
this:
deriv (\<lambda>x. of_nat n * x ^ (n - 1)) x = of_nat n * of_nat (n - Suc 0) * x ^ (n - 2)

goal (1 subgoal):
 1. deriv (deriv (\<lambda>x. x ^ n)) x = of_nat n * of_nat (n - Suc 0) * x ^ (n - 2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
deriv (\<lambda>x. of_nat n * x ^ (n - 1)) x = of_nat n * of_nat (n - Suc 0) * x ^ (n - 2)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
deriv (\<lambda>x. of_nat n * x ^ (n - 1)) x = of_nat n * of_nat (n - Suc 0) * x ^ (n - 2)

goal (1 subgoal):
 1. deriv (deriv (\<lambda>x. x ^ n)) x = of_nat n * of_nat (n - Suc 0) * x ^ (n - 2)
[PROOF STEP]
by (simp add: ext[OF deriv_power])
[PROOF STATE]
proof (state)
this:
deriv (deriv (\<lambda>x. x ^ n)) x = of_nat n * of_nat (n - Suc 0) * x ^ (n - 2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma VUnion_vintersection: "\<Union>\<^sub>\<circ>(A \<inter>\<^sub>\<circ> B) \<subseteq>\<^sub>\<circ> \<Union>\<^sub>\<circ>A \<inter>\<^sub>\<circ> \<Union>\<^sub>\<circ>B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union>\<^sub>\<circ> (A \<inter>\<^sub>\<circ> B) \<subseteq>\<^sub>\<circ> \<Union>\<^sub>\<circ> A \<inter>\<^sub>\<circ> \<Union>\<^sub>\<circ> B
[PROOF STEP]
by auto


[STATEMENT]
lemma convergent_prod_divide:
  assumes f: "convergent_prod f" and g: "convergent_prod g"
  shows "convergent_prod (\<lambda>n. f n / g n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convergent_prod (\<lambda>n. f n / g n)
[PROOF STEP]
using f g has_prod_divide has_prod_iff
[PROOF STATE]
proof (prove)
using this:
convergent_prod f
convergent_prod g
\<lbrakk>f has_prod ?a; ?g has_prod ?b\<rbrakk> \<Longrightarrow> (\<lambda>n. f n / ?g n) has_prod (?a / ?b)
?f has_prod ?x = (convergent_prod ?f \<and> prodinf ?f = ?x)

goal (1 subgoal):
 1. convergent_prod (\<lambda>n. f n / g n)
[PROOF STEP]
by blast


[STATEMENT]
lemma union_subseteqI: "\<lbrakk>A \<union> B \<subseteq> C; A' \<subseteq> A; B' \<subseteq> B\<rbrakk>  \<Longrightarrow>   A' \<union> B' \<subseteq> C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<union> B \<subseteq> C; A' \<subseteq> A; B' \<subseteq> B\<rbrakk> \<Longrightarrow> A' \<union> B' \<subseteq> C
[PROOF STEP]
by blast


[STATEMENT]
lemma dist_mul[simp]: "dist (c *s x) (c *s y) = \<bar>c\<bar> * dist x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (c *s x) (c *s y) = \<bar>c\<bar> * dist x y
[PROOF STEP]
unfolding dist_norm scalar_mult_eq_scaleR
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (c *\<^sub>R x - c *\<^sub>R y) = \<bar>c\<bar> * norm (x - y)
[PROOF STEP]
unfolding scaleR_right_diff_distrib[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (c *\<^sub>R (x - y)) = \<bar>c\<bar> * norm (x - y)
[PROOF STEP]
by simp


[STATEMENT]
lemma open_fps_def: "open (S :: 'a::group_add fps set) = (\<forall>a \<in> S. \<exists>r. r >0 \<and> {y. dist y a < r} \<subseteq> S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open S = (\<forall>a\<in>S. \<exists>r>0. {y. dist y a < r} \<subseteq> S)
[PROOF STEP]
unfolding open_dist subset_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x\<in>S. \<exists>e>0. \<forall>y. dist y x < e \<longrightarrow> y \<in> S) = (\<forall>a\<in>S. \<exists>r>0. \<forall>x\<in>{y. dist y a < r}. x \<in> S)
[PROOF STEP]
by simp


[STATEMENT]
lemma two_block_non_interfering_dims:
  "dim_row (two_block_non_interfering A B) = dim_row A + dim_row B"
  "dim_col (two_block_non_interfering A B) = dim_col A + dim_col B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (two_block_non_interfering A B) = dim_row A + dim_row B &&& dim_col (two_block_non_interfering A B) = dim_col A + dim_col B
[PROOF STEP]
by (simp)+


[STATEMENT]
lemma is_nth_power_mult_coprime_nat_iff:
  fixes a b :: nat
  assumes "coprime a b"
  shows   "is_nth_power n (a * b) \<longleftrightarrow> is_nth_power n a \<and>is_nth_power n b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_nth_power n (a * b) = (is_nth_power n a \<and> is_nth_power n b)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
coprime a b

goal (1 subgoal):
 1. is_nth_power n (a * b) = (is_nth_power n a \<and> is_nth_power n b)
[PROOF STEP]
by (cases "a = 0"; cases "b = 0")
     (auto intro: is_nth_power_mult dest: is_nth_power_mult_coprime_natD[of a b n]
           simp del: One_nat_def)


[STATEMENT]
theorem has_absolute_integral_change_of_variables:
  fixes f :: "real^'m::{finite,wellorder} \<Rightarrow> real^'n" and g :: "real^'m::_ \<Rightarrow> real^'m::_"
  assumes S: "S \<in> sets lebesgue"
    and der_g: "\<And>x. x \<in> S \<Longrightarrow> (g has_derivative g' x) (at x within S)"
    and inj: "inj_on g S"
  shows "(\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f(g x)) absolutely_integrable_on S \<and>
           integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f(g x)) = b
     \<longleftrightarrow> f absolutely_integrable_on (g ` S) \<and> integral (g ` S) f = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)
[PROOF STEP]
obtain C N where "fsigma C" and N: "N \<in> null_sets lebesgue" and CNS: "C \<union> N = S" and "disjnt C N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>C N. \<lbrakk>fsigma C; N \<in> null_sets lebesgue; C \<union> N = S; disjnt C N\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using lebesgue_set_almost_fsigma [OF S]
[PROOF STATE]
proof (prove)
using this:
(\<And>C T. \<lbrakk>fsigma C; T \<in> null_sets lebesgue; C \<union> T = S; disjnt C T\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>C N. \<lbrakk>fsigma C; N \<in> null_sets lebesgue; C \<union> N = S; disjnt C N\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
fsigma C
N \<in> null_sets lebesgue
C \<union> N = S
disjnt C N

goal (1 subgoal):
 1. ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
fsigma C
N \<in> null_sets lebesgue
C \<union> N = S
disjnt C N
[PROOF STEP]
obtain F :: "nat \<Rightarrow> (real^'m::_) set"
    where F: "range F \<subseteq> Collect compact" and Ceq: "C = Union(range F)"
[PROOF STATE]
proof (prove)
using this:
fsigma C
N \<in> null_sets lebesgue
C \<union> N = S
disjnt C N

goal (1 subgoal):
 1. (\<And>F. \<lbrakk>range F \<subseteq> Collect compact; C = \<Union> (range F)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using fsigma_Union_compact
[PROOF STATE]
proof (prove)
using this:
fsigma C
N \<in> null_sets lebesgue
C \<union> N = S
disjnt C N
fsigma ?S = (\<exists>F. range F \<subseteq> Collect compact \<and> ?S = \<Union> (range F))

goal (1 subgoal):
 1. (\<And>F. \<lbrakk>range F \<subseteq> Collect compact; C = \<Union> (range F)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
range F \<subseteq> Collect compact
C = \<Union> (range F)

goal (1 subgoal):
 1. ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)
[PROOF STEP]
have "negligible N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. negligible N
[PROOF STEP]
using N
[PROOF STATE]
proof (prove)
using this:
N \<in> null_sets lebesgue

goal (1 subgoal):
 1. negligible N
[PROOF STEP]
by (simp add: negligible_iff_null_sets)
[PROOF STATE]
proof (state)
this:
negligible N

goal (1 subgoal):
 1. ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)
[PROOF STEP]
let ?D = "\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)
[PROOF STEP]
have "?D absolutely_integrable_on C \<and> integral C ?D = b
    \<longleftrightarrow> f absolutely_integrable_on (g ` C) \<and> integral (g ` C) f = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on C \<and> integral C (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` C \<and> integral (g ` C) f = b)
[PROOF STEP]
unfolding Ceq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on \<Union> (range F) \<and> integral (\<Union> (range F)) (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` \<Union> (range F) \<and> integral (g ` \<Union> (range F)) f = b)
[PROOF STEP]
proof (rule has_absolute_integral_change_of_variables_compact_family)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>n. compact (F n)
 2. \<And>x. x \<in> \<Union> (range F) \<Longrightarrow> (g has_derivative g' x) (at x within \<Union> (range F))
 3. inj_on g (\<Union> (range F))
[PROOF STEP]
fix n x
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>n. compact (F n)
 2. \<And>x. x \<in> \<Union> (range F) \<Longrightarrow> (g has_derivative g' x) (at x within \<Union> (range F))
 3. inj_on g (\<Union> (range F))
[PROOF STEP]
assume "x \<in> \<Union>(F ` UNIV)"
[PROOF STATE]
proof (state)
this:
x \<in> \<Union> (range F)

goal (3 subgoals):
 1. \<And>n. compact (F n)
 2. \<And>x. x \<in> \<Union> (range F) \<Longrightarrow> (g has_derivative g' x) (at x within \<Union> (range F))
 3. inj_on g (\<Union> (range F))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> \<Union> (range F)
[PROOF STEP]
show "(g has_derivative g' x) (at x within \<Union>(F ` UNIV))"
[PROOF STATE]
proof (prove)
using this:
x \<in> \<Union> (range F)

goal (1 subgoal):
 1. (g has_derivative g' x) (at x within \<Union> (range F))
[PROOF STEP]
using Ceq \<open>C \<union> N = S\<close> der_g has_derivative_subset
[PROOF STATE]
proof (prove)
using this:
x \<in> \<Union> (range F)
C = \<Union> (range F)
C \<union> N = S
?x \<in> S \<Longrightarrow> (g has_derivative g' ?x) (at ?x within S)
\<lbrakk>(?f has_derivative ?f') (at ?x within ?s); ?t \<subseteq> ?s\<rbrakk> \<Longrightarrow> (?f has_derivative ?f') (at ?x within ?t)

goal (1 subgoal):
 1. (g has_derivative g' x) (at x within \<Union> (range F))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(g has_derivative g' x) (at x within \<Union> (range F))

goal (2 subgoals):
 1. \<And>n. compact (F n)
 2. inj_on g (\<Union> (range F))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>n. compact (F n)
 2. inj_on g (\<Union> (range F))
[PROOF STEP]
have "\<Union>(F ` UNIV) \<subseteq> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> (range F) \<subseteq> S
[PROOF STEP]
using Ceq \<open>C \<union> N = S\<close>
[PROOF STATE]
proof (prove)
using this:
C = \<Union> (range F)
C \<union> N = S

goal (1 subgoal):
 1. \<Union> (range F) \<subseteq> S
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<Union> (range F) \<subseteq> S

goal (2 subgoals):
 1. \<And>n. compact (F n)
 2. inj_on g (\<Union> (range F))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<Union> (range F) \<subseteq> S
[PROOF STEP]
show "inj_on g (\<Union>(F ` UNIV))"
[PROOF STATE]
proof (prove)
using this:
\<Union> (range F) \<subseteq> S

goal (1 subgoal):
 1. inj_on g (\<Union> (range F))
[PROOF STEP]
using inj
[PROOF STATE]
proof (prove)
using this:
\<Union> (range F) \<subseteq> S
inj_on g S

goal (1 subgoal):
 1. inj_on g (\<Union> (range F))
[PROOF STEP]
by (meson inj_on_subset)
[PROOF STATE]
proof (state)
this:
inj_on g (\<Union> (range F))

goal (1 subgoal):
 1. \<And>n. compact (F n)
[PROOF STEP]
qed (use F in auto)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on C \<and> integral C (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` C \<and> integral (g ` C) f = b)

goal (1 subgoal):
 1. ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on C \<and> integral C (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` C \<and> integral (g ` C) f = b)

goal (1 subgoal):
 1. ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)
[PROOF STEP]
have "?D absolutely_integrable_on C \<and> integral C ?D = b
    \<longleftrightarrow> ?D absolutely_integrable_on S \<and> integral S ?D = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on C \<and> integral C (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b)
[PROOF STEP]
proof (rule conj_cong)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on C) = ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S)
 2. (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<Longrightarrow> (integral C (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b)
[PROOF STEP]
have neg: "negligible {x \<in> C - S. ?D x \<noteq> 0}" "negligible {x \<in> S - C. ?D x \<noteq> 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. negligible {x \<in> C - S. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x) \<noteq> 0} &&& negligible {x \<in> S - C. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x) \<noteq> 0}
[PROOF STEP]
using CNS
[PROOF STATE]
proof (prove)
using this:
C \<union> N = S

goal (1 subgoal):
 1. negligible {x \<in> C - S. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x) \<noteq> 0} &&& negligible {x \<in> S - C. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x) \<noteq> 0}
[PROOF STEP]
by (blast intro: negligible_subset [OF \<open>negligible N\<close>])+
[PROOF STATE]
proof (state)
this:
negligible {x \<in> C - S. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x) \<noteq> 0}
negligible {x \<in> S - C. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x) \<noteq> 0}

goal (2 subgoals):
 1. ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on C) = ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S)
 2. (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<Longrightarrow> (integral C (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
negligible {x \<in> C - S. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x) \<noteq> 0}
negligible {x \<in> S - C. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x) \<noteq> 0}
[PROOF STEP]
show "(?D absolutely_integrable_on C) = (?D absolutely_integrable_on S)"
[PROOF STATE]
proof (prove)
using this:
negligible {x \<in> C - S. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x) \<noteq> 0}
negligible {x \<in> S - C. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x) \<noteq> 0}

goal (1 subgoal):
 1. ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on C) = ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S)
[PROOF STEP]
by (rule absolutely_integrable_spike_set_eq)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on C) = ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S)

goal (1 subgoal):
 1. (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<Longrightarrow> (integral C (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b)
[PROOF STEP]
show "(integral C ?D = b) \<longleftrightarrow> (integral S ?D = b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (integral C (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b)
[PROOF STEP]
using integral_spike_set [OF neg]
[PROOF STATE]
proof (prove)
using this:
integral C (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x))

goal (1 subgoal):
 1. (integral C (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(integral C (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on C \<and> integral C (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b)

goal (1 subgoal):
 1. ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on C \<and> integral C (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b)

goal (1 subgoal):
 1. ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)
[PROOF STEP]
have "f absolutely_integrable_on (g ` C) \<and> integral (g ` C) f = b
    \<longleftrightarrow> f absolutely_integrable_on (g ` S) \<and> integral (g ` S) f = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f absolutely_integrable_on g ` C \<and> integral (g ` C) f = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)
[PROOF STEP]
proof (rule conj_cong)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (f absolutely_integrable_on g ` C) = (f absolutely_integrable_on g ` S)
 2. f absolutely_integrable_on g ` S \<Longrightarrow> (integral (g ` C) f = b) = (integral (g ` S) f = b)
[PROOF STEP]
have "g differentiable_on N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g differentiable_on N
[PROOF STEP]
by (metis CNS der_g differentiable_def differentiable_on_def differentiable_on_subset sup.cobounded2)
[PROOF STATE]
proof (state)
this:
g differentiable_on N

goal (2 subgoals):
 1. (f absolutely_integrable_on g ` C) = (f absolutely_integrable_on g ` S)
 2. f absolutely_integrable_on g ` S \<Longrightarrow> (integral (g ` C) f = b) = (integral (g ` S) f = b)
[PROOF STEP]
with \<open>negligible N\<close>
[PROOF STATE]
proof (chain)
picking this:
negligible N
g differentiable_on N
[PROOF STEP]
have neg_gN: "negligible (g ` N)"
[PROOF STATE]
proof (prove)
using this:
negligible N
g differentiable_on N

goal (1 subgoal):
 1. negligible (g ` N)
[PROOF STEP]
by (blast intro: negligible_differentiable_image_negligible)
[PROOF STATE]
proof (state)
this:
negligible (g ` N)

goal (2 subgoals):
 1. (f absolutely_integrable_on g ` C) = (f absolutely_integrable_on g ` S)
 2. f absolutely_integrable_on g ` S \<Longrightarrow> (integral (g ` C) f = b) = (integral (g ` S) f = b)
[PROOF STEP]
have neg: "negligible {x \<in> g ` C - g ` S. f x \<noteq> 0}"
              "negligible {x \<in> g ` S - g ` C. f x \<noteq> 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. negligible {x \<in> g ` C - g ` S. f x \<noteq> 0} &&& negligible {x \<in> g ` S - g ` C. f x \<noteq> 0}
[PROOF STEP]
using CNS
[PROOF STATE]
proof (prove)
using this:
C \<union> N = S

goal (1 subgoal):
 1. negligible {x \<in> g ` C - g ` S. f x \<noteq> 0} &&& negligible {x \<in> g ` S - g ` C. f x \<noteq> 0}
[PROOF STEP]
by (blast intro: negligible_subset [OF neg_gN])+
[PROOF STATE]
proof (state)
this:
negligible {x \<in> g ` C - g ` S. f x \<noteq> 0}
negligible {x \<in> g ` S - g ` C. f x \<noteq> 0}

goal (2 subgoals):
 1. (f absolutely_integrable_on g ` C) = (f absolutely_integrable_on g ` S)
 2. f absolutely_integrable_on g ` S \<Longrightarrow> (integral (g ` C) f = b) = (integral (g ` S) f = b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
negligible {x \<in> g ` C - g ` S. f x \<noteq> 0}
negligible {x \<in> g ` S - g ` C. f x \<noteq> 0}
[PROOF STEP]
show "(f absolutely_integrable_on g ` C) = (f absolutely_integrable_on g ` S)"
[PROOF STATE]
proof (prove)
using this:
negligible {x \<in> g ` C - g ` S. f x \<noteq> 0}
negligible {x \<in> g ` S - g ` C. f x \<noteq> 0}

goal (1 subgoal):
 1. (f absolutely_integrable_on g ` C) = (f absolutely_integrable_on g ` S)
[PROOF STEP]
by (rule absolutely_integrable_spike_set_eq)
[PROOF STATE]
proof (state)
this:
(f absolutely_integrable_on g ` C) = (f absolutely_integrable_on g ` S)

goal (1 subgoal):
 1. f absolutely_integrable_on g ` S \<Longrightarrow> (integral (g ` C) f = b) = (integral (g ` S) f = b)
[PROOF STEP]
show "(integral (g ` C) f = b) \<longleftrightarrow> (integral (g ` S) f = b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (integral (g ` C) f = b) = (integral (g ` S) f = b)
[PROOF STEP]
using integral_spike_set [OF neg]
[PROOF STATE]
proof (prove)
using this:
integral (g ` C) f = integral (g ` S) f

goal (1 subgoal):
 1. (integral (g ` C) f = b) = (integral (g ` S) f = b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(integral (g ` C) f = b) = (integral (g ` S) f = b)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(f absolutely_integrable_on g ` C \<and> integral (g ` C) f = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)

goal (1 subgoal):
 1. ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on C \<and> integral C (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` C \<and> integral (g ` C) f = b)
((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on C \<and> integral C (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b)
(f absolutely_integrable_on g ` C \<and> integral (g ` C) f = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on C \<and> integral C (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` C \<and> integral (g ` C) f = b)
((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on C \<and> integral C (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b)
(f absolutely_integrable_on g ` C \<and> integral (g ` C) f = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)

goal (1 subgoal):
 1. ((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
((\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) absolutely_integrable_on S \<and> integral S (\<lambda>x. \<bar>det (matrix (g' x))\<bar> *\<^sub>R f (g x)) = b) = (f absolutely_integrable_on g ` S \<and> integral (g ` S) f = b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma conjugate_add_vec:
  fixes v w :: "'a :: conjugatable_ring vec"
  assumes dim: "v : carrier_vec n" "w : carrier_vec n"
  shows "conjugate (v + w) = conjugate v + conjugate w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conjugate (v + w) = conjugate v + conjugate w
[PROOF STEP]
by (rule, insert dim, auto simp: conjugate_dist_add)


[STATEMENT]
lemma MN_refines: "\<lbrakk>MyhillNerode L R; (x,y) \<in> R\<rbrakk> \<Longrightarrow> x \<in> L \<longleftrightarrow> y \<in> L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>MyhillNerode L R; (x, y) \<in> R\<rbrakk> \<Longrightarrow> (x \<in> L) = (y \<in> L)
[PROOF STEP]
unfolding equiv_def trans_def sym_def MyhillNerode_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(refl R \<and> (\<forall>x y. (x, y) \<in> R \<longrightarrow> (y, x) \<in> R) \<and> (\<forall>x y z. (x, y) \<in> R \<longrightarrow> (y, z) \<in> R \<longrightarrow> (x, z) \<in> R)) \<and> right_invariant R \<and> finite (UNIV // R) \<and> (\<exists>A. L = R `` A); (x, y) \<in> R\<rbrakk> \<Longrightarrow> (x \<in> L) = (y \<in> L)
[PROOF STEP]
by blast


[STATEMENT]
lemma adjoint_adjoint:
  fixes f :: "'n::euclidean_space \<Rightarrow> 'm::euclidean_space"
  assumes lf: "linear f"
  shows "adjoint (adjoint f) = f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjoint (adjoint f) = f
[PROOF STEP]
by (rule adjoint_unique, simp add: adjoint_clauses [OF lf])


[STATEMENT]
lemma mat_kernelD: assumes "A \<in> carrier_mat nr nc" "v \<in> mat_kernel A"
  shows "v \<in> carrier_vec nc" "A *\<^sub>v v = 0\<^sub>v nr"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> carrier_vec nc &&& A *\<^sub>v v = 0\<^sub>v nr
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat nr nc
v \<in> mat_kernel A

goal (1 subgoal):
 1. v \<in> carrier_vec nc &&& A *\<^sub>v v = 0\<^sub>v nr
[PROOF STEP]
unfolding mat_kernel_def
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat nr nc
v \<in> {v \<in> carrier_vec (dim_col A). A *\<^sub>v v = 0\<^sub>v (dim_row A)}

goal (1 subgoal):
 1. v \<in> carrier_vec nc &&& A *\<^sub>v v = 0\<^sub>v nr
[PROOF STEP]
by auto


[STATEMENT]
lemma LeadsTo_UN_UN:
     "(!! i. i \<in> I ==> F \<in> (A i) LeadsTo (A' i))
      ==> F \<in> (\<Union>i \<in> I. A i) LeadsTo (\<Union>i \<in> I. A' i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. i \<in> I \<Longrightarrow> F \<in> A i \<longmapsto>w A' i) \<Longrightarrow> F \<in> \<Union> (A ` I) \<longmapsto>w \<Union> (A' ` I)
[PROOF STEP]
apply (blast intro: LeadsTo_Union LeadsTo_weaken_R)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma correct_DisjointSchedules1:
assumes h1:"DisjointSchedules n nC"
       and h2:"IdenticCycleLength n nC"
       and h3:"(t mod cycleLength (nC i)) mem schedule (nC i)"
       and h4:"i < n"
       and h5:"j < n"
       and h6:"i \<noteq> j"
shows "\<not> (t mod cycleLength (nC j) mem schedule (nC j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> t mod cycleLength (nC j) mem schedule (nC j)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> t mod cycleLength (nC j) mem schedule (nC j)
[PROOF STEP]
from h1 and h4 and h5 and h6
[PROOF STATE]
proof (chain)
picking this:
DisjointSchedules n nC
i < n
j < n
i \<noteq> j
[PROOF STEP]
have sg1:"disjoint (schedule (nC i)) (schedule (nC j))"
[PROOF STATE]
proof (prove)
using this:
DisjointSchedules n nC
i < n
j < n
i \<noteq> j

goal (1 subgoal):
 1. disjoint (schedule (nC i)) (schedule (nC j))
[PROOF STEP]
by (simp add: DisjointSchedules_def)
[PROOF STATE]
proof (state)
this:
disjoint (schedule (nC i)) (schedule (nC j))

goal (1 subgoal):
 1. \<not> t mod cycleLength (nC j) mem schedule (nC j)
[PROOF STEP]
from h2 and h4 and h5
[PROOF STATE]
proof (chain)
picking this:
IdenticCycleLength n nC
i < n
j < n
[PROOF STEP]
have sg2:"cycleLength (nC i) = cycleLength (nC j)"
[PROOF STATE]
proof (prove)
using this:
IdenticCycleLength n nC
i < n
j < n

goal (1 subgoal):
 1. cycleLength (nC i) = cycleLength (nC j)
[PROOF STEP]
by (metis IdenticCycleLength_def)
[PROOF STATE]
proof (state)
this:
cycleLength (nC i) = cycleLength (nC j)

goal (1 subgoal):
 1. \<not> t mod cycleLength (nC j) mem schedule (nC j)
[PROOF STEP]
from sg1 and h3
[PROOF STATE]
proof (chain)
picking this:
disjoint (schedule (nC i)) (schedule (nC j))
t mod cycleLength (nC i) mem schedule (nC i)
[PROOF STEP]
have sg3:"\<not> (t mod (cycleLength (nC i))) mem (schedule (nC j))"
[PROOF STATE]
proof (prove)
using this:
disjoint (schedule (nC i)) (schedule (nC j))
t mod cycleLength (nC i) mem schedule (nC i)

goal (1 subgoal):
 1. \<not> t mod cycleLength (nC i) mem schedule (nC j)
[PROOF STEP]
by (simp add: mem_notdisjoint2)
[PROOF STATE]
proof (state)
this:
\<not> t mod cycleLength (nC i) mem schedule (nC j)

goal (1 subgoal):
 1. \<not> t mod cycleLength (nC j) mem schedule (nC j)
[PROOF STEP]
from sg2 and sg3
[PROOF STATE]
proof (chain)
picking this:
cycleLength (nC i) = cycleLength (nC j)
\<not> t mod cycleLength (nC i) mem schedule (nC j)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cycleLength (nC i) = cycleLength (nC j)
\<not> t mod cycleLength (nC i) mem schedule (nC j)

goal (1 subgoal):
 1. \<not> t mod cycleLength (nC j) mem schedule (nC j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<not> t mod cycleLength (nC j) mem schedule (nC j)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma conv_radius_eqI:
  fixes f :: "nat \<Rightarrow> 'a :: {banach, real_normed_div_algebra}"
  assumes "R \<ge> 0"
  assumes "\<And>r. 0 < r \<Longrightarrow> ereal r < R \<Longrightarrow> \<exists>z. norm z = r \<and> summable (\<lambda>n. f n * z^n)"
  assumes "\<And>r. 0 < r \<Longrightarrow> ereal r > R \<Longrightarrow> \<exists>z. norm z = r \<and> \<not>summable (\<lambda>n. norm (f n * z^n))"
  shows   "conv_radius f = R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conv_radius f = R
[PROOF STEP]
by (intro antisym conv_radius_geI_ex conv_radius_leI_ex assms)


[STATEMENT]
lemma nz_prod_sum_eq:
  fixes c :: "'a::linordered_field"
  assumes "c \<noteq> 0"
  shows "c * x + t = 0 \<equiv> x = (- 1/c) * t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c * x + t = (0::'a) \<equiv> x = - (1::'a) / c * t
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. c * x + t = (0::'a) \<equiv> x = - (1::'a) / c * t
[PROOF STEP]
have "c * x + t = 0 \<longleftrightarrow> c * x = - t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (c * x + t = (0::'a)) = (c * x = - t)
[PROOF STEP]
by (subst eq_iff_diff_eq_0 [of "c*x" "-t"]) simp
[PROOF STATE]
proof (state)
this:
(c * x + t = (0::'a)) = (c * x = - t)

goal (1 subgoal):
 1. c * x + t = (0::'a) \<equiv> x = - (1::'a) / c * t
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(c * x + t = (0::'a)) = (c * x = - t)

goal (1 subgoal):
 1. c * x + t = (0::'a) \<equiv> x = - (1::'a) / c * t
[PROOF STEP]
have "\<dots> \<longleftrightarrow> x = - t / c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (c * x = - t) = (x = - t / c)
[PROOF STEP]
by (simp only: nonzero_eq_divide_eq[OF \<open>c \<noteq> 0\<close>] algebra_simps)
[PROOF STATE]
proof (state)
this:
(c * x = - t) = (x = - t / c)

goal (1 subgoal):
 1. c * x + t = (0::'a) \<equiv> x = - (1::'a) / c * t
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(c * x + t = (0::'a)) = (x = - t / c)
[PROOF STEP]
show "PROP ?thesis"
[PROOF STATE]
proof (prove)
using this:
(c * x + t = (0::'a)) = (x = - t / c)

goal (1 subgoal):
 1. c * x + t = (0::'a) \<equiv> x = - (1::'a) / c * t
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
c * x + t = (0::'a) \<equiv> x = - (1::'a) / c * t

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma poly_mult_gt_mono:
  fixes q :: "('v :: linorder,'a)poly"
  assumes gt: "p1 >p p2" and mono: "q \<ge>p one_poly"
  shows "poly_mult p1 q >p poly_mult p2 q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_mult p1 q >p poly_mult p2 q
[PROOF STEP]
proof (unfold poly_gt_def, intro impI allI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>\<alpha>. pos_assign \<alpha> \<Longrightarrow> eval_poly \<alpha> (poly_mult p1 q) \<succ> eval_poly \<alpha> (poly_mult p2 q)
[PROOF STEP]
fix \<alpha> :: "('v,'a)assign"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>\<alpha>. pos_assign \<alpha> \<Longrightarrow> eval_poly \<alpha> (poly_mult p1 q) \<succ> eval_poly \<alpha> (poly_mult p2 q)
[PROOF STEP]
assume p: "pos_assign \<alpha>"
[PROOF STATE]
proof (state)
this:
pos_assign \<alpha>

goal (1 subgoal):
 1. \<And>\<alpha>. pos_assign \<alpha> \<Longrightarrow> eval_poly \<alpha> (poly_mult p1 q) \<succ> eval_poly \<alpha> (poly_mult p2 q)
[PROOF STEP]
with gt
[PROOF STATE]
proof (chain)
picking this:
p1 >p p2
pos_assign \<alpha>
[PROOF STEP]
have gt: "eval_poly \<alpha> p1 \<succ> eval_poly \<alpha> p2"
[PROOF STATE]
proof (prove)
using this:
p1 >p p2
pos_assign \<alpha>

goal (1 subgoal):
 1. eval_poly \<alpha> p1 \<succ> eval_poly \<alpha> p2
[PROOF STEP]
unfolding poly_gt_def
[PROOF STATE]
proof (prove)
using this:
\<forall>\<alpha>. pos_assign \<alpha> \<longrightarrow> eval_poly \<alpha> p1 \<succ> eval_poly \<alpha> p2
pos_assign \<alpha>

goal (1 subgoal):
 1. eval_poly \<alpha> p1 \<succ> eval_poly \<alpha> p2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
eval_poly \<alpha> p1 \<succ> eval_poly \<alpha> p2

goal (1 subgoal):
 1. \<And>\<alpha>. pos_assign \<alpha> \<Longrightarrow> eval_poly \<alpha> (poly_mult p1 q) \<succ> eval_poly \<alpha> (poly_mult p2 q)
[PROOF STEP]
from mono p
[PROOF STATE]
proof (chain)
picking this:
q \<ge>p one_poly
pos_assign \<alpha>
[PROOF STEP]
have one: "eval_poly \<alpha> q \<ge> 1"
[PROOF STATE]
proof (prove)
using this:
q \<ge>p one_poly
pos_assign \<alpha>

goal (1 subgoal):
 1. (1::'a) \<le> eval_poly \<alpha> q
[PROOF STEP]
unfolding poly_ge_def one_poly_def
[PROOF STATE]
proof (prove)
using this:
\<forall>\<alpha>. pos_assign \<alpha> \<longrightarrow> eval_poly \<alpha> [(1, 1::'a)] \<le> eval_poly \<alpha> q
pos_assign \<alpha>

goal (1 subgoal):
 1. (1::'a) \<le> eval_poly \<alpha> q
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(1::'a) \<le> eval_poly \<alpha> q

goal (1 subgoal):
 1. \<And>\<alpha>. pos_assign \<alpha> \<Longrightarrow> eval_poly \<alpha> (poly_mult p1 q) \<succ> eval_poly \<alpha> (poly_mult p2 q)
[PROOF STEP]
show "eval_poly \<alpha> (poly_mult p1 q) \<succ> eval_poly \<alpha> (poly_mult p2 q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eval_poly \<alpha> (poly_mult p1 q) \<succ> eval_poly \<alpha> (poly_mult p2 q)
[PROOF STEP]
using times_gt_mono[OF gt one]
[PROOF STATE]
proof (prove)
using this:
eval_poly \<alpha> p1 * eval_poly \<alpha> q \<succ> eval_poly \<alpha> p2 * eval_poly \<alpha> q

goal (1 subgoal):
 1. eval_poly \<alpha> (poly_mult p1 q) \<succ> eval_poly \<alpha> (poly_mult p2 q)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
eval_poly \<alpha> (poly_mult p1 q) \<succ> eval_poly \<alpha> (poly_mult p2 q)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cSup_asclose:
  fixes S :: "'a::{linordered_idom,conditionally_complete_linorder} set"
  assumes S: "S \<noteq> {}"
    and b: "\<forall>x\<in>S. \<bar>x - l\<bar> \<le> e"
  shows "\<bar>Sup S - l\<bar> \<le> e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>Sup S - l\<bar> \<le> e
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<bar>Sup S - l\<bar> \<le> e
[PROOF STEP]
have *: "\<bar>x - l\<bar> \<le> e \<longleftrightarrow> l - e \<le> x \<and> x \<le> l + e" for x l e :: 'a
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<bar>x - l\<bar> \<le> e) = (l - e \<le> x \<and> x \<le> l + e)
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
(\<bar>?x - ?l\<bar> \<le> ?e) = (?l - ?e \<le> ?x \<and> ?x \<le> ?l + ?e)

goal (1 subgoal):
 1. \<bar>Sup S - l\<bar> \<le> e
[PROOF STEP]
have "bdd_above S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bdd_above S
[PROOF STEP]
using b
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>S. \<bar>x - l\<bar> \<le> e

goal (1 subgoal):
 1. bdd_above S
[PROOF STEP]
by (auto intro!: bdd_aboveI[of _ "l + e"])
[PROOF STATE]
proof (state)
this:
bdd_above S

goal (1 subgoal):
 1. \<bar>Sup S - l\<bar> \<le> e
[PROOF STEP]
with S b
[PROOF STATE]
proof (chain)
picking this:
S \<noteq> {}
\<forall>x\<in>S. \<bar>x - l\<bar> \<le> e
bdd_above S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
S \<noteq> {}
\<forall>x\<in>S. \<bar>x - l\<bar> \<le> e
bdd_above S

goal (1 subgoal):
 1. \<bar>Sup S - l\<bar> \<le> e
[PROOF STEP]
unfolding *
[PROOF STATE]
proof (prove)
using this:
S \<noteq> {}
\<forall>x\<in>S. l - e \<le> x \<and> x \<le> l + e
bdd_above S

goal (1 subgoal):
 1. l - e \<le> Sup S \<and> Sup S \<le> l + e
[PROOF STEP]
by (auto intro!: cSup_upper2 cSup_least)
[PROOF STATE]
proof (state)
this:
\<bar>Sup S - l\<bar> \<le> e

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma multiplicity_prime:
  assumes p: "prime (i :: nat)" and ji: "j \<noteq> i"
  shows "multiplicity j i = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicity j i = 0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
prime i
j \<noteq> i

goal (1 subgoal):
 1. multiplicity j i = 0
[PROOF STEP]
by (metis dvd_refl prime_nat_iff multiplicity_eq_zero_iff
        multiplicity_unit_left multiplicity_zero)


[STATEMENT]
lemma bigo_const_powr:
  assumes "filterlim f at_top F" "F \<noteq> bot"
  shows "(\<lambda>_. c :: real) \<in> O[F](\<lambda>x. f x powr p) \<longleftrightarrow> p \<ge> 0 \<or> c = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>_. c) \<in> O[F](\<lambda>x. f x powr p)) = (0 \<le> p \<or> c = 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>_. c) \<in> O[F](\<lambda>x. f x powr p)) = (0 \<le> p \<or> c = 0)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
filterlim f at_top F
F \<noteq> bot
[PROOF STEP]
have A: "(\<lambda>_. 1) \<in> o[F](f)"
[PROOF STATE]
proof (prove)
using this:
filterlim f at_top F
F \<noteq> bot

goal (1 subgoal):
 1. (\<lambda>_. 1) \<in> o[F](f)
[PROOF STEP]
by (simp add: filterlim_at_top_iff_smallomega smallomega_iff_smallo landau_o.small_imp_big)
[PROOF STATE]
proof (state)
this:
(\<lambda>_. 1) \<in> o[F](f)

goal (1 subgoal):
 1. ((\<lambda>_. c) \<in> O[F](\<lambda>x. f x powr p)) = (0 \<le> p \<or> c = 0)
[PROOF STEP]
hence B: "(\<lambda>_. 1) \<in> O[F](f)" "f \<notin> O[F](\<lambda>_. 1)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>_. 1) \<in> o[F](f)

goal (1 subgoal):
 1. (\<lambda>_. 1) \<in> O[F](f) &&& f \<notin> O[F](\<lambda>_. 1)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(\<lambda>_. 1) \<in> o[F](f)
filterlim f at_top F
F \<noteq> bot

goal (1 subgoal):
 1. (\<lambda>_. 1) \<in> O[F](f) &&& f \<notin> O[F](\<lambda>_. 1)
[PROOF STEP]
by (auto simp: landau_o.small_imp_big dest: landau_o.small_big_asymmetric)
[PROOF STATE]
proof (state)
this:
(\<lambda>_. 1) \<in> O[F](f)
f \<notin> O[F](\<lambda>_. 1)

goal (1 subgoal):
 1. ((\<lambda>_. c) \<in> O[F](\<lambda>x. f x powr p)) = (0 \<le> p \<or> c = 0)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>_. c) \<in> O[F](\<lambda>x. f x powr p)) = (0 \<le> p \<or> c = 0)
[PROOF STEP]
by (rule linorder_cases[of p 0]; cases "c = 0")
       (insert insert assms A B bigo_powr_iff[of p "\<lambda>_. 1" F f] bigo_neg_powr_iff[of p "\<lambda>_. 1" F f],
        auto simp: landau_simps eventually_nonzero_simps not_less dest: landau_o.small_asymmetric)
[PROOF STATE]
proof (state)
this:
((\<lambda>_. c) \<in> O[F](\<lambda>x. f x powr p)) = (0 \<le> p \<or> c = 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eventually_le_abs_nonneg:
  "eventually (\<lambda>x. l x \<ge> 0) at_top \<Longrightarrow> eventually (\<lambda>x. f x \<ge> l x) at_top \<Longrightarrow>
     eventually (\<lambda>x::real. l x \<le> (\<bar>f x\<bar> :: real)) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>\<^sub>F x in at_top. 0 \<le> l x; \<forall>\<^sub>F x in at_top. l x \<le> f x\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in at_top. l x \<le> \<bar>f x\<bar>
[PROOF STEP]
by (auto elim: eventually_elim2)


[STATEMENT]
lemma index_sl_four [simp]: "\<forall>i::nat. i < 4 \<longrightarrow> i = 0 \<or> i = 1 \<or> i = 2 \<or> i = 3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i<4. i = 0 \<or> i = 1 \<or> i = 2 \<or> i = 3
[PROOF STEP]
by auto


[STATEMENT]
lemma bl_and_bin: "map2 (\<and>) (bin_to_bl n v) (bin_to_bl n w) = bin_to_bl n (v AND w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map2 (\<and>) (bin_to_bl n v) (bin_to_bl n w) = bin_to_bl n (v AND w)
[PROOF STEP]
by (simp add: bin_to_bl_def bl_and_aux_bin)


[STATEMENT]
lemma path_mult: "\<lbrakk>path f; path g\<rbrakk> \<Longrightarrow> path (\<lambda>t. f t * g t)" for f::"real\<Rightarrow>'a::real_normed_field"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>path f; path g\<rbrakk> \<Longrightarrow> path (\<lambda>t. f t * g t)
[PROOF STEP]
unfolding path_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>continuous_on {0..1} f; continuous_on {0..1} g\<rbrakk> \<Longrightarrow> continuous_on {0..1} (\<lambda>t. f t * g t)
[PROOF STEP]
by (intro continuous_intros)


[STATEMENT]
lemma jordan_block_index[simp]: "i < n \<Longrightarrow> j < n \<Longrightarrow>
  jordan_block n a $$ (i,j) = (if i = j then a else if Suc i = j then 1 else 0)"
  "dim_row (jordan_block n k) = n"
  "dim_col (jordan_block n k) = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lbrakk>i < n; j < n\<rbrakk> \<Longrightarrow> jordan_block n a $$ (i, j) = (if i = j then a else if Suc i = j then 1::'a else (0::'a))) &&& dim_row (jordan_block n k) = n &&& dim_col (jordan_block n k) = n
[PROOF STEP]
unfolding jordan_block_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lbrakk>i < n; j < n\<rbrakk> \<Longrightarrow> mat n n (\<lambda>(i, j). if i = j then a else if Suc i = j then 1::'a else (0::'a)) $$ (i, j) = (if i = j then a else if Suc i = j then 1::'a else (0::'a))) &&& dim_row (mat n n (\<lambda>(i, j). if i = j then k else if Suc i = j then 1::'b else (0::'b))) = n &&& dim_col (mat n n (\<lambda>(i, j). if i = j then k else if Suc i = j then 1::'b else (0::'b))) = n
[PROOF STEP]
by auto


[STATEMENT]
lemma has_integral_is_0_cbox:
  fixes f :: "'n::euclidean_space \<Rightarrow> 'a::real_normed_vector"
  assumes "\<And>x. x \<in> cbox a b \<Longrightarrow> f x = 0"
  shows "(f has_integral 0) (cbox a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_integral (0::'a)) (cbox a b)
[PROOF STEP]
unfolding has_integral_cbox
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sum (\<lambda>(x, k). content k *\<^sub>R f x) \<longlongrightarrow> (0::'a)) (division_filter (cbox a b))
[PROOF STEP]
using eventually_division_filter_tagged_division[of "cbox a b"] assms
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F p in division_filter (cbox a b). p tagged_division_of cbox a b
?x \<in> cbox a b \<Longrightarrow> f ?x = (0::'a)

goal (1 subgoal):
 1. (sum (\<lambda>(x, k). content k *\<^sub>R f x) \<longlongrightarrow> (0::'a)) (division_filter (cbox a b))
[PROOF STEP]
by (subst tendsto_cong[where g="\<lambda>_. 0"])
       (auto elim!: eventually_mono intro!: sum.neutral simp: tag_in_interval)


[STATEMENT]
lemma bacc_upper_bound:
  "bacc (r :: ('a \<times> 'a) set)  (card (UNIV :: 'a::finite set)) = (\<Union>n. bacc r n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bacc r (card UNIV) = \<Union> (range (bacc r))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bacc r (card UNIV) = \<Union> (range (bacc r))
[PROOF STEP]
have "mono (bacc r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mono (bacc r)
[PROOF STEP]
unfolding mono_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. x \<le> y \<longrightarrow> bacc r x \<subseteq> bacc r y
[PROOF STEP]
by (simp add: bacc_mono)
[PROOF STATE]
proof (state)
this:
mono (bacc r)

goal (1 subgoal):
 1. bacc r (card UNIV) = \<Union> (range (bacc r))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
mono (bacc r)

goal (1 subgoal):
 1. bacc r (card UNIV) = \<Union> (range (bacc r))
[PROOF STEP]
have "\<forall>n. bacc r n = bacc r (Suc n) \<longrightarrow> bacc r (Suc n) = bacc r (Suc (Suc n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>n. bacc r n = bacc r (Suc n) \<longrightarrow> bacc r (Suc n) = bacc r (Suc (Suc n))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>n. bacc r n = bacc r (Suc n) \<longrightarrow> bacc r (Suc n) = bacc r (Suc (Suc n))

goal (1 subgoal):
 1. bacc r (card UNIV) = \<Union> (range (bacc r))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>n. bacc r n = bacc r (Suc n) \<longrightarrow> bacc r (Suc n) = bacc r (Suc (Suc n))

goal (1 subgoal):
 1. bacc r (card UNIV) = \<Union> (range (bacc r))
[PROOF STEP]
have "finite (range (bacc r))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (range (bacc r))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite (range (bacc r))

goal (1 subgoal):
 1. bacc r (card UNIV) = \<Union> (range (bacc r))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
mono (bacc r)
\<forall>n. bacc r n = bacc r (Suc n) \<longrightarrow> bacc r (Suc n) = bacc r (Suc (Suc n))
finite (range (bacc r))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
mono (bacc r)
\<forall>n. bacc r n = bacc r (Suc n) \<longrightarrow> bacc r (Suc n) = bacc r (Suc (Suc n))
finite (range (bacc r))

goal (1 subgoal):
 1. bacc r (card UNIV) = \<Union> (range (bacc r))
[PROOF STEP]
by (intro finite_mono_strict_prefix_implies_finite_fixpoint)
     (auto intro: finite_mono_remains_stable_implies_strict_prefix)
[PROOF STATE]
proof (state)
this:
bacc r (card UNIV) = \<Union> (range (bacc r))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ceiling_less_one [simp]: "\<lceil>x\<rceil> < 1 \<longleftrightarrow> x \<le> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lceil>x\<rceil> < 1) = (x \<le> (0::'a))
[PROOF STEP]
by (simp add: ceiling_less_iff)


[STATEMENT]
theorem CONS_subset_Lim: "CONS \<subset> LIM"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. CONS \<subset> LIM
[PROOF STEP]
using U_LIMCONS_in_Lim U_LIMCONS_not_in_CONS CONS_subseteq_Lim
[PROOF STATE]
proof (prove)
using this:
U\<^bsub>LIM-CONS\<^esub> \<in> LIM
U\<^bsub>LIM-CONS\<^esub> \<notin> CONS
CONS \<subseteq> LIM

goal (1 subgoal):
 1. CONS \<subset> LIM
[PROOF STEP]
by auto


[STATEMENT]
lemma tensor_smult_distr_left: "dims A = dims B \<Longrightarrow> \<alpha> \<cdot> (A + B) = \<alpha> \<cdot> A  + \<alpha> \<cdot> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dims A = dims B \<Longrightarrow> \<alpha> \<cdot> (A + B) = \<alpha> \<cdot> A + \<alpha> \<cdot> B
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dims A = dims B \<Longrightarrow> \<alpha> \<cdot> (A + B) = \<alpha> \<cdot> A + \<alpha> \<cdot> B
[PROOF STEP]
assume a1: "dims A = dims B"
[PROOF STATE]
proof (state)
this:
dims A = dims B

goal (1 subgoal):
 1. dims A = dims B \<Longrightarrow> \<alpha> \<cdot> (A + B) = \<alpha> \<cdot> A + \<alpha> \<cdot> B
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
dims A = dims B
[PROOF STEP]
have f2: "length (vec_plus (vec A) (vec B)) = length (vec A)"
[PROOF STATE]
proof (prove)
using this:
dims A = dims B

goal (1 subgoal):
 1. length (vec_plus (vec A) (vec B)) = length (vec A)
[PROOF STEP]
by (simp add: length_vec vec_plus_def)
[PROOF STATE]
proof (state)
this:
length (vec_plus (vec A) (vec B)) = length (vec A)

goal (1 subgoal):
 1. dims A = dims B \<Longrightarrow> \<alpha> \<cdot> (A + B) = \<alpha> \<cdot> A + \<alpha> \<cdot> B
[PROOF STEP]
have f3: "dims (tensor_from_vec (dims B) (vec_smult \<alpha> (vec A))) = dims B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dims (tensor_from_vec (dims B) (vec_smult \<alpha> (vec A))) = dims B
[PROOF STEP]
using a1
[PROOF STATE]
proof (prove)
using this:
dims A = dims B

goal (1 subgoal):
 1. dims (tensor_from_vec (dims B) (vec_smult \<alpha> (vec A))) = dims B
[PROOF STEP]
by (simp add: length_vec vec_smult_def)
[PROOF STATE]
proof (state)
this:
dims (tensor_from_vec (dims B) (vec_smult \<alpha> (vec A))) = dims B

goal (1 subgoal):
 1. dims A = dims B \<Longrightarrow> \<alpha> \<cdot> (A + B) = \<alpha> \<cdot> A + \<alpha> \<cdot> B
[PROOF STEP]
have f4: "vec (\<alpha> \<cdot> A) = vec_smult \<alpha> (vec A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec (\<alpha> \<cdot> A) = vec_smult \<alpha> (vec A)
[PROOF STEP]
by (simp add: vec_smult_def)
[PROOF STATE]
proof (state)
this:
vec (\<alpha> \<cdot> A) = vec_smult \<alpha> (vec A)

goal (1 subgoal):
 1. dims A = dims B \<Longrightarrow> \<alpha> \<cdot> (A + B) = \<alpha> \<cdot> A + \<alpha> \<cdot> B
[PROOF STEP]
have "length (vec_smult \<alpha> (vec B)) = length (vec B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (vec_smult \<alpha> (vec B)) = length (vec B)
[PROOF STEP]
by (simp add: vec_smult_def)
[PROOF STATE]
proof (state)
this:
length (vec_smult \<alpha> (vec B)) = length (vec B)

goal (1 subgoal):
 1. dims A = dims B \<Longrightarrow> \<alpha> \<cdot> (A + B) = \<alpha> \<cdot> A + \<alpha> \<cdot> B
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
length (vec_smult \<alpha> (vec B)) = length (vec B)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
length (vec_smult \<alpha> (vec B)) = length (vec B)

goal (1 subgoal):
 1. \<alpha> \<cdot> (A + B) = \<alpha> \<cdot> A + \<alpha> \<cdot> B
[PROOF STEP]
unfolding plus_def plus_base_def
[PROOF STATE]
proof (prove)
using this:
length (vec_smult \<alpha> (vec B)) = length (vec B)

goal (1 subgoal):
 1. \<alpha> \<cdot> (if dims A = dims B then tensor_from_vec (dims A) (vec_plus (vec A) (vec B)) else undefined) = (if dims (\<alpha> \<cdot> A) = dims (\<alpha> \<cdot> B) then tensor_from_vec (dims (\<alpha> \<cdot> A)) (vec_plus (vec (\<alpha> \<cdot> A)) (vec (\<alpha> \<cdot> B))) else undefined)
[PROOF STEP]
using f4 f3 f2 a1
[PROOF STATE]
proof (prove)
using this:
length (vec_smult \<alpha> (vec B)) = length (vec B)
vec (\<alpha> \<cdot> A) = vec_smult \<alpha> (vec A)
dims (tensor_from_vec (dims B) (vec_smult \<alpha> (vec A))) = dims B
length (vec_plus (vec A) (vec B)) = length (vec A)
dims A = dims B

goal (1 subgoal):
 1. \<alpha> \<cdot> (if dims A = dims B then tensor_from_vec (dims A) (vec_plus (vec A) (vec B)) else undefined) = (if dims (\<alpha> \<cdot> A) = dims (\<alpha> \<cdot> B) then tensor_from_vec (dims (\<alpha> \<cdot> A)) (vec_plus (vec (\<alpha> \<cdot> A)) (vec (\<alpha> \<cdot> B))) else undefined)
[PROOF STEP]
by (simp add: length_vec smult_def vec_smult_distr_left)
[PROOF STATE]
proof (state)
this:
\<alpha> \<cdot> (A + B) = \<alpha> \<cdot> A + \<alpha> \<cdot> B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dim_subset: "S \<subseteq> T \<Longrightarrow> dim S \<le> dim T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<subseteq> T \<Longrightarrow> dim S \<le> dim T
[PROOF STEP]
using dim_mono[of S T]
[PROOF STATE]
proof (prove)
using this:
S \<subseteq> span T \<Longrightarrow> dim S \<le> dim T

goal (1 subgoal):
 1. S \<subseteq> T \<Longrightarrow> dim S \<le> dim T
[PROOF STEP]
by (auto intro: span_base)


[STATEMENT]
lemma exp_split_high_low: assumes "x < 2^(n+m)" and "n > 0" and "m> 0"
  shows "high x n < 2^m" and "low x n < 2^n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. high x n < 2 ^ m &&& low x n < 2 ^ n
[PROOF STEP]
apply (metis Euclidean_Division.div_eq_0_iff assms(1) div_exp_eq high_def nat.simps(3) numeral_2_eq_2 power_not_zero)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. low x n < 2 ^ n
[PROOF STEP]
by (simp add: low_def)


[STATEMENT]
lemma Gamma_euler'_aux1:
  fixes z :: "'a :: {real_normed_field,banach}"
  assumes n: "n > 0"
  shows "exp (z * of_real (ln (of_nat n + 1))) = (\<Prod>k=1..n. exp (z * of_real (ln (1 + 1 / of_nat k))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp (z * of_real (ln (real n + 1))) = (\<Prod>k = 1..n. exp (z * of_real (ln (1 + 1 / real k))))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. exp (z * of_real (ln (real n + 1))) = (\<Prod>k = 1..n. exp (z * of_real (ln (1 + 1 / real k))))
[PROOF STEP]
have "(\<Prod>k=1..n. exp (z * of_real (ln (1 + 1 / of_nat k)))) =
          exp (z * of_real (\<Sum>k = 1..n. ln (1 + 1 / real_of_nat k)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>k = 1..n. exp (z * of_real (ln (1 + 1 / real k)))) = exp (z * of_real (\<Sum>k = 1..n. ln (1 + 1 / real k)))
[PROOF STEP]
by (subst exp_sum [symmetric]) (simp_all add: sum_distrib_left)
[PROOF STATE]
proof (state)
this:
(\<Prod>k = 1..n. exp (z * of_real (ln (1 + 1 / real k)))) = exp (z * of_real (\<Sum>k = 1..n. ln (1 + 1 / real k)))

goal (1 subgoal):
 1. exp (z * of_real (ln (real n + 1))) = (\<Prod>k = 1..n. exp (z * of_real (ln (1 + 1 / real k))))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Prod>k = 1..n. exp (z * of_real (ln (1 + 1 / real k)))) = exp (z * of_real (\<Sum>k = 1..n. ln (1 + 1 / real k)))

goal (1 subgoal):
 1. exp (z * of_real (ln (real n + 1))) = (\<Prod>k = 1..n. exp (z * of_real (ln (1 + 1 / real k))))
[PROOF STEP]
have "(\<Sum>k=1..n. ln (1 + 1 / of_nat k) :: real) = ln (\<Prod>k=1..n. 1 + 1 / real_of_nat k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = 1..n. ln (1 + 1 / real k)) = ln (\<Prod>k = 1..n. 1 + 1 / real k)
[PROOF STEP]
by (subst ln_prod [symmetric]) (auto intro!: add_pos_nonneg)
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 1..n. ln (1 + 1 / real k)) = ln (\<Prod>k = 1..n. 1 + 1 / real k)

goal (1 subgoal):
 1. exp (z * of_real (ln (real n + 1))) = (\<Prod>k = 1..n. exp (z * of_real (ln (1 + 1 / real k))))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 1..n. ln (1 + 1 / real k)) = ln (\<Prod>k = 1..n. 1 + 1 / real k)

goal (1 subgoal):
 1. exp (z * of_real (ln (real n + 1))) = (\<Prod>k = 1..n. exp (z * of_real (ln (1 + 1 / real k))))
[PROOF STEP]
have "(\<Prod>k=1..n. 1 + 1 / of_nat k :: real) = (\<Prod>k=1..n. (of_nat k + 1) / of_nat k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>k = 1..n. 1 + 1 / real k) = (\<Prod>k = 1..n. (real k + 1) / real k)
[PROOF STEP]
by (intro prod.cong) (simp_all add: field_split_simps)
[PROOF STATE]
proof (state)
this:
(\<Prod>k = 1..n. 1 + 1 / real k) = (\<Prod>k = 1..n. (real k + 1) / real k)

goal (1 subgoal):
 1. exp (z * of_real (ln (real n + 1))) = (\<Prod>k = 1..n. exp (z * of_real (ln (1 + 1 / real k))))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Prod>k = 1..n. 1 + 1 / real k) = (\<Prod>k = 1..n. (real k + 1) / real k)

goal (1 subgoal):
 1. exp (z * of_real (ln (real n + 1))) = (\<Prod>k = 1..n. exp (z * of_real (ln (1 + 1 / real k))))
[PROOF STEP]
have "(\<Prod>k=1..n. (of_nat k + 1) / of_nat k :: real) = of_nat n + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>k = 1..n. (real k + 1) / real k) = real n + 1
[PROOF STEP]
by (induction n) (simp_all add: prod.nat_ivl_Suc' field_split_simps)
[PROOF STATE]
proof (state)
this:
(\<Prod>k = 1..n. (real k + 1) / real k) = real n + 1

goal (1 subgoal):
 1. exp (z * of_real (ln (real n + 1))) = (\<Prod>k = 1..n. exp (z * of_real (ln (1 + 1 / real k))))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Prod>k = 1..n. exp (z * of_real (ln (1 + 1 / real k)))) = exp (z * of_real (ln (real n + 1)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Prod>k = 1..n. exp (z * of_real (ln (1 + 1 / real k)))) = exp (z * of_real (ln (real n + 1)))

goal (1 subgoal):
 1. exp (z * of_real (ln (real n + 1))) = (\<Prod>k = 1..n. exp (z * of_real (ln (1 + 1 / real k))))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
exp (z * of_real (ln (real n + 1))) = (\<Prod>k = 1..n. exp (z * of_real (ln (1 + 1 / real k))))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma integral_componentwise:
  fixes f :: "'a :: euclidean_space \<Rightarrow> 'b :: euclidean_space"
  assumes "f integrable_on A"
  shows "integral A f = (\<Sum>b\<in>Basis. integral A (\<lambda>x. (f x \<bullet> b) *\<^sub>R b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral A f = (\<Sum>b\<in>Basis. integral A (\<lambda>x. (f x \<bullet> b) *\<^sub>R b))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integral A f = (\<Sum>b\<in>Basis. integral A (\<lambda>x. (f x \<bullet> b) *\<^sub>R b))
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
f integrable_on A
[PROOF STEP]
have integrable: "\<forall>b\<in>Basis. (\<lambda>x. x *\<^sub>R b) \<circ> (\<lambda>x. (f x \<bullet> b)) integrable_on A"
[PROOF STATE]
proof (prove)
using this:
f integrable_on A

goal (1 subgoal):
 1. \<forall>b\<in>Basis. (\<lambda>x. x *\<^sub>R b) \<circ> (\<lambda>x. f x \<bullet> b) integrable_on A
[PROOF STEP]
by (subst (asm) integrable_componentwise_iff, intro integrable_linear ballI)
       (simp_all add: bounded_linear_scaleR_left)
[PROOF STATE]
proof (state)
this:
\<forall>b\<in>Basis. (\<lambda>x. x *\<^sub>R b) \<circ> (\<lambda>x. f x \<bullet> b) integrable_on A

goal (1 subgoal):
 1. integral A f = (\<Sum>b\<in>Basis. integral A (\<lambda>x. (f x \<bullet> b) *\<^sub>R b))
[PROOF STEP]
have "integral A f = integral A (\<lambda>x. \<Sum>b\<in>Basis. (f x \<bullet> b) *\<^sub>R b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral A f = integral A (\<lambda>x. \<Sum>b\<in>Basis. (f x \<bullet> b) *\<^sub>R b)
[PROOF STEP]
by (simp add: euclidean_representation)
[PROOF STATE]
proof (state)
this:
integral A f = integral A (\<lambda>x. \<Sum>b\<in>Basis. (f x \<bullet> b) *\<^sub>R b)

goal (1 subgoal):
 1. integral A f = (\<Sum>b\<in>Basis. integral A (\<lambda>x. (f x \<bullet> b) *\<^sub>R b))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
integral A f = integral A (\<lambda>x. \<Sum>b\<in>Basis. (f x \<bullet> b) *\<^sub>R b)

goal (1 subgoal):
 1. integral A f = (\<Sum>b\<in>Basis. integral A (\<lambda>x. (f x \<bullet> b) *\<^sub>R b))
[PROOF STEP]
from integrable
[PROOF STATE]
proof (chain)
picking this:
\<forall>b\<in>Basis. (\<lambda>x. x *\<^sub>R b) \<circ> (\<lambda>x. f x \<bullet> b) integrable_on A
[PROOF STEP]
have "\<dots> = (\<Sum>a\<in>Basis. integral A (\<lambda>x. (f x \<bullet> a) *\<^sub>R a))"
[PROOF STATE]
proof (prove)
using this:
\<forall>b\<in>Basis. (\<lambda>x. x *\<^sub>R b) \<circ> (\<lambda>x. f x \<bullet> b) integrable_on A

goal (1 subgoal):
 1. integral A (\<lambda>x. \<Sum>b\<in>Basis. (f x \<bullet> b) *\<^sub>R b) = (\<Sum>a\<in>Basis. integral A (\<lambda>x. (f x \<bullet> a) *\<^sub>R a))
[PROOF STEP]
by (subst integral_sum) (simp_all add: o_def)
[PROOF STATE]
proof (state)
this:
integral A (\<lambda>x. \<Sum>b\<in>Basis. (f x \<bullet> b) *\<^sub>R b) = (\<Sum>a\<in>Basis. integral A (\<lambda>x. (f x \<bullet> a) *\<^sub>R a))

goal (1 subgoal):
 1. integral A f = (\<Sum>b\<in>Basis. integral A (\<lambda>x. (f x \<bullet> b) *\<^sub>R b))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
integral A f = (\<Sum>a\<in>Basis. integral A (\<lambda>x. (f x \<bullet> a) *\<^sub>R a))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
integral A f = (\<Sum>a\<in>Basis. integral A (\<lambda>x. (f x \<bullet> a) *\<^sub>R a))

goal (1 subgoal):
 1. integral A f = (\<Sum>b\<in>Basis. integral A (\<lambda>x. (f x \<bullet> b) *\<^sub>R b))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
integral A f = (\<Sum>b\<in>Basis. integral A (\<lambda>x. (f x \<bullet> b) *\<^sub>R b))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma groupF_concat_set: "set (concat (groupF f xs)) = set xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (concat (groupF f xs)) = set xs
[PROOF STEP]
proof(induction f xs rule: groupF.induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>f. set (concat (groupF f [])) = set []
 2. \<And>f x xs. set (concat (groupF f (filter (\<lambda>y. f x \<noteq> f y) xs))) = set (filter (\<lambda>y. f x \<noteq> f y) xs) \<Longrightarrow> set (concat (groupF f (x # xs))) = set (x # xs)
[PROOF STEP]
case 2
[PROOF STATE]
proof (state)
this:
set (concat (groupF f_ (filter (\<lambda>y. f_ x_ \<noteq> f_ y) xs_))) = set (filter (\<lambda>y. f_ x_ \<noteq> f_ y) xs_)

goal (2 subgoals):
 1. \<And>f. set (concat (groupF f [])) = set []
 2. \<And>f x xs. set (concat (groupF f (filter (\<lambda>y. f x \<noteq> f y) xs))) = set (filter (\<lambda>y. f x \<noteq> f y) xs) \<Longrightarrow> set (concat (groupF f (x # xs))) = set (x # xs)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
set (concat (groupF f_ (filter (\<lambda>y. f_ x_ \<noteq> f_ y) xs_))) = set (filter (\<lambda>y. f_ x_ \<noteq> f_ y) xs_)

goal (1 subgoal):
 1. set (concat (groupF f_ (x_ # xs_))) = set (x_ # xs_)
[PROOF STEP]
by (simp) blast
[PROOF STATE]
proof (state)
this:
set (concat (groupF f_ (x_ # xs_))) = set (x_ # xs_)

goal (1 subgoal):
 1. \<And>f. set (concat (groupF f [])) = set []
[PROOF STEP]
qed(simp)


[STATEMENT]
lemma lattice_of_cols_as_mat_mult:
  assumes A: "A \<in> carrier_mat n nc" (*Integer matrix*)
  shows "lattice_of (cols A) = {y\<in>carrier_vec (dim_row A). \<exists>x\<in>carrier_vec (dim_col A). A *\<^sub>v x = y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lattice_of (cols A) = {y \<in> carrier_vec (dim_row A). \<exists>x\<in>carrier_vec (dim_col A). A *\<^sub>v x = y}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lattice_of (cols A) = {y \<in> carrier_vec (dim_row A). \<exists>x\<in>carrier_vec (dim_col A). A *\<^sub>v x = y}
[PROOF STEP]
let ?ws = "cols A"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lattice_of (cols A) = {y \<in> carrier_vec (dim_row A). \<exists>x\<in>carrier_vec (dim_col A). A *\<^sub>v x = y}
[PROOF STEP]
have set_cols_in: "set (cols A) \<subseteq> carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (cols A) \<subseteq> carrier_vec n
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n nc

goal (1 subgoal):
 1. set (cols A) \<subseteq> carrier_vec n
[PROOF STEP]
unfolding cols_def
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n nc

goal (1 subgoal):
 1. set (map (col A) [0..<dim_col A]) \<subseteq> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set (cols A) \<subseteq> carrier_vec n

goal (1 subgoal):
 1. lattice_of (cols A) = {y \<in> carrier_vec (dim_row A). \<exists>x\<in>carrier_vec (dim_col A). A *\<^sub>v x = y}
[PROOF STEP]
have "lincomb (of_int \<circ> f)(set  ?ws) \<in> carrier_vec (dim_row A)" for f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb (of_int \<circ> f) (set (cols A)) \<in> carrier_vec (dim_row A)
[PROOF STEP]
using lincomb_closed A
[PROOF STATE]
proof (prove)
using this:
?S \<subseteq> carrier_vec n \<Longrightarrow> lincomb ?a ?S \<in> carrier_vec n
A \<in> carrier_mat n nc

goal (1 subgoal):
 1. lincomb (of_int \<circ> f) (set (cols A)) \<in> carrier_vec (dim_row A)
[PROOF STEP]
by (metis (full_types) carrier_matD(1) cols_dim lincomb_closed)
[PROOF STATE]
proof (state)
this:
lincomb (of_int \<circ> ?f1) (set (cols A)) \<in> carrier_vec (dim_row A)

goal (1 subgoal):
 1. lattice_of (cols A) = {y \<in> carrier_vec (dim_row A). \<exists>x\<in>carrier_vec (dim_col A). A *\<^sub>v x = y}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
lincomb (of_int \<circ> ?f1) (set (cols A)) \<in> carrier_vec (dim_row A)

goal (1 subgoal):
 1. lattice_of (cols A) = {y \<in> carrier_vec (dim_row A). \<exists>x\<in>carrier_vec (dim_col A). A *\<^sub>v x = y}
[PROOF STEP]
have "\<exists>x\<in>carrier_vec (dim_col A). A *\<^sub>v x = lincomb (of_int \<circ> f) (set (cols A))" for f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x\<in>carrier_vec (dim_col A). A *\<^sub>v x = lincomb (of_int \<circ> f) (set (cols A))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>x\<in>carrier_vec (dim_col A). A *\<^sub>v x = lincomb (of_int \<circ> f) (set (cols A))
[PROOF STEP]
let ?g = "(\<lambda>v. of_int (f v))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>x\<in>carrier_vec (dim_col A). A *\<^sub>v x = lincomb (of_int \<circ> f) (set (cols A))
[PROOF STEP]
let ?g' = "(\<lambda>i. if \<exists>j<i. ?ws ! i = ?ws ! j then 0 else ?g (?ws ! i))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>x\<in>carrier_vec (dim_col A). A *\<^sub>v x = lincomb (of_int \<circ> f) (set (cols A))
[PROOF STEP]
have "lincomb (of_int \<circ> f) (set (cols A)) = lincomb ?g (set ?ws)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb (of_int \<circ> f) (set (cols A)) = lincomb (\<lambda>v. of_int (f v)) (set (cols A))
[PROOF STEP]
unfolding o_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb (\<lambda>x. of_int (f x)) (set (cols A)) = lincomb (\<lambda>v. of_int (f v)) (set (cols A))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lincomb (of_int \<circ> f) (set (cols A)) = lincomb (\<lambda>v. of_int (f v)) (set (cols A))

goal (1 subgoal):
 1. \<exists>x\<in>carrier_vec (dim_col A). A *\<^sub>v x = lincomb (of_int \<circ> f) (set (cols A))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lincomb (of_int \<circ> f) (set (cols A)) = lincomb (\<lambda>v. of_int (f v)) (set (cols A))

goal (1 subgoal):
 1. \<exists>x\<in>carrier_vec (dim_col A). A *\<^sub>v x = lincomb (of_int \<circ> f) (set (cols A))
[PROOF STEP]
have "... = lincomb_list ?g' ?ws"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb (\<lambda>v. of_int (f v)) (set (cols A)) = lincomb_list (\<lambda>i. if \<exists>j<i. cols A ! i = cols A ! j then 0 else of_int (f (cols A ! i))) (cols A)
[PROOF STEP]
by (rule lincomb_as_lincomb_list[OF set_cols_in])
[PROOF STATE]
proof (state)
this:
lincomb (\<lambda>v. of_int (f v)) (set (cols A)) = lincomb_list (\<lambda>i. if \<exists>j<i. cols A ! i = cols A ! j then 0 else of_int (f (cols A ! i))) (cols A)

goal (1 subgoal):
 1. \<exists>x\<in>carrier_vec (dim_col A). A *\<^sub>v x = lincomb (of_int \<circ> f) (set (cols A))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lincomb (\<lambda>v. of_int (f v)) (set (cols A)) = lincomb_list (\<lambda>i. if \<exists>j<i. cols A ! i = cols A ! j then 0 else of_int (f (cols A ! i))) (cols A)

goal (1 subgoal):
 1. \<exists>x\<in>carrier_vec (dim_col A). A *\<^sub>v x = lincomb (of_int \<circ> f) (set (cols A))
[PROOF STEP]
have "... = mat_of_cols n ?ws *\<^sub>v vec (length ?ws) ?g'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb_list (\<lambda>i. if \<exists>j<i. cols A ! i = cols A ! j then 0 else of_int (f (cols A ! i))) (cols A) = mat_of_cols n (cols A) *\<^sub>v vec (length (cols A)) (\<lambda>i. if \<exists>j<i. cols A ! i = cols A ! j then 0 else of_int (f (cols A ! i)))
[PROOF STEP]
by (rule lincomb_list_as_mat_mult, insert set_cols_in A, auto)
[PROOF STATE]
proof (state)
this:
lincomb_list (\<lambda>i. if \<exists>j<i. cols A ! i = cols A ! j then 0 else of_int (f (cols A ! i))) (cols A) = mat_of_cols n (cols A) *\<^sub>v vec (length (cols A)) (\<lambda>i. if \<exists>j<i. cols A ! i = cols A ! j then 0 else of_int (f (cols A ! i)))

goal (1 subgoal):
 1. \<exists>x\<in>carrier_vec (dim_col A). A *\<^sub>v x = lincomb (of_int \<circ> f) (set (cols A))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
lincomb_list (\<lambda>i. if \<exists>j<i. cols A ! i = cols A ! j then 0 else of_int (f (cols A ! i))) (cols A) = mat_of_cols n (cols A) *\<^sub>v vec (length (cols A)) (\<lambda>i. if \<exists>j<i. cols A ! i = cols A ! j then 0 else of_int (f (cols A ! i)))

goal (1 subgoal):
 1. \<exists>x\<in>carrier_vec (dim_col A). A *\<^sub>v x = lincomb (of_int \<circ> f) (set (cols A))
[PROOF STEP]
have "... = A *\<^sub>v (vec (length ?ws) ?g')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_of_cols n (cols A) *\<^sub>v vec (length (cols A)) (\<lambda>i. if \<exists>j<i. cols A ! i = cols A ! j then 0 else of_int (f (cols A ! i))) = A *\<^sub>v vec (length (cols A)) (\<lambda>i. if \<exists>j<i. cols A ! i = cols A ! j then 0 else of_int (f (cols A ! i)))
[PROOF STEP]
using mat_of_cols_cols A
[PROOF STATE]
proof (prove)
using this:
mat_of_cols (dim_row ?A) (cols ?A) = ?A
A \<in> carrier_mat n nc

goal (1 subgoal):
 1. mat_of_cols n (cols A) *\<^sub>v vec (length (cols A)) (\<lambda>i. if \<exists>j<i. cols A ! i = cols A ! j then 0 else of_int (f (cols A ! i))) = A *\<^sub>v vec (length (cols A)) (\<lambda>i. if \<exists>j<i. cols A ! i = cols A ! j then 0 else of_int (f (cols A ! i)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mat_of_cols n (cols A) *\<^sub>v vec (length (cols A)) (\<lambda>i. if \<exists>j<i. cols A ! i = cols A ! j then 0 else of_int (f (cols A ! i))) = A *\<^sub>v vec (length (cols A)) (\<lambda>i. if \<exists>j<i. cols A ! i = cols A ! j then 0 else of_int (f (cols A ! i)))

goal (1 subgoal):
 1. \<exists>x\<in>carrier_vec (dim_col A). A *\<^sub>v x = lincomb (of_int \<circ> f) (set (cols A))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
lincomb (of_int \<circ> f) (set (cols A)) = A *\<^sub>v vec (length (cols A)) (\<lambda>i. if \<exists>j<i. cols A ! i = cols A ! j then 0 else of_int (f (cols A ! i)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
lincomb (of_int \<circ> f) (set (cols A)) = A *\<^sub>v vec (length (cols A)) (\<lambda>i. if \<exists>j<i. cols A ! i = cols A ! j then 0 else of_int (f (cols A ! i)))

goal (1 subgoal):
 1. \<exists>x\<in>carrier_vec (dim_col A). A *\<^sub>v x = lincomb (of_int \<circ> f) (set (cols A))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>x\<in>carrier_vec (dim_col A). A *\<^sub>v x = lincomb (of_int \<circ> f) (set (cols A))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>x\<in>carrier_vec (dim_col A). A *\<^sub>v x = lincomb (of_int \<circ> ?f1) (set (cols A))

goal (1 subgoal):
 1. lattice_of (cols A) = {y \<in> carrier_vec (dim_row A). \<exists>x\<in>carrier_vec (dim_col A). A *\<^sub>v x = y}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<exists>x\<in>carrier_vec (dim_col A). A *\<^sub>v x = lincomb (of_int \<circ> ?f1) (set (cols A))

goal (1 subgoal):
 1. lattice_of (cols A) = {y \<in> carrier_vec (dim_row A). \<exists>x\<in>carrier_vec (dim_col A). A *\<^sub>v x = y}
[PROOF STEP]
have "\<exists>f. A *\<^sub>v x = lincomb (of_int \<circ> f) (set (cols A))"
    if Ax: "A *\<^sub>v x \<in> carrier_vec (dim_row A)" and x: "x \<in> carrier_vec (dim_col A)" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f. A *\<^sub>v x = lincomb (of_int \<circ> f) (set (cols A))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f. A *\<^sub>v x = lincomb (of_int \<circ> f) (set (cols A))
[PROOF STEP]
let ?c = "\<lambda>i. x $ i"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>f. A *\<^sub>v x = lincomb (of_int \<circ> f) (set (cols A))
[PROOF STEP]
have x_vec: "vec (length ?ws) ?c = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec (length (cols A)) (($v) x) = x
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier_vec (dim_col A)

goal (1 subgoal):
 1. vec (length (cols A)) (($v) x) = x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vec (length (cols A)) (($v) x) = x

goal (1 subgoal):
 1. \<exists>f. A *\<^sub>v x = lincomb (of_int \<circ> f) (set (cols A))
[PROOF STEP]
have "A *\<^sub>v x = mat_of_cols n ?ws *\<^sub>v vec (length ?ws) ?c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *\<^sub>v x = mat_of_cols n (cols A) *\<^sub>v vec (length (cols A)) (($v) x)
[PROOF STEP]
using mat_of_cols_cols A x_vec
[PROOF STATE]
proof (prove)
using this:
mat_of_cols (dim_row ?A) (cols ?A) = ?A
A \<in> carrier_mat n nc
vec (length (cols A)) (($v) x) = x

goal (1 subgoal):
 1. A *\<^sub>v x = mat_of_cols n (cols A) *\<^sub>v vec (length (cols A)) (($v) x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A *\<^sub>v x = mat_of_cols n (cols A) *\<^sub>v vec (length (cols A)) (($v) x)

goal (1 subgoal):
 1. \<exists>f. A *\<^sub>v x = lincomb (of_int \<circ> f) (set (cols A))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A *\<^sub>v x = mat_of_cols n (cols A) *\<^sub>v vec (length (cols A)) (($v) x)

goal (1 subgoal):
 1. \<exists>f. A *\<^sub>v x = lincomb (of_int \<circ> f) (set (cols A))
[PROOF STEP]
have "... = lincomb_list ?c ?ws"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_of_cols n (cols A) *\<^sub>v vec (length (cols A)) (($v) x) = lincomb_list (($v) x) (cols A)
[PROOF STEP]
by (rule lincomb_list_as_mat_mult[symmetric], insert set_cols_in A, auto)
[PROOF STATE]
proof (state)
this:
mat_of_cols n (cols A) *\<^sub>v vec (length (cols A)) (($v) x) = lincomb_list (($v) x) (cols A)

goal (1 subgoal):
 1. \<exists>f. A *\<^sub>v x = lincomb (of_int \<circ> f) (set (cols A))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mat_of_cols n (cols A) *\<^sub>v vec (length (cols A)) (($v) x) = lincomb_list (($v) x) (cols A)

goal (1 subgoal):
 1. \<exists>f. A *\<^sub>v x = lincomb (of_int \<circ> f) (set (cols A))
[PROOF STEP]
have "... = lincomb (mk_coeff ?ws ?c) (set ?ws)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lincomb_list (($v) x) (cols A) = lincomb (mk_coeff (cols A) (($v) x)) (set (cols A))
[PROOF STEP]
by (rule lincomb_list_as_lincomb, insert set_cols_in A, auto)
[PROOF STATE]
proof (state)
this:
lincomb_list (($v) x) (cols A) = lincomb (mk_coeff (cols A) (($v) x)) (set (cols A))

goal (1 subgoal):
 1. \<exists>f. A *\<^sub>v x = lincomb (of_int \<circ> f) (set (cols A))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
A *\<^sub>v x = lincomb (mk_coeff (cols A) (($v) x)) (set (cols A))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
A *\<^sub>v x = lincomb (mk_coeff (cols A) (($v) x)) (set (cols A))

goal (1 subgoal):
 1. \<exists>f. A *\<^sub>v x = lincomb (of_int \<circ> f) (set (cols A))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>f. A *\<^sub>v x = lincomb (of_int \<circ> f) (set (cols A))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>A *\<^sub>v ?x1 \<in> carrier_vec (dim_row A); ?x1 \<in> carrier_vec (dim_col A)\<rbrakk> \<Longrightarrow> \<exists>f. A *\<^sub>v ?x1 = lincomb (of_int \<circ> f) (set (cols A))

goal (1 subgoal):
 1. lattice_of (cols A) = {y \<in> carrier_vec (dim_row A). \<exists>x\<in>carrier_vec (dim_col A). A *\<^sub>v x = y}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
lincomb (of_int \<circ> ?f1) (set (cols A)) \<in> carrier_vec (dim_row A)
\<exists>x\<in>carrier_vec (dim_col A). A *\<^sub>v x = lincomb (of_int \<circ> ?f1) (set (cols A))
\<lbrakk>A *\<^sub>v ?x1 \<in> carrier_vec (dim_row A); ?x1 \<in> carrier_vec (dim_col A)\<rbrakk> \<Longrightarrow> \<exists>f. A *\<^sub>v ?x1 = lincomb (of_int \<circ> f) (set (cols A))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
lincomb (of_int \<circ> ?f1) (set (cols A)) \<in> carrier_vec (dim_row A)
\<exists>x\<in>carrier_vec (dim_col A). A *\<^sub>v x = lincomb (of_int \<circ> ?f1) (set (cols A))
\<lbrakk>A *\<^sub>v ?x1 \<in> carrier_vec (dim_row A); ?x1 \<in> carrier_vec (dim_col A)\<rbrakk> \<Longrightarrow> \<exists>f. A *\<^sub>v ?x1 = lincomb (of_int \<circ> f) (set (cols A))

goal (1 subgoal):
 1. lattice_of (cols A) = {y \<in> carrier_vec (dim_row A). \<exists>x\<in>carrier_vec (dim_col A). A *\<^sub>v x = y}
[PROOF STEP]
unfolding lattice_of_altdef_lincomb[OF set_cols_in]
[PROOF STATE]
proof (prove)
using this:
lincomb (of_int \<circ> ?f1) (set (cols A)) \<in> carrier_vec (dim_row A)
\<exists>x\<in>carrier_vec (dim_col A). A *\<^sub>v x = lincomb (of_int \<circ> ?f1) (set (cols A))
\<lbrakk>A *\<^sub>v ?x1 \<in> carrier_vec (dim_row A); ?x1 \<in> carrier_vec (dim_col A)\<rbrakk> \<Longrightarrow> \<exists>f. A *\<^sub>v ?x1 = lincomb (of_int \<circ> f) (set (cols A))

goal (1 subgoal):
 1. {y. \<exists>f. lincomb (of_int \<circ> f) (set (cols A)) = y} = {y \<in> carrier_vec (dim_row A). \<exists>x\<in>carrier_vec (dim_col A). A *\<^sub>v x = y}
[PROOF STEP]
by (metis (mono_tags, opaque_lifting))
[PROOF STATE]
proof (state)
this:
lattice_of (cols A) = {y \<in> carrier_vec (dim_row A). \<exists>x\<in>carrier_vec (dim_col A). A *\<^sub>v x = y}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma minus2_not0: "(-2::'a::ell_field) \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (2::'a) \<noteq> (0::'a)
[PROOF STEP]
using two_not_zero [where 'a='a]
[PROOF STATE]
proof (prove)
using this:
(2::'a) \<noteq> (0::'a)

goal (1 subgoal):
 1. - (2::'a) \<noteq> (0::'a)
[PROOF STEP]
by simp


[STATEMENT]
lemma leq_term_minus_Id: "leq_term - Id = {(x,y). x < y}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. leq_term - Id = {(x, y). x < y}
[PROOF STEP]
using less_trm_well_order
[PROOF STATE]
proof (prove)
using this:
well_order leq_term

goal (1 subgoal):
 1. leq_term - Id = {(x, y). x < y}
[PROOF STEP]
unfolding well_order_on_def linear_order_on_def partial_order_on_def antisym_def less_term_def less_eq_term_def
[PROOF STATE]
proof (prove)
using this:
((preorder_on UNIV leq_term \<and> (\<forall>x y. (x, y) \<in> leq_term \<longrightarrow> (y, x) \<in> leq_term \<longrightarrow> x = y)) \<and> total leq_term) \<and> wf (leq_term - Id)

goal (1 subgoal):
 1. leq_term - Id = {(x, y). strict (in_rel leq_term) x y}
[PROOF STEP]
by auto