reserve S for non empty non void ManySortedSign,
  A for MSAlgebra over S;
reserve A for non-empty MSAlgebra over S;
reserve S for non empty non void ManySortedSign,
  A for non-empty MSAlgebra over S,
  R for ManySortedRelation of the Sorts of A;

theorem Th31:
  for R being ManySortedRelation of the Sorts of A for s being
SortSymbol of S for a,b being Element of A,s holds [a,b] in (StabCl R).s iff ex
x,y being Element of A,s, h being Endomorphism of A st [x,y] in R.s & a = h.s.x
  & b = h.s.y
proof
  let P be ManySortedRelation of the Sorts of A;
  defpred Z[SortSymbol of S,set,set] means ex s9 being SortSymbol of S, f
being Function of (the Sorts of A).s9,(the Sorts of A).$1, x,y being Element of
A,s9 st s9 = $1 & (ex h being Endomorphism of A st f = h.s9) & [x,y] in P.s9 &
  $2 = f.x & $3 = f.y;
  let s be SortSymbol of S;
  let a,b be Element of A,s;
  consider Q being ManySortedRelation of the Sorts of A such that
A1: for s being SortSymbol of S, a,b being Element of A,s holds [a,b] in
  Q.s iff Z[s,a,b] from MSRExistence;
  reconsider R = P,Q as ManySortedRelation of A;
A2: R c= Q by A1,Lm2;
  reconsider Q as stable ManySortedRelation of A by A1,Lm2;
  R c= StabCl R by Def12;
  then
A3: Q c= StabCl R by A1,Lm2;
  StabCl R c= Q by A2,Def12;
  then
A4: StabCl R = Q by A3,PBOOLE:146;
  hereby
    assume [a,b] in (StabCl P).s;
    then
    ex s9 being SortSymbol of S, f being Function of (the Sorts of A).s9,(
    the Sorts of A).s, x,y being Element of A,s9 st s9 = s & (ex h being
Endomorphism of A st f = h.s9) & [x,y] in P.s9 & a = f.x & b = f.y by A1,A4;
    hence
    ex x,y being Element of A,s, h being Endomorphism of A st [x,y] in P.
    s & a = h.s.x & b = h.s.y;
  end;
  thus thesis by A1,A4;
end;
