Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Complexity/Computability/WordRAM/Native.lean
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ module

public import Complexity.Computability.WordRAM.Generic
public import Complexity.Computability.GenericRAM.Simulation.Run
public import Complexity.Computability.Machines.Turing.MultiTape.Complexity.BigO.Plain
public import Complexity.Computability.Machines.Turing.MultiTape.Complexity.PolyTime.Nat.Binary
public import Complexity.Computability.Machines.Turing.MultiTape.Complexity.PolyTime.Pi
public import Complexity.Computability.Machines.Turing.MultiTape.Complexity.PolyTime.Option
Expand Down Expand Up @@ -395,7 +396,7 @@ def transportCertificate (enc : B.genericModel.Encoding) (N : B.genericModel.Nat
rw [hden a]
exact ⟨m, hm, executes_toGeneric_iff.mpr hex⟩

/-- Parameterized `ComputableTidilyInO` transport theorem from `WordRAM.Executes`. -/
/-- Parameterized `ComputableInO` transport theorem from `WordRAM.Executes`. -/
theorem transport_inO (enc : B.genericModel.Encoding) (N : B.genericModel.NativePrimitives enc)
(p : Program B r) {f : α → ℕ} {cfg : α → ℕ}
{initState : α → FiniteState B.genericModel r} {u : α → State r} {steps : α → ℕ}
Expand All @@ -404,12 +405,12 @@ theorem transport_inO (enc : B.genericModel.Encoding) (N : B.genericModel.Native
(cInit : NativeCertificate initState ei (FiniteState.encoding enc))
(hden : ∀ a, (initState a).denote = (u a).toGeneric B)
(hExec : ∀ a, ∃ m ≤ steps a, Executes (cfg a) p (u a) (f a) m) :
ComputableTidilyInO f ei enc.value
Turing.MultiTapeTM.ComputableInO f ei enc.value
(fun a => cSteps.time a + (cCfg.time a + cInit.time a) +
FiniteState.runTime enc N p.toGeneric (steps a, (cfg a, initState a)))
(fun a => cSteps.space a + (cCfg.space a + cInit.space a) +
FiniteState.runSpace enc N p.toGeneric (steps a, (cfg a, initState a))) :=
(transportCertificate enc N p cSteps cCfg cInit hden hExec).computes
.of_tidy (transportCertificate enc N p cSteps cCfg cInit hden hExec).computes

/-- Automatic `ComputableInPolyTime` transport corollary from `WordRAM.Executes`. -/
theorem transport_polyTime (enc : B.genericModel.Encoding)
Expand Down
4 changes: 2 additions & 2 deletions ComplexityTests/GenericRAMSimulation.lean
Original file line number Diff line number Diff line change
Expand Up @@ -455,10 +455,10 @@ theorem wordDoubleProgram_executes (x : ℕ) :
obtain ⟨m, hm, hex⟩ := FiniteState.executes_of_run_eq_inr (wordDoubleProgram_run x)
exact ⟨m, hm, Cslib.WordRAM.executes_toGeneric_iff.mp hex⟩

/-- Whole-run `ComputableTidilyInO` bound transported from `wordDoubleProgram` via
/-- Whole-run `ComputableInO` bound transported from `wordDoubleProgram` via
`Cslib.WordRAM.transport_inO` and `Basis.standard.nativePrimitives`. -/
theorem wordDouble_inO :
ComputableTidilyInO (fun x : ℕ => x + x) encNat encNat
Turing.MultiTapeTM.ComputableInO (fun x : ℕ => x + x) encNat encNat
(fun x => wordDoubleStepsCert.time x +
(wordDoubleWidthCert.time x + wordDoubleInitCert.time x) +
FiniteState.runTime Cslib.WordRAM.Basis.standard.encoding
Expand Down
1 change: 0 additions & 1 deletion scripts/tidy_surface_baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,6 @@
"Complexity/Computability/TreeEval/Space.lean": 2,
"Complexity/Computability/USTCON/Reader/Cert.lean": 3,
"Complexity/Computability/USTCON/Space.lean": 1,
"Complexity/Computability/WordRAM/Native.lean": 1,
"Complexity/Crypto/Computational/Basic.lean": 1,
"Complexity/Crypto/Computational/Commitment.lean": 13,
"Complexity/Crypto/Computational/Encryption/PolyTime.lean": 2,
Expand Down
Loading