Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

The canonical finite partition by complete CFZ carry vectors

Definition
GreenTaoPort_Wikipedia_GreenTao_Sieve_CFZCanonicalCarryCellPartition

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

arithmetic-progressionsgreen-tao-port-8822number-theorysieve-theory

A finite family of CFZ form indices assigns to each natural doubled-variable point its vector of integer carries when the form values are reduced modulo a positive modulus NNN.

The admissible carry-vector set is the finite Cartesian product of the integer interval [−Ck,Ck][-C_k,C_k][−Ck​,Ck​], where CkC_kCk​ is the uniform carry bound for progression length kkk. It depends only on that length and the family index type. The cell for a specified carry vector is its exact fiber inside the standard coordinate box {0,…,N−1}V\{0,\ldots,N-1\}^{V}{0,…,N−1}V. The partition is fixed before choosing divisor families or affine residue constants.

Definition code
import Definitions.Def_GreenTaoPort_Wikipedia_GreenTao_Sieve_CFZCarryBlockBoundary
import Lean
import Mathlib.Algebra.BigOperators.Expect
import Mathlib.Algebra.Field.ZMod
import Mathlib.Algebra.GCDMonoid.FinsetLemmas
import Mathlib.Algebra.Order.BigOperators.Group.Finset
import Mathlib.Analysis.Calculus.BumpFunction.InnerProduct
import Mathlib.Analysis.Calculus.ContDiff.Deriv
import Mathlib.Analysis.Calculus.Deriv.MeanValue
import Mathlib.Analysis.Calculus.Deriv.Support
import Mathlib.Analysis.Distribution.SchwartzSpace.Fourier
import Mathlib.Analysis.SpecialFunctions.Log.Basic
import Mathlib.Analysis.SpecialFunctions.Log.Summable
import Mathlib.Combinatorics.Pigeonhole
import Mathlib.Data.Fintype.BigOperators
import Mathlib.Data.Fintype.Card
import Mathlib.Data.Fintype.Pi
import Mathlib.Data.Int.Interval
import Mathlib.Data.Int.Lemmas
import Mathlib.Data.Nat.GCD.Prime
import Mathlib.Data.Nat.Squarefree
import Mathlib.Data.Nat.Totient
import Mathlib.Data.ZMod.Basic
import Mathlib.Data.ZMod.QuotientRing
import Mathlib.GroupTheory.Index
import Mathlib.LinearAlgebra.Pi
import Mathlib.Logic.Equiv.Fin.Basic
import Mathlib.MeasureTheory.Integral.Bochner.Set
import Mathlib.MeasureTheory.Integral.IntegralEqImproper
import Mathlib.NumberTheory.ArithmeticFunction.Moebius
import Mathlib.NumberTheory.Divisors
import Mathlib.NumberTheory.Primorial
import Mathlib.NumberTheory.SumPrimeReciprocals
import Mathlib.Tactic

set_option autoImplicit true
set_option relaxedAutoImplicit false
set_option maxSynthPendingDepth 3


/-!
# Canonical carry-cell partition independent of divisor choices

The quotient-block argument used so far chooses its block side from the
paired divisor LCM.  Consequently its frozen affine family varies with the
divisor choice, which obstructs a direct comparison with one unrestricted
Euler series.

There is also a divisor-independent decomposition: partition the standard
natural box by the complete vector of canonical CFZ carries.  The carry
range is bounded solely in terms of `k`, so a fixed finite product of
integer intervals contains every realized vector.  Each fiber is a genuine
simultaneous `IsCFZCarryCell`, the fibers are pairwise disjoint, and their
union is the whole box.

This file establishes that exact combinatorial reorganization.  The next
analytic input for this route is a residue-class discrepancy estimate on
these rational polyhedral cells, uniform in the paired divisor modulus.
-/

namespace Wikipedia.SzemeredisTheorem

open scoped BigOperators

/-! ## Carry vectors and their finite range -/

/-- The complete canonical carry vector of a finite selected CFZ family at
one natural point. -/
def cfzCanonicalCarryVector
    {κ : Type*} {k N : ℕ} [NeZero N]
    (forms : κ → CFZFormIndex k)
    (x : CFZVariable k → ℕ) : κ → ℤ :=
  fun q => cfzCarry (N := N) (forms q) x

/-- All carry vectors in the uniform coordinatewise range.  The finset
depends only on `k` and the finite index type, not on `N`, the divisor
choice, or the affine constants. -/
noncomputable def cfzCanonicalCarryVectorChoices
    (κ : Type*) [Fintype κ] [DecidableEq κ]
    (k : ℕ) : Finset (κ → ℤ) :=
  Fintype.piFinset fun _q : κ =>
    Finset.Icc (-(cfzCarryRange k : ℤ))
      (cfzCarryRange k : ℤ)





/-! ## The canonical cells -/

/-- The fiber of one complete carry vector inside the standard natural
box. -/
def cfzCanonicalCarryCell
    {κ : Type*} [Fintype κ] [DecidableEq κ]
    {k N : ℕ} [NeZero N]
    (forms : κ → CFZFormIndex k)
    (carry : κ → ℤ) :
    Finset (CFZVariable k → ℕ) :=
  (natBox (fun _ : CFZVariable k => N)).filter
    fun x => cfzCanonicalCarryVector (N := N) forms x = carry









/-! ## Exact partition identities -/







end Wikipedia.SzemeredisTheorem


/- Materialize compiler-generated declarations promised by this bundle. -/
run_meta do
  for requiredName in #[
    `Wikipedia.SzemeredisTheorem.cfzCanonicalCarryCell.eq_1,
    `Wikipedia.SzemeredisTheorem.cfzCanonicalCarryVector.congr_simp
  ] do
    let actualName ← Lean.realizeGlobalConstNoOverloadCore requiredName
    unless actualName == requiredName do
      throwError "Generated companion resolved to an unexpected name"
Source
https://github.com/plby/lean-proofs/blob/8822f7ddef30fadbd92e1c6ab4ed897af356af5e/src/latest/Wikipedia/GreenTao/Sieve/CFZCanonicalCarryCellPartition.lean#L29-L89

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