Skip to content

Legacy.Base.Adjunction.Residuation

Residuation

This is the Legacy.Base.Adjunction.Residuation module of the Agda Universal Algebra Library.

{-# OPTIONS --cubical-compatible --exact-split --safe #-}

module Legacy.Base.Adjunction.Residuation where

-- Imports from Agda and the Agda Standard Library --------------------------------------
open import Agda.Primitive           using () renaming ( Set to Type )
open import Function.Base            using ( _on_ ; _โˆ˜_ )
open import Level                    using ( Level ; _โŠ”_ ; suc )
open import Relation.Binary.Bundles  using ( Poset )
open import Relation.Binary.Core     using ( _Preserves_โŸถ_ )

-- Imports from the Agda Universal Algebra Library --------------------------------------
open import Legacy.Base.Relations.Discrete using ( PointWise )

private variable
 a ฮนแตƒ ฮฑ b ฮนแต‡ ฮฒ : Level

module _ (A : Poset a ฮนแตƒ ฮฑ)(B : Poset b ฮนแต‡ ฮฒ) where
 open Poset
 private
  _โ‰คA_ = _โ‰ค_ A
  _โ‰คB_ = _โ‰ค_ B

 record Residuation : Type (suc (ฮฑ โŠ” a โŠ” ฮฒ โŠ” b))  where
  field
   f      : Carrier A โ†’ Carrier B
   g      : Carrier B โ†’ Carrier A
   fhom   : f Preserves _โ‰คA_ โŸถ _โ‰คB_
   ghom   : g Preserves _โ‰คB_ โŸถ _โ‰คA_
   gfโ‰ฅid  : โˆ€ a โ†’ a โ‰คA g (f a)
   fgโ‰คid  : โˆ€ b โ†’ f (g b) โ‰คB b

Basic properties of residual pairs

open Residuation
open Poset

module _ {A : Poset a ฮนแตƒ ฮฑ} {B : Poset b ฮนแต‡ ฮฒ} (R : Residuation A B) where
 private
  _โ‰คA_ = _โ‰ค_ A
  _โ‰คB_ = _โ‰ค_ B

  ๐‘“ = (R .f)
  ๐‘” = (R .g)

  -- Pointwise equality of unary functions wrt equality on the given poset carrier
  -- 1. pointwise equality on B โ†’ A
  _โ‰ˆฬ‡A_ = PointWise{a = b}{A = Carrier B} (_โ‰ˆ_ A)
  -- 2. pointwise equality on A โ†’ B
  _โ‰ˆฬ‡B_ = PointWise{a = a}{A = Carrier A} (_โ‰ˆ_ B)

In a ring R, if x y : R and if x y x = x, then y is called a weak inverse for x. (A ring is called von Neumann regular if every element has a unique weak inverse.)

 -- ๐‘” is a weak inverse for ๐‘“
 weak-inverse : (๐‘“ โˆ˜ ๐‘” โˆ˜ ๐‘“) โ‰ˆฬ‡B ๐‘“
 weak-inverse a = antisym B lt gt
  where
  lt : ๐‘“ (๐‘” (๐‘“ a)) โ‰คB ๐‘“ a
  lt = fgโ‰คid R (๐‘“ a)
  gt : ๐‘“ a โ‰คB ๐‘“ (๐‘” (๐‘“ a))
  gt = fhom R (gfโ‰ฅid R a)

 -- ๐‘“ is a weak inverse of ๐‘”
 weak-inverse' : (๐‘” โˆ˜ ๐‘“ โˆ˜ ๐‘”) โ‰ˆฬ‡A ๐‘”
 weak-inverse' b = antisym A lt gt
  where
  lt : ๐‘” (๐‘“ (๐‘” b)) โ‰คA ๐‘” b
  lt = ghom R (fgโ‰คid R b)
  gt : ๐‘” b โ‰คA ๐‘” (๐‘“ (๐‘” b))
  gt = gfโ‰ฅid R (๐‘” b)
{-# WARNING_ON_USAGE Residuation   "Use Overture.Adjunction.Residuation.Residuation instead. Deprecated under #305; removal planned one minor cycle later." #-}
{-# WARNING_ON_USAGE weak-inverse  "Use Overture.Adjunction.Residuation.weak-inverse instead. Deprecated under #305; removal planned one minor cycle later." #-}
{-# WARNING_ON_USAGE weak-inverse' "Use Overture.Adjunction.Residuation.weak-inverse' instead. Deprecated under #305; removal planned one minor cycle later." #-}