Module: Mathlib.GroupTheory.HNNExtension

Goal state before:
pp: case neg.cons.refl
G : Type u_1
inst✝ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
d : TransversalPair G A B
u : ℤˣ
g : G
w : NormalWord d
h1 : w.head ∈ d.set { val := -↑u, inv := -↑u⁻¹, val_inv := ⋯, inv_val := ⋯ }
h2 :
  ∀ u' ∈ Option.map Prod.fst w.toList.head?,
    w.head ∈ toSubgroup A B { val := -↑u, inv := -↑u⁻¹, val_inv := ⋯, inv_val := ⋯ } →
      { val := -↑u, inv := -↑u⁻¹, val_inv := ⋯, inv_val := ⋯ } = u'
hcan✝ :
  ¬Cancels (-u)
      (if h : Cancels u (cons g { val := -↑u, inv := -↑u⁻¹, val_inv := ⋯, inv_val := ⋯ } w h1 h2) then
        unitsSMulWithCancel φ u (cons g { val := -↑u, inv := -↑u⁻¹, val_inv := ⋯, inv_val := ⋯ } w h1 h2) h
      else
        let g' := unitsSMulGroup φ d u (cons g { val := -↑u, inv := -↑u⁻¹, val_inv := ⋯, inv_val := ⋯ } w h1 h2).head;
        cons (↑g'.1) u
          ((↑g'.2 * (cons g { val := -↑u, inv := -↑u⁻¹, val_inv := ⋯, inv_val := ⋯ } w h1 h2).head⁻¹) •
            cons g { val := -↑u, inv := -↑u⁻¹, val_inv := ⋯, inv_val := ⋯ } w h1 h2)
          ⋯ ⋯)
hcan2 : Cancels u (cons g { val := -↑u, inv := -↑u⁻¹, val_inv := ⋯, inv_val := ⋯ } w h1 h2)
hcan :
  ¬Cancels (-u)
      (unitsSMulWithCancel φ u (cons g { val := -↑u, inv := -↑u⁻¹, val_inv := ⋯, inv_val := ⋯ } w h1 h2) hcan2)
⊢ cons (↑((toSubgroupEquiv φ (-u)) (⋯.equiv (↑((toSubgroupEquiv φ u) ⟨g, ⋯⟩) * w.head)).1)) (-u)
      ((↑(⋯.equiv (↑((toSubgroupEquiv φ u) ⟨g, ⋯⟩) * w.head)).2 * (w.head⁻¹ * (↑((toSubgroupEquiv φ u) ⟨g, ⋯⟩))⁻¹)) •
        ↑((toSubgroupEquiv φ u) ⟨g, ⋯⟩) • w)
      ⋯ ⋯ =
    cons g { val := -↑u, inv := -↑u⁻¹, val_inv := ⋯, inv_val := ⋯ } w h1 h2

Tactic:
have : ((d.compl (-u)).equiv w.head).1 = 1 :=
        (d.compl (-u)).equiv_fst_eq_one_of_mem_of_one_mem _ h1

Goal state after:
case neg.cons.refl
G : Type u_1
inst✝ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
d : TransversalPair G A B
u : ℤˣ
g : G
w : NormalWord d
h1 : w.head ∈ d.set { val := -↑u, inv := -↑u⁻¹, val_inv := ⋯, inv_val := ⋯ }
h2 :
  ∀ u' ∈ Option.map Prod.fst w.toList.head?,
    w.head ∈ toSubgroup A B { val := -↑u, inv := -↑u⁻¹, val_inv := ⋯, inv_val := ⋯ } →
      { val := -↑u, inv := -↑u⁻¹, val_inv := ⋯, inv_val := ⋯ } = u'
hcan✝ :
  ¬Cancels (-u)
      (if h : Cancels u (cons g { val := -↑u, inv := -↑u⁻¹, val_inv := ⋯, inv_val := ⋯ } w h1 h2) then
        unitsSMulWithCancel φ u (cons g { val := -↑u, inv := -↑u⁻¹, val_inv := ⋯, inv_val := ⋯ } w h1 h2) h
      else
        let g' := unitsSMulGroup φ d u (cons g { val := -↑u, inv := -↑u⁻¹, val_inv := ⋯, inv_val := ⋯ } w h1 h2).head;
        cons (↑g'.1) u
          ((↑g'.2 * (cons g { val := -↑u, inv := -↑u⁻¹, val_inv := ⋯, inv_val := ⋯ } w h1 h2).head⁻¹) •
            cons g { val := -↑u, inv := -↑u⁻¹, val_inv := ⋯, inv_val := ⋯ } w h1 h2)
          ⋯ ⋯)
hcan2 : Cancels u (cons g { val := -↑u, inv := -↑u⁻¹, val_inv := ⋯, inv_val := ⋯ } w h1 h2)
hcan :
  ¬Cancels (-u)
      (unitsSMulWithCancel φ u (cons g { val := -↑u, inv := -↑u⁻¹, val_inv := ⋯, inv_val := ⋯ } w h1 h2) hcan2)
this : (⋯.equiv w.head).1 = 1
⊢ cons (↑((toSubgroupEquiv φ (-u)) (⋯.equiv (↑((toSubgroupEquiv φ u) ⟨g, ⋯⟩) * w.head)).1)) (-u)
      ((↑(⋯.equiv (↑((toSubgroupEquiv φ u) ⟨g, ⋯⟩) * w.head)).2 * (w.head⁻¹ * (↑((toSubgroupEquiv φ u) ⟨g, ⋯⟩))⁻¹)) •
        ↑((toSubgroupEquiv φ u) ⟨g, ⋯⟩) • w)
      ⋯ ⋯ =
    cons g { val := -↑u, inv := -↑u⁻¹, val_inv := ⋯, inv_val := ⋯ } w h1 h2