Correct. Canada is a member of Nato. And Nato has obligation to act if its member is under attack. And
trigger happy US chose the full blown invasion as a retribution. So we end up brigning democracy and so on. Although many questions still remain unanswered. E.g, if harbouring (not even directly sponsoring) a group that conspires and executes attacks against other countries should be equivalent to a declaration of war, maybe US itself should be invaded for all the uncounted instances when it did the same (Chile, Nicaragua ....)?
Your line of thinking is quite disturbing. The 'trigger happy' US waited a month before it invaded Afghanistan after the attacks of 9/11. Another fallacy you claim is that the Taliban were not even directly sponsoring Al Qaeda. NATO leaving Afghanistan will hand the country back to the Taliban and give Al Qaeda a place to organize and carry out attacks worldwide. It's obvious.