Natural Readout of Positive-Base Integer Remainders Is Primitive Recursive
ProvedMonodromy.IntegerPrimrec.remainderFor every natural B, the unary function on integers is primitive recursive. The modulus B+1 is positive, B=0 is allowed, and negative integer arguments are included.
Original proof dependencies: Monodromy.IntegerPrimrec.cases, Monodromy.IntegerPrimrec.split.
Proof elaboration dependencies: Monodromy.IntegerPrimrec.cases, Monodromy.IntegerPrimrec.split.
module public import Definitions.Def_Monodromy_IntegerPrimrec public import Mathlib.Computability.Primrec.Basic public import Mathlib.Data.Int.ModEq public import Mathlib.Tactic.Ring @[expose] public section open Monodromy open Monodromy.IntegerPrimrec
theorem Monodromy.IntegerPrimrec.remainder (B : ℕ) : Primrec (fun value : ℤ => (value % ((B + 1 : ℕ) : ℤ)).toNat) := by sorry
Read-back
What the Lean code literally says, in plain math · OpenAI Codex (independent agent)
For every natural number , the total function on signed integers given by is primitive recursive in the standard natural-number encodings of its integer input and natural output. The modulus is first formed as the natural number and then regarded as an integer; integer remainder is Euclidean, and sends a nonnegative integer to its natural value and a negative integer to . Since this particular modulus is positive, the remainder always belongs to , including for negative , and no zero-modulus case is quantified. The edge case gives the constantly zero function. The claim is made separately for each fixed and is not itself a statement that a single function of both and is primitive recursive.
Confirmed by the mission captain (proposal self-audit).