Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

∇⋅E=0\nabla\cdot\mathbf E=0∇⋅E=0 at positive distance from the charges

Proved
CoulombGauss.divergence_electricField_eq_zero_of_not_mem_closure

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 a measurable set and let ρ:R3→R\rho:\mathbb R^3\to\mathbb Rρ:R3→R be integrable on SSS. Let

E(r)=14πε0∫Sρ(r′) r−r′∣r−r′∣3 d3r′\mathbf E(r)=\frac{1}{4\pi\varepsilon_0}\int_S\rho(r')\,\frac{r-r'}{|r-r'|^3}\,d^3r'E(r)=4πε0​1​∫S​ρ(r′)∣r−r′∣3r−r′​d3r′

be the field generated by the charge density ρ\rhoρ on SSS. If rrr does not belong to the closure S‾\overline SS, then E\mathbf EE is differentiable at rrr and

∇⋅E(r)=0.\nabla\cdot\mathbf E(r)=0 .∇⋅E(r)=0.

In the source this is the step "e∈C1(V×Ω)\mathbf e\in C^1(V\times\Omega)e∈C1(V×Ω), hence ∇⋅E0=14πε0∫Ω∇r⋅e dr′=0\nabla\cdot\mathbf E_0=\frac{1}{4\pi\varepsilon_0}\int_\Omega\nabla_{\mathbf r}\cdot\mathbf e\,d\mathbf r'=0∇⋅E0​=4πε0​1​∫Ω​∇r​⋅edr′=0 on VVV", where VVV is disjoint from the charged region.

Formalization Note Integrability of ρ\rhoρ on SSS is the standing assumption under which the field is defined; the charged region is an arbitrary measurable set SSS (the source's Ω\OmegaΩ), and the source's region VVV is replaced by a single point rrr at positive distance from SSS.

Preamble
import Mathlib
import Definitions.Def_CoulombGauss_basic
open MeasureTheory Filter Topology Metric
Formal statement
namespace CoulombGauss
theorem divergence_electricField_eq_zero_of_not_mem_closure (ε₀ : ℝ) (hε₀ : 0 < ε₀)
    (ρ : Vec3 → ℝ) (S : Set Vec3) (hS : MeasurableSet S) (hρ : IntegrableOn ρ S)
    (r : Vec3) (hr : r ∉ closure S) :
    DifferentiableAt ℝ (electricField ε₀ ρ S) r ∧
      divergence (electricField ε₀ ρ S) 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\varepsilon_0ε0​ be a real number with ε0>0\varepsilon_0>0ε0​>0, ρ:R3→R\rho:\mathbb R^3\to\mathbb Rρ:R3→R any function, S⊆R3S\subseteq\mathbb R^3S⊆R3 a Lebesgue-measurable set on which ρ\rhoρ is Lebesgue integrable, and r∈R3r\in\mathbb R^3r∈R3 a point not in the topological closure of SSS. Write E(x)=14πε0∫Sρ(r′) coulombKernel(x,r′) dr′\mathbf E(x)=\frac{1}{4\pi\varepsilon_0}\int_S\rho(r')\,\mathrm{coulombKernel}(x,r')\,dr'E(x)=4πε0​1​∫S​ρ(r′)coulombKernel(x,r′)dr′ with coulombKernel(x,r′)=(∣x−r′∣3)−1(x−r′)\mathrm{coulombKernel}(x,r')=(|x-r'|^3)^{-1}(x-r')coulombKernel(x,r′)=(∣x−r′∣3)−1(x−r′) (zero when x=r′x=r'x=r′). Conclusion: E\mathbf EE is Fréchet differentiable at rrr, and ∑i=02∂iEi(r)=0\sum_{i=0}^2\partial_i\mathbf E_i(r)=0∑i=02​∂i​Ei​(r)=0. Edge cases: SSS may be empty (then E≡0\mathbf E\equiv 0E≡0 and the claim is immediate); SSS need not be bounded or open; ρ\rhoρ is only required to be integrable on SSS, with no continuity or boundedness.

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