fontsize=, breaklines, bgcolor=lightgray, framesep=2mm 11institutetext: Yonsei University 11email: [email protected] 22institutetext: University of California, Berkeley 22email: [email protected]
Formalizing Mason–Stothers Theorem and its Corollaries in Lean 4
Abstract
The ABC conjecture implies many conjectures and theorems in number theory, including the celebrated Fermat’s Last Theorem. Mason–Stothers Theorem is a function field analogue of the ABC conjecture that admits a much more elementary proof with many interesting consequences, including a polynomial version of Fermat’s Last Theorem. While years of dedicated effort are expected for a full formalization of Fermat’s Last Theorem, the simple proof of Mason–Stothers Theorem and its corollaries calls for an immediate formalization.
We formalize an elementary proof of by Snyder in Lean 4, and also formalize many consequences of Mason–Stothers, including (i) non-solvability of Fermat–Cartan equations in polynomials, (ii) non-parametrizability of a certain elliptic curve, and (iii) Davenport’s Theorem. We compare our work to existing formalizations of Mason–Stothers by Eberl in Isabelle and Wagemaker in Lean 3 respectively. Our formalization is based on the mathlib4 library of Lean 4, and is currently being ported back to mathlib4.
Keywords:
Formalization Number Theory ABC Conjecture Fermat’s Last Theorem Lean Theorem Prover mathlib1 Introduction
Conjecture 1 (ABC conjecture)
For every positive real number , there exist only finitely many triples of coprime integers such that and
Here, is the product of all prime factors of .
The conjecture implies many deep theorems or conjectures in number theory. For example, Fermat’s Last Theorem (FLT) for exponent is a direct corollary of an explicit quantitative version of the ABC conjecture [9], while the currently known proof by Wiles [25] and Taylor-Wiles [22] requires heavy machinery (See [3] for detailed surveys). Also, Roth’s theorem [17] and Faltings’ theorem [8] both follow from the ABC conjecture [23]; note that the proof of each theorem earned its corresponding author a Fields medal.
In number theory, there is a strong analogy between number fields (e.g., rational numbers ) and function fields of a smooth projective curve over (e.g., rational function field ). Under this analogy, profound statements on integers , such as the Riemann Hypothesis, the Birch and Swinnerton-Dyer conjecture, or the Langlands program, have analogous statements [5, 6, 11, 21] on the integral ring of the rational function field . The analogs of such conjectures often turn out to be true and easier to prove in general.
In this line, Stothers proved the polynomial analog of the ABC conjecture in 1981 [20], and Mason rediscovered it in a more general form in 1983 [14], even before Osterlé and Masser proposed the ABC conjecture.
Definition 1
Let be any field. For any nonzero , define the radical of as the product of all irreducible monic factors of not counting multiplicity.
Theorem 1.1 (Mason–Stothers)
Let be any field and be non-zero, pairwise coprime polynomials satisfying . Then we either have where denotes the (formal) derivative of by , or
Mason and Stothers proved the theorem using algebro-geometric methods, and subsequently Snyder discovered a short and purely elementary proof [19]. Like the ABC conjecture, the Mason–Stothers theorem has a lot of interesting consequences as the following.
We give a fully documented Lean 4 formalization of the Mason–Stothers theorem on fields of arbitrary characteristic. Also, we formalize the aforementioned corollaries of the theorem to demonstrate the power of Mason–Stothers theorem (Theorem 2.1, 2.2, and 2.3). The code is hosted in
https://github.com/seewoo5/lean-poly-abc.
and is currently being ported to mathlib4 (see Appendix 0.A).
The Mason–Stothers theorem was already formalized by Eberl in Isabelle [7] and Wagemaker in Lean 3 [24]. We give a detailed comparison between our work and theirs in Section 7. In short, our formalization works for arbitrary characteristic (see Section 7.2), is compatible with the mathlib4 library of Lean 4, includes variants of Mason–Stothers (e.g. Theorem 6.1), and formalizes several interesting corollaries including the polynomial FLT with a slightly stronger conclusion than existing formalization (see Section 7.1).
2 Statements of the Theorem and its Corollaries
The precise statement of Mason–Stothers theorem we formalize is Theorem 1.1, which holds for arbitrary field . Note that most literature either assumes that is of characteristic zero or is algebraically closed [20, 19].
If has characteristic zero, the condition in Theorem 1.1 is equivalent to being constants. If has characteristic , then the condition for is equivalent to being a polynomial of . Indeed,
is an example satisfying and , but
We now state the corollaries of the Mason–Stothers theorem mentioned in Section 1 precisely. Their proofs can be found in Section 6.
The Fermat–Catalan conjecture is a generalization of Fermat’s Last Theorem stating that the equation has only finitely many solutions in positive integers satisfying [9]. The following Theorem 2.1 is a polynomial variant which is true.
Theorem 2.1 (Fermat–Catalan Conjecture for Polynomials)
Let be any field. Let be integers not divisible by the characteristic of such that . Let be arbitrary nonzero constants. Then any triple of nonzero and pairwise coprime polynomials in satisfying should be constants .
Let and in Theorem 2.1 to recover the Fermat’s Last Theorem for polynomials.
Corollary 1 (Fermat’s Last Theorem for Polynomials)
Let be any field. Let be any integer not divisible by the characteristic of . Then any triple of nonzero and pairwise coprime polynomials in satisfying should be constants .
Using Theorem 2.1, we can obtain the following corollary.
Theorem 2.2 (Non-parametrizablility of an Elliptic Curve)
Let be a field of characteristic . If rational functions satisfy , then both and are constants in .
In other words, the elliptic curve defined by the Weierstrass equation is not parametrizable by non-constant rational functions in .
Another interesting corollary of Mason–Stothers theorem is the following theorem by Davenport [4] initially conjectured [2] by Birch et al. This theorem motivated Stothers’ proof of the Mason–Stothers theorem [20].
Theorem 2.3 (Davenport)
Let be a field of characteristic zero. Let be non-constant polynomials such that . Then
3 Mathematical Proof of Mason–Stothers Theorem
We summarize the proof of Mason–Stothers theorem (Theorem 1.1) in Lemmermeyer’s note [12] that we formalize.
Definition 2
The Wronskian of two polynomials is , where is the (formal) derivative of with respect to .
From we can check that the values , , and are all equal. Denote the common value as .
Next, we observe the following property.
Lemma 1
For a nonzero polynomial , divides .
For a proof, we can use the prime factorization of . Let be a factorization with unit and primes of exponents . Then the product rule of derivative gives which is divisible by . An immediate corollary is that
Lemma 2
For any nonzero , divides
because divides both and .
The pairwise coprime polynomials , , and all divide . So their product should also divide . This is the key step of the proof. Divide the case into whether is zero or not. If , then implies , and since and are coprime divides and so . Likewise, from we also get .
Now assume . Then dividing implies
The first inequality follows from divisibility, and the second inequality follows from the definition of Wronskian and . Hence we have . The same argument with and gives
4 Basic Definitions
Now we explain our formalization of the proof of Mason–Stothers in Section 3. The frst step to develop an interface for the radical (Definition 1) and Wronskian (Definition 2) of polynomials.
4.1 Wronskian
We formalize the Wronskian of any two polynomials with coefficients in an arbitrary commutative ring .
lean variable R : Type* [CommRing R]
def wronskian (a b : R[X]) : R[X] := a * (derivative b) - (derivative a) * b
The degree of Wronskian is strictly smaller than , which was one of the last steps in our proof of Theorem 1.1.
lean theorem wronskian.natDegree_lt_add a b : R[X] (hw : wronskian a b 0) : natDegree (wronskian a b) ¡ natDegree a + natDegree b
For a polynomial a in Lean 4’s mathlib4, both degree a and natDegree a denote the degree of a. The difference between the two is that the natDegree has type of natural numbers, while the degree has type WithBot which is equipped with . The natDegree of zero polynomial is defined as 0, while the degree of that is defined as . While degree is mathematically more natural, we opt to use natDegree as its type is much easier to work in Lean 4 than the extended type WithBot .
We use that for any with in our proof. This identity actually holds for any alternating bilinear map on any -module . Thus we add the general theorem in the relevant place of mathlib4.111Mathlib.LinearAlgebra.BilinearForm.Properties
lean theorem eq_of_add_add_eq_zero [IsCancelAdd R] a b c : M (H : B.IsAlt) (hAdd : a + b + c = 0) : B a b = B b c
Note that the above theorem is stated for a slightly general class of called IsCancelAdd, where the additive structure is not necessarily a group but still satisfy the cancellation law: for any , .
4.2 Radical
Recall that for any field and nonzero , its radical is defined as the product of all irreducible monic factors of not counting multiplicity. In fact, such a definition works over any multiplicative monoid with zero that is
-
1.
commutative,
-
2.
cancellative ( for nonzero ),
-
3.
a unique factorization monoid, in the sense that each nonzero element admits a unique factorization into irreducible elements, and
-
4.
a normalization monoid, equipped with a map to the set of units of preserving multiplication. The map is then called the normalization map.
In particular, for polynomials the map in (4) reads the leading coefficient of a nonzero polynomial. The corresponding normalization map sends a polynomial to its scalar multiple which is monic.
In mathlib4, these assumptions can be imposed on a monoid by using the following instances on .
-
(i)
CancelCommMonoidWithZero (for 1 and 2)
-
(ii)
UniqueFactorizationMonoid (for 3)
-
(iii)
NormalizationMonoid (for 4)
To define the radical of , we first extract the multiset of normalized factors of from mathlib4 using normalizedFactors a. Here, a multiset is essentially a set allowing duplicated elements. Then we convert it to a finite set (.toFinset) to get rid of duplicated elements, and multiply them all to get the radical of .
lean variable M : Type* [CancelCommMonoidWithZero M] [UniqueFactorizationMonoid M] [NormalizationMonoid M]
/– Prime factors of ‘a‘ are monic factors of ‘a‘ without duplication. -/ def primeFactors (a : M) : Finset M := (normalizedFactors a).toFinset
/– Radical of ‘a‘ is a product of prime factors of ‘a‘. -/ def radical (a : M) : M := (primeFactors a).prod id
In case of polynomials , any radical is a monic polynomial, and for any constant including zero.222The set of normalized factors of zero or a unit is an empty set in mathlib. The product of elements in an empty set is then defined as 1 in mathlib.
Radical satisfies the power law: for . {minted}lean theorem radical_pow (a : M) n : Nat (hn : 0 ¡ n) : radical (a ^n) = radical a
Also, divides . Although this is obvious from unique factorization, Lean is not aware of this intuition. A formal proof uses basic lemmas in mathlib4333e.g., If a multiset is contained in , the product of elements in divides that of (Multiset.prod_dvd_prod_of_le). to boil down the proof to that the Multiset of prime factors of contains, as a subset, the same set with duplicated elements removed. {minted}lean theorem radical_dvd_self (a : M) : radical a — a
Once we restrict our attention to a commutative domain with unique factorization, we can also prove multiplicativity of radical for coprime elements , i.e. . We also have . These basic lemmas will be used frequently in the main proof.
lean variable R : Type* [CommRing R] [IsDomain R] [NormalizationMonoid R] [UniqueFactorizationMonoid R]
theorem radical_hMul a b : R (hc : IsCoprime a b) : radical (a * b) = (radical a) * (radical b)
theorem radical_neg a : R : radical (-a) = radical a
The following seems obvious to the human eye.
Lemma 3
For any field and a polynomial of degree , the degree of its radical is also at least one.
A formal proof of Lemma 3 requires more work, however. We need to explicitly take a prime factor of and show that it is also a prime factor of . We first show that for any element of a general monoid , a prime divides if and only if it divides ; this is done by using that the prime divisors of and are the same. {minted}lean theorem prime_dvd_radical_iff a p : M (ha : a 0) (hp : Prime p) : p — radical a p — a We then use it to show that nonzero is a unit if and only if is. Note that an element of is a unit if and only if it has no prime divisor. {minted}lean theorem radical_isUnit_iff a : M (h : a 0) : IsUnit (radical a) IsUnit a Then we specialize it to and use that nonzero is a unit if and only if its degree is zero, proving Lemma 3. {minted}lean lemma natDegree_radical_eq_zero_iff a : k[X] : (radical a).natDegree = 0 a.natDegree = 0
The fraction is a polynomial which will be used frequently in the proof. We define this as divRadical f in our formalization.
lean def divRadical (a : k[X]) : k[X] := a / radical a The division notation actually denotes the quotient of two polynomials as in the Euclidean division algorithm. Using that the radical divides the polynomial (radical_dvd_self), we define lemmas that introduces and eliminates divRadical f as it is multiplied by radical f. With this, we do not need to work with division explicitly and only work with multiplications, which is easier to handle with Lean 4 tactics like ring.
lean theorem eq_divRadical a x : k[X] (h : (radical a) * x = a) : x = divRadical a
theorem mul_radical_divRadical (a : k[X]) : (radical a) * (divRadical a) = a
Now we need to prove Lemma 1 that for any , divides . {minted}lean theorem divRadical_dvd_derivative (a : k[X]) : (divRadical a) — (derivative a) Our formalization does not explicitly use the factorization which is somewhat cumbersome to work in Lean. Instead, we use the coprime induction in mathlib4.444Available as induction_on_coprime in mathlib4. We first prove the result for units and prime powers . Then we show that for any coprime satisfying the lemma, their product also satisfies the lemma. This makes the derivative much easier to manipulate than the derivative of full factorization.
5 Formalization of Mason–Stothers theorem
Finally, Mason–Stothers theorem is formalized as follows. Note that k is a field of arbitrary characteristic with only [Field k] assumed.
lean variable k : Type* [Field k]
theorem Polynomial.abc a b c : k[X] (ha : a 0) (hb : b 0) (hc : c 0) (hab : IsCoprime a b) (hsum : a + b + c = 0) : (derivative a = 0 derivative b = 0 derivative c = 0) Nat.max3 a.natDegree b.natDegree c.natDegree + 1 (radical (a * b * c)).natDegree
We only require coprimality of and , as can be deduced from and . Because are nonzero, there is no difference in using natDegree instead of degree.
To formalize Mason–Stothers, we first formalize the proof of mentioned as the key step of the proof in Section 3. Then we define an auxiliary lemma below that derives from .
lean private theorem abc_subcall a b c w : k[X] hw : w 0 (wab : w = wronskian a b) (ha : a 0) (hb : b 0) (hc : c 0) (hab : IsCoprime a b) (hbc : IsCoprime b c) (hca : IsCoprime c a) (abc_dr_dvd_w : (a * b * c).divRadical — w) : c.natDegree + 1 (radical (a * b * c)).natDegree
Once the auxiliary lemma is shown, we apply this three times to the permuted triples , , and to prove the full Mason–Stothers. While it is evident that the conditions of abc_subcall are symmetric, we have to manually permute them in our formalization (e.g., change the product a * b * c to b * c * a in abc_dr_dvd_w). This, however, costs much less than repeating the whole argument for to and .
6 Formalization of Corollaries
We also formalize multiple corollaries of Mason–Stothers (Theorems 2.1, 2.2 and 2.3).
6.1 Fermat–Catalan Conjecture for Polynomials (Theorem 2.1)
6.1.1 Mathematical Proof
Theorem 2.1 basically follows from Mason–Stothers applied to the triple . Let
If the inequality holds, then we have
which is a contradiction. So by Mason–Stothers it should be that . As none of or are zero in , we conclude . If the characteristic of is zero, then immediately implies that are constants.
If the characteristic of is positive, we need an extra infinite descent argument to show that are constants. For , that in implies the existence of such that . Hence we have . Substitution gives , giving rise to a new nontrivial solution with strictly smaller yet nonzero degrees. Repeated application of this descent in degree leads to contradiction.
6.1.2 Formalization
The full statement of Theorem 2.1 we formalize is the following.
lean theorem Polynomial.flt_catalan p q r : (hp : 0 ¡ p) (hq : 0 ¡ q) (hr : 0 ¡ r) (hineq : q * r + r * p + p * q p * q * r) (chp : ringChar k — p) (chq : ringChar k — q) (chr : ringChar k — r) a b c : k[X] (ha : a 0) (hb : b 0) (hc : c 0) (hab : IsCoprime a b) u v w : k (hu : u 0) (hv : v 0) (hw : w 0) (heq : C u * a ^p + C v * b ^q + C w * c ^r = 0) : a.natDegree = 0 b.natDegree = 0 c.natDegree = 0
We state the inequality as instead, as this is expressible purely in integers which is easier to work with in Lean 4. In mathlib, for any element u : k in field the notation C u : k[X] denotes the same value in ring .
To formalize Theorem 2.1, we first factor the part of the proof where we show . {minted}lean theorem Polynomial.flt_catalan_deriv /-…same condition as flt_catalan…-/ : derivative a = 0 derivative b = 0 derivative c = 0
We then formalize the infinite descent argument in Section 6.1.1 to show that the degree of is zero. If the characteristic of is nonzero, we apply a strong induction555Nat.case_strong_induction_on in mathlib4 on the degree of . {minted}lean theorem Polynomial.flt_catalan_aux /-…same condition as flt_catalan…-/ : a.natDegree = 0 Then we use this auxiliary step three times to formalize Theorem 2.1.
FLT for polynomial (Corollary 1) then immediately follows by considering the case when and , .
lean theorem Polynomial.flt n : (hn : 3 n) (chn : ringChar k — n) a b c : k[X] (ha : a 0) (hb : b 0) (hc : c 0) (hab : IsCoprime a b) (heq : a ^n + b ^n = c ^n) : a.natDegree = 0 b.natDegree = 0 c.natDegree = 0
6.2 Non-parametrizability of (Theorem 2.2)
6.2.1 Mathematical proof
As a corollary of Theorem 2.1, we can show that is not parametrizable by rational functions of , similarly as in [12, Proposition 2.3.1].
Assume that a parametrization exists, so that and for some with and . By clearing denominators, we obtain . From this one can show that and divide each other. Using the unique factorization of , we can find and such that and . Now the equation reduces to , which is a nontrivial solution for the Fermat-Catalan equation with . This is a contradiction as the characteristic of is not or .
6.2.2 Formalization
The statement can be formalized as follows.
lean def IsConst (x : RatFunc k) := c : k, x = RatFunc.C c
theorem no_parametrization_y2_x3_1 (chk : ringChar k — 6) x y : RatFunc k (eqn : y ^2 = x ^3 + 1) : IsConst x IsConst y
The formalization is straightforward, but requires a large body of code for algebraic manipulation. Also, we had to formalize certain number-theoretic properties coming from that is a UFD. For example, that and divides each other impling the existence of such that and are associated to and respectively, which is true for any UFD.
lean theorem associated_pow_pow_coprime_iff a b : k[X] (ha : a 0) (hb : b 0) m n : (hm : m 0) (hn : n 0) (h : Associated (a ^m) (b ^n)) (hcp : m.Coprime n) : c : k[X], c 0 Associated a (c ^n) Associated b (c ^m)
6.3 Davenport’s Theorem (Theorem 2.3)
6.3.1 A Non-coprime Variant of Mason–Stothers Theorem
Davenport’s theorem also almost directly follows from Mason–Stothers theorem. We start with a variant of Mason–Stothers theorem by Stothers [20] that does not require coprimality of .
Theorem 6.1
Let be any field of characteristic zero, and be non-zero polynomials satisfying . Then we either have or
Note that we need to have characteristic zero in Theorem 6.1. If , then a counterexample is .
Proof
Let be the gratest common divisor of and . Then for with . Moreover, so are nonzero and pairwise coprime. By applying Theorem 1.1 to , we either have or
(1) |
Consider the case . Since have characteristic zero, . If then the proof is done. Otherwise, by Lemma 3 so
and the proof is done too.
The variant Theorem 6.1 is formalized as following. {minted}lean theorem Polynomial.abc’_char0 [CharZero k] a b c : k[X] (ha : a 0) (hb : b 0) (hc : c 0) (hsum : a + b + c = 0) : (a.natDegree = 0 b.natDegree = 0 c.natDegree = 0) Nat.max3 a.natDegree b.natDegree c.natDegree + 1 (radical a).natDegree + (radical b).natDegree + c.natDegree
6.3.2 Mathematical proof
We now prove Davenport’s theorem (Theorem 2.3), mainly following the proof in Stothers’ paper [20].666Our proof is slightly more streamlined; we do not divide the proof into cases on whether or not. For non-constant polynomials with , apply Theorem 6.1 to the zero-sum triple . The equality case
cannot happen since it would imply and thus .
So we get the inequality
This gives two inequalities
and adding these two inequalities and rearranging gives the desired inequality.
6.3.3 Formalization
The statement of Davenport’s theorem (Corollary 2.3) can be formalized as follows. {minted}lean theorem Polynomial.davenport [CharZero k] a b : k[X] (ha : a.natDegree ¿ 0) (hb : b.natDegree ¿ 0) (hnz : a ^3 - b ^2 0) : a.natDegree + 2 2 * (a ^3 - b ^2).natDegree
We also formalized a variant of Davenport’s theorem that allows arbitrary characteristics, with the cost of assuming coprimality of two polynomials and assuming non-vanishing derivative instead of non-constantness. Note that we cannot remove all of these assumptions; with gives a counterexample.
lean theorem Polynomial.davenport’ a b : k[X] (hab : IsCoprime a b) (haderiv : derivative a 0) (hbderiv : derivative b 0) : a.natDegree + 2 2 * (a ^3 - b ^2).natDegree
7 Comparison with Previous Works
We compare our work to other formalizations of the Mason-Stothers Theorem by Eberl in Isabelle [7] and by Wagemaker in Lean 3 [10, 24].777Note that an unpublished Coq formalization by Assia Mahboubi is also reported in [24, Chapter 5]. We do not compare our work to this as it is not publicly available. All three formalizations, including ours, are based on the same proof by Lemmermeyer’s note [12] on the elementary proof of Snyder [19]. Unlike Snyder’s original proof [19] which assumes that is algebraically closed, all formalizations work with any field using radicals, following [12, Theorem 2.1.4, Corollary 2.1.5].
Eberl [7] | Wagemaker [10] | Ours | |
Radical | radical | rad | radical |
radical_mult_coprime | rad_mul_eq_rad_mul_rad_of_coprime | radical_hMul | |
degree_pderiv_mult_less888Eberl formalized instead and used it twice. | degree_wron_le | natDegree_lt_add | |
([12, Lemma 2.1.2]) | poly_div_radical_dvd_pderiv | Mason_Stothers_lemma999Doest not exactly prove ; see Section 7.2 for details. | divRadical_dvd_derivative |
Mason–Stothers | Mason_Stothers | Mason_Stothers | Polynomial.abc |
Mason_Stothers_char_0 | |||
Polynomial FLT | fermat_poly | - | Polynomial.flt |
fermat_poly_char_0 |
7.1 Eberl’s Isabelle formalization
Eberl formalized both the characteristic zero and positive case of Mason–Stothers theorem in Isabelle [7], as a part of the Archive of Formal Proofs (Isabelle-AFP) mathematics library. Consequently, their formalization is reusable with other definitions and theorems in Isabelle-AFP. We compare their formalization to ours as follows.
-
1.
They define the radical on any factoral semiring, which is a commutative ring with unique factorization. We define radical in a slightly more general setting of monoids with unique factorization.
-
2.
They assume the coprimality condition 101010cop: "Gcd {A, B, C} = 1" in Isabelle in Mason–Stothers, but this is equivalent to pairwise coprimality we assume by .
-
3.
Their work also formalizes the polynomial version of FLT for any characteristic. They proved that, when a triple of nonzero coprime polynomials satisfy and at least one of , , or is nonzero111111deg: " in Isabelle, then . In other words, nonzero coprime polynomials satisfying the Fermat’s equation for should have . Our formalization of polynomial FLT (Corollary 1) has a strictly stronger conclusion; either the characteristic of divides , or .121212Our condition implies the conclusion of Eberl’s version immediately. On the other hand, let be of characteristic , let be any number not divisible by , and let . Then holds, satisfying the conclusion of Eberl’s, but observe that is not a constant. This is achieved by the simple infinite descent argument in Section 6.1.1.
7.2 Wagemaker’s Lean 3 formalization
Wagemaker formalized the Mason–Stothers theorem in Lean 3, in the early days when the Lean mathlib mathematics library was taking shape [10, 24]. Consequently, Hőlzl and Wagemaker built a large body of work (“4/5 of the formalization” according to Wagemaker [24]) that formalizes many fundamental notions such as polynomials, UFDs, greatest common divisor, and coprimality [10]. Their work was then incorporated into the current mathlib/mathlib4 library of Lean 3 and 4. In particular, the design suggestions [24] in Wagemaker’s work shapes a lot of fundamental APIs in the current mathlib implementation of UFDs.131313For an example, he observed that the notion of greatest common divisor in a general UFD should have the type of quotients of modulo associated elements, which is now available as Associates in mathlib4..
Their project was independent of Lean 3’s mathlib, however, as it was incorporated after its completion. In contrast, our work builds on the now-mature mathlib4 of Lean 4, ensuring reusability with existing definitions. In regards to the formalization of Mason–Stothers theorem, we compare their work to ours as follows.
-
1.
They work on fields of characteristic zero only, while our formallization allows arbitrary characteristic.
-
2.
They do not formalize further corollaries of Mason–Stothers such as polynomial FLT.
-
3.
Their work misses the proof that a polynomial ring over a unique factorization domain is also a unique factorization domain.141414This is represented as a sorry in poly_over_UFD.lean of [10]. In contrast, our formalization on Lean 4 is complete, and is based on the current mathlib4 with the proof that is UFD (and many more).
- 4.
Eberl [7] | Wagemaker [10, 24] | Ours | ||
---|---|---|---|---|
Language | Isabelle | Lean 3 | Lean 4 | |
Complete | O | X | O | |
Mason-Stothers | O | O | O151515Includes a non-coprime variant (Theorem 6.1) by Stothers. | |
O | X | O | ||
Poly-FLT | O | X | O | |
O | X | O161616Stronger conclusion than Eberl [7] as described in Section 7.1. | ||
Other corollaries | X | X | O |
8 Future Works
We suggest further directions in formalizing generalizations of Mason–Stothers theorem.
-
•
Bayat et al. [1] extends the Mason–Stothers theorem to more than three polynomials, using the Wronskian of more than two polynomials.
-
•
In algebraic geometry, it is known that rational maps from the projective line to a curve exist only if the curve has genus 0. This immediately proves both FLT for polynomials and non-parametrizability of any elliptic curves, as the Fermat curve () and elliptic curve have genus [12]. However, the current mathlib4 does not have enough theorems to prove this result (e.g. Riemann–Hurwitz formula).
-
•
Mason–Stothers theorem can be thought as the most basic case of ABC over a function field of a smooth projective curve , when the curve is the projective line over . Mason [13] proved the following more general result:
Theorem 8.1 (Mason)
Let be an algebraically closed field and be a smooth projective curve over . Let satisfying , and be a finite subset of points in containing all the zeros and poles of and . Then either or
When , this reduces to the Mason–Stothers theorem: a zero-sum coprime triple of polynomials gives , and the above inequality becomes
where and . Silverman [18] gives a short proof of the theorem using Riemann-Hurwitz formula.
Acknowledgement
We thank Kevin Buzzard for suggesting the project. Also, we thank Thomas Browning for his help in simplifying the formalization of Davenport’s theorem. We also thank the reviewers of mathlib4 who helped improving our codes and porting them into mathlib4, including Johan Commelin, Yaël Dillies, and Eric Weiser. Jineon Baek acknowledges the support from Korea Foundation for Advanced Studies during the completion of this work.
Appendix 0.A Porting to mathlib4
We are in the process of integrating our formalization of the Mason–Stothers theorem to the mathlib4 library. Table 3 lists the pull requests made so far to mathlib4 as of August 23, 2024.
Topic | PR | Descriptions |
---|---|---|
Wronskian | 14281 | Prove for alternating bilinear . |
14243 | Define Wronskian of polynomials and prove relevant theorems. | |
Radical | 14873 | Define radical of elements. |
15531 | Prove theorems on radicals of coprime elements. | |
Mason–Stothers | 15706 | Proof of Mason–Stothers theorem. |
Polynomial FLT | 16060 | Statement of FLT for semirings, allowing nonzero unit solutions. |
References
- [1] Bayat, M., Teimoori, H., Hassani, M.: An extension of ABC-theorem. Sci. Magna 1(2), 81–88 (2005)
- [2] Birch, B.J., Chowla, S., Hall, Jr., M., Schinzel, A.: On the difference . Norske Vid. Selsk. Forh. (Trondheim) 38, 65–69 (1965)
- [3] Cornell, G., Silverman, J.H., Stevens, G.: Modular forms and Fermat’s last theorem. Springer Science & Business Media (2013)
- [4] Davenport, H.: On . Norske Vid. Selsk. Forh. (Trondheim) 38, 86–87 (1965)
- [5] Deligne, P.: La conjecture de Weil. I. Inst. Hautes Études Sci. Publ. Math. pp. 273–307 (1974)
- [6] Deligne, P.: La conjecture de Weil. II. Inst. Hautes Études Sci. Publ. Math. pp. 137–252 (1980)
- [7] Eberl, M.: The mason–stothers theorem. Archive of Formal Proofs (December 2017), https://isa-afp.org/entries/Mason_Stothers.html, Formal proof development
- [8] Faltings, G.: Endlichkeitssätze für abelsche Varietäten über Zahlkörpern. Invent. Math. 73(3), 349–366 (1983)
- [9] Granville, A., Tucker, T.J.: It’s as easy as . Notices Amer. Math. Soc. 49(10), 1224–1231 (2002)
- [10] Hölzl, J., Wagemaker, J.: mason-stother. https://github.com/johoelzl/mason-stother (2017)
- [11] Lafforgue, L.: Chtoucas de Drinfeld et correspondance de Langlands. Invent. Math. 147(1), 1–241 (2002)
- [12] Lemmermeyer, F.: Mason’s theorem. https://www.fen.bilkent.edu.tr/~franz/ag05/ag-02.pdf
- [13] Mason, R.C.: The hyperelliptic equation over function fields. Math. Proc. Cambridge Philos. Soc. 93(2), 219–230 (1983)
- [14] Mason, R.C.: Diophantine equations over function fields, London Mathematical Society Lecture Note Series, vol. 96. Cambridge University Press, Cambridge (1984)
- [15] Masser, D.W.: Open problems. In: Proceedings of the symposium on Analytic Number Theory, London, 1985. Imperial College (1985)
- [16] Oesterlé, J.: Nouvelles approches du “théoreme” de fermat. Astérisque 161(162), 165–186 (1988)
- [17] Roth, K.F.: Rational approximations to algebraic numbers. Mathematika 2, 1–20; corrigendum, 168 (1955)
- [18] Silverman, J.H.: The -unit equation over function fields. Math. Proc. Cambridge Philos. Soc. 95(1), 3–4 (1984)
- [19] Snyder, N.: An alternate proof of Mason’s theorem. Elem. Math. 55(3), 93–94 (2000)
- [20] Stothers, W.W.: Polynomial identities and Hauptmoduln. Quart. J. Math. Oxford Ser. (2) 32(127), 349–370 (1981)
- [21] Tate, J.: On the conjectures of Birch and Swinnerton-Dyer and a geometric analog. In: Séminaire Bourbaki, Vol. 9, pp. Exp. No. 306, 415–440. Soc. Math. France, Paris (1995)
- [22] Taylor, R., Wiles, A.: Ring-theoretic properties of certain Hecke algebras. Ann. of Math. (2) 141(3), 553–572 (1995)
- [23] Van Frankenhuysen, M.: The abc conjecture implies roth’s theorem and mordell’s conjecture. Mat. Contemp 16, 45–72 (1999)
- [24] Wagemaker, J.: A formally verified proof of the mason-stothers theorem in lean (2018), https://matryoshka-project.github.io/pubs/wagemaker_bsc_thesis.pdf
- [25] Wiles, A.: Modular elliptic curves and Fermat’s last theorem. Ann. of Math. (2) 141(3), 443–551 (1995)