Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

A boundary bound for differences of box sums

Proved
Wikipedia.SzemeredisTheorem.abs_boxSum_sub_trimmed_le

by kmehltretter82 · Nov 14, 2026 · Mathlib c5ea003 (Lean v4.30.0)

additive-combinatoricsgreen-tao-port-8822number-theory

For a finite coordinate type with decidable equality, natural side lengths, and any natural trimming modulus DDD, suppose ∣F(x)∣≤B|F(x)|\le B∣F(x)∣≤B on the original box. The difference between its original and trimmed box sums has absolute value at most BBB times the cardinality of the removed boundary.

Preamble
/- Mechanically transplanted from https://github.com/plby/lean-proofs.git at 8822f7ddef30fadbd92e1c6ab4ed897af356af5e. Original scopes and proof bytes are oracle-derived. -/
import Definitions.Def_GreenTaoPort_Wikipedia_GreenTao_Sieve_CongruenceAverage
import Mathlib.Algebra.GCDMonoid.FinsetLemmas
import Mathlib.Algebra.Order.BigOperators.Group.Finset
import Mathlib.Data.Fintype.BigOperators
import Mathlib.Data.Fintype.Pi
import Mathlib.Logic.Equiv.Fin.Basic
import Mathlib.Tactic

set_option autoImplicit true
set_option relaxedAutoImplicit false
set_option maxSynthPendingDepth 3
/-!
# Congruence averages on finite boxes

This file supplies the elementary finite-arithmetic layer used after expanding
the Selberg sieve weight.  A finite family of divisor moduli is combined by an
LCM, while a function depending only on coordinatewise residues is averaged
exactly over boxes whose side lengths are multiples of that LCM.

There are two equivalent box models:

* `natBox side` is the literal finset of natural-valued points satisfying
  `x i < side i`;
* `FiniteBox side` is the finite type `∀ i, Fin (side i)`.

The second model makes quotient--remainder reindexing transparent, and
`boxSum_eq_sum_natBox` transports its sums back to the literal finset.
-/
open Wikipedia.SzemeredisTheorem
open scoped BigOperators
/-! ## LCM bounds -/
/-! ## Finite boxes -/
/-! ## Coordinatewise periodicity and exact box sums -/
/-! ## Exact means -/
/-! ## Trimming and explicit boundary loss -/

Formal statement

theorem Wikipedia.SzemeredisTheorem.abs_boxSum_sub_trimmed_le {ι : Type*}
    [Fintype ι] [DecidableEq ι]
    (D : ℕ) (side : ι → ℕ) (F : (ι → ℕ) → ℝ) (B : ℝ)
    (hF : ∀ x ∈ natBox side, |F x| ≤ B) :
    |boxSum side F - boxSum (trimmedSide D side) F| ≤
      ((natBox side \ natBox (trimmedSide D side)).card : ℝ) * B := by sorry
Source
https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/Wikipedia/GreenTao/Sieve/CongruenceAverage.lean#L436-L455

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