Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 198fb09

Browse files
sgouezelmergify[bot]
authored andcommitted
feat(analysis/complex/exponential): derivatives (#1695)
* feat(analysis/complex/exponential): derivatives * nhds * nhds * remove omega * remove set_option * simp attributes, field type * restrict scalar * staging * complete proof * staging * cleanup * staging * cleanup * docstring * docstring * reviewer's comments * real derivatives of exp, sin, cos, sinh, cosh * fix build * remove priority * better proofs
1 parent 01b1576 commit 198fb09

File tree

6 files changed

+286
-107
lines changed

6 files changed

+286
-107
lines changed

src/analysis/asymptotics.lean

Lines changed: 62 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,22 @@ open_locale topological_space
4242

4343
namespace asymptotics
4444

45-
variables {α : Type*} {β : Type*} {γ : Type*} {δ : Type*}
45+
variables {α : Type*} {β : Type*} {γ : Type*} {δ : Type*} {𝕜 : Type*} {𝕜' : Type*}
4646

4747
section
4848
variables [has_norm β] [has_norm γ] [has_norm δ]
4949

50+
/-- The Landau notation `is_O f g l` where `f` and `g` are two functions on a type `α` and `l` is
51+
a filter on `α`, means that eventually for `l`, `∥f∥` is bounded by a constant multiple of `∥g∥`.
52+
In other words, `∥f∥ / ∥g∥` is eventually bounded, modulo division by zero issues that are avoided
53+
by this definition. -/
5054
def is_O (f : α → β) (g : α → γ) (l : filter α) : Prop :=
5155
∃ c > 0, { x | ∥ f x ∥ ≤ c * ∥ g x ∥ } ∈ l
5256

57+
/-- The Landau notation `is_o f g l` where `f` and `g` are two functions on a type `α` and `l` is
58+
a filter on `α`, means that eventually for `l`, `∥f∥` is bounded by an arbitrarily small constant
59+
multiple of `∥g∥`. In other words, `∥f∥ / ∥g∥` tends to `0` along `l`, modulo division by zero
60+
issues that are avoided by this definition. -/
5361
def is_o (f : α → β) (g : α → γ) (l : filter α) : Prop :=
5462
∀ c > 0, { x | ∥ f x ∥ ≤ c * ∥ g x ∥ } ∈ l
5563

@@ -450,12 +458,12 @@ end
450458
end
451459

452460
section
453-
variables [has_norm β] [normed_field γ]
461+
variables [has_norm β] [normed_field 𝕜]
454462

455463
open normed_field
456464

457465
theorem is_O_const_one (c : β) (l : filter α) :
458-
is_O (λ x : α, c) (λ x, (1 : γ)) l :=
466+
is_O (λ x : α, c) (λ x, (1 : 𝕜)) l :=
459467
begin
460468
rw is_O_iff,
461469
refine ⟨∥c∥, _⟩,
@@ -467,9 +475,9 @@ end
467475
end
468476

469477
section
470-
variables [normed_field β] [normed_group γ]
478+
variables [normed_field 𝕜] [normed_group γ]
471479

472-
theorem is_O_const_mul_left {f : α → β} {g : α → γ} {l : filter α} (h : is_O f g l) (c : β) :
480+
theorem is_O_const_mul_left {f : α → 𝕜} {g : α → γ} {l : filter α} (h : is_O f g l) (c : 𝕜) :
473481
is_O (λ x, c * f x) g l :=
474482
begin
475483
cases classical.em (c = 0) with h'' h'',
@@ -484,7 +492,7 @@ theorem is_O_const_mul_left {f : α → β} {g : α → γ} {l : filter α} (h :
484492
exact mul_le_mul_of_nonneg_left h₀ (norm_nonneg _)
485493
end
486494

487-
theorem is_O_const_mul_left_iff {f : α → β} {g : α → γ} {l : filter α} {c : β} (hc : c ≠ 0) :
495+
theorem is_O_const_mul_left_iff {f : α → 𝕜} {g : α → γ} {l : filter α} {c : 𝕜} (hc : c ≠ 0) :
488496
is_O (λ x, c * f x) g l ↔ is_O f g l :=
489497
begin
490498
split,
@@ -494,8 +502,7 @@ begin
494502
intro h, apply is_O_const_mul_left h
495503
end
496504

497-
theorem is_o_const_mul_left {f : α → β} {g : α → γ} {l : filter α}
498-
(h : is_o f g l) (c : β) :
505+
theorem is_o_const_mul_left {f : α → 𝕜} {g : α → γ} {l : filter α} (h : is_o f g l) (c : 𝕜) :
499506
is_o (λ x, c * f x) g l :=
500507
begin
501508
cases classical.em (c = 0) with h'' h'',
@@ -509,7 +516,7 @@ begin
509516
rw [←mul_assoc, mul_div_cancel' _ cne0]
510517
end
511518

512-
theorem is_o_const_mul_left_iff {f : α → β} {g : α → γ} {l : filter α} {c : β} (hc : c ≠ 0) :
519+
theorem is_o_const_mul_left_iff {f : α → 𝕜} {g : α → γ} {l : filter α} {c : 𝕜} (hc : c ≠ 0) :
513520
is_o (λ x, c * f x) g l ↔ is_o f g l :=
514521
begin
515522
split,
@@ -523,9 +530,9 @@ end
523530
end
524531

525532
section
526-
variables [normed_group β] [normed_field γ]
533+
variables [normed_group β] [normed_field 𝕜]
527534

528-
theorem is_O_of_is_O_const_mul_right {f : α → β} {g : α → γ} {l : filter α} {c : γ}
535+
theorem is_O_of_is_O_const_mul_right {f : α → β} {g : α → 𝕜} {l : filter α} {c : 𝕜}
529536
(h : is_O f (λ x, c * g x) l) :
530537
is_O f g l :=
531538
begin
@@ -539,7 +546,7 @@ begin
539546
rw [normed_field.norm_mul, mul_assoc]
540547
end
541548

542-
theorem is_O_const_mul_right_iff {f : α → β} {g : α → γ} {l : filter α} {c : γ} (hc : c ≠ 0) :
549+
theorem is_O_const_mul_right_iff {f : α → β} {g : α → 𝕜} {l : filter α} {c : 𝕜} (hc : c ≠ 0) :
543550
is_O f (λ x, c * g x) l ↔ is_O f g l :=
544551
begin
545552
split,
@@ -550,7 +557,7 @@ begin
550557
convert h, ext, rw [←mul_assoc, inv_mul_cancel hc, one_mul]
551558
end
552559

553-
theorem is_o_of_is_o_const_mul_right {f : α → β} {g : α → γ} {l : filter α} {c : γ}
560+
theorem is_o_of_is_o_const_mul_right {f : α → β} {g : α → 𝕜} {l : filter α} {c : 𝕜}
554561
(h : is_o f (λ x, c * g x) l) :
555562
is_o f g l :=
556563
begin
@@ -563,7 +570,7 @@ begin
563570
ext x, rw [normed_field.norm_mul, ←mul_assoc, div_mul_cancel _ cne0]
564571
end
565572

566-
theorem is_o_const_mul_right {f : α → β} {g : α → γ} {l : filter α} {c : γ} (hc : c ≠ 0) :
573+
theorem is_o_const_mul_right {f : α → β} {g : α → 𝕜} {l : filter α} {c : 𝕜} (hc : c ≠ 0) :
567574
is_o f (λ x, c * g x) l ↔ is_o f g l :=
568575
begin
569576
split,
@@ -575,7 +582,7 @@ begin
575582
end
576583

577584
theorem is_o_one_iff {f : α → β} {l : filter α} :
578-
is_o f (λ x, (1 : γ)) l ↔ tendsto f l (𝓝 0) :=
585+
is_o f (λ x, (1 : 𝕜)) l ↔ tendsto f l (𝓝 0) :=
579586
begin
580587
rw [normed_group.tendsto_nhds_zero, is_o], split,
581588
{ intros h e epos,
@@ -589,7 +596,7 @@ begin
589596
end
590597

591598
theorem is_O_one_of_tendsto {f : α → β} {l : filter α} {y : β}
592-
(h : tendsto f l (𝓝 y)) : is_O f (λ x, (1 : γ)) l :=
599+
(h : tendsto f l (𝓝 y)) : is_O f (λ x, (1 : 𝕜)) l :=
593600
begin
594601
have Iy : ∥y∥ < ∥y∥ + 1 := lt_add_one _,
595602
refine ⟨∥y∥ + 1, lt_of_le_of_lt (norm_nonneg _) Iy, _⟩,
@@ -616,9 +623,9 @@ h₁.to_is_O.trans_tendsto
616623
end
617624

618625
section
619-
variables [normed_field β] [normed_field γ]
626+
variables [normed_field 𝕜] [normed_field 𝕜']
620627

621-
theorem is_O_mul {f₁ f₂ : α → β} {g₁ g₂ : α → γ} {l : filter α}
628+
theorem is_O_mul {f₁ f₂ : α → 𝕜} {g₁ g₂ : α → 𝕜'} {l : filter α}
622629
(h₁ : is_O f₁ g₁ l) (h₂ : is_O f₂ g₂ l) :
623630
is_O (λ x, f₁ x * f₂ x) (λ x, g₁ x * g₂ x) l :=
624631
begin
@@ -631,7 +638,7 @@ begin
631638
exact mul_le_mul hx₁ hx₂ (norm_nonneg _) (mul_nonneg (le_of_lt c₁pos) (norm_nonneg _))
632639
end
633640

634-
theorem is_o_mul_left {f₁ f₂ : α → β} {g₁ g₂ : α → γ} {l : filter α}
641+
theorem is_o_mul_left {f₁ f₂ : α → 𝕜} {g₁ g₂ : α → 𝕜'} {l : filter α}
635642
(h₁ : is_O f₁ g₁ l) (h₂ : is_o f₂ g₂ l) :
636643
is_o (λ x, f₁ x * f₂ x) (λ x, g₁ x * g₂ x) l :=
637644
begin
@@ -645,12 +652,12 @@ begin
645652
rw [mul_left_comm]
646653
end
647654

648-
theorem is_o_mul_right {f₁ f₂ : α → β} {g₁ g₂ : α → γ} {l : filter α}
655+
theorem is_o_mul_right {f₁ f₂ : α → 𝕜} {g₁ g₂ : α → 𝕜'} {l : filter α}
649656
(h₁ : is_o f₁ g₁ l) (h₂ : is_O f₂ g₂ l) :
650657
is_o (λ x, f₁ x * f₂ x) (λ x, g₁ x * g₂ x) l :=
651658
by convert is_o_mul_left h₂ h₁; simp only [mul_comm]
652659

653-
theorem is_o_mul {f₁ f₂ : α → β} {g₁ g₂ : α → γ} {l : filter α}
660+
theorem is_o_mul {f₁ f₂ : α → 𝕜} {g₁ g₂ : α → 𝕜'} {l : filter α}
654661
(h₁ : is_o f₁ g₁ l) (h₂ : is_o f₂ g₂ l) :
655662
is_o (λ x, f₁ x * f₂ x) (λ x, g₁ x * g₂ x) l :=
656663
is_o_mul_left h₁.to_is_O h₂
@@ -663,11 +670,11 @@ scalar multiplication is multiplication.
663670
-/
664671

665672
section
666-
variables {K : Type*} [normed_field K] [normed_group β] [normed_space K β] [normed_group γ]
673+
variables [normed_field 𝕜] [normed_group β] [normed_space 𝕜 β] [normed_group γ]
667674

668675
set_option class.instance_max_depth 43
669676

670-
theorem is_O_const_smul_left {f : α → β} {g : α → γ} {l : filter α} (h : is_O f g l) (c : K) :
677+
theorem is_O_const_smul_left {f : α → β} {g : α → γ} {l : filter α} (h : is_O f g l) (c : 𝕜) :
671678
is_O (λ x, c • f x) g l :=
672679
begin
673680
rw [←is_O_norm_left], simp only [norm_smul],
@@ -676,15 +683,15 @@ begin
676683
apply h
677684
end
678685

679-
theorem is_O_const_smul_left_iff {f : α → β} {g : α → γ} {l : filter α} {c : K} (hc : c ≠ 0) :
686+
theorem is_O_const_smul_left_iff {f : α → β} {g : α → γ} {l : filter α} {c : 𝕜} (hc : c ≠ 0) :
680687
is_O (λ x, c • f x) g l ↔ is_O f g l :=
681688
begin
682689
have cne0 : ∥c∥ ≠ 0, from mt (norm_eq_zero _).mp hc,
683690
rw [←is_O_norm_left], simp only [norm_smul],
684691
rw [is_O_const_mul_left_iff cne0, is_O_norm_left]
685692
end
686693

687-
theorem is_o_const_smul_left {f : α → β} {g : α → γ} {l : filter α} (h : is_o f g l) (c : K) :
694+
theorem is_o_const_smul_left {f : α → β} {g : α → γ} {l : filter α} (h : is_o f g l) (c : 𝕜) :
688695
is_o (λ x, c • f x) g l :=
689696
begin
690697
rw [←is_o_norm_left], simp only [norm_smul],
@@ -693,7 +700,7 @@ begin
693700
apply h
694701
end
695702

696-
theorem is_o_const_smul_left_iff {f : α → β} {g : α → γ} {l : filter α} {c : K} (hc : c ≠ 0) :
703+
theorem is_o_const_smul_left_iff {f : α → β} {g : α → γ} {l : filter α} {c : 𝕜} (hc : c ≠ 0) :
697704
is_o (λ x, c • f x) g l ↔ is_o f g l :=
698705
begin
699706
have cne0 : ∥c∥ ≠ 0, from mt (norm_eq_zero _).mp hc,
@@ -704,19 +711,19 @@ end
704711
end
705712

706713
section
707-
variables {K : Type*} [normed_group β] [normed_field K] [normed_group γ] [normed_space K γ]
714+
variables [normed_group β] [normed_field 𝕜] [normed_group γ] [normed_space 𝕜 γ]
708715

709716
set_option class.instance_max_depth 43
710717

711-
theorem is_O_const_smul_right {f : α → β} {g : α → γ} {l : filter α} {c : K} (hc : c ≠ 0) :
718+
theorem is_O_const_smul_right {f : α → β} {g : α → γ} {l : filter α} {c : 𝕜} (hc : c ≠ 0) :
712719
is_O f (λ x, c • g x) l ↔ is_O f g l :=
713720
begin
714721
have cne0 : ∥c∥ ≠ 0, from mt (norm_eq_zero _).mp hc,
715722
rw [←is_O_norm_right], simp only [norm_smul],
716723
rw [is_O_const_mul_right_iff cne0, is_O_norm_right]
717724
end
718725

719-
theorem is_o_const_smul_right {f : α → β} {g : α → γ} {l : filter α} {c : K} (hc : c ≠ 0) :
726+
theorem is_o_const_smul_right {f : α → β} {g : α → γ} {l : filter α} {c : 𝕜} (hc : c ≠ 0) :
720727
is_o f (λ x, c • g x) l ↔ is_o f g l :=
721728
begin
722729
have cne0 : ∥c∥ ≠ 0, from mt (norm_eq_zero _).mp hc,
@@ -727,12 +734,12 @@ end
727734
end
728735

729736
section
730-
variables {K : Type*} [normed_field K] [normed_group β] [normed_space K β]
731-
[normed_group γ] [normed_space K γ]
737+
variables [normed_field 𝕜] [normed_group β] [normed_space 𝕜 β]
738+
[normed_group γ] [normed_space 𝕜 γ]
732739

733740
set_option class.instance_max_depth 43
734741

735-
theorem is_O_smul {k : α → K} {f : α → β} {g : α → γ} {l : filter α} (h : is_O f g l) :
742+
theorem is_O_smul {k : α → 𝕜} {f : α → β} {g : α → γ} {l : filter α} (h : is_O f g l) :
736743
is_O (λ x, k x • f x) (λ x, k x • g x) l :=
737744
begin
738745
rw [←is_O_norm_left, ←is_O_norm_right], simp only [norm_smul],
@@ -741,7 +748,7 @@ begin
741748
exact h
742749
end
743750

744-
theorem is_o_smul {k : α → K} {f : α → β} {g : α → γ} {l : filter α} (h : is_o f g l) :
751+
theorem is_o_smul {k : α → 𝕜} {f : α → β} {g : α → γ} {l : filter α} (h : is_o f g l) :
745752
is_o (λ x, k x • f x) (λ x, k x • g x) l :=
746753
begin
747754
rw [←is_o_norm_left, ←is_o_norm_right], simp only [norm_smul],
@@ -753,13 +760,13 @@ end
753760
end
754761

755762
section
756-
variables [normed_field β]
763+
variables [normed_field 𝕜]
757764

758-
theorem tendsto_nhds_zero_of_is_o {f g : α → β} {l : filter α} (h : is_o f g l) :
765+
theorem tendsto_nhds_zero_of_is_o {f g : α → 𝕜} {l : filter α} (h : is_o f g l) :
759766
tendsto (λ x, f x / (g x)) l (𝓝 0) :=
760767
have eq₁ : is_o (λ x, f x / g x) (λ x, g x / g x) l,
761768
from is_o_mul_right h (is_O_refl _ _),
762-
have eq₂ : is_O (λ x, g x / g x) (λ x, (1 : β)) l,
769+
have eq₂ : is_O (λ x, g x / g x) (λ x, (1 : 𝕜)) l,
763770
begin
764771
use [1, zero_lt_one],
765772
filter_upwards [univ_mem_sets], simp,
@@ -769,10 +776,10 @@ have eq₂ : is_O (λ x, g x / g x) (λ x, (1 : β)) l,
769776
end,
770777
is_o_one_iff.mp (eq₁.trans_is_O eq₂)
771778

772-
private theorem is_o_of_tendsto {f g : α → β} {l : filter α}
779+
private theorem is_o_of_tendsto {f g : α → 𝕜} {l : filter α}
773780
(hgf : ∀ x, g x = 0 → f x = 0) (h : tendsto (λ x, f x / (g x)) l (𝓝 0)) :
774781
is_o f g l :=
775-
have eq₁ : is_o (λ x, f x / (g x)) (λ x, (1 : β)) l,
782+
have eq₁ : is_o (λ x, f x / (g x)) (λ x, (1 : 𝕜)) l,
776783
from is_o_one_iff.mpr h,
777784
have eq₂ : is_o (λ x, f x / g x * g x) g l,
778785
by convert is_o_mul_right eq₁ (is_O_refl _ _); simp,
@@ -787,11 +794,27 @@ have eq₃ : is_O f (λ x, f x / g x * g x) l,
787794
end,
788795
eq₃.trans_is_o eq₂
789796

790-
theorem is_o_iff_tendsto {f g : α → β} {l : filter α}
797+
theorem is_o_iff_tendsto {f g : α → 𝕜} {l : filter α}
791798
(hgf : ∀ x, g x = 0 → f x = 0) :
792799
is_o f g l ↔ tendsto (λ x, f x / (g x)) l (𝓝 0) :=
793800
iff.intro tendsto_nhds_zero_of_is_o (is_o_of_tendsto hgf)
794801

802+
theorem is_o_pow_pow {m n : ℕ} (h : m < n) :
803+
is_o (λ(x : 𝕜), x^n) (λx, x^m) (𝓝 0) :=
804+
begin
805+
let p := n - m,
806+
have nmp : n = m + p := (nat.add_sub_cancel' (le_of_lt h)).symm,
807+
have : (λ(x : 𝕜), x^m) = (λx, x^m * 1), by simp,
808+
simp only [this, pow_add, nmp],
809+
refine is_o_mul_left (is_O_refl _ _) (is_o_one_iff.2 _),
810+
convert (continuous_pow p).tendsto (0 : 𝕜),
811+
exact (zero_pow (nat.sub_pos_of_lt h)).symm
812+
end
813+
814+
theorem is_o_pow_id {n : ℕ} (h : 1 < n) :
815+
is_o (λ(x : 𝕜), x^n) (λx, x) (𝓝 0) :=
816+
by { convert is_o_pow_pow h, simp }
817+
795818
end
796819

797820
end asymptotics

0 commit comments

Comments
 (0)