Ah, that's quite interesting! I'm going through a similar process of formalization, but starting from Wikipedia (but law did indeed cross my mind as a good candidate for formalization too).
I'm also starting from a set-theoretic-like starting point, but am using Discourse Representation Theory to express it in a higher level language that is a subset of english.
https://code.sgo.to/2021/01/06/brazil.html
Find on twitter in case you are interested in telling me more about formalizing the constitution?
https://twitter.com/samuelgoto
FWIW, metamath looks really awesome, will look more closely into it!