auto-task(HarmonicOscillator): add API-map.yaml tracking the Harmonic oscillator API#1340
Conversation
… oscillator API Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
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 |
|
Closing this one as there has been an update to this directory, so some of the references are wrong. |
Summary
Adds
Physlib/ClassicalMechanics/HarmonicOscillator/API-map.yaml, a new in-repo tracker for theHarmonic oscillator API (
Physlib/ClassicalMechanics/HarmonicOscillator/). The map isgenerated from the directory's Lean files (
Basic.lean,ConfigurationSpace.lean,Solution.lean), with GitHub issue#846 "API: Configuration space of harmonic oscillator"
used only as a reference for the intended scope. No Lean source is touched;
lake buildstaysgreen (a YAML-only change).
The directory has no
API-map.yamlyet, and no open PR is adding one anywhere in the repository(
gh pr list --state open --limit 1000filtered onAPI-map.yamlreturns nothing). Two open PRstouch this API but neither adds a map: #1329 adds a new
HarmonicOscillator/Geometric/subdirectory, and #1004 edits
ConfigurationSpace.lean(a diffeomorphism feature).Links below pin commit
843373266f73adaccb4db401c545fdef9810f78eso line numbers are stable.A note on the issue vs. the code
Issue #846 is scoped to the configuration space of the oscillator, whereas the directory is the
full harmonic-oscillator API, so the map covers the whole directory and uses #846 as the reference
for the configuration-space portion. Per the task rules, every
doneflag was decided by readingthe code, not by trusting the issue's checkboxes:
value of type Real". The code defines it with a single value of type
EuclideanSpace ℝ (Fin 1)(a one-dimensional real coordinate). Marked
done: truewith the type discrepancy recorded.met: trajectories are valued in the coordinate model
EuclideanSpace ℝ (Fin 1), not inConfigurationSpace. Markeddone: false.issue's last requirement is captured by a separate
done: trueitem; the geometric /Space-API-integrated version it hints at is
done: false, corroborated by two TODOs.Hamiltonian formulations, the TFAE of equations of motion, uniqueness, alternative
initial-condition parametrizations, amplitude-phase normal form, periodicity). These are marked
done: true, each grounded in the module "Key results" docstrings.Field-by-field justification (reviewer tick-box)
Title/OverviewGrounded in the
Basic.leanmodule docstringBasic.lean#L17-L24:and in the
Basic.lean"Key results"Basic.lean#L30-L44(input data, equation of motion, energy conservation, TFAE) and
Solution.lean"Key results"Solution.lean#L20-L23(initial conditions, trajectories). The configuration-space clause is grounded in
ConfigurationSpace.lean#L14-L20.ParentAPIsDetermined from the direct
public imports and their usages:Basic.leanimports both classical-mechanics APIs(
Basic.lean#L8-L9):Both are actually used:
eulerLagrangeOp(
Basic.lean#L488-L492,defined at
EulerLagrange.lean#L31)and
hamiltonEqOp(
Basic.lean#L865-L869,defined at
HamiltonsEquations.lean#L39).ConfigurationSpace.leanimports the Space API(
ConfigurationSpace.lean#L8)and uses
Space 1intoSpace(
ConfigurationSpace.lean#L173-L174):public import Physlib.SpaceAndTime.Space.BasicThis matches issue #846's declared parent APIs #854 ("API: Space"); #863 ("API: Configuration
Space") is not imported as an external API since the configuration space is defined within this
directory.
ReferencesBoth are real citations taken from the directory's own docstrings (no reference is invented):
Basic.lean#L84-L88and identically
Solution.lean#L64-L67:ConfigurationSpace.lean#L42-L44:Requirements
✅
HarmonicOscillatorinput data is definedBasic.lean#L114-L122✅ Configuration space is defined (issue #846 "Key data structure")
ConfigurationSpace.lean#L65-L71Issue #846: "The key data structure ... is the configuration space ... should be defined as a
structure with a single value of type Real. - [ ] Is defined". Confirmed present; the reviewer
should note the coordinate is
EuclideanSpace ℝ (Fin 1)rather than a bareℝ.✅ Smooth-manifold structure on the configuration space (issue #846 requirement)
ConfigurationSpace.lean#L144-L163Issue #846: "- [ ] the structure of a smooth manifold on the configuration space".
✅ Map from configuration space to physical
Space(issue #846 requirement)ConfigurationSpace.lean#L173-L174Issue #846: "- [ ] maps from the configuration space to the actual position of the particle in
Space".
✅ Angular frequency, energies and energy conservation
Energies at
Basic.lean#L193-L203;conservation at
Basic.lean#L633-L641:Grounded in
Basic.lean"Key results"(
Basic.lean#L33-L34).✅ Lagrangian and equation of motion
lagrangianBasic.lean#L336-L340,gradLagrangianBasic.lean#L475-L478,EquationOfMotionBasic.lean#L503-L505:✅ Hamiltonian formulation
toCanonicalMomentumBasic.lean#L687-L700,hamiltonianBasic.lean#L727-L730,hamiltonEqOpBasic.lean#L850-L854:✅ Equivalence (TFAE) of the equations of motion
Basic.lean#L896-L902✅
InitialConditionsis definedSolution.lean#L112-L116✅ Trajectory defined and satisfies the equation of motion
trajectorySolution.lean#L365-L367,trajectory_equationOfMotionSolution.lean#L500-L515:(The docstring names these
trajectories/trajectories_equationOfMotion; the actualdeclarations are
InitialConditions.trajectory/trajectory_equationOfMotion.)✅ Uniqueness of trajectories
Solution.lean#L532-L536✅ Alternative initial-condition parametrizations
Types at
Solution.lean#L172-L178(at time),
#L231-L239(two positions),
#L286-L294(two velocities),
#L782-L786(amplitude-phase). Correctness proofs e.g.
toInitialConditions_trajectory_at_t₀(
#L617-L629).✅ Periodicity and recurrence
periodSolution.lean#L1153-L1159,trajectory_periodic#L1180-L1186,return_time#L1202-L1204:❌ Trajectories defined using the configuration space (issue checked-scope, not met)
Issue #846: "- [ ] Trajectories should be defined using the configuration space". The only
trajectory definition is valued in
EuclideanSpace ℝ (Fin 1), with noConfigurationSpacein itssignature
(
Solution.lean#L365-L367),and
ConfigurationSpaceis never used inSolution.lean(a grep forConfigurationSpacein thatfile returns nothing).
❌ Geometric model / interaction with the Space API (issue + TODOs)
Issue #846: "- [ ] Well defined notion for trajectories, may need interaction with 5e Space
API". Corroborated by two TODOs:
Basic.lean#L98-L102and
ConfigurationSpace.lean#L53-L55❌ Split
Solution.leaninto smaller modules (TODO)Solution.lean#L71-L78TODO "Split this file into smaller modules, keeping `Solution.lean` as an umbrella import. ..."Verification
ruby -e 'require "yaml"; d=YAML.safe_load(File.read(ARGV[0])); raise "bad keys" unless (%w[version Title Overview ParentAPIs References Requirements]-d.keys).empty?'→ passes; thetop-level keys are exactly
version, Title, Overview, ParentAPIs, References, Requirements.done: true, 3done: false), everydone: truehas a non-N/Alocation, and everydone: falsehaslocation: N/A.done: truedeclaration was confirmed to exist by reading the source at commit843373266f73adaccb4db401c545fdef9810f78e(line numbers above); everydone: falseitem wasconfirmed absent (no
ConfigurationSpaceusage inSolution.lean; no geometric-model file;Solution.leannot yet split), grounded in issue API: Configuration space of harmonic oscillator #846 and the in-file TODOs.lake buildis expected to stay green: this is a YAML-only addition and cannot affect the Leanbuild graph. No
.leanfile, other map, docstring, or the GitHub issue was modified.