reserve
  a,b for object, I,J for set, f for Function, R for Relation,
  i,j,n for Nat, m for (Element of NAT),
  S for non empty non void ManySortedSign,
  s,s1,s2 for SortSymbol of S,
  o for OperSymbol of S,
  X for non-empty ManySortedSet of the carrier of S,
  x,x1,x2 for (Element of X.s), x11 for (Element of X.s1),
  T for all_vars_including inheriting_operations free_in_itself
  (X,S)-terms MSAlgebra over S,
  g for Translation of Free(S,X),s1,s2,
  h for Endomorphism of Free(S,X);
reserve
  r,r1,r2 for (Element of T),
  t,t1,t2 for (Element of Free(S,X));
reserve
  Y for infinite-yielding ManySortedSet of the carrier of S,
  y,y1 for (Element of Y.s), y11 for (Element of Y.s1),
  Q for all_vars_including inheriting_operations free_in_itself
  (Y,S)-terms MSAlgebra over S,
  q,q1 for (Element of Args(o,Free(S,Y))),
  u,u1,u2 for (Element of Q),
  v,v1,v2 for (Element of Free(S,Y)),
  Z for non-trivial ManySortedSet of the carrier of S,
  z,z1 for (Element of Z.s),
  l,l1 for (Element of Free(S,Z)),
  R for all_vars_including inheriting_operations free_in_itself
  (Z,S)-terms MSAlgebra over S,
  k,k1 for Element of Args(o,Free(S,Z));
reserve c,c1,c2 for set, d,d1 for DecoratedTree;
reserve
  w for (Element of Args(o,T)),
  p,p1 for Element of Args(o,Free(S,X));
reserve C for (context of x), C1 for (context of y), C9 for (context of z),
  C11 for (context of x11), C12 for (context of y11), D for context of s,X;
reserve
  S9 for sufficiently_rich non empty non void ManySortedSign,
  s9 for SortSymbol of S9,
  o9 for s9-dependent OperSymbol of S9,
  X9 for non-trivial ManySortedSet of the carrier of S9,
  x9 for (Element of X9.s9);
reserve h1 for x-constant Homomorphism of Free(S,X), T,
  h2 for y-constant Homomorphism of Free(S,Y), Q;
reserve
  s2 for s1-reachable SortSymbol of S,
  g1 for Translation of Free(S,Y),s1,s2,
  g for Translation of Free(S,X),s1,s2;

theorem Th59:
  for V being finite set holds
  m in dom q & (the_arity_of o)/.m = s implies
  ex y,C1,q1 st y nin V & C1 = o-term q1 & q1 = q+*(m,y-term) &
  q1 is y-context_including &
  m = y-context_pos_in q1 & y-context_in q1 = y-term
  proof let V be finite set;
    assume Z0: m in dom q & (the_arity_of o)/.m = s;
    set y = the Element of Y.s \ (V \/ proj1 rng (o-term q));
A0: proj1 rng (o-term q) is finite by WAYBEL26:39;
    then reconsider y as Element of Y.s by XBOOLE_0:def 5;
    reconsider t = y-term as Element of Free(S,Y);
    reconsider q1 = q+*(m,y-term) as Element of Args(o,Free(S,Y))
    by Z0,MSUALG_6:7;
A1: q1 is y-context_including
    proof
      take m; thus m in dom q1 by Z0,FUNCT_7:30;
      thus q1.m is context of y by Z0,FUNCT_7:31;
      let j,v; assume
Z1:   j in dom q1 & j <> m & v = q1.j;
      then
A4:   j in dom q by FUNCT_7:30;
      then
A2:   v = q.j in rng q by Z1,FUNCT_7:32,FUNCT_1:def 3;
      set d = the Element of Coim(v,[y,s]);
      assume
A7:   Coim(v,[y,s]) <> {};
      then
A3:   d in dom v & v.d in {[y,s]} by FUNCT_1:def 7;
      reconsider d as Element of dom v by A7,FUNCT_1:def 7;
      consider k being Nat such that
A5:   j = 1+k by Z1,FINSEQ_3:25,NAT_1:10;
A6:   v.d = [y,s] by A3,TARSKI:def 1;
      j <= len q by A4,FINSEQ_3:25;
      then <*k*>^d in dom(o-term q) & (o-term q).(<*k*>^d) = v.d
      by A2,A5,TREES_4:11,12,NAT_1:13;
      then [y,s] in rng(o-term q) by A6,FUNCT_1:def 3;
      then y in proj1 rng(o-term q) by XTUPLE_0:def 12;
      then y in V \/ proj1 rng(o-term q) by XBOOLE_0:def 3;
      hence contradiction by A0,XBOOLE_0:def 5;
    end;
    then reconsider C9 = o-term q1 as context of y by Th53;
    take y,C9,q1;
    y nin V \/ proj1 rng (o-term q) by A0,XBOOLE_0:def 5;
    hence y nin V by XBOOLE_0:def 3;
    thus C9 = o-term q1;
    thus q1 = q+*(m,y-term);
    thus q1 is y-context_including by A1;
A7: q1.m = y-term by Z0,FUNCT_7:31;
    hence m = y-context_pos_in q1 by A1,CPI;
    hence y-context_in q1 = y-term by A1,A7,Th71;
  end;
