AFTD Auto-Formalizing Theoretical Domains

ternary_affine_hyperplane

def

Given an explicit natural number n, a vector a : Fin n → ZMod 3, and a scalar b : ZMod 3, the ternary affine hyperplane is the finite set (Finset) of all vectors x : Fin n → ZMod 3 such that the sum over all i : Fin n of a i * x i equals b.

Statement

def ternary_affine_hyperplane (n : ℕ) (a : Fin n → ZMod 3) (b : ZMod 3) : Finset (Fin n → ZMod 3)
Defined in
arXiv:2610.32789, Section 3.1
Verified
30 Oct 2026
Axioms
none listed
Used by 5

Read back from the Lean

Given a natural number $n$, a vector $a : \text{Fin } n \to \mathbb{Z}/3\mathbb{Z}$, and a scalar $b : \mathbb{Z}/3\mathbb{Z}$, ternary_affine_hyperplane n a b is defined as the finite set of all vectors $x : \text{Fin } n \to \mathbb{Z}/3\mathbb{Z}$ such that $\sum_{i \in \text{Fin } n} a(i) x(i) = b$.

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 affine hyperplane in (Fin n → ZMod 3) with equation sum_i a_i * x_i = b as a Finset. -/
def ternary_affine_hyperplane (n : ℕ) (a : Fin n → ZMod 3) (b : ZMod 3) : Finset (Fin n → ZMod 3) := Finset.filter (fun x => (∑ i : Fin n, a i * x i) = b) Finset.univ
See it in the graphDiscuss this resultChallenge it