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

theorem
  for R being MSEquivalence-like ManySortedRelation of A holds R is
  compatible iff R is MSCongruence of A
proof
  let R be MSEquivalence-like ManySortedRelation of A;
  hereby
    assume
A1: R is compatible;
    now
      let o be OperSymbol of S, x,y be Element of Args(o,A) such that
A2:   for n be Nat st n in dom x holds [x.n,y.n] in R.((the_arity_of o )/.n);
      now
        let n be Element of NAT;
        assume n in dom the_arity_of o;
        then n in dom x by MSUALG_3:6;
        hence [x.n,y.n] in R.((the_arity_of o)/.n) by A2;
      end;
      hence [Den(o,A).x,Den(o,A).y] in R.(the_result_sort_of o) by A1;
    end;
    hence R is MSCongruence of A by MSUALG_4:def 4;
  end;
  assume
A3: R is MSCongruence of A;
  let o be OperSymbol of S, x,y be Function such that
A4: x in Args(o,A) and
A5: y in Args(o,A) and
A6: for n be Element of NAT st n in dom the_arity_of o holds [x.n,y.n]
  in R.((the_arity_of o)/.n);
  reconsider x, y as Element of Args(o,A) by A4,A5;
  now
    let n be Nat;
    assume n in dom x;
    then n in dom the_arity_of o by MSUALG_3:6;
    hence [x.n,y.n] in R.((the_arity_of o)/.n) by A6;
  end;
  hence thesis by A3,MSUALG_4:def 4;
end;
