Natural numbers and monoids [01C1]
- September 30, 2026
- Marcelo Fiore, Jon Sterling
Objectives [01C2]
- September 30, 2026
- Marcelo Fiore, Jon Sterling
In this course, we are studying numbers with the following goals in mind:
- To get an appreciation for the abstract notion of number system, considering four examples: natural numbers, integers, rationals, and modular integers.
- To prove the correctness of three basic algorithms in the theory of numbers: the division algorithm, Euclid’s algorithm, and the Extended Euclid’s algorithm.
- To exemplify the use of the mathematical theory surrounding Euclid’s algorithm and Fermat’s Little Theorem in the context of public-key cryptography.
- To understand and be able to proficiently use the Principle of Mathematical Induction in its various forms.
Natural numbers [01C3]
- September 30, 2026
- Marcelo Fiore, Jon Sterling
In the beginning there were the natural numbers 0, 1, 2, 3, \ldots \text {.}
We write \mathbb {N} for the set of all natural numbers. In school math, you probably learned that the natural numbers are a certain subset of the integers, or a certain subset of the reals. Indeed, we have ourselves already promoted this viewpoint in an earlier lecture. But at times, we may wish to understand the naturals without reference to any other number system on their own terms. From this more abstract point of view, what matters about the naturals is not the specific way of embedding them into the reals, but rather the way that they are generated.
In particular, the natural numbers are generated by starting from a lowest natural number (conventionally called zero), and repeatedly applying a successor operation. In IA Foundations of Mathematics you may have already seen how such definitions are given in functional programming languages like OCaml:
type nat = zero | succ of nat
We will consider this viewpoint much more deeply later in the course.
As a mere matter of notation, we write the lowest natural number as 0 and the successors as 1,2,3,\ldots and so on, but it is really important to understand that this notation is independent of any particular embedding into the integers or the reals. The reason for privileging the standard embeddings of the naturals into the integers and the reals is that these embeddings are special in the sense that they preserve the additive and multiplicative structure of the naturals, meaning (for example) that i(m+n) = i(m)+i(n) where i\colon \mathbb {N}\hookrightarrow \mathbb {R} is the standard embedding.
Basic structure of the natural number system [01C5]
- September 30, 2026
- Marcelo Fiore, Jon Sterling
The basic operations of the natural number system are divided into additive and multiplicative structure.
Additive structure of the naturals [01C4]
- September 30, 2026
- Marcelo Fiore, Jon Sterling
The additive structure (\mathbb {N},+,0) of the natural numbers with zero and addition satisfies the following laws:
-
The monoid laws:
- The neutral element laws: 0+n=n=n+0
- The associativity law: (l+m)+n = l+(m+n)
- The commutativity law: m+n = n+m
In the mathematical jargon, the laws of addition together make (\mathbb {N},+,0) what is called a commutative monoid, an abstraction that we will define momentarily. 0 is called the neutral element or unit of the monoid; sometimes the neutral element laws are referred to as unit laws.
Multiplicative structure of the naturals [01C6]
- September 30, 2026
- Marcelo Fiore, Jon Sterling
The multiplicative structure (\mathbb {N},\cdot ,1) of the natural numbers with one and multiplication satisfies the following laws:
-
The monoid laws:
- The neutral element laws: 1\cdot n=n=n\cdot 1
- The associativity law: (l\cdot m)\cdot n = l\cdot (m\cdot n)
- The commutativity law: m\cdot n = n\cdot m
So, by the same token as the additive structure, the natural numbers under multiplication form a commutative monoid with neutral element 1\in \mathbb {N}.
Definition Monoid [01C7]
- September 30, 2026
- Marcelo Fiore, Jon Sterling
A monoid is a set M together with
- a binary operation, say \bullet \colon M\times M\to M,
- a neutral element, say e: M,
- the neutral element laws: e\bullet x = x = x \bullet e, and
- the associativity law: (x\bullet y)\bullet z = x \bullet (y\bullet z).
A monoid (M,\bullet ,e) is called commutative when the commutativity law x\bullet y = y \bullet x is satisfied.