Download data/lean/OAI/Computability/VertexCover/Reduction/GridBudget.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 4.09 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/VertexCover/Reduction/GridBudget.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Computability/VertexCover/Reduction/GridBudget.lean
-
curl -L -o GridBudget.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Computability/VertexCover/Reduction/GridBudget.lean
4.09 kB
| import Mathlib | |
| namespace OAI | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| section | |
| namespace VertexCover.Parameters | |
| noncomputable section | |
| def a (m : β) : β := 1 / (4*m) | |
| def bβ (m : β) : β := 1 / (2*m) | |
| def Ξ½ (m : β) : β := 1 / (2^7 * (m:β)^3) | |
| def Ξ² (m : β) : β := 1 / (2^10 * (m:β)^3) | |
| def ell (m : β) : β := 2^11*m^3 | |
| def h (m : β) : β := 2^12*m^3 | |
| def d (m : β) : β := 2^38*m^10 | |
| def Ο (m : β) : β := 1 / (2^46 * (m:β)^12) | |
| def p (m : β) : β := 2*d m+1 | |
| def t (m : β) : β := 2^17*m^4 | |
| theorem d_square (m : β) : d m = (2^19*m^5)^2 := by | |
| unfold d | |
| ring | |
| theorem sqrt_d (m : β) : Real.sqrt (d m) = 2^19*(m:β)^5 := by | |
| rw [d_square] | |
| simp only [Nat.cast_pow, Nat.cast_mul, Nat.cast_ofNat, Real.sqrt_sq_eq_abs] | |
| exact abs_of_nonneg (by positivity) | |
| theorem t_eq (m : β) (hm : 0 < m) : (t m : β) = a m * Real.sqrt (d m) := by | |
| rw [sqrt_d] | |
| have hp : (m:β) β 0 := by positivity | |
| simp only [t, a, Nat.cast_mul, Nat.cast_pow, Nat.cast_ofNat] | |
| field_simp | |
| ring | |
| theorem positive (m : β) (hm : 0 < m) : | |
| 0 < Ξ½ m β§ 0 < Ξ² m β§ 0 < ell m β§ 0 < h m β§ 0 < d m β§ 0 < Ο m := by | |
| dsimp [Ξ½, Ξ², ell, h, d, Ο] | |
| constructor <;> try positivity | |
| constructor <;> try positivity | |
| constructor <;> try positivity | |
| constructor <;> try positivity | |
| constructor <;> positivity | |
| theorem dimensions (m : β) (hm : 4 β€ m) : | |
| 4 β€ d m β§ 2 β€ h m β§ h m < d m β§ Even (d m) := by | |
| have h1 : 1 β€ m := by omega | |
| have h3 : 1 β€ m^3 := one_le_powβ h1 | |
| have h310 : m^3 β€ m^10 := Nat.pow_le_pow_right (by omega) (by decide) | |
| have h10 : 1 β€ m^10 := one_le_powβ h1 | |
| dsimp [d, h] | |
| refine β¨by omega, by omega, ?_, ?_β© | |
| Β· omega | |
| Β· exact β¨137438953472*m^10, by omegaβ© | |
| theorem restriction_budget (m : β) (hm : 4 β€ m) : | |
| 16*(h m : β)+32*(h m : β)^2 β€ Ξ½ m*(d m : β)/2 := by | |
| have hm1 : (1:β) β€ m := by exact_mod_cast (show 1 β€ m by omega) | |
| have hp : (m:β) β 0 := by exact_mod_cast (show m β 0 by omega) | |
| have h36 : (m:β)^3 β€ (m:β)^6 := pow_le_pow_rightβ hm1 (by decide) | |
| have h67 : (m:β)^6 β€ (m:β)^7 := pow_le_pow_rightβ hm1 (by decide) | |
| have h6 : (0:β) β€ (m:β)^6 := by positivity | |
| have heq : Ξ½ m*(d m : β)/2 = 2^30*(m:β)^7 := by | |
| simp only [Ξ½, d, Nat.cast_mul, Nat.cast_pow, Nat.cast_ofNat] | |
| field_simp | |
| rw [heq] | |
| simp only [h, Nat.cast_mul, Nat.cast_pow, Nat.cast_ofNat] | |
| nlinarith [sq_nonneg ((m:β)^3)] | |
| theorem Ξ²_h (m : β) (hm : 0 < m) : Ξ² m*(h m : β)/2 = 2 := by | |
| have hp : (m:β) β 0 := by positivity | |
| simp only [Ξ², h, Nat.cast_mul, Nat.cast_pow, Nat.cast_ofNat] | |
| field_simp | |
| theorem ell_eq (m : β) (hm : 0 < m) : (ell m : β) = 2/Ξ² m := by | |
| have hp : (m:β) β 0 := by positivity | |
| simp only [ell, Ξ², Nat.cast_mul, Nat.cast_pow, Nat.cast_ofNat] | |
| field_simp | |
| theorem Ο_eq (m : β) : Ο m = 1 / ((h m : β)^2*(ell m : β)^2) := by | |
| unfold Ο h ell | |
| push_cast | |
| congr 1 | |
| ring | |
| theorem grid_budget (m : β) (hm : 4 β€ m) : | |
| (d m : β)/(p m : β) < 1/2 β§ (1:β)/2 < (t m : β)/2 β§ 2*m < p m := by | |
| have hd := (dimensions m hm).1 | |
| have hm1 : 1 β€ m := by omega | |
| have hm4 : 1 β€ m^4 := one_le_powβ hm1 | |
| have hmd : m β€ d m := by | |
| have hpow : m^1 β€ m^10 := Nat.pow_le_pow_right (by omega) (by decide) | |
| simp only [pow_one] at hpow | |
| dsimp [d] | |
| omega | |
| refine β¨?_, ?_, ?_β© | |
| Β· have hp : (0:β) < p m := by unfold p; positivity | |
| apply (div_lt_iffβ hp).mpr | |
| simp only [p, Nat.cast_add, Nat.cast_mul, Nat.cast_ofNat, Nat.cast_one] | |
| linarith | |
| Β· have ht : 1 < t m := by dsimp [t]; omega | |
| have ht' : (1:β) < t m := by exact_mod_cast ht | |
| linarith | |
| Β· dsimp [p]; omega | |
| end | |
| end VertexCover.Parameters | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end OAI | |