Chain compression (Lemma 1 and the abstract part of Lemma 2) #
A chain system splits the positive integers into chains: every n > 0 sits at position
pos n of the chain key n, and elt k u is the element at position u of chain k
(valid positions form an initial segment, elements increase along a chain).
comp S replaces the occupied positions of every chain by an initial segment of the same size.
We show |comp S| = |S|, that comp does not decrease any |A S t| provided the multiples
j * elt k e (j ≤ t) can be described by "shifted windows" in target chains (Cons), and
that comp strictly decreases the sum of the elements as soon as some chain has a gap.
A partition of the positive integers into increasing chains.
- key : ℕ → κ
The chain containing a positive integer.
The position of a positive integer in its chain.
The integer at a given chain and position.
The positions belonging to a chain, forming an initial segment.
Instances For
Occupied positions of chain k.
Instances For
Compression: every chain's occupied positions become an initial segment.
Equations
- C.comp S = (Finset.image C.key S).biUnion fun (k : κ) => Finset.image (C.elt k) (Finset.range (C.occ S k).card)
Instances For
The sum of a set, chain by chain.
Sum over an initial segment is at most the sum over any set of the same size, for a function increasing on an initial segment containing the set; strictly if the set is not the initial segment.
Compression does not increase the sum, and strictly decreases it if some chain has a gap.
Lemma 1 + compression: if every chain satisfies the window condition for t,
compression does not decrease |A S t|.