
theorem Th12:
  for T be full Tree for n be non zero Nat holds Seg (2 to_power
  n) c= rng NumberOnLevel(n,T)
proof
  let T be full Tree;
  let n be non zero Nat;
  let y be object;
  assume y in Seg (2 to_power n);
  then y in { k where k is Nat : 1 <= k & k <= 2 to_power n } by FINSEQ_1:def 1
;
  then consider k be Nat such that
A1: k = y and
A2: 1 <= k and
A3: k <= 2 to_power n;
A4: k - 1 >= 1 - 1 by A2,XREAL_1:9;
  set t = Rev (n-BinarySequence (k-'1));
A5: len t = len (n-BinarySequence (k-'1)) by FINSEQ_5:def 3
    .= n by CARD_1:def 7;
  then len Rev t = n by FINSEQ_5:def 3;
  then reconsider F = Rev t as Element of n-tuples_on BOOLEAN by FINSEQ_2:92;
  T = {0,1}* by Def2;
  then t in T by FINSEQ_1:def 11;
  then t in { w where w is Element of T : len w = n } by A5;
  then
A6: t in T-level n by TREES_2:def 6;
  then
A7: t in dom NumberOnLevel(n,T) by FUNCT_2:def 1;
  k < 2 to_power n + 1 by A3,NAT_1:13;
  then k - 1 < 2 to_power n by XREAL_1:19;
  then
A8: k-'1 < 2 to_power n by A4,XREAL_0:def 2;
  NumberOnLevel(n,T).t = (Absval F) + 1 by A6,Def1
    .= (Absval (n-BinarySequence (k-'1))) + 1
    .= k -' 1 + 1 by A8,BINARI_3:35
    .= k - 1 + 1 by A4,XREAL_0:def 2
    .= y by A1;
  hence thesis by A7,FUNCT_1:def 3;
end;
