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);

theorem Th47:
  for A being disjoint_valued non-empty MSAlgebra over S
  for B being non-empty MSAlgebra over S
  for o being OperSymbol of S, p,q being Element of Args(o,A)
  for h being ManySortedFunction of A,B, a being Element of A
  for i st i in dom p & q = p+*(i,a) holds h#q = (h#p)+*(i,h.a)
  proof
    let A be disjoint_valued non-empty MSAlgebra over S;
    let B be non-empty MSAlgebra over S;
    let o be OperSymbol of S;
    let p,q be Element of Args(o,A);
    let h be ManySortedFunction of A,B;
    let a be Element of A;
    let i;
    assume Z0: i in dom p;
    assume Z1: q = p+*(i,a);
A1: dom (h#q) = dom the_arity_of o = dom (h#p) = dom((h#p)+*(i,h.a)) &
    dom q = dom the_arity_of o = dom p by MSUALG_3:6,FUNCT_7:30;
    now let j be object;
      assume
A2:   j in dom (h#q);
      then reconsider k = j as Nat;
A3:   (h#q).k = h.((the_arity_of o)/.k).(q.k) &
      (h#p).k = h.((the_arity_of o)/.k).(p.k) by A1,A2,MSUALG_3:def 6;
      q.i = a by Z0,Z1,FUNCT_7:31;
      then a in (the Sorts of A).((the_arity_of o)/.i) by Z0,A1,MSUALG_6:2;
      then the_sort_of a = (the_arity_of o)/.i by SORT;
      then
A5:   h.((the_arity_of o)/.i).a = h.a by ABBR;
      per cases;
      suppose
A4:     j = i;
        hence (h#q).j = h.((the_arity_of o)/.k).a by Z1,A1,A2,A3,FUNCT_7:31
        .= ((h#p)+*(i,h.a)).j by A4,A5,A1,A2,FUNCT_7:31;
      end;
      suppose
A6:     j <> i;
        hence (h#q).j = h.((the_arity_of o)/.k).(p.k) by Z1,A3,FUNCT_7:32
        .= ((h#p)+*(i,h.a)).j by A3,A6,FUNCT_7:32;
      end;
    end;
    hence h#q = (h#p)+*(i,h.a) by A1,FUNCT_1:2;
  end;
