-
Notifications
You must be signed in to change notification settings - Fork 246
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
Monus _∸_
is right adjoint to addition _+_
across usual _≤_
preorder
#1949
Conversation
Sure but we probably couldn't use the name |
Regarding renamings (even though I couldn't in all conscience propose such things this time around): I almost feel that the builtin |
I'm not sure I see the point of a guarded version of this function. What does it give us over the current definition when a proof of |
@Taneb well, as I indicated, I wouldn't advocate for it in this PR. In a subsequent one, I might say that insisting on having the guard explicitly in scope (but perhaps making the definition take an instance argument, so that 'floating around' would indeed suffice?) has at least one contra and one pro:
This is not trying to be facetious: it irks/irked me that the right->left direction of the adjunction requires the additional condition (the left->right does not), but that draws attention to the statement not really making sense (and even: leading to a contradiction) otherwise. So a question perhaps of consistent, if excessive, 'hygiene'? |
It (c/sh)ould be easily obtained by composing |
@gallais hmmm... that seems a fairly monstrous detour? In any case, I'm also on a mission (#1919/#1948) to redefine What I have been thinking about since @Taneb's comment, and while preparing this addition, is to make |
Surprised that these properties are not already there; they may induce downstream a number of simplification to proofs of properties of monus. But not for this PR!
Separately, in view of the right->left direction of the adjunction: monus is defined as a total function
_-_
inAgda.Builtin.Nat
, and reimported as_∸_
... why don't we define an alternative functionn ∸ m
only on those arguments satisfyingm ≤ n
(by an easy recursion on the inductive definition of that relation; alternatively with an irrelevant instance argument of that type, and then simply definitionally equal toAgda.Builtin.Nat._-_
) and then prove the two definitions extensionally equal? The fact that_-_
has certain properties provable outright, without further ordering assumptions here or there, seems moot: the only ones which matter are those restricted to the partial domain... but our library setup doesn't typically take account for that. A case of strict(er) specification, but (more) permissive implementation?