opl2_col_freq
def
Given a natural number n, an n × n partial array of pairs M : Fin n → Fin n → Option (Fin n × Fin n), and a column index c : Fin n, the column frequency opl2_col_freq M c is the cardinality of the finset of row indices r : Fin n such that M r c is not none.
Statement
def opl2_col_freq {n : ℕ} (M : Fin n → Fin n → Option (Fin n × Fin n)) (c : Fin n) : ℕ- Defined in
- arXiv:2611.13961, Section 2
- Verified
- 13 Nov 2026
- Axioms
- none listed
Read back from the Lean
Given a natural number n, a function M : Fin n → Fin n → Option (Fin n × Fin n) (an n × n grid/matrix with optional entries in Fin n × Fin n), and a column index c : Fin n, opl2_col_freq M c is defined to be the number of rows r : Fin n such that M r c is not none (i.e., (M r c).isSome is true).
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 n × n partial array of pairs. -/ def opl2_col_freq {n : ℕ} (M : Fin n → Fin n → Option (Fin n × Fin n)) (c : Fin n) : ℕ := (Finset.univ.filter (fun r : Fin n => (M r c).isSome)).card