Increasingly, the biggest fights in American politics aren’t in Washington. They’re fights between different levels of government, controlled by different parties but connected by thick tissues of funding and policy.

The first major challenge to the Donald Trump administration will come from cities: the last redoubt of blue America. It could happen in New York, LA, Chicago, Philadelphia — or all of the above and dozens, or hundreds, more.

And it’s going to be over immigration.

Trump and his administration have made it clear that they believe cities are obligated to help the government maximally enforce immigration law. And he’s promised, in his first 100 days, to “cancel all federal funding to Sanctuary Cities” — cities that refuse to provide assistance to federal immigration agents.

“We will end the sanctuary cities that have resulted in so many needless deaths," Trump said during a campaign speech in September — blaming “sanctuary” policies for shielding immigrants who then killed American citizens. "Cities that refuse to cooperate with federal authorities will not receive taxpayer dollars.”

Many of America’s biggest, bluest cities welcome the fight. They’ve proudly declared themselves “sanctuaries,” or made it clear, in other ways, that they’re committed to protecting their immigrant residents even at the risk of federal funding.

The week after the election, Chicago Mayor Rahm Emanuel promised immigrants who were “very nervous, filled with anxiety” about Trump: “You are safe in Chicago. You are secure in Chicago. And you are supported in Chicago.”

“It will always be a sanctuary city,” Emanuel declared.

It’s a bold stance. But it might be a hard one to maintain. As the Trump administration goes from words to action, and cities are forced to put their money where their mouths are, both sides are likely to encounter more trouble than they might expect.

Trump ran a campaign predicated on the idea that he was making a certain kind of America great again — one that didn’t include most immigrants. But even though cities are a huge driver of economic activity in America, they depend on a lot of federal money to keep them running smoothly. Emanuel’s Chicago, for example, relied on federal grants for $15 billion of the $90 billion it expected to have available to spend in 2017 on city services.

The Trump administration could define “sanctuary city” however it wants, and how effectively Trump will be able to act on this threat depends greatly on which definition he picks. And depending on how far Trump goes, he could be putting the budgets of America’s biggest, bluest cities at risk.

Emanuel and other mayors have promised protection and defiance. But the stakes for them are high — these cities are risking a large fraction of their municipal budgets — and their victory isn’t at all assured.

If the Trump administration really wants to pick a fight with blue America over immigration, it could prosecute a long, drawn-out battle — one that both sides aren’t particularly interested in backing down from.

The federal government needs cities’ help on immigration — but cities have good reason not to give it

“Sanctuary city” is not an official government term. It has no legal meaning. President-elect Trump, characteristically, has promised to do something that sounds dramatic, but that won’t actually be that straightforward — and hasn’t offered any details about how it would actually look in practice.

Lots of people use the unofficial term “sanctuary city” to refer to local jurisdictions (not just cities, but counties and sometimes states) that don’t fully cooperate with federal efforts to find and deport unauthorized immigrants. If that sounds vague, that’s because it is, and it gets at the tension between federal policy and local law enforcement generally used to carry out those laws.

The federal government heavily relies on local law enforcement to identify and detain immigrants. This relationship is a big reason deportations went up exponentially during the Bush and Obama administrations: from 189,000 a year when Bush arrived in office to 400,000 a year in the late 2000s and early 2010s.

Here’s one way to think about the impact of the local “force multiplier.” In 1996 (the year a law was passed creating new opportunities for local-federal immigration collaboration), 70,000 immigrants were removed from the US. That includes both immigrants caught at the US border, and those deported from communities within the country.

Each year, from 2011 to 2014 — the peak of local-federal immigration cooperation — a single local-federal program, Secure Communities (which checked immigrants booked into local jails against federal databases), resulted in the deportation of more than 70,000 immigrants. (In 2012, it resulted in 83,000 deportations.) Secure Communities got more immigrants deported during those years than the entire federal government had in 1996.

But that cooperation hasn’t always been smooth. Local resistance — often thanks to pressure by immigrant activist groups, who’ve had an easier time exerting leverage over self-identified progressives in local government than with either the Bush or Obama administrations — can cause problems for the federal government.

Local police departments aren’t required to help the federal government do whatever it wants, and since immigration law is federal law, it makes sense that catching unauthorized immigrants might not be a local law-enforcement priority. After all, local police don’t go out of their way to enforce federal tax law, either.

And a lot of police think it’s a net negative for local cops to enforce immigration law — it makes immigrant communities afraid of police, and less likely to report crimes or cooperate with investigations in, say, murder cases.

Exactly how much assistance local governments should provide in immigration enforcement is an ongoing fight — the Obama administration’s been fighting it for eight years — and there are nearly as many answers to it as there are jurisdictions. So what, precisely, a city has to do in order to qualify as a “sanctuary city” becomes extremely important.

Trump could target 10 cities — or 300. And that’s the problem.

If the Trump administration wanted to define “sanctuary city” as conservatively as possible, it might start with a memo written this summer — written by an Obama administration office — which alleged that some of America’s biggest cities weren’t just failing to help with federal law, but actually violating it.

Under federal law, state and local governments can’t prohibit their employees from sharing information with the federal government (if they so choose) about someone’s immigration status. (They’re allowed to have broad confidentiality policies in place that protect immigration information along with other kinds of personal info.)

The memo, written by the office of the inspector general for the Department of Justice, concluded that many of America’s biggest cities had policies that, depending on how they were applied, could “restrict cooperation with ICE in all respects” — and therefore violate the law.

The memo only looked at 10 of the cities and states that get the most DOJ funding, including cities like New York City, Chicago and Philadelphia, as well as the states of California and Massachusetts. Those jurisdictions represent 63 percent of active DOJ grants through three offices — so they wouldn’t be a bad place for the Trump administration to start (though plenty of other jurisdictions that receive federal funding could have similar restrictions on information-sharing).

If the Trump administration wanted to punish not only cities that might violate federal law, but those that don’t help with enforcing it, it could cast a much wider net.

It could go with the definition of “sanctuary cities” provided by the most recent defunding bill — any city that bans information-sharing, or that has refused “to cooperate with a request for a detainer.”

Legally, Immigration and Customs Enforcement can’t require cities and states to hold people or turn them over; instead it files what’s called a “detainer” — a formal request — and local law enforcement decides whether to honor the request or not. Hundreds of local law enforcement agencies have turned down thousands of detainer requests in recent years. One estimate found 155 jurisdictions had denied requests between January 1, 2014, and June 30, 2015. All of those jurisdictions could be on the hook.

Or it could go with the definition that Jessica Vaughan, of the Center for Immigration Studies (which advocates for lower immigration levels and stricter enforcement), uses for her list of “sanctuary cities”: “any jurisdiction that has a policy that in any way interferes with immigration enforcement, or shields criminal aliens from detection.”

By Vaughan’s count, there are currently 305 sanctuary jurisdictions across the US. Those jurisdictions include four entire states — California, Colorado, Connecticut, and New Mexico — as well as seven of the 25 biggest cities in the country and 16 of its 25 biggest counties.

The point is that the Trump administration has a lot of leeway in making a determination in what is considered a “sanctuary city” — and could draw up its own list accordingly. It’s this vagueness that could have a chilling effect on local jurisdictions, making local law enforcement — and undocumented immigrants themselves — change their behaviors in anticipation of the coming crackdown.

Cities are being defiant so far — largely because they don’t think the threat’s all that serious

So far, many local governments are anything but intimidated by the Trump administration’s threats. Dozens of cities that could count as “sanctuaries” have already made it clear that they won’t change their policies even at the risk of losing federal funding.

It’s a way for blue cities to stand up to a suddenly deep-red federal government, and to do so in the name of protecting some of their most vulnerable residents. It doesn’t hurt that because the definition of “sanctuary city” is fuzzy, cities can make it sound like they’re saving their unauthorized-immigrant residents from getting turned over to ICE and deported, even if that’s not how it really works.

But cities and agencies that aren’t looking for a big political fight are more cautious. Some small towns, like Storm Lake, Iowa, plan to keep protecting their immigrant residents — but avoid the term “sanctuary city.” “We're getting along just fine, we don't need to take on that,” Storm Lake’s city manager told Vice’s Meredith Hoffman.

And local officials who are most directly under threat from federal defunding — police officers — are even more squeamish.

“I don’t think people understand what it would mean to cut off federal assistance,” one California police officer told the Intercept. “I’d lose all my (organized crime task force) funding, my investigative assistance, all the resources we use to go after seriously bad dudes.”

But their anxiety isn’t spilling over to the rest of city governments. The bet that sanctuary cities are making, in many cases, is that the Trump administration simply won’t be able to (or want to) revoke literally every federal grant that the city receives.

In fact, over the past few weeks, legal scholars have advanced the argument that it would be unconstitutional for the Trump administration to make funding conditional on cities abandoning their “sanctuary” policies.

“Trump’s threat is not as formidable as it might seem,” George Mason law professor Ilya Somin wrote at the Washington Post. “The Trump administration can’t cut off any federal grants to sanctuary cities unless it can show that those grants were clearly conditioned on cooperation with federal deportation policies.”

Bloomberg Law columnist Noah Feldman is even blunter: Trump “can’t do it -- not without violating the Constitution. Two core rules of federalism preclude Trump’s idea.”

So cities have a Plan B: Instead of planning for how to survive defunding, they can start planning a court challenge.

But whether it’s unconstitutional is a gamble. It depends entirely on how the Trump administration wants to implement its defunding plan.

If the administration is serious about carefully crafting a plan, and is willing to pick a political fight, it could defund “sanctuary cities” without running afoul of the Constitution.

The Supreme Court’s ruling on Obamacare could strengthen sanctuary cities’ argument

The Supreme Court doesn’t let the federal government tell cities and states what laws to prosecute, and it can’t force them to help enforce federal law. That’s called “commandeering,” and the Supreme Court’s ruled it violates the 10th Amendment. This is why President-elect Trump can’t just decree that all police officers in the US have to assist federal immigration agents whenever possible.

If the federal government wants to get states to do something, it has to use funding: making grants to states or cities conditional on certain policies. This is why the legal drinking age is 21 in most states: Thanks to legislation passed in 1984 and pushed by Mothers Against Drunk Driving, the federal government started refusing to give federal highway funds to any state with a lower drinking age.

But the government can’t push conditions on funding to the point of being “coercive.” That, too, runs afoul of the 10th Amendment. This is why the Supreme Court ruled the Medicaid expansion in the Affordable Care Act unconstitutional — it took existing Medicaid funding that states were already receiving, and declared they would stop receiving that money unless they adopted a new, expanded definition for who ought to qualify for the program.

The Medicaid decision was a defeat for progressives when it came down. But in the wake of Donald Trump’s election, many have embraced it — in the belief that Trump’s pledge to defund “sanctuary cities” will also be deemed coercive.

But the Medicaid decision isn’t a foolproof secret weapon. Instead, like any court case, it sets a standard for what counts as “coercive” — and, therefore, a checklist for what a particularly careful Trump administration could try to avoid.

For one thing, Professor Gabriel Chin of UC Davis says, the government would be on much more solid footing if it replaced existing grants with new ones that had conditions attached — much like Race to the Top grants the Education Department used to pass teacher accountability laws and the adoption of Common Core standards in states — rather than trying to retroactively wedge new conditions into existing funding.

But the DOJ might already have more leverage than the Affordable Care Act did. As Jessica Vaughan of the Center for Immigration Studies said, according to the Inspector General’s memo, “If they are violating federal law, then according to the DOJ rules, they are not eligible for certain DOJ grants.”

This strategy wouldn’t be as constitutionally foolproof as just creating a new grant program. But it would be more defensible than simply defining “sanctuary cities” in terms detainer requests.

“There is some case law supporting the idea that merely requiring communication is not an impairment of a state’s rights under the 10th Amendment,” says Melissa Keaney of the National Immigration Law Center, which advocates for “sanctuary city”-type policies. “So I think at minimum we could say that it would be more difficult to challenge as coercive” than defunding cities for ignoring ICE’s detention requests.

How much funding could the Trump administration withhold? It depends on whether it wants to start a fight.

It’s a foregone conclusion that any attempt at “sanctuary city” defunding is going to get challenged in court. If Republicans in Congress — whether in the name of fiscal conservatism, or the name of partisanship — get on board with a defunding strategy, the court challenge will still happen. But it will be much more protracted.

That could be good for cities: It could mean that they defer the pain of losing potential funding for years. Or it could be a problem: shrouding years of future budgeting under a cloud of uncertainty.

More importantly, Chin says, the federal government could win.

Chin compares the situation to the Solomon Amendment, a statute that prevented universities from getting federal money if they didn’t allow military recruiters access to its campuses (something many schools were loath to do in the era of legalized anti-LGBTQ discrimination in the military). Universities challenged the amendment, but the Supreme Court upheld it — and most schools gave in.

“The cost of noncompliance was too high,” Chin said.

While cities might be willing to fight for the ability to keep both the funding and “sanctuary” policies, if they lose the court case and have to pick one, they might decide they need the former more.

“It’s possible that a cleverly drafted and broadly worded statute could put a lot of state and local funding at risk,” Chin says. “And if that happens, and it was upheld, then I think states and localities would knuckle under.”

That could take years to play out, and it would require a lot of other things to fall into place first.

But if both the Trump administration and “sanctuary cities” are spoiling for a fight — and it definitely looks like they are — then the risks are sure to run high.