Theorem: GroupCat.SurjectiveOfEpiAuxs.g_ne_h
File: Mathlib/Algebra/Category/GroupCat/EpiMono.lean

tactic: intro r
state_before: A B : GroupCat
f : A ⟶ B
x : ↑B
hx : ¬x ∈ MonoidHom.range f
⊢ g ≠ h

tactic: replace r :=
  FunLike.congr_fun (FunLike.congr_fun r x) (fromCoset ⟨f.range, ⟨1, one_leftCoset _⟩⟩)
state_before: A B : GroupCat
f : A ⟶ B
x : ↑B
hx : ¬x ∈ MonoidHom.range f
r : g = h
⊢ False

tactic: change _ = ((τ).symm.trans (g x)).trans τ _ at r
state_before: A B : GroupCat
f : A ⟶ B
x : ↑B
hx : ¬x ∈ MonoidHom.range f
r :
  ↑(↑g x)
      (fromCoset
        { val := ↑(MonoidHom.range f),
          property :=
            (_ :
              ∃ y,
                Function.swap leftCoset (MonoidHom.range f).toSubmonoid.toSubsemigroup.carrier y =
                  ↑(MonoidHom.range f)) }) =
    ↑(↑h x)
      (fromCoset
        { val := ↑(MonoidHom.range f),
          property :=
            (_ :
              ∃ y,
                Function.swap leftCoset (MonoidHom.range f).toSubmonoid.toSubsemigroup.carrier y =
                  ↑(MonoidHom.range f)) })
⊢ False

tactic: rw [g_apply_fromCoset, MonoidHom.coe_mk] at r
state_before: A B : GroupCat
f : A ⟶ B
x : ↑B
hx : ¬x ∈ MonoidHom.range f
r :
  ↑(↑g x)
      (fromCoset
        { val := ↑(MonoidHom.range f),
          property :=
            (_ :
              ∃ y,
                Function.swap leftCoset (MonoidHom.range f).toSubmonoid.toSubsemigroup.carrier y =
                  ↑(MonoidHom.range f)) }) =
    ↑((τ.symm.trans (↑g x)).trans τ)
      (fromCoset
        { val := ↑(MonoidHom.range f),
          property :=
            (_ :
              ∃ y,
                Function.swap leftCoset (MonoidHom.range f).toSubmonoid.toSubsemigroup.carrier y =
                  ↑(MonoidHom.range f)) })
⊢ False

tactic: simp only [MonoidHom.coe_range, Subtype.coe_mk, Equiv.symm_swap, Equiv.toFun_as_coe,
  Equiv.coe_trans, Function.comp_apply] at r
state_before: A B : GroupCat
f : A ⟶ B
x : ↑B
hx : ¬x ∈ MonoidHom.range f
r :
  fromCoset
      {
        val :=
          x *l
            ↑{ val := ↑(MonoidHom.range f),
                property :=
                  (_ :
                    ∃ y,
                      Function.swap leftCoset (MonoidHom.range f).toSubmonoid.toSubsemigroup.carrier y =
                        ↑(MonoidHom.range f)) },
        property :=
          (_ :
            x *l
                ↑{ val := ↑(MonoidHom.range f),
                    property :=
                      (_ :
                        ∃ y,
                          Function.swap leftCoset (MonoidHom.range f).toSubmonoid.toSubsemigroup.carrier y =
                            ↑(MonoidHom.range f)) } ∈
              Set.range (Function.swap leftCoset (MonoidHom.range f).toSubmonoid.toSubsemigroup.carrier)) } =
    ↑((τ.symm.trans (↑↑g x)).trans τ)
      (fromCoset
        { val := ↑(MonoidHom.range f),
          property :=
            (_ :
              ∃ y,
                Function.swap leftCoset (MonoidHom.range f).toSubmonoid.toSubsemigroup.carrier y =
                  ↑(MonoidHom.range f)) })
⊢ False

tactic: erw [Equiv.swap_apply_left, g_apply_infinity, Equiv.swap_apply_right] at r
state_before: A B : GroupCat
f : A ⟶ B
x : ↑B
hx : ¬x ∈ MonoidHom.range f
r :
  fromCoset
      { val := x *l Set.range ↑f,
        property :=
          (_ :
            (fun x => x ∈ Set.range (Function.swap leftCoset (MonoidHom.range f).toSubmonoid.toSubsemigroup.carrier))
              (x *l Set.range ↑f)) } =
    ↑τ
      (↑(↑↑g x)
        (↑τ.symm
          (fromCoset
            { val := Set.range ↑f,
              property :=
                (_ :
                  (fun x =>
                      x ∈ Set.range (Function.swap leftCoset (MonoidHom.range f).toSubmonoid.toSubsemigroup.carrier))
                    (Set.range ↑f)) })))
⊢ False

tactic: exact fromCoset_ne_of_nin_range _ hx r
state_before: A B : GroupCat
f : A ⟶ B
x : ↑B
hx : ¬x ∈ MonoidHom.range f
r :
  fromCoset
      { val := x *l Set.range ↑f,
        property :=
          (_ :
            (fun x => x ∈ Set.range (Function.swap leftCoset (MonoidHom.range f).toSubmonoid.toSubsemigroup.carrier))
              (x *l Set.range ↑f)) } =
    fromCoset
      { val := (MonoidHom.range f).toSubmonoid.toSubsemigroup.carrier,
        property :=
          (_ :
            ∃ y,
              Function.swap leftCoset (MonoidHom.range f).toSubmonoid.toSubsemigroup.carrier y =
                (MonoidHom.range f).toSubmonoid.toSubsemigroup.carrier) }
⊢ False