Theory and design of freeform gradient index optics and applications in progressive addition lenses