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 Th131:
  for xi being Node of t st t1 = t|xi holds (h.t)|xi = h.t1
  proof
    let xi be Node of t;
    defpred P[Element of Free(S,X)] means for xi being Node of $1
    for t1 st t1 = $1|xi holds (h.$1)|xi = h.t1 & xi in dom (h.$1);
A1: P[x-term]
    proof
      let xi be Node of x-term;
      dom(x-term) = {{}} by TREES_1:29;
      then
A2:   xi = {};
      let t1; assume t1 = (x-term)|xi;
      then t1 = x-term by A2,TREES_9:1;
      hence (h.(x-term))|xi = h.t1 by A2,TREES_9:1;
      thus thesis by A2,TREES_1:22;
    end;
A3: for o,p st for t st t in rng p holds P[t] holds P[o-term p]
    proof
      let o,p; assume
A4:   for t st t in rng p holds P[t];
      let xi be Node of o-term p;
      let t1; assume
A5:   t1 = (o-term p)|xi;
      per cases by TREES_4:11;
      suppose
A6:     xi = {};
        hence (h.(o-term p))|xi = h.(o-term p) by TREES_9:1
        .= h.t1 by A5,A6,TREES_9:1;
        thus thesis by A6,TREES_1:22;
      end;
      suppose ex n being Nat,t being DecoratedTree,q being Node of t
        st n < len p & t = p.(n+1) & xi = <*n*>^q;
        then consider n being Nat,t being DecoratedTree,q being Node of t
        such that
A6:     n < len p & t = p.(n+1) & xi = <*n*>^q;
A8:     t1 = (o-term p)|<*n*>|q by A5,A6,TREES_9:3;
        1 <= n+1 <= len p by A6,NAT_1:12,13;
        then
A10:    n+1 in dom p by FINSEQ_3:25;
        then reconsider t as Element of Free(S,X) by A6,FUNCT_1:102;
A9:     t = (o-term p)|<*n*> by A6,TREES_4:def 4;
        t in rng p by A6,A10,FUNCT_1:def 3;
        then
A12:    (h.t)|q = h.t1 & q in dom (h.t) by A8,A9,A4;
        the_sort_of (o-term p) = the_result_sort_of o by Th8;
        then h.(o-term p) = h.(the_result_sort_of o).(o-term p) &
        o-term p = Den(o,Free(S,X)).p
        by ABBR,MSAFREE4:13;
        then
A13:    h.(o-term p) = Den(o,Free(S,X)).(h#p) by MSUALG_6:def 2,MSUALG_3:def 7
        .= o-term (h#p) by MSAFREE4:13;
        dom (h#p) = dom the_arity_of o = dom p by MSUALG_6:2;
        then
A16:    len (h#p) = len p by FINSEQ_3:29;
        then
A14:    (h#p).(n+1) = (o-term (h#p))|<*n*> by A6,TREES_4:def 4;
        (h#p).(n+1) = h.((the_arity_of o)/.(n+1)).t & t = p/.(n+1)
        by A6,A10,MSUALG_3:def 6,PARTFUN1:def 6;
        then
A15:    (h#p).(n+1) = h.(the_sort_of t).t by A10,Th4A .= h.t by ABBR;
        then <*n*>^q in dom(o-term (h#p)) by A6,A12,A16,TREES_4:11;
        hence thesis by A6,A12,A13,A14,A15,TREES_9:3;
      end;
    end;
    P[t] from TermInd(A1,A3);
    hence thesis;
  end;
