Skip to content

refactor(List/GetD, Kolmogorov/TimeBounded): shared getD membership; move the poly-time K^t bound - #4529

Merged
SamuelSchlesinger merged 1 commit into
mainfrom
refactor/getd-mem-timebounded
Nov 11, 2026
Merged

SamuelSchlesinger merged 1 commit into
mainfrom
refactor/getd-mem-timebounded

Conversation

@SamuelSchlesinger

@SamuelSchlesinger SamuelSchlesinger commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Follow-ups from the #4447 reviews. Infrastructure only: no statement changes and no new mathematics.

What changed.

  • List.getD_mem (l.getD i d ∈ l for i < l.length) is new, in Foundations/Data/List/GetD.lean (upstream: Mathlib candidate). It replaces the private getD_formulas_mem in Kolmogorov/MINKTStar/Generator.lean, the private getD_mem_of_lt in PolyTime/LinearAlgebra/CopyPlacement.lean, and the inline step in MCSP/PartialHardness/Completeness.lean.
    • Placement. Core, Batteries and Mathlib have no such lemma; the closest are List.getD_eq_getElem and List.getElem_mem, which every copy composed. It lives in a new small module rather than next to List.getD_mem_or in Foundations/Data/List/Lookup.lean: Lookup has 102 direct and about 2200 transitive importers, so a new public declaration there would rebuild all of them (perf(build): reduce cache invalidation from growing hub modules #569).
  • exists_timeBounded_of_computableInPolyTime moves unchanged from Kolmogorov/AverageCase.lean, which imports probability, to the new Kolmogorov/TimeBounded/PolyTime.lean. AverageCase keeps its specialization, exists_timeBounded_generator_le, and now imports the new module.
    • MINKTStar/Generator/PolyTime imports the new module instead of AverageCase, so the MINKT* generator no longer imports AverageCase, Entropy.BitString, PMF.Bool or Complexity.AverageCase. PMF.Bind, PMF.Map and PMF.ToReal still arrive through the hash family.
    • OneWay/LiuPass imports the new module directly.

Not done; candidates for a later cleanup.

Manuals.

  • Operator's Manual: the K^t paragraph of metacomplexity-and-methods gains a sentence locating exists_timeBounded_of_computableInPolyTime in its new module.
  • Agent Operator's Manual: no edit needed, since no workflow, tooling or policy changes.
  • No registry or ROADMAP change: neither declaration has a registry entry.

Validation.

AI disclosure: written by an AI agent (meta-proj, Jetski) working for @SamuelSchlesinger. This is not human review.

…move the poly-time K^t bound

List.getD_mem replaces the private getD_formulas_mem (MINKTStar/Generator)
and getD_mem_of_lt (CopyPlacement) and an inline step in
PartialHardness/Completeness. It lives in a new small module rather than
Foundations/Data/List/Lookup, whose interface 2200 modules depend on.

exists_timeBounded_of_computableInPolyTime moves unchanged from
Kolmogorov/AverageCase, which imports probability, to the new
Kolmogorov/TimeBounded/PolyTime; MINKTStar/Generator/PolyTime now imports
it there instead of AverageCase, and LiuPass imports it directly.

Follow-ups from the #4447 reviews; infrastructure only.
@SamuelSchlesinger

Copy link
Copy Markdown
Collaborator Author

Agent review (reviewer review-4529, Jetski session 66593da7-0927-4c8a-ab74-00bba570565b) of 6c38a34: approve.

List.getD_mem is not in core, Batteries, Mathlib or cslib; the closest are getD_eq_getElem, getElem_mem and getD_surjective_iff. Its name and argument shape (explicit default, implicit list) follow getElem_mem and getD_eq_getElem, and the module imports only Init and Mathlib.Data.List.GetD. The three replaced copies were private or inline, so no public statement changes and there are no aliases. exists_timeBounded_of_computableInPolyTime is byte-identical in its new module, whose import closure has no probability modules. Plain imports are right for AverageCase, Generator/PolyTime and LiuPass, since each uses it only inside proofs. The manual sentence is accurate, and I agree the Agent Operator's Manual needs no edit.

Record fix (no new head needed): the count of remaining copies is low. getD_eq_getElem followed by getElem_mem still appears at about 110 sites in 77 files, not about 25. The largest are Li/Berlekamp (6), Quantum/PathNetwork (6), TreeSignature/Security (4), BoundedIncidenceSemantics (4) and Planar/PairedGeometry (4). #4447 is closed, so please correct the count and record the follow-up in an open issue rather than only in this PR body.

Nit: Generator/PolyTime does drop AverageCase, Entropy.BitString, PMF.Bool and Complexity.AverageCase from its closure. PMF basics such as PMF.Bind still arrive through the hash family, though, so "no longer pulls in AverageCase's probability imports" is slightly broad.

Agent review, not human review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant