6. Abstract Algebra

Fermat's theorem

Fermat's Theorem in abstract algebra connects group theory and number theory by stating that if $p$ is a prime number and $a$ is an integer not divisible by $p$, then $a^{p-1} \equiv 1 \pmod p$, which is also generalized via group actions.

For: UP PGT Mathematics UP TGT Mathematics DSSSB PGT / TGT KVS / NVS PGT LT Grade
📖 Topic progress
○ Mark as complete

Definition and statement

Fermat's Little Theorem (Number Theory) & Fermat's Interior Extremum Theorem (Calculus)
(1) \text{ If } p \text{ is prime and } p \nmid a, \text{ then } a^{p-1} \equiv 1 \pmod p. \\ (2) \text{ If } f: (a, b) \to \mathbb{R} \text{ has a local extremum at } c \in (a, b) \text{ and } f'(c) \text{ exists, then } f'(c) = 0.

📐 Geometric Interpretation

In calculus, at any local maximum or minimum inside an open interval, the tangent line to the curve is perfectly horizontal, yielding a slope of zero ($f'(c) = 0$). In number theory, it reflects the cyclic group structure of the multiplicative group of integers modulo $p$, denoted as $\mathbb{Z}_p^*$.

⚙️ Algebraic & Structural Meaning

Fermat's Little Theorem is a direct corollary of Lagrange's Theorem applied to the finite multiplicative group $(\mathbb{Z}/p\mathbb{Z})^-$ of order $p-1$. It underpins modern public-key cryptography (RSA) and modular arithmetic simplification in competitive examinations.

Conditions and hypotheses

Check each condition and what changes when it is omitted:

Hypothesis / Condition Domain / Interval Necessity What Fails If Condition Dropped
Primality of modulus $p$ (For Number Theory) Modular integers $\mathbb{Z}_p$ Strictly Mandatory If $p$ is composite, $a^{\phi(n)} \equiv 1 \pmod n$ applies instead (Euler's Totient Theorem), and $a^{n-1} \equiv 1 \pmod n$ may fail (e.g., base 2, composite 4).
Existence of Differentiability at Local Extremum (For Calculus) Open interval $(a, b)$ Strictly Mandatory If the function has a sharp corner (e.g., $f(x) = |x|$ at $x=0$), a local extremum exists, but the derivative does not exist, so $f'(c) = 0$ is inapplicable.
Interior Point requirement Strictly $c \in (a, b)$ Essential for conclusion Extrema occurring at boundary endpoints $a$ or $b$ of a closed interval do not guarantee a zero derivative (governed instead by Extreme Value Theorem).

Useful results and shortcuts

Use these identities and results when their conditions apply:

01

Modular Reduction of Powers

$$ a^n \pmod p \equiv a^{n \bmod (p-1)} \pmod p \quad (\text{if } \gcd(a,p)=1) $$

Rule: Reduce large exponents modulo $p-1$ before computing powers to solve congruence questions.

Application: Frequently asked in UP PGT and DSSSB Mathematics for evaluating large modular powers like $3^{2023} \pmod{11}$.
02

Inverse Modulo Prime

$$ a^{-1} \equiv a^{p-2} \pmod p $$

Rule: Use Fermat's theorem to write the modular inverse instantly when $p$ is prime.

03

Critical Point Root Extraction

$$ \text{If } f(x) = x^3 - 3ax + b, \text{ extrema occur at } x = \pm \sqrt{a} $$

Rule: Directly equate $f'(x) = 3x^2 - 3a = 0$ to find critical values instantly without factoring.

Application: Directly tested in UP TGT calculus sections.
04

Sum of Exponents Modulo Prime

$$ \sum_{k=1}^{p-1} k^{p-1} \equiv p-1 \equiv -1 \pmod p $$

Rule: By Fermat's Little Theorem, each non-zero term is $1 \pmod p$, summing to $p-1$ terms.

Application: High-level UP PGT questions testing group theory identities.
05

Polynomial Derivative Root Counting

$$ \text{Between two roots of } f(x), \text{ there lies at least one root of } f'(x) (\text{Rolle's/Fermat linkage}) $$

Rule: Instantly determine the lower bound for the number of roots of derivative equations.

06

Rapid Elimination via Coprimality

$$ \text{If } p \mid a, \text{ then } a^{p-1} \not\equiv 1 \pmod p \text{ (it is } 0 \pmod p) $$

Rule: Instantly eliminate options where base is a multiple of the prime when checking for multiplicative identity 1.

Application: Eliminates distractor options in multiple-choice numerical modular arithmetic.

Common errors and counterexamples

These examples show how a conclusion can fail when a condition is missing:

⚠️ COMMON ERROR #01

Forgetting the Coprimality Condition

Common Pitfall: Applying $a^{p-1} \equiv 1 \pmod p$ when $\gcd(a, p) \neq 1$.

Counterexample: $a = 3, p = 3 \implies 3^{3-1} = 9 \equiv 0 \pmod 3 \neq 1 \pmod 3$

Why it fails: Fermat's Little Theorem requires $p \nmid a$. If $p$ divides $a$, the remainder modulo $p$ is $0$, not $1$.

🛡️ Exam Defense: Always check if $\gcd(a, p) = 1$ before reducing exponents by $p-1$.
⚠️ COMMON ERROR #02

Confusing Fermat's Little Theorem with Euler's Totient Theorem

Common Pitfall: Using $p-1$ when the modulus is a composite number $n$.

Counterexample: For $n = 6$ (composite), $2^{6-1} = 32 \equiv 2 \pmod 6 \neq 1 \pmod 6$

Why it fails: For composite moduli, Euler's totient theorem states $a^{\phi(n)} \equiv 1 \pmod n$, where $\phi(6) = 2 \neq 5$.

🛡️ Exam Defense: Check if the modulus is prime. If composite, calculate $\phi(n)$.

Comparison

Concept / TheoremHypotheses / AssumptionsKey Formula / OutcomeGeometric MeaningExam Identification Clue
Fermat's Little Theorem$p$ is prime, $\gcd(a,p)=1$$a^{p-1} \equiv 1 \pmod p$Cyclic subgroup order divisibilityKeywords: 'remainder', 'modular power', 'prime modulus'
Euler's Totient Theorem$\gcd(a,n)=1$, $n$ is any integer$a^{\phi(n)} \equiv 1 \pmod n$Generalization over reduced residue systemsKeywords: 'composite modulus', 'totient', 'coprime'
Fermat's Interior Extremum$f$ differentiable at local extremum $c \in (a,b)$$f'(c) = 0$Horizontal tangent at peak or troughKeywords: 'local maximum', 'derivative vanishes', 'open interval'
Lagrange's Theorem (Group Theory)$H$ is a subgroup of finite group $G$$|H|$ divides $|G|$Partition of group into cosets of equal sizeQuestions linking group order to element order

Solved examples

Each problem includes a full solution and a shorter method:

CANONICAL PROBLEM 01 Dual-Method Breakdown

Find the remainder when $2^{100}$ is divided by 101.

(A) 1(B) 2(C) 100(D) 50
✓ Correct Answer: (A)
📚 Method A: Formal Textbook Derivation
Step 1: Identify $p = 101$, which is prime. Step 2: Check $\gcd(2, 101) = 1$. Step 3: Apply Fermat's Little Theorem: $2^{100} \equiv 1 \pmod{101}$. Step 4: Conclude remainder is 1.
⚡ Method B: 25-Second Exam Shortcut
Direct application of $a^{p-1} \equiv 1 \pmod p$ with $a=2, p=101$. Exponent $100 = p-1$. Answer is immediately 1.
💡 Tip: Look out for prime moduli where the exponent is exactly $p-1$.
CANONICAL PROBLEM 02 Dual-Method Breakdown

If $f(x) = x^3 - 3x + 2$, at what value of $x$ does the function satisfy Fermat's interior condition for local extrema?

(A) $x = 0$(B) $x = \pm 1$(C) $x = 1$ only(D) $x = -1$ only
✓ Correct Answer: (B)
📚 Method A: Formal Textbook Derivation
Step 1: Differentiate $f'(x) = 3x^2 - 3$. Step 2: Set $f'(x) = 0$ for critical points. Step 3: $3(x^2 - 1) = 0 \implies x = \pm 1$. Step 4: Verify they lie in the interior domain.
⚡ Method B: 25-Second Exam Shortcut
Quickly factor $3(x-1)(x+1)=0$ to spot roots $\pm 1$.
💡 Tip: Remember that $f'(c) = 0$ finds candidates for extrema, which must be tested with second derivatives.

Practice questions

Choose an answer to check it and see the solution:

Q1
What is the remainder when $3^{2022}$ is divided by 7?
A 1
B 2
C 3
D 6
Derivation & Analysis:

Here $p = 7$ (prime) and $\gcd(3,7) = 1$. By Fermat's Little Theorem, $3^6 \equiv 1 \pmod 7$. Dividing the exponent: $2022 = 6 \times 337$, so $3^{2022} = (3^6)^{337} \equiv 1^{337} \equiv 1 \pmod 7$. Correct option is (A).

Q2
If $p$ is a prime number, then by Fermat's Little Theorem, $a^p \pmod p$ is equal to:
A 1
B a
C 0
D p-1
Derivation & Analysis:

By Fermat's Little Theorem, $a^{p-1} \equiv 1 \pmod p$. Multiplying both sides by $a$ gives $a^p \equiv a \pmod p$. This holds for all integers $a$ (including when $p \mid a$). Correct option is (B).

Q3
The modular inverse of $3$ modulo $11$ using Fermat's theorem is:
A 3
B 4
C 7
D 8
Derivation & Analysis:

By Fermat's theorem, $a^{-1} \equiv a^{p-2} \pmod p$. Here $a=3, p=11$. Thus $3^{-1} \equiv 3^{9} \pmod{11}$. Compute powers mod 11: $3^3 = 27 \equiv 5$, $3^6 \equiv 25 \equiv 3$, $3^9 = 3^6 \times 3^3 \equiv 3 \times 5 = 15 \equiv 4 \pmod{11}$. Correct option is (B).

Q4
Fermat's Theorem in calculus states that if $f(x)$ has a local extremum at $c$ and $f'(c)$ exists, then:
A $f'(c) > 0$
B $f'(c) < 0$
C $f'(c) = 0$
D $f'(c) = 1$
Derivation & Analysis:

By definition of Fermat's Interior Extremum Theorem, at any interior local extremum where the derivative exists, the tangent is horizontal, hence $f'(c) = 0$. Correct option is (C).

Q5
Which of the following functions violates the hypotheses of Fermat's Interior Extremum Theorem on $[-1, 1]$ despite having a local minimum at $x = 0$?
A $f(x) = x^2$
B $f(x) = |x|^3$
C $f(x) = |x|$
D $f(x) = \sin x$
Derivation & Analysis:

For $f(x) = |x|$, there is a sharp corner at $x=0$, so $f'(0)$ does not exist. Thus, Fermat's theorem hypothesis fails, although a local minimum exists. Correct option is (C).

Q6
The value of $5^{16} \pmod{17}$ is:
A 1
B 5
C 16
D 2
Derivation & Analysis:

17 is a prime number and $\gcd(5, 17) = 1$. By Fermat's Little Theorem, $5^{17-1} = 5^{16} \equiv 1 \pmod{17}$. Correct option is (A).

Q7
If $G$ is a finite group of order $n$, then for any element $a \in G$, $a^n = e$ is a direct consequence of:
A Intermediate Value Theorem
B Lagrange's Theorem
C Rolle's Theorem
D Taylor's Theorem
Derivation & Analysis:

The order of any element $a$ divides the order of the group $n$ (Lagrange's Theorem), meaning $o(a) \mid n$, which implies $a^n = e$. Fermat's Little Theorem is a special case of this result. Correct option is (B).

Q8
What is the remainder when $2^{10}$ is divided by 11?
A 0
B 1
C 2
D 10
Derivation & Analysis:

11 is prime, and $\gcd(2, 11) = 1$. By Fermat's Little Theorem, $2^{11-1} = 2^{10} \equiv 1 \pmod{11}$. Correct option is (B).

Q9
If $f(x) = x^3$ on $[-1, 1]$, does Fermat's Interior Extremum Theorem guarantee a point $c \in (-1, 1)$ where $f'(c) = 0$?
A Yes, at $c = 0$
B No, because $f(-1) \neq f(1)$
C No, because $f'(0) = 0$ is a point of inflection, not an extremum
D Yes, by Rolle's theorem linkage
Derivation & Analysis:

Fermat's theorem requires a local extremum. For $f(x) = x^3$, $x=0$ is a point of inflection, not a local extremum. (Note: Rolle's theorem requires $f(a)=f(b)$). Correct option is (C).

Q10
If $p$ is a prime number, the number of generators of the multiplicative cyclic group $\mathbb{Z}_p^*$ is given by:
A $p$
B $p-1$
C $\phi(p-1)$
D $\phi(p)$
Derivation & Analysis:

The multiplicative group $\mathbb{Z}_p^*$ is cyclic of order $p-1$. The number of generators of a cyclic group of order $m$ is $\phi(m)$, which here is $\phi(p-1)$. Correct option is (C).

Common questions

No. If the modulus is composite, using $p-1$ will yield incorrect remainders. You must use Euler's Totient Theorem, replacing $p-1$ with $\phi(n)$, where $\phi(n)$ is Euler's totient function.

Candidates frequently forget to check the coprimality condition $\gcd(a, p) = 1$. If $p$ divides $a$, $a^{p-1} \pmod p$ is $0$, not $1$. Additionally, confusing open and closed intervals in calculus questions leads to sign and endpoint errors.

Always reduce the exponent modulo $p-1$ first. For instance, computing $2^{1000} \pmod{13}$ becomes $2^{1000 \pmod{12}} = 2^4 = 16 \equiv 3 \pmod{13}$. This bypasses massive intermediate calculations.