math / data /lean /OAI /Probability /Ising /Main.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
4.25 kB
import OAI.Probability.Ising.Contraction
import OAI.Probability.Ising.Influence
namespace OAI
open scoped BigOperators Classical
namespace BufferedIsing
noncomputable section
/-- The oriented pair matrix is precisely the original edge-list interaction;
parallel edges are summed, with no ghost and no change to the field. -/
def dssMatrix {n m : β„•} (G : FiniteGraph n m) (u v : Fin n) : ℝ :=
βˆ‘ e, if G.left e = u then if G.right e = v then G.coupling e else 0 else 0
lemma dssMatrix_nonneg {n m : β„•} (G : FiniteGraph n m) (u v : Fin n) :
0 ≀ dssMatrix G u v := by
apply Finset.sum_nonneg
intro e _
split_ifs <;> first | exact G.coupling_nonneg e | exact le_rfl
lemma dss_hamiltonian_eq {n m : β„•} (G : FiniteGraph n m) (h : Fin n β†’ ℝ)
(Οƒ : Spins n) : DSS.hamiltonian (dssMatrix G) h Οƒ = energy G h Οƒ := by
unfold DSS.hamiltonian energy dssMatrix
change ((βˆ‘ u, βˆ‘ v, (βˆ‘ e, if G.left e = u then if G.right e = v then
G.coupling e else 0 else 0) * spin (Οƒ u) * spin (Οƒ v)) + _) = _
congr 1
simp only [Finset.sum_mul]
calc
_ = βˆ‘ u, βˆ‘ e, βˆ‘ v, (if G.left e = u then if G.right e = v then
G.coupling e else 0 else 0) * spin (Οƒ u) * spin (Οƒ v) := by
apply Finset.sum_congr rfl
intro u _
exact Finset.sum_comm
_ = βˆ‘ e, βˆ‘ u, βˆ‘ v, (if G.left e = u then if G.right e = v then
G.coupling e else 0 else 0) * spin (Οƒ u) * spin (Οƒ v) := Finset.sum_comm
_ = _ := by simp [ite_mul, Finset.sum_ite_irrel]
lemma dss_mass_eq {n m : β„•} (G : FiniteGraph n m) (h : Fin n β†’ ℝ)
(Οƒ : Spins n) : DSS.mass (dssMatrix G) h Οƒ = weight G h Οƒ := by
rw [DSS.mass, weight, dss_hamiltonian_eq]
lemma dss_average_eq {n m : β„•} (G : FiniteGraph n m) (h : Fin n β†’ ℝ)
(f : Spins n β†’ ℝ) : DSS.average (dssMatrix G) h f = expectation G h f := by
simp only [DSS.average, DSS.part, dss_mass_eq, expectation]
congr!
/-- The arbitrary-field covariance bound for the finite edge-list Gibbs law, including equal sites. -/
theorem arbitraryFieldCovarianceBound : ArbitraryFieldCovarianceBound := by
intro n m G h u v
have H := DSS.covariance_le_zero_field (dssMatrix G) (dssMatrix_nonneg G) h u v
simp only [DSS.correlation, DSS.mean, dss_average_eq] at H
convert H using 1 <;> congr!
theorem effectiveCouplingBound : EffectiveCouplingBound :=
covarianceBound_iff_effectiveCouplingBound.mp arbitraryFieldCovarianceBound
lemma extremeLogOdds_le_zero {n m : β„•} (G : FiniteGraph n m)
(h : Fin n β†’ ℝ) (I J F : Finset (Fin n))
(hIJ : Disjoint I J) (hIF : Disjoint I F) (hJF : Disjoint J F)
(i j : KeptVertex F) (hi : i.val ∈ I) (hj : j.val ∈ J) (Ο„ : Spins n) :
extremeLogOdds G h I J F Ο„ ≀ 4 * Real.artanh (qZero G I J F i j) := by
rw [extremeLogOdds_eq_actualCoupling G h I J F hIJ hIF hJF i j hi hj Ο„,
artanh_qZero_eq_actualCoupling G I J F hIJ i j hi hj]
exact mul_le_mul_of_nonneg_left
(effectiveCouplingBound _ _ (actualComparisonGraph G I J F)
(actualComparisonField G h I J F Ο„) _ _
(actualTerminal_ne G I J F hIJ i j hi hj)) (by norm_num)
/-- Finite-graph comparison for arbitrary probability mixtures on both sides. Dirac mixtures recover the conditional laws. -/
theorem finite_graph_comparison {n m : β„•} (G : FiniteGraph n m)
(h : Fin n β†’ ℝ) (I J F : Finset (Fin n))
(hIJ : Disjoint I J) (hIF : Disjoint I F) (hJF : Disjoint J F)
(i j : KeptVertex F) (hi : i.val ∈ I) (hj : j.val ∈ J)
(a Ο„ : Spins n) (mix mix' : Spins n β†’ ℝ)
(hmix : βˆ€ b, 0 ≀ mix b) (hmix' : βˆ€ b, 0 ≀ mix' b)
(hmixsum : βˆ‘ b, mix b = 1) (hmix'sum : βˆ‘ b, mix' b = 1) :
Real.exp (-4 * Real.artanh (qZero G I J F i j)) ≀
mixtureProb G h I J F a Ο„ mix / mixtureProb G h I J F a Ο„ mix' ∧
mixtureProb G h I J F a Ο„ mix / mixtureProb G h I J F a Ο„ mix' ≀
Real.exp (4 * Real.artanh (qZero G I J F i j)) := by
have H := mixture_ratio_extreme G h I J F hIJ hIF hJF a Ο„ mix mix'
hmix hmix' hmixsum hmix'sum
have HB := extremeLogOdds_le_zero G h I J F hIJ hIF hJF i j hi hj Ο„
exact ⟨(Real.exp_le_exp.mpr (by linarith)).trans H.1,
H.2.trans (Real.exp_le_exp.mpr HB)⟩
end
end BufferedIsing
end OAI