Mathematicians conceived of black holes long before astronomers actually found any?How?

Without going into the details (which I'm not intimately familiar with), it was possible because physicists and mathematicians (such as Lorentz, Einstein and Minkowski) had developed a good mathematical model of gravitation. Using this model - which is a system of partial differential equations - physicists and mathematicians were able to predict that gravitational singularities should form under certain conditions. As a very (very) simplified example of what I mean, suppose that we have modeled some quantity with the simple ODE

$$ \dot{x}=x^2,\quad x(0)=1 $$ The solution to this equation is the function

$$ x(t)=\frac{1}{1-t} $$

This function exhibits finite time blow-up, since when $t=1$, we have a singularity - a place where $x(t)$ becomes infinite. If the ODE models our system accurately, we should be able to observe this blow-up with measurements. The same is true of gravitational singularities - the model predicts a blow-up, so astronomers went looking for (and found) those singularities.