Theorem: derangements.Equiv.RemoveNone.fiber_some
File: Mathlib/Combinatorics/Derangements/Basic.lean

tactic: ext f
state_before: α : Type u_1
β : Type ?u.81438
inst✝ : DecidableEq α
a : α
⊢ fiber (some a) = {f | fixedPoints ↑f ⊆ {a}}

tactic: constructor
state_before: case h
α : Type u_1
β : Type ?u.81438
inst✝ : DecidableEq α
a : α
f : Perm α
⊢ f ∈ fiber (some a) ↔ f ∈ {f | fixedPoints ↑f ⊆ {a}}

tactic: rw [RemoveNone.mem_fiber]
state_before: case h.mp
α : Type u_1
β : Type ?u.81438
inst✝ : DecidableEq α
a : α
f : Perm α
⊢ f ∈ fiber (some a) → f ∈ {f | fixedPoints ↑f ⊆ {a}}

tactic: rintro ⟨F, F_derangement, F_none, rfl⟩ x x_fixed
state_before: case h.mp
α : Type u_1
β : Type ?u.81438
inst✝ : DecidableEq α
a : α
f : Perm α
⊢ (∃ F, F ∈ derangements (Option α) ∧ ↑F none = some a ∧ removeNone F = f) → f ∈ {f | fixedPoints ↑f ⊆ {a}}

tactic: rw [mem_fixedPoints_iff] at x_fixed
state_before: case h.mp.intro.intro.intro
α : Type u_1
β : Type ?u.81438
inst✝ : DecidableEq α
a : α
F : Perm (Option α)
F_derangement : F ∈ derangements (Option α)
F_none : ↑F none = some a
x : α
x_fixed : x ∈ fixedPoints ↑(removeNone F)
⊢ x ∈ {a}

tactic: apply_fun some  at x_fixed
state_before: case h.mp.intro.intro.intro
α : Type u_1
β : Type ?u.81438
inst✝ : DecidableEq α
a : α
F : Perm (Option α)
F_derangement : F ∈ derangements (Option α)
F_none : ↑F none = some a
x : α
x_fixed : ↑(removeNone F) x = x
⊢ x ∈ {a}

tactic: cases' Fx : F (some x) with y
state_before: case h.mp.intro.intro.intro
α : Type u_1
β : Type ?u.81438
inst✝ : DecidableEq α
a : α
F : Perm (Option α)
F_derangement : F ∈ derangements (Option α)
F_none : ↑F none = some a
x : α
x_fixed : some (↑(removeNone F) x) = some x
⊢ x ∈ {a}

tactic: rwa [removeNone_none F Fx, F_none, Option.some_inj, eq_comm] at x_fixed
state_before: case h.mp.intro.intro.intro.none
α : Type u_1
β : Type ?u.81438
inst✝ : DecidableEq α
a : α
F : Perm (Option α)
F_derangement : F ∈ derangements (Option α)
F_none : ↑F none = some a
x : α
x_fixed : some (↑(removeNone F) x) = some x
Fx : ↑F (some x) = none
⊢ x ∈ {a}

tactic: exfalso
state_before: case h.mp.intro.intro.intro.some
α : Type u_1
β : Type ?u.81438
inst✝ : DecidableEq α
a : α
F : Perm (Option α)
F_derangement : F ∈ derangements (Option α)
F_none : ↑F none = some a
x : α
x_fixed : some (↑(removeNone F) x) = some x
y : α
Fx : ↑F (some x) = some y
⊢ x ∈ {a}

tactic: rw [removeNone_some F ⟨y, Fx⟩] at x_fixed
state_before: case h.mp.intro.intro.intro.some.h
α : Type u_1
β : Type ?u.81438
inst✝ : DecidableEq α
a : α
F : Perm (Option α)
F_derangement : F ∈ derangements (Option α)
F_none : ↑F none = some a
x : α
x_fixed : some (↑(removeNone F) x) = some x
y : α
Fx : ↑F (some x) = some y
⊢ False

tactic: exact F_derangement _ x_fixed
state_before: case h.mp.intro.intro.intro.some.h
α : Type u_1
β : Type ?u.81438
inst✝ : DecidableEq α
a : α
F : Perm (Option α)
F_derangement : F ∈ derangements (Option α)
F_none : ↑F none = some a
x : α
x_fixed : ↑F (some x) = some x
y : α
Fx : ↑F (some x) = some y
⊢ False

tactic: intro h_opfp
state_before: case h.mpr
α : Type u_1
β : Type ?u.81438
inst✝ : DecidableEq α
a : α
f : Perm α
⊢ f ∈ {f | fixedPoints ↑f ⊆ {a}} → f ∈ fiber (some a)

tactic: use Equiv.Perm.decomposeOption.symm (some a, f)
state_before: case h.mpr
α : Type u_1
β : Type ?u.81438
inst✝ : DecidableEq α
a : α
f : Perm α
h_opfp : f ∈ {f | fixedPoints ↑f ⊆ {a}}
⊢ f ∈ fiber (some a)

tactic: constructor
state_before: case h.mpr
α : Type u_1
β : Type ?u.81438
inst✝ : DecidableEq α
a : α
f : Perm α
h_opfp : f ∈ {f | fixedPoints ↑f ⊆ {a}}
⊢ ↑Perm.decomposeOption.symm (some a, f) ∈ derangements (Option α) ∧
    ↑Perm.decomposeOption (↑Perm.decomposeOption.symm (some a, f)) = (some a, f)

tactic: intro x
state_before: case h.mpr.left
α : Type u_1
β : Type ?u.81438
inst✝ : DecidableEq α
a : α
f : Perm α
h_opfp : f ∈ {f | fixedPoints ↑f ⊆ {a}}
⊢ ↑Perm.decomposeOption.symm (some a, f) ∈ derangements (Option α)

tactic: apply_fun fun x => Equiv.swap none (some a) x
state_before: case h.mpr.left
α : Type u_1
β : Type ?u.81438
inst✝ : DecidableEq α
a : α
f : Perm α
h_opfp : f ∈ {f | fixedPoints ↑f ⊆ {a}}
x : Option α
⊢ ↑(↑Perm.decomposeOption.symm (some a, f)) x ≠ x

tactic: simp only [Perm.decomposeOption_symm_apply, swap_apply_self, Perm.coe_mul]
state_before: α : Type u_1
β : Type ?u.81438
inst✝ : DecidableEq α
a : α
f : Perm α
h_opfp : f ∈ {f | fixedPoints ↑f ⊆ {a}}
x : Option α
⊢ (fun x => ↑(Equiv.swap none (some a)) x) (↑(↑Perm.decomposeOption.symm (some a, f)) x) ≠
    (fun x => ↑(Equiv.swap none (some a)) x) x

tactic: cases' x with x
state_before: α : Type u_1
β : Type ?u.81438
inst✝ : DecidableEq α
a : α
f : Perm α
h_opfp : f ∈ {f | fixedPoints ↑f ⊆ {a}}
x : Option α
⊢ ↑(Equiv.swap none (some a)) ((↑(Equiv.swap none (some a)) ∘ ↑(optionCongr f)) x) ≠ ↑(Equiv.swap none (some a)) x

tactic: simp only [comp, optionCongr_apply, Option.map_some', swap_apply_self]
state_before: case some
α : Type u_1
β : Type ?u.81438
inst✝ : DecidableEq α
a : α
f : Perm α
h_opfp : f ∈ {f | fixedPoints ↑f ⊆ {a}}
x : α
⊢ ↑(Equiv.swap none (some a)) ((↑(Equiv.swap none (some a)) ∘ ↑(optionCongr f)) (some x)) ≠
    ↑(Equiv.swap none (some a)) (some x)

tactic: by_cases x_vs_a : x = a
state_before: case some
α : Type u_1
β : Type ?u.81438
inst✝ : DecidableEq α
a : α
f : Perm α
h_opfp : f ∈ {f | fixedPoints ↑f ⊆ {a}}
x : α
⊢ some (↑f x) ≠ ↑(Equiv.swap none (some a)) (some x)

tactic: have ne_1 : some x ≠ none := Option.some_ne_none _
state_before: case neg
α : Type u_1
β : Type ?u.81438
inst✝ : DecidableEq α
a : α
f : Perm α
h_opfp : f ∈ {f | fixedPoints ↑f ⊆ {a}}
x : α
x_vs_a : ¬x = a
⊢ some (↑f x) ≠ ↑(Equiv.swap none (some a)) (some x)

tactic: have ne_2 : some x ≠ some a := (Option.some_injective α).ne_iff.mpr x_vs_a
state_before: case neg
α : Type u_1
β : Type ?u.81438
inst✝ : DecidableEq α
a : α
f : Perm α
h_opfp : f ∈ {f | fixedPoints ↑f ⊆ {a}}
x : α
x_vs_a : ¬x = a
ne_1 : some x ≠ none
⊢ some (↑f x) ≠ ↑(Equiv.swap none (some a)) (some x)

tactic: rw [swap_apply_of_ne_of_ne ne_1 ne_2, (Option.some_injective α).ne_iff]
state_before: case neg
α : Type u_1
β : Type ?u.81438
inst✝ : DecidableEq α
a : α
f : Perm α
h_opfp : f ∈ {f | fixedPoints ↑f ⊆ {a}}
x : α
x_vs_a : ¬x = a
ne_1 : some x ≠ none
ne_2 : some x ≠ some a
⊢ some (↑f x) ≠ ↑(Equiv.swap none (some a)) (some x)

tactic: intro contra
state_before: case neg
α : Type u_1
β : Type ?u.81438
inst✝ : DecidableEq α
a : α
f : Perm α
h_opfp : f ∈ {f | fixedPoints ↑f ⊆ {a}}
x : α
x_vs_a : ¬x = a
ne_1 : some x ≠ none
ne_2 : some x ≠ some a
⊢ ↑f x ≠ x

tactic: exact x_vs_a (h_opfp contra)
state_before: case neg
α : Type u_1
β : Type ?u.81438
inst✝ : DecidableEq α
a : α
f : Perm α
h_opfp : f ∈ {f | fixedPoints ↑f ⊆ {a}}
x : α
x_vs_a : ¬x = a
ne_1 : some x ≠ none
ne_2 : some x ≠ some a
contra : ↑f x = x
⊢ False

tactic: simp
state_before: case none
α : Type u_1
β : Type ?u.81438
inst✝ : DecidableEq α
a : α
f : Perm α
h_opfp : f ∈ {f | fixedPoints ↑f ⊆ {a}}
⊢ ↑(Equiv.swap none (some a)) ((↑(Equiv.swap none (some a)) ∘ ↑(optionCongr f)) none) ≠ ↑(Equiv.swap none (some a)) none

tactic: rw [x_vs_a, swap_apply_right]
state_before: case pos
α : Type u_1
β : Type ?u.81438
inst✝ : DecidableEq α
a : α
f : Perm α
h_opfp : f ∈ {f | fixedPoints ↑f ⊆ {a}}
x : α
x_vs_a : x = a
⊢ some (↑f x) ≠ ↑(Equiv.swap none (some a)) (some x)

tactic: apply Option.some_ne_none
state_before: case pos
α : Type u_1
β : Type ?u.81438
inst✝ : DecidableEq α
a : α
f : Perm α
h_opfp : f ∈ {f | fixedPoints ↑f ⊆ {a}}
x : α
x_vs_a : x = a
⊢ some (↑f a) ≠ none

tactic: rw [apply_symm_apply]
state_before: case h.mpr.right
α : Type u_1
β : Type ?u.81438
inst✝ : DecidableEq α
a : α
f : Perm α
h_opfp : f ∈ {f | fixedPoints ↑f ⊆ {a}}
⊢ ↑Perm.decomposeOption (↑Perm.decomposeOption.symm (some a, f)) = (some a, f)