This post aims to use a novel method using the package Haskell package SBV to solve an easy to state, but tricky problem.
Question. What is the longest non-trivial arithmetic progression that is a subset of a geometric progession?
This was an open question of K. Zarankiewicz which was solved by Schinzel in 1962. In this article, we re-write the tedious calculations in a Haskell program and extend the proof in the original article to extra cases. In order to formalize the question we first define a few notions
The question can be reframed as the following: What is the largest \(k\) such that \(P(k)\) is true. It makes sense check some cases where \(k\) is small.
(Longest a.p in a g.p) If there is an arithemtic progression of length at least \(3\) that is a subset of \((\xi^i)_{i \in \mathbb{Z}}\) then we have that \(\xi = 0\) or \(\xi\) is a root of unity (i.e, \(\exists m \in \mathbb{N}\) such that \(\xi^m = 1\))
Definition. Given a polynomial \(p \in \mathbb{Z}[x]\), we define the reversal of \(p\) by \[p^\dagger = x^{\deg p}p(1/x)\]
Proof (Uniquely positive form) We write \(p = \pi_1 \cdots \pi_n\) where \(\pi_i\) are irreducible and \(\pi_1 , \ldots, \pi_k\) are symmetric. If \(k \leq n-2\) then we have that on setting \(p_1 = \pi_1\cdots \pi_{n-2} \pi_{n-1} \pi_n^\dagger\), we note that \(p_1 \neq p\) but \(p_1p_1^\dagger = pp^\dagger\). Thus if \(p\) is to be uniquely symettric then we have that \(k \geq n-1\) and so \(p = sf\) where \(s\) is symmetric and \(f\) is irreducible. We note that if \(q = \mu_1 \cdots \mu_l\) where \(\mu_i\) are irreducible, then we have that \(pp^\dagger = \pm qq^\dagger\) if and only if \(l = n\) and there is a permuations \(\sigma\) of \(\{1,\ldots,n\}\) such that for all \(i\) we have that either \(\pi_i = \pm \mu_{\sigma(i)}\) or \(\pi_i = \pm \mu_{\sigma(i)}^\dagger\). Therefore if \(p = sf\) where \(s\) is symmteric and \(f\) is irreducible then we have that for all \(i \leq n-1\) we have that \(\pi_i = \pm \mu_{\sigma(i)}\). Therefore the only possiblilites for \(q\) are \(\pm \pi_1 \cdots \pi_{n-1}\pi_n\) or \(\pm \pi_1 \cdots \pi_{n-1}\pi_n^\dagger\). Thus \(q = \pm p\) or \(q = \pm p^\dagger\).
Thus if we can show that a polynomial is uniquely positive, and we know it’s “symmetric part” (that is the maximal divisor \(s\) that satisfies \(s = s^\dagger\)). Then we have factorized the polynomial. This will help us factor \(p_{a,b,c}\).
Lemma (Symmetric part of \(\boldsymbol{p_{a,b,c}}\)). Let \(a,b,c \in \mathbb{N}_{\geq 0}\) be such that \(a = b = c\) does not hold. The symmettric part of \(p_{a,b,c}\) is \(s = x^{e_3}(x^{\gcd(e_1-e_3,e_2-e_3)} - 1)^{e_4}\) where \([e_1,e_2,e_3]\) is \([a,b,c]\) sorted in descending order and \(e_4 = 1\) if \(e_1 - e_2 \neq 2(e_2 - e_3)\) and \(e_4 = 2\) otherwise
Claim. \(\xi\) is a root of the symmetric part of \(p'\) iff \(\xi\) is a root of \(x^{\gcd(m,n)}-1\). Furthermore the multiplicity of the root \(\xi\) in \(p'\) is 1.
\(\blacksquare\)
In order to use the above information to factor \(p_{a,b,c}\) we need to prove that \(p_{a,b,c}\) is uniquely postive. We can now jump into the realm of computation! (Technically, by the Curry-Howard correspondence, the reader understanding the above proof would also count as computation)
Definition. We define the coeffcient operator for an \(m \in \mathbb{Z}\) as follows, given any polynomial \(p(x) = a_nx^n + \cdots + a_0\) we define \[ [x^m]p(x) = a_m\] where \(a_m = 0\) if \(m <0\) or \(m > n\)
Lemma. Let \(p(x) = a_nx^n + \cdots + a_0\). Then \([x^n] pp^\dagger (x) = \sum_{i = 0}^n a_i^2\)
Note that if \([e_1,e_2,e_3]\) is \([a,b,c]\) sorted in descending order then we have that \[ [x^{e_3}] p_{a,b,c}p_{a,b,c}^\dagger (x) = \begin{cases} 0 & e_3 = e_1 \\ 2 & e_3 = e_2 \text{ or } e_2 = e_1 \\ 6 & e_3 > e_2 > e_1 \\ \end{cases} \] In the case \(e_3 = e_1\), \(p_{a,b,c}(x) = 0\) and in the case \(e_3 = e_2 \, \text{or} \, e_2 = e_1\) we have that \(p_{a,b,c}(x) = (-1)^{e_4}(x^{e_3} - x^{e_1})\) where \(e_4 = 1\) if \(e_3 = e_2\) and \(0\) otherwise. Thus the only case that we have not fully factored \(p_{a,b,c}\) is when \(e_3 > e_2 > e_1\). The rest of the section will focus on the last case.
Thus, the above lemma says that if \(qq^\dagger = p_{a,b,c}p_{a,b,c}^\dagger\) then we must have that sum of squares of the coefficients of \(q\) must be \(6\). This means that there are at most finitely many possibilities for the coefficients of \(q\). We can now get to work!
Lemma If \(b > \max\{a,c\}\) or \(b < \min\{a,c\}\) then we have that \(p_1 = p_{a,b,c}/x^{\min\{a,b,c\}}\) is uniquely positive
So the only interesting case is when \(a > b > c\). Let \(p_{m,n}(x) = x^n - 2x^m + 1\), where \(n > m\). Suppose that \(qq^\dagger(x) = p_{m,n}p_{m,n}^\dagger(x)\). Then we know that if \(q(x) = \sum_{i = 1}^n a_i x^i\), it must be that \(\sum_{i = 1}^n a_i^2 = 6\). It is easy to see that if for some \(i\) we have that \(a_i = \pm 2\) then it must be the case that \(q(x) = \pm p_{m,n}(x)\) or \(q(x) = \pm p_{m,n}^\dagger(x)\). Therfore the only interesting case is when \(q(x) = \sum_{i = 1}^6 a_ix^{k_1}\) where \(a_i = \pm 1\). We will follow this case for the rest of the article.
We want to find the \(a_i,k_i,n,m\) such that \(p_{m,n}(x)p_{m,n}^\dagger(x) = q(x)q^\dagger(x)\) where \(p_{m,n} = x^n - 2x^m + 1\), \(q(x) = \sum_{i = 1}^6 a_ix^{k_i}\), \(a_i = \pm 1\) and \(m < n\)
a_expr :: symbol
| n ∈ ℤ
| a_expr + a_expr
| a_expr * a_expr
b_expr :: True
| False
| a_expr < a_expr
| a_expr > a_expr
| a_expr = a_expr
| b_expr && b_expr
| b_expr || b_expr
| not b_expr
Which means that you build an a_expr using symbols, integers and the operations \(+\) and \(*\). A b_expr is built using the values True and False, a_exprs compared using relations and the boolean AND (&&), OR (||). Examples of an a_expr would be \(x\), \(1 + y\) and an example of a b_expr is \(x > 1+y\)
How can we construct an integer solver? That is a topic for another day! Luckily there are many integer solvers packaged into more general automated problem solvers called SMT (Satisfiable Modulo Theory) solvers. The Haskell package SBV allows one to construct b_exprs and query an SMT solver to return one of the following: time out, satisifiable or unsatisfiable. We will be using the cvc5 solver in this project.
checkZeroSat
in this repository
Lemma (Algorithm) Given a symbolic polynomial \(p\), the term runSMT (p >>= checkZeroSat)
returns either an SMT time out, prints out a solution if there exists \((a_i,k_i)\) such that \(\sum_{i = 1}^n a_ix^{k_i} = 0\) or “Failure” if there does not exist \((a_i,k_i)\) such that \(\sum_{i = 1}^n a_ix^{k_i} = 0\)
ghci> runSMT (r >>= checkZeroSat)
SMTModel {modelObjectives = [], modelBindings = Nothing, modelAssocs = [("a0",1 :: Integer),("a1",-1 :: Integer),("a2",-1 :: Integer),("a3",-1:: Integer),("a4",1 :: Integer),("a5",1 :: Integer),("k0",0 :: Integer),("k1",1 :: Integer),("k2",4 :: Integer),("k3",5 :: Integer),("k4",6 ::Integer),("k5",7 :: Integer),("p0",0 :: Integer),("p1",2 :: Integer),("p2",7 :: Integer)], modelUIFuns = []}
Where \(p2 = n, p1 = m\). So that tells us that there is a solution to \(r(x) = 0\), namely when \(n = 7,m = 2\). This is because
\[
x^{7k} - 2x^{2k} + 1 = (x^k-1)(x^{3k}+x^{k}+1)(x^{3k}+x^{2k}-1)
\]
and hence when \(7m = 2n\), \(p_{m,n}\) is not uniquely positive. Now let us add the constraint \(7*m \neq 2*n\) to the constraint list. Then we get
ghci> runSMT (rWithConstraint >>= checkZeroSat)
"Failure"
So if \(7m \neq 2n\) and \(n > 2m\) we have that \(p_{m,n}\) is uniquely positive. By symmetry this gives us that if \(2m \neq n\) and \(7m \neq 2n\) and \(7m \neq 5n\) then \(p_{m,n}\) is uniqely positive. We thus deduce the following theorem
Then we have that all the polynomials above are distinct (upto multiplication by a unit) and irreducible over \(\mathbb{Z}\)
Proof. Unfortunately, the proof of this fact boils down to a lot of case checking. Using the exact same technique in the previous section, we can prove that \(\mu_k\) and \(\nu_k\) are irreducible. It is easy to see that any \(\beta_{m,n}\) are distinct to polynomials from any other family beacuse it’s top coefficient is \(2\). Similarlyf or \(\gamma_{m,n}\) since we have that the top coefficient of \(\gamma_{m,n}^\dagger\) is \(2\). Therefore the annoying cases are checking that two polynomials from the same family are distinct and that \(\alpha_{m,n}\) are distinct from the \(\mu_k, \nu_k, \mu_k^\dagger, \nu_k^\dagger\). We will use the algorithm to prove that these polynomials are not equal in any case. The code for the proofs are found in the same repository.
\(\blacksquare\)(Final Lemma) For any \(a,b,c,d\in \mathbb{N}_{\geq 0}\) such that \(|\{a,b,c,d\}| = 4\), we have that \[ \mathrm{gcd}(p_{a,b,c}(x),p_{b,c,d}(x)) = \mathrm{gcd}(x^{e}(x^{\mathrm{gcd}(m_0,n_0)}-1)^{\epsilon_0},x^{f}(x^{\mathrm{gcd}(m_1,n_1)}-1)^{\epsilon_1}) \] where \([k_1,k_2,k_3],[l_1,l_2,l_3]\) are the lists \([a,b,c],[b,c,d]\) sorted in descending order, \(m_0 = k_1 - k_2, n_0 = k_1-k_3\), \(m_1 = l_1-l_2, n_1 = l_1-l_3\), \(e = k_3, f = l_3\) and \[ \epsilon_i = \begin{cases} 1 & \, \text{if $2m_i \neq n_i$} \\ 2 & \, \text{if $2m_i = n_i$} \end{cases} \]
Proof. We know that the gcd of two polynomials \(f,g \in \mathbb{Z}[x]\) is the product of the gcd of their symettric parts and their antisymettric parts. Therefore, by the above Lemma (Non-symmetric parts are coprime) we know that the gcd of the antisymmetric parts of \(p_{a,b,c}\) and \(p_{b,c,d}\) is not \(1\) if and only if we have that there exists a \(\gamma \in \mathbb{Z}\) such that \([k_1 + \gamma,k_2 + \gamma,k_3 + \gamma] = [l_1,l_2,l_3]\). But since we know that both lists contain a sublist corresponding to the list \([b,c]\) sorted in descending order, we must have that for some \(i,j \in \{1,2,3\}\) that \([k_i + \gamma, k_j + \gamma] = [k_i,k_j]\). Thus \(\gamma = 0\) and we deduce that for all \(i \in \{1,2,3\}\) that \(k_i = l_i\). This gives us that \(|\{a,b,c,d\}| < 4\), a contradiction
\(\blacksquare\)Thus by the above theorem we can finally conclude that if \((\xi^a)_{a \in \mathbb{Z}}\) contains a four term arithmetic progresison, then it must be that \(x = 0\) or that \(x\) is a root of unity.