The Wigner function in paraxial optics I. Matrix