The core procedure of the modular counting oracle writes all counts of the candidates (Lemma 4.1)
ProvedLight.Filter.oCore_specLet be a program containing the procedures of the counting oracle (OCoreCtx: the procedures of the host of Theorem 17 that it reuses, the loop over the instances, and a #Lop-AE-SparseTri solver with time and need ). Let be an oracle instance: an Exact Triangle instance with vertices per part and weight bound (three matrices , , in memory), a block size , a modulus and a place cnt for the counts, with the precondition x.Pre at free pointer , the host ready at depth for the data of the instances (oDataOf x), and the limits HostLim allowing the host and the solver.
Then the core body oCoreBody, run in the frame oCoreArgs x f, ends within steps and leaves the memory with the list cntList n s p AB BC AC at cnt (for the candidate , the number of in the block with ), changing no other cell below .
Lemma 4.1: with , the count is the number of common neighbours of and in the lopsided graph with , ; the queries are grouped by and cut into chunks, so each block costs at most solver calls at inner dimension .
/-
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
-/
-- Generated by skeleton subtraction from the ThreeSumApsp library at commit 7c34437be804.
import Definitions.Def_APSP2996001_Defs2
set_option autoImplicit false
set_option relaxedAutoImplicit false
open Light
open Light.Filter
open ThreeSumApsp ThreeSumApsp.Spec Light.Sec3 Light.Sec3.Et17
variable {lim : Limits} {d : ℕ}
theorem Light.Filter.oCore_spec {P₀ R : Program} {ν : ONums} {Tn : List ℕ → ℕ} {need : List ℕ → Light.Need}
(C : OCoreCtx P₀ R ν Tn need) (x : OracleInst) (μ : ℕ → ℤ) (fr : ℕ) (hpre : x.Pre μ fr)
(hr : Ready lim d x.toTriInst (oDataOf x) μ fr)
(hlim : HostLim lim (d + 1) (oDataOf x) x.U (hostAddr x.toTriInst (oDataOf x) fr) need) :
Ends lim (P₀ ++ R) d (oCoreBody ν) ⟨Light.frame (oCoreArgs x fr), μ⟩
(et17Addr.blockCost + tCoreRun Tn (oDataOf x) x.U)
fun σ' => Seg σ'.mem x.cnt (cntList x.n x.s x.p x.AB x.BC x.AC) ∧
KeptBut μ σ'.mem fr x.cnt x.len := by sorry