-
Notifications
You must be signed in to change notification settings - Fork 90
Refactor the natural numbers and integers up to present code standards #1568
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.
I'll admit it's not obvious to me that these files on the standard finite types belong in elementary-number-theory and not univalent-combinatorics.
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.
It's not obvious to me either
|
||
```agda | ||
module elementary-number-theory.commutative-semiring-of-natural-numbers where | ||
module elementary-number-theory.semiring-of-natural-numbers where |
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.
We don't specify commutativity for the ring of integers, so it seemed more consistent.
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.
Fair enough. Could you just also split up the definitions section to have ℕ-Semiring
in its own section?
Also, I broke several files down into more separate sections. |
src/elementary-number-theory/exponentiation-natural-numbers.lagda.md
Outdated
Show resolved
Hide resolved
I'm a bit worried that these changes will make it considerably harder to get #1211 merged down the road. But since that PR has been stale for a while and there are likely other merged changes that already make this difficult I'm not sure it should be a blocker. I would be incredibly grateful if someone were to comb through that PR and try and get the more finished parts of it merged though, such as the well-ordering principle of the natural numbers and divisibility among many others. |
I'd like to get some feedback from another maintainer before this PR is potentially merged. Preferrably @EgbertRijke, but otherwise @VojtechStep, since I expect the former will not respond. From what I've seen so far, this PR mostly abstracts definitions and fixes a few names. Are these changes necessary for your continued process @lowasser, or could we potentially icebox this PR until progress has been made to merge the other one? Otherwise, should we consider #1211 discontinued and not take it into consideration, @VojtechStep? Keep in mind I have not checked exactly how much overlap there are between these two PRs. |
I don't think #1211 is becoming mergeable any time soon (it never typechecked, it's been stale for 8 months, and in any case a +17k-3k PR would be very hard to review in one go), and I don't think we should freeze |
These are not necessary changes, just things that have irritated me. |
Co-authored-by: Fredrik Bakke <fredrbak@gmail.com>
triangle-inequality-dist-ℕ m n k | ||
``` | ||
|
||
### `dist-ℕ x y` is a solution in `z` to `x + z = y` |
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.
### `dist-ℕ x y` is a solution in `z` to `x + z = y` | |
### `dist-ℕ x y` is a solution in `z` to `x + z = y` when `x ≤ y` |
is-nonzero-right-factor-mul-ℕ x .zero-ℕ H refl = H (right-zero-law-mul-ℕ x) | ||
``` | ||
|
||
### If `(x+1)y = x+1`, then `y = 1` |
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'd just like to reiterate that, until #1235 is resolved, using code guards over latex rendered text in headers should not generally be considered an improvement.
The **[poset](order-theory.posets.md) of natural numbers ordered by | ||
divisibility** consists of the |
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.
The **[poset](order-theory.posets.md) of natural numbers ordered by | |
divisibility** consists of the | |
The {{#concept "poset of natural numbers ordered by divisibility" Agda=ℕ-Div-Poset}} consists of the |
{{#concept "relatively prime" WDID=Q104752 WD="coprime" Disambiguation="natural numbers" Agda=is-relatively-prime-ℕ}} | ||
if their |
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.
{{#concept "relatively prime" WDID=Q104752 WD="coprime" Disambiguation="natural numbers" Agda=is-relatively-prime-ℕ}} | |
if their | |
{{#concept "relatively prime" WDID=Q104752 WD="coprime" Disambiguation="natural numbers" Agda=is-relatively-prime-ℕ}}, | |
or **coprime**, if their |
{{#concept "relatively prime" Disambiguation="integers" Agda=is-relatively-prime-ℤ}} | ||
if their |
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.
{{#concept "relatively prime" Disambiguation="integers" Agda=is-relatively-prime-ℤ}} | |
if their | |
{{#concept "relatively prime" Disambiguation="integers" WDID=Q104752 WD="coprime" Agda=is-relatively-prime-ℤ}}, | |
or **coprime**, if their |
The strong induction principle allows one to assume in the inductive step that | ||
the inductive hypothesis is satisfied at all smaller values. | ||
The | ||
{{#concept "strong induction principle" WDID=Q54506667 WD="principle of complete induction" Agda=strong-ind-ℕ}} |
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.
Looking at the wikidata page, I wonder if this identifier also refers to well-founded induction á la https://unimath.github.io/agda-unimath/order-theory.well-founded-relations.html. Maybe we should point both to this identifier
open import elementary-number-theory.inequality-natural-numbers using | ||
( preserves-leq-left-mul-ℕ | ||
; reflects-order-mul-ℕ) | ||
; reflects-leq-mul-ℕ) |
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 renaming is fine by me as a temporary solution. See #1575 however.
leq-quotient-div-ℕ d (succ-ℕ x) (is-nonzero-succ-ℕ x) H | ||
``` | ||
|
||
### If `x` is nonzero, if `d | x` and `d ≠ x`, then `d < x` |
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.
### If `x` is nonzero, if `d | x` and `d ≠ x`, then `d < x` | |
### If `x` is nonzero, `d | x`, and `d ≠ x`, then `d < x` |
I guess I'm just struggling to accept that #1211 is again not going to get merged, and this PR puts a final nail in its coffin. I'll okay these changes for merging. |
Maybe I should've done the natural numbers and the integers separately? If so, I'll split it...
Changes include:
is-equiv-is-invertible