reserve x for set,
  R for non empty Poset;
reserve S1 for OrderSortedSign,
  OU0 for OSAlgebra of S1;
reserve s,s1,s2,s3,s4 for SortSymbol of S1;

theorem Th30:
  for A be OSSubset of OU0 holds GenOSAlg(A) = OU0 | OSMSubSort(A)
  & the Sorts of GenOSAlg(A) = OSMSubSort(A)
proof
  let A be OSSubset of OU0;
  set a = OSMSubSort(A);
  reconsider u1 = OU0|a as strict OSSubAlgebra of OU0;
A1: u1 = MSAlgebra (# a, Opers(OU0,a)qua ManySortedFunction of (a# * the
    Arity of S1),(a * the ResultSort of S1)#) by MSUALG_2:def 15;
A2: A c= a by Th29;
A3: A is OrderSortedSet of S1 by Def2;
A4: A is OSSubset of u1 & for OU1 be OSSubAlgebra of OU0 st A is OSSubset of
  OU1 holds u1 is OSSubAlgebra of OU1
  proof
    A is MSSubset of u1 by A2,A1,PBOOLE:def 18;
    hence A is OSSubset of u1 by A3,Def2;
    let U2 be OSSubAlgebra of OU0;
    reconsider B1 = the Sorts of U2 as MSSubset of OU0 by MSUALG_2:def 9;
    B1 is OrderSortedSet of S1 by OSALG_1:17;
    then reconsider B = B1 as OSSubset of OU0 by Def2;
    assume A is OSSubset of U2;
    then
A5: B is opers_closed & A c= B by MSUALG_2:def 9,PBOOLE:def 18;
    OSConstants(OU0) is OSSubset of U2 by Th13;
    then OSConstants(OU0) c= B by PBOOLE:def 18;
    then
A6: B in OSSubSort(A) by A5,Th19;
    the Sorts of u1 c= the Sorts of U2
    proof
      let i be object;
      assume i in the carrier of S1;
      then reconsider s = i as SortSymbol of S1;
      (the Sorts of u1).s = meet OSSubSort(A,s) & B.s in OSSubSort(A,s)
      by A1,A6,Def10,Def11;
      hence thesis by SETFAM_1:3;
    end;
    hence thesis by MSUALG_2:8;
  end;
  hence GenOSAlg(A) = OU0|a by Def12;
  thus thesis by A1,A4,Def12;
end;
