Let $B \subset \mathbb R^n$ be the unit ball. Consider a Borel measurable set $E \subset B$ with positive Lebesgue measure $|E|>0$ (say $|E| = |B|/2$).
Then, Lebesgue's density theorem, says that for a.e. $x\in E$ $$ \lim_{r \downarrow 0} \frac{|B(x,r)\backslash E|}{|B(x,r)|} = 0. $$
We can restate it as follows: for a.e. $x\in E$, for all $\epsilon>0$ there exists $r_0 = r_0(x, \epsilon)>0$ such that $$ |B(x,r)\backslash E| \leq \epsilon |B(x,r)|, \quad 0<r<r_0(x,\epsilon) . $$ I am particularly interested in the dependence $\epsilon(r, x)$.
I have two questionsa question about this. Probably they haveit has been studied but I have not been able to find any reference.
Let $x$ be the "best possible point" in the density set of $E$. That is, consider $x$ such that $\epsilon(r) = \epsilon(r,x)$ decreases faster in the limit when $r\downarrow 0$. Can we find some upper bound on $\epsilon(r)$? In the best possible case, $\epsilon(r) = 0$ for $r$ smaller than some $r_*$ if $x \in \operatorname{interior}(E)$, but, can we say something about the worst possible case? More details in the edit below
Can we prove some uniformity for $\epsilon$ in a positive measure set (maybe of measure smaller than $|E|$)? That is, proving that there exists $r_*>0$ and $\phi$ nondecreasing with $\phi(0)=0$ such that $$ \epsilon(r,x) \leq \phi(r), \quad r<r_* $$ for all $x \in E_2$ for some Borel set $E_2$ with $0<|E_2|\leq |E|$.
I am specially interested in bounds independent ofGiven $E$, can we prove some uniformity for $\epsilon$ in a positive measure set (if they can existmaybe of measure smaller than $|E|$).
Edit: In the first question I wonder if there exists? That is, can we find some universal $\phi(r)$ nondecreasing$r_*>0$ and $\phi$ continuous with $\phi(0) = 0$$\phi(0)=0$ such that for $$ \epsilon(r,x) \leq \phi(r), \quad 0<r<r_* $$ for all $E$ measurable$x \in \tilde E$ for some Borel set $\tilde E\subset E$ with $|E|=|B|/2$ we have $$ \inf_{x\in B} \lim_{r \downarrow 0} \frac{\epsilon_E(r,x)}{\phi(r)} = 0 . $$$0<|\tilde E|\leq |E|$.
In the second question, I'm interested in finding $\phi$ dependent on $E$. That is, given $E$ showing that there is $E_2$, $r_*$ and $\phi(r)$ (or maybe that they cannot exist)Edit: Initially I had two questions but I have decided to delete one.