Problem: A convex polygon $\mathcal{P}$ in the plane
is dissected into smaller convex polygons by drawing all of its diagonals.
The lengths of all sides and all diagonals of the polygon $\mathcal{P}$ are rational numbers.
Prove that the lengths of all sides of all polygons
in the dissection are also rational numbers.

Solution: Suppose $AB$ is a side of a polygon in the dissection,
lying on diagonal $XY$, with $X$, $A$, $B$, $Y$ in that order.
Then \[ AB = XY - XA - YB. \]
In this way, we see that it actually just suffices to
prove the result for a quadrilateral.

We present two approaches to this end.

\paragraph{First approach (trig).}
Consider quadrilateral $ABCD$.
There are twelve angles one can obtain using three of its four vertices,
three at each vertex; denote this set of $12$ angles by $S$
Note that:
\begin{itemize}
  \ii The law of cosines implies $\cos \theta \in \QQ$ for each $\theta \in S$.
  \ii Hence, $(\sin \theta)^2 \in \QQ$ for $\theta \in S$.
  (This is because $\sin^2 \theta + \cos^2 \theta = 1$.)
\end{itemize}
We say two angles $\theta_1$ and $\theta_2$ are
\emph{equivalent} if $\frac{\sin \theta_1}{\sin \theta_2} \in \QQ$.
This is the same as saying,
when $\sin\theta_1$ and $\sin\theta_2$ are written in simplest radical form,
the part under the square root is the same.

Now we contend:
\begin{claim*}
  The angles $\angle BAC$, $\angle CAD$, $\angle BAD$ are equivalent.
\end{claim*}
\begin{proof}
  Note that
  \[ \QQ \ni \cos(\angle BAD) = \cos \angle BAC \cos \angle CAD - \sin \angle BAC \sin \angle CAD \]
  so $\angle BAC$ and $\angle CAD$ are equivalent.
  Then
  \[ \sin (\angle BAD) = \sin \angle BAC \cos \angle CAD + \cos \angle BAC \sin \angle CAD \]
  implies $\angle BAD$ is equivalent to those two.
\end{proof}

\begin{claim*}
  The angles $\angle BAD$, $\angle DBA$, $\angle ADB$ are equivalent.
\end{claim*}
\begin{proof}
  Law of sines on $\triangle BAD$.
\end{proof}

Iterating the argument implies that all angles are equivalent.

Now, if $AB$ and $CD$ meet at $E$,
the law of sines on $\triangle AEB$, etc.\ implies the result.

\paragraph{Second approach (barycentric coordinates).}
To do this, we apply barycentric coordinates.
Consider quadrilateral $ABDC$
(note the changed order of vertices),
with $A=(1,0,0)$, $B=(0,1,0)$, $C=(0,0,1)$.
Let $D = (x,y,z)$, with $x+y+z=1$.
By hypothesis, each of the numbers
\begin{align*}
  -a^2yz + b^2(1-x)z + c^2(1-x)y &= AD^2 \\
  a^2(1-y)z + b^2zx + c^2(1-y)x &= BD^2 \\
  -a^2(1-z)y - b^2(1-z)x + c^2xy &= CD^2
\end{align*}
is rational. Let $W = a^2yz + b^2zx + c^2xy$. Then,
\begin{align*}
  b^2z + c^2y &=  AD^2 + W \\
  a^2z + c^2x &= BD^2 + W \\
  a^2y + b^2x &= CD^2 + W.
\end{align*}
This implies that $AD^2 + BD^2 + 2W - c^2 = 2S_C z$ and cyclically
(as usual $2S_C = a^2+b^2-c^2$).
If any of $S_A$, $S_B$, $S_C$ are zero, then we deduce $W$ is rational.
Otherwise, we have that
\[ 1 = x+y+z = \sum_{\text{cyc}} \frac{AD^2 + BD^2 + 2W - c^2}{2S_C} \]
which implies that $W$ is rational,
because it appears with coefficient
$\frac{1}{S_A} + \frac{1}{S_B} + \frac{1}{S_C} \neq 0$
(since $S_{BC} + S_{CA} + S_{AB}$ is actually the area of $ABC$).

Hence from the rationality of $W$,
we deduce that $x$ is rational as long as $S_A \neq 0$, and similarly for the others.
So at most one of $x$, $y$, $z$ is irrational,
but since $x+y+z=1$ this implies they are all rational.

Finally, if $P = \ol{AD} \cap \ol{BC}$
then $AP = \frac{1}{y+z} AD$, so $AP$ is rational too,
completing the proof.

\begin{remark*}
  After the reduction to quadrilateral,
  a third alternate approach goes by quoting Putnam 2018 A6, reproduced below:
  \begin{quote}
  Four points are given in the plane, with no three collinear,
  such that the squares of the $\binom42=6$ pairwise distances are all rational.
  Show that the ratio of the areas between any two of the
  $\binom43=4$ triangles determined by these points is also rational.
  \end{quote}
  If $ABCD$ is the quadrilateral,
  the heights from $C$ and $D$ to $AB$ have rational ratio.
  Letting $P = AC \cap BD$, we see $AP/AB$ can be shown as rational via coordinates, as needed.
\end{remark*}