Air quality within cities is actually a totally different issue from whether living in a city is in and of itself harmful for the environment.
As the OP mentioned, reducing fossil fuel usage within city centers (both power generation and vehicle usage) can dramatically reduce smog and improve air quality within the city. While even more dramatically reducing the city dwellers' environmental footprint.
Living in the suburbs is reliant on largely fossil-fuel burning vehicular transport, which even if electrified, is substantially less efficient than mass transit, cycling, or walking, all of which are much more feasible within a city. Not to mention the sheer land area used for pavements and stormwater drainage and such in spread-out areas.
Cities concentrate pollution and completely overwhelm the local environment's capacity to absorb human impacts. However, they generally reduce overall pollution when compared to suburban or rural living at the same income level.
- never having a medical emergency
- driving 30 minutes to get food
- never going anywhere you can't drive home from