Leigh Brackett was at pains to stress that a fair chunk of the film's dialogue was hers, although she gave Altman a huge amount of credit for some of the more memorable innovations. The whole business with the cat (and therefore the entire opening scene) was entirely an Altman/Gould creation, much of Hayden's dialogue was indeed improvised, and Brackett was as shocked as everyone else in the audience by the Coke bottle incident - more shocked, in fact, because she thought she knew what was around the corner of every scene - but she and Altman worked very closely together to ensure that while strict textual fidelity wasn't sacrosanct (can you imagine Altman working with someone fastidious like Paddy Chayefsky, who famously wrote it into his Altered States contract that Ken Russell wasn't to touch a word of his script?), they nonetheless agreed when it came to the sense of what they were doing. And certain key elements that are constantly credited to Altman - setting it in present-day California, Gould's casting, the ending - were in fact in place before he got involved, when it was conceived as a Brian G. Hutton project.AfterTheRain wrote:If I recall correctly, Hayden wrote (or ad-libbed) much of of his own dialogue for the film.
So while it's unquestionably an Altman film through and through (and how!), its genesis is somewhat knotty and complicated.
As for the significant divergences from the novel, a lot of those were for practical reasons. As Brackett explained, the novel takes place in two time periods: the then present (i.e. the 1950s), with flashbacks to a decade earlier. So you basically have two choices: either make it a period drama, which whacks the budget way up, or update it to the present (and Chandler was, after all, writing in the present), which means ditching all the WWII stuff. And casting Elliott Gould also dictated a certain approach - as screenwriter of The Big Sleep, Brackett spoke with considerable authority when she said that while he's a terrific actor, he isn't Humphrey Bogart, and nothing he can conceivably do is ever going to make him bear even the faintest resemblance to Humphrey Bogart. So a surprising number of the film's more adventurous ideas were dictated more by situational and contractual circumstance than eccentric whim.