2018-03-08 09:45:15 +00:00
|
|
|
|
{-# OPTIONS --allow-unsolved-metas #-}
|
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-14 09:23:23 +00:00
|
|
|
|
open import Cubical.NType.Properties using (lemPropF)
|
|
|
|
|
|
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
|
|
|
|
|
2018-03-08 09:23:37 +00:00
|
|
|
|
module _ {ℓa ℓb : Level} (ℂ : Category ℓa ℓb) where
|
2018-02-05 13:08:30 +00:00
|
|
|
|
|
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
|
2018-03-08 09:45:15 +00:00
|
|
|
|
object : Object
|
|
|
|
|
proj₁ : ℂ [ object , A ]
|
|
|
|
|
proj₂ : ℂ [ object , B ]
|
2018-03-08 09:28:05 +00:00
|
|
|
|
|
2018-03-08 09:38:46 +00:00
|
|
|
|
-- FIXME Not sure this is actually a proposition - so this name is
|
|
|
|
|
-- misleading.
|
2018-03-08 09:28:05 +00:00
|
|
|
|
record IsProduct (raw : RawProduct) : Set (ℓa ⊔ ℓb) where
|
|
|
|
|
open RawProduct raw public
|
|
|
|
|
field
|
2018-03-14 09:23:23 +00:00
|
|
|
|
ump : ∀ {X : Object} (f : ℂ [ X , A ]) (g : ℂ [ X , B ])
|
2018-03-08 09:38:46 +00:00
|
|
|
|
→ ∃![ f×g ] (ℂ [ proj₁ ∘ f×g ] ≡ f P.× ℂ [ proj₂ ∘ f×g ] ≡ g)
|
2018-03-08 09:28:05 +00:00
|
|
|
|
|
|
|
|
|
-- | Arrow product
|
|
|
|
|
_P[_×_] : ∀ {X} → (π₁ : ℂ [ X , A ]) (π₂ : ℂ [ X , B ])
|
2018-03-08 09:45:15 +00:00
|
|
|
|
→ ℂ [ X , object ]
|
2018-03-14 09:23:23 +00:00
|
|
|
|
_P[_×_] π₁ π₂ = P.proj₁ (ump π₁ π₂)
|
2018-03-08 09:28:05 +00:00
|
|
|
|
|
|
|
|
|
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
|
2018-03-08 09:45:15 +00:00
|
|
|
|
A × B = Product.object (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
|
|
|
|
]
|
|
|
|
|
|
2018-03-14 09:23:23 +00:00
|
|
|
|
module _ {ℓa ℓb : Level} {ℂ : Category ℓa ℓb} {A B : Category.Object ℂ} where
|
|
|
|
|
private
|
|
|
|
|
open Category ℂ
|
|
|
|
|
module _ (raw : RawProduct ℂ A B) where
|
|
|
|
|
module _ (x y : IsProduct ℂ A B raw) where
|
|
|
|
|
private
|
|
|
|
|
module x = IsProduct x
|
|
|
|
|
module y = IsProduct y
|
|
|
|
|
|
|
|
|
|
module _ {X : Object} (f : ℂ [ X , A ]) (g : ℂ [ X , B ]) where
|
|
|
|
|
prodAux : x.ump f g ≡ y.ump f g
|
|
|
|
|
prodAux = {!!}
|
|
|
|
|
|
|
|
|
|
propIsProduct' : x ≡ y
|
|
|
|
|
propIsProduct' i = record { ump = λ f g → prodAux f g i }
|
|
|
|
|
|
|
|
|
|
propIsProduct : isProp (IsProduct ℂ A B raw)
|
|
|
|
|
propIsProduct = propIsProduct'
|
|
|
|
|
|
|
|
|
|
Product≡ : {x y : Product ℂ A B} → (Product.raw x ≡ Product.raw y) → x ≡ y
|
|
|
|
|
Product≡ {x} {y} p i = record { raw = p i ; isProduct = q i }
|
|
|
|
|
where
|
|
|
|
|
q : (λ i → IsProduct ℂ A B (p i)) [ Product.isProduct x ≡ Product.isProduct y ]
|
|
|
|
|
q = lemPropF propIsProduct p
|
|
|
|
|
|
|
|
|
|
module _ {ℓa ℓb : Level} {ℂ : Category ℓa ℓb} {A B : Category.Object ℂ} where
|
|
|
|
|
open Category ℂ
|
|
|
|
|
private
|
|
|
|
|
module _ (x y : HasProducts ℂ) where
|
|
|
|
|
private
|
|
|
|
|
module x = HasProducts x
|
|
|
|
|
module y = HasProducts y
|
|
|
|
|
module _ (A B : Object) where
|
|
|
|
|
module pX = Product (x.product A B)
|
|
|
|
|
module pY = Product (y.product A B)
|
|
|
|
|
objEq : pX.object ≡ pY.object
|
|
|
|
|
objEq = {!!}
|
|
|
|
|
proj₁Eq : (λ i → ℂ [ objEq i , A ]) [ pX.proj₁ ≡ pY.proj₁ ]
|
|
|
|
|
proj₁Eq = {!!}
|
|
|
|
|
proj₂Eq : (λ i → ℂ [ objEq i , B ]) [ pX.proj₂ ≡ pY.proj₂ ]
|
|
|
|
|
proj₂Eq = {!!}
|
|
|
|
|
rawEq : pX.raw ≡ pY.raw
|
|
|
|
|
RawProduct.object (rawEq i) = objEq i
|
|
|
|
|
RawProduct.proj₁ (rawEq i) = {!!}
|
|
|
|
|
RawProduct.proj₂ (rawEq i) = {!!}
|
|
|
|
|
|
|
|
|
|
isEq : (λ i → IsProduct ℂ A B (rawEq i)) [ pX.isProduct ≡ pY.isProduct ]
|
|
|
|
|
isEq = {!!}
|
|
|
|
|
|
|
|
|
|
appEq : x.product A B ≡ y.product A B
|
|
|
|
|
appEq = Product≡ rawEq
|
|
|
|
|
|
|
|
|
|
productEq : x.product ≡ y.product
|
|
|
|
|
productEq i = λ A B → appEq A B i
|
|
|
|
|
|
|
|
|
|
propHasProducts' : x ≡ y
|
|
|
|
|
propHasProducts' i = record { product = productEq i }
|
2018-03-08 09:38:46 +00:00
|
|
|
|
|
|
|
|
|
propHasProducts : isProp (HasProducts ℂ)
|
2018-03-14 09:23:23 +00:00
|
|
|
|
propHasProducts = propHasProducts'
|