Documentation

Mathlib.Algebra.Order.Ring.Defs

Ordered rings and semirings #

This file develops the basics of ordered (semi)rings.

Each typeclass here comprises

For short,

Typeclasses #

Hierarchy #

The hardest part of proving order lemmas might be to figure out the correct generality and its corresponding typeclass. Here's an attempt at demystifying it. For each typeclass, we list its immediate predecessors and what conditions are added to each of them.

An ordered semiring is a semiring with a partial order such that addition is monotone and multiplication by a nonnegative number is monotone.

  • add_le_add_left (a b : R) : a b∀ (c : R), c + a c + b
  • add_le_add_right (a b : R) : a b∀ (c : R), a + c b + c
  • mul_le_mul_of_nonneg_left (a b c : R) : a b0 cc * a c * b

    In an ordered semiring, we can multiply an inequality a ≤ b on the left by a non-negative element 0 ≤ c to obtain c * a ≤ c * b.

  • mul_le_mul_of_nonneg_right (a b c : R) : a b0 ca * c b * c

    In an ordered semiring, we can multiply an inequality a ≤ b on the right by a non-negative element 0 ≤ c to obtain a * c ≤ b * c.

Instances

    A strict ordered semiring is a nontrivial semiring with a partial order such that addition is strictly monotone and multiplication by a positive number is strictly monotone.

    Instances
      theorem IsOrderedRing.of_mul_nonneg {R : Type u} [Ring R] [PartialOrder R] [IsOrderedAddMonoid R] [ZeroLEOneClass R] (mul_nonneg : ∀ (a b : R), 0 a0 b0 a * b) :
      theorem IsStrictOrderedRing.of_mul_pos {R : Type u} [Ring R] [PartialOrder R] [IsOrderedAddMonoid R] [ZeroLEOneClass R] [Nontrivial R] (mul_pos : ∀ (a b : R), 0 < a0 < b0 < a * b) :
      @[instance 200]
      @[instance 200]

      Turn an ordered domain into a strict ordered ring.

      Note that OrderDual does not satisfy any of the ordered ring typeclasses due to the zero_le_one field.

      @[deprecated "Use `[Semiring R] [PartialOrder R] [IsOrderedRing R]` instead." (since := "2025-04-10")]
      structure OrderedSemiring (R : Type u) extends Semiring R, OrderedAddCommMonoid R :

      An OrderedSemiring is a semiring with a partial order such that addition is monotone and multiplication by a nonnegative number is monotone.

      Instances For
        @[deprecated "Use `[CommSemiring R] [PartialOrder R] [IsOrderedRing R]` instead." (since := "2025-04-10")]
        structure OrderedCommSemiring (R : Type u) extends OrderedSemiring R, CommSemiring R :

        An OrderedCommSemiring is a commutative semiring with a partial order such that addition is monotone and multiplication by a nonnegative number is monotone.

        Instances For
          @[deprecated "Use `[Ring R] [PartialOrder R] [IsOrderedRing R]` instead." (since := "2025-04-10")]
          structure OrderedRing (R : Type u) extends Ring R, OrderedAddCommGroup R :

          An OrderedRing is a ring with a partial order such that addition is monotone and multiplication by a nonnegative number is monotone.

          Instances For
            @[deprecated "Use `[CommRing R] [PartialOrder R] [IsOrderedRing R]` instead." (since := "2025-04-10")]
            structure OrderedCommRing (R : Type u) extends OrderedRing R, CommRing R :

            An OrderedCommRing is a commutative ring with a partial order such that addition is monotone and multiplication by a nonnegative number is monotone.

            Instances For
              @[deprecated "Use `[Semiring R] [PartialOrder R] [IsStrictOrderedRing R]` instead." (since := "2025-04-10")]

              A StrictOrderedSemiring is a nontrivial semiring with a partial order such that addition is strictly monotone and multiplication by a positive number is strictly monotone.

              Instances For
                @[deprecated "Use `[CommSemiring R] [PartialOrder R] [IsStrictOrderedRing R]` instead." (since := "2025-04-10")]

                A StrictOrderedCommSemiring is a commutative semiring with a partial order such that addition is strictly monotone and multiplication by a positive number is strictly monotone.

                Instances For
                  @[deprecated "Use `[Ring R] [PartialOrder R] [IsStrictOrderedRing R]` instead." (since := "2025-04-10")]
                  structure StrictOrderedRing (R : Type u) extends Ring R, OrderedAddCommGroup R, Nontrivial R :

                  A StrictOrderedRing is a ring with a partial order such that addition is strictly monotone and multiplication by a positive number is strictly monotone.

                  Instances For
                    @[deprecated "Use `[CommRing R] [PartialOrder R] [IsStrictOrderedRing R]` instead." (since := "2025-04-10")]
                    structure StrictOrderedCommRing (R : Type u_1) extends StrictOrderedRing R, CommRing R :
                    Type u_1

                    A StrictOrderedCommRing is a commutative ring with a partial order such that addition is strictly monotone and multiplication by a positive number is strictly monotone.

                    Instances For
                      @[deprecated "Use `[Semiring R] [LinearOrder R] [IsStrictOrderedRing R]` instead." (since := "2025-04-10")]

                      A LinearOrderedSemiring is a nontrivial semiring with a linear order such that addition is monotone and multiplication by a positive number is strictly monotone.

                      Instances For
                        @[deprecated "Use `[CommSemiring R] [LinearOrder R] [IsStrictOrderedRing R]` instead." (since := "2025-04-10")]

                        A LinearOrderedCommSemiring is a nontrivial commutative semiring with a linear order such that addition is monotone and multiplication by a positive number is strictly monotone.

                        Instances For
                          @[deprecated "Use `[Ring R] [LinearOrder R] [IsStrictOrderedRing R]` instead." (since := "2025-04-10")]
                          structure LinearOrderedRing (R : Type u) extends StrictOrderedRing R, LinearOrder R :

                          A LinearOrderedRing is a ring with a linear order such that addition is monotone and multiplication by a positive number is strictly monotone.

                          Instances For
                            @[deprecated "Use `[CommRing R] [LinearOrder R] [IsStrictOrderedRing R]` instead." (since := "2025-04-10")]
                            structure LinearOrderedCommRing (R : Type u) extends LinearOrderedRing R, CommMonoid R :

                            A LinearOrderedCommRing is a commutative ring with a linear order such that addition is monotone and multiplication by a positive number is strictly monotone.

                            Instances For
                              theorem one_add_le_one_sub_mul_one_add {R : Type u} [Ring R] [PartialOrder R] [IsOrderedRing R] {a b c : R} (h : a + b + b * c c) :
                              1 + a (1 - b) * (1 + c)
                              theorem one_add_le_one_add_mul_one_sub {R : Type u} [Ring R] [PartialOrder R] [IsOrderedRing R] {a b c : R} (h : a + c + b * c b) :
                              1 + a (1 + b) * (1 - c)
                              theorem one_sub_le_one_sub_mul_one_add {R : Type u} [Ring R] [PartialOrder R] [IsOrderedRing R] {a b c : R} (h : b + b * c a + c) :
                              1 - a (1 - b) * (1 + c)
                              theorem one_sub_le_one_add_mul_one_sub {R : Type u} [Ring R] [PartialOrder R] [IsOrderedRing R] {a b c : R} (h : c + b * c a + b) :
                              1 - a (1 + b) * (1 - c)