Download data/lean/OAI/Combinatorics/EditApproximation/Queries/QueryEarlierInputs.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 4.23 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/EditApproximation/Queries/QueryEarlierInputs.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Combinatorics/EditApproximation/Queries/QueryEarlierInputs.lean
-
curl -L -o QueryEarlierInputs.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/EditApproximation/Queries/QueryEarlierInputs.lean
4.23 kB
| import OAI.Combinatorics.EditApproximation.Geometry.WideEarlierInputs | |
| import OAI.Combinatorics.EditApproximation.Definitions | |
| namespace OAI | |
| /-! All wide-coordinate requests needed for one local query can be gathered | |
| from bounded representative lists, including complete requested cells and | |
| the rounded online center at every applicable scale. -/ | |
| namespace EditApproximation | |
| open Finset | |
| theorem queryEarlierRepresentatives_length {n : β} (N P F exponent : β) (a : β) | |
| (initial : TargetInterval n β β) (q : TargetInterval n) (hP : β e : β, P = 2 ^ e) | |
| (hF : 1 β€ F) (hw : 0 β€ initial q) : | |
| (queryEarlierRepresentatives N P F exponent a initial q).length β€ | |
| (dyadicQueryWindow N (initial q) a F).length * | |
| ((64 * F * P + 2) ^ 2 + | |
| ((32 * F + 2) * 2 ^ exponent + 2) ^ 2 * (P + 1) ^ 2 + 1) := by | |
| have hPpos : 0 < P := by obtain β¨e, rflβ© := hP; positivity | |
| have hlocal := localRefinementRepresentatives_length N P F a initial q hPpos hF | |
| have hcells := localGroupQueryKeys_length N F exponent a initial q hF hw | |
| have hmembers : ((localGroupQueryKeys N F exponent a initial q).flatMap fun key => | |
| (cellRepresentativeStates n P F key.1 a initial ((2 : β) ^ (-(exponent : β€))) key.2).map | |
| fun r => (key.1, r)).length β€ | |
| (localGroupQueryKeys N F exponent a initial q).length * (P + 1) ^ 2 := by | |
| apply list_flatMap_length_le | |
| intro key hkey | |
| have hscale := localGroupQueryKeys_scale hkey | |
| obtain β¨e, _, heqβ© := List.mem_map.mp hscale | |
| simpa only [List.length_map] using cellRepresentativeStates_length_le a initial | |
| ((2 : β) ^ (-(exponent : β€))) key.2 | |
| β¨by positivity, zpow_le_one_of_nonposβ (by norm_num : (1 : β) β€ 2) (by omega)β© | |
| β¨e, heq.symmβ© hP | |
| unfold queryEarlierRepresentatives | |
| simp only [List.length_append, List.length_map] | |
| nlinarith only [hlocal, hmembers, Nat.mul_le_mul_right ((P + 1) ^ 2) hcells] | |
| theorem queryEarlierRepresentatives_local {n : β} (N P F exponent : β) (a : β) | |
| (initial : TargetInterval n β β) (q : TargetInterval n) (br : β Γ TargetInterval n) | |
| (hbr : br β localRefinementRepresentatives N P F a initial q) : | |
| br β queryEarlierRepresentatives N P F exponent a initial q := by | |
| exact List.mem_append_left _ (List.mem_append_left _ hbr) | |
| theorem queryEarlierRepresentatives_cell {n : β} (N P F exponent : β) (a : β) | |
| (initial : TargetInterval n β β) (q : TargetInterval n) (key : β Γ (β Γ β)) | |
| (hkey : key β localGroupQueryKeys N F exponent a initial q) (r : TargetInterval n) | |
| (hr : r β cellRepresentativeStates n P F key.1 a initial ((2 : β) ^ (-(exponent : β€))) key.2) : | |
| (key.1, r) β queryEarlierRepresentatives N P F exponent a initial q := by | |
| apply List.mem_append_left | |
| apply List.mem_append_right | |
| exact List.mem_flatMap.mpr β¨key, hkey, List.mem_map.mpr β¨r, hr, rflβ©β© | |
| theorem queryEarlierRepresentatives_online {n : β} (N P F exponent : β) (a : β) | |
| (initial : TargetInterval n β β) (q : TargetInterval n) (b : β) | |
| (hb : b β dyadicQueryWindow N (initial q) a F) : | |
| (b, roundInterval (seedGridSpacing b P) q) β | |
| queryEarlierRepresentatives N P F exponent a initial q := by | |
| exact List.mem_append_right _ (List.mem_map.mpr β¨b, hb, rflβ©) | |
| theorem queryEarlierInputCover_card {nx ny M : β} (parent : TargetInterval nx) | |
| (N P F exponent history : β) (a : β) | |
| (initial : TargetInterval ny β β) (q : TargetInterval ny) (hP : β e : β, P = 2 ^ e) | |
| (hF : 1 β€ F) (hw : 0 β€ initial q) : | |
| (queryEarlierInputCover (M := M) parent N P F exponent history a initial q).card β€ | |
| (dyadicQueryWindow N (initial q) a F).length * | |
| ((64 * F * P + 2) ^ 2 + | |
| ((32 * F + 2) * 2 ^ exponent + 2) ^ 2 * (P + 1) ^ 2 + 1) * | |
| M * history * (40 * P + 2) ^ 2 := by | |
| have hPpos : 0 < P := by obtain β¨e, rflβ© := hP; positivity | |
| apply (wideEarlierInputCover_card parent P history _ hPpos).trans | |
| exact Nat.mul_le_mul_right ((40 * P + 2) ^ 2) (Nat.mul_le_mul_right history | |
| (Nat.mul_le_mul_right M (queryEarlierRepresentatives_length N P F exponent a initial q hP hF hw))) | |
| end EditApproximation | |
| end OAI | |