Documentation

CslibFrontier.DataStructure.PriorityQueue.WordRAM.SoftHeap.Params

Soft-Heap Rank Parameters, Corruption Bound, and Item Potential #

Single-heap Word-RAM parameter and potential step toward #8624, after [Cha00], Theorem 1.1 and Section 5.1, Lemmas 5.1–5.2 (NECI TR 99-097 preprint, pp. 2, 12–13), and [PR02], Section 2.4, p. 19, Lemma 2.2. Supports insert, extractMin, and collectCorrupted without meld or arbitrary-handle delete. The dismantling-free binary-tree defill parameterization (targetSize r k = 2 ^ ((k - r + 1) / 2)), the 12 / 2 ^ r sizeCap recurrence, rankThresholdForEps ε for arbitrary 0 < ε : ℚ (extending Chazelle Theorem 1.1's 0 < ε ≤ 1 / 2 and PR02 Lemma 2.2's 0 < ε < 1 / 2), and the +(r : ℚ) baseline credit in itemPhi are this module's self-contained Word-RAM adaptation.

Main definitions #

Main results #

References #

Rank threshold achieving error rate at most ε : ℚ (using 12 / 2 ^ r ≤ ε).

Sufficient Word-RAM loop fuel for soft-heap operations with threshold r and capacity maxItems.

Minimum target item-list length targetSize r k of a non-leaf soft-heap node of rank k under corruption threshold r.

Target size is always positive.

@[simp]

Target size equals 1 for all ranks at most r.

Maximum number of items stored at a single soft-heap node of rank k under threshold r.

@[simp]

sizeCap r k = 1 for all k ≤ r.

theorem Cslib.DataStructure.PriorityQueue.WordRAM.SoftHeap.corrupt_sum_bound (r : ℕ) (C : ℕ → ℕ) (K : ℕ) (hstep : ∀ (k : ℕ), 2 * C (k + 1) ≤ C k) :
2 ^ r * ∑ k ∈ Finset.Icc (r + 1) K, C k * sizeCap r k ≤ 12 * C 0

General geometric corruption bound: if 2 * C (k + 1) ≤ C k for all k, then 2 ^ r * ∑ k ∈ Finset.Icc (r + 1) K, C k * sizeCap r k ≤ 12 * C 0.

theorem Cslib.DataStructure.PriorityQueue.WordRAM.SoftHeap.rat_le_eps_mul_of_pow_mul_le {ε : ℚ} (hε : 0 < ε) {c n : ℕ} (h : 2 ^ rankThresholdForEps ε * c ≤ 12 * n) :
↑c ≤ ε * ↑n

Converts an integer corruption bound 2 ^ rankThresholdForEps ε * c ≤ 12 * n into (c : ℚ) ≤ ε * (n : ℚ) for any 0 < ε.

theorem Cslib.DataStructure.PriorityQueue.WordRAM.SoftHeap.corrupt_sum_bound_eps {ε : ℚ} (hε : 0 < ε) (C : ℕ → ℕ) (K : ℕ) (hstep : ∀ (k : ℕ), 2 * C (k + 1) ≤ C k) :
↑(∑ k ∈ Finset.Icc (rankThresholdForEps ε + 1) K, C k * sizeCap (rankThresholdForEps ε) k) ≤ ε * ↑(C 0)

Rational error-rate specialization: setting r = rankThresholdForEps ε for any 0 < ε yields total capacity above rank r at most ε * C 0.

Closed-form amortized item rank potential itemPhi r k, including an (r : ℚ) credit baseline that pays for root-list suffix-min repairs so shExtractMin stays O(1) independently of r.

Item potential is always at least the baseline credit (r : ℚ).

Item potential is always non-negative.

@[simp]

Initial item potential at rank 0 equals 2 * r + 3.

Every item potential at threshold r is bounded above by 2 * r + 3.

Exact telescoping drop itemPhi r k - itemPhi r (k + 1) = 1 / targetSize r k.