AFTD Auto-Formalizing Theoretical Domains

perm_reflection_length

def

The reflection length of a permutation σ of {0, ..., n-1} is the sum of the lengths of the nontrivial cycles minus the number of nontrivial cycles.

Statement

def perm_reflection_length {n : ℕ} (σ : Equiv.Perm (Fin n)) : ℕ
Defined in
arXiv:2611.33575 Section 1
Verified
27 Nov 2026
Axioms
none listed

Read back from the Lean

For an implicit natural number $n$ and a permutation $\sigma$ of $\mathrm{Fin}(n)$, $\mathtt{perm\_reflection\_length}(\sigma)$ is defined as the natural number $\sum (\mathtt{cycleType}(\sigma)) - |\mathtt{cycleType}(\sigma)|$, that is, the sum of the elements in the multiset of cycle lengths of $\sigma$ minus the cardinality of that multiset (using truncated natural number subtraction).

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

/-- Reflection length ℓ'(σ) of a permutation on Fin n. -/
def perm_reflection_length {n : ℕ} (σ : Equiv.Perm (Fin n)) : ℕ := Multiset.sum (Equiv.Perm.cycleType σ) - Multiset.card (Equiv.Perm.cycleType σ)
See it in the graphDiscuss this resultChallenge it