[STATEMENT]
theorem vec_vec_Tensor_elements:
 assumes " (y \<noteq> [])"
 shows
   "\<forall>i.((i<((length x)*(length y)))
       \<longrightarrow> ((vec_vec_Tensor x y)!i)
             = f (x!(i div (length y))) (y!(i mod (length y))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i<length x * length y. vec_vec_Tensor x y ! i = x ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
apply(rule allI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i < length x * length y \<longrightarrow> vec_vec_Tensor x y ! i = x ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
proof(induct x)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. i < length [] * length y \<longrightarrow> vec_vec_Tensor [] y ! i = [] ! (i div length y) * y ! (i mod length y)
 2. \<And>a x i. (\<And>i. i < length x * length y \<longrightarrow> vec_vec_Tensor x y ! i = x ! (i div length y) * y ! (i mod length y)) \<Longrightarrow> i < length (a # x) * length y \<longrightarrow> vec_vec_Tensor (a # x) y ! i = (a # x) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>i. i < length [] * length y \<longrightarrow> vec_vec_Tensor [] y ! i = [] ! (i div length y) * y ! (i mod length y)
 2. \<And>a x i. (\<And>i. i < length x * length y \<longrightarrow> vec_vec_Tensor x y ! i = x ! (i div length y) * y ! (i mod length y)) \<Longrightarrow> i < length (a # x) * length y \<longrightarrow> vec_vec_Tensor (a # x) y ! i = (a # x) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
have "(length [] = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length [] = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length [] = 0

goal (2 subgoals):
 1. \<And>i. i < length [] * length y \<longrightarrow> vec_vec_Tensor [] y ! i = [] ! (i div length y) * y ! (i mod length y)
 2. \<And>a x i. (\<And>i. i < length x * length y \<longrightarrow> vec_vec_Tensor x y ! i = x ! (i div length y) * y ! (i mod length y)) \<Longrightarrow> i < length (a # x) * length y \<longrightarrow> vec_vec_Tensor (a # x) y ! i = (a # x) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
length [] = 0

goal (2 subgoals):
 1. \<And>i. i < length [] * length y \<longrightarrow> vec_vec_Tensor [] y ! i = [] ! (i div length y) * y ! (i mod length y)
 2. \<And>a x i. (\<And>i. i < length x * length y \<longrightarrow> vec_vec_Tensor x y ! i = x ! (i div length y) * y ! (i mod length y)) \<Longrightarrow> i < length (a # x) * length y \<longrightarrow> vec_vec_Tensor (a # x) y ! i = (a # x) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
have "length (vec_vec_Tensor [] y) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (vec_vec_Tensor [] y) = 0
[PROOF STEP]
using vec_vec_Tensor.simps(1)
[PROOF STATE]
proof (prove)
using this:
vec_vec_Tensor [] ?ys = []

goal (1 subgoal):
 1. length (vec_vec_Tensor [] y) = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length (vec_vec_Tensor [] y) = 0

goal (2 subgoals):
 1. \<And>i. i < length [] * length y \<longrightarrow> vec_vec_Tensor [] y ! i = [] ! (i div length y) * y ! (i mod length y)
 2. \<And>a x i. (\<And>i. i < length x * length y \<longrightarrow> vec_vec_Tensor x y ! i = x ! (i div length y) * y ! (i mod length y)) \<Longrightarrow> i < length (a # x) * length y \<longrightarrow> vec_vec_Tensor (a # x) y ! i = (a # x) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
length (vec_vec_Tensor [] y) = 0
[PROOF STEP]
have "i <(length (vec_vec_Tensor [] y)) \<Longrightarrow> False"
[PROOF STATE]
proof (prove)
using this:
length (vec_vec_Tensor [] y) = 0

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

goal (2 subgoals):
 1. \<And>i. i < length [] * length y \<longrightarrow> vec_vec_Tensor [] y ! i = [] ! (i div length y) * y ! (i mod length y)
 2. \<And>a x i. (\<And>i. i < length x * length y \<longrightarrow> vec_vec_Tensor x y ! i = x ! (i div length y) * y ! (i mod length y)) \<Longrightarrow> i < length (a # x) * length y \<longrightarrow> vec_vec_Tensor (a # x) y ! i = (a # x) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
i < length (vec_vec_Tensor [] y) \<Longrightarrow> False

goal (2 subgoals):
 1. \<And>i. i < length [] * length y \<longrightarrow> vec_vec_Tensor [] y ! i = [] ! (i div length y) * y ! (i mod length y)
 2. \<And>a x i. (\<And>i. i < length x * length y \<longrightarrow> vec_vec_Tensor x y ! i = x ! (i div length y) * y ! (i mod length y)) \<Longrightarrow> i < length (a # x) * length y \<longrightarrow> vec_vec_Tensor (a # x) y ! i = (a # x) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
have "(vec_vec_Tensor [] y) = []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_vec_Tensor [] y = []
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vec_vec_Tensor [] y = []

goal (2 subgoals):
 1. \<And>i. i < length [] * length y \<longrightarrow> vec_vec_Tensor [] y ! i = [] ! (i div length y) * y ! (i mod length y)
 2. \<And>a x i. (\<And>i. i < length x * length y \<longrightarrow> vec_vec_Tensor x y ! i = x ! (i div length y) * y ! (i mod length y)) \<Longrightarrow> i < length (a # x) * length y \<longrightarrow> vec_vec_Tensor (a # x) y ! i = (a # x) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
vec_vec_Tensor [] y = []

goal (2 subgoals):
 1. \<And>i. i < length [] * length y \<longrightarrow> vec_vec_Tensor [] y ! i = [] ! (i div length y) * y ! (i mod length y)
 2. \<And>a x i. (\<And>i. i < length x * length y \<longrightarrow> vec_vec_Tensor x y ! i = x ! (i div length y) * y ! (i mod length y)) \<Longrightarrow> i < length (a # x) * length y \<longrightarrow> vec_vec_Tensor (a # x) y ! i = (a # x) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
have
   "(i<(length (vec_vec_Tensor [] y))) \<longrightarrow>
   ((vec_vec_Tensor x y)!i) = f (x!(i div (length y))) (y!(i mod (length y)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < length (vec_vec_Tensor [] y) \<longrightarrow> vec_vec_Tensor x y ! i = x ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i < length (vec_vec_Tensor [] y) \<longrightarrow> vec_vec_Tensor x y ! i = x ! (i div length y) * y ! (i mod length y)

goal (2 subgoals):
 1. \<And>i. i < length [] * length y \<longrightarrow> vec_vec_Tensor [] y ! i = [] ! (i div length y) * y ! (i mod length y)
 2. \<And>a x i. (\<And>i. i < length x * length y \<longrightarrow> vec_vec_Tensor x y ! i = x ! (i div length y) * y ! (i mod length y)) \<Longrightarrow> i < length (a # x) * length y \<longrightarrow> vec_vec_Tensor (a # x) y ! i = (a # x) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i < length (vec_vec_Tensor [] y) \<longrightarrow> vec_vec_Tensor x y ! i = x ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
i < length (vec_vec_Tensor [] y) \<longrightarrow> vec_vec_Tensor x y ! i = x ! (i div length y) * y ! (i mod length y)

goal (1 subgoal):
 1. i < length [] * length y \<longrightarrow> vec_vec_Tensor [] y ! i = [] ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i < length [] * length y \<longrightarrow> vec_vec_Tensor [] y ! i = [] ! (i div length y) * y ! (i mod length y)

goal (1 subgoal):
 1. \<And>a x i. (\<And>i. i < length x * length y \<longrightarrow> vec_vec_Tensor x y ! i = x ! (i div length y) * y ! (i mod length y)) \<Longrightarrow> i < length (a # x) * length y \<longrightarrow> vec_vec_Tensor (a # x) y ! i = (a # x) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a x i. (\<And>i. i < length x * length y \<longrightarrow> vec_vec_Tensor x y ! i = x ! (i div length y) * y ! (i mod length y)) \<Longrightarrow> i < length (a # x) * length y \<longrightarrow> vec_vec_Tensor (a # x) y ! i = (a # x) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
case (Cons z zs)
[PROOF STATE]
proof (state)
this:
?i < length zs * length y \<longrightarrow> vec_vec_Tensor zs y ! ?i = zs ! (?i div length y) * y ! (?i mod length y)

goal (1 subgoal):
 1. \<And>a x i. (\<And>i. i < length x * length y \<longrightarrow> vec_vec_Tensor x y ! i = x ! (i div length y) * y ! (i mod length y)) \<Longrightarrow> i < length (a # x) * length y \<longrightarrow> vec_vec_Tensor (a # x) y ! i = (a # x) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
have 1:"vec_vec_Tensor (z#zs) y = (times z y)@(vec_vec_Tensor zs y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_vec_Tensor (z # zs) y = local.times z y @ vec_vec_Tensor zs y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vec_vec_Tensor (z # zs) y = local.times z y @ vec_vec_Tensor zs y

goal (1 subgoal):
 1. \<And>a x i. (\<And>i. i < length x * length y \<longrightarrow> vec_vec_Tensor x y ! i = x ! (i div length y) * y ! (i mod length y)) \<Longrightarrow> i < length (a # x) * length y \<longrightarrow> vec_vec_Tensor (a # x) y ! i = (a # x) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
have 2:"i<(length y)\<longrightarrow>((times z y)!i = f z (y!i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < length y \<longrightarrow> local.times z y ! i = z * y ! i
[PROOF STEP]
using times_elements
[PROOF STATE]
proof (prove)
using this:
\<forall>i<length ?v. local.times ?a ?v ! i = ?a * ?v ! i

goal (1 subgoal):
 1. i < length y \<longrightarrow> local.times z y ! i = z * y ! i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i < length y \<longrightarrow> local.times z y ! i = z * y ! i

goal (1 subgoal):
 1. \<And>a x i. (\<And>i. i < length x * length y \<longrightarrow> vec_vec_Tensor x y ! i = x ! (i div length y) * y ! (i mod length y)) \<Longrightarrow> i < length (a # x) * length y \<longrightarrow> vec_vec_Tensor (a # x) y ! i = (a # x) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
i < length y \<longrightarrow> local.times z y ! i = z * y ! i

goal (1 subgoal):
 1. \<And>a x i. (\<And>i. i < length x * length y \<longrightarrow> vec_vec_Tensor x y ! i = x ! (i div length y) * y ! (i mod length y)) \<Longrightarrow> i < length (a # x) * length y \<longrightarrow> vec_vec_Tensor (a # x) y ! i = (a # x) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
have 3:
        "i<(length y)
           \<longrightarrow> (vec_vec_Tensor (z#zs) y)!i = (times z y)!i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = local.times z y ! i
[PROOF STEP]
using vec_vec_Tensor_simpl
[PROOF STATE]
proof (prove)
using this:
?i < length ?y \<longrightarrow> vec_vec_Tensor (?z # ?zs) ?y ! ?i = local.times ?z ?y ! ?i

goal (1 subgoal):
 1. i < length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = local.times z y ! i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i < length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = local.times z y ! i

goal (1 subgoal):
 1. \<And>a x i. (\<And>i. i < length x * length y \<longrightarrow> vec_vec_Tensor x y ! i = x ! (i div length y) * y ! (i mod length y)) \<Longrightarrow> i < length (a # x) * length y \<longrightarrow> vec_vec_Tensor (a # x) y ! i = (a # x) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
i < length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = local.times z y ! i

goal (1 subgoal):
 1. \<And>a x i. (\<And>i. i < length x * length y \<longrightarrow> vec_vec_Tensor x y ! i = x ! (i div length y) * y ! (i mod length y)) \<Longrightarrow> i < length (a # x) * length y \<longrightarrow> vec_vec_Tensor (a # x) y ! i = (a # x) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
have 35:
           "i<(length y) \<longrightarrow> (vec_vec_Tensor (z#zs) y)!i = f z (y!i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = z * y ! i
[PROOF STEP]
using calculation(1) calculation(2)
[PROOF STATE]
proof (prove)
using this:
i < length y \<longrightarrow> local.times z y ! i = z * y ! i
i < length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = local.times z y ! i

goal (1 subgoal):
 1. i < length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = z * y ! i
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
i < length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = z * y ! i

goal (1 subgoal):
 1. \<And>a x i. (\<And>i. i < length x * length y \<longrightarrow> vec_vec_Tensor x y ! i = x ! (i div length y) * y ! (i mod length y)) \<Longrightarrow> i < length (a # x) * length y \<longrightarrow> vec_vec_Tensor (a # x) y ! i = (a # x) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
have 4:"(y \<noteq> []) \<longrightarrow> (length y) >0 "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<noteq> [] \<longrightarrow> 0 < length y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y \<noteq> [] \<longrightarrow> 0 < length y

goal (1 subgoal):
 1. \<And>a x i. (\<And>i. i < length x * length y \<longrightarrow> vec_vec_Tensor x y ! i = x ! (i div length y) * y ! (i mod length y)) \<Longrightarrow> i < length (a # x) * length y \<longrightarrow> vec_vec_Tensor (a # x) y ! i = (a # x) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
have "(i <(length y)) \<longrightarrow>  ((i div (length y)) = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < length y \<longrightarrow> i div length y = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i < length y \<longrightarrow> i div length y = 0

goal (1 subgoal):
 1. \<And>a x i. (\<And>i. i < length x * length y \<longrightarrow> vec_vec_Tensor x y ! i = x ! (i div length y) * y ! (i mod length y)) \<Longrightarrow> i < length (a # x) * length y \<longrightarrow> vec_vec_Tensor (a # x) y ! i = (a # x) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i < length y \<longrightarrow> i div length y = 0
[PROOF STEP]
have  6:"(i <(length y)) \<longrightarrow> (z#zs)!(i div (length y)) = z"
[PROOF STATE]
proof (prove)
using this:
i < length y \<longrightarrow> i div length y = 0

goal (1 subgoal):
 1. i < length y \<longrightarrow> (z # zs) ! (i div length y) = z
[PROOF STEP]
using nth_Cons_0
[PROOF STATE]
proof (prove)
using this:
i < length y \<longrightarrow> i div length y = 0
(?x # ?xs) ! 0 = ?x

goal (1 subgoal):
 1. i < length y \<longrightarrow> (z # zs) ! (i div length y) = z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i < length y \<longrightarrow> (z # zs) ! (i div length y) = z

goal (1 subgoal):
 1. \<And>a x i. (\<And>i. i < length x * length y \<longrightarrow> vec_vec_Tensor x y ! i = x ! (i div length y) * y ! (i mod length y)) \<Longrightarrow> i < length (a # x) * length y \<longrightarrow> vec_vec_Tensor (a # x) y ! i = (a # x) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i < length y \<longrightarrow> (z # zs) ! (i div length y) = z
[PROOF STEP]
have 7:"(i <(length y)) \<longrightarrow> (i mod (length y)) = i"
[PROOF STATE]
proof (prove)
using this:
i < length y \<longrightarrow> (z # zs) ! (i div length y) = z

goal (1 subgoal):
 1. i < length y \<longrightarrow> i mod length y = i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i < length y \<longrightarrow> i mod length y = i

goal (1 subgoal):
 1. \<And>a x i. (\<And>i. i < length x * length y \<longrightarrow> vec_vec_Tensor x y ! i = x ! (i div length y) * y ! (i mod length y)) \<Longrightarrow> i < length (a # x) * length y \<longrightarrow> vec_vec_Tensor (a # x) y ! i = (a # x) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
with 2 6
[PROOF STATE]
proof (chain)
picking this:
i < length y \<longrightarrow> local.times z y ! i = z * y ! i
i < length y \<longrightarrow> (z # zs) ! (i div length y) = z
i < length y \<longrightarrow> i mod length y = i
[PROOF STEP]
have "(i < (length y))
        \<longrightarrow> (times z y)!i
                 = f  ((z#zs)!(i div (length y))) (y! (i mod (length y)))"
[PROOF STATE]
proof (prove)
using this:
i < length y \<longrightarrow> local.times z y ! i = z * y ! i
i < length y \<longrightarrow> (z # zs) ! (i div length y) = z
i < length y \<longrightarrow> i mod length y = i

goal (1 subgoal):
 1. i < length y \<longrightarrow> local.times z y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i < length y \<longrightarrow> local.times z y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)

goal (1 subgoal):
 1. \<And>a x i. (\<And>i. i < length x * length y \<longrightarrow> vec_vec_Tensor x y ! i = x ! (i div length y) * y ! (i mod length y)) \<Longrightarrow> i < length (a # x) * length y \<longrightarrow> vec_vec_Tensor (a # x) y ! i = (a # x) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
with 3
[PROOF STATE]
proof (chain)
picking this:
i < length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = local.times z y ! i
i < length y \<longrightarrow> local.times z y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
have step1:
      "((i < (length y))
          \<longrightarrow> ((i<((length x)*(length y))
          \<longrightarrow> ((vec_vec_Tensor (z#zs) y)!i
                      =  f
                             ((z#zs)!(i div (length y)))
                              (y! (i mod (length y)))))))"
[PROOF STATE]
proof (prove)
using this:
i < length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = local.times z y ! i
i < length y \<longrightarrow> local.times z y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)

goal (1 subgoal):
 1. i < length y \<longrightarrow> i < length x * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i < length y \<longrightarrow> i < length x * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)

goal (1 subgoal):
 1. \<And>a x i. (\<And>i. i < length x * length y \<longrightarrow> vec_vec_Tensor x y ! i = x ! (i div length y) * y ! (i mod length y)) \<Longrightarrow> i < length (a # x) * length y \<longrightarrow> vec_vec_Tensor (a # x) y ! i = (a # x) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
have "((length y) \<le> i) \<longrightarrow> (i - (length y)) \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length y \<le> i \<longrightarrow> 0 \<le> i - length y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length y \<le> i \<longrightarrow> 0 \<le> i - length y

goal (1 subgoal):
 1. \<And>a x i. (\<And>i. i < length x * length y \<longrightarrow> vec_vec_Tensor x y ! i = x ! (i div length y) * y ! (i mod length y)) \<Longrightarrow> i < length (a # x) * length y \<longrightarrow> vec_vec_Tensor (a # x) y ! i = (a # x) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
have step2:
        "((length y) < i)
           \<longrightarrow> ((i < (length (z#zs)*(length y)))
           \<longrightarrow>((vec_vec_Tensor (z#zs) y)!i)
                          = f
                              ((z#zs)!(i div (length y)))
                              (y!(i mod (length y))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length y < i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. length y < i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
have "(length y)>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < length y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
y \<noteq> []

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

goal (1 subgoal):
 1. length y < i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < length y
[PROOF STEP]
have 1:
           "(i > (length y))
               \<longrightarrow>(i div (length y)) = ((i-(length y)) div (length y)) + 1"
[PROOF STATE]
proof (prove)
using this:
0 < length y

goal (1 subgoal):
 1. length y < i \<longrightarrow> i div length y = (i - length y) div length y + 1
[PROOF STEP]
using nat_div
[PROOF STATE]
proof (prove)
using this:
0 < length y
\<lbrakk>0 < ?b; ?b < ?a\<rbrakk> \<Longrightarrow> ?a div ?b = (?a - ?b) div ?b + 1

goal (1 subgoal):
 1. length y < i \<longrightarrow> i div length y = (i - length y) div length y + 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length y < i \<longrightarrow> i div length y = (i - length y) div length y + 1

goal (1 subgoal):
 1. length y < i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
have "zs!j = (z#zs)!(j+1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zs ! j = (z # zs) ! (j + 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
zs ! j = (z # zs) ! (j + 1)

goal (1 subgoal):
 1. length y < i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
zs ! j = (z # zs) ! (j + 1)
[PROOF STEP]
have
            "(zs!((i - (length y)) div (length y)))
                     = (z#zs)!(((i - (length y)) div (length y))+1)"
[PROOF STATE]
proof (prove)
using this:
zs ! j = (z # zs) ! (j + 1)

goal (1 subgoal):
 1. zs ! ((i - length y) div length y) = (z # zs) ! ((i - length y) div length y + 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
zs ! ((i - length y) div length y) = (z # zs) ! ((i - length y) div length y + 1)

goal (1 subgoal):
 1. length y < i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
with 1
[PROOF STATE]
proof (chain)
picking this:
length y < i \<longrightarrow> i div length y = (i - length y) div length y + 1
zs ! ((i - length y) div length y) = (z # zs) ! ((i - length y) div length y + 1)
[PROOF STEP]
have 2:
           "(i > (length y))
              \<longrightarrow> (zs!((i - (length y)) div (length y))
                     = (z#zs)!(i div (length y)))"
[PROOF STATE]
proof (prove)
using this:
length y < i \<longrightarrow> i div length y = (i - length y) div length y + 1
zs ! ((i - length y) div length y) = (z # zs) ! ((i - length y) div length y + 1)

goal (1 subgoal):
 1. length y < i \<longrightarrow> zs ! ((i - length y) div length y) = (z # zs) ! (i div length y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length y < i \<longrightarrow> zs ! ((i - length y) div length y) = (z # zs) ! (i div length y)

goal (1 subgoal):
 1. length y < i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
have "(i > (length y))
               \<longrightarrow>((i mod (length y))
                                 = ((i - (length y)) mod (length y)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length y < i \<longrightarrow> i mod length y = (i - length y) mod length y
[PROOF STEP]
using nat_mod
[PROOF STATE]
proof (prove)
using this:
?n < ?m \<Longrightarrow> ?m mod ?n = (?m - ?n) mod ?n

goal (1 subgoal):
 1. length y < i \<longrightarrow> i mod length y = (i - length y) mod length y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length y < i \<longrightarrow> i mod length y = (i - length y) mod length y

goal (1 subgoal):
 1. length y < i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
length y < i \<longrightarrow> i mod length y = (i - length y) mod length y
[PROOF STEP]
have 3:
          "(i > (length y))
                  \<longrightarrow>((y! (i mod (length y)))
                                = (y! ((i - (length y)) mod (length y))))"
[PROOF STATE]
proof (prove)
using this:
length y < i \<longrightarrow> i mod length y = (i - length y) mod length y

goal (1 subgoal):
 1. length y < i \<longrightarrow> y ! (i mod length y) = y ! ((i - length y) mod length y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length y < i \<longrightarrow> y ! (i mod length y) = y ! ((i - length y) mod length y)

goal (1 subgoal):
 1. length y < i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
have 4:"(i > (length y))
                       \<longrightarrow>(vec_vec_Tensor (z#zs) y)!i
                                = (vec_vec_Tensor zs y)!(i- (length y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length y < i \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = vec_vec_Tensor zs y ! (i - length y)
[PROOF STEP]
using vec_vec_Tensor_simpl2
[PROOF STATE]
proof (prove)
using this:
length ?y \<le> ?i \<longrightarrow> vec_vec_Tensor (?z # ?zs) ?y ! ?i = vec_vec_Tensor ?zs ?y ! (?i - length ?y)

goal (1 subgoal):
 1. length y < i \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = vec_vec_Tensor zs y ! (i - length y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length y < i \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = vec_vec_Tensor zs y ! (i - length y)

goal (1 subgoal):
 1. length y < i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
have 5: "(i > (length y))
                 \<longrightarrow>((i <((length (z#zs))*(length y))))
                          = (i - (length y)< (length zs)*(length y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length y < i \<longrightarrow> (i < length (z # zs) * length y) = (i - length y < length zs * length y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length y < i \<longrightarrow> (i < length (z # zs) * length y) = (i - length y < length zs * length y)

goal (1 subgoal):
 1. length y < i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
length y < i \<longrightarrow> (i < length (z # zs) * length y) = (i - length y < length zs * length y)
[PROOF STEP]
have 6:
             "\<forall>i.((i<((length zs)*(length y)))
                       \<longrightarrow> ((vec_vec_Tensor zs y)!i)
                                 = f
                                    (zs!(i div (length y)))
                                    (y!(i mod (length y))))"
[PROOF STATE]
proof (prove)
using this:
length y < i \<longrightarrow> (i < length (z # zs) * length y) = (i - length y < length zs * length y)

goal (1 subgoal):
 1. \<forall>i<length zs * length y. vec_vec_Tensor zs y ! i = zs ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
using Cons.hyps
[PROOF STATE]
proof (prove)
using this:
length y < i \<longrightarrow> (i < length (z # zs) * length y) = (i - length y < length zs * length y)
?i < length zs * length y \<longrightarrow> vec_vec_Tensor zs y ! ?i = zs ! (?i div length y) * y ! (?i mod length y)

goal (1 subgoal):
 1. \<forall>i<length zs * length y. vec_vec_Tensor zs y ! i = zs ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>i<length zs * length y. vec_vec_Tensor zs y ! i = zs ! (i div length y) * y ! (i mod length y)

goal (1 subgoal):
 1. length y < i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
with 5
[PROOF STATE]
proof (chain)
picking this:
length y < i \<longrightarrow> (i < length (z # zs) * length y) = (i - length y < length zs * length y)
\<forall>i<length zs * length y. vec_vec_Tensor zs y ! i = zs ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
have "(i > (length y))
                       \<longrightarrow> ((i<((length (z#zs))*(length y)))
                       \<longrightarrow> ((vec_vec_Tensor zs y)!(i -(length y)))
                               = f
                                  (zs!((i -(length y)) div (length y)))
                                  (y!((i -(length y)) mod (length y))))
                                   = ((i<((length zs)*(length y)))
                                      \<longrightarrow> ((vec_vec_Tensor zs y)!i)
                                                = f
                                                    (zs!(i div (length y)))
                                                    (y!(i mod (length y))))"
[PROOF STATE]
proof (prove)
using this:
length y < i \<longrightarrow> (i < length (z # zs) * length y) = (i - length y < length zs * length y)
\<forall>i<length zs * length y. vec_vec_Tensor zs y ! i = zs ! (i div length y) * y ! (i mod length y)

goal (1 subgoal):
 1. length y < i \<longrightarrow> (i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor zs y ! (i - length y) = zs ! ((i - length y) div length y) * y ! ((i - length y) mod length y)) = (i < length zs * length y \<longrightarrow> vec_vec_Tensor zs y ! i = zs ! (i div length y) * y ! (i mod length y))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length y < i \<longrightarrow> (i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor zs y ! (i - length y) = zs ! ((i - length y) div length y) * y ! ((i - length y) mod length y)) = (i < length zs * length y \<longrightarrow> vec_vec_Tensor zs y ! i = zs ! (i div length y) * y ! (i mod length y))

goal (1 subgoal):
 1. length y < i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
with 6
[PROOF STATE]
proof (chain)
picking this:
\<forall>i<length zs * length y. vec_vec_Tensor zs y ! i = zs ! (i div length y) * y ! (i mod length y)
length y < i \<longrightarrow> (i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor zs y ! (i - length y) = zs ! ((i - length y) div length y) * y ! ((i - length y) mod length y)) = (i < length zs * length y \<longrightarrow> vec_vec_Tensor zs y ! i = zs ! (i div length y) * y ! (i mod length y))
[PROOF STEP]
have
           "(i > (length y))
                \<longrightarrow>((i<((length (z#zs))*(length y)))
                \<longrightarrow> ((vec_vec_Tensor zs y)!(i -(length y)))
                            = f
                               (zs!((i -(length y)) div (length y)))
                               (y!((i -(length y))  mod (length y))))"
[PROOF STATE]
proof (prove)
using this:
\<forall>i<length zs * length y. vec_vec_Tensor zs y ! i = zs ! (i div length y) * y ! (i mod length y)
length y < i \<longrightarrow> (i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor zs y ! (i - length y) = zs ! ((i - length y) div length y) * y ! ((i - length y) mod length y)) = (i < length zs * length y \<longrightarrow> vec_vec_Tensor zs y ! i = zs ! (i div length y) * y ! (i mod length y))

goal (1 subgoal):
 1. length y < i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor zs y ! (i - length y) = zs ! ((i - length y) div length y) * y ! ((i - length y) mod length y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length y < i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor zs y ! (i - length y) = zs ! ((i - length y) div length y) * y ! ((i - length y) mod length y)

goal (1 subgoal):
 1. length y < i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
with 2 3 4
[PROOF STATE]
proof (chain)
picking this:
length y < i \<longrightarrow> zs ! ((i - length y) div length y) = (z # zs) ! (i div length y)
length y < i \<longrightarrow> y ! (i mod length y) = y ! ((i - length y) mod length y)
length y < i \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = vec_vec_Tensor zs y ! (i - length y)
length y < i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor zs y ! (i - length y) = zs ! ((i - length y) div length y) * y ! ((i - length y) mod length y)
[PROOF STEP]
have
            "(i > (length y))
                \<longrightarrow>((i<((length (z#zs))*(length y)))
                \<longrightarrow>((vec_vec_Tensor (z#zs) y)!i)
                         =  f
                               ((z#zs)!(i div (length y)))
                               (y!(i mod (length y))))"
[PROOF STATE]
proof (prove)
using this:
length y < i \<longrightarrow> zs ! ((i - length y) div length y) = (z # zs) ! (i div length y)
length y < i \<longrightarrow> y ! (i mod length y) = y ! ((i - length y) mod length y)
length y < i \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = vec_vec_Tensor zs y ! (i - length y)
length y < i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor zs y ! (i - length y) = zs ! ((i - length y) div length y) * y ! ((i - length y) mod length y)

goal (1 subgoal):
 1. length y < i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length y < i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)

goal (1 subgoal):
 1. length y < i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
length y < i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
length y < i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)

goal (1 subgoal):
 1. length y < i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length y < i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
length y < i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)

goal (1 subgoal):
 1. \<And>a x i. (\<And>i. i < length x * length y \<longrightarrow> vec_vec_Tensor x y ! i = x ! (i div length y) * y ! (i mod length y)) \<Longrightarrow> i < length (a # x) * length y \<longrightarrow> vec_vec_Tensor (a # x) y ! i = (a # x) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
have "((length y) = i)
                     \<longrightarrow> ((i < (length (z#zs)*(length y)))
                     \<longrightarrow> ((vec_vec_Tensor (z#zs) y)!i)
                                          = f
                                              ((z#zs)!(i div (length y)))
                                              (y!(i mod (length y))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length y = i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. length y = i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
have 1:"(i = (length y))
                  \<longrightarrow> ((vec_vec_Tensor (z#zs) y)!i)
                                        = (vec_vec_Tensor zs y)!0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i = length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = vec_vec_Tensor zs y ! 0
[PROOF STEP]
using vec_vec_Tensor_simpl2
[PROOF STATE]
proof (prove)
using this:
length ?y \<le> ?i \<longrightarrow> vec_vec_Tensor (?z # ?zs) ?y ! ?i = vec_vec_Tensor ?zs ?y ! (?i - length ?y)

goal (1 subgoal):
 1. i = length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = vec_vec_Tensor zs y ! 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i = length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = vec_vec_Tensor zs y ! 0

goal (1 subgoal):
 1. length y = i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
have 2:"(i = length y) \<longrightarrow> (i mod (length y)) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i = length y \<longrightarrow> i mod length y = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i = length y \<longrightarrow> i mod length y = 0

goal (1 subgoal):
 1. length y = i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
have 3:"(i = length y) \<longrightarrow> (i div (length y)) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i = length y \<longrightarrow> i div length y = 1
[PROOF STEP]
using 4 assms div_self less_numeral_extra(3)
[PROOF STATE]
proof (prove)
using this:
y \<noteq> [] \<longrightarrow> 0 < length y
y \<noteq> []
?a \<noteq> (0::?'a) \<Longrightarrow> ?a div ?a = (1::?'a)
\<not> (0::?'a) < (0::?'a)

goal (1 subgoal):
 1. i = length y \<longrightarrow> i div length y = 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i = length y \<longrightarrow> i div length y = 1

goal (1 subgoal):
 1. length y = i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
have 4: "(i = length y)
                  \<longrightarrow> ((i < (length (z#zs))*(length y))
                               = (0 < (length zs)*(length y)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i = length y \<longrightarrow> (i < length (z # zs) * length y) = (0 < length zs * length y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i = length y \<longrightarrow> (i < length (z # zs) * length y) = (0 < length zs * length y)

goal (1 subgoal):
 1. length y = i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
have "(z#zs)!1 = (zs!0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (z # zs) ! 1 = zs ! 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(z # zs) ! 1 = zs ! 0

goal (1 subgoal):
 1. length y = i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
with 3
[PROOF STATE]
proof (chain)
picking this:
i = length y \<longrightarrow> i div length y = 1
(z # zs) ! 1 = zs ! 0
[PROOF STEP]
have 5:" (i = length y)
                              \<longrightarrow> ((z#zs)!(i div (length y))) = (zs!0)"
[PROOF STATE]
proof (prove)
using this:
i = length y \<longrightarrow> i div length y = 1
(z # zs) ! 1 = zs ! 0

goal (1 subgoal):
 1. i = length y \<longrightarrow> (z # zs) ! (i div length y) = zs ! 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i = length y \<longrightarrow> (z # zs) ! (i div length y) = zs ! 0

goal (1 subgoal):
 1. length y = i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
have " \<forall>i.((i < (length zs)*(length y))
                               \<longrightarrow>((vec_vec_Tensor (zs) y)!i)
                                             = f
                                                 ((zs)!(i div (length y)))
                                                 (y!(i mod (length y))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i<length zs * length y. vec_vec_Tensor zs y ! i = zs ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
using Cons.hyps
[PROOF STATE]
proof (prove)
using this:
?i < length zs * length y \<longrightarrow> vec_vec_Tensor zs y ! ?i = zs ! (?i div length y) * y ! (?i mod length y)

goal (1 subgoal):
 1. \<forall>i<length zs * length y. vec_vec_Tensor zs y ! i = zs ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>i<length zs * length y. vec_vec_Tensor zs y ! i = zs ! (i div length y) * y ! (i mod length y)

goal (1 subgoal):
 1. length y = i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
with 4
[PROOF STATE]
proof (chain)
picking this:
i = length y \<longrightarrow> (i < length (z # zs) * length y) = (0 < length zs * length y)
\<forall>i<length zs * length y. vec_vec_Tensor zs y ! i = zs ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
have 6:"(i = length y)
                           \<longrightarrow> ((0 < ((length zs)*(length y)))
                              \<longrightarrow> (((vec_vec_Tensor (zs) y)!0)
                                       = f ((zs)!0) (y!0)))
                                         = ((i < ((length zs)*(length y)))
                                               \<longrightarrow>(((vec_vec_Tensor zs y)!i)
                                                = f
                                                    ((zs)!(i div (length y)))
                                                    (y!(i mod (length y)))))"
[PROOF STATE]
proof (prove)
using this:
i = length y \<longrightarrow> (i < length (z # zs) * length y) = (0 < length zs * length y)
\<forall>i<length zs * length y. vec_vec_Tensor zs y ! i = zs ! (i div length y) * y ! (i mod length y)

goal (1 subgoal):
 1. i = length y \<longrightarrow> (0 < length zs * length y \<longrightarrow> vec_vec_Tensor zs y ! 0 = zs ! 0 * y ! 0) = (i < length zs * length y \<longrightarrow> vec_vec_Tensor zs y ! i = zs ! (i div length y) * y ! (i mod length y))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i = length y \<longrightarrow> (0 < length zs * length y \<longrightarrow> vec_vec_Tensor zs y ! 0 = zs ! 0 * y ! 0) = (i < length zs * length y \<longrightarrow> vec_vec_Tensor zs y ! i = zs ! (i div length y) * y ! (i mod length y))

goal (1 subgoal):
 1. length y = i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
have 7: "(0 div (length y)) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 div length y = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 div length y = 0

goal (1 subgoal):
 1. length y = i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
have 8: " (0 mod (length y)) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 mod length y = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 mod length y = 0

goal (1 subgoal):
 1. length y = i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
have 9: "(0 < ((length zs)*(length y)))
                       \<longrightarrow> ((vec_vec_Tensor zs y)!0)
                                           = f (zs!0) (y!0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < length zs * length y \<longrightarrow> vec_vec_Tensor zs y ! 0 = zs ! 0 * y ! 0
[PROOF STEP]
using 7 8 Cons.hyps
[PROOF STATE]
proof (prove)
using this:
0 div length y = 0
0 mod length y = 0
?i < length zs * length y \<longrightarrow> vec_vec_Tensor zs y ! ?i = zs ! (?i div length y) * y ! (?i mod length y)

goal (1 subgoal):
 1. 0 < length zs * length y \<longrightarrow> vec_vec_Tensor zs y ! 0 = zs ! 0 * y ! 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < length zs * length y \<longrightarrow> vec_vec_Tensor zs y ! 0 = zs ! 0 * y ! 0

goal (1 subgoal):
 1. length y = i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
with  4 5 8
[PROOF STATE]
proof (chain)
picking this:
i = length y \<longrightarrow> (i < length (z # zs) * length y) = (0 < length zs * length y)
i = length y \<longrightarrow> (z # zs) ! (i div length y) = zs ! 0
0 mod length y = 0
0 < length zs * length y \<longrightarrow> vec_vec_Tensor zs y ! 0 = zs ! 0 * y ! 0
[PROOF STEP]
have "(i = length y)
                            \<longrightarrow> ((i < (length (z#zs))*(length y))
                                     \<longrightarrow> (((vec_vec_Tensor (zs) y)!0)
                                             = f ((zs)!0) (y!0)))"
[PROOF STATE]
proof (prove)
using this:
i = length y \<longrightarrow> (i < length (z # zs) * length y) = (0 < length zs * length y)
i = length y \<longrightarrow> (z # zs) ! (i div length y) = zs ! 0
0 mod length y = 0
0 < length zs * length y \<longrightarrow> vec_vec_Tensor zs y ! 0 = zs ! 0 * y ! 0

goal (1 subgoal):
 1. i = length y \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor zs y ! 0 = zs ! 0 * y ! 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i = length y \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor zs y ! 0 = zs ! 0 * y ! 0

goal (1 subgoal):
 1. length y = i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
with 1 2 5
[PROOF STATE]
proof (chain)
picking this:
i = length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = vec_vec_Tensor zs y ! 0
i = length y \<longrightarrow> i mod length y = 0
i = length y \<longrightarrow> (z # zs) ! (i div length y) = zs ! 0
i = length y \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor zs y ! 0 = zs ! 0 * y ! 0
[PROOF STEP]
have "(i = length y)
                             \<longrightarrow> ((i < (length (z#zs))*(length y))
                                 \<longrightarrow> (((vec_vec_Tensor ((z#zs)) y)!i)
                                            = f
                                                 ((z#zs)!(i div (length y)))
                                                 (y!(i mod (length y)))))"
[PROOF STATE]
proof (prove)
using this:
i = length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = vec_vec_Tensor zs y ! 0
i = length y \<longrightarrow> i mod length y = 0
i = length y \<longrightarrow> (z # zs) ! (i div length y) = zs ! 0
i = length y \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor zs y ! 0 = zs ! 0 * y ! 0

goal (1 subgoal):
 1. i = length y \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i = length y \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)

goal (1 subgoal):
 1. length y = i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i = length y \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
i = length y \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)

goal (1 subgoal):
 1. length y = i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length y = i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
length y = i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)

goal (1 subgoal):
 1. \<And>a x i. (\<And>i. i < length x * length y \<longrightarrow> vec_vec_Tensor x y ! i = x ! (i div length y) * y ! (i mod length y)) \<Longrightarrow> i < length (a # x) * length y \<longrightarrow> vec_vec_Tensor (a # x) y ! i = (a # x) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
with step2
[PROOF STATE]
proof (chain)
picking this:
length y < i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
length y = i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
have step4:
            "(i \<ge> (length y))
                      \<longrightarrow>  ((i < (length (z#zs))*(length y))
                       \<longrightarrow> (((vec_vec_Tensor ((z#zs)) y)!i)
                                    = f
                                         ((z#zs)!(i div (length y)))
                                         (y!(i mod (length y)))))"
[PROOF STATE]
proof (prove)
using this:
length y < i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
length y = i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)

goal (1 subgoal):
 1. length y \<le> i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length y \<le> i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)

goal (1 subgoal):
 1. \<And>a x i. (\<And>i. i < length x * length y \<longrightarrow> vec_vec_Tensor x y ! i = x ! (i div length y) * y ! (i mod length y)) \<Longrightarrow> i < length (a # x) * length y \<longrightarrow> vec_vec_Tensor (a # x) y ! i = (a # x) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
have "(i < (length y)) \<or> (i \<ge> (length y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < length y \<or> length y \<le> i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i < length y \<or> length y \<le> i

goal (1 subgoal):
 1. \<And>a x i. (\<And>i. i < length x * length y \<longrightarrow> vec_vec_Tensor x y ! i = x ! (i div length y) * y ! (i mod length y)) \<Longrightarrow> i < length (a # x) * length y \<longrightarrow> vec_vec_Tensor (a # x) y ! i = (a # x) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
with step1 step4
[PROOF STATE]
proof (chain)
picking this:
i < length y \<longrightarrow> i < length x * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
length y \<le> i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
i < length y \<or> length y \<le> i
[PROOF STEP]
have
            "((i < (length (z#zs))*(length y))
                       \<longrightarrow> (((vec_vec_Tensor ((z#zs)) y)!i)
                                = f
                                    ((z#zs)!(i div (length y)))
                                     (y!(i mod (length y)))))"
[PROOF STATE]
proof (prove)
using this:
i < length y \<longrightarrow> i < length x * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
length y \<le> i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
i < length y \<or> length y \<le> i

goal (1 subgoal):
 1. i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
using logic
[PROOF STATE]
proof (prove)
using this:
i < length y \<longrightarrow> i < length x * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
length y \<le> i \<longrightarrow> i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
i < length y \<or> length y \<le> i
\<lbrakk>?A \<longrightarrow> ?B; \<not> ?A \<longrightarrow> ?B\<rbrakk> \<Longrightarrow> ?B

goal (1 subgoal):
 1. i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
by (metis "6" "7" 35)
[PROOF STATE]
proof (state)
this:
i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)

goal (1 subgoal):
 1. \<And>a x i. (\<And>i. i < length x * length y \<longrightarrow> vec_vec_Tensor x y ! i = x ! (i div length y) * y ! (i mod length y)) \<Longrightarrow> i < length (a # x) * length y \<longrightarrow> vec_vec_Tensor (a # x) y ! i = (a # x) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)

goal (1 subgoal):
 1. i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i < length (z # zs) * length y \<longrightarrow> vec_vec_Tensor (z # zs) y ! i = (z # zs) ! (i div length y) * y ! (i mod length y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lemma_NBseq_def: "(\<exists>K > 0. \<forall>n. norm (X n) \<le> K) \<longleftrightarrow> (\<exists>N. \<forall>n. norm (X n) \<le> real(Suc N))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>K>0. \<forall>n. norm (X n) \<le> K) = (\<exists>N. \<forall>n. norm (X n) \<le> real (Suc N))
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>K. \<lbrakk>0 < K; \<forall>n. norm (X n) \<le> K\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n. norm (X n) \<le> real (Suc N)
 2. \<And>N. \<forall>n. norm (X n) \<le> real (Suc N) \<Longrightarrow> \<exists>K>0. \<forall>n. norm (X n) \<le> K
[PROOF STEP]
fix K :: real
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>K. \<lbrakk>0 < K; \<forall>n. norm (X n) \<le> K\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n. norm (X n) \<le> real (Suc N)
 2. \<And>N. \<forall>n. norm (X n) \<le> real (Suc N) \<Longrightarrow> \<exists>K>0. \<forall>n. norm (X n) \<le> K
[PROOF STEP]
from reals_Archimedean2
[PROOF STATE]
proof (chain)
picking this:
\<exists>n. ?x < of_nat n
[PROOF STEP]
obtain n :: nat where "K < real n"
[PROOF STATE]
proof (prove)
using this:
\<exists>n. ?x < of_nat n

goal (1 subgoal):
 1. (\<And>n. K < real n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
K < real n

goal (2 subgoals):
 1. \<And>K. \<lbrakk>0 < K; \<forall>n. norm (X n) \<le> K\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n. norm (X n) \<le> real (Suc N)
 2. \<And>N. \<forall>n. norm (X n) \<le> real (Suc N) \<Longrightarrow> \<exists>K>0. \<forall>n. norm (X n) \<le> K
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
K < real n
[PROOF STEP]
have "K \<le> real (Suc n)"
[PROOF STATE]
proof (prove)
using this:
K < real n

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

goal (2 subgoals):
 1. \<And>K. \<lbrakk>0 < K; \<forall>n. norm (X n) \<le> K\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n. norm (X n) \<le> real (Suc N)
 2. \<And>N. \<forall>n. norm (X n) \<le> real (Suc N) \<Longrightarrow> \<exists>K>0. \<forall>n. norm (X n) \<le> K
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
K \<le> real (Suc n)

goal (2 subgoals):
 1. \<And>K. \<lbrakk>0 < K; \<forall>n. norm (X n) \<le> K\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n. norm (X n) \<le> real (Suc N)
 2. \<And>N. \<forall>n. norm (X n) \<le> real (Suc N) \<Longrightarrow> \<exists>K>0. \<forall>n. norm (X n) \<le> K
[PROOF STEP]
assume "\<forall>m. norm (X m) \<le> K"
[PROOF STATE]
proof (state)
this:
\<forall>m. norm (X m) \<le> K

goal (2 subgoals):
 1. \<And>K. \<lbrakk>0 < K; \<forall>n. norm (X n) \<le> K\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n. norm (X n) \<le> real (Suc N)
 2. \<And>N. \<forall>n. norm (X n) \<le> real (Suc N) \<Longrightarrow> \<exists>K>0. \<forall>n. norm (X n) \<le> K
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
K \<le> real (Suc n)
\<forall>m. norm (X m) \<le> K
[PROOF STEP]
have "\<forall>m. norm (X m) \<le> real (Suc n)"
[PROOF STATE]
proof (prove)
using this:
K \<le> real (Suc n)
\<forall>m. norm (X m) \<le> K

goal (1 subgoal):
 1. \<forall>m. norm (X m) \<le> real (Suc n)
[PROOF STEP]
by (blast intro: order_trans)
[PROOF STATE]
proof (state)
this:
\<forall>m. norm (X m) \<le> real (Suc n)

goal (2 subgoals):
 1. \<And>K. \<lbrakk>0 < K; \<forall>n. norm (X n) \<le> K\<rbrakk> \<Longrightarrow> \<exists>N. \<forall>n. norm (X n) \<le> real (Suc N)
 2. \<And>N. \<forall>n. norm (X n) \<le> real (Suc N) \<Longrightarrow> \<exists>K>0. \<forall>n. norm (X n) \<le> K
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>m. norm (X m) \<le> real (Suc n)
[PROOF STEP]
show "\<exists>N. \<forall>n. norm (X n) \<le> real (Suc N)"
[PROOF STATE]
proof (prove)
using this:
\<forall>m. norm (X m) \<le> real (Suc n)

goal (1 subgoal):
 1. \<exists>N. \<forall>n. norm (X n) \<le> real (Suc N)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<exists>N. \<forall>n. norm (X n) \<le> real (Suc N)

goal (1 subgoal):
 1. \<And>N. \<forall>n. norm (X n) \<le> real (Suc N) \<Longrightarrow> \<exists>K>0. \<forall>n. norm (X n) \<le> K
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>N. \<forall>n. norm (X n) \<le> real (Suc N) \<Longrightarrow> \<exists>K>0. \<forall>n. norm (X n) \<le> K
[PROOF STEP]
show "\<And>N. \<forall>n. norm (X n) \<le> real (Suc N) \<Longrightarrow> \<exists>K>0. \<forall>n. norm (X n) \<le> K"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>N. \<forall>n. norm (X n) \<le> real (Suc N) \<Longrightarrow> \<exists>K>0. \<forall>n. norm (X n) \<le> K
[PROOF STEP]
using of_nat_0_less_iff
[PROOF STATE]
proof (prove)
using this:
((0::?'a) < of_nat ?n) = (0 < ?n)

goal (1 subgoal):
 1. \<And>N. \<forall>n. norm (X n) \<le> real (Suc N) \<Longrightarrow> \<exists>K>0. \<forall>n. norm (X n) \<le> K
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>n. norm (X n) \<le> real (Suc ?N) \<Longrightarrow> \<exists>K>0. \<forall>n. norm (X n) \<le> K

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma size_mset_sum_mset_distrib: "size (sum_mset A :: 'a multiset) = sum_mset (image_mset size A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size (\<Sum>\<^sub># A) = \<Sum>\<^sub># (image_mset size A)
[PROOF STEP]
by (induction A) auto


[STATEMENT]
lemma filterlim_at_infinity:
  fixes f :: "_ \<Rightarrow> 'a::real_normed_vector"
  assumes "0 \<le> c"
  shows "(LIM x F. f x :> at_infinity) \<longleftrightarrow> (\<forall>r>c. eventually (\<lambda>x. r \<le> norm (f x)) F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filterlim f at_infinity F = (\<forall>r>c. \<forall>\<^sub>F x in F. r \<le> norm (f x))
[PROOF STEP]
unfolding filterlim_iff eventually_at_infinity
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>P. (\<exists>b. \<forall>x. b \<le> norm x \<longrightarrow> P x) \<longrightarrow> (\<forall>\<^sub>F x in F. P (f x))) = (\<forall>r>c. \<forall>\<^sub>F x in F. r \<le> norm (f x))
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>r. \<lbrakk>\<forall>P. (\<exists>b. \<forall>x. b \<le> norm x \<longrightarrow> P x) \<longrightarrow> (\<forall>\<^sub>F x in F. P (f x)); c < r\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. r \<le> norm (f x)
 2. \<And>P b. \<lbrakk>\<forall>r>c. \<forall>\<^sub>F x in F. r \<le> norm (f x); \<forall>x. b \<le> norm x \<longrightarrow> P x\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. P (f x)
[PROOF STEP]
fix P :: "'a \<Rightarrow> bool"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>r. \<lbrakk>\<forall>P. (\<exists>b. \<forall>x. b \<le> norm x \<longrightarrow> P x) \<longrightarrow> (\<forall>\<^sub>F x in F. P (f x)); c < r\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. r \<le> norm (f x)
 2. \<And>P b. \<lbrakk>\<forall>r>c. \<forall>\<^sub>F x in F. r \<le> norm (f x); \<forall>x. b \<le> norm x \<longrightarrow> P x\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. P (f x)
[PROOF STEP]
fix b
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>r. \<lbrakk>\<forall>P. (\<exists>b. \<forall>x. b \<le> norm x \<longrightarrow> P x) \<longrightarrow> (\<forall>\<^sub>F x in F. P (f x)); c < r\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. r \<le> norm (f x)
 2. \<And>P b. \<lbrakk>\<forall>r>c. \<forall>\<^sub>F x in F. r \<le> norm (f x); \<forall>x. b \<le> norm x \<longrightarrow> P x\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. P (f x)
[PROOF STEP]
assume *: "\<forall>r>c. eventually (\<lambda>x. r \<le> norm (f x)) F"
[PROOF STATE]
proof (state)
this:
\<forall>r>c. \<forall>\<^sub>F x in F. r \<le> norm (f x)

goal (2 subgoals):
 1. \<And>r. \<lbrakk>\<forall>P. (\<exists>b. \<forall>x. b \<le> norm x \<longrightarrow> P x) \<longrightarrow> (\<forall>\<^sub>F x in F. P (f x)); c < r\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. r \<le> norm (f x)
 2. \<And>P b. \<lbrakk>\<forall>r>c. \<forall>\<^sub>F x in F. r \<le> norm (f x); \<forall>x. b \<le> norm x \<longrightarrow> P x\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. P (f x)
[PROOF STEP]
assume P: "\<forall>x. b \<le> norm x \<longrightarrow> P x"
[PROOF STATE]
proof (state)
this:
\<forall>x. b \<le> norm x \<longrightarrow> P x

goal (2 subgoals):
 1. \<And>r. \<lbrakk>\<forall>P. (\<exists>b. \<forall>x. b \<le> norm x \<longrightarrow> P x) \<longrightarrow> (\<forall>\<^sub>F x in F. P (f x)); c < r\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. r \<le> norm (f x)
 2. \<And>P b. \<lbrakk>\<forall>r>c. \<forall>\<^sub>F x in F. r \<le> norm (f x); \<forall>x. b \<le> norm x \<longrightarrow> P x\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. P (f x)
[PROOF STEP]
have "max b (c + 1) > c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c < max b (c + 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c < max b (c + 1)

goal (2 subgoals):
 1. \<And>r. \<lbrakk>\<forall>P. (\<exists>b. \<forall>x. b \<le> norm x \<longrightarrow> P x) \<longrightarrow> (\<forall>\<^sub>F x in F. P (f x)); c < r\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. r \<le> norm (f x)
 2. \<And>P b. \<lbrakk>\<forall>r>c. \<forall>\<^sub>F x in F. r \<le> norm (f x); \<forall>x. b \<le> norm x \<longrightarrow> P x\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. P (f x)
[PROOF STEP]
with *
[PROOF STATE]
proof (chain)
picking this:
\<forall>r>c. \<forall>\<^sub>F x in F. r \<le> norm (f x)
c < max b (c + 1)
[PROOF STEP]
have "eventually (\<lambda>x. max b (c + 1) \<le> norm (f x)) F"
[PROOF STATE]
proof (prove)
using this:
\<forall>r>c. \<forall>\<^sub>F x in F. r \<le> norm (f x)
c < max b (c + 1)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. max b (c + 1) \<le> norm (f x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. max b (c + 1) \<le> norm (f x)

goal (2 subgoals):
 1. \<And>r. \<lbrakk>\<forall>P. (\<exists>b. \<forall>x. b \<le> norm x \<longrightarrow> P x) \<longrightarrow> (\<forall>\<^sub>F x in F. P (f x)); c < r\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. r \<le> norm (f x)
 2. \<And>P b. \<lbrakk>\<forall>r>c. \<forall>\<^sub>F x in F. r \<le> norm (f x); \<forall>x. b \<le> norm x \<longrightarrow> P x\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. P (f x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in F. max b (c + 1) \<le> norm (f x)
[PROOF STEP]
show "eventually (\<lambda>x. P (f x)) F"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. max b (c + 1) \<le> norm (f x)

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. P (f x)
[PROOF STEP]
proof eventually_elim
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. max b (c + 1) \<le> norm (f x) \<Longrightarrow> P (f x)
[PROOF STEP]
case (elim x)
[PROOF STATE]
proof (state)
this:
max b (c + 1) \<le> norm (f x)

goal (1 subgoal):
 1. \<And>x. max b (c + 1) \<le> norm (f x) \<Longrightarrow> P (f x)
[PROOF STEP]
with P
[PROOF STATE]
proof (chain)
picking this:
\<forall>x. b \<le> norm x \<longrightarrow> P x
max b (c + 1) \<le> norm (f x)
[PROOF STEP]
show "P (f x)"
[PROOF STATE]
proof (prove)
using this:
\<forall>x. b \<le> norm x \<longrightarrow> P x
max b (c + 1) \<le> norm (f x)

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. P (f x)

goal (1 subgoal):
 1. \<And>r. \<lbrakk>\<forall>P. (\<exists>b. \<forall>x. b \<le> norm x \<longrightarrow> P x) \<longrightarrow> (\<forall>\<^sub>F x in F. P (f x)); c < r\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. r \<le> norm (f x)
[PROOF STEP]
qed force


[STATEMENT]
lemma map_sq_matrix_add:
  "(\<And>a b. f (a + b) = f a + f b) \<Longrightarrow> map_sq_matrix f (A + B) = map_sq_matrix f A + map_sq_matrix f B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a b. f (a + b) = f a + f b) \<Longrightarrow> map_sq_matrix f (A + B) = map_sq_matrix f A + map_sq_matrix f B
[PROOF STEP]
by transfer simp


[STATEMENT]
lemma mult_matrix_n_zero_right[simp]: "\<lbrakk>fadd 0 0 = 0; \<forall>a. fmul a 0 = 0\<rbrakk> \<Longrightarrow> mult_matrix_n n fmul fadd A 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'c) = (0::'a)\<rbrakk> \<Longrightarrow> mult_matrix_n n fmul fadd A 0 = 0
[PROOF STEP]
apply (simp add: mult_matrix_n_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'c) = (0::'a)\<rbrakk> \<Longrightarrow> Abs_matrix (\<lambda>j i. foldseq fadd (\<lambda>k. 0::'a) n) = 0
[PROOF STEP]
apply (subst foldseq_zero)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'c) = (0::'a)\<rbrakk> \<Longrightarrow> fadd (0::'a) (0::'a) = (0::'a)
 2. \<And>i j. \<lbrakk>fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'c) = (0::'a)\<rbrakk> \<Longrightarrow> \<forall>i\<le>n. (0::'a) = (0::'a)
 3. \<lbrakk>fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'c) = (0::'a)\<rbrakk> \<Longrightarrow> Abs_matrix (\<lambda>j i. 0::'a) = 0
[PROOF STEP]
by (simp_all add: zero_matrix_def)


[STATEMENT]
lemma distinct_conv_pairs: "distinct xs \<longleftrightarrow> list_all (\<lambda>(x,y). x \<noteq> y) (pairs xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct xs = list_all (\<lambda>(x, y). x \<noteq> y) (pairs xs)
[PROOF STEP]
by (induction xs) (auto simp: list_all_iff)


[STATEMENT]
lemma vifunion_vsingleton_family[simp]: "(\<Union>\<^sub>\<circ>i\<in>\<^sub>\<circ>I. set {i}) = I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union>\<^sub>\<circ> ((\<lambda>a\<in>\<^sub>\<circ>I. set {a}) `\<^sub>\<circ> I) = I
[PROOF STEP]
by force


[STATEMENT]
lemma bst_baliL:
  "\<lbrakk>bst l; bst r; \<forall>x\<in>set_tree l. x < a; \<forall>x\<in>set_tree r. a < x\<rbrakk>
   \<Longrightarrow> bst (baliL l a r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Tree2.bst l; Tree2.bst r; \<forall>x\<in>Tree2.set_tree l. x < a; \<forall>x\<in>Tree2.set_tree r. a < x\<rbrakk> \<Longrightarrow> Tree2.bst (baliL l a r)
[PROOF STEP]
by(cases "(l,a,r)" rule: baliL.cases) (auto simp: ball_Un)


[STATEMENT]
lemma decrease[termination_simp]: "\<not> j \<le> 1 \<Longrightarrow> odd j \<Longrightarrow> Suc (j div 2) < j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<not> j \<le> 1; odd j\<rbrakk> \<Longrightarrow> Suc (j div 2) < j
[PROOF STEP]
by presburger


[STATEMENT]
lemma Not_eq_iff [simp]: "Not x1 = Not x2 \<longleftrightarrow> x1 = x2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (FL_Formula.Not x1 = FL_Formula.Not x2) = (x1 = x2)
[PROOF STEP]
by (metis Not.rep_eq Not\<^sub>\<alpha>_eq_iff Rep_formula_inverse)


[STATEMENT]
lemma lim_ln_over_n [tendsto_intros]: "((\<lambda>n. ln(real_of_nat n) / of_nat n) \<longlongrightarrow> 0) sequentially"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. ln (real n) / real n) \<longlonglongrightarrow> 0
[PROOF STEP]
using lim_ln_over_power [of 1]
[PROOF STATE]
proof (prove)
using this:
0 < 1 \<Longrightarrow> (\<lambda>n. ln (real n) / real n powr 1) \<longlonglongrightarrow> 0

goal (1 subgoal):
 1. (\<lambda>n. ln (real n) / real n) \<longlonglongrightarrow> 0
[PROOF STEP]
by auto


[STATEMENT]
lemma linear_order_from_list_position_total:
  "total_on (set xs) (set (linear_order_from_list_position xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. total_on (set xs) (set (linear_order_from_list_position xs))
[PROOF STEP]
unfolding linear_order_from_list_position_set
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. total_on (set xs) (set (map (\<lambda>x. (x, x)) xs) \<union> set (non_sym_dist_pairs xs))
[PROOF STEP]
using non_sym_dist_pairs_elems[of _ xs]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<in> set xs; ?y \<in> set xs; ?x \<noteq> ?y\<rbrakk> \<Longrightarrow> (?x, ?y) \<in> set (non_sym_dist_pairs xs) \<or> (?y, ?x) \<in> set (non_sym_dist_pairs xs)

goal (1 subgoal):
 1. total_on (set xs) (set (map (\<lambda>x. (x, x)) xs) \<union> set (non_sym_dist_pairs xs))
[PROOF STEP]
by (meson UnI2 total_onI)


[STATEMENT]
lemma closed_mdpc_SupI: "(\<And>a. a \<in> A \<Longrightarrow> closed_mdpc a) \<Longrightarrow> closed_mdpc (\<Squnion>A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a. a \<in> A \<Longrightarrow> closed_mdpc a) \<Longrightarrow> closed_mdpc (\<Squnion> A)
[PROOF STEP]
by (auto simp: closed_mdpc_def)


[STATEMENT]
lemma card_of_infinite_diff_finite:
assumes "\<not>finite A" and "finite B"
shows "|A - B| =o |A|"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |A - B| =o |A|
[PROOF STEP]
by (metis assms card_of_Un_diff_infinite finite_ordLess_infinite2)


[STATEMENT]
lemma moebius_pt_moebius_rotation_zero_iff [simp]:
  shows "moebius_pt (moebius_rotation \<phi>) x = 0\<^sub>h \<longleftrightarrow> x = 0\<^sub>h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (moebius_pt (moebius_rotation \<phi>) x = 0\<^sub>h) = (x = 0\<^sub>h)
[PROOF STEP]
using moebius_pt_invert[of "moebius_rotation \<phi>" x "0\<^sub>h"]
[PROOF STATE]
proof (prove)
using this:
moebius_pt (moebius_rotation \<phi>) x = 0\<^sub>h \<Longrightarrow> moebius_pt (moebius_inv (moebius_rotation \<phi>)) 0\<^sub>h = x

goal (1 subgoal):
 1. (moebius_pt (moebius_rotation \<phi>) x = 0\<^sub>h) = (x = 0\<^sub>h)
[PROOF STEP]
by auto


[STATEMENT]
lemma d_def: "d = (\<Sum>t = 0..q. (2^c - 1) * b^t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d = (\<Sum>t = 0..q. (2 ^ c - 1) * b ^ t)
[PROOF STEP]
using c_eq
[PROOF STATE]
proof (prove)
using this:
rm_constants q c b d e f a

goal (1 subgoal):
 1. d = (\<Sum>t = 0..q. (2 ^ c - 1) * b ^ t)
[PROOF STEP]
by (simp add: D_def rm_constants_def)