
theorem Th6:
  for S being non void non empty ManySortedSign, A being non-empty
  MSAlgebra over S holds the Sorts of A is GeneratorSet of A
proof
  let S be non void non empty ManySortedSign, A be non-empty MSAlgebra over S;
  reconsider theA = the MSAlgebra of A as non-empty MSAlgebra over S;
  reconsider AA = the Sorts of A as non-empty MSSubset of theA by PBOOLE:def 18
;
  set GAA = GenMSAlg AA;
A1: the Sorts of GAA is MSSubset of A by MSUALG_2:def 9;
  now
    let B be MSSubset of A such that
A2: B = the Sorts of GAA;
    reconsider C = B as MSSubset of theA;
A3: C is opers_closed by A2,MSUALG_2:def 9;
A4: now
      let o be OperSymbol of S;
      C is_closed_on o by A3;
      then
A5:   rng ((Den(o,the MSAlgebra of A))|((C# * the Arity of S).o)) c= (C *
      the ResultSort of S).o;
      thus B is_closed_on o by A5;
    end;
    hence B is opers_closed;
    reconsider OAB = Opers(A, B) as ManySortedFunction of (C# * the Arity of S
    ),(C * the ResultSort of S);
A6: now
      let o be OperSymbol of S;
A7:   C is_closed_on o & Den (o, A) = Den (o, the MSAlgebra of A) by A3;
      thus OAB.o = o/.B by MSUALG_2:def 8
        .= (Den(o,A)) | ((B# * the Arity of S).o) by A4,MSUALG_2:def 7
        .= o/.C by A7,MSUALG_2:def 7;
    end;
    the Charact of GAA = Opers(theA, C) by A2,MSUALG_2:def 9;
    hence the Charact of GAA = Opers(A,B) by A6,MSUALG_2:def 8;
  end;
  then reconsider GAA as strict non-empty MSSubAlgebra of A by A1,
MSUALG_2:def 9;
  reconsider BB = the Sorts of A as MSSubset of A by PBOOLE:def 18;
A8: now
    let U1 be MSSubAlgebra of A;
A9: now
      let B be MSSubset of theA such that
A10:  B = the Sorts of U1;
      reconsider C = B as MSSubset of A;
A11:  C is opers_closed by A10,MSUALG_2:def 9;
A12:  now
        let o be OperSymbol of S;
        C is_closed_on o by A11;
        then
A13:    rng ((Den(o,A))|((C# * the Arity of S).o)) c= (C * the ResultSort
        of S).o;
        thus B is_closed_on o by A13;
      end;
      hence B is opers_closed;
      reconsider OAB = Opers(theA, B) as ManySortedFunction of (C# * the Arity
      of S),(C * the ResultSort of S);
A14:  now
        let o be OperSymbol of S;
A15:    Den (o, A) = Den (o, the MSAlgebra of A);
A16:    C is_closed_on o by A11;
        thus OAB.o = o/.B by MSUALG_2:def 8
          .= (Den(o,A)) | ((B# * the Arity of S).o) by A12,A15,MSUALG_2:def 7
          .= o/.C by A16,MSUALG_2:def 7;
      end;
      the Charact of U1 = Opers(A, C) by A10,MSUALG_2:def 9;
      hence the Charact of U1 = Opers(theA,B) by A14,MSUALG_2:def 8;
    end;
    the Sorts of U1 is MSSubset of the MSAlgebra of A by MSUALG_2:def 9;
    then reconsider U2 = U1 as MSSubAlgebra of theA by A9,MSUALG_2:def 9;
    assume BB is MSSubset of U1;
    then GAA is MSSubAlgebra of U2 by MSUALG_2:def 17;
    hence GAA is MSSubAlgebra of U1;
  end;
  BB is MSSubset of GenMSAlg AA by MSUALG_2:def 17;
  then GenMSAlg AA = GenMSAlg BB by A8,MSUALG_2:def 17;
  then the Sorts of GenMSAlg BB = the Sorts of A by MSUALG_2:21;
  hence thesis by MSAFREE:def 4;
end;
