Alphabeta Math
Session-authored (Fable 5 assisted)
How statement and proof provenance work

The first chip identifies the source of the statement or construction; the second identifies the source of its local proof or verification.

  • Literature-sourced — the exact statement appears in a cited source; only wording and notation differ.
  • AI-adapted — a semantically identical restatement of literature-sourced material, modulo indexing, notation, and boundary cases adopted by the library.
  • AI-generated — a genuinely novel statement formulated by AI, with no source for the claim itself.

These labels describe origin, not correctness: citations and verification chips remain separate evidence.

19 results · all verified · 0 also independently AI-judged
Every result on this page is machine-checked by a proof checker and read in full and owner-audited; the judge is an additional, independent cross-model AI review of the proofs. The 19 not AI-judged were verified by owner audit (typically over a confirmed judge false positive), not failures.

Congruences, the Integers Modulo n and the Chinese Remainder Theorem

1 · Prerequisites

2 · Summary

Congruence turns divisibility into an equivalence relation and hence into the quotient Z/n\mathbb Z/n, where addition and multiplication are independent of representatives. The boundary moduli are part of the construction: congruence modulo 00 is equality, congruence modulo 11 is universal, and Z/1\mathbb Z/1 is the one-element ring rather than a field. For positive moduli, units are exactly the coprime residue classes, so their number is Euler's totient. Linear congruences are reduced by their gcd, giving both their solvability criterion and their exact number of solution classes.

The two-modulus theorem first proves the full compatibility criterion: residues modulo positive m,nm,n coexist exactly when gcd(m,n)\gcd(m,n) divides their difference, and then determine one class modulo mn/gcd(m,n)mn/\gcd(m,n). Its coprime specialization extends to finite pairwise-coprime lists and preserves both operations. This yields multiplicativity of φ\varphi, while inclusion-exclusion gives Euler's finite prime-divisor product. Partitioning standard residues by n/gcd(a,n)n/\gcd(a,n) gives dn, d>0φ(d)=n\sum_{d\mid n,\ d>0}\varphi(d)=n. Finally, prime modulus makes Z/p\mathbb Z/p a field, and inverse pairing in its unit group proves Wilson's theorem.

3 · Logical flowchart

4 · Definitions, theorems and proofs

DefinitionDefinition: Literature-sourcedProof: Not applicableaudited 2026-07-31Open item page →

Congruence modulo an integer: ab(modn)a\equiv b\pmod n when n(ab)n\mid(a-b), including the moduli 00 and 11

Definition

Let a,b,nZa,b,n\in\mathbb Z. We say that aa is congruent to bb modulo nn, and write

ab(modn),a\equiv b\pmod n,

when n(ab)n\mid(a-b) in the sense of Divisibility in Z\mathbb{Z}: dad \mid a when a=dqa = dq for some integer qq. Thus there is an integer qq with ab=nqa-b=nq. The modulus is any integer; it is not required to be positive.

At modulus 00, the condition is 0(ab)0\mid(a-b), which holds exactly when ab=0a-b=0. Hence

ab(mod0)a=b.a\equiv b\pmod 0\quad\Longleftrightarrow\quad a=b.

At modulus 11, every two integers are congruent because 11 divides every integer. Changing the sign of the modulus changes nothing: n(ab)n\mid(a-b) exactly when n(ab)-n\mid(a-b).

Remarks

  • Congruence is a relation on integers. The quotient sets and operations below use nonnegative or positive moduli only where their statements require it.
  • The notation amodna\bmod n is not used for a chosen remainder here. The relation ab(modn)a\equiv b\pmod n is defined even for n=0n=0, where a remainder operation would not be available.
LemmaStatement: AI-adaptedProof: AI-adaptedprecheck passaudited 2026-07-31Open item page →

Congruence modulo every integer is an equivalence relation on Z\mathbb{Z}

Statement

For every integer nn, the relation ab(modn)a\equiv b\pmod n on Z\mathbb Z (Congruence modulo an integer: ab(modn)a\equiv b\pmod n when n(ab)n\mid(a-b), including the moduli 00 and 11) is an equivalence relation (Equivalence relation, equivalence class, and the quotient set A/A/{\sim}). For n=0n=0 it is equality, and for n=1n=1 it is the universal relation.

Facts & Assumptions

Given: An integer nn and integers a,b,ca,b,c.

[L1]

Divisibility is reflexive and linear: dud\mid u and dvd\mid v imply dux+vyd\mid ux+vy for all integers x,yx,y; also dud\mid u implies dud\mid -u (Divisibility is reflexive and transitive on Z\mathbb{Z}, and is linear: if dad \mid a and dbd \mid b then dax+byd \mid ax + by for all integers x,yx, y; also dad \mid a implies dacd \mid ac, da-d \mid a and dad \mid -a).

[F2]

An equivalence relation is reflexive, symmetric and transitive (Equivalence relation, equivalence class, and the quotient set A/A/{\sim}).

Proof

technique · direct
1.1

Reflexivity: aa=0=n0a-a=0=n\cdot0, so n(aa)n\mid(a-a) and aa(modn)a\equiv a\pmod n.

F1algebra
1.2

Symmetry: if ab(modn)a\equiv b\pmod n, then n(ab)n\mid(a-b), hence n(ab)=ban\mid-(a-b)=b-a, so ba(modn)b\equiv a\pmod n.

F1L1
1.3

Transitivity: if ab(modn)a\equiv b\pmod n and bc(modn)b\equiv c\pmod n, then n(ab)n\mid(a-b) and n(bc)n\mid(b-c), hence n(ab)+(bc)=acn\mid(a-b)+(b-c)=a-c, so ac(modn)a\equiv c\pmod n.

F1L1algebra
2.1

Steps 1.1, 1.2 and 1.3 establish the three clauses in [F2], so congruence modulo nn is an equivalence relation.

step 1.1step 1.2step 1.3F2
3.1

When n=0n=0, [F1] reads 0(ab)0\mid(a-b), which is equivalent to a=ba=b; when n=1n=1, it always holds because ab=1(ab)a-b=1\cdot(a-b).

F1algebra
LemmaStatement: AI-adaptedProof: AI-adaptedprecheck passaudited 2026-07-31Open item page →

Congruent integers may be added, subtracted and multiplied: representative changes preserve both arithmetic operations

Statement

Let n,a,a,b,bZn,a,a',b,b'\in\mathbb Z. If aa(modn)a\equiv a'\pmod n and bb(modn)b\equiv b'\pmod n, then

a+ba+b(modn),abab(modn),abab(modn).a+b\equiv a'+b'\pmod n,\qquad a-b\equiv a'-b'\pmod n,\qquad ab\equiv a'b'\pmod n.

In particular aa(modn)-a\equiv-a'\pmod n, and for every kNk\in\mathbb N the natural powers of Powers gng^{n}: natural exponents in a monoid and integer exponents in a group, with g0=eg^{0} = e satisfy ak(a)k(modn)a^k\equiv(a')^k\pmod n.

Facts & Assumptions

Given: Integers n,a,a,b,bn,a,a',b,b' with aa(modn)a\equiv a'\pmod n and bb(modn)b\equiv b'\pmod n.

[L2]

Z\mathbb Z is a commutative ring, so subtraction, distributivity and the identities used below are valid (The integers form a commutative ring).

[F2]

Natural powers in the multiplicative monoid of Z\mathbb Z satisfy x0=1x^0=1 and xk+1=xkxx^{k+1}=x^kx (Powers gng^{n}: natural exponents in a monoid and integer exponents in a group, with g0=eg^{0} = e).

[L3]

A property true at 00 and inherited by successors holds for every natural number (The principle of mathematical induction).

Proof

technique · direct
1.1

By [F1], n(aa)n\mid(a-a') and n(bb)n\mid(b-b').

givenF1
2.1

Since (a+b)(a+b)=(aa)+(bb)(a+b)-(a'+b')=(a-a')+(b-b'), linearity gives a+ba+b(modn)a+b\equiv a'+b'\pmod n.

step 1.1F1L1L2
2.2

Since (ab)(ab)=(aa)(bb)(a-b)-(a'-b')=(a-a')-(b-b'), linearity gives abab(modn)a-b\equiv a'-b'\pmod n; also n(aa)n\mid(a-a') gives n(aa)=(a)(a)n\mid-(a-a')=(-a)-(-a'), so aa(modn)-a\equiv-a'\pmod n.

step 1.1F1L1L2
2.3

The identity abab=a(bb)+b(aa)ab-a'b'=a(b-b')+b'(a-a') and linearity give n(abab)n\mid(ab-a'b'), hence abab(modn)ab\equiv a'b'\pmod n.

step 1.1F1L1L2
3.1

The power claim holds at k=0k=0 because a0=1=(a)0a^0=1=(a')^0. If it holds at kk, then step 2.3 applied to ak(a)ka^k\equiv(a')^k and aaa\equiv a' gives ak+1=aka(a)ka=(a)k+1a^{k+1}=a^ka\equiv(a')^ka'=(a')^{k+1}. Thus it holds for every kNk\in\mathbb N by induction.

step 2.3F2L3
DefinitionDefinition: AI-adaptedProof: Not applicableaudited 2026-07-31Open item page →

The congruence class [a]n[a]_n and the quotient set Z/n\mathbb{Z}/n

Definition

Fix an integer nn. Congruence modulo nn is an equivalence relation on Z\mathbb Z by Congruence modulo every integer is an equivalence relation on Z\mathbb{Z}. The congruence class of aa modulo nn is

[a]n:={bZ:ba(modn)},[a]_n:=\{\,b\in\mathbb Z:b\equiv a\pmod n\,\},

and the integers modulo nn form the quotient set

Z/n:={[a]n:aZ}.\mathbb Z/n:=\{\,[a]_n:a\in\mathbb Z\,\}.

This is the quotient-set construction of Equivalence relation, equivalence class, and the quotient set A/A/{\sim}. By The equivalence classes of an equivalence relation are nonempty, cover AA, and are pairwise equal or disjoint; conversely every such cover arises from exactly one equivalence relation, two classes are equal exactly when their representatives are congruent:

[a]n=[b]nab(modn).[a]_n=[b]_n\quad\Longleftrightarrow\quad a\equiv b\pmod n.

At n=0n=0 each class is a singleton because congruence modulo 00 is equality. At n=1n=1 there is one class, namely Z\mathbb Z itself.

Remarks

  • The notation Z/n\mathbb Z/n in this item denotes a quotient set. It does not yet assert any algebraic structure.
  • Since congruence modulo nn and modulo n-n are the same relation, their quotient sets are literally the same collection of subsets of Z\mathbb Z.
TheoremStatement: AI-adaptedProof: AI-generatedprecheck passaudited 2026-07-31Open item page →

For n1n\ge 1, every class in Z/n\mathbb{Z}/n has one representative rr with 0r<n0\le r<n, so Z/n=n\lvert\mathbb{Z}/n\rvert=n; while Z/0\mathbb{Z}/0 is in bijection with Z\mathbb{Z}

Statement

Let nn be a positive integer. Every class in Z/n\mathbb Z/n (The congruence class [a]n[a]_n and the quotient set Z/n\mathbb{Z}/n) contains exactly one integer rr with 0r<n0\le r<n. Consequently the map

r[r]n(0r<n)r\longmapsto[r]_n\qquad(0\le r<n)

is a bijection from the von Neumann natural nn to Z/n\mathbb Z/n, and Z/n=n|\mathbb Z/n|=n. This includes n=1n=1, where the only representative is 00. For n=0n=0, the map a[a]0a\mapsto[a]_0 is a bijection ZZ/0\mathbb Z\to\mathbb Z/0.

Facts & Assumptions

Given: A positive integer nn and integers a,ba,b; separately, the modulus 00.

[F1]

[u]n=[v]n[u]_n=[v]_n exactly when n(uv)n\mid(u-v) (The congruence class [a]n[a]_n and the quotient set Z/n\mathbb{Z}/n).

[L2]

The natural-number embedding into Z\mathbb Z is injective and has image the nonnegative integers; the von Neumann natural nn is the set of naturals r<nr<n (The naturals embed in the integers, The natural numbers N\mathbb{N} (von Neumann)).

[F2]

A bijection transports finite cardinality, and n=n|n|=n (Injection, surjection, bijection, The cardinality A\lvert A\rvert of a finite set).

Proof

technique · direct
1.1

By [L1], write a=qn+ra=qn+r with 0r<n0\le r<n. Then n(ar)n\mid(a-r), so [a]n=[r]n[a]_n=[r]_n.

L1F1
1.2

If 0r,s<n0\le r,s<n and [r]n=[s]n[r]_n=[s]_n, then rs=knr-s=kn for some integer kk, so r=kn+sr=kn+s. Both r=0n+rr=0n+r and r=kn+sr=kn+s express rr with a remainder in the range from 00 to n1n-1, so uniqueness in [L1] gives r=sr=s.

F1L1
1.3

At modulus 00, [F1] says [a]0=[b]0[a]_0=[b]_0 exactly when 0(ab)0\mid(a-b), exactly when a=ba=b. Hence a[a]0a\mapsto[a]_0 is injective, and it is surjective by the definition of the quotient set.

F1algebra
2.1

Thus r[r]nr\mapsto[r]_n from the natural nn to Z/n\mathbb Z/n is surjective by step 1.1 and injective by step 1.2, hence bijective.

step 1.1step 1.2L2F2
3.1

Since nn is finite with cardinality nn, the bijection in step 2.1 gives Z/n=n|\mathbb Z/n|=n. At n=1n=1 its domain is 1={0}1=\{0\}, so there is one class.

step 2.1F2L2
4.1

Steps 1.1 through 3.1 prove the positive-modulus statement, and step 1.3 proves the bijection at modulus 00.

step 1.1step 1.2step 2.1step 3.1step 1.3
DefinitionDefinition: AI-adaptedProof: Not applicableaudited 2026-07-31Open item page →

Addition and multiplication on Z/n\mathbb{Z}/n by [a]n+[b]n=[a+b]n[a]_n+[b]_n=[a+b]_n and [a]n[b]n=[ab]n[a]_n[b]_n=[ab]_n

Definition

Let nNn\in\mathbb N, including n=0n=0 and n=1n=1. For classes in Z/n\mathbb Z/n (The congruence class [a]n[a]_n and the quotient set Z/n\mathbb{Z}/n) define

[a]n+[b]n:=[a+b]n,[a]n[b]n:=[ab]n.[a]_n+[b]_n:=[a+b]_n,\qquad [a]_n[b]_n:=[ab]_n.

These are binary operations in the sense of Binary operation on a set; associativity, commutativity, and a subset closed under the operation. Indeed, if [a]n=[a]n[a]_n=[a']_n and [b]n=[b]n[b]_n=[b']_n, then aa(modn)a\equiv a'\pmod n and bb(modn)b\equiv b'\pmod n, so

a+ba+b(modn),abab(modn)a+b\equiv a'+b'\pmod n,\qquad ab\equiv a'b'\pmod n

by Congruent integers may be added, subtracted and multiplied: representative changes preserve both arithmetic operations. Thus the two displayed classes do not depend on the representatives chosen.

For n=0n=0, every class is a singleton and these operations reproduce integer addition and multiplication under the bijection ZZ/0\mathbb Z\to\mathbb Z/0. For n=1n=1, the quotient has one element, so [0]1=[1]1[0]_1=[1]_1 and both operations are the unique binary operation on a one-element set.

Remarks

  • The representative-independence argument is part of the definition. Without it the displayed formulas would be rules on integers, not operations on classes.
  • No field assertion is made here. In particular, the coincidence [0]1=[1]1[0]_1=[1]_1 will exclude Z/1\mathbb Z/1 from being a field.
TheoremStatement: AI-adaptedProof: AI-generatedprecheck passaudited 2026-07-31Open item page →

For every natural nn, (Z/n,+)(\mathbb{Z}/n,+) is an abelian group, multiplication is a commutative monoid operation, and both distributive laws hold

Statement

For every nNn\in\mathbb N, with addition and multiplication as in Addition and multiplication on Z/n\mathbb{Z}/n by [a]n+[b]n=[a+b]n[a]_n+[b]_n=[a+b]_n and [a]n[b]n=[ab]n[a]_n[b]_n=[ab]_n:

  1. (Z/n,+,[0]n)(\mathbb Z/n,+,[0]_n) is an abelian group (Group and abelian group), with [a]n=[a]n-[a]_n=[-a]_n;
  2. (Z/n,,[1]n)(\mathbb Z/n,\cdot,[1]_n) is a commutative monoid (Semigroup and monoid);
  3. multiplication distributes over addition on both sides.

The assertions include n=0n=0 and n=1n=1. At n=1n=1, the two distinguished identities coincide because [0]1=[1]1[0]_1=[1]_1.

Facts & Assumptions

Given: A natural number nn and classes [a]n,[b]n,[c]n[a]_n,[b]_n,[c]_n in Z/n\mathbb Z/n.

[F1]

[u]n+[v]n=[u+v]n[u]_n+[v]_n=[u+v]_n and [u]n[v]n=[uv]n[u]_n[v]_n=[uv]_n, and these values are independent of representatives (Addition and multiplication on Z/n\mathbb{Z}/n by [a]n+[b]n=[a+b]n[a]_n+[b]_n=[a+b]_n and [a]n[b]n=[ab]n[a]_n[b]_n=[ab]_n).

[L1]

Z\mathbb Z is a commutative ring: addition and multiplication are associative and commutative, 00 and 11 are identities, every integer has an additive inverse, and multiplication distributes over addition (The integers form a commutative ring).

[F2]

An abelian group is an associative commutative binary operation with an identity and inverses; a commutative monoid is an associative commutative binary operation with an identity (Group and abelian group, Semigroup and monoid).

Proof

technique · direct
1.1

Associativity and commutativity of addition follow from ([a]n+[b]n)+[c]n=[(a+b)+c]n=[a+(b+c)]n=[a]n+([b]n+[c]n)([a]_n+[b]_n)+[c]_n=[(a+b)+c]_n=[a+(b+c)]_n=[a]_n+([b]_n+[c]_n) and [a+b]n=[b+a]n[a+b]_n=[b+a]_n.

F1L1
1.2

The class [0]n[0]_n is an additive identity, and [a]n[-a]_n is an additive inverse of [a]n[a]_n, since [a+0]n=[a]n[a+0]_n=[a]_n and [a+(a)]n=[0]n[a+(-a)]_n=[0]_n.

F1L1
1.3

Associativity and commutativity of multiplication follow from [(ab)c]n=[a(bc)]n[(ab)c]_n=[a(bc)]_n and [ab]n=[ba]n[ab]_n=[ba]_n, while [1]n[1]_n is a multiplicative identity because [a1]n=[a]n[a\cdot1]_n=[a]_n.

F1L1
1.4

Left distributivity is [a]n([b]n+[c]n)=[a(b+c)]n=[ab+ac]n=[a]n[b]n+[a]n[c]n[a]_n([b]_n+[c]_n)=[a(b+c)]_n=[ab+ac]_n=[a]_n[b]_n+[a]_n[c]_n; right distributivity follows identically, or from commutativity.

F1L1
2.1

Steps 1.1 and 1.2 verify the abelian-group clauses, step 1.3 verifies the commutative-monoid clauses, and step 1.4 gives both distributive laws.

step 1.1step 1.2step 1.3step 1.4F2
DefinitionDefinition: AI-adaptedProof: Not applicableaudited 2026-07-31Open item page →

The unit group (Z/n)×(\mathbb{Z}/n)^\times and Euler's totient φ(n)=(Z/n)×\varphi(n)=\lvert(\mathbb{Z}/n)^\times\rvert for n1n\ge1

Definition

Let n1n\ge1 be an integer. Multiplication makes Z/n\mathbb Z/n a commutative monoid with identity [1]n[1]_n by For every natural nn, (Z/n,+)(\mathbb{Z}/n,+) is an abelian group, multiplication is a commutative monoid operation, and both distributive laws hold. A class uZ/nu\in\mathbb Z/n is a unit when it is invertible in that monoid (Left inverse, right inverse, and invertible element of a monoid). The set of all units is

(Z/n)×:={uZ/n:some vZ/n satisfies uv=[1]n}.(\mathbb Z/n)^\times:=\{\,u\in\mathbb Z/n:\text{some }v\in\mathbb Z/n\text{ satisfies }uv=[1]_n\,\}.

By The invertible elements of a monoid form a group under the restricted operation, multiplication restricts to a group operation on (Z/n)×(\mathbb Z/n)^\times, called the unit group modulo nn.

The quotient Z/n\mathbb Z/n is finite with cardinality nn by For n1n\ge 1, every class in Z/n\mathbb{Z}/n has one representative rr with 0r<n0\le r<n, so Z/n=n\lvert\mathbb{Z}/n\rvert=n; while Z/0\mathbb{Z}/0 is in bijection with Z\mathbb{Z}, and its unit set is a finite subset by A subset of a finite set is finite, with BA\lvert B\rvert \le \lvert A\rvert, and equality holds if and only if B=AB = A. Euler's totient function is therefore defined for every positive integer nn by

φ(n):=(Z/n)×N\varphi(n):=\big|(\mathbb Z/n)^\times\big|\in\mathbb N

(The cardinality A\lvert A\rvert of a finite set). For n=1n=1, the quotient has one element, which is its multiplicative identity and hence a unit, so φ(1)=1\varphi(1)=1 follows from the definition.

Remarks

  • The domain of φ\varphi here is the positive integers. No value φ(0)\varphi(0) is defined.
  • The one-element multiplicative monoid is a group, even though its identity is also its additive zero. It is not a field because a field requires distinct elements 00 and 11 (Field).
TheoremStatement: Literature-sourcedProof: AI-adaptedprecheck passaudited 2026-07-31Open item page →

For n1n\ge1, [a]n[a]_n is a unit if and only if gcd(a,n)=1\gcd(a,n)=1

Statement

Let n1n\ge1 and aZa\in\mathbb Z. Then [a]n[a]_n is a unit of Z/n\mathbb Z/n (The unit group (Z/n)×(\mathbb{Z}/n)^\times and Euler's totient φ(n)=(Z/n)×\varphi(n)=\lvert(\mathbb{Z}/n)^\times\rvert for n1n\ge1) if and only if

gcd(a,n)=1,\gcd(a,n)=1,

that is, if and only if aa and nn are coprime (Coprime integers: gcd(a,b)=1\gcd(a,b) = 1). Consequently the condition gcd(a,n)=1\gcd(a,n)=1 depends only on the class [a]n[a]_n.

Facts & Assumptions

Given: A positive integer nn and an integer aa.

[F1]

The class [a]n[a]_n is a unit exactly when some [b]n[b]_n satisfies [a]n[b]n=[1]n[a]_n[b]_n=[1]_n (The unit group (Z/n)×(\mathbb{Z}/n)^\times and Euler's totient φ(n)=(Z/n)×\varphi(n)=\lvert(\mathbb{Z}/n)^\times\rvert for n1n\ge1).

Proof

technique · direct
1.1

Suppose gcd(a,n)=1\gcd(a,n)=1. By [L1], choose integers x,yx,y with ax+ny=1ax+ny=1. Reducing this equality modulo nn gives [a]n[x]n=[1]n[a]_n[x]_n=[1]_n, so [a]n[a]_n is a unit.

L1F1choose
1.2

Conversely, suppose [a]n[a]_n is a unit. Choose bb with [a]n[b]n=[1]n[a]_n[b]_n=[1]_n. Then ab1(modn)ab\equiv1\pmod n, so ab1=nqab-1=nq for some integer qq, and ab+n(q)=1ab+n(-q)=1. By [L1], gcd(a,n)=1\gcd(a,n)=1.

F1L1choose
1.3

If aa(modn)a\equiv a'\pmod n and gcd(a,n)=1\gcd(a,n)=1, write a=a+nka'=a+nk. A Bézout identity ax+ny=1ax+ny=1 then becomes ax+n(ykx)=1a'x+n(y-kx)=1, so gcd(a,n)=1\gcd(a',n)=1 by [L1]; symmetry gives the converse. Thus the criterion is representative independent.

L1L2algebra
2.1

Steps 1.1 and 1.2 prove the equivalence, and step 1.3 proves its final representative-independence assertion.

step 1.1step 1.2step 1.3
CorollaryStatement: AI-adaptedProof: AI-generatedprecheck passaudited 2026-07-31Open item page →

φ(1)=1\varphi(1)=1, and φ(p)=p1\varphi(p)=p-1 for every prime pp

Statement

Euler's totient satisfies φ(1)=1\varphi(1)=1. If pp is prime (Prime and composite integers: pp is prime when p>1p > 1 and its only positive divisors are 11 and pp), then

φ(p)=p1.\varphi(p)=p-1.

Facts & Assumptions

Proof

technique · direct
1.1

Modulo 11 there is one class, and it is the multiplicative identity, hence a unit. Therefore φ(1)=1\varphi(1)=1.

F1L2
1.2

Let 0r<p0\le r<p. If r=0r=0, then prp\mid r, so [r]p[r]_p is not a unit by the unit criterion. If r>0r>0, then prp\nmid r: otherwise r=pkr=pk with p>0p>0 and r>0r>0, forcing k1k\ge1 and rpr\ge p, contrary to r<pr<p.

F1F2L2algebra
2.1

For 0<r<p0<r<p, [L1] gives gcd(p,r)=1\gcd(p,r)=1, hence gcd(r,p)=1\gcd(r,p)=1, so [r]p[r]_p is a unit by the unit criterion. Thus the units are exactly the classes with representatives 1,2,,p11,2,\ldots,p-1.

step 1.2F1L1
3.1

Translation by 11 is a bijection from the natural p1p-1 onto the representatives rr with 0<r<p0<r<p. Hence that finite set, and therefore the unit group, has cardinality p1p-1.

step 2.1L2L3algebra
4.1

By [F1] and step 3.1, φ(p)=p1\varphi(p)=p-1; together with step 1.1 this proves both clauses.

step 1.1step 3.1F1
LemmaStatement: AI-adaptedProof: AI-generatedprecheck passaudited 2026-07-31Open item page →

For a prime pp and k1k\ge1, multiplication by pp bijects the standard representatives modulo pk1p^{k-1} with the representatives modulo pkp^k divisible by pp

Statement

Let pp be prime and let kNk\in\mathbb N with k1k\ge1. Write k1k-1 for the unique natural jj with j+1=kj+1=k. Multiplication by pp gives a bijection

{rZ:0r<pk1}{sZ:0s<pk, ps},rpr.\{\,r\in\mathbb Z:0\le r<p^{k-1}\,\}\longrightarrow\{\,s\in\mathbb Z:0\le s<p^k,\ p\mid s\,\},\qquad r\longmapsto pr.

Thus the standard representatives modulo pkp^k divisible by pp are exactly 0,p,2p,,(pk11)p0,p,2p,\ldots,(p^{k-1}-1)p, and there are pk1p^{k-1} of them.

Facts & Assumptions

Proof

technique · direct
1.1

If 0r<pk10\le r<p^{k-1}, then 0pr<ppk1=pk0\le pr<p\cdot p^{k-1}=p^k, and pprp\mid pr. Thus the displayed rule has values in the stated codomain.

F1F4algebra
1.2

The rule is injective: pr=prpr=pr' implies r=rr=r' because p0p\ne0.

L1F4
1.3

It is surjective: if 0s<pk0\le s<p^k and psp\mid s, write s=prs=pr. Since p>0p>0, the inequalities give 0r<pk10\le r<p^{k-1} after using pk=ppk1p^k=pp^{k-1}.

F1F4algebrachoose
2.1

Steps 1.1, 1.2 and 1.3 give a bijection, and [F2] transports the domain cardinality pk1p^{k-1} to the codomain.

step 1.1step 1.2step 1.3F2F3
TheoremStatement: AI-adaptedProof: AI-generatedprecheck passaudited 2026-07-31Open item page →

For a prime pp and k1k\ge1, φ(pk)=pkpk1\varphi(p^k)=p^k-p^{k-1}

Statement

For every prime pp and natural k1k\ge1,

φ(pk)=pkpk1.\varphi(p^k)=p^k-p^{k-1}.

Equivalently, among the pkp^k standard classes modulo pkp^k, the nonunits are exactly those whose standard representatives are divisible by pp.

Facts & Assumptions

Given: A prime pp, a natural k1k\ge1, and an arbitrary standard representative rr with 0r<pk0\le r<p^k.

Proof

technique · direct
1.1

If prp\mid r, then pp is a common divisor of rr and pkp^k. Since p>1p>1 by [F1], the greatest-common-divisor property in [F2] gives gcd(r,pk)1\gcd(r,p^k)\ne1, so [r]pk[r]_{p^k} is not a unit.

L1F1F2
1.2

Suppose prp\nmid r, so pp and rr are coprime by [L2]. If gcd(r,pk)>1\gcd(r,p^k)>1, [L3] gives a prime qq dividing that gcd. Then [F2] gives qrq\mid r and qpkq\mid p^k. Uniqueness of prime factorisation applied to pkp^k, a product of copies of pp, forces q=pq=p, contradicting the coprimality of pp and rr. Hence gcd(r,pk)=1\gcd(r,p^k)=1, so [r]pk[r]_{p^k} is a unit.

L1L2L3F2
2.1

Since rr was arbitrary, the standard representatives split disjointly into the unit representatives and the representatives divisible by pp. The whole set has cardinality pkp^k by [L5], and the second block has cardinality pk1p^{k-1} by [L4].

step 1.1step 1.2L4L5
3.1

By the sum rule, pk=φ(pk)+pk1p^k=\varphi(p^k)+p^{k-1} in N\mathbb N, so φ(pk)=pkpk1\varphi(p^k)=p^k-p^{k-1}.

step 2.1L5L6
LemmaStatement: AI-adaptedProof: AI-generatedprecheck passaudited 2026-07-31Open item page →

If n1n\ge1, d=gcd(a,n)d=\gcd(a,n) and dbd\mid b, then axb(modn)ax\equiv b\pmod n reduces to a congruence with coprime coefficient modulo n/dn/d

Statement

Let a,bZa,b\in\mathbb Z, let n1n\ge1, and put d:=gcd(a,n)d:=\gcd(a,n). If dbd\mid b, write

a=da,n=dn,b=db.a=da',\qquad n=dn',\qquad b=db'.

Then d>0d>0, the integers a,na',n' are coprime, and for every xZx\in\mathbb Z,

axb(modn)axb(modn).ax\equiv b\pmod n\quad\Longleftrightarrow\quad a'x\equiv b'\pmod{n'}.

Thus the reduced modulus is the positive integer n=n/dn'=n/d and its coefficient is coprime to it (Congruence modulo an integer: ab(modn)a\equiv b\pmod n when n(ab)n\mid(a-b), including the moduli 00 and 11).

Facts & Assumptions

Given: Integers a,ba,b, a positive integer nn, d:=gcd(a,n)d:=\gcd(a,n), and dbd\mid b.

[L1]

The gcd is a nonnegative common divisor, and it is positive when its two arguments are not both zero (Common divisor, and the greatest common divisor gcd(a,b)\gcd(a,b), with the convention gcd(0,0):=0\gcd(0,0) := 0).

[L2]

If d=gcd(u,v)0d=\gcd(u,v)\ne0, then the uniquely determined quotients u/du/d and v/dv/d are coprime (If d=gcd(a,b)d = \gcd(a,b) is nonzero then a/da/d and b/db/d are coprime, The integers have no zero divisors; multiplicative cancellation).

Proof

technique · direct
1.1

Since n>0n>0, the pair (a,n)(a,n) is not (0,0)(0,0), so d>0d>0 by [L1]. Because dd divides a,n,ba,n,b, there are integers a,n,ba',n',b' with a=daa=da', n=dnn=dn' and b=dbb=db'; these quotients are unique by cancellation, n>0n'>0, and a,na',n' are coprime by [L2].

L1L2L3
2.1

For any integer xx, the congruence axb(modn)ax\equiv b\pmod n says dnd(axb)dn'\mid d(a'x-b'), so it holds exactly when there is an integer qq with d(axb)=dnqd(a'x-b')=dn'q; since d0d\ne0, cancellation makes this equivalent to axb=nqa'x-b'=n'q, namely axb(modn)a'x\equiv b'\pmod{n'}.

step 1.1L3L4
TheoremStatement: Literature-sourcedProof: AI-adaptedprecheck passaudited 2026-07-31Open item page →

For n1n\ge1, axb(modn)ax\equiv b\pmod n is solvable exactly when gcd(a,n)b\gcd(a,n)\mid b, and then has exactly gcd(a,n)\gcd(a,n) solution classes modulo nn

Statement

Let a,bZa,b\in\mathbb Z and n1n\ge1, and put d:=gcd(a,n)d:=\gcd(a,n). The congruence

axb(modn)ax\equiv b\pmod n

has an integer solution if and only if dbd\mid b. When it is solvable, it has exactly dd solution classes in Z/n\mathbb Z/n. More explicitly, if a=daa=da', n=dnn=dn', b=dbb=db' and x0x_0 solves ax0b(modn)a'x_0\equiv b'\pmod{n'}, the solutions modulo nn are

[x0+jn]n(0j<d).[x_0+jn']_n\qquad(0\le j<d).

Facts & Assumptions

Given: Integers a,ba,b, a positive integer nn, and d:=gcd(a,n)d:=\gcd(a,n).

[L2]

If dbd\mid b, the original congruence is equivalent to axb(modn)a'x\equiv b'\pmod{n'}, where a=daa=da', n=dnn=dn', b=dbb=db', n>0n'>0, and a,na',n' are coprime (If n1n\ge1, d=gcd(a,n)d=\gcd(a,n) and dbd\mid b, then axb(modn)ax\equiv b\pmod n reduces to a congruence with coprime coefficient modulo n/dn/d).

Proof

technique · direct
1.1

If xx solves the congruence, then naxbn\mid ax-b, so axb=nqax-b=nq for some qq and b=axnqb=ax-nq. Since dad\mid a and dnd\mid n, it follows that dbd\mid b.

L1
1.2

Conversely suppose dbd\mid b and use the notation of [L2]. Choose u,vu,v with ua+vn=1ua'+vn'=1 by [L3]. Then x0:=ubx_0:=ub' satisfies ax0b=b(ua1)=bvna'x_0-b'=b'(ua'-1)=-b'vn', so it solves the reduced congruence and hence the original one.

L2L3
1.3

By [L4], every integer qq has a unique residue jj with 0j<d0\le j<d modulo dd. Thus every integer congruent to x0x_0 modulo nn' is congruent modulo dn=ndn'=n to exactly one x0+jnx_0+jn' with 0j<d0\le j<d.

L4
2.1

Every solution xx of the reduced congruence is congruent to x0x_0 modulo nn'. Indeed, na(xx0)n'\mid a'(x-x_0); multiplying ua+vn=1ua'+vn'=1 by xx0x-x_0 shows that nn' divides xx0x-x_0. Conversely every xx0(modn)x\equiv x_0\pmod{n'} solves the reduced congruence.

step 1.2L2L3
2.2

If 0i,j<d0\le i,j<d and [x0+in]n=[x0+jn]n[x_0+in']_n=[x_0+jn']_n, then dn(ij)ndn'\mid(i-j)n', so cancellation gives dijd\mid i-j; uniqueness of the standard representatives modulo dd yields i=ji=j. Hence the displayed dd classes are distinct.

step 1.3L4
3.1

Steps 1.1 and 1.2 prove the solvability criterion. When it holds, steps 2.1, 1.3 and 2.2 show that the displayed list is exhaustive and contains exactly dd distinct solution classes.

step 1.1step 1.2step 2.1step 1.3step 2.2
LemmaStatement: AI-adaptedProof: AI-generatedprecheck passaudited 2026-07-31Open item page →

For a finite pairwise-coprime list of positive integers, the product divides every common multiple, and each initial product is coprime to every remaining modulus

Statement

Let n0,,nr1n_0,\ldots,n_{r-1} be a finite list of positive integers such that gcd(ni,nj)=1\gcd(n_i,n_j)=1 whenever iji\ne j. Put Pk:=i<kniP_k:=\prod_{i<k}n_i, with P0=1P_0=1.

  1. For every kj<rk\le j<r, gcd(Pk,nj)=1\gcd(P_k,n_j)=1.
  2. If every nin_i divides an integer MM, then PrMP_r\mid M.

The products are finite monoid products (The product g0g1gn1g_0 g_1 \cdots g_{n-1} of a finite list in a monoid, by recursion, with the empty product (n=0n = 0) equal to the identity).

Facts & Assumptions

Given: A natural rr, a pairwise-coprime list of positive integers n0,,nr1n_0,\ldots,n_{r-1}, its initial products PkP_k, and an integer MM divisible by every list member.

[L6]

Induction proves a statement at every natural number from its base case and successor implication (The principle of mathematical induction).

Proof

technique · induction
1.1

Fix kj<rk\le j<r. If gcd(Pk,nj)>1\gcd(P_k,n_j)>1, [L2] supplies a prime qq dividing this gcd. Then qPkq\mid P_k, so [L1] gives an i<kji<k\le j with qniq\mid n_i; also qnjq\mid n_j, contradicting gcd(ni,nj)=1\gcd(n_i,n_j)=1 because iji\ne j and the positive prime q>1q>1 would divide that gcd. Hence gcd(Pk,nj)=1\gcd(P_k,n_j)=1.

L1L2L5
1.2

At k=0k=0, P0=1P_0=1 divides MM.

baseL4
2.1

Assume PkMP_k\mid M for some k<rk<r. The hypothesis gives nkMn_k\mid M, and step 1.1 gives gcd(Pk,nk)=1\gcd(P_k,n_k)=1; hence [L3] gives Pknk=Pk+1MP_kn_k=P_{k+1}\mid M.

ihstep 1.1L3L4
3.1

Induction using steps 1.2 and 2.1 yields PkMP_k\mid M for every krk\le r, and in particular PrMP_r\mid M; together with step 1.1 this proves both clauses.

step 1.1step 1.2step 2.1L6discharge-induction
LemmaStatement: Literature-sourcedProof: AI-adaptedprecheck passaudited 2026-07-31Open item page →

For coprime positive m,nm,n, every pair of residue classes modulo mm and nn has a unique simultaneous class modulo mnmn

Statement

Let m,nm,n be positive integers, a,bZa,b\in\mathbb Z, and d:=gcd(m,n)d:=\gcd(m,n). The simultaneous system

xa(modm),xb(modn)x\equiv a\pmod m,\qquad x\equiv b\pmod n

is solvable if and only if d(ab)d\mid(a-b). If it is solvable, all its solutions form one congruence class modulo mn/dmn/d.

In particular, when m,nm,n are coprime, every pair of classes [a]m,[b]n[a]_m,[b]_n determines a unique simultaneous class [x]mn[x]_{mn}. This includes m=1m=1 or n=1n=1.

Facts & Assumptions

Given: Positive integers m,nm,n, integers a,ba,b, and d:=gcd(m,n)d:=\gcd(m,n).

[L2]

Writing m=dmm=dm' and n=dnn=dn', the positive integers m,nm',n' are coprime (If d=gcd(a,b)d = \gcd(a,b) is nonzero then a/da/d and b/db/d are coprime, The integers have no zero divisors; multiplicative cancellation).

[L5]

The quotient Z/c\mathbb Z/c consists of the congruence classes modulo cc (The congruence class [a]n[a]_n and the quotient set Z/n\mathbb{Z}/n).

Proof

technique · direct
1.1

If xx solves both congruences, then m(xa)m\mid(x-a) and n(xb)n\mid(x-b). Since dd divides m,nm,n, it divides both differences and therefore their difference bab-a; equivalently d(ab)d\mid(a-b).

L1L4
1.2

Conversely suppose d(ab)d\mid(a-b) and write ab=dca-b=dc, m=dmm=dm', n=dnn=dn' as in [L2]. Choose u,vu,v with um+vn=1um'+vn'=1 by [L3], put t:=uct:=-uc, and set x:=a+mtx:=a+mt. Then xa(modm)x\equiv a\pmod m, while xb=(ab)+dmt=d(cmuc)=dcnvx-b=(a-b)+d m't=d(c-m'uc)=dcn'v, so xb(modn)x\equiv b\pmod n.

L2L3L4
1.3

If x,yx,y are two solutions, then m(xy)m\mid(x-y), so xy=dmqx-y=dm'q for some integer qq. Also n=dn(xy)n=dn'\mid(x-y), hence cancellation of dd gives nmqn'\mid m'q; multiplying a Bézout identity for m,nm',n' by qq shows nqn'\mid q. Thus dmn=mn/ddm'n'=mn/d divides xyx-y.

L2L3L4
1.4

Conversely, if mn/d=dmnmn/d=dm'n' divides xyx-y, then both m=dmm=dm' and n=dnn=dn' divide xyx-y, so xx and yy satisfy exactly the same two residue conditions. Hence, when compatible, the solution set is one class modulo mn/dmn/d.

L2L4L5
2.1

When gcd(m,n)=1\gcd(m,n)=1, one has d=1d=1 and the compatibility condition is automatic; the modulus mn/dmn/d is mnmn, so steps 1.1 through 1.4 give the stated bijection between pairs of residue classes and simultaneous classes. The same proof applies when either modulus is 11.

step 1.1step 1.2step 1.3step 1.4L5
TheoremStatement: AI-adaptedProof: AI-adaptedprecheck passaudited 2026-07-31Open item page →

Chinese remainder theorem for a finite pairwise-coprime list: simultaneous residues determine one class modulo the product, and the resulting bijection preserves addition and multiplication

Statement

Let n0,,nr1n_0,\ldots,n_{r-1} be a finite pairwise-coprime list of positive integers and let N:=i<rniN:=\prod_{i<r}n_i. The map

Φ:Z/Ni<rZ/ni,[x]N([x]ni)i<r,\Phi:\mathbb Z/N\longrightarrow\prod_{i<r}\mathbb Z/n_i,\qquad[x]_N\longmapsto([x]_{n_i})_{i<r},

is a bijection. It preserves addition, multiplication, [0][0], and [1][1] componentwise. For the empty list, N=1N=1 and both sides have one element.

Facts & Assumptions

Given: A natural rr, a finite pairwise-coprime list of positive integers n0,,nr1n_0,\ldots,n_{r-1}, and N:=i<rniN:=\prod_{i<r}n_i.

[L1]

Every initial product Pk:=i<kniP_k:=\prod_{i<k}n_i is coprime to nkn_k, and the full product divides every common multiple of all list entries (For a finite pairwise-coprime list of positive integers, the product divides every common multiple, and each initial product is coprime to every remaining modulus).

[L2]

For coprime positive m,nm,n, each pair of residue classes modulo m,nm,n determines exactly one class modulo mnmn (For coprime positive m,nm,n, every pair of residue classes modulo mm and nn has a unique simultaneous class modulo mnmn).

[L5]

A map is bijective exactly when it is both injective and surjective (Injection, surjection, bijection).

[L6]

Induction proves a statement at every natural number from its base case and successor implication (The principle of mathematical induction).

[F1]

The quotient Z/c\mathbb Z/c is the set of congruence classes modulo cc (The congruence class [a]n[a]_n and the quotient set Z/n\mathbb{Z}/n).

Proof

technique · induction
1.1

For r=0r=0, N=P0=1N=P_0=1. The quotient Z/1\mathbb Z/1 has one class because congruence modulo 11 is universal, and the empty Cartesian product has its single empty tuple; hence Φ\Phi is a bijection and all componentwise preservation assertions are vacuous.

baseL3L4F1
1.2

Assume the simultaneous-residue assertion for the first kk moduli. Given classes modulo the first k+1k+1 moduli, the induction hypothesis supplies a unique class [y]Pk[y]_{P_k} having the first kk residues. Since gcd(Pk,nk)=1\gcd(P_k,n_k)=1 by [L1], [L2] supplies a unique class [x]Pknk=[x]Pk+1[x]_{P_kn_k}=[x]_{P_{k+1}} reducing to [y]Pk[y]_{P_k} and to the prescribed class modulo nkn_k. It therefore has all prescribed residues.

ihL1L2L3
1.3

If xy(modN)x\equiv y\pmod N, every nin_i divides NN and hence divides xyx-y, so Φ\Phi is well defined. For representatives x,yx,y, its iith coordinate sends [x+y]N[x+y]_N to [x+y]ni=[x]ni+[y]ni[x+y]_{n_i}=[x]_{n_i}+[y]_{n_i} and sends [xy]N[xy]_N to [xy]ni=[x]ni[y]ni[xy]_{n_i}=[x]_{n_i}[y]_{n_i}; it similarly sends [0]N,[1]N[0]_N,[1]_N to the componentwise identities.

L3L4
2.1

If two classes modulo Pk+1P_{k+1} have the same first k+1k+1 residues, their representatives have difference divisible by every nin_i for i<k+1i<k+1, hence by Pk+1P_{k+1} using [L1]; the two classes are equal. Thus the class constructed in step 1.2 is unique.

ihstep 1.2L1L4
3.1

Induction gives existence and uniqueness for every finite length rr. Therefore Φ\Phi is surjective and injective, hence bijective by [L5].

step 1.1step 1.2step 2.1L5L6
4.1

Steps 3.1 and 1.3 prove all assertions, including the empty-list boundary case from step 1.1.

step 1.1step 3.1step 1.3discharge-induction
CorollaryStatement: Literature-sourcedProof: AI-adaptedprecheck passaudited 2026-07-31Open item page →

Euler's totient is multiplicative: gcd(m,n)=1\gcd(m,n)=1 implies φ(mn)=φ(m)φ(n)\varphi(mn)=\varphi(m)\varphi(n) for positive m,nm,n

Statement

For positive integers m,nm,n with gcd(m,n)=1\gcd(m,n)=1,

φ(mn)=φ(m)φ(n).\varphi(mn)=\varphi(m)\varphi(n).

Thus Euler's totient is multiplicative on coprime positive arguments.

Facts & Assumptions

Given: Coprime positive integers m,nm,n.

[L1]

The Chinese remainder map Z/(mn)Z/m×Z/n\mathbb Z/(mn)\to\mathbb Z/m\times\mathbb Z/n is a bijection preserving multiplication and [1][1] (Chinese remainder theorem for a finite pairwise-coprime list: simultaneous residues determine one class modulo the product, and the resulting bijection preserves addition and multiplication).

[L2]

A unit is an element with a multiplicative inverse, and φ(c)\varphi(c) is the cardinality of the unit group modulo the positive integer cc (The unit group (Z/n)×(\mathbb{Z}/n)^\times and Euler's totient φ(n)=(Z/n)×\varphi(n)=\lvert(\mathbb{Z}/n)^\times\rvert for n1n\ge1).

Proof

technique · direct
1.1

A class uu modulo mnmn is a unit if and only if both components of its CRT image are units: an inverse of uu maps to componentwise inverses, while inverses of both components form a pair whose unique CRT preimage multiplies with uu to the unique preimage of the identity.

L1L2
2.1

Consequently the CRT bijection restricts to a bijection (Z/(mn))×(Z/m)××(Z/n)×(\mathbb Z/(mn))^\times\to(\mathbb Z/m)^\times\times(\mathbb Z/n)^\times. Taking finite cardinalities and applying [L3] gives φ(mn)=φ(m)φ(n)\varphi(mn)=\varphi(m)\varphi(n).

step 1.1L2L3
TheoremStatement: AI-adaptedProof: AI-generatedprecheck passaudited 2026-07-31Open item page →

Euler's product formula φ(n)=npn(11/p)=pkn(pkpk1)\varphi(n)=n\prod_{p\mid n}(1-1/p)=\prod_{p^k\parallel n}(p^k-p^{k-1}) for n1n\ge1, stated through a finite injective list of its prime divisors

Statement

Let n1n\ge1, and let p0,,pr1p_0,\ldots,p_{r-1} be an injective finite list consisting exactly of the prime divisors of nn. Put ki:=vpi(n)k_i:=v_{p_i}(n), so ki1k_i\ge1. Then

φ(n)=i<r(pikipiki1).\varphi(n)=\prod_{i<r}\bigl(p_i^{k_i}-p_i^{k_i-1}\bigr).

After carrying the natural numbers into Q\mathbb Q, the same identity is

φ(n)=ni<r(11pi).\varphi(n)=n\prod_{i<r}\left(1-\frac1{p_i}\right).

At n=1n=1 the list is empty, both products are empty products equal to 11, and φ(1)=1\varphi(1)=1. These finite-list formulas are the precise meanings of the two products displayed in the title.

Facts & Assumptions

Given: A positive integer nn and an injective finite list p0,,pr1p_0,\ldots,p_{r-1} consisting exactly of its prime divisors; ki:=vpi(n)k_i:=v_{p_i}(n).

[L6]

Natural finite products have empty value 11 and obey the successor recursion (Finite sums and finite products of natural numbers, k<nak\sum_{k<n} a_k and k<nak\prod_{k<n} a_k in N\mathbb{N}); the integers embed injectively in the field Q\mathbb Q, which in turn embeds injectively as an ordered subfield of R\mathbb R (The integers embed in the rationals, The rationals form a field, The rationals embed densely in the reals).

[L7]

Induction is valid on natural numbers (The principle of mathematical induction).

[L10]

Multiplication by a nonzero integer is cancellative (The integers have no zero divisors; multiplicative cancellation).

Proof

technique · direct
1.1

For i<ri<r, let Ai:={aX:pia}A_i:=\{a\in X:p_i\mid a\}. Since the pip_i are distinct primes, they are pairwise coprime by [L8]. For J{0,,r1}J\subseteq\{0,\ldots,r-1\} put qJ:=jJpjq_J:=\prod_{j\in J}p_j, with q=1q_\varnothing=1. By [L5], the intersection AJA_J consists exactly of the standard representatives divisible by qJq_J.

L2L5L8
1.2

A representative aXa\in X lies outside every AiA_i exactly when no prime divisor of nn divides aa. This is equivalent to gcd(a,n)=1\gcd(a,n)=1: a common divisor greater than 11 would have a prime divisor by [L9], and every such prime would occur in the list. Therefore XiAiX\setminus\bigcup_iA_i is precisely the set of unit representatives and has cardinality φ(n)\varphi(n).

L1L4L9
1.3

By [L4], n=i<rpikin=\prod_{i<r}p_i^{k_i}. In Q\mathbb Q, finite distributivity and ki1k_i\ge1 give piki(11/pi)=pikipiki1p_i^{k_i}(1-1/p_i)=p_i^{k_i}-p_i^{k_i-1} for each ii, hence ni<r(11/pi)=i<r(pikipiki1)n\prod_{i<r}(1-1/p_i)=\prod_{i<r}(p_i^{k_i}-p_i^{k_i-1}).

L4L6
2.1

The integer qJq_J divides nn by [L4]. Multiplication by qJq_J bijects the integers tt with 0t<n/qJ0\le t<n/q_J onto AJA_J: its values lie between 00 and n1n-1, every member of AJA_J has the required quotient, and [L10] gives injectivity. Hence AJ=n/qJ|A_J|=n/q_J.

step 1.1L2L4L10
3.1

Inclusion-exclusion applied to steps 1.1, 2.1 and 1.2 gives this equality after embedding its integer and rational terms in R\mathbb R. Both sides come from Q\mathbb Q, and the ordered-field embedding QR\mathbb Q\to\mathbb R is injective by [L6], so already in Q\mathbb Q one has φ(n)=J{0,,r1}(1)Jn/qJ\varphi(n)=\sum_{J\subseteq\{0,\ldots,r-1\}}(-1)^{|J|}n/q_J.

step 1.1step 2.1step 1.2L3L6
4.1

Finite distributivity gives i<r(11/pi)=J(1)J/qJ\prod_{i<r}(1-1/p_i)=\sum_J(-1)^{|J|}/q_J: the empty case reads 1=11=1, and adjoining prp_r replaces every old term 1/qJ1/q_J by the pair 1/qJ1/q_J and 1/(qJpr)-1/(q_Jp_r), indexed respectively by subsets not containing and containing rr. Multiplying this identity by nn and using step 3.1 yields φ(n)=ni<r(11/pi)\varphi(n)=n\prod_{i<r}(1-1/p_i).

step 3.1L6L7
5.1

Combining steps 4.1 and 1.3 proves both formulas. When n=1n=1, there are no prime divisors, so the list is empty; the products equal 11 by [L6], and φ(1)=1\varphi(1)=1 by [L1].

step 4.1step 1.3L1L6

Remarks

TheoremStatement: Literature-sourcedProof: AI-adaptedprecheck passaudited 2026-07-31Open item page →

For every positive integer nn, dn, d>0φ(d)=n\sum_{d\mid n,\ d>0}\varphi(d)=n

Statement

For every positive integer nn,

dnd>0φ(d)=n.\sum_{\substack{d\mid n\\d>0}}\varphi(d)=n.

The sum is over the finite set of positive divisors of nn (The sum iSai\sum_{i \in S} a_i over a finite index set, and its product form).

Facts & Assumptions

Given: A positive integer nn, its standard representative set X:={aZ:0a<n}X:=\{a\in\mathbb Z:0\le a<n\}, and its positive-divisor set D:={dZ:dn, d>0}D:=\{d\in\mathbb Z:d\mid n,\ d>0\}.

Proof

technique · direct
1.1

For each dDd\in D, put Xd:={aX:n/gcd(a,n)=d}X_d:=\{a\in X:n/\gcd(a,n)=d\}. Every aXa\in X lies in exactly one such block: its positive gcd g=gcd(a,n)g=\gcd(a,n) divides nn, and d=n/gd=n/g is a positive divisor of nn. Thus the XdX_d form a partition of XX.

L2L5
1.2

Fix dDd\in D and put c:=n/d>0c:=n/d>0. Multiplication by cc sends each standard unit representative uu modulo dd to a:=cuXa:=cu\in X, because 0u<d0\le u<d gives 0cu<n0\le cu<n; moreover gcd(a,n)=gcd(cu,cd)=cgcd(u,d)=c\gcd(a,n)=\gcd(cu,cd)=c\gcd(u,d)=c, so n/gcd(a,n)=dn/\gcd(a,n)=d and aXda\in X_d.

L1L2
1.3

Conversely, if aXda\in X_d, then gcd(a,n)=n/d=c\gcd(a,n)=n/d=c, so cac\mid a and a=cua=cu for a unique integer uu. The bounds on aa give 0u<d0\le u<d, and c=cgcd(u,d)c=c\gcd(u,d) by [L2], so cancellation gives gcd(u,d)=1\gcd(u,d)=1. Thus uu is a standard unit representative modulo dd.

L1L2L5
2.1

Steps 1.2 and 1.3 are inverse constructions, so Xd=φ(d)|X_d|=\varphi(d) for every dDd\in D.

step 1.2step 1.3L1
3.1

The index set DD is finite by [L3]. Applying the sum rule to the partition in step 1.1 and using step 2.1 gives n=X=dDXd=dDφ(d)n=|X|=\sum_{d\in D}|X_d|=\sum_{d\in D}\varphi(d).

step 1.1step 2.1L1L3L4

Remarks

  • The partition by n/gcd(a,n)n/\gcd(a,n) is an incidence identity: each residue is assigned to one positive divisor, and the block over dd is counted by the units modulo dd.
TheoremStatement: Literature-sourcedProof: AI-adaptedprecheck passaudited 2026-07-31Open item page →

For every prime pp, the two operations on Z/p\mathbb{Z}/p make it a field

Statement

For every prime pp, the operations of addition and multiplication on Z/p\mathbb Z/p make it a field (Field).

Facts & Assumptions

Given: A prime integer pp.

[L1]

Modular addition makes Z/p\mathbb Z/p an abelian group, modular multiplication makes it a commutative monoid, and both distributive laws hold (For every natural nn, (Z/n,+)(\mathbb{Z}/n,+) is an abelian group, multiplication is a commutative monoid operation, and both distributive laws hold).

[L3]

For positive modulus pp, [a]p[a]_p is invertible exactly when gcd(a,p)=1\gcd(a,p)=1 (For n1n\ge1, [a]n[a]_n is a unit if and only if gcd(a,n)=1\gcd(a,n)=1).

[L4]

Equality [a]p=[b]p[a]_p=[b]_p is equivalent to ab(modp)a\equiv b\pmod p, which means p(ab)p\mid(a-b) (The congruence class [a]n[a]_n and the quotient set Z/n\mathbb{Z}/n, Congruence modulo an integer: ab(modn)a\equiv b\pmod n when n(ab)n\mid(a-b), including the moduli 00 and 11).

[L5]

A field is a commutative ring with 010\ne1 in which every nonzero element is multiplicatively invertible (Field).

Proof

technique · direct
1.1

By [L1], all additive, multiplicative, identity, inverse, commutativity, associativity and distributive field axioms already hold except possibly [0]p[1]p[0]_p\ne[1]_p and invertibility of nonzero classes.

L1L5
1.2

Since p>1p>1, it does not divide 11, so [L4] gives [0]p[1]p[0]_p\ne[1]_p.

L2L4
1.3

If [a]p[0]p[a]_p\ne[0]_p, then pap\nmid a by [L4]. Hence gcd(a,p)=1\gcd(a,p)=1 by [L2], and [L3] makes [a]p[a]_p invertible.

L2L3L4
2.1

Steps 1.1 through 1.3 verify every clause of [L5], so Z/p\mathbb Z/p is a field.

step 1.1step 1.2step 1.3L5
LemmaStatement: AI-adaptedProof: AI-adaptedprecheck passaudited 2026-07-31Open item page →

In (Z/p)×(\mathbb{Z}/p)^\times, inversion pairs every class except [1]p[1]_p and [1]p[-1]_p, which are the only self-inverse classes

Statement

Let pp be prime. In the finite unit group (Z/p)×(\mathbb Z/p)^\times, inversion partitions all classes other than [1]p[1]_p and [1]p[-1]_p into disjoint pairs {u,u1}\{u,u^{-1}\} with distinct members. The only self-inverse classes are [1]p[1]_p and [1]p[-1]_p.

When p=2p=2 these two displayed classes coincide, and the unit group has that single element.

Facts & Assumptions

Proof

technique · direct
1.1

If a unit uu is self-inverse, then u2=[1]pu^2=[1]_p, so (u[1]p)(u+[1]p)=[0]p(u-[1]_p)(u+[1]_p)=[0]_p. In a field a product is zero only if a factor is zero: if the first factor is nonzero, multiply by its inverse. Hence u=[1]pu=[1]_p or u=[1]p=[1]pu=-[1]_p=[-1]_p.

L1
1.2

Conversely, [1]p2=[1]p[1]_p^2=[1]_p and [1]p2=[1]p[-1]_p^2=[1]_p, so both displayed classes are self-inverse.

L1
1.3

If p=2p=2, then 2(1(1))2\mid(1-(-1)), so [1]2=[1]2[1]_2=[-1]_2; the unique nonzero standard class is [1]2[1]_2, and it is the only unit.

L1L2
2.1

On the remaining finite set, inversion has no fixed point by steps 1.1 and 1.2. Since uu is an inverse of u1u^{-1}, uniqueness in [L3] gives (u1)1=u(u^{-1})^{-1}=u. Therefore the inversion orbits are disjoint pairs {u,u1}\{u,u^{-1}\} with distinct members.

step 1.1step 1.2L2L3
3.1

Steps 1.1 through 2.1 prove the pairing and its boundary case.

step 1.1step 1.2step 2.1step 1.3
TheoremStatement: Literature-sourcedProof: AI-adaptedprecheck passaudited 2026-07-31Open item page →

Wilson's theorem: for every prime pp, (p1)!1(modp)(p-1)!\equiv-1\pmod p

Statement

For every prime pp,

(p1)!1(modp).(p-1)!\equiv-1\pmod p.

Facts & Assumptions

Given: A prime pp.

[L1]

The unit classes modulo pp other than [1]p[1]_p and [1]p[-1]_p occur in disjoint inverse pairs, while those displayed classes are the only self-inverse ones; at p=2p=2 they coincide (In (Z/p)×(\mathbb{Z}/p)^\times, inversion pairs every class except [1]p[1]_p and [1]p[-1]_p, which are the only self-inverse classes).

[L5]

The quotient Z/p\mathbb Z/p is a field, so every nonzero class is a unit (For every prime pp, the two operations on Z/p\mathbb{Z}/p make it a field).

[F1]

Products of residue classes are computed by multiplying representatives: [a]p[b]p=[ab]p[a]_p[b]_p=[ab]_p (Addition and multiplication on Z/n\mathbb{Z}/n by [a]n+[b]n=[a+b]n[a]_n+[b]_n=[a+b]_n and [a]n[b]n=[ab]n[a]_n[b]_n=[ab]_n).

Proof

technique · direct
1.1

By [L5], the nonzero classes are exactly the unit classes. Multiply them all and regroup by [L1]: every two-element inverse pair contributes [1]p[1]_p. If the two displayed self-inverse classes are distinct, their contribution is [1]p[1]p=[1]p[1]_p[-1]_p=[-1]_p; if they coincide, their single common contribution is itself [1]p[-1]_p. Thus in every case the product of all nonzero classes is [1]p[-1]_p.

L1L3L5
2.1

By [L2] and [F1], that same class product is [(p1)!]p[(p-1)!]_p. Therefore [(p1)!]p=[1]p[(p-1)!]_p=[-1]_p, which is exactly (p1)!1(modp)(p-1)!\equiv-1\pmod p by [L4].

step 1.1L2L4F1

5 · Examples, counterexamples and false statements

None yet.

Sources