Skip to content

Gram Matrix

Tabulate the pairwise inner products of a finite vector family in one square matrix, preserving its relative geometry and dependence.

Version
v1 · 2026-10-03 · History
Domain-specific #
13285
Domain group
Formal Sciences
Origin domain
Mathematics
Subdomains
Linear Algebra, Inner Product Spaces → Mathematics

Core Idea

Given a finite indexed family \(v_1,\ldots,v_n\) in a real or complex inner-product space, its Gram matrix is the square table \(G_{ij}=\langle v_i,v_j\rangle\). Choose and state the complex convention; here the inner product is conjugate-linear in the first slot, so if the vectors are columns of \(X\) under the standard coordinate inner product, \(G=X^*X\). The table records every pairwise inner product of the family. It is Hermitian (symmetric over the reals) and positive semidefinite because \(c^*Gc=\|\sum_i c_i v_i\|^2\geq0\) for every coefficient vector \(c\).[1][2]

This is more than a generic square table. The positive-definite inner product makes the entries encode relative lengths, angles and linear dependence. In particular, \(\operatorname{rank}G\) is the dimension of the family's span; \(G\) is positive definite and invertible exactly when its members are linearly independent. For independent real vectors, \(\det G\) is the squared Euclidean \(n\)-volume of the parallelotope they span; the complex analogue is the squared Hermitian norm of their exterior product. If dependent, the determinant is zero. These claims fail without qualification for an arbitrary indefinite bilinear form.[1][2]

The same construction applies to coordinate vectors, to functions under an integral inner product, and to implicit feature vectors represented by a positive-definite kernel. Elkies's monomial example produces a Hilbert matrix; Hofmann, Schölkopf and Smola explain that a kernel evaluation table is the Gram matrix of feature vectors. A kernel is a function that must produce positive-semidefinite matrices for every finite sample, not identical to one particular Gram matrix.[1][3]

Structural Signature

Sig role-phrases: finite indexed family — positive-definite inner product — pairwise table — quadratic-form certificate — rank/determinant readout — optional projection use.

  • Finite indexed family. Fix \(v_1,\ldots,v_n\) in the same space. The same indices label rows and columns; repeated or linearly dependent vectors are permitted and make the resulting matrix singular.[1]
  • Positive-definite inner product. Specify the real or complex scalar field and inner-product convention. Its positivity is the premise behind Gram positive semidefiniteness, not a property of every bilinear or sesquilinear form.[2]
  • Pairwise table. Form \(G_{ij}=\langle v_i,v_j\rangle\). Under standard column coordinates, this is \(X^*X\); in a nonstandard inner product the coordinate formula includes that inner product's metric matrix.[1][2]
  • Quadratic-form certificate. For any \(c\), \(c^*Gc=\|\sum c_i v_i\|^2\). It is nonnegative; it is strictly positive for every nonzero \(c\) exactly when the vectors are independent.[1][2]
  • Rank/determinant readout. The Gram rank equals span dimension. The determinant vanishes precisely for dependence; for an independent real family it is squared Euclidean volume (with a Hermitian exterior-product analogue over the complexes). These are consequences of the inner-product construction, not extra data stored in the matrix.[1]
  • Optional projection use. In least squares, the column Gram matrix appears in normal equations \(Gc=X^*b\). If \(G\) is singular, coefficients need not be unique even though the projection of \(b\) onto the column span is unique.[4]

What It Is Not

Not a table from an arbitrary bilinear form. One can make a square matrix of \(B(v_i,v_j)\) for an indefinite form \(B\), but \(c^*Gc\) may be negative and even independent vectors may yield a singular table. Those are not the positive inner-product Gram guarantees asserted here.[2]

Not always positive definite. A Gram matrix is always positive semidefinite under the stated assumption; strict positive definiteness requires an independent family. A duplicated vector or linear relation creates a nonzero \(c\) with \(c^*Gc=0\).[1]

Not an unqualified “Gramian matrix” alias. That name can denote this mathematical table, but control theory also uses Controllability and observability Gramians tied to dynamical reachability or observation over time. This entry does not treat those as the same finite-family identity solely because of shared terminology; the frozen Gramian request remains a lexical-collision hold.

Not the kernel function, distance matrix, or covariance table. A positive-definite kernel \(k(x,y)\) produces a Gram matrix only after a finite sample is selected; one PSD table does not prove \(k\) is positive definite on all samples. Distances and cross-covariances use different pair rules.[3]

Scope of Application

For coordinate vectors, \(G=X^*X\) compresses a chosen family into its mutual dot products. If \(X\) has full column rank, its Gram is invertible and can be used in the normal equations for a least-squares projection. If \(X\) is rank deficient, \(G\) is singular and different coefficient vectors can represent the same projected point. The projected vector is fixed because orthogonal projection onto a finite-dimensional subspace is unique, but coefficients relative to a redundant list are not.[1][4]

For functions, choose a genuine integral inner product. Elkies takes \(1,x,x^2,\ldots,x^{n-1}\) on \([0,1]\); under the convention used here, \(\langle f,g\rangle=\int_0^1 \overline{f(x)}g(x)\,dx\). One-based indices give \(G_{ij}=1/(i+j-1)\), the Hilbert matrix. The monomials are linearly independent, so this finite Gram is positive definite despite its coordinates being functions rather than ordinary finite vectors.[1]

For implicit features in kernel methods, Hofmann, Schölkopf and Smola define a sample matrix \(K_{ij}=k(x_i,x_j)=\langle\phi(x_i),\phi(x_j)\rangle\) when the kernel has a feature map. The vectors may live in a high- or infinite-dimensional space while the chosen finite sample produces one finite Gram matrix. Kernel positivity is a universal all-samples condition, not inferred from one favorable table.[3]

Clarity

The central distinction is between the family and its pairwise geometry. The matrix retains each \(\langle v_i,v_j\rangle\), so it can recover norms, real-space angles (for nonzero vectors), squared distances \(\|v_i-v_j\|^2=G_{ii}+G_{jj}-2\Re G_{ij}\), and linear dependence. But it does not preserve absolute orientation: replacing every \(v_i\) by \(Uv_i\) for one orthogonal or unitary \(U\) leaves \(G\) unchanged.[1][2]

The positivity words are another frequent trap. “Positive semidefinite” allows zero quadratic form for nonzero coefficients; “positive definite” does not. Bindel states the positive-definite result for a basis. The general finite-family case may contain redundancy and therefore requires the weaker semidefinite statement.[2][1]

The complex convention matters in formulas. With conjugate-linearity in the first slot, \(G_{ij}=v_i^*v_j\) and \(G=X^*X\). Authors using the opposite convention may transpose/conjugate the displayed entry rule while preserving the same Hermitian and PSD substance. This entry states its convention rather than switching silently.[2]

Manages Complexity

One matrix packages \(n^2\) pairwise geometric comparisons and enables linear-algebra readouts. From \(G\) one can determine span dimension via rank, detect dependence via a zero determinant, and express projection equations using the same inner products. This does not mean the matrix retains every coordinate of the original family: global rotations or unitary changes give the same table.[1][4]

The function and kernel cases show why this is useful. A family of polynomials can be compared through integrals without rewriting each as a finite coordinate vector. A positive-definite kernel can compute inner products of feature images without explicit construction of a possibly infinite-dimensional feature space. In either case the table is still finite because the indexed family or sample is finite.[1][3]

Abstract Reasoning

To recognize a candidate, declare the inner product and family, then compute every \(G_{ij}\). Check Hermitian symmetry and use \(c^*Gc=\|\sum_i c_i v_i\|^2\) to prove PSD. To decide strict positivity, ask whether a nonzero linear combination of the \(v_i\) can vanish. This criterion simultaneously settles Gram invertibility and whether the determinant is zero.[1][2]

For independent real vectors, Elkies's determinant-growth observation—adding a vector multiplies Gram determinant by its squared distance from the preceding span—explains squared volume by induction. For a redundant family, the added distance is zero and determinant collapses. Do not apply the same geometric interpretation to an indefinite bilinear form without rebuilding assumptions.[1]

For least squares, write the residual orthogonality equations \(X^*(b-Xc)=0\). They give \(Gc=X^*b\). Full column rank gives unique coefficients; if the columns are dependent, a nonzero null vector of \(X\) can be added to any solution without changing \(Xc\). The normal equations remain meaningful, but inverting a singular \(G\) is invalid.[4][1]

Knowledge Transfer

The same mathematical rule transfers literally from finite coordinate vectors to monomial functions: replace coordinate dot products by integrals, keep the finite family and all pairwise inner products, then use the same PSD and rank arguments. In kernel methods, the rule acts on feature vectors, even when they are not explicitly materialized. That is a transfer of the same inner-product table, not a loose analogy based on the word “similarity.”[1][3]

Outside inner-product geometry, many pairwise tables exist, but the named Gram identity requires positive-definite inner products and linear combinations. A broader pairwise-tabulation skeleton is a future-prime question rather than evidence that Gram Matrix itself is prime. Live Matrix supplies the strict mathematical genus; the Gram entry rule supplies the autonomous domain-specific residual.

Examples

Canonical — dependent coordinate family

In \(\mathbb R^2\), take \(v_1=(1,0)\), \(v_2=(0,1)\) and \(v_3=(1,1)\). Their ordinary dot products yield \(G=\begin{pmatrix}1&0&1\\0&1&1\\1&1&2\end{pmatrix}\). This is positive semidefinite with rank $2$ and determinant $0$ because \(v_3=v_1+v_2\). Its null vector \((-1,-1,1)\) shows why a least-squares projection onto the span can have more than one coefficient description. The example follows Elkies's Gram construction and independence criterion.[1][4]

Mapped back: the finite indexed family is \((v_1,v_2,v_3)\); the positive-definite inner product is Euclidean dot product; the pairwise table is displayed \(G\); the quadratic-form certificate is \(c^TGc=\|c_1v_1+c_2v_2+c_3v_3\|^2\); the rank/determinant readout is rank $2$ and determinant $0$; and the projection use has nonunique coefficients along the exhibited null direction.

Unlike function-space case — monomial Hilbert matrix

Take the functions \(v_1(x)=1\), \(v_2(x)=x\) and \(v_3(x)=x^2\) in \(L^2[0,1]\). Under \(\langle f,g\rangle=\int_0^1 \overline{f(x)}g(x)\,dx\), their Gram matrix is \(G_{ij}=\int_0^1 x^{i+j-2}dx=1/(i+j-1)\): the \(3\times3\) Hilbert matrix. A nonzero polynomial of degree at most two cannot vanish almost everywhere on the interval, so this Gram is positive definite and has rank $3$. Elkies uses this monomial construction for the general Hilbert matrix.[1]

Mapped back: the finite indexed family is \((1,x,x^2)\); the positive-definite inner product is the integral over \([0,1]\); the pairwise table is the Hilbert matrix; the quadratic-form certificate is the integral of the squared polynomial; the rank/determinant readout is rank $3$ and positive determinant; and projection use would require a separately specified target function, so none is assumed.

Structural Tensions

Redundant descriptive family versus unique coefficients. Keeping all named vectors can preserve meaningful candidate labels or correlated measurements, but a dependence makes the Gram singular and coefficient descriptions nonunique. Replacing the list by an independent basis restores invertibility, yet loses some original labels and may change how a domain expert interprets the representation. The projected point in the span can remain the same.[1][4] Diagnostic: Is the task to preserve each named direction, or to require unique coefficients, and does the Gram nullspace expose redundancy?

Relative geometry versus absolute orientation. Storing only \(G\) preserves inner products, lengths, dependence and (with convention) angles, and can avoid explicit high-dimensional features. It cannot reveal which absolute coordinate frame or common unitary orientation generated the family. Retaining original coordinates supports frame-specific claims but sacrifices the representation-invariant compactness of a pairwise table.[1][3] Diagnostic: Would the conclusion survive a common orthogonal/unitary transformation of all vectors, or does it depend on their original coordinates?

Structural–Framed Character

Gram Matrix lies toward the structural end within mathematics but is framed by an inner-product space. Evaluative weight: PSD is a neutral theorem, not a judgment that one family is better; usefulness depends on the inquiry. Human-practice dependence: selecting the family and inner product is a modeling decision, while the computed entries and PSD consequence follow mathematically once selected. Institutional origin: the name and notation have a scholarly history, but an institution cannot make an indefinite table positive semidefinite. Vocabulary travel: “Gramian” travels to control theory with other construction rules, so name similarity does not license identity. Import versus recognition: coordinate vectors, monomial functions and feature vectors all yield the same pairwise-inner-product matrix rule, rather than merely borrowing a word.[1][2][3]

Its character: a formal, evaluatively neutral geometry-compressing matrix kind with literal mathematical transfer and a constitutive positive-definite inner-product frame.

Structural Core vs. Domain Accent

The portable skeleton is same-family pairwise relation tabulation. Whether that can be admitted as a broader prime requires separate evidence; this is a future-prime question. Live Matrix is a real genus because a Gram matrix is literally a square scalar array with matrix arithmetic. The domain accent adds a finite family in a real/complex inner-product space, pairwise inner-product entries and their PSD geometry.[1][2]

Remove the inner product and one can still have a pair table, but not the same guaranteed rank, determinant and volume interpretation. Move from coordinate vectors to functions and the inner product remains, so the identity stays intact. This distinction between precise transfer and loose analogy keeps Gram Matrix domain-specific rather than prime.[1][3]

This entry is a kind of Matrix.

The proposed strict upward edge is to live Matrix: a Gram matrix satisfies the general indexed-array identity and adds a square same-family inner-product entry rule. Live Positive Definite Kernel is a function whose every finite evaluation table must be PSD; one Gram table from one sample is not a strict kind of kernel. Distance Matrix stores distances, Cross-covariance Matrix stores cross-variable covariance and Rank is a derived integer; none is a genus from shared vocabulary.[3]

The frozen requested surface Gramian matrix is left for lexical review because in control theory “Gramian” often denotes a dynamical reachability/observability construction.

Relationships to Other Abstractions

Local relationship map for Gram MatrixParents appear above the current abstraction, mutual partners to the right, and children below. Node labels state whether each abstraction is prime or domain-specific; colors identify relation types.Gram MatrixDOMAINDomain-specific abstraction: Matrix — is a kind ofMatrixDOMAIN

Current abstraction Gram Matrix Domain-specific

Parents (1) — more general patterns this builds on

  • Gram Matrix is a kind of Matrix Domain-specific

    A Gram matrix is a square matrix of pairwise inner products from one finite family.

Hierarchy paths (5) — routes to 5 parentless roots

Neighborhood in Abstraction Space

Gram Matrix sits in a moderately populated region (58th percentile for distinctiveness): it has near-neighbors but no dense thicket of look-alikes.

Family — Codes, Matrices & Combinatorial Problems (30 abstractions)

Nearest neighbors

Computed from structural-signature embeddings · 2026-10-08

Not to Be Confused With

  • Positive-definite kernel: a pair function with PSD Gram tables for every finite sample, not one fixed family matrix.[3]
  • Control-theory controllability/observability Gramian: a dynamics-derived reachability or observation construction, not automatically this fixed-family table.
  • Distance matrix: pairwise distances rather than inner products; distances can be computed from a Gram table under extra geometric context, but the objects differ.[1]
  • Cross-covariance matrix: moments between two variable families, not automatically the same-family inner-product table.
  • Arbitrary bilinear-form table: may be indefinite, so PSD, rank and volume claims cannot be imported without a true inner product.[2]
  • An always-invertible matrix: dependence makes a genuine Gram matrix singular; positive semidefinite is the unconditional statement.[1]

References

[1] Noam Elkies, Math 55a Honors Abstract Algebra course notes, original Harvard lecture page, paragraphs beginning “For positive definiteness” and “For any matrix B,” covering the monomial Hilbert example, \(B^*B\), independence and determinant-distance growth, inspected 2026-10-01. registry ↩a ↩b ↩c ↩d ↩e ↩f ↩g ↩h ↩i ↩j ↩k ↩l ↩m ↩n ↩o ↩p ↩q ↩r ↩s ↩t ↩u ↩v ↩w ↩x ↩y ↩z ↩27

[2] David Bindel, CS 6210 Matrix Computations lecture slides, 25 August 2025, original Cornell author notes, “Inner products” and “Gram matrices,” inspected 2026-10-01. registry ↩a ↩b ↩c ↩d ↩e ↩f ↩g ↩h ↩i ↩j ↩k ↩l ↩m

[3] Thomas Hofmann, Bernhard Schölkopf and Alexander J. Smola, “Kernel Methods in Machine Learning”, original author-hosted Annals of Statistics 36 (2008), §2.1–2.2 Definitions 1–3, printed pp.1171–1175, inspected 2026-10-01. registry ↩a ↩b ↩c ↩d ↩e ↩f ↩g ↩h ↩i ↩j

[4] David Bindel, CS 6210 Matrix Computations lecture slides, 24 September 2025, original Cornell author notes, “Solving the normal equations” and full-column-rank uniqueness, inspected 2026-10-01. registry ↩a ↩b ↩c ↩d ↩e ↩f