:: RUSUB_4 semantic presentation

theorem Th1: :: RUSUB_4:1
for b1 being RealUnitarySpace
for b2, b3 being finite Subset of b1
for b4 being VECTOR of b1 st b4 in Lin (b2 \/ b3) & not b4 in Lin b3 holds
ex b5 being VECTOR of b1 st
( b5 in b2 & b5 in Lin (((b2 \/ b3) \ {b5}) \/ {b4}) )
proof end;

Lemma2: for b1, b2 being set st b2 in b1 holds
(b1 \ {b2}) \/ {b2} = b1
proof end;

Lemma3: for b1, b2 being set st not b2 in b1 holds
b1 \ {b2} = b1
proof end;

theorem Th2: :: RUSUB_4:2
for b1 being RealUnitarySpace
for b2, b3 being finite Subset of b1 st UNITSTR(# the carrier of b1,the Zero of b1,the add of b1,the Mult of b1,the scalar of b1 #) = Lin b2 & b3 is linearly-independent holds
( card b3 <= card b2 & ex b4 being finite Subset of b1 st
( b4 c= b2 & card b4 = (card b2) - (card b3) & UNITSTR(# the carrier of b1,the Zero of b1,the add of b1,the Mult of b1,the scalar of b1 #) = Lin (b3 \/ b4) ) )
proof end;

definition
let c1 be RealUnitarySpace;
attr a1 is finite-dimensional means :Def1: :: RUSUB_4:def 1
ex b1 being finite Subset of a1 st b1 is Basis of a1;
end;

:: deftheorem Def1 defines finite-dimensional RUSUB_4:def 1 :
for b1 being RealUnitarySpace holds
( b1 is finite-dimensional iff ex b2 being finite Subset of b1 st b2 is Basis of b1 );

registration
cluster strict finite-dimensional UNITSTR ;
existence
ex b1 being RealUnitarySpace st
( b1 is strict & b1 is finite-dimensional )
proof end;
end;

definition
let c1 be RealUnitarySpace;
redefine attr a1 is finite-dimensional means :Def2: :: RUSUB_4:def 2
ex b1 being finite Subset of a1 st b1 is Basis of a1;
compatibility
( c1 is finite-dimensional iff ex b1 being finite Subset of c1 st b1 is Basis of c1 )
by Def1;
end;

:: deftheorem Def2 defines finite-dimensional RUSUB_4:def 2 :
for b1 being RealUnitarySpace holds
( b1 is finite-dimensional iff ex b2 being finite Subset of b1 st b2 is Basis of b1 );

theorem Th3: :: RUSUB_4:3
for b1 being RealUnitarySpace st b1 is finite-dimensional holds
for b2 being Basis of b1 holds b2 is finite
proof end;

theorem Th4: :: RUSUB_4:4
for b1 being RealUnitarySpace
for b2 being Subset of b1 st b1 is finite-dimensional & b2 is linearly-independent holds
b2 is finite
proof end;

theorem Th5: :: RUSUB_4:5
for b1 being RealUnitarySpace
for b2, b3 being Basis of b1 st b1 is finite-dimensional holds
Card b2 = Card b3
proof end;

theorem Th6: :: RUSUB_4:6
for b1 being RealUnitarySpace holds (0). b1 is finite-dimensional
proof end;

theorem Th7: :: RUSUB_4:7
for b1 being RealUnitarySpace
for b2 being Subspace of b1 st b1 is finite-dimensional holds
b2 is finite-dimensional
proof end;

registration
let c1 be RealUnitarySpace;
cluster strict finite-dimensional Subspace of a1;
existence
ex b1 being Subspace of c1 st
( b1 is finite-dimensional & b1 is strict )
proof end;
end;

registration
let c1 be finite-dimensional RealUnitarySpace;
cluster -> finite-dimensional Subspace of a1;
correctness
coherence
for b1 being Subspace of c1 holds b1 is finite-dimensional
;
by Th7;
end;

registration
let c1 be finite-dimensional RealUnitarySpace;
cluster strict finite-dimensional Subspace of a1;
existence
ex b1 being Subspace of c1 st b1 is strict
proof end;
end;

definition
let c1 be RealUnitarySpace;
assume E11: c1 is finite-dimensional ;
func dim c1 -> Nat means :Def3: :: RUSUB_4:def 3
for b1 being Basis of a1 holds a2 = Card b1;
existence
ex b1 being Nat st
for b2 being Basis of c1 holds b1 = Card b2
proof end;
uniqueness
for b1, b2 being Nat st ( for b3 being Basis of c1 holds b1 = Card b3 ) & ( for b3 being Basis of c1 holds b2 = Card b3 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def3 defines dim RUSUB_4:def 3 :
for b1 being RealUnitarySpace st b1 is finite-dimensional holds
for b2 being Nat holds
( b2 = dim b1 iff for b3 being Basis of b1 holds b2 = Card b3 );

theorem Th8: :: RUSUB_4:8
for b1 being finite-dimensional RealUnitarySpace
for b2 being Subspace of b1 holds dim b2 <= dim b1
proof end;

theorem Th9: :: RUSUB_4:9
for b1 being finite-dimensional RealUnitarySpace
for b2 being Subset of b1 st b2 is linearly-independent holds
Card b2 = dim (Lin b2)
proof end;

theorem Th10: :: RUSUB_4:10
for b1 being finite-dimensional RealUnitarySpace holds dim b1 = dim ((Omega). b1)
proof end;

theorem Th11: :: RUSUB_4:11
for b1 being finite-dimensional RealUnitarySpace
for b2 being Subspace of b1 holds
( dim b1 = dim b2 iff (Omega). b1 = (Omega). b2 )
proof end;

theorem Th12: :: RUSUB_4:12
for b1 being finite-dimensional RealUnitarySpace holds
( dim b1 = 0 iff (Omega). b1 = (0). b1 )
proof end;

theorem Th13: :: RUSUB_4:13
for b1 being finite-dimensional RealUnitarySpace holds
( dim b1 = 1 iff ex b2 being VECTOR of b1 st
( b2 <> 0. b1 & (Omega). b1 = Lin {b2} ) )
proof end;

theorem Th14: :: RUSUB_4:14
for b1 being finite-dimensional RealUnitarySpace holds
( dim b1 = 2 iff ex b2, b3 being VECTOR of b1 st
( b2 <> b3 & {b2,b3} is linearly-independent & (Omega). b1 = Lin {b2,b3} ) )
proof end;

theorem Th15: :: RUSUB_4:15
for b1 being finite-dimensional RealUnitarySpace
for b2, b3 being Subspace of b1 holds (dim (b2 + b3)) + (dim (b2 /\ b3)) = (dim b2) + (dim b3)
proof end;

theorem Th16: :: RUSUB_4:16
for b1 being finite-dimensional RealUnitarySpace
for b2, b3 being Subspace of b1 holds dim (b2 /\ b3) >= ((dim b2) + (dim b3)) - (dim b1)
proof end;

theorem Th17: :: RUSUB_4:17
for b1 being finite-dimensional RealUnitarySpace
for b2, b3 being Subspace of b1 st b1 is_the_direct_sum_of b2,b3 holds
dim b1 = (dim b2) + (dim b3)
proof end;

Lemma17: for b1 being finite-dimensional RealUnitarySpace
for b2 being Nat st b2 <= dim b1 holds
ex b3 being strict Subspace of b1 st dim b3 = b2
proof end;

theorem Th18: :: RUSUB_4:18
for b1 being finite-dimensional RealUnitarySpace
for b2 being Subspace of b1
for b3 being Nat holds
( b3 <= dim b1 iff ex b4 being strict Subspace of b1 st dim b4 = b3 ) by Lemma17, Th8;

definition
let c1 be finite-dimensional RealUnitarySpace;
let c2 be Nat;
func c2 Subspaces_of c1 -> set means :Def4: :: RUSUB_4:def 4
for b1 being set holds
( b1 in a3 iff ex b2 being strict Subspace of a1 st
( b2 = b1 & dim b2 = a2 ) );
existence
ex b1 being set st
for b2 being set holds
( b2 in b1 iff ex b3 being strict Subspace of c1 st
( b3 = b2 & dim b3 = c2 ) )
proof end;
uniqueness
for b1, b2 being set st ( for b3 being set holds
( b3 in b1 iff ex b4 being strict Subspace of c1 st
( b4 = b3 & dim b4 = c2 ) ) ) & ( for b3 being set holds
( b3 in b2 iff ex b4 being strict Subspace of c1 st
( b4 = b3 & dim b4 = c2 ) ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def4 defines Subspaces_of RUSUB_4:def 4 :
for b1 being finite-dimensional RealUnitarySpace
for b2 being Nat
for b3 being set holds
( b3 = b2 Subspaces_of b1 iff for b4 being set holds
( b4 in b3 iff ex b5 being strict Subspace of b1 st
( b5 = b4 & dim b5 = b2 ) ) );

theorem Th19: :: RUSUB_4:19
for b1 being finite-dimensional RealUnitarySpace
for b2 being Nat st b2 <= dim b1 holds
not b2 Subspaces_of b1 is empty
proof end;

theorem Th20: :: RUSUB_4:20
for b1 being finite-dimensional RealUnitarySpace
for b2 being Nat st dim b1 < b2 holds
b2 Subspaces_of b1 = {}
proof end;

theorem Th21: :: RUSUB_4:21
for b1 being finite-dimensional RealUnitarySpace
for b2 being Subspace of b1
for b3 being Nat holds b3 Subspaces_of b2 c= b3 Subspaces_of b1
proof end;

definition
let c1 be non empty RLSStruct ;
let c2 be Subset of c1;
attr a2 is Affine means :Def5: :: RUSUB_4:def 5
for b1, b2 being VECTOR of a1
for b3 being Real st b1 in a2 & b2 in a2 holds
((1 - b3) * b1) + (b3 * b2) in a2;
end;

:: deftheorem Def5 defines Affine RUSUB_4:def 5 :
for b1 being non empty RLSStruct
for b2 being Subset of b1 holds
( b2 is Affine iff for b3, b4 being VECTOR of b1
for b5 being Real st b3 in b2 & b4 in b2 holds
((1 - b5) * b3) + (b5 * b4) in b2 );

theorem Th22: :: RUSUB_4:22
for b1 being non empty RLSStruct holds
( [#] b1 is Affine & {} b1 is Affine )
proof end;

theorem Th23: :: RUSUB_4:23
for b1 being non empty RealLinearSpace-like RLSStruct
for b2 being VECTOR of b1 holds {b2} is Affine
proof end;

registration
let c1 be non empty RLSStruct ;
cluster non empty Affine Element of K40(the carrier of a1);
existence
ex b1 being Subset of c1 st
( not b1 is empty & b1 is Affine )
proof end;
cluster empty Affine Element of K40(the carrier of a1);
existence
ex b1 being Subset of c1 st
( b1 is empty & b1 is Affine )
proof end;
end;

definition
let c1 be RealLinearSpace;
let c2 be Subspace of c1;
func Up c2 -> non empty Subset of a1 equals :: RUSUB_4:def 6
the carrier of a2;
coherence
the carrier of c2 is non empty Subset of c1
by RLSUB_1:def 2;
end;

:: deftheorem Def6 defines Up RUSUB_4:def 6 :
for b1 being RealLinearSpace
for b2 being Subspace of b1 holds Up b2 = the carrier of b2;

definition
let c1 be RealUnitarySpace;
let c2 be Subspace of c1;
func Up c2 -> non empty Subset of a1 equals :: RUSUB_4:def 7
the carrier of a2;
coherence
the carrier of c2 is non empty Subset of c1
by RUSUB_1:def 1;
end;

:: deftheorem Def7 defines Up RUSUB_4:def 7 :
for b1 being RealUnitarySpace
for b2 being Subspace of b1 holds Up b2 = the carrier of b2;

theorem Th24: :: RUSUB_4:24
for b1 being RealLinearSpace
for b2 being Subspace of b1 holds
( Up b2 is Affine & 0. b1 in the carrier of b2 )
proof end;

theorem Th25: :: RUSUB_4:25
for b1 being RealLinearSpace
for b2 being Affine Subset of b1 st 0. b1 in b2 holds
for b3 being VECTOR of b1
for b4 being Real st b3 in b2 holds
b4 * b3 in b2
proof end;

definition
let c1 be non empty RLSStruct ;
let c2 be non empty Subset of c1;
attr a2 is Subspace-like means :Def8: :: RUSUB_4:def 8
( the Zero of a1 in a2 & ( for b1, b2 being Element of a1
for b3 being Real st b1 in a2 & b2 in a2 holds
( b1 + b2 in a2 & b3 * b1 in a2 ) ) );
end;

:: deftheorem Def8 defines Subspace-like RUSUB_4:def 8 :
for b1 being non empty RLSStruct
for b2 being non empty Subset of b1 holds
( b2 is Subspace-like iff ( the Zero of b1 in b2 & ( for b3, b4 being Element of b1
for b5 being Real st b3 in b2 & b4 in b2 holds
( b3 + b4 in b2 & b5 * b3 in b2 ) ) ) );

theorem Th26: :: RUSUB_4:26
for b1 being RealLinearSpace
for b2 being non empty Affine Subset of b1 st 0. b1 in b2 holds
( b2 is Subspace-like & b2 = the carrier of (Lin b2) )
proof end;

theorem Th27: :: RUSUB_4:27
for b1 being RealLinearSpace
for b2 being Subspace of b1 holds Up b2 is Subspace-like
proof end;

theorem Th28: :: RUSUB_4:28
for b1 being RealLinearSpace
for b2 being strict Subspace of b1 holds b2 = Lin (Up b2) by RLVECT_3:21;

theorem Th29: :: RUSUB_4:29
for b1 being RealUnitarySpace
for b2 being non empty Affine Subset of b1 st 0. b1 in b2 holds
b2 = the carrier of (Lin b2)
proof end;

theorem Th30: :: RUSUB_4:30
for b1 being RealUnitarySpace
for b2 being Subspace of b1 holds Up b2 is Subspace-like
proof end;

theorem Th31: :: RUSUB_4:31
for b1 being RealUnitarySpace
for b2 being strict Subspace of b1 holds b2 = Lin (Up b2) by RUSUB_3:5;

definition
let c1 be non empty LoopStr ;
let c2 be Subset of c1;
let c3 be Element of c1;
func c3 + c2 -> Subset of a1 equals :: RUSUB_4:def 9
{ (a3 + b1) where B is Element of a1 : b1 in a2 } ;
coherence
{ (c3 + b1) where B is Element of c1 : b1 in c2 } is Subset of c1
proof end;
end;

:: deftheorem Def9 defines + RUSUB_4:def 9 :
for b1 being non empty LoopStr
for b2 being Subset of b1
for b3 being Element of b1 holds b3 + b2 = { (b3 + b4) where B is Element of b1 : b4 in b2 } ;

theorem Th32: :: RUSUB_4:32
for b1 being RealLinearSpace
for b2 being strict Subspace of b1
for b3 being Subset of b1
for b4 being VECTOR of b1 st Up b2 = b3 holds
b4 + b2 = b4 + b3
proof end;

theorem Th33: :: RUSUB_4:33
for b1 being non empty Abelian add-associative RealLinearSpace-like RLSStruct
for b2 being Affine Subset of b1
for b3 being VECTOR of b1 holds b3 + b2 is Affine
proof end;

theorem Th34: :: RUSUB_4:34
for b1 being RealUnitarySpace
for b2 being strict Subspace of b1
for b3 being Subset of b1
for b4 being VECTOR of b1 st Up b2 = b3 holds
b4 + b2 = b4 + b3
proof end;

definition
let c1 be non empty LoopStr ;
let c2, c3 be Subset of c1;
func c2 + c3 -> Subset of a1 equals :: RUSUB_4:def 10
{ (b1 + b2) where B is Element of a1, B is Element of a1 : ( b1 in a2 & b2 in a3 ) } ;
coherence
{ (b1 + b2) where B is Element of c1, B is Element of c1 : ( b1 in c2 & b2 in c3 ) } is Subset of c1
proof end;
end;

:: deftheorem Def10 defines + RUSUB_4:def 10 :
for b1 being non empty LoopStr
for b2, b3 being Subset of b1 holds b2 + b3 = { (b4 + b5) where B is Element of b1, B is Element of b1 : ( b4 in b2 & b5 in b3 ) } ;

theorem Th35: :: RUSUB_4:35
for b1 being non empty Abelian LoopStr
for b2, b3 being Subset of b1 holds b3 + b2 = b2 + b3
proof end;

definition
let c1 be non empty Abelian LoopStr ;
let c2, c3 be Subset of c1;
redefine func + as c2 + c3 -> Subset of a1;
commutativity
for b1, b2 being Subset of c1 holds b1 + b2 = b2 + b1
by Th35;
end;

theorem Th36: :: RUSUB_4:36
for b1 being non empty LoopStr
for b2 being Subset of b1
for b3 being Element of b1 holds {b3} + b2 = b3 + b2
proof end;

theorem Th37: :: RUSUB_4:37
for b1 being non empty Abelian add-associative RealLinearSpace-like RLSStruct
for b2 being Affine Subset of b1
for b3 being VECTOR of b1 holds {b3} + b2 is Affine
proof end;

theorem Th38: :: RUSUB_4:38
for b1 being non empty RLSStruct
for b2, b3 being Affine Subset of b1 holds b2 /\ b3 is Affine
proof end;

theorem Th39: :: RUSUB_4:39
for b1 being non empty Abelian add-associative RealLinearSpace-like RLSStruct
for b2, b3 being Affine Subset of b1 holds b2 + b3 is Affine
proof end;