Completeness of the exhaustive triple index
ProvedThreeSum.BruteTripleIndex.hit_complete3sumalgorithmsfine-grained-complexitythree-sum-1962word-ram
Let and let be an input array. The triple enumerator decodes each index below into three positions. Let mean that some decoded index below both and gives pairwise distinct positions whose values sum to zero. Then
This certifies completeness of the brute-force fallback over distinct positions. Repeated input values are permitted.
Preamble
import Definitions.Def_ThreeSum1962Source_Bundle01 import Lean.Elab.Tactic.Omega import Mathlib.Data.Finset.Image import Mathlib.Data.Fintype.BigOperators import Mathlib.Data.Fintype.Card import Mathlib.Data.Fintype.Pi import Mathlib.Data.Fintype.Prod import Mathlib.Data.Int.Basic import Mathlib.Data.Nat.Bitwise import Mathlib.Data.Nat.Size import Mathlib.Tactic.Push import Mathlib.Tactic.Ring set_option autoImplicit false set_option relaxedAutoImplicit false set_option Elab.async false
Formal statement
theorem ThreeSum.BruteTripleIndex.hit_complete : ∀ {n : Nat} (x : Fin n → Int)
(hn : @LT.lt.{0} Nat instLTNat (@OfNat.ofNat.{0} Nat (nat_lit 0) (instOfNatNat (nat_lit 0))) n),
Iff
(@ThreeSum.BruteTripleIndex.Hit n x hn
(@HPow.hPow.{0, 0, 0} Nat Nat Nat
(@instHPow.{0, 0} Nat Nat (@NPow.toPow.{0} Nat (@Monoid.toNPow.{0} Nat Nat.instMonoid))) n
(@OfNat.ofNat.{0} Nat (nat_lit 3) (instOfNatNat (nat_lit 3)))))
(@ThreeSum.Coloring.DistinctZeroSum n x) := by
sorry
Source