Natural representatives of cyclic progression terms
DefinitionGreenTaoPort_Wikipedia_SzemeredisTheorem_ArithmeticProgression_ShortIntervalarithmetic-progressionscombinatoricsgreen-tao-port-8822
For a positive natural modulus , residues , and a natural position , define
using the standard natural representative. The definition allows every natural position rather than restricting to a fixed finite length. It supplies the sequence used later to unwrap a cyclic progression whose representatives lie in a sufficiently short interval.
Definition code
import Definitions.Def_GreenTaoPort_Wikipedia_SzemeredisTheorem_ArithmeticProgression_Count
import Mathlib.Data.Int.ModEq
import Lean
import Mathlib.Algebra.BigOperators.Expect
import Mathlib.Algebra.Order.BigOperators.GroupWithZero.Finset
import Mathlib.Data.Fintype.Card
import Mathlib.Data.ZMod.Basic
import Mathlib.Tactic
set_option autoImplicit true
set_option relaxedAutoImplicit false
set_option maxSynthPendingDepth 3
/-!
# Unwrapping cyclic progressions in a short interval
A progression obtained by transference lives in `ZMod N`. The prime weight
is supported on an interval much shorter than a full residue system. In
that situation the standard representatives have second difference zero
over the integers, so they form an ordinary integer progression.
-/
namespace Wikipedia.SzemeredisTheorem
/-- The standard natural representative of the `j`th term of a cyclic
progression. -/
def cyclicAPVal {N : ℕ} [NeZero N] (a d : ZMod N) (j : ℕ) : ℕ :=
(a + (j : ZMod N) * d).val
end Wikipedia.SzemeredisTheorem
/- Materialize compiler-generated declarations promised by this bundle. -/
run_meta do
for requiredName in #[
`Wikipedia.SzemeredisTheorem.cyclicAPVal.congr_simp,
`Wikipedia.SzemeredisTheorem.cyclicAPVal.eq_1
] do
let actualName ← Lean.realizeGlobalConstNoOverloadCore requiredName
unless actualName == requiredName do
throwError "Generated companion resolved to an unexpected name"
Source