Howling:I'm pretty sure the doctor was back before the wedding.

There’s more evidence to suggest he and the TARDIS came back, at least partly, with the rest of the world than there is to suggest Amy remembered him back at the wedding.

He came back when everyone else did, Tardis included, dropped river off at the wedding with the diary and waited to make a dramatic entrance.

Amy still had the raggedy doctor dolls on her dresser in the morning, so she must have remembered something of him. And of course let's not forget he was ready with a tuxedo.

Also we're told time and time again he's a liar...

he just needed her to remember enough at the wedding to bring back his history, (or future? eg the info in the diary.)

It seems to be amy remembers, then the memories of everyone else fill in the blanks, in this case the doctors own memories.