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-02-05 15:35:33 +00:00
|
|
|
|
open import Data.Product as P hiding (_×_)
|
2018-02-05 13:08:30 +00:00
|
|
|
|
|
|
|
|
|
open import Cat.Category
|
|
|
|
|
|
|
|
|
|
open Category
|
|
|
|
|
|
|
|
|
|
module _ {ℓ ℓ' : Level} (ℂ : Category ℓ ℓ') {A B obj : Object ℂ} where
|
|
|
|
|
IsProduct : (π₁ : ℂ [ obj , A ]) (π₂ : ℂ [ obj , B ]) → Set (ℓ ⊔ ℓ')
|
|
|
|
|
IsProduct π₁ π₂
|
|
|
|
|
= ∀ {X : Object ℂ} (x₁ : ℂ [ X , A ]) (x₂ : ℂ [ X , B ])
|
2018-02-05 15:35:33 +00:00
|
|
|
|
→ ∃![ x ] (ℂ [ π₁ ∘ x ] ≡ x₁ P.× ℂ [ π₂ ∘ x ] ≡ x₂)
|
2018-02-05 13:08:30 +00:00
|
|
|
|
|
|
|
|
|
-- Tip from Andrea; Consider this style for efficiency:
|
2018-02-05 15:35:33 +00:00
|
|
|
|
-- record IsProduct {ℓa ℓb : Level} (ℂ : Category ℓa ℓb)
|
|
|
|
|
-- {A B obj : Object ℂ} (π₁ : Arrow ℂ obj A) (π₂ : Arrow ℂ obj B) : Set (ℓa ⊔ ℓb) where
|
2018-02-05 13:08:30 +00:00
|
|
|
|
-- field
|
2018-02-05 15:35:33 +00:00
|
|
|
|
-- issProduct : ∀ {X : Object ℂ} (x₁ : ℂ [ X , A ]) (x₂ : ℂ [ X , B ])
|
|
|
|
|
-- → ∃![ x ] (ℂ [ π₁ ∘ x ] ≡ x₁ P.× ℂ [ π₂ ∘ x ] ≡ x₂)
|
|
|
|
|
|
|
|
|
|
-- open IsProduct
|
2018-02-05 13:08:30 +00:00
|
|
|
|
|
|
|
|
|
record Product {ℓ ℓ' : Level} {ℂ : Category ℓ ℓ'} (A B : Object ℂ) : Set (ℓ ⊔ ℓ') where
|
|
|
|
|
no-eta-equality
|
|
|
|
|
field
|
|
|
|
|
obj : Object ℂ
|
|
|
|
|
proj₁ : ℂ [ obj , A ]
|
|
|
|
|
proj₂ : ℂ [ obj , B ]
|
|
|
|
|
{{isProduct}} : IsProduct ℂ proj₁ proj₂
|
|
|
|
|
|
2018-02-05 15:35:33 +00:00
|
|
|
|
_P[_×_] : ∀ {X} → (π₁ : ℂ [ X , A ]) (π₂ : ℂ [ X , B ])
|
2018-02-05 13:08:30 +00:00
|
|
|
|
→ ℂ [ X , obj ]
|
2018-02-05 15:35:33 +00:00
|
|
|
|
_P[_×_] π₁ π₂ = proj₁ (isProduct π₁ π₂)
|
2018-02-05 13:08:30 +00:00
|
|
|
|
|
|
|
|
|
record HasProducts {ℓ ℓ' : Level} (ℂ : Category ℓ ℓ') : Set (ℓ ⊔ ℓ') where
|
|
|
|
|
field
|
|
|
|
|
product : ∀ (A B : Object ℂ) → Product {ℂ = ℂ} A B
|
|
|
|
|
|
|
|
|
|
open Product
|
|
|
|
|
|
2018-02-05 15:35:33 +00:00
|
|
|
|
_×_ : (A B : Object ℂ) → Object ℂ
|
|
|
|
|
A × B = Product.obj (product A B)
|
2018-02-05 13:08:30 +00:00
|
|
|
|
-- The product mentioned in awodey in Def 6.1 is not the regular product of arrows.
|
|
|
|
|
-- It's a "parallel" product
|
2018-02-05 15:35:33 +00:00
|
|
|
|
_|×|_ : {A A' B B' : Object ℂ} → ℂ [ A , A' ] → ℂ [ B , B' ]
|
|
|
|
|
→ ℂ [ A × B , A' × B' ]
|
|
|
|
|
_|×|_ {A = A} {A' = A'} {B = B} {B' = B'} a b
|
|
|
|
|
= product A' B'
|
|
|
|
|
P[ ℂ [ a ∘ (product A B) .proj₁ ]
|
|
|
|
|
× ℂ [ b ∘ (product A B) .proj₂ ]
|
|
|
|
|
]
|