Documentation

Complexitylib.Algebraic.MassProduction.Nonuniform.SortedPropagation

Propagation along sorted equal-key runs #

In a sorted array, equal keys occupy an interval. Linking adjacent equal keys therefore propagates a source bit to exactly the later records having that key, regardless of how many such records there are.

theorem Algebraic.MassProduction.Nonuniform.Propagation.value_sorted_eq_true_iff {Key : Type u_1} [LinearOrder Key] (key : ℕ → Key) (source : ℕ → Bool) (count : ℕ) (countPositive : 0 < count) (sorted : ∀ {left right : ℕ}, left ≤ right → right < count → key left ≤ key right) :
value source (keyLinks key) count = true ↔ ∃ start < count, source start = true ∧ key start = key (count - 1)

The segmented recurrence on sorted keys reports precisely the source bits in the equal-key run ending at the last processed record.