Rank-two conditions for affine coefficient families modulo a prime
DefinitionGreenTaoPort_Wikipedia_GreenTao_Sieve_GoodPrimeAffineRankarithmetic-progressionsgreen-tao-port-8822number-theorysieve-theory
For a finite family of integer affine forms , a rank-two good prime is a natural prime such that every two distinct form indices admit variable indices with
The selected-family predicate requires the existence of one such distinct pair inside a specified finite subset of form indices. This second predicate does not itself require to be prime. Both conditions concern coefficient vectors; affine constant terms do not enter the minors, and repeating an index cannot supply the required rank.
Definition code
import Definitions.Def_GreenTaoPort_Wikipedia_GreenTao_Sieve_PairedLocalFactors
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.SpecialFunctions.Log.Basic
import Mathlib.Combinatorics.Pigeonhole
import Mathlib.Data.Fintype.BigOperators
import Mathlib.Data.Fintype.Card
import Mathlib.Data.Fintype.Pi
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.Tactic
set_option autoImplicit true
set_option relaxedAutoImplicit false
set_option maxSynthPendingDepth 3
/-!
# Rank-two affine densities at good primes
For a finite system of affine forms, failure of rank two modulo `p` is
detected by the vanishing of every two-by-two coefficient minor for some
distinct pair. This file isolates a finite, explicit exceptional set using
the sum of the absolute values of all such minors.
Outside that set, pairwise independent integer coefficient vectors remain
rank two modulo `p`. Thus every selected subfamily containing two distinct
indices has common-zero density at most `1 / p²`: its common-zero set is
contained in the common-zero set of one rank-two pair. This is the actual
higher-order density estimate needed for the CFZ family. Repeated indices do
not create rank, so the hypotheses use a `Finset` and explicitly require it
to be nontrivial.
The final results instantiate
`HasGoodPrimeHigherOrderDensityEstimate` for the CFZ forms and package the
estimate together with the exact local-factor inclusion--exclusion formula.
-/
namespace Wikipedia.SzemeredisTheorem
open scoped BigOperators
/-! ## An explicit finite exceptional set for rank two -/
/-- Every two distinct forms have a nonzero two-by-two minor modulo a
rank-two good prime. -/
def AffineRankTwoGoodPrime
{κ ι : Type*} [Fintype κ] [Fintype ι]
(p : ℕ) (forms : κ → AffineForm ι ℤ) : Prop :=
p.Prime ∧
∀ {q r : κ}, q ≠ r →
∃ i j : ι,
(((forms q).coefficientMinor (forms r) i j : ℤ) :
ZMod p) ≠ 0
/-! ## Selected-family rank and density -/
/-- A selected family has rank at least two modulo `p` when it contains two
distinct indices with a nonvanishing coefficient minor. Repetition alone
cannot witness this predicate. -/
def SelectedAffineFamilyHasRankAtLeastTwo
{κ ι : Type*} [Fintype ι]
(p : ℕ) (forms : κ → AffineForm ι ℤ)
(s : Finset κ) : Prop :=
∃ q ∈ s, ∃ r ∈ s, q ≠ r ∧
∃ i j : ι,
(((forms q).coefficientMinor (forms r) i j : ℤ) :
ZMod p) ≠ 0
/-! ## CFZ specialization -/
end Wikipedia.SzemeredisTheorem
Source