The Trump administration is preparing an escalation in its unrelenting assault on the rights of LGBTQ Americans. According to a New York Times report, the Department of Health and Human Services is circulating a memo proposing a new federal definition of the word “sex” that’s designed to strip protections for gay, bisexual, and transgender Americans under civil rights laws. This definition would be implemented through four major executive branch agencies, removing safeguards that currently bar anti-LGBTQ discrimination in education, employment, and health care.

Protesters across the country demonstrated in opposition to the memo on Sunday and Monday, asserting that the Trump administration plans to deny the existence of transgender people. In fact, the memo goes much further than that: It is an effort to rewrite federal law to exclude certain disfavored minority groups from civil rights protections. These proposals would undo decades of precedent by shrinking the scope of civil rights statutes to legalize anti-LGBTQ discrimination. To understand just how radical the memo’s legal vision really is, it’s important to recognize the legal developments that the Trump administration is seeking to erase.

What does “sex” mean?

The Trump memo revolves around the word sex as it’s used in three major federal laws. Title VII of the Civil Rights of Act of 1964 bars sex discrimination in the workplace; Title IX bars sex discrimination in schools that receive federal funds; and the Affordable Care Act bars sex discrimination in health care. Dozens of federal courts have interpreted these provisions to encompass discrimination on the basis of sexual orientation, gender identity, or both. The Obama administration issued federal rules and guidance clarifying that all three laws prohibit discrimination against transgender people.

Trump wants to change all that. The draft memo seeks to define sex as “a person’s status as male or female based on immutable biological traits identifiable by or before birth.” It states that the “sex listed on a person’s birth certificate, as originally issued, shall constitute definitive proof of a person’s sex unless rebutted by reliable genetic evidence.”

This definition may have some specious appeal. But it flies in the face of a growing judicial consensus that “sex” means much more than the gender you’re assigned at birth. It was the Supreme Court itself that kicked off this progression.

Sex stereotyping as sex discrimination

It’s true that there is no federal law that explicitly bars anti-LGBTQ discrimination in employment, education, or health care. But a 1989 Supreme Court decision has persuaded myriad lower courts that existing laws do protect LGBTQ people.

In the Price Waterhouse v. Hopkins decision, that court ruled that sex discrimination encompasses “sex stereotyping”—punishing individuals for their failure to conform to gender norms. The application of this logic to transgender people is obvious. When an employer discriminates against a transgender woman, he is punishing her for her failure to conform to the sex she was assigned at birth. The employer believes she should present in a stereotypically masculine fashion. He is, in short, discriminating on the basis of sex stereotypes, which is illegal under Price Waterhouse.

Many courts have developed another theory as to why anti-trans discrimination constitutes discrimination “because of sex.” When an employer mistreats a transgender worker on the basis of her identity, he is inherently taking her sex into account. He demands that she present as the sex assigned to her at birth and dislikes her refusal to do so. It is impossible to make this judgment without considering her sex, and so his discrimination is quite literally “because of sex.”

Armed with this reasoning, the Obama administration issued guidance protecting LGBTQ people throughout the country. Most famously, the Department of Education notified schools that it could not discriminate against transgender students under Title IX’s bar on sex discrimination. Under Donald Trump, the Department of Education rescinded that guidance and rejects complaints from transgender students denied access to the correct bathroom at school. The draft memo proposes rules that would formalize this policy. And if a transgender student demanded access to a certain bathroom, a school could justify its discrimination through genetic testing, treating her in accordance with biological markers rather than her gender identity.

Sex stereotyping and sexual orientation

A number of courts have also extended Price Waterhouse’s logic to gay and bisexual people. The 2nd and 7th U.S. Circuit Courts of Appeals, for example, have held that anti-gay discrimination constitutes sex stereotyping because it reflects a belief that men should only be attracted to women, and women should only be attracted to men. Gay people represent “the ultimate case of failure to conform to [sex stereotypes]” in a country that “views heterosexuality as the norm,” the 7th Circuit wrote last year.

Both courts also held that, apart from sex stereotyping, sexual orientation discrimination is clearly discrimination “because of sex” for two reasons. First, anti-gay bias must take sex into account. For instance, an employer who mistreats a gay man punishes him for his attraction to other men; if he were a woman, he would not face discrimination. The gay person’s sex lies at the heart of the discrimination he suffers.

Second, anti-gay bias punishes an individual for intimate association with people of the same sex. Consider a comparison to Loving v. Virginia. There, the Supreme Court held that interracial marriage bans constitute race discrimination because they take the race of each partner into account. Similarly here, when an employer discriminates against a gay person, it is objecting to his intimate association with someone of the same sex. Change the sex of one partner and there would be no discrimination. Per the 7th Circuit, this reveals that “the discrimination rests on distinctions drawn according to sex.”

What does the Trump administration say?

In legal filings, the Trump administration has largely justified its anti-LGBTQ position by claiming that Congress did not consider LGBTQ people when it passed various civil rights laws. That may be true, but it’s a pretty weak argument, because our modern conception of sex discrimination is far removed from what Congress had in mind when it passed these landmark statutes.

Take sexual harassment. Today, there is near-universal agreement that laws which bar sex discrimination prohibit sexual harassment. But when Congress passed the Civil Rights Act in 1964, it did not expressly outlaw sexual harassment, and no lawmaker expressed a clear intent to outlaw inappropriate sexual behavior at work. As late as 1975, a federal judge ruled that victims of harassment don’t face discrimination because of their sex, so they have no legal recourse. Feminist lawyers and scholars pushed the courts to abandon this archaic reading of the law. They argued that the phrase “because of sex” represented an effort to eradicate all sex-based mistreatment that perpetuates gender inequality in employment.

It worked. The Supreme Court unanimously ruled in 1986 that sexual harassment is a form of sex discrimination. And in 1998, the court also held that harassment between members of the same sex also qualifies as sex discrimination. No one seriously argues that the Congress of 1964 thought about male-on-male sexual harassment when it passed Title VII. But as Justice Antonin Scalia explained for the court, “statutory prohibitions often go beyond the principal evil to cover reasonably comparable evils, and it is ultimately the provisions of our laws rather than the principal concerns of our legislators by which we are governed.”

To get around precedents involving sex stereotyping and sexual harassment, the Trump administration has concocted some bizarre arguments. Most notably, it has claimed that true sex discrimination is always rooted in the belief that one sex is inferior to another. This hypothesis makes little sense. The Supreme Court has never said that a victim of sexual harassment must prove that her abuser believed women to be inferior. It has never said that some “inferiority” analysis plays any role in a sex discrimination lawsuit. And the text of these laws says nothing about inferiority. The Trump administration is not interpreting statutes; it is rewriting them.

What the Trump memo would do

The draft memo encourages the Departments of Justice, Education, Labor, and Health and Human Services to adopt its narrow definition of sex through the formal rule-making process. These agencies have offices of civil rights that adjudicate claims of unlawful bias. By reading LGBTQ people out of civil rights laws, these agencies would close their doors to any victim of anti-LGBTQ discrimination.

To get around precedents involving sex stereotyping and sexual harassment, the Trump administration has concocted some bizarre arguments.

If a gay student faced harassment, for example, she could not file a Title IX complaint. If a transgender patient was denied insurance coverage for gender dysphoria, she could not seek recourse from HHS. If a gay employee of a federal contractor faced homophobia on the job, he would receive no help from the Department of Labor.

For LGBTQ employees, the impact is different. The Equal Employment Opportunity Commission enforces workplace discrimination laws, and it is an independent agency which the Trump administration cannot boss around. In 2012 and 2015, the EEOC has recognized that sex discrimination encompasses anti-LGBTQ discrimination. It is currently battling the Department of Justice, which, under Attorney General Jeff Sessions, has taken the opposite stance. For now, at least, the EEOC will still represent LGBTQ employees.

How all this ends

Ultimately, the task of resolving this dispute will fall upon the U.S. Supreme Court. There are already several cases pending before the court involving anti-LGBTQ discrimination. If the justices agree to hear them, they will settle this matter by next June. Now that Justice Brett Kavanaugh has replaced Justice Anthony Kennedy, many LGBTQ advocates are pessimistic about their odds at the court. It is quite possible that the reconstituted Supreme Court will eventually affirm Trump’s anti-LGBTQ theories, even though doing so would require the justices to overrule years of precedent.

In its report on the memo, the New York Times contended that the Obama administration had “loosened the legal concept of gender,” a change the Trump administration wishes to reverse. That is not correct. The Obama administration embraced the Supreme Court’s expansive definition of “sex” so that it no longer arbitrarily excluded gender and sexual minorities. Trump wants to revive those categorical exclusions—and add new ones. His administration is not tightening the definition of sex. It is changing the meaning of the word to tell LGBTQ people that they are not equal under the law.