[STATEMENT]
theorem vec_mat_Tensor_elements:
 "\<forall>i.\<forall>j.
  (((i<((length v)*(row_length M)))
  \<and>(j < (length M)))
  \<and>(mat (row_length M) (length M) M)
   \<longrightarrow> ((vec_mat_Tensor v M)!j!i)
               = f (v!(i div (row_length M))) (M!j!(i mod (row_length M))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i j. (i < length v * row_length M \<and> j < length M) \<and> mat (row_length M) (length M) M \<longrightarrow> vec_mat_Tensor v M ! j ! i = v ! (i div row_length M) * M ! j ! (i mod row_length M)
[PROOF STEP]
apply(rule allI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. \<forall>j. (i < length v * row_length M \<and> j < length M) \<and> mat (row_length M) (length M) M \<longrightarrow> vec_mat_Tensor v M ! j ! i = v ! (i div row_length M) * M ! j ! (i mod row_length M)
[PROOF STEP]
apply(rule allI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i j. (i < length v * row_length M \<and> j < length M) \<and> mat (row_length M) (length M) M \<longrightarrow> vec_mat_Tensor v M ! j ! i = v ! (i div row_length M) * M ! j ! (i mod row_length M)
[PROOF STEP]
proof(induct M)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i j. (i < length v * row_length [] \<and> j < length []) \<and> mat (row_length []) (length []) [] \<longrightarrow> vec_mat_Tensor v [] ! j ! i = v ! (i div row_length []) * [] ! j ! (i mod row_length [])
 2. \<And>a M i j. (\<And>i j. (i < length v * row_length M \<and> j < length M) \<and> mat (row_length M) (length M) M \<longrightarrow> vec_mat_Tensor v M ! j ! i = v ! (i div row_length M) * M ! j ! (i mod row_length M)) \<Longrightarrow> (i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>i j. (i < length v * row_length [] \<and> j < length []) \<and> mat (row_length []) (length []) [] \<longrightarrow> vec_mat_Tensor v [] ! j ! i = v ! (i div row_length []) * [] ! j ! (i mod row_length [])
 2. \<And>a M i j. (\<And>i j. (i < length v * row_length M \<and> j < length M) \<and> mat (row_length M) (length M) M \<longrightarrow> vec_mat_Tensor v M ! j ! i = v ! (i div row_length M) * M ! j ! (i mod row_length M)) \<Longrightarrow> (i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
have "row_length [] = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row_length [] = 0
[PROOF STEP]
using row_length_def
[PROOF STATE]
proof (prove)
using this:
row_length ?xs \<equiv> if ?xs = [] then 0 else length (hd ?xs)

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

goal (2 subgoals):
 1. \<And>i j. (i < length v * row_length [] \<and> j < length []) \<and> mat (row_length []) (length []) [] \<longrightarrow> vec_mat_Tensor v [] ! j ! i = v ! (i div row_length []) * [] ! j ! (i mod row_length [])
 2. \<And>a M i j. (\<And>i j. (i < length v * row_length M \<and> j < length M) \<and> mat (row_length M) (length M) M \<longrightarrow> vec_mat_Tensor v M ! j ! i = v ! (i div row_length M) * M ! j ! (i mod row_length M)) \<Longrightarrow> (i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
row_length [] = 0
[PROOF STEP]
have "(length v)*(row_length []) = 0"
[PROOF STATE]
proof (prove)
using this:
row_length [] = 0

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

goal (2 subgoals):
 1. \<And>i j. (i < length v * row_length [] \<and> j < length []) \<and> mat (row_length []) (length []) [] \<longrightarrow> vec_mat_Tensor v [] ! j ! i = v ! (i div row_length []) * [] ! j ! (i mod row_length [])
 2. \<And>a M i j. (\<And>i j. (i < length v * row_length M \<and> j < length M) \<and> mat (row_length M) (length M) M \<longrightarrow> vec_mat_Tensor v M ! j ! i = v ! (i div row_length M) * M ! j ! (i mod row_length M)) \<Longrightarrow> (i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
length v * row_length [] = 0
[PROOF STEP]
have "((i<((length v)*(row_length [])))\<and>(j < (length []))) \<longrightarrow> False"
[PROOF STATE]
proof (prove)
using this:
length v * row_length [] = 0

goal (1 subgoal):
 1. i < length v * row_length [] \<and> j < length [] \<longrightarrow> False
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i < length v * row_length [] \<and> j < length [] \<longrightarrow> False

goal (2 subgoals):
 1. \<And>i j. (i < length v * row_length [] \<and> j < length []) \<and> mat (row_length []) (length []) [] \<longrightarrow> vec_mat_Tensor v [] ! j ! i = v ! (i div row_length []) * [] ! j ! (i mod row_length [])
 2. \<And>a M i j. (\<And>i j. (i < length v * row_length M \<and> j < length M) \<and> mat (row_length M) (length M) M \<longrightarrow> vec_mat_Tensor v M ! j ! i = v ! (i div row_length M) * M ! j ! (i mod row_length M)) \<Longrightarrow> (i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
i < length v * row_length [] \<and> j < length [] \<longrightarrow> False

goal (2 subgoals):
 1. \<And>i j. (i < length v * row_length [] \<and> j < length []) \<and> mat (row_length []) (length []) [] \<longrightarrow> vec_mat_Tensor v [] ! j ! i = v ! (i div row_length []) * [] ! j ! (i mod row_length [])
 2. \<And>a M i j. (\<And>i j. (i < length v * row_length M \<and> j < length M) \<and> mat (row_length M) (length M) M \<longrightarrow> vec_mat_Tensor v M ! j ! i = v ! (i div row_length M) * M ! j ! (i mod row_length M)) \<Longrightarrow> (i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
have "vec_mat_Tensor v [] = []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_mat_Tensor v [] = []
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vec_mat_Tensor v [] = []

goal (2 subgoals):
 1. \<And>i j. (i < length v * row_length [] \<and> j < length []) \<and> mat (row_length []) (length []) [] \<longrightarrow> vec_mat_Tensor v [] ! j ! i = v ! (i div row_length []) * [] ! j ! (i mod row_length [])
 2. \<And>a M i j. (\<And>i j. (i < length v * row_length M \<and> j < length M) \<and> mat (row_length M) (length M) M \<longrightarrow> vec_mat_Tensor v M ! j ! i = v ! (i div row_length M) * M ! j ! (i mod row_length M)) \<Longrightarrow> (i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
vec_mat_Tensor v [] = []

goal (2 subgoals):
 1. \<And>i j. (i < length v * row_length [] \<and> j < length []) \<and> mat (row_length []) (length []) [] \<longrightarrow> vec_mat_Tensor v [] ! j ! i = v ! (i div row_length []) * [] ! j ! (i mod row_length [])
 2. \<And>a M i j. (\<And>i j. (i < length v * row_length M \<and> j < length M) \<and> mat (row_length M) (length M) M \<longrightarrow> vec_mat_Tensor v M ! j ! i = v ! (i div row_length M) * M ! j ! (i mod row_length M)) \<Longrightarrow> (i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
have "(((i<((length v)*(row_length [])))\<and>(j < (length [])))
                  \<longrightarrow> ((vec_mat_Tensor v [])!j!i)
                                = f (v!(i div (row_length []))) ([]!j!(i mod (row_length []))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < length v * row_length [] \<and> j < length [] \<longrightarrow> vec_mat_Tensor v [] ! j ! i = v ! (i div row_length []) * [] ! j ! (i mod row_length [])
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i < length v * row_length [] \<and> j < length [] \<longrightarrow> vec_mat_Tensor v [] ! j ! i = v ! (i div row_length []) * [] ! j ! (i mod row_length [])

goal (2 subgoals):
 1. \<And>i j. (i < length v * row_length [] \<and> j < length []) \<and> mat (row_length []) (length []) [] \<longrightarrow> vec_mat_Tensor v [] ! j ! i = v ! (i div row_length []) * [] ! j ! (i mod row_length [])
 2. \<And>a M i j. (\<And>i j. (i < length v * row_length M \<and> j < length M) \<and> mat (row_length M) (length M) M \<longrightarrow> vec_mat_Tensor v M ! j ! i = v ! (i div row_length M) * M ! j ! (i mod row_length M)) \<Longrightarrow> (i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
i < length v * row_length [] \<and> j < length [] \<longrightarrow> vec_mat_Tensor v [] ! j ! i = v ! (i div row_length []) * [] ! j ! (i mod row_length [])
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
i < length v * row_length [] \<and> j < length [] \<longrightarrow> vec_mat_Tensor v [] ! j ! i = v ! (i div row_length []) * [] ! j ! (i mod row_length [])

goal (1 subgoal):
 1. (i < length v * row_length [] \<and> j < length []) \<and> mat (row_length []) (length []) [] \<longrightarrow> vec_mat_Tensor v [] ! j ! i = v ! (i div row_length []) * [] ! j ! (i mod row_length [])
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(i < length v * row_length [] \<and> j < length []) \<and> mat (row_length []) (length []) [] \<longrightarrow> vec_mat_Tensor v [] ! j ! i = v ! (i div row_length []) * [] ! j ! (i mod row_length [])

goal (1 subgoal):
 1. \<And>a M i j. (\<And>i j. (i < length v * row_length M \<and> j < length M) \<and> mat (row_length M) (length M) M \<longrightarrow> vec_mat_Tensor v M ! j ! i = v ! (i div row_length M) * M ! j ! (i mod row_length M)) \<Longrightarrow> (i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a M i j. (\<And>i j. (i < length v * row_length M \<and> j < length M) \<and> mat (row_length M) (length M) M \<longrightarrow> vec_mat_Tensor v M ! j ! i = v ! (i div row_length M) * M ! j ! (i mod row_length M)) \<Longrightarrow> (i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
case (Cons a M)
[PROOF STATE]
proof (state)
this:
(?i < length v * row_length M \<and> ?j < length M) \<and> mat (row_length M) (length M) M \<longrightarrow> vec_mat_Tensor v M ! ?j ! ?i = v ! (?i div row_length M) * M ! ?j ! (?i mod row_length M)

goal (1 subgoal):
 1. \<And>a M i j. (\<And>i j. (i < length v * row_length M \<and> j < length M) \<and> mat (row_length M) (length M) M \<longrightarrow> vec_mat_Tensor v M ! j ! i = v ! (i div row_length M) * M ! j ! (i mod row_length M)) \<Longrightarrow> (i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
have "(((i<((length v)*(row_length (a#M))))
       \<and>(j < (length (a#M))))
       \<and>(mat (row_length (a#M)) (length (a#M)) (a#M))
           \<longrightarrow> ((vec_mat_Tensor v (a#M))!j!i)
                  = f
                      (v!(i div (row_length (a#M))))
                      ((a#M)!j!(i mod (row_length (a#M)))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
proof(cases a)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a = [] \<Longrightarrow> (i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
 2. \<And>aa list. a = aa # list \<Longrightarrow> (i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
a = []

goal (2 subgoals):
 1. a = [] \<Longrightarrow> (i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
 2. \<And>aa list. a = aa # list \<Longrightarrow> (i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
have "row_length ([]#M) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row_length ([] # M) = 0
[PROOF STEP]
using row_length_def
[PROOF STATE]
proof (prove)
using this:
row_length ?xs \<equiv> if ?xs = [] then 0 else length (hd ?xs)

goal (1 subgoal):
 1. row_length ([] # M) = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
row_length ([] # M) = 0

goal (2 subgoals):
 1. a = [] \<Longrightarrow> (i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
 2. \<And>aa list. a = aa # list \<Longrightarrow> (i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
row_length ([] # M) = 0
[PROOF STEP]
have 1:"(length v)*(row_length ([]#M)) = 0"
[PROOF STATE]
proof (prove)
using this:
row_length ([] # M) = 0

goal (1 subgoal):
 1. length v * row_length ([] # M) = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length v * row_length ([] # M) = 0

goal (2 subgoals):
 1. a = [] \<Longrightarrow> (i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
 2. \<And>aa list. a = aa # list \<Longrightarrow> (i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
length v * row_length ([] # M) = 0
[PROOF STEP]
have "((i<((length v)*(row_length ([]#M))))
                \<and>(j < (length ([]#M)))) \<longrightarrow> False"
[PROOF STATE]
proof (prove)
using this:
length v * row_length ([] # M) = 0

goal (1 subgoal):
 1. i < length v * row_length ([] # M) \<and> j < length ([] # M) \<longrightarrow> False
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i < length v * row_length ([] # M) \<and> j < length ([] # M) \<longrightarrow> False

goal (2 subgoals):
 1. a = [] \<Longrightarrow> (i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
 2. \<And>aa list. a = aa # list \<Longrightarrow> (i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
i < length v * row_length ([] # M) \<and> j < length ([] # M) \<longrightarrow> False

goal (2 subgoals):
 1. a = [] \<Longrightarrow> (i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
 2. \<And>aa list. a = aa # list \<Longrightarrow> (i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
have
                 "(((i<((length v)*(row_length ([]#M))))
                  \<and>(j < (length ([]#M))))
                     \<longrightarrow> ((vec_mat_Tensor v ([]#M))!j!i) =
                                   f
                                        (v!(i div (row_length ([]#M))))
                                        ([]!j!(i mod (row_length ([]#M)))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < length v * row_length ([] # M) \<and> j < length ([] # M) \<longrightarrow> vec_mat_Tensor v ([] # M) ! j ! i = v ! (i div row_length ([] # M)) * [] ! j ! (i mod row_length ([] # M))
[PROOF STEP]
using calculation
[PROOF STATE]
proof (prove)
using this:
i < length v * row_length ([] # M) \<and> j < length ([] # M) \<longrightarrow> False

goal (1 subgoal):
 1. i < length v * row_length ([] # M) \<and> j < length ([] # M) \<longrightarrow> vec_mat_Tensor v ([] # M) ! j ! i = v ! (i div row_length ([] # M)) * [] ! j ! (i mod row_length ([] # M))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i < length v * row_length ([] # M) \<and> j < length ([] # M) \<longrightarrow> vec_mat_Tensor v ([] # M) ! j ! i = v ! (i div row_length ([] # M)) * [] ! j ! (i mod row_length ([] # M))

goal (2 subgoals):
 1. a = [] \<Longrightarrow> (i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
 2. \<And>aa list. a = aa # list \<Longrightarrow> (i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i < length v * row_length ([] # M) \<and> j < length ([] # M) \<longrightarrow> vec_mat_Tensor v ([] # M) ! j ! i = v ! (i div row_length ([] # M)) * [] ! j ! (i mod row_length ([] # M))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
i < length v * row_length ([] # M) \<and> j < length ([] # M) \<longrightarrow> vec_mat_Tensor v ([] # M) ! j ! i = v ! (i div row_length ([] # M)) * [] ! j ! (i mod row_length ([] # M))

goal (1 subgoal):
 1. (i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
using Nil 1 less_nat_zero_code
[PROOF STATE]
proof (prove)
using this:
i < length v * row_length ([] # M) \<and> j < length ([] # M) \<longrightarrow> vec_mat_Tensor v ([] # M) ! j ! i = v ! (i div row_length ([] # M)) * [] ! j ! (i mod row_length ([] # M))
a = []
length v * row_length ([] # M) = 0
(?n < 0) = False

goal (1 subgoal):
 1. (i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
by (metis )
[PROOF STATE]
proof (state)
this:
(i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))

goal (1 subgoal):
 1. \<And>aa list. a = aa # list \<Longrightarrow> (i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>aa list. a = aa # list \<Longrightarrow> (i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
case (Cons x xs)
[PROOF STATE]
proof (state)
this:
a = x # xs

goal (1 subgoal):
 1. \<And>aa list. a = aa # list \<Longrightarrow> (i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
have 1:"(a#M)!(j+1) = M!j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a # M) ! (j + 1) = M ! j
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(a # M) ! (j + 1) = M ! j

goal (1 subgoal):
 1. \<And>aa list. a = aa # list \<Longrightarrow> (i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
have "(((i<((length v)*(row_length M)))
           \<and>(j < (length M)))
           \<and>(mat (row_length M) (length M) M)
             \<longrightarrow> ((vec_mat_Tensor v M)!j!i) = f
                                               (v!(i div (row_length M)))
                                               (M!j!(i mod (row_length M))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (i < length v * row_length M \<and> j < length M) \<and> mat (row_length M) (length M) M \<longrightarrow> vec_mat_Tensor v M ! j ! i = v ! (i div row_length M) * M ! j ! (i mod row_length M)
[PROOF STEP]
using Cons.hyps
[PROOF STATE]
proof (prove)
using this:
(?i < length v * row_length M \<and> ?j < length M) \<and> mat (row_length M) (length M) M \<longrightarrow> vec_mat_Tensor v M ! ?j ! ?i = v ! (?i div row_length M) * M ! ?j ! (?i mod row_length M)

goal (1 subgoal):
 1. (i < length v * row_length M \<and> j < length M) \<and> mat (row_length M) (length M) M \<longrightarrow> vec_mat_Tensor v M ! j ! i = v ! (i div row_length M) * M ! j ! (i mod row_length M)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(i < length v * row_length M \<and> j < length M) \<and> mat (row_length M) (length M) M \<longrightarrow> vec_mat_Tensor v M ! j ! i = v ! (i div row_length M) * M ! j ! (i mod row_length M)

goal (1 subgoal):
 1. \<And>aa list. a = aa # list \<Longrightarrow> (i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
have 2: "(row_length (a#M)) = (length a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row_length (a # M) = length a
[PROOF STEP]
using row_length_def
[PROOF STATE]
proof (prove)
using this:
row_length ?xs \<equiv> if ?xs = [] then 0 else length (hd ?xs)

goal (1 subgoal):
 1. row_length (a # M) = length a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
row_length (a # M) = length a

goal (1 subgoal):
 1. \<And>aa list. a = aa # list \<Longrightarrow> (i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
row_length (a # M) = length a
[PROOF STEP]
have 3:"(i< (row_length (a#M))*(length v))
                              = (i < (length a)*(length v))"
[PROOF STATE]
proof (prove)
using this:
row_length (a # M) = length a

goal (1 subgoal):
 1. (i < row_length (a # M) * length v) = (i < length a * length v)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(i < row_length (a # M) * length v) = (i < length a * length v)

goal (1 subgoal):
 1. \<And>aa list. a = aa # list \<Longrightarrow> (i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
have "a \<noteq> []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<noteq> []
[PROOF STEP]
using Cons
[PROOF STATE]
proof (prove)
using this:
a = x # xs

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

goal (1 subgoal):
 1. \<And>aa list. a = aa # list \<Longrightarrow> (i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<noteq> []
[PROOF STEP]
have 4:
         "\<forall>i.((i < (length a)*(length v))
              \<longrightarrow>  ((vec_vec_Tensor v a)!i) = f
                                               (v!(i div (length a)))
                                               (a!(i mod (length a))))"
[PROOF STATE]
proof (prove)
using this:
a \<noteq> []

goal (1 subgoal):
 1. \<forall>i<length a * length v. vec_vec_Tensor v a ! i = v ! (i div length a) * a ! (i mod length a)
[PROOF STEP]
using vec_vec_Tensor_elements Cons.hyps mult.commute
[PROOF STATE]
proof (prove)
using this:
a \<noteq> []
?y \<noteq> [] \<Longrightarrow> \<forall>i<length ?x * length ?y. vec_vec_Tensor ?x ?y ! i = ?x ! (i div length ?y) * ?y ! (i mod length ?y)
(?i < length v * row_length M \<and> ?j < length M) \<and> mat (row_length M) (length M) M \<longrightarrow> vec_mat_Tensor v M ! ?j ! ?i = v ! (?i div row_length M) * M ! ?j ! (?i mod row_length M)
?a * ?b = ?b * ?a

goal (1 subgoal):
 1. \<forall>i<length a * length v. vec_vec_Tensor v a ! i = v ! (i div length a) * a ! (i mod length a)
[PROOF STEP]
by (simp add: mult.commute vec_vec_Tensor_elements)
[PROOF STATE]
proof (state)
this:
\<forall>i<length a * length v. vec_vec_Tensor v a ! i = v ! (i div length a) * a ! (i mod length a)

goal (1 subgoal):
 1. \<And>aa list. a = aa # list \<Longrightarrow> (i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
have "(vec_mat_Tensor v (a#M))!0 = (vec_vec_Tensor v a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_mat_Tensor v (a # M) ! 0 = vec_vec_Tensor v a
[PROOF STEP]
using vec_mat_Tensor.simps(2)
[PROOF STATE]
proof (prove)
using this:
vec_mat_Tensor ?xs (?ys # ?yss) = vec_vec_Tensor ?xs ?ys # vec_mat_Tensor ?xs ?yss

goal (1 subgoal):
 1. vec_mat_Tensor v (a # M) ! 0 = vec_vec_Tensor v a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vec_mat_Tensor v (a # M) ! 0 = vec_vec_Tensor v a

goal (1 subgoal):
 1. \<And>aa list. a = aa # list \<Longrightarrow> (i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
with 2 4
[PROOF STATE]
proof (chain)
picking this:
row_length (a # M) = length a
\<forall>i<length a * length v. vec_vec_Tensor v a ! i = v ! (i div length a) * a ! (i mod length a)
vec_mat_Tensor v (a # M) ! 0 = vec_vec_Tensor v a
[PROOF STEP]
have 5:
       "\<forall>i.((i < (row_length (a#M))*(length v))
          \<longrightarrow>  ((vec_mat_Tensor v (a#M))!0!i)
                                   = f
                                       (v!(i div (row_length (a#M))))
                                       ((a#M)!0!(i mod (row_length (a#M)))))"
[PROOF STATE]
proof (prove)
using this:
row_length (a # M) = length a
\<forall>i<length a * length v. vec_vec_Tensor v a ! i = v ! (i div length a) * a ! (i mod length a)
vec_mat_Tensor v (a # M) ! 0 = vec_vec_Tensor v a

goal (1 subgoal):
 1. \<forall>i<row_length (a # M) * length v. vec_mat_Tensor v (a # M) ! 0 ! i = v ! (i div row_length (a # M)) * (a # M) ! 0 ! (i mod row_length (a # M))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>i<row_length (a # M) * length v. vec_mat_Tensor v (a # M) ! 0 ! i = v ! (i div row_length (a # M)) * (a # M) ! 0 ! (i mod row_length (a # M))

goal (1 subgoal):
 1. \<And>aa list. a = aa # list \<Longrightarrow> (i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
have "length (a#M)>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < length (a # M)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < length (a # M)

goal (1 subgoal):
 1. \<And>aa list. a = aa # list \<Longrightarrow> (i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
with 5
[PROOF STATE]
proof (chain)
picking this:
\<forall>i<row_length (a # M) * length v. vec_mat_Tensor v (a # M) ! 0 ! i = v ! (i div row_length (a # M)) * (a # M) ! 0 ! (i mod row_length (a # M))
0 < length (a # M)
[PROOF STEP]
have 6:
       "(j = 0)\<longrightarrow>
                    ((((i < (row_length (a#M))*(length v))
                    \<and>(j < (length (a#M))))
                    \<and>(mat (row_length (a#M)) (length (a#M)) (a#M))
                         \<longrightarrow>  ((vec_mat_Tensor v (a#M))!j!i)
                               = f
                                    (v!(i div (row_length (a#M))))
                                    ((a#M)!j!(i mod (row_length (a#M))))))"
[PROOF STATE]
proof (prove)
using this:
\<forall>i<row_length (a # M) * length v. vec_mat_Tensor v (a # M) ! 0 ! i = v ! (i div row_length (a # M)) * (a # M) ! 0 ! (i mod row_length (a # M))
0 < length (a # M)

goal (1 subgoal):
 1. j = 0 \<longrightarrow> (i < row_length (a # M) * length v \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
j = 0 \<longrightarrow> (i < row_length (a # M) * length v \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))

goal (1 subgoal):
 1. \<And>aa list. a = aa # list \<Longrightarrow> (i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
have "(((i < (row_length (a#M))*(length v))
         \<and>(j < (length (a#M))))
         \<and>(mat (row_length (a#M)) (length (a#M)) (a#M))
          \<longrightarrow>
           ((vec_mat_Tensor v (a#M))!j!i) =
                                f
                                         (v!(i div (row_length (a#M))))
                                         ((a#M)!j!(i mod (row_length (a#M)))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (i < row_length (a # M) * length v \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
proof(cases M)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. M = [] \<Longrightarrow> (i < row_length (a # M) * length v \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
 2. \<And>aa list. M = aa # list \<Longrightarrow> (i < row_length (a # M) * length v \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
M = []

goal (2 subgoals):
 1. M = [] \<Longrightarrow> (i < row_length (a # M) * length v \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
 2. \<And>aa list. M = aa # list \<Longrightarrow> (i < row_length (a # M) * length v \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
have "(length (a#[])) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length [a] = 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length [a] = 1

goal (2 subgoals):
 1. M = [] \<Longrightarrow> (i < row_length (a # M) * length v \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
 2. \<And>aa list. M = aa # list \<Longrightarrow> (i < row_length (a # M) * length v \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
length [a] = 1
[PROOF STEP]
have "(j<(length (a#[]))) = (j = 0)"
[PROOF STATE]
proof (prove)
using this:
length [a] = 1

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

goal (2 subgoals):
 1. M = [] \<Longrightarrow> (i < row_length (a # M) * length v \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
 2. \<And>aa list. M = aa # list \<Longrightarrow> (i < row_length (a # M) * length v \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(j < length [a]) = (j = 0)
[PROOF STEP]
have "((((i < (row_length (a#[]))*(length v))
               \<and>(j < (length (a#[]))))
               \<and> (mat (row_length (a#[])) (length (a#[])) (a#[]))
                  \<longrightarrow>  ((vec_mat_Tensor v (a#[]))!j!i)
                                 = f
                                    (v!(i div (row_length (a#[]))))
                                     ((a#[])!j!(i mod (row_length (a#[]))))))"
[PROOF STATE]
proof (prove)
using this:
(j < length [a]) = (j = 0)

goal (1 subgoal):
 1. (i < row_length [a] * length v \<and> j < length [a]) \<and> mat (row_length [a]) (length [a]) [a] \<longrightarrow> vec_mat_Tensor v [a] ! j ! i = v ! (i div row_length [a]) * [a] ! j ! (i mod row_length [a])
[PROOF STEP]
using 6 Nil
[PROOF STATE]
proof (prove)
using this:
(j < length [a]) = (j = 0)
j = 0 \<longrightarrow> (i < row_length (a # M) * length v \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
M = []

goal (1 subgoal):
 1. (i < row_length [a] * length v \<and> j < length [a]) \<and> mat (row_length [a]) (length [a]) [a] \<longrightarrow> vec_mat_Tensor v [a] ! j ! i = v ! (i div row_length [a]) * [a] ! j ! (i mod row_length [a])
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(i < row_length [a] * length v \<and> j < length [a]) \<and> mat (row_length [a]) (length [a]) [a] \<longrightarrow> vec_mat_Tensor v [a] ! j ! i = v ! (i div row_length [a]) * [a] ! j ! (i mod row_length [a])

goal (2 subgoals):
 1. M = [] \<Longrightarrow> (i < row_length (a # M) * length v \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
 2. \<And>aa list. M = aa # list \<Longrightarrow> (i < row_length (a # M) * length v \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(i < row_length [a] * length v \<and> j < length [a]) \<and> mat (row_length [a]) (length [a]) [a] \<longrightarrow> vec_mat_Tensor v [a] ! j ! i = v ! (i div row_length [a]) * [a] ! j ! (i mod row_length [a])
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(i < row_length [a] * length v \<and> j < length [a]) \<and> mat (row_length [a]) (length [a]) [a] \<longrightarrow> vec_mat_Tensor v [a] ! j ! i = v ! (i div row_length [a]) * [a] ! j ! (i mod row_length [a])

goal (1 subgoal):
 1. (i < row_length (a # M) * length v \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
using Nil
[PROOF STATE]
proof (prove)
using this:
(i < row_length [a] * length v \<and> j < length [a]) \<and> mat (row_length [a]) (length [a]) [a] \<longrightarrow> vec_mat_Tensor v [a] ! j ! i = v ! (i div row_length [a]) * [a] ! j ! (i mod row_length [a])
M = []

goal (1 subgoal):
 1. (i < row_length (a # M) * length v \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(i < row_length (a # M) * length v \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))

goal (1 subgoal):
 1. \<And>aa list. M = aa # list \<Longrightarrow> (i < row_length (a # M) * length v \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>aa list. M = aa # list \<Longrightarrow> (i < row_length (a # M) * length v \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
case (Cons b N)
[PROOF STATE]
proof (state)
this:
M = b # N

goal (1 subgoal):
 1. \<And>aa list. M = aa # list \<Longrightarrow> (i < row_length (a # M) * length v \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
have 7:"(mat  (row_length (a#b#N))  (length (a#b#N)) (a#b#N))
               \<longrightarrow> row_length (a#b#N) = (row_length (b#N))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> row_length (a # b # N) = row_length (b # N)
[PROOF STEP]
using row_length_eq
[PROOF STATE]
proof (prove)
using this:
mat (row_length (?a # ?b # ?N)) (length (?a # ?b # ?N)) (?a # ?b # ?N) \<longrightarrow> row_length (?a # ?b # ?N) = row_length (?b # ?N)

goal (1 subgoal):
 1. mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> row_length (a # b # N) = row_length (b # N)
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> row_length (a # b # N) = row_length (b # N)

goal (1 subgoal):
 1. \<And>aa list. M = aa # list \<Longrightarrow> (i < row_length (a # M) * length v \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
have 8: "(j>0)
            \<longrightarrow> ((vec_mat_Tensor v (b#N))!(nat ((int j)+-1)))
                                  = (vec_mat_Tensor v (a#b#N))!j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < j \<longrightarrow> vec_mat_Tensor v (b # N) ! nat (int j + - 1) = vec_mat_Tensor v (a # b # N) ! j
[PROOF STEP]
using vec_mat_Tensor.simps(2)
[PROOF STATE]
proof (prove)
using this:
vec_mat_Tensor ?xs (?ys # ?yss) = vec_vec_Tensor ?xs ?ys # vec_mat_Tensor ?xs ?yss

goal (1 subgoal):
 1. 0 < j \<longrightarrow> vec_mat_Tensor v (b # N) ! nat (int j + - 1) = vec_mat_Tensor v (a # b # N) ! j
[PROOF STEP]
using list_int_nat
[PROOF STATE]
proof (prove)
using this:
vec_mat_Tensor ?xs (?ys # ?yss) = vec_vec_Tensor ?xs ?ys # vec_mat_Tensor ?xs ?yss
0 < ?k \<longrightarrow> (?x # ?xs) ! ?k = ?xs ! nat (int ?k + - 1)

goal (1 subgoal):
 1. 0 < j \<longrightarrow> vec_mat_Tensor v (b # N) ! nat (int j + - 1) = vec_mat_Tensor v (a # b # N) ! j
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
0 < j \<longrightarrow> vec_mat_Tensor v (b # N) ! nat (int j + - 1) = vec_mat_Tensor v (a # b # N) ! j

goal (1 subgoal):
 1. \<And>aa list. M = aa # list \<Longrightarrow> (i < row_length (a # M) * length v \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
have 9: "(j>0)
                 \<longrightarrow> (((i < (row_length (b#N))*(length v))
                    \<and>((nat ((int j)+-1)) < (length (b#N))))
                    \<and>(mat (row_length (b#N)) (length (b#N)) (b#N))
                      \<longrightarrow>
             ((vec_mat_Tensor v (b#N))!(nat ((int j)+-1))!i)
                    = f
                      (v!(i div (row_length (b#N))))
                      ((b#N)!(nat ((int j)+-1))!(i mod (row_length (b#N)))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < j \<longrightarrow> (i < row_length (b # N) * length v \<and> nat (int j + - 1) < length (b # N)) \<and> mat (row_length (b # N)) (length (b # N)) (b # N) \<longrightarrow> vec_mat_Tensor v (b # N) ! nat (int j + - 1) ! i = v ! (i div row_length (b # N)) * (b # N) ! nat (int j + - 1) ! (i mod row_length (b # N))
[PROOF STEP]
using Cons.hyps Cons mult.commute
[PROOF STATE]
proof (prove)
using this:
(?i < length v * row_length M \<and> ?j < length M) \<and> mat (row_length M) (length M) M \<longrightarrow> vec_mat_Tensor v M ! ?j ! ?i = v ! (?i div row_length M) * M ! ?j ! (?i mod row_length M)
M = b # N
?a * ?b = ?b * ?a

goal (1 subgoal):
 1. 0 < j \<longrightarrow> (i < row_length (b # N) * length v \<and> nat (int j + - 1) < length (b # N)) \<and> mat (row_length (b # N)) (length (b # N)) (b # N) \<longrightarrow> vec_mat_Tensor v (b # N) ! nat (int j + - 1) ! i = v ! (i div row_length (b # N)) * (b # N) ! nat (int j + - 1) ! (i mod row_length (b # N))
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
0 < j \<longrightarrow> (i < row_length (b # N) * length v \<and> nat (int j + - 1) < length (b # N)) \<and> mat (row_length (b # N)) (length (b # N)) (b # N) \<longrightarrow> vec_mat_Tensor v (b # N) ! nat (int j + - 1) ! i = v ! (i div row_length (b # N)) * (b # N) ! nat (int j + - 1) ! (i mod row_length (b # N))

goal (1 subgoal):
 1. \<And>aa list. M = aa # list \<Longrightarrow> (i < row_length (a # M) * length v \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
have "(j>0) \<longrightarrow> ((nat ((int j) + -1)) < (length (b#N)))
                           \<longrightarrow> ((nat ((int j) + -1) + 1) < length (a#b#N))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < j \<longrightarrow> nat (int j + - 1) < length (b # N) \<longrightarrow> nat (int j + - 1) + 1 < length (a # b # N)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < j \<longrightarrow> nat (int j + - 1) < length (b # N) \<longrightarrow> nat (int j + - 1) + 1 < length (a # b # N)

goal (1 subgoal):
 1. \<And>aa list. M = aa # list \<Longrightarrow> (i < row_length (a # M) * length v \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < j \<longrightarrow> nat (int j + - 1) < length (b # N) \<longrightarrow> nat (int j + - 1) + 1 < length (a # b # N)
[PROOF STEP]
have
           "(j>0)
                 \<longrightarrow> ((nat ((int j) + -1)) < (length (b#N))) = (j < length (a#b#N))"
[PROOF STATE]
proof (prove)
using this:
0 < j \<longrightarrow> nat (int j + - 1) < length (b # N) \<longrightarrow> nat (int j + - 1) + 1 < length (a # b # N)

goal (1 subgoal):
 1. 0 < j \<longrightarrow> (nat (int j + - 1) < length (b # N)) = (j < length (a # b # N))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < j \<longrightarrow> (nat (int j + - 1) < length (b # N)) = (j < length (a # b # N))

goal (1 subgoal):
 1. \<And>aa list. M = aa # list \<Longrightarrow> (i < row_length (a # M) * length v \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < j \<longrightarrow> (nat (int j + - 1) < length (b # N)) = (j < length (a # b # N))
[PROOF STEP]
have
         "(j>0)
          \<longrightarrow> (((i < (row_length (b#N))*(length v)) \<and> (j < length (a#b#N)))
              \<and>(mat (row_length (b#N)) (length (b#N)) (b#N))   \<longrightarrow>
                    ((vec_mat_Tensor v (b#N))!(nat ((int j)+-1))!i)
            = f
                (v!(i div (row_length (b#N))))
                ((b#N)!(nat ((int j)+-1))!(i mod (row_length (b#N)))))"
[PROOF STATE]
proof (prove)
using this:
0 < j \<longrightarrow> (nat (int j + - 1) < length (b # N)) = (j < length (a # b # N))

goal (1 subgoal):
 1. 0 < j \<longrightarrow> (i < row_length (b # N) * length v \<and> j < length (a # b # N)) \<and> mat (row_length (b # N)) (length (b # N)) (b # N) \<longrightarrow> vec_mat_Tensor v (b # N) ! nat (int j + - 1) ! i = v ! (i div row_length (b # N)) * (b # N) ! nat (int j + - 1) ! (i mod row_length (b # N))
[PROOF STEP]
using Cons.hyps Cons mult.commute
[PROOF STATE]
proof (prove)
using this:
0 < j \<longrightarrow> (nat (int j + - 1) < length (b # N)) = (j < length (a # b # N))
(?i < length v * row_length M \<and> ?j < length M) \<and> mat (row_length M) (length M) M \<longrightarrow> vec_mat_Tensor v M ! ?j ! ?i = v ! (?i div row_length M) * M ! ?j ! (?i mod row_length M)
M = b # N
?a * ?b = ?b * ?a

goal (1 subgoal):
 1. 0 < j \<longrightarrow> (i < row_length (b # N) * length v \<and> j < length (a # b # N)) \<and> mat (row_length (b # N)) (length (b # N)) (b # N) \<longrightarrow> vec_mat_Tensor v (b # N) ! nat (int j + - 1) ! i = v ! (i div row_length (b # N)) * (b # N) ! nat (int j + - 1) ! (i mod row_length (b # N))
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
0 < j \<longrightarrow> (i < row_length (b # N) * length v \<and> j < length (a # b # N)) \<and> mat (row_length (b # N)) (length (b # N)) (b # N) \<longrightarrow> vec_mat_Tensor v (b # N) ! nat (int j + - 1) ! i = v ! (i div row_length (b # N)) * (b # N) ! nat (int j + - 1) ! (i mod row_length (b # N))

goal (1 subgoal):
 1. \<And>aa list. M = aa # list \<Longrightarrow> (i < row_length (a # M) * length v \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
with 8
[PROOF STATE]
proof (chain)
picking this:
0 < j \<longrightarrow> vec_mat_Tensor v (b # N) ! nat (int j + - 1) = vec_mat_Tensor v (a # b # N) ! j
0 < j \<longrightarrow> (i < row_length (b # N) * length v \<and> j < length (a # b # N)) \<and> mat (row_length (b # N)) (length (b # N)) (b # N) \<longrightarrow> vec_mat_Tensor v (b # N) ! nat (int j + - 1) ! i = v ! (i div row_length (b # N)) * (b # N) ! nat (int j + - 1) ! (i mod row_length (b # N))
[PROOF STEP]
have "(j>0)
                 \<longrightarrow> (((i < (row_length (b#N))*(length v))
                     \<and> (j < length (a#b#N)))
                     \<and> (mat (row_length (b#N)) (length (b#N)) (b#N))
                      \<longrightarrow>
         ((vec_mat_Tensor v (a#b#N))!j!i)
                = f
                    (v!(i div (row_length (b#N))))
                    ((b#N)!(nat ((int j)+-1))!(i mod (row_length (b#N)))))"
[PROOF STATE]
proof (prove)
using this:
0 < j \<longrightarrow> vec_mat_Tensor v (b # N) ! nat (int j + - 1) = vec_mat_Tensor v (a # b # N) ! j
0 < j \<longrightarrow> (i < row_length (b # N) * length v \<and> j < length (a # b # N)) \<and> mat (row_length (b # N)) (length (b # N)) (b # N) \<longrightarrow> vec_mat_Tensor v (b # N) ! nat (int j + - 1) ! i = v ! (i div row_length (b # N)) * (b # N) ! nat (int j + - 1) ! (i mod row_length (b # N))

goal (1 subgoal):
 1. 0 < j \<longrightarrow> (i < row_length (b # N) * length v \<and> j < length (a # b # N)) \<and> mat (row_length (b # N)) (length (b # N)) (b # N) \<longrightarrow> vec_mat_Tensor v (a # b # N) ! j ! i = v ! (i div row_length (b # N)) * (b # N) ! nat (int j + - 1) ! (i mod row_length (b # N))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < j \<longrightarrow> (i < row_length (b # N) * length v \<and> j < length (a # b # N)) \<and> mat (row_length (b # N)) (length (b # N)) (b # N) \<longrightarrow> vec_mat_Tensor v (a # b # N) ! j ! i = v ! (i div row_length (b # N)) * (b # N) ! nat (int j + - 1) ! (i mod row_length (b # N))

goal (1 subgoal):
 1. \<And>aa list. M = aa # list \<Longrightarrow> (i < row_length (a # M) * length v \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
0 < j \<longrightarrow> (i < row_length (b # N) * length v \<and> j < length (a # b # N)) \<and> mat (row_length (b # N)) (length (b # N)) (b # N) \<longrightarrow> vec_mat_Tensor v (a # b # N) ! j ! i = v ! (i div row_length (b # N)) * (b # N) ! nat (int j + - 1) ! (i mod row_length (b # N))

goal (1 subgoal):
 1. \<And>aa list. M = aa # list \<Longrightarrow> (i < row_length (a # M) * length v \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
have "(j>0) \<longrightarrow> (b#N)!(nat ((int j)+-1)) = (a#b#N)!j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < j \<longrightarrow> (b # N) ! nat (int j + - 1) = (a # b # N) ! j
[PROOF STEP]
using list_int_nat
[PROOF STATE]
proof (prove)
using this:
0 < ?k \<longrightarrow> (?x # ?xs) ! ?k = ?xs ! nat (int ?k + - 1)

goal (1 subgoal):
 1. 0 < j \<longrightarrow> (b # N) ! nat (int j + - 1) = (a # b # N) ! j
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
0 < j \<longrightarrow> (b # N) ! nat (int j + - 1) = (a # b # N) ! j

goal (1 subgoal):
 1. \<And>aa list. M = aa # list \<Longrightarrow> (i < row_length (a # M) * length v \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 < j \<longrightarrow> (b # N) ! nat (int j + - 1) = (a # b # N) ! j

goal (1 subgoal):
 1. \<And>aa list. M = aa # list \<Longrightarrow> (i < row_length (a # M) * length v \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
have " (j>0) \<longrightarrow>
                    (((i < (row_length (b#N))*(length v))
                   \<and> (j < length (a#b#N)))
                   \<and> (mat (row_length (b#N)) (length (b#N)) (b#N))
                     \<longrightarrow>
                         ((vec_mat_Tensor v (a#b#N))!j!i)
                                  = f
                                      (v!(i div (row_length (b#N))))
                                      ((a#b#N)!j!(i mod (row_length (b#N)))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < j \<longrightarrow> (i < row_length (b # N) * length v \<and> j < length (a # b # N)) \<and> mat (row_length (b # N)) (length (b # N)) (b # N) \<longrightarrow> vec_mat_Tensor v (a # b # N) ! j ! i = v ! (i div row_length (b # N)) * (a # b # N) ! j ! (i mod row_length (b # N))
[PROOF STEP]
by (metis calculation(1) calculation(2))
[PROOF STATE]
proof (state)
this:
0 < j \<longrightarrow> (i < row_length (b # N) * length v \<and> j < length (a # b # N)) \<and> mat (row_length (b # N)) (length (b # N)) (b # N) \<longrightarrow> vec_mat_Tensor v (a # b # N) ! j ! i = v ! (i div row_length (b # N)) * (a # b # N) ! j ! (i mod row_length (b # N))

goal (1 subgoal):
 1. \<And>aa list. M = aa # list \<Longrightarrow> (i < row_length (a # M) * length v \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < j \<longrightarrow> (i < row_length (b # N) * length v \<and> j < length (a # b # N)) \<and> mat (row_length (b # N)) (length (b # N)) (b # N) \<longrightarrow> vec_mat_Tensor v (a # b # N) ! j ! i = v ! (i div row_length (b # N)) * (a # b # N) ! j ! (i mod row_length (b # N))
[PROOF STEP]
have
           "(j>0)
             \<longrightarrow> (((i < (row_length (b#N))*(length v))
                 \<and> (j < length (a#b#N)))
                 \<and> (mat (row_length (a#b#N)) (length (a#b#N)) (a#b#N))
                 \<longrightarrow>
                        ((vec_mat_Tensor v (a#b#N))!j!i)
                              = f
                                    (v!(i div (row_length (b#N))))
                                    ((a#b#N)!j!(i mod (row_length (b#N)))))"
[PROOF STATE]
proof (prove)
using this:
0 < j \<longrightarrow> (i < row_length (b # N) * length v \<and> j < length (a # b # N)) \<and> mat (row_length (b # N)) (length (b # N)) (b # N) \<longrightarrow> vec_mat_Tensor v (a # b # N) ! j ! i = v ! (i div row_length (b # N)) * (a # b # N) ! j ! (i mod row_length (b # N))

goal (1 subgoal):
 1. 0 < j \<longrightarrow> (i < row_length (b # N) * length v \<and> j < length (a # b # N)) \<and> mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> vec_mat_Tensor v (a # b # N) ! j ! i = v ! (i div row_length (b # N)) * (a # b # N) ! j ! (i mod row_length (b # N))
[PROOF STEP]
using reduct_matrix
[PROOF STATE]
proof (prove)
using this:
0 < j \<longrightarrow> (i < row_length (b # N) * length v \<and> j < length (a # b # N)) \<and> mat (row_length (b # N)) (length (b # N)) (b # N) \<longrightarrow> vec_mat_Tensor v (a # b # N) ! j ! i = v ! (i div row_length (b # N)) * (a # b # N) ! j ! (i mod row_length (b # N))
mat (row_length (?a # ?M)) (length (?a # ?M)) (?a # ?M) \<Longrightarrow> mat (row_length ?M) (length ?M) ?M

goal (1 subgoal):
 1. 0 < j \<longrightarrow> (i < row_length (b # N) * length v \<and> j < length (a # b # N)) \<and> mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> vec_mat_Tensor v (a # b # N) ! j ! i = v ! (i div row_length (b # N)) * (a # b # N) ! j ! (i mod row_length (b # N))
[PROOF STEP]
by (metis)
[PROOF STATE]
proof (state)
this:
0 < j \<longrightarrow> (i < row_length (b # N) * length v \<and> j < length (a # b # N)) \<and> mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> vec_mat_Tensor v (a # b # N) ! j ! i = v ! (i div row_length (b # N)) * (a # b # N) ! j ! (i mod row_length (b # N))

goal (1 subgoal):
 1. \<And>aa list. M = aa # list \<Longrightarrow> (i < row_length (a # M) * length v \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
0 < j \<longrightarrow> (i < row_length (b # N) * length v \<and> j < length (a # b # N)) \<and> mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> vec_mat_Tensor v (a # b # N) ! j ! i = v ! (i div row_length (b # N)) * (a # b # N) ! j ! (i mod row_length (b # N))

goal (1 subgoal):
 1. \<And>aa list. M = aa # list \<Longrightarrow> (i < row_length (a # M) * length v \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
have "(mat (row_length (a#b#N)) (length (a#b#N)) (a#b#N))
                   \<longrightarrow>(row_length (b#N)) = (row_length (a#b#N))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> row_length (b # N) = row_length (a # b # N)
[PROOF STEP]
by (metis "7" Cons)
[PROOF STATE]
proof (state)
this:
mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> row_length (b # N) = row_length (a # b # N)

goal (1 subgoal):
 1. \<And>aa list. M = aa # list \<Longrightarrow> (i < row_length (a # M) * length v \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> row_length (b # N) = row_length (a # b # N)

goal (1 subgoal):
 1. \<And>aa list. M = aa # list \<Longrightarrow> (i < row_length (a # M) * length v \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
have 10:"(j>0)
                     \<longrightarrow> (((i < (row_length (a#b#N))*(length v))
                        \<and>(j < length (a#b#N)))
                        \<and>(mat (row_length (a#b#N)) (length (a#b#N)) (a#b#N))   \<longrightarrow>
                         ((vec_mat_Tensor v (a#b#N))!j!i)
                                = f (v!(i div (row_length (a#b#N))))
                                    ((a#b#N)!j!(i mod (row_length (a#b#N)))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < j \<longrightarrow> (i < row_length (a # b # N) * length v \<and> j < length (a # b # N)) \<and> mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> vec_mat_Tensor v (a # b # N) ! j ! i = v ! (i div row_length (a # b # N)) * (a # b # N) ! j ! (i mod row_length (a # b # N))
[PROOF STEP]
by (metis calculation(3) calculation(4))
[PROOF STATE]
proof (state)
this:
0 < j \<longrightarrow> (i < row_length (a # b # N) * length v \<and> j < length (a # b # N)) \<and> mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> vec_mat_Tensor v (a # b # N) ! j ! i = v ! (i div row_length (a # b # N)) * (a # b # N) ! j ! (i mod row_length (a # b # N))

goal (1 subgoal):
 1. \<And>aa list. M = aa # list \<Longrightarrow> (i < row_length (a # M) * length v \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
have "(j = 0) \<or> (j > 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j = 0 \<or> 0 < j
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
j = 0 \<or> 0 < j

goal (1 subgoal):
 1. \<And>aa list. M = aa # list \<Longrightarrow> (i < row_length (a # M) * length v \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
with 6 10 logic
[PROOF STATE]
proof (chain)
picking this:
j = 0 \<longrightarrow> (i < row_length (a # M) * length v \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
0 < j \<longrightarrow> (i < row_length (a # b # N) * length v \<and> j < length (a # b # N)) \<and> mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> vec_mat_Tensor v (a # b # N) ! j ! i = v ! (i div row_length (a # b # N)) * (a # b # N) ! j ! (i mod row_length (a # b # N))
\<lbrakk>?A \<longrightarrow> ?B; \<not> ?A \<longrightarrow> ?B\<rbrakk> \<Longrightarrow> ?B
j = 0 \<or> 0 < j
[PROOF STEP]
have
            "(((i < (row_length (a#b#N))*(length v))
            \<and> (j < length (a#b#N)))
            \<and> (mat (row_length (a#b#N)) (length (a#b#N)) (a#b#N))
            \<longrightarrow>
                ((vec_mat_Tensor v (a#b#N))!j!i)
                      = f
                          (v!(i div (row_length (a#b#N))))
                          ((a#b#N)!j!(i mod (row_length (a#b#N)))))"
[PROOF STATE]
proof (prove)
using this:
j = 0 \<longrightarrow> (i < row_length (a # M) * length v \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
0 < j \<longrightarrow> (i < row_length (a # b # N) * length v \<and> j < length (a # b # N)) \<and> mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> vec_mat_Tensor v (a # b # N) ! j ! i = v ! (i div row_length (a # b # N)) * (a # b # N) ! j ! (i mod row_length (a # b # N))
\<lbrakk>?A \<longrightarrow> ?B; \<not> ?A \<longrightarrow> ?B\<rbrakk> \<Longrightarrow> ?B
j = 0 \<or> 0 < j

goal (1 subgoal):
 1. (i < row_length (a # b # N) * length v \<and> j < length (a # b # N)) \<and> mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> vec_mat_Tensor v (a # b # N) ! j ! i = v ! (i div row_length (a # b # N)) * (a # b # N) ! j ! (i mod row_length (a # b # N))
[PROOF STEP]
using  Cons
[PROOF STATE]
proof (prove)
using this:
j = 0 \<longrightarrow> (i < row_length (a # M) * length v \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
0 < j \<longrightarrow> (i < row_length (a # b # N) * length v \<and> j < length (a # b # N)) \<and> mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> vec_mat_Tensor v (a # b # N) ! j ! i = v ! (i div row_length (a # b # N)) * (a # b # N) ! j ! (i mod row_length (a # b # N))
\<lbrakk>?A \<longrightarrow> ?B; \<not> ?A \<longrightarrow> ?B\<rbrakk> \<Longrightarrow> ?B
j = 0 \<or> 0 < j
M = b # N

goal (1 subgoal):
 1. (i < row_length (a # b # N) * length v \<and> j < length (a # b # N)) \<and> mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> vec_mat_Tensor v (a # b # N) ! j ! i = v ! (i div row_length (a # b # N)) * (a # b # N) ! j ! (i mod row_length (a # b # N))
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
(i < row_length (a # b # N) * length v \<and> j < length (a # b # N)) \<and> mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> vec_mat_Tensor v (a # b # N) ! j ! i = v ! (i div row_length (a # b # N)) * (a # b # N) ! j ! (i mod row_length (a # b # N))

goal (1 subgoal):
 1. \<And>aa list. M = aa # list \<Longrightarrow> (i < row_length (a # M) * length v \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
(i < row_length (a # b # N) * length v \<and> j < length (a # b # N)) \<and> mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> vec_mat_Tensor v (a # b # N) ! j ! i = v ! (i div row_length (a # b # N)) * (a # b # N) ! j ! (i mod row_length (a # b # N))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(i < row_length (a # b # N) * length v \<and> j < length (a # b # N)) \<and> mat (row_length (a # b # N)) (length (a # b # N)) (a # b # N) \<longrightarrow> vec_mat_Tensor v (a # b # N) ! j ! i = v ! (i div row_length (a # b # N)) * (a # b # N) ! j ! (i mod row_length (a # b # N))

goal (1 subgoal):
 1. (i < row_length (a # M) * length v \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
by (metis Cons)
[PROOF STATE]
proof (state)
this:
(i < row_length (a # M) * length v \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(i < row_length (a # M) * length v \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))

goal (1 subgoal):
 1. \<And>aa list. a = aa # list \<Longrightarrow> (i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
(i < row_length (a # M) * length v \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(i < row_length (a # M) * length v \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))

goal (1 subgoal):
 1. (i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
by (metis mult.commute)
[PROOF STATE]
proof (state)
this:
(i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))

goal (1 subgoal):
 1. \<And>a M i j. (\<And>i j. (i < length v * row_length M \<and> j < length M) \<and> mat (row_length M) (length M) M \<longrightarrow> vec_mat_Tensor v M ! j ! i = v ! (i div row_length M) * M ! j ! (i mod row_length M)) \<Longrightarrow> (i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
(i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))

goal (1 subgoal):
 1. (i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(i < length v * row_length (a # M) \<and> j < length (a # M)) \<and> mat (row_length (a # M)) (length (a # M)) (a # M) \<longrightarrow> vec_mat_Tensor v (a # M) ! j ! i = v ! (i div row_length (a # M)) * (a # M) ! j ! (i mod row_length (a # M))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in monoid_add) interv_sum_list_conv_sum_set_nat:
  "sum_list (map f [m..<n]) = sum f (set [m..<n])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (map f [m..<n]) = sum f (set [m..<n])
[PROOF STEP]
by (simp add: sum_list_distinct_conv_sum_set)


[STATEMENT]
lemma ccspan_gram_schmidt0_invariant:
  defines "basis_enum \<equiv> (basis_enum_of_vec :: _ \<Rightarrow> 'a::{basis_enum,complex_normed_vector})"
  defines "n \<equiv> length (canonical_basis :: 'a list)"
  assumes "set ws \<subseteq> carrier_vec n"
  shows "ccspan (set (map basis_enum (gram_schmidt0 n ws))) = ccspan (set (map basis_enum ws))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ccspan (set (map basis_enum (gram_schmidt0 n ws))) = ccspan (set (map basis_enum ws))
[PROOF STEP]
proof (transfer fixing: n ws basis_enum)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. closure (cspan (set (map basis_enum (gram_schmidt0 n ws)))) = closure (cspan (set (map basis_enum ws)))
[PROOF STEP]
interpret complex_vec_space
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. closure (cspan (set (map basis_enum (gram_schmidt0 n ws)))) = closure (cspan (set (map basis_enum ws)))
[PROOF STEP]
define gs where "gs = gram_schmidt0 n ws"
[PROOF STATE]
proof (state)
this:
gs = gram_schmidt0 n ws

goal (1 subgoal):
 1. closure (cspan (set (map basis_enum (gram_schmidt0 n ws)))) = closure (cspan (set (map basis_enum ws)))
[PROOF STEP]
have "closure (cspan (set (map basis_enum gs)))
     = cspan (set (map basis_enum gs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure (cspan (set (map basis_enum gs))) = cspan (set (map basis_enum gs))
[PROOF STEP]
apply (rule closure_finite_cspan)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (set (map basis_enum gs))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
closure (cspan (set (map basis_enum gs))) = cspan (set (map basis_enum gs))

goal (1 subgoal):
 1. closure (cspan (set (map basis_enum (gram_schmidt0 n ws)))) = closure (cspan (set (map basis_enum ws)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
closure (cspan (set (map basis_enum gs))) = cspan (set (map basis_enum gs))

goal (1 subgoal):
 1. closure (cspan (set (map basis_enum (gram_schmidt0 n ws)))) = closure (cspan (set (map basis_enum ws)))
[PROOF STEP]
have "\<dots> = cspan (basis_enum ` set gs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cspan (set (map basis_enum gs)) = cspan (basis_enum ` set gs)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cspan (set (map basis_enum gs)) = cspan (basis_enum ` set gs)

goal (1 subgoal):
 1. closure (cspan (set (map basis_enum (gram_schmidt0 n ws)))) = closure (cspan (set (map basis_enum ws)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cspan (set (map basis_enum gs)) = cspan (basis_enum ` set gs)

goal (1 subgoal):
 1. closure (cspan (set (map basis_enum (gram_schmidt0 n ws)))) = closure (cspan (set (map basis_enum ws)))
[PROOF STEP]
have "\<dots> = basis_enum ` span (set gs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cspan (basis_enum ` set gs) = basis_enum ` local.span (set gs)
[PROOF STEP]
unfolding basis_enum_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cspan (basis_enum_of_vec ` set gs) = basis_enum_of_vec ` local.span (set gs)
[PROOF STEP]
apply (rule basis_enum_of_vec_span[symmetric])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. length canonical_basis = n
 2. set gs \<subseteq> carrier_vec n
[PROOF STEP]
using n_def
[PROOF STATE]
proof (prove)
using this:
n \<equiv> length canonical_basis

goal (2 subgoals):
 1. length canonical_basis = n
 2. set gs \<subseteq> carrier_vec n
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set gs \<subseteq> carrier_vec n
[PROOF STEP]
by (simp add: assms(3) cof_vec_space.gram_schmidt0_result(1) gs_def)
[PROOF STATE]
proof (state)
this:
cspan (basis_enum ` set gs) = basis_enum ` local.span (set gs)

goal (1 subgoal):
 1. closure (cspan (set (map basis_enum (gram_schmidt0 n ws)))) = closure (cspan (set (map basis_enum ws)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cspan (basis_enum ` set gs) = basis_enum ` local.span (set gs)

goal (1 subgoal):
 1. closure (cspan (set (map basis_enum (gram_schmidt0 n ws)))) = closure (cspan (set (map basis_enum ws)))
[PROOF STEP]
have "\<dots> = basis_enum ` span (set ws)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. basis_enum ` local.span (set gs) = basis_enum ` local.span (set ws)
[PROOF STEP]
unfolding gs_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. basis_enum ` local.span (set (gram_schmidt0 n ws)) = basis_enum ` local.span (set ws)
[PROOF STEP]
apply (subst gram_schmidt0_result(4)[where ws=ws, symmetric])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. set ws \<subseteq> carrier_vec n
 2. basis_enum ` local.span (set ws) = basis_enum ` local.span (set ws)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
basis_enum \<equiv> basis_enum_of_vec
n \<equiv> length canonical_basis
set ws \<subseteq> carrier_vec n

goal (2 subgoals):
 1. set ws \<subseteq> carrier_vec n
 2. basis_enum ` local.span (set ws) = basis_enum ` local.span (set ws)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
basis_enum ` local.span (set gs) = basis_enum ` local.span (set ws)

goal (1 subgoal):
 1. closure (cspan (set (map basis_enum (gram_schmidt0 n ws)))) = closure (cspan (set (map basis_enum ws)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
basis_enum ` local.span (set gs) = basis_enum ` local.span (set ws)

goal (1 subgoal):
 1. closure (cspan (set (map basis_enum (gram_schmidt0 n ws)))) = closure (cspan (set (map basis_enum ws)))
[PROOF STEP]
have "\<dots> = cspan (basis_enum ` set ws)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. basis_enum ` local.span (set ws) = cspan (basis_enum ` set ws)
[PROOF STEP]
unfolding basis_enum_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. basis_enum_of_vec ` local.span (set ws) = cspan (basis_enum_of_vec ` set ws)
[PROOF STEP]
apply (rule basis_enum_of_vec_span)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. length canonical_basis = n
 2. set ws \<subseteq> carrier_vec n
[PROOF STEP]
using n_def
[PROOF STATE]
proof (prove)
using this:
n \<equiv> length canonical_basis

goal (2 subgoals):
 1. length canonical_basis = n
 2. set ws \<subseteq> carrier_vec n
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set ws \<subseteq> carrier_vec n
[PROOF STEP]
by (simp add: assms(3))
[PROOF STATE]
proof (state)
this:
basis_enum ` local.span (set ws) = cspan (basis_enum ` set ws)

goal (1 subgoal):
 1. closure (cspan (set (map basis_enum (gram_schmidt0 n ws)))) = closure (cspan (set (map basis_enum ws)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
basis_enum ` local.span (set ws) = cspan (basis_enum ` set ws)

goal (1 subgoal):
 1. closure (cspan (set (map basis_enum (gram_schmidt0 n ws)))) = closure (cspan (set (map basis_enum ws)))
[PROOF STEP]
have "\<dots> = cspan (set (map basis_enum ws))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cspan (basis_enum ` set ws) = cspan (set (map basis_enum ws))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cspan (basis_enum ` set ws) = cspan (set (map basis_enum ws))

goal (1 subgoal):
 1. closure (cspan (set (map basis_enum (gram_schmidt0 n ws)))) = closure (cspan (set (map basis_enum ws)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cspan (basis_enum ` set ws) = cspan (set (map basis_enum ws))

goal (1 subgoal):
 1. closure (cspan (set (map basis_enum (gram_schmidt0 n ws)))) = closure (cspan (set (map basis_enum ws)))
[PROOF STEP]
have "\<dots> = closure (cspan (set (map basis_enum ws)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cspan (set (map basis_enum ws)) = closure (cspan (set (map basis_enum ws)))
[PROOF STEP]
apply (rule closure_finite_cspan[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (set (map basis_enum ws))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cspan (set (map basis_enum ws)) = closure (cspan (set (map basis_enum ws)))

goal (1 subgoal):
 1. closure (cspan (set (map basis_enum (gram_schmidt0 n ws)))) = closure (cspan (set (map basis_enum ws)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
closure (cspan (set (map basis_enum gs))) = closure (cspan (set (map basis_enum ws)))
[PROOF STEP]
show "closure (cspan (set (map basis_enum gs)))
              = closure (cspan (set (map basis_enum ws)))"
[PROOF STATE]
proof (prove)
using this:
closure (cspan (set (map basis_enum gs))) = closure (cspan (set (map basis_enum ws)))

goal (1 subgoal):
 1. closure (cspan (set (map basis_enum gs))) = closure (cspan (set (map basis_enum ws)))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
closure (cspan (set (map basis_enum gs))) = closure (cspan (set (map basis_enum ws)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma isLub_unique: "[| isLub R S x; isLub R S y |] ==> x = (y::'a::linorder)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>isLub R S x; isLub R S y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
apply (frule isLub_isUb)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>isLub R S x; isLub R S y; isUb R S x\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
apply (frule_tac x = y in isLub_isUb)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>isLub R S x; isLub R S y; isUb R S x; isUb R S y\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
apply (blast intro!: order_antisym dest!: isLub_le_isUb)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma topological_basis:
  "topological_basis B \<longleftrightarrow> (\<forall>x. open x \<longleftrightarrow> (\<exists>B'. B' \<subseteq> B \<and> \<Union>B' = x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. topological_basis B = (\<forall>x. open x = (\<exists>B'\<subseteq>B. \<Union> B' = x))
[PROOF STEP]
unfolding topological_basis_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Ball B open \<and> (\<forall>x. open x \<longrightarrow> (\<exists>B'\<subseteq>B. \<Union> B' = x))) = (\<forall>x. open x = (\<exists>B'\<subseteq>B. \<Union> B' = x))
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>x. \<lbrakk>Ball B open; \<forall>x. open x \<longrightarrow> (\<exists>B'\<subseteq>B. \<Union> B' = x); open x\<rbrakk> \<Longrightarrow> \<exists>B'\<subseteq>B. \<Union> B' = x
 2. \<And>x B'. \<lbrakk>Ball B open; \<forall>x. open x \<longrightarrow> (\<exists>B'\<subseteq>B. \<Union> B' = x); B' \<subseteq> B\<rbrakk> \<Longrightarrow> open (\<Union> B')
 3. \<And>x. \<lbrakk>\<forall>x. open x = (\<exists>B'\<subseteq>B. \<Union> B' = x); x \<in> B\<rbrakk> \<Longrightarrow> open x
 4. \<And>x. \<lbrakk>\<forall>x. open x = (\<exists>B'\<subseteq>B. \<Union> B' = x); open x\<rbrakk> \<Longrightarrow> \<exists>B'\<subseteq>B. \<Union> B' = x
[PROOF STEP]
apply fastforce
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x B'. \<lbrakk>Ball B open; \<forall>x. open x \<longrightarrow> (\<exists>B'\<subseteq>B. \<Union> B' = x); B' \<subseteq> B\<rbrakk> \<Longrightarrow> open (\<Union> B')
 2. \<And>x. \<lbrakk>\<forall>x. open x = (\<exists>B'\<subseteq>B. \<Union> B' = x); x \<in> B\<rbrakk> \<Longrightarrow> open x
 3. \<And>x. \<lbrakk>\<forall>x. open x = (\<exists>B'\<subseteq>B. \<Union> B' = x); open x\<rbrakk> \<Longrightarrow> \<exists>B'\<subseteq>B. \<Union> B' = x
[PROOF STEP]
apply fastforce
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>\<forall>x. open x = (\<exists>B'\<subseteq>B. \<Union> B' = x); x \<in> B\<rbrakk> \<Longrightarrow> open x
 2. \<And>x. \<lbrakk>\<forall>x. open x = (\<exists>B'\<subseteq>B. \<Union> B' = x); open x\<rbrakk> \<Longrightarrow> \<exists>B'\<subseteq>B. \<Union> B' = x
[PROOF STEP]
apply (erule_tac x=x in allE, simp)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>x \<in> B; open x = (\<exists>B'\<subseteq>B. \<Union> B' = x)\<rbrakk> \<Longrightarrow> \<exists>B'\<subseteq>B. \<Union> B' = x
 2. \<And>x. \<lbrakk>\<forall>x. open x = (\<exists>B'\<subseteq>B. \<Union> B' = x); open x\<rbrakk> \<Longrightarrow> \<exists>B'\<subseteq>B. \<Union> B' = x
[PROOF STEP]
apply (rule_tac x="{x}" in exI, auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma continuous_prod [continuous_intros]:
  fixes f :: "'a \<Rightarrow> 'b::t2_space \<Rightarrow> 'c::{real_normed_algebra,comm_ring_1}"
  shows "(\<And>i. i \<in> S \<Longrightarrow> continuous F (f i)) \<Longrightarrow> continuous F (\<lambda>x. \<Prod>i\<in>S. f i x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. i \<in> S \<Longrightarrow> continuous F (f i)) \<Longrightarrow> continuous F (\<lambda>x. \<Prod>i\<in>S. f i x)
[PROOF STEP]
unfolding continuous_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. i \<in> S \<Longrightarrow> (f i \<longlongrightarrow> f i (Lim F (\<lambda>x. x))) F) \<Longrightarrow> ((\<lambda>x. \<Prod>i\<in>S. f i x) \<longlongrightarrow> (\<Prod>i\<in>S. f i (Lim F (\<lambda>x. x)))) F
[PROOF STEP]
by (rule tendsto_prod)


[STATEMENT]
lemma powhr_minus_divide: "x powhr (- a) = 1 / (x powhr a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x powhr - a = 1 / x powhr a
[PROOF STEP]
by (simp add: divide_inverse powhr_minus)


[STATEMENT]
lemma collinear_quadratic:
  assumes "t = i *\<^sub>R a + r"
  shows "t \<bullet> (M *v t) =
  (a \<bullet> (M *v a)) * i\<^sup>2 + 2 * (a \<bullet> (M *v r)) * i + r \<bullet> (M *v r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t \<bullet> (M *v t) = a \<bullet> (M *v a) * i\<^sup>2 + 2 * (a \<bullet> (M *v r)) * i + r \<bullet> (M *v r)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. t \<bullet> (M *v t) = a \<bullet> (M *v a) * i\<^sup>2 + 2 * (a \<bullet> (M *v r)) * i + r \<bullet> (M *v r)
[PROOF STEP]
from M_reverse
[PROOF STATE]
proof (chain)
picking this:
?a \<bullet> (M *v ?b) = ?b \<bullet> (M *v ?a)
[PROOF STEP]
have "i * (a \<bullet> (M *v r)) = i * (r \<bullet> (M *v a))"
[PROOF STATE]
proof (prove)
using this:
?a \<bullet> (M *v ?b) = ?b \<bullet> (M *v ?a)

goal (1 subgoal):
 1. i * (a \<bullet> (M *v r)) = i * (r \<bullet> (M *v a))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
i * (a \<bullet> (M *v r)) = i * (r \<bullet> (M *v a))

goal (1 subgoal):
 1. t \<bullet> (M *v t) = a \<bullet> (M *v a) * i\<^sup>2 + 2 * (a \<bullet> (M *v r)) * i + r \<bullet> (M *v r)
[PROOF STEP]
with \<open>t = i *\<^sub>R a + r\<close>
[PROOF STATE]
proof (chain)
picking this:
t = i *\<^sub>R a + r
i * (a \<bullet> (M *v r)) = i * (r \<bullet> (M *v a))
[PROOF STEP]
show "t \<bullet> (M *v t) =
    (a \<bullet> (M *v a)) * i\<^sup>2 + 2 * (a \<bullet> (M *v r)) * i + r \<bullet> (M *v r)"
[PROOF STATE]
proof (prove)
using this:
t = i *\<^sub>R a + r
i * (a \<bullet> (M *v r)) = i * (r \<bullet> (M *v a))

goal (1 subgoal):
 1. t \<bullet> (M *v t) = a \<bullet> (M *v a) * i\<^sup>2 + 2 * (a \<bullet> (M *v r)) * i + r \<bullet> (M *v r)
[PROOF STEP]
by (simp add:
      inner_add_left
      matrix_vector_right_distrib
      inner_add_right
      matrix_scaleR_vector_ac
      inner_scaleR_right
      scaleR_matrix_vector_assoc [symmetric]
      M_reverse
      power2_eq_square
      algebra_simps)
[PROOF STATE]
proof (state)
this:
t \<bullet> (M *v t) = a \<bullet> (M *v a) * i\<^sup>2 + 2 * (a \<bullet> (M *v r)) * i + r \<bullet> (M *v r)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma multiplicity_characterization'_nat: "finite {p. 0 < f (p::nat)} \<longrightarrow>
    (\<forall>p. 0 < f p \<longrightarrow> prime p) \<longrightarrow> prime p \<longrightarrow>
      multiplicity p (\<Prod>p | 0 < f p. p ^ f p) = f p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {p. 0 < f p} \<longrightarrow> (\<forall>p. 0 < f p \<longrightarrow> prime p) \<longrightarrow> prime p \<longrightarrow> multiplicity p (\<Prod>p\<in>{p. 0 < f p}. p ^ f p) = f p
[PROOF STEP]
by (intro impI, rule multiplicity_characterization_nat) auto


[STATEMENT]
lemma line_integral_on_pair_straight_path:
  fixes F::"('a::euclidean_space) \<Rightarrow> 'a" and g :: "real \<Rightarrow> real" and \<gamma>
  assumes gamma_const: "\<forall>x. \<gamma>(x)\<bullet> i = a"
      and gamma_smooth: "\<forall>x \<in> {0 .. 1}. \<gamma> differentiable at x"
  shows "(line_integral F {i} \<gamma>) = 0" "(line_integral_exists F {i} \<gamma>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. line_integral F {i} \<gamma> = 0 &&& line_integral_exists F {i} \<gamma>
[PROOF STEP]
proof (simp add: line_integral_def)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. integral {0..1} (\<lambda>x. F (\<gamma> x) \<bullet> i * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> i)) = 0
 2. line_integral_exists F {i} \<gamma>
[PROOF STEP]
have *: "F (\<gamma> x) \<bullet> i * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> i) = 0"
    if "0 \<le> x \<and> x \<le> 1" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F (\<gamma> x) \<bullet> i * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> i) = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. F (\<gamma> x) \<bullet> i * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> i) = 0
[PROOF STEP]
have "((\<lambda>x. \<gamma>(x)\<bullet> i) has_vector_derivative 0) (at x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. \<gamma> x \<bullet> i) has_vector_derivative 0) (at x)
[PROOF STEP]
using vector_derivative_const_at[of "a" "x"] and gamma_const
[PROOF STATE]
proof (prove)
using this:
vector_derivative (\<lambda>x. a) (at x) = 0
\<forall>x. \<gamma> x \<bullet> i = a

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

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

goal (1 subgoal):
 1. vector_derivative \<gamma> (at x) \<bullet> i = 0
[PROOF STEP]
using derivative_component_fun_component[ of "\<gamma>" "x" "i"]
        and gamma_smooth and that
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. \<gamma> x \<bullet> i) has_vector_derivative 0) (at x)
\<gamma> differentiable at x \<Longrightarrow> vector_derivative \<gamma> (at x) \<bullet> i = vector_derivative (\<lambda>x. \<gamma> x \<bullet> i) (at x)
\<forall>x\<in>{0..1}. \<gamma> differentiable at x
0 \<le> x \<and> x \<le> 1

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

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

goal (1 subgoal):
 1. vector_derivative \<gamma> (at x within {0..1}) \<bullet> i = 0
[PROOF STEP]
using has_vector_derivative_at_within vector_derivative_at_within_ivl that
[PROOF STATE]
proof (prove)
using this:
vector_derivative \<gamma> (at x) \<bullet> i = 0
(?f has_vector_derivative ?f') (at ?x) \<Longrightarrow> (?f has_vector_derivative ?f') (at ?x within ?S)
\<lbrakk>(?f has_vector_derivative ?f') (at ?x); ?a \<le> ?x; ?x \<le> ?b; ?a < ?b\<rbrakk> \<Longrightarrow> vector_derivative ?f (at ?x within {?a..?b}) = ?f'
0 \<le> x \<and> x \<le> 1

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

goal (1 subgoal):
 1. F (\<gamma> x) \<bullet> i * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> i) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
vector_derivative \<gamma> (at x within {0..1}) \<bullet> i = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
vector_derivative \<gamma> (at x within {0..1}) \<bullet> i = 0

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 \<le> ?x \<and> ?x \<le> 1 \<Longrightarrow> F (\<gamma> ?x) \<bullet> i * (vector_derivative \<gamma> (at ?x within {0..1}) \<bullet> i) = 0

goal (2 subgoals):
 1. integral {0..1} (\<lambda>x. F (\<gamma> x) \<bullet> i * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> i)) = 0
 2. line_integral_exists F {i} \<gamma>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 \<le> ?x \<and> ?x \<le> 1 \<Longrightarrow> F (\<gamma> ?x) \<bullet> i * (vector_derivative \<gamma> (at ?x within {0..1}) \<bullet> i) = 0
[PROOF STEP]
have "((\<lambda>x. F (\<gamma> x) \<bullet> i * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> i)) has_integral 0) {0..1}"
[PROOF STATE]
proof (prove)
using this:
0 \<le> ?x \<and> ?x \<le> 1 \<Longrightarrow> F (\<gamma> ?x) \<bullet> i * (vector_derivative \<gamma> (at ?x within {0..1}) \<bullet> i) = 0

goal (1 subgoal):
 1. ((\<lambda>x. F (\<gamma> x) \<bullet> i * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> i)) has_integral 0) {0..1}
[PROOF STEP]
using has_integral_is_0[of "{0 .. 1}" "(\<lambda>x. F (\<gamma> x) \<bullet> i * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> i))"]
[PROOF STATE]
proof (prove)
using this:
0 \<le> ?x \<and> ?x \<le> 1 \<Longrightarrow> F (\<gamma> ?x) \<bullet> i * (vector_derivative \<gamma> (at ?x within {0..1}) \<bullet> i) = 0
(\<And>x. x \<in> {0..1} \<Longrightarrow> F (\<gamma> x) \<bullet> i * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> i) = 0) \<Longrightarrow> ((\<lambda>x. F (\<gamma> x) \<bullet> i * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> i)) has_integral 0) {0..1}

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

goal (2 subgoals):
 1. integral {0..1} (\<lambda>x. F (\<gamma> x) \<bullet> i * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> i)) = 0
 2. line_integral_exists F {i} \<gamma>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. F (\<gamma> x) \<bullet> i * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> i)) has_integral 0) {0..1}
[PROOF STEP]
have "((\<lambda>x. F (\<gamma> x) \<bullet> i * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> i)) integrable_on {0..1})"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. F (\<gamma> x) \<bullet> i * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> i)) has_integral 0) {0..1}

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

goal (2 subgoals):
 1. integral {0..1} (\<lambda>x. F (\<gamma> x) \<bullet> i * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> i)) = 0
 2. line_integral_exists F {i} \<gamma>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. F (\<gamma> x) \<bullet> i * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> i)) integrable_on {0..1}
[PROOF STEP]
show "line_integral_exists F {i} \<gamma>"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. F (\<gamma> x) \<bullet> i * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> i)) integrable_on {0..1}

goal (1 subgoal):
 1. line_integral_exists F {i} \<gamma>
[PROOF STEP]
by (auto simp add:line_integral_exists_def)
[PROOF STATE]
proof (state)
this:
line_integral_exists F {i} \<gamma>

goal (1 subgoal):
 1. integral {0..1} (\<lambda>x. F (\<gamma> x) \<bullet> i * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> i)) = 0
[PROOF STEP]
show "integral {0..1} (\<lambda>x. F (\<gamma> x) \<bullet> i * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> i)) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral {0..1} (\<lambda>x. F (\<gamma> x) \<bullet> i * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> i)) = 0
[PROOF STEP]
using * has_integral_is_0[of "{0 .. 1}" "(\<lambda>x. F (\<gamma> x) \<bullet> i * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> i))"]
[PROOF STATE]
proof (prove)
using this:
0 \<le> ?x \<and> ?x \<le> 1 \<Longrightarrow> F (\<gamma> ?x) \<bullet> i * (vector_derivative \<gamma> (at ?x within {0..1}) \<bullet> i) = 0
(\<And>x. x \<in> {0..1} \<Longrightarrow> F (\<gamma> x) \<bullet> i * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> i) = 0) \<Longrightarrow> ((\<lambda>x. F (\<gamma> x) \<bullet> i * (vector_derivative \<gamma> (at x within {0..1}) \<bullet> i)) has_integral 0) {0..1}

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma complex_cnj_zero [simp]: "cnj 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnj 0 = 0
[PROOF STEP]
by (simp add: complex_eq_iff)