
theorem Th17:
  for t being Element of TS PeanoNat
  holds PostTraversal t = <*0*>^((height dom t) |-> 1)
proof
  consider f being Function of (TS PN), (the carrier of PN)* such that
A1: PostTraversal 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) = FlattenSeq(x)^<*nt*>
  by Def13;
  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 &
  PostTraversal t = <*0*>^((height dom t) |-> 1);
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 PostTraversal t = <*O*> by A1,A2
        .= <*O*>^{} by FINSEQ_1:34
        .= <*0*>^(0 |-> 1)
        .= <*0*>^((height dom t) |-> 1) 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 & PostTraversal t9 = <*O*>^((height dom t9) |-> 1) by A8;
    f.x9 is Element of (the carrier of PN)*;
    then
A13: f.x9 = <*O*>^((height dom x9) |-> 1) by A2,A3,A12,Def13;
    f * ts = <*f.x*> by A10,FINSEQ_2:35;
    then
A14: f.(nt-tree ts) = FlattenSeq(<*f.x9*>)^<*nt*> by A3,A7
      .= <*O*>^((height dom x9) |-> 1)^<*nt*> by A13,PRE_POLY:1
      .= <*O*>^(((height dom x9) |-> 1)^<*nt*>) by FINSEQ_1:32
      .= <*O*>^(((height dom x9)|->1)^(1|->1)) by A9,FINSEQ_2:59
      .= <*O*>^(((height dom x9)+1) |-> 1) by FINSEQ_2:123
      .= <*O*>^((height ^dom x9) |-> 1) 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 PostTraversal(nt-tree ts) = f.(nt-tree ts) by A2,A3,Def13;
    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;
