:: BHSP_5 semantic presentation

theorem Th1: :: BHSP_5:1
for b1 being set
for b2, b3 being FinSequence of b1 st b2 is one-to-one & b3 is one-to-one & rng b2 = rng b3 holds
( dom b2 = dom b3 & ex b4 being Permutation of dom b2 st
( b3 = b2 * b4 & dom b4 = dom b2 & rng b4 = dom b2 ) )
proof end;

definition
let c1 be non empty set ;
let c2 be BinOp of c1;
assume E2: ( c2 is commutative & c2 is associative & c2 has_a_unity ) ;
let c3 be finite Subset of c1;
func c2 ++ c3 -> Element of a1 means :: BHSP_5:def 1
ex b1 being FinSequence of a1 st
( b1 is one-to-one & rng b1 = a3 & a4 = a2 "**" b1 );
existence
ex b1 being Element of c1ex b2 being FinSequence of c1 st
( b2 is one-to-one & rng b2 = c3 & b1 = c2 "**" b2 )
proof end;
uniqueness
for b1, b2 being Element of c1 st ex b3 being FinSequence of c1 st
( b3 is one-to-one & rng b3 = c3 & b1 = c2 "**" b3 ) & ex b3 being FinSequence of c1 st
( b3 is one-to-one & rng b3 = c3 & b2 = c2 "**" b3 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def1 defines ++ BHSP_5:def 1 :
for b1 being non empty set
for b2 being BinOp of b1 st b2 is commutative & b2 is associative & b2 has_a_unity holds
for b3 being finite Subset of b1
for b4 being Element of b1 holds
( b4 = b2 ++ b3 iff ex b5 being FinSequence of b1 st
( b5 is one-to-one & rng b5 = b3 & b4 = b2 "**" b5 ) );

definition
let c1 be RealUnitarySpace;
let c2 be finite Subset of c1;
func setop_SUM c2,c1 -> set equals :: BHSP_5:def 2
the add of a1 ++ a2 if a2 <> {}
otherwise 0. a1;
correctness
coherence
( ( c2 <> {} implies the add of c1 ++ c2 is set ) & ( not c2 <> {} implies 0. c1 is set ) )
;
consistency
for b1 being set holds verum
;
;
end;

:: deftheorem Def2 defines setop_SUM BHSP_5:def 2 :
for b1 being RealUnitarySpace
for b2 being finite Subset of b1 holds
( ( b2 <> {} implies setop_SUM b2,b1 = the add of b1 ++ b2 ) & ( not b2 <> {} implies setop_SUM b2,b1 = 0. b1 ) );

definition
let c1 be RealUnitarySpace;
let c2 be Point of c1;
let c3 be FinSequence;
let c4 be Nat;
func PO c4,c3,c2 -> set equals :: BHSP_5:def 3
the scalar of a1 . [a2,(a3 . a4)];
correctness
coherence
the scalar of c1 . [c2,(c3 . c4)] is set
;
;
end;

:: deftheorem Def3 defines PO BHSP_5:def 3 :
for b1 being RealUnitarySpace
for b2 being Point of b1
for b3 being FinSequence
for b4 being Nat holds PO b4,b3,b2 = the scalar of b1 . [b2,(b3 . b4)];

definition
let c1, c2 be non empty set ;
let c3 be Function of c2,c1;
let c4 be FinSequence of c2;
func Func_Seq c3,c4 -> FinSequence of a1 equals :: BHSP_5:def 4
a3 * a4;
correctness
coherence
c3 * c4 is FinSequence of c1
;
by FINSEQ_2:36;
end;

:: deftheorem Def4 defines Func_Seq BHSP_5:def 4 :
for b1, b2 being non empty set
for b3 being Function of b2,b1
for b4 being FinSequence of b2 holds Func_Seq b3,b4 = b3 * b4;

definition
let c1, c2 be non empty set ;
let c3 be BinOp of c1;
assume E2: ( c3 is commutative & c3 is associative & c3 has_a_unity ) ;
let c4 be finite Subset of c2;
let c5 be Function of c2,c1;
assume E3: c4 c= dom c5 ;
func setopfunc c4,c2,c1,c5,c3 -> Element of a1 means :Def5: :: BHSP_5:def 5
ex b1 being FinSequence of a2 st
( b1 is one-to-one & rng b1 = a4 & a6 = a3 "**" (Func_Seq a5,b1) );
existence
ex b1 being Element of c1ex b2 being FinSequence of c2 st
( b2 is one-to-one & rng b2 = c4 & b1 = c3 "**" (Func_Seq c5,b2) )
proof end;
uniqueness
for b1, b2 being Element of c1 st ex b3 being FinSequence of c2 st
( b3 is one-to-one & rng b3 = c4 & b1 = c3 "**" (Func_Seq c5,b3) ) & ex b3 being FinSequence of c2 st
( b3 is one-to-one & rng b3 = c4 & b2 = c3 "**" (Func_Seq c5,b3) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def5 defines setopfunc BHSP_5:def 5 :
for b1, b2 being non empty set
for b3 being BinOp of b1 st b3 is commutative & b3 is associative & b3 has_a_unity holds
for b4 being finite Subset of b2
for b5 being Function of b2,b1 st b4 c= dom b5 holds
for b6 being Element of b1 holds
( b6 = setopfunc b4,b2,b1,b5,b3 iff ex b7 being FinSequence of b2 st
( b7 is one-to-one & rng b7 = b4 & b6 = b3 "**" (Func_Seq b5,b7) ) );

definition
let c1 be RealUnitarySpace;
let c2 be Point of c1;
let c3 be finite Subset of c1;
func setop_xPre_PROD c2,c3,c1 -> Real means :: BHSP_5:def 6
ex b1 being FinSequence of the carrier of a1 st
( b1 is one-to-one & rng b1 = a3 & ex b2 being FinSequence of REAL st
( dom b2 = dom b1 & ( for b3 being Nat st b3 in dom b2 holds
b2 . b3 = PO b3,b1,a2 ) & a4 = addreal "**" b2 ) );
existence
ex b1 being Realex b2 being FinSequence of the carrier of c1 st
( b2 is one-to-one & rng b2 = c3 & ex b3 being FinSequence of REAL st
( dom b3 = dom b2 & ( for b4 being Nat st b4 in dom b3 holds
b3 . b4 = PO b4,b2,c2 ) & b1 = addreal "**" b3 ) )
proof end;
uniqueness
for b1, b2 being Real st ex b3 being FinSequence of the carrier of c1 st
( b3 is one-to-one & rng b3 = c3 & ex b4 being FinSequence of REAL st
( dom b4 = dom b3 & ( for b5 being Nat st b5 in dom b4 holds
b4 . b5 = PO b5,b3,c2 ) & b1 = addreal "**" b4 ) ) & ex b3 being FinSequence of the carrier of c1 st
( b3 is one-to-one & rng b3 = c3 & ex b4 being FinSequence of REAL st
( dom b4 = dom b3 & ( for b5 being Nat st b5 in dom b4 holds
b4 . b5 = PO b5,b3,c2 ) & b2 = addreal "**" b4 ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def6 defines setop_xPre_PROD BHSP_5:def 6 :
for b1 being RealUnitarySpace
for b2 being Point of b1
for b3 being finite Subset of b1
for b4 being Real holds
( b4 = setop_xPre_PROD b2,b3,b1 iff ex b5 being FinSequence of the carrier of b1 st
( b5 is one-to-one & rng b5 = b3 & ex b6 being FinSequence of REAL st
( dom b6 = dom b5 & ( for b7 being Nat st b7 in dom b6 holds
b6 . b7 = PO b7,b5,b2 ) & b4 = addreal "**" b6 ) ) );

definition
let c1 be RealUnitarySpace;
let c2 be Point of c1;
let c3 be finite Subset of c1;
func setop_xPROD c2,c3,c1 -> Real equals :: BHSP_5:def 7
setop_xPre_PROD a2,a3,a1 if a3 <> {}
otherwise 0;
correctness
coherence
( ( c3 <> {} implies setop_xPre_PROD c2,c3,c1 is Real ) & ( not c3 <> {} implies 0 is Real ) )
;
consistency
for b1 being Real holds verum
;
;
end;

:: deftheorem Def7 defines setop_xPROD BHSP_5:def 7 :
for b1 being RealUnitarySpace
for b2 being Point of b1
for b3 being finite Subset of b1 holds
( ( b3 <> {} implies setop_xPROD b2,b3,b1 = setop_xPre_PROD b2,b3,b1 ) & ( not b3 <> {} implies setop_xPROD b2,b3,b1 = 0 ) );

definition
let c1 be RealUnitarySpace;
mode OrthogonalFamily of c1 -> Subset of a1 means :Def8: :: BHSP_5:def 8
for b1, b2 being Point of a1 st b1 in a2 & b2 in a2 & b1 <> b2 holds
b1 .|. b2 = 0;
existence
ex b1 being Subset of c1 st
for b2, b3 being Point of c1 st b2 in b1 & b3 in b1 & b2 <> b3 holds
b2 .|. b3 = 0
proof end;
end;

:: deftheorem Def8 defines OrthogonalFamily BHSP_5:def 8 :
for b1 being RealUnitarySpace
for b2 being Subset of b1 holds
( b2 is OrthogonalFamily of b1 iff for b3, b4 being Point of b1 st b3 in b2 & b4 in b2 & b3 <> b4 holds
b3 .|. b4 = 0 );

theorem Th2: :: BHSP_5:2
for b1 being RealUnitarySpace holds {} is OrthogonalFamily of b1
proof end;

registration
let c1 be RealUnitarySpace;
cluster finite OrthogonalFamily of a1;
existence
ex b1 being OrthogonalFamily of c1 st b1 is finite
proof end;
end;

definition
let c1 be RealUnitarySpace;
mode OrthonormalFamily of c1 -> Subset of a1 means :Def9: :: BHSP_5:def 9
( a2 is OrthogonalFamily of a1 & ( for b1 being Point of a1 st b1 in a2 holds
b1 .|. b1 = 1 ) );
existence
ex b1 being Subset of c1 st
( b1 is OrthogonalFamily of c1 & ( for b2 being Point of c1 st b2 in b1 holds
b2 .|. b2 = 1 ) )
proof end;
end;

:: deftheorem Def9 defines OrthonormalFamily BHSP_5:def 9 :
for b1 being RealUnitarySpace
for b2 being Subset of b1 holds
( b2 is OrthonormalFamily of b1 iff ( b2 is OrthogonalFamily of b1 & ( for b3 being Point of b1 st b3 in b2 holds
b3 .|. b3 = 1 ) ) );

theorem Th3: :: BHSP_5:3
for b1 being RealUnitarySpace holds {} is OrthonormalFamily of b1
proof end;

registration
let c1 be RealUnitarySpace;
cluster finite OrthonormalFamily of a1;
existence
ex b1 being OrthonormalFamily of c1 st b1 is finite
proof end;
end;

theorem Th4: :: BHSP_5:4
for b1 being RealUnitarySpace
for b2 being Point of b1 holds
( b2 = 0. b1 iff for b3 being Point of b1 holds b2 .|. b3 = 0 )
proof end;

theorem Th5: :: BHSP_5:5
for b1 being RealUnitarySpace
for b2, b3 being Point of b1 holds (||.(b2 + b3).|| ^2 ) + (||.(b2 - b3).|| ^2 ) = (2 * (||.b2.|| ^2 )) + (2 * (||.b3.|| ^2 ))
proof end;

theorem Th6: :: BHSP_5:6
for b1 being RealUnitarySpace
for b2, b3 being Point of b1 st b2,b3 are_orthogonal holds
||.(b2 + b3).|| ^2 = (||.b2.|| ^2 ) + (||.b3.|| ^2 )
proof end;

theorem Th7: :: BHSP_5:7
for b1 being RealUnitarySpace
for b2 being FinSequence of the carrier of b1 st len b2 >= 1 & ( for b3, b4 being Nat st b3 in dom b2 & b4 in dom b2 & b3 <> b4 holds
the scalar of b1 . [(b2 . b3),(b2 . b4)] = 0 ) holds
for b3 being FinSequence of REAL st dom b2 = dom b3 & ( for b4 being Nat st b4 in dom b3 holds
b3 . b4 = the scalar of b1 . [(b2 . b4),(b2 . b4)] ) holds
(the add of b1 "**" b2) .|. (the add of b1 "**" b2) = addreal "**" b3
proof end;

theorem Th8: :: BHSP_5:8
for b1 being RealUnitarySpace
for b2 being Point of b1
for b3 being FinSequence of the carrier of b1 st len b3 >= 1 holds
for b4 being FinSequence of REAL st dom b3 = dom b4 & ( for b5 being Nat st b5 in dom b4 holds
b4 . b5 = the scalar of b1 . [b2,(b3 . b5)] ) holds
b2 .|. (the add of b1 "**" b3) = addreal "**" b4
proof end;

theorem Th9: :: BHSP_5:9
for b1 being RealUnitarySpace
for b2 being non empty finite Subset of b1
for b3 being Function of the carrier of b1,the carrier of b1 st b2 c= dom b3 & ( for b4, b5 being Point of b1 st b4 in b2 & b5 in b2 & b4 <> b5 holds
the scalar of b1 . [(b3 . b4),(b3 . b5)] = 0 ) holds
for b4 being Function of the carrier of b1, REAL st b2 c= dom b4 & ( for b5 being Point of b1 st b5 in b2 holds
b4 . b5 = the scalar of b1 . [(b3 . b5),(b3 . b5)] ) holds
for b5 being FinSequence of the carrier of b1 st b5 is one-to-one & rng b5 = b2 holds
the scalar of b1 . [(the add of b1 "**" (Func_Seq b3,b5)),(the add of b1 "**" (Func_Seq b3,b5))] = addreal "**" (Func_Seq b4,b5)
proof end;

theorem Th10: :: BHSP_5:10
for b1 being RealUnitarySpace
for b2 being Point of b1
for b3 being non empty finite Subset of b1
for b4 being Function of the carrier of b1,the carrier of b1 st b3 c= dom b4 holds
for b5 being Function of the carrier of b1, REAL st b3 c= dom b5 & ( for b6 being Point of b1 st b6 in b3 holds
b5 . b6 = the scalar of b1 . [b2,(b4 . b6)] ) holds
for b6 being FinSequence of the carrier of b1 st b6 is one-to-one & rng b6 = b3 holds
the scalar of b1 . [b2,(the add of b1 "**" (Func_Seq b4,b6))] = addreal "**" (Func_Seq b5,b6)
proof end;

theorem Th11: :: BHSP_5:11
for b1 being RealUnitarySpace st the add of b1 is commutative & the add of b1 is associative & the add of b1 has_a_unity holds
for b2 being Point of b1
for b3 being finite OrthonormalFamily of b1 st not b3 is empty holds
for b4 being Function of the carrier of b1, REAL st b3 c= dom b4 & ( for b5 being Point of b1 st b5 in b3 holds
b4 . b5 = (b2 .|. b5) ^2 ) holds
for b5 being Function of the carrier of b1,the carrier of b1 st b3 c= dom b5 & ( for b6 being Point of b1 st b6 in b3 holds
b5 . b6 = (b2 .|. b6) * b6 ) holds
b2 .|. (setopfunc b3,the carrier of b1,the carrier of b1,b5,the add of b1) = setopfunc b3,the carrier of b1,REAL ,b4,addreal
proof end;

theorem Th12: :: BHSP_5:12
for b1 being RealUnitarySpace st the add of b1 is commutative & the add of b1 is associative & the add of b1 has_a_unity holds
for b2 being Point of b1
for b3 being finite OrthonormalFamily of b1 st not b3 is empty holds
for b4 being Function of the carrier of b1,the carrier of b1 st b3 c= dom b4 & ( for b5 being Point of b1 st b5 in b3 holds
b4 . b5 = (b2 .|. b5) * b5 ) holds
for b5 being Function of the carrier of b1, REAL st b3 c= dom b5 & ( for b6 being Point of b1 st b6 in b3 holds
b5 . b6 = (b2 .|. b6) ^2 ) holds
(setopfunc b3,the carrier of b1,the carrier of b1,b4,the add of b1) .|. (setopfunc b3,the carrier of b1,the carrier of b1,b4,the add of b1) = setopfunc b3,the carrier of b1,REAL ,b5,addreal
proof end;

theorem Th13: :: BHSP_5:13
for b1 being RealUnitarySpace st the add of b1 is commutative & the add of b1 is associative & the add of b1 has_a_unity holds
for b2 being Point of b1
for b3 being finite OrthonormalFamily of b1 st not b3 is empty holds
for b4 being Function of the carrier of b1, REAL st b3 c= dom b4 & ( for b5 being Point of b1 st b5 in b3 holds
b4 . b5 = (b2 .|. b5) ^2 ) holds
setopfunc b3,the carrier of b1,REAL ,b4,addreal <= ||.b2.|| ^2
proof end;

theorem Th14: :: BHSP_5:14
for b1, b2 being non empty set
for b3 being BinOp of b1 st b3 is commutative & b3 is associative & b3 has_a_unity holds
for b4, b5 being finite Subset of b2 st b4 misses b5 holds
for b6 being Function of b2,b1 st b4 c= dom b6 & b5 c= dom b6 holds
for b7 being finite Subset of b2 st b7 = b4 \/ b5 holds
setopfunc b7,b2,b1,b6,b3 = b3 . (setopfunc b4,b2,b1,b6,b3),(setopfunc b5,b2,b1,b6,b3)
proof end;