My question arises from Susskinds book on Special Relativity and Classical Field Theory. (page 102 equation 3.29 to 3.30 and page 105 equation 3.34 to 3.36.)
The relativistic Lagrangian for a free particle is given by the following equation. $$ L = -mc^2\sqrt{1-\frac{v^2}{c^2}} = \frac{-mc^2}{\dot{X}^0},\tag{1} $$ where dot means differentiation with respect to the proper time. The $i^{th}$ component of momentum is given by ($i=1, 2, 3$), $$ P_{i} = \frac{\partial L}{\partial \dot{X^{i}}}.\tag{2} $$
This definition works perfectly fine for the 3 spatial components of relativistic momentum and gives $$P_{i} = m\dot{X^{i}}.\tag{3}$$
However, for the time component of 4-momentum, Susskind uses the relativistic Hamiltonian to derive $$P_{0} = m\dot{X^{0}}.\tag{4}$$
I am aware that the time component of 4-momentum corresponds to the energy, but I would like to know why we can't use the Lagrangian definition: $$P_{0} = \frac{\partial L}{\partial \dot{X^{0}}}\tag{5}$$ here.
I am new to this subject and would be really grateful for any help or insights.