2.13 Natural numbers
We use the encode-decode method to characterize the path space of the natural numbers, which are also a positive type.
In this case, rather than fixing one endpoint, we characterize the two-sided path space all at once.
Thus, the codes for identities are a type family
πΌππ½πΎ:ββββπ°, |
defined by double recursion over β as follows:
πΌππ½πΎ(0,0) | :β‘π | ||
πΌππ½πΎ(πππΌπΌ(m),0) | :β‘π | ||
πΌππ½πΎ(0,πππΌπΌ(n)) | :β‘π | ||
πΌππ½πΎ(πππΌπΌ(m),πππΌπΌ(n)) | :β‘πΌππ½πΎ(m,n). |
We also define by recursion a dependent function r:β(n:β)πΌππ½πΎ(n,n), with
r(0) | :β‘β | ||
r(πππΌπΌ(n)) | :β‘r(n). |
Theorem 2.13.1.
For all m,n:N we have (m=n)βcode(m,n).
Proof.
We define
πΎππΌππ½πΎ:βm,n:β(m=n)βπΌππ½πΎ(m,n) |
by transporting, πΎππΌππ½πΎ(m,n,p):β‘πππΊπππππππΌππ½πΎ(m,β)(p,r(m)). And we define
π½πΎπΌππ½πΎ:βm,n:βπΌππ½πΎ(m,n)β(m=n) |
by double induction on m,n.
When m and n are both 0, we need a function πβ(0=0), which we define to send everything to ππΎπΏπ
0.
When m is a successor
and n is 0 or vice versa, the domain πΌππ½πΎ(m,n) is π, so the eliminator for π suffices.
And when both are successors, we can define π½πΎπΌππ½πΎ(πππΌπΌ(m),πππΌπΌ(n)) to be the composite
πΌππ½πΎ(πππΌπΌ(m),πππΌπΌ(n))β‘πΌππ½πΎ(m,n)π½πΎπΌππ½πΎ(m,n)β(m=n)πΊππππΌπΌβ(πππΌπΌ(m)=πππΌπΌ(n)). |
Next we show that πΎππΌππ½πΎ(m,n) and π½πΎπΌππ½πΎ(m,n) are quasi-inverses for all m,n.
On one hand, if we start with p:m=n, then by induction on p it suffices to show
π½πΎπΌππ½πΎ(n,n,πΎππΌππ½πΎ(n,n,ππΎπΏπ n))=ππΎπΏπ n. |
But πΎππΌππ½πΎ(n,n,ππΎπΏπ n)β‘r(n), so it suffices to show that π½πΎπΌππ½πΎ(n,n,r(n))=ππΎπΏπ n. We can prove this by induction on n. If nβ‘0, then π½πΎπΌππ½πΎ(0,0,r(0))=ππΎπΏπ 0 by definition of π½πΎπΌππ½πΎ. And in the case of a successor, by the inductive hypothesis we have π½πΎπΌππ½πΎ(n,n,r(n))=ππΎπΏπ n, so it suffices to observe that πΊππππΌπΌ(ππΎπΏπ n)β‘ππΎπΏπ πππΌπΌ(n).
On the other hand, if we start with c:πΌππ½πΎ(m,n), then we proceed by double induction on m and n. If both are 0, then π½πΎπΌππ½πΎ(0,0,c)β‘ππΎπΏπ 0, while πΎππΌππ½πΎ(0,0,ππΎπΏπ 0)β‘r(0)β‘β. Thus, it suffices to recall from Β§2.8 (http://planetmath.org/28theunittype) that every inhabitant of π is equal to β. If m is 0 but n is a successor, or vice versa, then c:π, so we are done. And in the case of two successors, we have
πΎππΌππ½πΎ(πππΌπΌ(m),πππΌπΌ(n),π½πΎπΌππ½πΎ(πππΌπΌ(m),πππΌπΌ(n),c))=πΎππΌππ½πΎ(πππΌπΌ(m),πππΌπΌ(n),πΊππππΌπΌ(π½πΎπΌππ½πΎ(m,n,c)))=πππΊπππππππΌππ½πΎ(πππΌπΌ(m),β)(πΊππππΌπΌ(π½πΎπΌππ½πΎ(m,n,c)),r(πππΌπΌ(m)))=πππΊπππππππΌππ½πΎ(πππΌπΌ(m),πππΌπΌ(β))(π½πΎπΌππ½πΎ(m,n,c),r(πππΌπΌ(m)))=πππΊπππππππΌππ½πΎ(m,β)(π½πΎπΌππ½πΎ(m,n,c),r(m))=πΎππΌππ½πΎ(m,n,π½πΎπΌππ½πΎ(m,n,c))=c |
using the inductive hypothesis. β
In particular, we have
πΎππΌππ½πΎ(πππΌπΌ(m),0):(πππΌπΌ(m)=0)βπ | (2.13.2) |
which shows that β0 is not the successor of any natural numberβ. We also have the composite
(πππΌπΌ(m)=πππΌπΌ(n))πΎππΌππ½πΎβπΌππ½πΎ(πππΌπΌ(m),πππΌπΌ(n))β‘πΌππ½πΎ(m,n)π½πΎπΌππ½πΎβ(m=n) | (2.13.3) |
which shows that the function πππΌπΌ is injective.
We will study more general positive types in http://planetmath.org/node/87578Chapter 5,http://planetmath.org/node/87579Chapter 6. In http://planetmath.org/node/87582Chapter 8, we will see that the same technique used here to characterize the identity types of coproducts and β can also be used to calculate homotopy groups of spheres.
Title | 2.13 Natural numbers |
---|---|
\metatable |