
theorem Th15:
  for t being Element of TS PeanoNat
  holds PreTraversal t = ((height dom t) |-> 1)^<*0*>
proof
  consider f being Function of (TS PN), (the carrier of PN)* such that
A1: PreTraversal root-tree (O qua Symbol of PN) = f.(root-tree O) and
A2: for t being Symbol of PN st t in Terminals PN holds f.(root-tree t)
  = <*t*> and
A3: for nt being Symbol of PN, ts being FinSequence of TS(PN), rts
  being FinSequence st rts = roots ts & nt ==> rts for x being FinSequence of (
  the carrier of PN)* st x = f * ts holds f.(nt-tree ts) = <*nt*>^FlattenSeq(x)
  by Def12;
  reconsider rtO = root-tree O as Element of TS PN;
  defpred P[DecoratedTree of the carrier of PN] means
  ex t being Element of TS PN st $1 = t &
  PreTraversal t = ((height dom t) |-> 1)^<*0*>;
A4: now
    let s be Symbol of PN;
    assume
A5: s in Terminals PN;
    thus P[root-tree s]
    proof
      take t = rtO;
      thus root-tree s = t by A5,Lm10,TARSKI:def 1;
      thus PreTraversal t = <*O*> by A1,A2
        .= {}^<*O*> by FINSEQ_1:34
        .= (0 |-> 1)^<*0*>
        .= ((height dom t) |-> 1)^<*0*> by TREES_1:42,TREES_4:3;
    end;
  end;
A6: now
    let nt be Symbol of PN, ts be FinSequence of TS PN;
    assume that
A7: nt ==> roots ts and
A8: for t being DecoratedTree of the carrier of PN st t in rng ts holds P[t];
    reconsider t9 = nt-tree ts as Element of TS PN by A7,Def1;
A9: nt = S by A7,Def2;
    roots ts = <*O*> or roots ts = <*1*> by A7,Def2;
    then len roots ts = 1 by FINSEQ_1:40;
    then consider x being Element of FinTrees the carrier of PN such that
A10: ts = <*x*> and
A11: x in TS PN by Th5;
    reconsider x9 = x as Element of TS PN by A11;
    rng ts = {x} by A10,FINSEQ_1:39;
    then x in rng ts by TARSKI:def 1;
    then
A12: ex t9 being Element of TS PN st
    x = t9 & PreTraversal t9 = ((height dom t9) |-> 1)^<*0*> by A8;
    f.x9 is Element of (the carrier of PN)*;
    then
A13: f.x9 = ((height dom x9) |-> 1)^<*0*> by A2,A3,A12,Def12;
    f * ts = <*f.x*> by A10,FINSEQ_2:35;
    then
A14: f.(nt-tree ts) = <*nt*>^FlattenSeq(<*f.x9*>) by A3,A7
      .= <*nt*>^(((height dom x9) |-> 1)^<*0*>) by A13,PRE_POLY:1
      .= <*nt*>^((height dom x9) |-> 1)^<*0*> by FINSEQ_1:32
      .= (1|->1)^((height dom x9) |-> 1)^<*0*> by A9,FINSEQ_2:59
      .= (((height dom x9)+1) |-> 1)^<*0*> by FINSEQ_2:123
      .= ((height ^dom x9) |-> 1)^<*0*> by TREES_3:80;
A15: dom (nt-tree x9) = ^dom x9 by TREES_4:13;
A16: t9 = nt-tree x9 by A10,TREES_4:def 5;
    f.t9 is Element of (the carrier of PN)*;
    then PreTraversal(nt-tree ts) = f.(nt-tree ts) by A2,A3,Def12;
    hence P[nt-tree ts] by A14,A15,A16;
  end;
A17: for t being DecoratedTree of the carrier of PN
  st t in TS PN holds P[t] from DTConstrInd(A4,A6);
  let t be Element of TS PeanoNat;
  P[t] by A17;
  hence thesis;
end;
