Density theorems and applications