Question: $G$ is a bipartite graph where $|X| = |Y| = n$ and $|E| \geq n^2 - \frac{2n}{3} + 3$.
$X$ and $Y$ are the set of vertices and $E$ is the set of edges.
Prove that $G$ has a perfect matching.
My approach:
I tried solving the question but when you plug in values like $n=3$, $|E| \geq 9-2+3 \implies |E|\geq10$. How can this be? When $n = 3$, every vertex can be connected to only $3$ other vertices. Therefore maximum number of edges should be $9$ but this is clearly not the case here.
We have to check that $G$ satisfies the conditions of Hall’s Marriage Theorem. Suppose to the contrary, that there exists a subset $W$ of $X$ of size $1\le k\le n$ such that $|N_G(W)|\le k-1$. Then
$$n^2 - \frac{2n}{3} + 3\le |E|\le |W|||N_G(W)|+|X\setminus W||Y|\le$$ $$ k(k-1)+(n-k)n.$$
$$k^2-(n+1)k+\frac{2n}{3}-3\ge 0$$
Since $1\le k\le n$, we have $k^2-(n+1)k\le –n$, so $-n+\frac{2n}{3}-3\ge 0$ and $-n-9\ge 0$, a contradiction.