-
Notifications
You must be signed in to change notification settings - Fork 449
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
chore: simplify signature of Array.mapIdx #5749
Merged
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
github-actions
bot
added
the
toolchain-available
A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN
label
Oct 17, 2024
Mathlib CI status (docs):
|
Hmm, I expect that soon someone will want that version with Fin, it seems strictly more useful. Maybe change the list version instead? Or maybe all uses that would want it should use a (future) array type rather than vectors? |
leanprover-community-mathlib4-bot
added a commit
to leanprover-community/batteries
that referenced
this pull request
Oct 18, 2024
leanprover-community-mathlib4-bot
added a commit
to leanprover-community/mathlib4
that referenced
this pull request
Oct 18, 2024
leanprover-community-bot
added
the
breaks-mathlib
This is not necessarily a blocker for merging: but there needs to be a plan
label
Oct 18, 2024
kim-em
added a commit
to leanprover-community/batteries
that referenced
this pull request
Oct 18, 2024
kim-em
added a commit
to leanprover-community/mathlib4
that referenced
this pull request
Oct 18, 2024
kim-em
added
awaiting-mathlib
We should not merge this until we have a successful Mathlib build
and removed
breaks-mathlib
This is not necessarily a blocker for merging: but there needs to be a plan
toolchain-available
A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN
labels
Oct 21, 2024
github-actions
bot
added
the
toolchain-available
A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN
label
Oct 21, 2024
leanprover-community-mathlib4-bot
added a commit
to leanprover-community/batteries
that referenced
this pull request
Oct 21, 2024
leanprover-community-mathlib4-bot
added a commit
to leanprover-community/mathlib4
that referenced
this pull request
Oct 21, 2024
leanprover-community-bot
added
the
breaks-mathlib
This is not necessarily a blocker for merging: but there needs to be a plan
label
Oct 21, 2024
kim-em
added a commit
to leanprover-community/batteries
that referenced
this pull request
Oct 21, 2024
kim-em
added a commit
to leanprover-community/ProofWidgets4
that referenced
this pull request
Oct 21, 2024
kim-em
added a commit
to leanprover-community/mathlib4
that referenced
this pull request
Oct 21, 2024
kim-em
added a commit
to leanprover-community/mathlib4
that referenced
this pull request
Oct 21, 2024
kim-em
added
the
release-ci
Enable all CI checks for a PR, like is done for releases
label
Oct 21, 2024
leanprover-community-mathlib4-bot
added a commit
to leanprover-community/batteries
that referenced
this pull request
Oct 21, 2024
leanprover-community-mathlib4-bot
added a commit
to leanprover-community/mathlib4
that referenced
this pull request
Oct 21, 2024
kim-em
added a commit
to leanprover-community/mathlib4
that referenced
this pull request
Oct 21, 2024
tobiasgrosser
pushed a commit
to opencompl/lean4
that referenced
this pull request
Oct 27, 2024
This PR simplifies the signature of `Array.mapIdx`, to take a function `f : Nat \to \a \to \b` rather than a function `f : Fin as.size \to \a \to \b`. Lean doesn't actually use the extra generality anywhere (so in fact this change *simplifies* all the call sites of `Array.mapIdx`, since we no longer need to throw away the proof). This change would make the function signature equivalent to `List.mapIdx`, hence making it easier to write verification lemmas. We keep the original behaviour as `Array.mapFinIdx`.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
awaiting-mathlib
We should not merge this until we have a successful Mathlib build
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.
This PR simplifies the signature of
Array.mapIdx
, to take a functionf : Nat \to \a \to \b
rather than a functionf : Fin as.size \to \a \to \b
.Lean doesn't actually use the extra generality anywhere (so in fact this change simplifies all the call sites of
Array.mapIdx
, since we no longer need to throw away the proof).This change would make the function signature equivalent to
List.mapIdx
, hence making it easier to write verification lemmas.We keep the original behaviour as
Array.mapFinIdx
.