Download data/lean/OAI/Combinatorics/EditApproximation/Binary/BinaryCountedGroupWork.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 3.96 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/EditApproximation/Binary/BinaryCountedGroupWork.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Combinatorics/EditApproximation/Binary/BinaryCountedGroupWork.lean
-
curl -L -o BinaryCountedGroupWork.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/EditApproximation/Binary/BinaryCountedGroupWork.lean
3.96 kB
| import OAI.Combinatorics.EditApproximation.Binary.BinaryCountedGroup | |
| namespace OAI | |
| /-! The count used by every sampled scale is at most the actual child | |
| arity. Consequently the complete group counter is bounded from stored | |
| input widths, without assuming estimates on its internal callbacks. -/ | |
| namespace EditApproximation | |
| namespace BinaryFraction | |
| private theorem sumStorage_mono {n m B : β} (h : n β€ m) : | |
| bandMassTotalStorageBudget n B β€ bandMassTotalStorageBudget m B := by | |
| have hs := Nat.size_le_size h | |
| unfold bandMassTotalStorageBudget | |
| gcongr | |
| private theorem storedSumWork_mono {n m B : β} (h : n β€ m) : | |
| storedSumBitBudget n B β€ storedSumBitBudget m B := by | |
| have hs := Nat.size_le_size h | |
| unfold storedSumBitBudget storedSumWordBudget | |
| gcongr | |
| def boundedScaleWordBudget (M B : β) : β := | |
| 4 * (4 * B + 4 + bandMassTotalStorageBudget M B) + 2 | |
| def boundedScaleBitBudget (M B : β) : β := | |
| groupIndexBitBudget M B + (2100 * (B + 2) ^ 2 + 1) + | |
| 2000 * (4 * B + 4 + bandMassTotalStorageBudget M B + 1) ^ 2 + 2 * B + 3 | |
| private theorem groupScale_budget_le (M k B : β) (hk : k β€ M) : | |
| groupScaleWordBudget M k B β€ boundedScaleWordBudget M B β§ | |
| groupScaleBitBudget M k B β€ boundedScaleBitBudget M B := by | |
| have ht : groupScaleTermCount M k β€ M := by | |
| unfold groupScaleTermCount | |
| split_ifs <;> omega | |
| have hsum := sumStorage_mono (B := B) ht | |
| have hwork := storedSumWork_mono (B := B) ht | |
| constructor | |
| Β· unfold groupScaleWordBudget boundedScaleWordBudget | |
| omega | |
| Β· unfold groupScaleBitBudget boundedScaleBitBudget groupIndexBitBudget | |
| have hprod := Nat.mul_le_mul_right (2 * (1000 * (B + 1) ^ 2 + 1) + 6) ht | |
| have hsq := Nat.pow_le_pow_left (show | |
| 4 * B + 4 + bandMassTotalStorageBudget (groupScaleTermCount M k) B + 1 β€ | |
| 4 * B + 4 + bandMassTotalStorageBudget M B + 1 by omega) 2 | |
| omega | |
| def countedGroupBitBudget (M T B : β) : β := | |
| T * (groupSampleCountBitBudget B + 6) + | |
| groupMemberBitBudget T B (boundedScaleBitBudget M B) (boundedScaleWordBudget M B) + 1 | |
| theorem countedGroupMemberWithWork_bounds {M T : β} (Q b : β) (scales : Fin T β BinaryFraction) | |
| (connection : BinaryFraction) (envelope values : Vector BinaryFraction M) | |
| (draw : β t, Fin (groupSampleCount M Q b (scales t).value) β Fin M) | |
| (B : β) (hB : 1 β€ B) (hM : Nat.size M + 2 β€ B) (hQ : Nat.size Q + 2 β€ B) | |
| (hb : Nat.size b + 2 β€ B) (hs : β t, (scales t).width β€ B) | |
| (hconn : connection.width β€ B) (he : β i, (envelope.get i).width β€ B) | |
| (hv : β i, (values.get i).width β€ B) : | |
| (countedGroupMemberWithWork Q b scales connection envelope values draw).1.width β€ | |
| groupMemberWordBudget T B (boundedScaleWordBudget M B) β§ | |
| (countedGroupMemberWithWork Q b scales connection envelope values draw).2 β€ | |
| countedGroupBitBudget M T B := by | |
| have hk (t : Fin T) : groupSampleCount M Q b (scales t).value β€ M := by | |
| exact min_le_left _ _ | |
| have hscale (t : Fin T) := groupScaleWithWork_bounds | |
| (groupSampleCount M Q b (scales t).value) (scales t) envelope values (draw t) B | |
| hB (hs t) he hv hM ((Nat.add_le_add_right (Nat.size_le_size (hk t)) 2).trans hM) | |
| have hc (t : Fin T) := (hscale t).2.trans (groupScale_budget_le M _ B (hk t)).2 | |
| have hw (t : Fin T) := (hscale t).1.trans (groupScale_budget_le M _ B (hk t)).1 | |
| constructor | |
| Β· have hmember := (groupMemberWithWork_bounds scales | |
| (fun t => groupSampleCount M Q b (scales t).value) connection envelope values draw B | |
| (boundedScaleBitBudget M B) (boundedScaleWordBudget M B) hconn hc hw).1 | |
| unfold countedGroupMemberWithWork | |
| dsimp only | |
| rw [groupMemberWithWork_transport] | |
| exact hmember | |
| Β· exact countedGroupMemberWithWork_cost Q b scales connection envelope values draw B | |
| (boundedScaleBitBudget M B) (boundedScaleWordBudget M B) hM hQ hb hs hconn hc hw | |
| end BinaryFraction | |
| end EditApproximation | |
| end OAI | |