theoremabs_log_sum_exp_sub_le (EF : I→ℝ) (C : ℝ)
(h : ∀ i, |E i - F i| ≤C) :
|Real.log (∑ i, Real.exp (E i)) - Real.log (∑ i, Real.exp (F i))| ≤C:=by
proof · 7
lines
have hEF := log_sum_exp_le_of_le_add EFC (fun i =>byhave hi := (abs_le.mp (h i)).2
linarith)
have hFE := log_sum_exp_le_of_le_add FEC (fun i =>byhave hi := (abs_le.mp (h i)).1
linarith)
exact abs_le.mpr ⟨by linarith, by linarith⟩
theorempaired_field_eq (EF : I→ℝ) (x : ℝ) :
Real.artanh ((pairedFieldWeight E x - pairedFieldWeight F (-x)) /
(pairedFieldWeight E x + pairedFieldWeight F (-x))) =
x + (Real.log (∑ i, Real.exp (E i)) - Real.log (∑ i, Real.exp (F i))) / 2:=by
proof · 10
lines
rw [binary_mean_eq_tanh_half_log (pairedFieldWeight_pos E x)
(pairedFieldWeight_pos F (-x)), Real.artanh_tanh]
havehE : (∑ i, Real.exp (E i)) ≠0:=
ne_of_gt (Finset.sum_pos (fun i _ =>Real.exp_pos _) Finset.univ_nonempty)
havehF : (∑ i, Real.exp (F i)) ≠0:=
ne_of_gt (Finset.sum_pos (fun i _ =>Real.exp_pos _) Finset.univ_nonempty)
rw [pairedFieldWeight, pairedFieldWeight,
Real.log_mul (Real.exp_pos x).ne' hE, Real.log_mul (Real.exp_pos (-x)).ne' hF,
Real.log_exp, Real.log_exp]
ring
theorempaired_field_difference_bound (EF : I→ℝ) (x K : ℝ)
(h : ∀ i, |E i - F i| ≤2 * K) :
|Real.artanh ((pairedFieldWeight E x - pairedFieldWeight F (-x)) /
(pairedFieldWeight E x + pairedFieldWeight F (-x))) - x| ≤K:=by
theorempaired_posterior_mean (EF : I→ℝ) (x : ℝ) :
FinitePosterior.mean (pairedEnergy EF) (fun s => spinSign s.1)
(fun s => spinSign s.1) x =
(pairedFieldWeight E x - pairedFieldWeight F (-x)) /
(pairedFieldWeight E x + pairedFieldWeight F (-x)) :=by
proof · 5
lines
simp only [FinitePosterior.mean, FinitePosterior.partition, FinitePosterior.weight,
Fintype.sum_prod_type, sum_isingSpin, pairedEnergy, spinSign_neg, spinSign_pos,
mul_neg_one, mul_one, neg_one_mul, one_mul, Real.exp_add, Finset.sum_neg_distrib,
←Finset.sum_mul, pairedFieldWeight]
ring
theoremfinitePosterior_mean_equiv {SR : Type*} [FintypeS] [FintypeR]
(e : S ≃ R) (energy signal observable : R→ℝ) (x : ℝ) :
FinitePosterior.mean (energy ∘ e) (signal ∘ e) (observable ∘ e) x =
FinitePosterior.mean energy signal observable x :=by
proof · 4
lines
unfold FinitePosterior.mean FinitePosterior.partition FinitePosterior.weight
simp only [Function.comp_apply]
rw [e.sum_comp (fun s => observable s * Real.exp (energy s + x * signal s)),
e.sum_comp (fun s =>Real.exp (energy s + x * signal s))]
theorempaired_posterior_field_bound_equiv {SI : Type*} [FintypeS] [FintypeI]
[NonemptyI] (e : S ≃ IsingSpin×I) (energy : S→ℝ) (x K : ℝ)
(h : ∀ i, |energy (e.symm (.pos, i)) - energy (e.symm (.neg, i))| ≤2 * K) :
|Real.artanh (FinitePosterior.mean energy (fun s => spinSign (e s).1)
(fun s => spinSign (e s).1) x) - x| ≤K:=by
proof · 12
lines
have hm := finitePosterior_mean_equiv e.symm energy
(fun s => spinSign (e s).1) (fun s => spinSign (e s).1) x
simp only [Function.comp_def, e.apply_symm_apply] at hm
rw [← hm]
havehe : (fun s => energy (e.symm s)) =
pairedEnergy (fun i => energy (e.symm (.pos, i)))
(fun i => energy (e.symm (.neg, i))) :=by
funext s
rcases s with ⟨s, i⟩
cases s <;> rfl
rw [he]
exact paired_posterior_field_bound _ _ x K h