I have $x_n \to x_0$ and $y_n \to y_0$ as $n \to \infty$. Let $f(x,y)$ be a real-valued function.
Question: Under which conditions do I have
$$f(x_n, y_n) - f(x_0, y_n) \to 0 $$
as $n \to \infty$?
I know two separate conditions, but I was wondering if there were other less restrictive assumptions for the convergence listed above.
Condition 1: There is a neighborhood $\mathcal{B}$ of $y_0$ on which $f(x,y)$ is continuous in $x$ uniformly in $y$, i.e
$$ \sup_{y \in \mathcal{B}} \left|f(x_n, y) - f(x_0, y)\right| \to 0 $$
in which case we have, for $n$ larger enough so that $y_n \in \mathcal{B}$,
$$|f(x_n, y_n) - f(x_0, y_n)| \le \sup_{y \in \mathcal{B}} \left|f(x_n, y) - f(x_0, y)\right| \to 0$$
Alternatively,
Condition 2: $f(x,y)$ is continuous at $(x_0,y_0)$.
We then have, through the triangle inequality,
$$\begin{align}|f(x_n, y_n) - f(x_0, y_n)| &\le |f(x_n, y_n) - f(x_0, y_0)| + |f(x_0, y_n) - f(x_0, y_0)| \to 0 \end{align}$$
Neither condition implies the other. For example, the following condition satisfies Condition 1 but not Condition 2 for $(x_0,y_0) = (0,0)$,
Example 1: $$ f(x,y) = \left\{\begin{align} 1 , & \text{ for } y \in \mathbb{Q}\\ -1 , & \text{ for } y \notin \mathbb{Q} \end{align}\right. $$
while this function satisfies Condition 2 but not Condition 1,
Example 2: $$ f(x,y) = \left\{\begin{align} y, & \text{ for } x \in \mathbb{Q} \\ - y, & \text{ for } x \notin \mathbb{Q} \end{align}\right. $$
Maybe I am missing a more fundamental condition?
This is not amazingly useful, but I've seen in the literature an assumption similar to the following:
That Condition 3 is sufficient can be seenby taking $\{ \delta_n \}$ such that $\delta_n > |y_n - y_0|$ for every $n$.
Clearly Condition 1 implies Condition 3.
Condition 2 also implies Condition 3.
Proof.
First, note that, from the triangle inequality,
$$\begin{align}\sup_{y \in B(y_0,\delta_n)} \left|f(x_n, y) - f(x_0, y)\right| &\le \sup_{y \in B(y_0,\delta_n)} \left|f(x_n, y) - f(x_0, y_0)\right| \\ &+\sup_{y \in B(y_0,\delta_n)} \left|f(x_0, y) - f(x_0, y_0)\right| \end{align}$$
From continuity at $(x_0,y_0)$ both terms can be made arbitrarily small by picking a $n$ large enough.
We can then apply Condition 3 to Example 2.