Download data/lean/OAI/Combinatorics/EditApproximation/Refinement/ComputedExecutionCosts.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 7.37 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/EditApproximation/Refinement/ComputedExecutionCosts.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Combinatorics/EditApproximation/Refinement/ComputedExecutionCosts.lean
-
curl -L -o ComputedExecutionCosts.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/EditApproximation/Refinement/ComputedExecutionCosts.lean
7.37 kB
| import Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics | |
| import OAI.Combinatorics.EditApproximation.Refinement.ComputedExecutionWork | |
| import OAI.Combinatorics.EditApproximation.Refinement.ComputedJointCoarseWork | |
| import OAI.Combinatorics.EditApproximation.Refinement.ComputedAddressWork | |
| import OAI.Combinatorics.EditApproximation.Definitions | |
| namespace OAI | |
| namespace EditApproximation | |
| open Filter MeasureTheory | |
| theorem computedExecutionRejectionWork_integrable (source target : List β) (N : β) : | |
| Integrable (computedExecutionRejectionWork source target N) (computedExecutionLaw source target N) := by | |
| let incoming := physicalCoarseSeedLaw (M := (integerParameters N).M) | |
| (J := intervalTreeDepth (integerParameters N).M source.length) source target N | |
| (integerParameters N).B (computedPhysicalCoarseDepth source target N) | |
| have hi : Integrable (computedFamilyRejectionWork source target N) | |
| (physicalFamilyRuntimeLaw (R := inputHeight N ^ 2) target N (integerParameters N).P | |
| (inputHeight N) incoming) := | |
| finite_outer_integrable incoming _ (computedFamilyRejectionWork source target N) | |
| (computedFamilyRejectionWork_integrable source target N) | |
| have hj : Integrable (computedFamilyRejectionWork source target N) | |
| ((computedExecutionLaw source target N).map (computedExecutionProjection source target N)) := by | |
| rw [computedExecutionProjection_law] | |
| exact hi | |
| exact hj.comp_measurable (computedExecutionProjection_measurable source target N) | |
| theorem computedExecutionAccepted_measurable (source target : List β) (N : β) : | |
| Measurable (computedExecutionAccepted source target N) := measurable_of_countable _ | |
| theorem computedExecutionAcceptedWork_integrable (source target : List β) (N : β) | |
| (f : ComputedFamilyInput source target N β β) : | |
| Integrable (f β computedExecutionAccepted source target N) (computedExecutionLaw source target N) := by | |
| have hi : Integrable f ((computedExecutionLaw source target N).map | |
| (computedExecutionAccepted source target N)) := Integrable.of_finite | |
| exact hi.comp_measurable (computedExecutionAccepted_measurable source target N) | |
| theorem computedExecutionDictionaryWork_integrable (source target : List β) (N : β) : | |
| Integrable (computedExecutionDictionaryWork source target N) (computedExecutionLaw source target N) := | |
| computedExecutionAcceptedWork_integrable source target N | |
| (fun input => (computedFamilyResult source target N input).dictionaryVisits) | |
| theorem computedExecutionDictionaryWork_expected_near_linear (epsilon : β) (hepsilon : 0 < epsilon) : | |
| βαΆ N in atTop, β source target : List β, source.length + target.length β€ N β | |
| (β« execution, computedExecutionDictionaryWork source target N execution | |
| βcomputedExecutionLaw source target N) β€ (N + 2 : β) ^ (1 + epsilon) := by | |
| filter_upwards [computedFamilyResult_dictionary_near_linear epsilon hepsilon] with N hN | |
| intro source target hsize | |
| calc | |
| _ β€ β« _ : ComputedExecutionOutcome source target N, (N + 2 : β) ^ (1 + epsilon) | |
| βcomputedExecutionLaw source target N := | |
| integral_mono (computedExecutionDictionaryWork_integrable source target N) (integrable_const _) | |
| (fun execution => hN source target hsize _) | |
| _ = _ := by simp | |
| theorem computedExecutionAddressWork_integrable (source target : List β) (N : β) : | |
| Integrable (computedExecutionAddressWork source target N) (computedExecutionLaw source target N) := | |
| computedExecutionAcceptedWork_integrable source target N | |
| (fun input => (computedFamilyAddressWork source target N input : β)) | |
| theorem computedExecutionAddressWork_expected_near_linear (epsilon : β) (hepsilon : 0 < epsilon) : | |
| βαΆ N in atTop, β source target : List β, source.length + target.length β€ N β | |
| (β« execution, computedExecutionAddressWork source target N execution | |
| βcomputedExecutionLaw source target N) β€ (N + 2 : β) ^ (1 + epsilon) := by | |
| filter_upwards [computedFamilyAddressWork_near_linear epsilon hepsilon] with N hN | |
| intro source target hsize | |
| calc | |
| _ β€ β« _ : ComputedExecutionOutcome source target N, (N + 2 : β) ^ (1 + epsilon) | |
| βcomputedExecutionLaw source target N := | |
| integral_mono (computedExecutionAddressWork_integrable source target N) (integrable_const _) | |
| (fun execution => hN source target hsize _) | |
| _ = _ := by simp | |
| /-- These are the actual coarse, rejection-bit, dictionary and address-construction counters. | |
| The local arithmetic counter is kept separate until its kernel is composed. -/ | |
| theorem computedExecutionNonlocalWork_integrable (source target : List β) (N : β) : | |
| Integrable (computedExecutionNonlocalWork source target N) (computedExecutionLaw source target N) := | |
| (((computedExecutionCoarseWork_integrable source target N).add | |
| (computedExecutionRejectionWork_integrable source target N)).add | |
| (computedExecutionDictionaryWork_integrable source target N)).add | |
| (computedExecutionAddressWork_integrable source target N) | |
| theorem constant_le_rpow_eventually (C epsilon : β) (hepsilon : 0 < epsilon) : | |
| βαΆ N : β in atTop, C β€ (N + 2 : β) ^ epsilon := by | |
| have ht : Tendsto (fun N : β => (N : β) + 2) atTop atTop := | |
| tendsto_atTop_add_const_right atTop 2 tendsto_natCast_atTop_atTop | |
| exact ((tendsto_rpow_atTop hepsilon).comp ht).eventually (eventually_ge_atTop C) | |
| theorem computedExecutionNonlocalWork_expected_near_linear (epsilon : β) (hepsilon : 0 < epsilon) : | |
| βαΆ N in atTop, β source target : List β, source.length + target.length β€ N β | |
| (β« execution, computedExecutionNonlocalWork source target N execution | |
| βcomputedExecutionLaw source target N) β€ (N + 2 : β) ^ (1 + epsilon) := by | |
| have hhalf : 0 < epsilon / 2 := half_pos hepsilon | |
| filter_upwards [computedExecutionCoarseWork_expected_near_linear (epsilon / 2) hhalf, | |
| computedExecutionRejectionWork_expected_near_linear (epsilon / 2) hhalf, | |
| computedExecutionDictionaryWork_expected_near_linear (epsilon / 2) hhalf, | |
| computedExecutionAddressWork_expected_near_linear (epsilon / 2) hhalf, | |
| constant_le_rpow_eventually 4 (epsilon / 2) hhalf] with N hc hr hd ha hfour | |
| intro source target hsize | |
| have hiC := computedExecutionCoarseWork_integrable source target N | |
| have hiR := computedExecutionRejectionWork_integrable source target N | |
| have hiD := computedExecutionDictionaryWork_integrable source target N | |
| have hiA := computedExecutionAddressWork_integrable source target N | |
| change integral (computedExecutionLaw source target N) | |
| (((computedExecutionCoarseWork source target N + computedExecutionRejectionWork source target N) + | |
| computedExecutionDictionaryWork source target N) + computedExecutionAddressWork source target N) β€ _ | |
| rw [integral_add' ((hiC.add hiR).add hiD) hiA, integral_add' (hiC.add hiR) hiD, | |
| integral_add' hiC hiR] | |
| calc | |
| _ β€ 4 * (N + 2 : β) ^ (1 + epsilon / 2) := by | |
| linarith only [hc source target hsize, hr source target hsize, hd source target hsize, | |
| ha source target hsize] | |
| _ β€ (N + 2 : β) ^ (epsilon / 2) * (N + 2 : β) ^ (1 + epsilon / 2) := | |
| mul_le_mul_of_nonneg_right hfour (Real.rpow_nonneg (by positivity) _) | |
| _ = _ := by rw [β Real.rpow_add (by positivity)]; congr 1; ring | |
| end EditApproximation | |
| end OAI | |