Skip to content

Short polynomial containment decidability#3495

Open
tom111 wants to merge 2 commits intogoogle-deepmind:mainfrom
tom111:short-poly-decidability
Open

Short polynomial containment decidability#3495
tom111 wants to merge 2 commits intogoogle-deepmind:mainfrom
tom111:short-poly-decidability

Conversation

@tom111
Copy link

@tom111 tom111 commented Mar 9, 2026

Formalization of the problem whether a Turing machine can decide if an ideal in a polynomial ring contains a short polynomial.

I've created this with a lot of LLM help: A bit of Aristotle in the beginning and then Claude code to walk me through all the steps and prepare the file.

I'm relatively new to lean. Any comments and suggestions are very welcome.

@google-cla
Copy link

google-cla bot commented Mar 9, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Formalizes the open problem of deciding whether a finitely generated
ideal in ℚ[x₁, x₂, …] contains a t-short polynomial (t ≥ 3).

- Defines HasShortPoly, PolyRep encoding (with Primcodable rationale),
  and the decision predicate
- States solved cases: monomials (t=1, colon ideals) and binomials
  (t=2, Jensen–Kahle–Katthän 2017; Kreuzer–Walsh 2024)
- States main open conjecture with answer(sorry) formulation
- Includes Fibonacci family example showing no computable degree bound
  can be derived from classical ideal-theoretic invariants

References: Draisma–Kahle–Wiersig (2023), Jensen–Kahle–Katthän (2017),
Kreuzer–Walsh (2024), Giesbrecht–Roche–Tilak (2012), MathOverflow 273132

Drafted with assistance from Aristotle (Harmonic) and Claude Code.
@tom111 tom111 force-pushed the short-poly-decidability branch from 4c8ae65 to 62874b8 Compare March 9, 2026 12:12
Copy link
Collaborator

@mo271 mo271 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, that looks great!

I think the way ComputablePred is used here and the encoding makes sense. I will start a thread on zulip nonetheless, because I think this is the first time we have such decision problems in our repo.

I just made suggestion for a serious of API test statements (which will also be useful when proving stuff about them).

Edit: https://leanprover.zulipchat.com/#narrow/channel/524981-Formal-conjectures/topic/decision.20problems.20and.20.60ComputablePred.60

Comment on lines +22 to +49
*Reference:* [No short polynomials vanish on bounded rank matrices](
https://doi.org/10.1112/blms.12819)
by *Jan Draisma, Thomas Kahle, Finn Wiersig*, Bull. Lond. Math. Soc. (2023)

*Reference:* [Finding binomials in polynomial ideals](
https://doi.org/10.1186/s40687-017-0106-0)
by *Anders Jensen, Thomas Kahle, Lukas Katthän*, Res. Math. Sci. (2017)

*Reference:* [Computing the binomial part of a polynomial ideal](
https://doi.org/10.1016/j.jsc.2023.102298)
by *Martin Kreuzer, Florian Walsh*, J. Symbolic Comput. (2024)

*Reference:* [Computing sparse multiples of polynomials](
https://doi.org/10.1007/s00453-012-9652-4)
by *Mark Giesbrecht, Daniel S. Roche, Hrushikesh Tilak*, Algorithmica (2012)

*Reference:* [What is the shortest polynomial divisible by (x-1)(y-1)(x²y-1)?](
https://mathoverflow.net/questions/273132) — MathOverflow question by Thomas Kahle (2017).
YCor's comment poses the decidability question: "A general question is whether it's decidable
(given an oracle to compute in K), and also whether it's decidable for principal ideals."

A polynomial is *$t$-short* if it is nonzero and has at most $t$ terms. Given generators
of an ideal $I \subseteq \mathbb{Q}[x_1, x_2, \ldots]$, can one algorithmically decide
whether $I$ contains a $t$-short polynomial?

The problem is solved for $t \leq 2$: monomials ($t = 1$) can be detected via colon ideals,
and binomials ($t = 2$) via the algorithm of Jensen–Kahle–Katthän (2017). For $t \geq 3$,
the problem is open, even in the univariate case $\mathbb{Q}[x]$.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
*Reference:* [No short polynomials vanish on bounded rank matrices](
https://doi.org/10.1112/blms.12819)
by *Jan Draisma, Thomas Kahle, Finn Wiersig*, Bull. Lond. Math. Soc. (2023)
*Reference:* [Finding binomials in polynomial ideals](
https://doi.org/10.1186/s40687-017-0106-0)
by *Anders Jensen, Thomas Kahle, Lukas Katthän*, Res. Math. Sci. (2017)
*Reference:* [Computing the binomial part of a polynomial ideal](
https://doi.org/10.1016/j.jsc.2023.102298)
by *Martin Kreuzer, Florian Walsh*, J. Symbolic Comput. (2024)
*Reference:* [Computing sparse multiples of polynomials](
https://doi.org/10.1007/s00453-012-9652-4)
by *Mark Giesbrecht, Daniel S. Roche, Hrushikesh Tilak*, Algorithmica (2012)
*Reference:* [What is the shortest polynomial divisible by (x-1)(y-1)(x²y-1)?](
https://mathoverflow.net/questions/273132) — MathOverflow question by Thomas Kahle (2017).
YCor's comment poses the decidability question: "A general question is whether it's decidable
(given an oracle to compute in K), and also whether it's decidable for principal ideals."
A polynomial is *$t$-short* if it is nonzero and has at most $t$ terms. Given generators
of an ideal $I \subseteq \mathbb{Q}[x_1, x_2, \ldots]$, can one algorithmically decide
whether $I$ contains a $t$-short polynomial?
The problem is solved for $t \leq 2$: monomials ($t = 1$) can be detected via colon ideals,
and binomials ($t = 2$) via the algorithm of Jensen–Kahle–Katthän (2017). For $t \geq 3$,
the problem is open, even in the univariate case $\mathbb{Q}[x]$.
*References:*
- [No short polynomials vanish on bounded rank matrices](
https://doi.org/10.1112/blms.12819)
by *Jan Draisma, Thomas Kahle, Finn Wiersig*, Bull. Lond. Math. Soc. (2023)
- [Finding binomials in polynomial ideals](
https://doi.org/10.1186/s40687-017-0106-0)
by *Anders Jensen, Thomas Kahle, Lukas Katthän*, Res. Math. Sci. (2017)
- [Computing the binomial part of a polynomial ideal](
https://doi.org/10.1016/j.jsc.2023.102298)
by *Martin Kreuzer, Florian Walsh*, J. Symbolic Comput. (2024)
- [Computing sparse multiples of polynomials](
https://doi.org/10.1007/s00453-012-9652-4)
by *Mark Giesbrecht, Daniel S. Roche, Hrushikesh Tilak*, Algorithmica (2012)
- [What is the shortest polynomial divisible by (x-1)(y-1)(x²y-1)?](
https://mathoverflow.net/questions/273132) — MathOverflow question by Thomas Kahle (2017).
YCor's comment poses the decidability question: "A general question is whether it's decidable
(given an oracle to compute in K), and also whether it's decidable for principal ideals."

Our references are usually just such a list. (I will update the AGENTS.md to make that more clear : #3518)

(l.mapIdx (fun i e => Finsupp.single i e)).sum

/--
Interpret a `PolyRep` as a polynomial in $\mathbb{Q}[x_1, x_2, \ldots]$.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might it make sense to change the docstring to zero-based indexing here as well? It is that way in the lean code, if it is not totally unusual in the informal math, perhaps a good idea to homogenize. also below (for instance in binomial_decidability)

-/
def HasShortPoly (t : ℕ) (I : Ideal (MvPolynomial ℕ ℚ)) : Prop :=
∃ p ∈ I, p ≠ 0 ∧ p.support.card ≤ t

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/-- No nonzero polynomial has zero terms, so `HasShortPoly 0` is always false. -/
@[category API, AMS 13]
theorem not_hasShortPoly_zero (I : Ideal (MvPolynomial ℕ ℚ)) : ¬ HasShortPoly 0 I := by
intro ⟨p, _, hp_ne, hp_card⟩
exact hp_ne (MvPolynomial.support_eq_empty.mp (Finset.card_eq_zero.mp (Nat.le_zero.mp hp_card)))
/-- The zero ideal contains no nonzero elements, so it has no short polynomials. -/
@[category API, AMS 13]
theorem not_hasShortPoly_bot (t : ℕ) : ¬ HasShortPoly t (⊥ : Ideal (MvPolynomial ℕ ℚ)) := by
intro ⟨p, hp_mem, hp_ne, _⟩
exact hp_ne (Ideal.mem_bot.mp hp_mem)
/-- The whole ring contains the monomial $1$, which has one term. -/
@[category API, AMS 13]
theorem hasShortPoly_one_top : HasShortPoly 1 (⊤ : Ideal (MvPolynomial ℕ ℚ)) := by
refine ⟨X 0, Submodule.mem_top, by simp, ?_⟩
simp [MvPolynomial.support_X]

Perhaps let's add a few API tests?

-/
def monomialOfList (l : List ℕ) : ℕ →₀ ℕ :=
(l.mapIdx (fun i e => Finsupp.single i e)).sum

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/-- The empty exponent vector gives the zero `Finsupp`, representing $x^0 = 1$. -/
@[category API, AMS 13]
theorem monomialOfList_nil : monomialOfList [] = 0 := by
simp [monomialOfList]

def polyOfRep (p : PolyRep) : MvPolynomial ℕ ℚ :=
(p.map (fun (exps, num, den) =>
MvPolynomial.monomial (monomialOfList exps) (↑num / ↑den))).sum

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/-- The empty list represents the zero polynomial. -/
@[category API, AMS 13]
theorem polyOfRep_nil : polyOfRep [] = 0 := by
simp [polyOfRep]

-/
def idealOfInput (L : List PolyRep) : Ideal (MvPolynomial ℕ ℚ) :=
Ideal.span (Set.range (fun i : Fin L.length => polyOfRep (L.get i)))

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/-- Empty generators produce the zero ideal. -/
@[category API, AMS 13]
theorem idealOfInput_nil : idealOfInput [] = ⊥ := by
simp [idealOfInput]

-/
def decisionProblem (t : ℕ) : List PolyRep → Prop :=
fun L => HasShortPoly t (idealOfInput L)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/-- The zero ideal has no $t$-short polynomial. -/
@[category API, AMS 13]
theorem not_decisionProblem_nil (t : ℕ) : ¬ decisionProblem t [] := by
simp only [decisionProblem]
rw [idealOfInput_nil]
exact not_hasShortPoly_bot t

Comment on lines +187 to +189
theorem fib_ideal_contains_binomial (n : ℕ) (hn : 1 ≤ n) :
X 0 ^ n - X 1 ∈ fibIdeal n := by
sorry
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AlphaProof can prove this:

theorem fib_ideal_contains_binomial (n : ℕ) (hn : 1 ≤ n) :
    X 0 ^ n - X 1 ∈ fibIdeal n := by
  norm_num [fibIdeal, false]
  rw[Ideal.mem_span_pair]
  by_contra!
  replace hn:∃ A B : MvPolynomial (Fin 2) Rat, A*(.X (1)-n.fib*.X 0-(n-1).fib)+B*(.X 0^2-.X 0-1)=.X 0^n-.X (1):=?_
  · bound
  use-1
  refine n.sub_add_cancel hn▸(n-1).strongRec fun and x=>match and with|0=>⟨0,by ring⟩|1=>⟨1,by ring⟩ | S+2=>((x _) (by constructor)).elim fun and h=>((x S (by valid)).elim) ?_
  use fun A B=>⟨and*.X 0+(S+2).fib,Nat.fib_add_two▸.trans (by rw [Nat.cast_add]) (by linear_combination h*.X 0)⟩

Potentially clean up the proof and also add it here (or rewrite it from scratch). But also fine to leave as sorry: just a good sanity check that we cannot find a disprove here...

@mo271 mo271 added the awaiting-author The author should answer a question or perform changes. Reply when done. label Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-author The author should answer a question or perform changes. Reply when done.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants