Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Bateman--Horn data: Bunyakovsky and Schinzel conditions, ωp\omega_pωp​, the partial Euler product and the counting function

Definition
FCP_BatemanHorn

by LG · Sep 15, 2026 · Mathlib 0df444a (Lean v4.33.1)

number-theory

This file fixes the data entering the Bateman--Horn conjecture for a finite family SSS of integer polynomials.

A single polynomial f∈Z[X]f \in \mathbb{Z}[X]f∈Z[X] satisfies the Bunyakovsky condition when its leading coefficient is positive, its degree is at least 111, and it is irreducible in Z[X]\mathbb{Z}[X]Z[X].

A finite family SSS satisfies the Schinzel condition when for every prime ppp there is an integer nnn with p∤∏f∈Sf(n)p \nmid \prod_{f \in S} f(n)p∤∏f∈S​f(n); this rules out families whose product is divisible by a fixed prime at every integer.

For a prime ppp, ωp(S)\omega_p(S)ωp​(S) is the number of residue classes n mod pn \bmod pnmodp at which at least one f∈Sf \in Sf∈S vanishes, D(S)=∏f∈Sdeg⁡fD(S) = \prod_{f \in S} \deg fD(S)=∏f∈S​degf, and the truncated Euler product is

PN(S)=∏p<N(1−1p)−∣S∣(1−ωp(S)p),P_N(S) = \prod_{p < N} \left(1 - \tfrac{1}{p}\right)^{-|S|}\left(1 - \tfrac{\omega_p(S)}{p}\right),PN​(S)=p<N∏​(1−p1​)−∣S∣(1−pωp​(S)​),

whose limit as N→∞N \to \inftyN→∞ is the Bateman--Horn constant (the product is only conditionally convergent, so the order of the factors matters).

Finally πS(x)\pi_S(x)πS​(x) counts the natural numbers n≤xn \le xn≤x at which every f∈Sf \in Sf∈S takes a value of prime absolute value.

Definition code
import Mathlib

namespace FCP.BatemanHorn

open Polynomial

/-- The Bunyakovsky condition on a single integer polynomial `f`: its leading coefficient is
positive, its degree is at least one, and it is irreducible over `ℤ`. -/
def BunyakovskyCondition (f : ℤ[X]) : Prop :=
  0 < f.leadingCoeff ∧ 1 ≤ f.natDegree ∧ Irreducible f

/-- The Schinzel condition on a finite family of integer polynomials: for every prime `p` there
is an integer `n` with `p ∤ ∏ f ∈ polys, f(n)`. -/
def SchinzelCondition (polys : Finset ℤ[X]) : Prop :=
  ∀ p : ℕ, p.Prime → ∃ n : ℤ, ¬ ((p : ℤ) ∣ ∏ f ∈ polys, f.eval n)

/-- `omegaP polys p` is the number of residue classes modulo `p` at which at least one of the
polynomials in `polys` vanishes. -/
noncomputable def omegaP (polys : Finset ℤ[X]) (p : ℕ) : ℕ :=
  {n : ZMod p | ∃ f ∈ polys, (f.map (Int.castRingHom (ZMod p))).eval n = 0}.ncard

/-- The product of the degrees of the polynomials in `polys`. -/
def degreesProduct (polys : Finset ℤ[X]) : ℕ := ∏ f ∈ polys, f.natDegree

/-- The partial Euler product defining the Bateman-Horn constant, truncated at the primes `p < N`:
`∏_{p < N} (1 - 1/p)^(-k) (1 - ω_p/p)`, where `k` is the number of polynomials. -/
noncomputable def partialProduct (polys : Finset ℤ[X]) (N : ℕ) : ℝ :=
  ∏ p ∈ Nat.primesBelow N,
    (1 - (1 : ℝ) / p) ^ (-polys.card : ℤ) * (1 - (omegaP polys p : ℝ) / p)

/-- `countSimultaneousPrimes polys x` is the number of natural numbers `n ≤ x` such that every
polynomial in `polys` takes a value of prime absolute value at `n`. -/
noncomputable def countSimultaneousPrimes (polys : Finset ℤ[X]) (x : ℝ) : ℕ :=
  ((Finset.range (⌊x⌋₊ + 1)).filter
    (fun n : ℕ => ∀ f ∈ polys, (f.eval (n : ℤ)).natAbs.Prime)).card

end FCP.BatemanHorn
Source
Formal Conjectures library (Google DeepMind), Apache-2.0, https://github.com/google-deepmind/formal-conjectures (FormalConjectures/Wikipedia/BatemanHornConjecture.lean, Bunyakovsky.lean); https://en.wikipedia.org/wiki/Bateman%E2%80%93Horn_conjecture
Read-back

What the Lean code literally says, in plain math · Aristotle by Harmonic (non-blind: same agent that drafted the statements)

Non-blind read-back. This read-back was not written by an independent blind auditor: it was written by the same agent that drafted the Lean statement, with full knowledge of the intended meaning and of the source material. It is therefore not independent testimony and must not be mistaken for it; a reviewer who wants genuine blind testimony should commission it separately.

This bundle introduces six notions about a finite set SSS of polynomials with integer coefficients.

  1. Bunyakovsky condition on a single fff: the conjunction of three assertions — the leading coefficient of fff is strictly positive, the degree of fff (the natural-number degree, which is 000 for the zero polynomial) is at least 111, and fff is irreducible as an element of the ring Z[X]\mathbb{Z}[X]Z[X] (so in particular fff is neither zero nor a unit, and any factorization has a unit factor).

  2. Schinzel condition on the finite set SSS: for every natural number ppp that is prime there exists an integer nnn such that ppp does not divide ∏f∈Sf(n)\prod_{f \in S} f(n)∏f∈S​f(n), the product of the values at nnn of all members of SSS. For the empty set SSS this product is 111, so the condition holds vacuously.

  3. ωp(S)\omega_p(S)ωp​(S): the cardinality (as a set-cardinal, 000 when infinite) of the set of elements nnn of Z/pZ\mathbb{Z}/p\mathbb{Z}Z/pZ for which some f∈Sf \in Sf∈S, reduced modulo ppp coefficientwise, evaluates to 000 at nnn. Here ppp ranges over all natural numbers, not just primes; for p=0p = 0p=0 the ring is Z\mathbb{Z}Z and for p=1p = 1p=1 it is the zero ring.

  4. D(S)=∏f∈Sdeg⁡fD(S) = \prod_{f \in S} \deg fD(S)=∏f∈S​degf, the product of the natural-number degrees, equal to 111 for SSS empty.

  5. PN(S)=∏p<N, p prime(1−1/p)−∣S∣ (1−ωp(S)/p)P_N(S) = \prod_{p < N,\ p \text{ prime}} (1 - 1/p)^{-|S|}\,(1 - \omega_p(S)/p)PN​(S)=∏p<N, p prime​(1−1/p)−∣S∣(1−ωp​(S)/p), a finite real product over the primes strictly below the natural number NNN; the exponent −∣S∣-|S|−∣S∣ is an integer exponent, and real division by ppp uses the real coercion of ppp.

  6. πS(x)\pi_S(x)πS​(x) for a real xxx: the number of natural numbers nnn with 0≤n≤⌊x⌋0 \le n \le \lfloor x \rfloor0≤n≤⌊x⌋ such that for every f∈Sf \in Sf∈S the absolute value of the integer f(n)f(n)f(n) is a prime number. For x<0x < 0x<0 the floor is 000, so only n=0n = 0n=0 is tested.

Human review
  • Endorsed by Shuze Chen · Sep 17, 2026

  • Endorsed by LG · Sep 17, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me