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: proofs for Batteries.Data.Array/Vector.Monadic #1109

Open
wants to merge 10 commits into
base: bump/v4.17.0
Choose a base branch
from

Conversation

Rob23oba
Copy link

Adds proofs for the proof_wanteds in Batteries.Data.Array.Monadic.

@kim-em
Copy link
Collaborator

kim-em commented Jan 31, 2025

@Rob23oba, thank you, these are very nice!

@kim-em
Copy link
Collaborator

kim-em commented Jan 31, 2025

I'll wait until Monday to merge this, so your commit ends up directly on main, rather than bundled into the v4.17.0 update. I presume/hope that you're happy if I move this material up to Lean itself quite soon?

@Rob23oba
Copy link
Author

Sure, very cool!

Copy link
Collaborator

@fgdorais fgdorais left a comment

Choose a reason for hiding this comment

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

Excellent work! There's a lot of nonterminal simps. Could you go through and squeeze them using simp??

@Rob23oba
Copy link
Author

Rob23oba commented Feb 1, 2025

There you go, replaced all of my simps I could find.

@Rob23oba
Copy link
Author

Rob23oba commented Feb 1, 2025

I've added LawfulFunctor.map_inj_right_of_nonempty and LawfulMonad.map_inj_right because they are very useful in proving the other statements. However, they are definitely in the wrong place and from what I've seen it is also very uncommon to put lemmas about a class into the namespace of the class. So, anyone know where a better place to put these would be?

@Rob23oba Rob23oba changed the title feat: proofs for Batteries.Data.Array.Monadic feat: proofs for Batteries.Data.Array/Vector.Monadic Feb 1, 2025
@Rob23oba Rob23oba requested review from fgdorais and kim-em February 1, 2025 09:20
@Rob23oba
Copy link
Author

Rob23oba commented Feb 1, 2025

Oh, I didn't realize you already made LawfulFunctor.map_inj_right_of_nonempty as map_inj_of_inj in core lean! The one there doesn't need Applicative though, Functor is enough. But we also definitely need the one with LawfulMonad because that's the more common case and that one doesn't require Nonempty. We might want to change the naming a bit then (e.g. map_inj_of_inj for the monadic one, map_inj_of_inj_of_nonempty for the functor one) to make sure we have both.

@fgdorais fgdorais added the awaiting-review This PR is ready for review; the author thinks it is ready to be merged. label Feb 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-review This PR is ready for review; the author thinks it is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants