AFTD Auto-Formalizing Theoretical Domains

restricted_cycle_perms_count

def

For a natural number n and a finite set S of natural numbers, the number of permutations σ of Fin n such that for every element x of Fin n, the size of the cycle containing x under σ is not in S.

Statement

def restricted_cycle_perms_count (n : ℕ) (S : Finset ℕ) : ℕ
Defined in
arXiv:2610.40342 Section 1.1
Verified
31 Oct 2026
Axioms
none listed
Used by 11

Read back from the Lean

The function restricted_cycle_perms_count n S returns the number (as a natural number) of permutations σ of Fin n such that for every x : Fin n, the cardinality of the cycle containing x under σ (the number of y : Fin n such that σ.SameCycle x y) is not in S.

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 permutations of Fin n having no cycle lengths in the finite set S. -/
def restricted_cycle_perms_count (n : ℕ) (S : Finset ℕ) : ℕ := ((Finset.univ : Finset (Equiv.Perm (Fin n))).filter (fun σ =>
    ∀ x : Fin n, (Finset.univ.filter (fun y => σ.SameCycle x y)).card ∉ (S : Set ℕ))).card
See it in the graphDiscuss this resultChallenge it