Skip to content

Commit ccfcf55

Browse files
Double negation stability of equality on Dedekind real numbers (#1703)
1 parent faeb8d0 commit ccfcf55

File tree

5 files changed

+123
-0
lines changed

5 files changed

+123
-0
lines changed

references.bib

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,15 @@ @online{BdJR24
149149
keywords = {Computer Science - Logic in Computer Science,Mathematics - Algebraic Topology,Mathematics - Category Theory},
150150
}
151151

152+
@misc{BH25,
153+
title = {The Countable Reals},
154+
author = {Andrej Bauer and James E. Hanson},
155+
year = 2025,
156+
eprint = {2404.01256},
157+
archiveprefix = {arXiv},
158+
primaryclass = {math.LO},
159+
}
160+
152161
@phdthesis{Booij20PhD,
153162
title = {Analysis in univalent type theory},
154163
author = {Booij, Auke Bart},

src/real-numbers.lagda.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ open import real-numbers.dedekind-real-numbers public
2323
open import real-numbers.difference-real-numbers public
2424
open import real-numbers.distance-real-numbers public
2525
open import real-numbers.enclosing-closed-rational-intervals-real-numbers public
26+
open import real-numbers.equality-real-numbers public
2627
open import real-numbers.finitely-enumerable-subsets-real-numbers public
2728
open import real-numbers.geometric-sequences-real-numbers public
2829
open import real-numbers.inequalities-addition-and-subtraction-real-numbers public
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Equality of real numbers
2+
3+
```agda
4+
module real-numbers.equality-real-numbers where
5+
```
6+
7+
<details><summary>Imports</summary>
8+
9+
```agda
10+
open import foundation.double-negation
11+
open import foundation.double-negation-stable-equality
12+
open import foundation.identity-types
13+
open import foundation.sets
14+
open import foundation.universe-levels
15+
16+
open import real-numbers.dedekind-real-numbers
17+
open import real-numbers.inequality-real-numbers
18+
open import real-numbers.similarity-real-numbers
19+
```
20+
21+
</details>
22+
23+
## Idea
24+
25+
We record that [equality](foundation-core.identity-types.md) and
26+
[similarity](real-numbers.similarity-real-numbers.md) of
27+
[Dedekind real numbers](real-numbers.dedekind-real-numbers.md) and
28+
[double negation stable](foundation.double-negation-stable-equality.md).
29+
30+
## Properties
31+
32+
### Similarity of Dedekind real numbers is double negation stable
33+
34+
```agda
35+
module _
36+
{l1 l2 : Level} {x : ℝ l1} {y : ℝ l2}
37+
where abstract
38+
39+
double-negation-elim-sim-ℝ : ¬¬ (x ~ℝ y) → x ~ℝ y
40+
double-negation-elim-sim-ℝ H =
41+
sim-antisymmetric-leq-ℝ x y
42+
( double-negation-elim-leq-ℝ x y (map-double-negation leq-sim-ℝ H))
43+
( double-negation-elim-leq-ℝ y x (map-double-negation leq-sim-ℝ' H))
44+
```
45+
46+
### Equality of Dedekind real numbers is double negation stable
47+
48+
```agda
49+
module _
50+
{l : Level} {x y : ℝ l}
51+
where abstract
52+
53+
double-negation-elim-eq-ℝ : ¬¬ (x = y) → x = y
54+
double-negation-elim-eq-ℝ H =
55+
eq-sim-ℝ (double-negation-elim-sim-ℝ (map-double-negation sim-eq-ℝ H))
56+
```
57+
58+
### The Dedekind real numbers form a set
59+
60+
This fact is already demonstrated in
61+
[`real-numbers.dedekind-real-numbers`](real-numbers.dedekind-real-numbers.md),
62+
but we give a second proof using the fact that equality satisfies double
63+
negation elimination.
64+
65+
```agda
66+
is-set-ℝ' : {l : Level} → is-set (ℝ l)
67+
is-set-ℝ' =
68+
is-set-has-double-negation-stable-equality (λ x y → double-negation-elim-eq-ℝ)
69+
```

src/real-numbers/inequality-real-numbers.lagda.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ open import elementary-number-theory.strict-inequality-rational-numbers
1616
open import foundation.cartesian-product-types
1717
open import foundation.complements-subtypes
1818
open import foundation.dependent-pair-types
19+
open import foundation.disjunction
20+
open import foundation.double-negation
1921
open import foundation.empty-types
2022
open import foundation.existential-quantification
2123
open import foundation.function-types
@@ -189,6 +191,9 @@ abstract opaque
189191
190192
leq-sim-ℝ : {l1 l2 : Level} {x : ℝ l1} {y : ℝ l2} → sim-ℝ x y → leq-ℝ x y
191193
leq-sim-ℝ = pr1
194+
195+
leq-sim-ℝ' : {l1 l2 : Level} {x : ℝ l1} {y : ℝ l2} → sim-ℝ x y → leq-ℝ y x
196+
leq-sim-ℝ' = pr2
192197
```
193198

194199
### Inequality on the real numbers is antisymmetric
@@ -413,6 +418,39 @@ module _
413418
leq-leq-rational-ℝ y x (λ q → forward-implication (H q)))
414419
```
415420

421+
### Double negation elimination of inequality
422+
423+
Given two Dedekind real numbers `x` and `y` such that `¬¬(x ≤ y)`, then `x ≤ y`.
424+
425+
We follow the proof of Proposition 5.2 in {{#cite BH25}}.
426+
427+
**Proof.** Assume `¬¬(x ≤ y)`, and let `q : ℚ` such that `q ∈ Lx`. Then by
428+
roundedness of `Lx` there exists an `r : ℚ` such that `q < r` and `r ∈ Lx`.
429+
Because `y` is located, we have that `q ∈ Ly` or `r ∈ Uy`. In the first case we
430+
are already done, so assume `r ∈ Uy`. By `¬¬(x ≤ y)` we also know that
431+
`¬¬ (r ∈ Ly)`, but the lower and upper cuts of `y` are disjoint, so we have
432+
reached a contradiction. ∎
433+
434+
```agda
435+
module _
436+
{l1 l2 : Level} (x : ℝ l1) (y : ℝ l2)
437+
where abstract opaque
438+
439+
unfolding leq-ℝ
440+
441+
double-negation-elim-leq-ℝ : ¬¬ (leq-ℝ x y) → leq-ℝ x y
442+
double-negation-elim-leq-ℝ H q Q =
443+
rec-trunc-Prop
444+
( lower-cut-ℝ y q)
445+
( λ (r , q<r , R) →
446+
elim-disjunction
447+
( lower-cut-ℝ y q)
448+
( id)
449+
( λ r∈Uy → ex-falso (H (λ L → is-disjoint-cut-ℝ y r (L r R , r∈Uy))))
450+
( is-located-lower-upper-cut-ℝ y q<r))
451+
( forward-implication (is-rounded-lower-cut-ℝ x q) Q)
452+
```
453+
416454
## References
417455

418456
{{#bibliography}}

src/real-numbers/similarity-real-numbers.lagda.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,3 +190,9 @@ abstract opaque
190190
191191
syntax step-similarity-reasoning-ℝ p u q = p ~ℝ u by q
192192
```
193+
194+
## See also
195+
196+
- In
197+
[`real-numbers.equality-real-numbers`](real-numbers.equality-real-numbers.md)
198+
it is demonstrated that similarity is double negation stable.

0 commit comments

Comments
 (0)