
theorem
  for S being non void non empty ManySortedSign for X being non-empty
  ManySortedSet of the carrier of S holds hom(id the carrier of S, id the
  carrier' of S, X, S, S) = id the Sorts of FreeMSA X
proof
  let S be non void non empty ManySortedSign;
  let X be non-empty ManySortedSet of the carrier of S;
  set f = id the carrier of S;
  set h = hom(f, id the carrier' of S, X, S, S);
  set I = id the Sorts of FreeMSA X, g = id the carrier' of S;
A1: f, g form_morphism_between S,S by PUA2MSS1:28;
  dom X = the carrier of S by PARTFUN1:def 2;
  then
A2: X*f = X by RELAT_1:52;
A3: (FreeMSA X)|(S,f,g) = FreeMSA X by Th25;
A4: now
    let i be object;
    assume i in the carrier of S;
    then reconsider s = i as SortSymbol of S;
    FreeGen X c= the Sorts of FreeMSA X by PBOOLE:def 18;
    then
A5: (FreeGen X).s c= (the Sorts of FreeMSA X).s;
    then (I.s)|((FreeGen X).s) is Function of (FreeGen X).s, (the Sorts of
    FreeMSA X).s by FUNCT_2:32;
    then
A6: dom ((I.s)|((FreeGen X).s)) = (FreeGen X).s by FUNCT_2:def 1;
A7: now
      let a be object;
      assume
A8:   a in (FreeGen X).s;
      then reconsider b = a as Element of FreeMSA X,s by A5;
      b in FreeGen(s,X) by A8,MSAFREE:def 16;
      then consider x being set such that
A9:   x in X.s and
A10:  b = root-tree [x,s] by MSAFREE:def 15;
      thus ((I.s)|((FreeGen X).s)).a = I.s.b by A8,FUNCT_1:49
        .= (id ((the Sorts of FreeMSA X).s)).b by MSUALG_3:def 1
        .= b
        .= root-tree [x,f.s] by A10
        .= h.s.b by A1,A2,A9,A10,Def5
        .= ((h.s)|((FreeGen X).s)).a by A8,FUNCT_1:49;
    end;
    (h.s)|((FreeGen X).s) is Function of (FreeGen X).s, (the Sorts of
    FreeMSA X).s by A2,A3,A5,FUNCT_2:32;
    then
A11: dom ((h.s)|((FreeGen X).s)) = (FreeGen X).s by FUNCT_2:def 1;
    (I||FreeGen X).s = (I.s)|((FreeGen X).s) & (h||FreeGen (X*f)).s = (h.s
    )|(( FreeGen (X*f)).s) by MSAFREE:def 1;
    hence (I||FreeGen X).i = (h||FreeGen (X*f)).i by A2,A6,A11,A7;
  end;
  I is_homomorphism FreeMSA X, FreeMSA X & h is_homomorphism FreeMSA (X*f)
  , ( FreeMSA X)|(S,f,g) by A1,Def5,MSUALG_3:9;
  hence thesis by A2,A3,A4,EXTENS_1:19,PBOOLE:3;
end;
