Skip to content

Commit a1bd3fc

Browse files
authored
Pour Categories.Commutativity into Categories.Morphism (#1244)
* Pour Commutativity into Morphism * Update NaturalTransformation to not import Commutativity and also simplify natural transformation composition using compSq * make C explicit for `compSq` * fix whitespace
1 parent cd94b8c commit a1bd3fc

File tree

3 files changed

+24
-48
lines changed

3 files changed

+24
-48
lines changed

Cubical/Categories/Commutativity.agda

Lines changed: 0 additions & 32 deletions
This file was deleted.

Cubical/Categories/Morphism.agda

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{-# OPTIONS --safe #-}
12
module Cubical.Categories.Morphism where
23

34
open import Cubical.Foundations.HLevels
@@ -16,7 +17,27 @@ module _ (C : Category ℓ ℓ') where
1617

1718
private
1819
variable
19-
x y z v w : ob
20+
x y z v u w : ob
21+
22+
compSq : {f : C [ x , y ]} {g h} {k : C [ z , w ]} {l} {m} {n : C [ u , v ]}
23+
-- square 1
24+
f ⋆ g ≡ h ⋆ k
25+
-- square 2 (sharing g)
26+
k ⋆ l ≡ m ⋆ n
27+
f ⋆ (g ⋆ l) ≡ (h ⋆ m) ⋆ n
28+
compSq {f = f} {g} {h} {k} {l} {m} {n} p q
29+
= f ⋆ (g ⋆ l)
30+
≡⟨ sym (⋆Assoc _ _ _) ⟩
31+
(f ⋆ g) ⋆ l
32+
≡⟨ cong (_⋆ l) p ⟩
33+
(h ⋆ k) ⋆ l
34+
≡⟨ ⋆Assoc _ _ _ ⟩
35+
h ⋆ (k ⋆ l)
36+
≡⟨ cong (h ⋆_) q ⟩
37+
h ⋆ (m ⋆ n)
38+
≡⟨ sym (⋆Assoc _ _ _) ⟩
39+
(h ⋆ m) ⋆ n
40+
2041

2142
isMonic : Hom[ x , y ] Type (ℓ-max ℓ ℓ')
2243
isMonic {x} {y} f =

Cubical/Categories/NaturalTransformation/Base.agda

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ open import Cubical.Data.Sigma
88
open import Cubical.Categories.Category renaming (isIso to isIsoC)
99
open import Cubical.Categories.Functor.Base
1010
open import Cubical.Categories.Functor.Properties
11-
open import Cubical.Categories.Commutativity
1211
open import Cubical.Categories.Morphism
1312
open import Cubical.Categories.Isomorphism
1413

@@ -117,19 +116,7 @@ module _ {C : Category ℓC ℓC'} {D : Category ℓD ℓD'} where
117116
-- vertical sequencing
118117
seqTrans : {F G H : Functor C D} (α : NatTrans F G) (β : NatTrans G H) NatTrans F H
119118
seqTrans α β .N-ob x = (α .N-ob x) ⋆ᴰ (β .N-ob x)
120-
seqTrans {F} {G} {H} α β .N-hom f =
121-
(F .F-hom f) ⋆ᴰ ((α .N-ob _) ⋆ᴰ (β .N-ob _))
122-
≡⟨ sym (D .⋆Assoc _ _ _) ⟩
123-
((F .F-hom f) ⋆ᴰ (α .N-ob _)) ⋆ᴰ (β .N-ob _)
124-
≡[ i ]⟨ (α .N-hom f i) ⋆ᴰ (β .N-ob _) ⟩
125-
((α .N-ob _) ⋆ᴰ (G .F-hom f)) ⋆ᴰ (β .N-ob _)
126-
≡⟨ D .⋆Assoc _ _ _ ⟩
127-
(α .N-ob _) ⋆ᴰ ((G .F-hom f) ⋆ᴰ (β .N-ob _))
128-
≡[ i ]⟨ (α .N-ob _) ⋆ᴰ (β .N-hom f i) ⟩
129-
(α .N-ob _) ⋆ᴰ ((β .N-ob _) ⋆ᴰ (H .F-hom f))
130-
≡⟨ sym (D .⋆Assoc _ _ _) ⟩
131-
((α .N-ob _) ⋆ᴰ (β .N-ob _)) ⋆ᴰ (H .F-hom f)
132-
119+
seqTrans α β .N-hom f = compSq D (α .N-hom f) (β .N-hom f)
133120

134121
compTrans : {F G H : Functor C D} (β : NatTrans G H) (α : NatTrans F G) NatTrans F H
135122
compTrans β α = seqTrans α β
@@ -154,7 +141,7 @@ module _ {C : Category ℓC ℓC'} {D : Category ℓD ℓD'} where
154141
-- compose the two commuting squares
155142
-- 1. α's commuting square
156143
-- 2. β's commuting square, but extended to G since β is only G' ≡> H
157-
= compSq {C = D} (α .N-hom f) βSq
144+
= compSq D (α .N-hom f) βSq
158145
where
159146
-- functor equality implies equality of actions on objects and morphisms
160147
Gx≡G'x : G ⟅ x ⟆ ≡ G' ⟅ x ⟆

0 commit comments

Comments
 (0)