[STATEMENT]
lemma Farkas_Lemma':
  fixes A :: "'a mat" and b :: "'a vec"
  assumes A: "A \<in> carrier_mat nr nc" and b: "b\<in> carrier_vec nr"
  shows "(\<exists>x. x\<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b)
         \<longleftrightarrow> (\<forall>y. y \<ge> 0\<^sub>v nr \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc \<longrightarrow> y \<bullet> b \<ge> 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b) = (\<forall>y. 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc \<longrightarrow> (0::'a) \<le> y \<bullet> b)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<exists>x. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b) = (\<forall>y. 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc \<longrightarrow> (0::'a) \<le> y \<bullet> b)
[PROOF STEP]
define B where "B = (1\<^sub>m nr) @\<^sub>c (A @\<^sub>c -A)"
[PROOF STATE]
proof (state)
this:
B = 1\<^sub>m nr @\<^sub>c A @\<^sub>c - A

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

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

goal (1 subgoal):
 1. (\<exists>x. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b) = (\<forall>y. 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc \<longrightarrow> (0::'a) \<le> y \<bullet> b)
[PROOF STEP]
have id0: "0\<^sub>v (nr + (nc + nc)) = 0\<^sub>v nr @\<^sub>v (0\<^sub>v nc @\<^sub>v 0\<^sub>v nc)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0\<^sub>v (nr + (nc + nc)) = 0\<^sub>v nr @\<^sub>v 0\<^sub>v nc @\<^sub>v 0\<^sub>v nc
[PROOF STEP]
by (intro eq_vecI, auto)
[PROOF STATE]
proof (state)
this:
0\<^sub>v (nr + (nc + nc)) = 0\<^sub>v nr @\<^sub>v 0\<^sub>v nc @\<^sub>v 0\<^sub>v nc

goal (1 subgoal):
 1. (\<exists>x. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b) = (\<forall>y. 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc \<longrightarrow> (0::'a) \<le> y \<bullet> b)
[PROOF STEP]
have idcarr: "(1\<^sub>m nr) \<in> carrier_mat nr nr"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1\<^sub>m nr \<in> carrier_mat nr nr
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1\<^sub>m nr \<in> carrier_mat nr nr

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

goal (1 subgoal):
 1. 1\<^sub>m nr @\<^sub>c A @\<^sub>c - A \<in> carrier_mat nr (nr + (nc + nc))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
B \<in> carrier_mat nr n

goal (1 subgoal):
 1. (\<exists>x. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b) = (\<forall>y. 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc \<longrightarrow> (0::'a) \<le> y \<bullet> b)
[PROOF STEP]
have "(\<exists>x \<in> carrier_vec nc. A *\<^sub>v x \<le> b) =
        (\<exists>x1 \<in> carrier_vec nr. \<exists>x2 \<in> carrier_vec nc. \<exists>x3 \<in> carrier_vec nc.
         x1 \<ge> 0\<^sub>v nr \<and> x2 \<ge> 0\<^sub>v nc \<and> x3 \<ge> 0\<^sub>v nc \<and> B *\<^sub>v (x1 @\<^sub>v (x2 @\<^sub>v x3)) = b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b) = (\<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b \<Longrightarrow> \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b
 2. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
assume "\<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b"
[PROOF STATE]
proof (state)
this:
\<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b

goal (2 subgoals):
 1. \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b \<Longrightarrow> \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b
 2. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
\<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
obtain x where Axb: "A *\<^sub>v x \<le> b" and xcarr: "x \<in> carrier_vec nc"
[PROOF STATE]
proof (prove)
using this:
\<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b

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

goal (2 subgoals):
 1. \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b \<Longrightarrow> \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b
 2. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
have bmAx: "b - A *\<^sub>v x \<in> carrier_vec nr"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b - A *\<^sub>v x \<in> carrier_vec nr
[PROOF STEP]
using A b xcarr
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat nr nc
b \<in> carrier_vec nr
x \<in> carrier_vec nc

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

goal (2 subgoals):
 1. \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b \<Longrightarrow> \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b
 2. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
define x1 where "x1 = b - A *\<^sub>v x"
[PROOF STATE]
proof (state)
this:
x1 = b - A *\<^sub>v x

goal (2 subgoals):
 1. \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b \<Longrightarrow> \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b
 2. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
have x1: "x1 \<in> carrier_vec nr"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x1 \<in> carrier_vec nr
[PROOF STEP]
using bmAx
[PROOF STATE]
proof (prove)
using this:
b - A *\<^sub>v x \<in> carrier_vec nr

goal (1 subgoal):
 1. x1 \<in> carrier_vec nr
[PROOF STEP]
unfolding x1_def
[PROOF STATE]
proof (prove)
using this:
b - A *\<^sub>v x \<in> carrier_vec nr

goal (1 subgoal):
 1. b - A *\<^sub>v x \<in> carrier_vec nr
[PROOF STEP]
by (simp add: xcarr)
[PROOF STATE]
proof (state)
this:
x1 \<in> carrier_vec nr

goal (2 subgoals):
 1. \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b \<Longrightarrow> \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b
 2. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
define x2 where "x2 = vec (dim_vec x) (\<lambda>i. if x $ i \<ge> 0 then x $ i else 0)"
[PROOF STATE]
proof (state)
this:
x2 = vec (dim_vec x) (\<lambda>i. if (0::'a) \<le> x $ i then x $ i else (0::'a))

goal (2 subgoals):
 1. \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b \<Longrightarrow> \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b
 2. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
have x2: "x2 \<in> carrier_vec nc"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x2 \<in> carrier_vec nc
[PROOF STEP]
using xcarr
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier_vec nc

goal (1 subgoal):
 1. x2 \<in> carrier_vec nc
[PROOF STEP]
unfolding x2_def
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier_vec nc

goal (1 subgoal):
 1. vec (dim_vec x) (\<lambda>i. if (0::'a) \<le> x $ i then x $ i else (0::'a)) \<in> carrier_vec nc
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x2 \<in> carrier_vec nc

goal (2 subgoals):
 1. \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b \<Longrightarrow> \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b
 2. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
define x3 where "x3 = vec (dim_vec x) (\<lambda>i. if x $ i < 0 then -x $ i else 0)"
[PROOF STATE]
proof (state)
this:
x3 = vec (dim_vec x) (\<lambda>i. if x $ i < (0::'a) then - x $ i else (0::'a))

goal (2 subgoals):
 1. \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b \<Longrightarrow> \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b
 2. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
have x3: "x3 \<in> carrier_vec nc"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x3 \<in> carrier_vec nc
[PROOF STEP]
using xcarr
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier_vec nc

goal (1 subgoal):
 1. x3 \<in> carrier_vec nc
[PROOF STEP]
unfolding x3_def
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier_vec nc

goal (1 subgoal):
 1. vec (dim_vec x) (\<lambda>i. if x $ i < (0::'a) then - x $ i else (0::'a)) \<in> carrier_vec nc
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x3 \<in> carrier_vec nc

goal (2 subgoals):
 1. \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b \<Longrightarrow> \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b
 2. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
have x2x3carr: "x2 @\<^sub>v x3 \<in> carrier_vec (nc + nc)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x2 @\<^sub>v x3 \<in> carrier_vec (nc + nc)
[PROOF STEP]
using x2 x3
[PROOF STATE]
proof (prove)
using this:
x2 \<in> carrier_vec nc
x3 \<in> carrier_vec nc

goal (1 subgoal):
 1. x2 @\<^sub>v x3 \<in> carrier_vec (nc + nc)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x2 @\<^sub>v x3 \<in> carrier_vec (nc + nc)

goal (2 subgoals):
 1. \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b \<Longrightarrow> \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b
 2. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
have x2x3x: "x2 - x3 = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x2 - x3 = x
[PROOF STEP]
unfolding x2_def x3_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec (dim_vec x) (\<lambda>i. if (0::'a) \<le> x $ i then x $ i else (0::'a)) - vec (dim_vec x) (\<lambda>i. if x $ i < (0::'a) then - x $ i else (0::'a)) = x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x2 - x3 = x

goal (2 subgoals):
 1. \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b \<Longrightarrow> \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b
 2. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
have "A *\<^sub>v x -b \<le> 0\<^sub>v nr"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *\<^sub>v x - b \<le> 0\<^sub>v nr
[PROOF STEP]
using vec_le_iff_diff_le_0 b
[PROOF STATE]
proof (prove)
using this:
(?a \<le> ?b) = (?a - ?b \<le> 0\<^sub>v (dim_vec ?a))
b \<in> carrier_vec nr

goal (1 subgoal):
 1. A *\<^sub>v x - b \<le> 0\<^sub>v nr
[PROOF STEP]
by (metis A Axb carrier_matD(1) dim_mult_mat_vec)
[PROOF STATE]
proof (state)
this:
A *\<^sub>v x - b \<le> 0\<^sub>v nr

goal (2 subgoals):
 1. \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b \<Longrightarrow> \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b
 2. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
hence x1lez: "x1 \<ge> 0\<^sub>v nr"
[PROOF STATE]
proof (prove)
using this:
A *\<^sub>v x - b \<le> 0\<^sub>v nr

goal (1 subgoal):
 1. 0\<^sub>v nr \<le> x1
[PROOF STEP]
using x1
[PROOF STATE]
proof (prove)
using this:
A *\<^sub>v x - b \<le> 0\<^sub>v nr
x1 \<in> carrier_vec nr

goal (1 subgoal):
 1. 0\<^sub>v nr \<le> x1
[PROOF STEP]
unfolding x1_def
[PROOF STATE]
proof (prove)
using this:
A *\<^sub>v x - b \<le> 0\<^sub>v nr
b - A *\<^sub>v x \<in> carrier_vec nr

goal (1 subgoal):
 1. 0\<^sub>v nr \<le> b - A *\<^sub>v x
[PROOF STEP]
by (smt A Axb carrier_matD(1) carrier_vecD diff_ge_0_iff_ge dim_mult_mat_vec
          index_minus_vec(1) index_zero_vec(1) index_zero_vec(2) less_eq_vec_def)
[PROOF STATE]
proof (state)
this:
0\<^sub>v nr \<le> x1

goal (2 subgoals):
 1. \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b \<Longrightarrow> \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b
 2. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
have x2lez: "x2 \<ge> 0\<^sub>v nc"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0\<^sub>v nc \<le> x2
[PROOF STEP]
using x2 less_eq_vec_def
[PROOF STATE]
proof (prove)
using this:
x2 \<in> carrier_vec nc
(?v \<le> ?w) = (dim_vec ?v = dim_vec ?w \<and> (\<forall>i<dim_vec ?w. ?v $ i \<le> ?w $ i))

goal (1 subgoal):
 1. 0\<^sub>v nc \<le> x2
[PROOF STEP]
unfolding x2_def
[PROOF STATE]
proof (prove)
using this:
vec (dim_vec x) (\<lambda>i. if (0::'a) \<le> x $ i then x $ i else (0::'a)) \<in> carrier_vec nc
(?v \<le> ?w) = (dim_vec ?v = dim_vec ?w \<and> (\<forall>i<dim_vec ?w. ?v $ i \<le> ?w $ i))

goal (1 subgoal):
 1. 0\<^sub>v nc \<le> vec (dim_vec x) (\<lambda>i. if (0::'a) \<le> x $ i then x $ i else (0::'a))
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
0\<^sub>v nc \<le> x2

goal (2 subgoals):
 1. \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b \<Longrightarrow> \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b
 2. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
have x3lez: "x3 \<ge> 0\<^sub>v nc"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0\<^sub>v nc \<le> x3
[PROOF STEP]
using x3 less_eq_vec_def
[PROOF STATE]
proof (prove)
using this:
x3 \<in> carrier_vec nc
(?v \<le> ?w) = (dim_vec ?v = dim_vec ?w \<and> (\<forall>i<dim_vec ?w. ?v $ i \<le> ?w $ i))

goal (1 subgoal):
 1. 0\<^sub>v nc \<le> x3
[PROOF STEP]
unfolding x3_def
[PROOF STATE]
proof (prove)
using this:
vec (dim_vec x) (\<lambda>i. if x $ i < (0::'a) then - x $ i else (0::'a)) \<in> carrier_vec nc
(?v \<le> ?w) = (dim_vec ?v = dim_vec ?w \<and> (\<forall>i<dim_vec ?w. ?v $ i \<le> ?w $ i))

goal (1 subgoal):
 1. 0\<^sub>v nc \<le> vec (dim_vec x) (\<lambda>i. if x $ i < (0::'a) then - x $ i else (0::'a))
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
0\<^sub>v nc \<le> x3

goal (2 subgoals):
 1. \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b \<Longrightarrow> \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b
 2. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
have B1: "(1\<^sub>m nr) *\<^sub>v x1 = b - A *\<^sub>v x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1\<^sub>m nr *\<^sub>v x1 = b - A *\<^sub>v x
[PROOF STEP]
using xcarr x1
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier_vec nc
x1 \<in> carrier_vec nr

goal (1 subgoal):
 1. 1\<^sub>m nr *\<^sub>v x1 = b - A *\<^sub>v x
[PROOF STEP]
unfolding x1_def
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier_vec nc
b - A *\<^sub>v x \<in> carrier_vec nr

goal (1 subgoal):
 1. 1\<^sub>m nr *\<^sub>v (b - A *\<^sub>v x) = b - A *\<^sub>v x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
1\<^sub>m nr *\<^sub>v x1 = b - A *\<^sub>v x

goal (2 subgoals):
 1. \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b \<Longrightarrow> \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b
 2. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
have "A *\<^sub>v x2 + (-A) *\<^sub>v x3 = A *\<^sub>v x2 + A *\<^sub>v (-x3)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *\<^sub>v x2 + - A *\<^sub>v x3 = A *\<^sub>v x2 + A *\<^sub>v - x3
[PROOF STEP]
using x2 x3 A
[PROOF STATE]
proof (prove)
using this:
x2 \<in> carrier_vec nc
x3 \<in> carrier_vec nc
A \<in> carrier_mat nr nc

goal (1 subgoal):
 1. A *\<^sub>v x2 + - A *\<^sub>v x3 = A *\<^sub>v x2 + A *\<^sub>v - x3
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A *\<^sub>v x2 + - A *\<^sub>v x3 = A *\<^sub>v x2 + A *\<^sub>v - x3

goal (2 subgoals):
 1. \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b \<Longrightarrow> \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b
 2. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A *\<^sub>v x2 + - A *\<^sub>v x3 = A *\<^sub>v x2 + A *\<^sub>v - x3

goal (2 subgoals):
 1. \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b \<Longrightarrow> \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b
 2. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
have "\<dots> = A *\<^sub>v (x2 + (-x3))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *\<^sub>v x2 + A *\<^sub>v - x3 = A *\<^sub>v (x2 + - x3)
[PROOF STEP]
using A x2 x3
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat nr nc
x2 \<in> carrier_vec nc
x3 \<in> carrier_vec nc

goal (1 subgoal):
 1. A *\<^sub>v x2 + A *\<^sub>v - x3 = A *\<^sub>v (x2 + - x3)
[PROOF STEP]
by (metis mult_add_distrib_mat_vec uminus_carrier_vec)
[PROOF STATE]
proof (state)
this:
A *\<^sub>v x2 + A *\<^sub>v - x3 = A *\<^sub>v (x2 + - x3)

goal (2 subgoals):
 1. \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b \<Longrightarrow> \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b
 2. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A *\<^sub>v x2 + A *\<^sub>v - x3 = A *\<^sub>v (x2 + - x3)

goal (2 subgoals):
 1. \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b \<Longrightarrow> \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b
 2. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
have "\<dots> = A *\<^sub>v x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *\<^sub>v (x2 + - x3) = A *\<^sub>v x
[PROOF STEP]
using x2x3x minus_add_uminus_vec x2 x3
[PROOF STATE]
proof (prove)
using this:
x2 - x3 = x
\<lbrakk>?v \<in> carrier_vec ?n; ?w \<in> carrier_vec ?n\<rbrakk> \<Longrightarrow> ?v - ?w = ?v + - ?w
x2 \<in> carrier_vec nc
x3 \<in> carrier_vec nc

goal (1 subgoal):
 1. A *\<^sub>v (x2 + - x3) = A *\<^sub>v x
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
A *\<^sub>v (x2 + - x3) = A *\<^sub>v x

goal (2 subgoals):
 1. \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b \<Longrightarrow> \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b
 2. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
A *\<^sub>v x2 + - A *\<^sub>v x3 = A *\<^sub>v x
[PROOF STEP]
have B2:"A *\<^sub>v x2 + (-A) *\<^sub>v x3 = A *\<^sub>v x"
[PROOF STATE]
proof (prove)
using this:
A *\<^sub>v x2 + - A *\<^sub>v x3 = A *\<^sub>v x

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

goal (2 subgoals):
 1. \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b \<Longrightarrow> \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b
 2. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
have "B *\<^sub>v (x1 @\<^sub>v (x2 @\<^sub>v x3)) = (1\<^sub>m nr) *\<^sub>v x1 + (A *\<^sub>v x2 + (-A) *\<^sub>v x3)" (is "\<dots> = ?p1 + ?p2")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = 1\<^sub>m nr *\<^sub>v x1 + (A *\<^sub>v x2 + - A *\<^sub>v x3)
[PROOF STEP]
using x1 x2 x3 A mat_mult_append_cols
[PROOF STATE]
proof (prove)
using this:
x1 \<in> carrier_vec nr
x2 \<in> carrier_vec nc
x3 \<in> carrier_vec nc
A \<in> carrier_mat nr nc
\<lbrakk>?A \<in> carrier_mat ?nr ?nc1.0; ?B \<in> carrier_mat ?nr ?nc2.0; ?v1.0 \<in> carrier_vec ?nc1.0; ?v2.0 \<in> carrier_vec ?nc2.0\<rbrakk> \<Longrightarrow> (?A @\<^sub>c ?B) *\<^sub>v (?v1.0 @\<^sub>v ?v2.0) = ?A *\<^sub>v ?v1.0 + ?B *\<^sub>v ?v2.0

goal (1 subgoal):
 1. B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = 1\<^sub>m nr *\<^sub>v x1 + (A *\<^sub>v x2 + - A *\<^sub>v x3)
[PROOF STEP]
unfolding B_def
[PROOF STATE]
proof (prove)
using this:
x1 \<in> carrier_vec nr
x2 \<in> carrier_vec nc
x3 \<in> carrier_vec nc
A \<in> carrier_mat nr nc
\<lbrakk>?A \<in> carrier_mat ?nr ?nc1.0; ?B \<in> carrier_mat ?nr ?nc2.0; ?v1.0 \<in> carrier_vec ?nc1.0; ?v2.0 \<in> carrier_vec ?nc2.0\<rbrakk> \<Longrightarrow> (?A @\<^sub>c ?B) *\<^sub>v (?v1.0 @\<^sub>v ?v2.0) = ?A *\<^sub>v ?v1.0 + ?B *\<^sub>v ?v2.0

goal (1 subgoal):
 1. (1\<^sub>m nr @\<^sub>c A @\<^sub>c - A) *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = 1\<^sub>m nr *\<^sub>v x1 + (A *\<^sub>v x2 + - A *\<^sub>v x3)
[PROOF STEP]
by (subst mat_mult_append_cols[OF _ _ x1 x2x3carr], auto simp add: mat_mult_append_cols)
[PROOF STATE]
proof (state)
this:
B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = 1\<^sub>m nr *\<^sub>v x1 + (A *\<^sub>v x2 + - A *\<^sub>v x3)

goal (2 subgoals):
 1. \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b \<Longrightarrow> \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b
 2. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = 1\<^sub>m nr *\<^sub>v x1 + (A *\<^sub>v x2 + - A *\<^sub>v x3)

goal (2 subgoals):
 1. \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b \<Longrightarrow> \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b
 2. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
have "?p1 = b - A *\<^sub>v x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1\<^sub>m nr *\<^sub>v x1 = b - A *\<^sub>v x
[PROOF STEP]
using B1
[PROOF STATE]
proof (prove)
using this:
1\<^sub>m nr *\<^sub>v x1 = b - A *\<^sub>v x

goal (1 subgoal):
 1. 1\<^sub>m nr *\<^sub>v x1 = b - A *\<^sub>v x
[PROOF STEP]
unfolding x1_def
[PROOF STATE]
proof (prove)
using this:
1\<^sub>m nr *\<^sub>v (b - A *\<^sub>v x) = b - A *\<^sub>v x

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

goal (2 subgoals):
 1. \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b \<Longrightarrow> \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b
 2. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1\<^sub>m nr *\<^sub>v x1 = b - A *\<^sub>v x

goal (2 subgoals):
 1. \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b \<Longrightarrow> \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b
 2. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
have "?p2 = A *\<^sub>v x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *\<^sub>v x2 + - A *\<^sub>v x3 = A *\<^sub>v x
[PROOF STEP]
using B2
[PROOF STATE]
proof (prove)
using this:
A *\<^sub>v x2 + - A *\<^sub>v x3 = A *\<^sub>v x

goal (1 subgoal):
 1. A *\<^sub>v x2 + - A *\<^sub>v x3 = A *\<^sub>v x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
A *\<^sub>v x2 + - A *\<^sub>v x3 = A *\<^sub>v x

goal (2 subgoals):
 1. \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b \<Longrightarrow> \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b
 2. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b - A *\<^sub>v x + A *\<^sub>v x
[PROOF STEP]
have res: "B *\<^sub>v (x1 @\<^sub>v (x2 @\<^sub>v x3)) = b"
[PROOF STATE]
proof (prove)
using this:
B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b - A *\<^sub>v x + A *\<^sub>v x

goal (1 subgoal):
 1. B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b
[PROOF STEP]
using A xcarr b
[PROOF STATE]
proof (prove)
using this:
B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b - A *\<^sub>v x + A *\<^sub>v x
A \<in> carrier_mat nr nc
x \<in> carrier_vec nc
b \<in> carrier_vec nr

goal (1 subgoal):
 1. B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b

goal (2 subgoals):
 1. \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b \<Longrightarrow> \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b
 2. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
show "\<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b \<Longrightarrow> \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc.
          0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b \<Longrightarrow> \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b
[PROOF STEP]
using x1 x2 x3 x1lez x2lez x3lez res
[PROOF STATE]
proof (prove)
using this:
x1 \<in> carrier_vec nr
x2 \<in> carrier_vec nc
x3 \<in> carrier_vec nc
0\<^sub>v nr \<le> x1
0\<^sub>v nc \<le> x2
0\<^sub>v nc \<le> x3
B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b

goal (1 subgoal):
 1. \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b \<Longrightarrow> \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b \<Longrightarrow> \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b

goal (1 subgoal):
 1. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
assume "\<exists>x1 \<in> carrier_vec nr. \<exists>x2 \<in> carrier_vec nc. \<exists>x3 \<in> carrier_vec nc.
            x1 \<ge> 0\<^sub>v nr \<and> x2 \<ge> 0\<^sub>v nc \<and> x3 \<ge> 0\<^sub>v nc \<and> B *\<^sub>v (x1 @\<^sub>v (x2 @\<^sub>v x3)) = b"
[PROOF STATE]
proof (state)
this:
\<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b

goal (1 subgoal):
 1. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
\<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b
[PROOF STEP]
obtain x1 x2 x3 where x1: "x1 \<in> carrier_vec nr" and x1lez: "x1 \<ge> 0\<^sub>v nr"
      and x2: "x2 \<in> carrier_vec nc" and x2lez: "x2 \<ge> 0\<^sub>v nc"
      and x3: "x3 \<in> carrier_vec nc" and x3lez: "x3 \<ge> 0\<^sub>v nc"
      and clc: "B *\<^sub>v (x1 @\<^sub>v (x2 @\<^sub>v x3)) = b"
[PROOF STATE]
proof (prove)
using this:
\<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b

goal (1 subgoal):
 1. (\<And>x1 x2 x3. \<lbrakk>x1 \<in> carrier_vec nr; 0\<^sub>v nr \<le> x1; x2 \<in> carrier_vec nc; 0\<^sub>v nc \<le> x2; x3 \<in> carrier_vec nc; 0\<^sub>v nc \<le> x3; B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x1 \<in> carrier_vec nr
0\<^sub>v nr \<le> x1
x2 \<in> carrier_vec nc
0\<^sub>v nc \<le> x2
x3 \<in> carrier_vec nc
0\<^sub>v nc \<le> x3
B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b

goal (1 subgoal):
 1. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
have x2x3carr: "x2 @\<^sub>v x3 \<in> carrier_vec (nc + nc)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x2 @\<^sub>v x3 \<in> carrier_vec (nc + nc)
[PROOF STEP]
using x2 x3
[PROOF STATE]
proof (prove)
using this:
x2 \<in> carrier_vec nc
x3 \<in> carrier_vec nc

goal (1 subgoal):
 1. x2 @\<^sub>v x3 \<in> carrier_vec (nc + nc)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x2 @\<^sub>v x3 \<in> carrier_vec (nc + nc)

goal (1 subgoal):
 1. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
define x where "x = x2 - x3"
[PROOF STATE]
proof (state)
this:
x = x2 - x3

goal (1 subgoal):
 1. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
have xcarr: "x \<in> carrier_vec nc"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> carrier_vec nc
[PROOF STEP]
using x2 x3
[PROOF STATE]
proof (prove)
using this:
x2 \<in> carrier_vec nc
x3 \<in> carrier_vec nc

goal (1 subgoal):
 1. x \<in> carrier_vec nc
[PROOF STEP]
unfolding x_def
[PROOF STATE]
proof (prove)
using this:
x2 \<in> carrier_vec nc
x3 \<in> carrier_vec nc

goal (1 subgoal):
 1. x2 - x3 \<in> carrier_vec nc
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x \<in> carrier_vec nc

goal (1 subgoal):
 1. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
have "A *\<^sub>v x2 + (-A) *\<^sub>v x3 = A *\<^sub>v x2 + A *\<^sub>v (-x3)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *\<^sub>v x2 + - A *\<^sub>v x3 = A *\<^sub>v x2 + A *\<^sub>v - x3
[PROOF STEP]
using x2 x3 A
[PROOF STATE]
proof (prove)
using this:
x2 \<in> carrier_vec nc
x3 \<in> carrier_vec nc
A \<in> carrier_mat nr nc

goal (1 subgoal):
 1. A *\<^sub>v x2 + - A *\<^sub>v x3 = A *\<^sub>v x2 + A *\<^sub>v - x3
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A *\<^sub>v x2 + - A *\<^sub>v x3 = A *\<^sub>v x2 + A *\<^sub>v - x3

goal (1 subgoal):
 1. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A *\<^sub>v x2 + - A *\<^sub>v x3 = A *\<^sub>v x2 + A *\<^sub>v - x3

goal (1 subgoal):
 1. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
have "\<dots> = A *\<^sub>v (x2 + (-x3))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *\<^sub>v x2 + A *\<^sub>v - x3 = A *\<^sub>v (x2 + - x3)
[PROOF STEP]
using A x2 x3
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat nr nc
x2 \<in> carrier_vec nc
x3 \<in> carrier_vec nc

goal (1 subgoal):
 1. A *\<^sub>v x2 + A *\<^sub>v - x3 = A *\<^sub>v (x2 + - x3)
[PROOF STEP]
by (metis mult_add_distrib_mat_vec uminus_carrier_vec)
[PROOF STATE]
proof (state)
this:
A *\<^sub>v x2 + A *\<^sub>v - x3 = A *\<^sub>v (x2 + - x3)

goal (1 subgoal):
 1. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A *\<^sub>v x2 + A *\<^sub>v - x3 = A *\<^sub>v (x2 + - x3)

goal (1 subgoal):
 1. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
have "\<dots> = A *\<^sub>v x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *\<^sub>v (x2 + - x3) = A *\<^sub>v x
[PROOF STEP]
using minus_add_uminus_vec x2 x3
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?v \<in> carrier_vec ?n; ?w \<in> carrier_vec ?n\<rbrakk> \<Longrightarrow> ?v - ?w = ?v + - ?w
x2 \<in> carrier_vec nc
x3 \<in> carrier_vec nc

goal (1 subgoal):
 1. A *\<^sub>v (x2 + - x3) = A *\<^sub>v x
[PROOF STEP]
unfolding x_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?v \<in> carrier_vec ?n; ?w \<in> carrier_vec ?n\<rbrakk> \<Longrightarrow> ?v - ?w = ?v + - ?w
x2 \<in> carrier_vec nc
x3 \<in> carrier_vec nc

goal (1 subgoal):
 1. A *\<^sub>v (x2 + - x3) = A *\<^sub>v (x2 - x3)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
A *\<^sub>v (x2 + - x3) = A *\<^sub>v x

goal (1 subgoal):
 1. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
A *\<^sub>v x2 + - A *\<^sub>v x3 = A *\<^sub>v x
[PROOF STEP]
have B2:"A *\<^sub>v x2 + (-A) *\<^sub>v x3 = A *\<^sub>v x"
[PROOF STATE]
proof (prove)
using this:
A *\<^sub>v x2 + - A *\<^sub>v x3 = A *\<^sub>v x

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

goal (1 subgoal):
 1. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
have Axcarr: "A *\<^sub>v x \<in> carrier_vec nr"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *\<^sub>v x \<in> carrier_vec nr
[PROOF STEP]
using A xcarr
[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 \<in> carrier_vec nr
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A *\<^sub>v x \<in> carrier_vec nr

goal (1 subgoal):
 1. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
have "b = B *\<^sub>v (x1 @\<^sub>v (x2 @\<^sub>v x3))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b = B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3)
[PROOF STEP]
using clc
[PROOF STATE]
proof (prove)
using this:
B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b

goal (1 subgoal):
 1. b = B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
b = B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3)

goal (1 subgoal):
 1. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
b = B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3)

goal (1 subgoal):
 1. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
have "\<dots> = (1\<^sub>m nr) *\<^sub>v x1 + (A *\<^sub>v x2 + (-A) *\<^sub>v x3)" (is "\<dots> = ?p1 + ?p2")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = 1\<^sub>m nr *\<^sub>v x1 + (A *\<^sub>v x2 + - A *\<^sub>v x3)
[PROOF STEP]
using x1 x2 x3 A mat_mult_append_cols
[PROOF STATE]
proof (prove)
using this:
x1 \<in> carrier_vec nr
x2 \<in> carrier_vec nc
x3 \<in> carrier_vec nc
A \<in> carrier_mat nr nc
\<lbrakk>?A \<in> carrier_mat ?nr ?nc1.0; ?B \<in> carrier_mat ?nr ?nc2.0; ?v1.0 \<in> carrier_vec ?nc1.0; ?v2.0 \<in> carrier_vec ?nc2.0\<rbrakk> \<Longrightarrow> (?A @\<^sub>c ?B) *\<^sub>v (?v1.0 @\<^sub>v ?v2.0) = ?A *\<^sub>v ?v1.0 + ?B *\<^sub>v ?v2.0

goal (1 subgoal):
 1. B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = 1\<^sub>m nr *\<^sub>v x1 + (A *\<^sub>v x2 + - A *\<^sub>v x3)
[PROOF STEP]
unfolding B_def
[PROOF STATE]
proof (prove)
using this:
x1 \<in> carrier_vec nr
x2 \<in> carrier_vec nc
x3 \<in> carrier_vec nc
A \<in> carrier_mat nr nc
\<lbrakk>?A \<in> carrier_mat ?nr ?nc1.0; ?B \<in> carrier_mat ?nr ?nc2.0; ?v1.0 \<in> carrier_vec ?nc1.0; ?v2.0 \<in> carrier_vec ?nc2.0\<rbrakk> \<Longrightarrow> (?A @\<^sub>c ?B) *\<^sub>v (?v1.0 @\<^sub>v ?v2.0) = ?A *\<^sub>v ?v1.0 + ?B *\<^sub>v ?v2.0

goal (1 subgoal):
 1. (1\<^sub>m nr @\<^sub>c A @\<^sub>c - A) *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = 1\<^sub>m nr *\<^sub>v x1 + (A *\<^sub>v x2 + - A *\<^sub>v x3)
[PROOF STEP]
by (subst mat_mult_append_cols[OF _ _ x1 x2x3carr], auto simp add: mat_mult_append_cols)
[PROOF STATE]
proof (state)
this:
B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = 1\<^sub>m nr *\<^sub>v x1 + (A *\<^sub>v x2 + - A *\<^sub>v x3)

goal (1 subgoal):
 1. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = 1\<^sub>m nr *\<^sub>v x1 + (A *\<^sub>v x2 + - A *\<^sub>v x3)

goal (1 subgoal):
 1. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
have "?p2 = A *\<^sub>v x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *\<^sub>v x2 + - A *\<^sub>v x3 = A *\<^sub>v x
[PROOF STEP]
using B2
[PROOF STATE]
proof (prove)
using this:
A *\<^sub>v x2 + - A *\<^sub>v x3 = A *\<^sub>v x

goal (1 subgoal):
 1. A *\<^sub>v x2 + - A *\<^sub>v x3 = A *\<^sub>v x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
A *\<^sub>v x2 + - A *\<^sub>v x3 = A *\<^sub>v x

goal (1 subgoal):
 1. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
b = 1\<^sub>m nr *\<^sub>v x1 + A *\<^sub>v x
[PROOF STEP]
have res: "b = (1\<^sub>m nr) *\<^sub>v x1 + A *\<^sub>v x"
[PROOF STATE]
proof (prove)
using this:
b = 1\<^sub>m nr *\<^sub>v x1 + A *\<^sub>v x

goal (1 subgoal):
 1. b = 1\<^sub>m nr *\<^sub>v x1 + A *\<^sub>v x
[PROOF STEP]
using A xcarr b
[PROOF STATE]
proof (prove)
using this:
b = 1\<^sub>m nr *\<^sub>v x1 + A *\<^sub>v x
A \<in> carrier_mat nr nc
x \<in> carrier_vec nc
b \<in> carrier_vec nr

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

goal (1 subgoal):
 1. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
hence "b = x1 + A *\<^sub>v x"
[PROOF STATE]
proof (prove)
using this:
b = 1\<^sub>m nr *\<^sub>v x1 + A *\<^sub>v x

goal (1 subgoal):
 1. b = x1 + A *\<^sub>v x
[PROOF STEP]
using x1 A b
[PROOF STATE]
proof (prove)
using this:
b = 1\<^sub>m nr *\<^sub>v x1 + A *\<^sub>v x
x1 \<in> carrier_vec nr
A \<in> carrier_mat nr nc
b \<in> carrier_vec nr

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

goal (1 subgoal):
 1. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
hence "b - A *\<^sub>v x = x1"
[PROOF STATE]
proof (prove)
using this:
b = x1 + A *\<^sub>v x

goal (1 subgoal):
 1. b - A *\<^sub>v x = x1
[PROOF STEP]
using x1 A b
[PROOF STATE]
proof (prove)
using this:
b = x1 + A *\<^sub>v x
x1 \<in> carrier_vec nr
A \<in> carrier_mat nr nc
b \<in> carrier_vec nr

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

goal (1 subgoal):
 1. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
hence "b - A *\<^sub>v x \<ge> 0\<^sub>v nr"
[PROOF STATE]
proof (prove)
using this:
b - A *\<^sub>v x = x1

goal (1 subgoal):
 1. 0\<^sub>v nr \<le> b - A *\<^sub>v x
[PROOF STEP]
using x1lez
[PROOF STATE]
proof (prove)
using this:
b - A *\<^sub>v x = x1
0\<^sub>v nr \<le> x1

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

goal (1 subgoal):
 1. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
hence "A *\<^sub>v x \<le> b"
[PROOF STATE]
proof (prove)
using this:
0\<^sub>v nr \<le> b - A *\<^sub>v x

goal (1 subgoal):
 1. A *\<^sub>v x \<le> b
[PROOF STEP]
using Axcarr
[PROOF STATE]
proof (prove)
using this:
0\<^sub>v nr \<le> b - A *\<^sub>v x
A *\<^sub>v x \<in> carrier_vec nr

goal (1 subgoal):
 1. A *\<^sub>v x \<le> b
[PROOF STEP]
by (smt \<open>b - A *\<^sub>v x = x1\<close> \<open>b = x1 + A *\<^sub>v x\<close> carrier_vecD comm_add_vec index_zero_vec(2)
          minus_add_minus_vec minus_cancel_vec vec_le_iff_diff_le_0 x1)
[PROOF STATE]
proof (state)
this:
A *\<^sub>v x \<le> b

goal (1 subgoal):
 1. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A *\<^sub>v x \<le> b
[PROOF STEP]
show "\<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc.
          0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow>
          \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b"
[PROOF STATE]
proof (prove)
using this:
A *\<^sub>v x \<le> b

goal (1 subgoal):
 1. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
using xcarr
[PROOF STATE]
proof (prove)
using this:
A *\<^sub>v x \<le> b
x \<in> carrier_vec nc

goal (1 subgoal):
 1. \<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b \<Longrightarrow> \<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b) = (\<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b)

goal (1 subgoal):
 1. (\<exists>x. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b) = (\<forall>y. 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc \<longrightarrow> (0::'a) \<le> y \<bullet> b)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b) = (\<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b)

goal (1 subgoal):
 1. (\<exists>x. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b) = (\<forall>y. 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc \<longrightarrow> (0::'a) \<le> y \<bullet> b)
[PROOF STEP]
have "\<dots> = (\<exists>x1 \<in> carrier_vec nr. \<exists>x2 \<in> carrier_vec nc. \<exists>x3 \<in> carrier_vec nc.
         (x1 @\<^sub>v (x2 @\<^sub>v x3)) \<ge> 0\<^sub>v n  \<and> B *\<^sub>v (x1 @\<^sub>v (x2 @\<^sub>v x3)) = b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b) = (\<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v n \<le> x1 @\<^sub>v x2 @\<^sub>v x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b)
[PROOF STEP]
by (metis append_vec_le id0 n_def zero_carrier_vec)
[PROOF STATE]
proof (state)
this:
(\<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b) = (\<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v n \<le> x1 @\<^sub>v x2 @\<^sub>v x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b)

goal (1 subgoal):
 1. (\<exists>x. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b) = (\<forall>y. 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc \<longrightarrow> (0::'a) \<le> y \<bullet> b)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v nr \<le> x1 \<and> 0\<^sub>v nc \<le> x2 \<and> 0\<^sub>v nc \<le> x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b) = (\<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v n \<le> x1 @\<^sub>v x2 @\<^sub>v x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b)

goal (1 subgoal):
 1. (\<exists>x. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b) = (\<forall>y. 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc \<longrightarrow> (0::'a) \<le> y \<bullet> b)
[PROOF STEP]
have "\<dots> = (\<exists>x \<in> carrier_vec n. x \<ge> 0\<^sub>v n  \<and> B *\<^sub>v x = b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v n \<le> x1 @\<^sub>v x2 @\<^sub>v x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b) = (\<exists>x\<in>carrier_vec n. 0\<^sub>v n \<le> x \<and> B *\<^sub>v x = b)
[PROOF STEP]
unfolding n_def exists_vec_append
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v (nr + (nc + nc)) \<le> x1 @\<^sub>v x2 @\<^sub>v x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b) = (\<exists>x1\<in>carrier_vec nr. \<exists>x1a\<in>carrier_vec nc. \<exists>x2\<in>carrier_vec nc. 0\<^sub>v (nr + (nc + nc)) \<le> x1 @\<^sub>v x1a @\<^sub>v x2 \<and> B *\<^sub>v (x1 @\<^sub>v x1a @\<^sub>v x2) = b)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v n \<le> x1 @\<^sub>v x2 @\<^sub>v x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b) = (\<exists>x\<in>carrier_vec n. 0\<^sub>v n \<le> x \<and> B *\<^sub>v x = b)

goal (1 subgoal):
 1. (\<exists>x. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b) = (\<forall>y. 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc \<longrightarrow> (0::'a) \<le> y \<bullet> b)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<exists>x1\<in>carrier_vec nr. \<exists>x2\<in>carrier_vec nc. \<exists>x3\<in>carrier_vec nc. 0\<^sub>v n \<le> x1 @\<^sub>v x2 @\<^sub>v x3 \<and> B *\<^sub>v (x1 @\<^sub>v x2 @\<^sub>v x3) = b) = (\<exists>x\<in>carrier_vec n. 0\<^sub>v n \<le> x \<and> B *\<^sub>v x = b)

goal (1 subgoal):
 1. (\<exists>x. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b) = (\<forall>y. 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc \<longrightarrow> (0::'a) \<le> y \<bullet> b)
[PROOF STEP]
have "\<dots> = (\<exists>x \<ge> 0\<^sub>v n. B *\<^sub>v x = b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x\<in>carrier_vec n. 0\<^sub>v n \<le> x \<and> B *\<^sub>v x = b) = (\<exists>x\<ge>0\<^sub>v n. B *\<^sub>v x = b)
[PROOF STEP]
unfolding less_eq_vec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x\<in>carrier_vec n. (dim_vec (0\<^sub>v n) = dim_vec x \<and> (\<forall>i<dim_vec x. 0\<^sub>v n $ i \<le> x $ i)) \<and> B *\<^sub>v x = b) = (\<exists>x. (dim_vec (0\<^sub>v n) = dim_vec x \<and> (\<forall>i<dim_vec x. 0\<^sub>v n $ i \<le> x $ i)) \<and> B *\<^sub>v x = b)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(\<exists>x\<in>carrier_vec n. 0\<^sub>v n \<le> x \<and> B *\<^sub>v x = b) = (\<exists>x\<ge>0\<^sub>v n. B *\<^sub>v x = b)

goal (1 subgoal):
 1. (\<exists>x. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b) = (\<forall>y. 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc \<longrightarrow> (0::'a) \<le> y \<bullet> b)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<exists>x\<in>carrier_vec n. 0\<^sub>v n \<le> x \<and> B *\<^sub>v x = b) = (\<exists>x\<ge>0\<^sub>v n. B *\<^sub>v x = b)

goal (1 subgoal):
 1. (\<exists>x. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b) = (\<forall>y. 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc \<longrightarrow> (0::'a) \<le> y \<bullet> b)
[PROOF STEP]
have "\<dots> = (\<forall> y. y \<in> carrier_vec nr \<longrightarrow> B\<^sup>T *\<^sub>v y \<ge> 0\<^sub>v n \<longrightarrow> y \<bullet> b \<ge> 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x\<ge>0\<^sub>v n. B *\<^sub>v x = b) = (\<forall>y. y \<in> carrier_vec nr \<longrightarrow> 0\<^sub>v n \<le> B\<^sup>T *\<^sub>v y \<longrightarrow> (0::'a) \<le> y \<bullet> b)
[PROOF STEP]
by (rule gram_schmidt.Farkas_Lemma[OF B b])
[PROOF STATE]
proof (state)
this:
(\<exists>x\<ge>0\<^sub>v n. B *\<^sub>v x = b) = (\<forall>y. y \<in> carrier_vec nr \<longrightarrow> 0\<^sub>v n \<le> B\<^sup>T *\<^sub>v y \<longrightarrow> (0::'a) \<le> y \<bullet> b)

goal (1 subgoal):
 1. (\<exists>x. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b) = (\<forall>y. 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc \<longrightarrow> (0::'a) \<le> y \<bullet> b)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<exists>x\<ge>0\<^sub>v n. B *\<^sub>v x = b) = (\<forall>y. y \<in> carrier_vec nr \<longrightarrow> 0\<^sub>v n \<le> B\<^sup>T *\<^sub>v y \<longrightarrow> (0::'a) \<le> y \<bullet> b)

goal (1 subgoal):
 1. (\<exists>x. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b) = (\<forall>y. 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc \<longrightarrow> (0::'a) \<le> y \<bullet> b)
[PROOF STEP]
have "\<dots> = (\<forall> y. y \<in> carrier_vec nr \<longrightarrow> (y \<ge> 0\<^sub>v nr \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc) \<longrightarrow> y \<bullet> b \<ge> 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>y. y \<in> carrier_vec nr \<longrightarrow> 0\<^sub>v n \<le> B\<^sup>T *\<^sub>v y \<longrightarrow> (0::'a) \<le> y \<bullet> b) = (\<forall>y. y \<in> carrier_vec nr \<longrightarrow> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc \<longrightarrow> (0::'a) \<le> y \<bullet> b)
[PROOF STEP]
proof (intro all_cong imp_cong refl)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. y \<in> carrier_vec nr \<Longrightarrow> (0\<^sub>v n \<le> B\<^sup>T *\<^sub>v y) = (0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc)
[PROOF STEP]
fix y :: "'a vec"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. y \<in> carrier_vec nr \<Longrightarrow> (0\<^sub>v n \<le> B\<^sup>T *\<^sub>v y) = (0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc)
[PROOF STEP]
assume y: "y \<in> carrier_vec nr"
[PROOF STATE]
proof (state)
this:
y \<in> carrier_vec nr

goal (1 subgoal):
 1. \<And>y. y \<in> carrier_vec nr \<Longrightarrow> (0\<^sub>v n \<le> B\<^sup>T *\<^sub>v y) = (0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc)
[PROOF STEP]
have idtcarr: "(1\<^sub>m nr)\<^sup>T \<in> carrier_mat nr nr"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1\<^sub>m nr)\<^sup>T \<in> carrier_mat nr nr
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(1\<^sub>m nr)\<^sup>T \<in> carrier_mat nr nr

goal (1 subgoal):
 1. \<And>y. y \<in> carrier_vec nr \<Longrightarrow> (0\<^sub>v n \<le> B\<^sup>T *\<^sub>v y) = (0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc)
[PROOF STEP]
have Atcarr: "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. \<And>y. y \<in> carrier_vec nr \<Longrightarrow> (0\<^sub>v n \<le> B\<^sup>T *\<^sub>v y) = (0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc)
[PROOF STEP]
have mAtcarr: "(-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. \<And>y. y \<in> carrier_vec nr \<Longrightarrow> (0\<^sub>v n \<le> B\<^sup>T *\<^sub>v y) = (0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc)
[PROOF STEP]
have AtAtcarr: "A\<^sup>T @\<^sub>r (-A)\<^sup>T \<in> carrier_mat (nc + nc) nr"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A\<^sup>T @\<^sub>r (- A)\<^sup>T \<in> carrier_mat (nc + 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 @\<^sub>r (- A)\<^sup>T \<in> carrier_mat (nc + nc) nr
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A\<^sup>T @\<^sub>r (- A)\<^sup>T \<in> carrier_mat (nc + nc) nr

goal (1 subgoal):
 1. \<And>y. y \<in> carrier_vec nr \<Longrightarrow> (0\<^sub>v n \<le> B\<^sup>T *\<^sub>v y) = (0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc)
[PROOF STEP]
have "B\<^sup>T *\<^sub>v y = ((1\<^sub>m nr)\<^sup>T @\<^sub>r A\<^sup>T @\<^sub>r (-A)\<^sup>T) *\<^sub>v y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B\<^sup>T *\<^sub>v y = ((1\<^sub>m nr)\<^sup>T @\<^sub>r A\<^sup>T @\<^sub>r (- A)\<^sup>T) *\<^sub>v y
[PROOF STEP]
unfolding B_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1\<^sub>m nr @\<^sub>c A @\<^sub>c - A)\<^sup>T *\<^sub>v y = ((1\<^sub>m nr)\<^sup>T @\<^sub>r A\<^sup>T @\<^sub>r (- A)\<^sup>T) *\<^sub>v y
[PROOF STEP]
by (simp add: append_cols_def)
[PROOF STATE]
proof (state)
this:
B\<^sup>T *\<^sub>v y = ((1\<^sub>m nr)\<^sup>T @\<^sub>r A\<^sup>T @\<^sub>r (- A)\<^sup>T) *\<^sub>v y

goal (1 subgoal):
 1. \<And>y. y \<in> carrier_vec nr \<Longrightarrow> (0\<^sub>v n \<le> B\<^sup>T *\<^sub>v y) = (0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
B\<^sup>T *\<^sub>v y = ((1\<^sub>m nr)\<^sup>T @\<^sub>r A\<^sup>T @\<^sub>r (- A)\<^sup>T) *\<^sub>v y

goal (1 subgoal):
 1. \<And>y. y \<in> carrier_vec nr \<Longrightarrow> (0\<^sub>v n \<le> B\<^sup>T *\<^sub>v y) = (0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc)
[PROOF STEP]
have "\<dots> = ((1\<^sub>m nr)\<^sup>T *\<^sub>v y) @\<^sub>v (A\<^sup>T *\<^sub>v y) @\<^sub>v ((-A)\<^sup>T *\<^sub>v y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((1\<^sub>m nr)\<^sup>T @\<^sub>r A\<^sup>T @\<^sub>r (- A)\<^sup>T) *\<^sub>v y = (1\<^sub>m nr)\<^sup>T *\<^sub>v y @\<^sub>v A\<^sup>T *\<^sub>v y @\<^sub>v (- A)\<^sup>T *\<^sub>v y
[PROOF STEP]
using mat_mult_append[OF Atcarr mAtcarr y] mat_mult_append y Atcarr idtcarr mAtcarr
[PROOF STATE]
proof (prove)
using this:
(A\<^sup>T @\<^sub>r (- A)\<^sup>T) *\<^sub>v y = A\<^sup>T *\<^sub>v y @\<^sub>v (- A)\<^sup>T *\<^sub>v y
\<lbrakk>?A \<in> carrier_mat ?nr1.0 ?nc; ?B \<in> carrier_mat ?nr2.0 ?nc; ?v \<in> carrier_vec ?nc\<rbrakk> \<Longrightarrow> (?A @\<^sub>r ?B) *\<^sub>v ?v = ?A *\<^sub>v ?v @\<^sub>v ?B *\<^sub>v ?v
y \<in> carrier_vec nr
A\<^sup>T \<in> carrier_mat nc nr
(1\<^sub>m nr)\<^sup>T \<in> carrier_mat nr nr
(- A)\<^sup>T \<in> carrier_mat nc nr

goal (1 subgoal):
 1. ((1\<^sub>m nr)\<^sup>T @\<^sub>r A\<^sup>T @\<^sub>r (- A)\<^sup>T) *\<^sub>v y = (1\<^sub>m nr)\<^sup>T *\<^sub>v y @\<^sub>v A\<^sup>T *\<^sub>v y @\<^sub>v (- A)\<^sup>T *\<^sub>v y
[PROOF STEP]
by (metis AtAtcarr)
[PROOF STATE]
proof (state)
this:
((1\<^sub>m nr)\<^sup>T @\<^sub>r A\<^sup>T @\<^sub>r (- A)\<^sup>T) *\<^sub>v y = (1\<^sub>m nr)\<^sup>T *\<^sub>v y @\<^sub>v A\<^sup>T *\<^sub>v y @\<^sub>v (- A)\<^sup>T *\<^sub>v y

goal (1 subgoal):
 1. \<And>y. y \<in> carrier_vec nr \<Longrightarrow> (0\<^sub>v n \<le> B\<^sup>T *\<^sub>v y) = (0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
B\<^sup>T *\<^sub>v y = (1\<^sub>m nr)\<^sup>T *\<^sub>v y @\<^sub>v A\<^sup>T *\<^sub>v y @\<^sub>v (- A)\<^sup>T *\<^sub>v y
[PROOF STEP]
have eq: "B\<^sup>T *\<^sub>v y = ((1\<^sub>m nr)\<^sup>T *\<^sub>v y) @\<^sub>v (A\<^sup>T *\<^sub>v y) @\<^sub>v ((-A)\<^sup>T *\<^sub>v y)"
[PROOF STATE]
proof (prove)
using this:
B\<^sup>T *\<^sub>v y = (1\<^sub>m nr)\<^sup>T *\<^sub>v y @\<^sub>v A\<^sup>T *\<^sub>v y @\<^sub>v (- A)\<^sup>T *\<^sub>v y

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

goal (1 subgoal):
 1. \<And>y. y \<in> carrier_vec nr \<Longrightarrow> (0\<^sub>v n \<le> B\<^sup>T *\<^sub>v y) = (0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc)
[PROOF STEP]
have "(B\<^sup>T *\<^sub>v y \<ge> 0\<^sub>v n) = (0\<^sub>v n \<le> (1\<^sub>m nr)\<^sup>T *\<^sub>v y @\<^sub>v A\<^sup>T *\<^sub>v y @\<^sub>v (- A)\<^sup>T *\<^sub>v y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0\<^sub>v n \<le> B\<^sup>T *\<^sub>v y) = (0\<^sub>v n \<le> (1\<^sub>m nr)\<^sup>T *\<^sub>v y @\<^sub>v A\<^sup>T *\<^sub>v y @\<^sub>v (- A)\<^sup>T *\<^sub>v y)
[PROOF STEP]
unfolding eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0\<^sub>v n \<le> (1\<^sub>m nr)\<^sup>T *\<^sub>v y @\<^sub>v A\<^sup>T *\<^sub>v y @\<^sub>v (- A)\<^sup>T *\<^sub>v y) = (0\<^sub>v n \<le> (1\<^sub>m nr)\<^sup>T *\<^sub>v y @\<^sub>v A\<^sup>T *\<^sub>v y @\<^sub>v (- A)\<^sup>T *\<^sub>v y)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(0\<^sub>v n \<le> B\<^sup>T *\<^sub>v y) = (0\<^sub>v n \<le> (1\<^sub>m nr)\<^sup>T *\<^sub>v y @\<^sub>v A\<^sup>T *\<^sub>v y @\<^sub>v (- A)\<^sup>T *\<^sub>v y)

goal (1 subgoal):
 1. \<And>y. y \<in> carrier_vec nr \<Longrightarrow> (0\<^sub>v n \<le> B\<^sup>T *\<^sub>v y) = (0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(0\<^sub>v n \<le> B\<^sup>T *\<^sub>v y) = (0\<^sub>v n \<le> (1\<^sub>m nr)\<^sup>T *\<^sub>v y @\<^sub>v A\<^sup>T *\<^sub>v y @\<^sub>v (- A)\<^sup>T *\<^sub>v y)

goal (1 subgoal):
 1. \<And>y. y \<in> carrier_vec nr \<Longrightarrow> (0\<^sub>v n \<le> B\<^sup>T *\<^sub>v y) = (0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc)
[PROOF STEP]
have "\<dots> = (((1\<^sub>m nr)\<^sup>T *\<^sub>v y) @\<^sub>v (A\<^sup>T *\<^sub>v y) @\<^sub>v ((-A)\<^sup>T *\<^sub>v y) \<ge> 0\<^sub>v nr @\<^sub>v 0\<^sub>v nc @\<^sub>v 0\<^sub>v nc)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0\<^sub>v n \<le> (1\<^sub>m nr)\<^sup>T *\<^sub>v y @\<^sub>v A\<^sup>T *\<^sub>v y @\<^sub>v (- A)\<^sup>T *\<^sub>v y) = (0\<^sub>v nr @\<^sub>v 0\<^sub>v nc @\<^sub>v 0\<^sub>v nc \<le> (1\<^sub>m nr)\<^sup>T *\<^sub>v y @\<^sub>v A\<^sup>T *\<^sub>v y @\<^sub>v (- A)\<^sup>T *\<^sub>v y)
[PROOF STEP]
using id0
[PROOF STATE]
proof (prove)
using this:
0\<^sub>v (nr + (nc + nc)) = 0\<^sub>v nr @\<^sub>v 0\<^sub>v nc @\<^sub>v 0\<^sub>v nc

goal (1 subgoal):
 1. (0\<^sub>v n \<le> (1\<^sub>m nr)\<^sup>T *\<^sub>v y @\<^sub>v A\<^sup>T *\<^sub>v y @\<^sub>v (- A)\<^sup>T *\<^sub>v y) = (0\<^sub>v nr @\<^sub>v 0\<^sub>v nc @\<^sub>v 0\<^sub>v nc \<le> (1\<^sub>m nr)\<^sup>T *\<^sub>v y @\<^sub>v A\<^sup>T *\<^sub>v y @\<^sub>v (- A)\<^sup>T *\<^sub>v y)
[PROOF STEP]
by (metis eq n_def)
[PROOF STATE]
proof (state)
this:
(0\<^sub>v n \<le> (1\<^sub>m nr)\<^sup>T *\<^sub>v y @\<^sub>v A\<^sup>T *\<^sub>v y @\<^sub>v (- A)\<^sup>T *\<^sub>v y) = (0\<^sub>v nr @\<^sub>v 0\<^sub>v nc @\<^sub>v 0\<^sub>v nc \<le> (1\<^sub>m nr)\<^sup>T *\<^sub>v y @\<^sub>v A\<^sup>T *\<^sub>v y @\<^sub>v (- A)\<^sup>T *\<^sub>v y)

goal (1 subgoal):
 1. \<And>y. y \<in> carrier_vec nr \<Longrightarrow> (0\<^sub>v n \<le> B\<^sup>T *\<^sub>v y) = (0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(0\<^sub>v n \<le> (1\<^sub>m nr)\<^sup>T *\<^sub>v y @\<^sub>v A\<^sup>T *\<^sub>v y @\<^sub>v (- A)\<^sup>T *\<^sub>v y) = (0\<^sub>v nr @\<^sub>v 0\<^sub>v nc @\<^sub>v 0\<^sub>v nc \<le> (1\<^sub>m nr)\<^sup>T *\<^sub>v y @\<^sub>v A\<^sup>T *\<^sub>v y @\<^sub>v (- A)\<^sup>T *\<^sub>v y)

goal (1 subgoal):
 1. \<And>y. y \<in> carrier_vec nr \<Longrightarrow> (0\<^sub>v n \<le> B\<^sup>T *\<^sub>v y) = (0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc)
[PROOF STEP]
have "\<dots> = (y \<ge> 0\<^sub>v nr \<and> A\<^sup>T *\<^sub>v y \<ge> 0\<^sub>v nc \<and> ((-A)\<^sup>T *\<^sub>v y) \<ge> 0\<^sub>v nc)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0\<^sub>v nr @\<^sub>v 0\<^sub>v nc @\<^sub>v 0\<^sub>v nc \<le> (1\<^sub>m nr)\<^sup>T *\<^sub>v y @\<^sub>v A\<^sup>T *\<^sub>v y @\<^sub>v (- A)\<^sup>T *\<^sub>v y) = (0\<^sub>v nr \<le> y \<and> 0\<^sub>v nc \<le> A\<^sup>T *\<^sub>v y \<and> 0\<^sub>v nc \<le> (- A)\<^sup>T *\<^sub>v y)
[PROOF STEP]
by (metis Atcarr append_vec_le mult_mat_vec_carrier one_mult_mat_vec transpose_one y zero_carrier_vec)
[PROOF STATE]
proof (state)
this:
(0\<^sub>v nr @\<^sub>v 0\<^sub>v nc @\<^sub>v 0\<^sub>v nc \<le> (1\<^sub>m nr)\<^sup>T *\<^sub>v y @\<^sub>v A\<^sup>T *\<^sub>v y @\<^sub>v (- A)\<^sup>T *\<^sub>v y) = (0\<^sub>v nr \<le> y \<and> 0\<^sub>v nc \<le> A\<^sup>T *\<^sub>v y \<and> 0\<^sub>v nc \<le> (- A)\<^sup>T *\<^sub>v y)

goal (1 subgoal):
 1. \<And>y. y \<in> carrier_vec nr \<Longrightarrow> (0\<^sub>v n \<le> B\<^sup>T *\<^sub>v y) = (0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(0\<^sub>v nr @\<^sub>v 0\<^sub>v nc @\<^sub>v 0\<^sub>v nc \<le> (1\<^sub>m nr)\<^sup>T *\<^sub>v y @\<^sub>v A\<^sup>T *\<^sub>v y @\<^sub>v (- A)\<^sup>T *\<^sub>v y) = (0\<^sub>v nr \<le> y \<and> 0\<^sub>v nc \<le> A\<^sup>T *\<^sub>v y \<and> 0\<^sub>v nc \<le> (- A)\<^sup>T *\<^sub>v y)

goal (1 subgoal):
 1. \<And>y. y \<in> carrier_vec nr \<Longrightarrow> (0\<^sub>v n \<le> B\<^sup>T *\<^sub>v y) = (0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc)
[PROOF STEP]
have "\<dots> = (y \<ge> 0\<^sub>v nr \<and>A\<^sup>T *\<^sub>v y \<ge> 0\<^sub>v nc \<and> -(A\<^sup>T *\<^sub>v y) \<ge> 0\<^sub>v nc)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0\<^sub>v nr \<le> y \<and> 0\<^sub>v nc \<le> A\<^sup>T *\<^sub>v y \<and> 0\<^sub>v nc \<le> (- A)\<^sup>T *\<^sub>v y) = (0\<^sub>v nr \<le> y \<and> 0\<^sub>v nc \<le> A\<^sup>T *\<^sub>v y \<and> 0\<^sub>v nc \<le> - (A\<^sup>T *\<^sub>v y))
[PROOF STEP]
by (metis A Atcarr carrier_matD(2) carrier_vecD transpose_uminus uminus_mult_mat_vec y)
[PROOF STATE]
proof (state)
this:
(0\<^sub>v nr \<le> y \<and> 0\<^sub>v nc \<le> A\<^sup>T *\<^sub>v y \<and> 0\<^sub>v nc \<le> (- A)\<^sup>T *\<^sub>v y) = (0\<^sub>v nr \<le> y \<and> 0\<^sub>v nc \<le> A\<^sup>T *\<^sub>v y \<and> 0\<^sub>v nc \<le> - (A\<^sup>T *\<^sub>v y))

goal (1 subgoal):
 1. \<And>y. y \<in> carrier_vec nr \<Longrightarrow> (0\<^sub>v n \<le> B\<^sup>T *\<^sub>v y) = (0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(0\<^sub>v nr \<le> y \<and> 0\<^sub>v nc \<le> A\<^sup>T *\<^sub>v y \<and> 0\<^sub>v nc \<le> (- A)\<^sup>T *\<^sub>v y) = (0\<^sub>v nr \<le> y \<and> 0\<^sub>v nc \<le> A\<^sup>T *\<^sub>v y \<and> 0\<^sub>v nc \<le> - (A\<^sup>T *\<^sub>v y))

goal (1 subgoal):
 1. \<And>y. y \<in> carrier_vec nr \<Longrightarrow> (0\<^sub>v n \<le> B\<^sup>T *\<^sub>v y) = (0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc)
[PROOF STEP]
have "\<dots> = (y \<ge> 0\<^sub>v nr \<and>A\<^sup>T *\<^sub>v y \<ge> 0\<^sub>v nc \<and> (A\<^sup>T *\<^sub>v y) \<le> 0\<^sub>v nc)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0\<^sub>v nr \<le> y \<and> 0\<^sub>v nc \<le> A\<^sup>T *\<^sub>v y \<and> 0\<^sub>v nc \<le> - (A\<^sup>T *\<^sub>v y)) = (0\<^sub>v nr \<le> y \<and> 0\<^sub>v nc \<le> A\<^sup>T *\<^sub>v y \<and> A\<^sup>T *\<^sub>v y \<le> 0\<^sub>v nc)
[PROOF STEP]
by (metis (mono_tags, lifting) A Atcarr carrier_matD(2) carrier_vecD index_zero_vec(2)
          mAtcarr mult_mat_vec_carrier transpose_uminus uminus_mult_mat_vec uminus_uminus_vec
          vec_le_iff_diff_le_0 y zero_minus_vec)
[PROOF STATE]
proof (state)
this:
(0\<^sub>v nr \<le> y \<and> 0\<^sub>v nc \<le> A\<^sup>T *\<^sub>v y \<and> 0\<^sub>v nc \<le> - (A\<^sup>T *\<^sub>v y)) = (0\<^sub>v nr \<le> y \<and> 0\<^sub>v nc \<le> A\<^sup>T *\<^sub>v y \<and> A\<^sup>T *\<^sub>v y \<le> 0\<^sub>v nc)

goal (1 subgoal):
 1. \<And>y. y \<in> carrier_vec nr \<Longrightarrow> (0\<^sub>v n \<le> B\<^sup>T *\<^sub>v y) = (0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(0\<^sub>v nr \<le> y \<and> 0\<^sub>v nc \<le> A\<^sup>T *\<^sub>v y \<and> 0\<^sub>v nc \<le> - (A\<^sup>T *\<^sub>v y)) = (0\<^sub>v nr \<le> y \<and> 0\<^sub>v nc \<le> A\<^sup>T *\<^sub>v y \<and> A\<^sup>T *\<^sub>v y \<le> 0\<^sub>v nc)

goal (1 subgoal):
 1. \<And>y. y \<in> carrier_vec nr \<Longrightarrow> (0\<^sub>v n \<le> B\<^sup>T *\<^sub>v y) = (0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc)
[PROOF STEP]
have "\<dots> = (y \<ge> 0\<^sub>v nr \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0\<^sub>v nr \<le> y \<and> 0\<^sub>v nc \<le> A\<^sup>T *\<^sub>v y \<and> A\<^sup>T *\<^sub>v y \<le> 0\<^sub>v nc) = (0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(0\<^sub>v nr \<le> y \<and> 0\<^sub>v nc \<le> A\<^sup>T *\<^sub>v y \<and> A\<^sup>T *\<^sub>v y \<le> 0\<^sub>v nc) = (0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc)

goal (1 subgoal):
 1. \<And>y. y \<in> carrier_vec nr \<Longrightarrow> (0\<^sub>v n \<le> B\<^sup>T *\<^sub>v y) = (0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(0\<^sub>v n \<le> B\<^sup>T *\<^sub>v y) = (0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc)
[PROOF STEP]
show "(B\<^sup>T *\<^sub>v y \<ge> 0\<^sub>v n) = (y \<ge> 0\<^sub>v nr \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc)"
[PROOF STATE]
proof (prove)
using this:
(0\<^sub>v n \<le> B\<^sup>T *\<^sub>v y) = (0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc)

goal (1 subgoal):
 1. (0\<^sub>v n \<le> B\<^sup>T *\<^sub>v y) = (0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(0\<^sub>v n \<le> B\<^sup>T *\<^sub>v y) = (0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<forall>y. y \<in> carrier_vec nr \<longrightarrow> 0\<^sub>v n \<le> B\<^sup>T *\<^sub>v y \<longrightarrow> (0::'a) \<le> y \<bullet> b) = (\<forall>y. y \<in> carrier_vec nr \<longrightarrow> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc \<longrightarrow> (0::'a) \<le> y \<bullet> b)

goal (1 subgoal):
 1. (\<exists>x. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b) = (\<forall>y. 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc \<longrightarrow> (0::'a) \<le> y \<bullet> b)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b) = (\<forall>y. y \<in> carrier_vec nr \<longrightarrow> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc \<longrightarrow> (0::'a) \<le> y \<bullet> b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<exists>x\<in>carrier_vec nc. A *\<^sub>v x \<le> b) = (\<forall>y. y \<in> carrier_vec nr \<longrightarrow> 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc \<longrightarrow> (0::'a) \<le> y \<bullet> b)

goal (1 subgoal):
 1. (\<exists>x. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b) = (\<forall>y. 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc \<longrightarrow> (0::'a) \<le> y \<bullet> b)
[PROOF STEP]
by (auto simp: less_eq_vec_def)
[PROOF STATE]
proof (state)
this:
(\<exists>x. x \<in> carrier_vec nc \<and> A *\<^sub>v x \<le> b) = (\<forall>y. 0\<^sub>v nr \<le> y \<and> A\<^sup>T *\<^sub>v y = 0\<^sub>v nc \<longrightarrow> (0::'a) \<le> y \<bullet> b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma aform_val_inner2_aform[simp]: "aform_val e (inner2_aform Z n i) = inner2 (aform_val e Z) n i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aform_val e (inner2_aform Z n i) = inner2 (aform_val e Z) n i
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. aform_val e (inner2_aform Z n i) = inner2 (aform_val e Z) n i
[PROOF STEP]
have "aform_val e (inner2_aform Z n i) = inner2 (fst Z) n i + inner2 (pdevs_val e (snd Z)) n i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. aform_val e (inner2_aform Z n i) = inner2 (fst Z) n i + inner2 (pdevs_val e (snd Z)) n i
[PROOF STEP]
by (auto simp: aform_val_def inner2_aform_def pdevs_inner2_def pdevs_val_unop_linear)
[PROOF STATE]
proof (state)
this:
aform_val e (inner2_aform Z n i) = inner2 (fst Z) n i + inner2 (pdevs_val e (snd Z)) n i

goal (1 subgoal):
 1. aform_val e (inner2_aform Z n i) = inner2 (aform_val e Z) n i
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
aform_val e (inner2_aform Z n i) = inner2 (fst Z) n i + inner2 (pdevs_val e (snd Z)) n i

goal (1 subgoal):
 1. aform_val e (inner2_aform Z n i) = inner2 (aform_val e Z) n i
[PROOF STEP]
have "\<dots> = inner2 (aform_val e Z) n i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner2 (fst Z) n i + inner2 (pdevs_val e (snd Z)) n i = inner2 (aform_val e Z) n i
[PROOF STEP]
by (simp add: inner2_def algebra_simps aform_val_def)
[PROOF STATE]
proof (state)
this:
inner2 (fst Z) n i + inner2 (pdevs_val e (snd Z)) n i = inner2 (aform_val e Z) n i

goal (1 subgoal):
 1. aform_val e (inner2_aform Z n i) = inner2 (aform_val e Z) n i
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
aform_val e (inner2_aform Z n i) = inner2 (aform_val e Z) n i
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
aform_val e (inner2_aform Z n i) = inner2 (aform_val e Z) n i

goal (1 subgoal):
 1. aform_val e (inner2_aform Z n i) = inner2 (aform_val e Z) n i
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
aform_val e (inner2_aform Z n i) = inner2 (aform_val e Z) n i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma find_eigenvector: assumes A: "A \<in> carrier_mat n n"
  and ev: "eigenvalue A e"
  shows "eigenvector A (find_eigenvector A e) e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eigenvector A (find_eigenvector A e) e
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. eigenvector A (find_eigenvector A e) e
[PROOF STEP]
define B where "B = char_matrix A e"
[PROOF STATE]
proof (state)
this:
B = char_matrix A e

goal (1 subgoal):
 1. eigenvector A (find_eigenvector A e) e
[PROOF STEP]
from ev[unfolded eigenvalue_char_matrix[OF A]]
[PROOF STATE]
proof (chain)
picking this:
\<exists>v. v \<in> carrier_vec n \<and> v \<noteq> 0\<^sub>v n \<and> char_matrix A e *\<^sub>v v = 0\<^sub>v n
[PROOF STEP]
obtain v where
    v: "v \<in> carrier_vec n" "v \<noteq> 0\<^sub>v n" and Bv: "B *\<^sub>v v = 0\<^sub>v n"
[PROOF STATE]
proof (prove)
using this:
\<exists>v. v \<in> carrier_vec n \<and> v \<noteq> 0\<^sub>v n \<and> char_matrix A e *\<^sub>v v = 0\<^sub>v n

goal (1 subgoal):
 1. (\<And>v. \<lbrakk>v \<in> carrier_vec n; v \<noteq> 0\<^sub>v n; B *\<^sub>v v = 0\<^sub>v n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding B_def
[PROOF STATE]
proof (prove)
using this:
\<exists>v. v \<in> carrier_vec n \<and> v \<noteq> 0\<^sub>v n \<and> char_matrix A e *\<^sub>v v = 0\<^sub>v n

goal (1 subgoal):
 1. (\<And>v. \<lbrakk>v \<in> carrier_vec n; v \<noteq> 0\<^sub>v n; char_matrix A e *\<^sub>v v = 0\<^sub>v n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v \<in> carrier_vec n
v \<noteq> 0\<^sub>v n
B *\<^sub>v v = 0\<^sub>v n

goal (1 subgoal):
 1. eigenvector A (find_eigenvector A e) e
[PROOF STEP]
have B: "B \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B \<in> carrier_mat n n
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n

goal (1 subgoal):
 1. B \<in> carrier_mat n n
[PROOF STEP]
unfolding B_def
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n

goal (1 subgoal):
 1. char_matrix A e \<in> carrier_mat n n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
B \<in> carrier_mat n n

goal (1 subgoal):
 1. eigenvector A (find_eigenvector A e) e
[PROOF STEP]
let ?z = "0\<^sub>m (dim_row A) 0"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. eigenvector A (find_eigenvector A e) e
[PROOF STEP]
obtain C D where gauss: "gauss_jordan B ?z = (C,D)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>C D. gauss_jordan B (0\<^sub>m (dim_row A) 0) = (C, D) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
gauss_jordan B (0\<^sub>m (dim_row A) 0) = (C, D)

goal (1 subgoal):
 1. eigenvector A (find_eigenvector A e) e
[PROOF STEP]
define w where "w = find_base_vector C"
[PROOF STATE]
proof (state)
this:
w = find_base_vector C

goal (1 subgoal):
 1. eigenvector A (find_eigenvector A e) e
[PROOF STEP]
have res: "find_eigenvector A e = w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. find_eigenvector A e = w
[PROOF STEP]
unfolding w_def find_eigenvector_def Let_def gauss B_def[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. find_base_vector (fst (C, D)) = find_base_vector C
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
find_eigenvector A e = w

goal (1 subgoal):
 1. eigenvector A (find_eigenvector A e) e
[PROOF STEP]
have "?z \<in> carrier_mat n 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0\<^sub>m (dim_row A) 0 \<in> carrier_mat n 0
[PROOF STEP]
using A
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n

goal (1 subgoal):
 1. 0\<^sub>m (dim_row A) 0 \<in> carrier_mat n 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0\<^sub>m (dim_row A) 0 \<in> carrier_mat n 0

goal (1 subgoal):
 1. eigenvector A (find_eigenvector A e) e
[PROOF STEP]
note gauss_0 = gauss_jordan[OF B this gauss]
[PROOF STATE]
proof (state)
this:
?x \<in> carrier_vec n \<Longrightarrow> (B *\<^sub>v ?x = 0\<^sub>v n) = (C *\<^sub>v ?x = 0\<^sub>v n)
?X \<in> carrier_mat n 0 \<Longrightarrow> (B * ?X = 0\<^sub>m (dim_row A) 0) = (C * ?X = D)
C \<in> carrier_mat n n
D \<in> carrier_mat n 0

goal (1 subgoal):
 1. eigenvector A (find_eigenvector A e) e
[PROOF STEP]
hence C: "C \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
using this:
?x \<in> carrier_vec n \<Longrightarrow> (B *\<^sub>v ?x = 0\<^sub>v n) = (C *\<^sub>v ?x = 0\<^sub>v n)
?X \<in> carrier_mat n 0 \<Longrightarrow> (B * ?X = 0\<^sub>m (dim_row A) 0) = (C * ?X = D)
C \<in> carrier_mat n n
D \<in> carrier_mat n 0

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

goal (1 subgoal):
 1. eigenvector A (find_eigenvector A e) e
[PROOF STEP]
from gauss_0(1)[OF v(1)] Bv
[PROOF STATE]
proof (chain)
picking this:
(B *\<^sub>v v = 0\<^sub>v n) = (C *\<^sub>v v = 0\<^sub>v n)
B *\<^sub>v v = 0\<^sub>v n
[PROOF STEP]
have Cv: "C *\<^sub>v v = 0\<^sub>v n"
[PROOF STATE]
proof (prove)
using this:
(B *\<^sub>v v = 0\<^sub>v n) = (C *\<^sub>v v = 0\<^sub>v n)
B *\<^sub>v v = 0\<^sub>v n

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

goal (1 subgoal):
 1. eigenvector A (find_eigenvector A e) e
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
C *\<^sub>v v = 0\<^sub>v n

goal (1 subgoal):
 1. eigenvector A (find_eigenvector A e) e
[PROOF STEP]
assume C: "C = 1\<^sub>m n"
[PROOF STATE]
proof (state)
this:
C = 1\<^sub>m n

goal (1 subgoal):
 1. eigenvector A (find_eigenvector A e) e
[PROOF STEP]
have False
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. False
[PROOF STEP]
using id Cv v
[PROOF STATE]
proof (prove)
using this:
swapidseq 0 id
C *\<^sub>v v = 0\<^sub>v n
v \<in> carrier_vec n
v \<noteq> 0\<^sub>v n

goal (1 subgoal):
 1. False
[PROOF STEP]
unfolding C
[PROOF STATE]
proof (prove)
using this:
swapidseq 0 id
1\<^sub>m n *\<^sub>v v = 0\<^sub>v n
v \<in> carrier_vec n
v \<noteq> 0\<^sub>v n

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

goal (1 subgoal):
 1. eigenvector A (find_eigenvector A e) e
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
C = 1\<^sub>m n \<Longrightarrow> False

goal (1 subgoal):
 1. eigenvector A (find_eigenvector A e) e
[PROOF STEP]
hence C1: "C \<noteq> 1\<^sub>m n"
[PROOF STATE]
proof (prove)
using this:
C = 1\<^sub>m n \<Longrightarrow> False

goal (1 subgoal):
 1. C \<noteq> 1\<^sub>m n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
C \<noteq> 1\<^sub>m n

goal (1 subgoal):
 1. eigenvector A (find_eigenvector A e) e
[PROOF STEP]
from find_base_vector_not_1[OF gauss_jordan_row_echelon[OF B gauss] C C1]
[PROOF STATE]
proof (chain)
picking this:
find_base_vector C \<in> carrier_vec n
find_base_vector C \<noteq> 0\<^sub>v n
C *\<^sub>v find_base_vector C = 0\<^sub>v n
[PROOF STEP]
have w: "w \<in> carrier_vec n" "w \<noteq> 0\<^sub>v n" and id: "C *\<^sub>v w = 0\<^sub>v n"
[PROOF STATE]
proof (prove)
using this:
find_base_vector C \<in> carrier_vec n
find_base_vector C \<noteq> 0\<^sub>v n
C *\<^sub>v find_base_vector C = 0\<^sub>v n

goal (1 subgoal):
 1. (w \<in> carrier_vec n &&& w \<noteq> 0\<^sub>v n) &&& C *\<^sub>v w = 0\<^sub>v n
[PROOF STEP]
unfolding w_def
[PROOF STATE]
proof (prove)
using this:
find_base_vector C \<in> carrier_vec n
find_base_vector C \<noteq> 0\<^sub>v n
C *\<^sub>v find_base_vector C = 0\<^sub>v n

goal (1 subgoal):
 1. (find_base_vector C \<in> carrier_vec n &&& find_base_vector C \<noteq> 0\<^sub>v n) &&& C *\<^sub>v find_base_vector C = 0\<^sub>v n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
w \<in> carrier_vec n
w \<noteq> 0\<^sub>v n
C *\<^sub>v w = 0\<^sub>v n

goal (1 subgoal):
 1. eigenvector A (find_eigenvector A e) e
[PROOF STEP]
from gauss_0(1)[OF w(1)] id
[PROOF STATE]
proof (chain)
picking this:
(B *\<^sub>v w = 0\<^sub>v n) = (C *\<^sub>v w = 0\<^sub>v n)
C *\<^sub>v w = 0\<^sub>v n
[PROOF STEP]
have Bw: "B *\<^sub>v w = 0\<^sub>v n"
[PROOF STATE]
proof (prove)
using this:
(B *\<^sub>v w = 0\<^sub>v n) = (C *\<^sub>v w = 0\<^sub>v n)
C *\<^sub>v w = 0\<^sub>v n

goal (1 subgoal):
 1. B *\<^sub>v w = 0\<^sub>v n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
B *\<^sub>v w = 0\<^sub>v n

goal (1 subgoal):
 1. eigenvector A (find_eigenvector A e) e
[PROOF STEP]
from w Bw
[PROOF STATE]
proof (chain)
picking this:
w \<in> carrier_vec n
w \<noteq> 0\<^sub>v n
B *\<^sub>v w = 0\<^sub>v n
[PROOF STEP]
have "eigenvector A w e"
[PROOF STATE]
proof (prove)
using this:
w \<in> carrier_vec n
w \<noteq> 0\<^sub>v n
B *\<^sub>v w = 0\<^sub>v n

goal (1 subgoal):
 1. eigenvector A w e
[PROOF STEP]
unfolding eigenvector_char_matrix[OF A] B_def
[PROOF STATE]
proof (prove)
using this:
w \<in> carrier_vec n
w \<noteq> 0\<^sub>v n
char_matrix A e *\<^sub>v w = 0\<^sub>v n

goal (1 subgoal):
 1. w \<in> carrier_vec n \<and> w \<noteq> 0\<^sub>v n \<and> char_matrix A e *\<^sub>v w = 0\<^sub>v n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
eigenvector A w e

goal (1 subgoal):
 1. eigenvector A (find_eigenvector A e) e
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
eigenvector A w e

goal (1 subgoal):
 1. eigenvector A (find_eigenvector A e) e
[PROOF STEP]
unfolding res
[PROOF STATE]
proof (prove)
using this:
eigenvector A w e

goal (1 subgoal):
 1. eigenvector A w e
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
eigenvector A (find_eigenvector A e) e

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem "\<forall>(x::int). 2 dvd x \<longrightarrow> (\<exists>(y::int). x = 2*y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. even x \<longrightarrow> (\<exists>y. x = 2 * y)
[PROOF STEP]
by cooper


[STATEMENT]
lemma Max_ge_image:
  "Max (f ` S) \<ge> f x" if "finite S" "x \<in> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f x \<le> Max (f ` S)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
finite S
x \<in> S

goal (1 subgoal):
 1. f x \<le> Max (f ` S)
[PROOF STEP]
by (auto intro: Max_ge)


[STATEMENT]
lemma euclidean_isCont:
  assumes "\<And>b. b \<in> CBasis \<Longrightarrow> isCont (\<lambda>x. (cinner b (f x)) *\<^sub>C b) x"
  shows "isCont f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont f x
[PROOF STEP]
apply (subst ceuclidean_representation_sum_fun [symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont (\<lambda>x. \<Sum>b\<in>CBasis. (b \<bullet>\<^sub>C f x) *\<^sub>C b) x
[PROOF STEP]
apply (rule isCont_sum)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>b\<in>CBasis. isCont (\<lambda>x. (b \<bullet>\<^sub>C f x) *\<^sub>C b) x
[PROOF STEP]
by (blast intro: assms)