cat/src/Cat/Category/Product.agda

62 lines
1.9 KiB
Agda
Raw Normal View History

2018-02-05 13:59:53 +00:00
module Cat.Category.Product where
open import Agda.Primitive
open import Cubical
2018-03-08 09:20:29 +00:00
open import Data.Product as P hiding (_×_ ; proj₁ ; proj₂)
2018-03-08 09:20:29 +00:00
open import Cat.Category hiding (module Propositionality)
2018-03-08 09:23:37 +00:00
module _ {a b : Level} ( : Category a b) where
2018-03-08 09:23:37 +00:00
open Category
2018-03-08 09:28:05 +00:00
module _ (A B : Object) where
record RawProduct : Set (a b) where
no-eta-equality
field
obj : Object
proj₁ : [ obj , A ]
proj₂ : [ obj , B ]
record IsProduct (raw : RawProduct) : Set (a b) where
open RawProduct raw public
field
isProduct : {X : Object} (x₁ : [ X , A ]) (x₂ : [ X , B ])
∃![ x ] ( [ proj₁ x ] x₁ P.× [ proj₂ x ] x₂)
-- | Arrow product
_P[_×_] : {X} (π₁ : [ X , A ]) (π₂ : [ X , B ])
[ X , obj ]
_P[_×_] π₁ π₂ = P.proj₁ (isProduct π₁ π₂)
record Product : Set (a b) where
field
raw : RawProduct
isProduct : IsProduct raw
open IsProduct isProduct public
2018-03-08 09:20:29 +00:00
2018-03-08 09:23:37 +00:00
record HasProducts : Set (a b) where
2018-03-08 09:20:29 +00:00
field
2018-03-08 09:23:37 +00:00
product : (A B : Object) Product A B
2018-03-08 09:20:29 +00:00
2018-03-08 09:30:35 +00:00
_×_ : Object Object Object
A × B = Product.obj (product A B)
2018-03-08 09:20:29 +00:00
-- | Parallel product of arrows
--
-- The product mentioned in awodey in Def 6.1 is not the regular product of
-- arrows. It's a "parallel" product
2018-03-08 09:23:37 +00:00
module _ {A A' B B' : Object} where
2018-03-08 09:20:29 +00:00
open Product
open Product (product A B) hiding (_P[_×_]) renaming (proj₁ to fst ; proj₂ to snd)
_|×|_ : [ A , A' ] [ B , B' ] [ A × B , A' × B' ]
2018-03-08 09:30:35 +00:00
f |×| g = product A' B'
P[ [ f fst ]
× [ g snd ]
2018-03-08 09:20:29 +00:00
]
module Propositionality where
-- TODO `isProp (Product ...)`
-- TODO `isProp (HasProducts ...)`