[STATEMENT]
lemma set_in_convex_hull:
  assumes "A \<subseteq> carrier_vec n"
  shows "A \<subseteq> convex_hull A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<subseteq> convex_hull A
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> A \<Longrightarrow> x \<in> convex_hull A
[PROOF STEP]
fix a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> A \<Longrightarrow> x \<in> convex_hull A
[PROOF STEP]
assume "a \<in> A"
[PROOF STATE]
proof (state)
this:
a \<in> A

goal (1 subgoal):
 1. \<And>x. x \<in> A \<Longrightarrow> x \<in> convex_hull A
[PROOF STEP]
hence acarr: "a \<in> carrier_vec n"
[PROOF STATE]
proof (prove)
using this:
a \<in> A

goal (1 subgoal):
 1. a \<in> carrier_vec n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a \<in> A
A \<subseteq> carrier_vec n

goal (1 subgoal):
 1. a \<in> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a \<in> carrier_vec n

goal (1 subgoal):
 1. \<And>x. x \<in> A \<Longrightarrow> x \<in> convex_hull A
[PROOF STEP]
hence "convex_lincomb (\<lambda> x. 1) {a} a "
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier_vec n

goal (1 subgoal):
 1. convex_lincomb (\<lambda>x. 1::'a) {a} a
[PROOF STEP]
unfolding convex_lincomb_def
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier_vec n

goal (1 subgoal):
 1. nonneg_lincomb (\<lambda>x. 1::'a) {a} a \<and> (\<Sum>x\<in>{a}. (1::'a)) = (1::'a)
[PROOF STEP]
by (auto simp: nonneg_lincomb_def lincomb_def)
[PROOF STATE]
proof (state)
this:
convex_lincomb (\<lambda>x. 1::'a) {a} a

goal (1 subgoal):
 1. \<And>x. x \<in> A \<Longrightarrow> x \<in> convex_hull A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
convex_lincomb (\<lambda>x. 1::'a) {a} a
[PROOF STEP]
show "a \<in> convex_hull A"
[PROOF STATE]
proof (prove)
using this:
convex_lincomb (\<lambda>x. 1::'a) {a} a

goal (1 subgoal):
 1. a \<in> convex_hull A
[PROOF STEP]
using \<open>a \<in> A\<close>
[PROOF STATE]
proof (prove)
using this:
convex_lincomb (\<lambda>x. 1::'a) {a} a
a \<in> A

goal (1 subgoal):
 1. a \<in> convex_hull A
[PROOF STEP]
unfolding convex_hull_def
[PROOF STATE]
proof (prove)
using this:
convex_lincomb (\<lambda>x. 1::'a) {a} a
a \<in> A

goal (1 subgoal):
 1. a \<in> {x. \<exists>Ws c. finite Ws \<and> Ws \<subseteq> A \<and> convex_lincomb c Ws x}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a \<in> convex_hull A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sort_by_mergesort_rec:
  "sort cmp xs =
    merge (sort cmp (take (length xs div 2) xs))
      (sort cmp (drop (length xs div 2) xs))" (is "_ = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sorting_Algorithms.sort cmp xs = merge (Sorting_Algorithms.sort cmp (take (length xs div 2) xs)) (Sorting_Algorithms.sort cmp (drop (length xs div 2) xs))
[PROOF STEP]
proof (rule sort_eqI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. mset xs = mset (merge (Sorting_Algorithms.sort cmp (take (length xs div 2) xs)) (Sorting_Algorithms.sort cmp (drop (length xs div 2) xs)))
 2. Sorting_Algorithms.sorted cmp (merge (Sorting_Algorithms.sort cmp (take (length xs div 2) xs)) (Sorting_Algorithms.sort cmp (drop (length xs div 2) xs)))
 3. \<And>y. y \<in> set xs \<Longrightarrow> filter (\<lambda>ya. compare cmp y ya = Equiv) xs = filter (\<lambda>ya. compare cmp y ya = Equiv) (merge (Sorting_Algorithms.sort cmp (take (length xs div 2) xs)) (Sorting_Algorithms.sort cmp (drop (length xs div 2) xs)))
[PROOF STEP]
have "mset (take (length xs div 2) xs) + mset (drop (length xs div 2) xs) =
    mset (take (length xs div 2) xs @ drop (length xs div 2) xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (take (length xs div 2) xs) + mset (drop (length xs div 2) xs) = mset (take (length xs div 2) xs @ drop (length xs div 2) xs)
[PROOF STEP]
by (simp only: mset_append)
[PROOF STATE]
proof (state)
this:
mset (take (length xs div 2) xs) + mset (drop (length xs div 2) xs) = mset (take (length xs div 2) xs @ drop (length xs div 2) xs)

goal (3 subgoals):
 1. mset xs = mset (merge (Sorting_Algorithms.sort cmp (take (length xs div 2) xs)) (Sorting_Algorithms.sort cmp (drop (length xs div 2) xs)))
 2. Sorting_Algorithms.sorted cmp (merge (Sorting_Algorithms.sort cmp (take (length xs div 2) xs)) (Sorting_Algorithms.sort cmp (drop (length xs div 2) xs)))
 3. \<And>y. y \<in> set xs \<Longrightarrow> filter (\<lambda>ya. compare cmp y ya = Equiv) xs = filter (\<lambda>ya. compare cmp y ya = Equiv) (merge (Sorting_Algorithms.sort cmp (take (length xs div 2) xs)) (Sorting_Algorithms.sort cmp (drop (length xs div 2) xs)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
mset (take (length xs div 2) xs) + mset (drop (length xs div 2) xs) = mset (take (length xs div 2) xs @ drop (length xs div 2) xs)
[PROOF STEP]
show "mset xs = mset ?rhs"
[PROOF STATE]
proof (prove)
using this:
mset (take (length xs div 2) xs) + mset (drop (length xs div 2) xs) = mset (take (length xs div 2) xs @ drop (length xs div 2) xs)

goal (1 subgoal):
 1. mset xs = mset (merge (Sorting_Algorithms.sort cmp (take (length xs div 2) xs)) (Sorting_Algorithms.sort cmp (drop (length xs div 2) xs)))
[PROOF STEP]
by (simp add: mset_merge)
[PROOF STATE]
proof (state)
this:
mset xs = mset (merge (Sorting_Algorithms.sort cmp (take (length xs div 2) xs)) (Sorting_Algorithms.sort cmp (drop (length xs div 2) xs)))

goal (2 subgoals):
 1. Sorting_Algorithms.sorted cmp (merge (Sorting_Algorithms.sort cmp (take (length xs div 2) xs)) (Sorting_Algorithms.sort cmp (drop (length xs div 2) xs)))
 2. \<And>y. y \<in> set xs \<Longrightarrow> filter (\<lambda>ya. compare cmp y ya = Equiv) xs = filter (\<lambda>ya. compare cmp y ya = Equiv) (merge (Sorting_Algorithms.sort cmp (take (length xs div 2) xs)) (Sorting_Algorithms.sort cmp (drop (length xs div 2) xs)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Sorting_Algorithms.sorted cmp (merge (Sorting_Algorithms.sort cmp (take (length xs div 2) xs)) (Sorting_Algorithms.sort cmp (drop (length xs div 2) xs)))
 2. \<And>y. y \<in> set xs \<Longrightarrow> filter (\<lambda>ya. compare cmp y ya = Equiv) xs = filter (\<lambda>ya. compare cmp y ya = Equiv) (merge (Sorting_Algorithms.sort cmp (take (length xs div 2) xs)) (Sorting_Algorithms.sort cmp (drop (length xs div 2) xs)))
[PROOF STEP]
show "sorted cmp ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sorting_Algorithms.sorted cmp (merge (Sorting_Algorithms.sort cmp (take (length xs div 2) xs)) (Sorting_Algorithms.sort cmp (drop (length xs div 2) xs)))
[PROOF STEP]
by (simp add: sorted_merge)
[PROOF STATE]
proof (state)
this:
Sorting_Algorithms.sorted cmp (merge (Sorting_Algorithms.sort cmp (take (length xs div 2) xs)) (Sorting_Algorithms.sort cmp (drop (length xs div 2) xs)))

goal (1 subgoal):
 1. \<And>y. y \<in> set xs \<Longrightarrow> filter (\<lambda>ya. compare cmp y ya = Equiv) xs = filter (\<lambda>ya. compare cmp y ya = Equiv) (merge (Sorting_Algorithms.sort cmp (take (length xs div 2) xs)) (Sorting_Algorithms.sort cmp (drop (length xs div 2) xs)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. y \<in> set xs \<Longrightarrow> filter (\<lambda>ya. compare cmp y ya = Equiv) xs = filter (\<lambda>ya. compare cmp y ya = Equiv) (merge (Sorting_Algorithms.sort cmp (take (length xs div 2) xs)) (Sorting_Algorithms.sort cmp (drop (length xs div 2) xs)))
[PROOF STEP]
fix l
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. y \<in> set xs \<Longrightarrow> filter (\<lambda>ya. compare cmp y ya = Equiv) xs = filter (\<lambda>ya. compare cmp y ya = Equiv) (merge (Sorting_Algorithms.sort cmp (take (length xs div 2) xs)) (Sorting_Algorithms.sort cmp (drop (length xs div 2) xs)))
[PROOF STEP]
have "stable_segment cmp l (take (length xs div 2) xs) @ stable_segment cmp l (drop (length xs div 2) xs)
    = stable_segment cmp l xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filter (\<lambda>y. compare cmp l y = Equiv) (take (length xs div 2) xs) @ filter (\<lambda>y. compare cmp l y = Equiv) (drop (length xs div 2) xs) = filter (\<lambda>y. compare cmp l y = Equiv) xs
[PROOF STEP]
by (simp only: filter_append [symmetric] append_take_drop_id)
[PROOF STATE]
proof (state)
this:
filter (\<lambda>y. compare cmp l y = Equiv) (take (length xs div 2) xs) @ filter (\<lambda>y. compare cmp l y = Equiv) (drop (length xs div 2) xs) = filter (\<lambda>y. compare cmp l y = Equiv) xs

goal (1 subgoal):
 1. \<And>y. y \<in> set xs \<Longrightarrow> filter (\<lambda>ya. compare cmp y ya = Equiv) xs = filter (\<lambda>ya. compare cmp y ya = Equiv) (merge (Sorting_Algorithms.sort cmp (take (length xs div 2) xs)) (Sorting_Algorithms.sort cmp (drop (length xs div 2) xs)))
[PROOF STEP]
have "merge (stable_segment cmp l (take (length xs div 2) xs))
    (stable_segment cmp l (drop (length xs div 2) xs)) =
    stable_segment cmp l (take (length xs div 2) xs) @ stable_segment cmp l (drop (length xs div 2) xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. merge (filter (\<lambda>y. compare cmp l y = Equiv) (take (length xs div 2) xs)) (filter (\<lambda>y. compare cmp l y = Equiv) (drop (length xs div 2) xs)) = filter (\<lambda>y. compare cmp l y = Equiv) (take (length xs div 2) xs) @ filter (\<lambda>y. compare cmp l y = Equiv) (drop (length xs div 2) xs)
[PROOF STEP]
by (rule merge_eq_appendI) (auto simp add: compare.trans_equiv_greater)
[PROOF STATE]
proof (state)
this:
merge (filter (\<lambda>y. compare cmp l y = Equiv) (take (length xs div 2) xs)) (filter (\<lambda>y. compare cmp l y = Equiv) (drop (length xs div 2) xs)) = filter (\<lambda>y. compare cmp l y = Equiv) (take (length xs div 2) xs) @ filter (\<lambda>y. compare cmp l y = Equiv) (drop (length xs div 2) xs)

goal (1 subgoal):
 1. \<And>y. y \<in> set xs \<Longrightarrow> filter (\<lambda>ya. compare cmp y ya = Equiv) xs = filter (\<lambda>ya. compare cmp y ya = Equiv) (merge (Sorting_Algorithms.sort cmp (take (length xs div 2) xs)) (Sorting_Algorithms.sort cmp (drop (length xs div 2) xs)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
merge (filter (\<lambda>y. compare cmp l y = Equiv) (take (length xs div 2) xs)) (filter (\<lambda>y. compare cmp l y = Equiv) (drop (length xs div 2) xs)) = filter (\<lambda>y. compare cmp l y = Equiv) (take (length xs div 2) xs) @ filter (\<lambda>y. compare cmp l y = Equiv) (drop (length xs div 2) xs)

goal (1 subgoal):
 1. \<And>y. y \<in> set xs \<Longrightarrow> filter (\<lambda>ya. compare cmp y ya = Equiv) xs = filter (\<lambda>ya. compare cmp y ya = Equiv) (merge (Sorting_Algorithms.sort cmp (take (length xs div 2) xs)) (Sorting_Algorithms.sort cmp (drop (length xs div 2) xs)))
[PROOF STEP]
have "\<dots> = stable_segment cmp l xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filter (\<lambda>y. compare cmp l y = Equiv) (take (length xs div 2) xs) @ filter (\<lambda>y. compare cmp l y = Equiv) (drop (length xs div 2) xs) = filter (\<lambda>y. compare cmp l y = Equiv) xs
[PROOF STEP]
by (simp only: filter_append [symmetric] append_take_drop_id)
[PROOF STATE]
proof (state)
this:
filter (\<lambda>y. compare cmp l y = Equiv) (take (length xs div 2) xs) @ filter (\<lambda>y. compare cmp l y = Equiv) (drop (length xs div 2) xs) = filter (\<lambda>y. compare cmp l y = Equiv) xs

goal (1 subgoal):
 1. \<And>y. y \<in> set xs \<Longrightarrow> filter (\<lambda>ya. compare cmp y ya = Equiv) xs = filter (\<lambda>ya. compare cmp y ya = Equiv) (merge (Sorting_Algorithms.sort cmp (take (length xs div 2) xs)) (Sorting_Algorithms.sort cmp (drop (length xs div 2) xs)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
merge (filter (\<lambda>y. compare cmp l y = Equiv) (take (length xs div 2) xs)) (filter (\<lambda>y. compare cmp l y = Equiv) (drop (length xs div 2) xs)) = filter (\<lambda>y. compare cmp l y = Equiv) xs
[PROOF STEP]
show "stable_segment cmp l xs = stable_segment cmp l ?rhs"
[PROOF STATE]
proof (prove)
using this:
merge (filter (\<lambda>y. compare cmp l y = Equiv) (take (length xs div 2) xs)) (filter (\<lambda>y. compare cmp l y = Equiv) (drop (length xs div 2) xs)) = filter (\<lambda>y. compare cmp l y = Equiv) xs

goal (1 subgoal):
 1. filter (\<lambda>y. compare cmp l y = Equiv) xs = filter (\<lambda>y. compare cmp l y = Equiv) (merge (Sorting_Algorithms.sort cmp (take (length xs div 2) xs)) (Sorting_Algorithms.sort cmp (drop (length xs div 2) xs)))
[PROOF STEP]
by (simp add: stable_sort filter_merge)
[PROOF STATE]
proof (state)
this:
filter (\<lambda>y. compare cmp l y = Equiv) xs = filter (\<lambda>y. compare cmp l y = Equiv) (merge (Sorting_Algorithms.sort cmp (take (length xs div 2) xs)) (Sorting_Algorithms.sort cmp (drop (length xs div 2) xs)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma artanh_real_has_field_derivative [derivative_intros]:
  "(artanh has_field_derivative (1 / (1 - x ^ 2))) (at x within A)" if
    "\<bar>x\<bar> < 1" for x :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (artanh has_real_derivative 1 / (1 - x\<^sup>2)) (at x within A)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (artanh has_real_derivative 1 / (1 - x\<^sup>2)) (at x within A)
[PROOF STEP]
from that
[PROOF STATE]
proof (chain)
picking this:
\<bar>x\<bar> < 1
[PROOF STEP]
have "- 1 < x" "x < 1"
[PROOF STATE]
proof (prove)
using this:
\<bar>x\<bar> < 1

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

goal (1 subgoal):
 1. (artanh has_real_derivative 1 / (1 - x\<^sup>2)) (at x within A)
[PROOF STEP]
hence "(artanh has_field_derivative (4 - 4 * x) / ((1 + x) * (1 - x) * (1 - x) * 4))
           (at x within A)"
[PROOF STATE]
proof (prove)
using this:
- 1 < x
x < 1

goal (1 subgoal):
 1. (artanh has_real_derivative (4 - 4 * x) / ((1 + x) * (1 - x) * (1 - x) * 4)) (at x within A)
[PROOF STEP]
unfolding artanh_def [abs_def]
[PROOF STATE]
proof (prove)
using this:
- 1 < x
x < 1

goal (1 subgoal):
 1. ((\<lambda>x. ln ((1 + x) / (1 - x)) / 2) has_real_derivative (4 - 4 * x) / ((1 + x) * (1 - x) * (1 - x) * 4)) (at x within A)
[PROOF STEP]
by (auto intro!: derivative_eq_intros simp: powr_minus powr_half_sqrt)
[PROOF STATE]
proof (state)
this:
(artanh has_real_derivative (4 - 4 * x) / ((1 + x) * (1 - x) * (1 - x) * 4)) (at x within A)

goal (1 subgoal):
 1. (artanh has_real_derivative 1 / (1 - x\<^sup>2)) (at x within A)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(artanh has_real_derivative (4 - 4 * x) / ((1 + x) * (1 - x) * (1 - x) * 4)) (at x within A)

goal (1 subgoal):
 1. (artanh has_real_derivative 1 / (1 - x\<^sup>2)) (at x within A)
[PROOF STEP]
have "(4 - 4 * x) / ((1 + x) * (1 - x) * (1 - x) * 4) = 1 / ((1 + x) * (1 - x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (4 - 4 * x) / ((1 + x) * (1 - x) * (1 - x) * 4) = 1 / ((1 + x) * (1 - x))
[PROOF STEP]
using \<open>-1 < x\<close> \<open>x < 1\<close>
[PROOF STATE]
proof (prove)
using this:
- 1 < x
x < 1

goal (1 subgoal):
 1. (4 - 4 * x) / ((1 + x) * (1 - x) * (1 - x) * 4) = 1 / ((1 + x) * (1 - x))
[PROOF STEP]
by (simp add: frac_eq_eq)
[PROOF STATE]
proof (state)
this:
(4 - 4 * x) / ((1 + x) * (1 - x) * (1 - x) * 4) = 1 / ((1 + x) * (1 - x))

goal (1 subgoal):
 1. (artanh has_real_derivative 1 / (1 - x\<^sup>2)) (at x within A)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(4 - 4 * x) / ((1 + x) * (1 - x) * (1 - x) * 4) = 1 / ((1 + x) * (1 - x))

goal (1 subgoal):
 1. (artanh has_real_derivative 1 / (1 - x\<^sup>2)) (at x within A)
[PROOF STEP]
have "(1 + x) * (1 - x) = 1 - x ^ 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 + x) * (1 - x) = 1 - x\<^sup>2
[PROOF STEP]
by (simp add: algebra_simps power2_eq_square)
[PROOF STATE]
proof (state)
this:
(1 + x) * (1 - x) = 1 - x\<^sup>2

goal (1 subgoal):
 1. (artanh has_real_derivative 1 / (1 - x\<^sup>2)) (at x within A)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(artanh has_real_derivative 1 / (1 - x\<^sup>2)) (at x within A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(artanh has_real_derivative 1 / (1 - x\<^sup>2)) (at x within A)

goal (1 subgoal):
 1. (artanh has_real_derivative 1 / (1 - x\<^sup>2)) (at x within A)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(artanh has_real_derivative 1 / (1 - x\<^sup>2)) (at x within A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma assoc'_o_assoc[simp]: \<open>assoc' o assoc = id\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. assoc' \<circ> assoc = id
[PROOF STEP]
apply (rule tensor_extensionality3')
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. register (assoc' \<circ> assoc)
 2. register id
 3. \<And>f g h. (assoc' \<circ> assoc) ((f \<otimes>\<^sub>u g) \<otimes>\<^sub>u h) = id ((f \<otimes>\<^sub>u g) \<otimes>\<^sub>u h)
[PROOF STEP]
by auto


[STATEMENT]
lemma gcd_abs_mult_left_int [simp]:
  "gcd x (a * \<bar>y\<bar>) = gcd x (a * y)" for x y a :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd x (a * \<bar>y\<bar>) = gcd x (a * y)
[PROOF STEP]
using gcd_abs2_int [of _ "a * \<bar>y\<bar>"] gcd_abs2_int [of _ "a * y"]
[PROOF STATE]
proof (prove)
using this:
gcd ?x \<bar>a * \<bar>y\<bar>\<bar> = gcd ?x (a * \<bar>y\<bar>)
gcd ?x \<bar>a * y\<bar> = gcd ?x (a * y)

goal (1 subgoal):
 1. gcd x (a * \<bar>y\<bar>) = gcd x (a * y)
[PROOF STEP]
by (simp add: abs_mult)


[STATEMENT]
lemma idx_spec: "fP xs \<longleftrightarrow> (\<forall>i<length xs - 1. P (xs!i) (xs!Suc i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fP xs = (\<forall>i<length xs - 1. P (xs ! i) (xs ! Suc i))
[PROOF STEP]
apply (induction xs rule: ii_induction.induct)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. fP [] = (\<forall>i<length [] - 1. P ([] ! i) ([] ! Suc i))
 2. \<And>uu_. fP [uu_] = (\<forall>i<length [uu_] - 1. P ([uu_] ! i) ([uu_] ! Suc i))
 3. \<And>uv_ y xs. fP (y # xs) = (\<forall>i<length (y # xs) - 1. P ((y # xs) ! i) ((y # xs) ! Suc i)) \<Longrightarrow> fP (uv_ # y # xs) = (\<forall>i<length (uv_ # y # xs) - 1. P ((uv_ # y # xs) ! i) ((uv_ # y # xs) ! Suc i))
[PROOF STEP]
using less_Suc_eq_0_disj
[PROOF STATE]
proof (prove)
using this:
(?m < Suc ?n) = (?m = 0 \<or> (\<exists>j. ?m = Suc j \<and> j < ?n))

goal (3 subgoals):
 1. fP [] = (\<forall>i<length [] - 1. P ([] ! i) ([] ! Suc i))
 2. \<And>uu_. fP [uu_] = (\<forall>i<length [uu_] - 1. P ([uu_] ! i) ([uu_] ! Suc i))
 3. \<And>uv_ y xs. fP (y # xs) = (\<forall>i<length (y # xs) - 1. P ((y # xs) ! i) ((y # xs) ! Suc i)) \<Longrightarrow> fP (uv_ # y # xs) = (\<forall>i<length (uv_ # y # xs) - 1. P ((uv_ # y # xs) ! i) ((uv_ # y # xs) ! Suc i))
[PROOF STEP]
by auto


[STATEMENT]
lemma valid_path_valid_swap:
  assumes "valid_path (\<lambda>x::real. ((f x)::real, (g x)::real))"
  shows "valid_path (prod.swap o (\<lambda>x. (f x, g x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valid_path (prod.swap \<circ> (\<lambda>x. (f x, g x)))
[PROOF STEP]
unfolding o_def valid_path_def piecewise_C1_differentiable_on_def swap_simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {0..1} (\<lambda>x. (g x, f x)) \<and> (\<exists>S. finite S \<and> (\<lambda>x. (g x, f x)) C1_differentiable_on {0..1} - S)
[PROOF STEP]
proof (intro conjI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. continuous_on {0..1} (\<lambda>x. (g x, f x))
 2. \<exists>S. finite S \<and> (\<lambda>x. (g x, f x)) C1_differentiable_on {0..1} - S
[PROOF STEP]
show "continuous_on {0..1} (\<lambda>x. (g x, f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {0..1} (\<lambda>x. (g x, f x))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
valid_path (\<lambda>x. (f x, g x))

goal (1 subgoal):
 1. continuous_on {0..1} (\<lambda>x. (g x, f x))
[PROOF STEP]
using continuous_on_Pair continuous_on_componentwise[where f = "(\<lambda>x. (f x, g x))"]
[PROOF STATE]
proof (prove)
using this:
valid_path (\<lambda>x. (f x, g x))
\<lbrakk>continuous_on ?s ?f; continuous_on ?s ?g\<rbrakk> \<Longrightarrow> continuous_on ?s (\<lambda>x. (?f x, ?g x))
continuous_on ?S (\<lambda>x. (f x, g x)) = (\<forall>i\<in>Basis. continuous_on ?S (\<lambda>x. (f x, g x) \<bullet> i))

goal (1 subgoal):
 1. continuous_on {0..1} (\<lambda>x. (g x, f x))
[PROOF STEP]
by (auto simp add: real_pair_basis valid_path_def piecewise_C1_differentiable_on_def)
[PROOF STATE]
proof (state)
this:
continuous_on {0..1} (\<lambda>x. (g x, f x))

goal (1 subgoal):
 1. \<exists>S. finite S \<and> (\<lambda>x. (g x, f x)) C1_differentiable_on {0..1} - S
[PROOF STEP]
show "\<exists>S. finite S \<and> (\<lambda>x. (g x, f x)) C1_differentiable_on {0..1} - S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>S. finite S \<and> (\<lambda>x. (g x, f x)) C1_differentiable_on {0..1} - S
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>S. finite S \<and> (\<lambda>x. (g x, f x)) C1_differentiable_on {0..1} - S
[PROOF STEP]
obtain S where "finite S" and S: "(\<lambda>x. (f x, g x)) C1_differentiable_on {0..1} - S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>S. \<lbrakk>finite S; (\<lambda>x. (f x, g x)) C1_differentiable_on {0..1} - S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
valid_path (\<lambda>x. (f x, g x))

goal (1 subgoal):
 1. (\<And>S. \<lbrakk>finite S; (\<lambda>x. (f x, g x)) C1_differentiable_on {0..1} - S\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp add: real_pair_basis valid_path_def piecewise_C1_differentiable_on_def)
[PROOF STATE]
proof (state)
this:
finite S
(\<lambda>x. (f x, g x)) C1_differentiable_on {0..1} - S

goal (1 subgoal):
 1. \<exists>S. finite S \<and> (\<lambda>x. (g x, f x)) C1_differentiable_on {0..1} - S
[PROOF STEP]
have 0: "f C1_differentiable_on {0..1} - S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f C1_differentiable_on {0..1} - S
[PROOF STEP]
using S assms
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. (f x, g x)) C1_differentiable_on {0..1} - S
valid_path (\<lambda>x. (f x, g x))

goal (1 subgoal):
 1. f C1_differentiable_on {0..1} - S
[PROOF STEP]
using C1_diff_components_2[of "(1,0)" "(\<lambda>x. (f x, g x))"]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. (f x, g x)) C1_differentiable_on {0..1} - S
valid_path (\<lambda>x. (f x, g x))
\<lbrakk>(1, 0) \<in> Basis; (\<lambda>x. (f x, g x)) C1_differentiable_on ?s\<rbrakk> \<Longrightarrow> (\<lambda>x. (f x, g x) \<bullet> (1, 0)) C1_differentiable_on ?s

goal (1 subgoal):
 1. f C1_differentiable_on {0..1} - S
[PROOF STEP]
by (auto simp add: real_pair_basis algebra_simps)
[PROOF STATE]
proof (state)
this:
f C1_differentiable_on {0..1} - S

goal (1 subgoal):
 1. \<exists>S. finite S \<and> (\<lambda>x. (g x, f x)) C1_differentiable_on {0..1} - S
[PROOF STEP]
have 1: "g C1_differentiable_on {0..1} - S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g C1_differentiable_on {0..1} - S
[PROOF STEP]
using S assms
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. (f x, g x)) C1_differentiable_on {0..1} - S
valid_path (\<lambda>x. (f x, g x))

goal (1 subgoal):
 1. g C1_differentiable_on {0..1} - S
[PROOF STEP]
using C1_diff_components_2 [of "(0,1)", OF _ S] real_pair_basis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. (f x, g x)) C1_differentiable_on {0..1} - S
valid_path (\<lambda>x. (f x, g x))
(0, 1) \<in> Basis \<Longrightarrow> (\<lambda>x. (f x, g x) \<bullet> (0, 1)) C1_differentiable_on {0..1} - S
Basis = {(1, 0), (0, 1)}

goal (1 subgoal):
 1. g C1_differentiable_on {0..1} - S
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
g C1_differentiable_on {0..1} - S

goal (1 subgoal):
 1. \<exists>S. finite S \<and> (\<lambda>x. (g x, f x)) C1_differentiable_on {0..1} - S
[PROOF STEP]
have *: "(\<lambda>x. (g x, f x)) C1_differentiable_on {0..1} - S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. (g x, f x)) C1_differentiable_on {0..1} - S
[PROOF STEP]
using 0 1 C1_differentiable_on_components[where f = "(\<lambda>x. (g x, f x))"]
[PROOF STATE]
proof (prove)
using this:
f C1_differentiable_on {0..1} - S
g C1_differentiable_on {0..1} - S
(\<And>i. i \<in> Basis \<Longrightarrow> (\<lambda>x. (g x, f x) \<bullet> i) C1_differentiable_on ?s) \<Longrightarrow> (\<lambda>x. (g x, f x)) C1_differentiable_on ?s

goal (1 subgoal):
 1. (\<lambda>x. (g x, f x)) C1_differentiable_on {0..1} - S
[PROOF STEP]
by (auto simp add: real_pair_basis valid_path_def piecewise_C1_differentiable_on_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. (g x, f x)) C1_differentiable_on {0..1} - S

goal (1 subgoal):
 1. \<exists>S. finite S \<and> (\<lambda>x. (g x, f x)) C1_differentiable_on {0..1} - S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. (g x, f x)) C1_differentiable_on {0..1} - S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. (g x, f x)) C1_differentiable_on {0..1} - S

goal (1 subgoal):
 1. \<exists>S. finite S \<and> (\<lambda>x. (g x, f x)) C1_differentiable_on {0..1} - S
[PROOF STEP]
using \<open>finite S\<close>
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. (g x, f x)) C1_differentiable_on {0..1} - S
finite S

goal (1 subgoal):
 1. \<exists>S. finite S \<and> (\<lambda>x. (g x, f x)) C1_differentiable_on {0..1} - S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>S. finite S \<and> (\<lambda>x. (g x, f x)) C1_differentiable_on {0..1} - S

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>S. finite S \<and> (\<lambda>x. (g x, f x)) C1_differentiable_on {0..1} - S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma scount_eq_0I: "alw (not P) \<omega> \<Longrightarrow> scount P \<omega> = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. alw (\<lambda>xs. \<not> P xs) \<omega> \<Longrightarrow> scount P \<omega> = 0
[PROOF STEP]
by (induct arbitrary: \<omega> rule: scount.fixp_induct)
     (auto simp: bot_enat_def intro!: admissible_all admissible_imp admissible_eq_mcontI mcont_const)


[STATEMENT]
lemma eq_inf_transp[intro, trans]:
      assumes "w\<^sub>1 =\<^sub>I w\<^sub>2" "w\<^sub>2 =\<^sub>I w\<^sub>3"
      shows "w\<^sub>1 =\<^sub>I w\<^sub>3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w\<^sub>1 =\<^sub>I w\<^sub>3
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
w\<^sub>1 =\<^sub>I w\<^sub>2
w\<^sub>2 =\<^sub>I w\<^sub>3

goal (1 subgoal):
 1. w\<^sub>1 =\<^sub>I w\<^sub>3
[PROOF STEP]
by blast


[STATEMENT]
lemma Q_mat_def: "Q_mat d = mat 1 - l *\<^sub>R P_lower d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Q_mat d = mat 1 - l *\<^sub>R P_lower d
[PROOF STEP]
unfolding Q_GS_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. blinfun_to_matrix (id_blinfun - l *\<^sub>R \<P>\<^sub>L d) = mat 1 - l *\<^sub>R P_lower d
[PROOF STEP]
by (simp add: \<P>\<^sub>L_def blinfun_to_matrix_diff blinfun_to_matrix_id blinfun_to_matrix_scaleR)


[STATEMENT]
lemma Cauchy_product_sums:
  fixes a b :: "nat \<Rightarrow> 'a::{real_normed_algebra,banach}"
  assumes a: "summable (\<lambda>k. norm (a k))"
    and b: "summable (\<lambda>k. norm (b k))"
  shows "(\<lambda>k. \<Sum>i\<le>k. a i * b (k - i)) sums ((\<Sum>k. a k) * (\<Sum>k. b k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>k. \<Sum>i\<le>k. a i * b (k - i)) sums ((\<Sum>k. a k) * (\<Sum>k. b k))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>k. \<Sum>i\<le>k. a i * b (k - i)) sums ((\<Sum>k. a k) * (\<Sum>k. b k))
[PROOF STEP]
let ?S1 = "\<lambda>n::nat. {..<n} \<times> {..<n}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>k. \<Sum>i\<le>k. a i * b (k - i)) sums ((\<Sum>k. a k) * (\<Sum>k. b k))
[PROOF STEP]
let ?S2 = "\<lambda>n::nat. {(i,j). i + j < n}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>k. \<Sum>i\<le>k. a i * b (k - i)) sums ((\<Sum>k. a k) * (\<Sum>k. b k))
[PROOF STEP]
have S1_mono: "\<And>m n. m \<le> n \<Longrightarrow> ?S1 m \<subseteq> ?S1 n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m n. m \<le> n \<Longrightarrow> {..<m} \<times> {..<m} \<subseteq> {..<n} \<times> {..<n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?m \<le> ?n \<Longrightarrow> {..<?m} \<times> {..<?m} \<subseteq> {..<?n} \<times> {..<?n}

goal (1 subgoal):
 1. (\<lambda>k. \<Sum>i\<le>k. a i * b (k - i)) sums ((\<Sum>k. a k) * (\<Sum>k. b k))
[PROOF STEP]
have S2_le_S1: "\<And>n. ?S2 n \<subseteq> ?S1 n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. {(i, j). i + j < n} \<subseteq> {..<n} \<times> {..<n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{(i, j). i + j < ?n} \<subseteq> {..<?n} \<times> {..<?n}

goal (1 subgoal):
 1. (\<lambda>k. \<Sum>i\<le>k. a i * b (k - i)) sums ((\<Sum>k. a k) * (\<Sum>k. b k))
[PROOF STEP]
have S1_le_S2: "\<And>n. ?S1 (n div 2) \<subseteq> ?S2 n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. {..<n div 2} \<times> {..<n div 2} \<subseteq> {(i, j). i + j < n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{..<?n div 2} \<times> {..<?n div 2} \<subseteq> {(i, j). i + j < ?n}

goal (1 subgoal):
 1. (\<lambda>k. \<Sum>i\<le>k. a i * b (k - i)) sums ((\<Sum>k. a k) * (\<Sum>k. b k))
[PROOF STEP]
have finite_S1: "\<And>n. finite (?S1 n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. finite ({..<n} \<times> {..<n})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite ({..<?n} \<times> {..<?n})

goal (1 subgoal):
 1. (\<lambda>k. \<Sum>i\<le>k. a i * b (k - i)) sums ((\<Sum>k. a k) * (\<Sum>k. b k))
[PROOF STEP]
with S2_le_S1
[PROOF STATE]
proof (chain)
picking this:
{(i, j). i + j < ?n} \<subseteq> {..<?n} \<times> {..<?n}
finite ({..<?n} \<times> {..<?n})
[PROOF STEP]
have finite_S2: "\<And>n. finite (?S2 n)"
[PROOF STATE]
proof (prove)
using this:
{(i, j). i + j < ?n} \<subseteq> {..<?n} \<times> {..<?n}
finite ({..<?n} \<times> {..<?n})

goal (1 subgoal):
 1. \<And>n. finite {(i, j). i + j < n}
[PROOF STEP]
by (rule finite_subset)
[PROOF STATE]
proof (state)
this:
finite {(i, j). i + j < ?n}

goal (1 subgoal):
 1. (\<lambda>k. \<Sum>i\<le>k. a i * b (k - i)) sums ((\<Sum>k. a k) * (\<Sum>k. b k))
[PROOF STEP]
let ?g = "\<lambda>(i,j). a i * b j"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>k. \<Sum>i\<le>k. a i * b (k - i)) sums ((\<Sum>k. a k) * (\<Sum>k. b k))
[PROOF STEP]
let ?f = "\<lambda>(i,j). norm (a i) * norm (b j)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>k. \<Sum>i\<le>k. a i * b (k - i)) sums ((\<Sum>k. a k) * (\<Sum>k. b k))
[PROOF STEP]
have f_nonneg: "\<And>x. 0 \<le> ?f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. 0 \<le> (case x of (i, j) \<Rightarrow> norm (a i) * norm (b j))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> (case ?x of (i, j) \<Rightarrow> norm (a i) * norm (b j))

goal (1 subgoal):
 1. (\<lambda>k. \<Sum>i\<le>k. a i * b (k - i)) sums ((\<Sum>k. a k) * (\<Sum>k. b k))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 \<le> (case ?x of (i, j) \<Rightarrow> norm (a i) * norm (b j))
[PROOF STEP]
have norm_sum_f: "\<And>A. norm (sum ?f A) = sum ?f A"
[PROOF STATE]
proof (prove)
using this:
0 \<le> (case ?x of (i, j) \<Rightarrow> norm (a i) * norm (b j))

goal (1 subgoal):
 1. \<And>A. norm (\<Sum>(i, j)\<in>A. norm (a i) * norm (b j)) = (\<Sum>(i, j)\<in>A. norm (a i) * norm (b j))
[PROOF STEP]
unfolding real_norm_def
[PROOF STATE]
proof (prove)
using this:
0 \<le> (case ?x of (i, j) \<Rightarrow> norm (a i) * norm (b j))

goal (1 subgoal):
 1. \<And>A. \<bar>\<Sum>(i, j)\<in>A. norm (a i) * norm (b j)\<bar> = (\<Sum>(i, j)\<in>A. norm (a i) * norm (b j))
[PROOF STEP]
by (simp only: abs_of_nonneg sum_nonneg [rule_format])
[PROOF STATE]
proof (state)
this:
norm (\<Sum>(i, j)\<in>?A. norm (a i) * norm (b j)) = (\<Sum>(i, j)\<in>?A. norm (a i) * norm (b j))

goal (1 subgoal):
 1. (\<lambda>k. \<Sum>i\<le>k. a i * b (k - i)) sums ((\<Sum>k. a k) * (\<Sum>k. b k))
[PROOF STEP]
have "(\<lambda>n. (\<Sum>k<n. a k) * (\<Sum>k<n. b k)) \<longlonglongrightarrow> (\<Sum>k. a k) * (\<Sum>k. b k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. sum a {..<n} * sum b {..<n}) \<longlonglongrightarrow> (\<Sum>k. a k) * (\<Sum>k. b k)
[PROOF STEP]
by (intro tendsto_mult summable_LIMSEQ summable_norm_cancel [OF a] summable_norm_cancel [OF b])
[PROOF STATE]
proof (state)
this:
(\<lambda>n. sum a {..<n} * sum b {..<n}) \<longlonglongrightarrow> (\<Sum>k. a k) * (\<Sum>k. b k)

goal (1 subgoal):
 1. (\<lambda>k. \<Sum>i\<le>k. a i * b (k - i)) sums ((\<Sum>k. a k) * (\<Sum>k. b k))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. sum a {..<n} * sum b {..<n}) \<longlonglongrightarrow> (\<Sum>k. a k) * (\<Sum>k. b k)
[PROOF STEP]
have 1: "(\<lambda>n. sum ?g (?S1 n)) \<longlonglongrightarrow> (\<Sum>k. a k) * (\<Sum>k. b k)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. sum a {..<n} * sum b {..<n}) \<longlonglongrightarrow> (\<Sum>k. a k) * (\<Sum>k. b k)

goal (1 subgoal):
 1. (\<lambda>n. \<Sum>(i, j)\<in>{..<n} \<times> {..<n}. a i * b j) \<longlonglongrightarrow> (\<Sum>k. a k) * (\<Sum>k. b k)
[PROOF STEP]
by (simp only: sum_product sum.Sigma [rule_format] finite_lessThan)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. \<Sum>(i, j)\<in>{..<n} \<times> {..<n}. a i * b j) \<longlonglongrightarrow> (\<Sum>k. a k) * (\<Sum>k. b k)

goal (1 subgoal):
 1. (\<lambda>k. \<Sum>i\<le>k. a i * b (k - i)) sums ((\<Sum>k. a k) * (\<Sum>k. b k))
[PROOF STEP]
have "(\<lambda>n. (\<Sum>k<n. norm (a k)) * (\<Sum>k<n. norm (b k))) \<longlonglongrightarrow> (\<Sum>k. norm (a k)) * (\<Sum>k. norm (b k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. (\<Sum>k<n. norm (a k)) * (\<Sum>k<n. norm (b k))) \<longlonglongrightarrow> (\<Sum>k. norm (a k)) * (\<Sum>k. norm (b k))
[PROOF STEP]
using a b
[PROOF STATE]
proof (prove)
using this:
summable (\<lambda>k. norm (a k))
summable (\<lambda>k. norm (b k))

goal (1 subgoal):
 1. (\<lambda>n. (\<Sum>k<n. norm (a k)) * (\<Sum>k<n. norm (b k))) \<longlonglongrightarrow> (\<Sum>k. norm (a k)) * (\<Sum>k. norm (b k))
[PROOF STEP]
by (intro tendsto_mult summable_LIMSEQ)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (\<Sum>k<n. norm (a k)) * (\<Sum>k<n. norm (b k))) \<longlonglongrightarrow> (\<Sum>k. norm (a k)) * (\<Sum>k. norm (b k))

goal (1 subgoal):
 1. (\<lambda>k. \<Sum>i\<le>k. a i * b (k - i)) sums ((\<Sum>k. a k) * (\<Sum>k. b k))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. (\<Sum>k<n. norm (a k)) * (\<Sum>k<n. norm (b k))) \<longlonglongrightarrow> (\<Sum>k. norm (a k)) * (\<Sum>k. norm (b k))
[PROOF STEP]
have "(\<lambda>n. sum ?f (?S1 n)) \<longlonglongrightarrow> (\<Sum>k. norm (a k)) * (\<Sum>k. norm (b k))"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. (\<Sum>k<n. norm (a k)) * (\<Sum>k<n. norm (b k))) \<longlonglongrightarrow> (\<Sum>k. norm (a k)) * (\<Sum>k. norm (b k))

goal (1 subgoal):
 1. (\<lambda>n. \<Sum>(i, j)\<in>{..<n} \<times> {..<n}. norm (a i) * norm (b j)) \<longlonglongrightarrow> (\<Sum>k. norm (a k)) * (\<Sum>k. norm (b k))
[PROOF STEP]
by (simp only: sum_product sum.Sigma [rule_format] finite_lessThan)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. \<Sum>(i, j)\<in>{..<n} \<times> {..<n}. norm (a i) * norm (b j)) \<longlonglongrightarrow> (\<Sum>k. norm (a k)) * (\<Sum>k. norm (b k))

goal (1 subgoal):
 1. (\<lambda>k. \<Sum>i\<le>k. a i * b (k - i)) sums ((\<Sum>k. a k) * (\<Sum>k. b k))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. \<Sum>(i, j)\<in>{..<n} \<times> {..<n}. norm (a i) * norm (b j)) \<longlonglongrightarrow> (\<Sum>k. norm (a k)) * (\<Sum>k. norm (b k))
[PROOF STEP]
have "convergent (\<lambda>n. sum ?f (?S1 n))"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. \<Sum>(i, j)\<in>{..<n} \<times> {..<n}. norm (a i) * norm (b j)) \<longlonglongrightarrow> (\<Sum>k. norm (a k)) * (\<Sum>k. norm (b k))

goal (1 subgoal):
 1. convergent (\<lambda>n. \<Sum>(i, j)\<in>{..<n} \<times> {..<n}. norm (a i) * norm (b j))
[PROOF STEP]
by (rule convergentI)
[PROOF STATE]
proof (state)
this:
convergent (\<lambda>n. \<Sum>(i, j)\<in>{..<n} \<times> {..<n}. norm (a i) * norm (b j))

goal (1 subgoal):
 1. (\<lambda>k. \<Sum>i\<le>k. a i * b (k - i)) sums ((\<Sum>k. a k) * (\<Sum>k. b k))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
convergent (\<lambda>n. \<Sum>(i, j)\<in>{..<n} \<times> {..<n}. norm (a i) * norm (b j))
[PROOF STEP]
have Cauchy: "Cauchy (\<lambda>n. sum ?f (?S1 n))"
[PROOF STATE]
proof (prove)
using this:
convergent (\<lambda>n. \<Sum>(i, j)\<in>{..<n} \<times> {..<n}. norm (a i) * norm (b j))

goal (1 subgoal):
 1. Cauchy (\<lambda>n. \<Sum>(i, j)\<in>{..<n} \<times> {..<n}. norm (a i) * norm (b j))
[PROOF STEP]
by (rule convergent_Cauchy)
[PROOF STATE]
proof (state)
this:
Cauchy (\<lambda>n. \<Sum>(i, j)\<in>{..<n} \<times> {..<n}. norm (a i) * norm (b j))

goal (1 subgoal):
 1. (\<lambda>k. \<Sum>i\<le>k. a i * b (k - i)) sums ((\<Sum>k. a k) * (\<Sum>k. b k))
[PROOF STEP]
have "Zfun (\<lambda>n. sum ?f (?S1 n - ?S2 n)) sequentially"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Zfun (\<lambda>n. \<Sum>(i, j)\<in>{..<n} \<times> {..<n} - {(i, j). i + j < n}. norm (a i) * norm (b j)) sequentially
[PROOF STEP]
proof (rule ZfunI, simp only: eventually_sequentially norm_sum_f)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>r. 0 < r \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. (\<Sum>(i, j)\<in>{..<n} \<times> {..<n} - {(i, j). i + j < n}. norm (a i) * norm (b j)) < r
[PROOF STEP]
fix r :: real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>r. 0 < r \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. (\<Sum>(i, j)\<in>{..<n} \<times> {..<n} - {(i, j). i + j < n}. norm (a i) * norm (b j)) < r
[PROOF STEP]
assume r: "0 < r"
[PROOF STATE]
proof (state)
this:
0 < r

goal (1 subgoal):
 1. \<And>r. 0 < r \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. (\<Sum>(i, j)\<in>{..<n} \<times> {..<n} - {(i, j). i + j < n}. norm (a i) * norm (b j)) < r
[PROOF STEP]
from CauchyD [OF Cauchy r]
[PROOF STATE]
proof (chain)
picking this:
\<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. norm ((\<Sum>(i, j)\<in>{..<m} \<times> {..<m}. norm (a i) * norm (b j)) - (\<Sum>(i, j)\<in>{..<n} \<times> {..<n}. norm (a i) * norm (b j))) < r
[PROOF STEP]
obtain N
      where "\<forall>m\<ge>N. \<forall>n\<ge>N. norm (sum ?f (?S1 m) - sum ?f (?S1 n)) < r"
[PROOF STATE]
proof (prove)
using this:
\<exists>M. \<forall>m\<ge>M. \<forall>n\<ge>M. norm ((\<Sum>(i, j)\<in>{..<m} \<times> {..<m}. norm (a i) * norm (b j)) - (\<Sum>(i, j)\<in>{..<n} \<times> {..<n}. norm (a i) * norm (b j))) < r

goal (1 subgoal):
 1. (\<And>N. \<forall>m\<ge>N. \<forall>n\<ge>N. norm ((\<Sum>(i, j)\<in>{..<m} \<times> {..<m}. norm (a i) * norm (b j)) - (\<Sum>(i, j)\<in>{..<n} \<times> {..<n}. norm (a i) * norm (b j))) < r \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<forall>m\<ge>N. \<forall>n\<ge>N. norm ((\<Sum>(i, j)\<in>{..<m} \<times> {..<m}. norm (a i) * norm (b j)) - (\<Sum>(i, j)\<in>{..<n} \<times> {..<n}. norm (a i) * norm (b j))) < r

goal (1 subgoal):
 1. \<And>r. 0 < r \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. (\<Sum>(i, j)\<in>{..<n} \<times> {..<n} - {(i, j). i + j < n}. norm (a i) * norm (b j)) < r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>m\<ge>N. \<forall>n\<ge>N. norm ((\<Sum>(i, j)\<in>{..<m} \<times> {..<m}. norm (a i) * norm (b j)) - (\<Sum>(i, j)\<in>{..<n} \<times> {..<n}. norm (a i) * norm (b j))) < r
[PROOF STEP]
have "\<And>m n. N \<le> n \<Longrightarrow> n \<le> m \<Longrightarrow> norm (sum ?f (?S1 m - ?S1 n)) < r"
[PROOF STATE]
proof (prove)
using this:
\<forall>m\<ge>N. \<forall>n\<ge>N. norm ((\<Sum>(i, j)\<in>{..<m} \<times> {..<m}. norm (a i) * norm (b j)) - (\<Sum>(i, j)\<in>{..<n} \<times> {..<n}. norm (a i) * norm (b j))) < r

goal (1 subgoal):
 1. \<And>m n. \<lbrakk>N \<le> n; n \<le> m\<rbrakk> \<Longrightarrow> norm (\<Sum>(i, j)\<in>{..<m} \<times> {..<m} - {..<n} \<times> {..<n}. norm (a i) * norm (b j)) < r
[PROOF STEP]
by (simp only: sum_diff finite_S1 S1_mono)
[PROOF STATE]
proof (state)
this:
\<lbrakk>N \<le> ?n; ?n \<le> ?m\<rbrakk> \<Longrightarrow> norm (\<Sum>(i, j)\<in>{..<?m} \<times> {..<?m} - {..<?n} \<times> {..<?n}. norm (a i) * norm (b j)) < r

goal (1 subgoal):
 1. \<And>r. 0 < r \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. (\<Sum>(i, j)\<in>{..<n} \<times> {..<n} - {(i, j). i + j < n}. norm (a i) * norm (b j)) < r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>N \<le> ?n; ?n \<le> ?m\<rbrakk> \<Longrightarrow> norm (\<Sum>(i, j)\<in>{..<?m} \<times> {..<?m} - {..<?n} \<times> {..<?n}. norm (a i) * norm (b j)) < r
[PROOF STEP]
have N: "\<And>m n. N \<le> n \<Longrightarrow> n \<le> m \<Longrightarrow> sum ?f (?S1 m - ?S1 n) < r"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>N \<le> ?n; ?n \<le> ?m\<rbrakk> \<Longrightarrow> norm (\<Sum>(i, j)\<in>{..<?m} \<times> {..<?m} - {..<?n} \<times> {..<?n}. norm (a i) * norm (b j)) < r

goal (1 subgoal):
 1. \<And>m n. \<lbrakk>N \<le> n; n \<le> m\<rbrakk> \<Longrightarrow> (\<Sum>(i, j)\<in>{..<m} \<times> {..<m} - {..<n} \<times> {..<n}. norm (a i) * norm (b j)) < r
[PROOF STEP]
by (simp only: norm_sum_f)
[PROOF STATE]
proof (state)
this:
\<lbrakk>N \<le> ?n; ?n \<le> ?m\<rbrakk> \<Longrightarrow> (\<Sum>(i, j)\<in>{..<?m} \<times> {..<?m} - {..<?n} \<times> {..<?n}. norm (a i) * norm (b j)) < r

goal (1 subgoal):
 1. \<And>r. 0 < r \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. (\<Sum>(i, j)\<in>{..<n} \<times> {..<n} - {(i, j). i + j < n}. norm (a i) * norm (b j)) < r
[PROOF STEP]
show "\<exists>N. \<forall>n\<ge>N. sum ?f (?S1 n - ?S2 n) < r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. (\<Sum>(i, j)\<in>{..<n} \<times> {..<n} - {(i, j). i + j < n}. norm (a i) * norm (b j)) < r
[PROOF STEP]
proof (intro exI allI impI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. ?N \<le> n \<Longrightarrow> (\<Sum>(i, j)\<in>{..<n} \<times> {..<n} - {(i, j). i + j < n}. norm (a i) * norm (b j)) < r
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. ?N \<le> n \<Longrightarrow> (\<Sum>(i, j)\<in>{..<n} \<times> {..<n} - {(i, j). i + j < n}. norm (a i) * norm (b j)) < r
[PROOF STEP]
assume "2 * N \<le> n"
[PROOF STATE]
proof (state)
this:
2 * N \<le> n

goal (1 subgoal):
 1. \<And>n. ?N \<le> n \<Longrightarrow> (\<Sum>(i, j)\<in>{..<n} \<times> {..<n} - {(i, j). i + j < n}. norm (a i) * norm (b j)) < r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
2 * N \<le> n
[PROOF STEP]
have n: "N \<le> n div 2"
[PROOF STATE]
proof (prove)
using this:
2 * N \<le> n

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

goal (1 subgoal):
 1. \<And>n. ?N \<le> n \<Longrightarrow> (\<Sum>(i, j)\<in>{..<n} \<times> {..<n} - {(i, j). i + j < n}. norm (a i) * norm (b j)) < r
[PROOF STEP]
have "sum ?f (?S1 n - ?S2 n) \<le> sum ?f (?S1 n - ?S1 (n div 2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>(i, j)\<in>{..<n} \<times> {..<n} - {(i, j). i + j < n}. norm (a i) * norm (b j)) \<le> (\<Sum>(i, j)\<in>{..<n} \<times> {..<n} - {..<n div 2} \<times> {..<n div 2}. norm (a i) * norm (b j))
[PROOF STEP]
by (intro sum_mono2 finite_Diff finite_S1 f_nonneg Diff_mono subset_refl S1_le_S2)
[PROOF STATE]
proof (state)
this:
(\<Sum>(i, j)\<in>{..<n} \<times> {..<n} - {(i, j). i + j < n}. norm (a i) * norm (b j)) \<le> (\<Sum>(i, j)\<in>{..<n} \<times> {..<n} - {..<n div 2} \<times> {..<n div 2}. norm (a i) * norm (b j))

goal (1 subgoal):
 1. \<And>n. ?N \<le> n \<Longrightarrow> (\<Sum>(i, j)\<in>{..<n} \<times> {..<n} - {(i, j). i + j < n}. norm (a i) * norm (b j)) < r
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>(i, j)\<in>{..<n} \<times> {..<n} - {(i, j). i + j < n}. norm (a i) * norm (b j)) \<le> (\<Sum>(i, j)\<in>{..<n} \<times> {..<n} - {..<n div 2} \<times> {..<n div 2}. norm (a i) * norm (b j))

goal (1 subgoal):
 1. \<And>n. ?N \<le> n \<Longrightarrow> (\<Sum>(i, j)\<in>{..<n} \<times> {..<n} - {(i, j). i + j < n}. norm (a i) * norm (b j)) < r
[PROOF STEP]
have "\<dots> < r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>(i, j)\<in>{..<n} \<times> {..<n} - {..<n div 2} \<times> {..<n div 2}. norm (a i) * norm (b j)) < r
[PROOF STEP]
using n div_le_dividend
[PROOF STATE]
proof (prove)
using this:
N \<le> n div 2
?m div ?n \<le> ?m

goal (1 subgoal):
 1. (\<Sum>(i, j)\<in>{..<n} \<times> {..<n} - {..<n div 2} \<times> {..<n div 2}. norm (a i) * norm (b j)) < r
[PROOF STEP]
by (rule N)
[PROOF STATE]
proof (state)
this:
(\<Sum>(i, j)\<in>{..<n} \<times> {..<n} - {..<n div 2} \<times> {..<n div 2}. norm (a i) * norm (b j)) < r

goal (1 subgoal):
 1. \<And>n. ?N \<le> n \<Longrightarrow> (\<Sum>(i, j)\<in>{..<n} \<times> {..<n} - {(i, j). i + j < n}. norm (a i) * norm (b j)) < r
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>(i, j)\<in>{..<n} \<times> {..<n} - {(i, j). i + j < n}. norm (a i) * norm (b j)) < r
[PROOF STEP]
show "sum ?f (?S1 n - ?S2 n) < r"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>(i, j)\<in>{..<n} \<times> {..<n} - {(i, j). i + j < n}. norm (a i) * norm (b j)) < r

goal (1 subgoal):
 1. (\<Sum>(i, j)\<in>{..<n} \<times> {..<n} - {(i, j). i + j < n}. norm (a i) * norm (b j)) < r
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>(i, j)\<in>{..<n} \<times> {..<n} - {(i, j). i + j < n}. norm (a i) * norm (b j)) < r

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>N. \<forall>n\<ge>N. (\<Sum>(i, j)\<in>{..<n} \<times> {..<n} - {(i, j). i + j < n}. norm (a i) * norm (b j)) < r

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Zfun (\<lambda>n. \<Sum>(i, j)\<in>{..<n} \<times> {..<n} - {(i, j). i + j < n}. norm (a i) * norm (b j)) sequentially

goal (1 subgoal):
 1. (\<lambda>k. \<Sum>i\<le>k. a i * b (k - i)) sums ((\<Sum>k. a k) * (\<Sum>k. b k))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Zfun (\<lambda>n. \<Sum>(i, j)\<in>{..<n} \<times> {..<n} - {(i, j). i + j < n}. norm (a i) * norm (b j)) sequentially
[PROOF STEP]
have "Zfun (\<lambda>n. sum ?g (?S1 n - ?S2 n)) sequentially"
[PROOF STATE]
proof (prove)
using this:
Zfun (\<lambda>n. \<Sum>(i, j)\<in>{..<n} \<times> {..<n} - {(i, j). i + j < n}. norm (a i) * norm (b j)) sequentially

goal (1 subgoal):
 1. Zfun (\<lambda>n. \<Sum>(i, j)\<in>{..<n} \<times> {..<n} - {(i, j). i + j < n}. a i * b j) sequentially
[PROOF STEP]
apply (rule Zfun_le [rule_format])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. norm (\<Sum>(i, j)\<in>{..<x} \<times> {..<x} - {(i, j). i + j < x}. a i * b j) \<le> norm (\<Sum>(i, j)\<in>{..<x} \<times> {..<x} - {(i, j). i + j < x}. norm (a i) * norm (b j))
[PROOF STEP]
apply (simp only: norm_sum_f)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. norm (\<Sum>(i, j)\<in>{..<x} \<times> {..<x} - {(i, j). i + j < x}. a i * b j) \<le> (\<Sum>(i, j)\<in>{..<x} \<times> {..<x} - {(i, j). i + j < x}. norm (a i) * norm (b j))
[PROOF STEP]
apply (rule order_trans [OF norm_sum sum_mono])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x i. i \<in> {..<x} \<times> {..<x} - {(i, j). i + j < x} \<Longrightarrow> norm (case i of (i, j) \<Rightarrow> a i * b j) \<le> (case i of (i, j) \<Rightarrow> norm (a i) * norm (b j))
[PROOF STEP]
apply (auto simp add: norm_mult_ineq)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
Zfun (\<lambda>n. \<Sum>(i, j)\<in>{..<n} \<times> {..<n} - {(i, j). i + j < n}. a i * b j) sequentially

goal (1 subgoal):
 1. (\<lambda>k. \<Sum>i\<le>k. a i * b (k - i)) sums ((\<Sum>k. a k) * (\<Sum>k. b k))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Zfun (\<lambda>n. \<Sum>(i, j)\<in>{..<n} \<times> {..<n} - {(i, j). i + j < n}. a i * b j) sequentially
[PROOF STEP]
have 2: "(\<lambda>n. sum ?g (?S1 n) - sum ?g (?S2 n)) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
using this:
Zfun (\<lambda>n. \<Sum>(i, j)\<in>{..<n} \<times> {..<n} - {(i, j). i + j < n}. a i * b j) sequentially

goal (1 subgoal):
 1. (\<lambda>n. (\<Sum>(i, j)\<in>{..<n} \<times> {..<n}. a i * b j) - (\<Sum>(i, j)\<in>{(i, j). i + j < n}. a i * b j)) \<longlonglongrightarrow> (0::'a)
[PROOF STEP]
unfolding tendsto_Zfun_iff diff_0_right
[PROOF STATE]
proof (prove)
using this:
Zfun (\<lambda>n. \<Sum>(i, j)\<in>{..<n} \<times> {..<n} - {(i, j). i + j < n}. a i * b j) sequentially

goal (1 subgoal):
 1. Zfun (\<lambda>x. (\<Sum>(i, j)\<in>{..<x} \<times> {..<x}. a i * b j) - (\<Sum>(i, j)\<in>{(i, j). i + j < x}. a i * b j)) sequentially
[PROOF STEP]
by (simp only: sum_diff finite_S1 S2_le_S1)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (\<Sum>(i, j)\<in>{..<n} \<times> {..<n}. a i * b j) - (\<Sum>(i, j)\<in>{(i, j). i + j < n}. a i * b j)) \<longlonglongrightarrow> (0::'a)

goal (1 subgoal):
 1. (\<lambda>k. \<Sum>i\<le>k. a i * b (k - i)) sums ((\<Sum>k. a k) * (\<Sum>k. b k))
[PROOF STEP]
with 1
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. \<Sum>(i, j)\<in>{..<n} \<times> {..<n}. a i * b j) \<longlonglongrightarrow> (\<Sum>k. a k) * (\<Sum>k. b k)
(\<lambda>n. (\<Sum>(i, j)\<in>{..<n} \<times> {..<n}. a i * b j) - (\<Sum>(i, j)\<in>{(i, j). i + j < n}. a i * b j)) \<longlonglongrightarrow> (0::'a)
[PROOF STEP]
have "(\<lambda>n. sum ?g (?S2 n)) \<longlonglongrightarrow> (\<Sum>k. a k) * (\<Sum>k. b k)"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. \<Sum>(i, j)\<in>{..<n} \<times> {..<n}. a i * b j) \<longlonglongrightarrow> (\<Sum>k. a k) * (\<Sum>k. b k)
(\<lambda>n. (\<Sum>(i, j)\<in>{..<n} \<times> {..<n}. a i * b j) - (\<Sum>(i, j)\<in>{(i, j). i + j < n}. a i * b j)) \<longlonglongrightarrow> (0::'a)

goal (1 subgoal):
 1. (\<lambda>n. \<Sum>(i, j)\<in>{(i, j). i + j < n}. a i * b j) \<longlonglongrightarrow> (\<Sum>k. a k) * (\<Sum>k. b k)
[PROOF STEP]
by (rule Lim_transform2)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. \<Sum>(i, j)\<in>{(i, j). i + j < n}. a i * b j) \<longlonglongrightarrow> (\<Sum>k. a k) * (\<Sum>k. b k)

goal (1 subgoal):
 1. (\<lambda>k. \<Sum>i\<le>k. a i * b (k - i)) sums ((\<Sum>k. a k) * (\<Sum>k. b k))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. \<Sum>(i, j)\<in>{(i, j). i + j < n}. a i * b j) \<longlonglongrightarrow> (\<Sum>k. a k) * (\<Sum>k. b k)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. \<Sum>(i, j)\<in>{(i, j). i + j < n}. a i * b j) \<longlonglongrightarrow> (\<Sum>k. a k) * (\<Sum>k. b k)

goal (1 subgoal):
 1. (\<lambda>k. \<Sum>i\<le>k. a i * b (k - i)) sums ((\<Sum>k. a k) * (\<Sum>k. b k))
[PROOF STEP]
by (simp only: sums_def sum.triangle_reindex)
[PROOF STATE]
proof (state)
this:
(\<lambda>k. \<Sum>i\<le>k. a i * b (k - i)) sums ((\<Sum>k. a k) * (\<Sum>k. b k))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cos_of_real: "cos (of_real x) = of_real (cos x)"
  for x :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos (of_real x) = of_real (cos x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cos (of_real x) = of_real (cos x)
[PROOF STEP]
have "(\<lambda>n. of_real (cos_coeff n *\<^sub>R  x^n)) = (\<lambda>n. cos_coeff n *\<^sub>R  (of_real x)^n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. of_real (cos_coeff n *\<^sub>R x ^ n)) = (\<lambda>n. cos_coeff n *\<^sub>R of_real x ^ n)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. of_real (cos_coeff n *\<^sub>R x ^ n) = cos_coeff n *\<^sub>R of_real x ^ n
[PROOF STEP]
show "of_real (cos_coeff n *\<^sub>R  x^n) = cos_coeff n *\<^sub>R of_real x^n" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_real (cos_coeff n *\<^sub>R x ^ n) = cos_coeff n *\<^sub>R of_real x ^ n
[PROOF STEP]
by (simp add: scaleR_conv_of_real)
[PROOF STATE]
proof (state)
this:
of_real (cos_coeff ?n1 *\<^sub>R x ^ ?n1) = cos_coeff ?n1 *\<^sub>R of_real x ^ ?n1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<lambda>n. of_real (cos_coeff n *\<^sub>R x ^ n)) = (\<lambda>n. cos_coeff n *\<^sub>R of_real x ^ n)

goal (1 subgoal):
 1. cos (of_real x) = of_real (cos x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>n. of_real (cos_coeff n *\<^sub>R x ^ n)) = (\<lambda>n. cos_coeff n *\<^sub>R of_real x ^ n)

goal (1 subgoal):
 1. cos (of_real x) = of_real (cos x)
[PROOF STEP]
have "\<dots> sums (cos (of_real x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. cos_coeff n *\<^sub>R of_real x ^ n) sums cos (of_real x)
[PROOF STEP]
by (rule cos_converges)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. cos_coeff n *\<^sub>R of_real x ^ n) sums cos (of_real x)

goal (1 subgoal):
 1. cos (of_real x) = of_real (cos x)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. of_real (cos_coeff n *\<^sub>R x ^ n)) sums cos (of_real x)
[PROOF STEP]
have "(\<lambda>n. of_real (cos_coeff n *\<^sub>R x^n)) sums (cos (of_real x))"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. of_real (cos_coeff n *\<^sub>R x ^ n)) sums cos (of_real x)

goal (1 subgoal):
 1. (\<lambda>n. of_real (cos_coeff n *\<^sub>R x ^ n)) sums cos (of_real x)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<lambda>n. of_real (cos_coeff n *\<^sub>R x ^ n)) sums cos (of_real x)

goal (1 subgoal):
 1. cos (of_real x) = of_real (cos x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. of_real (cos_coeff n *\<^sub>R x ^ n)) sums cos (of_real x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. of_real (cos_coeff n *\<^sub>R x ^ n)) sums cos (of_real x)

goal (1 subgoal):
 1. cos (of_real x) = of_real (cos x)
[PROOF STEP]
using sums_unique2 sums_of_real [OF cos_converges]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. of_real (cos_coeff n *\<^sub>R x ^ n)) sums cos (of_real x)
\<lbrakk>?f sums ?a; ?f sums ?b\<rbrakk> \<Longrightarrow> ?a = ?b
(\<lambda>n. of_real (cos_coeff n *\<^sub>R ?x1 ^ n)) sums of_real (cos ?x1)

goal (1 subgoal):
 1. cos (of_real x) = of_real (cos x)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
cos (of_real x) = of_real (cos x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma full_meet_weak2:\<open>K = Cn(A) \<Longrightarrow> K \<turnstile> \<phi> \<Longrightarrow> Cn((K \<div>\<^bsub>\<gamma>\<^sub>F\<^sub>C\<^esub> \<phi>) \<union> {.\<not> \<phi>}) = Cn({.\<not> \<phi>})\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>K = Cn A; K \<turnstile> \<phi>\<rbrakk> \<Longrightarrow> Cn ((K \<div>\<^bsub>\<gamma>\<^sub>F\<^sub>C\<^esub> \<phi>) \<union> {.\<not> \<phi>}) = Cn {.\<not> \<phi>}
[PROOF STEP]
unfolding full_meet_weak1
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>K = Cn A; K \<turnstile> \<phi>\<rbrakk> \<Longrightarrow> Cn (K \<inter> Cn {.\<not> \<phi>} \<union> {.\<not> \<phi>}) = Cn {.\<not> \<phi>}
[PROOF STEP]
by (metis Cn_union idempotency_L inf.cobounded2 sup.absorb_iff2 sup_commute)