After the University of California at Berkeley cancelled an appearance by controversial writer Milo Yiannopoulos, President Trump threatened Thursday to pull federal funding to the public university for not permitting free speech.

Here’s the thing: That’s not how federal funding to colleges works. Not at all.

The vast majority of federal dollars that flow to colleges and universities arrives in the form of student loans and grants to cover the cost of attendance. That money, which is dispensed through what’s known as the Title IV program, does come with conditions that schools must meet, mainly involving the quality of the education.

To remain in the program, schools, for instance, can’t have scores of students defaulting on their loans year after year. Or, in the case of career colleges, they can’t lie about the number of students landing jobs after graduation. Trampling on First Amendment rights, as Trump has accused Berkeley of doing, are not grounds to be kicked out of the program.

“Nothing in current law would allow the federal government to withhold funds on free speech grounds,” said David Bergeron, a 35-year veteran of the Education Department who now works at the left-leaning Center for American Progress. “A small portion of the student aid funds – work-study, supplemental grants – go as grants to the institution, but those funds flow based on a congressionally mandated formula that doesn’t include free speech.”

He points out that about a quarter of Berkeley’s students rely on federal loans and Pell Grants, a type of aid for families typically earning less than $60,000 a year. The school, long seen as a beacon of public higher education, boasts a graduation rate of over 90 percent. State financial support, a critical source of funding for public institutions, has waned considerably at Berkeley in the last 30 years, leading to staff cuts and tuition increases. Still, the flagship is perennially ranked atop the U.S. News and World Report list of top public universities.

“Do we really want to deny access to those that need aid to a public university with one of the highest – if not the highest – graduation rate of 91 percent?” Bergeron asked. “Affluent students would still be able to go there and their access to Berkeley would be enhanced if those needing aid did not attend.”

Robert Shibley, executive director of the Foundation for Individual Rights in Education, said while there is no federal law that specifically provides for cutting off student aid funding to colleges over free speech violations, the administration could use regulations to that end. None came to mind, but Shibley said he wouldn’t rule out the possibility.

“It’s potentially possible that this could be accomplished in individual cases using other regulations, but I am skeptical about that and don’t know of any that would suffice,” Shibley said.

Another path for federal dollars to colleges is research grants, money bestowed by entities such as the National Institutes of Health to aid students and faculty pursing research in the public interest. Grants are awarded based on peer review, and funding is reliant on congressional appropriations.

Trump could certainly put pressure on Congress to slash federal spending on research to get what he wants, though that could put all universities that conduct research projects in jeopardy.

The basis for Trump’s threat to Berkeley is a bit shaky, said Neal McCluskey, director of the Center for Educational Freedom at the libertarian Cato Institute. After all, Berkeley cancelled the talk and put the campus on lockdown after intense protests against the speech.

Yiannopoulos is a provocative writer for the Breitbart website who advocates open expression. He is a highly polarizing figure who was banned from Twitter for sending racist messages to an African-American actress. His planned visit to Berkeley resulted in protesters throwing rocks and bricks, before university police broke them up with tear gas.

“I’m not sure it is an obvious free speech violation if a school cancels an event due to real—not just feared—violence,” McCluskey said. “Real violence seemed to be occurring at Berkeley, from what I could tell. The group guilty of the violation would seem to be the perpetrators of the violence, not the school.”