Bro, it's not correct, we're strong enough to figh against China or US alone(1975 we defeated US, 1979 we defeated China), but we can't fight against US-China combined, so we have to make friend with one, and fight with another.
I don't know what exactly they are teaching in Vietnam history books, but to say Vietnam "defeated" US alone in Vietnam war is rather ridicules.
How did US lose the war? The short version is US was forced to fight the war with severe handicaps and eventually was forced to withdraw due to internal protests.
The long version: During Vietnam war, United States pretty much have advantage in every single aspect of the war----logistic, manpower, firepower, information, etc. However, North Vietnam has a key advantage that makes all those advantage useless----the Chinese government warned US that if US army move past 17 degree parallel, then China will intervene, just like the Korean war. As a result, the US army never set foot north of 17 degree parallel line and even the planes avoid Chinese/Vietnam border where all the production facility of North Vietnam is located. As a result, no matter how well US fought in South Vietnam, no troop in North Vietnam means US simply can't deal a decisive blow.
If you are familiar with Vietnam war history, doesn't it surprise you why US pretty much spent the entire time fighting guerrilla and the North Vietnam force in South Vietnam territory instead of going straight for the source? Isn't cut enemy off at its head and destroy its supply basic tactics in war?
The answer is that they can't. Chinese/Vietnam relationship may have soured after China/Soviet split, but that doesn't change the fact had US tried to attack North Vietnam itself, then they would be doing Korean war #2, only this time with a modernized Chinese army that had nuclear weapon in the works.
On top of the huge strategic advantage provided by China, both USSR and China also send weapons and equipment to North Vietnam. China sent J6 fighters and infantry weapons and Russians built factory for Vietnam along Vietnam/China border.
To sum it up, to say Vietnam "defeated" US alone in Vietnam war is utter non-sense. The more accurate term is that US lost a war due to internal conflict generated by fighting a proxy of two other members of UN security council, aka the big five.
To say Vietnam "defeated" China in 1979 is even more ridiculous. For Vietnam war, Vietnam can at least claim that they meet their strategic objective and the other party admitted de facto defeat through drawn of its troops. No matter how you look at the Sino-Vietnam war, you can't claim there is any strategic objectives met by Vietnam and the Chinese pretty much met every single one of theirs. Here are the long term strategic objectives of both sides of the Sino-Vietnam conflict:
Vietnam objective of the war: Fend off Chinese force to preserve Vietnamese dominance of Southeast Asia.
Chinese objective of the war: Destruction of Vietnam's ability to threaten Southern Chinese borders and Vietnam potential to dominate Southeast Asia.
In essence, after the Vietnam war, Vietnam became the most powerful nation in Southeast Asia and it was poised to conquer the entire region. This is shown by Vietnam conflict with neighboring countries. China did not wish to see a strong opponent at its southern door and proceeded to take Vietnam down a few pegs (or a lot more than that, I will explain) There are other minor objectives for China, such as improving relationship with US and Europe by taking down an ally of USSR, etc.
For the war itself, there really isn't much to talk about. The Chinese army went against its tradition (which is winning wars by outmaneuvering its opponent in strategic and tactical play) and simply carpet bombed everything. You see a mine? Boom! It's gone. You see a factory? Boom! It's gone. The Chinese force was there to remove Vietnam's ability to be an influential player in the international arena by systemically de-industrialize Vietnam. (Remember those factories on Vietnam-China border? Those Russian built factories which were the backbone of Vietnam industry?) And when the conflict ended, every single strategic points along Vietnam-China border belonged to Chinese. Today, Hanoi, Vietnam's capital is still in range of Chinese artillery.
And that is pretty much the Sino-Vietnam war. I am not sure how you can claim victory from a beating like that.
In order to claim victory, typically you need to 1) meet at least one or all of your strategic objectives 2) Ideally you would also want to come out on top on tactical level, but it is not required as long as you do reasonably well. If you don't have 1, then you can't claim victory at all. If you don't have 2, then it can turn in to pyrrhic victory.
For example, China can claim victory in Korean war because they meet all their strategic objectives: drove UN forces from the Chinese border and prevent the collapse of North Korean. At tactical level, the Chinese forces suffered a 1.3 to 1 death/wounded ratio against UN force, which is acceptable consider the Ally vs Axis death/wound ratio is 2:1.
Another example, Chinese Japanese war during WWII and the year leading up to it. China can claim it achieved all the strategic objectives: Defeat of Japanese forces and liberation of all Chinese territories, excluding some far off islands. However, the death/wound ratio is 50:1 China vs Japan; therefore, it is a victory, but a very costly victory.
In Vietnam war, North Vietnam achieved all of its strategic objectives: unification of Vietnam under North Vietnam, become independent nation. At tactically level, the death/wound ratio is 1.25 to 1 North Vietnam vs US/South Vietnam. So Vietnam can claim victory.
In Sino-Vietnam war, Vietnam achieved none of its strategic objectives: Vietnam's ability and potential to conquer southeast is destroyed. At tactical level, the death/wound ratio is 2:1 Vietnam vs China. This is excluding guerrilla and militia forces employed by Vietnam. If those numbers are included, the ratio can be as high as 3.5:1. As a result, the Sino-Vietnam cannot be anything but a Vietnam defeat.