This may be a very stupid question and could be blatantly obvious, but I want to clear the confusion that I have about it. There are two equivalent definitions of the derivative:
Let $g: A \rightarrow \mathbf{R}$ be a function defined on an interval $A$. Given $c \in A$, the derivative of $g$ at $c$ is defined by $$g'(c) = \lim_{x \rightarrow c} \frac{g(x) - g(c)}{x-c}$$ provided this limit exists.
and
Let $g: A \rightarrow \mathbf{R}$ be a function defined on an interval $A$. Given $c \in A$, the derivative of $g$ at $c$ is defined by $$g'(c) = \lim_{h \rightarrow 0} \frac{g(c+h) - g(c)}{h}$$ provided this limit exists.
My question is, what's the formal reasoning why these two definitions are equivalent? For example, are we using the Algebraic Limit Theorem for functional limits? It is very clear to me "intuitively" why they are equivalently, i.e., simply let $x = c+h$ and one can see that in the first definition, as $x$ tends towards $c$ we "get" the expression $\frac{g(c)-g(c)}{c-c}$ while for the second definition, as $h$ tends towards $0$ we "get" the same expression $\frac{g(c)-g(c)}{c-c}$. But such reasoning is certainly not very rigorous and is very primitive, I wish to know why they are equivalent using formally justified reasons for each step in the process. For example, why can one substitute $x = c+h$ into the first definition and why after the substitution does the limiting variable change from $x$ to $h$?
EDIT: To be more precise, let $\phi(x)=\frac{g(x)-g(c)}{x-c}$ and let $\gamma(h) = \frac{g(c+h)-g(c)}{h}$, how can I prove that $\lim_{x \rightarrow c} \phi(x) = \lim_{h \rightarrow 0} \gamma(h)$ with the substitution $x = c+h$?