Skip to content

feat: Gram-Schmidt orthonormalisation for sections of a vector bundle#27024

Open
grunweg wants to merge 28 commits intoleanprover-community:masterfrom
grunweg:gramSchmidt-sections
Open

feat: Gram-Schmidt orthonormalisation for sections of a vector bundle#27024
grunweg wants to merge 28 commits intoleanprover-community:masterfrom
grunweg:gramSchmidt-sections

Conversation

@grunweg
Copy link
Copy Markdown
Contributor

@grunweg grunweg commented Jul 12, 2025

Add a parametrised version of Gram-Schmidt, for sections of a topological vector bundle with a bundle metric.
This will be used to define orthonormal local frames.

From the path towards geodesics and the Levi-Civita connection.
Co-authored-by: Patrick Massot patrickmassot@free.fr


Open in Gitpod

Add gramSchmidt_zero (about gramSchmidt applied to a set of zero vectors),
rename the previous gramSchmidt_zero to gramSchmidt_bot (which is the
correct name anyway).
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jul 12, 2025

PR summary 0ccc06d21e

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference
Mathlib.Topology.VectorBundle.GramSchmidtOrtho (new file) 2018

Declarations diff

+ coe_gramSchmidtBasis
+ coe_gramSchmidtNormedBasis
+ gramSchmidt
+ gramSchmidtBasis
+ gramSchmidtNormed
+ gramSchmidtNormedBasis
+ gramSchmidtNormed_apply_of_orthogonal
+ gramSchmidtNormed_apply_of_orthonormal
+ gramSchmidtNormed_coe
+ gramSchmidtNormed_linearIndependent
+ gramSchmidtNormed_orthonormal
+ gramSchmidtNormed_orthonormal'
+ gramSchmidtNormed_unit_length'
+ gramSchmidtOrthonormalBasis
+ gramSchmidtOrthonormalBasis_apply_of_orthonormal
+ gramSchmidtOrthonormalBasis_coe
+ gramSchmidt_apply
+ gramSchmidt_bot
+ gramSchmidt_def
+ gramSchmidt_def'
+ gramSchmidt_def''
+ gramSchmidt_inv_triangular
+ gramSchmidt_linearIndependent
+ gramSchmidt_mem_span
+ gramSchmidt_ne_zero
+ gramSchmidt_ne_zero_coe
+ gramSchmidt_orthogonal
+ gramSchmidt_pairwise_orthogonal
+ gramSchmidt_zero
+ mem_span_gramSchmidt
+ span_gramSchmidt
+ span_gramSchmidtNormed
+ span_gramSchmidtNormed_range
+ span_gramSchmidt_Iic
+ span_gramSchmidt_Iio
+-+ gramSchmidt_of_orthogonal
-++ gramSchmidtNormed_unit_length
-++ gramSchmidtNormed_unit_length_coe

You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>

## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>

The doc-module for script/declarations_diff.sh contains some details about this script.


No changes to technical debt.

You can run this locally as

./scripts/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).

@grunweg grunweg force-pushed the gramSchmidt-sections branch from 7a2d3c8 to c7cba64 Compare July 12, 2025 09:14
@grunweg grunweg added the t-differential-geometry Manifolds etc label Jul 12, 2025
@mathlib4-dependent-issues-bot mathlib4-dependent-issues-bot added the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Jul 12, 2025
Copy link
Copy Markdown
Contributor

@faenuccio faenuccio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Copy link
Copy Markdown
Contributor

@faenuccio faenuccio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not noticed that a part of this was in #27023, so I made my comments to that PR for this one.

@faenuccio faenuccio added the awaiting-author A reviewer has asked the author a question or requested changes. label Jul 15, 2025
grunweg and others added 4 commits July 15, 2025 13:25
Co-authored-by: Filippo A. E. Nuccio <filippo.nuccio@univ-st-etienne.fr>
Co-authored-by: Filippo A. E. Nuccio <filippo.nuccio@univ-st-etienne.fr>
Copy link
Copy Markdown
Contributor Author

@grunweg grunweg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the detailed review! I just followed most of your suggestions; here are a few comments about some of your questions.


open Finset

namespace VectorBundle
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, and I've seen your changes. But although I agree that having B simply a top. manifold seems ok, having E a top. vector bundle might cause problems when you will need to prove that GS preserves regularity, no?

Co-authored-by: Filippo A. E. Nuccio <filippo.nuccio@univ-st-etienne.fr>
@grunweg grunweg removed the awaiting-author A reviewer has asked the author a question or requested changes. label Jul 15, 2025
@grunweg
Copy link
Copy Markdown
Contributor Author

grunweg commented Jul 15, 2025

This is ready for review again.

@leanprover-community-bot-assistant leanprover-community-bot-assistant added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jul 16, 2025
@leanprover-community-bot-assistant
Copy link
Copy Markdown
Collaborator

This pull request has conflicts, please merge master and resolve them.

@grunweg grunweg removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Jul 16, 2025
@grunweg
Copy link
Copy Markdown
Contributor Author

grunweg commented Jul 17, 2025

CI passes now

Copy link
Copy Markdown
Contributor

@faenuccio faenuccio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, this projection is missing (and should be added).
I don't think that would really help, though --- for topological vector bundles, you rather want a result that applying Gram-Schmidt to continuous sections yields something continuous, don't you? (I've started on this in #27025, but this uncovered some amount of missing basic API. So adding this may require a bit more tedium than I'd like for now.)

I think I did not make myself clear. What I am saying is that if now your assumption is [IsContinuousRiemannianBundle] and you lack IsContMDiffRiemannianBundle.toIsContinuousRiemannianBundle, how can you apply the results in this file to a ContMDiffRiemanianBundle?

@grunweg
Copy link
Copy Markdown
Contributor Author

grunweg commented Jul 30, 2025

You're right, this projection is missing (and should be added).
I don't think that would really help, though --- for topological vector bundles, you rather want a result that applying Gram-Schmidt to continuous sections yields something continuous, don't you? (I've started on this in #27025, but this uncovered some amount of missing basic API. So adding this may require a bit more tedium than I'd like for now.)

I think I did not make myself clear. What I am saying is that if now your assumption is [IsContinuousRiemannianBundle] and you lack IsContMDiffRiemannianBundle.toIsContinuousRiemannianBundle, how can you apply the results in this file to a ContMDiffRiemanianBundle?

Yes, that clarification helped. Are you fine with a "constructive proof"? #27025 applies these results to a C^n Riemannian bundle, and works. (#print axioms gramSchmidtNormed_contMDiff returns "'gramSchmidtNormed_contMDiff' depends on axioms: [propext, Classical.choice, Quot.sound]", i.e. is sorry-free.)

@grunweg grunweg assigned hrmacbeth and sgouezel and unassigned hrmacbeth Jul 31, 2025
Copy link
Copy Markdown
Contributor

@sgouezel sgouezel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you explain a little bit why duplicating the API of InnerProductSpace.gramSchmidt to VectorBundle.gramSchmidt is useful? (That's an honest question: most of the file seems to be just a restatement of preexisting lemmas, but I'm sure you have encountered difficulties when trying to work just with InnerProductSpace.gramSchmidt, which prompted you to this duplication)

/-- The Gram-Schmidt process takes a set of sections as input
and outputs a set of sections which are point-wise orthogonal and have the same span.
Basically, we apply the Gram-Schmidt algorithm point-wise. -/
noncomputable def gramSchmidt (s : ι → (x : B) → E x) (n : ι) : (x : B) → E x :=
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move x left of the colon?


/-- If the section values `s i x` are orthogonal, `gramSchmidt` yields the same values at `x`. -/
theorem gramSchmidt_of_orthogonal (hs : Pairwise fun i j ↦ ⟪s i x, s j x⟫ = 0) :
∀ i₀, gramSchmidt s i₀ x = s i₀ x := by
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move i0 left of the colon?

@faenuccio
Copy link
Copy Markdown
Contributor

faenuccio commented Aug 13, 2025

You're right, this projection is missing (and should be added).
I don't think that would really help, though --- for topological vector bundles, you rather want a result that applying Gram-Schmidt to continuous sections yields something continuous, don't you? (I've started on this in #27025, but this uncovered some amount of missing basic API. So adding this may require a bit more tedium than I'd like for now.)

I think I did not make myself clear. What I am saying is that if now your assumption is [IsContinuousRiemannianBundle] and you lack IsContMDiffRiemannianBundle.toIsContinuousRiemannianBundle, how can you apply the results in this file to a ContMDiffRiemanianBundle?

Yes, that clarification helped. Are you fine with a "constructive proof"? #27025 applies these results to a C^n Riemannian bundle, and works. (#print axioms gramSchmidtNormed_contMDiff returns "'gramSchmidtNormed_contMDiff' depends on axioms: [propext, Classical.choice, Quot.sound]", i.e. is sorry-free.)

I am certainly happy with such a constructive proof! But I confess I do not understand how it can possibly work. EDIT I had a closer look, and it seems to me that in that file at the beginning of the section smoothness you re-introduce all your gadgets (in particular, you declare a variable F : Type* and variable [IsContMDiffRiemannianBundle IB n F E] but the old ones are still in force, so you have both [IsContMDiffRiemannianBundle IB n F E] and [IsContinuousRiemannianBundle F E] in force.

@sgouezel sgouezel added the awaiting-author A reviewer has asked the author a question or requested changes. label Aug 14, 2025
@mathlib4-merge-conflict-bot mathlib4-merge-conflict-bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Sep 15, 2025
@mathlib4-merge-conflict-bot
Copy link
Copy Markdown
Collaborator

This pull request has conflicts, please merge master and resolve them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-author A reviewer has asked the author a question or requested changes. merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) t-differential-geometry Manifolds etc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants