/-- The monoid equivalence between units of a product of two monoids, and the product of the
    units of each monoid. -/
@[to_additive prodAddUnits
      "The additive monoid equivalence between additive units of a product
      of two additive monoids, and the product of the additive units of each additive monoid."]
def prodUnits : (M × N)ˣ ≃* Mˣ × Nˣ where
  toFun := (Units.map (MonoidHom.fst M N)).prod (Units.map (MonoidHom.snd M N))
  invFun u := ⟨(u.1, u.2), (↑u.1⁻¹, ↑u.2⁻¹), by simp, by simp⟩
  left_inv u := by
    simp only [MonoidHom.prod_apply, Units.coe_map, MonoidHom.coe_fst, MonoidHom.coe_snd,
      Prod.mk.eta, Units.coe_map_inv, Units.mk_val]
  right_inv := fun ⟨u₁, u₂⟩ => by
    simp only [Units.map, MonoidHom.coe_fst, Units.inv_eq_val_inv,
      MonoidHom.coe_snd, MonoidHom.prod_apply, Prod.mk.injEq]
    

Proof state:
A : Type u_1
B : Type u_2
G : Type u_3
H : Type u_4
M : Type u_5
N : Type u_6
P : Type u_7
inst✝¹ : Monoid M
inst✝ : Monoid N
x✝ : Mˣ × Nˣ
u₁ : Mˣ
u₂ : Nˣ
⊢ (MonoidHom.mk'
          (fun u =>
            { val := (↑u).1, inv := (↑u⁻¹).1, val_inv := (_ : (↑u).1 * (↑u⁻¹).1 = 1),
              inv_val := (_ : (↑u⁻¹).1 * (↑u).1 = 1) })
          (_ :
            ∀ (a b : (M × N)ˣ),
              (fun u =>
                    { val := (↑u).1, inv := (↑u⁻¹).1, val_inv := (_ : (↑u).1 * (↑u⁻¹).1 = 1),
                      inv_val := (_ : (↑u⁻¹).1 * (↑u).1 = 1) })
                  (a * b) =
                (fun u =>
                      { val := (↑u).1, inv := (↑u⁻¹).1, val_inv := (_ : (↑u).1 * (↑u⁻¹).1 = 1),
                        inv_val := (_ : (↑u⁻¹).1 * (↑u).1 = 1) })
                    a *
                  (fun u =>
                      { val := (↑u).1, inv := (↑u⁻¹).1, val_inv := (_ : (↑u).1 * (↑u⁻¹).1 = 1),
                        inv_val := (_ : (↑u⁻¹).1 * (↑u).1 = 1) })
                    b))
        { val := (↑u₁, ↑u₂), inv := (↑u₁⁻¹, ↑u₂⁻¹),
          val_inv := (_ : (↑(u₁, u₂).1 * ↑(u₁, u₂).1⁻¹, ↑(u₁, u₂).2 * ↑(u₁, u₂).2⁻¹) = 1),
          inv_val := (_ : (↑(u₁, u₂).1⁻¹ * ↑(u₁, u₂).1, ↑(u₁, u₂).2⁻¹ * ↑(u₁, u₂).2) = 1) } =
      u₁ ∧
    (MonoidHom.mk'
          (fun u =>
            { val := (↑u).2, inv := (↑u⁻¹).2, val_inv := (_ : (↑u).2 * (↑u⁻¹).2 = 1),
              inv_val := (_ : (↑u⁻¹).2 * (↑u).2 = 1) })
          (_ :
            ∀ (a b : (M × N)ˣ),
              (fun u =>
                    { val := (↑u).2, inv := (↑u⁻¹).2, val_inv := (_ : (↑u).2 * (↑u⁻¹).2 = 1),
                      inv_val := (_ : (↑u⁻¹).2 * (↑u).2 = 1) })
                  (a * b) =
                (fun u =>
                      { val := (↑u).2, inv := (↑u⁻¹).2, val_inv := (_ : (↑u).2 * (↑u⁻¹).2 = 1),
                        inv_val := (_ : (↑u⁻¹).2 * (↑u).2 = 1) })
                    a *
                  (fun u =>
                      { val := (↑u).2, inv := (↑u⁻¹).2, val_inv := (_ : (↑u).2 * (↑u⁻¹).2 = 1),
                        inv_val := (_ : (↑u⁻¹).2 * (↑u).2 = 1) })
                    b))
        { val := (↑u₁, ↑u₂), inv := (↑u₁⁻¹, ↑u₂⁻¹),
          val_inv := (_ : (↑(u₁, u₂).1 * ↑(u₁, u₂).1⁻¹, ↑(u₁, u₂).2 * ↑(u₁, u₂).2⁻¹) = 1),
          inv_val := (_ : (↑(u₁, u₂).1⁻¹ * ↑(u₁, u₂).1, ↑(u₁, u₂).2⁻¹ * ↑(u₁, u₂).2) = 1) } =
      u₂

Next tactic:
exact ⟨rfl, rfl⟩