Relative monad #
This file defines the RelativeMonad type class, both as a category-theoretic object and a
programming object.
The data of a relative monad over a functor J : C ⟶ D consists of:
- a map between objects
T : C → D - a natural transformation
η : ∀ {X}, J X ⟶ T X - a natural transformation
μ : ∀ {X Y}, (J X ⟶ T Y) ⟶ (T X ⟶ T Y)satisfying three equations: μ_{X, X} ∘ η_X = 1_{T X}(left unit)∀ f, η_X ≫ μ_{X, Y} = f(right unit)∀ f g, μ_{X, Z} (f ≫ μ_{Y, Z} g) = μ_{X, Y} f ≫ μ_{Y, Z} g(associativity)
- T : C → D
The monadic mapping on objects.
The unit for the relative monad.
The multiplication for the monad.
- assoc {X Y Z : C} (f : J.obj X ⟶ self.T Y) (g : J.obj Y ⟶ self.T Z) : self.μ (CategoryStruct.comp f (self.μ g)) = CategoryStruct.comp (self.μ f) (self.μ g)
μis associative.
Instances For
μ is associative.
The functor induced by a relative monad.
Note: this is not the same as the underlying functor of the relative monad.
Equations
Instances For
The natural transformation from the underlying functor of the relative monad, to the functor induced by the relative monad.
Equations
Instances For
If a relative monad is over the identity functor, it is a monad.
Equations
Instances For
Transport a relative monad along a natural isomorphism of the underlying functor.
Equations
Instances For
Precompose a relative monad M : RelativeMonad C D J along a functor J' : C' ⥤ C.
Equations
Instances For
The product of two relative monads is a relative monad on the corresponding product categories.
Equations
Instances For
A morphism of relative monads, where the two ending categories may be different. We require another functor & a natural isomorphism to correct for this discrepancy.
- J₁₂ : Functor D₁ D₂
- map_μ {X Y : C} (f : J₁.obj X ⟶ M₁.T Y) : CategoryStruct.comp (self.J₁₂.map (M₁.μ f)) self.map = CategoryStruct.comp self.map (M₂.μ (CategoryStruct.comp (self.φ.hom.app X) (CategoryStruct.comp (self.J₁₂.map f) self.map)))
Instances For
Old stuff below. #
Turns out one cannot just work with Type u → Type v, since in the relational context, relative
relational specification monad actually has signature Type u₁ × Type u₂ → Type v₁ × Type v₂. This
means that we have to develop the general theory at the category-theoretic level.
Type class for the relative monad
Instances
Equations
Instances For
Equations
Instances For
Equations
Equations
Instances
Instances
- toLift : MonadLiftT m n
- invLift : MonadLiftT n m
- monadLift_left_inv {α : Type u} : Function.LeftInverse monadLift monadLift
- monadLift_right_inv {α : Type u} : Function.RightInverse monadLift monadLift