reserve X,x for set;
reserve k,m,n for Element of NAT,
  p,q,r,s,r9,s9 for Element of HP-WFF,
  T1,T2 for Tree;

theorem Th5:
  <*x*> in tree(T1,T2) iff x=0 or x=1
proof
A1: len<*T1,T2*> = 2 & tree(T1,T2) = tree<*T1,T2*> by FINSEQ_1:44
,TREES_3:def 17;
  thus <*x*> in tree(T1,T2) implies x=0 or x=1
  proof
    assume <*x*> in tree(T1,T2);
    then consider n being Nat, q being FinSequence such that
A2: n < 2 and
    q in <*T1,T2*>.(n+1) and
A3: <*x*> = <*n*>^q by A1,TREES_3:def 15;
    x = <*x*>.1
      .= n by A3,FINSEQ_1:41;
    hence thesis by A2,NAT_1:23;
  end;
  assume
A4: x=0 or x=1;
  then reconsider n = x as Element of NAT;
  <*T1,T2*>.(n+1) = T1 or <*T1,T2*>.(n+1) = T2 by A4;
  then
A5: {} in <*T1,T2*>.(n+1) by TREES_1:22;
  <*n*> = <*n*>^{} by FINSEQ_1:34;
  hence thesis by A1,A4,A5,TREES_3:def 15;
end;
