If you increase density, you should be avoiding the need to improve public transit, as more people will be closer to their destination than it's worth driving to.
For the same population increase, less density means people have to travel farther to get to their destination. More people travelling farther necessitates more public transit
Suppose that you have a grid-like road network across an area of 100 square miles, where intersecting roads go north-south and east-west and roads are half a mile apart. If you want to get from one corner of the square to the adjacent one, you have to travel 10 miles. If there are a million people doing this, you have ten million vehicle miles.
Now suppose you compress this many people into an area of 25 square miles, where the roads are still half a mile apart. Now the distance along one of the edges is 5 miles and the same million people only have to travel 5 million miles. But now instead of having 400 miles of roads (10/0.5 * 10 on each axis), you have 100 miles of roads (5/0.5 * 5 * 2), so each road has twice as many cars, or each bus has to carry twice as many passengers or whatever.
This is why mass transit works in cities and not in the suburbs. In a city you have enough passengers to fill the bus or subway car, in the suburbs you don't. But if you increase the density without putting in any mass transit, you just get more traffic.
On the other hand, the people who say we can't increase density until we build mass transit are full of crap. You can add a bus route in a day, you just buy a bus and hire a driver. In urban areas subways are generally more efficient, and those take time to build, but you can run a bus until the subway is built. It's no excuse to hold up housing construction.
You can't assume that the number of cars is a constant though. As point A and point B become farther apart, car usage goes up. When they become closer together, car usage scales down.
But as point A and point B become closer together, it takes less time to get there by car and then people do it more often. Unless traffic congestion eats the time savings, implying that there is high traffic congestion.
Cities are populated by people, not cars. As point A and point B become closer, people are less likely to drive.
If your mailbox is attached to your house, you can lean out your front door to get your mail. If your mailbox is at the end of your 20 foot driveway, you take a few steps to get your mail. If you live on a farm, and your mailbox is down a several hundred yard driveway, you might hop in your side-by-side UTV. If your mail goes to a Post Office Box in town, you might hop in your truck and pick it up while running errands.
If things that had been a 10 minute drive become a 5 minute drive, now they're worth it when before they weren't. You go to the shop instead of waiting 2 days for Amazon. You go to the shop you like more instead of the one you like less even though the lesser one is closer, because now the difference isn't as big.
There's a finite number of trips people can practically do - just because they live next door to work doesn't mean they'll commute more than twice each day (close enough people will return for home for lunch perhaps).
As traffic and travel times lessen, people do travel further and more, but only to a point.
But who was contending otherwise? You don't need it to be infinite, to be a problem all it has to do is not allow the reduction in driving because now distances are shorter and sometimes people can walk to not exceed the increase in density because now four times as many people are in the same area. Which it might not have done even without this, depending on how much more often shorter distances cause people to walk.
If you increase density, you should be avoiding the need to improve public transit, as more people will be closer to their destination than it's worth driving to.
For the same population increase, less density means people have to travel farther to get to their destination. More people travelling farther necessitates more public transit