Documentation

Mathlib.Algebra.Group.Units

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.Associated.

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
    theorem Units.val_inv {α : Type u} [Monoid α] (self : αˣ) :
    self * self.inv = 1

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

    theorem Units.inv_val {α : Type u} [Monoid α] (self : αˣ) :
    self.inv * self = 1

    inv is the left inverse of val in the base 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.

    Equations
    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
        theorem AddUnits.val_neg {α : Type u} [AddMonoid α] (self : AddUnits α) :
        self + self.neg = 0

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

        theorem AddUnits.neg_val {α : Type u} [AddMonoid α] (self : AddUnits α) :
        self.neg + self = 0

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

        theorem unique_zero {α : Type u_1} [Unique α] [Zero α] :
        default = 0
        theorem unique_one {α : Type u_1} [Unique α] [One α] :
        default = 1
        instance AddUnits.instCoeHead {α : Type u} [AddMonoid α] :

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

        Equations
        • AddUnits.instCoeHead = { coe := AddUnits.val }
        instance Units.instCoeHead {α : Type u} [Monoid α] :
        CoeHead αˣ α

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

        Equations
        • Units.instCoeHead = { coe := Units.val }
        instance AddUnits.instNeg {α : Type u} [AddMonoid α] :

        The additive inverse of an additive unit in an AddMonoid.

        Equations
        • AddUnits.instNeg = { neg := fun (u : AddUnits α) => { val := u.neg, neg := u, val_neg := , neg_val := } }
        instance Units.instInv {α : Type u} [Monoid α] :

        The inverse of a unit in a Monoid.

        Equations
        • Units.instInv = { inv := fun (u : αˣ) => { val := u.inv, inv := u, val_inv := , inv_val := } }
        def AddUnits.Simps.val_neg {α : Type u} [AddMonoid α] (u : AddUnits α) :
        α

        See Note [custom simps projection]

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

          See Note [custom simps projection]

          Equations
          Instances For
            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_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.ext {α : Type u} [AddMonoid α] :
            Function.Injective AddUnits.val
            theorem Units.ext_iff {α : Type u} [Monoid α] {a₁ : αˣ} {a₂ : αˣ} :
            a₁ = a₂ a₁ = a₂
            theorem AddUnits.ext_iff {α : Type u} [AddMonoid α] {a₁ : AddUnits α} {a₂ : AddUnits α} :
            a₁ = a₂ a₁ = a₂
            theorem Units.ext {α : Type u} [Monoid α] :
            theorem AddUnits.eq_iff {α : Type u} [AddMonoid α] {a : AddUnits α} {b : AddUnits α} :
            a = b a = b
            theorem Units.eq_iff {α : Type u} [Monoid α] {a : αˣ} {b : αˣ} :
            a = b a = b

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

            Equations

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

            Equations
            @[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
            @[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
            theorem AddUnits.copy.proof_2 {α : Type u_1} [AddMonoid α] (u : AddUnits α) (val : α) (hv : val = u) (inv : α) (hi : inv = (-u)) :
            inv + val = 0
            def AddUnits.copy {α : Type u} [AddMonoid α] (u : AddUnits α) (val : α) (hv : val = u) (inv : α) (hi : inv = (-u)) :

            Copy an AddUnit, adjusting definitional equalities.

            Equations
            • u.copy val hv inv hi = { val := val, neg := inv, val_neg := , neg_val := }
            Instances For
              theorem AddUnits.copy.proof_1 {α : Type u_1} [AddMonoid α] (u : AddUnits α) (val : α) (hv : val = u) (inv : α) (hi : inv = (-u)) :
              val + inv = 0
              @[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
              @[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) (inv : α) (hi : inv = (-u)) :
              (u.copy val hv inv hi) = val
              @[simp]
              theorem AddUnits.val_neg_copy {α : Type u} [AddMonoid α] (u : AddUnits α) (val : α) (hv : val = u) (inv : α) (hi : inv = (-u)) :
              (-u.copy val hv inv hi) = inv
              def Units.copy {α : Type u} [Monoid α] (u : αˣ) (val : α) (hv : val = u) (inv : α) (hi : inv = u⁻¹) :
              αˣ

              Copy a unit, adjusting definition equalities.

              Equations
              • u.copy val hv inv hi = { val := val, inv := inv, val_inv := , inv_val := }
              Instances For
                theorem AddUnits.copy_eq {α : Type u} [AddMonoid α] (u : AddUnits α) (val : α) (hv : val = u) (inv : α) (hi : inv = (-u)) :
                u.copy val hv inv hi = u
                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.instAdd.proof_2 {α : Type u_1} [AddMonoid α] (u₁ : AddUnits α) (u₂ : AddUnits α) :
                u₂.neg + u₁.neg + (u₁ + u₂) = 0
                theorem AddUnits.instAdd.proof_1 {α : Type u_1} [AddMonoid α] (u₁ : AddUnits α) (u₂ : AddUnits α) :
                u₁ + u₂ + (u₂.neg + u₁.neg) = 0
                instance AddUnits.instAdd {α : Type u} [AddMonoid α] :

                Additive units of an additive monoid have an induced addition.

                Equations
                • AddUnits.instAdd = { add := fun (u₁ u₂ : AddUnits α) => { val := u₁ + u₂, neg := u₂.neg + u₁.neg, val_neg := , neg_val := } }
                instance Units.instMul {α : Type u} [Monoid α] :

                Units of a monoid have an induced multiplication.

                Equations
                • Units.instMul = { mul := fun (u₁ u₂ : αˣ) => { val := u₁ * u₂, inv := u₂.inv * u₁.inv, val_inv := , inv_val := } }
                theorem AddUnits.instZero.proof_1 {α : Type u_1} [AddMonoid α] :
                0 + 0 = 0
                instance AddUnits.instZero {α : Type u} [AddMonoid α] :

                Additive units of an additive monoid have a zero.

                Equations
                • AddUnits.instZero = { zero := { val := 0, neg := 0, val_neg := , neg_val := } }
                instance Units.instOne {α : Type u} [Monoid α] :

                Units of a monoid have a unit

                Equations
                • Units.instOne = { one := { val := 1, inv := 1, val_inv := , inv_val := } }

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

                Equations
                theorem AddUnits.instAddZeroClass.proof_2 {α : Type u_1} [AddMonoid α] (u : AddUnits α) :
                u + 0 = u
                theorem AddUnits.instAddZeroClass.proof_1 {α : Type u_1} [AddMonoid α] (u : AddUnits α) :
                0 + u = u
                instance Units.instMulOneClass {α : Type u} [Monoid α] :

                Units of a monoid have a multiplication and multiplicative identity.

                Equations

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

                Equations
                • AddUnits.instInhabited = { default := 0 }
                instance Units.instInhabited {α : Type u} [Monoid α] :

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

                Equations
                • Units.instInhabited = { default := 1 }
                instance AddUnits.instRepr {α : Type u} [AddMonoid α] [Repr α] :

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

                Equations
                • AddUnits.instRepr = { reprPrec := reprPrec AddUnits.val }
                instance Units.instRepr {α : Type u} [Monoid α] [Repr α] :

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

                Equations
                • Units.instRepr = { reprPrec := reprPrec Units.val }
                @[simp]
                theorem AddUnits.val_add {α : Type u} [AddMonoid α] (a : AddUnits α) (b : AddUnits α) :
                (a + b) = a + b
                @[simp]
                theorem Units.val_mul {α : Type u} [Monoid α] (a : αˣ) (b : αˣ) :
                (a * b) = a * b
                @[simp]
                theorem AddUnits.val_zero {α : Type u} [AddMonoid α] :
                0 = 0
                @[simp]
                theorem Units.val_one {α : Type u} [Monoid α] :
                1 = 1
                @[simp]
                theorem AddUnits.val_eq_zero {α : Type u} [AddMonoid α] {a : AddUnits α} :
                a = 0 a = 0
                @[simp]
                theorem Units.val_eq_one {α : Type u} [Monoid α] {a : αˣ} :
                a = 1 a = 1
                @[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_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_eq_val_neg {α : Type u} [AddMonoid α] (a : AddUnits α) :
                a.neg = (-a)
                @[simp]
                theorem Units.inv_eq_val_inv {α : Type u} [Monoid α] (a : αˣ) :
                a.inv = a⁻¹
                @[simp]
                theorem AddUnits.neg_add {α : Type u} [AddMonoid α] (a : AddUnits α) :
                (-a) + a = 0
                @[simp]
                theorem Units.inv_mul {α : Type u} [Monoid α] (a : αˣ) :
                a⁻¹ * a = 1
                @[simp]
                theorem AddUnits.add_neg {α : Type u} [AddMonoid α] (a : AddUnits α) :
                a + (-a) = 0
                @[simp]
                theorem Units.mul_inv {α : Type u} [Monoid α] (a : αˣ) :
                a * a⁻¹ = 1
                theorem AddUnits.addCommute_coe_neg {α : Type u} [AddMonoid α] (a : AddUnits α) :
                AddCommute a (-a)
                theorem Units.commute_coe_inv {α : Type u} [Monoid α] (a : αˣ) :
                Commute a a⁻¹
                theorem AddUnits.addCommute_neg_coe {α : Type u} [AddMonoid α] (a : AddUnits α) :
                AddCommute (-a) a
                theorem Units.commute_inv_coe {α : Type u} [Monoid α] (a : αˣ) :
                Commute a⁻¹ a
                theorem AddUnits.neg_add_of_eq {α : Type u} [AddMonoid α] {u : AddUnits α} {a : α} (h : u = a) :
                (-u) + a = 0
                theorem Units.inv_mul_of_eq {α : Type u} [Monoid α] {u : αˣ} {a : α} (h : u = a) :
                u⁻¹ * a = 1
                theorem AddUnits.add_neg_of_eq {α : Type u} [AddMonoid α] {u : AddUnits α} {a : α} (h : u = a) :
                a + (-u) = 0
                theorem Units.mul_inv_of_eq {α : Type u} [Monoid α] {u : αˣ} {a : α} (h : u = a) :
                a * u⁻¹ = 1
                @[simp]
                theorem AddUnits.add_neg_cancel_left {α : Type u} [AddMonoid α] (a : AddUnits α) (b : α) :
                a + ((-a) + b) = b
                @[simp]
                theorem Units.mul_inv_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
                @[simp]
                theorem Units.inv_mul_cancel_left {α : Type u} [Monoid α] (a : αˣ) (b : α) :
                a⁻¹ * (a * b) = b
                @[simp]
                theorem AddUnits.add_neg_cancel_right {α : Type u} [AddMonoid α] (a : α) (b : AddUnits α) :
                a + b + (-b) = a
                @[simp]
                theorem Units.mul_inv_cancel_right {α : Type u} [Monoid α] (a : α) (b : αˣ) :
                a * b * b⁻¹ = a
                @[simp]
                theorem AddUnits.neg_add_cancel_right {α : Type u} [AddMonoid α] (a : α) (b : AddUnits α) :
                a + (-b) + b = a
                @[simp]
                theorem Units.inv_mul_cancel_right {α : Type u} [Monoid α] (a : α) (b : αˣ) :
                a * b⁻¹ * b = a
                @[simp]
                theorem AddUnits.add_right_inj {α : Type u} [AddMonoid α] (a : AddUnits α) {b : α} {c : α} :
                a + b = a + c b = c
                @[simp]
                theorem Units.mul_right_inj {α : Type u} [Monoid α] (a : αˣ) {b : α} {c : α} :
                a * b = a * c b = c
                @[simp]
                theorem AddUnits.add_left_inj {α : Type u} [AddMonoid α] (a : AddUnits α) {b : α} {c : α} :
                b + a = c + a b = c
                @[simp]
                theorem Units.mul_left_inj {α : Type u} [Monoid α] (a : αˣ) {b : α} {c : α} :
                b * a = c * a b = c
                theorem AddUnits.eq_add_neg_iff_add_eq {α : Type u} [AddMonoid α] (c : AddUnits α) {a : α} {b : α} :
                a = b + (-c) a + c = b
                theorem Units.eq_mul_inv_iff_mul_eq {α : Type u} [Monoid α] (c : αˣ) {a : α} {b : α} :
                a = b * c⁻¹ a * c = b
                theorem AddUnits.eq_neg_add_iff_add_eq {α : Type u} [AddMonoid α] (b : AddUnits α) {a : α} {c : α} :
                a = (-b) + c b + a = c
                theorem Units.eq_inv_mul_iff_mul_eq {α : Type u} [Monoid α] (b : αˣ) {a : α} {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
                theorem Units.inv_mul_eq_iff_eq_mul {α : Type u} [Monoid α] (a : αˣ) {b : α} {c : α} :
                a⁻¹ * b = c b = a * c
                theorem AddUnits.add_neg_eq_iff_eq_add {α : Type u} [AddMonoid α] (b : AddUnits α) {a : α} {c : α} :
                a + (-b) = c a = c + b
                theorem Units.mul_inv_eq_iff_eq_mul {α : Type u} [Monoid α] (b : αˣ) {a : α} {c : α} :
                a * b⁻¹ = c a = c * b
                theorem AddUnits.neg_eq_of_add_eq_zero_left {α : Type u} [AddMonoid α] {u : AddUnits α} {a : α} (h : a + u = 0) :
                (-u) = a
                theorem Units.inv_eq_of_mul_eq_one_left {α : Type u} [Monoid α] {u : αˣ} {a : α} (h : a * u = 1) :
                u⁻¹ = a
                theorem AddUnits.neg_eq_of_add_eq_zero_right {α : Type u} [AddMonoid α] {u : AddUnits α} {a : α} (h : u + a = 0) :
                (-u) = a
                theorem Units.inv_eq_of_mul_eq_one_right {α : Type u} [Monoid α] {u : αˣ} {a : α} (h : u * a = 1) :
                u⁻¹ = a
                theorem AddUnits.eq_neg_of_add_eq_zero_left {α : Type u} [AddMonoid α] {u : AddUnits α} {a : α} (h : u + a = 0) :
                a = (-u)
                theorem Units.eq_inv_of_mul_eq_one_left {α : Type u} [Monoid α] {u : αˣ} {a : α} (h : u * a = 1) :
                a = u⁻¹
                theorem AddUnits.eq_neg_of_add_eq_zero_right {α : Type u} [AddMonoid α] {u : AddUnits α} {a : α} (h : a + u = 0) :
                a = (-u)
                theorem Units.eq_inv_of_mul_eq_one_right {α : Type u} [Monoid α] {u : αˣ} {a : α} (h : a * u = 1) :
                a = u⁻¹
                theorem AddUnits.instAddMonoid.proof_7 {α : Type u_1} [AddMonoid α] (n : ) (a : AddUnits α) :
                (fun (n : ) (a : AddUnits α) => { val := n a, neg := n (-a), val_neg := , neg_val := }) (n + 1) a = (fun (n : ) (a : AddUnits α) => { val := n a, neg := n (-a), val_neg := , neg_val := }) n a + a
                theorem AddUnits.instAddMonoid.proof_1 {α : Type u_1} [AddMonoid α] :
                ∀ (x x_1 x_2 : AddUnits α), x + x_1 + x_2 = x + (x_1 + x_2)
                Equations
                • AddUnits.instAddMonoid = AddMonoid.mk (fun (n : ) (a : AddUnits α) => { val := n a, neg := n (-a), val_neg := , neg_val := })
                theorem AddUnits.instAddMonoid.proof_3 {α : Type u_1} [AddMonoid α] (a : AddUnits α) :
                a + 0 = a
                theorem AddUnits.instAddMonoid.proof_2 {α : Type u_1} [AddMonoid α] (a : AddUnits α) :
                0 + a = a
                theorem AddUnits.instAddMonoid.proof_4 {α : Type u_1} [AddMonoid α] (n : ) (a : AddUnits α) :
                n a + n (-a) = 0
                theorem AddUnits.instAddMonoid.proof_5 {α : Type u_1} [AddMonoid α] (n : ) (a : AddUnits α) :
                n (-a) + n a = 0
                theorem AddUnits.instAddMonoid.proof_6 {α : Type u_1} [AddMonoid α] (a : AddUnits α) :
                (fun (n : ) (a : AddUnits α) => { val := n a, neg := n (-a), val_neg := , neg_val := }) 0 a = 0
                instance Units.instMonoid {α : Type u} [Monoid α] :
                Equations
                • Units.instMonoid = Monoid.mk (fun (n : ) (a : αˣ) => { val := a ^ n, inv := a⁻¹ ^ n, val_inv := , inv_val := })
                theorem AddUnits.instSub.proof_1 {α : Type u_1} [AddMonoid α] (a : AddUnits α) (b : AddUnits α) :
                a + (-b) + (b + (-a)) = 0
                instance AddUnits.instSub {α : Type u} [AddMonoid α] :

                Additive units of an additive monoid have subtraction.

                Equations
                • AddUnits.instSub = { sub := fun (a b : AddUnits α) => { val := a + (-b), neg := b + (-a), val_neg := , neg_val := } }
                theorem AddUnits.instSub.proof_2 {α : Type u_1} [AddMonoid α] (a : AddUnits α) (b : AddUnits α) :
                b + (-a) + (a + (-b)) = 0
                instance Units.instDiv {α : Type u} [Monoid α] :

                Units of a monoid have division

                Equations
                • Units.instDiv = { div := fun (a b : αˣ) => { val := a * b⁻¹, inv := b * a⁻¹, val_inv := , inv_val := } }
                theorem AddUnits.instSubNegAddMonoid.proof_4 {α : Type u_1} [AddMonoid α] (n : ) (a : AddUnits α) :
                -((n + 1) a) = -((n + 1) a)
                theorem AddUnits.instSubNegAddMonoid.proof_3 {α : Type u_1} [AddMonoid α] (n : ) (a : AddUnits α) :
                (n + 1) a = n a + a

                Additive units of an additive monoid form a SubNegMonoid.

                Equations
                theorem AddUnits.instSubNegAddMonoid.proof_1 {α : Type u_1} [AddMonoid α] :
                ∀ (a b : AddUnits α), a - b = a - b
                theorem AddUnits.instSubNegAddMonoid.proof_2 {α : Type u_1} [AddMonoid α] (a : AddUnits α) :
                0 a = 0

                Units of a monoid form a DivInvMonoid.

                Equations

                Additive units of an additive monoid form an additive group.

                Equations
                theorem AddUnits.instAddGroup.proof_1 {α : Type u_1} [AddMonoid α] (u : AddUnits α) :
                -u + u = 0
                instance Units.instGroup {α : Type u} [Monoid α] :

                Units of a monoid form a group.

                Equations
                theorem AddUnits.instAddCommGroupAddUnits.proof_1 {α : Type u_1} [AddCommMonoid α] :
                ∀ (x x_1 : AddUnits α), x + x_1 = x_1 + x

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

                Equations

                Units of a commutative monoid form a commutative group.

                Equations
                @[simp]
                theorem AddUnits.val_nsmul_eq_nsmul_val {α : Type u} [AddMonoid α] (a : AddUnits α) (n : ) :
                (n a) = n a
                @[simp]
                theorem Units.val_pow_eq_pow_val {α : Type u} [Monoid α] (a : αˣ) (n : ) :
                (a ^ n) = a ^ n
                @[simp]
                theorem AddUnits.add_neg_eq_zero {α : Type u} [AddMonoid α] {u : AddUnits α} {a : α} :
                a + (-u) = 0 a = u
                @[simp]
                theorem Units.mul_inv_eq_one {α : Type u} [Monoid α] {u : αˣ} {a : α} :
                a * u⁻¹ = 1 a = u
                @[simp]
                theorem AddUnits.neg_add_eq_zero {α : Type u} [AddMonoid α] {u : AddUnits α} {a : α} :
                (-u) + a = 0 u = a
                @[simp]
                theorem Units.inv_mul_eq_one {α : Type u} [Monoid α] {u : αˣ} {a : α} :
                u⁻¹ * a = 1 u = a
                theorem AddUnits.add_eq_zero_iff_eq_neg {α : Type u} [AddMonoid α] {u : AddUnits α} {a : α} :
                a + u = 0 a = (-u)
                theorem Units.mul_eq_one_iff_eq_inv {α : Type u} [Monoid α] {u : αˣ} {a : α} :
                a * u = 1 a = u⁻¹
                theorem AddUnits.add_eq_zero_iff_neg_eq {α : Type u} [AddMonoid α] {u : AddUnits α} {a : α} :
                u + a = 0 (-u) = a
                theorem Units.mul_eq_one_iff_inv_eq {α : Type u} [Monoid α] {u : αˣ} {a : α} :
                u * a = 1 u⁻¹ = a
                theorem AddUnits.neg_unique {α : Type u} [AddMonoid α] {u₁ : AddUnits α} {u₂ : AddUnits α} (h : u₁ = u₂) :
                (-u₁) = (-u₂)
                theorem Units.inv_unique {α : Type u} [Monoid α] {u₁ : αˣ} {u₂ : αˣ} (h : u₁ = u₂) :
                u₁⁻¹ = u₂⁻¹
                @[simp]
                theorem AddUnits.val_neg_eq_neg_val {α : Type u} [SubtractionMonoid α] (u : AddUnits α) :
                (-u) = -u
                @[simp]
                theorem Units.val_inv_eq_inv_val {α : Type u} [DivisionMonoid α] (u : αˣ) :
                u⁻¹ = (↑u)⁻¹
                @[simp]
                theorem AddUnits.val_sub_eq_sub_val {α : Type u} [SubtractionMonoid α] (u₁ : AddUnits α) (u₂ : AddUnits α) :
                (u₁ - u₂) = u₁ - u₂
                @[simp]
                theorem Units.val_div_eq_div_val {α : Type u} [DivisionMonoid α] (u₁ : αˣ) (u₂ : αˣ) :
                (u₁ / u₂) = u₁ / u₂
                theorem AddUnits.mkOfAddEqZero.proof_1 {α : Type u_1} [AddCommMonoid α] (a : α) (b : α) (hab : a + b = 0) :
                b + a = 0
                def AddUnits.mkOfAddEqZero {α : Type u} [AddCommMonoid α] (a : α) (b : α) (hab : a + b = 0) :

                For a, b in an AddCommMonoid such that a + b = 0, makes an addUnit out of a.

                Equations
                Instances For
                  def Units.mkOfMulEqOne {α : Type u} [CommMonoid α] (a : α) (b : α) (hab : a * b = 1) :
                  αˣ

                  For a, b in a CommMonoid such that a * b = 1, makes a unit out of a.

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

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

                    Equations
                    Instances For

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

                      Equations
                      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)
                        theorem divp_assoc' {α : Type u} [Monoid α] (x : α) (y : α) (u : αˣ) :
                        x * (y /ₚ u) = x * y /ₚ u

                        field_simp needs the reverse direction of divp_assoc to move all /ₚ to the right.

                        @[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
                        @[simp]
                        theorem divp_left_inj {α : Type u} [Monoid α] (u : αˣ) {a : α} {b : α} :
                        a /ₚ u = b /ₚ u a = b
                        theorem divp_divp_eq_divp_mul {α : Type u} [Monoid α] (x : α) (u₁ : αˣ) (u₂ : αˣ) :
                        x /ₚ u₁ /ₚ u₂ = x /ₚ (u₂ * u₁)
                        theorem divp_eq_iff_mul_eq {α : Type u} [Monoid α] {x : α} {u : αˣ} {y : α} :
                        x /ₚ u = y y * u = x
                        theorem eq_divp_iff_mul_eq {α : Type u} [Monoid α] {x : α} {u : αˣ} {y : α} :
                        x = y /ₚ u x * u = y
                        theorem divp_eq_one_iff_eq {α : Type u} [Monoid α] {a : α} {u : αˣ} :
                        a /ₚ u = 1 a = u
                        @[simp]
                        theorem one_divp {α : Type u} [Monoid α] (u : αˣ) :
                        1 /ₚ u = u⁻¹
                        theorem inv_eq_one_divp {α : Type u} [Monoid α] (u : αˣ) :
                        u⁻¹ = 1 /ₚ u

                        Used for field_simp to deal with inverses of units.

                        theorem inv_eq_one_divp' {α : Type u} [Monoid α] (u : αˣ) :
                        (1 / u) = 1 /ₚ u

                        Used for field_simp to deal with inverses of units. This form of the lemma is essential since field_simp likes to use inv_eq_one_div to rewrite ↑u⁻¹ = ↑(1 / u).

                        theorem val_div_eq_divp {α : Type u} [Monoid α] (u₁ : αˣ) (u₂ : αˣ) :
                        (u₁ / u₂) = u₁ /ₚ u₂

                        field_simp moves division inside αˣ to the right, and this lemma lifts the calculation to α.

                        theorem AddLeftCancelMonoid.eq_zero_of_add_right {α : Type u} [AddLeftCancelMonoid α] [Subsingleton (AddUnits α)] {a : α} {b : α} (h : a + b = 0) :
                        a = 0
                        theorem LeftCancelMonoid.eq_one_of_mul_right {α : Type u} [LeftCancelMonoid α] [Subsingleton αˣ] {a : α} {b : α} (h : a * b = 1) :
                        a = 1
                        theorem AddLeftCancelMonoid.eq_zero_of_add_left {α : Type u} [AddLeftCancelMonoid α] [Subsingleton (AddUnits α)] {a : α} {b : α} (h : a + b = 0) :
                        b = 0
                        theorem LeftCancelMonoid.eq_one_of_mul_left {α : Type u} [LeftCancelMonoid α] [Subsingleton αˣ] {a : α} {b : α} (h : a * b = 1) :
                        b = 1
                        @[simp]
                        theorem AddLeftCancelMonoid.add_eq_zero {α : Type u} [AddLeftCancelMonoid α] [Subsingleton (AddUnits α)] {a : α} {b : α} :
                        a + b = 0 a = 0 b = 0
                        @[simp]
                        theorem LeftCancelMonoid.mul_eq_one {α : Type u} [LeftCancelMonoid α] [Subsingleton αˣ] {a : α} {b : α} :
                        a * b = 1 a = 1 b = 1
                        theorem AddLeftCancelMonoid.add_ne_zero {α : Type u} [AddLeftCancelMonoid α] [Subsingleton (AddUnits α)] {a : α} {b : α} :
                        a + b 0 a 0 b 0
                        theorem LeftCancelMonoid.mul_ne_one {α : Type u} [LeftCancelMonoid α] [Subsingleton αˣ] {a : α} {b : α} :
                        a * b 1 a 1 b 1
                        theorem AddRightCancelMonoid.eq_zero_of_add_right {α : Type u} [AddRightCancelMonoid α] [Subsingleton (AddUnits α)] {a : α} {b : α} (h : a + b = 0) :
                        a = 0
                        theorem RightCancelMonoid.eq_one_of_mul_right {α : Type u} [RightCancelMonoid α] [Subsingleton αˣ] {a : α} {b : α} (h : a * b = 1) :
                        a = 1
                        theorem AddRightCancelMonoid.eq_zero_of_add_left {α : Type u} [AddRightCancelMonoid α] [Subsingleton (AddUnits α)] {a : α} {b : α} (h : a + b = 0) :
                        b = 0
                        theorem RightCancelMonoid.eq_one_of_mul_left {α : Type u} [RightCancelMonoid α] [Subsingleton αˣ] {a : α} {b : α} (h : a * b = 1) :
                        b = 1
                        @[simp]
                        theorem AddRightCancelMonoid.add_eq_zero {α : Type u} [AddRightCancelMonoid α] [Subsingleton (AddUnits α)] {a : α} {b : α} :
                        a + b = 0 a = 0 b = 0
                        @[simp]
                        theorem RightCancelMonoid.mul_eq_one {α : Type u} [RightCancelMonoid α] [Subsingleton αˣ] {a : α} {b : α} :
                        a * b = 1 a = 1 b = 1
                        theorem AddRightCancelMonoid.add_ne_zero {α : Type u} [AddRightCancelMonoid α] [Subsingleton (AddUnits α)] {a : α} {b : α} :
                        a + b 0 a 0 b 0
                        theorem RightCancelMonoid.mul_ne_one {α : Type u} [RightCancelMonoid α] [Subsingleton αˣ] {a : α} {b : α} :
                        a * b 1 a 1 b 1
                        theorem eq_zero_of_add_right' {α : Type u} [AddCancelMonoid α] [Subsingleton (AddUnits α)] {a : α} {b : α} (h : a + b = 0) :
                        a = 0
                        theorem eq_one_of_mul_right' {α : Type u} [CancelMonoid α] [Subsingleton αˣ] {a : α} {b : α} (h : a * b = 1) :
                        a = 1
                        theorem eq_zero_of_add_left' {α : Type u} [AddCancelMonoid α] [Subsingleton (AddUnits α)] {a : α} {b : α} (h : a + b = 0) :
                        b = 0
                        theorem eq_one_of_mul_left' {α : Type u} [CancelMonoid α] [Subsingleton αˣ] {a : α} {b : α} (h : a * b = 1) :
                        b = 1
                        theorem add_eq_zero' {α : Type u} [AddCancelMonoid α] [Subsingleton (AddUnits α)] {a : α} {b : α} :
                        a + b = 0 a = 0 b = 0
                        theorem mul_eq_one' {α : Type u} [CancelMonoid α] [Subsingleton αˣ] {a : α} {b : α} :
                        a * b = 1 a = 1 b = 1
                        theorem add_ne_zero' {α : Type u} [AddCancelMonoid α] [Subsingleton (AddUnits α)] {a : α} {b : α} :
                        a + b 0 a 0 b 0
                        theorem mul_ne_one' {α : Type u} [CancelMonoid α] [Subsingleton αˣ] {a : α} {b : α} :
                        a * b 1 a 1 b 1
                        theorem divp_mul_eq_mul_divp {α : Type u} [CommMonoid α] (x : α) (y : α) (u : αˣ) :
                        x /ₚ u * y = x * y /ₚ u
                        theorem divp_eq_divp_iff {α : Type u} [CommMonoid α] {x : α} {y : α} {ux : αˣ} {uy : αˣ} :
                        x /ₚ ux = y /ₚ uy x * uy = y * ux
                        theorem divp_mul_divp {α : Type u} [CommMonoid α] (x : α) (y : α) (ux : αˣ) (uy : αˣ) :
                        x /ₚ ux * (y /ₚ uy) = x * y /ₚ (ux * uy)
                        theorem eq_zero_of_add_right {α : Type u} [AddCommMonoid α] [Subsingleton (AddUnits α)] {a : α} {b : α} (h : a + b = 0) :
                        a = 0
                        theorem eq_one_of_mul_right {α : Type u} [CommMonoid α] [Subsingleton αˣ] {a : α} {b : α} (h : a * b = 1) :
                        a = 1
                        theorem eq_zero_of_add_left {α : Type u} [AddCommMonoid α] [Subsingleton (AddUnits α)] {a : α} {b : α} (h : a + b = 0) :
                        b = 0
                        theorem eq_one_of_mul_left {α : Type u} [CommMonoid α] [Subsingleton αˣ] {a : α} {b : α} (h : a * b = 1) :
                        b = 1
                        @[simp]
                        theorem add_eq_zero {α : Type u} [AddCommMonoid α] [Subsingleton (AddUnits α)] {a : α} {b : α} :
                        a + b = 0 a = 0 b = 0
                        @[simp]
                        theorem mul_eq_one {α : Type u} [CommMonoid α] [Subsingleton αˣ] {a : α} {b : α} :
                        a * b = 1 a = 1 b = 1
                        theorem add_ne_zero {α : Type u} [AddCommMonoid α] [Subsingleton (AddUnits α)] {a : α} {b : α} :
                        a + b 0 a 0 b 0
                        theorem mul_ne_one {α : Type u} [CommMonoid α] [Subsingleton αˣ] {a : α} {b : α} :
                        a * b 1 a 1 b 1

                        IsUnit predicate #

                        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.

                        Equations
                        Instances For
                          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.

                          Equations
                          Instances For
                            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 {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_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.

                            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 isUnit_of_subsingleton {M : Type u_1} [Monoid M] [Subsingleton M] (a : M) :
                            instance instCanLiftAddUnitsValIsAddUnit {M : Type u_1} [AddMonoid M] :
                            CanLift M (AddUnits M) AddUnits.val IsAddUnit
                            Equations
                            • =
                            instance instCanLiftUnitsValIsUnit {M : Type u_1} [Monoid M] :
                            CanLift M Mˣ Units.val IsUnit
                            Equations
                            • =

                            A subsingleton AddMonoid has a unique additive unit.

                            Equations
                            • instUniqueAddUnitsOfSubsingleton = { toInhabited := AddUnits.instInhabited, uniq := }

                            A subsingleton Monoid has a unique unit.

                            Equations
                            • instUniqueUnitsOfSubsingleton = { toInhabited := Units.instInhabited, uniq := }
                            @[simp]
                            theorem AddUnits.isAddUnit {M : Type u_1} [AddMonoid M] (u : AddUnits M) :
                            @[simp]
                            theorem Units.isUnit {M : Type u_1} [Monoid M] (u : Mˣ) :
                            IsUnit u
                            @[simp]
                            theorem isAddUnit_zero {M : Type u_1} [AddMonoid M] :
                            @[simp]
                            theorem isUnit_one {M : Type u_1} [Monoid M] :
                            theorem isAddUnit_of_add_eq_zero {M : Type u_1} [AddCommMonoid M] (a : M) (b : M) (h : a + b = 0) :
                            theorem isUnit_of_mul_eq_one {M : Type u_1} [CommMonoid M] (a : M) (b : M) (h : a * b = 1) :
                            theorem isAddUnit_of_add_eq_zero_right {M : Type u_1} [AddCommMonoid M] (a : M) (b : M) (h : a + b = 0) :
                            theorem isUnit_of_mul_eq_one_right {M : Type u_1} [CommMonoid M] (a : M) (b : M) (h : 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_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), b + a = 0
                            theorem IsUnit.exists_left_inv {M : Type u_1} [Monoid M] {a : M} (h : IsUnit a) :
                            ∃ (b : M), b * a = 1
                            theorem IsAddUnit.add {M : Type u_1} [AddMonoid M] {a : M} {b : M} :
                            IsAddUnit aIsAddUnit bIsAddUnit (a + b)
                            theorem IsUnit.mul {M : Type u_1} [Monoid M] {a : M} {b : M} :
                            IsUnit aIsUnit bIsUnit (a * b)
                            theorem IsAddUnit.nsmul {M : Type u_1} [AddMonoid M] {a : M} (n : ) :
                            IsAddUnit aIsAddUnit (n a)
                            theorem IsUnit.pow {M : Type u_1} [Monoid M] {a : M} (n : ) :
                            IsUnit aIsUnit (a ^ n)
                            theorem units_eq_one {M : Type u_1} [Monoid M] [Unique Mˣ] (u : Mˣ) :
                            u = 1
                            theorem isAddUnit_iff_eq_zero {M : Type u_1} [AddMonoid M] [Unique (AddUnits M)] {x : M} :
                            theorem isUnit_iff_eq_one {M : Type u_1} [Monoid M] [Unique Mˣ] {x : M} :
                            IsUnit x x = 1
                            theorem isAddUnit_iff_exists_neg {M : Type u_1} [AddCommMonoid M] {a : M} :
                            IsAddUnit a ∃ (b : M), a + b = 0
                            theorem isUnit_iff_exists_inv {M : Type u_1} [CommMonoid M] {a : M} :
                            IsUnit a ∃ (b : M), a * b = 1
                            theorem isAddUnit_iff_exists_neg' {M : Type u_1} [AddCommMonoid M] {a : M} :
                            IsAddUnit a ∃ (b : M), b + a = 0
                            theorem isUnit_iff_exists_inv' {M : Type u_1} [CommMonoid M] {a : M} :
                            IsUnit a ∃ (b : M), b * a = 1
                            @[simp]
                            theorem AddUnits.isAddUnit_add_addUnits {M : Type u_1} [AddMonoid M] (a : M) (u : AddUnits M) :

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

                            @[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_addUnits_add {M : Type u_3} [AddMonoid M] (u : AddUnits M) (a : M) :

                            Addition of a u : AddUnits M on the left 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.

                            theorem isAddUnit_of_add_isAddUnit_left {M : Type u_1} [AddCommMonoid M] {x : M} {y : M} (hu : IsAddUnit (x + y)) :
                            theorem isUnit_of_mul_isUnit_left {M : Type u_1} [CommMonoid M] {x : M} {y : M} (hu : IsUnit (x * y)) :
                            theorem isAddUnit_of_add_isAddUnit_right {M : Type u_1} [AddCommMonoid M] {x : M} {y : M} (hu : IsAddUnit (x + y)) :
                            theorem isUnit_of_mul_isUnit_right {M : Type u_1} [CommMonoid M] {x : M} {y : M} (hu : IsUnit (x * y)) :
                            @[simp]
                            theorem IsAddUnit.add_iff {M : Type u_1} [AddCommMonoid M] {x : M} {y : M} :
                            @[simp]
                            theorem IsUnit.mul_iff {M : Type u_1} [CommMonoid M] {x : M} {y : M} :
                            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.

                            Equations
                            Instances For
                              noncomputable def IsAddUnit.addUnit {N : Type u_2} [AddMonoid N] {a : N} (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.

                              Equations
                              Instances For
                                @[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_of_val_units {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_spec {M : Type u_1} [Monoid M] {a : M} (h : IsUnit a) :
                                h.unit = a
                                @[simp]
                                theorem IsAddUnit.addUnit_zero {M : Type u_1} [AddMonoid M] (h : IsAddUnit 0) :
                                h.addUnit = 0
                                @[simp]
                                theorem IsUnit.unit_one {M : Type u_1} [Monoid M] (h : IsUnit 1) :
                                h.unit = 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.val_inv_mul {M : Type u_1} [Monoid M] {a : M} (h : IsUnit a) :
                                h.unit⁻¹ * a = 1
                                @[simp]
                                theorem IsAddUnit.add_val_neg {M : Type u_1} [AddMonoid M] {a : M} (h : IsAddUnit a) :
                                a + (-h.addUnit) = 0
                                @[simp]
                                theorem IsUnit.mul_val_inv {M : Type u_1} [Monoid M] {a : M} (h : IsUnit a) :
                                a * h.unit⁻¹ = 1
                                instance IsAddUnit.instDecidableOfExistsAddUnitsEqVal {M : Type u_1} [AddMonoid M] (x : M) [h : Decidable (∃ (u : AddUnits M), u = x)] :

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

                                Equations
                                instance IsUnit.instDecidableOfExistsUnitsEqVal {M : Type u_1} [Monoid M] (x : M) [h : Decidable (∃ (u : Mˣ), u = x)] :

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

                                Equations
                                theorem IsAddUnit.add_left_inj {M : Type u_1} [AddMonoid M] {a : M} {b : M} {c : M} (h : IsAddUnit a) :
                                b + a = c + a b = c
                                theorem IsUnit.mul_left_inj {M : Type u_1} [Monoid M] {a : M} {b : M} {c : M} (h : IsUnit a) :
                                b * a = c * a b = c
                                theorem IsAddUnit.add_right_inj {M : Type u_1} [AddMonoid M] {a : M} {b : M} {c : M} (h : IsAddUnit a) :
                                a + b = a + c b = c
                                theorem IsUnit.mul_right_inj {M : Type u_1} [Monoid M] {a : M} {b : M} {c : M} (h : IsUnit a) :
                                a * b = a * c b = c
                                theorem IsAddUnit.add_left_cancel {M : Type u_1} [AddMonoid M] {a : M} {b : M} {c : M} (h : IsAddUnit a) :
                                a + b = a + cb = c
                                theorem IsUnit.mul_left_cancel {M : Type u_1} [Monoid M] {a : M} {b : M} {c : M} (h : IsUnit a) :
                                a * b = a * cb = c
                                theorem IsAddUnit.add_right_cancel {M : Type u_1} [AddMonoid M] {a : M} {b : M} {c : M} (h : IsAddUnit b) :
                                a + b = c + ba = c
                                theorem IsUnit.mul_right_cancel {M : Type u_1} [Monoid M] {a : M} {b : M} {c : M} (h : IsUnit b) :
                                a * b = c * ba = c
                                theorem IsAddUnit.add_right_injective {M : Type u_1} [AddMonoid M] {a : M} (h : IsAddUnit a) :
                                Function.Injective fun (x : M) => a + x
                                theorem IsUnit.mul_right_injective {M : Type u_1} [Monoid M] {a : M} (h : IsUnit a) :
                                Function.Injective fun (x : M) => a * x
                                theorem IsAddUnit.add_left_injective {M : Type u_1} [AddMonoid M] {b : M} (h : IsAddUnit b) :
                                Function.Injective fun (x : M) => x + b
                                theorem IsUnit.mul_left_injective {M : Type u_1} [Monoid M] {b : M} (h : IsUnit b) :
                                Function.Injective fun (x : M) => x * b
                                theorem IsUnit.isUnit_iff_mulLeft_bijective {M : Type u_1} [Monoid M] {a : M} :
                                IsUnit a Function.Bijective fun (x : M) => a * x
                                theorem IsUnit.isUnit_iff_mulRight_bijective {M : Type u_1} [Monoid M] {a : M} :
                                IsUnit a Function.Bijective fun (x : M) => x * a
                                @[simp]
                                theorem IsAddUnit.neg_add_cancel {α : Type u} [SubtractionMonoid α] {a : α} :
                                IsAddUnit a-a + a = 0
                                @[simp]
                                theorem IsUnit.inv_mul_cancel {α : Type u} [DivisionMonoid α] {a : α} :
                                IsUnit aa⁻¹ * a = 1
                                @[simp]
                                theorem IsAddUnit.add_neg_cancel {α : Type u} [SubtractionMonoid α] {a : α} :
                                IsAddUnit aa + -a = 0
                                @[simp]
                                theorem IsUnit.mul_inv_cancel {α : Type u} [DivisionMonoid α] {a : α} :
                                IsUnit aa * a⁻¹ = 1
                                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.

                                Equations
                                • h.addUnit' = { val := a, neg := -a, val_neg := , neg_val := }
                                Instances For
                                  @[simp]
                                  theorem IsUnit.val_unit' {α : Type u} [DivisionMonoid α] {a : α} (h : IsUnit a) :
                                  h.unit' = a
                                  @[simp]
                                  theorem IsAddUnit.val_addUnit' {α : Type u} [SubtractionMonoid α] {a : α} (h : IsAddUnit a) :
                                  h.addUnit' = a
                                  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.

                                  Equations
                                  • h.unit' = { val := a, inv := a⁻¹, val_inv := , inv_val := }
                                  Instances For
                                    theorem IsAddUnit.val_neg_addUnit' {α : Type u} [SubtractionMonoid α] {a : α} (h : IsAddUnit a) :
                                    (-h.addUnit') = -a
                                    theorem IsUnit.val_inv_unit' {α : Type u} [DivisionMonoid α] {a : α} (h : IsUnit a) :
                                    h.unit'⁻¹ = a⁻¹
                                    @[simp]
                                    theorem IsAddUnit.add_neg_cancel_left {α : Type u} [SubtractionMonoid α] {a : α} (h : IsAddUnit a) (b : α) :
                                    a + (-a + b) = b
                                    @[simp]
                                    theorem IsUnit.mul_inv_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
                                    @[simp]
                                    theorem IsUnit.inv_mul_cancel_left {α : Type u} [DivisionMonoid α] {a : α} (h : IsUnit a) (b : α) :
                                    a⁻¹ * (a * b) = b
                                    @[simp]
                                    theorem IsAddUnit.add_neg_cancel_right {α : Type u} [SubtractionMonoid α] {b : α} (h : IsAddUnit b) (a : α) :
                                    a + b + -b = a
                                    @[simp]
                                    theorem IsUnit.mul_inv_cancel_right {α : Type u} [DivisionMonoid α] {b : α} (h : IsUnit b) (a : α) :
                                    a * b * b⁻¹ = a
                                    @[simp]
                                    theorem IsAddUnit.neg_add_cancel_right {α : Type u} [SubtractionMonoid α] {b : α} (h : IsAddUnit b) (a : α) :
                                    a + -b + b = a
                                    @[simp]
                                    theorem IsUnit.inv_mul_cancel_right {α : Type u} [DivisionMonoid α] {b : α} (h : IsUnit b) (a : α) :
                                    a * b⁻¹ * b = a
                                    theorem IsAddUnit.sub_self {α : Type u} [SubtractionMonoid α] {a : α} (h : IsAddUnit a) :
                                    a - a = 0
                                    theorem IsUnit.div_self {α : Type u} [DivisionMonoid α] {a : α} (h : IsUnit a) :
                                    a / a = 1
                                    theorem IsAddUnit.eq_add_neg_iff_add_eq {α : Type u} [SubtractionMonoid α] {a : α} {b : α} {c : α} (h : IsAddUnit c) :
                                    a = b + -c a + c = b
                                    theorem IsUnit.eq_mul_inv_iff_mul_eq {α : Type u} [DivisionMonoid α] {a : α} {b : α} {c : α} (h : IsUnit c) :
                                    a = b * c⁻¹ a * c = b
                                    theorem IsAddUnit.eq_neg_add_iff_add_eq {α : Type u} [SubtractionMonoid α] {a : α} {b : α} {c : α} (h : IsAddUnit b) :
                                    a = -b + c b + a = c
                                    theorem IsUnit.eq_inv_mul_iff_mul_eq {α : Type u} [DivisionMonoid α] {a : α} {b : α} {c : α} (h : IsUnit b) :
                                    a = b⁻¹ * c b * a = c
                                    theorem IsAddUnit.neg_add_eq_iff_eq_add {α : Type u} [SubtractionMonoid α] {a : α} {b : α} {c : α} (h : IsAddUnit a) :
                                    -a + b = c b = a + c
                                    theorem IsUnit.inv_mul_eq_iff_eq_mul {α : Type u} [DivisionMonoid α] {a : α} {b : α} {c : α} (h : IsUnit a) :
                                    a⁻¹ * b = c b = a * c
                                    theorem IsAddUnit.add_neg_eq_iff_eq_add {α : Type u} [SubtractionMonoid α] {a : α} {b : α} {c : α} (h : IsAddUnit b) :
                                    a + -b = c a = c + b
                                    theorem IsUnit.mul_inv_eq_iff_eq_mul {α : Type u} [DivisionMonoid α] {a : α} {b : α} {c : α} (h : IsUnit b) :
                                    a * b⁻¹ = c a = c * b
                                    theorem IsAddUnit.add_neg_eq_zero {α : Type u} [SubtractionMonoid α] {a : α} {b : α} (h : IsAddUnit b) :
                                    a + -b = 0 a = b
                                    theorem IsUnit.mul_inv_eq_one {α : Type u} [DivisionMonoid α] {a : α} {b : α} (h : IsUnit b) :
                                    a * b⁻¹ = 1 a = b
                                    theorem IsAddUnit.neg_add_eq_zero {α : Type u} [SubtractionMonoid α] {a : α} {b : α} (h : IsAddUnit a) :
                                    -a + b = 0 a = b
                                    theorem IsUnit.inv_mul_eq_one {α : Type u} [DivisionMonoid α] {a : α} {b : α} (h : IsUnit a) :
                                    a⁻¹ * b = 1 a = b
                                    theorem IsAddUnit.add_eq_zero_iff_eq_neg {α : Type u} [SubtractionMonoid α] {a : α} {b : α} (h : IsAddUnit b) :
                                    a + b = 0 a = -b
                                    theorem IsUnit.mul_eq_one_iff_eq_inv {α : Type u} [DivisionMonoid α] {a : α} {b : α} (h : IsUnit b) :
                                    a * b = 1 a = b⁻¹
                                    theorem IsAddUnit.add_eq_zero_iff_neg_eq {α : Type u} [SubtractionMonoid α] {a : α} {b : α} (h : IsAddUnit a) :
                                    a + b = 0 -a = b
                                    theorem IsUnit.mul_eq_one_iff_inv_eq {α : Type u} [DivisionMonoid α] {a : α} {b : α} (h : IsUnit a) :
                                    a * b = 1 a⁻¹ = b
                                    @[simp]
                                    theorem IsAddUnit.sub_add_cancel {α : Type u} [SubtractionMonoid α] {b : α} (h : IsAddUnit b) (a : α) :
                                    a - b + b = a
                                    @[simp]
                                    theorem IsUnit.div_mul_cancel {α : Type u} [DivisionMonoid α] {b : α} (h : IsUnit b) (a : α) :
                                    a / b * b = a
                                    @[simp]
                                    theorem IsAddUnit.add_sub_cancel_right {α : Type u} [SubtractionMonoid α] {b : α} (h : IsAddUnit b) (a : α) :
                                    a + b - b = a
                                    @[simp]
                                    theorem IsUnit.mul_div_cancel_right {α : Type u} [DivisionMonoid α] {b : α} (h : IsUnit b) (a : α) :
                                    a * b / b = a
                                    theorem IsAddUnit.add_zero_sub_cancel {α : Type u} [SubtractionMonoid α] {a : α} (h : IsAddUnit a) :
                                    a + (0 - a) = 0
                                    theorem IsUnit.mul_one_div_cancel {α : Type u} [DivisionMonoid α] {a : α} (h : IsUnit a) :
                                    a * (1 / a) = 1
                                    theorem IsAddUnit.zero_sub_add_cancel {α : Type u} [SubtractionMonoid α] {a : α} (h : IsAddUnit a) :
                                    0 - a + a = 0
                                    theorem IsUnit.one_div_mul_cancel {α : Type u} [DivisionMonoid α] {a : α} (h : IsUnit a) :
                                    1 / a * a = 1
                                    theorem IsAddUnit.neg {α : Type u} [SubtractionMonoid α] {a : α} (h : IsAddUnit a) :
                                    theorem IsUnit.inv {α : Type u} [DivisionMonoid α] {a : α} (h : IsUnit a) :
                                    theorem IsAddUnit.sub {α : Type u} [SubtractionMonoid α] {a : α} {b : α} (ha : IsAddUnit a) (hb : IsAddUnit b) :
                                    IsAddUnit (a - b)
                                    theorem IsUnit.div {α : Type u} [DivisionMonoid α] {a : α} {b : α} (ha : IsUnit a) (hb : IsUnit b) :
                                    IsUnit (a / b)
                                    theorem IsAddUnit.sub_left_inj {α : Type u} [SubtractionMonoid α] {a : α} {b : α} {c : α} (h : IsAddUnit c) :
                                    a - c = b - c a = b
                                    theorem IsUnit.div_left_inj {α : Type u} [DivisionMonoid α] {a : α} {b : α} {c : α} (h : IsUnit c) :
                                    a / c = b / c a = b
                                    theorem IsAddUnit.sub_eq_iff {α : Type u} [SubtractionMonoid α] {a : α} {b : α} {c : α} (h : IsAddUnit b) :
                                    a - b = c a = c + b
                                    theorem IsUnit.div_eq_iff {α : Type u} [DivisionMonoid α] {a : α} {b : α} {c : α} (h : IsUnit b) :
                                    a / b = c a = c * b
                                    theorem IsAddUnit.eq_sub_iff {α : Type u} [SubtractionMonoid α] {a : α} {b : α} {c : α} (h : IsAddUnit c) :
                                    a = b - c a + c = b
                                    theorem IsUnit.eq_div_iff {α : Type u} [DivisionMonoid α] {a : α} {b : α} {c : α} (h : IsUnit c) :
                                    a = b / c a * c = b
                                    theorem IsAddUnit.sub_eq_of_eq_add {α : Type u} [SubtractionMonoid α] {a : α} {b : α} {c : α} (h : IsAddUnit b) :
                                    a = c + ba - b = c
                                    theorem IsUnit.div_eq_of_eq_mul {α : Type u} [DivisionMonoid α] {a : α} {b : α} {c : α} (h : IsUnit b) :
                                    a = c * ba / b = c
                                    theorem IsAddUnit.eq_sub_of_add_eq {α : Type u} [SubtractionMonoid α] {a : α} {b : α} {c : α} (h : IsAddUnit c) :
                                    a + c = ba = b - c
                                    theorem IsUnit.eq_div_of_mul_eq {α : Type u} [DivisionMonoid α] {a : α} {b : α} {c : α} (h : IsUnit c) :
                                    a * c = ba = b / c
                                    theorem IsAddUnit.sub_eq_zero_iff_eq {α : Type u} [SubtractionMonoid α] {a : α} {b : α} (h : IsAddUnit b) :
                                    a - b = 0 a = b
                                    theorem IsUnit.div_eq_one_iff_eq {α : Type u} [DivisionMonoid α] {a : α} {b : α} (h : IsUnit b) :
                                    a / b = 1 a = b
                                    theorem IsAddUnit.sub_add_cancel_right {α : Type u} [SubtractionMonoid α] {b : α} (h : IsAddUnit b) (a : α) :
                                    b - (a + b) = -a
                                    theorem IsUnit.div_mul_cancel_right {α : Type u} [DivisionMonoid α] {b : α} (h : IsUnit b) (a : α) :
                                    b / (a * b) = a⁻¹
                                    @[deprecated sub_add_cancel_right]
                                    theorem IsAddUnit.sub_add_left {α : Type u} [SubtractionMonoid α] {a : α} {b : α} (h : IsAddUnit b) :
                                    b - (a + b) = 0 - a
                                    @[deprecated div_mul_cancel_right]
                                    theorem IsUnit.div_mul_left {α : Type u} [DivisionMonoid α] {a : α} {b : α} (h : IsUnit b) :
                                    b / (a * b) = 1 / a
                                    theorem IsAddUnit.add_sub_add_right {α : Type u} [SubtractionMonoid α] {c : α} (h : IsAddUnit c) (a : α) (b : α) :
                                    a + c - (b + c) = a - b
                                    theorem IsUnit.mul_div_mul_right {α : Type u} [DivisionMonoid α] {c : α} (h : IsUnit c) (a : α) (b : α) :
                                    a * c / (b * c) = a / b
                                    theorem IsAddUnit.add_add_sub {α : Type u} [SubtractionMonoid α] {b : α} (a : α) (h : IsAddUnit b) :
                                    a + b + (0 - b) = a
                                    theorem IsUnit.mul_mul_div {α : Type u} [DivisionMonoid α] {b : α} (a : α) (h : IsUnit b) :
                                    a * b * (1 / b) = a
                                    theorem IsAddUnit.sub_add_cancel_left {α : Type u} [SubtractionCommMonoid α] {a : α} (h : IsAddUnit a) (b : α) :
                                    a - (a + b) = -b
                                    theorem IsUnit.div_mul_cancel_left {α : Type u} [DivisionCommMonoid α] {a : α} (h : IsUnit a) (b : α) :
                                    a / (a * b) = b⁻¹
                                    @[deprecated sub_add_cancel_left]
                                    theorem IsAddUnit.sub_add_right {α : Type u} [SubtractionCommMonoid α] {a : α} (h : IsAddUnit a) (b : α) :
                                    a - (a + b) = 0 - b
                                    @[deprecated div_mul_cancel_left]
                                    theorem IsUnit.div_mul_right {α : Type u} [DivisionCommMonoid α] {a : α} (h : IsUnit a) (b : α) :
                                    a / (a * b) = 1 / b
                                    theorem IsAddUnit.add_sub_cancel_left {α : Type u} [SubtractionCommMonoid α] {a : α} (h : IsAddUnit a) (b : α) :
                                    a + b - a = b
                                    theorem IsUnit.mul_div_cancel_left {α : Type u} [DivisionCommMonoid α] {a : α} (h : IsUnit a) (b : α) :
                                    a * b / a = b
                                    theorem IsAddUnit.add_sub_cancel {α : Type u} [SubtractionCommMonoid α] {a : α} (h : IsAddUnit a) (b : α) :
                                    a + (b - a) = b
                                    theorem IsUnit.mul_div_cancel {α : Type u} [DivisionCommMonoid α] {a : α} (h : IsUnit a) (b : α) :
                                    a * (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 IsUnit.mul_div_mul_left {α : Type u} [DivisionCommMonoid α] {c : α} (h : IsUnit c) (a : α) (b : α) :
                                    c * a / (c * b) = a / b
                                    theorem IsAddUnit.add_eq_add_of_sub_eq_sub {α : Type u} [SubtractionCommMonoid α] {b : α} {d : α} (hb : IsAddUnit b) (hd : IsAddUnit d) (a : α) (c : α) (h : a - b = c - d) :
                                    a + d = c + b
                                    theorem IsUnit.mul_eq_mul_of_div_eq_div {α : Type u} [DivisionCommMonoid α] {b : α} {d : α} (hb : IsUnit b) (hd : IsUnit d) (a : α) (c : α) (h : a / b = c / d) :
                                    a * d = c * b
                                    theorem IsAddUnit.sub_eq_sub_iff {α : Type u} [SubtractionCommMonoid α] {a : α} {b : α} {c : α} {d : α} (hb : IsAddUnit b) (hd : IsAddUnit d) :
                                    a - b = c - d a + d = c + b
                                    theorem IsUnit.div_eq_div_iff {α : Type u} [DivisionCommMonoid α] {a : α} {b : α} {c : α} {d : α} (hb : IsUnit b) (hd : IsUnit d) :
                                    a / b = c / d a * d = c * b
                                    theorem IsAddUnit.sub_sub_cancel {α : Type u} [SubtractionCommMonoid α] {a : α} {b : α} (h : IsAddUnit a) :
                                    a - (a - b) = b
                                    theorem IsUnit.div_div_cancel {α : Type u} [DivisionCommMonoid α] {a : α} {b : α} (h : IsUnit a) :
                                    a / (a / b) = b
                                    theorem IsAddUnit.sub_sub_cancel_left {α : Type u} [SubtractionCommMonoid α] {a : α} {b : α} (h : IsAddUnit a) :
                                    a - b - a = -b
                                    theorem IsUnit.div_div_cancel_left {α : Type u} [DivisionCommMonoid α] {a : α} {b : α} (h : IsUnit a) :
                                    a / b / a = b⁻¹
                                    theorem divp_eq_div {α : Type u} [DivisionMonoid α] (a : α) (u : αˣ) :
                                    a /ₚ u = a / u
                                    theorem AddGroup.isAddUnit {α : Type u} [AddGroup α] (a : α) :
                                    theorem Group.isUnit {α : Type u} [Group α] (a : α) :
                                    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.

                                    Equations
                                    Instances For
                                      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.

                                      Equations
                                      Instances For
                                        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.

                                        Equations
                                        Instances For
                                          @[deprecated IsUnit.mul_div_cancel]
                                          theorem IsUnit.mul_div_cancel' {α : Type u} [DivisionCommMonoid α] {a : α} (h : IsUnit a) (b : α) :
                                          a * (b / a) = b

                                          Alias of IsUnit.mul_div_cancel.

                                          @[deprecated IsAddUnit.add_sub_cancel]
                                          theorem IsAddUnit.add_sub_cancel' {α : Type u} [SubtractionCommMonoid α] {a : α} (h : IsAddUnit a) (b : α) :
                                          a + (b - a) = b

                                          Alias of IsAddUnit.add_sub_cancel.