Download data/lean/OAI/Combinatorics/EditApproximation/Coarse/CoarseIndexedEntryCost.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 3 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/EditApproximation/Coarse/CoarseIndexedEntryCost.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Combinatorics/EditApproximation/Coarse/CoarseIndexedEntryCost.lean
-
curl -L -o CoarseIndexedEntryCost.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/EditApproximation/Coarse/CoarseIndexedEntryCost.lean
3 kB
| import OAI.Combinatorics.EditApproximation.Refinement.ComputedCoarseIndexedWork | |
| import OAI.Combinatorics.EditApproximation.Refinement.PhysicalCoarseSeedLaw | |
| import OAI.Combinatorics.EditApproximation.Probability.FreshCoordinateCost | |
| import OAI.Combinatorics.EditApproximation.Definitions | |
| namespace OAI | |
| namespace EditApproximation | |
| /-- Keep the branch dimensions symbolic when forming the finite source sum. -/ | |
| theorem coarseIndexedEntryBinaryCost_computed_bound : | |
| βαΆ N : β in Filter.atTop, β B d : β, β x y : List β, | |
| B = (integerParameters N).B β d = computedCoarseDepth N (coarseEntryWidth x y) β | |
| coarseEntryWidth x y β€ N β (β a β x ++ y, Nat.size a β€ inputHeight N ^ 3) β | |
| β (_hB : NeZero B) (draw : CoarseGuessIndex (coarseEntryWidth x y) β CoarseThresholdDraws B d), | |
| (coarseIndexedEntryBinaryCost N B d x y draw : β) β€ (inputHeight N : β) ^ 40 * | |
| ((coarseInitialArrayWork B d (initialThresholdQ N) (initialLambda N) x y draw : β) + | |
| (x.length + 1 : β)) := by | |
| filter_upwards [BinaryFraction.computedCoarseIndexedInitialWithWork_bound] with N hN | |
| intro B d x y hB hd hxy hsymbols hinstance draw | |
| have hb := hN B d x y hB hd hxy hsymbols | |
| (Nat.pos_of_neZero _) (pow_pos (Nat.two_pow_pos _) _) | |
| (Nat.mul_pos (by decide) (Nat.two_pow_pos _)) draw | |
| exact_mod_cast hb | |
| theorem coarseIndexedEntryCostSum_bound {M J B : β} [NeZero B] (source target : List β) | |
| (N : β) (depth : PhysicalEntry M J target.length β β) | |
| (draw : PhysicalCoarseDraw source target B depth) | |
| (selected : PhysicalEntry M J target.length β Prop) (C : β) | |
| (hc : β entry : PhysicalEntry M J target.length, | |
| (coarseIndexedEntryBinaryCost N B (depth entry) (physicalSource source entry.1) | |
| (substring target entry.2.lo entry.2.hi) (draw entry) : β) β€ | |
| C * ((coarseInitialArrayWork B (depth entry) (initialThresholdQ N) (initialLambda N) | |
| (physicalSource source entry.1) (substring target entry.2.lo entry.2.hi) (draw entry) : β) + | |
| ((physicalSource source entry.1).length + 1 : β))) : | |
| coarseIndexedEntryCostSum source target N depth draw selected β€ C * | |
| ((β entry : PhysicalEntry M J target.length, selectionIndicator (selected entry) * | |
| (coarseInitialArrayWork B (depth entry) (initialThresholdQ N) (initialLambda N) | |
| (physicalSource source entry.1) (substring target entry.2.lo entry.2.hi) (draw entry) : β)) + | |
| β entry : PhysicalEntry M J target.length, selectionIndicator (selected entry) * | |
| ((physicalSource source entry.1).length + 1 : β)) := by | |
| classical | |
| rw [β Finset.sum_add_distrib, Finset.mul_sum] | |
| unfold coarseIndexedEntryCostSum | |
| apply Finset.sum_le_sum | |
| intro entry _ | |
| have hs : 0 β€ selectionIndicator (selected entry) := by | |
| unfold selectionIndicator | |
| split <;> norm_num | |
| exact (mul_le_mul_of_nonneg_left (hc entry) hs).trans_eq (by ring) | |
| end EditApproximation | |
| end OAI | |