feat(ClassicalMechanics): add geometric kinetic energy for the harmonic oscillator#1369
Conversation
|
Thank you for this PR, which will now be reviewed. If submitting to ./Physlib or ./QuantumInfo, please see our review guidelines if you are not familiar with the process. You should expect a back and forth with a reviewer before your PR is merged. See also that link for how to add appropriate labels to your PR. The PR will also go through a number of automated checks. You can learn more about these here, including how to run them locally. If you are submitting to ./PhyslibAlpha there will be a lighter review process, though your PR must still pass the automated checks. If you want to bring attention to this PR, please write a message on this thread of the Lean Zulip. Important: If a reviewer adds an |
920d025 to
5d128ba
Compare
|
t-classical-mechanics |
| set_option backward.isDefEq.respectTransparency false | ||
|
|
||
| /-- The Euclidean coordinate model for the harmonic oscillator configuration space. -/ | ||
| abbrev Model := EuclideanSpace ℝ (Fin 1) |
There was a problem hiding this comment.
I think abbreviation is wrong here, I think you should be using local notation.
| /-- The chart-induced continuous linear equivalence from the tangent space at `q` to the | ||
| Euclidean coordinate model. It sends a tangent vector to its coordinate representative in | ||
| `Model`. -/ | ||
| def tangentCoord (q : ConfigurationSpace) : |
There was a problem hiding this comment.
This should likely go in the Basic.lean file
There was a problem hiding this comment.
Along with the results below (they are not about the kinetic energy)
| /-- For a pseudo-Riemannian metric `g` on `Q`, the kinetic-energy function | ||
| `K_g(q, v) = 1 / 2 * g.inner q v v` on the tangent bundle `TQ`. -/ | ||
| noncomputable def geometricKineticEnergy | ||
| (g : PseudoRiemannianMetric |
There was a problem hiding this comment.
I think Mathlib now has RiemannianMetric, so we should probably use this. But should we define an explicit version of this on ConfigurationSpace rather than keeping it a free variable (i.e. move below the definition of the metric).
| /-- The mass-scaled pullback of the Euclidean inner product, as a pseudo-Riemannian metric on | ||
| the oscillator configuration space. -/ | ||
| noncomputable def massPseudoRiemannianMetric (S : HarmonicOscillator) : | ||
| PseudoRiemannianMetric |
There was a problem hiding this comment.
Would probably make this a RiemannianMetric. Also would collapse this down to one line, instead of having the arguments spread across different lines.
fdddc99 to
b52e2a6
Compare
|
Thank you for your comments @jstoobysmith. I hope I have addressed them in the latest commit. I have moved the parts not pertaining to KE into basic.lean. Moving to the mathlib remannian metric required a significant rewrite and a new set of proof obligations, therefore I would appreciate if you could take another look to see if I've done things correctly. I do believe that it was the right design choice to switch as it did not lead to any diamonds, maybe we should rethink physlib's own implementation of the metric in light of this. -awaiting-author |
jstoobysmith
left a comment
There was a problem hiding this comment.
This looks good! We probably actually want such a metric on things like Space aswell. I agree we need to rethink the pseudo-reimannian metric in Physlib.
|
I will try to add a todo with regards to this after scoping out the relevant files. Thank you for your review. |
I add a geometric notion of kinetic energy for the harmonic oscillator in a new file, building on the geometric
ConfigurationSpace. The metric-induced kinetic energy is defined coordinate-free and parametric in any pseudo-Riemannian metric, and I then construct the oscillator's own mass metric and show it reproduces the standard KE formula.Some challenges I ran into:
⟪v, w⟫directly on velocities, which doesn't compile, as Mathlib deliberately withholds inner-product/normed instances fromTangentSpace. I resolved this with an explicit coordinate identificationtangentCoord. I tried installing instances but the instance route creates diamonds.fun_propcouldn't discharge this, because it can't see that the global chart inverse has identity derivative. I added a dedicated lemma establishing exactly that, which collapses the metric to a constant in the chart, after which smoothness is immediate.geometricKineticEnergy(whose type already demands them), and I needed a file-scopedset_option backward.isDefEq.respectTransparency falsefor the tangent≡model identification.Developed with assistance from AI; all mathematics and proofs were reviewed and verified to compile.