Download data/lean/OAI/Combinatorics/EditApproximation/Refinement/ComputedGroupAccuracy.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 5.66 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/EditApproximation/Refinement/ComputedGroupAccuracy.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Combinatorics/EditApproximation/Refinement/ComputedGroupAccuracy.lean
-
curl -L -o ComputedGroupAccuracy.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/EditApproximation/Refinement/ComputedGroupAccuracy.lean
5.66 kB
| import OAI.Combinatorics.EditApproximation.Geometry.CellGroupSelection | |
| import OAI.Combinatorics.EditApproximation.Refinement.ComputedGroupNumerical | |
| import OAI.Combinatorics.EditApproximation.Refinement.ComputedBandSpacing | |
| namespace OAI | |
| /-! One actual whole cell has simultaneous gamma*b accuracy with failure at most H^-4. -/ | |
| namespace EditApproximation | |
| open MeasureTheory ProbabilityTheory | |
| theorem computed_cellGroupEstimate_failure {Ξ± : Type*} (source target : List Ξ±) | |
| (N : β) (hN : 0 < N) (hell : 1764 β€ inputSmallLog N) | |
| {M P b Q thetaExponent T : β} [NeZero M] | |
| [MeasurableSpace (Fin M)] [MeasurableSingletonClass (Fin M)] | |
| (hM : 0 < M) (hMeq : M = (integerParameters N).M) | |
| (hPeq : P = (integerParameters N).P) (eb : β) (hbeq : b = 2 ^ eb) | |
| (hQeq : Q = inputSmallLog N ^ 80) (hthetaeq : thetaExponent = 40 * smallLogExponent N) | |
| (parent : TargetInterval source.length) (a : β) | |
| (parentInitial : TargetInterval target.length β β) | |
| (child initial value : Fin M β TargetInterval target.length β β) (cell : β Γ β) | |
| (scales : Fin T β β) (count : Fin T β β) | |
| (hscales : List.ofFn scales = groupDyadicScales M b (inputSmallLog N)) | |
| (hcount : β scale, count scale = groupSampleCount M Q b (scales scale)) | |
| (hspatial : β i s t, initial i s β€ initial i t + | |
| (32 * inputSmallLog N : β) * targetEndpointDistance s t) | |
| (hvalue : β i s, 0 β€ value i s β§ value i s β€ initial i s) | |
| (bernstein : β scale : Fin T, FiniteBernsteinInput | |
| (Measure.pi fun _ : Fin (count scale) => (PMF.uniformOfFintype (Fin M)).toMeasure)) : | |
| let members := cellUnskippedBands source target parent b P (inputSmallLog N) thetaExponent | |
| (rationalParameters (inputSmallLog N)).tau a parentInitial child initial cell | |
| (groupSharedDrawLaw count).real | |
| {draw | β member β members, ((rationalParameters (inputSmallLog N)).gamma : β) * b < | |
| |((unskippedGroupEstimate scales count value member draw - | |
| rationalEndpointActionValue member.center member.rounded value : β) : β)|} β€ | |
| 1 / (inputHeight N : β) ^ 4 := by | |
| let ell := inputSmallLog N | |
| let members := cellUnskippedBands source target parent b P ell thetaExponent | |
| (rationalParameters ell).tau a parentInitial child initial cell | |
| let deviation : β := 1 / (2 * (ell : β) ^ 21) | |
| let ΞΌ := groupSharedDrawLaw (M := M) count | |
| let : IsProbabilityMeasure ΞΌ := by dsimp only [ΞΌ]; infer_instance | |
| have hellQ : (2 : β) β€ ell := by exact_mod_cast (show 2 β€ ell from by omega) | |
| have hellpos : (0 : β) < ell := by linarith only [hellQ] | |
| have hb : 0 < b := hbeq βΈ Nat.two_pow_pos eb | |
| have hQ : 0 < Q := by rw [hQeq]; exact pow_pos (by omega : 0 < inputSmallLog N) 80 | |
| have htheta : (2 : β) ^ (-(thetaExponent : β€)) = 1 / (ell : β) ^ 40 := by | |
| rw [hthetaeq] | |
| exact (computed_theta_dyadic N).symm | |
| have hsmall : 2 * (32 * ell : β) * (2 : β) ^ (-(thetaExponent : β€)) β€ 1 := by | |
| rw [htheta] | |
| have h := (basic_band_small_constants hellQ).2.2.2.2 | |
| convert h using 1 | |
| ring | |
| have hdev : 0 < deviation := by dsimp only [deviation]; positivity | |
| have htail := unskippedGroupEstimate_failure scales count Q hscales hcount value members hM hQ hb | |
| hellpos (32 * ell) (mul_nonneg (by norm_num) (Nat.cast_nonneg _)) hsmall hspatial hvalue deviation hdev bernstein | |
| have hT : T β€ 2 * ell := by | |
| have hlength := congrArg List.length hscales | |
| simp only [List.length_ofFn] at hlength | |
| rw [hlength, hMeq, hbeq] | |
| exact computed_group_scale_count N eb hN (by omega) | |
| have hTQ : (T : β) β€ 2 * ell := by exact_mod_cast hT | |
| have hbudget : (T : β) * deviation β€ (rationalParameters ell).gamma := by | |
| have h := mul_le_mul_of_nonneg_right hTQ hdev.le | |
| have hid : (2 * ell : β) * deviation = (rationalParameters ell).gamma := by | |
| dsimp only [deviation, rationalParameters] | |
| field_simp | |
| exact h.trans_eq hid | |
| have hbudgetR : (T : β) * (deviation : β) * b β€ | |
| ((rationalParameters ell).gamma : β) * b := by | |
| have h := mul_le_mul_of_nonneg_right hbudget (Nat.cast_nonneg (Ξ± := β) b) | |
| exact_mod_cast h | |
| have hsubset : {draw | β member β members, ((rationalParameters ell).gamma : β) * b < | |
| |((unskippedGroupEstimate scales count value member draw - | |
| rationalEndpointActionValue member.center member.rounded value : β) : β)|} β | |
| {draw | β member β members, (T : β) * (deviation : β) * b < | |
| |((unskippedGroupEstimate scales count value member draw - | |
| rationalEndpointActionValue member.center member.rounded value : β) : β)|} := by | |
| rintro draw β¨member, hm, heβ© | |
| exact β¨member, hm, hbudgetR.trans_lt heβ© | |
| have hmembers : members.length β€ ((integerParameters N).P + 1) ^ 2 := by | |
| rw [β hPeq] | |
| exact cellUnskippedBands_length_le source target parent b P ell thetaExponent _ a parentInitial | |
| child initial cell β¨eb, hbeqβ© β¨_, hPeq.trans (computed_P_dyadic N)β© | |
| have hnumerical := computed_group_union_failure N eb members.length hN hell hmembers | |
| dsimp only at hnumerical | |
| have hTeq : T = (groupDyadicScales (integerParameters N).M (2 ^ eb) ell).length := by | |
| have hlength := congrArg List.length hscales | |
| simpa only [List.length_ofFn, hMeq, hbeq] using hlength | |
| change ΞΌ.real _ β€ _ | |
| apply (measureReal_mono hsubset (measure_ne_top ΞΌ _)).trans | |
| apply htail.trans | |
| rw [hQeq, hTeq] | |
| simpa only [deviation, ell, Rat.cast_div, Rat.cast_mul, Rat.cast_ofNat, Rat.cast_pow, | |
| Rat.cast_natCast, Rat.cast_one, Nat.cast_pow, neg_mul, neg_div] using hnumerical | |
| end EditApproximation | |
| end OAI | |