> # Created on February 6, 2015 > # This is a Maple (version 5.3) worksheet for > # Gábor Czédli and Ádám Kunos' paper > # GEOMETRIC CONSTRUCTIBILITY OF CYCLIC POLYGONS AND A LIMIT THEOREM > # arXiv:1307.5484v2 > # (Note that there is another, more involved, worksheet for > # arXiv:1307.5484v1, the earlier version) > restart: > # > ###################################### > # **0** General comments # > ###################################### > # > # > # Since different Maple version are not always > # compatible, we note the following: > # Comment lines begin with "#". (But in print there > # could be line breaks violating this rule.) > # Commands are separated by colon or semicolon; > # the difference is that colons supress the output. > # > # > # > ############################################## > # The polynomials in Lemma 4.2 # > ############################################## > # > fkss:=proc(k,x) local a,j; # in the paper, f_{k,m}^{s-s} > if k mod 2 = 0 then > print("Czedli and Kunos' error message: the 1st parameter must be odd"): fi: > a:=0: for j from 1 by 2 to k do > a:=a+ (-1)^((j-1)/2) * binomial(k,j)* (1-x*x)^((k-j)/2)*x^j > od: sort(expand(a)) end; fkss := proc(k, x) local a, j; if k mod 2 = 0 then print("Czedli and Kunos' error mes\ sage: the 1st parameter must be odd") fi; a := 0; for j by 2 to k do a := a + (-1)^(1/2*j - 1/2)* binomial(k, j)*(1 - x^2)^(1/2*k - 1/2*j)*x^j od; sort(expand(a)) end > # > fksc:=proc(k,x) local a,j; # in the paper, f_{k,m}^{s-c} > if k mod 2 = 1 then > print("Czedli and Kunos' error message: the 1st parameter must be even"): fi: > a:=0: for j from 0 by 2 to k do > a:=a+ (-1)^(j/2) * binomial(k,j)* (1-x*x)^((k-j)/2)*x^j > od: sort(expand(a)) end; fksc := proc(k, x) local a, j; if k mod 2 = 1 then print("Czedli and Kunos' error mes\ sage: the 1st parameter must be even") fi; a := 0; for j from 0 by 2 to k do a := a + (-1)^(1/2*j)* binomial(k, j)*(1 - x^2)^(1/2*k - 1/2*j)*x^j od; sort(expand(a)) end > # > # > Wkm11:=proc(k,m,a,b,x) sort(collect( expand(fkss(k,a*x)- fkss(m,b*x)) ,x)) end; > Wkm00:=proc(k,m,a,b,x) sort(collect( expand(fksc(k,a*x)+ fksc(m,b*x)) ,x)) end; > Wkm10:=proc(k,m,a,b,x) sort(collect(expand((fkss(k,a*x))^2 + (fksc(m,b*x))^2 -1),x)) end; > Wkm01:=proc(k,m,a,b,x) sort(collect(expand((fksc(k,a*x))^2 + (fkss(m,b*x))^2 -1),x)) end; > # > Wkm:=proc(k,m,a,b,x) > if (k mod 2 =0) and (m mod 2 =0) then Wkm00(k,m,a,b,x) else > if (k mod 2 =1) and (m mod 2 =1) then Wkm11(k,m,a,b,x) else > if (k mod 2 =1) and (m mod 2 =0) then Wkm10(k,m,a,b,x) else > if (k mod 2 =0) and (m mod 2 =1) then Wkm01(k,m,a,b,x) > fi > fi > fi > fi; end; Wkm11 := proc(k, m, a, b, x) sort(collect(expand(fkss(k, a*x) - fkss(m, b*x)), x)) end Wkm00 := proc(k, m, a, b, x) sort(collect(expand(fksc(k, a*x) + fksc(m, b*x)), x)) end Wkm10 := proc(k, m, a, b, x) sort( collect(expand(fkss(k, a*x)^2 + fksc(m, b*x)^2 - 1), x)) end Wkm01 := proc(k, m, a, b, x) sort( collect(expand(fksc(k, a*x)^2 + fkss(m, b*x)^2 - 1), x)) end Wkm := proc(k, m, a, b, x) if k mod 2 = 0 and m mod 2 = 0 then Wkm00(k, m, a, b, x) else if k mod 2 = 1 and m mod 2 = 1 then Wkm11(k, m, a, b, x) else if k mod 2 = 1 and m mod 2 = 0 then Wkm10(k, m, a, b, x) else if k mod 2 = 0 and m mod 2 = 1 then Wkm01(k, m, a, b, x) fi fi fi fi end > # > # > # > # > # > ############################################## > # Testing the polynomials in Lemma 4.2 # > # (one can modify the parameters) # > ############################################## > # Below, we test fkss in several ways: > print("k=",2);fkss(2,x); > for k from 1 by 2 to 7 do print("k=",k); > the_polynom_fkss:=fkss(k,x); > tempor1:=fkss(k,sin(alpha))- sin(k*alpha); > tempor2:=expand(tempor1); > good_if_zero:=expand(subs(cos(alpha)=sqrt(1-sin(alpha)^2), expand(tempor2))); > od; "k=", 2 "Czedli and Kunos' error message: the 1st parameter must be odd" 2 2 sqrt(-x + 1) x "k=", 1 the_polynom_fkss := x tempor1 := 0 tempor2 := 0 good_if_zero := 0 "k=", 3 3 the_polynom_fkss := -4 x + 3 x 3 tempor1 := -4 sin(alpha) + 3 sin(alpha) - sin(3 alpha) 3 2 tempor2 := -4 sin(alpha) + 4 sin(alpha) - 4 sin(alpha) cos(alpha) good_if_zero := 0 "k=", 5 5 3 the_polynom_fkss := 16 x - 20 x + 5 x tempor1 := 5 3 16 sin(alpha) - 20 sin(alpha) + 5 sin(alpha) - sin(5 alpha) 5 3 tempor2 := 16 sin(alpha) - 20 sin(alpha) + 4 sin(alpha) 4 2 - 16 sin(alpha) cos(alpha) + 12 sin(alpha) cos(alpha) good_if_zero := 0 "k=", 7 7 5 3 the_polynom_fkss := -64 x + 112 x - 56 x + 7 x 7 5 3 tempor1 := -64 sin(alpha) + 112 sin(alpha) - 56 sin(alpha) + 7 sin(alpha) - sin(7 alpha) 7 5 3 tempor2 := -64 sin(alpha) + 112 sin(alpha) - 56 sin(alpha) 6 + 8 sin(alpha) - 64 sin(alpha) cos(alpha) 4 2 + 80 sin(alpha) cos(alpha) - 24 sin(alpha) cos(alpha) good_if_zero := 0 > # > # > # Below, we test fksc in several ways: > print("k=",1);fksc(1,x); > # > for k from 2 by 2 to 4 do print("k=",k); > the_polynom_fksc:=fksc(k,x); > tempor1:=fksc(k,sin(alpha))- cos(k*alpha); > tempor2:=expand(tempor1); > good_if_zero:=expand(subs(cos(alpha)=sqrt(1-sin(alpha)^2), expand(tempor2))); > od; "k=", 1 "Czedli and Kunos' error message: the 1st parameter must be even\ " 2 sqrt(-x + 1) "k=", 2 2 the_polynom_fksc := -2 x + 1 2 tempor1 := -2 sin(alpha) + 1 - cos(2 alpha) 2 2 tempor2 := -2 sin(alpha) + 2 - 2 cos(alpha) good_if_zero := 0 "k=", 4 4 2 the_polynom_fksc := 8 x - 8 x + 1 4 2 tempor1 := 8 sin(alpha) - 8 sin(alpha) + 1 - cos(4 alpha) tempor2 := 4 2 4 2 8 sin(alpha) - 8 sin(alpha) - 8 cos(alpha) + 8 cos(alpha) good_if_zero := 0 > # > # > # Now we test the polynomial Wkm(k,m, a,b, x) in the > # following way. We select k, m,r=1,alpha and beta such > # that k*alpha+m+beta=Pi. We compute a, b, and u:=1/(2r). > # Then, using real (floating point) arithmetic, we > # test if u is a root of Wkm(k,m,a,b,x). To make this > # comfortable, we build a procedure for this. This allows > # us to change the test parameters. > Wkmtest:= proc(k,m,alpha) local a,b, beta, r, u, testpoly; > r:=1;u:=1/(2*r); beta:=(Pi-k*alpha)/m; > a:=2*r*sin(alpha); b:=2*r*sin(beta); > testpoly:=evalf(Wkm(k,m,a,b, x) ); evalf(subs(x=u,testpoly) ); > end; Wkmtest := proc(k, m, alpha) local a, b, beta, r, u, testpoly; r := 1; u := 1/2*1/r; beta := (Pi - k*alpha)/m; a := 2*r*sin(alpha); b := 2*r*sin(beta); testpoly := evalf(Wkm(k, m, a, b, x)); evalf(subs(x = u, testpoly)) end > Wkmtest(1,1,Pi/4); > Wkmtest(1,2,Pi/5); > Wkmtest(1,3,Pi/6); > Wkmtest(1,4,Pi/7); > Wkmtest(1,4,Pi/9); > Wkmtest(4,1,Pi/12); > Wkmtest(2,2,Pi/8); > Wkmtest(2,2,Pi/10); > Wkmtest(2,3,Pi/14); > Wkmtest(3,2,Pi/11); > Wkmtest(4,2,Pi/15); > Wkmtest(5,2,Pi/18); > Wkmtest(3,3,Pi/10); > Wkmtest(3,4,Pi/13); > Wkmtest(3,5,Pi/13); > Wkmtest(3,6,Pi/15); > Wkmtest(4,4,Pi/12); > Wkmtest(4,5,Pi/10); > Wkmtest(5,4,Pi/12); > Wkmtest(5,7,Pi/13); > Wkmtest(4,6,Pi/13); > Wkmtest(8,6,Pi/13); 0 -8 -.2 10 0 -7 .10 10 -8 .1 10 -8 -.81 10 0 0 -8 -.4 10 0 -8 -.1 10 0 -8 -.1 10 -8 -.3 10 -8 -.2 10 -8 -.1 10 -8 -.1 10 -8 .1 10 -7 -.64 10 -9 -.1 10 0 -8 -.1 10 > ############################################## > # Using the polynomials above to verify # > # the computations in the paper # > ############################################## > > poly1a:=Wkm(1,4,1,2,x); poly1b:=expand(poly1a/(x^2)); irreduc(poly1b); 8 6 4 2 poly1a := 16384 x - 8192 x + 1280 x - 63 x 6 4 2 poly1b := 16384 x - 8192 x + 1280 x - 63 true > poly2a:=Wkm(1,5,a,b,x); poly2b:=sort(expand(poly2a/x),x); 5 5 3 3 poly2a := -16 x b + 20 x b + (a - 5 b) x 5 4 3 2 poly2b := -16 b x + 20 b x + a - 5 b > poly3:=Wkm(2,4,a,b,x); 4 4 2 2 2 poly3 := 8 x b + (-2 a - 8 b ) x + 2 > poly3a:=Wkm(3,3,a,b,x); poly3b:=sort(collect(expand(poly3a/x),x),x); 3 3 3 poly3a := (-4 a + 4 b ) x + (3 a - 3 b) x 3 3 2 poly3b := (-4 a + 4 b ) x + 3 a - 3 b > ############################################## > # Further computations in the paper # > ############################################## > # > cosform3:=proc(a6,b6,c6) 2*a6*c6*b6+a6^2+c6^2+b6^2-1 end; > # Purpose: if a6=cos(alpha),b6=cos(beta9, c6=cos(gamma), > # and alpha+beta+gamma=pi, then cosform3 gives 0. > # > # > # To test cosform3, uncomment this (possibly, with other parameters): > # for j from 5 by 0.2 to 5.6 do print(cosform3_test_angle1=j): for k from 10 by 0.3 to 10.6 do > # print(angle2=k, should_be_zero= evalf(cosform3(cos(j),cos(k),cos(Pi-j-k)))): od:od: > cosform3 := proc(a6, b6, c6) 2*a6*c6*b6 + a6^2 + c6^2 + b6^2 - 1 end > > coskx:=proc(k,x) sum('(-1)^j * binomial(k,2*j) * x^(k-2*j) * (1-x*x)^j', 'j'=0..floor(k/2)) end; > # Purpose: for x=cos(alpha), we get > # coskx(k,x) = cos(k*alpha). > # If you want to test the function coskx, uncomment the following command, possibly with other parameters. > # for i from 1 to 5 by 1 do x1:=cos(alpha): print(expand(coskx(i,x))), print(i,th_coskxTest = # expand(coskx(i,x1) - cos(i*alpha))); od: > coskx := proc(k, x) sum('(-1)^j*binomial(k, 2*j)*x^(k - 2*j)*(1 - x^2)^j', 'j' = 0 .. floor(1/2*k)) end > > # > # Computation for n=6 in Theorem 1.2 : > # > aa4:=1000; bb1:=999; cc1:=1001; > f1:=sort(collect(cosform3(coskx(4,aa4*u), bb1*u, cc1*u),u),u); > f2:=simplify(f1/(4000000*u^2)); > f3:= subs(u=sqrt(x),f2); > irreduc(f3); > aa4 := 1000 bb1 := 999 cc1 := 1001 8 6 f1 := 64000000000000000000000000 u - 112000016000000000000 u 4 2 + 64000016000000 u - 12000000 u 6 4 2 f2 := 16000000000000000000 u - 28000004000000 u + 16000004 u - 3 3 2 f3 := 16000000000000000000 x - 28000004000000 x + 16000004 x - 3 true > # > # > # Computation for 6 in NCL(3) in Theorem 1.1 : > # > aa1:=1; aa2:=2; aa3:=3; > htempor0:=cosform3(1-2*aa1*aa1*u, 1-2*aa2*aa2*u, 1-2*aa3*aa3*u ); > htempor1:=sort(expand(subs(u=x,htempor0/(-4)))); > htempor2:=sort(expand(subs(x=y/2,htempor1))); > irreduc(htempor1); irreduc(htempor2); aa1 := 1 aa2 := 2 aa3 := 3 2 htempor0 := 2 (1 - 2 u) (1 - 18 u) (1 - 8 u) + (1 - 2 u) 2 2 + (1 - 18 u) + (1 - 8 u) - 1 3 2 htempor1 := 144 x - 196 x + 28 x - 1 3 2 htempor2 := 18 y - 49 y + 14 y - 1 true true > ############################################### > # The triangle is not constructible from the > # three distances; see Proposition 1.3 > ############################################## > # > f1:=sort(subs(u=x,cosform3(1*u,2*u,3*u))); > f2:=subs(x=y/2,2*f1); > irreduc(f1); irreduc(f2); 3 2 f1 := 12 x + 14 x - 1 3 2 f2 := 3 y + 7 y - 2 true true > # > # > # > ############################################### > # The qadrangle D_4 is constructible from the > # four distances; see Proposition 1.3 > ############################################## > # > # Preliminary calculations: > f1:=sort(expand(cos(alpha+beta)+cos(gamma+delta))); > > # This is 0, and so are f2,f3, ... > auxiliary:=-sin(alpha)*sin(beta)-sin(gamma)*sin(delta); > > f2:=sort(expand((f1-auxiliary)^2 -auxiliary^2)); > auxiliary:=-2*sin(gamma)*sin(alpha)*sin(beta)*sin(delta); > f3:=sort(expand((f2-auxiliary )^2-auxiliary^2)); > > f4:=expand(subs(sin(alpha)=sqrt(1-cos(alpha)^2),sin(beta)=sqrt(1-cos(beta)^2),sin(gamma)=sqrt(1-cos(gamma)^2),sin(delta)=sqrt(1-cos(delta)^2), f3)) ; > > f5:=sort(subs(cos(alpha)=x,cos(beta)=y,cos(gamma)=z,cos(delta)=t ,f4)); > # Now, we simply copy the expression f5 here: > cosform4:=proc(x,y,z,t) 4*x^3*t*y*z+4*x^2*t^2*y^2+4*x^2*t^2*z^2+4*x^2*y^2*z^2+4*x*t^3*y*z+4*x*t*y^3*z+4*x*t*y*z^3+4*t^2*y^2*z^2+x^4-2*x^2*t^2-2*x^2*y^2-2*x^2*z^2-8*x*t*y*z+t^4-2*t^2*y^2-2*t^2*z^2+y^4-2*y^2*z^2+z^4 end; > # Next, to check that this is the same as given > # in the paper, we type that formula here: > cosform4_paper:=proc(x1,x2,x3,x4) (x1^4+x2^4+x3^4+x4^4) > - 2*(x1^2*x2^2 + x1^2*x3^2 + x1^2*x4^2 + x2^2*x3^2 + x2^2*x4^2 + x3^2*x4^2) > + 4*x1*x2*x3*x4* (-2 + (x1^2+x2^2+x3^2+x4^2) ) > + 4* (x1^2*x2^2*x3^2 + x1^2*x2^2*x4^2 + x1^2*x3^2*x4^2 + x2^2*x3^2*x4^2 ) end; > # And now we can check the formula: > expand( cosform4(x,y,z,t)- cosform4_paper(x,y,z,t)); > # We check that c_2x^2 + c_0 mentioned > # in the paper is not the zero polynomial: > a1:=sort(collect(expand(cosform4_paper(d1*u,d2*u,d3*u,d4*u)/(u^4)),u),u); > a2:=op(1,a1)/u^2; > c2:=sort(factor(a2)); f1 := cos(beta) cos(alpha) - sin(beta) sin(alpha) - sin(gamma) sin(delta) + cos(gamma) cos(delta) auxiliary := -sin(beta) sin(alpha) - sin(gamma) sin(delta) 2 2 2 2 f2 := cos(beta) cos(alpha) - sin(beta) sin(alpha) - 2 sin(gamma) sin(delta) sin(beta) sin(alpha) + 2 cos(gamma) cos(beta) cos(delta) cos(alpha) 2 2 2 2 - sin(gamma) sin(delta) + cos(gamma) cos(delta) auxiliary := -2 sin(gamma) sin(delta) sin(beta) sin(alpha) 4 4 f3 := cos(beta) cos(alpha) 2 2 2 2 - 2 cos(beta) sin(beta) sin(alpha) cos(alpha) 4 4 + sin(beta) sin(alpha) 3 3 + 4 cos(gamma) cos(beta) cos(delta) cos(alpha) - 4 2 2 cos(gamma) cos(beta) sin(beta) cos(delta) sin(alpha) 2 2 2 2 cos(alpha) - 2 sin(gamma) sin(delta) cos(beta) cos(alpha) 2 2 2 2 - 2 sin(gamma) sin(delta) sin(beta) sin(alpha) 2 2 2 2 + 6 cos(gamma) cos(beta) cos(delta) cos(alpha) 2 2 2 2 - 2 cos(gamma) sin(beta) cos(delta) sin(alpha) - 4 2 2 cos(gamma) sin(gamma) sin(delta) cos(beta) cos(delta) 3 3 cos(alpha) + 4 cos(gamma) cos(beta) cos(delta) cos(alpha) 4 4 + sin(gamma) sin(delta) 2 2 2 2 - 2 sin(gamma) cos(gamma) sin(delta) cos(delta) 4 4 + cos(gamma) cos(delta) 4 2 2 2 f4 := cos(alpha) + 4 cos(gamma) cos(delta) cos(alpha) 2 2 2 + 4 cos(gamma) cos(delta) cos(beta) 2 2 2 4 + 4 cos(beta) cos(alpha) cos(gamma) + cos(gamma) 4 2 2 + cos(delta) - 2 cos(gamma) cos(alpha) 3 + 4 cos(gamma) cos(beta) cos(delta) cos(alpha) 3 + 4 cos(gamma) cos(beta) cos(delta) cos(alpha) 2 2 2 2 - 2 cos(delta) cos(beta) - 2 cos(gamma) cos(beta) 3 + 4 cos(gamma) cos(beta) cos(delta) cos(alpha) 3 + 4 cos(gamma) cos(beta) cos(delta) cos(alpha) 2 2 4 - 2 cos(delta) cos(alpha) + cos(beta) - 8 cos(gamma) cos(beta) cos(delta) cos(alpha) 2 2 2 2 - 2 cos(beta) cos(alpha) - 2 cos(gamma) cos(delta) 2 2 2 + 4 cos(beta) cos(alpha) cos(delta) 3 2 2 2 2 2 2 2 2 2 f5 := 4 x t y z + 4 x t y + 4 x t z + 4 x y z 3 3 3 2 2 2 4 + 4 x t y z + 4 x t y z + 4 x t y z + 4 t y z + x 2 2 2 2 2 2 4 2 2 - 2 x t - 2 x y - 2 x z - 8 x t y z + t - 2 t y 2 2 4 2 2 4 - 2 t z + y - 2 y z + z cosform4 := proc(x, y, z, t) 4*x^3*t*y*z + 4*x^2*t^2*y^2 + 4*x^2*t^2*z^2 + 4*x^2*y^2*z^2 + 4*x*t^3*y*z + 4*x*t*y^3*z + 4*x*t*y*z^3 + 4*t^2*y^2*z^2 + x^4 - 2*x^2*t^2 - 2*x^2*y^2 - 2*x^2*z^2 - 8*x*t*y*z + t^4 - 2*t^2*y^2 - 2*t^2*z^2 + y^4 - 2*y^2*z^2 + z^4 end cosform4_paper := proc(x1, x2, x3, x4) x1^4 + x2^4 + x3^4 + x4^4 - 2*x1^2*x2^2 - 2*x1^2*x3^2 - 2*x1^2*x4^2 - 2*x2^2*x3^2 - 2*x4^2*x2^2 - 2*x4^2*x3^2 + 4*x1*x2*x3*x4*(-2 + x1^2 + x2^2 + x3^2 + x4^2) + 4*x1^2*x2^2*x3^2 + 4*x1^2*x4^2*x2^2 + 4*x1^2*x4^2*x3^2 + 4*x4^2*x2^2*x3^2 end 0 3 3 3 a1 := (4 d1 d2 d3 d4 + 4 d1 d2 d3 d4 + 4 d1 d2 d3 d4 3 2 2 2 2 2 2 + 4 d1 d2 d3 d4 + 4 d1 d2 d3 + 4 d1 d4 d2 2 2 2 2 2 2 2 4 4 4 4 + 4 d1 d4 d3 + 4 d4 d2 d3 ) u + d1 + d2 + d3 + d4 2 2 2 2 2 2 2 2 2 2 - 2 d1 d2 - 2 d1 d3 - 2 d1 d4 - 2 d2 d3 - 2 d4 d2 2 2 - 2 d4 d3 - 8 d1 d2 d3 d4 3 3 3 a2 := 4 d1 d2 d3 d4 + 4 d1 d2 d3 d4 + 4 d1 d2 d3 d4 3 2 2 2 2 2 2 + 4 d1 d2 d3 d4 + 4 d1 d2 d3 + 4 d1 d4 d2 2 2 2 2 2 2 + 4 d1 d4 d3 + 4 d4 d2 d3 c2 := 4 (d2 d3 + d4 d1) (d2 d1 + d3 d4) (d2 d4 + d3 d1) > # > # > # > ############################################## > # P_5 is not constructible from the distances; > # see Proposition 1.3 > ############################################## > a:=499; b:=500; c:=501; > f1:=cosform3(2*(a*u)^2-1, 2*(b*u)^2-1, 3*u ); > f2:=sort(expand(subs(u=x,f1))); > irreduc(f2); > a := 499 b := 500 c := 501 2 2 2 2 2 f1 := 6 (498002 u - 1) u (500000 u - 1) + (498002 u - 1) + 9 u 2 2 + (500000 u - 1) - 1 5 4 3 2 f2 := 1494006000000 x + 498005992004 x - 5988012 x - 1995995 x + 6 x + 1 true > # End of worksheet