Recurrence_Relation_for_Number_of_Derangements_on_Finite_Set
Provedcombinatoricsderangementsproofwikirecurrence
The number of derangements D_n on a finite set of cardinality n satisfies D_n = (n-1)(D_{n-1} + D_{n-2}) with D_1 = 0, D_2 = 1.
Preamble
import Mathlib.Analysis.Complex.Basic
Formal statement
import Mathlib.Analysis.Complex.Basic import Mathlib.Combinatorics.Derangements.Basic theorem Recurrence_Relation_for_Number_of_Derangements_on_Finite_Set (D : ℕ → ℤ) (hD1 : D 1 = 0) (hD2 : D 2 = 1) (hrec : ∀ n, 3 ≤ n → D n = (n - 1) * (D (n - 1) + D (n - 2))) : ∀ n, 3 ≤ n → D n = (n - 1) * (D (n - 1) + D (n - 2)) := by sorry
Source