Skip to content

[Merged by Bors] - feat: metric connections - #36299

Closed
grunweg wants to merge 50 commits into
leanprover-community:masterfrom
grunweg:covariant-derivatives-metric
Closed

grunweg wants to merge 50 commits into
leanprover-community:masterfrom
grunweg:covariant-derivatives-metric

Conversation

@grunweg

@grunweg grunweg commented Mar 6, 2026 •

Copy link
Copy Markdown
Contributor

This file defines what it means for a connection on a Riemannian vector bundle (V, g) to be compatible with the metric g. Namely, the differentiated metric tensor ∇ g (defined by (X, σ, τ) ↦ X g(σ, τ) - g(∇_X σ, τ) - g(σ, ∇_X τ)) should vanish on all differentiable vector fields X and differentiable sections σ, τ.

From the path towards the Levi-Civita connection and Riemannian geometry.

Co-authored-by: Heather Macbeth 25316162+hrmacbeth@users.noreply.github.com
Co-authored-by: Patrick Massot patrickmassot@free.fr


Open in Gitpod

@grunweg grunweg added WIP Work in progress t-differential-geometry Manifolds etc labels Mar 6, 2026
@github-actions

github-actions Bot commented Mar 6, 2026 •

Copy link
Copy Markdown

PR summary f5d014bf4f

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.Geometry.Manifold.VectorBundle.CovariantDerivative.Metric (new file) 2222

Declarations diff (regex)

+ IsMetricCompatible
+ IsMetricCompatible.mvfderiv_inner_eq
+ _root_.VectorBundle.injective_eval_contMDiffAt_sec
+ _root_.VectorBundle.injective_eval_mdifferentiableAt_sec
+ derivMetricTensor
+ derivMetricTensorAux
+ derivMetricTensorAux_apply
+ derivMetricTensor_apply
+ derivMetricTensor_apply_eq_extend
+ isMetricCompatible_iff
+ tensorial_derivMetricTensorAux₁
+ tensorial_derivMetricTensorAux₂

You can run this locally as follows
## from your `mathlib4` directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci

## summary with just the declaration names:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh <optional_commit>

## more verbose report:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh long <optional_commit>

The doc-module for scripts/pr_summary/declarations_diff.sh in the mathlib-ci repository contains some details about this script.

Declarations diff (Lean)

✅ Lean-aware diff — post-build, computed from the Lean environment (commit f5d014b).

  • +9 new declarations
  • −0 removed declarations
+CovariantDerivative.IsMetricCompatible
+CovariantDerivative.IsMetricCompatible.mvfderiv_inner_eq
+CovariantDerivative.derivMetricTensor
+CovariantDerivative.derivMetricTensor.congr_simp
+CovariantDerivative.derivMetricTensor_apply
+CovariantDerivative.derivMetricTensor_apply_eq_extend
+CovariantDerivative.isMetricCompatible_iff
+VectorBundle.injective_eval_contMDiffAt_sec
+VectorBundle.injective_eval_mdifferentiableAt_sec

No changes to strong technical debt.

No changes to weak technical debt.

Current commit f5d014bf4f
Reference commit 96fd0fff3b

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 relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@mathlib-dependent-issues mathlib-dependent-issues Bot added the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Mar 6, 2026
@hrmacbeth hrmacbeth changed the title feat: metric connections on the tangent bundle feat: metric connections Mar 7, 2026
@grunweg

grunweg commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

Could you write down somewhere why you only treat CovariantDerivative and not IsCovariantDerivativeOn?

Sure: in short, we are not aware of any application of such a notion.

You want covariant derivatives on a set e.g. to construct any covariant derivative by gluing. Heather, Patrick and I are not aware of any application of gluing metric connections. (This is also why we don't have the torsion of a connection on a set.) Do you think this is worth a comment in the implementation notes?

Comment thread Mathlib/Geometry/Manifold/VectorBundle/CovariantDerivative/Metric.lean Outdated
Comment thread Mathlib/Geometry/Manifold/VectorBundle/CovariantDerivative/Metric.lean Outdated
Comment thread Mathlib/Geometry/Manifold/VectorBundle/CovariantDerivative/Metric.lean Outdated
@sgouezel sgouezel added the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Jun 10, 2026
grunweg and others added 2 commits June 11, 2026 14:04
…ric.lean

Co-authored-by: Sebastien Gouezel <sebastien.gouezel@univ-rennes1.fr>
@grunweg

grunweg commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review comments, fixed!

@grunweg grunweg removed the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Jun 11, 2026
@grunweg
grunweg requested a review from sgouezel June 11, 2026 12:36
Comment thread Mathlib/Geometry/Manifold/VectorBundle/CovariantDerivative/Metric.lean Outdated
Comment thread Mathlib/Geometry/Manifold/VectorBundle/CovariantDerivative/Metric.lean Outdated
Comment thread Mathlib/Geometry/Manifold/VectorBundle/CovariantDerivative/Metric.lean Outdated
@sgouezel sgouezel added the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Jun 12, 2026
@grunweg

grunweg commented Jun 14, 2026

Copy link
Copy Markdown
Contributor Author

-awaiting-author
All comments addressed again.

@github-actions github-actions Bot removed the awaiting-author Reply -awaiting-author to remove the label on your PR once you have addressed all comments. label Jun 14, 2026
@sgouezel

Copy link
Copy Markdown
Contributor

bors r+
Thanks!

@mathlib-triage mathlib-triage Bot added the ready-to-merge This PR has been sent to bors. label Jun 17, 2026
mathlib-bors Bot pushed a commit that referenced this pull request Jun 17, 2026
This file defines what it means for a connection on a Riemannian vector bundle `(V, g)` to be *compatible* with the metric `g`. Namely, the differentiated metric tensor `∇ g` (defined by `(X, σ, τ) ↦ X g(σ, τ) - g(∇_X σ, τ) - g(σ, ∇_X τ)`) should vanish on all differentiable vector fields `X` and differentiable sections `σ`, `τ`.

From the path towards the Levi-Civita connection and Riemannian geometry.

Co-authored-by: Heather Macbeth [25316162+hrmacbeth@users.noreply.github.com](mailto:25316162+hrmacbeth@users.noreply.github.com)
Co-authored-by: Patrick Massot [patrickmassot@free.fr](mailto:patrickmassot@free.fr)
Co-authored-by: Heather Macbeth <25316162+hrmacbeth@users.noreply.github.com>
Co-authored-by: sgouezel <sebastien.gouezel@univ-rennes1.fr>
Co-authored-by: Patrick Massot <patrickmassot@free.fr>
@grunweg

grunweg commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

Thanks a lot for the reviews, and especially through the last stages of nitpicking/bikeshedding!

@mathlib-bors

mathlib-bors Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors Bot changed the title feat: metric connections [Merged by Bors] - feat: metric connections Jun 17, 2026
@mathlib-bors mathlib-bors Bot closed this Jun 17, 2026
@grunweg
grunweg deleted the covariant-derivatives-metric branch June 17, 2026 21:18
xroblot pushed a commit to xroblot/mathlib4 that referenced this pull request Jun 18, 2026
This file defines what it means for a connection on a Riemannian vector bundle `(V, g)` to be *compatible* with the metric `g`. Namely, the differentiated metric tensor `∇ g` (defined by `(X, σ, τ) ↦ X g(σ, τ) - g(∇_X σ, τ) - g(σ, ∇_X τ)`) should vanish on all differentiable vector fields `X` and differentiable sections `σ`, `τ`.

From the path towards the Levi-Civita connection and Riemannian geometry.

Co-authored-by: Heather Macbeth [25316162+hrmacbeth@users.noreply.github.com](mailto:25316162+hrmacbeth@users.noreply.github.com)
Co-authored-by: Patrick Massot [patrickmassot@free.fr](mailto:patrickmassot@free.fr)
Co-authored-by: Heather Macbeth <25316162+hrmacbeth@users.noreply.github.com>
Co-authored-by: sgouezel <sebastien.gouezel@univ-rennes1.fr>
Co-authored-by: Patrick Massot <patrickmassot@free.fr>
ReemMelamed pushed a commit to ReemMelamed/mathlib4 that referenced this pull request Jun 20, 2026
This file defines what it means for a connection on a Riemannian vector bundle `(V, g)` to be *compatible* with the metric `g`. Namely, the differentiated metric tensor `∇ g` (defined by `(X, σ, τ) ↦ X g(σ, τ) - g(∇_X σ, τ) - g(σ, ∇_X τ)`) should vanish on all differentiable vector fields `X` and differentiable sections `σ`, `τ`.

From the path towards the Levi-Civita connection and Riemannian geometry.

Co-authored-by: Heather Macbeth [25316162+hrmacbeth@users.noreply.github.com](mailto:25316162+hrmacbeth@users.noreply.github.com)
Co-authored-by: Patrick Massot [patrickmassot@free.fr](mailto:patrickmassot@free.fr)
Co-authored-by: Heather Macbeth <25316162+hrmacbeth@users.noreply.github.com>
Co-authored-by: sgouezel <sebastien.gouezel@univ-rennes1.fr>
Co-authored-by: Patrick Massot <patrickmassot@free.fr>
bryangingechen pushed a commit to jcommelin/mathlib4 that referenced this pull request Jun 22, 2026
This file defines what it means for a connection on a Riemannian vector bundle `(V, g)` to be *compatible* with the metric `g`. Namely, the differentiated metric tensor `∇ g` (defined by `(X, σ, τ) ↦ X g(σ, τ) - g(∇_X σ, τ) - g(σ, ∇_X τ)`) should vanish on all differentiable vector fields `X` and differentiable sections `σ`, `τ`.

From the path towards the Levi-Civita connection and Riemannian geometry.

Co-authored-by: Heather Macbeth [25316162+hrmacbeth@users.noreply.github.com](mailto:25316162+hrmacbeth@users.noreply.github.com)
Co-authored-by: Patrick Massot [patrickmassot@free.fr](mailto:patrickmassot@free.fr)
Co-authored-by: Heather Macbeth <25316162+hrmacbeth@users.noreply.github.com>
Co-authored-by: sgouezel <sebastien.gouezel@univ-rennes1.fr>
Co-authored-by: Patrick Massot <patrickmassot@free.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge This PR has been sent to bors. t-differential-geometry Manifolds etc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants