Documentation

CslibFrontier.Computability.CellProbe.Chronogram

Chronogram bookkeeping for cell-probe schemes #

The chronogram method of Fredman and Saks [FS89] proves dynamic cell-probe lower bounds by splitting an update sequence into consecutive epochs and asking which epoch last wrote the cells that a later query probes (see [PD06], §3.1, p. 5, for the history of the method). Here the epoch that last probed a cell stands in for the epoch that last wrote it: a cell that no later epoch probes keeps its contents, and the cells probed later are exactly the ones whose final contents an encoder records.

This file supplies the epoch-independent bookkeeping for a deterministic step-indexed scheme D : IndexedScheme Op Result cells w that runs consecutive operation segments seg 0, seg 1, … from step t₀ and memory m₀.

For a run of L segments and a segment j < L, laterCells is the set of cells probed by segments j + 1, …, L - 1, and lastCells is the set of cells probed by segment j and by no later segment. overlayMem is the memory that a decoder can reconstruct from the memory before segment j together with the final contents of the cells probed afterwards. The main facts are:

At most (cells * (2 ^ w - 1) + 1) ^ r memories lie within Hamming distance r of a fixed memory, which bounds the number of overlays in an encoding argument.

Main definitions #

Main results #

References #

theorem Cslib.CellProbe.card_filter_hammingDist_le_le_pow {cells w : ℕ} (m : Mem cells w) (r : ℕ) :
{m' : Mem cells w | hammingDist m m' ≤ r}.card ≤ (cells * (2 ^ w - 1) + 1) ^ r

At most (cells * (2 ^ w - 1) + 1) ^ r memories of cells cells of w bits lie within Hamming distance r of a fixed memory m: the number of overlays in an encoding argument.

Segments, their start points and their probed cells #

def Cslib.CellProbe.IndexedScheme.segStart {Op : Type u_1} (seg : ℕ → List Op) (t₀ j : ℕ) :

The step index at which segment j starts when the segments seg 0, seg 1, … run consecutively from step t₀.

def Cslib.CellProbe.IndexedScheme.segMem {Op : Type u_1} {Result : Op → Type} {cells w : ℕ} (D : IndexedScheme Op Result cells w) (seg : ℕ → List Op) (t₀ : ℕ) (m₀ : Mem cells w) :
ℕ → Mem cells w

The memory before segment j when D runs the segments seg 0, seg 1, … consecutively from step t₀ and memory m₀.

def Cslib.CellProbe.IndexedScheme.segCells {Op : Type u_1} {Result : Op → Type} {cells w : ℕ} (D : IndexedScheme Op Result cells w) (seg : ℕ → List Op) (t₀ : ℕ) (m₀ : Mem cells w) (j : ℕ) :
Finset (Fin cells)

The cells probed while D runs segment j.

def Cslib.CellProbe.IndexedScheme.laterCells {Op : Type u_1} {Result : Op → Type} {cells w : ℕ} (D : IndexedScheme Op Result cells w) (seg : ℕ → List Op) (t₀ : ℕ) (m₀ : Mem cells w) (L j : ℕ) :
Finset (Fin cells)

The cells probed by the segments strictly between j and L.

def Cslib.CellProbe.IndexedScheme.lastCells {Op : Type u_1} {Result : Op → Type} {cells w : ℕ} (D : IndexedScheme Op Result cells w) (seg : ℕ → List Op) (t₀ : ℕ) (m₀ : Mem cells w) (L j : ℕ) :
Finset (Fin cells)

The cells probed by segment j and by no segment between j and L: the cells whose last probe before step segStart seg t₀ L happened during segment j.

def Cslib.CellProbe.IndexedScheme.overlayMem {Op : Type u_1} {Result : Op → Type} {cells w : ℕ} (D : IndexedScheme Op Result cells w) (seg : ℕ → List Op) (t₀ : ℕ) (m₀ : Mem cells w) (L j : ℕ) :
Mem cells w

The final contents of the cells probed after segment j, laid over the memory before segment j.

@[simp]
theorem Cslib.CellProbe.IndexedScheme.segStart_zero {Op : Type u_1} (seg : ℕ → List Op) (t₀ : ℕ) :
segStart seg t₀ 0 = t₀
theorem Cslib.CellProbe.IndexedScheme.segStart_succ {Op : Type u_1} (seg : ℕ → List Op) (t₀ j : ℕ) :
segStart seg t₀ (j + 1) = segStart seg t₀ j + (seg j).length
@[simp]
theorem Cslib.CellProbe.IndexedScheme.segMem_zero {Op : Type u_1} {Result : Op → Type} {cells w : ℕ} (D : IndexedScheme Op Result cells w) (seg : ℕ → List Op) (t₀ : ℕ) (m₀ : Mem cells w) :
D.segMem seg t₀ m₀ 0 = m₀
theorem Cslib.CellProbe.IndexedScheme.segMem_succ {Op : Type u_1} {Result : Op → Type} {cells w : ℕ} (D : IndexedScheme Op Result cells w) (seg : ℕ → List Op) (t₀ : ℕ) (m₀ : Mem cells w) (j : ℕ) :
D.segMem seg t₀ m₀ (j + 1) = (D.runInterval (segStart seg t₀ j) (D.segMem seg t₀ m₀ j) (seg j)).2
theorem Cslib.CellProbe.IndexedScheme.segStart_congr {Op : Type u_1} (t₀ : ℕ) {seg seg' : ℕ → List Op} {j : ℕ} (h : ∀ k < j, seg k = seg' k) :
segStart seg t₀ j = segStart seg' t₀ j

The start of segment j depends only on the lengths of the segments before it.

theorem Cslib.CellProbe.IndexedScheme.segMem_congr {Op : Type u_1} {Result : Op → Type} {cells w : ℕ} (D : IndexedScheme Op Result cells w) (t₀ : ℕ) (m₀ : Mem cells w) {seg seg' : ℕ → List Op} {j : ℕ} (h : ∀ k < j, seg k = seg' k) :
D.segMem seg t₀ m₀ j = D.segMem seg' t₀ m₀ j

The memory before segment j depends only on the segments before it.

theorem Cslib.CellProbe.IndexedScheme.runInterval_flatMap_range {Op : Type u_1} {Result : Op → Type} {cells w : ℕ} (D : IndexedScheme Op Result cells w) (seg : ℕ → List Op) (t₀ : ℕ) (m₀ : Mem cells w) (L : ℕ) :
(D.runInterval t₀ m₀ (List.flatMap seg (List.range L))).2 = D.segMem seg t₀ m₀ L ∧ t₀ + (List.flatMap seg (List.range L)).length = segStart seg t₀ L

Running the concatenation of the first L segments reaches step segStart seg t₀ L and memory segMem L.

theorem Cslib.CellProbe.IndexedScheme.runInterval_flatMap_range_append {Op : Type u_1} {Result : Op → Type} {cells w : ℕ} (D : IndexedScheme Op Result cells w) (seg : ℕ → List Op) (t₀ : ℕ) (m₀ : Mem cells w) (L : ℕ) (ops : List Op) :
D.runInterval t₀ m₀ (List.flatMap seg (List.range L) ++ ops) = ((D.runInterval t₀ m₀ (List.flatMap seg (List.range L))).1 ++ (D.runInterval (segStart seg t₀ L) (D.segMem seg t₀ m₀ L) ops).1, (D.runInterval (segStart seg t₀ L) (D.segMem seg t₀ m₀ L) ops).2)

Running the first L segments followed by ops runs ops from step segStart seg t₀ L and memory segMem L.

Later and last-touched cells #

theorem Cslib.CellProbe.IndexedScheme.mem_laterCells {Op : Type u_1} {Result : Op → Type} {cells w : ℕ} (D : IndexedScheme Op Result cells w) (seg : ℕ → List Op) (t₀ : ℕ) (m₀ : Mem cells w) {L j : ℕ} {c : Fin cells} :
c ∈ D.laterCells seg t₀ m₀ L j ↔ ∃ (k : ℕ), j < k ∧ k < L ∧ c ∈ D.segCells seg t₀ m₀ k

A cell lies in laterCells L j iff some segment strictly between j and L probes it.

theorem Cslib.CellProbe.IndexedScheme.segCells_subset_laterCells {Op : Type u_1} {Result : Op → Type} {cells w : ℕ} (D : IndexedScheme Op Result cells w) (seg : ℕ → List Op) (t₀ : ℕ) (m₀ : Mem cells w) {L j k : ℕ} (hjk : j < k) (hkL : k < L) :
D.segCells seg t₀ m₀ k ⊆ D.laterCells seg t₀ m₀ L j

Every segment strictly between j and L probes only cells of laterCells L j.

theorem Cslib.CellProbe.IndexedScheme.lastCells_subset_segCells {Op : Type u_1} {Result : Op → Type} {cells w : ℕ} (D : IndexedScheme Op Result cells w) (seg : ℕ → List Op) (t₀ : ℕ) (m₀ : Mem cells w) (L j : ℕ) :
D.lastCells seg t₀ m₀ L j ⊆ D.segCells seg t₀ m₀ j

The cells last touched by segment j are probed by segment j.

theorem Cslib.CellProbe.IndexedScheme.segMem_eq_of_notMem_laterCells {Op : Type u_1} {Result : Op → Type} {cells w : ℕ} (D : IndexedScheme Op Result cells w) (seg : ℕ → List Op) (t₀ : ℕ) (m₀ : Mem cells w) {L j : ℕ} (hjL : j < L) {c : Fin cells} (hc : c ∉ D.laterCells seg t₀ m₀ L j) :
D.segMem seg t₀ m₀ L c = D.segMem seg t₀ m₀ (j + 1) c

Frame across segments: a cell probed by no segment strictly between j and L keeps the contents it had at the end of segment j.

theorem Cslib.CellProbe.IndexedScheme.overlayMem_eq_segMem_of_notMem_laterCells {Op : Type u_1} {Result : Op → Type} {cells w : ℕ} (D : IndexedScheme Op Result cells w) (seg : ℕ → List Op) (t₀ : ℕ) (m₀ : Mem cells w) {L j : ℕ} {c : Fin cells} (hc : c ∉ D.laterCells seg t₀ m₀ L j) :
D.overlayMem seg t₀ m₀ L j c = D.segMem seg t₀ m₀ j c

The overlay agrees with the memory before segment j outside laterCells.

theorem Cslib.CellProbe.IndexedScheme.overlayMem_eq_of_notMem_lastCells {Op : Type u_1} {Result : Op → Type} {cells w : ℕ} (D : IndexedScheme Op Result cells w) (seg : ℕ → List Op) (t₀ : ℕ) (m₀ : Mem cells w) {L j : ℕ} (hjL : j < L) {c : Fin cells} (hc : c ∉ D.lastCells seg t₀ m₀ L j) :
D.overlayMem seg t₀ m₀ L j c = D.segMem seg t₀ m₀ L c

Overlay agreement: the overlay agrees with the memory after all L segments outside the cells last touched by segment j.

theorem Cslib.CellProbe.IndexedScheme.hammingDist_overlayMem_le {Op : Type u_1} {Result : Op → Type} {cells w : ℕ} (D : IndexedScheme Op Result cells w) (seg : ℕ → List Op) (t₀ : ℕ) (m₀ : Mem cells w) (L j : ℕ) :
hammingDist (D.segMem seg t₀ m₀ j) (D.overlayMem seg t₀ m₀ L j) ≤ (D.laterCells seg t₀ m₀ L j).card

The overlay differs from the memory before segment j on at most #laterCells cells.

theorem Cslib.CellProbe.IndexedScheme.disjoint_lastCells {Op : Type u_1} {Result : Op → Type} {cells w : ℕ} (D : IndexedScheme Op Result cells w) (seg : ℕ → List Op) (t₀ : ℕ) (m₀ : Mem cells w) {L j k : ℕ} (hj : j < L) (hk : k < L) (hjk : j ≠ k) :
Disjoint (D.lastCells seg t₀ m₀ L j) (D.lastCells seg t₀ m₀ L k)

The cells last touched by different segments j, k < L are disjoint.

theorem Cslib.CellProbe.IndexedScheme.pairwiseDisjoint_lastCells {Op : Type u_1} {Result : Op → Type} {cells w : ℕ} (D : IndexedScheme Op Result cells w) (seg : ℕ → List Op) (t₀ : ℕ) (m₀ : Mem cells w) (L : ℕ) :
(↑(Finset.range L)).PairwiseDisjoint (D.lastCells seg t₀ m₀ L)

The cells last touched by the segments j < L form a pairwise disjoint family.

theorem Cslib.CellProbe.IndexedScheme.card_filter_lastCells_le {Op : Type u_1} {Result : Op → Type} {cells w : ℕ} (D : IndexedScheme Op Result cells w) (seg : ℕ → List Op) (t₀ : ℕ) (m₀ : Mem cells w) (L : ℕ) (P : Finset (Fin cells)) :
{j ∈ Finset.range L | (P ∩ D.lastCells seg t₀ m₀ L j).Nonempty}.card ≤ P.card

Epoch counting: a set P of cells meets the last-touched sets of at most #P segments.

Probe counts under a uniform depth bound #

theorem Cslib.CellProbe.IndexedScheme.probesInterval_le_mul_length {Op : Type u_1} {Result : Op → Type} {cells w : ℕ} (D : IndexedScheme Op Result cells w) {d : ℕ} (t : ℕ) (m : Mem cells w) (ops : List Op) (hd : ∀ (t : ℕ), ∀ o ∈ ops, (D.step t o).depth ≤ d) :
D.probesInterval t m ops ≤ d * ops.length

If every step on the operations of ops has depth at most d, running ops makes at most d * ops.length probes.

theorem Cslib.CellProbe.IndexedScheme.card_laterCells_le {Op : Type u_1} {Result : Op → Type} {cells w : ℕ} (D : IndexedScheme Op Result cells w) (seg : ℕ → List Op) (t₀ : ℕ) (m₀ : Mem cells w) {d L j : ℕ} (hd : ∀ k ∈ Finset.Ioo j L, ∀ (t : ℕ), ∀ o ∈ seg k, (D.step t o).depth ≤ d) :
(D.laterCells seg t₀ m₀ L j).card ≤ d * ∑ k ∈ Finset.Ioo j L, (seg k).length

If every step on the operations of the segments between j and L has depth at most d, those segments probe at most d * Σ |seg k| cells.

Replaying a query on the overlay #

theorem Cslib.CellProbe.IndexedScheme.run_overlayMem_eq {Op : Type u_1} {Result : Op → Type} {cells w : ℕ} (D : IndexedScheme Op Result cells w) (seg : ℕ → List Op) (t₀ : ℕ) (m₀ : Mem cells w) {α : Type} {L j : ℕ} (hjL : j < L) (t : ProbeTree cells w α) (h : Disjoint (t.probedCells (D.segMem seg t₀ m₀ L)) (D.lastCells seg t₀ m₀ L j)) :
(t.run (D.overlayMem seg t₀ m₀ L j)).1 = (t.run (D.segMem seg t₀ m₀ L)).1 ∧ t.probes (D.overlayMem seg t₀ m₀ L j) = t.probes (D.segMem seg t₀ m₀ L)

Query replay: a tree whose probed cells on the final memory avoid the cells last touched by segment j answers identically, with the same probes, on the overlay.