Documentation

Mathlib.Algebra.Ring.Basic

Semirings and rings #

This file gives lemmas about semirings, rings and domains. This is analogous to Algebra.Group.Basic, the difference being that the former is about + and * separately, while the present file is about their interaction.

For the definitions of semirings and rings see Algebra.Ring.Defs.

def AddHom.mulLeft {R : Type u_1} [Distrib R] (r : R) :

Left multiplication by an element of a type with distributive multiplication is an AddHom.

Equations
    Instances For
      @[simp]
      theorem AddHom.mulLeft_apply {R : Type u_1} [Distrib R] (r : R) :
      (mulLeft r) = fun (x : R) => r * x
      def AddHom.mulRight {R : Type u_1} [Distrib R] (r : R) :

      Left multiplication by an element of a type with distributive multiplication is an AddHom.

      Equations
        Instances For
          @[simp]
          theorem AddHom.mulRight_apply {R : Type u_1} [Distrib R] (r : R) :
          (mulRight r) = fun (a : R) => a * r

          Left multiplication by an element of a (semi)ring is an AddMonoidHom

          Equations
            Instances For
              @[simp]

              Right multiplication by an element of a (semi)ring is an AddMonoidHom

              Equations
                Instances For
                  @[simp]
                  theorem AddMonoidHom.coe_mulRight {R : Type u_1} [NonUnitalNonAssocSemiring R] (r : R) :
                  (mulRight r) = fun (x : R) => x * r
                  theorem AddMonoidHom.mulRight_apply {R : Type u_1} [NonUnitalNonAssocSemiring R] (a r : R) :
                  (mulRight r) a = a * r

                  Multiplication of an element of a (semi)ring is an AddMonoidHom in both arguments.

                  This is a more-strongly bundled version of AddMonoidHom.mulLeft and AddMonoidHom.mulRight.

                  Stronger versions of this exists for algebras as LinearMap.mul, NonUnitalAlgHom.mul and Algebra.lmul.

                  Equations
                    Instances For
                      theorem AddMonoidHom.mul_apply {R : Type u_1} [NonUnitalNonAssocSemiring R] (x y : R) :
                      (mul x) y = x * y
                      theorem AddMonoidHom.map_mul_iff {R : Type u_1} {S : Type u_2} [NonUnitalNonAssocSemiring R] [NonUnitalNonAssocSemiring S] (f : R →+ S) :
                      (∀ (x y : R), f (x * y) = f x * f y) mul.compr₂ f = (mul.comp f).compl₂ f

                      An AddMonoidHom preserves multiplication if pre- and post- composition with mul are equivalent. By converting the statement into an equality of AddMonoidHoms, this lemma allows various specialized ext lemmas about →+ to then be applied.

                      The left multiplication map: (a, b) ↦ a * b. See also AddMonoidHom.mulLeft.

                      Equations
                        Instances For
                          @[simp]
                          theorem AddMonoid.End.mulLeft_apply_apply {R : Type u_1} [NonUnitalNonAssocSemiring R] (r x✝ : R) :
                          (mulLeft r) x✝ = r * x✝

                          The right multiplication map: (a, b) ↦ b * a. See also AddMonoidHom.mulRight.

                          Equations
                            Instances For
                              @[simp]
                              theorem vieta_formula_quadratic {α : Type u_3} [NonUnitalCommRing α] {b c x : α} (h : x * x - b * x + c = 0) :
                              (y : α), y * y - b * y + c = 0 x + y = b x * y = c

                              Vieta's formula for a quadratic equation, relating the coefficients of the polynomial with its roots. This particular version states that if we have a root x of a monic quadratic polynomial, then there is another root y such that x + y is negative the a_1 coefficient and x * y is the a_0 coefficient.

                              theorem succ_ne_self {α : Type u_3} [NonAssocRing α] [Nontrivial α] (a : α) :
                              a + 1 a
                              theorem pred_ne_self {α : Type u_3} [NonAssocRing α] [Nontrivial α] (a : α) :
                              a - 1 a
                              @[instance 100]
                              theorem one_div_neg_eq_neg_one_div {R : Type u_1} [DivisionMonoid R] [HasDistribNeg R] (a : R) :
                              1 / -a = -(1 / a)
                              theorem div_neg_eq_neg_div {R : Type u_1} [DivisionMonoid R] [HasDistribNeg R] (a b : R) :
                              b / -a = -(b / a)
                              theorem neg_div {R : Type u_1} [DivisionMonoid R] [HasDistribNeg R] (a b : R) :
                              -b / a = -(b / a)
                              theorem neg_div' {R : Type u_1} [DivisionMonoid R] [HasDistribNeg R] (a b : R) :
                              -(b / a) = -b / a
                              @[simp]
                              theorem neg_div_neg_eq {R : Type u_1} [DivisionMonoid R] [HasDistribNeg R] (a b : R) :
                              -a / -b = a / b
                              theorem neg_inv {R : Type u_1} [DivisionMonoid R] [HasDistribNeg R] {a : R} :
                              theorem div_neg {R : Type u_1} [DivisionMonoid R] [HasDistribNeg R] {b : R} (a : R) :
                              a / -b = -(a / b)
                              @[simp]
                              theorem inv_neg {R : Type u_1} [DivisionMonoid R] [HasDistribNeg R] {a : R} :
                              @[deprecated inv_neg (since := "2025-04-24")]
                              theorem inv_neg' {R : Type u_1} [DivisionMonoid R] [HasDistribNeg R] {a : R} :

                              Alias of inv_neg.

                              theorem inv_neg_one {R : Type u_1} [DivisionMonoid R] [HasDistribNeg R] :
                              (-1)⁻¹ = -1