reserve I for set;
reserve S for non empty non void ManySortedSign,
  U0, U1 for non-empty MSAlgebra over S;

theorem Th22:
  for A being feasible MSAlgebra over S, C being feasible
  MSSubAlgebra of A for D being ManySortedSubset of the Sorts of A st D = the
  Sorts of C for h being ManySortedFunction of A, U0 st h is_homomorphism A, U0
for g being ManySortedFunction of C, U0 st g = h || D holds g is_homomorphism C
  , U0
proof
  let A be feasible MSAlgebra over S, C be feasible MSSubAlgebra of A, D be
  ManySortedSubset of the Sorts of A such that
A1: D = the Sorts of C;
  let h be ManySortedFunction of A, U0 such that
A2: h is_homomorphism A, U0;
  let g be ManySortedFunction of C, U0 such that
A3: g = h || D;
  let o be OperSymbol of S such that
A4: Args(o,C) <> {};
  let x be Element of Args(o,C);
  reconsider y = x as Element of Args(o,A) by A4,Th18;
  set r = the_result_sort_of o;
A5: x in Args(o,A) by A4,Th18;
  Result(o,C) <> {} by A4,MSUALG_6:def 1;
  then Den(o,C).x in Result(o,C) by A4,FUNCT_2:5;
  then
A6: Den(o,C).x in (the Sorts of C).((the ResultSort of S).o) by FUNCT_2:15;
  Den(o,A).x = Den(o,C).x by A4,Th19;
  hence (g.(the_result_sort_of o)).(Den(o,C).x) = (h.r).(Den(o,A).x) by A1,A3
,A6,INSTALG1:39
    .= Den(o,U0).(h#y) by A2,A5
    .= Den(o,U0).(g#x) by A1,A3,A4,Th21;
end;
