explainer
Lie groups and Lie algebras: connect robot poses to local motions
Use planar robot poses to understand SE(2), its tangent space se(2), and the Lie bracket. Compare motion order, shrink a commutator loop, and reproduce the calculations in Python.
What you will learn
- Check the group properties of planar rigid motions and explain why motion order matters.
- Derive the matrix form of an infinitesimal planar motion at the identity.
- Compute a Lie bracket and connect it to the leading effect of a shrinking motion loop.
- Distinguish a finite pose, a tangent vector, and the units of a chosen motion parameter.
Before you start
Translate a point one meter to the right, then rotate it 90° about the origin. Reverse those operations and you usually get a different point. This order dependence is part of the geometry a robot's pose calculations must preserve.
A Lie group combines smooth geometry with reversible composition. Its Lie algebra describes infinitesimal motions at the identity. We will build both objects for planar poses, then use a shrinking sequence of motions to give the Lie bracket a concrete meaning.
Describe planar poses and compare motion order
Use right-handed x and y axes, active transformations, and column vectors. A positive angle rotates counterclockwise. Coordinates of points and translations are in meters; angles in equations are in radians. An active transformation moves the point while the reference axes stay fixed.
A planar rigid motion consists of a rotation R and translation t. Its action and homogeneous matrix are:
p′ = Rp + t
g =
[ cos θ, −sin θ, tₓ ]
[ sin θ, cos θ, tᵧ ]
[ 0, 0, 1 ]
The collection of these orientation-preserving planar rigid motions is SE(2), the special Euclidean group in two dimensions. Reflections are excluded. The rotation satisfies RᵀR = I and det R = +1.
In a product RT, the rightmost factor T acts first. Let R rotate 90°, let T translate by (1, 0), and start with p = (1, 0):
- RT: first (1, 0) → (2, 0), then (2, 0) → (0, 2).
- TR: first (1, 0) → (0, 1), then (0, 1) → (1, 1).
The point results differ by √2 meters. The full poses have the same 90° rotation, but RT has translation (0, 1) and TR has translation (1, 0). Their matrices differ, establishing that RT ≠ TR as transformations.
Check the group rules
Write a pose as g = (R, t). Applying g₂ first and g₁ second gives:
(R₁, t₁)(R₂, t₂) = (R₁R₂, R₁t₂ + t₁)
e = (I, 0)
(R, t)⁻¹ = (Rᵀ, −Rᵀt)
These formulas expose the group properties. Composition stays within SE(2). The identity leaves every point unchanged. Every pose has an inverse that undoes its action. Associativity follows from matrix multiplication, so (g₁g₂)g₃ = g₁(g₂g₃).
A group does not require commutativity. Our rotation and translation example shows why that omission matters. It also explains the rotated translation R₁t₂ in the composition rule: adding the two translation columns directly would give the wrong result.
Add smooth coordinates to the group
A Lie group is a smooth manifold whose multiplication and inversion are smooth maps. This lets us differentiate paths of group elements. MIT's definition of a Lie group makes both the group operations and their smoothness explicit.
SE(2) has three local coordinates: one heading and two translations. The heading wraps around a circle, so a global angle convention has a seam. The poses remain smooth when a displayed angle jumps from +180° to −180°.
These three coordinates do not make the group a vector space under ordinary matrix addition. Averaging the rotation matrices for 0° and 180° produces a zero rotation block, which collapses all displacement vectors. That average is not a rigid motion. Tangent spaces provide vector spaces for local calculations while respecting the curved set of valid poses.
Differentiate a pose at the identity
Take a smooth pose curve g(s) that starts at the identity: g(0) = I. Differentiate R(s)ᵀR(s) = I at s = 0. Since R(0) = I, its derivative Ω must satisfy Ωᵀ + Ω = 0. In two dimensions, this forces the form below:
g′(0) = ξ̂ =
[ 0, −ω, vₓ ]
[ ω, 0, vᵧ ]
[ 0, 0, 0 ]
Here ξ = (ω, vₓ, vᵧ), and the hat symbol packages those three coordinates into a matrix. The collection of these matrices is se(2), the tangent space to SE(2) at the identity. Its bottom row is zero because it is a derivative, not a pose matrix.
Adding two such matrices or multiplying one by a scalar gives another tangent matrix. For a twice continuously differentiable curve, the local approximation is g(h) = I + hξ̂ + O(h²). A finite matrix I + hξ̂ need not be a valid pose: its rotation block generally fails the orthogonality constraint.
Units depend on s. If s is time in seconds, ω is radians per second and v is meters per second. In the experiment below, s is dimensionless, and we choose generators with one radian and one meter per unit parameter. We do not interpret these numbers as time rates.
Measure order dependence with the Lie bracket
For a matrix Lie group, its Lie algebra carries an operation called the Lie bracket:
[A, B] = AB − BA
Ordinary addition of tangent matrices is commutative. The bracket records a different structure: how the motions generated by two tangent directions depend on their composition order. It is bilinear and antisymmetric, and satisfies the Jacobi identity. These are the defining algebraic properties described in MIT's Lie algebra lecture.
Let Z = hat(1, 0, 0) generate rotation, X = hat(0, 1, 0) generate x translation, and Y = hat(0, 0, 1) generate y translation, using the unit choices just stated. Multiplying their matrices gives ZX = Y and XZ = 0, hence:
[Z, X] = Y
[X, Z] = −Y
[X, Y] = 0
The first result predicts a small sideways effect when rotation and forward translation are composed around a loop. Two pure translations commute, so their bracket vanishes. A bracket stays in the Lie algebra; a matrix product by itself need not.
Separate a finite loop from its leading effect
Consider this group commutator, with dimensionless ε:
C(ε) = R(ε)Tₓ(ε)R(−ε)Tₓ(−ε)
Here R(ε) rotates ε radians, and Tₓ(ε) translates ε meters along the fixed x axis. In time order, translate −ε, rotate −ε, translate +ε, then rotate +ε. Although the signed rotation and translation parameters each sum to zero, the pose generally does not return to its start.
Direct composition gives zero net rotation and the exact translation:
δ(ε) = (ε(cos ε − 1), ε sin ε) m
δ(ε)/ε² → (0, 1) m as ε → 0
For small ε, the x component starts at −ε³/2, while the y component starts at ε². The leading second-order motion is therefore the y translation predicted by [Z, X] = Y. The matrix statement is C(ε) = I + ε²[Z, X] + O(ε³), a special case of the commutator expansion in MIT's exponential-map lecture.
At ε = 0.25, the exact displacement is approximately (−0.007772, 0.061851) m. Dividing by ε² gives (−0.124350, 0.989616) m. The finite horizontal component remains visible; the limiting bracket does not describe every term of a finite loop.
Compare order and shrink the loop
The upper experiment varies a finite rotation and translation acting on the same point. The complete matrices show both the rotation and translation of each result. Try No rotation to find a commuting case, then Reverse translation to change the direction of the order gap.
The lower experiment uses its own fixed generators and ε setting. Choose Smaller loop: the scaled result moves closer to (0, 1), while the actual displacement shrinks. Both plots use equal horizontal and vertical scales. The lower plot displays the scaled translation, so it is not a drawing of the traveled path.
Use local pose updates in estimation and learning
In robot pose estimation, sensor residuals depend on a pose, and an optimization step proposes a local correction. A three-coordinate correction can be converted to a valid planar motion and composed with the current estimate. This avoids optimizing nine unrelated entries of a homogeneous matrix. Solà, Deray, and Atchuthan develop this approach for robotics estimation, including the Jacobians needed to propagate local changes.
A learned pose-refinement model can use the same representation: predict local correction coordinates, convert them to a pose update, then compose. This construction enforces the pose constraints; prediction quality still depends on the data, objective, and model. Rotational and translational coordinates also carry different units, so losses and step sizes need deliberate scaling.
The Lie group exponential maps a tangent matrix A to a group element exp(A). In particular, exp(sA) is the one-parameter motion generated by A. For a pose g, updates g exp(A) and exp(A)g express the increment in different frames and generally give different results. Declare that convention before deriving a Jacobian or interpreting a learned correction.
The exponential and logarithm maps lesson works through this conversion and its inverse ambiguities. A Lie group supplies composition and smooth structure; it does not, by itself, specify a distance metric. Calling an exponential curve a shortest path or a Riemannian geodesic needs additional assumptions about that metric.
Reproduce the matrices and loop in Python
This standard-library example composes full homogeneous matrices. The print helper removes rounded negative zero only from the displayed text; it does not change the calculations.
from math import cos, hypot, pi, sin
def multiply(a, b):
return [[sum(a[i][k] * b[k][j] for k in range(3))
for j in range(3)] for i in range(3)]
def pose(angle, tx=0.0, ty=0.0):
c, s = cos(angle), sin(angle)
return [[c, -s, tx], [s, c, ty], [0.0, 0.0, 1.0]]
def apply(g, p):
return tuple(sum(g[i][j] * p[j] for j in range(3))
for i in range(2))
def pair(values, digits=6):
parts = [f"{value:.{digits}f}" for value in values]
parts = [f"{0:.{digits}f}" if float(part) == 0 else part
for part in parts]
return "(" + ", ".join(parts) + ")"
r, t = pose(pi / 2), pose(0, 1)
p = (1, 0, 1)
print("RT point:", pair(apply(multiply(r, t), p), 3))
print("TR point:", pair(apply(multiply(t, r), p), 3))
for epsilon in (0.25, 0.05):
loop = multiply(multiply(multiply(
pose(epsilon), pose(0, epsilon)),
pose(-epsilon)), pose(0, -epsilon))
delta = (loop[0][2], loop[1][2])
scaled = tuple(value / epsilon**2 for value in delta)
error = hypot(scaled[0], scaled[1] - 1)
print(f"epsilon = {epsilon:.2f}")
print("translation:", pair(delta))
print("scaled:", pair(scaled))
print(f"scaled error: {error:.6f}")
Expected output:
RT point: (0.000, 2.000)
TR point: (1.000, 1.000)
epsilon = 0.25
translation: (-0.007772, 0.061851)
scaled: (-0.124350, 0.989616)
scaled error: 0.124783
epsilon = 0.05
translation: (-0.000062, 0.002499)
scaled: (-0.024995, 0.999583)
scaled error: 0.024998
The scaled error falls by about a factor of five when ε falls by five. Its leading error is proportional to ε because the unscaled horizontal correction starts at ε³. Taking ε extremely small eventually exposes floating-point cancellation in the direct matrix calculation; a limit is a mathematical statement, not a guarantee that every smaller numerical input improves accuracy.
Try it yourself
Exercise 1. Let R rotate 90°, let T translate two meters along x, and let p = (0, 1) m. Compute RTp, TRp, and their separation. What are the rotation and translation of the inverse of RT?
Show solution: compose and undo the pose
T takes p to (2, 1), and R takes that result to (−1, 2). Thus RTp = (−1, 2). In the other order, Rp = (−1, 0), then TRp = (1, 0). Their difference is (−2, 2), with length 2√2 m.
The pose RT has rotation R and translation (0, 2). Its inverse has rotation Rᵀ, a −90° turn, and translation −Rᵀ(0, 2) = (−2, 0). Applied to (−1, 2), it returns (0, 1). Negating the original translation without rotating it would give the wrong inverse.
Exercise 2. Reverse the generator order to form D(ε) = Tₓ(ε)R(ε)Tₓ(−ε)R(−ε). Predict the limit of its translation divided by ε². Is that quotient defined at ε = 0? Must the finite x translation vanish?
Show solution: reverse the bracket sign
The relevant bracket is [X, Z] = −Y, so the scaled translation tends to (0, −1) m. Direct composition gives translation (ε(1 − cos ε), −ε sin ε), confirming the sign.
At ε = 0, both the numerator and denominator are zero, so the quotient is undefined. Its limit is still (0, −1). For small nonzero ε, the x component starts at +ε³/2 and generally does not vanish. The bracket predicts the leading second-order motion, leaving these higher-order terms to the finite calculation.
Sources and further study
- Pavel Etingof, MIT: Lie Groups I gives the smooth-group definition and properties of group translations.
- Pavel Etingof, MIT: The Exponential Map of a Lie Group develops one-parameter subgroups and the expansion connecting group commutators with Lie brackets.
- Pavel Etingof, MIT: Lie Algebras states the bracket properties and the matrix commutator example.
- Joan Solà, Jérémie Deray, and Dinesh Atchuthan: A micro Lie theory for state estimation in robotics develops local perturbations and Jacobians for practical robot estimation problems.