diff 3e7a496..5ececa3 circulant_hadamard_v2.txt
diff --git a/circulant_hadamard_v2.txt b/circulant_hadamard_v2.txt
index e69de29..d26cea1 100644
--- a/circulant_hadamard_v2.txt
+++ b/circulant_hadamard_v2.txt
@@ -0,0 +1,950 @@
+====================================================================
+THE CIRCULANT HADAMARD CONJECTURE
+A complete proof, written for curious readers
+====================================================================
+
+--------------------------------------------------------------------
+PART 0. WHAT THIS IS
+--------------------------------------------------------------------
+
+In 1963 Herbert Ryser guessed that a certain kind of square matrix,
+made entirely of plus and minus signs, can only exist in two sizes:
+1 x 1 and 4 x 4. For sixty years nobody could prove it. This document
+is a proof, written from scratch so that a high-school student who
+knows what a matrix and a complex number are can follow it.
+
+The proof has two halves.
+
+ Half one (old, Turyn 1965). If the size is bigger than 4, it must
+ have the special form 4 u^2 where u is odd and larger than 1.
+
+ Half two (new). If u is odd and larger than 1, no such matrix can
+ exist. This is the heart of the argument.
+
+ Then Barker sequences, which are the reason people care, follow
+ as a corollary.
+
+We will need only four tools:
+ (i) the ring of polynomials mod X^n - 1,
+ (ii) complex numbers on the unit circle,
+ (iii) the fact that integers reduce mod 2,
+ (iv) the arithmetic of roots of unity.
+
+Everything else is built out of these.
+
+--------------------------------------------------------------------
+PART 1. THE PROBLEM
+--------------------------------------------------------------------
+
+1.1 Hadamard matrices.
+
+An n x n matrix H with every entry +1 or -1 is called a Hadamard
+matrix if any two different rows are perpendicular: their dot product
+is zero. A row's dot product with itself is the sum of n copies of
++1, which is n. So the perpendicularity condition is the same as
+
+ H H^T = n I
+
+where H^T is the transpose and I is the identity matrix.
+
+Example (size 1). H = [1]. Then H H^T = [1] = 1 * I. Works.
+
+Example (size 2). H = [ 1 1 ; 1 -1 ]. Rows (1,1) and (1,-1) have dot
+product 0. And H H^T = [ 2 0 ; 0 2 ] = 2 I. Works.
+
+Example (size 4). There is one in 1.2.
+
+1.2 Circulant matrices.
+
+Call H circulant if every row is a cyclic shift of the row above it.
+Such a matrix is completely described by its first row
+h = (h_0, h_1, ..., h_{n-1}) of signs: the entry in row i, column j
+is h_{(j - i) mod n}.
+
+Example (size 4). First row (1, 1, 1, -1). The whole matrix is
+
+ [ 1 1 1 -1 ]
+ [ -1 1 1 1 ]
+ [ 1 -1 1 1 ]
+ [ 1 1 -1 1 ]
+
+Every row is the previous one shifted right by one, with wrap-around.
+You can check by hand that any two rows are perpendicular:
+row 0 . row 1 = (1)(-1) + (1)(1) + (1)(1) + (-1)(1) = 0,
+and the rest follow by the same rotation.
+
+Define the periodic autocorrelations of h by
+
+ P_h(t) = sum_{j=0}^{n-1} h_j h_{(j+t) mod n}, 0 <= t < n.
+
+P_h(0) is always n. For a circulant matrix, the (0, t) entry of H H^T
+is exactly P_h(t). So:
+
+ H is Hadamard <=> P_h(0) = n and P_h(t) = 0 for 1 <= t < n.
+
+1.3 The conjecture.
+
+Which n admit a real circulant Hadamard matrix?
+Answer, proved here: only n = 1 and n = 4.
+
+The order-4 example is (1, 1, 1, -1). The order-1 example is (1).
+No other size is possible.
+
+This is the circulant Hadamard conjecture, first written down by
+Ryser in 1963.
+
+1.4 Why people care: Barker sequences.
+
+A sign sequence a = (a_0, ..., a_{n-1}) with each a_j in {+1, -1} is
+called a Barker sequence of length n if its aperiodic
+autocorrelations
+
+ C_a(t) = sum_{j=0}^{n-t-1} a_j a_{j+t}, 1 <= t < n,
+
+all have absolute value at most 1. These are the sharpest possible
+radar pings: they reduce the "sidelobes" to almost nothing, which
+matters in radar and in cell-phone synchronization.
+
+Known Barker sequences exist only at lengths
+ 1, 2, 3, 4, 5, 7, 11, 13.
+It has long been conjectured that no longer ones exist.
+
+Here is the connection. Any even-length Barker sequence with n > 2
+can be turned into a circulant Hadamard matrix of the same order:
+take the sequence as the first row of a circulant matrix; the Barker
+bound forces every nontrivial periodic autocorrelation to vanish.
+So the circulant Hadamard theorem kills all even n above 4, and a
+classical result of Turyn and Storer (1961, sharpened by Schmidt and
+Willms in 2016) kills all odd n above 13. Together they prove the
+Barker-sequence conjecture.
+
+1.5 History in one paragraph. Ryser proposed the problem in 1963.
+Turyn in 1965 proved the order restriction and many partial results.
+Through the 1990s and 2000s Bernhard Schmidt and collaborators
+developed the field-descent method and its refinements. A 2017
+computation of Logan and Mossinghoff reduced the candidate list to
+4489 integers below 4 * 10^30. The present proof combines Turyn's
+descent with a residue-field argument at the prime two.
+
+--------------------------------------------------------------------
+PART 2. THE SIGN ROW AS AN ALGEBRAIC OBJECT
+--------------------------------------------------------------------
+
+2.1 The ring Z[C_n].
+
+Let C_n be the cyclic group of order n with a chosen generator X, so
+X^n = 1. Its group ring Z[C_n] consists of all formal sums
+
+ f = f_0 + f_1 X + ... + f_{n-1} X^{n-1}, each f_j in Z.
+
+Addition is componentwise. Multiplication is polynomial multiplication
+followed by the rule X^n = 1, so the exponents wrap around modulo n.
+The first row h of a circulant Hadamard matrix is exactly such an
+element, with every coefficient equal to +1 or -1.
+
+2.2 The star (reversal) operation.
+
+On Z[C_n] define
+
+ f* = f_0 + f_1 X^{-1} + ... + f_{n-1} X^{-(n-1)}.
+
+Same coefficients, exponents negated. It is not complex conjugation,
+because the coefficients are integers (i.e. real). Note (f g)* = f* g*
+and (f*)* = f.
+
+Lemma 2.1. The coefficient of X^a in h h* equals P_h(a).
+
+Proof. Write h h* = sum_{i,j} h_i h_j X^{i-j}. The coefficient of X^a
+collects every pair with i - j = a mod n. For each such pair,
+h_i h_j = h_{j+a} h_j. Summing over j gives exactly P_h(a). []
+
+Corollary 2.2. A sign vector h is the first row of a circulant
+Hadamard matrix of order n if and only if
+
+ h h* = n (as an element of Z[C_n]).
+
+Proof. The coefficient of X^0 is P_h(0) = n. For a not equal to 0,
+the coefficient is P_h(a), which must be 0. []
+
+2.3 Two immediate consequences.
+
+(a) n is a perfect square.
+Evaluate h h* = n at X = 1 (send every X^k to 1). Both star and
+product become ordinary multiplication, so
+
+ (h(1))^2 = n, where h(1) = sum_j h_j is an integer.
+
+Hence n is a perfect square, and the row sum is +- sqrt(n).
+
+(b) n is even.
+If n > 1, multiply the columns of a Hadamard matrix by signs to make
+the first row all +1. Every other row is perpendicular to it, so it
+has exactly n/2 plus ones and n/2 minus ones. Hence n is even.
+
+Combining (a) and (b): n = 4 w^2 for some integer w >= 1. Write
+w = 2^a u with u odd. Then
+
+ n = 4 * (2^a u)^2 = 2^{2s} u^2, s = a + 1 >= 1.
+
+Part 4 proves s = 1, i.e. a = 0 and w = u is odd, so n = 4 u^2 with
+u odd.
+
+--------------------------------------------------------------------
+PART 3. THE LOCAL TOOL: ROOTS OF UNITY AND THE PRIME p
+--------------------------------------------------------------------
+
+The proof uses one precise fact about how a prime number behaves
+inside rings built from roots of unity. If you have not seen this
+before, do not be scared: the statement is concrete even though the
+proof is fiddly.
+
+3.1 Localizing at p.
+
+Let p be a prime and let A_0 = Z[eta] be the ring of integer
+combinations of a root of unity eta. To "localize at p" means: allow
+division by any integer not divisible by p. The resulting ring A is
+a domain whose only maximal ideal is p A. Equivalently, every nonzero
+element of A is a unit times a power of p. This gives a well-defined
+"p-adic valuation"
+
+ v(a) = the exponent of p in a, v(unit) = 0.
+
+(If "maximal ideal" is unfamiliar, read it as "the set of things
+divisible by p". The one fact we need is that A/pA is a field.)
+
+3.2 Adjoining a p-power root of unity.
+
+Now let xi be a primitive p^k-th root of unity (so xi^{p^k} = 1 and
+no smaller power works). Put
+
+ D = (p - 1) p^{k-1}.
+
+Then A[xi] is free over A on the D elements 1, xi, ..., xi^{D-1}. It
+is again a local ring; its unique maximal ideal is generated by
+(xi - 1). The prime p equals a unit times (xi - 1)^D. So the
+valuation v on the fraction field satisfies
+
+ v(p) = 1, v(xi - 1) = 1/D.
+
+The ring A[xi] is exactly { v >= 0 }, and p^l A[xi] = { v >= l }.
+
+3.3 The coefficient criterion.
+
+Every element z of A[xi] has a unique expansion
+
+ z = r_0 + r_1 xi + ... + r_{D-1} xi^{D-1}, each r_j in A,
+
+because of the free basis above.
+
+Lemma 3.1. With the notation of 3.2, for any integer l >= 0 and any
+polynomial R(X) = r_0 + r_1 X + ... + r_{D-1} X^{D-1} with coefficients
+in A, the following are equivalent:
+
+ (i) v(R(xi)) >= l,
+ (ii) R(xi) belongs to p^l A[xi],
+ (iii) every coefficient r_j belongs to p^l A.
+
+In words: to make R(xi) divisible by p^l, each coefficient must
+already be divisible by p^l. Nothing cancels, because the powers of
+xi form a basis.
+
+Why the statement is true. Evaluate R at xi. Since 1, xi, ..., xi^{D-1}
+is an A-basis of A[xi], the element R(xi) is p^l-divisible exactly
+when each of its basis coefficients r_j is. That is the equivalence
+of (ii) and (iii). The equivalence of (i) and (ii) is the description
+of the valuation in 3.2. []
+
+(A full proof has to build A[xi] carefully and show that the
+cyclotomic polynomial of xi is Eisenstein at p, which is what makes
+xi - 1 a uniformizing element. We do not need that bookkeeping; the
+criterion above is the only consequence we use.)
+
+--------------------------------------------------------------------
+PART 4. STEP ONE: THE ORDER IS 4 u^2 WITH u ODD
+--------------------------------------------------------------------
+
+By 2.3 we have n = 2^{2s} u^2 with s >= 1 and u odd. This part
+proves s = 1. The idea: if the prime 2 appears more than twice, a
+congruence mod 8 blows up.
+
+4.1 Project to the 2-part.
+
+Since C_n = C_{2^{2s}} x C_{u^2}, we may project h to the first
+factor by a group-ring map sending X to X. The image T is an element
+
+ T = sum_j t_j X^j, t_j in Z, 0 <= j < 2^{2s},
+
+where each t_j is a sum of u^2 signs (one per element of the u^2
+part collapsed to 1). Because u^2 is odd, every t_j is odd. Applying
+the projection to h h* = 2^{2s} u^2 gives
+
+ T T* = 2^{2s} u^2 in Z[C_{2^{2s}}], all coefficients odd.
+
+4.2 The halving step.
+
+Suppose T in Z[C_{2^k}] satisfies
+
+ T T* = 2^{2t} u^2, k >= 1, t >= 2, all coefficients odd.
+
+We will produce T' in Z[C_{2^{k-1}}] with
+
+ T' T'* = 2^{2(t-1)} u^2, all coefficients odd.
+
+Let A = Z localized at 2, i.e. the fractions a/b with b odd. Its only
+maximal ideal is 2 A. Let xi be a primitive 2^k-th root of unity.
+
+Step 1: valuation of T(xi). Conjugation on Z[C_{2^k}] sends X to
+X^{-1}, hence xi to xi^{-1}. But
+
+ xi^{-1} - 1 = -xi^{-1} (xi - 1),
+
+a unit multiple of xi - 1, so conjugation does not change v. Evaluate
+T T* = 2^{2t} u^2 at X = xi:
+
+ T(xi) * conj(T(xi)) = 2^{2t} u^2.
+
+Taking v (and using v(2) = 1, v(u^2) = 0) gives
+2 v(T(xi)) = 2t, so v(T(xi)) = t. By Lemma 3.1, T(xi) is in
+2^t A[xi], i.e. T(xi) is divisible by 2^t.
+
+Step 2: coefficients. Divide T by the cyclotomic polynomial of xi.
+For k >= 2 this polynomial is
+
+ phi_{2^k}(X) = X^{2^{k-1}} + 1;
+
+for k = 1 it is phi_2(X) = X + 1. The remainder R has degree < D =
+2^{k-1} (this is D from 3.2 with p = 2) and satisfies R(xi) = T(xi).
+By Lemma 3.1 with l = t, every coefficient of R is in 2^t Z. But
+those coefficients are (for k >= 2)
+
+ t_j - t_{j + 2^{k-1}}, 0 <= j < 2^{k-1}.
+
+(For k = 1 it is just t_0 - t_1.) Since t >= 2, each such difference
+is divisible by 2^t, in particular by 4.
+
+Step 3: averaging. Project C_{2^k} to C_{2^{k-1}} by X -> X. Then
+X^{2^{k-1}} goes to 1, so T projects to a shorter group-ring element
+with every coefficient becoming t_j + t_{j + 2^{k-1}}. Divide by 2:
+
+ T' = (1/2) * (projection of T).
+
+Is each coefficient (t_j + t_{j + 2^{k-1}})/2 odd? Both t_j and
+t_{j + 2^{k-1}} are odd. Their difference is divisible by 4, so they
+are congruent mod 4: either both are 1 mod 4 or both are 3 mod 4. In
+either case their sum is 2 mod 4, and halving gives an odd integer.
+So T' has all coefficients odd.
+
+Step 4: norm. Projection is a ring homomorphism and products commute
+with it, so
+
+ image(T T*) = image(T) image(T)* = 2^{2t} u^2.
+
+But image(T) = 2 T', hence
+
+ 4 T' T'* = 2^{2t} u^2, that is, T' T'* = 2^{2(t-1)} u^2.
+
+This is exactly the halving step.
+
+4.3 Iterate and hit mod 8.
+
+Start with k = 2s, t = s. Apply the halving step s - 1 times. This is
+allowed because t stays >= 2 throughout: it starts at s >= 2 and
+decreases by one each step until it reaches 1. After s - 1 steps we
+have
+
+ T_final in Z[C_{2^{s+1}}], T_final T_final* = 4 u^2,
+
+and all 2^{s+1} coefficients of T_final are odd.
+
+Now look at the coefficient of X^0 in T_final T_final*. If
+T_final = sum_j t_j X^j with 0 <= j < 2^{s+1}, then
+
+ T_final T_final* = sum_{j,k} t_j t_k X^{j-k}.
+
+The coefficient of X^0 collects pairs with j - k congruent to 0 mod
+2^{s+1}. Since both j and k lie in [0, 2^{s+1}), that forces j = k.
+So
+
+ (coefficient of X^0) = sum_j t_j^2.
+
+Each t_j is odd, so t_j^2 is congruent to 1 mod 8. There are 2^{s+1}
+terms, hence
+
+ sum_j t_j^2 is congruent to 2^{s+1} mod 8.
+
+If s >= 2, then 2^{s+1} is divisible by 8, so the sum is 0 mod 8.
+
+On the other hand, the coefficient of X^0 must equal the constant
+4 u^2. Since u is odd, u^2 is congruent to 1 mod 8, so 4 u^2 is
+congruent to 4 mod 8. Contradiction.
+
+Hence s = 1, and combined with 2.3:
+
+ a real circulant Hadamard matrix of order n > 1 has
+ n = 4 u^2 with u odd.
+
+This order restriction is classical, due to Turyn (1965).
+
+--------------------------------------------------------------------
+PART 5. THE ROOT-OF-UNITY TRAP
+--------------------------------------------------------------------
+
+For the rest of the proof fix u > 1 and put P = C_{u^2}. Let I be
+the (nonempty) set of prime divisors of u.
+
+The strategy in one sentence: build from any solution x of x x* = u^2
+a certain product Delta(x) of complex numbers that is forced to be a
+root of unity of odd order, and later show a specific choice of three
+such x's makes Delta collide with itself modulo 2.
+
+5.1 Characters of P.
+
+Decompose P as a product of cyclic groups, one for each prime power
+dividing u^2. For each p in I, choose a generator X_p of the p-part
+of P and a primitive p-th root of unity rho_p. These choices stay
+fixed.
+
+For a subset S of I, define the character chi_S: P -> C by
+
+ chi_S(X_p) = rho_p if p is in S,
+ chi_S(X_p) = 1 otherwise,
+
+extended multiplicatively over the whole group. There are 2^{|I|}
+characters in all, one per subset.
+
+If x = sum_{z in P} x_z z is an element of Z[i][P], define its
+S-evaluation by
+
+ x_S = sum_{z in P} x_z chi_S(z),
+
+which is an element of the ring
+
+ B = Z[i, rho_p (p in I)].
+
+5.2 The key observation.
+
+Suppose x in Z[i][P] satisfies x x* = u^2. Then for every S,
+
+ x_S * conj(x_S) = u^2.
+
+Why? Evaluate both sides of x x* = u^2 at the character chi_S. The
+involution * sends x_z to conj(x_z) and z to z^{-1}, so the evaluation
+of x* at chi_S is exactly conj(x_S). The scalar u^2 is unaffected by
+evaluation. That gives the identity.
+
+Consequences, used repeatedly below:
+ - x_S is never 0, because its squared absolute value is u^2 > 0.
+ - In every complex embedding of B, |x_S| = u.
+ - x_S is a unit of B at every prime not dividing u^2.
+
+5.3 The alternating product.
+
+Define
+
+ Delta(x) = product over S of x_S^{eps_S}, eps_S = (-1)^{|S|}.
+
+This is a product in the fraction field of B: exponent +1 for S of
+even size, exponent -1 for S of odd size.
+
+For |I| = 2, say I = {p, q}, we get
+
+ Delta(x) = (x_empty * x_{p,q}) / (x_p * x_q).
+
+Notice the two ways to regroup the same four numbers:
+
+ = [x_empty / x_p] / [x_q / x_{p,q}]
+ = [x_empty / x_q] / [x_p / x_{p,q}].
+
+Each line compares pairs going in one prime direction. The lemma
+below makes each such comparison a unit of residue 1 at that prime.
+Comparing in every direction makes Delta(x) have residue 1 at every
+prime above every p in I; that is how we bound its order.
+
+5.4 The comparison lemma.
+
+Lemma 5.1 (character pairing). Let p be in I, and let p^e be the
+order of the p-part of P. Let A be the localized cyclotomic ring of
+Part 3. Suppose F and K lie in A[C_{p^e}] with
+
+ F K = p^e b, b a unit of A.
+
+Then the two ratios
+
+ F(rho_p) / F(1) and K(rho_p) / K(1)
+
+are units of A[rho_p], and both have residue 1 at its maximal ideal.
+
+Why it holds. If e = 1, the valuations of F(1) and K(1) are
+nonnegative integers summing to 1, so one of them is a unit, i.e.
+v = 0. Modulo (rho_p - 1), the root rho_p behaves like 1, so that
+factor's ratio has residue 1; the two ratios multiply to 1, so the
+other has the same property.
+
+If e >= 2, evaluate at a primitive p^e-th root xi. Since FK = p^e b,
+the two valuations v(F(xi)) and v(K(xi)) are nonnegative and sum to e,
+so at least one is 1 or more; swap the factors so that F(xi) is
+divisible by p. Divide F by the cyclotomic polynomial of xi: the
+remainder R has degree < D and R(xi) = F(xi), so by Lemma 3.1 every
+coefficient of R lies in pA. Projecting C_{p^e} to C_{p^{e-1}} sends
+that cyclotomic polynomial to p, so the projection of F is divisible
+by p in the smaller group ring. Replace F by that projection divided
+by p; the relation FK = p^e b drops to p^{e-1} b, and both evaluations
+at 1 and at rho_p pass through the projection, so the ratios are
+unchanged. Induct. []
+
+Corollary 5.2 (residue one at each prime). Suppose x in Z[i][P]
+satisfies x x* = u^2. Then for each p in I and each subset S with p
+not in S, the quotient
+
+ x_{S union {p}} / x_S
+
+is a unit of B, with residue 1 at every maximal ideal above p.
+
+The corollary comes from applying Lemma 5.1 to the two factors of
+x x* = u^2, after evaluating everything except the p-part at chi_S.
+
+5.5 Kronecker and odd torsion.
+
+Two standard facts about roots of unity:
+
+Lemma 5.3 (Kronecker). Let B be a subring of C that is finitely
+generated as an abelian group by roots of unity. If z in B satisfies
+|sigma(z)| = 1 for every unital ring homomorphism sigma: B -> C, then
+z is a root of unity.
+
+Sketch. Multiplication by z is an integer-linear map on the finite
+lattice B, hence an integer matrix. Every eigenvalue has absolute
+value 1 and is an algebraic integer, so Kronecker's theorem says each
+eigenvalue is a root of unity. A positive power of z then acts as the
+identity on the lattice; applying that power to 1 in B shows z has
+finite order. []
+
+Lemma 5.4 (odd torsion). In a local domain whose residue field has
+characteristic p, any root of unity congruent to 1 has p-power order.
+
+Sketch. Let the root be z, of order m = p^a n with gcd(n, p) = 1. If
+n > 1, raising to the p^a-th power gives a root of unity of order n
+congruent to 1. In a domain, (z' - 1)(1 + z' + ... + z'^{n-1}) = 0, and
+z' - 1 is not zero, so the sum vanishes. Reducing mod p gives
+n = 0 in the residue field, contradiction. So n = 1. []
+
+5.6 The trap.
+
+Proposition 5.5. Suppose x in Z[i][P] satisfies x x* = u^2. Then:
+
+ (a) Delta(x) lies in B and is a root of unity.
+ (b) For every p in I, the order of Delta(x) is a power of p.
+ (c) In particular, Delta(x) has odd order.
+ (d) If u has at least two distinct prime divisors, Delta(x) = 1.
+
+Why it holds.
+
+ (a) Local control. Corollary 5.2 gives, at every prime above every
+ p in I, that Delta(x) is a unit of residue 1. At primes not above
+ any p in I, u^2 is a unit, so every x_S is already a unit and
+ Delta(x) is a unit there too. So Delta(x) sits inside B localized at
+ every maximal ideal, which is the same as being in B itself.
+
+ Absolute values. Every complex embedding sigma sends each x_S to a
+ complex number of modulus u, and the total exponent sum
+ sum_S eps_S = (1 - 1)^{|I|} = 0, so |sigma(Delta(x))| = 1. Lemma 5.3
+ then makes Delta(x) a root of unity.
+
+ (b) Pick a maximal ideal above p. By (a), Delta(x) has residue 1
+ there. Lemma 5.4 makes its order a power of p. This holds for every
+ p in I.
+
+ (c) Each p in I divides u, and u is odd, so each p is odd. An order
+ that is a power of an odd prime is odd.
+
+ (d) If p and q are distinct primes both in I, the order is a power
+ of p and also a power of q, hence equals 1.
+
+There is a subtlety worth flagging. When u has a single prime divisor,
+Delta(x) can be a nontrivial root of unity. For instance, if u = p^a
+and x = p^a X (with X the generator of C_{u^2} = C_{p^{2a}}), then
+x x* = u^2, but Delta(x) = rho_p^{-1}, of order p. The final argument
+uses this odd torsion directly; it does not try to kill it.
+
+--------------------------------------------------------------------
+PART 6. STEP TWO: THE MOD-2 CONTRADICTION
+--------------------------------------------------------------------
+
+Now assume u > 1 is odd, and suppose a circulant Hadamard matrix of
+order n = 4 u^2 exists. We derive a contradiction. Throughout, P =
+C_{u^2}, n = 4 u^2, and B and I are as in Part 5.
+
+6.1 Split the row by residues mod 4.
+
+Since C_{4u^2} = C_4 x C_{u^2}, write the first row as
+
+ h = H_0 + Z H_1 + Z^2 H_2 + Z^3 H_3,
+
+where Z is a generator of C_4 (so Z^4 = 1) and each H_j is an element
+of Z[P] whose coefficients are all +1 or -1. (Concretely, H_j collects
+the signs sitting at exponents congruent to j mod 4.)
+
+6.2 Four partial evaluations.
+
+Evaluate the C_4 part at Z = 1, -1, i, -i and keep P variable. Divide
+each result by 2 to make the coefficients integers. The three results
+we will use are
+
+ c = (H_0 + H_1 + H_2 + H_3) / 2 (Z = 1),
+ d = (H_0 - H_1 + H_2 - H_3) / 2 (Z = -1),
+ g = (H_0 - H_2)/2 + i (H_1 - H_3)/2 (Z = i).
+
+(The fourth, at Z = -i, is the coefficientwise conjugate of g.)
+
+Coefficients are integers: in c and d each coefficient is a sum of
+four odd integers, hence even, and halving gives an integer; in g each
+coefficient is (odd - odd)/2, an integer, or i times such a half.
+
+Norms. Each of 1, -1, i has absolute value 1, so evaluating the norm
+identity h h* = 4 u^2 at Z = that value commutes with the star
+operation and gives
+
+ c c* = d d* = g g* = u^2 (g taken in Z[i][P]).
+
+So c, d, g are exactly the input demanded by Proposition 5.5.
+
+6.3 Two roots of unity.
+
+Set
+
+ R = Delta(d) / Delta(c), W = Delta(g) / Delta(c).
+
+By Proposition 5.5 each of Delta(c), Delta(d), Delta(g) is a root of
+unity of odd order, so R and W are roots of unity of odd order. (They
+live in the fraction field of B, but Part 6 works modulo a maximal
+ideal, where this causes no trouble.)
+
+Goal: show the residue mod 2 forces R = W = 1, and then extract a
+direct algebraic contradiction from the way c, d, g were built.
+
+6.4 The prime above 2.
+
+Let M be any maximal ideal of B = Z[i, rho_p (p in I)] that contains
+2. (Such M exists because B / 2B is nonzero: 2 is not a unit of B.)
+Set O = B localized at M, with maximal ideal M O, and let k = O / M O
+be the residue field. Its characteristic is 2.
+
+Inside k, the element i is 1. Indeed i - 1 satisfies
+
+ (i - 1)^2 = i^2 - 2i + 1 = -1 + 0 + 1 = 0 (char 2),
+
+and a field has no nonzero nilpotents. Hence 2, 1 + i, and 1 - i all
+lie in the maximal ideal M O.
+
+6.5 Units mod 2.
+
+Every c_S, d_S, g_S is a unit of O. Reason: c_S mul conj(c_S) = u^2,
+which is odd and hence not divisible by 2; so c_S is not in any prime
+above 2, and the same holds for d_S and g_S. Therefore the local units
+
+ r_S = d_S / c_S, w_S = g_S / c_S
+
+are defined in O, and
+
+ R = product_S r_S^{eps_S}, W = product_S w_S^{eps_S}.
+
+6.6 The first-order logarithm.
+
+We need a way to "linearize" units close to 1 in a local ring. This is
+the logarithmic first-order term.
+
+Lemma 6.1. Let O be a local domain with maximal ideal M, residue field
+k = O/M, and let t be a nonzero element of M. Then 1 + t O is a
+subgroup of the unit group O^x, and the map
+
+ lambda_t: 1 + t O -> (k, +),
+ lambda_t(1 + t L) = L mod M
+
+is a group homomorphism.
+
+Why it holds. If L is in O, then 1 + t L is a unit (its residue is 1),
+and L is recovered uniquely from 1 + t L because t is not zero in the
+domain O. The two exact identities
+
+ [ (1 + t L)(1 + t M) - 1 ] / t = L + M + t L M,
+ [ (1 + t L)^{-1} - 1 ] / t = - L / (1 + t L)
+
+show closure under multiplication and inversion. Reducing modulo M
+gives additivity and the inverse rule. []
+
+6.7 The exact differences.
+
+Put b = (H_1 + H_3)/2, an element of Z[P]. Direct subtraction gives
+
+ d - c = -2 b,
+ g - c = (i - 1) b - (H_2 + i H_3).
+
+The second identity is worth checking once. From 6.2,
+
+ g - c = [ (H_0 - H_2) + i (H_1 - H_3)
+ - (H_0 + H_1 + H_2 + H_3) ] / 2
+ = [ -2 H_2 - H_1 - H_3 + i (H_1 - H_3) ] / 2
+ = -H_2 + [ (i - 1) H_1 - (1 + i) H_3 ] / 2.
+
+With b = (H_1 + H_3)/2, this equals (i - 1) b - (H_2 + i H_3), as
+claimed.
+
+Now control the last bracket. Every coefficient of H_2 + i H_3 has
+the form a + i b with a and b each +1 or -1. So each such coefficient
+differs from 1 + i by an element of 2 Z[i] (the differences a - 1 and
+b - 1 are 0 or -2). Let
+
+ J = sum_{z in P} z
+
+be the group-ring element whose every coefficient is 1. Then
+
+ H_2 + i H_3 = (1 + i) J + 2 U, U in Z[i][P].
+
+Substitute into the second difference and use the two factorisations
+
+ i - 1 = i (1 + i), -2 = (1 + i)(i - 1):
+
+ g - c = i (1 + i) b - (1 + i) J - 2 U
+ = (1 + i) [ i b - J - (1 - i) U ].
+
+So both differences have a visible factor: d - c has a factor 2, and
+g - c has a factor 1 + i. Both 2 and 1 + i lie in the maximal ideal
+M O of O.
+
+6.8 First-order forms.
+
+Evaluate the identities of 6.7 at the character chi_S and divide by
+c_S (a unit of O):
+
+ L_{r,S} := (r_S - 1) / 2 = - b_S / c_S,
+ L_{w,S} := (w_S - 1) / (1 + i) = [ i b_S - J_S - (1 - i) U_S ] / c_S.
+
+Because b_S, J_S, U_S, c_S are all in O and c_S is a unit, both
+L_{r,S} and L_{w,S} lie in O. In other words,
+
+ r_S = 1 + 2 L_{r,S} lies in 1 + 2 O,
+ w_S = 1 + (1 + i) L_{w,S} lies in 1 + (1 + i) O.
+
+The two factors 2 and 1 + i are exactly the choices of t for which
+Lemma 6.1 applies, since both lie in M O.
+
+6.9 Reduce and cancel b.
+
+Apply Lemma 6.1 with t = 2 to the family r_S, and with t = 1 + i to
+the family w_S. Then
+
+ lambda_2(r_S) = L_{r,S} mod M O,
+ lambda_{1+i}(w_S) = L_{w,S} mod M O.
+
+Each r_S is in 1 + 2O and each w_S is in 1 + (1+i)O, and both 2 and
+1 + i lie in M O. So every r_S and w_S is congruent to 1 modulo M O,
+and hence so are R and W. But R and W have odd order by section 6.3,
+and Lemma 5.4 (residue characteristic 2) makes any root of unity
+congruent to 1 have 2-power order. An odd 2-power is 1, so R = W = 1.
+The homomorphism property then gives
+
+ sum_S eps_S L_{r,S} = 0 mod M O,
+ sum_S eps_S L_{w,S} = 0 mod M O.
+
+Add the two displayed congruences. In characteristic 2, addition and
+subtraction coincide, so the signs do no harm:
+
+ sum_S eps_S ( L_{r,S} + L_{w,S} ) = 0 mod M O. (*)
+
+Now compute the inner sum with the exact forms of 6.8.
+
+ L_{r,S} + L_{w,S}
+ = - b_S / c_S + [ i b_S - J_S - (1 - i) U_S ] / c_S
+ = [ (i - 1) b_S - J_S - (1 - i) U_S ] / c_S
+ = [ -(1 - i) b_S - J_S - (1 - i) U_S ] / c_S
+ = - J_S / c_S - (1 - i)( b_S + U_S ) / c_S.
+
+The factor 1 - i lies in M O, so the second term vanishes modulo M O:
+
+ L_{r,S} + L_{w,S} = - J_S / c_S = J_S / c_S mod M O,
+
+where the last equality again uses characteristic 2 (minus equals
+plus). Substituting into (*) gives
+
+ sum_S eps_S J_S / c_S = 0 mod M O. (**)
+
+6.10 The last sum has exactly one nonzero term.
+
+Recall J = sum_{z in P} z.
+
+ - Suppose S is empty. Then chi_empty is the trivial character, so
+ J_empty = sum of 1 over P, which is |P| = u^2. And eps_empty = 1.
+
+ - Suppose S is not empty. Then chi_S is a nontrivial character, so
+ some z in P has chi_S(z) not equal to 1. Multiplication by z
+ permutes the summands of J, so
+
+ chi_S(z) J_S = J_S, hence ( chi_S(z) - 1 ) J_S = 0.
+
+ Since B is a domain and chi_S(z) - 1 is not zero, J_S = 0.
+
+So every term of the sum in (**) except the empty one vanishes, and
+
+ (**) becomes u^2 / c_empty = 0 mod M O.
+
+But c_empty is a unit of O (section 6.5), and u^2 is an odd integer,
+hence a unit mod 2. So u^2 / c_empty is a unit of O and is nonzero in
+the residue field k. That contradicts the equation above.
+
+Therefore u = 1.
+
+Combining with Part 4, the only possible orders are n = 1 and n = 4.
+
+6.11 Order 4 is genuine.
+
+For the first row (1, 1, 1, -1) we have c = 1, d = 1, g = i (and
+conjugate -i). Here I is empty, so Delta(x) is just the empty
+character evaluation, i.e. x(1): R = Delta(d)/Delta(c) = 1 and
+W = Delta(g)/Delta(c) = i. The deduction of section 6.9 needs R and W
+to be roots of unity of odd order; here W = i has order 2, so that
+step simply does not fire. The order-4 matrix survives exactly
+because the torsion at the prime 2 is even.
+
+--------------------------------------------------------------------
+PART 7. BARKER SEQUENCES
+--------------------------------------------------------------------
+
+We now finish by classifying Barker sequences. The odd-length case is
+classical; the even-length case follows from the main theorem.
+
+7.1 Even lengths give circulant Hadamard matrices.
+
+Let a = (a_0, ..., a_{n-1}) be a Barker sequence of even length n > 2.
+Recall its aperiodic autocorrelations C_a(t) and define the periodic
+ones
+
+ P_a(t) = sum_{j=0}^{n-1} a_j a_{(j+t) mod n}.
+
+Because the sequence is periodic, P_a(t) = C_a(t) + C_a(n - t).
+
+Two congruences, both used below.
+
+ (i) P_a(t) is congruent to n modulo 4. Why? The product of the n
+ summands of P_a(t) is prod_j a_j a_{j+t} = (prod_j a_j)^2 = 1.
+ So an even number of summands equal -1. Then P_a(t) = n minus
+ twice an even number, which is congruent to n modulo 4.
+
+ (ii) C_a(t) is congruent to n - t modulo 2. Why? C_a(t) has n - t
+ summands, each +1 or -1, so it is congruent to n - t modulo 2.
+
+Take t = 2. Then C_a(2) and C_a(n - 2) are both even (from (ii), for
+an even n). The Barker condition says each has absolute value at most
+1, and an even integer of absolute value at most 1 must be 0. So
+C_a(2) = C_a(n - 2) = 0, giving P_a(2) = 0. Combined with (i),
+
+ n is congruent to 0 modulo 4.
+
+Now take any t. By (i), P_a(t) is divisible by 4 (since n is). By the
+Barker condition, |P_a(t)| <= |C_a(t)| + |C_a(n - t)| <= 2. A multiple
+of 4 with absolute value at most 2 is 0. So P_a(t) = 0 for every
+nontrivial t.
+
+Therefore the cyclic shifts of a form a circulant Hadamard matrix of
+order n. By the main theorem, n is 1 or 4; since n > 2 is even, n = 4.
+
+7.2 Odd lengths.
+
+For odd n > 1, Turyn and Storer (1961) proved that no Barker sequence
+exists for n > 13, and Schmidt and Willms (2016) proved the exact
+list of odd lengths is {3, 5, 7, 11, 13}. We do not redo those here.
+
+7.3 Examples.
+
+Every length in {2, 3, 4, 5, 7, 11, 13} has a Barker sequence.
+Here + denotes +1 and - denotes -1.
+
+ n = 2: ++
+ n = 3: ++-
+ n = 4: +++-
+ n = 5: +++-+
+ n = 7: +++--+-
+ n = 11: +++---+--+-
+ n = 13: +++++--++-+-+
+
+For each row you can check directly that every nontrivial C_a(t) lies
+in {-1, 0, 1}.
+
+7.4 The classification.
+
+Combining 7.1 and 7.2: a Barker sequence of length n > 1 exists if
+and only if n is one of
+
+ 2, 3, 4, 5, 7, 11, 13.
+
+If length 1 is admitted, it is trivially also possible: there are no
+nontrivial shifts, so the Barker condition is vacuous.
+
+====================================================================
+REFERENCES
+====================================================================
+
+Turyn, R. J. (1965). Character sums and difference sets.
+ Pacific J. Math. 15, 319-346.
+ doi:10.2140/pjm.1965.15.319
+
+Turyn, R. and Storer, J. (1961). On binary sequences.
+ Proc. Amer. Math. Soc. 12, 394-399.
+ doi:10.1090/S0002-9939-1961-0125026-2
+
+Schmidt, K.-U. and Willms, J. (2016). Barker sequences of odd length.
+ Des. Codes Cryptogr. 80, 409-414. arXiv:1501.06035
+
+Logan, B. and Mossinghoff, M. J. (2017). Double Wieferich pairs and
+ circulant Hadamard matrices. J. Combin. Math. Combin. Comput. 101,
+ 145-156.
+
+Euler, R., Gallardo, L. H., and Rahavandrainy, O. (2016).
+ Combinatorial properties of circulant Hadamard matrices.
+ Contemp. Math. 658, 9-19. arXiv:2406.10748
+
+Steinerberger, S. (2024). A note on approximate Hadamard matrices.
+ Des. Codes Cryptogr. 92, 3125-3131.
+ doi:10.1007/s10623-024-01430-w
+
+Kronecker, L. (1857). Zwei Saetze ueber Gleichungen mit ganzzahligen
+ Coefficienten. J. reine angew. Math. 53, 173-175.
+ doi:10.1515/crll.1857.53.173
+
+Ryser, H. J. (1963). Combinatorial Mathematics. Carus Math. Monographs
+ 14, Math. Assoc. America. doi:10.5948/UPO9781614440147
+
+Schmidt, B. (1999). Cyclotomic integers and finite geometry.
+ J. Amer. Math. Soc. 12, 929-952.
+ doi:10.1090/S0894-0347-99-00298-2
+
+Leung, K. H. and Schmidt, B. (2005). The field descent method.
+ Des. Codes Cryptogr. 36, 171-188.
+ doi:10.1007/s10623-004-1703-7
+
+Leung, K. H. and Schmidt, B. (2012). New restrictions on possible
+ orders of circulant Hadamard matrices. Des. Codes Cryptogr. 64,
+ 143-151. doi:10.1007/s10623-011-9493-1
+
+Leung, K. H. and Schmidt, B. (2016). The anti-field-descent method.
+ J. Combin. Theory Ser. A 139, 87-131.
+ doi:10.1016/j.jcta.2015.11.005
+
+Oh-Hashi, Y. (2016). A proof of Turyn's conjecture. IEICE Trans.
+ Commun. E99-B, 1395-1407. doi:10.1587/transcom.2015EBP3506
+
+Orozco Lopez, R. (2019). Proof of the circulant Hadamard conjecture.
+ arXiv:1907.12683.
+
+Morris, J. (2023). A proof of Ryser's circulant Hadamard conjecture.
+ arXiv:2302.08346.
+
+Gallardo, L. H. (2024). Ryser's conjecture and stochastic matrices.
+ arXiv:2405.13033.
+
+Manjhi, P. K. and Kumar, J. (2025). Construction of regular Hadamard
+ matrices from circulant Hadamard matrices and Ryser's conjecture.
+ Commun. Math. Appl. 16, 923-927. doi:10.26713/cma.v16i3.3215
+
+====================================================================
+END.
+====================================================================