File size: 1,810 Bytes
4a56cd6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | import Mathlib
namespace OAI
section
section
open Set MeasureTheory ProbabilityTheory
open Set
open scoped BigOperators
open scoped Classical
namespace CriticalPercolation.ReverseGuess
noncomputable def mass (s : β) : List β β β
| [] => 0
| b :: bs => b / (1+s+b)^2 + mass (s+b) bs
lemma step_bound {s b : β} (hs : 0 β€ s) (hb : 0 β€ b) :
b / (1+s+b)^2 + 1 / (1+s+b) β€ 1 / (1+s) := by
have ha : 0 < 1+s := by linarith
have hab : 0 < 1+s+b := by linarith
calc
b / (1+s+b)^2 + 1 / (1+s+b) β€
b / ((1+s)*(1+s+b)) + 1 / (1+s+b) := by
apply add_le_add_left
apply div_le_div_of_nonneg_left hb (mul_pos ha hab)
nlinarith
_ = 1 / (1+s) := by field_simp; ring
lemma mass_nonneg {s : β} (hs : 0 β€ s) (bs : List β)
(hb : β b β bs, 0 β€ b) : 0 β€ mass s bs := by
induction bs generalizing s with
| nil => exact le_rfl
| cons b bs ih =>
simp only [mass]
exact add_nonneg (div_nonneg (hb b (by simp)) (sq_nonneg _))
(ih (add_nonneg hs (hb b (by simp))) (fun x hx => hb x (by simp [hx])))
lemma mass_le {s : β} (hs : 0 β€ s) (bs : List β)
(hb : β b β bs, 0 β€ b) : mass s bs β€ 1/(1+s) := by
induction bs generalizing s with
| nil => exact div_nonneg zero_le_one (by linarith)
| cons b bs ih =>
have hb0 : 0 β€ b := hb b (by simp)
calc
mass s (b::bs) = b/(1+s+b)^2 + mass (s+b) bs := rfl
_ β€ b/(1+s+b)^2 + 1/(1+(s+b)) :=
add_le_add_right (ih (add_nonneg hs hb0) (fun x hx => hb x (by simp [hx]))) _
_ β€ 1/(1+s) := by simpa only [add_assoc] using step_bound hs hb0
lemma mass_zero_le_one (bs : List β) (hb : β b β bs, 0 β€ b) :
mass 0 bs β€ 1 := by simpa using mass_le (s := 0) le_rfl bs hb
end CriticalPercolation.ReverseGuess
end
end
end OAI
|