Skip to content

Commit 2c7836b

Browse files
committed
chore(Geometry/Manifold): make some doc-strings follow the style guide (#39729)
such as, by them beginning with the object they are defining as a subject. This will yield much better doc-strings for the differential geometry elaborators in #39677. It also increases conformance with the [documentation style guide](https://github.com/leanprover/lean4/blob/master/doc/style.md). Inspired by the MI retreat in Lisbon.
1 parent 22616d0 commit 2c7836b

3 files changed

Lines changed: 57 additions & 31 deletions

File tree

Mathlib/Geometry/Manifold/ContMDiff/Defs.lean

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -160,18 +160,22 @@ theorem contDiffWithinAtProp_id (x : H) : ContDiffWithinAtProp I I n id univ x :
160160
· simp only [mfld_simps]
161161

162162
variable (I I') in
163-
/-- A function is `n` times continuously differentiable within a set at a point in a manifold if
164-
it is continuous and it is `n` times continuously differentiable in this set around this point, when
165-
read in the preferred chart at this point.
163+
/-- `ContMDiffWithinAt I I' n f x` indicates that the function `f : M → M'` between manifolds
164+
is `n` times continuously differentiable at `x : M` within the set `s`.
165+
166+
`f` is `n` times continuously differentiable within `s` at `x` if it is continuous and it is `n`
167+
times continuously differentiable in this set around `x`, when read in the preferred chart at `x`.
166168
The parameter `n` belongs to `ℕ∞ω` (accessible in the `ContDiff` scope), i.e. it can be a natural
167169
number, `∞`, or `ω`, where `C^ω` corresponds to analytic functions. -/
168170
def ContMDiffWithinAt (n : ℕ∞ω) (f : M → M') (s : Set M) (x : M) :=
169171
LiftPropWithinAt (ContDiffWithinAtProp I I' n) f s x
170172

171173
variable (I I') in
172-
/-- A function is `n` times continuously differentiable at a point in a manifold if
173-
it is continuous and it is `n` times continuously differentiable around this point, when
174-
read in the preferred chart at this point.
174+
/-- `ContMDiffAt I I' n f x` indicates that the function `f : M → M'` between manifolds
175+
is `n` times continuously differentiable at `x : M`.
176+
177+
`f` is `n` times continuously differentiable at `x` if it is continuous and it is `n` times
178+
continuously differentiable around `x`, when read in the preferred chart at `x`.
175179
The parameter `n` belongs to `ℕ∞ω` (accessible in the `ContDiff` scope), i.e. it can be a natural
176180
number, `∞`, or `ω`, where `C^ω` corresponds to analytic functions. -/
177181
def ContMDiffAt (n : ℕ∞ω) (f : M → M') (x : M) :=
@@ -185,18 +189,23 @@ theorem contMDiffAt_iff {n : ℕ∞ω} {f : M → M'} {x : M} :
185189
liftPropAt_iff.trans <| by rw [ContDiffWithinAtProp, preimage_univ, univ_inter]; rfl
186190

187191
variable (I I') in
188-
/-- A function is `n` times continuously differentiable in a set of a manifold if it is continuous
189-
and, for any pair of points, it is `n` times continuously differentiable on this set in the charts
192+
/-- `ContMDiffOn I I' n f s` indicates that the function `f : M → M'` between manifolds
193+
is `n` times continuously differentiable in a set `s : Set M`.
194+
195+
`f` is `n` times continuously differentiable on `s` if it is continuous on `s` and,
196+
for any pair of points, it is `n` times continuously differentiable `s` in the charts
190197
around these points.
191198
The parameter `n` belongs to `ℕ∞ω` (accessible in the `ContDiff` scope), i.e. it can be a natural
192199
number, `∞`, or `ω`, where `C^ω` corresponds to analytic functions. -/
193200
def ContMDiffOn (n : ℕ∞ω) (f : M → M') (s : Set M) :=
194201
∀ x ∈ s, ContMDiffWithinAt I I' n f s x
195202

196203
variable (I I') in
197-
/-- A function is `n` times continuously differentiable in a manifold if it is continuous
198-
and, for any pair of points, it is `n` times continuously differentiable in the charts
199-
around these points.
204+
/-- `ContMDiff I I' n f` indicates that the function `f : M → M'` between manifolds
205+
is `n` times continuously differentiable.
206+
207+
`f` is `n` times continuously differentiable if it is continuous and, for any pair of points,
208+
it is `n` times continuously differentiable in the charts around these points.
200209
The parameter `n` belongs to `ℕ∞ω` (accessible in the `ContDiff` scope), i.e. it can be a natural
201210
number, `∞`, or `ω`, where `C^ω` corresponds to analytic functions. -/
202211
def ContMDiff (n : ℕ∞ω) (f : M → M') :=

Mathlib/Geometry/Manifold/MFDeriv/Defs.lean

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,9 @@ def HasMFDerivAt (f : M → M') (x : M) (f' : TangentSpace I x →L[𝕜] Tangen
316316

317317
open Classical in
318318
variable (I I') in
319-
/-- Let `f` be a function between two manifolds. Then `mfderivWithin I I' f s x` is the
320-
derivative of `f` at `x` within `s`, as a continuous linear map from the tangent space at `x` to the
321-
tangent space at `f x`. -/
319+
/-- `mfderivWithin I I' f s x`, given a function `f` between two manifolds,
320+
is the derivative of `f` at `x` within `s`,
321+
as a continuous linear map from the tangent space at `x` to the tangent space at `f x`. -/
322322
def mfderivWithin (f : M → M') (s : Set M) (x : M) : TangentSpace I x →L[𝕜] TangentSpace I' (f x) :=
323323
if MDifferentiableWithinAt I I' f s x then
324324
(fderivWithin 𝕜 (writtenInExtChartAt I I' x f) ((extChartAt I x).symm ⁻¹' s ∩ range I)
@@ -328,21 +328,22 @@ def mfderivWithin (f : M → M') (s : Set M) (x : M) : TangentSpace I x →L[
328328

329329
open Classical in
330330
variable (I I') in
331-
/-- Let `f` be a function between two manifolds. Then `mfderiv I I' f x` is the derivative of
332-
`f` at `x`, as a continuous linear map from the tangent space at `x` to the tangent space at
333-
`f x`. -/
331+
/-- `mfderiv I I' f x`, given a function `f` between two manifolds, is the derivative of `f` at `x`,
332+
as a continuous linear map from the tangent space at `x` to the tangent space at `f x`. -/
334333
def mfderiv (f : M → M') (x : M) : TangentSpace I x →L[𝕜] TangentSpace I' (f x) :=
335334
if MDifferentiableAt I I' f x then
336335
(fderivWithin 𝕜 (writtenInExtChartAt I I' x f : E → E') (range I) ((extChartAt I x) x) :)
337336
else 0
338337

339338
variable (I I') in
340-
/-- The derivative within a set, as a map between the tangent bundles -/
339+
/-- `tangentMapWithin I I' f s` is the derivative of `f : M → M'` within a set `s`,
340+
as a map between the tangent bundles `TM` and `TM'`. -/
341341
def tangentMapWithin (f : M → M') (s : Set M) : TangentBundle I M → TangentBundle I' M' := fun p =>
342342
⟨f p.1, (mfderivWithin I I' f s p.1 : TangentSpace I p.1 → TangentSpace I' (f p.1)) p.2
343343

344344
variable (I I') in
345-
/-- The derivative, as a map between the tangent bundles -/
345+
/-- `tangentMap I I' f` is the derivative of `f : M → M'` as a map between the tangent bundles
346+
`TM` and `TM'`. -/
346347
def tangentMap (f : M → M') : TangentBundle I M → TangentBundle I' M' := fun p =>
347348
⟨f p.1, (mfderiv I I' f p.1 : TangentSpace I p.1 → TangentSpace I' (f p.1)) p.2
348349

Mathlib/Geometry/Manifold/MFDeriv/NormedSpace.lean

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,34 @@ public import Mathlib.Geometry.Manifold.Algebra.SMul
99
public import Mathlib.Geometry.Manifold.ContMDiff.NormedSpace
1010
public import Mathlib.Geometry.Manifold.MFDeriv.SpecificFunctions
1111

12-
/-! ## Equivalence of manifold differentiability with the basic definition for functions between
12+
/-! # Equivalence of manifold differentiability with the basic definition for functions between
1313
vector spaces
1414
1515
The API in this file is mostly copied from `Mathlib/Geometry/Manifold/ContMDiff/NormedSpace.lean`,
1616
providing the same statements for higher smoothness. In this file, we do the same for
1717
differentiability.
1818
19-
In addition to the above, this file provides
20-
* results about the differentiability of scalar multiplication (`mfderiv_smul` and friends),
21-
* `mvfderiv`: the exterior derivative of a vector-valued function, as a section of the
22-
cotangent bundle; adds notation `d% f` for `mvfderiv I f` via a custom elaborator scoped to the
23-
`Manifold` namespace, with a corresponding delaborator, and
24-
adds basic lemmas about `mvfderiv` (such as addition, subtraction, multiplication and constants).
25-
* `mvfderivWithin` with notation `d[s]f` for `mvfderivWithin I f s` in the `Manifold` namespace:
19+
## Main definitions
20+
21+
In addition to the above, this file provides two important definitions.
22+
* `mvfderiv I f x` is the manifold Fréchet derivative at `x : M` of a vector-valued function
23+
`f : M → V`, but taking values in the target normed space `V` instead of `TangentSpace% (f x) V`.
24+
Mathematically, this uses the global trivialization `T V ≅ V × V`, yielding an identification
25+
`T_v V ≅ V` for each `v : V`. In Lean, we post-compose the differential `mfderiv% f x` with
26+
`NormedSpace.fromTangentSpace`. If `V` is a field, this coincides with the exterior derivative
27+
of `f` as a section of the cotangent bundle.
28+
There is notation `d% f` for `mvfderiv I f` via a custom elaborator scoped to the
29+
`Manifold` namespace, with a corresponding delaborator,
30+
* `mvfderivWithin` with notation `d[s] f` for `mvfderivWithin I f s` in the `Manifold` namespace:
2631
the analogous concept within a set, with analogous API lemmas
2732
33+
## Main results
34+
35+
This file contains
36+
* results about the differentiability of scalar multiplication (`mfderiv_smul` and friends),
37+
* basic lemmas about `mvfderiv` (such as addition, subtraction, multiplication and constants),
38+
* analogous lemmas about `mvfderivWithin`.
39+
2840
-/
2941

3042
public section
@@ -410,8 +422,10 @@ end smul
410422
/-! ### Exterior derivative of a vector-valued function -/
411423

412424
variable (I) in
413-
/-- `mvfderiv I J f x` is the exterior derivative of a vector-valued function `g` on `M`,
414-
as a section of the cotangent bundle.
425+
/-- `mvfderivWithin I J f s x` is the `mfderiv` of a vector-valued function `f` on `M` at `x`
426+
within the set `s`, but taking values in the target normed space directly.
427+
The difference to `mfderivWithin` is explained in the module-docstring for
428+
`Mathlib/Geometry/Manifold/MFDeriv/NormedSpace.lean`.
415429
416430
Future: this could be generalised to functions into additive torsors over abelian Lie groups.
417431
-/
@@ -421,8 +435,10 @@ noncomputable def mvfderivWithin (g : M → F) (s : Set M) :
421435
fun x ↦ (NormedSpace.fromTangentSpace <| g x).toContinuousLinearMap ∘L (mfderiv[s] g x)
422436

423437
variable (I) in
424-
/-- The exterior derivative of a vector-valued function on `M`,
425-
as a section of the cotangent bundle.
438+
/-- `mvfderiv I J f x` is the `mfderiv` of a vector-valued function `f` on `M` at `x`,
439+
but taking values in the target normed space directly.
440+
The difference to `mfderiv` is explained in the module-docstring for
441+
`Mathlib/Geometry/Manifold/MFDeriv/NormedSpace.lean`.
426442
427443
Future: this could be generalised to functions into additive torsors over abelian Lie groups.
428444
-/

0 commit comments

Comments
 (0)