Ordered rings and semirings #
This file develops the basics of ordered (semi)rings.
Each typeclass here comprises
- an algebraic class (
semiring
,comm_semiring
,ring
,comm_ring
) - an order class (
partial_order
,linear_order
) - assumptions on how both interact ((strict) monotonicity, canonicity)
For short,
- "
+
respects≤
" means "monotonicity of addition" - "
*
respects<
" means "strict monotonicity of multiplication by a positive number".
Typeclasses #
ordered_semiring
: Semiring with a partial order such that+
respects≤
and*
respects<
.ordered_comm_semiring
: Commutative semiring with a partial order such that+
respects≤
and*
respects<
.ordered_ring
: Ring with a partial order such that+
respects≤
and*
respects<
.ordered_comm_ring
: Commutative ring with a partial order such that+
respects≤
and*
respects<
.linear_ordered_semiring
: Semiring with a linear order such that+
respects≤
and*
respects<
.linear_ordered_ring
: Ring with a linear order such that+
respects≤
and*
respects<
.linear_ordered_comm_ring
: Commutative ring with a linear order such that+
respects≤
and*
respects<
.canonically_ordered_comm_semiring
: Commutative semiring with a partial order such that+
respects≤
,*
respects<
, anda ≤ b ↔ ∃ c, b = a + c
.
and some typeclasses to define ordered rings by specifying their nonegative elements:
nonneg_ring
: To defineordered_ring
s.linear_nonneg_ring
: To definelinear_ordered_ring
s.
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.
ordered_semiring
ordered_cancel_add_comm_monoid
& multiplication &*
respects<
semiring
& partial order structure &+
respects≤
&*
respects<
ordered_comm_semiring
ordered_semiring
& commutativity of multiplicationcomm_semiring
& partial order structure &+
respects≤
&*
respects<
ordered_ring
ordered_semiring
& additive inversesordered_add_comm_group
& multiplication &*
respects<
ring
& partial order structure &+
respects≤
&*
respects<
ordered_comm_ring
ordered_ring
& commutativity of multiplicationordered_comm_semiring
& additive inversescomm_ring
& partial order structure &+
respects≤
&*
respects<
linear_ordered_semiring
ordered_semiring
& totality of the order & nontrivialitylinear_ordered_add_comm_monoid
& multiplication & nontriviality &*
respects<
linear_ordered_ring
ordered_ring
& totality of the order & nontrivialitylinear_ordered_semiring
& additive inverseslinear_ordered_add_comm_group
& multiplication &*
respects<
domain
& linear order structure
linear_ordered_comm_ring
ordered_comm_ring
& totality of the order & nontrivialitylinear_ordered_ring
& commutativity of multiplicationis_domain
& linear order structure
canonically_ordered_comm_semiring
canonically_ordered_add_monoid
& multiplication &*
respects<
& no zero divisorscomm_semiring
&a ≤ b ↔ ∃ c, b = a + c
& no zero divisors
TODO #
We're still missing some typeclasses, like
linear_ordered_comm_semiring
canonically_ordered_semiring
They have yet to come up in practice.
Note that order_dual
does not satisfy any of the ordered ring typeclasses due to the
zero_le_one
field.
Equations
Equations
Equations
Equations
Equations
Equations
Equations
Equations
Equations
Equations
Equations
Equations
- add : α → α → α
- add_assoc : ∀ (a b c : α), a + b + c = a + (b + c)
- zero : α
- zero_add : ∀ (a : α), 0 + a = a
- add_zero : ∀ (a : α), a + 0 = a
- nsmul : ℕ → α → α
- nsmul_zero' : (∀ (x : α), ordered_semiring.nsmul 0 x = 0) . "try_refl_tac"
- nsmul_succ' : (∀ (n : ℕ) (x : α), ordered_semiring.nsmul n.succ x = x + ordered_semiring.nsmul n x) . "try_refl_tac"
- add_comm : ∀ (a b : α), a + b = b + a
- mul : α → α → α
- left_distrib : ∀ (a b c : α), a * (b + c) = a * b + a * c
- right_distrib : ∀ (a b c : α), (a + b) * c = a * c + b * c
- zero_mul : ∀ (a : α), 0 * a = 0
- mul_zero : ∀ (a : α), a * 0 = 0
- mul_assoc : ∀ (a b c : α), (a * b) * c = a * b * c
- one : α
- one_mul : ∀ (a : α), 1 * a = a
- mul_one : ∀ (a : α), a * 1 = a
- npow : ℕ → α → α
- npow_zero' : (∀ (x : α), ordered_semiring.npow 0 x = 1) . "try_refl_tac"
- npow_succ' : (∀ (n : ℕ) (x : α), ordered_semiring.npow n.succ x = x * ordered_semiring.npow n x) . "try_refl_tac"
- add_left_cancel : ∀ (a b c : α), a + b = a + c → b = c
- le : α → α → Prop
- lt : α → α → Prop
- le_refl : ∀ (a : α), a ≤ a
- le_trans : ∀ (a b c : α), a ≤ b → b ≤ c → a ≤ c
- lt_iff_le_not_le : (∀ (a b : α), a < b ↔ a ≤ b ∧ ¬b ≤ a) . "order_laws_tac"
- le_antisymm : ∀ (a b : α), a ≤ b → b ≤ a → a = b
- add_le_add_left : ∀ (a b : α), a ≤ b → ∀ (c : α), c + a ≤ c + b
- le_of_add_le_add_left : ∀ (a b c : α), a + b ≤ a + c → b ≤ c
- zero_le_one : 0 ≤ 1
- mul_lt_mul_of_pos_left : ∀ (a b c : α), a < b → 0 < c → c * a < c * b
- mul_lt_mul_of_pos_right : ∀ (a b c : α), a < b → 0 < c → a * c < b * c
An ordered_semiring α
is a semiring α
with a partial order such that
addition is monotone and multiplication by a positive number is strictly monotone.
Instances
- ordered_comm_semiring.to_ordered_semiring
- linear_ordered_semiring.to_ordered_semiring
- ordered_ring.to_ordered_semiring
- nat.ordered_semiring
- rat.ordered_semiring
- subsemiring_class.to_ordered_semiring
- subsemiring.to_ordered_semiring
- subalgebra.to_ordered_semiring
- real.ordered_semiring
- nonneg.ordered_semiring
- nnreal.ordered_semiring
Alias of zero_lt_one
.
Alias of zero_lt_two
.
Alias of zero_lt_three
.
Alias of zero_lt_four
.
Pullback an ordered_semiring
under an injective map.
See note [reducible non-instances].
Equations
- function.injective.ordered_semiring f hf zero one add mul nsmul npow = {add := ordered_cancel_add_comm_monoid.add (function.injective.ordered_cancel_add_comm_monoid f hf zero add nsmul), add_assoc := _, zero := ordered_cancel_add_comm_monoid.zero (function.injective.ordered_cancel_add_comm_monoid f hf zero add nsmul), zero_add := _, add_zero := _, nsmul := ordered_cancel_add_comm_monoid.nsmul (function.injective.ordered_cancel_add_comm_monoid f hf zero add nsmul), nsmul_zero' := _, nsmul_succ' := _, add_comm := _, mul := semiring.mul (function.injective.semiring f hf zero one add mul nsmul npow), left_distrib := _, right_distrib := _, zero_mul := _, mul_zero := _, mul_assoc := _, one := semiring.one (function.injective.semiring f hf zero one add mul nsmul npow), one_mul := _, mul_one := _, npow := semiring.npow (function.injective.semiring f hf zero one add mul nsmul npow), npow_zero' := _, npow_succ' := _, add_left_cancel := _, le := ordered_cancel_add_comm_monoid.le (function.injective.ordered_cancel_add_comm_monoid f hf zero add nsmul), lt := ordered_cancel_add_comm_monoid.lt (function.injective.ordered_cancel_add_comm_monoid f hf zero add nsmul), le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, add_le_add_left := _, le_of_add_le_add_left := _, zero_le_one := _, mul_lt_mul_of_pos_left := _, mul_lt_mul_of_pos_right := _}
- add : α → α → α
- add_assoc : ∀ (a b c : α), a + b + c = a + (b + c)
- zero : α
- zero_add : ∀ (a : α), 0 + a = a
- add_zero : ∀ (a : α), a + 0 = a
- nsmul : ℕ → α → α
- nsmul_zero' : (∀ (x : α), ordered_comm_semiring.nsmul 0 x = 0) . "try_refl_tac"
- nsmul_succ' : (∀ (n : ℕ) (x : α), ordered_comm_semiring.nsmul n.succ x = x + ordered_comm_semiring.nsmul n x) . "try_refl_tac"
- add_comm : ∀ (a b : α), a + b = b + a
- mul : α → α → α
- left_distrib : ∀ (a b c : α), a * (b + c) = a * b + a * c
- right_distrib : ∀ (a b c : α), (a + b) * c = a * c + b * c
- zero_mul : ∀ (a : α), 0 * a = 0
- mul_zero : ∀ (a : α), a * 0 = 0
- mul_assoc : ∀ (a b c : α), (a * b) * c = a * b * c
- one : α
- one_mul : ∀ (a : α), 1 * a = a
- mul_one : ∀ (a : α), a * 1 = a
- npow : ℕ → α → α
- npow_zero' : (∀ (x : α), ordered_comm_semiring.npow 0 x = 1) . "try_refl_tac"
- npow_succ' : (∀ (n : ℕ) (x : α), ordered_comm_semiring.npow n.succ x = x * ordered_comm_semiring.npow n x) . "try_refl_tac"
- add_left_cancel : ∀ (a b c : α), a + b = a + c → b = c
- le : α → α → Prop
- lt : α → α → Prop
- le_refl : ∀ (a : α), a ≤ a
- le_trans : ∀ (a b c : α), a ≤ b → b ≤ c → a ≤ c
- lt_iff_le_not_le : (∀ (a b : α), a < b ↔ a ≤ b ∧ ¬b ≤ a) . "order_laws_tac"
- le_antisymm : ∀ (a b : α), a ≤ b → b ≤ a → a = b
- add_le_add_left : ∀ (a b : α), a ≤ b → ∀ (c : α), c + a ≤ c + b
- le_of_add_le_add_left : ∀ (a b c : α), a + b ≤ a + c → b ≤ c
- zero_le_one : 0 ≤ 1
- mul_lt_mul_of_pos_left : ∀ (a b c : α), a < b → 0 < c → c * a < c * b
- mul_lt_mul_of_pos_right : ∀ (a b c : α), a < b → 0 < c → a * c < b * c
- mul_comm : ∀ (a b : α), a * b = b * a
An ordered_comm_semiring α
is a commutative semiring α
with a partial order such that
addition is monotone and multiplication by a positive number is strictly monotone.
Pullback an ordered_comm_semiring
under an injective map.
See note [reducible non-instances].
Equations
- function.injective.ordered_comm_semiring f hf zero one add mul nsmul npow = {add := comm_semiring.add (function.injective.comm_semiring f hf zero one add mul nsmul npow), add_assoc := _, zero := comm_semiring.zero (function.injective.comm_semiring f hf zero one add mul nsmul npow), zero_add := _, add_zero := _, nsmul := comm_semiring.nsmul (function.injective.comm_semiring f hf zero one add mul nsmul npow), nsmul_zero' := _, nsmul_succ' := _, add_comm := _, mul := comm_semiring.mul (function.injective.comm_semiring f hf zero one add mul nsmul npow), left_distrib := _, right_distrib := _, zero_mul := _, mul_zero := _, mul_assoc := _, one := comm_semiring.one (function.injective.comm_semiring f hf zero one add mul nsmul npow), one_mul := _, mul_one := _, npow := comm_semiring.npow (function.injective.comm_semiring f hf zero one add mul nsmul npow), npow_zero' := _, npow_succ' := _, add_left_cancel := _, le := ordered_semiring.le (function.injective.ordered_semiring f hf zero one add mul nsmul npow), lt := ordered_semiring.lt (function.injective.ordered_semiring f hf zero one add mul nsmul npow), le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, add_le_add_left := _, le_of_add_le_add_left := _, zero_le_one := _, mul_lt_mul_of_pos_left := _, mul_lt_mul_of_pos_right := _, mul_comm := _}
- add : α → α → α
- add_assoc : ∀ (a b c : α), a + b + c = a + (b + c)
- zero : α
- zero_add : ∀ (a : α), 0 + a = a
- add_zero : ∀ (a : α), a + 0 = a
- nsmul : ℕ → α → α
- nsmul_zero' : (∀ (x : α), linear_ordered_semiring.nsmul 0 x = 0) . "try_refl_tac"
- nsmul_succ' : (∀ (n : ℕ) (x : α), linear_ordered_semiring.nsmul n.succ x = x + linear_ordered_semiring.nsmul n x) . "try_refl_tac"
- add_comm : ∀ (a b : α), a + b = b + a
- mul : α → α → α
- left_distrib : ∀ (a b c : α), a * (b + c) = a * b + a * c
- right_distrib : ∀ (a b c : α), (a + b) * c = a * c + b * c
- zero_mul : ∀ (a : α), 0 * a = 0
- mul_zero : ∀ (a : α), a * 0 = 0
- mul_assoc : ∀ (a b c : α), (a * b) * c = a * b * c
- one : α
- one_mul : ∀ (a : α), 1 * a = a
- mul_one : ∀ (a : α), a * 1 = a
- npow : ℕ → α → α
- npow_zero' : (∀ (x : α), linear_ordered_semiring.npow 0 x = 1) . "try_refl_tac"
- npow_succ' : (∀ (n : ℕ) (x : α), linear_ordered_semiring.npow n.succ x = x * linear_ordered_semiring.npow n x) . "try_refl_tac"
- add_left_cancel : ∀ (a b c : α), a + b = a + c → b = c
- le : α → α → Prop
- lt : α → α → Prop
- le_refl : ∀ (a : α), a ≤ a
- le_trans : ∀ (a b c : α), a ≤ b → b ≤ c → a ≤ c
- lt_iff_le_not_le : (∀ (a b : α), a < b ↔ a ≤ b ∧ ¬b ≤ a) . "order_laws_tac"
- le_antisymm : ∀ (a b : α), a ≤ b → b ≤ a → a = b
- add_le_add_left : ∀ (a b : α), a ≤ b → ∀ (c : α), c + a ≤ c + b
- le_of_add_le_add_left : ∀ (a b c : α), a + b ≤ a + c → b ≤ c
- zero_le_one : 0 ≤ 1
- mul_lt_mul_of_pos_left : ∀ (a b c : α), a < b → 0 < c → c * a < c * b
- mul_lt_mul_of_pos_right : ∀ (a b c : α), a < b → 0 < c → a * c < b * c
- le_total : ∀ (a b : α), a ≤ b ∨ b ≤ a
- decidable_le : decidable_rel has_le.le
- decidable_eq : decidable_eq α
- decidable_lt : decidable_rel has_lt.lt
- max : α → α → α
- max_def : linear_ordered_semiring.max = max_default . "reflexivity"
- min : α → α → α
- min_def : linear_ordered_semiring.min = min_default . "reflexivity"
- exists_pair_ne : ∃ (x y : α), x ≠ y
A linear_ordered_semiring α
is a nontrivial semiring α
with a linear order
such that addition is monotone and multiplication by a positive number is strictly monotone.
Instances
- linear_ordered_ring.to_linear_ordered_semiring
- linear_ordered_comm_ring.to_linear_ordered_semiring
- nat.linear_ordered_semiring
- rat.linear_ordered_semiring
- subsemiring_class.to_linear_ordered_semiring
- subsemiring.to_linear_ordered_semiring
- subalgebra.to_linear_ordered_semiring
- real.linear_ordered_semiring
- nonneg.linear_ordered_semiring
- nnreal.linear_ordered_semiring
Pullback a linear_ordered_semiring
under an injective map.
See note [reducible non-instances].
Equations
- function.injective.linear_ordered_semiring f hf zero one add mul nsmul npow = {add := ordered_semiring.add (function.injective.ordered_semiring f hf zero one add mul nsmul npow), add_assoc := _, zero := ordered_semiring.zero (function.injective.ordered_semiring f hf zero one add mul nsmul npow), zero_add := _, add_zero := _, nsmul := ordered_semiring.nsmul (function.injective.ordered_semiring f hf zero one add mul nsmul npow), nsmul_zero' := _, nsmul_succ' := _, add_comm := _, mul := ordered_semiring.mul (function.injective.ordered_semiring f hf zero one add mul nsmul npow), left_distrib := _, right_distrib := _, zero_mul := _, mul_zero := _, mul_assoc := _, one := ordered_semiring.one (function.injective.ordered_semiring f hf zero one add mul nsmul npow), one_mul := _, mul_one := _, npow := ordered_semiring.npow (function.injective.ordered_semiring f hf zero one add mul nsmul npow), npow_zero' := _, npow_succ' := _, add_left_cancel := _, le := linear_order.le (linear_order.lift f hf), lt := linear_order.lt (linear_order.lift f hf), le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, add_le_add_left := _, le_of_add_le_add_left := _, zero_le_one := _, mul_lt_mul_of_pos_left := _, mul_lt_mul_of_pos_right := _, le_total := _, decidable_le := linear_order.decidable_le (linear_order.lift f hf), decidable_eq := linear_order.decidable_eq (linear_order.lift f hf), decidable_lt := linear_order.decidable_lt (linear_order.lift f hf), max := max (linear_order.lift f hf), max_def := _, min := min (linear_order.lift f hf), min_def := _, exists_pair_ne := _}
- add : α → α → α
- add_assoc : ∀ (a b c : α), a + b + c = a + (b + c)
- zero : α
- zero_add : ∀ (a : α), 0 + a = a
- add_zero : ∀ (a : α), a + 0 = a
- nsmul : ℕ → α → α
- nsmul_zero' : (∀ (x : α), ordered_ring.nsmul 0 x = 0) . "try_refl_tac"
- nsmul_succ' : (∀ (n : ℕ) (x : α), ordered_ring.nsmul n.succ x = x + ordered_ring.nsmul n x) . "try_refl_tac"
- neg : α → α
- sub : α → α → α
- sub_eq_add_neg : (∀ (a b : α), a - b = a + -b) . "try_refl_tac"
- zsmul : ℤ → α → α
- zsmul_zero' : (∀ (a : α), ordered_ring.zsmul 0 a = 0) . "try_refl_tac"
- zsmul_succ' : (∀ (n : ℕ) (a : α), ordered_ring.zsmul (int.of_nat n.succ) a = a + ordered_ring.zsmul (int.of_nat n) a) . "try_refl_tac"
- zsmul_neg' : (∀ (n : ℕ) (a : α), ordered_ring.zsmul -[1+ n] a = -ordered_ring.zsmul ↑(n.succ) a) . "try_refl_tac"
- add_left_neg : ∀ (a : α), -a + a = 0
- add_comm : ∀ (a b : α), a + b = b + a
- mul : α → α → α
- mul_assoc : ∀ (a b c : α), (a * b) * c = a * b * c
- one : α
- one_mul : ∀ (a : α), 1 * a = a
- mul_one : ∀ (a : α), a * 1 = a
- npow : ℕ → α → α
- npow_zero' : (∀ (x : α), ordered_ring.npow 0 x = 1) . "try_refl_tac"
- npow_succ' : (∀ (n : ℕ) (x : α), ordered_ring.npow n.succ x = x * ordered_ring.npow n x) . "try_refl_tac"
- left_distrib : ∀ (a b c : α), a * (b + c) = a * b + a * c
- right_distrib : ∀ (a b c : α), (a + b) * c = a * c + b * c
- le : α → α → Prop
- lt : α → α → Prop
- le_refl : ∀ (a : α), a ≤ a
- le_trans : ∀ (a b c : α), a ≤ b → b ≤ c → a ≤ c
- lt_iff_le_not_le : (∀ (a b : α), a < b ↔ a ≤ b ∧ ¬b ≤ a) . "order_laws_tac"
- le_antisymm : ∀ (a b : α), a ≤ b → b ≤ a → a = b
- add_le_add_left : ∀ (a b : α), a ≤ b → ∀ (c : α), c + a ≤ c + b
- zero_le_one : 0 ≤ 1
- mul_pos : ∀ (a b : α), 0 < a → 0 < b → 0 < a * b
An ordered_ring α
is a ring α
with a partial order such that
addition is monotone and multiplication by a positive number is strictly monotone.
Equations
- ordered_ring.to_ordered_semiring = {add := ordered_ring.add _inst_1, add_assoc := _, zero := ordered_ring.zero _inst_1, zero_add := _, add_zero := _, nsmul := ordered_ring.nsmul _inst_1, nsmul_zero' := _, nsmul_succ' := _, add_comm := _, mul := ordered_ring.mul _inst_1, left_distrib := _, right_distrib := _, zero_mul := _, mul_zero := _, mul_assoc := _, one := ordered_ring.one _inst_1, one_mul := _, mul_one := _, npow := ordered_ring.npow _inst_1, npow_zero' := _, npow_succ' := _, add_left_cancel := _, le := ordered_ring.le _inst_1, lt := ordered_ring.lt _inst_1, le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, add_le_add_left := _, le_of_add_le_add_left := _, zero_le_one := _, mul_lt_mul_of_pos_left := _, mul_lt_mul_of_pos_right := _}
Pullback an ordered_ring
under an injective map.
See note [reducible non-instances].
Equations
- function.injective.ordered_ring f hf zero one add mul neg sub nsmul zsmul npow = {add := ordered_semiring.add (function.injective.ordered_semiring f hf zero one add mul nsmul npow), add_assoc := _, zero := ordered_semiring.zero (function.injective.ordered_semiring f hf zero one add mul nsmul npow), zero_add := _, add_zero := _, nsmul := ordered_semiring.nsmul (function.injective.ordered_semiring f hf zero one add mul nsmul npow), nsmul_zero' := _, nsmul_succ' := _, neg := ring.neg (function.injective.ring f hf zero one add mul neg sub nsmul zsmul npow), sub := ring.sub (function.injective.ring f hf zero one add mul neg sub nsmul zsmul npow), sub_eq_add_neg := _, zsmul := ring.zsmul (function.injective.ring f hf zero one add mul neg sub nsmul zsmul npow), zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _, mul := ordered_semiring.mul (function.injective.ordered_semiring f hf zero one add mul nsmul npow), mul_assoc := _, one := ordered_semiring.one (function.injective.ordered_semiring f hf zero one add mul nsmul npow), one_mul := _, mul_one := _, npow := ordered_semiring.npow (function.injective.ordered_semiring f hf zero one add mul nsmul npow), npow_zero' := _, npow_succ' := _, left_distrib := _, right_distrib := _, le := ordered_semiring.le (function.injective.ordered_semiring f hf zero one add mul nsmul npow), lt := ordered_semiring.lt (function.injective.ordered_semiring f hf zero one add mul nsmul npow), le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, add_le_add_left := _, zero_le_one := _, mul_pos := _}
- add : α → α → α
- add_assoc : ∀ (a b c : α), a + b + c = a + (b + c)
- zero : α
- zero_add : ∀ (a : α), 0 + a = a
- add_zero : ∀ (a : α), a + 0 = a
- nsmul : ℕ → α → α
- nsmul_zero' : (∀ (x : α), ordered_comm_ring.nsmul 0 x = 0) . "try_refl_tac"
- nsmul_succ' : (∀ (n : ℕ) (x : α), ordered_comm_ring.nsmul n.succ x = x + ordered_comm_ring.nsmul n x) . "try_refl_tac"
- neg : α → α
- sub : α → α → α
- sub_eq_add_neg : (∀ (a b : α), a - b = a + -b) . "try_refl_tac"
- zsmul : ℤ → α → α
- zsmul_zero' : (∀ (a : α), ordered_comm_ring.zsmul 0 a = 0) . "try_refl_tac"
- zsmul_succ' : (∀ (n : ℕ) (a : α), ordered_comm_ring.zsmul (int.of_nat n.succ) a = a + ordered_comm_ring.zsmul (int.of_nat n) a) . "try_refl_tac"
- zsmul_neg' : (∀ (n : ℕ) (a : α), ordered_comm_ring.zsmul -[1+ n] a = -ordered_comm_ring.zsmul ↑(n.succ) a) . "try_refl_tac"
- add_left_neg : ∀ (a : α), -a + a = 0
- add_comm : ∀ (a b : α), a + b = b + a
- mul : α → α → α
- mul_assoc : ∀ (a b c : α), (a * b) * c = a * b * c
- one : α
- one_mul : ∀ (a : α), 1 * a = a
- mul_one : ∀ (a : α), a * 1 = a
- npow : ℕ → α → α
- npow_zero' : (∀ (x : α), ordered_comm_ring.npow 0 x = 1) . "try_refl_tac"
- npow_succ' : (∀ (n : ℕ) (x : α), ordered_comm_ring.npow n.succ x = x * ordered_comm_ring.npow n x) . "try_refl_tac"
- left_distrib : ∀ (a b c : α), a * (b + c) = a * b + a * c
- right_distrib : ∀ (a b c : α), (a + b) * c = a * c + b * c
- le : α → α → Prop
- lt : α → α → Prop
- le_refl : ∀ (a : α), a ≤ a
- le_trans : ∀ (a b c : α), a ≤ b → b ≤ c → a ≤ c
- lt_iff_le_not_le : (∀ (a b : α), a < b ↔ a ≤ b ∧ ¬b ≤ a) . "order_laws_tac"
- le_antisymm : ∀ (a b : α), a ≤ b → b ≤ a → a = b
- add_le_add_left : ∀ (a b : α), a ≤ b → ∀ (c : α), c + a ≤ c + b
- zero_le_one : 0 ≤ 1
- mul_pos : ∀ (a b : α), 0 < a → 0 < b → 0 < a * b
- mul_comm : ∀ (a b : α), a * b = b * a
An ordered_comm_ring α
is a commutative ring α
with a partial order such that
addition is monotone and multiplication by a positive number is strictly monotone.
Equations
- ordered_comm_ring.to_ordered_comm_semiring = {add := ordered_semiring.add ordered_ring.to_ordered_semiring, add_assoc := _, zero := ordered_semiring.zero ordered_ring.to_ordered_semiring, zero_add := _, add_zero := _, nsmul := ordered_semiring.nsmul ordered_ring.to_ordered_semiring, nsmul_zero' := _, nsmul_succ' := _, add_comm := _, mul := ordered_semiring.mul ordered_ring.to_ordered_semiring, left_distrib := _, right_distrib := _, zero_mul := _, mul_zero := _, mul_assoc := _, one := ordered_semiring.one ordered_ring.to_ordered_semiring, one_mul := _, mul_one := _, npow := ordered_semiring.npow ordered_ring.to_ordered_semiring, npow_zero' := _, npow_succ' := _, add_left_cancel := _, le := ordered_semiring.le ordered_ring.to_ordered_semiring, lt := ordered_semiring.lt ordered_ring.to_ordered_semiring, le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, add_le_add_left := _, le_of_add_le_add_left := _, zero_le_one := _, mul_lt_mul_of_pos_left := _, mul_lt_mul_of_pos_right := _, mul_comm := _}
Pullback an ordered_comm_ring
under an injective map.
See note [reducible non-instances].
Equations
- function.injective.ordered_comm_ring f hf zero one add mul neg sub nsmul zsmul npow = {add := ordered_ring.add (function.injective.ordered_ring f hf zero one add mul neg sub nsmul zsmul npow), add_assoc := _, zero := ordered_ring.zero (function.injective.ordered_ring f hf zero one add mul neg sub nsmul zsmul npow), zero_add := _, add_zero := _, nsmul := ordered_ring.nsmul (function.injective.ordered_ring f hf zero one add mul neg sub nsmul zsmul npow), nsmul_zero' := _, nsmul_succ' := _, neg := ordered_ring.neg (function.injective.ordered_ring f hf zero one add mul neg sub nsmul zsmul npow), sub := ordered_ring.sub (function.injective.ordered_ring f hf zero one add mul neg sub nsmul zsmul npow), sub_eq_add_neg := _, zsmul := ordered_ring.zsmul (function.injective.ordered_ring f hf zero one add mul neg sub nsmul zsmul npow), zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _, mul := ordered_ring.mul (function.injective.ordered_ring f hf zero one add mul neg sub nsmul zsmul npow), mul_assoc := _, one := ordered_ring.one (function.injective.ordered_ring f hf zero one add mul neg sub nsmul zsmul npow), one_mul := _, mul_one := _, npow := ordered_ring.npow (function.injective.ordered_ring f hf zero one add mul neg sub nsmul zsmul npow), npow_zero' := _, npow_succ' := _, left_distrib := _, right_distrib := _, le := ordered_ring.le (function.injective.ordered_ring f hf zero one add mul neg sub nsmul zsmul npow), lt := ordered_ring.lt (function.injective.ordered_ring f hf zero one add mul neg sub nsmul zsmul npow), le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, add_le_add_left := _, zero_le_one := _, mul_pos := _, mul_comm := _}
- add : α → α → α
- add_assoc : ∀ (a b c : α), a + b + c = a + (b + c)
- zero : α
- zero_add : ∀ (a : α), 0 + a = a
- add_zero : ∀ (a : α), a + 0 = a
- nsmul : ℕ → α → α
- nsmul_zero' : (∀ (x : α), linear_ordered_ring.nsmul 0 x = 0) . "try_refl_tac"
- nsmul_succ' : (∀ (n : ℕ) (x : α), linear_ordered_ring.nsmul n.succ x = x + linear_ordered_ring.nsmul n x) . "try_refl_tac"
- neg : α → α
- sub : α → α → α
- sub_eq_add_neg : (∀ (a b : α), a - b = a + -b) . "try_refl_tac"
- zsmul : ℤ → α → α
- zsmul_zero' : (∀ (a : α), linear_ordered_ring.zsmul 0 a = 0) . "try_refl_tac"
- zsmul_succ' : (∀ (n : ℕ) (a : α), linear_ordered_ring.zsmul (int.of_nat n.succ) a = a + linear_ordered_ring.zsmul (int.of_nat n) a) . "try_refl_tac"
- zsmul_neg' : (∀ (n : ℕ) (a : α), linear_ordered_ring.zsmul -[1+ n] a = -linear_ordered_ring.zsmul ↑(n.succ) a) . "try_refl_tac"
- add_left_neg : ∀ (a : α), -a + a = 0
- add_comm : ∀ (a b : α), a + b = b + a
- mul : α → α → α
- mul_assoc : ∀ (a b c : α), (a * b) * c = a * b * c
- one : α
- one_mul : ∀ (a : α), 1 * a = a
- mul_one : ∀ (a : α), a * 1 = a
- npow : ℕ → α → α
- npow_zero' : (∀ (x : α), linear_ordered_ring.npow 0 x = 1) . "try_refl_tac"
- npow_succ' : (∀ (n : ℕ) (x : α), linear_ordered_ring.npow n.succ x = x * linear_ordered_ring.npow n x) . "try_refl_tac"
- left_distrib : ∀ (a b c : α), a * (b + c) = a * b + a * c
- right_distrib : ∀ (a b c : α), (a + b) * c = a * c + b * c
- le : α → α → Prop
- lt : α → α → Prop
- le_refl : ∀ (a : α), a ≤ a
- le_trans : ∀ (a b c : α), a ≤ b → b ≤ c → a ≤ c
- lt_iff_le_not_le : (∀ (a b : α), a < b ↔ a ≤ b ∧ ¬b ≤ a) . "order_laws_tac"
- le_antisymm : ∀ (a b : α), a ≤ b → b ≤ a → a = b
- add_le_add_left : ∀ (a b : α), a ≤ b → ∀ (c : α), c + a ≤ c + b
- zero_le_one : 0 ≤ 1
- mul_pos : ∀ (a b : α), 0 < a → 0 < b → 0 < a * b
- le_total : ∀ (a b : α), a ≤ b ∨ b ≤ a
- decidable_le : decidable_rel has_le.le
- decidable_eq : decidable_eq α
- decidable_lt : decidable_rel has_lt.lt
- max : α → α → α
- max_def : linear_ordered_ring.max = max_default . "reflexivity"
- min : α → α → α
- min_def : linear_ordered_ring.min = min_default . "reflexivity"
- exists_pair_ne : ∃ (x y : α), x ≠ y
A linear_ordered_ring α
is a ring α
with a linear order such that
addition is monotone and multiplication by a positive number is strictly monotone.
Equations
- linear_ordered_ring.to_linear_ordered_add_comm_group = {add := linear_ordered_ring.add s, add_assoc := _, zero := linear_ordered_ring.zero s, zero_add := _, add_zero := _, nsmul := linear_ordered_ring.nsmul s, nsmul_zero' := _, nsmul_succ' := _, neg := linear_ordered_ring.neg s, sub := linear_ordered_ring.sub s, sub_eq_add_neg := _, zsmul := linear_ordered_ring.zsmul s, zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _, le := linear_ordered_ring.le s, lt := linear_ordered_ring.lt s, le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, add_le_add_left := _, le_total := _, decidable_le := linear_ordered_ring.decidable_le s, decidable_eq := linear_ordered_ring.decidable_eq s, decidable_lt := linear_ordered_ring.decidable_lt s, max := linear_ordered_ring.max s, max_def := _, min := linear_ordered_ring.min s, min_def := _}
Equations
- linear_ordered_ring.to_linear_ordered_semiring = {add := linear_ordered_ring.add _inst_1, add_assoc := _, zero := linear_ordered_ring.zero _inst_1, zero_add := _, add_zero := _, nsmul := linear_ordered_ring.nsmul _inst_1, nsmul_zero' := _, nsmul_succ' := _, add_comm := _, mul := linear_ordered_ring.mul _inst_1, left_distrib := _, right_distrib := _, zero_mul := _, mul_zero := _, mul_assoc := _, one := linear_ordered_ring.one _inst_1, one_mul := _, mul_one := _, npow := linear_ordered_ring.npow _inst_1, npow_zero' := _, npow_succ' := _, add_left_cancel := _, le := linear_ordered_ring.le _inst_1, lt := linear_ordered_ring.lt _inst_1, le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, add_le_add_left := _, le_of_add_le_add_left := _, zero_le_one := _, mul_lt_mul_of_pos_left := _, mul_lt_mul_of_pos_right := _, le_total := _, decidable_le := linear_ordered_ring.decidable_le _inst_1, decidable_eq := linear_ordered_ring.decidable_eq _inst_1, decidable_lt := linear_ordered_ring.decidable_lt _inst_1, max := linear_ordered_ring.max _inst_1, max_def := _, min := linear_ordered_ring.min _inst_1, min_def := _, exists_pair_ne := _}
abs
as a monoid_with_zero_hom
.
Out of three elements of a linear_ordered_ring
, two must have the same sign.
Pullback a linear_ordered_ring
under an injective map.
See note [reducible non-instances].
Equations
- function.injective.linear_ordered_ring f hf zero one add mul neg sub nsmul zsmul npow = {add := ordered_ring.add (function.injective.ordered_ring f hf zero one add mul neg sub nsmul zsmul npow), add_assoc := _, zero := ordered_ring.zero (function.injective.ordered_ring f hf zero one add mul neg sub nsmul zsmul npow), zero_add := _, add_zero := _, nsmul := ordered_ring.nsmul (function.injective.ordered_ring f hf zero one add mul neg sub nsmul zsmul npow), nsmul_zero' := _, nsmul_succ' := _, neg := ordered_ring.neg (function.injective.ordered_ring f hf zero one add mul neg sub nsmul zsmul npow), sub := ordered_ring.sub (function.injective.ordered_ring f hf zero one add mul neg sub nsmul zsmul npow), sub_eq_add_neg := _, zsmul := ordered_ring.zsmul (function.injective.ordered_ring f hf zero one add mul neg sub nsmul zsmul npow), zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _, mul := ordered_ring.mul (function.injective.ordered_ring f hf zero one add mul neg sub nsmul zsmul npow), mul_assoc := _, one := ordered_ring.one (function.injective.ordered_ring f hf zero one add mul neg sub nsmul zsmul npow), one_mul := _, mul_one := _, npow := ordered_ring.npow (function.injective.ordered_ring f hf zero one add mul neg sub nsmul zsmul npow), npow_zero' := _, npow_succ' := _, left_distrib := _, right_distrib := _, le := linear_order.le (linear_order.lift f hf), lt := linear_order.lt (linear_order.lift f hf), le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, add_le_add_left := _, zero_le_one := _, mul_pos := _, le_total := _, decidable_le := linear_order.decidable_le (linear_order.lift f hf), decidable_eq := linear_order.decidable_eq (linear_order.lift f hf), decidable_lt := linear_order.decidable_lt (linear_order.lift f hf), max := max (linear_order.lift f hf), max_def := _, min := min (linear_order.lift f hf), min_def := _, exists_pair_ne := _}
- add : α → α → α
- add_assoc : ∀ (a b c : α), a + b + c = a + (b + c)
- zero : α
- zero_add : ∀ (a : α), 0 + a = a
- add_zero : ∀ (a : α), a + 0 = a
- nsmul : ℕ → α → α
- nsmul_zero' : (∀ (x : α), linear_ordered_comm_ring.nsmul 0 x = 0) . "try_refl_tac"
- nsmul_succ' : (∀ (n : ℕ) (x : α), linear_ordered_comm_ring.nsmul n.succ x = x + linear_ordered_comm_ring.nsmul n x) . "try_refl_tac"
- neg : α → α
- sub : α → α → α
- sub_eq_add_neg : (∀ (a b : α), a - b = a + -b) . "try_refl_tac"
- zsmul : ℤ → α → α
- zsmul_zero' : (∀ (a : α), linear_ordered_comm_ring.zsmul 0 a = 0) . "try_refl_tac"
- zsmul_succ' : (∀ (n : ℕ) (a : α), linear_ordered_comm_ring.zsmul (int.of_nat n.succ) a = a + linear_ordered_comm_ring.zsmul (int.of_nat n) a) . "try_refl_tac"
- zsmul_neg' : (∀ (n : ℕ) (a : α), linear_ordered_comm_ring.zsmul -[1+ n] a = -linear_ordered_comm_ring.zsmul ↑(n.succ) a) . "try_refl_tac"
- add_left_neg : ∀ (a : α), -a + a = 0
- add_comm : ∀ (a b : α), a + b = b + a
- mul : α → α → α
- mul_assoc : ∀ (a b c : α), (a * b) * c = a * b * c
- one : α
- one_mul : ∀ (a : α), 1 * a = a
- mul_one : ∀ (a : α), a * 1 = a
- npow : ℕ → α → α
- npow_zero' : (∀ (x : α), linear_ordered_comm_ring.npow 0 x = 1) . "try_refl_tac"
- npow_succ' : (∀ (n : ℕ) (x : α), linear_ordered_comm_ring.npow n.succ x = x * linear_ordered_comm_ring.npow n x) . "try_refl_tac"
- left_distrib : ∀ (a b c : α), a * (b + c) = a * b + a * c
- right_distrib : ∀ (a b c : α), (a + b) * c = a * c + b * c
- le : α → α → Prop
- lt : α → α → Prop
- le_refl : ∀ (a : α), a ≤ a
- le_trans : ∀ (a b c : α), a ≤ b → b ≤ c → a ≤ c
- lt_iff_le_not_le : (∀ (a b : α), a < b ↔ a ≤ b ∧ ¬b ≤ a) . "order_laws_tac"
- le_antisymm : ∀ (a b : α), a ≤ b → b ≤ a → a = b
- add_le_add_left : ∀ (a b : α), a ≤ b → ∀ (c : α), c + a ≤ c + b
- zero_le_one : 0 ≤ 1
- mul_pos : ∀ (a b : α), 0 < a → 0 < b → 0 < a * b
- le_total : ∀ (a b : α), a ≤ b ∨ b ≤ a
- decidable_le : decidable_rel has_le.le
- decidable_eq : decidable_eq α
- decidable_lt : decidable_rel has_lt.lt
- max : α → α → α
- max_def : linear_ordered_comm_ring.max = max_default . "reflexivity"
- min : α → α → α
- min_def : linear_ordered_comm_ring.min = min_default . "reflexivity"
- exists_pair_ne : ∃ (x y : α), x ≠ y
- mul_comm : ∀ (a b : α), a * b = b * a
A linear_ordered_comm_ring α
is a commutative ring α
with a linear order
such that addition is monotone and multiplication by a positive number is strictly monotone.
Equations
- linear_ordered_comm_ring.to_ordered_comm_ring = {add := linear_ordered_comm_ring.add d, add_assoc := _, zero := linear_ordered_comm_ring.zero d, zero_add := _, add_zero := _, nsmul := linear_ordered_comm_ring.nsmul d, nsmul_zero' := _, nsmul_succ' := _, neg := linear_ordered_comm_ring.neg d, sub := linear_ordered_comm_ring.sub d, sub_eq_add_neg := _, zsmul := linear_ordered_comm_ring.zsmul d, zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _, mul := linear_ordered_comm_ring.mul d, mul_assoc := _, one := linear_ordered_comm_ring.one d, one_mul := _, mul_one := _, npow := linear_ordered_comm_ring.npow d, npow_zero' := _, npow_succ' := _, left_distrib := _, right_distrib := _, le := linear_ordered_comm_ring.le d, lt := linear_ordered_comm_ring.lt d, le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, add_le_add_left := _, zero_le_one := _, mul_pos := _, mul_comm := _}
Equations
- linear_ordered_comm_ring.to_linear_ordered_semiring = {add := linear_ordered_comm_ring.add d, add_assoc := _, zero := linear_ordered_comm_ring.zero d, zero_add := _, add_zero := _, nsmul := linear_ordered_comm_ring.nsmul d, nsmul_zero' := _, nsmul_succ' := _, add_comm := _, mul := linear_ordered_comm_ring.mul d, left_distrib := _, right_distrib := _, zero_mul := _, mul_zero := _, mul_assoc := _, one := linear_ordered_comm_ring.one d, one_mul := _, mul_one := _, npow := linear_ordered_comm_ring.npow d, npow_zero' := _, npow_succ' := _, add_left_cancel := _, le := linear_ordered_comm_ring.le d, lt := linear_ordered_comm_ring.lt d, le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, add_le_add_left := _, le_of_add_le_add_left := _, zero_le_one := _, mul_lt_mul_of_pos_left := _, mul_lt_mul_of_pos_right := _, le_total := _, decidable_le := linear_ordered_comm_ring.decidable_le d, decidable_eq := linear_ordered_comm_ring.decidable_eq d, decidable_lt := linear_ordered_comm_ring.decidable_lt d, max := linear_ordered_comm_ring.max d, max_def := _, min := linear_ordered_comm_ring.min d, min_def := _, exists_pair_ne := _}
Pullback a linear_ordered_comm_ring
under an injective map.
See note [reducible non-instances].
Equations
- function.injective.linear_ordered_comm_ring f hf zero one add mul neg sub nsmul zsmul npow = {add := ordered_comm_ring.add (function.injective.ordered_comm_ring f hf zero one add mul neg sub nsmul zsmul npow), add_assoc := _, zero := ordered_comm_ring.zero (function.injective.ordered_comm_ring f hf zero one add mul neg sub nsmul zsmul npow), zero_add := _, add_zero := _, nsmul := ordered_comm_ring.nsmul (function.injective.ordered_comm_ring f hf zero one add mul neg sub nsmul zsmul npow), nsmul_zero' := _, nsmul_succ' := _, neg := ordered_comm_ring.neg (function.injective.ordered_comm_ring f hf zero one add mul neg sub nsmul zsmul npow), sub := ordered_comm_ring.sub (function.injective.ordered_comm_ring f hf zero one add mul neg sub nsmul zsmul npow), sub_eq_add_neg := _, zsmul := ordered_comm_ring.zsmul (function.injective.ordered_comm_ring f hf zero one add mul neg sub nsmul zsmul npow), zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _, mul := ordered_comm_ring.mul (function.injective.ordered_comm_ring f hf zero one add mul neg sub nsmul zsmul npow), mul_assoc := _, one := ordered_comm_ring.one (function.injective.ordered_comm_ring f hf zero one add mul neg sub nsmul zsmul npow), one_mul := _, mul_one := _, npow := ordered_comm_ring.npow (function.injective.ordered_comm_ring f hf zero one add mul neg sub nsmul zsmul npow), npow_zero' := _, npow_succ' := _, left_distrib := _, right_distrib := _, le := linear_order.le (linear_order.lift f hf), lt := linear_order.lt (linear_order.lift f hf), le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, add_le_add_left := _, zero_le_one := _, mul_pos := _, le_total := _, decidable_le := linear_order.decidable_le (linear_order.lift f hf), decidable_eq := linear_order.decidable_eq (linear_order.lift f hf), decidable_lt := linear_order.decidable_lt (linear_order.lift f hf), max := max (linear_order.lift f hf), max_def := _, min := min (linear_order.lift f hf), min_def := _, exists_pair_ne := _, mul_comm := _}
Forget that a positive cone in a ring respects the multiplicative structure.
- nonneg : α → Prop
- pos : α → Prop
- pos_iff : (∀ (a : α), self.pos a ↔ self.nonneg a ∧ ¬self.nonneg (-a)) . "order_laws_tac"
- zero_nonneg : self.nonneg 0
- add_nonneg : ∀ {a b : α}, self.nonneg a → self.nonneg b → self.nonneg (a + b)
- nonneg_antisymm : ∀ {a : α}, self.nonneg a → self.nonneg (-a) → a = 0
- one_nonneg : self.nonneg 1
- mul_pos : ∀ (a b : α), self.pos a → self.pos b → self.pos (a * b)
A positive cone in a ring consists of a positive cone in underlying add_comm_group
,
which contains 1
and such that the positive elements are closed under multiplication.
- nonneg : α → Prop
- pos : α → Prop
- pos_iff : (∀ (a : α), self.pos a ↔ self.nonneg a ∧ ¬self.nonneg (-a)) . "order_laws_tac"
- zero_nonneg : self.nonneg 0
- add_nonneg : ∀ {a b : α}, self.nonneg a → self.nonneg b → self.nonneg (a + b)
- nonneg_antisymm : ∀ {a : α}, self.nonneg a → self.nonneg (-a) → a = 0
- one_nonneg : self.nonneg 1
- mul_pos : ∀ (a b : α), self.pos a → self.pos b → self.pos (a * b)
- nonneg_decidable : decidable_pred self.nonneg
- nonneg_total : ∀ (a : α), self.nonneg a ∨ self.nonneg (-a)
- one_pos : self.pos 1
A positive cone in a ring induces a linear order if 1
is a positive element.
Forget that a total_positive_cone
in a ring respects the multiplicative structure.
Forget that a total_positive_cone
in a ring is total.
Construct an ordered_ring
by
designating a positive cone in an existing ring
.
Equations
- ordered_ring.mk_of_positive_cone C = {add := ring.add _inst_1, add_assoc := _, zero := ring.zero _inst_1, zero_add := _, add_zero := _, nsmul := ring.nsmul _inst_1, nsmul_zero' := _, nsmul_succ' := _, neg := ring.neg _inst_1, sub := ring.sub _inst_1, sub_eq_add_neg := _, zsmul := ring.zsmul _inst_1, zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _, mul := ring.mul _inst_1, mul_assoc := _, one := ring.one _inst_1, one_mul := _, mul_one := _, npow := ring.npow _inst_1, npow_zero' := _, npow_succ' := _, left_distrib := _, right_distrib := _, le := ordered_add_comm_group.le (ordered_add_comm_group.mk_of_positive_cone C.to_positive_cone), lt := ordered_add_comm_group.lt (ordered_add_comm_group.mk_of_positive_cone C.to_positive_cone), le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, add_le_add_left := _, zero_le_one := _, mul_pos := _}
Construct a linear_ordered_ring
by
designating a positive cone in an existing ring
.
Equations
- linear_ordered_ring.mk_of_positive_cone C = {add := ordered_ring.add (ordered_ring.mk_of_positive_cone C.to_positive_cone), add_assoc := _, zero := ordered_ring.zero (ordered_ring.mk_of_positive_cone C.to_positive_cone), zero_add := _, add_zero := _, nsmul := ordered_ring.nsmul (ordered_ring.mk_of_positive_cone C.to_positive_cone), nsmul_zero' := _, nsmul_succ' := _, neg := ordered_ring.neg (ordered_ring.mk_of_positive_cone C.to_positive_cone), sub := ordered_ring.sub (ordered_ring.mk_of_positive_cone C.to_positive_cone), sub_eq_add_neg := _, zsmul := ordered_ring.zsmul (ordered_ring.mk_of_positive_cone C.to_positive_cone), zsmul_zero' := _, zsmul_succ' := _, zsmul_neg' := _, add_left_neg := _, add_comm := _, mul := ordered_ring.mul (ordered_ring.mk_of_positive_cone C.to_positive_cone), mul_assoc := _, one := ordered_ring.one (ordered_ring.mk_of_positive_cone C.to_positive_cone), one_mul := _, mul_one := _, npow := ordered_ring.npow (ordered_ring.mk_of_positive_cone C.to_positive_cone), npow_zero' := _, npow_succ' := _, left_distrib := _, right_distrib := _, le := ordered_ring.le (ordered_ring.mk_of_positive_cone C.to_positive_cone), lt := ordered_ring.lt (ordered_ring.mk_of_positive_cone C.to_positive_cone), le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, add_le_add_left := _, zero_le_one := _, mul_pos := _, le_total := _, decidable_le := linear_ordered_add_comm_group.decidable_le (linear_ordered_add_comm_group.mk_of_positive_cone C.to_total_positive_cone), decidable_eq := linear_ordered_add_comm_group.decidable_eq (linear_ordered_add_comm_group.mk_of_positive_cone C.to_total_positive_cone), decidable_lt := linear_ordered_add_comm_group.decidable_lt (linear_ordered_add_comm_group.mk_of_positive_cone C.to_total_positive_cone), max := linear_ordered_add_comm_group.max (linear_ordered_add_comm_group.mk_of_positive_cone C.to_total_positive_cone), max_def := _, min := linear_ordered_add_comm_group.min (linear_ordered_add_comm_group.mk_of_positive_cone C.to_total_positive_cone), min_def := _, exists_pair_ne := _}
- add : α → α → α
- add_assoc : ∀ (a b c : α), a + b + c = a + (b + c)
- zero : α
- zero_add : ∀ (a : α), 0 + a = a
- add_zero : ∀ (a : α), a + 0 = a
- nsmul : ℕ → α → α
- nsmul_zero' : (∀ (x : α), canonically_ordered_comm_semiring.nsmul 0 x = 0) . "try_refl_tac"
- nsmul_succ' : (∀ (n : ℕ) (x : α), canonically_ordered_comm_semiring.nsmul n.succ x = x + canonically_ordered_comm_semiring.nsmul n x) . "try_refl_tac"
- add_comm : ∀ (a b : α), a + b = b + a
- le : α → α → Prop
- lt : α → α → Prop
- le_refl : ∀ (a : α), a ≤ a
- le_trans : ∀ (a b c : α), a ≤ b → b ≤ c → a ≤ c
- lt_iff_le_not_le : (∀ (a b : α), a < b ↔ a ≤ b ∧ ¬b ≤ a) . "order_laws_tac"
- le_antisymm : ∀ (a b : α), a ≤ b → b ≤ a → a = b
- add_le_add_left : ∀ (a b : α), a ≤ b → ∀ (c : α), c + a ≤ c + b
- bot : α
- bot_le : ∀ (x : α), ⊥ ≤ x
- le_iff_exists_add : ∀ (a b : α), a ≤ b ↔ ∃ (c : α), b = a + c
- mul : α → α → α
- left_distrib : ∀ (a b c : α), a * (b + c) = a * b + a * c
- right_distrib : ∀ (a b c : α), (a + b) * c = a * c + b * c
- zero_mul : ∀ (a : α), 0 * a = 0
- mul_zero : ∀ (a : α), a * 0 = 0
- mul_assoc : ∀ (a b c : α), (a * b) * c = a * b * c
- one : α
- one_mul : ∀ (a : α), 1 * a = a
- mul_one : ∀ (a : α), a * 1 = a
- npow : ℕ → α → α
- npow_zero' : (∀ (x : α), canonically_ordered_comm_semiring.npow 0 x = 1) . "try_refl_tac"
- npow_succ' : (∀ (n : ℕ) (x : α), canonically_ordered_comm_semiring.npow n.succ x = x * canonically_ordered_comm_semiring.npow n x) . "try_refl_tac"
- mul_comm : ∀ (a b : α), a * b = b * a
- eq_zero_or_eq_zero_of_mul_eq_zero : ∀ (a b : α), a * b = 0 → a = 0 ∨ b = 0
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.
Instances
A version of zero_lt_one : 0 < 1
for a canonically_ordered_comm_semiring
.
Structures involving *
and 0
on with_top
and with_bot
#
The main results of this section are with_top.canonically_ordered_comm_semiring
and
with_bot.comm_monoid_with_zero
.
nontrivial α
is needed here as otherwise we have 1 * ⊤ = ⊤
but also = 0 * ⊤ = 0
.
Equations
- with_top.mul_zero_one_class = {one := 1, mul := has_mul.mul (mul_zero_class.to_has_mul (with_top α)), one_mul := _, mul_one := _, zero := 0, zero_mul := _, mul_zero := _}
Equations
- with_top.semigroup_with_zero = {mul := has_mul.mul (mul_zero_class.to_has_mul (with_top α)), mul_assoc := _, zero := 0, zero_mul := _, mul_zero := _}
Equations
- with_top.monoid_with_zero = {mul := mul_zero_one_class.mul with_top.mul_zero_one_class, mul_assoc := _, one := mul_zero_one_class.one with_top.mul_zero_one_class, one_mul := _, mul_one := _, npow := monoid.npow._default mul_zero_one_class.one mul_zero_one_class.mul with_top.monoid_with_zero._proof_4 with_top.monoid_with_zero._proof_5, npow_zero' := _, npow_succ' := _, zero := mul_zero_one_class.zero with_top.mul_zero_one_class, zero_mul := _, mul_zero := _}
Equations
- with_top.comm_monoid_with_zero = {mul := has_mul.mul (mul_zero_class.to_has_mul (with_top α)), mul_assoc := _, one := monoid_with_zero.one with_top.monoid_with_zero, one_mul := _, mul_one := _, npow := monoid_with_zero.npow with_top.monoid_with_zero, npow_zero' := _, npow_succ' := _, mul_comm := _, zero := 0, zero_mul := _, mul_zero := _}
This instance requires canonically_ordered_comm_semiring
as it is the smallest class
that derives from both non_assoc_non_unital_semiring
and canonically_ordered_add_monoid
, both
of which are required for distributivity.
Equations
- with_top.comm_semiring = {add := add_comm_monoid.add with_top.add_comm_monoid, add_assoc := _, zero := add_comm_monoid.zero with_top.add_comm_monoid, zero_add := _, add_zero := _, nsmul := add_comm_monoid.nsmul with_top.add_comm_monoid, nsmul_zero' := _, nsmul_succ' := _, add_comm := _, mul := comm_monoid_with_zero.mul with_top.comm_monoid_with_zero, left_distrib := _, right_distrib := _, zero_mul := _, mul_zero := _, mul_assoc := _, one := comm_monoid_with_zero.one with_top.comm_monoid_with_zero, one_mul := _, mul_one := _, npow := comm_monoid_with_zero.npow with_top.comm_monoid_with_zero, npow_zero' := _, npow_succ' := _, mul_comm := _}
Equations
- with_top.canonically_ordered_comm_semiring = {add := comm_semiring.add with_top.comm_semiring, add_assoc := _, zero := comm_semiring.zero with_top.comm_semiring, zero_add := _, add_zero := _, nsmul := comm_semiring.nsmul with_top.comm_semiring, nsmul_zero' := _, nsmul_succ' := _, add_comm := _, le := canonically_ordered_add_monoid.le with_top.canonically_ordered_add_monoid, lt := canonically_ordered_add_monoid.lt with_top.canonically_ordered_add_monoid, le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, add_le_add_left := _, bot := canonically_ordered_add_monoid.bot with_top.canonically_ordered_add_monoid, bot_le := _, le_iff_exists_add := _, mul := comm_semiring.mul with_top.comm_semiring, left_distrib := _, right_distrib := _, zero_mul := _, mul_zero := _, mul_assoc := _, one := comm_semiring.one with_top.comm_semiring, one_mul := _, mul_one := _, npow := comm_semiring.npow with_top.comm_semiring, npow_zero' := _, npow_succ' := _, mul_comm := _, eq_zero_or_eq_zero_of_mul_eq_zero := _}
Equations
nontrivial α
is needed here as otherwise we have 1 * ⊥ = ⊥
but also = 0 * ⊥ = 0
.