Documentation

Mathlib.Algebra.Order.Nonneg.Ring

Bundled ordered algebra instance on the type of nonnegative elements #

This file defines instances and prove some properties about the nonnegative elements {x : α // 0 ≤ x} of an arbitrary type α.

Currently we only state instances and states some simp/norm_cast lemmas.

When α is , this will give us some properties about ℝ≥0.

Main declarations #

Implementation Notes #

Instead of {x : α // 0 ≤ x} we could also use Set.Ici (0 : α), which is definitionally equal. However, using the explicit subtype has a big advantage: when writing an element explicitly with a proof of nonnegativity as ⟨x, hx⟩, the hx is expected to have type 0 ≤ x. If we would use Ici 0, then the type is expected to be x ∈ Ici 0. Although these types are definitionally equal, this often confuses the elaborator. Similar problems arise when doing cases on an element.

The disadvantage is that we have to duplicate some instances about Set.Ici to this subtype.

Equations
Equations
Equations
Equations
instance Nonneg.orderedSemiring {α : Type u_1} [OrderedSemiring α] :
OrderedSemiring { x : α // 0 x }
Equations
Equations
instance Nonneg.orderedCommSemiring {α : Type u_1} [OrderedCommSemiring α] :
OrderedCommSemiring { x : α // 0 x }
Equations
instance Nonneg.orderedCommMonoid {α : Type u_1} [OrderedCommSemiring α] :
OrderedCommMonoid { x : α // 0 x }
Equations
Equations
theorem Nonneg.nontrivial {α : Type u_1} [LinearOrderedSemiring α] :
Nontrivial { x : α // 0 x }
Equations
Equations
Equations
Equations
Equations
theorem Nonneg.orderedSub {α : Type u_1} [LinearOrderedRing α] :
OrderedSub { x : α // 0 x }