File size: 3,986 Bytes
4a56cd6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | import OAI.Combinatorics.EditApproximation.Refinement.ComputedKernelWork
import OAI.Combinatorics.EditApproximation.Refinement.ComputedReadChargedWork
import OAI.Combinatorics.EditApproximation.Definitions
namespace OAI
namespace EditApproximation
open MeasureTheory Filter
theorem computedExecutionKernelWork_integrable (source target : List β) (N : β)
(cost : ComputedFamilyInput source target N β ComputedFamilyMemoKey source target N β β) :
Integrable (computedExecutionKernelWork source target N cost)
(computedExecutionLaw source target N) :=
computedExecutionAcceptedWork_integrable source target N
(fun input => (computedFamilyKernelWork source target N input (cost input) : β))
theorem computedExecutionKernelWork_expected_near_linear (D : β)
(epsilon : β) (hepsilon : 0 < epsilon) :
βαΆ N in atTop, β source target : List β, source.length + target.length β€ N β
β cost : ComputedFamilyInput source target N β ComputedFamilyMemoKey source target N β β,
(β input key, cost input key β€ computedLocalKernelBudget D N) β
(β« execution, computedExecutionKernelWork source target N cost execution
βcomputedExecutionLaw source target N) β€ (N + 2 : β) ^ (1 + epsilon) := by
filter_upwards [computedFamilyKernelWork_near_linear D epsilon hepsilon] with N hN
intro source target hsize cost hcost
calc
_ β€ β« _ : ComputedExecutionOutcome source target N, (N + 2 : β) ^ (1 + epsilon)
βcomputedExecutionLaw source target N :=
integral_mono (computedExecutionKernelWork_integrable source target N cost)
(integrable_const _) (fun execution => hN source target hsize
(computedExecutionAccepted source target N execution) _ (hcost _))
_ = _ := by simp
/-- Execution work combines the nonlocal charges with a local kernel annotation. -/
theorem computedExecutionTotalWork_integrable (source target : List β) (N : β)
(cost : ComputedFamilyInput source target N β ComputedFamilyMemoKey source target N β β) :
Integrable (computedExecutionTotalWork source target N cost)
(computedExecutionLaw source target N) :=
(computedExecutionReadChargedWork_integrable source target N).add
(computedExecutionKernelWork_integrable source target N cost)
theorem computedExecutionTotalWork_expected_near_linear (D : β)
(epsilon : β) (hepsilon : 0 < epsilon) :
βαΆ N in atTop, β source target : List β, source.length + target.length β€ N β
(β a β source ++ target, Nat.size a β€ inputHeight N ^ 3) β
β cost : ComputedFamilyInput source target N β ComputedFamilyMemoKey source target N β β,
(β input key, cost input key β€ computedLocalKernelBudget D N) β
(β« execution, computedExecutionTotalWork source target N cost execution
βcomputedExecutionLaw source target N) β€ (N + 2 : β) ^ (1 + epsilon) := by
have hh := half_pos hepsilon
filter_upwards [computedExecutionReadChargedWork_expected_near_linear (epsilon / 2) hh,
computedExecutionKernelWork_expected_near_linear D (epsilon / 2) hh,
constant_le_rpow_eventually 2 (epsilon / 2) hh] with N hn hk htwo
intro source target hsize hsymbol cost hcost
change integral (computedExecutionLaw source target N)
(computedExecutionReadChargedWork source target N + computedExecutionKernelWork source target N cost) β€ _
rw [integral_add' (computedExecutionReadChargedWork_integrable source target N)
(computedExecutionKernelWork_integrable source target N cost)]
calc
_ β€ 2 * (N + 2 : β) ^ (1 + epsilon / 2) := by
linarith only [hn source target hsize hsymbol, hk source target hsize cost hcost]
_ β€ (N + 2 : β) ^ (epsilon / 2) * (N + 2 : β) ^ (1 + epsilon / 2) :=
mul_le_mul_of_nonneg_right htwo (Real.rpow_nonneg (by positivity) _)
_ = _ := by rw [β Real.rpow_add (by positivity)]; congr 1; ring
end EditApproximation
end OAI
|