Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
74dfa31
Progress
lowasser Aug 19, 2025
aa578cd
Progress
lowasser Aug 19, 2025
a596e90
Merge branch 'master' into min-max-total
lowasser Aug 19, 2025
034dea6
Progress
lowasser Aug 20, 2025
0f863ac
Merge branch 'min-max-total' into intervals
lowasser Aug 20, 2025
90f991c
Progress
lowasser Aug 20, 2025
a6a698e
Merge branch 'master' into intervals
lowasser Sep 6, 2025
7c5f694
Progress
lowasser Sep 6, 2025
d3b06b5
Merge branch 'master' into intervals
lowasser Sep 9, 2025
8ea30ea
Progress
lowasser Sep 9, 2025
9726c59
Respond to review comments
lowasser Sep 12, 2025
d7509a2
Merge branch 'master' into intervals
lowasser Sep 12, 2025
a868f8a
make pre-commit
lowasser Sep 13, 2025
9400255
make pre-commit
lowasser Sep 13, 2025
a0edf6e
Progress
lowasser Sep 14, 2025
0202393
Renamings
lowasser Sep 14, 2025
ab17ce8
Split out nonnegative rational operations
lowasser Sep 14, 2025
8be4cf8
naming
fredrik-bakke Sep 21, 2025
e7b2418
fix link
fredrik-bakke Sep 21, 2025
dbdcab2
edits
fredrik-bakke Sep 21, 2025
c4ec81e
fix more links
fredrik-bakke Sep 21, 2025
e285dac
concept macro closed intervals rational numbers
fredrik-bakke Sep 21, 2025
9348d77
Rename
lowasser Sep 24, 2025
9979a0f
Merge remote-tracking branch 'origin/intervals' into intervals
lowasser Sep 24, 2025
e97c045
Renaming
lowasser Sep 24, 2025
ee0c903
Renaming
lowasser Sep 24, 2025
2cbc082
Progress
lowasser Sep 24, 2025
2ec83b1
Progress
lowasser Sep 30, 2025
8aa2992
Merge branch 'master' into intervals
lowasser Sep 30, 2025
0eb3098
Rename back
lowasser Oct 1, 2025
b071f0f
Fix link
lowasser Oct 1, 2025
d55ff8b
Fix concept
lowasser Oct 1, 2025
01d0853
Progress
lowasser Oct 1, 2025
1f89925
Progress
lowasser Oct 1, 2025
57f7b4d
Progress
lowasser Oct 1, 2025
b7e4310
Merge branch 'master' into split-mul-nonneg-rat
lowasser Oct 1, 2025
cd3348c
Progress
lowasser Oct 1, 2025
5f35912
Progress
lowasser Oct 1, 2025
903e8d0
Move more out of nonnegative
lowasser Oct 1, 2025
06e9319
Merge branch 'split-mul-nonneg-rat' into split-pos-rat
lowasser Oct 1, 2025
0d12e8a
Update dependencies
lowasser Oct 1, 2025
c43da1f
Apply suggestions from code review
lowasser Oct 1, 2025
6ef4366
Fix 'inhabited closed' stragglers
lowasser Oct 1, 2025
865797a
make pre-commit format
lowasser Oct 1, 2025
76f1766
Apply suggestions from code review
lowasser Oct 1, 2025
07300fe
Parenthesize concatenated paths
lowasser Oct 1, 2025
0118a0c
Merge remote-tracking branch 'origin/intervals' into intervals
lowasser Oct 1, 2025
fd6fac6
Merge branch 'intervals' into narrow-mul-interval
lowasser Oct 1, 2025
9235a01
Progress
lowasser Oct 2, 2025
af3df99
Merge branch 'master' into narrow-mul-interval
lowasser Oct 2, 2025
9cd7d6e
Finish the first case
lowasser Oct 2, 2025
2268ddd
Remove concepts for specific instances
lowasser Oct 2, 2025
a300c7a
Merge branch 'split-mul-nonneg-rat' into split-pos-rat
lowasser Oct 2, 2025
6d2aa78
Remove concepts for specific instances
lowasser Oct 2, 2025
5bc67cf
Finish first version
lowasser Oct 3, 2025
53fa7dc
Merge branch 'split-pos-rat' into narrow-mul-interval-split
lowasser Oct 3, 2025
a7d87bd
Progress
lowasser Oct 3, 2025
bbaff84
Finish proving the interior condition
lowasser Oct 3, 2025
440678d
Merge branch 'master' into split-pos-rat
lowasser Oct 3, 2025
7290d4c
Restore unlinked concepts
lowasser Oct 3, 2025
c56d410
Fixes
lowasser Oct 3, 2025
f77e973
Revert
lowasser Oct 3, 2025
e27c74d
Apply suggestions from code review
lowasser Oct 3, 2025
8172049
Merge branch 'master' into narrow-mul-interval
lowasser Oct 3, 2025
d566f5f
Respond to comments
lowasser Oct 3, 2025
6c1d5fb
Merge branch 'split-pos-rat' into narrow-mul-interval-split
lowasser Oct 3, 2025
5ef0748
Merge branch 'narrow-mul-interval' into narrow-mul-interval-split
lowasser Oct 3, 2025
c41e40a
Merge
lowasser Oct 3, 2025
0358102
Apply suggestions from code review
lowasser Oct 4, 2025
7fd3724
Merge branch 'master' into narrow-mul-interval
lowasser Oct 4, 2025
4566e50
make pre-commit
lowasser Oct 4, 2025
52f4e42
Respond to review comments
lowasser Oct 4, 2025
5952641
Merge branch 'narrow-mul-interval' into narrow-mul-interval-split
lowasser Oct 4, 2025
7217f3a
Apply suggestions from code review
lowasser Oct 5, 2025
f888fdc
Merge branch 'master' into narrow-mul-interval
lowasser Oct 5, 2025
4413d69
make pre-commit
lowasser Oct 5, 2025
abef95a
Fix import
lowasser Oct 5, 2025
d02fabf
Merge branch 'master' into narrow-mul-interval
fredrik-bakke Oct 6, 2025
80e5f3c
Split out multiplication of interior intervals
lowasser Oct 6, 2025
a023e85
Merge remote-tracking branch 'origin/narrow-mul-interval' into narrow…
lowasser Oct 6, 2025
4e47107
Fix
lowasser Oct 6, 2025
4de6918
Fix
lowasser Oct 6, 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
9 changes: 9 additions & 0 deletions src/elementary-number-theory.lagda.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ open import elementary-number-theory.binomial-theorem-integers public
open import elementary-number-theory.binomial-theorem-natural-numbers public
open import elementary-number-theory.bounded-sums-arithmetic-functions public
open import elementary-number-theory.catalan-numbers public
open import elementary-number-theory.closed-interval-preserving-maps-rational-numbers public
open import elementary-number-theory.closed-intervals-rational-numbers public
open import elementary-number-theory.cofibonacci public
open import elementary-number-theory.collatz-bijection public
Expand Down Expand Up @@ -107,6 +108,7 @@ open import elementary-number-theory.initial-segments-natural-numbers public
open import elementary-number-theory.integer-fractions public
open import elementary-number-theory.integer-partitions public
open import elementary-number-theory.integers public
open import elementary-number-theory.interior-closed-intervals-rational-numbers public
open import elementary-number-theory.intersections-closed-intervals-rational-numbers public
open import elementary-number-theory.jacobi-symbol public
open import elementary-number-theory.kolakoski-sequence public
Expand All @@ -118,6 +120,7 @@ open import elementary-number-theory.maximum-rational-numbers public
open import elementary-number-theory.maximum-standard-finite-types public
open import elementary-number-theory.mediant-integer-fractions public
open import elementary-number-theory.mersenne-primes public
open import elementary-number-theory.minima-and-maxima-rational-numbers public
open import elementary-number-theory.minimum-natural-numbers public
open import elementary-number-theory.minimum-positive-rational-numbers public
open import elementary-number-theory.minimum-rational-numbers public
Expand All @@ -129,10 +132,13 @@ open import elementary-number-theory.monoid-of-natural-numbers-with-maximum publ
open import elementary-number-theory.multiplication-closed-intervals-rational-numbers public
open import elementary-number-theory.multiplication-integer-fractions public
open import elementary-number-theory.multiplication-integers public
open import elementary-number-theory.multiplication-interior-closed-intervals-rational-numbers public
open import elementary-number-theory.multiplication-lists-of-natural-numbers public
open import elementary-number-theory.multiplication-natural-numbers public
open import elementary-number-theory.multiplication-nonnegative-rational-numbers public
open import elementary-number-theory.multiplication-nonpositive-rational-numbers public
open import elementary-number-theory.multiplication-positive-and-negative-integers public
open import elementary-number-theory.multiplication-positive-and-negative-rational-numbers public
open import elementary-number-theory.multiplication-positive-rational-numbers public
open import elementary-number-theory.multiplication-rational-numbers public
open import elementary-number-theory.multiplicative-group-of-positive-rational-numbers public
Expand All @@ -144,13 +150,15 @@ open import elementary-number-theory.multiplicative-units-integers public
open import elementary-number-theory.multiplicative-units-standard-cyclic-rings public
open import elementary-number-theory.multiset-coefficients public
open import elementary-number-theory.natural-numbers public
open import elementary-number-theory.negation-closed-intervals-rational-numbers public
open import elementary-number-theory.negative-integer-fractions public
open import elementary-number-theory.negative-integers public
open import elementary-number-theory.negative-rational-numbers public
open import elementary-number-theory.nonnegative-integer-fractions public
open import elementary-number-theory.nonnegative-integers public
open import elementary-number-theory.nonnegative-rational-numbers public
open import elementary-number-theory.nonpositive-integers public
open import elementary-number-theory.nonpositive-rational-numbers public
open import elementary-number-theory.nonzero-integers public
open import elementary-number-theory.nonzero-natural-numbers public
open import elementary-number-theory.nonzero-rational-numbers public
Expand All @@ -170,6 +178,7 @@ open import elementary-number-theory.powers-integers public
open import elementary-number-theory.powers-of-two public
open import elementary-number-theory.prime-numbers public
open import elementary-number-theory.products-of-natural-numbers public
open import elementary-number-theory.proper-closed-intervals-rational-numbers public
open import elementary-number-theory.proper-divisors-natural-numbers public
open import elementary-number-theory.pythagorean-triples public
open import elementary-number-theory.rational-numbers public
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Closed interval preserving endomaps on the rational numbers

```agda
module elementary-number-theory.closed-interval-preserving-maps-rational-numbers where
```

<details><summary>Imports</summary>

```agda
open import elementary-number-theory.closed-intervals-rational-numbers
open import elementary-number-theory.inequality-rational-numbers
open import elementary-number-theory.rational-numbers

open import foundation.propositions
open import foundation.universe-levels

open import order-theory.closed-interval-preserving-maps-posets
```

</details>

## Idea

A map from the [rational numbers](elementary-number-theory.rational-numbers.md)
to themselves `f : ℚ → ℚ` is
{{#concept "closed interval preserving" Agda=is-closed-interval-map-ℚ disambiguation="map between rational numbers"}}
if the [image](foundation.images-subtypes.md) of a
[closed interval](elementary-number-theory.closed-intervals-rational-numbers.md)
is always a closed interval in `Y`. Equivalently, it is a
[closed interval preserving map](order-theory.closed-interval-preserving-maps-total-orders.md)
on the
[total order of rational numbers](elementary-number-theory.decidable-total-order-rational-numbers.md).

## Definition

```agda
is-closed-interval-map-ℚ :
(ℚ → ℚ) → ([a,b] [c,d] : closed-interval-ℚ) → UU lzero
is-closed-interval-map-ℚ = is-closed-interval-map-Poset ℚ-Poset ℚ-Poset

is-closed-interval-map-prop-ℚ :
(ℚ → ℚ) → closed-interval-ℚ → closed-interval-ℚ →
Prop lzero
is-closed-interval-map-prop-ℚ =
is-closed-interval-map-prop-Poset ℚ-Poset ℚ-Poset
```
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,13 @@ lower-bound-closed-interval-ℚ =
upper-bound-closed-interval-ℚ : closed-interval-ℚ → ℚ
upper-bound-closed-interval-ℚ =
upper-bound-closed-interval-Poset ℚ-Poset
```

## Properties

### The subtype associated with a closed interval

```agda
subtype-closed-interval-ℚ :
closed-interval-ℚ → subtype lzero ℚ
subtype-closed-interval-ℚ =
Expand All @@ -68,21 +74,23 @@ subtype-closed-interval-ℚ =
is-in-closed-interval-ℚ : closed-interval-ℚ → ℚ → UU lzero
is-in-closed-interval-ℚ [a,b] =
is-in-subtype (subtype-closed-interval-ℚ [a,b])
```

is-closed-interval-map-prop-ℚ :
(ℚ → ℚ) → closed-interval-ℚ → closed-interval-ℚ →
Prop lzero
is-closed-interval-map-prop-ℚ =
is-closed-interval-map-prop-Poset ℚ-Poset ℚ-Poset
### The property of being above or below a closed interval

```agda
is-below-prop-closed-interval-ℚ :
closed-interval-ℚ → subtype lzero ℚ
is-below-prop-closed-interval-ℚ ((a , _) , _) b = le-ℚ-Prop b a

is-above-prop-closed-interval-ℚ :
closed-interval-ℚ → subtype lzero ℚ
is-above-prop-closed-interval-ℚ ((_ , a) , _) b = le-ℚ-Prop a b
```

### The width of a closed interval

```agda
nonnegative-width-closed-interval-ℚ :
closed-interval-ℚ → ℚ⁰⁺
nonnegative-width-closed-interval-ℚ ((a , b) , a≤b) =
Expand All @@ -91,11 +99,6 @@ nonnegative-width-closed-interval-ℚ ((a , b) , a≤b) =
width-closed-interval-ℚ : closed-interval-ℚ → ℚ
width-closed-interval-ℚ [a,b] =
rational-ℚ⁰⁺ (nonnegative-width-closed-interval-ℚ [a,b])

is-injective-subtype-closed-interval-ℚ :
is-injective subtype-closed-interval-ℚ
is-injective-subtype-closed-interval-ℚ =
is-injective-subtype-closed-interval-Poset ℚ-Poset
```

### Important ranges
Expand All @@ -108,7 +111,14 @@ one-one-closed-interval-ℚ : closed-interval-ℚ
one-one-closed-interval-ℚ = ((one-ℚ , one-ℚ) , refl-leq-ℚ one-ℚ)
```

## Properties
### The map from closed intervals to their subtypes is injective

```agda
is-injective-subtype-closed-interval-ℚ :
is-injective subtype-closed-interval-ℚ
is-injective-subtype-closed-interval-ℚ =
is-injective-subtype-closed-interval-Poset ℚ-Poset
```

### Characterization of equality

Expand Down Expand Up @@ -152,10 +162,18 @@ abstract
( right-leq-left-max-ℚ p q q≤p)
```

### Maps from rational intervals to rational intervals
### The bounds of a closed interval are elements

```agda
is-closed-interval-map-ℚ :
(ℚ → ℚ) → ([a,b] [c,d] : closed-interval-ℚ) → UU lzero
is-closed-interval-map-ℚ = is-closed-interval-map-Poset ℚ-Poset ℚ-Poset
lower-bound-is-in-closed-interval-ℚ :
([a,b] : closed-interval-ℚ) →
is-in-closed-interval-ℚ [a,b] (lower-bound-closed-interval-ℚ [a,b])
lower-bound-is-in-closed-interval-ℚ =
lower-bound-is-in-closed-interval-Poset ℚ-Poset

upper-bound-is-in-closed-interval-ℚ :
([a,b] : closed-interval-ℚ) →
is-in-closed-interval-ℚ [a,b] (upper-bound-closed-interval-ℚ [a,b])
upper-bound-is-in-closed-interval-ℚ =
upper-bound-is-in-closed-interval-Poset ℚ-Poset
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Interior closed intervals in the rational numbers

```agda
module elementary-number-theory.interior-closed-intervals-rational-numbers where
```

<details><summary>Imports</summary>

```agda
open import elementary-number-theory.closed-intervals-rational-numbers
open import elementary-number-theory.strict-inequality-rational-numbers

open import foundation.conjunction
open import foundation.dependent-pair-types
open import foundation.propositions
open import foundation.universe-levels
```

</details>

## Idea

Given two
[closed intervals of rational numbers](elementary-number-theory.closed-intervals-rational-numbers.md)
[a, b] and [c, d], then [c, d] is said to be
{{#concept "interior" Disambiguation="closed intervals of rational numbers" Agda=is-interior-closed-interval-ℚ}}
to [a, b] if `a < c` and `d < b`.

## Definition

```agda
is-interior-prop-closed-interval-ℚ :
closed-interval-ℚ → closed-interval-ℚ → Prop lzero
is-interior-prop-closed-interval-ℚ ((x , y) , _) ((x' , y') , _) =
le-ℚ-Prop x x' ∧ le-ℚ-Prop y' y

is-interior-closed-interval-ℚ : closed-interval-ℚ → closed-interval-ℚ → UU lzero
is-interior-closed-interval-ℚ [x,y] [x',y'] =
type-Prop (is-interior-prop-closed-interval-ℚ [x,y] [x',y'])
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Minima and maxima on the rational numbers

```agda
module elementary-number-theory.minima-and-maxima-rational-numbers where
```

<details><summary>Imports</summary>

```agda
open import elementary-number-theory.inequality-rational-numbers
open import elementary-number-theory.maximum-rational-numbers
open import elementary-number-theory.minimum-rational-numbers
open import elementary-number-theory.rational-numbers

open import foundation.action-on-identifications-functions
open import foundation.coproduct-types
open import foundation.identity-types
```

</details>

## Idea

On this page, we outline basic relations between
[minima](elementary-number-theory.minimum-rational-numbers.md) and
[maxima](elementary-number-theory.maximum-rational-numbers.md) of
[rational numbers](elementary-number-theory.rational-numbers.md).

## Lemmas

### The negation of the minimum of rational numbers is the maximum of the negations

```agda
module _
(p q : ℚ)
where

abstract
neg-min-ℚ : neg-ℚ (min-ℚ p q) = max-ℚ (neg-ℚ p) (neg-ℚ q)
neg-min-ℚ =
rec-coproduct
( λ p≤q →
( ap neg-ℚ (left-leq-right-min-ℚ p q p≤q)) ∙
( inv (right-leq-left-max-ℚ _ _ (neg-leq-ℚ _ _ p≤q))))
( λ q≤p →
( ap neg-ℚ (right-leq-left-min-ℚ p q q≤p)) ∙
( inv (left-leq-right-max-ℚ _ _ (neg-leq-ℚ _ _ q≤p))))
( linear-leq-ℚ p q)
```

### The negation of the maximum of rational numbers is the minimum of the negations

```agda
module _
(p q : ℚ)
where

abstract
neg-max-ℚ : neg-ℚ (max-ℚ p q) = min-ℚ (neg-ℚ p) (neg-ℚ q)
neg-max-ℚ =
rec-coproduct
( λ p≤q →
( ap neg-ℚ (left-leq-right-max-ℚ _ _ p≤q)) ∙
( inv (right-leq-left-min-ℚ _ _ (neg-leq-ℚ _ _ p≤q))))
( λ q≤p →
( ap neg-ℚ (right-leq-left-max-ℚ _ _ q≤p)) ∙
( inv (left-leq-right-min-ℚ _ _ (neg-leq-ℚ _ _ q≤p))))
( linear-leq-ℚ p q)
```
Loading