refactor(Encoding): hoist the pair projections out of the Cobham internals - #30
Merged
BoltonBailey merged 1 commit intoAug 29, 2026
Conversation
…rnals `Cobham.fstBlock` / `Cobham.sndBlock` are the total decoders of the pairing codec, but they were defined in the Cobham proof internals, so any file wanting to decode a pair had to import those internals. Move them to `Complexitylib.Encoding.Pairing` next to `pair` / `unpair?` as `pairFst` / `pairSnd`, with `pairFst_pair` / `pairSnd_pair` and `pairSnd_eq_unpair?`, and rename every use. The scanner machines and their lemmas (`fstBlockTM`, `fstBlock_mem_FP`, …) keep their names. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
SamuelSchlesinger
approved these changes
Aug 28, 2026
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
Cobham.fstBlock/Cobham.sndBlock— the total decoders of the pairing codec — lived in the Cobham proof internals, so anything wanting to decode a pair had to import those internals. This moves them toComplexitylib.Encoding.Pairing, next topair/unpair?, aspairFst/pairSnd, with the simp lemmaspairFst_pair/pairSnd_pairandpairSnd_eq_unpair?, and renames every use (~270 sites, all inside the Cobham internals). Scanner machines and their lemmas (fstBlockTM,fstBlock_mem_FP, …) keep their names.Pure relocation + rename; no new theorems beyond
pairSnd_eq_unpair?. #18 will be stacked on this.Verification
lake build --wfailplus both Validation executablespython3 scripts/lint_style.pycleanlake exe runLinterclean on every touched modulelake env lean scripts/AxiomGuard.lean: 42,974 declarations on standard axioms only🤖 Generated with Claude Code