Perfect numbers, sums of two squares, sums of four squares, and involutions
import /Freeks/divisibility.book(section 12 まで) /Freeks/sets.book /Freeks/numbertheory.book(section 2 まで)
Perfect numbers (#70a/b, Euclid–Euler), the sum of two squares for primes (#20, Zagier's one-sentence proof), counting by involutions (the parity of the number of divisors, and the elements of order 2 in a group of even order), and Lagrange's four-square theorem (#19). The foundation is divisibility and primes (divisibility) and sets and counting (sets). Since #20 and counting by involutions use the same lemma on the parity of an involution, the sections of that lemma (removing a point, an involution after removing two points, parity) are placed before #20. The four-square theorem assumes that the multiplication of ℤ is a commutative ring (the section Assumption).
1 Preliminaries: lemmas on natural numbers
The original topic: perfect numbers (Euclid–Euler). Cancellation for addition, and closure for multiplication (a product of natural numbers is a natural number). The lemmas on parity, order, divisibility, and primes come from arith and divisibility.