l3lab/ntp-mathlib huggingface dataset:
theorem prod_unitsSMul (u : ℤˣ) (w : NormalWord d) :
    (unitsSMul φ u w).prod φ = (t^(u : ℤ) * w.prod φ : HNNExtension G A B φ) := by
  rw [unitsSMul]
  split_ifs with hcan
  · 

Proof state:
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 w
⊢ ReducedWord.prod φ (unitsSMulWithCancel φ u w hcan).toReducedWord = t ^ ↑u * ReducedWord.prod φ w.toReducedWord

Next tactic:
cases w using consRecOn
theorem prod_unitsSMul (u : ℤˣ) (w : NormalWord d) :
    (unitsSMul φ u w).prod φ = (t^(u : ℤ) * w.prod φ : HNNExtension G A B φ) := by
  rw [unitsSMul]
  split_ifs with hcan
  · cases w using consRecOn
    · 

Proof state:
case pos.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 (ofGroup g✝)
⊢ ReducedWord.prod φ (unitsSMulWithCancel φ u (ofGroup g✝) hcan).toReducedWord =
    t ^ ↑u * ReducedWord.prod φ (ofGroup g✝).toReducedWord

Next tactic:
simp [Cancels] at hcan
theorem prod_unitsSMul (u : ℤˣ) (w : NormalWord d) :
    (unitsSMul φ u w).prod φ = (t^(u : ℤ) * w.prod φ : HNNExtension G A B φ) := by
  rw [unitsSMul]
  split_ifs with hcan
  · cases w using consRecOn
    · simp [Cancels] at hcan
    · 

Proof state:
case pos.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 ∈ TransversalPair.set d u✝
h2✝ : ∀ u' ∈ Option.map Prod.fst (List.head? w✝.toList), w✝.head ∈ toSubgroup A B u✝ → u✝ = u'
hcan : Cancels u (cons g✝ u✝ w✝ h1✝ h2✝)
a✝ :
  cons g✝ u✝ w✝ h1✝ h2✝ = w✝ →
    ReducedWord.prod φ (unitsSMulWithCancel φ u (cons g✝ u✝ w✝ h1✝ h2✝) hcan).toReducedWord =
      t ^ ↑u * ReducedWord.prod φ (cons g✝ u✝ w✝ h1✝ h2✝).toReducedWord
⊢ ReducedWord.prod φ (unitsSMulWithCancel φ u (cons g✝ u✝ w✝ h1✝ h2✝) hcan).toReducedWord =
    t ^ ↑u * ReducedWord.prod φ (cons g✝ u✝ w✝ h1✝ h2✝).toReducedWord

Next tactic:
cases hcan.2
theorem prod_unitsSMul (u : ℤˣ) (w : NormalWord d) :
    (unitsSMul φ u w).prod φ = (t^(u : ℤ) * w.prod φ : HNNExtension G A B φ) := by
  rw [unitsSMul]
  split_ifs with hcan
  · cases w using consRecOn
    · simp [Cancels] at hcan
    · cases hcan.2
      

Proof state:
case pos.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 ∈
    TransversalPair.set d
      { val := -↑u, inv := -↑u⁻¹, val_inv := (_ : -↑u * -↑u⁻¹ = 1), inv_val := (_ : -↑u⁻¹ * -↑u = 1) }
h2✝ :
  ∀ u' ∈ Option.map Prod.fst (List.head? w✝.toList),
    w✝.head ∈
        toSubgroup A B
          { val := -↑u, inv := -↑u⁻¹, val_inv := (_ : -↑u * -↑u⁻¹ = 1), inv_val := (_ : -↑u⁻¹ * -↑u = 1) } →
      { val := -↑u, inv := -↑u⁻¹, val_inv := (_ : -↑u * -↑u⁻¹ = 1), inv_val := (_ : -↑u⁻¹ * -↑u = 1) } = u'
hcan :
  Cancels u
    (cons g✝ { val := -↑u, inv := -↑u⁻¹, val_inv := (_ : -↑u * -↑u⁻¹ = 1), inv_val := (_ : -↑u⁻¹ * -↑u = 1) } w✝ h1✝
      h2✝)
a✝ :
  cons g✝ { val := -↑u, inv := -↑u⁻¹, val_inv := (_ : -↑u * -↑u⁻¹ = 1), inv_val := (_ : -↑u⁻¹ * -↑u = 1) } w✝ h1✝ h2✝ =
      w✝ →
    ReducedWord.prod φ
        (unitsSMulWithCancel φ u
            (cons g✝ { val := -↑u, inv := -↑u⁻¹, val_inv := (_ : -↑u * -↑u⁻¹ = 1), inv_val := (_ : -↑u⁻¹ * -↑u = 1) } w✝
              h1✝ h2✝)
            hcan).toReducedWord =
      t ^ ↑u *
        ReducedWord.prod φ
          (cons g✝ { val := -↑u, inv := -↑u⁻¹, val_inv := (_ : -↑u * -↑u⁻¹ = 1), inv_val := (_ : -↑u⁻¹ * -↑u = 1) } w✝
              h1✝ h2✝).toReducedWord
⊢ ReducedWord.prod φ
      (unitsSMulWithCancel φ u
          (cons g✝ { val := -↑u, inv := -↑u⁻¹, val_inv := (_ : -↑u * -↑u⁻¹ = 1), inv_val := (_ : -↑u⁻¹ * -↑u = 1) } w✝
            h1✝ h2✝)
          hcan).toReducedWord =
    t ^ ↑u *
      ReducedWord.prod φ
        (cons g✝ { val := -↑u, inv := -↑u⁻¹, val_inv := (_ : -↑u * -↑u⁻¹ = 1), inv_val := (_ : -↑u⁻¹ * -↑u = 1) } w✝ h1✝
            h2✝).toReducedWord

Next tactic:
simp [unitsSMulWithCancel]
theorem prod_unitsSMul (u : ℤˣ) (w : NormalWord d) :
    (unitsSMul φ u w).prod φ = (t^(u : ℤ) * w.prod φ : HNNExtension G A B φ) := by
  rw [unitsSMul]
  split_ifs with hcan
  · cases w using consRecOn
    · simp [Cancels] at hcan
    · cases hcan.2
      simp [unitsSMulWithCancel]
      

Proof state:
case pos.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 ∈
    TransversalPair.set d
      { val := -↑u, inv := -↑u⁻¹, val_inv := (_ : -↑u * -↑u⁻¹ = 1), inv_val := (_ : -↑u⁻¹ * -↑u = 1) }
h2✝ :
  ∀ u' ∈ Option.map Prod.fst (List.head? w✝.toList),
    w✝.head ∈
        toSubgroup A B
          { val := -↑u, inv := -↑u⁻¹, val_inv := (_ : -↑u * -↑u⁻¹ = 1), inv_val := (_ : -↑u⁻¹ * -↑u = 1) } →
      { val := -↑u, inv := -↑u⁻¹, val_inv := (_ : -↑u * -↑u⁻¹ = 1), inv_val := (_ : -↑u⁻¹ * -↑u = 1) } = u'
hcan :
  Cancels u
    (cons g✝ { val := -↑u, inv := -↑u⁻¹, val_inv := (_ : -↑u * -↑u⁻¹ = 1), inv_val := (_ : -↑u⁻¹ * -↑u = 1) } w✝ h1✝
      h2✝)
a✝ :
  cons g✝ { val := -↑u, inv := -↑u⁻¹, val_inv := (_ : -↑u * -↑u⁻¹ = 1), inv_val := (_ : -↑u⁻¹ * -↑u = 1) } w✝ h1✝ h2✝ =
      w✝ →
    ReducedWord.prod φ
        (unitsSMulWithCancel φ u
            (cons g✝ { val := -↑u, inv := -↑u⁻¹, val_inv := (_ : -↑u * -↑u⁻¹ = 1), inv_val := (_ : -↑u⁻¹ * -↑u = 1) } w✝
              h1✝ h2✝)
            hcan).toReducedWord =
      t ^ ↑u *
        ReducedWord.prod φ
          (cons g✝ { val := -↑u, inv := -↑u⁻¹, val_inv := (_ : -↑u * -↑u⁻¹ = 1), inv_val := (_ : -↑u⁻¹ * -↑u = 1) } w✝
              h1✝ h2✝).toReducedWord
⊢ of
        ↑((toSubgroupEquiv φ u)
            { val := g✝,
              property :=
                (_ :
                  (cons g✝
                          { val := -↑u, inv := -↑u⁻¹, val_inv := (_ : -↑u * -↑u⁻¹ = 1),
                            inv_val := (_ : -↑u⁻¹ * -↑u = 1) }
                          w✝ h1✝ h2✝).toReducedWord.head ∈
                    toSubgroup A B u) }) *
      ReducedWord.prod φ w✝.toReducedWord =
    t ^ ↑u * (of g✝ * ((t ^ ↑u)⁻¹ * ReducedWord.prod φ w✝.toReducedWord))

Next tactic:
rcases Int.units_eq_one_or u with (rfl | rfl)
theorem prod_unitsSMul (u : ℤˣ) (w : NormalWord d) :
    (unitsSMul φ u w).prod φ = (t^(u : ℤ) * w.prod φ : HNNExtension G A B φ) := by
  rw [unitsSMul]
  split_ifs with hcan
  · cases w using consRecOn
    · simp [Cancels] at hcan
    · cases hcan.2
      simp [unitsSMulWithCancel]
      rcases Int.units_eq_one_or u with (rfl | rfl)
      · 

Proof state:
case pos.cons.refl.inl
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
g✝ : G
w✝ : NormalWord d
h1✝ :
  w✝.head ∈
    TransversalPair.set d
      { val := -↑1, inv := -↑1⁻¹, val_inv := (_ : -↑1 * -↑1⁻¹ = 1), inv_val := (_ : -↑1⁻¹ * -↑1 = 1) }
h2✝ :
  ∀ u' ∈ Option.map Prod.fst (List.head? w✝.toList),
    w✝.head ∈
        toSubgroup A B
          { val := -↑1, inv := -↑1⁻¹, val_inv := (_ : -↑1 * -↑1⁻¹ = 1), inv_val := (_ : -↑1⁻¹ * -↑1 = 1) } →
      { val := -↑1, inv := -↑1⁻¹, val_inv := (_ : -↑1 * -↑1⁻¹ = 1), inv_val := (_ : -↑1⁻¹ * -↑1 = 1) } = u'
hcan :
  Cancels 1
    (cons g✝ { val := -↑1, inv := -↑1⁻¹, val_inv := (_ : -↑1 * -↑1⁻¹ = 1), inv_val := (_ : -↑1⁻¹ * -↑1 = 1) } w✝ h1✝
      h2✝)
a✝ :
  cons g✝ { val := -↑1, inv := -↑1⁻¹, val_inv := (_ : -↑1 * -↑1⁻¹ = 1), inv_val := (_ : -↑1⁻¹ * -↑1 = 1) } w✝ h1✝ h2✝ =
      w✝ →
    ReducedWord.prod φ
        (unitsSMulWithCancel φ 1
            (cons g✝ { val := -↑1, inv := -↑1⁻¹, val_inv := (_ : -↑1 * -↑1⁻¹ = 1), inv_val := (_ : -↑1⁻¹ * -↑1 = 1) } w✝
              h1✝ h2✝)
            hcan).toReducedWord =
      t ^ ↑1 *
        ReducedWord.prod φ
          (cons g✝ { val := -↑1, inv := -↑1⁻¹, val_inv := (_ : -↑1 * -↑1⁻¹ = 1), inv_val := (_ : -↑1⁻¹ * -↑1 = 1) } w✝
              h1✝ h2✝).toReducedWord
⊢ of
        ↑((toSubgroupEquiv φ 1)
            { val := g✝,
              property :=
                (_ :
                  (cons g✝
                          { val := -↑1, inv := -↑1⁻¹, val_inv := (_ : -↑1 * -↑1⁻¹ = 1),
                            inv_val := (_ : -↑1⁻¹ * -↑1 = 1) }
                          w✝ h1✝ h2✝).toReducedWord.head ∈
                    toSubgroup A B 1) }) *
      ReducedWord.prod φ w✝.toReducedWord =
    t ^ ↑1 * (of g✝ * ((t ^ ↑1)⁻¹ * ReducedWord.prod φ w✝.toReducedWord))

Next tactic:
simp [equiv_eq_conj, mul_assoc]
theorem prod_unitsSMul (u : ℤˣ) (w : NormalWord d) :
    (unitsSMul φ u w).prod φ = (t^(u : ℤ) * w.prod φ : HNNExtension G A B φ) := by
  rw [unitsSMul]
  split_ifs with hcan
  · cases w using consRecOn
    · simp [Cancels] at hcan
    · cases hcan.2
      simp [unitsSMulWithCancel]
      rcases Int.units_eq_one_or u with (rfl | rfl)
      · simp [equiv_eq_conj, mul_assoc]
      · 

Proof state:
case pos.cons.refl.inr
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
g✝ : G
w✝ : NormalWord d
h1✝ :
  w✝.head ∈
    TransversalPair.set d
      { val := -↑(-1), inv := -↑(-1)⁻¹, val_inv := (_ : -↑(-1) * -↑(-1)⁻¹ = 1), inv_val := (_ : -↑(-1)⁻¹ * -↑(-1) = 1) }
h2✝ :
  ∀ u' ∈ Option.map Prod.fst (List.head? w✝.toList),
    w✝.head ∈
        toSubgroup A B
          { val := -↑(-1), inv := -↑(-1)⁻¹, val_inv := (_ : -↑(-1) * -↑(-1)⁻¹ = 1),
            inv_val := (_ : -↑(-1)⁻¹ * -↑(-1) = 1) } →
      { val := -↑(-1), inv := -↑(-1)⁻¹, val_inv := (_ : -↑(-1) * -↑(-1)⁻¹ = 1),
          inv_val := (_ : -↑(-1)⁻¹ * -↑(-1) = 1) } =
        u'
hcan :
  Cancels (-1)
    (cons g✝
      { val := -↑(-1), inv := -↑(-1)⁻¹, val_inv := (_ : -↑(-1) * -↑(-1)⁻¹ = 1), inv_val := (_ : -↑(-1)⁻¹ * -↑(-1) = 1) }
      w✝ h1✝ h2✝)
a✝ :
  cons g✝
        { val := -↑(-1), inv := -↑(-1)⁻¹, val_inv := (_ : -↑(-1) * -↑(-1)⁻¹ = 1),
          inv_val := (_ : -↑(-1)⁻¹ * -↑(-1) = 1) }
        w✝ h1✝ h2✝ =
      w✝ →
    ReducedWord.prod φ
        (unitsSMulWithCancel φ (-1)
            (cons g✝
              { val := -↑(-1), inv := -↑(-1)⁻¹, val_inv := (_ : -↑(-1) * -↑(-1)⁻¹ = 1),
                inv_val := (_ : -↑(-1)⁻¹ * -↑(-1) = 1) }
              w✝ h1✝ h2✝)
            hcan).toReducedWord =
      t ^ ↑(-1) *
        ReducedWord.prod φ
          (cons g✝
              { val := -↑(-1), inv := -↑(-1)⁻¹, val_inv := (_ : -↑(-1) * -↑(-1)⁻¹ = 1),
                inv_val := (_ : -↑(-1)⁻¹ * -↑(-1) = 1) }
              w✝ h1✝ h2✝).toReducedWord
⊢ of
        ↑((toSubgroupEquiv φ (-1))
            { val := g✝,
              property :=
                (_ :
                  (cons g✝
                          { val := -↑(-1), inv := -↑(-1)⁻¹, val_inv := (_ : -↑(-1) * -↑(-1)⁻¹ = 1),
                            inv_val := (_ : -↑(-1)⁻¹ * -↑(-1) = 1) }
                          w✝ h1✝ h2✝).toReducedWord.head ∈
                    toSubgroup A B (-1)) }) *
      ReducedWord.prod φ w✝.toReducedWord =
    t ^ ↑(-1) * (of g✝ * ((t ^ ↑(-1))⁻¹ * ReducedWord.prod φ w✝.toReducedWord))

Next tactic:
simp [equiv_symm_eq_conj, mul_assoc]
theorem prod_unitsSMul (u : ℤˣ) (w : NormalWord d) :
    (unitsSMul φ u w).prod φ = (t^(u : ℤ) * w.prod φ : HNNExtension G A B φ) := by
  rw [unitsSMul]
  split_ifs with hcan
  · cases w using consRecOn
    · simp [Cancels] at hcan
    · cases hcan.2
      simp [unitsSMulWithCancel]
      rcases Int.units_eq_one_or u with (rfl | rfl)
      · simp [equiv_eq_conj, mul_assoc]
      · simp [equiv_symm_eq_conj, mul_assoc]
        -- This used to be the end of the proof before leanprover/lean4#2644
        

Proof state:
case pos.cons.refl.inr
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
g✝ : G
w✝ : NormalWord d
h1✝ :
  w✝.head ∈
    TransversalPair.set d
      { val := -↑(-1), inv := -↑(-1)⁻¹, val_inv := (_ : -↑(-1) * -↑(-1)⁻¹ = 1), inv_val := (_ : -↑(-1)⁻¹ * -↑(-1) = 1) }
h2✝ :
  ∀ u' ∈ Option.map Prod.fst (List.head? w✝.toList),
    w✝.head ∈
        toSubgroup A B
          { val := -↑(-1), inv := -↑(-1)⁻¹, val_inv := (_ : -↑(-1) * -↑(-1)⁻¹ = 1),
            inv_val := (_ : -↑(-1)⁻¹ * -↑(-1) = 1) } →
      { val := -↑(-1), inv := -↑(-1)⁻¹, val_inv := (_ : -↑(-1) * -↑(-1)⁻¹ = 1),
          inv_val := (_ : -↑(-1)⁻¹ * -↑(-1) = 1) } =
        u'
hcan :
  Cancels (-1)
    (cons g✝
      { val := -↑(-1), inv := -↑(-1)⁻¹, val_inv := (_ : -↑(-1) * -↑(-1)⁻¹ = 1), inv_val := (_ : -↑(-1)⁻¹ * -↑(-1) = 1) }
      w✝ h1✝ h2✝)
a✝ :
  cons g✝
        { val := -↑(-1), inv := -↑(-1)⁻¹, val_inv := (_ : -↑(-1) * -↑(-1)⁻¹ = 1),
          inv_val := (_ : -↑(-1)⁻¹ * -↑(-1) = 1) }
        w✝ h1✝ h2✝ =
      w✝ →
    ReducedWord.prod φ
        (unitsSMulWithCancel φ (-1)
            (cons g✝
              { val := -↑(-1), inv := -↑(-1)⁻¹, val_inv := (_ : -↑(-1) * -↑(-1)⁻¹ = 1),
                inv_val := (_ : -↑(-1)⁻¹ * -↑(-1) = 1) }
              w✝ h1✝ h2✝)
            hcan).toReducedWord =
      t ^ ↑(-1) *
        ReducedWord.prod φ
          (cons g✝
              { val := -↑(-1), inv := -↑(-1)⁻¹, val_inv := (_ : -↑(-1) * -↑(-1)⁻¹ = 1),
                inv_val := (_ : -↑(-1)⁻¹ * -↑(-1) = 1) }
              w✝ h1✝ h2✝).toReducedWord
⊢ of
        ↑((MulEquiv.symm φ)
            { val := g✝,
              property :=
                (_ :
                  (cons g✝
                          { val := -↑(-1), inv := -↑(-1)⁻¹, val_inv := (_ : -↑(-1) * -↑(-1)⁻¹ = 1),
                            inv_val := (_ : -↑(-1)⁻¹ * -↑(-1) = 1) }
                          w✝ h1✝ h2✝).toReducedWord.head ∈
                    toSubgroup A B (-1)) }) *
      ReducedWord.prod φ w✝.toReducedWord =
    t⁻¹ * (of g✝ * (t * ReducedWord.prod φ w✝.toReducedWord))

Next tactic:
erw [equiv_symm_eq_conj]
theorem prod_unitsSMul (u : ℤˣ) (w : NormalWord d) :
    (unitsSMul φ u w).prod φ = (t^(u : ℤ) * w.prod φ : HNNExtension G A B φ) := by
  rw [unitsSMul]
  split_ifs with hcan
  · cases w using consRecOn
    · simp [Cancels] at hcan
    · cases hcan.2
      simp [unitsSMulWithCancel]
      rcases Int.units_eq_one_or u with (rfl | rfl)
      · simp [equiv_eq_conj, mul_assoc]
      · simp [equiv_symm_eq_conj, mul_assoc]
        -- This used to be the end of the proof before leanprover/lean4#2644
        erw [equiv_symm_eq_conj]
        

Proof state:
case pos.cons.refl.inr
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
g✝ : G
w✝ : NormalWord d
h1✝ :
  w✝.head ∈
    TransversalPair.set d
      { val := -↑(-1), inv := -↑(-1)⁻¹, val_inv := (_ : -↑(-1) * -↑(-1)⁻¹ = 1), inv_val := (_ : -↑(-1)⁻¹ * -↑(-1) = 1) }
h2✝ :
  ∀ u' ∈ Option.map Prod.fst (List.head? w✝.toList),
    w✝.head ∈
        toSubgroup A B
          { val := -↑(-1), inv := -↑(-1)⁻¹, val_inv := (_ : -↑(-1) * -↑(-1)⁻¹ = 1),
            inv_val := (_ : -↑(-1)⁻¹ * -↑(-1) = 1) } →
      { val := -↑(-1), inv := -↑(-1)⁻¹, val_inv := (_ : -↑(-1) * -↑(-1)⁻¹ = 1),
          inv_val := (_ : -↑(-1)⁻¹ * -↑(-1) = 1) } =
        u'
hcan :
  Cancels (-1)
    (cons g✝
      { val := -↑(-1), inv := -↑(-1)⁻¹, val_inv := (_ : -↑(-1) * -↑(-1)⁻¹ = 1), inv_val := (_ : -↑(-1)⁻¹ * -↑(-1) = 1) }
      w✝ h1✝ h2✝)
a✝ :
  cons g✝
        { val := -↑(-1), inv := -↑(-1)⁻¹, val_inv := (_ : -↑(-1) * -↑(-1)⁻¹ = 1),
          inv_val := (_ : -↑(-1)⁻¹ * -↑(-1) = 1) }
        w✝ h1✝ h2✝ =
      w✝ →
    ReducedWord.prod φ
        (unitsSMulWithCancel φ (-1)
            (cons g✝
              { val := -↑(-1), inv := -↑(-1)⁻¹, val_inv := (_ : -↑(-1) * -↑(-1)⁻¹ = 1),
                inv_val := (_ : -↑(-1)⁻¹ * -↑(-1) = 1) }
              w✝ h1✝ h2✝)
            hcan).toReducedWord =
      t ^ ↑(-1) *
        ReducedWord.prod φ
          (cons g✝
              { val := -↑(-1), inv := -↑(-1)⁻¹, val_inv := (_ : -↑(-1) * -↑(-1)⁻¹ = 1),
                inv_val := (_ : -↑(-1)⁻¹ * -↑(-1) = 1) }
              w✝ h1✝ h2✝).toReducedWord
⊢ t⁻¹ *
          of
            ↑{ val := g✝,
                property :=
                  (_ :
                    (cons g✝
                            { val := -↑(-1), inv := -↑(-1)⁻¹, val_inv := (_ : -↑(-1) * -↑(-1)⁻¹ = 1),
                              inv_val := (_ : -↑(-1)⁻¹ * -↑(-1) = 1) }
                            w✝ h1✝ h2✝).toReducedWord.head ∈
                      toSubgroup A B (-1)) } *
        t *
      ReducedWord.prod φ w✝.toReducedWord =
    t⁻¹ * (of g✝ * (t * ReducedWord.prod φ w✝.toReducedWord))

Next tactic:
simp [equiv_symm_eq_conj, mul_assoc]
theorem prod_unitsSMul (u : ℤˣ) (w : NormalWord d) :
    (unitsSMul φ u w).prod φ = (t^(u : ℤ) * w.prod φ : HNNExtension G A B φ) := by
  rw [unitsSMul]
  split_ifs with hcan
  · cases w using consRecOn
    · simp [Cancels] at hcan
    · cases hcan.2
      simp [unitsSMulWithCancel]
      rcases Int.units_eq_one_or u with (rfl | rfl)
      · simp [equiv_eq_conj, mul_assoc]
      · simp [equiv_symm_eq_conj, mul_assoc]
        -- This used to be the end of the proof before leanprover/lean4#2644
        erw [equiv_symm_eq_conj]
        simp [equiv_symm_eq_conj, mul_assoc]
  · 

Proof state:
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 w
⊢ ReducedWord.prod φ
      (let g' := unitsSMulGroup φ d u w.head;
        cons (↑g'.1) u ((↑g'.2 * w.head⁻¹) • w)
          (_ : ↑(unitsSMulGroup φ d u w.head).2 * w.head⁻¹ * w.head ∈ TransversalPair.set d u)
          (_ :
            ∀ u' ∈ Option.map Prod.fst (List.head? ((↑(unitsSMulGroup φ d u w.head).2 * w.head⁻¹) • w).toList),
              ((↑(unitsSMulGroup φ d u w.head).2 * w.head⁻¹) • w).head ∈ toSubgroup A B u → u = u')).toReducedWord =
    t ^ ↑u * ReducedWord.prod φ w.toReducedWord

Next tactic:
simp [unitsSMulGroup]
theorem prod_unitsSMul (u : ℤˣ) (w : NormalWord d) :
    (unitsSMul φ u w).prod φ = (t^(u : ℤ) * w.prod φ : HNNExtension G A B φ) := by
  rw [unitsSMul]
  split_ifs with hcan
  · cases w using consRecOn
    · simp [Cancels] at hcan
    · cases hcan.2
      simp [unitsSMulWithCancel]
      rcases Int.units_eq_one_or u with (rfl | rfl)
      · simp [equiv_eq_conj, mul_assoc]
      · simp [equiv_symm_eq_conj, mul_assoc]
        -- This used to be the end of the proof before leanprover/lean4#2644
        erw [equiv_symm_eq_conj]
        simp [equiv_symm_eq_conj, mul_assoc]
  · simp [unitsSMulGroup]
    

Proof state:
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 w
⊢ of
        ↑((toSubgroupEquiv φ u)
            ((IsComplement.equiv (_ : IsComplement (↑(toSubgroup A B u)) (TransversalPair.set d u))) w.head).1) *
      (t ^ ↑u *
        (of ↑((IsComplement.equiv (_ : IsComplement (↑(toSubgroup A B u)) (TransversalPair.set d u))) w.head).2 *
            (of w.head)⁻¹ *
          ReducedWord.prod φ w.toReducedWord)) =
    t ^ ↑u * ReducedWord.prod φ w.toReducedWord

Next tactic:
rcases Int.units_eq_one_or u with (rfl | rfl)
theorem prod_unitsSMul (u : ℤˣ) (w : NormalWord d) :
    (unitsSMul φ u w).prod φ = (t^(u : ℤ) * w.prod φ : HNNExtension G A B φ) := by
  rw [unitsSMul]
  split_ifs with hcan
  · cases w using consRecOn
    · simp [Cancels] at hcan
    · cases hcan.2
      simp [unitsSMulWithCancel]
      rcases Int.units_eq_one_or u with (rfl | rfl)
      · simp [equiv_eq_conj, mul_assoc]
      · simp [equiv_symm_eq_conj, mul_assoc]
        -- This used to be the end of the proof before leanprover/lean4#2644
        erw [equiv_symm_eq_conj]
        simp [equiv_symm_eq_conj, mul_assoc]
  · simp [unitsSMulGroup]
    rcases Int.units_eq_one_or u with (rfl | rfl)
    · 

Proof state:
case neg.inl
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
w : NormalWord d
hcan : ¬Cancels 1 w
⊢ of
        ↑((toSubgroupEquiv φ 1)
            ((IsComplement.equiv (_ : IsComplement (↑(toSubgroup A B 1)) (TransversalPair.set d 1))) w.head).1) *
      (t ^ ↑1 *
        (of ↑((IsComplement.equiv (_ : IsComplement (↑(toSubgroup A B 1)) (TransversalPair.set d 1))) w.head).2 *
            (of w.head)⁻¹ *
          ReducedWord.prod φ w.toReducedWord)) =
    t ^ ↑1 * ReducedWord.prod φ w.toReducedWord

Next tactic:
simp [equiv_eq_conj, mul_assoc, (d.compl _).equiv_snd_eq_inv_mul]
theorem prod_unitsSMul (u : ℤˣ) (w : NormalWord d) :
    (unitsSMul φ u w).prod φ = (t^(u : ℤ) * w.prod φ : HNNExtension G A B φ) := by
  rw [unitsSMul]
  split_ifs with hcan
  · cases w using consRecOn
    · simp [Cancels] at hcan
    · cases hcan.2
      simp [unitsSMulWithCancel]
      rcases Int.units_eq_one_or u with (rfl | rfl)
      · simp [equiv_eq_conj, mul_assoc]
      · simp [equiv_symm_eq_conj, mul_assoc]
        -- This used to be the end of the proof before leanprover/lean4#2644
        erw [equiv_symm_eq_conj]
        simp [equiv_symm_eq_conj, mul_assoc]
  · simp [unitsSMulGroup]
    rcases Int.units_eq_one_or u with (rfl | rfl)
    · simp [equiv_eq_conj, mul_assoc, (d.compl _).equiv_snd_eq_inv_mul]
      -- This used to be the end of the proof before leanprover/lean4#2644
      

Proof state:
case neg.inl
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
w : NormalWord d
hcan : ¬Cancels 1 w
⊢ of ↑((IsComplement.equiv (_ : IsComplement (↑(toSubgroup A B 1)) (TransversalPair.set d 1))) w.head).1 *
      (of ↑((IsComplement.equiv (_ : IsComplement (↑(toSubgroup A B 1)) (TransversalPair.set d 1))) w.head).2 *
        ((of w.head)⁻¹ * ReducedWord.prod φ w.toReducedWord)) =
    ReducedWord.prod φ w.toReducedWord

Next tactic:
erw [(d.compl _).equiv_snd_eq_inv_mul]
theorem prod_unitsSMul (u : ℤˣ) (w : NormalWord d) :
    (unitsSMul φ u w).prod φ = (t^(u : ℤ) * w.prod φ : HNNExtension G A B φ) := by
  rw [unitsSMul]
  split_ifs with hcan
  · cases w using consRecOn
    · simp [Cancels] at hcan
    · cases hcan.2
      simp [unitsSMulWithCancel]
      rcases Int.units_eq_one_or u with (rfl | rfl)
      · simp [equiv_eq_conj, mul_assoc]
      · simp [equiv_symm_eq_conj, mul_assoc]
        -- This used to be the end of the proof before leanprover/lean4#2644
        erw [equiv_symm_eq_conj]
        simp [equiv_symm_eq_conj, mul_assoc]
  · simp [unitsSMulGroup]
    rcases Int.units_eq_one_or u with (rfl | rfl)
    · simp [equiv_eq_conj, mul_assoc, (d.compl _).equiv_snd_eq_inv_mul]
      -- This used to be the end of the proof before leanprover/lean4#2644
      erw [(d.compl _).equiv_snd_eq_inv_mul]
      

Proof state:
case neg.inl
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
w : NormalWord d
hcan : ¬Cancels 1 w
⊢ of ↑((IsComplement.equiv (_ : IsComplement (↑(toSubgroup A B 1)) (TransversalPair.set d 1))) w.head).1 *
      (of
          ((↑((IsComplement.equiv (_ : IsComplement (↑(toSubgroup A B 1)) (TransversalPair.set d 1))) w.head).1)⁻¹ *
            w.head) *
        ((of w.head)⁻¹ * ReducedWord.prod φ w.toReducedWord)) =
    ReducedWord.prod φ w.toReducedWord

Next tactic:
simp [equiv_eq_conj, mul_assoc, (d.compl _).equiv_snd_eq_inv_mul]