cfahlgren1's picture
download
raw
25.6 kB
import Mathlib
import OAI.Probability.ParisiFinite.Field
import OAI.Probability.ParisiFinite.RotateIJApply
namespace OAI
/-! Count. -/
noncomputable section
open scoped BigOperators ComplexConjugate InnerProductSpace Topology ComplexOrder
open Filter
open scoped BigOperators
open scoped Matrix Matrix.Norms.L2Operator ComplexConjugate
open scoped InnerProductSpace ComplexConjugate
open Filter Topology
open Filter Set Topology
open scoped InnerProductSpace ComplexConjugate Topology
open scoped InnerProductSpace
open scoped BigOperators Topology InnerProductSpace
open scoped BigOperators InnerProductSpace
namespace BinaryOccupations
open scoped InnerProductSpace
def count (D : โ„•) (s : Finset (Fin D)) : Fin (D+1) :=
โŸจs.card,Nat.lt_succ_of_le (by simpa using Finset.card_le_univ s)โŸฉ
@[simp] theorem count_eq_iff (D : โ„•) (s : Finset (Fin D)) (m : Fin (D+1)) :
count D s=m โ†” s.card=m.val := Fin.ext_iff
theorem count_surjective (D : โ„•) : Function.Surjective (count D) := by
intro m
obtain โŸจs,_,hsโŸฉ := Finset.exists_subset_card_eq
(show m.valโ‰ค(Finset.univ : Finset (Fin D)).card by simpa using Nat.le_of_lt_succ m.isLt)
exact โŸจs,(count_eq_iff D s m).mpr hsโŸฉ
theorem fiber_card (D : โ„•) (m : Fin (D+1)) :
Fintype.card {s : Finset (Fin D) // count D s=m}=D.choose m.val := by
calc
_ = Fintype.card {s : Finset (Fin D) // s.card=m.val} :=
Fintype.card_congr (Equiv.subtypeEquivRight (fun s => count_eq_iff D s m))
_ = _ := by simp
def embedding (D : โ„•) :
EuclideanSpace โ„‚ (Fin (D+1)) โ†’โ‚—แตข[โ„‚] EuclideanSpace โ„‚ (Finset (Fin D)) :=
FiniteOccupations.lift (count D) (count_surjective D)
@[simp] theorem embedding_apply (D : โ„•) (u : EuclideanSpace โ„‚ (Fin (D+1)))
(s : Finset (Fin D)) :
embedding D u s=(Real.sqrt (D.choose s.card : โ„) : โ„‚)โปยน*u (count D s) := by
change FiniteOccupations.weight (count D) (count D s)*u (count D s)=_
rw [FiniteOccupations.weight,fiber_card]
rfl
theorem mem_range_iff_card (D : โ„•) (u : EuclideanSpace โ„‚ (Finset (Fin D))) :
uโˆˆSet.range (embedding D) โ†” โˆ€s t : Finset (Fin D), s.card=t.card โ†’ u s=u t := by
rw [embedding,FiniteOccupations.mem_range_iff]
simp only [count,Fin.mk.injEq]
end BinaryOccupations
namespace SKQAOA
def extendAngles {p : โ„•} (ฮณ : Fin p โ†’ โ„) : (k : โ„•) โ†’ Fin (p+k) โ†’ โ„
| 0 => ฮณ
| k+1 => Fin.snoc (extendAngles ฮณ k) 0
@[simp] theorem expectedEnergy_extendAngles (n p k : โ„•) (ฮณ ฮฒ : Fin p โ†’ โ„) :
expectedEnergy n (p+k) (extendAngles ฮณ k) (extendAngles ฮฒ k)=expectedEnergy n p ฮณ ฮฒ := by
induction k with
| zero => rfl
| succ k ih => simpa only [Nat.add_succ,extendAngles,expectedEnergy_pad] using ih
@[simp] theorem value_extendAngles (p k : โ„•) (ฮณ ฮฒ : Fin p โ†’ โ„) :
value (p+k) (extendAngles ฮณ k) (extendAngles ฮฒ k)=value p ฮณ ฮฒ := by
simp [value]
end SKQAOA
namespace SKQAOA
theorem explicit_ground_lower_bound : Real.exp (-1/2)/2 โ‰ค Pstar := by
have ht : Tendsto (fun n => expectedEnergy n 1 (fun _ => 1/2) (fun _ => Real.pi/8))
atTop (๐“ (Real.exp (-1/2)/2)) := by
convert tendsto_expectedEnergy_one (fun _ => 1/2) (fun _ => Real.pi/8) using 1
norm_num
rw [show 4*(Real.pi/8)=Real.pi/2 by ring,Real.sin_pi_div_two]
ring
exact le_of_tendsto_of_tendsto ht tendsto_expectedGround
(Filter.Eventually.of_forall fun n => expectedEnergy_le_expectedGround n 1 _ _)
theorem Pstar_pos : 0 < Pstar :=
lt_of_lt_of_le (div_pos (Real.exp_pos _) (by norm_num)) explicit_ground_lower_bound
theorem exists_positive_word_every_depth (p : โ„•) (hp : 1โ‰คp) :
โˆƒฮณ ฮฒ : Fin p โ†’ โ„,
Tendsto (fun n => expectedEnergy n p ฮณ ฮฒ) atTop (๐“ (Real.exp (-1/2)/2)) โˆง
value p ฮณ ฮฒ=Real.exp (-1/2)/2 := by
obtain โŸจk,rflโŸฉ := Nat.exists_eq_add_of_le hp
refine โŸจextendAngles (fun _ : Fin 1 => 1/2) k,
extendAngles (fun _ : Fin 1 => Real.pi/8) k,?_,?_โŸฉ
ยท simp only [expectedEnergy_extendAngles]
have ht := tendsto_expectedEnergy_one (fun _ => 1/2) (fun _ => Real.pi/8)
rw [โ†value_one (fun _ => 1/2) (fun _ => Real.pi/8),explicit_one_layer_value] at ht
exact ht
ยท simpa only [value_extendAngles] using explicit_one_layer_value
end SKQAOA
namespace SKQAOA
open MeasureTheory ProbabilityTheory Filter
@[simp] theorem hamiltonian_neg_disorder (n : โ„•) (J : Disorder n) (ฯƒ : Configuration n) :
hamiltonian n (-J) ฯƒ = -hamiltonian n J ฯƒ := by
simp [hamiltonian,Finset.sum_neg_distrib]
theorem neg_energyDensity_le_groundMaximum (n p : โ„•) (J : Disorder n)
(ฮณ ฮฒ : Fin p โ†’ โ„) :
-energyDensity n p J ฮณ ฮฒ โ‰ค groundMaximum n (-J)/(n : โ„) := by
rw [energyDensity_eq,โ†neg_div]
apply div_le_div_of_nonneg_right _ (Nat.cast_nonneg n)
calc
-(โˆ‘ฯƒ,Complex.normSq (qaoaState n p J ฮณ ฮฒ ฯƒ)*hamiltonian n J ฯƒ) =
โˆ‘ฯƒ,Complex.normSq (qaoaState n p J ฮณ ฮฒ ฯƒ)*hamiltonian n (-J) ฯƒ := by
simp [Finset.sum_neg_distrib]
_ โ‰ค โˆ‘ฯƒ,Complex.normSq (qaoaState n p J ฮณ ฮฒ ฯƒ)*groundMaximum n (-J) :=
Finset.sum_le_sum fun ฯƒ _ => mul_le_mul_of_nonneg_left
(hamiltonian_le_groundMaximum n (-J) ฯƒ) (Complex.normSq_nonneg _)
_ = groundMaximum n (-J) := by
rw [โ†Finset.sum_mul]
change mass (qaoaState n p J ฮณ ฮฒ)*groundMaximum n (-J)=_
rw [qaoaState_mass,one_mul]
theorem disorder_neg_preserving (n : โ„•) :
MeasurePreserving (fun J : Disorder n => -J) (disorderLaw n) (disorderLaw n) := by
refine measurePreserving_pi (fun _ : Edge n => gaussianReal 0 1)
(fun _ : Edge n => gaussianReal 0 1) (f := fun (_ : Edge n) (x : โ„) => -x) ?_
intro e
exact โŸจmeasurable_neg,by simpa using gaussianReal_map_neg (ฮผ := 0) (v := 1)โŸฉ
theorem abs_expectedEnergy_le_expectedGround (n p : โ„•) (ฮณ ฮฒ : Fin p โ†’ โ„) :
|expectedEnergy n p ฮณ ฮฒ| โ‰ค expectedGround n := by
apply abs_le.mpr
refine โŸจ?_,expectedEnergy_le_expectedGround n p ฮณ ฮฒโŸฉ
have hp := disorder_neg_preserving n
have hi := hp.integrable_comp_of_integrable ((groundMaximum_integrable n).div_const (n : โ„))
have h := integral_mono (energyDensity_integrable n p ฮณ ฮฒ).neg hi
(fun J => neg_energyDensity_le_groundMaximum n p J ฮณ ฮฒ)
have he : (โˆซJ : Disorder n,groundMaximum n (-J)/(n : โ„) โˆ‚disorderLaw n)=expectedGround n := by
calc
_ = โˆซJ : Disorder n,groundMaximum n J/(n : โ„) โˆ‚disorderLaw n :=
hp.integral_comp (MeasurableEquiv.neg (Disorder n)).measurableEmbedding
(fun J => groundMaximum n J/(n : โ„))
_ = _ := integral_div _ _
change (โˆซJ : Disorder n,-energyDensity n p J ฮณ ฮฒ โˆ‚disorderLaw n) โ‰ค
(โˆซJ : Disorder n,groundMaximum n (-J)/(n : โ„) โˆ‚disorderLaw n) at h
rw [integral_neg,he] at h
change -(โˆซJ : Disorder n,energyDensity n p J ฮณ ฮฒ โˆ‚disorderLaw n) โ‰ค _ at h
change -expectedGround n โ‰ค (โˆซJ : Disorder n,energyDensity n p J ฮณ ฮฒ โˆ‚disorderLaw n)
linarith
theorem eventually_uniform_expectedEnergy_bound {ฮต : โ„} (hฮต : 0<ฮต) :
โˆ€แถ  n in atTop, โˆ€p : โ„•, โˆ€ฮณ ฮฒ : Fin p โ†’ โ„,
|expectedEnergy n p ฮณ ฮฒ| < Pstar+ฮต := by
have he : โˆ€แถ  n in atTop, expectedGround n < Pstar+ฮต :=
tendsto_expectedGround.eventually (eventually_lt_nhds (lt_add_of_pos_right _ hฮต))
filter_upwards [he] with n hn p ฮณ ฮฒ
exact (abs_expectedEnergy_le_expectedGround n p ฮณ ฮฒ).trans_lt hn
end SKQAOA
open scoped BigOperators Matrix Topology ComplexConjugate
open MeasureTheory ProbabilityTheory Filter
namespace SKQAOA.SiteHistories
def Bits : โ„• โ†’ Type
| 0 => Unit
| p+1 => Bool ร— Bits p
instance bitsFintype : (p : โ„•) โ†’ Fintype (Bits p)
| 0 => inferInstanceAs (Fintype Unit)
| p+1 => @instFintypeProd Bool (Bits p) inferInstance (bitsFintype p)
instance bitsDecidableEq : (p : โ„•) โ†’ DecidableEq (Bits p)
| 0 => inferInstanceAs (DecidableEq Unit)
| p+1 => @instDecidableEqProd Bool (Bits p) inferInstance (bitsDecidableEq p)
def atVertex (n : โ„•) : (p : โ„•) โ†’ History n p โ†’ Fin n โ†’ Bits p
| 0, _, _ => ()
| p+1, h, i => (h.1 i,atVertex n p h.2 i)
def assemble (n : โ„•) : (p : โ„•) โ†’ (Fin n โ†’ Bits p) โ†’ History n p
| 0, _ => ()
| p+1, h => (fun i => (h i).1,assemble n p (fun i => (h i).2))
@[simp] theorem atVertex_assemble (n p : โ„•) (h : Fin n โ†’ Bits p) :
atVertex n p (assemble n p h)=h := by
induction p with
| zero => funext i; change (():Unit)=h i; exact Subsingleton.elim _ _
| succ p ih =>
funext i
change ((h i).1,atVertex n p (assemble n p (fun i => (h i).2)) i)=h i
rw [ih]
exact Prod.eta _
@[simp] theorem assemble_atVertex (n p : โ„•) (h : History n p) :
assemble n p (atVertex n p h)=h := by
induction p with
| zero => change (():Unit)=h; exact Subsingleton.elim _ _
| succ p ih =>
change (h.1,assemble n p (atVertex n p h.2))=h
rw [ih]
exact Prod.eta _
def historyEquiv (n p : โ„•) : History n p โ‰ƒ (Fin n โ†’ Bits p) where
toFun := atVertex n p
invFun := assemble n p
left_inv := assemble_atVertex n p
right_inv := atVertex_assemble n p
def step (t : โ„) (ฯƒ ฯ„ : Bool) : โ„‚ :=
if ฯƒ=ฯ„ then (Real.cos t:โ„‚) else -(Real.sin t:โ„‚)*Complex.I
def mix : (p : โ„•) โ†’ (Fin p โ†’ โ„) โ†’ Bool โ†’ Bits p โ†’ โ„‚
| 0, _, _, _ => ((Real.sqrt 2)โปยน:โ„)
| p+1, ฮฒ, ฯƒ, h => step (ฮฒ (Fin.last p)) ฯƒ h.1 * mix p (fun i => ฮฒ i.castSucc) h.1 h.2
lemma sqrt_nat_pow (x : โ„) (hx : 0 โ‰ค x) (n : โ„•) : Real.sqrt (x^n)=(Real.sqrt x)^n := by
apply (Real.sqrt_eq_iff_mul_self_eq (pow_nonneg hx n) (pow_nonneg (Real.sqrt_nonneg x) n)).mpr
rw [โ†mul_pow,Real.mul_self_sqrt hx]
theorem historyMix_factor (n p : โ„•) (ฮฒ : Fin p โ†’ โ„) (ฯƒ : Configuration n)
(h : History n p) :
historyMix n p ฮฒ ฯƒ h = โˆi, mix p ฮฒ (ฯƒ i) (atVertex n p h i) := by
induction p generalizing ฯƒ with
| zero => simp [historyMix,mix,sqrt_nat_pow 2 (by norm_num)]
| succ p ih =>
simp only [historyMix,mix,atVertex]
rw [mixer_evolution_apply,ih,โ†Finset.prod_mul_distrib]
rfl
abbrev Site (p : โ„•) := Bool ร— Bits p ร— Bits p
def weight (p : โ„•) (ฮฒ : Fin p โ†’ โ„) (s : Site p) : โ„‚ :=
star (mix p ฮฒ s.1 s.2.1)*mix p ฮฒ s.1 s.2.2
def trajectoriesEquiv (n p : โ„•) :
(Configuration n ร— History n p ร— History n p) โ‰ƒ (Fin n โ†’ Site p) where
toFun h i := (h.1 i,atVertex n p h.2.1 i,atVertex n p h.2.2 i)
invFun h := (fun i => (h i).1,assemble n p (fun i => (h i).2.1),
assemble n p (fun i => (h i).2.2))
left_inv h := by simp
right_inv h := by funext i; simp
@[simp] theorem trajectoriesEquiv_apply (n p : โ„•)
(h : Configuration n ร— History n p ร— History n p) (i : Fin n) :
trajectoriesEquiv n p h i=(h.1 i,atVertex n p h.2.1 i,atVertex n p h.2.2 i) := rfl
theorem pairedMix_factor (n p : โ„•) (ฮฒ : Fin p โ†’ โ„) (ฯƒ : Configuration n)
(a b : History n p) :
pairedMix n p ฮฒ ฯƒ a b = โˆi, weight p ฮฒ (ฯƒ i,atVertex n p a i,atVertex n p b i) := by
rw [pairedMix,historyMix_factor,historyMix_factor]
simp only [star_prod,โ†Finset.prod_mul_distrib,weight]
theorem sum_pairedMix (n p : โ„•) (ฮฒ : Fin p โ†’ โ„) :
(โˆ‘ฯƒ : Configuration n, โˆ‘a : History n p, โˆ‘b : History n p,
pairedMix n p ฮฒ ฯƒ a b)=1 := by
have h (ฯƒ : Configuration n) := qaoaState_pair_history n p (fun _ => 0) (fun _ => 0) ฮฒ ฯƒ
simp only [Complex.ofReal_zero,mul_zero,Finset.sum_const_zero,Complex.exp_zero,mul_one] at h
simp_rw [โ†h]
change star (qaoaState n p (fun _ => 0) (fun _ => 0) ฮฒ) โฌแตฅ
qaoaState n p (fun _ => 0) (fun _ => 0) ฮฒ = 1
rw [โ†mass_eq_dot,qaoaState_mass]
norm_num
theorem sum_weight (p : โ„•) (ฮฒ : Fin p โ†’ โ„) : โˆ‘s : Site p, weight p ฮฒ s=1 := by
have h := sum_pairedMix 1 p ฮฒ
simp_rw [pairedMix_factor] at h
have hs := (trajectoriesEquiv 1 p).sum_comp (fun f => โˆi,weight p ฮฒ (f i))
rw [Fintype.sum_prod_type] at hs
simp_rw [Fintype.sum_prod_type] at hs
simp only [trajectoriesEquiv_apply] at hs
rw [hs] at h
rw [โ†Fintype.prod_sum] at h
simpa using h
lemma norm_step_le_one (t : โ„) (ฯƒ ฯ„ : Bool) : โ€–step t ฯƒ ฯ„โ€– โ‰ค 1 := by
unfold step
split_ifs <;> simp only [norm_mul,norm_neg,Complex.norm_real,Real.norm_eq_abs,
Complex.norm_I,mul_one]
ยท exact Real.abs_cos_le_one t
ยท exact Real.abs_sin_le_one t
lemma norm_mix_le_one (p : โ„•) (ฮฒ : Fin p โ†’ โ„) (ฯƒ : Bool) (h : Bits p) :
โ€–mix p ฮฒ ฯƒ hโ€– โ‰ค 1 := by
induction p generalizing ฯƒ with
| zero =>
simp only [mix,Complex.norm_real,Real.norm_eq_abs,abs_inv,abs_of_nonneg (Real.sqrt_nonneg _)]
apply inv_le_one_of_one_leโ‚€
exact (Real.le_sqrt (by norm_num) (by norm_num)).mpr (by norm_num)
| succ p ih =>
rw [mix,norm_mul]
exact (mul_le_of_le_one_left (norm_nonneg _) (norm_step_le_one _ _ _)).trans (ih _ _ _)
lemma norm_weight_le_one (p : โ„•) (ฮฒ : Fin p โ†’ โ„) (s : Site p) :
โ€–weight p ฮฒ sโ€– โ‰ค 1 := by
rw [weight,norm_mul,norm_star]
exact (mul_le_of_le_one_left (norm_nonneg _) (norm_mix_le_one _ _ _ _)).trans
(norm_mix_le_one _ _ _ _)
def bitSpin (b : Bool) : โ„ := if b then -1 else 1
@[simp] theorem abs_bitSpin (b : Bool) : |bitSpin b|=1 := by cases b <;> norm_num [bitSpin]
def interaction : (p : โ„•) โ†’ (Fin p โ†’ โ„) โ†’ Bits p โ†’ Bits p โ†’ โ„
| 0, _, _, _ => 0
| p+1, ฮณ, a, b => ฮณ (Fin.last p)*bitSpin a.1*bitSpin b.1 +
interaction p (fun i => ฮณ i.castSucc) a.2 b.2
def angleMass : (p : โ„•) โ†’ (Fin p โ†’ โ„) โ†’ โ„
| 0, _ => 0
| p+1, ฮณ => |ฮณ (Fin.last p)|+angleMass p (fun i => ฮณ i.castSucc)
lemma angleMass_nonneg (p : โ„•) (ฮณ : Fin p โ†’ โ„) : 0 โ‰ค angleMass p ฮณ := by
induction p with
| zero => rfl
| succ p ih => exact add_nonneg (abs_nonneg _) (ih _)
lemma abs_interaction_le (p : โ„•) (ฮณ : Fin p โ†’ โ„) (a b : Bits p) :
|interaction p ฮณ a b| โ‰ค angleMass p ฮณ := by
induction p with
| zero => simp [interaction,angleMass]
| succ p ih =>
calc
_ โ‰ค |ฮณ (Fin.last p)*bitSpin a.1*bitSpin b.1| +
|interaction p (fun i => ฮณ i.castSucc) a.2 b.2| := abs_add_le _ _
_ โ‰ค |ฮณ (Fin.last p)|+angleMass p (fun i => ฮณ i.castSucc) := by
simp only [abs_mul,abs_bitSpin,mul_one]
exact add_le_add le_rfl (ih _ _ _)
_ = _ := rfl
def delta (p : โ„•) (ฮณ : Fin p โ†’ โ„) (s t : Site p) : โ„ :=
interaction p ฮณ s.2.1 t.2.1 - interaction p ฮณ s.2.2 t.2.2
lemma abs_delta_le (p : โ„•) (ฮณ : Fin p โ†’ โ„) (s t : Site p) :
|delta p ฮณ s t| โ‰ค 2*angleMass p ฮณ := by
calc
_ โ‰ค |interaction p ฮณ s.2.1 t.2.1|+|interaction p ฮณ s.2.2 t.2.2| := abs_sub _ _
_ โ‰ค angleMass p ฮณ+angleMass p ฮณ := add_le_add (abs_interaction_le _ _ _ _) (abs_interaction_le _ _ _ _)
_ = _ := by ring
theorem historyPhase_local (n p : โ„•) (ฮณ : Fin p โ†’ โ„) (a : History n p) (e : Edge n) :
historyPhase n p ฮณ a e = -Complex.I*((Real.sqrt (n:โ„))โปยน:โ„‚)*
(interaction p ฮณ (atVertex n p a e.1.1) (atVertex n p a e.1.2):โ„‚) := by
induction p with
| zero => simp [historyPhase,interaction]
| succ p ih =>
simp only [historyPhase,interaction,atVertex]
rw [ih]
simp only [skCoeff,spin,bitSpin,Complex.ofReal_add,Complex.ofReal_mul,Complex.ofReal_inv]
ring
theorem pairedPhase_local (n p : โ„•) (ฮณ : Fin p โ†’ โ„)
(h : Configuration n ร— History n p ร— History n p) (e : Edge n) :
pairedPhase n p ฮณ h.2.1 h.2.2 e = Complex.I*((Real.sqrt (n:โ„))โปยน:โ„‚)*
(delta p ฮณ (trajectoriesEquiv n p h e.1.1) (trajectoriesEquiv n p h e.1.2):โ„‚) := by
rw [pairedPhase,historyPhase_local,historyPhase_local]
simp only [delta,trajectoriesEquiv_apply,star_mul,star_neg,Complex.star_def,
Complex.conj_I,neg_neg,Complex.conj_ofReal,Complex.ofReal_sub,map_invโ‚€]
ring
def edgeKernel (n p : โ„•) (ฮณ : Fin p โ†’ โ„) (s t : Site p) : โ„ :=
Real.exp (-(delta p ฮณ s t)^2*((n:โ„)โปยน)/2)
lemma edgeKernel_pos (n p : โ„•) (ฮณ : Fin p โ†’ โ„) (s t : Site p) :
0 < edgeKernel n p ฮณ s t := Real.exp_pos _
lemma edgeKernel_le_one (n p : โ„•) (ฮณ : Fin p โ†’ โ„) (s t : Site p) :
edgeKernel n p ฮณ s t โ‰ค 1 := by
apply Real.exp_le_one_iff.mpr
exact div_nonpos_of_nonpos_of_nonneg (mul_nonpos_of_nonpos_of_nonneg
(neg_nonpos.mpr (sq_nonneg _)) (inv_nonneg.mpr (Nat.cast_nonneg n))) (by norm_num)
lemma abs_edgeKernel_sub_one_le (n p : โ„•) (ฮณ : Fin p โ†’ โ„) (s t : Site p) :
|edgeKernel n p ฮณ s t-1| โ‰ค (2*angleMass p ฮณ)^2*((n:โ„)โปยน)/2 := by
have hd := abs_delta_le p ฮณ s t
have hsq : (delta p ฮณ s t)^2 โ‰ค (2*angleMass p ฮณ)^2 := by
nlinarith [sq_abs (delta p ฮณ s t),abs_nonneg (delta p ฮณ s t),angleMass_nonneg p ฮณ]
have he := Real.add_one_le_exp (-(delta p ฮณ s t)^2*((n:โ„)โปยน)/2)
rw [abs_of_nonpos (sub_nonpos.mpr (edgeKernel_le_one n p ฮณ s t))]
have hmul := mul_le_mul_of_nonneg_right hsq (inv_nonneg.mpr (Nat.cast_nonneg n))
change _ โ‰ค _
dsimp [edgeKernel] at *
linarith
theorem exp_pairedPhase_sq (n p : โ„•) (ฮณ : Fin p โ†’ โ„)
(h : Configuration n ร— History n p ร— History n p) (e : Edge n) :
Complex.exp ((pairedPhase n p ฮณ h.2.1 h.2.2 e)^2/2)=
(edgeKernel n p ฮณ (trajectoriesEquiv n p h e.1.1) (trajectoriesEquiv n p h e.1.2):โ„‚) := by
rw [pairedPhase_local,edgeKernel,Complex.ofReal_exp]
congr 1
simp only [mul_pow,Complex.I_sq,โ†Complex.ofReal_pow,inv_pow,Real.sq_sqrt (Nat.cast_nonneg n)]
push_cast
ring
end SKQAOA.SiteHistories
open scoped BigOperators
namespace FiniteHistory
variable {V A : Type*} [Fintype V] [DecidableEq V] [Fintype A]
def expectation (q : A โ†’ โ„‚) (F : (V โ†’ A) โ†’ โ„‚) : โ„‚ :=
โˆ‘a : V โ†’ A, (โˆi, q (a i))*F a
theorem restrict_expectation (q : A โ†’ โ„‚) (hq : โˆ‘a,q a=1)
(S : Finset V) (F : (S โ†’ A) โ†’ โ„‚) :
expectation q (fun (a : V โ†’ A) => F (fun i : S => a i)) =
expectation q F := by
let e := Equiv.piEquivPiSubtypeProd (fun i : V => iโˆˆS) (fun _ => A)
let G : ((S โ†’ A) ร— ({i : V // iโˆ‰S} โ†’ A)) โ†’ โ„‚ :=
fun ab => ((โˆi:S,q (ab.1 i))*F ab.1)*(โˆi:{i:V // iโˆ‰S},q (ab.2 i))
have hs := e.sum_comp G
have hg (a : V โ†’ A) : G (e a) = (โˆi,q (a i))*F (fun i:S => a i) := by
simp only [G,e,Equiv.piEquivPiSubtypeProd_apply]
rw [mul_right_comm]
congr 1
convert Fintype.prod_subtype_mul_prod_subtype (fun i : V => iโˆˆS) (fun i => q (a i)) using 1
congr 2
ext x
simp
simp_rw [hg] at hs
dsimp only [expectation]
rw [hs,Fintype.sum_prod_type]
dsimp only [G]
simp_rw [โ†Finset.mul_sum,โ†Fintype.prod_sum (fun _ : {i:V // iโˆ‰S} => q),hq]
simp
lemma norm_expectation_le (q : A โ†’ โ„‚) (F : (V โ†’ A) โ†’ โ„‚) {C : โ„}
(hC : 0 โ‰ค C) (hF : โˆ€a, โ€–F aโ€– โ‰ค C) :
โ€–expectation q Fโ€– โ‰ค (โˆ‘a, โ€–q aโ€–)^(Fintype.card V)*C := by
calc
_ โ‰ค โˆ‘a:Vโ†’A, โ€–(โˆi,q (a i))*F aโ€– := norm_sum_le _ _
_ โ‰ค โˆ‘a:Vโ†’A, (โˆi,โ€–q (a i)โ€–)*C := by
apply Finset.sum_le_sum
intro a ha
rw [norm_mul]
exact (mul_le_mul_of_nonneg_left (hF a) (norm_nonneg _)).trans
(mul_le_mul_of_nonneg_right (Finset.norm_prod_le _ _) hC)
_ = (โˆ‘a, โ€–q aโ€–)^(Fintype.card V)*C := by
rw [โ†Finset.sum_mul,โ†Fintype.prod_sum (fun _ : V => fun a:A => โ€–q aโ€–)]
simp
variable [Nonempty A]
def extend (S : Finset V) (a : S โ†’ A) : V โ†’ A :=
fun i => if h : iโˆˆS then a โŸจi,hโŸฉ else Classical.choice (inferInstance : Nonempty A)
omit [Fintype V] [Fintype A] in
@[simp] lemma extend_apply (S : Finset V) (a : S โ†’ A) (i : S) : extend S a i=a i := by
simp [extend,i.property]
theorem norm_expectation_le_of_local (q : A โ†’ โ„‚) (hq : โˆ‘a,q a=1)
(S : Finset V) (F : (V โ†’ A) โ†’ โ„‚)
(hlocal : โˆ€a b, (โˆ€iโˆˆS, a i=b i) โ†’ F a=F b)
{C : โ„} (hC : 0 โ‰ค C) (hF : โˆ€a, โ€–F aโ€– โ‰ค C) :
โ€–expectation q Fโ€– โ‰ค (โˆ‘a, โ€–q aโ€–)^S.card*C := by
have he : F=(fun a => F (extend S (fun i:S => a i))) := by
funext a
apply hlocal
intro i hi
simp [extend,hi]
rw [he,restrict_expectation q hq S (fun a => F (extend S a))]
have hh := norm_expectation_le q (fun a:Sโ†’A => F (extend S a)) hC (fun a => hF _)
simpa using hh
end FiniteHistory
open scoped BigOperators Topology
open Filter
namespace SKQAOA.SiteHistories
lemma tendsto_scaled_exp (c : โ„) :
Tendsto (fun n : โ„• => (n:โ„)*(Real.exp (c/(n:โ„))-1)) atTop (๐“ c) := by
have hd : HasDerivAt (fun t : โ„ => Real.exp (c*t)) c 0 := by
convert ((hasDerivAt_id (0:โ„)).const_mul c).exp using 1 <;> simp
have hi : Tendsto (fun n : โ„• => (n:โ„)โปยน) atTop (๐“[โ‰ ] (0:โ„)) := by
refine tendsto_nhdsWithin_iff.mpr โŸจtendsto_inv_atTop_nhds_zero_nat,?_โŸฉ
filter_upwards [eventually_ge_atTop 1] with n hn
simpa only [Set.mem_compl_iff,Set.mem_singleton_iff,inv_eq_zero] using
(show (n:โ„)โ‰ 0 by exact_mod_cast (by omega : nโ‰ 0))
simpa only [Function.comp_def,zero_add,mul_zero,Real.exp_zero,smul_eq_mul,inv_inv,
div_eq_mul_inv] using hd.tendsto_slope_zero.comp hi
def kernelScaled (n p : โ„•) (ฮณ : Fin p โ†’ โ„) (u v : Site p) : โ„ :=
(n:โ„)*(edgeKernel n p ฮณ u v-1)
lemma tendsto_kernel (p : โ„•) (ฮณ : Fin p โ†’ โ„) (u v : Site p) :
Tendsto (fun n : โ„• => edgeKernel n p ฮณ u v) atTop (๐“ 1) := by
have ht : Tendsto (fun n : โ„• => -(delta p ฮณ u v)^2/(2*(n:โ„))) atTop (๐“ 0) := by
have := (tendsto_const_nhds (x := -(delta p ฮณ u v)^2/2)).mul
(tendsto_inv_atTop_nhds_zero_nat (๐•œ := โ„))
simpa only [mul_zero,zero_mul,div_eq_mul_inv,mul_inv_rev,mul_assoc,mul_left_comm,mul_comm] using this
convert Real.continuous_exp.continuousAt.tendsto.comp ht using 1
ยท funext n
simp only [edgeKernel,Function.comp_def]
congr 1
ring
ยท simp
lemma tendsto_kernelScaled (p : โ„•) (ฮณ : Fin p โ†’ โ„) (u v : Site p) :
Tendsto (fun n : โ„• => kernelScaled n p ฮณ u v) atTop (๐“ (-(delta p ฮณ u v)^2/2)) := by
have ht := tendsto_scaled_exp (-(delta p ฮณ u v)^2/2)
convert ht using 1
funext n
unfold kernelScaled edgeKernel
congr 3
ring
def graphCoefficient (N m p : โ„•) (ฮณ ฮฒ : Fin p โ†’ โ„) (r : Edge m)
(H : Finset (Edge m)) : โ„‚ :=
FiniteHistory.expectation (weight p ฮฒ) (fun a : Fin m โ†’ Site p =>
(bitSpin (a r.1.1).1:โ„‚)*(bitSpin (a r.1.2).1:โ„‚)*Complex.I*
(delta p ฮณ (a r.1.1) (a r.1.2):โ„‚)*
(edgeKernel N p ฮณ (a r.1.1) (a r.1.2):โ„‚)*
โˆeโˆˆH,if e=r then 0 else (kernelScaled N p ฮณ (a e.1.1) (a e.1.2):โ„‚))
def graphCoefficientLimit (m p : โ„•) (ฮณ ฮฒ : Fin p โ†’ โ„) (r : Edge m)
(H : Finset (Edge m)) : โ„‚ :=
FiniteHistory.expectation (weight p ฮฒ) (fun a : Fin m โ†’ Site p =>
(bitSpin (a r.1.1).1:โ„‚)*(bitSpin (a r.1.2).1:โ„‚)*Complex.I*
(delta p ฮณ (a r.1.1) (a r.1.2):โ„‚)*
โˆeโˆˆH,if e=r then 0 else (-(delta p ฮณ (a e.1.1) (a e.1.2):โ„‚)^2/2))
theorem tendsto_graphCoefficient (m p : โ„•) (ฮณ ฮฒ : Fin p โ†’ โ„) (r : Edge m)
(H : Finset (Edge m)) :
Tendsto (fun N => graphCoefficient N m p ฮณ ฮฒ r H) atTop
(๐“ (graphCoefficientLimit m p ฮณ ฮฒ r H)) := by
unfold graphCoefficient graphCoefficientLimit FiniteHistory.expectation
apply tendsto_finsetSum
intro a ha
apply Tendsto.const_mul
have hk := Complex.continuous_ofReal.continuousAt.tendsto.comp
(tendsto_kernel p ฮณ (a r.1.1) (a r.1.2))
have hp : Tendsto (fun N => โˆeโˆˆH,if e=r then (0:โ„‚) else
(kernelScaled N p ฮณ (a e.1.1) (a e.1.2):โ„‚)) atTop
(๐“ (โˆeโˆˆH,if e=r then 0 else (-(delta p ฮณ (a e.1.1) (a e.1.2):โ„‚)^2/2))) := by
apply tendsto_finsetProd
intro e he
by_cases her : e=r
ยท simp only [her,ite_true]
exact tendsto_const_nhds
ยท simp only [her,ite_false]
convert Complex.continuous_ofReal.continuousAt.tendsto.comp
(tendsto_kernelScaled p ฮณ (a e.1.1) (a e.1.2)) using 1 <;> push_cast <;> rfl
simpa only [Function.comp_def,Complex.ofReal_one,mul_one] using (hk.const_mul
((bitSpin (a r.1.1).1:โ„‚)*(bitSpin (a r.1.2).1:โ„‚)*Complex.I*
(delta p ฮณ (a r.1.1) (a r.1.2):โ„‚))).mul hp
end SKQAOA.SiteHistories
open scoped BigOperators
namespace FiniteHistory
variable {V W A : Type*} [Fintype V] [Fintype W] [Fintype A] [DecidableEq V] [DecidableEq W]
theorem expectation_equiv (q : A โ†’ โ„‚) (e : V โ‰ƒ W) (F : (W โ†’ A) โ†’ โ„‚) :
expectation q (fun a : V โ†’ A => F (a โˆ˜ e.symm))=expectation q F := by
let ฯˆ : (V โ†’ A) โ‰ƒ (W โ†’ A) := Equiv.arrowCongr e (Equiv.refl A)
have he (a : V โ†’ A) : (โˆi:V,q (a i))*(F (a โˆ˜ e.symm))=
(โˆj:W,q (ฯˆ a j))*F (ฯˆ a) := by
have hp : (โˆj:W,q (ฯˆ a j))=(โˆi:V,q (a i)) := by
simpa [ฯˆ] using e.symm.prod_comp (fun i : V => q (a i))
rw [hp]
rfl
dsimp only [expectation]
simp_rw [he]
exact ฯˆ.sum_comp (fun a : W โ†’ A => (โˆj:W,q (a j))*F a)
theorem expectation_embedding (q : A โ†’ โ„‚) (hq : โˆ‘a,q a=1)
(f : W โ†ช V) (F : (W โ†’ A) โ†’ โ„‚) :
expectation q (fun a : V โ†’ A => F (a โˆ˜ f))=expectation q F := by
classical
let S : Finset V := Finset.univ.image f
let e : W โ‰ƒ S := Equiv.ofBijective (fun w => โŸจf w,Finset.mem_image.mpr โŸจw,Finset.mem_univ _,rflโŸฉโŸฉ)
(by
constructor
ยท intro u v h
exact f.injective (congrArg Subtype.val h)
ยท intro v
obtain โŸจw,hw,heโŸฉ := Finset.mem_image.mp v.property
exact โŸจw,Subtype.ext heโŸฉ)
have he (a : V โ†’ A) : F (a โˆ˜ f)=F ((fun i : S => a i) โˆ˜ e) := rfl
simp_rw [he]
rw [restrict_expectation q hq S (fun a => F (a โˆ˜ e))]
exact expectation_equiv q e.symm F
end FiniteHistory
end
end OAI

Xet Storage Details

Size:
25.6 kB
ยท
Xet hash:
956ac37ba61f09d7d74c8297979e8c19ee466abb98446132f62473dfbc0594b7

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.