Theorem: Grp.SurjectiveOfEpiAuxs.h_apply_fromCoset_nin_range
File: Mathlib/Algebra/Category/Grp/EpiMono.lean

Proof steps:
state_before: A B : Grp
f : A ⟶ B
x : ↑B
hx : x ∈ MonoidHom.range f
b : ↑B
hb : b ∉ MonoidHom.range f
⊢ (h x) (fromCoset ⟨b • ↑(MonoidHom.range f), ⋯⟩) = fromCoset ⟨(x * b) • ↑(MonoidHom.range f), ⋯⟩
state_after: A B : Grp
f : A ⟶ B
x : ↑B
hx : x ∈ MonoidHom.range f
b : ↑B
hb : b ∉ MonoidHom.range f
⊢ (((Equiv.symm τ).trans (g x)).trans τ) (fromCoset ⟨b • ↑(MonoidHom.range f), ⋯⟩) =
    fromCoset ⟨(x * b) • ↑(MonoidHom.range f), ⋯⟩
tactic: change ((τ).symm.trans (g x)).trans τ _ = _
state_before: A B : Grp
f : A ⟶ B
x : ↑B
hx : x ∈ MonoidHom.range f
b : ↑B
hb : b ∉ MonoidHom.range f
⊢ (((Equiv.symm τ).trans (g x)).trans τ) (fromCoset ⟨b • ↑(MonoidHom.range f), ⋯⟩) =
    fromCoset ⟨(x * b) • ↑(MonoidHom.range f), ⋯⟩
state_after: A B : Grp
f : A ⟶ B
x : ↑B
hx : x ∈ MonoidHom.range f
b : ↑B
hb : b ∉ MonoidHom.range f
⊢ (Equiv.swap (fromCoset ⟨↑(MonoidHom.range f), ⋯⟩) ∞)
      ((g x)
        ((Equiv.symm (Equiv.swap (fromCoset ⟨↑(MonoidHom.range f), ⋯⟩) ∞)) (fromCoset ⟨b • ↑(MonoidHom.range f), ⋯⟩))) =
    fromCoset ⟨(x * b) • ↑(MonoidHom.range f), ⋯⟩
tactic: simp only [tau, MonoidHom.coe_mk, Equiv.toFun_as_coe, Equiv.coe_trans, Function.comp_apply]
state_before: A B : Grp
f : A ⟶ B
x : ↑B
hx : x ∈ MonoidHom.range f
b : ↑B
hb : b ∉ MonoidHom.range f
⊢ (Equiv.swap (fromCoset ⟨↑(MonoidHom.range f), ⋯⟩) ∞)
      ((g x)
        ((Equiv.symm (Equiv.swap (fromCoset ⟨↑(MonoidHom.range f), ⋯⟩) ∞)) (fromCoset ⟨b • ↑(MonoidHom.range f), ⋯⟩))) =
    fromCoset ⟨(x * b) • ↑(MonoidHom.range f), ⋯⟩
state_after: A B : Grp
f : A ⟶ B
x : ↑B
hx : x ∈ MonoidHom.range f
b : ↑B
hb : b ∉ MonoidHom.range f
⊢ (Equiv.swap (fromCoset ⟨↑(MonoidHom.range f), ⋯⟩) ∞) ((g x) (fromCoset ⟨b • ↑(MonoidHom.range f), ⋯⟩)) =
    fromCoset ⟨(x * b) • ↑(MonoidHom.range f), ⋯⟩
tactic: rw [Equiv.symm_swap,
    @Equiv.swap_apply_of_ne_of_ne X' _ (fromCoset ⟨f.range, 1, one_leftCoset _⟩) ∞
      (fromCoset ⟨b • ↑f.range, b, rfl⟩) (fromCoset_ne_of_nin_range _ hb) (by simp)]
state_before: A B : Grp
f : A ⟶ B
x : ↑B
hx : x ∈ MonoidHom.range f
b : ↑B
hb : b ∉ MonoidHom.range f
⊢ (Equiv.swap (fromCoset ⟨↑(MonoidHom.range f), ⋯⟩) ∞) ((g x) (fromCoset ⟨b • ↑(MonoidHom.range f), ⋯⟩)) =
    fromCoset ⟨(x * b) • ↑(MonoidHom.range f), ⋯⟩
state_after: A B : Grp
f : A ⟶ B
x : ↑B
hx : x ∈ MonoidHom.range f
b : ↑B
hb : b ∉ MonoidHom.range f
⊢ (Equiv.swap (fromCoset ⟨↑(MonoidHom.range f), ⋯⟩) ∞) (fromCoset ⟨(x * b) • ↑(MonoidHom.range f), ⋯⟩) =
    fromCoset ⟨(x * b) • ↑(MonoidHom.range f), ⋯⟩
tactic: simp only [g_apply_fromCoset, leftCoset_assoc]
state_before: A B : Grp
f : A ⟶ B
x : ↑B
hx : x ∈ MonoidHom.range f
b : ↑B
hb : b ∉ MonoidHom.range f
⊢ (Equiv.swap (fromCoset ⟨↑(MonoidHom.range f), ⋯⟩) ∞) (fromCoset ⟨(x * b) • ↑(MonoidHom.range f), ⋯⟩) =
    fromCoset ⟨(x * b) • ↑(MonoidHom.range f), ⋯⟩
state_after: A B : Grp
f : A ⟶ B
x : ↑B
hx : x ∈ MonoidHom.range f
b : ↑B
hb : b ∉ MonoidHom.range f
r : x * b ∈ MonoidHom.range f
⊢ b ∈ MonoidHom.range f
tactic: refine Equiv.swap_apply_of_ne_of_ne (fromCoset_ne_of_nin_range _ fun r => hb ?_) (by simp)
state_before: A B : Grp
f : A ⟶ B
x : ↑B
hx : x ∈ MonoidHom.range f
b : ↑B
hb : b ∉ MonoidHom.range f
r : x * b ∈ MonoidHom.range f
⊢ b ∈ MonoidHom.range f
state_after: case h.e'_4
A B : Grp
f : A ⟶ B
x : ↑B
hx : x ∈ MonoidHom.range f
b : ↑B
hb : b ∉ MonoidHom.range f
r : x * b ∈ MonoidHom.range f
⊢ b = x⁻¹ * (x * b)
tactic: convert Subgroup.mul_mem _ (Subgroup.inv_mem _ hx) r
state_before: case h.e'_4
A B : Grp
f : A ⟶ B
x : ↑B
hx : x ∈ MonoidHom.range f
b : ↑B
hb : b ∉ MonoidHom.range f
r : x * b ∈ MonoidHom.range f
⊢ b = x⁻¹ * (x * b)
state_after: no goals
tactic: rw [← mul_assoc, mul_left_inv, one_mul]