Square root of a real number #
In this file we define
NNReal.sqrt
to be the square root of a nonnegative real number.Real.sqrt
to be the square root of a real number, defined to be zero on negative numbers.
Then we prove some basic properties of these functions.
Implementation notes #
We define NNReal.sqrt
as the noncomputable inverse to the function x ↦ x * x
. We use general
theory of inverses of strictly monotone functions to prove that NNReal.sqrt x
exists. As a side
effect, NNReal.sqrt
is a bundled OrderIso
, so for NNReal
numbers we get continuity as well as
theorems like NNReal.sqrt x ≤ y ↔ x ≤ y * y
for free.
Then we define Real.sqrt x
to be NNReal.sqrt (Real.toNNReal x)
.
Tags #
square root
Square root of a nonnegative real number.
Equations
Instances For
Alias of NNReal.sqrt_le_sqrt
.
Alias of NNReal.sqrt_lt_sqrt
.
Alias of NNReal.sqrt_le_iff_le_sq
.
Alias of NNReal.le_sqrt_iff_sq_le
.
Alias of NNReal.sqrt_eq_iff_eq_sq
.
NNReal.sqrt
as a MonoidWithZeroHom
.
Equations
- NNReal.sqrtHom = { toZeroHom := { toFun := ⇑NNReal.sqrt, map_zero' := NNReal.sqrt_zero }, map_one' := NNReal.sqrt_one, map_mul' := NNReal.sqrt_mul }
Instances For
Alias of the reverse direction of NNReal.sqrt_pos
.
The square root of a real number. This returns 0 for negative inputs.
This has notation √x
. Note that √x⁻¹
is parsed as √(x⁻¹)
.
Equations
- Real.«term√_» = Lean.ParserDescr.node `Real.term√_ 1024 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol "√") (Lean.ParserDescr.cat `term 1024))
Instances For
Note: if you want to conclude x ≤ √y
, then use Real.le_sqrt_of_sq_le
.
If you have x > 0
, consider using Real.le_sqrt'
Alias of the reverse direction of Real.sqrt_pos
.
Extension for the positivity
tactic: a square root of a strictly positive nonnegative real is
positive.
Instances For
Extension for the positivity
tactic: a square root is nonnegative, and is strictly positive if
its input is.
Instances For
Although the instance RCLike.toStarOrderedRing
exists, it is locked behind the
ComplexOrder
scope because currently the order on ℂ
is not enabled globally. But we
want StarOrderedRing ℝ
to be available globally, so we include this instance separately.
In addition, providing this instance here makes it available earlier in the import
hierarchy; otherwise in order to access it we would need to import Mathlib.Analysis.RCLike.Basic
.
Equations
- One or more equations did not get rendered due to their size.
Equations
Cauchy-Schwarz inequality for finsets using square roots in ℝ≥0
.
Cauchy-Schwarz inequality for finsets using square roots in ℝ≥0
.
Cauchy-Schwarz inequality for finsets using square roots in ℝ
.
Cauchy-Schwarz inequality for finsets using square roots in ℝ
.