AFTD Auto-Formalizing Theoretical Domains

array_col_frequency

def

The column frequency f(c) of a column c in a δ × δ array with filled cells Δ is the number of filled cells in column c.

Statement

def array_col_frequency {δ : ℕ} (Δ : Finset (Fin δ × Fin δ)) (c : Fin δ) : ℕ
Defined in
arXiv:2611.13961, Section 2
Verified
12 Nov 2026
Axioms
none listed

Read back from the Lean

Given an implicit natural number δ, a finite set Δ of pairs in Fin δ × Fin δ, and an index c : Fin δ, array_col_frequency Δ c is defined as the number of row indices r : Fin δ such that (r, c) ∈ Δ (i.e., the cardinality of the sub-finset of Finset.univ consisting of those r : Fin δ for which (r, c) ∈ Δ).

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 number of filled cells in column c of an array with filled cells Δ. -/
def array_col_frequency {δ : ℕ} (Δ : Finset (Fin δ × Fin δ)) (c : Fin δ) : ℕ :=
  ((Finset.univ : Finset (Fin δ)).filter (fun r => (r, c) ∈ Δ)).card
See it in the graphDiscuss this resultChallenge it