Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 6669a28

Browse files
committed
feat(algebraic_topology/simplicial_object + ...): Add has_limits + has_colimits instances (#6695)
This PR adds `has_limits` and `has_colimits` instances for the category of simplicial objects (assuming the existence of such an instance for the base category). The category of simplicial sets now has both limits and colimits, and we include a small example of a simplicial set (the circle) constructed as a colimit. This PR also includes the following two components, which were required for the above: 1. A basic API for working with `ulift C` where `C` is a category. This was required to avoid some annoying universe issues in the definitions of `has_colimits` and `has_limits`. 2. A small shim that transports a `has_(co)limit` instance along an equivalence of categories. Co-authored-by: Adam Topaz <adamtopaz@users.noreply.github.com>
1 parent 6d7d169 commit 6669a28

File tree

4 files changed

+115
-3
lines changed

4 files changed

+115
-3
lines changed

src/algebraic_topology/simplicial_object.lean

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Johan Commelin, Scott Morrison
55
-/
66
import algebraic_topology.simplex_category
7+
import category_theory.category.ulift
8+
import category_theory.limits.functor_category
9+
import category_theory.opposites
10+
import category_theory.adjunction.limits
711

812
/-!
913
# Simplicial objects in a category.
@@ -13,6 +17,7 @@ A simplicial object in a category `C` is a `C`-valued presheaf on `simplex_categ
1317

1418
open opposite
1519
open category_theory
20+
open category_theory.limits
1621

1722
universes v u
1823

@@ -26,6 +31,23 @@ This is the category of contravariant functors from `simplex_category` to `C`. -
2631
def simplicial_object := simplex_categoryᵒᵖ ⥤ C
2732

2833
namespace simplicial_object
34+
35+
instance {J : Type v} [small_category J] [has_limits_of_shape J C] :
36+
has_limits_of_shape J (simplicial_object C) :=
37+
let E : (simplex_categoryᵒᵖ ⥤ C) ≌ (ulift.{v} simplex_category)ᵒᵖ ⥤ C :=
38+
ulift.equivalence.op.congr_left in
39+
adjunction.has_limits_of_shape_of_equivalence E.functor
40+
41+
instance [has_limits C] : has_limits (simplicial_object C) := ⟨infer_instance⟩
42+
43+
instance {J : Type v} [small_category J] [has_colimits_of_shape J C] :
44+
has_colimits_of_shape J (simplicial_object C) :=
45+
let E : (simplex_categoryᵒᵖ ⥤ C) ≌ (ulift.{v} simplex_category)ᵒᵖ ⥤ C :=
46+
ulift.equivalence.op.congr_left in
47+
adjunction.has_colimits_of_shape_of_equivalence E.functor
48+
49+
instance [has_colimits C] : has_colimits (simplicial_object C) := ⟨infer_instance⟩
50+
2951
variables {C} (X : simplicial_object C)
3052

3153
/-- Face maps for a simplicial object. -/

src/algebraic_topology/simplicial_set.lean

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Authors: Johan Commelin, Scott Morrison
55
-/
66
import algebraic_topology.simplicial_object
77
import category_theory.yoneda
8+
import category_theory.limits.types
89

910
/-!
1011
A simplicial set is just a simplicial object in `Type`,
@@ -33,7 +34,7 @@ open category_theory
3334
/-- The category of simplicial sets.
3435
This is the category of contravariant functors from
3536
`simplex_category` to `Type u`. -/
36-
@[derive large_category]
37+
@[derive [large_category, limits.has_limits, limits.has_colimits]]
3738
def sSet : Type (u+1) := simplicial_object (Type u)
3839

3940
namespace sSet
@@ -42,7 +43,7 @@ namespace sSet
4243
is the Yoneda embedding of `n`. -/
4344
def standard_simplex : simplex_category ⥤ sSet := yoneda
4445

45-
localized "notation `Δ[`n`]` := standard_simplex.obj n" in sSet
46+
localized "notation `Δ[`n`]` := standard_simplex.obj (n : ℕ)" in sSet
4647

4748
instance : inhabited sSet := ⟨standard_simplex.obj (0 : ℕ)⟩
4849

@@ -82,11 +83,23 @@ def horn (n : ℕ) (i : fin (n+1)) : sSet :=
8283
exact set.range_comp_subset_range _ _ hj,
8384
end⟩ }
8485

85-
localized "notation `Λ[`n`, `i`]` := horn n i" in sSet
86+
localized "notation `Λ[`n`, `i`]` := horn (n : ℕ) i" in sSet
8687

8788
/-- The inclusion of the `i`-th horn of the `n`-th standard simplex into that standard simplex. -/
8889
def horn_inclusion (n : ℕ) (i : fin (n+1)) :
8990
Λ[n, i] ⟶ Δ[n] :=
9091
{ app := λ m (α : {α : Δ[n].obj m // _}), α }
9192

93+
section examples
94+
95+
open_locale sSet
96+
97+
/-- The simplicial circle. -/
98+
noncomputable def S1 : sSet :=
99+
limits.colimit $ limits.parallel_pair
100+
((standard_simplex.map $ simplex_category.δ 0) : Δ[0] ⟶ Δ[1])
101+
(standard_simplex.map $ simplex_category.δ 1)
102+
103+
end examples
104+
92105
end sSet

src/category_theory/adjunction/limits.lean

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,16 @@ lemma has_colimit_of_comp_equivalence (E : C ⥤ D) [is_equivalence E] [has_coli
115115
(@adjunction.has_colimit_comp_equivalence _ _ _ _ _ _ (K ⋙ E) (inv E) _ _)
116116
((functor.right_unitor _).symm ≪≫ iso_whisker_left K (E.as_equivalence.unit_iso))
117117

118+
/-- Transport a `has_colimits_of_shape` instance across an equivalence. -/
119+
lemma has_colimits_of_shape_of_equivalence (E : C ⥤ D) [is_equivalence E]
120+
[has_colimits_of_shape J D] : has_colimits_of_shape J C :=
121+
⟨λ F, by exactI has_colimit_of_comp_equivalence F E⟩
122+
123+
/-- Transport a `has_colimits` instance across an equivalence. -/
124+
lemma has_colimits_of_equivalence (E : C ⥤ D) [is_equivalence E] [has_colimits D] :
125+
has_colimits C :=
126+
⟨λ J hJ, by exactI has_colimits_of_shape_of_equivalence E⟩
127+
118128
end preservation_colimits
119129

120130
section preservation_limits
@@ -212,6 +222,15 @@ lemma has_limit_of_comp_equivalence (E : D ⥤ C) [is_equivalence E] [has_limit
212222
(@adjunction.has_limit_comp_equivalence _ _ _ _ _ _ (K ⋙ E) (inv E) _ _)
213223
((iso_whisker_left K E.as_equivalence.unit_iso.symm) ≪≫ (functor.right_unitor _))
214224

225+
/-- Transport a `has_limits_of_shape` instance across an equivalence. -/
226+
lemma has_limits_of_shape_of_equivalence (E : D ⥤ C) [is_equivalence E] [has_limits_of_shape J C] :
227+
has_limits_of_shape J D :=
228+
⟨λ F, by exactI has_limit_of_comp_equivalence F E⟩
229+
230+
/-- Transport a `has_limits` instance across an equivalence. -/
231+
lemma has_limits_of_equivalence (E : D ⥤ C) [is_equivalence E] [has_limits C] : has_limits D :=
232+
⟨λ J hJ, by exactI has_limits_of_shape_of_equivalence E⟩
233+
215234
end preservation_limits
216235

217236
/-- auxiliary construction for `cocones_iso` -/
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/-
2+
Copyright (c) 2021 Adam Topaz. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Adam Topaz
5+
-/
6+
import category_theory.category
7+
import category_theory.equivalence
8+
9+
/-!
10+
# Basic API for ulift
11+
12+
This file contains a very basic API for working with the categorical
13+
instance on `ulift C` where `C` is a type with a category instance.
14+
15+
1. `category_theory.ulift.up` is the functorial version of the usual `ulift.up`.
16+
2. `category_theory.ulift.down` is the functorial version of the usual `ulift.down`.
17+
3. `category_theory.ulift.equivalence` is the categorical equivalence between
18+
`C` and `ulift C`.
19+
-/
20+
21+
universes v u1 u2
22+
23+
namespace category_theory
24+
25+
variables {C : Type u1} [category.{v} C]
26+
27+
/-- The functorial version of `ulift.up`. -/
28+
@[simps]
29+
def ulift.up : C ⥤ (ulift.{u2} C) :=
30+
{ obj := ulift.up,
31+
map := λ X Y f, f }
32+
33+
/-- The functorial version of `ulift.down`. -/
34+
@[simps]
35+
def ulift.down : (ulift.{u2} C) ⥤ C :=
36+
{ obj := ulift.down,
37+
map := λ X Y f, f }
38+
39+
/-- The categorical equivalence between `C` and `ulift C`. -/
40+
@[simps]
41+
def ulift.equivalence : C ≌ (ulift.{u2} C) :=
42+
{ functor := ulift.up,
43+
inverse := ulift.down,
44+
unit_iso :=
45+
{ hom := 𝟙 _,
46+
inv := 𝟙 _ },
47+
counit_iso :=
48+
{ hom :=
49+
{ app := λ X, 𝟙 _,
50+
naturality' := λ X Y f, by {change f ≫ 𝟙 _ = 𝟙 _ ≫ f, simp} },
51+
inv :=
52+
{ app := λ X, 𝟙 _,
53+
naturality' := λ X Y f, by {change f ≫ 𝟙 _ = 𝟙 _ ≫ f, simp} },
54+
hom_inv_id' := by {ext, change (𝟙 _) ≫ (𝟙 _) = 𝟙 _, simp},
55+
inv_hom_id' := by {ext, change (𝟙 _) ≫ (𝟙 _) = 𝟙 _, simp} },
56+
functor_unit_iso_comp' := λ X, by {change (𝟙 X) ≫ (𝟙 X) = 𝟙 X, simp} }
57+
58+
end category_theory

0 commit comments

Comments
 (0)