For a congruence on a ring, the equivalence class containing 0 is always a two-sided ideal, and the two operations on the set of equivalence classes define the corresponding quotient ring. General The general notion of a congruence relation can be formally defined in the context of universal algebra, a field which studies ideas common to all algebraic structures. In this setting, a relation on a given algebraic structure is called compatible if for each and each -ary operation defined on the structure: whenever and ... and , then . A congruence relation on the structure is then defined as an equivalence relation that is also compatible. Relation with homomorphisms If is a homomorphism between two algebraic structures (such as homomorphism of groups, or a linear map between vector spaces), then the relation defined by if and only if is a congruence relation on . By the first isomorphism theorem, the image of A under is a substructure of B isomorphic to the quotient of A by this congruence. On the other hand, the congruence relation induces a unique homomorphism given by . Thus, there is a natural correspondence between the congruences and the homomorphisms of any given algebraic structure. Congruences of groups, and normal subgroups and ideals In the particular case of groups, congruence relations can be described in elementary terms as follows: If G is a group (with identity element e and operation *) and ~ is a binary relation on G, then ~ is a congruence whenever: Given any element a of G, a ~ a (reflexivity); Given any elements a and b of G, if a ~ b, then b ~ a (symmetry); Given any elements a, b, and c of G, if a ~ b and b ~ c, then a ~ c (transitivity); Given any elements a, a' , b, and b' of G, if a ~ a' and b ~ b' , then a * b ~ a' * b' ; Given any elements a and a' of G, if a ~ a' , then a−1 ~ a' −1 (this can actually be proven from the other four, so is strictly redundant). Conditions 1, 2, and 3 say that ~ is an equivalence relation. A congruence ~ is determined entirely by the set {a ∈ G : a ~ e} of those elements of G that are congruent to the identity element, and