The natural numbers form a Preorder with the usual size ordering (, ). This is a Total Order: for all either or , and its Hasse Diagram is a line
Sources: 7 Sketches Example 1.9, 1.45, 1.60, 1.62; DaoFP Ch. 7 (“Natural Numbers” as an initial algebra); Kittenlab Lecture 5 (monoids); CTfS Example 3.1.1.3, Application 3.1.2.6, §2.7.3
The same set carries many orders: the Discrete Preorder, the reverse ordering (, “like golf”), and the Divisibility Order . The Booleans map monotonically into (e.g. , , Example 1.60), and Cardinality is monotone (Example 1.62).
CTfS emphasizes that is the set of isomorphism classes of finite sets (counting is building a bijection with , Cardinality), and that is the free monoid on one generator — so an action of on a set is just one function iterated, e.g. Newton’s method acting on (Monoid Action).
Other structures on appearing in the wiki: and are monoids and a Symmetric Monoidal Preorder; is a Rig; as a type, is the Initial Algebra of the functor (Natural Numbers Object, DaoFP §7.1), with zero and succ as introduction rules and recursion/induction as elimination rules.
Docs: Kittenlab Lecture 5
Builds on: Preorder (Preorder) — run that note’s Julia code first.
# ℕ with its usual, reverse, and divisibility preorders (Kittenlab-style)
struct UsualOrder <: Preorder{Int} end; leq(::UsualOrder, m, n) = m <= n
struct ReverseOrder <: Preorder{Int} end; leq(::ReverseOrder, m, n) = n <= m
struct DivOrder <: Preorder{Int} end; leq(::DivOrder, m, n) = n % m == 0example : LinearOrder ℕ := inferInstance
-- ℕ as an inductive type (initial algebra of 1 + X)
#print Nat -- inductive Nat | zero | succ (n : Nat)
#check @Nat.rec-- DaoFP Ch. 7: natural numbers as an inductive type
data Nat = Z | S Nat
-- the eliminator (recursion principle)
rec :: a -> (a -> a) -> Nat -> a
rec z _ Z = z
rec z s (S n) = s (rec z s n)