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

refactor: clean up public API around Array.eraseIdx #3676

Merged
merged 3 commits into from
Mar 17, 2024

Conversation

timotree3
Copy link
Contributor

@timotree3 timotree3 commented Mar 14, 2024

  • Removes the public definitions Array.eraseIdxAux and Array.eraseIdxSzAux which were implementation details.
    • Motivation: Array.eraseIdxAux and Array.eraseIdxSzAux were clearly not intended to remain public, but simply making them private would make it inconvenient to unfold them when writing proofs in Std.
  • Adds documentation comments to the public Array.eraseIdx-related definitions which remain.
  • Removes Array.eraseIdx' which was just Array.feraseIdx wrapped in a subtype and adds Array.size_feraseIdx to prove the subtype property as a standalone theorem.

Co-Authored-By: Daniel Windham daniel@atlascomputing.org

Motivation: `Array.eraseIdxAux` and `Array.eraseIdxSzAux` were clearly not intended to remain public,
but simply making them private would make it inconvenient to unfold them when writing proofs in Std.
`Array.eraseIdx'` which was just `Array.feraseIdx` wrapped in a subtype.
`Array.size_feraseIdx` proves the property as a standalone theorem.
@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 14, 2024
@leanprover-community-mathlib4-bot
Copy link
Collaborator

Mathlib CI status (docs):

  • ❗ Std/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 612d97440b4c0b3da967eaf041687b0f2c468f3a --onto 317adf42e92a4dbe07295bc1f0429b61bb8079fe. (2024-03-14 05:02:05)

@timotree3
Copy link
Contributor Author

awaiting-review

@github-actions github-actions bot added the awaiting-review Waiting for someone to review the PR label Mar 14, 2024
@Seppel3210
Copy link

BTW porting over the lemma from my std4 PR leanprover-community/batteries#690 was pretty easy: https://github.com/Seppel3210/std4/commit/109c3ce97e182813a166c9b55418d9a599a01bb6
So this is definitely bug free 😄

I also think this makes the API nicer

@kim-em kim-em added this pull request to the merge queue Mar 17, 2024
Merged via the queue into leanprover:master with commit 8e96d7b Mar 17, 2024
12 checks passed
@timotree3 timotree3 deleted the cleanup-array branch March 17, 2024 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-review Waiting for someone to review the PR 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.

4 participants