  An a posteriori estimate for the error of a standard Krylov approximation to
the matrix exponential is derived. The estimate is based on the defect
(residual) of the Krylov approximation and is proven to constitute a rigorous
upper bound on the error, in contrast to existing asymptotical approximations.
It can be computed economically in the underlying Krylov space. In view of
time-stepping applications, assuming that the given matrix is scaled by a time
step, it is shown that the bound is asymptotically correct (with an order
related to the dimension of the Krylov space) for the time step tending to
zero. This means that the deviation of the error estimate from the true error
tends to zero faster than the error itself. Furthermore, this result is
extended to Krylov approximations of $\varphi$-functions and to improved
versions of such approximations. The accuracy of the derived bounds is
demonstrated by examples and compared with different variants known from the
literature, which are also investigated more closely. Alternative error bounds
are tested on examples, in particular a version based on the concept of
effective order. For the case where the matrix exponential is used in time
integration algorithms, a step size selection strategy is proposed and
illustrated by experiments.
