cfahlgren1/math / lean /OAI /Computability /UniqueGames /Machines /MachinePaddingTable.lean
cfahlgren1's picture
download
raw
2.16 kB
import OAI.Computability.UniqueGames.Machines.MachinePaddingRowsLemmas
import OAI.Computability.UniqueGames.PCP.PreprocessingPaddingWords
namespace OAI
section
/-! Exact table-codec endpoint of the polynomial padding-row routine.
The caller supplies the physical unary counters and copied old-row buffer
with the updated headers. This theorem executes every added row and proves
that the resulting output is exactly the existing full table encoding. -/
namespace UniqueGamesTheorem.Foundations.Complexity.MachinePaddingTable
open PCP MachinePaddingRows
def initialOutput {n d m : Nat} (table : PortTables.Table n d) : List Bool :=
encodeWords [m, m * d] ++ PreprocessingPaddingWords.rowsBits table
def execution {n d m : Nat} (table : PortTables.Table n d) (h : n ≤ m) (hd : 0 < d) :
StateTransition.EvalsToInTime (machine d hd).step
⟨some (.inr .initialize), (((), none), ()),
initialTapes n (n * d) (m - n) (initialOutput (m := m) table)⟩
(some (cfg d none m (m * d) 0
(PortTables.tableBits (PreprocessingPaddingTables.pad table h))))
((MachinePaddingCertificate.timePolynomial d).eval
(MachinePaddingBounds.inputSize n (n * d) (m - n) (initialOutput (m := m) table))) where
steps := steps d n (n * d) (initialOutput (m := m) table) (m - n) + 1
evals_in_steps := by
have run := paddingTrace d hd (m - n) n (n * d) (initialOutput (m := m) table)
have hv : n + (m - n) = m := Nat.add_sub_of_le h
have he : n * d + (m - n) * d = m * d := by rw [← Nat.add_mul, hv]
have hout : initialOutput (m := m) table ++ paddingBits d n (n * d) (m - n) =
PortTables.tableBits (PreprocessingPaddingTables.pad table h) := by
rw [PreprocessingPaddingWords.tableBits_pad]
rfl
rw [hv, he, hout] at run
convert run using 1
rfl
steps_le_m := by
simp only [MachinePaddingCertificate.timePolynomial, Polynomial.eval_add, Polynomial.eval_one]
exact Nat.add_le_add_right
(MachinePaddingBounds.timePolynomial_bounds d n (n * d) (m - n) (initialOutput (m := m) table)) 1
end UniqueGamesTheorem.Foundations.Complexity.MachinePaddingTable
end
end OAI

Xet Storage Details

Size:
2.16 kB
·
Xet hash:
bf6b4865e5e9c498f77617515d75fe4eb90de244a4ba925608eb605eaae42dfb

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