Canonically ordered rings and semirings. #
- CanonicallyOrderedCommSemiring- CanonicallyOrderedAddCommMonoid& multiplication &- *respects- ≤& no zero divisors
- CommSemiring&- a ≤ b ↔ ∃ c, b = a + c& no zero divisors
 
TODO #
We're still missing some typeclasses, like
- CanonicallyOrderedSemiringThey have yet to come up in practice.
A canonically ordered commutative semiring is an ordered, commutative semiring in which a ≤ b
iff there exists c with b = a + c. This is satisfied by the natural numbers, for example, but
not the integers or other ordered groups.
- add : α → α → α
- zero : α
- nsmul : ℕ → α → α
- nsmul_zero : ∀ (x : α), AddMonoid.nsmul 0 x = 0
- nsmul_succ : ∀ (n : ℕ) (x : α), AddMonoid.nsmul (n + 1) x = AddMonoid.nsmul n x + x
- le : α → α → Prop
- lt : α → α → Prop
- le_refl : ∀ (a : α), a ≤ a
- bot : α
- mul : α → α → α
- Multiplication is left distributive over addition 
- Multiplication is right distributive over addition 
- Zero is a left absorbing element for multiplication 
- Zero is a right absorbing element for multiplication 
- Multiplication is associative 
- one : α
- One is a left neutral element for multiplication 
- One is a right neutral element for multiplication 
- natCast : ℕ → α
- natCast_zero : NatCast.natCast 0 = 0The canonical map ℕ → Rsends0 : ℕto0 : R.
- natCast_succ : ∀ (n : ℕ), NatCast.natCast (n + 1) = NatCast.natCast n + 1The canonical map ℕ → Ris a homomorphism.
- npow : ℕ → α → αRaising to the power of a natural number. 
- npow_zero : ∀ (x : α), CanonicallyOrderedCommSemiring.npow 0 x = 1Raising to the power (0 : ℕ)gives1.
- npow_succ : ∀ (n : ℕ) (x : α), CanonicallyOrderedCommSemiring.npow (n + 1) x = CanonicallyOrderedCommSemiring.npow n x * xRaising to the power (n + 1 : ℕ)behaves as expected.
- Multiplication is commutative in a commutative multiplicative magma. 
- No zero divisors. 
Instances
Equations
- ⋯ = ⋯
Equations
- ⋯ = ⋯
Equations
- CanonicallyOrderedCommSemiring.toOrderedCommMonoid = OrderedCommMonoid.mk ⋯
Equations
- CanonicallyOrderedCommSemiring.toOrderedCommSemiring = let __src := inst; OrderedCommSemiring.mk ⋯