let R be non degenerated almost_left_invertible Ring; :: thesis: for V being LeftMod of R
for A being Subset of V st Lin A = V holds
ex B being Subset of V st
( B c= A & B is base )

let V be LeftMod of R; :: thesis: for A being Subset of V st Lin A = V holds
ex B being Subset of V st
( B c= A & B is base )

let A be Subset of V; :: thesis: ( Lin A = V implies ex B being Subset of V st
( B c= A & B is base ) )

defpred S1[ set ] means ex B being Subset of V st
( B = $1 & B c= A & B is linearly-independent );
assume A2: Lin A = V ; :: thesis: ex B being Subset of V st
( B c= A & B is base )

consider Q being set such that
A3: for Z being set holds
( Z in Q iff ( Z in bool the carrier of V & S1[Z] ) ) from XFAMILY:sch 1();
A4: now :: thesis: for Z being set st Z <> {} & Z c= Q & Z is c=-linear holds
union Z in Q
let Z be set ; :: thesis: ( Z <> {} & Z c= Q & Z is c=-linear implies union Z in Q )
assume that
Z <> {} and
A5: Z c= Q and
A6: Z is c=-linear ; :: thesis: union Z in Q
set W = union Z;
union Z c= the carrier of V
proof
let x be object ; :: according to TARSKI:def 3 :: thesis: ( not x in union Z or x in the carrier of V )
assume x in union Z ; :: thesis: x in the carrier of V
then consider X being set such that
A7: x in X and
A8: X in Z by TARSKI:def 4;
X in bool the carrier of V by A3, A5, A8;
hence x in the carrier of V by A7; :: thesis: verum
end;
then reconsider W = union Z as Subset of V ;
A9: W is linearly-independent
proof
deffunc H1( object ) -> set = { C where C is Subset of V : ( $1 in C & C in Z ) } ;
let l be Linear_Combination of W; :: according to VECTSP_7:def 1 :: thesis: ( not Sum l = 0. V or Carrier l = {} )
assume that
A10: Sum l = 0. V and
A11: Carrier l <> {} ; :: thesis: contradiction
consider f being Function such that
A12: dom f = Carrier l and
A13: for x being object st x in Carrier l holds
f . x = H1(x) from FUNCT_1:sch 3();
reconsider M = rng f as non empty set by A11, A12, RELAT_1:42;
set F = the Choice_Function of M;
set S = rng the Choice_Function of M;
A14: now :: thesis: not {} in M
assume {} in M ; :: thesis: contradiction
then consider x being object such that
A15: x in dom f and
A16: f . x = {} by FUNCT_1:def 3;
Carrier l c= W by VECTSP_6:def 4;
then consider X being set such that
A17: x in X and
A18: X in Z by A12, A15, TARSKI:def 4;
reconsider X = X as Subset of V by A3, A5, A18;
X in { C where C is Subset of V : ( x in C & C in Z ) } by A17, A18;
hence contradiction by A12, A13, A15, A16; :: thesis: verum
end;
then A19: dom the Choice_Function of M = M by RLVECT_3:28;
then dom the Choice_Function of M is finite by A12, FINSET_1:8;
then A20: rng the Choice_Function of M is finite by FINSET_1:8;
A21: now :: thesis: for X being set st X in rng the Choice_Function of M holds
X in Z
let X be set ; :: thesis: ( X in rng the Choice_Function of M implies X in Z )
assume X in rng the Choice_Function of M ; :: thesis: X in Z
then consider x being object such that
A22: x in dom the Choice_Function of M and
A23: the Choice_Function of M . x = X by FUNCT_1:def 3;
consider y being object such that
A24: ( y in dom f & f . y = x ) by A19, A22, FUNCT_1:def 3;
A25: x = { C where C is Subset of V : ( y in C & C in Z ) } by A12, A13, A24;
reconsider x = x as set by TARSKI:1;
X in x by A14, A19, A22, A23, ORDERS_1:89;
then ex C being Subset of V st
( C = X & y in C & C in Z ) by A25;
hence X in Z ; :: thesis: verum
end;
A26: now :: thesis: for X, Y being set st X in rng the Choice_Function of M & Y in rng the Choice_Function of M & not X c= Y holds
Y c= X
let X, Y be set ; :: thesis: ( X in rng the Choice_Function of M & Y in rng the Choice_Function of M & not X c= Y implies Y c= X )
assume ( X in rng the Choice_Function of M & Y in rng the Choice_Function of M ) ; :: thesis: ( X c= Y or Y c= X )
then ( X in Z & Y in Z ) by A21;
then X,Y are_c=-comparable by A6, ORDINAL1:def 8;
hence ( X c= Y or Y c= X ) ; :: thesis: verum
end;
rng the Choice_Function of M <> {} by A19, RELAT_1:42;
then union (rng the Choice_Function of M) in rng the Choice_Function of M by A26, A20, CARD_2:62;
then union (rng the Choice_Function of M) in Z by A21;
then consider B being Subset of V such that
A27: B = union (rng the Choice_Function of M) and
B c= A and
A28: B is linearly-independent by A3, A5;
Carrier l c= union (rng the Choice_Function of M)
proof
let x be object ; :: according to TARSKI:def 3 :: thesis: ( not x in Carrier l or x in union (rng the Choice_Function of M) )
set X = f . x;
assume A29: x in Carrier l ; :: thesis: x in union (rng the Choice_Function of M)
then A30: f . x = { C where C is Subset of V : ( x in C & C in Z ) } by A13;
A31: f . x in M by A12, A29, FUNCT_1:def 3;
then the Choice_Function of M . (f . x) in f . x by A14, ORDERS_1:89;
then A32: ex C being Subset of V st
( the Choice_Function of M . (f . x) = C & x in C & C in Z ) by A30;
the Choice_Function of M . (f . x) in rng the Choice_Function of M by A19, A31, FUNCT_1:def 3;
hence x in union (rng the Choice_Function of M) by A32, TARSKI:def 4; :: thesis: verum
end;
then l is Linear_Combination of B by A27, VECTSP_6:def 4;
hence contradiction by A10, A11, A28; :: thesis: verum
end;
W c= A
proof
let x be object ; :: according to TARSKI:def 3 :: thesis: ( not x in W or x in A )
assume x in W ; :: thesis: x in A
then consider X being set such that
A33: x in X and
A34: X in Z by TARSKI:def 4;
ex B being Subset of V st
( B = X & B c= A & B is linearly-independent ) by A3, A5, A34;
hence x in A by A33; :: thesis: verum
end;
hence union Z in Q by A3, A9; :: thesis: verum
end;
( {} the carrier of V c= A & {} the carrier of V is linearly-independent ) ;
then Q <> {} by A3;
then consider X being set such that
A35: X in Q and
A36: for Z being set st Z in Q & Z <> X holds
not X c= Z by A4, ORDERS_1:67;
consider B being Subset of V such that
A37: B = X and
A38: B c= A and
A39: B is linearly-independent by A3, A35;
take B ; :: thesis: ( B c= A & B is base )
thus ( B c= A & B is linearly-independent ) by A38, A39; :: according to VECTSP_7:def 3 :: thesis: Lin B = ModuleStr(# the carrier of V, the addF of V, the ZeroF of V, the lmult of V #)
assume A40: Lin B <> ModuleStr(# the carrier of V, the addF of V, the ZeroF of V, the lmult of V #) ; :: thesis: contradiction
now :: thesis: ex v being Vector of V st
( v in A & not v in Lin B )
assume A41: for v being Vector of V st v in A holds
v in Lin B ; :: thesis: contradiction
now :: thesis: for v being Vector of V st v in Lin A holds
v in Lin B
reconsider F = the carrier of (Lin B) as Subset of V by VECTSP_4:def 2;
let v be Vector of V; :: thesis: ( v in Lin A implies v in Lin B )
assume v in Lin A ; :: thesis: v in Lin B
then consider l being Linear_Combination of A such that
A42: v = Sum l by Th4;
Carrier l c= the carrier of (Lin B)
proof
let x be object ; :: according to TARSKI:def 3 :: thesis: ( not x in Carrier l or x in the carrier of (Lin B) )
assume A43: x in Carrier l ; :: thesis: x in the carrier of (Lin B)
then reconsider a = x as Vector of V ;
Carrier l c= A by VECTSP_6:def 4;
then a in Lin B by A41, A43;
hence x in the carrier of (Lin B) by STRUCT_0:def 5; :: thesis: verum
end;
then reconsider l = l as Linear_Combination of F by VECTSP_6:def 4;
Sum l = v by A42;
then v in Lin F by Th4;
hence v in Lin B by Th8; :: thesis: verum
end;
then Lin A is Subspace of Lin B by VECTSP_4:28;
hence contradiction by A2, A40, VECTSP_4:25; :: thesis: verum
end;
then consider v being Vector of V such that
A44: v in A and
A45: not v in Lin B ;
A46: B \/ {v} is linearly-independent
proof
let l be Linear_Combination of B \/ {v}; :: according to VECTSP_7:def 1 :: thesis: ( not Sum l = 0. V or Carrier l = {} )
assume A47: Sum l = 0. V ; :: thesis: Carrier l = {}
now :: thesis: Carrier l = {}
per cases ( v in Carrier l or not v in Carrier l ) ;
suppose v in Carrier l ; :: thesis: Carrier l = {}
then l . v <> 0. R by VECTSP_6:2;
then - (l . v) <> 0. R by Lm1;
then A48: ((- (l . v)) ") * ((- (l . v)) * v) = (1. R) * v by Lm2
.= v ;
deffunc H1( Vector of V) -> Element of the carrier of R = l . $1;
consider f being Function of the carrier of V, the carrier of R such that
A49: f . v = 0. R and
A50: for u being Vector of V st u <> v holds
f . u = H1(u) from FUNCT_2:sch 6();
reconsider f = f as Element of Funcs ( the carrier of V, the carrier of R) by FUNCT_2:8;
now :: thesis: for u being Vector of V st not u in (Carrier l) \ {v} holds
f . u = 0. R
let u be Vector of V; :: thesis: ( not u in (Carrier l) \ {v} implies f . u = 0. R )
assume not u in (Carrier l) \ {v} ; :: thesis: f . u = 0. R
then ( not u in Carrier l or u in {v} ) by XBOOLE_0:def 5;
then ( ( l . u = 0. R & u <> v ) or u = v ) by TARSKI:def 1;
hence f . u = 0. R by A49, A50; :: thesis: verum
end;
then reconsider f = f as Linear_Combination of V by VECTSP_6:def 1;
Carrier f c= B
proof
let x be object ; :: according to TARSKI:def 3 :: thesis: ( not x in Carrier f or x in B )
A51: Carrier l c= B \/ {v} by VECTSP_6:def 4;
assume x in Carrier f ; :: thesis: x in B
then consider u being Vector of V such that
A52: u = x and
A53: f . u <> 0. R ;
f . u = l . u by A49, A50, A53;
then u in Carrier l by A53;
then ( u in B or u in {v} ) by A51, XBOOLE_0:def 3;
hence x in B by A49, A52, A53, TARSKI:def 1; :: thesis: verum
end;
then reconsider f = f as Linear_Combination of B by VECTSP_6:def 4;
deffunc H2( Vector of V) -> Element of the carrier of R = 0. R;
consider g being Function of the carrier of V, the carrier of R such that
A54: g . v = - (l . v) and
A55: for u being Vector of V st u <> v holds
g . u = H2(u) from FUNCT_2:sch 6();
reconsider g = g as Element of Funcs ( the carrier of V, the carrier of R) by FUNCT_2:8;
now :: thesis: for u being Vector of V st not u in {v} holds
g . u = 0. R
let u be Vector of V; :: thesis: ( not u in {v} implies g . u = 0. R )
assume not u in {v} ; :: thesis: g . u = 0. R
then u <> v by TARSKI:def 1;
hence g . u = 0. R by A55; :: thesis: verum
end;
then reconsider g = g as Linear_Combination of V by VECTSP_6:def 1;
Carrier g c= {v}
proof
let x be object ; :: according to TARSKI:def 3 :: thesis: ( not x in Carrier g or x in {v} )
assume x in Carrier g ; :: thesis: x in {v}
then ex u being Vector of V st
( x = u & g . u <> 0. R ) ;
then x = v by A55;
hence x in {v} by TARSKI:def 1; :: thesis: verum
end;
then reconsider g = g as Linear_Combination of {v} by VECTSP_6:def 4;
f - g = l
proof
let u be Vector of V; :: according to VECTSP_6:def 7 :: thesis: (f - g) . u = l . u
now :: thesis: (f - g) . u = l . u
per cases ( v = u or v <> u ) ;
suppose A56: v = u ; :: thesis: (f - g) . u = l . u
thus (f - g) . u = (f . u) - (g . u) by VECTSP_6:40
.= (0. R) + (- (- (l . v))) by A49, A54, A56, RLVECT_1:def 11
.= (l . v) + (0. R) by RLVECT_1:17
.= l . u by A56, RLVECT_1:4 ; :: thesis: verum
end;
suppose A57: v <> u ; :: thesis: (f - g) . u = l . u
thus (f - g) . u = (f . u) - (g . u) by VECTSP_6:40
.= (l . u) - (g . u) by A50, A57
.= (l . u) - (0. R) by A55, A57
.= l . u by RLVECT_1:13 ; :: thesis: verum
end;
end;
end;
hence (f - g) . u = l . u ; :: thesis: verum
end;
then A58: 0. V = (Sum f) - (Sum g) by A47, VECTSP_6:47;
Sum g = (- (l . v)) * v by A54, VECTSP_6:17;
then Sum f = (- (l . v)) * v by A58, VECTSP_1:19;
then (- (l . v)) * v in Lin B by Th4;
hence Carrier l = {} by A45, A48, VECTSP_4:21; :: thesis: verum
end;
end;
end;
hence Carrier l = {} ; :: thesis: verum
end;
{v} c= A by A44, ZFMISC_1:31;
then B \/ {v} c= A by A38, XBOOLE_1:8;
then A61: B \/ {v} in Q by A3, A46;
v in {v} by TARSKI:def 1;
then A62: v in B \/ {v} by XBOOLE_0:def 3;
not v in B by A45, Th5;
hence contradiction by A36, A37, A62, A61, XBOOLE_1:7; :: thesis: verum