English
The map a ↦ max(a,0) defines a function from any α with a zero and a semilattice supremum to the subset {x ∈ α | 0 ≤ x}, i.e., a nonnegative representative of a.
Русский
Отображение a ↦ max(a,0) определяет отображение из любой множества α с нулём и наим. верх. пределом в подмножество {x ∈ α | 0 ≤ x}.
LaTeX
$$$\mathrm{toNonneg}(a) = (\max(a,0),\ 0 \le \max(a,0))$$$
Lean4
/-- The function `a ↦ max a 0` of type `α → {x : α // 0 ≤ x}`. -/
def toNonneg (a : α) : { x : α // 0 ≤ x } :=
⟨max a 0, le_sup_right⟩