Skip to content

Commit 3cdbe79

Browse files
committed
Add construction of the opposite category
1 parent dc024e2 commit 3cdbe79

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

CategoryTheory/Constructions.lean

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,32 @@ open Quiver
99
open DeductiveSystem
1010
open Category
1111

12+
/--
13+
The opposite of a category C, written C^{op} is a category with
14+
the same objects and every arrow reversed:
15+
Ob(C^op) = C
16+
C^op(c₁, c₂) = Hom(c₂, c₁)
17+
-/
18+
structure Opposite (C : Type u) : Type u where
19+
obj : C
20+
21+
instance (C : Type u) [Quiver C] : Quiver (Opposite C) where
22+
Hom c₁ c₂ := Hom c₂.obj c₁.obj
23+
24+
instance (C : Type u) [DeductiveSystem C] : DeductiveSystem (Opposite C) where
25+
id C := id C.obj
26+
comp f g := comp g f
27+
28+
instance (C : Type u) [Category C] : Category (Opposite C) where
29+
id_comp _f := by
30+
apply comp_id
31+
32+
comp_id _f := by
33+
apply id_comp
34+
35+
assoc f g h := by
36+
simp [DeductiveSystem.comp]
37+
1238
/--
1339
The product of two categories is a product category where:
1440
Ob(C × D) = C₀ × D₀

0 commit comments

Comments
 (0)