introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
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