l3lab/ntp-mathlib huggingface dataset:
theorem induction_on {motive : PushoutI φ → Prop}
    (x : PushoutI φ)
    (of  : ∀ (i : ι) (g : G i), motive (of i g))
    (base : ∀ h, motive (base φ h))
    (mul : ∀ x y, motive x → motive y → motive (x * y)) : motive x := by
  delta PushoutI PushoutI.of PushoutI.base at *
  induction x using Con.induction_on with
  | H x =>
    induction x using Coprod.induction_on with
    | inl g =>
      induction g using CoprodI.induction_on with
      | h_of i g => exact of i g
      | h_mul x y ihx ihy =>
        rw [map_mul]
        exact mul _ _ ihx ihy
      | h_one => simpa using base 1
    | inr h => exact base h
    | mul x y ihx ihy => 

Proof state:
case H.mul
ι : Type u_1
G : ι → Type u_2
H : Type u_3
K : Type u_4
inst✝² : Monoid K
inst✝¹ : (i : ι) → Monoid (G i)
inst✝ : Monoid H
φ : (i : ι) → H →* G i
motive : Con.Quotient (con φ) → Prop
of : ∀ (i : ι) (g : G i), motive ((MonoidHom.comp (Con.mk' (con φ)) (MonoidHom.comp inl CoprodI.of)) g)
base : ∀ (h : H), motive ((MonoidHom.comp (Con.mk' (con φ)) inr) h)
mul : ∀ (x y : Con.Quotient (con φ)), motive x → motive y → motive (x * y)
x y : (CoprodI fun i => (fun i => G i) i) ∗ H
ihx : motive ↑x
ihy : motive ↑y
⊢ motive ↑(x * y)

Next tactic:
exact mul _ _ ihx ihy
theorem transversal_nonempty (hφ : ∀ i, Injective (φ i)) : Nonempty (Transversal φ) := 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
hφ : ∀ (i : ι), Injective ⇑(φ i)
⊢ Nonempty (Transversal φ)

Next tactic:
choose t ht using fun i => (φ i).range.exists_right_transversal 1
theorem transversal_nonempty (hφ : ∀ i, Injective (φ i)) : Nonempty (Transversal φ) := by
  choose t ht using fun i => (φ i).range.exists_right_transversal 1
  

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
hφ : ∀ (i : ι), Injective ⇑(φ i)
t : (i : ι) → Set (G i)
ht : ∀ (i : ι), t i ∈ rightTransversals ↑(MonoidHom.range (φ i)) ∧ 1 ∈ t i
⊢ Nonempty (Transversal φ)

Next tactic:
apply Nonempty.intro
theorem transversal_nonempty (hφ : ∀ i, Injective (φ i)) : Nonempty (Transversal φ) := by
  choose t ht using fun i => (φ i).range.exists_right_transversal 1
  apply Nonempty.intro
  

Proof state:
case val
ι : 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
hφ : ∀ (i : ι), Injective ⇑(φ i)
t : (i : ι) → Set (G i)
ht : ∀ (i : ι), t i ∈ rightTransversals ↑(MonoidHom.range (φ i)) ∧ 1 ∈ t i
⊢ Transversal φ

Next tactic:
exact
    { injective := hφ
      set := t
      one_mem := fun i => (ht i).2
      compl := fun i => (ht i).1 }
/-- The empty normalized word, representing the identity element of the group. -/
@[simps!]
def empty : NormalWord d := ⟨CoprodI.Word.empty, 1, fun i g => 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 φ
i : ι
g : G i
⊢ { fst := i, snd := g } ∈ Word.empty.toList → g ∈ Transversal.set d i

Next tactic:
simp [CoprodI.Word.empty]
instance (i : ι) : Inhabited (Pair d i) :=
  ⟨{ (empty : NormalWord d) with
      head := 1,
      fstIdx_ne := fun h => 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 φ
i : ι
src✝ : NormalWord d := empty
h : Word.fstIdx Word.empty = some i
⊢ False

Next tactic:
cases h
@[ext]
theorem ext {w₁ w₂ : NormalWord d} (hhead : w₁.head = w₂.head)
    (hlist : w₁.toList = w₂.toList) : 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
hhead : w₁.head = w₂.head
hlist : w₁.toList = w₂.toList
⊢ w₁ = w₂

Next tactic:
rcases w₁ with ⟨⟨_, _, _⟩, _, _⟩
@[ext]
theorem ext {w₁ w₂ : NormalWord d} (hhead : w₁.head = w₂.head)
    (hlist : w₁.toList = w₂.toList) : w₁ = w₂ := by
  rcases w₁ with ⟨⟨_, _, _⟩, _, _⟩
  

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)
w₂ : NormalWord d
head✝ : H
toList✝ : List ((i : ι) × G i)
ne_one✝ : ∀ l ∈ toList✝, l.snd ≠ 1
chain_ne✝ : Chain' (fun l l' => l.fst ≠ l'.fst) toList✝
normalized✝ :
  ∀ (i : ι) (g : G i),
    { fst := i, snd := g } ∈ { toList := toList✝, ne_one := ne_one✝, chain_ne := chain_ne✝ }.toList →
      g ∈ Transversal.set d i
hhead :
  { toWord := { toList := toList✝, ne_one := ne_one✝, chain_ne := chain_ne✝ }, head := head✝,
        normalized := normalized✝ }.head =
    w₂.head
hlist :
  { toWord := { toList := toList✝, ne_one := ne_one✝, chain_ne := chain_ne✝ }, head := head✝,
          normalized := normalized✝ }.toWord.toList =
    w₂.toList
⊢ { toWord := { toList := toList✝, ne_one := ne_one✝, chain_ne := chain_ne✝ }, head := head✝,
      normalized := normalized✝ } =
    w₂

Next tactic:
rcases w₂ with ⟨⟨_, _, _⟩, _, _⟩
@[ext]
theorem ext {w₁ w₂ : NormalWord d} (hhead : w₁.head = w₂.head)
    (hlist : w₁.toList = w₂.toList) : w₁ = w₂ := by
  rcases w₁ with ⟨⟨_, _, _⟩, _, _⟩
  rcases w₂ with ⟨⟨_, _, _⟩, _, _⟩
  

Proof state:
case mk.mk.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)
head✝¹ : H
toList✝¹ : List ((i : ι) × G i)
ne_one✝¹ : ∀ l ∈ toList✝¹, l.snd ≠ 1
chain_ne✝¹ : Chain' (fun l l' => l.fst ≠ l'.fst) toList✝¹
normalized✝¹ :
  ∀ (i : ι) (g : G i),
    { fst := i, snd := g } ∈ { toList := toList✝¹, ne_one := ne_one✝¹, chain_ne := chain_ne✝¹ }.toList →
      g ∈ Transversal.set d i
head✝ : H
toList✝ : List ((i : ι) × G i)
ne_one✝ : ∀ l ∈ toList✝, l.snd ≠ 1
chain_ne✝ : Chain' (fun l l' => l.fst ≠ l'.fst) toList✝
normalized✝ :
  ∀ (i : ι) (g : G i),
    { fst := i, snd := g } ∈ { toList := toList✝, ne_one := ne_one✝, chain_ne := chain_ne✝ }.toList →
      g ∈ Transversal.set d i
hhead :
  { toWord := { toList := toList✝¹, ne_one := ne_one✝¹, chain_ne := chain_ne✝¹ }, head := head✝¹,
        normalized := normalized✝¹ }.head =
    { toWord := { toList := toList✝, ne_one := ne_one✝, chain_ne := chain_ne✝ }, head := head✝,
        normalized := normalized✝ }.head
hlist :
  { toWord := { toList := toList✝¹, ne_one := ne_one✝¹, chain_ne := chain_ne✝¹ }, head := head✝¹,
          normalized := normalized✝¹ }.toWord.toList =
    { toWord := { toList := toList✝, ne_one := ne_one✝, chain_ne := chain_ne✝ }, head := head✝,
          normalized := normalized✝ }.toWord.toList
⊢ { toWord := { toList := toList✝¹, ne_one := ne_one✝¹, chain_ne := chain_ne✝¹ }, head := head✝¹,
      normalized := normalized✝¹ } =
    { toWord := { toList := toList✝, ne_one := ne_one✝, chain_ne := chain_ne✝ }, head := head✝,
      normalized := normalized✝ }

Next tactic:
simp_all
theorem ext_iff {w₁ w₂ : NormalWord d} : w₁ = w₂ ↔ w₁.head = w₂.head ∧ w₁.toList = w₂.toList :=
  ⟨fun h => 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
h : w₁ = w₂
⊢ w₁.head = w₂.head ∧ w₁.toList = w₂.toList

Next tactic:
simp [h]
/-- 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
  

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 : Word G
i : ι
h : H
hw : ∀ (i : ι) (g : G i), { fst := i, snd := g } ∈ w.toList → g ∈ Transversal.set d i
hφw : ∀ (j : ι) (g : G j), { fst := j, snd := g } ∈ (CoprodI.of ((φ i) h) • w).toList → g ∈ Transversal.set d j
⊢ h = 1

Next tactic:
simp only [← (d.compl _).equiv_snd_eq_self_iff_mem (one_mem _)] at hw hφw
/-- 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
  

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 : 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
⊢ h = 1

Next tactic:
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 _)]
/-- 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
    

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 : 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
⊢ ↑((equiv (_ : IsComplement (↑(MonoidHom.range (φ i))) (Transversal.set d i))) ((Word.equivPair i) w).head).2 =
    ((Word.equivPair i) w).head

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]
    

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 : 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
⊢ ↑((equiv (_ : IsComplement (↑(MonoidHom.range (φ i))) (Transversal.set d i)))
          (if h : ∃ (h : w.toList ≠ []), (List.head w.toList h).fst = i then
            (_ : (List.head w.toList (_ : w.toList ≠ [])).fst = i) ▸ (List.head w.toList (_ : w.toList ≠ [])).snd
          else 1)).2 =
    if h : ∃ (h : w.toList ≠ []), (List.head w.toList h).fst = i then
      (_ : (List.head w.toList (_ : w.toList ≠ [])).fst = i) ▸ (List.head w.toList (_ : w.toList ≠ [])).snd
    else 1

Next tactic:
dsimp only
/-- 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
    

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 : 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
⊢ ↑((equiv (_ : IsComplement (↑(MonoidHom.range (φ i))) (Transversal.set d i)))
          (if h : ∃ (h : w.toList ≠ []), (List.head w.toList h).fst = i then
            (_ : (List.head w.toList (_ : w.toList ≠ [])).fst = i) ▸ (List.head w.toList (_ : w.toList ≠ [])).snd
          else 1)).2 =
    if h : ∃ (h : w.toList ≠ []), (List.head w.toList h).fst = i then
      (_ : (List.head w.toList (_ : w.toList ≠ [])).fst = i) ▸ (List.head w.toList (_ : w.toList ≠ [])).snd
    else 1

Next tactic:
split_ifs with h
/-- 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
    · 

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
h : ∃ (h : w.toList ≠ []), (List.head w.toList h).fst = i
⊢ ↑((equiv (_ : IsComplement (↑(MonoidHom.range (φ i))) (Transversal.set d i)))
          ((_ : (List.head w.toList (_ : w.toList ≠ [])).fst = i) ▸ (List.head w.toList (_ : w.toList ≠ [])).snd)).2 =
    (_ : (List.head w.toList (_ : w.toList ≠ [])).fst = i) ▸ (List.head w.toList (_ : w.toList ≠ [])).snd

Next tactic:
rcases h with ⟨_, 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⟩
      

Proof state:
case pos.intro
ι : 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
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
w✝ : w.toList ≠ []
hφw :
  ∀ (j : ι) (g : G j),
    { fst := j, snd := g } ∈ (CoprodI.of ((φ (List.head w.toList w✝).fst) h) • w).toList →
      ↑((equiv (_ : IsComplement (↑(MonoidHom.range (φ j))) (Transversal.set d j))) g).2 = g
⊢ ↑((equiv
            (_ :
              IsComplement (↑(MonoidHom.range (φ (List.head w.toList w✝).fst)))
                (Transversal.set d (List.head w.toList w✝).fst)))
          ((_ : (List.head w.toList (_ : w.toList ≠ [])).fst = (List.head w.toList w✝).fst) ▸
            (List.head w.toList (_ : w.toList ≠ [])).snd)).2 =
    (_ : (List.head w.toList (_ : w.toList ≠ [])).fst = (List.head w.toList w✝).fst) ▸
      (List.head w.toList (_ : w.toList ≠ [])).snd

Next tactic:
exact hw _ _ (List.head_mem _)
/-- 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 _)
    · 

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
h : ¬∃ (h : w.toList ≠ []), (List.head w.toList h).fst = i
⊢ ↑((equiv (_ : IsComplement (↑(MonoidHom.range (φ i))) (Transversal.set d i))) 1).2 = 1

Next tactic:
rw [equiv_one (d.compl i) (one_mem _) (d.one_mem _)]
/-- 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 _)]
  

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 : 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
⊢ h = 1

Next tactic:
by_contra hh1
/-- 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
  

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 : 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
⊢ False

Next tactic:
have := hφw i (φ i h * (Word.equivPair i w).head) ?_