TITLE: Wrong use of function notation $f(n)$
QUESTION [6 upvotes]: I've recently read in a book about computational complexity theory:
$$ O(f(n)) = \{g:\mathbb N \to\mathbb R \cup \{0\} : \exists \xi > 0,n_0\in \mathbb N\;\: g(n) \leq \xi \cdot f(n) \;\: \forall n \geq n_0 \} $$
But I think it should be $O(f)$ since the notation $f(n)$ denotes the image of $n$ under $f$. Is this correct? Thanks in advance.
Edit: What is your opinion about $O(\log n)$? Should we consider $\log n: \mathbb N \to\mathbb R^+\cup\{0\}, n \mapsto \log(n)$?

REPLY [2 votes]: You're correct. It should be $O(f),$ or else $(Om \in \mathbb{N})(f(m)),$ but certainly not $O(f(m))$. Actually, the best solution would be to write: Let $\mathbb{O}(f(m))$ be shorthand for $(Om \in \mathbb{N})(f(m)).$ So, whenever you see the author abusing notation by writing $O(f(m))$, just think $\mathbb{O}(f(m))$ and you'll be fine.