Let Gn be a graph with 2n nodes: a0, a1, ..., an-1, b0, b1, ..., bn-1. Let the edges be formed like this:
Node $a_i$ connects with $b_j$ and $b_k$, where $j = 2i \pmod n$ and $k = (2i + 1) \pmod n$
Prove that every Gn has a perfect match.
For n = 4, we would get this:
where the perfect match would be (a0, b0), (a1, b2), (a2, b1) and (a3, b3).
My attempt:
I wrote some code which performs a greedy algorithm to find a match and for G4 and G5 I see that the output is a perfect match. However, I am not sure how to prove that in math (that there is a perfect match (not necessarily found with the greedy algorithm)).

Observe that for each $i=0,1,\ldots,n-1$, $a_i$ is joined to $b_{2i}$ and $b_{2i+1}$, where the subscripts are taken modulo $n$. This means the degree of vertex $a_i$ is 2 for each $i$.
The degree of vertex $b_i$ is also 2 for each $i$. One way to prove this is to consider the case of even $n$ and odd $n$ separately. Observe that the neighbors of $a_0$ are the first two vertices on the right side, the neighbors of $a_1$ are the next two vertices on the right side, and so on. If $n$ is even, then the vertices $b_{2i}$ and $b_{2i+1}$ have the same set of neighbors, namely $a_i$ and $a_{i+n/2}$. If $n$ is odd, then the argument is only slightly more complicated - some vertex will have the last vertex $b_{n-1}$ and the first vertex $b_0$ as a neighbor.
So the bipartite graph is 2-regular. By Hall's theorem, the graph has a perfect matching.