Theorem: Equiv.Perm.IsCycleOn.pow_apply_eq
File: Mathlib/GroupTheory/Perm/Cycle/Basic.lean

tactic: obtain rfl | hs := Finset.eq_singleton_or_nontrivial ha
state_before: ι : Type ?u.1658946
α : Type u_1
β : Type ?u.1658952
f g : Perm α
s✝ t : Set α
a b x y : α
s : Finset α
hf : IsCycleOn f ↑s
ha : a ∈ s
n : ℕ
⊢ ↑(f ^ n) a = a ↔ card s ∣ n

tactic: classical
  have h : ∀ x ∈ s.attach, ¬f ↑x = ↑x := fun x _ => hf.apply_ne hs x.2
  have := (hf.isCycle_subtypePerm hs).orderOf
  simp only [coe_sort_coe, support_subtype_perm, ne_eq, decide_not, Bool.not_eq_true',
    decide_eq_false_iff_not, mem_attach, forall_true_left, Subtype.forall, filter_true_of_mem h,
    card_attach] at this
  rw [← this, orderOf_dvd_iff_pow_eq_one,
    (hf.isCycle_subtypePerm hs).pow_eq_one_iff'
      (ne_of_apply_ne ((↑) : s → α) <| hf.apply_ne hs (⟨a, ha⟩ : s).2)]
  simp
state_before: case inr
ι : Type ?u.1658946
α : Type u_1
β : Type ?u.1658952
f g : Perm α
s✝ t : Set α
a b x y : α
s : Finset α
hf : IsCycleOn f ↑s
ha : a ∈ s
n : ℕ
hs : Set.Nontrivial ↑s
⊢ ↑(f ^ n) a = a ↔ card s ∣ n

tactic: rw [coe_singleton, isCycleOn_singleton] at hf
state_before: case inl
ι : Type ?u.1658946
α : Type u_1
β : Type ?u.1658952
f g : Perm α
s t : Set α
a b x y : α
n : ℕ
hf : IsCycleOn f ↑{a}
ha : a ∈ {a}
⊢ ↑(f ^ n) a = a ↔ card {a} ∣ n

tactic: simpa using IsFixedPt.iterate hf n
state_before: case inl
ι : Type ?u.1658946
α : Type u_1
β : Type ?u.1658952
f g : Perm α
s t : Set α
a b x y : α
n : ℕ
hf : ↑f a = a
ha : a ∈ {a}
⊢ ↑(f ^ n) a = a ↔ card {a} ∣ n

tactic: have h : ∀ x ∈ s.attach, ¬f ↑x = ↑x := fun x _ => hf.apply_ne hs x.2
state_before: case inr
ι : Type ?u.1658946
α : Type u_1
β : Type ?u.1658952
f g : Perm α
s✝ t : Set α
a b x y : α
s : Finset α
hf : IsCycleOn f ↑s
ha : a ∈ s
n : ℕ
hs : Set.Nontrivial ↑s
⊢ ↑(f ^ n) a = a ↔ card s ∣ n

tactic: have := (hf.isCycle_subtypePerm hs).orderOf
state_before: case inr
ι : Type ?u.1658946
α : Type u_1
β : Type ?u.1658952
f g : Perm α
s✝ t : Set α
a b x y : α
s : Finset α
hf : IsCycleOn f ↑s
ha : a ∈ s
n : ℕ
hs : Set.Nontrivial ↑s
h : ∀ (x : { x // x ∈ s }), x ∈ attach s → ¬↑f ↑x = ↑x
⊢ ↑(f ^ n) a = a ↔ card s ∣ n

tactic: simp only [coe_sort_coe, support_subtype_perm, ne_eq, decide_not, Bool.not_eq_true',
  decide_eq_false_iff_not, mem_attach, forall_true_left, Subtype.forall, filter_true_of_mem h,
  card_attach] at this
state_before: case inr
ι : Type ?u.1658946
α : Type u_1
β : Type ?u.1658952
f g : Perm α
s✝ t : Set α
a b x y : α
s : Finset α
hf : IsCycleOn f ↑s
ha : a ∈ s
n : ℕ
hs : Set.Nontrivial ↑s
h : ∀ (x : { x // x ∈ s }), x ∈ attach s → ¬↑f ↑x = ↑x
this :
  orderOf (subtypePerm f (_ : ∀ (x : α), x ∈ ↑s ↔ ↑f x ∈ ↑s)) =
    card (support (subtypePerm f (_ : ∀ (x : α), x ∈ ↑s ↔ ↑f x ∈ ↑s)))
⊢ ↑(f ^ n) a = a ↔ card s ∣ n

tactic: rw [← this, orderOf_dvd_iff_pow_eq_one,
  (hf.isCycle_subtypePerm hs).pow_eq_one_iff'
    (ne_of_apply_ne ((↑) : s → α) <| hf.apply_ne hs (⟨a, ha⟩ : s).2)]
state_before: case inr
ι : Type ?u.1658946
α : Type u_1
β : Type ?u.1658952
f g : Perm α
s✝ t : Set α
a b x y : α
s : Finset α
hf : IsCycleOn f ↑s
ha : a ∈ s
n : ℕ
hs : Set.Nontrivial ↑s
h : ∀ (x : { x // x ∈ s }), x ∈ attach s → ¬↑f ↑x = ↑x
this : orderOf (subtypePerm f (_ : ∀ (x : α), x ∈ ↑s ↔ ↑f x ∈ ↑s)) = card s
⊢ ↑(f ^ n) a = a ↔ card s ∣ n

tactic: simp
state_before: case inr
ι : Type ?u.1658946
α : Type u_1
β : Type ?u.1658952
f g : Perm α
s✝ t : Set α
a b x y : α
s : Finset α
hf : IsCycleOn f ↑s
ha : a ∈ s
n : ℕ
hs : Set.Nontrivial ↑s
h : ∀ (x : { x // x ∈ s }), x ∈ attach s → ¬↑f ↑x = ↑x
this : orderOf (subtypePerm f (_ : ∀ (x : α), x ∈ ↑s ↔ ↑f x ∈ ↑s)) = card s
⊢ ↑(f ^ n) a = a ↔
    ↑(subtypePerm f (_ : ∀ (x : α), x ∈ ↑s ↔ ↑f x ∈ ↑s) ^ n) { val := a, property := ha } = { val := a, property := ha }