Contents
Context
Type theory
Deduction and Induction
Foundations
foundations
The basis of it all
-
mathematical logic
-
deduction system, natural deduction, sequent calculus, lambda-calculus, judgment
-
type theory, simple type theory, dependent type theory
-
collection, object, type, term, set, element
-
equality, judgmental equality, typal equality
-
universe, size issues
-
higher-order logic
Set theory
Foundational axioms
Removing axioms
Contents
Idea
In type theory: the integers type is the type of integers.
Definitions
As the inductive type generated by an element and an equivalence of types
Assuming that identification types, equivalence types and dependent product types exist in the type theory, the integers type is the inductive type generated by an element and an equivalence of types:
Formation rules for the integers type:
Introduction rules for the integers type:
Elimination rules for the integers type:
Computation rules for the integers type:
- Judgmental computation rules
Uniqueness rules for the integers type:
- Judgmental uniqueness rules
The elimination, computation, and uniqueness rules for the integers type state that the integers type satisfy the dependent universal property of the integers. If the dependent type theory also has dependent sum types and product types, allowing one to define the uniqueness quantifier, the dependent universal property of the integers could be simplified to the following rule:
As the underlying type of the free infinity-group on the unit type
The integers type is the underlying type of free infinity-group on the unit type
As the loop space of the circle type
Given a dependent type theory with identity types, equivalence types, a univalent universe, and the circle type which is an essentially small type relative to the universe universe, the type of integers is defined as the loop space type of the circle type at the canonical element :
As a quotient of a product type
Definition
The integers type is defined as the higher inductive type generated by:
- A function .
- An identity representing that positive and negative zero are equal: .
Definition
The integers type is defined as the higher inductive type generated by:
- A function .
- A dependent product of functions between identities representing that equivalent differences are equal:
- A set-truncator
Properties
We assume in this section that the integers type is defined as the inductive type generated by an element and an equivalence of types.
Extensionality principle of the integers type
By the recursion principle of the natural numbers, there is a function
which takes zero of the natural numbers to zero of the integers and the successor function of the natural numbrers to the successor equivalence of the integers, where is the first projection function of the dependent sum type . The extensionality principle of the circle type states that the above function is an embedding of types,
or equivalently that application of the above function is an equivalence for all natural numbers ,
Theorem
The integers type has decidable equality.
Double induction
From the inference rules for the integers type, one could derive the following rules for double induction, which is important for the definition of addition, subtraction, and multiplication on the integers:
Addition on the integers
Definition
The binary operation addition is defined by double induction, where the type family is the constant type family , is , and are both the constant function which takes integers to the successor equivalence, and is the constant function which takes pairs of integers to the composition of the successor equivalence with itself, and is defined pointwise as
We have similar definitions for the computation rules of addition:
Theorem
The integers type is a non-coherent H-space with respect to the zero integer found in the introduction rule of the integers type and addition defined above.
Proof
We define the homotopies for the H-space structure of the integers type by induction on the integers type. For the case with the element , one gets the identity from the rules for addition. For the case with the equivalence , the application to is itself a dependent function of a family of equivalences,
Substituting and in for yields the family of equivalences
and by the introduction rule of dependent product types, one gets the dependent functions of families of equivalences
and by the elimination rules for the integers type, one has families of identifications
By the introduction rule of dependent product types, one gets homotopies
Thus, the integers type is a non-coherent H-space.
Theorem
The integers type is an associative non-coherent H-space.
Theorem
The integers type is invertible with respect to the H-space structure of addition - such that given an integer , left addition and right addition by is each an equivalence of types.
Corollary
The integers type is a non-coherent H-group, a non-coherent H-space which is invertible and associative.
Theorem
The integers type is non-coherently abelian with respect to addition.
Negation on the integers
Definition
The unary operation negation is defined by induction on the integers type, where the type family is the constant type family , is , and is the constant function which takes integers to the inverse of the successor equivalence, and is defined pointwise as
We have similar definitions for the computation rules of negation:
Subtraction on the integers
Definition
The binary operation subtraction is defined by double induction, where the type family is the constant type family , is , is the constant function which takes integers to the inverse of the successor equivalence, is the constant function which takes integers to the successor equivalence, and is the constant function which takes pairs of integers to the identity equivalence on the integers, and is defined pointwise as
We have similar definitions for the computation rules of subtraction:
Theorem
For all and , we have an identification of type
Set-truncation structure
To do: figure out a way to prove that the integers type is 0-truncated without using the natural numbers type. Then we define the natural numbers type as the quotient of the integers type by its group of units .
Theorem
The natural numbers type and the integers type are equivalent to each other.
Corollary
The integers type are an abelian group.
Proof
Since is 0-truncated, and equivalences preserve truncatedness, by the equivalence , is also 0-truncated. Since is an non-coherently abelian H-group, this implies that is a abelian group.
Multiplication on the integers
To do: figure out a way to prove the various properties of multiplication without using the fact that the integers are a set (i.e. the integers are a non-coherently abelian H-ring).
Definition
Since the integers are a non-coherently abelian H-group with respect to addition, right addition by an integer , , is an equivalence.
The binary operation multiplication is defined by double induction, where the type family is the constant type family , is , and are both the constant function which takes integers to the identity equivalence on the integers, and is the function which takes pairs of integers to the equivalence , and is defined pointwise as
We have similar definitions for the computation rules of multiplication:
Theorem
The integers type is an absorption magma with respect to the zero integer and multiplication defined above.
Proof
We begin with the left absorption law, that for all . By the computation rules for the integers type, we have
Then we need to show that for all we have an equivalence
But that’s given by transport across the identification
for the type family :
Thus, by induction on the integers, we have
Similarly, for the right absorption law, we have an equivalence
given by transport across the identification
for the type family :
Thus, by induction on the integers, we have
Thus, the integers are an absorption magma with respect to zero and multiplication.
Theorem
Multiplication in the integers type is bilinear with respect to addition.
Proof
We begin with bilinearity in the right parameter of multiplication, and we prove by double induction on the integers: given an integer , we need to show the following types have elements:
Now, for the first type, by application of the function on the identification , we have
Similarly, by the right absorption law of multiplication, we have
and by application of the function across , we have
By the right unit law for addition, we have
Thus, by concatenating identifications we have
Next, we need to show that for all there is an equivalence of types
By transport across the identification for type families
and
we get equivalences
and
Similarly, by transport across the identification
for type family
we get the equivalence
and by transport across the identification
for type family
we get the equivalence
By transport across the identification
for type family
we get the equivalence
and by transport across the identification
for type family
we get the equivalence
Thus, it remains to show that there is an equivalence
But since is a set, both identity types are propositions, and have elements and respectively. As a result, both identity types are contractible types, and contractible types are equivalent to each other. Thus, we have an equivalence:
Finally, by composing all the equivalences above, we get an equivalence
By a similar argument, we have
Finally, we need to show that for all and there is an equivalence of types
…
Definition
The integer number one is defined as
Theorem
The integers type is a unital magma with respect to the one integer and multiplication both defined above.
Proof
We begin with the right unital laws, that . By the computation rules for the integers type, we have
Concatenating with results in the required identification
Then we need to show that for all we have an equivalence
We have the family of identifications
Since multiplication is an absorption magma, we have identifications
so application of the function to the above identification results in the identification
The left unit law for addition results in
and application of the successor equivalence to the right unit law results in
Concatenating all the identifications leads to the identification
Similarly, by substituting in for in the above expression, we have
In addition, we have the right inverse homotopy
so by transport across the identity for the type family , we also have the equivalence
Thus, we have the identification
Since is a set, the identity types and are both propositions, and since they have identifications, both types are contractible types. All contractible types are equivalent to each other; thus there is an equivalence
Then, by induction on the integers, there is the homotopy
Next, we derive the left unital laws, that . By the computation rules for the integers type, we have
Concatenating with results in the required identification
Then we need to show that for all we have an equivalence
We have the family of identifications
Since multiplication is an absorption magma, we have identifications
so application of the function to the above identification results in the identification
The left unit law for addition results in
and application of the successor equivalence to the left unit law results in
Concatenating all the identifications leads to the identification
Similarly, by substituting in for in the above expression, we have
In addition, we have the right inverse homotopy
so by transport across the identity for the type family , we also have the equivalence
Thus, we have the identification
Since is a set, the identity types and are both propositions, and since they have identifications, both types are contractible types. All contractible types are equivalent to each other; thus there is an equivalence
Then, by induction on the integers, there is the homotopy
Thus, is a unital magma with respect to one and multiplication .
Theorem
Multiplication on the integers is associative.
Theorem
Multiplication on the integers is commutative.
Exponentiation on the integers
Definition
The binary operation exponentiation is defined by induction on the natural numbers
Introduction rules for exponentiation:
Computation rules for exponentiation:
Definition
The inclusion of the natural numbers in the integers is inductively defined by induction on the natural numbers
Introduction rules for natural number inclusion:
Computation rules for natural number inclusion:
Decidability of equality
Perhaps it is time to prove that equality is decidable on the integers.
Definition
The observational equality relation is defined by double induction on the integers
Formation rules for observational equality:
Definition rules for observational equality:
The following rules only hold if the universe has a univalent universe:
Order structure on the integers
Given a type family , we define the existential quantifier as the propositional truncation of the dependent sum type . Given two types and , we define the disjunction as the propositional truncation of the sum type .
Definition
The predicate is less than, denoted as , is defined as
for , .
Definition
The predicate is greater than, denoted as , is defined as
for , .
Definition
The predicate is apart from, denoted as , is defined as
for , .
Definition
The predicate is less than or equal to, denoted as , is defined as
for , .
Definition
The predicate is greater than or equal to, denoted as , is defined as
for , .
Definition
The predicate is positive, denoted as , is defined as
for .
Definition
The predicate is negative, denoted as , is defined as
for .
Definition
The predicate is zero, denoted as , is defined as
for .
Definition
The predicate is non-positive, denoted as , is defined as
for .
Definition
The predicate is non-negative, denoted as , is defined as
for .
Definition
The predicate is non-zero, denoted as , is defined as
for .
Pseudolattice and metric structure on the integers
Definition
The ramp function is defined as
for .
Definition
The minimum is defined as
for , .
Definition
The maximum is defined as
for , .
Definition
The metric is defined as
for , .
Definition
The absolute value is defined as
for .
Division and remainder
Definition
Integer division is defined as
for , .
Categorical semantics
The categorical semantics of the integers type is the integers object.
See also
References
For definitions as a higher inductive type in homotopy type theory, see:
A few more definitions of the integers, as well as the statement of the dependent universal property of the integers, could be found in:
Some terms about specific kinds of H-spaces used to prove properties of the integers are defined in:
A formalization in terms of homotopy type theory, using a unary notation, is in
(A different common formalization of integers in type theory is in a binary notation, as in the Coq standard library. Binary notation is exponentially more efficient for performing computations, but the unary notation was convenient for calculating .)
That one can construct the natural numbers type from the integers type can be found in: