Download data/lean/OAI/NumberTheory/PiExponent/Approximation/AdmissibleParameters.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 13.8 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/NumberTheory/PiExponent/Approximation/AdmissibleParameters.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/NumberTheory/PiExponent/Approximation/AdmissibleParameters.lean
-
curl -L -o AdmissibleParameters.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/NumberTheory/PiExponent/Approximation/AdmissibleParameters.lean
13.8 kB
| import Mathlib | |
| import OAI.NumberTheory.PiExponent.Approximation.Parameters | |
| import OAI.NumberTheory.PiExponent.Approximation.Sigma | |
| import OAI.NumberTheory.PiExponent.Approximation.SuccessiveApproximations | |
| import OAI.NumberTheory.PiExponent.Approximation.WeightErrorMargin | |
| import OAI.NumberTheory.PiExponent.Approximation.WeightSeparation | |
| import OAI.NumberTheory.PiExponent.Approximation.WeightSeparationConstant | |
| import OAI.NumberTheory.PiExponent.LocalAlgebra.Dimension | |
| namespace OAI | |
| namespace PiExponent | |
| noncomputable def interpolationSeparationConstant (m : β) (sigma : β) : β := | |
| 2 * ((m : β) + 2) ^ (m + 2) * | |
| (1 + ((m : β) + 2) / (sigma : β)) ^ (m + 2) | |
| theorem interpolationSeparationConstant_pos (m : β) (sigma : β) | |
| (hsigma : 0 < (sigma : β)) : 0 < interpolationSeparationConstant m sigma := by | |
| unfold interpolationSeparationConstant | |
| positivity | |
| noncomputable def weightErrorCoefficient (nu theta : β) (K : β) : β := | |
| theta + Real.log 4 + Real.log (2 * (K : β)) + nu + Real.log (200 * (K : β)) | |
| theorem weightErrorCoefficient_nonneg (nu theta : β) (K : β) | |
| (hnu : 0 < nu) (htheta : 0 < theta) (hK : 1 β€ K) : | |
| 0 β€ weightErrorCoefficient nu theta K := by | |
| have hKr : (1 : β) β€ K := by exact_mod_cast hK | |
| have h4 : 0 β€ Real.log 4 := Real.log_nonneg (by norm_num) | |
| have h2K : 0 β€ Real.log (2 * (K : β)) := Real.log_nonneg (by linarith) | |
| have h200K : 0 β€ Real.log (200 * (K : β)) := Real.log_nonneg (by linarith) | |
| unfold weightErrorCoefficient | |
| linarith | |
| theorem exists_initial_scale (nu theta epsilon : β) (_htheta : 0 < theta) | |
| (hepsilon : 0 < epsilon) : | |
| β F0 : β, 0 < F0 β§ 2 / theta < F0 β§ nu / F0 < epsilon / 3 := by | |
| obtain β¨N, hNβ© := exists_nat_gt (max 1 (max (2 / theta) (3 * nu / epsilon))) | |
| have hF : 1 < (N : β) := lt_of_le_of_lt (le_max_left _ _) hN | |
| have hthetaF : 2 / theta < (N : β) := | |
| lt_of_le_of_lt ((le_max_left _ _).trans (le_max_right _ _)) hN | |
| have hnuF : 3 * nu / epsilon < (N : β) := | |
| lt_of_le_of_lt ((le_max_right _ _).trans (le_max_right _ _)) hN | |
| refine β¨N, by linarith, hthetaF, ?_β© | |
| apply (div_lt_iffβ (show (0 : β) < N by linarith)).2 | |
| have := (div_lt_iffβ hepsilon).mp hnuF | |
| nlinarith | |
| structure AdmissibleParameters (nu Lambda c : β) where | |
| base : Parameters nu | |
| epsilon : β | |
| F0 : β | |
| m : β | |
| K : β | |
| w0 : β | |
| v0 : β | |
| sigma : β | |
| p : β β β€ | |
| q : β β β | |
| x : β β β | |
| wstar : β | |
| epsilon_pos : 0 < epsilon | |
| epsilon_lt_gap : epsilon < | |
| nu * ((base.A : β) * (1 - base.eta) - base.theta) - (1 - base.theta) | |
| epsilon_le_half : epsilon β€ 1 / 2 | |
| F0_pos : 0 < F0 | |
| F0_large : 2 / (base.theta : β) < F0 | |
| initial_margin : nu / F0 < epsilon / 3 | |
| m_pos : 1 β€ m | |
| K_eq : K = dimensionK (base.C : β) m | |
| K_pos : 1 β€ K | |
| w0_eq : (w0 : β) = dimensionW (base.B : β) m | |
| v0_eq : (v0 : β) = dimensionV (base.theta : β) base.B base.C m | |
| w0_pos : 0 < (w0 : β) | |
| v0_pos : 0 < (v0 : β) | |
| volume_eq : (K : β) * ((w0 : β) / v0) * (base.theta : β) ^ m = 1 / 2 | |
| volume_lt_one : (K : β) * (base.theta : β) ^ m < 1 | |
| dimension_margin : | |
| (Lambda * F0 * (m : β) + 2 * Real.log 2) / (v0 : β) + | |
| 100 * (K : β) / (w0 : β) < epsilon / 3 | |
| collision_margin : 2 < c * | |
| (base.eta ^ 2 * (K : β) * (base.theta : β) ^ m / | |
| (((m : β) + 1) * (v0 : β) * (base.A : β) ^ m)) | |
| sigma_pos : 0 < (sigma : β) | |
| sigma_volume : (1 + 3 * (sigma : β)) ^ (m + 1) * | |
| ((K : β) * ((w0 : β) / v0) * (base.theta : β) ^ m) < 1 | |
| sigma_centers : (1 + 3 * (sigma : β)) ^ m * | |
| ((K : β) * (base.theta : β) ^ m) < 1 | |
| sigma_theta : (1 + (sigma : β)) * (base.theta : β) < 1 | |
| x_zero : x 0 = 1 | |
| x_log : β n, x (n + 1) = (Nat.ceil (Real.log (q n)) : β) | |
| approximations : β n, 2 β€ q n β§ p n β 0 β§ | |
| |Real.pi - (p n : β) / q n| β€ (q n : β) ^ (-nu) | |
| x_one_le : β i, 1 β€ x i | |
| weight_growth : PiExponentApprox.SeparatedWeightGrowth m | |
| (PiExponentApprox.weightSeparationFactor m (interpolationSeparationConstant m sigma) | |
| w0 v0 base.theta) x | |
| wstar_pos : 0 < wstar | |
| wstar_lower : β i : Fin m, wstar β€ x (i.val + 1) | |
| wstar_attained : β i : Fin m, wstar = x (i.val + 1) | |
| weight_margin : Lambda * (β i : Fin m, 1 / x (i.val + 1)) + | |
| weightErrorCoefficient nu base.theta K / wstar < epsilon / 3 | |
| theorem exists_admissible_parameters | |
| (nu Lambda c : β) (hnu : 2 < nu) (hLambda : 0 < Lambda) (hc : 0 < c) | |
| (hbad : β Q : β, β p : β€, β q : β, | |
| Q β€ q β§ |Real.pi - (p : β) / q| β€ (q : β) ^ (-nu)) : | |
| Nonempty (AdmissibleParameters nu Lambda c) := by | |
| classical | |
| obtain β¨Pβ© := exists_parameters nu hnu | |
| let g : β := nu * ((P.A : β) * (1 - P.eta) - P.theta) - (1 - P.theta) | |
| have hg : 0 < g := P.gap_pos | |
| let epsilon : β := min (g / 2) (1 / 2) | |
| have hepsilon : 0 < epsilon := lt_min (by positivity) (by norm_num) | |
| have hepsg : epsilon < g := lt_of_le_of_lt (min_le_left _ _) (by linarith) | |
| have hepshalf : epsilon β€ 1 / 2 := min_le_right _ _ | |
| have heps3 : 0 < epsilon / 3 := by positivity | |
| obtain β¨F0, hF0, hFtheta, hFmarginβ© := | |
| exists_initial_scale nu P.theta epsilon P.theta_pos hepsilon | |
| have hlog2 : 0 < Real.log 2 := Real.log_pos (by norm_num) | |
| obtain β¨m, hm, hdim, hcollisionβ© := exists_dimension_margin | |
| P.theta P.A P.B P.C P.eta (Lambda * F0) (2 * Real.log 2) | |
| (epsilon / 3) (2 / c) P.theta_pos P.B_pos P.one_lt_C | |
| P.CB_lt_one P.one_lt_C_theta_div_B P.one_lt_B_div_A P.eta_pos | |
| (mul_pos hLambda hF0).le (by positivity) heps3 | |
| let K : β := dimensionK P.C m | |
| let w0 : β := (P.B ^ m)β»ΒΉ | |
| let v0 : β := 2 * (K : β) * P.theta ^ m * w0 | |
| have hK : 1 β€ K := dimensionK_one_le P.C P.one_lt_C.le m | |
| have hw0eq : (w0 : β) = dimensionW P.B m := by simp [w0, dimensionW] | |
| have hv0eq : (v0 : β) = dimensionV P.theta P.B P.C m := by | |
| simp [v0, dimensionV, K, hw0eq] | |
| have hw0 : 0 < (w0 : β) := by | |
| rw [hw0eq] | |
| exact dimensionW_pos P.B P.B_pos m | |
| have hv0 : 0 < (v0 : β) := by | |
| rw [hv0eq] | |
| exact dimensionV_pos P.theta P.B P.C P.theta_pos P.B_pos P.one_lt_C.le m | |
| have hvolume : (K : β) * ((w0 : β) / v0) * (P.theta : β) ^ m = 1 / 2 := by | |
| rw [hw0eq, hv0eq] | |
| exact dimension_volume P.theta P.B P.C P.theta_pos P.B_pos P.one_lt_C.le m | |
| have hvolume1 : (K : β) * (P.theta : β) ^ m < 1 := | |
| dimension_volume_lt_one P.theta P.C P.theta_pos P.C_pos.le P.C_theta_lt_one m hm | |
| have hcollision' : 2 < c * | |
| (P.eta ^ 2 * (K : β) * (P.theta : β) ^ m / | |
| (((m : β) + 1) * (v0 : β) * (P.A : β) ^ m)) := by | |
| rw [hv0eq] | |
| change 2 < c * (P.eta ^ 2 * (dimensionK (P.C : β) m : β) * | |
| (P.theta : β) ^ m / (((m : β) + 1) * | |
| dimensionV (P.theta : β) P.B P.C m * (P.A : β) ^ m)) | |
| rw [dimension_collision_identity P.theta P.A P.B P.C P.eta | |
| P.theta_pos P.A_pos P.B_pos P.one_lt_C.le] | |
| have hh := (div_lt_iffβ hc).mp hcollision | |
| nlinarith | |
| obtain β¨sigma, hsigma, hsigmaVol, hsigmaK, hsigmaThetaβ© := | |
| exists_small_rational_sigma m (1 / 2) | |
| ((K : β) * (P.theta : β) ^ m) P.theta (by norm_num) hvolume1 P.theta_lt_one | |
| have hnupos : 0 < nu := by linarith | |
| have hS : 0 β€ weightErrorCoefficient nu P.theta K := | |
| weightErrorCoefficient_nonneg nu P.theta K hnupos P.theta_pos hK | |
| obtain β¨X, hX, hXmarginβ© := exists_uniform_weight_error_margin m Lambda | |
| (weightErrorCoefficient nu P.theta K) (epsilon / 3) hLambda hS heps3 | |
| obtain β¨p, q, x, hx0, hxlog, happ, hx1, hgrowthβ© := | |
| exists_normalized_successive_approximations nu X | |
| (PiExponentApprox.weightSeparationFactor m | |
| (interpolationSeparationConstant m sigma) w0 v0 P.theta) hnupos hbad | |
| obtain β¨wstar, hwstarX, hwstarLower, hwstarAttainedβ© := | |
| exists_minimum_weight m hm (fun i : Fin m => x (i.val + 1)) X | |
| (fun i => (happ i.val).2.2.2.2) | |
| have hwstar : 0 < wstar := lt_of_lt_of_le zero_lt_one (le_trans hX hwstarX.le) | |
| refine β¨{ | |
| base := P | |
| epsilon := epsilon | |
| F0 := F0 | |
| m := m | |
| K := K | |
| w0 := w0 | |
| v0 := v0 | |
| sigma := sigma | |
| p := p | |
| q := q | |
| x := x | |
| wstar := wstar | |
| epsilon_pos := hepsilon | |
| epsilon_lt_gap := hepsg | |
| epsilon_le_half := hepshalf | |
| F0_pos := hF0 | |
| F0_large := hFtheta | |
| initial_margin := hFmargin | |
| m_pos := hm | |
| K_eq := rfl | |
| K_pos := hK | |
| w0_eq := hw0eq | |
| v0_eq := hv0eq | |
| w0_pos := hw0 | |
| v0_pos := hv0 | |
| volume_eq := hvolume | |
| volume_lt_one := hvolume1 | |
| dimension_margin := ?_ | |
| collision_margin := hcollision' | |
| sigma_pos := hsigma | |
| sigma_volume := ?_ | |
| sigma_centers := hsigmaK | |
| sigma_theta := hsigmaTheta | |
| x_zero := hx0 | |
| x_log := hxlog | |
| approximations := fun n => β¨(happ n).1, (happ n).2.1, (happ n).2.2.1β© | |
| x_one_le := hx1 | |
| weight_growth := fun i hi _ => hgrowth i hi | |
| wstar_pos := hwstar | |
| wstar_lower := hwstarLower | |
| wstar_attained := hwstarAttained | |
| weight_margin := hXmargin wstar (fun i : Fin m => x (i.val + 1)) | |
| hwstarX hwstarLower | |
| }β© | |
| Β· rw [hv0eq, hw0eq] | |
| exact hdim | |
| Β· rw [hvolume] | |
| exact hsigmaVol | |
| namespace AdmissibleParameters | |
| variable {nu Lambda c : β} (d : AdmissibleParameters nu Lambda c) | |
| noncomputable def rationalWeight : β β β | |
| | 0 => 1 | |
| | n + 1 => (Nat.ceil (Real.log (d.q n)) : β) | |
| theorem cast_rationalWeight (i : β) : (d.rationalWeight i : β) = d.x i := by | |
| cases i with | |
| | zero => simpa [rationalWeight] using d.x_zero.symm | |
| | succ n => simpa [rationalWeight] using (d.x_log n).symm | |
| theorem rationalWeight_pos (i : β) : 0 < d.rationalWeight i := by | |
| have h : (0 : β) < (d.rationalWeight i : β) := by | |
| rw [d.cast_rationalWeight] | |
| exact zero_lt_one.trans_le (d.x_one_le i) | |
| exact_mod_cast h | |
| theorem multiplicity_constant_bound (k : β) (hk : k β€ d.m) : | |
| 2 * (k.factorial : β) * (((d.m : β) + 2) / (d.sigma : β)) ^ k β€ | |
| interpolationSeparationConstant d.m d.sigma := by | |
| exact PiExponentApprox.multiplicity_constant_le_enlarged d.m k d.sigma d.sigma_pos hk | |
| theorem rectangular_multiplicity_constant_bound (k : β) (hk : k β€ d.m) : | |
| (k : β) ^ k * (((d.m : β) + 2) / (d.sigma : β)) ^ k β€ | |
| interpolationSeparationConstant d.m d.sigma := by | |
| exact PiExponentApprox.rectangular_multiplicity_constant_le_enlarged | |
| d.m k d.sigma d.sigma_pos hk | |
| theorem separated_weight_products | |
| (A B : Finset β) (hcard : A.card = B.card) | |
| (hA : A β Finset.range (d.m + 1)) (hB : B β Finset.range (d.m + 1)) | |
| (i : β) (hi : 0 < i) (hiA : i β A) (hiB : i β B) | |
| (hbelow : β j β B \ A, j < i) : | |
| interpolationSeparationConstant d.m d.sigma * | |
| (β j β B, PiExponentApprox.geometricJetWeight d.v0 d.base.theta d.x j) < | |
| β j β A, PiExponentApprox.geometricDegreeWeight d.w0 d.x j := by | |
| exact PiExponentApprox.geometric_weight_products_separated d.m | |
| (interpolationSeparationConstant d.m d.sigma) d.w0 d.v0 d.base.theta d.x | |
| (interpolationSeparationConstant_pos d.m d.sigma d.sigma_pos) | |
| d.w0_pos d.v0_pos d.base.theta_pos d.x_zero d.x_one_le d.weight_growth | |
| A B hcard hA hB i hi hiA hiB hbelow | |
| theorem total_error_lt_gap : | |
| nu / d.F0 + | |
| ((Lambda * d.F0 * (d.m : β) + 2 * Real.log 2) / (d.v0 : β) + | |
| 100 * (d.K : β) / (d.w0 : β)) + | |
| (Lambda * (β i : Fin d.m, 1 / d.x (i.val + 1)) + | |
| weightErrorCoefficient nu d.base.theta d.K / d.wstar) < | |
| nu * ((d.base.A : β) * (1 - d.base.eta) - d.base.theta) - | |
| (1 - d.base.theta) := by | |
| have h1 := d.initial_margin | |
| have h2 := d.dimension_margin | |
| have h3 := d.weight_margin | |
| have h4 := d.epsilon_lt_gap | |
| linarith | |
| theorem collision_exceeds_one_add_error : | |
| 1 + (nu / d.F0 + | |
| ((Lambda * d.F0 * (d.m : β) + 2 * Real.log 2) / (d.v0 : β) + | |
| 100 * (d.K : β) / (d.w0 : β)) + | |
| (Lambda * (β i : Fin d.m, 1 / d.x (i.val + 1)) + | |
| weightErrorCoefficient nu d.base.theta d.K / d.wstar)) < | |
| c * (d.base.eta ^ 2 * (d.K : β) * (d.base.theta : β) ^ d.m / | |
| (((d.m : β) + 1) * (d.v0 : β) * (d.base.A : β) ^ d.m)) := by | |
| have h1 := d.initial_margin | |
| have h2 := d.dimension_margin | |
| have h3 := d.weight_margin | |
| have h4 := d.epsilon_le_half | |
| have h5 := d.collision_margin | |
| linarith | |
| noncomputable def arithmeticError : β := | |
| Lambda * d.F0 * (d.m : β) / (d.v0 : β) + | |
| Lambda * (β i : Fin d.m, 1 / d.x (i.val + 1)) + (d.base.theta : β) / d.wstar | |
| noncomputable def translationError : β := | |
| nu / d.F0 + Real.log 2 / (d.v0 : β) + | |
| (Real.log 4 + Real.log (2 * (d.K : β)) + nu) / d.wstar | |
| noncomputable def holomorphicError : β := | |
| 100 * (d.K : β) / (d.w0 : β) + Real.log 2 / (d.v0 : β) + | |
| Real.log (200 * (d.K : β)) / d.wstar | |
| noncomputable def analyticError : β := d.translationError + d.holomorphicError | |
| theorem error_sum_eq : d.arithmeticError + d.analyticError = | |
| nu / d.F0 + | |
| ((Lambda * d.F0 * (d.m : β) + 2 * Real.log 2) / (d.v0 : β) + | |
| 100 * (d.K : β) / (d.w0 : β)) + | |
| (Lambda * (β i : Fin d.m, 1 / d.x (i.val + 1)) + | |
| weightErrorCoefficient nu d.base.theta d.K / d.wstar) := by | |
| unfold arithmeticError analyticError translationError holomorphicError weightErrorCoefficient | |
| ring | |
| theorem error_sum_lt_gap : d.arithmeticError + d.analyticError < | |
| nu * ((d.base.A : β) * (1 - d.base.eta) - d.base.theta) - | |
| (1 - d.base.theta) := by | |
| rw [d.error_sum_eq] | |
| exact d.total_error_lt_gap | |
| theorem collision_exceeds_error_sum : 1 + d.arithmeticError + d.analyticError < | |
| c * (d.base.eta ^ 2 * (d.K : β) * (d.base.theta : β) ^ d.m / | |
| (((d.m : β) + 1) * (d.v0 : β) * (d.base.A : β) ^ d.m)) := by | |
| rw [add_assoc, d.error_sum_eq] | |
| exact d.collision_exceeds_one_add_error | |
| end AdmissibleParameters | |
| end PiExponent | |
| end OAI | |