##### 狄利克雷函数
- 狄利克雷函数
- **狄利克雷函数**定义为[[实数]]上划分[[有理数]]和[[无理数]]的[[指示函数]]. 它在每一点上不连续, 是典型的不可[[积分|黎曼积分]]的函数, 可通过[[勒贝格积分]]对其进行分析, 因为有理数 $\mathbb{Q}$ 的勒贝格测度为 $0$ 即[[零测集]]
- $f(x) = \begin{cases} 1, & x \in \mathbb{Q}\\ 0, & x \notin \mathbb{Q}\end{cases}$ , $x\in\mathbb{R}$
>[!example]- 狄利克雷函数
> - 狄利克雷函数
> - $f(x) = \begin{cases} 1, & x \in \mathbb{Q}\\ 0, & x \notin \mathbb{Q}\end{cases}$ , $x\in[0,1]$
> - 黎曼积分
> - 黎曼积分要求函数在积分区间的上积分和下积分必须相等, 在区间 $[0,1]$ 内取划分 $P$, 因为有理数和无理数都在每个子区间 $[x_{i-1}, x_i]$ 中稠密, 所以上下确界分别为 $1,0$
> - $P = \{x_0 = 0, x_1, \ldots, x_n = 1\}$
> - $\displaystyle \sup_{x \in [x_{i-1}, x_i]} f(x) = 1$
> - $\displaystyle \inf_{x \in [x_{i-1}, x_i]} f(x) = 0$
> - 上黎曼和
> - $\displaystyle U(f, P) = \sum_{i=1}^n \sup_{x \in [x_{i-1}, x_i]} f(x) \cdot (x_i - x_{i-1})=1$
> - 下黎曼和
> - $\displaystyle L(f, P) = \sum_{i=1}^n \inf_{x \in [x_{i-1}, x_i]} f(x) \cdot (x_i - x_{i-1})=0$
> - 上积分和下积分不相等, 因此狄利克雷函数 $f$ 在 $[0,1]$ 上不是黎曼可积的
> - $\displaystyle \overline{\int_0^1} f(x) \text{d}x = 1 \neq 0 = \underline{\int_0^1} f(x) \text{d}x$
> - 勒贝格积分
> - 勒贝格积分要求函数是可测函数, 在区间 $[0,1]$ 上, 有理数集是可数的, 它的勒贝格测度为 $0$, 无理数集是不可数的, 它的勒贝格测度为 $1$, 狄利克雷函数是可测的, 通过对函数取值域的测度来进行积分
> - $\displaystyle \int_{[0,1]} f(x) \text{d}\mu = \int_{[0,1]} \chi_{\mathbb{Q}}(x) \text{d}\mu$
> - $\displaystyle \int_{[0,1]} f(x) \text{d}\mu = \int_{\mathbb{Q} \cap [0,1]} 1 \text{d}\mu + \int_{[0,1] \setminus \mathbb{Q}} 0 \text{d}\mu$
> - 狄利克雷函数 $f$ 在 $[0,1]$ 上是勒贝格可积的, 且其勒贝格积分为 $0$
> - $\displaystyle \int_{[0,1]} f(x) \text{d}\mu = 0 + 0 = 0$