FiniteCategories-0.6.4.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.FinCat

Description

The FinCat category has as objects finite categories and as morphisms homogeneous functors between them.

Functors must be homogeneous because otherwise we would not be able to compose them with the Morphism typeclass.

The FinCat datatype should not be confused with the FiniteCategory typeclass. The FiniteCategory typeclass describes axioms a structure should follow to be considered a finite category. The FinCat type is itself a Category.

A FinFunctor is a Diagram where the source and target category are the same. The source category of a FinFunctor should be finite.

Synopsis

Homogeneous functor

type FinFunctor c m o = Diagram c m o c m o Source #

A FinFunctor funct between two categories is a map between objects and a map between arrows of the two categories such that :

funct ->$ (source f) == source (funct ->£ f)
funct ->$ (target f) == target (funct ->£ f)
funct ->£ (f @ g) = (funct ->£ f) @ (funct ->£ g)
funct ->£ (identity a) = identity (funct ->$ a)

A FinFunctor is a type of Diagram.

It is meant to be a morphism between categories within FinCat, it is homogeneous, the type of the source category must be the same as the type of the target category.

See Diagram in Math.Categories.FunctorCategory for heterogeneous ones.

FinCat

data FinCat c m o Source #

The FinCat category has as objects finite categories and as morphisms homogeneous functors between them.

Constructors

FinCat 

Instances

Instances details
PrettyPrint (FinCat c m o) Source # 
Instance details

Defined in Math.Categories.FinCat

Methods

pprint :: Int -> FinCat c m o -> String Source #

pprintWithIndentations :: Int -> Int -> String -> FinCat c m o -> String Source #

pprintIndent :: Int -> FinCat c m o -> String Source #

Simplifiable (FinCat c m o) Source # 
Instance details

Defined in Math.Categories.FinCat

Methods

simplify :: FinCat c m o -> FinCat c m o #

Generic (FinCat c m o) Source # 
Instance details

Defined in Math.Categories.FinCat

Associated Types

type Rep (FinCat c m o) :: Type -> Type

Methods

from :: FinCat c m o -> Rep (FinCat c m o) x

to :: Rep (FinCat c m o) x -> FinCat c m o

Show (FinCat c m o) Source # 
Instance details

Defined in Math.Categories.FinCat

Methods

showsPrec :: Int -> FinCat c m o -> ShowS

show :: FinCat c m o -> String

showList :: [FinCat c m o] -> ShowS

Eq (FinCat c m o) Source # 
Instance details

Defined in Math.Categories.FinCat

Methods

(==) :: FinCat c m o -> FinCat c m o -> Bool

(/=) :: FinCat c m o -> FinCat c m o -> Bool

(FiniteCategory c m o, Morphism m o, Eq c, Eq m, Eq o) => Category (FinCat c m o) (FinFunctor c m o) c Source # 
Instance details

Defined in Math.Categories.FinCat

Methods

identity :: FinCat c m o -> c -> FinFunctor c m o Source #

ar :: FinCat c m o -> c -> c -> Set (FinFunctor c m o) Source #

genAr :: FinCat c m o -> c -> c -> Set (FinFunctor c m o) Source #

decompose :: FinCat c m o -> FinFunctor c m o -> [FinFunctor c m o] Source #

(FiniteCategory c m o, Morphism m o, Eq c, Eq m, Eq o, FiniteCategory cIndex mIndex oIndex, Morphism mIndex oIndex, Eq oIndex, Eq mIndex) => CocompleteCategory (FinCat c m o) (FinFunctor c m o) c (FinCat (CompositionGraph (Colimit oIndex o) (Colimit oIndex m)) (CGMorphism (Colimit oIndex o) (Colimit oIndex m)) (Colimit oIndex o)) (FinFunctor (CompositionGraph (Colimit oIndex o) (Colimit oIndex m)) (CGMorphism (Colimit oIndex o) (Colimit oIndex m)) (Colimit oIndex o)) (CompositionGraph (Colimit oIndex o) (Colimit oIndex m)) cIndex mIndex oIndex Source #

Note that computing a ColimitCategory is MUCH slower than computing a LimitCategory as coequalizers of categories are trickier than equalizers of categories. We can only compute colimits of CompositionGraphs as coequalizing might create new formal morphisms when gluing two objects. Therefore colimit transforms all given categories into CompositionGraphs. If you already have a CompositionGraph, consider using colimitOfCompositionGraphs instead of colimit.

Instance details

Defined in Math.FiniteCategories.ColimitCategory

Methods

colimit :: Diagram cIndex mIndex oIndex (FinCat c m o) (FinFunctor c m o) c -> Cocone cIndex mIndex oIndex (FinCat (CompositionGraph (Colimit oIndex o) (Colimit oIndex m)) (CGMorphism (Colimit oIndex o) (Colimit oIndex m)) (Colimit oIndex o)) (FinFunctor (CompositionGraph (Colimit oIndex o) (Colimit oIndex m)) (CGMorphism (Colimit oIndex o) (Colimit oIndex m)) (Colimit oIndex o)) (CompositionGraph (Colimit oIndex o) (Colimit oIndex m)) Source #

coprojectBase :: Diagram cIndex mIndex oIndex (FinCat c m o) (FinFunctor c m o) c -> Diagram (FinCat c m o) (FinFunctor c m o) c (FinCat (CompositionGraph (Colimit oIndex o) (Colimit oIndex m)) (CGMorphism (Colimit oIndex o) (Colimit oIndex m)) (Colimit oIndex o)) (FinFunctor (CompositionGraph (Colimit oIndex o) (Colimit oIndex m)) (CGMorphism (Colimit oIndex o) (Colimit oIndex m)) (Colimit oIndex o)) (CompositionGraph (Colimit oIndex o) (Colimit oIndex m)) Source #

(FiniteCategory c m o, Morphism m o, Eq c, Eq m, Eq o, FiniteCategory cIndex mIndex oIndex, Morphism mIndex oIndex, Eq cIndex, Eq mIndex, Eq oIndex) => CompleteCategory (FinCat c m o) (FinFunctor c m o) c (FinCat (LimitCategory cIndex mIndex oIndex c m o) (Limit oIndex m) (Limit oIndex o)) (FinFunctor (LimitCategory cIndex mIndex oIndex c m o) (Limit oIndex m) (Limit oIndex o)) (LimitCategory cIndex mIndex oIndex c m o) cIndex mIndex oIndex Source # 
Instance details

Defined in Math.FiniteCategories.LimitCategory

Methods

limit :: Diagram cIndex mIndex oIndex (FinCat c m o) (FinFunctor c m o) c -> Cone cIndex mIndex oIndex (FinCat (LimitCategory cIndex mIndex oIndex c m o) (Limit oIndex m) (Limit oIndex o)) (FinFunctor (LimitCategory cIndex mIndex oIndex c m o) (Limit oIndex m) (Limit oIndex o)) (LimitCategory cIndex mIndex oIndex c m o) Source #

projectBase :: Diagram cIndex mIndex oIndex (FinCat c m o) (FinFunctor c m o) c -> Diagram (FinCat c m o) (FinFunctor c m o) c (FinCat (LimitCategory cIndex mIndex oIndex c m o) (Limit oIndex m) (Limit oIndex o)) (FinFunctor (LimitCategory cIndex mIndex oIndex c m o) (Limit oIndex m) (Limit oIndex o)) (LimitCategory cIndex mIndex oIndex c m o) Source #

(Eq n, Eq e) => HasCoequalizers (FinCat (CompositionGraph n e) (CGMorphism n e) n) (FinFunctor (CompositionGraph n e) (CGMorphism n e) n) (CompositionGraph n e) Source # 
Instance details

Defined in Math.FiniteCategories.ColimitCategory

(Eq e, Eq n, Eq oIndex) => HasCoproducts (FinCat (CompositionGraph n e) (CGMorphism n e) n) (FinFunctor (CompositionGraph n e) (CGMorphism n e) n) (CompositionGraph n e) (FinCat (CompositionGraph (Colimit oIndex n) (Colimit oIndex e)) (CGMorphism (Colimit oIndex n) (Colimit oIndex e)) (Colimit oIndex n)) (FinFunctor (CompositionGraph (Colimit oIndex n) (Colimit oIndex e)) (CGMorphism (Colimit oIndex n) (Colimit oIndex e)) (Colimit oIndex n)) (CompositionGraph (Colimit oIndex n) (Colimit oIndex e)) oIndex Source # 
Instance details

Defined in Math.FiniteCategories.ColimitCategory

Methods

coproduct :: Diagram (DiscreteCategory oIndex) (DiscreteMorphism oIndex) oIndex (FinCat (CompositionGraph n e) (CGMorphism n e) n) (FinFunctor (CompositionGraph n e) (CGMorphism n e) n) (CompositionGraph n e) -> Cocone (DiscreteCategory oIndex) (DiscreteMorphism oIndex) oIndex (FinCat (CompositionGraph (Colimit oIndex n) (Colimit oIndex e)) (CGMorphism (Colimit oIndex n) (Colimit oIndex e)) (Colimit oIndex n)) (FinFunctor (CompositionGraph (Colimit oIndex n) (Colimit oIndex e)) (CGMorphism (Colimit oIndex n) (Colimit oIndex e)) (Colimit oIndex n)) (CompositionGraph (Colimit oIndex n) (Colimit oIndex e)) Source #

type Rep (FinCat c m o) Source # 
Instance details

Defined in Math.Categories.FinCat

type Rep (FinCat c m o) = D1 ('MetaData "FinCat" "Math.Categories.FinCat" "FiniteCategories-0.6.4.0-inplace" 'False) (C1 ('MetaCons "FinCat" 'PrefixI 'False) (U1 :: Type -> Type))

Orphan instances

(Category c m o, Morphism m o, Eq m, Eq o) => Morphism (FinFunctor c m o) c Source # 
Instance details

Methods

(@) :: FinFunctor c m o -> FinFunctor c m o -> FinFunctor c m o Source #

(@?) :: FinFunctor c m o -> FinFunctor c m o -> Maybe (FinFunctor c m o) Source #

source :: FinFunctor c m o -> c Source #

target :: FinFunctor c m o -> c Source #