Skip to content

feat: injectivity lemmas for List.getElem, List.getElem?, List.getElem! and List.getD#12435

Draft
datokrat wants to merge 1 commit intomasterfrom
paul/humanevup5
Draft

feat: injectivity lemmas for List.getElem, List.getElem?, List.getElem! and List.getD#12435
datokrat wants to merge 1 commit intomasterfrom
paul/humanevup5

Conversation

@datokrat
Copy link
Contributor

This PR provides injectivity lemmas for List.getElem, List.getElem?, List.getElem! and List.getD.

@datokrat datokrat added the changelog-library Library label Feb 11, 2026
@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 Feb 11, 2026
@leanprover-bot
Copy link
Collaborator

Reference manual CI status:

  • ❗ Reference manual CI can not be attempted yet, as the nightly-testing-2026-02-10 tag does not exist there yet. We will retry when you push more commits. If you rebase your branch onto nightly-with-manual, reference manual CI should run now. You can force reference manual CI using the force-manual-ci label. (2026-02-11 14:09:50)

mathlib-nightly-testing bot pushed a commit to leanprover-community/batteries that referenced this pull request Feb 11, 2026
@github-actions github-actions bot added the mathlib4-nightly-available A branch for this PR exists at leanprover-community/mathlib4-nightly-testing:lean-pr-testing-NNNN label Feb 11, 2026
mathlib-nightly-testing bot pushed a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Feb 11, 2026
@mathlib-lean-pr-testing mathlib-lean-pr-testing bot added the builds-mathlib CI has verified that Mathlib builds against this PR label Feb 11, 2026
@mathlib-lean-pr-testing
Copy link

Mathlib CI status (docs):

rw [mem_iff_getElem?]
exact ⟨_, h₂⟩; exact ⟨_ , h₂.symm⟩

theorem getElem?_inj_iff {l : List α} (h₀ : i < l.length) (h₁ : List.Nodup l) :
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the naming convention, inj already means iff. I'm not sure whether we have a convention for non-iff injectivity lemmas, my guess is just that we usually don't even state them and immediately go for an Iff which is easy to rewrite with.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, that sounds good. I believe to remember having seen precedent for inj_iff, but perhaps that was just a library defect!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

builds-mathlib CI has verified that Mathlib builds against this PR changelog-library Library mathlib4-nightly-available A branch for this PR exists at leanprover-community/mathlib4-nightly-testing:lean-pr-testing-NNNN 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