Did you miss the bit where copilot reproduced exactly a function including the comments? That's not some mashup or reinterpretation or inspiration it meets the definition of plagiarism in universities and is just copying.
I didn’t miss that, this still doesn’t make the answer obvious to me. I’m pretty sure I’ve unknowningly replicated licensed code as well during my time as an engineer, and I’ve written way less code over my 8 years than Copilot has.
Then if you were discovered using it in a commercial project you can fairly be sued for it. Unless you're trying to argue that you should for some reason get an exemption?
Would I be found guilty if I could prove that I didn’t explicitly copy that code but rather just happened to write the same code by arriving at the same solution as the original one I had seen years before?
Nobody can answer this because it depends on the code and the resources of the entity suing you, but in general yes. This is why clean room design is a well-defined strategy: depending on the code and company, you would indeed not be allowed to work on the project because of the fact you'd seen a competitors solution previously.