reserve x,y,x1,x2,z for set,
  n,m,k for Nat,
  t1 for (DecoratedTree of [: NAT,NAT :]),
  w,s,t,u for FinSequence of NAT,
  D for non empty set;

theorem Th6:
  for Z,Z1,Z2 being Tree,z being Element of Z st Z
  with-replacement (z,Z1) = Z with-replacement (z,Z2) holds Z1 = Z2
proof
  let Z,Z1,Z2 be Tree,z be Element of Z;
  assume
A1: Z with-replacement (z,Z1) = Z with-replacement (z,Z2);
  now
    let s;
    thus s in Z1 implies s in Z2
    proof
      assume
A2:   s in Z1;
      per cases;
      suppose
        s = {};
        hence thesis by TREES_1:22;
      end;
      suppose
        s <> {};
        then
A3:     z is_a_proper_prefix_of z^s by TREES_1:10;
        z^s in Z with-replacement (z,Z2) by A1,A2,TREES_1:def 9;
        then ex w st w in Z2 & z^s = z^w by A3,TREES_1:def 9;
        hence thesis by FINSEQ_1:33;
      end;
    end;
    assume
A4: s in Z2;
    per cases;
    suppose
      s = {};
      hence s in Z1 by TREES_1:22;
    end;
    suppose
      s <> {};
      then
A5:   z is_a_proper_prefix_of z^s by TREES_1:10;
      z^s in Z with-replacement (z,Z1) by A1,A4,TREES_1:def 9;
      then ex w st w in Z1 & z^s = z^w by A5,TREES_1:def 9;
      hence s in Z1 by FINSEQ_1:33;
    end;
  end;
  hence thesis by TREES_2:def 1;
end;
