reserve S,S9 for non void Signature,
  f,g for Function;

theorem Th38:
  f,g form_a_replacement_in S implies for g9 being rng-retract of
(the carrier' of S)-indexing g holds the ResultSort of S with-replacement (f,g)
  = ((the carrier of S)-indexing f)*(the ResultSort of S)*g9
proof
  set ff = (the carrier of S)-indexing f;
  set gg = (the carrier' of S)-indexing g;
  set T = S with-replacement (f,g);
  assume
A1: f,g form_a_replacement_in S;
  then
A2: ff, gg form_morphism_between S, T by Def4;
  let g9 be rng-retract of gg;
  the carrier' of T = rng gg by A1,Def4;
  hence the ResultSort of T = (the ResultSort of T)*id rng gg by FUNCT_2:17
    .= (the ResultSort of T)*(gg*g9) by Def2
    .= (the ResultSort of T)*gg*g9 by RELAT_1:36
    .= ff*(the ResultSort of S)*g9 by A2;
end;
