Documentation

CslibFrontier.Algorithms.ExactTriangle.FailureAccounting

One false-positive budget for distinct record/query occurrences #

Lists within distinct existing instances inject into the existing global failedScans set. Consequently their failed accepted occurrences share one falsePositiveCount bound. This finite bridge does not multiply that bound by the number of records. A native caller must derive list membership, nonrepetition and answers from its actual execution/readback.

The counting argument adapts Host.FailedScans.sum_fails_le from anthropics/formal-math@16a5ce41304fcdaea4e0be7c132e1c361dc26da5, using the existing local finite instances and failed-scan API rather than a second host-data model.

theorem Cslib.Algorithms.ExactTriangle.sum_failed_occurrences_le {n D g p : ℕ} (wAB wBC wAC : Fin n → Fin n → ℤ) (hp : p ≠ 0) (ans : InstanceIndex p → Fin n × Fin n → Bool) (hans : AnswersCorrect wAB wBC wAC D g p ans) (I : Finset (InstanceIndex p)) (hI : I ⊆ instanceIndices wAB D g p) (queries : InstanceIndex p → List (Fin n × Fin n)) (default : Fin n × Fin n) (hnodup : ∀ idx ∈ I, (queries idx).Nodup) (hquery : ∀ idx ∈ I, ∀ q ∈ queries idx, q ∈ (lopInstance wAB wBC wAC D g p idx).W) :
∑ idx ∈ I, Nat.count (fun (j : ℕ) => ans idx ((queries idx).getD j default) = true ∧ scanPiece wAB wBC wAC D g idx.piece ((queries idx).getD j default).1 ((queries idx).getD j default).2 = none) (queries idx).length ≤ falsePositiveCount wAB wBC wAC p

Failed accepted occurrences across distinct records inject into the single global failed-scan set. Lists may be partial chunks, but each occurrence list must be repetition-free.