Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Flux of a charged ball through its boundary sphere is Q/ε0Q/\varepsilon_0Q/ε0​

Open
CoulombGauss.sphereFlux_electricField_ball

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

electrostaticsmathematical-physicsvector-calculus

Let ε0>0\varepsilon_0>0ε0​>0, c∈R3c\in\mathbb R^3c∈R3, R>0R>0R>0, and let ρ\rhoρ be integrable and bounded on the open ball BR(c)B_R(c)BR​(c). Let EBR\mathbf E_{B_R}EBR​​ be the field generated by the charge density ρ\rhoρ restricted to BR(c)B_R(c)BR​(c). Then its outward flux through the boundary sphere equals the enclosed charge divided by ε0\varepsilon_0ε0​:

∮∂BR(c)EBR⋅dS=Q(R)ε0,Q(R)=∫BR(c)ρ(r′) d3r′.\oint_{\partial B_R(c)}\mathbf E_{B_R}\cdot d\mathbf S=\frac{Q(R)}{\varepsilon_0},\qquad Q(R)=\int_{B_R(c)}\rho(r')\,d^3r' .∮∂BR​(c)​EBR​​⋅dS=ε0​Q(R)​,Q(R)=∫BR​(c)​ρ(r′)d3r′.

In the source this is the sentence "The RHS is the electric flux generated by a charged sphere, and so Φ(R)=Q(R)/ε0=1ε0∫BR(r0)ρ\Phi(R)=Q(R)/\varepsilon_0=\frac1{\varepsilon_0}\int_{B_R(\mathbf r_0)}\rhoΦ(R)=Q(R)/ε0​=ε0​1​∫BR​(r0​)​ρ".

Formalization Note Boundedness of ρ\rhoρ on the ball guarantees that the field is well defined and integrable on the sphere, where the charges touch it; in the source ρ\rhoρ is continuous on an open set containing the closed ball, which implies it.

Preamble
import Mathlib
import Definitions.Def_CoulombGauss_basic
open MeasureTheory Filter Topology Metric
Formal statement
namespace CoulombGauss
theorem sphereFlux_electricField_ball (ε₀ : ℝ) (hε₀ : 0 < ε₀)
    (ρ : Vec3 → ℝ) (c : Vec3) (R : ℝ) (hR : 0 < R) (hρ : IntegrableOn ρ (ball c R))
    (hbdd : ∃ M : ℝ, ∀ x ∈ ball c R, |ρ x| ≤ M) :
    sphereFlux (electricField ε₀ ρ (ball c R)) c R = (1 / ε₀) * ∫ x in ball c R, ρ x := 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, c∈R3c\in\mathbb R^3c∈R3, and R>0R>0R>0 real. Assume ρ\rhoρ is integrable on the open ball B={x:∣x−c∣<R}B=\{x:|x-c|<R\}B={x:∣x−c∣<R}, and that there is a real MMM with ∣ρ(x)∣≤M|\rho(x)|\le M∣ρ(x)∣≤M for all x∈Bx\in Bx∈B. Let EB(x)=14πε0∫Bρ(r′)x−r′∣x−r′∣3 dr′\mathbf E_B(x)=\frac{1}{4\pi\varepsilon_0}\int_B\rho(r')\frac{x-r'}{|x-r'|^3}\,dr'EB​(x)=4πε0​1​∫B​ρ(r′)∣x−r′∣3x−r′​dr′ (kernel read as 000 at x=r′x=r'x=r′). Conclusion:

R2∫S2⟨EB(c+Ru),u⟩ dσ(u)=1ε0∫Bρ(x) dx,R^2\int_{S^2}\big\langle\mathbf E_B(c+Ru),u\big\rangle\,d\sigma(u)=\frac{1}{\varepsilon_0}\int_B\rho(x)\,dx ,R2∫S2​⟨EB​(c+Ru),u⟩dσ(u)=ε0​1​∫B​ρ(x)dx,

with σ\sigmaσ the cone (surface) measure of total mass 4π4\pi4π on the unit sphere and the convention that a non-integrable integrand integrates to 000. The hypotheses are satisfiable (e.g. ρ\rhoρ constant); no continuity of ρ\rhoρ is assumed.

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