nLab real numbers type

Context

Type theory

natural deduction metalanguage, practical foundations

  1. type formation rule
  2. term introduction rule
  3. term elimination rule
  4. computation rule

type theory (dependent, intensional, observational type theory, homotopy type theory)

syntax object language

computational trinitarianism =
propositions as types +programs as proofs +relation type theory/category theory

logicset theory (internal logic of)category theorytype theory
propositionsetobjecttype
predicatefamily of setsdisplay morphismdependent type
proofelementgeneralized elementterm/program
cut rulecomposition of classifying morphisms / pullback of display mapssubstitution
introduction rule for implicationcounit for hom-tensor adjunctionlambda
elimination rule for implicationunit for hom-tensor adjunctionapplication
cut elimination for implicationone of the zigzag identities for hom-tensor adjunctionbeta reduction
identity elimination for implicationthe other zigzag identity for hom-tensor adjunctioneta conversion
truesingletonterminal object/(-2)-truncated objecth-level 0-type/unit type
falseempty setinitial objectempty type
proposition, truth valuesubsingletonsubterminal object/(-1)-truncated objecth-proposition, mere proposition
logical conjunctioncartesian productproductproduct type
disjunctiondisjoint union (support of)coproduct ((-1)-truncation of)sum type (bracket type of)
implicationfunction set (into subsingleton)internal hom (into subterminal object)function type (into h-proposition)
negationfunction set into empty setinternal hom into initial objectfunction type into empty type
universal quantificationindexed cartesian product (of family of subsingletons)dependent product (of family of subterminal objects)dependent product type (of family of h-propositions)
existential quantificationindexed disjoint union (support of)dependent sum ((-1)-truncation of)dependent sum type (bracket type of)
logical equivalencebijection setobject of isomorphismsequivalence type
support setsupport object/(-1)-truncationpropositional truncation/bracket type
n-image of morphism into terminal object/n-truncationn-truncation modality
equalitydiagonal function/diagonal subset/diagonal relationpath space objectidentity type/path type
completely presented setsetdiscrete object/0-truncated objecth-level 2-type/set/h-set
setset with equivalence relationinternal 0-groupoidBishop set/setoid with its pseudo-equivalence relation an actual equivalence relation
equivalence class/quotient setquotientquotient type
inductioncolimitinductive type, W-type, M-type
higher inductionhigher colimithigher inductive type
-0-truncated higher colimitquotient inductive type
coinductionlimitcoinductive type
presettype without identity types
set of truth valuessubobject classifiertype of propositions
domain of discourseuniverseobject classifiertype universe
modalityclosure operator, (idempotent) monadmodal type theory, monad (in computer science)
linear logic(symmetric, closed) monoidal categorylinear type theory/quantum computation
proof netstring diagramquantum circuit
(absence of) contraction rule(absence of) diagonalno-cloning theorem
synthetic mathematicsdomain specific embedded programming language

homotopy levels

semantics

Analysis

Contents

Idea

There are many possible definitions of the (two-sided, Dedekind) real numbers type in dependent type theory. If the dependent type theory has a type universe or a type of all propositions, then one can translate the impredicative definition of the Dedekind real numbers over to dependent type theory.

However, in dependent type theory without a type universe or a type of all propositions, the impredicative definition of the Dedekind real numbers no longer works. Nonetheless, it is possible to define the type of real numbers \mathbb{R} via inference rules as a type with a type family of domains of the structural Dedekind cut associated with each real number.

Definitions

We shall assume the minimum amount of type formers in dependent type theory to define Dedekind cuts of the rational numbers:

The types in the dependent type theory form the (infinity,1)-categorical version of a Heyting category with exponential objects and a natural numbers object.

In addition, if one has a type of all propositions Prop\mathrm{Prop} in the dependent type theory, one can define the type of real numbers as the type of all (two-sided) Dedekind cuts, which are subtypes or predicates C:(𝟚×)PropC:(\mathbb{2} \times \mathbb{Q}) \to \mathrm{Prop} of the product type 𝟚×\mathbb{2} \times \mathbb{Q} which satisfy the following axioms:

  • Dedekind cuts are bounded:

    q:.C(0,q)r:.C(1,r)\exists q:\mathbb{Q}.C(0, q) \quad \exists r:\mathbb{Q}.C(1, r)
  • Dedekind cuts are rounded:

    q:C(0,q))r:.(q<r)×C(0,r))\prod_{q:\mathbb{Q}} C(0, q)) \simeq \exists r:\mathbb{Q}.(q \lt r) \times C(0, r))
    r:C(1,r))q:.(q<r)×C(1,q))\prod_{r:\mathbb{Q}} C(1, r)) \simeq \exists q:\mathbb{Q}.(q \lt r) \times C(1, q))
  • Dedekind cuts are disjoint:

    q:¬(C(0,q))×C(1,q)))\prod_{q:\mathbb{Q}} \neg (C(0, q)) \times C(1, q)))
  • Dedekind cuts are located:

    q: r:(q<r)(C(0,q))C(1,r))\prod_{q:\mathbb{Q}} \prod_{r:\mathbb{Q}} (q \lt r) \to (C(0, q)) \vee C(1, r))

Usually, Dedekind cuts are presented as pairs of predicates (L,U):(Prop)×(Prop)(L, U):(\mathbb{Q} \to \mathrm{Prop}) \times (\mathbb{Q} \to \mathrm{Prop}), but this is equivalent to the above definition, since for any types AA, BB, and CC, one has that

((A+B)C)(AC)×(BC)((A + B) \to C) \simeq (A \to C) \times (B \to C)

and for any type AA, one has that

(A+A)(𝟚×A)(A + A) \simeq (\mathbb{2} \times A)

The predicate isCut(C)\mathrm{isCut}(C) is defined as the product of all the axioms above, and the type of real numbers is defined as

C:(𝟚×)PropisCut(C)\mathbb{R} \coloneqq \sum_{C:(\mathbb{2} \times \mathbb{Q}) \to \mathrm{Prop}} \mathrm{isCut}(C)

In dependent type theory with a type universe UU, one can take the type of all UU-small propositions by the dependent sum type

Prop U A:UisProp(A)\mathrm{Prop}_U \coloneqq \sum_{A:U} \mathrm{isProp}(A)

and define locally UU-small Dedekind cuts C:(𝟚×)Prop UC:(\mathbb{2} \times \mathbb{Q}) \to \mathrm{Prop}_U and the (locally UU-small) real numbers U\mathbb{R}_U using Prop U\mathrm{Prop}_U.

So, what happens if the dependent type theory has neither a type of all propositions nor a type universe, so that we are working in fully predicative mathematics? It is no longer possible to quantify over all subtypes of 𝟚×\mathbb{2} \times \mathbb{Q}, so one cannot define the type of real numbers impredicatively. Also, without impredicativity, a subtype of the sum type 𝟚×\mathbb{2} \times \mathbb{Q} is a type CC with an embedding of types e:C(𝟚×)e:C \hookrightarrow (\mathbb{2} \times \mathbb{Q}). One can show from the definition of embedding that given an element x:𝟚×x:\mathbb{2} \times \mathbb{Q}, the fiber type of ee at xx is a mere proposition

isProp( z:Ce(z)= 𝟚×x)\mathrm{isProp}\left(\sum_{z:C} e(z) =_{\mathbb{2} \times \mathbb{Q}} x\right)

so everywhere in the definition above where one would have used the type family C(x)C(x) one can instead use the dependent sum type fiber(e,x) z:Ce(z)= 𝟚×x\mathrm{fiber}(e, x) \coloneqq \sum_{z:C} e(z) =_{\mathbb{2} \times \mathbb{Q}} x.

Then a Dedekind cut consists of a type CC with an embedding of types e:C(𝟚×)e:C \hookrightarrow (\mathbb{2} \times \mathbb{Q}), which satisfies the following axioms:

  • Dedekind cuts are bounded:

    q:.fiber(e,(0,q))r:.fiber(e,(1,r))\exists q:\mathbb{Q}.\mathrm{fiber}(e, (0, q)) \quad \exists r:\mathbb{Q}.\mathrm{fiber}(e, (1, r))
  • Dedekind cuts are rounded:

    q:fiber(e,(0,q))r:.(q<r)×fiber(e,(0,r))\prod_{q:\mathbb{Q}} \mathrm{fiber}(e, (0, q)) \simeq \exists r:\mathbb{Q}.(q \lt r) \times \mathrm{fiber}(e, (0, r))
    r:fiber(e,(1,r))q:.(q<r)×fiber(e,(1,q))\prod_{r:\mathbb{Q}} \mathrm{fiber}(e, (1, r)) \simeq \exists q:\mathbb{Q}.(q \lt r) \times \mathrm{fiber}(e, (1, q))
  • Dedekind cuts are disjoint:

    q:¬(fiber(e,(0,q))×fiber(e,(1,q)))\prod_{q:\mathbb{Q}} \neg (\mathrm{fiber}(e, (0, q)) \times \mathrm{fiber}(e, (1, q)))
  • Dedekind cuts are located:

    q: r:(q<r)(fiber(e,(0,q))fiber(e,(1,r))\prod_{q:\mathbb{Q}} \prod_{r:\mathbb{Q}} (q \lt r) \to (\mathrm{fiber}(e, (0, q)) \vee \mathrm{fiber}(e, (1, r))

The predicate isCut(C,e)\mathrm{isCut}(C, e) is defined as the product of all the axioms above, and the type of all Dedekind cuts with domain CC is given by the dependent sum type

Cuts(C) e:C𝟚×isCut(C,e)\mathrm{Cuts}(C) \coloneqq \sum_{e:C \hookrightarrow \mathbb{2} \times \mathbb{Q}} \mathrm{isCut}(C, e)

If there existed a type universe, one can simply define the real numbers as the type of Dedekind cuts in UU;

U C:UCuts(C)\mathbb{R}_U \coloneqq \sum_{C:U} \mathrm{Cuts}(C)

However, while there is no type universe UU, one can add inference rules for the type of real numbers \mathbb{R} such that \mathbb{R} behaves as the dependent sum type C:UCuts(C)\sum_{C:U} \mathrm{Cuts}(C) if the hypothetical UU contained every single type in the type theory.

Formation rules for the real numbers type:

ΓctxΓtype\frac{\Gamma \; \mathrm{ctx}}{\Gamma \vdash \mathbb{R} \; \mathrm{type}}

Introduction rules for real numbers type:

ΓCtypeΓinR C:Cuts(C)\frac{\Gamma \vdash C \; \mathrm{type}}{\Gamma \vdash \mathrm{inR}_C:\mathrm{Cuts}(C) \to \mathbb{R}}

Elimination rules for real numbers type:

ΓctxΓ,x:CutDomain(x)typeΓctxΓ,x:cut(x):Cuts(CutDomain(x))\frac{\Gamma \; \mathrm{ctx}}{\Gamma, x:\mathbb{R} \vdash \mathrm{CutDomain}(x) \; \mathrm{type}} \quad \frac{\Gamma \; \mathrm{ctx}}{\Gamma, x:\mathbb{R} \vdash \mathrm{cut}(x):\mathrm{Cuts}(\mathrm{CutDomain}(x))}

Computation rules for real numbers type:

ΓCtypec:Cuts(C)ΓCutDomain(inR C(c))CtypeΓCtypec:Cuts(C)Γcut(inR C(c))c:Cuts(C)\frac{\Gamma \vdash C \; \mathrm{type} \quad c:\mathrm{Cuts}(C)}{\Gamma \vdash \mathrm{CutDomain}(\mathrm{inR}_C(c)) \equiv C \; \mathrm{type}} \quad \frac{\Gamma \vdash C \; \mathrm{type} \quad c:\mathrm{Cuts}(C)}{\Gamma \vdash \mathrm{cut}(\mathrm{inR}_C(c)) \equiv c:\mathrm{Cuts}(C)}

Uniqueness rules for real numbers type:

ΓctxΓ,x:inR CutDomain(x)(cut(x))x:Cuts(CutDomain(x))\frac{\Gamma \; \mathrm{ctx}}{\Gamma, x:\mathbb{R} \vdash \mathrm{inR}_{\mathrm{CutDomain}(x)}(\mathrm{cut}(x)) \equiv x:\mathrm{Cuts}(\mathrm{CutDomain}(x))}

The inference rules for the real numbers type imply that the real numbers type are a Tarski universe with universal type family CutDomain(x)\mathrm{CutDomain}(x) indexed by x:x:\mathbb{R}, where CutDomain(x)\mathrm{CutDomain}(x) is the domain of the Dedekind cut

cut(x):CutDomain(x)(𝟚×)\mathrm{cut}(x):\mathrm{CutDomain}(x) \hookrightarrow (\mathbb{2} \times \mathbb{Q})

associated with the real number x:x:\mathbb{R}. This makes the real numbers type similar to other type universes such as the type of all propositions or the type of finite types.

As a terminal object

An Archimedean ordered field can be defined in any dependent type theory with the following types:

Then the real numbers type R\mathbf{R} is the homotopy terminal Archimedean ordered field.

If the dependent type theory has quotient sets, then it is provable that R\mathbf{R} is Cauchy complete. From the definition of homotopy terminal Archimedean ordered field, R\mathbf{R} is an algebra of the endofunctor X𝒞(X)X \mapsto \mathcal{C}(X) which takes Archimedean ordered fields XX to the Archimedean ordered field 𝒞(X)\mathcal{C}(X) of equivalence classes of Cauchy sequences in XX. Every algebra of the endofunctor X𝒞(X)X \mapsto \mathcal{C}(X) in the type of Archimedean ordered field is a Cauchy complete Archimedean ordered field.

Similarly, if power sets of Archimedean ordered fields exist, then it is provable that R\mathbf{R} is Dedekind complete. From the definition of homotopy terminal Archimedean field, R\mathbf{R} is an algebra of the endofunctor X𝒟(X)X \mapsto \mathcal{D}(X) which takes Archimedean ordered fields XX to the Archimedean ordered field 𝒞(X)\mathcal{C}(X) of two-sided Dedekind cuts in XX. Every algebra of the endofunctor X𝒟(X)X \mapsto \mathcal{D}(X) in the type of Archimedean ordered field is a Dedekind complete Archimedean ordered field.

If a real numbers type RR as defined in the previous section also exists, then it is a subtype of this real numbers type \mathbb{R} defined as the terminal Archimedean ordered field, since RR is provably Archimedean ordered, and any ring homomorphisms between two field objects is an embedding of types, and by definition of terminal object, there is always a ring homomorphism RR \to \mathbb{R}.

Properties

The type of real numbers is the Coquand universe of all Dedekind cuts. Since real numbers and Dedekind cuts are interdefinable via the rules of Coquand universes, we shall just be directly defining the algebraic operations and order relations on Dedekind cuts; the corresponding operations on real numbers follow from the rules of Coquand universes.

Algebraic structure on real numbers

Definition

Addition of two Dedekind cuts (C,e C)(C, e_C) and (D,e D)(D, e_D) is given by the type

C+D (b,q):𝟚×r,s:.fiber(e C,(b,r))×fiber(e D,(b,s))×(q= r+s)C + D \coloneqq \sum_{(b, q):\mathbb{2} \times \mathbb{Q}} \exists r, s:\mathbb{Q}.\mathrm{fiber}(e_C, (b, r)) \times \mathrm{fiber}(e_D, (b, s)) \times (q =_\mathbb{Q} r + s)

with the embedding e C+De_{C + D} given by the first projection function of the dependent sum type into the product type 𝟚×\mathbb{2} \times \mathbb{Q}.

The swap function swap:𝟚𝟚\mathrm{swap}:\mathbb{2} \to \mathbb{2} on the booleans is inductively defined by swap(0)1\mathrm{swap}(0) \coloneqq 1 and swap(1)0\mathrm{swap}(1) \coloneqq 0.

Definition

The additive inverse of a Dedekind cut (C,e C)(C, e_C) is given by the type

C (b,q):𝟚×r:.fiber(e C,(swap(b),r))×(q= r)-C \coloneqq \sum_{(b, q):\mathbb{2} \times \mathbb{Q}} \exists r:\mathbb{Q}.\mathrm{fiber}(e_C, (\mathrm{swap}(b), r)) \times (q =_\mathbb{Q} -r)

with the embedding e Ce_{-C} given by the first projection function of the dependent sum type into the product type 𝟚×\mathbb{2} \times \mathbb{Q}.

With these operations, the real numbers form an abelian group.

References

For the impredicative definition of the real numbers using a type of propositions, as well as the algebraic operations and order relations for real numbers see section 11.2 of:

Last revised on September 26, 2024 at 21:01:44. See the history of this page for a list of all contributions to it.