math / data /lean /OAI /Probability /CriticalPercolation /Entropy /FiniteEventEntropy.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
1.7 kB
import Mathlib
import OAI.Probability.CriticalPercolation.Modular.PushMass
namespace OAI
section
section
namespace CriticalPercolation.FiniteEntropy
open scoped Classical
variable {X Y : Type*} [Fintype X] [Fintype Y]
omit [Fintype Y] in
lemma supported_event_entropy (P R : X β†’ ℝ) (hP : βˆ€ x, 0 ≀ P x)
(hP1 : βˆ‘ x, P x = 1) (hR : βˆ€ x, 0 < R x) (A : Set X)
(hs : βˆ€ x, P x β‰  0 β†’ x ∈ A) :
0 < (βˆ‘ x, if x ∈ A then R x else 0) ∧
Real.log (1/(βˆ‘ x, if x ∈ A then R x else 0)) ≀ divergence P R := by
let R' : X β†’ ℝ := fun x => if x ∈ A then R x else 0
have hn : βˆ€ x, 0 ≀ R' x := by
intro x
unfold R'
split_ifs
Β· exact (hR x).le
Β· exact le_rfl
have hp : βˆ€ x, 0 < P x β†’ 0 < R' x := by
intro x hx
simp only [R',ite_eq_left (hs x hx.ne')]
exact hR x
have ho : 0 < βˆ‘ x, R' x := by
have hh := normalizer_pos P R' hP hn hP1 hp (fun _ => 0)
simpa only [Real.exp_zero,mul_one] using hh
refine ⟨ho,?_⟩
have hh := log_sum_inequality P R' hP hn hp
rw [hP1,one_mul] at hh
refine hh.trans_eq ?_
unfold divergence
apply Finset.sum_congr rfl
intro x _
by_cases hx : P x=0
Β· simp only [hx,zero_mul]
Β· simp only [R',ite_eq_left (hs x hx)]
omit [Fintype Y] in
lemma pushMass_supported (P : X β†’ ℝ) (f : X β†’ Y) (A : Set Y)
(hs : βˆ€ x, P x β‰  0 β†’ f x ∈ A) (y : Y) (hy : pushMass f P y β‰  0) : y ∈ A := by
by_contra hn
apply hy
unfold pushMass
apply Finset.sum_eq_zero
intro x _
by_cases hx : f x=y
Β· rw [ite_eq_left hx]
by_contra hp
exact hn (hx β–Έ hs x hp)
Β· exact ite_eq_right hx
end CriticalPercolation.FiniteEntropy
end
end
end OAI