Could the U.S. Lose a War with China over Taiwan?
nationalinterest.org
nationalinterest.org
If mainland China launches a military invasion of Taiwan (key word being 'if'):
First, they will have made sure that they have a massive advantage over Taiwan so that victory is virtually certain (as far as these things can be). That's because this will require an operation on the scale of D-day, if not bigger (they will need an air campaign to obtain air supremacy first), and because defeat would be too big a cost both internationally and domestically for the PRC and CPC.
Second, and more to the point, the US will not attack China. They will provide all the support they can to Taiwan in terms of weapons, intelligence, etc. but despite the spin will not send troops to engage the PLA directly.
The US are extremely careful not to commit to any direct involvement for the clear reason they they don't want to and won't because that would mean WWIII for no vital reason, at the very least the possibility to lose by conventional means. A war against China is not winnable on any acceptable terms so the US, like everyone else, will not entertain the possibility unless cornered, for instance if China decided to invade the US (obviously not going to happen).