On this page
You can check by hand that 3² = 9 leaves remainder 2 when divided by 7. Now find a number whose square leaves remainder 2 when divided by 49. Hensel's lemma turns the answer mod 7 into the answer mod 49 in one line, then mod 343, and so on.
The lemma is named after Kurt Hensel (1861 to 1941), who was born in Königsberg and invented the p-adic numbers in 1897, according to his MacTutor biography. Keith Conrad's notes on Hensel's lemma say Hensel proved it in 1904.
What does Hensel's lemma say?
Hensel's lemma says that if a polynomial has a simple root modulo a prime p, that root lifts to a unique root modulo every higher power of p (Wikipedia, Hensel's lemma).
"Simple" has a precise test: f(a) ≡ 0 mod p and f′(a) ≢ 0 mod p, the hypothesis of the basic version (Theorem 2.1) in Conrad's notes. If you first need to know which numbers are squares mod a prime, start with our explainer on quadratic residues and the Legendre symbol.
How do you lift a root from mod p to mod p²?
Write the lift as x = a + pt and expand. Every term after the first two contains p², so f(a + pt) ≡ f(a) + f′(a)·pt mod p². Because f(a) is a multiple of p, divide through by p to get a congruence mod p for the unknown t:
f′(a)·t ≡ −f(a)/p mod p.
That linear congruence has exactly one solution when f′(a) ≢ 0 mod p, because f′(a) then has an inverse mod p. Rearranged, the lift is a − f(a)·u, where u is that inverse. Wikipedia points out that this recursion is precisely Newton's method, x − f(x)/f′(x), with division replaced by multiplying by an inverse.
Worked example: x² ≡ 2 mod 7, then mod 49 and 343
Here f(x) = x² − 2 and f′(x) = 2x.
Find a root mod 7. The squares of 0 to 6 leave remainders 0, 1, 4, 2, 2, 4, 1, so 3² ≡ 2 and 4² ≡ 2. Take a = 3.
Check the condition. f′(3) = 6 is not a multiple of 7, so the lift exists and is unique.
Find the inverse. 6 × 6 = 36 = 35 + 1, so u = 6.
Lift to 49. f(3) = 7, so 3 − 7 × 6 = −39 ≡ 10 mod 49. Check: 10² = 100 = 2 × 49 + 2.
Lift to 343. f(10) = 98, so 10 − 98 × 6 = −578 ≡ 108 mod 343. Check: 108² = 11,664 = 34 × 343 + 2.
The other root, 4 ≡ −3, lifts to 39 mod 49 and 235 mod 343.
The same u works at every stage, because each lift is still ≡ 3 mod 7, so f′ of it is still ≡ 6 mod 7. These match Wikipedia's 7-adic example, which reaches r₂ = 10 and r₃ = 108 (Wikipedia, Hensel's lemma).
When does Hensel lifting fail?
Try f(x) = x² − 7 with p = 7. Mod 7 the only root is 0, and f′(0) = 0, so the condition fails. Any lift has the form x = 7t, and then x² = 49t² ≡ 0 mod 49, never 7. So x² ≡ 7 mod 49 has no solution.
In the step equation, a zero derivative turns f′(a)·t ≡ c into 0·t ≡ c mod p. If c ≢ 0 there is no lift; if c ≡ 0, every t works. Either way, the guarantee of exactly one lift is gone.
Conrad's notes show both outcomes for cubics mod 2: a multiple root that does not lift even to mod 4, and another that does lift, which the basic version cannot explain (Conrad, Examples 2.6 and 2.7).
How does lifting build a p-adic square root of 2?
Write each lift in base 7. 108 = 3 + 1 × 7 + 2 × 49, so the root mod 343 has digits 3, 1, 2 read from the units up. Each new lift adds one digit and never changes the earlier ones.
Carried on forever, the digits give 3 + 7 + 2·7² + 6·7³ + 7⁴ + 2·7⁵ + 7⁶ + 2·7⁷ + 4·7⁸ + ⋯, a square root of 2 in the 7-adic integers (Wikipedia, Hensel's lemma). The p-adic number article credits Hensel with this method of lifting solutions mod p to mod p², p³ and onwards. Why such endless expansions form a number system is the subject of our explainer on p-adic numbers, where size is measured by divisibility.
A checklist for lifting any root
Find a root a mod p; for a small p, test every residue.
Compute f′(a) mod p. If it is 0, the basic lemma promises nothing, so test the lifts by hand.
Find u, the inverse of f′(a) mod p.
Repeat aₙ₊₁ = aₙ − f(aₙ)·u, reducing mod the next power of p, and substitute back each time.
If a step goes wrong, the Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning. For the ideas underneath, such as modular inverses and congruences, the Fermi Concept Library covers every concept in mathematics, each with its own lesson.



