Structures involving *
and 0
on with_top
and with_bot
#
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
The main results of this section are with_top.canonically_ordered_comm_semiring
and
with_bot.ordered_comm_semiring
.
@[protected, instance]
Equations
- with_top.mul_zero_class = {mul := λ (m n : with_top α), ite (m = 0 ∨ n = 0) 0 (option.map₂ has_mul.mul m n), zero := 0, zero_mul := _, mul_zero := _}
theorem
with_top.mul_def
{α : Type u_1}
[decidable_eq α]
[has_zero α]
[has_mul α]
{a b : with_top α} :
a * b = ite (a = 0 ∨ b = 0) 0 (option.map₂ has_mul.mul a b)
@[protected, instance]
def
with_top.no_zero_divisors
{α : Type u_1}
[decidable_eq α]
[has_zero α]
[has_mul α]
[no_zero_divisors α] :
@[simp, norm_cast]
theorem
with_top.mul_coe
{α : Type u_1}
[decidable_eq α]
[mul_zero_class α]
{b : α}
(hb : b ≠ 0)
{a : with_top α} :
@[simp]
theorem
with_top.untop'_zero_mul
{α : Type u_1}
[decidable_eq α]
[mul_zero_class α]
(a b : with_top α) :
with_top.untop' 0 (a * b) = with_top.untop' 0 a * with_top.untop' 0 b
@[protected, instance]
def
with_top.mul_zero_one_class
{α : Type u_1}
[decidable_eq α]
[mul_zero_one_class α]
[nontrivial α] :
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 := _}
@[simp]
theorem
monoid_with_zero_hom.with_top_map_apply
{R : Type u_1}
{S : Type u_2}
[mul_zero_one_class R]
[decidable_eq R]
[nontrivial R]
[mul_zero_one_class S]
[decidable_eq S]
[nontrivial S]
(f : R →*₀ S)
(hf : function.injective ⇑f) :
⇑(f.with_top_map hf) = with_top.map ⇑f
@[protected]
def
monoid_with_zero_hom.with_top_map
{R : Type u_1}
{S : Type u_2}
[mul_zero_one_class R]
[decidable_eq R]
[nontrivial R]
[mul_zero_one_class S]
[decidable_eq S]
[nontrivial S]
(f : R →*₀ S)
(hf : function.injective ⇑f) :
A version of with_top.map
for monoid_with_zero_hom
s.
Equations
- f.with_top_map hf = {to_fun := with_top.map ⇑f, map_zero' := _, map_one' := _, map_mul' := _}
@[protected, instance]
def
with_top.semigroup_with_zero
{α : Type u_1}
[decidable_eq α]
[semigroup_with_zero α]
[no_zero_divisors α] :
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 := _}
@[protected, instance]
def
with_top.monoid_with_zero
{α : Type u_1}
[decidable_eq α]
[monoid_with_zero α]
[no_zero_divisors α]
[nontrivial α] :
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 := _}
@[protected, instance]
def
with_top.comm_monoid_with_zero
{α : Type u_1}
[decidable_eq α]
[comm_monoid_with_zero α]
[no_zero_divisors α]
[nontrivial α] :
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 := _}
@[protected, instance]
def
with_top.comm_semiring
{α : Type u_1}
[decidable_eq α]
[canonically_ordered_comm_semiring α]
[nontrivial α] :
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_with_one.add with_top.add_comm_monoid_with_one, add_assoc := _, zero := add_comm_monoid_with_one.zero with_top.add_comm_monoid_with_one, zero_add := _, add_zero := _, nsmul := add_comm_monoid_with_one.nsmul with_top.add_comm_monoid_with_one, 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 := add_comm_monoid_with_one.one with_top.add_comm_monoid_with_one, one_mul := _, mul_one := _, nat_cast := add_comm_monoid_with_one.nat_cast with_top.add_comm_monoid_with_one, nat_cast_zero := _, nat_cast_succ := _, npow := comm_monoid_with_zero.npow with_top.comm_monoid_with_zero, npow_zero' := _, npow_succ' := _, mul_comm := _}
@[protected, instance]
def
with_top.canonically_ordered_comm_semiring
{α : Type u_1}
[decidable_eq α]
[canonically_ordered_comm_semiring α]
[nontrivial α] :
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 := _, exists_add_of_le := _, le_self_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 := _, nat_cast := comm_semiring.nat_cast with_top.comm_semiring, nat_cast_zero := _, nat_cast_succ := _, npow := comm_semiring.npow with_top.comm_semiring, npow_zero' := _, npow_succ' := _, mul_comm := _, eq_zero_or_eq_zero_of_mul_eq_zero := _}
@[protected]
def
ring_hom.with_top_map
{R : Type u_1}
{S : Type u_2}
[canonically_ordered_comm_semiring R]
[decidable_eq R]
[nontrivial R]
[canonically_ordered_comm_semiring S]
[decidable_eq S]
[nontrivial S]
(f : R →+* S)
(hf : function.injective ⇑f) :
A version of with_top.map
for ring_hom
s.
Equations
- f.with_top_map hf = {to_fun := with_top.map ⇑f, map_one' := _, map_mul' := _, map_zero' := _, map_add' := _}
@[simp]
theorem
ring_hom.with_top_map_apply
{R : Type u_1}
{S : Type u_2}
[canonically_ordered_comm_semiring R]
[decidable_eq R]
[nontrivial R]
[canonically_ordered_comm_semiring S]
[decidable_eq S]
[nontrivial S]
(f : R →+* S)
(hf : function.injective ⇑f) :
⇑(f.with_top_map hf) = with_top.map ⇑f
@[protected, instance]
Equations
theorem
with_bot.mul_def
{α : Type u_1}
[decidable_eq α]
[has_zero α]
[has_mul α]
{a b : with_bot α} :
a * b = ite (a = 0 ∨ b = 0) 0 (option.map₂ has_mul.mul a b)
@[norm_cast]
theorem
with_bot.mul_coe
{α : Type u_1}
[decidable_eq α]
[mul_zero_class α]
{b : α}
(hb : b ≠ 0)
{a : with_bot α} :
@[protected, instance]
def
with_bot.mul_zero_one_class
{α : Type u_1}
[decidable_eq α]
[mul_zero_one_class α]
[nontrivial α] :
nontrivial α
is needed here as otherwise we have 1 * ⊥ = ⊥
but also = 0 * ⊥ = 0
.
@[protected, instance]
def
with_bot.no_zero_divisors
{α : Type u_1}
[decidable_eq α]
[mul_zero_class α]
[no_zero_divisors α] :
@[protected, instance]
def
with_bot.semigroup_with_zero
{α : Type u_1}
[decidable_eq α]
[semigroup_with_zero α]
[no_zero_divisors α] :
@[protected, instance]
def
with_bot.monoid_with_zero
{α : Type u_1}
[decidable_eq α]
[monoid_with_zero α]
[no_zero_divisors α]
[nontrivial α] :
@[protected, instance]
def
with_bot.comm_monoid_with_zero
{α : Type u_1}
[decidable_eq α]
[comm_monoid_with_zero α]
[no_zero_divisors α]
[nontrivial α] :
@[protected, instance]
def
with_bot.comm_semiring
{α : Type u_1}
[decidable_eq α]
[canonically_ordered_comm_semiring α]
[nontrivial α] :
Equations
@[protected, instance]
def
with_bot.pos_mul_mono
{α : Type u_1}
[decidable_eq α]
[mul_zero_class α]
[preorder α]
[pos_mul_mono α] :
pos_mul_mono (with_bot α)
@[protected, instance]
def
with_bot.mul_pos_mono
{α : Type u_1}
[decidable_eq α]
[mul_zero_class α]
[preorder α]
[mul_pos_mono α] :
mul_pos_mono (with_bot α)
@[protected, instance]
def
with_bot.pos_mul_strict_mono
{α : Type u_1}
[decidable_eq α]
[mul_zero_class α]
[preorder α]
[pos_mul_strict_mono α] :
@[protected, instance]
def
with_bot.mul_pos_strict_mono
{α : Type u_1}
[decidable_eq α]
[mul_zero_class α]
[preorder α]
[mul_pos_strict_mono α] :
@[protected, instance]
def
with_bot.pos_mul_reflect_lt
{α : Type u_1}
[decidable_eq α]
[mul_zero_class α]
[preorder α]
[pos_mul_reflect_lt α] :
@[protected, instance]
def
with_bot.mul_pos_reflect_lt
{α : Type u_1}
[decidable_eq α]
[mul_zero_class α]
[preorder α]
[mul_pos_reflect_lt α] :
@[protected, instance]
def
with_bot.pos_mul_mono_rev
{α : Type u_1}
[decidable_eq α]
[mul_zero_class α]
[preorder α]
[pos_mul_mono_rev α] :
@[protected, instance]
def
with_bot.mul_pos_mono_rev
{α : Type u_1}
[decidable_eq α]
[mul_zero_class α]
[preorder α]
[mul_pos_mono_rev α] :
@[protected, instance]
def
with_bot.ordered_comm_semiring
{α : Type u_1}
[decidable_eq α]
[canonically_ordered_comm_semiring α]
[nontrivial α] :
Equations
- with_bot.ordered_comm_semiring = {add := ordered_add_comm_monoid.add with_bot.ordered_add_comm_monoid, add_assoc := _, zero := ordered_add_comm_monoid.zero with_bot.ordered_add_comm_monoid, zero_add := _, add_zero := _, nsmul := ordered_add_comm_monoid.nsmul with_bot.ordered_add_comm_monoid, nsmul_zero' := _, nsmul_succ' := _, add_comm := _, mul := comm_semiring.mul with_bot.comm_semiring, left_distrib := _, right_distrib := _, zero_mul := _, mul_zero := _, mul_assoc := _, one := comm_semiring.one with_bot.comm_semiring, one_mul := _, mul_one := _, nat_cast := comm_semiring.nat_cast with_bot.comm_semiring, nat_cast_zero := _, nat_cast_succ := _, npow := comm_semiring.npow with_bot.comm_semiring, npow_zero' := _, npow_succ' := _, le := ordered_add_comm_monoid.le with_bot.ordered_add_comm_monoid, lt := ordered_add_comm_monoid.lt with_bot.ordered_add_comm_monoid, le_refl := _, le_trans := _, lt_iff_le_not_le := _, le_antisymm := _, add_le_add_left := _, zero_le_one := _, mul_le_mul_of_nonneg_left := _, mul_le_mul_of_nonneg_right := _, mul_comm := _}