-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apartness from 0, for example, implies a real is multiplicatively invertible. --------- Co-authored-by: Fredrik Bakke <[email protected]>
- Loading branch information
1 parent
66eebb8
commit 14c6589
Showing
6 changed files
with
257 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
# Large apartness relations | ||
|
||
```agda | ||
module foundation.large-apartness-relations where | ||
``` | ||
|
||
<details><summary>Imports</summary> | ||
|
||
```agda | ||
open import foundation.cartesian-product-types | ||
open import foundation.disjunction | ||
open import foundation.identity-types | ||
open import foundation.large-binary-relations | ||
open import foundation.negated-equality | ||
open import foundation.negation | ||
open import foundation.propositions | ||
open import foundation.universe-levels | ||
``` | ||
|
||
</details> | ||
|
||
## Idea | ||
|
||
A | ||
{{#concept "large apartness relation" WD="apartness relation" WDID=Q4779193 Agda=Large-Apartness-Relation}} | ||
on a family of types indexed by universe levels `A` is a | ||
[large binary relation](foundation.large-binary-relations.md) `R` which is | ||
|
||
- **Antireflexive:** For any `a : A` we have `¬ (R a a)` | ||
- **Symmetric:** For any `a b : A` we have `R a b → R b a` | ||
- **Cotransitive:** For any `a b c : A` we have `R a b → R a c ∨ R b c`. | ||
|
||
This is analogous to the notion of small | ||
[apartness relations](foundation.apartness-relations.md). | ||
|
||
## Definitions | ||
|
||
```agda | ||
record Large-Apartness-Relation | ||
{α : Level → Level} (β : Level → Level → Level) | ||
(A : (l : Level) → UU (α l)) : UUω | ||
where | ||
|
||
field | ||
apart-prop-Large-Apartness-Relation : Large-Relation-Prop β A | ||
antirefl-Large-Apartness-Relation : | ||
is-antireflexive-Large-Relation-Prop A apart-prop-Large-Apartness-Relation | ||
symmetric-Large-Apartness-Relation : | ||
is-symmetric-Large-Relation-Prop A apart-prop-Large-Apartness-Relation | ||
cotransitive-Large-Apartness-Relation : | ||
is-cotransitive-Large-Relation-Prop A apart-prop-Large-Apartness-Relation | ||
|
||
apart-Large-Apartness-Relation : Large-Relation β A | ||
apart-Large-Apartness-Relation a b = | ||
type-Prop (apart-prop-Large-Apartness-Relation a b) | ||
|
||
consistent-Large-Apartness-Relation : | ||
{l : Level} → | ||
(a b : A l) → | ||
a = b → ¬ (apart-Large-Apartness-Relation a b) | ||
consistent-Large-Apartness-Relation a .a refl = | ||
antirefl-Large-Apartness-Relation a | ||
|
||
open Large-Apartness-Relation public | ||
``` | ||
|
||
### Type families equipped with large apartness relations | ||
|
||
```agda | ||
record Type-Family-With-Large-Apartness | ||
(α : Level → Level) (β : Level → Level → Level) : UUω | ||
where | ||
|
||
field | ||
type-family-Type-Family-With-Large-Apartness : (l : Level) → UU (α l) | ||
large-apartness-relation-Type-Family-With-Large-Apartness : | ||
Large-Apartness-Relation β type-family-Type-Family-With-Large-Apartness | ||
|
||
large-rel-Type-Family-With-Large-Apartness : | ||
Large-Relation-Prop β type-family-Type-Family-With-Large-Apartness | ||
large-rel-Type-Family-With-Large-Apartness = | ||
Large-Apartness-Relation.apart-prop-Large-Apartness-Relation | ||
large-apartness-relation-Type-Family-With-Large-Apartness | ||
|
||
open Type-Family-With-Large-Apartness public | ||
``` | ||
|
||
## Properties | ||
|
||
### If two elements are apart, then they are nonequal | ||
|
||
```agda | ||
module _ | ||
{α : Level → Level} {β : Level → Level → Level} | ||
{A : (l : Level) → UU (α l)} (R : Large-Apartness-Relation β A) | ||
where | ||
|
||
nonequal-apart-Large-Apartness-Relation : | ||
{l : Level} {a b : A l} → apart-Large-Apartness-Relation R a b → a ≠ b | ||
nonequal-apart-Large-Apartness-Relation {a = a} p refl = | ||
antirefl-Large-Apartness-Relation R a p | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
# Apartness of real numbers | ||
|
||
```agda | ||
module real-numbers.apartness-real-numbers where | ||
``` | ||
|
||
<details><summary>Imports</summary> | ||
|
||
```agda | ||
open import foundation.apartness-relations | ||
open import foundation.disjunction | ||
open import foundation.empty-types | ||
open import foundation.function-types | ||
open import foundation.identity-types | ||
open import foundation.large-apartness-relations | ||
open import foundation.large-binary-relations | ||
open import foundation.negated-equality | ||
open import foundation.negation | ||
open import foundation.propositions | ||
open import foundation.transport-along-identifications | ||
open import foundation.universe-levels | ||
|
||
open import real-numbers.dedekind-real-numbers | ||
open import real-numbers.strict-inequality-real-numbers | ||
``` | ||
|
||
</details> | ||
|
||
## Idea | ||
|
||
Two [real numbers](real-numbers.dedekind-real-numbers.md) are | ||
[apart](foundation.large-apartness-relations.md) if one is | ||
[strictly less](real-numbers.strict-inequality-real-numbers.md) than the other. | ||
|
||
```agda | ||
module _ | ||
{l1 l2 : Level} | ||
(x : ℝ l1) | ||
(y : ℝ l2) | ||
where | ||
|
||
apart-ℝ-Prop : Prop (l1 ⊔ l2) | ||
apart-ℝ-Prop = le-ℝ-Prop x y ∨ le-ℝ-Prop y x | ||
|
||
apart-ℝ : UU (l1 ⊔ l2) | ||
apart-ℝ = type-Prop apart-ℝ-Prop | ||
``` | ||
|
||
## Properties | ||
|
||
### Apartness is antireflexive | ||
|
||
```agda | ||
antireflexive-apart-ℝ : {l : Level} → (x : ℝ l) → ¬ (apart-ℝ x x) | ||
antireflexive-apart-ℝ x = | ||
elim-disjunction empty-Prop (irreflexive-le-ℝ x) (irreflexive-le-ℝ x) | ||
``` | ||
|
||
### Apartness is symmetric | ||
|
||
```agda | ||
symmetric-apart-ℝ : | ||
{l1 l2 : Level} → (x : ℝ l1) (y : ℝ l2) → apart-ℝ x y → apart-ℝ y x | ||
symmetric-apart-ℝ x y = | ||
elim-disjunction (apart-ℝ-Prop y x) inr-disjunction inl-disjunction | ||
``` | ||
|
||
### Apartness is cotransitive | ||
|
||
```agda | ||
cotransitive-apart-ℝ : is-cotransitive-Large-Relation-Prop ℝ apart-ℝ-Prop | ||
cotransitive-apart-ℝ x y z = | ||
elim-disjunction | ||
( apart-ℝ-Prop x z ∨ apart-ℝ-Prop z y) | ||
( λ x<y → | ||
elim-disjunction | ||
( apart-ℝ-Prop x z ∨ apart-ℝ-Prop z y) | ||
( inl-disjunction ∘ inl-disjunction) | ||
( inr-disjunction ∘ inl-disjunction) | ||
( cotransitive-le-ℝ x y z x<y)) | ||
( λ y<x → | ||
elim-disjunction | ||
( apart-ℝ-Prop x z ∨ apart-ℝ-Prop z y) | ||
( inr-disjunction ∘ inr-disjunction) | ||
( inl-disjunction ∘ inr-disjunction) | ||
( cotransitive-le-ℝ y x z y<x)) | ||
``` | ||
|
||
### Apartness on the reals is a large apartness relation | ||
|
||
```agda | ||
large-apartness-relation-ℝ : Large-Apartness-Relation _⊔_ ℝ | ||
apart-prop-Large-Apartness-Relation large-apartness-relation-ℝ = | ||
apart-ℝ-Prop | ||
antirefl-Large-Apartness-Relation large-apartness-relation-ℝ = | ||
antireflexive-apart-ℝ | ||
symmetric-Large-Apartness-Relation large-apartness-relation-ℝ = | ||
symmetric-apart-ℝ | ||
cotransitive-Large-Apartness-Relation large-apartness-relation-ℝ = | ||
cotransitive-apart-ℝ | ||
``` | ||
|
||
### Apart real numbers are nonequal | ||
|
||
```agda | ||
nonequal-apart-ℝ : {l : Level} (x y : ℝ l) → apart-ℝ x y → x ≠ y | ||
nonequal-apart-ℝ x y = | ||
nonequal-apart-Large-Apartness-Relation large-apartness-relation-ℝ | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters