Documentation

Complexity.Algorithms.WordRAM.ThreeSum.ChanHe.Query

Complete native collision queries for Chan–He prime searches #

A query computes all three collision counts and tests their scaled thresholds. No count or acceptance test is supplied as advice: all counting and comparison instructions are charged.

Main definitions #

Main results #

Count collisions and test all three inequalities.

Instances For
    theorem Cslib.Algorithms.WordRAM.ThreeSum.ChanHe.Query.exec {w M : ℕ} (x : WordRAM.Data 64) (values : Fin 3 → ℕ → ℤ) (hM : 0 < M) (hmod : GenericRAM.Signed.Fits w ↑M) (hmodreg : x.regs CountCall.modulus = WordRAM.Signed.encode ↑M) (hfit : ∀ (j : Fin 3), ∀ i < x.regs (CountCall.length j), GenericRAM.Signed.Fits w (values j i)) (hs : ∀ (j : Fin 3), WordRAM.Fits (w + 2) (x.regs (CountCall.source j) + x.regs (CountCall.length j))) (hk : ∀ (j : Fin 3), WordRAM.Fits (w + 2) (x.regs CountCall.scratch + x.regs (CountCall.length j))) (hd : WordRAM.Fits (w + 2) (x.regs CountCall.histogram + M)) (ht : ∀ (j : Fin 3), WordRAM.Fits (w + 2) (x.regs (CountCall.length j) * x.regs (CountCall.length j) + x.regs (CountCall.length j) + 1)) (hproduct : ∀ (j : Fin 3), WordRAM.Fits (w + 2) (x.regs (CountCall.length j) * x.regs (CountCall.length j) * x.regs CollisionTest.card)) (hz : x.regs CollisionTest.zero = 0) (hsk : ∀ (j : Fin 3), x.regs (CountCall.source j) + x.regs (CountCall.length j) ≤ x.regs CountCall.scratch) (hkd : ∀ (j : Fin 3), x.regs CountCall.scratch + x.regs (CountCall.length j) ≤ x.regs CountCall.histogram) (hinput : ∀ (j : Fin 3), ∀ i < x.regs (CountCall.length j), x.mem (x.regs (CountCall.source j) + i) = WordRAM.Signed.encode (values j i)) (hinj : ∀ (j : Fin 3), Set.InjOn (values j) ↑(Finset.range (x.regs (CountCall.length j)))) :

    Execute a complete three-set collision query within 34(n₀+n₁+n₂)+15M+85 instructions. Multiplication fits are bounded by nⱼ²·card, independently of the actual input collision count. The final halt is excluded.