The Dunford-Pettis Theorem (see Uniform Integrability Wiki) states that:
A class of random variables $X_n \in L^1(\mu)$ is Uniformly Integrable if and only if it is relatively weakly compact.
Now $X_n \in L^1(\mu)$ means that $\sup_n \int_\mathbb{X} |X_n(x)| \mu(dx) < \infty$.
A family $\mathcal{X}$ is relatively weakly compact if for every sequence $\{X_n\}$ in $\mathcal{X}$ there exist a subsequence $\{X_{\tilde{n}}\}$ and $X_* \in \mathcal{L}^1(\mu)$ such that
$$ \lim_{\tilde n} \int_A X_{\tilde n}(x) \mu(d x) = \int_A X_*(x) \mu(dx) \quad \forall A \subseteq \mathbb{X} \ s.t. \int_A \mu(dx) > 0 $$
Given $Y: \mathbb{R}^m \times \mathbb{X} \rightarrow \mathbb{R}_{\geq 0} $ continuous in the first argument, locally bounded in the second, is the family $\{ Y(n,\cdot) \}_{n \in \mathcal{N}}$, $Y(n,\cdot) \in L^1(\mu)$, being $\mathcal{N}$ is compact, “relatively weakly compact”?
This is not true.
(First, notational gripe: To everyone else in the world, “$X_n \in L^1(\mu)$” means “for each $n$, $\int |X_n|\,d\mu < \infty$” – it doesn’t say anything about the supremum of the integrals. The right word for having $\sup_n \int|X_n|\,d\mu < \infty$ is to say that the $X_n$ are “bounded in $L^1$”. And it’s really weird to use $n$ as a parameter ranging over an arbitrary (compact) subset of $\mathbb{R}^k$ (not necessarily integers), and most people would denote such a set by a letter like $K$ instead of $\mathcal{N}$ (which looks like Baire space).)
Let’s first see why we should not expect it to be true. The assumption that $Y$ is continuous in its first argument says that if $t_n \to t$, then $Y(t_n, \cdot) \to Y(t,\cdot)$ pointwise. If we wanted to take advantage of something like “continuous image of compact set is compact”, we would want instead something like $Y(t_n, \cdot) \to Y(t, \cdot)$ weakly in $L^1$, which is a very different assumption. In particular, thanks to Dunford-Pettis, we would want $\{Y(t_n, \cdot)\}$ to be uniformly integrable.
So for a counterexample, let’s try to think of a family of functions, each locally bounded, that converges pointwise but is not uniformly integrable. If they were uniformly integrable then the Vitali convergence theorem would say they would also converge in $L^1$, so we want that to fail. There are two main ways that a family of functions can converge pointwise but not in $L^1$: they can squeeze mass into sets of tiny measure, or they can push mass off to infinity. Let’s go with the first way, since then we can make an example that lives on a probability space (the second way can only happen in a space of infinite measure).
I am going to take $(\mathbb{X}, \mu)$ to be the unit interval $[0,1]$ with Lebesgue measure. Also, I will take $m=1$ and $K \subset \mathbb{R}^m$ to be the unit interval $[0,1]$ as well, so that I am really just looking for a one-parameter family of measurable functions on $[0,1]$.
Let $f : [0, \infty) \to [0,\infty)$ have the following properties:
$f$ is continuous
$f(0) = 0$
$\int_0^1 f(x)\,dx = 1$
$f = 0$ on $[1, \infty)$.
(For instance, you can just put an appropriate bump inside $(0,1)$).
Set
$$Y(t,x) = \begin{cases} \frac{1}{t} f(\frac{x}{t}), & t > 0 \\
0, & t=0.
\end{cases}$$
It would be helpful to draw a sketch of $Y(t,x)$ as a function of $x$ for several values of $t$. The idea is that $Y(t, \cdot)$ looks like a tall bump of total area 1 supported on the interval $[0, 1/t]$, and as $t \to 0$ the bump is squeezed to a point and winks out altogether.
Clearly, for each $t$, we have that $Y(t, \cdot)$ is a bounded function on $[0,1]$. A quick computation shows $\int_{\mathbb{X}} Y(t,x)\,\mu(dx) = \int_0^1 Y(t,x)\,dx = 1$ for every $t > 0$, and of course $\int_0^1 Y(0,x)\,dx = 0$. In particular $\sup_{t \in K} \int_{\mathbb{X}} |Y(t,x)|\,\mu(dx) = 1 < \infty$, so $\{Y(t, \cdot) : t \in K\}$ is bounded in $L^1$.
Now I claim $Y$ is continuous in $t$; that is, for each $x$, the function $t \mapsto Y(t,x)$ is continuous. Since $f$ is continuous, it is clear that $Y(\cdot, x)$ is continuous at every $t > 0$. Moreover, for every $t < \frac{1}{x}$, we have $Y(t,x) = 0$ (when $x=0$ this holds for every $t$), so in fact we have $\lim_{t \to 0} Y(t,x) = 0 = Y(0,x)$. Thus $Y(\cdot, x)$ is continuous at $t=0$ as well.
So $Y$ satisfies the desired assumptions. But if $\{Y(t, \cdot) : t \in [0,1] \}$ were weakly relatively compact, it would be uniformly integrable (by Dunford-Pettis). Since $Y(t, \cdot) \to Y(0, \cdot)$ pointwise as $t \to 0$, the Vitali convergence theorem would imply that $\int_0^1 Y(t,x)\,dx \to \int_0^1 Y(0,x)\,dx$ as $t\to 0$ which we know is false.
You can also see this directly: take $t_n = 1/n$ or any other sequence converging to 0 (none of whose terms actually equals 0). Suppose there is a subsequence $t_{n_k}$ (which also converges to 0) and an $X^* \in L^1([0,1], \mu)$ such that $\int_A Y(t_{n_k}, x)\,dx \to \int_A X^*(x)\,dx$ for every $A \subset [0,1]$ with positive measure.
Taking $A = \{X^* < 0\}$, since $Y(t_{n_k}, \cdot) \ge 0$ everywhere we have $\int_A Y(t_{n_k}, x)\,dx \ge 0$ and thus $\int_A X^*(x)\,dx \ge 0$. We conclude that $X^* \ge 0$ almost everywhere.
Taking $A = [1/n, 1]$ and noting that $Y(t, \cdot) = 0$ on $A$ as soon as $t < 1/n$, we conclude that $\int_A Y(t_{n_k}, x)\,dx \to 0$ and therefore $\int_A X^*(x)\,dx = 0$. That is, $\int_0^1 1_{[1/n, 1]}(x) X^*(x)\,dx \to 0$. Using monotone convergence we conclude that $\int_0^1 1_{(0,1]}(x) X^*(x) = 0$. Combining this with the fact that $\{0\}$ is a null set and $X^* \ge 0 $ almost everywhere, we conclude $X^* = 0$ almost everywhere.
But taking $A = [0,1]$ and using our assumption that none of the $t_{n_k}$ are zero, we have $\int_A Y(t_{n_k},x)\,dx = 1$ for all $k$. Thus $\int_A X^*(x)\,dx = 1$. This contradicts our conclusion that $X^* = 0$ almost everywhere.