# How do we find the largest $\mathcal{F}_n$-measurable random variable $X_n$?

Consider the probability space $$(\Omega,\mathcal{F},\mathbb{P})$$ where $$\Omega=(0,1]$$, $$\mathcal{F}$$ is the Borel $$\sigma$$-field generated by intervals of the form $$(0,\frac{b}{2^n}]$$ with $$b\leq 2^n$$, $$b\in\mathbb{N}$$, or$$\mathcal{F}_n=\bigg\{\bigcup_j\bigg(\frac{a_j}{2^n},\frac{b_j}{2^n}\bigg]\bigg\},$$ and $$\mathbb{P}$$ is the uniform Lebesgue measure. Define the random variable $$Y(\omega)=\frac{1}{\omega}$$.

Definition: On a general probability space $$(\Omega,\mathcal{F},\mathbb{P})$$, a random variable $$X:\Omega\to\mathbb{R}$$ is $$\mathcal{F}$$-measurable if $$\{\omega\in\Omega:X(\omega)\leq x\}\in\mathcal{F}$$ for all $$x\in\mathbb{R}$$.

Let $$X_n$$ be the largest $$\mathcal{F}_n$$-measurable random variable with $$X_n\leq Y$$. What is $$X_1$$ for each $$\omega$$?

My attempt: We have $$\mathcal{F}_1=(0,1/2]\cup (1/2,1]$$ and have to show that $$\{\omega\in\Omega: X_1(\omega)\leq x\}\in\mathcal{F}_1$$.

We also know that $$X_1(\omega)\leq \frac{1}{\omega}$$, where $$\omega\in(0,1]$$.

I struggle a lot on how do to construct such a random variable $$X_1$$? The part that gives me most trouble is the $$\mathcal{F}_1$$-measurability of $$X_1$$, i.e., the collection of $$X_1(\omega)\leq x$$ for each $$x\in\mathbb{R}$$ has to belong in $$\mathcal{F}_1$$.

Let $$B=\left(0,\frac{1}{2}\right]$$. Then $$\mathcal F_1=\{\varnothing, \Omega,B,B^c\}$$. Clearly, $$\mathcal F_1=\sigma(1_B)$$. Therefore, by this theorem, $$X_1$$ is $$f(1_B)$$ for some $$f:\mathbb R\to \mathbb R$$ which is Borel. So, $$X_1(\omega) =\begin{cases}f(1),&\text{if }\omega\in B\\ f(0),& \text{otherwise} \end{cases}$$ So, $$X_1$$ is constant on $$B$$ and $$B^c$$. As $$\inf_{\omega\in B} Y(\omega)=2$$ (which is attained by $$Y$$) and $$X_1\le Y$$ and $$X_1$$ is the largest such function, $$X_1(B)=\{2\}$$ and similarly, $$X_1(B^c)=\{1\}$$. And $$f(x)=x+1$$ is a Borel function that satisfies $$X_1=f(1_B)$$.