When a Democrat says he doesn’t understand Republicans, it’s not news. Especially when the Democrat is a man who honeymooned in Cuba and thinks Daniel Ortega can teach us about health care.

In front of a Brooklyn church two Sundays ago, Bill de Blasio put it this way: “I don’t understand, in this day and age, how someone could continue to be a Republican and say that they want to help New York City move forward.”

Again, not surprising. What is surprising is that his Republican rival, Joe Lhota, also has no idea why anyone would be a Republican.

It was one of the few areas of agreement in Tuesday’s mayoral debate, with de Blasio savaging “Republican ideology,” “the views of the national Republican Party” and “Tea Party extremism” — and Lhota saying “me, too!”

So let the lesson begin.

Start with this: In a city whose voter rolls have six times as many Democrats as Republicans, a Republican will not persuade people to vote for him by emphasizing what he’s not. Yet that’s just what Lhota does. He begins almost every conversation by stressing his disagreements with his party on abortion, gay rights, legalized marijuana and so on.

Purely as a policy matter, that disagreement is to be expected. A blue-city Republican is not going to hold the same social positions as a red-state senator. But a blue-city Republican candidate also has to be the upstart. That means he needs to present vision that sharpens differences, not blurs them.

On the Democratic side, de Blasio has his “Tale of Two Cities.” Of course, it’s only a warmed-over version of the spend more, tax more and let government do it approach Democrats have been advocating for decades. Still, it’s a narrative, and it helped de Blasio come from behind to prevail over the two favorites in his primary.

The tragedy of the Lhota campaign is that New York does have a compelling urban Republican vision. And Lhota should know it because it comes from the man in whose administration he served: Rudy Giuliani.

Yes, Rudy was pro-choice and pro-gay rights. But the differences Rudy campaigned on weren’t with other Republicans. The differences Rudy emphasized were between his agenda to take on the city’s dysfunctions and the tired, unworkable, big-city Democratic status quo.

It wasn’t just crime. From taxes, welfare and illegitimacy to graffiti, development and homelessness, Rudy challenged most of the prevailing liberal dogmas. And when Rudy attacked, he didn’t just make it about bad policy. He also indicted the debilitating philosophy behind these policies, and offered counter-solutions that rested on a Republican preference for market competition, personal responsibility and accountable government.

To take one example, here’s then-Mayor Giuliani describing his approach to welfare reform: “Remember the era in which politicians who supported expanding welfare were described as progressive? I just want you to focus on the word progressive for a moment and connect it to welfare.

“Welfare is many, many things, and many different things to different people. But the thing it is not in the life of a human being or a society is progressive. When you are moving people from work to welfare, when you’re moving people from being able to take care of themselves to being dependent on someone else to take care of them, a society is not moving in a progressive direction.”

And here’s the Manhattan Institute’s Steve Malanga writing how Rudy used his very first budget to stun the city establishment by relying on spending cuts and savings to take on the budget deficit:

“To demonstrate his disdain for the reigning orthodoxy, when the New York Times editorial board urged him to solve the budget crisis with tax and fee increases that a Dinkins-era special commission had recommended, Giuliani unceremoniously dumped a copy of the commission’s report into the garbage and derided it as ‘old thinking.’ ”

True, all those de Blasio debate references to Lhota’s “ties” to a Tea Party based on one appearance in Staten Island are pretty rich coming from a man who complains it’s unfair to tie his thinking to a Sandinista movement he in fact worked for and still speaks fondly of. Then again, Lhota brought this on himself.

When a Republican candidate spends his time labeling the Tea Party and the national GOP extremists, he’s signaling unease. De Blasio picked up on that signal, which explains why the more frequently and vehemently Lhota denounced his fellow Republicans, the more de Blasio kept him there.

Somewhere along the way, Joe Lhota decided to define himself by stressing the Republican agenda he’s against rather than the one he should be for. One poll shows him 50 points down.