Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
2de4945
start defining free monoidal categories
marcosh Apr 4, 2019
ee56056
definition for free category morphisms
marcosh Apr 11, 2019
b472c43
Free categories defined.
Apr 11, 2019
184a519
add license head to free monoidal category
marcosh Apr 18, 2019
900199f
progress on free monoidal category
marcosh Apr 25, 2019
f844bf7
solving free category tensor issue
marcosh Apr 30, 2019
6b456a3
complete free monoidal category definition
marcosh Apr 30, 2019
d32bea3
strict symmetric monoidal category (inverse missing)
marcosh May 7, 2019
4d5bcef
inverse law for strict symmetric monoidal categories
marcosh May 7, 2019
3a95eab
progress on FreeMonoidalCategory
marcosh May 9, 2019
fbabc8d
complete freeSymmetryCommutativity proof
marcosh May 14, 2019
0fe4bdf
complete free strict symmetric monoidal category with mistake
marcosh May 15, 2019
e2917db
complete definition of free strict symmetric monoidal category
marcosh May 16, 2019
b5f65cd
add license to free monoid file
marcosh May 16, 2019
e1cf9de
remove newlines
marcosh May 16, 2019
fea7f48
removed unused imports
marcosh May 16, 2019
65477bf
coherently use `generatingMorphisms`
marcosh May 21, 2019
65571ec
avoid paradoxes by disabling pattern matching on FreeMorphism
marcosh May 23, 2019
ab21bca
start implementing monoidal functor
marcosh May 23, 2019
4c28710
start defining a fold on free strict symmetric monoidal category
marcosh May 23, 2019
8d493bc
Agda experiment constructing free sym mon cat on a cat
fredrikNordvallForsberg May 30, 2019
3213b10
remove fred experiment from free-marcosh branch
marcosh Jun 11, 2019
7a10a8e
remove definition of monoidal functor from free-marcosh branch
marcosh Jun 11, 2019
1ccb775
add namespace to module name
marcosh Jun 11, 2019
468d379
add getters for strict symmetric monoidal category
marcosh Jun 11, 2019
15eb353
start defining monoid instance for strict monoidal category objects
marcosh Jun 11, 2019
d696bf6
progress with free monoidal category fold
marcosh Jun 11, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Basic/Category.lidr
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Then, we implement the basic elements a category consists of.
%
< record Category where
%
A |record| in Idirs is just the product type of several values, which are called the fields of the record. It's a convenient syntax because Idris provides field access and update functions automatically for us. We add also the constructor |MkCategory| to be able to construct concrete values of type |Category|:
A |record| in Idris is just the product type of several values, which are called the fields of the record. It's a convenient syntax because Idris provides field access and update functions automatically for us. We add also the constructor |MkCategory| to be able to construct concrete values of type |Category|:
%
%
< constructor MkCategory
Expand Down
35 changes: 35 additions & 0 deletions src/Monoid/FreeMonoid.lidr
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
\iffalse
SPDX-License-Identifier: AGPL-3.0-only

This file is part of `idris-ct` Category Theory in Idris library.

Copyright (C) 2019 Stichting Statebox <https://statebox.nl>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
\fi

> module Monoid.FreeMonoid
>
> import Data.Fin
> import Interfaces.Verified
> import Monoid.Monoid
>
> %access public export
> %default total
>
> FreeMonoid : Type -> Monoid
> FreeMonoid t = MkMonoid (List t) %implementation
>
> finSetToFreeMonoid : Nat -> Monoid
> finSetToFreeMonoid n = FreeMonoid (Fin n)
342 changes: 342 additions & 0 deletions src/MonoidalCategory/FreeMonoidalCategory.lidr

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/MonoidalCategory/MonoidalCategory.lidr
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
\fi

> module MonoidalCategory
> module MonoidalCategory.MonoidalCategory
>
> import Basic.Category
> import Basic.Functor
Expand Down
2 changes: 1 addition & 1 deletion src/MonoidalCategory/MonoidalCategoryHelpers.lidr
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
\fi

> module MonoidalCategoryHelpers
> module MonoidalCategory.MonoidalCategoryHelpers
>
> import Basic.Category
> import Basic.Functor
Expand Down
11 changes: 10 additions & 1 deletion src/MonoidalCategory/StrictMonoidalCategory.lidr
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,16 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
\fi

> module StrictMonoidalCategory
> module MonoidalCategory.StrictMonoidalCategory
>
> import Basic.Category
> import Basic.Functor
> import Monoid.Monoid
> import Product.ProductCategory
>
> -- contrib
> import Interfaces.Verified
>
> %access public export
> %default total
>
Expand All @@ -49,3 +53,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
> (mapObj tensor (a,c), e)
> (mapObj tensor (b,d), f)
> (MkProductMorphism (mapMor tensor (a,c) (b,d) (MkProductMorphism g h)) k)
>
> smcObjectMonoid : StrictMonoidalCategory -> Monoid.Monoid
> smcObjectMonoid smc = MkMonoid
> (obj (cat smc))
> ?asdf
118 changes: 118 additions & 0 deletions src/MonoidalCategory/StrictSymmetricMonoidalCategory.lidr
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
\iffalse
SPDX-License-Identifier: AGPL-3.0-only

This file is part of `idris-ct` Category Theory in Idris library.

Copyright (C) 2019 Stichting Statebox <https://statebox.nl>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
\fi

> module MonoidalCategory.StrictSymmetricMonoidalCategory
>
> import Basic.Category
> import Basic.Functor
> import Basic.NaturalIsomorphism
> import Basic.NaturalTransformation
> import MonoidalCategory.StrictMonoidalCategory
> import MonoidalCategory.SymmetricMonoidalCategoryHelpers
> import Product.ProductCategory
>
> %access public export
> %default total
>
> StrictUnitCoherence :
> (cat : Category)
> -> (unit : obj cat)
> -> (symmetry : NaturalIsomorphism (productCategory cat cat)
> cat
> tensor
> (functorComposition (productCategory cat cat)
> (productCategory cat cat)
> cat
> (swapFunctor cat cat)
> tensor))
> -> (a : obj cat)
> -> Type
> StrictUnitCoherence cat unit symmetry a =
> (component (natTrans symmetry) (a, unit)) = identity cat a
>
> StrictAssociativityCoherence :
> (cat : Category)
> -> (tensor : CFunctor (productCategory cat cat) cat)
> -> (tensorIsAssociativeObj :
> (a, b, c : obj cat)
> -> mapObj tensor (a, mapObj tensor (b, c)) = mapObj tensor (mapObj tensor (a, b), c))
> -> (symmetry : NaturalIsomorphism (productCategory cat cat)
> cat
> tensor
> (functorComposition (productCategory cat cat)
> (productCategory cat cat)
> cat
> (swapFunctor cat cat)
> tensor))
> -> (a, b, c : obj cat)
> -> Type
> StrictAssociativityCoherence cat tensor tensorIsAssociativeObj symmetry a b c =
> component (natTrans symmetry) (a, mapObj tensor (b, c)) =
> compose cat
> (mapObj tensor (mapObj tensor (a, b), c))
> (mapObj tensor (mapObj tensor (b, a), c))
> (mapObj tensor (mapObj tensor (b, c), a))
> (mapMor tensor
> (mapObj tensor (a, b), c)
> (mapObj tensor (b, a), c)
> (MkProductMorphism (component (natTrans symmetry) (a, b)) (identity cat c)))
> (rewrite sym (tensorIsAssociativeObj b a c) in
> rewrite sym (tensorIsAssociativeObj b c a) in (mapMor tensor
> (b, (mapObj tensor (a, c)))
> (b, (mapObj tensor (c, a)))
> (MkProductMorphism (identity cat b)
> (component (natTrans symmetry)
> (a, c)))))
>
> data StrictSymmetricMonoidalCategory : Type where
> MkStrictSymmetricMonoidalCategory :
> (smcat : StrictMonoidalCategory)
> -> (symmetry : NaturalIsomorphism (productCategory (cat smcat) (cat smcat))
> (cat smcat)
> (tensor smcat)
> (functorComposition (productCategory (cat smcat) (cat smcat))
> (productCategory (cat smcat) (cat smcat))
> (cat smcat)
> (swapFunctor (cat smcat) (cat smcat))
> (tensor smcat)))
> -> ((a : obj (cat smcat)) -> StrictUnitCoherence (cat smcat) (unit smcat) symmetry a)
> -> ((a, b, c : obj (cat smcat)) -> StrictAssociativityCoherence (cat smcat)
> (tensor smcat)
> (tensorIsAssociativeObj smcat)
> symmetry
> a b c)
> -> ((a, b : obj (cat smcat)) -> InverseLaw (cat smcat) (tensor smcat) symmetry a b)
> -> StrictSymmetricMonoidalCategory
>
> smcat : StrictSymmetricMonoidalCategory -> StrictMonoidalCategory
> smcat (MkStrictSymmetricMonoidalCategory smcat _ _ _ _) = smcat
>
> symmetry :
> (ssmc : StrictSymmetricMonoidalCategory)
> -> NaturalIsomorphism (productCategory (cat (smcat ssmc)) (cat (smcat ssmc)))
> (cat (smcat ssmc))
> (tensor (smcat ssmc))
> (functorComposition (productCategory (cat (smcat ssmc)) (cat (smcat ssmc)))
> (productCategory (cat (smcat ssmc)) (cat (smcat ssmc)))
> (cat (smcat ssmc))
> (swapFunctor (cat (smcat ssmc)) (cat (smcat ssmc)))
> (tensor (smcat ssmc)))
> symmetry (MkStrictSymmetricMonoidalCategory _ symmetry _ _ _) = symmetry
2 changes: 1 addition & 1 deletion src/MonoidalCategory/SymmetricMonoidalCategory.lidr
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
\fi

> module SymmetricMonoidalCategory
> module MonoidalCategory.SymmetricMonoidalCategory
>
> import Basic.Category
> import Basic.Functor
Expand Down
2 changes: 1 addition & 1 deletion src/MonoidalCategory/SymmetricMonoidalCategoryHelpers.lidr
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
\fi

> module SymmetricMonoidalCategoryHelpers
> module MonoidalCategory.SymmetricMonoidalCategoryHelpers
>
> import Basic.Category
> import Basic.Functor
Expand Down