Open
Description
In Algebra.Definitions
LeftCancellative _•_ = ∀ x {y z} → (x • y) ≈ (x • z) → y ≈ z
RightCancellative _•_ = ∀ {x} y z → (y • x) ≈ (z • x) → y ≈ z
AlmostLeftCancellative e _•_ = ∀ {x} y z → ¬ x ≈ e → (x • y) ≈ (x • z) → y ≈ z
AlmostRightCancellative e _•_ = ∀ {x} y z → ¬ x ≈ e → (y • x) ≈ (z • x) → y ≈ z
In Data.Rational.Unnormalised.Properties
+-cancelˡ : ∀ {r p q} → r + p ≃ r + q → p ≃ q
+-cancelʳ : ∀ {r p q} → p + r ≃ q + r → p ≃ q
Perhaps we should make them uniform.
Activity
MatthewDaggitt commentedon Feb 24, 2021
Hey, thanks for the spot! Yup, so for starters the rational proofs should be using the
LeftCancellative
andRightCancellative
types.As for the
AlmostX
andX
definitions, the reason for the differences in the implicits is Agda's ability to infer them.LeftCancellative
andRightCancellative
were introduced early on in the library's life and the implicit arguments are slightly broken, see the code below. To fix this I think none of the arguments to those definitions should be implicit. TheAlmost
versions were introduced very recently and I think have the right implicits (x
is inferrable from the equality).Therefore I think the correct definitions are:
but we will need to wait until v2.0 to make such a breaking change.
FR-vdash-bot commentedon Feb 24, 2021
I have just noticed something similar.
In
Data.Nat.Properties
In
Data.Integer.Properties
In
Data.Rational.Unnormalised.Properties
MatthewDaggitt commentedon Sep 12, 2022
Okay so
Algebra.Definitions
Data.Rational.Properties
(and elsewhere) to be use those definitionsMatthewDaggitt commentedon Sep 12, 2022
We should check that the subsequent inconsistencies in
Data.Nat/Integer/Rational.Properties
been resolved by theNonZero
rewrite everywhere, as their types have changed.change definition of the Cancellative family to have all its argument…
JacquesCarette commentedon Sep 16, 2022
So there's a problem with using the definitions in
Data.Rational.Properties
: the notion ofNonZero
that it uses is different than the notion thatAlmostLeftCancellative
uses. So I'm not sure we can make that change. To make things consistent, what we'd need to do is to parametrizeAlmostLeftCancellative
by a "non zero" predicate.Also, by inconsistencies, do you mean like the ones pointed out above regarding implicit/explicit? For example, in
≤-stepsˡ
it does make sense to make them implicit, as they'll always be inferable. So I'm not quite sure what to do for part 2 of this.jamesmckinna commentedon Sep 25, 2023
Is there a common resolution available of this issue with (the implied need for non-zeroness distinct from
NonZero
brought up by) #1562? And #1175?Eg. see developing branch towards a possible PR...
... where I will shortly push some breaking (and speculative) changes.
Data.(Nat/Integer).Properties
#1579Almost*
properties inAlgebra.Definitions
#211727 remaining items