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

Commit d06f62d

Browse files
committed
feat(analysis/calculus/times_cont_diff): more thorough times_cont_diff interface (#3551)
Add missing lemmas on smooth functions between vector spaces, that were necessary to solve the manifold exercises in Lftcm2020. Changes the `{x : E}` argument from implicit to explicit in `lemma times_cont_diff_within_at.comp` and `lemma times_cont_diff_within_at.comp'`.
1 parent ca6cebc commit d06f62d

File tree

5 files changed

+139
-34
lines changed

5 files changed

+139
-34
lines changed

src/analysis/calculus/fderiv.lean

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -729,13 +729,20 @@ differentiable_id.differentiable_on
729729
lemma fderiv_id : fderiv 𝕜 id x = id 𝕜 E :=
730730
has_fderiv_at.fderiv (has_fderiv_at_id x)
731731

732+
lemma fderiv_id' : fderiv 𝕜 (λ (x : E), x) x = continuous_linear_map.id 𝕜 E :=
733+
fderiv_id
734+
732735
lemma fderiv_within_id (hxs : unique_diff_within_at 𝕜 s x) :
733736
fderiv_within 𝕜 id s x = id 𝕜 E :=
734737
begin
735738
rw differentiable_at.fderiv_within (differentiable_at_id) hxs,
736739
exact fderiv_id
737740
end
738741

742+
lemma fderiv_within_id' (hxs : unique_diff_within_at 𝕜 s x) :
743+
fderiv_within 𝕜 (λ (x : E), x) s x = continuous_linear_map.id 𝕜 E :=
744+
fderiv_within_id hxs
745+
739746
end id
740747

741748
section const

src/analysis/calculus/times_cont_diff.lean

Lines changed: 128 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ for each natural `m` is by definition `C^∞` at `0`.
9191
9292
There is another issue with the definition of `times_cont_diff_within_at 𝕜 n f s x`. We can
9393
require the existence and good behavior of derivatives up to order `n` on a neighborhood of `x`
94-
within `s`. However, this does not imply continuity or differentiability within `s`of the function
94+
within `s`. However, this does not imply continuity or differentiability within `s` of the function
9595
at `x`. Therefore, we require such existence and good behavior on a neighborhood of `x` within
9696
`s ∪ {x}` (which appears as `insert x s` in this file).
9797
@@ -157,7 +157,7 @@ derivative, differentiability, higher derivative, `C^n`, multilinear, Taylor ser
157157
-/
158158

159159
noncomputable theory
160-
open_locale classical
160+
open_locale classical big_operators
161161

162162
local notation `∞` := (⊤ : with_top ℕ)
163163

@@ -1238,6 +1238,10 @@ lemma times_cont_diff.times_cont_diff_at {n : with_top ℕ} (h : times_cont_diff
12381238
times_cont_diff_at 𝕜 n f x :=
12391239
times_cont_diff_iff_times_cont_diff_at.1 h x
12401240

1241+
lemma times_cont_diff.times_cont_diff_within_at {n : with_top ℕ} (h : times_cont_diff 𝕜 n f) :
1242+
times_cont_diff_within_at 𝕜 n f s x :=
1243+
h.times_cont_diff_at.times_cont_diff_within_at
1244+
12411245
lemma times_cont_diff_top :
12421246
times_cont_diff 𝕜 ∞ f ↔ ∀ (n : ℕ), times_cont_diff 𝕜 n f :=
12431247
by simp [times_cont_diff_on_univ.symm, times_cont_diff_on_top]
@@ -1876,7 +1880,7 @@ times_cont_diff_on_univ.1 $ times_cont_diff_on.comp (times_cont_diff_on_univ.2 h
18761880

18771881
/-- The composition of `C^n` functions at points in domains is `C^n`. -/
18781882
lemma times_cont_diff_within_at.comp
1879-
{n : with_top ℕ} {s : set E} {t : set F} {g : F → G} {f : E → F} {x : E}
1883+
{n : with_top ℕ} {s : set E} {t : set F} {g : F → G} {f : E → F} (x : E)
18801884
(hg : times_cont_diff_within_at 𝕜 n g t (f x))
18811885
(hf : times_cont_diff_within_at 𝕜 n f s x) (st : s ⊆ f ⁻¹' t) :
18821886
times_cont_diff_within_at 𝕜 n (g ∘ f) s x :=
@@ -1906,10 +1910,20 @@ end
19061910

19071911
/-- The composition of `C^n` functions at points in domains is `C^n`. -/
19081912
lemma times_cont_diff_within_at.comp' {n : with_top ℕ} {s : set E} {t : set F} {g : F → G}
1909-
{f : E → F} {x : E}
1913+
{f : E → F} (x : E)
19101914
(hg : times_cont_diff_within_at 𝕜 n g t (f x)) (hf : times_cont_diff_within_at 𝕜 n f s x) :
19111915
times_cont_diff_within_at 𝕜 n (g ∘ f) (s ∩ f⁻¹' t) x :=
1912-
hg.comp (hf.mono (inter_subset_left _ _)) (inter_subset_right _ _)
1916+
hg.comp x (hf.mono (inter_subset_left _ _)) (inter_subset_right _ _)
1917+
1918+
lemma times_cont_diff.comp_times_cont_diff_within_at
1919+
{n : with_top ℕ} {g : F → G} {f : E → F} (h : times_cont_diff 𝕜 n g)
1920+
(hf : times_cont_diff_within_at 𝕜 n f t x) :
1921+
times_cont_diff_within_at 𝕜 n (g ∘ f) t x :=
1922+
begin
1923+
have : times_cont_diff_within_at 𝕜 n g univ (f x) :=
1924+
h.times_cont_diff_at.times_cont_diff_within_at,
1925+
exact this.comp x hf (subset_univ _),
1926+
end
19131927

19141928
/-- The bundled derivative of a `C^{n+1}` function is `C^n`. -/
19151929
lemma times_cont_diff_on_fderiv_within_apply {m n : with_top ℕ} {s : set E}
@@ -1943,59 +1957,143 @@ begin
19431957
exact times_cont_diff_on_fderiv_within_apply hf unique_diff_on_univ hmn
19441958
end
19451959

1946-
/-- The sum of two `C^n`functions on a domain is `C^n`. -/
1947-
lemma times_cont_diff_on.add {n : with_top ℕ} {s : set E} {f g : E → F}
1948-
(hf : times_cont_diff_on 𝕜 n f s) (hg : times_cont_diff_on 𝕜 n g s) :
1949-
times_cont_diff_on 𝕜 n (λx, f x + g x) s :=
1960+
/-! ### Sum of two functions -/
1961+
1962+
/-- The sum of two `C^n` functions within a set at a point is `C^n` within this set
1963+
at this point. -/
1964+
lemma times_cont_diff_within_at.add {n : with_top ℕ} {s : set E} {f g : E → F}
1965+
(hf : times_cont_diff_within_at 𝕜 n f s x) (hg : times_cont_diff_within_at 𝕜 n g s x) :
1966+
times_cont_diff_within_at 𝕜 n (λx, f x + g x) s x :=
19501967
begin
1951-
have : times_cont_diff 𝕜 n (λp : F × F, p.1 + p.2),
1968+
have A : times_cont_diff 𝕜 n (λp : F × F, p.1 + p.2),
19521969
{ apply is_bounded_linear_map.times_cont_diff,
19531970
exact is_bounded_linear_map.add is_bounded_linear_map.fst is_bounded_linear_map.snd },
1954-
exact this.comp_times_cont_diff_on (hf.prod hg)
1971+
exact A.times_cont_diff_within_at.comp x (hf.prod hg) subset_preimage_univ,
1972+
end
1973+
1974+
/-- The sum of two `C^n` functions at a point is `C^n` at this point. -/
1975+
lemma times_cont_diff_at.add {n : with_top ℕ} {f g : E → F}
1976+
(hf : times_cont_diff_at 𝕜 n f x) (hg : times_cont_diff_at 𝕜 n g x) :
1977+
times_cont_diff_at 𝕜 n (λx, f x + g x) x :=
1978+
begin
1979+
rw [← times_cont_diff_within_at_univ] at *,
1980+
exact hf.add hg
19551981
end
19561982

1957-
/-- The sum of two `C^n`functions is `C^n`. -/
1983+
/-- The sum of two `C^n` functions on a domain is `C^n`. -/
1984+
lemma times_cont_diff_on.add {n : with_top ℕ} {s : set E} {f g : E → F}
1985+
(hf : times_cont_diff_on 𝕜 n f s) (hg : times_cont_diff_on 𝕜 n g s) :
1986+
times_cont_diff_on 𝕜 n (λx, f x + g x) s :=
1987+
λ x hx, (hf x hx).add (hg x hx)
1988+
1989+
/-- The sum of two `C^n` functions is `C^n`. -/
19581990
lemma times_cont_diff.add {n : with_top ℕ} {f g : E → F}
19591991
(hf : times_cont_diff 𝕜 n f) (hg : times_cont_diff 𝕜 n g) : times_cont_diff 𝕜 n (λx, f x + g x) :=
19601992
begin
1961-
have : times_cont_diff 𝕜 n (λp : F × F, p.1 + p.2),
1962-
{ apply is_bounded_linear_map.times_cont_diff,
1963-
exact is_bounded_linear_map.add is_bounded_linear_map.fst is_bounded_linear_map.snd },
1964-
exact this.comp (hf.prod hg)
1993+
rw ← times_cont_diff_on_univ at *,
1994+
exact hf.add hg
19651995
end
19661996

1967-
/-- The negative of a `C^n`function on a domain is `C^n`. -/
1968-
lemma times_cont_diff_on.neg {n : with_top ℕ} {s : set E} {f : E → F}
1969-
(hf : times_cont_diff_on 𝕜 n f s) : times_cont_diff_on 𝕜 n (λx, -f x) s :=
1997+
/-! ### Negative -/
1998+
1999+
/-- The negative of a `C^n` function within a domain at a point is `C^n` within this domain at
2000+
this point. -/
2001+
lemma times_cont_diff_within_at.neg {n : with_top ℕ} {s : set E} {f : E → F}
2002+
(hf : times_cont_diff_within_at 𝕜 n f s x) : times_cont_diff_within_at 𝕜 n (λx, -f x) s x :=
19702003
begin
19712004
have : times_cont_diff 𝕜 n (λp : F, -p),
19722005
{ apply is_bounded_linear_map.times_cont_diff,
19732006
exact is_bounded_linear_map.neg is_bounded_linear_map.id },
1974-
exact this.comp_times_cont_diff_on hf
2007+
exact this.times_cont_diff_within_at.comp x hf subset_preimage_univ
2008+
end
2009+
2010+
/-- The negative of a `C^n` function at a point is `C^n` at this point. -/
2011+
lemma times_cont_diff_at.neg {n : with_top ℕ} {f : E → F}
2012+
(hf : times_cont_diff_at 𝕜 n f x) : times_cont_diff_at 𝕜 n (λx, -f x) x :=
2013+
begin
2014+
rw ← times_cont_diff_within_at_univ at *,
2015+
exact hf.neg
19752016
end
19762017

1977-
/-- The negative of a `C^n`function is `C^n`. -/
2018+
/-- The negative of a `C^n` function on a domain is `C^n`. -/
2019+
lemma times_cont_diff_on.neg {n : with_top ℕ} {s : set E} {f : E → F}
2020+
(hf : times_cont_diff_on 𝕜 n f s) : times_cont_diff_on 𝕜 n (λx, -f x) s :=
2021+
λ x hx, (hf x hx).neg
2022+
2023+
/-- The negative of a `C^n` function is `C^n`. -/
19782024
lemma times_cont_diff.neg {n : with_top ℕ} {f : E → F} (hf : times_cont_diff 𝕜 n f) :
19792025
times_cont_diff 𝕜 n (λx, -f x) :=
19802026
begin
1981-
have : times_cont_diff 𝕜 n (λp : F, -p),
1982-
{ apply is_bounded_linear_map.times_cont_diff,
1983-
exact is_bounded_linear_map.neg is_bounded_linear_map.id },
1984-
exact this.comp hf
2027+
rw ← times_cont_diff_on_univ at *,
2028+
exact hf.neg
19852029
end
19862030

1987-
/-- The difference of two `C^n`functions on a domain is `C^n`. -/
2031+
/-! ### Subtraction -/
2032+
2033+
/-- The difference of two `C^n` functions within a set at a point is `C^n` within this set
2034+
at this point. -/
2035+
lemma times_cont_diff_within_at.sub {n : with_top ℕ} {s : set E} {f g : E → F}
2036+
(hf : times_cont_diff_within_at 𝕜 n f s x) (hg : times_cont_diff_within_at 𝕜 n g s x) :
2037+
times_cont_diff_within_at 𝕜 n (λx, f x - g x) s x :=
2038+
hf.add hg.neg
2039+
2040+
/-- The difference of two `C^n` functions at a point is `C^n` at this point. -/
2041+
lemma times_cont_diff_at.sub {n : with_top ℕ} {f g : E → F}
2042+
(hf : times_cont_diff_at 𝕜 n f x) (hg : times_cont_diff_at 𝕜 n g x) :
2043+
times_cont_diff_at 𝕜 n (λx, f x - g x) x :=
2044+
hf.add hg.neg
2045+
2046+
/-- The difference of two `C^n` functions on a domain is `C^n`. -/
19882047
lemma times_cont_diff_on.sub {n : with_top ℕ} {s : set E} {f g : E → F}
19892048
(hf : times_cont_diff_on 𝕜 n f s) (hg : times_cont_diff_on 𝕜 n g s) :
19902049
times_cont_diff_on 𝕜 n (λx, f x - g x) s :=
1991-
hf.add (hg.neg)
2050+
hf.add hg.neg
19922051

1993-
/-- The difference of two `C^n`functions is `C^n`. -/
2052+
/-- The difference of two `C^n` functions is `C^n`. -/
19942053
lemma times_cont_diff.sub {n : with_top ℕ} {f g : E → F}
1995-
(hf : times_cont_diff 𝕜 n f) (hg : times_cont_diff 𝕜 n g) :
1996-
times_cont_diff 𝕜 n (λx, f x - g x) :=
2054+
(hf : times_cont_diff 𝕜 n f) (hg : times_cont_diff 𝕜 n g) : times_cont_diff 𝕜 n (λx, f x - g x) :=
19972055
hf.add hg.neg
19982056

2057+
/-! ### Sum of finitely many functions -/
2058+
2059+
lemma times_cont_diff_within_at.sum
2060+
{ι : Type*} {f : ι → E → F} {s : finset ι} {n : with_top ℕ} {t : set E} {x : E}
2061+
(h : ∀ i ∈ s, times_cont_diff_within_at 𝕜 n (λ x, f i x) t x) :
2062+
times_cont_diff_within_at 𝕜 n (λ x, (∑ i in s, f i x)) t x :=
2063+
begin
2064+
classical,
2065+
induction s using finset.induction_on with i s is IH,
2066+
{ simp [times_cont_diff_within_at_const] },
2067+
{ simp only [is, finset.sum_insert, not_false_iff],
2068+
exact (h _ (finset.mem_insert_self i s)).add (IH (λ j hj, h _ (finset.mem_insert_of_mem hj))) }
2069+
end
2070+
2071+
lemma times_cont_diff_at.sum
2072+
{ι : Type*} {f : ι → E → F} {s : finset ι} {n : with_top ℕ} {x : E}
2073+
(h : ∀ i ∈ s, times_cont_diff_at 𝕜 n (λ x, f i x) x) :
2074+
times_cont_diff_at 𝕜 n (λ x, (∑ i in s, f i x)) x :=
2075+
begin
2076+
rw [← times_cont_diff_within_at_univ] at *,
2077+
exact times_cont_diff_within_at.sum h
2078+
end
2079+
2080+
lemma times_cont_diff_on.sum
2081+
{ι : Type*} {f : ι → E → F} {s : finset ι} {n : with_top ℕ} {t : set E}
2082+
(h : ∀ i ∈ s, times_cont_diff_on 𝕜 n (λ x, f i x) t) :
2083+
times_cont_diff_on 𝕜 n (λ x, (∑ i in s, f i x)) t :=
2084+
λ x hx, times_cont_diff_within_at.sum (λ i hi, h i hi x hx)
2085+
2086+
lemma times_cont_diff.sum
2087+
{ι : Type*} {f : ι → E → F} {s : finset ι} {n : with_top ℕ}
2088+
(h : ∀ i ∈ s, times_cont_diff 𝕜 n (λ x, f i x)) :
2089+
times_cont_diff 𝕜 n (λ x, (∑ i in s, f i x)) :=
2090+
begin
2091+
simp [← times_cont_diff_on_univ] at *,
2092+
exact times_cont_diff_on.sum h
2093+
end
2094+
2095+
/-! ### Cartesian product of two functions-/
2096+
19992097
/-- The product map of two `C^n` functions is `C^n`. -/
20002098
lemma times_cont_diff_on.map_prod {E' : Type*} [normed_group E'] [normed_space 𝕜 E']
20012099
{F' : Type*} [normed_group F'] [normed_space 𝕜 F']

src/geometry/manifold/times_cont_mdiff.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ lemma times_cont_diff_within_at_local_invariant_prop (n : with_top ℕ) :
9393
rw this at h,
9494
have : I (e x) ∈ (I.symm) ⁻¹' e.target ∩ range ⇑I, by simp only [hx] with mfld_simps,
9595
have := ((mem_groupoid_of_pregroupoid.2 he).2.times_cont_diff_within_at this).of_le le_top,
96-
convert h.comp' this using 1,
96+
convert h.comp' _ this using 1,
9797
{ ext y, simp only with mfld_simps },
9898
{ mfld_set_tac }
9999
end,
@@ -113,7 +113,7 @@ lemma times_cont_diff_within_at_local_invariant_prop (n : with_top ℕ) :
113113
have A : (I' ∘ f ∘ I.symm) (I x) ∈ (I'.symm ⁻¹' e'.source ∩ range I'),
114114
by simp only [hx] with mfld_simps,
115115
have := ((mem_groupoid_of_pregroupoid.2 he').1.times_cont_diff_within_at A).of_le le_top,
116-
convert this.comp h _,
116+
convert this.comp _ h _,
117117
{ ext y, simp only with mfld_simps },
118118
{ assume y hy, simp only with mfld_simps at hy, simpa only [hy] with mfld_simps using hs hy.2 }
119119
end }

src/topology/metric_space/gromov_hausdorff.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ instance GH_space_metric_space : metric_space GH_space :=
409409
end,
410410
dist_triangle := λx y z, begin
411411
/- To show the triangular inequality between `X`, `Y` and `Z`, realize an optimal coupling
412-
between `X` and `Y` in a space `γ1`, and an optimal coupling between `Y`and `Z` in a space `γ2`.
412+
between `X` and `Y` in a space `γ1`, and an optimal coupling between `Y` and `Z` in a space `γ2`.
413413
Then, glue these metric spaces along `Y`. We get a new space `γ` in which `X` and `Y` are
414414
optimally coupled, as well as `Y` and `Z`. Apply the triangle inequality for the Hausdorff
415415
distance in `γ` to conclude. -/

src/topology/metric_space/hausdorff_distance.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ exists_edist_lt_of_inf_edist_lt $ calc
211211
... ≤ Sup ((λx, inf_edist x t) '' s) ⊔ Sup ((λx, inf_edist x s) '' t) : le_sup_left
212212
... < r : by rwa Hausdorff_edist_def at H
213213

214-
/-- The distance from `x` to `s`or `t` is controlled in terms of the Hausdorff distance
214+
/-- The distance from `x` to `s` or `t` is controlled in terms of the Hausdorff distance
215215
between `s` and `t` -/
216216
lemma inf_edist_le_inf_edist_add_Hausdorff_edist :
217217
inf_edist x t ≤ inf_edist x s + Hausdorff_edist s t :=

0 commit comments

Comments
 (0)