The day before half term, our seven-year-old son came home with a letter from school announcing that a boy in his class is becoming a girl. Nicholas, a “transgender student,” will henceforth be known as Nicole, and when term resumes tomorrow “will be fully integrated into our school community as a female student and will be entitled to use the girls’ restroom”.

The headteacher and the school guidance counsellor talked to the kids and answered their questions without Nicole present (names have been changed to protect privacy). Nicole’s mother and father addressed a letter to other parents, essentially saying “we respect your beliefs, please respect ours.” This being proudly liberal Brooklyn, the prevailing response was a shrug of acceptance.

On Wednesday, President Donald Trump rescinded federal legal protections for transgender students. Under Barack Obama, the Justice Department’s position was that anti-discrimination laws guaranteed the right of transgender people to use public toilets corresponding to their gender identity. The new Attorney General, Jeff Sessions, does not share this view.

During the campaign, Trump said that Caitlyn Jenner, perhaps the most famous transgender person in the world, would be welcome to use the ladies loo at Trump Tower. This week’s decision is a sop to religious conservatives, and a signal that Sessions will dispense with civil rights protections as he sees fit.

The Education Department’s directive notes that individual schools may determine their own policy in accordance with state laws, so for Nicole and students like her in New York, nothing has changed. Her peers in North Carolina will not be so fortunate. A dozen states have “bathroom bills” pending that will oblige women born as boys to use the gents, and punish institutions that allow them to use the ladies. The Texas Privacy Act, for instance, establishes fines of $10,000 a day for schools that violate the law.

The USA is a nation of overlapping divides - red and blue, rural and urban, religious and secular, traditional and modern - and its federal system guarantees conflict between the states and the national government. In the Trump era, the country’s largest cities are defining themselves as centres of resistance, on the streets and in the courts, particularly on the issue of immigration.

An executive order signed by Trump in his first week included a threat to strip federal funding from “sanctuary cities” that refuse to co-operate with Immigration and Customs Enforcement officials (ICE). “The American people are no longer going to have to be forced to subsidise this disregard for our laws,” said White House Press Secretary Sean Spicer.

Big city mayors responded with a show of defiance. San Francisco sued, challenging the legality of the order. In Chicago, Mayor Rahm Emanuel declared: “We’re going to stay a sanctuary city.” Los Angeles advertised the LA Justice Fund, set up to provide legal assistance to immigrants facing deportation. Boston’s Mayor Martin J. Walsh announced that “if necessary, we will use City Hall itself to shelter and protect anyone who’s targeted unjustly.”

In New York, families received a letter from the city’s Department of Education asserting the right “of every student in New York City to attend public school, regardless of immigration status.” Staff do not record whether students or their parents have visas and will not permit ICE agents - the immigration police - to enter schools without proper legal authority. There is much cities can do to gum up the works of the deportation machine.

It's estimated that the federal government can withhold $2.27 billion in funding from the ten largest sanctuary cities, including money for pre-school education, airport improvements and public housing, but it is liable to face legal challenges. Peter L. Markowitz, the director of the Immigration Justice Clinic at the Cardozo School of Law said that funding cuts would need to be directly related to the order being flouted: “You can’t say ‘if you don’t use your police officers to go after unauthorised immigrants, you don’t get any money for your hospitals.’”

A leaked memo from Police Commissioner James O’Neill instructed NYPD officers not to enforce ICE warrants, but at street level, plenty of cops support Trump’s order. Every time officers arrest someone, fingerprints and identifying information are sent to federal authorities. For undocumented immigrants, cycling through a red light, smoking marijuana or selling scarves without a licence are potentially punishable by deportation.

This is underscored by the elastic definition of “criminal alien” in the Department of Homeland Security directive issued this week, which includes any undocumented immigrant charged with (not convicted of) a crime, plus anyone that ICE officials think may pose “a risk to public safety”.

Homeland Security Secretary John Kelly has requested an additional 10,000 ICE agents and 5,000 Border Patrol officers. “Do you think Mexicans are the lowest sort of subhuman filth? Do you enjoy wearing a black mask and staying up late?” asked Neo-Nazi website the Daily Stormer. “Well, if the answer to these questions is “HELL YES,” then the government has a job for you…!”

This week, customs agents checked the passports and ID cards of passengers on at least one domestic flight arriving at JFK airport. Much will depend on how police departments and individual officers choose to enforce the new rules. Presumably, more undocumented immigrants will seek sanctuary in the cities than ever.

Minneapolis Mayor Betsy Hodges responded to Trump’s threat with a passionate defence of diversity. “We must continue, as always, to take a stand against what is coming, to fight for and with people against the meanness that is upon us,” she said. “The first order of business, however, is to grieve, to rage, to confess confusion, to shake with fear.”