In linear regression there are two approaches for minimizing the cost function: The first one is using gradient descent. The second one is setting the derivative of the cost function to zero and solving the resulting equation. When the equation is solved, the parameter values which minimizes the cost function is given by the following well-known formula:
$$ \beta = (X^TX)^{-1}X^TY $$
where $\beta$ is the parameter values, $X$ is the design matrix, and $Y$ is the response vector.
Note that to have a solution $X^TX$ must be invertible. I think that even if $X^TX$ is non-invertible we can still minimize the cost function using the first approach (gradient descent). If this is true, what bothers me is which property of gradient descent makes it not vulnerable to this kind of problem.
thanks