What if two people independently arrive at thesame algorithm, say, an optimal implementation with the least possible amount of code in a given language. Is it still a copyright violation? You can't copyright math, can you?
Legally that is not a copyright violation. There are examples where this is likely, and companies make efforts to prove this no copying occurred. I think this is called a 'clean room' implementation.