File: Mathlib/Combinatorics/Derangements/Basic.lean

full_name: derangements
code: /-- A permutation is a derangement if it has no fixed points. -/
def derangements (α : Type*) : Set (Perm α) 
goal: Set (Equiv.Perm α)

full_name: mem_derangements_iff_fixedPoints_eq_empty
code: theorem mem_derangements_iff_fixedPoints_eq_empty {f : Perm α} :
    f ∈ derangements α ↔ fixedPoints f = ∅ 
goal: f ∈ derangements α ↔ Function.fixedPoints ⇑f = ∅

full_name: Equiv.derangementsCongr
code: /-- If `α` is equivalent to `β`, then `derangements α` is equivalent to `derangements β`. -/
def Equiv.derangementsCongr (e : α ≃ β) : derangements α ≃ derangements β 
goal: ↑(derangements α) ≃ ↑(derangements β)

full_name: derangements.subtypeEquiv
code: /-- Derangements on a subtype are equivalent to permutations on the original type where points are
fixed iff they are not in the subtype. -/
protected def subtypeEquiv (p : α → Prop) [DecidablePred p] :
    derangements (Subtype p) ≃ { f : Perm α // ∀ a, ¬p a ↔ a ∈ fixedPoints f } 
goal: ↑(derangements (Subtype p)) ≃ { f // ∀ (a : α), ¬p a ↔ a ∈ Function.fixedPoints ⇑f }

full_name: derangements.atMostOneFixedPointEquivSum_derangements
code: /-- The set of permutations that fix either `a` or nothing is equivalent to the sum of:
    - derangements on `α`
    - derangements on `α` minus `a`. -/
def atMostOneFixedPointEquivSum_derangements [DecidableEq α] (a : α) :
    { f : Perm α // fixedPoints f ⊆ {a} } ≃ (derangements ({a}ᶜ : Set α)) ⊕ (derangements α) 
goal: { f // Function.fixedPoints ⇑f ⊆ {a} } ≃ ↑(derangements ↑{a}ᶜ) ⊕ ↑(derangements α)

full_name: derangements.Equiv.RemoveNone.fiber
code: /-- The set of permutations `f` such that the preimage of `(a, f)` under
    `Equiv.Perm.decomposeOption` is a derangement. -/
def RemoveNone.fiber (a : Option α) : Set (Perm α) 
goal: Set (Equiv.Perm α)

full_name: derangements.Equiv.RemoveNone.mem_fiber
code: theorem RemoveNone.mem_fiber (a : Option α) (f : Perm α) :
    f ∈ RemoveNone.fiber a ↔
      ∃ F : Perm (Option α), F ∈ derangements (Option α) ∧ F none = a ∧ removeNone F = f 
goal: f ∈ derangements.Equiv.RemoveNone.fiber a ↔ ∃ F ∈ derangements (Option α), F none = a ∧ Equiv.removeNone F = f

full_name: derangements.Equiv.RemoveNone.fiber_none
code: theorem RemoveNone.fiber_none : RemoveNone.fiber (@none α) = ∅ 
goal: derangements.Equiv.RemoveNone.fiber none = ∅

full_name: derangements.Equiv.RemoveNone.fiber_some
code: /-- For any `a : α`, the fiber over `some a` is the set of permutations
    where `a` is the only possible fixed point. -/
theorem RemoveNone.fiber_some (a : α) :
    RemoveNone.fiber (some a) = { f : Perm α | fixedPoints f ⊆ {a} } 
goal: derangements.Equiv.RemoveNone.fiber (some a) = {f | Function.fixedPoints ⇑f ⊆ {a}}

full_name: derangements.derangementsOptionEquivSigmaAtMostOneFixedPoint
code: /-- The set of derangements on `Option α` is equivalent to the union over `a : α`
    of "permutations with `a` the only possible fixed point". -/
def derangementsOptionEquivSigmaAtMostOneFixedPoint :
    derangements (Option α) ≃ Σa : α, { f : Perm α | fixedPoints f ⊆ {a} } 
goal: ↑(derangements (Option α)) ≃ (a : α) × ↑{f | Function.fixedPoints ⇑f ⊆ {a}}

full_name: derangements.derangementsRecursionEquiv
code: /-- The set of derangements on `Option α` is equivalent to the union over all `a : α` of
    "derangements on `α` ⊕ derangements on `{a}ᶜ`". -/
def derangementsRecursionEquiv :
    derangements (Option α) ≃
      Σa : α, derangements (({a}ᶜ : Set α) : Type _) ⊕ derangements α 
goal: ↑(derangements (Option α)) ≃ (a : α) × (↑(derangements ↑{a}ᶜ) ⊕ ↑(derangements α))