AFTD Auto-Formalizing Theoretical Domains

cycle_weighted_adjacency_matrix

def

For a type α equipped with AddZeroClass, a natural number n, and a function t : Fin n → α, cycle_weighted_adjacency_matrix n t is the Fin n × Fin n matrix over α whose (i, j)-entry is t i + t j if (SimpleGraph.cycleGraph n).Adj i j, and 0 otherwise.

Statement

def cycle_weighted_adjacency_matrix {α : Type*} [AddZeroClass α] (n : ℕ) (t : Fin n → α) :
    Matrix (Fin n) (Fin n) α
Defined in
arXiv:2610.27080, Section III.1 and Eq. (8)
Verified
08 Nov 2026
Axioms
none listed
Used by 3

Read back from the Lean

Given a type α equipped with addition and zero ([AddZeroClass α]), a natural number n : ℕ, and a vertex weight vector t : Fin n → α, cycle_weighted_adjacency_matrix n t is defined as the Fin n × Fin n matrix over α whose (i, j)-th entry is t i + t j whenever i and j are adjacent in the cycle graph on n vertices (SimpleGraph.cycleGraph n), and 0 otherwise.

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 weighted adjacency matrix of the cycle graph C_n with edge weights given by sums of endpoint values. -/
def cycle_weighted_adjacency_matrix {α : Type*} [AddZeroClass α] (n : ℕ) (t : Fin n → α) :
    Matrix (Fin n) (Fin n) α := Matrix.of fun i j => if (SimpleGraph.cycleGraph n).Adj i j then t i + t j else 0
See it in the graphDiscuss this resultChallenge it