Contents
Context
Type theory
Deduction and Induction
Arithmetic
number theory
number
- natural number, integer number, rational number, real number, irrational number, complex number, quaternion, octonion, adic number, cardinal number, ordinal number, surreal number
arithmetic
arithmetic geometry, function field analogy
Arakelov geometry
Contents
Idea
The decimal numeral representation of the natural numbers as strings of digits as familiar from school mathematics, with mathematical operations directly defined on the strings of digits.
Definition
In type theory
Let be the type of decimal digits, inductively generated by the terms , , , , , , , , , and . The decimal numeral representation of the natural numbers is defined as the higher inductive type generated by the function
the binary operation
the dependent function
and the dependent function
In Coq-syntax the decimal digits and the decimal representation of the natural numbers are the (higher) inductive types defined by
Inductive DecDigits : Type :=
| zero : DecDigits
| one : DecDigits
| two : DecDigits
| three : DecDigits
| four : DecDigits
| five : DecDigits
| six : DecDigits
| seven : DecDigits
| eight : DecDigits
| nine : DecDigits
Inductive Dec : Type :=
| digit : DecDigits -> Dec
| cat : Dec -> Dec -> Dec
| assoc : forall (a,b,c : DecDigits) cat cat a b c == cat a cat b c
| lead-zero : forall (a : Dec) a == cat digit zero a
As a quotient set
Let
be the disjoint union of 10 singletons, with an element and let be the free semigroup on . Then the set of decimal numeral representations of the natural numbers is the quotient set .
Properties
Zero and successor
The decimal numeral representation of the natural numbers is a natural numbers object in Set: We define to be , and we inductively define the successor function as
Inequalities
The denial inequality tight apartness relation called not equal to is inductively defined for decimal numeral representations of the natural numbers in the same way that it is inductively defined for natural numbers:
The total order relation called less than or equal to is inductively defined for decimal numeral representations of the natural numbers in the same way that it is inductively defined for natural numbers:
The opposite total order called greater than or equal to is inductively defined as
The strict linear order relation called less than is inductively defined for decimal numeral representations of the natural numbers in the same way that it is inductively defined for natural numbers:
The opposite strict linear order called greater than is inductively defined as
Number of digits
Each decimal numeral representation has an associated number of digits, a function inductively defined as
and for every decimal numeral representation ,
We define the type of decimal numeral representations with -digits as the fiber of at :
Addition of single digits
Addition of two digits is inductively defined as
+ | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
---|
0 | | | | | | | | | | |
1 | | | | | | | | | | |
2 | | | | | | | | | | |
3 | | | | | | | | | | |
4 | | | | | | | | | | |
5 | | | | | | | | | | |
6 | | | | | | | | | | |
7 | | | | | | | | | | |
8 | | | | | | | | | | |
9 | | | | | | | | | | |
Arithmetic left shifts
There is a binary operation called the arithmetic left shift inductively defined as
This binary operation is also called multiplication by a power of ten.
Arithmetic left shifts of digits is left distributive over addition: given , , and , .
Digit decompositions
Given a decimal numeral representation , there exists functions and such that
and
Addition of general decimal representations
Given a decimal numeral representation such that , the sum of and a digit is defined as
Given two decimal numeral representations of the natural numbers and with and being digits and and being decimal numeral representations, addition is inductively defined as
The decimal numeral representation of the natural numbers is a commutative monoid object in Set:
Addition is left unital:
Addition is right unital:
See also