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
  ex y11,C12 st the_sort_of C12 = s2 & g1 = transl C12
  proof
    defpred P[Function,SortSymbol of S,SortSymbol of S] means
    for V being finite set
    ex x being Element of Y.$2 st ex C being context of x st
    x nin V & the_sort_of C = $3 & $1 = transl C;
A1: for s holds P[id ((the Sorts of Free(S,Y)).s),s,s]
    proof let s;
      let V be finite set;
      reconsider x = the Element of Y.s \ V as Element of Y.s;
      reconsider C = x-term as context of x;
      take x, C;
      thus x nin V by XBOOLE_0:def 5;
      thus the_sort_of C = s by SORT;
      thus thesis by Th57;
    end;
A2: for s1,s2,s3 being SortSymbol of S st TranslationRel S reduces s1,s2
    for t being Translation of Free(S,Y),s1,s2 st P[t,s1,s2]
    for f being Function st f is_e.translation_of Free(S,Y),s2,s3
    holds P[f*t,s1,s3]
    proof
      let s1,s2,s3 be SortSymbol of S;
      assume TranslationRel S reduces s1,s2;
      let t be Translation of Free(S,Y),s1,s2;
      assume Z1: P[t,s1,s2];
      let f be Function;
      assume f is_e.translation_of Free(S,Y),s2,s3;
      then consider o being OperSymbol of S such that
B1:   the_result_sort_of o = s3 &
      ex i being Element of NAT st i in dom the_arity_of o &
      ((the_arity_of o)/.i) = s2 &
      ex a being Function st a in Args(o,Free(S,Y)) &
      f = transl(o,i,a,Free(S,Y))
      by MSUALG_6:def 5;
      consider i being Element of NAT such that
B2:   i in dom the_arity_of o & ((the_arity_of o)/.i) = s2 &
      ex a being Function st a in Args(o,Free(S,Y)) &
      f = transl(o,i,a,Free(S,Y)) by B1;
      consider a being Function such that
B3:   a in Args(o,Free(S,Y)) & f = transl(o,i,a,Free(S,Y)) by B2;
      reconsider a as Element of Args(o,Free(S,Y)) by B3;
      let V be finite set;
      [s2,s3] in TranslationRel S & i in dom a by B1,B2,MSUALG_6:2,def 3;
      then consider y being (Element of Y.s2), C being (context of y),
      q1 being Element of Args(o,Free(S,Y)) such that
B4:   y nin V & q1 = a+*(i,y-term) &
      q1 is y-context_including & y-context_in q1 = y-term & C = o-term q1 &
      i = y-context_pos_in q1 & transl C = transl(o,i,a,Free(S,Y))
      by B2,Th91;
      consider y1 being (Element of Y.s1), C1 being context of y1 such that
B5:   y1 nin V \/ vf C & the_sort_of C1 = s2 & t = transl C1 by Z1;
      y in vf C by Th95;
      then y1 nin vf C & y <> y1 by B5,XBOOLE_0:def 3;
      then C is y1-omitting & y is y1-different by Th92;
      then reconsider C2 = C-sub C1 as context of y1 by B5,Th94;
      take y1,C2;
      thus y1 nin V by B5,XBOOLE_0:def 3;
      the_sort_of C2 = the_sort_of C by SORT;
      hence the_sort_of C2 = s3 by B1,B4,Th8;
      thus f*t = transl C2 by B3,B4,B5,Th93;
    end;
    for s1,s2 being SortSymbol of S st TranslationRel S reduces s1,s2
    for t being Translation of Free(S,Y),s1,s2 holds P[t,s1,s2]
    from MSUALG_6:sch 1(A1,A2);
    then ex x being Element of Y.s1 st ex C being context of x st
    x nin {} & the_sort_of C = s2 & g1 = transl C by REACH;
    hence thesis;
  end;
