Skip to content

feat: lemmas about pure for {List,Array,Vector}.{mapM,foldlM,foldrM,anyM,allM,findM?,findSomeM?}#7356

Merged
kim-em merged 5 commits intoleanprover:masterfrom
eric-wieser:fold_pure
Mar 10, 2025
Merged

feat: lemmas about pure for {List,Array,Vector}.{mapM,foldlM,foldrM,anyM,allM,findM?,findSomeM?}#7356
kim-em merged 5 commits intoleanprover:masterfrom
eric-wieser:fold_pure

Conversation

@eric-wieser
Copy link
Copy Markdown
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
Copy Markdown
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
@ghost
Copy link
Copy Markdown

ghost 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
/-! ### mapM -/

@[simp]
theorem mapM_pure [Monad m] [LawfulMonad m] {xs : Vector α n} (f : α → β) :
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

2 participants