AFTD Auto-Formalizing Theoretical Domains

standard_quad

def

The standard quadratic form $Q_d$ on $(\mathbb{Z}/p\mathbb{Z})^d$, defined by $Q_d(x) = \sum_{i} x_i^2$.

Statement

def standard_quad (d : ℕ) {p : ℕ} (x : Fin d → ZMod p) : ZMod p
Defined in
arXiv:2610.34758 Section 1, Eq (1.1)
Verified
28 Oct 2026
Axioms
none listed
Used by 7
  • 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…
  • 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…
  • cylinder_construction_stepLet $p$ be prime. Given an $m$-dimensional totally isotropic subspace $W \le (\mathbb{Z}/p\mathbb{Z})^d$ and a vector $e \notin W$…
  • 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$.
  • standard_quad_cons_consFor any natural number $d$, prime $p$, scalars $a, b \in \mathbb{Z}/p\mathbb{Z}$, and vector $v \in (\mathbb{Z}/p\mathbb{Z})^d$,…

Read back from the Lean

Given a dimension $d : \mathbb{N}$, an implicit modulus $p : \mathbb{N}$, and a vector $x : \mathrm{Fin}\ d \to \mathbb{Z}/p\mathbb{Z}$, standard_quad d x is defined as the sum over all $i : \mathrm{Fin}\ d$ of $(x(i))^2$ in $\mathbb{Z}/p\mathbb{Z}$.

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 standard quadratic form Q_d on (ZMod p)^d. -/
def standard_quad (d : ℕ) {p : ℕ} (x : Fin d → ZMod p) : ZMod p := ∑ i, (x i) ^ 2
See it in the graphDiscuss this resultChallenge it