-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into refactor-up-limits
- Loading branch information
Showing
21 changed files
with
1,263 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
src/elementary-number-theory/cubes-natural-numbers.lagda.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Cubes of natural numbers | ||
|
||
```agda | ||
module elementary-number-theory.cubes-natural-numbers where | ||
``` | ||
|
||
<details><summary>Imports</summary> | ||
|
||
```agda | ||
open import elementary-number-theory.multiplication-natural-numbers | ||
open import elementary-number-theory.natural-numbers | ||
open import elementary-number-theory.squares-natural-numbers | ||
|
||
open import foundation.dependent-pair-types | ||
open import foundation.fibers-of-maps | ||
open import foundation.universe-levels | ||
``` | ||
|
||
</details> | ||
|
||
## Idea | ||
|
||
The {{#concept "cube" Disambiguation="natural number"}} `n³` of a | ||
[natural number](elementary-number-theory.natural-numbers.md) `n` is the triple | ||
[product](elementary-number-theory.multiplication-natural-numbers.md) | ||
|
||
```text | ||
n³ := n * n * n | ||
``` | ||
|
||
of `n` with itself. | ||
|
||
## Definitions | ||
|
||
### Cubes of natural numbers | ||
|
||
```agda | ||
cube-ℕ : ℕ → ℕ | ||
cube-ℕ n = square-ℕ n *ℕ n | ||
``` | ||
|
||
### The predicate of being a cube of natural numbers | ||
|
||
```agda | ||
is-cube-ℕ : ℕ → UU lzero | ||
is-cube-ℕ = fiber cube-ℕ | ||
``` | ||
|
||
### The cubic root of cubic natural numbers | ||
|
||
```agda | ||
cubic-root-ℕ : (n : ℕ) → is-cube-ℕ n → ℕ | ||
cubic-root-ℕ n = pr1 | ||
``` | ||
|
||
## See also | ||
|
||
- [Squares of natural numbers](elementary-number-theory.squares-natural-numbers.md) |
73 changes: 73 additions & 0 deletions
73
src/elementary-number-theory/hardy-ramanujan-number.lagda.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# The Hardy-Ramanujan number | ||
|
||
```agda | ||
module elementary-number-theory.hardy-ramanujan-number where | ||
``` | ||
|
||
<details><summary>Imports</summary> | ||
|
||
```agda | ||
open import elementary-number-theory.inequality-natural-numbers | ||
open import elementary-number-theory.natural-numbers | ||
open import elementary-number-theory.taxicab-numbers | ||
|
||
open import foundation.dependent-pair-types | ||
open import foundation.identity-types | ||
open import foundation.unit-type | ||
``` | ||
|
||
</details> | ||
|
||
## Idea | ||
|
||
The | ||
{{#concept "Hardy-Ramanujan number" Agda=Hardy-Ramanujan-ℕ WD="1729" WDID=Q825176}} | ||
is the number `1729`. This number is the second | ||
[taxicab number](elementary-number-theory.taxicab-numbers.md), i.e., it is the | ||
least natural number that can be written as a sum of cubes of positive natural | ||
numbers in exactly two distinct ways. Specifically, we have the identifications | ||
|
||
```text | ||
1³ + 12³ = 1729 and 9³ + 10³ = 1729. | ||
``` | ||
|
||
## Definition | ||
|
||
### The Hardy-Ramanujan number | ||
|
||
```agda | ||
Hardy-Ramanujan-ℕ : ℕ | ||
Hardy-Ramanujan-ℕ = 1729 | ||
``` | ||
|
||
## Properties | ||
|
||
### Two decompositions of the Hardy-Ramanujan number into sums of cubes of two positive natural numbers | ||
|
||
```agda | ||
first-sum-of-cubes-decomposition-Hardy-Ramanujan-ℕ : | ||
sum-of-cubes-decomposition-ℕ Hardy-Ramanujan-ℕ | ||
pr1 first-sum-of-cubes-decomposition-Hardy-Ramanujan-ℕ = | ||
(1 , is-nonzero-one-ℕ) | ||
pr1 (pr2 first-sum-of-cubes-decomposition-Hardy-Ramanujan-ℕ) = | ||
(12 , is-nonzero-succ-ℕ 11) | ||
pr1 (pr2 (pr2 first-sum-of-cubes-decomposition-Hardy-Ramanujan-ℕ)) = | ||
star | ||
pr2 (pr2 (pr2 first-sum-of-cubes-decomposition-Hardy-Ramanujan-ℕ)) = | ||
refl | ||
|
||
second-sum-of-cubes-decomposition-Hardy-Ramanujan-ℕ : | ||
sum-of-cubes-decomposition-ℕ Hardy-Ramanujan-ℕ | ||
pr1 second-sum-of-cubes-decomposition-Hardy-Ramanujan-ℕ = | ||
(9 , is-nonzero-succ-ℕ 8) | ||
pr1 (pr2 second-sum-of-cubes-decomposition-Hardy-Ramanujan-ℕ) = | ||
(10 , is-nonzero-succ-ℕ 9) | ||
pr1 (pr2 (pr2 second-sum-of-cubes-decomposition-Hardy-Ramanujan-ℕ)) = | ||
star | ||
pr2 (pr2 (pr2 second-sum-of-cubes-decomposition-Hardy-Ramanujan-ℕ)) = | ||
refl | ||
``` | ||
|
||
## External links | ||
|
||
- [1729 (number)](<https://en.wikipedia.org/wiki/1729_(number)>) at Wikipedia |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
# Taxicab numbers | ||
|
||
```agda | ||
module elementary-number-theory.taxicab-numbers where | ||
``` | ||
|
||
<details><summary>Imports</summary> | ||
|
||
```agda | ||
open import elementary-number-theory.addition-natural-numbers | ||
open import elementary-number-theory.cubes-natural-numbers | ||
open import elementary-number-theory.inequality-natural-numbers | ||
open import elementary-number-theory.natural-numbers | ||
open import elementary-number-theory.nonzero-natural-numbers | ||
|
||
open import foundation.cartesian-product-types | ||
open import foundation.dependent-pair-types | ||
open import foundation.equivalences | ||
open import foundation.identity-types | ||
open import foundation.universe-levels | ||
|
||
open import univalent-combinatorics.standard-finite-types | ||
``` | ||
|
||
</details> | ||
|
||
## Idea | ||
|
||
The `n`-th | ||
{{#concept "taxicab number" Agda=is-taxicab-number-ℕ WD="taxicab number" WDID=Q1462591}} | ||
`taxicab n` is the smallest | ||
[natural number](elementary-number-theory.natural-numbers.md) `x` such that `x` | ||
is a [sum](elementary-number-theory.addition-natural-numbers.md) of two | ||
[cubes](elementary-number-theory.cubes-natural-numbers.md) in `n` | ||
[distinct](foundation.negated-equality.md) ways. | ||
|
||
**Note:** The definition of taxicab numbers only considers sums of | ||
[positive integers](elementary-number-theory.nonzero-natural-numbers.md). Note | ||
that if `n` is a cube, i.e., if `n = c³`, then the only solutions to the | ||
equation | ||
|
||
```text | ||
a³ + b³ = c³ | ||
``` | ||
|
||
have either `a = 0` or `b = 0` by | ||
[Fermat's last theorem](https://en.wikipedia.org/wiki/Fermat%27s_Last_Theorem). | ||
Therefore `n` can be written in at least two different ways as a sum of cubes of | ||
positive natural numbers if and only if it can be written in at least two | ||
different ways as a sum of cubes of arbitary natural numbers. However, the class | ||
of natural numbers that can be written in exactly one way as a sum of cubes is | ||
different when we consider sums of cubes of positive natural numbers or sums of | ||
cubes of arbitrary natural numbers. | ||
|
||
## Definitions | ||
|
||
### The type of decompositions of a natural number as a sum of cubes | ||
|
||
```agda | ||
sum-of-cubes-decomposition-ℕ : ℕ → UU lzero | ||
sum-of-cubes-decomposition-ℕ x = | ||
Σ ( nonzero-ℕ) | ||
( λ y → | ||
Σ ( nonzero-ℕ) | ||
( λ z → | ||
( leq-ℕ (nat-nonzero-ℕ y) (nat-nonzero-ℕ z)) × | ||
( cube-ℕ (nat-nonzero-ℕ y) +ℕ cube-ℕ (nat-nonzero-ℕ z) = x))) | ||
``` | ||
|
||
### The predicate of being a sum of two cubes in exactly `n` distinct ways | ||
|
||
A number `x` is a sum of cubes in `n` distinct ways if there is an equivalence | ||
|
||
```text | ||
Fin n ≃ sum-of-cubes-decomposition-ℕ x | ||
``` | ||
|
||
from the | ||
[standard finite type](univalent-combinatorics.standard-finite-types.md) to the | ||
type `sum-of-cubes-decomposition-ℕ x` of ways of writing `x` as a sum of cubes. | ||
|
||
```agda | ||
is-sum-of-cubes-in-number-of-distinct-ways-ℕ : ℕ → ℕ → UU lzero | ||
is-sum-of-cubes-in-number-of-distinct-ways-ℕ n x = | ||
Fin n ≃ sum-of-cubes-decomposition-ℕ x | ||
``` | ||
|
||
### The predicate of being the `n`-th taxicab number | ||
|
||
```agda | ||
is-taxicab-number-ℕ : ℕ → ℕ → UU lzero | ||
is-taxicab-number-ℕ n x = | ||
is-sum-of-cubes-in-number-of-distinct-ways-ℕ n x × | ||
((y : ℕ) → is-sum-of-cubes-in-number-of-distinct-ways-ℕ n y → leq-ℕ x y) | ||
``` | ||
|
||
## See also | ||
|
||
- [The Hardy-Ramanujan number](elementary-number-theory.hardy-ramanujan-number.md) | ||
|
||
## External links | ||
|
||
- [Taxicab numbers](https://en.wikipedia.org/wiki/Taxicab_number) at Wikipedia | ||
- [Taxicab nubmers](https://oeis.org/A011541) at the OEIS. |
Oops, something went wrong.