Skip to content

Commit

Permalink
feat(category_theory/triangulated): changing namespaces, introducing …
Browse files Browse the repository at this point in the history
…triangulated categories (#17284)

This PR moves the namespace `category_theory.triangulated.pretriangulated` to `category_theory.pretriangulated`, and introduces triangulated categories.



Co-authored-by: Joël Riou <37772949+joelriou@users.noreply.github.com>
  • Loading branch information
joelriou and joelriou committed Nov 2, 2022
1 parent c64b2b4 commit 1978671
Show file tree
Hide file tree
Showing 4 changed files with 150 additions and 41 deletions.
10 changes: 5 additions & 5 deletions src/category_theory/triangulated/basic.lean
Expand Up @@ -22,7 +22,7 @@ open category_theory.limits

universes v v₀ v₁ v₂ u u₀ u₁ u₂

namespace category_theory.triangulated
namespace category_theory.pretriangulated
open category_theory.category

/-
Expand All @@ -43,6 +43,8 @@ structure triangle := mk' ::
(mor₂ : obj₂ ⟶ obj₃)
(mor₃ : obj₃ ⟶ obj₁⟦(1:ℤ)⟧)

variable {C}

/--
A triangle `(X,Y,Z,f,g,h)` in `C` is defined by the morphisms `f : X ⟶ Y`, `g : Y ⟶ Z`
and `h : Z ⟶ X⟦1⟧`.
Expand All @@ -67,12 +69,10 @@ instance : inhabited (triangle C) :=
For each object in `C`, there is a triangle of the form `(X,X,0,𝟙 X,0,0)`
-/
@[simps]
def contractible_triangle (X : C) : triangle C := triangle.mk C (𝟙 X) (0 : X ⟶ 0) 0
def contractible_triangle (X : C) : triangle C := triangle.mk (𝟙 X) (0 : X ⟶ 0) 0

end

variable {C}

/--
A morphism of triangles `(X,Y,Z,f,g,h) ⟶ (X',Y',Z',f',g',h')` in `C` is a triple of morphisms
`a : X ⟶ X'`, `b : Y ⟶ Y'`, `c : Z ⟶ Z'` such that
Expand Down Expand Up @@ -135,4 +135,4 @@ instance triangle_category : category (triangle C) :=
id := λ A, triangle_morphism_id A,
comp := λ A B C f g, f.comp g }

end category_theory.triangulated
end category_theory.pretriangulated
54 changes: 22 additions & 32 deletions src/category_theory/triangulated/pretriangulated.lean
Expand Up @@ -29,14 +29,16 @@ open category_theory.limits

universes v v₀ v₁ v₂ u u₀ u₁ u₂

namespace category_theory.triangulated
open category_theory.category
namespace category_theory
open category pretriangulated

/-
We work in a preadditive category `C` equipped with an additive shift.
-/
variables (C : Type u) [category.{v} C] [has_zero_object C] [has_shift C ℤ] [preadditive C]
[∀ n : ℤ, functor.additive (shift_functor C n)]
variables (D : Type u₂) [category.{v₂} D] [has_zero_object D] [has_shift D ℤ] [preadditive D]
[∀ n : ℤ, functor.additive (shift_functor D n)]

/--
A preadditive category `C` with an additive shift, and a class of "distinguished triangles"
Expand Down Expand Up @@ -64,10 +66,10 @@ class pretriangulated :=
(distinguished_triangles [] : set (triangle C))
(isomorphic_distinguished : Π (T₁ ∈ distinguished_triangles) (T₂ ≅ T₁),
T₂ ∈ distinguished_triangles)
(contractible_distinguished : Π (X : C), (contractible_triangle C X) ∈ distinguished_triangles)
(contractible_distinguished : Π (X : C), (contractible_triangle X) ∈ distinguished_triangles)
(distinguished_cocone_triangle : Π (X Y : C) (f : X ⟶ Y), (∃ (Z : C) (g : Y ⟶ Z)
(h : Z ⟶ X⟦(1:ℤ)⟧),
triangle.mk _ f g h ∈ distinguished_triangles))
triangle.mk f g h ∈ distinguished_triangles))
(rotate_distinguished_triangle : Π (T : triangle C),
T ∈ distinguished_triangles ↔ T.rotate ∈ distinguished_triangles)
(complete_distinguished_triangle_morphism : Π (T₁ T₂ : triangle C)
Expand All @@ -76,7 +78,9 @@ class pretriangulated :=
(∃ (c : T₁.obj₃ ⟶ T₂.obj₃), (T₁.mor₂ ≫ c = b ≫ T₂.mor₂) ∧ (T₁.mor₃ ≫ a⟦1⟧' = c ≫ T₂.mor₃) ))

namespace pretriangulated
variables [pretriangulated C]
variables [hC : pretriangulated C]

include hC

notation `dist_triang `:20 C := distinguished_triangles C
/--
Expand All @@ -103,16 +107,10 @@ See <https://stacks.math.columbia.edu/tag/0146>
-/
lemma comp_dist_triangle_mor_zero₁₂ (T ∈ dist_triang C) : T.mor₁ ≫ T.mor₂ = 0 :=
begin
have h := contractible_distinguished T.obj₁,
have f := complete_distinguished_triangle_morphism,
specialize f (contractible_triangle C T.obj₁) T h H (𝟙 T.obj₁) T.mor₁,
have t : (contractible_triangle C T.obj₁).mor₁ ≫ T.mor₁ = 𝟙 T.obj₁ ≫ T.mor₁,
by refl,
specialize f t,
cases f with c f,
rw ← f.left,
simp only [limits.zero_comp, contractible_triangle_mor₂],
end -- TODO : tidy this proof up
obtain ⟨c, hc⟩ := complete_distinguished_triangle_morphism _ _
(contractible_distinguished T.obj₁) H (𝟙 T.obj₁) T.mor₁ rfl,
simpa only [contractible_triangle_mor₂, zero_comp] using hc.left.symm,
end

/--
Given any distinguished triangle
Expand Down Expand Up @@ -144,16 +142,8 @@ by simpa using comp_dist_triangle_mor_zero₁₂ C (T.rotate.rotate) H₂
TODO: If `C` is pretriangulated with respect to a shift,
then `Cᵒᵖ` is pretriangulated with respect to the inverse shift.
-/
end pretriangulated
end category_theory.triangulated

namespace category_theory.triangulated
namespace pretriangulated

variables (C : Type u₁) [category.{v₁} C] [has_zero_object C] [has_shift C ℤ] [preadditive C]
[∀ n : ℤ, functor.additive (shift_functor C n)]
variables (D : Type u₂) [category.{v₂} D] [has_zero_object D] [has_shift D ℤ] [preadditive D]
[∀ n : ℤ, functor.additive (shift_functor D n)]
omit hC

/--
The underlying structure of a triangulated functor between pretriangulated categories `C` and `D`
Expand All @@ -179,7 +169,7 @@ triangles of `D`.
-/
@[simps]
def map_triangle (F : triangulated_functor_struct C D) : triangle C ⥤ triangle D :=
{ obj := λ T, triangle.mk _ (F.map T.mor₁) (F.map T.mor₂)
{ obj := λ T, triangle.mk (F.map T.mor₁) (F.map T.mor₂)
(F.map T.mor₃ ≫ F.comm_shift.hom.app T.obj₁),
map := λ S T f,
{ hom₁ := F.map f.hom₁,
Expand All @@ -195,20 +185,21 @@ def map_triangle (F : triangulated_functor_struct C D) : triangle C ⥤ triangle

end triangulated_functor_struct

variables (C D)
include hC
variables (C D) [pretriangulated D]

/--
A triangulated functor between pretriangulated categories `C` and `D` is a functor `F : C ⥤ D`
together with given functorial isomorphisms `ξ X : F(X⟦1⟧) ⟶ F(X)⟦1⟧` such that for every
distinguished triangle `(X,Y,Z,f,g,h)` of `C`, the triangle
`(F(X), F(Y), F(Z), F(f), F(g), F(h) ≫ (ξ X))` is a distinguished triangle of `D`.
See <https://stacks.math.columbia.edu/tag/014V>
-/
structure triangulated_functor [pretriangulated C] [pretriangulated D] extends
triangulated_functor_struct C D :=
structure triangulated_functor extends triangulated_functor_struct C D :=
(map_distinguished' : Π (T : triangle C), (T ∈ dist_triang C) →
(to_triangulated_functor_struct.map_triangle.obj T ∈ dist_triang D) )

instance [pretriangulated C] : inhabited (triangulated_functor C C) :=
instance : inhabited (triangulated_functor C C) :=
⟨{obj := λ X, X,
map := λ _ _ f, f,
comm_shift := by refl ,
Expand All @@ -218,7 +209,7 @@ instance [pretriangulated C] : inhabited (triangulated_functor C C) :=
rwa category.comp_id,
end }⟩

variables {C D} [pretriangulated C] [pretriangulated D]
variables {C D}
/--
Given a `triangulated_functor` we can define a functor from triangles of `C` to triangles of `D`.
-/
Expand All @@ -234,6 +225,5 @@ maps onto in `D` is also distinguished.
lemma triangulated_functor.map_distinguished (F : triangulated_functor C D) (T : triangle C)
(h : T ∈ dist_triang C) : (F.map_triangle.obj T) ∈ dist_triang D := F.map_distinguished' T h


end pretriangulated
end category_theory.triangulated
end category_theory
8 changes: 4 additions & 4 deletions src/category_theory/triangulated/rotate.lean
Expand Up @@ -22,7 +22,7 @@ open category_theory.limits

universes v v₀ v₁ v₂ u u₀ u₁ u₂

namespace category_theory.triangulated
namespace category_theory.pretriangulated
open category_theory.category

/--
Expand All @@ -47,7 +47,7 @@ applying `rotate` gives a triangle of the form:
```
-/
@[simps]
def triangle.rotate (T : triangle C) : triangle C := triangle.mk _ T.mor₂ T.mor₃ (-T.mor₁⟦1⟧')
def triangle.rotate (T : triangle C) : triangle C := triangle.mk T.mor₂ T.mor₃ (-T.mor₁⟦1⟧')

section
local attribute [semireducible] shift_shift_neg shift_neg_shift
Expand All @@ -68,7 +68,7 @@ not necessarily equal to `Z`, but it is isomorphic, by the `counit_iso` of `shif
-/
@[simps]
def triangle.inv_rotate (T : triangle C) : triangle C :=
triangle.mk _ (-T.mor₃⟦(-1:ℤ)⟧' ≫ (shift_shift_neg _ _).hom) T.mor₁
triangle.mk (-T.mor₃⟦(-1:ℤ)⟧' ≫ (shift_shift_neg _ _).hom) T.mor₁
(T.mor₂ ≫ (shift_neg_shift _ _).inv)

end
Expand Down Expand Up @@ -351,4 +351,4 @@ by { change is_equivalence (triangle_rotation C).functor, apply_instance, }
instance : is_equivalence (inv_rotate C) :=
by { change is_equivalence (triangle_rotation C).inverse, apply_instance, }

end category_theory.triangulated
end category_theory.pretriangulated
119 changes: 119 additions & 0 deletions src/category_theory/triangulated/triangulated.lean
@@ -0,0 +1,119 @@
/-
Copyright (c) 2022 Joël Riou. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Joël Riou
-/

import category_theory.triangulated.pretriangulated

/-!
# Triangulated Categories
This file contains the definition of triangulated categories, which are
pretriangulated categories which satisfy the octahedron axiom.
-/

noncomputable theory

namespace category_theory

open limits category preadditive pretriangulated
open_locale zero_object

variables {C : Type*} [category C] [preadditive C] [has_zero_object C] [has_shift C ℤ]
[∀ (n : ℤ), functor.additive (shift_functor C n)] [pretriangulated C]

variables {X₁ X₂ X₃ Z₁₂ Z₂₃ Z₁₃ : C} {u₁₂ : X₁ ⟶ X₂} {u₂₃ : X₂ ⟶ X₃} {u₁₃ : X₁ ⟶ X₃}
(comm : u₁₂ ≫ u₂₃ = u₁₃)
{v₁₂ : X₂ ⟶ Z₁₂} {w₁₂ : Z₁₂ ⟶ X₁⟦(1 : ℤ)⟧} (h₁₂ : triangle.mk u₁₂ v₁₂ w₁₂ ∈ dist_triang C)
{v₂₃ : X₃ ⟶ Z₂₃} {w₂₃ : Z₂₃ ⟶ X₂⟦(1 : ℤ)⟧} (h₂₃ : triangle.mk u₂₃ v₂₃ w₂₃ ∈ dist_triang C)
{v₁₃ : X₃ ⟶ Z₁₃} {w₁₃ : Z₁₃ ⟶ X₁⟦(1 : ℤ)⟧} (h₁₃ : triangle.mk u₁₃ v₁₃ w₁₃ ∈ dist_triang C)

namespace triangulated

include comm h₁₂ h₂₃ h₁₃

/-- An octahedron is a type of datum whose existence is asserted by
the octahedron axiom (TR 4), see https://stacks.math.columbia.edu/tag/05QK -/
structure octahedron :=
(m₁ : Z₁₂ ⟶ Z₁₃)
(m₃ : Z₁₃ ⟶ Z₂₃)
(comm₁ : v₁₂ ≫ m₁ = u₂₃ ≫ v₁₃)
(comm₂ : m₁ ≫ w₁₃ = w₁₂)
(comm₃ : v₁₃ ≫ m₃ = v₂₃)
(comm₄ : w₁₃ ≫ u₁₂⟦1⟧' = m₃ ≫ w₂₃)
(mem : triangle.mk m₁ m₃ (w₂₃ ≫ v₁₂⟦1⟧') ∈ dist_triang C)

omit comm h₁₂ h₂₃ h₁₃

instance (X : C) : nonempty (octahedron (comp_id (𝟙 X)) (contractible_distinguished X)
(contractible_distinguished X) (contractible_distinguished X)) :=
begin
refine ⟨⟨0, 0, _, _, _, _, by convert contractible_distinguished (0 : C)⟩⟩,
all_goals { apply subsingleton.elim, },
end

namespace octahedron

attribute [reassoc] comm₁ comm₂ comm₃ comm₄

variables {comm h₁₂ h₂₃ h₁₃} (h : octahedron comm h₁₂ h₂₃ h₁₃)

/-- The triangle `Z₁₂ ⟶ Z₁₃ ⟶ Z₂₃ ⟶ Z₁₂⟦1⟧` given by an octahedron. -/
@[simps]
def triangle : triangle C := triangle.mk h.m₁ h.m₃ (w₂₃ ≫ v₁₂⟦1⟧')

/-- The first morphism of triangles given by an octahedron. -/
@[simps]
def triangle_morphism₁ : triangle.mk u₁₂ v₁₂ w₁₂ ⟶ triangle.mk u₁₃ v₁₃ w₁₃ :=
{ hom₁ := 𝟙 X₁,
hom₂ := u₂₃,
hom₃ := h.m₁,
comm₁' := by { dsimp, rw [id_comp, comm], },
comm₂' := h.comm₁,
comm₃' := by { dsimp, simpa only [functor.map_id, comp_id] using h.comm₂.symm, }, }

/-- The second morphism of triangles given an octahedron. -/
@[simps]
def triangle_morphism₂ : triangle.mk u₁₃ v₁₃ w₁₃ ⟶ triangle.mk u₂₃ v₂₃ w₂₃ :=
{ hom₁ := u₁₂,
hom₂ := 𝟙 X₃,
hom₃ := h.m₃,
comm₁' := by { dsimp, rw [comp_id, comm], },
comm₂' := by { dsimp, rw [id_comp, h.comm₃], },
comm₃' := h.comm₄, }

/- TODO (@joelriou): show that in order to verify the existence of an octahedron, one may
replace the composable maps `u₁₂` and `u₂₃` by any isomorphic composable maps
and the given "cones" of `u₁₂`, `u₂₃`, `u₁₃` by any choice of cones. -/

end octahedron

end triangulated

open triangulated

variable (C)

/-- A triangulated category is a pretriangulated category which satisfies
the octahedron axiom (TR 4), see https://stacks.math.columbia.edu/tag/05QK -/
class is_triangulated :=
(octahedron_axiom : ∀ ⦃X₁ X₂ X₃ Z₁₂ Z₂₃ Z₁₃ : C⦄ ⦃u₁₂ : X₁ ⟶ X₂⦄ ⦃u₂₃ : X₂ ⟶ X₃⦄ ⦃u₁₃ : X₁ ⟶ X₃⦄
(comm : u₁₂ ≫ u₂₃ = u₁₃)
⦃v₁₂ : X₂ ⟶ Z₁₂⦄ ⦃w₁₂ : Z₁₂ ⟶ X₁⟦1⟧⦄ (h₁₂ : triangle.mk u₁₂ v₁₂ w₁₂ ∈ dist_triang C)
⦃v₂₃ : X₃ ⟶ Z₂₃⦄ ⦃w₂₃ : Z₂₃ ⟶ X₂⟦1⟧⦄ (h₂₃ : triangle.mk u₂₃ v₂₃ w₂₃ ∈ dist_triang C)
⦃v₁₃ : X₃ ⟶ Z₁₃⦄ ⦃w₁₃ : Z₁₃ ⟶ X₁⟦1⟧⦄ (h₁₃ : triangle.mk u₁₃ v₁₃ w₁₃ ∈ dist_triang C),
nonempty (octahedron comm h₁₂ h₂₃ h₁₃))

namespace triangulated

variable {C}

/-- A choice of octahedron given by the octahedron axiom. -/
def some_octahedron [is_triangulated C] : octahedron comm h₁₂ h₂₃ h₁₃ :=
(is_triangulated.octahedron_axiom comm h₁₂ h₂₃ h₁₃).some

end triangulated

end category_theory

0 comments on commit 1978671

Please sign in to comment.