cfahlgren1/math / lean /OAI /Computability /MaxCut /PCP /RoundComputation.lean
cfahlgren1's picture
download
raw
5.59 kB
import Mathlib
import OAI.Computability.MaxCut.PCP.RawInitialTables
import OAI.Computability.MaxCut.Machines.PoweringMachineRuntime
namespace OAI
/-!
Actual sequential finite-machine composition for the concrete numbered round.
The initial composition lemma isolates the preprocessing and powering execution
certificates with their shared bit codecs. The final endpoint supplies the
checked powering and alphabet machines, leaving only preprocessing explicit.
-/
namespace MaxCutGames.Foundations.PCP.RoundComputation
open Turing
open MaxCutGames.Foundations.Complexity
/-- The exact pending preprocessing interface, including its output encoding. -/
abbrev PreprocessingCertificate (H : RoundTables.BaseTable) :=
TM2ComputableInPolyTime GraphTables.tableBits
(PortTables.inputBits (ports := PreprocessingTables.degree))
(PreprocessingTables.output H)
/-- The exact powering interface at the fixed parameters of the round. -/
abbrev PoweringCertificate :=
TM2ComputableInPolyTime
(PortTables.inputBits (ports := PreprocessingTables.degree))
(GenericGraphTables.tableBits (q := RoundTables.alphabet))
(PoweringTables.transform PreprocessingTables.degree RoundTables.walkParameter)
theorem powered_eq_transform (H : RoundTables.BaseTable) (table : GraphTables.Table) :
RoundTables.powered H table =
PoweringTables.transform PreprocessingTables.degree RoundTables.walkParameter
(PreprocessingTables.output H table) := rfl
/-- Both actual transfer loops between the machines are included by
`MachineSequential.composeBits`; their work contributes to its polynomial. -/
noncomputable def poweredPolynomialTimeOfCertificates (H : RoundTables.BaseTable)
(preprocessing : PreprocessingCertificate H) (powering : PoweringCertificate) :
TM2ComputableInPolyTime GraphTables.tableBits
(GenericGraphTables.tableBits (q := RoundTables.alphabet))
(RoundTables.powered H) := by
change TM2ComputableInPolyTime GraphTables.tableBits _
(fun table => PoweringTables.transform PreprocessingTables.degree
RoundTables.walkParameter (PreprocessingTables.output H table))
exact MachineSequential.composeBits preprocessing powering
noncomputable def tablePolynomialTimeOfCertificates (H : RoundTables.BaseTable)
(preprocessing : PreprocessingCertificate H) (powering : PoweringCertificate) :
TM2ComputableInPolyTime GraphTables.tableBits GraphTables.tableBits
(RoundTables.build H) := by
change TM2ComputableInPolyTime GraphTables.tableBits GraphTables.tableBits
(fun table => AlphabetTable.Table.build (RoundTables.powered H table))
exact MachineSequential.composeBits
(poweredPolynomialTimeOfCertificates H preprocessing powering)
(AlphabetTable.Runtime.tablePolynomialTime RoundTables.alphabet)
/-- All intermediate work alphabets stay finite under the actual sequential
composition, provided that they are finite in the two supplied machines. -/
theorem powered_finiteAlphabet (H : RoundTables.BaseTable)
(preprocessing : PreprocessingCertificate H) (powering : PoweringCertificate)
(hpreprocessing : MachineFiniteAlphabet.FiniteAlphabet preprocessing.tm)
(hpowering : MachineFiniteAlphabet.FiniteAlphabet powering.tm) :
MachineFiniteAlphabet.FiniteAlphabet
(poweredPolynomialTimeOfCertificates H preprocessing powering).tm :=
MachineFiniteAlphabet.composeBits preprocessing powering hpreprocessing hpowering
/-- This is a separate work-alphabet fact about the same runtime certificate;
the final alphabet stage has homogeneous Bool tapes. -/
theorem finiteAlphabet (H : RoundTables.BaseTable)
(preprocessing : PreprocessingCertificate H) (powering : PoweringCertificate)
(hpreprocessing : MachineFiniteAlphabet.FiniteAlphabet preprocessing.tm)
(hpowering : MachineFiniteAlphabet.FiniteAlphabet powering.tm) :
MachineFiniteAlphabet.FiniteAlphabet
(tablePolynomialTimeOfCertificates H preprocessing powering).tm :=
MachineFiniteAlphabet.composeBits
(poweredPolynomialTimeOfCertificates H preprocessing powering)
(AlphabetTable.Runtime.tablePolynomialTime RoundTables.alphabet)
(powered_finiteAlphabet H preprocessing powering hpreprocessing hpowering)
(AlphabetTable.Runtime.finiteAlphabet RoundTables.alphabet)
/-- Powering and alphabet reduction now use their constructed finite machines.
The only remaining input is an execution certificate for preprocessing. -/
noncomputable def tablePolynomialTime (H : RoundTables.BaseTable)
(preprocessing : PreprocessingCertificate H) :
TM2ComputableInPolyTime GraphTables.tableBits GraphTables.tableBits
(RoundTables.build H) :=
tablePolynomialTimeOfCertificates H preprocessing
(PoweringMachineRuntime.computableInPolyTime PreprocessingTables.degree
RoundTables.walkParameter)
/-- The same certificate has finite work-tape alphabets whenever the supplied
preprocessing machine does; both later stages supply their own proof. -/
theorem tablePolynomialTime_finite_alphabet (H : RoundTables.BaseTable)
(preprocessing : PreprocessingCertificate H)
(hpreprocessing : MachineFiniteAlphabet.FiniteAlphabet preprocessing.tm) :
MachineFiniteAlphabet.FiniteAlphabet
(tablePolynomialTime H preprocessing).tm :=
finiteAlphabet H preprocessing
(PoweringMachineRuntime.computableInPolyTime PreprocessingTables.degree
RoundTables.walkParameter) hpreprocessing
(PoweringMachineRuntime.computableInPolyTime_finite_alphabet
PreprocessingTables.degree RoundTables.walkParameter)
end MaxCutGames.Foundations.PCP.RoundComputation
end OAI

Xet Storage Details

Size:
5.59 kB
·
Xet hash:
dc827913f31e5b6817803067701cfcd2660b7cf84871cf0b33ad18db8177d2fc

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