Ordered rings and semirings #
This file develops the basics of ordered (semi)rings.
Each typeclass here comprises
- an algebraic class (
Semiring,CommSemiring,Ring,CommRing) - an order class (
PartialOrder,LinearOrder) - assumptions on how both interact ((strict) monotonicity, canonicity)
For short,
- "
+respects≤" means "monotonicity of addition" - "
+respects<" means "strict monotonicity of addition" - "
*respects≤" means "monotonicity of multiplication by a nonnegative number". - "
*respects<" means "strict monotonicity of multiplication by a positive number".
Typeclasses #
OrderedSemiring: Semiring with a partial order such that+and*respect≤.StrictOrderedSemiring: Nontrivial semiring with a partial order such that+and*respects<.OrderedCommSemiring: Commutative semiring with a partial order such that+and*respect≤.StrictOrderedCommSemiring: Nontrivial commutative semiring with a partial order such that+and*respect<.OrderedRing: Ring with a partial order such that+respects≤and*respects<.OrderedCommRing: Commutative ring with a partial order such that+respects≤and*respects<.LinearOrderedSemiring: Nontrivial semiring with a linear order such that+respects≤and*respects<.LinearOrderedCommSemiring: Nontrivial commutative semiring with a linear order such that+respects≤and*respects<.LinearOrderedRing: Nontrivial ring with a linear order such that+respects≤and*respects<.LinearOrderedCommRing: Nontrivial commutative ring with a linear order such that+respects≤and*respects<.
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.
OrderedSemiringOrderedAddCommMonoid& multiplication &*respects≤Semiring& partial order structure &+respects≤&*respects≤
StrictOrderedSemiringOrderedCancelAddCommMonoid& multiplication &*respects<& nontrivialityOrderedSemiring&+respects<&*respects<& nontriviality
OrderedCommSemiringOrderedSemiring& commutativity of multiplicationCommSemiring& partial order structure &+respects≤&*respects<
StrictOrderedCommSemiringStrictOrderedSemiring& commutativity of multiplicationOrderedCommSemiring&+respects<&*respects<& nontriviality
OrderedRingOrderedSemiring& additive inversesOrderedAddCommGroup& multiplication &*respects<Ring& partial order structure &+respects≤&*respects<
StrictOrderedRingStrictOrderedSemiring& additive inversesOrderedSemiring&+respects<&*respects<& nontriviality
OrderedCommRingOrderedRing& commutativity of multiplicationOrderedCommSemiring& additive inversesCommRing& partial order structure &+respects≤&*respects<
StrictOrderedCommRingStrictOrderedCommSemiring& additive inversesStrictOrderedRing& commutativity of multiplicationOrderedCommRing&+respects<&*respects<& nontriviality
LinearOrderedSemiringStrictOrderedSemiring& totality of the orderLinearOrderedAddCommMonoid& multiplication & nontriviality &*respects<
LinearOrderedCommSemiringStrictOrderedCommSemiring& totality of the orderLinearOrderedSemiring& commutativity of multiplication
LinearOrderedRingStrictOrderedRing& totality of the orderLinearOrderedSemiring& additive inversesLinearOrderedAddCommGroup& multiplication &*respects<Ring&IsDomain& linear order structure
LinearOrderedCommRingStrictOrderedCommRing& totality of the orderLinearOrderedRing& commutativity of multiplicationLinearOrderedCommSemiring& additive inversesCommRing&IsDomain& linear order structure
Note that OrderDual does not satisfy any of the ordered ring typeclasses due to the
zero_le_one field.
An OrderedSemiring is a semiring with a partial order such that addition is monotone and
multiplication by a nonnegative number is monotone.
- add : α → α → α
- zero : α
- mul : α → α → α
- one : α
- natCast_zero : NatCast.natCast 0 = 0
- zero_le_one : 0 ≤ 1
0 ≤ 1in any ordered semiring. In an ordered semiring, we can multiply an inequality
a ≤ bon the left by a non-negative element0 ≤ cto obtainc * a ≤ c * b.In an ordered semiring, we can multiply an inequality
a ≤ bon the right by a non-negative element0 ≤ cto obtaina * c ≤ b * c.
Instances
An OrderedCommSemiring is a commutative semiring with a partial order such that addition is
monotone and multiplication by a nonnegative number is monotone.
- add : α → α → α
- zero : α
- mul : α → α → α
- one : α
- natCast_zero : NatCast.natCast 0 = 0
- zero_le_one : 0 ≤ 1
Instances
An OrderedRing is a ring with a partial order such that addition is monotone and
multiplication by a nonnegative number is monotone.
- add : α → α → α
- zero : α
- mul : α → α → α
- one : α
- natCast_zero : NatCast.natCast 0 = 0
- neg : α → α
- sub : α → α → α
- zero_le_one : 0 ≤ 1
0 ≤ 1in any ordered ring. The product of non-negative elements is non-negative.
Instances
An OrderedCommRing is a commutative ring with a partial order such that addition is monotone
and multiplication by a nonnegative number is monotone.
- add : α → α → α
- zero : α
- mul : α → α → α
- one : α
- natCast_zero : NatCast.natCast 0 = 0
- neg : α → α
- sub : α → α → α
- zero_le_one : 0 ≤ 1
Instances
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.
- add : α → α → α
- zero : α
- mul : α → α → α
- one : α
- natCast_zero : NatCast.natCast 0 = 0
- exists_pair_ne : ∃ (x : α), ∃ (y : α), x ≠ y
- zero_le_one : 0 ≤ 1
In a strict ordered semiring,
0 ≤ 1. Left multiplication by a positive element is strictly monotone.
Right multiplication by a positive element is strictly monotone.
Instances
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.
- add : α → α → α
- zero : α
- mul : α → α → α
- one : α
- natCast_zero : NatCast.natCast 0 = 0
- exists_pair_ne : ∃ (x : α), ∃ (y : α), x ≠ y
- zero_le_one : 0 ≤ 1
Instances
A StrictOrderedRing is a ring with a partial order such that addition is strictly monotone
and multiplication by a positive number is strictly monotone.
- add : α → α → α
- zero : α
- mul : α → α → α
- one : α
- natCast_zero : NatCast.natCast 0 = 0
- neg : α → α
- sub : α → α → α
- exists_pair_ne : ∃ (x : α), ∃ (y : α), x ≠ y
- zero_le_one : 0 ≤ 1
In a strict ordered ring,
0 ≤ 1. The product of two positive elements is positive.
Instances
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.
- add : α → α → α
- zero : α
- mul : α → α → α
- one : α
- natCast_zero : NatCast.natCast 0 = 0
- neg : α → α
- sub : α → α → α
- exists_pair_ne : ∃ (x : α), ∃ (y : α), x ≠ y
- zero_le_one : 0 ≤ 1
Instances
A LinearOrderedSemiring is a nontrivial semiring with a linear order such that
addition is monotone and multiplication by a positive number is strictly monotone.
- add : α → α → α
- zero : α
- mul : α → α → α
- one : α
- natCast_zero : NatCast.natCast 0 = 0
- exists_pair_ne : ∃ (x : α), ∃ (y : α), x ≠ y
- zero_le_one : 0 ≤ 1
- min : α → α → α
- max : α → α → α
- decidableLE : DecidableRel fun (x1 x2 : α) => x1 ≤ x2
- decidableLT : DecidableRel fun (x1 x2 : α) => x1 < x2
Instances
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.
- add : α → α → α
- zero : α
- mul : α → α → α
- one : α
- natCast_zero : NatCast.natCast 0 = 0
- exists_pair_ne : ∃ (x : α), ∃ (y : α), x ≠ y
- zero_le_one : 0 ≤ 1
- min : α → α → α
- max : α → α → α
- decidableLE : DecidableRel fun (x1 x2 : α) => x1 ≤ x2
- decidableLT : DecidableRel fun (x1 x2 : α) => x1 < x2
Instances
A LinearOrderedRing is a ring with a linear order such that addition is monotone and
multiplication by a positive number is strictly monotone.
- add : α → α → α
- zero : α
- mul : α → α → α
- one : α
- natCast_zero : NatCast.natCast 0 = 0
- neg : α → α
- sub : α → α → α
- exists_pair_ne : ∃ (x : α), ∃ (y : α), x ≠ y
- zero_le_one : 0 ≤ 1
- min : α → α → α
- max : α → α → α
- decidableLE : DecidableRel fun (x1 x2 : α) => x1 ≤ x2
- decidableLT : DecidableRel fun (x1 x2 : α) => x1 < x2
Instances
A LinearOrderedCommRing is a commutative ring with a linear order such that addition is
monotone and multiplication by a positive number is strictly monotone.
- add : α → α → α
- zero : α
- mul : α → α → α
- one : α
- natCast_zero : NatCast.natCast 0 = 0
- neg : α → α
- sub : α → α → α
- exists_pair_ne : ∃ (x : α), ∃ (y : α), x ≠ y
- zero_le_one : 0 ≤ 1
- min : α → α → α
- max : α → α → α
- decidableLE : DecidableRel fun (x1 x2 : α) => x1 ≤ x2
- decidableLT : DecidableRel fun (x1 x2 : α) => x1 < x2
Instances
Equations
A choice-free version of StrictOrderedSemiring.toOrderedSemiring to avoid using choice in
basic Nat lemmas.
Equations
Instances For
Equations
A choice-free version of StrictOrderedCommSemiring.toOrderedCommSemiring' to avoid using
choice in basic Nat lemmas.
Instances For
Equations
A choice-free version of StrictOrderedRing.toOrderedRing to avoid using choice in basic
Int lemmas.
Equations
Instances For
Equations
A choice-free version of StrictOrderedCommRing.toOrderedCommRing to avoid using
choice in basic Int lemmas.
Instances For
Equations
- One or more equations did not get rendered due to their size.