-
Notifications
You must be signed in to change notification settings - Fork 245
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
[ refactor ] Revise definitions, consequences, and use, of Algebra.Definitions.(Almost)*Cancellative
#2573
base: master
Are you sure you want to change the base?
Conversation
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.
Seems all quite reasonable.
I think I can't face doing more with this PR at this stage: the new definitions are in-place, with one specimen instantiation for
without a lot more refactoring, which I suggest take place downstream? |
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.
Seems like a nice PR as-is, more can be done subsequently.
Thanks @JacquesCarette I suppose my concern was that if it turned out those downstream PRs were still stymied by 'bad' design decisions here, then ... I'm not sure what. Certainly it seemed a big job to try to refactor existing proofs to try to conform to the new APIs... |
To allay your fears, might be worth taking |
So to allay the fears about whether it's too much work to make the change, I may as well (accept having to) do the additional work to make the change? Sigh... |
Well, it might turn out to be easy! Or you might be right, and be able to estimate just how much work it is, and let us know. |
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.
There are lots of good changes in here, but it's difficult to parse all the different definitions of cancellative being added. I'll have another look if you can lay them out on separate lines?
@@ -3,7 +3,7 @@ | |||
module README where | |||
|
|||
------------------------------------------------------------------------ | |||
-- The Agda standard library, version 2.3-dev | |||
-- The Agda standard library, version 3.0-dev |
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.
This change probably shouldn't be made in this PR?
* In `Data.Nat.Properties`: | ||
```agda | ||
*-almostCancelʳ-≡ : AlmostRightCancellative 0 _*_ | ||
``` |
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.
Seem to be missing a lot of stuff in the CHANGELOG?
|
||
Cancellative : Op₂ A → Set _ | ||
Cancellative _•_ = (LeftCancellative _•_) × (RightCancellative _•_) | ||
|
||
_-AlmostLeftCancellative_ Provided_-LeftCancellative_ | ||
Except_-LeftCancellative_ : ∀ {p} (P : Pred A p) → Op₂ A → Set _ |
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.
These lines are pretty unreadable to me. Can we separate them out into separate definitions even if they do have the same type?
Also why do these names have -
in them?
@@ -44,6 +43,7 @@ import Relation.Binary.Properties.Poset as PosetProperties | |||
import Relation.Binary.Reasoning.Setoid as ≈-Reasoning | |||
open import Relation.Binary.Reasoning.Syntax | |||
|
|||
open import Algebra.Consequences.Propositional {A = ℚᵘ} |
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.
This seems like an unneeded import?
@@ -64,6 +63,7 @@ open import Relation.Nullary.Decidable.Core as Dec | |||
using (yes; no; recompute; map′; _×-dec_) | |||
open import Relation.Nullary.Negation.Core using (¬_; contradiction) | |||
|
|||
open import Algebra.Consequences.Propositional {A = ℚ} |
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.
Why do we now need to import it with the type specifically applied? Is this a breaking change?
Fixes #1436 , ...
... at least as far as 'AlmostCancellative' properties of operations wrt equality relation; the various order-theoretic generalisations are not covered
... so the issue probably ought to be kept open even if this gets merged? cf. #2580
NB.:
breaking
?naming
issues... etc.)Algebra.Consequences.Base
refactoring [ refactor ] Add equality as a parameter toAlgebra.Consequences.Base
#2572 should probably be merged first; fold in theinstance
-based analysis forDecidable
(and henceRecomputable
) predicates intoExcept_-*Cancellative_
?Algebra.Definitions
only imported at the equality relation, but might better be left parameterised, so that the variousCancellative
properties can be made generic...Integer
andRational
, theCancellative
properties wrt multiplication don't easily cash out via the 'generic' design strategy of going viaAlmostCancellative
, so I haven't (yet) include such statements, nor refactored to make these the primary notions.