Conversion from WithTop to Base Type #
For types α that are instances of Zero, we provide a convenient conversion, WithTop.untop₀, that
maps elements a : WithTop α to α, by mapping ⊤ to zero.
For settings where α has additional structure, we provide a large number of simplifier lemmas,
akin to those that already exists for ENat.toNat.
Conversion from WithTop α to α, mapping ⊤ to zero.
Instances For
Simplifying Lemmas in cases where α is an Instance of Zero #
@[simp]
@[simp]
theorem
WithTop.coe_untop₀_of_ne_top
{α : Type u_1}
[Zero α]
{a : WithTop α}
(ha : a ≠ ⊤)
:
↑a.untop₀ = a
Simplifying Lemmas involving addition and negation #
@[simp]
@[simp]
theorem
WithTop.untop₀_add
{α : Type u_1}
[AddZeroClass α]
{a b : WithTop α}
(ha : a ≠ ⊤)
(hb : b ≠ ⊤)
:
@[simp]
@[simp]
theorem
WithTop.untop₀_ofNat
{α : Type u_1}
[AddMonoidWithOne α]
(n : ℕ)
[n.AtLeastTwo]
:
(OfNat.ofNat n).untop₀ = OfNat.ofNat n
@[simp]
Simplifying Lemmas in cases where α is a MulZeroClass #
@[simp]
Simplifying Lemmas in cases where α is an OrderedAddCommGroup #
@[simp]
Elements of ordered additive commutative groups are nonnegative iff their untop₀ is nonnegative.
theorem
WithTop.le_of_untop₀_le_untop₀
{α : Type u_1}
[AddCommGroup α]
[PartialOrder α]
{a b : WithTop α}
(ha : a ≠ ⊤)
(h : a.untop₀ ≤ b.untop₀)
:
@[simp]
theorem
WithTop.untop₀_le_untop₀
{α : Type u_1}
[AddCommGroup α]
[PartialOrder α]
{a b : WithTop α}
(hb : b ≠ ⊤)
(h : a ≤ b)
:
theorem
WithTop.untop₀_le_untop₀_iff
{α : Type u_1}
[AddCommGroup α]
[PartialOrder α]
{a b : WithTop α}
(ha : a ≠ ⊤)
(hb : b ≠ ⊤)
:
Simplifying Lemmas in cases where α is a LinearOrderedAddCommGroup #
@[simp]
theorem
WithTop.untop₀_max
{α : Type u_1}
[AddCommGroup α]
[LinearOrder α]
{a b : WithTop α}
(ha : a ≠ ⊤)
(hb : b ≠ ⊤)
:
@[simp]
theorem
WithTop.untop₀_min
{α : Type u_1}
[AddCommGroup α]
[LinearOrder α]
{a b : WithTop α}
(ha : a ≠ ⊤)
(hb : b ≠ ⊤)
: