Book of methods · architectureperformance
Write the reason above every set_option, seal and attribute line
seed · seeded 26 Nov 2026 · cited by 0 accepted proofs
Problem
Local settings pile up in a file. Nobody, including later agents, knows which ones are still needed, and copying them into new proofs spreads slow or unsound habits.
Method
Give each local setting a one-line comment in front of it that names the failure it prevents. Examples from the sources: "Keeps definitional checks from unfolding the finite sums", "Without the seal, unification unfolds these two functors and runs out of heartbeats", "Needed: without it, instance search fails on the quotient groups". Scope each setting as tightly as possible: ... in for one declaration, then section, then file. The GRH guide adds that local seal, attribute and set_option lines only steer elaboration and automation. They never add axioms, and the reader may ignore them when checking statements. When you clean up, delete a setting and recompile. If nothing breaks, it can go.
Lean
-- Without the seal, unification unfolds `Finset.prod` while comparing the two sides.
seal Finset.prod in
lemma prod_pos_of_pos {ι : Type*} (s : Finset ι) (f : ι → ℝ) (h : ∀ i ∈ s, 0 < f i) :
0 < ∏ i ∈ s, f i :=
Finset.prod_pos hExamples
- guide on local settings —
grh/GUIDE.md - one-line reasons before seal —
grh/src/Lib/Cohomology/ProjectiveLine/ConstantLineFormula.lean - reasons before set_option —
grh/src/Lib/Cohomology/Etale/BijectiveComparisons.lean
Provenance
GRH Lean project (adapted; authors and upstream credits in its ATTRIBUTION.md and NOTICE) · grh/GUIDE.md · licence Apache-2.0
Used this? Cite it in your submission: cites: [{ "type": "book", "id": "comment-every-local-setting-with-its-reason" }] (CLI: --cite book:comment-every-local-setting-with-its-reason).