New York Mayor Ed Koch raises his arms in victory...

New York Mayor Ed Koch raises his arms in victory at the Sheraton Centre in Manhattan after winning the Democratic primary in his bid for a third four-year term. (Sept. 11, 1985) Credit: AP

I first got acquainted with Ed Koch in 2001 after the funeral of his predecessor, Abe Beame.

As stories flowed effusively that day, eulogists told how Beame had learned in 1974, on his inauguration day, that he was looking at a $1.5-billion hole in a $10-billion city budget.

But by the time Koch took over as mayor four years later -- the story went -- Beame had miraculously turned the debt into a $200-million surplus.

Koch sent me a letter, and in an amused tone said that when he heard that remark he expected a bolt of lightning to come crashing through the ceiling of the synagogue to smite the tellers of untruths.

Say this for Edward I. Koch: He and the city he represented as mayor for 12 years shared identical DNA: frank and brash, cranky and irreverent, impossible and impassioned, witty and wise, not to mention joyful, egotistical and human.

Monday morning, at his own funeral, as the honor guard bore his casket out of Temple Emanu-El onto Fifth Avenue, the organist broke into strains of "New York, New York" while a packed house of assembled mourners -- several thousand strong -- broke into sustained applause.

It was a profound moment.

New York is a state of mind, Mayor Michael Bloomberg said in his eulogy, "and no mayor has ever embodied the spirit of New York City like he did."

Well . . . in the Koch tradition of truth-telling, maybe Fiorello LaGuardia did, but let us not cavil. Both were great mayors, and both were sui generis.

The question now is: What comes after Koch and Rudolph Giuliani and Bloomberg? For better or worse -- mostly for the better -- these recent mayors have all left substantial positive imprints on the city.

So now: What of Christine Quinn? Bill Thompson? Bill de Blasio? Joe Lhota?

We all have something riding on the question -- a robust city means a robust state. The crop of mayoral candidates has a lot to show us over the next nine months.

LaGuardia deftly shepherded New York through the Great Depression and World War II. And it fell to Koch to lead the block-by-block rescue of America's largest city after it painfully and calamitously began to crumble from the weight of its own vices.

Before Koch's election, the town had been run for all intents and purposes by corrupt political machines and hungry public worker unions.

Its affordable housing stock was rapidly turning to ashes, and its Fortune 500 companies were racing for the friendlier precincts of the Sunbelt. The place had become one of the largest and most lurid psychodramas on Earth.

Into this craziness danced Koch, who brought with him some key lessons in leadership:

No. 1. You don't always have to be right. You don't even have to be rational all the time. But you do have to understand the people you plan to lead -- not from what you've read, not from what the political strategists on your staff have told you, but intuitively, and with every fiber of your being.

No. 2. You have to know where you want to lead people once you have their attention. Koch fought the political machines. His government aimed to move the city out of its squalor first. It ultimately provided hundreds of thousands of units of new affordable housing.

And he was especially proud of his program to select judges not by their political connections but through merit.

Through sheer ebullience and chutzpah, he convinced New Yorkers first and then the world that the city might -- just might -- be great again. For that, the five boroughs of New York -- and with them Nassau, Suffolk and Westchester counties, whose economies are so intricately tied with the city's fortunes -- owe him their eternal gratitude.

So now, class of 2013, what's your story? Are you ready to lead us to the next big thing?

Or will you simply feed the machine and placate the vocal?

How will you measure up?

Joseph Dolman was deputy editorial page editor for New York Newsday.