In universal algebra there is the notion of congruence relation: Consider a (1-sorted) algebraic structure, i.e. a set $A$ with a bunch of finitary operations $f\_i$ satisfying equations.


A *congruence relation* is an equivalence relation $\sim$ on $A$ such that the operations on $A$ produce well-defined operations on the set $A/\sim$ of equivalence classes by applying them to representatives. I.e. for any operation $f$ on $A$ the operation $\bar{f}$ on $A/\sim$ given by $\bar{f}([x\_1],...,[x\_n]):=[f(x\_1,...x\_n)]$ is well-defined, i.e. if $x\_1 \sim y\_1, ... , x\_n \sim y\_n$ then $f(x\_1,...,x\_n) \sim f(y\_1,...,y\_n)$ for all operations $f$ of the given structure.
Thus these relations are the right ones to form quotients inside the given category of algebraic structures.


An *essentially algebraic structure* is a (if 1-sorted) or several (if many-sorted) sets with partially defined operations satisfying equational laws, where the domain of any given operation is a subset defined by equations between previously defined operations (equivalenty: it is a $Set$-model of a finite limit sketch). The standard example are categories, where one has three global operations, identity, source and target, and a partial operation, composition, defined only for certain pairs of morphisms.


**My question is:** Is there a notion of congruence relation for these more general algebraic structures? E.g. one equivalence relation on each set satisfying the analogous properties to the above? If so have these "congruence relations" been studied, do they e.g. form lattices?


**Motivation:** Just curiosity really. I asked myself this question, after reading [this MO-question](https://mathoverflow.net/questions/35335/collapsing-objects-in-a-category) of Colin Tan, which might be a special case. He asks whether there is a way to collapse two objects in a category. If there was a lattice of congruence relations on a category, there might be the congruence relation generated by the relation which identifies just the two objects (this would of course mean to treat categories in an ["evil"](http://ncatlab.org/nlab/show/evil), non-two-categorical way, but that was what the question sounded like to me).
Googling did reveal nothing, so I ask you people...



Is there a notion of congruence relation for essentially algebraic structures?
As Finn says, lfp categories have all coequalizers. However, there is a fly in the ointment. In set-models of algebraic theories, the underlying functor preserves the congruences and the quotients of the congruences. This means that a congruence is an equivalence relation on the underlying set and the quotient alegbraic structure has underlying set the set-quotient of the congruence. This is true even in many sorted algebraic theories. 


But in models of finite limit sketches the quotient can blow up. The quotient need not be a structure whose underlying set is the quotient of the equivalence relation on the underlying set. An example of this happens in the category of small categories when you merge nonisomorphic objects. All of a sudden arrows may compose that didn't meet each other before, creating new arrows. (So the underlying set of arrows in the quotient is not the quotient of the congruence on the underlying set.)


This is spelled out and proved in Toposes, Triples and Theories, by Michael Barr and Charles Wells, in Theorem 4.1 of Chapter 8. In that theorem, "LE" means "Finite Limits" and "EE" means "effective equivalence relations whose quotients are preserved by the underlying set functor". This book is available for free on the internet -- just google it. Exercises EEPO and ORTHODOX give specific examples of that behavior. I think there is a specific example for small categories somewhere but at the moment I can't find it.


ADDED: The specific example is in section 1.8, exercise CBB. Section 1.8 talks about effective equivalence relations in general and calls them congruences.


