# How do you implement the logarithm in terms of an exponential function?

When you first learn about abstract algebra, you learn about how subtraction and division is just addition and multiplication with inverses, i.e.

$$\frac{x}y = x * (\frac1y)$$

And when you learn about exponentials, you learn how the root is the inverse of exponentials:

$$\sqrt{x^2} = x^{\frac22}=x$$

However because exponentials are asymmetrical, there are logarithms of course:

$$log10^{x} = x$$

You learn that subtraction is addition in disguise or roots are exponentials in disguise. However it seems logarithms are also exponentials in disguise, but it seems like their disguise is absolutely impeccable, because their isn't even a concept of how $log_{10}10^{x} = x$

Let me try to explain in Pseudo-Haskell, because I think I can better illustrate my problem this way:

addTwo x      = (+) x 2          -- OR (+) 2 x
subtractTwo x = (+) x (negate 2) -- OR (+) (negate 2) x
idAdd         = (+) x 0          -- OR (+) 0 x

multiplyByTwo x = (*) x 2         -- OR (*) 2 x
divideByTwo x   = (*) x (recip 2) -- OR (*) (recip 2) x
idMultiply      = (*) x 1         -- OR (*) 1 x

powerOfTwo x = (**) x 2
rootOfTwo x  = (**) x (recip 2)
idPower      = (**) x 1

baseOfTwo x = (**) 2 x
logOfTwo x  = (**) (??? 2) x
idBase x    = (**) ??? x


Basically I tried to define something like groups (of course exponentiation has no associativity...), but instead of having a binary operation, I tried to use unary operations in order to identify the inverse and identity element.

You can't.

From a fonction $F$ you try to find a fonction $\varphi$ such that $$\forall x\forall y \quad F(F(x,y),\varphi(y))=x$$

• If $F(x,y)=x+y$ then $\varphi(z)=-z$
• If $F(x,y)=x\cdot y$ then $\varphi(z)=\frac{1}{z}$
• If $F(x,y)=x^y$ then $\varphi(z)=\frac{1}{z}$

(As you see, $F$ is not entirely defined by $\varphi$)

But if $F(x,y)=y^x$ then you need $$\varphi(y)^{y^x}=x$$ Hence $\varphi(y)=x^{y^{-x}}$, and you can't eliminate the $x$'s. So there is not such $\varphi$.

Why ? You need to understand that addition, multiplication and power are defined inductively :

• $x+(y+1)=(x+y)+1$
• $x\cdot(y+1)=(x\cdot y)+x$
• $x^{y+1}=(x^y)\cdot x$

and from that definition on integers, you can extend those fonctions on all reals. But it keeps some very regular behaviour due to the nature of the definition by induction. However $x^y$ is not commutative, and you can only define it by induction on $y$ (and not on $x$).