Download data/lean/OAI/Combinatorics/EditApproximation/Coarse/CoarseGridInvariant.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 3.67 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/EditApproximation/Coarse/CoarseGridInvariant.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Combinatorics/EditApproximation/Coarse/CoarseGridInvariant.lean
-
curl -L -o CoarseGridInvariant.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/EditApproximation/Coarse/CoarseGridInvariant.lean
3.67 kB
| import OAI.Combinatorics.EditApproximation.Coarse.CoarsePrecision | |
| import OAI.Combinatorics.EditApproximation.Coarse.CoarseGlobalSeed | |
| namespace OAI | |
| namespace EditApproximation | |
| /-- One descended allowance acquires only one factor of the fixed root | |
| base in its denominator. This includes the literal sampled child label. -/ | |
| theorem coarseChildAllowance_grid (B q L j : β) (allowance : β) (draw : Fin B) | |
| (hB : 0 < B) (hq : 0 < q) (hL : 0 < L) | |
| (ha : allowance.den β£ (L * B * q) ^ j) : | |
| ((1 / (L : β)) * coarseChildThreshold B q allowance draw).den β£ | |
| (L * B * q) ^ (j + 1) := by | |
| have ht : (coarseChildThreshold B q allowance draw).den β£ | |
| (L * B * q) ^ j * (B * q) := by | |
| simpa only [coarseChildThreshold, Nat.cast_mul] using | |
| coarse_rat_div_nat_den_dvd (allowance * ((draw.val + 1 : β) : β)) (B * q) ((L * B * q) ^ j) | |
| (Nat.mul_pos hB hq) (coarse_rat_mul_nat_den_dvd allowance (draw.val + 1) _ ha) | |
| have heq : (1 / (L : β)) * coarseChildThreshold B q allowance draw = | |
| coarseChildThreshold B q allowance draw / L := by ring | |
| rw [heq] | |
| convert coarse_rat_div_nat_den_dvd _ L _ hL ht using 1 | |
| rw [pow_succ] | |
| ring | |
| /-- Every descendant array lives on the same denominator constructed for | |
| its root; it is unnecessary to normalize any array sum by a gcd. -/ | |
| theorem coarseDescendant_grid {B d : β} {Ξ± : Type*} [DecidableEq Ξ±] | |
| (k q L j : β) (frame : List (Option Ξ±)) (tree : CoarseSourceTree B Ξ± d) | |
| (draws : CoarseThresholdDraws B d) (allowance : β) | |
| (hB : 0 < B) (hq : 0 < q) (hL : 0 < L) | |
| (ha : allowance.den β£ (L * B * q) ^ j) (start : β) (shift : Fin (2 * k + 1)) : | |
| (coarseThresholdEstimate k q (1 / L) frame tree draws allowance start shift).den β£ | |
| coarseCommonDenominator 1 q L B (j + d) := by | |
| have h := coarseThresholdEstimate_den_dvd k q L frame tree draws allowance | |
| ((L * B * q) ^ j) hB hq hL (pow_pos (by positivity) _) ha start shift | |
| convert h using 1 | |
| simp only [coarseCommonDenominator, one_mul, pow_add] | |
| ring | |
| /-- Uniform root magnitude for every descendant and pruning outcome. -/ | |
| theorem coarseDescendant_magnitude {B d : β} {Ξ± : Type*} [DecidableEq Ξ±] | |
| (k q L D n : β) (frame : List (Option Ξ±)) (tree : CoarseSourceTree B Ξ± d) | |
| (draws : CoarseThresholdDraws B d) (allowance : β) | |
| (hB : 2 β€ B) (hq : 0 < q) (hL : 0 < L) (hd : d β€ D) | |
| (hn : tree.word.length β€ n) (ha : 0 β€ allowance) (hak : allowance β€ k) | |
| (start : β) (shift : Fin (2 * k + 1)) : | |
| |coarseThresholdEstimate k q (1 / L) frame tree draws allowance start shift| β€ | |
| ((n + B * k * B ^ D : β) : β) := by | |
| have hqQ : (1 : β) β€ q := by exact_mod_cast hq | |
| have hLQ : (1 : β) β€ L := by exact_mod_cast hL | |
| have hLpos : (0 : β) < L := by exact_mod_cast hL | |
| have hnode : coarseInternalNodes B d β€ B ^ D := | |
| (Nat.le_of_succ_le (coarseInternalNodes_add_one_le_pow B d hB)).trans | |
| (Nat.pow_le_pow_right (by omega) hd) | |
| have hm := coarseThresholdEstimate_magnitude k q (1 / L) frame tree draws allowance hqQ | |
| (by positivity) ((div_le_one hLpos).mpr hLQ) ha start shift | |
| rw [abs_of_nonneg (coarseThresholdEstimate_nonneg k q (1 / L) frame tree draws allowance start shift | |
| (by positivity) ha)] | |
| apply hm.trans | |
| have hs : (B : β) * allowance / q β€ B * k := by | |
| exact (div_le_self (by positivity) hqQ).trans | |
| (mul_le_mul_of_nonneg_left hak (by positivity)) | |
| have hh := mul_le_mul hs (by exact_mod_cast hnode : (coarseInternalNodes B d : β) β€ B ^ D) | |
| (by positivity) (by positivity : (0 : β) β€ B * k) | |
| push_cast | |
| exact add_le_add (by exact_mod_cast hn) hh | |
| end EditApproximation | |
| end OAI | |