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

Loading…

Book of methods · tactics

Prove continuity, measurability and differentiability with fun_prop

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

Problem

Goals like Continuous fun x ↦ exp (f x) * x ^ 2, Measurable … or AnalyticAt ℂ … need long chains of .mul, .comp and .pow, and side conditions such as x ≠ 0 for division.

Method

Prefer fun_prop to continuity and measurability: it is faster and more predictable, with about 1,800 uses against about 110 for the other two in the GRH sources. Side conditions (a denominator ≠ 0, 0 < x for rpow) go to a discharger: fun_prop (disch := assumption), (disch := simp) or (disch := exact h). Pass definitions to unfold as fun_prop [myFun]. Make your own lemmas usable by tagging them @[fun_prop] (or attribute [fun_prop] Foo.continuous afterwards). The GRH guide notes that five Mathlib lemmas get the fun_prop tag where they are first needed, with attribute [local fun_prop] Continuous.rpow_const as an example. Tagged lemmas must have the shape Continuous f, or Continuous fun x ↦ g (f x) with the composition hypotheses.

Lean

example (f : ℝ → ℝ) (hf : Continuous f) : Continuous fun x ↦ Real.exp (f x) * x ^ 2 := by
  fun_prop

example {x₀ : ℝ} (h : x₀ ≠ 0) : ContinuousAt (fun x : ℝ ↦ Real.exp x / x) x₀ := by
  fun_prop (disch := assumption)

/-- A project function with its continuity lemma registered for `fun_prop`. -/
noncomputable def bump (x : ℝ) : ℝ := Real.exp (-x ^ 2)
@[fun_prop] lemma continuous_bump : Continuous bump := by unfold bump; fun_prop
example : Continuous fun x ↦ bump x + bump (2 * x) := by fun_prop

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": "fun-prop-with-discharger-and-tagged-lemmas" }] (CLI: --cite book:fun-prop-with-discharger-and-tagged-lemmas).