This is a bit random, but there are some formal systems for Euclid's elements out there (see, for example https://arxiv.org/abs/0810.4315).
I think it should be possible to implement this in a dependently typed language like Idris, but haven't really worked on this (yet). Any thoughts?