JERUSALEM, AUG. 16 -- For six months the state of Israel has been trying to prove its case. It says that John Demjanjuk, 67, a retired auto mechanic from suburban Cleveland, once ran the diesel engines of the Treblinka death camp in Poland, piping their deadly exhaust into gas chambers crammed with Jews.

Six months into Demjanjuk's Nazi war crimes trial his attorneys face a web of problems as they make their argument that Israel has the wrong man.

The defense team is struggling to recover from infighting that led to the firing of its former leader last month, just days before it was to begin presenting its case. Also, defense attorneys say, they are having problems persuading and paying for witnesses to come to Israel to testify. They say their difficulties are exacerbated by differences between the American and Israeli legal systems and by particular rulings of the three judges trying the case.

But, in debate over the quality of justice in this trial, perhaps the most important disagreement is over the question of why it is being held. Israeli society appears largely to agree that the trial should serve as an educational device, reminding a new Israeli generation of the Nazi genocide program that helped spur the founding of this state after World War II.

Defense lawyers and some independent observers express fears that, by turning the trial into a history lesson, Israel risks prejudicing the court against Demjanjuk.

Tzir Terlow, a former senior judge here, answers a question about the conduct of the trial with a historical essay. Noting attacks in recent years on synagogues in several European cities, he said, "Jews are being killed today simply because they are Jews."

Terlow said such violence leaves him and other Israelis feeling a responsibility to "conduct . . . a battle to remind the world" of the horrors of the Holocaust, which began as anti-Semitism and ended in Nazi Germany's extermination of most of Europe's Jews.

"In all the wars fought over Israel . . . we have lost about 16,000 people," Terlow said softly in an interview last week. "Remember that at Treblinka alone we lost 900,000."

It has been 26 years since Terlow worked here as one of the prosecutors who won the conviction of Adolf Eichmann for directing Nazi Germany's genocide campaign.

"The message of the Eichmann trial was loud and clear, but it has been forgotten," Terlow said.

"We needed the Demjanjuk case to remind our people and the world. Suddenly the Holocaust became a reality again."

Observers with roots in the traditions of Anglo-American jurisprudence worry that the trial's educational role may dilute the justice offered to the bald, beefy Ukrainian who is accused of being the sadistic guard at Treblinka nicknamed Ivan the Terrible.

Demjanjuk's attorneys objected last spring when the trial opened with four days of testimony about the horrors of Treblinka and the Holocaust -- facts that the defense pointed out it does not contest. But the court agreed with the prosecution that the historical review was necessary background to the allegations against Demjanjuk and "can enable a normal human being in 1987 to understand how such things ever occurred."

Walter Anastas, who is monitoring the trial for the Chicago-based Ukrainian American Bar Association, disagrees. "Legal scholars say that when a large amount of emotionally charged material not in dispute is injected into a trial it . . . tends to distort the ability to arrive at a decision on the facts," he said.

Prosecutor Michael Horowitz insisted that emotions raised by such material "are mainly reserved for the public at large and not so much for judges, who are professionals."

But Anastas said that the effect on judges "cannot be dismissed" because "it creates pressure in the community for a conviction."

Anastas' association, in combination with the Ukrainian Canadian Advocates' Society, seems to be the only legal group directly and continuously monitoring the case. In April, the joint group raised specific concerns about the trial in a letter to the Israeli government. It protested "spectacle-like elements," including frequent visits by top government officials and groups of school children, and continuous radio and TV broadcasts.

The Ukrainian lawyers also questioned the court's admission of hearsay evidence -- including depositions from three survivors of Treblinka, now dead -- identifying Demjanjuk as Ivan the Terrible.

A response from the Justice Ministry defended the use of hearsay evidence because of "the enormity of the Holocaust and the universal obligation to bring Nazi war criminals to justice," combined with the problem of losing direct testimony with the deaths of aging witnesses. Because of the "assumed trustworthiness of these persons' testimonies," the ministry wrote, Israel accepts their hearsay depositions.

Terlow, the former judge and Eichmann prosecutor, said exceptions to accepted rules of evidence have been allowed sparingly in Israel's two war crimes trials, and emphasized that the experience of Demjanjuk's judges would prevent them from being improperly swayed.

Americans at the trial, including attorneys and tourists, expressed shock last week at the active intervention of the judges.

Alison Bender, an American freelance journalist monitoring the trial, agreed that the judges' aggressive questioning can give the impression that "they've made their minds up," but said, "They're tough on the prosecution, too."

Israeli attorneys say that because there are no jurors to influence with their questioning, the judges are free to question witnesses critically and to chastise defense or prosecution lawyers in open court. But, because of numerous clashes between the judges and Demjanjuk's more flamboyant lawyers, some observers say the judges leave the impression that they are favoring the prosecution.

Anastas said the judges' interventions are "unbelievable" to an American lawyer. "Some of it may be due to the differences in the systems," he said, but "it weakens the public impression that justice is being done."

"It is very difficult to evaluate how it is affecting" the quality of justice, Anastas said.

Three weeks into its case, the defense still seems in disarray. Last month, a running conflict within the team led the Demjanjuk family to fire Buffalo, N.Y., attorney Mark O'Connor, who had led the defense. Only last week did Toronto attorney Paul Chumak receive Israeli approval to join the team.

The defense must rebut five survivors of the Treblinka nightmare who have identified Demjanjuk as the sadistic guard who herded Jews into the gas chambers. It must also counter the single piece of documentary evidence: a Nazi SS identification card that places Demjanjuk at Trawniki, a camp in Poland where Ukrainian prisoners of war were trained to help run Treblinka and other Nazi death camps.

Demjanjuk says that during the time he is accused of having helped run Treblinka, he was held in POW camps and fought in a Nazi-organized turncoat army against the Soviets. His own testimony, which opened the defense presentation last month, was contradictory and confused.

The defense says it will call Treblinka survivors who do not believe Demjanjuk is Ivan the Terrible. But, they say, they are having trouble persuading Jews to testify in Demjanjuk's behalf.

"Some of them have told me they fear they will not be able to be buried in Israel if they testify," said defense attorney John Gill.

The defense says the Trawniki ID card is a Soviet forgery meant to discredit Demjanjuk and, by extension, the anticommunist Ukrainian exile communities in the West. The Soviet Union offered the card with no explanation of how Demjanjuk might have lost it or where it was found.

The prosecution brought numerous technical experts who declared that the paper, stamps and signatures on the card were authentic, and that the photo showed a young John Demjanjuk. The defense's first effort to rebut that evidence foundered last week when the prosecution forced a Florida document analyst to back away from part of her testimony that the card was forged. The judges joined the prosecutors in questioning her competence to testify.

In an interview, defense attorney Gill, who is from Cleveland, said the delays caused by the earlier infighting have left the defense team behind in finding and preparing witnesses, a problem he said is magnified by the court's refusal to grant the defense time to reorganize after the firing of O'Connor. Gill said he and Chumak might leave the courtroom case to their Israeli colleague, Yoram Sheftel, while they seek new witnesses in the United States.

Gill said the team faces "perpetual" money problems.

"To pay an expert witness from the U.S. to testify for just a couple of days may cost us $5,000," he said.

The trial is being financed by family fund-raising efforts in Ukrainian communities in the West.

Demjanjuk remains "an eternal optimist," Chumak said. He said Demjanjuk's cell walls, in a prison about an hour from Jerusalem, reflect the sources of his faith that he will be acquitted.

"His cell is papered with hundreds of letters, Christmas cards and Easter cards from well-wishers, and with pictures of Christ and the Virgin," Chumak said. "He showed me a notebook where he keeps track of his correspondence, putting x's by each letter he gets and answers."