President Trump has griped for years – without any proof – that undocumented immigrants vote in American elections regularly, often enough to change their outcomes. He claimed after losing the popular vote in 2016 that his 3.1 million-vote national deficit was due solely to droves of illegals casting ballots.

Of course, the commission he appointed in hopes of verifying his rationalization got nowhere, and he was forced to disband it in January.

But all Trump must do later this year is look at San Francisco if he wants to see non-citizens at the polls, including plenty of the undocumented.

That’s because San Francisco in 2016 passed the local Proposition N, allowing non-citizens to vote in school board elections regardless of their immigration status. The idea received 54-46 percent backing in that city, which in this century has also pioneered concepts like same-sex marriage and universal health care.

Non-citizens will vote legally for the first time in November, and can continue participating in school board elections for at least the next four years.

It turns out this concept isn’t entirely new, even though San Francisco is the only place in America where the practice is currently legal. Until the 1920s, many states, cities and counties allowed non-citizens to vote in all elections. If you live here, went the reasoning of the time, you have a stake in American or local public affairs. Voting was tied to where people lived, not where they were born or which passport they carried.

That ended even before the Great Depression, in a tide of anti-immigrant feeling that produced this nation’s first immigration quotas, which still limit how many newcomers are allowed to enter from each of the world’s other countries.

In San Francisco, there will be safeguards preventing non-citizens from doing what Trump strongly opposes: They won’t be allowed to vote legally in elections for anything but school officials. To ensure that doesn’t happen, ballots going to non-citizens will not list any federal, state or other local offices. And yet, there are few safeguards to prevent non-citizens from registering as regular voters.

Here’s what the California secretary of state’s website says about identification needed to register: “The voter registration application asks for your driver license or California identification card number, or you can use the last four numbers on your Social Security card. If you do not have a driver license, California identification card or Social Security card, you may leave that space blank. Your county elections official will assign a number to you that will be used to identify you as a voter.”

In short, no one really needs to prove citizenship to vote for any office, in San Francisco or anywhere else in California.

This may be in keeping with the old idea that everyone here has a stake in the election results, and so ought to be able to vote. Many immigrant advocates may believe — privately, if not publicly — this would be a good thing.

But it definitely blurs the lines between citizens and non-citizens, especially those who are here legally, with permanent resident status. There’s already almost nothing they can’t do in California.

Drivers licenses, check. Immigrant children, even the undocumented, eligible for state-paid medical insurance under Medi-Cal, check. In-state college tuition, check that, too. Non-citizens, even if they’re not here legally, can also practice law under a 2015 bill signed by Gov. Jerry Brown. And legal immigrants can be poll workers because of a perceived shortage of multi-lingual election officials.

Until now, about the only thing they couldn’t do was vote legally. But the San Francisco law has begun to chip away at that distinction. Which means non-citizens now can indirectly help decide how taxpayer money will be spent, by the billions of dollars.

Some politicians in New York City would like to take things even farther. Mayor Bill de Blasio and his city council have several times considered a law allowing legal-resident non-citizens to vote in all local elections.

The problem, of course, is that giving this ultimate civic right to non-citizens, along with other privileges they’ve already attained, removes much of the motive to do the very basic book-learning needed to become a citizen.