Chain rule and smooth functions

I have read often the following.

Let $$U\subset \mathbb R^n$$ and $$V \subset \mathbb R^m$$. If $$f: U \rightarrow V$$ and $$g: V \rightarrow \mathbb R^p$$ are smooth functions then $$g \circ f: U \rightarrow \mathbb R^p$$ is also smooth. That should be because of the chain rule.

I have some understanding problems here. Three questions:

1. Why is it stated $$U\subset \mathbb R^n$$ and not $$U\subseteq \mathbb R^n$$ (same for $$V$$)? Can't $$U = \mathbb R^n$$?
2. Why is it explicitly stated that $$g$$ maps to $$\mathbb R^p$$ ? Can $$g$$ not just map to some $$G \subseteq \mathbb R^p$$?
3. Isn't it enought hat $$f: U \rightarrow V_1$$ and $$g: V_2 \rightarrow \mathbb R^p$$ with $$V_1 \subseteq V_2?$$ Or is $$V_1 = V_2$$ really necessary?

Example to 1. and 2.:

Take $$f(x) = x$$ and $$g(x) = x^2$$ which are both smooth. Then $$(g \circ f)(x) = g(f(x)) = x^3$$ is also smooth, so at least in this case it works without problems. Also $$g$$ maps only to $$\mathbb R_{\geq0} \subseteq \mathbb R$$. Are there cases where it will not work this way?

Example to 3.:

Take $$g(x) = \log(x + 1)$$ and $$f(x) = x^2$$. So $$f: U \rightarrow V_1$$ and $$g : V_2 \rightarrow G$$ with $$U = \mathbb R$$, $$V_1 = \mathbb R_{\geq 0}$$ and $$V_2 = \mathbb R_{>-1}$$ and $$G = \mathbb R$$. So, $$V_1 \subset V_2$$. In this case, $$(g \circ f)(x)$$ is smooth but can the fact that $$V_1 \subset V_2$$ instead of $$V_1 = V_2$$ prevent this generally?

• I think you are overthinking the motivation for the notation. – zugzug May 18 at 13:02
• @zugzug Maybe, but maybe not. Notation matters, so I want to be sure. – user3137490 May 18 at 13:07

1) People often use $$\subset$$ and $$\subseteq$$ interchangeably. 2) $$g$$ maps to $$\mathbb{R}^p$$ because it covers situations where it is not injective. Technically, $$g$$ has some image, but it ends up in $$\mathbb{R}^p.$$ 3) If $$f: U \to V_1$$ and $$g: V_2 \to \mathbb{R}^p$$ with $$V_2\subset V_1,$$ you would have to be able to extend the domain of $$g$$ to $$V_1$$ in order for the composition to be defined. Also, being well-defined doesn't mean smooth.
In your example to 3, $$V_1$$ is the image of $$f$$. You wrote it as the domain.
• 1) I know, but that doesn't answer the question? 2) Ok, but then writing $G \subseteq \mathbb R^p$ should work as well in those cases? Why be more restrictive than neccessary? 3) Right, the example was incorrect, I have updated the question. – user3137490 May 18 at 13:53