reserve
  X,x,y,z for set,
  k,n,m for Nat ,
  f for Function,
  p,q,r for FinSequence of NAT;
reserve p1,p2,p3 for FinSequence;
reserve T,T1 for Tree;
reserve fT,fT1 for finite Tree;
reserve t for Element of T;

theorem
  p in T implies T1 = T with-replacement (p,T1)|p
proof
  assume
A1: p in T;
then A2: p in T with-replacement (p,T1) by Def9;
  thus T1 c= T with-replacement (p,T1)|p
  proof
    let x be object;
    assume
A3: x in T1;
    then reconsider q = x as FinSequence of NAT by Th18;
 p^q in T with-replacement (p,T1) by A1,A3,Def9;
    hence thesis by A2,Def6;
  end;
  let x be object;
  assume
A4: x in T with-replacement (p,T1)|p;
  then reconsider q = x as FinSequence of NAT by Th18;
A5: p^q in T with-replacement (p,T1) by A2,A4,Def6;
A6: now
    assume that
    p^q in T and
A7: not p is_a_proper_prefix_of p^q;
 p is_a_prefix_of p^q by Th1;
then  p^q = p by A7
      .= p^{} by FINSEQ_1:34;
then  q = {} by FINSEQ_1:33;
    hence q in T1 by Th21;
  end;
 (ex r st r in T1 & p^q = p^r) implies q in T1 by FINSEQ_1:33;
  hence thesis by A1,A5,A6,Def9;
end;
