AnyLearn
All lessons
Mathadvanced

When Your Parameters Live on a Curved Space

Rotations, subspaces, low-rank matrices and covariances are not vectors in flat space. Why treating those constraints as penalties or projections wastes structure, and what it means to say the search space is a manifold.

Updated · AI-authored, review-gated · how lessons are made

Not signed in: your progress and quiz score won't be saved.
Progress1 / 8

Constraints that are not really constraints

Standard optimisation assumes your unknowns form a vector in flat space: any direction is a valid step, and a step of any size lands somewhere legal.

A surprising number of problems violate this, and always in the same way.

Fit a rotation aligning two point clouds, and the unknown is a matrix that must be orthogonal with determinant one. Find the best k-dimensional subspace for your data, and the unknown is a subspace, not a matrix. Complete a low-rank matrix from partial observations, and the unknown must have rank exactly r. Estimate a covariance, and it must be symmetric positive definite.

In every case the parameters satisfy equations, so they do not fill their ambient space. The rotation matrices form a curved surface inside the space of all matrices, and stepping off it produces something that is not a rotation.

The usual treatment is to call these constraints and reach for constrained optimisation machinery. There is a better framing, and it is the subject of this path: the feasible set is not a restriction carved out of a flat space, it is a curved space in its own right.

Full lesson text

All 8 steps on one page, for reading, reference, and search.

Show

1. Constraints that are not really constraints

Standard optimisation assumes your unknowns form a vector in flat space: any direction is a valid step, and a step of any size lands somewhere legal.

A surprising number of problems violate this, and always in the same way.

Fit a rotation aligning two point clouds, and the unknown is a matrix that must be orthogonal with determinant one. Find the best k-dimensional subspace for your data, and the unknown is a subspace, not a matrix. Complete a low-rank matrix from partial observations, and the unknown must have rank exactly r. Estimate a covariance, and it must be symmetric positive definite.

In every case the parameters satisfy equations, so they do not fill their ambient space. The rotation matrices form a curved surface inside the space of all matrices, and stepping off it produces something that is not a rotation.

The usual treatment is to call these constraints and reach for constrained optimisation machinery. There is a better framing, and it is the subject of this path: the feasible set is not a restriction carved out of a flat space, it is a curved space in its own right.

2. Three ways to handle a constraint

Take the simplest example: minimise a function over unit-norm vectors, so the feasible set is a sphere.

Penalise. Add a term punishing deviation from norm one. The problem stays unconstrained, and you now have a penalty weight to tune, iterates that satisfy the constraint only approximately, and worse conditioning as the weight grows.

Project. Take an ordinary gradient step, then rescale to unit norm. This is projected gradient descent, and it works. But the step direction was computed as though all directions were available, including the radial one that projection then discards. You compute a component solely to throw it away.

Work intrinsically. Recognise that the sphere is a two-dimensional surface. At any point, only tangential directions are meaningful. Compute the gradient within that tangent space and move along the surface.

The third is Riemannian optimisation. The problem becomes unconstrained on a curved space rather than constrained on a flat one, and dimension is reduced honestly: a sphere in three dimensions has two degrees of freedom, and the intrinsic view optimises over exactly those two.

3. What a manifold is, operationally

The formal definition of a smooth manifold involves charts and atlases. For optimisation purposes there is a more useful characterisation: a manifold is a set that looks flat if you zoom in far enough.

The Earth's surface is the standard illustration. Globally it is a sphere. Locally, in a room, it is indistinguishable from a plane, which is why flat maps work over small regions and fail over large ones.

That local flatness is precisely what optimisation needs, because optimisation is local. An algorithm at a point asks which nearby direction decreases the objective, then moves a small distance. If the space is locally flat, that question has an answer in a flat vector space, where calculus works normally.

Nicolas Boumal, who holds the chair of continuous optimization at EPFL and wrote An Introduction to Optimization on Smooth Manifolds (Cambridge University Press, 2023), takes a charts-last approach for exactly this reason: the heavy differential-geometry machinery of coordinate charts is not what an optimizer needs first.

What you need is the tangent space at a point, a way to measure lengths in it, and a way to move along the manifold.

4. The manifolds that keep appearing

A small collection covers most applications, and recognising them is the practical skill.

The sphere. Unit-norm vectors. Appears wherever scale is irrelevant and only direction matters: eigenvector problems, normalised embeddings.

The Stiefel manifold. Matrices with orthonormal columns. This is a set of k orthonormal directions in n-dimensional space, appearing in dimensionality reduction and orthogonality-constrained problems.

The Grassmann manifold. The set of k-dimensional subspaces. The distinction from Stiefel is the important one: if your objective depends only on the subspace spanned and not on which basis represents it, then every rotation of the basis gives the same value. Grassmann quotients out that redundancy, removing a symmetry that would otherwise leave the optimum non-unique.

Symmetric positive definite matrices. Covariances, kernels, diffusion tensors. The natural geometry here is genuinely curved, and treating these matrices as flat vectors gives poor interpolation.

Fixed-rank matrices. Matrices of exactly rank r, the natural home of low-rank matrix completion.

The rotation group. Rotations in two or three dimensions, ubiquitous in robotics, vision, and structural biology.

5. Recognising the structure

The diagnostic question is whether your constraint set is a smooth surface with a fixed number of degrees of freedom. Equality constraints defining a smooth surface usually indicate a manifold; inequalities producing corners and edges usually do not.

flowchart TD
  A["Your parameters satisfy constraints"] --> B{"Equalities or inequalities?"}
  B -- inequalities --> C["Feasible set has corners and boundaries"]
  C --> D["Use standard constrained optimization"]
  B -- equalities --> E{"Do they define a smooth surface?"}
  E -- no --> D
  E -- yes --> F["Likely a manifold"]
  F --> G{"Does the objective ignore some symmetry?"}
  G -- yes --> H["Quotient it out, e.g. Grassmann not Stiefel"]
  G -- no --> I["Use the embedded manifold directly"]

6. Why the intrinsic view pays

The advantages are concrete rather than aesthetic.

Exact feasibility. Every iterate lies on the manifold, exactly, by construction. There is no tolerance to monitor and no penalty weight to tune. If your rotation matrix must be a rotation because downstream code assumes it, this matters operationally.

Honest dimension. Optimising over rank-r matrices in the ambient space means carrying far more variables than the problem has degrees of freedom. The intrinsic view works in the true dimension, which reduces both cost and the size of the space being searched.

Symmetry removed. When a parameterisation has redundancy, the objective has flat directions that slow convergence and make the optimum non-unique. Quotient manifolds eliminate them.

Standard algorithms transfer. Gradient descent, conjugate gradients, trust regions, and quasi-Newton methods all have Riemannian counterparts with convergence guarantees analogous to the Euclidean ones.

That last point is the one that makes this practical rather than theoretical. You are not abandoning the optimisation toolkit; you are running the same algorithms on a different space, and Boumal's book covers the accompanying theory including worst-case complexity and geodesic convexity.

7. A concrete comparison

Take the simplest nontrivial case: find the dominant eigenvector of a symmetric matrix by maximising the Rayleigh quotient over unit vectors.

Penalty method
  maximize  x'Ax - lambda * (||x||^2 - 1)^2
  - tune lambda; too small drifts off the sphere,
    too large makes the problem ill-conditioned
  - iterates only approximately unit norm

Projected gradient
  x <- x + t * A x
  x <- x / ||x||
  - always feasible after projection
  - the radial component of A x is computed, then discarded

Riemannian gradient ascent
  g <- A x - (x'A x) x        # project A x onto the tangent space
  x <- retract(x, t * g)      # move along the sphere
  - no tuning parameter, exact feasibility, correct dimension

Notice what the Riemannian gradient is: the ambient gradient with its radial component removed, since moving radially would leave the sphere and cannot change the objective anyway. The projection is not a correction applied afterward; it is part of computing the right direction in the first place.

That is the whole idea in miniature, and the next lesson makes it general.

8. When not to use this

Manifold optimisation is the right tool for a specific shape of problem, and misapplying it costs effort for nothing.

SituationVerdict
Smooth equality constraints defining a surfaceWell suited
Objective invariant to a symmetryWell suited, use a quotient
Feasibility must hold exactly at every iterateWell suited
Inequality constraints, corners, boundariesUse standard constrained methods
Constraint set not smoothNot applicable
Unconstrained problem in flat spaceUnnecessary overhead
Constraint is soft and approximate is fineA penalty is simpler

Two caveats worth stating. First, the manifold structure must be derived, not assumed: you need its tangent spaces, projections, and a retraction, and while these are known for the standard manifolds, an unusual constraint set means real derivation work.

Second, non-convexity does not disappear. Most of these manifolds are not convex sets in any useful sense, and Riemannian gradient descent finds critical points, not global optima. What the geometry buys is a well-posed problem in the right dimension, not a guarantee of global optimality, though there is a class of problems where more can be said and the final lesson covers it.

Check your understanding

The lesson ends with a 5-question quiz. Take it in the player above to see your score.

  1. What is the key conceptual shift in Riemannian optimization?
    • Replacing gradient descent with second-order methods
    • Treating the feasible set as a curved space in its own right rather than a constraint carved out of flat space
    • Adding penalty terms that enforce constraints approximately
    • Converting all constraints into inequalities
  2. Why does projected gradient descent waste effort compared to the intrinsic approach?
    • Projection requires an expensive matrix decomposition each step
    • It cannot guarantee the iterate satisfies the constraint
    • It computes gradient components in directions that leave the manifold and are then discarded
    • It requires a smaller step size to remain stable
  3. What distinguishes the Grassmann manifold from the Stiefel manifold?
    • Grassmann requires square matrices while Stiefel allows rectangular ones
    • Grassmann consists of subspaces, quotienting out the choice of basis that Stiefel retains
    • Stiefel is curved while Grassmann is flat
    • Grassmann allows non-orthonormal columns
  4. For optimization purposes, what is the most useful characterisation of a manifold?
    • A set that is convex in the ambient space
    • A set defined entirely by linear equality constraints
    • A set that can be covered by a single coordinate chart
    • A set that looks flat when you zoom in far enough
  5. When is manifold optimization the wrong tool?
    • When the constraint set has corners and boundaries from inequality constraints
    • When the objective is invariant to a symmetry in the parameterisation
    • When iterates must satisfy the constraints exactly
    • When parameters must have orthonormal columns

Related lessons