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: lemmas about pure for {List,Array,Vector}.{mapM,foldlM,foldrM,anyM,allM,findM?,findSomeM?} #7356

Merged
merged 5 commits into from
Mar 10, 2025

Conversation

eric-wieser
Copy link
Contributor

This PR adds lemmas reducing monadic operations with pure to the non-monadic counterparts.

These are more general cases of the existing lemmas about `Id`.
@eric-wieser
Copy link
Contributor Author

changelog-library

@eric-wieser eric-wieser changed the title feat: lemmas about pure for mapM, foldlM, and foldrM feat: lemmas about pure for mapM, foldlM, and foldrM Mar 6, 2025
@eric-wieser eric-wieser marked this pull request as ready for review March 6, 2025 02:15
@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 6, 2025
@leanprover-community-bot
Copy link
Collaborator

leanprover-community-bot commented Mar 6, 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 9ae2ac39c9512461643e268f0feff5654044776f --onto 5536281238dff2fb4e0a54da472d4f0d6496069e. You can force Mathlib CI using the force-mathlib-ci label. (2025-03-06 02:33:36)
  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 9ae2ac39c9512461643e268f0feff5654044776f --onto ca0d8226192e7c0cdcc71d6322c3226ad4f73f30. You can force Mathlib CI using the force-mathlib-ci label. (2025-03-06 11:31:57)

@eric-wieser eric-wieser changed the title feat: lemmas about pure for mapM, foldlM, and foldrM feat: lemmas about pure for {List,Array,Vector}.{mapM,foldlM,foldrM,anyM,allM} Mar 6, 2025
@@ -29,6 +29,12 @@ open Nat

/-! ### mapM -/

@[simp]
theorem mapM_pure [Monad m] [LawfulMonad m] {xs : Vector α n} (f : α → β) :
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kim-em, do you want this in Monadic (which claims to only be about forIn), or in Lemmas which is where many other monadic lemmas are?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Leave it in Monadic for now. I'll need to rehome these lemmas sometime.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for taking on the rehoming!

@eric-wieser eric-wieser changed the title feat: lemmas about pure for {List,Array,Vector}.{mapM,foldlM,foldrM,anyM,allM} feat: lemmas about pure for {List,Array,Vector}.{mapM,foldlM,foldrM,anyM,allM,findM?,findSomeM?} Mar 6, 2025
@kim-em kim-em added this pull request to the merge queue Mar 10, 2025
Merged via the queue into leanprover:master with commit 9a435b4 Mar 10, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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