It was all in the library at Alexandria. I think it burned down though.
Pythagoras studied for years under Egyptian priests in Egypt. The Library is a different matter. It was the Egyptians as far back as the Old Kingdom and likely even pre-dynastic that all of that figured out.
You don’t imagine that the Pyramids at Giza are just random piles of stones with no other significance?