FiniteCategories-0.2.0.0: Finite categories and usual categorical constructions on them.
CopyrightGuillaume Sabbagh 2022
LicenseGPL-3
Maintainerguillaumesabbagh@protonmail.com
Stabilityexperimental
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Math.Categories.CommaCategory

Description

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 Diagrams 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

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

Instances details
(Eq o1, Eq o2, Eq m3) => Eq (CommaObject o1 o2 m3) Source # 
Instance details

Defined in Math.Categories.CommaCategory

Methods

(==) :: 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 # 
Instance details

Defined in Math.Categories.CommaCategory

Methods

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 # 
Instance details

Defined in Math.Categories.CommaCategory

Methods

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 # 
Instance details

Defined in Math.Categories.CommaCategory

Methods

(@?) :: 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 # 
Instance details

Defined in Math.Categories.CommaCategory

Methods

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 # 
Instance details

Defined in Math.Categories.CommaCategory

Methods

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

Instances details
(Eq o1, Eq o2, Eq m3, Eq m1, Eq m2) => Eq (CommaMorphism o1 o2 m1 m2 m3) Source # 
Instance details

Defined in Math.Categories.CommaCategory

Methods

(==) :: 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 # 
Instance details

Defined in Math.Categories.CommaCategory

Methods

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 # 
Instance details

Defined in Math.Categories.CommaCategory

Methods

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 # 
Instance details

Defined in Math.Categories.CommaCategory

Methods

(@?) :: 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 # 
Instance details

Defined in Math.Categories.CommaCategory

Methods

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 # 
Instance details

Defined in Math.Categories.CommaCategory

Methods

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.

Constructors

CommaCategory 

Fields

Instances

Instances details
(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 # 
Instance details

Defined in Math.Categories.CommaCategory

Methods

(==) :: 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 # 
Instance details

Defined in Math.Categories.CommaCategory

Methods

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 # 
Instance details

Defined in Math.Categories.CommaCategory

Methods

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 # 
Instance details

Defined in Math.Categories.CommaCategory

Methods

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.