This seems like something that should be true, but I think I remember seeing a Mythbusters episode where they decided it didn’t make a difference. That show was more about entertainment than science, so I wondered if there was a more rigorous study done? I’ve definitely seen splashes of water(?) come out from flushes so that alone seems to argue for closing lids.
In France they have public toilets that basically do this. The toilet gets completely cleaned automatically with hot water and detergent after you used it. It works by locking up after you unlocked the door after using it. If you hold the door for someone, they get the cleaning treatment.