-
Notifications
You must be signed in to change notification settings - Fork 68
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
[WIP] Commutative Monad #404
Conversation
Happy to help - I think the easiest way for me to do so would be if you give me access to your fork. |
Ah I thought people could just add onto this PR, I've added you now. |
Maybe if my git-fu was stronger? It clearly says above
I know that one other way to deal with this is for me to merge your branch into a branch on here, instead of on master. |
I've given it a try, and got stuck as well. I have a partial proof plan (i.e. I managed to get to where I could apply I could also push my (very partial) attempt, but I'm not sure it is worthwhile. |
Asking for help sounds good! |
There are 2 'clear' spots in my attempt where the hexagon laws can be applied. Unfortunately what comes out the other end does not feel "closer" to solving the problem, although it does uncover more opportunities for shuffling things around. I've asked on Zulip. |
Recording the help that I got:
|
So I'm going to start a new branch on here to test out these ideas, basically because 1/2 of it is independent of Strength and would be useful to have regardless. |
With the hint that a right strength is a left strength in I don't have time to implement the proof in Agda right now, but I'm happy to share my drawings if someone else wants to give it a go. I'm afraid this will require a non-trivial amount of fiddling with isos to get the hexagon law into the right shape(s) for in the diagrams though. (This seems to be a recurring pain when working with monoidal categories. That half-finished monoid solver we have somewhere in a PR would have come handy here. 😉) |
Yes, that is the missing part. Please do share your drawing! There are a few more shapes of hexagon in the library, but I'd be happy to add more. |
OK, here are the drawings: The lower diagram is the core proof: it starts from associativity of the left strength (the central "pentagon") and then "reverses" the order of the monoidal products in the five corners using braiding. Then the strengths forming the top and bottom of the center are pushed out via naturality diagrams and the fact that the left and right strengths commute with braiding (this follows directly from the definition of the right strength and the fact that the braiding is self-inverse - you may want to factor it into a lemma or two). To finish the proof, one has to show that the left and right edge of the lower diagram are (the inverse of) the associator. That's what the upper diagram proves via repeated use of the hexagon law. This is the bit that I expected to be most cumbersome to translate to Agda. It should certainly be made a lemma because it's used on both sides of the lower diagram. I hope I didn't miss anything. |
It seems there hasn't been any progress on this, so I'll giving it a go now. |
Thanks. Do let us know of partial progress, as I have time this weekend to push on this. |
OK, I managed to prove I refactored the module a bit to make the new proofs more readable but left most of the existing proofs as they were (modulo white space cleanup, etc.) I also left FIXME comments suggesting some further ways to clean things up. There is still an open goal: I think that would be more fun and also more insightful. The only issue is that we'd need to mechanize |
Interesting observation: the proof that a left strength |
@JacquesCarette, I have mechanized the definition of |
Wow, thanks! Adding those definitions to this PR is fine, they are sufficiently related. |
OK, all goals solved and The PR definitely still needs some cleanup (see FIXMEs) but it's getting late here, so I'll stop for today. I put the definition of reverse categories in a separate commit, so it could easily be cherry-picked or rebased into a separate branch, if you decide the PR is getting too big. |
@Reijix, would you like me to wrap this up, or do you prefer to put on the finishing touches yourself? @JacquesCarette, I think the PR is ready for review. Would you mind having a look to see if there's anything that needs fixing (beyond the small FIXMEs)? |
It's on my pile. The week started out fine, and then kind of exploded on me. |
Sure, no rush. Bon courage! |
@sstucki, you can finish it, I'm happy with the state this PR is in now. |
OK, I've cleaned up the remaining FIXMEs and I think the code is good to go. But the PR now has quite a few commits, and I forgot what the policy is re. squashing/cleaning up the commit history. Do we usually merge PRs as they are or rebase the history into a few self-contained commits? @JacquesCarette, any preferences? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beautiful!
Adding commutative monads (see #402 also).
First I've added the notion of
RightStrength
toCategories.Monad.Strong
, thenCommutativeMonad
is defined as in nlab, i.e. a (left) strong monad on a symmetric monoidal category, where the left strength and the induced right strength commute.I'm currently stuck on the proof that the induced strength is actually strong (
Categories.Monad.Strong.Properties
), any help would be much appreciated.