Date: Fri, 30 Jun 2006 10:29:03 -0500 (CDT)
From: Dan Grayson <dan@math.uiuc.edu>
To: Michael Stillman <mike@math.cornell.edu>
CC: dan@math.uiuc.edu
In-reply-to: <C0A55BE0-BA76-4D14-8C61-AEEE08AE1830@math.cornell.edu> (message
	from Michael Stillman on Fri, 30 Jun 2006 11:13:29 -0400)
Subject: Re: 
Reply-to: dan@math.uiuc.edu



> To: Dan Grayson <dan@math.uiuc.edu>
> From: Michael Stillman <mike@math.cornell.edu>
> Subject: 
> Date: Fri, 30 Jun 2006 11:13:29 -0400
> 
> I checked in a change that fixes rawPromote for matrices.
> 
> Should we allow lifting:
> 
> QQ --> ZZ/p  ?
> 
> This could do the rational reconstruction algorithm, (or fail, if it  
> cannot be lifted, or lift to an integer)

Sure, that sounds like fun.  I don't know the algorithm, though.  Let's see:
x=r/s mod p means sx=r mod p means sx-r+kp=0, so we take the vectors (s,r,k)
such that sx+r1+kp=0; they form a lattice of rank 2 in ZZ^3, and we pick a
vector of minimal length, perhaps using LLL, except that might be slow.  Is
that it?  Actually, we don't care how big k is, so we should pick a norm on Z^3
such as |(s,r,k)| = p^e s^2 + p^e r^2 + k^2, for some suitably large e.  Also,
we much prefer integer lifts, so we could make large s worse than large r by choosing a
norm like |(s,r,k)| = p^e s^2 + p^f r^2 + k^2 where e>f>1.

Failure is not possible, we can always lift to something.

By the way, lifting QQ --> RRR or RR can be done with continued fractions.  We
should do that, too.

-----------------------------------------------------------------------------

In-Reply-To: <200606301529.k5UFT3p25565@u00.math.uiuc.edu>
From: Michael Stillman <mike@math.cornell.edu>
Subject: Re: Re: 
Date: Fri, 30 Jun 2006 11:34:25 -0400
To: dan@math.uiuc.edu

The algorithm is simple: start the extended gcd alg  (on a and p),  
proceed until the coefficients and "gcd in progress" are small enough  
(less than sqrt(p), or 1/2 of that -- I'd have to think about it).   
In Macaulay classic, that was one way we displayed coeffs and (since  
we didn't actually have QQ implemented).

For continued fractions, when should we stop?

On Jun 30, 2006, at 11:29 AM, Dan Grayson wrote:

