Let $G$ be a graph with a single perfect matching $M$.
- Show that $G$ has no alternating cycle,
- Proof that if $G$ is bipartite then $X$ and $Y$ contain a 1-degree vertex.
I know that if $G$ has an alternating cycle $C$ then I would be able to define another perfect matching $M - M\cap E(C) + E(C \backslash M)$. So, there is no cycle in $G$.
Since $G$ has no (odd) cycle, then it is a tree. If it is a tree then $G$ contains at least two leafs. Let $v, u \in V(G)$ be leafs. We can consider that $v \in X$, for bipartitins $X$ and $Y$ of $G$.
I'm not sure how to continue to show that $u \in Y$. Can I argue that, since $M$ is a perfect matching, then there is a alternating path from $v$ to $u$ that must be even, and because of that $u \in Y$?
You have to be careful: just because $G$ has no alternating cycle doesn't mean it has no cycle, so it is not necessarily a tree. Consider the following graph:
Here, there is a unique perfect matching (the degree-$1$ vertices force it), but the red edges form a cycle - just not an alternating cycle.
Fortunately, you don't need to know that the graph is a tree. Just take an alternating path of maximal length, and look at its endpoints $u$ and $v$.
First of all, both $u$ and $v$ must have degree $1$. (Otherwise, either you could extend the alternating path, or turn it into an alternating cycle.)
Second, because a perfect matching exists, the single edge out of $u$, and the single edge out of $v$, must both be part of the perfect matching. Therefore $u$ and $v$ are on opposite sides of the bipartition by looking at their parity along the alternating path.