Unrestricted depth-three lower bound: tape divide five #
Adapted from OpenAI's formalization at revision adc7f1241b42e322a6451854ab7e4b4c146bf78a.
Source: https://github.com/openai/math/blob/adc7f1241b42e322a6451854ab7e4b4c146bf78a/lean/OAI/Computability/DepthThree/TapeDivideFive.lean
Imports, namespaces, module visibility, documentation, and formatting are adapted for complexitylib. The source theorem statements and mathematical proofs are retained.
Control states of the divide five routine.
- dec (phase : Fin 5) (q : TapeUnary.DecState) : State
- inc (q : TapeUnary.IncState) : State
- done (remainder : Fin 5) : State
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[instance_reducible]
Equations
- One or more equations did not get rendered due to their size.
Advance the remainder counter modulo five.
Instances For
Transition function of the divide five routine.
Equations
- One or more equations did not get rendered due to their size.
- Complexity.DepthThreeLowerBound.TapeDivideFive.program counter destination (Complexity.DepthThreeLowerBound.TapeDivideFive.State.done remainder) x✝ = none
Instances For
theorem
Complexity.DepthThreeLowerBound.TapeDivideFive.runs_phase
{counter destination : TapeRegister}
(hne : counter ≠ destination)
(T : TapeTapes)
(n m : ℕ)
(phase : Fin 5)
:
RunsIn (program counter destination).step
(TapeMultiProgram.cfg (State.dec phase TapeUnary.DecState.start)
(TapeCopy.onPair counter destination T (TapeUnary.counterTape n) (TapeUnary.counterTape m)))
(TapeMultiProgram.cfg (State.done (residue (↑phase + n)))
(TapeCopy.onPair counter destination T (TapeUnary.counterTape 0) (TapeUnary.counterTape (m + (↑phase + n) / 5))))
(8 * n + 3)
theorem
Complexity.DepthThreeLowerBound.TapeDivideFive.runs_divide
{counter destination : TapeRegister}
(hne : counter ≠ destination)
(T : TapeTapes)
(n m : ℕ)
:
RunsIn (program counter destination).step
(TapeMultiProgram.cfg (State.dec 0 TapeUnary.DecState.start)
(TapeCopy.onPair counter destination T (TapeUnary.counterTape n) (TapeUnary.counterTape m)))
(TapeMultiProgram.cfg (State.done (residue n))
(TapeCopy.onPair counter destination T (TapeUnary.counterTape 0) (TapeUnary.counterTape (m + n / 5))))
(8 * n + 3)
@[simp]
theorem
Complexity.DepthThreeLowerBound.TapeDivideFive.done_halts
(counter destination : TapeRegister)
(r : Fin 5)
(h : TapeHeads)
: