refactor(Computability): make PFun a one-field structure - #38534
refactor(Computability): make PFun a one-field structure#38534AlexeyMilovanov wants to merge 63 commits into
PFun a one-field structure#38534Conversation
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 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 371cb47e8fImport changes for modified filesNo significant changes to the import graph Import changes for all files
|
| Current number | Change | Type (strong) |
|---|---|---|
| backward.isDefEq.respectTransparency | 4744 | -32 |
| backward.isDefEq.respectTransparency.types | 2465 | -4 |
Current commit 371cb47e8f
Reference commit 5315eef9e4
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
relativevalue is the weighted sum of the differences with weight given by the inverse of the current value of the statistic. - The
absolutevalue is therelativevalue divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).
a29b66d to
e83159c
Compare
|
This pull request is now in draft mode. No active bors state needed cleanup. While this PR remains draft, bors will ignore commands on this PR. Mark it ready for review before using commands like |
cb11c69 to
38d9dd0
Compare
58c6265 to
c886cf2
Compare
Sorry, I meant |
|
Can you please get the hang of resolving the comments you've satisfactorily addressed and removing |
|
-awaiting-author |
YaelDillies
left a comment
There was a problem hiding this comment.
Thanks!
maintainer delegate
|
🚀 Pull request has been placed on the maintainer queue by YaelDillies. |
Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
|
This pull request has conflicts, please merge |
…like # Conflicts: # Mathlib/Data/PFun.lean
|
This pull request has conflicts, please merge |
…like # Conflicts: # Mathlib/Computability/PartrecCode.lean
|
!radar |
|
Benchmark results for 8492528 against fa6385b are in. No significant results found. @jcommelin
Medium changes (1🟥)
Small changes (2✅, 4🟥)
|
|
Thanks for your PR! I think I understand the motivation for this PR: using |
|
This pull request has conflicts, please merge |
…like # Conflicts: # Mathlib/CategoryTheory/Category/PartialFun.lean
Use .of_eq to guide implicit argument inference after the PFun refactor. This recovers the affected module performance without changing the public API.
|
!bench |
|
Benchmark results for bed3641 against 5315eef are in. No significant results found. @AlexeyMilovanov
Small changes (2✅, 1🟥)
|
|
!radar |
|
Benchmark results for 371cb47 against 5315eef are in. No significant results found. @AlexeyMilovanov
Small changes (2✅, 2🟥)
|
This PR refactors
PFunfromdef PFun α β := α → Part βto a structure with aFunLikeinstance.Discussion
Main changes
PFunas a structure with one field,toFun : α → Part β.FunLike (α →. β) α (Part β)instance and configuresimpsprojections.fun x ↦. ...notation for partial-function literals.PFun.extorDFunLike.extwherefunextno longer applies directly.backward.isDefEq.respectTransparency falseworkarounds thatare no longer needed after the refactor.
Downstream impact
The refactor mainly impacts Computability Theory and Category Theory (
Category/PartialFun.lean). SincePFunis no longer definitionally equal toα → Part β, tactics such asrfl,simp, andfunextcan no longer always see through the old raw-function representation.Note on LLM usage
The core
PFunchange caused numerous downstream errors. I initially used an LLM to help draft fixes for these files. Afterwards, I spent a significant amount of time manually correcting and modifying all of the generated changes.