Skip to content

Conversation

@kim-em
Copy link
Collaborator

@kim-em kim-em commented Jun 3, 2025

This PR removes the NatCast (Fin n) global instance (both the direct instance, and the indirect one via Lean.Grind.Semiring), as that instance causes causes x < n (for x : Fin k, n : Nat) to be elaborated as x < ↑n rather than ↑x < n, which is undesirable. Note however that in Mathlib this happens anyway!

@kim-em kim-em added the changelog-library Library label Jun 3, 2025
@kim-em kim-em requested a review from leodemoura as a code owner June 3, 2025 23:01
@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 Jun 3, 2025
@leanprover-community-bot
Copy link
Collaborator

leanprover-community-bot commented Jun 3, 2025

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase b9aefb4a502b26eb2ad6c60e4400c6bd43b33bad --onto 0f4459b42c87d7712391e6d87160da3077fff671. You can force Mathlib CI using the force-mathlib-ci label. (2025-06-03 23:53:40)
  • 💥 Mathlib branch lean-pr-testing-8620 build failed against this PR. (2025-06-04 01:52:17) View Log

leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Jun 4, 2025
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4 that referenced this pull request Jun 4, 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 Jun 4, 2025
@kim-em kim-em added this pull request to the merge queue Jun 4, 2025
Merged via the queue into master with commit 4500a7f Jun 4, 2025
19 checks passed
kim-em added a commit that referenced this pull request Jun 4, 2025
This PR removes the `NatCast (Fin n)` global instance (both the direct
instance, and the indirect one via `Lean.Grind.Semiring`), as that
instance causes causes `x < n` (for `x : Fin k`, `n : Nat`) to be
elaborated as `x < ↑n` rather than `↑x < n`, which is undesirable. Note
however that in Mathlib this happens anyway!
eshelyaron added a commit to eshelyaron/lean4-bdd that referenced this pull request Jun 16, 2025
Lean 4.21 removes the default Nat-to-Fin coercion[1], which some of
our proofs and functions relied on.

[1]: leanprover/lean4#8620
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-library Library 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.

3 participants