Skip to content

fix(lean): repair Voting.lean baseline build (indent + add Voting to CI) - #886

Merged
jsboige merged 1 commit into
mainfrom
fix/voting-baseline-indent-build
May 10, 2026
Merged

jsboige merged 1 commit into
mainfrom
fix/voting-baseline-indent-build

Conversation

@jsboige

@jsboige jsboige commented May 10, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fix 2 indentation bugs in median_voter_theorem (L242 + L246) introduced in 592147a4 and propagated through every Voting.lean change since
  • lake build SocialChoice.Voting now SUCCESS on Windows native (3286 jobs)
  • sorry count = 2 baseline preserved (L251 median completion, L445 maximal chain)

Root cause

CI workflow lean-social-choice.yml only checks Arrow / Sen / Framework / Basic for sorry — Voting.lean has never been built by CI. The bug survived multiple PRs (notably the broken #866 + the corrective #885) because no one ran lake build SocialChoice.Voting locally.

Verification

$ lake build SocialChoice.Voting
warning: SocialChoice/Voting.lean:281:0: ... (unused section vars, harmless)
warning: SocialChoice/Voting.lean:439:8: declaration uses `sorry`
Build completed successfully (3286 jobs).

$ grep -c sorry SocialChoice/Voting.lean
2
$ grep -n sorry SocialChoice/Voting.lean
251:  · sorry -- TODO: median beats all others in single-peaked profile
445:  sorry -- TODO: maximal chain existence (finiteness + Zorn-like argument)

Toolchain: Lake 5.0.0-src+f72c35b, Lean 4.29.1, Mathlib at rev 5e932f97 (cache via lake exe cache get).

Follow-up (separate PRs)

🤖 Authored with the Section H.4 discipline applied.

…seline build)

Voting.lean baseline (post-#885 revert) does not build locally:
two `have ... := by` blocks at L241/L245 had their `simp` body un-indented,
producing an empty tactic block + a dangling top-level `simp` that closes
nothing. Lean reported the unfilled goal of `median_voter_theorem` and
exited with code 1.

Indented the two `simp` lines (4 spaces inside their `by` block).

Verification on ai-01 (Windows):
  Lake version 5.0.0-src+f72c35b (Lean 4.29.1)
  lake build SocialChoice.Voting -> Build completed successfully (3286 jobs).
  grep -c sorry SocialChoice/Voting.lean -> 2 (baseline preserved:
    L251 median_voter completion, L445 maximal chain).

Root cause: the bug was introduced in `592147a4` ("restore Voting.lean
build") and survived multiple PRs because the CI workflow `lean-social-choice.yml`
only checks `Arrow.lean / Sen.lean / Framework.lean / Basic.lean` for
no-sorry — Voting.lean has never been built by CI. Section H.4 lake-build-local
discipline made this surface.

@clusterManager-Myia clusterManager-Myia left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Indent fix propre (+2/-2), sorry count préservé (2), lake build OK. Root cause bien identifié (Voting.lean jamais dans CI) et follow-up prévu (ajouter au matrix). ✅

@jsboige
jsboige merged commit 10ab9e1 into main May 10, 2026
3 checks passed
@jsboige
jsboige deleted the fix/voting-baseline-indent-build branch May 10, 2026 10:02
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.

2 participants