The president remarked on Monday that the United States would intervene militarily if mainland China were to attack Taiwan.