Gram determinants of pairs #
The Gram determinant of two vectors, with inner products valued in a commutative ring, is
<u, u> * <v, v> - <u, v> * <v, u>. Over the reals this is
<u, u> * <v, v> - <u, v> ^ 2, the squared area of the parallelogram spanned by the pair and the
denominator in the definition of sectional curvature.
The results here specialize Mathlib's general Gram-matrix API to a pair, exposing the explicit
formula without introducing a second notion of Gram determinant. The real Gram determinant
‖u‖² ‖v‖² - ⟪u, v⟫² of a pair is also differentiated as a function of the pair
(TauCeti.hasStrictFDerivAt_sq_sub_inner_sq); in mechanics it is the squared angular momentum
ℓ² = ‖q‖² ‖p‖² - ⟪q, p⟫² of a phase-space point (q, p). Replacing the pair by
(a q + b p, c q + d p) multiplies it by (a d - b c)²
(TauCeti.sq_sub_inner_sq_smul_add_smul), so changes with a d - b c = ±1 preserve it.
The partial gradients of the real Gram determinant G(q, p) = ‖q‖² ‖p‖² - ⟪q, p⟫² of a pair
are ∇_q G = 2 ‖p‖² q - 2 ⟪q, p⟫ p and ∇_p G = 2 ‖q‖² p - 2 ⟪q, p⟫ q, as a strict derivative.
Replacing a pair (q, p) by (a q + b p, c q + d p) multiplies its real Gram determinant
‖q‖² ‖p‖² - ⟪q, p⟫² by the square of the determinant a d - b c of the change of basis.