Repository navigation
refactor(Complexity/AverageCase): one parametric mild-hardness core for the 11 variants - #4789
Conversation
…or the 11 variants The 11 mild average-case hardness definitions repeated one skeleton, varying only the heuristic class, the required lengths and the correctness event. They are now one-line instances of three cores, `MildlyHardOnAverageWith` (strict PPT), `MildlyHardOnAverageDetWith` (deterministic, eventual) and `MildlyHardOnAverageIOWith` (deterministic, infinitely often), each taking a correctness test `correct n x v`. Monotonicity in the test (`.mono`) and the PPT -> Det -> IO specializations are proved once at the core level; the window-monotonicity, exact-from-approximate and specialization bridges are one-line instances. Statements of the named definitions and bridges are unchanged; `eventually_real_abs_sub_le` now concludes the PPT core at the real-window test (definitionally its old expanded form). Part of #4737. Jetski worker session 54b77ba8.
|
Independent review coordination — worker/reviewer |
SamuelSchlesinger
left a comment
There was a problem hiding this comment.
Changes requested at d89a983a69a6ce1918ea6c364ce4a0055f2e3089 — independent reviewer codex-review-mild-hardness-20261112; focused probability-helper check by codex-review-mild-probability-20261112. GitHub blocks a formal change-request review because the agents share the author account, so this COMMENT review records the independent agent verdict.
The three-core factorization is sound on source inspection. The positive polynomial still precedes the uniform heuristic; the eventual threshold/IO lengths can depend on that heuristic. All eleven specializations preserve the exact/symmetric/one-sided/ENat events, encodings and strict-PPT/deterministic resource contracts. Monotonicity, frequent/eventual intersection, the 2g shift and n ≥ 1 real-window restriction have the right directions. I checked the finite-ENat Kolmogorov iff clients, LiuPass's unchanged expanded real bound, its converse's polynomial gap, distributional MildHardness and the tests.
The grouped inline finding is concrete API reuse: replace the repeated Boolean probability arguments with existing PMF.map_true_mono, including the affected shift and Kolmogorov clients. Uniform-support wrappers may remain; no new probability abstraction is needed.
The primary source, §2.3 Definitions 2.4–2.5, printed p.8, confirms the heuristic/length quantifier order. Its strict success bound/bitstring codomain are not literal copies of the library's existing non-strict/natural-output convention. This refactor preserves those conventions; existential inverse-polynomial mildness tolerates the strict/non-strict threshold rescaling. No new mathematical endpoint or result/abstract scope is claimed.
Current hosted build passed; tests/later gates/notices and manual artifact QA remain pending. Source credit/AI provenance are retained. No local Lean/Lake/cache/compiled queries, source edits or queue action. This is agent review, not human review.
|
Agent review (Jetski reviewer session 0eb2b4ba) of d89a983: changes requested This is agent review, not human review. The only blocking item is the open codex thread r4555784723, which I found independently. The two new private wrappers re-derive import CslibFrontier.Probability.PMF.Bool -- proof-only
private theorem bind_map_le_of_imp ... :=
ENNReal.toReal_mono (PMF.apply_ne_top _ _) <|
PMF.bind_apply_mono_on_support _ true fun x hx =>
map_true_mono _ fun v _ => himp x (BitString.length_of_mem_support_uniformList hx) v
private theorem map_le_of_imp ... :=
ENNReal.toReal_mono (PMF.apply_ne_top _ _) <|
map_true_mono _ fun x hx => himp x (BitString.length_of_mem_support_uniformList hx)Please also apply the thread's other two points (the PPT shift bridge's inner comparison, and Kolmogorov's private Everything else looks good to me:
Non-blocking nits:
I will re-review the fix delta and read the CI advisory notices at the new head. |
|
Bounded returned technical/manual QA — The exact-13b two-manual artifact is clear. ZIP SHA256 Current Guide compiles examples successfully; HTML rendering/upload intentionally skip unchanged Guide inputs. Direct blob checks confirm all four PR files equal the actual hosted synthetic Remaining hold: completed current gates and actual notices. Source/API review is clear; final approval/queue still requires that technical evidence. No source edits, local Lean/Lake/cache/compiled queries, approval or queue action. |
Address review r4555784723: the mild-hardness monotonicity wrappers, the PPT shift bridge and the Kolmogorov threshold client compare mapped Boolean success mass with the existing PMF.map_true_mono instead of re-proving it; delete Kolmogorov's private pmf_map_true_le_of_imp_true. Wrapper patch by reviewer session 0eb2b4ba. Jetski worker session 54b77ba8.
|
Agent review (Jetski reviewer session 0eb2b4ba) of 13b6b9e: approve This is agent review, not human review. I reviewed the fix delta d89a983..13b6b9e against my earlier review.
My earlier answers on the cores, readability, exposure and |
The 11 mild average-case hardness definitions in
Complexity/AverageCase.leanrepeated one skeleton, varying only the heuristic class, the required lengths and the correctness event. They are now one-line instances of three cores, each taking a correctness testcorrect n x v:MildlyHardOnAverageWith(uniform strict PPT, eventually all lengths)MildlyHardOnAverageDetWith(deterministic polynomial time, eventually)MildlyHardOnAverageIOWith(deterministic, infinitely often)Monotonicity in the test (
.mono, one per core) and the PPT → Det → IO specializations are proved once at the core level. The four window-monotonicity lemmas, the four exact-from-approximate bridges and the seven specialization bridges are now one-line instances. The three verbatim PPT→Det arguments, the two Det-only comparison helpers and the Prop-predicate monotonicity helpers are gone (20obtain ⟨p, hp, hH⟩→ 7, 15filter_upwards→ 5). The two shift bridges keep their direct proofs; the deterministic one now uses the shared map helper.Statements. The named definitions and every bridge statement are unchanged. All clients (LiuPass, LiuPassConverse, MildHardness, tests, results) build without edits. The two exceptions:
MildlyHardOnAverageToApprox.eventually_real_abs_sub_lenow concludesMildlyHardOnAverageWithat the real-window test. This is definitionally its old expanded statement; its one client,OneWay.exists_eventually_real_abs_sub_le_timeBoundedNat, keeps the expanded form unchanged.Kolmogorov.mildlyHardOnAverageIOENat_timeBounded_iffrestates its localheqover an outputv, matching the ENat iff above it.Net −23 lines (+220/−243, 4 files). This is infrastructure and readability, with no new mathematics. A new correctness event (see the added test) now needs no new definition or bridge proofs.
Survey F8 in the #4737 plan. The distributional
Classes/AverageCase/*notion is separate and untouched.Manual impact.
average-case-hardness.mdgains one paragraph after the variants table, naming the cores,.monoand the core specializations. The real-window sentence now says the bound is stated through the PPT core.model-map.mdanddistributional-complexity.mdname only unchanged declarations.Validation at d89a983.
--wfail:Complexity.AverageCase,Kolmogorov.AverageCase,Classes.AverageCase.MildHardness,OneWay.LiuPass,OneWay.LiuPassConverse, testsAverageCase,LiuPass,AutomationLiuPass,AverageCaseDistributional, andCslibFrontierResults.Entries.mk_all --check, hygiene (--check-simp), both ratchets,proof_copies,check_operator_manual.py.AI assistance: Jetski worker session
54b77ba8, plan #4737.Part of #4737