Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions Mathlib/Data/Real/Sqrt.lean
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,24 @@ variable {x y : ℝ}
theorem coe_sqrt {x : ℝ≥0} : (NNReal.sqrt x : ℝ) = √(x : ℝ) := by
rw [Real.sqrt, Real.toNNReal_coe]

@[continuity]
theorem continuous_sqrt : Continuous (√· : ℝ → ℝ) := by
@[continuity, fun_prop]
theorem continuous_sqrt : Continuous (√· : ℝ → ℝ) := by unfold sqrt; fun_prop

@[simp]
lemma map_sqrt_atTop : map (√·) atTop = atTop := by
unfold sqrt
exact NNReal.continuous_coe.comp <| NNReal.continuous_sqrt.comp continuous_real_toNNReal
change map (NNReal.toReal ∘ NNReal.sqrt ∘ Real.toNNReal) atTop = atTop
simp [← map_map]

@[simp]
lemma comap_sqrt_atTop : comap (√·) atTop = atTop := by
unfold sqrt
change comap (NNReal.toReal ∘ NNReal.sqrt ∘ Real.toNNReal) atTop = atTop
simp [← comap_comap]

lemma tendsto_sqrt_atTop : Tendsto (√·) atTop atTop := map_sqrt_atTop.le

theorem sqrt_eq_zero_of_nonpos (h : x ≤ 0) : sqrt x = 0 := by simp [sqrt, Real.toNNReal_eq_zero.2 h]
theorem sqrt_eq_zero_of_nonpos (h : x ≤ 0) : x = 0 := by simp [sqrt, Real.toNNReal_eq_zero.2 h]

@[simp] theorem sqrt_nonneg (x : ℝ) : 0 ≤ √x := by
unfold sqrt
Expand Down