Is this two-dimensional version of the Intermediate Value Theorem correct? Given 1 continuous function $f(x)$ defined on a 1-dimensional interval $[-1,1]$, the IVT says that if:


*

*$f(-1)<0$ and 

*$f(1)>0$ 


then there is an $x$ such that $f(x)=0$.
I am trying to prove the following extension:
Given 2 continuous functions $f(x,y)$ and $g(x,y)$ defined on a 2-dimensional square $[-1,1]\times[-1,1]$, if:


*

*for all $y$: $f(-1,y)<0$ and $f(1,y)>0$ 

*for all $x$: $g(x,-1)<0$ and $g(x,1)>0$


then there are $x,y$ such that $f(x,y)=g(x,y)=0$.
My current "proof" is graphic:

I.e., by the condition on $f$ (green), there must be a connected "wall" (green), separating the west side from the east side, in which $f=0$. Otherwise we could go from $f<0$ to $f>0$ without passing through $f=0$, which is impossible.
Similarly, by the condition on $g$ (red), there must be a connected "wall" separating the north side from the south side, in which $g=0$.
These walls must have an intersection point in which both functions are 0.
MY QUESTIONS ARE:


*

*Is this idea correct?

*If it is correct, how can it be formalized?

*Are there generalizations of this theorem to many dimensions?

 A: In fact, this is the  Poincaré–Miranda theorem. It holds in arbitrary dimensions: Given $n$ continuous functions $f_1\dots f_n$ on $[-1,1]^n$ with $f_i$ being positive on the face with $x_i=-1$ and negative on $x_i=1$.  Then there is a point in the cube, where all these functions simultaneously vanish.
A: It is true but non-trivial and your idea cannot be formalized because the set of points at which $f$ is zero do not at all have to look like what you drew. They could for example be some weird set that looks like blotches, which may even be disconnected or fractal or both.
To prove it, use the 2d Intermediate value theorem, where $f,g$ are the two components of the continuous function from the square to $\mathbb{R}^2$. It is easy to check that that function on the square's boundary winds around $(0,0)$ and hence we are done.
A: Based on an answer by Itai Weiss, I think I can prove the claim.
Suppose by contradiction that the claim is false, i.e. there is no point in $[-1,1]\times[-1,1]$ on which $f=g=0$. We show a continuous function $h(x,y)$ from $[-1,1]\times[-1,1]$ to $[-1,1]\times[-1,1]$ which does NOT have a fixed point, contradicting the Brouwer fixed-point theorem.
Define:
$$h = \frac{-(f,g)}{\max(|f|,|g|)}$$
Because of the assumption, the denominator is always positive, so $h$ is defined and continuous in all of $[-1,1]\times[-1,1]$.
$h$ maps every point in $[-1,1]\times[-1,1]$ to the boundary of $[-1,1]\times[-1,1]$, in particular:


*

*If $|f|\geq|g|$ then $|h_x|=1$ so $h$ is on the left boundary (if $f>0$) or the right boundary (if $f<0$);

*If $|g|\geq|f|$ then $|h_y|=1$ so $h$ is on the bottom boundary (if $g>0$) or the top boundary (if $g<0$).


In particular, this means that $h$ has no fixed point in its interior. We now prove that it has no fixed point in its boundary:


*

*On the left boundary $f<0$, so $h$ goes either to the right boundary (if $|f|\geq|g|$) or to the interior of the top/bottom boundaries (if $|f|<|g|$); in any cas $h$ is not on the left boundary.

*The same is true in the other 3 cases.


Hence, $h$ has no fixed point - a contradiction.
Comments are welcome!
