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

Commit 0877077

Browse files
committed
chore(analysis/calculus/times_cont_diff): a few missing lemmas (#4900)
* add `times_cont_diff_within_at_iff_forall_nat_le` and `times_cont_diff_on_iff_forall_nat_le`; * add `times_cont_diff_on_all_iff_nat` and `times_cont_diff_all_iff_nat`; * rename `times_cont_diff_at.differentiable` to `times_cont_diff_at.differentiable_at`; * add `times_cont_diff.div_const`; * add `times_cont_diff_succ_iff_deriv` * move some `of_le` lemmas up to support minor golfing of proofs.
1 parent beb6831 commit 0877077

File tree

1 file changed

+64
-27
lines changed

1 file changed

+64
-27
lines changed

src/analysis/calculus/times_cont_diff.lean

Lines changed: 64 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -456,17 +456,18 @@ lemma times_cont_diff_within_at_nat {n : ℕ} :
456456
has_ftaylor_series_up_to_on n f p u :=
457457
⟨λ H, H n (le_refl _), λ ⟨u, hu, p, hp⟩ m hm, ⟨u, hu, p, hp.of_le hm⟩⟩
458458

459+
lemma times_cont_diff_within_at.of_le {m n : with_top ℕ}
460+
(h : times_cont_diff_within_at 𝕜 n f s x) (hmn : m ≤ n) :
461+
times_cont_diff_within_at 𝕜 m f s x :=
462+
λ k hk, h k (le_trans hk hmn)
463+
464+
lemma times_cont_diff_within_at_iff_forall_nat_le {n : with_top ℕ} :
465+
times_cont_diff_within_at 𝕜 n f s x ↔ ∀ m : ℕ, ↑m ≤ n → times_cont_diff_within_at 𝕜 m f s x :=
466+
⟨λ H m hm, H.of_le hm, λ H m hm, H m hm _ le_rfl⟩
467+
459468
lemma times_cont_diff_within_at_top :
460469
times_cont_diff_within_at 𝕜 ∞ f s x ↔ ∀ (n : ℕ), times_cont_diff_within_at 𝕜 n f s x :=
461-
begin
462-
split,
463-
{ assume H n m hm,
464-
rcases H m le_top with ⟨u, hu, p, hp⟩,
465-
exact ⟨u, hu, p, hp⟩ },
466-
{ assume H m hm,
467-
rcases H m m (le_refl _) with ⟨u, hu, p, hp⟩,
468-
exact ⟨u, hu, p, hp⟩ }
469-
end
470+
times_cont_diff_within_at_iff_forall_nat_le.trans $ by simp only [forall_prop_of_true, le_top]
470471

471472
lemma times_cont_diff_within_at.continuous_within_at {n : with_top ℕ}
472473
(h : times_cont_diff_within_at 𝕜 n f s x) : continuous_within_at f s x :=
@@ -522,11 +523,6 @@ lemma times_cont_diff_within_at_congr_nhds {n : with_top ℕ} {t : set E} (hst :
522523
times_cont_diff_within_at 𝕜 n f s x ↔ times_cont_diff_within_at 𝕜 n f t x :=
523524
⟨λ h, h.congr_nhds hst, λ h, h.congr_nhds hst.symm⟩
524525

525-
lemma times_cont_diff_within_at.of_le {m n : with_top ℕ}
526-
(h : times_cont_diff_within_at 𝕜 n f s x) (hmn : m ≤ n) :
527-
times_cont_diff_within_at 𝕜 m f s x :=
528-
λ k hk, h k (le_trans hk hmn)
529-
530526
lemma times_cont_diff_within_at_inter' {n : with_top ℕ} (h : t ∈ 𝓝[s] x) :
531527
times_cont_diff_within_at 𝕜 n f (s ∩ t) x ↔ times_cont_diff_within_at 𝕜 n f s x :=
532528
times_cont_diff_within_at_congr_nhds $ eq.symm $ nhds_within_restrict'' _ h
@@ -633,9 +629,26 @@ begin
633629
exact insert_eq_of_mem hy
634630
end
635631

632+
lemma times_cont_diff_on.of_le {m n : with_top ℕ}
633+
(h : times_cont_diff_on 𝕜 n f s) (hmn : m ≤ n) :
634+
times_cont_diff_on 𝕜 m f s :=
635+
λ x hx, (h x hx).of_le hmn
636+
637+
lemma times_cont_diff_on_iff_forall_nat_le {n : with_top ℕ} :
638+
times_cont_diff_on 𝕜 n f s ↔ ∀ m : ℕ, ↑m ≤ n → times_cont_diff_on 𝕜 m f s :=
639+
⟨λ H m hm, H.of_le hm, λ H x hx m hm, H m hm x hx m le_rfl⟩
640+
636641
lemma times_cont_diff_on_top :
637642
times_cont_diff_on 𝕜 ∞ f s ↔ ∀ (n : ℕ), times_cont_diff_on 𝕜 n f s :=
638-
by { simp [times_cont_diff_on, times_cont_diff_within_at_top], tauto }
643+
times_cont_diff_on_iff_forall_nat_le.trans $ by simp only [le_top, forall_prop_of_true]
644+
645+
lemma times_cont_diff_on_all_iff_nat :
646+
(∀ n, times_cont_diff_on 𝕜 n f s) ↔ (∀ n : ℕ, times_cont_diff_on 𝕜 n f s) :=
647+
begin
648+
refine ⟨λ H n, H n, _⟩,
649+
rintro H (_|n),
650+
exacts [times_cont_diff_on_top.2 H, H n]
651+
end
639652

640653
lemma times_cont_diff_on.continuous_on {n : with_top ℕ}
641654
(h : times_cont_diff_on 𝕜 n f s) : continuous_on f s :=
@@ -660,11 +673,6 @@ lemma times_cont_diff_on.congr_mono {n : with_top ℕ}
660673
times_cont_diff_on 𝕜 n f₁ s₁ :=
661674
(hf.mono hs).congr h₁
662675

663-
lemma times_cont_diff_on.of_le {m n : with_top ℕ}
664-
(h : times_cont_diff_on 𝕜 n f s) (hmn : m ≤ n) :
665-
times_cont_diff_on 𝕜 m f s :=
666-
λ x hx, (h x hx).of_le hmn
667-
668676
/-- If a function is `C^n` on a set with `n ≥ 1`, then it is differentiable there. -/
669677
lemma times_cont_diff_on.differentiable_on {n : with_top ℕ}
670678
(h : times_cont_diff_on 𝕜 n f s) (hn : 1 ≤ n) : differentiable_on 𝕜 f s :=
@@ -1245,7 +1253,7 @@ lemma times_cont_diff_at.continuous_at {n : with_top ℕ}
12451253
by simpa [continuous_within_at_univ] using h.continuous_within_at
12461254

12471255
/-- If a function is `C^n` with `n ≥ 1` at a point, then it is differentiable there. -/
1248-
lemma times_cont_diff_at.differentiable {n : with_top ℕ}
1256+
lemma times_cont_diff_at.differentiable_at {n : with_top ℕ}
12491257
(h : times_cont_diff_at 𝕜 n f x) (hn : 1 ≤ n) : differentiable_at 𝕜 f x :=
12501258
by simpa [hn, differentiable_within_at_univ] using h.differentiable_within_at
12511259

@@ -1312,6 +1320,10 @@ lemma times_cont_diff_top :
13121320
times_cont_diff 𝕜 ∞ f ↔ ∀ (n : ℕ), times_cont_diff 𝕜 n f :=
13131321
by simp [times_cont_diff_on_univ.symm, times_cont_diff_on_top]
13141322

1323+
lemma times_cont_diff_all_iff_nat :
1324+
(∀ n, times_cont_diff 𝕜 n f) ↔ (∀ n : ℕ, times_cont_diff 𝕜 n f) :=
1325+
by simp only [← times_cont_diff_on_univ, times_cont_diff_on_all_iff_nat]
1326+
13151327
lemma times_cont_diff.times_cont_diff_on {n : with_top ℕ}
13161328
(h : times_cont_diff 𝕜 n f) : times_cont_diff_on 𝕜 n f s :=
13171329
(times_cont_diff_on_univ.2 h).mono (subset_univ _)
@@ -2244,24 +2256,41 @@ lemma times_cont_diff_at.mul {n : with_top ℕ} {f g : E → 𝕜}
22442256
times_cont_diff_at 𝕜 n (λ x, f x * g x) x :=
22452257
by rw [← times_cont_diff_within_at_univ] at *; exact hf.mul hg
22462258

2259+
/-- The product of two `C^n` functions on a domain is `C^n`. -/
2260+
lemma times_cont_diff_on.mul {n : with_top ℕ} {s : set E} {f g : E → 𝕜}
2261+
(hf : times_cont_diff_on 𝕜 n f s) (hg : times_cont_diff_on 𝕜 n g s) :
2262+
times_cont_diff_on 𝕜 n (λ x, f x * g x) s :=
2263+
λ x hx, (hf x hx).mul (hg x hx)
2264+
22472265
/-- The product of two `C^n`functions is `C^n`. -/
22482266
lemma times_cont_diff.mul {n : with_top ℕ} {f g : E → 𝕜}
22492267
(hf : times_cont_diff 𝕜 n f) (hg : times_cont_diff 𝕜 n g) :
22502268
times_cont_diff 𝕜 n (λ x, f x * g x) :=
22512269
times_cont_diff_mul.comp (hf.prod hg)
22522270

2271+
lemma times_cont_diff_within_at.div_const {f : E → 𝕜} {n} {c : 𝕜}
2272+
(hf : times_cont_diff_within_at 𝕜 n f s x) :
2273+
times_cont_diff_within_at 𝕜 n (λ x, f x / c) s x :=
2274+
hf.mul times_cont_diff_within_at_const
2275+
2276+
lemma times_cont_diff_at.div_const {f : E → 𝕜} {n} {c : 𝕜} (hf : times_cont_diff_at 𝕜 n f x) :
2277+
times_cont_diff_at 𝕜 n (λ x, f x / c) x :=
2278+
hf.mul times_cont_diff_at_const
2279+
2280+
lemma times_cont_diff_on.div_const {f : E → 𝕜} {n} {c : 𝕜} (hf : times_cont_diff_on 𝕜 n f s) :
2281+
times_cont_diff_on 𝕜 n (λ x, f x / c) s :=
2282+
hf.mul times_cont_diff_on_const
2283+
2284+
lemma times_cont_diff.div_const {f : E → 𝕜} {n} {c : 𝕜} (hf : times_cont_diff 𝕜 n f) :
2285+
times_cont_diff 𝕜 n (λ x, f x / c) :=
2286+
hf.mul times_cont_diff_const
2287+
22532288
lemma times_cont_diff.pow {n : with_top ℕ} {f : E → 𝕜}
22542289
(hf : times_cont_diff 𝕜 n f) :
22552290
∀ m : ℕ, times_cont_diff 𝕜 n (λ x, (f x) ^ m)
22562291
| 0 := by simpa using times_cont_diff_const
22572292
| (m + 1) := hf.mul (times_cont_diff.pow m)
22582293

2259-
/-- The product of two `C^n` functions on a domain is `C^n`. -/
2260-
lemma times_cont_diff_on.mul {n : with_top ℕ} {s : set E} {f g : E → 𝕜}
2261-
(hf : times_cont_diff_on 𝕜 n f s) (hg : times_cont_diff_on 𝕜 n g s) :
2262-
times_cont_diff_on 𝕜 n (λ x, f x * g x) s :=
2263-
λ x hx, (hf x hx).mul (hg x hx)
2264-
22652294
/-! ### Scalar multiplication -/
22662295

22672296
/- The scalar multiplication is smooth. -/
@@ -2697,6 +2726,14 @@ lemma times_cont_diff_on.continuous_on_deriv_of_open {n : with_top ℕ}
26972726
continuous_on (deriv f₂) s₂ :=
26982727
((times_cont_diff_on_succ_iff_deriv_of_open hs).1 (h.of_le hn)).2.continuous_on
26992728

2729+
/-- A function is `C^(n + 1)` on a domain with unique derivatives if and only if it is
2730+
differentiable there, and its derivative is `C^n`. -/
2731+
theorem times_cont_diff_succ_iff_deriv {n : ℕ} :
2732+
times_cont_diff 𝕜 ((n + 1) : ℕ) f₂ ↔
2733+
differentiable 𝕜 f₂ ∧ times_cont_diff 𝕜 n (deriv f₂) :=
2734+
by simp only [← times_cont_diff_on_univ, times_cont_diff_on_succ_iff_deriv_of_open, is_open_univ,
2735+
differentiable_on_univ]
2736+
27002737
end deriv
27012738

27022739
section restrict_scalars

0 commit comments

Comments
 (0)