On Do Carmo's book Riemannian Geometry in the chapter $0$ we have the following theorem:
Let $X,Y$ be differentiable vector fields on a differentiable manifold $M$, let $p\in M$ and let $\phi_t$ be the local flow of $X$ in a neighborhood $U$ of $p$. Then $$[X,Y](p)=\lim_{t\rightarrow 0}\displaystyle\frac{1}{t}[Y-d\phi_tY](\phi_t(p))$$
To prove this theorem he use the following lemma:
$h:(-\delta,\delta)\times U\rightarrow \mathbb{R}$ be a differentiable mapping with $h(0,q)=0$ for all $q\in U$. Then there exist a differentiable mapping $g:(-\delta,\delta)\times U\rightarrow \mathbb{R}$ with $h(t,q)=t g(t,q)$; in particular, $$g(0,q)=\displaystyle\frac{\partial h(t,q)}{\partial t}\large|_{t=0}$$
I have some doubts in the prove. For completeness I post it here:
Proof: Let $f$ be a differentiable function in a neigboorhood of $p$. Putting $$h(t,q)=f(\phi_t(q))-f(q)$$ and applying the lemma we obtain a differentiable function $g(t,q)$ such that $$f\circ\phi_t(q)=f(q)+tg(t,q)\text{ and } g(0,q)=Xf(q)$$ Accordingly $$((d\phi_t Y)f)(\phi_t(p))=Y(f\circ\phi_t))(p)=Yf(p)+t(Yg(t,p))$$ Therefore $$\lim_{t\rightarrow 0}[Y-d\phi_tY]f(\phi_tp)=\lim_{t\rightarrow 0}\displaystyle\frac{(Yf)(\phi_tp)-Yf(p)}{t}-(Yg(0,p)) $$ $$=(X(Yf))(p)-(Y(Xf))(p)$$ $$=((XY-YX)f(p)=([X,Y]f)(p)$$
I do not understand two details in this prove:
Why $g(0,q)=Xf(q)$ I know that it follow from the lemma and the definition of local flow, but I want some detail to prove this claim.
Why $$\lim_{t\rightarrow 0}\displaystyle\frac{(Yf)(\phi_tp)-Yf(p)}{t}=(X(Yf))(p)$$ Why this equation holds?
Thanks!