Updating one digit of a finite-function radix code #
These weighted-digit identities reuse Mathlib's finite-function enumeration and sum updates. The concrete client computes a child box's native encoding-array index by replacing a P0 digit with one of the ten term digits, without rebuilding the string.
theorem Nat.finFunctionFinEquiv_update_add {b L : ℕ} (f : Fin L → Fin b) (i : Fin L) (d : Fin b) :
↑(finFunctionFinEquiv (Function.update f i d)) + ↑(f i) * b ^ ↑i = ↑(finFunctionFinEquiv f) + ↑d * b ^ ↑i
Replacing one digit changes exactly its weighted contribution to the code.