File: Mathlib/Data/Real/Sqrt.lean

full_name: NNReal.sqrt
code: /-- Square root of a nonnegative real number. -/
-- Porting note (kmill): `pp_nodot` has no affect here
-- unless RFC lean4#1910 leads to dot notation for CoeFun
@[pp_nodot]
noncomputable def sqrt : ℝ≥0 ≃o ℝ≥0 
goal: ℝ≥0 ≃o ℝ≥0

full_name: NNReal.sq_sqrt
code: @[simp] lemma sq_sqrt (x : ℝ≥0) : sqrt x ^ 2 = x 
goal: NNReal.sqrt x ^ 2 = x

full_name: NNReal.sqrt_sq
code: @[simp] lemma sqrt_sq (x : ℝ≥0) : sqrt (x ^ 2) = x 
goal: NNReal.sqrt (x ^ 2) = x

full_name: NNReal.mul_self_sqrt
code: @[simp] lemma mul_self_sqrt (x : ℝ≥0) : sqrt x * sqrt x = x 
goal: NNReal.sqrt x * NNReal.sqrt x = x

full_name: NNReal.sqrt_mul_self
code: @[simp] lemma sqrt_mul_self (x : ℝ≥0) : sqrt (x * x) = x 
goal: NNReal.sqrt (x * x) = x

full_name: NNReal.sqrt_le_sqrt
code: lemma sqrt_le_sqrt : sqrt x ≤ sqrt y ↔ x ≤ y 
goal: NNReal.sqrt x ≤ NNReal.sqrt y ↔ x ≤ y

full_name: NNReal.sqrt_lt_sqrt
code: lemma sqrt_lt_sqrt : sqrt x < sqrt y ↔ x < y 
goal: NNReal.sqrt x < NNReal.sqrt y ↔ x < y

full_name: NNReal.sqrt_eq_iff_eq_sq
code: lemma sqrt_eq_iff_eq_sq : sqrt x = y ↔ x = y ^ 2 
goal: NNReal.sqrt x = y ↔ x = y ^ 2

full_name: NNReal.sqrt_le_iff_le_sq
code: lemma sqrt_le_iff_le_sq : sqrt x ≤ y ↔ x ≤ y ^ 2 
goal: NNReal.sqrt x ≤ y ↔ x ≤ y ^ 2

full_name: NNReal.le_sqrt_iff_sq_le
code: lemma le_sqrt_iff_sq_le : x ≤ sqrt y ↔ x ^ 2 ≤ y 
goal: x ≤ NNReal.sqrt y ↔ x ^ 2 ≤ y

full_name: NNReal.sqrt_eq_zero
code: @[simp] lemma sqrt_eq_zero : sqrt x = 0 ↔ x = 0 
goal: NNReal.sqrt x = 0 ↔ x = 0

full_name: NNReal.sqrt_eq_one
code: @[simp] lemma sqrt_eq_one : sqrt x = 1 ↔ x = 1 
goal: NNReal.sqrt x = 1 ↔ x = 1

full_name: NNReal.sqrt_zero
code: @[simp] lemma sqrt_zero : sqrt 0 = 0 
goal: NNReal.sqrt 0 = 0

full_name: NNReal.sqrt_one
code: @[simp] lemma sqrt_one : sqrt 1 = 1 
goal: NNReal.sqrt 1 = 1

full_name: NNReal.sqrt_le_one
code: @[simp] lemma sqrt_le_one : sqrt x ≤ 1 ↔ x ≤ 1 
goal: NNReal.sqrt x ≤ 1 ↔ x ≤ 1

full_name: NNReal.one_le_sqrt
code: @[simp] lemma one_le_sqrt : 1 ≤ sqrt x ↔ 1 ≤ x 
goal: 1 ≤ NNReal.sqrt x ↔ 1 ≤ x

full_name: NNReal.sqrt_mul
code: theorem sqrt_mul (x y : ℝ≥0) : sqrt (x * y) = sqrt x * sqrt y 
goal: NNReal.sqrt (x * y) = NNReal.sqrt x * NNReal.sqrt y

full_name: NNReal.sqrtHom
code: /-- `NNReal.sqrt` as a `MonoidWithZeroHom`. -/
noncomputable def sqrtHom : ℝ≥0 →*₀ ℝ≥0 
goal: ℝ≥0 →*₀ ℝ≥0

full_name: NNReal.sqrt_inv
code: theorem sqrt_inv (x : ℝ≥0) : sqrt x⁻¹ = (sqrt x)⁻¹ 
goal: NNReal.sqrt x⁻¹ = (NNReal.sqrt x)⁻¹

full_name: NNReal.sqrt_div
code: theorem sqrt_div (x y : ℝ≥0) : sqrt (x / y) = sqrt x / sqrt y 
goal: NNReal.sqrt (x / y) = NNReal.sqrt x / NNReal.sqrt y

full_name: NNReal.continuous_sqrt
code: @[continuity, fun_prop]
theorem continuous_sqrt : Continuous sqrt 
goal: Continuous ⇑NNReal.sqrt

full_name: NNReal.sqrt_pos
code: @[simp] theorem sqrt_pos : 0 < sqrt x ↔ 0 < x 
goal: 0 < NNReal.sqrt x ↔ 0 < x

full_name: Real.sqrt
code: /-- The square root of a real number. This returns 0 for negative inputs.

This has notation `√x`. Note that `√x⁻¹` is parsed as `√(x⁻¹)`. -/
noncomputable def sqrt (x : ℝ) : ℝ 
goal: ℝ

full_name: Real.«_aux_Mathlib_Data_Real_Sqrt___macroRules_Real_term√__1»
code: @[inherit_doc]
prefix:max "√" => Real.sqrt
goal: Lean.Macro

full_name: Real._aux_Mathlib_Data_Real_Sqrt___unexpand_Real_sqrt_1
code: @[inherit_doc]
prefix:max "√" => Real.sqrt
goal: Lean.PrettyPrinter.Unexpander

full_name: Real.coe_sqrt
code: @[simp, norm_cast]
theorem coe_sqrt {x : ℝ≥0} : (NNReal.sqrt x : ℝ) = √(x : ℝ) 
goal: ↑(NNReal.sqrt x) = √↑x

full_name: Real.continuous_sqrt
code: @[continuity]
theorem continuous_sqrt : Continuous (√· : ℝ → ℝ) 
goal: Continuous fun x => √x

full_name: Real.sqrt_eq_zero_of_nonpos
code: theorem sqrt_eq_zero_of_nonpos (h : x ≤ 0) : sqrt x = 0 
goal: √x = 0

full_name: Real.sqrt_nonneg
code: theorem sqrt_nonneg (x : ℝ) : 0 ≤ √x 
goal: 0 ≤ √x

full_name: Real.mul_self_sqrt
code: @[simp]
theorem mul_self_sqrt (h : 0 ≤ x) : √x * √x = x 
goal: √x * √x = x

full_name: Real.sqrt_mul_self
code: @[simp]
theorem sqrt_mul_self (h : 0 ≤ x) : √(x * x) = x 
goal: √(x * x) = x

full_name: Real.sqrt_eq_cases
code: theorem sqrt_eq_cases : √x = y ↔ y * y = x ∧ 0 ≤ y ∨ x < 0 ∧ y = 0 
goal: √x = y ↔ y * y = x ∧ 0 ≤ y ∨ x < 0 ∧ y = 0

full_name: Real.sqrt_eq_iff_mul_self_eq
code: theorem sqrt_eq_iff_mul_self_eq (hx : 0 ≤ x) (hy : 0 ≤ y) : √x = y ↔ y * y = x 
goal: √x = y ↔ y * y = x

full_name: Real.sqrt_eq_iff_mul_self_eq_of_pos
code: theorem sqrt_eq_iff_mul_self_eq_of_pos (h : 0 < y) : √x = y ↔ y * y = x 
goal: √x = y ↔ y * y = x

full_name: Real.sqrt_eq_one
code: @[simp]
theorem sqrt_eq_one : √x = 1 ↔ x = 1 
goal: √x = 1 ↔ x = 1

full_name: Real.sq_sqrt
code: @[simp]
theorem sq_sqrt (h : 0 ≤ x) : √x ^ 2 = x 
goal: √x ^ 2 = x

full_name: Real.sqrt_sq
code: @[simp]
theorem sqrt_sq (h : 0 ≤ x) : √(x ^ 2) = x 
goal: √(x ^ 2) = x

full_name: Real.sqrt_eq_iff_sq_eq
code: theorem sqrt_eq_iff_sq_eq (hx : 0 ≤ x) (hy : 0 ≤ y) : √x = y ↔ y ^ 2 = x 
goal: √x = y ↔ y ^ 2 = x

full_name: Real.sqrt_mul_self_eq_abs
code: theorem sqrt_mul_self_eq_abs (x : ℝ) : √(x * x) = |x| 
goal: √(x * x) = |x|

full_name: Real.sqrt_sq_eq_abs
code: theorem sqrt_sq_eq_abs (x : ℝ) : √(x ^ 2) = |x| 
goal: √(x ^ 2) = |x|

full_name: Real.sqrt_zero
code: @[simp]
theorem sqrt_zero : √0 = 0 
goal: √0 = 0

full_name: Real.sqrt_one
code: @[simp]
theorem sqrt_one : √1 = 1 
goal: √1 = 1

full_name: Real.sqrt_le_sqrt_iff
code: @[simp]
theorem sqrt_le_sqrt_iff (hy : 0 ≤ y) : √x ≤ √y ↔ x ≤ y 
goal: √x ≤ √y ↔ x ≤ y

full_name: Real.sqrt_lt_sqrt_iff
code: @[simp]
theorem sqrt_lt_sqrt_iff (hx : 0 ≤ x) : √x < √y ↔ x < y 
goal: √x < √y ↔ x < y

full_name: Real.sqrt_lt_sqrt_iff_of_pos
code: theorem sqrt_lt_sqrt_iff_of_pos (hy : 0 < y) : √x < √y ↔ x < y 
goal: √x < √y ↔ x < y

full_name: Real.sqrt_le_sqrt
code: @[gcongr]
theorem sqrt_le_sqrt (h : x ≤ y) : √x ≤ √y 
goal: √x ≤ √y

full_name: Real.sqrt_lt_sqrt
code: @[gcongr]
theorem sqrt_lt_sqrt (hx : 0 ≤ x) (h : x < y) : √x < √y 
goal: √x < √y

full_name: Real.sqrt_le_left
code: theorem sqrt_le_left (hy : 0 ≤ y) : √x ≤ y ↔ x ≤ y ^ 2 
goal: √x ≤ y ↔ x ≤ y ^ 2

full_name: Real.sqrt_le_iff
code: theorem sqrt_le_iff : √x ≤ y ↔ 0 ≤ y ∧ x ≤ y ^ 2 
goal: √x ≤ y ↔ 0 ≤ y ∧ x ≤ y ^ 2

full_name: Real.sqrt_lt
code: theorem sqrt_lt (hx : 0 ≤ x) (hy : 0 ≤ y) : √x < y ↔ x < y ^ 2 
goal: √x < y ↔ x < y ^ 2

full_name: Real.sqrt_lt'
code: theorem sqrt_lt' (hy : 0 < y) : √x < y ↔ x < y ^ 2 
goal: √x < y ↔ x < y ^ 2

full_name: Real.le_sqrt
code: /-- 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'` -/
theorem le_sqrt (hx : 0 ≤ x) (hy : 0 ≤ y) : x ≤ √y ↔ x ^ 2 ≤ y 
goal: x ≤ √y ↔ x ^ 2 ≤ y

full_name: Real.le_sqrt'
code: theorem le_sqrt' (hx : 0 < x) : x ≤ √y ↔ x ^ 2 ≤ y 
goal: x ≤ √y ↔ x ^ 2 ≤ y

full_name: Real.abs_le_sqrt
code: theorem abs_le_sqrt (h : x ^ 2 ≤ y) : |x| ≤ √y 
goal: |x| ≤ √y

full_name: Real.sq_le
code: theorem sq_le (h : 0 ≤ y) : x ^ 2 ≤ y ↔ -√y ≤ x ∧ x ≤ √y 
goal: x ^ 2 ≤ y ↔ -√y ≤ x ∧ x ≤ √y

full_name: Real.neg_sqrt_le_of_sq_le
code: theorem neg_sqrt_le_of_sq_le (h : x ^ 2 ≤ y) : -√y ≤ x 
goal: -√y ≤ x

full_name: Real.le_sqrt_of_sq_le
code: theorem le_sqrt_of_sq_le (h : x ^ 2 ≤ y) : x ≤ √y 
goal: x ≤ √y

full_name: Real.sqrt_inj
code: @[simp]
theorem sqrt_inj (hx : 0 ≤ x) (hy : 0 ≤ y) : √x = √y ↔ x = y 
goal: √x = √y ↔ x = y

full_name: Real.sqrt_eq_zero
code: @[simp]
theorem sqrt_eq_zero (h : 0 ≤ x) : √x = 0 ↔ x = 0 
goal: √x = 0 ↔ x = 0

full_name: Real.sqrt_eq_zero'
code: theorem sqrt_eq_zero' : √x = 0 ↔ x ≤ 0 
goal: √x = 0 ↔ x ≤ 0

full_name: Real.sqrt_ne_zero
code: theorem sqrt_ne_zero (h : 0 ≤ x) : √x ≠ 0 ↔ x ≠ 0 
goal: √x ≠ 0 ↔ x ≠ 0

full_name: Real.sqrt_ne_zero'
code: theorem sqrt_ne_zero' : √x ≠ 0 ↔ 0 < x 
goal: √x ≠ 0 ↔ 0 < x

full_name: Real.sqrt_pos
code: @[simp]
theorem sqrt_pos : 0 < √x ↔ 0 < x 
goal: 0 < √x ↔ 0 < x

full_name: Real.sqrt_le_sqrt_iff'
code: lemma sqrt_le_sqrt_iff' (hx : 0 < x) : √x ≤ √y ↔ x ≤ y 
goal: √x ≤ √y ↔ x ≤ y

full_name: Real.one_le_sqrt
code: @[simp] lemma one_le_sqrt : 1 ≤ √x ↔ 1 ≤ x 
goal: 1 ≤ √x ↔ 1 ≤ x

full_name: Real.sqrt_le_one
code: @[simp] lemma sqrt_le_one : √x ≤ 1 ↔ x ≤ 1 
goal: √x ≤ 1 ↔ x ≤ 1

full_name: Mathlib.Meta.Positivity.evalNNRealSqrt
code: /-- Extension for the `positivity` tactic: a square root of a strictly positive nonnegative real is
positive. -/
@[positivity NNReal.sqrt _]
def evalNNRealSqrt : PositivityExt 
goal: Mathlib.Meta.Positivity.PositivityExt

full_name: Mathlib.Meta.Positivity.evalSqrt
code: /-- Extension for the `positivity` tactic: a square root is nonnegative, and is strictly positive if
its input is. -/
@[positivity √ _]
def evalSqrt : PositivityExt 
goal: Mathlib.Meta.Positivity.PositivityExt

full_name: Real.sqrt_mul
code: @[simp]
theorem sqrt_mul {x : ℝ} (hx : 0 ≤ x) (y : ℝ) : √(x * y) = √x * √y 
goal: √(x * y) = √x * √y

full_name: Real.sqrt_mul'
code: @[simp]
theorem sqrt_mul' (x) {y : ℝ} (hy : 0 ≤ y) : √(x * y) = √x * √y 
goal: √(x * y) = √x * √y

full_name: Real.sqrt_inv
code: @[simp]
theorem sqrt_inv (x : ℝ) : √x⁻¹ = (√x)⁻¹ 
goal: √x⁻¹ = (√x)⁻¹

full_name: Real.sqrt_div
code: @[simp]
theorem sqrt_div {x : ℝ} (hx : 0 ≤ x) (y : ℝ) : √(x / y) = √x / √y 
goal: √(x / y) = √x / √y

full_name: Real.sqrt_div'
code: @[simp]
theorem sqrt_div' (x) {y : ℝ} (hy : 0 ≤ y) : √(x / y) = √x / √y 
goal: √(x / y) = √x / √y

full_name: Real.div_sqrt
code: @[simp]
theorem div_sqrt : x / √x = √x 
goal: x / √x = √x

full_name: Real.sqrt_div_self'
code: theorem sqrt_div_self' : √x / x = 1 / √x 
goal: √x / x = 1 / √x

full_name: Real.sqrt_div_self
code: theorem sqrt_div_self : √x / x = (√x)⁻¹ 
goal: √x / x = (√x)⁻¹

full_name: Real.lt_sqrt
code: theorem lt_sqrt (hx : 0 ≤ x) : x < √y ↔ x ^ 2 < y 
goal: x < √y ↔ x ^ 2 < y

full_name: Real.sq_lt
code: theorem sq_lt : x ^ 2 < y ↔ -√y < x ∧ x < √y 
goal: x ^ 2 < y ↔ -√y < x ∧ x < √y

full_name: Real.neg_sqrt_lt_of_sq_lt
code: theorem neg_sqrt_lt_of_sq_lt (h : x ^ 2 < y) : -√y < x 
goal: -√y < x

full_name: Real.lt_sqrt_of_sq_lt
code: theorem lt_sqrt_of_sq_lt (h : x ^ 2 < y) : x < √y 
goal: x < √y

full_name: Real.lt_sq_of_sqrt_lt
code: theorem lt_sq_of_sqrt_lt (h : √x < y) : x < y ^ 2 
goal: x < y ^ 2

full_name: Real.nat_sqrt_le_real_sqrt
code: /-- The natural square root is at most the real square root -/
theorem nat_sqrt_le_real_sqrt {a : ℕ} : ↑(Nat.sqrt a) ≤ √(a : ℝ) 
goal: ↑a.sqrt ≤ √↑a

full_name: Real.real_sqrt_lt_nat_sqrt_succ
code: /-- The real square root is less than the natural square root plus one -/
theorem real_sqrt_lt_nat_sqrt_succ {a : ℕ} : √(a : ℝ) < Nat.sqrt a + 1 
goal: √↑a < ↑a.sqrt + 1

full_name: Real.real_sqrt_le_nat_sqrt_succ
code: /-- The real square root is at most the natural square root plus one -/
theorem real_sqrt_le_nat_sqrt_succ {a : ℕ} : √(a : ℝ) ≤ Nat.sqrt a + 1 
goal: √↑a ≤ ↑a.sqrt + 1

full_name: Real.floor_real_sqrt_eq_nat_sqrt
code: /-- The floor of the real square root is the same as the natural square root. -/
@[simp]
theorem floor_real_sqrt_eq_nat_sqrt {a : ℕ} : ⌊√(a : ℝ)⌋ = Nat.sqrt a 
goal: ⌊√↑a⌋ = ↑a.sqrt

full_name: Real.nat_floor_real_sqrt_eq_nat_sqrt
code: /-- The natural floor of the real square root is the same as the natural square root. -/
@[simp]
theorem nat_floor_real_sqrt_eq_nat_sqrt {a : ℕ} : ⌊√(a : ℝ)⌋₊ = Nat.sqrt a 
goal: ⌊√↑a⌋₊ = a.sqrt

full_name: Real.sqrt_one_add_le
code: /-- Bernoulli's inequality for exponent `1 / 2`, stated using `sqrt`. -/
theorem sqrt_one_add_le (h : -1 ≤ x) : √(1 + x) ≤ 1 + x / 2 
goal: √(1 + x) ≤ 1 + x / 2

full_name: Filter.Tendsto.sqrt
code: theorem Filter.Tendsto.sqrt {f : α → ℝ} {l : Filter α} {x : ℝ} (h : Tendsto f l (𝓝 x)) :
    Tendsto (fun x => √(f x)) l (𝓝 (√x)) 
goal: Filter.Tendsto (fun x => √(f x)) l (𝓝 √x)

full_name: ContinuousWithinAt.sqrt
code: nonrec theorem ContinuousWithinAt.sqrt (h : ContinuousWithinAt f s x) :
    ContinuousWithinAt (fun x => √(f x)) s x 
goal: ContinuousWithinAt (fun x => √(f x)) s x

full_name: ContinuousAt.sqrt
code: @[fun_prop]
nonrec theorem ContinuousAt.sqrt (h : ContinuousAt f x) : ContinuousAt (fun x => √(f x)) x 
goal: ContinuousAt (fun x => √(f x)) x

full_name: ContinuousOn.sqrt
code: @[fun_prop]
theorem ContinuousOn.sqrt (h : ContinuousOn f s) : ContinuousOn (fun x => √(f x)) s 
goal: ContinuousOn (fun x => √(f x)) s

full_name: Continuous.sqrt
code: @[continuity, fun_prop]
theorem Continuous.sqrt (h : Continuous f) : Continuous fun x => √(f x) 
goal: Continuous fun x => √(f x)

full_name: NNReal.sum_mul_le_sqrt_mul_sqrt
code: /-- **Cauchy-Schwarz inequality** for finsets using square roots in `ℝ≥0`. -/
lemma sum_mul_le_sqrt_mul_sqrt (s : Finset ι) (f g : ι → ℝ≥0) :
    ∑ i ∈ s, f i * g i ≤ sqrt (∑ i ∈ s, f i ^ 2) * sqrt (∑ i ∈ s, g i ^ 2) 
goal: ∑ i ∈ s, f i * g i ≤ NNReal.sqrt (∑ i ∈ s, f i ^ 2) * NNReal.sqrt (∑ i ∈ s, g i ^ 2)

full_name: NNReal.sum_sqrt_mul_sqrt_le
code: /-- **Cauchy-Schwarz inequality** for finsets using square roots in `ℝ≥0`. -/
lemma sum_sqrt_mul_sqrt_le (s : Finset ι) (f g : ι → ℝ≥0) :
    ∑ i ∈ s, sqrt (f i) * sqrt (g i) ≤ sqrt (∑ i ∈ s, f i) * sqrt (∑ i ∈ s, g i) 
goal: ∑ i ∈ s, NNReal.sqrt (f i) * NNReal.sqrt (g i) ≤ NNReal.sqrt (∑ i ∈ s, f i) * NNReal.sqrt (∑ i ∈ s, g i)

full_name: Real.sum_mul_le_sqrt_mul_sqrt
code: /-- **Cauchy-Schwarz inequality** for finsets using square roots in `ℝ`. -/
lemma sum_mul_le_sqrt_mul_sqrt (s : Finset ι) (f g : ι → ℝ) :
    ∑ i ∈ s, f i * g i ≤ √(∑ i ∈ s, f i ^ 2) * √(∑ i ∈ s, g i ^ 2) 
goal: ∑ i ∈ s, f i * g i ≤ √(∑ i ∈ s, f i ^ 2) * √(∑ i ∈ s, g i ^ 2)

full_name: Real.sum_sqrt_mul_sqrt_le
code: /-- **Cauchy-Schwarz inequality** for finsets using square roots in `ℝ`. -/
lemma sum_sqrt_mul_sqrt_le (s : Finset ι) (hf : ∀ i, 0 ≤ f i) (hg : ∀ i, 0 ≤ g i) :
    ∑ i ∈ s, √(f i) * √(g i) ≤ √(∑ i ∈ s, f i) * √(∑ i ∈ s, g i) 
goal: ∑ i ∈ s, √(f i) * √(g i) ≤ √(∑ i ∈ s, f i) * √(∑ i ∈ s, g i)