2018-02-05 13:59:53 +00:00
|
|
|
|
module Cat.Category.Product where
|
2018-02-05 13:08:30 +00:00
|
|
|
|
|
|
|
|
|
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-02-05 13:08:30 +00:00
|
|
|
|
|
2018-03-08 09:20:29 +00:00
|
|
|
|
open import Cat.Category hiding (module Propositionality)
|
2018-02-05 13:08:30 +00:00
|
|
|
|
|
|
|
|
|
open Category
|
|
|
|
|
|
2018-03-08 09:20:29 +00:00
|
|
|
|
module _ {ℓa ℓb : Level} where
|
2018-03-08 09:22:21 +00:00
|
|
|
|
record RawProduct (ℂ : Category ℓa ℓb) (A B : Object ℂ) : Set (ℓa ⊔ ℓb) where
|
2018-03-08 09:20:29 +00:00
|
|
|
|
no-eta-equality
|
|
|
|
|
field
|
|
|
|
|
obj : Object ℂ
|
|
|
|
|
proj₁ : ℂ [ obj , A ]
|
|
|
|
|
proj₂ : ℂ [ obj , B ]
|
|
|
|
|
|
2018-03-08 09:22:21 +00:00
|
|
|
|
record IsProduct (ℂ : Category ℓa ℓb) {A B : Object ℂ} (raw : RawProduct ℂ A B) : Set (ℓa ⊔ ℓb) where
|
2018-03-08 09:20:29 +00:00
|
|
|
|
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 π₁ π₂)
|
|
|
|
|
|
2018-03-08 09:22:21 +00:00
|
|
|
|
record Product (ℂ : Category ℓa ℓb) (A B : Object ℂ) : Set (ℓa ⊔ ℓb) where
|
2018-03-08 09:20:29 +00:00
|
|
|
|
field
|
2018-03-08 09:22:21 +00:00
|
|
|
|
raw : RawProduct ℂ A B
|
2018-03-08 09:20:29 +00:00
|
|
|
|
isProduct : IsProduct ℂ {A} {B} raw
|
|
|
|
|
|
|
|
|
|
open IsProduct isProduct public
|
|
|
|
|
|
|
|
|
|
record HasProducts (ℂ : Category ℓa ℓb) : Set (ℓa ⊔ ℓb) where
|
|
|
|
|
field
|
2018-03-08 09:22:21 +00:00
|
|
|
|
product : ∀ (A B : Object ℂ) → Product ℂ A B
|
2018-03-08 09:20:29 +00:00
|
|
|
|
|
|
|
|
|
module _ (A B : Object ℂ) where
|
|
|
|
|
open Product (product A B)
|
|
|
|
|
_×_ : Object ℂ
|
|
|
|
|
_×_ = obj
|
|
|
|
|
|
|
|
|
|
-- | 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
|
|
|
|
|
module _ {A A' B B' : Object ℂ} where
|
|
|
|
|
open Product
|
|
|
|
|
open Product (product A B) hiding (_P[_×_]) renaming (proj₁ to fst ; proj₂ to snd)
|
|
|
|
|
_|×|_ : ℂ [ A , A' ] → ℂ [ B , B' ] → ℂ [ A × B , A' × B' ]
|
|
|
|
|
a |×| b = product A' B'
|
|
|
|
|
P[ ℂ [ a ∘ fst ]
|
|
|
|
|
× ℂ [ b ∘ snd ]
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
module Propositionality where
|
|
|
|
|
-- TODO `isProp (Product ...)`
|
|
|
|
|
-- TODO `isProp (HasProducts ...)`
|