Documentation

LeanPool.ZetaH123.H1

H1 for Thakur's hypotheses on power sums #

def ZetaH123.H1.digit (q x n : ℕ) :

The n-th digit of x in base q, i.e. a_{i,n} for x = ∑_n a_{i,n} q ^ n.

Equations
Instances For
    def ZetaH123.H1.bCoeff (q i d : ℕ) :

    The coefficient b(i,d). The geometric sum ∑_{j=i+1} ^ d q ^ j equals the integer (q ^ (d + 1) - q ^ (i+1))/(q - 1), so this matches the informal definition exactly.

    Equations
    Instances For
      def ZetaH123.H1.CarryFree (q d : ℕ) (kk : Fin (d + 1) → ℕ) :

      Carry-free condition (Definition 2): in every digit position n, the sum of the n-th base-q digits of the entries is at most q - 1.

      Equations
      Instances For
        def ZetaH123.H1.Admissible (q d k : ℕ) (kk : Fin (d + 1) → ℕ) :

        Admissible tuple (Definition 3): satisfies the representation and carry-free conditions.

        Equations
        Instances For
          def ZetaH123.H1.F (q d : ℕ) (kk : Fin (d + 1) → ℕ) :

          The objective function F (Definition 4).

          Equations
          Instances For

            Supporting lemmas #

            Elementary structural facts: every component of an admissible tuple is ≤ k, base-q digits are ≤ q-1, the "all in slot 0" tuple is admissible, and the admissible set is finite.

            theorem ZetaH123.H1.admissible_le (q d k : ℕ) (hq : 1 ≤ q) (kk : Fin (d + 1) → ℕ) (h : Admissible q d k kk) (i : Fin (d + 1)) :
            kk i ≤ k

            Each component of an admissible tuple is at most k.

            theorem ZetaH123.H1.digit_le (q x n : ℕ) (hq : 1 ≤ q) :
            digit q x n ≤ q - 1

            digit q x n ≤ q - 1 whenever q ≥ 1.

            def ZetaH123.H1.k0tuple (d k : ℕ) :
            Fin (d + 1) → ℕ

            The "all in slot 0" tuple (k, 0, ..., 0).

            Equations
            Instances For
              theorem ZetaH123.H1.k0tuple_admissible (q d k : ℕ) (hq : 1 ≤ q) :
              Admissible q d k (k0tuple d k)
              theorem ZetaH123.H1.admissible_finite (q d k : ℕ) (hq : 1 ≤ q) :
              {kk : Fin (d + 1) → ℕ | Admissible q d k kk}.Finite

              The set of admissible tuples is finite.

              The crux: uniqueness of the maximizer #

              Maximizing F is equivalent to minimizing the linear functional Φ(kk) = q ^ {d+1}·∑ᵢ kkᵢ + (q - 1)·∑ᵢ i·qⁱ·kkᵢ, in which each "stone" in cell (i,n) (one unit of the digit a_{i,n}) carries weight q ^ {n+i}·g_i with g_i = q ^ {d+1-i} + (q - 1)·i strictly decreasing in i (informal.tex eq:Phi-H1, eq:g-decreasing-H1). Two pillars: carry elimination (carry_elimination: a maximizer's column sums are exactly the base-q digits of k) and uniqueness of the greedy allocation via exchange arguments (move_down, move_parallelogram).

              Digit bookkeeping for the single-column exchange #

              theorem ZetaH123.H1.digit_sub_self (q x n r : ℕ) (hq : 1 ≤ q) (hr : r ≤ digit q x n) :
              digit q (x - r * q ^ n) n = digit q x n - r

              Digit no-cascade, target position. Subtracting r * q ^ n from x, where r ≤ digit q x n, decreases the n-th digit by exactly r.

              theorem ZetaH123.H1.digit_sub_other (q x n r m : ℕ) (hq : 1 ≤ q) (hr : r ≤ digit q x n) (hmn : m ≠ n) :
              digit q (x - r * q ^ n) m = digit q x m

              Digit no-cascade, other positions. Subtracting r * q ^ n from x, where r ≤ digit q x n, leaves every digit at a position m ≠ n unchanged.

              theorem ZetaH123.H1.digit_add_self (q x n : ℕ) (hq : 1 ≤ q) (hlt : digit q x n + 1 < q) :
              digit q (x + q ^ n) n = digit q x n + 1

              Digit add, target position. Adding q ^ n to x, when digit q x n < q-1 (no carry triggered), increases the n-th digit by one.

              theorem ZetaH123.H1.digit_add_other (q x n m : ℕ) (hq : 1 ≤ q) (hlt : digit q x n + 1 < q) (hmn : m ≠ n) :
              digit q (x + q ^ n) m = digit q x m

              Digit add, other positions. Adding q ^ n to x, when digit q x n < q-1, leaves every digit at a position m ≠ n unchanged.

              def ZetaH123.H1.gWeight (q d i : ℕ) :

              The "stone weight" gᵢ = q ^ {d+1-i} + (q - 1)·i (informal.tex eq:Phi-H1).

              Equations
              Instances For
                theorem ZetaH123.H1.gWeight_exchange_pos (q d j : ℕ) (hq : 2 ≤ q) (hj : j < d) :
                q * gWeight q d (j + 1) + (q - 1) ^ 2 * (d - j) = gWeight q d j + (q - 1) * gWeight q d d

                The strict Φ-decrease arithmetic. The key identity q·g_{j+1} + (q - 1) ^ 2·(d-j) = g_j + (q - 1)·g_d, i.e. g_j + (q - 1)·g_d - q·g_{j+1} = (q - 1) ^ 2·(d-j) > 0 for j < d, q ≥ 2 (informal.tex lem:H1-carry-elimination).

                theorem ZetaH123.H1.F_lt_of_Phi_lt (q d _k : ℕ) (hq : 2 ≤ q) (kk kk' : Fin (d + 1) → ℕ) (hk : ∑ i : Fin (d + 1), kk i * q ^ ↑i = ∑ i : Fin (d + 1), kk' i * q ^ ↑i) (hPhi : q ^ (d + 1) * ∑ i : Fin (d + 1), kk' i + (q - 1) * ∑ i : Fin (d + 1), ↑i * q ^ ↑i * kk' i < q ^ (d + 1) * ∑ i : Fin (d + 1), kk i + (q - 1) * ∑ i : Fin (d + 1), ↑i * q ^ ↑i * kk i) :
                F q d kk < F q d kk'

                The F ↔ Φ reduction. Comparing F of two admissible tuples with the same k reduces to comparing their Φ, where Φ(kk) = q ^ {d+1}·∑ᵢ kkᵢ + (q - 1)·∑ᵢ i·qⁱ·kkᵢ: a strict Φ-decrease (from kk to kk') gives a strict F-increase. (Identity (q - 1)·(-(∑ᵢ kkᵢ·b(i,d))) + q·k = Φ(kk).)

                theorem ZetaH123.H1.row_take_top (d : ℕ) (a : Fin (d + 1) → ℕ) (c : ℕ) :
                1 ≤ c → c ≤ ∑ i : Fin (d + 1), a i → ∃ (r : Fin (d + 1) → ℕ), (∀ (i : Fin (d + 1)), r i ≤ a i) ∧ ∑ i : Fin (d + 1), r i = c ∧ ∃ (J : Fin (d + 1)), 0 < r J ∧ ∀ (i : Fin (d + 1)), ↑J < ↑i → r i = 0

                Row selection (take-from-top). Given nonnegative row-counts a on Fin (d + 1) and a target c with 1 ≤ c ≤ ∑ a, there is a removal function r ≤ a removing exactly c stones, taken greedily from the top rows: there is a maximal removed row J (r J > 0) above which nothing is removed (r i = 0 for i > J).

                theorem ZetaH123.H1.digit_place_le (q x n : ℕ) :
                digit q x n * q ^ n ≤ x

                digit q x n times its place value q ^ n is at most x.

                theorem ZetaH123.H1.peridx (a x b p : ℕ) (hx : x ≤ a) :
                (a - x + b) * p + x * p = a * p + b * p

                A small per-index algebraic identity used in representation preservation.

                theorem ZetaH123.H1.repr_preserved (q d m : ℕ) (_hq : 1 ≤ q) (kk r : Fin (d + 1) → ℕ) (jj : Fin (d + 1)) (j : ℕ) (hjj : ↑jj = j + 1) (hjm : j ≤ m) (hrle : ∀ (i : Fin (d + 1)), r i ≤ digit q (kk i) (m - ↑i)) (hr0 : ∀ (i : Fin (d + 1)), m < ↑i → r i = 0) (hrsum : ∑ i : Fin (d + 1), r i = q) :
                ∑ i : Fin (d + 1), (kk i - r i * q ^ (m - ↑i) + if i = jj then q ^ (m - j) else 0) * q ^ ↑i = ∑ i : Fin (d + 1), kk i * q ^ ↑i

                Representation preservation for the single-column exchange. Removing r i stones at cell (i, m-i) (r i ≤ a_{i,m-i}, r i = 0 for i > m, ∑ r = q) and adding one stone at cell (j+1, m-j) (jj = j+1, j ≤ m) leaves ∑ kk_i q ^ i unchanged.

                theorem ZetaH123.H1.row_select_j (q d : ℕ) (hq : 2 ≤ q) (r : Fin (d + 1) → ℕ) (hrsum : ∑ i : Fin (d + 1), r i = q) (hrlast : r (Fin.last d) ≤ q - 1) :
                ∃ (j : Fin (d + 1)), ↑j < d ∧ 0 < r j ∧ ∀ (i : Fin (d + 1)), ↑j < ↑i → ↑i < d → r i = 0

                Maximal removed non-top row. From a removal r with ∑ r = q whose top-row value is ≤ q-1, there is a maximal row j < d that loses a stone, with no removed rows strictly between j and d.

                theorem ZetaH123.H1.exchange_carryfree (q d m : ℕ) (hq2 : 2 ≤ q) (kk : Fin (d + 1) → ℕ) (hcf : CarryFree q d kk) (r : Fin (d + 1) → ℕ) (jrow jj : Fin (d + 1)) (jv : ℕ) (hjv : jv = ↑jrow) (hjjval : ↑jj = jv + 1) (_hjm : jv ≤ m) (hrdig : ∀ (i : Fin (d + 1)), r i ≤ digit q (kk i) (m - ↑i)) (_hr0 : ∀ (i : Fin (d + 1)), m < ↑i → r i = 0) (hjpos : 0 < r jrow) (kk' : Fin (d + 1) → ℕ) (hkk' : ∀ (i : Fin (d + 1)), kk' i = kk i - r i * q ^ (m - ↑i) + if i = jj then q ^ (m - jv) else 0) :
                CarryFree q d kk'

                Carry-free preservation for the single-column exchange. The exchanged tuple kk' (remove r i stones at cell (i,m-i), add one at (jj,m-jv), jj = jv+1) stays carry-free. jrow is the maximal removed non-top row, jv = jrow.

                theorem ZetaH123.H1.gWeight_anti (q d i j : ℕ) (hq : 2 ≤ q) (hij : i < j) (hjd : j ≤ d) :
                gWeight q d j < gWeight q d i

                g is strictly decreasing in the row index (for q ≥ 2): the stone weight gWeight q d i = q ^ {d+1-i} + (q - 1)·i strictly decreases as i increases within 0..d (informal.tex eq:g-decreasing-H1).

                theorem ZetaH123.H1.exchange_phi_gain (q d k m : ℕ) (hq2 : 2 ≤ q) (kk : Fin (d + 1) → ℕ) (hrep : k = ∑ i : Fin (d + 1), kk i * q ^ ↑i) (r : Fin (d + 1) → ℕ) (jrow jj : Fin (d + 1)) (jv : ℕ) (hjv : jv = ↑jrow) (hjjval : ↑jj = jv + 1) (hjm : jv ≤ m) (hjd : jv < d) (hrdig : ∀ (i : Fin (d + 1)), r i ≤ digit q (kk i) (m - ↑i)) (hr0 : ∀ (i : Fin (d + 1)), m < ↑i → r i = 0) (hrsum : ∑ i : Fin (d + 1), r i = q) (hjpos : 0 < r jrow) (_hjtop : ∀ (i : Fin (d + 1)), jv < ↑i → ↑i < d → r i = 0) (kk' : Fin (d + 1) → ℕ) (hkk' : ∀ (i : Fin (d + 1)), kk' i = kk i - r i * q ^ (m - ↑i) + if i = jj then q ^ (m - jv) else 0) :
                F q d kk < F q d kk'

                Strict F-increase for the single-column exchange. The exchanged tuple kk' has strictly larger F, since Φ drops by q ^ m·(q - 1) ^ 2·(d-jv) > 0.

                theorem ZetaH123.H1.carry_exchange_improves (q d k : ℕ) (hq : Nat.Prime q) (kk : Fin (d + 1) → ℕ) (hadm : Admissible q d k kk) (m : ℕ) (hcarry : q ≤ ∑ i : Fin (d + 1), if ↑i ≤ m then digit q (kk i) (m - ↑i) else 0) :
                ∃ (kk' : Fin (d + 1) → ℕ), Admissible q d k kk' ∧ F q d kk < F q d kk'

                Carry-exchange improvement. If an admissible kk has a shifted carry at some column m (shifted column sum ∑_i a_{i,m-i} ≥ q), there is an admissible kk' with strictly larger F: remove q stones from Col_m, add one at (j+1, m-j) for j < d the maximal occupied non-top row (informal.tex lem:H1-carry-elimination).

                theorem ZetaH123.H1.carry_elimination (q d k : ℕ) (hq : Nat.Prime q) (kk : Fin (d + 1) → ℕ) (hadm : Admissible q d k kk) (hmax : ∀ (kk' : Fin (d + 1) → ℕ), Admissible q d k kk' → F q d kk' ≤ F q d kk) (m : ℕ) :
                (∑ i : Fin (d + 1), if ↑i ≤ m then digit q (kk i) (m - ↑i) else 0) ≤ q - 1

                Carry elimination. An admissible F-maximizer has no shifted carries: for every m, ∑_i a_{i,m-i} ≤ q-1. Otherwise carry_exchange_improves would give an admissible tuple with strictly larger F (informal.tex lem:H1-carry-elimination).

                theorem ZetaH123.H1.digit_zero (q : ℕ) (hq : 2 ≤ q) (y : ℕ) :
                (∀ (n : ℕ), digit q y n = 0) → y = 0

                Two naturals with all base-q digits equal to 0 are 0 (q ≥ 2).

                theorem ZetaH123.H1.digit_ext (q : ℕ) (hq : 2 ≤ q) (x y : ℕ) :
                (∀ (n : ℕ), digit q x n = digit q y n) → x = y

                Two naturals with all equal base-q digits are equal (q ≥ 2).

                def ZetaH123.H1.Phi (q d : ℕ) (kk : Fin (d + 1) → ℕ) :

                The potential Φ(kk) = q ^ {d+1}·∑ᵢ kkᵢ + (q - 1)·∑ᵢ i·qⁱ·kkᵢ (matches the form used by F_lt_of_Phi_lt). Minimizing Φ over equal-representation admissible tuples is equivalent to maximizing F.

                Equations
                Instances For
                  theorem ZetaH123.H1.move_down (q d k m i j : ℕ) (hq : 2 ≤ q) (kk : Fin (d + 1) → ℕ) (hadm : Admissible q d k kk) (hi : i ≤ m) (hj : j ≤ m) (hjd : j ≤ d) (hij : i < j) (hsrc : 1 ≤ digit q (kk ⟨i, ⋯⟩) (m - i)) (hslack : ∑ r : Fin (d + 1), digit q (kk r) (m - j) ≤ q - 2) :
                  ∃ (kk' : Fin (d + 1) → ℕ), Admissible q d k kk' ∧ Phi q d kk' < Phi q d kk

                  Single downward move within a column. Move one stone from cell (i, m-i) down to cell (j, m-j) (same column, rows i < j ≤ d), when the source cell is occupied and the target diagonal m-j has slack (≤ q-2 stones). The result is admissible and has strictly smaller Φ (by q ^ m (g_j - g_i) < 0).

                  theorem ZetaH123.H1.move_parallelogram_representation (q d k m i j t : ℕ) (kk kk' : Fin (d + 1) → ℕ) (I J IT JT : Fin (d + 1)) (hi : i ≤ m) (hj : j ≤ m) (hrep : k = ∑ r : Fin (d + 1), kk r * q ^ ↑r) (hborrowP : q ^ (m - i) ≤ kk I) (hborrowS : q ^ (m - j) ≤ kk JT) (hIval : ↑I = i) (hJval : ↑J = j) (hITval : ↑IT = i + t) (hJTval : ↑JT = j + t) (hIJT : I ≠ JT) (hkk'def : kk' = fun (r : Fin (d + 1)) => (((kk r - if r = I then q ^ (m - i) else 0) - if r = JT then q ^ (m - j) else 0) + if r = IT then q ^ (m - i) else 0) + if r = J then q ^ (m - j) else 0) :
                  k = ∑ r : Fin (d + 1), kk' r * q ^ ↑r
                  theorem ZetaH123.H1.move_parallelogram_carry_free (q d m i j t : ℕ) (kk kk' : Fin (d + 1) → ℕ) (I J IT JT : Fin (d + 1)) (hq1 : 1 ≤ q) (hcf : CarryFree q d kk) (hsrcP : 1 ≤ digit q (kk I) (m - i)) (hsrcS : 1 ≤ digit q (kk JT) (m - j)) (hJval : ↑J = j) (hITval : ↑IT = i + t) (hJTval : ↑JT = j + t) (hIJ : I ≠ J) (hIIT : I ≠ IT) (hIJT : I ≠ JT) (hJJT : J ≠ JT) (hITJT : IT ≠ JT) (hmimj : m - i ≠ m - j) (hkk'def : kk' = fun (r : Fin (d + 1)) => (((kk r - if r = I then q ^ (m - i) else 0) - if r = JT then q ^ (m - j) else 0) + if r = IT then q ^ (m - i) else 0) + if r = J then q ^ (m - j) else 0) (hkkI : kk' I = kk I - q ^ (m - i)) (hkkJT : kk' JT = kk JT - q ^ (m - j)) :
                  CarryFree q d kk'
                  theorem ZetaH123.H1.move_parallelogram_phi_lt (q d m i j t : ℕ) (hq : 2 ≤ q) (kk kk' : Fin (d + 1) → ℕ) (I J IT JT : Fin (d + 1)) (hi : i ≤ m) (hj : j ≤ m) (hij : i < j) (ht : 1 ≤ t) (hborrowP : q ^ (m - i) ≤ kk I) (hborrowS : q ^ (m - j) ≤ kk JT) (hIval : ↑I = i) (hJval : ↑J = j) (hITval : ↑IT = i + t) (hJTval : ↑JT = j + t) (hIJT : I ≠ JT) (hkk'def : kk' = fun (r : Fin (d + 1)) => (((kk r - if r = I then q ^ (m - i) else 0) - if r = JT then q ^ (m - j) else 0) + if r = IT then q ^ (m - i) else 0) + if r = J then q ^ (m - j) else 0) :
                  Phi q d kk' < Phi q d kk
                  theorem ZetaH123.H1.move_parallelogram (q d k m i j t : ℕ) (hq : 2 ≤ q) (kk : Fin (d + 1) → ℕ) (hadm : Admissible q d k kk) (hi : i ≤ m) (hj : j ≤ m) (hij : i < j) (ht : 1 ≤ t) (hjt : j + t ≤ d) (hsrcP : 1 ≤ digit q (kk ⟨i, ⋯⟩) (m - i)) (hsrcS : 1 ≤ digit q (kk ⟨j + t, ⋯⟩) (m - j)) :
                  ∃ (kk' : Fin (d + 1) → ℕ), Admissible q d k kk' ∧ Phi q d kk' < Phi q d kk

                  Parallelogram double move. When the target diagonal m-j is full, swap two stones around a parallelogram with corners P=(i,m-i), S=(j+t,m-j), Q=(i+t,m-i), R=(j,m-j) (rows i<j, shift t ≥ 1, all rows ≤ d): remove one from P and S, add one to Q and R. This preserves every column and diagonal sum (so admissibility needs no slack hypothesis) and strictly lowers Φ by (q - 1)(j-i)(q ^ m - q ^ {m+t}) < 0.

                  No two distinct maximizers #

                  theorem ZetaH123.H1.maximizer_min_Phi (q d k : ℕ) (hq : 2 ≤ q) (kk : Fin (d + 1) → ℕ) (hadm : Admissible q d k kk) (hmax : ∀ (kk' : Fin (d + 1) → ℕ), Admissible q d k kk' → F q d kk' ≤ F q d kk) (kk' : Fin (d + 1) → ℕ) (hadm' : Admissible q d k kk') :
                  Phi q d kk ≤ Phi q d kk'

                  A maximizer minimizes Φ. For an admissible F-maximizer kk, every admissible tuple kk' with the same k has Φ kk ≤ Φ kk' (via F_lt_of_Phi_lt).

                  theorem ZetaH123.H1.digit_sum_repr (q N x : ℕ) :
                  x < q ^ N → x = ∑ n ∈ Finset.range N, digit q x n * q ^ n

                  A natural x with x < q ^ N equals the sum of its first N base-q digits weighted by place value.

                  theorem ZetaH123.H1.reindex_col (q i M : ℕ) (f : ℕ → ℕ) :
                  (∑ m ∈ Finset.range M, if i ≤ m then f (m - i) * q ^ m else 0) = q ^ i * ∑ n ∈ Finset.range (M - i), f n * q ^ n

                  Reindex a "column" sum (terms with i ≤ m, weighted by q ^ m) as a place-shifted digit sum: substitute n = m - i.

                  theorem ZetaH123.H1.digit_eq_of_repr' (q : ℕ) (hq : 2 ≤ q) (m : ℕ) (c : ℕ → ℕ) (k : ℕ) :
                  (∀ (n : ℕ), c n ≤ q - 1) → (∃ (M : ℕ), (∀ (n : ℕ), M ≤ n → c n = 0) ∧ k = ∑ i ∈ Finset.range M, c i * q ^ i) → c m = digit q k m

                  Uniqueness of finite base-q representations. If k = ∑_{i<M} c i · q ^ i with every coefficient c n ≤ q - 1 and c vanishing past M, then c m is exactly the m-th base-q digit of k.

                  theorem ZetaH123.H1.column_sum_eq (q d k : ℕ) (hq : Nat.Prime q) (kk : Fin (d + 1) → ℕ) (hadm : Admissible q d k kk) (hmax : ∀ (kk' : Fin (d + 1) → ℕ), Admissible q d k kk' → F q d kk' ≤ F q d kk) (m : ℕ) :
                  (∑ i : Fin (d + 1), if ↑i ≤ m then digit q (kk i) (m - ↑i) else 0) = digit q k m

                  Exact column sums. A maximizer kk has exactly digit q k m stones in column m (∑_{i ≤ m} digit q (kk i) (m-i) = digit q k m): by carry_elimination the column sums are ≤ q-1, so they form the unique base-q digit string of k.

                  theorem ZetaH123.H1.differing_cell_select (q d k : ℕ) (hq : Nat.Prime q) (a b : Fin (d + 1) → ℕ) (hadma : Admissible q d k a) (hadmb : Admissible q d k b) (hcol : ∀ (m : ℕ), (∑ i : Fin (d + 1), if ↑i ≤ m then digit q (a i) (m - ↑i) else 0) = ∑ i : Fin (d + 1), if ↑i ≤ m then digit q (b i) (m - ↑i) else 0) (hne : a ≠ b) :
                  ∃ (m₀ : ℕ) (i₀ : ℕ) (j₀ : ℕ) (_ : i₀ ≤ m₀) (_ : j₀ ≤ m₀) (hj₀d : j₀ ≤ d) (hij : i₀ < j₀), (∀ (r : Fin (d + 1)) (nn : ℕ), ↑r + nn < m₀ → digit q (a r) nn = digit q (b r) nn) ∧ (1 ≤ digit q (a ⟨i₀, ⋯⟩) (m₀ - i₀) ∧ digit q (b ⟨i₀, ⋯⟩) (m₀ - i₀) < digit q (a ⟨i₀, ⋯⟩) (m₀ - i₀) ∧ digit q (a ⟨j₀, ⋯⟩) (m₀ - j₀) < digit q (b ⟨j₀, ⋯⟩) (m₀ - j₀) ∨ 1 ≤ digit q (b ⟨i₀, ⋯⟩) (m₀ - i₀) ∧ digit q (a ⟨i₀, ⋯⟩) (m₀ - i₀) < digit q (b ⟨i₀, ⋯⟩) (m₀ - i₀) ∧ digit q (b ⟨j₀, ⋯⟩) (m₀ - j₀) < digit q (a ⟨j₀, ⋯⟩) (m₀ - j₀))

                  Extremal differing-cell selection. Given admissible a ≠ b with equal column sums in every column, there are a column m₀ and rows i₀ < j₀ (i₀, j₀ ≤ m₀, j₀ ≤ d) such that a and b agree on every cell in columns < m₀, and either a has a surplus at (i₀, m₀-i₀) and a deficit at (j₀, m₀-j₀), or the mirror image with a and b swapped. In both cases the surplus row lies strictly above the deficit row, so a downward move on the surplus array is possible.

                  theorem ZetaH123.H1.parallelogram_exists (q d k : ℕ) (hq : Nat.Prime q) (a b : Fin (d + 1) → ℕ) (_hadma : Admissible q d k a) (hadmb : Admissible q d k b) (m₀ i₀ j₀ : ℕ) (_hi₀ : i₀ ≤ m₀) (hj₀ : j₀ ≤ m₀) (hj₀d : j₀ ≤ d) (_hij : i₀ < j₀) (hagree : ∀ (r : Fin (d + 1)) (nn : ℕ), ↑r + nn < m₀ → digit q (a r) nn = digit q (b r) nn) (hdef : digit q (a ⟨j₀, ⋯⟩) (m₀ - j₀) < digit q (b ⟨j₀, ⋯⟩) (m₀ - j₀)) (hfull : ∑ r : Fin (d + 1), digit q (a r) (m₀ - j₀) = q - 1) :
                  ∃ (t : ℕ) (hjtd : j₀ + t ≤ d), 1 ≤ t ∧ 1 ≤ digit q (a ⟨j₀ + t, ⋯⟩) (m₀ - j₀)

                  Surplus row exists in the full-diagonal case. In the configuration produced by differing_cell_select (rows i₀ < j₀ ≤ m₀, a,b agree below column m₀, a deficit at (j₀, m₀-j₀)), if the target diagonal m₀-j₀ is full in a (∑_r digit q (a r) (m₀-j₀) = q-1), then there is a shift t ≥ 1 with j₀ + t ≤ d and a stone at (j₀+t, m₀-j₀).

                  theorem ZetaH123.H1.no_two_distinct_maximizers (q d k : ℕ) (hq : Nat.Prime q) (kk₁ : Fin (d + 1) → ℕ) (hadm₁ : Admissible q d k kk₁) (hmax₁ : ∀ (kk' : Fin (d + 1) → ℕ), Admissible q d k kk' → F q d kk' ≤ F q d kk₁) (kk₂ : Fin (d + 1) → ℕ) (hadm₂ : Admissible q d k kk₂) (hmax₂ : ∀ (kk' : Fin (d + 1) → ℕ), Admissible q d k kk' → F q d kk' ≤ F q d kk₂) (ii : Fin (d + 1)) (n : ℕ) :
                  digit q (kk₁ ii) n = digit q (kk₂ ii) n

                  No two distinct admissible maximizers. Two admissible F-maximizers agree in every base-q digit of every row: both have column sums digit q k m (column_sum_eq), so if they differed, differing_cell_select plus an improving step (move_down or, via parallelogram_exists, move_parallelogram) on the surplus array would strictly lower Φ, contradicting maximizer_min_Phi.

                  theorem ZetaH123.H1.maximizer_unique (q d k : ℕ) (hq : Nat.Prime q) (kk₁ : Fin (d + 1) → ℕ) (hadm₁ : Admissible q d k kk₁) (hmax₁ : ∀ (kk' : Fin (d + 1) → ℕ), Admissible q d k kk' → F q d kk' ≤ F q d kk₁) (kk₂ : Fin (d + 1) → ℕ) (hadm₂ : Admissible q d k kk₂) (hmax₂ : ∀ (kk' : Fin (d + 1) → ℕ), Admissible q d k kk' → F q d kk' ≤ F q d kk₂) :
                  kk₁ = kk₂

                  Greedy uniqueness. Any two admissible tuples that both maximize F over the admissible set are equal: by digit_ext it suffices that all base-q digits agree, which is no_two_distinct_maximizers (informal.tex alg:H1-greedy).

                  theorem ZetaH123.H1.main_theorem (q d k : ℕ) (hq : Nat.Prime q) :
                  ∃ (kstar : Fin (d + 1) → ℕ), Admissible q d k kstar ∧ (∀ (kk : Fin (d + 1) → ℕ), Admissible q d k kk → F q d kk ≤ F q d kstar) ∧ ∀ (kk : Fin (d + 1) → ℕ), Admissible q d k kk → (∀ (kk' : Fin (d + 1) → ℕ), Admissible q d k kk' → F q d kk' ≤ F q d kk) → kk = kstar

                  Theorem (Unique maximizer). Let q be a prime and d, k ≥ 0. Among all admissible (d + 1)-tuples, the value F attains its maximum at exactly one admissible tuple: there exists an admissible kstar that maximizes F, and any admissible tuple that itself maximizes F over all admissible tuples must equal kstar.