math / data /lean /OAI /Algorithms /SubexponentialSAT /Subexp /AssignmentPairFrontendBounds.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
1.78 kB
import OAI.Algorithms.SubexponentialSAT.LeanCompat
import OAI.Algorithms.SubexponentialSAT.Subexp.AssignmentPairFrontend
import OAI.Algorithms.SubexponentialSAT.SubexpVertexPairComplexity
namespace OAI.Algorithms
/-! Explicit polynomial cost for the physical assignment pair frontend. -/
namespace SubexponentialSAT.Subexp.AssignmentPairFrontend
open BitProgram StructuredCalls
def polynomialBudget (D Ξ” : β„•) (scopes : List (List β„•)) : β„• :=
60 * (SubexpVertexPairProgram.polynomialBound D Ξ” scopes +
(SubexpPlanAlphabetBase.scopeBytes scopes).length + 4)
theorem sourceBudget_le_polynomial (D Ξ” : β„•) (scopes : List (List β„•))
(hd : βˆ€ v : Fin D, IncidencePlanSpec.degree scopes v.val ≀ Ξ”) :
sourceBudget D Ξ” scopes ≀ polynomialBudget D Ξ” scopes := by
have h := SubexpVertexPairProgram.bound_le_polynomial D Ξ” scopes hd
unfold sourceBudget polynomialBudget
omega
theorem primitive_run_polynomial (regs : Fin 16 β†’ Bool) (r Q Ξ” D : β„•)
(scopes : List (List β„•))
(hd : βˆ€ v : Fin D, IncidencePlanSpec.degree scopes v.val ≀ Ξ”) :
βˆƒ rf, Computation.RunsIn (BitProgram.primitive program).step
(BitProgram.primitiveOverhead program * polynomialBudget D Ξ” scopes)
(BitProgram.primitiveCfg program
((inputState regs r Q Ξ” D scopes).withPC (some program.entry)))
(BitProgram.primitiveCfg program
((AssignmentInputProgram.inputState rf r Q Ξ” D scopes.length
(pairBytes D Ξ” scopes)).withPC none)) := by
obtain ⟨rf, n, hn, ht⟩ := program_run regs r Q Ξ” D scopes hd
exact ⟨rf, BitProgram.primitive_execution program
⟨n, hn.trans (sourceBudget_le_polynomial D Ξ” scopes hd), ht⟩⟩
end SubexponentialSAT.Subexp.AssignmentPairFrontend
end OAI.Algorithms