diff --git a/diophantine_classifier/data/families/catalan.yaml b/diophantine_classifier/data/families/catalan.yaml new file mode 100644 index 0000000..1d25e70 --- /dev/null +++ b/diophantine_classifier/data/families/catalan.yaml @@ -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 diff --git a/diophantine_classifier/solvers.py b/diophantine_classifier/solvers.py index b2aa55c..bd84f27 100644 --- a/diophantine_classifier/solvers.py +++ b/diophantine_classifier/solvers.py @@ -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, @@ -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, } diff --git a/docs/FAMILIES.md b/docs/FAMILIES.md index 86434cf..047800c 100644 --- a/docs/FAMILIES.md +++ b/docs/FAMILIES.md @@ -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). + --- diff --git a/tests/test_classify.py b/tests/test_classify.py index e3d6386..7ec2887 100644 --- a/tests/test_classify.py +++ b/tests/test_classify.py @@ -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"), ] diff --git a/tests/test_solvers.py b/tests/test_solvers.py index 1b8b095..e9a242b 100644 --- a/tests/test_solvers.py +++ b/tests/test_solvers.py @@ -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")