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
  · 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]
      simp [equiv_eq_conj, mul_assoc, (d.compl _).equiv_snd_eq_inv_mul]
    · 

Proof state:
case neg.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
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_symm_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
      erw [(d.compl _).equiv_snd_eq_inv_mul]
      simp [equiv_eq_conj, mul_assoc, (d.compl _).equiv_snd_eq_inv_mul]
    · simp [equiv_symm_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.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
w : NormalWord d
hcan : ¬Cancels (-1) w
⊢ of
        ↑((MulEquiv.symm φ)
            ((IsComplement.equiv (_ : IsComplement (↑(toSubgroup A B (-1))) (TransversalPair.set d (-1)))) w.head).1) *
      (t⁻¹ *
        (of ↑((IsComplement.equiv (_ : IsComplement (↑(toSubgroup A B (-1))) (TransversalPair.set d (-1)))) w.head).2 *
          ((of w.head)⁻¹ * ReducedWord.prod φ w.toReducedWord))) =
    t⁻¹ * ReducedWord.prod φ w.toReducedWord

Next tactic:
erw [equiv_symm_eq_conj, (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]
      simp [equiv_eq_conj, mul_assoc, (d.compl _).equiv_snd_eq_inv_mul]
    · simp [equiv_symm_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 [equiv_symm_eq_conj, (d.compl _).equiv_snd_eq_inv_mul]
      

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

Next tactic:
simp [equiv_symm_eq_conj, mul_assoc, (d.compl _).equiv_snd_eq_inv_mul]
@[simp]
theorem prod_empty : (empty : NormalWord d).prod φ = 1 := by
  

Proof state:
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
⊢ ReducedWord.prod φ empty.toReducedWord = 1

Next tactic:
simp [ReducedWord.prod]
@[simp]
theorem prod_smul (g : HNNExtension G A B φ) (w : NormalWord d) :
    (g • w).prod φ = g * w.prod φ := by
  

Proof state:
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 : HNNExtension G A B φ
w : NormalWord d
⊢ ReducedWord.prod φ (g • w).toReducedWord = g * ReducedWord.prod φ w.toReducedWord

Next tactic:
induction g using induction_on generalizing w with
  | of => simp [of_smul_eq_smul]
  | t => simp [t_smul_eq_unitsSMul, prod_unitsSMul, mul_assoc]
  | mul => simp_all [mul_smul, mul_assoc]
  | inv x ih =>
    rw [← mul_right_inj x, ← ih]
    simp
@[simp]
theorem prod_smul (g : HNNExtension G A B φ) (w : NormalWord d) :
    (g • w).prod φ = g * w.prod φ := by
  induction g using induction_on generalizing w with
  

Proof state:
case of
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
⊢ ReducedWord.prod φ (of g✝ • w).toReducedWord = of g✝ * ReducedWord.prod φ w.toReducedWord

Next tactic:
| of => simp [of_smul_eq_smul]
@[simp]
theorem prod_smul (g : HNNExtension G A B φ) (w : NormalWord d) :
    (g • w).prod φ = g * w.prod φ := by
  induction g using induction_on generalizing w with
  | of => 

Proof state:
case of
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
⊢ ReducedWord.prod φ (of g✝ • w).toReducedWord = of g✝ * ReducedWord.prod φ w.toReducedWord

Next tactic:
simp [of_smul_eq_smul]
@[simp]
theorem prod_smul (g : HNNExtension G A B φ) (w : NormalWord d) :
    (g • w).prod φ = g * w.prod φ := by
  induction g using induction_on generalizing w with
  | of => simp [of_smul_eq_smul]
  

Proof state:
case t
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
⊢ ReducedWord.prod φ (t • w).toReducedWord = t * ReducedWord.prod φ w.toReducedWord

Next tactic:
| t => simp [t_smul_eq_unitsSMul, prod_unitsSMul, mul_assoc]
@[simp]
theorem prod_smul (g : HNNExtension G A B φ) (w : NormalWord d) :
    (g • w).prod φ = g * w.prod φ := by
  induction g using induction_on generalizing w with
  | of => simp [of_smul_eq_smul]
  | t => 

Proof state:
case t
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
⊢ ReducedWord.prod φ (t • w).toReducedWord = t * ReducedWord.prod φ w.toReducedWord

Next tactic:
simp [t_smul_eq_unitsSMul, prod_unitsSMul, mul_assoc]
@[simp]
theorem prod_smul (g : HNNExtension G A B φ) (w : NormalWord d) :
    (g • w).prod φ = g * w.prod φ := by
  induction g using induction_on generalizing w with
  | of => simp [of_smul_eq_smul]
  | t => simp [t_smul_eq_unitsSMul, prod_unitsSMul, mul_assoc]
  

Proof state:
case mul
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
x✝ y✝ : HNNExtension G A B φ
a✝¹ : ∀ (w : NormalWord d), ReducedWord.prod φ (x✝ • w).toReducedWord = x✝ * ReducedWord.prod φ w.toReducedWord
a✝ : ∀ (w : NormalWord d), ReducedWord.prod φ (y✝ • w).toReducedWord = y✝ * ReducedWord.prod φ w.toReducedWord
w : NormalWord d
⊢ ReducedWord.prod φ ((x✝ * y✝) • w).toReducedWord = x✝ * y✝ * ReducedWord.prod φ w.toReducedWord

Next tactic:
| mul => simp_all [mul_smul, mul_assoc]
@[simp]
theorem prod_smul (g : HNNExtension G A B φ) (w : NormalWord d) :
    (g • w).prod φ = g * w.prod φ := by
  induction g using induction_on generalizing w with
  | of => simp [of_smul_eq_smul]
  | t => simp [t_smul_eq_unitsSMul, prod_unitsSMul, mul_assoc]
  | mul => 

Proof state:
case mul
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
x✝ y✝ : HNNExtension G A B φ
a✝¹ : ∀ (w : NormalWord d), ReducedWord.prod φ (x✝ • w).toReducedWord = x✝ * ReducedWord.prod φ w.toReducedWord
a✝ : ∀ (w : NormalWord d), ReducedWord.prod φ (y✝ • w).toReducedWord = y✝ * ReducedWord.prod φ w.toReducedWord
w : NormalWord d
⊢ ReducedWord.prod φ ((x✝ * y✝) • w).toReducedWord = x✝ * y✝ * ReducedWord.prod φ w.toReducedWord

Next tactic:
simp_all [mul_smul, mul_assoc]
@[simp]
theorem prod_smul (g : HNNExtension G A B φ) (w : NormalWord d) :
    (g • w).prod φ = g * w.prod φ := by
  induction g using induction_on generalizing w with
  | of => simp [of_smul_eq_smul]
  | t => simp [t_smul_eq_unitsSMul, prod_unitsSMul, mul_assoc]
  | mul => simp_all [mul_smul, mul_assoc]
  

Proof state:
case inv
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
x : HNNExtension G A B φ
ih : ∀ (w : NormalWord d), ReducedWord.prod φ (x • w).toReducedWord = x * ReducedWord.prod φ w.toReducedWord
w : NormalWord d
⊢ ReducedWord.prod φ (x⁻¹ • w).toReducedWord = x⁻¹ * ReducedWord.prod φ w.toReducedWord

Next tactic:
| inv x ih =>
    rw [← mul_right_inj x, ← ih]
    simp
@[simp]
theorem prod_smul (g : HNNExtension G A B φ) (w : NormalWord d) :
    (g • w).prod φ = g * w.prod φ := by
  induction g using induction_on generalizing w with
  | of => simp [of_smul_eq_smul]
  | t => simp [t_smul_eq_unitsSMul, prod_unitsSMul, mul_assoc]
  | mul => simp_all [mul_smul, mul_assoc]
  | inv x ih =>
    

Proof state:
case inv
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
x : HNNExtension G A B φ
ih : ∀ (w : NormalWord d), ReducedWord.prod φ (x • w).toReducedWord = x * ReducedWord.prod φ w.toReducedWord
w : NormalWord d
⊢ ReducedWord.prod φ (x⁻¹ • w).toReducedWord = x⁻¹ * ReducedWord.prod φ w.toReducedWord

Next tactic:
rw [← mul_right_inj x, ← ih]
@[simp]
theorem prod_smul (g : HNNExtension G A B φ) (w : NormalWord d) :
    (g • w).prod φ = g * w.prod φ := by
  induction g using induction_on generalizing w with
  | of => simp [of_smul_eq_smul]
  | t => simp [t_smul_eq_unitsSMul, prod_unitsSMul, mul_assoc]
  | mul => simp_all [mul_smul, mul_assoc]
  | inv x ih =>
    rw [← mul_right_inj x, ← ih]
    

Proof state:
case inv
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
x : HNNExtension G A B φ
ih : ∀ (w : NormalWord d), ReducedWord.prod φ (x • w).toReducedWord = x * ReducedWord.prod φ w.toReducedWord
w : NormalWord d
⊢ ReducedWord.prod φ (x • x⁻¹ • w).toReducedWord = x * (x⁻¹ * ReducedWord.prod φ w.toReducedWord)

Next tactic:
simp
@[simp]
theorem prod_smul_empty (w : NormalWord d) :
    (w.prod φ) • empty = w := by
  

Proof state:
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
⊢ ReducedWord.prod φ w.toReducedWord • empty = w

Next tactic:
induction w using consRecOn with
  | ofGroup => simp [ofGroup, ReducedWord.prod, of_smul_eq_smul, group_smul_def]
  | cons g u w h1 h2 ih =>
    rw [prod_cons, ← mul_assoc, mul_smul, ih, mul_smul, t_pow_smul_eq_unitsSMul,
      of_smul_eq_smul, unitsSMul]
    rw [dif_neg (not_cancels_of_cons_hyp u w h2)]
    -- The next 3 lines were a single `simp [...]` before leanprover/lean4#2644
    simp only [unitsSMulGroup]
    simp_rw [SetLike.coe_sort_coe]
    erw [(d.compl _).equiv_fst_eq_one_of_mem_of_one_mem (one_mem _) h1]
    ext <;> simp
    -- The next 4 were not needed before leanprover/lean4#2644
    · erw [(d.compl _).equiv_snd_eq_inv_mul]
      simp_rw [SetLike.coe_sort_coe]
      erw [(d.compl _).equiv_fst_eq_one_of_mem_of_one_mem (one_mem _) h1]
      simp
@[simp]
theorem prod_smul_empty (w : NormalWord d) :
    (w.prod φ) • empty = w := by
  induction w using consRecOn with
  

Proof state:
case 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
g✝ : G
⊢ ReducedWord.prod φ (ofGroup g✝).toReducedWord • empty = ofGroup g✝

Next tactic:
| ofGroup => simp [ofGroup, ReducedWord.prod, of_smul_eq_smul, group_smul_def]
@[simp]
theorem prod_smul_empty (w : NormalWord d) :
    (w.prod φ) • empty = w := by
  induction w using consRecOn with
  | ofGroup => 

Proof state:
case 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
g✝ : G
⊢ ReducedWord.prod φ (ofGroup g✝).toReducedWord • empty = ofGroup g✝

Next tactic:
simp [ofGroup, ReducedWord.prod, of_smul_eq_smul, group_smul_def]
@[simp]
theorem prod_smul_empty (w : NormalWord d) :
    (w.prod φ) • empty = w := by
  induction w using consRecOn with
  | ofGroup => simp [ofGroup, ReducedWord.prod, of_smul_eq_smul, group_smul_def]
  

Proof state:
case 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
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'
ih : ReducedWord.prod φ w.toReducedWord • empty = w
⊢ ReducedWord.prod φ (cons g u w h1 h2).toReducedWord • empty = cons g u w h1 h2

Next tactic:
| cons g u w h1 h2 ih =>
    rw [prod_cons, ← mul_assoc, mul_smul, ih, mul_smul, t_pow_smul_eq_unitsSMul,
      of_smul_eq_smul, unitsSMul]
    rw [dif_neg (not_cancels_of_cons_hyp u w h2)]
    -- The next 3 lines were a single `simp [...]` before leanprover/lean4#2644
    simp only [unitsSMulGroup]
    simp_rw [SetLike.coe_sort_coe]
    erw [(d.compl _).equiv_fst_eq_one_of_mem_of_one_mem (one_mem _) h1]
    ext <;> simp
    -- The next 4 were not needed before leanprover/lean4#2644
    · erw [(d.compl _).equiv_snd_eq_inv_mul]
      simp_rw [SetLike.coe_sort_coe]
      erw [(d.compl _).equiv_fst_eq_one_of_mem_of_one_mem (one_mem _) h1]
      simp
@[simp]
theorem prod_smul_empty (w : NormalWord d) :
    (w.prod φ) • empty = w := by
  induction w using consRecOn with
  | ofGroup => simp [ofGroup, ReducedWord.prod, of_smul_eq_smul, group_smul_def]
  | cons g u w h1 h2 ih =>
    

Proof state:
case 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
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'
ih : ReducedWord.prod φ w.toReducedWord • empty = w
⊢ ReducedWord.prod φ (cons g u w h1 h2).toReducedWord • empty = cons g u w h1 h2

Next tactic:
rw [prod_cons, ← mul_assoc, mul_smul, ih, mul_smul, t_pow_smul_eq_unitsSMul,
      of_smul_eq_smul, unitsSMul]
@[simp]
theorem prod_smul_empty (w : NormalWord d) :
    (w.prod φ) • empty = w := by
  induction w using consRecOn with
  | ofGroup => simp [ofGroup, ReducedWord.prod, of_smul_eq_smul, group_smul_def]
  | cons g u w h1 h2 ih =>
    rw [prod_cons, ← mul_assoc, mul_smul, ih, mul_smul, t_pow_smul_eq_unitsSMul,
      of_smul_eq_smul, unitsSMul]
    

Proof state:
case 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
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'
ih : ReducedWord.prod φ w.toReducedWord • empty = w
⊢ (g •
      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)
          (_ : ↑(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')) =
    cons g u w h1 h2

Next tactic:
rw [dif_neg (not_cancels_of_cons_hyp u w h2)]
@[simp]
theorem prod_smul_empty (w : NormalWord d) :
    (w.prod φ) • empty = w := by
  induction w using consRecOn with
  | ofGroup => simp [ofGroup, ReducedWord.prod, of_smul_eq_smul, group_smul_def]
  | cons g u w h1 h2 ih =>
    rw [prod_cons, ← mul_assoc, mul_smul, ih, mul_smul, t_pow_smul_eq_unitsSMul,
      of_smul_eq_smul, unitsSMul]
    rw [dif_neg (not_cancels_of_cons_hyp u w h2)]
    -- The next 3 lines were a single `simp [...]` before leanprover/lean4#2644
    

Proof state:
case 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
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'
ih : ReducedWord.prod φ w.toReducedWord • empty = w
⊢ (g •
      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')) =
    cons g u w h1 h2

Next tactic:
simp only [unitsSMulGroup]
@[simp]
theorem prod_smul_empty (w : NormalWord d) :
    (w.prod φ) • empty = w := by
  induction w using consRecOn with
  | ofGroup => simp [ofGroup, ReducedWord.prod, of_smul_eq_smul, group_smul_def]
  | cons g u w h1 h2 ih =>
    rw [prod_cons, ← mul_assoc, mul_smul, ih, mul_smul, t_pow_smul_eq_unitsSMul,
      of_smul_eq_smul, unitsSMul]
    rw [dif_neg (not_cancels_of_cons_hyp u w h2)]
    -- The next 3 lines were a single `simp [...]` before leanprover/lean4#2644
    simp only [unitsSMulGroup]
    

Proof state:
case 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
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'
ih : ReducedWord.prod φ w.toReducedWord • empty = w
⊢ g •
      cons
        (↑((toSubgroupEquiv φ u)
            ((IsComplement.equiv (_ : IsComplement (↑(toSubgroup A B u)) (TransversalPair.set d u))) w.head).1))
        u
        ((↑((IsComplement.equiv (_ : IsComplement (↑(toSubgroup A B u)) (TransversalPair.set d u))) w.head).2 *
            w.head⁻¹) •
          w)
        (_ :
          ((↑((IsComplement.equiv (_ : IsComplement (↑(toSubgroup A B u)) (TransversalPair.set d u))) w.head).2 *
                  w.head⁻¹) •
                w).head ∈
            TransversalPair.set d u)
        (_ :
          ∀
            u' ∈
              Option.map Prod.fst
                (List.head?
                  ((↑((IsComplement.equiv (_ : IsComplement (↑(toSubgroup A B u)) (TransversalPair.set d u)))
                              w.head).2 *
                        w.head⁻¹) •
                      w).toList),
            ((↑((IsComplement.equiv (_ : IsComplement (↑(toSubgroup A B u)) (TransversalPair.set d u))) w.head).2 *
                      w.head⁻¹) •
                    w).head ∈
                toSubgroup A B u →
              u = u') =
    cons g u w h1 h2

Next tactic:
simp_rw [SetLike.coe_sort_coe]
@[simp]
theorem prod_smul_empty (w : NormalWord d) :
    (w.prod φ) • empty = w := by
  induction w using consRecOn with
  | ofGroup => simp [ofGroup, ReducedWord.prod, of_smul_eq_smul, group_smul_def]
  | cons g u w h1 h2 ih =>
    rw [prod_cons, ← mul_assoc, mul_smul, ih, mul_smul, t_pow_smul_eq_unitsSMul,
      of_smul_eq_smul, unitsSMul]
    rw [dif_neg (not_cancels_of_cons_hyp u w h2)]
    -- The next 3 lines were a single `simp [...]` before leanprover/lean4#2644
    simp only [unitsSMulGroup]
    simp_rw [SetLike.coe_sort_coe]
    

Proof state:
case 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
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'
ih : ReducedWord.prod φ w.toReducedWord • empty = w
⊢ g •
      cons
        (↑((toSubgroupEquiv φ u)
            ((IsComplement.equiv (_ : IsComplement (↑(toSubgroup A B u)) (TransversalPair.set d u))) w.head).1))
        u
        ((↑((IsComplement.equiv (_ : IsComplement (↑(toSubgroup A B u)) (TransversalPair.set d u))) w.head).2 *
            w.head⁻¹) •
          w)
        (_ :
          ((↑((IsComplement.equiv (_ : IsComplement (↑(toSubgroup A B u)) (TransversalPair.set d u))) w.head).2 *
                  w.head⁻¹) •
                w).head ∈
            TransversalPair.set d u)
        (_ :
          ∀
            u' ∈
              Option.map Prod.fst
                (List.head?
                  ((↑((IsComplement.equiv (_ : IsComplement (↑(toSubgroup A B u)) (TransversalPair.set d u)))
                              w.head).2 *
                        w.head⁻¹) •
                      w).toList),
            ((↑((IsComplement.equiv (_ : IsComplement (↑(toSubgroup A B u)) (TransversalPair.set d u))) w.head).2 *
                      w.head⁻¹) •
                    w).head ∈
                toSubgroup A B u →
              u = u') =
    cons g u w h1 h2

Next tactic:
erw [(d.compl _).equiv_fst_eq_one_of_mem_of_one_mem (one_mem _) h1]