reserve X,Y for set, x,y,z for object, i,j,n for natural number;

theorem Th23:
  for J being non void Signature
  for T being MSAlgebra over J
  for X being ManySortedSubset of the Sorts of T
  for S being J-extension non void Signature
  for Q being T-extension MSAlgebra over S holds
  X extended_by ({}, the carrier of S) is ManySortedSubset of the Sorts of Q
  proof
    let J be non void Signature;
    let T be MSAlgebra over J;
    let X be ManySortedSubset of the Sorts of T;
    let S be J-extension non void Signature;
    let Q be T-extension MSAlgebra over S;
    let x;
    assume
A1: x in the carrier of S;
    then reconsider s = x as SortSymbol of S;
    per cases;
    suppose
A2:   s in the carrier of J;
      then s in dom X by PARTFUN1:def 2;
      then s in dom(X|the carrier of S) by RELAT_1:57;
      then
A3:   (X extended_by ({}, the carrier of S)).x = (X|the carrier of S).x
      by FUNCT_4:13 .= X.x by A1,FUNCT_1:49;
      X.x c= (the Sorts of T).x by A2,PBOOLE:def 18,def 2;
      hence (X extended_by ({}, the carrier of S)).x c= (the Sorts of Q).x
      by A2,A3,Th16;
    end;
    suppose
A4:   s nin the carrier of J;
A5:   J is Subsignature of S by Def2;
      dom (X|the carrier of S) = (dom X)/\the carrier of S by RELAT_1:61
      .= (the carrier of J) /\ the carrier of S by PARTFUN1:def 2
      .= the carrier of J by A5,XBOOLE_1:28,INSTALG1:10;
      then (X extended_by ({}, the carrier of S)).x
      = ((the carrier of S)-->{}).x by A4,FUNCT_4:11
      .= {};
      hence (X extended_by ({}, the carrier of S)).x c= (the Sorts of Q).x;
    end;
  end;
