Download data/lean/OAI/NumberTheory/Jacobsthal/Partitions/CellLengthLower.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 5.35 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/NumberTheory/Jacobsthal/Partitions/CellLengthLower.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/NumberTheory/Jacobsthal/Partitions/CellLengthLower.lean
-
curl -L -o CellLengthLower.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/NumberTheory/Jacobsthal/Partitions/CellLengthLower.lean
5.35 kB
| import OAI.NumberTheory.Jacobsthal.Estimates.PositiveProgression | |
| namespace OAI | |
| namespace Erdos970 | |
| section | |
| namespace ErdosInverseTail | |
| open ErdosInverseHits | |
| noncomputable def commonParentLength (Y p : β) (Qplus : β) : β := | |
| β(Y : β)/((p : β)*Qplus)ββ | |
| theorem commonParentLength_le_hits (Y p q b : β) (hp : 0 < p) (hq : 0 < q) | |
| (hb : b β€ p*q) (Qplus : β) (hqQ : (q : β) β€ Qplus) : | |
| commonParentLength Y p Qplus β€ hitLength Y (p*q) b := by | |
| have hpR : (0 : β) < p := by exact_mod_cast hp | |
| have hqR : (0 : β) < q := by exact_mod_cast hq | |
| have hQ : 0 < Qplus := hqR.trans_le hqQ | |
| have hA : 0 β€ (Y : β)/((p : β)*Qplus) := by positivity | |
| have hJ : (commonParentLength Y p Qplus : β) β€ (Y : β)/((p : β)*Qplus) := Nat.floor_le hA | |
| have hden : (p : β)*q β€ (p : β)*Qplus := mul_le_mul_of_nonneg_left hqQ hpR.le | |
| have hJB : (commonParentLength Y p Qplus : β) β€ (Y : β)/((p : β)*q) := | |
| hJ.trans (div_le_div_of_nonneg_left (Nat.cast_nonneg _) (mul_pos hpR hqR) hden) | |
| have hnat : commonParentLength Y p Qplus*(p*q) β€ Y := by | |
| exact_mod_cast (le_div_iffβ (mul_pos hpR hqR)).mp hJB | |
| have hdiv : commonParentLength Y p Qplus β€ Y/(p*q) := (Nat.le_div_iff_mul_le (mul_pos hp hq)).mpr hnat | |
| exact hdiv.trans (Nat.div_le_div_right (by omega : Y β€ Y+p*q-b)) | |
| theorem actual_cell_tail_length (Y p q b : β) (hp : 0 < p) (hq : 0 < q) | |
| (hb1 : 1 β€ b) (hb : b β€ p*q) (Qplus xi : β) | |
| (hxi : 0 β€ xi) (hxi1 : xi β€ 1) (hqQ : (q : β) β€ Qplus) (hQq : Qplus β€ (1+xi)*(q : β)) : | |
| ((hitLength Y (p*q) b-commonParentLength Y p Qplus : β) : β) β€ | |
| xi*(commonParentLength Y p Qplus : β)+3 := by | |
| have hpR : (0 : β) < p := by exact_mod_cast hp | |
| have hqR : (0 : β) < q := by exact_mod_cast hq | |
| have hQ : 0 < Qplus := hqR.trans_le hqQ | |
| have hA : 0 β€ (Y : β)/((p : β)*Qplus) := by positivity | |
| have hJlt : (Y : β)/((p : β)*Qplus) < (commonParentLength Y p Qplus : β)+1 := Nat.lt_floor_add_one _ | |
| have hratio : Qplus/(q : β) β€ 1+xi := (div_le_iffβ hqR).mpr hQq | |
| have hB : (Y : β)/((p : β)*q) β€ (1+xi)*((Y : β)/((p : β)*Qplus)) := by | |
| calc | |
| _ = ((Y : β)/((p : β)*Qplus))*(Qplus/(q : β)) := by field_simp | |
| _ β€ ((Y : β)/((p : β)*Qplus))*(1+xi) := mul_le_mul_of_nonneg_left hratio hA | |
| _ = _ := by ring | |
| have herr := hitLength_error Y (p*q) b (mul_pos hp hq) hb1 hb | |
| have hN : (hitLength Y (p*q) b : β) β€ (Y : β)/((p : β)*q)+1 := by | |
| have hh := (abs_le.mp herr).2 | |
| push_cast at hh | |
| linarith | |
| have hJN := commonParentLength_le_hits Y p q b hp hq hb Qplus hqQ | |
| rw [Nat.cast_sub hJN] | |
| have hpay := mul_le_mul_of_nonneg_left hJlt.le (by linarith : 0 β€ 1+xi) | |
| nlinarith | |
| end ErdosInverseTail | |
| end | |
| section | |
| namespace ErdosInverseTail | |
| theorem common_length_from_log (Y p q u : β) (hp : 0 < p) (hq : 0 < q) (hu : 0 < u) | |
| (Qplus xi w aStar : β) (hqQ : (q : β) β€ Qplus) (hQq : Qplus β€ (1+xi)*(q : β)) | |
| (hxi : 0 β€ xi) (hxi1 : xi β€ 1) (hw : 1 < w) (ha : 0 < aStar) | |
| (hlen : 3*aStar/4 β€ Real.log ((Y : β)/((p : β)*q*u))/Real.log w) : | |
| w^(3*aStar/4) β€ 2*(commonParentLength Y p Qplus : β)/(u : β)+2 := by | |
| have hpR : (0 : β) < p := by exact_mod_cast hp | |
| have hqR : (0 : β) < q := by exact_mod_cast hq | |
| have huR : (0 : β) < u := by exact_mod_cast hu | |
| have hu1 : (1 : β) β€ u := by exact_mod_cast hu | |
| have hQ : 0 < Qplus := hqR.trans_le hqQ | |
| have hw0 : 0 < w := by linarith | |
| have hlogw : 0 < Real.log w := Real.log_pos hw | |
| have hlog := (le_div_iffβ hlogw).mp hlen | |
| have hlogpos : 0 < Real.log ((Y : β)/((p : β)*q*u)) := by nlinarith | |
| have hR1 : 1 < (Y : β)/((p : β)*q*u) := (Real.log_pos_iff (by positivity)).mp hlogpos | |
| have hpow : w^(3*aStar/4) β€ (Y : β)/((p : β)*q*u) := by | |
| rw [Real.rpow_def_of_pos hw0] | |
| calc | |
| _ β€ Real.exp (Real.log ((Y : β)/((p : β)*q*u))) := Real.exp_le_exp.mpr (by nlinarith [hlog]) | |
| _ = _ := Real.exp_log (by linarith) | |
| have hA : 0 β€ (Y : β)/((p : β)*Qplus) := by positivity | |
| have hJlt : (Y : β)/((p : β)*Qplus) < (commonParentLength Y p Qplus : β)+1 := Nat.lt_floor_add_one _ | |
| have hratio : Qplus/(q : β) β€ 1+xi := (div_le_iffβ hqR).mpr hQq | |
| have hRupper : (Y : β)/((p : β)*q*u) β€ 2*((commonParentLength Y p Qplus : β)+1)/(u : β) := by | |
| calc | |
| _ = ((Y : β)/((p : β)*Qplus))*(Qplus/(q : β))/(u : β) := by field_simp | |
| _ β€ ((Y : β)/((p : β)*Qplus))*(1+xi)/(u : β) := | |
| div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_left hratio hA) huR.le | |
| _ β€ ((commonParentLength Y p Qplus : β)+1)*(1+xi)/(u : β) := | |
| div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_right hJlt.le (by linarith)) huR.le | |
| _ β€ 2*((commonParentLength Y p Qplus : β)+1)/(u : β) := by | |
| apply div_le_div_of_nonneg_right _ huR.le | |
| nlinarith [show (0 : β) β€ commonParentLength Y p Qplus from Nat.cast_nonneg _] | |
| have htwo : (2 : β)/(u : β) β€ 2 := (div_le_iffβ huR).mpr (by linarith) | |
| calc | |
| _ β€ (Y : β)/((p : β)*q*u) := hpow | |
| _ β€ 2*((commonParentLength Y p Qplus : β)+1)/(u : β) := hRupper | |
| _ = 2*(commonParentLength Y p Qplus : β)/(u : β)+2/(u : β) := by ring | |
| _ β€ _ := add_le_add le_rfl htwo | |
| end ErdosInverseTail | |
| end | |
| end Erdos970 | |
| end OAI | |