Monday, January 28, 2019

Factoring using BQF (not SQUFOF)

We start with a very brief primer to Binary Quadratic Forms (BQF). For more information ⦗1⦘ is a very good source to start with.

 A Binary Quadratic Form is a polynom of the form Q(x,y)=ax2+bxy+cy2 with integer coefficients. We focus on integer BQF, i.e., x,yZ. Often one is only interested in the behaviour of the coefficients a,b,c and in those cases one refers to a BQF simply by the triple (a,b,c). Further, the integer D defined as: D=b24ac
is called the discriminant of (a,b,c).

 A positive definite BQF (a,b,c), i.e. D<0,a>0, is reduced if a<b<a<c. Gauss observed, that all reduced BQF with the same discriminant form an abelian group and he gave a composition algorithm for those group elements. This group is called the class group and is usually denoted as Cl(D). The size of the group has a special name and is called the class number h(D). Informally spoken, the class group Cl(D) contains all different reduced quadratic forms with the same discriminant D.



 The basic idea i want to talk about is the following: Given a BQF Q1=(n,1,c), then, if Q1 is reduced and pq=n is a non trivial factorization of n, then also Q2=(p,1,qc) is a reduced BQF and is contained in the same class group as Q1. With the same argument, this holds for the element Q3=(q,1,pc). If we take into account all further different divisors of n and also the prime factorization of c, the number of BQFs that reveal the factorization of n can be increased. So, can we say something about the following ratio: Number of BQF with discriminant D that reveal the PF of nThe class number h(D)

 For simplicity, we assume that n=pq>1 with p,qP. To create a reduced quadratic form, a trivial choice would be Q=(n,1,n+1), which is obviously reduced since 1<n<n+1. The discriminant is D=14n(n+1). A very very rough estimation for the class number is h(D)D, hence in our case D=|14n(n+1)|2n. For this trivial choice of Q and under the assumption that Cl(D) is cyclic, how many elements in the class group generated by Q reveal a factorization of n? — We know that the following six BQFs (n,±1,n+1),(p,±1,(n+1)q),(q,±1,(n+1)p)
are all part of the class group and the last four reveal the factorization of n However, there are more. Let n+1=fj=1peii
The number of divisors of n+1 are σ0(n+1)=fi=1(ei+1)
the number of co-prime divisors are σcp0(n+1)=2f
If all exponents  ei are equal to 1, σ0(n+1)=σcp0(n+1). But keep in mind that the BQF must be reduced, so we can not build all combinations of the possible divisors of n and n+1. We have to ensure that a<c, i.e., pdi<qn+1di and qdi<pn+1di. An often used upper bound for the number of divisors for a number n is σ0(n+1)<nO(1/loglogn)

Theorem 1.  Let n=pq and n+1=din+1di, then either max(di,n+1di)>max(p,q) or min(di,n+1di)>min(p,q).
Proof: If A is the statement max(di,n+1di)<max(p,q) and B is the statement min(di,n+1di)<min(p,q), we proof that the statement AB leads to a contradiction hence ¬A¬B is true. So w.l.o.g. we assume din+1di and pq, so statement A says n+1di<q and B says  di<p. But this together immediately leads to din+1di<pq=n, which is a contraction, hence either ¬A¬B is true. ⬛
Theorem 2.  Let w.l.o.g., n=pq and q>p and n+1 not a square. Then the element (pdi,±1,qn+1di) is reduced for at least σ0(n+1)/2 divisors di. And the element (qdi,±1,pn+1di) is reduced whenever n+1di>q
Proof: We have q>p and that n+1 is not a square. For non square number σ0 is even and it is di<n+1di for i=1,...,σ0(n+1)/2 if the divisors are ordered such that di<di+1. Hence the element (pdi,±1.qn+1di) is reduced for at least σ0(n+1)/2 values for di. Since q>p the element (qdi,±,pn+12) is more critical. From Theorem 1 we know that either max(di,n+1di)>max(p,q) or min(di,n+1di)>min(p,q). For σ0(n+1)/2 values for i we have n+1di>di
. hence in the first case we have n+1di>q>p>di
Multiplication with di yields n+1>qdi>pdi
Since the fraction p/di is larger than 1 it is qdi<pn+1di

Compared to the actual size of the class group the elements that reveal a factorization of n are small. We have around σ0(n+1)/2 elements that reveal the factorization compared to a group size of 14n(n+1)2(n+1)
and the ratio σ0(n+1)4(n+1)<nO(1/loglogn)4(n+1)<nO(1/loglogn)1
is so small that the corresponding probability is negligible.

# Improvement #

▶ Larger values for b.  However, the choice of b=1 is actually the worst choice if one wants to keep the class group small. In order to reduce the size of the class group (always assuming that h(D)D), one has to choose b which minimizes the equation b24ac.

▶ Distribution of elements with the same coefficient bIn the following table, you find the group elements that reveal the factorization of n=2993=4173 as well have 2993 as a gcd. The group is generated by the element Q=(2993,1,2994) and has class number h=4369. The left column indicates the i value such that Qi corresponds to the a,b,c values in the row. E.g. Q715=(6,1,1493507).

iabcgcd(n,a)gcd(n,c)000129931299429931000221448052112993000314971598612993046421914091873410466438120459734107144991179581299307156114935071299307169981897912993071731298701412993117882110928141731180411218562417311817311227547341118314616137773411895246136427417318971231728544173247212317285441732474246136427417331861461613777341318873112275473413189411218562417331918211092814173365231298701412993365399818979129933654611493507129933655499117958129933903438120459734139052191409187341436614971598612993436721448052112993436829931299429931436911896104212993

The group has size 4369 elements, the table has 31 entries, whereof 16 reveal the factorization of n. However, as you can see, the elements are not randomly distributed. There are only 6 different differences between consecutive entries in the table 1,2,248,461,575,712

Is there some pattern that could be used?

⦗1⦘ Johannes Buchmann, Ulrich Vollmer: Binary Quadratic Forms, Springer, Berlin 2007, ISBN 3-540-46367-4

No comments:

Post a Comment