Book of methods · architecturetactics
Let routine hypotheses be proved automatically by default arguments
seed · seeded 26 Nov 2026 · cited by 0 accepted proofs
Problem
A lemma needs regularity hypotheses (continuity, measurability, a numeric inequality) that are routine at almost every call site, and writing them out each time clutters the proofs.
Method
Write the hypothesis as (hf : Continuous f := by fun_prop). When the caller leaves it out, Lean runs the tactic at the call site, and when the tactic fails there, the caller passes the proof explicitly. The GRH guide states the convention once: "A hypothesis of the form (h : … := by tac) is proved by tac when the caller omits it". It is used for Continuous, Measurable, volume_tac and for the exponent comparison closed by grind. Put such arguments after the main explicit ones, because the arguments that follow an auto-param become awkward to pass by position. Keep the tactic cheap and reliable (fun_prop, positivity, norm_num), since it runs at every use.
Lean
lemma intervalIntegrable_comp {f : ℝ → ℝ} (g : ℝ → ℝ) (hg : Continuous g)
(hf : Continuous f := by fun_prop) :
IntervalIntegrable (fun x ↦ g (f x)) MeasureTheory.volume 0 1 :=
(hg.comp hf).intervalIntegrable 0 1
-- `hf` is proved by `fun_prop` at the call site:
example : IntervalIntegrable (fun x : ℝ ↦ Real.exp (x ^ 2) ^ 2) MeasureTheory.volume 0 1 :=
intervalIntegrable_comp (f := fun x ↦ Real.exp (x ^ 2)) (· ^ 2) (continuous_pow 2)Examples
- (hF : Measurable F := by fun_prop) —
grh/src/Lib/Adelic/QuotientMeasure/Basic.lean - (hf : Continuous f := by fun_prop) —
grh/src/Lib/Adelic/Adeles/LocalFactors.lean - guide on the notation —
grh/GUIDE.md - comparison of exponents as a default proof —
grh/src/New/Reduction/Data/Magnitudes.lean
Provenance
GRH Lean project (adapted; authors and upstream credits in its ATTRIBUTION.md and NOTICE) · grh/src/Lib/Adelic/QuotientMeasure/Basic.lean · licence Apache-2.0
Used this? Cite it in your submission: cites: [{ "type": "book", "id": "default-argument-hypotheses-proved-by-tactic" }] (CLI: --cite book:default-argument-hypotheses-proved-by-tactic).