-
Notifications
You must be signed in to change notification settings - Fork 239
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
Standardise implicit arguments of cancellation properties. #1436
Comments
Hey, thanks for the spot! Yup, so for starters the rational proofs should be using the As for the open import Data.Rational.Base
open import Algebra.Definitions
open import Relation.Binary.PropositionalEquality.Core
postulate
rc : RightCancellative _≡_ _+_
arc : AlmostRightCancellative _≡_ 0ℚ _+_
x y z : ℚ
x≢0 : x ≢ 0ℚ
eq : y + x ≡ z + x
-- Inference error
test : y ≡ z
test = rc y z eq
-- No inference error
test2 : y ≡ z
test2 = arc y z x≢0 eq Therefore I think the correct definitions are: 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 but we will need to wait until v2.0 to make such a breaking change. |
I have just noticed something similar. In ≤-stepsˡ : ∀ {m n} o → m ≤ n → m ≤ o + n
≤-stepsʳ : ∀ {m n} o → m ≤ n → m ≤ n + o
m≤m+n : ∀ m n → m ≤ m + n
m≤n+m : ∀ m n → m ≤ n + m In ≤-steps : ∀ {m n} p → m ≤ n → m ≤ + p + n
m≤m+n : ∀ {m} n → m ≤ m + + n
n≤m+n : ∀ m {n} → n ≤ + m + n In ≤-steps : ∀ {p q r} → NonNegative r → p ≤ q → p ≤ r + q
p≤p+q : ∀ {p q} → NonNegative q → p ≤ p + q
p≤q+p : ∀ {p} → NonNegative p → ∀ {q} → q ≤ p + q |
Okay so
|
We should check that the subsequent inconsistencies in |
So there's a problem with using the definitions in Also, by inconsistencies, do you mean like the ones pointed out above regarding implicit/explicit? For example, in |
Is there a common resolution available of this issue with (the implied need for non-zeroness distinct from Eg. see developing branch towards a possible PR... ... where I will shortly push some breaking (and speculative) changes. |
While I'm assigned this (and I don't mind), right now, I'm not quite sure what ought to be done. It feels like enough things have "moved underneath" that I'm not sure what is feasible / outstanding. Especially given some of @jamesmckinna 's work in #1562 , #1579 and #2117 . |
Fair enough! Plus I have mentally timed out on a lot of this issue since those PRs, and more importantly, the post-v2.0 cycle of development I'm currently working on... Ping me on Zulip if you want me to try to page this back in... |
[Summarising comments I made to @JacquesCarette on Zulip]
But that said, I think that the concrete arithmetic datatypes present a different challenge, namely that the corresponding
So: it seems as though two parallel strands of definitions are required, one with the quantified instance, one with the Worse (as regards duplication) it is going to be typically again the case that the The only conceivable (to me, at least ;-)) unification (in terms of a hypothetical But that still doesn't solve the problem of such derived statements nevertheless needing a consistent form... and we are/seem to be back to duplication of the statement (template) again... sigh. |
One possible alternative statement, but which then still requires some specialisation for the concrete case, would be to rephrase |
Unless, perhaps, we...
record NonZero (0# : A) : Set _ where
field
NonZero : Pred A _
nonZero-≢ : NonZero ⇒ (_≉ 0#)
nonZero-≢⁻¹ : (_≉ 0#) ⇒ NonZero
record DecNonZero (0# : A) : Set _ where
field
nonZero : NonZero 0#
nonZero? : Unary.Decidable NonZero
record AlmostCancellative (_∙_ : Op₂ A) : Set _ where
field
cancellative : AlmostCancellative _∙_
module NonZeroCancellative (NZ : NonZero 0#) where
record AlmostCancellativeNZ (_∙_ : Op₂ A) : Set _ where
field
cancellative : AlmostCancellativeNZ _∙_ -- '.{{NonZero x}} version'
almostCancellative : AlmostCancellative _∙_
almostCancellative = ... etc. ? (Modulo better choices of names... apologies for any unintended confusion potentially introduced by poor choice of names above... TL;DR: instead of |
Yes, I think at this point I don't see how to avoid duplication... It's all very unsatisfying and I feel that we're missing something. As a hunch, I would say we're running up into the lack of ability to be generic over modalities (e.g. irrelevance).... |
In
Algebra.Definitions
In
Data.Rational.Unnormalised.Properties
Perhaps we should make them uniform.
The text was updated successfully, but these errors were encountered: