feat(Geometry/Manifold): riemannian metrics exist - #33714
feat(Geometry/Manifold): riemannian metrics exist#33714idontgetoutmuch wants to merge 18 commits into
Conversation
PR summary c4cbb8b896Import changes for modified filesNo significant changes to the import graph Import changes for all files
|
| Current number | Change | Type (strong) |
|---|---|---|
| 4 | 4 | maxHeartBeats modifications |
Current commit c4cbb8b896
Reference commit 65fe2a1f85
This script lives in the mathlib-ci repository. To run it locally, from your mathlib4 directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci
../mathlib-ci/scripts/reporting/technical-debt-metrics.sh pr_summary
- The
relativevalue is the weighted sum of the differences with weight given by the inverse of the current value of the statistic. - The
absolutevalue is therelativevalue divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).
|
From #33519 (comment)
@grunweg do you mean generalising this? /-
Overloading the use of π, let φ : π⁻¹(U) → U × ℝⁿ and ψ : π⁻¹(U) → U × (ℝⁿ ⊗ ℝⁿ →ₗ ℝ) be local
trivialisations of the tangent bundle and the bundle of bilinear forms respectively and
w ∈ π⁻¹(U) and (x, u) and (y, v) ∈ U × ℝⁿ then ψ(w)(u, v) = w(φ⁻¹(x, u), φ⁻¹(x, v))
-/
lemma trivializationAt_tangentSpace_bilinearForm_apply (x₀ x : B)
(w : (TangentSpace (M := B) IB) x →L[ℝ] (TangentSpace (M := B) IB) x →L[ℝ] ℝ)
(u v : EB)
(hx : x ∈ (trivializationAt EB (TangentSpace (M := B) IB) x₀).baseSet) :
(trivializationAt (EB →L[ℝ] EB →L[ℝ] ℝ)
(fun x ↦ (TangentSpace (M := B) IB) x →L[ℝ]
(TangentSpace (M := B) IB) x →L[ℝ]
ℝ) x₀).continuousLinearMapAt ℝ x w u v =
w ((trivializationAt EB (TangentSpace (M := B) IB) x₀).symm x u)
((trivializationAt EB (TangentSpace (M := B) IB) x₀).symm x v)Code here: |
|
You know what your comment refers to - but this seems about right. |
|
See also #28056 |
grunweg
left a comment
There was a problem hiding this comment.
Thanks for your PR; this result is sorely missing from mathlib.
I have two kinds of comments. The first one is that the code is not yet at mathlib's quality bar; it can be shortened significantly, for instance. I have made some example comments below. The second, higher-level, comment is that this result holds on any finite rank vector bundle --- hence should be proven in that generality. Would you like to attempt this generalisation also? As-is, this PR probably should not get merged.
|
I have been thinking about the comment on generalisation. But can this be generalised? What would the statement of a general theorem be? Existence of an n-form on a manifold? Moreover the proof relies on |
|
You want to prove the existence of a Riemannian metric, on any vector bundle. (Let's say finite-dimensional for now.) I don't see the issues with |
Thank you. I have been barking up the wrong generalisation tree (auf dem Holzweg). That feels like it should be easy enough. Yes |
|
@grunweg thanks for all the feedback - I am working through generalising everything and then I will address your feedback (which may no longer apply if we are lucky). |
All generalised now but my refactoring technique now needs cosmetic attention. I will address all comments and then perhaps you can help with getting the code to the quality bar (is this just someone's opinion? in which case whose?). |
|
I think I addressed all the comments so I've removed the "awaiting author" label. |
|
Maybe I should add Every smooth finite-dimensional vector bundle over a smooth manifold admits a smooth Riemannian metric on its fibers. |
Congratulations on completing the generalisation! I'll be happy to help you raise the code towards mathlib quality. (Perhaps I can take a look again later today.) A lot of the quality bar is documented in the style guide, the rest is accumulated collective wisdom on writing code that is maintainable in the long term. There is broad consensus on that. In principle, any maintainer has the power to unilaterally merge a PR. In practice, we operate by consensus (and discuss potentially controversial topics beforehand). |
grunweg
left a comment
There was a problem hiding this comment.
I have looked at your PR from a style/golfing perspective: I think it can be written more compactly, which makes it easier to see what's going on, and to maintain the proof going forward. I have a number of such suggestions. Often, each case occurs many times throughout your PR, and I have said so: please try to look for other occurrences and fix those as well. Thank you!
Let me emphasize that most of these comments should be quick to address, and will make it easier to review the code in more detail.
grunweg
left a comment
There was a problem hiding this comment.
Thanks for your changes - it's generally moving in the right direction. (I think the many different variable lines can be cleaned up a bit, but if needed I can take a pass at that.)
I have a few more comments. Some of them are pointing at previous comments of mine - can you check that you took a look at them all?
grunweg
left a comment
There was a problem hiding this comment.
Some more comments. Trying them locally, something breaks --- so be careful to test that each of your changes is fine. (Perhaps make changes outside instances first; those should be safe.)
The fact that "something breaks" is a warning sign; there'll be the need to debug why. I won't have time for that this week, and fixing some style issues first is a good idea in any case.
| (φ : E x →L[ℝ] E x →L[ℝ] ℝ) | ||
| (hpos : ∀ v, 0 ≤ φ v v) | ||
| (hsymm : ∀ u v, φ u v = φ v u) | ||
| (hdef : ∀ v, φ v v = 0 → v = 0) | ||
| (u v : VectorSpaceAux x φ hpos hsymm hdef) : | ||
| u = v ↔ u.val = (v.val : E x) := by |
There was a problem hiding this comment.
Please indent these lines like so (likewise below)
| (φ : E x →L[ℝ] E x →L[ℝ] ℝ) | |
| (hpos : ∀ v, 0 ≤ φ v v) | |
| (hsymm : ∀ u v, φ u v = φ v u) | |
| (hdef : ∀ v, φ v v = 0 → v = 0) | |
| (u v : VectorSpaceAux x φ hpos hsymm hdef) : | |
| u = v ↔ u.val = (v.val : E x) := by | |
| (φ : E x →L[ℝ] E x →L[ℝ] ℝ) | |
| (hpos : ∀ v, 0 ≤ φ v v) | |
| (hsymm : ∀ u v, φ u v = φ v u) | |
| (hdef : ∀ v, φ v v = 0 → v = 0) | |
| (u v : VectorSpaceAux x φ hpos hsymm hdef) : | |
| u = v ↔ u.val = (v.val : E x) := by |
All of these are hypotheses for the lemma, or the lemma statement. If the whole statement spans multiple lines, they should be indented by four spaces (or four plus x, if there is further indentation of x required).
There was a problem hiding this comment.
Like this a0e3c66? Then I should do the same for the other lemmas in this section?
There was a problem hiding this comment.
Please also indent the u = v ↔ u.val = (v.val : E x) := by line.
With that fixes: yes, please do the same for the other lemmas in the section.
|
Thanks; this is going into the right direction. Feel free to write a comment once you have addressed all comments; then I can take a look again. |
| (h_sub : f.IsSubordinate (fun x ↦ (trivializationAt F E x).baseSet ∩ (chartAt HB x).source)) : | ||
| ContMDiff IB (IB.prod 𝓘(ℝ, F →L[ℝ] F →L[ℝ] ℝ)) ∞ |
There was a problem hiding this comment.
Indentation is wrong here.
| (p : B) (u v : E p) : | ||
| g_global_bilin (F := F) (E := E) f p u v = | ||
| g_global_bilin_aux (F := F) f p u v := by | ||
| have : g_global_bilin (F := F) (E := E) f p = g_global_bilin_aux (F := F) f p := by |
There was a problem hiding this comment.
Suffices would be better than a long have here.
| (hf : f.IsSubordinate (fun x ↦ (trivializationAt F E x).baseSet ∩ (chartAt HB x).source)) | ||
| [∀ x, FiniteDimensional ℝ (E x)] (b : B) : | ||
| Bornology.IsVonNBounded ℝ |
There was a problem hiding this comment.
Indentation is wrong here.
The final normed-fibre dependency (isVonNBounded_of_posDef) remains pending a TVS generalisation of BilinearFormBounded.
✅ PR Title Formatted CorrectlyThe title of this PR has been updated to match our commit style conventions. |
grunweg
left a comment
There was a problem hiding this comment.
Thanks, this PR is definitely making progress. The next step (in my opinion) is to split out pieces that can be reviewed independently. For instance, inCoordinates_apply_eq₂_spec and inCoordinates_apply_eq₂_spec_symm should move to a more basic file, and could be a preliminary PR.
(I'll also note that you have a handful of yet unaddressed small review comments.)
| 0 < ((g_bilin_2 F i b).toFun v).toFun v := by | ||
| unfold g_bilin_2 | ||
| simp only [AddHom.toFun_eq_coe, LinearMap.coe_toAddHom, ContinuousLinearMap.coe_coe] | ||
| letI χ := trivializationAt F E i |
There was a problem hiding this comment.
Inline this, please --- the proof gets slightly shorter without :-)
|
|
||
| noncomputable section | ||
|
|
||
| lemma inCoordinates_apply_eq₂_spec |
There was a problem hiding this comment.
Can you move this lemma and the next to a more basic file? They apply more broadly than Riemannian metrics.
Using a partition of unity, we prove the existence of a smooth Riemannian metric.
The idea is that there are two equivalent ways of defining a bilinear positive definite form:
Falong the inverse trivialization;F, then apply the inner product there.Definition (1) makes smoothness straightforward: locally the form is smooth, provided the domain is taken small enough: the intersection of the trivialization's base set with the chart source. Global smoothness then follows from a partition of unity.
It is less clear (to me at least) how to get positive-definiteness from (1). This is what (2) is for: with vectors pushed forward into an inner product space, positivity, definiteness and symmetry are immediate. We prove the two definitions agree, transferring these properties back to (1).
One step remains. Mathlib's
ContMDiffRiemannianMetricrequires the the set where the form is less than 1 to be von Neumann bounded:Let$E$ be a real vector bundle over a manifold $B$ , with model fiber $F$ , an inner product space; $E_b$ the fiber over $b \in B$ and $e_i : E_b \to F$ the fiberwise linear isomorphism onto the model fiber given by the trivialization $i$ , and $|\cdot|$ the norm on $F$ . Let ${f_i}_{i \in B}$ be a smooth partition of unity subordinate to the trivialization domains. Then the set ${v \in E_b : g_b(v,v) < 1}$ is bounded, where $g_b(v,v) = \sum_i f_i(b), |e_i v|^2$ .
Since the$f_i(b)$ sum to $1$ , at least one is positive; fix such an $i$ , so $f_i(b) > 0$ , and write $e := e_i$ . Because $f_i(b) > 0$ , the point $b$ lies in the support of $f_i$ , and subordinacy places that support inside the small set where the trivialization $e$ is available.
For any$v$ in our set, the single $i$ -th term is at most the whole sum: $f_i(b) |e v|^2 \le g_b(v,v) \lt 1$ .
Since$f_i(b) > 0$ , we can divide to obtain
Setting$r = {1}/{f_i(b)}$ , every $v$ in our set satisfies $e v \in \overline{B}_F!\big(0, r\big)$ , and since $v = e^{-1}(e v)$ lies in $e^{-1}$ of that closed ball. Our set is therefore contained in the image of a bounded ball under the continuous linear map $e^{-1}$ . That image is bounded (continuous linear maps preserve boundedness), and a subset of a bounded set is bounded.