l3lab/ntp-mathlib huggingface dataset:
@[elab_as_elim]
theorem induction_on {motive : HNNExtension G A B φ → Prop}
    (x : HNNExtension G A B φ) (of : ∀ g, motive (of g))
    (t : motive t) (mul : ∀ x y, motive x → motive y → motive (x * y))
    (inv : ∀ x, motive x → motive x⁻¹) : motive x := by
  let S : Subgroup (HNNExtension G A B φ) :=
    { carrier := setOf motive
      one_mem' := by simpa using of 1
      mul_mem' := mul _ _
      inv_mem' := inv _ }
  let f : HNNExtension G A B φ →* S :=
    lift (HNNExtension.of.codRestrict S of)
      ⟨HNNExtension.t, t⟩ (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
motive : HNNExtension G A B φ → Prop
x : HNNExtension G A B φ
of : ∀ (g : G), motive (HNNExtension.of g)
t : motive HNNExtension.t
mul : ∀ (x y : HNNExtension G A B φ), motive x → motive y → motive (x * y)
inv : ∀ (x : HNNExtension G A B φ), motive x → motive x⁻¹
S : Subgroup (HNNExtension G A B φ) :=
  {
    toSubmonoid :=
      {
        toSubsemigroup :=
          { carrier := setOf motive,
            mul_mem' := (_ : ∀ {a b : HNNExtension G A B φ}, motive a → motive b → motive (a * b)) },
        one_mem' :=
          (_ :
            1 ∈
              { carrier := setOf motive,
                  mul_mem' := (_ : ∀ {a b : HNNExtension G A B φ}, motive a → motive b → motive (a * b)) }.carrier) },
    inv_mem' := (_ : ∀ {x : HNNExtension G A B φ}, motive x → motive x⁻¹) }
⊢ ∀ (a : ↥A),
    { val := HNNExtension.t, property := t } * (MonoidHom.codRestrict HNNExtension.of S of) ↑a =
      (MonoidHom.codRestrict HNNExtension.of S of) ↑(φ a) * { val := HNNExtension.t, property := t }

Next tactic:
intro a
@[elab_as_elim]
theorem induction_on {motive : HNNExtension G A B φ → Prop}
    (x : HNNExtension G A B φ) (of : ∀ g, motive (of g))
    (t : motive t) (mul : ∀ x y, motive x → motive y → motive (x * y))
    (inv : ∀ x, motive x → motive x⁻¹) : motive x := by
  let S : Subgroup (HNNExtension G A B φ) :=
    { carrier := setOf motive
      one_mem' := by simpa using of 1
      mul_mem' := mul _ _
      inv_mem' := inv _ }
  let f : HNNExtension G A B φ →* S :=
    lift (HNNExtension.of.codRestrict S of)
      ⟨HNNExtension.t, t⟩ (by intro a; 

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
motive : HNNExtension G A B φ → Prop
x : HNNExtension G A B φ
of : ∀ (g : G), motive (HNNExtension.of g)
t : motive HNNExtension.t
mul : ∀ (x y : HNNExtension G A B φ), motive x → motive y → motive (x * y)
inv : ∀ (x : HNNExtension G A B φ), motive x → motive x⁻¹
S : Subgroup (HNNExtension G A B φ) :=
  {
    toSubmonoid :=
      {
        toSubsemigroup :=
          { carrier := setOf motive,
            mul_mem' := (_ : ∀ {a b : HNNExtension G A B φ}, motive a → motive b → motive (a * b)) },
        one_mem' :=
          (_ :
            1 ∈
              { carrier := setOf motive,
                  mul_mem' := (_ : ∀ {a b : HNNExtension G A B φ}, motive a → motive b → motive (a * b)) }.carrier) },
    inv_mem' := (_ : ∀ {x : HNNExtension G A B φ}, motive x → motive x⁻¹) }
a : ↥A
⊢ { val := HNNExtension.t, property := t } * (MonoidHom.codRestrict HNNExtension.of S of) ↑a =
    (MonoidHom.codRestrict HNNExtension.of S of) ↑(φ a) * { val := HNNExtension.t, property := t }

Next tactic:
ext
@[elab_as_elim]
theorem induction_on {motive : HNNExtension G A B φ → Prop}
    (x : HNNExtension G A B φ) (of : ∀ g, motive (of g))
    (t : motive t) (mul : ∀ x y, motive x → motive y → motive (x * y))
    (inv : ∀ x, motive x → motive x⁻¹) : motive x := by
  let S : Subgroup (HNNExtension G A B φ) :=
    { carrier := setOf motive
      one_mem' := by simpa using of 1
      mul_mem' := mul _ _
      inv_mem' := inv _ }
  let f : HNNExtension G A B φ →* S :=
    lift (HNNExtension.of.codRestrict S of)
      ⟨HNNExtension.t, t⟩ (by intro a; ext; 

Proof state:
case a
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
motive : HNNExtension G A B φ → Prop
x : HNNExtension G A B φ
of : ∀ (g : G), motive (HNNExtension.of g)
t : motive HNNExtension.t
mul : ∀ (x y : HNNExtension G A B φ), motive x → motive y → motive (x * y)
inv : ∀ (x : HNNExtension G A B φ), motive x → motive x⁻¹
S : Subgroup (HNNExtension G A B φ) :=
  {
    toSubmonoid :=
      {
        toSubsemigroup :=
          { carrier := setOf motive,
            mul_mem' := (_ : ∀ {a b : HNNExtension G A B φ}, motive a → motive b → motive (a * b)) },
        one_mem' :=
          (_ :
            1 ∈
              { carrier := setOf motive,
                  mul_mem' := (_ : ∀ {a b : HNNExtension G A B φ}, motive a → motive b → motive (a * b)) }.carrier) },
    inv_mem' := (_ : ∀ {x : HNNExtension G A B φ}, motive x → motive x⁻¹) }
a : ↥A
⊢ ↑({ val := HNNExtension.t, property := t } * (MonoidHom.codRestrict HNNExtension.of S of) ↑a) =
    ↑((MonoidHom.codRestrict HNNExtension.of S of) ↑(φ a) * { val := HNNExtension.t, property := t })

Next tactic:
simp [equiv_eq_conj, mul_assoc]
@[elab_as_elim]
theorem induction_on {motive : HNNExtension G A B φ → Prop}
    (x : HNNExtension G A B φ) (of : ∀ g, motive (of g))
    (t : motive t) (mul : ∀ x y, motive x → motive y → motive (x * y))
    (inv : ∀ x, motive x → motive x⁻¹) : motive x := by
  let S : Subgroup (HNNExtension G A B φ) :=
    { carrier := setOf motive
      one_mem' := by simpa using of 1
      mul_mem' := mul _ _
      inv_mem' := inv _ }
  let f : HNNExtension G A B φ →* S :=
    lift (HNNExtension.of.codRestrict S of)
      ⟨HNNExtension.t, t⟩ (by intro a; ext; simp [equiv_eq_conj, mul_assoc])
  

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
motive : HNNExtension G A B φ → Prop
x : HNNExtension G A B φ
of : ∀ (g : G), motive (HNNExtension.of g)
t : motive HNNExtension.t
mul : ∀ (x y : HNNExtension G A B φ), motive x → motive y → motive (x * y)
inv : ∀ (x : HNNExtension G A B φ), motive x → motive x⁻¹
S : Subgroup (HNNExtension G A B φ) :=
  {
    toSubmonoid :=
      {
        toSubsemigroup :=
          { carrier := setOf motive,
            mul_mem' := (_ : ∀ {a b : HNNExtension G A B φ}, motive a → motive b → motive (a * b)) },
        one_mem' :=
          (_ :
            1 ∈
              { carrier := setOf motive,
                  mul_mem' := (_ : ∀ {a b : HNNExtension G A B φ}, motive a → motive b → motive (a * b)) }.carrier) },
    inv_mem' := (_ : ∀ {x : HNNExtension G A B φ}, motive x → motive x⁻¹) }
f : HNNExtension G A B φ →* ↥S :=
  lift (MonoidHom.codRestrict HNNExtension.of S of) { val := HNNExtension.t, property := t }
    (_ :
      ∀ (a : ↥A),
        { val := HNNExtension.t, property := t } * (MonoidHom.codRestrict HNNExtension.of S of) ↑a =
          (MonoidHom.codRestrict HNNExtension.of S of) ↑(φ a) * { val := HNNExtension.t, property := t })
⊢ motive x

Next tactic:
have hf : S.subtype.comp f = MonoidHom.id _ :=
    hom_ext (by ext; simp) (by simp)
@[elab_as_elim]
theorem induction_on {motive : HNNExtension G A B φ → Prop}
    (x : HNNExtension G A B φ) (of : ∀ g, motive (of g))
    (t : motive t) (mul : ∀ x y, motive x → motive y → motive (x * y))
    (inv : ∀ x, motive x → motive x⁻¹) : motive x := by
  let S : Subgroup (HNNExtension G A B φ) :=
    { carrier := setOf motive
      one_mem' := by simpa using of 1
      mul_mem' := mul _ _
      inv_mem' := inv _ }
  let f : HNNExtension G A B φ →* S :=
    lift (HNNExtension.of.codRestrict S of)
      ⟨HNNExtension.t, t⟩ (by intro a; ext; simp [equiv_eq_conj, mul_assoc])
  have hf : S.subtype.comp f = MonoidHom.id _ :=
    hom_ext (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
motive : HNNExtension G A B φ → Prop
x : HNNExtension G A B φ
of : ∀ (g : G), motive (HNNExtension.of g)
t : motive HNNExtension.t
mul : ∀ (x y : HNNExtension G A B φ), motive x → motive y → motive (x * y)
inv : ∀ (x : HNNExtension G A B φ), motive x → motive x⁻¹
S : Subgroup (HNNExtension G A B φ) :=
  {
    toSubmonoid :=
      {
        toSubsemigroup :=
          { carrier := setOf motive,
            mul_mem' := (_ : ∀ {a b : HNNExtension G A B φ}, motive a → motive b → motive (a * b)) },
        one_mem' :=
          (_ :
            1 ∈
              { carrier := setOf motive,
                  mul_mem' := (_ : ∀ {a b : HNNExtension G A B φ}, motive a → motive b → motive (a * b)) }.carrier) },
    inv_mem' := (_ : ∀ {x : HNNExtension G A B φ}, motive x → motive x⁻¹) }
f : HNNExtension G A B φ →* ↥S :=
  lift (MonoidHom.codRestrict HNNExtension.of S of) { val := HNNExtension.t, property := t }
    (_ :
      ∀ (a : ↥A),
        { val := HNNExtension.t, property := t } * (MonoidHom.codRestrict HNNExtension.of S of) ↑a =
          (MonoidHom.codRestrict HNNExtension.of S of) ↑(φ a) * { val := HNNExtension.t, property := t })
⊢ MonoidHom.comp (MonoidHom.comp (Subgroup.subtype S) f) HNNExtension.of =
    MonoidHom.comp (MonoidHom.id (HNNExtension G A B φ)) HNNExtension.of

Next tactic:
ext
@[elab_as_elim]
theorem induction_on {motive : HNNExtension G A B φ → Prop}
    (x : HNNExtension G A B φ) (of : ∀ g, motive (of g))
    (t : motive t) (mul : ∀ x y, motive x → motive y → motive (x * y))
    (inv : ∀ x, motive x → motive x⁻¹) : motive x := by
  let S : Subgroup (HNNExtension G A B φ) :=
    { carrier := setOf motive
      one_mem' := by simpa using of 1
      mul_mem' := mul _ _
      inv_mem' := inv _ }
  let f : HNNExtension G A B φ →* S :=
    lift (HNNExtension.of.codRestrict S of)
      ⟨HNNExtension.t, t⟩ (by intro a; ext; simp [equiv_eq_conj, mul_assoc])
  have hf : S.subtype.comp f = MonoidHom.id _ :=
    hom_ext (by ext; 

Proof state:
case h
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
motive : HNNExtension G A B φ → Prop
x : HNNExtension G A B φ
of : ∀ (g : G), motive (HNNExtension.of g)
t : motive HNNExtension.t
mul : ∀ (x y : HNNExtension G A B φ), motive x → motive y → motive (x * y)
inv : ∀ (x : HNNExtension G A B φ), motive x → motive x⁻¹
S : Subgroup (HNNExtension G A B φ) :=
  {
    toSubmonoid :=
      {
        toSubsemigroup :=
          { carrier := setOf motive,
            mul_mem' := (_ : ∀ {a b : HNNExtension G A B φ}, motive a → motive b → motive (a * b)) },
        one_mem' :=
          (_ :
            1 ∈
              { carrier := setOf motive,
                  mul_mem' := (_ : ∀ {a b : HNNExtension G A B φ}, motive a → motive b → motive (a * b)) }.carrier) },
    inv_mem' := (_ : ∀ {x : HNNExtension G A B φ}, motive x → motive x⁻¹) }
f : HNNExtension G A B φ →* ↥S :=
  lift (MonoidHom.codRestrict HNNExtension.of S of) { val := HNNExtension.t, property := t }
    (_ :
      ∀ (a : ↥A),
        { val := HNNExtension.t, property := t } * (MonoidHom.codRestrict HNNExtension.of S of) ↑a =
          (MonoidHom.codRestrict HNNExtension.of S of) ↑(φ a) * { val := HNNExtension.t, property := t })
x✝ : G
⊢ (MonoidHom.comp (MonoidHom.comp (Subgroup.subtype S) f) HNNExtension.of) x✝ =
    (MonoidHom.comp (MonoidHom.id (HNNExtension G A B φ)) HNNExtension.of) x✝

Next tactic:
simp
@[elab_as_elim]
theorem induction_on {motive : HNNExtension G A B φ → Prop}
    (x : HNNExtension G A B φ) (of : ∀ g, motive (of g))
    (t : motive t) (mul : ∀ x y, motive x → motive y → motive (x * y))
    (inv : ∀ x, motive x → motive x⁻¹) : motive x := by
  let S : Subgroup (HNNExtension G A B φ) :=
    { carrier := setOf motive
      one_mem' := by simpa using of 1
      mul_mem' := mul _ _
      inv_mem' := inv _ }
  let f : HNNExtension G A B φ →* S :=
    lift (HNNExtension.of.codRestrict S of)
      ⟨HNNExtension.t, t⟩ (by intro a; ext; simp [equiv_eq_conj, mul_assoc])
  have hf : S.subtype.comp f = MonoidHom.id _ :=
    hom_ext (by ext; simp) (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
motive : HNNExtension G A B φ → Prop
x : HNNExtension G A B φ
of : ∀ (g : G), motive (HNNExtension.of g)
t : motive HNNExtension.t
mul : ∀ (x y : HNNExtension G A B φ), motive x → motive y → motive (x * y)
inv : ∀ (x : HNNExtension G A B φ), motive x → motive x⁻¹
S : Subgroup (HNNExtension G A B φ) :=
  {
    toSubmonoid :=
      {
        toSubsemigroup :=
          { carrier := setOf motive,
            mul_mem' := (_ : ∀ {a b : HNNExtension G A B φ}, motive a → motive b → motive (a * b)) },
        one_mem' :=
          (_ :
            1 ∈
              { carrier := setOf motive,
                  mul_mem' := (_ : ∀ {a b : HNNExtension G A B φ}, motive a → motive b → motive (a * b)) }.carrier) },
    inv_mem' := (_ : ∀ {x : HNNExtension G A B φ}, motive x → motive x⁻¹) }
f : HNNExtension G A B φ →* ↥S :=
  lift (MonoidHom.codRestrict HNNExtension.of S of) { val := HNNExtension.t, property := t }
    (_ :
      ∀ (a : ↥A),
        { val := HNNExtension.t, property := t } * (MonoidHom.codRestrict HNNExtension.of S of) ↑a =
          (MonoidHom.codRestrict HNNExtension.of S of) ↑(φ a) * { val := HNNExtension.t, property := t })
⊢ (MonoidHom.comp (Subgroup.subtype S) f) HNNExtension.t = (MonoidHom.id (HNNExtension G A B φ)) HNNExtension.t

Next tactic:
simp
@[elab_as_elim]
theorem induction_on {motive : HNNExtension G A B φ → Prop}
    (x : HNNExtension G A B φ) (of : ∀ g, motive (of g))
    (t : motive t) (mul : ∀ x y, motive x → motive y → motive (x * y))
    (inv : ∀ x, motive x → motive x⁻¹) : motive x := by
  let S : Subgroup (HNNExtension G A B φ) :=
    { carrier := setOf motive
      one_mem' := by simpa using of 1
      mul_mem' := mul _ _
      inv_mem' := inv _ }
  let f : HNNExtension G A B φ →* S :=
    lift (HNNExtension.of.codRestrict S of)
      ⟨HNNExtension.t, t⟩ (by intro a; ext; simp [equiv_eq_conj, mul_assoc])
  have hf : S.subtype.comp f = MonoidHom.id _ :=
    hom_ext (by ext; simp) (by simp)
  

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
motive : HNNExtension G A B φ → Prop
x : HNNExtension G A B φ
of : ∀ (g : G), motive (HNNExtension.of g)
t : motive HNNExtension.t
mul : ∀ (x y : HNNExtension G A B φ), motive x → motive y → motive (x * y)
inv : ∀ (x : HNNExtension G A B φ), motive x → motive x⁻¹
S : Subgroup (HNNExtension G A B φ) :=
  {
    toSubmonoid :=
      {
        toSubsemigroup :=
          { carrier := setOf motive,
            mul_mem' := (_ : ∀ {a b : HNNExtension G A B φ}, motive a → motive b → motive (a * b)) },
        one_mem' :=
          (_ :
            1 ∈
              { carrier := setOf motive,
                  mul_mem' := (_ : ∀ {a b : HNNExtension G A B φ}, motive a → motive b → motive (a * b)) }.carrier) },
    inv_mem' := (_ : ∀ {x : HNNExtension G A B φ}, motive x → motive x⁻¹) }
f : HNNExtension G A B φ →* ↥S :=
  lift (MonoidHom.codRestrict HNNExtension.of S of) { val := HNNExtension.t, property := t }
    (_ :
      ∀ (a : ↥A),
        { val := HNNExtension.t, property := t } * (MonoidHom.codRestrict HNNExtension.of S of) ↑a =
          (MonoidHom.codRestrict HNNExtension.of S of) ↑(φ a) * { val := HNNExtension.t, property := t })
hf : MonoidHom.comp (Subgroup.subtype S) f = MonoidHom.id (HNNExtension G A B φ)
⊢ motive x

Next tactic:
show motive (MonoidHom.id _ x)
@[elab_as_elim]
theorem induction_on {motive : HNNExtension G A B φ → Prop}
    (x : HNNExtension G A B φ) (of : ∀ g, motive (of g))
    (t : motive t) (mul : ∀ x y, motive x → motive y → motive (x * y))
    (inv : ∀ x, motive x → motive x⁻¹) : motive x := by
  let S : Subgroup (HNNExtension G A B φ) :=
    { carrier := setOf motive
      one_mem' := by simpa using of 1
      mul_mem' := mul _ _
      inv_mem' := inv _ }
  let f : HNNExtension G A B φ →* S :=
    lift (HNNExtension.of.codRestrict S of)
      ⟨HNNExtension.t, t⟩ (by intro a; ext; simp [equiv_eq_conj, mul_assoc])
  have hf : S.subtype.comp f = MonoidHom.id _ :=
    hom_ext (by ext; simp) (by simp)
  show motive (MonoidHom.id _ x)
  

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
motive : HNNExtension G A B φ → Prop
x : HNNExtension G A B φ
of : ∀ (g : G), motive (HNNExtension.of g)
t : motive HNNExtension.t
mul : ∀ (x y : HNNExtension G A B φ), motive x → motive y → motive (x * y)
inv : ∀ (x : HNNExtension G A B φ), motive x → motive x⁻¹
S : Subgroup (HNNExtension G A B φ) :=
  {
    toSubmonoid :=
      {
        toSubsemigroup :=
          { carrier := setOf motive,
            mul_mem' := (_ : ∀ {a b : HNNExtension G A B φ}, motive a → motive b → motive (a * b)) },
        one_mem' :=
          (_ :
            1 ∈
              { carrier := setOf motive,
                  mul_mem' := (_ : ∀ {a b : HNNExtension G A B φ}, motive a → motive b → motive (a * b)) }.carrier) },
    inv_mem' := (_ : ∀ {x : HNNExtension G A B φ}, motive x → motive x⁻¹) }
f : HNNExtension G A B φ →* ↥S :=
  lift (MonoidHom.codRestrict HNNExtension.of S of) { val := HNNExtension.t, property := t }
    (_ :
      ∀ (a : ↥A),
        { val := HNNExtension.t, property := t } * (MonoidHom.codRestrict HNNExtension.of S of) ↑a =
          (MonoidHom.codRestrict HNNExtension.of S of) ↑(φ a) * { val := HNNExtension.t, property := t })
hf : MonoidHom.comp (Subgroup.subtype S) f = MonoidHom.id (HNNExtension G A B φ)
⊢ motive ((MonoidHom.id (HNNExtension G A B φ)) x)

Next tactic:
rw [← hf]
@[elab_as_elim]
theorem induction_on {motive : HNNExtension G A B φ → Prop}
    (x : HNNExtension G A B φ) (of : ∀ g, motive (of g))
    (t : motive t) (mul : ∀ x y, motive x → motive y → motive (x * y))
    (inv : ∀ x, motive x → motive x⁻¹) : motive x := by
  let S : Subgroup (HNNExtension G A B φ) :=
    { carrier := setOf motive
      one_mem' := by simpa using of 1
      mul_mem' := mul _ _
      inv_mem' := inv _ }
  let f : HNNExtension G A B φ →* S :=
    lift (HNNExtension.of.codRestrict S of)
      ⟨HNNExtension.t, t⟩ (by intro a; ext; simp [equiv_eq_conj, mul_assoc])
  have hf : S.subtype.comp f = MonoidHom.id _ :=
    hom_ext (by ext; simp) (by simp)
  show motive (MonoidHom.id _ x)
  rw [← hf]
  

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
motive : HNNExtension G A B φ → Prop
x : HNNExtension G A B φ
of : ∀ (g : G), motive (HNNExtension.of g)
t : motive HNNExtension.t
mul : ∀ (x y : HNNExtension G A B φ), motive x → motive y → motive (x * y)
inv : ∀ (x : HNNExtension G A B φ), motive x → motive x⁻¹
S : Subgroup (HNNExtension G A B φ) :=
  {
    toSubmonoid :=
      {
        toSubsemigroup :=
          { carrier := setOf motive,
            mul_mem' := (_ : ∀ {a b : HNNExtension G A B φ}, motive a → motive b → motive (a * b)) },
        one_mem' :=
          (_ :
            1 ∈
              { carrier := setOf motive,
                  mul_mem' := (_ : ∀ {a b : HNNExtension G A B φ}, motive a → motive b → motive (a * b)) }.carrier) },
    inv_mem' := (_ : ∀ {x : HNNExtension G A B φ}, motive x → motive x⁻¹) }
f : HNNExtension G A B φ →* ↥S :=
  lift (MonoidHom.codRestrict HNNExtension.of S of) { val := HNNExtension.t, property := t }
    (_ :
      ∀ (a : ↥A),
        { val := HNNExtension.t, property := t } * (MonoidHom.codRestrict HNNExtension.of S of) ↑a =
          (MonoidHom.codRestrict HNNExtension.of S of) ↑(φ a) * { val := HNNExtension.t, property := t })
hf : MonoidHom.comp (Subgroup.subtype S) f = MonoidHom.id (HNNExtension G A B φ)
⊢ motive ((MonoidHom.comp (Subgroup.subtype S) f) x)

Next tactic:
exact (f x).2
/-- To avoid duplicating code, we define `toSubgroup A B u` and `toSubgroupEquiv u`
where `u : ℤˣ` is `1` or `-1`. `toSubgroup A B u` is `A` when `u = 1` and `B` when `u = -1`,
and `toSubgroupEquiv` is the group ismorphism from `toSubgroup A B u` to `toSubgroup A B (-u)`.
It is defined to be `φ` when `u = 1` and `φ⁻¹` when `u = -1`. -/
def toSubgroupEquiv (u : ℤˣ) : toSubgroup A B u ≃* toSubgroup A B (-u) :=
  if hu : u = 1 then hu ▸ φ else 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
u : ℤˣ
hu : ¬u = 1
⊢ ↥(toSubgroup A B u) ≃* ↥(toSubgroup A B (-u))

Next tactic:
convert φ.symm
/-- To avoid duplicating code, we define `toSubgroup A B u` and `toSubgroupEquiv u`
where `u : ℤˣ` is `1` or `-1`. `toSubgroup A B u` is `A` when `u = 1` and `B` when `u = -1`,
and `toSubgroupEquiv` is the group ismorphism from `toSubgroup A B u` to `toSubgroup A B (-u)`.
It is defined to be `φ` when `u = 1` and `φ⁻¹` when `u = -1`. -/
def toSubgroupEquiv (u : ℤˣ) : toSubgroup A B u ≃* toSubgroup A B (-u) :=
  if hu : u = 1 then hu ▸ φ else by
    convert φ.symm <;>
    

Proof state:
case h.e'_1.h.e'_2.h.h.e'_5
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
u : ℤˣ
hu : ¬u = 1
x✝ : G
⊢ toSubgroup A B u = B

Next tactic:
cases Int.units_eq_one_or u
/-- To avoid duplicating code, we define `toSubgroup A B u` and `toSubgroupEquiv u`
where `u : ℤˣ` is `1` or `-1`. `toSubgroup A B u` is `A` when `u = 1` and `B` when `u = -1`,
and `toSubgroupEquiv` is the group ismorphism from `toSubgroup A B u` to `toSubgroup A B (-u)`.
It is defined to be `φ` when `u = 1` and `φ⁻¹` when `u = -1`. -/
def toSubgroupEquiv (u : ℤˣ) : toSubgroup A B u ≃* toSubgroup A B (-u) :=
  if hu : u = 1 then hu ▸ φ else by
    convert φ.symm <;>
    

Proof state:
case h.e'_2.h.e'_2.h.h.e'_5
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
u : ℤˣ
hu : ¬u = 1
x✝ : G
⊢ toSubgroup A B (-u) = A

Next tactic:
cases Int.units_eq_one_or u
/-- To avoid duplicating code, we define `toSubgroup A B u` and `toSubgroupEquiv u`
where `u : ℤˣ` is `1` or `-1`. `toSubgroup A B u` is `A` when `u = 1` and `B` when `u = -1`,
and `toSubgroupEquiv` is the group ismorphism from `toSubgroup A B u` to `toSubgroup A B (-u)`.
It is defined to be `φ` when `u = 1` and `φ⁻¹` when `u = -1`. -/
def toSubgroupEquiv (u : ℤˣ) : toSubgroup A B u ≃* toSubgroup A B (-u) :=
  if hu : u = 1 then hu ▸ φ else by
    convert φ.symm <;>
    

Proof state:
case h.e'_3.e'_3
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
u : ℤˣ
hu : ¬u = 1
e_1✝ : ↥(toSubgroup A B u) = ↥B
⊢ toSubgroup A B u = B

Next tactic:
cases Int.units_eq_one_or u
/-- To avoid duplicating code, we define `toSubgroup A B u` and `toSubgroupEquiv u`
where `u : ℤˣ` is `1` or `-1`. `toSubgroup A B u` is `A` when `u = 1` and `B` when `u = -1`,
and `toSubgroupEquiv` is the group ismorphism from `toSubgroup A B u` to `toSubgroup A B (-u)`.
It is defined to be `φ` when `u = 1` and `φ⁻¹` when `u = -1`. -/
def toSubgroupEquiv (u : ℤˣ) : toSubgroup A B u ≃* toSubgroup A B (-u) :=
  if hu : u = 1 then hu ▸ φ else by
    convert φ.symm <;>
    

Proof state:
case h.e'_4.e'_3
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
u : ℤˣ
hu : ¬u = 1
e_2✝ : ↥(toSubgroup A B (-u)) = ↥A
⊢ toSubgroup A B (-u) = A

Next tactic:
cases Int.units_eq_one_or u
/-- To avoid duplicating code, we define `toSubgroup A B u` and `toSubgroupEquiv u`
where `u : ℤˣ` is `1` or `-1`. `toSubgroup A B u` is `A` when `u = 1` and `B` when `u = -1`,
and `toSubgroupEquiv` is the group ismorphism from `toSubgroup A B u` to `toSubgroup A B (-u)`.
It is defined to be `φ` when `u = 1` and `φ⁻¹` when `u = -1`. -/
def toSubgroupEquiv (u : ℤˣ) : toSubgroup A B u ≃* toSubgroup A B (-u) :=
  if hu : u = 1 then hu ▸ φ else by
    convert φ.symm <;>
    cases Int.units_eq_one_or u <;> 

Proof state:
case h.e'_1.h.e'_2.h.h.e'_5.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
u : ℤˣ
hu : ¬u = 1
x✝ : G
h✝ : u = 1
⊢ toSubgroup A B u = B

Next tactic:
simp_all