refactor(SpaceAndTime): move cmap and cmap_apply to Space/SmoothFunctions - #1599
Conversation
…ions Discharge the relocation TODO in RigidBody/Basic.lean: the test-function constructor `cmap` and its evaluation lemma `cmap_apply` move unchanged from the rigid-body file to the new general file Physlib/SpaceAndTime/Space/SmoothFunctions.lean, under the `Space` namespace. The rigid-body files borrow the two names with a selective `open Space (cmap cmap_apply)`, so every statement and proof is untouched. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FMFfQktaC5pFD1JyETTU4i
|
Thank you for this pull-request (PR). If this is your first PR, welcome to the community! Below is what will happen next. Please read carefully if you are not familiar with the process. You may open other PRs while this one is being reviewed, and can stack PRs on top of each other, so don't let these steps slow you down.
Tip: The easiest way to get have a fast review is to submit a PR that is small and self-contained, and has clear documentation explaining why things are the way they are in your chages. If you have any problems or questions, please reach out to the community on the Zulip. |
jstoobysmith
left a comment
There was a problem hiding this comment.
Looks sensible to me. Approved
This PR discharges the relocation
TODOinPhyslib/ClassicalMechanics/RigidBody/Basic.lean(added following the final review of #1401): the test-function constructorcmapand its evaluation lemmacmap_applymove out of the rigid-body file to a general home inSpaceAndTime/Space/.Changes
Physlib/SpaceAndTime/Space/SmoothFunctions.lean—Space.cmap, the named constructor bundlingf : Space d → ℝtogether with aContDiff ℝ ⊤ fproof as an element ofC^⊤⟮𝓘(ℝ, Space d), Space d; 𝓘(ℝ, ℝ), ℝ⟯, and the@[simp]evaluation lemmaSpace.cmap_apply. Both are the declarations previously inRigidBody/Basic.lean, unchanged except for the namespace (RigidBody→Space) and a light docstring adaptation to the new context.RigidBody/Basic.lean— theTODOand the two moved declarations removed; the direct import ofSpace.Moduleis replaced by the new file (which public-imports it).RigidBody/Basic.lean,Motion.lean,KineticEnergy.lean— each gainsopen Space (cmap cmap_apply), so every statement and proof body is textually unchanged. The selective open borrows exactly the two names without activatingSpace's scoped notations (∇,Δ,𝔁) inside the mechanics files.Physlib.lean— the new file imported, in sorted position.The whole diff is +42/−15; no statement, proof, or simp-set behaviour changes.
Why the move, and not the unbundled
ρThe TODO recorded two options: relocate
cmap, or giveρa version taking an unbundled(f, hf)pair. In the #1401 thread I suggested introducing the unbundled-ρwrapper together with this relocation; on reflection I would rather not add it. Inside proofs the bundled form stays load-bearing — the König and parallel-axis computations work by applyingmap_add/map_smul/map_sumtoρas a linear map onContMDiffMaps — and at statement levelR.ρ (cmap f hf)already is the unbundled spelling, so a dedicateddefwrapping it would be a thin renaming def of the kind dropped at #1353. Happy to add the wrapper here if you still prefer having it.Naming
SmoothFunctions.leandeliberately echoes mathlib'sGeometry/Manifold/Algebra/SmoothFunctions.lean: the mathlib file carries the algebra structure on spaces of smooth maps, ours carries theSpace-specific constructor into that space.Reading order
Physlib/SpaceAndTime/Space/SmoothFunctions.lean(new file, 37 lines), then the removal hunk inRigidBody/Basic.lean; the remaining hunks are one-lineopen/import adjustments.