-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(CategoryTheory): categories of homological complexes have a sepa…
…rator (#20229) (This also requires the introduction of a typeclass `ComplexShape.HasNoLoop`, which holds for the most common shapes.) Co-authored-by: Joël Riou <[email protected]>
- Loading branch information
Showing
6 changed files
with
196 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/- | ||
Copyright (c) 2024 Joël Riou. All rights reserved. | ||
Released under Apache 2.0 license as described in the file LICENSE. | ||
Authors: Joël Riou | ||
-/ | ||
import Mathlib.Algebra.Homology.ComplexShape | ||
import Mathlib.Algebra.Group.Int.Defs | ||
import Mathlib.Algebra.Group.Nat.Defs | ||
|
||
/-! | ||
# Complex shapes with no loop | ||
Let `c : ComplexShape ι`. We define a type class `c.HasNoLoop` | ||
which expresses that `¬ c.Rel i i` for all `i : ι`. | ||
-/ | ||
|
||
namespace ComplexShape | ||
|
||
variable {ι : Type*} | ||
|
||
/-- The condition that `c.Rel i i` does not hold for any `i`. -/ | ||
class HasNoLoop (c : ComplexShape ι) : Prop where | ||
not_rel_self (i : ι) : ¬ c.Rel i i | ||
|
||
section | ||
|
||
variable (c : ComplexShape ι) [c.HasNoLoop] (j : ι) | ||
|
||
lemma not_rel_self : ¬ c.Rel j j := | ||
HasNoLoop.not_rel_self j | ||
|
||
variable {j} in | ||
lemma not_rel_of_eq {j' : ι } (h : j = j') : ¬ c.Rel j j' := by | ||
subst h | ||
exact c.not_rel_self j | ||
|
||
instance : c.symm.HasNoLoop where | ||
not_rel_self j := c.not_rel_self j | ||
|
||
lemma exists_distinct_prev_or : | ||
(∃ (k : ι), c.Rel j k ∧ j ≠ k) ∨ ∀ (k : ι), ¬ c.Rel j k := by | ||
by_cases h : ∃ (k : ι), c.Rel j k | ||
· obtain ⟨k, hk⟩ := h | ||
exact Or.inl ⟨k, hk, fun hjk ↦ c.not_rel_of_eq hjk hk⟩ | ||
· exact Or.inr (by simpa using h) | ||
|
||
lemma exists_distinct_next_or : | ||
(∃ (i : ι), c.Rel i j ∧ i ≠ j) ∨ ∀ (i : ι), ¬ c.Rel i j := by | ||
by_cases h : ∃ (i : ι), c.Rel i j | ||
· obtain ⟨i, hi⟩ := h | ||
exact Or.inl ⟨i, hi, fun hij ↦ c.not_rel_of_eq hij hi⟩ | ||
· exact Or.inr (by simpa using h) | ||
|
||
lemma hasNoLoop_up' {α : Type*} [AddZeroClass α] [IsRightCancelAdd α] [IsLeftCancelAdd α] | ||
(a : α) (ha : a ≠ 0) : | ||
(up' a).HasNoLoop where | ||
not_rel_self i (hi : _ = _) := | ||
ha (add_left_cancel (by rw [add_zero, hi])) | ||
|
||
lemma hasNoLoop_down' {α : Type*} [AddZeroClass α] [IsRightCancelAdd α] [IsLeftCancelAdd α] | ||
(a : α) (ha : a ≠ 0) : | ||
(down' a).HasNoLoop := by | ||
have := hasNoLoop_up' a ha | ||
exact inferInstanceAs (up' a).symm.HasNoLoop | ||
|
||
lemma hasNoLoop_up {α : Type*} [AddZeroClass α] [IsRightCancelAdd α] [IsLeftCancelAdd α] | ||
[One α] (ha : (1 : α) ≠ 0) : | ||
(up α).HasNoLoop := | ||
hasNoLoop_up' _ ha | ||
|
||
lemma hasNoLoop_down {α : Type*} [AddZeroClass α] [IsRightCancelAdd α] [IsLeftCancelAdd α] | ||
[One α] (ha : (1 : α) ≠ 0) : | ||
(down α).HasNoLoop := | ||
hasNoLoop_down' _ ha | ||
|
||
end | ||
|
||
instance : (up ℤ).HasNoLoop := hasNoLoop_up (by simp) | ||
instance : (up ℕ).HasNoLoop := hasNoLoop_up (by simp) | ||
instance : (down ℤ).HasNoLoop := hasNoLoop_down (by simp) | ||
instance : (down ℕ).HasNoLoop := hasNoLoop_down (by simp) | ||
|
||
end ComplexShape |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/- | ||
Copyright (c) 2024 Joël Riou. All rights reserved. | ||
Released under Apache 2.0 license as described in the file LICENSE. | ||
Authors: Joël Riou | ||
-/ | ||
import Mathlib.Algebra.Homology.Double | ||
import Mathlib.Algebra.Homology.HomologicalComplexLimits | ||
import Mathlib.CategoryTheory.Generator.Basic | ||
|
||
/-! | ||
# Generators of the category of homological complexes | ||
Let `c : ComplexShape ι` be a complex shape with no loop. | ||
If a category `C` has a separator, then `HomologicalComplex C c` | ||
has a separating family, and a separator when suitable coproducts exist. | ||
-/ | ||
|
||
universe t w v u | ||
|
||
open CategoryTheory Limits | ||
|
||
namespace HomologicalComplex | ||
|
||
variable {C : Type u} [Category.{v} C] {ι : Type w} [DecidableEq ι] | ||
(c : ComplexShape ι) [c.HasNoLoop] | ||
|
||
section | ||
|
||
variable [HasZeroMorphisms C] [HasZeroObject C] | ||
|
||
variable {α : Type t} {X : α → C} (hX : IsSeparating (Set.range X)) | ||
|
||
variable (X) in | ||
/-- If `X : α → C` is a separating family, and `c : ComplexShape ι` has no loop, | ||
then this is a separating family indexed by `α × ι` in `HomologicalComplex C c`, | ||
which consists of homological complexes that are nonzero in at most | ||
two (consecutive) degrees. -/ | ||
noncomputable def separatingFamily (j : α × ι) : HomologicalComplex C c := | ||
evalCompCoyonedaCorepresentative c (X j.1) j.2 | ||
|
||
include hX in | ||
lemma isSeparating_separatingFamily : | ||
IsSeparating (Set.range (separatingFamily c X)) := by | ||
intro K L f g h | ||
ext j | ||
apply hX | ||
rintro _ ⟨a, rfl⟩ p | ||
have H := evalCompCoyonedaCorepresentable c (X a) j | ||
apply H.homEquiv.symm.injective | ||
simpa only [H.homEquiv_symm_comp] using h _ ⟨⟨a, j⟩, rfl⟩ (H.homEquiv.symm p) | ||
|
||
end | ||
|
||
variable [HasCoproductsOfShape ι C] [Preadditive C] [HasZeroObject C] | ||
|
||
lemma isSeparator_coproduct_separatingFamily {X : C} (hX : IsSeparator X) : | ||
IsSeparator (∐ (fun i ↦ separatingFamily c (fun (_ : Unit) ↦ X) ⟨⟨⟩, i⟩)) := by | ||
let φ (i : ι) := separatingFamily c (fun (_ : Unit) ↦ X) ⟨⟨⟩, i⟩ | ||
refine isSeparator_of_isColimit_cofan | ||
(isSeparating_separatingFamily c (X := fun (_ : Unit) ↦ X) (by simpa using hX)) | ||
(c := Cofan.mk (∐ φ) (fun ⟨_, i⟩ ↦ Sigma.ι φ i)) ?_ | ||
exact IsColimit.ofWhiskerEquivalence | ||
(Discrete.equivalence (Equiv.punitProd.{0} ι).symm) (coproductIsCoproduct φ) | ||
|
||
instance [HasSeparator C] : HasSeparator (HomologicalComplex C c) := | ||
⟨_, isSeparator_coproduct_separatingFamily c (isSeparator_separator C)⟩ | ||
|
||
end HomologicalComplex |