Change counts, piece counts, and sorted groups #
A function has at most T changes when every nondecreasing sequence has at most T
adjacent positions with unequal outputs, and at most M pieces when it is constant on the
level sets of a monotone rank function with values below M. Sorting a finite set by a key and
splitting it into consecutive groups yields a large group on which most functions in a finite
family are constant. The key may have ties, and the size bound uses natural-number division.
Main definitions #
Cslib.ChangesAtMost: a uniform bound on changes along nondecreasing sequences.Cslib.PiecesAtMost: a function constant on the level sets of a monotone rank function with values belowM.
Main results #
Cslib.ChangesAtMost.comp_antitone: antitone precomposition preserves a change bound.Cslib.ChangesAtMost.pi,Cslib.ChangesAtMost.finset_pi: a finite tuple of functions changes at most the sum of the coordinate change bounds.Cslib.PiecesAtMost.changesAtMost: a function with at mostMpieces changes at mostM - 1times.Cslib.ChangesAtMost.exists_sorted_group: a group of at least|P| / Gpoints, with at mostT |Q| / Gexceptional functions.
References #
- [S. Schlesinger, Algebraic circuit formalizations in Complexitylib, Threshold/Internal/Changes] [Sch26a]
Increasing a change bound preserves it.
Post-composition preserves a change bound.
Monotone precomposition preserves a change bound.
Antitone precomposition preserves a change bound.
A constant function has no changes.
A tuple of functions indexed by a finite type changes at most the sum of the individual change bounds.
A tuple of functions indexed by a finite set changes at most the sum of the individual change bounds.
Increasing a piece bound preserves it.
Post-composition preserves a piece bound.
A function with at most M pieces changes at most M - 1 times.
Lemma 1 (sorted groups). Sort P by the key key and cut it into G consecutive
groups of ⌊|P| / G⌋ elements. If every Ψ q changes at most T times, some group P' is
such that the functions p ↦ Ψ q (key p) are constant on P' for every q ∈ Q outside a set
Qbad with G |Qbad| ≤ T |Q|.