let p be FinSequence; :: thesis: ( p <> {} implies ex q being FinSequence ex x being object st p = q ^ <*x*> )
assume p <> {} ; :: thesis: ex q being FinSequence ex x being object st p = q ^ <*x*>
then consider n being Nat such that
A1: len p = n + 1 by NAT_1:6;
reconsider n = n as Element of NAT by ORDINAL1:def 12;
reconsider q = p | (Seg n) as FinSequence by Th15;
take q ; :: thesis: ex x being object st p = q ^ <*x*>
take p . (len p) ; :: thesis: p = q ^ <*(p . (len p))*>
A2: dom q = (dom p) /\ (Seg n) by RELAT_1:61
.= (Seg (len p)) /\ (Seg n) by Def3 ;
Seg n c= Seg (len p) by Th5, A1, NAT_1:11;
then A3: dom q = Seg n by A2, XBOOLE_1:28;
A4: dom (q ^ <*(p . (len p))*>) = Seg (len (q ^ <*(p . (len p))*>)) by Def3
.= Seg ((len q) + (len <*(p . (len p))*>)) by Th22
.= Seg ((len q) + 1) by Th39
.= Seg (len p) by A1, A3, Def3
.= dom p by Def3 ;
for x being object st x in dom p holds
p . x = (q ^ <*(p . (len p))*>) . x
proof
let x be object ; :: thesis: ( x in dom p implies p . x = (q ^ <*(p . (len p))*>) . x )
assume A5: x in dom p ; :: thesis: p . x = (q ^ <*(p . (len p))*>) . x
then reconsider k = x as Element of NAT ;
k in Seg (n + 1) by A1, A5, Def3;
then A6: k in (Seg n) \/ {(n + 1)} by Th9;
A7: now :: thesis: ( k in Seg n implies p . k = (q ^ <*(p . (len p))*>) . k )
assume A8: k in Seg n ; :: thesis: p . k = (q ^ <*(p . (len p))*>) . k
hence p . k = q . k by A3, FUNCT_1:47
.= (q ^ <*(p . (len p))*>) . k by A3, A8, Def7 ;
:: thesis: verum
end;
now :: thesis: ( k in {(n + 1)} implies (q ^ <*(p . (len p))*>) . k = p . k )
assume A9: k in {(n + 1)} ; :: thesis: (q ^ <*(p . (len p))*>) . k = p . k
1 in Seg 1 ;
then A10: 1 in dom <*(p . (len p))*> by Def8;
thus (q ^ <*(p . (len p))*>) . k = (q ^ <*(p . (len p))*>) . (n + 1) by A9, TARSKI:def 1
.= (q ^ <*(p . (len p))*>) . ((len q) + 1) by A3, Def3
.= <*(p . (len p))*> . 1 by A10, Def7
.= p . k by A1, A9, TARSKI:def 1 ; :: thesis: verum
end;
hence p . x = (q ^ <*(p . (len p))*>) . x by A6, A7, XBOOLE_0:def 3; :: thesis: verum
end;
hence q ^ <*(p . (len p))*> = p by A4; :: thesis: verum