Checking terminal witnesses from a stored reporting frontier
ProvedThreeSum.LightReportingTerminalStored.program_meetsWrite for machine space, word magnitude, and depth limits. Let be a finite set of raw items, a wanted label, and . Suppose the retained frontier at level has its exact count, query mask, and left/right prefix-mask arrays stored at root , with the correct capacity in . Independently, let stored integer arrays , integer , and natural have exact residue buckets and the required occurrence and cover data for 's output.
Assume the terminal layout, source-value and sum word bounds, terminal space and word bounds, , and depth
The routine returns a Boolean satisfying
where is the frontier of and is the guarded terminal test: an admissible enumerated completion has bucket-matching with . It preserves memory before the terminal masks and uses the frontier-scan time bound plus .
This connects stored frontier records to terminal checking.
/- Copyright (c) 2026 Anthropic, PBC. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. SPDX-License-Identifier: Apache-2.0 -/ import Aesop import Definitions.Def_APSPSource_RemainingDefinitions import Definitions.Def_APSPSource_ThreeSumApsp_Lang_Logic import Definitions.Def_APSPSource_ThreeSumApsp_Lang_Regions import Definitions.Def_APSPSource_ThreeSumApsp_Lang_Syntax import Definitions.Def_ThreeSum1962Source_Bundle01 import Definitions.Def_ThreeSum1962Source_Bundle04 import Definitions.Def_ThreeSum1962Source_Bundle05 import Definitions.Def_ThreeSum1962Source_Bundle07 import Definitions.Def_ThreeSum1962Source_Bundle08 import Definitions.Def_ThreeSum1962Source_Bundle09 import Definitions.Def_ThreeSum1962Source_Bundle10 import Definitions.Def_ThreeSum1962Source_Bundle11 import Definitions.Def_ThreeSum1962Source_Bundle12 import Definitions.Def_ThreeSum1962Source_Bundle13 import Definitions.Def_ThreeSum1962Source_Bundle14 import Lean.Elab.Tactic.Omega import Mathlib.Algebra.BigOperators.Fin import Mathlib.Algebra.BigOperators.Group.Finset.Basic import Mathlib.Algebra.BigOperators.Group.Finset.Piecewise import Mathlib.Algebra.BigOperators.Group.Finset.Powerset import Mathlib.Algebra.BigOperators.Group.Finset.Sigma import Mathlib.Algebra.BigOperators.Ring.Finset import Mathlib.Algebra.Field.ZMod import Mathlib.Algebra.Group.Equiv.Basic import Mathlib.Algebra.Group.Int.Defs import Mathlib.Algebra.GroupWithZero.Nat import Mathlib.Algebra.Order.BigOperators.Group.Finset import Mathlib.Algebra.Order.BigOperators.Group.List import Mathlib.Algebra.Order.BigOperators.Group.Multiset import Mathlib.Algebra.Order.Chebyshev import Mathlib.Algebra.Order.Field.Basic import Mathlib.Algebra.Order.Floor.Div 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.Algebra.Order.Ring.Nat import Mathlib.Algebra.Order.Ring.Pow import Mathlib.Algebra.Polynomial.Basic import Mathlib.Algebra.Polynomial.Coeff import Mathlib.Algebra.Ring.Nat import Mathlib.Combinatorics.Colex import Mathlib.Data.Bool.Basic import Mathlib.Data.Fin.Embedding import Mathlib.Data.Fin.VecNotation import Mathlib.Data.Finset.Basic import Mathlib.Data.Finset.Card import Mathlib.Data.Finset.Max import Mathlib.Data.Finset.Powerset import Mathlib.Data.Finset.Prod import Mathlib.Data.Finset.Range import Mathlib.Data.Finset.Sigma import Mathlib.Data.Finset.Sort import Mathlib.Data.Fintype.BigOperators import Mathlib.Data.Fintype.Card import Mathlib.Data.Fintype.EquivFin import Mathlib.Data.Fintype.Fin import Mathlib.Data.Fintype.Pi import Mathlib.Data.Fintype.Prod import Mathlib.Data.Int.Cast.Lemmas import Mathlib.Data.Int.ModEq import Mathlib.Data.Int.Notation import Mathlib.Data.Int.SuccPred import Mathlib.Data.List.Basic import Mathlib.Data.List.GetD import Mathlib.Data.List.MinMax import Mathlib.Data.List.Nodup import Mathlib.Data.List.OfFn import Mathlib.Data.List.Pi import Mathlib.Data.List.ProdSigma import Mathlib.Data.List.Range import Mathlib.Data.List.Sublists import Mathlib.Data.List.TakeDrop import Mathlib.Data.Nat.Cast.Order.Ring import Mathlib.Data.Nat.Choose.Basic import Mathlib.Data.Nat.Choose.Bounds import Mathlib.Data.Nat.Choose.Central import Mathlib.Data.Nat.Choose.Sum import Mathlib.Data.Nat.Count import Mathlib.Data.Nat.Log import Mathlib.Data.Nat.Notation import Mathlib.Data.Nat.Size import Mathlib.Data.Nat.Sqrt import Mathlib.Data.Nat.SuccPred import Mathlib.Data.Real.Basic import Mathlib.Data.ZMod.Basic import Mathlib.GroupTheory.Index import Mathlib.LinearAlgebra.Dual.Lemmas import Mathlib.LinearAlgebra.Matrix.Defs import Mathlib.LinearAlgebra.Matrix.Dual import Mathlib.LinearAlgebra.Matrix.ToLin import Mathlib.Logic.Equiv.Fin.Basic import Mathlib.Logic.Function.Basic import Mathlib.NumberTheory.Bertrand import Mathlib.Order.ConditionallyCompleteLattice.Basic import Mathlib.RingTheory.Coprime.Lemmas import Mathlib.Tactic import Mathlib.Tactic.Abel import Mathlib.Tactic.ByContra import Mathlib.Tactic.FieldSimp import Mathlib.Tactic.FinCases import Mathlib.Tactic.GCongr import Mathlib.Tactic.Linarith import Mathlib.Tactic.NormNum import Mathlib.Tactic.Positivity import Mathlib.Tactic.Push import Mathlib.Tactic.Ring import Mathlib.Tactic.SplitIfs import Mathlib.Tactic.Tauto import Theorems.Thm_ThreeSum_LightReportingTerminalFrontier_program_meets import Theorems.Thm_ThreeSum_RawReporting_partitionWord_length import Theorems.Thm_ThreeSum_RawReporting_word_children import Theorems.Thm_ThreeSum_ReportingHostMasks_blockSet_localRow import Theorems.Thm_ThreeSum_ReportingHostMasks_localChildren_mem import Theorems.Thm_ThreeSum_Reporting_frontier_length_le_mass set_option autoImplicit false set_option relaxedAutoImplicit false set_option Elab.async false namespace Light end Light namespace ThreeSum.BlockCoefficientRows end ThreeSum.BlockCoefficientRows namespace ThreeSum.BlockEncoding end ThreeSum.BlockEncoding namespace ThreeSum.BlockForced end ThreeSum.BlockForced namespace ThreeSum.BlockIndex end ThreeSum.BlockIndex namespace ThreeSum.BlockIndexedQuery end ThreeSum.BlockIndexedQuery namespace ThreeSum.BlockMaskLayout end ThreeSum.BlockMaskLayout namespace ThreeSum.BlockRows end ThreeSum.BlockRows namespace ThreeSum.BlockSourceEncoding end ThreeSum.BlockSourceEncoding namespace ThreeSum.GlobalEncoding end ThreeSum.GlobalEncoding namespace ThreeSum.LightBlockQuery end ThreeSum.LightBlockQuery namespace ThreeSum.LightBlockSourceBuild end ThreeSum.LightBlockSourceBuild namespace ThreeSum.LightReportingTerminalMasks end ThreeSum.LightReportingTerminalMasks namespace ThreeSum.LightSourceResidues end ThreeSum.LightSourceResidues namespace ThreeSum.LocalCoverBounds end ThreeSum.LocalCoverBounds namespace ThreeSum.RawIncidences end ThreeSum.RawIncidences namespace ThreeSum.RawPrefixCounts end ThreeSum.RawPrefixCounts namespace ThreeSum.RawReporting end ThreeSum.RawReporting namespace ThreeSum.ReportingHostFrontierLayout end ThreeSum.ReportingHostFrontierLayout namespace ThreeSum.ReportingHostMasks end ThreeSum.ReportingHostMasks namespace ThreeSum.ReportingHostTerminalFrontier end ThreeSum.ReportingHostTerminalFrontier namespace ThreeSum.SourceBuckets end ThreeSum.SourceBuckets namespace ThreeSum.StoredReporting end ThreeSum.StoredReporting namespace ThreeSum.SubsetAddress end ThreeSum.SubsetAddress namespace ThreeSumApsp end ThreeSumApsp universe u_1 u_2 u_3
theorem ThreeSum.LightReportingTerminalStored.program_meets : ∀ {lim : Light.Limits} {α : Type u_1} {β : Type u_2} {γ : Type u_3} [Fintype.{u_1} α] [Fintype.{u_2} β]
[Fintype.{u_3} γ] [inst : DecidableEq.{u_1 + 1} α] [DecidableEq.{u_2 + 1} β] [DecidableEq.{u_3 + 1} γ] {μ : Nat → Int}
{h J k srcL srcR offsetsL offsetsR flatL flatR NL NR occ maps candidates histL histR root masks masksL masksR base
bitBase rowOut work d : Nat}
(av : Int) (p : Nat) (shift : Int) (left right : Nat → Int)
(I : Finset.{max (max u_3 u_2) u_1} (ThreeSum.RawIncidences.RawItem.{u_1, u_2, u_3} h J α β γ))
(w : ThreeSum.RawReporting.Wanted.{u_1} h J α) (hk : @LE.le.{0} Nat instLENat k J)
(HF :
@ThreeSum.ReportingHostFrontierLayout.At.{u_1, u_2, u_3} α β γ inst h J μ I w root
(@ThreeSum.ReportingHostFrontierLayout.capacity.{u_1, u_2, u_3} α β γ inst h J I w) k)
(hcap :
@Eq.{1} Int
(μ
(@HAdd.hAdd.{0, 0, 0} Nat Nat Nat (@instHAdd.{0} Nat instAddNat) root
(@OfNat.ofNat.{0} Nat (nat_lit 3) (instOfNatNat (nat_lit 3)))))
(@Nat.cast.{0} Int instNatCastInt
(@ThreeSum.ReportingHostFrontierLayout.capacity.{u_1, u_2, u_3} α β γ inst h J I w)))
(HL :
ThreeSum.SourceBuckets.Stored μ
(fun (i : Nat) =>
ThreeSum.LightSourceResidues.key p (ThreeSum.BlockSourceEncoding.modulus h J)
(@OfNat.ofNat.{0} Int (nat_lit 0) (@instOfNat (nat_lit 0))) (left i))
NL (ThreeSum.BlockSourceEncoding.modulus h J) offsetsL flatL)
(HR :
ThreeSum.SourceBuckets.Stored μ
(fun (i : Nat) => ThreeSum.LightSourceResidues.key p (ThreeSum.BlockSourceEncoding.modulus h J) shift (right i))
NR (ThreeSum.BlockSourceEncoding.modulus h J) offsetsR flatR)
(hw : @LE.le.{0} Int Int.instLEInt (@Nat.cast.{0} Int instNatCastInt lim.space) lim.word)
(hd :
@LE.le.{0} Nat instLENat
(@HAdd.hAdd.{0, 0, 0} Nat Nat Nat (@instHAdd.{0} Nat instAddNat)
(@HAdd.hAdd.{0, 0, 0} Nat Nat Nat (@instHAdd.{0} Nat instAddNat)
(@HAdd.hAdd.{0, 0, 0} Nat Nat Nat (@instHAdd.{0} Nat instAddNat)
(@HAdd.hAdd.{0, 0, 0} Nat Nat Nat (@instHAdd.{0} Nat instAddNat) d
(@List.length.{0}
(List.{0}
(Finset.{0}
(Fin
(@HMul.hMul.{0, 0, 0} Nat Nat Nat (@instHMul.{0} Nat instMulNat)
(@OfNat.ofNat.{0} Nat (nat_lit 512) (instOfNatNat (nat_lit 512))) h))))
(@ThreeSum.ReportingHostFrontier.frontier.{u_1, u_2, u_3} α β γ inst h J I w k)))
(ThreeSum.LightReportingTerminalMasks.count h J k))
(@HMul.hMul.{0, 0, 0} Nat Nat Nat (@instHMul.{0} Nat instMulNat) J
(@HMul.hMul.{0, 0, 0} Nat Nat Nat (@instHMul.{0} Nat instMulNat)
(@OfNat.ofNat.{0} Nat (nat_lit 512) (instOfNatNat (nat_lit 512))) h)))
(@OfNat.ofNat.{0} Nat (nat_lit 11) (instOfNatNat (nat_lit 11))))
lim.depth)
(hsrcL : @LE.le.{0} Nat instLENat (@HAdd.hAdd.{0, 0, 0} Nat Nat Nat (@instHAdd.{0} Nat instAddNat) srcL NL) masks)
(hsrcR : @LE.le.{0} Nat instLENat (@HAdd.hAdd.{0, 0, 0} Nat Nat Nat (@instHAdd.{0} Nat instAddNat) srcR NR) masks)
(hoffsetsL :
@LE.le.{0} Nat instLENat
(@HAdd.hAdd.{0, 0, 0} Nat Nat Nat (@instHAdd.{0} Nat instAddNat)
(@HAdd.hAdd.{0, 0, 0} Nat Nat Nat (@instHAdd.{0} Nat instAddNat) offsetsL
(ThreeSum.BlockSourceEncoding.modulus h J))
(@OfNat.ofNat.{0} Nat (nat_lit 1) (instOfNatNat (nat_lit 1))))
masks)
(hoffsetsR :
@LE.le.{0} Nat instLENat
(@HAdd.hAdd.{0, 0, 0} Nat Nat Nat (@instHAdd.{0} Nat instAddNat)
(@HAdd.hAdd.{0, 0, 0} Nat Nat Nat (@instHAdd.{0} Nat instAddNat) offsetsR
(ThreeSum.BlockSourceEncoding.modulus h J))
(@OfNat.ofNat.{0} Nat (nat_lit 1) (instOfNatNat (nat_lit 1))))
masks)
(hflatL : @LE.le.{0} Nat instLENat (@HAdd.hAdd.{0, 0, 0} Nat Nat Nat (@instHAdd.{0} Nat instAddNat) flatL NL) masks)
(hflatR : @LE.le.{0} Nat instLENat (@HAdd.hAdd.{0, 0, 0} Nat Nat Nat (@instHAdd.{0} Nat instAddNat) flatR NR) masks)
(hocc : @LE.le.{0} Nat instLENat (@HAdd.hAdd.{0, 0, 0} Nat Nat Nat (@instHAdd.{0} Nat instAddNat) occ J) masks)
(hmaps :
@LE.le.{0} Nat instLENat
(@HAdd.hAdd.{0, 0, 0} Nat Nat Nat (@instHAdd.{0} Nat instAddNat) maps
(@HMul.hMul.{0, 0, 0} Nat Nat Nat (@instHMul.{0} Nat instMulNat)
(@HMul.hMul.{0, 0, 0} Nat Nat Nat (@instHMul.{0} Nat instMulNat)
(@OfNat.ofNat.{0} Nat (nat_lit 2) (instOfNatNat (nat_lit 2)))
(@HMul.hMul.{0, 0, 0} Nat Nat Nat (@instHMul.{0} Nat instMulNat)
(@OfNat.ofNat.{0} Nat (nat_lit 512) (instOfNatNat (nat_lit 512))) h))
(ThreeSum.GlobalEncoding.scheduleSize h)))
masks)
(hcandidates :
@LE.le.{0} Nat instLENat
(@HAdd.hAdd.{0, 0, 0} Nat Nat Nat (@instHAdd.{0} Nat instAddNat) candidates
(ThreeSum.GlobalEncoding.scheduleSize h))
masks)
(hleft :
@LE.le.{0} Nat instLENat
(@HAdd.hAdd.{0, 0, 0} Nat Nat Nat (@instHAdd.{0} Nat instAddNat) histL
(@HMul.hMul.{0, 0, 0} Nat Nat Nat (@instHMul.{0} Nat instMulNat) (ThreeSum.LightLocalCoverSchedule.rows h)
(ThreeSum.LocalCoverBounds.localPrime h)))
masks)
(hright :
@LE.le.{0} Nat instLENat
(@HAdd.hAdd.{0, 0, 0} Nat Nat Nat (@instHAdd.{0} Nat instAddNat) histR
(@HMul.hMul.{0, 0, 0} Nat Nat Nat (@instHMul.{0} Nat instMulNat) (ThreeSum.LightLocalCoverSchedule.rows h)
(ThreeSum.LocalCoverBounds.localPrime h)))
masks)
(hslot :
@LE.le.{0} Nat instLENat
(ThreeSum.ReportingHostFrontierLayout.slot root
(@ThreeSum.ReportingHostFrontierLayout.capacity.{u_1, u_2, u_3} α β γ inst h J I w)
(@HAdd.hAdd.{0, 0, 0} Nat Nat Nat (@instHAdd.{0} Nat instAddNat) k
(@OfNat.ofNat.{0} Nat (nat_lit 1) (instOfNatNat (nat_lit 1)))))
masks)
(hmasks :
@LE.le.{0} Nat instLENat
(@HAdd.hAdd.{0, 0, 0} Nat Nat Nat (@instHAdd.{0} Nat instAddNat) masks
(ThreeSum.LightReportingTerminalMasks.count h J k))
masksL)
(hmasksL :
@LE.le.{0} Nat instLENat
(@HAdd.hAdd.{0, 0, 0} Nat Nat Nat (@instHAdd.{0} Nat instAddNat) masksL
(ThreeSum.LightReportingTerminalMasks.count h J k))
masksR)
(hmasksR :
@LE.le.{0} Nat instLENat
(@HAdd.hAdd.{0, 0, 0} Nat Nat Nat (@instHAdd.{0} Nat instAddNat) masksR
(ThreeSum.LightReportingTerminalMasks.count h J k))
base)
(hstop :
@LE.le.{0} Nat instLENat
(ThreeSum.LightReportingTerminalPreparation.stop base
(@HMul.hMul.{0, 0, 0} Nat Nat Nat (@instHMul.{0} Nat instMulNat) J
(@HMul.hMul.{0, 0, 0} Nat Nat Nat (@instHMul.{0} Nat instMulNat)
(@OfNat.ofNat.{0} Nat (nat_lit 512) (instOfNatNat (nat_lit 512))) h))
(ThreeSum.LightReportingTerminalMasks.count h J k))
bitBase)
(hbits :
@LE.le.{0} Nat instLENat
(@HAdd.hAdd.{0, 0, 0} Nat Nat Nat (@instHAdd.{0} Nat instAddNat) bitBase
(@HMul.hMul.{0, 0, 0} Nat Nat Nat (@instHMul.{0} Nat instMulNat) J
(@HMul.hMul.{0, 0, 0} Nat Nat Nat (@instHMul.{0} Nat instMulNat)
(@OfNat.ofNat.{0} Nat (nat_lit 512) (instOfNatNat (nat_lit 512))) h)))
rowOut)
(hrowOut :
@LE.le.{0} Nat instLENat
(@HAdd.hAdd.{0, 0, 0} Nat Nat Nat (@instHAdd.{0} Nat instAddNat) rowOut
(@OfNat.ofNat.{0} Nat (nat_lit 2) (instOfNatNat (nat_lit 2))))
work)
(hspace : @LE.le.{0} Nat instLENat (ThreeSum.LightReportingTerminal.space work h J) lim.space)
(hword :
@LE.le.{0} Int Int.instLEInt (@Nat.cast.{0} Int instNatCastInt (ThreeSum.LightReportingTerminal.word h J)) lim.word)
(hoccRead :
∀ (j : Nat),
@LT.lt.{0} Nat instLTNat j J →
@Eq.{1} Int (μ (@HAdd.hAdd.{0, 0, 0} Nat Nat Nat (@instHAdd.{0} Nat instAddNat) occ j))
(@Nat.cast.{0} Int instNatCastInt
(@ThreeSum.BlockCoefficientRows.occurrenceIndices h J
(@ThreeSum.BlockEncoding.outputOccurrences h J
(@Prod.snd.{0, 0} (Fin (@OfNat.ofNat.{0} Nat (nat_lit 3) (instOfNatNat (nat_lit 3))))
(ThreeSum.GlobalEncoding.GlobalOutput h J)
(@Prod.snd.{u_1, 0} α
(Prod.{0, 0} (Fin (@OfNat.ofNat.{0} Nat (nat_lit 3) (instOfNatNat (nat_lit 3))))
(ThreeSum.GlobalEncoding.GlobalOutput h J))
w)))
j)))
(hcover : ThreeSum.BlockSourceCoverInput.Input μ h maps candidates histL histR)
(hreadL :
∀ (i : Nat),
@LT.lt.{0} Nat instLTNat i NL →
@Eq.{1} Int (μ (@HAdd.hAdd.{0, 0, 0} Nat Nat Nat (@instHAdd.{0} Nat instAddNat) srcL i)) (left i))
(hreadR :
∀ (j : Nat),
@LT.lt.{0} Nat instLTNat j NR →
@Eq.{1} Int (μ (@HAdd.hAdd.{0, 0, 0} Nat Nat Nat (@instHAdd.{0} Nat instAddNat) srcR j)) (right j))
(hvaluesL :
∀ (i : Nat),
@LT.lt.{0} Nat instLTNat i NL →
@LE.le.{0} Int Int.instLEInt (@abs.{0} Int instLatticeInt Int.instAddGroup (left i)) lim.word)
(hvaluesR :
∀ (j : Nat),
@LT.lt.{0} Nat instLTNat j NR →
@LE.le.{0} Int Int.instLEInt (@abs.{0} Int instLatticeInt Int.instAddGroup (right j)) lim.word)
(ha : @LE.le.{0} Int Int.instLEInt (@abs.{0} Int instLatticeInt Int.instAddGroup av) lim.word)
(htarget :
∀ (i : Nat),
@LT.lt.{0} Nat instLTNat i NL →
@LE.le.{0} Int Int.instLEInt
(@abs.{0} Int instLatticeInt Int.instAddGroup
(@HAdd.hAdd.{0, 0, 0} Int Int Int (@instHAdd.{0} Int Int.instAdd) av (left i)))
lim.word)
(hcountWord :
@LE.le.{0} Int Int.instLEInt
(@Nat.cast.{0} Int instNatCastInt (@HMul.hMul.{0, 0, 0} Nat Nat Nat (@instHMul.{0} Nat instMulNat) NL NR))
lim.word),
Light.Meets lim ThreeSum.LightReportingTerminalStored.program
(@OfNat.ofNat.{0} Nat (nat_lit 40) (instOfNatNat (nat_lit 40))) d
(@List.cons.{0} Int av
(@List.cons.{0} Int (@Nat.cast.{0} Int instNatCastInt srcL)
(@List.cons.{0} Int (@Nat.cast.{0} Int instNatCastInt srcR)
(@List.cons.{0} Int (@Nat.cast.{0} Int instNatCastInt offsetsL)
(@List.cons.{0} Int (@Nat.cast.{0} Int instNatCastInt flatL)
(@List.cons.{0} Int (@Nat.cast.{0} Int instNatCastInt offsetsR)
(@List.cons.{0} Int (@Nat.cast.{0} Int instNatCastInt flatR)
(@List.cons.{0} Int (@Nat.cast.{0} Int instNatCastInt NL)
(@List.cons.{0} Int (@Nat.cast.{0} Int instNatCastInt NR)
(@List.cons.{0} Int (@Nat.cast.{0} Int instNatCastInt (ThreeSum.BlockSourceEncoding.modulus h J))
(@List.cons.{0} Int (@Nat.cast.{0} Int instNatCastInt J)
(@List.cons.{0} Int
(@HMul.hMul.{0, 0, 0} Int Int Int (@instHMul.{0} Int Int.instMul)
(@OfNat.ofNat.{0} Int (nat_lit 512) (@instOfNat (nat_lit 512)))
(@Nat.cast.{0} Int instNatCastInt h))
(@List.cons.{0} Int (@Nat.cast.{0} Int instNatCastInt h)
(@List.cons.{0} Int
(@Nat.cast.{0} Int instNatCastInt (ThreeSum.LocalCoverBounds.localPrime h))
(@List.cons.{0} Int
(@Nat.cast.{0} Int instNatCastInt (ThreeSum.LocalCoverBounds.localBucketCap h))
(@List.cons.{0} Int (@Nat.cast.{0} Int instNatCastInt occ)
(@List.cons.{0} Int (@Nat.cast.{0} Int instNatCastInt maps)
(@List.cons.{0} Int (@Nat.cast.{0} Int instNatCastInt candidates)
(@List.cons.{0} Int (@Nat.cast.{0} Int instNatCastInt histL)
(@List.cons.{0} Int (@Nat.cast.{0} Int instNatCastInt histR)
(@List.cons.{0} Int (@Nat.cast.{0} Int instNatCastInt k)
(@List.cons.{0} Int (@Nat.cast.{0} Int instNatCastInt root)
(@List.cons.{0} Int (@Nat.cast.{0} Int instNatCastInt masks)
(@List.cons.{0} Int (@Nat.cast.{0} Int instNatCastInt masksL)
(@List.cons.{0} Int (@Nat.cast.{0} Int instNatCastInt masksR)
(@List.cons.{0} Int (@Nat.cast.{0} Int instNatCastInt base)
(@List.cons.{0} Int (@Nat.cast.{0} Int instNatCastInt bitBase)
(@List.cons.{0} Int (@Nat.cast.{0} Int instNatCastInt rowOut)
(@List.cons.{0} Int (@Nat.cast.{0} Int instNatCastInt work)
(@List.nil.{0} Int))))))))))))))))))))))))))))))
μ (@ThreeSum.LightReportingTerminalStored.time.{u_1, u_2, u_3} α β γ inst h J p shift left right NL NR I w k)
fun (r : Int) (ν : Nat → Int) =>
And
(Or (@Eq.{1} Int r (@OfNat.ofNat.{0} Int (nat_lit 0) (@instOfNat (nat_lit 0))))
(@Eq.{1} Int r (@OfNat.ofNat.{0} Int (nat_lit 1) (@instOfNat (nat_lit 1)))))
(And
(Iff (@Eq.{1} Int r (@OfNat.ofNat.{0} Int (nat_lit 1) (@instOfNat (nat_lit 1))))
(∃ (pre :
List.{0}
(Finset.{0}
(Fin
(@HMul.hMul.{0, 0, 0} Nat Nat Nat (@instHMul.{0} Nat instMulNat)
(@OfNat.ofNat.{0} Nat (nat_lit 512) (instOfNatNat (nat_lit 512))) h)))),
And
(@Membership.mem.{0, 0}
(List.{0}
(Finset.{0}
(Fin
(@HMul.hMul.{0, 0, 0} Nat Nat Nat (@instHMul.{0} Nat instMulNat)
(@OfNat.ofNat.{0} Nat (nat_lit 512) (instOfNatNat (nat_lit 512))) h))))
(List.{0}
(List.{0}
(Finset.{0}
(Fin
(@HMul.hMul.{0, 0, 0} Nat Nat Nat (@instHMul.{0} Nat instMulNat)
(@OfNat.ofNat.{0} Nat (nat_lit 512) (instOfNatNat (nat_lit 512))) h)))))
(@List.instMembership.{0}
(List.{0}
(Finset.{0}
(Fin
(@HMul.hMul.{0, 0, 0} Nat Nat Nat (@instHMul.{0} Nat instMulNat)
(@OfNat.ofNat.{0} Nat (nat_lit 512) (instOfNatNat (nat_lit 512))) h)))))
(@ThreeSum.ReportingHostFrontier.frontier.{u_1, u_2, u_3} α β γ inst h J I w k) pre)
(@ThreeSum.ReportingHostTerminalBatch.Hit h J av p shift left right NL NR
(@Prod.snd.{0, 0} (Fin (@OfNat.ofNat.{0} Nat (nat_lit 3) (instOfNatNat (nat_lit 3))))
(ThreeSum.GlobalEncoding.GlobalOutput h J)
(@Prod.snd.{u_1, 0} α
(Prod.{0, 0} (Fin (@OfNat.ofNat.{0} Nat (nat_lit 3) (instOfNatNat (nat_lit 3))))
(ThreeSum.GlobalEncoding.GlobalOutput h J))
w))
k pre)))
(Light.Kept μ ν masks)) := by
sorry