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{Q} + \mathbb{Q}) \to \mathrm{Prop} of the sum type +\mathbb{Q} + \mathbb{Q} which satisfy the following axioms:

  • Dedekind cuts are bounded:

    q:.C(inl(q))r:.C(inr(r))\exists q:\mathbb{Q}.C(\mathrm{inl}(q)) \quad \exists r:\mathbb{Q}.C(\mathrm{inr}(r))
  • Dedekind cuts are rounded:

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

    q:¬(C(inl(q))×C(inl(r)))\prod_{q:\mathbb{Q}} \neg (C(\mathrm{inl}(q)) \times C(\mathrm{inl}(r)))
  • Dedekind cuts are located:

    q: r:(q<r)(C(inl(q))C(inr(r))\prod_{q:\mathbb{Q}} \prod_{r:\mathbb{Q}} (q \lt r) \to (C(\mathrm{inl}(q)) \vee C(\mathrm{inr}(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)

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{Q} + \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{Q} + \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{Q} + \mathbb{Q}, so one cannot define the type of real numbers impredicatively. Also, without impredicativity, a subtype of the sum type +\mathbb{Q} + \mathbb{Q} is a type CC with an embedding of types e:C(+)e:C \hookrightarrow (\mathbb{Q} + \mathbb{Q}). One can show from the definition of embedding that given an element x:+x:\mathbb{Q} + \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{Q} + \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{Q} + \mathbb{Q}} x.

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

  • Dedekind cuts are bounded:

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

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

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

    q: r:(q<r)(fiber(e,inl(q))fiber(e,inr(r))\prod_{q:\mathbb{Q}} \prod_{r:\mathbb{Q}} (q \lt r) \to (\mathrm{fiber}(e, \mathrm{inl}(q)) \vee \mathrm{fiber}(e, \mathrm{inr}(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{Q} + \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{Q} + \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

Algebraic structure on real numbers

One can add two Dedekind cuts together; this involves adding inference rules for adding the two domains of the Dedekind cuts as well as for adding the embeddings of the Dedekind cuts. The rules for adding the witnesses that the embeddings are Dedekind cuts are provable from the fact that the type isCut(A,e A)\mathrm{isCut}(A, e_A) is always a mere proposition, and so if inhabited, then it is contractible, so are not included.

The formation rules for addition of two Dedekind cuts are as follows:

ΓAtypeΓBtype Γe A:A(+)Γe B:B(+) Γc A:isCut(A,e A)Γc B:isCut(B,e B)ΓA+ (e A,c A),(e B,c B)Btype\frac{ \begin{array}{c} \Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \\ \Gamma \vdash e_A:A \hookrightarrow (\mathbb{Q} + \mathbb{Q}) \quad \Gamma \vdash e_B:B \hookrightarrow (\mathbb{Q} + \mathbb{Q}) \\ \Gamma \vdash c_A:\mathrm{isCut}(A, e_A) \quad \Gamma \vdash c_B:\mathrm{isCut}(B, e_B) \end{array}}{\Gamma \vdash A +_{(e_A, c_A), (e_B, c_B)} B \; \mathrm{type}}
ΓAtypeΓBtype Γe A:A(+)Γe B:B(+) Γc A:isCut(A,e A)Γc B:isCut(B,e B)Γe A+e B:(A+ (e A,c A),(e B,c B)B)(+)\frac{ \begin{array}{c} \Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \\ \Gamma \vdash e_A:A \hookrightarrow (\mathbb{Q} + \mathbb{Q}) \quad \Gamma \vdash e_B:B \hookrightarrow (\mathbb{Q} + \mathbb{Q}) \\ \Gamma \vdash c_A:\mathrm{isCut}(A, e_A) \quad \Gamma \vdash c_B:\mathrm{isCut}(B, e_B) \end{array}}{\Gamma \vdash e_A + e_B:(A +_{(e_A, c_A), (e_B, c_B)} B) \hookrightarrow (\mathbb{Q} + \mathbb{Q})}

In addition, we have rules defining the addition of two embeddings of Dedekind cuts:

ΓAtypeΓBtype Γe A:A(+)Γe B:B(+) Γc A:isCut(A,e A)Γc B:isCut(B,e B)Γ,q:fib(e A+e B,inl(q))r,s:.fib(e A,inl(r))fib(e B,inl(s))q=r+stype\frac{ \begin{array}{c} \Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \\ \Gamma \vdash e_A:A \hookrightarrow (\mathbb{Q} + \mathbb{Q}) \quad \Gamma \vdash e_B:B \hookrightarrow (\mathbb{Q} + \mathbb{Q}) \\ \Gamma \vdash c_A:\mathrm{isCut}(A, e_A) \quad \Gamma \vdash c_B:\mathrm{isCut}(B, e_B) \end{array}}{\Gamma, q:\mathbb{Q} \vdash \mathrm{fib}(e_A + e_B, \mathrm{inl}(q)) \equiv \exists r, s:\mathbb{Q}.\mathrm{fib}(e_A, \mathrm{inl}(r)) \wedge \mathrm{fib}(e_B, \mathrm{inl}(s)) \wedge q = r + s \; \mathrm{type}}
ΓAtypeΓBtype Γe A:A(+)Γe B:B(+) Γc A:isCut(A,e A)Γc B:isCut(B,e B)Γ,q:fib(e A+e B,inr(q))r,s:.fib(e A,inr(r))fib(e B,inr(s))q=r+stype\frac{ \begin{array}{c} \Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \\ \Gamma \vdash e_A:A \hookrightarrow (\mathbb{Q} + \mathbb{Q}) \quad \Gamma \vdash e_B:B \hookrightarrow (\mathbb{Q} + \mathbb{Q}) \\ \Gamma \vdash c_A:\mathrm{isCut}(A, e_A) \quad \Gamma \vdash c_B:\mathrm{isCut}(B, e_B) \end{array}}{\Gamma, q:\mathbb{Q} \vdash \mathrm{fib}(e_A + e_B, \mathrm{inr}(q)) \equiv \exists r, s:\mathbb{Q}.\mathrm{fib}(e_A, \mathrm{inr}(r)) \wedge \mathrm{fib}(e_B, \mathrm{inr}(s)) \wedge q = r + s \; \mathrm{type}}

as well as rules defining the addition of two domains of Dedekind cuts:

ΓAtypeΓBtype Γe A:A(+)Γe B:B(+) Γc A:isCut(A,e A)Γc B:isCut(B,e B)ΓA+ (e A,c A),(e B,c B)B q:fib(e A+e B,rec +(inl(q),inr(q)))type\frac{ \begin{array}{c} \Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B \; \mathrm{type} \\ \Gamma \vdash e_A:A \hookrightarrow (\mathbb{Q} + \mathbb{Q}) \quad \Gamma \vdash e_B:B \hookrightarrow (\mathbb{Q} + \mathbb{Q}) \\ \Gamma \vdash c_A:\mathrm{isCut}(A, e_A) \quad \Gamma \vdash c_B:\mathrm{isCut}(B, e_B) \end{array}}{\Gamma \vdash A +_{(e_A, c_A), (e_B, c_B)} B \equiv \sum_{q:\mathbb{Q}} \mathrm{fib}(e_A + e_B, \mathrm{rec}_{\mathbb{Q} + \mathbb{Q}}(\mathrm{inl}(q), \mathrm{inr}(q))) \; \mathrm{type}}

Then given two real numbers x:x:\mathbb{R} and y:y:\mathbb{R}, addition on the real numbers is defined as

x+yinR CutDomain(x)+ cut(x),cut(y)CutDomain(y)(cut(x)+cut(y)):x + y \coloneqq \mathrm{inR}_{\mathrm{CutDomain}(x) +_{\mathrm{cut}(x), \mathrm{cut}(y)} \mathrm{CutDomain}(y)}(\mathrm{cut}(x) + \mathrm{cut}(y)):\mathbb{R}

References

For the impredicative definition of the real numbers using a type of propositions, see section 11.2 of:

Last revised on January 18, 2024 at 02:09:57. See the history of this page for a list of all contributions to it.