Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Newtonian gravitation: point force, fields, potential, symmetric mass distributions

Definition
NewtonGravitation_Defs

by LG · Sep 27, 2026 · Mathlib 0df444a (Lean v4.33.1)

gravitationmathematical-physics

This bundle fixes the objects of Newtonian gravitation used by every statement in the mission. Space is E3=R3\mathbb{E}^3 = \mathbb{R}^3E3=R3 with the Euclidean norm, and G=6.67430×10−11G = 6.67430\times10^{-11}G=6.67430×10−11.

  1. Point force (vector form of the law). For masses m1,m2m_1,m_2m1​,m2​ at positions r1,r2r_1,r_2r1​,r2​,
F21(m1,m2,r1,r2)=−Gm1m2∥r2−r1∥2⋅r2−r1∥r2−r1∥,F_{21}(m_1,m_2,r_1,r_2) = -\frac{G m_1 m_2}{\|r_2-r_1\|^2}\cdot\frac{r_2-r_1}{\|r_2-r_1\|},F21​(m1​,m2​,r1​,r2​)=−∥r2​−r1​∥2Gm1​m2​​⋅∥r2​−r1​∥r2​−r1​​,

the force applied on body 2 by body 1. 2. Point field of a mass MMM at ccc: gM,c(x)=−GM∥x−c∥3(x−c)g_{M,c}(x) = -\dfrac{GM}{\|x-c\|^3}(x-c)gM,c​(x)=−∥x−c∥3GM​(x−c). 3. Point potential of a mass MMM at ccc: VM,c(x)=−GM∥x−c∥V_{M,c}(x) = -\dfrac{GM}{\|x-c\|}VM,c​(x)=−∥x−c∥GM​. 4. Field of a mass distribution μ\muμ (a measure on E3\mathbb{E}^3E3):

gμ(x)=∫−G∥x−y∥3(x−y) dμ(y).g_\mu(x) = \int -\frac{G}{\|x-y\|^3}(x-y)\,d\mu(y).gμ​(x)=∫−∥x−y∥3G​(x−y)dμ(y).
  1. Spherical symmetry: μ∘A−1=μ\mu\circ A^{-1} = \muμ∘A−1=μ for every linear isometry AAA of E3\mathbb{E}^3E3.
  2. Uniform shell σM,a\sigma_{M,a}σM,a​: the surface measure of the unit sphere, pushed forward by u↦auu\mapsto a uu↦au and scaled to total mass M≥0M\ge 0M≥0.
  3. Uniform solid ball βM,R\beta_{M,R}βM,R​: Lebesgue measure on the open ball ∥y∥<R\|y\|<R∥y∥<R, scaled to total mass M≥0M\ge0M≥0.

These are the basic notions in terms of which the shell theorem and its corollaries are stated.

Formalization Note At coincident points the formulas divide by zero; Lean's convention a/0=0a/0 = 0a/0=0 makes the point force and point field equal to 000 there, and the corresponding theorems exclude that case where relevant. A non-integrable Bochner integral is 000. For R≤0R\le 0R≤0 the "uniform ball" is the zero measure; theorems assume positive radii.

Definition code
import Mathlib

open MeasureTheory

namespace NewtonGravitation

/-- Physical space: three-dimensional Euclidean space. -/
abbrev Space := EuclideanSpace ℝ (Fin 3)

/-- The Newtonian constant of gravitation, `G = 6.67430 × 10⁻¹¹ m³ kg⁻¹ s⁻²` (CODATA 2022). -/
noncomputable def G : ℝ := 6.67430e-11

/-- Vector form of Newton's law: the force `F₂₁` applied on body 2 (mass `m₂`, position `r₂`)
exerted by body 1 (mass `m₁`, position `r₁`):
`F₂₁ = -G m₁ m₂ / ‖r₂₁‖² • r̂₂₁`, with `r₂₁ = r₂ - r₁` and `r̂₂₁ = r₂₁ / ‖r₂₁‖`. -/
noncomputable def pointForce (m₁ m₂ : ℝ) (r₁ r₂ : Space) : Space :=
  -(G * m₁ * m₂ / ‖r₂ - r₁‖ ^ 2) • (‖r₂ - r₁‖⁻¹ • (r₂ - r₁))

/-- Gravitational field at `x` of a point mass `M` located at `c`:
`g(x) = -G M / ‖x - c‖³ • (x - c)`. -/
noncomputable def pointField (M : ℝ) (c x : Space) : Space :=
  -(G * M / ‖x - c‖ ^ 3) • (x - c)

/-- Gravitational potential at `x` of a point mass `M` located at `c`: `V(x) = -G M / ‖x - c‖`. -/
noncomputable def pointPotential (M : ℝ) (c x : Space) : ℝ :=
  -(G * M / ‖x - c‖)

/-- Gravitational field at `x` produced by a mass distribution `μ` (a measure on space, giving the
mass of each region): the superposition (integral) of the point-mass fields of its elements,
`g_μ(x) = ∫ -G / ‖x - y‖³ • (x - y) dμ(y)`. -/
noncomputable def gravField (μ : Measure Space) (x : Space) : Space :=
  ∫ y, -(G / ‖x - y‖ ^ 3) • (x - y) ∂μ

/-- A mass distribution is spherically symmetric about the origin if it is invariant under every
linear isometry of space (every rotation and reflection fixing the origin). -/
def IsSphericallySymmetric (μ : Measure Space) : Prop :=
  ∀ A : Space ≃ₗᵢ[ℝ] Space, μ.map A = μ

/-- A uniform spherical shell of total mass `M` and radius `a`, centred at the origin: the surface
measure of the unit sphere, transported to the sphere of radius `a`, normalised to total mass `M`. -/
noncomputable def uniformShell (M : NNReal) (a : ℝ) : Measure Space :=
  ((M : ENNReal) / (volume : Measure Space).toSphere Set.univ) •
    ((volume : Measure Space).toSphere.map (fun u : Metric.sphere (0 : Space) 1 => a • (u : Space)))

/-- A uniform solid ball of total mass `M` and radius `R`, centred at the origin: Lebesgue measure
restricted to the open ball, normalised to total mass `M`. -/
noncomputable def uniformBall (M : NNReal) (R : ℝ) : Measure Space :=
  ((M : ENNReal) / volume (Metric.ball (0 : Space) R)) • volume.restrict (Metric.ball (0 : Space) R)

end NewtonGravitation
Source
Wikipedia, "Newton's law of universal gravitation", revision oldid=1370960529 (https://en.wikipedia.org/w/index.php?title=Newton%27s_law_of_universal_gravitation&oldid=1370960529), sections Modern form, Vector form, Gravity field, Bodies with spatial extent
Read-back

What the Lean code literally says, in plain math · aristotle-harmonic (same agent as drafter; non-blind)

Non-blind read-back. This read-back was written by the same agent that drafted the Lean statements (Aristotle, by Harmonic), at the proposal owner's explicit instruction. It is not independent testimony and must not be treated as a blind audit; an independent read-back is still recommended before submission.

The file declares, in the namespace NewtonGravitation, the following objects. Let E3\mathbb{E}^3E3 be R3\mathbb{R}^3R3 (indexed by three coordinates) with the Euclidean norm ∥⋅∥\|\cdot\|∥⋅∥.

  • GGG is the real number 6.67430×10−116.67430\times10^{-11}6.67430×10−11 (written as the decimal literal 6.67430e-11).
  • For real numbers m1,m2m_1,m_2m1​,m2​ (any sign) and points r1,r2r_1,r_2r1​,r2​, the point force is
F(m1,m2,r1,r2)=−Gm1m2∥r2−r1∥2(∥r2−r1∥−1(r2−r1)).F(m_1,m_2,r_1,r_2) = -\frac{G m_1 m_2}{\|r_2-r_1\|^2}\left(\|r_2-r_1\|^{-1}(r_2-r_1)\right).F(m1​,m2​,r1​,r2​)=−∥r2​−r1​∥2Gm1​m2​​(∥r2​−r1​∥−1(r2​−r1​)).

When r1=r2r_1=r_2r1​=r2​ the divisions by zero evaluate to 000, so F=0F = 0F=0.

  • For a real MMM and points c,xc,xc,x: the point field gM,c(x)=−GM∥x−c∥3(x−c)g_{M,c}(x) = -\frac{GM}{\|x-c\|^3}(x-c)gM,c​(x)=−∥x−c∥3GM​(x−c) (equal to 000 when x=cx=cx=c), and the point potential VM,c(x)=−GM∥x−c∥V_{M,c}(x) = -\frac{GM}{\|x-c\|}VM,c​(x)=−∥x−c∥GM​ (equal to 000 when x=cx=cx=c).
  • For any measure μ\muμ on the Borel sets of E3\mathbb{E}^3E3 (not necessarily finite) and a point xxx, gμ(x)g_\mu(x)gμ​(x) is the Bochner integral ∫−G∥x−y∥3(x−y) dμ(y)\int -\frac{G}{\|x-y\|^3}(x-y)\,d\mu(y)∫−∥x−y∥3G​(x−y)dμ(y); the integrand is 000 at y=xy=xy=x, and if the integrand is not μ\muμ-integrable the value is defined to be 000.
  • A measure μ\muμ is called spherically symmetric if for every linear isometric bijection A:E3→E3A:\mathbb{E}^3\to\mathbb{E}^3A:E3→E3 the image measure A∗μA_*\muA∗​μ equals μ\muμ. The symmetry centre is the origin.
  • For M≥0M\ge0M≥0 and real aaa (any sign), σM,a=Mτ(S2) ϕ∗τ\sigma_{M,a} = \frac{M}{\tau(S^2)}\,\phi_*\tauσM,a​=τ(S2)M​ϕ∗​τ, where τ\tauτ is Mathlib's measure on the unit sphere S2S^2S2 induced from Lebesgue measure (Measure.toSphere, which is 3×3\times3× the Lebesgue measure of the cone over a subset of the sphere), and ϕ(u)=au\phi(u)=a uϕ(u)=au. The division is in the extended nonnegative reals. For a=0a=0a=0 this is MMM times the point mass at 000; for a<0a<0a<0 it is the shell of radius ∣a∣|a|∣a∣.
  • For M≥0M\ge0M≥0 and real RRR, βM,R=Mλ(B(0,R)) λ∣B(0,R)\beta_{M,R} = \frac{M}{\lambda(B(0,R))}\,\lambda|_{B(0,R)}βM,R​=λ(B(0,R))M​λ∣B(0,R)​ where λ\lambdaλ is Lebesgue measure and B(0,R)B(0,R)B(0,R) the open ball; for R≤0R\le0R≤0 the ball is empty and βM,R=0\beta_{M,R}=0βM,R​=0.
Human review
  • Endorsed by Shuze Chen · Oct 8, 2026

    Confirmed by the moderator at approval.

  • Endorsed by LG · Oct 8, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me