Copyright | Guillaume Sabbagh 2022 |
---|---|
License | GPL-3 |
Maintainer | guillaumesabbagh@protonmail.com |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Each Category
has an opposite one where morphisms are reversed.
A CommaCategory
is intuitively a category where objects are selected morphisms of another category C and morphisms are selected commutative squares in C.
More precisely, given two Diagram
s T : E -> C
and S : D -> C
, a CommaObject
in the CommaCategory
(T|S) is a triplet <e,d,f> where f : T(e) -> S(d)
.
A CommaMorphism
from <e1,d1,f1> to <e2,d2,f2> in the CommaCategory
(T|S) is a couple <k,h> where T(k) : T(e1) -> T(e2)
, S(h) : S(d1) -> S(d2)
such that f2 @ T(k) = S(h) @ f1
.
See Categories for the working mathematician, Saunders Mac Lane, P.46.
If the category C is a FiniteCategory
, then the CommaCategory
of C is also a FiniteCategory
. Otherwise it is only a Category
.
Synopsis
- data CommaObject o1 o2 m3
- indexSource :: CommaObject o1 o2 m3 -> o1
- indexTarget :: CommaObject o1 o2 m3 -> o2
- selectedArrow :: CommaObject o1 o2 m3 -> m3
- commaObject :: (Morphism m3 o3, Eq o1, Eq o2, Eq o3) => Diagram c1 m1 o1 c3 m3 o3 -> Diagram c2 m2 o2 c3 m3 o3 -> o1 -> o2 -> m3 -> Maybe (CommaObject o1 o2 m3)
- unsafeCommaObject :: o1 -> o2 -> m3 -> CommaObject o1 o2 m3
- data CommaMorphism o1 o2 m1 m2 m3
- indexFirstArrow :: CommaMorphism o1 o2 m1 m2 m3 -> m1
- indexSecondArrow :: CommaMorphism o1 o2 m1 m2 m3 -> m2
- commaMorphism :: (Morphism m3 o3, Eq o1, Eq o2, Eq o3, Eq m1, Eq m2, Eq m3) => Diagram c1 m1 o1 c3 m3 o3 -> Diagram c2 m2 o2 c3 m3 o3 -> CommaObject o1 o2 m3 -> CommaObject o1 o2 m3 -> m1 -> m2 -> Maybe (CommaMorphism o1 o2 m1 m2 m3)
- unsafeCommaMorphism :: CommaObject o1 o2 m3 -> CommaObject o1 o2 m3 -> m1 -> m2 -> CommaMorphism o1 o2 m1 m2 m3
- data CommaCategory c1 m1 o1 c2 m2 o2 c3 m3 o3 = CommaCategory {
- leftDiagram :: Diagram c1 m1 o1 c3 m3 o3
- rightDiagram :: Diagram c2 m2 o2 c3 m3 o3
- sliceCategory :: (FiniteCategory c m o, Morphism m o, Eq c, Eq m, Eq o) => c -> o -> Maybe (CommaCategory c m o One One One c m o)
- cosliceCategory :: (FiniteCategory c m o, Morphism m o, Eq c, Eq m, Eq o) => c -> o -> Maybe (CommaCategory One One One c m o c m o)
- arrowCategory :: (FiniteCategory c m o, Morphism m o, Eq c, Eq m, Eq o) => c -> CommaCategory c m o c m o c m o
Comma object
data CommaObject o1 o2 m3 Source #
A CommaObject
in the CommaCategory
(T|S) is a triplet <e,d,f> where f : T(e) -> S(d)
.
See "Categories for the working mathematician", Saunders Mac Lane, P.46.
The CommaObject
constructor is private, use the smart constructor commaObject
or the unsafe one unsafeCommaObject
.
Instances
(Eq o1, Eq o2, Eq m3) => Eq (CommaObject o1 o2 m3) Source # | |
Defined in Math.Categories.CommaCategory (==) :: CommaObject o1 o2 m3 -> CommaObject o1 o2 m3 -> Bool (/=) :: CommaObject o1 o2 m3 -> CommaObject o1 o2 m3 -> Bool | |
(Show o1, Show o2, Show m3) => Show (CommaObject o1 o2 m3) Source # | |
Defined in Math.Categories.CommaCategory showsPrec :: Int -> CommaObject o1 o2 m3 -> ShowS show :: CommaObject o1 o2 m3 -> String showList :: [CommaObject o1 o2 m3] -> ShowS | |
(PrettyPrint o1, PrettyPrint o2, PrettyPrint m3) => PrettyPrint (CommaObject o1 o2 m3) Source # | |
Defined in Math.Categories.CommaCategory pprint :: CommaObject o1 o2 m3 -> String Source # | |
(Morphism m1 o1, Morphism m2 o2, Eq o1, Eq o2, Eq m3) => Morphism (CommaMorphism o1 o2 m1 m2 m3) (CommaObject o1 o2 m3) Source # | |
Defined in Math.Categories.CommaCategory (@?) :: CommaMorphism o1 o2 m1 m2 m3 -> CommaMorphism o1 o2 m1 m2 m3 -> Maybe (CommaMorphism o1 o2 m1 m2 m3) Source # source :: CommaMorphism o1 o2 m1 m2 m3 -> CommaObject o1 o2 m3 Source # target :: CommaMorphism o1 o2 m1 m2 m3 -> CommaObject o1 o2 m3 Source # | |
(Category c1 m1 o1, Morphism m1 o1, Eq m1, Eq o1, Category c2 m2 o2, Morphism m2 o2, Eq m2, Eq o2, Category c3 m3 o3, Morphism m3 o3, Eq m3, Eq o3) => Category (CommaCategory c1 m1 o1 c2 m2 o2 c3 m3 o3) (CommaMorphism o1 o2 m1 m2 m3) (CommaObject o1 o2 m3) Source # | |
Defined in Math.Categories.CommaCategory identity :: CommaCategory c1 m1 o1 c2 m2 o2 c3 m3 o3 -> CommaObject o1 o2 m3 -> CommaMorphism o1 o2 m1 m2 m3 Source # ar :: CommaCategory c1 m1 o1 c2 m2 o2 c3 m3 o3 -> CommaObject o1 o2 m3 -> CommaObject o1 o2 m3 -> Set (CommaMorphism o1 o2 m1 m2 m3) Source # genAr :: CommaCategory c1 m1 o1 c2 m2 o2 c3 m3 o3 -> CommaObject o1 o2 m3 -> CommaObject o1 o2 m3 -> Set (CommaMorphism o1 o2 m1 m2 m3) Source # decompose :: CommaCategory c1 m1 o1 c2 m2 o2 c3 m3 o3 -> CommaMorphism o1 o2 m1 m2 m3 -> [CommaMorphism o1 o2 m1 m2 m3] Source # | |
(FiniteCategory c1 m1 o1, Morphism m1 o1, Eq m1, Eq o1, FiniteCategory c2 m2 o2, Morphism m2 o2, Eq m2, Eq o2, FiniteCategory c3 m3 o3, Morphism m3 o3, Eq m3, Eq o3) => FiniteCategory (CommaCategory c1 m1 o1 c2 m2 o2 c3 m3 o3) (CommaMorphism o1 o2 m1 m2 m3) (CommaObject o1 o2 m3) Source # | |
Defined in Math.Categories.CommaCategory ob :: CommaCategory c1 m1 o1 c2 m2 o2 c3 m3 o3 -> Set (CommaObject o1 o2 m3) Source # |
Getters
indexSource :: CommaObject o1 o2 m3 -> o1 Source #
e, the indexing object of the source of the selectedArrow
.
indexTarget :: CommaObject o1 o2 m3 -> o2 Source #
d, the indexing object of the target of the selectedArrow
.
selectedArrow :: CommaObject o1 o2 m3 -> m3 Source #
f, the selected arrow of the target category.
Smart constructors
commaObject :: (Morphism m3 o3, Eq o1, Eq o2, Eq o3) => Diagram c1 m1 o1 c3 m3 o3 -> Diagram c2 m2 o2 c3 m3 o3 -> o1 -> o2 -> m3 -> Maybe (CommaObject o1 o2 m3) Source #
Smart constructor of CommaObject
which checks the structure of the CommaObject
.
unsafeCommaObject :: o1 -> o2 -> m3 -> CommaObject o1 o2 m3 Source #
Unsafe way of constructing a CommaObject
: the structure of the CommaObject
Comma morphism
data CommaMorphism o1 o2 m1 m2 m3 Source #
A CommaMorphism
from <e1,d1,f1> to <e2,d2,f2> in the CommaCategory
(T|S) is a couple <k,h> where T(k) : T(e1) -> T(e2)
, S(h) : S(d1) -> S(d2)
such that f2 @ T(k) = S(h) @ f1
.
See "Categories for the working mathematician", Saunders Mac Lane, P.46.
Instances
(Eq o1, Eq o2, Eq m3, Eq m1, Eq m2) => Eq (CommaMorphism o1 o2 m1 m2 m3) Source # | |
Defined in Math.Categories.CommaCategory (==) :: CommaMorphism o1 o2 m1 m2 m3 -> CommaMorphism o1 o2 m1 m2 m3 -> Bool (/=) :: CommaMorphism o1 o2 m1 m2 m3 -> CommaMorphism o1 o2 m1 m2 m3 -> Bool | |
(Show o1, Show o2, Show m1, Show m2, Show m3) => Show (CommaMorphism o1 o2 m1 m2 m3) Source # | |
Defined in Math.Categories.CommaCategory showsPrec :: Int -> CommaMorphism o1 o2 m1 m2 m3 -> ShowS show :: CommaMorphism o1 o2 m1 m2 m3 -> String showList :: [CommaMorphism o1 o2 m1 m2 m3] -> ShowS | |
(PrettyPrint m1, PrettyPrint m2) => PrettyPrint (CommaMorphism o1 o2 m1 m2 m3) Source # | |
Defined in Math.Categories.CommaCategory pprint :: CommaMorphism o1 o2 m1 m2 m3 -> String Source # | |
(Morphism m1 o1, Morphism m2 o2, Eq o1, Eq o2, Eq m3) => Morphism (CommaMorphism o1 o2 m1 m2 m3) (CommaObject o1 o2 m3) Source # | |
Defined in Math.Categories.CommaCategory (@?) :: CommaMorphism o1 o2 m1 m2 m3 -> CommaMorphism o1 o2 m1 m2 m3 -> Maybe (CommaMorphism o1 o2 m1 m2 m3) Source # source :: CommaMorphism o1 o2 m1 m2 m3 -> CommaObject o1 o2 m3 Source # target :: CommaMorphism o1 o2 m1 m2 m3 -> CommaObject o1 o2 m3 Source # | |
(Category c1 m1 o1, Morphism m1 o1, Eq m1, Eq o1, Category c2 m2 o2, Morphism m2 o2, Eq m2, Eq o2, Category c3 m3 o3, Morphism m3 o3, Eq m3, Eq o3) => Category (CommaCategory c1 m1 o1 c2 m2 o2 c3 m3 o3) (CommaMorphism o1 o2 m1 m2 m3) (CommaObject o1 o2 m3) Source # | |
Defined in Math.Categories.CommaCategory identity :: CommaCategory c1 m1 o1 c2 m2 o2 c3 m3 o3 -> CommaObject o1 o2 m3 -> CommaMorphism o1 o2 m1 m2 m3 Source # ar :: CommaCategory c1 m1 o1 c2 m2 o2 c3 m3 o3 -> CommaObject o1 o2 m3 -> CommaObject o1 o2 m3 -> Set (CommaMorphism o1 o2 m1 m2 m3) Source # genAr :: CommaCategory c1 m1 o1 c2 m2 o2 c3 m3 o3 -> CommaObject o1 o2 m3 -> CommaObject o1 o2 m3 -> Set (CommaMorphism o1 o2 m1 m2 m3) Source # decompose :: CommaCategory c1 m1 o1 c2 m2 o2 c3 m3 o3 -> CommaMorphism o1 o2 m1 m2 m3 -> [CommaMorphism o1 o2 m1 m2 m3] Source # | |
(FiniteCategory c1 m1 o1, Morphism m1 o1, Eq m1, Eq o1, FiniteCategory c2 m2 o2, Morphism m2 o2, Eq m2, Eq o2, FiniteCategory c3 m3 o3, Morphism m3 o3, Eq m3, Eq o3) => FiniteCategory (CommaCategory c1 m1 o1 c2 m2 o2 c3 m3 o3) (CommaMorphism o1 o2 m1 m2 m3) (CommaObject o1 o2 m3) Source # | |
Defined in Math.Categories.CommaCategory ob :: CommaCategory c1 m1 o1 c2 m2 o2 c3 m3 o3 -> Set (CommaObject o1 o2 m3) Source # |
Getters
indexFirstArrow :: CommaMorphism o1 o2 m1 m2 m3 -> m1 Source #
k, the indexing arrow of the first functor.
indexSecondArrow :: CommaMorphism o1 o2 m1 m2 m3 -> m2 Source #
h, the indexing arrow of the second functor.
Smart constructors
commaMorphism :: (Morphism m3 o3, Eq o1, Eq o2, Eq o3, Eq m1, Eq m2, Eq m3) => Diagram c1 m1 o1 c3 m3 o3 -> Diagram c2 m2 o2 c3 m3 o3 -> CommaObject o1 o2 m3 -> CommaObject o1 o2 m3 -> m1 -> m2 -> Maybe (CommaMorphism o1 o2 m1 m2 m3) Source #
Smart constructor of CommaMorphism
, checks the structure of the CommaMorphism
at construction.
unsafeCommaMorphism :: CommaObject o1 o2 m3 -> CommaObject o1 o2 m3 -> m1 -> m2 -> CommaMorphism o1 o2 m1 m2 m3 Source #
Unsafe constructor of CommaMorphism
, does not check the structure of the CommaMorphism
.
data CommaCategory c1 m1 o1 c2 m2 o2 c3 m3 o3 Source #
A CommaCategory
is a couple (T|S) with T and S two diagrams with the same target.
See "Categories for the working mathematician", Saunders Mac Lane, P.46.
CommaCategory | |
|
Instances
(Eq c1, Eq c3, Eq o1, Eq o3, Eq m1, Eq m3, Eq c2, Eq o2, Eq m2) => Eq (CommaCategory c1 m1 o1 c2 m2 o2 c3 m3 o3) Source # | |
Defined in Math.Categories.CommaCategory (==) :: CommaCategory c1 m1 o1 c2 m2 o2 c3 m3 o3 -> CommaCategory c1 m1 o1 c2 m2 o2 c3 m3 o3 -> Bool (/=) :: CommaCategory c1 m1 o1 c2 m2 o2 c3 m3 o3 -> CommaCategory c1 m1 o1 c2 m2 o2 c3 m3 o3 -> Bool | |
(Show c1, Show c3, Show o1, Show o3, Show m1, Show m3, Show c2, Show o2, Show m2) => Show (CommaCategory c1 m1 o1 c2 m2 o2 c3 m3 o3) Source # | |
Defined in Math.Categories.CommaCategory showsPrec :: Int -> CommaCategory c1 m1 o1 c2 m2 o2 c3 m3 o3 -> ShowS show :: CommaCategory c1 m1 o1 c2 m2 o2 c3 m3 o3 -> String showList :: [CommaCategory c1 m1 o1 c2 m2 o2 c3 m3 o3] -> ShowS | |
(Category c1 m1 o1, Morphism m1 o1, Eq m1, Eq o1, Category c2 m2 o2, Morphism m2 o2, Eq m2, Eq o2, Category c3 m3 o3, Morphism m3 o3, Eq m3, Eq o3) => Category (CommaCategory c1 m1 o1 c2 m2 o2 c3 m3 o3) (CommaMorphism o1 o2 m1 m2 m3) (CommaObject o1 o2 m3) Source # | |
Defined in Math.Categories.CommaCategory identity :: CommaCategory c1 m1 o1 c2 m2 o2 c3 m3 o3 -> CommaObject o1 o2 m3 -> CommaMorphism o1 o2 m1 m2 m3 Source # ar :: CommaCategory c1 m1 o1 c2 m2 o2 c3 m3 o3 -> CommaObject o1 o2 m3 -> CommaObject o1 o2 m3 -> Set (CommaMorphism o1 o2 m1 m2 m3) Source # genAr :: CommaCategory c1 m1 o1 c2 m2 o2 c3 m3 o3 -> CommaObject o1 o2 m3 -> CommaObject o1 o2 m3 -> Set (CommaMorphism o1 o2 m1 m2 m3) Source # decompose :: CommaCategory c1 m1 o1 c2 m2 o2 c3 m3 o3 -> CommaMorphism o1 o2 m1 m2 m3 -> [CommaMorphism o1 o2 m1 m2 m3] Source # | |
(FiniteCategory c1 m1 o1, Morphism m1 o1, Eq m1, Eq o1, FiniteCategory c2 m2 o2, Morphism m2 o2, Eq m2, Eq o2, FiniteCategory c3 m3 o3, Morphism m3 o3, Eq m3, Eq o3) => FiniteCategory (CommaCategory c1 m1 o1 c2 m2 o2 c3 m3 o3) (CommaMorphism o1 o2 m1 m2 m3) (CommaObject o1 o2 m3) Source # | |
Defined in Math.Categories.CommaCategory ob :: CommaCategory c1 m1 o1 c2 m2 o2 c3 m3 o3 -> Set (CommaObject o1 o2 m3) Source # |
sliceCategory :: (FiniteCategory c m o, Morphism m o, Eq c, Eq m, Eq o) => c -> o -> Maybe (CommaCategory c m o One One One c m o) Source #
Construct the slice category of a category C over an object o.
Return Nothing if the object is not in the category.
cosliceCategory :: (FiniteCategory c m o, Morphism m o, Eq c, Eq m, Eq o) => c -> o -> Maybe (CommaCategory One One One c m o c m o) Source #
Construct the coslice category of a category C under an object o.
arrowCategory :: (FiniteCategory c m o, Morphism m o, Eq c, Eq m, Eq o) => c -> CommaCategory c m o c m o c m o Source #
Construct the arrow category of a category C.