Though the Pythagorean theorem is attributed to Pythagoras, a mathematician and philosopher who lived in the 6th century BC,
the first proof had not been completed before the year 300 BC,
when it appeared in Euclid’s Elements.
Pay attention to the last part of the sentence: it' s a modifier. "
when it appeared in Euclid’s Elements" what should modify? The proof that appeared in Euclid's Elements.
So in the underlined part we must have the "proof" (otherwise that modifier makes no sense)
B. it had not been proven to be true before the year
E. it was not proven to be true prior to
Out B and E that do not have "proof". We are left with A C and D.
A. the first proof
had not been completed before the year
The past perfect must express an action that happened for a long period of time,this is not the case. Out A
C. the first proof of the theorem was not completed prior to
D. the first proof was not completed until
Between C and D, D is the better chioce. D is more coincise (clearly) and C uses "prior to" (not an error by itself, but "until" is preferred)