And I could prove that they had! The key was that we could find vestiges of the A code in the B code in a way that wasn't just person P's own personal style. for example, software A would set a logging variable as it did some processing, and under specific conditions would actually write to a log file. Software B also had the logging variable, and set in the exact same way even though the underlying code was different and it was never written out. And there were date-stamped comments in software A, and the same comments were present in software B, even though software B was written long after software A.
Lazy copiers might be easy to spot if there were inconsistencies in formatting throughout a program, comments that match copied-from-source, lots of extraneous glue that indicates lacking the understanding to factor and adapt techniques.
Also, everyone uses some Stack Overflow snippets, so it don't expect things to be absolutely from scratch.