ordcomp = (s,L) -> ( oc:={}; for i from 0 to #L - 1 do ( if member(L_i,s)==false then oc=append(oc, L_i) ); return oc ) switcher = (S,a,b) -> ( S = set S - set {a} + set {b}; newS = {}; for i from 0 to #S-1 do ( newS = append(newS, min toList S); S=S - set {min toList S} ); return newS ) chowm0nlite = (n) -> ( L=apply(n, i -> i+1); subs=flatten apply(n-3, i-> subsets(L,i+2)); subsw1={}; cmpprs={}; for i from 0 to #subs -1 do ( if member(1,subs_i)==true then ( subsw1=append(subsw1,subs_i); cmpprs=append(cmpprs,{subs_i, ordcomp(subs_i,L)}) ) ); rstr="QQ["; for i from 0 to #subsw1-1 do ( rstr=concatenate(rstr,"D_",toString subsw1_i,", ") ); rstr=substring(0,#rstr - 2,rstr); rstr=concatenate(rstr,"]"); R=value rstr; --D_S = D_Sc relations for i from 0 to #cmpprs -1 do ( relstr={}; relstr = concatenate(relstr,"D_",toString cmpprs_i_1," = D_",toString cmpprs_i_0,";"); value relstr ); --D_S*D_T relations prs=subsets(subs,2); i2str="{"; for i from 0 to #prs - 1 do ( S= prs_i_0; T=prs_i_1; Tc=ordcomp(T,L); if {isSubset(S,T),isSubset(T,S),isSubset(S,Tc),isSubset(Tc,S)}=={false,false,false,false} then ( i2str=concatenate(i2str,"D_",toString S,"*D_",toString T,", "); )); i2str=substring(0,#i2str-2,i2str); i2str=concatenate(i2str,"}",); I2=ideal value i2str; --The M04 relations --Use the Rulla basis i3str="{"; for i from 3 to n-1 do ( for j from i+1 to n do ( T12notij={}; for k from 0 to #subs-1 do ( if {isSubset({1,2},subs_k),isSubset({i,j},ordcomp(subs_k,L))}=={true,true} then T12notij = append(T12notij,subs_k)); T1inot2j=apply(#T12notij, k-> switcher(T12notij_k,2,i)); for k from 0 to #T12notij-2 do ( i3str=concatenate(i3str,"D_", toString T12notij_k," + ")); i3str=concatenate(i3str,"D_", toString T12notij_(#T12notij-1)); for k from 0 to #T1inot2j-1 do ( i3str=concatenate(i3str," - D_", toString T1inot2j_k)); i3str=concatenate(i3str,", ") ) ); for k from 4 to n do ( T13not2k = {}; for l from 0 to #subs-1 do ( if {isSubset({1,3},subs_l),isSubset({2,k},ordcomp(subs_l,L))}=={true,true} then T13not2k = append(T13not2k,subs_l)); T1knot23=apply(#T13not2k, l-> switcher(T13not2k_l,3,k)); for l from 0 to #T13not2k-2 do ( i3str=concatenate(i3str,"D_", toString T13not2k_l," + ")); i3str=concatenate(i3str,"D_", toString T13not2k_(#T13not2k-1)); for l from 0 to #T1knot23-1 do ( i3str=concatenate(i3str," - D_", toString T1knot23_l)); i3str=concatenate(i3str,", ") ); i3str=substring(0,#i3str-2,i3str); i3str=concatenate(i3str,"}"); I3=ideal value i3str; I=I2+I3; return R/I )