@@ -45,6 +45,12 @@ order_iso.symm $ strict_mono.order_iso_of_surjective (λ x, x * x)
45
45
(continuous_id.mul continuous_id).surjective tendsto_mul_self_at_top $
46
46
by simp [order_bot.at_bot_eq]
47
47
48
+ lemma sqrt_le_sqrt_iff : sqrt x ≤ sqrt y ↔ x ≤ y :=
49
+ sqrt.le_iff_le
50
+
51
+ lemma sqrt_lt_sqrt_iff : sqrt x < sqrt y ↔ x < y :=
52
+ sqrt.lt_iff_lt
53
+
48
54
lemma sqrt_eq_iff_sq_eq : sqrt x = y ↔ y * y = x :=
49
55
sqrt.to_equiv.apply_eq_iff_eq_symm_apply.trans eq_comm
50
56
@@ -61,13 +67,19 @@ sqrt_eq_iff_sq_eq.trans $ by rw [eq_comm, zero_mul]
61
67
62
68
@[simp] lemma sqrt_one : sqrt 1 = 1 := sqrt_eq_iff_sq_eq.2 $ mul_one 1
63
69
64
- @[simp] lemma mul_sqrt_self (x : ℝ≥0 ) : sqrt x * sqrt x = x :=
70
+ @[simp] lemma mul_self_sqrt (x : ℝ≥0 ) : sqrt x * sqrt x = x :=
65
71
sqrt.symm_apply_apply x
66
72
67
73
@[simp] lemma sqrt_mul_self (x : ℝ≥0 ) : sqrt (x * x) = x := sqrt.apply_symm_apply x
68
74
75
+ @[simp] lemma sq_sqrt (x : ℝ≥0 ) : (sqrt x)^2 = x :=
76
+ by rw [sq, mul_self_sqrt x]
77
+
78
+ @[simp] lemma sqrt_sq (x : ℝ≥0 ) : sqrt (x^2 ) = x :=
79
+ by rw [sq, sqrt_mul_self x]
80
+
69
81
lemma sqrt_mul (x y : ℝ≥0 ) : sqrt (x * y) = sqrt x * sqrt y :=
70
- by rw [sqrt_eq_iff_sq_eq, mul_mul_mul_comm, mul_sqrt_self, mul_sqrt_self ]
82
+ by rw [sqrt_eq_iff_sq_eq, mul_mul_mul_comm, mul_self_sqrt, mul_self_sqrt ]
71
83
72
84
/-- `nnreal.sqrt` as a `monoid_with_zero_hom`. -/
73
85
noncomputable def sqrt_hom : monoid_with_zero_hom ℝ≥0 ℝ≥0 := ⟨sqrt, sqrt_zero, sqrt_one, sqrt_mul⟩
@@ -122,6 +134,9 @@ nnreal.sqrt (real.to_nnreal x)
122
134
123
135
variables {x y : ℝ}
124
136
137
+ @[simp, norm_cast] lemma coe_sqrt {x : ℝ≥0 } : (nnreal.sqrt x : ℝ) = real.sqrt x :=
138
+ by rw [real.sqrt, real.to_nnreal_coe]
139
+
125
140
@[continuity]
126
141
lemma continuous_sqrt : continuous sqrt :=
127
142
nnreal.continuous_coe.comp $ nnreal.sqrt.continuous.comp nnreal.continuous_of_real
@@ -132,7 +147,7 @@ by simp [sqrt, real.to_nnreal_eq_zero.2 h]
132
147
theorem sqrt_nonneg (x : ℝ) : 0 ≤ sqrt x := nnreal.coe_nonneg _
133
148
134
149
@[simp] theorem mul_self_sqrt (h : 0 ≤ x) : sqrt x * sqrt x = x :=
135
- by simp [sqrt, ← nnreal.coe_mul, real.coe_to_nnreal _ h]
150
+ by rw [sqrt, ← nnreal.coe_mul, nnreal.mul_self_sqrt , real.coe_to_nnreal _ h]
136
151
137
152
@[simp] theorem sqrt_mul_self (h : 0 ≤ x) : sqrt (x * x) = x :=
138
153
(mul_self_inj_of_nonneg (sqrt_nonneg _) h).1 (mul_self_sqrt (mul_self_nonneg _))
@@ -141,7 +156,7 @@ theorem sqrt_eq_iff_mul_self_eq (hx : 0 ≤ x) (hy : 0 ≤ y) :
141
156
sqrt x = y ↔ y * y = x :=
142
157
⟨λ h, by rw [← h, mul_self_sqrt hx], λ h, by rw [← h, sqrt_mul_self hy]⟩
143
158
144
- @[simp] theorem sq_sqrt (h : 0 ≤ x) : sqrt x ^ 2 = x :=
159
+ @[simp] theorem sq_sqrt (h : 0 ≤ x) : ( sqrt x)^ 2 = x :=
145
160
by rw [sq, mul_self_sqrt h]
146
161
147
162
@[simp] theorem sqrt_sq (h : 0 ≤ x) : sqrt (x ^ 2 ) = x :=
@@ -161,14 +176,20 @@ by rw [sq, sqrt_mul_self_eq_abs]
161
176
162
177
@[simp] theorem sqrt_one : sqrt 1 = 1 := by simp [sqrt]
163
178
164
- @[simp] theorem sqrt_le (hy : 0 ≤ y) : sqrt x ≤ sqrt y ↔ x ≤ y :=
165
- by simp [sqrt, real.to_nnreal_le_to_nnreal_iff, *]
179
+ @[simp] theorem sqrt_le_sqrt_iff (hy : 0 ≤ y) : sqrt x ≤ sqrt y ↔ x ≤ y :=
180
+ by rw [sqrt, sqrt, nnreal.coe_le_coe, nnreal.sqrt_le_sqrt_iff, real.to_nnreal_le_to_nnreal_iff hy]
181
+
182
+ @[simp] theorem sqrt_lt_sqrt_iff (hx : 0 ≤ x) : sqrt x < sqrt y ↔ x < y :=
183
+ lt_iff_lt_of_le_iff_le (sqrt_le_sqrt_iff hx)
166
184
167
- @[simp] theorem sqrt_lt (hx : 0 ≤ x ) : sqrt x < sqrt y ↔ x < y :=
168
- lt_iff_lt_of_le_iff_le (sqrt_le hx)
185
+ theorem sqrt_lt_sqrt_iff_of_pos (hy : 0 < y ) : sqrt x < sqrt y ↔ x < y :=
186
+ by rw [sqrt, sqrt, nnreal.coe_lt_coe, nnreal.sqrt_lt_sqrt_iff, to_nnreal_lt_to_nnreal_iff hy]
169
187
170
188
theorem sqrt_le_sqrt (h : x ≤ y) : sqrt x ≤ sqrt y :=
171
- by simp [sqrt, real.to_nnreal_le_to_nnreal h]
189
+ by { rw [sqrt, sqrt, nnreal.coe_le_coe, nnreal.sqrt_le_sqrt_iff], exact to_nnreal_le_to_nnreal h }
190
+
191
+ theorem sqrt_lt_sqrt (hx : 0 ≤ x) (h : x < y) : sqrt x < sqrt y :=
192
+ (sqrt_lt_sqrt_iff hx).2 h
172
193
173
194
theorem sqrt_le_left (hy : 0 ≤ y) : sqrt x ≤ y ↔ x ≤ y ^ 2 :=
174
195
by rw [sqrt, ← real.le_to_nnreal_iff_coe_le hy, nnreal.sqrt_le_iff, ← real.to_nnreal_mul hy,
@@ -250,7 +271,7 @@ by rw [mul_self_lt_mul_self_iff hx (sqrt_nonneg y), sq, mul_self_sqrt hy]
250
271
theorem sq_lt : x^2 < y ↔ -sqrt y < x ∧ x < sqrt y :=
251
272
begin
252
273
split,
253
- { simpa only [← sqrt_lt (sq_nonneg x), sqrt_sq_eq_abs] using abs_lt.mp },
274
+ { simpa only [← sqrt_lt_sqrt_iff (sq_nonneg x), sqrt_sq_eq_abs] using abs_lt.mp },
254
275
{ rw [← abs_lt, ← sq_abs],
255
276
exact λ h, (lt_sqrt (abs_nonneg x) (sqrt_pos.mp (lt_of_le_of_lt (abs_nonneg x) h)).le).mp h },
256
277
end
0 commit comments