---
layout: default
file: "src/Order/Iso.lagda.md"
title : "Order.Iso module (The Agda Universal Algebra Library)"
date : "2026-07-26"
author: "agda-algebras development team"
---
### Order isomorphisms
This is the [Order.Iso][] module of the [Agda Universal Algebra Library][].
An **order isomorphism** between two ordered objects is a pair of monotone maps that
are mutually inverse up to the respective equivalences. Because both maps are
monotone and the round trips are the identity up to the equivalence, an order
isomorphism transports every existing infimum and supremum, so isomorphic posets
carry the same lattice (indeed, complete-lattice) structure; this is why no separate
preservation clauses for meet and join are needed.
`OrderIso`{.AgdaRecord} states this for *raw relations* rather than for a bundle, so
it applies uniformly to setoid-valued and propositionally-valued orders. That
generality is what the library's two motivating instances need: the congruence poset
`(Con π¨ , β , β)` of [Setoid.Congruences.Lattice][] carries an equivalence of *mutual
containment* rather than propositional equality, while a classical lattice carries
its meet order from [Classical.Properties.Lattice][].
(The standard library's `IsOrderIsomorphism`{.AgdaRecord} packages one map with
surjectivity instead of an explicit inverse; the two presentations are
interconvertible, and the inverse-pair form is the convenient one for transporting
structure.)
The record was first introduced next to its first use in a downstream development,
with a note that it should migrate here once the group-theoretic side of the
library needed it. [Classical.Structures.Group.Congruences][] is that consumer
(the correspondence between normal subgroups and congruences is ordinary group
theory), so the record now lives in `Order/`.
<!--
```agda
{-# OPTIONS --without-K --exact-split --safe #-}
module Order.Iso where
open import Agda.Primitive using () renaming ( Set to Type )
open import Function using ( _β_ )
open import Level using ( Level ; _β_ )
open import Relation.Binary using () renaming ( Rel to BinaryRel )
```
-->
#### The record
```agda
record OrderIso
{a b ββ ββ mβ mβ : Level}
{A : Type a} {B : Type b}
(_ββ_ : BinaryRel A ββ) (_β€β_ : BinaryRel A ββ)
(_ββ_ : BinaryRel B mβ) (_β€β_ : BinaryRel B mβ) : Type (a β b β ββ β ββ β mβ β mβ) where
field
to : A β B
from : B β A
to-mono : β {x y} β x β€β y β to x β€β to y
from-mono : β {u v} β u β€β v β from u β€β from v
toβfrom : β u β to (from u) ββ u
fromβto : β x β from (to x) ββ x
```
#### Composition
Order isomorphisms compose. The round trips of the composite pass the inner
round trip through the outer maps, which is sound only *up to the middle
equivalence* β so composition asks for two congruence witnesses (the second
map's `to` and the first map's `from` respect the middle equivalence) and for
transitivity of the two end equivalences. These are not derivable from the
raw relations, but every instance has them: for setoid-valued orders they are
the setoid laws, and for containment-style orders (congruences, intervals,
partitions) they are monotonicity applied to the two directions of the
equivalence. Nothing is assumed of the middle relations beyond what the two
isomorphisms already state.
```agda
module _
{a b c ββ ββ mβ mβ nβ nβ : Level}
{A : Type a} {B : Type b} {C : Type c}
{_ββ_ : BinaryRel A ββ} {_β€β_ : BinaryRel A ββ}
{_ββ_ : BinaryRel B mβ} {_β€β_ : BinaryRel B mβ}
{_ββ_ : BinaryRel C nβ} {_β€β_ : BinaryRel C nβ}
where
OrderIso-trans :
(F : OrderIso _ββ_ _β€β_ _ββ_ _β€β_) (G : OrderIso _ββ_ _β€β_ _ββ_ _β€β_)
β (β {x y} β x ββ y β OrderIso.to G x ββ OrderIso.to G y)
β (β {x y} β x ββ y β OrderIso.from F x ββ OrderIso.from F y)
β (β {x y z} β x ββ y β y ββ z β x ββ z)
β (β {x y z} β x ββ y β y ββ z β x ββ z)
β OrderIso _ββ_ _β€β_ _ββ_ _β€β_
OrderIso-trans F G G-to-cong F-from-cong ββ-trans ββ-trans = record
{ to = G.to β F.to
; from = F.from β G.from
; to-mono = G.to-mono β F.to-mono
; from-mono = F.from-mono β G.from-mono
; toβfrom = Ξ» u β ββ-trans (G-to-cong (F.toβfrom (G.from u))) (G.toβfrom u)
; fromβto = Ξ» x β ββ-trans (F-from-cong (G.fromβto (F.to x))) (F.fromβto x)
}
where
module F = OrderIso F
module G = OrderIso G
```
--------------------------------------