l3lab/ntp-mathlib huggingface dataset:
/-- The frame homomorphism from a complete lattice `L` to the complete lattice of sets of
points of `L`. -/
@[simps]
def openOfElementHom : FrameHom L (Set (PT L)) where
  toFun u := {x | x u}
  map_inf' a b := by 

Proof state:
L : Type u_1
inst✝ : CompleteLattice L
a b : L
⊢ (fun u => {x | x u}) (a ⊓ b) = (fun u => {x | x u}) a ⊓ (fun u => {x | x u}) b

Next tactic:
simp [Set.setOf_and]
/-- The frame homomorphism from a complete lattice `L` to the complete lattice of sets of
points of `L`. -/
@[simps]
def openOfElementHom : FrameHom L (Set (PT L)) where
  toFun u := {x | x u}
  map_inf' a b := by simp [Set.setOf_and]
  map_top' := by 

Proof state:
L : Type u_1
inst✝ : CompleteLattice L
⊢ InfHom.toFun { toFun := fun u => {x | x u}, map_inf' := (_ : ∀ (a b : L), {x | x (a ⊓ b)} = {x | x a} ∩ {x | x b}) }
      ⊤ =
    ⊤

Next tactic:
simp
/-- The frame homomorphism from a complete lattice `L` to the complete lattice of sets of
points of `L`. -/
@[simps]
def openOfElementHom : FrameHom L (Set (PT L)) where
  toFun u := {x | x u}
  map_inf' a b := by simp [Set.setOf_and]
  map_top' := by simp
  map_sSup' S := by 

Proof state:
L : Type u_1
inst✝ : CompleteLattice L
S : Set L
⊢ InfHom.toFun
      {
          toInfHom :=
            { toFun := fun u => {x | x u}, map_inf' := (_ : ∀ (a b : L), {x | x (a ⊓ b)} = {x | x a} ∩ {x | x b}) },
          map_top' := (_ : {x | x ⊤} = univ) }.toInfHom
      (sSup S) =
    sSup
      ({
              toInfHom :=
                { toFun := fun u => {x | x u}, map_inf' := (_ : ∀ (a b : L), {x | x (a ⊓ b)} = {x | x a} ∩ {x | x b}) },
              map_top' := (_ : {x | x ⊤} = univ) }.toInfHom.toFun ''
        S)

Next tactic:
ext
/-- The frame homomorphism from a complete lattice `L` to the complete lattice of sets of
points of `L`. -/
@[simps]
def openOfElementHom : FrameHom L (Set (PT L)) where
  toFun u := {x | x u}
  map_inf' a b := by simp [Set.setOf_and]
  map_top' := by simp
  map_sSup' S := by ext; 

Proof state:
case h
L : Type u_1
inst✝ : CompleteLattice L
S : Set L
x✝ : PT L
⊢ x✝ ∈
      InfHom.toFun
        {
            toInfHom :=
              { toFun := fun u => {x | x u}, map_inf' := (_ : ∀ (a b : L), {x | x (a ⊓ b)} = {x | x a} ∩ {x | x b}) },
            map_top' := (_ : {x | x ⊤} = univ) }.toInfHom
        (sSup S) ↔
    x✝ ∈
      sSup
        ({
                toInfHom :=
                  { toFun := fun u => {x | x u},
                    map_inf' := (_ : ∀ (a b : L), {x | x (a ⊓ b)} = {x | x a} ∩ {x | x b}) },
                map_top' := (_ : {x | x ⊤} = univ) }.toInfHom.toFun ''
          S)

Next tactic:
simp [Prop.exists_iff]
/-- The topology on the set of points of the complete lattice `L`. -/
instance instTopologicalSpace : TopologicalSpace (PT L) where
  IsOpen s := ∃ u, {x | x u} = s
  isOpen_univ := ⟨⊤, by 

Proof state:
L : Type u_1
inst✝ : CompleteLattice L
⊢ {x | x ⊤} = univ

Next tactic:
simp
/-- The topology on the set of points of the complete lattice `L`. -/
instance instTopologicalSpace : TopologicalSpace (PT L) where
  IsOpen s := ∃ u, {x | x u} = s
  isOpen_univ := ⟨⊤, by simp⟩
  isOpen_inter := by 

Proof state:
L : Type u_1
inst✝ : CompleteLattice L
⊢ ∀ (s t : Set (PT L)),
    (fun s => ∃ u, {x | x u} = s) s → (fun s => ∃ u, {x | x u} = s) t → (fun s => ∃ u, {x | x u} = s) (s ∩ t)

Next tactic:
rintro s t ⟨u, rfl⟩ ⟨v, rfl⟩
/-- The topology on the set of points of the complete lattice `L`. -/
instance instTopologicalSpace : TopologicalSpace (PT L) where
  IsOpen s := ∃ u, {x | x u} = s
  isOpen_univ := ⟨⊤, by simp⟩
  isOpen_inter := by rintro s t ⟨u, rfl⟩ ⟨v, rfl⟩; 

Proof state:
case intro.intro
L : Type u_1
inst✝ : CompleteLattice L
u v : L
⊢ ∃ u_1, {x | x u_1} = {x | x u} ∩ {x | x v}

Next tactic:
use u ⊓ v
/-- The topology on the set of points of the complete lattice `L`. -/
instance instTopologicalSpace : TopologicalSpace (PT L) where
  IsOpen s := ∃ u, {x | x u} = s
  isOpen_univ := ⟨⊤, by simp⟩
  isOpen_inter := by rintro s t ⟨u, rfl⟩ ⟨v, rfl⟩; use u ⊓ v; 

Proof state:
case h
L : Type u_1
inst✝ : CompleteLattice L
u v : L
⊢ {x | x (u ⊓ v)} = {x | x u} ∩ {x | x v}

Next tactic:
simp_rw [map_inf]
/-- The topology on the set of points of the complete lattice `L`. -/
instance instTopologicalSpace : TopologicalSpace (PT L) where
  IsOpen s := ∃ u, {x | x u} = s
  isOpen_univ := ⟨⊤, by simp⟩
  isOpen_inter := by rintro s t ⟨u, rfl⟩ ⟨v, rfl⟩; use u ⊓ v; simp_rw [map_inf]; 

Proof state:
case h
L : Type u_1
inst✝ : CompleteLattice L
u v : L
⊢ {x | x u ⊓ x v} = {x | x u} ∩ {x | x v}

Next tactic:
rfl
/-- The topology on the set of points of the complete lattice `L`. -/
instance instTopologicalSpace : TopologicalSpace (PT L) where
  IsOpen s := ∃ u, {x | x u} = s
  isOpen_univ := ⟨⊤, by simp⟩
  isOpen_inter := by rintro s t ⟨u, rfl⟩ ⟨v, rfl⟩; use u ⊓ v; simp_rw [map_inf]; rfl
  isOpen_sUnion S hS := by
    

Proof state:
L : Type u_1
inst✝ : CompleteLattice L
S : Set (Set (PT L))
hS : ∀ t ∈ S, (fun s => ∃ u, {x | x u} = s) t
⊢ (fun s => ∃ u, {x | x u} = s) (⋃₀ S)

Next tactic:
choose f hf using hS
/-- The topology on the set of points of the complete lattice `L`. -/
instance instTopologicalSpace : TopologicalSpace (PT L) where
  IsOpen s := ∃ u, {x | x u} = s
  isOpen_univ := ⟨⊤, by simp⟩
  isOpen_inter := by rintro s t ⟨u, rfl⟩ ⟨v, rfl⟩; use u ⊓ v; simp_rw [map_inf]; rfl
  isOpen_sUnion S hS := by
    choose f hf using hS
    

Proof state:
L : Type u_1
inst✝ : CompleteLattice L
S : Set (Set (PT L))
f : (t : Set (PT L)) → t ∈ S → L
hf : ∀ (t : Set (PT L)) (a : t ∈ S), {x | x (f t a)} = t
⊢ ∃ u, {x | x u} = ⋃₀ S

Next tactic:
use ⨆ t, ⨆ ht, f t ht
/-- The topology on the set of points of the complete lattice `L`. -/
instance instTopologicalSpace : TopologicalSpace (PT L) where
  IsOpen s := ∃ u, {x | x u} = s
  isOpen_univ := ⟨⊤, by simp⟩
  isOpen_inter := by rintro s t ⟨u, rfl⟩ ⟨v, rfl⟩; use u ⊓ v; simp_rw [map_inf]; rfl
  isOpen_sUnion S hS := by
    choose f hf using hS
    use ⨆ t, ⨆ ht, f t ht
    

Proof state:
case h
L : Type u_1
inst✝ : CompleteLattice L
S : Set (Set (PT L))
f : (t : Set (PT L)) → t ∈ S → L
hf : ∀ (t : Set (PT L)) (a : t ∈ S), {x | x (f t a)} = t
⊢ {x | x (⨆ t, ⨆ (ht : t ∈ S), f t ht)} = ⋃₀ S

Next tactic:
simp_rw [map_iSup, iSup_Prop_eq, setOf_exists, hf, sUnion_eq_biUnion]
/-- The covariant functor `pt` from the category of locales to the category of
topological spaces, which sends a locale `L` to the topological space `PT L` of homomorphisms
from `L` to `Prop` and a locale homomorphism `f` to a continuous function between the spaces
of points. -/
def pt : Locale ⥤ TopCat where
  obj L := ⟨PT L.unop, inferInstance⟩
  map f := ⟨fun p ↦ p.comp f.unop, continuous_def.2 <| by 

Proof state:
L : Type u_1
inst✝ : CompleteLattice L
X✝ Y✝ : Locale
f : X✝ ⟶ Y✝
⊢ ∀ (s : Set ↑((fun L => Bundled.mk (PT ↑L.unop)) Y✝)), IsOpen s → IsOpen ((fun p => FrameHom.comp p f.unop) ⁻¹' s)

Next tactic:
rintro s ⟨u, rfl⟩
/-- The covariant functor `pt` from the category of locales to the category of
topological spaces, which sends a locale `L` to the topological space `PT L` of homomorphisms
from `L` to `Prop` and a locale homomorphism `f` to a continuous function between the spaces
of points. -/
def pt : Locale ⥤ TopCat where
  obj L := ⟨PT L.unop, inferInstance⟩
  map f := ⟨fun p ↦ p.comp f.unop, continuous_def.2 <| by rintro s ⟨u, rfl⟩; 

Proof state:
case intro
L : Type u_1
inst✝ : CompleteLattice L
X✝ Y✝ : Locale
f : X✝ ⟶ Y✝
u : ↑Y✝.unop
⊢ IsOpen ((fun p => FrameHom.comp p f.unop) ⁻¹' {x | x u})

Next tactic:
use f.unop u
/-- The covariant functor `pt` from the category of locales to the category of
topological spaces, which sends a locale `L` to the topological space `PT L` of homomorphisms
from `L` to `Prop` and a locale homomorphism `f` to a continuous function between the spaces
of points. -/
def pt : Locale ⥤ TopCat where
  obj L := ⟨PT L.unop, inferInstance⟩
  map f := ⟨fun p ↦ p.comp f.unop, continuous_def.2 <| by rintro s ⟨u, rfl⟩; use f.unop u; 

Proof state:
case h
L : Type u_1
inst✝ : CompleteLattice L
X✝ Y✝ : Locale
f : X✝ ⟶ Y✝
u : ↑Y✝.unop
⊢ {x | x (f.unop u)} = (fun p => FrameHom.comp p f.unop) ⁻¹' {x | x u}

Next tactic:
rfl
/-- The unit of the adjunction between locales and topological spaces, which associates with
a point `x` of the space `X` a point of the locale of opens of `X`. -/
@[simps]
def localePointOfSpacePoint (x : X) : PT (Opens X) where
  toFun := (x ∈ ·)
  map_inf' a b := rfl
  map_top' := rfl
  map_sSup' S := by 

Proof state:
X : Type u_1
inst✝ : TopologicalSpace X
L : Locale
x : X
S : Set (Opens X)
⊢ InfHom.toFun
      {
          toInfHom :=
            { toFun := fun x_1 => x ∈ x_1,
              map_inf' := (_ : ∀ (a b : Opens X), (fun x_1 => x ∈ x_1) (a ⊓ b) = (fun x_1 => x ∈ x_1) (a ⊓ b)) },
          map_top' :=
            (_ :
              InfHom.toFun
                  { toFun := fun x_1 => x ∈ x_1,
                    map_inf' := (_ : ∀ (a b : Opens X), (fun x_1 => x ∈ x_1) (a ⊓ b) = (fun x_1 => x ∈ x_1) (a ⊓ b)) }
                  ⊤ =
                InfHom.toFun
                  { toFun := fun x_1 => x ∈ x_1,
                    map_inf' := (_ : ∀ (a b : Opens X), (fun x_1 => x ∈ x_1) (a ⊓ b) = (fun x_1 => x ∈ x_1) (a ⊓ b)) }
                  ⊤) }.toInfHom
      (sSup S) =
    sSup
      ({
              toInfHom :=
                { toFun := fun x_1 => x ∈ x_1,
                  map_inf' := (_ : ∀ (a b : Opens X), (fun x_1 => x ∈ x_1) (a ⊓ b) = (fun x_1 => x ∈ x_1) (a ⊓ b)) },
              map_top' :=
                (_ :
                  InfHom.toFun
                      { toFun := fun x_1 => x ∈ x_1,
                        map_inf' :=
                          (_ : ∀ (a b : Opens X), (fun x_1 => x ∈ x_1) (a ⊓ b) = (fun x_1 => x ∈ x_1) (a ⊓ b)) }
                      ⊤ =
                    InfHom.toFun
                      { toFun := fun x_1 => x ∈ x_1,
                        map_inf' :=
                          (_ : ∀ (a b : Opens X), (fun x_1 => x ∈ x_1) (a ⊓ b) = (fun x_1 => x ∈ x_1) (a ⊓ b)) }
                      ⊤) }.toInfHom.toFun ''
        S)

Next tactic:
simp [Prop.exists_iff]
/-- The counit is a frame homomorphism. -/
def counitAppCont : FrameHom L (Opens <| PT L) where
  toFun u := ⟨openOfElementHom L u, u, rfl⟩
  map_inf' a b := by 

Proof state:
X : Type u_1
inst✝ : TopologicalSpace X
L : Locale
a b : ↑L.unop
⊢ (fun u =>
        { carrier := (openOfElementHom ↑L.unop) u,
          is_open' := (_ : ∃ u_1, {x | x u_1} = (openOfElementHom ↑L.unop) u) })
      (a ⊓ b) =
    (fun u =>
          { carrier := (openOfElementHom ↑L.unop) u,
            is_open' := (_ : ∃ u_1, {x | x u_1} = (openOfElementHom ↑L.unop) u) })
        a ⊓
      (fun u =>
          { carrier := (openOfElementHom ↑L.unop) u,
            is_open' := (_ : ∃ u_1, {x | x u_1} = (openOfElementHom ↑L.unop) u) })
        b

Next tactic:
simp
/-- The counit is a frame homomorphism. -/
def counitAppCont : FrameHom L (Opens <| PT L) where
  toFun u := ⟨openOfElementHom L u, u, rfl⟩
  map_inf' a b := by simp
  map_top' := by 

Proof state:
X : Type u_1
inst✝ : TopologicalSpace X
L : Locale
⊢ InfHom.toFun
      {
        toFun := fun u =>
          { carrier := (openOfElementHom ↑L.unop) u,
            is_open' := (_ : ∃ u_1, {x | x u_1} = (openOfElementHom ↑L.unop) u) },
        map_inf' :=
          (_ :
            ∀ (a b : ↑L.unop),
              { carrier := (openOfElementHom ↑L.unop) (a ⊓ b),
                  is_open' := (_ : ∃ u, {x | x u} = (openOfElementHom ↑L.unop) (a ⊓ b)) } =
                { carrier := {x | x a} ∩ {x | x b}, is_open' := (_ : IsOpen ({x | x a} ∩ {x | x b})) }) }
      ⊤ =
    ⊤

Next tactic:
simp
/-- The counit is a frame homomorphism. -/
def counitAppCont : FrameHom L (Opens <| PT L) where
  toFun u := ⟨openOfElementHom L u, u, rfl⟩
  map_inf' a b := by simp
  map_top' := by simp
  map_sSup' S := by 

Proof state:
X : Type u_1
inst✝ : TopologicalSpace X
L : Locale
S : Set ↑L.unop
⊢ InfHom.toFun
      {
          toInfHom :=
            {
              toFun := fun u =>
                { carrier := (openOfElementHom ↑L.unop) u,
                  is_open' := (_ : ∃ u_1, {x | x u_1} = (openOfElementHom ↑L.unop) u) },
              map_inf' :=
                (_ :
                  ∀ (a b : ↑L.unop),
                    { carrier := (openOfElementHom ↑L.unop) (a ⊓ b),
                        is_open' := (_ : ∃ u, {x | x u} = (openOfElementHom ↑L.unop) (a ⊓ b)) } =
                      { carrier := {x | x a} ∩ {x | x b}, is_open' := (_ : IsOpen ({x | x a} ∩ {x | x b})) }) },
          map_top' :=
            (_ :
              { carrier := (openOfElementHom ↑L.unop) ⊤,
                  is_open' := (_ : ∃ u, {x | x u} = (openOfElementHom ↑L.unop) ⊤) } =
                ⊤) }.toInfHom
      (sSup S) =
    sSup
      ({
              toInfHom :=
                {
                  toFun := fun u =>
                    { carrier := (openOfElementHom ↑L.unop) u,
                      is_open' := (_ : ∃ u_1, {x | x u_1} = (openOfElementHom ↑L.unop) u) },
                  map_inf' :=
                    (_ :
                      ∀ (a b : ↑L.unop),
                        { carrier := (openOfElementHom ↑L.unop) (a ⊓ b),
                            is_open' := (_ : ∃ u, {x | x u} = (openOfElementHom ↑L.unop) (a ⊓ b)) } =
                          { carrier := {x | x a} ∩ {x | x b}, is_open' := (_ : IsOpen ({x | x a} ∩ {x | x b})) }) },
              map_top' :=
                (_ :
                  { carrier := (openOfElementHom ↑L.unop) ⊤,
                      is_open' := (_ : ∃ u, {x | x u} = (openOfElementHom ↑L.unop) ⊤) } =
                    ⊤) }.toInfHom.toFun ''
        S)

Next tactic:
ext
/-- The counit is a frame homomorphism. -/
def counitAppCont : FrameHom L (Opens <| PT L) where
  toFun u := ⟨openOfElementHom L u, u, rfl⟩
  map_inf' a b := by simp
  map_top' := by simp
  map_sSup' S := by ext; 

Proof state:
case h.h
X : Type u_1
inst✝ : TopologicalSpace X
L : Locale
S : Set ↑L.unop
x✝ : PT ↑L.unop
⊢ x✝ ∈
      ↑(InfHom.toFun
          {
              toInfHom :=
                {
                  toFun := fun u =>
                    { carrier := (openOfElementHom ↑L.unop) u,
                      is_open' := (_ : ∃ u_1, {x | x u_1} = (openOfElementHom ↑L.unop) u) },
                  map_inf' :=
                    (_ :
                      ∀ (a b : ↑L.unop),
                        { carrier := (openOfElementHom ↑L.unop) (a ⊓ b),
                            is_open' := (_ : ∃ u, {x | x u} = (openOfElementHom ↑L.unop) (a ⊓ b)) } =
                          { carrier := {x | x a} ∩ {x | x b}, is_open' := (_ : IsOpen ({x | x a} ∩ {x | x b})) }) },
              map_top' :=
                (_ :
                  { carrier := (openOfElementHom ↑L.unop) ⊤,
                      is_open' := (_ : ∃ u, {x | x u} = (openOfElementHom ↑L.unop) ⊤) } =
                    ⊤) }.toInfHom
          (sSup S)) ↔
    x✝ ∈
      ↑(sSup
          ({
                  toInfHom :=
                    {
                      toFun := fun u =>
                        { carrier := (openOfElementHom ↑L.unop) u,
                          is_open' := (_ : ∃ u_1, {x | x u_1} = (openOfElementHom ↑L.unop) u) },
                      map_inf' :=
                        (_ :
                          ∀ (a b : ↑L.unop),
                            { carrier := (openOfElementHom ↑L.unop) (a ⊓ b),
                                is_open' := (_ : ∃ u, {x | x u} = (openOfElementHom ↑L.unop) (a ⊓ b)) } =
                              { carrier := {x | x a} ∩ {x | x b}, is_open' := (_ : IsOpen ({x | x a} ∩ {x | x b})) }) },
                  map_top' :=
                    (_ :
                      { carrier := (openOfElementHom ↑L.unop) ⊤,
                          is_open' := (_ : ∃ u, {x | x u} = (openOfElementHom ↑L.unop) ⊤) } =
                        ⊤) }.toInfHom.toFun ''
            S))

Next tactic:
simp
/-- The forgetful functor `topToLocale` is left adjoint to the functor `pt`. -/
def adjunctionTopToLocalePT : topToLocale ⊣ pt :=
  Adjunction.mkOfUnitCounit
    { unit := { app := fun X ↦ ⟨localePointOfSpacePoint X, continuous_def.2 <|
        by 

Proof state:
X✝ : Type u_1
inst✝ : TopologicalSpace X✝
L : Locale
X : TopCat
⊢ ∀ (s : Set ↑((topToLocale ⋙ pt).obj X)), IsOpen s → IsOpen (localePointOfSpacePoint ↑X ⁻¹' s)

Next tactic:
rintro _ ⟨u, rfl⟩
/-- The forgetful functor `topToLocale` is left adjoint to the functor `pt`. -/
def adjunctionTopToLocalePT : topToLocale ⊣ pt :=
  Adjunction.mkOfUnitCounit
    { unit := { app := fun X ↦ ⟨localePointOfSpacePoint X, continuous_def.2 <|
        by rintro _ ⟨u, rfl⟩; 

Proof state:
case intro
X✝ : Type u_1
inst✝ : TopologicalSpace X✝
L : Locale
X : TopCat
u : ↑(topToLocale.obj X).unop
⊢ IsOpen (localePointOfSpacePoint ↑X ⁻¹' {x | x u})

Next tactic:
simpa using u.2
@[to_additive (attr := ext)]
theorem Monoid.ext {M : Type u} ⦃m₁ m₂ : Monoid M⦄
    (h_mul : (letI := m₁; HMul.hMul : M → M → M) = (letI := m₂; HMul.hMul : M → M → M)) :
    m₁ = m₂ := by
  

Proof state:
M : Type u
m₁ m₂ : Monoid M
h_mul : HMul.hMul = HMul.hMul
⊢ m₁ = m₂

Next tactic:
have : m₁.toMulOneClass = m₂.toMulOneClass := MulOneClass.ext h_mul
@[to_additive (attr := ext)]
theorem Monoid.ext {M : Type u} ⦃m₁ m₂ : Monoid M⦄
    (h_mul : (letI := m₁; HMul.hMul : M → M → M) = (letI := m₂; HMul.hMul : M → M → M)) :
    m₁ = m₂ := by
  have : m₁.toMulOneClass = m₂.toMulOneClass := MulOneClass.ext h_mul
  

Proof state:
M : Type u
m₁ m₂ : Monoid M
h_mul : HMul.hMul = HMul.hMul
this : toMulOneClass = toMulOneClass
⊢ m₁ = m₂

Next tactic:
have h₁ : m₁.one = m₂.one := congr_arg (·.one) (this)
@[to_additive (attr := ext)]
theorem Monoid.ext {M : Type u} ⦃m₁ m₂ : Monoid M⦄
    (h_mul : (letI := m₁; HMul.hMul : M → M → M) = (letI := m₂; HMul.hMul : M → M → M)) :
    m₁ = m₂ := by
  have : m₁.toMulOneClass = m₂.toMulOneClass := MulOneClass.ext h_mul
  have h₁ : m₁.one = m₂.one := congr_arg (·.one) (this)
  

Proof state:
M : Type u
m₁ m₂ : Monoid M
h_mul : HMul.hMul = HMul.hMul
this : toMulOneClass = toMulOneClass
h₁ : One.one = One.one
⊢ m₁ = m₂

Next tactic:
let f : @MonoidHom M M m₁.toMulOneClass m₂.toMulOneClass :=
    @MonoidHom.mk _ _ (_) _ (@OneHom.mk _ _ (_) _ id h₁)
      (fun x y => congr_fun (congr_fun h_mul x) y)
@[to_additive (attr := ext)]
theorem Monoid.ext {M : Type u} ⦃m₁ m₂ : Monoid M⦄
    (h_mul : (letI := m₁; HMul.hMul : M → M → M) = (letI := m₂; HMul.hMul : M → M → M)) :
    m₁ = m₂ := by
  have : m₁.toMulOneClass = m₂.toMulOneClass := MulOneClass.ext h_mul
  have h₁ : m₁.one = m₂.one := congr_arg (·.one) (this)
  let f : @MonoidHom M M m₁.toMulOneClass m₂.toMulOneClass :=
    @MonoidHom.mk _ _ (_) _ (@OneHom.mk _ _ (_) _ id h₁)
      (fun x y => congr_fun (congr_fun h_mul x) y)
  

Proof state:
M : Type u
m₁ m₂ : Monoid M
h_mul : HMul.hMul = HMul.hMul
this : toMulOneClass = toMulOneClass
h₁ : One.one = One.one
f : M →* M := { toOneHom := { toFun := id, map_one' := h₁ }, map_mul' := (_ : ∀ (x y : M), x * y = x * y) }
⊢ m₁ = m₂

Next tactic:
have : m₁.npow = m₂.npow := by
    ext n x
    exact @MonoidHom.map_pow M M m₁ m₂ f x n
@[to_additive (attr := ext)]
theorem Monoid.ext {M : Type u} ⦃m₁ m₂ : Monoid M⦄
    (h_mul : (letI := m₁; HMul.hMul : M → M → M) = (letI := m₂; HMul.hMul : M → M → M)) :
    m₁ = m₂ := by
  have : m₁.toMulOneClass = m₂.toMulOneClass := MulOneClass.ext h_mul
  have h₁ : m₁.one = m₂.one := congr_arg (·.one) (this)
  let f : @MonoidHom M M m₁.toMulOneClass m₂.toMulOneClass :=
    @MonoidHom.mk _ _ (_) _ (@OneHom.mk _ _ (_) _ id h₁)
      (fun x y => congr_fun (congr_fun h_mul x) y)
  have : m₁.npow = m₂.npow := by
    

Proof state:
M : Type u
m₁ m₂ : Monoid M
h_mul : HMul.hMul = HMul.hMul
this : toMulOneClass = toMulOneClass
h₁ : One.one = One.one
f : M →* M := { toOneHom := { toFun := id, map_one' := h₁ }, map_mul' := (_ : ∀ (x y : M), x * y = x * y) }
⊢ Monoid.npow = Monoid.npow

Next tactic:
ext n x
@[to_additive (attr := ext)]
theorem Monoid.ext {M : Type u} ⦃m₁ m₂ : Monoid M⦄
    (h_mul : (letI := m₁; HMul.hMul : M → M → M) = (letI := m₂; HMul.hMul : M → M → M)) :
    m₁ = m₂ := by
  have : m₁.toMulOneClass = m₂.toMulOneClass := MulOneClass.ext h_mul
  have h₁ : m₁.one = m₂.one := congr_arg (·.one) (this)
  let f : @MonoidHom M M m₁.toMulOneClass m₂.toMulOneClass :=
    @MonoidHom.mk _ _ (_) _ (@OneHom.mk _ _ (_) _ id h₁)
      (fun x y => congr_fun (congr_fun h_mul x) y)
  have : m₁.npow = m₂.npow := by
    ext n x
    

Proof state:
case h.h
M : Type u
m₁ m₂ : Monoid M
h_mul : HMul.hMul = HMul.hMul
this : toMulOneClass = toMulOneClass
h₁ : One.one = One.one
f : M →* M := { toOneHom := { toFun := id, map_one' := h₁ }, map_mul' := (_ : ∀ (x y : M), x * y = x * y) }
n : ℕ
x : M
⊢ Monoid.npow n x = Monoid.npow n x

Next tactic:
exact @MonoidHom.map_pow M M m₁ m₂ f x n
@[to_additive (attr := ext)]
theorem Monoid.ext {M : Type u} ⦃m₁ m₂ : Monoid M⦄
    (h_mul : (letI := m₁; HMul.hMul : M → M → M) = (letI := m₂; HMul.hMul : M → M → M)) :
    m₁ = m₂ := by
  have : m₁.toMulOneClass = m₂.toMulOneClass := MulOneClass.ext h_mul
  have h₁ : m₁.one = m₂.one := congr_arg (·.one) (this)
  let f : @MonoidHom M M m₁.toMulOneClass m₂.toMulOneClass :=
    @MonoidHom.mk _ _ (_) _ (@OneHom.mk _ _ (_) _ id h₁)
      (fun x y => congr_fun (congr_fun h_mul x) y)
  have : m₁.npow = m₂.npow := by
    ext n x
    exact @MonoidHom.map_pow M M m₁ m₂ f x n
  

Proof state:
M : Type u
m₁ m₂ : Monoid M
h_mul : HMul.hMul = HMul.hMul
this✝ : toMulOneClass = toMulOneClass
h₁ : One.one = One.one
f : M →* M := { toOneHom := { toFun := id, map_one' := h₁ }, map_mul' := (_ : ∀ (x y : M), x * y = x * y) }
this : Monoid.npow = Monoid.npow
⊢ m₁ = m₂

Next tactic:
rcases m₁ with @⟨@⟨⟨_⟩⟩, ⟨_⟩⟩
@[to_additive (attr := ext)]
theorem Monoid.ext {M : Type u} ⦃m₁ m₂ : Monoid M⦄
    (h_mul : (letI := m₁; HMul.hMul : M → M → M) = (letI := m₂; HMul.hMul : M → M → M)) :
    m₁ = m₂ := by
  have : m₁.toMulOneClass = m₂.toMulOneClass := MulOneClass.ext h_mul
  have h₁ : m₁.one = m₂.one := congr_arg (·.one) (this)
  let f : @MonoidHom M M m₁.toMulOneClass m₂.toMulOneClass :=
    @MonoidHom.mk _ _ (_) _ (@OneHom.mk _ _ (_) _ id h₁)
      (fun x y => congr_fun (congr_fun h_mul x) y)
  have : m₁.npow = m₂.npow := by
    ext n x
    exact @MonoidHom.map_pow M M m₁ m₂ f x n
  rcases m₁ with @⟨@⟨⟨_⟩⟩, ⟨_⟩⟩
  

Proof state:
case mk.mk.mk.mk
M : Type u
m₂ : Monoid M
npow✝ : ℕ → M → M
mul✝ : M → M → M
mul_assoc✝ : ∀ (a b c : M), a * b * c = a * (b * c)
npow_succ✝ : ∀ (n : ℕ) (x : M), npow✝ (n + 1) x = x * npow✝ n x
one✝ : M
npow_zero✝ : ∀ (x : M), npow✝ 0 x = 1
one_mul✝ : ∀ (a : M), 1 * a = a
mul_one✝ : ∀ (a : M), a * 1 = a
h_mul : HMul.hMul = HMul.hMul
this✝ : toMulOneClass = toMulOneClass
h₁ : One.one = One.one
f : M →* M := { toOneHom := { toFun := id, map_one' := h₁ }, map_mul' := (_ : ∀ (x y : M), x * y = x * y) }
this : Monoid.npow = Monoid.npow
⊢ mk one_mul✝ mul_one✝ npow✝ = m₂

Next tactic:
rcases m₂ with @⟨@⟨⟨_⟩⟩, ⟨_⟩⟩