When I was doing my graph theory assignment, I came across such a question: And here is my question, Let $G$ be a bipartite graph with bipartition $(A,B)$ where $\lvert A \rvert = \lvert B \rvert = 2n$. Suppose that $\lvert N(X) \rvert \leq \lvert X\rvert$ for every $X \subseteq A$ with $\lvert X \rvert \leq n$, and $\lvert N(Y) \rvert \leq \lvert Y \rvert$ for every $Y \subseteq B$ with $\lvert Y \rvert \leq n$. Prove that $G$ has a perfect matching.
I know that to prove a graph has a perfect matching, we have to show that for each subset $S$ on either side, we must have $\lvert N(S) \rvert \geq \lvert S \rvert$, but I just don't know how to expand the conditions given in the question to every subsets required in the proof. I would appreciate it if you could offer some help!