Documentation

CslibFrontier.DataStructure.NearNeighbor.MeasureLSH

Probabilistic query-failure step for probability-measure LSH families #

This module formalizes the probabilistic candidate-collision and query-failure step on unbucketed point-set filtering over arbitrary probability-measure seed laws ν : Measure ι (after [IM98] and [HPIM12], Section 3; not a bucketed sublinear approximate near-neighbour data structure, tracked in #3361).

CslibFrontier.DataStructure.NearNeighbor.LSH proves the discrete PMF ι query-failure bounds on the unbucketed candidates, query, and queryRepeat definitions with parameter functions rho, numHashes, and numTables. Here the failure bounds are extended to independent table seeds drawn via Measure.pi under the measurability assumption {i | g i x = g i q}; Word-RAM hash buckets, seed storage, and sublinear O(n ^ ρ) query running time remain open in #3361.

Main results #

References #

theorem Cslib.DataStructure.NearNeighbor.lintegral_pi_countP_candidates_le {ι : Type u_1} {X : Type u_2} {Y : Type u_3} [MeasurableSpace ι] [DecidableEq Y] {far : X → X → Prop} [DecidableRel far] (ν : MeasureTheory.Measure ι) [MeasureTheory.IsProbabilityMeasure ν] (g : ι → X → Y) (L : ℕ) (P : List X) (q : X) {P₂ : ℝ} (hmeas : ∀ x ∈ P, MeasurableSet {i : ι | g i x = g i q}) (hfar : ∀ x ∈ P, far x q → Probability.measureCollisionProb ν g x q ≤ P₂) :
(Measurable fun (s : Fin L → ι) => ↑(List.countP (fun (y : X) => decide (far y q)) (candidates g s P q))) ∧ (∫⁻ (s : Fin L → ι), ↑(List.countP (fun (y : X) => decide (far y q)) (candidates g s P q)) ∂MeasureTheory.Measure.pi fun (x : Fin L) => ν) ≤ ↑L * (↑P.length * ENNReal.ofReal P₂)

Expected far-candidate step for probability-measure seeds on unbucketed candidates (#3361): over L independent table seeds, the expected number of far colliding candidates is at most L * |P| * P₂.

theorem Cslib.DataStructure.NearNeighbor.measureReal_query_eq_none_le {ι : Type u_1} {X : Type u_2} {Y : Type u_3} [MeasurableSpace ι] [DecidableEq Y] {far : X → X → Prop} [DecidableRel far] (ν : MeasureTheory.Measure ι) [MeasureTheory.IsProbabilityMeasure ν] (g : ι → X → Y) (L : ℕ) {T : ℕ} (hT : 0 < T) {P : List X} {q x₀ : X} (hx₀ : x₀ ∈ P) (hnf : ¬far x₀ q) {P₁ P₂ : ℝ} (hmeas : ∀ x ∈ P, MeasurableSet {i : ι | g i x = g i q}) (hP₁ : P₁ ≤ Probability.measureCollisionProb ν g x₀ q) (hP₂ : 0 ≤ P₂) (hfar : ∀ x ∈ P, far x q → Probability.measureCollisionProb ν g x q ≤ P₂) :
(MeasureTheory.Measure.pi fun (x : Fin L) => ν).real {s : Fin L → ι | query g far s T P q = none} ≤ (1 - P₁) ^ L + ↑L * ↑P.length * P₂ / ↑T

Probabilistic query-failure step for probability-measure seeds on unbucketed point-set filtering (after [IM98]; not a bucketed sublinear near-neighbour data structure, #3361): with L independent tables drawn from ν and stop limit T > 0, query returns none with probability at most (1 - P₁) ^ L + L * |P| * P₂ / T.

theorem Cslib.DataStructure.NearNeighbor.measureReal_query_andHash_eq_none_le {ι : Type u_1} {X : Type u_2} {Y : Type u_3} [MeasurableSpace ι] [DecidableEq Y] {near far : X → X → Prop} [DecidableRel far] {seed : MeasureTheory.Measure ι} [MeasureTheory.IsProbabilityMeasure seed] {hash : ι → X → Y} {p₁ p₂ : ℝ} (h : Probability.IsLocalitySensitive (Probability.measureCollisionProb seed hash) near far p₁ p₂) (hp₂ : 0 ≤ p₂) (hp : p₂ < p₁) (k L : ℕ) {T : ℕ} (hT : 0 < T) {P : List X} {q x₀ : X} (hx₀ : x₀ ∈ P) (hmeas : ∀ x ∈ P, MeasurableSet {i : ι | hash i x = hash i q}) (hnear : near x₀ q) :
(MeasureTheory.Measure.pi fun (x : Fin L) => MeasureTheory.Measure.pi fun (x : Fin k) => seed).real {s : Fin L → Fin k → ι | query (Probability.andHash hash k) far s T P q = none} ≤ (1 - p₁ ^ k) ^ L + ↑L * ↑P.length * p₂ ^ k / ↑T

Probabilistic AND-table query-failure step for probability-measure seeds on unbucketed point-set filtering (after [IM98]; #3361): (1 - p₁ ^ k) ^ L + L * |P| * p₂ ^ k / T.

theorem Cslib.DataStructure.NearNeighbor.measureReal_query_numTables_eq_none_le {ι : Type u_1} {X : Type u_2} {Y : Type u_3} [MeasurableSpace ι] [DecidableEq Y] {near far : X → X → Prop} [DecidableRel far] {seed : MeasureTheory.Measure ι} [MeasureTheory.IsProbabilityMeasure seed] {hash : ι → X → Y} {p₁ p₂ : ℝ} (h : Probability.IsLocalitySensitive (Probability.measureCollisionProb seed hash) near far p₁ p₂) (hp₂ : 0 < p₂) (hp₂₁ : p₂ < p₁) (hp₁ : p₁ ≤ 1) {P : List X} {q x₀ : X} (hx₀ : x₀ ∈ P) (hmeas : ∀ x ∈ P, MeasurableSet {i : ι | hash i x = hash i q}) (hnear : near x₀ q) :
(MeasureTheory.Measure.pi fun (x : Fin (numTables P.length p₁ p₂)) => MeasureTheory.Measure.pi fun (x : Fin (numHashes P.length p₂)) => seed).real {s : Fin (numTables P.length p₁ p₂) → Fin (numHashes P.length p₂) → ι | query (Probability.andHash hash (numHashes P.length p₂)) far s (3 * numTables P.length p₁ p₂) P q = none} ≤ Real.exp (-1) + 1 / 3

Probabilistic query-failure step with explicit parameters for probability-measure seeds on unbucketed point-set filtering (after [HPIM12], Theorem 3.4; not a bucketed sublinear near-neighbour data structure, #3361): with k = numHashes |P| p₂, L = numTables |P| p₁ p₂, and stop limit T = 3 * L, query returns none with probability at most exp (-1) + 1 / 3.

theorem Cslib.DataStructure.NearNeighbor.measureReal_queryRepeat_eq_none {ι : Type u_1} {X : Type u_2} {Y : Type u_3} [MeasurableSpace ι] [DecidableEq Y] {far : X → X → Prop} [DecidableRel far] (ν : MeasureTheory.Measure ι) [MeasureTheory.IsProbabilityMeasure ν] (g : ι → X → Y) (R L T : ℕ) (P : List X) (q : X) :
(MeasureTheory.Measure.pi fun (x : Fin R) => MeasureTheory.Measure.pi fun (x : Fin L) => ν).real {s : Fin R → Fin L → ι | queryRepeat g far s T P q = none} = (MeasureTheory.Measure.pi fun (x : Fin L) => ν).real {s : Fin L → ι | query g far s T P q = none} ^ R

Under product probability-measure seeds, R independent instances of the unbucketed query model all return none with the R-th power of a single instance's failure probability (#3361).

theorem Cslib.DataStructure.NearNeighbor.measureReal_queryRepeat_numTables_eq_none_le {ι : Type u_1} {X : Type u_2} {Y : Type u_3} [MeasurableSpace ι] [DecidableEq Y] {near far : X → X → Prop} [DecidableRel far] {seed : MeasureTheory.Measure ι} [MeasureTheory.IsProbabilityMeasure seed] {hash : ι → X → Y} {p₁ p₂ : ℝ} (h : Probability.IsLocalitySensitive (Probability.measureCollisionProb seed hash) near far p₁ p₂) (hp₂ : 0 < p₂) (hp₂₁ : p₂ < p₁) (hp₁ : p₁ ≤ 1) (R : ℕ) {P : List X} {q x₀ : X} (hx₀ : x₀ ∈ P) (hmeas : ∀ x ∈ P, MeasurableSet {i : ι | hash i x = hash i q}) (hnear : near x₀ q) :
(MeasureTheory.Measure.pi fun (x : Fin R) => MeasureTheory.Measure.pi fun (x : Fin (numTables P.length p₁ p₂)) => MeasureTheory.Measure.pi fun (x : Fin (numHashes P.length p₂)) => seed).real {s : Fin R → Fin (numTables P.length p₁ p₂) → Fin (numHashes P.length p₂) → ι | queryRepeat (Probability.andHash hash (numHashes P.length p₂)) far s (3 * numTables P.length p₁ p₂) P q = none} ≤ (Real.exp (-1) + 1 / 3) ^ R

Probabilistic repetition step for probability-measure seeds on unbucketed point-set filtering (#3361): R independent instances of query all return none with probability at most (e⁻¹ + 1 / 3) ^ R.