I'm not sure I understand the use of generating functions in canonical transformations. In particular, why are there four basic canonical transformations? It isn't true that any canonical transformation is one of the four basic types, so what makes them special over any other transformation. Also, why is the generating fuction written in terms of both the new and the old coordinates? Since the old and new are related by the transformation, shouldn't it be possible to write the generating function solely in terms of the old or the new? Also, is there any way to find a generating function given the transformation explicitly?