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

[Merged by Bors] - feat(measure_theory/pmf): lawful monad instance for probability mass function monad #15066

Closed
wants to merge 10 commits into from

Conversation

dtumad
Copy link
Collaborator

@dtumad dtumad commented Jun 30, 2022

Provide is_lawful_functor and is_lawful_monad instances for pmf. Also switch the seq and map operations to the ones coming from the monad instance.


This required changing some universe levels to match the way they are in the monad api. I don't think the more general case is generally useful, so I don't think this should be a problem.

Open in Gitpod

@dtumad dtumad added the awaiting-review The author would like community review of the PR label Jun 30, 2022
noncomputable theory
variables {α β γ : Type*}
variables {α : Type*} {β : Type*} {γ : Type*}
Copy link
Member

Choose a reason for hiding this comment

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

Note that this means exactly the same thing as what was written before, so there's no need to change it

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Just changed this to match the other pmf files, probably doesn't matter much I guess. Changed it to switch them all to the simple version

@eric-wieser eric-wieser added easy < 20s of review time. See the lifecycle page for guidelines. awaiting-author A reviewer has asked the author a question or requested changes and removed awaiting-review The author would like community review of the PR labels Jul 6, 2022
@dtumad dtumad added awaiting-review The author would like community review of the PR and removed awaiting-author A reviewer has asked the author a question or requested changes labels Jul 7, 2022
@dtumad
Copy link
Collaborator Author

dtumad commented Jul 12, 2022

@eric-wieser Is this good to be merged?

Copy link
Member

@eric-wieser eric-wieser left a comment

Choose a reason for hiding this comment

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

bors d+

@bors
Copy link

bors bot commented Jul 12, 2022

✌️ dtumad can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@eric-wieser eric-wieser added the awaiting-CI The author would like to see what CI has to say before doing more work. label Jul 12, 2022
@leanprover-community-bot-assistant leanprover-community-bot-assistant added delegated The PR author may merge after reviewing final suggestions. and removed awaiting-review The author would like community review of the PR labels Jul 12, 2022
@github-actions github-actions bot removed the awaiting-CI The author would like to see what CI has to say before doing more work. label Jul 12, 2022
@alreadydone
Copy link
Collaborator

alreadydone commented Jul 13, 2022

If you want to rerun CI, just click on "Details" to the right of the failed job, and there will be a "Re-run jobs" button (as in this page for the commit 9cd2290), and you may opt to re-run only failed jobs.

@eric-wieser
Copy link
Member

You can also use git commit --allow-empty to push a new commit without actually changing the code

bors merge

@github-actions github-actions bot added the ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) label Jul 13, 2022
bors bot pushed a commit that referenced this pull request Jul 13, 2022
…function monad (#15066)

Provide `is_lawful_functor` and `is_lawful_monad` instances for `pmf`. Also switch the `seq` and `map` operations to the ones coming from the `monad` instance.



Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
@bors
Copy link

bors bot commented Jul 13, 2022

Build failed (retrying...):

bors bot pushed a commit that referenced this pull request Jul 13, 2022
…function monad (#15066)

Provide `is_lawful_functor` and `is_lawful_monad` instances for `pmf`. Also switch the `seq` and `map` operations to the ones coming from the `monad` instance.



Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
@bors
Copy link

bors bot commented Jul 13, 2022

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(measure_theory/pmf): lawful monad instance for probability mass function monad [Merged by Bors] - feat(measure_theory/pmf): lawful monad instance for probability mass function monad Jul 13, 2022
@bors bors bot closed this Jul 13, 2022
@bors bors bot deleted the lawful_pmf_monad branch July 13, 2022 13:55
@dtumad
Copy link
Collaborator Author

dtumad commented Jul 13, 2022

@eric-wieser @alreadydone Thanks that's very helpful to know for the future

joelriou pushed a commit that referenced this pull request Jul 23, 2022
…function monad (#15066)

Provide `is_lawful_functor` and `is_lawful_monad` instances for `pmf`. Also switch the `seq` and `map` operations to the ones coming from the `monad` instance.



Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
delegated The PR author may merge after reviewing final suggestions. easy < 20s of review time. See the lifecycle page for guidelines. ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants