Skip to content
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

Refactor elementary number theory #1211

Draft
wants to merge 70 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
f988936
squares of natural numbers
EgbertRijke Oct 25, 2024
c66773a
add file
EgbertRijke Oct 25, 2024
269e3d0
make pre-commit
EgbertRijke Oct 25, 2024
48b74ec
properties of squares
EgbertRijke Oct 26, 2024
7952fc4
some work on integer fractions
EgbertRijke Oct 26, 2024
156dd99
squares of integers
EgbertRijke Oct 26, 2024
defae26
make pre-commit
EgbertRijke Oct 26, 2024
9b917e7
parity integers
EgbertRijke Oct 26, 2024
01b1c33
parity integers
EgbertRijke Oct 26, 2024
70edf99
work
EgbertRijke Oct 27, 2024
e55cb69
work
EgbertRijke Oct 28, 2024
a12e652
generalizations to commutative rings
EgbertRijke Oct 29, 2024
39b6264
work
EgbertRijke Oct 29, 2024
02a81cf
Merge branch 'master' of github.com:UniMath/agda-unimath into irratio…
EgbertRijke Oct 29, 2024
dec3433
implementing some algebra into the theory of integers
EgbertRijke Oct 30, 2024
22a5ace
edits
EgbertRijke Oct 30, 2024
aea9973
edits
EgbertRijke Oct 30, 2024
c0dfde5
work
EgbertRijke Oct 30, 2024
fbdb94c
moving decidability of divisibility into the file about divisibility
EgbertRijke Oct 31, 2024
9fa26d3
refactoring decidability of divisibility of integers
EgbertRijke Oct 31, 2024
3c12fb5
Merge branch 'master' of github.com:UniMath/agda-unimath into irratio…
EgbertRijke Oct 31, 2024
19a1948
some work
EgbertRijke Nov 5, 2024
3c8f4fd
Merge branch 'master' of github.com:UniMath/agda-unimath into irratio…
EgbertRijke Nov 5, 2024
de1f5b5
work
EgbertRijke Nov 5, 2024
15f9efa
Merge branch 'master' of github.com:UniMath/agda-unimath into irratio…
EgbertRijke Nov 11, 2024
627cbb3
Merge branch 'master' of github.com:UniMath/agda-unimath into irratio…
EgbertRijke Dec 4, 2024
032e45d
some improvements to number theory
EgbertRijke Dec 7, 2024
c8f84ad
refactoring the fundamental theorem of arithmetic
EgbertRijke Dec 16, 2024
5578aaa
further refactoring of fundamental theorem
EgbertRijke Dec 17, 2024
71f3b76
well-ordering principles for the integers
EgbertRijke Jan 2, 2025
6270496
Nicomachus's Theorem
EgbertRijke Jan 4, 2025
9d2836c
Merge branch 'master' of github.com:UniMath/agda-unimath into irratio…
EgbertRijke Jan 4, 2025
405c30a
square pyramidal numbers
EgbertRijke Jan 4, 2025
adec8f0
sum of pronic numbers
EgbertRijke Jan 4, 2025
4f10aa5
The sum of the first n odd numbers is the nth square
EgbertRijke Jan 4, 2025
a4e411c
merge
EgbertRijke Jan 4, 2025
5dd2b23
number of divisors
EgbertRijke Jan 4, 2025
f94ad9d
LeVeque's strict bound on the growth of the Fibonacci numbers
EgbertRijke Jan 5, 2025
c6b25ed
generalizing LeVeque's upper bound for the Fibonacci sequence
EgbertRijke Jan 5, 2025
8b61eeb
edits
EgbertRijke Jan 6, 2025
2c3a0c1
Merge branch 'master' of github.com:UniMath/agda-unimath into irratio…
EgbertRijke Jan 6, 2025
d484452
mersenne numbers and bounded natural numbers
EgbertRijke Jan 6, 2025
e031856
fixing citations
EgbertRijke Jan 6, 2025
9af5931
resolve merge conflicts
EgbertRijke Jan 6, 2025
aa6bb2e
resolve merge conflicts
EgbertRijke Jan 6, 2025
be13fbf
involution on the type of divisors
EgbertRijke Jan 7, 2025
ed68ab3
The formula for the distance of squares
EgbertRijke Jan 7, 2025
e0a8dee
refactoring exponentiation
EgbertRijke Jan 7, 2025
06035d1
Merge branch 'master' of github.com:UniMath/agda-unimath into irratio…
EgbertRijke Jan 7, 2025
1e2dc89
strictly ordered sets and inflationary maps
EgbertRijke Jan 8, 2025
1535006
inflationary maps of strictly ordered types
EgbertRijke Jan 8, 2025
4b86dd1
lower and upper bounds of structured natural numbers
EgbertRijke Jan 9, 2025
03dd0cf
factoring out minimal and maximal structure natural numbers
EgbertRijke Jan 10, 2025
948d7c7
bounded maximal elements of decidable families
EgbertRijke Jan 10, 2025
0845585
setting up some files for maps on the natural numbers
EgbertRijke Jan 11, 2025
9ff5147
maximal value-bound input property
EgbertRijke Jan 11, 2025
f120698
finite subtypes of the natural numbers have maximal elements
EgbertRijke Jan 12, 2025
1d66e6e
structured maximal value-bound inputs
EgbertRijke Jan 14, 2025
89abe84
any two distinct Fermat numbers are relatively prime
EgbertRijke Jan 15, 2025
a686f18
Farey fractions
EgbertRijke Jan 15, 2025
fa5ced3
unbounded Farey fractions
EgbertRijke Jan 15, 2025
24c32f7
some properties of Farey fractions
EgbertRijke Jan 16, 2025
ae95d3c
Every positive natural number has a 2-adic decomposition
EgbertRijke Jan 17, 2025
a23ea64
work
EgbertRijke Jan 19, 2025
fb2ec5b
Merge branch 'master' of github.com:UniMath/agda-unimath into irratio…
EgbertRijke Jan 19, 2025
f64232c
literature, exercises, and historical references
EgbertRijke Jan 21, 2025
b14fcab
literature, exercises, and historical references
EgbertRijke Jan 21, 2025
b66615e
formatting
EgbertRijke Jan 21, 2025
f80e569
Merge branch 'master' of github.com:UniMath/agda-unimath into irratio…
EgbertRijke Jan 26, 2025
06f229d
refactoring divisibility
EgbertRijke Jan 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 115 additions & 1 deletion references.bib
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@online{1000+theorems,
G@online{1000+theorems,
title = {1000+ theorems},
author = {Freek Wiedijk},
url = {https://1000-plus.github.io/}
Expand All @@ -10,6 +10,16 @@ @online{100theorems
url = {https://www.cs.ru.nl/~freek/100/}
}

@book{AZ18,
author = {Aigner, Martin and Ziegler, G\"{u}nter M.},
title = {Proofs from THE BOOK},
year = {2018},
isbn = {3662572648},
publisher = {Springer Publishing Company, Incorporated},
edition = {6th},
abstract = {This revised and enlarged sixth edition of Proofs from THE BOOKfeatures an entirely new chapter on Van der Waerdens permanent conjecture, as well as additional, highly original and delightful proofs in other chapters.}
}

@article{AKS15,
title = {Univalent Categories and the {{Rezk}} Completion},
author = {Ahrens, Benedikt and Kapulkin, Krzysztof and Shulman, Michael},
Expand Down Expand Up @@ -54,6 +64,16 @@ @article{AL19
langid = {english}
}

@book{Andrews94,
title = {Number Theory},
author = {Andrews, G.E.},
isbn = {9780486682525},
lccn = {lc94005243},
series = {Dover Books on Mathematics},
year = {1994},
publisher = {Dover Publications}
}

@misc{Awodey22,
author = {{Awodey}, Steve},
title = "{On Hofmann-Streicher universes}",
Expand Down Expand Up @@ -335,6 +355,15 @@ @article{Esc21
keywords = {55U40 03B15,Mathematics - Algebraic Geometry,Mathematics - Logic}
}

@book{Euler1748,
author = {Leonhard Euler},
title = {Introductio in analysin infinitorum},
year = {1748},
publisher = {Typographia Academiae Imperialis Petropolitanae},
url = {https://archive.org/details/introductioanaly00eule_0},
note = {Accessed: 2025-01-20}
}

@book{FBL73,
author = {Fraenkel, Abraham A. and Bar-Hillel, Yehoshua and Levy,
Azriel},
Expand All @@ -358,6 +387,14 @@ @online{Felixwellen/DCHoTT-Agda
howpublished = {{{GitHub}} repository}
}

@misc{Fibonacci1202,
author = {Fibonacci},
title = {Liber Abaci},
year = {1202},
note = {A scanned copy of Fibonacci's *Liber Abaci* is available through the Linda Hall Library Digital Collections.},
url = {https://old.maa.org/press/periodicals/convergence/mathematical-treasure-fibonacci-s-liber-abaci}
}

@online{GGMS24,
title = {The {{Category}} of {{Iterative Sets}} in {{Homotopy Type Theory}} and {{Univalent Foundations}}},
author = {Gratzer, Daniel and Gylterud, Håkon and Mörtberg, Anders and Stenholm, Elisabeth},
Expand All @@ -372,6 +409,16 @@ @online{GGMS24
keywords = {Computer Science - Logic in Computer Science,Mathematics - Logic}
}

@book{HW08,
title = {{An Introduction to the Theory of Numbers (6th edition)}},
author = {Hardy, G. H. and Wright, Edward M. and Heath-Brown, D. R. and Silverman, Joseph H.},
isbn = {0199219869},
keywords = {congruences, primitive roots, residue systems, instructional exposition},
publisher = {Oxford University Press},
year = {2008},
abstract = {{The sixth edition of the classic undergraduate text in elementary number theory includes a new chapter on elliptic curves and their role in the proof of Fermat's Last Theorem, a foreword by Andrew Wiles and extensively revised and updated end-of-chapter notes.}},
}

@article{KECA17,
title = {{Notions of Anonymous Existence in {{Martin-L\"of}} Type Theory}},
author = {Nicolai Kraus and Martín Escardó and Thierry Coquand and Thorsten Altenkirch},
Expand Down Expand Up @@ -415,6 +462,41 @@ @inproceedings{KvR19
eprintclass = {cs, math}
}

@book{Leibniz1693,
author = {Gottfried Wilhelm Leibniz},
title = {De geometria analysis},
year = {1693},
publisher = {Leibniz's own press, Vienna},
note = {This text is often cited as one of Leibniz's early works on calculus.}
}

@book{Leveque12volI,
title = {Topics in Number Theory, Volume I},
author = {LeVeque, W.J.},
isbn = {9780486152080},
series = {Dover Books on Mathematics},
year = {2012},
publisher = {Dover Publications}
}

@book{Leveque12volII,
title = {Topics in Number Theory, Volume II},
author = {LeVeque, W.J.},
isbn = {9780486152080},
series = {Dover Books on Mathematics},
year = {2012},
publisher = {Dover Publications}
}

@book{lucas1891,
title = {Théorie des Nombres},
author = {Lucas, Édouard},
year = {1891},
publisher = {Gauthier-Villars},
address = {Paris},
url = {https://archive.org/details/thoriedesnombr01lucauoft}
}

@incollection{Makkai98,
author = {Makkai, M.},
title = {Towards a categorical foundation of mathematics},
Expand Down Expand Up @@ -560,6 +642,18 @@ @misc{Mye21
primaryclass = {math.CT}
}

@book {NZM,
author = {Niven, Ivan and Zuckerman, Herbert S. and Montgomery, Hugh L.},
title = {An introduction to the theory of numbers},
edition = {Fifth},
publisher = {John Wiley \& Sons, Inc., New York},
year = {1991},
pages = {xiv+529},
isbn = {0-471-62546-9},
mrclass = {11-01},
mrnumber = {1083765},
}

@online{oeis,
title = {The {{On-Line Encyclopedia}} of {{Integer Sequences}}},
author = {OEIS Foundation Inc.},
Expand All @@ -583,6 +677,15 @@ @phdthesis{Qui16
langid = {english}
}

@book{Recorde1557,
author = {Robert Recorde},
title = {The Whetstone of Witte},
year = {1557},
publisher = {Printed by John Daye, London},
note = {This work contains the first recorded use of the equals sign (=).},
url = {https://archive.org/embed/TheWhetstoneOfWitte}
}

@book{Rie17,
title = {Category {{Theory}} in {{Context}}},
author = {Riehl, Emily},
Expand Down Expand Up @@ -890,3 +993,14 @@ @online{Warn24
pubstate = {preprint},
keywords = {Mathematics - Algebraic Topology,Mathematics - Category Theory}
}

@book{Widmann1489,
author = {Johannes Widmann},
title = {Behende und hüpsche Rechenung auff allen Kauffmanschafft},
year = {1489},
publisher = {Conrad Kachelofen},
address = {Leipzig},
note = {First use of "+" and "−" symbols in printed mathematics},
language = {German},
url = {https://www.loc.gov/item/49038907}
}
33 changes: 31 additions & 2 deletions src/commutative-algebra/groups-of-units-commutative-rings.lagda.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ open import category-theory.functors-large-precategories

open import commutative-algebra.commutative-rings
open import commutative-algebra.homomorphisms-commutative-rings
open import commutative-algebra.invertible-elements-commutative-rings
open import commutative-algebra.precategory-of-commutative-rings

open import foundation.dependent-pair-types
Expand All @@ -35,8 +36,9 @@ open import ring-theory.groups-of-units-rings

## Idea

The **group of units** of a
[commutative ring](commutative-algebra.commutative-rings.md) `A` is the
The
{{#concept "group of units" Disambiguation="commutative ring" WD="unit" WDID=Q118084}}
of a [commutative ring](commutative-algebra.commutative-rings.md) `A` is the
[abelian group](group-theory.abelian-groups.md) consisting of all the
[invertible elements](commutative-algebra.invertible-elements-commutative-rings.md)
in `A`. Equivalently, the group of units of `A` is the
Expand Down Expand Up @@ -177,6 +179,14 @@ module _
inclusion-group-of-units-Commutative-Ring =
inclusion-group-of-units-Ring (ring-Commutative-Ring A)

is-invertible-element-inclusion-group-of-units-Commutative-Ring :
(x : type-group-of-units-Commutative-Ring) →
is-invertible-element-Commutative-Ring A
( inclusion-group-of-units-Commutative-Ring x)
is-invertible-element-inclusion-group-of-units-Commutative-Ring =
is-invertible-element-inclusion-group-of-units-Ring
( ring-Commutative-Ring A)

preserves-mul-inclusion-group-of-units-Commutative-Ring :
{x y : type-group-of-units-Commutative-Ring} →
inclusion-group-of-units-Commutative-Ring
Expand Down Expand Up @@ -324,3 +334,22 @@ preserves-id-functor-Large-Precategory
group-of-units-commutative-ring-functor-Large-Precategory {X = A} =
preserves-id-hom-group-of-units-hom-Commutative-Ring A
```

### Negatives of units

```agda
module _
{l : Level} (A : Commutative-Ring l)
where

neg-group-of-units-Commutative-Ring :
type-group-of-units-Commutative-Ring A →
type-group-of-units-Commutative-Ring A
neg-group-of-units-Commutative-Ring =
neg-group-of-units-Ring (ring-Commutative-Ring A)

neg-unit-group-of-units-Commutative-Ring :
type-group-of-units-Commutative-Ring A
neg-unit-group-of-units-Commutative-Ring =
neg-unit-group-of-units-Ring (ring-Commutative-Ring A)
```
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ module commutative-algebra.invertible-elements-commutative-rings where
```agda
open import commutative-algebra.commutative-rings

open import foundation.action-on-identifications-functions
open import foundation.contractible-types
open import foundation.dependent-pair-types
open import foundation.identity-types
Expand Down Expand Up @@ -70,7 +71,7 @@ module _
( ring-Commutative-Ring A)
```

### Aight invertible elements of commutative rings
### Right invertible elements of commutative rings

```agda
module _
Expand Down Expand Up @@ -241,7 +242,7 @@ module _
is-invertible-element-inverse-Ring (ring-Commutative-Ring A)
```

### Any invertible element of a monoid has a contractible type of right inverses
### Any invertible element of a commutative ring has a contractible type of right inverses

```agda
module _
Expand All @@ -255,7 +256,7 @@ module _
is-contr-is-right-invertible-element-Ring (ring-Commutative-Ring A)
```

### Any invertible element of a monoid has a contractible type of left inverses
### Any invertible element of a commutative ring has a contractible type of left inverses

```agda
module _
Expand All @@ -269,7 +270,7 @@ module _
is-contr-is-left-invertible-Ring (ring-Commutative-Ring A)
```

### The unit of a monoid is invertible
### The unit of a commutative ring is invertible

```agda
module _
Expand All @@ -290,9 +291,17 @@ module _
is-invertible-element-Commutative-Ring A (one-Commutative-Ring A)
is-invertible-element-one-Commutative-Ring =
is-invertible-element-one-Ring (ring-Commutative-Ring A)

is-invertible-element-is-one-Commutative-Ring :
(x : type-Commutative-Ring A) → one-Commutative-Ring A = x →
is-invertible-element-Commutative-Ring A x
is-invertible-element-is-one-Commutative-Ring =
is-invertible-element-is-one-Ring (ring-Commutative-Ring A)
```

### Invertible elements are closed under multiplication
### A product `xy` is invertible if and only if both `x` and `y` are invertible

#### Invertible elements are closed under multiplication

```agda
module _
Expand Down Expand Up @@ -324,6 +333,46 @@ module _
is-invertible-element-mul-Ring (ring-Commutative-Ring A)
```

#### If `xy` is invertible then so is `x`

```agda
module _
{l : Level} (A : Commutative-Ring l) (x y : type-Commutative-Ring A)
where

is-invertible-element-left-factor-Commutative-Ring :
is-invertible-element-Commutative-Ring A (mul-Commutative-Ring A x y) →
is-invertible-element-Commutative-Ring A x
pr1 (is-invertible-element-left-factor-Commutative-Ring (u , p , q)) =
mul-Commutative-Ring A y u
pr1 (pr2 (is-invertible-element-left-factor-Commutative-Ring (u , p , q))) =
inv (associative-mul-Commutative-Ring A x y u) ∙ p
pr2 (pr2 (is-invertible-element-left-factor-Commutative-Ring (u , p , q))) =
right-swap-mul-Commutative-Ring A y u x ∙
ap (mul-Commutative-Ring' A u) (commutative-mul-Commutative-Ring A y x) ∙
p
```

#### If `xy` is invertible then so is `y`

```agda
module _
{l : Level} (A : Commutative-Ring l) (x y : type-Commutative-Ring A)
where

is-invertible-element-right-factor-Commutative-Ring :
is-invertible-element-Commutative-Ring A (mul-Commutative-Ring A x y) →
is-invertible-element-Commutative-Ring A y
pr1 (is-invertible-element-right-factor-Commutative-Ring (u , p , q)) =
mul-Commutative-Ring A u x
pr1 (pr2 (is-invertible-element-right-factor-Commutative-Ring (u , p , q))) =
left-swap-mul-Commutative-Ring A y u x ∙
ap (mul-Commutative-Ring A u) (commutative-mul-Commutative-Ring A y x) ∙
q
pr2 (pr2 (is-invertible-element-right-factor-Commutative-Ring (u , p , q))) =
associative-mul-Commutative-Ring A u x y ∙ q
```

### The inverse of an invertible element is invertible

```agda
Expand Down
Loading
Loading