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 #
IsOrderedRing: Semiring with a partial order such that addition and multiplication by a nonnegative number are both monotone.IsStrictOrderedRing: Nontrivial semiring with a partial order such that addition and multiplication by a positive number are both strictly monotone.
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.
PartialOrder+Semiring+IsOrderedRingIsOrderedAddMonoid& multiplication &*respects≤
PartialOrder+Semiring+IsStrictOrderedRingIsOrderedCancelAddMonoid& multiplication &*respects<& nontriviality
LinearOrder+Ring+IsOrderedRingIsStrictOrderedRing& totality of the orderIsDomain& linear order structure
An ordered semiring is a semiring with a partial order such that addition is monotone and multiplication by a nonnegative number is monotone.
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
Turn an ordered domain into a strict ordered ring.
This is not an instance, as it would loop with NeZero.charZero_one.
Note that OrderDual does not satisfy any of the ordered ring typeclasses due to the
zero_le_one field.
A nontrivial ordered ring is of characteristic zero. This is not made a global instance for performance reasons.