File size: 4,987 Bytes
4a56cd6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | import Mathlib
import OAI.Probability.SKBarriers.SpinGlass.Basic
namespace OAI
section
section
noncomputable section
open scoped BigOperators
open MeasureTheory ProbabilityTheory Filter Set
namespace SK.Analytic
open scoped InnerProductSpace
theorem unit_conflict_packing {E : Type*} [NormedAddCommGroup E] [InnerProductSpace β E]
{d : β} (hd : 0 < d) (u : Fin d β E) (w : E) {a b : β}
(hb : 0 < b) (ha : 0 β€ a) (hab : a < b^2/2)
(hu : β i, βu iβ = 1) (hw : βwβ = 1)
(hoff : β i j, i β j β βͺu i,u jβ«_β β€ a)
(hconf : β i, b < βͺu i,wβ«_β) : (d:β) < 2/b^2 := by
classical
let U := β i, u i
have hdR : 0 < (d:β) := by exact_mod_cast hd
have hsum : (d:β)*b < βͺU,wβ«_β := by
dsimp only [U]
rw [sum_inner]
have H := Finset.sum_lt_sum_of_nonempty (s := (Finset.univ : Finset (Fin d)))
(Finset.univ_nonempty_iff.mpr β¨β¨0,hdβ©β©) (fun i _ => hconf i)
simpa only [Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul] using H
have hCS : βͺU,wβ«_β β€ βUβ := by simpa only [hw,mul_one] using real_inner_le_norm U w
have hdiag (i : Fin d) : (β j : Fin d, βͺu i,u jβ«_β) β€ 1+((d:β)-1)*a := by
have H := Finset.sum_le_sum (s := (Finset.univ : Finset (Fin d)))
(g := fun j => if i=j then (1:β) else a) (fun j _ => show βͺu i,u jβ«_β β€ (if i=j then 1 else a) from by
by_cases hij : i=j
Β· subst j; simp only [ite_true,real_inner_self_eq_norm_sq,hu,one_pow,le_refl]
Β· simp only [ite_eq_right hij]; exact hoff i j hij)
have he : (β j : Fin d, if i=j then (1:β) else a) = 1+((d:β)-1)*a := by
have hh (j : Fin d) : (if i=j then (1:β) else a) = a+(if i=j then 1-a else 0) := by split_ifs <;> ring
simp_rw [hh]
simp only [Finset.sum_add_distrib,Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul,
Finset.sum_ite_eq,Finset.mem_univ,ite_true]
ring
rwa [he] at H
have hnorm : βUβ^2 β€ (d:β)+(d:β)*((d:β)-1)*a := by
rw [β real_inner_self_eq_norm_sq]
dsimp only [U]
rw [sum_inner]
simp_rw [inner_sum]
have H := Finset.sum_le_sum (fun i (_ : i β (Finset.univ : Finset (Fin d))) => hdiag i)
simp only [Finset.sum_const,Finset.card_univ,Fintype.card_fin,nsmul_eq_mul] at H
nlinarith [H]
have hqlt : ((d:β)*b)^2 < βUβ^2 := sq_lt_sqβ (by positivity) (norm_nonneg _) |>.mpr (hsum.trans_le hCS)
have hdb : (d:β)*b^2 < 1+((d:β)-1)*a := by
have H : (d:β)*((d:β)*b^2) < (d:β)*(1+((d:β)-1)*a) := by nlinarith [hqlt,hnorm]
exact (mul_lt_mul_iff_rightβ hdR).mp H
have hdiff : b^2-a > b^2/2 := by linarith
have H : (d:β)*(b^2-a) < 1-a := by nlinarith [hdb]
have H' : (d:β)*(b^2/2) < 1 := by nlinarith [mul_lt_mul_of_pos_left hdiff hdR,H]
apply (lt_div_iffβ (sq_pos_of_pos hb)).mpr
nlinarith
def configVector {n : β} (x : Config n) : EuclideanSpace β (Fin n) :=
WithLp.toLp 2 (fun i => spin (x i)/Real.sqrt (n:β))
theorem configVector_inner {n : β} (hn : 0 < n) (x y : Config n) :
βͺconfigVector x,configVector yβ«_β = overlap x y := by
rw [configVector,configVector,EuclideanSpace.inner_toLp_toLp]
simp only [dotProduct,Pi.star_apply,star_trivial]
have hn0 : 0 β€ (n:β) := by positivity
have he (i : Fin n) : spin (y i)/Real.sqrt (n:β)*(spin (x i)/Real.sqrt (n:β)) =
(spin (x i)*spin (y i))/(n:β) := by
rw [div_mul_div_comm,Real.mul_self_sqrt hn0,mul_comm (spin (y i))]
simp_rw [he]
rw [β Finset.sum_div]
rfl
theorem configVector_norm {n : β} (hn : 0 < n) (x : Config n) : βconfigVector xβ = 1 := by
have H := configVector_inner hn x x
rw [real_inner_self_eq_norm_sq,overlap_self hn] at H
nlinarith [norm_nonneg (configVector x)]
theorem config_conflict_packing {n d : β} (hn : 0 < n) (hd : 0 < d)
(x : Fin d β Config n) (w : Config n) {a b : β}
(hb : 0 < b) (ha : 0 β€ a) (hab : a < b^2/2)
(hoff : β i j, i β j β |overlap (x i) (x j)| β€ a)
(hconf : β i, b < |overlap (x i) w|) : (d:β) < 2/b^2 := by
let u : Fin d β EuclideanSpace β (Fin n) := fun i =>
if 0 β€ overlap (x i) w then configVector (x i) else -configVector (x i)
apply unit_conflict_packing hd u (configVector w) hb ha hab
Β· intro i
dsimp only [u]
split_ifs <;> simp only [norm_neg,configVector_norm hn]
Β· exact configVector_norm hn w
Β· intro i j hij
have H := hoff i j hij
have HP := (le_abs_self (overlap (x i) (x j))).trans H
have HN := (neg_le_abs (overlap (x i) (x j))).trans H
dsimp only [u]
split_ifs <;> simp only [inner_neg_left,inner_neg_right,configVector_inner hn,neg_neg] <;> assumption
Β· intro i
dsimp only [u]
split_ifs with hs
Β· simpa only [configVector_inner hn,abs_of_nonneg hs] using hconf i
Β· simpa only [inner_neg_left,configVector_inner hn,abs_of_neg (lt_of_not_ge hs)] using hconf i
end SK.Analytic
end
end
end
end OAI
|