We 100 percent lost in Afghanistan, literally defeated by the Taliban everywhere except the capital city and a small ring around it. The rest is Taliban controlled, and they only got more territory the longer we fought. No matter what we "liberated" the Taliban took it back the moment we left. Just not enough troops by us.
Historical backing of this? As in actual cited sources from anywhere, really? This is all just so wrong, by the general historical consensus of the world's bookkeeping.
The Taliban were pushed back and had an all-time low (supporter/manpower wise) in 2006 where they even wanted to sign treaties promising that they would no longer use Afghanistan as a base of offensive operations (which we ignored), and only controlled small regions, not until much, much later did they experience a resurgence in the world as a whole and even now are not as influential as they used to be in Afghanistan.
They did not "take" everything back the moment "we" left, in the majority of the military exercises waged against them (I said majority before you go ballistic and name one or three contrary examples).
Lastly, thinking "more troops" would have solved things is probably the most idiotic thing I've ever heard anyone babble about the conflict, as this is in no way shape or form a classic war of old where boots on the ground fixes everything, and is instead a conflict with much deeper roots then just manpower.