AFTD Auto-Formalizing Theoretical Domains

hypercube_maj

def

Given three Boolean vectors x, y, z : Fin n → Bool, hypercube_maj x y z is their componentwise majority vector, defined by (x ⊓ y) ⊔ (y ⊓ z) ⊔ (z ⊓ x).

Statement

def hypercube_maj {n : ℕ} (x y z : Fin n → Bool) : Fin n → Bool
Defined in
arXiv:2610.38287 Section 2.3.1
Verified
08 Nov 2026
Axioms
none listed
Used by 3

Read back from the Lean

hypercube_maj defines a function that takes an implicit natural number $n$ and three vectors $x, y, z : \mathrm{Fin}\ n \to \mathrm{Bool}$, and produces the vector in $\mathrm{Fin}\ n \to \mathrm{Bool}$ given by $(x \sqcap y) \sqcup (y \sqcap z) \sqcup (z \sqcap x)$, which is the pointwise majority (or median) of $x, y, 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

/-- Componentwise majority vector of three Boolean vectors. -/
def hypercube_maj {n : ℕ} (x y z : Fin n → Bool) : Fin n → Bool := (x ⊓ y) ⊔ (y ⊓ z) ⊔ (z ⊓ x)
See it in the graphDiscuss this resultChallenge it