-
Notifications
You must be signed in to change notification settings - Fork 1.3k
feat: metric connections #36299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
feat: metric connections #36299
Changes from all commits
4dc88fe
419199f
9cc0d58
a412b42
54895ba
403efac
9c8186d
72147d5
efdc73f
4cc7608
c76b337
ff0a1bf
ba399a0
03cb39f
98bd8bb
5ef0c9b
711c141
b0a39e7
7f7b5d8
3de9043
4dcac6e
91d1d2a
dcbeacf
072c4b8
1025438
34c13ed
33e3308
5ae6c25
c14dfac
8241b09
099d895
39119fa
9b3f66f
49bf82d
2f1bbfe
a2e9ee1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,281 @@ | ||||||
| /- | ||||||
| Copyright (c) 2025 Michael Rothgang. All rights reserved. | ||||||
| Released under Apache 2.0 license as described in the file LICENSE. | ||||||
| Authors: Patrick Massot, Michael Rothgang, Heather Macbeth | ||||||
| -/ | ||||||
| module | ||||||
|
|
||||||
| public import Mathlib.Geometry.Manifold.VectorBundle.CovariantDerivative.Basic | ||||||
| public import Mathlib.Geometry.Manifold.VectorBundle.Riemannian | ||||||
| public import Mathlib.Geometry.Manifold.MFDeriv.NormedSpace | ||||||
|
|
||||||
| /-! # Metric connections | ||||||
|
|
||||||
| This file defines connections on a Riemannian vector bundle which are compatible with the ambient | ||||||
| metric. A bundled connection `∇` on a Riemannian vector bundle `(V, g)` is compatible with the | ||||||
| metric `g` if and only if the differentiated metric tensor `∇ g` (defined by | ||||||
| `(X, σ, τ) ↦ ∇_X g(σ, τ) - g(∇_X σ, τ) - g(σ, ∇_X τ)`) vanishes on all differentiable vector fields | ||||||
| `X` and differentiable sections `σ`, `τ`. | ||||||
|
|
||||||
| ## Main definitions and results | ||||||
|
|
||||||
| * `CovariantDerivative.compatibilityTensor`: the tensor | ||||||
| `(X, σ, τ) ↦ X g(σ, τ) - g(∇_X σ, τ) - g(σ, ∇_X τ)` defining when a connection `∇` on a Riemannian | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here you're writing the first derivative as |
||||||
| vector bundle `(V, g)` is compatible with the metric `g`. | ||||||
| * `CovariantDerivative.compatibilityTensor_apply` and | ||||||
| `CovariantDerivative.compatibilityTensor_apply` give formulas for applying the compatibility | ||||||
| tensor at `x` to vector fields and sections which are differentiable at `x`, | ||||||
| resp. to extensions of tangent vectors and sections at `x` to differentiable vector fields and | ||||||
| sections near `x`. | ||||||
| * `CovariantDerivative.IsCompatible`: predicate for a connection to be metric, namely that | ||||||
| `∇` is metric iff its `compatibilityTensor` vanishes | ||||||
|
|
||||||
| ## TODO | ||||||
|
|
||||||
| * When Mathlib has a notion of parallel transport, prove the equivalence of | ||||||
| `CovariantDerivative.IsCompatible` with the characterisation that parallel transport be an | ||||||
| isometry. | ||||||
|
|
||||||
| * Given connections on bundles `V` and `W`, there is an induced connnection on the bundle Hom(V, W). | ||||||
| When this induced connection has been defined in Mathlib, rephrase the definition of | ||||||
| `CovariantDerivative.compatibilityTensor`, to be simply the covariant derivative of the metric | ||||||
| tensor (considered as a section of Hom(V, Hom(V, ℝ))). | ||||||
|
|
||||||
| -/ | ||||||
| open Bundle NormedSpace | ||||||
| open scoped Manifold ContDiff | ||||||
|
|
||||||
| @[expose] public section | ||||||
|
|
||||||
| variable | ||||||
| -- Let `M` be a `C^k` real manifold modeled on `(E, H)` | ||||||
| {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] | ||||||
| {H : Type*} [TopologicalSpace H] (I : ModelWithCorners ℝ E H) | ||||||
| {M : Type*} | ||||||
| -- Let `V` be a bundle over `M`, endowed with a Riemannian metric. | ||||||
| (F : Type*) [NormedAddCommGroup F] [NormedSpace ℝ F] | ||||||
| {V : M → Type*} [TopologicalSpace (TotalSpace F V)] | ||||||
| [∀ x, NormedAddCommGroup (V x)] [∀ x, InnerProductSpace ℝ (V x)] | ||||||
|
|
||||||
| /-! # Compatible connections | ||||||
|
|
||||||
| A connection on `V` is compatible with the metric on `V` iff `X ⟨σ, τ⟩ = ⟨∇_X σ, τ⟩ + ⟨σ, ∇_X τ⟩` | ||||||
| holds for all sufficiently nice vector fields `X` on `M` and sections `σ`, `τ` of `V`. | ||||||
| The left hand side is the pushforward of the function `⟨σ, τ⟩` along the vector field `X`: | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. pushforward sounds strange to me here. |
||||||
| the left hand side at `x` is `df(X x)`, where `f := ⟨σ, τ⟩` (ie. `X` is seen a derivation on | ||||||
| the algebra of function on the base manifold acting on the function `⟨σ, τ⟩`). | ||||||
| In our definition, we ask for this identity to at each `x : M`, whenever `X`, `σ` and `τ` are | ||||||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| differentiable at `x`. | ||||||
| -/ | ||||||
|
|
||||||
| variable {σ σ' σ'' τ τ' τ'' : Π x : M, V x} | ||||||
|
|
||||||
| -- set_option trace.profiler true | ||||||
| -- set_option profiler.threshold 500 | ||||||
|
|
||||||
| /-- The scalar product of two sections. -/ | ||||||
| noncomputable abbrev product (σ τ : Π x : M, V x) : M → ℝ := | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you really want to introduce a new definition, that will then be available throughout Mathlib for everyone? Wouldn't a notation local to the file make more sense? |
||||||
| fun x ↦ inner ℝ (σ x) (τ x) | ||||||
|
|
||||||
| -- `product` is C^k if σ and τ are: this is shown in `Riemannian.lean` | ||||||
|
|
||||||
| local notation "⟪" σ ", " τ "⟫" => product σ τ | ||||||
|
|
||||||
| -- Basic API for the product of two sections. | ||||||
| section product | ||||||
|
|
||||||
| lemma product_apply (x) : ⟪σ, τ⟫ x = inner ℝ (σ x) (τ x) := rfl | ||||||
|
|
||||||
| variable (σ σ' τ) | ||||||
|
|
||||||
| lemma product_swap : ⟪τ, σ⟫ = ⟪σ, τ⟫ := by | ||||||
| ext x | ||||||
| apply real_inner_comm | ||||||
|
|
||||||
| @[simp] | ||||||
| lemma product_zero_left : ⟪0, σ⟫ = 0 := by | ||||||
| ext x | ||||||
| simp only [product, Pi.zero_apply, inner_zero_left] | ||||||
|
|
||||||
| @[simp] | ||||||
| lemma product_zero_right : ⟪σ, 0⟫ = 0 := by rw [product_swap, product_zero_left] | ||||||
|
|
||||||
| lemma product_add_left : ⟪σ + σ', τ⟫ = ⟪σ, τ⟫ + ⟪σ', τ⟫ := by | ||||||
| ext x | ||||||
| simp [product, InnerProductSpace.add_left] | ||||||
|
|
||||||
| @[simp] | ||||||
| lemma product_add_left_apply (x) : ⟪σ + σ', τ⟫ x = ⟪σ, τ⟫ x + ⟪σ', τ⟫ x := by | ||||||
| simp [product, InnerProductSpace.add_left] | ||||||
|
|
||||||
| lemma product_add_right : ⟪σ, τ + τ'⟫ = ⟪σ, τ⟫ + ⟪σ, τ'⟫ := by | ||||||
| rw [product_swap, product_swap τ, product_swap τ', product_add_left] | ||||||
|
|
||||||
| @[simp] | ||||||
| lemma product_add_right_apply (x) : ⟪σ, τ + τ'⟫ x = ⟪σ, τ⟫ x + ⟪σ, τ'⟫ x := by | ||||||
| rw [product_swap, product_swap τ, product_swap τ', product_add_left_apply] | ||||||
|
|
||||||
| @[simp] lemma product_neg_left : ⟪-σ, τ⟫ = -⟪σ, τ⟫ := by ext x; simp [product] | ||||||
|
|
||||||
| @[simp] lemma product_neg_right : ⟪σ, -τ⟫ = -⟪σ, τ⟫ := by ext x; simp [product] | ||||||
|
|
||||||
| lemma product_sub_left : ⟪σ - σ', τ⟫ = ⟪σ, τ⟫ - ⟪σ', τ⟫ := by | ||||||
| ext x | ||||||
| simp [product, inner_sub_left] | ||||||
|
|
||||||
| lemma product_sub_right : ⟪σ, τ - τ'⟫ = ⟪σ, τ⟫ - ⟪σ, τ'⟫ := by | ||||||
| ext x | ||||||
| simp [product, inner_sub_right] | ||||||
|
|
||||||
| lemma product_smul_left (f : M → ℝ) : product (f • σ) τ = f • product σ τ := by | ||||||
| ext x | ||||||
| simp [product, real_inner_smul_left] | ||||||
|
|
||||||
| @[simp] | ||||||
| lemma product_smul_const_left (a : ℝ) : product (a • σ) τ = a • product σ τ := by | ||||||
| ext x | ||||||
| simp [product, real_inner_smul_left] | ||||||
|
|
||||||
| lemma product_smul_right (f : M → ℝ) : product σ (f • τ) = f • product σ τ := by | ||||||
| ext x | ||||||
| simp [product, real_inner_smul_right] | ||||||
|
|
||||||
| @[simp] | ||||||
| lemma product_smul_const_right (a : ℝ) : product σ (a • τ) = a • product σ τ := by | ||||||
| ext x | ||||||
| simp [product, real_inner_smul_right] | ||||||
|
|
||||||
| end product | ||||||
|
|
||||||
| -- These lemmas are necessary as my Lie bracket identities (assuming minimal differentiability) | ||||||
| -- only hold point-wise. They abstract the expanding and unexpanding of `product`. | ||||||
| lemma product_congr_left {x} (h : σ x = σ' x) : product σ τ x = product σ' τ x := by | ||||||
| rw [product_apply, h, ← product_apply] | ||||||
|
|
||||||
| lemma product_congr_left₂ {x} (h : σ x = σ' x + σ'' x) : | ||||||
| product σ τ x = product σ' τ x + product σ'' τ x := by | ||||||
| rw [product_apply, h, inner_add_left, ← product_apply] | ||||||
|
|
||||||
| lemma product_congr_right {x} (h : τ x = τ' x) : product σ τ x = product σ τ' x := by | ||||||
| rw [product_apply, h, ← product_apply] | ||||||
|
|
||||||
| lemma product_congr_right₂ {x} (h : τ x = τ' x + τ'' x) : | ||||||
| product σ τ x = product σ τ' x + product σ τ'' x := by | ||||||
| rw [product_apply, h, inner_add_right, ← product_apply] | ||||||
|
|
||||||
| namespace CovariantDerivative | ||||||
|
|
||||||
| -- Let `cov` be a covariant derivative on `V`. | ||||||
| -- TODO: include in cheat sheet! | ||||||
| variable [TopologicalSpace M] [ChartedSpace H M] [FiberBundle F V] | ||||||
| (cov : CovariantDerivative I F V) | ||||||
|
|
||||||
| /-- Local notation for a covariant derivative on a vector bundle acting on a vector field and a | ||||||
| section. -/ | ||||||
| local syntax "∇" term:arg term : term | ||||||
| local macro_rules | `(∇ $X $σ) => `(fun (x : M) ↦ cov $σ x ($X x)) | ||||||
|
|
||||||
| variable {F} | ||||||
|
|
||||||
| /-- The function defining the compatibility tensor for `∇` w.r.t. `g`: | ||||||
| prefer using `compatibilityTensor` instead -/ | ||||||
| noncomputable def compatibilityTensorAux (σ τ : Π x : M, V x) : | ||||||
| Π (x : M), TangentSpace I x →L[ℝ] ℝ := fun x ↦ | ||||||
| (NormedSpace.fromTangentSpace _).toContinuousLinearMap ∘L mfderiv% ⟪σ, τ⟫ x | ||||||
| - ((innerSL ℝ (τ x)) ∘L (cov σ x)) - ((innerSL ℝ (σ x)) ∘L (cov τ x)) | ||||||
|
|
||||||
| lemma compatibilityTensorAux_apply (σ τ : Π x : M, V x) | ||||||
| {x : M} (X₀ : TangentSpace I x) : | ||||||
| compatibilityTensorAux I cov σ τ x X₀ = | ||||||
| NormedSpace.fromTangentSpace _ (mfderiv% ⟪σ, τ⟫ x X₀) | ||||||
| - inner ℝ (cov σ x X₀) (τ x) - inner ℝ (σ x) (cov τ x X₀) := by | ||||||
| rw [real_inner_comm] | ||||||
| rfl | ||||||
|
|
||||||
| variable [VectorBundle ℝ F V] [IsContMDiffRiemannianBundle I 1 F V] {x : M} | ||||||
|
|
||||||
| theorem compatibilityTensorAux_tensorial₁ (τ : Π x, V x) (hτ : MDiffAt (T% τ) x) : | ||||||
| TensorialAt I F (compatibilityTensorAux I cov · τ x) x where | ||||||
| smul hf hσ := by | ||||||
| ext X₀ | ||||||
| rw [compatibilityTensorAux_apply, product_smul_left, | ||||||
| fromTangentSpace_mfderiv_smul_apply hf (hσ.inner_bundle hτ)] | ||||||
| simp [compatibilityTensorAux_apply, cov.isCovariantDerivativeOn.leibniz hσ hf, inner_add_left, | ||||||
| inner_smul_left] | ||||||
| ring | ||||||
| add hσ hσ' := by | ||||||
| ext X₀ | ||||||
| rw [compatibilityTensorAux_apply, product_add_left, | ||||||
| fromTangentSpace_mfderiv_add_apply (hσ.inner_bundle hτ) (hσ'.inner_bundle hτ)] | ||||||
| simp [compatibilityTensorAux_apply, cov.isCovariantDerivativeOn.add hσ hσ', inner_add_left] | ||||||
| abel | ||||||
|
|
||||||
| theorem compatibilityTensorAux_tensorial₂ (σ : Π x, V x) (hσ : MDiffAt (T% σ) x) : | ||||||
| TensorialAt I F (compatibilityTensorAux I cov σ · x) x where | ||||||
| smul hf hτ := by | ||||||
| ext X₀ | ||||||
| rw [compatibilityTensorAux_apply, product_smul_right, | ||||||
| fromTangentSpace_mfderiv_smul_apply hf (hσ.inner_bundle hτ)] | ||||||
| simp [compatibilityTensorAux_apply, cov.isCovariantDerivativeOn.leibniz hτ hf, inner_add_right, | ||||||
| inner_smul_right] | ||||||
| ring | ||||||
| add hτ hτ' := by | ||||||
| ext X₀ | ||||||
| rw [compatibilityTensorAux_apply, product_add_right, | ||||||
| fromTangentSpace_mfderiv_add_apply (hσ.inner_bundle hτ) (hσ.inner_bundle hτ')] | ||||||
| simp [compatibilityTensorAux_apply, cov.isCovariantDerivativeOn.add hτ hτ', inner_add_right] | ||||||
| abel | ||||||
|
|
||||||
| variable {I} [ContMDiffVectorBundle 1 F V I] in | ||||||
| /-- The tensor `(X, σ, τ) ↦ X g(σ, τ) - g(∇_X σ, τ) - g(σ, ∇_X τ)` defining when a connection | ||||||
| `∇` on a Riemannian bundle `(M, V)` is compatible with the metric `g`. -/ | ||||||
| @[no_expose] noncomputable def compatibilityTensor [FiniteDimensional ℝ F] (x : M) : | ||||||
| V x →L[ℝ] V x →L[ℝ] (TangentSpace I x →L[ℝ] ℝ) := | ||||||
| TensorialAt.mkHom₂ (compatibilityTensorAux I cov · · x) _ | ||||||
| (compatibilityTensorAux_tensorial₁ I cov) (compatibilityTensorAux_tensorial₂ I cov) | ||||||
|
|
||||||
| variable {X : Π x : M, TangentSpace I x} | ||||||
|
|
||||||
| variable {I} [ContMDiffVectorBundle 1 F V I] in | ||||||
| theorem compatibilityTensor_apply [FiniteDimensional ℝ F] (x : M) | ||||||
| (hσ : MDiffAt (T% σ) x) (hτ : MDiffAt (T% τ) x) : | ||||||
| cov.compatibilityTensor x (σ x) (τ x) (X x) = | ||||||
| fromTangentSpace _ (mfderiv% ⟪σ, τ⟫ x (X x)) - ⟪∇ X σ, τ⟫ x - ⟪σ, ∇ X τ⟫ x := by | ||||||
| unfold compatibilityTensor | ||||||
| rw [TensorialAt.mkHom₂_apply _ _ hσ hτ, compatibilityTensorAux_apply] | ||||||
|
|
||||||
| open FiberBundle in | ||||||
| variable {I} [ContMDiffVectorBundle 1 F V I] in | ||||||
| theorem compatibilityTensor_apply_eq_extend [FiniteDimensional ℝ F] (X₀ : TangentSpace I x) | ||||||
| (σ₀ τ₀ : V x) : | ||||||
| cov.compatibilityTensor x σ₀ τ₀ X₀ = | ||||||
| fromTangentSpace _ (mfderiv% ⟪(extend F σ₀), (extend F τ₀)⟫ x X₀) | ||||||
| - inner ℝ (cov (extend F σ₀) x X₀) τ₀ | ||||||
| - inner ℝ σ₀ (cov (extend F τ₀) x X₀) := by | ||||||
| simp [compatibilityTensor, TensorialAt.mkHom₂_apply_eq_extend, compatibilityTensorAux_apply] | ||||||
|
|
||||||
| variable {I} [ContMDiffVectorBundle 1 F V I] in | ||||||
| /-- Predicate saying that a connection `∇` on a Riemannian bundle `(V, g)` is compatible with the | ||||||
| ambient metric, i.e. for all differentiable vector fields `X` on `M` and sections `σ` and `τ` of | ||||||
| `V`, we have `X ⟨σ, τ⟩ = ⟨∇_X σ, τ⟩ + ⟨σ, ∇_X τ⟩`. -/ | ||||||
| def IsCompatible [FiniteDimensional ℝ F] : Prop := compatibilityTensor cov = 0 | ||||||
|
|
||||||
| variable {I} [IsManifold I 1 M] [ContMDiffVectorBundle 1 F V I] | ||||||
|
|
||||||
| open FiberBundle in | ||||||
| lemma isCompatible_iff [FiniteDimensional ℝ F] : | ||||||
| cov.IsCompatible ↔ ∀ {x : M} {X : Π x, TangentSpace I x} {σ τ : (x : M) → V x}, | ||||||
| MDiffAt (T% X) x → MDiffAt (T% σ) x → MDiffAt (T% τ) x → | ||||||
| fromTangentSpace _ (mfderiv% ⟪σ, τ⟫ x (X x)) = ⟪∇ X σ, τ⟫ x + ⟪σ, ∇ X τ⟫ x := by | ||||||
| refine ⟨fun hcov x X σ τ hX hσ hτ ↦ ?_, fun h ↦ ?_⟩ | ||||||
| · have H := congr($hcov x (σ x) (τ x) (X x)) | ||||||
| simp [compatibilityTensor_apply _ _ hσ hτ] at H | ||||||
| linear_combination H | ||||||
| ext x σ₀ τ₀ X₀ | ||||||
| rw [compatibilityTensor_apply_eq_extend] | ||||||
| have h' := h (mdifferentiableAt_extend I E X₀) (mdifferentiableAt_extend I F σ₀) | ||||||
| (mdifferentiableAt_extend I F τ₀) | ||||||
| simp [product] at h' ⊢ | ||||||
| linear_combination h' | ||||||
|
|
||||||
| end CovariantDerivative | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not convinced by this name, because nothing says it's about metrics. Compatibility of covariant derivatives and other objects can make sense, so the name should be more specific.