Ordered monads #
This file collects all definitions and basic theorems about adding ordering to monads.
Main definitions #
OrderedMonad
OrderedMonadAlgebra
OrderedMonadLift
MonadIdeal
OrderedMonadTransformer
- Left / right Kan extension of ordered monads
pointwiseRelation r f g
is the pullback of a relation r
on β
to a relation on α
via f
and g
.
Equations
- pointwiseRelation r f g a b = r (f a) (g b)
Instances For
An ordered monad m
is a monad equipped with a preorder on each type m α
, such that the bind
operation preserves the order.
Instances
Equations
Equations
The less-than-or-equal relation on an ordered monad m
.
Instances For
The less-than relation on an ordered monad m
.
Instances For
The less-than-or-equal relation on an ordered monad m
.
Equations
- OrderedMonad.«term_≤ₘ_» = Lean.ParserDescr.trailingNode `OrderedMonad.«term_≤ₘ_» 50 51 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ≤ₘ ") (Lean.ParserDescr.cat `term 51))
Instances For
The less-than relation on an ordered monad m
.
Equations
- OrderedMonad.«term_<ₘ_» = Lean.ParserDescr.trailingNode `OrderedMonad.«term_<ₘ_» 50 51 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " <ₘ ") (Lean.ParserDescr.cat `term 51))
Instances For
Any monad can be given the discrete preorder, where a ≤ b
if and only if a = b
.
This is put into the Discrete
scope in order to avoid conflicts with other instances. This
instance should only be used as a last resort.
Equations
Instances For
Instances
If the target monad n
is ordered, then we have a preorder on the monad lifts from m
to n
.
Equations
- monadLift_mono {α : Type u} : Monotone MonadLift.monadLift
Instances
Instances
Equations
Given the (default) discrete preorder on the beginning monad m
, we can have a preorder on the
monad lifts from m
to n
.
This is stated as a definition and not an instance, since oftentimes we want to have another instance on the monad lift.
Equations
Instances For
Instances
Equations
- MonadRelation.instOfMonadOfOrderedMonadOfMonadLiftT = { monadRel := fun {α : Type ?u.42} (a : m α) (b : n α) => monadLE (monadLift a) b }
- liftOf_mono {m n : Type u → Type v} [OrderedMonad m] [OrderedMonad n] [OrderedMonadLiftT m n] : OrderedMonadLiftT (t m) (t n)
Instances
- assert_assume {α : Type u} : _root_.AssertAssume (m α)