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:

  1. The logarithm is non-linear.
  2. 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.

Solution 1:

You are correct if we endow $\Bbb R_{> 0}$ with the strange vector space structure in which "addition" is given by the usual multiplication, and "scalar multiplication" is given by exponentiation. When people say that logarithms are not linear, they are usually thinking of giving $\Bbb R$ the usual vector space structure, and with this being understood, then logarithms really are not linear.

The takeaway here is that the statement "the logarithm is linear" depends on what vector space structure you have in mind. With your strange vector space structure, this is true. With the usual one, this is false.

Solution 2:

it's worth noting that with your argument, any bijection is linear!

We have a set $X$ and a vector space $Y$. We have a bijection $$ f: X \to Y. $$

We simply define the operations $$ x+y = f^{-1}(f(x) + f(y)), \;\;\; \lambda x = f^{-1}(\lambda(f(x)). $$ Now $f$ is linear.

The issue is that when we say $f: V \to W$ is linear, we generally already have linear structures on $V$ and $W$ that are not defined in terms of $f.$

Solution 3:

The first statement you have is:

The logarithm is not the restriction of linear map $(\mathbb R,+)\rightarrow (\mathbb R,+)$ to $\mathbb R_{>0}$.

The second one you have is:

The logarithm is a linear map $(\mathbb R_{>0},\cdot)\rightarrow(\mathbb R,+)$.

I don't see any contradiction there. Certainly $f(xy)=f(x)+f(y)$ does not imply $f(x+y)=f(x)+f(y)$ and neither does the latter imply the former, so the statements are unrelated (and both true). It's not like we magically get a contradiction when we refer to both those two equations as a condition of linearity. We call the logarithm "non-linear" because the first statement refers to the canonical vector space structure on $\mathbb R$, which what we'd assume if nothing is specified.

It's also worthy of note that, if we're considering the logarithm, we're probably considering it as a map on a single structure with both addition and multiplication, rather than a map between two separate structures; the identity $\log(xy)=\log(x)+\log(y)$ relates multiplication to addition, which is only particularly remarkable when we've defined both in a sensible way (like in a ring or field).