fix: make sure monad lift coercion elaborator has no side effects#6024
Merged
kmill merged 3 commits intoleanprover:masterfrom Nov 13, 2024
Merged
fix: make sure monad lift coercion elaborator has no side effects#6024kmill merged 3 commits intoleanprover:masterfrom
kmill merged 3 commits intoleanprover:masterfrom
Conversation
ghost
pushed a commit
to leanprover-community/batteries
that referenced
this pull request
Nov 10, 2024
ghost
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
Nov 10, 2024
ghost
pushed a commit
to leanprover-community/batteries
that referenced
this pull request
Nov 11, 2024
ghost
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
Nov 11, 2024
kim-em
added a commit
to leanprover-community/mathlib4
that referenced
this pull request
Nov 11, 2024
kim-em
added a commit
to leanprover-community/mathlib4
that referenced
this pull request
Nov 11, 2024
kim-em
added a commit
to leanprover-community/mathlib4
that referenced
this pull request
Nov 12, 2024
kim-em
added a commit
to leanprover-community/mathlib4
that referenced
this pull request
Nov 12, 2024
mathlib-bors bot
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
Nov 12, 2024
leanprover/lean4#6024 fixes a serious elaboration bug which, perversely, was quite helpful. Kyle is investigating replacing the bug with something intentional, but we definitively need to fix the bug in the meantime. This is the backport of changes from lean-pr-testing-6024 which do not have conflicts with `master`. There are a few more changes that we'll need to handle separately later. Co-authored-by: Kyle Miller <kmill31415@gmail.com>
This PR fixes a bug where the monad lift coercion elaborator would partially unify expressions even if they were not monads. Breaking change: examples such as `change _ = .some true` no longer work. They accidentally worked because this elaborator left an accidental type hint on `Eq`.
2b0f9bb to
53e20fe
Compare
|
Mathlib CI status (docs):
|
TobiasLeichtfried
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
Nov 21, 2024
leanprover/lean4#6024 fixes a serious elaboration bug which, perversely, was quite helpful. Kyle is investigating replacing the bug with something intentional, but we definitively need to fix the bug in the meantime. This is the backport of changes from lean-pr-testing-6024 which do not have conflicts with `master`. There are a few more changes that we'll need to handle separately later. Co-authored-by: Kyle Miller <kmill31415@gmail.com>
3 tasks
JovanGerb
pushed a commit
to JovanGerb/lean4
that referenced
this pull request
Jan 21, 2025
…anprover#6024) This PR fixes a bug where the monad lift coercion elaborator would partially unify expressions even if they were not monads. This could be taken advantage of to propagate information that could help elaboration make progress, for example the first `change` worked because the monad lift coercion elaborator was unifying `@Eq _ _` with `@Eq (Nat × Nat) p`: ```lean example (p : Nat × Nat) : p = p := by change _ = ⟨_, _⟩ -- used to work (yielding `p = (p.fst, p.snd)`), now it doesn't change ⟨_, _⟩ = _ -- never worked ``` As such, this is a breaking change; you may need to adjust expressions to include additional implicit arguments.
mathlib-bors bot
pushed a commit
to leanprover-community/mathlib4
that referenced
this pull request
Jul 22, 2025
We have some adaptation notes referring to [lean4#6024](leanprover/lean4#6024), which changed elaboration subtly; some tricky unifications no longer get solved. I checked every reference to make sure that these still apply. We don't expect that this change gets reverted, so we can turn the remaining adaptation notes into regular comments.
callesonne
pushed a commit
to callesonne/mathlib4
that referenced
this pull request
Jul 24, 2025
…unity#27348) We have some adaptation notes referring to [lean4#6024](leanprover/lean4#6024), which changed elaboration subtly; some tricky unifications no longer get solved. I checked every reference to make sure that these still apply. We don't expect that this change gets reverted, so we can turn the remaining adaptation notes into regular comments.
hrmacbeth
pushed a commit
to szqzs/mathlib4
that referenced
this pull request
Jul 28, 2025
…unity#27348) We have some adaptation notes referring to [lean4#6024](leanprover/lean4#6024), which changed elaboration subtly; some tricky unifications no longer get solved. I checked every reference to make sure that these still apply. We don't expect that this change gets reverted, so we can turn the remaining adaptation notes into regular comments.
Equilibris
pushed a commit
to Equilibris/mathlib4
that referenced
this pull request
Aug 7, 2025
…unity#27348) We have some adaptation notes referring to [lean4#6024](leanprover/lean4#6024), which changed elaboration subtly; some tricky unifications no longer get solved. I checked every reference to make sure that these still apply. We don't expect that this change gets reverted, so we can turn the remaining adaptation notes into regular comments.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR fixes a bug where the monad lift coercion elaborator would partially unify expressions even if they were not monads. This could be taken advantage of to propagate information that could help elaboration make progress, for example the first
changeworked because the monad lift coercion elaborator was unifying@Eq _ _with@Eq (Nat × Nat) p:As such, this is a breaking change; you may need to adjust expressions to include additional implicit arguments.