OAI/Combinatorics/LowSpaceSubsetSum/Separators/SeparatorTraversal.lean
13 declarations, 0 contain sorry, 0 declared as axioms
Depth-first separator interval traversal
Only the received arrays, their filtered children and a scalar result are retained. A branch whose filtered arrays are empty ends immediately. The binary interval queries refer to the precomputed incidence arrays. The terminal callback is the next block, or the final exact-weight search.
- structure
OAI.LowSpaceSubsetSum.SeparatorTraversal.Resultline 20 - def
OAI.LowSpaceSubsetSum.SeparatorTraversal.keepline 26 - def
OAI.LowSpaceSubsetSum.SeparatorTraversal.finishline 29 - def
OAI.LowSpaceSubsetSum.SeparatorTraversal.runline 35Source documentation
The ledger completes both children, so acceptance can only save work.
def run (inc₁ : α → Array ℕ) (inc₂ : β → Array ℕ) (leaf : ℕ → List α → List β → Result) : ℕ → ℕ → ℕ → List α → List β → Result | 0, lo, hi, xs, ys => let left := keep inc₁ lo hi xs …Mentions: OAI.LowSpaceSubsetSum.SeparatorTraversal.Result, OAI.LowSpaceSubsetSum.SeparatorTraversal.keep
- theorem
OAI.LowSpaceSubsetSum.SeparatorTraversal.keep_memline 57 - theorem
OAI.LowSpaceSubsetSum.SeparatorTraversal.keep_lengthline 61 - def
OAI.LowSpaceSubsetSum.SeparatorTraversal.Witnessline 64 - theorem
OAI.LowSpaceSubsetSum.SeparatorTraversal.witness_emptyline 69 - theorem
OAI.LowSpaceSubsetSum.SeparatorTraversal.witness_singletonline 86 - theorem
OAI.LowSpaceSubsetSum.SeparatorTraversal.witness_splitline 106 - theorem
OAI.LowSpaceSubsetSum.SeparatorTraversal.correctline 129 - theorem
OAI.LowSpaceSubsetSum.SeparatorTraversal.peak_leline 169Source documentation
Retaining parent buffers through both children costs only depth times input length, plus the terminal callback's workspace.
theorem peak_le (inc₁ : α → Array ℕ) (inc₂ : β → Array ℕ) (leaf : ℕ → List α → List β → Result) (L : ℕ) (hleaf : ∀ j xs ys, (leaf j xs ys).peak ≤ L) (k lo hi : ℕ) (xs : List α) (ys : List β) : (run inc₁ inc₂ leaf k lo hi xs ys).peak ≤ 2 * (k + 1) * (xs.length + ys.length) + L := by …Mentions: OAI.LowSpaceSubsetSum.SeparatorTraversal.Result, OAI.LowSpaceSubsetSum.SeparatorTraversal.run
- theorem
OAI.LowSpaceSubsetSum.SeparatorTraversal.peak_le_capacityline 200Source documentation
Retaining parent buffers through both children costs only depth times input length, plus the terminal callback's workspace.
theorem peak_le_capacity (inc₁ : α → Array ℕ) (inc₂ : β → Array ℕ) (leaf : ℕ → List α → List β → Result) (C L : ℕ) (hleaf : ∀ j xs ys, xs.length + ys.length ≤ C → (leaf j xs ys).peak ≤ L) (k lo hi : ℕ) (xs : List α) (ys : List β) (hsize : xs.length + ys.length ≤ C) : (run inc₁ inc₂ leaf k lo hi xs ys).peak ≤ 2 * (k + 1) * (xs.length + ys.length) + L := by …Mentions: OAI.LowSpaceSubsetSum.SeparatorTraversal.Result, OAI.LowSpaceSubsetSum.SeparatorTraversal.run