Documentation

LeanPool.CriticalPortraits.CycleLemma

The cycle lemma (Raney / Dvoretzky–Motzkin), sum = 1 case — PROVED #

Sorry-free, kernel-axiom-clean (propext, Classical.choice, Quot.sound).

Raney's lemma: any integers summing to 1 have exactly one cyclic shift with all partial sums positive. We formalize it on a period-n sequence a : ℕ → ℤ with period-sum 1, via the partial sums Q k = ∑_{j<k} a j (so Q (k+n) = Q k + 1). A shift i is good iff Q i < Q t for all t ∈ (i, i+n); the unique good i ∈ [0,n) is the last argmin of Q over [0,n). The count #level-canonical = C(N,d-1)/d will follow (a_k = 1 - (level counts)).

def CriticalPortraits.Cycle.Q (a : ) (k : ) :

Partial sums of a.

Equations
Instances For
    theorem CriticalPortraits.Cycle.Q_succ (a : ) (k : ) :
    Q a (k + 1) = Q a k + a k
    theorem CriticalPortraits.Cycle.window_sum {n : } (a : ) (hper : ∀ (k : ), a (k + n) = a k) (k : ) :
    Q a (k + n) - Q a k = Q a n - Q a 0

    A window of length n of a period-n sequence sums to the period sum.

    theorem CriticalPortraits.Cycle.Q_periodic {n : } (a : ) (hper : ∀ (k : ), a (k + n) = a k) (hsum : Q a n = 1) (k : ) :
    Q a (k + n) = Q a k + 1

    Periodicity of the partial sums: Q (k+n) = Q k + (period sum).

    def CriticalPortraits.Cycle.Good (n : ) (a : ) (i : ) :

    Shift i is good: every partial sum of the shifted sequence is positive, i.e. Q i is a strict minimum of Q over the half-open window (i, i+n).

    Equations
    Instances For
      theorem CriticalPortraits.Cycle.cycle_lemma {n : } (a : ) (hn : 0 < n) (hper : ∀ (k : ), a (k + n) = a k) (hsum : Q a n = 1) :
      ∃! i : , i < n Good n a i

      The cycle lemma (Raney), sum = 1. For a period-n integer sequence with period-sum 1, exactly one shift i ∈ [0,n) is good. The witness is the last argmin of Q over [0,n).