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

theorem Th39:
  f,g form_morphism_between S,S9 implies S with-replacement (f,g)
  is Subsignature of S9
proof
  set R = S with-replacement (f,g);
  set F = id the carrier of R;
  set G = id the carrier' of R;
  set f9 = (the carrier of S)-indexing f;
  set g9 = (the carrier' of S)-indexing g;
A1: dom the ResultSort of S9 = the carrier' of S9 by FUNCT_2:def 1;
A2: dom the ResultSort of R = the carrier' of R by FUNCT_2:def 1;
  assume
A3: f,g form_morphism_between S,S9;
  then dom f = the carrier of S;
  then
A4: f9 = f by Th10;
A5: f,g form_a_replacement_in S by A3,Th31;
  then
A6: the carrier' of R = rng g9 by Def4;
  thus dom F = the carrier of R & dom G = the carrier' of R;
  dom g = the carrier' of S by A3;
  then
A7: g9 = g by Th10;
A8: f9, g9 form_morphism_between S, R by A5,Def4;
A9: now
    let x be object;
    assume
A10: x in the carrier' of R;
    then consider a being object such that
A11: a in dom g and
A12: x = g.a by A6,A7,FUNCT_1:def 3;
    reconsider a as OperSymbol of S by A3,A11;
    (the ResultSort of R)*g = f*the ResultSort of S by A8,A4,A7;
    then
A13: (the ResultSort of R).x = (f*the ResultSort of S).a by A11,A12,FUNCT_1:13;
    (the ResultSort of S9)*g = f*the ResultSort of S by A3;
    then (the ResultSort of S9).x = (f*the ResultSort of S).a by A11,A12,
FUNCT_1:13;
    hence
    (the ResultSort of R).x = ((the ResultSort of S9)|the carrier' of R).
    x by A10,A13,FUNCT_1:49;
  end;
  rng g c= the carrier' of S9 by A3;
  then dom ((the ResultSort of S9)|the carrier' of R) = the carrier' of R by A6
,A7,A1,RELAT_1:62;
  then
A14: the ResultSort of R = (the ResultSort of S9)|the carrier' of R by A2,A9;
  the carrier of R = rng f9 by A5,Def4;
  hence rng F c= the carrier of S9 & rng G c= the carrier' of S9 by A3,A6,A4,A7
;
  rng the ResultSort of R c= the carrier of R;
  hence F*the ResultSort of R = the ResultSort of R by RELAT_1:53
    .= (the ResultSort of S9)*G by A14,RELAT_1:65;
  let o be set, p be Function;
  assume that
A15: o in the carrier' of R and
A16: p = (the Arity of R).o;
  consider a being object such that
A17: a in dom g and
A18: o = g.a by A6,A7,A15,FUNCT_1:def 3;
  reconsider a as OperSymbol of S by A3,A17;
A19: f*the_arity_of a = (the Arity of S9).o by A3,A18;
  p in (the carrier of R)* by A15,A16,FUNCT_2:5;
  then p is FinSequence of the carrier of R by FINSEQ_1:def 11;
  then
A20: rng p c= the carrier of R by FINSEQ_1:def 4;
  f*the_arity_of a = p by A8,A4,A7,A16,A18;
  hence F*p = (the Arity of S9).o by A20,A19,RELAT_1:53
    .= (the Arity of S9).(G.o) by A15,FUNCT_1:18;
end;
