Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Zero flux through a sphere from charges outside its closed ball

Open
CoulombGauss.sphereFlux_electricField_eq_zero_of_disjoint

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

electrostaticsmathematical-physicsvector-calculus

Let ε0>0\varepsilon_0>0ε0​>0, let S⊆R3S\subseteq\mathbb R^3S⊆R3 be measurable, and let ρ\rhoρ be integrable on SSS. Let c∈R3c\in\mathbb R^3c∈R3 and R>0R>0R>0, and assume

  1. SSS does not meet the closed ball B‾R(c)={x:∣x−c∣≤R}\overline B_R(c)=\{x:|x-c|\le R\}BR​(c)={x:∣x−c∣≤R};
  2. ρ\rhoρ is bounded on SSS near the sphere: there are δ>0\delta>0δ>0 and MMM with ∣ρ(x)∣≤M|\rho(x)|\le M∣ρ(x)∣≤M for all x∈Sx\in Sx∈S with ∣x−c∣<R+δ|x-c|<R+\delta∣x−c∣<R+δ.

Then the field E\mathbf EE generated by ρ\rhoρ on SSS has zero outward flux through the sphere ∂BR(c)\partial B_R(c)∂BR​(c):

∮∂BR(c)E⋅dS=0.\oint_{\partial B_R(c)}\mathbf E\cdot d\mathbf S=0 .∮∂BR​(c)​E⋅dS=0.

This is the source's statement "the flux through a closed surface generated by some charge density outside (the surface) is null", specialised to the spherical surfaces used in the rest of the proof.

Formalization Note The source states the claim for any compact VVV with piecewise smooth boundary disjoint from the charges; only the case V=B‾R(c)V=\overline B_R(c)V=BR​(c) is used later, and a general piecewise-smooth divergence theorem is not available in Mathlib, so the milestone is stated for balls. Hypothesis 2 (boundedness of ρ\rhoρ near the sphere) guarantees that the field is well defined and integrable on the sphere even when the charges accumulate at it; in the source ρ\rhoρ is continuous on an open set containing the sphere, which implies it.

Preamble
import Mathlib
import Definitions.Def_CoulombGauss_basic
open MeasureTheory Filter Topology Metric
Formal statement
namespace CoulombGauss
theorem sphereFlux_electricField_eq_zero_of_disjoint (ε₀ : ℝ) (hε₀ : 0 < ε₀)
    (ρ : Vec3 → ℝ) (S : Set Vec3) (hS : MeasurableSet S) (hρ : IntegrableOn ρ S)
    (c : Vec3) (R : ℝ) (hR : 0 < R) (hdisj : Disjoint S (closedBall c R))
    (hbdd : ∃ δ > 0, ∃ M : ℝ, ∀ x ∈ S, dist x c < R + δ → |ρ x| ≤ M) :
    sphereFlux (electricField ε₀ ρ S) c R = 0 := by sorry
end CoulombGauss
Source
Wikipedia, "Coulomb's law", https://en.wikipedia.org/wiki/Coulomb%27s_law (snapshot supplied as PDF, 30 Sep 2026), section "Relation to Gauss's law" -> "Deriving Gauss's law from Coulomb's law", box "Proof (without Dirac Delta)" (PDF pp. 8-9).
Read-back

What the Lean code literally says, in plain math · Aristotle (Harmonic)

NON-BLIND READ-BACK — NOT INDEPENDENT TESTIMONY. This read-back was written by the same agent that drafted the Lean statements of this proposal (at the explicit direction of the proposal owner), with full knowledge of the source text and of the intended meaning. It is therefore not a blind audit and must not be mistaken for independent testimony. Reviewers should compare the Lean code against the source directly.

Let ε0>0\varepsilon_0>0ε0​>0 be real, ρ:R3→R\rho:\mathbb R^3\to\mathbb Rρ:R3→R any function, S⊆R3S\subseteq\mathbb R^3S⊆R3 a measurable set with ρ\rhoρ integrable on SSS, c∈R3c\in\mathbb R^3c∈R3 and RRR a real number with R>0R>0R>0. Assume SSS and the closed ball {x:∣x−c∣≤R}\{x:|x-c|\le R\}{x:∣x−c∣≤R} have empty intersection, and assume there exist δ>0\delta>0δ>0 and a real MMM such that every x∈Sx\in Sx∈S with ∣x−c∣<R+δ|x-c|<R+\delta∣x−c∣<R+δ satisfies ∣ρ(x)∣≤M|\rho(x)|\le M∣ρ(x)∣≤M. Conclusion: with E(x)=14πε0∫Sρ(r′)x−r′∣x−r′∣3dr′\mathbf E(x)=\frac{1}{4\pi\varepsilon_0}\int_S\rho(r')\frac{x-r'}{|x-r'|^3}dr'E(x)=4πε0​1​∫S​ρ(r′)∣x−r′∣3x−r′​dr′ (kernel read as 000 at x=r′x=r'x=r′),

R2∫S2⟨E(c+Ru), u⟩ dσ(u)=0,R^2\int_{S^2}\big\langle \mathbf E(c+Ru),\,u\big\rangle\,d\sigma(u)=0,R2∫S2​⟨E(c+Ru),u⟩dσ(u)=0,

where σ\sigmaσ is the cone (surface) measure of total mass 4π4\pi4π on the unit sphere S2S^2S2; if this integrand were not integrable the integral would be read as 000. Edge cases: S=∅S=\emptysetS=∅ is allowed; SSS may come arbitrarily close to the sphere (only the closed ball is excluded); the boundedness hypothesis is vacuous for points of SSS farther than R+δR+\deltaR+δ from ccc.

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