/-
Copyright 2026 The Formal Conjectures Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-/importFormalConjecturesUtil
Lam--Litt conjecture
A conjecture of Lam and Litt on algebraic solutions of algebraic ODEs.
Let $g \in \mathbb{Q}(z, y_0, \dots, y_{n-1})$ be a rational function in
$n + 1$ variables. Let $f$ be a power series over $\mathbb{Q}$ such that
$f^{(n)}(z) = g(z, f(z), f'(z), \dots, f^{(n-1)}(z))$.
Also, assume that $g(0, f(0), f'(0), \dots, f^{(n-1)}(0))$ is defined.
Then the following are equivalent:
$f$ is algebraic over $\mathbb{Q}[z]$.
There exists $N$ such that for all $n$, the $n$-th coefficient of $f$ is in $\mathbb{Z}[1/N]$.
There exists an integer-valued function $\omega$ on the set of primes with
$\lim_{p \to \infty} \omega(p) / p = \infty$ such that, for each prime $p$,
the rational numbers $a_0, a_1, \dots, a_{\omega(p)}$ are in $\mathbb{Z}_{(p)}$.
The implication 1) => 2) is due to Eisenstein, and 2) => 3) is trivial.
Yeuk Hay Joshua Lam, Daniel Litt, "Algebraicity and integrality of solutions to differential equations",
arxiv/2501.13175
Gotthold Eisenstein. "Über eine allgemeine Eigenschaft der Reihen-Entwicklungen aller algebraischen Funktionen",
Bericht der Königl. Preuss. Akademie der Wissenschaften zu Berlin, 1852
Examples in Remark 1.1.3 and 1.1.5 on the conditions of the conjecture.
openRealMvPolynomialPowerSeriesnamespaceLamLitt
A power series $f$ is a solution of an algebraic ODE defined by the rational function
$g \in \mathbb{Q}(z, y_0, \dots, y_{n-1})$ if $f^{(n)}(z) = g(z, f(z), f'(z), \dots, f^{(n-1)}(z))$.
The variable indexed by 0 : Fin (n + 1) corresponds to $z$, and the variable indexed by
i.succ corresponds to $y_i = f^{(i)}(z)$.
For an integer-valued function $\omega$ on the set of primes and a sequence $a_n$ of rational
numbers, the condition $\omega$-integrality means that for each prime $p$, the rational numbers
$a_0, a_1, \dots, a_{\omega(p)}$ are in $\mathbb{Z}_{(p)}$, i.e. their denominators are not
divisible by $p$. When $\omega(p) < 0$ the constraint at $p$ is vacuous.
The growth condition on $\omega$: the ratio $\omega(p) / p$ tends to infinity as the prime $p$
tends to infinity, i.e. $\lim_{p \to \infty} \omega(p) / p = \infty$. Here the source filter is
Filter.atTop on the primes, obtained by pulling back Filter.atTop on $\mathbb{N}$ along the
coercion Nat.Primes → ℕ.
Eisenstein's theorem (1852): an algebraic power series over $\mathbb{Q}[z]$ has bounded
denominators, i.e., there exists $N$ such that all coefficients lie in $\mathbb{Z}[1/N]$.
Every element of $\mathbb{Z}[1/N]$ has denominator coprime to any prime $p$ not in the
prime factor set of $N$ (vacuously, the case $N = 0$ gives $\mathbb{Z}[1/N] = \mathbb{Z}$).
@[categorytextbook,AMS12]theoremlam_litt.variants.integrality_implies_omega_integrality(f:PowerSeriesℚ)(N:ℕ)(hN:IsCoeffIntegralAdjointInvNatfN):∃ω:Nat.Primes→ℤ,omegaSuperlinearω∧omegaIntegralω(PowerSeries.coeff·f):=byf:ℚ⟦X⟧N:ℕhN:IsCoeffIntegralAdjointInvNatfN⊢ ∃ω,omegaSuperlinearω∧omegaIntegralωfunx↦(PowerSeries.coeffx)f-- Take ω(p) = -1 if p divides N, else p^2.refine⟨funp=>if(p:ℕ)∈N.primeFactorsthen(-1:ℤ)else(p:ℤ)^2,?_,?_⟩refine_1f:ℚ⟦X⟧N:ℕhN:IsCoeffIntegralAdjointInvNatfN⊢ omegaSuperlinearfunp↦if↑p∈N.primeFactorsthen-1else↑↑p^2refine_2f:ℚ⟦X⟧N:ℕhN:IsCoeffIntegralAdjointInvNatfN⊢ omegaIntegral(funp↦if↑p∈N.primeFactorsthen-1else↑↑p^2)funx↦(PowerSeries.coeffx)f·refine_1f:ℚ⟦X⟧N:ℕhN:IsCoeffIntegralAdjointInvNatfN⊢ omegaSuperlinearfunp↦if↑p∈N.primeFactorsthen-1else↑↑p^2refine((tendsto_natCast_atTop_atTop(R:=ℝ)).compFilter.tendsto_comap).congr'?_refine_1f:ℚ⟦X⟧N:ℕhN:IsCoeffIntegralAdjointInvNatfN⊢ (Nat.cast∘funp↦↑p)=ᶠ[Filter.comap(funp↦↑p)Filter.atTop]funp↦↑((funp↦if↑p∈N.primeFactorsthen-1else↑↑p^2)p)/↑↑pfilter_upwards[(Filter.eventually_gt_atTopN).comap((↑):Nat.Primes→ℕ)]withphpN_ltf:ℚ⟦X⟧N:ℕhN:IsCoeffIntegralAdjointInvNatfNp:Nat.PrimeshpN_lt:p∈{x|N<↑x}⊢ (Nat.cast∘funp↦↑p)p=↑(if↑p∈N.primeFactorsthen-1else↑↑p^2)/↑↑phavehpN:(p:ℕ)∉N.primeFactors:=funhmem=>Nat.not_lt.mpr(Nat.le_of_mem_primeFactorshmem)hpN_ltf:ℚ⟦X⟧N:ℕhN:IsCoeffIntegralAdjointInvNatfNp:Nat.PrimeshpN_lt:p∈{x|N<↑x}hpN:↑p∉N.primeFactors⊢ (Nat.cast∘funp↦↑p)p=↑(if↑p∈N.primeFactorsthen-1else↑↑p^2)/↑↑psimp[hpN,sq,p.2.ne_zero]All goals completed! 🐙·refine_2f:ℚ⟦X⟧N:ℕhN:IsCoeffIntegralAdjointInvNatfN⊢ omegaIntegral(funp↦if↑p∈N.primeFactorsthen-1else↑↑p^2)funx↦(PowerSeries.coeffx)fintropjhjrefine_2f:ℚ⟦X⟧N:ℕhN:IsCoeffIntegralAdjointInvNatfNp:Nat.Primesj:ℕhj:↑j≤(funp↦if↑p∈N.primeFactorsthen-1else↑↑p^2)p⊢ ((funx↦(PowerSeries.coeffx)f)j).den.Coprime↑pby_caseshpmem:(p:ℕ)∈N.primeFactorsposf:ℚ⟦X⟧N:ℕhN:IsCoeffIntegralAdjointInvNatfNp:Nat.Primesj:ℕhj:↑j≤(funp↦if↑p∈N.primeFactorsthen-1else↑↑p^2)phpmem:↑p∈N.primeFactors⊢ ((funx↦(PowerSeries.coeffx)f)j).den.Coprime↑pnegf:ℚ⟦X⟧N:ℕhN:IsCoeffIntegralAdjointInvNatfNp:Nat.Primesj:ℕhj:↑j≤(funp↦if↑p∈N.primeFactorsthen-1else↑↑p^2)phpmem:↑p∉N.primeFactors⊢ ((funx↦(PowerSeries.coeffx)f)j).den.Coprime↑p·posf:ℚ⟦X⟧N:ℕhN:IsCoeffIntegralAdjointInvNatfNp:Nat.Primesj:ℕhj:↑j≤(funp↦if↑p∈N.primeFactorsthen-1else↑↑p^2)phpmem:↑p∈N.primeFactors⊢ ((funx↦(PowerSeries.coeffx)f)j).den.Coprime↑psimponly[hpmem,if_true]athjposf:ℚ⟦X⟧N:ℕhN:IsCoeffIntegralAdjointInvNatfNp:Nat.Primesj:ℕhpmem:↑p∈N.primeFactorshj:↑j≤-1⊢ ((funx↦(PowerSeries.coeffx)f)j).den.Coprime↑p;omegaAll goals completed! 🐙·negf:ℚ⟦X⟧N:ℕhN:IsCoeffIntegralAdjointInvNatfNp:Nat.Primesj:ℕhj:↑j≤(funp↦if↑p∈N.primeFactorsthen-1else↑↑p^2)phpmem:↑p∉N.primeFactors⊢ ((funx↦(PowerSeries.coeffx)f)j).den.Coprime↑pexactden_coprime_of_mem_adjoinInvNatp.2hpmem(hNj)All goals completed! 🐙
implies 2): if the coefficients of $f$ satisfy the $\omega$-integrality condition for some superlinear $\omega$,
then there exists $N$ such that for all $n$, the $n$-th coefficient of $f$ is in $\mathbb{Z}[1/N]$.
implies 1): if the coefficients of $f$ are in $\mathbb{Z}[1/N]$ for some $N$, then $f$ is algebraic over $\mathbb{Q}[z]$.
Also the version of conjecture of Litt's problem 1 on his website.