There are a number of ways for the challenge to President Trump’s “travel ban” to go wrong. But watching the Fourth of July fireworks earlier this week, I found myself dreaming of a way it could go splendidly, triumphantly right.

Though the court’s order promised argument “during the first session of October Term 2017,” at least some of the justices are plainly hoping that the case will be moot by then; indeed, they hinted as much by adding the mootness issue to the “questions presented” by the parties. It’s easy to see why. Mootness would let the justices dodge what they may see as unappetizing choices: they can either strike down the ban and create a lot of new caselaw that may bedevil future presidents, or approve the defiantly lawless thrashings of this uniquely incompetent executive on the other.

If the case is really moot by October, then God bless America, it’s moot. But as we learned in the Trinity Lutheran case last month, this court can find a way to keep even dead cases in a kind of zombie state, staggering toward a preferred doctrinal conclusion. Whatever the state of facts in October, we know that some version of the travel ban is coming back—Trump himself told us so, when he tweeted that he wants to follow this order with a “much tougher version.” Knowing that the issue is coming back, what if the court stopped looking for an institutional exit and instead asked itself what resolution would be right?

I don’t just mean most gratifying to one side or the other from a given political or policy point of view; I mean right as a matter of serious constitutional law. What would that be?

The court should hold that the ban is a palpable and categorical violation of the First Amendment’s prohibition of “an establishment of religion”—one of the worst such violations in American history.

So far, the lower courts have offered the Supremes two ways to decide against Trump. The Ninth Circuit dodged the constitutional issue; instead, its panel reasoned that the ban violates the Immigration and Nationality Act. That statute, the court’s panel argued, forbids an order banning immigrant visas on the basis of nationality. And even if the administration claims an emergency that would justify such a ban, the panel said, the president has not taken the procedural steps required by the INA and the Refugee Act of 1980 before issuing it.

By contrast, the Fourth Circuit went big. Because “the reasonable observer would likely conclude that [the order’s] primary purpose is to exclude persons from the United States on the basis of their religious beliefs,” the en banc court held, the ban violates the Establishment Clause rights of one or more of the individual plaintiffs.

Affirming either opinion will require the court to go well beyond existing precedent. The statutory route will involve looking hard at the administration’s claims of a “national security” rationale for the ban—something courts have been reluctant to do in the immigration context. And the rule against establishment of religion has never—as near as I can tell—been applied in the context of immigration law.

Establishment clause cases are bedeviled by one issue: Whose rights are violated by an “establishment of religion”? The paradox is that because “establishment” violates everybody’s rights, it often does not—under the “standing to sue” doctrine used by the federal courts—violate any particular person’s rights enough to give rise to a “justiciable” lawsuit. Individuals in federal court are supposed to have “particularized” injury—otherwise, the logic runs, they are simply using the federal courts to pursue “generalized grievances” against the government, and should instead turn to the political process.

The Warren Court found a limited exception for “establishment” cases in 1968: The essence of the clause, it said, bars using individuals’ tax money to benefit religion; thus a taxpayer can challenge legislative appropriations of money for religious uses.

Subsequent courts have proved skittish about extending the rule. Under a 1982 precedent, taxpayers can’t challenge transfers of government property to religious bodies, since those aren’t tax funds. In 2007, the Roberts Court held that no one could sue to stop the Bush White House’s promotion of “faith-based” programs; since the program was funded by the office of the President’s overall congressional appropriation, there was no specifically religious appropriation to challenge. In 2011, the court held that taxpayers could not challenge state tax credits for contributions to religious schools, since the benefit to religion was the result of the individual taxpayers’ free choice, not that of the state.

In its travel ban opinion, the Fourth Circuit admitted that standing in establishment cases is often “particularly elusive.” However, it found that one plaintiff (“Doe #1”), at least, has standing because the order “will bar his wife’s entry into the United States and prolong their separation. [It also] sends a state-sanctioned message condemning his religion and causing him to feel excluded and marginalized in his community.”

The justices may hesitate to recognize this basis for standing; it is too easy to mistake for a holding that foreign-born people living in, say, Somalia have individual rights under the U.S. Constitution. That’s not exactly what the Fourth Circuit said, but one can easily imagine the high court brushing aside this claim of injury as nothing more than a general grievance.

There’s a historical reason for the court’s skittishness about establishment standing. The Establishment Clause has always fit badly into the individual-rights reading of the Bill of Rights. More clearly than any other part of the first eight amendments, the prohibition on “establishment” was originally a protection for the states themselves, not individual citizens. That’s because, in 1790, as many as half the American states had their own state religious establishments—tax-based funding for a specific Christian denomination or denominations. Some critics of the Constitution feared that the new national government would use its power to void this system, and create a national establishment.

“The Establishment Clause did more than prohibit Congress from establishing a national church,” Yale Law professor Akhil Reed Amar wrote in The Bill of Rights: Creation and Reconstruction. It also “prohibited the national legislature from interfering with, or trying to dis-establish, churches established by state and local governments.”

Very soon after the adoption of the First Amendment, states began their own process of “dis-establishment.” Within a half-century, the last state establishment had been abolished by law. But not until 1947 did the Supreme Court hold that the bar on establishment was one of the individual rights applied by the Fourteenth Amendment against the states as well as the federal government.

Conservatives have never quite accepted the individual-rights analysis. Indeed, Justice Clarence Thomas continues to fight a rearguard action against the clause as applied to the states. “The Federalist logic of the original Establishment Clause poses a special barrier to its mechanical incorporation against the States through the Fourteenth Amendment,” Thomas wrote in one of his famous separate opinions in 2013.

But even in the rigidly conservative terms set out by Thomas, the “travel ban” case is the strongest candidate for Establishment Clause standing I have seen in my long lifetime.

Why? Well, remember, the court has consolidated two cases challenging the ban. The Fourth Circuit case is Trump v. International Refugee Assistance Project, a challenge by individuals and advocacy groups; the Ninth Circuit case is called Trump v. Hawaii—a challenge to the ban by the state of Hawaii.

The second case, in other words, has been brought by the precise entity the clause was “originally understood” to protect against federal overreach: a state government.

Hawaii is claiming—on behalf of itself and of its religiously diverse people—that the federal government has violated a solemn guarantee made to the states soon after the founding: The new government would not take it upon itself to create a national religion.

This claim deserves to be taken seriously. The ban on establishment is the most broadly worded prohibition in the Constitution. Congress is to make “no law respecting” establishment—not “prohibiting,” as in the “free exercise” clause, nor “abridging,” as in the speech and press clauses; nor “unreasonable,” as in the Fourth Amendment’s “search and seizure clause,” nor “excessive,” as in the Eighth Amendment’s “bail and fines” clause.

No. Law. At. All.

I can’t find an immigration exception in that. Indeed, arguably the ban should apply most strongly in matters of citizenship and immigration. And if “no law” means anything, surely it means that no statute (such as the Immigration and Nationality Act) can be read to silently authorize the president to decide what religions are permitted and which are not, whether in matters of immigration or anything else. How dare the federal government take it on itself to decide what religions shall be permitted in this country, and indeed to shape our population to suit the religious views of a particular president?

Admittedly, the establishment argument faces some questions of proof. Much of the debate in courts below involves what evidence can be cited to show that, in issuing the order, Trump intended to obstruct and reduce Muslim immigration. As long as we are discussing this matter like real adults rather than lawyers, though, does any reader of this column doubt what the executive order was intended to do? Could any judge worthy of the robe seriously argue that, even though all the world can see his nakedness, judges should ignore Trump’s statements and tweets?

Is there evidence of intent to exclude Muslims? As Uncle Junior of The Sopranos used to say, “What are we, children?”

American conservative thought can be oddly self-contradictory; government power over the economy, some on the right argue, is a mortal danger to liberty—but some of these same conservatives contend that government is the appropriate steward of the immortal soul. Even Clarence Thomas, however, should be willing to admit that, if the federal government takes it on itself to decide what religions are welcome here—what gods our people shall worship, who shall form “we the people” at prayer—it has betrayed a very basic commitment made in 1790. Of all the powers a powerful national government might usurp, perhaps the most terrifying would be the power to open and close the roads to heaven.

We know that three justices—Thomas, Samuel Alito, and Neil Gorsuch—are eager to approve the travel ban in its entirety. What of the other two conservatives, and the four moderate liberals? Would any of them like to pass over the lawyers’ gabble of “deference” and “facial neutrality” and tackle a constitutional issue in the high style of the great justices of the past? Are there any who want to leave (perhaps as a parting gift) a legacy as enduring as Justice John Marshall Harlan’s dissent in Plessy v. Ferguson, Justice Robert Jackson’s concurrence in the Steel Seizure Cases, or Chief Justice Earl Warren’s majority opinion in Brown v. Board of Education?

Could these well-paid civil servants bestir themselves not only to rescue the American republic from danger but to strengthen its democratic governance, refresh its ideals, and reclaim its sadly soiled national honor?