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

Adding new reasoning combinators #2288

Open
JacquesCarette opened this issue Feb 10, 2024 · 4 comments
Open

Adding new reasoning combinators #2288

JacquesCarette opened this issue Feb 10, 2024 · 4 comments

Comments

@JacquesCarette
Copy link
Contributor

JacquesCarette commented Feb 10, 2024

Fascinating how these next proofs are essentially the cancel and elim (left and right) combinators in Categories.Morphism.Reasoning !

Originally posted by @JacquesCarette in #2251 (comment)

The point would be that for binary operations for which we have congruence (i.e. everything above Magma), there are additional combinators that we can create. Even more above Semigroup, where we also get associativity, and also Monoid (unital).

So we should get more and more reasoning power as we move up.

EDIT:
Categories.Morphism.Reasoning

@jamesmckinna
Copy link
Contributor

Naming:

  • Is cancel actually an instance of a Cancellative property?
  • Is there a more memorable/less generic name than elim for the other one?

@JacquesCarette
Copy link
Contributor Author

  • No, as Cancellative have a different shape and cancel-left: x * y = e -> x * (y * z) = z for e a unit. It is a chain of assoc, apply on left, left-unit. (There's cancel-right too).
  • elim-id would be slightly better. The comments above the definition of those combinators is
-- Introduce/Elimilate an equivalent-to-identity
-- on left, right or 'in the middle' of something existing

@jamesmckinna
Copy link
Contributor

Looks worth pursuing! ... perhaps provided there are concrete instances in the library that could usefully be refactored to exploit these new combinators? (Hint: any PR introducing them should at least attempt to do an amount of such refactoring as well?)

@jamesmckinna
Copy link
Contributor

Further thoughts: already in Algebra.Consequences.* and Algebra.Properties.* there are examples of this kind of 'layered' reasoning, but what the combinators defined there don't seem to do is to build in associativity etc. in order to build larger hypothetical proof steps, relying instead on vanilla appeals to cong, trans etc. via Relation.Binary.Reasoning.Setoid... so as elsewhere, suggest revisiting Larry Paulson's original LCF work on 'conversions' and 'conversionals', as well as the general principle that sometimes, in any category/reflexive-transitive composition structure, there's a balance to strike between constructing arrows/proofs out of whole cloth, by composition, and letting Yoneda do some (more) of the work for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants