Documentation

Mathlib.Data.Real.Sign

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 #

Tags #

sign function

noncomputable def Real.sign (r : โ„) :

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

Instances For
    theorem Real.sign_of_neg {r : โ„} (hr : r < 0) :
    r.sign = -1
    theorem Real.sign_of_pos {r : โ„} (hr : 0 < r) :
    r.sign = 1
    theorem Real.sign_apply_eq (r : โ„) :
    r.sign = -1 โˆจ r.sign = 0 โˆจ r.sign = 1
    theorem Real.sign_apply_eq_of_ne_zero (r : โ„) (h : r โ‰  0) :
    r.sign = -1 โˆจ r.sign = 1

    This lemma is useful for working with โ„หฃ

    @[simp]
    theorem Real.sign_eq_zero_iff {r : โ„} :
    r.sign = 0 โ†” r = 0
    theorem Real.sign_intCast (z : โ„ค) :
    (โ†‘z).sign = โ†‘z.sign
    theorem Real.sign_mul_pos_of_ne_zero (r : โ„) (hr : r โ‰  0) :
    0 < r.sign * r