AFTD Auto-Formalizing Theoretical Domains

cylinder_distance_set

theoremverified

For 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 vector $e \in (\mathbb{Z}/p\mathbb{Z})^d$ orthogonal to every element of $W$ under the standard dot product, and any subset $A \subset \mathbb{Z}/p\mathbb{Z}$, the distance set $\Delta(E_A)$ of the cylinder set $E_A = \{w + a \cdot e : w \in W, a \in A\}$ equals the scaled squared difference set $Q_d(e) (A - A)^2$.

Statement

theorem cylinder_distance_set
    (d : ℕ) {p : ℕ}
    (W : Submodule (ZMod p) (Fin d → ZMod p)) (e : Fin d → ZMod p)
    (h_iso : is_totally_isotropic d W)
    (h_orth : ∀ w ∈ W, dotProduct e w = 0)
    (A : Set (ZMod p)) :
    distance_set d (cylinder_set d W e A) = diff_sq_scaled (standard_quad d e) A
Source
arXiv:2610.34758 Lemma 2.3 proof
Verified
28 Oct 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 6
  • standard_quadThe standard quadratic form $Q_d$ on $(\mathbb{Z}/p\mathbb{Z})^d$, defined by $Q_d(x) = \sum_{i} x_i^2$.
  • is_totally_isotropicA subspace $W \subset (\mathbb{Z}/p\mathbb{Z})^d$ is totally isotropic with respect to the standard quadratic form $Q_d$ if $Q_d(w) = 0$…
  • distance_setThe 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$.
  • cylinder_setThe cylinder set $E_A \subset (\mathbb{Z}/p\mathbb{Z})^d$ associated to a subspace $W$, a vector $e$, and a subset…
  • diff_sq_scaledThe scaled squared difference set $\kappa (A - A)^2$ for a subset $A \subset \mathbb{Z}/p\mathbb{Z}$ and scalar…
  • cylinder_quad_expansionFor 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$, and…
Used by 1

Read back from the Lean

For any dimension $d : ℕ$ and (implicit) modulus $p : ℕ$, let $W$ be a $\mathbb{Z}/p\mathbb{Z}$-submodule of $(\mathbb{Z}/p\mathbb{Z})^d$, let $e \in (\mathbb{Z}/p\mathbb{Z})^d$, assume that $W$ is totally isotropic (every $w \in W$ satisfies $\text{standard\_quad}_d(w) = 0$), and assume that $e$ is orthogonal to every vector in $W$ (for all $w \in W$, $e \cdot w = 0$). Then, for any subset $A \subseteq \mathbb{Z}/p\mathbb{Z}$, the distance set of the cylinder set formed by $W$, $e$, and $A$ equals the set of scaled squared differences $( \text{standard\_quad}_d(e) ) \cdot (a - b)^2$ for $a, b \in A$.

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

The proof, explained

The proof proceeds by double inclusion, showing that an element belongs to the distance set of the cylinder if and only if it belongs to the scaled squared difference set. The essential move is the expansion lemma cylinder_quad_expansion: because W is totally isotropic and e is orthogonal to W, the quadratic distance between any two cylinder points w₁ + a • e and w₂ + b • e collapses to (a - b)² * Q_d(e). This shows that every cylinder distance has the required form, and setting w₁ = w₂ = 0 shows that every scaled squared difference is realized.

  1. The set equality reduces to two inclusions: the distance set is contained in the scaled squared difference set, and conversely.

    By extensionality for sets, two sets are equal if they contain the same elements. Unfolding the definitions of distance set, cylinder set, and scaled squared difference set, the goal splits into two directions: showing that every distance between points in the cylinder belongs to the scaled squared difference set, and that every scaled squared difference is realized as such a distance.

    lines 9–11

      ext x
      simp only [distance_set, cylinder_set, diff_sq_scaled]
      constructor
  2. Every distance between two points in the cylinder set belongs to Q_d(e) * (A - A)².

    Let x be in the distance set, so x = Q_d(u - v) for points u, v in the cylinder. Writing u = w₁ + a • e and v = w₂ + b • e with w₁, w₂ ∈ W and a, b ∈ A, we take a and b as witnesses in the scaled squared difference set. By cylinder_quad_expansion, the isotropy of W and orthogonality of e ensure that Q_d((w₁ + a • e) - (w₂ + b • e)) simplifies to (a - b)² * Q_d(e). Commutativity of multiplication in ℤ/pℤ (verified by ring arithmetic) establishes the equality.

    lines 12–15

    uses cylinder_quad_expansion

      · rintro ⟨u, ⟨w1, hw1, a, ha, rfl⟩, v, ⟨w2, hw2, b, hb, rfl⟩, rfl⟩
        refine ⟨a, ha, b, hb, ?_⟩
        rw [cylinder_quad_expansion d W e h_iso h_orth w1 hw1 w2 hw2 a b]
        ring
  3. Every element of Q_d(e) * (A - A)² belongs to the distance set of the cylinder.

    Given x = Q_d(e) * (a - b)² with a, b ∈ A, we witness that x is in the distance set using the points 0 + a • e and 0 + b • e. These points lie in the cylinder because 0 ∈ W by W.zero_mem. Evaluating cylinder_quad_expansion at w₁ = w₂ = 0 gives Q_d((0 + a • e) - (0 + b • e)) = (a - b)² * Q_d(e), which equals Q_d(e) * (a - b)² by ring arithmetic.

    lines 16–19

    uses cylinder_quad_expansion, W.zero_mem

      · rintro ⟨a, ha, b, hb, rfl⟩
        refine ⟨0 + a • e, ⟨0, W.zero_mem, a, ha, rfl⟩, 0 + b • e, ⟨0, W.zero_mem, b, hb, rfl⟩, ?_⟩
        rw [cylinder_quad_expansion d W e h_iso h_orth 0 W.zero_mem 0 W.zero_mem a b]
        ring
cylinder_quad_expansion
For any totally isotropic submodule W and vector e orthogonal to W, the quadratic form on the difference (w + a • e) - (w' + b • e) simplifies to (a - b)² * Q_d(e) for all w, w' ∈ W and a, b ∈ ℤ/pℤ.
W.zero_mem
The zero vector is an element of the submodule W.

Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.

Lean source view module on GitHub

/-- Distance set of the cylinder set E_A equals the scaled squared difference set kappa * (A - A)^2. -/theorem cylinder_distance_set    (d : ℕ) {p : ℕ}    (W : Submodule (ZMod p) (Fin d → ZMod p)) (e : Fin d → ZMod p)    (h_iso : is_totally_isotropic d W)    (h_orth : ∀ w ∈ W, dotProduct e w = 0)    (A : Set (ZMod p)) :    distance_set d (cylinder_set d W e A) = diff_sq_scaled (standard_quad d e) A := by  ext x  simp only [distance_set, cylinder_set, diff_sq_scaled]  constructor  · rintro ⟨u, ⟨w1, hw1, a, ha, rfl⟩, v, ⟨w2, hw2, b, hb, rfl⟩, rfl⟩    refine ⟨a, ha, b, hb, ?_⟩    rw [cylinder_quad_expansion d W e h_iso h_orth w1 hw1 w2 hw2 a b]    ring  · rintro ⟨a, ha, b, hb, rfl⟩    refine ⟨0 + a • e, ⟨0, W.zero_mem, a, ha, rfl⟩, 0 + b • e, ⟨0, W.zero_mem, b, hb, rfl⟩, ?_⟩    rw [cylinder_quad_expansion d W e h_iso h_orth 0 W.zero_mem 0 W.zero_mem a b]    ring
See it in the graphDiscuss this resultChallenge it