AFTD Auto-Formalizing Theoretical Domains

distance_set

def

The distance set $\Delta(E)$ of a subset $E \subset (\mathbb{Z}/p\mathbb{Z})^d$ is the set of values $Q_d(x - y)$ for all $x, y \in E$.

Statement

def distance_set (d : ℕ) {p : ℕ} (E : Set (Fin d → ZMod p)) : Set (ZMod p)
Defined in
arXiv:2610.34758 Section 1, Eq (1.1)
Verified
28 Oct 2026
Axioms
none listed
Built on 1
  • standard_quadThe standard quadratic form $Q_d$ on $(\mathbb{Z}/p\mathbb{Z})^d$, defined by $Q_d(x) = \sum_{i} x_i^2$.
Used by 2
  • cylinder_distance_setFor any natural numbers $d$ and $p$, any submodule $W \le (\mathbb{Z}/p\mathbb{Z})^d$ that is totally isotropic with respect to $Q_d$, any…
  • cylinder_construction_distance_setLet $p$ be an odd prime (with $p$ prime and $p$ odd) and let $m \ge 0$ be a natural number. There exist an $m$-dimensional submodule…

Read back from the Lean

The definition distance_set d E takes a dimension d : ℕ, an implicit modulus p : ℕ, and a subset E : Set (Fin d → ZMod p), and defines a subset of ZMod p consisting of all values standard_quad d (x - y) for elements x ∈ E and y ∈ E.

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

Lean source view module on GitHub

/-- The distance set of a subset of (ZMod p)^d under the standard quadratic form. -/
def distance_set (d : ℕ) {p : ℕ} (E : Set (Fin d → ZMod p)) : Set (ZMod p) := { standard_quad d (x - y) | (x ∈ E) (y ∈ E) }
See it in the graphDiscuss this resultChallenge it