Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up code in BinProduct. #1159

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 16 additions & 10 deletions Cubical/Categories/Constructions/BinProduct.agda
Original file line number Diff line number Diff line change
Expand Up @@ -68,35 +68,37 @@ module _ where
Δ : ∀ (C : Category ℓC ℓC') → Functor C (C ×C C)
Δ C = Id ,F Id

Sym : {C : Category ℓC ℓC'}{D : Category ℓD ℓD'} → Functor (C ×C D) (D ×C C)
Sym {C = C}{D = D} = Snd C D ,F Fst C D

-- Some useful functors
module _ (C : Category ℓC ℓC')
(D : Category ℓD ℓD') where
open Functor

-- Symmetry of cartesian product (swapping components)
×C-sym : Functor (C ×C D) (D ×C C)
×C-sym = Snd C D ,F Fst C D
-- TODO: Prove involution

module _ (E : Category ℓE ℓE') where
-- Associativity of product
-- Associativity of cartesian product
×C-assoc : Functor (C ×C (D ×C E)) ((C ×C D) ×C E)
×C-assoc .F-ob (c , (d , e)) = ((c , d), e)
×C-assoc .F-hom (f , (g , h)) = ((f , g), h)
×C-assoc .F-id = refl
×C-assoc .F-seq _ _ = refl

{-
TODO:
- define inverse to `assoc`, prove isomorphism
- prove product is commutative up to isomorphism
-}

-- Left/right injections into product
linj : (d : ob D) → Functor C (C ×C D)
linj d = Id ,F Constant C D d

rinj : (c : ob C) → Functor D (C ×C D)
rinj c = Constant D C c ,F Id

{-
TODO:
- define inverse to `assoc`, prove isomorphism
- prove product is commutative up to isomorphism
-}


-- The isomorphisms in product category

Expand All @@ -107,3 +109,7 @@ module _ (C : Category ℓC ℓC')
CatIso× f g .snd .inv = f .snd .inv , g .snd .inv
CatIso× f g .snd .sec i = f .snd .sec i , g .snd .sec i
CatIso× f g .snd .ret i = f .snd .ret i , g .snd .ret i

Sym : {C : Category ℓC ℓC'}{D : Category ℓD ℓD'} → Functor (C ×C D) (D ×C C)
Sym {C = C}{D = D} = Snd C D ,F Fst C D
{-# WARNING_ON_USAGE Sym "DEPRECATED: Use `×C-sym` instead of `Sym`" #-}
Loading