> Apparently the main part of Pakistan relevant to Afghanistan is the 'tribal regions' mostly not governed by the rest of Pakistan. There your claims of a "mix" seem to be not correct.

They do. The 'tribal regions' are known 'tribal' for a reason. They are dominated by tribes, who have there own traditions & rivalry. They have affiliations with Taliban because of Pashtun traditions. This affiliation goes back even before the Pakistan came into being. Islam is a cultural part of this region but not the sole driving force. They used poppy/heroine for ages but Islam strictly prohibits using drugs. So yet another sample where your nice little narrative doesn't fit.

> Further, much of the problem the US has had with Pakistan is from the strong role of Islam there and in Afghanistan

erm ..US played an important role during the Afghan-Russia war. They actually pumped up the Jihadist sentiment at that time. Religion in the grand scheme has just been a tool to achieve interest.

> For reasons of religion, culture, domestic politics, and foreign policy, Pakistan has been mostly on the side of the Taliban, that is, wants to dominate Afghanistan.

Only foreign policy. Pakistan cannot afford to fight with neighbors on both sides of border. That's the sole reason Pakistan wants to friend whoever comes into power in Afghanistan (apparently the notorious double-game Pak army has been playing with US is because once US goes back they would have to deal with Taliban ..and they want to be in there good books).
Pakistan has also been super-friendly with China but no religion, culture, domestic politics play any role in that. It's only foreign policy.

> My comments about Islam were focused on Afghanistan. The comments also apply a lot to Iran and Iraq

You do know Iraq fought war with Saudia Arabia ..the be and end all of all things Islam ? You do know how things were in Iran before the revolution ? If you start looking things from an economics-perspective then everything fits in place. There are some nut-jobs who leave everything to go and fight for the sake of religion but the majority of the population doesn't do that. They just want good food and good living style regardless of whose in power. Iranian revolution can be traced back to that as well.

> But the main reason for the formation of Pakistan was just Islam -- they wanted an Islamic country. Net, the main culture in Pakistan is just Islam.

then how come there hasn't been any Islamic governing system in Pakistan since the creation? There are gazillion open things in this country which are against the very premise of Islam yet no one talks about that. Pakistan wasn't created by an imam or cleric. The most ironic thing (and I would suggest you should go and study that) is that creation of Pakistan was opposed by virtually every single cleric at that time. Founder of Pakistan (Jinnah) lead a very secular life & wasn't a fan-favourite of Islamic imams at that time. Pakistan was created because Muslims were living a second-class life in all of India. Again economic reasons.

> The main interest in this tread is what the heck is the US going to do about Afghanistan and why? The main content of why is just the role of Islam.

That I agree. But that is not something which you can use as a reason to justify how things work in every Muslim country out there. US invaded Afghanistan at a time when they had right-wing extremists in power. So obviously they'll have to deal with problems in the same domain. You don't need to create grand conclusions out of it.