l3lab/ntp-mathlib huggingface dataset:
/-- Given a word in `CoprodI`, if every letter is in the transversal and when
we multiply by an element of the base group it still has this property,
then the element of the base group we multiplied by was one.  -/
theorem eq_one_of_smul_normalized (w : CoprodI.Word G) {i : ι} (h : H)
    (hw : ∀ i g, ⟨i, g⟩ ∈ w.toList → g ∈ d.set i)
    (hφw : ∀ j g, ⟨j, g⟩ ∈ (CoprodI.of (φ i h) • w).toList → g ∈ d.set j) :
    h = 1 := by
  simp only [← (d.compl _).equiv_snd_eq_self_iff_mem (one_mem _)] at hw hφw
  have hhead : ((d.compl i).equiv (Word.equivPair i w).head).2 =
      (Word.equivPair i w).head := by
    rw [Word.equivPair_head]
    dsimp only
    split_ifs with h
    · rcases h with ⟨_, rfl⟩
      exact hw _ _ (List.head_mem _)
    · rw [equiv_one (d.compl i) (one_mem _) (d.one_mem _)]
  by_contra hh1
  have := hφw i (φ i h * (Word.equivPair i w).head) ?_
  · apply hh1
    rw [equiv_mul_left_of_mem (d.compl i) ⟨_, rfl⟩, hhead] at this
    simpa [((injective_iff_map_eq_one' _).1 (d.injective i))] using this
  · simp only [Word.mem_smul_iff, not_true, false_and, ne_eq, Option.mem_def, mul_right_inj,
      exists_eq_right', mul_right_eq_self, exists_prop, true_and, false_or]
    constructor
    · intro h
      apply_fun (d.compl i).equiv at h
      simp only [Prod.ext_iff, equiv_one (d.compl i) (one_mem _) (d.one_mem _),
        equiv_mul_left_of_mem (d.compl i) ⟨_, rfl⟩ , hhead, Subtype.ext_iff,
        Prod.ext_iff, Subgroup.coe_mul] at h
      rcases h with ⟨h₁, h₂⟩
      rw [h₂, equiv_one (d.compl i) (one_mem _) (d.one_mem _), mul_one,
        ((injective_iff_map_eq_one' _).1 (d.injective i))] at h₁
      contradiction
    · 

Proof state:
case refine_1.right
ι : Type u_1
G : ι → Type u_2
H : Type u_3
K : Type u_4
inst✝⁴ : Monoid K
inst✝³ : (i : ι) → Group (G i)
inst✝² : Group H
φ : (i : ι) → H →* G i
d : Transversal φ
inst✝¹ : DecidableEq ι
inst✝ : (i : ι) → DecidableEq (G i)
w : Word G
i : ι
h : H
hw :
  ∀ (i : ι) (g : G i),
    { fst := i, snd := g } ∈ w.toList →
      ↑((equiv (_ : IsComplement (↑(MonoidHom.range (φ i))) (Transversal.set d i))) g).2 = g
hφw :
  ∀ (j : ι) (g : G j),
    { fst := j, snd := g } ∈ (CoprodI.of ((φ i) h) • w).toList →
      ↑((equiv (_ : IsComplement (↑(MonoidHom.range (φ j))) (Transversal.set d j))) g).2 = g
hhead :
  ↑((equiv (_ : IsComplement (↑(MonoidHom.range (φ i))) (Transversal.set d i))) ((Word.equivPair i) w).head).2 =
    ((Word.equivPair i) w).head
hh1 : ¬h = 1
⊢ { fst := i, snd := (φ i) h * ((Word.equivPair i) w).head } ∈ tail w.toList ∨
    head? w.toList = some { fst := i, snd := ((Word.equivPair i) w).head } ∨
      ¬Word.fstIdx w = some i ∧ ((Word.equivPair i) w).head = 1

Next tactic:
rw [Word.equivPair_head]
/-- Given a word in `CoprodI`, if every letter is in the transversal and when
we multiply by an element of the base group it still has this property,
then the element of the base group we multiplied by was one.  -/
theorem eq_one_of_smul_normalized (w : CoprodI.Word G) {i : ι} (h : H)
    (hw : ∀ i g, ⟨i, g⟩ ∈ w.toList → g ∈ d.set i)
    (hφw : ∀ j g, ⟨j, g⟩ ∈ (CoprodI.of (φ i h) • w).toList → g ∈ d.set j) :
    h = 1 := by
  simp only [← (d.compl _).equiv_snd_eq_self_iff_mem (one_mem _)] at hw hφw
  have hhead : ((d.compl i).equiv (Word.equivPair i w).head).2 =
      (Word.equivPair i w).head := by
    rw [Word.equivPair_head]
    dsimp only
    split_ifs with h
    · rcases h with ⟨_, rfl⟩
      exact hw _ _ (List.head_mem _)
    · rw [equiv_one (d.compl i) (one_mem _) (d.one_mem _)]
  by_contra hh1
  have := hφw i (φ i h * (Word.equivPair i w).head) ?_
  · apply hh1
    rw [equiv_mul_left_of_mem (d.compl i) ⟨_, rfl⟩, hhead] at this
    simpa [((injective_iff_map_eq_one' _).1 (d.injective i))] using this
  · simp only [Word.mem_smul_iff, not_true, false_and, ne_eq, Option.mem_def, mul_right_inj,
      exists_eq_right', mul_right_eq_self, exists_prop, true_and, false_or]
    constructor
    · intro h
      apply_fun (d.compl i).equiv at h
      simp only [Prod.ext_iff, equiv_one (d.compl i) (one_mem _) (d.one_mem _),
        equiv_mul_left_of_mem (d.compl i) ⟨_, rfl⟩ , hhead, Subtype.ext_iff,
        Prod.ext_iff, Subgroup.coe_mul] at h
      rcases h with ⟨h₁, h₂⟩
      rw [h₂, equiv_one (d.compl i) (one_mem _) (d.one_mem _), mul_one,
        ((injective_iff_map_eq_one' _).1 (d.injective i))] at h₁
      contradiction
    · rw [Word.equivPair_head]
      dsimp
      split_ifs with hep
      · 

Proof state:
case pos
ι : Type u_1
G : ι → Type u_2
H : Type u_3
K : Type u_4
inst✝⁴ : Monoid K
inst✝³ : (i : ι) → Group (G i)
inst✝² : Group H
φ : (i : ι) → H →* G i
d : Transversal φ
inst✝¹ : DecidableEq ι
inst✝ : (i : ι) → DecidableEq (G i)
w : Word G
i : ι
h : H
hw :
  ∀ (i : ι) (g : G i),
    { fst := i, snd := g } ∈ w.toList →
      ↑((equiv (_ : IsComplement (↑(MonoidHom.range (φ i))) (Transversal.set d i))) g).2 = g
hφw :
  ∀ (j : ι) (g : G j),
    { fst := j, snd := g } ∈ (CoprodI.of ((φ i) h) • w).toList →
      ↑((equiv (_ : IsComplement (↑(MonoidHom.range (φ j))) (Transversal.set d j))) g).2 = g
hhead :
  ↑((equiv (_ : IsComplement (↑(MonoidHom.range (φ i))) (Transversal.set d i))) ((Word.equivPair i) w).head).2 =
    ((Word.equivPair i) w).head
hh1 : ¬h = 1
hep : ∃ (h : ¬w.toList = []), (List.head w.toList h).fst = i
⊢ { fst := i,
        snd :=
          (φ i) h *
            (_ : (List.head w.toList (_ : ¬w.toList = [])).fst = i) ▸ (List.head w.toList (_ : ¬w.toList = [])).snd } ∈
      tail w.toList ∨
    head? w.toList =
        some
          { fst := i,
            snd :=
              (_ : (List.head w.toList (_ : ¬w.toList = [])).fst = i) ▸
                (List.head w.toList (_ : ¬w.toList = [])).snd } ∨
      ¬Word.fstIdx w = some i ∧
        (_ : (List.head w.toList (_ : ¬w.toList = [])).fst = i) ▸ (List.head w.toList (_ : ¬w.toList = [])).snd = 1

Next tactic:
rcases hep with ⟨hnil, rfl⟩
/-- Given a word in `CoprodI`, if every letter is in the transversal and when
we multiply by an element of the base group it still has this property,
then the element of the base group we multiplied by was one.  -/
theorem eq_one_of_smul_normalized (w : CoprodI.Word G) {i : ι} (h : H)
    (hw : ∀ i g, ⟨i, g⟩ ∈ w.toList → g ∈ d.set i)
    (hφw : ∀ j g, ⟨j, g⟩ ∈ (CoprodI.of (φ i h) • w).toList → g ∈ d.set j) :
    h = 1 := by
  simp only [← (d.compl _).equiv_snd_eq_self_iff_mem (one_mem _)] at hw hφw
  have hhead : ((d.compl i).equiv (Word.equivPair i w).head).2 =
      (Word.equivPair i w).head := by
    rw [Word.equivPair_head]
    dsimp only
    split_ifs with h
    · rcases h with ⟨_, rfl⟩
      exact hw _ _ (List.head_mem _)
    · rw [equiv_one (d.compl i) (one_mem _) (d.one_mem _)]
  by_contra hh1
  have := hφw i (φ i h * (Word.equivPair i w).head) ?_
  · apply hh1
    rw [equiv_mul_left_of_mem (d.compl i) ⟨_, rfl⟩, hhead] at this
    simpa [((injective_iff_map_eq_one' _).1 (d.injective i))] using this
  · simp only [Word.mem_smul_iff, not_true, false_and, ne_eq, Option.mem_def, mul_right_inj,
      exists_eq_right', mul_right_eq_self, exists_prop, true_and, false_or]
    constructor
    · intro h
      apply_fun (d.compl i).equiv at h
      simp only [Prod.ext_iff, equiv_one (d.compl i) (one_mem _) (d.one_mem _),
        equiv_mul_left_of_mem (d.compl i) ⟨_, rfl⟩ , hhead, Subtype.ext_iff,
        Prod.ext_iff, Subgroup.coe_mul] at h
      rcases h with ⟨h₁, h₂⟩
      rw [h₂, equiv_one (d.compl i) (one_mem _) (d.one_mem _), mul_one,
        ((injective_iff_map_eq_one' _).1 (d.injective i))] at h₁
      contradiction
    · rw [Word.equivPair_head]
      dsimp
      split_ifs with hep
      · rcases hep with ⟨hnil, rfl⟩
        rw [head?_eq_head _ hnil]
        simp_all
      · 

Proof state:
case neg
ι : Type u_1
G : ι → Type u_2
H : Type u_3
K : Type u_4
inst✝⁴ : Monoid K
inst✝³ : (i : ι) → Group (G i)
inst✝² : Group H
φ : (i : ι) → H →* G i
d : Transversal φ
inst✝¹ : DecidableEq ι
inst✝ : (i : ι) → DecidableEq (G i)
w : Word G
i : ι
h : H
hw :
  ∀ (i : ι) (g : G i),
    { fst := i, snd := g } ∈ w.toList →
      ↑((equiv (_ : IsComplement (↑(MonoidHom.range (φ i))) (Transversal.set d i))) g).2 = g
hφw :
  ∀ (j : ι) (g : G j),
    { fst := j, snd := g } ∈ (CoprodI.of ((φ i) h) • w).toList →
      ↑((equiv (_ : IsComplement (↑(MonoidHom.range (φ j))) (Transversal.set d j))) g).2 = g
hhead :
  ↑((equiv (_ : IsComplement (↑(MonoidHom.range (φ i))) (Transversal.set d i))) ((Word.equivPair i) w).head).2 =
    ((Word.equivPair i) w).head
hh1 : ¬h = 1
hep : ¬∃ (h : ¬w.toList = []), (List.head w.toList h).fst = i
⊢ { fst := i, snd := (φ i) h * 1 } ∈ tail w.toList ∨
    head? w.toList = some { fst := i, snd := 1 } ∨ ¬Word.fstIdx w = some i ∧ 1 = 1

Next tactic:
push_neg at hep
/-- Given a word in `CoprodI`, if every letter is in the transversal and when
we multiply by an element of the base group it still has this property,
then the element of the base group we multiplied by was one.  -/
theorem eq_one_of_smul_normalized (w : CoprodI.Word G) {i : ι} (h : H)
    (hw : ∀ i g, ⟨i, g⟩ ∈ w.toList → g ∈ d.set i)
    (hφw : ∀ j g, ⟨j, g⟩ ∈ (CoprodI.of (φ i h) • w).toList → g ∈ d.set j) :
    h = 1 := by
  simp only [← (d.compl _).equiv_snd_eq_self_iff_mem (one_mem _)] at hw hφw
  have hhead : ((d.compl i).equiv (Word.equivPair i w).head).2 =
      (Word.equivPair i w).head := by
    rw [Word.equivPair_head]
    dsimp only
    split_ifs with h
    · rcases h with ⟨_, rfl⟩
      exact hw _ _ (List.head_mem _)
    · rw [equiv_one (d.compl i) (one_mem _) (d.one_mem _)]
  by_contra hh1
  have := hφw i (φ i h * (Word.equivPair i w).head) ?_
  · apply hh1
    rw [equiv_mul_left_of_mem (d.compl i) ⟨_, rfl⟩, hhead] at this
    simpa [((injective_iff_map_eq_one' _).1 (d.injective i))] using this
  · simp only [Word.mem_smul_iff, not_true, false_and, ne_eq, Option.mem_def, mul_right_inj,
      exists_eq_right', mul_right_eq_self, exists_prop, true_and, false_or]
    constructor
    · intro h
      apply_fun (d.compl i).equiv at h
      simp only [Prod.ext_iff, equiv_one (d.compl i) (one_mem _) (d.one_mem _),
        equiv_mul_left_of_mem (d.compl i) ⟨_, rfl⟩ , hhead, Subtype.ext_iff,
        Prod.ext_iff, Subgroup.coe_mul] at h
      rcases h with ⟨h₁, h₂⟩
      rw [h₂, equiv_one (d.compl i) (one_mem _) (d.one_mem _), mul_one,
        ((injective_iff_map_eq_one' _).1 (d.injective i))] at h₁
      contradiction
    · rw [Word.equivPair_head]
      dsimp
      split_ifs with hep
      · rcases hep with ⟨hnil, rfl⟩
        rw [head?_eq_head _ hnil]
        simp_all
      · push_neg at hep
        

Proof state:
case neg
ι : Type u_1
G : ι → Type u_2
H : Type u_3
K : Type u_4
inst✝⁴ : Monoid K
inst✝³ : (i : ι) → Group (G i)
inst✝² : Group H
φ : (i : ι) → H →* G i
d : Transversal φ
inst✝¹ : DecidableEq ι
inst✝ : (i : ι) → DecidableEq (G i)
w : Word G
i : ι
h : H
hw :
  ∀ (i : ι) (g : G i),
    { fst := i, snd := g } ∈ w.toList →
      ↑((equiv (_ : IsComplement (↑(MonoidHom.range (φ i))) (Transversal.set d i))) g).2 = g
hφw :
  ∀ (j : ι) (g : G j),
    { fst := j, snd := g } ∈ (CoprodI.of ((φ i) h) • w).toList →
      ↑((equiv (_ : IsComplement (↑(MonoidHom.range (φ j))) (Transversal.set d j))) g).2 = g
hhead :
  ↑((equiv (_ : IsComplement (↑(MonoidHom.range (φ i))) (Transversal.set d i))) ((Word.equivPair i) w).head).2 =
    ((Word.equivPair i) w).head
hh1 : ¬h = 1
hep : ∀ (h : ¬w.toList = []), (List.head w.toList h).fst ≠ i
⊢ { fst := i, snd := (φ i) h * 1 } ∈ tail w.toList ∨
    head? w.toList = some { fst := i, snd := 1 } ∨ ¬Word.fstIdx w = some i ∧ 1 = 1

Next tactic:
by_cases hw : w.toList = []
/-- Given a word in `CoprodI`, if every letter is in the transversal and when
we multiply by an element of the base group it still has this property,
then the element of the base group we multiplied by was one.  -/
theorem eq_one_of_smul_normalized (w : CoprodI.Word G) {i : ι} (h : H)
    (hw : ∀ i g, ⟨i, g⟩ ∈ w.toList → g ∈ d.set i)
    (hφw : ∀ j g, ⟨j, g⟩ ∈ (CoprodI.of (φ i h) • w).toList → g ∈ d.set j) :
    h = 1 := by
  simp only [← (d.compl _).equiv_snd_eq_self_iff_mem (one_mem _)] at hw hφw
  have hhead : ((d.compl i).equiv (Word.equivPair i w).head).2 =
      (Word.equivPair i w).head := by
    rw [Word.equivPair_head]
    dsimp only
    split_ifs with h
    · rcases h with ⟨_, rfl⟩
      exact hw _ _ (List.head_mem _)
    · rw [equiv_one (d.compl i) (one_mem _) (d.one_mem _)]
  by_contra hh1
  have := hφw i (φ i h * (Word.equivPair i w).head) ?_
  · apply hh1
    rw [equiv_mul_left_of_mem (d.compl i) ⟨_, rfl⟩, hhead] at this
    simpa [((injective_iff_map_eq_one' _).1 (d.injective i))] using this
  · simp only [Word.mem_smul_iff, not_true, false_and, ne_eq, Option.mem_def, mul_right_inj,
      exists_eq_right', mul_right_eq_self, exists_prop, true_and, false_or]
    constructor
    · intro h
      apply_fun (d.compl i).equiv at h
      simp only [Prod.ext_iff, equiv_one (d.compl i) (one_mem _) (d.one_mem _),
        equiv_mul_left_of_mem (d.compl i) ⟨_, rfl⟩ , hhead, Subtype.ext_iff,
        Prod.ext_iff, Subgroup.coe_mul] at h
      rcases h with ⟨h₁, h₂⟩
      rw [h₂, equiv_one (d.compl i) (one_mem _) (d.one_mem _), mul_one,
        ((injective_iff_map_eq_one' _).1 (d.injective i))] at h₁
      contradiction
    · rw [Word.equivPair_head]
      dsimp
      split_ifs with hep
      · rcases hep with ⟨hnil, rfl⟩
        rw [head?_eq_head _ hnil]
        simp_all
      · push_neg at hep
        by_cases hw : w.toList = []
        · 

Proof state:
case pos
ι : Type u_1
G : ι → Type u_2
H : Type u_3
K : Type u_4
inst✝⁴ : Monoid K
inst✝³ : (i : ι) → Group (G i)
inst✝² : Group H
φ : (i : ι) → H →* G i
d : Transversal φ
inst✝¹ : DecidableEq ι
inst✝ : (i : ι) → DecidableEq (G i)
w : Word G
i : ι
h : H
hw✝ :
  ∀ (i : ι) (g : G i),
    { fst := i, snd := g } ∈ w.toList →
      ↑((equiv (_ : IsComplement (↑(MonoidHom.range (φ i))) (Transversal.set d i))) g).2 = g
hφw :
  ∀ (j : ι) (g : G j),
    { fst := j, snd := g } ∈ (CoprodI.of ((φ i) h) • w).toList →
      ↑((equiv (_ : IsComplement (↑(MonoidHom.range (φ j))) (Transversal.set d j))) g).2 = g
hhead :
  ↑((equiv (_ : IsComplement (↑(MonoidHom.range (φ i))) (Transversal.set d i))) ((Word.equivPair i) w).head).2 =
    ((Word.equivPair i) w).head
hh1 : ¬h = 1
hep : ∀ (h : ¬w.toList = []), (List.head w.toList h).fst ≠ i
hw : w.toList = []
⊢ { fst := i, snd := (φ i) h * 1 } ∈ tail w.toList ∨
    head? w.toList = some { fst := i, snd := 1 } ∨ ¬Word.fstIdx w = some i ∧ 1 = 1

Next tactic:
simp [hw, Word.fstIdx]
/-- Given a word in `CoprodI`, if every letter is in the transversal and when
we multiply by an element of the base group it still has this property,
then the element of the base group we multiplied by was one.  -/
theorem eq_one_of_smul_normalized (w : CoprodI.Word G) {i : ι} (h : H)
    (hw : ∀ i g, ⟨i, g⟩ ∈ w.toList → g ∈ d.set i)
    (hφw : ∀ j g, ⟨j, g⟩ ∈ (CoprodI.of (φ i h) • w).toList → g ∈ d.set j) :
    h = 1 := by
  simp only [← (d.compl _).equiv_snd_eq_self_iff_mem (one_mem _)] at hw hφw
  have hhead : ((d.compl i).equiv (Word.equivPair i w).head).2 =
      (Word.equivPair i w).head := by
    rw [Word.equivPair_head]
    dsimp only
    split_ifs with h
    · rcases h with ⟨_, rfl⟩
      exact hw _ _ (List.head_mem _)
    · rw [equiv_one (d.compl i) (one_mem _) (d.one_mem _)]
  by_contra hh1
  have := hφw i (φ i h * (Word.equivPair i w).head) ?_
  · apply hh1
    rw [equiv_mul_left_of_mem (d.compl i) ⟨_, rfl⟩, hhead] at this
    simpa [((injective_iff_map_eq_one' _).1 (d.injective i))] using this
  · simp only [Word.mem_smul_iff, not_true, false_and, ne_eq, Option.mem_def, mul_right_inj,
      exists_eq_right', mul_right_eq_self, exists_prop, true_and, false_or]
    constructor
    · intro h
      apply_fun (d.compl i).equiv at h
      simp only [Prod.ext_iff, equiv_one (d.compl i) (one_mem _) (d.one_mem _),
        equiv_mul_left_of_mem (d.compl i) ⟨_, rfl⟩ , hhead, Subtype.ext_iff,
        Prod.ext_iff, Subgroup.coe_mul] at h
      rcases h with ⟨h₁, h₂⟩
      rw [h₂, equiv_one (d.compl i) (one_mem _) (d.one_mem _), mul_one,
        ((injective_iff_map_eq_one' _).1 (d.injective i))] at h₁
      contradiction
    · rw [Word.equivPair_head]
      dsimp
      split_ifs with hep
      · rcases hep with ⟨hnil, rfl⟩
        rw [head?_eq_head _ hnil]
        simp_all
      · push_neg at hep
        by_cases hw : w.toList = []
        · simp [hw, Word.fstIdx]
        · 

Proof state:
case neg
ι : Type u_1
G : ι → Type u_2
H : Type u_3
K : Type u_4
inst✝⁴ : Monoid K
inst✝³ : (i : ι) → Group (G i)
inst✝² : Group H
φ : (i : ι) → H →* G i
d : Transversal φ
inst✝¹ : DecidableEq ι
inst✝ : (i : ι) → DecidableEq (G i)
w : Word G
i : ι
h : H
hw✝ :
  ∀ (i : ι) (g : G i),
    { fst := i, snd := g } ∈ w.toList →
      ↑((equiv (_ : IsComplement (↑(MonoidHom.range (φ i))) (Transversal.set d i))) g).2 = g
hφw :
  ∀ (j : ι) (g : G j),
    { fst := j, snd := g } ∈ (CoprodI.of ((φ i) h) • w).toList →
      ↑((equiv (_ : IsComplement (↑(MonoidHom.range (φ j))) (Transversal.set d j))) g).2 = g
hhead :
  ↑((equiv (_ : IsComplement (↑(MonoidHom.range (φ i))) (Transversal.set d i))) ((Word.equivPair i) w).head).2 =
    ((Word.equivPair i) w).head
hh1 : ¬h = 1
hep : ∀ (h : ¬w.toList = []), (List.head w.toList h).fst ≠ i
hw : ¬w.toList = []
⊢ { fst := i, snd := (φ i) h * 1 } ∈ tail w.toList ∨
    head? w.toList = some { fst := i, snd := 1 } ∨ ¬Word.fstIdx w = some i ∧ 1 = 1

Next tactic:
simp [head?_eq_head _ hw, Word.fstIdx, hep hw]
theorem ext_smul {w₁ w₂ : NormalWord d} (i : ι)
    (h : CoprodI.of (φ i w₁.head) • w₁.toWord =
         CoprodI.of (φ i w₂.head) • w₂.toWord) :
    w₁ = w₂ := by
  

Proof state:
ι : Type u_1
G : ι → Type u_2
H : Type u_3
K : Type u_4
inst✝⁴ : Monoid K
inst✝³ : (i : ι) → Group (G i)
inst✝² : Group H
φ : (i : ι) → H →* G i
d : Transversal φ
inst✝¹ : DecidableEq ι
inst✝ : (i : ι) → DecidableEq (G i)
w₁ w₂ : NormalWord d
i : ι
h : CoprodI.of ((φ i) w₁.head) • w₁.toWord = CoprodI.of ((φ i) w₂.head) • w₂.toWord
⊢ w₁ = w₂

Next tactic:
rcases w₁ with ⟨w₁, h₁, hw₁⟩
theorem ext_smul {w₁ w₂ : NormalWord d} (i : ι)
    (h : CoprodI.of (φ i w₁.head) • w₁.toWord =
         CoprodI.of (φ i w₂.head) • w₂.toWord) :
    w₁ = w₂ := by
  rcases w₁ with ⟨w₁, h₁, hw₁⟩
  

Proof state:
case mk
ι : Type u_1
G : ι → Type u_2
H : Type u_3
K : Type u_4
inst✝⁴ : Monoid K
inst✝³ : (i : ι) → Group (G i)
inst✝² : Group H
φ : (i : ι) → H →* G i
d : Transversal φ
inst✝¹ : DecidableEq ι
inst✝ : (i : ι) → DecidableEq (G i)
w₂ : NormalWord d
i : ι
w₁ : Word fun i => G i
h₁ : H
hw₁ : ∀ (i : ι) (g : G i), { fst := i, snd := g } ∈ w₁.toList → g ∈ Transversal.set d i
h :
  CoprodI.of ((φ i) { toWord := w₁, head := h₁, normalized := hw₁ }.head) •
      { toWord := w₁, head := h₁, normalized := hw₁ }.toWord =
    CoprodI.of ((φ i) w₂.head) • w₂.toWord
⊢ { toWord := w₁, head := h₁, normalized := hw₁ } = w₂

Next tactic:
rcases w₂ with ⟨w₂, h₂, hw₂⟩
theorem ext_smul {w₁ w₂ : NormalWord d} (i : ι)
    (h : CoprodI.of (φ i w₁.head) • w₁.toWord =
         CoprodI.of (φ i w₂.head) • w₂.toWord) :
    w₁ = w₂ := by
  rcases w₁ with ⟨w₁, h₁, hw₁⟩
  rcases w₂ with ⟨w₂, h₂, hw₂⟩
  

Proof state:
case mk.mk
ι : Type u_1
G : ι → Type u_2
H : Type u_3
K : Type u_4
inst✝⁴ : Monoid K
inst✝³ : (i : ι) → Group (G i)
inst✝² : Group H
φ : (i : ι) → H →* G i
d : Transversal φ
inst✝¹ : DecidableEq ι
inst✝ : (i : ι) → DecidableEq (G i)
i : ι
w₁ : Word fun i => G i
h₁ : H
hw₁ : ∀ (i : ι) (g : G i), { fst := i, snd := g } ∈ w₁.toList → g ∈ Transversal.set d i
w₂ : Word fun i => G i
h₂ : H
hw₂ : ∀ (i : ι) (g : G i), { fst := i, snd := g } ∈ w₂.toList → g ∈ Transversal.set d i
h :
  CoprodI.of ((φ i) { toWord := w₁, head := h₁, normalized := hw₁ }.head) •
      { toWord := w₁, head := h₁, normalized := hw₁ }.toWord =
    CoprodI.of ((φ i) { toWord := w₂, head := h₂, normalized := hw₂ }.head) •
      { toWord := w₂, head := h₂, normalized := hw₂ }.toWord
⊢ { toWord := w₁, head := h₁, normalized := hw₁ } = { toWord := w₂, head := h₂, normalized := hw₂ }

Next tactic:
dsimp at *
theorem ext_smul {w₁ w₂ : NormalWord d} (i : ι)
    (h : CoprodI.of (φ i w₁.head) • w₁.toWord =
         CoprodI.of (φ i w₂.head) • w₂.toWord) :
    w₁ = w₂ := by
  rcases w₁ with ⟨w₁, h₁, hw₁⟩
  rcases w₂ with ⟨w₂, h₂, hw₂⟩
  dsimp at *
  

Proof state:
case mk.mk
ι : Type u_1
G : ι → Type u_2
H : Type u_3
K : Type u_4
inst✝⁴ : Monoid K
inst✝³ : (i : ι) → Group (G i)
inst✝² : Group H
φ : (i : ι) → H →* G i
d : Transversal φ
inst✝¹ : DecidableEq ι
inst✝ : (i : ι) → DecidableEq (G i)
i : ι
w₁ : Word fun i => G i
h₁ : H
hw₁ : ∀ (i : ι) (g : G i), { fst := i, snd := g } ∈ w₁.toList → g ∈ Transversal.set d i
w₂ : Word fun i => G i
h₂ : H
hw₂ : ∀ (i : ι) (g : G i), { fst := i, snd := g } ∈ w₂.toList → g ∈ Transversal.set d i
h : CoprodI.of ((φ i) h₁) • w₁ = CoprodI.of ((φ i) h₂) • w₂
⊢ { toWord := w₁, head := h₁, normalized := hw₁ } = { toWord := w₂, head := h₂, normalized := hw₂ }

Next tactic:
rw [smul_eq_iff_eq_inv_smul, ← mul_smul] at h
theorem ext_smul {w₁ w₂ : NormalWord d} (i : ι)
    (h : CoprodI.of (φ i w₁.head) • w₁.toWord =
         CoprodI.of (φ i w₂.head) • w₂.toWord) :
    w₁ = w₂ := by
  rcases w₁ with ⟨w₁, h₁, hw₁⟩
  rcases w₂ with ⟨w₂, h₂, hw₂⟩
  dsimp at *
  rw [smul_eq_iff_eq_inv_smul, ← mul_smul] at h
  

Proof state:
case mk.mk
ι : Type u_1
G : ι → Type u_2
H : Type u_3
K : Type u_4
inst✝⁴ : Monoid K
inst✝³ : (i : ι) → Group (G i)
inst✝² : Group H
φ : (i : ι) → H →* G i
d : Transversal φ
inst✝¹ : DecidableEq ι
inst✝ : (i : ι) → DecidableEq (G i)
i : ι
w₁ : Word fun i => G i
h₁ : H
hw₁ : ∀ (i : ι) (g : G i), { fst := i, snd := g } ∈ w₁.toList → g ∈ Transversal.set d i
w₂ : Word fun i => G i
h₂ : H
hw₂ : ∀ (i : ι) (g : G i), { fst := i, snd := g } ∈ w₂.toList → g ∈ Transversal.set d i
h : w₁ = ((CoprodI.of ((φ i) h₁))⁻¹ * CoprodI.of ((φ i) h₂)) • w₂
⊢ { toWord := w₁, head := h₁, normalized := hw₁ } = { toWord := w₂, head := h₂, normalized := hw₂ }

Next tactic:
subst h
theorem ext_smul {w₁ w₂ : NormalWord d} (i : ι)
    (h : CoprodI.of (φ i w₁.head) • w₁.toWord =
         CoprodI.of (φ i w₂.head) • w₂.toWord) :
    w₁ = w₂ := by
  rcases w₁ with ⟨w₁, h₁, hw₁⟩
  rcases w₂ with ⟨w₂, h₂, hw₂⟩
  dsimp at *
  rw [smul_eq_iff_eq_inv_smul, ← mul_smul] at h
  subst h
  

Proof state:
case mk.mk
ι : Type u_1
G : ι → Type u_2
H : Type u_3
K : Type u_4
inst✝⁴ : Monoid K
inst✝³ : (i : ι) → Group (G i)
inst✝² : Group H
φ : (i : ι) → H →* G i
d : Transversal φ
inst✝¹ : DecidableEq ι
inst✝ : (i : ι) → DecidableEq (G i)
i : ι
h₁ : H
w₂ : Word fun i => G i
h₂ : H
hw₂ : ∀ (i : ι) (g : G i), { fst := i, snd := g } ∈ w₂.toList → g ∈ Transversal.set d i
hw₁ :
  ∀ (i_1 : ι) (g : G i_1),
    { fst := i_1, snd := g } ∈ (((CoprodI.of ((φ i) h₁))⁻¹ * CoprodI.of ((φ i) h₂)) • w₂).toList →
      g ∈ Transversal.set d i_1
⊢ { toWord := ((CoprodI.of ((φ i) h₁))⁻¹ * CoprodI.of ((φ i) h₂)) • w₂, head := h₁, normalized := hw₁ } =
    { toWord := w₂, head := h₂, normalized := hw₂ }

Next tactic:
simp only [← map_inv, ← map_mul] at hw₁
theorem ext_smul {w₁ w₂ : NormalWord d} (i : ι)
    (h : CoprodI.of (φ i w₁.head) • w₁.toWord =
         CoprodI.of (φ i w₂.head) • w₂.toWord) :
    w₁ = w₂ := by
  rcases w₁ with ⟨w₁, h₁, hw₁⟩
  rcases w₂ with ⟨w₂, h₂, hw₂⟩
  dsimp at *
  rw [smul_eq_iff_eq_inv_smul, ← mul_smul] at h
  subst h
  simp only [← map_inv, ← map_mul] at hw₁
  

Proof state:
case mk.mk
ι : Type u_1
G : ι → Type u_2
H : Type u_3
K : Type u_4
inst✝⁴ : Monoid K
inst✝³ : (i : ι) → Group (G i)
inst✝² : Group H
φ : (i : ι) → H →* G i
d : Transversal φ
inst✝¹ : DecidableEq ι
inst✝ : (i : ι) → DecidableEq (G i)
i : ι
h₁ : H
w₂ : Word fun i => G i
h₂ : H
hw₂ : ∀ (i : ι) (g : G i), { fst := i, snd := g } ∈ w₂.toList → g ∈ Transversal.set d i
hw₁✝ :
  ∀ (i_1 : ι) (g : G i_1),
    { fst := i_1, snd := g } ∈ (((CoprodI.of ((φ i) h₁))⁻¹ * CoprodI.of ((φ i) h₂)) • w₂).toList →
      g ∈ Transversal.set d i_1
hw₁ :
  ∀ (i_1 : ι) (g : G i_1),
    { fst := i_1, snd := g } ∈ (CoprodI.of ((φ i) (h₁⁻¹ * h₂)) • w₂).toList → g ∈ Transversal.set d i_1
⊢ { toWord := ((CoprodI.of ((φ i) h₁))⁻¹ * CoprodI.of ((φ i) h₂)) • w₂, head := h₁, normalized := hw₁✝ } =
    { toWord := w₂, head := h₂, normalized := hw₂ }

Next tactic:
have : h₁⁻¹ * h₂ = 1 := eq_one_of_smul_normalized w₂ (h₁⁻¹ * h₂) hw₂ hw₁