feat(CombinatoryLogic): SKI terms for Nat.sqrt, Nat.pair, and Nat.unpair - #445
Merged
Merged
Conversation
Implement SKI combinator terms for three Mathlib numeric operations and prove they compute the correct values on Church numerals: - Sqrt / sqrt_correct: integer square root via root-finding - NatPair / natPair_correct: Nat.pair via case split on a < b - NatUnpairLeft / natUnpairLeft_correct: left projection of Nat.unpair - NatUnpairRight / natUnpairRight_correct: right projection of Nat.unpair
chenson2018
requested changes
Mar 20, 2026
chenson2018
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for splitting this out! It did make it easier to look at.
Two general comments (probably for later PRs):
- We use the
SKInamespace explicitly a lot in this module, maybe more readable if we didn't - I think more generally a syntax for SKI might be nice for readability. The docstrings you have listing these out helps show precisely what we'd want.
Co-authored-by: Chris Henson <46805207+chenson2018@users.noreply.github.com>
Co-authored-by: Chris Henson <46805207+chenson2018@users.noreply.github.com>
Co-authored-by: Chris Henson <46805207+chenson2018@users.noreply.github.com>
Co-authored-by: Chris Henson <46805207+chenson2018@users.noreply.github.com>
Co-authored-by: Chris Henson <46805207+chenson2018@users.noreply.github.com>
chenson2018
approved these changes
Mar 20, 2026
chenson2018
left a comment
Collaborator
There was a problem hiding this comment.
LGTM. Is this ready to merge @jessealama? I wasn't sure since it's still marked as a draft.
jessealama
marked this pull request as ready for review
March 20, 2026 05:51
thomaskwaring
pushed a commit
to thomaskwaring/cslib_SKI
that referenced
this pull request
Apr 6, 2026
…air (leanprover#445) Implement SKI combinator terms for Nat.sqrt, Nat.pair, and Nat.unpair with correctness proofs against Mathlib definitions. Split out from leanprover#403 to make review easier. --------- Co-authored-by: Chris Henson <46805207+chenson2018@users.noreply.github.com>
tannerduve
pushed a commit
to tannerduve/cslib
that referenced
this pull request
Apr 22, 2026
…air (leanprover#445) Implement SKI combinator terms for Nat.sqrt, Nat.pair, and Nat.unpair with correctness proofs against Mathlib definitions. Split out from leanprover#403 to make review easier. --------- Co-authored-by: Chris Henson <46805207+chenson2018@users.noreply.github.com>
benbrastmckie
pushed a commit
to benbrastmckie/cslib
that referenced
this pull request
Jun 14, 2026
…air (leanprover#445) Implement SKI combinator terms for Nat.sqrt, Nat.pair, and Nat.unpair with correctness proofs against Mathlib definitions. Split out from leanprover#403 to make review easier. --------- Co-authored-by: Chris Henson <46805207+chenson2018@users.noreply.github.com>
benbrastmckie
added a commit
to benbrastmckie/cslib
that referenced
this pull request
Jul 1, 2026
…icts - Chain the three fix tasks to eliminate mutual file conflicts: 445 (conservativity proof) -> 446 (citations/bib) -> 444 (uniformity sweep). - Scope Temporal/Tableau/ OUT of 444 (owned by the active 301/426/439 tableau redesign line) to avoid collision. - leanprover#445 now supersedes leanprover#275; abandon leanprover#275 (goal subsumed by the no-sorry conservativity proof). - Repoint task leanprover#414 (Modal/Temporal/Bimodal proof simplification) off the abandoned leanprover#275 and onto 444/445/446 so it sequences after this cleanup. Session: sess_1782882070_293303
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.
Implement SKI combinator terms for Nat.sqrt, Nat.pair, and Nat.unpair with correctness proofs against Mathlib definitions.
Split out from #403 to make review easier.