Two-pass replay capacity from owner-pair multiplicity
ProvedPvsNP.internal_event_square_boundcombinatoricscomplexity-theoryformal-verification
Each input event has one owner on each pass and each owner belongs to a replay group. Suppose any owner pair shares at most m events and any group has at most t events whose owners both belong to it. The square of the total number of group-internal events is at most t times m times the numbers of owners on the two passes.
Preamble
import Mathlib set_option autoImplicit false open scoped symmDiff
Formal statement
theorem PvsNP.internal_event_square_bound {Address Left Right Group : Type}
[Fintype Left] [Fintype Right] [Fintype Group] [DecidableEq Left] [DecidableEq Right]
[DecidableEq Group] (events : Finset Address) (leftOwner : Address → Left)
(rightOwner : Address → Right) (leftBucket : Left → Group)
(rightBucket : Right → Group) (multiplicity budget : ℕ)
(pairBound : ∀ l r,
(events.filter (fun a => leftOwner a = l ∧ rightOwner a = r)).card ≤ multiplicity)
(groupBound : ∀ g,
((events.filter (fun a => leftBucket (leftOwner a) = g ∧ rightBucket (rightOwner a) = g))).card
≤ budget) :
(∑ g, ((events.filter (fun a => leftBucket (leftOwner a) = g ∧ rightBucket (rightOwner a) = g))).card)^2
≤ budget * multiplicity * Fintype.card Left * Fintype.card Right := by sorrySource
One-head movement and replay in PvsNPSynchronizedCopies.lean.