David Wichs, 38, the man killed by a collapsing crane on Friday, was eulogized Sunday as a gifted mathematician, a loving and devoted husband, a tremendous colleague and “a supreme mensch,” in the words of Haskel Lookstein, rabbi emeritus of the Congregation Kehilath Jeshurun on the Upper East Side.

“Before you can be righteous, you have to be a mensch first,” and Wichs “was a supreme mensch in every respect,” Lookstein said.

Wichs’ wife, Rebecca Guttman, praised her deceased husband as “the rock of my family,” who helped them recover after the death of her father. He was “the most wonderful husband any girl could ever hope for,” she said. Unpretentious (“he hated dressing up”), loving and down to earth, Wichs was an exemplar of always taking “the high road” and had a knack for banishing the blues in others: Whenever she was sad, Guttman recounted, her voice sometimes quavering, Wichs would “always bring me a great treat, take me on a special date or plan a trip.”

Wichs’ colleague of 15 years, Ravi Sarma, a managing partner of Tower Research Capital, said that while the financial world measures worth by “how much money you made,” Wichs’s definition of success was solving problems and helping others. “He put people before profits” and always thought of others before himself, said Sarma, noting that Wichs, a Czech immigrant, was exceedingly humble and never spoke unkindly of others.

Sarma and Wichs, on several occasions, went to India, where they visited a small village in Andhra Pradesh. While Sarma complained about how the place compared unfavorably to the United States -- spotty electricity, dirt roads and “no running water” -- Wichs managed to see everything as “positive and charming,” Sarma recounted. Wichs’ connection with the locals there was so profound, despite their lack of a common language, people still ask after him, Sarma said. “There is a small village in southern India that is also weeping for David today,” he said.

Wichs engaged in a “life of giving -- giving of his possessions and to causes he believed in passionately,” which included a yeshiva in Flatbush, a think tank for modern Jewish thought, and to a rabbi’s project of a “web yeshiva,” Lookstein recounted. “It’s very hard to raise funds for a web yeshiva, but David gave,” Lookstein said.

Before the funeral service, Jacob Brandler, who mentored Wichs more than 20 years ago when Wichs competed as a high school junior in the Westinghouse Science Talent Search, recalled his protégé as extraordinarily gifted. Wichs was a fantastic and brilliant mathematician, Brandler, of Marine Park, said, “but that wasn’t as important as the kind of human being he was.”

Daniel Wichs recalled his older brother as having a “contagious” optimism and happiness. David was “a math genius, a graduate from Harvard with honors who worked hard but didn’t chase after success.” Meeting his wife Rebecca brought him the greatest happiness of all, Daniel said, and his brother’s dream was to start a family with her. “What a horrible tragedy that this dream cannot be,” Daniel said.

Mourners left the funeral crying as a simple wooden casket was loaded into a Heritage hearse marked “Riverside” and followed as it made its way slowly west on E. 85th St.

One man, who declined to give his name, stood as if stricken, saying, finally, “His death is an absurd and miserable loss that is not even approachable with ordinary words.”