definition

Given a Preorder , the opposite preorder has the same elements, with iff .

Sources: 7 Sketches Example 1.58, 1.72, Exercise 1.66; DaoFP §8.1 (opposite categories), §5.2 (duality).

  • The identity is monotone iff is a Dagger Preorder (Example 1.72).
  • The principal-upper-set map is monotone (7S Exercise 1.66) — a preorder Yoneda Embedding.
  • Reversing the order swaps meets and joins, and swaps left and right adjoints in a Galois Connection. This is the preorder instance of the Opposite Category and of duality (“reversing the arrows”, DaoFP §3, §5.2): every statement about preorders has a dual obtained by replacing with .
  • The reverse ordering on (“like golf”) is ; the base of Lawvere metric spaces is .

Docs: Vignette: preorders

Builds on: Preorder (Preorder) — run that note’s Julia code first.

struct OppositePreorder{T,P<:Preorder{T}} <: Preorder{T}
  p::P
end
leq(op::OppositePreorder, x, y) = leq(op.p, y, x)
-- Mathlib: `OrderDual α` (notation αᵒᵈ) reverses the order
example {α : Type} [Preorder α] (a b : α) : OrderDual.toDual a ≤ OrderDual.toDual b ↔ b ≤ a :=
  OrderDual.toDual_le_toDual
newtype Op a = Op a
instance Preorder a => Preorder (Op a) where
  leq (Op x) (Op y) = leq y x
-- cf. Data.Ord.Down for Ord