reserve i,j,x,y for object,
  f,g for Function;
reserve T,T1 for finite Tree,
  t,p for Element of T,
  t1 for Element of T1;

theorem Th8:
  T|p,{ t : p is_a_prefix_of t } are_equipotent
proof
  set X = { t : p is_a_prefix_of t };
  deffunc F(Element of T|p) = p^$1;
  consider f being Function such that
A1: dom f = T|p and
A2: for n being Element of T|p holds f.n = F(n) from FUNCT_1:sch 4;
  take f;
  thus f is one-to-one
  proof
    let x,y be object such that
A3: x in dom f & y in dom f and
A4: f.x = f.y;
    reconsider m = x, n = y as Element of T|p by A1,A3;
    p^m = f.n by A2,A4
      .= p^n by A2;
    hence thesis by FINSEQ_1:33;
  end;
  thus dom f = T|p by A1;
  thus rng f c= X
  proof
    let i be object;
    assume i in rng f;
    then consider n being object such that
A5: n in dom f and
A6: i = f.n by FUNCT_1:def 3;
    reconsider n as Element of T|p by A1,A5;
    reconsider t = p^n as Element of T by TREES_1:def 6;
    f.n = p^n & p is_a_prefix_of t by A2,TREES_1:1;
    hence thesis by A6;
  end;
  let i be object;
  assume i in X;
  then
A7: ex t being Element of T st i = t & p is_a_prefix_of t;
  then consider n being FinSequence such that
A8: i = p^n by TREES_1:1;
  n is FinSequence of NAT by A7,A8,FINSEQ_1:36;
  then reconsider n as Element of T|p by A7,A8,TREES_1:def 6;
  i = f.n by A2,A8;
  hence thesis by A1,FUNCT_1:def 3;
end;
