Download data/lean/OAI/NumberTheory/Jacobsthal/Probability/FallingFactorialProbability.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 2.69 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/NumberTheory/Jacobsthal/Probability/FallingFactorialProbability.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/NumberTheory/Jacobsthal/Probability/FallingFactorialProbability.lean
-
curl -L -o FallingFactorialProbability.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/NumberTheory/Jacobsthal/Probability/FallingFactorialProbability.lean
2.69 kB
| import OAI.NumberTheory.Jacobsthal.Estimates.FiniteSampleSpace | |
| namespace OAI | |
| namespace Erdos970 | |
| section | |
| namespace ErdosInverseSampling | |
| attribute [local instance] Classical.decEq | |
| theorem sample_length_le (n h : β) (beta : β) (hb : 0 < beta) (hb1 : beta β€ 1) | |
| (hsize : 4*(h : β)/beta β€ (n : β)) : h β€ n := by | |
| have hh := (div_le_iffβ hb).mp hsize | |
| have hbmul := mul_le_mul_of_nonneg_right hb1 (Nat.cast_nonneg n : (0 : β) β€ n) | |
| have hr : (h : β) β€ n := by nlinarith [show (0 : β) β€ h from Nat.cast_nonneg h] | |
| exact_mod_cast hr | |
| theorem falling_ratio_lower (n m h : β) (beta : β) (hb : 0 < beta) (hb1 : beta β€ 1) | |
| (hgood : (beta/2)*(n : β) β€ (m : β)) | |
| (hsize : 4*(h : β)/beta β€ (n : β)) : | |
| (beta/4)^h β€ (m.descFactorial h : β)/(n.descFactorial h : β) := by | |
| have hhn := sample_length_le n h beta hb hb1 hsize | |
| have hpay := (div_le_iffβ hb).mp hsize | |
| have hhm : h β€ m := by | |
| have hh : (h : β) β€ m := by nlinarith [show (0 : β) β€ h from Nat.cast_nonneg h] | |
| exact_mod_cast hh | |
| have hnum : ((beta/4)*(n : β))^h β€ (m.descFactorial h : β) := by | |
| rw [Nat.descFactorial_eq_prod_range,Nat.cast_prod] | |
| calc | |
| _ = β _i β Finset.range h,(beta/4)*(n : β) := by simp | |
| _ β€ β i β Finset.range h,((m-i : β) : β) := by | |
| apply Finset.prod_le_prodβ (fun _ _ => by positivity) | |
| intro i hi | |
| have hih : i < h := Finset.mem_range.mp hi | |
| have him : i β€ m := by omega | |
| rw [Nat.cast_sub him] | |
| have hiR : (i : β) β€ h := by exact_mod_cast hih.le | |
| nlinarith | |
| have hden : (n.descFactorial h : β) β€ (n : β)^h := by | |
| exact_mod_cast Nat.descFactorial_le_pow n h | |
| have hdenpos : (0 : β) < n.descFactorial h := by exact_mod_cast Nat.descFactorial_pos.mpr hhn | |
| apply (le_div_iffβ hdenpos).mpr | |
| calc | |
| _ β€ (beta/4)^h*(n : β)^h := mul_le_mul_of_nonneg_left hden (by positivity) | |
| _ = ((beta/4)*(n : β))^h := by rw [mul_pow] | |
| _ β€ _ := hnum | |
| theorem sampleFrequency_lower {Ξ± : Type*} (U W : Finset Ξ±) (hWU : W β U) (h : β) | |
| (beta : β) (hb : 0 < beta) (hb1 : beta β€ 1) | |
| (hgood : (beta/2)*(U.card : β) β€ (W.card : β)) | |
| (hsize : 4*(h : β)/beta β€ (U.card : β)) : | |
| (beta/4)^h β€ sampleFrequency U W h := by | |
| rw [sampleFrequency_eq U W hWU h] | |
| exact falling_ratio_lower U.card W.card h beta hb hb1 hgood hsize | |
| theorem sample_nonempty_of_length {Ξ± : Type*} (U : Finset Ξ±) (h : β) (hh : h β€ U.card) : | |
| Nonempty (Sample U h) := by | |
| apply Fintype.card_pos_iff.mp | |
| rw [sample_card] | |
| exact Nat.descFactorial_pos.mpr hh | |
| end ErdosInverseSampling | |
| end | |
| end Erdos970 | |
| end OAI | |