[STATEMENT]
lemma normal_vector: assumes fin: "finite W"
  and card: "Suc (card W) = n"
  and lin: "lin_indpt W"
  and W: "W \<subseteq> carrier_vec n"
shows "normal_vector W \<in> carrier_vec n"
  "normal_vector W \<noteq> 0\<^sub>v n"
  "w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = 0"
  "w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = 0"
  "lin_indpt (insert (normal_vector W) W)"
  "normal_vector W \<notin> W"
  "is_det_bound db \<Longrightarrow> W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd) \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n-1) Bnd))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (normal_vector W \<in> carrier_vec n &&& normal_vector W \<noteq> 0\<^sub>v n &&& (w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a))) &&& ((w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)) &&& lin_indpt (insert (normal_vector W) W)) &&& normal_vector W \<notin> W &&& (\<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
define ws where "ws = (SOME ws. set ws = W \<and> distinct ws)"
[PROOF STATE]
proof (state)
this:
ws = (SOME ws. set ws = W \<and> distinct ws)

goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
from finite_distinct_list[OF fin]
[PROOF STATE]
proof (chain)
picking this:
\<exists>xs. set xs = W \<and> distinct xs
[PROOF STEP]
have "\<exists> ws. set ws = W \<and> distinct ws"
[PROOF STATE]
proof (prove)
using this:
\<exists>xs. set xs = W \<and> distinct xs

goal (1 subgoal):
 1. \<exists>ws. set ws = W \<and> distinct ws
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>ws. set ws = W \<and> distinct ws

goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
from someI_ex[OF this, folded ws_def]
[PROOF STATE]
proof (chain)
picking this:
set ws = W \<and> distinct ws
[PROOF STEP]
have id: "set ws = W" and dist: "distinct ws"
[PROOF STATE]
proof (prove)
using this:
set ws = W \<and> distinct ws

goal (1 subgoal):
 1. set ws = W &&& distinct ws
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set ws = W
distinct ws

goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
have len: "length ws = card W"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length ws = card W
[PROOF STEP]
using distinct_card[OF dist] id
[PROOF STATE]
proof (prove)
using this:
card (set ws) = length ws
set ws = W

goal (1 subgoal):
 1. length ws = card W
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length ws = card W

goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
let ?n = "length ws"
[PROOF STATE]
proof (state)
goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
define B where "B = (\<lambda> j. mat ?n ?n (\<lambda>(i, j'). ws ! i $ (if j' < j then j' else Suc j')))"
[PROOF STATE]
proof (state)
this:
B = (\<lambda>j. mat (length ws) (length ws) (\<lambda>(i, j'). ws ! i $ (if j' < j then j' else Suc j')))

goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
define nv where "nv = vec n (\<lambda> j. (-1)^(?n+j) * det (B j))"
[PROOF STATE]
proof (state)
this:
nv = vec n (\<lambda>j. (- (1::'a)) ^ (length ws + j) * det (B j))

goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
have nv2: "normal_vector W = nv"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. normal_vector W = nv
[PROOF STEP]
unfolding normal_vector_def Let_def
      ws_def[symmetric] B_def nv_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec n (\<lambda>j. (- (1::'a)) ^ (length ws + j) * det (mat (length ws) (length ws) (\<lambda>(i, j'). ws ! i $ (if j' < j then j' else Suc j')))) = vec n (\<lambda>j. (- (1::'a)) ^ (length ws + j) * det (mat (length ws) (length ws) (\<lambda>(i, j'). ws ! i $ (if j' < j then j' else Suc j'))))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
normal_vector W = nv

goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
define A where "A = (\<lambda> w. mat_of_rows n (ws @ [w]))"
[PROOF STATE]
proof (state)
this:
A = (\<lambda>w. mat_of_rows n (ws @ [w]))

goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
from len id card
[PROOF STATE]
proof (chain)
picking this:
length ws = card W
set ws = W
Suc (card W) = n
[PROOF STEP]
have len: "Suc ?n = n"
[PROOF STATE]
proof (prove)
using this:
length ws = card W
set ws = W
Suc (card W) = n

goal (1 subgoal):
 1. Suc (length ws) = n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Suc (length ws) = n

goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
have A: "A w \<in> carrier_mat n n" for w
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A w \<in> carrier_mat n n
[PROOF STEP]
using id W len
[PROOF STATE]
proof (prove)
using this:
set ws = W
W \<subseteq> carrier_vec n
Suc (length ws) = n

goal (1 subgoal):
 1. A w \<in> carrier_mat n n
[PROOF STEP]
unfolding A_def
[PROOF STATE]
proof (prove)
using this:
set ws = W
W \<subseteq> carrier_vec n
Suc (length ws) = n

goal (1 subgoal):
 1. mat_of_rows n (ws @ [w]) \<in> carrier_mat n n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A ?w3 \<in> carrier_mat n n

goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
A ?w3 \<in> carrier_mat n n

goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
fix w :: "'a vec"
[PROOF STATE]
proof (state)
goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
assume w: "w \<in> carrier_vec n"
[PROOF STATE]
proof (state)
this:
w \<in> carrier_vec n

goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
from len
[PROOF STATE]
proof (chain)
picking this:
Suc (length ws) = n
[PROOF STEP]
have n1[simp]: "n - Suc 0 = ?n"
[PROOF STATE]
proof (prove)
using this:
Suc (length ws) = n

goal (1 subgoal):
 1. n - Suc 0 = length ws
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n - Suc 0 = length ws

goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
n - Suc 0 = length ws

goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
fix j
[PROOF STATE]
proof (state)
goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
assume j: "j < n"
[PROOF STATE]
proof (state)
this:
j < n

goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
have "mat_delete (A w) ?n j = B j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_delete (A w) (length ws) j = B j
[PROOF STEP]
unfolding mat_delete_def A_def mat_of_rows_def B_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat (dim_row (mat (length (ws @ [w])) n (\<lambda>(i, y). (ws @ [w]) ! i $ y)) - 1) (dim_col (mat (length (ws @ [w])) n (\<lambda>(i, y). (ws @ [w]) ! i $ y)) - 1) (\<lambda>(i', j'). mat (length (ws @ [w])) n (\<lambda>(i, y). (ws @ [w]) ! i $ y) $$ (if i' < length ws then i' else Suc i', if j' < j then j' else Suc j')) = mat (length ws) (length ws) (\<lambda>(i, j'). ws ! i $ (if j' < j then j' else Suc j'))
[PROOF STEP]
by (rule eq_matI, insert j len, auto simp: nth_append)
[PROOF STATE]
proof (state)
this:
mat_delete (A w) (length ws) j = B j

goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?j5 < n \<Longrightarrow> mat_delete (A w) (length ws) ?j5 = B ?j5

goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
note B = this
[PROOF STATE]
proof (state)
this:
?j5 < n \<Longrightarrow> mat_delete (A w) (length ws) ?j5 = B ?j5

goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
have "det (A w) = (\<Sum>j<n. (A w) $$ (length ws, j) * cofactor (A w) ?n j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (A w) = (\<Sum>j<n. A w $$ (length ws, j) * cofactor (A w) (length ws) j)
[PROOF STEP]
by (subst laplace_expansion_row[OF A, of ?n], insert len, auto)
[PROOF STATE]
proof (state)
this:
det (A w) = (\<Sum>j<n. A w $$ (length ws, j) * cofactor (A w) (length ws) j)

goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
det (A w) = (\<Sum>j<n. A w $$ (length ws, j) * cofactor (A w) (length ws) j)

goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
have "\<dots> = (\<Sum>j<n. w $ j * (-1)^(?n+j) * det (mat_delete (A w) ?n j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j<n. A w $$ (length ws, j) * cofactor (A w) (length ws) j) = (\<Sum>j<n. w $ j * (- (1::'a)) ^ (length ws + j) * det (mat_delete (A w) (length ws) j))
[PROOF STEP]
by (rule sum.cong, auto simp: A_def mat_of_rows_def cofactor_def)
[PROOF STATE]
proof (state)
this:
(\<Sum>j<n. A w $$ (length ws, j) * cofactor (A w) (length ws) j) = (\<Sum>j<n. w $ j * (- (1::'a)) ^ (length ws + j) * det (mat_delete (A w) (length ws) j))

goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>j<n. A w $$ (length ws, j) * cofactor (A w) (length ws) j) = (\<Sum>j<n. w $ j * (- (1::'a)) ^ (length ws + j) * det (mat_delete (A w) (length ws) j))

goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
have "\<dots> = (\<Sum>j<n. w $ j * (-1)^(?n+j) * det (B j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j<n. w $ j * (- (1::'a)) ^ (length ws + j) * det (mat_delete (A w) (length ws) j)) = (\<Sum>j<n. w $ j * (- (1::'a)) ^ (length ws + j) * det (B j))
[PROOF STEP]
by (rule sum.cong[OF refl], subst B, auto)
[PROOF STATE]
proof (state)
this:
(\<Sum>j<n. w $ j * (- (1::'a)) ^ (length ws + j) * det (mat_delete (A w) (length ws) j)) = (\<Sum>j<n. w $ j * (- (1::'a)) ^ (length ws + j) * det (B j))

goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>j<n. w $ j * (- (1::'a)) ^ (length ws + j) * det (mat_delete (A w) (length ws) j)) = (\<Sum>j<n. w $ j * (- (1::'a)) ^ (length ws + j) * det (B j))

goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
have "\<dots> = (\<Sum>j<n. w $ j * nv $ j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j<n. w $ j * (- (1::'a)) ^ (length ws + j) * det (B j)) = (\<Sum>j<n. w $ j * nv $ j)
[PROOF STEP]
by (rule sum.cong[OF refl], auto simp: nv_def)
[PROOF STATE]
proof (state)
this:
(\<Sum>j<n. w $ j * (- (1::'a)) ^ (length ws + j) * det (B j)) = (\<Sum>j<n. w $ j * nv $ j)

goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>j<n. w $ j * (- (1::'a)) ^ (length ws + j) * det (B j)) = (\<Sum>j<n. w $ j * nv $ j)

goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
have "\<dots> = w \<bullet> nv"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j<n. w $ j * nv $ j) = w \<bullet> nv
[PROOF STEP]
unfolding scalar_prod_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j<n. w $ j * nv $ j) = (\<Sum>i = 0..<dim_vec nv. w $ i * nv $ i)
[PROOF STEP]
unfolding nv_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j<n. w $ j * vec n (\<lambda>j. (- (1::'a)) ^ (length ws + j) * det (B j)) $ j) = (\<Sum>i = 0..<dim_vec (vec n (\<lambda>j. (- (1::'a)) ^ (length ws + j) * det (B j))). w $ i * vec n (\<lambda>j. (- (1::'a)) ^ (length ws + j) * det (B j)) $ i)
[PROOF STEP]
by (rule sum.cong, auto)
[PROOF STATE]
proof (state)
this:
(\<Sum>j<n. w $ j * nv $ j) = w \<bullet> nv

goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
det (A w) = w \<bullet> nv
[PROOF STEP]
have "det (A w) = w \<bullet> nv"
[PROOF STATE]
proof (prove)
using this:
det (A w) = w \<bullet> nv

goal (1 subgoal):
 1. det (A w) = w \<bullet> nv
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
det (A w) = w \<bullet> nv

goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?wa5 \<in> carrier_vec n \<Longrightarrow> det (A ?wa5) = ?wa5 \<bullet> nv

goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
note det_scalar = this
[PROOF STATE]
proof (state)
this:
?wa5 \<in> carrier_vec n \<Longrightarrow> det (A ?wa5) = ?wa5 \<bullet> nv

goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
have nv: "nv \<in> carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nv \<in> carrier_vec n
[PROOF STEP]
unfolding nv_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec n (\<lambda>j. (- (1::'a)) ^ (length ws + j) * det (B j)) \<in> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
nv \<in> carrier_vec n

goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
nv \<in> carrier_vec n

goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
fix w
[PROOF STATE]
proof (state)
goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
assume wW: "w \<in> W"
[PROOF STATE]
proof (state)
this:
w \<in> W

goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
with W
[PROOF STATE]
proof (chain)
picking this:
W \<subseteq> carrier_vec n
w \<in> W
[PROOF STEP]
have w: "w \<in> carrier_vec n"
[PROOF STATE]
proof (prove)
using this:
W \<subseteq> carrier_vec n
w \<in> W

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

goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
from wW id
[PROOF STATE]
proof (chain)
picking this:
w \<in> W
set ws = W
[PROOF STEP]
obtain i where i: "i < ?n" and ws: "ws ! i = w"
[PROOF STATE]
proof (prove)
using this:
w \<in> W
set ws = W

goal (1 subgoal):
 1. (\<And>i. \<lbrakk>i < length ws; ws ! i = w\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding set_conv_nth
[PROOF STATE]
proof (prove)
using this:
w \<in> W
{ws ! i |i. i < length ws} = W

goal (1 subgoal):
 1. (\<And>i. \<lbrakk>i < length ws; ws ! i = w\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i < length ws
ws ! i = w

goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
from det_scalar[OF w]
[PROOF STATE]
proof (chain)
picking this:
det (A w) = w \<bullet> nv
[PROOF STEP]
have "det (A w) = w \<bullet> nv"
[PROOF STATE]
proof (prove)
using this:
det (A w) = w \<bullet> nv

goal (1 subgoal):
 1. det (A w) = w \<bullet> nv
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
det (A w) = w \<bullet> nv

goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
det (A w) = w \<bullet> nv

goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
have "det (A w) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (A w) = (0::'a)
[PROOF STEP]
by (subst det_identical_rows[OF A, of i ?n], insert i ws len, auto simp: A_def mat_of_rows_def nth_append)
[PROOF STATE]
proof (state)
this:
det (A w) = (0::'a)

goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(0::'a) = w \<bullet> nv
[PROOF STEP]
have "w \<bullet> nv = 0"
[PROOF STATE]
proof (prove)
using this:
(0::'a) = w \<bullet> nv

goal (1 subgoal):
 1. w \<bullet> nv = (0::'a)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
w \<bullet> nv = (0::'a)

goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
note this this[unfolded comm_scalar_prod[OF w nv]]
[PROOF STATE]
proof (state)
this:
w \<bullet> nv = (0::'a)
nv \<bullet> w = (0::'a)

goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?wa5 \<in> W \<Longrightarrow> ?wa5 \<bullet> nv = (0::'a)
?wa5 \<in> W \<Longrightarrow> nv \<bullet> ?wa5 = (0::'a)

goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
note ortho = this
[PROOF STATE]
proof (state)
this:
?wa5 \<in> W \<Longrightarrow> ?wa5 \<bullet> nv = (0::'a)
?wa5 \<in> W \<Longrightarrow> nv \<bullet> ?wa5 = (0::'a)

goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
have nv0: "nv \<noteq> 0\<^sub>v n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nv \<noteq> 0\<^sub>v n
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. nv = 0\<^sub>v n \<Longrightarrow> False
[PROOF STEP]
assume nv: "nv = 0\<^sub>v n"
[PROOF STATE]
proof (state)
this:
nv = 0\<^sub>v n

goal (1 subgoal):
 1. nv = 0\<^sub>v n \<Longrightarrow> False
[PROOF STEP]
define bs where "bs = basis_extension ws"
[PROOF STATE]
proof (state)
this:
bs = basis_extension ws

goal (1 subgoal):
 1. nv = 0\<^sub>v n \<Longrightarrow> False
[PROOF STEP]
define w where "w = hd bs"
[PROOF STATE]
proof (state)
this:
w = hd bs

goal (1 subgoal):
 1. nv = 0\<^sub>v n \<Longrightarrow> False
[PROOF STEP]
have "lin_indpt_list ws"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lin_indpt_list ws
[PROOF STEP]
using dist lin W
[PROOF STATE]
proof (prove)
using this:
distinct ws
lin_indpt W
W \<subseteq> carrier_vec n

goal (1 subgoal):
 1. lin_indpt_list ws
[PROOF STEP]
unfolding lin_indpt_list_def id
[PROOF STATE]
proof (prove)
using this:
distinct ws
lin_indpt W
W \<subseteq> carrier_vec n

goal (1 subgoal):
 1. W \<subseteq> carrier_vec n \<and> distinct ws \<and> lin_indpt W
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lin_indpt_list ws

goal (1 subgoal):
 1. nv = 0\<^sub>v n \<Longrightarrow> False
[PROOF STEP]
from basis_extension[OF this, folded bs_def] len
[PROOF STATE]
proof (chain)
picking this:
set bs \<subseteq> set (unit_vecs n)
lin_indpt_list (ws @ bs)
length (ws @ bs) = n
Suc (length ws) = n
[PROOF STEP]
have lin: "lin_indpt_list (ws @ bs)" and "length bs = 1" and bsc: "set bs \<subseteq> carrier_vec n"
[PROOF STATE]
proof (prove)
using this:
set bs \<subseteq> set (unit_vecs n)
lin_indpt_list (ws @ bs)
length (ws @ bs) = n
Suc (length ws) = n

goal (1 subgoal):
 1. lin_indpt_list (ws @ bs) &&& length bs = 1 &&& set bs \<subseteq> carrier_vec n
[PROOF STEP]
by (auto simp: unit_vecs_def)
[PROOF STATE]
proof (state)
this:
lin_indpt_list (ws @ bs)
length bs = 1
set bs \<subseteq> carrier_vec n

goal (1 subgoal):
 1. nv = 0\<^sub>v n \<Longrightarrow> False
[PROOF STEP]
hence bs: "bs = [w]"
[PROOF STATE]
proof (prove)
using this:
lin_indpt_list (ws @ bs)
length bs = 1
set bs \<subseteq> carrier_vec n

goal (1 subgoal):
 1. bs = [w]
[PROOF STEP]
unfolding w_def
[PROOF STATE]
proof (prove)
using this:
lin_indpt_list (ws @ bs)
length bs = 1
set bs \<subseteq> carrier_vec n

goal (1 subgoal):
 1. bs = [hd bs]
[PROOF STEP]
by (cases bs, auto)
[PROOF STATE]
proof (state)
this:
bs = [w]

goal (1 subgoal):
 1. nv = 0\<^sub>v n \<Longrightarrow> False
[PROOF STEP]
with bsc
[PROOF STATE]
proof (chain)
picking this:
set bs \<subseteq> carrier_vec n
bs = [w]
[PROOF STEP]
have w: "w \<in> carrier_vec n"
[PROOF STATE]
proof (prove)
using this:
set bs \<subseteq> carrier_vec n
bs = [w]

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

goal (1 subgoal):
 1. nv = 0\<^sub>v n \<Longrightarrow> False
[PROOF STEP]
note lin = lin[unfolded bs]
[PROOF STATE]
proof (state)
this:
lin_indpt_list (ws @ [w])

goal (1 subgoal):
 1. nv = 0\<^sub>v n \<Longrightarrow> False
[PROOF STEP]
from lin_indpt_list_length_eq_n[OF lin] len
[PROOF STATE]
proof (chain)
picking this:
length (ws @ [w]) = n \<Longrightarrow> local.span (set (ws @ [w])) = carrier_vec n
length (ws @ [w]) = n \<Longrightarrow> basis (set (ws @ [w]))
Suc (length ws) = n
[PROOF STEP]
have basis: "basis (set (ws @ [w]))"
[PROOF STATE]
proof (prove)
using this:
length (ws @ [w]) = n \<Longrightarrow> local.span (set (ws @ [w])) = carrier_vec n
length (ws @ [w]) = n \<Longrightarrow> basis (set (ws @ [w]))
Suc (length ws) = n

goal (1 subgoal):
 1. basis (set (ws @ [w]))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
basis (set (ws @ [w]))

goal (1 subgoal):
 1. nv = 0\<^sub>v n \<Longrightarrow> False
[PROOF STEP]
from w det_scalar nv
[PROOF STATE]
proof (chain)
picking this:
w \<in> carrier_vec n
?wa5 \<in> carrier_vec n \<Longrightarrow> det (A ?wa5) = ?wa5 \<bullet> nv
nv = 0\<^sub>v n
[PROOF STEP]
have det0: "det (A w) = 0"
[PROOF STATE]
proof (prove)
using this:
w \<in> carrier_vec n
?wa5 \<in> carrier_vec n \<Longrightarrow> det (A ?wa5) = ?wa5 \<bullet> nv
nv = 0\<^sub>v n

goal (1 subgoal):
 1. det (A w) = (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
det (A w) = (0::'a)

goal (1 subgoal):
 1. nv = 0\<^sub>v n \<Longrightarrow> False
[PROOF STEP]
with basis_det_nonzero[OF basis] len
[PROOF STATE]
proof (chain)
picking this:
length (ws @ [w]) = n \<Longrightarrow> det (mat_of_rows n (ws @ [w])) \<noteq> (0::'a)
Suc (length ws) = n
det (A w) = (0::'a)
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
length (ws @ [w]) = n \<Longrightarrow> det (mat_of_rows n (ws @ [w])) \<noteq> (0::'a)
Suc (length ws) = n
det (A w) = (0::'a)

goal (1 subgoal):
 1. False
[PROOF STEP]
unfolding A_def
[PROOF STATE]
proof (prove)
using this:
length (ws @ [w]) = n \<Longrightarrow> det (mat_of_rows n (ws @ [w])) \<noteq> (0::'a)
Suc (length ws) = n
det (mat_of_rows n (ws @ [w])) = (0::'a)

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
nv \<noteq> 0\<^sub>v n

goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
let ?nv = "normal_vector W"
[PROOF STATE]
proof (state)
goal (7 subgoals):
 1. normal_vector W \<in> carrier_vec n
 2. normal_vector W \<noteq> 0\<^sub>v n
 3. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)
 4. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a)
 5. lin_indpt (insert (normal_vector W) W)
 6. normal_vector W \<notin> W
 7. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
from ortho nv nv0
[PROOF STATE]
proof (chain)
picking this:
?wa5 \<in> W \<Longrightarrow> ?wa5 \<bullet> nv = (0::'a)
?wa5 \<in> W \<Longrightarrow> nv \<bullet> ?wa5 = (0::'a)
nv \<in> carrier_vec n
nv \<noteq> 0\<^sub>v n
[PROOF STEP]
show nv: "?nv \<in> carrier_vec n"
    and ortho: "\<And> w. w \<in> W \<Longrightarrow> w \<bullet> ?nv = 0"
    "\<And> w. w \<in> W \<Longrightarrow> ?nv \<bullet> w = 0"
    and n0: "?nv \<noteq> 0\<^sub>v n"
[PROOF STATE]
proof (prove)
using this:
?wa5 \<in> W \<Longrightarrow> ?wa5 \<bullet> nv = (0::'a)
?wa5 \<in> W \<Longrightarrow> nv \<bullet> ?wa5 = (0::'a)
nv \<in> carrier_vec n
nv \<noteq> 0\<^sub>v n

goal (1 subgoal):
 1. normal_vector W \<in> carrier_vec n &&& ((\<And>w. w \<in> W \<Longrightarrow> w \<bullet> normal_vector W = (0::'a)) &&& (\<And>w. w \<in> W \<Longrightarrow> normal_vector W \<bullet> w = (0::'a))) &&& normal_vector W \<noteq> 0\<^sub>v n
[PROOF STEP]
unfolding nv2
[PROOF STATE]
proof (prove)
using this:
?wa5 \<in> W \<Longrightarrow> ?wa5 \<bullet> nv = (0::'a)
?wa5 \<in> W \<Longrightarrow> nv \<bullet> ?wa5 = (0::'a)
nv \<in> carrier_vec n
nv \<noteq> 0\<^sub>v n

goal (1 subgoal):
 1. nv \<in> carrier_vec n &&& ((\<And>w. w \<in> W \<Longrightarrow> w \<bullet> nv = (0::'a)) &&& (\<And>w. w \<in> W \<Longrightarrow> nv \<bullet> w = (0::'a))) &&& nv \<noteq> 0\<^sub>v n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
normal_vector W \<in> carrier_vec n
?w3 \<in> W \<Longrightarrow> ?w3 \<bullet> normal_vector W = (0::'a)
?w3 \<in> W \<Longrightarrow> normal_vector W \<bullet> ?w3 = (0::'a)
normal_vector W \<noteq> 0\<^sub>v n

goal (3 subgoals):
 1. lin_indpt (insert (normal_vector W) W)
 2. normal_vector W \<notin> W
 3. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
from n0 nv
[PROOF STATE]
proof (chain)
picking this:
normal_vector W \<noteq> 0\<^sub>v n
normal_vector W \<in> carrier_vec n
[PROOF STEP]
have "sq_norm ?nv \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
normal_vector W \<noteq> 0\<^sub>v n
normal_vector W \<in> carrier_vec n

goal (1 subgoal):
 1. \<parallel>normal_vector W\<parallel>\<^sup>2 \<noteq> (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<parallel>normal_vector W\<parallel>\<^sup>2 \<noteq> (0::'a)

goal (3 subgoals):
 1. lin_indpt (insert (normal_vector W) W)
 2. normal_vector W \<notin> W
 3. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
hence nvnv: "?nv \<bullet> ?nv \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
\<parallel>normal_vector W\<parallel>\<^sup>2 \<noteq> (0::'a)

goal (1 subgoal):
 1. normal_vector W \<bullet> normal_vector W \<noteq> (0::'a)
[PROOF STEP]
by (auto simp: sq_norm_vec_as_cscalar_prod)
[PROOF STATE]
proof (state)
this:
normal_vector W \<bullet> normal_vector W \<noteq> (0::'a)

goal (3 subgoals):
 1. lin_indpt (insert (normal_vector W) W)
 2. normal_vector W \<notin> W
 3. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
show nvW: "?nv \<notin> W"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. normal_vector W \<notin> W
[PROOF STEP]
using nvnv ortho
[PROOF STATE]
proof (prove)
using this:
normal_vector W \<bullet> normal_vector W \<noteq> (0::'a)
?w3 \<in> W \<Longrightarrow> ?w3 \<bullet> normal_vector W = (0::'a)
?w3 \<in> W \<Longrightarrow> normal_vector W \<bullet> ?w3 = (0::'a)

goal (1 subgoal):
 1. normal_vector W \<notin> W
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
normal_vector W \<notin> W

goal (2 subgoals):
 1. lin_indpt (insert (normal_vector W) W)
 2. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
have "?nv \<notin> span W"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. normal_vector W \<notin> local.span W
[PROOF STEP]
using W ortho nvnv nv
[PROOF STATE]
proof (prove)
using this:
W \<subseteq> carrier_vec n
?w3 \<in> W \<Longrightarrow> ?w3 \<bullet> normal_vector W = (0::'a)
?w3 \<in> W \<Longrightarrow> normal_vector W \<bullet> ?w3 = (0::'a)
normal_vector W \<bullet> normal_vector W \<noteq> (0::'a)
normal_vector W \<in> carrier_vec n

goal (1 subgoal):
 1. normal_vector W \<notin> local.span W
[PROOF STEP]
using orthocompl_span
[PROOF STATE]
proof (prove)
using this:
W \<subseteq> carrier_vec n
?w3 \<in> W \<Longrightarrow> ?w3 \<bullet> normal_vector W = (0::'a)
?w3 \<in> W \<Longrightarrow> normal_vector W \<bullet> ?w3 = (0::'a)
normal_vector W \<bullet> normal_vector W \<noteq> (0::'a)
normal_vector W \<in> carrier_vec n
\<lbrakk>\<And>x. x \<in> ?S \<Longrightarrow> ?v \<bullet> x = (0::'a); ?S \<subseteq> carrier_vec n; ?v \<in> carrier_vec n; ?y \<in> local.span ?S\<rbrakk> \<Longrightarrow> ?v \<bullet> ?y = (0::'a)

goal (1 subgoal):
 1. normal_vector W \<notin> local.span W
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
normal_vector W \<notin> local.span W

goal (2 subgoals):
 1. lin_indpt (insert (normal_vector W) W)
 2. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
with lin_dep_iff_in_span[OF W lin nv nvW]
[PROOF STATE]
proof (chain)
picking this:
(normal_vector W \<in> local.span W) = lin_dep (W \<union> {normal_vector W})
normal_vector W \<notin> local.span W
[PROOF STEP]
show "lin_indpt (insert ?nv W)"
[PROOF STATE]
proof (prove)
using this:
(normal_vector W \<in> local.span W) = lin_dep (W \<union> {normal_vector W})
normal_vector W \<notin> local.span W

goal (1 subgoal):
 1. lin_indpt (insert (normal_vector W) W)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lin_indpt (insert (normal_vector W) W)

goal (1 subgoal):
 1. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
lin_indpt (insert (normal_vector W) W)

goal (1 subgoal):
 1. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
assume db: "is_det_bound db"
[PROOF STATE]
proof (state)
this:
is_det_bound db

goal (1 subgoal):
 1. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
assume "W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)"
[PROOF STATE]
proof (state)
this:
W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)

goal (1 subgoal):
 1. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
hence wsI: "set ws \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)"
[PROOF STATE]
proof (prove)
using this:
W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)

goal (1 subgoal):
 1. set ws \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)
[PROOF STEP]
unfolding id
[PROOF STATE]
proof (prove)
using this:
W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)

goal (1 subgoal):
 1. W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set ws \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)

goal (1 subgoal):
 1. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
have ws: "set ws \<subseteq> carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set ws \<subseteq> carrier_vec n
[PROOF STEP]
using W
[PROOF STATE]
proof (prove)
using this:
W \<subseteq> carrier_vec n

goal (1 subgoal):
 1. set ws \<subseteq> carrier_vec n
[PROOF STEP]
unfolding id
[PROOF STATE]
proof (prove)
using this:
W \<subseteq> carrier_vec n

goal (1 subgoal):
 1. W \<subseteq> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set ws \<subseteq> carrier_vec n

goal (1 subgoal):
 1. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
from wsI ws
[PROOF STATE]
proof (chain)
picking this:
set ws \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)
set ws \<subseteq> carrier_vec n
[PROOF STEP]
have wsI: "i < ?n \<Longrightarrow> ws ! i \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd) \<inter> carrier_vec n" for i
[PROOF STATE]
proof (prove)
using this:
set ws \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)
set ws \<subseteq> carrier_vec n

goal (1 subgoal):
 1. i < length ws \<Longrightarrow> ws ! i \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd) \<inter> carrier_vec n
[PROOF STEP]
using len wsI
[PROOF STATE]
proof (prove)
using this:
set ws \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)
set ws \<subseteq> carrier_vec n
Suc (length ws) = n
set ws \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)

goal (1 subgoal):
 1. i < length ws \<Longrightarrow> ws ! i \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd) \<inter> carrier_vec n
[PROOF STEP]
unfolding set_conv_nth
[PROOF STATE]
proof (prove)
using this:
{ws ! i |i. i < length ws} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)
{ws ! i |i. i < length ws} \<subseteq> carrier_vec n
Suc (length ws) = n
{ws ! i |i. i < length ws} \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)

goal (1 subgoal):
 1. i < length ws \<Longrightarrow> ws ! i \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd) \<inter> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?i3 < length ws \<Longrightarrow> ws ! ?i3 \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd) \<inter> carrier_vec n

goal (1 subgoal):
 1. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
have ints: "i < ?n \<Longrightarrow> j < n \<Longrightarrow> ws ! i $ j \<in> \<int>" for i j
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i < length ws; j < n\<rbrakk> \<Longrightarrow> ws ! i $ j \<in> \<int>
[PROOF STEP]
using wsI[of i, unfolded Ints_vec_def]
[PROOF STATE]
proof (prove)
using this:
i < length ws \<Longrightarrow> ws ! i \<in> {x. \<forall>i<dim_vec x. x $ i \<in> \<int>} \<inter> Bounded_vec (of_int Bnd) \<inter> carrier_vec n

goal (1 subgoal):
 1. \<lbrakk>i < length ws; j < n\<rbrakk> \<Longrightarrow> ws ! i $ j \<in> \<int>
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
\<lbrakk>?i3 < length ws; ?j3 < n\<rbrakk> \<Longrightarrow> ws ! ?i3 $ ?j3 \<in> \<int>

goal (1 subgoal):
 1. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
have bnd: "i < ?n \<Longrightarrow> j < n \<Longrightarrow> abs (ws ! i $ j) \<le> of_int Bnd" for i j
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i < length ws; j < n\<rbrakk> \<Longrightarrow> \<bar>ws ! i $ j\<bar> \<le> of_int Bnd
[PROOF STEP]
using wsI[unfolded Bounded_vec_def, of i]
[PROOF STATE]
proof (prove)
using this:
i < length ws \<Longrightarrow> ws ! i \<in> \<int>\<^sub>v \<inter> {x. \<forall>i<dim_vec x. \<bar>x $ i\<bar> \<le> of_int Bnd} \<inter> carrier_vec n

goal (1 subgoal):
 1. \<lbrakk>i < length ws; j < n\<rbrakk> \<Longrightarrow> \<bar>ws ! i $ j\<bar> \<le> of_int Bnd
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<lbrakk>?i3 < length ws; ?j3 < n\<rbrakk> \<Longrightarrow> \<bar>ws ! ?i3 $ ?j3\<bar> \<le> of_int Bnd

goal (1 subgoal):
 1. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
\<lbrakk>?i3 < length ws; ?j3 < n\<rbrakk> \<Longrightarrow> \<bar>ws ! ?i3 $ ?j3\<bar> \<le> of_int Bnd

goal (1 subgoal):
 1. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
assume i: "i < n"
[PROOF STATE]
proof (state)
this:
i < n

goal (1 subgoal):
 1. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
have ints_nv: "nv $ i \<in> \<int>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nv $ i \<in> \<int>
[PROOF STEP]
unfolding nv_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec n (\<lambda>j. (- (1::'a)) ^ (length ws + j) * det (B j)) $ i \<in> \<int>
[PROOF STEP]
using wsI len ws
[PROOF STATE]
proof (prove)
using this:
?i3 < length ws \<Longrightarrow> ws ! ?i3 \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd) \<inter> carrier_vec n
Suc (length ws) = n
set ws \<subseteq> carrier_vec n

goal (1 subgoal):
 1. vec n (\<lambda>j. (- (1::'a)) ^ (length ws + j) * det (B j)) $ i \<in> \<int>
[PROOF STEP]
by (auto simp: i B_def set_conv_nth intro!: Ints_mult Ints_det ints)
[PROOF STATE]
proof (state)
this:
nv $ i \<in> \<int>

goal (1 subgoal):
 1. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
have "B i \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B i \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd)
[PROOF STEP]
unfolding B_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat (length ws) (length ws) (\<lambda>(ia, j'). ws ! ia $ (if j' < i then j' else Suc j')) \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd)
[PROOF STEP]
using len ws i bnd ints_nv
[PROOF STATE]
proof (prove)
using this:
Suc (length ws) = n
set ws \<subseteq> carrier_vec n
i < n
\<lbrakk>?i3 < length ws; ?j3 < n\<rbrakk> \<Longrightarrow> \<bar>ws ! ?i3 $ ?j3\<bar> \<le> of_int Bnd
nv $ i \<in> \<int>

goal (1 subgoal):
 1. mat (length ws) (length ws) (\<lambda>(ia, j'). ws ! ia $ (if j' < i then j' else Suc j')) \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd)
[PROOF STEP]
apply (simp add: Ints_mat_def Ints_vec_def Bounded_mat_def, intro allI impI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>ia j. \<lbrakk>Suc (length ws) = n; set ws \<subseteq> carrier_vec n; i < n; \<And>i j. \<lbrakk>i < length ws; j < n\<rbrakk> \<Longrightarrow> \<bar>ws ! i $ j\<bar> \<le> of_int Bnd; nv $ i \<in> \<int>; Suc (length ws) = n; set ws \<subseteq> carrier_vec n; i < n; \<And>i j. \<lbrakk>i < length ws; j < n\<rbrakk> \<Longrightarrow> \<bar>ws ! i $ j\<bar> \<le> of_int Bnd; nv $ i \<in> \<int>; ia < length ws\<rbrakk> \<Longrightarrow> (j < i \<longrightarrow> ws ! ia $ j \<in> \<int>) \<and> (\<not> j < i \<longrightarrow> j < length ws \<longrightarrow> ws ! ia $ Suc j \<in> \<int>)
[PROOF STEP]
subgoal for ii j
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Suc (length ws) = n; set ws \<subseteq> carrier_vec n; i < n; \<And>i j. \<lbrakk>i < length ws; j < n\<rbrakk> \<Longrightarrow> \<bar>ws ! i $ j\<bar> \<le> of_int Bnd; nv $ i \<in> \<int>; Suc (length ws) = n; set ws \<subseteq> carrier_vec n; i < n; \<And>i j. \<lbrakk>i < length ws; j < n\<rbrakk> \<Longrightarrow> \<bar>ws ! i $ j\<bar> \<le> of_int Bnd; nv $ i \<in> \<int>; ii < length ws\<rbrakk> \<Longrightarrow> (j < i \<longrightarrow> ws ! ii $ j \<in> \<int>) \<and> (\<not> j < i \<longrightarrow> j < length ws \<longrightarrow> ws ! ii $ Suc j \<in> \<int>)
[PROOF STEP]
using ints[of ii j] ints[of ii "Suc j"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>ii < length ws; j < n\<rbrakk> \<Longrightarrow> ws ! ii $ j \<in> \<int>
\<lbrakk>ii < length ws; Suc j < n\<rbrakk> \<Longrightarrow> ws ! ii $ Suc j \<in> \<int>

goal (1 subgoal):
 1. \<lbrakk>Suc (length ws) = n; set ws \<subseteq> carrier_vec n; i < n; \<And>i j. \<lbrakk>i < length ws; j < n\<rbrakk> \<Longrightarrow> \<bar>ws ! i $ j\<bar> \<le> of_int Bnd; nv $ i \<in> \<int>; Suc (length ws) = n; set ws \<subseteq> carrier_vec n; i < n; \<And>i j. \<lbrakk>i < length ws; j < n\<rbrakk> \<Longrightarrow> \<bar>ws ! i $ j\<bar> \<le> of_int Bnd; nv $ i \<in> \<int>; ii < length ws\<rbrakk> \<Longrightarrow> (j < i \<longrightarrow> ws ! ii $ j \<in> \<int>) \<and> (\<not> j < i \<longrightarrow> j < length ws \<longrightarrow> ws ! ii $ Suc j \<in> \<int>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
B i \<in> \<int>\<^sub>m \<inter> Bounded_mat (of_int Bnd)

goal (1 subgoal):
 1. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
from is_det_bound_of_int[OF db _ this, of ?n]
[PROOF STATE]
proof (chain)
picking this:
B i \<in> carrier_mat (length ws) (length ws) \<Longrightarrow> \<bar>det (B i)\<bar> \<le> of_int (db (length ws) Bnd)
[PROOF STEP]
have "\<bar>nv $ i\<bar> \<le> of_int (db (n - 1) Bnd)"
[PROOF STATE]
proof (prove)
using this:
B i \<in> carrier_mat (length ws) (length ws) \<Longrightarrow> \<bar>det (B i)\<bar> \<le> of_int (db (length ws) Bnd)

goal (1 subgoal):
 1. \<bar>nv $ i\<bar> \<le> of_int (db (n - 1) Bnd)
[PROOF STEP]
unfolding nv_def
[PROOF STATE]
proof (prove)
using this:
B i \<in> carrier_mat (length ws) (length ws) \<Longrightarrow> \<bar>det (B i)\<bar> \<le> of_int (db (length ws) Bnd)

goal (1 subgoal):
 1. \<bar>vec n (\<lambda>j. (- (1::'a)) ^ (length ws + j) * det (B j)) $ i\<bar> \<le> of_int (db (n - 1) Bnd)
[PROOF STEP]
using wsI len ws i
[PROOF STATE]
proof (prove)
using this:
B i \<in> carrier_mat (length ws) (length ws) \<Longrightarrow> \<bar>det (B i)\<bar> \<le> of_int (db (length ws) Bnd)
?i3 < length ws \<Longrightarrow> ws ! ?i3 \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd) \<inter> carrier_vec n
Suc (length ws) = n
set ws \<subseteq> carrier_vec n
i < n

goal (1 subgoal):
 1. \<bar>vec n (\<lambda>j. (- (1::'a)) ^ (length ws + j) * det (B j)) $ i\<bar> \<le> of_int (db (n - 1) Bnd)
[PROOF STEP]
by (auto simp: B_def abs_mult bnd)
[PROOF STATE]
proof (state)
this:
\<bar>nv $ i\<bar> \<le> of_int (db (n - 1) Bnd)

goal (1 subgoal):
 1. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
note ints_nv this
[PROOF STATE]
proof (state)
this:
nv $ i \<in> \<int>
\<bar>nv $ i\<bar> \<le> of_int (db (n - 1) Bnd)

goal (1 subgoal):
 1. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?i5 < n \<Longrightarrow> nv $ ?i5 \<in> \<int>
?i5 < n \<Longrightarrow> \<bar>nv $ ?i5\<bar> \<le> of_int (db (n - 1) Bnd)

goal (1 subgoal):
 1. \<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
with nv nv2
[PROOF STATE]
proof (chain)
picking this:
normal_vector W \<in> carrier_vec n
normal_vector W = nv
?i5 < n \<Longrightarrow> nv $ ?i5 \<in> \<int>
?i5 < n \<Longrightarrow> \<bar>nv $ ?i5\<bar> \<le> of_int (db (n - 1) Bnd)
[PROOF STEP]
show "?nv \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))"
[PROOF STATE]
proof (prove)
using this:
normal_vector W \<in> carrier_vec n
normal_vector W = nv
?i5 < n \<Longrightarrow> nv $ ?i5 \<in> \<int>
?i5 < n \<Longrightarrow> \<bar>nv $ ?i5\<bar> \<le> of_int (db (n - 1) Bnd)

goal (1 subgoal):
 1. normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))
[PROOF STEP]
unfolding Ints_vec_def Bounded_vec_def
[PROOF STATE]
proof (prove)
using this:
normal_vector W \<in> carrier_vec n
normal_vector W = nv
?i5 < n \<Longrightarrow> nv $ ?i5 \<in> \<int>
?i5 < n \<Longrightarrow> \<bar>nv $ ?i5\<bar> \<le> of_int (db (n - 1) Bnd)

goal (1 subgoal):
 1. normal_vector W \<in> {x. \<forall>i<dim_vec x. x $ i \<in> \<int>} \<inter> {x. \<forall>i<dim_vec x. \<bar>x $ i\<bar> \<le> of_int (db (n - 1) Bnd)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))

goal:
No subgoals!
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>is_det_bound db; W \<subseteq> \<int>\<^sub>v \<inter> Bounded_vec (of_int Bnd)\<rbrakk> \<Longrightarrow> normal_vector W \<in> \<int>\<^sub>v \<inter> Bounded_vec (of_int (db (n - 1) Bnd))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mset_subseteq_add_iff1:
  "j \<le> (i::nat) \<Longrightarrow> (repeat_mset i u + m \<subseteq># repeat_mset j u + n) = (repeat_mset (i-j) u + m \<subseteq># n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j \<le> i \<Longrightarrow> (repeat_mset i u + m \<subseteq># repeat_mset j u + n) = (repeat_mset (i - j) u + m \<subseteq># n)
[PROOF STEP]
by (auto simp add: subseteq_mset_def nat_le_add_iff1)


[STATEMENT]
lemma mult_less_multiset\<^sub>D\<^sub>M: "(M, N) \<in> mult {(x, y). x < y} \<longleftrightarrow> less_multiset\<^sub>D\<^sub>M M N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((M, N) \<in> mult {(x, y). x < y}) = less_multiset\<^sub>D\<^sub>M M N
[PROOF STEP]
unfolding multp_def[of "(<)", symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multp (<) M N = less_multiset\<^sub>D\<^sub>M M N
[PROOF STEP]
using multp_eq_multp\<^sub>D\<^sub>M[of "(<)", simplified]
[PROOF STATE]
proof (prove)
using this:
multp (<) = multp\<^sub>D\<^sub>M (<)

goal (1 subgoal):
 1. multp (<) M N = less_multiset\<^sub>D\<^sub>M M N
[PROOF STEP]
by (simp add: multp\<^sub>D\<^sub>M_def less_multiset\<^sub>D\<^sub>M_def)


[STATEMENT]
lemma (in PolynRg) polyn_Suc:"Suc n \<le> (fst c) \<Longrightarrow>
       polyn_expr R X (Suc n) ((Suc n), (snd c)) =
               polyn_expr R X n c \<plusminus> ((snd c) (Suc n)) \<cdot>\<^sub>r (X^\<^bsup>R (Suc n)\<^esup>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc n \<le> fst c \<Longrightarrow> polyn_expr R X (Suc n) (Suc n, snd c) = polyn_expr R X n c \<plusminus> snd c (Suc n) \<cdot>\<^sub>r X^\<^bsup>R Suc n\<^esup>
[PROOF STEP]
by (simp add:polyn_expr_def)


[STATEMENT]
lemma m_s2: "finite(X) \<Longrightarrow> S1 = S2 on -X \<Longrightarrow> S1 < S2 \<Longrightarrow> m_s S1 X > m_s S2 X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite X; S1 = S2 on - X; S1 < S2\<rbrakk> \<Longrightarrow> m\<^sub>s S2 X < m\<^sub>s S1 X
[PROOF STEP]
apply(auto simp add: less_fun_def m_s_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite X; S1 = S2 on - X; S1 \<le> S2; S2 \<noteq> S1\<rbrakk> \<Longrightarrow> (\<Sum>x\<in>X. m (S2 x)) < (\<Sum>x\<in>X. m (S1 x))
[PROOF STEP]
apply(simp add: m_s2_rep le_fun_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma diff_empty [simp]: "M - {#} = M \<and> {#} - M = {#}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M - {#} = M \<and> {#} - M = {#}
[PROOF STEP]
by rule (fact Groups.diff_zero, fact Groups.zero_diff)


[STATEMENT]
lemma SEval_append: "SEval m e (xs@ys) = ( (SEval m e xs) | (SEval m e ys))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SEval m e (xs @ ys) = (SEval m e xs \<or> SEval m e ys)
[PROOF STEP]
by (induct xs) auto


[STATEMENT]
lemma mono_maps_chain_to_chain:
  assumes f: "mono f"
  assumes C: "chain C"
  shows "chain (f o C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. chain (f \<circ> C)
[PROOF STEP]
by (metis C comp_def f chain_def mono_def)


[STATEMENT]
lemma of_nat_mono_maybe:
  assumes xlt: "x < 2 ^ len_of TYPE ('a)"
  shows   "y < x \<Longrightarrow> of_nat y < (of_nat x :: 'a :: len word)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y < x \<Longrightarrow> word_of_nat y < word_of_nat x
[PROOF STEP]
apply (subst word_less_nat_alt)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y < x \<Longrightarrow> unat (word_of_nat y) < unat (word_of_nat x)
[PROOF STEP]
apply (subst unat_of_nat)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y < x \<Longrightarrow> y mod 2 ^ LENGTH('a) < x mod 2 ^ LENGTH('a)
[PROOF STEP]
apply (subst mod_less)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. y < x \<Longrightarrow> y < 2 ^ LENGTH('a)
 2. y < x \<Longrightarrow> y < x mod 2 ^ LENGTH('a)
[PROOF STEP]
apply (erule order_less_trans [OF _ xlt])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y < x \<Longrightarrow> y < x mod 2 ^ LENGTH('a)
[PROOF STEP]
apply (subst mod_less [OF xlt])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y < x \<Longrightarrow> y < x
[PROOF STEP]
apply assumption
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma imaginary_eq_real_iff [simp]:
  assumes "y \<in> Reals" "x \<in> Reals"
  shows "\<i> * y = x \<longleftrightarrow> x=0 \<and> y=0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<i> * y = x) = (x = 0 \<and> y = 0)
[PROOF STEP]
by (metis Im_complex_of_real Im_i_times assms mult_zero_right of_real_0 of_real_Re)


[STATEMENT]
lemma Suc_minus_Suc_Suc [simp]:
  "b < n - 1 \<Longrightarrow> Suc (n - Suc (Suc b)) = n - Suc b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b < n - 1 \<Longrightarrow> Suc (n - Suc (Suc b)) = n - Suc b
[PROOF STEP]
by simp


[STATEMENT]
lemma rel_interior_Epigraph:
  fixes f :: "'a::euclidean_space \<Rightarrow> ereal"
  assumes "convex_on UNIV f"
  shows "(x,z) : rel_interior (Epigraph UNIV f) \<longleftrightarrow>
    (x : rel_interior (domain f) \<and> f x < ereal z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((x, z) \<in> rel_interior (Epigraph UNIV f)) = (x \<in> rel_interior (domain f) \<and> f x < ereal z)
[PROOF STEP]
apply (subst rel_interior_projection[of _ "(\<lambda>y. {z. (y, z) : Epigraph UNIV f})"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. convex (Epigraph UNIV f)
 2. (\<lambda>y. {z. (y, z) \<in> Epigraph UNIV f}) = (\<lambda>y. {z. (y, z) \<in> Epigraph UNIV f})
 3. (x \<in> rel_interior {y. {z. (y, z) \<in> Epigraph UNIV f} \<noteq> {}} \<and> z \<in> rel_interior {z. (x, z) \<in> Epigraph UNIV f}) = (x \<in> rel_interior (domain f) \<and> f x < ereal z)
[PROOF STEP]
apply (metis assms convex_EpigraphI convex_UNIV convex_on_ereal_univ)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<lambda>y. {z. (y, z) \<in> Epigraph UNIV f}) = (\<lambda>y. {z. (y, z) \<in> Epigraph UNIV f})
 2. (x \<in> rel_interior {y. {z. (y, z) \<in> Epigraph UNIV f} \<noteq> {}} \<and> z \<in> rel_interior {z. (x, z) \<in> Epigraph UNIV f}) = (x \<in> rel_interior (domain f) \<and> f x < ereal z)
[PROOF STEP]
unfolding domain_Epigraph Epigraph_def
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<lambda>y. {z. (y, z) \<in> {xy. fst xy \<in> UNIV \<and> f (fst xy) \<le> ereal (snd xy)}}) = (\<lambda>y. {z. (y, z) \<in> {xy. fst xy \<in> UNIV \<and> f (fst xy) \<le> ereal (snd xy)}})
 2. (x \<in> rel_interior {y. {z. (y, z) \<in> {xy. fst xy \<in> UNIV \<and> f (fst xy) \<le> ereal (snd xy)}} \<noteq> {}} \<and> z \<in> rel_interior {z. (x, z) \<in> {xy. fst xy \<in> UNIV \<and> f (fst xy) \<le> ereal (snd xy)}}) = (x \<in> rel_interior {x. \<exists>y. (x, y) \<in> {xy. fst xy \<in> UNIV \<and> f (fst xy) \<le> ereal (snd xy)}} \<and> f x < ereal z)
[PROOF STEP]
using rel_interior_ereal_semiline
[PROOF STATE]
proof (prove)
using this:
rel_interior {y. ?a \<le> ereal y} = {y. ?a < ereal y}

goal (2 subgoals):
 1. (\<lambda>y. {z. (y, z) \<in> {xy. fst xy \<in> UNIV \<and> f (fst xy) \<le> ereal (snd xy)}}) = (\<lambda>y. {z. (y, z) \<in> {xy. fst xy \<in> UNIV \<and> f (fst xy) \<le> ereal (snd xy)}})
 2. (x \<in> rel_interior {y. {z. (y, z) \<in> {xy. fst xy \<in> UNIV \<and> f (fst xy) \<le> ereal (snd xy)}} \<noteq> {}} \<and> z \<in> rel_interior {z. (x, z) \<in> {xy. fst xy \<in> UNIV \<and> f (fst xy) \<le> ereal (snd xy)}}) = (x \<in> rel_interior {x. \<exists>y. (x, y) \<in> {xy. fst xy \<in> UNIV \<and> f (fst xy) \<le> ereal (snd xy)}} \<and> f x < ereal z)
[PROOF STEP]
by auto


[STATEMENT]
lemma trace_plus[simp]: "trace (A + B) = trace A + trace B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Square_Matrix.trace (A + B) = Square_Matrix.trace A + Square_Matrix.trace B
[PROOF STEP]
by transfer (simp add: sum.distrib)


[STATEMENT]
lemma Four_Suc: "4 = Suc (Suc (Suc (Suc 0)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 4 = Suc (Suc (Suc (Suc 0)))
[PROOF STEP]
by auto


[STATEMENT]
theorem effective_matrix_kauff_mat:
 assumes "is_tangle_diagram ws"
 shows "(rat_poly.row_length (kauff_mat ws)) = 2^(nat (domain_wall ws))"
 and "length (kauff_mat ws) = 2^(nat (codomain_wall ws))"
 and "mat (rat_poly.row_length (kauff_mat ws)) (length (kauff_mat ws))
                                           (kauff_mat ws) "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rat_poly.row_length (kauff_mat ws) = 2 ^ nat (domain_wall ws) &&& length (kauff_mat ws) = 2 ^ nat (codomain_wall ws) &&& mat (rat_poly.row_length (kauff_mat ws)) (length (kauff_mat ws)) (kauff_mat ws)
[PROOF STEP]
apply (auto simp add:matrix_kauff_mat assms )
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat (2 ^ nat (domain_wall ws)) (2 ^ nat (codomain_wall ws)) (kauff_mat ws)
[PROOF STEP]
using assms matrix_kauff_mat
[PROOF STATE]
proof (prove)
using this:
is_tangle_diagram ws
is_tangle_diagram ?ws \<Longrightarrow> rat_poly.row_length (kauff_mat ?ws) = 2 ^ nat (domain_wall ?ws) \<and> length (kauff_mat ?ws) = 2 ^ nat (codomain_wall ?ws) \<and> mat (rat_poly.row_length (kauff_mat ?ws)) (length (kauff_mat ?ws)) (kauff_mat ?ws)

goal (1 subgoal):
 1. mat (2 ^ nat (domain_wall ws)) (2 ^ nat (codomain_wall ws)) (kauff_mat ws)
[PROOF STEP]
by metis


[STATEMENT]
theorem PfP_implies_ModPon_PfP: "\<lbrakk>H \<turnstile> PfP (Q_Imp x y); H \<turnstile> PfP x\<rbrakk> \<Longrightarrow> H \<turnstile> PfP y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>H \<turnstile> PfP (Q_Imp x y); H \<turnstile> PfP x\<rbrakk> \<Longrightarrow> H \<turnstile> PfP y
[PROOF STEP]
by (force intro: PfP_inference [of x, THEN cut3] Disj_I1  simp add: ModPonP_def)


[STATEMENT]
lemma clearjunk_map_ran: "clearjunk (map_ran f al) = map_ran f (clearjunk al)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. clearjunk (map_ran f al) = map_ran f (clearjunk al)
[PROOF STEP]
by (simp add: map_ran_def split_def clearjunk_map)


[STATEMENT]
lemma tendsto_arctan_at_bot: "(arctan \<longlongrightarrow> - (pi/2)) at_bot"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (arctan \<longlongrightarrow> - (pi / 2)) at_bot
[PROOF STEP]
unfolding filterlim_at_bot_mirror arctan_minus
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. - arctan x) \<longlongrightarrow> - (pi / 2)) at_top
[PROOF STEP]
by (intro tendsto_minus tendsto_arctan_at_top)


[STATEMENT]
lemma finite_lattice_complete_bot_least: "(bot::'a::finite_lattice_complete) \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bot \<le> x
[PROOF STEP]
by (auto simp: bot_def intro: Inf_fin.coboundedI)


[STATEMENT]
lemma image_filter_cp_correct:
    assumes I: "s1.invar s1" "s2.invar s2"
    shows
    "s3.\<alpha> (image_filter_cp f P s1 s2)
     = { f (x, y) | x y. P (x, y) \<and> x\<in>s1.\<alpha> s1 \<and> y\<in>s2.\<alpha> s2 }" (is ?T1)
    "s3.invar (image_filter_cp f P s1 s2)" (is ?T2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s3.\<alpha> (image_filter_cp f P s1 s2) = {f (x, y) |x y. P (x, y) \<and> x \<in> s1.\<alpha> s1 \<and> y \<in> s2.\<alpha> s2} &&& s3.invar (image_filter_cp f P s1 s2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. s3.\<alpha> (image_filter_cp f P s1 s2) = {f (x, y) |x y. P (x, y) \<and> x \<in> s1.\<alpha> s1 \<and> y \<in> s2.\<alpha> s2}
 2. s3.invar (image_filter_cp f P s1 s2)
[PROOF STEP]
from image_filter_cartesian_product_correct [OF I]
[PROOF STATE]
proof (chain)
picking this:
s3.\<alpha> (image_filter_cartesian_product ?f s1 s2) = {uu_. \<exists>x y z. uu_ = z \<and> ?f (x, y) = Some z \<and> x \<in> s1.\<alpha> s1 \<and> y \<in> s2.\<alpha> s2}
s3.invar (image_filter_cartesian_product ?f s1 s2)
[PROOF STEP]
show "?T1" "?T2"
[PROOF STATE]
proof (prove)
using this:
s3.\<alpha> (image_filter_cartesian_product ?f s1 s2) = {uu_. \<exists>x y z. uu_ = z \<and> ?f (x, y) = Some z \<and> x \<in> s1.\<alpha> s1 \<and> y \<in> s2.\<alpha> s2}
s3.invar (image_filter_cartesian_product ?f s1 s2)

goal (1 subgoal):
 1. s3.\<alpha> (image_filter_cp f P s1 s2) = {f (x, y) |x y. P (x, y) \<and> x \<in> s1.\<alpha> s1 \<and> y \<in> s2.\<alpha> s2} &&& s3.invar (image_filter_cp f P s1 s2)
[PROOF STEP]
unfolding image_filter_cp_def
[PROOF STATE]
proof (prove)
using this:
s3.\<alpha> (image_filter_cartesian_product ?f s1 s2) = {uu_. \<exists>x y z. uu_ = z \<and> ?f (x, y) = Some z \<and> x \<in> s1.\<alpha> s1 \<and> y \<in> s2.\<alpha> s2}
s3.invar (image_filter_cartesian_product ?f s1 s2)

goal (1 subgoal):
 1. s3.\<alpha> (image_filter_cartesian_product (\<lambda>xy. if P xy then Some (f xy) else None) s1 s2) = {f (x, y) |x y. P (x, y) \<and> x \<in> s1.\<alpha> s1 \<and> y \<in> s2.\<alpha> s2} &&& s3.invar (image_filter_cartesian_product (\<lambda>xy. if P xy then Some (f xy) else None) s1 s2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
s3.\<alpha> (image_filter_cp f P s1 s2) = {f (x, y) |x y. P (x, y) \<and> x \<in> s1.\<alpha> s1 \<and> y \<in> s2.\<alpha> s2}
s3.invar (image_filter_cp f P s1 s2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma i_even_power [simp]:
  \<open>\<i> ^ (n * 2) = (- 1) ^ n\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<i> ^ (n * 2) = (- 1) ^ n
[PROOF STEP]
unfolding mult.commute [of n] power_mult
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<i>\<^sup>2 ^ n = (- 1) ^ n
[PROOF STEP]
by simp


[STATEMENT]
lemma adds_except_singleton:
  "s adds t \<longleftrightarrow> (except s {v} adds except t {v} \<and> lookup s v adds lookup t v)"
  for s t :: "'a \<Rightarrow>\<^sub>0 'b::add_linorder"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (s adds t) = (except s {v} adds except t {v} \<and> lookup s v adds lookup t v)
[PROOF STEP]
by (simp add: poly_mapping_adds_iff adds_except_fun_singleton[of "lookup s", where v=v] except.rep_eq)


[STATEMENT]
theorem (in group) lagrange:
  assumes "subgroup H G"
  shows "card (rcosets H) * card H = order G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (rcosets H) * card H = order G
[PROOF STEP]
proof (cases "finite (carrier G)")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite (carrier G) \<Longrightarrow> card (rcosets H) * card H = order G
 2. infinite (carrier G) \<Longrightarrow> card (rcosets H) * card H = order G
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
finite (carrier G)

goal (2 subgoals):
 1. finite (carrier G) \<Longrightarrow> card (rcosets H) * card H = order G
 2. infinite (carrier G) \<Longrightarrow> card (rcosets H) * card H = order G
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
finite (carrier G)

goal (1 subgoal):
 1. card (rcosets H) * card H = order G
[PROOF STEP]
using lagrange_finite assms
[PROOF STATE]
proof (prove)
using this:
finite (carrier G)
\<lbrakk>finite (carrier G); subgroup ?H G\<rbrakk> \<Longrightarrow> card (rcosets ?H) * card ?H = order G
subgroup H G

goal (1 subgoal):
 1. card (rcosets H) * card H = order G
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card (rcosets H) * card H = order G

goal (1 subgoal):
 1. infinite (carrier G) \<Longrightarrow> card (rcosets H) * card H = order G
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. infinite (carrier G) \<Longrightarrow> card (rcosets H) * card H = order G
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
infinite (carrier G)

goal (1 subgoal):
 1. infinite (carrier G) \<Longrightarrow> card (rcosets H) * card H = order G
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
infinite (carrier G)

goal (1 subgoal):
 1. card (rcosets H) * card H = order G
[PROOF STEP]
proof (cases "finite H")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>infinite (carrier G); finite H\<rbrakk> \<Longrightarrow> card (rcosets H) * card H = order G
 2. \<lbrakk>infinite (carrier G); infinite H\<rbrakk> \<Longrightarrow> card (rcosets H) * card H = order G
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
infinite H

goal (2 subgoals):
 1. \<lbrakk>infinite (carrier G); finite H\<rbrakk> \<Longrightarrow> card (rcosets H) * card H = order G
 2. \<lbrakk>infinite (carrier G); infinite H\<rbrakk> \<Longrightarrow> card (rcosets H) * card H = order G
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
infinite H

goal (1 subgoal):
 1. card (rcosets H) * card H = order G
[PROOF STEP]
using \<open>infinite (carrier G)\<close>
[PROOF STATE]
proof (prove)
using this:
infinite H
infinite (carrier G)

goal (1 subgoal):
 1. card (rcosets H) * card H = order G
[PROOF STEP]
by (simp add: order_def)
[PROOF STATE]
proof (state)
this:
card (rcosets H) * card H = order G

goal (1 subgoal):
 1. \<lbrakk>infinite (carrier G); finite H\<rbrakk> \<Longrightarrow> card (rcosets H) * card H = order G
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>infinite (carrier G); finite H\<rbrakk> \<Longrightarrow> card (rcosets H) * card H = order G
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
finite H

goal (1 subgoal):
 1. \<lbrakk>infinite (carrier G); finite H\<rbrakk> \<Longrightarrow> card (rcosets H) * card H = order G
[PROOF STEP]
have "infinite (rcosets H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infinite (rcosets H)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite (rcosets H) \<Longrightarrow> False
[PROOF STEP]
assume "finite (rcosets H)"
[PROOF STATE]
proof (state)
this:
finite (rcosets H)

goal (1 subgoal):
 1. finite (rcosets H) \<Longrightarrow> False
[PROOF STEP]
hence finite_rcos: "finite (rcosets H)"
[PROOF STATE]
proof (prove)
using this:
finite (rcosets H)

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

goal (1 subgoal):
 1. finite (rcosets H) \<Longrightarrow> False
[PROOF STEP]
hence "card (\<Union>(rcosets H)) = (\<Sum>R\<in>(rcosets H). card R)"
[PROOF STATE]
proof (prove)
using this:
finite (rcosets H)

goal (1 subgoal):
 1. card (\<Union> (rcosets H)) = sum card (rcosets H)
[PROOF STEP]
using card_Union_disjoint[of "rcosets H"] \<open>finite H\<close> rcos_disjoint[OF assms(1)]
              rcosets_finite[where ?H = H]
[PROOF STATE]
proof (prove)
using this:
finite (rcosets H)
\<lbrakk>pairwise disjnt (rcosets H); \<And>A. A \<in> rcosets H \<Longrightarrow> finite A\<rbrakk> \<Longrightarrow> card (\<Union> (rcosets H)) = sum card (rcosets H)
finite H
pairwise disjnt (rcosets H)
\<lbrakk>?R \<in> rcosets H; H \<subseteq> carrier G; finite H\<rbrakk> \<Longrightarrow> finite ?R

goal (1 subgoal):
 1. card (\<Union> (rcosets H)) = sum card (rcosets H)
[PROOF STEP]
by (simp add: assms subgroup.subset)
[PROOF STATE]
proof (state)
this:
card (\<Union> (rcosets H)) = sum card (rcosets H)

goal (1 subgoal):
 1. finite (rcosets H) \<Longrightarrow> False
[PROOF STEP]
hence "order G = (\<Sum>R\<in>(rcosets H). card R)"
[PROOF STATE]
proof (prove)
using this:
card (\<Union> (rcosets H)) = sum card (rcosets H)

goal (1 subgoal):
 1. order G = sum card (rcosets H)
[PROOF STEP]
by (simp add: assms order_def rcosets_part_G)
[PROOF STATE]
proof (state)
this:
order G = sum card (rcosets H)

goal (1 subgoal):
 1. finite (rcosets H) \<Longrightarrow> False
[PROOF STEP]
hence "order G = (\<Sum>R\<in>(rcosets H). card H)"
[PROOF STATE]
proof (prove)
using this:
order G = sum card (rcosets H)

goal (1 subgoal):
 1. order G = (\<Sum>R\<in>rcosets H. card H)
[PROOF STEP]
using card_rcosets_equal
[PROOF STATE]
proof (prove)
using this:
order G = sum card (rcosets H)
\<lbrakk>?R \<in> rcosets ?H; ?H \<subseteq> carrier G\<rbrakk> \<Longrightarrow> card ?H = card ?R

goal (1 subgoal):
 1. order G = (\<Sum>R\<in>rcosets H. card H)
[PROOF STEP]
by (simp add: assms subgroup.subset)
[PROOF STATE]
proof (state)
this:
order G = (\<Sum>R\<in>rcosets H. card H)

goal (1 subgoal):
 1. finite (rcosets H) \<Longrightarrow> False
[PROOF STEP]
hence "order G = (card H) * (card (rcosets H))"
[PROOF STATE]
proof (prove)
using this:
order G = (\<Sum>R\<in>rcosets H. card H)

goal (1 subgoal):
 1. order G = card H * card (rcosets H)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
order G = card H * card (rcosets H)

goal (1 subgoal):
 1. finite (rcosets H) \<Longrightarrow> False
[PROOF STEP]
hence "order G \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
order G = card H * card (rcosets H)

goal (1 subgoal):
 1. order G \<noteq> 0
[PROOF STEP]
using finite_rcos \<open>finite H\<close> assms ex_in_conv
                                rcosets_part_G subgroup.one_closed
[PROOF STATE]
proof (prove)
using this:
order G = card H * card (rcosets H)
finite (rcosets H)
finite H
subgroup H G
(\<exists>x. x \<in> ?A) = (?A \<noteq> {})
subgroup ?H G \<Longrightarrow> \<Union> (rcosets ?H) = carrier G
subgroup ?H ?G \<Longrightarrow> \<one>\<^bsub>?G\<^esub> \<in> ?H

goal (1 subgoal):
 1. order G \<noteq> 0
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
order G \<noteq> 0

goal (1 subgoal):
 1. finite (rcosets H) \<Longrightarrow> False
[PROOF STEP]
thus False
[PROOF STATE]
proof (prove)
using this:
order G \<noteq> 0

goal (1 subgoal):
 1. False
[PROOF STEP]
using \<open>infinite (carrier G)\<close> order_gt_0_iff_finite
[PROOF STATE]
proof (prove)
using this:
order G \<noteq> 0
infinite (carrier G)
(0 < order G) = finite (carrier G)

goal (1 subgoal):
 1. False
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
infinite (rcosets H)

goal (1 subgoal):
 1. \<lbrakk>infinite (carrier G); finite H\<rbrakk> \<Longrightarrow> card (rcosets H) * card H = order G
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
infinite (rcosets H)

goal (1 subgoal):
 1. card (rcosets H) * card H = order G
[PROOF STEP]
using \<open>infinite (carrier G)\<close>
[PROOF STATE]
proof (prove)
using this:
infinite (rcosets H)
infinite (carrier G)

goal (1 subgoal):
 1. card (rcosets H) * card H = order G
[PROOF STEP]
by (simp add: order_def)
[PROOF STATE]
proof (state)
this:
card (rcosets H) * card H = order G

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
card (rcosets H) * card H = order G

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma span_diff: "x \<in> span S \<Longrightarrow> y \<in> span S \<Longrightarrow> x - y \<in> span S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> span S; y \<in> span S\<rbrakk> \<Longrightarrow> x - y \<in> span S
[PROOF STEP]
by (metis subspace_span subspace_diff)


[STATEMENT]
lemma atLeast_greaterThan_conv: "{Suc n..} = {n<..}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {Suc n..} = {n<..}
[PROOF STEP]
by (simp only: atLeast_def greaterThan_def Suc_le_eq)


[STATEMENT]
lemma bisimilar_eqI:
  assumes "\<And>R. \<lbrakk>R x y; \<And>x y. R x y \<Longrightarrow> Q R (s1 x) (s2 y)\<rbrakk> \<Longrightarrow>  P x y"
  and "P x y \<Longrightarrow> \<forall>x y. P x y \<longrightarrow> Q P (s1 x) (s2 y)"
  shows "bisimilar Q s1 s2 x y = P x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bisimilar Q s1 s2 x y = P x y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?R x y; \<And>x y. ?R x y \<Longrightarrow> Q ?R (s1 x) (s2 y)\<rbrakk> \<Longrightarrow> P x y
P x y \<Longrightarrow> \<forall>x y. P x y \<longrightarrow> Q P (s1 x) (s2 y)

goal (1 subgoal):
 1. bisimilar Q s1 s2 x y = P x y
[PROOF STEP]
unfolding bisimilar_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?R x y; \<And>x y. ?R x y \<Longrightarrow> Q ?R (s1 x) (s2 y)\<rbrakk> \<Longrightarrow> P x y
P x y \<Longrightarrow> \<forall>x y. P x y \<longrightarrow> Q P (s1 x) (s2 y)

goal (1 subgoal):
 1. (\<exists>R. R x y \<and> (\<forall>x y. R x y \<longrightarrow> Q R (s1 x) (s2 y))) = P x y
[PROOF STEP]
by auto


[STATEMENT]
lemma pres_distinct_not_0_list_dec:
  "distinct xs \<Longrightarrow> 0 \<notin> set xs \<Longrightarrow> distinct (map (\<lambda>x. x - Suc 0) xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>distinct xs; 0 \<notin> set xs\<rbrakk> \<Longrightarrow> distinct (map (\<lambda>x. x - Suc 0) xs)
[PROOF STEP]
by (induct xs) (auto, metis Suc_pred neq0_conv)


[STATEMENT]
lemma maps_to_n_infinite_seq_res_ring:
"\<And>f. f \<in> (UNIV::nat set) \<rightarrow> carrier (Zp_res_ring k) \<Longrightarrow> \<exists>l. \<forall>m. \<exists>n. n>m \<and> (f n = l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f. f \<in> UNIV \<rightarrow> carrier (residue_ring (p ^ k)) \<Longrightarrow> \<exists>l. \<forall>m. \<exists>n>m. f n = l
[PROOF STEP]
apply(rule maps_to_n_infinite_seq[of "nat (p^k - 1)"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f. f \<in> UNIV \<rightarrow> carrier (residue_ring (p ^ k)) \<Longrightarrow> maps_to_n (int (nat (p ^ k - 1))) f
[PROOF STEP]
unfolding maps_to_n_def res_ring_car int_nat_p_pow_minus
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f. f \<in> UNIV \<rightarrow> {0..p ^ k - 1} \<Longrightarrow> \<forall>ka. f ka \<in> {0..p ^ k - 1}
[PROOF STEP]
by blast


[STATEMENT]
lemma swap_rows_transfer: "mat_rel R A B \<Longrightarrow> i < dim_row B \<Longrightarrow> j < dim_row B \<Longrightarrow>
  mat_rel R (mat_swaprows i j A) (mat_swaprows i j B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>mat_rel R A B; i < dim_row B; j < dim_row B\<rbrakk> \<Longrightarrow> mat_rel R (swaprows i j A) (swaprows i j B)
[PROOF STEP]
unfolding mat_rel_def mat_swaprows_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>dim_row A = dim_row B \<and> dim_col A = dim_col B \<and> (\<forall>i j. i < dim_row B \<longrightarrow> j < dim_col B \<longrightarrow> R (A $$ (i, j)) (B $$ (i, j))); i < dim_row B; j < dim_row B\<rbrakk> \<Longrightarrow> dim_row (mat (dim_row A) (dim_col A) (\<lambda>(ia, ja). if i = ia then A $$ (j, ja) else if j = ia then A $$ (i, ja) else A $$ (ia, ja))) = dim_row (mat (dim_row B) (dim_col B) (\<lambda>(ia, ja). if i = ia then B $$ (j, ja) else if j = ia then B $$ (i, ja) else B $$ (ia, ja))) \<and> dim_col (mat (dim_row A) (dim_col A) (\<lambda>(ia, ja). if i = ia then A $$ (j, ja) else if j = ia then A $$ (i, ja) else A $$ (ia, ja))) = dim_col (mat (dim_row B) (dim_col B) (\<lambda>(ia, ja). if i = ia then B $$ (j, ja) else if j = ia then B $$ (i, ja) else B $$ (ia, ja))) \<and> (\<forall>ia ja. ia < dim_row (mat (dim_row B) (dim_col B) (\<lambda>(ia, ja). if i = ia then B $$ (j, ja) else if j = ia then B $$ (i, ja) else B $$ (ia, ja))) \<longrightarrow> ja < dim_col (mat (dim_row B) (dim_col B) (\<lambda>(ia, ja). if i = ia then B $$ (j, ja) else if j = ia then B $$ (i, ja) else B $$ (ia, ja))) \<longrightarrow> R (mat (dim_row A) (dim_col A) (\<lambda>(ia, ja). if i = ia then A $$ (j, ja) else if j = ia then A $$ (i, ja) else A $$ (ia, ja)) $$ (ia, ja)) (mat (dim_row B) (dim_col B) (\<lambda>(ia, ja). if i = ia then B $$ (j, ja) else if j = ia then B $$ (i, ja) else B $$ (ia, ja)) $$ (ia, ja)))
[PROOF STEP]
by (intro rel_funI conjI allI impI eq_matI, auto)


[STATEMENT]
lemma integral_normal_moment_nz_1:
  "integral\<^sup>L lborel (\<lambda>x. normal_density \<mu> \<sigma> x * x) = \<mu>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LBINT x. normal_density \<mu> \<sigma> x * x = \<mu>
[PROOF STEP]
using normal_moment_nz_1
[PROOF STATE]
proof (prove)
using this:
has_bochner_integral lborel (\<lambda>x. normal_density ?\<mu> \<sigma> x * x) ?\<mu>

goal (1 subgoal):
 1. LBINT x. normal_density \<mu> \<sigma> x * x = \<mu>
[PROOF STEP]
by (rule has_bochner_integral_integral_eq)


[STATEMENT]
lemma streams_iff_snth: "s \<in> streams X \<longleftrightarrow> (\<forall>n. s !! n \<in> X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (s \<in> streams X) = (\<forall>n. s !! n \<in> X)
[PROOF STEP]
by (force simp: streams_iff_sset sset_range)


[STATEMENT]
lemma smult_four_block_mat: assumes c: "A \<in> carrier_mat nr1 nc1" "B \<in> carrier_mat nr1 nc2"
  "C \<in> carrier_mat nr2 nc1" "D \<in> carrier_mat nr2 nc2"
  shows "a \<cdot>\<^sub>m four_block_mat A B C D = four_block_mat (a \<cdot>\<^sub>m A) (a \<cdot>\<^sub>m B) (a \<cdot>\<^sub>m C) (a \<cdot>\<^sub>m D)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<cdot>\<^sub>m four_block_mat A B C D = four_block_mat (a \<cdot>\<^sub>m A) (a \<cdot>\<^sub>m B) (a \<cdot>\<^sub>m C) (a \<cdot>\<^sub>m D)
[PROOF STEP]
by (rule eq_matI, insert c, auto)


[STATEMENT]
lemma TC_sup_distrib: "TC (x \<squnion> y) = TC x \<squnion> TC y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. TC (x \<squnion> y) = TC x \<squnion> TC y
[PROOF STEP]
by (simp add: Sup_Un_distrib TC [of "x \<squnion> y"] TC [of x] TC [of y] image_Un sup.assoc sup_left_commute)