File: Mathlib/GroupTheory/Perm/Cycle/Basic.lean

full_name: Equiv.Perm.SameCycle
code: /-- The equivalence relation indicating that two points are in the same cycle of a permutation. -/
def SameCycle (f : Perm α) (x y : α) : Prop 
goal: Prop

full_name: Equiv.Perm.SameCycle.refl
code: @[refl]
theorem SameCycle.refl (f : Perm α) (x : α) : SameCycle f x x 
goal: f.SameCycle x x

full_name: Equiv.Perm.SameCycle.rfl
code: theorem SameCycle.rfl : SameCycle f x x 
goal: f.SameCycle x x

full_name: Eq.sameCycle
code: protected theorem _root_.Eq.sameCycle (h : x = y) (f : Perm α) : f.SameCycle x y 
goal: f.SameCycle x y

full_name: Equiv.Perm.SameCycle.symm
code: @[symm]
theorem SameCycle.symm : SameCycle f x y → SameCycle f y x 
goal: f.SameCycle x y → f.SameCycle y x

full_name: Equiv.Perm.sameCycle_comm
code: theorem sameCycle_comm : SameCycle f x y ↔ SameCycle f y x 
goal: f.SameCycle x y ↔ f.SameCycle y x

full_name: Equiv.Perm.SameCycle.trans
code: @[trans]
theorem SameCycle.trans : SameCycle f x y → SameCycle f y z → SameCycle f x z 
goal: f.SameCycle x y → f.SameCycle y z → f.SameCycle x z

full_name: Equiv.Perm.SameCycle.equivalence
code: theorem SameCycle.equivalence : Equivalence (SameCycle f) 
goal: Equivalence f.SameCycle

full_name: Equiv.Perm.SameCycle.setoid
code: /-- The setoid defined by the `SameCycle` relation. -/
def SameCycle.setoid (f : Perm α) : Setoid α 
goal: Setoid α

full_name: Equiv.Perm.sameCycle_one
code: @[simp]
theorem sameCycle_one : SameCycle 1 x y ↔ x = y 
goal: Equiv.Perm.SameCycle 1 x y ↔ x = y

full_name: Equiv.Perm.sameCycle_inv
code: @[simp]
theorem sameCycle_inv : SameCycle f⁻¹ x y ↔ SameCycle f x y 
goal: f⁻¹.SameCycle x y ↔ f.SameCycle x y

full_name: Equiv.Perm.sameCycle_conj
code: @[simp]
theorem sameCycle_conj : SameCycle (g * f * g⁻¹) x y ↔ SameCycle f (g⁻¹ x) (g⁻¹ y) 
goal: (g * f * g⁻¹).SameCycle x y ↔ f.SameCycle (g⁻¹ x) (g⁻¹ y)

full_name: Equiv.Perm.SameCycle.conj
code: theorem SameCycle.conj : SameCycle f x y → SameCycle (g * f * g⁻¹) (g x) (g y) 
goal: f.SameCycle x y → (g * f * g⁻¹).SameCycle (g x) (g y)

full_name: Equiv.Perm.SameCycle.apply_eq_self_iff
code: theorem SameCycle.apply_eq_self_iff : SameCycle f x y → (f x = x ↔ f y = y) 
goal: f.SameCycle x y → (f x = x ↔ f y = y)

full_name: Equiv.Perm.SameCycle.eq_of_left
code: theorem SameCycle.eq_of_left (h : SameCycle f x y) (hx : IsFixedPt f x) : x = y 
goal: x = y

full_name: Equiv.Perm.SameCycle.eq_of_right
code: theorem SameCycle.eq_of_right (h : SameCycle f x y) (hy : IsFixedPt f y) : x = y 
goal: x = y

full_name: Equiv.Perm.sameCycle_apply_left
code: @[simp]
theorem sameCycle_apply_left : SameCycle f (f x) y ↔ SameCycle f x y 
goal: f.SameCycle (f x) y ↔ f.SameCycle x y

full_name: Equiv.Perm.sameCycle_apply_right
code: @[simp]
theorem sameCycle_apply_right : SameCycle f x (f y) ↔ SameCycle f x y 
goal: f.SameCycle x (f y) ↔ f.SameCycle x y

full_name: Equiv.Perm.sameCycle_inv_apply_left
code: @[simp]
theorem sameCycle_inv_apply_left : SameCycle f (f⁻¹ x) y ↔ SameCycle f x y 
goal: f.SameCycle (f⁻¹ x) y ↔ f.SameCycle x y

full_name: Equiv.Perm.sameCycle_inv_apply_right
code: @[simp]
theorem sameCycle_inv_apply_right : SameCycle f x (f⁻¹ y) ↔ SameCycle f x y 
goal: f.SameCycle x (f⁻¹ y) ↔ f.SameCycle x y

full_name: Equiv.Perm.sameCycle_zpow_left
code: @[simp]
theorem sameCycle_zpow_left {n : ℤ} : SameCycle f ((f ^ n) x) y ↔ SameCycle f x y 
goal: f.SameCycle ((f ^ n) x) y ↔ f.SameCycle x y

full_name: Equiv.Perm.sameCycle_zpow_right
code: @[simp]
theorem sameCycle_zpow_right {n : ℤ} : SameCycle f x ((f ^ n) y) ↔ SameCycle f x y 
goal: f.SameCycle x ((f ^ n) y) ↔ f.SameCycle x y

full_name: Equiv.Perm.sameCycle_pow_left
code: @[simp]
theorem sameCycle_pow_left {n : ℕ} : SameCycle f ((f ^ n) x) y ↔ SameCycle f x y 
goal: f.SameCycle ((f ^ n) x) y ↔ f.SameCycle x y

full_name: Equiv.Perm.sameCycle_pow_right
code: @[simp]
theorem sameCycle_pow_right {n : ℕ} : SameCycle f x ((f ^ n) y) ↔ SameCycle f x y 
goal: f.SameCycle x ((f ^ n) y) ↔ f.SameCycle x y

full_name: Equiv.Perm.SameCycle.of_pow
code: theorem SameCycle.of_pow {n : ℕ} : SameCycle (f ^ n) x y → SameCycle f x y 
goal: (f ^ n).SameCycle x y → f.SameCycle x y

full_name: Equiv.Perm.SameCycle.of_zpow
code: theorem SameCycle.of_zpow {n : ℤ} : SameCycle (f ^ n) x y → SameCycle f x y 
goal: (f ^ n).SameCycle x y → f.SameCycle x y

full_name: Equiv.Perm.sameCycle_subtypePerm
code: @[simp]
theorem sameCycle_subtypePerm {h} {x y : { x // p x }} :
    (f.subtypePerm h).SameCycle x y ↔ f.SameCycle x y 
goal: (f.subtypePerm h).SameCycle x y ↔ f.SameCycle ↑x ↑y

full_name: Equiv.Perm.sameCycle_extendDomain
code: @[simp]
theorem sameCycle_extendDomain {p : β → Prop} [DecidablePred p] {f : α ≃ Subtype p} :
    SameCycle (g.extendDomain f) (f x) (f y) ↔ g.SameCycle x y 
goal: (g.extendDomain f).SameCycle ↑(f x) ↑(f y) ↔ g.SameCycle x y

full_name: Equiv.Perm.SameCycle.exists_pow_eq'
code: theorem SameCycle.exists_pow_eq' [Finite α] : SameCycle f x y → ∃ i < orderOf f, (f ^ i) x = y 
goal: f.SameCycle x y → ∃ i < orderOf f, (f ^ i) x = y

full_name: Equiv.Perm.SameCycle.exists_pow_eq''
code: theorem SameCycle.exists_pow_eq'' [Finite α] (h : SameCycle f x y) :
    ∃ i : ℕ, 0 < i ∧ i ≤ orderOf f ∧ (f ^ i) x = y 
goal: ∃ i, 0 < i ∧ i ≤ orderOf f ∧ (f ^ i) x = y

full_name: Equiv.Perm.instDecidableRelSameCycleOfInv
code: instance (f : Perm α) [DecidableRel (SameCycle f⁻¹)] :
    DecidableRel (SameCycle f) 
goal: DecidableRel f.SameCycle

full_name: Equiv.Perm.instDecidableRelSameCycleInv
code: instance (f : Perm α) [DecidableRel (SameCycle f)] :
    DecidableRel (SameCycle f⁻¹) 
goal: DecidableRel f⁻¹.SameCycle

full_name: Equiv.Perm.instDecidableRelSameCycleOfNatOfDecidableEq
code: instance (priority := 100) [DecidableEq α] : DecidableRel (SameCycle (1 : Perm α)) 
goal: DecidableRel (Equiv.Perm.SameCycle 1)

full_name: Equiv.Perm.instDecidableRelSameCycleOfFintypeOfDecidableEq
code: instance [Fintype α] [DecidableEq α] (f : Perm α) : DecidableRel (SameCycle f) 
goal: DecidableRel f.SameCycle

full_name: Equiv.Perm.IsCycle
code: /-- A cycle is a non identity permutation where any two nonfixed points of the permutation are
related by repeated application of the permutation. -/
def IsCycle (f : Perm α) : Prop 
goal: Prop

full_name: Equiv.Perm.IsCycle.ne_one
code: theorem IsCycle.ne_one (h : IsCycle f) : f ≠ 1 
goal: f ≠ 1

full_name: Equiv.Perm.not_isCycle_one
code: @[simp]
theorem not_isCycle_one : ¬(1 : Perm α).IsCycle 
goal: ¬Equiv.Perm.IsCycle 1

full_name: Equiv.Perm.IsCycle.sameCycle
code: protected theorem IsCycle.sameCycle (hf : IsCycle f) (hx : f x ≠ x) (hy : f y ≠ y) :
    SameCycle f x y 
goal: f.SameCycle x y

full_name: Equiv.Perm.IsCycle.exists_zpow_eq
code: theorem IsCycle.exists_zpow_eq : IsCycle f → f x ≠ x → f y ≠ y → ∃ i : ℤ, (f ^ i) x = y 
goal: f.IsCycle → f x ≠ x → f y ≠ y → ∃ i, (f ^ i) x = y

full_name: Equiv.Perm.IsCycle.inv
code: theorem IsCycle.inv (hf : IsCycle f) : IsCycle f⁻¹ 
goal: f⁻¹.IsCycle

full_name: Equiv.Perm.isCycle_inv
code: @[simp]
theorem isCycle_inv : IsCycle f⁻¹ ↔ IsCycle f 
goal: f⁻¹.IsCycle ↔ f.IsCycle

full_name: Equiv.Perm.IsCycle.conj
code: theorem IsCycle.conj : IsCycle f → IsCycle (g * f * g⁻¹) 
goal: f.IsCycle → (g * f * g⁻¹).IsCycle

full_name: Equiv.Perm.IsCycle.extendDomain
code: protected theorem IsCycle.extendDomain {p : β → Prop} [DecidablePred p] (f : α ≃ Subtype p) :
    IsCycle g → IsCycle (g.extendDomain f) 
goal: g.IsCycle → (g.extendDomain f).IsCycle

full_name: Equiv.Perm.isCycle_iff_sameCycle
code: theorem isCycle_iff_sameCycle (hx : f x ≠ x) : IsCycle f ↔ ∀ {y}, SameCycle f x y ↔ f y ≠ y 
goal: f.IsCycle ↔ ∀ {y : α}, f.SameCycle x y ↔ f y ≠ y

full_name: Equiv.Perm.IsCycle.exists_pow_eq
code: theorem IsCycle.exists_pow_eq (hf : IsCycle f) (hx : f x ≠ x) (hy : f y ≠ y) :
    ∃ i : ℕ, (f ^ i) x = y 
goal: ∃ i, (f ^ i) x = y

full_name: Equiv.Perm.isCycle_swap
code: theorem isCycle_swap (hxy : x ≠ y) : IsCycle (swap x y) 
goal: (Equiv.swap x y).IsCycle

full_name: Equiv.Perm.IsSwap.isCycle
code: protected theorem IsSwap.isCycle : IsSwap f → IsCycle f 
goal: f.IsSwap → f.IsCycle

full_name: Equiv.Perm.IsCycle.two_le_card_support
code: theorem IsCycle.two_le_card_support (h : IsCycle f) : 2 ≤ f.support.card 
goal: 2 ≤ f.support.card

full_name: Equiv.Perm.IsCycle.zpowersEquivSupport
code: /-- The subgroup generated by a cycle is in bijection with its support -/
noncomputable def IsCycle.zpowersEquivSupport {σ : Perm α} (hσ : IsCycle σ) :
    (Subgroup.zpowers σ) ≃ σ.support 
goal: ↥(Subgroup.zpowers σ) ≃ { x // x ∈ σ.support }

full_name: Equiv.Perm.IsCycle.zpowersEquivSupport_apply
code: @[simp]
theorem IsCycle.zpowersEquivSupport_apply {σ : Perm α} (hσ : IsCycle σ) {n : ℕ} :
    hσ.zpowersEquivSupport ⟨σ ^ n, n, rfl⟩ =
      ⟨(σ ^ n) (Classical.choose hσ),
        pow_apply_mem_support.2 (mem_support.2 (Classical.choose_spec hσ).1)⟩ 
goal: hσ.zpowersEquivSupport ⟨σ ^ n, ⋯⟩ = ⟨(σ ^ n) (Classical.choose hσ), ⋯⟩

full_name: Equiv.Perm.IsCycle.zpowersEquivSupport_symm_apply
code: @[simp]
theorem IsCycle.zpowersEquivSupport_symm_apply {σ : Perm α} (hσ : IsCycle σ) (n : ℕ) :
    hσ.zpowersEquivSupport.symm
        ⟨(σ ^ n) (Classical.choose hσ),
          pow_apply_mem_support.2 (mem_support.2 (Classical.choose_spec hσ).1)⟩ =
      ⟨σ ^ n, n, rfl⟩ 
goal: hσ.zpowersEquivSupport.symm ⟨(σ ^ n) (Classical.choose hσ), ⋯⟩ = ⟨σ ^ n, ⋯⟩

full_name: Equiv.Perm.IsCycle.orderOf
code: protected theorem IsCycle.orderOf (hf : IsCycle f) : orderOf f = f.support.card 
goal: orderOf f = f.support.card

full_name: Equiv.Perm.isCycle_swap_mul_aux₁
code: theorem isCycle_swap_mul_aux₁ {α : Type*} [DecidableEq α] :
    ∀ (n : ℕ) {b x : α} {f : Perm α} (_ : (swap x (f x) * f) b ≠ b) (_ : (f ^ n) (f x) = b),
      ∃ i : ℤ, ((swap x (f x) * f) ^ i) (f x) = b 
goal: (Equiv.swap x (f x) * f) b ≠ b → (f ^ n) (f x) = b → ∃ i, ((Equiv.swap x (f x) * f) ^ i) (f x) = b

full_name: Equiv.Perm.isCycle_swap_mul_aux₂
code: theorem isCycle_swap_mul_aux₂ {α : Type*} [DecidableEq α] :
    ∀ (n : ℤ) {b x : α} {f : Perm α} (_ : (swap x (f x) * f) b ≠ b) (_ : (f ^ n) (f x) = b),
      ∃ i : ℤ, ((swap x (f x) * f) ^ i) (f x) = b 
goal: (Equiv.swap x (f x) * f) b ≠ b → (f ^ n) (f x) = b → ∃ i, ((Equiv.swap x (f x) * f) ^ i) (f x) = b

full_name: Equiv.Perm.IsCycle.eq_swap_of_apply_apply_eq_self
code: theorem IsCycle.eq_swap_of_apply_apply_eq_self {α : Type*} [DecidableEq α] {f : Perm α}
    (hf : IsCycle f) {x : α} (hfx : f x ≠ x) (hffx : f (f x) = x) : f = swap x (f x) 
goal: f = Equiv.swap x (f x)

full_name: Equiv.Perm.IsCycle.swap_mul
code: theorem IsCycle.swap_mul {α : Type*} [DecidableEq α] {f : Perm α} (hf : IsCycle f) {x : α}
    (hx : f x ≠ x) (hffx : f (f x) ≠ x) : IsCycle (swap x (f x) * f) 
goal: (Equiv.swap x (f x) * f).IsCycle

full_name: Equiv.Perm.IsCycle.sign
code: theorem IsCycle.sign {f : Perm α} (hf : IsCycle f) : sign f = -(-1) ^ f.support.card 
goal: Equiv.Perm.sign f = -(-1) ^ f.support.card

full_name: Equiv.Perm.IsCycle.of_pow
code: theorem IsCycle.of_pow {n : ℕ} (h1 : IsCycle (f ^ n)) (h2 : f.support ⊆ (f ^ n).support) :
    IsCycle f 
goal: f.IsCycle

full_name: Equiv.Perm.IsCycle.of_zpow
code: theorem IsCycle.of_zpow {n : ℤ} (h1 : IsCycle (f ^ n)) (h2 : f.support ⊆ (f ^ n).support) :
    IsCycle f 
goal: f.IsCycle

full_name: Equiv.Perm.nodup_of_pairwise_disjoint_cycles
code: theorem nodup_of_pairwise_disjoint_cycles {l : List (Perm β)} (h1 : ∀ f ∈ l, IsCycle f)
    (h2 : l.Pairwise Disjoint) : l.Nodup 
goal: l.Nodup

full_name: Equiv.Perm.IsCycle.support_congr
code: /-- Unlike `support_congr`, which assumes that `∀ (x ∈ g.support), f x = g x)`, here
we have the weaker assumption that `∀ (x ∈ f.support), f x = g x`. -/
theorem IsCycle.support_congr (hf : IsCycle f) (hg : IsCycle g) (h : f.support ⊆ g.support)
    (h' : ∀ x ∈ f.support, f x = g x) : f = g 
goal: f = g

full_name: Equiv.Perm.IsCycle.eq_on_support_inter_nonempty_congr
code: /-- If two cyclic permutations agree on all terms in their intersection,
and that intersection is not empty, then the two cyclic permutations must be equal. -/
theorem IsCycle.eq_on_support_inter_nonempty_congr (hf : IsCycle f) (hg : IsCycle g)
    (h : ∀ x ∈ f.support ∩ g.support, f x = g x)
    (hx : f x = g x) (hx' : x ∈ f.support) : f = g 
goal: f = g

full_name: Equiv.Perm.IsCycle.support_pow_eq_iff
code: theorem IsCycle.support_pow_eq_iff (hf : IsCycle f) {n : ℕ} :
    support (f ^ n) = support f ↔ ¬orderOf f ∣ n 
goal: (f ^ n).support = f.support ↔ ¬orderOf f ∣ n

full_name: Equiv.Perm.IsCycle.support_pow_of_pos_of_lt_orderOf
code: theorem IsCycle.support_pow_of_pos_of_lt_orderOf (hf : IsCycle f) {n : ℕ} (npos : 0 < n)
    (hn : n < orderOf f) : (f ^ n).support = f.support 
goal: (f ^ n).support = f.support

full_name: Equiv.Perm.IsCycle.pow_iff
code: theorem IsCycle.pow_iff [Finite β] {f : Perm β} (hf : IsCycle f) {n : ℕ} :
    IsCycle (f ^ n) ↔ n.Coprime (orderOf f) 
goal: (f ^ n).IsCycle ↔ n.Coprime (orderOf f)

full_name: Equiv.Perm.IsCycle.pow_eq_one_iff
code: theorem IsCycle.pow_eq_one_iff [Finite β] {f : Perm β} (hf : IsCycle f) {n : ℕ} :
    f ^ n = 1 ↔ ∃ x, f x ≠ x ∧ (f ^ n) x = x 
goal: f ^ n = 1 ↔ ∃ x, f x ≠ x ∧ (f ^ n) x = x

full_name: Equiv.Perm.IsCycle.pow_eq_one_iff'
code: theorem IsCycle.pow_eq_one_iff' [Finite β] {f : Perm β} (hf : IsCycle f) {n : ℕ} {x : β}
    (hx : f x ≠ x) : f ^ n = 1 ↔ (f ^ n) x = x 
goal: f ^ n = 1 ↔ (f ^ n) x = x

full_name: Equiv.Perm.IsCycle.pow_eq_one_iff''
code: theorem IsCycle.pow_eq_one_iff'' [Finite β] {f : Perm β} (hf : IsCycle f) {n : ℕ} :
    f ^ n = 1 ↔ ∀ x, f x ≠ x → (f ^ n) x = x 
goal: f ^ n = 1 ↔ ∀ (x : β), f x ≠ x → (f ^ n) x = x

full_name: Equiv.Perm.IsCycle.pow_eq_pow_iff
code: theorem IsCycle.pow_eq_pow_iff [Finite β] {f : Perm β} (hf : IsCycle f) {a b : ℕ} :
    f ^ a = f ^ b ↔ ∃ x, f x ≠ x ∧ (f ^ a) x = (f ^ b) x 
goal: f ^ a = f ^ b ↔ ∃ x, f x ≠ x ∧ (f ^ a) x = (f ^ b) x

full_name: Equiv.Perm.IsCycle.isCycle_pow_pos_of_lt_prime_order
code: theorem IsCycle.isCycle_pow_pos_of_lt_prime_order [Finite β] {f : Perm β} (hf : IsCycle f)
    (hf' : (orderOf f).Prime) (n : ℕ) (hn : 0 < n) (hn' : n < orderOf f) : IsCycle (f ^ n) 
goal: (f ^ n).IsCycle

full_name: Int.addLeft_one_isCycle
code: theorem _root_.Int.addLeft_one_isCycle : (Equiv.addLeft 1 : Perm ℤ).IsCycle 
goal: (Equiv.addLeft 1).IsCycle

full_name: Int.addRight_one_isCycle
code: theorem _root_.Int.addRight_one_isCycle : (Equiv.addRight 1 : Perm ℤ).IsCycle 
goal: (Equiv.addRight 1).IsCycle

full_name: Equiv.Perm.IsCycle.isConj
code: theorem IsCycle.isConj (hσ : IsCycle σ) (hτ : IsCycle τ) (h : σ.support.card = τ.support.card) :
    IsConj σ τ 
goal: IsConj σ τ

full_name: Equiv.Perm.IsCycle.isConj_iff
code: theorem IsCycle.isConj_iff (hσ : IsCycle σ) (hτ : IsCycle τ) :
    IsConj σ τ ↔ σ.support.card = τ.support.card 
goal: IsConj σ τ ↔ σ.support.card = τ.support.card

full_name: Equiv.Perm.IsCycleOn
code: /-- A permutation is a cycle on `s` when any two points of `s` are related by repeated application
of the permutation. Note that this means the identity is a cycle of subsingleton sets. -/
def IsCycleOn (f : Perm α) (s : Set α) : Prop 
goal: Prop

full_name: Equiv.Perm.isCycleOn_empty
code: @[simp]
theorem isCycleOn_empty : f.IsCycleOn ∅ 
goal: f.IsCycleOn ∅

full_name: Equiv.Perm.isCycleOn_one
code: @[simp]
theorem isCycleOn_one : (1 : Perm α).IsCycleOn s ↔ s.Subsingleton 
goal: Equiv.Perm.IsCycleOn 1 s ↔ s.Subsingleton

full_name: Equiv.Perm.isCycleOn_singleton
code: @[simp]
theorem isCycleOn_singleton : f.IsCycleOn {a} ↔ f a = a 
goal: f.IsCycleOn {a} ↔ f a = a

full_name: Equiv.Perm.isCycleOn_of_subsingleton
code: theorem isCycleOn_of_subsingleton [Subsingleton α] (f : Perm α) (s : Set α) : f.IsCycleOn s 
goal: f.IsCycleOn s

full_name: Equiv.Perm.isCycleOn_inv
code: @[simp]
theorem isCycleOn_inv : f⁻¹.IsCycleOn s ↔ f.IsCycleOn s 
goal: f⁻¹.IsCycleOn s ↔ f.IsCycleOn s

full_name: Equiv.Perm.IsCycleOn.conj
code: theorem IsCycleOn.conj (h : f.IsCycleOn s) : (g * f * g⁻¹).IsCycleOn ((g : Perm α) '' s) 
goal: (g * f * g⁻¹).IsCycleOn (⇑g '' s)

full_name: Equiv.Perm.isCycleOn_swap
code: theorem isCycleOn_swap [DecidableEq α] (hab : a ≠ b) : (swap a b).IsCycleOn {a, b} 
goal: (Equiv.swap a b).IsCycleOn {a, b}

full_name: Equiv.Perm.IsCycleOn.apply_ne
code: protected theorem IsCycleOn.apply_ne (hf : f.IsCycleOn s) (hs : s.Nontrivial) (ha : a ∈ s) :
    f a ≠ a 
goal: f a ≠ a

full_name: Equiv.Perm.IsCycle.isCycleOn
code: protected theorem IsCycle.isCycleOn (hf : f.IsCycle) : f.IsCycleOn { x | f x ≠ x } 
goal: f.IsCycleOn {x | f x ≠ x}

full_name: Equiv.Perm.isCycle_iff_exists_isCycleOn
code: /-- This lemma demonstrates the relation between `Equiv.Perm.IsCycle` and `Equiv.Perm.IsCycleOn`
in non-degenerate cases. -/
theorem isCycle_iff_exists_isCycleOn :
    f.IsCycle ↔ ∃ s : Set α, s.Nontrivial ∧ f.IsCycleOn s ∧ ∀ ⦃x⦄, ¬IsFixedPt f x → x ∈ s 
goal: f.IsCycle ↔ ∃ s, s.Nontrivial ∧ f.IsCycleOn s ∧ ∀ ⦃x : α⦄, ¬Function.IsFixedPt (⇑f) x → x ∈ s

full_name: Equiv.Perm.IsCycleOn.apply_mem_iff
code: theorem IsCycleOn.apply_mem_iff (hf : f.IsCycleOn s) : f x ∈ s ↔ x ∈ s 
goal: f x ∈ s ↔ x ∈ s

full_name: Equiv.Perm.IsCycleOn.isCycle_subtypePerm
code: /-- Note that the identity satisfies `IsCycleOn` for any subsingleton set, but not `IsCycle`. -/
theorem IsCycleOn.isCycle_subtypePerm (hf : f.IsCycleOn s) (hs : s.Nontrivial) :
    (f.subtypePerm fun _ => hf.apply_mem_iff.symm : Perm s).IsCycle 
goal: (f.subtypePerm ⋯).IsCycle

full_name: Equiv.Perm.IsCycleOn.subtypePerm
code: /-- Note that the identity is a cycle on any subsingleton set, but not a cycle. -/
protected theorem IsCycleOn.subtypePerm (hf : f.IsCycleOn s) :
    (f.subtypePerm fun _ => hf.apply_mem_iff.symm : Perm s).IsCycleOn _root_.Set.univ 
goal: (f.subtypePerm ⋯).IsCycleOn Set.univ

full_name: Equiv.Perm.IsCycleOn.pow_apply_eq
code: theorem IsCycleOn.pow_apply_eq {s : Finset α} (hf : f.IsCycleOn s) (ha : a ∈ s) {n : ℕ} :
    (f ^ n) a = a ↔ s.card ∣ n 
goal: (f ^ n) a = a ↔ s.card ∣ n

full_name: Equiv.Perm.IsCycleOn.zpow_apply_eq
code: theorem IsCycleOn.zpow_apply_eq {s : Finset α} (hf : f.IsCycleOn s) (ha : a ∈ s) :
    ∀ {n : ℤ}, (f ^ n) a = a ↔ (s.card : ℤ) ∣ n
  
goal: (f ^ n) a = a ↔ ↑s.card ∣ n

full_name: Equiv.Perm.IsCycleOn.pow_apply_eq_pow_apply
code: theorem IsCycleOn.pow_apply_eq_pow_apply {s : Finset α} (hf : f.IsCycleOn s) (ha : a ∈ s)
    {m n : ℕ} : (f ^ m) a = (f ^ n) a ↔ m ≡ n [MOD s.card] 
goal: (f ^ m) a = (f ^ n) a ↔ m ≡ n [MOD s.card]

full_name: Equiv.Perm.IsCycleOn.zpow_apply_eq_zpow_apply
code: theorem IsCycleOn.zpow_apply_eq_zpow_apply {s : Finset α} (hf : f.IsCycleOn s) (ha : a ∈ s)
    {m n : ℤ} : (f ^ m) a = (f ^ n) a ↔ m ≡ n [ZMOD s.card] 
goal: (f ^ m) a = (f ^ n) a ↔ m ≡ n [ZMOD ↑s.card]

full_name: Equiv.Perm.IsCycleOn.pow_card_apply
code: theorem IsCycleOn.pow_card_apply {s : Finset α} (hf : f.IsCycleOn s) (ha : a ∈ s) :
    (f ^ s.card) a = a 
goal: (f ^ s.card) a = a

full_name: Equiv.Perm.IsCycleOn.exists_pow_eq
code: theorem IsCycleOn.exists_pow_eq {s : Finset α} (hf : f.IsCycleOn s) (ha : a ∈ s) (hb : b ∈ s) :
    ∃ n < s.card, (f ^ n) a = b 
goal: ∃ n < s.card, (f ^ n) a = b

full_name: Equiv.Perm.IsCycleOn.exists_pow_eq'
code: theorem IsCycleOn.exists_pow_eq' (hs : s.Finite) (hf : f.IsCycleOn s) (ha : a ∈ s) (hb : b ∈ s) :
    ∃ n : ℕ, (f ^ n) a = b 
goal: ∃ n, (f ^ n) a = b

full_name: Equiv.Perm.IsCycleOn.range_pow
code: theorem IsCycleOn.range_pow (hs : s.Finite) (h : f.IsCycleOn s) (ha : a ∈ s) :
    Set.range (fun n => (f ^ n) a : ℕ → α) = s 
goal: (Set.range fun n => (f ^ n) a) = s

full_name: Equiv.Perm.IsCycleOn.range_zpow
code: theorem IsCycleOn.range_zpow (h : f.IsCycleOn s) (ha : a ∈ s) :
    Set.range (fun n => (f ^ n) a : ℤ → α) = s 
goal: (Set.range fun n => (f ^ n) a) = s

full_name: Equiv.Perm.IsCycleOn.of_pow
code: theorem IsCycleOn.of_pow {n : ℕ} (hf : (f ^ n).IsCycleOn s) (h : Set.BijOn f s s) : f.IsCycleOn s 
goal: f.IsCycleOn s

full_name: Equiv.Perm.IsCycleOn.of_zpow
code: theorem IsCycleOn.of_zpow {n : ℤ} (hf : (f ^ n).IsCycleOn s) (h : Set.BijOn f s s) :
    f.IsCycleOn s 
goal: f.IsCycleOn s

full_name: Equiv.Perm.IsCycleOn.extendDomain
code: theorem IsCycleOn.extendDomain {p : β → Prop} [DecidablePred p] (f : α ≃ Subtype p)
    (h : g.IsCycleOn s) : (g.extendDomain f).IsCycleOn ((↑) ∘ f '' s) 
goal: (g.extendDomain f).IsCycleOn (Subtype.val ∘ ⇑f '' s)

full_name: Equiv.Perm.IsCycleOn.countable
code: protected theorem IsCycleOn.countable (hs : f.IsCycleOn s) : s.Countable 
goal: s.Countable

full_name: List.Nodup.isCycleOn_formPerm
code: theorem Nodup.isCycleOn_formPerm (h : l.Nodup) :
    l.formPerm.IsCycleOn { a | a ∈ l } 
goal: l.formPerm.IsCycleOn {a | a ∈ l}

full_name: Finset.exists_cycleOn
code: theorem exists_cycleOn (s : Finset α) :
    ∃ f : Perm α, f.IsCycleOn s ∧ f.support ⊆ s 
goal: ∃ f, f.IsCycleOn ↑s ∧ f.support ⊆ s

full_name: Set.Countable.exists_cycleOn
code: theorem Countable.exists_cycleOn (hs : s.Countable) :
    ∃ f : Perm α, f.IsCycleOn s ∧ { x | f x ≠ x } ⊆ s 
goal: ∃ f, f.IsCycleOn s ∧ {x | f x ≠ x} ⊆ s

full_name: Set.prod_self_eq_iUnion_perm
code: theorem prod_self_eq_iUnion_perm (hf : f.IsCycleOn s) :
    s ×ˢ s = ⋃ n : ℤ, (fun a => (a, (f ^ n) a)) '' s 
goal: s ×ˢ s = ⋃ n, (fun a => (a, (f ^ n) a)) '' s

full_name: Finset.product_self_eq_disjiUnion_perm_aux
code: theorem product_self_eq_disjiUnion_perm_aux (hf : f.IsCycleOn s) :
    (range s.card : Set ℕ).PairwiseDisjoint fun k =>
      s.map ⟨fun i => (i, (f ^ k) i), fun i j => congr_arg Prod.fst⟩ 
goal: (↑(Finset.range s.card)).PairwiseDisjoint fun k => Finset.map { toFun := fun i => (i, (f ^ k) i), inj' := ⋯ } s

full_name: Finset.product_self_eq_disjiUnion_perm
code: /-- We can partition the square `s ×ˢ s` into shifted diagonals as such:
```
01234
40123
34012
23401
12340
```

The diagonals are given by the cycle `f`.
-/
theorem product_self_eq_disjiUnion_perm (hf : f.IsCycleOn s) :
    s ×ˢ s =
      (range s.card).disjiUnion
        (fun k => s.map ⟨fun i => (i, (f ^ k) i), fun i j => congr_arg Prod.fst⟩)
        (product_self_eq_disjiUnion_perm_aux hf) 
goal: s ×ˢ s = (Finset.range s.card).disjiUnion (fun k => Finset.map { toFun := fun i => (i, (f ^ k) i), inj' := ⋯ } s) ⋯

full_name: Finset.sum_smul_sum_eq_sum_perm
code: theorem sum_smul_sum_eq_sum_perm (hσ : σ.IsCycleOn s) (f : ι → α) (g : ι → β) :
    (∑ i ∈ s, f i) • ∑ i ∈ s, g i = ∑ k ∈ range s.card, ∑ i ∈ s, f i • g ((σ ^ k) i) 
goal: (∑ i ∈ s, f i) • ∑ i ∈ s, g i = ∑ k ∈ Finset.range s.card, ∑ i ∈ s, f i • g ((σ ^ k) i)

full_name: Finset.sum_mul_sum_eq_sum_perm
code: theorem sum_mul_sum_eq_sum_perm (hσ : σ.IsCycleOn s) (f g : ι → α) :
    ((∑ i ∈ s, f i) * ∑ i ∈ s, g i) = ∑ k ∈ range s.card, ∑ i ∈ s, f i * g ((σ ^ k) i) 
goal: (∑ i ∈ s, f i) * ∑ i ∈ s, g i = ∑ k ∈ Finset.range s.card, ∑ i ∈ s, f i * g ((σ ^ k) i)