In recent days, investigators in Connecticut and Arizona have released thousands of pages of documents about the Tucson and Sandy Hook massacres. The documents, coupled with investigative leaks and with testimony about the movie theater shooting in Aurora, Colo., paint a clearer picture of what caused these tragedies. It isn't just high-capacity magazines or defenseless victims. It's a failure to link firearms access to mental health information.

On Sept. 29, 2010, Pima Community College told the parents of a troubled student, Jared Loughner, that he was being suspended for a raving video he had made. College officials stipulated that before returning to campus, he would have to "obtain a mental health clearance indicating (that), in the opinion of a mental health professional, his presence at the College does not present a danger to himself or others." The officials advised Loughner's parents, with whom he was living, to remove any firearms he might use. So Loughner's dad took away the shotgun his son had bought from a local store in 2008. As compensation, the father gave his son money to cover part of what the gun had cost.

What did Loughner do with the money? He went back to the same store and bought a Glock pistol. The clerks at the store had no idea anything crucial about Loughner had changed. They made him sign the same form and go through the same background check, with the same result: He passed. That's because the form focuses on prior criminal behavior. The only mental health question it asks is whether you've ever been institutionalized or declared incompetent to manage your own affairs.

On Dec. 6, a week after the Glock purchase and a month before the shooting, Loughner put two spent cartridge casings from the gun in an envelope, with a note describing them as proof that he had "planned my assassination." Police later found the envelope in a safe in his room. Apparently, his parents hadn't looked inside it.

Three weeks before the shooting, Loughner showed the Glock to a friend. It had an extended clip full of rounds. The friend later told police that Loughner had failed to give a satisfactory answer to his question: "Why the hell do you have this?" Noting that Loughner had "crazy thoughts" about the government, the friend assured investigators that when Loughner showed up with the gun, "I kicked him out of my house." Fat lot of good that did.

Three hours before the shooting, Loughner tried to buy ammunition at a Walmart. The clerk, uneasy about Loughner's agitation, told him the ammo wasn't in stock.

So what did Loughner do? He went to the next Walmart and bought the same ammo 23 minutes later. Warnings don't get passed, even between Walmarts.

• • •

A year after the Tucson shooting, James Holmes, a neuroscience student at the University of Colorado, began to unravel.

Dr. Lynne Fenton, a psychiatrist at the university, has testified that she met with Holmes on June 11, 2012, and subsequently contacted a campus police officer "to communicate my concerns" about him. Reports from Denver, citing sources close to the investigation, say that Fenton requested a criminal background check on Holmes and contacted colleagues on the university's Behavioral Evaluation and Threat Assessment team because Holmes was fantasizing about killing "a lot of people."

What did Fenton and her colleagues do about this menace? Nothing, apparently. Holmes was already in the process of leaving the school. He had dropped out of the neuroscience program on June 10. By June 12, he no longer had access to campus facilities that required security clearance. He wasn't the university's problem anymore.

Over the next month, Holmes bought an arsenal of weapons and military gear from merchants who knew nothing about his condition. He eventually stockpiled four guns and 6,000 rounds of ammunition, which he used on July 20 to kill 12 people and injure 58 more.

• • •

Adam Lanza's atrocity came five months later, but the warning signs began years earlier.

The New York Daily News, citing a Connecticut State Police colonel, says Lanza had a "spreadsheet 7 feet long and 4 feet wide" that compared body counts and weaponry from so many mass killings "it had to have taken years" to compile. Police records also mention the discovery of three photos at Lanza's home depicting "a deceased human covered with … what appears to be blood," as well as a "digital image print of a child and various firearms." The Daily News says there was a 2-year-old picture showing Lanza "strapped with weapons, posing with a pistol to his head."

You'd think that Lanza's mother, who lived alone with him, might have stumbled across one of these clues. Even if she never found any of the photos or the giant spreadsheet, she told friends more than a year ago that he was burning himself with a lighter. Yet she continued to buy him deadly weapons and train him in their use.

All three guns Lanza brought into Sandy Hook Elementary School were registered to his mother. In addition to these and the shotgun in his car, a search of their home turned up two rifles, 10 knives (four of them with blades at least 9 inches long), three Samurai swords, a spear, a bayonet, and 1,700 rounds of ammunition.

Every detail suggests that this woman, in her blind folly, armed her son for mayhem. She bought four of her guns between 2010 and 2012, as he was deteriorating. (Records suggest two of them were purchased in October and December 2011.) She took him to shooting ranges to practice. When police entered her house after the Sandy Hook shooting and found her dead — apparently having been shot before she could get up — her gun locker was open, with no signs it had been broken into. The weapons were there for the taking.

• • •

The more we learn about these cases, the more they complicate the gun debate. Loughner, with a handgun, fired at a faster rate than Holmes or Lanza did with their rifles. Holmes' giant drum magazine didn't help him; it jammed his weapon. The cops in Connecticut think Lanza picked an elementary school because it was an easy target, just as the National Rifle Association says. And these guys were nuts, not crooks. Criminal background checks wouldn't have stopped them.

When I look at all the documents, the common thread is mental illness. Worries and warnings about it weren't heeded or shared.

I can't tell you how to link weapon sales to behavioral assessment in a way that avoids those scenarios. But I can tell you this: Until we do, there will be more carnage.

Got a comment on this story? Email tbteditors@tampabay.com. Please include your full name and city.