Skip to content

feat(AlgebraicTopology): delaborators for truncated simplicial notations#20719

Open
gio256 wants to merge 101 commits intomasterfrom
gio/trunc-delab
Open

feat(AlgebraicTopology): delaborators for truncated simplicial notations#20719
gio256 wants to merge 101 commits intomasterfrom
gio/trunc-delab

Conversation

@gio256
Copy link
Copy Markdown
Collaborator

@gio256 gio256 commented Jan 13, 2025

We add delaborators for the following notations, introduced in #20688:

  • ⦋m⦌ₙ, which denotes the m-dimensional simplex in the n-truncated simplex category.
  • X _⦋m⦌ₙ, which denotes the m-th term of an n-truncated simplicial object X.
  • X ^⦋m⦌ₙ, which denotes the m-th term of an n-truncated cosimplicial object X.

If pp.proofs is set to true, we also pretty-print the proof p : m ≤ n for all three notations as ⦋m, p⦌ₙ, X _⦋m, p⦌ₙ, and X ^⦋m, p⦌ₙ, respectively.

Credit to @kmill for one piece of code and much metaprogramming inspiration.


Open in Gitpod

@gio256 gio256 added WIP Work in progress t-meta Tactics, attributes or user commands t-category-theory Category theory labels Jan 13, 2025
@mathlib4-dependent-issues-bot mathlib4-dependent-issues-bot added the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Jan 13, 2025
@gio256 gio256 removed the WIP Work in progress label Jan 14, 2025
@gio256
Copy link
Copy Markdown
Collaborator Author

gio256 commented Jan 14, 2025

The following test, taken from #17732, shows that our delaborator attempts to pretty-print some terms even when the truncation level cannot be subscripted.

I'm not aware of a fix for this that would still allow pretty-printing things like [m]ₙ₊₁, but any suggestions would be appreciated. It also might not matter, as I can't think of any cases where the difference between [m]ₙ and [m]n✝ would be all that confusing.

import Mathlib.AlgebraicTopology.SimplexCategory
open SimplexCategory.Truncated

variable (n : ℕ) (m : ℕ) (h : m ≤ n) (x) (hx : x = [m]ₙ) (n : True)

/- The delaborator should ideally not fire here because the truncation level is now `n✝`,
which cannot be subscripted. -/
/-- info: hx : x = [m]n✝ -/
#guard_msgs in #check hx

Edit: Fixed in commits 5d41e60 and f4d15c3.

@gio256 gio256 removed the WIP Work in progress label Jan 17, 2025
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 18, 2025

PR summary 99427a7c6c

Import changes for modified files

Dependency changes

File Base Count Head Count Change
Mathlib.AlgebraicTopology.SimplexCategory.Defs 385 384 -1 (-0.26%)
Mathlib.Tactic 2702 2704 +2 (+0.07%)
Import changes for all files
Files Import difference
Mathlib.AlgebraicTopology.SimplexCategory.Defs -1
61 files Mathlib.Algebra.Homology.AlternatingConst Mathlib.AlgebraicTopology.AlternatingFaceMapComplex Mathlib.AlgebraicTopology.CechNerve Mathlib.AlgebraicTopology.DoldKan.Decomposition Mathlib.AlgebraicTopology.DoldKan.Degeneracies Mathlib.AlgebraicTopology.DoldKan.EquivalenceAdditive Mathlib.AlgebraicTopology.DoldKan.EquivalencePseudoabelian Mathlib.AlgebraicTopology.DoldKan.Equivalence Mathlib.AlgebraicTopology.DoldKan.Faces Mathlib.AlgebraicTopology.DoldKan.FunctorGamma Mathlib.AlgebraicTopology.DoldKan.FunctorN Mathlib.AlgebraicTopology.DoldKan.GammaCompN Mathlib.AlgebraicTopology.DoldKan.Homotopies Mathlib.AlgebraicTopology.DoldKan.HomotopyEquivalence Mathlib.AlgebraicTopology.DoldKan.NCompGamma Mathlib.AlgebraicTopology.DoldKan.NReflectsIso Mathlib.AlgebraicTopology.DoldKan.Normalized Mathlib.AlgebraicTopology.DoldKan.Notations Mathlib.AlgebraicTopology.DoldKan.PInfty Mathlib.AlgebraicTopology.DoldKan.Projections Mathlib.AlgebraicTopology.DoldKan.SplitSimplicialObject Mathlib.AlgebraicTopology.ExtraDegeneracy Mathlib.AlgebraicTopology.MooreComplex Mathlib.AlgebraicTopology.Quasicategory.Basic Mathlib.AlgebraicTopology.Quasicategory.Nerve Mathlib.AlgebraicTopology.Quasicategory.StrictSegal Mathlib.AlgebraicTopology.SimplexCategory.Basic Mathlib.AlgebraicTopology.SimplexCategory.GeneratorsRelations.Basic Mathlib.AlgebraicTopology.SimplexCategory.GeneratorsRelations.EpiMono Mathlib.AlgebraicTopology.SimplexCategory.MorphismProperty Mathlib.AlgebraicTopology.SimplicialCategory.Basic Mathlib.AlgebraicTopology.SimplicialCategory.SimplicialObject Mathlib.AlgebraicTopology.SimplicialNerve Mathlib.AlgebraicTopology.SimplicialObject.Basic Mathlib.AlgebraicTopology.SimplicialObject.Coskeletal Mathlib.AlgebraicTopology.SimplicialObject.Split Mathlib.AlgebraicTopology.SimplicialSet.Basic Mathlib.AlgebraicTopology.SimplicialSet.Boundary Mathlib.AlgebraicTopology.SimplicialSet.CategoryWithFibrations Mathlib.AlgebraicTopology.SimplicialSet.Coskeletal Mathlib.AlgebraicTopology.SimplicialSet.Degenerate Mathlib.AlgebraicTopology.SimplicialSet.HomotopyCat Mathlib.AlgebraicTopology.SimplicialSet.Horn Mathlib.AlgebraicTopology.SimplicialSet.KanComplex Mathlib.AlgebraicTopology.SimplicialSet.Monoidal Mathlib.AlgebraicTopology.SimplicialSet.NerveAdjunction Mathlib.AlgebraicTopology.SimplicialSet.Nerve Mathlib.AlgebraicTopology.SimplicialSet.Path Mathlib.AlgebraicTopology.SimplicialSet.StdSimplex Mathlib.AlgebraicTopology.SimplicialSet.StrictSegal Mathlib.AlgebraicTopology.SimplicialSet.Subcomplex Mathlib.AlgebraicTopology.SingularHomology.Basic Mathlib.AlgebraicTopology.SingularSet Mathlib.AlgebraicTopology.TopologicalSimplex Mathlib.CategoryTheory.Category.Cat.Colimit Mathlib.CategoryTheory.Idempotents.SimplicialObject Mathlib.RepresentationTheory.GroupCohomology.Basic Mathlib.RepresentationTheory.GroupCohomology.Functoriality Mathlib.RepresentationTheory.GroupCohomology.Hilbert90 Mathlib.RepresentationTheory.GroupCohomology.LowDegree Mathlib.RepresentationTheory.GroupCohomology.Resolution
1
Mathlib.Tactic 2
Mathlib.Tactic.SimplexCategory (new file) 386

Declarations diff

+ Nat'
+ Nat'.γ
+ delabSubscript
+ delabSuperscript
+++ delabMkNotation

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 script/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).

@mathlib4-dependent-issues-bot mathlib4-dependent-issues-bot added the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Mar 19, 2025
tukamilano pushed a commit that referenced this pull request Mar 20, 2025
We provide macros for the following notations:
- `⦋m⦌ₙ` denotes the `m`-dimensional simplex in the `n`-truncated simplex category.
- `X _⦋m⦌ₙ` denotes the `m`-th term of an `n`-truncated simplicial object `X`.
- `X ^⦋m⦌ₙ` denotes the `m`-th term of an `n`-truncated cosimplicial object `X`.

For all of these notations, the truncation proof `p : m ≤ n` can also be provided using the syntax `⦋m, p⦌ₙ`, `X _⦋m, p⦌ₙ`, and `X ^⦋m, p⦌ₙ`, respectively.

These notations generalize those already in use in `HomotopyCat.lean` and `Coskeletal.lean`.

Delaborators for these notations are added in #20719.

See #17732 and #20355 to understand the reason for the use of `subscriptTerm`.



Co-authored-by: gio256 <gio256@protonmail.com>
@leanprover-community-bot-assistant leanprover-community-bot-assistant added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Apr 1, 2025
@github-actions github-actions bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Apr 1, 2025
idontgetoutmuch pushed a commit to idontgetoutmuch/mathlib4 that referenced this pull request Apr 7, 2025
…ommunity#20688)

We provide macros for the following notations:
- `⦋m⦌ₙ` denotes the `m`-dimensional simplex in the `n`-truncated simplex category.
- `X _⦋m⦌ₙ` denotes the `m`-th term of an `n`-truncated simplicial object `X`.
- `X ^⦋m⦌ₙ` denotes the `m`-th term of an `n`-truncated cosimplicial object `X`.

For all of these notations, the truncation proof `p : m ≤ n` can also be provided using the syntax `⦋m, p⦌ₙ`, `X _⦋m, p⦌ₙ`, and `X ^⦋m, p⦌ₙ`, respectively.

These notations generalize those already in use in `HomotopyCat.lean` and `Coskeletal.lean`.

Delaborators for these notations are added in leanprover-community#20719.

See leanprover-community#17732 and leanprover-community#20355 to understand the reason for the use of `subscriptTerm`.



Co-authored-by: gio256 <gio256@protonmail.com>
@mathlib4-dependent-issues-bot mathlib4-dependent-issues-bot removed the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label May 1, 2025
@mathlib4-dependent-issues-bot
Copy link
Copy Markdown
Collaborator

@leanprover-community-bot-assistant
Copy link
Copy Markdown
Collaborator

This pull request has conflicts, please merge master and resolve them.

@leanprover-community-bot-assistant leanprover-community-bot-assistant added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jul 20, 2025
@grunweg grunweg added t-algebraic-topology Algebraic topology and removed t-category-theory Category theory labels Jul 31, 2025
Copy link
Copy Markdown
Contributor

@joneugster joneugster left a comment

Choose a reason for hiding this comment

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

Hi @gio256! Sorry this PR was lying around for quite a while!

I think this is useful for subscripting ⦋m⦌ₙ and ⦋m⦌ₙ₊₁ which seem to be the main intended use cases.

As far as I can see the main blocker of the PR was that @kim-em commented, that the tests are covering cases outside of the intended usage. I think this is fine as is.

Could you please resolve merge conflicts, so we can get this merged afterwards?

@joneugster joneugster assigned joneugster and unassigned eric-wieser Jan 16, 2026
@joneugster
Copy link
Copy Markdown
Contributor

I've asked on Zulip in #Infinity-Cosmos > truncated simplicial notations if anybody is still interested in getting this merged with no reaction. Therefore I am going to mark this ass please-adopt and will-close-soon and unassign myself. (Currently the will-close-soon has no consequences, it might in a further future)

Please feel free to reassign me if there are any changes :)

@joneugster joneugster added please-adopt Inactive PR (would be valuable to adopt) will-close-soon Unless something changes, we will close this PR soon labels Mar 27, 2026
@joneugster joneugster removed their assignment Mar 27, 2026
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 merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) please-adopt Inactive PR (would be valuable to adopt) t-algebraic-topology Algebraic topology t-meta Tactics, attributes or user commands will-close-soon Unless something changes, we will close this PR soon

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants