let V be RealLinearSpace; :: thesis: for A, B being Subset of V st A is linearly-independent & A c= B & Lin B = V holds
ex I being linearly-independent Subset of V st
( A c= I & I c= B & Lin I = V )

let A, B be Subset of V; :: thesis: ( A is linearly-independent & A c= B & Lin B = V implies ex I being linearly-independent Subset of V st
( A c= I & I c= B & Lin I = V ) )

assume that
A1: ( A is linearly-independent & A c= B ) and
A2: Lin B = V ; :: thesis: ex I being linearly-independent Subset of V st
( A c= I & I c= B & Lin I = V )

defpred S1[ set ] means ex I being Subset of V st
( I = $1 & A c= I & I c= B & I is linearly-independent );
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 XBOOLE_0:sch 1();
A4: now
let Z be set ; :: thesis: ( Z <> {} & Z c= Q & Z is c=-linear implies union Z in Q )
assume that
A5: Z <> {} and
A6: Z c= Q and
A7: Z is c=-linear ; :: thesis: union Z in Q
set W = union Z;
union Z c= the carrier of V
proof
let x be set ; :: 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
A8: x in X and
A9: X in Z by TARSKI:def 4;
X in bool the carrier of V by A3, A6, A9;
hence x in the carrier of V by A8; :: thesis: verum
end;
then reconsider W = union Z as Subset of V ;
set y = the Element of Z;
the Element of Z in Q by A5, A6, TARSKI:def 3;
then A10: ex I being Subset of V st
( I = the Element of Z & A c= I & I c= B & I is linearly-independent ) by A3;
A11: W is linearly-independent
proof
deffunc H1( set ) -> set = { D where D is Subset of V : ( $1 in D & D in Z ) } ;
let l be Linear_Combination of W; :: according to RLVECT_3:def 1 :: thesis: ( not Sum l = 0. V or Carrier l = {} )
assume that
A12: Sum l = 0. V and
A13: Carrier l <> {} ; :: thesis: contradiction
consider f being Function such that
A14: dom f = Carrier l and
A15: for x being set st x in Carrier l holds
f . x = H1(x) from FUNCT_1:sch 3();
reconsider M = rng f as non empty set by A13, A14, RELAT_1:42;
A16: now
assume {} in M ; :: thesis: contradiction
then consider x being set such that
A17: x in dom f and
A18: f . x = {} by FUNCT_1:def 3;
Carrier l c= W by RLVECT_2:def 6;
then consider X being set such that
A19: x in X and
A20: X in Z by A14, A17, TARSKI:def 4;
reconsider X = X as Subset of V by A3, A6, A20;
X in { D where D is Subset of V : ( x in D & D in Z ) } by A19, A20;
hence contradiction by A14, A15, A17, A18; :: thesis: verum
end;
set F = the Choice_Function of M;
set S = rng the Choice_Function of M;
the Element of M in M ;
then A21: union M <> {} by A16, ORDERS_1:6;
then A22: dom the Choice_Function of M = M by FUNCT_2:def 1;
A23: now
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 set such that
A24: x in dom the Choice_Function of M and
A25: the Choice_Function of M . x = X by FUNCT_1:def 3;
consider y being set such that
A26: ( y in dom f & f . y = x ) by A22, A24, FUNCT_1:def 3;
A27: x = { D where D is Subset of V : ( y in D & D in Z ) } by A14, A15, A26;
X in x by A16, A22, A24, A25, ORDERS_1:def 1;
then ex D being Subset of V st
( D = X & y in D & D in Z ) by A27;
hence X in Z ; :: thesis: verum
end;
A28: now
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 A23;
then X,Y are_c=-comparable by A7, ORDINAL1:def 8;
hence ( X c= Y or Y c= X ) by XBOOLE_0:def 9; :: thesis: verum
end;
dom the Choice_Function of M is finite by A14, A22, FINSET_1:8;
then rng the Choice_Function of M is finite by FINSET_1:8;
then union (rng the Choice_Function of M) in rng the Choice_Function of M by A21, A28, CARD_2:62;
then union (rng the Choice_Function of M) in Z by A23;
then consider I being Subset of V such that
A29: I = union (rng the Choice_Function of M) and
A c= I and
I c= B and
A30: I is linearly-independent by A3, A6;
Carrier l c= union (rng the Choice_Function of M)
proof
let x be set ; :: according to TARSKI:def 3 :: thesis: ( not x in Carrier l or x in union (rng the Choice_Function of M) )
assume A31: x in Carrier l ; :: thesis: x in union (rng the Choice_Function of M)
then A32: f . x = { D where D is Subset of V : ( x in D & D in Z ) } by A15;
A33: f . x in M by A14, A31, FUNCT_1:def 3;
then the Choice_Function of M . (f . x) in f . x by A16, ORDERS_1:def 1;
then A34: ex D being Subset of V st
( the Choice_Function of M . (f . x) = D & x in D & D in Z ) by A32;
the Choice_Function of M . (f . x) in rng the Choice_Function of M by A22, A33, FUNCT_1:def 3;
hence x in union (rng the Choice_Function of M) by A34, TARSKI:def 4; :: thesis: verum
end;
then l is Linear_Combination of I by A29, RLVECT_2:def 6;
hence contradiction by A12, A13, A30, RLVECT_3:def 1; :: thesis: verum
end;
A35: W c= B
proof
let x be set ; :: according to TARSKI:def 3 :: thesis: ( not x in W or x in B )
assume x in W ; :: thesis: x in B
then consider X being set such that
A36: x in X and
A37: X in Z by TARSKI:def 4;
ex I being Subset of V st
( I = X & A c= I & I c= B & I is linearly-independent ) by A3, A6, A37;
hence x in B by A36; :: thesis: verum
end;
the Element of Z c= W by A5, ZFMISC_1:74;
then A c= W by A10, XBOOLE_1:1;
hence union Z in Q by A3, A11, A35; :: thesis: verum
end;
Q <> {} by A1, A3;
then consider X being set such that
A38: X in Q and
A39: for Z being set st Z in Q & Z <> X holds
not X c= Z by A4, ORDERS_1:67;
consider I being Subset of V such that
A40: I = X and
A41: A c= I and
A42: I c= B and
A43: I is linearly-independent by A3, A38;
reconsider I = I as linearly-independent Subset of V by A43;
take I ; :: thesis: ( A c= I & I c= B & Lin I = V )
thus ( A c= I & I c= B ) by A41, A42; :: thesis: Lin I = V
assume A44: Lin I <> V ; :: thesis: contradiction
now
assume A45: for v being VECTOR of V st v in B holds
v in Lin I ; :: thesis: contradiction
now
let v be VECTOR of V; :: thesis: ( v in Lin B implies v in Lin I )
assume v in Lin B ; :: thesis: v in Lin I
then consider l being Linear_Combination of B such that
A46: v = Sum l by RLVECT_3:14;
Carrier l c= the carrier of (Lin I)
proof
let x be set ; :: according to TARSKI:def 3 :: thesis: ( not x in Carrier l or x in the carrier of (Lin I) )
assume A47: x in Carrier l ; :: thesis: x in the carrier of (Lin I)
then reconsider a = x as VECTOR of V ;
Carrier l c= B by RLVECT_2:def 6;
then a in Lin I by A45, A47;
hence x in the carrier of (Lin I) by STRUCT_0:def 5; :: thesis: verum
end;
then reconsider l = l as Linear_Combination of Up (Lin I) by RLVECT_2:def 6;
Sum l = v by A46;
then v in Lin (Up (Lin I)) by RLVECT_3:14;
hence v in Lin I by RLVECT_3:18; :: thesis: verum
end;
then Lin B is Subspace of Lin I by RLSUB_1:29;
hence contradiction by A2, A44, RLSUB_1:26; :: thesis: verum
end;
then consider v being VECTOR of V such that
A48: v in B and
A49: not v in Lin I ;
A50: not v in I by A49, RLVECT_3:15;
{v} c= B by A48, ZFMISC_1:31;
then A51: I \/ {v} c= B by A42, XBOOLE_1:8;
v in {v} by TARSKI:def 1;
then A52: v in I \/ {v} by XBOOLE_0:def 3;
A53: I \/ {v} is linearly-independent
proof
let l be Linear_Combination of I \/ {v}; :: according to RLVECT_3:def 1 :: thesis: ( not Sum l = 0. V or Carrier l = {} )
assume A54: Sum l = 0. V ; :: thesis: Carrier l = {}
per cases ( v in Carrier l or not v in Carrier l ) ;
suppose v in Carrier l ; :: thesis: Carrier l = {}
then A55: - (l . v) <> 0 by RLVECT_2:19;
deffunc H1( VECTOR of V) -> Element of NAT = 0 ;
deffunc H2( VECTOR of V) -> Element of REAL = l . $1;
consider f being Function of the carrier of V,REAL such that
A56: f . v = 0 and
A57: for u being Element of V st u <> v holds
f . u = H2(u) from FUNCT_2:sch 6();
reconsider f = f as Element of Funcs ( the carrier of V,REAL) by FUNCT_2:8;
now
let u be Element of V; :: thesis: ( not u in (Carrier l) \ {v} implies f . u = 0 )
assume not u in (Carrier l) \ {v} ; :: thesis: f . u = 0
then ( not u in Carrier l or u in {v} ) by XBOOLE_0:def 5;
then ( ( l . u = 0 & u <> v ) or u = v ) by TARSKI:def 1;
hence f . u = 0 by A56, A57; :: thesis: verum
end;
then reconsider f = f as Linear_Combination of V by RLVECT_2:def 3;
Carrier f c= I
proof
let x be set ; :: according to TARSKI:def 3 :: thesis: ( not x in Carrier f or x in I )
assume x in Carrier f ; :: thesis: x in I
then consider u being Element of V such that
A58: u = x and
A59: f . u <> 0 ;
f . u = l . u by A56, A57, A59;
then ( Carrier l c= I \/ {v} & u in Carrier l ) by A59, RLVECT_2:def 6;
then ( u in I or u in {v} ) by XBOOLE_0:def 3;
hence x in I by A56, A58, A59, TARSKI:def 1; :: thesis: verum
end;
then reconsider f = f as Linear_Combination of I by RLVECT_2:def 6;
consider g being Function of the carrier of V,REAL such that
A60: g . v = - (l . v) and
A61: for u being Element of V st u <> v holds
g . u = H1(u) from FUNCT_2:sch 6();
reconsider g = g as Element of Funcs ( the carrier of V,REAL) by FUNCT_2:8;
now
let u be Element of V; :: thesis: ( not u in {v} implies g . u = 0 )
assume not u in {v} ; :: thesis: g . u = 0
then u <> v by TARSKI:def 1;
hence g . u = 0 by A61; :: thesis: verum
end;
then reconsider g = g as Linear_Combination of V by RLVECT_2:def 3;
Carrier g c= {v}
proof
let x be set ; :: 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 Element of V st
( x = u & g . u <> 0 ) ;
then x = v by A61;
hence x in {v} by TARSKI:def 1; :: thesis: verum
end;
then reconsider g = g as Linear_Combination of {v} by RLVECT_2:def 6;
A62: Sum g = (- (l . v)) * v by A60, RLVECT_2:32;
now
let u be Element of V; :: thesis: (f - g) . u = l . u
now
per cases ( v = u or v <> u ) ;
suppose A63: v = u ; :: thesis: (f - g) . u = l . u
thus (f - g) . u = (f . u) - (g . u) by RLVECT_2:54
.= l . u by A56, A60, A63 ; :: thesis: verum
end;
suppose A64: v <> u ; :: thesis: (f - g) . u = l . u
thus (f - g) . u = (f . u) - (g . u) by RLVECT_2:54
.= (l . u) - (g . u) by A57, A64
.= (l . u) - 0 by A61, A64
.= l . u ; :: thesis: verum
end;
end;
end;
hence (f - g) . u = l . u ; :: thesis: verum
end;
then f - g = l by RLVECT_2:def 9;
then 0. V = (Sum f) - (Sum g) by A54, RLVECT_3:4;
then Sum f = (0. V) + (Sum g) by RLSUB_2:61
.= (- (l . v)) * v by A62, RLVECT_1:4 ;
then A65: (- (l . v)) * v in Lin I by RLVECT_3:14;
((- (l . v)) ") * ((- (l . v)) * v) = (((- (l . v)) ") * (- (l . v))) * v by RLVECT_1:def 7
.= 1 * v by A55, XCMPLX_0:def 7
.= v by RLVECT_1:def 8 ;
hence Carrier l = {} by A49, A65, RLSUB_1:21; :: thesis: verum
end;
end;
end;
A c= I \/ {v} by A41, XBOOLE_1:10;
then I \/ {v} in Q by A3, A51, A53;
hence contradiction by A39, A40, A50, A52, XBOOLE_1:7; :: thesis: verum