---
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

-- Imports from Agda and the Agda Standard Library ----------------------------
open import Agda.Primitive  using () renaming ( Set to Type )
open import Level           using ( Level ; _βŠ”_ ) renaming (suc to lsuc)

-- Imports from the Agda Universal Algebra Library ----------------------------
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
-- The relation level at which both meet and join are operations on Con 𝑨.
Ł : 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 𝑨 (Ł Ξ± ρ β„“β‚€)) β†’ ΞΈ βŠ† ψ β†’ ΞΈ ∨ (Ο† ∧ ψ) ≑ (ΞΈ ∨ Ο†) ∧ ψ
```