Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Charged priority selection preserves recursive machine memory

Proved
NearlyOptimalPPR.Computation.priority_exec

by Shuze Chen · Nov 19, 2026 · Mathlib 0df444a (Lean v4.33.1)

The priority routine scans the open recursion levels and selects exactly the pending exterior push prescribed by the logical state. It preserves that state, the input/output representation, all epoch marks, and the graph-query count. Let hhh be the current top level, M,M′M,M'M,M′ the initial and final heap masses, w=16(ℓ+3)w=16(\ell+3)w=16(ℓ+3) the vertex-record width, rrr the queue rank, LLL its array length, and PPP the queue-cleaning coefficient. If the represented heap fits a capacity below 2r2^r2r and r<Lr<Lr<L, there is a finite execution with

M′≤M,t+PM′≤PM+(h+1)(2P+21r+20w+120)+6.M'\le M,\qquad t+PM'\le PM+(h+1)(2P+21r+20w+120)+6.M′≤M,t+PM′≤PM+(h+1)(2P+21r+20w+120)+6.

Here ttt is its instruction count and the increase in charged work. The coefficient PPP is the explicit cleaning bound in the runtime interface. The routine remains ready for the next controller instruction. This contract makes lazy queue cleanup reusable without assuming that a priority queue contains no stale entries.

Preamble
import Definitions.Def_NearlyOptimalPPR_Computation_compiler_runtime
open Finset Matrix
open scoped ENNReal
set_option autoImplicit false
noncomputable section
attribute [local instance] Classical.propDecidable
Formal statement
namespace NearlyOptimalPPR.Computation
open SparseQueue
theorem priority_exec (m : SolveModel) {n : ℕ} (g : InputGraph n) (ω : ℕ → Bool)
    (logical : RecursiveState n) (s : Fin n) (α ε : ℝ) (ell length capacity rank : ℕ)
    (st : MachineState) (hh : st.scalar.halted=false)
    (pm : RecursiveMachineMemory g s α ε ell length logical st)
    (hDepth : logical.top ≤ ell) (hMass : pm.queueMass ≤ capacity) (hcap : rank < length) (hpow : capacity < 2^rank) :
    ∃ steps out, ∃ memory : RecursiveMachineMemory g s α ε ell length logical out,
      MachineEval m g ω priorityCode st steps out ∧ PendingSelectionSpec logical out ∧
      memory.queueMass ≤ pm.queueMass ∧
      steps+(cleanBodyBound (16*(ell+3)) length rank+2)*memory.queueMass ≤
        (cleanBodyBound (16*(ell+3)) length rank+2)*pm.queueMass+
        (logical.top+1)*(2*(cleanBodyBound (16*(ell+3)) length rank+2)+(21*rank+20*(16*(ell+3))+70)+50)+6 ∧
      out.scalar.queries=st.scalar.queries ∧ out.work=st.work+steps ∧ out.output=st.output ∧ out.scalar.halted=false ∧
      (∀ v : Fin n, out.scalar.integerMemory (vertexRecordAddress (16*(ell+3)) v.val 7)=
        st.scalar.integerMemory (vertexRecordAddress (16*(ell+3)) v.val 7)) := by sorry
end NearlyOptimalPPR.Computation
Source
Li, Xu, Yang, Zhou, Nearly optimal Personalized PageRank computation, STOC 2027 submission #884, https://github.com/sigact-stoc/stoc2027/releases/download/papers-1/884.pdf, Algorithms 1 and 6–9, pp. 5,14–22; charged local-machine realization of the mission computational model.

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me