[proofplan]
We count the finite incidence set $I$ in two different ways. First we partition $I$ by first coordinate, so each $x \in X$ contributes exactly $a$ incidences. Then we partition $I$ by second coordinate, so each $y \in Y$ contributes exactly $b$ incidences. Since both computations count the same set $I$, the two resulting expressions for $|I|$ are equal.
[/proofplan]
[step:Partition the incidence set by its first coordinate]
For each $x \in X$, define the fibre over $x$ by
\begin{align*}
I_x := \{y \in Y : (x,y) \in I\}.
\end{align*}
By hypothesis, $|I_x| = a$ for every $x \in X$; in particular, this hypothesis forces $a$ to be the nonnegative integer cardinality of each fibre. The sets $\{x\} \times I_x \subset X \times Y$, indexed by $x \in X$, are pairwise disjoint and their union is $I$. Therefore finite additivity of [cardinality](/page/Cardinality) for a finite disjoint union gives $|I| = \sum_{x \in X} |\{x\} \times I_x|$. For each $x \in X$, the map $I_x \to \{x\} \times I_x$ given by $y \mapsto (x,y)$ is a bijection, so $|\{x\} \times I_x| = |I_x|$. Hence
\begin{align*}
|I| = \sum_{x \in X} |I_x| = \sum_{x \in X} a = a|X|.
\end{align*}
[guided]
We first count incidences by asking: for each fixed element $x \in X$, how many elements of $Y$ are incident with it? To make this precise, for each $x \in X$ define the fibre over $x$ by
\begin{align*}
I_x := \{y \in Y : (x,y) \in I\}.
\end{align*}
This is a finite subset of $Y$ because $Y$ is finite. The hypothesis says exactly that every such fibre has cardinality $a$:
\begin{align*}
|I_x| = a \quad \text{for every } x \in X.
\end{align*}
Now we relate these fibres to the full incidence set $I$. Every incidence is an ordered pair $(x,y) \in I$, and it belongs to the set $\{x\} \times I_x$. Conversely, if $(x,y) \in \{x\} \times I_x$, then $y \in I_x$, so by the definition of $I_x$ we have $(x,y) \in I$. Hence
\begin{align*}
I = \bigcup_{x \in X} \bigl(\{x\} \times I_x\bigr).
\end{align*}
The union is disjoint: if $x_1 \ne x_2$, then no ordered pair can have first coordinate both $x_1$ and $x_2$. Since $X$ is finite, finite additivity of [cardinality](/page/Cardinality) for a finite disjoint union applies, and we obtain $|I| = \sum_{x \in X} |\{x\} \times I_x|$. The equality $|\{x\} \times I_x| = |I_x|$ follows from the bijection $I_x \to \{x\} \times I_x$ given by $y \mapsto (x,y)$. Substituting this bijective cardinality equality and then using $|I_x| = a$ for every $x \in X$, we get
\begin{align*}
|I| = \sum_{x \in X} |I_x| = \sum_{x \in X} a = a|X|.
\end{align*}
[/guided]
[/step]
[step:Partition the incidence set by its second coordinate]
For each $y \in Y$, define the fibre over $y$ by
\begin{align*}
J_y := \{x \in X : (x,y) \in I\}.
\end{align*}
By hypothesis, $|J_y| = b$ for every $y \in Y$; in particular, this hypothesis forces $b$ to be the nonnegative integer cardinality of each fibre. The sets $J_y \times \{y\} \subset X \times Y$, indexed by $y \in Y$, are pairwise disjoint and their union is $I$. Therefore finite additivity of [cardinality](/page/Cardinality) for a finite disjoint union gives $|I| = \sum_{y \in Y} |J_y \times \{y\}|$. For each $y \in Y$, the map $J_y \to J_y \times \{y\}$ given by $x \mapsto (x,y)$ is a bijection, so $|J_y \times \{y\}| = |J_y|$. Hence
\begin{align*}
|I| = \sum_{y \in Y} |J_y| = \sum_{y \in Y} b = b|Y|.
\end{align*}
[/step]
[step:Equate the two counts of the same finite set]
The first count gives $|I| = a|X|$, and the second count gives $|I| = b|Y|$. Since both right-hand sides are equal to the cardinality of the same finite set $I$, transitivity of equality yields
\begin{align*}
a|X| = |I| = b|Y|.
\end{align*}
Thus
\begin{align*}
a|X| = b|Y|,
\end{align*}
as required.
[/step]