In[]:=
ResourceFunction["MetamathImport"][URL["https://raw.githubusercontent.com/geohot/twitchcoq/master/metamath/twoplustwo.mm"],"ProofGraphStructure"]
Out[]=
In[]:=
ResourceFunction["MetamathImport"][URL["https://raw.githubusercontent.com/geohot/twitchcoq/master/metamath/twoplustwo.mm"]]
Out[]=
Addition Facts
Addition Facts
eq[succ[succ[0]],plus[succ[0],succ[0]]]
In[]:=
Table[eq[Nest[s,0,i+j],plus[Nest[s,0,i],Nest[s,0,j]]],{i,3},{j,3}]
Out[]=
{{eq[s[s[0]],plus[s[0],s[0]]],eq[s[s[s[0]]],plus[s[0],s[s[0]]]],eq[s[s[s[s[0]]]],plus[s[0],s[s[s[0]]]]]},{eq[s[s[s[0]]],plus[s[s[0]],s[0]]],eq[s[s[s[s[0]]]],plus[s[s[0]],s[s[0]]]],eq[s[s[s[s[s[0]]]]],plus[s[s[0]],s[s[s[0]]]]]},{eq[s[s[s[s[0]]]],plus[s[s[s[0]]],s[0]]],eq[s[s[s[s[s[0]]]]],plus[s[s[s[0]]],s[s[0]]]],eq[s[s[s[s[s[s[0]]]]]],plus[s[s[s[0]]],s[s[s[0]]]]]}}
In[]:=
ExpressionGraph/@Flatten[%]
Out[]=
,
,
,
,
,
,
,
,
In[]:=
ExpressionGraph[#,VertexLabelsAutomatic]&/@Flatten[%327]
Out[]=
,
,
,
,
,
,
,
,
In[]:=
VertexList
Out[]=
{1,2,3,4,5,6,7,8,9}
In[]:=
AnnotationValue
,VertexLabels
Out[]=
{6s,3s,5plus,8s,70,40,90,2s,1eq}
In[]:=
EdgeList
/.AnnotationValue
,VertexLabels
Out[]=
{eqs,ss,s0,eqplus,pluss,s0,pluss,s0}
In[]:=
atomify[g_]:=Graph[(DirectedEdge@@@EdgeList[g])/.(AnnotationValue[g,VertexLabels])]
In[]:=
ExpressionGraph[#,VertexLabelsAutomatic]&/@Flatten[Table[eq[Nest[s,0,i+j],plus[Nest[s,0,i],Nest[s,0,j]]],{i,3},{j,3}]]
Out[]=
,
,
,
,
,
,
,
,
In[]:=
atomify/@%
Out[]=
,
,
,
,
,
,
,
,
Really should use more of a WM approach with ordered relations
Really should use more of a WM approach with ordered relations
“Ultrapure mathematics”
“Ultrapure mathematics”