In Greek mythology, Daedalus was a brilliant inventor who fashioned wings for him and his son, Icarus, to escape imprisonment. Daedalus warned Icarus not to fly too close to the sun. But Icarus, heady with the power of flight, couldn’t help himself. Daedalus survived; Icarus scorched his wings and died.

When Elon Musk laid out an ambitious plan to buy the struggling solar firm SolarCity in 2016, Tesla’s then-CFO internally dubbed it “Project Icarus” — a detail that came out in a trial this week as Musk took the stand to defend the controversial $2.6 billion deal. “Did it dawn on you that this is the flying too close to the sun?” the plaintiffs’ attorney, Randall Baron, asked the Tesla chief, referring to his SolarCity bid. “This is the crashing and burning that he meant?”

Musk said he caught the allusion but took it as simply a bit of humor, not a prophecy of doom. “It should have been called Project Daedalus,” he added, smiling — perhaps implying that Musk, like Daedalus, would escape the ordeal unscathed.

The trial is, on one level, a business dispute over the SolarCity deal, which some Tesla shareholders view as a boondoggle that Musk forced through for his own purposes. (SolarCity was run by his cousins, he was part owner, and it was in financial crisis when Tesla bought it.) But for Musk, the stakes are higher. It’s a referendum on his own leadership, integrity and vision. Put another way: It’s about whether he’s Daedalus, the resourceful mastermind, or Icarus, flirting with disaster and bound for a tragic fall.

The answer matters to more than just Musk. He now leads two companies, Tesla and SpaceX, whose products people literally entrust with their lives. Both have pushed the boundaries of what’s considered possible — and safe. Like Daedalus’ wings, Tesla’s “autopilot” technology and SpaceX’s crewed space missions require enormous faith in technology and expose their users to novel risks. So the question of Musk’s trustworthiness is, in a real sense, life-or-death.

The trial’s most illuminating moments were the ones in which the central questions that have long haunted Musk’s career were made explicit. Is he a visionary or a huckster? A marketing genius or a narcissistic troll?

The world’s second-richest person, by some counts, easily could have afforded to settle the SolarCity case out of court, as all of his fellow Tesla board members did last year. Instead, he chose to fight it. And so he spent Monday and Tuesday in a dreary Delaware courtroom, defending his reputation against a lawyer bent on exposing him as a self-dealing fraud, even as his fellow billionaires Richard Branson and Jeff Bezos were in various stages of adventuring to space. (Jeff Bezos owns The Washington Post.)

The cost of that defense is fresh scrutiny of Musk’s record, and by implication, his fitness to lead. On Monday, Musk did himself no favors by calling Baron “a bad human being” — or by insisting that “I rather hate” being CEO of Tesla. But his exchanges with Baron did on several occasions offer insight into how Musk views himself, and how he justifies actions that others find troubling or incomprehensible.

For example: Why does Musk routinely make unrealistic promises? And does that make him dishonest, or is it crucial to his success?

Specifically, Baron pressed Musk on his grand plan for a “solar roof”: a house roof that’s literally made out of solar panels. He unveiled the idea in 2016, partly to justify the SolarCity deal, and at one point claimed that it would be ready for widespread deployment by the following year — a bold claim for what was at the time a nonfunctional concept. Five years later, it still isn’t in mass production, though Musk hasn’t given up on it.

“I have a habit of being optimistic with schedules,” Musk said. “If I wasn’t optimistic, I don’t think I would have started an electric-car company or a rocket company.”

Baron wasn’t buying it. “This is more than optimistic,” he said of the solar roof timeline. “This is just plain-out false.”

So is Musk an optimist or a liar? The truth may be some of each: Whether it’s his prediction of a solar roof by 2017, a fully self-driving Tesla by 2018, or one million robotaxis on the road by 2020, Musk often fails to deliver. And yet it’s that same outrageous ambition that has driven his companies to achievements that few thought possible, from leading an electric revolution in the automotive industry to pioneering commercial space exploration.

For the SpaceX founder, getting NASA astronauts to the International Space Station is just a first step. Elon Musk has the moon and Mars in his sights. (Lee Powell/The Washington Post)

Similarly, Musk’s bizarre tweets and antics — from crowning himself “Technoking” of Tesla in a federal filing to selling flamethrowers to smoking weed on Joe Rogan’s podcast to naming his child X Æ A-12 — can be viewed in two ways. One view is that he’s an immature, entitled jerk with no self-control. The other, which Musk himself hinted at in court this week, is that he’s an ingenious marketer and showman.

Baron held up the “Technoking” maneuver as an example of Musk’s willingness to put his own whims above the interests of his firm. Musk countered that his whimsy is actually strategic. “If we are entertaining, then people will write stories about us, and then we don’t have to spend money on advertising that would increase the price of our products,” he said.

That might sound like a stretch, particularly when it comes to some of Musk’s more ill-advised stunts, such as the “funding secured” tweet that cost him his Tesla chairmanship, or his unhelpful meddling in a Thailand cave rescue effort. But there’s no denying that he has succeeded in making Tesla a household name worldwide without commissioning a single car commercial. Again, both can be true: Musk is a reckless, self-aggrandizing loudmouth and a master of earned media.

Of all the crises Musk has weathered so far, the shareholder lawsuit over his SolarCity acquisition seems unlikely to be the one that brings him down. Unseemly as the deal appears from many angles, it hasn’t kept Tesla’s stock from soaring, and Musk made a persuasive enough case that solar energy remains a plausible long-term bet for the company. Even losing the case wouldn’t put much of a dent in his bank account.

But to return to the metaphor of Daedalus and Icarus, there was one key point that Musk seemed to overlook. Daedalus may have survived the flight — escaping from a labyrinth of his own making, by the way. But Icarus’s death was on his hands, and it haunted him. Elon Musk has made it this far, flying as close to the sun as any figure in the modern business world. Not every Tesla autopilot driver has been so lucky. And as more and more people rely on his companies’ technology, his brash approach raises justifiable concerns about whether he gives safety its due priority.

After all, it’s not Musk’s survival that the rest of us need to worry about most. It’s the survival of the people who use his contraptions.