Skip to content

Commit bf40f64

Browse files
authored
Lipschitz-continuous functions between metric spaces (#1417)
This introduces the concept of *Lipschitz* functions between metric spaces and proves that left/right multiplication of rational numbers is Lipschitz. More precisely, `metric-spaces.lipschitz-functions-metric-spaces` introduces the following concepts and results: - Lipschitz constant for a function between metric spaces; - Lipschitz functions between metric spaces (functions with some Lipschitz constant); - constant functions are Lipschitz for all `α : ℚ⁺`; - short functions are Lipschitz functions with Lipschitz constant equal to 1; - Lipschitz functions are uniformly continuous; - the composition of Lipschitz maps is Lipschitz; - being a Lipschitz map is homotopy invariant; - Lipschitz maps preserve elements at bounded distance. The metric space of Lipschitz functions is introduced in `metric-spaces.metric-space-of-lipschitz-functions-metric-spaces`. We also introduce a new concept in the `metric-spaces` module: - `metric-spaces.elements-at-bounded-distance-metric-spaces`: the equivalence relation of being at bounded distance in a metric space (being in _some_ neighborhood).
1 parent 3cdee34 commit bf40f64

16 files changed

+1064
-231
lines changed

src/elementary-number-theory/distance-rational-numbers.lagda.md

Lines changed: 24 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ open import foundation.dependent-pair-types
2929
open import foundation.identity-types
3030
open import foundation.logical-equivalences
3131
open import foundation.transport-along-identifications
32-
33-
open import metric-spaces.metric-space-of-rational-numbers
34-
open import metric-spaces.metric-space-of-rational-numbers-with-open-neighborhoods
3532
```
3633

3734
</details>
@@ -93,6 +90,30 @@ abstract
9390

9491
```agda
9592
abstract
93+
left-distributive-abs-mul-dist-ℚ :
94+
(p q r : ℚ) →
95+
abs-ℚ p *ℚ⁰⁺ dist-ℚ q r = dist-ℚ (p *ℚ q) (p *ℚ r)
96+
left-distributive-abs-mul-dist-ℚ p q r =
97+
equational-reasoning
98+
abs-ℚ p *ℚ⁰⁺ dist-ℚ q r
99+
= abs-ℚ (p *ℚ (q -ℚ r))
100+
by (inv (abs-mul-ℚ p (q -ℚ r)))
101+
= dist-ℚ (p *ℚ q) (p *ℚ r)
102+
by ap abs-ℚ (left-distributive-mul-diff-ℚ p q r)
103+
104+
right-distributive-abs-mul-dist-ℚ :
105+
(p q r : ℚ) →
106+
dist-ℚ q r *ℚ⁰⁺ abs-ℚ p = dist-ℚ (q *ℚ p) (r *ℚ p)
107+
right-distributive-abs-mul-dist-ℚ p q r =
108+
equational-reasoning
109+
dist-ℚ q r *ℚ⁰⁺ abs-ℚ p
110+
= abs-ℚ p *ℚ⁰⁺ dist-ℚ q r
111+
by commutative-mul-ℚ⁰⁺ (dist-ℚ q r) (abs-ℚ p)
112+
= dist-ℚ (p *ℚ q) (p *ℚ r)
113+
by left-distributive-abs-mul-dist-ℚ p q r
114+
= dist-ℚ (q *ℚ p) (r *ℚ p)
115+
by ap-binary dist-ℚ (commutative-mul-ℚ p q) (commutative-mul-ℚ p r)
116+
96117
left-distributive-mul-dist-ℚ :
97118
(p : ℚ⁰⁺) (q r : ℚ) →
98119
p *ℚ⁰⁺ dist-ℚ q r = dist-ℚ (rational-ℚ⁰⁺ p *ℚ q) (rational-ℚ⁰⁺ p *ℚ r)
@@ -165,122 +186,6 @@ abstract
165186
( inv-tr (λ s → le-ℚ s r) (distributive-neg-diff-ℚ p q) q-p<r)
166187
```
167188

168-
### Relationship to the metric space of rational numbers
169-
170-
```agda
171-
abstract
172-
leq-dist-neighborhood-leq-ℚ :
173-
(ε : ℚ⁺) (p q : ℚ) →
174-
neighborhood-leq-ℚ ε p q →
175-
leq-ℚ (rational-dist-ℚ p q) (rational-ℚ⁺ ε)
176-
leq-dist-neighborhood-leq-ℚ ε⁺@(ε , _) p q (H , K) =
177-
leq-dist-leq-diff-ℚ
178-
( p)
179-
( q)
180-
( ε)
181-
( swap-right-diff-leq-ℚ p ε q (leq-transpose-right-add-ℚ p q ε K))
182-
( swap-right-diff-leq-ℚ q ε p (leq-transpose-right-add-ℚ q p ε H))
183-
184-
neighborhood-leq-leq-dist-ℚ :
185-
(ε : ℚ⁺) (p q : ℚ) →
186-
leq-ℚ (rational-dist-ℚ p q) (rational-ℚ⁺ ε) →
187-
neighborhood-leq-ℚ ε p q
188-
neighborhood-leq-leq-dist-ℚ ε⁺@(ε , _) p q |p-q|≤ε =
189-
( leq-transpose-left-diff-ℚ
190-
( q)
191-
( ε)
192-
( p)
193-
( swap-right-diff-leq-ℚ
194-
( q)
195-
( p)
196-
( ε)
197-
( transitive-leq-ℚ
198-
( q -ℚ p)
199-
( rational-dist-ℚ p q)
200-
( ε)
201-
( |p-q|≤ε)
202-
( leq-reversed-diff-dist-ℚ p q)))) ,
203-
( leq-transpose-left-diff-ℚ
204-
( p)
205-
( ε)
206-
( q)
207-
( swap-right-diff-leq-ℚ
208-
( p)
209-
( q)
210-
( ε)
211-
( transitive-leq-ℚ
212-
( p -ℚ q)
213-
( rational-dist-ℚ p q)
214-
( ε)
215-
( |p-q|≤ε)
216-
( leq-diff-dist-ℚ p q))))
217-
218-
leq-dist-iff-neighborhood-leq-ℚ :
219-
(ε : ℚ⁺) (p q : ℚ) →
220-
leq-ℚ (rational-dist-ℚ p q) (rational-ℚ⁺ ε) ↔
221-
neighborhood-leq-ℚ ε p q
222-
pr1 (leq-dist-iff-neighborhood-leq-ℚ ε p q) = neighborhood-leq-leq-dist-ℚ ε p q
223-
pr2 (leq-dist-iff-neighborhood-leq-ℚ ε p q) = leq-dist-neighborhood-leq-ℚ ε p q
224-
```
225-
226-
### Relationship to the metric space of rational numbers with open neighborhoods
227-
228-
```agda
229-
abstract
230-
le-dist-neighborhood-le-ℚ :
231-
(ε : ℚ⁺) (p q : ℚ) →
232-
neighborhood-le-ℚ ε p q →
233-
le-ℚ (rational-dist-ℚ p q) (rational-ℚ⁺ ε)
234-
le-dist-neighborhood-le-ℚ ε⁺@(ε , _) p q (H , K) =
235-
le-dist-le-diff-ℚ
236-
( p)
237-
( q)
238-
( ε)
239-
( swap-right-diff-le-ℚ p ε q (le-transpose-right-add-ℚ p q ε K))
240-
( swap-right-diff-le-ℚ q ε p (le-transpose-right-add-ℚ q p ε H))
241-
242-
neighborhood-le-le-dist-ℚ :
243-
(ε : ℚ⁺) (p q : ℚ) →
244-
le-ℚ (rational-dist-ℚ p q) (rational-ℚ⁺ ε) →
245-
neighborhood-le-ℚ ε p q
246-
neighborhood-le-le-dist-ℚ ε⁺@(ε , _) p q |p-q|<ε =
247-
( le-transpose-left-diff-ℚ
248-
( q)
249-
( ε)
250-
( p)
251-
( swap-right-diff-le-ℚ
252-
( q)
253-
( p)
254-
( ε)
255-
( concatenate-leq-le-ℚ
256-
( q -ℚ p)
257-
( rational-dist-ℚ p q)
258-
( ε)
259-
( leq-reversed-diff-dist-ℚ p q)
260-
( |p-q|<ε)))) ,
261-
( le-transpose-left-diff-ℚ
262-
( p)
263-
( ε)
264-
( q)
265-
( swap-right-diff-le-ℚ
266-
( p)
267-
( q)
268-
( ε)
269-
( concatenate-leq-le-ℚ
270-
( p -ℚ q)
271-
( rational-dist-ℚ p q)
272-
( ε)
273-
( leq-diff-dist-ℚ p q)
274-
( |p-q|<ε))))
275-
276-
le-dist-iff-neighborhood-le-ℚ :
277-
(ε : ℚ⁺) (p q : ℚ) →
278-
le-ℚ (rational-dist-ℚ p q) (rational-ℚ⁺ ε) ↔
279-
neighborhood-le-ℚ ε p q
280-
pr1 (le-dist-iff-neighborhood-le-ℚ ε p q) = neighborhood-le-le-dist-ℚ ε p q
281-
pr2 (le-dist-iff-neighborhood-le-ℚ ε p q) = le-dist-neighborhood-le-ℚ ε p q
282-
```
283-
284189
### The distance between two rational numbers is the difference of their maximum and minimum
285190

286191
```agda

src/elementary-number-theory/inequality-integers.lagda.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,13 @@ _≤-ℤ_ = leq-ℤ
7373

7474
## Properties
7575

76+
### Zero is less than one
77+
78+
```agda
79+
leq-zero-one-ℤ : leq-ℤ zero-ℤ one-ℤ
80+
leq-zero-one-ℤ = star
81+
```
82+
7683
### Inequality on the integers is reflexive, antisymmetric and transitive
7784

7885
```agda

src/elementary-number-theory/inequality-rational-numbers.lagda.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,13 @@ _≤-ℚ_ = leq-ℚ
8484

8585
## Properties
8686

87+
### Zero is less than one
88+
89+
```agda
90+
leq-zero-one-ℚ : leq-ℚ zero-ℚ one-ℚ
91+
leq-zero-one-ℚ = leq-zero-one-ℤ
92+
```
93+
8794
### Inequality on the rational numbers is decidable
8895

8996
```agda
@@ -439,6 +446,17 @@ abstract
439446
( leq-transpose-left-diff-ℚ p q r p-q≤r))
440447
```
441448

449+
### A rational number is lesser than its successor
450+
451+
```agda
452+
succ-leq-ℚ : (p : ℚ) → leq-ℚ p (succ-ℚ p)
453+
succ-leq-ℚ p =
454+
tr
455+
( λ x → leq-ℚ x (one-ℚ +ℚ p))
456+
( left-unit-law-add-ℚ p)
457+
( preserves-leq-left-add-ℚ p zero-ℚ one-ℚ leq-zero-one-ℚ)
458+
```
459+
442460
## See also
443461

444462
- The decidable total order on the rational numbers is defined in

src/elementary-number-theory/nonnegative-rational-numbers.lagda.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,26 @@ module _
190190
is-nonnegative-leq-zero-ℚ)
191191
```
192192

193+
### The successor of a nonnegative rational number is positive
194+
195+
```agda
196+
abstract
197+
is-positive-succ-is-nonnegative-ℚ :
198+
(q : ℚ) → is-nonnegative-ℚ q → is-positive-ℚ (succ-ℚ q)
199+
is-positive-succ-is-nonnegative-ℚ q H =
200+
is-positive-le-zero-ℚ
201+
( succ-ℚ q)
202+
( concatenate-leq-le-ℚ
203+
( zero-ℚ)
204+
( q)
205+
( succ-ℚ q)
206+
( leq-zero-is-nonnegative-ℚ q H)
207+
( le-left-add-rational-ℚ⁺ q one-ℚ⁺))
208+
209+
positive-succ-ℚ⁰⁺ : ℚ⁰⁺ → ℚ⁺
210+
positive-succ-ℚ⁰⁺ (q , H) = (succ-ℚ q , is-positive-succ-is-nonnegative-ℚ q H)
211+
```
212+
193213
### The product of two nonnegative rational numbers is nonnegative
194214

195215
```agda

src/elementary-number-theory/positive-rational-numbers.lagda.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,14 @@ one-ℚ⁺ : ℚ⁺
177177
one-ℚ⁺ = (one-ℚ , is-positive-int-positive-ℤ one-positive-ℤ)
178178
```
179179

180+
### The type of positive rational numbers is inhabited
181+
182+
```agda
183+
abstract
184+
is-inhabited-ℚ⁺ : ║ ℚ⁺ ║₋₁
185+
is-inhabited-ℚ⁺ = unit-trunc-Prop one-ℚ⁺
186+
```
187+
180188
### The rational image of a positive natural number is positive
181189

182190
```agda

src/metric-spaces.lagda.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ open import metric-spaces.convergent-cauchy-approximations-metric-spaces public
5959
open import metric-spaces.convergent-sequences-metric-spaces public
6060
open import metric-spaces.dependent-products-metric-spaces public
6161
open import metric-spaces.discrete-premetric-structures public
62+
open import metric-spaces.elements-at-bounded-distance-metric-spaces public
6263
open import metric-spaces.equality-of-metric-spaces public
6364
open import metric-spaces.equality-of-premetric-spaces public
6465
open import metric-spaces.extensional-premetric-structures public
@@ -73,13 +74,15 @@ open import metric-spaces.limits-of-cauchy-approximations-premetric-spaces publi
7374
open import metric-spaces.limits-of-sequences-metric-spaces public
7475
open import metric-spaces.limits-of-sequences-premetric-spaces public
7576
open import metric-spaces.limits-of-sequences-pseudometric-spaces public
77+
open import metric-spaces.lipschitz-functions-metric-spaces public
7678
open import metric-spaces.metric-space-of-cauchy-approximations-complete-metric-spaces public
7779
open import metric-spaces.metric-space-of-cauchy-approximations-metric-spaces public
7880
open import metric-spaces.metric-space-of-cauchy-approximations-saturated-complete-metric-spaces public
7981
open import metric-spaces.metric-space-of-convergent-cauchy-approximations-metric-spaces public
8082
open import metric-spaces.metric-space-of-convergent-sequences-metric-spaces public
8183
open import metric-spaces.metric-space-of-functions-metric-spaces public
8284
open import metric-spaces.metric-space-of-isometries-metric-spaces public
85+
open import metric-spaces.metric-space-of-lipschitz-functions-metric-spaces public
8386
open import metric-spaces.metric-space-of-rational-numbers public
8487
open import metric-spaces.metric-space-of-rational-numbers-with-open-neighborhoods public
8588
open import metric-spaces.metric-space-of-short-functions-metric-spaces public

0 commit comments

Comments
 (0)