Download data/lean/OAI/Combinatorics/GraphThreshold/ThresholdBounds.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 5.05 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/GraphThreshold/ThresholdBounds.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Combinatorics/GraphThreshold/ThresholdBounds.lean
-
curl -L -o ThresholdBounds.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/GraphThreshold/ThresholdBounds.lean
5.05 kB
| import OAI.Combinatorics.GraphThreshold.Thresholds | |
| import Mathlib.Data.Nat.Choose.Bounds | |
| import Mathlib.Analysis.SpecialFunctions.Log.Base | |
| namespace OAI | |
| /-! | |
| # Explicit constants in the threshold conclusion | |
| The tree argument first gives a logarithm of an edge capacity. These elementary | |
| bounds turn that quantity into the two constants stated for graphs. | |
| -/ | |
| noncomputable section | |
| namespace LeanBlast.SecondKahnKalai | |
| theorem logTwo_eq_logb (x : β) : logTwo x = Real.logb 2 x := rfl | |
| theorem logTwo_nonneg {x : β} (hx : 1 β€ x) : 0 β€ logTwo x := by | |
| unfold logTwo | |
| exact div_nonneg (Real.log_nonneg hx) (Real.log_pos (by norm_num)).le | |
| theorem logTwo_mono {x y : β} (hx : 0 < x) (hxy : x β€ y) : | |
| logTwo x β€ logTwo y := by | |
| unfold logTwo | |
| exact div_le_div_of_nonneg_right (Real.log_le_log hx hxy) | |
| (Real.log_pos (by norm_num)).le | |
| theorem edgeCount_le_sq {V : Type*} [Fintype V] | |
| (n : β) (H : SimpleGraph V) (hcard : Fintype.card V β€ n) : | |
| edgeCount H β€ n ^ 2 := by | |
| classical | |
| rw [edgeCount_eq_card_edgeFinset] | |
| calc | |
| H.edgeFinset.card β€ (Fintype.card V).choose 2 := | |
| SimpleGraph.card_edgeFinset_le_card_choose_two | |
| _ β€ (Fintype.card V) ^ 2 := Nat.choose_le_pow _ _ | |
| _ β€ n ^ 2 := Nat.pow_le_pow_left hcard 2 | |
| theorem one_add_logTwo_le_three_logTwo (n h : β) | |
| (hn : 2 β€ n) (hh : 1 β€ h) (hhn : h β€ n ^ 2) : | |
| 1 + logTwo (h : β) β€ 3 * logTwo (n : β) := by | |
| have hn' : (2 : β) β€ n := by exact_mod_cast hn | |
| have hh' : (1 : β) β€ h := by exact_mod_cast hh | |
| have hhn' : (h : β) β€ (n : β) ^ 2 := by exact_mod_cast hhn | |
| have hlog2 : 0 < Real.log 2 := Real.log_pos (by norm_num) | |
| have hlogn : Real.log 2 β€ Real.log (n : β) := | |
| Real.log_le_log (by norm_num) hn' | |
| have hone : 1 β€ logTwo (n : β) := by | |
| unfold logTwo | |
| exact (le_div_iffβ hlog2).mpr (by simpa using hlogn) | |
| have hlogh : Real.log (h : β) β€ 2 * Real.log (n : β) := by | |
| calc | |
| Real.log (h : β) β€ Real.log ((n : β) ^ 2) := | |
| Real.log_le_log (by linarith) hhn' | |
| _ = 2 * Real.log (n : β) := by rw [Real.log_pow]; norm_num | |
| have htwo : logTwo (h : β) β€ 2 * logTwo (n : β) := by | |
| unfold logTwo | |
| simpa only [mul_div_assoc] using | |
| div_le_div_of_nonneg_right hlogh hlog2.le | |
| linarith | |
| theorem graph_one_add_logTwo_le_three_logTwo {V : Type*} [Fintype V] | |
| (n : β) (H : SimpleGraph V) (hn : 2 β€ n) | |
| (hcard : Fintype.card V β€ n) (hedge : 1 β€ edgeCount H) : | |
| 1 + logTwo (edgeCount H : β) β€ 3 * logTwo (n : β) := | |
| one_add_logTwo_le_three_logTwo n (edgeCount H) hn hedge | |
| (edgeCount_le_sq n H hcard) | |
| theorem graphThresholdParameter_mem_unitInterval (q : β) (h : β) | |
| (hq : 0 β€ q) (hh : 1 β€ h) : | |
| min 1 (2048 * Real.exp 50 * q * (1 + logTwo (h : β))) β Set.Icc 0 1 := by | |
| have hlog : 0 β€ logTwo (h : β) := logTwo_nonneg (by exact_mod_cast hh) | |
| constructor | |
| Β· exact le_min (by norm_num) (mul_nonneg | |
| (mul_nonneg (mul_nonneg (by norm_num) (Real.exp_pos 50).le) hq) (by linarith)) | |
| Β· exact min_le_left _ _ | |
| theorem treeSamplingParameter_mem_unitInterval (q : β) (m : β) | |
| (hq : 0 β€ q) (hm : 0 < m) : | |
| min 1 (16 * Real.exp 50 * (128 * q) * | |
| (1 + Real.logb 2 (m : β))) β Set.Icc 0 1 := by | |
| have hfactor : 16 * Real.exp 50 * (128 * q) = 2048 * Real.exp 50 * q := by ring | |
| rw [hfactor, β logTwo_eq_logb] | |
| exact graphThresholdParameter_mem_unitInterval q m hq hm | |
| theorem treeSamplingParameter_le_graphParameter (q : β) (m h : β) | |
| (hq : 0 β€ q) (hm : 0 < m) (hmh : m β€ h) : | |
| min 1 (16 * Real.exp 50 * (128 * q) * (1 + Real.logb 2 (m : β))) β€ | |
| min 1 (2048 * Real.exp 50 * q * (1 + logTwo (h : β))) := by | |
| apply min_le_min_left | |
| have hlog : logTwo (m : β) β€ logTwo (h : β) := | |
| logTwo_mono (by exact_mod_cast hm) (by exact_mod_cast hmh) | |
| calc | |
| 16 * Real.exp 50 * (128 * q) * (1 + Real.logb 2 (m : β)) = | |
| 2048 * Real.exp 50 * q * (1 + logTwo (m : β)) := by | |
| rw [logTwo_eq_logb] | |
| ring | |
| _ β€ 2048 * Real.exp 50 * q * (1 + logTwo (h : β)) := | |
| mul_le_mul_of_nonneg_left (by linarith) | |
| (mul_nonneg (mul_nonneg (by norm_num) (Real.exp_pos 50).le) hq) | |
| theorem graphThresholdParameter_le_vertexBound {V : Type*} [Fintype V] | |
| (n : β) (H : SimpleGraph V) (q : β) (hn : 2 β€ n) | |
| (hcard : Fintype.card V β€ n) (hedge : 1 β€ edgeCount H) (hq : 0 β€ q) : | |
| min 1 (2048 * Real.exp 50 * q * (1 + logTwo (edgeCount H : β))) β€ | |
| 6144 * Real.exp 50 * q * logTwo (n : β) := by | |
| calc | |
| min 1 (2048 * Real.exp 50 * q * (1 + logTwo (edgeCount H : β))) β€ | |
| 2048 * Real.exp 50 * q * (1 + logTwo (edgeCount H : β)) := min_le_right _ _ | |
| _ β€ 2048 * Real.exp 50 * q * (3 * logTwo (n : β)) := by | |
| exact mul_le_mul_of_nonneg_left | |
| (graph_one_add_logTwo_le_three_logTwo n H hn hcard hedge) | |
| (mul_nonneg (mul_nonneg (by norm_num) (Real.exp_pos 50).le) hq) | |
| _ = 6144 * Real.exp 50 * q * logTwo (n : β) := by ring | |
| end LeanBlast.SecondKahnKalai | |
| end | |
| end OAI | |