A symplectic six-dimensional thin-lens formalism for tracking