MANY FOREIGNERS have virtually written off Lebanon. They see its politics as a jungle and locate the solution, if they think any at all is possible, in a Syrian-Israeli partition or condominium. Many Lebanese, however, are conspicuously unready to yield up their chances for a national rebirth, notwithstanding the divisions that have rent the country and the cruelties that have been inflicted upon its citizens, often by each other.

The clearest evidence of their faith is that they are clinging to the rail of the Lebanese constitution, which mandates the start of a new six-year presidential term tomorrow. In August, Bashir Gemayel was elected, even though the country was still a war zone occupied by foreign powers. He was cut down last week -- his death cost Lebanon its distinction as the lone Arab country not to have lost a head of state to violence. By yesterday, however, the Lebanese had collected themselves and replaced him with his older brother, Amin.

What stands out in yesterday's election in parliament is that Mr. Gemayel's would-be competitors among his fellow Maronite Christians fell away, and his Moslem erstwhile rivals united to make him Lebanon's first one-ballot president by a margin of 77 to 0, with 3 abstentions. Enough is enough, everyone seemed to be saying. The vote for Bashir had been 57-1-4.

Bashir Gemayel was first of all a militia leader in Lebanon's civil war who had made an impressive but late start on trying to conciliate Lebanon's disparate factions. Amin Gemayel, a 40-year-old lawyer who has been a leader of his clan's Phalangist party and has served in parliament for 12 years, is regarded as better suited by both temperament and experience to bring Lebanese together. This reputation helps explain why Moslems accepted his disavowal of any Phalangist responsibility for the West Beirut massacre, although some Phalange militiamen--renegades, he says--took part in it. The worrisome flip side of this explanation, of course, is that Mr. Gemayel may not control his men.

That he will be sorely tested goes without saying, not least by Israel which, despite everything, still seems inclined to use its Lebanese presence to bargain for an early peace treaty with Beirut -- a treaty whose premature making would put at jeopardy the consensus that is Lebanon's best prospect for escaping from darkness. In making the effort, Mr. Gemayel will need full help from the United States and all of Lebanon's other friends.