Cayley-Menger Determinant for Tetrahedral Validity

Given six non-negative real numbers \( d_{ij} \in \mathbb{R}_{\geq 0} \), representing pairwise edge lengths between four distinct vertices \( \{v_0, v_1, v_2, v_3\} \), we test whether these edge lengths correspond to a realizable tetrahedron in Euclidean 3-space \( \mathbb{R}^3 \).

Define the edge set:

\( E = \{d_{01}, d_{02}, d_{03}, d_{12}, d_{13}, d_{23} \} \)

The Cayley-Menger determinant provides a necessary and sufficient condition for the embeddability of this edge configuration as a non-degenerate tetrahedron. Construct the \(5 \times 5\) symmetric matrix \( M \):

\[ M = \begin{bmatrix} 0 & 1 & 1 & 1 & 1 \\ 1 & 0 & d_{01}^2 & d_{02}^2 & d_{03}^2 \\ 1 & d_{01}^2 & 0 & d_{12}^2 & d_{13}^2 \\ 1 & d_{02}^2 & d_{12}^2 & 0 & d_{23}^2 \\ 1 & d_{03}^2 & d_{13}^2 & d_{23}^2 & 0 \end{bmatrix} \]

Let \( \mathrm{CM}(E) = \det(M) \) be the Cayley-Menger determinant. The squared volume \( V^2 \) of the corresponding 3-simplex is given by:

\[ V^2 = \frac{1}{288} \cdot \mathrm{CM}(E) \]

The tetrahedron is geometrically valid (i.e., can be embedded in \( \mathbb{R}^3 \) with positive volume) if and only if \( \mathrm{CM}(E) > 0 \). A result of zero indicates a degenerate configuration (coplanar or flat), and a negative determinant implies an infeasible edge configuration violating triangle inequalities or metric embeddability.

This determinant-based test operates purely on edge lengths and requires no coordinate embedding, making it a robust tool for applications in discrete geometry, combinatorics, and stochastic sampling of geometric configurations.