Israel's exit from Lebanon last week on the third anniversary of its entry by armed force invites a look at the costs: the military and civilian casualties; the physical devastation; the failure of American as well as Israeli missions; the buildup of the Syrian/Soviet power position; a Lebanon left up for grabs by Islamic extremists.

Somewhere in these ruins there has to be a lesson. But in order to find it, you must begin by addressing a fashionable fantasy. The Reagan administration lost the war, Israeli and American revisionists would now have us believe, by insisting on cease-fires and otherwise intervening to stop the carnage just when Israel was on the brink of victory.

If you believe that, the lesson of Lebanon is that a meddlesome, overbearing United States should have given Israel its head to tend to its security interests as it saw them. The plain implication is that Israel's security interests are inevitably the same as U.S. security interests.

The true lesson is just the opposite. The record of Lebanon is a record of the U.S.-Israeli relationship at its worst; of mutual interests lost sight of; of a United States protesting ineffectually to an unresponsive Israel. It is a record of U.S. perceptions of its own interests -- and Israel's -- weakly subordinated to the will of the Israeli government.

In the crucial months leading up to the invasion, the only thing the Reagan administration didn't know about Israeli intentions was what pretext the government of Prime Minister Menachem Begin would seize upon to justify invading Lebanon. Well-placed U.S. officials -- from former secretary of state Al Haig, in his memoirs, to the departing U.S. ambassador to Israel, Sam Lewis, in recent interviews -- have amply confirmed the administration's prior knowledge. The previews came from none other than the invasion's mastermind, Ariel Sharon, the Israeli minister of defense at the time.

The record is equally clear that administration officials remonstrated repeatedly from the moment Sharon first laid out his designs at a meeting with Ronald Reagan's special Mideast envoy, Philip Habib, a full six months before the invasion. According to Lewis (on Israeli television last month), Sharon presented in detail a plan that closely approximated the actual invasion. "Habib was dumbfounded," Lewis recalled, as were he and other Americans present, "by the audacity and the political concept that this seemed to involve." Habib "made it extraordinarily clear to Sharon that this was an unthinkable proposition as far as the U.S. government was concerned," Lewis recalled. Sharon called Lewis' account of the meeting a "gross lie." In reply, the State Department said Lewis "described the U.S. position in this matter with complete accuracy. We strongly object to any suggestions to the contrary."

This is talk among allies "irrevocably bound to each other and entangled in a whole variety of ways . . . in the nature of a family relationship," as Lewis recently put it in an interview with The Post?

Hardly. To suggest, as the revisionists do, that the Israelis knuckled under to American pressure at any significant point along the way is to deny the record.

Specifically, the notion that the United States "discouraged the Israelis from running the Syrians out of the Bekaa (Valley) and the Palestinians out of Beirut," as former U.N. ambassador Jeane Kirkpatrick argued recently, flies in the face of known facts. Sharon took more than a year to think up this explanation for the failure of his mission.

And Sharon is his own worst witness. Having persistently refused to pay attention to cease- fires he didn't like, he is in a poor position to blame one that he did observe for snatching defeat from the jaws of an Israeli victory.

As responsible Israelis well know, Israeli forces had run into unexpected stiff resistance. They had taken casualties at a rate increasingly unacceptable at home. The Israelis could not have mopped up all the PLO fighters scattered around Lebanon (the ones in Beirut were escorted out), and still less drive the Syrians out of the Bekaa, without far heavier costs in lives and treasure than Israel was prepared to pay.

Lewis, by contrast, is an impressive witness, the more so since his eight years as ambassador had made him dean of the diplomatic corps and a popular figure in Israel. That he was not known while on duty for questioning Israeli policy makes his questioning, after the fact, no less valuable as a future guide.

An acute concern for Israeli security interests is an American imperative. But it need not come at the cost of Israel's disregard for legitimate U.S. securityinterests. That is the lesson of Lebanon; play it again, Sam.