Add n-ary equivalence URMComputable ↔ Nat.Partrec'#57
Merged
jessealama merged 4 commits intomainfrom Jan 21, 2026
Merged
Conversation
Implement equivalence between n-ary URM computability and Mathlib's n-ary partial recursive functions (Nat.Partrec'). New file Urm/PartrecPrime.lean: - Type conversion utilities (toVectorFun, fromVectorFun) - Vector encoding is URMComputable (encodeVector_computable) - Backward direction complete (Nat.Partrec'.toURMComputable) - Forward direction structure (URMComputable.toPartrec') with one sorry - Main equivalence theorem (URMComputable_iff_Partrec') Also adds Part.sequence_some lemma to PartSequence.lean.
Complete the proof of URMComputable n ↔ Nat.Partrec' by filling three sorries: - URMComputable_zero_to_one: Lift 0-arity computable functions to 1-arity by prepending Z 0 to reset R₀. Added helper lemmas for step translation between concatenated and base programs. - decode_valid_extract: Core encoding correspondence showing decoded vectors match extractListElem element-by-element. - guardAndApply_eq_decode_bind invalid case: Handle the case when hasValidLengthNum returns a non-1 value. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Extract reusable helper lemmas (prSetupPhase_no_write_low, prLoopPrologue_no_write_high) - Replace verbose by_cases/dite patterns with split_ifs - Inline trivial let bindings as show expressions - Remove redundant type annotations and show statements - Use have instead of let for proof terms - Consolidate duplicated register bound proofs Net reduction of ~295 lines across 18 files.
Convert camelCase definitions and theorems to snake_case following Mathlib/CSLib structural naming patterns: - Definitions: maxRegister → max_register, shiftJumps → shift_jumps, isHalted → is_halted, fromInputs → of_inputs, etc. - Theorems: halted_no_step → no_step_of_halted (uses _of_ pattern), write_read_same → write_read_self (uses _self pattern), halts_unique → eq_of_halts (describes result), etc. - Module-specific renames in Composition/, Minimization/, PrimitiveRecursion/, and Simulate/ directories All 43 files updated with consistent naming. Build passes.
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.
No description provided.