Skip to the lesson
FixTheRobot Explore Robotics / Linear Algebra / M10 Lie Groups and Advanced Robotics Mathematics / M10-T1

Linear Algebra · Theory · M10

M10-T1 — Introduction to Lie Groups and Lie Algebras

Rotations can be multiplied but not added. A Lie group is such a curved space of transformations; its Lie algebra is the flat space of small motions that we can add and differentiate.

  • Lesson 1 of 8
  • Module 10: Lie Groups and Advanced Robotics Mathematics
  • Lie groups and manifolds
  • About 9 minutes to read

Everything so far treated orientations as matrices to multiply. But estimation needs more: averaging two orientations, adding a small error to one, differentiating a cost with respect to a pose. None of that makes sense for rotation matrices, which are not a vector space. Lie theory repairs this by pairing the curved group with a flat tangent space where ordinary calculus works, and a map between them.

Learning objectives

After this lesson, you should be able to:

  • Define a matrix Lie group as a smooth set of invertible matrices closed under multiplication and inverse, with SO(2) as the first example.
  • Describe the Lie algebra as the tangent space at the identity and identify so(2) with the real numbers.
  • Use the matrix exponential to map algebra elements to group elements and connect it to R(θ) = exp(θJ).
  • Explain why this structure fixes the problems of adding, averaging and differentiating orientations.

Introduction and motivation

The sum of two rotation matrices is not a rotation, and (A + B)/2 has columns shorter than 1. A filter that stores a rotation matrix and adds an update to it quickly produces something that is not a rotation at all. Quaternion averaging by adding components has the same problem. We can fix each case ad hoc, but Lie theory gives one principle for all: represent small changes as vectors in the tangent space, add them there, and map the result back onto the group.

The intuition

Think of the unit circle. Its points are 2D rotations: the point at angle θ is R(θ). You cannot add two points on a circle and stay on it, but you can compose them (add angles, wrapping around). Zoom into the identity and the circle looks like a straight line: the tangent line. Moving along that line is just adding numbers, and the exponential map wraps the line onto the circle. The tangent line is the Lie algebra; the circle is the Lie group; exp connects them.

A group is a curved space; its algebra is the flat tangent at the identityThe unit circle represents the rotation group of the plane. The identity is the point at angle zero. The tangent line at the identity is the Lie algebra, a flat vector space of angular velocities. The exponential map wraps the tangent line around the circle, and the logarithm unwraps it. I (θ = 0) tangent line = Lie algebra so(2) exp: wrap the line onto the circlelog: unwrap it back (near I) exp( θ [0 −1; 1 0] ) = R(θ) group product: angles addalgebra: ordinary vector space SO(2) group (curved)
SO(2): the circle is the group, the tangent line at the identity is its Lie algebra, exp wraps the line around the circle.

Interactive figure. A planar robot with a constant velocity and turning rate. With only a turning rate it rotates in place, which is the group SO(2) generated by its Lie algebra. The readout shows the end pose and the logarithm of that pose. This figure needs JavaScript to be interactive.

Set the forward speed to 0 and the sideways speed to 0 and vary only the turning rate ω: the pose is pure rotation, exp(tω) wrapped around the circle of angles. In the next lessons the same figure shows full planar motions, where velocity v and ω together form the Lie algebra of SE(2).

Geometric and physical interpretation

Geometric view. A Lie group G is a smooth manifold that is also a group, with smooth multiplication and inverse. Matrix Lie groups (SO(n), SE(n), GL(n)) are sets of invertible matrices. At every point the group looks locally like a flat space, and the tangent space at the identity, with the commutator, is the Lie algebra 𝔤. Physical view. Elements of the algebra are velocities: infinitesimal rotations (angular velocity) for SO(n), infinitesimal rigid motions (twists) for SE(n). Elements of the group are finite motions. Integrating a velocity over time is exactly the exponential map.

The mathematics

G
a matrix Lie group, e.g. SO(2) = {R(θ)}.
𝔤 = TI G
the Lie algebra: the tangent space at the identity I.
J
the generator of SO(2): J = [[0, −1], [1, 0]], so that 𝔰𝔬(2) = {θJ : θ ∈ ℝ}.
exp, log
the exponential map 𝔤 → G and its local inverse.

The generator and the exponential

exp(θJ) = Σₖ (θJ)ᵏ / k! = I + θJ + (θJ)²/2 + ⋯ = [ cos θ  −sin θ ; sin θ  cos θ ] = R(θ)

What it means. Because J² = −I the series splits into the series of cosine (even powers) and sine (odd powers). The exponential of a matrix is defined by the same power series as the scalar exponential.

Tangent space and velocity

d/dθ R(θ) = R(θ) J = J R(θ),   so   Ṙ = R (θ̇ J) :   the velocity of a rotation lies in the algebra

What it means. The derivative of R(θ) at θ = 0 is J: the tangent space at the identity is spanned by J. At any other rotation the velocity is that algebra element carried along by R.

Group versus algebra

R(α) R(β) = R(α + β)   (group: angles add, order irrelevant)       𝔰𝔬(2): ordinary addition, bracket [A, B] = AB − BA = 0

What it means. In 2D the group is commutative, so the Lie bracket vanishes. In 3D it does not: the bracket becomes the cross product (next lessons).

A Lie group is a smooth group of matrices; its Lie algebra is the flat tangent space at the identity; exp wraps algebra elements onto the group (R(θ) = exp(θJ)). Velocities live in the algebra.

Step-by-step derivation: R(θ) = exp(θJ) and the tangent space

  1. Powers of J. J = [[0, −1], [1, 0]] is a 90° rotation, so J² = −I, J³ = −J, J⁴ = I, and the pattern repeats.
  2. The series. exp(θJ) = I(1 − θ²/2! + θ⁴/4! − ⋯) + J(θ − θ³/3! + θ⁵/5! − ⋯) = I cos θ + J sin θ, which is exactly R(θ).
  3. One-parameter subgroup. exp((α + β)J) = exp(αJ)exp(βJ) because αJ and βJ commute. This reproduces R(α + β) = R(α)R(β).
  4. Tangent space. Differentiating R(θ) = I cos θ + J sin θ gives R′(θ) = −I sin θ + J cos θ = J R(θ). At θ = 0, R′(0) = J: the tangent space at the identity is the line {θJ}, one-dimensional, matching the one degree of freedom of a planar rotation.
  5. Why this is a vector space. The tangent vectors θJ add and scale like real numbers: θ₁J + θ₂J = (θ₁ + θ₂)J. We can average them, interpolate them and differentiate with respect to them using ordinary calculus.
  6. Local inverse. Near the identity log(R(θ)) = θJ with θ = atan2(R₂₁, R₁₁). It is only locally invertible: exp((θ + 2π)J) = exp(θJ), so the logarithm picks the principal value in (−π, π].
  7. The general definition. A matrix Lie group G ⊂ GL(n) has Lie algebra 𝔤 = {X : exp(tX) ∈ G for all t} (equivalently, the tangent vectors at I of curves in G). The matrix commutator [X, Y] = XY − YX turns 𝔤 into an algebra: the bracket measures the failure of the group to commute at second order.
  8. Closure of the algebra. For SO(n), Rᵀ R = I differentiated at I gives Xᵀ + X = 0: algebra elements are skew-symmetric matrices. For SO(2) these are exactly the multiples of J; for SO(3) they are the skew matrices [ω]ₓ of the next lesson.

Why bother? Three recurring needs of robotics are met uniformly: (1) updating an orientation by a small increment (apply exp(δ)), (2) differencing two orientations (take log(R₁⁻¹R₂)), (3) differentiating a function of a pose by perturbing it in the tangent space. The following lessons carry this out for SO(3) and SE(3).

Not a vector space, but nearly one. Locally the group is indistinguishable from its algebra (to first order, exp(δ) ≈ I + δ), which is why small-angle approximations work; globally it wraps (angles are modulo 2π), has curvature (non-commutativity in 3D) and cannot be covered by a single chart without a singularity (gimbal lock).

A worked example: SO(2) and its algebra with numbers

  • Exponential. θ = π/2: exp(θJ) = I cos(π/2) + J sin(π/2) = J = [[0, −1], [1, 0]], the 90° rotation. Summing the series to 30 terms reproduces it to 10⁻¹⁵.
  • Composition. R(0.3)R(0.5) = R(0.8): both sides equal [[0.6967, −0.7174], [0.7174, 0.6967]].
  • Derivative. At θ = 30°, R′ = J R(30°) = [[−0.5, −0.866], [0.866, −0.5]], the matrix whose columns are the velocities of the basis vectors for unit angular velocity.
  • Logarithm. R(2.0) has log = atan2(0.909, −0.416) J = 2.0 J, but R(4.0) returns −2.283 J, the principal value (4.0 − 2π).
  • Averaging. The naive entrywise average of R(0°) and R(180°) is the zero matrix, not a rotation. In the algebra, the average of 0 and π is π/2 (or −π/2): the ambiguity is a genuine property of the circle, but at least the algebra gives a well-defined answer for angles within 90°: the average of R(10°) and R(30°) is exp(20° J) = R(20°).
  • Not commutative in 3D (preview). Rz(90°)Rx(90°) ≠ Rx(90°)Rz(90°): only the one-dimensional SO(2) commutes.

Robotics application

SLAM and pose graphs. Back ends keep poses on the group and optimise by taking steps in the tangent space, x ← x ⊞ δ; the group structure avoids over-parametrised rotations; see pose graphs and rotation matrices, quaternions and poses.

UAV state estimation. The error-state Kalman filter represents the attitude error as a small tangent vector and corrects the attitude with exp; see the error-state Kalman filter and quaternion-based orientation.

Mobile robots. Planar heading is the SO(2) case: heading arithmetic with wrapping is group composition and logarithm in disguise; see rigid transforms in 2D.

Manipulators, LiDAR registration and IMU integration. Gyro integration multiplies by exp(ω Δt); ICP updates a pose by a small twist; manipulators use the product of exponentials of joint twists (next lessons).

Engineering implications and limitations

Practical rules

  • Never add rotation matrices or quaternions. Add tangent vectors and map with exp, or use the group product.
  • Wrap the logarithm. Angles are modulo 2π; return the principal value and be careful at ±π where it jumps.
  • Keep updates small. Tangent-space methods are first-order accurate; small steps keep the approximation honest, and exp keeps the result on the group exactly.
  • State your convention. Left versus right perturbations (next lessons) and the ordering of translation and rotation in twists differ between libraries (Sophus, GTSAM, Ceres, manif).
  • Prefer well-tested libraries. Sophus, manif and GTSAM provide exp, log, adjoint and Jacobians with the edge cases handled.

Limits

The exponential map is a local diffeomorphism near the identity only. Globally it is many-to-one (angle wrapping), and the logarithm is discontinuous at the cut locus (rotation by π in 3D). Methods that work in the tangent space must keep perturbations well inside that neighbourhood.

Common misconceptions

“Lie algebra is just another name for the group.”

The algebra is a flat vector space (the tangent space at the identity); the group is a curved manifold. They are related by exp and log.

“The exponential map of a matrix is entrywise exp.”

It is the matrix power series Σ Aᵏ/k!, not the exponential of each entry.

“The algebra elements are rotations.”

They are angular velocities (infinitesimal rotations); only after exp do they become rotations.

“log and exp are global inverses.”

Only locally: exp((θ + 2π)J) = exp(θJ), so log returns the principal value.

Engineering takeaways

  1. A matrix Lie group is a smooth, closed-under-product set of invertible matrices; SO(2) is the circle of planar rotations.
  2. Its Lie algebra is the tangent space at the identity: for SO(2) the line θJ, with J = [[0, −1], [1, 0]]; its elements are angular velocities.
  3. exp(θJ) = I cos θ + J sin θ = R(θ); the logarithm returns the principal angle.
  4. The algebra is a vector space where adding, averaging and differentiating are legitimate; the group needs the product and exp/log.
  5. Updating, differencing and differentiating poses are done in the tangent space and mapped back with exp and log.

References and further reading

Primary papers and authoritative documentation.

Knowledge check

Three conceptual questions. Write an answer, then reveal the explanation. Your answers stay in your browser.

Question 1

Compute exp(θJ) for θ = π and say what rotation it is.

Explanation

exp(πJ) = I cos π + J sin π = −I = [[−1, 0], [0, −1]]: the rotation by 180°. Note that exp(−πJ) is also −I: log is not unique at π.

Question 2

Differentiate R(θ) = [[cos θ, −sin θ], [sin θ, cos θ]] and show that R′(θ) = J R(θ).

Explanation

R′ = [[−sin θ, −cos θ], [cos θ, −sin θ]]. J R = [[0, −1], [1, 0]] [[cos, −sin], [sin, cos]] = [[−sin, −cos], [cos, −sin]] = R′ ✓.

Question 3

Explain why the entrywise average of two rotation matrices is not a rotation but the average of their angles gives one.

Explanation

Rotations are not closed under addition: the average of R(0) and R(150°) has columns of length cos 75° = 0.26, not 1. Averaging the angles (algebra elements) gives 75°, and exp maps it back to a valid rotation R(75°).

What’s next

In 3D the group is not commutative and the algebra has three dimensions: the skew-symmetric matrices of angular velocity. The next lesson develops that algebra, with the cross product as its bracket.

Next lesson

M10-T2 — SO(3) and Its Lie Algebra

Describe the tangent space of SO(3) with skew-symmetric matrices and rotation vectors.

Nothing below is required to finish this lesson.