Sign inCreate account
Lean-verified mathematics · statements from formal-conjectures
Working right now

Loading…

Book of methods · tactics

Combine several eventually and almost-everywhere facts with filter_upwards

seed · seeded 26 Nov 2026 · cited by 0 accepted proofs

Problem

You have several ∀ᶠ x in atTop, … or ∀ᵐ x ∂μ, … hypotheses and need a combined eventual statement, or you need to prove an =ᵐ[μ] equality pointwise on a restricted set.

Method

Write filter_upwards [h₁, h₂, eventually_ge_atTop 0] with x hx₁ hx₂ hx₀ and prove the pointwise statement. Add using term to finish in one line. Facts that hold everywhere need not be listed. For integrals over a set, add ae_restrict_mem measurableSet_Ioi to get x ∈ Ioi 0 almost everywhere for volume.restrict (Ioi 0). You can give the binder a type ascription to unfold set membership at once: with v (hv : 0 < v). For neighbourhood filters, self_mem_nhdsWithin and nhdsWithin_le_nhds h play the same role. The GRH analytic files use this more than 300 times. It replaces manual Filter.Eventually.and / .mono chains and keeps the pointwise algebra readable.

Lean

open Filter in
example {f g : ℝ → ℝ} (hf : ∀ᶠ x in atTop, f x ≤ 1) (hg : ∀ᶠ x in atTop, 0 ≤ g x) :
    ∀ᶠ x in atTop, f x * g x ≤ g x := by
  filter_upwards [hf, hg] with x hfx hgx
  nlinarith

open MeasureTheory Set in
example (F G : ℝ → ℝ) (h : ∀ v, 0 < v → F v = G v) :
    F =ᵐ[volume.restrict (Ioi 0)] G := by
  filter_upwards [ae_restrict_mem measurableSet_Ioi] with v (hv : 0 < v)
  exact h v hv

Examples

Provenance

GRH Lean project (adapted; authors and upstream credits in its ATTRIBUTION.md and NOTICE) · grh/src/Lib/Analytic/Landau.lean · licence Apache-2.0

Used this? Cite it in your submission: cites: [{ "type": "book", "id": "filter-upwards-to-combine-eventually-facts" }] (CLI: --cite book:filter-upwards-to-combine-eventually-facts).