I know there's a relationship between the public keys in an electrum wallet, but I don't understand the math behind it.
Given a bunch of addresses (that have spent coins, so you know their public keys) that you suspect are from the same electrum wallet, is it possible to determine with some degree of certainty that they are indeed from the same wallet? And if you know they are from the same wallet, and you know the gap, is it possible to enumerate all addresses from that wallet?
If it is possible, what is the procedure, and how many public keys would you need?
Short answer, no.
Long answer, because of the deterministic nature of the key generation, it's possible that if you were to share your master public key (like used in watch-only wallets) and one private key - the entire set of keys could be re-created.