Foundations to Frontier
Tests
A. Mathematical Foundations › A12 Geometry for ML

Lie Groups and Symmetries

Rotations, rigid motions and many symmetries form Lie groups: smooth manifolds where you can also compose and invert. This topic introduces groups and symmetry, the rotation groups SO(2) and SO(3), the rigid-motion groups SE(2) and SE(3), and their Lie algebras of 'infinitesimal motions'. It covers the hat map, the exponential map (Rodrigues' formula), the logarithm, quaternions, non-commutativity and the Lie bracket, and equivariant neural networks that build symmetry into learning. In the research exercise you integrate a tumbling spacecraft's attitude and see that naive integration leaves the rotation group, while Lie-group integrators stay on it and conserve angular momentum.

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

Symmetry as a set of moves

A square looks the same after turning it by 0°, 90°, 180° or 270°. Those four moves form a group: you can combine any two and get another one, and every move can be undone. Turning a spacecraft is also a move. Its orientations form a smooth group with infinitely many moves that blend into each other, called a Lie group (pronounced “lee”, after Sophus Lie).

One surprise: the order of moves matters. Turn a book 90° forward, then 90° to the side, and compare it with doing the turns in the other order.

Order matters: two turns, two different attitudes
x-turn first, then y-turn
y-turn first, then x-turn
attitudes differ by 26.87° · small-angle Lie-bracket prediction |α·β| = 27.93° (ratio 0.962)
Body axes: orange x, green y, blue z; faint lines are the fixed world axes. With small turns the two orders nearly agree and the difference is second order: about the Lie bracket [α x̂, β ŷ] = αβ ẑ, a small twist about z. With large turns the gap grows and the small-angle formula stops being accurate. This is why attitude is never stored as three independent angles that can be added, and why a pilot's sequence of pitch and roll matters.
Why engineers care

Every attitude controller, star tracker, IMU filter, robot arm and SLAM system works with rotations and rigid motions. Treating them as plain vectors of angles causes gimbal lock, drift and wrong averages. Lie groups give the right tools: compose with matrix or quaternion products, take small steps with the exponential map, and measure errors with the logarithm. The same mathematics also lets neural networks recognise objects regardless of their orientation.

📝 Quick check (Level 0)
0/3 answered
  1. 1. Does the order of two 3-D rotations matter?
  2. 2. A group must contain…
  3. 3. The orientations of a rigid body form a…

Level 1: Beginner

★★☆☆☆ Basic⏱ 25 minSecondary-school mathematics: arithmetic and elementary algebra.

Groups

A group is a set G with an associative operation, an identity e and inverses. A Lie group is a group that is also a smooth manifold, with smooth multiplication and inversion.

  • SO(2): planar rotations by an angle θ. It is commutative and has dimension 1.
  • SO(3) ={R∈R3×3:R⊤R=I,det⁡R=1}= \{R\in\mathbb R^{3\times3}: R^\top R = I, \det R = 1\}: 3-D rotations, of dimension 3. It is not commutative.
  • SE(3) ={(Rt01)}= \left\{\begin{pmatrix}R&t\\0&1\end{pmatrix}\right\}: rigid motions (rotation plus translation), of dimension 6. Compose by matrix product.
  • Unit quaternions S3S^3 cover SO(3) twice: q and −q give the same rotation.

Group actions and symmetry

A group acts on a space when each element moves points: x↦Rxx\mapsto R x. A function is invariant if f(gx)=f(x)f(gx) = f(x), and equivariant if f(gx)=ρ(g)f(x)f(gx) = \rho(g)f(x). For example, a CNN’s convolution is translation-equivariant, and a molecule’s energy is rotation-invariant.

📝 Quick check (Level 1)
0/3 answered
  1. 1. Dimension of SO(3):
  2. 2. Dimension of SE(3):
  3. 3. A rotation matrix R satisfies…

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 40 minUndergraduate students and practising engineers.

The Lie algebra: infinitesimal moves

Differentiate a curve of rotations R(t)R(t) with R(0)=IR(0) = I. From R⊤R=IR^\top R = I you get R˙(0)⊤+R˙(0)=0\dot R(0)^\top + \dot R(0) = 0, so the tangent space at I is the space of skew-symmetric matrices, so(3). The hat map identifies it with R3\mathbb R^3:

ω^=(0−ω3ω2ω30−ω1−ω2ω10),ω^v=ω×v.\hat\omega = \begin{pmatrix}0&-\omega_3&\omega_2\\\omega_3&0&-\omega_1\\-\omega_2&\omega_1&0\end{pmatrix},\qquad\hat\omega v = \omega\times v.

Exponential and logarithm

The matrix exponential maps the algebra to the group: R=exp⁡(ω^)R = \exp(\hat\omega) is a rotation by θ=∥ω∥\theta = \|\omega\| about ω/θ\omega/\theta. Rodrigues’ formula gives it in closed form, with K=ω/θ^K = \widehat{\omega/\theta}:

exp⁡(ω^)=I+sin⁡θ K+(1−cos⁡θ)K2.\exp(\hat\omega) = I + \sin\theta\,K + (1 - \cos\theta)K^2.

The logarithm inverts it for θ below π: θ=arccos⁡tr⁡R−12\theta = \arccos\frac{\operatorname{tr}R - 1}2 and ω^=θ2sin⁡θ(R−R⊤)\hat\omega = \frac\theta{2\sin\theta}(R - R^\top).

Non-commutativity and the bracket

For small a and b, the Baker–Campbell–Hausdorff (BCH) formula gives log⁡(ea^eb^)=a+b+12a×b+O(3)\log(e^{\hat a}e^{\hat b}) = a + b + \tfrac12a\times b + O(3). The Lie bracket [a^,b^]=a^b^−b^a^=a×b^[\hat a, \hat b] = \hat a\hat b - \hat b\hat a = \widehat{a\times b} measures how far the order matters.

Kinematics

Body rates ω\omega drive the attitude through R˙=Rω^\dot R = R\hat\omega. One step of a Lie-group integrator is Rk+1=Rkexp⁡(Δt ω^)R_{k+1} = R_k\exp(\Delta t\,\hat\omega), which stays exactly in SO(3) (Iserles et al., 2000).

🐍 Exercise 1: the rotation group SO(3)
Implement hat and vee, the matrix exponential as a power series, Rodrigues' formula, the SO(3) logarithm and quaternion conversion and product. Check that they agree, measure non-commutativity and test the BCH second-order formula.
📝 Quick check (Level 2)
0/3 answered
  1. 1. The Lie algebra so(3) consists of…
  2. 2. Rotation angle of R from its trace:
  3. 3. To leading order, the Lie bracket [â, b̂] corresponds to…

Level 3: Advanced

★★★★☆ Advanced⏱ 40 minGraduate level, with full derivations and proofs.

exp of a skew matrix is a rotation

If A⊤=−AA^\top = -A, then (eA)⊤eA=eA⊤eA=e−AeA=I(e^A)^\top e^A = e^{A^\top}e^A = e^{-A}e^A = I, because A and −A commute. Also det⁡eA=etr⁡A=e0=1\det e^A = e^{\operatorname{tr}A} = e^0 = 1. ∎

Rodrigues from the series

For unit axis k, K=k^K = \hat k satisfies K3=−KK^3 = -K. Group the series ∑θnKn/n!\sum\theta^nK^n/n! into odd and even powers: I+(θ−θ3/3!+… )K+(θ2/2!−θ4/4!+… )K2=I+sin⁡θ K+(1−cos⁡θ)K2I + (\theta - \theta^3/3! + \dots)K + (\theta^2/2! - \theta^4/4! + \dots)K^2 = I + \sin\theta\,K + (1 - \cos\theta)K^2. ∎

Commutator of two small rotations

ea^eb^e−a^e−b^=I+[a^,b^]+O(3)e^{\hat a}e^{\hat b}e^{-\hat a}e^{-\hat b} = I + [\hat a, \hat b] + O(3). So doing two small turns in opposite orders differs by a rotation of about ∥a×b∥\|a\times b\|. For 0.1 rad about x and 0.1 rad about y this is ≈ 0.01 rad about z. Parallel parking and the “falling cat” exploit exactly this.

Equivariant networks

Group convolution (f⋆ψ)(g)=∫f(h)ψ(g−1h) dh(f\star\psi)(g) = \int f(h)\psi(g^{-1}h)\,dh is equivariant by construction (Cohen and Welling, 2016). For 3-D data, networks such as Tensor Field Networks and SE(3)-Transformers use representations of SO(3) so that rotating the input rotates the features accordingly.

Exercise 3.1: composing two 0.4-rad turns

With a = (0.4, 0, 0) and b = (0, 0.4, 0), BCH predicts log⁡(ea^eb^)≈(0.4,0.4,0.08)\log(e^{\hat a}e^{\hat b})\approx(0.4, 0.4, 0.08) with norm ≈ 0.5713. The exact angle is 0.5638: the second-order formula is close, but not exact.

📝 Quick check (Level 3)
0/3 answered
  1. 1. For unit k, K = k̂ satisfies…
  2. 2. det(e^A) =
  3. 3. Two 0.1-rad turns about x and y, in opposite orders, differ by about…

Level 4: Expert

★★★★★ Expert⏱ 35 minResearchers: original papers and open problems.

Integrating a tumbling spacecraft

A body with principal inertias (1, 2, 3) spins mostly about its major axis with some nutation. Its body rates come from Euler’s equations. We integrate the attitude for 60 s with 3000 steps of 0.02 s, using four methods. For torque-free motion, the angular momentum L=RIωL = RI\omega must stay fixed in inertial space.

Method max ‖RᵀR − I‖ relative drift of L
Euler on the matrix 192.8 0.34
Euler + SVD re-projection 3e−15 0.0036
Lie–Euler, R exp(Δt ω̂) 2e−14 0.0036
Lie midpoint 9e−15 3.6e−5

Naive Euler leaves SO(3) entirely: its “rotation matrix” stretches. Projecting back or using the exponential map keeps R a rotation. Only a higher-order group integrator keeps the physics right: halving Δt cuts the drift by ×2.00 for Lie–Euler and ×4.00 for the midpoint method (first and second order). Flight software uses quaternion or exponential-map propagation and error-state filters on the group (the multiplicative EKF; Markley and Crassidis, 2014).

These are the numbers the exercise prints in the browser. Round-off-level values differ slightly by platform (desktop CPython gives 1e−14 for the Lie midpoint orthogonality error); the comparisons hold on both.

🐍 Exercise 2 (research): Lie-group attitude integration
Integrate torque-free body rates with RK4, then propagate the attitude by naive Euler, Euler with SVD projection, Lie–Euler and the Lie midpoint method. Compare orthogonality and angular-momentum conservation, and measure the order of convergence.

Lie groups in AI, robotics and aerospace

  • Attitude determination and control: quaternion kinematics, the multiplicative EKF, and geometric controllers on SO(3) and SE(3) (Lee, Leok and McClamroch, 2010).
  • Robotics and SLAM: pose graphs on SE(3), on-manifold preintegration of IMU data (Forster et al., 2017), and robot kinematics as products of exponentials (Lynch and Park, 2017).
  • Equivariant deep learning: group CNNs, steerable networks, and E(3)-equivariant networks for molecules and point clouds (Bronstein et al., 2021).
  • Numerical methods: geometric integrators that preserve structure over long horizons (Hairer, Lubich and Wanner, 2006).

References

  1. J. Solà, J. Deray, D. Atchuthan (2018). “A micro Lie theory for state estimation in robotics.” arXiv:1812.01537.
  2. K. Lynch, F. Park (2017). Modern Robotics. Cambridge.
  3. F. L. Markley, J. Crassidis (2014). Fundamentals of Spacecraft Attitude Determination and Control. Springer.
  4. T. Lee, M. Leok, N. H. McClamroch (2010). “Geometric tracking control of a quadrotor UAV on SE(3).” IEEE CDC.
  5. A. Iserles, H. Munthe-Kaas, S. Nørsett, A. Zanna (2000). “Lie-group methods.” Acta Numerica, 9.
  6. C. Forster, L. Carlone, F. Dellaert, D. Scaramuzza (2017). “On-manifold preintegration for real-time visual-inertial odometry.” IEEE T-RO, 33.
  7. T. Cohen, M. Welling (2016). “Group equivariant convolutional networks.” ICML.
  8. M. Bronstein, J. Bruna, T. Cohen, P. Veličković (2021). “Geometric deep learning: grids, groups, graphs, geodesics, and gauges.” arXiv:2104.13478.