let n be Element of NAT ; :: thesis: for p' being XFinSequence ex q' being XFinSequence st p' = (p' | n) ^ q'
let p' be XFinSequence; :: thesis: ex q' being XFinSequence st p' = (p' | n) ^ q'
now
per cases ( n > len p' or n <= len p' ) ;
suppose n > len p' ; :: thesis: ex q' being XFinSequence st p' = (p' | n) ^ q'
end;
suppose n <= len p' ; :: thesis: ex q' being XFinSequence st p' = (p' | n) ^ q'
then reconsider n1 = (len p') - n as Element of NAT by NAT_1:21;
defpred S1[ Nat] means for k being Element of NAT st k = (len p') - $1 holds
ex q' being XFinSequence st p' = (p' | k) ^ q';
A2: for m being Element of NAT st S1[m] holds
S1[m + 1]
proof
let m be Element of NAT ; :: thesis: ( S1[m] implies S1[m + 1] )
assume A3: S1[m] ; :: thesis: S1[m + 1]
let k be Element of NAT ; :: thesis: ( k = (len p') - (m + 1) implies ex q' being XFinSequence st p' = (p' | k) ^ q' )
assume A4: k = (len p') - (m + 1) ; :: thesis: ex q' being XFinSequence st p' = (p' | k) ^ q'
consider q' being XFinSequence such that
A5: p' = (p' | (k + 1)) ^ q' by A3, A4;
k <= k + 1 by NAT_1:11;
then k c= k + 1 by NAT_1:40;
then A6: (p' | (k + 1)) | k = p' | k by RELAT_1:103;
A7: p' | (k + 1) is XFinSequence of rng (p' | (k + 1)) by RELAT_1:def 19;
(len p') - m <= (len p') - 0 by XREAL_1:12;
then ( ( k + 1 = len p' & dom (p' | (len p')) = len p' ) or k + 1 < len p' ) by A4, RELAT_1:97, XXREAL_0:1;
then A8: len (p' | (k + 1)) = k + 1 by AFINSQ_1:14;
then rng (p' | (k + 1)) <> {} by RELAT_1:65;
then p' | (k + 1) = ((p' | (k + 1)) | k) ^ <%((p' | (k + 1)) . k)%> by A8, A7, CARD_FIN:43;
then p' = (p' | k) ^ (<%((p' | (k + 1)) . k)%> ^ q') by A5, A6, AFINSQ_1:30;
hence ex q' being XFinSequence st p' = (p' | k) ^ q' ; :: thesis: verum
end;
reconsider n2 = (len p') - n1 as Element of NAT ;
( p' | ((len p') - 0 ) = p' & p' ^ {} = p' ) by AFINSQ_1:32, RELAT_1:97;
then A9: S1[ 0 ] ;
for m being Element of NAT holds S1[m] from NAT_1:sch 1(A9, A2);
then ex q' being XFinSequence st p' = (p' | n2) ^ q' ;
hence ex q' being XFinSequence st p' = (p' | n) ^ q' ; :: thesis: verum
end;
end;
end;
hence ex q' being XFinSequence st p' = (p' | n) ^ q' ; :: thesis: verum