AFTD Auto-Formalizing Theoretical Domains

is_balanced_weighing_matrix

def

A square matrix W of order v with entries in {-1, 0, 1} is a balanced weighing matrix with parameters (k, λ) if W Wᵀ = k I_v and |W| |W|ᵀ = (k - λ) I_v + λ J_v.

Statement

def is_balanced_weighing_matrix (v : ℕ) (W : Matrix (Fin v) (Fin v) ℤ) (k lam : ℕ) : Prop
Defined in
arXiv:2611.17855, Section 2.1
Verified
16 Nov 2026
Axioms
none listed
Used by 1

Read back from the Lean

Definition of is_balanced_weighing_matrix v W k lam, where v : ℕ, W : Matrix (Fin v) (Fin v) ℤ, and k lam : ℕ. It asserts the conjunction of three conditions: 1. For all i, j : Fin v, the entry W i j is in {-1, 0, 1}. 2. The matrix product of W and its transpose Wᵀ equals k times the v × v identity matrix (over ℤ). 3. Letting |W| be the entrywise absolute value of W, the matrix product |W| * |W|ᵀ equals (k - lam) times the v × v identity matrix plus lam times the v × v all-ones matrix (over ℤ).

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

/-- Predicate for a balanced weighing matrix of order v with parameters (k, λ). -/
def is_balanced_weighing_matrix (v : ℕ) (W : Matrix (Fin v) (Fin v) ℤ) (k lam : ℕ) : Prop :=
  (∀ i j, W i j ∈ ({-1, 0, 1} : Set ℤ)) ∧
  W * W.transpose = (k : ℤ) • (1 : Matrix (Fin v) (Fin v) ℤ) ∧
  (W.map (|·|)) * (W.map (|·|)).transpose =
    ((k : ℤ) - (lam : ℤ)) • (1 : Matrix (Fin v) (Fin v) ℤ) +
      (lam : ℤ) • (Matrix.of fun (_ _ : Fin v) => (1 : ℤ))
See it in the graphDiscuss this resultChallenge it