The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V02. Numbers

Mathlib.Basic.Real.Sign

14 declarations. Mathlib docs · Source

Real sign function

This file introduces and contains some results about Real.sign which maps negative real numbers to -1, positive real numbers to 1, and 0 to 0.

Main definitions

  • Real.sign r is $\begin{cases} -1 & \text{if } r < 0, \ ~~, 0 & \text{if } r = 0, \ ~~, 1 & \text{if } r > 0. \end{cases}$

Tags

sign function

def Real.sign E1 #

ℝ → ℝ

The sign function that maps negative real numbers to -1, positive numbers to 1, and 0 otherwise.

theorem Real.sign_of_neg E1 #

∀ {r : ℝ}, r < 0 → r.sign = -1

theorem Real.sign_of_pos E1 #

∀ {r : ℝ}, 0 < r → r.sign = 1

theorem Real.sign_zero E0 #

Real.sign 0 = 0

theorem Real.sign_one E0 #

Real.sign 1 = 1

theorem Real.sign_apply_eq E0 #

∀ (r : ℝ), r.sign = -1 ∨ r.sign = 0 ∨ r.sign = 1

theorem Real.sign_apply_eq_of_ne_zero E2 #

∀ (r : ℝ), r ≠ 0 → r.sign = -1 ∨ r.sign = 1

This lemma is useful for working with ℝˣ

theorem Real.sign_eq_zero_iff E0 #

∀ {r : ℝ}, r.sign = 0 ↔ r = 0

theorem Real.sign_intCast E1 #

∀ (z : ℤ), (↑z).sign = ↑z.sign

theorem Real.sign_neg E1 #

∀ {r : ℝ}, (-r).sign = -r.sign

theorem Real.sign_mul_nonneg E1 #

∀ (r : ℝ), 0 ≤ r.sign * r

theorem Real.sign_mul_pos_of_ne_zero E1 #

∀ (r : ℝ), r ≠ 0 → 0 < r.sign * r

theorem Real.inv_sign E0 #

∀ (r : ℝ), r.sign⁻¹ = r.sign

theorem Real.sign_inv E0 #

∀ (r : ℝ), r⁻¹.sign = r.sign