Image copyright AFP Image caption Jinnah's theory remains at the heart of modern Pakistan's identity

In 1940 in Lahore Muhammad Ali Jinnah, the man who founded Pakistan, gave a seminal speech setting out the need for a separate state for Muslims on the subcontinent.

Prior to the division of India in 1947, Hindus and Muslims had lived together across the country. But Jinnah described them as two separate nations.

"It is a dream that the Hindus and Muslims can ever evolve a common nationality," he said.

"Hindus and Muslims belong to two different religious philosophies, social customs and literary traditions. They neither intermarry nor eat together, and indeed they belong to two different civilisations which are based mainly on conflicting ideas and conceptions."

This "Two Nation Theory", as it came to be known, has become the official Pakistani narrative for the creation of the state and key to how Pakistan defines itself.

Pakistan was perhaps the first country to be formed on the basis not of a common ethnicity or language, but religion. Yet at the same time it is not, and never has been, a theocracy.

This dichotomy is behind much of the debate around Pakistan's national identity and issues such as its treatment of minorities.

'Nothing in common'

Before partition, there was real concern among Muslims living in British India at the prospect of becoming a minority in a Hindu-dominated independent India. About one quarter of the population was Muslim.

Image copyright Getty Images Image caption Jinnah (seen here with Gandhi) backed Hindu-Muslim unity before losing faith in the Congress Party

Despite the Congress Party's assertions of its secular values, many Muslims were sceptical and feared that the Hindu majority would seek to marginalise them. Jinnah himself was an advocate of Hindu-Muslim unity before becoming disillusioned with the attitude of Congress.

But did, for example, a Malayalam-speaking Sunni Muslim from southern India really have more in common with a Punjabi Shia from the North than with his Hindu neighbour? There existed vast differences in language, culture and religious interpretations between Indian Muslims, even if they were united by a common faith.

Jinnah was not the first to articulate the Two Nation Theory, but with the creation of Pakistan he transformed it into a political reality.

The theory is now taught to all school children in Pakistan. It is why many see independence as liberation from India, as opposed to independence from British colonial rule.

At a tutoring centre in Islamabad, I asked teenagers why Pakistan was created.

"Hindus and Muslims had nothing in common other than the fact that they shared a land," one said. "Their religion, their values, and their culture were all different. So that was why a new country was needed to get their rights."

Image copyright AFP Image caption All children in Pakistan learn the Two Nation Theory

But when Pakistan was created, more Muslims stayed on in India than left. And then in 1971 Pakistan itself split in two, with the creation of an independent Bangladesh.

"If the Muslims are supposed to be one nation - then how come they are living in three different states?" asks historian and author Ayesha Jalal.

She says the official Pakistani narrative favours teaching ideology over history.

'Not wrong'

But Atta-ur Rahman, a former head of the Higher Education Commission in Pakistan, points to growing levels of intolerance in India towards Muslims as proof that the Two Nation Theory is correct. He claims Muslims who moved to Pakistan have done "far, far better" in terms of literacy levels and economic opportunities than those who stayed in India.

He rejects the suggestion that the independence of Bangladesh following a bloody civil war undermines the idea all Muslims in the subcontinent could be categorised as "one nation".

"It was political interests which led to the division; it doesn't mean the Two Nation Theory was wrong," he said.

It is clear that the theory is key to Pakistan's national identity. Islam is the principal bond between its ethnically diverse inhabitants. The national language, Urdu, is native to a small minority only.

Partition of India in August 1947

Perhaps the biggest movement of people in history, outside war and famine

Two newly-independent states were created - India and Pakistan

About 12 million people became refugees. Between half a million and a million people were killed in religious violence

Tens of thousands of women were abducted

Read more:

To disavow the theory would be to question the strength of the bond holding Pakistan together.

Yet some ethnic groups in Pakistan feel they are treated differently from others. This is particularly the case for people in the western province of Balochistan, where there has been a long-running nationalist insurgency.

Jehanzeb Jamaldini of the Balochistan National Party, which campaigns for greater autonomy, says it would have been better for Pakistan to have recognised different ethnic groups as "four or five different nations" within a federation.

Instead there is a feeling among many in Pakistan that one ethnic group, Punjabis, dominate the rest of the country.

Islamic state?

The Two Nation Theory has also led to debate over whether Pakistan was intended as a secular homeland for Indian Muslims or an Islamic state, and what role religious minorities should play.

Most Hindus left Pakistan at the time of partition but there are about two million who stayed.

Image copyright AFP Image caption Debate continues over whether Pakistan should be a homeland for Muslims or an Islamic state

Image caption About two million Hindus stayed in Pakistan after partition

Ramesh Vankwani, a Hindu member of parliament, says he believes in the theory, yet he also says Hindus and Muslims living in Pakistan "are one nation - Pakistani".

For Mr Vankwani, Jinnah's statements in the lead up to independence are more important.

Just days before Pakistan was created, Jinnah said: "You are free to go to your temples; you are free to go to your mosques or to any other place of worship in this State of Pakistan. You may belong to any religion or caste or creed - that has nothing to do with the business of the State."

For Mr Vankwani this is proof that Jinnah wanted equal rights for all and that Pakistan was not just for Muslims.

But others in Pakistan ask what the point of creating a homeland for Muslims was if it wasn't to be an Islamic state?

Historian Ayesha Jalal is clear that Jinnah envisaged Pakistan as a "homeland for India's Muslims", as opposed to an Islamic state.

But she says that his theory has been used by Islamists "as an ideological device" to justify claims for Pakistan to be a theocratic state.

And as a result, she says, "clarity has gone of how a homeland is distinct from a country run by the guardians of the faith".

'What was the point?'

These nuanced distinctions are lost on many ordinary Pakistanis. I spoke to the father of a university student accused of inciting a mob to beat to death one of their classmates for having committed blasphemy with his allegedly "atheist" views.

Sharafatullah asked me: "We are told Pakistan was created on the basis of the Two Nation Theory. If people are free to be atheists and spread atheist views, then what was the point of creating Pakistan?"

Yet at the same time Islamist parties have never been able to garner significant support in elections.

After Bangladesh was declared independent in 1971, then-Indian Prime Minister Indira Gandhi declared the Two Nation Theory "dead".

In Pakistan it certainly is not, but it continues to feed into debates about the country's identity. At the same time in India, Ms Jalal notes that the rise of right-wing Hindu ideology seems to be a surreptitious endorsement of the idea from a country that has long rejected it.