Cyclic anchor-offset indexing of product samples
DefinitionXMX_CyclicPartitionFor residues modulo N, a tuple has first coordinate anchor and remaining coordinates anchor+offset[j]. Positive N is imposed by the theorem; the definition also has the total ZMod 0 interpretation.
import Mathlib.Data.ZMod.Basic
import Mathlib.Data.Fin.VecNotation
set_option autoImplicit false
namespace XMX
/-- A cyclic group of product indices, with first coordinate as anchor. -/
def cyclicTuple (N d : ℕ) (anchor : ZMod N) (offset : Fin d → ZMod N) :
Fin (d + 1) → ZMod N :=
Fin.cons anchor (fun j => anchor + offset j)
end XMX
Read-back
What the Lean code literally says, in plain math · gpt-6
For every pair of natural numbers , every anchor , and every indexed offset vector , the defined tuple has coordinate and coordinates for . Addition takes place in the indicated ring. The notation denotes the modular-integer type used in the declaration: for it is the ring of residues modulo , while for it is the integers , so the latter case is included rather than giving an empty type. For the ring has one element. For the offset vector is the unique empty function and the resulting tuple has the single coordinate . No positivity or nonzero assumptions on or are imposed.