/-- The group of `S`-units is the group of units of the ring of `S`-integers. -/
@[simps apply_val_coe symm_apply_coe]
def unitEquivUnitsInteger : S.unit K ≃* (S.integer K)ˣ where
  toFun x :=
    ⟨⟨((x : Kˣ) : K), fun v hv => (x.property v hv).le⟩,
      ⟨((x⁻¹ : Kˣ) : K), fun v hv => (x⁻¹.property v hv).le⟩,
      Subtype.ext x.val.val_inv, Subtype.ext x.val.inv_val⟩
  invFun x :=
    ⟨Units.mk0 x fun hx => x.ne_zero (ZeroMemClass.coe_eq_zero.mp hx),
    fun v hv =>
      eq_one_of_one_le_mul_left (x.val.property v hv) (x.inv.property v hv) <|
        Eq.ge <| by
          -- Porting note: was
          -- rw [← map_mul]; convert v.valuation.map_one; exact subtype.mk_eq_mk.mp x.val_inv⟩
          rw [Units.val_mk0, ← map_mul, Subtype.mk_eq_mk.mp x.val_inv, v.valuation.map_one]⟩
  left_inv _ := by ext; rfl
  right_inv _ := by ext; rfl
  map_mul' _ _ := by 

Proof state:
R : Type u
inst✝⁵ : CommRing R
inst✝⁴ : IsDomain R
inst✝³ : IsDedekindDomain R
S : Set (HeightOneSpectrum R)
K : Type v
inst✝² : Field K
inst✝¹ : Algebra R K
inst✝ : IsFractionRing R K
x✝¹ x✝ : ↥(unit S K)
⊢ Equiv.toFun
      {
        toFun := fun x =>
          { val := { val := ↑↑x, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x ≤ 1) },
            inv := { val := ↑(↑x)⁻¹, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x⁻¹ ≤ 1) },
            val_inv :=
              (_ :
                { val := ↑↑x, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x ≤ 1) } *
                    { val := ↑(↑x)⁻¹, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x⁻¹ ≤ 1) } =
                  1),
            inv_val :=
              (_ :
                { val := ↑(↑x)⁻¹, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x⁻¹ ≤ 1) } *
                    { val := ↑↑x, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x ≤ 1) } =
                  1) },
        invFun := fun x =>
          { val := Units.mk0 ↑↑x (_ : ↑↑x = 0 → False),
            property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑(Units.mk0 ↑↑x (_ : ↑↑x = 0 → False)) = 1) },
        left_inv :=
          (_ :
            ∀ (x : ↥(unit S K)),
              (fun x =>
                    { val := Units.mk0 ↑↑x (_ : ↑↑x = 0 → False),
                      property :=
                        (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑(Units.mk0 ↑↑x (_ : ↑↑x = 0 → False)) = 1) })
                  ((fun x =>
                      { val := { val := ↑↑x, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x ≤ 1) },
                        inv := { val := ↑(↑x)⁻¹, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x⁻¹ ≤ 1) },
                        val_inv :=
                          (_ :
                            { val := ↑↑x, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x ≤ 1) } *
                                { val := ↑(↑x)⁻¹,
                                  property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x⁻¹ ≤ 1) } =
                              1),
                        inv_val :=
                          (_ :
                            { val := ↑(↑x)⁻¹, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x⁻¹ ≤ 1) } *
                                { val := ↑↑x, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x ≤ 1) } =
                              1) })
                    x) =
                x),
        right_inv :=
          (_ :
            ∀ (x : (↥(integer S K))ˣ),
              (fun x =>
                    { val := { val := ↑↑x, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x ≤ 1) },
                      inv := { val := ↑(↑x)⁻¹, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x⁻¹ ≤ 1) },
                      val_inv :=
                        (_ :
                          { val := ↑↑x, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x ≤ 1) } *
                              { val := ↑(↑x)⁻¹, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x⁻¹ ≤ 1) } =
                            1),
                      inv_val :=
                        (_ :
                          { val := ↑(↑x)⁻¹, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x⁻¹ ≤ 1) } *
                              { val := ↑↑x, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x ≤ 1) } =
                            1) })
                  ((fun x =>
                      { val := Units.mk0 ↑↑x (_ : ↑↑x = 0 → False),
                        property :=
                          (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑(Units.mk0 ↑↑x (_ : ↑↑x = 0 → False)) = 1) })
                    x) =
                x) }
      (x✝¹ * x✝) =
    Equiv.toFun
        {
          toFun := fun x =>
            { val := { val := ↑↑x, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x ≤ 1) },
              inv := { val := ↑(↑x)⁻¹, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x⁻¹ ≤ 1) },
              val_inv :=
                (_ :
                  { val := ↑↑x, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x ≤ 1) } *
                      { val := ↑(↑x)⁻¹, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x⁻¹ ≤ 1) } =
                    1),
              inv_val :=
                (_ :
                  { val := ↑(↑x)⁻¹, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x⁻¹ ≤ 1) } *
                      { val := ↑↑x, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x ≤ 1) } =
                    1) },
          invFun := fun x =>
            { val := Units.mk0 ↑↑x (_ : ↑↑x = 0 → False),
              property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑(Units.mk0 ↑↑x (_ : ↑↑x = 0 → False)) = 1) },
          left_inv :=
            (_ :
              ∀ (x : ↥(unit S K)),
                (fun x =>
                      { val := Units.mk0 ↑↑x (_ : ↑↑x = 0 → False),
                        property :=
                          (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑(Units.mk0 ↑↑x (_ : ↑↑x = 0 → False)) = 1) })
                    ((fun x =>
                        { val := { val := ↑↑x, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x ≤ 1) },
                          inv :=
                            { val := ↑(↑x)⁻¹, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x⁻¹ ≤ 1) },
                          val_inv :=
                            (_ :
                              { val := ↑↑x, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x ≤ 1) } *
                                  { val := ↑(↑x)⁻¹,
                                    property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x⁻¹ ≤ 1) } =
                                1),
                          inv_val :=
                            (_ :
                              { val := ↑(↑x)⁻¹, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x⁻¹ ≤ 1) } *
                                  { val := ↑↑x, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x ≤ 1) } =
                                1) })
                      x) =
                  x),
          right_inv :=
            (_ :
              ∀ (x : (↥(integer S K))ˣ),
                (fun x =>
                      { val := { val := ↑↑x, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x ≤ 1) },
                        inv := { val := ↑(↑x)⁻¹, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x⁻¹ ≤ 1) },
                        val_inv :=
                          (_ :
                            { val := ↑↑x, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x ≤ 1) } *
                                { val := ↑(↑x)⁻¹,
                                  property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x⁻¹ ≤ 1) } =
                              1),
                        inv_val :=
                          (_ :
                            { val := ↑(↑x)⁻¹, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x⁻¹ ≤ 1) } *
                                { val := ↑↑x, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x ≤ 1) } =
                              1) })
                    ((fun x =>
                        { val := Units.mk0 ↑↑x (_ : ↑↑x = 0 → False),
                          property :=
                            (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑(Units.mk0 ↑↑x (_ : ↑↑x = 0 → False)) = 1) })
                      x) =
                  x) }
        x✝¹ *
      Equiv.toFun
        {
          toFun := fun x =>
            { val := { val := ↑↑x, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x ≤ 1) },
              inv := { val := ↑(↑x)⁻¹, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x⁻¹ ≤ 1) },
              val_inv :=
                (_ :
                  { val := ↑↑x, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x ≤ 1) } *
                      { val := ↑(↑x)⁻¹, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x⁻¹ ≤ 1) } =
                    1),
              inv_val :=
                (_ :
                  { val := ↑(↑x)⁻¹, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x⁻¹ ≤ 1) } *
                      { val := ↑↑x, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x ≤ 1) } =
                    1) },
          invFun := fun x =>
            { val := Units.mk0 ↑↑x (_ : ↑↑x = 0 → False),
              property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑(Units.mk0 ↑↑x (_ : ↑↑x = 0 → False)) = 1) },
          left_inv :=
            (_ :
              ∀ (x : ↥(unit S K)),
                (fun x =>
                      { val := Units.mk0 ↑↑x (_ : ↑↑x = 0 → False),
                        property :=
                          (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑(Units.mk0 ↑↑x (_ : ↑↑x = 0 → False)) = 1) })
                    ((fun x =>
                        { val := { val := ↑↑x, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x ≤ 1) },
                          inv :=
                            { val := ↑(↑x)⁻¹, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x⁻¹ ≤ 1) },
                          val_inv :=
                            (_ :
                              { val := ↑↑x, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x ≤ 1) } *
                                  { val := ↑(↑x)⁻¹,
                                    property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x⁻¹ ≤ 1) } =
                                1),
                          inv_val :=
                            (_ :
                              { val := ↑(↑x)⁻¹, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x⁻¹ ≤ 1) } *
                                  { val := ↑↑x, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x ≤ 1) } =
                                1) })
                      x) =
                  x),
          right_inv :=
            (_ :
              ∀ (x : (↥(integer S K))ˣ),
                (fun x =>
                      { val := { val := ↑↑x, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x ≤ 1) },
                        inv := { val := ↑(↑x)⁻¹, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x⁻¹ ≤ 1) },
                        val_inv :=
                          (_ :
                            { val := ↑↑x, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x ≤ 1) } *
                                { val := ↑(↑x)⁻¹,
                                  property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x⁻¹ ≤ 1) } =
                              1),
                        inv_val :=
                          (_ :
                            { val := ↑(↑x)⁻¹, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x⁻¹ ≤ 1) } *
                                { val := ↑↑x, property := (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑↑x ≤ 1) } =
                              1) })
                    ((fun x =>
                        { val := Units.mk0 ↑↑x (_ : ↑↑x = 0 → False),
                          property :=
                            (_ : ∀ v ∉ S, (HeightOneSpectrum.valuation v) ↑(Units.mk0 ↑↑x (_ : ↑↑x = 0 → False)) = 1) })
                      x) =
                  x) }
        x✝

Next tactic:
ext