Documentation

Mathlib.Algebra.Group.Units.Defs

Units (i.e., invertible elements) of a monoid #

An element of a Monoid is a unit if it has a two-sided inverse.

Main declarations #

For both declarations, there is an additive counterpart: AddUnits and IsAddUnit. See also Prime, Associated, and Irreducible in Mathlib/Algebra/GroupWithZero/Associated.lean.

Notation #

We provide as notation for Units M, resembling the notation $R^{\times}$ for the units of a ring, which is common in mathematics.

TODO #

The results here should be used to golf the basic Group lemmas.

structure Units (α : Type u) [Monoid α] :

Units of a Monoid, bundled version. Notation: αˣ.

An element of a Monoid is a unit if it has a two-sided inverse. This version bundles the inverse element so that it can be computed. For a predicate see IsUnit.

  • val : α

    The underlying value in the base Monoid.

  • inv : α

    The inverse value of val in the base Monoid.

  • val_inv : self * self.inv = 1

    inv is the right inverse of val in the base Monoid.

  • inv_val : self.inv * self = 1

    inv is the left inverse of val in the base Monoid.

Instances For
    def «term_ˣ» :
    Lean.TrailingParserDescr

    Units of a Monoid, bundled version. Notation: αˣ.

    An element of a Monoid is a unit if it has a two-sided inverse. This version bundles the inverse element so that it can be computed. For a predicate see IsUnit.

    Instances For
      structure AddUnits (α : Type u) [AddMonoid α] :

      Units of an AddMonoid, bundled version.

      An element of an AddMonoid is a unit if it has a two-sided additive inverse. This version bundles the inverse element so that it can be computed. For a predicate see isAddUnit.

      • val : α

        The underlying value in the base AddMonoid.

      • neg : α

        The additive inverse value of val in the base AddMonoid.

      • val_neg : self + self.neg = 0

        neg is the right additive inverse of val in the base AddMonoid.

      • neg_val : self.neg + self = 0

        neg is the left additive inverse of val in the base AddMonoid.

      Instances For
        @[implicit_reducible]
        instance Units.instCoeHead {α : Type u} [Monoid α] :
        CoeHead αˣ α

        A unit can be interpreted as a term in the base Monoid.

        @[implicit_reducible]
        instance AddUnits.instCoeHead {α : Type u} [AddMonoid α] :
        CoeHead (AddUnits α) α

        An additive unit can be interpreted as a term in the base AddMonoid.

        @[implicit_reducible]
        instance Units.instInv {α : Type u} [Monoid α] :
        Inv αˣ

        The inverse of a unit in a Monoid.

        @[implicit_reducible]
        instance AddUnits.instNeg {α : Type u} [AddMonoid α] :
        Neg (AddUnits α)

        The additive inverse of an additive unit in an AddMonoid.

        def Units.Simps.val_inv {α : Type u} [Monoid α] (u : αˣ) :
        α

        See Note [custom simps projection]

        Instances For
          def AddUnits.Simps.val_neg {α : Type u} [AddMonoid α] (u : AddUnits α) :
          α

          See Note [custom simps projection]

          Instances For
            theorem Units.val_mk {α : Type u} [Monoid α] (a b : α) (h₁ : a * b = 1) (h₂ : b * a = 1) :
            { val := a, inv := b, val_inv := h₁, inv_val := h₂ } = a
            theorem AddUnits.val_mk {α : Type u} [AddMonoid α] (a b : α) (h₁ : a + b = 0) (h₂ : b + a = 0) :
            { val := a, neg := b, val_neg := h₁, neg_val := h₂ } = a
            theorem Units.val_injective {α : Type u} [Monoid α] :
            Function.Injective val
            theorem AddUnits.val_injective {α : Type u} [AddMonoid α] :
            Function.Injective val
            theorem Units.ext {α : Type u} [Monoid α] {u v : αˣ} (huv : u = v) :
            u = v
            theorem AddUnits.ext {α : Type u} [AddMonoid α] {u v : AddUnits α} (huv : u = v) :
            u = v
            theorem Units.ext_iff {α : Type u} [Monoid α] {u v : αˣ} :
            u = v u = v
            theorem AddUnits.ext_iff {α : Type u} [AddMonoid α] {u v : AddUnits α} :
            u = v u = v
            theorem Units.val_inj {α : Type u} [Monoid α] {a b : αˣ} :
            a = b a = b
            theorem AddUnits.val_inj {α : Type u} [AddMonoid α] {a b : AddUnits α} :
            a = b a = b
            @[implicit_reducible]
            instance Units.instDecidableEq {α : Type u} [Monoid α] [DecidableEq α] :
            DecidableEq αˣ

            Units have decidable equality if the base Monoid has decidable equality.

            @[implicit_reducible]
            instance AddUnits.instDecidableEq {α : Type u} [AddMonoid α] [DecidableEq α] :
            DecidableEq (AddUnits α)

            Additive units have decidable equality if the base AddMonoid has decidable equality.

            @[simp]
            theorem Units.mk_val {α : Type u} [Monoid α] (u : αˣ) (y : α) (h₁ : u * y = 1) (h₂ : y * u = 1) :
            { val := u, inv := y, val_inv := h₁, inv_val := h₂ } = u
            @[simp]
            theorem AddUnits.mk_val {α : Type u} [AddMonoid α] (u : AddUnits α) (y : α) (h₁ : u + y = 0) (h₂ : y + u = 0) :
            { val := u, neg := y, val_neg := h₁, neg_val := h₂ } = u
            def Units.copy {α : Type u} [Monoid α] (u : αˣ) (val : α) (hv : val = u) (inv : α) (hi : inv = u⁻¹) :
            αˣ

            Copy a unit, adjusting definition equalities.

            Instances For
              def AddUnits.copy {α : Type u} [AddMonoid α] (u : AddUnits α) (val : α) (hv : val = u) (neg : α) (hi : neg = ↑(-u)) :

              Copy an AddUnit, adjusting definitional equalities.

              Instances For
                @[simp]
                theorem Units.val_copy {α : Type u} [Monoid α] (u : αˣ) (val : α) (hv : val = u) (inv : α) (hi : inv = u⁻¹) :
                (u.copy val hv inv hi) = val
                @[simp]
                theorem AddUnits.val_copy {α : Type u} [AddMonoid α] (u : AddUnits α) (val : α) (hv : val = u) (neg : α) (hi : neg = ↑(-u)) :
                (u.copy val hv neg hi) = val
                @[simp]
                theorem AddUnits.val_neg_copy {α : Type u} [AddMonoid α] (u : AddUnits α) (val : α) (hv : val = u) (neg : α) (hi : neg = ↑(-u)) :
                ↑(-u.copy val hv neg hi) = neg
                @[simp]
                theorem Units.val_inv_copy {α : Type u} [Monoid α] (u : αˣ) (val : α) (hv : val = u) (inv : α) (hi : inv = u⁻¹) :
                (u.copy val hv inv hi)⁻¹ = inv
                theorem Units.copy_eq {α : Type u} [Monoid α] (u : αˣ) (val : α) (hv : val = u) (inv : α) (hi : inv = u⁻¹) :
                u.copy val hv inv hi = u
                theorem AddUnits.copy_eq {α : Type u} [AddMonoid α] (u : AddUnits α) (val : α) (hv : val = u) (neg : α) (hi : neg = ↑(-u)) :
                u.copy val hv neg hi = u
                @[implicit_reducible]
                instance Units.instMul {α : Type u} [Monoid α] :
                Mul αˣ

                Units of a monoid have an induced multiplication.

                @[implicit_reducible]
                instance AddUnits.instAdd {α : Type u} [AddMonoid α] :
                Add (AddUnits α)

                Additive units of an additive monoid have an induced addition.

                @[implicit_reducible]
                instance Units.instOne {α : Type u} [Monoid α] :
                One αˣ

                Units of a monoid have a unit

                @[implicit_reducible]
                instance AddUnits.instZero {α : Type u} [AddMonoid α] :
                Zero (AddUnits α)

                Additive units of an additive monoid have a zero.

                @[implicit_reducible]
                instance Units.instMulOneClass {α : Type u} [Monoid α] :

                Units of a monoid have a multiplication and multiplicative identity.

                @[implicit_reducible]

                Additive units of an additive monoid have an addition and an additive identity.

                @[implicit_reducible]
                instance Units.instInhabited {α : Type u} [Monoid α] :
                Inhabited αˣ

                Units of a monoid are inhabited because 1 is a unit.

                @[implicit_reducible]
                instance AddUnits.instInhabited {α : Type u} [AddMonoid α] :
                Inhabited (AddUnits α)

                Additive units of an additive monoid are inhabited because 0 is an additive unit.

                @[implicit_reducible]
                instance Units.instRepr {α : Type u} [Monoid α] [Repr α] :
                Repr αˣ

                Units of a monoid have a representation of the base value in the Monoid.

                @[implicit_reducible]
                instance AddUnits.instRepr {α : Type u} [AddMonoid α] [Repr α] :
                Repr (AddUnits α)

                Additive units of an additive monoid have a representation of the base value in the AddMonoid.

                @[simp]
                theorem Units.val_mul {α : Type u} [Monoid α] (a b : αˣ) :
                (a * b) = a * b
                @[simp]
                theorem AddUnits.val_add {α : Type u} [AddMonoid α] (a b : AddUnits α) :
                (a + b) = a + b
                @[simp]
                theorem Units.val_one {α : Type u} [Monoid α] :
                1 = 1
                @[simp]
                theorem AddUnits.val_zero {α : Type u} [AddMonoid α] :
                0 = 0
                @[simp]
                theorem Units.val_eq_one {α : Type u} [Monoid α] {a : αˣ} :
                a = 1 a = 1
                @[simp]
                theorem AddUnits.val_eq_zero {α : Type u} [AddMonoid α] {a : AddUnits α} :
                a = 0 a = 0
                @[simp]
                theorem Units.inv_mk {α : Type u} [Monoid α] (x y : α) (h₁ : x * y = 1) (h₂ : y * x = 1) :
                { val := x, inv := y, val_inv := h₁, inv_val := h₂ }⁻¹ = { val := y, inv := x, val_inv := h₂, inv_val := h₁ }
                @[simp]
                theorem AddUnits.neg_mk {α : Type u} [AddMonoid α] (x y : α) (h₁ : x + y = 0) (h₂ : y + x = 0) :
                -{ val := x, neg := y, val_neg := h₁, neg_val := h₂ } = { val := y, neg := x, val_neg := h₂, neg_val := h₁ }
                @[simp]
                theorem Units.inv_eq_val_inv {α : Type u} [Monoid α] (a : αˣ) :
                a.inv = a⁻¹
                @[simp]
                theorem AddUnits.neg_eq_val_neg {α : Type u} [AddMonoid α] (a : AddUnits α) :
                a.neg = ↑(-a)
                @[simp]
                theorem Units.inv_mul {α : Type u} [Monoid α] (a : αˣ) :
                a⁻¹ * a = 1
                @[simp]
                theorem AddUnits.neg_add {α : Type u} [AddMonoid α] (a : AddUnits α) :
                ↑(-a) + a = 0
                @[simp]
                theorem Units.mul_inv {α : Type u} [Monoid α] (a : αˣ) :
                a * a⁻¹ = 1
                @[simp]
                theorem AddUnits.add_neg {α : Type u} [AddMonoid α] (a : AddUnits α) :
                a + ↑(-a) = 0
                theorem Units.commute_coe_inv {α : Type u} [Monoid α] (a : αˣ) :
                Commute a a⁻¹
                theorem Units.commute_inv_coe {α : Type u} [Monoid α] (a : αˣ) :
                Commute a⁻¹ a
                theorem Units.inv_mul_of_eq {α : Type u} [Monoid α] {u : αˣ} {a : α} (h : u = a) :
                u⁻¹ * a = 1
                theorem AddUnits.neg_add_of_eq {α : Type u} [AddMonoid α] {u : AddUnits α} {a : α} (h : u = a) :
                ↑(-u) + a = 0
                theorem Units.mul_inv_of_eq {α : Type u} [Monoid α] {u : αˣ} {a : α} (h : u = a) :
                a * u⁻¹ = 1
                theorem AddUnits.add_neg_of_eq {α : Type u} [AddMonoid α] {u : AddUnits α} {a : α} (h : u = a) :
                a + ↑(-u) = 0
                @[simp]
                theorem Units.mul_inv_cancel_left {α : Type u} [Monoid α] (a : αˣ) (b : α) :
                a * (a⁻¹ * b) = b
                @[simp]
                theorem AddUnits.add_neg_cancel_left {α : Type u} [AddMonoid α] (a : AddUnits α) (b : α) :
                a + (↑(-a) + b) = b
                @[simp]
                theorem Units.inv_mul_cancel_left {α : Type u} [Monoid α] (a : αˣ) (b : α) :
                a⁻¹ * (a * b) = b
                @[simp]
                theorem AddUnits.neg_add_cancel_left {α : Type u} [AddMonoid α] (a : AddUnits α) (b : α) :
                ↑(-a) + (a + b) = b
                theorem Units.inv_mul_eq_iff_eq_mul {α : Type u} [Monoid α] (a : αˣ) {b c : α} :
                a⁻¹ * b = c b = a * c
                theorem AddUnits.neg_add_eq_iff_eq_add {α : Type u} [AddMonoid α] (a : AddUnits α) {b c : α} :
                ↑(-a) + b = c b = a + c
                @[implicit_reducible]
                instance Units.instMonoid {α : Type u} [Monoid α] :
                @[implicit_reducible]
                @[implicit_reducible]
                instance Units.instDiv {α : Type u} [Monoid α] :
                Div αˣ

                Units of a monoid have division

                @[implicit_reducible]
                instance AddUnits.instSub {α : Type u} [AddMonoid α] :
                Sub (AddUnits α)

                Additive units of an additive monoid have subtraction.

                @[implicit_reducible]

                Units of a monoid form a DivInvMonoid.

                @[implicit_reducible]

                Additive units of an additive monoid form a SubNegMonoid.

                @[implicit_reducible]
                instance Units.instGroup {α : Type u} [Monoid α] :

                Units of a monoid form a group.

                @[implicit_reducible]

                Additive units of an additive monoid form an additive group.

                @[implicit_reducible]

                Units of a commutative monoid form a commutative group.

                @[implicit_reducible]

                Additive units of an additive commutative monoid form an additive commutative group.

                @[simp]
                theorem Units.val_pow_eq_pow_val {α : Type u} [Monoid α] (a : αˣ) (n : ) :
                (a ^ n) = a ^ n
                @[simp]
                theorem AddUnits.val_nsmul_eq_nsmul_val {α : Type u} [AddMonoid α] (a : AddUnits α) (n : ) :
                (n a) = n a
                @[simp]
                theorem Units.inv_pow_eq_pow_inv {α : Type u} [Monoid α] (a : αˣ) (n : ) :
                (a ^ n)⁻¹ = a⁻¹ ^ n
                @[simp]
                theorem AddUnits.neg_nsmul_eq_nsmul_neg {α : Type u} [AddMonoid α] (a : AddUnits α) (n : ) :
                ↑(-(n a)) = n ↑(-a)
                @[simp]
                theorem Units.val_inv_eq_inv_val {α : Type u} [DivisionMonoid α] (u : αˣ) :
                u⁻¹ = (↑u)⁻¹
                @[simp]
                theorem AddUnits.val_neg_eq_neg_val {α : Type u} [SubtractionMonoid α] (u : AddUnits α) :
                ↑(-u) = -u
                @[simp]
                theorem Units.val_div_eq_div_val {α : Type u} [DivisionMonoid α] (u₁ u₂ : αˣ) :
                (u₁ / u₂) = u₁ / u₂
                @[simp]
                theorem AddUnits.val_sub_eq_sub_val {α : Type u} [SubtractionMonoid α] (u₁ u₂ : AddUnits α) :
                (u₁ - u₂) = u₁ - u₂
                def Units.mkOfMulEqOne {α : Type u} [Monoid α] [IsDedekindFiniteMonoid α] (a b : α) (hab : a * b = 1) :
                αˣ

                For a, b in a Dedekind-finite monoid such that a * b = 1, makes a unit out of a.

                Instances For
                  def AddUnits.mkOfAddEqZero {α : Type u} [AddMonoid α] [IsDedekindFiniteAddMonoid α] (a b : α) (hab : a + b = 0) :

                  For a, b in a Dedekind-finite additive monoid such that a + b = 0, makes an addUnit out of a.

                  Instances For
                    @[simp]
                    theorem Units.val_mkOfMulEqOne {α : Type u} [Monoid α] [IsDedekindFiniteMonoid α] {a b : α} (h : a * b = 1) :
                    (mkOfMulEqOne a b h) = a
                    @[simp]
                    theorem AddUnits.val_mkOfAddEqZero {α : Type u} [AddMonoid α] [IsDedekindFiniteAddMonoid α] {a b : α} (h : a + b = 0) :
                    (mkOfAddEqZero a b h) = a
                    def divp {α : Type u} [Monoid α] (a : α) (u : αˣ) :
                    α

                    Partial division, denoted a /ₚ u. It is defined when the second argument is invertible, and unlike the division operator in DivisionRing it is not totalized at zero.

                    Instances For
                      def «term_/ₚ_» :
                      Lean.TrailingParserDescr

                      Partial division, denoted a /ₚ u. It is defined when the second argument is invertible, and unlike the division operator in DivisionRing it is not totalized at zero.

                      Instances For
                        @[simp]
                        theorem divp_self {α : Type u} [Monoid α] (u : αˣ) :
                        u /ₚ u = 1
                        @[simp]
                        theorem divp_one {α : Type u} [Monoid α] (a : α) :
                        a /ₚ 1 = a
                        theorem divp_assoc {α : Type u} [Monoid α] (a b : α) (u : αˣ) :
                        a * b /ₚ u = a * (b /ₚ u)
                        @[simp]
                        theorem divp_inv {α : Type u} [Monoid α] {a : α} (u : αˣ) :
                        a /ₚ u⁻¹ = a * u
                        @[simp]
                        theorem divp_mul_cancel {α : Type u} [Monoid α] (a : α) (u : αˣ) :
                        a /ₚ u * u = a
                        @[simp]
                        theorem mul_divp_cancel {α : Type u} [Monoid α] (a : α) (u : αˣ) :
                        a * u /ₚ u = a
                        theorem divp_divp_eq_divp_mul {α : Type u} [Monoid α] (x : α) (u₁ u₂ : αˣ) :
                        x /ₚ u₁ /ₚ u₂ = x /ₚ (u₂ * u₁)
                        @[simp]
                        theorem one_divp {α : Type u} [Monoid α] (u : αˣ) :
                        1 /ₚ u = u⁻¹
                        theorem inv_eq_one_divp {α : Type u} [Monoid α] (u : αˣ) :
                        u⁻¹ = 1 /ₚ u
                        theorem val_div_eq_divp {α : Type u} [Monoid α] (u₁ u₂ : αˣ) :
                        (u₁ / u₂) = u₁ /ₚ u₂

                        IsUnit predicate #

                        def IsUnit {M : Type u_1} [Monoid M] (a : M) :

                        An element a : M of a Monoid is a unit if it has a two-sided inverse. The actual definition says that a is equal to some u : Mˣ, where is a bundled version of IsUnit.

                        Instances For
                          def IsAddUnit {M : Type u_1} [AddMonoid M] (a : M) :

                          An element a : M of an AddMonoid is an AddUnit if it has a two-sided additive inverse. The actual definition says that a is equal to some u : AddUnits M, where AddUnits M is a bundled version of IsAddUnit.

                          Instances For
                            theorem isUnit_iff_exists {M : Type u_1} [Monoid M] {x : M} :
                            IsUnit x ∃ (b : M), x * b = 1 b * x = 1

                            See isUnit_iff_exists_and_exists for a similar lemma with two existentials.

                            theorem isAddUnit_iff_exists {M : Type u_1} [AddMonoid M] {x : M} :
                            IsAddUnit x ∃ (b : M), x + b = 0 b + x = 0

                            See isAddUnit_iff_exists_and_exists for a similar lemma with two existentials.

                            theorem isUnit_iff_exists_and_exists {M : Type u_1} [Monoid M] {a : M} :
                            IsUnit a (∃ (b : M), a * b = 1) ∃ (c : M), c * a = 1

                            See isUnit_iff_exists for a similar lemma with one existential.

                            theorem isAddUnit_iff_exists_and_exists {M : Type u_1} [AddMonoid M] {a : M} :
                            IsAddUnit a (∃ (b : M), a + b = 0) ∃ (c : M), c + a = 0

                            See isAddUnit_iff_exists for a similar lemma with one existential.

                            @[simp]
                            theorem Units.isUnit {M : Type u_1} [Monoid M] (u : Mˣ) :
                            IsUnit u
                            @[simp]
                            theorem AddUnits.isAddUnit {M : Type u_1} [AddMonoid M] (u : AddUnits M) :
                            @[simp]
                            theorem isUnit_one {M : Type u_1} [Monoid M] :
                            @[simp]
                            theorem isAddUnit_zero {M : Type u_1} [AddMonoid M] :
                            theorem IsUnit.of_mul_eq_one {M : Type u_1} [Monoid M] [IsDedekindFiniteMonoid M] {a : M} (b : M) (h : a * b = 1) :
                            theorem IsAddUnit.of_add_eq_zero {M : Type u_1} [AddMonoid M] [IsDedekindFiniteAddMonoid M] {a : M} (b : M) (h : a + b = 0) :
                            @[deprecated IsUnit.of_mul_eq_one (since := "2025-11-05")]
                            theorem isUnit_of_mul_eq_one {M : Type u_1} [Monoid M] [IsDedekindFiniteMonoid M] {a : M} (b : M) (h : a * b = 1) :

                            Alias of IsUnit.of_mul_eq_one.

                            theorem IsUnit.of_mul_eq_one_right {M : Type u_1} [Monoid M] [IsDedekindFiniteMonoid M] {b : M} (a : M) (h : a * b = 1) :
                            theorem IsAddUnit.of_add_eq_zero_right {M : Type u_1} [AddMonoid M] [IsDedekindFiniteAddMonoid M] {b : M} (a : M) (h : a + b = 0) :
                            @[deprecated IsUnit.of_mul_eq_one_right (since := "2025-11-05")]
                            theorem isUnit_of_mul_eq_one_right {M : Type u_1} [Monoid M] [IsDedekindFiniteMonoid M] {b : M} (a : M) (h : a * b = 1) :

                            Alias of IsUnit.of_mul_eq_one_right.

                            theorem IsUnit.exists_right_inv {M : Type u_1} [Monoid M] {a : M} (h : IsUnit a) :
                            ∃ (b : M), a * b = 1
                            theorem IsAddUnit.exists_neg {M : Type u_1} [AddMonoid M] {a : M} (h : IsAddUnit a) :
                            ∃ (b : M), a + b = 0
                            theorem IsUnit.exists_left_inv {M : Type u_1} [Monoid M] {a : M} (h : IsUnit a) :
                            ∃ (b : M), b * a = 1
                            theorem IsAddUnit.exists_neg' {M : Type u_1} [AddMonoid M] {a : M} (h : IsAddUnit a) :
                            ∃ (b : M), b + a = 0
                            theorem IsUnit.mul {M : Type u_1} [Monoid M] {a b : M} :
                            IsUnit aIsUnit bIsUnit (a * b)
                            theorem IsAddUnit.add {M : Type u_1} [AddMonoid M] {a b : M} :
                            IsAddUnit aIsAddUnit bIsAddUnit (a + b)
                            theorem IsUnit.pow {M : Type u_1} [Monoid M] {a : M} (n : ) :
                            IsUnit aIsUnit (a ^ n)
                            theorem IsAddUnit.nsmul {M : Type u_1} [AddMonoid M] {a : M} (n : ) :
                            IsAddUnit aIsAddUnit (n a)
                            theorem Subsingleton.units_of_isUnit {M : Type u_1} [Monoid M] (h : ∀ (a : M), IsUnit aa = 1) :
                            Subsingleton Mˣ
                            theorem Subsingleton.addUnits_of_isAddUnit {M : Type u_1} [AddMonoid M] (h : ∀ (a : M), IsAddUnit aa = 0) :
                            Subsingleton (AddUnits M)
                            theorem Units.eq_one {M : Type u_1} [Monoid M] [Subsingleton Mˣ] (u : Mˣ) :
                            u = 1
                            theorem AddUnits.eq_zero {M : Type u_1} [AddMonoid M] [Subsingleton (AddUnits M)] (u : AddUnits M) :
                            u = 0
                            theorem IsUnit.eq_one {M : Type u_1} [Monoid M] {a : M} [Subsingleton Mˣ] :
                            IsUnit aa = 1
                            theorem IsAddUnit.eq_zero {M : Type u_1} [AddMonoid M] {a : M} [Subsingleton (AddUnits M)] :
                            IsAddUnit aa = 0
                            @[deprecated Units.eq_one (since := "2025-11-19")]
                            theorem units_eq_one {M : Type u_1} [Monoid M] [Subsingleton Mˣ] (u : Mˣ) :
                            u = 1

                            Alias of Units.eq_one.

                            @[simp]
                            theorem isUnit_iff_eq_one {M : Type u_1} [Monoid M] {a : M} [Subsingleton Mˣ] :
                            IsUnit a a = 1
                            @[simp]
                            theorem isAddUnit_iff_eq_zero {M : Type u_1} [AddMonoid M] {a : M} [Subsingleton (AddUnits M)] :
                            IsAddUnit a a = 0
                            theorem isUnit_iff_exists_inv {M : Type u_1} [Monoid M] [IsDedekindFiniteMonoid M] {a : M} :
                            IsUnit a ∃ (b : M), a * b = 1
                            theorem isAddUnit_iff_exists_neg {M : Type u_1} [AddMonoid M] [IsDedekindFiniteAddMonoid M] {a : M} :
                            IsAddUnit a ∃ (b : M), a + b = 0
                            theorem isUnit_iff_exists_inv' {M : Type u_1} [Monoid M] [IsDedekindFiniteMonoid M] {a : M} :
                            IsUnit a ∃ (b : M), b * a = 1
                            theorem isAddUnit_iff_exists_neg' {M : Type u_1} [AddMonoid M] [IsDedekindFiniteAddMonoid M] {a : M} :
                            IsAddUnit a ∃ (b : M), b + a = 0
                            @[simp]
                            theorem Units.isUnit_mul_units {M : Type u_1} [Monoid M] (a : M) (u : Mˣ) :
                            IsUnit (a * u) IsUnit a

                            Multiplication by a u : Mˣ on the right doesn't affect IsUnit.

                            @[simp]
                            theorem AddUnits.isAddUnit_add_addUnits {M : Type u_1} [AddMonoid M] (a : M) (u : AddUnits M) :
                            IsAddUnit (a + u) IsAddUnit a

                            Addition of a u : AddUnits M on the right doesn't affect IsAddUnit.

                            @[simp]
                            theorem Units.isUnit_units_mul {M : Type u_3} [Monoid M] (u : Mˣ) (a : M) :
                            IsUnit (u * a) IsUnit a

                            Multiplication by a u : Mˣ on the left doesn't affect IsUnit.

                            @[simp]
                            theorem AddUnits.isAddUnit_addUnits_add {M : Type u_3} [AddMonoid M] (u : AddUnits M) (a : M) :
                            IsAddUnit (u + a) IsAddUnit a

                            Addition of a u : AddUnits M on the left doesn't affect IsAddUnit.

                            theorem isUnit_of_mul_isUnit_left {M : Type u_1} [Monoid M] [IsDedekindFiniteMonoid M] {x y : M} (hu : IsUnit (x * y)) :
                            theorem isUnit_of_mul_isUnit_right {M : Type u_1} [Monoid M] [IsDedekindFiniteMonoid M] {x y : M} (hu : IsUnit (x * y)) :
                            @[simp]
                            theorem IsUnit.mul_iff {M : Type u_1} [Monoid M] [IsDedekindFiniteMonoid M] {x y : M} :
                            IsUnit (x * y) IsUnit x IsUnit y
                            @[simp]
                            theorem IsAddUnit.add_iff {M : Type u_1} [AddMonoid M] [IsDedekindFiniteAddMonoid M] {x y : M} :
                            IsAddUnit (x + y) IsAddUnit x IsAddUnit y
                            noncomputable def IsUnit.unit {M : Type u_1} [Monoid M] {a : M} (h : IsUnit a) :

                            The element of the group of units, corresponding to an element of a monoid which is a unit. When α is a DivisionMonoid, use IsUnit.unit' instead.

                            Instances For
                              noncomputable def IsAddUnit.addUnit {M : Type u_1} [AddMonoid M] {a : M} (h : IsAddUnit a) :

                              The element of the additive group of additive units, corresponding to an element of an additive monoid which is an additive unit. When α is a SubtractionMonoid, use IsAddUnit.addUnit' instead.

                              Instances For
                                @[simp]
                                theorem IsUnit.unit_of_val_units {M : Type u_1} [Monoid M] {a : Mˣ} (h : IsUnit a) :
                                h.unit = a
                                @[simp]
                                theorem IsAddUnit.addUnit_of_val_addUnits {M : Type u_1} [AddMonoid M] {a : AddUnits M} (h : IsAddUnit a) :
                                h.addUnit = a
                                @[simp]
                                theorem IsUnit.unit_spec {M : Type u_1} [Monoid M] {a : M} (h : IsUnit a) :
                                h.unit = a
                                @[simp]
                                theorem IsAddUnit.addUnit_spec {M : Type u_1} [AddMonoid M] {a : M} (h : IsAddUnit a) :
                                h.addUnit = a
                                @[simp]
                                theorem IsUnit.unit_one {M : Type u_1} [Monoid M] (h : IsUnit 1) :
                                h.unit = 1
                                @[simp]
                                theorem IsAddUnit.addUnit_zero {M : Type u_1} [AddMonoid M] (h : IsAddUnit 0) :
                                h.addUnit = 0
                                theorem IsUnit.unit_mul {M : Type u_1} [Monoid M] {a b : M} (ha : IsUnit a) (hb : IsUnit b) :
                                .unit = ha.unit * hb.unit
                                theorem IsAddUnit.addUnit_add {M : Type u_1} [AddMonoid M] {a b : M} (ha : IsAddUnit a) (hb : IsAddUnit b) :
                                .addUnit = ha.addUnit + hb.addUnit
                                theorem IsUnit.unit_pow {M : Type u_1} [Monoid M] {a : M} (h : IsUnit a) (n : ) :
                                .unit = h.unit ^ n
                                theorem IsAddUnit.addUnit_nsmul {M : Type u_1} [AddMonoid M] {a : M} (h : IsAddUnit a) (n : ) :
                                .addUnit = n h.addUnit
                                @[simp]
                                theorem IsUnit.val_inv_mul {M : Type u_1} [Monoid M] {a : M} (h : IsUnit a) :
                                h.unit⁻¹ * a = 1
                                @[simp]
                                theorem IsAddUnit.val_neg_add {M : Type u_1} [AddMonoid M] {a : M} (h : IsAddUnit a) :
                                ↑(-h.addUnit) + a = 0
                                @[simp]
                                theorem IsUnit.mul_val_inv {M : Type u_1} [Monoid M] {a : M} (h : IsUnit a) :
                                a * h.unit⁻¹ = 1
                                @[simp]
                                theorem IsAddUnit.add_val_neg {M : Type u_1} [AddMonoid M] {a : M} (h : IsAddUnit a) :
                                a + ↑(-h.addUnit) = 0
                                @[implicit_reducible]
                                instance IsUnit.instDecidableOfExistsUnitsEqVal {M : Type u_1} [Monoid M] (x : M) [h : Decidable (∃ (u : Mˣ), u = x)] :
                                Decidable (IsUnit x)

                                IsUnit x is decidable if we can decide if x comes from .

                                @[implicit_reducible]
                                instance IsAddUnit.instDecidableOfExistsAddUnitsEqVal {M : Type u_1} [AddMonoid M] (x : M) [h : Decidable (∃ (u : AddUnits M), u = x)] :
                                Decidable (IsAddUnit x)

                                IsAddUnit x is decidable if we can decide if x comes from AddUnits M.

                                @[simp]
                                theorem IsUnit.inv_mul_cancel {α : Type u} [DivisionMonoid α] {a : α} :
                                IsUnit aa⁻¹ * a = 1
                                @[simp]
                                theorem IsAddUnit.neg_add_cancel {α : Type u} [SubtractionMonoid α] {a : α} :
                                IsAddUnit a-a + a = 0
                                @[simp]
                                theorem IsUnit.mul_inv_cancel {α : Type u} [DivisionMonoid α] {a : α} :
                                IsUnit aa * a⁻¹ = 1
                                @[simp]
                                theorem IsAddUnit.add_neg_cancel {α : Type u} [SubtractionMonoid α] {a : α} :
                                IsAddUnit aa + -a = 0
                                def IsUnit.unit' {α : Type u} [DivisionMonoid α] {a : α} (h : IsUnit a) :
                                αˣ

                                The element of the group of units, corresponding to an element of a monoid which is a unit. As opposed to IsUnit.unit, the inverse is computable and comes from the inversion on α. This is useful to transfer properties of inversion in Units α to α. See also toUnits.

                                Instances For
                                  def IsAddUnit.addUnit' {α : Type u} [SubtractionMonoid α] {a : α} (h : IsAddUnit a) :

                                  The element of the additive group of additive units, corresponding to an element of an additive monoid which is an additive unit. As opposed to IsAddUnit.addUnit, the negation is computable and comes from the negation on α. This is useful to transfer properties of negation in AddUnits α to α. See also toAddUnits.

                                  Instances For
                                    @[simp]
                                    theorem IsAddUnit.val_addUnit' {α : Type u} [SubtractionMonoid α] {a : α} (h : IsAddUnit a) :
                                    h.addUnit' = a
                                    @[simp]
                                    theorem IsUnit.val_unit' {α : Type u} [DivisionMonoid α] {a : α} (h : IsUnit a) :
                                    h.unit' = a
                                    theorem IsUnit.val_inv_unit' {α : Type u} [DivisionMonoid α] {a : α} (h : IsUnit a) :
                                    theorem IsAddUnit.val_neg_addUnit' {α : Type u} [SubtractionMonoid α] {a : α} (h : IsAddUnit a) :
                                    ↑(-h.addUnit') = -a
                                    @[simp]
                                    theorem IsUnit.mul_inv_cancel_left {α : Type u} [DivisionMonoid α] {a : α} (h : IsUnit a) (b : α) :
                                    a * (a⁻¹ * b) = b
                                    @[simp]
                                    theorem IsAddUnit.add_neg_cancel_left {α : Type u} [SubtractionMonoid α] {a : α} (h : IsAddUnit a) (b : α) :
                                    a + (-a + b) = b
                                    @[simp]
                                    theorem IsUnit.inv_mul_cancel_left {α : Type u} [DivisionMonoid α] {a : α} (h : IsUnit a) (b : α) :
                                    a⁻¹ * (a * b) = b
                                    @[simp]
                                    theorem IsAddUnit.neg_add_cancel_left {α : Type u} [SubtractionMonoid α] {a : α} (h : IsAddUnit a) (b : α) :
                                    -a + (a + b) = b
                                    theorem IsUnit.div_self {α : Type u} [DivisionMonoid α] {a : α} (h : IsUnit a) :
                                    a / a = 1
                                    theorem IsAddUnit.sub_self {α : Type u} [SubtractionMonoid α] {a : α} (h : IsAddUnit a) :
                                    a - a = 0
                                    theorem IsUnit.inv {α : Type u} [DivisionMonoid α] {a : α} (h : IsUnit a) :
                                    theorem IsAddUnit.neg {α : Type u} [SubtractionMonoid α] {a : α} (h : IsAddUnit a) :
                                    theorem IsUnit.unit_inv {α : Type u} [DivisionMonoid α] {a : α} (h : IsUnit a) :
                                    .unit = h.unit⁻¹
                                    theorem IsUnit.div {α : Type u} [DivisionMonoid α] {a b : α} (ha : IsUnit a) (hb : IsUnit b) :
                                    IsUnit (a / b)
                                    theorem IsAddUnit.sub {α : Type u} [SubtractionMonoid α] {a b : α} (ha : IsAddUnit a) (hb : IsAddUnit b) :
                                    IsAddUnit (a - b)
                                    theorem IsUnit.unit_div {α : Type u} [DivisionMonoid α] {a b : α} (ha : IsUnit a) (hb : IsUnit b) :
                                    .unit = ha.unit / hb.unit
                                    theorem IsAddUnit.addUnit_sub {α : Type u} [SubtractionMonoid α] {a b : α} (ha : IsAddUnit a) (hb : IsAddUnit b) :
                                    .addUnit = ha.addUnit - hb.addUnit
                                    theorem IsUnit.div_mul_cancel_right {α : Type u} [DivisionMonoid α] {b : α} (h : IsUnit b) (a : α) :
                                    b / (a * b) = a⁻¹
                                    theorem IsAddUnit.sub_add_cancel_right {α : Type u} [SubtractionMonoid α] {b : α} (h : IsAddUnit b) (a : α) :
                                    b - (a + b) = -a
                                    theorem IsUnit.mul_div_mul_right {α : Type u} [DivisionMonoid α] {c : α} (h : IsUnit c) (a b : α) :
                                    a * c / (b * c) = a / b
                                    theorem IsAddUnit.add_sub_add_right {α : Type u} [SubtractionMonoid α] {c : α} (h : IsAddUnit c) (a b : α) :
                                    a + c - (b + c) = a - b
                                    theorem IsUnit.div_mul_cancel_left {α : Type u} [DivisionCommMonoid α] {a : α} (h : IsUnit a) (b : α) :
                                    a / (a * b) = b⁻¹
                                    theorem IsAddUnit.sub_add_cancel_left {α : Type u} [SubtractionCommMonoid α] {a : α} (h : IsAddUnit a) (b : α) :
                                    a - (a + b) = -b
                                    theorem IsUnit.mul_div_mul_left {α : Type u} [DivisionCommMonoid α] {c : α} (h : IsUnit c) (a b : α) :
                                    c * a / (c * b) = a / b
                                    theorem IsAddUnit.add_sub_add_left {α : Type u} [SubtractionCommMonoid α] {c : α} (h : IsAddUnit c) (a b : α) :
                                    c + a - (c + b) = a - b
                                    theorem divp_eq_div {α : Type u} [DivisionMonoid α] (a : α) (u : αˣ) :
                                    a /ₚ u = a / u
                                    theorem Group.isUnit {α : Type u} [Group α] (a : α) :
                                    theorem AddGroup.isAddUnit {α : Type u} [AddGroup α] (a : α) :
                                    @[implicit_reducible]
                                    noncomputable def invOfIsUnit {M : Type u_1} [Monoid M] (h : ∀ (a : M), IsUnit a) :
                                    Inv M

                                    Constructs an inv operation for a Monoid consisting only of units.

                                    Instances For
                                      @[implicit_reducible]
                                      noncomputable def groupOfIsUnit {M : Type u_1} [hM : Monoid M] (h : ∀ (a : M), IsUnit a) :

                                      Constructs a Group structure on a Monoid consisting only of units.

                                      Instances For
                                        @[implicit_reducible]
                                        noncomputable def commGroupOfIsUnit {M : Type u_1} [hM : CommMonoid M] (h : ∀ (a : M), IsUnit a) :

                                        Constructs a CommGroup structure on a CommMonoid consisting only of units.

                                        Instances For