Skip to content

Commit 904aa21

Browse files
authored
Category no eta equality (#1247)
* init the no-eta-equality for Category experiment * update Category.Path to no-eta-equality * no-eta-equality appropriate interface for Opposite categories * weakequiv fixes * more fixes * get started on fixing ZFunctor stuff * port ZFunctors to no-eta-equality * fix whitespace * get CommAlgebras compiling by filling in some inferred args * more op stuff * another op * another one * remove irrelevant changes * restore comment * revert unnecessary change * revert unnecessary change
1 parent 071e312 commit 904aa21

File tree

16 files changed

+163
-81
lines changed

16 files changed

+163
-81
lines changed

Cubical/AlgebraicGeometry/Functorial/ZFunctors/Base.agda

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ open import Cubical.Categories.Instances.Sets
4343
open import Cubical.Categories.Instances.CommRings
4444
open import Cubical.Categories.Instances.Functors
4545
open import Cubical.Categories.NaturalTransformation
46+
open import Cubical.Categories.Presheaf
4647
open import Cubical.Categories.Yoneda
4748
open import Cubical.Categories.Site.Sheaf
4849
open import Cubical.Categories.Site.Instances.ZariskiCommRing
@@ -60,16 +61,19 @@ module _ {ℓ : Level} where
6061
open CommRingStr ⦃...⦄
6162
open IsCommRingHom
6263

64+
Aff : Category (ℓ-suc ℓ) ℓ
65+
Aff = CommRingsCategory {ℓ = ℓ} ^op
6366

6467
-- using the naming conventions of Demazure & Gabriel
65-
ℤFunctor = Functor (CommRingsCategory {ℓ = ℓ}) (SET ℓ)
66-
ℤFUNCTOR = FUNCTOR (CommRingsCategory {ℓ = ℓ}) (SET ℓ)
68+
ℤFunctor = Presheaf Aff ℓ
69+
ℤFUNCTOR = PresheafCategory Aff ℓ
6770

6871
-- Yoneda in the notation of Demazure & Gabriel,
6972
-- uses that double op is original category definitionally
70-
Sp : Functor (CommRingsCategory {ℓ = ℓ} ^op) ℤFUNCTOR
71-
Sp = YO {C = (CommRingsCategory {ℓ = ℓ} ^op)}
73+
Sp : Functor Aff ℤFUNCTOR
74+
Sp = YO
7275

76+
-- TODO: should probably just be hasUniversalElement
7377
isAffine : (X : ℤFunctor) Type (ℓ-suc ℓ)
7478
isAffine X = ∃[ A ∈ CommRing ℓ ] NatIso (Sp .F-ob A) X
7579
-- TODO: 𝔸¹ ≅ Sp ℤ[x] and 𝔾ₘ ≅ Sp ℤ[x,x⁻¹] ≅ D(x) ↪ 𝔸¹ as first examples of affine schemes
@@ -82,7 +86,7 @@ module _ {ℓ : Level} where
8286
-- aka the affine line
8387
-- (aka the representable of ℤ[x])
8488
𝔸¹ : ℤFunctor
85-
𝔸¹ = ForgetfulCommRing→Set
89+
𝔸¹ = ForgetfulCommRing→Set ∘F fromOpOp
8690

8791
-- the global sections functor
8892
𝓞 : Functor ℤFUNCTOR (CommRingsCategory {ℓ = ℓ-suc ℓ} ^op)

Cubical/Categories/Category/Base.agda

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ private
1212

1313
-- Categories with hom-sets
1414
record Category ℓ ℓ' : Type (ℓ-suc (ℓ-max ℓ ℓ')) where
15-
-- no-eta-equality ; NOTE: need eta equality for `opop`
15+
-- TODO: document the impetus for this change
16+
no-eta-equality
1617
field
1718
ob : Type ℓ
1819
Hom[_,_] : ob ob Type ℓ'
@@ -137,6 +138,7 @@ isPropIsUnivalent =
137138
(isPropΠ2 λ _ _ isPropIsEquiv _ )
138139

139140
-- Opposite category
141+
-- TODO: move all of this to Constructions.Opposite?
140142
_^op : Category ℓ ℓ' Category ℓ ℓ'
141143
ob (C ^op) = ob C
142144
Hom[_,_] (C ^op) x y = C [ y , x ]

Cubical/Categories/Category/Path.agda

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -79,40 +79,42 @@ module _ {C C' : Category ℓ ℓ'} where
7979
id≡ c = cong id pa
8080
⋆≡ c = cong _⋆_ pa
8181

82-
CategoryPathIso : Iso (CategoryPath C C') (C ≡ C')
83-
Iso.fun CategoryPathIso = CategoryPath.mk≡
84-
Iso.inv CategoryPathIso = ≡→CategoryPath
85-
Iso.rightInv CategoryPathIso b i j = c
86-
where
87-
cp = ≡→CategoryPath b
88-
b' = CategoryPath.mk≡ cp
89-
module _ (j : I) where
90-
module c' = Category (b j)
91-
92-
c : Category ℓ ℓ'
93-
ob c = c'.ob j
94-
Hom[_,_] c = c'.Hom[_,_] j
95-
id c = c'.id j
96-
_⋆_ c = c'._⋆_ j
97-
⋆IdL c = isProp→SquareP (λ i j
82+
83+
module _ (b : C ≡ C') where
84+
private
85+
cp = ≡→CategoryPath b
86+
b' = CategoryPath.mk≡ cp
87+
88+
CategoryPathIsoRightInv : mk≡ (≡→CategoryPath b) ≡ b
89+
CategoryPathIsoRightInv i j .ob = b j .ob
90+
CategoryPathIsoRightInv i j .Hom[_,_] = b j .Hom[_,_]
91+
CategoryPathIsoRightInv i j .id = b j .id
92+
CategoryPathIsoRightInv i j ._⋆_ = b j ._⋆_
93+
CategoryPathIsoRightInv i j .⋆IdL = isProp→SquareP (λ i j
9894
isPropImplicitΠ2 λ x y isPropΠ λ f
9995
(isSetHom≡ cp j {x} {y})
100-
(c'._⋆_ j (c'.id j) f) f)
101-
refl refl (λ j b' j .⋆IdL) (λ j c'.⋆IdL j) i j
102-
⋆IdR c = isProp→SquareP (λ i j
96+
(b j ._⋆_ (b j .id) f) f)
97+
refl refl (λ j b' j .⋆IdL) (λ j b j .⋆IdL) i j
98+
CategoryPathIsoRightInv i j .⋆IdR = isProp→SquareP (λ i j
10399
isPropImplicitΠ2 λ x y isPropΠ λ f
104100
(isSetHom≡ cp j {x} {y})
105-
(c'._⋆_ j f (c'.id j)) f)
106-
refl refl (λ j b' j .⋆IdR) (λ j c'.⋆IdR j) i j
107-
⋆Assoc c = isProp→SquareP (λ i j
101+
(b j ._⋆_ f (b j .id)) f)
102+
refl refl (λ j b' j .⋆IdR) (λ j b j .⋆IdR) i j
103+
CategoryPathIsoRightInv i j .⋆Assoc = isProp→SquareP (λ i j
108104
isPropImplicitΠ4 λ x y z w isPropΠ3 λ f g h
109105
(isSetHom≡ cp j {x} {w})
110-
(c'._⋆_ j (c'._⋆_ j {x} {y} {z} f g) h)
111-
(c'._⋆_ j f (c'._⋆_ j g h)))
112-
refl refl (λ j b' j .⋆Assoc) (λ j c'.⋆Assoc j) i j
113-
isSetHom c = isProp→SquareP (λ i j
114-
isPropImplicitΠ2 λ x y isPropIsSet {A = c'.Hom[_,_] j x y})
115-
refl refl (λ j b' j .isSetHom) (λ j c'.isSetHom j) i j
106+
(b j ._⋆_ (b j ._⋆_ {x} {y} {z} f g) h)
107+
(b j ._⋆_ f (b j ._⋆_ g h)))
108+
refl refl (λ j b' j .⋆Assoc) (λ j b j .⋆Assoc) i j
109+
CategoryPathIsoRightInv i j .isSetHom = isProp→SquareP (λ i j
110+
isPropImplicitΠ2 λ x y isPropIsSet {A = b j .Hom[_,_] x y})
111+
refl refl (λ j b' j .isSetHom) (λ j b j .isSetHom) i j
112+
113+
CategoryPathIso : Iso (CategoryPath C C') (C ≡ C')
114+
Iso.fun CategoryPathIso = CategoryPath.mk≡
115+
Iso.inv CategoryPathIso = ≡→CategoryPath
116+
Iso.rightInv CategoryPathIso = CategoryPathIsoRightInv
117+
116118
ob≡ (Iso.leftInv CategoryPathIso a i) = ob≡ a
117119
Hom≡ (Iso.leftInv CategoryPathIso a i) = Hom≡ a
118120
id≡ (Iso.leftInv CategoryPathIso a i) = id≡ a

Cubical/Categories/Category/Properties.agda

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@ module _ {C : Category ℓ ℓ'} where
2929
isSetHomP2r = isOfHLevel→isOfHLevelDep 2 (λ a isSetHom C {y = a})
3030

3131

32-
-- opposite of opposite is definitionally equal to itself
33-
involutiveOp : {C : Category ℓ ℓ'} C ^op ^op ≡ C
34-
involutiveOp = refl
32+
-- opposite of opposite is *not* definitionally equal to itself.
33+
-- The following does *not* type check because of no-eta-equality.
34+
-- involutiveOp : ∀ {C : Category ℓ ℓ'} → C ^op ^op ≡ C
35+
-- involutiveOp = refl
3536

3637
module _ {C : Category ℓ ℓ'} where
3738
-- Other useful operations on categories

Cubical/Categories/Constructions/Opposite.agda

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,16 @@ module _ {C : Category ℓC ℓC'} (isUnivC : isUnivalent C) where
2323
J (λ y p op-Iso (pathToIso {C = C} p) ≡ pathToIso {C = C ^op} p)
2424
(CatIso≡ _ _ refl)
2525

26-
op-Iso-pathToIso' : {x y : C .ob} (p : x ≡ y)
27-
op-Iso (pathToIso {C = C ^op} p) ≡ pathToIso {C = C} p
28-
op-Iso-pathToIso' =
29-
J (λ y p op-Iso (pathToIso {C = C ^op} p) ≡ pathToIso {C = C} p)
30-
(CatIso≡ _ _ refl)
26+
op-Iso⁻-pathToIso : {x y : C .ob} (p : x ≡ y)
27+
op-Iso⁻ (pathToIso {C = C ^op} p) ≡ pathToIso {C = C} p
28+
op-Iso⁻-pathToIso =
29+
J (λ _ p op-Iso⁻ (pathToIso p) ≡ pathToIso p) (CatIso≡ _ _ refl)
3130

3231
isUnivalentOp : isUnivalent (C ^op)
3332
isUnivalentOp .univ x y = isIsoToIsEquiv
34-
( (λ f^op CatIsoToPath isUnivC (op-Iso f^op))
33+
( (λ f^op CatIsoToPath isUnivC (op-Iso f^op))
3534
, (λ f^op CatIso≡ _ _
36-
(cong fst
37-
(cong op-Iso ((secEq (univEquiv isUnivC _ _) (op-Iso f^op))))))
38-
, λ p cong (CatIsoToPath isUnivC) (op-Iso-pathToIso' p)
35+
(cong fst (cong op-Iso (secEq (univEquiv isUnivC _ _) (op-Iso⁻ f^op)))))
36+
, λ p
37+
cong (CatIsoToPath isUnivC) (op-Iso-pathToIso p)
3938
∙ retEq (univEquiv isUnivC _ _) p)

Cubical/Categories/Constructions/Slice/Functor.agda

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ private
2626
variable
2727
ℓ ℓ' : Level
2828
C D : Category ℓ ℓ'
29-
c d : C .ob
3029

3130
infix 39 _F/_
3231
infix 40 ∑_
@@ -79,7 +78,7 @@ module _ (Pbs : Pullbacks C) where
7978
open _⊣₂_
8079

8180

82-
module _ (𝑓 : C [ c , d ]) where
81+
module _ {c d}(𝑓 : C [ c , d ]) where
8382

8483
open BaseChange 𝑓 hiding (_*)
8584

Cubical/Categories/Constructions/TwistedArrow.agda

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ TwistedEnds : (C : Category ℓ ℓ') → Functor (TwistedArrowCategory C) (C ^o
2222
TwistedEnds C = ForgetElements (HomFunctor C)
2323

2424
TwistedDom : (C : Category ℓ ℓ') Functor ((TwistedArrowCategory C) ^op) C
25-
TwistedDom C = ((Fst (C ^op) C) ^opF) ∘F (ForgetElements (HomFunctor C) ^opF)
25+
TwistedDom C = recOp (Fst _ _ ∘F ForgetElements (HomFunctor C))
2626

2727
TwistedCod : (C : Category ℓ ℓ') Functor (TwistedArrowCategory C) C
2828
TwistedCod C = (Snd (C ^op) C) ∘F ForgetElements (HomFunctor C)

Cubical/Categories/Displayed/Constructions/Weaken/Base.agda

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ open import Cubical.Data.Sigma
1010

1111
open import Cubical.Categories.Category.Base
1212
open import Cubical.Categories.Functor
13+
open import Cubical.Categories.Constructions.BinProduct
1314

1415
open import Cubical.Categories.Displayed.Base
1516
open import Cubical.Categories.Displayed.Section.Base
@@ -42,6 +43,9 @@ module _ (C : Category ℓC ℓC') (D : Category ℓD ℓD') where
4243
weakenΠ .F-id = refl
4344
weakenΠ .F-seq _ _ = refl
4445

46+
∫weaken→×C : Functor (∫C weaken) (C ×C D)
47+
∫weaken→×C = TC.Fst ,F weakenΠ
48+
4549
module _ {C : Category ℓC ℓC'}
4650
{D : Category ℓD ℓD'}
4751
{E : Category ℓE ℓE'}
@@ -95,3 +99,4 @@ module _ {B : Category ℓB ℓB'} {C : Category ℓC ℓC'} where
9599
weakenF G .F-homᴰ = G .F-hom
96100
weakenF G .F-idᴰ = G .F-id
97101
weakenF G .F-seqᴰ = G .F-seq
102+

Cubical/Categories/Displayed/Functor.agda

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,36 @@ module _ {C : Category ℓC ℓC'} {D : Category ℓD ℓD'} {F : Functor C D}
143143

144144
-- Displayed opposite functor
145145
module _ {C : Category ℓC ℓC'} {D : Category ℓD ℓD'}
146-
{F : Functor C D} {Cᴰ : Categoryᴰ C ℓCᴰ ℓCᴰ'} {Dᴰ : Categoryᴰ D ℓDᴰ ℓDᴰ'}
147-
(Fᴰ : Functorᴰ F Cᴰ Dᴰ)
146+
{Cᴰ : Categoryᴰ C ℓCᴰ ℓCᴰ'} {Dᴰ : Categoryᴰ D ℓDᴰ ℓDᴰ'}
148147
where
149148
open Functorᴰ
150-
_^opFᴰ : Functorᴰ (F ^opF) (Cᴰ ^opᴰ) (Dᴰ ^opᴰ)
151-
_^opFᴰ .F-obᴰ = Fᴰ .F-obᴰ
152-
_^opFᴰ .F-homᴰ = Fᴰ .F-homᴰ
153-
_^opFᴰ .F-idᴰ = Fᴰ .F-idᴰ
154-
_^opFᴰ .F-seqᴰ fᴰ gᴰ = Fᴰ .F-seqᴰ gᴰ fᴰ
155149

150+
-- TODO: move to Displayed.Constructions.Opposite
151+
introOpᴰ : {F} Functorᴰ F (Cᴰ ^opᴰ) Dᴰ Functorᴰ (introOp F) Cᴰ (Dᴰ ^opᴰ)
152+
introOpᴰ Fᴰ .F-obᴰ = Fᴰ .F-obᴰ
153+
introOpᴰ Fᴰ .F-homᴰ = Fᴰ .F-homᴰ
154+
introOpᴰ Fᴰ .F-idᴰ = Fᴰ .F-idᴰ
155+
introOpᴰ Fᴰ .F-seqᴰ fᴰ gᴰ = Fᴰ .F-seqᴰ gᴰ fᴰ
156+
157+
recOpᴰ : {F} Functorᴰ F Cᴰ (Dᴰ ^opᴰ) Functorᴰ (recOp F) (Cᴰ ^opᴰ) Dᴰ
158+
recOpᴰ Fᴰ .F-obᴰ = Fᴰ .F-obᴰ
159+
recOpᴰ Fᴰ .F-homᴰ = Fᴰ .F-homᴰ
160+
recOpᴰ Fᴰ .F-idᴰ = Fᴰ .F-idᴰ
161+
recOpᴰ Fᴰ .F-seqᴰ fᴰ gᴰ = Fᴰ .F-seqᴰ gᴰ fᴰ
162+
module _ {C : Category ℓC ℓC'} {Cᴰ : Categoryᴰ C ℓCᴰ ℓCᴰ'} where
163+
toOpOpᴰ : Functorᴰ toOpOp Cᴰ ((Cᴰ ^opᴰ) ^opᴰ)
164+
toOpOpᴰ = introOpᴰ 𝟙ᴰ⟨ _ ⟩
165+
166+
fromOpOpᴰ : Functorᴰ fromOpOp ((Cᴰ ^opᴰ) ^opᴰ) Cᴰ
167+
fromOpOpᴰ = recOpᴰ 𝟙ᴰ⟨ _ ⟩
168+
module _ {C : Category ℓC ℓC'} {D : Category ℓD ℓD'}
169+
{Cᴰ : Categoryᴰ C ℓCᴰ ℓCᴰ'} {Dᴰ : Categoryᴰ D ℓDᴰ ℓDᴰ'}
170+
where
171+
172+
_^opFᴰ : {F} Functorᴰ F Cᴰ Dᴰ
173+
Functorᴰ (F ^opF) (Cᴰ ^opᴰ) (Dᴰ ^opᴰ)
174+
Fᴰ ^opFᴰ = recOpᴰ (toOpOpᴰ ∘Fᴰ Fᴰ)
175+
176+
_^opF⁻ᴰ : {F} Functorᴰ F (Cᴰ ^opᴰ) (Dᴰ ^opᴰ)
177+
Functorᴰ (F ^opF⁻) Cᴰ Dᴰ
178+
Fᴰ ^opF⁻ᴰ = fromOpOpᴰ ∘Fᴰ introOpᴰ Fᴰ

Cubical/Categories/Displayed/Section/Base.agda

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,3 +316,38 @@ module _ {C : Category ℓC ℓC'}
316316
compFunctorᴰGlobalSection : Functorᴰ F Cᴰ Dᴰ GlobalSection Cᴰ Section F Dᴰ
317317
compFunctorᴰGlobalSection Fᴰ Gᴰ = reindS' (Eq.refl , Eq.refl)
318318
(compFunctorᴰSection Fᴰ Gᴰ)
319+
320+
module _ {C : Category ℓC ℓC'}
321+
{D : Category ℓD ℓD'}
322+
{Dᴰ : Categoryᴰ D ℓDᴰ ℓDᴰ'}
323+
where
324+
325+
open Section
326+
introOpS : {F : Functor (C ^op) _}
327+
Section F Dᴰ
328+
Section (introOp F) (Dᴰ ^opᴰ)
329+
introOpS S .F-obᴰ = S .F-obᴰ
330+
introOpS S .F-homᴰ = S .F-homᴰ
331+
introOpS S .F-idᴰ = S .F-idᴰ
332+
introOpS S .F-seqᴰ f g = S .F-seqᴰ g f
333+
334+
recOpS : {F : Functor C _}
335+
Section F (Dᴰ ^opᴰ)
336+
Section (recOp F) Dᴰ
337+
recOpS S .F-obᴰ = S .F-obᴰ
338+
recOpS S .F-homᴰ = S .F-homᴰ
339+
recOpS S .F-idᴰ = S .F-idᴰ
340+
recOpS S .F-seqᴰ f g = S .F-seqᴰ g f
341+
342+
module _ {C : Category ℓC ℓC'}
343+
{D : Category ℓD ℓD'}
344+
{Dᴰ : Categoryᴰ D ℓDᴰ ℓDᴰ'}
345+
where
346+
347+
_^opS : {F : Functor C _} Section F Dᴰ Section (F ^opF) (Dᴰ ^opᴰ)
348+
S ^opS = recOpS (compFunctorᴰSection toOpOpᴰ S)
349+
350+
_^opS⁻ : {F : Functor (C ^op) _}
351+
Section F (Dᴰ ^opᴰ)
352+
Section (F ^opF⁻) Dᴰ
353+
S ^opS⁻ = compFunctorᴰSection fromOpOpᴰ (introOpS S)

0 commit comments

Comments
 (0)