---
layout: default
file: "src/Classical/Structures/Lattice/Product.lagda.md"
title: "Classical.Structures.Lattice.Product module"
date: "2026-07-24"
author: "the agda-algebras development team"
---

### Binary products of lattices {#classical-structures-lattice-product}

This is the [Classical.Structures.Lattice.Product][] module of the [Agda Universal Algebra Library][].

Given lattices `𝑳₁`{.AgdaBound} and `𝑳₂`{.AgdaBound} over
[`Sig-Lattice`][Classical.Signatures.Lattice], this module constructs their
**binary direct product** `𝑳₁`{.AgdaBound}` Γ—Λ‘ `{.AgdaFunction}`𝑳₂`{.AgdaBound}:
the lattice on the product
setoid whose meet and join act componentwise.  The construction mirrors the group
case ([Classical.Structures.Group.Product][]) but is assembled through the
setoid-level builder `setoidEqsToLattice`{.AgdaFunction} of
[Classical.Structures.Lattice][], whose interpretation clauses reduce
definitionally; consequently each of the eight lattice equations for the product is
*literally* the pair of the component equations, and no term-induction lemma is
needed.

Besides the product itself, the module characterizes the induced meet order of
[Classical.Properties.Lattice][]: the product order is the componentwise order,
definitionally, and the three accessors `≀ₓ-fst`{.AgdaFunction},
`≀ₓ-snd`{.AgdaFunction}, `≀ₓ-pair`{.AgdaFunction} name the two projections and the
pairing.  The first consumer is the FLRP closure toolkit
([FLRP.Closure][]; roadmap Β§ 3, work package WP-5), which represents
`𝑳₁ Γ—Λ‘ 𝑳₂`{.AgdaFunction} as a congruence lattice whenever its factors are so
representable.

Following the Cubical-port discipline, the underlying equivalence of the product is
isolated in `AΓ—B`{.AgdaFunction} β€” the pointwise pair of the component
equivalences β€” so it can be mechanically substituted on the eventual port.

<!--
```agda
{-# OPTIONS --cubical-compatible --exact-split --safe #-}

module Classical.Structures.Lattice.Product where


-- Imports from the Agda Standard Library ---------------------------------------
open import Data.Product          using ( _,_ ; _Γ—_ ; proj₁ ; projβ‚‚ )
open import Level                 using ( Level ; _βŠ”_ )
open import Relation.Binary       using ( Setoid )

-- Imports from the Agda Universal Algebra Library ------------------------------
open import Classical.Properties.Lattice        using  ( module Lattice-Order )
open import Classical.Structures.Lattice.Basic  using  ( Lattice ; module Lattice-Op
                                                       ; setoidEqsToLattice )
open import Setoid.Algebras.Basic               using ( π•Œ[_] ; 𝔻[_] )

private variable Ξ± ρ Ξ² Οƒ : Level
```
-->

#### The product construction

`LatticeProduct`{.AgdaModule} `𝑳₁` `𝑳₂` packages the whole development for a fixed
pair of lattices; opening it provides the product setoid, the componentwise
operations with their congruences and equations, the product lattice, and the
characterization of its order.

```agda
module LatticeProduct (𝑳₁ : Lattice Ξ± ρ) (𝑳₂ : Lattice Ξ² Οƒ) where
  private
    𝑨 = proj₁ 𝑳₁
    𝑩 = proj₁ 𝑳₂

  open Setoid 𝔻[ 𝑨 ] using ()
    renaming ( _β‰ˆ_ to _β‰ˆβ‚_ ; refl to refl₁ ; sym to sym₁ ; trans to trans₁ )
  open Setoid 𝔻[ 𝑩 ] using ()
    renaming ( _β‰ˆ_ to _β‰ˆβ‚‚_ ; refl to reflβ‚‚ ; sym to symβ‚‚ ; trans to transβ‚‚ )

  open Lattice-Op 𝑳₁ using ()
    renaming ( _∧_ to _βˆ§β‚_ ; _∨_ to _βˆ¨β‚_ ; ∧-cong to βˆ§β‚-cong ; ∨-cong to βˆ¨β‚-cong
             ; ∧-assoc-law to βˆ§β‚-assoc ; ∧-comm-law to βˆ§β‚-comm ; ∧-idem-law to βˆ§β‚-idem
             ; ∨-assoc-law to βˆ¨β‚-assoc ; ∨-comm-law to βˆ¨β‚-comm ; ∨-idem-law to βˆ¨β‚-idem
             ; absorbΛ‘-law to absorbˑ₁ ; absorbΚ³-law to absorbʳ₁ )
  open Lattice-Op 𝑳₂ using ()
    renaming ( _∧_ to _βˆ§β‚‚_ ; _∨_ to _βˆ¨β‚‚_ ; ∧-cong to βˆ§β‚‚-cong ; ∨-cong to βˆ¨β‚‚-cong
             ; ∧-assoc-law to βˆ§β‚‚-assoc ; ∧-comm-law to βˆ§β‚‚-comm ; ∧-idem-law to βˆ§β‚‚-idem
             ; ∨-assoc-law to βˆ¨β‚‚-assoc ; ∨-comm-law to βˆ¨β‚‚-comm ; ∨-idem-law to βˆ¨β‚‚-idem
             ; absorbΛ‘-law to absorbΛ‘β‚‚ ; absorbΚ³-law to absorbΚ³β‚‚ )
```

The carrier of the product is the pair type, and its equivalence is the pointwise
pair of the component equivalences β€” the isolated-equality locus for the Cubical
port.

```agda
  AΓ—B : Setoid (Ξ± βŠ” Ξ²) (ρ βŠ” Οƒ)
  AΓ—B = record
    { Carrier        = π•Œ[ 𝑨 ] Γ— π•Œ[ 𝑩 ]
    ; _β‰ˆ_            = Ξ» p q β†’ (proj₁ p β‰ˆβ‚ proj₁ q) Γ— (projβ‚‚ p β‰ˆβ‚‚ projβ‚‚ q)
    ; isEquivalence  = record
        { refl   = refl₁ , reflβ‚‚
        ; sym    = Ξ» e β†’ sym₁ (proj₁ e) , symβ‚‚ (projβ‚‚ e)
        ; trans  = Ξ» (d₁ , dβ‚‚) (e₁ , eβ‚‚) β†’ trans₁ d₁ e₁ , transβ‚‚ dβ‚‚ eβ‚‚
        }
    }

  open Setoid AΓ—B using () renaming ( _β‰ˆ_ to _β‰ˆβ‚“_ )
```

Meet and join act componentwise.  The operations project rather than pattern-match
their arguments, so they reduce on any pair expression, matched or not.

```agda
  _βˆ§β‚“_ : π•Œ[ 𝑨 ] Γ— π•Œ[ 𝑩 ] β†’ π•Œ[ 𝑨 ] Γ— π•Œ[ 𝑩 ] β†’ π•Œ[ 𝑨 ] Γ— π•Œ[ 𝑩 ]
  p βˆ§β‚“ q = (proj₁ p βˆ§β‚ proj₁ q) , (projβ‚‚ p βˆ§β‚‚ projβ‚‚ q)

  _βˆ¨β‚“_ : π•Œ[ 𝑨 ] Γ— π•Œ[ 𝑩 ] β†’ π•Œ[ 𝑨 ] Γ— π•Œ[ 𝑩 ] β†’ π•Œ[ 𝑨 ] Γ— π•Œ[ 𝑩 ]
  p βˆ¨β‚“ q = (proj₁ p βˆ¨β‚ proj₁ q) , (projβ‚‚ p βˆ¨β‚‚ projβ‚‚ q)
```

Congruence and the eight equations are all inherited componentwise: each proof is
the pair of the component proofs, applied at the projections.

```agda
  βˆ§β‚“-cong : βˆ€ {p q u v} β†’ p β‰ˆβ‚“ q β†’ u β‰ˆβ‚“ v β†’ (p βˆ§β‚“ u) β‰ˆβ‚“ (q βˆ§β‚“ v)
  βˆ§β‚“-cong e f = βˆ§β‚-cong (proj₁ e) (proj₁ f) , βˆ§β‚‚-cong (projβ‚‚ e) (projβ‚‚ f)

  βˆ¨β‚“-cong : βˆ€ {p q u v} β†’ p β‰ˆβ‚“ q β†’ u β‰ˆβ‚“ v β†’ (p βˆ¨β‚“ u) β‰ˆβ‚“ (q βˆ¨β‚“ v)
  βˆ¨β‚“-cong e f = βˆ¨β‚-cong (proj₁ e) (proj₁ f) , βˆ¨β‚‚-cong (projβ‚‚ e) (projβ‚‚ f)

  βˆ§β‚“-assoc : βˆ€ {p q r} β†’ ((p βˆ§β‚“ q) βˆ§β‚“ r) β‰ˆβ‚“ (p βˆ§β‚“ (q βˆ§β‚“ r))
  βˆ§β‚“-assoc = βˆ§β‚-assoc , βˆ§β‚‚-assoc

  βˆ§β‚“-comm : βˆ€ {p q} β†’ (p βˆ§β‚“ q) β‰ˆβ‚“ (q βˆ§β‚“ p)
  βˆ§β‚“-comm = βˆ§β‚-comm , βˆ§β‚‚-comm

  βˆ§β‚“-idem : βˆ€ {p} β†’ (p βˆ§β‚“ p) β‰ˆβ‚“ p
  βˆ§β‚“-idem = βˆ§β‚-idem , βˆ§β‚‚-idem

  βˆ¨β‚“-assoc : βˆ€ {p q r} β†’ ((p βˆ¨β‚“ q) βˆ¨β‚“ r) β‰ˆβ‚“ (p βˆ¨β‚“ (q βˆ¨β‚“ r))
  βˆ¨β‚“-assoc = βˆ¨β‚-assoc , βˆ¨β‚‚-assoc

  βˆ¨β‚“-comm : βˆ€ {p q} β†’ (p βˆ¨β‚“ q) β‰ˆβ‚“ (q βˆ¨β‚“ p)
  βˆ¨β‚“-comm = βˆ¨β‚-comm , βˆ¨β‚‚-comm

  βˆ¨β‚“-idem : βˆ€ {p} β†’ (p βˆ¨β‚“ p) β‰ˆβ‚“ p
  βˆ¨β‚“-idem = βˆ¨β‚-idem , βˆ¨β‚‚-idem

  absorbΛ‘β‚“ : βˆ€ {p q} β†’ (p βˆ§β‚“ (p βˆ¨β‚“ q)) β‰ˆβ‚“ p
  absorbΛ‘β‚“ = absorbˑ₁ , absorbΛ‘β‚‚

  absorbΚ³β‚“ : βˆ€ {p q} β†’ ((p βˆ§β‚“ q) βˆ¨β‚“ p) β‰ˆβ‚“ p
  absorbΚ³β‚“ = absorbʳ₁ , absorbΚ³β‚‚
```

Assembling through the setoid-level builder yields the product lattice.

```agda
  Γ—Λ‘-Lattice : Lattice (Ξ± βŠ” Ξ²) (ρ βŠ” Οƒ)
  Γ—Λ‘-Lattice = setoidEqsToLattice AΓ—B _βˆ§β‚“_ _βˆ¨β‚“_ βˆ§β‚“-cong βˆ¨β‚“-cong
    βˆ§β‚“-assoc βˆ§β‚“-comm βˆ§β‚“-idem βˆ¨β‚“-assoc βˆ¨β‚“-comm βˆ¨β‚“-idem absorbΛ‘β‚“ absorbΚ³β‚“
```

#### The product order is the componentwise order

The meet order of `Γ—Λ‘-Lattice`{.AgdaFunction} at `(p , q)` unfolds definitionally
to the pair of the component meet orders, because the builder's interpretation
applies its argument tuple and the product setoid's equality is the pointwise pair.
The three accessors below are therefore projections and pairing, but we name them:
they are the interface through which consumers (the FLRP closure lemmas) read the
product order without unfolding the builder.

```agda
  open Lattice-Order Γ—Λ‘-Lattice using () renaming ( _≀_ to _≀ₓ_ )
  open Lattice-Order 𝑳₁ using () renaming ( _≀_ to _≀₁_ )
  open Lattice-Order 𝑳₂ using () renaming ( _≀_ to _≀₂_ )

  -- The product order projects to the first factor's order.
  ≀ₓ-fst : βˆ€ {p q} β†’ p ≀ₓ q β†’ proj₁ p ≀₁ proj₁ q
  ≀ₓ-fst = proj₁

  -- The product order projects to the second factor's order.
  ≀ₓ-snd : βˆ€ {p q} β†’ p ≀ₓ q β†’ projβ‚‚ p ≀₂ projβ‚‚ q
  ≀ₓ-snd = projβ‚‚

  -- Componentwise order proofs pair into a product order proof.
  ≀ₓ-pair : βˆ€ {p q} β†’ proj₁ p ≀₁ proj₁ q β†’ projβ‚‚ p ≀₂ projβ‚‚ q β†’ p ≀ₓ q
  ≀ₓ-pair e f = e , f
```

#### The product operator

The standalone binary operator, for consumers that need only the lattice.

```agda
infixr 7 _Γ—Λ‘_

_Γ—Λ‘_ : Lattice Ξ± ρ β†’ Lattice Ξ² Οƒ β†’ Lattice (Ξ± βŠ” Ξ²) (ρ βŠ” Οƒ)
𝑳₁ Γ—Λ‘ 𝑳₂ = LatticeProduct.Γ—Λ‘-Lattice 𝑳₁ 𝑳₂
```

--------------------------------------