Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Finite rational Gram matrices for the discrete Bagchi approximation problem

Definition
NymanBeurling_RationalGram

by marozols · Nov 21, 2026 · Mathlib 0df444a (Lean v4.33.1)

analytic-number-theorygram-matrixnyman-beurling

Column iii is the Bagchi sawtooth at denominator i+2i+2i+2 and row nnn evaluates at m=n+1m=n+1m=n+1. The row weight is 1/[m(m+1)]1/[m(m+1)]1/[m(m+1)]. Form the weighted Gram matrix of the first DDD columns using the first HHH rows, the column of inner products with the constant target, and the augmented Gram matrix with that target appended. The quotient of their determinants is a rational number. The canonical polynomial row cutoff is (D+2)4(D+2)^4(D+2)4. A finite certificate adds the elementary coefficient-mass tail bound to a finite prefix of the squared residual.

Definition code
import Mathlib

open Finset Matrix
namespace NymanBeurling.RationalGram

/-- Row zero corresponds to the first Bagchi summand. -/
def weight (n : ℕ) : ℚ := 1 / ((n+1 : ℚ)*(n+2 : ℚ))
def atom (i n : ℕ) : ℚ := (((n+1)%(i+2) : ℕ):ℚ)/(i+2 : ℚ)
def residual (c : ℕ →₀ ℚ) (m : ℕ) : ℚ :=
  1 - ∑ i∈c.support,c i * ((m%(i+2) : ℕ):ℚ)/((i+2 : ℕ):ℚ)
def headEnergy (c : ℕ →₀ ℚ) (H : ℕ) : ℚ :=
  ∑ n∈range H, (residual c (n+1))^2 / ((n+1 : ℚ)*(n+2 : ℚ))
def mass (c : ℕ →₀ ℚ) : ℚ := 1 + ∑ i∈c.support,|c i|
def cost (c : ℕ →₀ ℚ) (H : ℕ) : ℚ := headEnergy c H + (mass c)^2/(H+1:ℚ)
def SmallCertificates : Prop := ∀ J : ℕ, ∃ (c : ℕ →₀ ℚ) (H : ℕ), cost c H < 1/(J+1:ℚ)

def design (D H : ℕ) : Matrix (Fin H) (Fin D) ℚ := Matrix.of (fun n i => atom i n)
def gram (D H : ℕ) : Matrix (Fin D) (Fin D) ℚ :=
  (design D H).transpose * Matrix.diagonal (fun n : Fin H => weight n) * design D H
def target (D H : ℕ) : Fin D → ℚ :=
  (design D H).transpose *ᵥ (fun n : Fin H => weight n)
def augmented (D H : ℕ) : Matrix (Fin D ⊕ Unit) (Fin D ⊕ Unit) ℚ :=
  Matrix.fromBlocks (gram D H) (Matrix.of fun i _ => target D H i)
    (Matrix.of fun _ i => target D H i) (Matrix.of fun _ _ => ∑ n : Fin H, weight n)
noncomputable def gap (D H : ℕ) : ℚ := (augmented D H).det/(gram D H).det
def rows (D : ℕ) : ℕ := (D+2)^4

end NymanBeurling.RationalGram
Source
Discrete Nyman–Beurling criterion in B. Bagchi, Proc. Indian Acad. Sci. (Math. Sci.) 116 (2006), 137–146. Finite rational cost as in NymanBeurling.arbitrarily_small_remainder_certificates.

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