let p be FinSequence; ProperPrefixes p, dom p are_equipotent
defpred S1[ object , object ] means ex w being FinSequence st
( $1 = w & $2 = (len w) + 1 );
A1:
for x being object st x in ProperPrefixes p holds
ex y being object st S1[x,y]
consider f being Function such that
A3:
dom f = ProperPrefixes p
and
A4:
for x being object st x in ProperPrefixes p holds
S1[x,f . x]
from CLASSES1:sch 1(A1);
take
f
; WELLORD2:def 4 ( f is one-to-one & dom f = ProperPrefixes p & rng f = dom p )
thus
f is one-to-one
( dom f = ProperPrefixes p & rng f = dom p )
thus
dom f = ProperPrefixes p
by A3; rng f = dom p
thus
rng f c= dom p
XBOOLE_0:def 10 dom p is_a_prefix_of rng f
let x be object ; TARSKI:def 3 ( not x in dom p or x in rng f )
assume A11:
x in dom p
; x in rng f
then A12:
x in Seg (len p)
by FINSEQ_1:def 3;
reconsider n = x as Nat by A11;
A13:
1 <= n
by A12, FINSEQ_1:1;
A14:
n <= len p
by A12, FINSEQ_1:1;
consider m being Nat such that
A15:
n = 1 + m
by A13, NAT_1:10;
reconsider m = m as Nat ;
reconsider q = p | (Seg m) as FinSequence by FINSEQ_1:15;
A16:
m <= len p
by A14, A15, NAT_1:13;
A17:
m <> len p
by A14, A15, NAT_1:13;
A18:
len q = m
by A16, FINSEQ_1:17;
A19:
q is_a_prefix_of p
;
len q = m
by A16, FINSEQ_1:17;
then
q is_a_proper_prefix_of p
by A17, A19;
then A20:
q in ProperPrefixes p
by Th11;
then
ex r being FinSequence st
( q = r & f . q = (len r) + 1 )
by A4;
hence
x in rng f
by A3, A15, A18, A20, FUNCT_1:def 3; verum