Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Step 2 of a stage: assigning the AAA-queries in increasing order of TTT

Definition
AvgPHETH_Supplement_aFill

by iris · Nov 22, 2026 · Mathlib 0df444a (Lean v4.33.1)

average-case-complexitycomplexity-theoryoracle-constructionp2o-gran-per-chapterp2o-plan-paperp2o-v1

In stage iii of the oracle construction, all valid AAA-queries q=(⟨M,d⟩,u,1T16)q=(\langle M,d\rangle,u,1^{T^{16}})q=(⟨M,d⟩,u,1T16) with i(T)=ii(T)=ii(T)=i are assigned, in increasing order of TTT, each by the rule A(q)=1,0,⊥A(q)=1,0,\botA(q)=1,0,⊥ according to whether fq≡1f_q\equiv1fq​≡1, fq≡0f_q\equiv0fq​≡0 or neither.

This definition is the table of AAA-answers after the queries with time parameter below a given bound have been processed, starting from the table of the earlier stages.

Formalization Note Queries with the same TTT are answered from the table of the smaller time parameters.

Definition code
import Mathlib
import Definitions.Def_AvgPHETH_Supplement_aAnswer
import Definitions.Def_AvgPHETH_Supplement_stageOf

namespace AvgPHETH.Supplement

open KarpLiptonOM

/-- Step 2 of stage `stage` of the oracle construction, carried out for the time parameters `T < N`
(Hirahara–Juvekar–Nanashima, *Average-Case Hardness of PH from ETH-Type Hypotheses*, manuscript of November 3, 2026 (STOC 2027 submission; held version sha256 ea5fd472…), §8.1, step 2, p.41 (PDF 43)): "For all valid `A`-queries
`q = (⟨M, d⟩, u, 1^{T^16})` with `i(T) = i`, in increasing order of `T`", set `A(q)` by `aAnswer`.
`aFill ε mach ρ stage tab N` is the table of `A`-answers after the queries with `T < N` have been
processed, starting from the table `tab` of the earlier stages.

**Formalization Note** The queries with the same `T` are answered from the table of the smaller time
parameters. Valid means `d ≥ 1` and `T ≥ max{2, d|u|}`; `stageOf` is `i(T)`. -/
noncomputable def aFill (ε : ℕ → ℝ) (mach : ℕ → OracleTM) (ρ : CVar → Option (List Bool))
    (stage : ℕ) (tab : ℕ → ℕ → List Bool → ℕ → Option Bool) :
    ℕ → ℕ → ℕ → List Bool → ℕ → Option Bool
  | 0 => tab
  | N + 1 => fun i d u T =>
      if T = N ∧ stageOf N = stage ∧ 1 ≤ d ∧ max 2 (d * u.length) ≤ N then
        aAnswer ε mach (aFill ε mach ρ stage tab N) ρ i d u N
      else aFill ε mach ρ stage tab N i d u T

end AvgPHETH.Supplement
Source
Hirahara–Juvekar–Nanashima, Average-Case Hardness of PH from ETH-Type Hypotheses, manuscript of November 3, 2026 (STOC 2027 submission; held version sha256 ea5fd472…), §8.1, step 2, p.41 (PDF 43)

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