0 | module Control.Category.Records.Cartesian
2 | import Control.Category
3 | import Control.Category.Records.Category
4 | import Control.Category.Records.Functor
5 | import Control.Category.Records.Monoidal
6 | import Control.Category.Records.Braided
7 | import Data.Morphisms
10 | %prefix_record_projections off
18 | record CartesianR where
19 | constructor MkCartesianR
21 | tensor : obj -> obj -> obj
23 | {auto impl : Cartesian hom tensor unit}
27 | PreCartesianR : Type
28 | PreCartesianR = CartesianR
30 | namespace CartesianR
32 | public export %inline
33 | (.categoryR) : (rec : CartesianR) -> CategoryR
34 | (.categoryR) (MkCartesianR {} {hom}) = MkCategoryR hom
37 | public export %inline
38 | (.id) : (rec : CartesianR) -> {a : _} -> rec.hom a a
39 | (.id) (MkCartesianR {}) = id
42 | public export %inline
43 | (.comp) : (rec : CartesianR) -> {a,b,c : _} ->
44 | rec.hom b c -> rec.hom a b -> rec.hom a c
45 | (.comp) (MkCartesianR {}) = (.)
49 | public export %inline
50 | (.tensorR) : (rec : CartesianR) -> EndoBifunctorR rec.categoryR
51 | (.tensorR) (MkCartesianR {} {tensor}) = MkBifunctorR tensor
55 | public export %inline
56 | (.monoidalR) : (rec : CartesianR) -> MonoidalR
57 | (.monoidalR) (MkCartesianR {} {hom,tensor,unit}) = MkMonoidalR hom tensor unit
60 | public export %inline
61 | (.assoc) : (rec : CartesianR) -> {a,b,c : _} ->
62 | rec.hom (rec.tensor (rec.tensor a b) c) (rec.tensor a (rec.tensor b c))
63 | (.assoc) (MkCartesianR {}) = assoc
66 | public export %inline
67 | (.assoc') : (rec : CartesianR) -> {a,b,c : _} ->
68 | rec.hom (rec.tensor a (rec.tensor b c)) (rec.tensor (rec.tensor a b) c)
69 | (.assoc') (MkCartesianR {}) = assoc'
72 | public export %inline
73 | (.unitl) : (rec : CartesianR) -> {a : _} ->
74 | rec.hom (rec.tensor rec.unit a) a
75 | (.unitl) (MkCartesianR {}) = unitl
78 | public export %inline
79 | (.unitl') : (rec : CartesianR) -> {a : _} ->
80 | rec.hom a (rec.tensor rec.unit a)
81 | (.unitl') (MkCartesianR {}) = unitl'
84 | public export %inline
85 | (.unitr) : (rec : CartesianR) -> {a : _} ->
86 | rec.hom (rec.tensor a rec.unit) a
87 | (.unitr) (MkCartesianR {}) = unitr
90 | public export %inline
91 | (.unitr') : (rec : CartesianR) -> {a : _} ->
92 | rec.hom a (rec.tensor a rec.unit)
93 | (.unitr') (MkCartesianR {}) = unitr'
97 | public export %inline
98 | (.braidedR) : (rec : CartesianR) -> BraidedR
99 | (.braidedR) (MkCartesianR {} {hom,tensor,unit}) =
100 | MkBraidedR {hom,tensor,unit,impl = FromCartesian}
103 | public export %inline
104 | (.symmetricR) : (rec : CartesianR) -> SymmetricR
105 | (.symmetricR) (MkCartesianR {} {hom,tensor,unit}) =
106 | MkSymmetricR {hom,tensor,unit,impl = FromCartesian}
109 | public export %inline
110 | (.braid) : (rec : CartesianR) -> {a,b : _} ->
111 | rec.hom (rec.tensor a b) (rec.tensor b a)
112 | (.braid) (MkCartesianR {}) = prod projr projl
116 | public export %inline
117 | (.cartesianR) : (rec : CartesianR) -> CartesianR
121 | public export %inline
122 | (.projl) : (rec : CartesianR) -> {a,b : _} ->
123 | rec.hom (rec.tensor a b) a
124 | (.projl) (MkCartesianR {}) = projl
127 | public export %inline
128 | (.projr) : (rec : CartesianR) -> {a,b : _} ->
129 | rec.hom (rec.tensor a b) b
130 | (.projr) (MkCartesianR {}) = projr
133 | public export %inline
134 | (.prod) : (rec : CartesianR) -> {a,b,b' : _} ->
135 | rec.hom a b -> rec.hom a b' -> rec.hom a (rec.tensor b b')
136 | (.prod) (MkCartesianR {}) = prod
139 | public export %inline
140 | (.split) : (rec : CartesianR) -> {a : _} ->
141 | rec.hom a (rec.tensor a a)
142 | (.split) (MkCartesianR {}) = split
145 | public export %inline
146 | (.elim) : (rec : CartesianR) -> {a : _} ->
148 | (.elim) (MkCartesianR {} {tensor}) = elim {ten=tensor}