Theorem: HNNExtension.NormalWord.unitsSMul_neg
File: Mathlib/GroupTheory/HNNExtension.lean

tactic: rw [unitsSMul]
state_before: G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
u : ℤˣ
w : NormalWord d
⊢ unitsSMul φ (-u) (unitsSMul φ u w) = w
state_after: G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
u : ℤˣ
w : NormalWord d
⊢ (if h : Cancels (-u) (unitsSMul φ u w) then unitsSMulWithCancel φ (-u) (unitsSMul φ u w) h
    else
      let g' := unitsSMulGroup φ d (-u) (unitsSMul φ u w).head;
      cons (↑g'.1) (-u) ((↑g'.2 * (unitsSMul φ u w).head⁻¹) • unitsSMul φ u w) ⋯ ⋯) =
    w

tactic: split_ifs with hcan
state_before: G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
u : ℤˣ
w : NormalWord d
⊢ (if h : Cancels (-u) (unitsSMul φ u w) then unitsSMulWithCancel φ (-u) (unitsSMul φ u w) h
    else
      let g' := unitsSMulGroup φ d (-u) (unitsSMul φ u w).head;
      cons (↑g'.1) (-u) ((↑g'.2 * (unitsSMul φ u w).head⁻¹) • unitsSMul φ u w) ⋯ ⋯) =
    w
state_after: case pos
G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
u : ℤˣ
w : NormalWord d
hcan : Cancels (-u) (unitsSMul φ u w)
⊢ unitsSMulWithCancel φ (-u) (unitsSMul φ u w) hcan = w

case neg
G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
u : ℤˣ
w : NormalWord d
hcan : ¬Cancels (-u) (unitsSMul φ u w)
⊢ (let g' := unitsSMulGroup φ d (-u) (unitsSMul φ u w).head;
    cons (↑g'.1) (-u) ((↑g'.2 * (unitsSMul φ u w).head⁻¹) • unitsSMul φ u w) ⋯ ⋯) =
    w

tactic: have hncan : ¬ Cancels u w := (unitsSMul_cancels_iff _ _ _).1 hcan
state_before: case pos
G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
u : ℤˣ
w : NormalWord d
hcan : Cancels (-u) (unitsSMul φ u w)
⊢ unitsSMulWithCancel φ (-u) (unitsSMul φ u w) hcan = w
state_after: case pos
G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
u : ℤˣ
w : NormalWord d
hcan : Cancels (-u) (unitsSMul φ u w)
hncan : ¬Cancels u w
⊢ unitsSMulWithCancel φ (-u) (unitsSMul φ u w) hcan = w

tactic: unfold unitsSMul
state_before: case pos
G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
u : ℤˣ
w : NormalWord d
hcan : Cancels (-u) (unitsSMul φ u w)
hncan : ¬Cancels u w
⊢ unitsSMulWithCancel φ (-u) (unitsSMul φ u w) hcan = w
state_after: case pos
G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
u : ℤˣ
w : NormalWord d
hcan : Cancels (-u) (unitsSMul φ u w)
hncan : ¬Cancels u w
⊢ unitsSMulWithCancel φ (-u)
      (if h : Cancels u w then unitsSMulWithCancel φ u w h
      else
        let g' := unitsSMulGroup φ d u w.head;
        cons (↑g'.1) u ((↑g'.2 * w.head⁻¹) • w) ⋯ ⋯)
      hcan =
    w

tactic: simp only [dif_neg hncan]
state_before: case pos
G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
u : ℤˣ
w : NormalWord d
hcan : Cancels (-u) (unitsSMul φ u w)
hncan : ¬Cancels u w
⊢ unitsSMulWithCancel φ (-u)
      (if h : Cancels u w then unitsSMulWithCancel φ u w h
      else
        let g' := unitsSMulGroup φ d u w.head;
        cons (↑g'.1) u ((↑g'.2 * w.head⁻¹) • w) ⋯ ⋯)
      hcan =
    w
state_after: case pos
G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
u : ℤˣ
w : NormalWord d
hcan : Cancels (-u) (unitsSMul φ u w)
hncan : ¬Cancels u w
⊢ unitsSMulWithCancel φ (-u)
      (cons (↑(unitsSMulGroup φ d u w.head).1) u ((↑(unitsSMulGroup φ d u w.head).2 * w.head⁻¹) • w) ⋯ ⋯) ⋯ =
    w

tactic: simp [unitsSMulWithCancel, unitsSMulGroup, (d.compl u).equiv_snd_eq_inv_mul]
state_before: case pos
G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
u : ℤˣ
w : NormalWord d
hcan : Cancels (-u) (unitsSMul φ u w)
hncan : ¬Cancels u w
⊢ unitsSMulWithCancel φ (-u)
      (cons (↑(unitsSMulGroup φ d u w.head).1) u ((↑(unitsSMulGroup φ d u w.head).2 * w.head⁻¹) • w) ⋯ ⋯) ⋯ =
    w
state_after: case pos
G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
u : ℤˣ
w : NormalWord d
hcan : Cancels (-u) (unitsSMul φ u w)
hncan : ¬Cancels u w
⊢ ↑(⋯.equiv w.head).1 • (↑(⋯.equiv w.head).2 * w.head⁻¹) • w = w

tactic: erw [(d.compl u).equiv_snd_eq_inv_mul]
state_before: case pos
G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
u : ℤˣ
w : NormalWord d
hcan : Cancels (-u) (unitsSMul φ u w)
hncan : ¬Cancels u w
⊢ ↑(⋯.equiv w.head).1 • (↑(⋯.equiv w.head).2 * w.head⁻¹) • w = w
state_after: case pos
G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
u : ℤˣ
w : NormalWord d
hcan : Cancels (-u) (unitsSMul φ u w)
hncan : ¬Cancels u w
⊢ ↑(⋯.equiv w.head).1 • ((↑(⋯.equiv w.head).1)⁻¹ * w.head * w.head⁻¹) • w = w

tactic: simp
state_before: case pos
G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
u : ℤˣ
w : NormalWord d
hcan : Cancels (-u) (unitsSMul φ u w)
hncan : ¬Cancels u w
⊢ ↑(⋯.equiv w.head).1 • ((↑(⋯.equiv w.head).1)⁻¹ * w.head * w.head⁻¹) • w = w
state_after: no goals

tactic: have hcan2 : Cancels u w := not_not.1 (mt (unitsSMul_cancels_iff _ _ _).2 hcan)
state_before: case neg
G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
u : ℤˣ
w : NormalWord d
hcan : ¬Cancels (-u) (unitsSMul φ u w)
⊢ (let g' := unitsSMulGroup φ d (-u) (unitsSMul φ u w).head;
    cons (↑g'.1) (-u) ((↑g'.2 * (unitsSMul φ u w).head⁻¹) • unitsSMul φ u w) ⋯ ⋯) =
    w
state_after: case neg
G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
u : ℤˣ
w : NormalWord d
hcan : ¬Cancels (-u) (unitsSMul φ u w)
hcan2 : Cancels u w
⊢ (let g' := unitsSMulGroup φ d (-u) (unitsSMul φ u w).head;
    cons (↑g'.1) (-u) ((↑g'.2 * (unitsSMul φ u w).head⁻¹) • unitsSMul φ u w) ⋯ ⋯) =
    w

tactic: unfold unitsSMul at hcan ⊢
state_before: case neg
G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
u : ℤˣ
w : NormalWord d
hcan : ¬Cancels (-u) (unitsSMul φ u w)
hcan2 : Cancels u w
⊢ (let g' := unitsSMulGroup φ d (-u) (unitsSMul φ u w).head;
    cons (↑g'.1) (-u) ((↑g'.2 * (unitsSMul φ u w).head⁻¹) • unitsSMul φ u w) ⋯ ⋯) =
    w
state_after: case neg
G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
u : ℤˣ
w : NormalWord d
hcan :
  ¬Cancels (-u)
      (if h : Cancels u w then unitsSMulWithCancel φ u w h
      else
        let g' := unitsSMulGroup φ d u w.head;
        cons (↑g'.1) u ((↑g'.2 * w.head⁻¹) • w) ⋯ ⋯)
hcan2 : Cancels u w
⊢ (let g' :=
      unitsSMulGroup φ d (-u)
        (if h : Cancels u w then unitsSMulWithCancel φ u w h
          else
            let g' := unitsSMulGroup φ d u w.head;
            cons (↑g'.1) u ((↑g'.2 * w.head⁻¹) • w) ⋯ ⋯).head;
    cons (↑g'.1) (-u)
      ((↑g'.2 *
          (if h : Cancels u w then unitsSMulWithCancel φ u w h
              else
                let g' := unitsSMulGroup φ d u w.head;
                cons (↑g'.1) u ((↑g'.2 * w.head⁻¹) • w) ⋯ ⋯).head⁻¹) •
        if h : Cancels u w then unitsSMulWithCancel φ u w h
        else
          let g' := unitsSMulGroup φ d u w.head;
          cons (↑g'.1) u ((↑g'.2 * w.head⁻¹) • w) ⋯ ⋯)
      ⋯ ⋯) =
    w

tactic: simp only [dif_pos hcan2] at hcan ⊢
state_before: case neg
G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
u : ℤˣ
w : NormalWord d
hcan :
  ¬Cancels (-u)
      (if h : Cancels u w then unitsSMulWithCancel φ u w h
      else
        let g' := unitsSMulGroup φ d u w.head;
        cons (↑g'.1) u ((↑g'.2 * w.head⁻¹) • w) ⋯ ⋯)
hcan2 : Cancels u w
⊢ (let g' :=
      unitsSMulGroup φ d (-u)
        (if h : Cancels u w then unitsSMulWithCancel φ u w h
          else
            let g' := unitsSMulGroup φ d u w.head;
            cons (↑g'.1) u ((↑g'.2 * w.head⁻¹) • w) ⋯ ⋯).head;
    cons (↑g'.1) (-u)
      ((↑g'.2 *
          (if h : Cancels u w then unitsSMulWithCancel φ u w h
              else
                let g' := unitsSMulGroup φ d u w.head;
                cons (↑g'.1) u ((↑g'.2 * w.head⁻¹) • w) ⋯ ⋯).head⁻¹) •
        if h : Cancels u w then unitsSMulWithCancel φ u w h
        else
          let g' := unitsSMulGroup φ d u w.head;
          cons (↑g'.1) u ((↑g'.2 * w.head⁻¹) • w) ⋯ ⋯)
      ⋯ ⋯) =
    w
state_after: case neg
G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
u : ℤˣ
w : NormalWord d
hcan✝ :
  ¬Cancels (-u)
      (if h : Cancels u w then unitsSMulWithCancel φ u w h
      else
        let g' := unitsSMulGroup φ d u w.head;
        cons (↑g'.1) u ((↑g'.2 * w.head⁻¹) • w) ⋯ ⋯)
hcan2 : Cancels u w
hcan : ¬Cancels (-u) (unitsSMulWithCancel φ u w hcan2)
⊢ cons (↑(unitsSMulGroup φ d (-u) (unitsSMulWithCancel φ u w hcan2).head).1) (-u)
      ((↑(unitsSMulGroup φ d (-u) (unitsSMulWithCancel φ u w hcan2).head).2 *
          (unitsSMulWithCancel φ u w hcan2).head⁻¹) •
        unitsSMulWithCancel φ u w hcan2)
      ⋯ ⋯ =
    w

tactic: simp [Cancels] at hcan2
state_before: case neg.ofGroup
G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
u : ℤˣ
g✝ : G
hcan✝ :
  ¬Cancels (-u)
      (if h : Cancels u (ofGroup g✝) then unitsSMulWithCancel φ u (ofGroup g✝) h
      else
        let g' := unitsSMulGroup φ d u (ofGroup g✝).head;
        cons (↑g'.1) u ((↑g'.2 * (ofGroup g✝).head⁻¹) • ofGroup g✝) ⋯ ⋯)
hcan2 : Cancels u (ofGroup g✝)
hcan : ¬Cancels (-u) (unitsSMulWithCancel φ u (ofGroup g✝) hcan2)
⊢ cons (↑(unitsSMulGroup φ d (-u) (unitsSMulWithCancel φ u (ofGroup g✝) hcan2).head).1) (-u)
      ((↑(unitsSMulGroup φ d (-u) (unitsSMulWithCancel φ u (ofGroup g✝) hcan2).head).2 *
          (unitsSMulWithCancel φ u (ofGroup g✝) hcan2).head⁻¹) •
        unitsSMulWithCancel φ u (ofGroup g✝) hcan2)
      ⋯ ⋯ =
    ofGroup g✝
state_after: no goals

tactic: clear ih
state_before: case neg.cons
G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
u : ℤˣ
g : G
u' : ℤˣ
w : NormalWord d
h1 : w.head ∈ d.set u'
h2 : ∀ u'_1 ∈ Option.map Prod.fst w.toList.head?, w.head ∈ toSubgroup A B u' → u' = u'_1
hcan✝ :
  ¬Cancels (-u)
      (if h : Cancels u (cons g u' w h1 h2) then unitsSMulWithCancel φ u (cons g u' w h1 h2) h
      else
        let g' := unitsSMulGroup φ d u (cons g u' w h1 h2).head;
        cons (↑g'.1) u ((↑g'.2 * (cons g u' w h1 h2).head⁻¹) • cons g u' w h1 h2) ⋯ ⋯)
hcan2 : Cancels u (cons g u' w h1 h2)
hcan : ¬Cancels (-u) (unitsSMulWithCancel φ u (cons g u' w h1 h2) hcan2)
ih :
  cons g u' w h1 h2 = w →
    cons (↑(unitsSMulGroup φ d (-u) (unitsSMulWithCancel φ u (cons g u' w h1 h2) hcan2).head).1) (-u)
        ((↑(unitsSMulGroup φ d (-u) (unitsSMulWithCancel φ u (cons g u' w h1 h2) hcan2).head).2 *
            (unitsSMulWithCancel φ u (cons g u' w h1 h2) hcan2).head⁻¹) •
          unitsSMulWithCancel φ u (cons g u' w h1 h2) hcan2)
        ⋯ ⋯ =
      cons g u' w h1 h2
⊢ cons (↑(unitsSMulGroup φ d (-u) (unitsSMulWithCancel φ u (cons g u' w h1 h2) hcan2).head).1) (-u)
      ((↑(unitsSMulGroup φ d (-u) (unitsSMulWithCancel φ u (cons g u' w h1 h2) hcan2).head).2 *
          (unitsSMulWithCancel φ u (cons g u' w h1 h2) hcan2).head⁻¹) •
        unitsSMulWithCancel φ u (cons g u' w h1 h2) hcan2)
      ⋯ ⋯ =
    cons g u' w h1 h2
state_after: case neg.cons
G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
u : ℤˣ
g : G
u' : ℤˣ
w : NormalWord d
h1 : w.head ∈ d.set u'
h2 : ∀ u'_1 ∈ Option.map Prod.fst w.toList.head?, w.head ∈ toSubgroup A B u' → u' = u'_1
hcan✝ :
  ¬Cancels (-u)
      (if h : Cancels u (cons g u' w h1 h2) then unitsSMulWithCancel φ u (cons g u' w h1 h2) h
      else
        let g' := unitsSMulGroup φ d u (cons g u' w h1 h2).head;
        cons (↑g'.1) u ((↑g'.2 * (cons g u' w h1 h2).head⁻¹) • cons g u' w h1 h2) ⋯ ⋯)
hcan2 : Cancels u (cons g u' w h1 h2)
hcan : ¬Cancels (-u) (unitsSMulWithCancel φ u (cons g u' w h1 h2) hcan2)
⊢ cons (↑(unitsSMulGroup φ d (-u) (unitsSMulWithCancel φ u (cons g u' w h1 h2) hcan2).head).1) (-u)
      ((↑(unitsSMulGroup φ d (-u) (unitsSMulWithCancel φ u (cons g u' w h1 h2) hcan2).head).2 *
          (unitsSMulWithCancel φ u (cons g u' w h1 h2) hcan2).head⁻¹) •
        unitsSMulWithCancel φ u (cons g u' w h1 h2) hcan2)
      ⋯ ⋯ =
    cons g u' w h1 h2

tactic: simp only [unitsSMulGroup, SetLike.coe_sort_coe, unitsSMulWithCancel, id_eq, consRecOn_cons,
  group_smul_head, IsComplement.equiv_mul_left, map_mul, Submonoid.coe_mul, coe_toSubmonoid,
  toSubgroupEquiv_neg_apply, mul_inv_rev]
state_before: case neg.cons
G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
u : ℤˣ
g : G
u' : ℤˣ
w : NormalWord d
h1 : w.head ∈ d.set u'
h2 : ∀ u'_1 ∈ Option.map Prod.fst w.toList.head?, w.head ∈ toSubgroup A B u' → u' = u'_1
hcan✝ :
  ¬Cancels (-u)
      (if h : Cancels u (cons g u' w h1 h2) then unitsSMulWithCancel φ u (cons g u' w h1 h2) h
      else
        let g' := unitsSMulGroup φ d u (cons g u' w h1 h2).head;
        cons (↑g'.1) u ((↑g'.2 * (cons g u' w h1 h2).head⁻¹) • cons g u' w h1 h2) ⋯ ⋯)
hcan2 : Cancels u (cons g u' w h1 h2)
hcan : ¬Cancels (-u) (unitsSMulWithCancel φ u (cons g u' w h1 h2) hcan2)
⊢ cons (↑(unitsSMulGroup φ d (-u) (unitsSMulWithCancel φ u (cons g u' w h1 h2) hcan2).head).1) (-u)
      ((↑(unitsSMulGroup φ d (-u) (unitsSMulWithCancel φ u (cons g u' w h1 h2) hcan2).head).2 *
          (unitsSMulWithCancel φ u (cons g u' w h1 h2) hcan2).head⁻¹) •
        unitsSMulWithCancel φ u (cons g u' w h1 h2) hcan2)
      ⋯ ⋯ =
    cons g u' w h1 h2
state_after: case neg.cons
G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
u : ℤˣ
g : G
u' : ℤˣ
w : NormalWord d
h1 : w.head ∈ d.set u'
h2 : ∀ u'_1 ∈ Option.map Prod.fst w.toList.head?, w.head ∈ toSubgroup A B u' → u' = u'_1
hcan✝ :
  ¬Cancels (-u)
      (if h : Cancels u (cons g u' w h1 h2) then unitsSMulWithCancel φ u (cons g u' w h1 h2) h
      else
        let g' := unitsSMulGroup φ d u (cons g u' w h1 h2).head;
        cons (↑g'.1) u ((↑g'.2 * (cons g u' w h1 h2).head⁻¹) • cons g u' w h1 h2) ⋯ ⋯)
hcan2 : Cancels u (cons g u' w h1 h2)
hcan : ¬Cancels (-u) (unitsSMulWithCancel φ u (cons g u' 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 u' w h1 h2

tactic: cases hcan2.2
state_before: case neg.cons
G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
u : ℤˣ
g : G
u' : ℤˣ
w : NormalWord d
h1 : w.head ∈ d.set u'
h2 : ∀ u'_1 ∈ Option.map Prod.fst w.toList.head?, w.head ∈ toSubgroup A B u' → u' = u'_1
hcan✝ :
  ¬Cancels (-u)
      (if h : Cancels u (cons g u' w h1 h2) then unitsSMulWithCancel φ u (cons g u' w h1 h2) h
      else
        let g' := unitsSMulGroup φ d u (cons g u' w h1 h2).head;
        cons (↑g'.1) u ((↑g'.2 * (cons g u' w h1 h2).head⁻¹) • cons g u' w h1 h2) ⋯ ⋯)
hcan2 : Cancels u (cons g u' w h1 h2)
hcan : ¬Cancels (-u) (unitsSMulWithCancel φ u (cons g u' 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 u' w h1 h2
state_after: case neg.cons.refl
G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
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
state_before: case neg.cons.refl
G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
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
state_after: case neg.cons.refl
G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
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

tactic: apply NormalWord.ext
state_before: case neg.cons.refl
G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
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
state_after: case neg.cons.refl.h1
G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
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)
        ⋯ ⋯).head =
    (cons g { val := -↑u, inv := -↑u⁻¹, val_inv := ⋯, inv_val := ⋯ } w h1 h2).head

case neg.cons.refl.h2
G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
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)
        ⋯ ⋯).toList =
    (cons g { val := -↑u, inv := -↑u⁻¹, val_inv := ⋯, inv_val := ⋯ } w h1 h2).toList

tactic: dsimp
state_before: case neg.cons.refl.h1
G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
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)
        ⋯ ⋯).head =
    (cons g { val := -↑u, inv := -↑u⁻¹, val_inv := ⋯, inv_val := ⋯ } w h1 h2).head
state_after: case neg.cons.refl.h1
G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
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
⊢ ↑((toSubgroupEquiv φ (-u)) (⋯.equiv (↑((toSubgroupEquiv φ u) ⟨g, ⋯⟩) * w.head)).1) = g

tactic: conv_lhs => erw [IsComplement.equiv_mul_left]
state_before: case neg.cons.refl.h1
G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
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
⊢ ↑((toSubgroupEquiv φ (-u)) (⋯.equiv (↑((toSubgroupEquiv φ u) ⟨g, ⋯⟩) * w.head)).1) = g
state_after: case neg.cons.refl.h1
G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
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
⊢ ↑((toSubgroupEquiv φ (-u)) ((toSubgroupEquiv φ u) ⟨g, ⋯⟩ * (⋯.equiv w.head).1, (⋯.equiv w.head).2).1) = g

tactic: rw [map_mul, Submonoid.coe_mul, toSubgroupEquiv_neg_apply, this]
state_before: case neg.cons.refl.h1
G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
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
⊢ ↑((toSubgroupEquiv φ (-u)) ((toSubgroupEquiv φ u) ⟨g, ⋯⟩ * (⋯.equiv w.head).1, (⋯.equiv w.head).2).1) = g
state_after: case neg.cons.refl.h1
G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
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
⊢ ↑⟨g, ⋯⟩ * ↑((toSubgroupEquiv φ (-u)) 1) = g

tactic: simp
state_before: case neg.cons.refl.h1
G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
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
⊢ ↑⟨g, ⋯⟩ * ↑((toSubgroupEquiv φ (-u)) 1) = g
state_after: no goals

tactic: dsimp
state_before: case neg.cons.refl.h2
G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
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)
        ⋯ ⋯).toList =
    (cons g { val := -↑u, inv := -↑u⁻¹, val_inv := ⋯, inv_val := ⋯ } w h1 h2).toList
state_after: case neg.cons.refl.h2
G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
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
⊢ (-u,
        ↑(⋯.equiv (↑((toSubgroupEquiv φ u) ⟨g, ⋯⟩) * w.head)).2 * (w.head⁻¹ * (↑((toSubgroupEquiv φ u) ⟨g, ⋯⟩))⁻¹) *
          (↑((toSubgroupEquiv φ u) ⟨g, ⋯⟩) * w.head)) ::
      w.toList =
    ({ val := -↑u, inv := -↑u⁻¹, val_inv := ⋯, inv_val := ⋯ }, w.head) :: w.toList

tactic: conv_lhs => erw [IsComplement.equiv_mul_left]
state_before: case neg.cons.refl.h2
G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
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
⊢ (-u,
        ↑(⋯.equiv (↑((toSubgroupEquiv φ u) ⟨g, ⋯⟩) * w.head)).2 * (w.head⁻¹ * (↑((toSubgroupEquiv φ u) ⟨g, ⋯⟩))⁻¹) *
          (↑((toSubgroupEquiv φ u) ⟨g, ⋯⟩) * w.head)) ::
      w.toList =
    ({ val := -↑u, inv := -↑u⁻¹, val_inv := ⋯, inv_val := ⋯ }, w.head) :: w.toList
state_after: case neg.cons.refl.h2
G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
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
⊢ (-u,
        ↑((toSubgroupEquiv φ u) ⟨g, ⋯⟩ * (⋯.equiv w.head).1, (⋯.equiv w.head).2).2 *
            (w.head⁻¹ * (↑((toSubgroupEquiv φ u) ⟨g, ⋯⟩))⁻¹) *
          (↑((toSubgroupEquiv φ u) ⟨g, ⋯⟩) * w.head)) ::
      w.toList =
    ({ val := -↑u, inv := -↑u⁻¹, val_inv := ⋯, inv_val := ⋯ }, w.head) :: w.toList

tactic: simp [mul_assoc, Units.ext_iff, (d.compl (-u)).equiv_snd_eq_inv_mul, this]
state_before: case neg.cons.refl.h2
G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
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
⊢ (-u,
        ↑((toSubgroupEquiv φ u) ⟨g, ⋯⟩ * (⋯.equiv w.head).1, (⋯.equiv w.head).2).2 *
            (w.head⁻¹ * (↑((toSubgroupEquiv φ u) ⟨g, ⋯⟩))⁻¹) *
          (↑((toSubgroupEquiv φ u) ⟨g, ⋯⟩) * w.head)) ::
      w.toList =
    ({ val := -↑u, inv := -↑u⁻¹, val_inv := ⋯, inv_val := ⋯ }, w.head) :: w.toList
state_after: case neg.cons.refl.h2
G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
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
⊢ ↑(⋯.equiv w.head).2 = w.head

tactic: erw [(d.compl (-u)).equiv_snd_eq_inv_mul, this]
state_before: case neg.cons.refl.h2
G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
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
⊢ ↑(⋯.equiv w.head).2 = w.head
state_after: case neg.cons.refl.h2
G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
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
⊢ (↑1)⁻¹ * w.head = w.head

tactic: simp
state_before: case neg.cons.refl.h2
G : Type u_1
inst✝³ : Group G
A B : Subgroup G
φ : ↥A ≃* ↥B
H : Type u_2
inst✝² : Group H
M : Type u_3
inst✝¹ : Monoid M
d : TransversalPair G A B
inst✝ : DecidableEq G
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
⊢ (↑1)⁻¹ * w.head = w.head
state_after: no goals