In this paper we prove the following result. If A is a Hurwitz matrix and f is a rational function that maps the open left half of the complex plane into the open unit disc, then any Hermitian matrix P>0 which is a Lyapunov matrix for A (that is, PA+A*P<0) is also a Stein matrix for f(A) (that is, f(A)*Pf(A)-P<0). We use this result to prove that all A-stable approximations for the matrix exponential preserve quadratic Lyapunov functions for any stable linear system. The importance of this result is that it implies that common quadratic Lyapunov functions for switched linear systems are preserved for all step sizes when discretising quadratically stable switched systems using A-stable approximations. Examples are given to illustrate our results. © 2013 Elsevier B.V. All rights reserved.