Skip to content

Commit 5449cc2

Browse files
authored
Category of elements as a wild functor to CAT. (#1160)
1 parent 53e400e commit 5449cc2

File tree

4 files changed

+98
-5
lines changed

4 files changed

+98
-5
lines changed

Cubical/Categories/Category.agda

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
{-
22
Definition of various kinds of categories.
33
4-
This library follows the UniMath terminology, that is:
4+
This library partially follows the UniMath terminology:
55
66
Concept Ob C Hom C Univalence
77
8-
Precategory Type Type No
8+
Wild Category Type Type No (called precategory in UniMath)
99
Category Type Set No
1010
Univalent Category Type Set Yes
1111
1212
The most useful notion is Category and the library is hence based on
13-
them. If one needs precategories then they can be found in
14-
Cubical.Categories.Category.Precategory
13+
them. If one needs wild categories then they can be found in
14+
Cubical.WildCat (so it's not considered part of the Categories sublibrary!)
1515
1616
-}
1717
{-# OPTIONS --safe #-}

Cubical/Categories/Constructions/Elements.agda

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ open import Cubical.Categories.Isomorphism
1919
import Cubical.Categories.Morphism as Morphism
2020

2121

22-
2322
module Cubical.Categories.Constructions.Elements where
2423

2524
-- some issues
@@ -81,6 +80,11 @@ module Covariant {ℓ ℓ'} {C : Category ℓ ℓ'} where
8180
p2 = snd ((∫ F) ._⋆_ f' ((∫ F) ._⋆_ {o1} {o2} {o3} g' h'))
8281
(∫ F) .isSetHom {x} {y} = isSetΣSndProp (C .isSetHom) λ _ (F ⟅ fst y ⟆) .snd _ _
8382

83+
ElementHom≡ : {ℓS} (F : Functor C (SET ℓS)) {c,f c',f' : Element F}
84+
{χ1,ef1 χ2,ef2 : (∫ F) [ c,f , c',f' ]} (fst χ1,ef1 ≡ fst χ2,ef2) (χ1,ef1 ≡ χ2,ef2)
85+
ElementHom≡ F {c1 , f1} {c2 , f2} {χ1 , ef1} {χ2 , ef2} eχ = cong₂ _,_ eχ
86+
(fst (isOfHLevelPathP' 0 (snd (F ⟅ c2 ⟆) _ _) ef1 ef2))
87+
8488
ForgetElements : {ℓS} (F : Functor C (SET ℓS)) Functor (∫ F) C
8589
F-ob (ForgetElements F) = fst
8690
F-hom (ForgetElements F) = fst
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{-# OPTIONS --safe #-}
2+
3+
open import Cubical.Foundations.Prelude
4+
open import Cubical.Foundations.HLevels
5+
6+
open import Cubical.Categories.Category
7+
open Category
8+
open import Cubical.Categories.Functor
9+
open Functor
10+
open import Cubical.Categories.NaturalTransformation
11+
open NatTrans
12+
open import Cubical.Categories.Instances.Functors
13+
open import Cubical.Categories.Instances.Sets
14+
open import Cubical.Categories.Constructions.Elements
15+
open Covariant
16+
17+
open import Cubical.WildCat.Functor
18+
open import Cubical.WildCat.Instances.Categories
19+
open import Cubical.WildCat.Instances.NonWild
20+
21+
module Cubical.Categories.Constructions.Elements.Properties where
22+
23+
variable
24+
ℓC ℓC' ℓD ℓD' ℓS : Level
25+
C : Category ℓC ℓC'
26+
D : Category ℓD ℓD'
27+
28+
∫-hom : {F G : Functor C (SET ℓS)} NatTrans F G Functor (∫ F) (∫ G)
29+
Functor.F-ob (∫-hom ν) (c , f) = c , N-ob ν c f
30+
Functor.F-hom (∫-hom ν) {c1 , f1} {c2 , f2} (χ , ef) = χ , sym (funExt⁻ (N-hom ν χ) f1) ∙ cong (N-ob ν c2) ef
31+
Functor.F-id (∫-hom {G = G} ν) {c , f} = ElementHom≡ G refl
32+
Functor.F-seq (∫-hom {G = G} ν) {c1 , f1} {c2 , f2} {c3 , f3} (χ12 , ef12) (χ23 , ef23) =
33+
ElementHom≡ G refl
34+
35+
∫-id : (F : Functor C (SET ℓS)) ∫-hom (idTrans F) ≡ Id
36+
∫-id F = Functor≡
37+
(λ _ refl)
38+
λ {(c1 , f1)} {(c2 , f2)} (χ , ef) ElementHom≡ F refl
39+
40+
∫-seq : {C : Category ℓC ℓC'} {F G H : Functor C (SET ℓS)} : NatTrans F G) : NatTrans G H)
41+
∫-hom (seqTrans μ ν) ≡ funcComp (∫-hom ν) (∫-hom μ)
42+
∫-seq {H = H} μ ν = Functor≡
43+
(λ _ refl)
44+
λ {(c1 , f1)} {(c2 , f2)} (χ , ef) ElementHom≡ H refl
45+
46+
module _ (C : Category ℓC ℓC') (ℓS : Level) where
47+
48+
ElementsWildFunctor : WildFunctor (AsWildCat (FUNCTOR C (SET ℓS))) (CatWildCat (ℓ-max ℓC ℓS) (ℓ-max ℓC' ℓS))
49+
WildFunctor.F-ob ElementsWildFunctor = ∫_
50+
WildFunctor.F-hom ElementsWildFunctor = ∫-hom
51+
WildFunctor.F-id ElementsWildFunctor {F} = ∫-id F
52+
WildFunctor.F-seq ElementsWildFunctor μ ν = ∫-seq μ ν
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{-# OPTIONS --safe #-}
2+
3+
module Cubical.WildCat.Instances.NonWild where
4+
5+
open import Cubical.Foundations.Prelude
6+
7+
open import Cubical.Categories.Category.Base
8+
open import Cubical.Categories.Functor.Base
9+
10+
open import Cubical.WildCat.Base
11+
open import Cubical.WildCat.Functor
12+
13+
module _ {ℓ ℓ' : Level} (C : Category ℓ ℓ') where
14+
15+
open WildCat
16+
open Category
17+
18+
AsWildCat : WildCat ℓ ℓ'
19+
ob AsWildCat = ob C
20+
Hom[_,_] AsWildCat = Hom[_,_] C
21+
id AsWildCat = id C
22+
_⋆_ AsWildCat = _⋆_ C
23+
⋆IdL AsWildCat = ⋆IdL C
24+
⋆IdR AsWildCat = ⋆IdR C
25+
⋆Assoc AsWildCat = ⋆Assoc C
26+
27+
28+
module _ {ℓC ℓC' ℓD ℓD' : Level} {C : Category ℓC ℓC'} {D : Category ℓD ℓD'} (F : Functor C D) where
29+
30+
open Functor
31+
open WildFunctor
32+
33+
AsWildFunctor : WildFunctor (AsWildCat C) (AsWildCat D)
34+
F-ob AsWildFunctor = F-ob F
35+
F-hom AsWildFunctor = F-hom F
36+
F-id AsWildFunctor = F-id F
37+
F-seq AsWildFunctor = F-seq F

0 commit comments

Comments
 (0)