reserve S for non empty non void ManySortedSign,
  A for MSAlgebra over S;
reserve A for non-empty MSAlgebra over S;

theorem Th28:
  for R being ManySortedRelation of A holds R is invariant iff for
  s1,s2 being SortSymbol of S st TranslationRel S reduces s1,s2 for f being
Translation of A,s1,s2 for a,b being set st [a,b] in R.s1 holds [f.a,f.b] in R.
  s2
proof
  let R be ManySortedRelation of A;
  hereby
    defpred P[Function,set,set] means for a,b being set st [a,b] in R.$2 holds
    [$1.a,$1.b] in R.$3;
    deffunc i(SortSymbol of S) = id ((the Sorts of A).$1);
    assume
A1: R is invariant;
A2: for s1,s2,s3 being SortSymbol of S st TranslationRel S reduces s1,s2
    for t being Translation of A,s1,s2 st P[t,s1,s2] for f being Function st f
    is_e.translation_of A,s2,s3 holds P[f*t,s1,s3]
    proof
      let s1,s2,s3 be SortSymbol of S such that
      TranslationRel S reduces s1,s2;
      let t be Translation of A,s1,s2 such that
A3:   for a,b being set st [a,b] in R.s1 holds [t.a,t.b] in R.s2;
      let f be Function such that
A4:   f is_e.translation_of A,s2,s3;
      let a,b be set;
      assume
A5:   [a,b] in R.s1;
      then reconsider a9 = a, b9 = b as Element of A,s1 by ZFMISC_1:87;
      [t.a9,t.b9] in R.s2 by A3,A5;
      then
A6:   [f.(t.a9),f.(t.b9)] in R.s3 by A1,A4;
      f.(t.a9) = (f*t).a9 by FUNCT_2:15;
      hence thesis by A6,FUNCT_2:15;
    end;
A7: for s being SortSymbol of S holds P[id ((the Sorts of A).s),s,s]
    proof
      let s be SortSymbol of S;
      let a,b be set;
      assume
A8:   [a,b] in R.s;
      then a in (the Sorts of A).s by ZFMISC_1:87;
      then
A9:   i(s).a = a by FUNCT_1:17;
      b in (the Sorts of A).s by A8,ZFMISC_1:87;
      hence thesis by A8,A9,FUNCT_1:17;
    end;
    thus for s1,s2 being SortSymbol of S st TranslationRel S reduces s1,s2 for
    t being Translation of A,s1,s2 holds P[t,s1,s2] from TranslationInd(A7,A2);
  end;
  assume
A10: for s1,s2 being SortSymbol of S st TranslationRel S reduces s1,s2
for f being Translation of A,s1,s2 for a,b being set st [a,b] in R.s1 holds [f.
  a,f.b] in R.s2;
  let s1,s2 be SortSymbol of S;
  let t be Function;
  assume
A11: t is_e.translation_of A,s1,s2;
  then t is Translation of A,s1,s2 by Th17;
  hence thesis by A10,A11,Th17;
end;
