Hi all,
I want to share with you an example of how proof steps could be visualized to improve readability. When I was trying to understand how Metamath works, I wrote a java program which does verification of theorems according to the Metamath book (just to ensure that my understanding is correct). After that I made an addition to that program to visualize content of the stack with proof steps. Basically this program converts set.mm file to a set of html files with proofs visualizations. I found such visualization very useful for me and I want to share it with you.
Please find attached a screenshot of one of such proof visualizations.
I temporarily placed those generated html files on a web server (though I am not sure how long it will stay online) http://metamath.d4-e5.de/index.html Those html pages contain json data and javascript code which visualizes the data using SVG. It is not optimized, so for some big proofs it may slow your browser down significantly.
Here are few direct links to proofs in case if index.html doesn’t work for any reason:
http://metamath.d4-e5.de/data/2p/2e/2p2e4.html
http://metamath.d4-e5.de/data/sq/rt/2i/sqrt2irr.html
I tested this in Chrome and Firefox only, but I hope it works in other browsers too.
Also there is a link to zip archives with those generated html files:
https://drive.google.com/drive/folders/1na2UM270rsCd85BQCmaJJSnak8HywfL8?usp=sharing
all-assertions--metamath-proof-explorer.zip - contains all axioms and theorems from set.mm and when unarchived it takes 900M.
first-193-assertions--proof-explorer.zip - takes only 2M when unarchived.
And here is the repo with the program https://github.com/Igorocky/text-parser (I am sorry for the “cleanliness” of the code, it is a proof of concept and I am not sure it will be interesting to anyone else except of me).
I am not a mathematician and I am a novice to Metamath, so I am sorry if this is useless or too primitive. I just found it very helpful for me to understand proofs and I think it may be helpful for others who are also novice to proof formalization.
Best regards,
Igor Yeskov
I like this very much. I think I will add a variable to the $t statement in set.mm so your base URL can be maintained there, instead of being hard-coded in metamath.exe. (And Thierry's structured version also, which is currently hard-coded.) Give me a week or so.An observation (in Chrome 87.0.4280.88 at least): when the [+] box is clicked, the [-] box sometimes appears in the lower-left corner of the expanded table cell and other times in the upper-left corner. E.g. step 34 of sqrtirr shows a lower-left [-] and step 35 shows an upper-right [-]. Ideally the [-] would remain at the same position as the corresponding [+] so we can open and close an expansion
The problem with the “jumping” [-] button is fixed. I also added few more features:
1) Adjustment of column widths: click a “three horizontal lines” button at the top right corner of the proof table. Column widths are stored in the local storage of the browser, so width adjustment may be done only once and it will be applied to all other assertion pages unless local storage is turned off.
2) Highlighting of matching parentheses: hover the mouse over a parenthesis to temporarily highlight it or click it to highlight it permanently. This feature works only on unexpanded expressions.