{VERSION 4 0 "SUN SPARC SOLARIS" "4.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 1 }{CSTYLE "2D Output" 2 20 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 256 "" 1 24 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }{PSTYLE "Normal " -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Heading 1" 0 3 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }1 0 0 0 8 4 0 0 0 0 0 0 -1 0 } {PSTYLE "Maple Output" 0 11 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }3 3 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 11 12 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }1 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT 256 67 "Given a fl oating point complex number, find its minimal polynomial." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart;" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 13 "Digits := 40;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>% 'DigitsG\"#S" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 99 "alpha := .0 02753340381990234990115493078115778952576 + 1.145047303126922965147677 457351240915890*I;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%&alphaG,&$\"Iw D&*yd6yI\\:,*\\B!*>QSLv#!#U\"\"\"%\"IG$\"I!*e\"4C^tXxw9lH#p7.t/X6!#R" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 51 "This alpha is a solution of a p olynomial g in Z[x]." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 " " {TEXT -1 42 "Given to you is the following information:" }}{PARA 0 " " 0 "" {TEXT -1 16 " degree(g) < 8." }}{PARA 0 "" 0 "" {TEXT -1 54 " \+ coefficients of g have absolute value less than 300." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 164 "Find such polynomial \+ g. Of course g(alpha) should be 0, but we only know 40 digits of alp ha, so g(alpha) will not necessarily be equal to 0, just very close to 0." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "g := add(c[i] * x^i, i=0..7);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"gG,2&%\"cG6#\"\"!\"\" \"*&&F'6#F*F*%\"xGF*F**&&F'6#\"\"#F*)F.F2F*F**&&F'6#\"\"$F*)F.F7F*F**& &F'6#\"\"%F*)F.F " 0 "" {MPLTEXT 1 0 84 "subs(x=alpha,g) = 0; # Note: Make \+ sure that Digits >= 40 so we don't loose accuracy" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#/,2&%\"cG6#\"\"!\"\"\"*&,&$\"IwD&*yd6yI\\:,*\\B!*>QSLv# !#UF)%\"IG$\"I!*e\"4C^tXxw9lH#p7.t/X6!#RF)&F&6#F)F)F)*&,&$!Ic?OB&y(o'* >X(3.)\\^Xd768F2F)F/$\"I0+x9t(33L?AY4uwz&*4aI'F.F)&F&6#\"\"#F)F)*&,&$! INO'f0](*z]x'*RfV[G\"o*H3\"!#TF)F/$!I\"*emIl\\V_a<_@UB-QOG,:F2F)&F&6# \"\"$F)F)*&,&$\"Ix%>Edc,>Rp%\\vuuNi4,>gJdAaEq'fQmqV`;F BF)&F&6#\"\"%F)F)*&,&$\"Ifzak7t]=7qit:'HP)ecmBFBF)F/$\"I'p))G9Yd&=_')* eLgUF2F)&F&6#\"\"&F)F)*&,&$!I.*e5v)*)*\\VzEh]$Ret_t`AF2F)F/$\"I% >t%zat$p>Y(o>.%>.zq=#Q\"e\\xSh RM%FBF)F/$!Io38ZtLA<#RZAJ+hY'Ra!e#F2F)&F&6#\"\"(F)F)F(" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 49 "We can split this up into two seperate eq uations:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "vars:=\{seq(c[i ],i=0..7)\};" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%%varsG<*&%\"cG6#\"\" !&F'6#\"\"#&F'6#\"\"$&F'6#\"\"\"&F'6#\"\"%&F'6#\"\"&&F'6#\"\"'&F'6#\" \"(" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 42 "eq1 := collect(subs( x=alpha,g), vars, Re);" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#>%$eq1G,2&% \"cG6#\"\"!\"\"\"&F'6#\"\"#$!Ic?OB&y(o'*>X(3.)\\^Xd768!#R&F'6#\"\"$$!I NO'f0](*z]x'*RfV[G\"o*H3\"!#T&F'6#F*$\"IwD&*yd6yI\\:,*\\B!*>QSLv#!#U&F '6#\"\"%$\"Ix%>Edc,>Rp%\\vuuNi4,>=#Q \"e\\xShRM%F6" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 42 "eq2 := col lect(subs(x=alpha,g), vars, Im);" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#>% $eq2G,0&%\"cG6#\"\"#$\"I0+x9t(33L?AY4uwz&*4aI'!#U&F'6#\"\"$$!I\"*emIl \\V_a<_@UB-QOG,:!#R&F'6#\"\"\"$\"I!*e\"4C^tXxw9lH#p7.t/X6F2&F'6#\"\"%$ !IacxB(>gJdAaEq'fQmqV`;!#T&F'6#\"\"&$\"I'p))G9Yd&=_')*eLgUF2&F'6 #\"\"'$\"I%>t%zat$p>Y(o>.%>.zq " 0 "" {MPLTEXT 1 0 66 "M := matrix(2,8, [seq( [seq(coeff(j,c[i]),i=0..7)], j=[eq1,eq2])]);" }}{PARA 12 "" 1 " " {XPPMATH 20 "6#>%\"MG-%'matrixG6#7$7*\"\"\"$\"IwD&*yd6yI\\:,*\\B!*>Q SLv#!#U$!Ic?OB&y(o'*>X(3.)\\^Xd768!#R$!INO'f0](*z]x'*RfV[G\"o*H3\"!#T$ \"Ix%>Edc,>Rp%\\vuuNi4,>=#Q\"e\\xShRM%F37*\"\"!$\"I!*e\"4C^tXxw9lH #p7.t/X6F0$\"I0+x9t(33L?AY4uwz&*4aI'F-$!I\"*emIl\\V_a<_@UB-QOG,:F0$!Ia cxB(>gJdAaEq'fQmqV`;F3$\"I'p))G9Yd&=_')*eLgUF0$\"I%>t%zat$p>Y(o> .%>.zq " 0 "" {MPLTEXT 1 0 65 " old_digits := Digits; Digits:=5;map(evalf,M); Digits:=old_digits;" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#>%+old_digitsG\"#S" }}{PARA 11 "" 1 " " {XPPMATH 20 "6#>%'DigitsG\"\"&" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#-% 'matrixG6#7$7*$\"\"\"\"\"!$\"&Lv#!\"($!&6J\"!\"%$!&I3\"!\"'$\"&!>F0$\"&=D$F3$!&0e#F0" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%'DigitsG\"# S" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 36 "Now lets look at the solutio ns of M:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "sol:=linalg[lin solve](M,[0,0]);" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#>%$solG-%'vectorG6 #7*&%#_tG6#\"\"\"&F*6#\"\"#&F*6#\"\"$&F*6#\"\"%&F*6#\"\"&&F*6#\"\"',.F )$\"I%)o#**Rc<`P,\"y*omO!R4+OW!#SF-$!ITmnu([TW]z?qn=?qL$3Ht!#UF0$!If$H El&3_s%FB,.F-$\"I.MLz#=F\\JXpi( F?F)$\"I;;\"Qo$z#f\")3Bv\"*p**>y^)*e&FB" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 174 "This isn't helpful at all. How are we going to find valu es for the following variables _t1, _t2, .. in such a way that all 8 e ntries (which are: c[0],..,c[7]) are integers???" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 143 "It's easy to make sure t hat the first 6 entries (c[0] .. c[5] = _t1 .. _t6) are integers, bu t the last two c[6],c[7] need to be integers too." }}{PARA 0 "" 0 "" {TEXT -1 124 "You can try all you want, but with standard linear algeb ra methods you can't find an integer solution \"sol\" of the matrix M. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 40 "We're going to need something different." }}{PARA 0 "" 0 "" {TEXT -1 120 "W e want: eq1 to be very close to 0 (in theory we want eq1 = 0 but due to round off errors we can't hope for that)." }}{PARA 0 "" 0 "" {TEXT -1 3 "Now" }}{PARA 0 "" 0 "" {TEXT -1 57 " eq1 is very close to 0 <====> C * eq1 is small" }}{PARA 0 "" 0 "" {TEXT -1 27 "wh ere C is some big number." }}{PARA 0 "" 0 "" {TEXT -1 151 "Lets take C = 10^40 because we had 40 digits accurate. Then the digits after the decimal point in C*eq1 are not accurate, so we may round to integers. " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "C := 10^Digits;" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"CG\"J++++++++++++++++++++\"" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "eq1 := collect( C*eq1, vars, round);" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#>%$eq1G,2&%\"cG6#\"\"!\"J+ +++++++++++++++++++\"&F'6#\"\"#!Jg0iL_y(o'*>X(3.)\\^Xd768&F'6#\"\"$!Hk jf0](*z]x'*RfV[G\"o*H3\"&F'6#\"\"\"\"GE&*yd6yI\\:,*\\B!*>QSLv#&F'6#\" \"%\"JqZ>Edc,>Rp%\\vuuNi4,><&F'6#\"\"&\"H'zak7t]=7qit:'HP)ecmB&F'6#\" \"'!JI!*e5v)*)*\\VzEh]$Ret_t`A&F'6#\"\"(!Hoh'R%4Z*G\">=#Q\"e\\xShRM%" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "eq2 := collect( C*eq2, va rs, round);" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#>%$eq2G,0&%\"cG6#\"\"# \"G+x9t(33L?AY4uwz&*4aI'&F'6#\"\"$!J5*emIl\\V_a<_@UB-QOG,:&F'6#\"\"\" \"J+*e\"4C^tXxw9lH#p7.t/X6&F'6#\"\"%!HlvPs>gJdAaEq'fQmqV`;&F'6#\"\"&\" Jgp))G9Yd&=_')*eLgU&F'6#\"\"'\"H>t%zat$p>Y(o>.%>.zq " 0 "" {MPLTEXT 1 0 37 "v := [ seq(c[i], i=0..7), eq1, eq2 ];" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#>%\"vG7,&%\"cG6#\"\"!&F'6#\"\"\"&F'6#\"\"#&F '6#\"\"$&F'6#\"\"%&F'6#\"\"&&F'6#\"\"'&F'6#\"\"(,2F&\"J+++++++++++++++ +++++\"F-!Jg0iL_y(o'*>X(3.)\\^Xd768F0!Hkjf0](*z]x'*RfV[G\"o*H3\"F*\"GE &*yd6yI\\:,*\\B!*>QSLv#F3\"JqZ>Edc,>Rp%\\vuuNi4,>=#Q\"e\\xShRM%,0F- \"G+x9t(33L?AY4uwz&*4aI'F0!J5*emIl\\V_a<_@UB-QOG,:F*\"J+*e\"4C^tXxw9lH #p7.t/X6F3!HlvPs>gJdAaEq'fQmqV`;F6\"Jgp))G9Yd&=_')*eLgUF9\"H>t%z at$p>Y(o>.%>.zq " 0 "" {MPLTEXT 1 0 56 "for i from 0 to 7 do\n V[i] := map( coeff, v, c[i] ) \nod;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>&%\"VG6#\"\"!7,\"\"\"F'F'F'F 'F'F'F'\"J++++++++++++++++++++\"F'" }}{PARA 11 "" 1 "" {XPPMATH 20 "6# >&%\"VG6#\"\"\"7,\"\"!F'F)F)F)F)F)F)\"GE&*yd6yI\\:,*\\B!*>QSLv#\"J+*e \"4C^tXxw9lH#p7.t/X6" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>&%\"VG6#\"\"# 7,\"\"!F)\"\"\"F)F)F)F)F)!Jg0iL_y(o'*>X(3.)\\^Xd768\"G+x9t(33L?AY4uwz& *4aI'" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>&%\"VG6#\"\"$7,\"\"!F)F)\"\" \"F)F)F)F)!Hkjf0](*z]x'*RfV[G\"o*H3\"!J5*emIl\\V_a<_@UB-QOG,:" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#>&%\"VG6#\"\"%7,\"\"!F)F)F)\"\"\"F)F)F )\"JqZ>Edc,>Rp%\\vuuNi4,>gJdAaEq'fQmqV`;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>&%\"VG6#\"\"&7,\"\"!F)F)F)F)\"\"\"F)F)\"H'zak7t]=7qit: 'HP)ecmB\"Jgp))G9Yd&=_')*eLgU" }}{PARA 11 "" 1 "" {XPPMATH 20 "6 #>&%\"VG6#\"\"'7,\"\"!F)F)F)F)F)\"\"\"F)!JI!*e5v)*)*\\VzEh]$Ret_t`A\"H >t%zat$p>Y(o>.%>.zq&%\"VG6#\" \"(7,\"\"!F)F)F)F)F)F)\"\"\"!Hoh'R%4Z*G\">=#Q\"e\\xShRM%!J!o38ZtLA<#RZ AJ+hY'Ra!e#" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 48 "Hence v is an elem ent of L := Z*V0 + .. + Z*V7." }}{PARA 0 "" 0 "" {TEXT -1 33 "We have the following basis of L:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "basis_L := [seq(V[i], i=0..7)]:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 155 "Unfortunately, all our basis elements have very long length ( they all have lenght around 10^40, but we want length somewhere in t he 10^2 or 10^3 range)." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 108 "Lets compute a new basis of the same L using the LL L algorithm, also called the lattice-reduction algorithm." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 135 "### WARNING: persistent store make s one-argument readlib obsolete\nreadlib(lattice): # only necessary i n Maple 5, not in later versions" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "new_L := lattice(bas is_L);" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#>%&new_LG7*7,\"$]\"\"$\"H!\" &\"#$)!$N#!$H$!$5\"!$q\"!$?$\"$:$7,!$+\"!$%>\"#?!#B\"$X\"\"$2#\"#b\"#& )\"$?'\"$q)7,\"$+$\"$K'\"#()\"$J\"!$2&!$8(!$0$!$S$\"%g8!$I'7,!0H)GFh3w 7!/bPRHrkH!/Uz!GMG@%!/#o%Q#y3=)!/^<]f`x[!/dCK>^tU!/I9S$))H%p\"./P!zPx6 !.wdf^Q\\#\".DClgd(=7,\"/TNSFGd\"*\"/')y)G(R.R\"/(>mA^$Q\")\"/EdN\\j)G \"!/Oh_k_%f%\"/MJ[>h.!*!/nL%H4RB%\"/VrqHzXy!.=1)=$*>Q\".23l9\"o;7,!0cT ]^E'>:\"/bpofiXU\"/#Rzs+2P'\"0>Ca/#)fV\"\"/F4%f:L*e\"/;9r1$H:\"!/+_j3$ f*e!/+k9tK(o&!.!ewu')zd!.&e*zd/$[7,!/1iMCq$\"0W8$zP?[;!.Wfp!Hr**\"/R&3Ua-W\"" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 142 "The improved basis, found by the LLL (Lenstra, Lenstra, Lovasz) algorithm finds 3 short vectors. Lets determine the \+ corresponding polynomials:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 41 "v1,v2,v3 := new_L[1], new_L[2], new_L[3]:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "g1 := add(v1[i+1]*x^i, i=0..7);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#g1G,2\"$]\"\"\"\"%\"xG\"$\"H*$)F(\"\"#F'!\"&*$) F(\"\"$F'\"#$)*$)F(\"\"%F'!$N#*$)F(\"\"&F'!$H$*$)F(\"\"'F'!$5\"*$)F(\" \"(F'!$q\"" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "g2 := add(v2[ i+1]*x^i, i=0..7);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#g2G,2!$+\"\" \"\"%\"xG!$%>*$)F(\"\"#F'\"#?*$)F(\"\"$F'!#B*$)F(\"\"%F'\"$X\"*$)F(\" \"&F'\"$2#*$)F(\"\"'F'\"#b*$)F(\"\"(F'\"#&)" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "g3 := add(v3[i+1]*x^i, i=0..7);" }}{PARA 11 "" 1 " " {XPPMATH 20 "6#>%#g3G,2\"$+$\"\"\"%\"xG\"$K'*$)F(\"\"#F'\"#()*$)F(\" \"$F'\"$J\"*$)F(\"\"%F'!$2&*$)F(\"\"&F'!$8(*$)F(\"\"'F'!$0$*$)F(\"\"(F '!$S$" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 20 "and lets check them:" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "subs(x=alpha,g1);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,&$!#Y!#R\"\"\"%\"IG$\"%(*\\!#T" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "subs(x=alpha,g2);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,&$\"#t!#R\"\"\"%\"IG$\"$,*!#S" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "subs(x=alpha,g3);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,&$\"\"\"!#QF%%\"IG$\"%/*)!#S" }}}{EXCHG {PARA 0 "" 0 " " {TEXT -1 141 "So they all seem to have alpha as a root (at least up \+ to very high accuracy). But if g1, g2 both have alpha as a root, then \+ so does their gcd" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "g := g cd(g1,g2);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"gG,.!#]\"\"\"%\"xG!# (**$)F(\"\"#F'\"#N*$)F(\"\"$F'\"#P*$)F(\"\"%F'\"#b*$)F(\"\"&F'\"#&)" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "g := gcd(g, g3);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"gG,.!#]\"\"\"%\"xG!#(**$)F(\"\"#F'\"#N*$ )F(\"\"$F'\"#P*$)F(\"\"%F'\"#b*$)F(\"\"&F'\"#&)" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 16 "subs(x=alpha,g);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,&$\"#&*!#R\"\"\"%\"IG$\"%-F!#S" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 536 "and there we have the polynomial g we're looking for. W e only knew that deg(g) < 8. And we found 3 short vectors. Had we kno wn that deg(g) < 6, then we would have only found one short vector. B ecause our degree-bound was too high, we found solutions g1,g2,g3 that were not the minimal polynomials of alpha. However, they were multipl es of the minimal polynomial. Getting the minimal polynomial itself wa s then simply a matter of taking the gcd (or, we could of course als o have redone all of the work but then using that deg(g)<6)." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 192 "Why is it that there were 3 linearly independent short vectors? Well, because there \+ are 3 linearly independent polynomials of degree < 8 that have alpha a s a solution, for example these three:" }}{PARA 0 "" 0 "" {TEXT -1 28 " g, x*g, and x^2 * g." }}{PARA 0 "" 0 "" {TEXT -1 81 "The span of the three short vectors corresponds to the span of g, x*g, x^2 *g." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" } }{PARA 0 "" 0 "" {TEXT -1 250 "Note that the three short vectors (who se span gives us the span of g, x*g, x^2*g) are much shorter than th e other vectors. This means that the determinant of the lattice was m uch bigger than it needed to be for LLL to give us these three vectors ." }}{PARA 0 "" 0 "" {TEXT -1 181 "LLL can successfully find the \"vec tors we want\" whenever the \"vectors we want\" are about 2^(n/2) time s smaller than the \"vectors we don't want\". But they're much smalle r than that:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 50 "LENGTH := p roc(w) evalf( sqrt(add(i^2,i=w))) end;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%'LENGTHGR6#%\"wG6\"F(F(-%&evalfG6#-%%sqrtG6#-%$addG6$*$)%\"iG \"\"#\"\"\"/F49$F(F(F(" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 72 "These w ere the lengths of the elements in the basis of L we constructed:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "Digits:=5;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%'DigitsG\"\"&" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "map(LENGTH,basis_L);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#7*$\"&++\"\"#O$\"&]9\"F&$\"&6J\"F&$\"&8]\"F&$\"&\">F&$\"& SD#F&$\"&4e#F&" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 88 "and these are t he lengths of the elements of the new basis, that was constructed by L LL:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "map(LENGTH, new_L); " }}{PARA 11 "" 1 "" {XPPMATH 20 "6#7*$\"&C@(!\"#$\"&V7\"!\"\"$\"&D$>F )$\"&>'=\"#5$\"&x'=F.$\"&%[CF.$\"&ac#F.$\"&-!\\F." }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 10 "%[4]/%[3];" }}{PARA 11 "" 1 "" {XPPMATH 20 " 6#$\"&Zj*\"\"'" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "evalf(2^( 8/2));" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#$\"#;\"\"!" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 236 "So the \"vectors we don't want\" are around 10 ^11 times bigger than the \"vectors we do want\". But they only need t o be about 16 times bigger in order for LLL to successfully separate \+ \"the vectors we want\" from \"the vectors we don't want\"." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 62 "So if these las t 5 vectors were about this many times smaller:" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 10 "s := %%/%;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6# >%\"sG$\"&<-'\"\"&" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 171 "then LLL w ould still have been able to compute the \"vectors we want\" for us. \+ We have 5 of these \"vectors we don't want\". So if the determinant ha d been this much smaller:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "s^5;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#$\"&w\"z\"#W" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 61 "then LLL probably still would have found \+ the vectors we want." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 " " {TEXT -1 495 "Now we had 2 equations, each contributing about 10^40 \+ to the determinant. So that's 10^80 all together. But 10^80 / s^5 wo uld have probably been OK. So that means that we've used more than twi ce the number of digits that was necessary (that's hindsight of course ). In any case, we can expect that with Digits=20, the computation wo uld still be successful, but with Digits=10 it would not be successful l. Lets set Digits=20 and see if it still works. Then set Digits=10 and see if it fails." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "Di gits:=20;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%'DigitsG\"#?" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 128 "Now go back to the beginning of t he worksheet (skip the line \"restart\" and \"Digits:=40\") and re-do everything, see if it works." }}{PARA 0 "" 0 "" {TEXT -1 245 "--> Ind eed, with Digits=20 we still find the same \"g\". But Digits=10 is p robably not going to be enough because then the \"vectors we don't wan t\" won't be long enough anymore, so LLL can't separate them from the \+ \"vectors we want\". But lets try:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "Digits:=10;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%'Dig itsG\"#5" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 57 "With this too low set ting of Digits, we find the wrong g." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 51 "A different \+ way to get the same result (using rem)" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 99 "alpha := .0027533403819 90234990115493078115778952576 + 1.145047303126922965147677457351240915 890*I;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%&alphaG^$$\"IwD&*yd6yI\\:, *\\B!*>QSLv#!#U$\"I!*e\"4C^tXxw9lH#p7.t/X6!#R" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "f1 := (x-alpha) * (x-conjugate(alpha));" }} {PARA 12 "" 1 "" {XPPMATH 20 "6#>%#f1G*&,&%\"xG\"\"\"^$$!IwD&*yd6yI\\: ,*\\B!*>QSLv#!#U$!I!*e\"4C^tXxw9lH#p7.t/X6!#RF(F(,&F'F(^$F*$\"I!*e\"4C ^tXxw9lH#p7.t/X6F/F(F(" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "D igits:=20; # we know now that 20 was enough" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%'DigitsG\"#?" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "f1 := expand(f1);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#f1G,(*$) %\"xG\"\"#\"\"\"F**&$\"5-)*p/)Rw!o1b!#AF*F(F*!\"\"^$$\"5\\])\\\"G24968 !#>$\"\"!F5F*" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "f1 := coll ect(f1, x, Re);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#f1G,(*$)%\"xG\" \"#\"\"\"F**&$\"5-)*p/)Rw!o1b!#AF*F(F*!\"\"$\"5\\])\\\"G24968!#>F*" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "g := add(c[i]*x^i,i=0..7); " }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"gG,2&%\"cG6#\"\"!\"\"\"*&&F'6# F*F*%\"xGF*F**&&F'6#\"\"#F*)F.F2F*F**&&F'6#\"\"$F*)F.F7F*F**&&F'6#\"\" %F*)F.F " 0 "" {MPLTEXT 1 0 12 "rem(g,f1,x);" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#,2&%\"cG6#\"\"!\"\"\"&F%6#\"\"#$!5\\])\\\"G24968!# >&F%6#\"\"%$\"5IuLBK?20>&F%6#\"\"$$!5@uG\\*HTM+A(!#A*&,0 &F%6#F(F(FD$!5C6i%[Pe56J\"F.F?$\"5kw:ER/7(*=F/$!5b+ztR%=!*RW\"F>F)$\"5-)*p/)Rw!o1bFIF(%\"xGF(F(" } }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 48 "and this leaves us with the foll owing equations:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "eqns := \{coeffs(%, x)\};" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#>%%eqnsG<$,0&%\" cG6#\"\"\"F*&F(6#\"\"$$!5C6i%[Pe56J\"!#>&F(6#\"\"&$\"5kw:ER/7(*= " 0 "" {MPLTEXT 1 0 15 "C := 10^Digits;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"CG\"6++++++++++\"" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 54 "and again, we want the following to be a \+ short vector:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 52 "v := [ seq (c[i],i=0..7), C * eqns[1], C * eqns[2] ];" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#>%\"vG7,&%\"cG6#\"\"!&F'6#\"\"\"&F'6#\"\"#&F'6#\"\"$&F' 6#\"\"%&F'6#\"\"&&F'6#\"\"'&F'6#\"\"(,0F*\"6++++++++++\"F0$!5C6i%[Pe56 J\"F,F6$\"5kw:ER/7(*= " 0 "" {MPLTEXT 1 0 68 "for i from 0 to 7 do\n V[i] := map(round, \+ map( coeff, v, c[i] ))\nod;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>&%\"VG 6#\"\"!7,\"\"\"F'F'F'F'F'F'F'F'\"6++++++++++\"" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>&%\"VG6#\"\"\"7,\"\"!F'F)F)F)F)F)F)\"6++++++++++\"F)" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>&%\"VG6#\"\"#7,\"\"!F)\"\"\"F)F)F)F )F)\"3)*p/)Rw!o1b!6!\\])\\\"G24968" }}{PARA 11 "" 1 "" {XPPMATH 20 "6# >&%\"VG6#\"\"$7,\"\"!F)F)\"\"\"F)F)F)F)!6S7@Y[Pe56J\"!3uG\\*HTM+A(" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#>&%\"VG6#\"\"%7,\"\"!F)F)F)\"\"\"F)F)F )!41!ztR%=!*RW\"\"6+VPLA.s]!><" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>&% \"VG6#\"\"&7,\"\"!F)F)F)F)\"\"\"F)F)\"6Smdh#R/7(*=<\"4OyNw/guK*=" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#>&%\"VG6#\"\"'7,\"\"!F)F)F)F)F)\"\"\"F )\"4OO(G)p;d)RG!65WW5=XY8QD#" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>&%\"V G6#\"\"(7,\"\"!F)F)F)F)F)F)\"\"\"!6]xcw\\E3dOD#!4R4znC!HXBP" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 20 "and lets \"LLL\" this:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "lattice( [ seq(V[i], i=0..7) ]);" } }{PARA 12 "" 1 "" {XPPMATH 20 "6#7*7,\"#]\"#(*\"#:\"#g!#!*!$A\"!#b!#&) !$+#!$<%7,\"$+#\"$)Q\"#5\"$V\"!$D$!$^%!$l\"!$b#\"%!G\"!$B$7,!$+$!$K&\" #d!$)H\"$o%\"$S'\"$!>\"$D%\"$)G!%857,\"'/_v!'**\\a!'+7J\"(S6;\"!'([j% \"'BT&)\"'x.2$!'T#R$!&m'>!&ra\"7,!'(\\g(!(2TZ\"!'Gc$*!'G[n!(&*f$=\"&HS&!(ar=\"! 'sdA\"%il\"&%=:7,\"'L[%*!''eG(\"(\"HCA\"'3J6\"'mE&)!'_1J!'\")p@!'0)G' \"&c5#\"&^Q*7,!( " 0 "" {MPLTEXT 1 0 29 "v1,v2,v3 := %[1], %[2], % [3]:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 29 "corresponding polynomials are" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 95 "g1 := add(v1[i+1]*x ^i, i=0..7); g2 := add(v2[i+1]*x^i, i=0..7); g3 := add(v3[i+1]*x^i, i= 0..7);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#g1G,2\"#]\"\"\"%\"xG\"#(* *$)F(\"\"#F'\"#:*$)F(\"\"$F'\"#g*$)F(\"\"%F'!#!**$)F(\"\"&F'!$A\"*$)F( \"\"'F'!#b*$)F(\"\"(F'!#&)" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#g2G,2 \"$+#\"\"\"%\"xG\"$)Q*$)F(\"\"#F'\"#5*$)F(\"\"$F'\"$V\"*$)F(\"\"%F'!$D $*$)F(\"\"&F'!$^%*$)F(\"\"'F'!$l\"*$)F(\"\"(F'!$b#" }}{PARA 11 "" 1 " " {XPPMATH 20 "6#>%#g3G,2!$+$\"\"\"%\"xG!$K&*$)F(\"\"#F'\"#d*$)F(\"\"$ F'!$)H*$)F(\"\"%F'\"$o%*$)F(\"\"&F'\"$S'*$)F(\"\"'F'\"$!>*$)F(\"\"(F' \"$D%" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 273 "Up to fairly high accur acy, they all have alpha as a root. So it seems likely that the \"tru e exact value of alpha, which of course is not given to us\" is a root of each of these g1,g2,g3, and if that's the case, then g1,g2,g3 have a common root and hence the gcd is not 1." }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 29 "g := gcd( gcd(g1,g2) , g3);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"gG,.!#]\"\"\"%\"xG!#(**$)F(\"\"#F'\"#N*$)F(\"\"$F' \"#P*$)F(\"\"%F'\"#b*$)F(\"\"&F'\"#&)" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "rem(g,f1,x);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"! " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 52 "that's a bit too close to 0 f or my taste, let's try:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 " Digits:=25; rem(g,f1,x);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%'Digits G\"#D" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,&$!-XX1HV7!#G\"\"\"%\"xG$!,b K_[1#!#F" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 31 "OK, that looks less s uspicious." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "subs(x=alpha, g);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,&$!$g\"!#C\"\"\"%\"IG$!%*e#!#D " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 20 "That looks good too." }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}}{MARK "64" 0 } {VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }