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

feat: List.unattach and simp lemmas #5550

Merged
merged 4 commits into from
Oct 2, 2024
Merged

feat: List.unattach and simp lemmas #5550

merged 4 commits into from
Oct 2, 2024

Conversation

kim-em
Copy link
Collaborator

@kim-em kim-em commented Oct 1, 2024

No description provided.

@kim-em kim-em requested a review from nomeata October 1, 2024 05:52
@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 Oct 1, 2024
@leanprover-community-bot
Copy link
Collaborator

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 4771741fa288466a2de48569483205ad0690c8ef --onto 5e8718dff9d7906e1d4ca7020256dae7c05e49c2. (2024-10-01 06:10:26)

@kim-em kim-em enabled auto-merge October 2, 2024 00:45
@github-actions github-actions bot temporarily deployed to lean-lang.org/lean4/doc October 2, 2024 02:41 Inactive
@kim-em kim-em added this pull request to the merge queue Oct 2, 2024
Merged via the queue into master with commit 9322d8d Oct 2, 2024
14 checks passed

If not, usually the right approach is `simp [List.unattach, -List.map_subtype]` to unfold.
-/
def unattach {α : Type _} {p : α → Prop} (l : List { x // p x }) := l.map (·.val)
Copy link
Collaborator

@digama0 digama0 Oct 2, 2024

Choose a reason for hiding this comment

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

Like attach, this needs an implemented_by version which uses an unsafeCast so that it is O(1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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