auto-task(RigidBody): add API-map.yaml tracking the Rigid body API - #1339
Conversation
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 |
jstoobysmith
left a comment
There was a problem hiding this comment.
Approved - many thanks. Will merge now.
Summary
Adds
Physlib/ClassicalMechanics/RigidBody/API-map.yaml, a new in-repo tracker for theRigid body API (
Physlib/ClassicalMechanics/RigidBody/). The map is generated from thedirectory's Lean files (
Basic.lean,SolidSphere.lean), with GitHub issue#893 "API: Rigid body" used only
as a reference for the intended scope. No Lean source is touched;
lake buildstays green(a YAML-only change).
The directory has no
API-map.yamlyet and no open PR is adding or editing anAPI-map.yamlanywhere. The two open PRs that touch this directory are #1320 (adds a new
Motion.lean) and#962 (proves
solidSphere_inertiaTensor, against the oldPhysLean/path); neither adds a map,so there is no conflict.
Links below pin commit
843373266f73adaccb4db401c545fdef9810f78eso line numbers are stable.A note on the issue checklist vs. the code
Per the task rules, every
doneflag was decided by reading the code, not by trusting theissue's checkboxes.
- [x](RigidBody defined, mass, centre of mass, moment ofinertia) are all genuinely present and are marked
done: true.- [ ](angular velocity, velocity of the centre of mass,kinetic energy, Euler angles) exist in the directory only as
informal_definition/informal_lemmastubs (no formal declaration), so they are markeddone: false. Inparticular the code's
euler_equationsis an informal statement of Euler's equations ofmotion, which is not the Euler angles the issue asks for.
done: true: the inertia-tensor symmetry lemma, and the solid sphere worked example(definition + mass + centre of mass).
solidSphere_inertiaTensor) but proved withsorry(@[sorryful]), so it isdone: false.TODOin the directory (switchRigidBodyto continuous linear maps) is carried as adone: falserequirement.Field-by-field justification (reviewer tick-box)
Title/OverviewGrounded in the
Basic.leanmodule docstring(
Basic.lean#L11-L25):# Rigid bodies A rigid body is one where the distance and relative orientation between particles does not change. In other words, the body remains undeformed. In this module we will define the basic properties of a rigid body, including - mass - center of mass - inertia tensorand the
SolidSphere.leanmodule docstring(
SolidSphere.lean#L11-L18):# The solid sphere as a rigid body In this module we consider the solid sphere as a rigid body, and compute its mass, center of mass and inertia tensor.The "mass distribution as a linear map" phrasing is the structure field itself
(
Basic.lean#L35-L38):Issue #893: "The key data structure shall be the definition of a Rigid Body specified by its
mass distribution."
ParentAPIsDetermined from the imports/usages.
Basic.leanimports and uses the Space API(
Basic.lean#L8;Space dappears in theRigidBodyfield and incenterOfMass,Basic.lean#L45-L47),and
SolidSphere.leanimports the Space integrals API(
SolidSphere.lean#L8-L9):Issue #893 lists "Parent APIs #854 #855" (Space and Time). Only Space (#854) is actually
imported/used by this directory — there is no
Timeimport or usage — so, taking the code as thesource of truth, only Space is listed.
ReferencesTaken from the
Basic.leanmodule docstring's## Referencessection(
Basic.lean#L23-L24):Matches issue #893: "References — Landau and Lifshitz, Mechanics, Section 32." Not invented.
Requirements
✅
RigidBodyis definedBasic.lean#L35-L38Issue #893: "Key data structure … - [x] is defined".
✅ Total mass
Basic.lean#L42-L43Issue #893: "- [x] The API shall allow the calculation of the total mass of the rigid body."
✅ Centre of mass
Basic.lean#L45-L47Issue #893: "- [x] The API shall allow the calculation of the center of mass of the rigid body."
✅ Moment of inertia (inertia tensor)
Basic.lean#L49-L53Issue #893: "- [x] The API shall allow the calculation of the moment of inertia of the rigid body."
✅ Inertia tensor is symmetric (not in issue; provided by code)
Basic.lean#L55-L63Not in the issue checklist, but a fully-proved lemma in the directory, so
done: true.✅ Solid sphere worked example (definition + mass + centre of mass)
Definition
SolidSphere.lean#L28-L44:Mass = m
SolidSphere.lean#L46-L58:Centre of mass = 0
SolidSphere.lean#L60-L73:Both lemmas are fully proved (no
sorry). Motivated by issue #893: "This API is needed to studymany examples in classical mechanics, for example rigid spheres."
❌ Solid sphere inertia tensor (stated but
sorry)SolidSphere.lean#L75-L80The statement exists but the proof is
sorry(@[sorryful]), so the result is not established →done: false. (Open PR #962 aims to complete this proof.)❌ Angular velocity of rotation
Issue #893: "- [ ] The API shall contain the definition of the angular velocity of rotation of
the rigid body." Only an
informal_lemmastub exists, no formal declaration(
Basic.lean#L90-L94):grep -rn "angularVelocity\|def angular"in the directory returns nothing →done: false.❌ Velocity of the centre of mass
Issue #893: "- [ ] The API shall contain the definition of the velocity of the center of mass of
the rigid body." No such formal declaration exists in the directory (only
centerOfMass, theposition, at
Basic.lean#L45-L47)→
done: false.❌ Kinetic energy
Issue #893: "- [ ] The API shall contain the definition of the kinetic energy of the rigid
body." Only an
informal_definitionstub exists, no formal declaration(
Basic.lean#L65-L68):grepfor a formaldef kineticEnergyreturns nothing →done: false.❌ Euler angles
Issue #893: "- [ ] The API shall contain the definition of Euler angles for a rigid body." No
Euler-angle declaration exists. The only "Euler" content is an informal statement of Euler's
equations of motion (not Euler angles)
(
Basic.lean#L206-L212):→
done: false.❌ Redefine
RigidBodywith continuous linear maps (directory TODO)From the
TODOin the directory(
Basic.lean#L31-L33):Not yet done (the structure field is still
→ₗ[ℝ], not→L[ℝ], atBasic.lean#L38)→
done: false.Verification
ruby -e 'require "yaml"; ...'→ valid YAML; top-level keys are exactlyversion, Title, Overview, ParentAPIs, References, Requirements(no others); 12 requirements,6
done: true, 6done: false. Everydone: truehas a reallocation; everydone: falsehas
location: N/A.done: truedeclaration was confirmed in the source at the pinned SHA (line numbersabove); the working tree matches the SHA for these files (
git diffis empty).done: falseitems confirmed absent as formal declarations viagrepin the directory(
kineticEnergy,angularVelocity,euler/Euler angles), andsolidSphere_inertiaTensorconfirmed to be
@[sorryful]+sorry.lake buildis unaffected — this is a YAML-only addition that cannot enter the Lean buildgraph.
.leanfile, other map, docstring, or the GitHub issue was modified.