---
layout: default
file: "src/Setoid/Congruences/Properties.lagda.md"
title: "Setoid.Congruences.Properties module"
date: "2026-06-19"
author: "the agda-algebras development team"
---
### Distributive and modular congruence lattices
This is the [Setoid.Congruences.Properties][] module of the [Agda Universal Algebra Library][].
[Setoid.Congruences.CompleteLattice][] assembled the congruence lattice of an
algebra. This module names two properties that lattice may have β being
**distributive** and being **modular** β which the Maltsev conditions of congruence
distributivity (JΓ³nsson) and congruence modularity (Day) characterize by the
existence of terms ([Setoid.Varieties.Maltsev][]).
As in [Setoid.Congruences.CompleteLattice][], the lattice equations are stated at the
**absorbing** relation level `π ββ = π β π₯ β Ξ± β Ο β ββ`. At this level the join
`_β¨_` (whose codomain otherwise bumps the level to `π β`) lands back at the level of
the meet `_β§_`, so both are operations on `Con π¨ (π ββ)` and the equations type-check.
<!--
```agda
{-# OPTIONS --cubical-compatible --exact-split --safe #-}
open import Overture using ( π ; π₯ ; Signature )
module Setoid.Congruences.Properties {π : Signature π π₯} where
open import Agda.Primitive using () renaming ( Set to Type )
open import Level using ( Level ; _β_ ) renaming (suc to lsuc)
open import Setoid.Algebras.Basic {π = π} using ( Algebra )
open import Setoid.Congruences.Basic {π = π} using ( Con )
open import Setoid.Congruences.Lattice {π = π} using ( _β_ ; _β_ ; _β§_ )
open import Setoid.Congruences.Generation {π = π} using ( _β¨_ )
```
-->
#### The absorbing relation level
```agda
Ε : Level β Level β Level β Level
Ε Ξ± Ο ββ = π β π₯ β Ξ± β Ο β ββ
```
#### Congruence distributivity
An algebra `π¨` is **congruence-distributive** (CD) when its congruence lattice
satisfies the distributive law `ΞΈ β§ (Ο β¨ Ο) β (ΞΈ β§ Ο) β¨ (ΞΈ β§ Ο)`. (The reverse
containment half of this `β` is automatic in any lattice; the distributive law is the
forward containment `ΞΈ β§ (Ο β¨ Ο) β (ΞΈ β§ Ο) β¨ (ΞΈ β§ Ο)`, but we state the full
symmetric `β` result for uniformity.)
```agda
module _ {Ξ± Ο : Level} (π¨ : Algebra Ξ± Ο)(ββ : Level) where
CongruenceDistributive : Type (lsuc (Ε Ξ± Ο ββ))
CongruenceDistributive = (ΞΈ Ο Ο : Con π¨ (Ε Ξ± Ο ββ)) β ΞΈ β§ (Ο β¨ Ο) β (ΞΈ β§ Ο) β¨ (ΞΈ β§ Ο)
```
#### Congruence modularity
An algebra `π¨` is **congruence-modular** (CM) when its congruence lattice satisfies
the modular law: whenever `ΞΈ β Ο`, `ΞΈ β¨ (Ο β§ Ο) β (ΞΈ β¨ Ο) β§ Ο`. Distributivity
implies modularity, so the congruence-distributive algebras form a subclass of the
congruence-modular ones.
```agda
CongruenceModular : Type (lsuc (Ε Ξ± Ο ββ))
CongruenceModular = (ΞΈ Ο Ο : Con π¨ (Ε Ξ± Ο ββ)) β ΞΈ β Ο β ΞΈ β¨ (Ο β§ Ο) β (ΞΈ β¨ Ο) β§ Ο
```