The logarithm is non-linear
Almost unexceptionally, I hear people say that the logarithm was a non-linear function. If asked to prove this, they often do something like this:
We have $$ \ln(x + y) \neq \ln(x) + \ln(y) \quad\text{and}\quad \ln(\lambda \cdot x) = \ln(\lambda) + \ln(x) \neq \lambda \cdot \ln(x), $$ and therefore $\ln$ is not linear.
And indeed, the literature is abundant with the claim that...
... a function $f : V \to W$ is linear, if and only if $$ f(x + y) = f(x) + f(y) \quad\text{and}\quad f(\lambda \cdot x) = \lambda \cdot f(x) $$ for all $x,y$ and all scalars $\lambda$.
Often, there is no hint that the symbols $+$ and $\cdot$ on the left belong to $V$, whereas the symbols $+$ and the $\cdot$ on the right belong to $W$.
The logarithm is linear
My proof that the logarithm is a linear function goes like this:
$$\ln(x \cdot y) = \ln(x) + \ln(y) \quad\text{and}\quad \ln(x^\lambda) = \lambda \cdot \ln(x).$$
The rationale for this is that $\ln : \mathbb{R}_{>0} \to \mathbb{R}$, i.e., the logarithm is a function from the $\mathbb{R}$-vector space $\mathbb{R}_{>0}$ (the positive-real numbers), to the $\mathbb{R}$-vector space $\mathbb{R}$ (the real numbers). Vector addition in $\mathbb{R}_{>0}$ is, however, not usual addition, but multiplication. Likewise, scalar multiplication in $\mathbb{R}_{>0}$ is not usual multiplication, but potentiation.
In fact, the linear-algebra definition of linearity is (e.g. Ricardo, 2009; Bowen and Wang, 1976):
A function $f : V \to W$ from a vectors space $(V,\oplus,\odot)$ over a field $F$ to a vector space $(W,\boxplus,\boxdot)$ over $F$ is linear if and only if it satisfies $$ f(x \oplus y) = f(x) \boxplus f(y) \quad\text{and}\quad f(\lambda \odot x) = \lambda \boxdot f(x) $$ for all $x,y \in V$ and $\lambda \in F$.
Another proof goes as follows:
The logarithm is an isomorphism between the vector space of positive-real numbers to the vector space of real numbers. And as every isomorphism is a linear function, so is the logarithm.
Question
We have two conflicting statements here:
- The logarithm is non-linear.
- The logarithm is linear.
Can both statements be correct simultaneously, depending on something I cannot imagine now? But wouldn't this also imply that two conflicting concepts of linearity exist?
Or is this a case of sloppy notation, e.g., abuse of the same symbol $+$ for vector addition or $\cdot$ for scalar multiplication even though two different vector spaces are involved?
Update
The solutions given to rescue the first statement haven't convinced me yet, because they are inconsistent:
- Using usual addition and multiplication on $\mathbb{R}_{>0}$ implies that $(\mathbb{R}_{>0},+,\cdot)$ is not a vector space anymore. But a precondition of the linearity proof is that the domain and the range of $f$ are vector spaces.
- Allowing the domain of $\ln$ to be $\mathbb{R}$ with usual addition and multiplication instead of $\mathbb{R}_{>0}$ doesn't work, because then the image of $\ln$ is the set of complex numbers.
- A mathematically consistent definition of "linearity" for subsets (but not subspaces) of a vector space was given in a comment by @Alex G. Let $S$ be an arbitrary subset of a real vector space $V$, and let $W$ be a real vector space. A function $f : S \to W$ is called "linear" if for all $x,y \in S$ such that $x+y \in S$, then $f(x+y) = f(x)+f(y)$, and for all $x \in S$, $k \in \mathbb{R}$ such that $kx \in S$, then $f(kx)=k⋅f(x)$. However, this definition is not what is meant by the concept of linearity coming from linear algebra. One would actually need to use another term for "linearity" here.