Adding new reasoning combinators
JacquesCarette opened this issue · comments
Fascinating how these next proofs are essentially the
cancel
andelim
(left and right) combinators inCategories.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.
Naming:
- Is
cancel
actually an instance of aCancellative
property? - Is there a more memorable/less generic name than
elim
for the other one?
- No, as
Cancellative
have a different shape andcancel-left
:x * y = e -> x * (y * z) = z
fore
a unit. It is a chain of assoc, apply on left, left-unit. (There'scancel-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