IT IS not hard to find examples of the peculiar divergence between how the world looks from Tehran, Iran's capital, and how it looks in the West. Take the recent release of a long-awaited report on Iran's nuclear programme by the International Atomic Energy Agency, the UN's nuclear watchdog. To Iran's state-controlled television, the report showed Iran's innocence and slapped its detractors in the face. In Washington, DC, the focus was on the report's doubts, which appeared to justify a push for further punitive sanctions.

But in many ways, the sparring capitals look more like mirror images than polar opposites. On different scales, both Iranians and Americans tend to take an imperial view. Both governments demonise the other. They use past resentments to reap political rewards by looking tough.

Yet in both America and Iran, currents of dissent are growing, even inside their administrations. In neither case do the dissenters differ much from their leader's stated objective: for Iran it is to claim a perceived right to nuclear technology; for America it is to perform an assumed duty to stop Iran making atomic bombs. In both cases, critics lambast their leaders for tactics that may take their countries to war.

In some respects, those leaders are oddly similar. George Bush and Mahmoud Ahmadinejad are both deeply religious, referring frequently to God's guiding hand. Both are idealists rather than pragmatists, and skilled at folksy populism. Both have replaced dozens of competent officials with like-minded conservatives. And both are now considered, by a large slice of their countrymen, to be bungling and dangerous. The difference is that it has taken Mr Ahmadinejad just two years in power to achieve the unpopularity Mr Bush has gained after six.

There are differences, of course. Mr Bush may be accused of curtailing civil liberties in pursuit of his war on terror. But his government does not drag women off the streets for maladjusting hijabs, the obligatory covering of head and shoulders, or jail student activists as dangers to national security or smear political opponents as traitors or muzzle their speech.

On the other hand, Mr Ahmadinejad may be bombastic but he has not implied he may bomb America—and could not, even if he wanted to. Oceans and an unparalleled armoury separate America from any conceivable enemy, except small bands of terrorists. The strategic view from Tehran, by contrast, is of guns pointing from every direction, at close range, and of potential treachery from within. Only a paranoid fringe in America thinks the country's constitution or the values underpinning it face an imminent threat of being overturned. That fringe is in charge in Iran.

Mr Ahmadinejad's inner circle consists of zealots determined to keep the flame of the 1979 Islamic revolution burning, no matter how much fuel it takes; in fact, it takes a great deal. Of the literal kind, hydrocarbons, Mr Ahmadinejad is lucky to have plenty to burn. For Iran has the world's second-largest reserves of natural gas and third largest of oil. This president's tenure has coincided with surging prices that have pushed Iran's oil income above $50 billion a year. By some counts, it has earned nearly as much under Mr Ahmadinejad as it did in the two four-year terms of his predecessor, Muhammad Khatami.

But to the dismay of Iranian economists, Mr Ahmadinejad has used this windfall to build immediate political capital rather than invest in the future. He has tirelessly toured the provinces, promising massive spending on local projects while maintaining subsidies that, by some estimates, devour a third of the government's budget and account for some 15% of GNP.

Not only has this postponed what many see as vital reforms. The flood of government cash has helped push annual inflation towards 20%. Property prices have risen even faster, sending rents in Tehran beyond the means of new households when the population pyramid's widest tier bulges in the 20-30 age bracket. Property owners have benefited, but sociologists note that the gap between rich and poor yawns as widely as under the hated shah whom the ayatollahs ousted.

Not that wealthy Iranians are very happy either. Businessmen, unlike ordinary citizens, are painfully aware of how international sanctions squeeze the economy and how tougher sanctions could hurt it far more. Until now, traders have generally found ways to keep going. They have switched en masse from Western to East Asian suppliers, such that in a few short years China has replaced Europe as Iran's main trading partner. They have also found ways to skirt the rather effective American pressure on international banks to avoid dealing with Iran, mostly by working through foreign intermediaries, and in non-dollar currencies.

But such means come at increasing expense. One economist reckons that extra charges to open letters of credit via Dubai add 10-20% to the cost of every transaction. Small businesses courier cash back and forth to the Gulf emirate, but should banking strictures tighten, bigger firms would face serious trouble. The local assembler of Peugeot cars, says a consultant, is not going to be able to pay for 100,000 French-made gearboxes in cash.

Government officials try hard to project confidence. They point, for instance, to a boom in house construction and to Iran's success at gaining self-sufficiency in such things as wheat, steel and cement. Petrol rationing, which sparked widespread protest when introduced in June, has, in fact, sharply cut imports. It is true, too, that despite the sanctions imposed by America since the revolution, Iran has enjoyed two decades of steady if unspectacular economic growth. The country seems mildly prosperous compared with its neighbours, with tidy parks, clean streets and impressive figures for schooling and health care.

We don't really need you anyway

Another common official refrain is that the world needs Iran more than Iran needs the world. There is some truth to this. With its 70m consumers, many of them young, Iran is a hugely tempting market. China and India thirst for Iranian energy, while Europe dreams of finding an alternative to dependence on Russia for its gas.

Yet it is hard, hearing tales of bureaucratic hurdles, corruption and Mafia-like interference by such privileged groups as the Revolutionary Guards, and seeing the level of talent displayed by many Iranian entrepreneurs, not to conclude that a country with such rich natural endowments is performing far below its potential.

Iranian analysts debate whether Mr Ahmadinejad's free-spending ways have bolstered or diminished his base of support. Some argue that the rural poor, long disregarded by the urban elite, have directly benefited from state handouts and still warm to his rhetoric of class retribution. Even the middle class, they say, can see for itself the improvements in infrastructure, such as the underground train systems being built in four provincial cities, as well as for the capital. Others note that in local elections last December, the president's men, who generally fared badly, fared worst in districts where Mr Ahmadinejad previously served in local government. The implication is that those who know him best believe him least.

Iranians grumble openly about the economy. They tend to be less vocal but more worried about Mr Ahmadinejad's other policies. Unbidden, many express dismay at his inflammatory questioning of the Nazi Holocaust, citing this as an example of antics that achieve nothing for Iran. When the mayor of Tehran, Muhammad Qalibaf, a pragmatic conservative, recently called for more “maturity and intelligence” in the handling of foreign affairs, the rumble of approval was almost audible over Tehran's traffic din. His voice joined a chorus that has spread across Iran's complex political spectrum, from the left wing of idealist reformers through the varied hues of conservatism in the centre and up to the margins of the usulgaran (fundamentalist) faction, whose radical right wing Mr Ahmadinejad represents.

Yet such criticism has tended to be muted. Iran is no longer as brutal a police state as in the revolution's early years nor even as oppressive as many of its neighbours. Though Iranians bemoan the ineffectiveness of the reformists who dominated the country under his predecessor, Mr Khatami, many do credit them with dispelling the mood of fear that permeated the 1980s and much of the 1990s.

But under Mr Ahmadinejad, selective repression has intensified just enough to signal that open dissent has again grown dangerous. His fellow fundamentalists who dominate such institutions as the judiciary, the state prosecution service and the police have gleefully carried out orders to harass reformist newspapers, stifle student and labour protests, and crack down on “bad hijab”, supposedly improper adherence to strict Islamic dress codes.

Their efforts have proved quite effective. Most Iranians probably resist the idea of returning to the supposed Islamic purity of the early revolution, yet most are far too preoccupied with getting by to protest. The hijab, even reformists admit, is not much of an issue to the broader public, even though many hate the bullying, hectoring ways by which it is imposed.

Indeed, most Iranians are probably quite proud of their experiment with Islamic-flavoured semi-democracy. Despite the flaws in the system, they tend to respect their institutions. As several young Iranians volunteered to this correspondent, having lived through one revolution, the last thing they want is another.

Knowing the right beards

Besides, Mr Ahmadinejad has had powerful allies. The supreme leader, Ayatollah Ali Khamenei, has directly blessed the fierce morality campaign, and said he considers this the best administration the Islamic Republic has yet seen, though a newspaper close to Mr Khamenei this week accused the president of treating his opponents “immorally”.

Surprisingly to outsiders, who tend to view Iran through the lens of its articulate dissidents, Mr Khamenei remains a revered figure; his office still basks in the shadow of the republic's founding father, Ayatollah Ruhollah Khomeini. Indeed, official portraits of the bearded head of state show a smaller inset of his famously glowering, even more lushly bearded predecessor peering over Mr Khamenei's shoulder.

The supreme leader cultivates an aura of aloofness from mundane affairs, but his backing carries more than moral weight. He directly controls the state broadcasting system and the 125,000-man Revolutionary Guards corps, which mans Iran's borders (so profiting, it is said, from smuggling rackets), liaises with overseas Islamist groups such as Lebanon's Hizbullah and the Palestinians' Hamas, and also runs hundreds of commercial enterprises.

AFP

Revering the president's favourite mosque

Mr Khamenei is also constitutionally charged with setting the broad foreign-policy agenda. He appoints top judges and half the members of the Guardian's Council, a body of clerics that, among other things, vets candidates for political office. The leader has access to a pool of funds that includes pious donations as well as income from several bonyads, holding companies tied to religious foundations.

Still, Mr Khamenei, a shrewd arbiter of Iran's bruising politics, has been careful not to allow the president full rein. Crucially, he has refrained from blocking the rise of conservative rivals of Mr Ahmadinejad, such as Hashemi Rafsanjani, a pragmatic former president, in key institutions.

Yet the supreme leader has so far concurred with Mr Ahmadinejad's hard line on one crucial issue, the nuclear file. This may reflect a similar world view: both deeply distrust Western intentions, sense that offence may be Iran's best defence, and feel that Iran is poised to regain its natural place as the region's strongman.

Iran has, after all, so far got away with defying the UN Security Council's order to stop enriching nuclear fuel. But his support on this score for the president also reflects Mr Khamenei's respect for the skill of a populist who has, far better than his rivals, conveyed to the public a link between possession of nuclear technology and a semi-sacred sense of national destiny.

Clever advertising jingles

This is important, because the nuclear programme is not easy to promote. Practically speaking, it makes little sense. Iran has poured an estimated $10 billion into building a complete, home-grown nuclear industry, yet it has just one nuclear power plant, the Russian-built Bushehr reactor, due to come on stream next year. The same money could have built ten conventional plants of the same capacity, fired solely by the natural gas that Iran currently flares off into the sky, because it has not invested in the technology to recover it. Russia has pledged a ten-year supply of fuel for the Bushehr reactor, meaning that there should be no use, any time soon, for the output of Iran's costly nuclear-enrichment plant at Natanz. The purpose of its heavy-water facility at Arak is even more obscure.

Yet the nuclear issue has been successfully portrayed to the Iranian public as a question not of economics but of national pride. Iranians bristle at the suggestion that they may not need nuclear energy. Why, they retort, should they not have it? The sole reason, as Mr Ahmadinejad insists, is that the West wants to keep Iran backward. Most Iranians appear convinced by their government's repeated assertions that the programme is entirely peaceful. Even if Iran produces a nuclear weapon, comes the common retort, so what? Neighbouring Pakistan, far less stable, has them. So does Israel. Those countries have only existed since the 1940s, whereas Iran has been home to a brilliant civilisation since history's beginning. So the rhetoric goes. Given Iran's sense of itself as a thwarted great power, it is easy to see how the issue has grown so touchy.

Yet unease persists among sophisticated Iranians. Even some religious conservatives understand that the nuclear question is not a Manichean one, pitting the good of Iranian progress against the bad of its enemies' ill will. Western countries, led by America, have been inept at explaining that they do not wish to deny nuclear know-how to Iran but simply do not trust its leaders. But the less outspoken opposition of nearly all Iran's neighbours, as well as of Russia and China (see article), is starting to focus Iranian minds.

The barrage of official praise for the latest report of the UN's nukes-watching agency cannot disguise the fact that it includes some pointed criticisms. True enough, Iran has co-operated pretty much to the letter with the agency. What is missing, the report strongly implies, aside from the required obedience to the Security Council's diktat over nuclear enrichment, is Iran's recognition that it could easily do more to dispel doubts as to its intentions.

It is this point that is starting to cause schisms in Tehran. In a brave move, Shireen Ebadi, a Nobel prize-winning human-rights lawyer, recently called in public for an immediate stop to the enrichment programme. Needless to say, Ms Ebadi is seen as anathema in Iran's ruling circles. Yet her point that Iran would lose little by such a step merely aired in public what more establishment figures say in private. It also served to underline the anxiety generated by another of Mr Ahmadinejad's brash gestures. Following a speech in which he blasted critics of his nuclear policy as traitors, his government announced it would press espionage charges against Hossein Mousavian, who served as Iran's chief nuclear negotiator under Mr Khatami. This, it seems, is what drew this week's sharp rebuke of the president from the supreme leader's camp.

The common explanation in Tehran is that the espionage charge was aimed at tarring the previous administration and reformists in general as dangers to the revolution. Mr Mousavian is known to be close to Mr Rafsanjani—some would say under his protection. Yet this kind of tough domestic politicking also showed up Mr Ahmadinejad's government as dangerously isolated in the world. If there is really nothing to hide about the Iranian nuclear programme, what could there be to spy on?

Mr Ahmadinejad may be correct in judging that, for the time being, he can brazen out his nuclear programme. Most Western countries plainly judge the risks of a military attack on Iran to be greater than its rewards. America is probably beginning to see the advantages of co-operation with Iran in resolving Iraq's woes. But Mr Ahmadinejad is wrong to think that he is home free. The danger of an unwanted outbreak of hostilities, provoked by some chance incident, remains great. Iran will continue to pay a high price, even without toughened sanctions, for its lack of openness on the nuclear issue.

Perhaps most distressing for Mr Ahmadinejad, he is likely to pay a high price in domestic politics for his lack of tact. Assuming there is no American attack on Iran to provoke a nationalist backlash, his radical fundamentalists may well get drubbed in the parliamentary elections in March. In the poll that brought him to power in 2005, some 20m Iranians refrained from voting. Many are itching to get in a word this time. Rather like his nemesis, Mr Bush, Mr Ahmadinejad may find himself facing a punchy parliament packed with people who want to get rid of him.