In mathematics, Lebesgue's density theorem states that for any Lebesgue measurable set A⊆ℝn, the "density" of A is 0 or 1 at almost every point in ℝn. Additionally, the "density" of A is 1 at almost every point of A. Intuitively, this means that the boundary of A, the set of points in A for which all neighborhoods are partially in A and partially outside A, is of measure zero.
Statement Let μ be the Lebesgue measure on the Euclidean space and A⊆ℝn be a Lebesgue measurable set. Let x∈ℝn and let Bε(x) denote the open ball of radius ε centered at x. Define the density at a point x dA(x)=limε→0μ(A∩Bε(x))μ(Bε(x))
For example, given a square in the plane, the density at every point inside the square is 1, on the edges is 1/2, and at the corners is 1/4. The set of points in the plane at which the density is neither 0 nor 1 is non-empty (the square boundary), but it is of measure zero. The Lebesgue density theorem is a particular case of the Lebesgue differentiation theorem. Thus, this theorem is also true for every finite Borel measure on A⊆ℝn instead of Lebesgue measure, as proven in sections 2.8–2.9 of Federer's Geometric Measure Theory, 1969.
See also Lebesgue differentiation theorem – Mathematical theorem in real analysis
References
This article incorporates material from Lebesgue density theorem on PlanetMath, which is licensed under the Creative Commons Attribution/Share-Alike License.

