File size: 4,693 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 75 76 77 | import OAI.Combinatorics.EditApproximation.Refinement.PhysicalCoarseInputWork
import OAI.Combinatorics.EditApproximation.Refinement.ComputedExecutionCosts
namespace OAI
namespace EditApproximation
open Filter MeasureTheory
noncomputable def computedFamilyCoarseInputWork (source target : List β) (N : β)
(input : ComputedFamilyInput source target N) : β :=
physicalFamilyCoarseInputWork source target N (integerParameters N).P (inputHeight N)
(integerParameters N).T (integerParameters N).S (computedSeedPassCount N) (inputHeight N ^ 2)
(scheduledSeedFactor N) (scheduledSeedMultiplier N)
(rationalParameters (inputSmallLog N)).tau (rationalParameters (inputSmallLog N)).eta
(rationalParameters (inputSmallLog N)).kappa (rationalParameters (inputSmallLog N)).delta
(clampedSeedNat input.1) input.2 (16384 * inputHeight N + 5)
(computedFamilyMemoCode source target N (inputHeight N ^ 2))
(computedFinalRoot source target N)
theorem computedFamilyCoarseInputWork_le (source target : List β) (N : β)
(hN : 0 < N) (hell : 2 ^ 1000 β€ inputSmallLog N)
(hsize : source.length + target.length β€ N)
(hB : Nat.size (localOnlineMassBound (integerParameters N).M (integerParameters N).P
(inputHeight N)) β€ inputHeight N)
(input : ComputedFamilyInput source target N) :
computedFamilyCoarseInputWork source target N input β€ computedWidthEnvelope N := by
have hc := physicalFamilyCoarseInputWork_le source target N (integerParameters N).P (inputHeight N)
(integerParameters N).T (integerParameters N).S (computedSeedPassCount N) (inputHeight N ^ 2)
(scheduledSeedFactor N) (scheduledSeedMultiplier N)
(rationalParameters (inputSmallLog N)).tau (rationalParameters (inputSmallLog N)).eta
(rationalParameters (inputSmallLog N)).kappa (rationalParameters (inputSmallLog N)).delta
(clampedSeedNat input.1) (computedParameterP_pos N) input.2 (16384 * inputHeight N + 5)
(computedFamilyMemoCode source target N (inputHeight N ^ 2))
(computedFamilyMemoCode_injective source target N (inputHeight N ^ 2) hN
(two_hundred_le_two_pow_thousand.trans hell))
(computedFamilyMemoCode_fits source target N (inputHeight N ^ 2) hN hell hsize le_rfl hB)
(computedFinalRoot source target N) rfl
have hh : 105 β€ inputHeight N :=
(by omega : 105 β€ inputSmallLog N).trans (computed_smallLog_le_height N)
exact hc.trans (computedFamilyTree_width_le source target N hN
(two_hundred_le_two_pow_thousand.trans hell) hh hsize input)
theorem computedFamilyCoarseInputWork_near_linear (epsilon : β) (hepsilon : 0 < epsilon) :
βαΆ N in atTop, β source target : List β, source.length + target.length β€ N β
β input : ComputedFamilyInput source target N,
computedFamilyCoarseInputWork source target N input β€ (N + 2 : β) ^ (1 + epsilon) := by
filter_upwards [computedWidthEnvelope_weighted_near_linear 0 epsilon hepsilon,
eventually_ge_atTop 1, inputSmallLog_tendsto.eventually (eventually_ge_atTop (2 ^ 1000)),
computed_localOnlineMassBound_word] with N hw hN hell hB
intro source target hsize input
exact (computedFamilyCoarseInputWork_le source target N (by omega) hell hsize hB input).trans (by simpa only [pow_zero, mul_one] using hw)
noncomputable def computedExecutionCoarseInputWork (source target : List β) (N : β)
(execution : ComputedExecutionOutcome source target N) : β :=
computedFamilyCoarseInputWork source target N (computedExecutionAccepted source target N execution)
theorem computedExecutionCoarseInputWork_integrable (source target : List β) (N : β) :
Integrable (computedExecutionCoarseInputWork source target N) (computedExecutionLaw source target N) :=
computedExecutionAcceptedWork_integrable source target N (computedFamilyCoarseInputWork source target N)
theorem computedExecutionCoarseInputWork_expected_near_linear (epsilon : β) (hepsilon : 0 < epsilon) :
βαΆ N in atTop, β source target : List β, source.length + target.length β€ N β
(β« execution, computedExecutionCoarseInputWork source target N execution
βcomputedExecutionLaw source target N) β€ (N + 2 : β) ^ (1 + epsilon) := by
filter_upwards [computedFamilyCoarseInputWork_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 (computedExecutionCoarseInputWork_integrable source target N) (integrable_const _)
(fun execution => hN source target hsize _)
_ = _ := by simp
end EditApproximation
end OAI
|