Homotopy Type Theory decimal numbers > history (Rev #3)

Idea

The decimal numbers as familiar from school mathematics.

Contents

Definition

The type of decimal numbers, denoted [1/10]\mathbb{Z}[1/10], is defined as the higher inductive type generated by:

  • A function ()/10 ():×[1/10](-)/10^{(-)}:\mathbb{Z} \times \mathbb{N} \rightarrow \mathbb{Z}[1/10]. The integer a:a:\mathbb{Z} represents the integer if one ignores the decimal separator in the decimal numeral representation of the decimal number, and the natural number b:b:\mathbb{N} represents the number of digits to the left of the final digit where the decimal separator ought to be placed after in the decimal numeral representation of the decimal number.
  • A dependent product of functions between identities representing that equivalent decimals are equal:
    equivdec: a: b: c: d:(a10 d=c10 b)(a/10 b=c/10 d)equivdec : \prod_{a:\mathbb{Z}} \prod_{b:\mathbb{N}} \prod_{c:\mathbb{Z}} \prod_{d:\mathbb{N}} (a \cdot 10^d = c \cdot 10^b) \to (a/10^b = c/10^d)

    (i.e. 1.00 = 1.000 with decimal numeral representations)

  • A set-truncator
    τ 0: a:[1/10] b:[1/10]isProp(a=b)\tau_0: \prod_{a:\mathbb{Z}[1/10]} \prod_{b:\mathbb{Z}[1/10]} isProp(a=b)

Raw ring structure on the decimal numbers

Zero

We define zero 0:[1/10]0:\mathbb{Z}[1/10] to be the following:

00/10 00 \coloneqq 0/10^0

Addition

We define addition ()+():[1/10]×[1/10][1/10](-)+(-):\mathbb{Z}[1/10] \times \mathbb{Z}[1/10] \to \mathbb{Z}[1/10] to be the following:

a/10 b+c/10 d(a10 d+c10 b)/10 (b+d)a/10^b + c/10^d \coloneqq (a \cdot 10^d + c \cdot 10^b)/10^{(b + d)}

for a:a:\mathbb{Z}, b:b:\mathbb{N}, c:c:\mathbb{Z}, d:d:\mathbb{N}.

Negation

We define negation ():[1/10][1/10]-(-):\mathbb{Z}[1/10] \to \mathbb{Z}[1/10] to be the following:

(a/10 b)(a)/10 b-(a/10^b) \coloneqq (-a)/10^b

for a:a:\mathbb{Z}, b:b:\mathbb{N}.

Subtraction

We define subtraction ()():[1/10]×[1/10][1/10](-)-(-):\mathbb{Z}[1/10] \times \mathbb{Z}[1/10] \to \mathbb{Z}[1/10] to be the following:

a/10 bc/10 d(a10 dc10 b)/10 (b+d)a/10^b - c/10^d \coloneqq (a \cdot 10^d - c \cdot 10^b)/10^{(b + d)}

for a:a:\mathbb{Z}, b:b:\mathbb{N}, c:c:\mathbb{Z}, d:d:\mathbb{N}.

One

We define one 1:[1/10]1:\mathbb{Z}[1/10] to be the following:

11/10 01 \coloneqq 1/10^0

Multiplication

We define multiplication ()():[1/10]×[1/10][1/10](-)\cdot(-):\mathbb{Z}[1/10] \times \mathbb{Z}[1/10] \to \mathbb{Z}[1/10] to be the following:

a/10 bc/10 d(ac)/10 (b+d)a/10^b \cdot c/10^d \coloneqq (a \cdot c)/10^{(b + d)}

for a:a:\mathbb{Z}, b:b:\mathbb{N}, c:c:\mathbb{Z}, d:d:\mathbb{N}.

Exponentiation

We define exponentiation () ():[1/10]×[1/10](-)^{(-)}:\mathbb{Z}[1/10] \times \mathbb{N} \to \mathbb{Z}[1/10] to be the following:

(a/10 b) n(a n)/10 (bn)(a/10^b)^n \coloneqq (a^n)/10^{(b \cdot n)}

for a:a:\mathbb{Z}, b:b:\mathbb{N}, n:n:\mathbb{N}.

Properties

TODO: Show that the decimal numbers are a ordered Heyting integral domain with decidable equality, decidable apartness, and decidable linear order, and that the decimal numbers are a Heyting integral subdomain of the rational numbers.

10 is a unit term.

Thus this is true:

sci: a:[1/10](0<a)× b:(1a10 b)×(a10 b<10)sci : \prod_{a:\mathbb{Z}[1/10]} (0 \lt a) \times \sum_{b:\mathbb{Z}} (1 \leq a \cdot 10^b) \times (a \cdot 10^b \lt 10)

this forms the basis of scientific notation.

See also

Revision on February 27, 2022 at 00:24:20 by Anonymous?. See the history of this page for a list of all contributions to it.