reserve x for set,
  t,t1,t2 for DecoratedTree;
reserve C for set;
reserve X,Y for non empty constituted-DTrees set;

theorem Th33:
  for D being non empty set, r being FinSequence of D, r1,r2 being
FinSequence, k being Nat st k+1 <= len r & r1 = r|Seg (k+1) & r2 = r
  |Seg k holds ex x being Element of D st r1 = r2^<*x*>
proof
  let D be non empty set, r be FinSequence of D, r1,r2 be FinSequence, k be
  Nat;
  assume that
A1: k+1 <= len r and
A2: r1 = r|Seg (k+1) and
A3: r2 = r|Seg k;
  k < len r by A1,NAT_1:13;
  then
A4: len r2 = k by A3,FINSEQ_1:17;
  r2 is_a_prefix_of r by A3,TREES_1:def 1;
  then
A5: ex q2 being FinSequence st r = r2^q2 by TREES_1:1;
  then reconsider r99 = r2 as FinSequence of D by FINSEQ_1:36;
  r1 is_a_prefix_of r by A2,TREES_1:def 1;
  then
A6: ex q1 being FinSequence st r = r1^q1 by TREES_1:1;
  then reconsider r9 = r1 as FinSequence of D by FINSEQ_1:36;
A7: len r1 = k+1 by A1,A2,FINSEQ_1:17;
A8: now
    assume r9 is_a_prefix_of r99;
    then k+1 <= k+0 by A7,A4,NAT_1:43;
    hence contradiction by XREAL_1:6;
  end;
  r9,r99 are_c=-comparable by A6,A5,TREES_A:1;
  then r99 is_a_prefix_of r9 by A8;
  then consider s being FinSequence such that
A9: r9 = r99^s by TREES_1:1;
  reconsider s as FinSequence of D by A9,FINSEQ_1:36;
A10: len s = 1
  proof
    consider m being Nat such that
A11: m = len s;
    k + 1 = k + m by A7,A4,A9,A11,FINSEQ_1:22;
    hence thesis by A11;
  end;
  consider x being set such that
A12: x = s.1;
  1 in {1} by TARSKI:def 1;
  then 1 in dom s by A10,FINSEQ_1:2,def 3;
  then
A13: x in rng s by A12,FUNCT_1:def 3;
  s = <*x*> by A10,A12,FINSEQ_1:40;
  hence thesis by A9,A13;
end;
