Skip to content

Option-D reference-0 cleanup campaign: item-specific dead-declaration deletion (post-_bundle-exhaustion) #4692

Description

@phasetr

Authorization

The user has explicitly authorized (2026-07-24) investigation and deletion of genuinely-dead reference-0 declarations:

時間と労力がかかっても構わない. 慎重に調べて余計なものは削除しろ

This campaign conducts item-specific dead-declaration deletion from the ~1,665-candidate reference-0 pool identified after the exhausted _bundle pattern sweep (#4665#4690, main 9a7b2c3).

Context & related: see .self-local/reports/handoff-2026-07-24-campaign-exhausted.md and memory project_refactor_buildspeed_2026_07_20.md.

Scope

This issue does NOT authorize:

Those remain separately gated.

Folded-in work: #4559 items

Issue #4559 "Follow-up: detached subtree, zero-ref decl, unused import (out of #4557 dedup scope)" contains three pre-vetted items that now fall under this Option-D authorization and are incorporated as the first work batch:

  1. Item 1: Delete IsingModel/ClusterExpansion/MayerCore/Truncations.lean and MayerTermThreeEval.lean (doc-sync-gated, conditionally).
  2. Item 2: alternatingConnectedSubgraphSum_cycleGraph_seven (already resolved by refactor: drop six reference-0 declarations covered by the general cycle closed form #4636 cleanup).
  3. Item 3: Remove unused import from IsingModel/ClusterExpansion/StrictPositivity/IffCharacterisations.lean:1 (pure hygiene, first-batch target).

#4559 will be closed once its 3 items are fully disposed via PRs.

Keep-Criteria (frozen, authoritative for this campaign)

A reference-0 declaration MUST BE KEPT (i.e., is NOT deletion-eligible) if it is ANY of:

Only declarations that are reference-0 AND fail ALL of (a)–(g) AND do not transitively feed any kept result are deletion-eligible. When uncertain, KEEP — do not resolve ambiguity in favor of deletion. This mirrors the already-litigated false-positive lesson (10/22 in Profile.lean audit, #4639) and the two REFUTED tier-2 candidates from 2026-07-21 recorded in project_abstraction_candidates_2026_07_21.md.

Per-PR Verification Protocol

For each PR claiming reference-0 deletions, dev-issue-manager applies after closure:

  1. Evidence-of-dead check: every deleted declaration must have a recorded rg -n scan showing zero consumers (both declaration-side and consumer-side, per the 2026-07-21 lesson), AND explicit confirmation it fails all keep-criteria (a)–(g) with citation of the grep/search used for each. Unicode-aware tokenization only (no naive ASCII word-boundary scanner — recurring bug noted 2026-07-21).

  2. Build health: lake build reproduces zero warnings post-deletion (not just pre-deletion baseline).

  3. Axiom/sorry hygiene: grep -rn "sorry" IsingModel/ = 0, grep -rn "^axiom" IsingModel/ = 0 (or repo-standard axiom-decl scan), and #print axioms on any touched/downstream theorem still yields exactly [propext, Classical.choice, Quot.sound].

  4. Docs/tex staleness: rg docs/index.md and tex/proof-guide.tex for the deleted declaration names — zero stale references remain (any hit must be fixed in the same PR, not deferred).

  5. Three-layer sync: canonical (docs/index.md, if it ever cites the item), local mirror .self-local/issues/<n>.md, and the GitHub issue body/checklist all reflect the actual deletion set (no ledger drift), following the pattern already used in .self-local/issues/4691.md.

Any single failure above → PR does not close its issue; issue-manager reports unresolved.

Status

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions