Download data/lean/OAI/Combinatorics/MatchingPSD/NumericalBounds.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 3.33 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/MatchingPSD/NumericalBounds.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Combinatorics/MatchingPSD/NumericalBounds.lean
-
curl -L -o NumericalBounds.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Combinatorics/MatchingPSD/NumericalBounds.lean
3.33 kB
| import OAI.Combinatorics.MatchingPSD.Parameters | |
| namespace OAI | |
| namespace PerfectMatchingPSD | |
| open MatchingSmoothing MatchingInterpolation Matrix | |
| open scoped BigOperators MatrixOrder | |
| lemma blockSize_ge (d t : β) : t^4 β€ blockSize d t := by | |
| dsimp [blockSize] | |
| simpa only [one_mul] using Nat.mul_le_mul_right (t^4) (show 1 β€ 4*(d+1) by omega) | |
| lemma blockSize_grid (d t : β) : 2*t^4*d β€ blockSize d t := by | |
| dsimp [blockSize] | |
| calc | |
| 2*t^4*d = (2*d)*t^4 := by ring | |
| _ β€ 4*(d+1)*t^4 := Nat.mul_le_mul_right _ (by omega) | |
| lemma selection_of_cleared {q r T m L b : β} (hb : 0 < b) (hc : 0 < r*m*L) | |
| (hnum : q*r^6*T*m^2*L^2 β€ b) : | |
| q*r^4*T*bβ»ΒΉ β€ (1/(r*m*L))^2 := by | |
| rw [β div_eq_mul_inv, div_pow, one_pow] | |
| apply (div_le_div_iffβ hb (sq_pos_of_pos hc)).mpr | |
| calc | |
| _ = q*r^6*T*m^2*L^2 := by ring | |
| _ β€ b := hnum | |
| _ = _ := by ring | |
| lemma numerical_selection (p d t r n T : β) (ht : 2 β€ t) (hr : 0 < r) | |
| (hn : n β€ t^6) (hT : T β€ t) (hrn : (r:β) β€ (n:β)^p) : | |
| (t:β)*r^4*T*((2*(3*(blockSize d t:β)+1))^(2*(10*(p+1))))β»ΒΉ β€ | |
| (1/((r:β)*((n:β)+1)*(2*(t:β)^4)))^2 := by | |
| have ht2 : (2:β) β€ t := by exact_mod_cast ht | |
| have ht1 : (1:β) β€ t := by linarith | |
| have ht0 : (0:β) β€ t := Nat.cast_nonneg t | |
| have hr0 : (0:β) β€ r := Nat.cast_nonneg r | |
| have hn6 : (n:β) β€ (t:β)^6 := by exact_mod_cast hn | |
| have hrp : (r:β) β€ (t:β)^(6*p) := by | |
| simpa only [pow_mul] using hrn.trans (pow_le_pow_leftβ (Nat.cast_nonneg n) hn6 p) | |
| have hm : (n:β)+1 β€ (t:β)^7 := by | |
| have h6 : (1:β) β€ (t:β)^6 := one_le_powβ ht1 | |
| calc | |
| _ β€ (t:β)^6+(t:β)^6 := add_le_add hn6 h6 | |
| _ = 2*(t:β)^6 := by ring | |
| _ β€ (t:β)*(t:β)^6 := mul_le_mul_of_nonneg_right ht2 (pow_nonneg ht0 _) | |
| _ = _ := by ring | |
| have hL : 2*(t:β)^4 β€ (t:β)^5 := by | |
| calc | |
| _ β€ (t:β)*(t:β)^4 := mul_le_mul_of_nonneg_right ht2 (pow_nonneg ht0 _) | |
| _ = _ := by ring | |
| have hTr : (T:β) β€ t := by exact_mod_cast hT | |
| have hbase : (t:β)^4 β€ 2*(3*(blockSize d t:β)+1) := by | |
| have hs : (t:β)^4 β€ (blockSize d t:β) := by exact_mod_cast blockSize_ge d t | |
| have hs0 : (0:β) β€ (blockSize d t:β) := Nat.cast_nonneg _ | |
| linarith | |
| have hb : 0 < (2*(3*(blockSize d t:β)+1))^(2*(10*(p+1))) := by positivity | |
| apply selection_of_cleared hb (by positivity) | |
| calc | |
| _ β€ (t:β)*((t:β)^(6*p))^6*(t:β)*((t:β)^7)^2*((t:β)^5)^2 := by gcongr | |
| _ = (t:β)^(36*p+26) := by | |
| have he : 36*p+26 = 1+(6*p)*6+1+7*2+5*2 := by omega | |
| rw [he] | |
| simp only [pow_add, pow_mul, pow_one] | |
| _ β€ (t:β)^(8*(10*(p+1))) := pow_le_pow_rightβ ht1 (by omega) | |
| _ = ((t:β)^4)^(2*(10*(p+1))) := by rw [β pow_mul]; congr 1; omega | |
| _ β€ _ := pow_le_pow_leftβ (pow_nonneg ht0 _) hbase _ | |
| lemma numerical_smallness (D : β) (t : β) (ht : 1 β€ t) (hD : 8*(D+1) β€ (t:β)) : | |
| 16*(t:β)^2*((t:β)*D+1) β€ 2*(t:β)^4 := by | |
| have ht1 : (1:β) β€ t := by exact_mod_cast ht | |
| have ht0 : (0:β) β€ t := Nat.cast_nonneg t | |
| calc | |
| _ β€ 16*(t:β)^2*((t:β)*(D+1)) := by gcongr; linarith | |
| _ = 2*(t:β)^3*(8*(D+1)) := by ring | |
| _ β€ 2*(t:β)^3*(t:β) := mul_le_mul_of_nonneg_left hD (by positivity) | |
| _ = _ := by ring | |
| end PerfectMatchingPSD | |
| end OAI | |