Documentation

CslibFrontier.DataStructure.Dictionary.FeistelPerm

Assumption-free Feistel permutation families (Lemmas 5.1–5.2 and Corollaries B.5–B.6) #

This module formalizes the one-round Feistel hash permutation families used for multi-level child routing (ℋ_ℓ^ch) and key-ID compression (ℋ_ℓ^id) in Tianxiao Li, Jingxun Liang, Huacheng Yu, and Renfei Zhou, "Dynamic Dictionary with Subconstant Wasted Bits per Key", Proc. 2024 Annual ACM-SIAM Symposium on Discrete Algorithms (SODA 2024), pp. 171–207 [LLYZ24] (arXiv:2310.20536v1, Section 5.4, PDF pp. 30–33 / printed pp. 29–32, Lemmas 5.1–5.2; Appendix B, PDF pp. 41–44 / printed pp. 40–43, Definition B.1, Claim B.2, Claim B.3, Theorem B.4, and Corollaries B.5–B.6).

Source statements, notation mapping, and proof adaptations #

In [LLYZ24] (arXiv:2310.20536v1):

Main definitions #

Main results #

References #

Section 1: Mixed-domain one-round Feistel involution #

(Definition B.1, Corollaries B.5–B.6)

def Cslib.DataStructure.Dictionary.FeistelPerm.feistelHead {s : ℕ} {α : Type u_1} (f : α → Fin (2 ^ s)) (x : Fin (2 ^ s) × α) :
Fin (2 ^ s)

The s-bit Feistel head projection x_L ^^^ f x_R (ĥ(x) in Appendix B of [LLYZ24], arXiv:2310.20536v1, Proof of Lemma 5.1, PDF p. 41 / printed p. 40, and Corollaries B.5–B.6, PDF pp. 43–44 / printed pp. 42–43).

def Cslib.DataStructure.Dictionary.FeistelPerm.feistelPair {s : ℕ} {α : Type u_1} (f : α → Fin (2 ^ s)) (x : Fin (2 ^ s) × α) :
Fin (2 ^ s) × α

Mixed-domain one-round Feistel map (x_L, x_R) ↦ (x_L ^^^ f x_R, x_R) (Definition B.1, PDF p. 41 / printed p. 40, and Corollaries B.5–B.6, PDF pp. 43–44 / printed pp. 42–43 of [LLYZ24], arXiv:2310.20536v1; cf. [LR88]).

def Cslib.DataStructure.Dictionary.FeistelPerm.recoverLeft {s : ℕ} {α : Type u_1} (f : α → Fin (2 ^ s)) (b : Fin (2 ^ s)) (xR : α) :
Fin (2 ^ s)

Recover the left s-bit coordinate x_L = b ^^^ f x_R from (b, x_R) = feistelPair f x.

@[simp]
theorem Cslib.DataStructure.Dictionary.FeistelPerm.val_feistelHead {s : ℕ} {α : Type u_1} (f : α → Fin (2 ^ s)) (x : Fin (2 ^ s) × α) :
↑(feistelHead f x) = ↑x.1 ^^^ ↑(f x.2)
@[simp]
theorem Cslib.DataStructure.Dictionary.FeistelPerm.val_recoverLeft {s : ℕ} {α : Type u_1} (f : α → Fin (2 ^ s)) (b : Fin (2 ^ s)) (xR : α) :
↑(recoverLeft f b xR) = ↑b ^^^ ↑(f xR)
@[simp]
theorem Cslib.DataStructure.Dictionary.FeistelPerm.recoverLeft_feistelHead {s : ℕ} {α : Type u_1} (f : α → Fin (2 ^ s)) (x : Fin (2 ^ s) × α) :
recoverLeft f (feistelHead f x) x.2 = x.1
@[simp]
theorem Cslib.DataStructure.Dictionary.FeistelPerm.feistelHead_recoverLeft {s : ℕ} {α : Type u_1} (f : α → Fin (2 ^ s)) (b : Fin (2 ^ s)) (xR : α) :
@[simp]
theorem Cslib.DataStructure.Dictionary.FeistelPerm.feistelPair_feistelPair {s : ℕ} {α : Type u_1} (f : α → Fin (2 ^ s)) (x : Fin (2 ^ s) × α) :

Every one-round Feistel map feistelPair f on Fin (2 ^ s) × α is an exact involution.

def Cslib.DataStructure.Dictionary.FeistelPerm.feistelPairEquiv {s : ℕ} {α : Type u_1} (f : α → Fin (2 ^ s)) :
Equiv.Perm (Fin (2 ^ s) × α)

feistelPair f packaged as a self-inverse permutation Equiv.Perm (Fin (2 ^ s) × α).

@[simp]
theorem Cslib.DataStructure.Dictionary.FeistelPerm.feistelPairEquiv_apply {s : ℕ} {α : Type u_1} (f : α → Fin (2 ^ s)) (x : Fin (2 ^ s) × α) :
def Cslib.DataStructure.Dictionary.FeistelPerm.feistelRightEquiv {α : Type u_1} {s : ℕ} (f : α → Fin (2 ^ s)) :
Equiv.Perm (α × Fin (2 ^ s))

Right-updating one-round Feistel permutation (x_L, x_R) ↦ (x_L, x_R ^^^ f x_L) on α × Fin (2 ^ s).

@[simp]
theorem Cslib.DataStructure.Dictionary.FeistelPerm.feistelRightEquiv_apply {α : Type u_1} {s : ℕ} (f : α → Fin (2 ^ s)) (p : α × Fin (2 ^ s)) :
(feistelRightEquiv f) p = (p.1, p.2 ^^^ f p.1)
theorem Cslib.DataStructure.Dictionary.FeistelPerm.feistelHead_eq_iff {s : ℕ} {α : Type u_1} (f : α → Fin (2 ^ s)) (x : Fin (2 ^ s) × α) (b : Fin (2 ^ s)) :
feistelHead f x = b ↔ x.1 = b ^^^ f x.2

Characterization of feistelHead f x = b via left-coordinate recovery x.1 = b ^^^ f x.2.

theorem Cslib.DataStructure.Dictionary.FeistelPerm.eq_of_feistelHead_eq_of_snd_eq {s : ℕ} {α : Type u_1} {f : α → Fin (2 ^ s)} {x₁ x₂ : Fin (2 ^ s) × α} (hhd : feistelHead f x₁ = feistelHead f x₂) (hsnd : x₁.2 = x₂.2) :
x₁ = x₂

Two pairs with the same Feistel head and the same right coordinate are equal.

theorem Cslib.DataStructure.Dictionary.FeistelPerm.feistelHead_ne_of_snd_eq_of_ne {s : ℕ} {α : Type u_1} {f : α → Fin (2 ^ s)} {x₁ x₂ : Fin (2 ^ s) × α} (hsnd : x₁.2 = x₂.2) (hne : x₁ ≠ x₂) :

Distinct keys sharing the same right coordinate x₁.2 = x₂.2 never collide under feistelHead ([LLYZ24], arXiv:2310.20536v1, Appendix B, Claim B.3 proof, PDF p. 42 / printed p. 41, and Lemma 5.2 proof, PDF p. 43 / printed p. 42).

theorem Cslib.DataStructure.Dictionary.FeistelPerm.injOn_snd_of_feistelHead_eq {s : ℕ} {α : Type u_1} (f : α → Fin (2 ^ s)) (b : Fin (2 ^ s)) :

Among all keys routed into a single child bucket b : Fin (2 ^ s), the right coordinate Prod.snd (y_prim in [LLYZ24], arXiv:2310.20536v1, Section 5.4, PDF p. 32 / printed p. 31) is injective.

Bit-mask/shift mixed-domain equivalence Fin (2 ^ s * T) ≃ Fin (2 ^ s) × Fin T sending u to (u % 2 ^ s, u / 2 ^ s) and (x_L, x_R) to x_L + 2 ^ s * x_R.

@[simp]
theorem Cslib.DataStructure.Dictionary.FeistelPerm.val_mixedDomainEquiv_symm (s T : ℕ) (p : Fin (2 ^ s) × Fin T) :
↑((mixedDomainEquiv s T).symm p) = ↑p.1 + 2 ^ s * ↑p.2

Flat mixed-domain one-round Feistel permutation on Fin (2 ^ s * T) conjugated through mixedDomainEquiv s T.

Bridge to FeistelQuotient.feistelBucket: under mixedDomainEquiv s T, feistelHead agrees with FeistelQuotient.feistelBucket s.

Bridge to FeistelQuotient.feistelReconstruct: inverse reassembly on Fin (2 ^ s * T) agrees with FeistelQuotient.feistelReconstruct s.

def Cslib.DataStructure.Dictionary.FeistelPerm.bitDomainEquiv {s L : ℕ} (hsL : s ≤ L) :
Fin (2 ^ L) ≃ Fin (2 ^ s) × Fin (2 ^ (L - s))

Power-of-two domain split Fin (2 ^ L) ≃ Fin (2 ^ s) × Fin (2 ^ (L - s)) when s ≤ L (Definition B.1 and Lemmas 5.1–5.2).

def Cslib.DataStructure.Dictionary.FeistelPerm.feistelBitEquiv {s L : ℕ} (hsL : s ≤ L) (f : Fin (2 ^ (L - s)) → Fin (2 ^ s)) :
Equiv.Perm (Fin (2 ^ L))

Flat one-round Feistel permutation on Fin (2 ^ L) for s ≤ L (Definition B.1).

@[simp]
theorem Cslib.DataStructure.Dictionary.FeistelPerm.feistelBitEquiv_apply {s L : ℕ} (hsL : s ≤ L) (f : Fin (2 ^ (L - s)) → Fin (2 ^ s)) (u : Fin (2 ^ L)) :
@[simp]
theorem Cslib.DataStructure.Dictionary.FeistelPerm.feistelBitEquiv_symm {s L : ℕ} (hsL : s ≤ L) (f : Fin (2 ^ (L - s)) → Fin (2 ^ s)) :

Section 2: Child-router Feistel family ℋ_ℓ^ch #

(Claim B.3, Lemma 5.1, Corollary B.5)

def Cslib.DataStructure.Dictionary.FeistelPerm.bucketLoad {s : ℕ} {α : Type u_1} (f : α → Fin (2 ^ s)) (S : Finset (Fin (2 ^ s) × α)) (b : Fin (2 ^ s)) :

Number of keys in S : Finset (Fin (2 ^ s) × α) routed to child bucket b : Fin (2 ^ s) under feistelHead f (|ĥ⁻¹(y)| in Claim B.3, PDF p. 41 / printed p. 40 of [LLYZ24], arXiv:2310.20536v1).

theorem Cslib.DataStructure.Dictionary.FeistelPerm.card_image_snd_filter_feistelHead_eq {s : ℕ} {α : Type u_1} [DecidableEq α] (f : α → Fin (2 ^ s)) (S : Finset (Fin (2 ^ s) × α)) (b : Fin (2 ^ s)) :
(Finset.image Prod.snd ({x ∈ S | feistelHead f x = b})).card = bucketLoad f S b

Within any bucket b, projecting {x ∈ S | feistelHead f x = b} to Prod.snd (y_prim) preserves cardinality ([LLYZ24], arXiv:2310.20536v1, Section 5.4, PDF p. 32 / printed p. 31).

theorem Cslib.DataStructure.Dictionary.FeistelPerm.sum_bucketLoad_eq_card {s : ℕ} {α : Type u_1} (f : α → Fin (2 ^ s)) (S : Finset (Fin (2 ^ s) × α)) :
∑ b : Fin (2 ^ s), bucketLoad f S b = S.card

Bucket loads partition #S across all 2 ^ s child buckets.

theorem Cslib.DataStructure.Dictionary.FeistelPerm.dens_bucketLoad_sub_ge_le {ι : Type u_1} {α : Type u_2} [Fintype ι] {s m : ℕ} (hm : 1 ≤ m) {h : ι → α → Fin (2 ^ s)} (hh : Probability.IsKWiseIndependentHash (2 * m) h) (S : Finset (Fin (2 ^ s) × α)) (b : Fin (2 ^ s)) {a : ℝ} (hmμ : 2 * ↑m ≤ 3 * (↑S.card / 2 ^ s)) (ha : 0 < a) :
↑{i : ι | a ≤ |↑(bucketLoad (h i) S b) - ↑S.card / 2 ^ s|}.dens ≤ 2 * (3 * ↑m * (↑S.card / 2 ^ s) / a ^ 2) ^ m

General 2m-wise independent Feistel single-bucket tail bound (Claim B.3): for any 1 ≤ m, 2m-wise independent round family h : ι → α → Fin (2 ^ s), finite set S with 2 * m ≤ 3 * (#S / 2 ^ s), bucket b, and a > 0, bucketLoad (h i) S b deviates from #S / 2 ^ s by at least a with seed density at most 2 * (3 * m * (#S / 2 ^ s) / a ^ 2) ^ m.

theorem Cslib.DataStructure.Dictionary.FeistelPerm.dens_exists_bucketLoad_sub_ge_le {ι : Type u_1} {α : Type u_2} [Fintype ι] {s m : ℕ} (hm : 1 ≤ m) {h : ι → α → Fin (2 ^ s)} (hh : Probability.IsKWiseIndependentHash (2 * m) h) (S : Finset (Fin (2 ^ s) × α)) {a : ℝ} (hmμ : 2 * ↑m ≤ 3 * (↑S.card / 2 ^ s)) (ha : 0 < a) :
↑{i : ι | ∃ (b : Fin (2 ^ s)), a ≤ |↑(bucketLoad (h i) S b) - ↑S.card / 2 ^ s|}.dens ≤ 2 ^ (s + 1) * (3 * ↑m * (↑S.card / 2 ^ s) / a ^ 2) ^ m

General 2m-wise independent Feistel all-buckets union bound (Corollary B.5(c) / Lemma 5.1(c) parametric form): union-bounding dens_bucketLoad_sub_ge_le over all 2 ^ s child buckets.

@[reducible, inline]

Concrete seed space for the child-router Feistel family ℋ_ℓ^ch instantiated via Mikkel Thorup's double tabulation [Tho13] (d = 2 * q * c, matching WordRAM.DoubleTabulation).

Exact bit length 2 * q * c * 2 ^ b * (c * b + s) of a seed in ChildRouterSeed c q b s.

Double-tabulation round function Fin T → Fin (2 ^ s) for seed θ : ChildRouterSeed c q b s.

theorem Cslib.DataStructure.Dictionary.FeistelPerm.childRouterRound_apply (c q b s T : ℕ) (θ : ChildRouterSeed c q b s) (z : Fin T) :
childRouterRound c q b s T θ z = Probability.doubleTabHash c (2 * q * c) b T s θ.1 θ.2 z

Child-router Feistel permutation on Fin (2 ^ s) × Fin T (Corollary B.5).

@[simp]
theorem Cslib.DataStructure.Dictionary.FeistelPerm.childRouterPerm_apply (c q b s T : ℕ) (θ : ChildRouterSeed c q b s) (x : Fin (2 ^ s) × Fin T) :
(childRouterPerm c q b s T θ) x = feistelPair (childRouterRound c q b s T θ) x

Flat child-router Feistel permutation on Fin (2 ^ s * T).

@[simp]

Flat child-router Feistel permutation on Fin (2 ^ L) for s ≤ L (Lemma 5.1).

@[simp]
theorem Cslib.DataStructure.Dictionary.FeistelPerm.childRouterBitPerm_apply {s L : ℕ} (hsL : s ≤ L) (c q b : ℕ) (θ : ChildRouterSeed c q b s) (u : Fin (2 ^ L)) :
(childRouterBitPerm hsL c q b θ) u = (feistelBitEquiv hsL (childRouterRound c q b s (2 ^ (L - s)) θ)) u
@[simp]
theorem Cslib.DataStructure.Dictionary.FeistelPerm.dens_childRouter_exists_bucketLoad_sub_ge_le {c q b s T m : ℕ} (hc : 1 ≤ c) (hq : 1 ≤ q) (hm : 1 ≤ m) (hT : T ≤ 2 ^ (c * b)) (hcode : 2 * Probability.doubleTabCodeBound c (2 * q * c) q (2 * m) ≤ 2 ^ ((q - 1) * b)) (S : Finset (Fin (2 ^ s) × Fin T)) {a : ℝ} (hmμ : 2 * ↑m ≤ 3 * (↑S.card / 2 ^ s)) (ha : 0 < a) :
↑{θ : ChildRouterSeed c q b s | ∃ (bucket : Fin (2 ^ s)), a ≤ |↑(bucketLoad (childRouterRound c q b s T θ) S bucket) - ↑S.card / 2 ^ s|}.dens ≤ 2 * ↑(Probability.doubleTabCodeBound c (2 * q * c) q (2 * m)) ^ 2 / 2 ^ (2 * (q - 1) * b) + 2 ^ (s + 1) * (3 * ↑m * (↑S.card / 2 ^ s) / a ^ 2) ^ m

Unconditional Double-Tabulation Feistel concentration (Corollary B.5(c) parametric form): bounds the seed density on ChildRouterSeed c q b s where any child bucket deviates from #S / 2 ^ s by at least a by δ_dt + 2 ^ (s + 1) * (3 * m * (#S / 2 ^ s) / a ^ 2) ^ m.

Half-independence exponent m = 3 * ⌈log₂ max(n, 2)⌉ + 4 (k = 2 * m), chosen so that 2 ^ (s + 1) * (1 / 2) ^ m ≤ 1 / (8 * n ^ 2) whenever 2 ^ s ≤ n.

theorem Cslib.DataStructure.Dictionary.FeistelPerm.dens_childRouter_bucketLoad_outside_le {c q b s T : ℕ} (hc : 1 ≤ c) (hq : 1 ≤ q) (hT : T ≤ 2 ^ (c * b)) (S : Finset (Fin (2 ^ s) × Fin T)) (hcode : 4 * S.card * Probability.doubleTabCodeBound c (2 * q * c) q (2 * childRouterHalfInd S.card) ≤ 2 ^ ((q - 1) * b)) (hconc : 2 ^ s * (150 * childRouterHalfInd S.card) ^ 3 ≤ S.card) :
↑{θ : ChildRouterSeed c q b s | ¬∀ (bucket : Fin (2 ^ s)), ↑S.card / 2 ^ s - 1 / 5 * (↑S.card / 2 ^ s) ^ (2 / 3) ≤ ↑(bucketLoad (childRouterRound c q b s T θ) S bucket) ∧ ↑(bucketLoad (childRouterRound c q b s T θ) S bucket) ≤ ↑S.card / 2 ^ s + 1 / 5 * (↑S.card / 2 ^ s) ^ (2 / 3)}.dens ≤ 1 / (4 * ↑S.card ^ 2)

Unconditional Double-Tabulation child-router concentration (Corollary B.5(c) & Lemma 5.1(c) (1/5)(n / 2 ^ s) ^ (2/3) form): whenever T ≤ 2 ^ (c * b), 4 * #S * doubleTabCodeBound ... ≤ 2 ^ ((q - 1) * b), and 2 ^ s * (150 * childRouterHalfInd #S) ^ 3 ≤ #S, every bucket load lies in [#S / 2 ^ s - (1/5)(#S / 2 ^ s)^(2/3), #S / 2 ^ s + (1/5)(#S / 2 ^ s)^(2/3)] except on at most a 1 / (4 * (#S) ^ 2) fraction of seeds θ : ChildRouterSeed c q b s.

theorem Cslib.DataStructure.Dictionary.FeistelPerm.prob_childRouter_bucketLoad_outside_le {c q b s T : ℕ} (hc : 1 ≤ c) (hq : 1 ≤ q) (hT : T ≤ 2 ^ (c * b)) (S : Finset (Fin (2 ^ s) × Fin T)) (hcode : 4 * S.card * Probability.doubleTabCodeBound c (2 * q * c) q (2 * childRouterHalfInd S.card) ≤ 2 ^ ((q - 1) * b)) (hconc : 2 ^ s * (150 * childRouterHalfInd S.card) ^ 3 ≤ S.card) :
((Probability.PMF.uniformOfFintype (ChildRouterSeed c q b s)).toOuterMeasure {θ : ChildRouterSeed c q b s | ¬∀ (bucket : Fin (2 ^ s)), ↑S.card / 2 ^ s - 1 / 5 * (↑S.card / 2 ^ s) ^ (2 / 3) ≤ ↑(bucketLoad (childRouterRound c q b s T θ) S bucket) ∧ ↑(bucketLoad (childRouterRound c q b s T θ) S bucket) ≤ ↑S.card / 2 ^ s + 1 / 5 * (↑S.card / 2 ^ s) ^ (2 / 3)}).toReal ≤ 1 / (4 * ↑S.card ^ 2)

PMF.uniformOfFintype event-probability form of dens_childRouter_bucketLoad_outside_le.

Character count c = 2 * max ε_inv 1 for pre-given space exponent ε = 1 / ε_inv in Corollary B.5 and Lemma 5.1.

Character bit-width b = max 1 ⌈⌈log₂ max(T, 2)⌉ / max c 1⌉ covering Fin T.

Repetition factor q = c * max α_inv 1 + 2 for gap bound 2 ^ s * T ≤ T ^ α_inv.

Constant O_{ε_inv, α_inv}(1) factor in (childRouterSeedBits ...) ^ max ε_inv 1 ≤ C * (2 ^ s * T).

Explicit input-cardinality threshold such that whenever 2 ^ s * T ≤ T ^ max α_inv 1 and childRouterThreshold ε_inv α_inv ≤ #S, the Corollary B.5 / Lemma 5.1 parameters satisfy 4 * #S * doubleTabCodeBound ... ≤ 2 ^ ((q - 1) * b).

theorem Cslib.DataStructure.Dictionary.FeistelPerm.childRouterThreshold_eq (ε_inv α_inv : ℕ) :
have c := childRouterChars ε_inv; have A := c * max α_inv 1; have q := childRouterRep ε_inv α_inv; have d := 2 * q * c; have D := 2 * c * q; childRouterThreshold ε_inv α_inv = 2 ^ (A * max (4 * c * d ^ q * (c * (6 * A + 8)) ^ D) (4 * (D + 1) ^ 2))

Explicit threshold s₀ = 2100 ^ 3 above which #S ≥ 2 ^ s * s ^ 4 implies 2 ^ s * (150 * childRouterHalfInd #S) ^ 3 ≤ #S ([LLYZ24], arXiv:2310.20536v1, Appendix B, Claim B.3 proof, PDF p. 42 / printed p. 41).

theorem Cslib.DataStructure.Dictionary.FeistelPerm.childRouterSpaceConst_eq (ε_inv α_inv : ℕ) :
childRouterSpaceConst ε_inv α_inv = (2 * childRouterRep ε_inv α_inv * childRouterChars ε_inv) ^ max ε_inv 1 * 2 ^ (2 * childRouterChars ε_inv ^ 2 + childRouterChars ε_inv + 2)
theorem Cslib.DataStructure.Dictionary.FeistelPerm.childRouterSeedBits_pow_le (ε_inv α_inv s : ℕ) {T : ℕ} (hT : 1 ≤ T) :
childRouterSeedBits (childRouterChars ε_inv) (childRouterRep ε_inv α_inv) (childRouterCharBits (childRouterChars ε_inv) T) s ^ max ε_inv 1 ≤ childRouterSpaceConst ε_inv α_inv * (2 ^ s * T)

Seed bit-space bound (Corollary B.5(b) & Lemma 5.1(b)): for every ε_inv, α_inv, s : ℕ and 1 ≤ T, (childRouterSeedBits ...) ^ max ε_inv 1 ≤ childRouterSpaceConst ε_inv α_inv * (2 ^ s * T), i.e., storing a seed takes O_{ε, α}((2 ^ s * T) ^ ε) bits.

theorem Cslib.DataStructure.Dictionary.FeistelPerm.dens_childRouter_bucketLoad_outside_le_of_threshold {ε_inv α_inv s T : ℕ} (hgap : 2 ^ s * T ≤ T ^ max α_inv 1) (S : Finset (Fin (2 ^ s) × Fin T)) (hthresh : childRouterThreshold ε_inv α_inv ≤ S.card) (hconc : 2 ^ s * (150 * childRouterHalfInd S.card) ^ 3 ≤ S.card) :
have c := childRouterChars ε_inv; have q := childRouterRep ε_inv α_inv; have b := childRouterCharBits c T; ↑{θ : ChildRouterSeed c q b s | ¬∀ (bucket : Fin (2 ^ s)), ↑S.card / 2 ^ s - 1 / 5 * (↑S.card / 2 ^ s) ^ (2 / 3) ≤ ↑(bucketLoad (childRouterRound c q b s T θ) S bucket) ∧ ↑(bucketLoad (childRouterRound c q b s T θ) S bucket) ≤ ↑S.card / 2 ^ s + 1 / 5 * (↑S.card / 2 ^ s) ^ (2 / 3)}.dens ≤ 1 / (4 * ↑S.card ^ 2)

Closed-form mixed-domain child-router concentration ([LLYZ24], arXiv:2310.20536v1, Appendix B, Corollary B.5(c), PDF p. 43 / printed p. 42): for pre-given constants ε_inv, α_inv with 2 ^ s * T ≤ T ^ max α_inv 1, childRouterThreshold ε_inv α_inv ≤ #S, and 2 ^ s * (150 * childRouterHalfInd #S) ^ 3 ≤ #S, every bucket load lies within ± (1/5)(#S / 2 ^ s) ^ (2/3) of #S / 2 ^ s except with seed density ≤ 1 / (4 * (#S) ^ 2).

theorem Cslib.DataStructure.Dictionary.FeistelPerm.dens_childRouterBit_bucketLoad_outside_le {ε_inv α_inv s L : ℕ} (hsL : s ≤ L) (hgap : L ≤ max α_inv 1 * (L - s)) (S : Finset (Fin (2 ^ L))) (hthresh : childRouterThreshold ε_inv α_inv ≤ S.card) (hconc : 2 ^ s * (150 * childRouterHalfInd S.card) ^ 3 ≤ S.card) :
have c := childRouterChars ε_inv; have q := childRouterRep ε_inv α_inv; have b := childRouterCharBits c (2 ^ (L - s)); ↑{θ : ChildRouterSeed c q b s | ¬∀ (bucket : Fin (2 ^ s)), ↑S.card / 2 ^ s - 1 / 5 * (↑S.card / 2 ^ s) ^ (2 / 3) ≤ ↑(bucketLoad (childRouterRound c q b s (2 ^ (L - s)) θ) (Finset.map (bitDomainEquiv hsL).toEmbedding S) bucket) ∧ ↑(bucketLoad (childRouterRound c q b s (2 ^ (L - s)) θ) (Finset.map (bitDomainEquiv hsL).toEmbedding S) bucket) ≤ ↑S.card / 2 ^ s + 1 / 5 * (↑S.card / 2 ^ s) ^ (2 / 3)}.dens ≤ 1 / (4 * ↑S.card ^ 2)

Closed-form flat-domain child-router concentration on Fin (2 ^ L) ([LLYZ24], arXiv:2310.20536v1, Section 5.4, Lemma 5.1(c), PDF p. 32 / printed p. 31, and Appendix B, PDF pp. 41–42 / printed pp. 40–41): specialization of dens_childRouter_bucketLoad_outside_le_of_threshold to T = 2 ^ (L - s) via bitDomainEquiv hsL.

When s ≥ childRouterMinS (2100 ^ 3), the paper's condition 2 ^ s * s ^ 4 ≤ n implies the quantitative concentration hypothesis 2 ^ s * (150 * childRouterHalfInd n) ^ 3 ≤ n ([LLYZ24], arXiv:2310.20536v1, Appendix B, Claim B.3 proof, PDF p. 42 / printed p. 41).

Section 3: ID-compressor Feistel family ℋ_ℓ^id (Lemma 5.2, Corollary B.6) #

theorem Cslib.DataStructure.Dictionary.FeistelPerm.dens_not_injOn_feistelHead_le {ι : Type u_1} {α : Type u_2} [Fintype ι] [Nonempty ι] {s : ℕ} {h : ι → α → Fin (2 ^ s)} (hh : Probability.IsPairwiseIndependentHash h) (S : Finset (Fin (2 ^ s) × α)) :
↑{i : ι | ¬Set.InjOn (feistelHead (h i)) ↑S}.dens ≤ ↑(S.card * (S.card - 1)) / (2 * 2 ^ s)

General pairwise-independent Feistel ID-compression bound (Lemma 5.2(c) & Corollary B.6(c)): for any pairwise independent round family h : ι → α → Fin (2 ^ s) on a nonempty finite seed space ι and any S : Finset (Fin (2 ^ s) × α), feistelHead (h i) fails to be injective on S with seed density at most #S * (#S - 1) / (2 * 2 ^ s).

@[reducible, inline]

Concrete seed space Fin 2 → Fin (2 ^ trinomialDeg T s) for the 2-wise trinomial ID-compressor Feistel family ℋ_ℓ^id (Lemma 5.2 & Corollary B.6, with arguments (s, T) matching Fin (2 ^ s) × Fin T).

Exact bit length 2 * trinomialDeg T s of an IdCompressorSeed s T.

Seed bit-space bound (Corollary B.6(b) & Lemma 5.2(b)): storing a seed in IdCompressorSeed s T uses 2 * trinomialDeg T s ≤ 6 * max ⌈log₂ max(T, 2)⌉ (max s 1) = O(s + log T) bits.

2-wise trinomial polynomial round function Fin T → Fin (2 ^ s).

noncomputable def Cslib.DataStructure.Dictionary.FeistelPerm.idCompressorHead (s T : ℕ) (θ : IdCompressorSeed s T) (x : Fin (2 ^ s) × Fin T) :
Fin (2 ^ s)

Compressed s-bit ID head feistelHead (idCompressorRound s T θ) x.

Unconditional 2-wise trinomial ID-compressor Feistel permutation on Fin (2 ^ s) × Fin T (Corollary B.6).

Flat mixed-domain ID-compressor Feistel permutation on Fin (2 ^ s * T).

noncomputable def Cslib.DataStructure.Dictionary.FeistelPerm.idCompressorBitPerm {s L : ℕ} (hsL : s ≤ L) (θ : IdCompressorSeed s (2 ^ (L - s))) :
Equiv.Perm (Fin (2 ^ L))

Flat Fin (2 ^ L) ID-compressor Feistel permutation for s ≤ L (Lemma 5.2).

@[simp]
theorem Cslib.DataStructure.Dictionary.FeistelPerm.idCompressorBitPerm_apply {s L : ℕ} (hsL : s ≤ L) (θ : IdCompressorSeed s (2 ^ (L - s))) (u : Fin (2 ^ L)) :
(idCompressorBitPerm hsL θ) u = (feistelBitEquiv hsL (idCompressorRound s (2 ^ (L - s)) θ)) u

Unconditional mixed-domain ID-compressor pairwise-collision bound ([LLYZ24], arXiv:2310.20536v1, Appendix B, Corollary B.6(c), PDF pp. 43–44 / printed pp. 42–43): on any finite set S, idCompressorHead s T θ fails to be injective on S with seed density at most (#S) ^ 2 / (2 * 2 ^ s) (hence also ≤ (#S) ^ 2 / 2 ^ s).

theorem Cslib.DataStructure.Dictionary.FeistelPerm.dens_not_injOn_idCompressorHead_le_two_div_sq {s T n_bar n_next : ℕ} (S : Finset (Fin (2 ^ s) × Fin T)) (hS : S.card ≤ n_bar) (hn : 1 ≤ n_next) (hI : n_bar ^ 2 * n_next ^ 2 ≤ 4 * 2 ^ s) :
↑{θ : IdCompressorSeed s T | ¬Set.InjOn (idCompressorHead s T θ) ↑S}.dens ≤ 2 / ↑n_next ^ 2

Section 5.4 2 / n_next ^ 2 instantiation of Corollary B.6(c) ([LLYZ24], arXiv:2310.20536v1, Section 5.4, PDF p. 33 / printed p. 32): whenever #S ≤ n_bar, 1 ≤ n_next, and n_bar ^ 2 * n_next ^ 2 ≤ 4 * 2 ^ s (satisfied both when n_bar ≤ 2 * n_next ∧ n_next ^ 4 ≤ 2 ^ s and when n_next ≤ n_bar ∧ n_bar ^ 4 ≤ 2 * 2 ^ s), collision probability is ≤ 2 / n_next ^ 2.

theorem Cslib.DataStructure.Dictionary.FeistelPerm.dens_not_injOn_idCompressorBit_le {s L : ℕ} (hsL : s ≤ L) (S : Finset (Fin (2 ^ L))) :
↑{θ : IdCompressorSeed s (2 ^ (L - s)) | ¬Set.InjOn (fun (u : Fin (2 ^ L)) => idCompressorHead s (2 ^ (L - s)) θ ((bitDomainEquiv hsL) u)) ↑S}.dens ≤ ↑S.card ^ 2 / (2 * 2 ^ s)

Unconditional flat-domain ID-compressor collision bound on Fin (2 ^ L) ([LLYZ24], arXiv:2310.20536v1, Section 5.4, Lemma 5.2(c), PDF p. 33 / printed p. 32, and Appendix B, PDF pp. 42–43 / printed pp. 41–42): for s ≤ L and any S : Finset (Fin (2 ^ L)), the compressed s-bit heads fail to be pairwise distinct on S with seed density at most (#S) ^ 2 / (2 * 2 ^ s) (hence also ≤ (#S) ^ 2 / 2 ^ s).