math / data /lean /OAI /Combinatorics /EditApproximation /Refinement /ComputedExecutionKernelWork.lean
Download data/lean/OAI/Combinatorics/EditApproximation/Refinement/ComputedExecutionKernelWork.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 3.99 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/EditApproximation/Refinement/ComputedExecutionKernelWork.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Combinatorics/EditApproximation/Refinement/ComputedExecutionKernelWork.lean
-
curl -L -o ComputedExecutionKernelWork.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/EditApproximation/Refinement/ComputedExecutionKernelWork.lean
3.99 kB
| 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 | |