Define the correct logarithm function.

Contains an informal proof that it works and a definition.

Also delete trailing whitespace.