Before you can believe the theorem, you must be able to read it. Every symbol below is built in an order where each one only uses ideas already defined.
Everything starts with the whole numbers 0,1,2,3,… and one very old idea: sharing into equal groups leaves a leftover.
Look at the figure: 17 pebbles in rows of 5 give 3 full rows (q=3) and 2 left over (r=2), matching 17=3⋅5+2. The remainder is the only part we will care about from here on.
Why does the topic need this? Fermat's theorem is entirely a statement about remainders. We never care that 81 is big; we care only that 81mod5=1. The symbol mod throws away the bulky quotient and keeps the one digit that matters.
Here is the single most important picture in all of modular arithmetic.
Why the topic needs it: the theorem's conclusion ap−1≡1(modp) is a congruence, not an equation. It says the giant number ap−1 lands on the "1" mark of the p-hour clock.
The theorem's condition p∤a means "a is not a multiple of p", which on the clock means "a does not sit on the 0 mark". That non-zero starting position is exactly what makes the magic possible — a starting hand parked at 0 would just stay at 0 forever.
Look at the figure: 12 pebbles can form a neat 3×4 rectangle — it factors, so it is composite. 11 pebbles refuse every rectangle except the flat 1×11 line — that stubbornness is primality.
Why the topic needs primes specifically: on a p-hour clock with p prime, multiplying by any non-zero number shuffles the marks {1,2,…,p−1} without ever collapsing two of them together. On a composite clock (like 4 hours) that shuffle breaks — which is exactly why the parent's 23≡0(mod4) counterexample fails the theorem. More at Properties of Prime Numbers.
For a prime p, saying gcd(a,p)=1 is the same as saying p∤a — because the only divisors of p are 1 and p, so the only way to share a factor with p is to be a multiple of p. That is why the parent lists them as equivalent conditions.
Why the topic needs it: the theorem is about repeated multiplication on the clock. Fermat's claim is that after exactly (p−1) such multiplications, the hour hand returns to the 1 mark.
The intuitive proof-sketch in the parent uses one more symbol.
Why the topic needs it: the "multiply every element on both sides" trick collects the numbers 1,2,…,p−1 into one product, and that product is (p−1)!. Because p is prime, none of 1,…,p−1 share a factor with p, so (p−1)! is coprime to p and can be cancelled — leaving ap−1≡1. (Its own remainder mod p is the subject of Wilson's Theorem.)
Read top to bottom: division-with-remainder is the seed; from it grow mod, congruence, and the divides relation; primes and coprimality branch off; powers and the factorial are the machinery; all of them converge on the theorem statement.