Documentation

CslibFrontier.DataStructure.Dictionary.DoubleHashing

Odd-Stride Double Hashing under Limited Independence and Double Tabulation #

This module proves $O(1)$ expected probes for power-of-two odd-stride double hashing oddStridePerm h₁ h₂ u i = (h₁(u) + i * (2 * h₂(u) + 1)) mod 2 ^ M ([CLRS09], Section 11.4, pp. 272–274) over open-addressed tables Cslib.DataStructure.Dictionary.UniformProbing.Table U (2 ^ M) with key universe size U, table bit-width M (m = 2 ^ M slots), and maximum stored key count n_max. The bound holds both under $(2 L + 1)$-wise independence for probe cutoff L = maxProbeCutoff n_max = Nat.clog 2 (max n_max 4) + 4 and under Mikkel Thorup's Double Tabulation ([Thorup2013], Theorem 1(a) and Lemma 2) with c characters of b bits (U ≤ 2 ^ (c * b)) or polynomial universe exponent c_exp (U ≤ max n_max 4 ^ c_exp).

Under the hypotheses of the cited theorems, the expected probe count is at most 2 under $(2 L + 1)$-wise independence (expect_probeCount_oddStride_of_kWiseIndependent) and at most 3 under Double Tabulation with an explicit code bound (expect_probeCount_oddStride_doubleTab_of_codeBound_le). For the exponent c_exp, the bound 3 is proved for doubleTabThreshold c_exp ≤ n_max (expect_probeCount_oddStride_doubleTab_le), where doubleTabThreshold c_exp = 2 ^ (2 * doubleTabMinB c_exp) ≥ 2 ^ 25088. Below the threshold the proof uses only the deterministic bound probeCount ≤ n_max + 1 (probeCount_le_add_one), valid for every probe permutation family representing the table; together the two cases give max (doubleTabThreshold c_exp : ℝ≥0∞) 3 for every n_max (expect_probeCount_oddStride_unconditional_le).

Source statements and notation mapping #

Main definitions #

Main results #

References #

Section 1: Acyclic Insertion-Order Invariant (OrderedTableRep) #

Open-addressed table representation invariant extending TableRep π s T with an acyclic insertion-order witness rank : Fin U → ℕ: for every stored key w ∈ Dictionary.dom s and every failed probe index i : Fin m with i.val < missedProbes (otherOccupiedSlots T w) (π w), the slot π w i holds a distinct key y ∈ (Dictionary.dom s).erase w with rank y < rank w.

The empty table satisfies OrderedTableRep under any permutation family π.

Preservation of OrderedTableRep under tableInsert: if OrderedTableRep π s T and (otherOccupiedSlots T u).card < m, then tableInsert hm π T u v satisfies OrderedTableRep π (Function.update s u (some v)).

Convenience wrapper for OrderedTableRep.tableInsert when (Dictionary.dom s).card < m.

theorem Cslib.DataStructure.Dictionary.DoubleHashing.orderedTableRep_runTableFrom {U V n_max m : ℕ} (hm : 0 < m) (hcap : n_max ≤ m) (π : Fin U → Equiv.Perm (Fin m)) {s : State U} {T : UniformProbing.Table U m} (hrep : OrderedTableRep π s T) (hs : (dom s).card ≤ n_max) {ops : List (Op U)} (hvh : (spec U V n_max).ValidHistory s ops) :
OrderedTableRep π ((spec U V n_max).run s ops).1 (UniformProbing.runTableFrom hm π T ops)

Any valid operation history preserves OrderedTableRep.

theorem Cslib.DataStructure.Dictionary.DoubleHashing.orderedTableRep_runTable {U V n_max m : ℕ} (hm : 0 < m) (hcap : n_max ≤ m) (π : Fin U → Equiv.Perm (Fin m)) {ops : List (Op U)} (hvh : (spec U V n_max).ValidHistory (empty U) ops) :
OrderedTableRep π ((spec U V n_max).run (empty U) ops).1 (UniformProbing.runTable hm π ops)

Running any valid operation history from emptyTable U m produces a table satisfying OrderedTableRep.

Every finite dictionary state s with (Dictionary.dom s).card ≤ m admits an open-addressed table T : Table U m satisfying OrderedTableRep π s T for any permutation family π : Fin U → Equiv.Perm (Fin m).

Section 2: Odd-Stride Double-Hashing Probe Permutation on Fin (2 ^ M) #

def Cslib.DataStructure.Dictionary.DoubleHashing.oddStrideSeq (M : ℕ) (p : Fin (2 ^ M)) (s : Fin (2 ^ (M - 1))) (i : Fin (2 ^ M)) :
Fin (2 ^ M)

Power-of-two odd-stride double-hashing probe sequence oddStrideSeq M p s i = (p + i * (2 * s + 1)) mod 2 ^ M on Fin (2 ^ M) ([CLRS09], Section 11.4, "Double hashing", pp. 272–274).

Because 2 * s.val + 1 is odd and therefore coprime to 2 ^ M, oddStrideSeq M p s is a bijection on Fin (2 ^ M) for every p and s.

noncomputable def Cslib.DataStructure.Dictionary.DoubleHashing.oddStridePermOfPair (M : ℕ) (p : Fin (2 ^ M)) (s : Fin (2 ^ (M - 1))) :
Equiv.Perm (Fin (2 ^ M))

Noncomputable full-cycle permutation Equiv.Perm (Fin (2 ^ M)) induced by primary hash value p : Fin (2 ^ M) and stride index s : Fin (2 ^ (M - 1)).

@[simp]
theorem Cslib.DataStructure.Dictionary.DoubleHashing.oddStridePermOfPair_apply (M : ℕ) (p : Fin (2 ^ M)) (s : Fin (2 ^ (M - 1))) (i : Fin (2 ^ M)) :
noncomputable def Cslib.DataStructure.Dictionary.DoubleHashing.oddStridePerm {U M : ℕ} (h₁ : Fin U → Fin (2 ^ M)) (h₂ : Fin U → Fin (2 ^ (M - 1))) (u : Fin U) :
Equiv.Perm (Fin (2 ^ M))

Odd-stride double-hashing permutation family Fin U → Equiv.Perm (Fin (2 ^ M)) constructed from a primary hash function h₁ : Fin U → Fin (2 ^ M) and a half-range stride hash function h₂ : Fin U → Fin (2 ^ (M - 1)).

@[simp]
theorem Cslib.DataStructure.Dictionary.DoubleHashing.oddStridePerm_apply {U M : ℕ} (h₁ : Fin U → Fin (2 ^ M)) (h₂ : Fin U → Fin (2 ^ (M - 1))) (u : Fin U) (i : Fin (2 ^ M)) :
(oddStridePerm h₁ h₂ u) i = oddStrideSeq M (h₁ u) (h₂ u) i
theorem Cslib.DataStructure.Dictionary.DoubleHashing.val_oddStridePerm {U M : ℕ} (h₁ : Fin U → Fin (2 ^ M)) (h₂ : Fin U → Fin (2 ^ (M - 1))) (u : Fin U) (i : Fin (2 ^ M)) :
↑((oddStridePerm h₁ h₂ u) i) = (↑(h₁ u) + ↑i * (2 * ↑(h₂ u) + 1)) % 2 ^ M

Section 3: Dependency Sets and the Minimal Overflow Dichotomy #

Maximum probe-depth cutoff L = Nat.clog 2 (max n_max 4) + 4 for the partial dependency dichotomy ([SS90], Theorem 1).

Section 4: BFS Spanning-Tree Witness and (2 * L + 1)-Wise Independent Probe Bound #

theorem Cslib.DataStructure.Dictionary.DoubleHashing.sum_probeCount_oddStride_le_of_kWiseIndependent {Θ₁ : Type u_1} {Θ₂ : Type u_2} [Fintype Θ₁] [Fintype Θ₂] {U M n_max : ℕ} {h₁ : Θ₁ → Fin U → Fin (2 ^ M)} {h₂ : Θ₂ → Fin U → Fin (2 ^ (M - 1))} (hh₁ : Probability.IsKWiseIndependentHash (2 * maxProbeCutoff n_max + 1) h₁) (hh₂ : Probability.IsKWiseIndependentHash (2 * maxProbeCutoff n_max + 1) h₂) (hM : 1 ≤ M) (hload : 32 * max n_max 4 ≤ 2 ^ M) (hw4 : 2 * (2 * maxProbeCutoff n_max) ^ 4 ≤ 2 ^ M) {s : State U} {T : Θ₁ × Θ₂ → UniformProbing.Table U (2 ^ M)} (hrep : ∀ (θ : Θ₁ × Θ₂), OrderedTableRep (oddStridePerm (h₁ θ.1) (h₂ θ.2)) s (T θ)) (hdom : (dom s).card ≤ n_max) (u : Fin U) :
∑ θ : Θ₁ × Θ₂, UniformProbing.probeCount (T θ) u (oddStridePerm (h₁ θ.1) (h₂ θ.2) u) ≤ 2 * Fintype.card (Θ₁ × Θ₂)

Seed-Sum Probe-Count Bound under (2 * L + 1)-Wise Independence: for 1 ≤ M, 32 * max n_max 4 ≤ 2 ^ M, 2 * (2 * maxProbeCutoff n_max) ^ 4 ≤ 2 ^ M, and any (2 * maxProbeCutoff n_max + 1)-wise independent hash families h₁ and h₂, the sum of probeCount (T θ) u (oddStridePerm (h₁ θ.1) (h₂ θ.2) u) over all θ : Θ₁ × Θ₂ is at most 2 * Fintype.card (Θ₁ × Θ₂).

theorem Cslib.DataStructure.Dictionary.DoubleHashing.expect_probeCount_oddStride_of_kWiseIndependent {Θ₁ : Type u_1} {Θ₂ : Type u_2} [Fintype Θ₁] [Fintype Θ₂] [Nonempty Θ₁] [Nonempty Θ₂] {U M n_max : ℕ} {h₁ : Θ₁ → Fin U → Fin (2 ^ M)} {h₂ : Θ₂ → Fin U → Fin (2 ^ (M - 1))} (hh₁ : Probability.IsKWiseIndependentHash (2 * maxProbeCutoff n_max + 1) h₁) (hh₂ : Probability.IsKWiseIndependentHash (2 * maxProbeCutoff n_max + 1) h₂) (hM : 1 ≤ M) (hload : 32 * max n_max 4 ≤ 2 ^ M) (hw4 : 2 * (2 * maxProbeCutoff n_max) ^ 4 ≤ 2 ^ M) {s : State U} {T : Θ₁ × Θ₂ → UniformProbing.Table U (2 ^ M)} (hrep : ∀ (θ : Θ₁ × Θ₂), OrderedTableRep (oddStridePerm (h₁ θ.1) (h₂ θ.2)) s (T θ)) (hdom : (dom s).card ≤ n_max) (u : Fin U) :
∑' (θ : Θ₁ × Θ₂), (Probability.PMF.uniformOfFintype (Θ₁ × Θ₂)) θ * ↑(UniformProbing.probeCount (T θ) u (oddStridePerm (h₁ θ.1) (h₂ θ.2) u)) ≤ 2

Expected Probe-Count Bound under (2 * L + 1)-Wise Independence: under the hypotheses of sum_probeCount_oddStride_le_of_kWiseIndependent, the expected probe count of u under PMF.uniformOfFintype (Θ₁ × Θ₂) is at most 2 ([SS90], Theorem 1).

Section 5: High-Probability Conditioning Bridge & Double Tabulation Instantiation #

noncomputable def Cslib.DataStructure.Dictionary.DoubleHashing.twoStageOddStridePerm {Θ_top₁ : Type u_1} {Θ_bot₁ : Type u_2} {Θ_top₂ : Type u_3} {Θ_bot₂ : Type u_4} {U M : ℕ} (H₁ : Θ_top₁ → Θ_bot₁ → Fin U → Fin (2 ^ M)) (H₂ : Θ_top₂ → Θ_bot₂ → Fin U → Fin (2 ^ (M - 1))) :
(Θ_top₁ × Θ_bot₁) × Θ_top₂ × Θ_bot₂ → Fin U → Equiv.Perm (Fin (2 ^ M))

Odd-stride double-hashing permutation family on a two-stage seed pair ((top₁, bottom₁), (top₂, bottom₂)) : (Θ_top₁ × Θ_bot₁) × (Θ_top₂ × Θ_bot₂).

theorem Cslib.DataStructure.Dictionary.DoubleHashing.twoStageOddStridePerm_apply {Θ_top₁ : Type u_1} {Θ_bot₁ : Type u_2} {Θ_top₂ : Type u_3} {Θ_bot₂ : Type u_4} {U M : ℕ} (H₁ : Θ_top₁ → Θ_bot₁ → Fin U → Fin (2 ^ M)) (H₂ : Θ_top₂ → Θ_bot₂ → Fin U → Fin (2 ^ (M - 1))) (top₁ : Θ_top₁) (bottom₁ : Θ_bot₁) (top₂ : Θ_top₂) (bottom₂ : Θ_bot₂) :
twoStageOddStridePerm H₁ H₂ ((top₁, bottom₁), top₂, bottom₂) = oddStridePerm (H₁ top₁ bottom₁) (H₂ top₂ bottom₂)
theorem Cslib.DataStructure.Dictionary.DoubleHashing.sum_probeCount_oddStride_of_whp_kWiseIndependent {Θ_top₁ : Type u_1} {Θ_bot₁ : Type u_2} {Θ_top₂ : Type u_3} {Θ_bot₂ : Type u_4} [Fintype Θ_top₁] [Fintype Θ_bot₁] [Fintype Θ_top₂] [Fintype Θ_bot₂] {U M n_max : ℕ} {H₁ : Θ_top₁ → Θ_bot₁ → Fin U → Fin (2 ^ M)} {H₂ : Θ_top₂ → Θ_bot₂ → Fin U → Fin (2 ^ (M - 1))} (Good₁ : Θ_top₁ → Prop) (Good₂ : Θ_top₂ → Prop) [DecidablePred Good₁] [DecidablePred Good₂] (hk₁ : ∀ (top₁ : Θ_top₁), Good₁ top₁ → Probability.IsKWiseIndependentHash (2 * maxProbeCutoff n_max + 1) (H₁ top₁)) (hk₂ : ∀ (top₂ : Θ_top₂), Good₂ top₂ → Probability.IsKWiseIndependentHash (2 * maxProbeCutoff n_max + 1) (H₂ top₂)) (hbad₁ : 2 * {top₁ : Θ_top₁ | ¬Good₁ top₁}.card * (n_max + 1) ≤ Fintype.card Θ_top₁) (hbad₂ : 2 * {top₂ : Θ_top₂ | ¬Good₂ top₂}.card * (n_max + 1) ≤ Fintype.card Θ_top₂) (hM : 1 ≤ M) (hload : 32 * max n_max 4 ≤ 2 ^ M) (hw4 : 2 * (2 * maxProbeCutoff n_max) ^ 4 ≤ 2 ^ M) {s : State U} {T : (Θ_top₁ × Θ_bot₁) × Θ_top₂ × Θ_bot₂ → UniformProbing.Table U (2 ^ M)} (hrep : ∀ (θ : (Θ_top₁ × Θ_bot₁) × Θ_top₂ × Θ_bot₂), OrderedTableRep (twoStageOddStridePerm H₁ H₂ θ) s (T θ)) (hdom : (dom s).card ≤ n_max) (u : Fin U) :
∑ θ : (Θ_top₁ × Θ_bot₁) × Θ_top₂ × Θ_bot₂, UniformProbing.probeCount (T θ) u (twoStageOddStridePerm H₁ H₂ θ u) ≤ 3 * Fintype.card ((Θ_top₁ × Θ_bot₁) × Θ_top₂ × Θ_bot₂)

High-Probability Conditioning Bridge for Odd-Stride Double Hashing: if H₁ top₁ and H₂ top₂ are (2 * maxProbeCutoff n_max + 1)-wise independent whenever Good₁ top₁ and Good₂ top₂ hold, and the bad top-seed sets Finset.univ.filter (¬ Goodᵢ ·) each have density at most 1 / (2 * (n_max + 1)), then the sum of probeCount over all seeds θ : (Θ_top₁ × Θ_bot₁) × (Θ_top₂ × Θ_bot₂) is at most 3 times the total number of seeds.

theorem Cslib.DataStructure.Dictionary.DoubleHashing.expect_probeCount_oddStride_of_whp_kWiseIndependent {Θ_top₁ : Type u_1} {Θ_bot₁ : Type u_2} {Θ_top₂ : Type u_3} {Θ_bot₂ : Type u_4} [Fintype Θ_top₁] [Fintype Θ_bot₁] [Fintype Θ_top₂] [Fintype Θ_bot₂] [Nonempty Θ_top₁] [Nonempty Θ_bot₁] [Nonempty Θ_top₂] [Nonempty Θ_bot₂] {U M n_max : ℕ} {H₁ : Θ_top₁ → Θ_bot₁ → Fin U → Fin (2 ^ M)} {H₂ : Θ_top₂ → Θ_bot₂ → Fin U → Fin (2 ^ (M - 1))} (Good₁ : Θ_top₁ → Prop) (Good₂ : Θ_top₂ → Prop) [DecidablePred Good₁] [DecidablePred Good₂] (hk₁ : ∀ (top₁ : Θ_top₁), Good₁ top₁ → Probability.IsKWiseIndependentHash (2 * maxProbeCutoff n_max + 1) (H₁ top₁)) (hk₂ : ∀ (top₂ : Θ_top₂), Good₂ top₂ → Probability.IsKWiseIndependentHash (2 * maxProbeCutoff n_max + 1) (H₂ top₂)) (hbad₁ : 2 * {top₁ : Θ_top₁ | ¬Good₁ top₁}.card * (n_max + 1) ≤ Fintype.card Θ_top₁) (hbad₂ : 2 * {top₂ : Θ_top₂ | ¬Good₂ top₂}.card * (n_max + 1) ≤ Fintype.card Θ_top₂) (hM : 1 ≤ M) (hload : 32 * max n_max 4 ≤ 2 ^ M) (hw4 : 2 * (2 * maxProbeCutoff n_max) ^ 4 ≤ 2 ^ M) {s : State U} {T : (Θ_top₁ × Θ_bot₁) × Θ_top₂ × Θ_bot₂ → UniformProbing.Table U (2 ^ M)} (hrep : ∀ (θ : (Θ_top₁ × Θ_bot₁) × Θ_top₂ × Θ_bot₂), OrderedTableRep (twoStageOddStridePerm H₁ H₂ θ) s (T θ)) (hdom : (dom s).card ≤ n_max) (u : Fin U) :
∑' (θ : (Θ_top₁ × Θ_bot₁) × Θ_top₂ × Θ_bot₂), (Probability.PMF.uniformOfFintype ((Θ_top₁ × Θ_bot₁) × Θ_top₂ × Θ_bot₂)) θ * ↑(UniformProbing.probeCount (T θ) u (twoStageOddStridePerm H₁ H₂ θ u)) ≤ 3

Expected Probe-Count Bound under High-Probability (2 * L + 1)-Wise Independence: under the hypotheses of sum_probeCount_oddStride_of_whp_kWiseIndependent, the expected probe count of u under PMF.uniformOfFintype ((Θ_top₁ × Θ_bot₁) × (Θ_top₂ × Θ_bot₂)) is at most 3.

@[reducible, inline]

Seed space for odd-stride double hashing instantiated with two independent copies of Mikkel Thorup's Double Tabulation ([Thorup2013], Theorem 1(a)), into Fin (2 ^ M) and Fin (2 ^ (M - 1)).

Odd-stride double-hashing permutation family driven by two independent doubleTabHash instances ([Thorup2013], Theorem 1(a)).

theorem Cslib.DataStructure.Dictionary.DoubleHashing.sum_probeCount_oddStride_doubleTab_of_codeBound_le {c b U M n_max : ℕ} (hc : 1 ≤ c) (hU : U ≤ 2 ^ (c * b)) (hM : 1 ≤ M) (hload : 32 * max n_max 4 ≤ 2 ^ M) (hw4 : 2 * (2 * maxProbeCutoff n_max) ^ 4 ≤ 2 ^ M) (hbound : 2 * (n_max + 1) * Probability.doubleTabCodeBound c (8 * c) 4 (2 * maxProbeCutoff n_max + 1) ≤ 2 ^ (3 * b)) {s : State U} {T : DoubleTabOddStrideSeed c b M → UniformProbing.Table U (2 ^ M)} (hrep : ∀ (θ : DoubleTabOddStrideSeed c b M), OrderedTableRep (doubleTabOddStridePerm c b U M θ) s (T θ)) (hdom : (dom s).card ≤ n_max) (u : Fin U) :

Double Tabulation Summed Probe-Count Bound under Explicit Code Bound ([Thorup2013], Theorem 1(a) & [SchmidtSiegel1990], Theorem 1): when 1 ≤ c, U ≤ 2 ^ (c * b), 1 ≤ M, 32 * max n_max 4 ≤ 2 ^ M, 2 * (2 * maxProbeCutoff n_max) ^ 4 ≤ 2 ^ M, and 2 * (n_max + 1) * doubleTabCodeBound c (8 * c) 4 (2 * maxProbeCutoff n_max + 1) ≤ 2 ^ (3 * b), the sum of probeCount over all seeds in DoubleTabOddStrideSeed c b M is at most 3 times the total number of seeds.

theorem Cslib.DataStructure.Dictionary.DoubleHashing.expect_probeCount_oddStride_doubleTab_of_codeBound_le {c b U M n_max : ℕ} (hc : 1 ≤ c) (hU : U ≤ 2 ^ (c * b)) (hM : 1 ≤ M) (hload : 32 * max n_max 4 ≤ 2 ^ M) (hw4 : 2 * (2 * maxProbeCutoff n_max) ^ 4 ≤ 2 ^ M) (hbound : 2 * (n_max + 1) * Probability.doubleTabCodeBound c (8 * c) 4 (2 * maxProbeCutoff n_max + 1) ≤ 2 ^ (3 * b)) {s : State U} {T : DoubleTabOddStrideSeed c b M → UniformProbing.Table U (2 ^ M)} (hrep : ∀ (θ : DoubleTabOddStrideSeed c b M), OrderedTableRep (doubleTabOddStridePerm c b U M θ) s (T θ)) (hdom : (dom s).card ≤ n_max) (u : Fin U) :

Expected Probe-Count Bound for Double Tabulation Odd-Stride Double Hashing under Explicit Code Bound: under the hypotheses of sum_probeCount_oddStride_doubleTab_of_codeBound_le, the expected probe count of u under PMF.uniformOfFintype (DoubleTabOddStrideSeed c b M) is at most 3.

@[reducible, inline]

Canonical Double Tabulation seed space for odd-stride double hashing at polynomial universe exponent c_exp, capacity n_max, and table bit-width M.

noncomputable def Cslib.DataStructure.Dictionary.DoubleHashing.doubleHashOddStridePerm (c_exp n_max U M : ℕ) :
DoubleHashSeed c_exp n_max M → Fin U → Equiv.Perm (Fin (2 ^ M))

Canonical Double Tabulation odd-stride permutation family at polynomial universe exponent c_exp, capacity n_max, universe size U, and table bit-width M.

theorem Cslib.DataStructure.Dictionary.DoubleHashing.sum_probeCount_oddStride_doubleTab_le {c_exp n_max U M : ℕ} (hge : Probability.doubleTabThreshold c_exp ≤ n_max) (hU : U ≤ max n_max 4 ^ c_exp) (hm : 32 * max n_max 4 ≤ 2 ^ M) {s : State U} {T : DoubleHashSeed c_exp n_max M → UniformProbing.Table U (2 ^ M)} (hrep : ∀ (θ : DoubleHashSeed c_exp n_max M), OrderedTableRep (doubleHashOddStridePerm c_exp n_max U M θ) s (T θ)) (hdom : (dom s).card ≤ n_max) (u : Fin U) :
∑ θ : DoubleHashSeed c_exp n_max M, UniformProbing.probeCount (T θ) u (doubleHashOddStridePerm c_exp n_max U M θ u) ≤ 3 * Fintype.card (DoubleHashSeed c_exp n_max M)

Summed Probe-Count Bound for Double Tabulation Odd-Stride Double Hashing above doubleTabThreshold c_exp ([Thorup2013], Theorem 1(a) & [SchmidtSiegel1990], Theorem 1): whenever doubleTabThreshold c_exp ≤ n_max, U ≤ max n_max 4 ^ c_exp, and 32 * max n_max 4 ≤ 2 ^ M, the sum of probeCount over all seeds in DoubleHashSeed c_exp n_max M is at most 3 times the total number of seeds.

theorem Cslib.DataStructure.Dictionary.DoubleHashing.expect_probeCount_oddStride_doubleTab_le {c_exp n_max U M : ℕ} (hge : Probability.doubleTabThreshold c_exp ≤ n_max) (hU : U ≤ max n_max 4 ^ c_exp) (hm : 32 * max n_max 4 ≤ 2 ^ M) {s : State U} {T : DoubleHashSeed c_exp n_max M → UniformProbing.Table U (2 ^ M)} (hrep : ∀ (θ : DoubleHashSeed c_exp n_max M), OrderedTableRep (doubleHashOddStridePerm c_exp n_max U M θ) s (T θ)) (hdom : (dom s).card ≤ n_max) (u : Fin U) :
∑' (θ : DoubleHashSeed c_exp n_max M), (Probability.PMF.uniformOfFintype (DoubleHashSeed c_exp n_max M)) θ * ↑(UniformProbing.probeCount (T θ) u (doubleHashOddStridePerm c_exp n_max U M θ u)) ≤ 3

O(1) Expected Probes (≤ 3) for Double Tabulation Odd-Stride Double Hashing above doubleTabThreshold c_exp ([Thorup2013], Theorem 1(a) & [SchmidtSiegel1990], Theorem 1): whenever doubleTabThreshold c_exp ≤ n_max, U ≤ max n_max 4 ^ c_exp, and 32 * max n_max 4 ≤ 2 ^ M, the expected probe count of u under PMF.uniformOfFintype (DoubleHashSeed c_exp n_max M) is at most 3.

theorem Cslib.DataStructure.Dictionary.DoubleHashing.expect_probeCount_oddStride_unconditional_le {c_exp n_max U M : ℕ} (hU : U ≤ max n_max 4 ^ c_exp) (hm : 32 * max n_max 4 ≤ 2 ^ M) {s : State U} {T : DoubleHashSeed c_exp n_max M → UniformProbing.Table U (2 ^ M)} (hrep : ∀ (θ : DoubleHashSeed c_exp n_max M), OrderedTableRep (doubleHashOddStridePerm c_exp n_max U M θ) s (T θ)) (hdom : (dom s).card ≤ n_max) (u : Fin U) :
∑' (θ : DoubleHashSeed c_exp n_max M), (Probability.PMF.uniformOfFintype (DoubleHashSeed c_exp n_max M)) θ * ↑(UniformProbing.probeCount (T θ) u (doubleHashOddStridePerm c_exp n_max U M θ u)) ≤ max (↑(Probability.doubleTabThreshold c_exp)) 3

O_{c_exp}(1) Expected Probe-Count Bound without a Threshold on n_max : ℕ: whenever U ≤ max n_max 4 ^ c_exp and 32 * max n_max 4 ≤ 2 ^ M, combining the deterministic full-cycle pigeonhole bound probeCount ≤ n_max + 1 ≤ doubleTabThreshold c_exp for n_max < doubleTabThreshold c_exp with the Double Tabulation bound ≤ 3 for doubleTabThreshold c_exp ≤ n_max yields expected probe count at most max (doubleTabThreshold c_exp : ℝ≥0∞) 3 = doubleTabThreshold c_exp for every n_max : ℕ. Below the threshold the bound uses no independence property of Double Tabulation.