IANL but I think it's perjury to lie in a declaration "under penalty of perjury" only if that declaration is specifically required under the law or if you are submitting it to a legal body, such as a court, or to achieve an expressly defined legal outcome. For example, the DMCA specifically requires such a declaration when making a complaint, so private parties can require it and you could face criminal prosecution for lying.
On the other hand, I have no idea what legal justification could Udacity claim. It's probably bogus.