Riemann Integral of finite rational activation function.

61 Views Asked by At

The Problem

Suppose I have the function $f_k: [0,1] \to \{0,1\}$ defined by $$f_k(x) = \begin{cases} 1 & x \in \{r_1,\dots, r_k\}\\ 0 & \text{otherwise} \end{cases}$$ where each $r_i \in \mathbb{Q}$. I want to show that $f_k$ for all $k$ is Riemann Integrable.

What I tried

For fixed $k \geq 1$, fixed $\epsilon > 0$, and assuming each $r_i$ are in increasing order, I construct the partition $$P = \left\{0, r_1 - \frac{\epsilon}{4k}, r_1 + \frac{\epsilon}{4k}, \dots, r_k - \frac{\epsilon}{4k}, r_k + \frac{\epsilon}{4k}, 1\right\}$$ The lower sum $L(f_k, P) = 0$ clearly, and it is not hard to see that the upper sum \begin{align*} U(f_k, P) &= \sum_{i = 1}^\infty\left[r_i + \frac{\epsilon}{4k} - \left(r_i - \frac{\epsilon}{4k}\right)\right]\\ &= \sum_{i = 1}^\infty\frac{\epsilon}{2k}\\ &= \frac{\epsilon}{2} \end{align*} Clearly from here we have $$U(f_k,P) - L(f_k, P) = \frac{\epsilon}{2} < \epsilon$$ Which proves that $f_k$ is riemann integrable for all $k \geq 1$.

Could I please check if my working is correct?

Extra question

I am able to prove that if we take $k\to \infty$ we have $f_k \to f$ pointwise where $$f(x) = \begin{cases} 1 & x\in \mathbb{Q}\\ 0 & \text{otherwise} \end{cases}$$ I know this function is not riemann integrable because it is the Dirichlet function, but I'm not exactly sure why this is the case. Could someone please explain this to me?

Thanks in advance!