:: Concatenation of Finite Sequences
:: by Rafa{\l} Ziobro
::
:: Copyright (c) 2019 Association of Mizar Users

registration
let a be Real;
let b be non negative Real;
cluster a -' (a + b) -> zero ;
coherence
a -' (a + b) is zero
proof end;
reduce (a + b) -' a to b;
reducibility
(a + b) -' a = b
proof end;
end;

registration
let n, m be Nat;
identify min (m,n) with n /\ m;
correctness
compatibility
min (m,n) = n /\ m
;
proof end;
identify n /\ m with min (m,n);
correctness
compatibility
n /\ m = min (m,n)
;
;
identify n \/ m with max (m,n);
correctness
compatibility
n \/ m = max (m,n)
;
proof end;
end;

registration
let n, m be non negative Real;
reduce min ((n + m),n) to n;
reducibility
min ((n + m),n) = n
proof end;
reduce max ((n + m),n) to n + m;
reducibility
max ((n + m),n) = n + m
proof end;
end;

theorem CNM: :: RVSUM_4:1
for f being Relation
for n, m being Nat holds (f | (n + m)) | n = f | n
proof end;

theorem CNX: :: RVSUM_4:2
for f being Function
for n being Nat
for m being non zero Nat holds (f | (n + m)) . n = f . n
proof end;

registration
let D be non empty set ;
let x be sequence of D;
let n be Nat;
reduce dom (x | n) to n;
reducibility
dom (x | n) = n
proof end;
coherence
( x | n is finite & x | n is Sequence-like )
;
cluster x | n -> n -element ;
coherence
x | n is n -element
proof end;
end;

theorem MFG: :: RVSUM_4:3
for f, g being complex-valued Function
for X being set holds (f (#) g) | X = (f | X) (#) (g | X)
proof end;

registration
let D be non empty set ;
let f, g be sequence of D;
coherence
f +* g is Sequence-like
by FUNCT_2:def 1;
end;

registration
let f be constant Complex_Sequence;
let n be Nat;
cluster f ^\ n -> constant ;
coherence
f ^\ n is constant
;
end;

registration
existence
ex b1 being Complex_Sequence st b1 is empty-yielding
proof end;
existence
ex b1 being Real_Sequence st b1 is empty-yielding
proof end;
coherence
for b1 being Complex_Sequence st b1 is empty-yielding holds
b1 is natural-valued
proof end;
existence
ex b1 being Complex_Sequence st
( b1 is constant & b1 is real-valued )
proof end;
end;

:: seq <-> FinSeq in DBLSEQ_2:49 -- etc.
theorem :: RVSUM_4:4
for s being Real_Sequence
for n being Nat holds () . n = Sum (s | (Segm (n + 1))) by AFINSQ_2:56;

definition
let c be Complex;
coherence
proof end;
end;

:: deftheorem defines seq_const RVSUM_4:def 1 :
for c being Complex holds seq_const c = NAT --> c;

registration
let c be Complex;
let n be Nat;
reduce () . n to c;
reducibility
() . n = c
by ;
end;

theorem SFG: :: RVSUM_4:5
for f, g being complex-valued Function
for X being set holds (f + g) | X = (f | X) + (g | X)
proof end;

registration
let f be 1 -element FinSequence;
reduce <*(f . 1)*> to f;
reducibility
<*(f . 1)*> = f
proof end;
end;

registration
let f be 2 -element FinSequence;
reduce <*(f . 1),(f . 2)*> to f;
reducibility
<*(f . 1),(f . 2)*> = f
proof end;
end;

registration
let f be 3 -element FinSequence;
reduce <*(f . 1),(f . 2),(f . 3)*> to f;
reducibility
<*(f . 1),(f . 2),(f . 3)*> = f
proof end;
end;

theorem :: RVSUM_4:6
for f being complex-valued FinSequence holds Sum f = (f . 1) + (Sum (f /^ 1))
proof end;

theorem FIF: :: RVSUM_4:7
for f being non empty complex-valued FinSequence holds Product f = (f . 1) * (Product (f /^ 1))
proof end;

LmFNK: for n being Nat
for f being b1 + 1 -element FinSequence holds f = (f | n) ^ <*(f . (n + 1))*>

proof end;

theorem FNK: :: RVSUM_4:8
for n being Nat
for m being non zero Nat
for f being b1 + b2 -element FinSequence holds f | (n + 1) = (f | n) ^ <*(f . (n + 1))*>
proof end;

theorem PAP: :: RVSUM_4:9
for f being complex-valued FinSequence
for n being Nat holds Product f = (Product (f | n)) * (Product (f /^ n))
proof end;

theorem FAF: :: RVSUM_4:10
for f, g being complex-valued FinSequence holds Product (f ^ g) = () * ()
proof end;

:: FINSOP_1 -- +*
definition
let s be Complex_Sequence;
func Partial_Product s -> Complex_Sequence means :PP: :: RVSUM_4:def 2
( it . 0 = s . 0 & ( for n being Nat holds it . (n + 1) = (it . n) * (s . (n + 1)) ) );
existence
ex b1 being Complex_Sequence st
( b1 . 0 = s . 0 & ( for n being Nat holds b1 . (n + 1) = (b1 . n) * (s . (n + 1)) ) )
proof end;
uniqueness
for b1, b2 being Complex_Sequence st b1 . 0 = s . 0 & ( for n being Nat holds b1 . (n + 1) = (b1 . n) * (s . (n + 1)) ) & b2 . 0 = s . 0 & ( for n being Nat holds b2 . (n + 1) = (b2 . n) * (s . (n + 1)) ) holds
b1 = b2
proof end;
end;

:: deftheorem PP defines Partial_Product RVSUM_4:def 2 :
for s, b2 being Complex_Sequence holds
( b2 = Partial_Product s iff ( b2 . 0 = s . 0 & ( for n being Nat holds b2 . (n + 1) = (b2 . n) * (s . (n + 1)) ) ) );

theorem PPN: :: RVSUM_4:11
for f being Complex_Sequence
for n being Nat st f . n = 0 holds
() . n = 0
proof end;

theorem PPM: :: RVSUM_4:12
for f being Complex_Sequence
for n, m being Nat st f . n = 0 holds
() . (n + m) = 0
proof end;

definition
let c be Complex;
let n be non zero Nat;
redefine func c |^ n equals :: RVSUM_4:def 3
() . (n - 1);
compatibility
for b1 being set holds
( b1 = c |^ n iff b1 = () . (n - 1) )
proof end;
end;

:: deftheorem defines |^ RVSUM_4:def 3 :
for c being Complex
for n being non zero Nat holds c |^ n = () . (n - 1);

theorem COMSEQ324: :: RVSUM_4:13
for n being Nat holds . n = 0
proof end;

registration
let k be Nat;
reduce . k to 0 ;
reducibility
. k = 0
proof end;
end;

registration
coherence
for b1 being Complex_Sequence st b1 is empty-yielding holds
b1 is absolutely_summable
proof end;
coherence
for b1 being Real_Sequence st b1 is empty-yielding holds
b1 is absolutely_summable
proof end;
end;

registration
reducibility
proof end;
reducibility by ;
coherence
for b1 being Complex_Sequence holds b1 is Sequence-like
by COMSEQ_1:1;
existence
ex b1 being sequence of COMPLEX st b1 is summable
proof end;
end;

registration
let seq be empty-yielding Complex_Sequence;
cluster Sum seq -> zero ;
coherence
Sum seq is zero
proof end;
end;

registration
let seq be empty-yielding Real_Sequence;
cluster Sum seq -> zero ;
coherence
Sum seq is zero
proof end;
end;

registration
let c be Complex;
coherence ;
reduce Sum <%c%> to c;
reducibility
Sum <%c%> = c
by AFINSQ_2:53;
end;

registration
let n be Nat;
existence
ex b1 being natural-valued XFinSequence st b1 is n -element
proof end;
let k be object ;
cluster n --> k -> n -element ;
coherence
n --> k is n -element
proof end;
end;

registration
let n be Nat;
existence
ex b1 being XFinSequence st b1 is n -element
proof end;
let f be n -element XFinSequence;
reduce f | n to f;
reducibility
f | n = f
proof end;
end;

registration
let n, m be Nat;
let f be n -element XFinSequence;
reduce f | (n + m) to f;
reducibility
f | (n + m) = f
proof end;
end;

registration
let f be 1 -element XFinSequence;
reduce <%(f . 0)%> to f;
reducibility
<%(f . 0)%> = f
proof end;
end;

registration
let f be 2 -element XFinSequence;
reduce <%(f . 0),(f . 1)%> to f;
reducibility
<%(f . 0),(f . 1)%> = f
proof end;
end;

registration
let f be 3 -element XFinSequence;
reduce <%(f . 0),(f . 1),(f . 2)%> to f;
reducibility
<%(f . 0),(f . 1),(f . 2)%> = f
proof end;
end;

:: Segm
theorem LmA: :: RVSUM_4:14
for n, k being Nat st k in Segm (n + 1) holds
n - k is Nat
proof end;

theorem :: RVSUM_4:15
for a, b being Complex
for n, k being Nat st k in Segm (n + 1) holds
ex c being object ex l being Nat st
( l = n - k & c = (a |^ l) * (b |^ k) )
proof end;

:: Extending XFinSequence
definition
let f be complex-valued XFinSequence;
let seq be Complex_Sequence;
func f ^ seq -> Complex_Sequence equals :: RVSUM_4:def 4
f \/ (Shift (seq,(len f)));
correctness
coherence
f \/ (Shift (seq,(len f))) is Complex_Sequence
;
proof end;
end;

:: deftheorem defines ^ RVSUM_4:def 4 :
for f being complex-valued XFinSequence
for seq being Complex_Sequence holds f ^ seq = f \/ (Shift (seq,(len f)));

definition
let seq be Complex_Sequence;
let f be Function;
func seq ^ f -> sequence of COMPLEX equals :: RVSUM_4:def 5
seq;
coherence
seq is sequence of COMPLEX
;
end;

:: deftheorem defines ^ RVSUM_4:def 5 :
for seq being Complex_Sequence
for f being Function holds seq ^ f = seq;

theorem RSC: :: RVSUM_4:16
for x being object holds
( x is real-valued Complex_Sequence iff x is Real_Sequence )
proof end;

theorem :: RVSUM_4:17
for rseq being Real_Sequence
for cseq being Complex_Sequence st cseq = rseq holds
Partial_Product rseq = Partial_Product cseq
proof end;

definition
let f be complex-valued XFinSequence;
let seq be Real_Sequence;
func f ^ seq -> Complex_Sequence equals :: RVSUM_4:def 6
f \/ (Shift (seq,(len f)));
correctness
coherence
f \/ (Shift (seq,(len f))) is Complex_Sequence
;
proof end;
end;

:: deftheorem defines ^ RVSUM_4:def 6 :
for f being complex-valued XFinSequence
for seq being Real_Sequence holds f ^ seq = f \/ (Shift (seq,(len f)));

theorem :: RVSUM_4:18
for rseq being Real_Sequence holds () ^ rseq is real-valued Complex_Sequence ;

:: may be used for conversion of Real_Sequences into Complex_Sequences
definition
let f be Real_Sequence;
let g be Function;
func f ^ g -> real-valued sequence of COMPLEX equals :: RVSUM_4:def 7
f;
correctness
coherence ;
by RSC;
end;

:: deftheorem defines ^ RVSUM_4:def 7 :
for f being Real_Sequence
for g being Function holds f ^ g = f;

registration
let f be complex-valued XFinSequence;
let seq be Complex_Sequence;
reduce (f ^ seq) | (dom f) to f;
reducibility
(f ^ seq) | (dom f) = f
proof end;
end;

registration
let f be complex-valued XFinSequence;
let seq be Real_Sequence;
reduce (f ^ seq) | (dom f) to f;
reducibility
(f ^ seq) | (dom f) = f
proof end;
end;

theorem SCX: :: RVSUM_4:19
for f being complex-valued XFinSequence
for x being Nat holds (f ^ ()) . x = f . x
proof end;

theorem :: RVSUM_4:20
for f being Real_Sequence holds f ^ f is real-valued Complex_Sequence ;

registration
let f be real-valued Complex_Sequence;
coherence
proof end;
reduce Re f to f;
reducibility
Re f = f
proof end;
end;

registration
existence
ex b1 being Real_Sequence st b1 is empty-yielding
proof end;
coherence
for b1 being Real_Sequence holds b1 is Sequence-like
by SEQ_1:1;
end;

registration
let r be Real;
cluster Re (r * <i>) -> zero ;
coherence
Re (r * <i>) is zero
by COMPLEX1:10;
reduce Im (r * <i>) to r;
reducibility
Im (r * <i>) = r
by COMPLEX1:11;
end;

registration
let f be complex-valued XFinSequence;
coherence
( Re f is real-valued & Re f is finite & Re f is Sequence-like )
proof end;
coherence
( Im f is real-valued & Im f is finite & Im f is Sequence-like )
proof end;
cluster Re f -> len f -element ;
coherence
Re f is len f -element
proof end;
cluster Im f -> len f -element ;
coherence
Im f is len f -element
proof end;
end;

registration
let f be complex-valued FinSequence;
coherence
( Re f is real-valued & Re f is FinSequence-like )
proof end;
coherence
( Im f is real-valued & Im f is FinSequence-like )
proof end;
end;

registration
let f be complex-valued Function;
reduce Re (Re f) to Re f;
reducibility
Re (Re f) = Re f
proof end;
reduce Re (Im f) to Im f;
reducibility
Re (Im f) = Im f
proof end;
cluster Im (Re f) -> empty-yielding ;
coherence
Im (Re f) is empty-yielding
proof end;
cluster Im (Im f) -> empty-yielding ;
coherence
Im (Im f) is empty-yielding
proof end;
reduce Re ((Re f) + (<i> (#) (Im f))) to Re f;
reducibility
Re ((Re f) + (<i> (#) (Im f))) = Re f
proof end;
reduce Im ((Re f) + (<i> (#) (Im f))) to Im f;
reducibility
Im ((Re f) + (<i> (#) (Im f))) = Im f
proof end;
reduce (Re f) + (<i> (#) (Im f)) to f;
reducibility
(Re f) + (<i> (#) (Im f)) = f
proof end;
end;

registration
let n be Nat;
existence
ex b1 being finite Function st b1 is n -element
proof end;
end;

registration
let f be finite complex-valued Sequence;
let n be Nat;
cluster Shift (f,n) -> finite ;
coherence
Shift (f,n) is finite
;
cluster Shift (f,n) -> len f -element ;
coherence
Shift (f,n) is len f -element
proof end;
end;

registration
coherence ;
end;

definition
let f be complex-valued XFinSequence;
func Sequel f -> Complex_Sequence equals :: RVSUM_4:def 8
() +* f;
coherence
() +* f is Complex_Sequence
proof end;
end;

:: deftheorem defines Sequel RVSUM_4:def 8 :
for f being complex-valued XFinSequence holds Sequel f = () +* f;

theorem SFX: :: RVSUM_4:21
for f being complex-valued XFinSequence
for x being Nat holds () . x = f . x
proof end;

theorem :: RVSUM_4:22
for f being complex-valued XFinSequence holds Sequel f = f ^ ()
proof end;

theorem :: RVSUM_4:23
for seq being Complex_Sequence holds seq = (Re seq) + (<i> (#) (Im seq)) ;

theorem RSF: :: RVSUM_4:24
for f being complex-valued XFinSequence holds Re () = Sequel (Re f)
proof end;

theorem ISF: :: RVSUM_4:25
for f being complex-valued XFinSequence holds Im () = Sequel (Im f)
proof end;

theorem :: RVSUM_4:26
for c being Complex holds 0 (#) () = NAT --> 0
proof end;

theorem FIC: :: RVSUM_4:27
for seq being Complex_Sequence
for x being Nat st ( for k being Nat st k >= x holds
seq . k = 0 ) holds
seq is summable
proof end;

theorem :: RVSUM_4:28
for seq being Real_Sequence
for x being Nat st ( for k being Nat st k >= x holds
seq . k = 0 ) holds
seq is summable
proof end;

registration
let f be complex-valued XFinSequence;
coherence
proof end;
end;

:: Concatenation of (X)FinSequences
definition
let f be XFinSequence;
let g be FinSequence;
func f ^ g -> XFinSequence means :Def1: :: RVSUM_4:def 9
( dom it = (len f) + (len g) & ( for k being Nat st k in dom f holds
it . k = f . k ) & ( for k being Nat st k in dom g holds
it . (((len f) + k) - 1) = g . k ) );
existence
ex b1 being XFinSequence st
( dom b1 = (len f) + (len g) & ( for k being Nat st k in dom f holds
b1 . k = f . k ) & ( for k being Nat st k in dom g holds
b1 . (((len f) + k) - 1) = g . k ) )
proof end;
uniqueness
for b1, b2 being XFinSequence st dom b1 = (len f) + (len g) & ( for k being Nat st k in dom f holds
b1 . k = f . k ) & ( for k being Nat st k in dom g holds
b1 . (((len f) + k) - 1) = g . k ) & dom b2 = (len f) + (len g) & ( for k being Nat st k in dom f holds
b2 . k = f . k ) & ( for k being Nat st k in dom g holds
b2 . (((len f) + k) - 1) = g . k ) holds
b1 = b2
proof end;
end;

:: deftheorem Def1 defines ^ RVSUM_4:def 9 :
for f being XFinSequence
for g being FinSequence
for b3 being XFinSequence holds
( b3 = f ^ g iff ( dom b3 = (len f) + (len g) & ( for k being Nat st k in dom f holds
b3 . k = f . k ) & ( for k being Nat st k in dom g holds
b3 . (((len f) + k) - 1) = g . k ) ) );

definition
let f be FinSequence;
let g be XFinSequence;
func f ^ g -> FinSequence means :Def2: :: RVSUM_4:def 10
( dom it = Seg ((len f) + (len g)) & ( for k being Nat st k in dom f holds
it . k = f . k ) & ( for k being Nat st k in dom g holds
it . (((len f) + k) + 1) = g . k ) );
existence
ex b1 being FinSequence st
( dom b1 = Seg ((len f) + (len g)) & ( for k being Nat st k in dom f holds
b1 . k = f . k ) & ( for k being Nat st k in dom g holds
b1 . (((len f) + k) + 1) = g . k ) )
proof end;
uniqueness
for b1, b2 being FinSequence st dom b1 = Seg ((len f) + (len g)) & ( for k being Nat st k in dom f holds
b1 . k = f . k ) & ( for k being Nat st k in dom g holds
b1 . (((len f) + k) + 1) = g . k ) & dom b2 = Seg ((len f) + (len g)) & ( for k being Nat st k in dom f holds
b2 . k = f . k ) & ( for k being Nat st k in dom g holds
b2 . (((len f) + k) + 1) = g . k ) holds
b1 = b2
proof end;
end;

:: deftheorem Def2 defines ^ RVSUM_4:def 10 :
for f being FinSequence
for g being XFinSequence
for b3 being FinSequence holds
( b3 = f ^ g iff ( dom b3 = Seg ((len f) + (len g)) & ( for k being Nat st k in dom f holds
b3 . k = f . k ) & ( for k being Nat st k in dom g holds
b3 . (((len f) + k) + 1) = g . k ) ) );

theorem XL1: :: RVSUM_4:29
for f being XFinSequence
for g being FinSequence holds
( len (f ^ g) = (len f) + (len g) & len (g ^ f) = (len f) + (len g) )
proof end;

registration
let n, m be Nat;
let f be n -element XFinSequence;
let g be m -element FinSequence;
cluster f ^ g -> n + m -element ;
coherence
f ^ g is n + m -element
proof end;
cluster g ^ f -> n + m -element ;
coherence
g ^ f is n + m -element
proof end;
end;

theorem XDF: :: RVSUM_4:30
for f being XFinSequence
for g being FinSequence
for x being Nat holds
( x in dom (f ^ g) iff ( x in dom f or (x + 1) - (len f) in dom g ) )
proof end;

theorem FDX: :: RVSUM_4:31
for f being FinSequence
for g being XFinSequence
for x being Nat holds
( x in dom (f ^ g) iff ( x in dom f or x - ((len f) + 1) in dom g ) )
proof end;

theorem FRX: :: RVSUM_4:32
for f being FinSequence
for g being XFinSequence holds
( rng (f ^ g) = (rng f) \/ (rng g) & rng (g ^ f) = (rng f) \/ (rng g) )
proof end;

theorem :: RVSUM_4:33
for f being non empty XFinSequence
for g being FinSequence holds dom (f \/ (Shift (g,((len f) - 1)))) = Segm ((len f) + (len g))
proof end;

theorem :: RVSUM_4:34
for f being FinSequence
for g being XFinSequence holds dom (f \/ (Shift (g,((len f) + 1)))) = Seg ((len f) + (len g))
proof end;

registration
let f be complex-valued FinSequence;
coherence
proof end;
end;

registration
let f be complex-valued XFinSequence;
coherence
proof end;
end;

registration
let f be XFinSequence;
let g be FinSequence;
reduce (f ^ g) | (len f) to f;
reducibility
(f ^ g) | (len f) = f
proof end;
reduce (g ^ f) | (len g) to g;
reducibility
(g ^ f) | (len g) = g
proof end;
end;

theorem :: RVSUM_4:35
for D being set
for f being XFinSequence
for g being FinSequence of D holds (f ^ g) /^ (len f) = FS2XFS g
proof end;

theorem :: RVSUM_4:36
for f being XFinSequence holds f is XFinSequence of (rng f) \/ {1} by ;

theorem :: RVSUM_4:37
for D being set
for f being FinSequence
for g being XFinSequence of D holds (f ^ g) /^ (len f) = XFS2FS g
proof end;

definition
let D be set ;
let f be XFinSequence of D;
redefine func XFS2FS f equals :: RVSUM_4:def 11
(<*> D) ^ f;
compatibility
for b1 being FinSequence of D holds
( b1 = XFS2FS f iff b1 = (<*> D) ^ f )
proof end;
end;

:: deftheorem defines XFS2FS RVSUM_4:def 11 :
for D being set
for f being XFinSequence of D holds XFS2FS f = (<*> D) ^ f;

theorem DSS: :: RVSUM_4:38
for D being set
for f being XFinSequence of D holds dom (Shift (f,1)) = Seg (len f)
proof end;

definition
let D be set ;
let f be XFinSequence of D;
redefine func XFS2FS f equals :: RVSUM_4:def 12
Shift (f,1);
compatibility
for b1 being FinSequence of D holds
( b1 = XFS2FS f iff b1 = Shift (f,1) )
proof end;
end;

:: deftheorem defines XFS2FS RVSUM_4:def 12 :
for D being set
for f being XFinSequence of D holds XFS2FS f = Shift (f,1);

definition
let D be set ;
let f be FinSequence of D;
redefine func FS2XFS f equals :: RVSUM_4:def 13
(<%> D) ^ f;
compatibility
for b1 being set holds
( b1 = FS2XFS f iff b1 = (<%> D) ^ f )
proof end;
end;

:: deftheorem defines FS2XFS RVSUM_4:def 13 :
for D being set
for f being FinSequence of D holds FS2XFS f = (<%> D) ^ f;

theorem XFX: :: RVSUM_4:39
for D being set
for f, g being XFinSequence of D holds f ^ g = f ^ ()
proof end;

theorem FXF: :: RVSUM_4:40
for D being set
for f, g being FinSequence of D holds f ^ g = f ^ ()
proof end;

registration
let f be XFinSequence of REAL ;
reduce () | (dom f) to f;
reducibility
() | (dom f) = f
;
cluster Shift (f,1) -> FinSequence-like ;
coherence
Shift (f,1) is FinSequence-like
proof end;
cluster () ^\ (dom f) -> empty-yielding ;
coherence
() ^\ (dom f) is empty-yielding
proof end;
end;

theorem FFX: :: RVSUM_4:41
for D being set
for f being FinSequence of D
for g being XFinSequence of D holds f ^ g = f ^ ()
proof end;

theorem XFF: :: RVSUM_4:42
for D being set
for f being XFinSequence of D
for g being FinSequence of D holds f ^ g = f ^ ()
proof end;

theorem SFF: :: RVSUM_4:43
for D being set
for f, g being FinSequence of D holds FS2XFS (f ^ g) = () ^ ()
proof end;

definition
let D be set ;
let f be FinSequence of D;
let g be XFinSequence of D;
:: original: ^
redefine func f ^ g -> FinSequence of D;
coherence
f ^ g is FinSequence of D
proof end;
end;

theorem :: RVSUM_4:44
for D being set
for f being FinSequence of D
for g being XFinSequence of D holds FS2XFS (f ^ g) = () ^ g
proof end;

theorem SXX: :: RVSUM_4:45
for D being set
for f, g being XFinSequence of D holds XFS2FS (f ^ g) = () ^ ()
proof end;

definition
let D be set ;
let f be XFinSequence of D;
let g be FinSequence of D;
:: original: ^
redefine func f ^ g -> XFinSequence of D;
coherence
f ^ g is XFinSequence of D
proof end;
end;

theorem SSX: :: RVSUM_4:46
for D being set
for f being XFinSequence of D
for g being FinSequence of D holds XFS2FS (f ^ g) = () ^ g
proof end;

theorem :: RVSUM_4:47
for D being set
for f, g being XFinSequence of D
for h being FinSequence of D holds
( (f ^ g) ^ h = f ^ (g ^ h) & (f ^ h) ^ g = f ^ (h ^ g) & (h ^ f) ^ g = h ^ (f ^ g) )
proof end;

:: Sums
theorem :: RVSUM_4:48
for f being complex-valued XFinSequence holds Sum (f | 1) = f . 0
proof end;

registration
let n, m be Nat;
let f be n + m -element XFinSequence;
cluster f | n -> n -element ;
coherence
f | n is n -element
proof end;
end;

registration
let n be Nat;
let p be n -element complex-valued XFinSequence;
cluster - p -> n -element ;
coherence
- p is n -element
proof end;
cluster p " -> n -element ;
coherence
p " is n -element
proof end;
cluster p ^2 -> n -element ;
coherence
p ^2 is n -element
proof end;
cluster |.p.| -> n -element ;
coherence
abs p is n -element
proof end;
cluster Rev p -> n -element ;
coherence
Rev p is n -element
proof end;
let m be Nat;
let q be n + m -element complex-valued XFinSequence;
reduce (dom p) /\ (dom q) to dom p;
reducibility
(dom p) /\ (dom q) = dom p
proof end;
cluster p + q -> n -element ;
coherence
p + q is n -element
proof end;
cluster p - q -> n -element ;
coherence
p - q is n -element
;
cluster p (#) q -> n -element ;
coherence
p (#) q is n -element
proof end;
cluster p /" q -> n -element ;
coherence
p /" q is n -element
;
end;

registration
let n be Nat;
let p, q be n -element complex-valued XFinSequence;
cluster p + q -> n -element ;
coherence
p + q is n -element
proof end;
cluster p - q -> n -element ;
coherence
p - q is n -element
;
cluster p (#) q -> n -element ;
coherence
p (#) q is n -element
proof end;
cluster p /" q -> n -element ;
coherence
p /" q is n -element
;
end;

theorem SPP: :: RVSUM_4:49
for n being Nat
for f1, f2 being b1 -element complex-valued XFinSequence holds Sum (f1 + f2) = (Sum f1) + (Sum f2)
proof end;

theorem XCF: :: RVSUM_4:50
for c being Complex holds XFS2FS <%c%> = <*c*>
proof end;

definition
let f be XFinSequence;
correctness
coherence ;
;
end;

:: deftheorem defines XProduct RVSUM_4:def 14 :
for f being XFinSequence holds XProduct f = multcomplex "**" f;

theorem PFO: :: RVSUM_4:51
for f being empty XFinSequence holds XProduct f = 1
proof end;

registration
let c be Complex;
reduce XProduct <%c%> to c;
reducibility
proof end;
end;

theorem A265: :: RVSUM_4:52
for n being Nat
for f being complex-valued XFinSequence st n in dom f holds
(XProduct (f | n)) * (f . n) = XProduct (f | (n + 1))
proof end;

theorem C265: :: RVSUM_4:53
for n being Nat
for f being Complex_Sequence holds (XProduct (f | n)) * (f . n) = XProduct (f | (n + 1))
proof end;

theorem :: RVSUM_4:54
for f being non empty complex-valued XFinSequence holds XProduct (f | 1) = f . 0
proof end;

theorem :: RVSUM_4:55
for n being Nat
for f1, f2 being b1 -element complex-valued XFinSequence holds XProduct (f1 (#) f2) = (XProduct f1) * (XProduct f2)
proof end;

theorem :: RVSUM_4:56
for f being Complex_Sequence
for n being Nat holds XProduct (f | (n + 1)) = () . n
proof end;

theorem XPF: :: RVSUM_4:57
for f being complex-valued XFinSequence holds Product () = XProduct f
proof end;

theorem :: RVSUM_4:58
for f being FinSequence of COMPLEX holds XProduct () = Product f
proof end;

theorem :: RVSUM_4:59
for f being XFinSequence of COMPLEX
for g being FinSequence of COMPLEX holds
( XProduct (f ^ g) = () * () & Product (g ^ f) = () * () )
proof end;

theorem XSF: :: RVSUM_4:60
for f being XFinSequence of REAL holds Sum () = Sum f
proof end;

theorem RSI: :: RVSUM_4:61
for f being complex-valued XFinSequence holds Sum f = (Sum (Re f)) + (<i> * (Sum (Im f)))
proof end;

theorem RSH: :: RVSUM_4:62
for f being complex-valued Sequence
for n being Nat holds
( Re (Shift (f,n)) = Shift ((Re f),n) & Im (Shift (f,n)) = Shift ((Im f),n) )
proof end;

theorem :: RVSUM_4:63
for f being complex-valued XFinSequence holds
( XFS2FS (Re f) = Re () & XFS2FS (Im f) = Im () ) by RSH;

theorem XSS: :: RVSUM_4:64
for f being complex-valued XFinSequence holds Sum () = Sum f
proof end;

theorem FSS: :: RVSUM_4:65
for f being FinSequence of COMPLEX holds Sum () = Sum f
proof end;

theorem SSF: :: RVSUM_4:66
for f being real-valued XFinSequence holds Sum f = Sum ()
proof end;

registration
existence
ex b1 being real-valued Complex_Sequence st b1 is summable
proof end;
end;

definition
let f be summable Complex_Sequence;
:: original: Re
redefine func Re f -> real-valued summable Complex_Sequence;
coherence
proof end;
:: original: Im
redefine func Im f -> real-valued summable Complex_Sequence;
coherence
proof end;
end;

theorem :: RVSUM_4:67
for f being complex-valued XFinSequence holds Sum f = Sum ()
proof end;

theorem :: RVSUM_4:68
for f being XFinSequence of COMPLEX
for g being FinSequence of COMPLEX holds
( Sum (f ^ g) = (Sum f) + (Sum g) & Sum (g ^ f) = (Sum g) + (Sum f) )
proof end;