Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions diophantine_classifier/data/families/catalan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Family: Catalan equation
# Schema: see data/families/README.md; prose documentation in docs/FAMILIES.md.
# References are keys into data/references.bib, each with a 'why' annotation.
slug: catalan
name: Catalan equation
priority: 1
status: solved
class: expdioph
form: x^p - y^q = 1, x, y, p, q >= 2
parents:
- exponential-diophantine
matcher: true
methods:
- cyclotomic fields (Mihailescu)
notes: Only solution 3^2 - 2^3 = 1.
examples:
- x^p - y^q = 1
references:
- key: Mihailescu2004
why: the complete solution of Catalan's conjecture
- key: Tijdeman1976
why: the earlier effective finiteness via Baker's method
- key: BiluBugeaudMignotte2014
why: book exposition of the proof
20 changes: 20 additions & 0 deletions diophantine_classifier/solvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1154,6 +1154,25 @@ def rec(k_left, target, minimum, acc):
"permutations give the rest", complete=True)


def _solve_catalan(cls, match):
r"""
Catalan's equation: Mihailescu's theorem.

EXAMPLES::

sage: from diophantine_classifier import solve
sage: solve("x^p - y^q = 1").solutions # unknowns (x, p, y, q)
[(3, 2, 2, 3)]
"""
# 3^2 - 2^3 = 1 in the standard coordinates (x, p, y, q)
standard = {"x": ZZ(3), "p": ZZ(2), "y": ZZ(2), "q": ZZ(3)}
names = _normalized(match)
return SolutionSet(
names, [tuple(standard[v] for v in names)], "finite-complete",
"Mihailescu's theorem: 3^2 - 2^3 = 1 is the only solution in "
"integers > 1", complete=True)


SOLVERS = {
"univariate": _solve_univariate,
"linear": _solve_linear,
Expand All @@ -1164,6 +1183,7 @@ def rec(k_left, target, minimum, acc):
"elliptic-weierstrass": _solve_weierstrass,
"thue": _solve_thue,
"egyptian-fractions": _solve_egyptian,
"catalan": _solve_catalan,
}


Expand Down
8 changes: 8 additions & 0 deletions docs/FAMILIES.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,14 @@ primitive solutions with min ≥ 2 exponents; Fermat–Catalan/Beal conjectures
Poonen–Schaefer–Stoll 2007; Bennett–Chen–Dahmen–Yazdani, "Generalized Fermat
equations: a miscellany" (Int. J. Number Theory 11, 2015).

### `catalan` — Catalan's equation — P1, solved
**Form.** x^p − y^q = 1, x, y > 0, p, q ≥ 2.
**Status.** Only 3² − 2³ = 1 (Mihăilescu 2002/2004, published Crelle 2004), using
cyclotomic fields — no logarithm bounds needed. Tijdeman 1976 had given effective
finiteness.
**References.** Catalan 1844; Tijdeman 1976; Mihăilescu 2004; Bilu–Bugeaud–Mignotte,
*The Problem of Catalan* (2014).


---

Expand Down
1 change: 1 addition & 0 deletions tests/test_classify.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
("x^4 + y^4 + z^4 = w^4", "", "equal-sums-like-powers"), # Elkies
# polynomial-exponential
("x^3 - 4 = y^n", "", "power-values"),
("x^p - y^q = 1", "", "catalan"),
# unit fractions
("1/x + 1/y + 1/z = 1", "", "egyptian-fractions"),
]
Expand Down
7 changes: 7 additions & 0 deletions tests/test_solvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ def test_thue():
assert_valid_solutions("x^3 + 2*y^3 = 11", s.solutions)


def test_catalan():
s = solve("x^p - y^q = 1")
# unknowns ordered (x, p, y, q)
assert s.solutions == [(3, 2, 2, 3)]
assert s.complete


def test_unavailable_carries_hints():
with pytest.raises(SolverUnavailable) as err:
solve("y^2 = x^7 + 3")
Expand Down