Buckets built from an actual stored histogram
ProvedThreeSum1960614.Machine.ThreeSum.LightSourceBucketFromHistogram.Procs.meets3sum3sum-1960614formal-verification
Let for , and suppose memory stores both these keys and their exact histogram. Assume the concrete bucket subroutines are present, addresses fit words, call depth is available, input arrays precede the offset region, the offset region precedes cursors, cursors precede flat indices, and the flat array fits space. The procedure constructs the exact stored bucket predicate in its stated time, preserves the preceding memory, and changes only the designated offset-to-flat interval.
Builds exact original-index fibers from computed counts. This supports the complete deterministic integer 3SUM runtime proof.
Preamble
import Definitions.Def_APSPSource_RemainingDefinitions
import Definitions.Def_APSPSource_ThreeSumApsp_Lang_Regions
import Definitions.Def_APSPSource_ThreeSumApsp_Lang_Syntax
import Definitions.Def_APSPSource_ThreeSumApsp_Util_Index
import Definitions.Def_APSPSource_ThreeSumApsp_Util_List
import Definitions.Def_ThreeSum1960614_Machine_Bundle003
import Definitions.Def_ThreeSum1960614_Machine_Bundle004
import Definitions.Def_ThreeSum1960614_Machine_Bundle005
import Definitions.Def_ThreeSum1960614_Machine_Bundle006
import Definitions.Def_ThreeSum1960614_Machine_Bundle007
import Definitions.Def_ThreeSum1960614_Machine_Bundle008
import Definitions.Def_ThreeSum1960614_Machine_Bundle010
import Definitions.Def_ThreeSum1960614_Machine_Bundle012
import Definitions.Def_ThreeSum1960614_Machine_Bundle013
import Definitions.Def_ThreeSum1960614_Machine_Bundle015
import Definitions.Def_ThreeSum1962Source_Bundle01
import Definitions.Def_ThreeSum1962Source_Bundle02
import Definitions.Def_ThreeSum1962Source_Bundle04
import Definitions.Def_ThreeSum1962Source_Bundle06
import Definitions.Def_ThreeSum1962Source_Bundle07
import Lean
import Mathlib.Algebra.BigOperators.Fin
import Mathlib.Algebra.BigOperators.Group.Finset.Basic
import Mathlib.Algebra.Group.Int.Defs
import Mathlib.Algebra.GroupWithZero.Nat
import Mathlib.Algebra.Order.BigOperators.Group.List
import Mathlib.Algebra.Order.BigOperators.Group.Multiset
import Mathlib.Algebra.Order.Group.Abs
import Mathlib.Algebra.Order.Group.Int
import Mathlib.Algebra.Order.Group.Nat
import Mathlib.Algebra.Order.Group.Unbundled.Abs
import Mathlib.Algebra.Order.Ring.Abs
import Mathlib.Algebra.Order.Ring.Int
import Mathlib.Data.Finset.Card
import Mathlib.Data.Finset.Range
import Mathlib.Data.Fintype.Card
import Mathlib.Data.Int.Notation
import Mathlib.Data.List.GetD
import Mathlib.Data.List.OfFn
import Mathlib.Data.Nat.Count
import Mathlib.Data.Nat.Notation
import Mathlib.Data.Nat.SuccPred
import Mathlib.LinearAlgebra.Matrix.Defs
import Mathlib.Logic.Function.Basic
import Mathlib.Order.ConditionallyCompleteLattice.Basic
import Mathlib.Tactic.Positivity
import Mathlib.Tactic.Ring
import Mathlib.Algebra.Order.Field.Basic
import Mathlib.Algebra.Order.Ring.Abs
import Mathlib.Algebra.Order.Ring.Int
import Mathlib.Data.Int.Cast.Lemmas
import Mathlib.Data.Nat.Cast.Order.Ring
import Mathlib.Tactic.GCongr
import Mathlib.Tactic.Linarith
import Mathlib.Tactic.NormNum
import Mathlib.Tactic.Positivity
import Mathlib.Tactic.Ring
import Theorems.Thm_ThreeSum1960614_Machine_ThreeSum_LightSourceBucketOffsets_meets
import Theorems.Thm_ThreeSum1960614_Machine_ThreeSum_LightSourceBucketScatter_meets
namespace Light
end Light
namespace ThreeSum
end ThreeSum
namespace ThreeSum.LightHistogram
end ThreeSum.LightHistogram
namespace ThreeSum.LightSourceBucketFromHistogram
end ThreeSum.LightSourceBucketFromHistogram
namespace ThreeSum.SourceBuckets
end ThreeSum.SourceBuckets
namespace ThreeSum1960614.Machine.Light
end ThreeSum1960614.Machine.Light
namespace ThreeSum1960614.Machine.ThreeSum
end ThreeSum1960614.Machine.ThreeSum
namespace ThreeSum1960614.Machine.ThreeSum.LightHistogram
end ThreeSum1960614.Machine.ThreeSum.LightHistogram
namespace ThreeSum1960614.Machine.ThreeSum.LightSourceBucketFromHistogram
end ThreeSum1960614.Machine.ThreeSum.LightSourceBucketFromHistogram
namespace ThreeSum1960614.Machine.ThreeSum.SourceBuckets
end ThreeSum1960614.Machine.ThreeSum.SourceBuckets
open _root_.ThreeSum
open _root_.ThreeSum1960614.Machine.ThreeSum
open _root_.ThreeSum.LightSourceBucketFromHistogram
open _root_.ThreeSum1960614.Machine.ThreeSum.LightSourceBucketFromHistogram
open _root_.Light
open _root_.ThreeSum1960614.Machine.Light
open _root_.ThreeSum.SourceBuckets
open _root_.ThreeSum1960614.Machine.ThreeSum.SourceBuckets
open _root_.ThreeSum.LightHistogram
open _root_.ThreeSum1960614.Machine.ThreeSum.LightHistogram
set_option maxHeartbeats 1500000
set_option maxRecDepth 10000
variable {lim : _root_.ThreeSum1960614.Machine.Light.Limits} {P : _root_.ThreeSum1960614.Machine.Light.Program} {d : ℕ}Formal statement
theorem ThreeSum1960614.Machine.ThreeSum.LightSourceBucketFromHistogram.Procs.meets {pMain : ℕ} (C : _root_.ThreeSum1960614.Machine.ThreeSum.LightSourceBucketFromHistogram.Procs P pMain)
{μ : ℕ → ℤ} {keys hist offsets cursor flat N M : ℕ} (key : ℕ → ℕ)
(hw : (lim.space : ℤ) ≤ lim.word) (hd : d < lim.depth)
(hkeys : keys+N ≤ offsets) (hhist : hist+M ≤ offsets)
(hoffsets : offsets+M+1 ≤ cursor) (hcursor : cursor+M ≤ flat)
(hspace : flat+N ≤ lim.space)
(hkey : ∀ i < N, key i < M)
(hread : ∀ i < N, μ (keys+i) = (key i : ℤ))
(hhistRead : ∀ r < M, μ (hist+r) = (_root_.ThreeSum.LightHistogram.count key r N : ℤ)) :
_root_.ThreeSum1960614.Machine.Light.Meets lim P pMain d [keys,hist,offsets,cursor,flat,N,M] μ (_root_.ThreeSum.LightSourceBucketFromHistogram.time N M)
(fun _ ν => _root_.ThreeSum1960614.Machine.ThreeSum.SourceBuckets.Stored ν key N M offsets flat ∧ _root_.ThreeSum1960614.Machine.Light.Kept μ ν offsets ∧
_root_.ThreeSum1960614.Machine.Light.SameOutside μ ν offsets (flat+N-offsets)) := by sorrySource