Skip to content

feat(AlgebraicTopology/SimplicialSet): define isomorphisms in simplicial sets, and the coherent isomorphism simplicial set#35287

Open
arnoudvanderleer wants to merge 4 commits intoleanprover-community:masterfrom
arnoudvanderleer:iso-in-simplicial-set
Open

feat(AlgebraicTopology/SimplicialSet): define isomorphisms in simplicial sets, and the coherent isomorphism simplicial set#35287
arnoudvanderleer wants to merge 4 commits intoleanprover-community:masterfrom
arnoudvanderleer:iso-in-simplicial-set

Conversation

@arnoudvanderleer
Copy link

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.


Open in Gitpod

@github-actions github-actions bot added the new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! label Feb 14, 2026
@github-actions
Copy link

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 awaiting-author tag, or another reason described in the Lifecycle of a PR.

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.

@github-actions
Copy link

github-actions bot commented Feb 14, 2026

PR summary eb5df47f87

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.AlgebraicTopology.SimplicialSet.CoherentIso (new file) 864

Declarations diff

+ IsIso
+ WalkingIso
+ WalkingIso.one
+ WalkingIso.zero
+ coev
+ coherentIso
+ equiv
+ equivFun
+ fromIso
+ hom
+ homInvId
+ idCompId
+ id_comp_id_aux
+ instance (n : ℕ) : DecidableEq (coherentIso _⦋n⦌)
+ instance : Category (WalkingIso)
+ inv
+ invHomId
+ isIsoHom
+ isIsoId
+ isIsoInv
+ isIsoMapHom
+ isIsoOfEqMapHom
+ map
+ toIso
+ x₀
+ x₁
+ yonedaEquiv_naturality
+ yonedaEquiv_symm_naturality
+++ ofEq

You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>

The doc-module for scripts/declarations_diff.sh contains some details about this script.


No changes to technical debt.

You can run this locally as

./scripts/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@github-actions github-actions bot added the t-algebraic-topology Algebraic topology label Feb 14, 2026
@arnoudvanderleer
Copy link
Author

infinity-cosmos

@github-actions github-actions bot added the infinity-cosmos This PR is associated with Infinity Cosmos project label Feb 14, 2026
Copy link
Contributor

@robin-carlier robin-carlier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a full review, but here are already some comments/suggestions


open WalkingIso

namespace WalkingIso
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +64 to +68
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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".)

Comment on lines +41 to +47
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)
Copy link
Contributor

@robin-carlier robin-carlier Feb 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
universe u v
universe w v u

(see in other comments as to why I am suggesting adding a w).

Hom _ _ := Unit
id _ := ⟨⟩
comp _ _ := ⟨⟩

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Comment on lines +197 to +199
{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 _ _
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don’t change the copyright line of a file, only the Authors line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infinity-cosmos This PR is associated with Infinity Cosmos project new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! t-algebraic-topology Algebraic topology

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants