Proofs: Kannan enumeration
These are the human proofs of Kannan enumeration, at full length.
Kannan's algorithm terminates and returns an HKZ-reduced basis of the same lattice full
This proof shows: correctness, termination.
Setting. The input is linearly independent rows of the lattice . We write for the Gram-Schmidt vectors, , for , and for the orthogonal projection onto , so that is a lattice of rank with basis and Gram-Schmidt norms . Line numbers refer to the pseudocode on the page; indices are here, while the implementation counts from 0. The basis is HKZ-reduced when it is size-reduced, , and
We say that the basis is HKZ from when (1) holds for . This depends only on (through ) and on the projections .
Let be a common denominator of the input entries. All operations below are integer row operations, so the rows stay in and , with , is a positive integer.
Lemma 1 (row operations). Each of the following keeps and the rows , hence keeps and the lattice :
- adding an integer multiple of an earlier row to a row at position ;
- swapping two adjacent rows at positions ;
- replacing by an integer unimodular combination of them.
Operation 1 does not change any .
Proof. All three are unimodular operations on the rows that do not touch positions below . Adding a multiple of an earlier row to keeps and the component of orthogonal to it, so no Gram-Schmidt vector changes.
Lemma 2 (line L4). The LLL step on positions terminates; it uses only operations 1 and 2 of Lemma 1.
Proof. Size reduction is operation 1 and keeps every . A swap of positions with is done only when ; the left side is the new , so decreases and the other are Gram determinants of the same sets of rows. The positive integer therefore decreases at each swap, and between two swaps the position rises at most times.
Lemma 3 (line L7 is exact). The enumeration returns a nonzero such that is a shortest nonzero vector of , together with its squared length.
Proof. By the Gram-Schmidt decomposition, with , and this is 0 only for . The search starts with the value of and fixes the coordinates from the last to the first. At each level it skips only values whose partial sum already exceeds the current best: below the start of its scan by the choice with , since then ; while rising from below ; and above once a value fails, since all further values are further from . The best value only decreases, so a skipped value stays useless. Every level scans a bounded interval, so the search ends, and it returns the minimum over all nonzero . This is the same search as in BKZ, where the proof is written out in full.
Lemma 4 (line L8). If the enumeration finds a squared length smaller than , then , and the gcd sweep replaces by a unimodular combination whose first vector is . Afterwards .
Proof. If , then would give a vector of squared length smaller by the factor , which contradicts Lemma 3. The sweep runs from the end of the block to its front and, for two adjacent rows with current coefficients not both 0, uses to replace them by and . This matrix has determinant 1 and keeps with , . At the end the coefficients are , so the new is . This is operation 3 of Lemma 1, so is unchanged and the new is a shortest nonzero vector of .
Calls. The stack starts with the single task . When a task is popped with the rest of the stack equal to , call the run from that moment until the stack is again equal to the call at . Every task pushed while it runs has index at least and lies above .
Lemma 5 (one call). For every , a call at terminates. It does not change or , and when it ends the basis is HKZ from .
Proof. By downward induction on .
Case . Line L3 discards the task. The lattice has , so the basis is HKZ from .
Case . Line L4 terminates by Lemma 2 and pushes and then , which is popped next. By induction the call at terminates, keeps , and leaves the basis HKZ from ; then is on top and is popped. From now on, every time is popped, the basis is HKZ from , which we use as an invariant.
Line L5 is operation 1 on ; it keeps all and the projection , so the basis stays HKZ from , and afterwards .
If on line L6, the swap is operation 2 and makes the new equal to . The tasks and are pushed; the call at restores the invariant and does not change , so keeps its new value. Thus each swap at this level halves at least, while always holds, because is a nonzero vector of , a lattice that does not change during the call by Lemma 1. So line L6 swaps at most times, with its value at the first check.
When line L6 does not swap, line L7 computes by Lemma 3. If it is smaller than , line L8 makes (Lemma 4) and pushes . The call at does not change , so (1) still holds at , and it makes the basis HKZ from ; then the stack is again and the call at ends, HKZ from . If instead the enumerated length equals , then (1) already holds at , the invariant gives it from on, nothing is pushed, and the call ends.
Every step of the call is one of the operations of Lemma 1 at positions , so and do not change.
Theorem. The algorithm terminates and returns an HKZ-reduced basis of . Its first row is a shortest nonzero vector of .
Proof. The whole loop of lines L2 to L8 is the call at 1, with empty, so by Lemma 5 it terminates and leaves a basis of that satisfies (1) for every . Line L9 is a sequence of operations 1 of Lemma 1; it makes for all and changes no Gram-Schmidt vector, so (1) still holds and the basis is HKZ-reduced. Since , (1) at says .