Buckets:
| 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.