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 Th60:
  X is non-trivial & the_sort_of C = s1 implies
  for x1 being Element of X.s1
  for C1 being (context of x1), C2 being context of x st C2 = C1-sub(C)
  for t st the_sort_of t = s holds C2-sub t = C1-sub(C-sub t)
  proof assume ZZ: X is non-trivial;
    assume Z0: the_sort_of C = s1;
    let x1 be Element of X.s1;
    let C1 be (context of x1);
    let C2 be context of x;
    assume Z1: C2 = C1-sub(C);
    let t;
    assume Z2: the_sort_of t = s;
A0: the_sort_of (C-sub t) = s1 by Z0,SORT;
    defpred P[context of x1] means
    for C1 being context of x1 for C2 being context of x st C1 = $1 &
    C2 = C1-sub(C) holds C2-sub t = C1-sub(C-sub t);
A1: P[x1-term]
    proof
      let C1 be context of x1;
      let C2 be context of x;
      assume
B1:   C1 = (x1-term) & C2 = C1-sub C;
      then C2 = C by Z0,Th41;
      hence C2-sub t = C1-sub(C-sub t) by B1,A0,Th41;
    end;
A2: for o for w being Element of Args(o, Free(S,X))
    st w is x1-context_including
    holds P[x1-context_in w] implies
    for C being context of x1 st C = o-term w holds P[C]
    proof
      let o;
      let w be Element of Args(o, Free(S,X));
      assume Z3: w is x1-context_including;
      assume Z4: P[x1-context_in w];
      let C1 be context of x1;
      assume Z5: C1 = o-term w;
      let CC be context of x1;
      let C2 be context of x;
      assume
B2:   CC = C1 & C2 = CC-sub C;
      set i = x1-context_pos_in w;
B3:   x1-context_pos_in w in dom w = dom the_arity_of o &
      x1-context_in w = w.(x1-context_pos_in w) by Z3,Th71,MSUALG_3:6;
      then x1-context_in w in
      (the Sorts of Free(S,X)).((the_arity_of o)/.(x1-context_pos_in w))
      by MSUALG_6:2;
      then
B7:   the_sort_of (x1-context_in w) =
      (the_arity_of o)/.(x1-context_pos_in w) by SORT;
      then
      reconsider p = w+*(x1-context_pos_in w, (x1-context_in w)-sub(C-sub t)),
      q = w+*(x1-context_pos_in w, (x1-context_in w)-sub(C))
      as Element of Args(o,Free(S,X)) by MSUALG_6:7;
B5:   C2 = o-term q & C1-sub(C-sub t) = o-term p by ZZ,A0,Z0,Z3,Z5,B2,Th43;
      then
B6:   q is x-context_including & dom q = dom the_arity_of o by Th53,MSUALG_3:6;
      reconsider A = Coim((x1-context_in w)-sub(C),[x,s]) as finite set;
      Segm 1 = Segm card Coim(C,[x,s]) = card Coim(C,[x,s])
      c= card Coim((x1-context_in w)-sub(C),[x,s])
      = Segm card Coim((x1-context_in w)-sub(C),[x,s])
      by ZZ,Z0,Th70,CONTEXT;
      then
B9:   (x1-context_in w)-sub(C) is non x-omitting &
      q/.i = q.i = (x1-context_in w)-sub(C)
      by B3,B6,PARTFUN1:def 6,FUNCT_7:31;
      then reconsider C3 = (x1-context_in w)-sub(C) as context of x
      by B3,B6;
      the_sort_of C3 =
      (the_arity_of o)/.(x1-context_pos_in w) by B7,SORT;
      then reconsider u = w+*(x1-context_pos_in w, C3-sub t)
      as Element of Args(o,Free(S,X)) by MSUALG_6:7;
      C3 in rng q by B9,B6,B3,FUNCT_1:def 3;
      then o-term p = o-term u & x-context_pos_in q = x1-context_pos_in w &
      q+*(x1-context_pos_in w, C3-sub t) = u & x-context_in q = C3
      by B6,Z4,B9,CIn,CPI,FUNCT_7:34;
      hence thesis by B2,ZZ,Th43,Z2,B5,Th53;
    end;
    P[C1] from ContextInd(A1,A2);
    hence C2-sub t = C1-sub(C-sub t) by Z1;
  end;
