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

Metric spaces #1162

Merged
merged 262 commits into from
Sep 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
262 commits
Select commit Hold shift + click to select a range
5137628
separating neighbourhhod relations
malarbol Aug 12, 2024
12affd0
typo
malarbol Aug 12, 2024
33471ff
refactor metric space definition
malarbol Aug 13, 2024
9a94102
apartness relation metric spaces
malarbol Aug 13, 2024
49e066d
typo
malarbol Aug 13, 2024
b343f25
refactor limits/continuity using existential quantification
malarbol Aug 14, 2024
55525f4
precategory of metric spaces and (uniformly) continuous functions
malarbol Aug 15, 2024
a08ff63
typo
malarbol Aug 15, 2024
c68bab0
typo
malarbol Aug 15, 2024
b8fe9b3
typo
malarbol Aug 15, 2024
b7bf3a0
precategory of metric spaces and short maps
malarbol Aug 15, 2024
c746376
typo
malarbol Aug 15, 2024
45a1201
projections on product metric spaces are short
malarbol Aug 15, 2024
a047cd0
precategory of metric spaces and isometries
malarbol Aug 16, 2024
ea18158
apartness is irreflexive and symmetric
malarbol Aug 16, 2024
5c4f18a
fix typo and add accessor functions
malarbol Aug 16, 2024
9fa7c92
equality of metric spaces
malarbol Aug 18, 2024
f032fc3
isomorphic objects in the precategory of metric spaces and short maps…
malarbol Aug 18, 2024
14265bc
fix link
malarbol Aug 18, 2024
ffed954
pseudometric spaces
malarbol Aug 18, 2024
034bcf4
Merge branch 'master' into metric-structures
malarbol Aug 18, 2024
4d9301c
fix link
malarbol Aug 18, 2024
a922799
fix link
malarbol Aug 18, 2024
8813340
fix link
malarbol Aug 18, 2024
28abf75
fix link
malarbol Aug 18, 2024
e2b2cdc
refactor equality of metric spaces / category of metric spaces and is…
malarbol Aug 22, 2024
0060367
fix link
malarbol Aug 22, 2024
836321c
Merge branch 'master' into metric-structures
malarbol Aug 22, 2024
2184940
category of metric spaces and short maps
malarbol Aug 23, 2024
5412b90
Merge branch 'master' into metric-structures
malarbol Aug 23, 2024
41f13ef
WIP refactor using premetric spaces
malarbol Aug 25, 2024
a5f3f2f
cleanup equality of premetric spaces
malarbol Aug 25, 2024
94a0180
add header and reference
malarbol Aug 25, 2024
1e13bc9
add section header
malarbol Aug 25, 2024
ba6db4b
isometric equivalence and equivalent on premetric spaces
malarbol Aug 26, 2024
d7c7441
cauchy approximations premetric spaces
malarbol Aug 26, 2024
7b6d866
short maps premetric spaces
malarbol Aug 26, 2024
aae61b4
fix typo
malarbol Aug 26, 2024
08d15e0
remove sequences and continuity metric spaces
malarbol Aug 27, 2024
9566cbb
remove sequences metric spaces
malarbol Aug 27, 2024
e0d7727
Merge branch 'master' into metric-structures
malarbol Aug 27, 2024
ea750bc
refactor metric spaces
malarbol Aug 27, 2024
9ac0e80
precategory of metric spaces and functions
malarbol Aug 28, 2024
4a314ce
embedding short-isomertry-Metric-Space
malarbol Aug 28, 2024
d0c31ce
functor precategory short-isometry metric spaces
malarbol Aug 28, 2024
ec898a9
functorial action of short maps on cauchy approximations
malarbol Aug 28, 2024
21ac8a4
fix links and headers
malarbol Aug 28, 2024
aa6c1d3
precategory functor from metric spaces and isometries to sets and fun…
malarbol Aug 28, 2024
91ff999
Add wikipedia reference
malarbol Aug 30, 2024
693ea52
pullback of premetrics
malarbol Aug 31, 2024
c803067
ordering of premetrics
malarbol Aug 31, 2024
e47e141
Merge branch 'master' into metric-structures
malarbol Aug 31, 2024
2c7d6e8
fix links
malarbol Aug 31, 2024
34ab077
fix header
malarbol Aug 31, 2024
c2575d6
discrete metric structures
malarbol Aug 31, 2024
487b723
Apply suggestions from code review
malarbol Sep 2, 2024
7883387
fix `map-inv-eq`
malarbol Sep 2, 2024
436e488
rename `is-close-XXX`
malarbol Sep 2, 2024
c740c65
factor out `is-category-XXX proofs`
malarbol Sep 2, 2024
22961cf
fix split-Q+
malarbol Sep 2, 2024
39a2f11
Apply suggestions from code review
malarbol Sep 2, 2024
569a136
fix isometry definition
malarbol Sep 2, 2024
1f4401e
fix local lemmas names
malarbol Sep 2, 2024
6c442a9
fix typo
malarbol Sep 2, 2024
f377b09
Add Booij2020PhD bibtex reference
malarbol Sep 2, 2024
7ada9a7
Merge branch 'master' into metric-structures
malarbol Sep 2, 2024
a895d88
refactor pseudometric spaces
malarbol Sep 2, 2024
598b095
closed premetric structures
malarbol Sep 3, 2024
636af08
saturated metric spaces
malarbol Sep 3, 2024
ed040ec
additive rules for inequality on the rational numbers
malarbol Sep 4, 2024
a9edb86
saturated metric space of rational numbers
malarbol Sep 4, 2024
9f0651a
saturated metric space of real numbers
malarbol Sep 4, 2024
c64db9f
fix link
malarbol Sep 4, 2024
51d1868
Merge branch 'master' into metric-structures
malarbol Sep 4, 2024
b881dea
Apply suggestions from code review
malarbol Sep 4, 2024
374480c
rename (subsets -> subspaces) metric spaces
malarbol Sep 4, 2024
7a03b61
fix indentation
malarbol Sep 4, 2024
9cffba1
move metric space of real numbers
malarbol Sep 4, 2024
9fe8868
pt-separation relation in premetric structures
malarbol Sep 5, 2024
9ef5aa9
Apply suggestions from code review
malarbol Sep 6, 2024
0fd143c
Apply suggestions from code review
malarbol Sep 6, 2024
50a56d9
markdown formatting
malarbol Sep 6, 2024
ee66b9e
rename {preserves => is}-short-function-Premetric-Space
malarbol Sep 6, 2024
190604c
rename pullback-metric-structures
malarbol Sep 6, 2024
9633d72
fix headers
malarbol Sep 6, 2024
bba35f3
add metric spaces in (pre)categories table
malarbol Sep 6, 2024
2efb4fd
table instances of metric spaces
malarbol Sep 6, 2024
dafdf7b
Apply suggestions from code review
malarbol Sep 6, 2024
9a6cd6c
table instances of metric spaces
malarbol Sep 6, 2024
a7994f7
Apply suggestions from code review
malarbol Sep 6, 2024
e4c4f66
Update src/metric-spaces/premetric-structures.lagda.md
malarbol Sep 6, 2024
d3052c6
cleanup is-reflexive-premetric-leq-R
malarbol Sep 8, 2024
d49d5f1
refactor isomorphisms isometry/short maps
malarbol Sep 8, 2024
d69b238
refactor metric space definition
malarbol Sep 9, 2024
790d7c8
use american neighborhoods
malarbol Sep 9, 2024
542ab06
fix typo
malarbol Sep 9, 2024
eafcf94
fix links
malarbol Sep 9, 2024
936f7d6
add external links pseudometric spaces
malarbol Sep 9, 2024
3d0e3ed
Update src/metric-spaces/pseudometric-spaces.lagda.md
malarbol Sep 9, 2024
49fd3e8
fix markdown indentation
malarbol Sep 9, 2024
cefcdfa
The precategory functor from isometries to short maps is split essent…
malarbol Sep 9, 2024
20572a2
the precategory functor from isometries to short maps is an equivalen…
malarbol Sep 10, 2024
d270f76
reorder definitions/properties of premetric structures
malarbol Sep 10, 2024
c12225d
fix upper case
malarbol Sep 10, 2024
cfb9619
remove apartness relation module
malarbol Sep 10, 2024
cefe3f5
fix metric-spaces main module
malarbol Sep 10, 2024
62d2eee
split premetric-structures module
malarbol Sep 12, 2024
84d59af
fix typo
malarbol Sep 12, 2024
5cd29c3
Apply suggestions from code review
malarbol Sep 12, 2024
bd8da55
fix markdown indentation
malarbol Sep 12, 2024
18e1b0d
Update src/metric-spaces/triangular-premetric-structures.lagda.md
malarbol Sep 12, 2024
7c20ccb
Merge branch 'master' into metric-structures
malarbol Sep 12, 2024
3d11e82
WIP distance interpretation
malarbol Sep 13, 2024
06562de
fix US english
malarbol Sep 13, 2024
529379c
WIP distance interpretation
malarbol Sep 13, 2024
7af13a5
Apply suggestions from code review
malarbol Sep 14, 2024
b8340cd
fix markdown formatting
malarbol Sep 14, 2024
48b1c37
distance interpretation
malarbol Sep 14, 2024
f40ae50
fix description
malarbol Sep 14, 2024
2b96bd5
refactor metric space of rational numbers
malarbol Sep 14, 2024
3b8110c
fix markdown formatting
malarbol Sep 14, 2024
8b5b1d0
refactor extensional premetric structures
malarbol Sep 14, 2024
5e190da
triple interpretation isometry
malarbol Sep 14, 2024
d0e8000
add link
malarbol Sep 14, 2024
abb3f11
Update src/metric-spaces/extensional-premetric-structures.lagda.md
malarbol Sep 14, 2024
1458f4c
add `metric-spaces` `## Idea` section
malarbol Sep 15, 2024
b9817f4
cleanup and remove duplicated code
malarbol Sep 15, 2024
5e9cf8a
distance interpretation cauchy approximations
malarbol Sep 15, 2024
3ed38d6
fix header
malarbol Sep 15, 2024
1dc36f9
remove nested `where` blocks
malarbol Sep 15, 2024
eb70022
fix typo
malarbol Sep 15, 2024
b5e4932
fix header
malarbol Sep 15, 2024
d943afc
fix header
malarbol Sep 15, 2024
e1c1c40
fix header
malarbol Sep 15, 2024
0d4d561
fix metric space of rational numbers headers
malarbol Sep 15, 2024
5c29525
fix typo
malarbol Sep 15, 2024
260eaa4
fix header
malarbol Sep 15, 2024
8107243
add links
malarbol Sep 15, 2024
596a739
add definition poset of premetric structures
malarbol Sep 15, 2024
202539a
fix header and add `## See also`
malarbol Sep 15, 2024
06a4d52
fix header and add `## See also`
malarbol Sep 15, 2024
74643db
fix typo
malarbol Sep 15, 2024
035876c
add links
malarbol Sep 16, 2024
38994f5
add `isometry-inclusion-subspace-Metric-Space`
malarbol Sep 16, 2024
a6da96d
fix markdown formatting
malarbol Sep 16, 2024
4d21a11
cleanup
malarbol Sep 16, 2024
b9184e9
fix typo
malarbol Sep 17, 2024
920162f
Merge branch 'master' into metric-structures
malarbol Sep 17, 2024
76b2ab1
refactor using `is-equiv-is-iso-precategory-Set`
malarbol Sep 17, 2024
bcb023f
isometries between metric spaces are embeddings
malarbol Sep 18, 2024
eae2568
Addition of rational numbers is isometric
malarbol Sep 18, 2024
b765f9b
accessor function `is-upper-bound-dist-Premetric-Space`
malarbol Sep 19, 2024
6d65939
refactor limits Cauchy approximations in premetric spaces
malarbol Sep 19, 2024
db27aeb
convergent Cauchy approximations in metric spaces
malarbol Sep 19, 2024
45230e4
cleanup
malarbol Sep 19, 2024
40617d1
metric space of cauchy approximations in a metric space
malarbol Sep 19, 2024
3dc7e0e
fix lowercase (NameSpace)
malarbol Sep 19, 2024
955e5f3
remove unused imports
malarbol Sep 19, 2024
aa63dea
complete metric spaces
malarbol Sep 19, 2024
6eeef15
add wikidata references
malarbol Sep 19, 2024
d0caafb
fix typo
malarbol Sep 19, 2024
8b411f1
`rational-ℚ⁺` is a convergent cauchy approximation
malarbol Sep 19, 2024
d6a12cb
metric space of convergent Cauchy approximations in a metric space
malarbol Sep 19, 2024
1338e98
fix link
malarbol Sep 19, 2024
764a211
accessor function `type-complete-Metric-Space`
malarbol Sep 19, 2024
980681a
Update src/metric-spaces/precategory-of-metric-spaces-and-isometries.…
malarbol Sep 21, 2024
98f0bf2
fix name
malarbol Sep 21, 2024
1a89348
define `premetric-space-leq-ℝ`
malarbol Sep 21, 2024
b6f58e1
use `is-equiv-is-iso-Set`
malarbol Sep 21, 2024
9ec9ade
remove unused import
malarbol Sep 21, 2024
7291542
Apply suggestions from code review
malarbol Sep 22, 2024
86155f4
Update src/metric-spaces/closed-premetric-structures.lagda.md
malarbol Sep 22, 2024
98dff1c
Apply suggestions from code review
malarbol Sep 22, 2024
03a61cc
fix names, formatting, etc.
malarbol Sep 22, 2024
d61e066
fix header
malarbol Sep 22, 2024
2a1e6e8
Update src/metric-spaces/closed-premetric-structures.lagda.md
malarbol Sep 22, 2024
c77357c
Update src/metric-spaces/symmetric-premetric-structures.lagda.md
malarbol Sep 22, 2024
2be1955
fix markdown lines
malarbol Sep 22, 2024
10e017c
refactor `is-saturated-metric-space-leq-ℝ`
malarbol Sep 22, 2024
8208d87
add header
malarbol Sep 22, 2024
00a1e94
remove empty line
malarbol Sep 22, 2024
7c3a01a
refactor discrete-metric-structures
malarbol Sep 22, 2024
ae6d6f9
fix typos
malarbol Sep 22, 2024
899fd4b
fix header / references
malarbol Sep 22, 2024
debd94b
fix upper-case `Complete-Metric-Space`
malarbol Sep 22, 2024
c2a5ad4
add links
malarbol Sep 22, 2024
903a8f2
refactor precategory laws
malarbol Sep 22, 2024
1b7d10a
fix header / references
malarbol Sep 23, 2024
d398d35
add link
malarbol Sep 23, 2024
10f48a6
add link
malarbol Sep 23, 2024
7479063
cleanup and `## See also`
malarbol Sep 23, 2024
fcbc764
prefer pattern metching over `rec-Σ`
malarbol Sep 23, 2024
12a7fb8
rename (`all-eq-[...]` => `all-elements-equal-[...]`)
malarbol Sep 23, 2024
b266954
the discrete premetric on a type is local iff the type is a set
malarbol Sep 23, 2024
88e7ed6
add link
malarbol Sep 23, 2024
b754ced
refactor `is-isometry-add-ℚ`
malarbol Sep 23, 2024
cd412a1
fix typos
malarbol Sep 23, 2024
c6105b6
refactor `discrete-premetric-structures`
malarbol Sep 23, 2024
24d4350
small cleanup categories metric spaces
malarbol Sep 23, 2024
0873ece
WIP fix names isometric => isometry
malarbol Sep 24, 2024
f606cfd
fix module names
malarbol Sep 24, 2024
87a9b50
improve main `metric-spaces` header
malarbol Sep 24, 2024
988c616
fix markdown formatting
malarbol Sep 24, 2024
fd186e8
rephrase `extensional-premetric-structures` header
malarbol Sep 24, 2024
73a707c
abstract `is-prop-is-convergent-cauchy-approximation-Metric-Space`
malarbol Sep 24, 2024
05a3ecb
fix references order
malarbol Sep 24, 2024
e09373d
fix links
malarbol Sep 24, 2024
dad55d2
Merge branch 'master' into metric-structures
malarbol Sep 24, 2024
8665bf9
add `#concept`
malarbol Sep 24, 2024
a86649d
fix typo
malarbol Sep 24, 2024
a36e544
fix one-sentence-paragraph
malarbol Sep 24, 2024
4ee06e3
fix typo
malarbol Sep 24, 2024
0d05890
fix name
malarbol Sep 24, 2024
8f2a4e3
rename `approximate` => `estimate`
malarbol Sep 24, 2024
577c389
rename `equivalent-isometries` => `invertible-isometries`
malarbol Sep 24, 2024
7d9a3f2
WIP clean isometric
malarbol Sep 24, 2024
c609f9f
fix one-sentence-paragraph
malarbol Sep 24, 2024
f86da45
change > to ```text``` to please the markdown formatter
malarbol Sep 24, 2024
ed00e1a
more explicit types
malarbol Sep 24, 2024
19fff3b
define `Π-Premetric-Space`
malarbol Sep 24, 2024
f6ff5e6
Revert "define `Π-Premetric-Space`"
malarbol Sep 24, 2024
445bbf4
cleanup & typos
malarbol Sep 24, 2024
c8ceec2
fix name
malarbol Sep 24, 2024
00a51db
cleanup
malarbol Sep 24, 2024
f2fd747
fix names
malarbol Sep 24, 2024
fa62a5f
fix one-sentence-paragraphs
malarbol Sep 24, 2024
0e16c07
rephrase header
malarbol Sep 24, 2024
d70751b
fix typo
malarbol Sep 25, 2024
092d271
fix one-sentence-paragraph
malarbol Sep 25, 2024
bfbefcf
add links
malarbol Sep 25, 2024
29ec684
cleanup
malarbol Sep 25, 2024
287e54b
fix typo
malarbol Sep 25, 2024
1ae75d6
cleanup
malarbol Sep 25, 2024
0f4b2c9
cleanup
malarbol Sep 25, 2024
2b67177
add distance interpretation in header
malarbol Sep 25, 2024
8e3e1e2
fix indent
malarbol Sep 25, 2024
380b5be
fix one-sentence-paragraph
malarbol Sep 25, 2024
7027f46
fix naming isometric equality/equivalence
fredrik-bakke Sep 25, 2024
bb2c8a1
quote blocks `closed-premetric-structures`
fredrik-bakke Sep 25, 2024
82a31fb
bullet points* `closed-premetric-structures`
fredrik-bakke Sep 25, 2024
ba9ccf2
prose `metric-spaces`
fredrik-bakke Sep 25, 2024
f0807c8
`Booij20PhD`
fredrik-bakke Sep 25, 2024
aa0d1dc
`local` -> `extensional` pseudometric
fredrik-bakke Sep 25, 2024
e6681ee
`is-local-Pseudometric-Space` -> `is-extensional-Pseudometric-Space`
fredrik-bakke Sep 25, 2024
7aa6672
remove `local-Pseudometric-Space`
fredrik-bakke Sep 25, 2024
06fa954
pre-commit
fredrik-bakke Sep 25, 2024
2df559e
`equiv-isometric-eq(uiv)-...` -> `equiv-isometric-eq(uiv)-eq-...`
fredrik-bakke Sep 25, 2024
be8efbb
pre-commit
fredrik-bakke Sep 25, 2024
d581f61
Merge branch 'master' into metric-structures
malarbol Sep 26, 2024
8be1a4f
rename `estimate` => `limit'`
malarbol Sep 27, 2024
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
98 changes: 98 additions & 0 deletions src/elementary-number-theory/positive-rational-numbers.lagda.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ open import elementary-number-theory.addition-integer-fractions
open import elementary-number-theory.addition-rational-numbers
open import elementary-number-theory.additive-group-of-rational-numbers
open import elementary-number-theory.cross-multiplication-difference-integer-fractions
open import elementary-number-theory.difference-rational-numbers
open import elementary-number-theory.inequality-rational-numbers
open import elementary-number-theory.integer-fractions
open import elementary-number-theory.integers
open import elementary-number-theory.multiplication-integer-fractions
Expand All @@ -29,11 +31,13 @@ open import elementary-number-theory.rational-numbers
open import elementary-number-theory.reduced-integer-fractions
open import elementary-number-theory.strict-inequality-rational-numbers

open import foundation.action-on-identifications-functions
open import foundation.cartesian-product-types
open import foundation.coproduct-types
open import foundation.dependent-pair-types
open import foundation.function-types
open import foundation.identity-types
open import foundation.logical-equivalences
open import foundation.negation
open import foundation.propositions
open import foundation.sets
Expand Down Expand Up @@ -175,6 +179,18 @@ module _
is-positive-eq-ℤ (cross-mul-diff-zero-fraction-ℤ (fraction-ℚ x))
```

### The difference of a rational number with a lesser rational number is positive

```agda
is-positive-diff-le-ℚ : (x y : ℚ) → le-ℚ x y → is-positive-ℚ (y -ℚ x)
is-positive-diff-le-ℚ x y H =
is-positive-le-zero-ℚ
( y -ℚ x)
( backward-implication
( iff-translate-diff-le-zero-ℚ x y)
( H))
```

### A nonzero rational number or its negative is positive

```agda
Expand Down Expand Up @@ -432,4 +448,86 @@ module _
( le-zero-is-positive-ℚ
( rational-ℚ⁺ x)
( is-positive-rational-ℚ⁺ x)))

malarbol marked this conversation as resolved.
Show resolved Hide resolved
module _
(x y : ℚ⁺) (H : le-ℚ⁺ x y)
where

le-diff-ℚ⁺ : ℚ⁺
pr1 le-diff-ℚ⁺ = (rational-ℚ⁺ y) -ℚ (rational-ℚ⁺ x)
pr2 le-diff-ℚ⁺ =
is-positive-le-zero-ℚ
( (rational-ℚ⁺ y) -ℚ (rational-ℚ⁺ x))
( backward-implication
( iff-translate-diff-le-zero-ℚ
( rational-ℚ⁺ x)
( rational-ℚ⁺ y))
( ( H)))

left-diff-law-add-ℚ⁺ : le-diff-ℚ⁺ +ℚ⁺ x = y
left-diff-law-add-ℚ⁺ =
eq-ℚ⁺
( ( associative-add-ℚ
( rational-ℚ⁺ y)
( neg-ℚ (rational-ℚ⁺ x))
( rational-ℚ⁺ x)) ∙
( ( ap
( (rational-ℚ⁺ y) +ℚ_)
( left-inverse-law-add-ℚ (rational-ℚ⁺ x))) ∙
( right-unit-law-add-ℚ (rational-ℚ⁺ y))))

right-diff-law-add-ℚ⁺ : x +ℚ⁺ le-diff-ℚ⁺ = y
right-diff-law-add-ℚ⁺ =
( eq-ℚ⁺
( commutative-add-ℚ
( rational-ℚ⁺ x)
( rational-ℚ⁺ le-diff-ℚ⁺))) ∙
( left-diff-law-add-ℚ⁺)
```

### The positive mediant between zero and a positive rational numbers
malarbol marked this conversation as resolved.
Show resolved Hide resolved

```agda
mediant-zero-ℚ⁺ : ℚ⁺ → ℚ⁺
mediant-zero-ℚ⁺ x =
( mediant-ℚ zero-ℚ (rational-ℚ⁺ x) ,
is-positive-le-zero-ℚ
( mediant-ℚ zero-ℚ (rational-ℚ⁺ x))
( le-left-mediant-ℚ
( zero-ℚ)
( rational-ℚ⁺ x)
( le-zero-is-positive-ℚ (rational-ℚ⁺ x) (is-positive-rational-ℚ⁺ x))))

le-mediant-zero-ℚ⁺ : (x : ℚ⁺) → le-ℚ⁺ (mediant-zero-ℚ⁺ x) x
le-mediant-zero-ℚ⁺ x =
( le-right-mediant-ℚ
( zero-ℚ)
( rational-ℚ⁺ x)
( le-zero-is-positive-ℚ (rational-ℚ⁺ x) (is-positive-rational-ℚ⁺ x)))
malarbol marked this conversation as resolved.
Show resolved Hide resolved
```

### The addition with a positive rational number is an increasing map
malarbol marked this conversation as resolved.
Show resolved Hide resolved

```agda
le-left-add-rational-ℚ⁺ : (x : ℚ) (d : ℚ⁺) → le-ℚ x ((rational-ℚ⁺ d) +ℚ x)
le-left-add-rational-ℚ⁺ x d =
concatenate-leq-le-ℚ
( x)
( zero-ℚ +ℚ x)
( (rational-ℚ⁺ d) +ℚ x)
( inv-tr (leq-ℚ x) (left-unit-law-add-ℚ x) (refl-leq-ℚ x))
( preserves-le-left-add-ℚ
( x)
( zero-ℚ)
( rational-ℚ⁺ d)
( le-zero-is-positive-ℚ
( rational-ℚ⁺ d)
( is-positive-rational-ℚ⁺ d)))

le-right-add-rational-ℚ⁺ : (x : ℚ) (d : ℚ⁺) → le-ℚ x (x +ℚ (rational-ℚ⁺ d))
le-right-add-rational-ℚ⁺ x d =
inv-tr
( le-ℚ x)
( commutative-add-ℚ x (rational-ℚ⁺ d))
( le-left-add-rational-ℚ⁺ x d)
```
17 changes: 17 additions & 0 deletions src/metric-spaces.lagda.md
fredrik-bakke marked this conversation as resolved.
Show resolved Hide resolved
malarbol marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Metric spaces

malarbol marked this conversation as resolved.
Show resolved Hide resolved
```agda
malarbol marked this conversation as resolved.
Show resolved Hide resolved
module metric-spaces where

open import metric-spaces.cauchy-sequences-metric-spaces public
open import metric-spaces.convergent-sequences-metric-spaces public
open import metric-spaces.dependent-products-metric-spaces public
open import metric-spaces.functions-metric-spaces public
open import metric-spaces.metric-space-of-rational-numbers public
open import metric-spaces.metric-spaces public
open import metric-spaces.neighbourhood-relations public
open import metric-spaces.pointwise-continuity-functions-metric-spaces public
open import metric-spaces.sequences-metric-spaces public
open import metric-spaces.subsets-metric-spaces public
open import metric-spaces.uniform-continuity-functions-metric-spaces public
```
119 changes: 119 additions & 0 deletions src/metric-spaces/cauchy-sequences-metric-spaces.lagda.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
# Cauchy sequences in metric spaces

```agda
module metric-spaces.cauchy-sequences-metric-spaces where
```

<details><summary>Imports</summary>

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

open import foundation.binary-relations
open import foundation.dependent-pair-types
open import foundation.identity-types
open import foundation.propositions
open import foundation.transport-along-identifications
open import foundation.universe-levels

open import metric-spaces.convergent-sequences-metric-spaces
open import metric-spaces.metric-spaces
open import metric-spaces.neighbourhood-relations
open import metric-spaces.sequences-metric-spaces
```

</details>

## Idea

Cauchy sequences in metric spaces are sequences that satisfy the Cauchy
criterion.

## Definitions

### Cauchy sequences in metric spaces

```agda
module _
{l : Level} (M : Metric-Space l) (u : Sequence-Metric-Space M)
where

is-modulus-cauchy-prop-Sequence-Metric-Space : (d : ℚ⁺) (N : ℕ) → Prop l
is-modulus-cauchy-prop-Sequence-Metric-Space d N =
Π-Prop
( ℕ)
( λ (n : ℕ) →
( Π-Prop
( ℕ)
( λ (m : ℕ) →
hom-Prop
( leq-ℕ-Prop N n)
( hom-Prop
( leq-ℕ-Prop N m)
( neighbourhood-Metric-Space M d (u n) (u m))))))

is-modulus-cauchy-Sequence-Metric-Space : (d : ℚ⁺) (N : ℕ) → UU l
is-modulus-cauchy-Sequence-Metric-Space d N =
type-Prop (is-modulus-cauchy-prop-Sequence-Metric-Space d N)

is-cauchy-Sequence-Metric-Space : UU l
is-cauchy-Sequence-Metric-Space =
(d : ℚ⁺) → Σ ℕ (is-modulus-cauchy-Sequence-Metric-Space d)
```

### Convergent sequences in metric spaces are Cauchy sequences

```agda
module _
{l : Level} (M : Metric-Space l) (u : Sequence-Metric-Space M)
where

is-cauchy-is-convergent-Sequence-Metric-Space :
is-convergent-Sequence-Metric-Space M u →
is-cauchy-Sequence-Metric-Space M u
is-cauchy-is-convergent-Sequence-Metric-Space (x , H) d = (N , α)
where
d₂ : ℚ⁺
d₂ = mediant-zero-ℚ⁺ d

d₁ : ℚ⁺
d₁ = le-diff-ℚ⁺ d₂ d (le-mediant-zero-ℚ⁺ d)

Np : ℕ
Np = modulus-limit-Sequence-Metric-Space M u x H d₁

Nq : ℕ
Nq = modulus-limit-Sequence-Metric-Space M u x H d₂

N : ℕ
N = max-ℕ Np Nq

α : is-modulus-cauchy-Sequence-Metric-Space M u d N
α p q I J =
tr
( λ d' → is-in-neighbourhood-Metric-Space M d' (u p) (u q))
( left-diff-law-add-ℚ⁺ d₂ d (le-mediant-zero-ℚ⁺ d))
( is-triangular-neighbourhood-Metric-Space M
( u p)
( x)
( u q)
( d₁)
( d₂)
( γ)
( is-symmetric-neighbourhood-Metric-Space M d₁ x (u p) β))
where
β : is-in-neighbourhood-Metric-Space M d₁ x (u p)
β =
is-modulus-modulus-limit-Sequence-Metric-Space M u x H d₁ p
( transitive-leq-ℕ Np N p I
( leq-left-leq-max-ℕ N Np Nq (refl-leq-ℕ N)))

γ : is-in-neighbourhood-Metric-Space M d₂ x (u q)
γ =
is-modulus-modulus-limit-Sequence-Metric-Space M u x H d₂ q
( transitive-leq-ℕ Nq N q J
( leq-right-leq-max-ℕ N Np Nq (refl-leq-ℕ N)))
```
Loading
Loading