Documentation

Complexitylib.Models.TuringMachine.Subroutines.BinaryAddConst.Internal

Addition of a fixed natural to a canonical binary tape — proof internals #

The proof follows the definition-level finite successor chain. Exact runs compose through seqTM; the all-prefix space induction uses the largest destination width rather than the total successor-chain runtime.

Canonical parked tape encoding of a natural for constant addition.

Equations
Instances For
    @[reducible, inline]
    abbrev Complexity.TM.binaryAddConstFramePred {n : } (inp₀ : Tape) (work₀ : Fin nTape) (out₀ : Tape) :

    Predicate fixing the tapes framing a constant-addition execution.

    Equations
    Instances For
      theorem Complexity.TM.binaryAddConstTM_reachesIn_frame_internal {n : } (idx : Fin n) (constant dstValue : ) (inp₀ : Tape) (work₀ : Fin nTape) (out₀ : Tape) (hdst : (work₀ idx).HasBinaryNat dstValue) (hinp : Parked inp₀) (hother : ∀ (i : Fin n), i idxParked (work₀ i)) (hout : Parked out₀) :
      (binaryAddConstTM idx constant).reachesIn (binaryAddConstTime constant dstValue) { state := (binaryAddConstTM idx constant).qstart, input := inp₀, work := work₀, output := out₀ } { state := (binaryAddConstTM idx constant).qhalt, input := inp₀, work := Function.update work₀ idx (binaryAddConstNatTape (dstValue + constant)), output := out₀ }
      theorem Complexity.TM.binaryAddConstTM_hoareTime_frame_internal {n : } (idx : Fin n) (constant dstValue : ) (inp₀ : Tape) (work₀ : Fin nTape) (out₀ : Tape) (hdst : (work₀ idx).HasBinaryNat dstValue) (hinp : Parked inp₀) (hother : ∀ (i : Fin n), i idxParked (work₀ i)) (hout : Parked out₀) :
      (binaryAddConstTM idx constant).HoareTime (binaryAddConstFramePred inp₀ work₀ out₀) (binaryAddConstFramePred inp₀ (Function.update work₀ idx (binaryAddConstNatTape (dstValue + constant))) out₀) (binaryAddConstTime constant dstValue)
      theorem Complexity.TM.binaryAddConstTM_hoareTimeSpace_frame_internal {n : } (idx : Fin n) (constant dstValue inputLength initialSpace : ) (inp₀ : Tape) (work₀ : Fin nTape) (out₀ : Tape) (hdst : (work₀ idx).HasBinaryNat dstValue) (hinp : Parked inp₀) (hother : ∀ (i : Fin n), i idxParked (work₀ i)) (hout : Parked out₀) (hworkSpace : ∀ (i : Fin n), (work₀ i).head initialSpace) (hinputSpace : inp₀.head inputLength + initialSpace + 1) :
      (binaryAddConstTM idx constant).HoareTimeSpace (binaryAddConstFramePred inp₀ work₀ out₀) (binaryAddConstFramePred inp₀ (Function.update work₀ idx (binaryAddConstNatTape (dstValue + constant))) out₀) (binaryAddConstTime constant dstValue) inputLength (binaryAddConstSpace initialSpace constant dstValue)