# checks/o_bases.py — run Sat 31 Oct 2026 18:22 PDT on Intel-mbp, Python 3.12.2
1. pairs with entries in [-4,4]: 6561; generating pairs (det = +-1): 360
   every generating pair: (1,0) and (0,1) written as integer combinations, checked exactly
   every other pair: index exactly |det| in (Z/|det|)^2, or a line (det 0) -- 6201 pairs, all as predicted
   sublattice index counts (first few): 1: 360, 2: 568, 3: 480, 4: 728, 5: 256, 6: 560, line: 545
2. for every primitive u in [-5,5]^2 and every v in [-12,12]^2 (50000 cases): det(u,v) = +-1 exactly when v = +-v0 + k u
3. 232 bases in [-3,3]^4 (116 with det +1, 116 with det -1); 7888 (B, B') checks: B' = B M with M integral, det M = +-1
4. (3,5),(1,2): det = 1; Euclid, run step by step, reaches (1,0),(0,1) in 7 Nielsen moves: u -> u v^-1, u -> u v^-1, u -> u v^-1, v -> v u^+1, v -> v u^+1, invert u, swap
   every basis with entries in [-6,6] reduces to (1,0),(0,1) the same way
   fewest moves, by breadth-first search over every pair (no bound on the entries): 4 when a move may multiply by the other's inverse, 6 when it may not. The search's first shortest walk: (3,5),(1,2) -> (2, 3),(1, 2) [u -> u v^-1] -> (1, 1),(1, 2) [u -> u v^-1] -> (1, 1),(0, 1) [v -> v u^-1] -> (1, 0),(0, 1) [u -> u v^-1]
   the page's walk, also 4 moves: (3, 5),(1, 2) -> (2, 3),(1, 2) -> (1, 1),(1, 2) -> (1, 1),(0, 1) -> (1, 0),(0, 1)
4c. in Z/5 x Z/5, 480 ordered pairs generate; Nielsen moves from (e1,e2) reach 240 of them, those with determinant +-1 mod 5, and never (2e1,e2), whose determinant is 2: a move changes the determinant only by its sign, so this group's generating pairs fall into two Nielsen classes
5. {(2,0),(3,0),(0,1)} generates ((1,0) = (3,0) - (2,0)); its pairs have determinants 0, 2, 3, so no two of them do. Index = gcd of 2x2 determinants on all 18424 triples from [-3,3]^2
   in Z itself: gcd(6,10,15) = 1, but gcd(6,10) = 2, gcd(6,15) = 3, gcd(10,15) = 5
HEADLINE o: (a,b),(c,d) generate o exactly when ad - bc = +-1 (all 6561 pairs in [-4,4]^4: 360 generate); one class up to automorphisms, a GL(2,Z)-torsor; (3,5),(1,2) -> (1,0),(0,1) in 4 Nielsen moves at fewest (7 by Euclid step by step); {(2,0),(3,0),(0,1)} generates with no generating pair inside; Z/5 x Z/5 has two Nielsen classes of generating pairs, 240 + 240
# exit status 0
