Download data/lean/OAI/Probability/BenjaminiSchramm/EntropyEvent.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 2.72 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/BenjaminiSchramm/EntropyEvent.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/BenjaminiSchramm/EntropyEvent.lean
-
curl -L -o EntropyEvent.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/BenjaminiSchramm/EntropyEvent.lean
2.72 kB
Lean 4 Β· 3
declarations statementsfull
| import OAI.Probability.CriticalPercolation.Entropy.Divergence | |
| namespace OAI | |
| namespace Percolation.BenjaminiSchramm | |
| open CriticalPercolation.FiniteEntropy | |
| theorem exp_neg_one_le_half : Real.exp (-1) β€ 1 / 2 := by | |
| have hh := mul_le_mul_of_nonneg_right (Real.add_one_le_exp (1 : β)) | |
| (Real.exp_pos (-1)).le | |
| have he : Real.exp (1 : β) * Real.exp (-1) = 1 := by rw [βReal.exp_add]; norm_num | |
| rw [he] at hh | |
| norm_num only [one_add_one_eq_two] at hh | |
| linarith | |
| theorem event_mass_le_two_add_divergence | |
| {X : Type*} [Fintype X] (P Q : X β β) (A : X β Bool) | |
| (hP : β x, 0 β€ P x) (hQ : β x, 0 β€ Q x) | |
| (hPsum : β x, P x = 1) (hQsum : β x, Q x = 1) | |
| (hs : β x, 0 < P x β 0 < Q x) : | |
| (β x, if A x then Q x else 0) β€ | |
| 2 * (β x, if A x then P x else 0) + 2 * divergence P Q := by | |
| let g : X β β := fun x => if A x then -1 else 0 | |
| let a : β := β x, if A x then P x else 0 | |
| let b : β := β x, if A x then Q x else 0 | |
| have hb : 0 β€ b := Finset.sum_nonneg (fun x _ => by split_ifs; exact hQ x; rfl) | |
| have htest : (β x, P x * g x) = -a := by | |
| dsimp only [a] | |
| rw [βFinset.sum_neg_distrib] | |
| apply Finset.sum_congr rfl | |
| intro x _ | |
| dsimp [g] | |
| split_ifs <;> ring | |
| have hZ : (β x, Q x * Real.exp (g x)) = 1 - (1 - Real.exp (-1)) * b := by | |
| dsimp only [b] | |
| calc | |
| _ = (β x, Q x) - (1 - Real.exp (-1)) * (β x, if A x then Q x else 0) := by | |
| rw [Finset.mul_sum,βFinset.sum_sub_distrib] | |
| apply Finset.sum_congr rfl | |
| intro x _ | |
| dsimp [g] | |
| split_ifs | |
| Β· ring | |
| Β· rw [Real.exp_zero] | |
| ring | |
| _ = _ := by rw [hQsum] | |
| have hZpos := normalizer_pos P Q hP hQ hPsum hs g | |
| have hlog := Real.log_le_sub_one_of_pos hZpos | |
| have hentropy := entropy_inequality P Q hP hQ hPsum hs g | |
| rw [htest,hZ] at hentropy | |
| rw [hZ] at hlog | |
| have hh := mul_le_mul_of_nonneg_right exp_neg_one_le_half hb | |
| change b β€ 2 * a + 2 * divergence P Q | |
| linarith | |
| theorem divergence_mul | |
| {X : Type*} [Fintype X] (P Q : X β β) | |
| (hP : β x, 0 < P x) (hQ : β x, 0 < Q x) (hPsum : β x, P x = 1) | |
| (a b : β) (ha : 0 < a) (hb : 0 < b) : | |
| divergence (fun x => a * P x) (fun x => b * Q x) = | |
| a * divergence P Q + a * Real.log (a / b) := by | |
| have ht (x : X) : (a * P x) * Real.log ((a * P x) / (b * Q x)) = | |
| a * (P x * Real.log (P x / Q x)) + (a * Real.log (a / b)) * P x := by | |
| rw [show (a * P x) / (b * Q x) = (a / b) * (P x / Q x) by ring, | |
| Real.log_mul (div_ne_zero ha.ne' hb.ne') (div_ne_zero (hP x).ne' (hQ x).ne')] | |
| ring | |
| simp only [divergence,ht,Finset.sum_add_distrib,βFinset.mul_sum,hPsum,mul_one] | |
| end Percolation.BenjaminiSchramm | |
| end OAI | |
Outline