[STATEMENT]
theorem strong_duality_theorem_both_sat:
  fixes A :: "'a :: trivial_conjugatable_linordered_field mat"
  assumes A: "A \<in> carrier_mat nr nc"
    and b: "b \<in> carrier_vec nr"
    and c: "c \<in> carrier_vec nc"
    and primal: "\<exists> x \<in> carrier_vec nc. A *\<^sub>v x \<le> b"
    and dual: "\<exists> y. y \<ge> 0\<^sub>v nr \<and> A\<^sup>T *\<^sub>v y = c"
  shows "\<exists> x y.
       x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and>
       y \<ge> 0\<^sub>v nr \<and> A\<^sup>T *\<^sub>v y = c \<and>
       c \<bullet> x = b \<bullet> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
define M_up where "M_up = four_block_mat A (0\<^sub>m nr nr) (mat_of_row (- c)) (mat_of_row b)"
[PROOF STATE]
proof (state)
this:
M_up = four_block_mat A (0\<^sub>m nr nr) (mat_of_row (- c)) (mat_of_row b)

goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
define M_low where "M_low = four_block_mat (0\<^sub>m nc nc) (A\<^sup>T) (0\<^sub>m nc nc) (- (A\<^sup>T))"
[PROOF STATE]
proof (state)
this:
M_low = four_block_mat (0\<^sub>m nc nc) A\<^sup>T (0\<^sub>m nc nc) (- A\<^sup>T)

goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
define M_last where "M_last = append_cols (0\<^sub>m nr nc) (- 1\<^sub>m nr :: 'a mat)"
[PROOF STATE]
proof (state)
this:
M_last = 0\<^sub>m nr nc @\<^sub>c - 1\<^sub>m nr

goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
define M where "M = (M_up  @\<^sub>r M_low) @\<^sub>r M_last"
[PROOF STATE]
proof (state)
this:
M = (M_up @\<^sub>r M_low) @\<^sub>r M_last

goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
define bc where "bc = ((b @\<^sub>v 0\<^sub>v 1) @\<^sub>v (c @\<^sub>v -c)) @\<^sub>v (0\<^sub>v nr)"
[PROOF STATE]
proof (state)
this:
bc = ((b @\<^sub>v 0\<^sub>v 1) @\<^sub>v c @\<^sub>v - c) @\<^sub>v 0\<^sub>v nr

goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
(* M = ( A   0) bc = (  b)
           (-c   b)      (  0)
           ( 0  At)      (  c)
           ( 0 -At)      ( -c)
           ( 0  -I)      (  0) *)
[PROOF STATE]
proof (state)
this:
bc = ((b @\<^sub>v 0\<^sub>v 1) @\<^sub>v c @\<^sub>v - c) @\<^sub>v 0\<^sub>v nr

goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
let ?nr = "((nr + 1) + (nc + nc)) + nr"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
let ?nc = "nc + nr"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
have M_up: "M_up \<in> carrier_mat (nr + 1) ?nc"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M_up \<in> carrier_mat (nr + 1) (nc + nr)
[PROOF STEP]
unfolding M_up_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_mat A (0\<^sub>m nr nr) (mat_of_row (- c)) (mat_of_row b) \<in> carrier_mat (nr + 1) (nc + nr)
[PROOF STEP]
using A b c
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat nr nc
b \<in> carrier_vec nr
c \<in> carrier_vec nc

goal (1 subgoal):
 1. four_block_mat A (0\<^sub>m nr nr) (mat_of_row (- c)) (mat_of_row b) \<in> carrier_mat (nr + 1) (nc + nr)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
M_up \<in> carrier_mat (nr + 1) (nc + nr)

goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
have M_low: "M_low \<in> carrier_mat (nc + nc) ?nc"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M_low \<in> carrier_mat (nc + nc) (nc + nr)
[PROOF STEP]
unfolding M_low_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_mat (0\<^sub>m nc nc) A\<^sup>T (0\<^sub>m nc nc) (- A\<^sup>T) \<in> carrier_mat (nc + nc) (nc + nr)
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat nr nc

goal (1 subgoal):
 1. four_block_mat (0\<^sub>m nc nc) A\<^sup>T (0\<^sub>m nc nc) (- A\<^sup>T) \<in> carrier_mat (nc + nc) (nc + nr)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
M_low \<in> carrier_mat (nc + nc) (nc + nr)

goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
have M_last: "M_last \<in> carrier_mat nr ?nc"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M_last \<in> carrier_mat nr (nc + nr)
[PROOF STEP]
unfolding M_last_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0\<^sub>m nr nc @\<^sub>c - 1\<^sub>m nr \<in> carrier_mat nr (nc + nr)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
M_last \<in> carrier_mat nr (nc + nr)

goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
have M: "M \<in> carrier_mat ?nr ?nc"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M \<in> carrier_mat (nr + 1 + (nc + nc) + nr) (nc + nr)
[PROOF STEP]
using carrier_append_rows[OF carrier_append_rows[OF M_up M_low] M_last]
[PROOF STATE]
proof (prove)
using this:
(M_up @\<^sub>r M_low) @\<^sub>r M_last \<in> carrier_mat (nr + 1 + (nc + nc) + nr) (nc + nr)

goal (1 subgoal):
 1. M \<in> carrier_mat (nr + 1 + (nc + nc) + nr) (nc + nr)
[PROOF STEP]
unfolding M_def
[PROOF STATE]
proof (prove)
using this:
(M_up @\<^sub>r M_low) @\<^sub>r M_last \<in> carrier_mat (nr + 1 + (nc + nc) + nr) (nc + nr)

goal (1 subgoal):
 1. (M_up @\<^sub>r M_low) @\<^sub>r M_last \<in> carrier_mat (nr + 1 + (nc + nc) + nr) (nc + nr)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
M \<in> carrier_mat (nr + 1 + (nc + nc) + nr) (nc + nr)

goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
have bc: "bc \<in> carrier_vec ?nr"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bc \<in> carrier_vec (nr + 1 + (nc + nc) + nr)
[PROOF STEP]
unfolding bc_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((b @\<^sub>v 0\<^sub>v 1) @\<^sub>v c @\<^sub>v - c) @\<^sub>v 0\<^sub>v nr \<in> carrier_vec (nr + 1 + (nc + nc) + nr)
[PROOF STEP]
by (intro append_carrier_vec, insert b c, auto)
[PROOF STATE]
proof (state)
this:
bc \<in> carrier_vec (nr + 1 + (nc + nc) + nr)

goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
have "(\<exists>xy. xy \<in> carrier_vec ?nc \<and> M *\<^sub>v xy \<le> bc)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>xy. xy \<in> carrier_vec (nc + nr) \<and> M *\<^sub>v xy \<le> bc
[PROOF STEP]
proof (subst gram_schmidt.Farkas_Lemma'[OF M bc], intro allI impI, elim conjE)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
fix ulv
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
assume ulv0: "0\<^sub>v ?nr \<le> ulv" and Mulv: "M\<^sup>T *\<^sub>v ulv = 0\<^sub>v ?nc"
[PROOF STATE]
proof (state)
this:
0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> ulv
M\<^sup>T *\<^sub>v ulv = 0\<^sub>v (nc + nr)

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
from ulv0[unfolded less_eq_vec_def]
[PROOF STATE]
proof (chain)
picking this:
dim_vec (0\<^sub>v (nr + 1 + (nc + nc) + nr)) = dim_vec ulv \<and> (\<forall>i<dim_vec ulv. 0\<^sub>v (nr + 1 + (nc + nc) + nr) $ i \<le> ulv $ i)
[PROOF STEP]
have ulv: "ulv \<in> carrier_vec ?nr"
[PROOF STATE]
proof (prove)
using this:
dim_vec (0\<^sub>v (nr + 1 + (nc + nc) + nr)) = dim_vec ulv \<and> (\<forall>i<dim_vec ulv. 0\<^sub>v (nr + 1 + (nc + nc) + nr) $ i \<le> ulv $ i)

goal (1 subgoal):
 1. ulv \<in> carrier_vec (nr + 1 + (nc + nc) + nr)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ulv \<in> carrier_vec (nr + 1 + (nc + nc) + nr)

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
define u1 where "u1 = vec_first ulv ((nr + 1) + (nc + nc))"
[PROOF STATE]
proof (state)
this:
u1 = vec_first ulv (nr + 1 + (nc + nc))

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
define u2 where "u2 = vec_first u1 (nr + 1)"
[PROOF STATE]
proof (state)
this:
u2 = vec_first u1 (nr + 1)

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
define u3 where "u3 = vec_last u1 (nc + nc)"
[PROOF STATE]
proof (state)
this:
u3 = vec_last u1 (nc + nc)

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
define t where "t = vec_last ulv nr"
[PROOF STATE]
proof (state)
this:
t = vec_last ulv nr

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
have ulvid: "ulv = u1 @\<^sub>v t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ulv = u1 @\<^sub>v t
[PROOF STEP]
using ulv
[PROOF STATE]
proof (prove)
using this:
ulv \<in> carrier_vec (nr + 1 + (nc + nc) + nr)

goal (1 subgoal):
 1. ulv = u1 @\<^sub>v t
[PROOF STEP]
unfolding u1_def t_def
[PROOF STATE]
proof (prove)
using this:
ulv \<in> carrier_vec (nr + 1 + (nc + nc) + nr)

goal (1 subgoal):
 1. ulv = vec_first ulv (nr + 1 + (nc + nc)) @\<^sub>v vec_last ulv nr
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ulv = u1 @\<^sub>v t

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
have t: "t \<in> carrier_vec nr"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t \<in> carrier_vec nr
[PROOF STEP]
unfolding t_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_last ulv nr \<in> carrier_vec nr
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
t \<in> carrier_vec nr

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
have u1: "u1 \<in> carrier_vec ((nr + 1) + (nc + nc))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u1 \<in> carrier_vec (nr + 1 + (nc + nc))
[PROOF STEP]
unfolding u1_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_first ulv (nr + 1 + (nc + nc)) \<in> carrier_vec (nr + 1 + (nc + nc))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u1 \<in> carrier_vec (nr + 1 + (nc + nc))

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
have u1id: "u1 = u2 @\<^sub>v u3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u1 = u2 @\<^sub>v u3
[PROOF STEP]
using u1
[PROOF STATE]
proof (prove)
using this:
u1 \<in> carrier_vec (nr + 1 + (nc + nc))

goal (1 subgoal):
 1. u1 = u2 @\<^sub>v u3
[PROOF STEP]
unfolding u2_def u3_def
[PROOF STATE]
proof (prove)
using this:
u1 \<in> carrier_vec (nr + 1 + (nc + nc))

goal (1 subgoal):
 1. u1 = vec_first u1 (nr + 1) @\<^sub>v vec_last u1 (nc + nc)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u1 = u2 @\<^sub>v u3

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
have u2: "u2 \<in> carrier_vec (nr + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u2 \<in> carrier_vec (nr + 1)
[PROOF STEP]
unfolding u2_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_first u1 (nr + 1) \<in> carrier_vec (nr + 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u2 \<in> carrier_vec (nr + 1)

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
have u3: "u3 \<in> carrier_vec (nc + nc)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u3 \<in> carrier_vec (nc + nc)
[PROOF STEP]
unfolding u3_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_last u1 (nc + nc) \<in> carrier_vec (nc + nc)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u3 \<in> carrier_vec (nc + nc)

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
define v where "v = vec_first u3 nc"
[PROOF STATE]
proof (state)
this:
v = vec_first u3 nc

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
define w where "w = vec_last u3 nc"
[PROOF STATE]
proof (state)
this:
w = vec_last u3 nc

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
have u3id: "u3 = v @\<^sub>v w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u3 = v @\<^sub>v w
[PROOF STEP]
using u3
[PROOF STATE]
proof (prove)
using this:
u3 \<in> carrier_vec (nc + nc)

goal (1 subgoal):
 1. u3 = v @\<^sub>v w
[PROOF STEP]
unfolding v_def w_def
[PROOF STATE]
proof (prove)
using this:
u3 \<in> carrier_vec (nc + nc)

goal (1 subgoal):
 1. u3 = vec_first u3 nc @\<^sub>v vec_last u3 nc
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u3 = v @\<^sub>v w

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
have v: "v \<in> carrier_vec nc"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> carrier_vec nc
[PROOF STEP]
unfolding v_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_first u3 nc \<in> carrier_vec nc
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v \<in> carrier_vec nc

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
have w: "w \<in> carrier_vec nc"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<in> carrier_vec nc
[PROOF STEP]
unfolding w_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_last u3 nc \<in> carrier_vec nc
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
w \<in> carrier_vec nc

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
define u where "u = vec_first u2 nr"
[PROOF STATE]
proof (state)
this:
u = vec_first u2 nr

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
define L where "L = vec_last u2 1"
[PROOF STATE]
proof (state)
this:
L = vec_last u2 1

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
have u2id: "u2 = u @\<^sub>v L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u2 = u @\<^sub>v L
[PROOF STEP]
using u2
[PROOF STATE]
proof (prove)
using this:
u2 \<in> carrier_vec (nr + 1)

goal (1 subgoal):
 1. u2 = u @\<^sub>v L
[PROOF STEP]
unfolding u_def L_def
[PROOF STATE]
proof (prove)
using this:
u2 \<in> carrier_vec (nr + 1)

goal (1 subgoal):
 1. u2 = vec_first u2 nr @\<^sub>v vec_last u2 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u2 = u @\<^sub>v L

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
have u: "u \<in> carrier_vec nr"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u \<in> carrier_vec nr
[PROOF STEP]
unfolding u_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_first u2 nr \<in> carrier_vec nr
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u \<in> carrier_vec nr

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
have L: "L \<in> carrier_vec 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. L \<in> carrier_vec 1
[PROOF STEP]
unfolding L_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_last u2 1 \<in> carrier_vec 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
L \<in> carrier_vec 1

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
define vec1 where "vec1 = A\<^sup>T *\<^sub>v u + mat_of_col (- c) *\<^sub>v L"
[PROOF STATE]
proof (state)
this:
vec1 = A\<^sup>T *\<^sub>v u + mat_of_col (- c) *\<^sub>v L

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
have vec1: "vec1 \<in> carrier_vec nc"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec1 \<in> carrier_vec nc
[PROOF STEP]
unfolding vec1_def mat_of_col_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A\<^sup>T *\<^sub>v u + (mat_of_row (- c))\<^sup>T *\<^sub>v L \<in> carrier_vec nc
[PROOF STEP]
using A u c L
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat nr nc
u \<in> carrier_vec nr
c \<in> carrier_vec nc
L \<in> carrier_vec 1

goal (1 subgoal):
 1. A\<^sup>T *\<^sub>v u + (mat_of_row (- c))\<^sup>T *\<^sub>v L \<in> carrier_vec nc
[PROOF STEP]
by (meson add_carrier_vec mat_of_row_carrier(1) mult_mat_vec_carrier transpose_carrier_mat uminus_carrier_vec)
[PROOF STATE]
proof (state)
this:
vec1 \<in> carrier_vec nc

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
define vec2 where "vec2 = A *\<^sub>v (v - w)"
[PROOF STATE]
proof (state)
this:
vec2 = A *\<^sub>v (v - w)

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
have vec2: "vec2 \<in> carrier_vec nr"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec2 \<in> carrier_vec nr
[PROOF STEP]
unfolding vec2_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *\<^sub>v (v - w) \<in> carrier_vec nr
[PROOF STEP]
using A v w
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat nr nc
v \<in> carrier_vec nc
w \<in> carrier_vec nc

goal (1 subgoal):
 1. A *\<^sub>v (v - w) \<in> carrier_vec nr
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vec2 \<in> carrier_vec nr

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
define vec3 where "vec3 = mat_of_col b *\<^sub>v L"
[PROOF STATE]
proof (state)
this:
vec3 = mat_of_col b *\<^sub>v L

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
have vec3: "vec3 \<in> carrier_vec nr"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec3 \<in> carrier_vec nr
[PROOF STEP]
using A b L
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat nr nc
b \<in> carrier_vec nr
L \<in> carrier_vec 1

goal (1 subgoal):
 1. vec3 \<in> carrier_vec nr
[PROOF STEP]
unfolding mat_of_col_def vec3_def
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat nr nc
b \<in> carrier_vec nr
L \<in> carrier_vec 1

goal (1 subgoal):
 1. (mat_of_row b)\<^sup>T *\<^sub>v L \<in> carrier_vec nr
[PROOF STEP]
by (meson add_carrier_vec mat_of_row_carrier(1) mult_mat_vec_carrier transpose_carrier_mat uminus_carrier_vec)
[PROOF STATE]
proof (state)
this:
vec3 \<in> carrier_vec nr

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
have Mt: "M\<^sup>T = (M_up\<^sup>T @\<^sub>c M_low\<^sup>T) @\<^sub>c M_last\<^sup>T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M\<^sup>T = (M_up\<^sup>T @\<^sub>c M_low\<^sup>T) @\<^sub>c M_last\<^sup>T
[PROOF STEP]
unfolding M_def append_cols_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((M_up @\<^sub>r M_low) @\<^sub>r M_last)\<^sup>T = ((M_up\<^sup>T\<^sup>T @\<^sub>r M_low\<^sup>T\<^sup>T)\<^sup>T\<^sup>T @\<^sub>r M_last\<^sup>T\<^sup>T)\<^sup>T
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
M\<^sup>T = (M_up\<^sup>T @\<^sub>c M_low\<^sup>T) @\<^sub>c M_last\<^sup>T

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
have "M\<^sup>T *\<^sub>v ulv = (M_up\<^sup>T @\<^sub>c M_low\<^sup>T) *\<^sub>v u1 + M_last\<^sup>T *\<^sub>v t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M\<^sup>T *\<^sub>v ulv = (M_up\<^sup>T @\<^sub>c M_low\<^sup>T) *\<^sub>v u1 + M_last\<^sup>T *\<^sub>v t
[PROOF STEP]
unfolding Mt ulvid
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((M_up\<^sup>T @\<^sub>c M_low\<^sup>T) @\<^sub>c M_last\<^sup>T) *\<^sub>v (u1 @\<^sub>v t) = (M_up\<^sup>T @\<^sub>c M_low\<^sup>T) *\<^sub>v u1 + M_last\<^sup>T *\<^sub>v t
[PROOF STEP]
by (subst mat_mult_append_cols[OF carrier_append_cols _ u1 t],
          insert M_up M_low M_last, auto)
[PROOF STATE]
proof (state)
this:
M\<^sup>T *\<^sub>v ulv = (M_up\<^sup>T @\<^sub>c M_low\<^sup>T) *\<^sub>v u1 + M_last\<^sup>T *\<^sub>v t

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
M\<^sup>T *\<^sub>v ulv = (M_up\<^sup>T @\<^sub>c M_low\<^sup>T) *\<^sub>v u1 + M_last\<^sup>T *\<^sub>v t

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
have "M_last\<^sup>T = 0\<^sub>m nc nr @\<^sub>r - 1\<^sub>m nr"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M_last\<^sup>T = 0\<^sub>m nc nr @\<^sub>r - 1\<^sub>m nr
[PROOF STEP]
unfolding M_last_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0\<^sub>m nr nc @\<^sub>c - 1\<^sub>m nr)\<^sup>T = 0\<^sub>m nc nr @\<^sub>r - 1\<^sub>m nr
[PROOF STEP]
unfolding append_cols_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((0\<^sub>m nr nc)\<^sup>T @\<^sub>r (- 1\<^sub>m nr)\<^sup>T)\<^sup>T\<^sup>T = 0\<^sub>m nc nr @\<^sub>r - 1\<^sub>m nr
[PROOF STEP]
by (simp, subst transpose_uminus, auto)
[PROOF STATE]
proof (state)
this:
M_last\<^sup>T = 0\<^sub>m nc nr @\<^sub>r - 1\<^sub>m nr

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
M_last\<^sup>T = 0\<^sub>m nc nr @\<^sub>r - 1\<^sub>m nr

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
have "\<dots> *\<^sub>v t = 0\<^sub>v nc @\<^sub>v - t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0\<^sub>m nc nr @\<^sub>r - 1\<^sub>m nr) *\<^sub>v t = 0\<^sub>v nc @\<^sub>v - t
[PROOF STEP]
by (subst mat_mult_append[OF _ _ t], insert t, auto)
[PROOF STATE]
proof (state)
this:
(0\<^sub>m nc nr @\<^sub>r - 1\<^sub>m nr) *\<^sub>v t = 0\<^sub>v nc @\<^sub>v - t

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(0\<^sub>m nc nr @\<^sub>r - 1\<^sub>m nr) *\<^sub>v t = 0\<^sub>v nc @\<^sub>v - t

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
have "(M_up\<^sup>T @\<^sub>c M_low\<^sup>T) *\<^sub>v u1 = (M_up\<^sup>T *\<^sub>v u2) + (M_low\<^sup>T *\<^sub>v u3)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (M_up\<^sup>T @\<^sub>c M_low\<^sup>T) *\<^sub>v u1 = M_up\<^sup>T *\<^sub>v u2 + M_low\<^sup>T *\<^sub>v u3
[PROOF STEP]
unfolding u1id
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (M_up\<^sup>T @\<^sub>c M_low\<^sup>T) *\<^sub>v (u2 @\<^sub>v u3) = M_up\<^sup>T *\<^sub>v u2 + M_low\<^sup>T *\<^sub>v u3
[PROOF STEP]
by (rule mat_mult_append_cols[OF _ _ u2 u3], insert M_up M_low, auto)
[PROOF STATE]
proof (state)
this:
(M_up\<^sup>T @\<^sub>c M_low\<^sup>T) *\<^sub>v u1 = M_up\<^sup>T *\<^sub>v u2 + M_low\<^sup>T *\<^sub>v u3

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(M_up\<^sup>T @\<^sub>c M_low\<^sup>T) *\<^sub>v u1 = M_up\<^sup>T *\<^sub>v u2 + M_low\<^sup>T *\<^sub>v u3

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
have "M_low\<^sup>T = four_block_mat (0\<^sub>m nc nc) (0\<^sub>m nc nc) A (- A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M_low\<^sup>T = four_block_mat (0\<^sub>m nc nc) (0\<^sub>m nc nc) A (- A)
[PROOF STEP]
unfolding M_low_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (four_block_mat (0\<^sub>m nc nc) A\<^sup>T (0\<^sub>m nc nc) (- A\<^sup>T))\<^sup>T = four_block_mat (0\<^sub>m nc nc) (0\<^sub>m nc nc) A (- A)
[PROOF STEP]
by (subst transpose_four_block_mat, insert A, auto)
[PROOF STATE]
proof (state)
this:
M_low\<^sup>T = four_block_mat (0\<^sub>m nc nc) (0\<^sub>m nc nc) A (- A)

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
M_low\<^sup>T = four_block_mat (0\<^sub>m nc nc) (0\<^sub>m nc nc) A (- A)

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
have "\<dots> *\<^sub>v u3 = (0\<^sub>m nc nc *\<^sub>v v + 0\<^sub>m nc nc *\<^sub>v w) @\<^sub>v (A *\<^sub>v v + - A *\<^sub>v w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_mat (0\<^sub>m nc nc) (0\<^sub>m nc nc) A (- A) *\<^sub>v u3 = (0\<^sub>m nc nc *\<^sub>v v + 0\<^sub>m nc nc *\<^sub>v w) @\<^sub>v A *\<^sub>v v + - A *\<^sub>v w
[PROOF STEP]
unfolding u3id
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_mat (0\<^sub>m nc nc) (0\<^sub>m nc nc) A (- A) *\<^sub>v (v @\<^sub>v w) = (0\<^sub>m nc nc *\<^sub>v v + 0\<^sub>m nc nc *\<^sub>v w) @\<^sub>v A *\<^sub>v v + - A *\<^sub>v w
[PROOF STEP]
by (subst four_block_mat_mult_vec[OF _ _ A _ v w], insert A, auto)
[PROOF STATE]
proof (state)
this:
four_block_mat (0\<^sub>m nc nc) (0\<^sub>m nc nc) A (- A) *\<^sub>v u3 = (0\<^sub>m nc nc *\<^sub>v v + 0\<^sub>m nc nc *\<^sub>v w) @\<^sub>v A *\<^sub>v v + - A *\<^sub>v w

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
four_block_mat (0\<^sub>m nc nc) (0\<^sub>m nc nc) A (- A) *\<^sub>v u3 = (0\<^sub>m nc nc *\<^sub>v v + 0\<^sub>m nc nc *\<^sub>v w) @\<^sub>v A *\<^sub>v v + - A *\<^sub>v w

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
have "0\<^sub>m nc nc *\<^sub>v v + 0\<^sub>m nc nc *\<^sub>v w = 0\<^sub>v nc"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0\<^sub>m nc nc *\<^sub>v v + 0\<^sub>m nc nc *\<^sub>v w = 0\<^sub>v nc
[PROOF STEP]
using v w
[PROOF STATE]
proof (prove)
using this:
v \<in> carrier_vec nc
w \<in> carrier_vec nc

goal (1 subgoal):
 1. 0\<^sub>m nc nc *\<^sub>v v + 0\<^sub>m nc nc *\<^sub>v w = 0\<^sub>v nc
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0\<^sub>m nc nc *\<^sub>v v + 0\<^sub>m nc nc *\<^sub>v w = 0\<^sub>v nc

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
0\<^sub>m nc nc *\<^sub>v v + 0\<^sub>m nc nc *\<^sub>v w = 0\<^sub>v nc

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
have "A *\<^sub>v v + - A *\<^sub>v w = vec2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *\<^sub>v v + - A *\<^sub>v w = vec2
[PROOF STEP]
unfolding vec2_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *\<^sub>v v + - A *\<^sub>v w = A *\<^sub>v (v - w)
[PROOF STEP]
using A v w
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat nr nc
v \<in> carrier_vec nc
w \<in> carrier_vec nc

goal (1 subgoal):
 1. A *\<^sub>v v + - A *\<^sub>v w = A *\<^sub>v (v - w)
[PROOF STEP]
by (metis (full_types) carrier_matD(2) carrier_vecD minus_add_uminus_vec mult_mat_vec_carrier mult_minus_distrib_mat_vec uminus_mult_mat_vec)
[PROOF STATE]
proof (state)
this:
A *\<^sub>v v + - A *\<^sub>v w = vec2

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A *\<^sub>v v + - A *\<^sub>v w = vec2

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
have "M_up\<^sup>T  = four_block_mat A\<^sup>T (mat_of_col (- c)) (0\<^sub>m nr nr) (mat_of_col b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M_up\<^sup>T = four_block_mat A\<^sup>T (mat_of_col (- c)) (0\<^sub>m nr nr) (mat_of_col b)
[PROOF STEP]
unfolding M_up_def mat_of_col_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (four_block_mat A (0\<^sub>m nr nr) (mat_of_row (- c)) (mat_of_row b))\<^sup>T = four_block_mat A\<^sup>T (mat_of_row (- c))\<^sup>T (0\<^sub>m nr nr) (mat_of_row b)\<^sup>T
[PROOF STEP]
by (subst transpose_four_block_mat[OF A], insert b c, auto)
[PROOF STATE]
proof (state)
this:
M_up\<^sup>T = four_block_mat A\<^sup>T (mat_of_col (- c)) (0\<^sub>m nr nr) (mat_of_col b)

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
M_up\<^sup>T = four_block_mat A\<^sup>T (mat_of_col (- c)) (0\<^sub>m nr nr) (mat_of_col b)

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
have "\<dots> *\<^sub>v u2 = vec1 @\<^sub>v vec3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_mat A\<^sup>T (mat_of_col (- c)) (0\<^sub>m nr nr) (mat_of_col b) *\<^sub>v u2 = vec1 @\<^sub>v vec3
[PROOF STEP]
unfolding u2id vec1_def vec3_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_mat A\<^sup>T (mat_of_col (- c)) (0\<^sub>m nr nr) (mat_of_col b) *\<^sub>v (u @\<^sub>v L) = (A\<^sup>T *\<^sub>v u + mat_of_col (- c) *\<^sub>v L) @\<^sub>v mat_of_col b *\<^sub>v L
[PROOF STEP]
by (subst four_block_mat_mult_vec[OF _ _ _ _ u L], insert A b c u, auto)
[PROOF STATE]
proof (state)
this:
four_block_mat A\<^sup>T (mat_of_col (- c)) (0\<^sub>m nr nr) (mat_of_col b) *\<^sub>v u2 = vec1 @\<^sub>v vec3

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
four_block_mat A\<^sup>T (mat_of_col (- c)) (0\<^sub>m nr nr) (mat_of_col b) *\<^sub>v u2 = vec1 @\<^sub>v vec3

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
have "(vec1 @\<^sub>v vec3)
      + (0\<^sub>v nc @\<^sub>v vec2) + (0\<^sub>v nc @\<^sub>v - t) =
      (vec1 @\<^sub>v (vec3 + vec2 - t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec1 @\<^sub>v vec3 + (0\<^sub>v nc @\<^sub>v vec2) + (0\<^sub>v nc @\<^sub>v - t) = vec1 @\<^sub>v vec3 + vec2 - t
[PROOF STEP]
apply (subst append_vec_add[of _ nc _ _ nr, OF vec1 _ vec3 vec2])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 0\<^sub>v nc \<in> carrier_vec nc
 2. (vec1 + 0\<^sub>v nc) @\<^sub>v vec3 + vec2 + (0\<^sub>v nc @\<^sub>v - t) = vec1 @\<^sub>v vec3 + vec2 - t
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0\<^sub>v nc \<in> carrier_vec nc
[PROOF STEP]
by force
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (vec1 + 0\<^sub>v nc) @\<^sub>v vec3 + vec2 + (0\<^sub>v nc @\<^sub>v - t) = vec1 @\<^sub>v vec3 + vec2 - t
[PROOF STEP]
apply (subst append_vec_add[of _ nc _ _ nr])
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. vec1 + 0\<^sub>v nc \<in> carrier_vec nc
 2. 0\<^sub>v nc \<in> carrier_vec nc
 3. vec3 + vec2 \<in> carrier_vec nr
 4. - t \<in> carrier_vec nr
 5. (vec1 + 0\<^sub>v nc + 0\<^sub>v nc) @\<^sub>v vec3 + vec2 + - t = vec1 @\<^sub>v vec3 + vec2 - t
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec1 + 0\<^sub>v nc \<in> carrier_vec nc
[PROOF STEP]
using vec1
[PROOF STATE]
proof (prove)
using this:
vec1 \<in> carrier_vec nc

goal (1 subgoal):
 1. vec1 + 0\<^sub>v nc \<in> carrier_vec nc
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. 0\<^sub>v nc \<in> carrier_vec nc
 2. vec3 + vec2 \<in> carrier_vec nr
 3. - t \<in> carrier_vec nr
 4. (vec1 + 0\<^sub>v nc + 0\<^sub>v nc) @\<^sub>v vec3 + vec2 + - t = vec1 @\<^sub>v vec3 + vec2 - t
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0\<^sub>v nc \<in> carrier_vec nc
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. vec3 + vec2 \<in> carrier_vec nr
 2. - t \<in> carrier_vec nr
 3. (vec1 + 0\<^sub>v nc + 0\<^sub>v nc) @\<^sub>v vec3 + vec2 + - t = vec1 @\<^sub>v vec3 + vec2 - t
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec3 + vec2 \<in> carrier_vec nr
[PROOF STEP]
using vec2 vec3
[PROOF STATE]
proof (prove)
using this:
vec2 \<in> carrier_vec nr
vec3 \<in> carrier_vec nr

goal (1 subgoal):
 1. vec3 + vec2 \<in> carrier_vec nr
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. - t \<in> carrier_vec nr
 2. (vec1 + 0\<^sub>v nc + 0\<^sub>v nc) @\<^sub>v vec3 + vec2 + - t = vec1 @\<^sub>v vec3 + vec2 - t
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - t \<in> carrier_vec nr
[PROOF STEP]
using t
[PROOF STATE]
proof (prove)
using this:
t \<in> carrier_vec nr

goal (1 subgoal):
 1. - t \<in> carrier_vec nr
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (vec1 + 0\<^sub>v nc + 0\<^sub>v nc) @\<^sub>v vec3 + vec2 + - t = vec1 @\<^sub>v vec3 + vec2 - t
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (vec1 + 0\<^sub>v nc + 0\<^sub>v nc) @\<^sub>v vec3 + vec2 + - t = vec1 @\<^sub>v vec3 + vec2 - t
[PROOF STEP]
using vec1
[PROOF STATE]
proof (prove)
using this:
vec1 \<in> carrier_vec nc

goal (1 subgoal):
 1. (vec1 + 0\<^sub>v nc + 0\<^sub>v nc) @\<^sub>v vec3 + vec2 + - t = vec1 @\<^sub>v vec3 + vec2 - t
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
vec1 @\<^sub>v vec3 + (0\<^sub>v nc @\<^sub>v vec2) + (0\<^sub>v nc @\<^sub>v - t) = vec1 @\<^sub>v vec3 + vec2 - t

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
M\<^sup>T *\<^sub>v ulv = vec1 @\<^sub>v vec3 + vec2 - t
[PROOF STEP]
have "vec1 @\<^sub>v (vec3 + vec2 - t) = 0\<^sub>v ?nc"
[PROOF STATE]
proof (prove)
using this:
M\<^sup>T *\<^sub>v ulv = vec1 @\<^sub>v vec3 + vec2 - t

goal (1 subgoal):
 1. vec1 @\<^sub>v vec3 + vec2 - t = 0\<^sub>v (nc + nr)
[PROOF STEP]
unfolding Mulv
[PROOF STATE]
proof (prove)
using this:
0\<^sub>v (nc + nr) = vec1 @\<^sub>v vec3 + vec2 - t

goal (1 subgoal):
 1. vec1 @\<^sub>v vec3 + vec2 - t = 0\<^sub>v (nc + nr)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
vec1 @\<^sub>v vec3 + vec2 - t = 0\<^sub>v (nc + nr)

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
vec1 @\<^sub>v vec3 + vec2 - t = 0\<^sub>v (nc + nr)

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
have "\<dots> = 0\<^sub>v nc @\<^sub>v 0\<^sub>v nr"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0\<^sub>v (nc + nr) = 0\<^sub>v nc @\<^sub>v 0\<^sub>v nr
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0\<^sub>v (nc + nr) = 0\<^sub>v nc @\<^sub>v 0\<^sub>v nr

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
vec1 @\<^sub>v vec3 + vec2 - t = 0\<^sub>v nc @\<^sub>v 0\<^sub>v nr
[PROOF STEP]
have "vec1 = 0\<^sub>v nc \<and> vec3 + vec2 - t = 0\<^sub>v nr"
[PROOF STATE]
proof (prove)
using this:
vec1 @\<^sub>v vec3 + vec2 - t = 0\<^sub>v nc @\<^sub>v 0\<^sub>v nr

goal (1 subgoal):
 1. vec1 = 0\<^sub>v nc \<and> vec3 + vec2 - t = 0\<^sub>v nr
[PROOF STEP]
by (subst (asm) append_vec_eq[OF vec1], auto)
[PROOF STATE]
proof (state)
this:
vec1 = 0\<^sub>v nc \<and> vec3 + vec2 - t = 0\<^sub>v nr

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
hence 01: "vec1 = 0\<^sub>v nc" and 02: "vec3 + vec2 - t = 0\<^sub>v nr"
[PROOF STATE]
proof (prove)
using this:
vec1 = 0\<^sub>v nc \<and> vec3 + vec2 - t = 0\<^sub>v nr

goal (1 subgoal):
 1. vec1 = 0\<^sub>v nc &&& vec3 + vec2 - t = 0\<^sub>v nr
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vec1 = 0\<^sub>v nc
vec3 + vec2 - t = 0\<^sub>v nr

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
from 01
[PROOF STATE]
proof (chain)
picking this:
vec1 = 0\<^sub>v nc
[PROOF STEP]
have "vec1 + mat_of_col c *\<^sub>v L = mat_of_col c *\<^sub>v L"
[PROOF STATE]
proof (prove)
using this:
vec1 = 0\<^sub>v nc

goal (1 subgoal):
 1. vec1 + mat_of_col c *\<^sub>v L = mat_of_col c *\<^sub>v L
[PROOF STEP]
using c L vec1
[PROOF STATE]
proof (prove)
using this:
vec1 = 0\<^sub>v nc
c \<in> carrier_vec nc
L \<in> carrier_vec 1
vec1 \<in> carrier_vec nc

goal (1 subgoal):
 1. vec1 + mat_of_col c *\<^sub>v L = mat_of_col c *\<^sub>v L
[PROOF STEP]
unfolding mat_of_col_def
[PROOF STATE]
proof (prove)
using this:
vec1 = 0\<^sub>v nc
c \<in> carrier_vec nc
L \<in> carrier_vec 1
vec1 \<in> carrier_vec nc

goal (1 subgoal):
 1. vec1 + (mat_of_row c)\<^sup>T *\<^sub>v L = (mat_of_row c)\<^sup>T *\<^sub>v L
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vec1 + mat_of_col c *\<^sub>v L = mat_of_col c *\<^sub>v L

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
vec1 + mat_of_col c *\<^sub>v L = mat_of_col c *\<^sub>v L

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
have "vec1 + mat_of_col c *\<^sub>v L = A\<^sup>T *\<^sub>v u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec1 + mat_of_col c *\<^sub>v L = A\<^sup>T *\<^sub>v u
[PROOF STEP]
unfolding vec1_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A\<^sup>T *\<^sub>v u + mat_of_col (- c) *\<^sub>v L + mat_of_col c *\<^sub>v L = A\<^sup>T *\<^sub>v u
[PROOF STEP]
using A u c L
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat nr nc
u \<in> carrier_vec nr
c \<in> carrier_vec nc
L \<in> carrier_vec 1

goal (1 subgoal):
 1. A\<^sup>T *\<^sub>v u + mat_of_col (- c) *\<^sub>v L + mat_of_col c *\<^sub>v L = A\<^sup>T *\<^sub>v u
[PROOF STEP]
unfolding mat_of_col_def mat_of_row_uminus transpose_uminus
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat nr nc
u \<in> carrier_vec nr
c \<in> carrier_vec nc
L \<in> carrier_vec 1

goal (1 subgoal):
 1. A\<^sup>T *\<^sub>v u + - (mat_of_row c)\<^sup>T *\<^sub>v L + (mat_of_row c)\<^sup>T *\<^sub>v L = A\<^sup>T *\<^sub>v u
[PROOF STEP]
by (subst uminus_mult_mat_vec, auto)
[PROOF STATE]
proof (state)
this:
vec1 + mat_of_col c *\<^sub>v L = A\<^sup>T *\<^sub>v u

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
A\<^sup>T *\<^sub>v u = mat_of_col c *\<^sub>v L
[PROOF STEP]
have As: "A\<^sup>T *\<^sub>v u = mat_of_col c *\<^sub>v L"
[PROOF STATE]
proof (prove)
using this:
A\<^sup>T *\<^sub>v u = mat_of_col c *\<^sub>v L

goal (1 subgoal):
 1. A\<^sup>T *\<^sub>v u = mat_of_col c *\<^sub>v L
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
A\<^sup>T *\<^sub>v u = mat_of_col c *\<^sub>v L

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
from 02
[PROOF STATE]
proof (chain)
picking this:
vec3 + vec2 - t = 0\<^sub>v nr
[PROOF STEP]
have "(vec3 + vec2 - t) + t = 0\<^sub>v nr + t"
[PROOF STATE]
proof (prove)
using this:
vec3 + vec2 - t = 0\<^sub>v nr

goal (1 subgoal):
 1. vec3 + vec2 - t + t = 0\<^sub>v nr + t
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
vec3 + vec2 - t + t = 0\<^sub>v nr + t

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
vec3 + vec2 - t + t = 0\<^sub>v nr + t

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
have "(vec3 + vec2 - t) + t = vec2 + vec3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec3 + vec2 - t + t = vec2 + vec3
[PROOF STEP]
using vec3 vec2 t
[PROOF STATE]
proof (prove)
using this:
vec3 \<in> carrier_vec nr
vec2 \<in> carrier_vec nr
t \<in> carrier_vec nr

goal (1 subgoal):
 1. vec3 + vec2 - t + t = vec2 + vec3
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vec3 + vec2 - t + t = vec2 + vec3

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
vec2 + vec3 = 0\<^sub>v nr + t
[PROOF STEP]
have t23: "t = vec2 + vec3"
[PROOF STATE]
proof (prove)
using this:
vec2 + vec3 = 0\<^sub>v nr + t

goal (1 subgoal):
 1. t = vec2 + vec3
[PROOF STEP]
using t
[PROOF STATE]
proof (prove)
using this:
vec2 + vec3 = 0\<^sub>v nr + t
t \<in> carrier_vec nr

goal (1 subgoal):
 1. t = vec2 + vec3
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
t = vec2 + vec3

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
have id0: "0\<^sub>v ?nr = ((0\<^sub>v nr @\<^sub>v 0\<^sub>v 1) @\<^sub>v (0\<^sub>v nc @\<^sub>v 0\<^sub>v nc)) @\<^sub>v 0\<^sub>v nr"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0\<^sub>v (nr + 1 + (nc + nc) + nr) = ((0\<^sub>v nr @\<^sub>v 0\<^sub>v 1) @\<^sub>v 0\<^sub>v nc @\<^sub>v 0\<^sub>v nc) @\<^sub>v 0\<^sub>v nr
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0\<^sub>v (nr + 1 + (nc + nc) + nr) = ((0\<^sub>v nr @\<^sub>v 0\<^sub>v 1) @\<^sub>v 0\<^sub>v nc @\<^sub>v 0\<^sub>v nc) @\<^sub>v 0\<^sub>v nr

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
from ulv0[unfolded id0 ulvid u1id u2id u3id]
[PROOF STATE]
proof (chain)
picking this:
((0\<^sub>v nr @\<^sub>v 0\<^sub>v 1) @\<^sub>v 0\<^sub>v nc @\<^sub>v 0\<^sub>v nc) @\<^sub>v 0\<^sub>v nr \<le> ((u @\<^sub>v L) @\<^sub>v v @\<^sub>v w) @\<^sub>v t
[PROOF STEP]
have "0\<^sub>v nr \<le> u \<and> 0\<^sub>v 1 \<le> L \<and> 0\<^sub>v nc \<le> v \<and> 0\<^sub>v nc \<le> w \<and> 0\<^sub>v nr \<le> t"
[PROOF STATE]
proof (prove)
using this:
((0\<^sub>v nr @\<^sub>v 0\<^sub>v 1) @\<^sub>v 0\<^sub>v nc @\<^sub>v 0\<^sub>v nc) @\<^sub>v 0\<^sub>v nr \<le> ((u @\<^sub>v L) @\<^sub>v v @\<^sub>v w) @\<^sub>v t

goal (1 subgoal):
 1. 0\<^sub>v nr \<le> u \<and> 0\<^sub>v 1 \<le> L \<and> 0\<^sub>v nc \<le> v \<and> 0\<^sub>v nc \<le> w \<and> 0\<^sub>v nr \<le> t
[PROOF STEP]
apply (subst (asm) append_vec_le[of _ "(nr + 1) + (nc + nc)"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. (0\<^sub>v nr @\<^sub>v 0\<^sub>v 1) @\<^sub>v 0\<^sub>v nc @\<^sub>v 0\<^sub>v nc \<in> carrier_vec (nr + 1 + (nc + nc))
 2. (u @\<^sub>v L) @\<^sub>v v @\<^sub>v w \<in> carrier_vec (nr + 1 + (nc + nc))
 3. (0\<^sub>v nr @\<^sub>v 0\<^sub>v 1) @\<^sub>v 0\<^sub>v nc @\<^sub>v 0\<^sub>v nc \<le> (u @\<^sub>v L) @\<^sub>v v @\<^sub>v w \<and> 0\<^sub>v nr \<le> t \<Longrightarrow> 0\<^sub>v nr \<le> u \<and> 0\<^sub>v 1 \<le> L \<and> 0\<^sub>v nc \<le> v \<and> 0\<^sub>v nc \<le> w \<and> 0\<^sub>v nr \<le> t
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0\<^sub>v nr @\<^sub>v 0\<^sub>v 1) @\<^sub>v 0\<^sub>v nc @\<^sub>v 0\<^sub>v nc \<in> carrier_vec (nr + 1 + (nc + nc))
[PROOF STEP]
by (intro append_carrier_vec, auto)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (u @\<^sub>v L) @\<^sub>v v @\<^sub>v w \<in> carrier_vec (nr + 1 + (nc + nc))
 2. (0\<^sub>v nr @\<^sub>v 0\<^sub>v 1) @\<^sub>v 0\<^sub>v nc @\<^sub>v 0\<^sub>v nc \<le> (u @\<^sub>v L) @\<^sub>v v @\<^sub>v w \<and> 0\<^sub>v nr \<le> t \<Longrightarrow> 0\<^sub>v nr \<le> u \<and> 0\<^sub>v 1 \<le> L \<and> 0\<^sub>v nc \<le> v \<and> 0\<^sub>v nc \<le> w \<and> 0\<^sub>v nr \<le> t
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (u @\<^sub>v L) @\<^sub>v v @\<^sub>v w \<in> carrier_vec (nr + 1 + (nc + nc))
[PROOF STEP]
by (intro append_carrier_vec u L v w)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0\<^sub>v nr @\<^sub>v 0\<^sub>v 1) @\<^sub>v 0\<^sub>v nc @\<^sub>v 0\<^sub>v nc \<le> (u @\<^sub>v L) @\<^sub>v v @\<^sub>v w \<and> 0\<^sub>v nr \<le> t \<Longrightarrow> 0\<^sub>v nr \<le> u \<and> 0\<^sub>v 1 \<le> L \<and> 0\<^sub>v nc \<le> v \<and> 0\<^sub>v nc \<le> w \<and> 0\<^sub>v nr \<le> t
[PROOF STEP]
apply (subst (asm) append_vec_le[of _ "(nr + 1)"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. 0\<^sub>v nr @\<^sub>v 0\<^sub>v 1 \<in> carrier_vec (nr + 1)
 2. u @\<^sub>v L \<in> carrier_vec (nr + 1)
 3. (0\<^sub>v nr @\<^sub>v 0\<^sub>v 1 \<le> u @\<^sub>v L \<and> 0\<^sub>v nc @\<^sub>v 0\<^sub>v nc \<le> v @\<^sub>v w) \<and> 0\<^sub>v nr \<le> t \<Longrightarrow> 0\<^sub>v nr \<le> u \<and> 0\<^sub>v 1 \<le> L \<and> 0\<^sub>v nc \<le> v \<and> 0\<^sub>v nc \<le> w \<and> 0\<^sub>v nr \<le> t
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0\<^sub>v nr @\<^sub>v 0\<^sub>v 1 \<in> carrier_vec (nr + 1)
[PROOF STEP]
by (intro append_carrier_vec, auto)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. u @\<^sub>v L \<in> carrier_vec (nr + 1)
 2. (0\<^sub>v nr @\<^sub>v 0\<^sub>v 1 \<le> u @\<^sub>v L \<and> 0\<^sub>v nc @\<^sub>v 0\<^sub>v nc \<le> v @\<^sub>v w) \<and> 0\<^sub>v nr \<le> t \<Longrightarrow> 0\<^sub>v nr \<le> u \<and> 0\<^sub>v 1 \<le> L \<and> 0\<^sub>v nc \<le> v \<and> 0\<^sub>v nc \<le> w \<and> 0\<^sub>v nr \<le> t
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u @\<^sub>v L \<in> carrier_vec (nr + 1)
[PROOF STEP]
by (intro append_carrier_vec u L v w)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0\<^sub>v nr @\<^sub>v 0\<^sub>v 1 \<le> u @\<^sub>v L \<and> 0\<^sub>v nc @\<^sub>v 0\<^sub>v nc \<le> v @\<^sub>v w) \<and> 0\<^sub>v nr \<le> t \<Longrightarrow> 0\<^sub>v nr \<le> u \<and> 0\<^sub>v 1 \<le> L \<and> 0\<^sub>v nc \<le> v \<and> 0\<^sub>v nc \<le> w \<and> 0\<^sub>v nr \<le> t
[PROOF STEP]
apply (subst (asm) append_vec_le[OF _ u], force)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((0\<^sub>v nr \<le> u \<and> 0\<^sub>v 1 \<le> L) \<and> 0\<^sub>v nc @\<^sub>v 0\<^sub>v nc \<le> v @\<^sub>v w) \<and> 0\<^sub>v nr \<le> t \<Longrightarrow> 0\<^sub>v nr \<le> u \<and> 0\<^sub>v 1 \<le> L \<and> 0\<^sub>v nc \<le> v \<and> 0\<^sub>v nc \<le> w \<and> 0\<^sub>v nr \<le> t
[PROOF STEP]
apply (subst (asm) append_vec_le[OF _ v], force)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((0\<^sub>v nr \<le> u \<and> 0\<^sub>v 1 \<le> L) \<and> 0\<^sub>v nc \<le> v \<and> 0\<^sub>v nc \<le> w) \<and> 0\<^sub>v nr \<le> t \<Longrightarrow> 0\<^sub>v nr \<le> u \<and> 0\<^sub>v 1 \<le> L \<and> 0\<^sub>v nc \<le> v \<and> 0\<^sub>v nc \<le> w \<and> 0\<^sub>v nr \<le> t
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0\<^sub>v nr \<le> u \<and> 0\<^sub>v 1 \<le> L \<and> 0\<^sub>v nc \<le> v \<and> 0\<^sub>v nc \<le> w \<and> 0\<^sub>v nr \<le> t

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
hence ineqs: "0\<^sub>v nr \<le> u" "0\<^sub>v 1 \<le> L" "0\<^sub>v nc \<le> v" "0\<^sub>v nc \<le> w" "0\<^sub>v nr \<le> t"
[PROOF STATE]
proof (prove)
using this:
0\<^sub>v nr \<le> u \<and> 0\<^sub>v 1 \<le> L \<and> 0\<^sub>v nc \<le> v \<and> 0\<^sub>v nc \<le> w \<and> 0\<^sub>v nr \<le> t

goal (1 subgoal):
 1. (0\<^sub>v nr \<le> u &&& 0\<^sub>v 1 \<le> L) &&& 0\<^sub>v nc \<le> v &&& 0\<^sub>v nc \<le> w &&& 0\<^sub>v nr \<le> t
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0\<^sub>v nr \<le> u
0\<^sub>v 1 \<le> L
0\<^sub>v nc \<le> v
0\<^sub>v nc \<le> w
0\<^sub>v nr \<le> t

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
have "ulv \<bullet> bc = u \<bullet> b + (v \<bullet> c + w \<bullet> (-c))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ulv \<bullet> bc = u \<bullet> b + (v \<bullet> c + w \<bullet> - c)
[PROOF STEP]
unfolding ulvid u1id u2id u3id bc_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (((u @\<^sub>v L) @\<^sub>v v @\<^sub>v w) @\<^sub>v t) \<bullet> (((b @\<^sub>v 0\<^sub>v 1) @\<^sub>v c @\<^sub>v - c) @\<^sub>v 0\<^sub>v nr) = u \<bullet> b + (v \<bullet> c + w \<bullet> - c)
[PROOF STEP]
apply (subst scalar_prod_append[OF _ t])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. (u @\<^sub>v L) @\<^sub>v v @\<^sub>v w \<in> carrier_vec ?n1.0
 2. (b @\<^sub>v 0\<^sub>v 1) @\<^sub>v c @\<^sub>v - c \<in> carrier_vec ?n1.0
 3. 0\<^sub>v nr \<in> carrier_vec nr
 4. ((u @\<^sub>v L) @\<^sub>v v @\<^sub>v w) \<bullet> ((b @\<^sub>v 0\<^sub>v 1) @\<^sub>v c @\<^sub>v - c) + t \<bullet> 0\<^sub>v nr = u \<bullet> b + (v \<bullet> c + w \<bullet> - c)
[PROOF STEP]
apply (rule append_carrier_vec[OF append_carrier_vec[OF u L] append_carrier_vec[OF v w]])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. (b @\<^sub>v 0\<^sub>v 1) @\<^sub>v c @\<^sub>v - c \<in> carrier_vec (nr + 1 + (nc + nc))
 2. 0\<^sub>v nr \<in> carrier_vec nr
 3. ((u @\<^sub>v L) @\<^sub>v v @\<^sub>v w) \<bullet> ((b @\<^sub>v 0\<^sub>v 1) @\<^sub>v c @\<^sub>v - c) + t \<bullet> 0\<^sub>v nr = u \<bullet> b + (v \<bullet> c + w \<bullet> - c)
[PROOF STEP]
apply (rule append_carrier_vec[OF append_carrier_vec[OF b] append_carrier_vec]; use c in force)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 0\<^sub>v nr \<in> carrier_vec nr
 2. ((u @\<^sub>v L) @\<^sub>v v @\<^sub>v w) \<bullet> ((b @\<^sub>v 0\<^sub>v 1) @\<^sub>v c @\<^sub>v - c) + t \<bullet> 0\<^sub>v nr = u \<bullet> b + (v \<bullet> c + w \<bullet> - c)
[PROOF STEP]
apply force
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((u @\<^sub>v L) @\<^sub>v v @\<^sub>v w) \<bullet> ((b @\<^sub>v 0\<^sub>v 1) @\<^sub>v c @\<^sub>v - c) + t \<bullet> 0\<^sub>v nr = u \<bullet> b + (v \<bullet> c + w \<bullet> - c)
[PROOF STEP]
apply (subst scalar_prod_append)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. u @\<^sub>v L \<in> carrier_vec ?n1.23
 2. v @\<^sub>v w \<in> carrier_vec ?n2.23
 3. b @\<^sub>v 0\<^sub>v 1 \<in> carrier_vec ?n1.23
 4. c @\<^sub>v - c \<in> carrier_vec ?n2.23
 5. (u @\<^sub>v L) \<bullet> (b @\<^sub>v 0\<^sub>v 1) + (v @\<^sub>v w) \<bullet> (c @\<^sub>v - c) + t \<bullet> 0\<^sub>v nr = u \<bullet> b + (v \<bullet> c + w \<bullet> - c)
[PROOF STEP]
apply (rule append_carrier_vec[OF u L])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. v @\<^sub>v w \<in> carrier_vec ?n2.23
 2. b @\<^sub>v 0\<^sub>v 1 \<in> carrier_vec (nr + 1)
 3. c @\<^sub>v - c \<in> carrier_vec ?n2.23
 4. (u @\<^sub>v L) \<bullet> (b @\<^sub>v 0\<^sub>v 1) + (v @\<^sub>v w) \<bullet> (c @\<^sub>v - c) + t \<bullet> 0\<^sub>v nr = u \<bullet> b + (v \<bullet> c + w \<bullet> - c)
[PROOF STEP]
apply (rule append_carrier_vec[OF v w])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. b @\<^sub>v 0\<^sub>v 1 \<in> carrier_vec (nr + 1)
 2. c @\<^sub>v - c \<in> carrier_vec (nc + nc)
 3. (u @\<^sub>v L) \<bullet> (b @\<^sub>v 0\<^sub>v 1) + (v @\<^sub>v w) \<bullet> (c @\<^sub>v - c) + t \<bullet> 0\<^sub>v nr = u \<bullet> b + (v \<bullet> c + w \<bullet> - c)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b @\<^sub>v 0\<^sub>v 1 \<in> carrier_vec (nr + 1)
[PROOF STEP]
by (rule append_carrier_vec, insert b, auto)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. c @\<^sub>v - c \<in> carrier_vec (nc + nc)
 2. (u @\<^sub>v L) \<bullet> (b @\<^sub>v 0\<^sub>v 1) + (v @\<^sub>v w) \<bullet> (c @\<^sub>v - c) + t \<bullet> 0\<^sub>v nr = u \<bullet> b + (v \<bullet> c + w \<bullet> - c)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c @\<^sub>v - c \<in> carrier_vec (nc + nc)
[PROOF STEP]
by (rule append_carrier_vec, insert c, auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (u @\<^sub>v L) \<bullet> (b @\<^sub>v 0\<^sub>v 1) + (v @\<^sub>v w) \<bullet> (c @\<^sub>v - c) + t \<bullet> 0\<^sub>v nr = u \<bullet> b + (v \<bullet> c + w \<bullet> - c)
[PROOF STEP]
apply (subst scalar_prod_append[OF u L b], force)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u \<bullet> b + L \<bullet> 0\<^sub>v 1 + (v @\<^sub>v w) \<bullet> (c @\<^sub>v - c) + t \<bullet> 0\<^sub>v nr = u \<bullet> b + (v \<bullet> c + w \<bullet> - c)
[PROOF STEP]
apply (subst scalar_prod_append[OF v w c], use c in force)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u \<bullet> b + L \<bullet> 0\<^sub>v 1 + (v \<bullet> c + w \<bullet> - c) + t \<bullet> 0\<^sub>v nr = u \<bullet> b + (v \<bullet> c + w \<bullet> - c)
[PROOF STEP]
apply (insert L t, auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
ulv \<bullet> bc = u \<bullet> b + (v \<bullet> c + w \<bullet> - c)

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ulv \<bullet> bc = u \<bullet> b + (v \<bullet> c + w \<bullet> - c)

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
have "v \<bullet> c + w \<bullet> (-c) = c \<bullet> v + (-c) \<bullet> w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<bullet> c + w \<bullet> - c = c \<bullet> v + - c \<bullet> w
[PROOF STEP]
by (subst (1 2) comm_scalar_prod, insert w c v, auto)
[PROOF STATE]
proof (state)
this:
v \<bullet> c + w \<bullet> - c = c \<bullet> v + - c \<bullet> w

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
v \<bullet> c + w \<bullet> - c = c \<bullet> v + - c \<bullet> w

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
have "\<dots> = c \<bullet> v - (c \<bullet> w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<bullet> v + - c \<bullet> w = c \<bullet> v - c \<bullet> w
[PROOF STEP]
using c w
[PROOF STATE]
proof (prove)
using this:
c \<in> carrier_vec nc
w \<in> carrier_vec nc

goal (1 subgoal):
 1. c \<bullet> v + - c \<bullet> w = c \<bullet> v - c \<bullet> w
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
c \<bullet> v + - c \<bullet> w = c \<bullet> v - c \<bullet> w

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
c \<bullet> v + - c \<bullet> w = c \<bullet> v - c \<bullet> w

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
have "\<dots> = c \<bullet> (v - w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<bullet> v - c \<bullet> w = c \<bullet> (v - w)
[PROOF STEP]
using c v w
[PROOF STATE]
proof (prove)
using this:
c \<in> carrier_vec nc
v \<in> carrier_vec nc
w \<in> carrier_vec nc

goal (1 subgoal):
 1. c \<bullet> v - c \<bullet> w = c \<bullet> (v - w)
[PROOF STEP]
by (simp add: scalar_prod_minus_distrib)
[PROOF STATE]
proof (state)
this:
c \<bullet> v - c \<bullet> w = c \<bullet> (v - w)

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
ulv \<bullet> bc = u \<bullet> b + c \<bullet> (v - w)
[PROOF STEP]
have ulvbc: "ulv \<bullet> bc = u \<bullet> b + c \<bullet> (v - w)"
[PROOF STATE]
proof (prove)
using this:
ulv \<bullet> bc = u \<bullet> b + c \<bullet> (v - w)

goal (1 subgoal):
 1. ulv \<bullet> bc = u \<bullet> b + c \<bullet> (v - w)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
ulv \<bullet> bc = u \<bullet> b + c \<bullet> (v - w)

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
define lam where "lam = L $ 0"
[PROOF STATE]
proof (state)
this:
lam = L $ 0

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
from ineqs(2) L
[PROOF STATE]
proof (chain)
picking this:
0\<^sub>v 1 \<le> L
L \<in> carrier_vec 1
[PROOF STEP]
have lam0: "lam \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
0\<^sub>v 1 \<le> L
L \<in> carrier_vec 1

goal (1 subgoal):
 1. (0::'a) \<le> lam
[PROOF STEP]
unfolding less_eq_vec_def lam_def
[PROOF STATE]
proof (prove)
using this:
dim_vec (0\<^sub>v 1) = dim_vec L \<and> (\<forall>i<dim_vec L. 0\<^sub>v 1 $ i \<le> L $ i)
L \<in> carrier_vec 1

goal (1 subgoal):
 1. (0::'a) \<le> L $ 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(0::'a) \<le> lam

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
have As: "A\<^sup>T *\<^sub>v u = lam \<cdot>\<^sub>v c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A\<^sup>T *\<^sub>v u = lam \<cdot>\<^sub>v c
[PROOF STEP]
unfolding As
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_of_col c *\<^sub>v L = lam \<cdot>\<^sub>v c
[PROOF STEP]
using c L
[PROOF STATE]
proof (prove)
using this:
c \<in> carrier_vec nc
L \<in> carrier_vec 1

goal (1 subgoal):
 1. mat_of_col c *\<^sub>v L = lam \<cdot>\<^sub>v c
[PROOF STEP]
unfolding lam_def mat_of_col_def
[PROOF STATE]
proof (prove)
using this:
c \<in> carrier_vec nc
L \<in> carrier_vec 1

goal (1 subgoal):
 1. (mat_of_row c)\<^sup>T *\<^sub>v L = L $ 0 \<cdot>\<^sub>v c
[PROOF STEP]
by (intro eq_vecI, auto simp: scalar_prod_def)
[PROOF STATE]
proof (state)
this:
A\<^sup>T *\<^sub>v u = lam \<cdot>\<^sub>v c

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
have vec3: "vec3 = lam \<cdot>\<^sub>v b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec3 = lam \<cdot>\<^sub>v b
[PROOF STEP]
unfolding vec3_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_of_col b *\<^sub>v L = lam \<cdot>\<^sub>v b
[PROOF STEP]
using b L
[PROOF STATE]
proof (prove)
using this:
b \<in> carrier_vec nr
L \<in> carrier_vec 1

goal (1 subgoal):
 1. mat_of_col b *\<^sub>v L = lam \<cdot>\<^sub>v b
[PROOF STEP]
unfolding lam_def mat_of_col_def
[PROOF STATE]
proof (prove)
using this:
b \<in> carrier_vec nr
L \<in> carrier_vec 1

goal (1 subgoal):
 1. (mat_of_row b)\<^sup>T *\<^sub>v L = L $ 0 \<cdot>\<^sub>v b
[PROOF STEP]
by (intro eq_vecI, auto simp: scalar_prod_def)
[PROOF STATE]
proof (state)
this:
vec3 = lam \<cdot>\<^sub>v b

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
note preconds = lam0 ineqs(1,3-)[unfolded t23[unfolded vec2_def vec3]] As
[PROOF STATE]
proof (state)
this:
(0::'a) \<le> lam
0\<^sub>v nr \<le> u
0\<^sub>v nc \<le> v
0\<^sub>v nc \<le> w
0\<^sub>v nr \<le> A *\<^sub>v (v - w) + lam \<cdot>\<^sub>v b
A\<^sup>T *\<^sub>v u = lam \<cdot>\<^sub>v c

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
have "0 \<le> u \<bullet> b + c \<bullet> (v - w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
[PROOF STEP]
proof (cases "lam > 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (0::'a) < lam \<Longrightarrow> (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
 2. \<not> (0::'a) < lam \<Longrightarrow> (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
(0::'a) < lam

goal (2 subgoals):
 1. (0::'a) < lam \<Longrightarrow> (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
 2. \<not> (0::'a) < lam \<Longrightarrow> (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
[PROOF STEP]
hence "u \<bullet> b = inverse lam * (lam * (b \<bullet> u))"
[PROOF STATE]
proof (prove)
using this:
(0::'a) < lam

goal (1 subgoal):
 1. u \<bullet> b = inverse lam * (lam * (b \<bullet> u))
[PROOF STEP]
using comm_scalar_prod[OF b u]
[PROOF STATE]
proof (prove)
using this:
(0::'a) < lam
b \<bullet> u = u \<bullet> b

goal (1 subgoal):
 1. u \<bullet> b = inverse lam * (lam * (b \<bullet> u))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
u \<bullet> b = inverse lam * (lam * (b \<bullet> u))

goal (2 subgoals):
 1. (0::'a) < lam \<Longrightarrow> (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
 2. \<not> (0::'a) < lam \<Longrightarrow> (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
u \<bullet> b = inverse lam * (lam * (b \<bullet> u))

goal (2 subgoals):
 1. (0::'a) < lam \<Longrightarrow> (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
 2. \<not> (0::'a) < lam \<Longrightarrow> (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
[PROOF STEP]
have "\<dots> = inverse lam * ((lam \<cdot>\<^sub>v b) \<bullet> u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse lam * (lam * (b \<bullet> u)) = inverse lam * ((lam \<cdot>\<^sub>v b) \<bullet> u)
[PROOF STEP]
using b u
[PROOF STATE]
proof (prove)
using this:
b \<in> carrier_vec nr
u \<in> carrier_vec nr

goal (1 subgoal):
 1. inverse lam * (lam * (b \<bullet> u)) = inverse lam * ((lam \<cdot>\<^sub>v b) \<bullet> u)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
inverse lam * (lam * (b \<bullet> u)) = inverse lam * ((lam \<cdot>\<^sub>v b) \<bullet> u)

goal (2 subgoals):
 1. (0::'a) < lam \<Longrightarrow> (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
 2. \<not> (0::'a) < lam \<Longrightarrow> (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
inverse lam * (lam * (b \<bullet> u)) = inverse lam * ((lam \<cdot>\<^sub>v b) \<bullet> u)

goal (2 subgoals):
 1. (0::'a) < lam \<Longrightarrow> (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
 2. \<not> (0::'a) < lam \<Longrightarrow> (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
[PROOF STEP]
have "\<dots> \<ge> inverse lam * (-(A *\<^sub>v (v - w)) \<bullet> u)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse lam * (- (A *\<^sub>v (v - w)) \<bullet> u) \<le> inverse lam * ((lam \<cdot>\<^sub>v b) \<bullet> u)
[PROOF STEP]
proof (intro mult_left_mono)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. - (A *\<^sub>v (v - w)) \<bullet> u \<le> (lam \<cdot>\<^sub>v b) \<bullet> u
 2. (0::'a) \<le> inverse lam
[PROOF STEP]
show "0 \<le> inverse lam"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) \<le> inverse lam
[PROOF STEP]
using preconds
[PROOF STATE]
proof (prove)
using this:
(0::'a) \<le> lam
0\<^sub>v nr \<le> u
0\<^sub>v nc \<le> v
0\<^sub>v nc \<le> w
0\<^sub>v nr \<le> A *\<^sub>v (v - w) + lam \<cdot>\<^sub>v b
A\<^sup>T *\<^sub>v u = lam \<cdot>\<^sub>v c

goal (1 subgoal):
 1. (0::'a) \<le> inverse lam
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(0::'a) \<le> inverse lam

goal (1 subgoal):
 1. - (A *\<^sub>v (v - w)) \<bullet> u \<le> (lam \<cdot>\<^sub>v b) \<bullet> u
[PROOF STEP]
show "-(A *\<^sub>v (v - w)) \<bullet> u \<le> (lam \<cdot>\<^sub>v b) \<bullet> u"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (A *\<^sub>v (v - w)) \<bullet> u \<le> (lam \<cdot>\<^sub>v b) \<bullet> u
[PROOF STEP]
unfolding scalar_prod_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<dim_vec u. (- (A *\<^sub>v (v - w))) $ i * u $ i) \<le> (\<Sum>i = 0..<dim_vec u. (lam \<cdot>\<^sub>v b) $ i * u $ i)
[PROOF STEP]
apply (rule sum_mono)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i \<in> {0..<dim_vec u} \<Longrightarrow> (- (A *\<^sub>v (v - w))) $ i * u $ i \<le> (lam \<cdot>\<^sub>v b) $ i * u $ i
[PROOF STEP]
subgoal for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<in> {0..<dim_vec u} \<Longrightarrow> (- (A *\<^sub>v (v - w))) $ i * u $ i \<le> (lam \<cdot>\<^sub>v b) $ i * u $ i
[PROOF STEP]
using lesseq_vecD[OF _ preconds(2), of nr i] lesseq_vecD[OF _ preconds(5), of nr i] u v w b A
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>u \<in> carrier_vec nr; i < nr\<rbrakk> \<Longrightarrow> 0\<^sub>v nr $ i \<le> u $ i
\<lbrakk>A *\<^sub>v (v - w) + lam \<cdot>\<^sub>v b \<in> carrier_vec nr; i < nr\<rbrakk> \<Longrightarrow> 0\<^sub>v nr $ i \<le> (A *\<^sub>v (v - w) + lam \<cdot>\<^sub>v b) $ i
u \<in> carrier_vec nr
v \<in> carrier_vec nc
w \<in> carrier_vec nc
b \<in> carrier_vec nr
A \<in> carrier_mat nr nc

goal (1 subgoal):
 1. i \<in> {0..<dim_vec u} \<Longrightarrow> (- (A *\<^sub>v (v - w))) $ i * u $ i \<le> (lam \<cdot>\<^sub>v b) $ i * u $ i
[PROOF STEP]
by (intro mult_right_mono, auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
- (A *\<^sub>v (v - w)) \<bullet> u \<le> (lam \<cdot>\<^sub>v b) \<bullet> u

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
inverse lam * (- (A *\<^sub>v (v - w)) \<bullet> u) \<le> inverse lam * ((lam \<cdot>\<^sub>v b) \<bullet> u)

goal (2 subgoals):
 1. (0::'a) < lam \<Longrightarrow> (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
 2. \<not> (0::'a) < lam \<Longrightarrow> (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
inverse lam * (- (A *\<^sub>v (v - w)) \<bullet> u) \<le> inverse lam * ((lam \<cdot>\<^sub>v b) \<bullet> u)

goal (2 subgoals):
 1. (0::'a) < lam \<Longrightarrow> (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
 2. \<not> (0::'a) < lam \<Longrightarrow> (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
[PROOF STEP]
have "inverse lam * (-(A *\<^sub>v (v - w)) \<bullet> u) =
         - (inverse lam * ((A *\<^sub>v (v - w)) \<bullet> u))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse lam * (- (A *\<^sub>v (v - w)) \<bullet> u) = - (inverse lam * ((A *\<^sub>v (v - w)) \<bullet> u))
[PROOF STEP]
by (subst scalar_prod_uminus_left, insert A u v w, auto)
[PROOF STATE]
proof (state)
this:
inverse lam * (- (A *\<^sub>v (v - w)) \<bullet> u) = - (inverse lam * ((A *\<^sub>v (v - w)) \<bullet> u))

goal (2 subgoals):
 1. (0::'a) < lam \<Longrightarrow> (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
 2. \<not> (0::'a) < lam \<Longrightarrow> (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
inverse lam * (- (A *\<^sub>v (v - w)) \<bullet> u) = - (inverse lam * ((A *\<^sub>v (v - w)) \<bullet> u))

goal (2 subgoals):
 1. (0::'a) < lam \<Longrightarrow> (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
 2. \<not> (0::'a) < lam \<Longrightarrow> (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
[PROOF STEP]
have "(A *\<^sub>v (v - w)) \<bullet> u = (A\<^sup>T *\<^sub>v u) \<bullet> (v - w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A *\<^sub>v (v - w)) \<bullet> u = (A\<^sup>T *\<^sub>v u) \<bullet> (v - w)
[PROOF STEP]
apply (subst transpose_vec_mult_scalar[OF A _ u])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. v - w \<in> carrier_vec nc
 2. (A *\<^sub>v (v - w)) \<bullet> u = u \<bullet> (A *\<^sub>v (v - w))
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v - w \<in> carrier_vec nc
[PROOF STEP]
using v w
[PROOF STATE]
proof (prove)
using this:
v \<in> carrier_vec nc
w \<in> carrier_vec nc

goal (1 subgoal):
 1. v - w \<in> carrier_vec nc
[PROOF STEP]
by force
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A *\<^sub>v (v - w)) \<bullet> u = u \<bullet> (A *\<^sub>v (v - w))
[PROOF STEP]
by (rule comm_scalar_prod[OF _ u], insert A v w, auto)
[PROOF STATE]
proof (state)
this:
(A *\<^sub>v (v - w)) \<bullet> u = (A\<^sup>T *\<^sub>v u) \<bullet> (v - w)

goal (2 subgoals):
 1. (0::'a) < lam \<Longrightarrow> (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
 2. \<not> (0::'a) < lam \<Longrightarrow> (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(A *\<^sub>v (v - w)) \<bullet> u = (A\<^sup>T *\<^sub>v u) \<bullet> (v - w)

goal (2 subgoals):
 1. (0::'a) < lam \<Longrightarrow> (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
 2. \<not> (0::'a) < lam \<Longrightarrow> (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
[PROOF STEP]
have "inverse lam * \<dots> = c \<bullet> (v - w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse lam * ((A\<^sup>T *\<^sub>v u) \<bullet> (v - w)) = c \<bullet> (v - w)
[PROOF STEP]
unfolding preconds(6)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse lam * ((lam \<cdot>\<^sub>v c) \<bullet> (v - w)) = c \<bullet> (v - w)
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
(0::'a) < lam

goal (1 subgoal):
 1. inverse lam * ((lam \<cdot>\<^sub>v c) \<bullet> (v - w)) = c \<bullet> (v - w)
[PROOF STEP]
by (subst scalar_prod_smult_left, insert c v w, auto)
[PROOF STATE]
proof (state)
this:
inverse lam * ((A\<^sup>T *\<^sub>v u) \<bullet> (v - w)) = c \<bullet> (v - w)

goal (2 subgoals):
 1. (0::'a) < lam \<Longrightarrow> (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
 2. \<not> (0::'a) < lam \<Longrightarrow> (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
- (c \<bullet> (v - w)) \<le> u \<bullet> b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
- (c \<bullet> (v - w)) \<le> u \<bullet> b

goal (1 subgoal):
 1. (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)

goal (1 subgoal):
 1. \<not> (0::'a) < lam \<Longrightarrow> (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (0::'a) < lam \<Longrightarrow> (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (0::'a) < lam

goal (1 subgoal):
 1. \<not> (0::'a) < lam \<Longrightarrow> (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
[PROOF STEP]
with preconds
[PROOF STATE]
proof (chain)
picking this:
(0::'a) \<le> lam
0\<^sub>v nr \<le> u
0\<^sub>v nc \<le> v
0\<^sub>v nc \<le> w
0\<^sub>v nr \<le> A *\<^sub>v (v - w) + lam \<cdot>\<^sub>v b
A\<^sup>T *\<^sub>v u = lam \<cdot>\<^sub>v c
\<not> (0::'a) < lam
[PROOF STEP]
have lam: "lam = 0"
[PROOF STATE]
proof (prove)
using this:
(0::'a) \<le> lam
0\<^sub>v nr \<le> u
0\<^sub>v nc \<le> v
0\<^sub>v nc \<le> w
0\<^sub>v nr \<le> A *\<^sub>v (v - w) + lam \<cdot>\<^sub>v b
A\<^sup>T *\<^sub>v u = lam \<cdot>\<^sub>v c
\<not> (0::'a) < lam

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

goal (1 subgoal):
 1. \<not> (0::'a) < lam \<Longrightarrow> (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
[PROOF STEP]
from primal
[PROOF STATE]
proof (chain)
picking this:
\<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
obtain x0 where x0: "x0 \<in> carrier_vec nc"
        and Ax0b: "A *\<^sub>v x0 \<le> b"
[PROOF STATE]
proof (prove)
using this:
\<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b

goal (1 subgoal):
 1. (\<And>x0. \<lbrakk>x0 \<in> carrier_vec nc; A *\<^sub>v x0 \<le> b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x0 \<in> carrier_vec nc
A *\<^sub>v x0 \<le> b

goal (1 subgoal):
 1. \<not> (0::'a) < lam \<Longrightarrow> (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
[PROOF STEP]
from dual
[PROOF STATE]
proof (chain)
picking this:
\<exists>y\<ge>0\<^sub>v nr. A\<^sup>T *\<^sub>v y = c
[PROOF STEP]
obtain y0 where y00: "y0 \<ge> 0\<^sub>v nr"
        and Ay0c: "A\<^sup>T *\<^sub>v y0 = c"
[PROOF STATE]
proof (prove)
using this:
\<exists>y\<ge>0\<^sub>v nr. A\<^sup>T *\<^sub>v y = c

goal (1 subgoal):
 1. (\<And>y0. \<lbrakk>0\<^sub>v nr \<le> y0; A\<^sup>T *\<^sub>v y0 = c\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0\<^sub>v nr \<le> y0
A\<^sup>T *\<^sub>v y0 = c

goal (1 subgoal):
 1. \<not> (0::'a) < lam \<Longrightarrow> (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
[PROOF STEP]
from y00
[PROOF STATE]
proof (chain)
picking this:
0\<^sub>v nr \<le> y0
[PROOF STEP]
have y0: "y0 \<in> carrier_vec nr"
[PROOF STATE]
proof (prove)
using this:
0\<^sub>v nr \<le> y0

goal (1 subgoal):
 1. y0 \<in> carrier_vec nr
[PROOF STEP]
unfolding less_eq_vec_def
[PROOF STATE]
proof (prove)
using this:
dim_vec (0\<^sub>v nr) = dim_vec y0 \<and> (\<forall>i<dim_vec y0. 0\<^sub>v nr $ i \<le> y0 $ i)

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

goal (1 subgoal):
 1. \<not> (0::'a) < lam \<Longrightarrow> (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
[PROOF STEP]
have Au: "A\<^sup>T *\<^sub>v u = 0\<^sub>v nc"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A\<^sup>T *\<^sub>v u = 0\<^sub>v nc
[PROOF STEP]
unfolding preconds lam
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) \<cdot>\<^sub>v c = 0\<^sub>v nc
[PROOF STEP]
using c
[PROOF STATE]
proof (prove)
using this:
c \<in> carrier_vec nc

goal (1 subgoal):
 1. (0::'a) \<cdot>\<^sub>v c = 0\<^sub>v nc
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A\<^sup>T *\<^sub>v u = 0\<^sub>v nc

goal (1 subgoal):
 1. \<not> (0::'a) < lam \<Longrightarrow> (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
[PROOF STEP]
have "0 = (A\<^sup>T *\<^sub>v u) \<bullet> x0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) = (A\<^sup>T *\<^sub>v u) \<bullet> x0
[PROOF STEP]
unfolding Au
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) = 0\<^sub>v nc \<bullet> x0
[PROOF STEP]
using x0
[PROOF STATE]
proof (prove)
using this:
x0 \<in> carrier_vec nc

goal (1 subgoal):
 1. (0::'a) = 0\<^sub>v nc \<bullet> x0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(0::'a) = (A\<^sup>T *\<^sub>v u) \<bullet> x0

goal (1 subgoal):
 1. \<not> (0::'a) < lam \<Longrightarrow> (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(0::'a) = (A\<^sup>T *\<^sub>v u) \<bullet> x0

goal (1 subgoal):
 1. \<not> (0::'a) < lam \<Longrightarrow> (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
[PROOF STEP]
have "\<dots> = u \<bullet> (A *\<^sub>v x0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A\<^sup>T *\<^sub>v u) \<bullet> x0 = u \<bullet> (A *\<^sub>v x0)
[PROOF STEP]
by (rule transpose_vec_mult_scalar[OF A x0 u])
[PROOF STATE]
proof (state)
this:
(A\<^sup>T *\<^sub>v u) \<bullet> x0 = u \<bullet> (A *\<^sub>v x0)

goal (1 subgoal):
 1. \<not> (0::'a) < lam \<Longrightarrow> (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(A\<^sup>T *\<^sub>v u) \<bullet> x0 = u \<bullet> (A *\<^sub>v x0)

goal (1 subgoal):
 1. \<not> (0::'a) < lam \<Longrightarrow> (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
[PROOF STEP]
have "\<dots> \<le> u \<bullet> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. u \<bullet> (A *\<^sub>v x0) \<le> u \<bullet> b
[PROOF STEP]
unfolding scalar_prod_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<dim_vec (A *\<^sub>v x0). u $ i * (A *\<^sub>v x0) $ i) \<le> (\<Sum>i = 0..<dim_vec b. u $ i * b $ i)
[PROOF STEP]
apply (use A x0 b in simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<in> carrier_mat nr nc; x0 \<in> carrier_vec nc; b \<in> carrier_vec nr\<rbrakk> \<Longrightarrow> (\<Sum>i = 0..<nr. u $ i * (row A i \<bullet> x0)) \<le> (\<Sum>i = 0..<nr. u $ i * b $ i)
[PROOF STEP]
apply (intro sum_mono)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>A \<in> carrier_mat nr nc; x0 \<in> carrier_vec nc; b \<in> carrier_vec nr; i \<in> {0..<nr}\<rbrakk> \<Longrightarrow> u $ i * (row A i \<bullet> x0) \<le> u $ i * b $ i
[PROOF STEP]
subgoal for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<in> carrier_mat nr nc; x0 \<in> carrier_vec nc; b \<in> carrier_vec nr; i \<in> {0..<nr}\<rbrakk> \<Longrightarrow> u $ i * (row A i \<bullet> x0) \<le> u $ i * b $ i
[PROOF STEP]
using lesseq_vecD[OF _ preconds(2), of nr i] lesseq_vecD[OF _ Ax0b, of nr i] u v w b A x0
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>u \<in> carrier_vec nr; i < nr\<rbrakk> \<Longrightarrow> 0\<^sub>v nr $ i \<le> u $ i
\<lbrakk>b \<in> carrier_vec nr; i < nr\<rbrakk> \<Longrightarrow> (A *\<^sub>v x0) $ i \<le> b $ i
u \<in> carrier_vec nr
v \<in> carrier_vec nc
w \<in> carrier_vec nc
b \<in> carrier_vec nr
A \<in> carrier_mat nr nc
x0 \<in> carrier_vec nc

goal (1 subgoal):
 1. \<lbrakk>A \<in> carrier_mat nr nc; x0 \<in> carrier_vec nc; b \<in> carrier_vec nr; i \<in> {0..<nr}\<rbrakk> \<Longrightarrow> u $ i * (row A i \<bullet> x0) \<le> u $ i * b $ i
[PROOF STEP]
by (intro mult_left_mono, auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
u \<bullet> (A *\<^sub>v x0) \<le> u \<bullet> b

goal (1 subgoal):
 1. \<not> (0::'a) < lam \<Longrightarrow> (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(0::'a) \<le> u \<bullet> b
[PROOF STEP]
have ub: "0 \<le> u \<bullet> b"
[PROOF STATE]
proof (prove)
using this:
(0::'a) \<le> u \<bullet> b

goal (1 subgoal):
 1. (0::'a) \<le> u \<bullet> b
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(0::'a) \<le> u \<bullet> b

goal (1 subgoal):
 1. \<not> (0::'a) < lam \<Longrightarrow> (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
[PROOF STEP]
have "c \<bullet> (v - w) = (A\<^sup>T *\<^sub>v y0) \<bullet> (v - w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<bullet> (v - w) = (A\<^sup>T *\<^sub>v y0) \<bullet> (v - w)
[PROOF STEP]
unfolding Ay0c
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<bullet> (v - w) = c \<bullet> (v - w)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
c \<bullet> (v - w) = (A\<^sup>T *\<^sub>v y0) \<bullet> (v - w)

goal (1 subgoal):
 1. \<not> (0::'a) < lam \<Longrightarrow> (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
c \<bullet> (v - w) = (A\<^sup>T *\<^sub>v y0) \<bullet> (v - w)

goal (1 subgoal):
 1. \<not> (0::'a) < lam \<Longrightarrow> (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
[PROOF STEP]
have "\<dots> = y0 \<bullet> (A *\<^sub>v (v - w))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A\<^sup>T *\<^sub>v y0) \<bullet> (v - w) = y0 \<bullet> (A *\<^sub>v (v - w))
[PROOF STEP]
by (subst transpose_vec_mult_scalar[OF A _ y0], insert v w, auto)
[PROOF STATE]
proof (state)
this:
(A\<^sup>T *\<^sub>v y0) \<bullet> (v - w) = y0 \<bullet> (A *\<^sub>v (v - w))

goal (1 subgoal):
 1. \<not> (0::'a) < lam \<Longrightarrow> (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(A\<^sup>T *\<^sub>v y0) \<bullet> (v - w) = y0 \<bullet> (A *\<^sub>v (v - w))

goal (1 subgoal):
 1. \<not> (0::'a) < lam \<Longrightarrow> (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
[PROOF STEP]
have "\<dots> \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) \<le> y0 \<bullet> (A *\<^sub>v (v - w))
[PROOF STEP]
unfolding scalar_prod_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) \<le> (\<Sum>i = 0..<dim_vec (A *\<^sub>v (v - w)). y0 $ i * (A *\<^sub>v (v - w)) $ i)
[PROOF STEP]
apply (use A v w in simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<in> carrier_mat nr nc; v \<in> carrier_vec nc; w \<in> carrier_vec nc\<rbrakk> \<Longrightarrow> (0::'a) \<le> (\<Sum>i = 0..<nr. y0 $ i * (row A i \<bullet> (v - w)))
[PROOF STEP]
apply (intro sum_nonneg)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>A \<in> carrier_mat nr nc; v \<in> carrier_vec nc; w \<in> carrier_vec nc; x \<in> {0..<nr}\<rbrakk> \<Longrightarrow> (0::'a) \<le> y0 $ x * (row A x \<bullet> (v - w))
[PROOF STEP]
subgoal for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<in> carrier_mat nr nc; v \<in> carrier_vec nc; w \<in> carrier_vec nc; i \<in> {0..<nr}\<rbrakk> \<Longrightarrow> (0::'a) \<le> y0 $ i * (row A i \<bullet> (v - w))
[PROOF STEP]
using lesseq_vecD[OF _ y00, of nr i] lesseq_vecD[OF _ preconds(5)[unfolded lam], of nr i] A y0 v w b
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>y0 \<in> carrier_vec nr; i < nr\<rbrakk> \<Longrightarrow> 0\<^sub>v nr $ i \<le> y0 $ i
\<lbrakk>A *\<^sub>v (v - w) + (0::'a) \<cdot>\<^sub>v b \<in> carrier_vec nr; i < nr\<rbrakk> \<Longrightarrow> 0\<^sub>v nr $ i \<le> (A *\<^sub>v (v - w) + (0::'a) \<cdot>\<^sub>v b) $ i
A \<in> carrier_mat nr nc
y0 \<in> carrier_vec nr
v \<in> carrier_vec nc
w \<in> carrier_vec nc
b \<in> carrier_vec nr

goal (1 subgoal):
 1. \<lbrakk>A \<in> carrier_mat nr nc; v \<in> carrier_vec nc; w \<in> carrier_vec nc; i \<in> {0..<nr}\<rbrakk> \<Longrightarrow> (0::'a) \<le> y0 $ i * (row A i \<bullet> (v - w))
[PROOF STEP]
by (intro mult_nonneg_nonneg, auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(0::'a) \<le> y0 \<bullet> (A *\<^sub>v (v - w))

goal (1 subgoal):
 1. \<not> (0::'a) < lam \<Longrightarrow> (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(0::'a) \<le> c \<bullet> (v - w)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(0::'a) \<le> c \<bullet> (v - w)

goal (1 subgoal):
 1. (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
[PROOF STEP]
using ub
[PROOF STATE]
proof (prove)
using this:
(0::'a) \<le> c \<bullet> (v - w)
(0::'a) \<le> u \<bullet> b

goal (1 subgoal):
 1. (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)

goal (1 subgoal):
 1. \<And>y. \<lbrakk>0\<^sub>v (nr + 1 + (nc + nc) + nr) \<le> y; M\<^sup>T *\<^sub>v y = 0\<^sub>v (nc + nr)\<rbrakk> \<Longrightarrow> (0::'a) \<le> y \<bullet> bc
[PROOF STEP]
thus "0 \<le> ulv \<bullet> bc"
[PROOF STATE]
proof (prove)
using this:
(0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)

goal (1 subgoal):
 1. (0::'a) \<le> ulv \<bullet> bc
[PROOF STEP]
unfolding ulvbc
[PROOF STATE]
proof (prove)
using this:
(0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)

goal (1 subgoal):
 1. (0::'a) \<le> u \<bullet> b + c \<bullet> (v - w)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(0::'a) \<le> ulv \<bullet> bc

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>xy. xy \<in> carrier_vec (nc + nr) \<and> M *\<^sub>v xy \<le> bc

goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>xy. xy \<in> carrier_vec (nc + nr) \<and> M *\<^sub>v xy \<le> bc
[PROOF STEP]
obtain xy where xy: "xy \<in> carrier_vec ?nc" and le: "M *\<^sub>v xy \<le> bc"
[PROOF STATE]
proof (prove)
using this:
\<exists>xy. xy \<in> carrier_vec (nc + nr) \<and> M *\<^sub>v xy \<le> bc

goal (1 subgoal):
 1. (\<And>xy. \<lbrakk>xy \<in> carrier_vec (nc + nr); M *\<^sub>v xy \<le> bc\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
xy \<in> carrier_vec (nc + nr)
M *\<^sub>v xy \<le> bc

goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
define x where "x = vec_first xy nc"
[PROOF STATE]
proof (state)
this:
x = vec_first xy nc

goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
define y where "y = vec_last xy nr"
[PROOF STATE]
proof (state)
this:
y = vec_last xy nr

goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
have xyid: "xy = x @\<^sub>v y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xy = x @\<^sub>v y
[PROOF STEP]
using xy
[PROOF STATE]
proof (prove)
using this:
xy \<in> carrier_vec (nc + nr)

goal (1 subgoal):
 1. xy = x @\<^sub>v y
[PROOF STEP]
unfolding x_def y_def
[PROOF STATE]
proof (prove)
using this:
xy \<in> carrier_vec (nc + nr)

goal (1 subgoal):
 1. xy = vec_first xy nc @\<^sub>v vec_last xy nr
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
xy = x @\<^sub>v y

goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
have x: "x \<in> carrier_vec nc"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> carrier_vec nc
[PROOF STEP]
unfolding x_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_first xy nc \<in> carrier_vec nc
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x \<in> carrier_vec nc

goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
have y: "y \<in> carrier_vec nr"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<in> carrier_vec nr
[PROOF STEP]
unfolding y_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_last xy nr \<in> carrier_vec nr
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y \<in> carrier_vec nr

goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
have At: "A\<^sup>T \<in> carrier_mat nc nr"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A\<^sup>T \<in> carrier_mat nc nr
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat nr nc

goal (1 subgoal):
 1. A\<^sup>T \<in> carrier_mat nc nr
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A\<^sup>T \<in> carrier_mat nc nr

goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
have Ax1: "A *\<^sub>v x @\<^sub>v vec 1 (\<lambda>_. b \<bullet> y - c \<bullet> x) \<in> carrier_vec (nr + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *\<^sub>v x @\<^sub>v vec 1 (\<lambda>_. b \<bullet> y - c \<bullet> x) \<in> carrier_vec (nr + 1)
[PROOF STEP]
using A x
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat nr nc
x \<in> carrier_vec nc

goal (1 subgoal):
 1. A *\<^sub>v x @\<^sub>v vec 1 (\<lambda>_. b \<bullet> y - c \<bullet> x) \<in> carrier_vec (nr + 1)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
A *\<^sub>v x @\<^sub>v vec 1 (\<lambda>_. b \<bullet> y - c \<bullet> x) \<in> carrier_vec (nr + 1)

goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
have b0cc: "(b @\<^sub>v 0\<^sub>v 1) @\<^sub>v c @\<^sub>v - c \<in> carrier_vec ((nr + 1) + (nc + nc))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (b @\<^sub>v 0\<^sub>v 1) @\<^sub>v c @\<^sub>v - c \<in> carrier_vec (nr + 1 + (nc + nc))
[PROOF STEP]
using b c
[PROOF STATE]
proof (prove)
using this:
b \<in> carrier_vec nr
c \<in> carrier_vec nc

goal (1 subgoal):
 1. (b @\<^sub>v 0\<^sub>v 1) @\<^sub>v c @\<^sub>v - c \<in> carrier_vec (nr + 1 + (nc + nc))
[PROOF STEP]
by (intro append_carrier_vec, auto)
[PROOF STATE]
proof (state)
this:
(b @\<^sub>v 0\<^sub>v 1) @\<^sub>v c @\<^sub>v - c \<in> carrier_vec (nr + 1 + (nc + nc))

goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
have "M *\<^sub>v xy = (M_up *\<^sub>v xy @\<^sub>v M_low *\<^sub>v xy) @\<^sub>v (M_last *\<^sub>v xy)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M *\<^sub>v xy = (M_up *\<^sub>v xy @\<^sub>v M_low *\<^sub>v xy) @\<^sub>v M_last *\<^sub>v xy
[PROOF STEP]
unfolding M_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((M_up @\<^sub>r M_low) @\<^sub>r M_last) *\<^sub>v xy = (M_up *\<^sub>v xy @\<^sub>v M_low *\<^sub>v xy) @\<^sub>v M_last *\<^sub>v xy
[PROOF STEP]
unfolding mat_mult_append[OF carrier_append_rows[OF M_up M_low] M_last xy]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (M_up @\<^sub>r M_low) *\<^sub>v xy @\<^sub>v M_last *\<^sub>v xy = (M_up *\<^sub>v xy @\<^sub>v M_low *\<^sub>v xy) @\<^sub>v M_last *\<^sub>v xy
[PROOF STEP]
by (simp add: mat_mult_append[OF M_up M_low xy])
[PROOF STATE]
proof (state)
this:
M *\<^sub>v xy = (M_up *\<^sub>v xy @\<^sub>v M_low *\<^sub>v xy) @\<^sub>v M_last *\<^sub>v xy

goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
M *\<^sub>v xy = (M_up *\<^sub>v xy @\<^sub>v M_low *\<^sub>v xy) @\<^sub>v M_last *\<^sub>v xy

goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
have "M_low *\<^sub>v xy = (0\<^sub>m nc nc *\<^sub>v x + A\<^sup>T *\<^sub>v y) @\<^sub>v (0\<^sub>m nc nc *\<^sub>v x + - A\<^sup>T *\<^sub>v y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M_low *\<^sub>v xy = (0\<^sub>m nc nc *\<^sub>v x + A\<^sup>T *\<^sub>v y) @\<^sub>v 0\<^sub>m nc nc *\<^sub>v x + - A\<^sup>T *\<^sub>v y
[PROOF STEP]
unfolding M_low_def xyid
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_mat (0\<^sub>m nc nc) A\<^sup>T (0\<^sub>m nc nc) (- A\<^sup>T) *\<^sub>v (x @\<^sub>v y) = (0\<^sub>m nc nc *\<^sub>v x + A\<^sup>T *\<^sub>v y) @\<^sub>v 0\<^sub>m nc nc *\<^sub>v x + - A\<^sup>T *\<^sub>v y
[PROOF STEP]
by (rule four_block_mat_mult_vec[OF _ At _ _ x y], insert A, auto)
[PROOF STATE]
proof (state)
this:
M_low *\<^sub>v xy = (0\<^sub>m nc nc *\<^sub>v x + A\<^sup>T *\<^sub>v y) @\<^sub>v 0\<^sub>m nc nc *\<^sub>v x + - A\<^sup>T *\<^sub>v y

goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
M_low *\<^sub>v xy = (0\<^sub>m nc nc *\<^sub>v x + A\<^sup>T *\<^sub>v y) @\<^sub>v 0\<^sub>m nc nc *\<^sub>v x + - A\<^sup>T *\<^sub>v y

goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
have "0\<^sub>m nc nc *\<^sub>v x + A\<^sup>T *\<^sub>v y = A\<^sup>T *\<^sub>v y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0\<^sub>m nc nc *\<^sub>v x + A\<^sup>T *\<^sub>v y = A\<^sup>T *\<^sub>v y
[PROOF STEP]
using A x y
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat nr nc
x \<in> carrier_vec nc
y \<in> carrier_vec nr

goal (1 subgoal):
 1. 0\<^sub>m nc nc *\<^sub>v x + A\<^sup>T *\<^sub>v y = A\<^sup>T *\<^sub>v y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0\<^sub>m nc nc *\<^sub>v x + A\<^sup>T *\<^sub>v y = A\<^sup>T *\<^sub>v y

goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
0\<^sub>m nc nc *\<^sub>v x + A\<^sup>T *\<^sub>v y = A\<^sup>T *\<^sub>v y

goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
have "0\<^sub>m nc nc *\<^sub>v x + - A\<^sup>T *\<^sub>v y = - A\<^sup>T *\<^sub>v y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0\<^sub>m nc nc *\<^sub>v x + - A\<^sup>T *\<^sub>v y = - A\<^sup>T *\<^sub>v y
[PROOF STEP]
using A x y
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat nr nc
x \<in> carrier_vec nc
y \<in> carrier_vec nr

goal (1 subgoal):
 1. 0\<^sub>m nc nc *\<^sub>v x + - A\<^sup>T *\<^sub>v y = - A\<^sup>T *\<^sub>v y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0\<^sub>m nc nc *\<^sub>v x + - A\<^sup>T *\<^sub>v y = - A\<^sup>T *\<^sub>v y

goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
0\<^sub>m nc nc *\<^sub>v x + - A\<^sup>T *\<^sub>v y = - A\<^sup>T *\<^sub>v y

goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
have "M_up *\<^sub>v xy = (A *\<^sub>v x + 0\<^sub>m nr nr *\<^sub>v y) @\<^sub>v
               (mat_of_row (- c) *\<^sub>v x + mat_of_row b *\<^sub>v y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M_up *\<^sub>v xy = (A *\<^sub>v x + 0\<^sub>m nr nr *\<^sub>v y) @\<^sub>v mat_of_row (- c) *\<^sub>v x + mat_of_row b *\<^sub>v y
[PROOF STEP]
unfolding M_up_def xyid
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. four_block_mat A (0\<^sub>m nr nr) (mat_of_row (- c)) (mat_of_row b) *\<^sub>v (x @\<^sub>v y) = (A *\<^sub>v x + 0\<^sub>m nr nr *\<^sub>v y) @\<^sub>v mat_of_row (- c) *\<^sub>v x + mat_of_row b *\<^sub>v y
[PROOF STEP]
by (rule four_block_mat_mult_vec[OF A _ _ _ x y], insert b c, auto)
[PROOF STATE]
proof (state)
this:
M_up *\<^sub>v xy = (A *\<^sub>v x + 0\<^sub>m nr nr *\<^sub>v y) @\<^sub>v mat_of_row (- c) *\<^sub>v x + mat_of_row b *\<^sub>v y

goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
M_up *\<^sub>v xy = (A *\<^sub>v x + 0\<^sub>m nr nr *\<^sub>v y) @\<^sub>v mat_of_row (- c) *\<^sub>v x + mat_of_row b *\<^sub>v y

goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
have "A *\<^sub>v x + 0\<^sub>m nr nr *\<^sub>v y = A *\<^sub>v x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *\<^sub>v x + 0\<^sub>m nr nr *\<^sub>v y = A *\<^sub>v x
[PROOF STEP]
using A x y
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat nr nc
x \<in> carrier_vec nc
y \<in> carrier_vec nr

goal (1 subgoal):
 1. A *\<^sub>v x + 0\<^sub>m nr nr *\<^sub>v y = A *\<^sub>v x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A *\<^sub>v x + 0\<^sub>m nr nr *\<^sub>v y = A *\<^sub>v x

goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A *\<^sub>v x + 0\<^sub>m nr nr *\<^sub>v y = A *\<^sub>v x

goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
have "mat_of_row (- c) *\<^sub>v x + mat_of_row b *\<^sub>v y =
    vec 1 (\<lambda> _. b \<bullet> y - c \<bullet> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_of_row (- c) *\<^sub>v x + mat_of_row b *\<^sub>v y = vec 1 (\<lambda>_. b \<bullet> y - c \<bullet> x)
[PROOF STEP]
unfolding mult_mat_vec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec (dim_row (mat_of_row (- c))) (\<lambda>i. row (mat_of_row (- c)) i \<bullet> x) + vec (dim_row (mat_of_row b)) (\<lambda>i. row (mat_of_row b) i \<bullet> y) = vec 1 (\<lambda>_. b \<bullet> y - c \<bullet> x)
[PROOF STEP]
using c x
[PROOF STATE]
proof (prove)
using this:
c \<in> carrier_vec nc
x \<in> carrier_vec nc

goal (1 subgoal):
 1. vec (dim_row (mat_of_row (- c))) (\<lambda>i. row (mat_of_row (- c)) i \<bullet> x) + vec (dim_row (mat_of_row b)) (\<lambda>i. row (mat_of_row b) i \<bullet> y) = vec 1 (\<lambda>_. b \<bullet> y - c \<bullet> x)
[PROOF STEP]
by (intro eq_vecI, auto)
[PROOF STATE]
proof (state)
this:
mat_of_row (- c) *\<^sub>v x + mat_of_row b *\<^sub>v y = vec 1 (\<lambda>_. b \<bullet> y - c \<bullet> x)

goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mat_of_row (- c) *\<^sub>v x + mat_of_row b *\<^sub>v y = vec 1 (\<lambda>_. b \<bullet> y - c \<bullet> x)

goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
have "M_last *\<^sub>v xy = - y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M_last *\<^sub>v xy = - y
[PROOF STEP]
unfolding M_last_def xyid
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0\<^sub>m nr nc @\<^sub>c - 1\<^sub>m nr) *\<^sub>v (x @\<^sub>v y) = - y
[PROOF STEP]
using x y
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier_vec nc
y \<in> carrier_vec nr

goal (1 subgoal):
 1. (0\<^sub>m nr nc @\<^sub>c - 1\<^sub>m nr) *\<^sub>v (x @\<^sub>v y) = - y
[PROOF STEP]
by (subst mat_mult_append_cols[OF _ _ x y], auto)
[PROOF STATE]
proof (state)
this:
M_last *\<^sub>v xy = - y

goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
M *\<^sub>v xy = ((A *\<^sub>v x @\<^sub>v vec 1 (\<lambda>_. b \<bullet> y - c \<bullet> x)) @\<^sub>v A\<^sup>T *\<^sub>v y @\<^sub>v - A\<^sup>T *\<^sub>v y) @\<^sub>v - y
[PROOF STEP]
have "((A *\<^sub>v x @\<^sub>v vec 1 (\<lambda>_. b \<bullet> y - c \<bullet> x)) @\<^sub>v (A\<^sup>T *\<^sub>v y @\<^sub>v - A\<^sup>T *\<^sub>v y)) @\<^sub>v -y
    = M *\<^sub>v xy"
[PROOF STATE]
proof (prove)
using this:
M *\<^sub>v xy = ((A *\<^sub>v x @\<^sub>v vec 1 (\<lambda>_. b \<bullet> y - c \<bullet> x)) @\<^sub>v A\<^sup>T *\<^sub>v y @\<^sub>v - A\<^sup>T *\<^sub>v y) @\<^sub>v - y

goal (1 subgoal):
 1. ((A *\<^sub>v x @\<^sub>v vec 1 (\<lambda>_. b \<bullet> y - c \<bullet> x)) @\<^sub>v A\<^sup>T *\<^sub>v y @\<^sub>v - A\<^sup>T *\<^sub>v y) @\<^sub>v - y = M *\<^sub>v xy
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
((A *\<^sub>v x @\<^sub>v vec 1 (\<lambda>_. b \<bullet> y - c \<bullet> x)) @\<^sub>v A\<^sup>T *\<^sub>v y @\<^sub>v - A\<^sup>T *\<^sub>v y) @\<^sub>v - y = M *\<^sub>v xy

goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((A *\<^sub>v x @\<^sub>v vec 1 (\<lambda>_. b \<bullet> y - c \<bullet> x)) @\<^sub>v A\<^sup>T *\<^sub>v y @\<^sub>v - A\<^sup>T *\<^sub>v y) @\<^sub>v - y = M *\<^sub>v xy

goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
have "\<dots> \<le> bc"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M *\<^sub>v xy \<le> bc
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
M *\<^sub>v xy \<le> bc

goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
M *\<^sub>v xy \<le> bc

goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
have "\<dots> = ((b @\<^sub>v 0\<^sub>v 1) @\<^sub>v (c @\<^sub>v -c)) @\<^sub>v 0\<^sub>v nr"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bc = ((b @\<^sub>v 0\<^sub>v 1) @\<^sub>v c @\<^sub>v - c) @\<^sub>v 0\<^sub>v nr
[PROOF STEP]
unfolding bc_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((b @\<^sub>v 0\<^sub>v 1) @\<^sub>v c @\<^sub>v - c) @\<^sub>v 0\<^sub>v nr = ((b @\<^sub>v 0\<^sub>v 1) @\<^sub>v c @\<^sub>v - c) @\<^sub>v 0\<^sub>v nr
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
bc = ((b @\<^sub>v 0\<^sub>v 1) @\<^sub>v c @\<^sub>v - c) @\<^sub>v 0\<^sub>v nr

goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
((A *\<^sub>v x @\<^sub>v vec 1 (\<lambda>_. b \<bullet> y - c \<bullet> x)) @\<^sub>v A\<^sup>T *\<^sub>v y @\<^sub>v - A\<^sup>T *\<^sub>v y) @\<^sub>v - y \<le> ((b @\<^sub>v 0\<^sub>v 1) @\<^sub>v c @\<^sub>v - c) @\<^sub>v 0\<^sub>v nr
[PROOF STEP]
have ineqs: "A *\<^sub>v x \<le> b \<and> vec 1 (\<lambda>_. b \<bullet> y - c \<bullet> x) \<le> 0\<^sub>v 1
             \<and> A\<^sup>T *\<^sub>v y \<le> c \<and> - A\<^sup>T *\<^sub>v y \<le> -c \<and> -y \<le> 0\<^sub>v nr"
[PROOF STATE]
proof (prove)
using this:
((A *\<^sub>v x @\<^sub>v vec 1 (\<lambda>_. b \<bullet> y - c \<bullet> x)) @\<^sub>v A\<^sup>T *\<^sub>v y @\<^sub>v - A\<^sup>T *\<^sub>v y) @\<^sub>v - y \<le> ((b @\<^sub>v 0\<^sub>v 1) @\<^sub>v c @\<^sub>v - c) @\<^sub>v 0\<^sub>v nr

goal (1 subgoal):
 1. A *\<^sub>v x \<le> b \<and> vec 1 (\<lambda>_. b \<bullet> y - c \<bullet> x) \<le> 0\<^sub>v 1 \<and> A\<^sup>T *\<^sub>v y \<le> c \<and> - A\<^sup>T *\<^sub>v y \<le> - c \<and> - y \<le> 0\<^sub>v nr
[PROOF STEP]
apply (subst (asm) append_vec_le[OF _ b0cc])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (A *\<^sub>v x @\<^sub>v vec 1 (\<lambda>_. b \<bullet> y - c \<bullet> x)) @\<^sub>v A\<^sup>T *\<^sub>v y @\<^sub>v - A\<^sup>T *\<^sub>v y \<in> carrier_vec (nr + 1 + (nc + nc))
 2. (A *\<^sub>v x @\<^sub>v vec 1 (\<lambda>_. b \<bullet> y - c \<bullet> x)) @\<^sub>v A\<^sup>T *\<^sub>v y @\<^sub>v - A\<^sup>T *\<^sub>v y \<le> (b @\<^sub>v 0\<^sub>v 1) @\<^sub>v c @\<^sub>v - c \<and> - y \<le> 0\<^sub>v nr \<Longrightarrow> A *\<^sub>v x \<le> b \<and> vec 1 (\<lambda>_. b \<bullet> y - c \<bullet> x) \<le> 0\<^sub>v 1 \<and> A\<^sup>T *\<^sub>v y \<le> c \<and> - A\<^sup>T *\<^sub>v y \<le> - c \<and> - y \<le> 0\<^sub>v nr
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A *\<^sub>v x @\<^sub>v vec 1 (\<lambda>_. b \<bullet> y - c \<bullet> x)) @\<^sub>v A\<^sup>T *\<^sub>v y @\<^sub>v - A\<^sup>T *\<^sub>v y \<in> carrier_vec (nr + 1 + (nc + nc))
[PROOF STEP]
using A x y
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat nr nc
x \<in> carrier_vec nc
y \<in> carrier_vec nr

goal (1 subgoal):
 1. (A *\<^sub>v x @\<^sub>v vec 1 (\<lambda>_. b \<bullet> y - c \<bullet> x)) @\<^sub>v A\<^sup>T *\<^sub>v y @\<^sub>v - A\<^sup>T *\<^sub>v y \<in> carrier_vec (nr + 1 + (nc + nc))
[PROOF STEP]
by (intro append_carrier_vec, auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A *\<^sub>v x @\<^sub>v vec 1 (\<lambda>_. b \<bullet> y - c \<bullet> x)) @\<^sub>v A\<^sup>T *\<^sub>v y @\<^sub>v - A\<^sup>T *\<^sub>v y \<le> (b @\<^sub>v 0\<^sub>v 1) @\<^sub>v c @\<^sub>v - c \<and> - y \<le> 0\<^sub>v nr \<Longrightarrow> A *\<^sub>v x \<le> b \<and> vec 1 (\<lambda>_. b \<bullet> y - c \<bullet> x) \<le> 0\<^sub>v 1 \<and> A\<^sup>T *\<^sub>v y \<le> c \<and> - A\<^sup>T *\<^sub>v y \<le> - c \<and> - y \<le> 0\<^sub>v nr
[PROOF STEP]
apply (subst (asm) append_vec_le[OF Ax1], use b in fastforce)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A *\<^sub>v x @\<^sub>v vec 1 (\<lambda>_. b \<bullet> y - c \<bullet> x) \<le> b @\<^sub>v 0\<^sub>v 1 \<and> A\<^sup>T *\<^sub>v y @\<^sub>v - A\<^sup>T *\<^sub>v y \<le> c @\<^sub>v - c) \<and> - y \<le> 0\<^sub>v nr \<Longrightarrow> A *\<^sub>v x \<le> b \<and> vec 1 (\<lambda>_. b \<bullet> y - c \<bullet> x) \<le> 0\<^sub>v 1 \<and> A\<^sup>T *\<^sub>v y \<le> c \<and> - A\<^sup>T *\<^sub>v y \<le> - c \<and> - y \<le> 0\<^sub>v nr
[PROOF STEP]
apply (subst (asm) append_vec_le[OF _ b], use A x in force)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((A *\<^sub>v x \<le> b \<and> vec 1 (\<lambda>_. b \<bullet> y - c \<bullet> x) \<le> 0\<^sub>v 1) \<and> A\<^sup>T *\<^sub>v y @\<^sub>v - A\<^sup>T *\<^sub>v y \<le> c @\<^sub>v - c) \<and> - y \<le> 0\<^sub>v nr \<Longrightarrow> A *\<^sub>v x \<le> b \<and> vec 1 (\<lambda>_. b \<bullet> y - c \<bullet> x) \<le> 0\<^sub>v 1 \<and> A\<^sup>T *\<^sub>v y \<le> c \<and> - A\<^sup>T *\<^sub>v y \<le> - c \<and> - y \<le> 0\<^sub>v nr
[PROOF STEP]
apply (subst (asm) append_vec_le[OF _ c], use A y in force)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((A *\<^sub>v x \<le> b \<and> vec 1 (\<lambda>_. b \<bullet> y - c \<bullet> x) \<le> 0\<^sub>v 1) \<and> A\<^sup>T *\<^sub>v y \<le> c \<and> - A\<^sup>T *\<^sub>v y \<le> - c) \<and> - y \<le> 0\<^sub>v nr \<Longrightarrow> A *\<^sub>v x \<le> b \<and> vec 1 (\<lambda>_. b \<bullet> y - c \<bullet> x) \<le> 0\<^sub>v 1 \<and> A\<^sup>T *\<^sub>v y \<le> c \<and> - A\<^sup>T *\<^sub>v y \<le> - c \<and> - y \<le> 0\<^sub>v nr
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A *\<^sub>v x \<le> b \<and> vec 1 (\<lambda>_. b \<bullet> y - c \<bullet> x) \<le> 0\<^sub>v 1 \<and> A\<^sup>T *\<^sub>v y \<le> c \<and> - A\<^sup>T *\<^sub>v y \<le> - c \<and> - y \<le> 0\<^sub>v nr

goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y
[PROOF STEP]
proof (intro exI conjI)
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. ?x \<in> carrier_vec nc
 2. A *\<^sub>v ?x \<le> b
 3. 0\<^sub>v nr \<le> ?y1
 4. A\<^sup>T *\<^sub>v ?y1 = c
 5. c \<bullet> ?x = b \<bullet> ?y1
[PROOF STEP]
from ineqs
[PROOF STATE]
proof (chain)
picking this:
A *\<^sub>v x \<le> b \<and> vec 1 (\<lambda>_. b \<bullet> y - c \<bullet> x) \<le> 0\<^sub>v 1 \<and> A\<^sup>T *\<^sub>v y \<le> c \<and> - A\<^sup>T *\<^sub>v y \<le> - c \<and> - y \<le> 0\<^sub>v nr
[PROOF STEP]
show Axb: "A *\<^sub>v x \<le> b"
[PROOF STATE]
proof (prove)
using this:
A *\<^sub>v x \<le> b \<and> vec 1 (\<lambda>_. b \<bullet> y - c \<bullet> x) \<le> 0\<^sub>v 1 \<and> A\<^sup>T *\<^sub>v y \<le> c \<and> - A\<^sup>T *\<^sub>v y \<le> - c \<and> - y \<le> 0\<^sub>v nr

goal (1 subgoal):
 1. A *\<^sub>v x \<le> b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A *\<^sub>v x \<le> b

goal (4 subgoals):
 1. x \<in> carrier_vec nc
 2. 0\<^sub>v nr \<le> ?y1
 3. A\<^sup>T *\<^sub>v ?y1 = c
 4. c \<bullet> x = b \<bullet> ?y1
[PROOF STEP]
from ineqs
[PROOF STATE]
proof (chain)
picking this:
A *\<^sub>v x \<le> b \<and> vec 1 (\<lambda>_. b \<bullet> y - c \<bullet> x) \<le> 0\<^sub>v 1 \<and> A\<^sup>T *\<^sub>v y \<le> c \<and> - A\<^sup>T *\<^sub>v y \<le> - c \<and> - y \<le> 0\<^sub>v nr
[PROOF STEP]
have "- A\<^sup>T *\<^sub>v y \<le> -c" "A\<^sup>T *\<^sub>v y \<le> c"
[PROOF STATE]
proof (prove)
using this:
A *\<^sub>v x \<le> b \<and> vec 1 (\<lambda>_. b \<bullet> y - c \<bullet> x) \<le> 0\<^sub>v 1 \<and> A\<^sup>T *\<^sub>v y \<le> c \<and> - A\<^sup>T *\<^sub>v y \<le> - c \<and> - y \<le> 0\<^sub>v nr

goal (1 subgoal):
 1. - A\<^sup>T *\<^sub>v y \<le> - c &&& A\<^sup>T *\<^sub>v y \<le> c
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
- A\<^sup>T *\<^sub>v y \<le> - c
A\<^sup>T *\<^sub>v y \<le> c

goal (4 subgoals):
 1. x \<in> carrier_vec nc
 2. 0\<^sub>v nr \<le> ?y1
 3. A\<^sup>T *\<^sub>v ?y1 = c
 4. c \<bullet> x = b \<bullet> ?y1
[PROOF STEP]
hence "A\<^sup>T *\<^sub>v y \<ge> c" "A\<^sup>T *\<^sub>v y \<le> c"
[PROOF STATE]
proof (prove)
using this:
- A\<^sup>T *\<^sub>v y \<le> - c
A\<^sup>T *\<^sub>v y \<le> c

goal (1 subgoal):
 1. c \<le> A\<^sup>T *\<^sub>v y &&& A\<^sup>T *\<^sub>v y \<le> c
[PROOF STEP]
unfolding less_eq_vec_def
[PROOF STATE]
proof (prove)
using this:
dim_vec (- A\<^sup>T *\<^sub>v y) = dim_vec (- c) \<and> (\<forall>i<dim_vec (- c). (- A\<^sup>T *\<^sub>v y) $ i \<le> (- c) $ i)
dim_vec (A\<^sup>T *\<^sub>v y) = dim_vec c \<and> (\<forall>i<dim_vec c. (A\<^sup>T *\<^sub>v y) $ i \<le> c $ i)

goal (1 subgoal):
 1. dim_vec c = dim_vec (A\<^sup>T *\<^sub>v y) \<and> (\<forall>i<dim_vec (A\<^sup>T *\<^sub>v y). c $ i \<le> (A\<^sup>T *\<^sub>v y) $ i) &&& dim_vec (A\<^sup>T *\<^sub>v y) = dim_vec c \<and> (\<forall>i<dim_vec c. (A\<^sup>T *\<^sub>v y) $ i \<le> c $ i)
[PROOF STEP]
using A y
[PROOF STATE]
proof (prove)
using this:
dim_vec (- A\<^sup>T *\<^sub>v y) = dim_vec (- c) \<and> (\<forall>i<dim_vec (- c). (- A\<^sup>T *\<^sub>v y) $ i \<le> (- c) $ i)
dim_vec (A\<^sup>T *\<^sub>v y) = dim_vec c \<and> (\<forall>i<dim_vec c. (A\<^sup>T *\<^sub>v y) $ i \<le> c $ i)
A \<in> carrier_mat nr nc
y \<in> carrier_vec nr

goal (1 subgoal):
 1. dim_vec c = dim_vec (A\<^sup>T *\<^sub>v y) \<and> (\<forall>i<dim_vec (A\<^sup>T *\<^sub>v y). c $ i \<le> (A\<^sup>T *\<^sub>v y) $ i) &&& dim_vec (A\<^sup>T *\<^sub>v y) = dim_vec c \<and> (\<forall>i<dim_vec c. (A\<^sup>T *\<^sub>v y) $ i \<le> c $ i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c \<le> A\<^sup>T *\<^sub>v y
A\<^sup>T *\<^sub>v y \<le> c

goal (4 subgoals):
 1. x \<in> carrier_vec nc
 2. 0\<^sub>v nr \<le> ?y1
 3. A\<^sup>T *\<^sub>v ?y1 = c
 4. c \<bullet> x = b \<bullet> ?y1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c \<le> A\<^sup>T *\<^sub>v y
A\<^sup>T *\<^sub>v y \<le> c
[PROOF STEP]
show Aty: "A\<^sup>T *\<^sub>v y = c"
[PROOF STATE]
proof (prove)
using this:
c \<le> A\<^sup>T *\<^sub>v y
A\<^sup>T *\<^sub>v y \<le> c

goal (1 subgoal):
 1. A\<^sup>T *\<^sub>v y = c
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
A\<^sup>T *\<^sub>v y = c

goal (3 subgoals):
 1. x \<in> carrier_vec nc
 2. 0\<^sub>v nr \<le> y
 3. c \<bullet> x = b \<bullet> y
[PROOF STEP]
from ineqs
[PROOF STATE]
proof (chain)
picking this:
A *\<^sub>v x \<le> b \<and> vec 1 (\<lambda>_. b \<bullet> y - c \<bullet> x) \<le> 0\<^sub>v 1 \<and> A\<^sup>T *\<^sub>v y \<le> c \<and> - A\<^sup>T *\<^sub>v y \<le> - c \<and> - y \<le> 0\<^sub>v nr
[PROOF STEP]
have "- y \<le> 0\<^sub>v nr"
[PROOF STATE]
proof (prove)
using this:
A *\<^sub>v x \<le> b \<and> vec 1 (\<lambda>_. b \<bullet> y - c \<bullet> x) \<le> 0\<^sub>v 1 \<and> A\<^sup>T *\<^sub>v y \<le> c \<and> - A\<^sup>T *\<^sub>v y \<le> - c \<and> - y \<le> 0\<^sub>v nr

goal (1 subgoal):
 1. - y \<le> 0\<^sub>v nr
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
- y \<le> 0\<^sub>v nr

goal (3 subgoals):
 1. x \<in> carrier_vec nc
 2. 0\<^sub>v nr \<le> y
 3. c \<bullet> x = b \<bullet> y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
- y \<le> 0\<^sub>v nr
[PROOF STEP]
show y0: "0\<^sub>v nr \<le> y"
[PROOF STATE]
proof (prove)
using this:
- y \<le> 0\<^sub>v nr

goal (1 subgoal):
 1. 0\<^sub>v nr \<le> y
[PROOF STEP]
unfolding less_eq_vec_def
[PROOF STATE]
proof (prove)
using this:
dim_vec (- y) = dim_vec (0\<^sub>v nr) \<and> (\<forall>i<dim_vec (0\<^sub>v nr). (- y) $ i \<le> 0\<^sub>v nr $ i)

goal (1 subgoal):
 1. dim_vec (0\<^sub>v nr) = dim_vec y \<and> (\<forall>i<dim_vec y. 0\<^sub>v nr $ i \<le> y $ i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0\<^sub>v nr \<le> y

goal (2 subgoals):
 1. x \<in> carrier_vec nc
 2. c \<bullet> x = b \<bullet> y
[PROOF STEP]
from ineqs
[PROOF STATE]
proof (chain)
picking this:
A *\<^sub>v x \<le> b \<and> vec 1 (\<lambda>_. b \<bullet> y - c \<bullet> x) \<le> 0\<^sub>v 1 \<and> A\<^sup>T *\<^sub>v y \<le> c \<and> - A\<^sup>T *\<^sub>v y \<le> - c \<and> - y \<le> 0\<^sub>v nr
[PROOF STEP]
have "b \<bullet> y \<le> c \<bullet> x"
[PROOF STATE]
proof (prove)
using this:
A *\<^sub>v x \<le> b \<and> vec 1 (\<lambda>_. b \<bullet> y - c \<bullet> x) \<le> 0\<^sub>v 1 \<and> A\<^sup>T *\<^sub>v y \<le> c \<and> - A\<^sup>T *\<^sub>v y \<le> - c \<and> - y \<le> 0\<^sub>v nr

goal (1 subgoal):
 1. b \<bullet> y \<le> c \<bullet> x
[PROOF STEP]
unfolding less_eq_vec_def
[PROOF STATE]
proof (prove)
using this:
(dim_vec (A *\<^sub>v x) = dim_vec b \<and> (\<forall>i<dim_vec b. (A *\<^sub>v x) $ i \<le> b $ i)) \<and> (dim_vec (vec 1 (\<lambda>_. b \<bullet> y - c \<bullet> x)) = dim_vec (0\<^sub>v 1) \<and> (\<forall>i<dim_vec (0\<^sub>v 1). vec 1 (\<lambda>_. b \<bullet> y - c \<bullet> x) $ i \<le> 0\<^sub>v 1 $ i)) \<and> (dim_vec (A\<^sup>T *\<^sub>v y) = dim_vec c \<and> (\<forall>i<dim_vec c. (A\<^sup>T *\<^sub>v y) $ i \<le> c $ i)) \<and> (dim_vec (- A\<^sup>T *\<^sub>v y) = dim_vec (- c) \<and> (\<forall>i<dim_vec (- c). (- A\<^sup>T *\<^sub>v y) $ i \<le> (- c) $ i)) \<and> dim_vec (- y) = dim_vec (0\<^sub>v nr) \<and> (\<forall>i<dim_vec (0\<^sub>v nr). (- y) $ i \<le> 0\<^sub>v nr $ i)

goal (1 subgoal):
 1. b \<bullet> y \<le> c \<bullet> x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
b \<bullet> y \<le> c \<bullet> x

goal (2 subgoals):
 1. x \<in> carrier_vec nc
 2. c \<bullet> x = b \<bullet> y
[PROOF STEP]
with weak_duality_theorem[OF A b c x Axb y0 Aty]
[PROOF STATE]
proof (chain)
picking this:
c \<bullet> x \<le> b \<bullet> y
b \<bullet> y \<le> c \<bullet> x
[PROOF STEP]
show "c \<bullet> x = b \<bullet> y"
[PROOF STATE]
proof (prove)
using this:
c \<bullet> x \<le> b \<bullet> y
b \<bullet> y \<le> c \<bullet> x

goal (1 subgoal):
 1. c \<bullet> x = b \<bullet> y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c \<bullet> x = b \<bullet> y

goal (1 subgoal):
 1. x \<in> carrier_vec nc
[PROOF STEP]
qed (insert x)
[PROOF STATE]
proof (state)
this:
\<exists>x y. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b \<and> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = c \<and> c \<bullet> x = b \<bullet> y

goal:
No subgoals!
[PROOF STEP]
qed