-
Notifications
You must be signed in to change notification settings - Fork 84
feat: Uniqueness of variational gradient #614
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
Merged
jstoobysmith
merged 12 commits into
leanprover-community:master
from
lecopivo:lecopivo/has_var_gradient_unique
Jun 19, 2025
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
1141ca3
fix imports and doc strings
lecopivo 27b4ec7
refactor: Lint
jstoobysmith 1ec2367
uniqueness of variational gradient
lecopivo 953ed21
update docs string
lecopivo a8d24ee
fix mistakes while rebasing
lecopivo 48846f1
fix white space
lecopivo ebb4cf9
use semiformal result
lecopivo 27f0a82
remove test code
lecopivo 8d69873
back to `proof_wanted`
lecopivo 6dbbb62
fix linter and recover semiformal_result
lecopivo b786712
fix doc-string
lecopivo d74afcc
refactor: Lint
jstoobysmith File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| /- | ||
| Copyright (c) 2025 Tomas Skrivan. All rights reserved. | ||
| Released under Apache 2.0 license as described in the file LICENSE. | ||
| Authors: Tomas Skrivan, Joseph Tooby-Smith | ||
| -/ | ||
| import Mathlib.MeasureTheory.Integral.Bochner.Basic | ||
| import PhysLean.Mathematics.VariationalCalculus.IsTestFunction | ||
| import PhysLean.Meta.Informal.SemiFormal | ||
| /-! | ||
|
|
||
| # Fundamental lemma of the calculus of variations | ||
|
|
||
| The key took in variational calculus is: | ||
| ``` | ||
| ∀ h, ∫ x, f x * h x = 0 → f = 0 | ||
| ``` | ||
| which allows use to go from reasoning about integrals to reasoning about functions. There are | ||
|
|
||
| -/ | ||
|
|
||
| open MeasureTheory InnerProductSpace | ||
|
|
||
| variable | ||
| {X} [NormedAddCommGroup X] [NormedSpace ℝ X] [MeasurableSpace X] | ||
| {V} [NormedAddCommGroup V] [InnerProductSpace ℝ V] | ||
|
|
||
| lemma fundamental_theorem_of_variational_calculus {f : X → V} | ||
| (μ : Measure X) [IsFiniteMeasureOnCompacts μ] [μ.IsOpenPosMeasure] | ||
| [OpensMeasurableSpace X] | ||
| (hf : IsTestFunction f) (hg : ∀ g, IsTestFunction g → ∫ x, ⟪f x, g x⟫_ℝ ∂μ = 0) : | ||
| f = 0 := by | ||
| have hf' := hg f hf | ||
| rw [MeasureTheory.integral_eq_zero_iff_of_nonneg] at hf' | ||
| · rw [Continuous.ae_eq_iff_eq] at hf' | ||
| · funext x | ||
| have hf'' := congrFun hf' x | ||
| simpa using hf'' | ||
| · have hf : Continuous f := hf.smooth.continuous | ||
| fun_prop | ||
| · fun_prop | ||
| · intro x | ||
| simp only [Pi.zero_apply] | ||
| exact real_inner_self_nonneg | ||
| · apply IsTestFunction.integrable | ||
| exact IsTestFunction.inner hf hf | ||
|
|
||
| /-- The assumption `IsTestFunction f` `in fundamental_theorem_of_variational_calculus` can be | ||
| weakened to `Continuous f`. | ||
|
|
||
| The proof is by contradiction, assume that there is `x₀` such that `f x₀` then you can easily | ||
| construct `g` test function with support on the neighborhood of `x₀` such that `⟪f x, g x⟫ ≥ 0`. -/ | ||
| semiformal_result "FIE3I" fundamental_theorem_of_variational_calculus' {f : X → V} | ||
| (μ : Measure X) [IsFiniteMeasureOnCompacts μ] [μ.IsOpenPosMeasure] | ||
| [OpensMeasurableSpace X] | ||
| (hf : Continuous f) (hg : ∀ g, IsTestFunction g → ∫ x, ⟪f x, g x⟫_ℝ ∂μ = 0) : | ||
| f = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Maybe we could put this in the
ClassicalMechanicsdirectory?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.
Yes this needs to be moved. I'm drafting PR where I show that variational gradient of action are Euler-Lagrange equations. This will be just a corollary.
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.
This will be fixed in #615