defpred S1[ Element of NAT , set , set ] means P1[$1,$2,$3];
A2:
for x being Element of NAT
for y being Element of F1() ex z being Element of F1() st S1[x,y,z]
by A1;
consider f being Function of [:NAT,F1():],F1() such that
A3:
for x being Element of NAT
for y being Element of F1() holds S1[x,y,f . (x,y)]
from BINOP_1:sch 3(A2);
defpred S2[ FinSequence] means ( $1 . 1 = F2() & ( for n being Element of NAT st n + 2 <= len $1 holds
$1 . (n + 2) = f . [n,($1 . (n + 1))] ) );
consider X being set such that
A4:
for x being set holds
( x in X iff ex p being FinSequence st
( p in F1() * & S2[p] & x = p ) )
from FINSEQ_1:sch 4();
set Y = union X;
A5:
for x being set st x in X holds
x in F1() *
A6:
for p, q being FinSequence st p in X & q in X & len p <= len q holds
p c= q
proof
let p,
q be
FinSequence;
( p in X & q in X & len p <= len q implies p c= q )
assume that A7:
p in X
and A8:
q in X
and A9:
len p <= len q
;
p c= q
A10:
ex
q9 being
FinSequence st
(
q9 in F1()
* &
q9 . 1
= F2() & ( for
n being
Element of
NAT st
n + 2
<= len q9 holds
q9 . (n + 2) = f . [n,(q9 . (n + 1))] ) &
q = q9 )
by A4, A8;
A11:
ex
p9 being
FinSequence st
(
p9 in F1()
* &
p9 . 1
= F2() & ( for
n being
Element of
NAT st
n + 2
<= len p9 holds
p9 . (n + 2) = f . [n,(p9 . (n + 1))] ) &
p = p9 )
by A4, A7;
A12:
for
n being
Element of
NAT st 1
<= n &
n <= len p holds
p . n = q . n
proof
defpred S3[
Nat]
means ( 1
<= $1 & $1
<= len p &
p . $1
<> q . $1 );
assume
ex
n being
Element of
NAT st
S3[
n]
;
contradiction
then A13:
ex
n being
Nat st
S3[
n]
;
consider k being
Nat such that A14:
(
S3[
k] & ( for
n being
Nat st
S3[
n] holds
k <= n ) )
from NAT_1:sch 5(A13);
k = 1
proof
0 <> k
by A14;
then consider n being
Nat such that A15:
k = n + 1
by NAT_1:6;
n + 0 <= n + 1
by XREAL_1:7;
then A16:
n <= len p
by A14, A15, XXREAL_0:2;
A17:
n + 0 < n + 1
by XREAL_1:6;
assume A18:
k <> 1
;
contradiction
then
1
< n + 1
by A14, A15, XXREAL_0:1;
then A19:
1
<= n
by NAT_1:13;
n <> 0
by A18, A15;
then consider m being
Nat such that A20:
n = m + 1
by NAT_1:6;
reconsider m =
m as
Element of
NAT by ORDINAL1:def 12;
A21:
m + 2
<= len q
by A9, A14, A15, A20, XXREAL_0:2;
p . k =
p . (m + (1 + 1))
by A15, A20
.=
f . [m,(p . n)]
by A11, A14, A15, A20
.=
f . [m,(q . (m + 1))]
by A14, A15, A19, A16, A17, A20
.=
q . k
by A10, A15, A20, A21
;
hence
contradiction
by A14;
verum
end;
hence
contradiction
by A11, A10, A14;
verum
end;
now let x be
set ;
( x in p implies x in q )assume
x in p
;
x in qthen consider n being
Nat such that A22:
n in dom p
and A23:
x = [n,(p . n)]
by FINSEQ_1:12;
A24:
n in Seg (len p)
by A22, FINSEQ_1:def 3;
then A25:
1
<= n
by FINSEQ_1:1;
A26:
n <= len p
by A24, FINSEQ_1:1;
then
n <= len q
by A9, XXREAL_0:2;
then
n in Seg (len q)
by A25, FINSEQ_1:1;
then A27:
n in dom q
by FINSEQ_1:def 3;
x = [n,(q . n)]
by A12, A22, A23, A25, A26;
hence
x in q
by A27, FUNCT_1:1;
verum end;
hence
p c= q
by TARSKI:def 3;
verum
end;
ex f being Function st f = union X
proof
defpred S3[
set ,
set ]
means [$1,$2] in union X;
A28:
for
x,
y,
z being
set st
S3[
x,
y] &
S3[
x,
z] holds
y = z
proof
let x,
y,
z be
set ;
( S3[x,y] & S3[x,z] implies y = z )
assume that A29:
[x,y] in union X
and A30:
[x,z] in union X
;
y = z
consider Z2 being
set such that A31:
[x,z] in Z2
and A32:
Z2 in X
by A30, TARSKI:def 4;
Z2 in F1()
*
by A5, A32;
then reconsider q =
Z2 as
FinSequence of
F1()
by FINSEQ_1:def 11;
consider Z1 being
set such that A33:
[x,y] in Z1
and A34:
Z1 in X
by A29, TARSKI:def 4;
Z1 in F1()
*
by A5, A34;
then reconsider p =
Z1 as
FinSequence of
F1()
by FINSEQ_1:def 11;
hence
y = z
by A35;
verum
end;
consider h being
Function such that A37:
for
x,
y being
set holds
(
[x,y] in h iff (
x in NAT &
S3[
x,
y] ) )
from FUNCT_1:sch 1(A28);
take
h
;
h = union X
A38:
for
x,
y being
set holds
(
[x,y] in h iff
[x,y] in union X )
for
x being
set holds
(
x in h iff
x in union X )
hence
h = union X
by TARSKI:1;
verum
end;
then consider g being Function such that
A46:
g = union X
;
A47:
for x being set st x in rng g holds
x in F1()
then
rng g c= F1()
by TARSKI:def 3;
then reconsider h = g as Function of (dom g),F1() by FUNCT_2:2;
A52:
for n being Element of NAT holds n + 1 in dom h
proof
defpred S3[
Element of
NAT ]
means $1
+ 1
in dom h;
A53:
for
n being
Element of
NAT st
n + 2
<= len <*F2()*> holds
<*F2()*> . (n + 2) = f . [n,(<*F2()*> . (n + 1))]
(
<*F2()*> . 1
= F2() &
<*F2()*> in F1()
* )
by FINSEQ_1:def 8, FINSEQ_1:def 11;
then
<*F2()*> in X
by A4, A53;
then A54:
{[1,F2()]} in X
by FINSEQ_1:37;
A55:
for
k being
Element of
NAT st
S3[
k] holds
S3[
k + 1]
proof
let k be
Element of
NAT ;
( S3[k] implies S3[k + 1] )
assume
k + 1
in dom h
;
S3[k + 1]
then
[(k + 1),(h . (k + 1))] in union X
by A46, FUNCT_1:1;
then consider Z being
set such that A56:
[(k + 1),(h . (k + 1))] in Z
and A57:
Z in X
by TARSKI:def 4;
Z in F1()
*
by A5, A57;
then reconsider Z =
Z as
FinSequence of
F1()
by FINSEQ_1:def 11;
A58:
(
k + 1
= len Z implies
S3[
k + 1] )
proof
set p =
Z ^ <*(f . [k,(Z . (k + 1))])*>;
A59:
1
<= (k + 1) + 1
by NAT_1:12;
assume A60:
k + 1
= len Z
;
S3[k + 1]
then
1
<= len Z
by NAT_1:12;
then
1
in Seg (len Z)
by FINSEQ_1:1;
then A61:
1
in dom Z
by FINSEQ_1:def 3;
A62:
for
n being
Element of
NAT st
n + 2
<= len (Z ^ <*(f . [k,(Z . (k + 1))])*>) holds
(Z ^ <*(f . [k,(Z . (k + 1))])*>) . (n + 2) = f . [n,((Z ^ <*(f . [k,(Z . (k + 1))])*>) . (n + 1))]
proof
let n be
Element of
NAT ;
( n + 2 <= len (Z ^ <*(f . [k,(Z . (k + 1))])*>) implies (Z ^ <*(f . [k,(Z . (k + 1))])*>) . (n + 2) = f . [n,((Z ^ <*(f . [k,(Z . (k + 1))])*>) . (n + 1))] )
assume
n + 2
<= len (Z ^ <*(f . [k,(Z . (k + 1))])*>)
;
(Z ^ <*(f . [k,(Z . (k + 1))])*>) . (n + 2) = f . [n,((Z ^ <*(f . [k,(Z . (k + 1))])*>) . (n + 1))]
then A63:
n + 2
<= (len Z) + (len <*(f . [k,(Z . (k + 1))])*>)
by FINSEQ_1:22;
then A64:
n + 2
<= (len Z) + 1
by FINSEQ_1:40;
A65:
(
n + 2
<> (len Z) + 1 implies
(Z ^ <*(f . [k,(Z . (k + 1))])*>) . (n + 2) = f . [n,((Z ^ <*(f . [k,(Z . (k + 1))])*>) . (n + 1))] )
proof
(n + 1) + 1
<= (len Z) + 1
by A63, FINSEQ_1:40;
then
( 1
<= n + 1 &
n + 1
<= len Z )
by NAT_1:12, XREAL_1:6;
then
n + 1
in Seg (len Z)
by FINSEQ_1:1;
then A66:
n + 1
in dom Z
by FINSEQ_1:def 3;
A67:
1
<= n + (1 + 1)
by NAT_1:12;
assume A68:
n + 2
<> (len Z) + 1
;
(Z ^ <*(f . [k,(Z . (k + 1))])*>) . (n + 2) = f . [n,((Z ^ <*(f . [k,(Z . (k + 1))])*>) . (n + 1))]
then
n + 2
<= len Z
by A64, NAT_1:8;
then
n + 2
in Seg (len Z)
by A67, FINSEQ_1:1;
then A69:
n + 2
in dom Z
by FINSEQ_1:def 3;
ex
q being
FinSequence st
(
q in F1()
* &
q . 1
= F2() & ( for
n being
Element of
NAT st
n + 2
<= len q holds
q . (n + 2) = f . [n,(q . (n + 1))] ) &
Z = q )
by A4, A57;
then
Z . (n + 2) = f . [n,(Z . (n + 1))]
by A64, A68, NAT_1:8;
then
(Z ^ <*(f . [k,(Z . (k + 1))])*>) . (n + 2) = f . [n,(Z . (n + 1))]
by A69, FINSEQ_1:def 7;
hence
(Z ^ <*(f . [k,(Z . (k + 1))])*>) . (n + 2) = f . [n,((Z ^ <*(f . [k,(Z . (k + 1))])*>) . (n + 1))]
by A66, FINSEQ_1:def 7;
verum
end;
(
n + 2
= (len Z) + 1 implies
(Z ^ <*(f . [k,(Z . (k + 1))])*>) . (n + 2) = f . [n,((Z ^ <*(f . [k,(Z . (k + 1))])*>) . (n + 1))] )
proof
(n + 1) + 1
<= (len Z) + 1
by A63, FINSEQ_1:40;
then
( 1
<= n + 1 &
n + 1
<= len Z )
by NAT_1:12, XREAL_1:6;
then
n + 1
in Seg (len Z)
by FINSEQ_1:1;
then A70:
n + 1
in dom Z
by FINSEQ_1:def 3;
assume A71:
n + 2
= (len Z) + 1
;
(Z ^ <*(f . [k,(Z . (k + 1))])*>) . (n + 2) = f . [n,((Z ^ <*(f . [k,(Z . (k + 1))])*>) . (n + 1))]
then (Z ^ <*(f . [k,(Z . (k + 1))])*>) . (n + 2) =
<*(f . [k,(Z . (k + 1))])*> . ((n + 2) - ((n + 2) - 1))
by A63, FINSEQ_1:23
.=
f . [n,(Z . (n + 1))]
by A60, A71, FINSEQ_1:40
;
hence
(Z ^ <*(f . [k,(Z . (k + 1))])*>) . (n + 2) = f . [n,((Z ^ <*(f . [k,(Z . (k + 1))])*>) . (n + 1))]
by A70, FINSEQ_1:def 7;
verum
end;
hence
(Z ^ <*(f . [k,(Z . (k + 1))])*>) . (n + 2) = f . [n,((Z ^ <*(f . [k,(Z . (k + 1))])*>) . (n + 1))]
by A65;
verum
end;
A72:
Z ^ <*(f . [k,(Z . (k + 1))])*> in F1()
*
len (Z ^ <*(f . [k,(Z . (k + 1))])*>) =
(len Z) + (len <*(f . [k,(Z . (k + 1))])*>)
by FINSEQ_1:22
.=
(k + 1) + 1
by A60, FINSEQ_1:39
;
then
(k + 1) + 1
in Seg (len (Z ^ <*(f . [k,(Z . (k + 1))])*>))
by A59, FINSEQ_1:1;
then
(k + 1) + 1
in dom (Z ^ <*(f . [k,(Z . (k + 1))])*>)
by FINSEQ_1:def 3;
then A74:
[((k + 1) + 1),((Z ^ <*(f . [k,(Z . (k + 1))])*>) . ((k + 1) + 1))] in Z ^ <*(f . [k,(Z . (k + 1))])*>
by FUNCT_1:1;
ex
p being
FinSequence st
(
p in F1()
* &
p . 1
= F2() & ( for
n being
Element of
NAT st
n + 2
<= len p holds
p . (n + 2) = f . [n,(p . (n + 1))] ) &
Z = p )
by A4, A57;
then
(Z ^ <*(f . [k,(Z . (k + 1))])*>) . 1
= F2()
by A61, FINSEQ_1:def 7;
then
Z ^ <*(f . [k,(Z . (k + 1))])*> in X
by A4, A72, A62;
then
[((k + 1) + 1),((Z ^ <*(f . [k,(Z . (k + 1))])*>) . ((k + 1) + 1))] in h
by A46, A74, TARSKI:def 4;
hence
S3[
k + 1]
by FUNCT_1:1;
verum
end;
(
k + 1
<> len Z implies
S3[
k + 1] )
hence
S3[
k + 1]
by A58;
verum
end;
[1,F2()] in {[1,F2()]}
by TARSKI:def 1;
then
[1,F2()] in h
by A46, A54, TARSKI:def 4;
then A77:
S3[
0 ]
by FUNCT_1:1;
thus
for
k being
Element of
NAT holds
S3[
k]
from NAT_1:sch 1(A77, A55); verum
end;
A78:
for n being Element of NAT holds h . (n + 2) = f . [n,(h . (n + 1))]
proof
let n be
Element of
NAT ;
h . (n + 2) = f . [n,(h . (n + 1))]
(n + 1) + 1
in dom h
by A52;
then
[(n + 2),(h . (n + 2))] in h
by FUNCT_1:def 2;
then consider Z being
set such that A79:
[(n + 2),(h . (n + 2))] in Z
and A80:
Z in X
by A46, TARSKI:def 4;
A81:
ex
p being
FinSequence st
(
p in F1()
* &
p . 1
= F2() & ( for
n being
Element of
NAT st
n + 2
<= len p holds
p . (n + 2) = f . [n,(p . (n + 1))] ) &
Z = p )
by A4, A80;
Z in F1()
*
by A5, A80;
then reconsider Z =
Z as
FinSequence of
F1()
by FINSEQ_1:def 11;
n + 2
in dom Z
by A79, FUNCT_1:1;
then
n + 2
in Seg (len Z)
by FINSEQ_1:def 3;
then A82:
n + 2
<= len Z
by FINSEQ_1:1;
n + 1
<= n + 2
by XREAL_1:7;
then
( 1
<= n + 1 &
n + 1
<= len Z )
by A82, NAT_1:12, XXREAL_0:2;
then
n + 1
in Seg (len Z)
by FINSEQ_1:1;
then
n + 1
in dom Z
by FINSEQ_1:def 3;
then
[(n + 1),(Z . (n + 1))] in Z
by FUNCT_1:1;
then A83:
[(n + 1),(Z . (n + 1))] in h
by A46, A80, TARSKI:def 4;
thus h . (n + 2) =
Z . (n + 2)
by A79, FUNCT_1:1
.=
f . [n,(Z . (n + 1))]
by A81, A82
.=
f . [n,(h . (n + 1))]
by A83, FUNCT_1:1
;
verum
end;
ex g being Function of NAT,F1() st
for n being Element of NAT holds g . n = h . (n + 1)
then consider g being Function of NAT,F1() such that
A91:
for n being Element of NAT holds g . n = h . (n + 1)
;
A92:
for n being Element of NAT st n + 2 <= len <*F2()*> holds
<*F2()*> . (n + 2) = f . [n,(<*F2()*> . (n + 1))]
( <*F2()*> in F1() * & <*F2()*> . 1 = F2() )
by FINSEQ_1:def 8, FINSEQ_1:def 11;
then
<*F2()*> in X
by A4, A92;
then A93:
{[1,F2()]} in X
by FINSEQ_1:37;
take
g
; ( g . 0 = F2() & ( for n being Element of NAT holds P1[n,g . n,g . (n + 1)] ) )
[1,F2()] in {[1,F2()]}
by TARSKI:def 1;
then
[1,F2()] in h
by A46, A93, TARSKI:def 4;
then F2() =
h . (0 + 1)
by FUNCT_1:1
.=
g . 0
by A91
;
hence
g . 0 = F2()
; for n being Element of NAT holds P1[n,g . n,g . (n + 1)]
let n be Element of NAT ; P1[n,g . n,g . (n + 1)]
A94:
h . (n + (1 + 1)) = f . (n,(h . (n + 1)))
by A78;
P1[n,g . n,f . (n,(g . n))]
by A3;
then
P1[n,g . n,h . ((n + 1) + 1)]
by A91, A94;
hence
P1[n,g . n,g . (n + 1)]
by A91; verum