
theorem
  for nt being Symbol of PeanoNat holds
  (nt = 0 implies PostTraversalLanguage nt = {<*0*>}) &
  (nt = 1 implies PostTraversalLanguage nt = { <*0*>^(n|->1)
  where n is Element of NAT : n <> 0 })
proof
  let nt be Symbol of PeanoNat;
  reconsider rtO = root-tree O as Element of TS PN;
  height dom root-tree 0 = 0 by TREES_1:42,TREES_4:3;
  then PostTraversal rtO = <*0*>^(0 |-> 1) by Th17;
  then
A1: PostTraversal rtO = <*O*>^{} .= <*O*> by FINSEQ_1:34;
  thus nt = 0 implies PostTraversalLanguage nt = {<*0*>}
  proof
    assume
A2: nt = 0;
    hereby
      let x be object;
      assume x in PostTraversalLanguage nt;
      then consider tsg being Element of FinTrees the carrier of PN such that
A3:   x = PostTraversal tsg and
A4:   tsg in TS PN and
A5:   tsg.{} = O by A2;
      tsg = root-tree O by A4,A5,Th9;
      hence x in {<*0*>} by A1,A3,TARSKI:def 1;
    end;
    let x be object;
    assume x in {<*0*>};
    then
A6: x = <*O*> by TARSKI:def 1;
    rtO.{} = O by TREES_4:3;
    hence thesis by A1,A2,A6;
  end;
  assume
A7: nt = 1;
  hereby
    let x be object;
    assume x in PostTraversalLanguage nt;
    then consider tsg being Element of FinTrees the carrier of PN such that
A8: x = PostTraversal tsg and
A9: tsg in TS PN and
A10: tsg.{} = S by A7;
    consider ts being FinSequence of TS PN such that
A11: tsg = S-tree ts and
A12: S ==> roots ts by A9,A10,Th10;
    roots ts = <*0*> or roots ts = <*1*> by A12,Def2;
    then len roots ts = 1 by FINSEQ_1:40;
    then consider t being Element of FinTrees the carrier of PN such that
A13: ts = <*t*> and t in TS PN by Th5;
    tsg = S-tree t by A11,A13,TREES_4:def 5;
    then dom tsg = ^dom t by TREES_4:13;
    then
A14: height dom tsg = (height dom t) + 1 by TREES_3:80;
    x=<*0*>^((height dom tsg)|->1) by A8,A9,Th17;
    hence x in { <*0*>^(n|->1) where n is Element of NAT : n <> 0 } by A14;
  end;
  let x be object;
  assume x in { <*0*>^(n|->1) where n is Element of NAT : n <> 0 };
  then consider n being Element of NAT such that
A15: x = <*0*>^(n |-> 1) and
A16: n <> 0;
  defpred P[Nat] means
  $1 <> 0 implies ex tsg being Element of TS PN st
  tsg.{} = S & PostTraversal tsg = <*0*>^($1|->1);
A17: P[0];
A18: now
    let n be Nat;
    assume
A19: P[n];
    thus P[n+1]
    proof
      assume n+1 <> 0;
      per cases;
      suppose n <> 0;
        then consider tsg being Element of TS PN such that
        tsg.{} = S and
A20:    PostTraversal tsg = <*0*>^(n|->1) by A19;
        PostTraversal tsg = <*0*>^((height dom tsg) |-> 1) by Th17;
        then
A21:    n |-> 1 = (height dom tsg) |-> 1 by A20,FINSEQ_1:33;
        len(n |-> 1) = n by CARD_1:def 7;
        then
A22:    height dom tsg = n by A21,CARD_1:def 7;
        take tsg9 = S-tree tsg;
A23:    tsg9 = S-tree <*tsg*> by TREES_4:def 5;
        height dom tsg9 = height ^dom tsg by TREES_4:13
          .= n+1 by A22,TREES_3:80;
        hence thesis by A23,Th17,TREES_4:def 4;
      end;
      suppose
A24:    n = 0;
        take tsg9 = S-tree rtO;
A25:    tsg9 = S-tree <*rtO*> by TREES_4:def 5;
        height dom tsg9 = height ^dom rtO by TREES_4:13
          .= (height dom rtO)+1 by TREES_3:80
          .= n+1 by A24,TREES_1:42,TREES_4:3;
        hence thesis by A25,Th17,TREES_4:def 4;
      end;
    end;
  end;
  for n being Nat holds P[n] from NAT_1:sch 2(A17, A18);
  then ex tsg being Element of TS PN st
  tsg.{} = S & PostTraversal tsg = <*0*>^(n|->1) by A16;
  hence thesis by A7,A15;
end;
