Skip to content

chore: remove obsolete proof workarounds - #45791

Open
JonasReif wants to merge 4 commits into
leanprover-community:masterfrom
JonasReif:claude/workflow-authoring-easy-wins-58cb09
Open

JonasReif wants to merge 4 commits into
leanprover-community:masterfrom
JonasReif:claude/workflow-authoring-easy-wins-58cb09

Conversation

@JonasReif

Copy link
Copy Markdown

Several proofs still carried workarounds marked by TODOs, porting notes, an adaptation note, or erw, for problems that have since been fixed: the missing lemmas now exist, or Lean no longer needs the hint. This PR removes those workarounds. Only proofs change; every statement stays the same.

  • PullbackCone.isLimitOfFactors: use t.condition_assoc h instead of the manual reassoc workaround
  • Scheme.basicOpen_add_le: use Opens.mem_sup (resolves the TODO)
  • Cardinal.toNat_congr: use mk_congr_lift, dropping the universe hint
  • LieIdeal.map_of_image: replace erw [h] with exact h.subset
  • isPullback_inl_inl_coprodMap: plain simp works now that Scheme.Hom.mem_opensRange exists (resolves the TODO)
  • Proj.fromOfGlobalSections_preimage_basicOpen: use Scheme.Hom.mem_preimage (resolves the TODO)
  • Tuple.graph.card: one-line injectivity proof
  • StarModule.decomposeProdAdjoint: drop the erw and its outdated note
  • skyscraperPresheaf_isSheaf: the universe annotation is no longer needed

Created with Claude Opus 5.5 in Claude Code.

🤖 Generated with Claude Code

@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 Nov 8, 2026
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown

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. In particular, we kindly remind contributors that we have guidelines regarding the use of AI when making pull requests.

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. The review dashboard has a dedicated webpage which shows whether your PR is on the review queue, and (if not), why.

If you haven't already done so, please come to Zulip and join the Lean community.
Thank you again for joining our community.

@github-actions github-actions Bot added the tech debt Fixes cross-cutting technical debt, see the "technical debt counters" stream on zulip label Nov 8, 2026
@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

PR summary 59c808238c

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff (regex)

No declarations were harmed in the making of this PR! 🐙

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 59c8082).

  • +0 new declarations
  • −0 removed declarations

No declaration differences.


Decrease in strong tech debt: (relative, absolute) = (1.63, 0.01)
Current number Change Type (strong)
488 -2 erw
373 -1 adaptation notes
410 -2 porting notes
No changes to weak technical debt.

Current commit 59c808238c
Reference commit 893812301f

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

Comment thread Mathlib/SetTheory/Cardinal/ToNat.lean Resolved

@grunweg grunweg 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 clean-up. I like many of the changes, and have questions about a few of them. In particular, we should ensure the underlying TODO is fixed when we delete it.

awaiting-author

Comment thread Mathlib/Data/Fin/Tuple/Sort.lean Outdated
-- Porting note: proof was `simp`
rw [Prod.ext_iff]
simp
· exact fun _ _ h ↦ congrArg Prod.snd h

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.

Does simp work here? (If not, perhaps the porting note should stay.)
Also, can you use the congr elaborator instead of congrArg? (If simp works, that would be even better.)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

simp doesn't work here: on its own it makes no progress, and intro _ _; simp leaves the injectivity goal open. So I kept the porting note and switched the proof to the congr elaborator: fun _ _ h ↦ congr($h.2).

rw [← SetLike.mem_coe] -- TODO : mem version of TopologicalSpace.Opens.map_coe
simp only [TopologicalSpace.Opens.map_coe, Set.mem_preimage,
← Scheme.Hom.comp_apply, fromOfGlobalSections]
simp only [Scheme.Hom.mem_preimage, ← Scheme.Hom.comp_apply, fromOfGlobalSections]

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.

Can this be combined with the subsequent simp?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Not as a single simp: putting ← Scheme.Hom.comp_apply into a full simp loops (it fights Scheme.Hom.comp_base) and hits the max recursion depth. Leaving it out, or dropping comp_base, leaves goals unsolved. The closest I got is one rw followed by one simp:

rw [Scheme.Hom.mem_preimage, ← Scheme.Hom.comp_apply]
simp [fromOfGlobalSections]

I've pushed that. Happy to go back to the previous version if you prefer it.

@grunweg grunweg added the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Nov 8, 2026
@JonasReif

Copy link
Copy Markdown
Author

-awaiting-author

@github-actions github-actions Bot removed the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Nov 18, 2026

This branch has not been deployed

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

Labels

new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! tech debt Fixes cross-cutting technical debt, see the "technical debt counters" stream on zulip

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants