feat(AlgebraicTopology/SimplicialSet): define isomorphisms in simplicial sets, and the coherent isomorphism simplicial set#35287
Conversation
Welcome new contributor!Thank you for contributing to Mathlib! If you haven't done so already, please review our contribution guidelines, as well as the style guide and naming conventions. We use a review queue to manage reviews. If your PR does not appear there, it is probably because it is not successfully building (i.e., it doesn't have a green checkmark), has the If you haven't already done so, please come to https://leanprover.zulipchat.com/, introduce yourself, and mention your new PR. Thank you again for joining our community. |
PR summary eb5df47f87Import changes for modified filesNo significant changes to the import graph Import changes for all files
|
|
infinity-cosmos |
623bb82 to
fe43f6a
Compare
robin-carlier
left a comment
There was a problem hiding this comment.
Not a full review, but here are already some comments/suggestions
|
|
||
| open WalkingIso | ||
|
|
||
| namespace WalkingIso |
There was a problem hiding this comment.
Here and below, you should use a universe level w, and use WalkingIso.{w} instead of WalkingIso:
using WalkingIso with an unspecified universe works but will create a universe-level metavariable, and we have observed in the library that these can be a cause of bad performances, so the good practice for now is to add an extra universe like this.
| def toIso (F : WalkingIso ⥤ C) : (F.obj zero) ≅ (F.obj one) where | ||
| hom := F.map PUnit.unit | ||
| inv := F.map PUnit.unit | ||
| hom_inv_id := by rw [← F.map_comp, ← F.map_id]; rfl | ||
| inv_hom_id := by rw [← F.map_comp, ← F.map_id]; rfl |
There was a problem hiding this comment.
You should also consider defining
def iso : zero.{u} ≅ one where
hom := ()
inv := ()and then
@[simps!]
def toIso (F : WalkingIso.{w} ⥤ C) : F.obj zero ≅ F.obj one := F.mapIso iso(here, I’m using the extra universe w to not make unintentional collisions with the levels in C. alternatively, you could use
variable (C : Type*) [Category* C]instead of
variable (C : Type u) [Category.{v} C]to leave the levels in C "irrelevant".)
| def WalkingIso : Type u := ULift (Fin 2) | ||
|
|
||
| @[match_pattern] | ||
| def WalkingIso.zero : WalkingIso := ULift.up (0 : Fin 2) | ||
|
|
||
| @[match_pattern] | ||
| def WalkingIso.one : WalkingIso := ULift.up (1 : Fin 2) |
There was a problem hiding this comment.
| def WalkingIso : Type u := ULift (Fin 2) | |
| @[match_pattern] | |
| def WalkingIso.zero : WalkingIso := ULift.up (0 : Fin 2) | |
| @[match_pattern] | |
| def WalkingIso.one : WalkingIso := ULift.up (1 : Fin 2) | |
| inductive WalkingIso : Type u where | |
| | zero : WalkingIso | |
| | one : WalkingIso | |
| attribute [aesop safe cases (rule_sets := [CategoryTheory])] WalkingIso | |
| attribute [grind cases] WalkingIso |
Semireducible type synonyms (that’s the jargon for def … : Type _ := …) are usually brittle and prone to defeq abuse, and I think the current trend in mathlib is to move away from them in favor of custom inductives or structures. Here, since you are tagging zero and one to match on it, it’s probably better to directly make it
an inductive. The type annotation Type u makes sure it lives in the right universes.
The two line below helps automation understanding how to work with the object.
|
|
||
| @[expose] public section | ||
|
|
||
| universe u v |
There was a problem hiding this comment.
| universe u v | |
| universe w v u |
(see in other comments as to why I am suggesting adding a w).
| Hom _ _ := Unit | ||
| id _ := ⟨⟩ | ||
| comp _ _ := ⟨⟩ | ||
|
|
There was a problem hiding this comment.
Additionally, you could consider adding extra instances like
instance {x y : WalkingIso.{u}} : Unique (x ⟶ y) := inferInstanceAs (Unique Unit)| /-- For `hom` an edge, `IsIso hom` encodes that there is a backward edge `inv`, and | ||
| there are 2-simplices witnessing that `hom` and `inv` compose to the identity on their endpoints. | ||
| This means that `hom` becomes an isomorphism in the homotopy category. -/ | ||
| structure IsIso (hom : Edge x₀ x₁) where |
There was a problem hiding this comment.
I think the name should be changed: usually, Is is a prefix for Prop-valued definition.
As quasicategory theory develops in mathlib, we will want it to be as backwards compatible as possible and to have the same names as the corresponding objects in ordinary category theory when possible: The current CategoryTheory.IsIso is the mere existence of such a structure.
Since it’s the structure of an isomorphism in the homotopy category, maybe hIso would be a suitable name for the structure?
| {X : SSet} {m n : SimplexCategory} (f : m ⟶ n) (g : stdSimplex.obj n ⟶ X) | ||
| : X.map f.op (yonedaEquiv g) = yonedaEquiv (stdSimplex.map f ≫ g) | ||
| := uliftYonedaEquiv_naturality _ _ |
There was a problem hiding this comment.
| {X : SSet} {m n : SimplexCategory} (f : m ⟶ n) (g : stdSimplex.obj n ⟶ X) | |
| : X.map f.op (yonedaEquiv g) = yonedaEquiv (stdSimplex.map f ≫ g) | |
| := uliftYonedaEquiv_naturality _ _ | |
| {X : SSet} {m n : SimplexCategory} (f : m ⟶ n) (g : stdSimplex.obj n ⟶ X) : | |
| X.map f.op (yonedaEquiv g) = yonedaEquiv (stdSimplex.map f ≫ g) := | |
| uliftYonedaEquiv_naturality _ _ |
similarly below
| @@ -1,16 +1,16 @@ | |||
| /- | |||
| Copyright (c) 2025 Joël Riou. All rights reserved. | |||
| Copyright (c) 2025 Joël Riou, Arnoud van der Leer. All rights reserved. | |||
There was a problem hiding this comment.
Please don’t change the copyright line of a file, only the Authors line.
show that any edge in a simplicial set, that is the image of the forward edge of the coherent isomorphism under a simplicial set morphism, is an isomorphism.