Documentation

LeanPool.Koethe.MaskSequence.Basic

Sparse periodic masks #

The bookkeeping in this file is purely combinatorial. In particular it does not use a matrix-mortality theorem: that theorem will be a hypothesis of the sequence construction.

We use the integral invariant 4 * assigned < period. If a compatible word has length l, repeating the old mask 4*l+1 times before installing the word preserves this invariant. Thus no limiting density or geometric-series calculation is needed.

All assignments, at all sites, of M persist in N.

Equations
Instances For
    theorem KoetheCounterexample.MaskSequence.Extends.trans {k : Type u_1} [Field k] {L M N : PeriodicMask k} (hNM : Extends N M) (hML : Extends M L) :
    theorem KoetheCounterexample.MaskSequence.lookup_nonzero {k : Type u_1} [Field k] (M : PeriodicMask k) {n : } {z : Triple k} (h : M.lookup n = some z) :
    z 0
    @[simp]
    theorem KoetheCounterexample.MaskSequence.lookup_fin {k : Type u_1} [Field k] (M : PeriodicMask k) (i : Fin M.period) :
    M.lookup i = M.value i
    theorem KoetheCounterexample.MaskSequence.lookup_mod_of_dvd {k : Type u_1} [Field k] (M : PeriodicMask k) {p : } (hp : M.period p) (n : ) :
    M.lookup (n % p) = M.lookup n
    theorem KoetheCounterexample.MaskSequence.lookup_add_of_mod_eq_zero {k : Type u_1} [Field k] (M : PeriodicMask k) {b : } (hb : b % M.period = 0) (i : ) :
    M.lookup (b + i) = M.lookup i

    The unassigned mask of period one.

    Equations
    Instances For

      Exact cardinal count for lifting all old assignments to c periods.

      def KoetheCounterexample.MaskSequence.install {k : Type u_1} [Field k] (M : PeriodicMask k) (w : List (Triple k)) (hw : zw, z 0) :

      Refine a mask by installing a nonzero compatible word in its first block. Outside that block every previous assignment is retained.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        @[simp]
        theorem KoetheCounterexample.MaskSequence.install_period {k : Type u_1} [Field k] (M : PeriodicMask k) (w : List (Triple k)) (hw : zw, z 0) :
        (install M w hw).period = (4 * w.length + 1) * M.period
        theorem KoetheCounterexample.MaskSequence.period_dvd_install {k : Type u_1} [Field k] (M : PeriodicMask k) (w : List (Triple k)) (hw : zw, z 0) :
        theorem KoetheCounterexample.MaskSequence.length_le_install_period {k : Type u_1} [Field k] (M : PeriodicMask k) (w : List (Triple k)) (hw : zw, z 0) :
        theorem KoetheCounterexample.MaskSequence.install_extends {k : Type u_1} [Field k] (M : PeriodicMask k) (w : List (Triple k)) (hw : zw, z 0) (hc : M.Compatible w) :
        Extends (install M w hw) M
        theorem KoetheCounterexample.MaskSequence.install_word {k : Type u_1} [Field k] (M : PeriodicMask k) (w : List (Triple k)) (hw : zw, z 0) (i : Fin w.length) :
        (install M w hw).lookup i = some (w.get i)
        theorem KoetheCounterexample.MaskSequence.install_assigned_le {k : Type u_1} [Field k] (M : PeriodicMask k) (w : List (Triple k)) (hw : zw, z 0) :
        (install M w hw).assigned (4 * w.length + 1) * M.assigned + w.length

        Installing the word adds at most its length to the lifted assigned set.

        theorem KoetheCounterexample.MaskSequence.install_sparse {k : Type u_1} [Field k] (M : PeriodicMask k) (w : List (Triple k)) (hw : zw, z 0) (hM : 4 * M.assigned < M.period) :
        4 * (install M w hw).assigned < (install M w hw).period

        An adaptive integral density budget: the positive old slack is amplified by 4 * length + 1, whereas the cost of the new block is at most 4 * length. The new slack is therefore still at least one.