Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: let synth order checker detect generalized projections #7310

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kmill
Copy link
Collaborator

@kmill kmill commented Mar 3, 2025

This PR modifies the instance synth order checker to detect projections-like instances, rather having special support only for constructor field projections. An instance is projection-like if the first instance implicit argument has a type that's a constant applied to all the preceding arguments in order — these arguments are assumed to be the parameters of the type.

In the future the class command will make all its generated parent projections use implicits for all parameters, making the generated projections all consistent.

This PR modifies the instance synth order checker to detect projections-like instances, rather having special support only for constructor field projections. An instance is projection-like if the first instance implicit argument has a type that's a constant applied to all the preceding arguments in order — these arguments are assumed to be the parameters of the type.

In the future the `class` command will make all its generated parent projections use implicits for all parameters, making the generated projections all consistent.
@kmill kmill added awaiting-review Waiting for someone to review the PR changelog-language Language features, tactics, and metaprograms labels Mar 3, 2025
@github-actions github-actions bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Mar 3, 2025
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Mar 3, 2025
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Mar 3, 2025
@leanprover-community-bot leanprover-community-bot added the breaks-mathlib This is not necessarily a blocker for merging: but there needs to be a plan label Mar 3, 2025
@leanprover-community-bot
Copy link
Collaborator

Mathlib CI status (docs):

@kmill kmill marked this pull request as draft March 3, 2025 23:51
@kmill kmill removed the awaiting-review Waiting for someone to review the PR label Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaks-mathlib This is not necessarily a blocker for merging: but there needs to be a plan changelog-language Language features, tactics, and metaprograms toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants