defpred S1[ set , set , set ] means ex a being adjective of T st
( a = p . $1 & ( ( $2 is not type of T & $3 = 0 ) or ex t being type of T st
( t = $2 & $3 = a ast t ) ) );
A1:
for i being Nat st 1 <= i & i < (len p) + 1 holds
for x being set ex y being set st S1[i,x,y]
proof
let i be
Nat;
( 1 <= i & i < (len p) + 1 implies for x being set ex y being set st S1[i,x,y] )
assume A2:
1
<= i
;
( not i < (len p) + 1 or for x being set ex y being set st S1[i,x,y] )
assume
i < (len p) + 1
;
for x being set ex y being set st S1[i,x,y]
then
i <= len p
by NAT_1:13;
then
i in dom p
by A2, FINSEQ_3:25;
then
p . i in rng p
by FUNCT_1:3;
then reconsider a =
p . i as
adjective of
T ;
let x be
set ;
ex y being set st S1[i,x,y]
per cases
( not x is type of T or x is type of T )
;
suppose A3:
x is not
type of
T
;
ex y being set st S1[i,x,y]take
0
;
S1[i,x, 0 ]take
a
;
( a = p . i & ( ( x is not type of T & 0 = 0 ) or ex t being type of T st
( t = x & 0 = a ast t ) ) )thus
(
a = p . i & ( (
x is not
type of
T &
0 = 0 ) or ex
t being
type of
T st
(
t = x &
0 = a ast t ) ) )
by A3;
verum end; suppose
x is
type of
T
;
ex y being set st S1[i,x,y]then reconsider t =
x as
type of
T ;
take
a ast t
;
S1[i,x,a ast t]take
a
;
( a = p . i & ( ( x is not type of T & a ast t = 0 ) or ex t being type of T st
( t = x & a ast t = a ast t ) ) )thus
a = p . i
;
( ( x is not type of T & a ast t = 0 ) or ex t being type of T st
( t = x & a ast t = a ast t ) )thus
( (
x is not
type of
T &
a ast t = 0 ) or ex
t being
type of
T st
(
t = x &
a ast t = a ast t ) )
;
verum end; end;
end;
consider q being FinSequence such that
A4:
len q = (len p) + 1
and
A5:
( q . 1 = t or (len p) + 1 = 0 )
and
A6:
for i being Nat st 1 <= i & i < (len p) + 1 holds
S1[i,q . i,q . (i + 1)]
from RECDEF_1:sch 3(A1);
defpred S2[ Nat] means ( $1 in dom q implies q . $1 is type of T );
A7:
now for k being Nat st S2[k] holds
S2[k + 1]let k be
Nat;
( S2[k] implies S2[k + 1] )assume A8:
S2[
k]
;
S2[k + 1]hence
S2[
k + 1]
;
verum end;
A11:
S2[ 0 ]
by FINSEQ_3:24;
A12:
for k being Nat holds S2[k]
from NAT_1:sch 2(A11, A7);
rng q c= the carrier of T
then reconsider q = q as FinSequence of the carrier of T by FINSEQ_1:def 4;
take
q
; ( len q = (len p) + 1 & q . 1 = t & ( for i being Element of NAT
for a being adjective of T
for t being type of T st i in dom p & a = p . i & t = q . i holds
q . (i + 1) = a ast t ) )
thus
( len q = (len p) + 1 & q . 1 = t )
by A4, A5; for i being Element of NAT
for a being adjective of T
for t being type of T st i in dom p & a = p . i & t = q . i holds
q . (i + 1) = a ast t
let i be Element of NAT ; for a being adjective of T
for t being type of T st i in dom p & a = p . i & t = q . i holds
q . (i + 1) = a ast t
let a be adjective of T; for t being type of T st i in dom p & a = p . i & t = q . i holds
q . (i + 1) = a ast t
let t be type of T; ( i in dom p & a = p . i & t = q . i implies q . (i + 1) = a ast t )
assume that
A13:
i in dom p
and
A14:
a = p . i
and
A15:
t = q . i
; q . (i + 1) = a ast t
i <= len p
by A13, FINSEQ_3:25;
then A16:
i < (len p) + 1
by NAT_1:13;
i >= 1
by A13, FINSEQ_3:25;
then
ex a being adjective of T st
( a = p . i & ( ( q . i is not type of T & q . (i + 1) = 0 ) or ex t being type of T st
( t = q . i & q . (i + 1) = a ast t ) ) )
by A6, A16;
hence
q . (i + 1) = a ast t
by A14, A15; verum