feat(cont): prove CONT-2 justifiable iff distance is window, square, or pronic - #37
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Discharges CONT-2 from
docs/lean4-proof-propositions.md:Slot.isJustifiableAfter finalized targetholds 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 boundsisqrt n · isqrt n ≤ n < (isqrt n + 1)²by functional induction on the base-4 recursion.isqrt_eq— uniqueness: anykwithk² ≤ n < (k+1)²equalsisqrt n.sq_succ/odd_sq— square expansions soomegacan work with products as atoms (noringwithout Mathlib).pronic_disc—4k(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_updatedbumped.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 buildgreen with zero warnings; nosorry, no new axioms.Part of the Containers domain (CONT-1 → #36).