reserve i for Nat, x,y for set;
reserve S for non empty non void ManySortedSign;
reserve X for non-empty ManySortedSet of S;

theorem Th31:
  for S being non empty non void ManySortedSign
  for A,B being MSAlgebra over S st the MSAlgebra of A = the MSAlgebra of B
  for G being MSSubset of A
  for H being MSSubset of B st G = H
  holds GenMSAlg G = GenMSAlg H
  proof
    let S be non empty non void ManySortedSign;
    let A,B be MSAlgebra over S such that
A1: the MSAlgebra of A = the MSAlgebra of B;
    let G be MSSubset of A;
    let H be MSSubset of B such that
A2: G = H;
A3: G is MSSubset of GenMSAlg G & H is MSSubset of GenMSAlg H
    by MSUALG_2:def 17;
    GenMSAlg G is MSSubAlgebra of B & GenMSAlg H is MSSubAlgebra of A
    by A1,MSAFREE4:28;
    then GenMSAlg G is MSSubAlgebra of GenMSAlg H &
    GenMSAlg H is MSSubAlgebra of GenMSAlg G by A2,A3,MSUALG_2:def 17;
    hence GenMSAlg G = GenMSAlg H by MSUALG_2:7;
  end;
