defpred S1[ Element of NAT , Nat] means $1 in card (NIC ((M /. $2),$2));
reconsider n = FirstLoc M as Element of NAT ;
defpred S2[ set , Element of NAT , set ] means ex l being Element of NAT st
( l = $1 & ( $2 in dom (LocSeq ((NIC ((M /. l),l)),S)) implies $3 = (LocSeq ((NIC ((M /. l),l)),S)) . $2 ) & ( not $2 in dom (LocSeq ((NIC ((M /. l),l)),S)) implies $3 = 0 ) );
set D = NAT ;
A1:
for x, y being Element of NAT ex z being Element of NAT st S2[x,y,z]
consider f being Function of [:NAT,NAT:],NAT such that
A4:
for l, n being Element of NAT holds S2[l,n,f . (l,n)]
from BINOP_1:sch 3(A1);
A5:
for d, k1, k2 being Element of NAT st k1 <= k2 & S1[k2,d] holds
S1[k1,d]
proof
let d be
Element of
NAT ;
for k1, k2 being Element of NAT st k1 <= k2 & S1[k2,d] holds
S1[k1,d]let k1,
k2 be
Element of
NAT ;
( k1 <= k2 & S1[k2,d] implies S1[k1,d] )
assume that A6:
k1 <= k2
and A7:
S1[
k2,
d]
;
S1[k1,d]
k1 c= k2
by A6, NAT_1:39;
hence
S1[
k1,
d]
by A7, ORDINAL1:12;
verum
end;
consider T being DecoratedTree of NAT such that
A8:
T . {} = n
and
A9:
for t being Element of dom T holds
( succ t = { (t ^ <*k*>) where k is Element of NAT : S1[k,T . t] } & ( for n being Element of NAT st S1[n,T . t] holds
T . (t ^ <*n*>) = f . ((T . t),n) ) )
from TREES_2:sch 10(A5);
take
T
; ( T . {} = FirstLoc M & ( for t being Element of dom T holds
( succ t = { (t ^ <*k*>) where k is Element of NAT : k in card (NIC ((M /. (T . t)),(T . t))) } & ( for m being Element of NAT st m in card (NIC ((M /. (T . t)),(T . t))) holds
T . (t ^ <*m*>) = (LocSeq ((NIC ((M /. (T . t)),(T . t))),S)) . m ) ) ) )
thus
T . {} = FirstLoc M
by A8; for t being Element of dom T holds
( succ t = { (t ^ <*k*>) where k is Element of NAT : k in card (NIC ((M /. (T . t)),(T . t))) } & ( for m being Element of NAT st m in card (NIC ((M /. (T . t)),(T . t))) holds
T . (t ^ <*m*>) = (LocSeq ((NIC ((M /. (T . t)),(T . t))),S)) . m ) )
let t be Element of dom T; ( succ t = { (t ^ <*k*>) where k is Element of NAT : k in card (NIC ((M /. (T . t)),(T . t))) } & ( for m being Element of NAT st m in card (NIC ((M /. (T . t)),(T . t))) holds
T . (t ^ <*m*>) = (LocSeq ((NIC ((M /. (T . t)),(T . t))),S)) . m ) )
thus
succ t = { (t ^ <*k*>) where k is Element of NAT : S1[k,T . t] }
by A9; for m being Element of NAT st m in card (NIC ((M /. (T . t)),(T . t))) holds
T . (t ^ <*m*>) = (LocSeq ((NIC ((M /. (T . t)),(T . t))),S)) . m
reconsider n = T . t as Element of NAT ;
let m be Element of NAT ; ( m in card (NIC ((M /. (T . t)),(T . t))) implies T . (t ^ <*m*>) = (LocSeq ((NIC ((M /. (T . t)),(T . t))),S)) . m )
consider l being Element of NAT such that
A10:
l = n
and
A11:
( m in dom (LocSeq ((NIC ((M /. l),l)),S)) implies f . (n,m) = (LocSeq ((NIC ((M /. l),l)),S)) . m )
and
( not m in dom (LocSeq ((NIC ((M /. l),l)),S)) implies f . (n,m) = 0 )
by A4;
assume
m in card (NIC ((M /. (T . t)),(T . t)))
; T . (t ^ <*m*>) = (LocSeq ((NIC ((M /. (T . t)),(T . t))),S)) . m
hence
T . (t ^ <*m*>) = (LocSeq ((NIC ((M /. (T . t)),(T . t))),S)) . m
by A9, A10, A11, Def1; verum