AFTD Auto-Formalizing Theoretical Domains

incidence_vector

def

Given a type R equipped with 0 and 1, a natural number N, and a subset E : Finset (Fin N), incidence_vector E is the function Fin N → R mapping each index j to 1 if j ∈ E, and 0 otherwise.

Statement

def incidence_vector {N : ℕ} {R : Type*} [Zero R] [One R] (E : Finset (Fin N)) : Fin N → R
Defined in
arXiv:2611.20197
Verified
18 Nov 2026
Axioms
none listed
Used by 1
  • zero_sum_separatorGiven an additive commutative group G, a natural number N, a sequence U : Fin N → G, an integer t : ℕ, and a commutative ring R, a…

Read back from the Lean

Given a natural number N, a type R with zero and one, and a finite subset E of Fin N, incidence_vector E is defined as the function from Fin N to R that maps each j : Fin N to 1 if j ∈ E 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 incidence vector 1_E in Fin N → R of a subset E of Fin N. -/
def incidence_vector {N : ℕ} {R : Type*} [Zero R] [One R] (E : Finset (Fin N)) : Fin N → R :=
  fun j => if j ∈ E then 1 else 0
See it in the graphDiscuss this resultChallenge it