teste

rel

  • This  routine produces a PDF file of relations from readrel.
  • This function calls another function: MULTREL, PRINTPOL;
  • This function calls external function: pdflatex, rm.




u3:=[U^3, 0*U];
v3:=[V^3, 0*V];

make_rel:=[
"$(UV + U + V)^3=0$",

"\\textcolor{red}{$ (1) \\times V^2 \\leftleftarrows (1) \\leftarrow (1) $}",

"\\textcolor{red}{$ U^2 \\times (1) \\leftleftarrows (1) \\leftarrow (1) $}",

"\\textcolor{red}{$ (2) \\times U^2  \\leftleftarrows (2) \\leftarrow (2)$}",

"\\textcolor{red}{$ U^2 \\times (2)  \\leftleftarrows (2) \\leftarrow (2)$}",

"\\textcolor{red}{$ U^2 \\times (4)  \\leftleftarrows (4) \\leftarrow (4)$}",

"\\textcolor{red}{$ (4) \\times V^2  \\leftleftarrows (4) \\leftarrow (4)$}",

"\\textcolor{red}{$ (6) \\leftarrow  (U \\mapsto U^2 -U)  $}",

"\\textcolor{red}{$ (6) \\leftarrow  (V \\mapsto V^2 -V)  $}",

"\\textcolor{red}{$ \\left\\{ U^2 \\times (8) - (8) \\times U^2\\right\\} \\leftleftarrows (5)                \n  \\leftleftarrows (4) \\leftarrow (5) \\leftarrow (4) \\Longleftrightarrow U^2VU^2 \\in Center(B) $}",

"\\textcolor{red}{$ \\left\\{ (6) - U^2 \\times (8) \\right\\} \\leftleftarrows (4)  \\leftarrow (4)             \\Longleftrightarrow U^2V^2U^2 \\in Center(B) $}",

"\\textcolor{red}{$ U \\times (4)   \\leftarrow (4)$}",

"\\textcolor{red}{$ (4) \\times V   \\leftarrow (4) \\leftarrow (8)$}",

"\\textcolor{red}{$ U \\times (8)   \\leftarrow (4)$}",

"\\textcolor{red}{$ (8) \\times V   \\leftarrow (4) \\leftarrow (8)$}",

"\\textcolor{red}{$ (15) \\leftarrow (U \\leftrightarrow V)    \\leftarrow (8)$}",

"\\textcolor{red}{$ (14) \\leftarrow (U \\leftrightarrow V)    \\leftarrow (8)$}",

"\\textcolor{red}{$ (13) \\leftarrow (U \\leftrightarrow V)    \\leftarrow (8)$}",

"\\textcolor{red}{$ (12) \\leftarrow (U \\leftrightarrow V)    \\leftarrow (8)$}",

"\\textcolor{red}{$ V \\times (12) \\leftarrow  (5) \\leftarrow (8) \\leftarrow (16) \\leftarrow (17) \\leftarrow (18) $}",

"\\textcolor{red}{$ (12) \\times U \\leftarrow  (5) $}",

"\\textcolor{red}{$ (12) \\times V \\leftarrow  (4) \\leftarrow (8) \\leftarrow (12) \\leftarrow (13) \\leftarrow (15) $}",

"\\textcolor{red}{$ U \\times (13) \\leftarrow  (4) $}",

"\\textcolor{red}{$ V \\times (13) \\leftarrow  (5) \\leftarrow (8) \\leftarrow (16) \\leftarrow (17) \\leftarrow (18) $}",

"\\textcolor{red}{$ (13) \\times U \\leftarrow  (5) \\leftarrow (6) $}",

"\\textcolor{red}{$ (13) \\times V \\leftarrow  (4) \\leftarrow (8) \\leftarrow (12) \\leftarrow (13) \\leftarrow (15) $}",

"\\textcolor{red}{$ V \\times (14) \\leftarrow  (5) \\leftarrow (8) \\leftarrow (9) \\leftarrow (18) $}",

"\\textcolor{red}{$ (14) \\times U \\leftarrow  (18) \\leftarrow (19) $}",

"\\textcolor{red}{$ V \\times (15) \\leftarrow  (5) \\leftarrow (7) \\leftarrow (8) \\leftarrow (9) \\leftarrow (18) $}",

"\\textcolor{red}{$ (15) \\times U \\leftarrow  (18) \\leftarrow (19) $}",

"\\textcolor{red}{$ (15) \\times V \\leftarrow  (4) \\leftarrow (8) \\leftarrow (9) \\leftarrow (15) $}",

"\\textcolor{red}{$ V \\times (16) \\leftarrow  (5) \\leftarrow (8) \\leftarrow (16) \\leftarrow (17) \\leftarrow (18) $}",

"\\textcolor{red}{$ (16) \\times U \\leftarrow  (5) $}",

"\\textcolor{red}{$ (16) \\times V \\leftarrow  (4) \\leftarrow (8) \\leftarrow (12) \\leftarrow (14) \\leftarrow (15) \\leftarrow (20)  $}",

"\\textcolor{red}{$ U \\times (17) \\leftarrow  (4) $}",

"\\textcolor{red}{$ V \\times (17) \\leftarrow  (5) \\leftarrow (8) \\leftarrow (16) \\leftarrow (17) \\leftarrow (18) $}",

"\\textcolor{red}{$ (17) \\times V \\leftarrow  (4) \\leftarrow (8) \\leftarrow (12) \\leftarrow (14) \\leftarrow (15)  \\leftarrow (24) $}",
#38
"\\textcolor{red}{$ U \\times (18) \\leftarrow  (13) \\leftarrow (15) \\leftarrow (28) \\leftarrow (32) \\leftarrow (34)$}",

"\\textcolor{red}{$ V \\times (18) \\leftarrow  (5) \\leftarrow (8) \\leftarrow (9) \\leftarrow (18) $}",

"\\textcolor{red}{$ (19) \\times V \\leftarrow  (4) \\leftarrow (8) \\leftarrow (9) \\leftarrow (15)$}",

"\\textcolor{red}{$ (38) \\leftarrow  (U \\mapsto U^2 -U) \\leftarrow (6) \\leftarrow (38)  $}",

"\\textcolor{red}{$ U \\times (38) \\leftarrow  (6) \\leftarrow (13) \\leftarrow (15) \\leftarrow (26) \\leftarrow (34) \\leftarrow (37) \\leftarrow (38) $}",

"\\textcolor{red}{$ \\dfrac{1}{3} \\times (38)  $}",

"\\textcolor{red}{$ \\dfrac{1}{6} \\times (41)  $}",

"\\textcolor{red}{$ \\dfrac{1}{3} \\times (42)  \\leftarrow (44) $}",
#46
"\\textcolor{red}{$ (1) \\leftarrow (U \\leftrightarrow V)  \\leftarrow  (2) \\leftarrow (3) \\leftarrow (4) \n  \\leftarrow (16) \\leftarrow (17) \\leftarrow (18) \\leftarrow (43)  \n           \\leftarrow (43) \\leftarrow (44)$}",

"\\textcolor{red}{$ (7) \\leftarrow (U \\mapsto U^2 + 2U)  \\leftarrow  (7) \\leftarrow (9)  $}",

"\\textcolor{red}{$ U \\times (47)$}",

#49
"\\textcolor{red}{$ (47) \\leftarrow (U \\leftrightarrow V) $}",

"\\textcolor{red}{$ (48) \\leftarrow (U \\leftrightarrow V) $}",

"\\textcolor{red}{$ (9) \\leftarrow (V \\mapsto V^2 + 2V)  \\leftarrow  (6) \\leftarrow (9) \\leftarrow (47) \\leftarrow (48) \\leftarrow(49)  $}",

"\\textcolor{red}{$ (51) \\times V \\leftarrow  (4) \\leftarrow (8) \\leftarrow (49) $}",

"\\textcolor{red}{$ (8)  \\leftarrow \\dfrac{1}{6} \\times (51) $}",

"\\textcolor{black}{$ u([X,Y])^3=0 \\leftarrow \\{B^7 = 0\\} \\leftarrow (1) \\leftarrow (2) \\leftarrow (3) \n \\leftarrow (5) \\leftarrow (12)\\leftarrow (13) \\leftarrow (14) \\leftarrow (15) \\leftarrow (20)  \\leftarrow (24) \\leftarrow (28) \\leftarrow (30) \\leftarrow (32) \\leftarrow (34)  \n \\leftarrow (42) \\leftarrow (43) \\leftarrow (44) \\leftarrow (46)  $}",





"\\textcolor{black}{$ u(X^2Y)^3=u(XY^2)^3=0 $}",

"\\textcolor{red}{$ (9) \\leftarrow (U \\mapsto U^2 + 2U)  \\leftarrow  (7) \\leftarrow (9)  $}",

"\\textcolor{red}{$ U \\times (48)  $}",

"\\textcolor{red}{$ (49) \\leftarrow ( U \\leftrightarrow V)  $}",

"\\textcolor{green}{$ (48) \\leftarrow (49)  $}",

"\\textcolor{red}{$ (51) \\leftarrow ( U \\leftrightarrow V)  $}",

"\\textcolor{red}{$ (9) \\leftarrow (V \\mapsto V^2 + 2V)  \\leftarrow  (6) \\leftarrow (9) \\leftarrow (49) \n   \\leftarrow (51) \\leftarrow (52)  $}",

"\\textcolor{red}{$ (53) \\times V  \\leftarrow  (4) \\leftarrow (8) \\leftarrow (52)  $}",

"\\textcolor{red}{$  \\dfrac{1}{3} \\times (49) $}",

"\\textcolor{red}{$  \\dfrac{1}{3} \\times (50) $}",

"\\textcolor{red}{$  \\dfrac{1}{3} \\times (51) $}",

"\\textcolor{red}{$  \\dfrac{1}{3} \\times (52) $}",

"\\textcolor{red}{$  \\dfrac{1}{6} \\times (53) $}",

"\\textcolor{red}{$  \\dfrac{1}{6} \\times (54) $}",



"\\textcolor{black}{$ u([X,Y])^3=0 \\leftarrow \\{B^7 = 0\\} \\leftarrow (20) \\leftarrow (22) \\leftarrow (24) \\leftarrow (28) \\leftarrow (30) \\leftarrow (32) \\leftarrow (34)  \n \\leftarrow (37) \\leftarrow (38) \\leftarrow (41) \\leftarrow (42) \\leftarrow (44) \\leftarrow (48) \\leftarrow (51) \n \\leftarrow (53) \\leftarrow (54) $}",  

"\\textcolor{red}{$  \\dfrac{1}{6} \\times (61) $}",






























];




rel:= [

[ (1)*(U*V)^3, (-1)*U^2*V+(-1)*U*V*U+(-1)*U*V^2+(-1)*V*U^2+(-1)*V*U*V+(-1)*V^2*U+(-1)*U^2*V*U+(-1)*U^2*V^2+(-1)*U*V*U^2+(-2)*(U*V)^2+(-1)*U*V^2*U+(-1)*V*U^2*V+(
    -1)*(V*U)^2+(-1)*V*U*V^2+(-1)*V^2*U*V+(-1)*U*(U*V)^2+(-1)*U*V*U^2*V+(-1)*(U*V)^2*U+(-1)*(U*V)^2*V+(-1)*U*V^2*U*V+(-1)*(V*U)^2*V ],

[ (1)*(U*V)^2*U, (-1)*U^2*V+(-1)*U*V*U+(-1)*U*V^2+(-1)*V*U^2+(-1)*V*U*V+(-1)*V^2*U+(-1)*U^2*V*U+(-1)*U*V*U^2+(-1)*(U*V)^2+(-1)*U*V^2*U+(-1)*(V*U)^2 ],

[ (1)*(V*U)^2*V, (-1)*U^2*V+(-1)*U*V*U+(-1)*U*V^2+(-1)*V*U^2+(-1)*V*U*V+(-1)*V^2*U+(-1)*(U*V)^2+(-1)*V*U^2*V+(-1)*(V*U)^2+(-1)*V*U*V^2+(-1)*V^2*U*V ],

[ (1)*(U*V)^2, (-1)*U^2*V+(-1)*U*V*U+(-1)*U*V^2+(-1)*V*U^2+(-1)*V*U*V+(-1)*V^2*U+(1)*V^2*U^2 ],

[ (1)*(V*U)^2, (-1)*U^2*V+(-1)*U*V*U+(-1)*U*V^2+(-1)*V*U^2+(-1)*V*U*V+(-1)*V^2*U+(1)*U^2*V^2 ],

[ (1)*U^2*V^2*U^2, (1)*U^2*V+(1)*U*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 (3)*U*V*U^2, (-3)*U^2*V*U ],

[ (3)*U^2*V*U^2, 0*U ],

[ (3)*V*U*V^2, (-3)*V^2*U*V ],

[ (3)*V^2*U*V^2, 0*U],

[ (6)*V*U*V, (6)*U^2*V+(6)*U*V*U+(-6)*U*V^2+(6)*V*U^2+(-6)*V^2*U ],

[ (6)*U*V^2*U, (12)*U^2*V+(12)*U*V*U+(12)*V*U^2+(-6)*U^2*V^2+(-6)*V^2*U^2 ],

[ (1)*V*U^2*V, (1)*U*V^2*U ],

[ (6)*V*U^2*V^2*U, 0*V ],






























];
rel_pos:=List([1..Size(rel)], i -> Concatenation(rel[i],[i]));
LogTo();
LogTo("label1");
Print("label1:=[];", "\n");
for i in [1..Size(rel)] do
Print("label1[",i ,"]:= \"");
PrintNP(GP2NP(rel_pos[i][1]));
Print("\"; ", "\n");
od;
LogTo();
Exec("sed ':a;N;s/\\n//g;ta' label1 > label");
Read("label");
label:=List(label1,i -> ReplacedString(i, "^", ""));
label:=List(label,i -> ReplacedString(i, " ", ""));
Exec("rm label label1");




###################################
###################################
###################################
###################################
var:=['U', 'V'];
ORDERP:=function(mon1, mon2)#função para ordenar monomios (lex e grau) strgi deve ser monomios senão erro.
return ORDERING(String(mon1), String(mon2));
end;

ORDERP_L:=function(lista1, lista2)#esta função usa ORDERP para ordenar um lista pela primeira coordenada.
return ORDERP(lista1[1], lista2[1]);
end;

rel_pos:=List([1..Size(rel)], i -> Concatenation(rel[i],[i]));
#Sort(rel_pos, ORDERP_L);
#rel_pos:=Reversed(rel_pos);
###################################
###################################
###################################
###################################

LogTo();
LogTo("rel.tex");
Print(
"\\documentclass{book}", "\n",
"\\usepackage{amssymb}", "\n",
"\\usepackage{amsmath}", "\n",
"\\usepackage{amsthm}", "\n",
"\\usepackage{graphicx,xcolor}", "\n",
"\\usepackage[normalem]{ulem}", "\n",
"\\begin{document}", "\n\n\n"
);

Print("\\begin{enumerate}", "\n");
for i in [1..Size(rel)] do
    Print("\\item (",i , ")", ":= ",make_rel[rel_pos[i][3]],"\n","\\label{eq:", label[i], "}\\\\", "\n");
    Print("$", "\n");
    PrintNP(GP2NP(rel_pos[i][1]));
    Print( "\\;=\\;", "\n");
    PRINTPOL(rel_pos[i][2]);
    Print("$;","\\\\ \\\\ \n");
#########################
#########################
#    Print("\\item[(",rel_pos[i][3],"):=]", make_rel[rel_pos[i][3]], "\\\\", "\n");
#    Print("$", "\n");
#    PRINTPOL_strg(rel_pos[i][1]);
#    Print( "\\;=\\;", "\n");
#    PRINTPOL_strg(rel_pos[i][2]);
#    Print("$;","\\\\ \\\\ \n");
od;

Print("\\end{enumerate}", "\n");


#Print("\\[ \\left< x, y\\;\\;|\\;\\; (x-1)^3, (y-1)^3, (xy-1)^3, (x^{-1}y -1)^3\\right>\\]", "\n");

l:=[];
for i in [1..Size(rel)] do
    if CHECKBYMAT(rel[i]) = false then
        Add(l, i);
    fi;
od;

if l=[] then
    Print("{\\Huge Todas equa\\c c\\~oes s\\~ao verdadeiras.}", "\\newline \\newline" ,"\n");
else
    for i in l do
        Print("(",i,")=falsa, ", "\n" );
    od;
fi;


Print("\\newpage", "\n");




# Proximos comando servem para eliminar os monomios que são escrito em função dos seus antecessores na ordem lex degree (ORDERP).
l:=[];
for i in [1..6] do
    l[i]:=List([1..i], j -> [U, V]);
od;

l:=List(l, Cartesian);
l:=List(l, i -> List(i, Product));
l:=Union(l); #lista dos monomios
for i  in [1..Size(l)] do  
    if SUBS(l[i],[U^3, 0*U])<> l[i] then
        l[i]:= SUBS(l[i],[U^3, 0*U]);
    elif  SUBS(l[i],[V^3, 0*V])<> l[i] then
        l[i]:= SUBS(l[i],[V^3, 0*U]);
    fi;
od;
l:=Filtered(l, i -> i<>0*i);
Sort(l, ORDERP);




lmon:=[];
cont:=0;
for i in [1..Size(l)] do
    laux:=[];
    lf:=Filtered(rel, relation -> relation[1] = l[i]);
    for relf in lf do     
        if POTENBASIS(relf, l) = true then
            Add(laux, true);# aqui deve ser não lmon
        break;
        fi;
    od;
    if true in laux then
        lmon[i]:=[l[i], true];
        cont:=cont+1;
    else
        lmon[i]:=[l[i], false];
    fi;
od;

for mon in lmon do
    if mon[2] = true then
        Print("$", "\n", "\\textcolor{red}{\\bf", "\n");
        PRINTPOL(mon[1]);
        Print(",}$ \\;\\; \n");
    else
        Print("$", "\n");
        PRINTPOL(mon[1]);
        Print("$,\\;\\; \n");
    fi;
od;
        


Print("\\newline \\newline","\n" ,"{\\Huge Dimens\\~ao Algebra $\\leq$ ", Size(l)-cont, "}\\\\", "\n\n");




##################
###################  proximo loops sao para mostrar q B^7=0.

l1:=List([1..7], j -> [U, V]);
l1:=Cartesian(l1);
l1:=List(l1, Product);



for i  in [1..Size(l1)] do  
    if SUBS(l1[i],[U^3, 0*U])<> l1[i] then
        l1[i]:= SUBS(l1[i],[U^3, 0*U]);
    elif  SUBS(l1[i],[V^3, 0*V])<> l1[i] then
        l1[i]:= SUBS(l1[i],[V^3, 0*U]);
    fi;
od;
l1:=Filtered(l1, i -> i<>0*i);
Sort(l1, ORDERP);



lf:=Filtered(rel, relation -> relation[2] = 0*relation[2]);
lf:=List(lf, i -> i[1]);

for mon  in l1 do
    if mon in  lf then
        Print("$", "\n", "\\textcolor{red}{\\bf", "\n");
        PRINTPOL(mon);
        Print( ",}$ \\;\\; \n");
    else
        Print("$", "\n");
        PRINTPOL(mon);
        Print("$,\\;\\; \n");
    fi;
od;


Print("\\newpage", "\\center{\\bf \\Huge Monomios Nulos}", "\n", "\\newline \\newline");
l:=[];
for i in [1..6] do
    l[i]:=List([1..i], j -> ["u", "v"]);
od;

l:=List(l, Cartesian);
l1:=[];for x in l do l1:=Concatenation(l1,x);od;
l1:=List(l1, i-> JoinStringsWithSeparator(i, "*") );

l1:=Filtered(l1, i -> PositionSublist(i, "u*u*u")=fail);
l1:=Filtered(l1, i -> PositionSublist(i, "v*v*v")=fail);
for mon  in l1 do
    if EvalString(mon)=0*u then
        Print("$", "\n", "\\underline{\\textcolor{red}{\\bf", "\n");
        mon:=ReplacedString(mon, "u", "U");
        mon:=ReplacedString(mon, "v", "V");
        PrintNP(GP2NP(EvalString(mon)));
        Print( ",}}$ \\;\\; \n");
    else
        Print("$", "\n");
        mon:=ReplacedString(mon, "u", "U");
        mon:=ReplacedString(mon, "v", "V");
        PrintNP(GP2NP(EvalString(mon)));
        Print("$,\\;\\; \n");
    fi;
od;






        

Print("\\end{document}", "\n");
LogTo();

Exec("pdflatex rel.tex");
#Exec("/Applications/Adobe\\ Reader.app/Contents/MacOS/AdobeReader  rel.pdf &" );
#Exec("/Applications/Safari.app/Contents/MacOS/Safari  rel.pdf &" );
Exec("rm *.aux *.log MEDELETESEMPRE");


#  os comandos abaixo sao para eliminar os produtos cujo peso e maior do 7 ja que B^7=0.
#pol:= ( (U^2-U)*(V^2-V) + (U^2-U) + (V^2-V) )*( U*V + U + V + One(A) ) + U*V + U + V;
#r:=M(POL2REL(pol^3), One(A));
#pol:=r[1]-r[2];
#spol:=String(pol);
#spol:=ReplacedString(spol, "U", "u");
#spol:=ReplacedString(spol, "V", "v");
#sspol:=SplitString(spol, "+");
#sspol:=Filtered(sspol, i -> not EvalString(i) in P7);
#spol:=JoinStringsWithSeparator( sspol, "+");
#spol:=ReplacedString(spol, "u", "U");
#spol:=ReplacedString(spol, "v", "V");
#pol:=EvalString(spol);
#PrintNP(GP2NP(POL2REL(pol)));