openAI-math-dataset / lean /OAI /Analysis /CoulombIonization /Localization /BarrierConditionalBarrier.lean
roseking's picture
Add lean source and binary files (part 16)
159357f verified
Raw History Blame Contribute Delete
3.49 kB
15
def reaction (k t : ℝ) : ℝ := 4*Real.pi*k*(max t 0)^(3/2:ℝ)
17
lemma reaction_nonneg {k : ℝ} (hk : 0 ≤ k) (t : ℝ) : 0 ≤ reaction k t := by
proof · 2 lines
  unfold reaction
  positivity
21
lemma reaction_monotone {k : ℝ} (hk : 0 ≤ k) : Monotone (reaction k) := by
proof · 4 lines
  intro s t hst
  exact mul_le_mul_of_nonneg_left
    (Real.rpow_le_rpow (le_max_right _ _) (max_le_max hst le_rfl) (by norm_num))
    (by positivity)
27
lemma reaction_continuous (k : ℝ) : Continuous (reaction k) := by
proof · 2 lines
  apply continuous_const.mul
  exact (continuous_id.max continuous_const).rpow_const (fun _ => Or.inr (by norm_num))
31
lemma reaction_convex {k : ℝ} (hk : 0 ≤ k) : ConvexOn ℝ univ (reaction k) := by
proof · 19 lines
  have hm : ConvexOn ℝ (univ : Set ℝ) (fun t : ℝ => max t 0) :=
    (convexOn_id convex_univ).sup (convexOn_const 0 convex_univ)
  have him : (fun t : ℝ => max t 0) '' univ = Ici 0 := by
    ext t
    constructor
    · rintro ⟨s,_,rfl⟩
      exact le_max_right (s : ℝ) 0
    · intro ht
      exact ⟨t,mem_univ _,max_eq_left ht⟩
  have hp : ConvexOn ℝ ((fun t : ℝ => max t 0) '' univ)
      (fun t : ℝ => t^(3/2:ℝ)) := by
    rw [him]
    exact convexOn_rpow (by norm_num)
  have hmono : MonotoneOn (fun t : ℝ => t^(3/2:ℝ))
      ((fun t : ℝ => max t 0) '' univ) := by
    rw [him]
    intro s hs t _ hst
    exact Real.rpow_le_rpow hs hst (by norm_num)
  exact (hp.comp hm hmono).smul (by positivity : 0 ≤ 4*Real.pi*k)
56
theorem reaction_condExp {k : ℝ} (hk : 0 ≤ k) {u : Ω → ℝ}
    (hu : Integrable u P) (hfu : Integrable (reaction k ∘ u) P) :
    ∀ᵐ sample ∂P, reaction k (P[u | m] sample) ≤ P[reaction k ∘ u | m] sample := by
proof · 1 line
  exact (reaction_convex hk).map_condExp_le_univ hm (reaction_continuous k).lowerSemicontinuous hu hfu
61
theorem offset_condExp {u : Ω → ℝ} (hu : Integrable u P) (V : ℝ) :
    (fun sample => V + P[fun sample => u sample - V | m] sample) =ᵐ[P] P[u | m] := by
proof · 6 lines
  have he := condExp_sub hu (integrable_const V) m
  rw [condExp_const hm] at he
  filter_upwards [he] with sample hω
  change (P[fun sample => u sample - V | m]) sample = (P[u | m]) sample - V at hω
  rw [hω]
  ring
70
theorem reaction_offset_condExp {k : ℝ} (hk : 0 ≤ k) {u : Ω → ℝ}
    (hu : Integrable u P) (hfu : Integrable (reaction k ∘ u) P) (V : ℝ) :
    ∀ᵐ sample ∂P, reaction k (V + P[fun sample => u sample-V | m] sample) ≤
      P[reaction k ∘ u | m] sample := by
proof · 2 lines
  filter_upwards [offset_condExp hm hu V,reaction_condExp hm hk hu hfu] with sample he hj
  rwa [he]
77
theorem offset_condExp_bounds {u : Ω → ℝ} (hu : Integrable u P)
    {a b : ℝ} (ha : ∀ᵐ sample ∂P, a ≤ u sample) (hb : ∀ᵐ sample ∂P, u sample ≤ b) (V : ℝ) :
    ∀ᵐ sample ∂P, a ≤ V + P[fun sample => u sample-V | m] sample ∧
      V + P[fun sample => u sample-V | m] sample ≤ b := by
proof · 6 lines
  have h1 := condExp_mono (integrable_const a) hu ha (m := m)
  have h2 := condExp_mono hu (integrable_const b) hb (m := m)
  rw [condExp_const hm] at h1 h2
  filter_upwards [offset_condExp hm hu V,h1,h2] with sample he h1 h2
  rw [he]
  exact ⟨h1,h2⟩