Skip to content

feat: implement pi-base cross-reference attribute#41487

Open
Deicyde wants to merge 6 commits into
leanprover-community:masterfrom
Deicyde:codex/pibase-crossref-attr
Open

feat: implement pi-base cross-reference attribute#41487
Deicyde wants to merge 6 commits into
leanprover-community:masterfrom
Deicyde:codex/pibase-crossref-attr

Conversation

@Deicyde

@Deicyde Deicyde commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Adds a @[pibase ID] cross-reference attribute for canonical pi-base identifiers.

The parser accepts IDs of the form P000001, S000023, and T000001, and routes them to the corresponding properties/, spaces/, or theorems/ page on topology.pi-base.org.

Tests cover docstring insertion, #pibase_tags, all three URL routes, and malformed IDs.

This PR was prepared with assistance from Codex. Based heavily on #41290

@github-actions github-actions Bot added the t-meta Tactics, attributes or user commands label Jul 8, 2026
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

PR summary 3dfdb5d9f5

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff (regex)

+ Lean.TSyntax.getPibaseId
+ p
+ pibaseIdAntiquot.parenthesizer
+ pibaseIdFn
+ pibaseIdKind
+ pibaseIdNoAntiquot
+ pibaseIdNoAntiquot.formatter
+ pibaseIdParser
+ s
+ t

You can run this locally as follows
## from your `mathlib4` directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci

## summary with just the declaration names:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh <optional_commit>

## more verbose report:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh long <optional_commit>

The doc-module for scripts/pr_summary/declarations_diff.sh in the mathlib-ci repository contains some details about this script.

Declarations diff (Lean)

Lean-aware diff — post-build, computed from the Lean environment (commit 20ddbc3).

  • +14 new declarations
  • −0 removed declarations
+Lean.PrettyPrinter.Formatter.pibaseIdNoAntiquot.formatter
+Lean.PrettyPrinter.Parenthesizer.pibaseIdAntiquot.parenthesizer
+Lean.TSyntax.getPibaseId
+Mathlib.CrossRef.Database.pibase
+Mathlib.CrossRef.Database.pibase.elim
+Mathlib.CrossRef.Database.pibase.sizeOf_spec
+Mathlib.CrossRef.pibaseIdFn
+Mathlib.CrossRef.pibaseIdKind
+Mathlib.CrossRef.pibaseIdNoAntiquot
+Mathlib.CrossRef.pibaseIdParser
+Mathlib.CrossRef.pibaseIdParser.formatter
+Mathlib.CrossRef.pibaseIdParser.parenthesizer
+Mathlib.CrossRef.pibaseTag
+Mathlib.CrossRef.pibaseTags

No changes to strong technical debt.

No changes to weak technical debt.

Current commit 3dfdb5d9f5
Reference commit f041774a2d

This script lives in the mathlib-ci repository. To run it locally, from your mathlib4 directory:

git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci
../mathlib-ci/scripts/reporting/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).

@mathlib-dependent-issues mathlib-dependent-issues Bot added the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Jul 8, 2026
@Deicyde
Deicyde force-pushed the codex/pibase-crossref-attr branch from 477b168 to c198e80 Compare July 8, 2026 10:05
@Deicyde
Deicyde marked this pull request as ready for review July 8, 2026 10:07
@Deicyde

Deicyde commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

LLM-generated

@github-actions github-actions Bot added the LLM-generated PRs with substantial input from LLMs - review accordingly label Jul 8, 2026
@Deicyde
Deicyde force-pushed the codex/pibase-crossref-attr branch 2 times, most recently from a8ecafa to cb3b52c Compare July 8, 2026 10:25
@mathlib-dependent-issues mathlib-dependent-issues Bot removed the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Jul 8, 2026
@mathlib-merge-conflicts

Copy link
Copy Markdown

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

@mathlib-merge-conflicts mathlib-merge-conflicts Bot 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 8, 2026
@Deicyde
Deicyde force-pushed the codex/pibase-crossref-attr branch from cb3b52c to 78bd73f Compare July 9, 2026 07:59
@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 Jul 9, 2026

@joneugster joneugster left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the PR!

Comment thread Mathlib/Tactic/CrossRefAttribute.lean Outdated
@joneugster joneugster added the awaiting-author A reviewer has asked the author a question or requested changes. label Jul 12, 2026
Co-authored-by: Jon Eugster <eugster.jon@gmail.com>
@Deicyde

Deicyde commented Jul 18, 2026

Copy link
Copy Markdown
Contributor Author

-awaiting-author

@github-actions github-actions Bot removed the awaiting-author A reviewer has asked the author a question or requested changes. label Jul 18, 2026
Comment thread MathlibTest/CrossRefAttribute.lean Outdated
Comment thread Mathlib/Tactic/CrossRefAttribute.lean Outdated
Comment thread Mathlib/Tactic/CrossRefAttribute.lean
Comment thread Mathlib/Tactic/CrossRefAttribute.lean
@joneugster joneugster self-assigned this Jul 24, 2026
Comment thread MathlibTest/CrossRefAttribute.lean Outdated
Comment thread Mathlib/Tactic/CrossRefAttribute.lean Outdated
@joneugster

Copy link
Copy Markdown
Contributor

Sorry @thorimur, I've simply forgot to self-assign this PR when I looked at it last week!

I've now extracted the part of your style suggestion which affects new code, see comments above.

There's one unresolved suggestion to add a -- TODO to the code to mark existing (and copied) technical debt. I have no clear opinion on that as the PR is just reusing existing patterns.

@joneugster joneugster added the awaiting-author A reviewer has asked the author a question or requested changes. label Jul 24, 2026
Deicyde and others added 2 commits July 24, 2026 14:06
Co-authored-by: Jon Eugster <eugster.jon@gmail.com>
Co-authored-by: Jon Eugster <eugster.jon@gmail.com>
@Deicyde

Deicyde commented Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

-awaiting-author

@github-actions github-actions Bot removed the awaiting-author A reviewer has asked the author a question or requested changes. label Jul 24, 2026
@joneugster

Copy link
Copy Markdown
Contributor

Thanks!

maintainer merge

@github-actions

Copy link
Copy Markdown

🚀 Pull request has been placed on the maintainer queue by joneugster.

@mathlib-triage mathlib-triage Bot added the maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. label Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

LLM-generated PRs with substantial input from LLMs - review accordingly maintainer-merge A reviewer has approved the changed; awaiting maintainer approval. t-meta Tactics, attributes or user commands

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants