On immigration forms, Ms. Chernykh and Mr. Marquez stated that they lived with the Farooks in their townhouse in Corona, Calif. Federal agents, who had searched the home this year, did so again Thursday, and also searched a residence in Ontario, Calif., that was identified as Ms. Chernykh’s.

In fact, the indictment says, neither Mr. Marquez nor Ms. Chernykh lived with the Farooks, and she “resided with her child and an adult male other than Enrique Marquez Jr.” in Ontario.

The would-be couple had wedding pictures taken and opened a joint bank account, but the indictment shows that they were far from expert at creating a false front. At one point, Tatiana Farook told her sister to stop posting pictures of herself posing with her real boyfriend to her social media page, the indictment says, and another time, Ms. Farook told Mr. Marquez that he needed to change the address on his driver’s license to match the one on the immigration forms.

They also left a considerable electronic trail, particularly as Mr. Marquez and Ms. Chernykh prepared last fall for an interview with immigration agents, who would try to determine if their marriage was genuine. Last November, they exchanged messages that “discussed their mutual anxiety for their upcoming immigration interview due to the lack of contact with each other,” and he told her he was afraid of going to prison for immigration fraud, the indictment says.

At about the same time, someone using Mr. Marquez’s Facebook page indicated that he might be in trouble, writing “involved in terrorist plots, drugs, antisocial behavior, marriage, might go to prison for fraud, etc.”

But the planning to hide the sham marriage continued. The day before the shooting, the indictment says, Ms. Farook sent an electronic message to her husband, asking him to create a backdated lease agreement to make it appear that Mr. Marquez and her sister lived with them. The indictment said that the Farooks helped the pair open their joint account and buy a wedding band, and served as witnesses on their marriage license.

On Thursday, the Farooks’ neighbor, Brittani Adams, said she had maintained a friendly relationship with the couple after the December attack.