Download data/lean/OAI/Combinatorics/EditApproximation/Geometry/ChargedRandomCoarseWork.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 8.58 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/EditApproximation/Geometry/ChargedRandomCoarseWork.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Combinatorics/EditApproximation/Geometry/ChargedRandomCoarseWork.lean
-
curl -L -o ChargedRandomCoarseWork.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/EditApproximation/Geometry/ChargedRandomCoarseWork.lean
8.58 kB
| import OAI.Combinatorics.EditApproximation.Geometry.ChargedRandomCoarseOracle | |
| import OAI.Combinatorics.EditApproximation.Queries.QueryWeightedWork | |
| import OAI.Combinatorics.EditApproximation.Geometry.ChargedRandomExpansion | |
| import OAI.Combinatorics.EditApproximation.Probability.FreshCoordinateCost | |
| namespace OAI | |
| namespace EditApproximation | |
| section Coarse | |
| variable {Ο Ξ± : Type*} [DecidableEq Ξ±] {M J R : β} [NeZero M] [NeZero R] | |
| (source target : List Ξ±) (N P H T S passes copies : β) | |
| (factor : β β β) (multiplier : β β β) (tau eta kappa delta : β) | |
| (readGroup : β β β β PhysicalInternalNode M J β Fin R β | |
| GroupScalarKey M (inputSmallLog N) (inputSmallLog N ^ 80) β FiniteQuery Ο) | |
| (readInteger : β β β β PhysicalInternalNode M J β Fin R β | |
| (β Γ TargetInterval target.length) β β β FiniteQuery Ο) | |
| (sourceAnswer : Ο β β) | |
| (initial : PhysicalEntry M J target.length β β) | |
| local notation "program" => SourceRanked.projectedBody ChargedPhysicalRequest.rank | |
| (chargedRandomGlobalQuery source target N P (inputSmallLog N) | |
| (40 * smallLogExponent N) H (inputSmallLog N ^ 80) T S passes copies factor multiplier | |
| tau eta kappa delta readGroup readInteger initial) sourceAnswer | |
| local notation "coarse" => chargedRandomCoarseQuery source target N P (inputSmallLog N) | |
| (40 * smallLogExponent N) H (inputSmallLog N ^ 80) T S passes copies factor multiplier | |
| tau eta kappa delta readGroup readInteger sourceAnswer | |
| local notation "depth" => .depth M J target.length passes copies T S | |
| local notation "index" => .index M J target.length passes copies T S | |
| theorem chargedRandomCoarseQuery_cost_le (weight : β β β) | |
| (root : ChargedPhysicalRequest M J target.length passes copies T S) : | |
| (coarse root).cost (fun entry => (initial entry : β)) | |
| (fun entry => weight (J - entry.1.1.val)) β€ | |
| rankedUncachedWork ChargedPhysicalRequest.rank program (fun request => weight (depth request)) root := by | |
| have hall : β level root, root.rank = level β | |
| (coarse root).cost (fun entry => (initial entry : β)) | |
| (fun entry => weight (J - entry.1.1.val)) β€ | |
| rankedUncachedWork ChargedPhysicalRequest.rank program (fun request => weight (depth request)) root := by | |
| intro level | |
| induction level using Nat.strong_induction_on with | |
| | h level ih => | |
| intro root hlevel | |
| cases root with | |
| | inl entry => | |
| rw [chargedRandomCoarseQuery, rankedUncachedWork] | |
| simp only [FiniteQuery.cost, SourceRanked.projectedBody, chargedRandomGlobalQuery, FiniteQuery.eraseSources, ChargedPhysicalRequest.depth, Nat.zero_add, | |
| Nat.add_zero, le_refl] | |
| | inr parent => | |
| rw [chargedRandomCoarseQuery, FiniteQuery.substitute_cost] | |
| have hv (child) := chargedRandomCoarseQuery_value source target N P (inputSmallLog N) | |
| (40 * smallLogExponent N) H (inputSmallLog N ^ 80) T S passes copies factor multiplier | |
| tau eta kappa delta readGroup readInteger sourceAnswer initial child | |
| simp_rw [hv] | |
| unfold SourceRanked.projectedBody | |
| rw [chargedRandomGlobalQuery_table_initial_independent source target N P (inputSmallLog N) | |
| (40 * smallLogExponent N) H (inputSmallLog N ^ 80) T S passes copies factor multiplier | |
| tau eta kappa delta readGroup readInteger (fun _ => 0) initial parent] | |
| rw [rankedUncachedWork] | |
| apply (FiniteQuery.cost_mono_weights _ _ _ _ ?_).trans (Nat.le_add_right _ _) | |
| intro child | |
| exact ih child.val.rank (hlevel βΈ child.property) child.val rfl | |
| exact hall root.rank root rfl | |
| variable | |
| (group : β β β β PhysicalInternalNode M J β Fin R β | |
| CellGroupDraws M (inputSmallLog N) (inputSmallLog N ^ 80)) | |
| (integer : β β β β PhysicalInternalNode M J β Fin R β β β TargetInterval target.length β β) | |
| local notation "values" => chargedRequestValue source target N P (inputSmallLog N) | |
| (40 * smallLogExponent N) H (inputSmallLog N ^ 80) T S passes copies factor multiplier | |
| tau eta kappa delta group integer initial | |
| variable (hbody : β (request : ChargedPhysicalRequest M J target.length passes copies T S), | |
| (chargedRandomGlobalQuery source target N P (inputSmallLog N) | |
| (40 * smallLogExponent N) H (inputSmallLog N ^ 80) T S passes copies factor multiplier | |
| tau eta kappa delta readGroup readInteger initial request).value | |
| (Sum.elim sourceAnswer (fun child : {child : ChargedPhysicalRequest M J target.length passes copies T S // | |
| child.rank < request.rank} => chargedRequestValue source target N P (inputSmallLog N) | |
| (40 * smallLogExponent N) H (inputSmallLog N ^ 80) T S passes copies factor multiplier | |
| tau eta kappa delta group integer initial child.val)) = | |
| chargedRequestValue source target N P (inputSmallLog N) | |
| (40 * smallLogExponent N) H (inputSmallLog N ^ 80) T S passes copies factor multiplier | |
| tau eta kappa delta group integer initial request) | |
| include hbody | |
| theorem chargedRandomCoarseQuery_width_cost_le | |
| (root : ChargedPhysicalRequest M J target.length passes copies T S) | |
| (hroot : depth root = J) : | |
| (coarse root).cost (fun entry => (initial entry : β)) | |
| (fun entry => 1 + source.length β/β M ^ entry.1.1.val) β€ | |
| (chargedRandomDependencyTree source target N P H T S passes copies factor multiplier | |
| tau eta kappa delta group integer initial readGroup readInteger sourceAnswer hbody root).widthWork M source.length := by | |
| have hweight := chargedRandomCoarseQuery_cost_le source target N P H T S passes copies | |
| factor multiplier tau eta kappa delta readGroup readInteger sourceAnswer initial | |
| (fun d => 1 + source.length β/β M ^ (J - d)) root | |
| have hdepth : β entry : PhysicalEntry M J target.length, | |
| J - (J - entry.1.1.val) = entry.1.1.val := by | |
| intro entry | |
| have := entry.1.1.isLt | |
| omega | |
| simp only [hdepth] at hweight | |
| apply hweight.trans_eq | |
| have hw := queryDependencyExpansion_weighted depth index program | |
| (chargedRandomRequestList_progress source target N P H T S passes copies factor multiplier | |
| tau eta kappa delta group integer initial readGroup readInteger sourceAnswer hbody) (fun d => 1 + source.length β/β M ^ (J - d)) root | |
| change _ = (chargedRandomDependencyTree source target N P H T S passes copies factor multiplier | |
| tau eta kappa delta group integer initial readGroup readInteger sourceAnswer hbody root).depthWeightedCount | |
| (fun d => 1 + source.length β/β M ^ (_ - d)) | |
| rw [show (chargedRandomDependencyTree source target N P H T S passes copies factor multiplier | |
| tau eta kappa delta group integer initial readGroup readInteger sourceAnswer hbody root).depth = depth root from | |
| queryDependencyExpansion_depth depth index program | |
| (chargedRandomRequestList_progress source target N P H T S passes copies factor multiplier | |
| tau eta kappa delta group integer initial readGroup readInteger sourceAnswer hbody) root] | |
| rw [hroot] | |
| exact hw.symm | |
| theorem chargedRandomCoarseQuery_fresh_width_le | |
| (root : ChargedPhysicalRequest M J target.length passes copies T S) | |
| (hroot : depth root = J) : | |
| (β entry, selectionIndicator (entry β (coarse root).keys (fun entry => (initial entry : β))) * | |
| (1 + (source.length β/β M ^ entry.1.1.val : β) : β)) β€ | |
| ((chargedRandomDependencyTree source target N P H T S passes copies factor multiplier | |
| tau eta kappa delta group integer initial readGroup readInteger sourceAnswer hbody root).widthWork M source.length : β) := by | |
| classical | |
| have hf := sum_selected_nat_weights_le ((coarse root).keys (fun entry => (initial entry : β))) | |
| (fun entry => 1 + source.length β/β M ^ entry.1.1.val) | |
| have hw := chargedRandomCoarseQuery_width_cost_le source target N P H T S passes copies factor multiplier | |
| tau eta kappa delta readGroup readInteger sourceAnswer initial group integer hbody root hroot | |
| rw [FiniteQuery.cost_eq_sum] at hw | |
| have hwR : (((coarse root).keys (fun entry => (initial entry : β))).map | |
| (fun entry => 1 + source.length β/β M ^ entry.1.1.val)).sum β€ | |
| (chargedRandomDependencyTree source target N P H T S passes copies factor multiplier | |
| tau eta kappa delta group integer initial readGroup readInteger sourceAnswer hbody root).widthWork M source.length := hw | |
| have hwcast := (Nat.cast_le (Ξ± := β)).mpr hwR | |
| apply le_trans ?_ hwcast | |
| simpa only [Nat.cast_add, Nat.cast_one] using hf | |
| end Coarse | |
| end EditApproximation | |
| end OAI | |