Density of Borel set at 0 The Lebesgue density theorem says that if $E$ is a Lebesgue measurable set, then the density of $E$ at almost every element of $E$ is 1 and the density of $E$ at almost every element not in $E$ is 0.
However, is it true that for each $t$ strictly between 0 and 1, there is a Borel set $E$ that has density $t$ at 0?
I have no idea how to construct such a set for a random value of $t$.
Any help would be appreciated.
 A: Hint: Let $I_n=(1/(n+1),1/n).$ Let $L_n$ be the length of $I_n.$ Out of $I_n$ we choose a subinterval
$$J_n = (1/(n+1),1/(n+1)+tL_n).$$
$J_n$ is a "$t$-bite" of $I_n.$ Set $E=\cup J_n.$ If I'm thinking about this right, we will have
$$\lim_{r\to 0^+} \frac{m((0,r)\cap E)}{r} = t.$$
A: Yes. In dimension $\geq 2$ this is trivial, so I assume we are looking at the real line.
Given an $n>0$ and $\alpha\in [0,1]$, put $U'_{n,\alpha}=(\frac{1}{n+1},\frac{1}{n+1}+\alpha(\frac{1}{n}-\frac{1}{n+1}))$ and $U_{n,\alpha}=U'_{n,\alpha}\cup -U'_{n,\alpha}$.
Put $U_\alpha=\bigcup_{n\geq 1} U_{n,\alpha}$. Then the density of $U_{n,\alpha}$ at $0$ is exactly $\alpha$. To see this, write $m_r$ for $\frac{\lambda(U_\alpha\cap (-r,r))}{2r}$ and note that:

*

*if $r\in (\frac{1}{n+1},\frac{1}{n+1}+\alpha(\frac{1}{n}-\frac{1}{n+1}))$, then $m_{\frac{1}{n+1}}\leq m_r\leq m_{\frac{1}{n+1}+\alpha(\frac{1}{n}-\frac{1}{n+1})}$

*if $r\in (\frac{1}{n+1}+\alpha(\frac{1}{n}-\frac{1}{n+1}),\frac{1}{n})$, then $m_{\frac{1}{n}}\leq m_r\leq m_{\frac{1}{n+1}+\alpha(\frac{1}{n}-\frac{1}{n+1})}$

*$m_{\frac{1}{n}}=\alpha$,

*$m_{\frac{1}{n+1}+\alpha(\frac{1}{n}-\frac{1}{n+1})}\leq m_{\frac{1}{n+1}}+n\alpha(\frac{1}{n}-\frac{1}{n+1})=\alpha+\frac{\alpha}{n+1}$.

A: Consider a sequence of numbers $r_n \searrow 0$ such that $\frac{r_{n-1}}{r_n} \to 1$.  Let $\theta$ be a measure preserving map from $(0,r_1]$ to $\mathbb R^2$ that takes $(\pi r_{n}^2,\pi r_{n-1}^2] \subset \mathbb R$ to $\{x \in \mathbb R^2: r_n < |x| \le r_{n-1}\}$.  Then let $A$ be a 'piece of pie' centered at the origin in $\mathbb R^2$, with angle $\alpha$ at the corner.  Then $\theta^{-1}(A)$ will be a set with density $\alpha/(4\pi)$ at $0$.
This will give densities $0 \le t \le \frac12$.  To get $\frac12 < t \le 1$, simply add $(-\infty,0]$.
