Public key cryptography was invented by the academic researchers Diffie, Hellman, Merkle, Rivest, Shamir, and Adleman. They’re the ones who came up with the idea, and they’re the ones who created functions that could work with it. Here’s the issue: British GCHQ researchers Ellis, Cocks, and Williamson did all of those things too. The only difference between the two groups is that the GCHQ researchers couldn’t publish their work because it was classified.
The phenomenon that occurred here happens in another science: biology. There, it’s known as Convergent evolution. Convergent evolution is the independent evolution of some biological feature by two different species. For example, echolocation evolved in dolphins and whales, but also independently in bats. Similarly, birds, bats, pterosaurs, and insects are not closely related to each other but they all have wings. They don’t all share some great winged ancestor, they just evolved to fly because that’s a useful thing to be able to do. The inability to fly was a common problem for all of these animals and independently, they solved it with the development of wings.
Similarly, the American academic researchers and the GCHQ researchers were each facing the problem of key distribution. Cryptography had advanced to the point where making a secure cipher was less challenging than arranging to share the key with the recipient of the cipher. Leading-edge cryptographers had arrived at the same obstacle at around the same time, and they each found the same (or similar) solution to it. That solution came to be associated with the American researchers because the Brits were under oath. They couldn’t even share their findings with their families, much less file a patent. The fact that one group came up with public-key cryptography doesn’t mean that the other didn’t. The two groups independently made convergent solutions.