# About the definition of a Borel measurable function in "Measure, Integration & Real Analysis" by Sheldon Axler.

I am reading "Measure, Integration & Real Analysis" by Sheldon Axler.

2.35 Definition measurable function
Suppose $$(X,\mathcal{S})$$ is a measurable space. A function $$f:X\to\mathbb{R}$$ is called $$\mathcal{S}$$-measurable (or just measurable if $$\mathcal{S}$$ is clear from the context) if $$f^{-1}(B)\in\mathcal{S}$$ for every Borel set $$B\subset\mathbb{R}.$$

We have been dealing with $$\mathcal{S}$$-measurable functions from $$X$$ to $$\mathbb{R}$$ in the context of an arbitrary set $$X$$ and a $$\sigma$$-algebra $$\mathcal{S}$$ on $$X.$$ An important special case of this setup is when $$X$$ is a Borel subset of $$\mathbb{R}$$ and $$\mathcal{S}$$ is the set of Borel subsets of $$\mathbb{R}$$ that are contained in $$X$$ (see Exercise 11 for another way of thinking about this $$\sigma$$-algebra). In this special case, the $$\mathcal{S}$$-measurable functions are called Borel measurable.

2.40 Definition Borel measurable function
Suppose $$X\subset\mathbb{R}.$$ A function $$f:X\to\mathbb{R}$$ is called Borel measurable if $$f^{-1}(B)$$ is a Borel set for every Borel set $$B\subset\mathbb{R}.$$

If $$X\subset\mathbb{R}$$ and there exists a Borel measurable function $$f:X\to\mathbb{R}$$, then $$X$$ must be a Borel set [because $$X=f^{-1}(\mathbb{R})$$].

I wonder why the author didn't define "a Borel measurable function" as follows (the author wrote this definition before Definition 2.40 but the author rewrote it as Defintion 2.40. Of course, the both definitions are equivalent.):

2.40' Definition Borel measurable function
Suppose $$X$$ is a Borel subset of $$\mathbb{R}.$$
Suppose $$\mathcal{S}$$ is the set of Borel subsets of $$\mathbb{R}$$ that are contained in $$X$$.
Then, $$(X,\mathcal{S})$$ is a measurable space.
Suppose $$f$$ is a function from $$X$$ to $$\mathbb{R}.$$
If $$f$$ is $$\mathcal{S}$$-measurable, then $$f$$ is called Borel measurable.

Its more useful the given definition, because it doesn't depend on the $$\sigma$$-algebra in $$X$$. I mean, using the definition of the book, if $$f$$ is Borel measurable it means that $$\sigma (f)\subset \mathcal{S}\cap \mathcal{B}$$, where $$\sigma (f)$$ is the $$\sigma$$-algebra defined in $$X$$ by the preimages $$f^{-1}(B)$$ of the Borel sets $$B\subset \mathbb{R}$$, and $$\mathcal{B}$$ is the Borel $$\sigma$$-algebra of $$X$$.
Then the definition of the book is more useful because it doesn't depends completely in $$\mathcal{S}$$ if not in $$f$$. Thus it's possible that a function will be Borel measurable but $$\mathcal{B}\not \subset \mathcal{S}$$. To be more clear: in practice if $$f$$ is Borel measurable you can work as if $$\mathcal{S}$$ is the Borel $$\sigma$$-algebra, as working with $$f$$ you just need $$\sigma (f)$$, what is a sub-$$\sigma$$-algebra of $$\mathcal{B}$$.