Skip to content

feat(cont): prove CONT-2 justifiable iff distance is window, square, or pronic - #37

Merged
adust09 merged 1 commit into
mainfrom
feat/cont-2-justifiable-iff
Jul 2, 2026
Merged

feat(cont): prove CONT-2 justifiable iff distance is window, square, or pronic#37
adust09 merged 1 commit into
mainfrom
feat/cont-2-justifiable-iff

Conversation

@adust09

@adust09 adust09 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Discharges CONT-2 from docs/lean4-proof-propositions.md: Slot.isJustifiableAfter finalized target holds iff the slot distance δ satisfies δ ≤ 5, δ is a perfect square, or δ is pronic — i.e. the executable 3SF-mini justification-candidate check (landed with #33) matches its mathematical specification.

Proof structure in LeanSpec/Forks/Lstar/Slot.lean:

  • isqrt_le / isqrt_lt_succ — bracketing bounds isqrt n · isqrt n ≤ n < (isqrt n + 1)² by functional induction on the base-4 recursion.

  • isqrt_eq — uniqueness: any k with k² ≤ n < (k+1)² equals isqrt n.

  • sq_succ / odd_sq — square expansions so omega can work with products as atoms (no ring without Mathlib).

  • pronic_disc4k(k+1) + 1 = (2k+1)², the identity behind upstream's odd-perfect-square pronic detection.

  • justifiableDelta_iff (Nat-level) → justifiable_iff (catalog form).

  • Catalog: CONT-2 checked off (CONT 1/1/0, total 13 proved), last_updated bumped.

Note: no GitHub issue exists for CONT-2 (issue creation was blocked in-session); the catalog entry is the tracking artifact. CONT-1 follows in a stacked PR (#36).

Verification

  • lake build green with zero warnings; no sorry, no new axioms.

Part of the Containers domain (CONT-1 → #36).

…or pronic

Prove justifiable_iff: the executable Slot.isJustifiableAfter holds iff
the slot distance from the finalized slot is at most 5, a perfect
square, or a pronic number. The core is correctness of the hand-rolled
isqrt (isqrt_le / isqrt_lt_succ by functional induction on the base-4
recursion, uniqueness via isqrt_eq), plus the square-expansion helpers
sq_succ / odd_sq and the pronic discriminant identity
4k(k+1) + 1 = (2k+1)^2 that justifies the upstream odd-square trick.
Axiom-free, no Mathlib.
@adust09
adust09 merged commit acf0bba into main Jul 2, 2026
1 check passed
@adust09
adust09 deleted the feat/cont-2-justifiable-iff branch July 2, 2026 15:58
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