Mitt Romney’s selection of Paul Ryan was supposed to be a problem for the Republicans. So said a chorus of chortling Democrats. So said a gaggle of anonymous seasoned Republican operatives. All of which was echoed gleefully by mainstream media.

The problem, these purveyors of the conventional wisdom all said, was Medicare — to be more specific, the future changes in Medicare set out in the budget resolutions Ryan fashioned as House Budget Committee chairman and persuaded almost all House and Senate Republicans to vote for.

But while Democrats licked their chops at the prospect of scaring old ladies that they’d be sent downhill in wheelchairs, the Medicare issue seems to be working in the other direction.

Romney and Ryan have gone on the offense, noting that while their plan calls for no changes for current Medicare recipients and those over 55, Obamacare, saved from demolition by Chief Justice John Roberts, cuts $716 billion from the politically popular Medicare to pay for Obama’s politically unpopular health care law.

The Romney campaign is putting TV advertising money behind this message, and it will have plenty more to spend — quite possibly more than the Obama forces — once the Romney-Ryan ticket is officially nominated in Tampa, Fla., in 10 days. Team Obama is visibly squirming.

It turns out that Ryan and Romney, who in late 2011 and early 2012 moved quietly but deliberately toward embracing the Ryan agenda, may have outthought their adversaries.

Those last-minute Mediscare-type mailings to seniors, which enabled Democratic Gov. Lawton Chiles to narrowly defeat Jeb Bush in the 1994 Florida governor race, don’t work so well anymore when the issue is brought out fully in the light of day.

But Medicare/Mediscare is not the only thing on which the Democrats have underestimated Ryan and the putative presidential nominee who selected him from the high-quality field of potential VP nominees from which he made his pick.

Ryan brings two other things to the Republican ticket that could prove important in the two-month sprint from the Tampa and Charlotte, N.C, conventions to Election Day.

One is foreign policy chops. Romney has less in the way of exposure to serious involvement in foreign and defense policy than any major party nominee since Bill Clinton in 1992 and Romney’s fellow Bay Stater Michael Dukakis in 1988.

Ryan, as a member of the House, theoretically brings a little more. But actually a good bit more, to judge from a little noticed speech he delivered three blocks from the White House to the Alexander Hamilton Society in June 2011.

In that speech, as Wall Street Journal columnist Bret Stephens noted last week, Ryan showed that “he knows how to think.”

“Our fiscal policy and our foreign policy are on a collision course,” said Ryan, whose number-crunching knack clearly appealed to fellow numbers-cruncher Romney.

Defense spending accounted for 39 percent of the federal budget in 1970, said Ryan (who was born that year), but accounts for only 16 percent today. Under current budget pressures, it is at risk of going far lower.

Ryan referenced Princeton scholar Aaron Friedberg’s book “The Weary Titan,” on how Britain ceded world leadership a century ago in the face of economic pressures. He pointed out that while Britain could assume that the United States, with similar values and goals, might take up the burden, we have no similar fallback today.

Ryan acknowledged that our long-term dedication to freedom and democracy must sometimes yield to short-term interests. But that dedication, not occasional accommodations, must be our lodestar.

As Stephens argues, this puts Ryan much more than Barack Obama in line with the examples set by Franklin Roosevelt and Harry Truman, John Kennedy and Ronald Reagan and — dangerous to say it — George W. Bush.

Romney takes the same approach on this, and on the other valuable quality Ryan brings to the Republican ticket.

And that is his solid mooring in the lessons of America’s Founding Fathers. “America is an idea,” Ryan said, that “our rights come to us from God and nature,” rights that “belong to every person everywhere.”

This election can be seen as a contest between the Founders’ ideas and those of the Progressives, who saw the Founders as outmoded in an industrial era.

Ryan strengthens Romney in his invocation of the Founders. Obama is stuck with the tinny and outdated debunking of the Progressives. Which rings truer today?