-
Notifications
You must be signed in to change notification settings - Fork 451
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
fix: universe parameter order discrepancy between theorem
and def
#4408
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Before this commit, the `theorem` and `def` declarations had different universe parameter orders. For example, the following `theorem`: ``` theorem f (a : α) (f : α → β) : f a = f a := by rfl ``` was elaborated as ``` theorem f.{u_2, u_1} : ∀ {α : Sort u_1} {β : Sort u_2} (a : α) (f : α → β), f a = f a := fun {α} {β} a f => Eq.refl (f a) ``` However, if we declare `f` as a `def`, the expected order is produced. ``` def f.{u_1, u_2} : ∀ {α : Sort u_1} {β : Sort u_2} (a : α) (f : α → β), f a = f a := fun {α} {β} a f => Eq.refl (f a) ``` This commit fixes this discrepancy. @semorrison: This might be a disruptive change to Mathlib, but it is better to fix the issue asap. I am surprised nobody has complained about this issue before. I discovered it while trying to reduce discrepancies between `theorem` and `def`.
github-actions
bot
added
the
toolchain-available
A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN
label
Jun 9, 2024
leanprover-community-mathlib4-bot
added a commit
to leanprover-community/batteries
that referenced
this pull request
Jun 9, 2024
leanprover-community-mathlib4-bot
added a commit
to leanprover-community/mathlib4
that referenced
this pull request
Jun 9, 2024
leanprover-community-mathlib4-bot
added
breaks-mathlib
This is not necessarily a blocker for merging: but there needs to be a plan
release-ci
Enable all CI checks for a PR, like is done for releases
labels
Jun 9, 2024
Mathlib CI status (docs):
|
leanprover-community-mathlib4-bot
added a commit
to leanprover-community/batteries
that referenced
this pull request
Jun 9, 2024
leanprover-community-mathlib4-bot
added a commit
to leanprover-community/mathlib4
that referenced
this pull request
Jun 9, 2024
mathlib-bors bot
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
Jun 11, 2024
kim-em
added a commit
to leanprover-community/mathlib4
that referenced
this pull request
Jun 16, 2024
This includes adaptations for: * leanprover/lean4#4430 * leanprover/lean4#4421 * leanprover/lean4#4357 * leanprover/lean4#4385 * leanprover/lean4#4408 Sorry that it's a few days worth in one go, for various reasons it was hard to get to green during this period. --------- Co-authored-by: Johan Commelin <[email protected]>
AntoineChambert-Loir
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
Jun 20, 2024
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
release-ci
Enable all CI checks for a PR, like is done for releases
toolchain-available
A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before this commit, the
theorem
anddef
declarations had differentuniverse parameter orders.
For example, the following
theorem
:was elaborated as
However, if we declare
f
as adef
, the expected order is produced.This commit fixes this discrepancy.
@semorrison @jcommelin: This might be a disruptive change to Mathlib, but it is better to fix the issue asap. I am surprised nobody has complained about this issue before. I discovered it while trying to reduce discrepancies between
theorem
anddef
elaboration.