If Jeremy Lin becomes the consistently productive and imaginative floor general he was during his short stint as a Knickerbocker, the circumstances that allowed him to become a Rocket will be regrettable.

But as it is now, you can’t blame Jim Dolan and the Knicks for letting Lin walk despite having the right to match Houston’s three-year, $25 million offer sheet.

It’s overly simplistic to say Lin’s controversial exit played out in a way only the Garden could botch.

Really it was Lin himself who ended up controlling the next step of his out-of-nowhere career by inking a document containing what’s referred to as a poison pill.  With $15 million back loaded in the third year of a proposal tailored to trigger luxury tax headaches for Dolan, Lin and the Rockets cut a deal that both parties knew would likely end Linsanity at the world’s most famous.

Lin pocketed about $6 million additional guaranteed by signing up for the re-worked Houston offer.  But by doing so, Lin sealed his exile to a city with zero basketball buzz.  What Lin gained in additional total salary from Houston would have been dwarfed by the value of lost endorsement opportunities should he manage to push the re-start button on the set of skills he displayed in half a season as a Knick.

Maybe Lin knows he’s not for real and wanted every last penny before the bubble bursts.  Or maybe (as I suspect) he projects it impossible to succeed in a lineup that is saddled with Carmelo Anthony’s me-first act.

Once Melo got D’Antoni fired and prompted management to put pushover Mike Woodson in the driver’s seat, perhaps Lin knew the ball-sharing style of play he so successfully orchestrated would be impossible.  Remember:  Linsanity blossomed while Melo sat with an injury.

I was in a banh mi joint in Queens Wednesday night and one of the items on the menu was the Lin Sandwich.  He captured every corner of this city’s imagination and made watching the Knicks a lotta fun.  Dolan will likely never get in front of a microphone and explain his decision, but the stiff luxury tax formula included in the new CBA means the Knicks would be on the hook for about two bucks for every dollar over the cap in 2014-15.

Even without Lin in the picture, the Knicks are projected to have a difficult time staying under the cap given the bloated max-out commitments to Stat and Melo.  That’s not Lin’s fault, of course, but you can see how that third-year spike in Houston’s Lin offer would be problematic.

Dolan’s math with luxury tax included made Houston’s offer sheet exorbitant even by the Garden’s standards.  The decision to let Lin leave drives Knick fans crazy because of all the bad money thrown after bad up until now.  But if you assess this move in isolation, the Knicks probably did the right thing given the distinct possibility that Lin doesn’t pan out long term.

Since explanations surrounding Mike D’Antoni’s sudden departure as head coach of the Knicks were so convoluted the last 24 hours, let’s try to lay down some truth as we know it and saw it.

Carmelo Anthony came to the Knicks a year ago at a steep price in a trade that both D’Antoni and then-GM Donnie Walsh opposed.  The transaction was forced on them by team owner Jim Dolan.

The dopey son of a cable TV magnate, Dolan knew what was better for a team gifted to him than two respected basketball lifers trying to rebuild the mess left by Dolan yes-man Isiah Thomas.

Mike Francesa calls it “revisionist history” to say there was an outcry when the Knicks acquired Melo.  That’s not true.  Plenty of Knick fans feared Walsh’s methodical effort to clear cap space would be harmed by adding a max-contract guy who was seen as interested only producing max-contract stat lines.

D’Antoni quietly worked with what he had and tried to contain frustration with Melo’s tendency to pitch a tent on the wing and demand that the ball run primarily through him.

When the bottom hit rock for D’Antoni and the team six weeks ago, there was an out-of-nowhere happenstance that played out.  Melo put on street clothes to rest nagging pains and Jeremy Lin put on a superman’s cape.  A Lin-led comeback win at home against Jersey likely saved D’Antoni’s job.  The ensuing seven-game win streak that brought Linsanity proved that an old school point guard leading an offense that rewarded hustle with inclusiveness was both an entertaining and effective style of playing the game.  A broad smile appeared on D’Antoni’s face.  It was a form of basketball that was pleasing to the fan’s eye and one that could finally be embraced by other Knick players who had grown tired of suiting up for roles that were mostly confined to getting out of the way of Melo.

When Melo returned from injury to join Linsanity already in progress, the team went into a tailspin.  Yeah, the schedule during that 2-9 stretch was tougher, but it was easy to see that the plug-in of a me-first superstar shot-taker didn’t mesh with a blossoming motion offense.  Melo’s shots clanked way more than they swished and Linsanity went down with it.  So did D’Antoni’s smile.

Howard Beck of the Times said the team’s nucleus enjoyed the style of play during Linsanity so much, there was building resentment over Melo’s disruption of it.  Said Beck in Thursday’s newspaper:  “Anthony never fully bought into D’Antoni’s system and frequently broke plays to create shots for himself.  The tension between Anthony and D’Antoni – and more broadly between Anthony and the rest of the team – was undermining the Knicks’ cohesion and morale.  Most of the team preferred to keep playing the way they were during the so-called Linsanity streak.”

With the trade deadline looming and this bad-apple dynamic infecting the team, D’Antoni had a chat with his immediate boss Glen Grunwald (who it should be said has a ridiculous interim tag on his GM title) Wednesday.  Grunwald called Dolan.  And then Dolan dragged his droopy self in for a pow-wow that ended with D’Antoni packing up his stuff along with his brother and other trusted assistant.  They walked out the door and agreed to call it a “resignation.”

Melo stayed because Dolan said so.  It was Melo’s way or the highway. Melo and the team owner now have the peace in knowing Melo can clank all the shots he wants while Linsanity goes back into a box for safe keeping until he and the others interested in a team game are freed from this mess.