cfahlgren1's picture
download
raw
1.88 kB
import OAI.Computability.DepthThree.TapeStoreRepresentation
namespace OAI
namespace DepthThreeLowerBound
namespace TapeCopyAdd
open TapeMultiProgram TapeRouting TapeArithmetic
abbrev State := TapeCopy.State ⊕ AddState
def program (src scratch dst : TapeRegister) : TapeMultiProgram State :=
joinCode (TapeCopy.code src scratch) (addProgram scratch dst) (fun _ => addStart)
def start : State := .inl .start
def done : State := .inr addDone
@[simp] theorem program_done (src scratch dst : TapeRegister) (h : TapeHeads) :
program src scratch dst done h = none := rfl
theorem runs_add {src scratch dst : TapeRegister}
(hsc : src ≠ scratch) (hcd : scratch ≠ dst) (σ : TapeStore) (n m : ℕ)
(hn : σ src = List.replicate n true) (hm : σ dst = List.replicate m true)
(hc : σ scratch = []) :
RunsIn (program src scratch dst).step (cfg start (storeTapes σ))
(cfg done (storeTapes (Function.update σ dst (List.replicate (m + n) true))))
(10 * n + 8) := by
let τ := Function.update σ scratch (List.replicate n true)
have hcopy := TapeStoreRuns.copy hsc σ hc
have hcopy' : RunsIn (TapeCopy.code src scratch).step
(cfg TapeCopy.State.start (storeTapes σ))
(cfg TapeCopy.State.done (storeTapes τ)) (2 * n + 4) := by
simpa only [hn, List.length_replicate] using hcopy
have hadd := TapeStoreRuns.add hcd τ n m
(by simp [τ]) (by simp [τ, hm, Ne.symm hcd])
have hclear : Function.update τ scratch [] = σ := by
dsimp [τ]
rw [Function.update_idem, ← hc, Function.update_eq_self]
rw [hclear] at hadd
have hall := join_runs (TapeCopy.code src scratch) (addProgram scratch dst)
(fun _ => addStart) hcopy' rfl hadd
have hcost : (2 * n + 4) + 1 + (8 * n + 3) = 10 * n + 8 := by omega
simpa only [program, start, done, hcost] using hall
end TapeCopyAdd
end DepthThreeLowerBound
end OAI

Xet Storage Details

Size:
1.88 kB
·
Xet hash:
f858ed70c443bed311eec5836bd61828e318f8ce9c2d4b86d2bf57eed01c3e39

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.