Skip to content

feat(ClassicalMechanics): Newtonian point-particle systems - #1612

Open
RaunakChhatwal wants to merge 2 commits into
leanprover-community:masterfrom
RaunakChhatwal:point-particle-system
Open

feat(ClassicalMechanics): Newtonian point-particle systems#1612
RaunakChhatwal wants to merge 2 commits into
leanprover-community:masterfrom
RaunakChhatwal:point-particle-system

Conversation

@RaunakChhatwal

Copy link
Copy Markdown
Contributor

Summary

This PR introduces basic definitions for forces and Newtonian point-particle systems in classical mechanics.

Forces

Adds Force, representing a time-dependent force acting on an object, together with:

  • InternalForce, which additionally records the source of a force
  • InternalForce.reverse, representing the equal-and-opposite force with source and target exchanged
  • netForce, which sums the internal and external forces acting on a given object

Point particles

Adds Particle, consisting of:

  • positive mass
  • a trajectory relative to a reference frame
  • twice-differentiability of the trajectory in inertial frames

and defines the associated:

  • velocity
  • acceleration
  • position in affine absolute space

Particles and forces are indexed by the reference frame in which they are described. This makes the frame dependence explicit in the types and prevents accidentally combining positions, velocities, accelerations, or forces expressed in different frames.

Point-particle systems

Adds PointParticle.System, representing a finite collection of particles in an inertial reference frame, together with internal and external forces.

Newton's laws are encoded as properties of a system:

  • Newton's second law: the net force on each particle equals its mass times its acceleration
  • Newton's third law: internal forces come in equal-and-opposite pairs

The PR also introduces convenient system-level definitions for:

  • particle mass, position, velocity, acceleration, momentum, and kinetic energy
  • internal/external system forces
  • reverse and central internal forces
  • total mass
  • total momentum
  • net external force
  • total kinetic energy

Finally, the new Force and PointParticle.Defs modules are exported from Physlib.lean.

@github-actions github-actions Bot added the medium label Sep 3, 2026
@RaunakChhatwal RaunakChhatwal changed the title feat(ClassicalMechanics): forces and Newtonian point-particle systems feat(ClassicalMechanics): Newtonian point-particle systems Sep 3, 2026
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

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.

  1. Some automated checks will be run on your PR. You can see the results of these checks at the buttom of your PR page. If any of these checks fail, you will need to fix the issues before your PR can be merged. You can learn more about these here, including how to run them locally, which is sometimes quicker than relying on the GitHub Actions. If you have never had a PR merged before, you may have to wait for a reviewer to manually start these checks (this is for security).

  2. A reviewer will look at your PR and may ask you to make changes. This may happen a couple of days after you submit your PR, so you may need to be patient. But it should not be longer than that - if it is please bring it to the attention of the community on the Zulip. The level of review will depend on where your PR is submitted. If it is submitted to ./Physlib or ./QuantumInfo, the review will be more thorough than if it is submitted to ./PhyslibAlpha. You can find out more about what the review process is looking for in our review guidelines. If a reviewer adds an awaiting-author label to your PR, address the review comments, then please remove that label by adding a comment with -awaiting-author. This helps us keep track of reviews.

  3. The reviewer will either approve your PR, or request more changes (in which case we return to step 2). Once your PR is approved, it will be merged by a maintainer, this should happen shortly after approval, though you may get more comments at this stage.

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.

@github-actions github-actions Bot added the t-classical-mechanics Classical mechanics label Sep 3, 2026

@jstoobysmith jstoobysmith left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gave some high level comments to start. I think you should look at the other classical mechanics files to see how they have been done.

variable {d : ℕ} {frame : ReferenceFrame d}

/-- Positive real numbers. -/
notation "ℝ+" => {x : ℝ // 0 < x}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should check, but I think we might already have PosReals defined somewhere

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there is one. For instance, Positive/Ring.lean uses {x : R // 0 < x} directly. I did narrow the SMul instance for R+ to frame.Vector to minimize redundancy.

⟨particle.pos_twice_differentiable h.out |>.left⟩

/-- The particle's velocity. -/
def vel [_h : Fact (Differentiable ℝ particle.pos)] : Time → frame.Vector :=

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would rename to velocity

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, also renamed acc. Though I would like to keep pos abbreviated

-/

/-- A point particle in `frame`. -/
structure Particle (frame : ReferenceFrame d) where

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would copy the structure of QuantumHarmonicOscillator here. Let Particle contain only the mass (definning the system). Then define ConfigurationSpace for the particles position. Then trajectories are maps from Time to ConfigurationSpace.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Particle is supposed to represent the properties (i.e. mass and position over time) of an actual particle. It is not a dynamical system by itself, and especially not the unconstrained one-particle lagrangian system. It's meant to constitute Newtonian particle systems in NewtonianSystem/Defs.lean, and I don't think configuration spaces should be involved in a foundation for newtonian mechanics

-/

/-- A finite system of point particles satisfying Newton's laws. -/
structure System (d : ℕ) where

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would rename this ManyPointParticles or similar, and give it its own directory.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not include "PointParticle" in the name, since that is already the namespace. PointParticle.System should therefore be read as "point-particle system". I moved it to PointParticle/NewtonianSystem/Defs.lean, which is a subfolder of PointParticle because this formalization only applies to point particles and not rigid bodies, continuums, etc.

@jstoobysmith jstoobysmith added the awaiting-author A reviewer has asked the author a question or requested changes label Sep 3, 2026
@RaunakChhatwal

Copy link
Copy Markdown
Contributor Author

I think you should look at the other classical mechanics files to see how they have been done.

I mostly see disjoint examples in ClassicalMechanics and not many composable APIs. This PR introduces core data types like particles, forces, and newtonian systems. This will enable models and constraints to be expressed in terms of particles and forces (like in Pendulum/Defs.lean and Pendulum.lean), rather than having to start from a lagrangian derived in comments.

-awaiting-author

@github-actions github-actions Bot removed the awaiting-author A reviewer has asked the author a question or requested changes label Sep 3, 2026
@jstoobysmith

Copy link
Copy Markdown
Member

Sorry, have been a bit busy. Have reached out to others to see if they can review this. But it will likely be Monday before I can return to this. General comment: I think we could expand some of the module doc-string to include the justification behind the definitions in those files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants