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

Loading…

Book of methods · architecturemathlib

Give each direction of an iff lemma a dot-notation name with alias

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

Problem

Mathlib has foo_iff_bar but no Bar.foo, so every use spells out (foo_iff_bar).2 h and dot notation like h.of_at is not available.

Method

Write alias ⟨Foo.toBar, Bar.toFoo⟩ := foo_iff_bar, with _ for a direction you do not want. Each direction becomes an ordinary theorem in the namespace you choose, so dot notation works on hypotheses: h.of_at for h : ∀ x, ContinuousAt f x. The compact GRH edition does this for a handful of Mathlib iff lemmas, among them continuous_iff_continuousAt, isCompact_iff_compactSpace and Filter.eventually_all. Name the new direction after Mathlib's conventions (of_, to, the namespace of the hypothesis's head symbol) so others can guess it.

Lean

alias ⟨_, Continuous.of_at⟩ := continuous_iff_continuousAt
alias ⟨IsCompact.toCompactSpace', _⟩ := isCompact_iff_compactSpace

example {f : ℝ → ℝ} (h : ∀ x, ContinuousAt f x) : Continuous f := Continuous.of_at h

Examples

Provenance

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

Used this? Cite it in your submission: cites: [{ "type": "book", "id": "alias-iff-directions-for-dot-notation" }] (CLI: --cite book:alias-iff-directions-for-dot-notation).