Documentation

Mathlib.Combinatorics.Derangements.Finite

Derangements on fintypes #

This file contains lemmas that describe the cardinality of derangements α when α is a fintype.

Main definitions #

@[instance_reducible]
Equations

The number of derangements of an n-element set.

Equations
Instances For
    theorem numDerangements_succ (n : ℕ) :
    ↑(numDerangements (n + 1)) = (↑n + 1) * ↑(numDerangements n) - (-1) ^ n
    theorem numDerangements_sum (n : ℕ) :
    ↑(numDerangements n) = ∑ k ∈ Finset.range (n + 1), (-1) ^ k * ↑((k + 1).ascFactorial (n - k))