math / data /lean /OAI /Combinatorics /EditApproximation /Refinement /ComputedJointCoarseWork.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
3.67 kB
import OAI.Combinatorics.EditApproximation.Refinement.ComputedPhysicalCoarseWork
import OAI.Combinatorics.EditApproximation.Refinement.ComputedExecutionLaw
import OAI.Combinatorics.EditApproximation.Probability.FiniteProductWork
import OAI.Combinatorics.EditApproximation.Definitions
namespace OAI
namespace EditApproximation
open MeasureTheory Filter
section Symbolic
variable {M J R B : β„•} [NeZero M] [NeZero R] [NeZero B]
(source target : List β„•) (N : β„•)
(depth : PhysicalEntry M J target.length β†’ β„•)
(encode : Sum (PhysicalFamilyScalarKey (M := M) (J := J) (R := R)
target N (integerParameters N).P (inputSmallLog N) (40 * smallLogExponent N)
(inputHeight N) (inputSmallLog N ^ 80) (computedSeedPassCount N) (inputHeight N ^ 2))
(ChargedPhysicalRequest M J target.length (computedSeedPassCount N + 1)
(inputHeight N ^ 2) (integerParameters N).T (integerParameters N).S) β†’ β„•)
theorem symbolicComputedExecutionCoarseWork_expected_le (budget : ℝ)
(hbudget : SymbolicComputedCoarseBudget (B := B) source target N depth encode budget) :
(∫ execution, symbolicComputedExecutionCoarseWork source target N depth encode execution
βˆ‚physicalCoarseExecutionLaw (R := R) source target N (integerParameters N).P
(inputHeight N) B depth) ≀ budget := by
exact rejectionProductWork_expected_le _ _
(fun outcome => symbolicComputedCoarseWork source target N depth encode outcome.2 outcome.1)
budget hbudget
theorem symbolicComputedExecutionCoarseWork_integrable :
Integrable (symbolicComputedExecutionCoarseWork source target N depth encode)
(physicalCoarseExecutionLaw (R := R) source target N (integerParameters N).P
(inputHeight N) B depth) := by
let ΞΌ := coarseFullSeedMeasure B depth
(fun entry => physicalSource source entry.1)
(fun entry => substring target entry.2.lo entry.2.hi)
let range := physicalFamilyRange (M := M) (J := J) (R := R)
target N (integerParameters N).P (inputSmallLog N) (40 * smallLogExponent N)
(inputHeight N) (inputSmallLog N ^ 80) (computedSeedPassCount N) (inputHeight N ^ 2)
let f := fun outcome : PhysicalCoarseDraw source target B depth Γ— (βˆ€ key, Fin (range key)) =>
symbolicComputedCoarseWork source target N depth encode outcome.2 outcome.1
have hf : Integrable f ((ΞΌ.prod (rejectionRuntimeArrayLaw range)).map
(rejectionProductAccepted range)) := by
rw [rejectionProductAccepted_law]
exact Integrable.of_finite
exact hf.comp_measurable (rejectionProductAccepted_measurable range)
end Symbolic
theorem computedExecutionCoarseWork_integrable (source target : List β„•) (N : β„•) :
Integrable (computedExecutionCoarseWork source target N) (computedExecutionLaw source target N) :=
symbolicComputedExecutionCoarseWork_integrable source target N
(computedPhysicalCoarseDepth source target N) (computedFamilyMemoCode source target N (inputHeight N ^ 2))
theorem computedExecutionCoarseWork_expected_near_linear (epsilon : ℝ) (hepsilon : 0 < epsilon) :
βˆ€αΆ  N in atTop, βˆ€ source target : List β„•, source.length + target.length ≀ N β†’
(∫ execution, computedExecutionCoarseWork source target N execution
βˆ‚computedExecutionLaw source target N) ≀ (N + 2 : ℝ) ^ (1 + epsilon) := by
filter_upwards [computedPhysicalCoarseWork_expected_near_linear epsilon hepsilon] with N hN
intro source target hsize
exact symbolicComputedExecutionCoarseWork_expected_le source target N
(computedPhysicalCoarseDepth source target N) (computedFamilyMemoCode source target N (inputHeight N ^ 2))
_ (hN source target hsize)
end EditApproximation
end OAI