I was having trouble recalling that scene in detail, so I checked with Ariana DeVere:
SHERLOCK You knew about the wedding; more importantly, you’d seen a wedding invitation. Now barely a hundred people had seen that invitation. The Mayfly Man only saw five women. For one person to be in both groups ... could be a coincidence.
MYCROFT Oh, Sherlock. What do we say about coincidence?
SHERLOCK The universe is rarely so lazy.
MYCROFT: So, the balance of probability is ...?
SHERLOCK: Someone went to great lengths to find out something about this wedding.
MYCROFT: What great lengths?
SHERLOCK They lied, assumed false identities.
MYCROFT: Which suggests ...?
SHERLOCK: Criminal intent.
MYCROFT: Also suggests ...?
SHERLOCK: Intelligence, planning.
MYCROFT: Clearly. But more importantly ...?
SHERLOCK (in the Chamber): The Mayfly Man is ... here today.
And after giving it a good look, I think your second interpretation is the correct one.