@@ -235,6 +235,209 @@ end
235
235
lemma arg_of_real_of_neg {x : ℝ} (hx : x < 0 ) : arg x = π :=
236
236
arg_eq_pi_iff.2 ⟨hx, rfl⟩
237
237
238
+ lemma arg_of_re_nonneg {x : ℂ} (hx : 0 ≤ x.re) : arg x = real.arcsin (x.im / x.abs) :=
239
+ if_pos hx
240
+
241
+ lemma arg_of_re_zero_of_im_pos {x : ℂ} (h_re : x.re = 0 ) (h_im : 0 < x.im) :
242
+ arg x = π / 2 :=
243
+ begin
244
+ rw arg_of_re_nonneg h_re.symm.le,
245
+ have h_im_eq_abs : x.im = abs x,
246
+ { refine le_antisymm (im_le_abs x) _,
247
+ refine (abs_le_abs_re_add_abs_im x).trans (le_of_eq _),
248
+ rw [h_re, _root_.abs_zero, zero_add, _root_.abs_eq_self],
249
+ exact h_im.le, },
250
+ rw [h_im_eq_abs, div_self],
251
+ { exact real.arcsin_one, },
252
+ { rw [ne.def, complex.abs_eq_zero], intro hx, rw hx at h_im, simpa using h_im, },
253
+ end
254
+
255
+ lemma arg_of_re_zero_of_im_neg {x : ℂ} (h_re : x.re = 0 ) (h_im : x.im < 0 ) :
256
+ arg x = - π / 2 :=
257
+ begin
258
+ rw arg_of_re_nonneg h_re.symm.le,
259
+ have h_im_eq_abs : x.im = - abs x,
260
+ { rw eq_neg_iff_eq_neg,
261
+ have : - x.im = |x.im|,
262
+ { symmetry, rw _root_.abs_eq_neg_self.mpr h_im.le, },
263
+ rw this ,
264
+ refine le_antisymm ((abs_le_abs_re_add_abs_im x).trans (le_of_eq _)) (abs_im_le_abs x),
265
+ rw [h_re, _root_.abs_zero, zero_add], },
266
+ rw [h_im_eq_abs, neg_div, div_self, neg_div],
267
+ { exact real.arcsin_neg_one, },
268
+ { rw [ne.def, complex.abs_eq_zero], intro hx, rw hx at h_im, simpa using h_im, },
269
+ end
270
+
271
+ lemma arg_of_re_neg_of_im_nonneg {x : ℂ} (hx_re : x.re < 0 ) (hx_im : 0 ≤ x.im) :
272
+ arg x = real.arcsin ((-x).im / x.abs) + π :=
273
+ by simp only [arg, hx_re.not_le, hx_im, if_true, if_false]
274
+
275
+ lemma arg_of_re_neg_of_im_neg {x : ℂ} (hx_re : x.re < 0 ) (hx_im : x.im < 0 ) :
276
+ arg x = real.arcsin ((-x).im / x.abs) - π :=
277
+ by simp only [arg, hx_re.not_le, hx_im.not_le, if_false]
278
+
279
+ section continuity
280
+
281
+ variables {x z : ℂ}
282
+
283
+ lemma arg_eq_nhds_of_re_pos (hx : 0 < x.re) : arg =ᶠ[𝓝 x] λ x, real.arcsin (x.im / x.abs) :=
284
+ begin
285
+ suffices h_forall_nhds : ∀ᶠ (y : ℂ) in (𝓝 x), 0 < y.re,
286
+ from h_forall_nhds.mono (λ y hy, arg_of_re_nonneg hy.le),
287
+ exact is_open.eventually_mem (is_open_lt continuous_zero continuous_re) hx,
288
+ end
289
+
290
+ lemma arg_eq_nhds_of_re_neg_of_im_pos (hx_re : x.re < 0 ) (hx_im : 0 < x.im) :
291
+ arg =ᶠ[𝓝 x] λ x, real.arcsin ((-x).im / x.abs) + π :=
292
+ begin
293
+ suffices h_forall_nhds : ∀ᶠ (y : ℂ) in (𝓝 x), y.re < 0 ∧ 0 < y.im,
294
+ from h_forall_nhds.mono (λ y hy, arg_of_re_neg_of_im_nonneg hy.1 hy.2 .le),
295
+ refine is_open.eventually_mem _ (⟨hx_re, hx_im⟩ : x.re < 0 ∧ 0 < x.im),
296
+ exact is_open.and (is_open_lt continuous_re continuous_zero)
297
+ (is_open_lt continuous_zero continuous_im),
298
+ end
299
+
300
+ lemma arg_eq_nhds_of_re_neg_of_im_neg (hx_re : x.re < 0 ) (hx_im : x.im < 0 ) :
301
+ arg =ᶠ[𝓝 x] λ x, real.arcsin ((-x).im / x.abs) - π :=
302
+ begin
303
+ suffices h_forall_nhds : ∀ᶠ (y : ℂ) in (𝓝 x), y.re < 0 ∧ y.im < 0 ,
304
+ from h_forall_nhds.mono (λ y hy, arg_of_re_neg_of_im_neg hy.1 hy.2 ),
305
+ refine is_open.eventually_mem _ (⟨hx_re, hx_im⟩ : x.re < 0 ∧ x.im < 0 ),
306
+ exact is_open.and (is_open_lt continuous_re continuous_zero)
307
+ (is_open_lt continuous_im continuous_zero),
308
+ end
309
+
310
+ /-- Auxiliary lemma for `continuous_at_arg`. -/
311
+ lemma continuous_at_arg_of_re_pos (h : 0 < x.re) : continuous_at arg x :=
312
+ begin
313
+ rw continuous_at_congr (arg_eq_nhds_of_re_pos h),
314
+ refine real.continuous_arcsin.continuous_at.comp _,
315
+ refine continuous_at.div continuous_im.continuous_at complex.continuous_abs.continuous_at _,
316
+ rw abs_ne_zero,
317
+ intro hx,
318
+ rw hx at h,
319
+ simpa using h,
320
+ end
321
+
322
+ /-- Auxiliary lemma for `continuous_at_arg`. -/
323
+ lemma continuous_at_arg_of_re_neg_of_im_pos (h_re : x.re < 0 ) (h_im : 0 < x.im) :
324
+ continuous_at arg x :=
325
+ begin
326
+ rw continuous_at_congr (arg_eq_nhds_of_re_neg_of_im_pos h_re h_im),
327
+ refine continuous_at.add (real.continuous_arcsin.continuous_at.comp _) continuous_at_const,
328
+ refine continuous_at.div (continuous.continuous_at _) complex.continuous_abs.continuous_at _,
329
+ { continuity, },
330
+ { rw abs_ne_zero, intro hx, rw hx at h_re, simpa using h_re, },
331
+ end
332
+
333
+ /-- Auxiliary lemma for `continuous_at_arg`. -/
334
+ lemma continuous_at_arg_of_re_neg_of_im_neg (h_re : x.re < 0 ) (h_im : x.im < 0 ) :
335
+ continuous_at arg x :=
336
+ begin
337
+ rw continuous_at_congr (arg_eq_nhds_of_re_neg_of_im_neg h_re h_im),
338
+ refine continuous_at.add (real.continuous_arcsin.continuous_at.comp _) continuous_at_const,
339
+ refine continuous_at.div (continuous.continuous_at _) complex.continuous_abs.continuous_at _,
340
+ { continuity, },
341
+ { rw abs_ne_zero, intro hx, rw hx at h_re, simpa using h_re, },
342
+ end
343
+
344
+ private lemma continuous_at_arcsin_im_div_abs (h : x ≠ 0 ) :
345
+ continuous_at (λ y : ℂ, real.arcsin (y.im / abs y)) x :=
346
+ begin
347
+ refine real.continuous_arcsin.continuous_at.comp _,
348
+ refine continuous_at.div (continuous.continuous_at _) complex.continuous_abs.continuous_at _,
349
+ { continuity, },
350
+ { rw abs_ne_zero, exact λ hx, h hx, },
351
+ end
352
+
353
+ private lemma continuous_at_arcsin_im_neg_div_abs_add (h : x ≠ 0 ) {r : ℝ} :
354
+ continuous_at (λ y : ℂ, real.arcsin ((-y).im / abs y) + r) x :=
355
+ begin
356
+ refine continuous_at.add _ continuous_at_const,
357
+ have : (λ (y : ℂ), real.arcsin ((-y).im / abs y)) =
358
+ (λ (y : ℂ), real.arcsin (y.im / abs y)) ∘ (λ y, - y),
359
+ by { ext1 y, simp, },
360
+ rw this ,
361
+ exact continuous_at.comp (continuous_at_arcsin_im_div_abs (neg_ne_zero.mpr h)) continuous_at_neg,
362
+ end
363
+
364
+ /-- Auxiliary lemma for `continuous_at_arg`. -/
365
+ lemma continuous_at_arg_of_re_zero (h_re : x.re = 0 ) (h_im : x.im ≠ 0 ) : continuous_at arg x :=
366
+ begin
367
+ have hx_ne_zero : x ≠ 0 , by { intro hx, rw hx at h_im, simpa using h_im, },
368
+ have hx_abs : 0 < |x.im|, by rwa _root_.abs_pos,
369
+ have h_cont_1 : continuous_at (λ y : ℂ, real.arcsin (y.im / abs y)) x,
370
+ from continuous_at_arcsin_im_div_abs hx_ne_zero,
371
+ have h_cont_2 : continuous_at (λ y : ℂ, real.arcsin ((-y).im / abs y) + real.pi) x,
372
+ from continuous_at_arcsin_im_neg_div_abs_add hx_ne_zero,
373
+ have h_cont_3 : continuous_at (λ y : ℂ, real.arcsin ((-y).im / abs y) - real.pi) x,
374
+ by { simp_rw sub_eq_add_neg, exact continuous_at_arcsin_im_neg_div_abs_add hx_ne_zero, },
375
+ have h_val1_x_pos : 0 < x.im → real.arcsin (x.im / abs x) = π / 2 ,
376
+ by { rw ← arg_of_re_nonneg h_re.symm.le, exact arg_of_re_zero_of_im_pos h_re, },
377
+ have h_val1_x_neg : x.im < 0 → real.arcsin (x.im / abs x) = - π / 2 ,
378
+ by { rw ← arg_of_re_nonneg h_re.symm.le, exact arg_of_re_zero_of_im_neg h_re, },
379
+ have h_val2_x : 0 < x.im → real.arcsin ((-x).im / abs x) + π = π / 2 ,
380
+ { intro h_im_pos,
381
+ rw [complex.neg_im, neg_div, real.arcsin_neg, ← arg_of_re_nonneg h_re.symm.le,
382
+ arg_of_re_zero_of_im_pos h_re h_im_pos],
383
+ ring, },
384
+ have h_val3_x : x.im < 0 → real.arcsin ((-x).im / abs x) - π = - π / 2 ,
385
+ { intro h_im_neg,
386
+ rw [complex.neg_im, neg_div, real.arcsin_neg, ← arg_of_re_nonneg h_re.symm.le,
387
+ arg_of_re_zero_of_im_neg h_re h_im_neg],
388
+ ring, },
389
+ rw metric.continuous_at_iff at ⊢ h_cont_1 h_cont_2 h_cont_3,
390
+ intros ε hε_pos,
391
+ rcases h_cont_1 ε hε_pos with ⟨δ₁, hδ₁, h1_x⟩,
392
+ rcases h_cont_2 ε hε_pos with ⟨δ₂, hδ₂, h2_x⟩,
393
+ rcases h_cont_3 ε hε_pos with ⟨δ₃, hδ₃, h3_x⟩,
394
+ refine ⟨min (min δ₁ δ₂) (min δ₃ (|x.im|)), lt_min (lt_min hδ₁ hδ₂) (lt_min hδ₃ hx_abs),
395
+ λ y hy, _⟩,
396
+ specialize h1_x (hy.trans_le ((min_le_left _ _).trans (min_le_left _ _))),
397
+ specialize h2_x (hy.trans_le ((min_le_left _ _).trans (min_le_right _ _))),
398
+ specialize h3_x (hy.trans_le ((min_le_right _ _).trans (min_le_left _ _))),
399
+ have hy_lt_abs : abs (y - x) < |x.im|,
400
+ { refine (le_of_eq _).trans_lt (hy.trans_le ((min_le_right _ _).trans (min_le_right _ _))),
401
+ rw dist_eq, },
402
+ rw arg_of_re_nonneg h_re.symm.le,
403
+ by_cases hy_re : 0 ≤ y.re,
404
+ { rwa arg_of_re_nonneg hy_re, },
405
+ push_neg at hy_re,
406
+ rw ne_iff_lt_or_gt at h_im,
407
+ cases h_im,
408
+ { have hy_im : y.im < 0 ,
409
+ calc y.im = x.im + (y - x).im : by simp
410
+ ... ≤ x.im + abs (y - x) : add_le_add_left (im_le_abs _) _
411
+ ... < x.im + |x.im| : add_lt_add_left hy_lt_abs _
412
+ ... = x.im - x.im : by { rw [abs_eq_neg_self.mpr, ← sub_eq_add_neg], exact h_im.le, }
413
+ ... = 0 : sub_self x.im,
414
+ rw [arg_of_re_neg_of_im_neg hy_re hy_im, h_val1_x_neg h_im],
415
+ rwa h_val3_x h_im at h3_x, },
416
+ { have hy_im : 0 < y.im,
417
+ calc 0 = x.im - x.im : (sub_self x.im).symm
418
+ ... = x.im - |x.im| : by { rw [abs_eq_self.mpr], exact h_im.lt.le, }
419
+ ... < x.im - abs (y - x) : sub_lt_sub_left hy_lt_abs _
420
+ ... = x.im - abs (x - y) : by rw complex.abs_sub_comm _ _
421
+ ... ≤ x.im - (x - y).im : sub_le_sub_left (im_le_abs _) _
422
+ ... = y.im : by simp,
423
+ rw [arg_of_re_neg_of_im_nonneg hy_re hy_im.le, h_val1_x_pos h_im],
424
+ rwa h_val2_x h_im at h2_x, },
425
+ end
426
+
427
+ lemma continuous_at_arg (h : 0 < x.re ∨ x.im ≠ 0 ) : continuous_at arg x :=
428
+ begin
429
+ by_cases h_re : 0 < x.re,
430
+ { exact continuous_at_arg_of_re_pos h_re, },
431
+ have h_im : x.im ≠ 0 , by simpa [h_re] using h,
432
+ rw not_lt_iff_eq_or_lt at h_re,
433
+ cases h_re,
434
+ { exact continuous_at_arg_of_re_zero h_re.symm h_im, },
435
+ { rw ne_iff_lt_or_gt at h_im,
436
+ cases h_im,
437
+ { exact continuous_at_arg_of_re_neg_of_im_neg h_re h_im, },
438
+ { exact continuous_at_arg_of_re_neg_of_im_pos h_re h_im, }, },
439
+ end
440
+
238
441
lemma tendsto_arg_nhds_within_im_neg_of_re_neg_of_im_zero
239
442
{z : ℂ} (hre : z.re < 0 ) (him : z.im = 0 ) :
240
443
tendsto arg (𝓝[{z : ℂ | z.im < 0 }] z) (𝓝 (-π)) :=
@@ -276,4 +479,6 @@ lemma tendsto_arg_nhds_within_im_nonneg_of_re_neg_of_im_zero
276
479
by simpa only [arg_eq_pi_iff.2 ⟨hre, him⟩]
277
480
using (continuous_within_at_arg_of_re_neg_of_im_zero hre him).tendsto
278
481
482
+ end continuity
483
+
279
484
end complex
0 commit comments