Download data/lean/OAI/Combinatorics/EditApproximation/Queries/QueryBandInputCost.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 3.62 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/EditApproximation/Queries/QueryBandInputCost.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Combinatorics/EditApproximation/Queries/QueryBandInputCost.lean
-
curl -L -o QueryBandInputCost.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/EditApproximation/Queries/QueryBandInputCost.lean
3.62 kB
| import OAI.Combinatorics.EditApproximation.Queries.QueryRepresentativeCost | |
| import OAI.Combinatorics.EditApproximation.Queries.QueryRepresentativeScales | |
| import OAI.Combinatorics.EditApproximation.Queries.QueryWideBounds | |
| namespace OAI | |
| namespace EditApproximation.BinaryFraction | |
| def queryWideInputsBitBudget (M P count B : β) : β := | |
| let G := (40 * P + 2) ^ 2 | |
| let C := wideChildGridBitBudget P (B + 1) | |
| count * (M * (C + 4 * G + 1 + G + 3) + M * G + 3) + | |
| (count * (M * G) + 1) ^ 2 * (24 * B + 12) + M + 2 | |
| theorem queryWideInputsWithWork_dyadic_bounds {nx ny : β} | |
| (M N P count B : β) (parent : TargetInterval nx) (hP : 0 < P) | |
| (representatives : List (β Γ TargetInterval ny)) | |
| (hl : representatives.length β€ count) | |
| (hs : β br β representatives, br.1 β dyadicScales N) | |
| (hN : Nat.size N β€ B) (hnx : Nat.size nx β€ B) (hny : Nat.size ny β€ B) | |
| (hM : Nat.size M β€ B) (hPb : Nat.size P β€ B) : | |
| (queryWideInputsWithWork M parent P representatives).1.length β€ count * (M * (40 * P + 2) ^ 2) β§ | |
| (queryWideInputsWithWork M parent P representatives).2 β€ queryWideInputsBitBudget M P count B := by | |
| have hb := queryWideInputsWithWork_bounds M parent P representatives ((40 * P + 2) ^ 2) | |
| (wideChildGridBitBudget P (B + 1)) B hM hny | |
| (fun br _ i => by rw [wideChildGridWithWork_value _ _ _ _ _ hP]; exact wideChildStateList_length_le parent br.2 hP i) | |
| (fun br hbr i => wideChildGridWithWork_cost parent br.2 br.1 P (B + 1) i hP | |
| (by omega) (by omega) (by omega) | |
| ((dyadicScales_size_bound N br.1 (hs br hbr)).trans (by omega)) (by omega)) | |
| constructor | |
| Β· exact hb.1.trans (Nat.mul_le_mul_right _ hl) | |
| Β· apply hb.2.trans | |
| unfold queryWideInputsBitBudget | |
| dsimp only | |
| gcongr | |
| def queryBandInputsBitBudget (M P F exponent B R : β) : β := | |
| queryEarlierRepresentativesBitBudget P F exponent B R + | |
| queryWideInputsBitBudget M P (queryEarlierRepresentativesLength P F exponent B) B + 1 | |
| theorem queryBandInputsWithWork_bounds {nx ny : β} (M N P F exponent B R : β) | |
| (parent : TargetInterval nx) (hP : 0 < P) (a : BinaryFraction) | |
| (initial : TargetInterval ny β BinaryFraction Γ β) (q : TargetInterval ny) | |
| (hB : 8 β€ B) (hN : Nat.size N β€ B) (hF : Nat.size F + 2 β€ B) (hFpos : 1 β€ F) | |
| (hPb : Nat.size P β€ B) (hnx : Nat.size nx β€ B) (hny : Nat.size ny β€ B) | |
| (hM : Nat.size M β€ B) (he : exponent + 1 β€ B) (ha : a.width β€ B) | |
| (hi : β r, (initial r).1.width β€ B) (hR : β r, (initial r).2 β€ R) | |
| (hw : 0 β€ (initial q).1.value) (hPd : β e : β, P = 2 ^ e) : | |
| (queryBandInputsWithWork M parent N P F exponent hP a initial q).1.length β€ | |
| queryEarlierRepresentativesLength P F exponent B * (M * (40 * P + 2) ^ 2) β§ | |
| (queryBandInputsWithWork M parent N P F exponent hP a initial q).2 β€ | |
| queryBandInputsBitBudget M P F exponent B R := by | |
| have hr := queryEarlierRepresentativesWithWork_bounds N P F exponent B R hP a initial q | |
| hB hN hF hFpos hPb hny he ha hi hR hw hPd | |
| have hwide := queryWideInputsWithWork_dyadic_bounds M N P | |
| (queryEarlierRepresentativesLength P F exponent B) B parent hP | |
| (queryEarlierRepresentativesWithWork N P F exponent hP a initial q).1 hr.1 | |
| (fun br hb => queryEarlierRepresentativesWithWork_scale N P F exponent hP a initial q R hR br hb) | |
| hN hnx hny hM hPb | |
| constructor | |
| Β· simpa only [queryBandInputsWithWork] using hwide.1 | |
| Β· simpa only [queryBandInputsWithWork, queryBandInputsBitBudget] using | |
| Nat.add_le_add_right (Nat.add_le_add hr.2 hwide.2) 1 | |
| end EditApproximation.BinaryFraction | |
| end OAI | |