-
Notifications
You must be signed in to change notification settings - Fork 251
∸-suc
lemma for natural numbers
#2757
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
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.
Thanks for this.
Please remove the duplicate lemma, and fix the other one.
CHANGELOG.md
Outdated
@@ -251,6 +251,12 @@ Additions to existing modules | |||
∙-cong-∣ : x ∣ y → a ∣ b → x ∙ a ∣ y ∙ b | |||
``` | |||
|
|||
* In `Data.Nat.Properties`: | |||
```agda | |||
∸-suc : n ≤ m → suc m ∸ n ≡ suc (m ∸ n) |
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 might better be called suc-∸
(we tend to favour L-R reading order for lemmas about composition of functions).
Also, following the style-guide
precepts about alphabetical mention of specimen names, esp. those bound in variable
declarations, the (name and) type of this lemma should probably be
∸-suc : n ≤ m → suc m ∸ n ≡ suc (m ∸ n) | |
suc-∸ : m ≤ n → suc n ∸ m ≡ suc (n ∸ m) |
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.
I chose ∸-suc
as a symmetric name to +-suc
and *-suc
which look quite similar. I have no problem with a renaming though.
Sorry for getting the variable names wrong, fixed now.
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.
Let's see what our colleagues say about names!
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.
Tricky: I prefer James' suggestion, but it's also true that this is consistent with pre-existing names! So I don't 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.
Yes,... maybe I was being too doctrinaire, moreover for a doctrine which is more often honoured in the breach... sigh.
∸-suc
and ≤-suc
lemmas for natural numbers∸-suc
lemma for natural numbers
I rebased onto master and now an internal CI error occurred (i.e., something in the pipeline, not the agda standard library failed). |
It seems that |
Ah! Yes! Good catch.but indeed the combination you describe us a common case, so I'm wondering if it is worth the Fairbairn threshold penalty to include your version as precisely thus instantiating the general case? Not sure, but suggest we perhaps in any case push to c2.4 to allow us all more time to discuss? |
Suggestion:
|
These lemmata wereThis lemma was useful in inductive proofs involving∸
andand it seems≤
these two lemmata arethis lemma is not yet part of the standard library.