Theorem: Subgroup.transferTransversal_apply''
File: Mathlib/GroupTheory/Complement.lean

tactic: rw [smul_apply_eq_smul_apply_inv_smul, transferTransversal_apply, transferFunction_apply, ←
  mul_smul, ← zpow_neg_one, ← zpow_add, quotientEquivSigmaZMod_apply, smul_eq_mul, ← mul_assoc,
  ← zpow_one_add, Int.cast_add, Int.cast_neg, Int.cast_one, intCast_cast, cast_id', id, ←
  sub_eq_neg_add, cast_sub_one, add_sub_cancel]
state_before: G : Type u
inst✝ : Group G
H : Subgroup G
g : G
q : orbitRel.Quotient (↥(zpowers g)) (G ⧸ H)
k : ZMod (minimalPeriod (fun x => g • x) (Quotient.out' q))
⊢ ↑((toEquiv ⋯) (g ^ k.cast • Quotient.out' q)) =
    if k = 0 then g ^ minimalPeriod (fun x => g • x) (Quotient.out' q) * Quotient.out' (Quotient.out' q)
    else g ^ k.cast * Quotient.out' (Quotient.out' q)
state_after: G : Type u
inst✝ : Group G
H : Subgroup G
g : G
q : orbitRel.Quotient (↥(zpowers g)) (G ⧸ H)
k : ZMod (minimalPeriod (fun x => g • x) (Quotient.out' q))
⊢ (g ^ if k = 0 then ↑(minimalPeriod (fun x => g • x) (Quotient.out' ⟨q, k - 1⟩.fst)) else k.cast) *
      Quotient.out' (Quotient.out' ⟨q, k - 1⟩.fst) =
    if k = 0 then g ^ minimalPeriod (fun x => g • x) (Quotient.out' q) * Quotient.out' (Quotient.out' q)
    else g ^ k.cast * Quotient.out' (Quotient.out' q)

tactic: by_cases hk : k = 0
state_before: G : Type u
inst✝ : Group G
H : Subgroup G
g : G
q : orbitRel.Quotient (↥(zpowers g)) (G ⧸ H)
k : ZMod (minimalPeriod (fun x => g • x) (Quotient.out' q))
⊢ (g ^ if k = 0 then ↑(minimalPeriod (fun x => g • x) (Quotient.out' ⟨q, k - 1⟩.fst)) else k.cast) *
      Quotient.out' (Quotient.out' ⟨q, k - 1⟩.fst) =
    if k = 0 then g ^ minimalPeriod (fun x => g • x) (Quotient.out' q) * Quotient.out' (Quotient.out' q)
    else g ^ k.cast * Quotient.out' (Quotient.out' q)
state_after: case pos
G : Type u
inst✝ : Group G
H : Subgroup G
g : G
q : orbitRel.Quotient (↥(zpowers g)) (G ⧸ H)
k : ZMod (minimalPeriod (fun x => g • x) (Quotient.out' q))
hk : k = 0
⊢ (g ^ if k = 0 then ↑(minimalPeriod (fun x => g • x) (Quotient.out' ⟨q, k - 1⟩.fst)) else k.cast) *
      Quotient.out' (Quotient.out' ⟨q, k - 1⟩.fst) =
    if k = 0 then g ^ minimalPeriod (fun x => g • x) (Quotient.out' q) * Quotient.out' (Quotient.out' q)
    else g ^ k.cast * Quotient.out' (Quotient.out' q)

case neg
G : Type u
inst✝ : Group G
H : Subgroup G
g : G
q : orbitRel.Quotient (↥(zpowers g)) (G ⧸ H)
k : ZMod (minimalPeriod (fun x => g • x) (Quotient.out' q))
hk : ¬k = 0
⊢ (g ^ if k = 0 then ↑(minimalPeriod (fun x => g • x) (Quotient.out' ⟨q, k - 1⟩.fst)) else k.cast) *
      Quotient.out' (Quotient.out' ⟨q, k - 1⟩.fst) =
    if k = 0 then g ^ minimalPeriod (fun x => g • x) (Quotient.out' q) * Quotient.out' (Quotient.out' q)
    else g ^ k.cast * Quotient.out' (Quotient.out' q)

tactic: rw [if_pos hk, if_pos hk, zpow_natCast]
state_before: case pos
G : Type u
inst✝ : Group G
H : Subgroup G
g : G
q : orbitRel.Quotient (↥(zpowers g)) (G ⧸ H)
k : ZMod (minimalPeriod (fun x => g • x) (Quotient.out' q))
hk : k = 0
⊢ (g ^ if k = 0 then ↑(minimalPeriod (fun x => g • x) (Quotient.out' ⟨q, k - 1⟩.fst)) else k.cast) *
      Quotient.out' (Quotient.out' ⟨q, k - 1⟩.fst) =
    if k = 0 then g ^ minimalPeriod (fun x => g • x) (Quotient.out' q) * Quotient.out' (Quotient.out' q)
    else g ^ k.cast * Quotient.out' (Quotient.out' q)
state_after: no goals

tactic: rw [if_neg hk, if_neg hk]
state_before: case neg
G : Type u
inst✝ : Group G
H : Subgroup G
g : G
q : orbitRel.Quotient (↥(zpowers g)) (G ⧸ H)
k : ZMod (minimalPeriod (fun x => g • x) (Quotient.out' q))
hk : ¬k = 0
⊢ (g ^ if k = 0 then ↑(minimalPeriod (fun x => g • x) (Quotient.out' ⟨q, k - 1⟩.fst)) else k.cast) *
      Quotient.out' (Quotient.out' ⟨q, k - 1⟩.fst) =
    if k = 0 then g ^ minimalPeriod (fun x => g • x) (Quotient.out' q) * Quotient.out' (Quotient.out' q)
    else g ^ k.cast * Quotient.out' (Quotient.out' q)
state_after: no goals