Reading the Lebesgue-number lemma

Read one theorem closely enough to say when it applies, which choices must work uniformly, and exactly what its conclusion covers.

This page has no figures. You can read it in two ways: follow its steps with Definograph open in Visual Studio Code, or skip the steps and read the theorem, the questions and their answers. What the page says about each view was recorded from Definograph in Visual Studio Code on 2 October 2026, with Lean 4.28.0.

New to Lean? Read the short notation guide, then read the theorem below. You should know what compact sets, open covers and metric balls are.

Already read Lean? Go to the theorem’s statement, or to the source and editor selection if you have Definograph open. The questions connect the statement’s scope with its mathematical meaning.

A little Lean notation

Notation used in this example

s : Set α says s is a set of elements of type α. A family c : ι → Set α assigns a set c i to each index i. Function application is written with a space.

  • ∃ r > 0, P r means there is an r with both 0 < r and P r.
  • ∀ z ∈ s, P z means every z with z ∈ s satisfies P z.
  • A ⊆ B means every element of A belongs to B. ⋃ i, c i is the union of all sets in the family.
  • Braces, as in {s : Set α}, introduce implicit parameters. Square brackets, as in [PseudoMetricSpace α], request a mathematical structure that Lean supplies through its typeclass mechanism.

A pseudometric has the usual metric properties but may give distance zero to distinct points. No coordinates or dimension are assumed here.

For a broader introduction, use Mathematics in Lean; its Logic chapter explains quantifiers and implications. Theorem Proving in Lean covers Lean’s language in more depth. This page uses only the notation its statement needs.

Start with the library theorem

This section is for reading with Definograph open; without it, go on to section 1.

Use a trusted project with Lean 4.28.0 and Mathlib revision 8f9d9cff6bd728b17a24e163c9402775d9e6a365, with the import built. Unlike the standard-library files in Lessons 5–7, this example needs Mathlib. See Setup for the reader and extension.

Download LebesgueNumber.lean. This is its complete source:

import Mathlib.Topology.MetricSpace.Pseudo.Lemmas

#check lebesgue_number_lemma_of_metric
  1. Open the file in the project and let Lean check it.
  2. Select only lebesgue_number_lemma_of_metric after #check.
  3. Run Definograph: Visualize Selection from the command palette.

The selected theorem constant is a proof term. Definograph reads its type: the proposition the theorem proves. #check asks Lean for the constant’s type; it is not the theorem’s proof, and it does not construct a radius or a cover index.

1. Separate the hypotheses from the conclusion

This is the theorem’s statement in Mathlib, with line breaks added:

theorem lebesgue_number_lemma_of_metric
    {s : Set α} {ι : Sort*} {c : ι → Set α}
    (hs : IsCompact s)
    (hc₁ : ∀ i, IsOpen (c i))
    (hc₂ : s ⊆ ⋃ i, c i) :
    ∃ δ > 0, ∀ x ∈ s, ∃ i, ball x δ ⊆ c i

Its background is a pseudometric space α, a set s, an index sort ι and a family of sets c : ι → Set α: the objects and structure in which the theorem is stated. Mathlib’s file declares α and its pseudometric before the theorem, and writes ball for Metric.ball.

The theorem has three named hypotheses:

hs : IsCompact s
The set s is compact.
hc₁ : ∀ i, IsOpen (c i)
Every member of the family is open.
hc₂ : s ⊆ ⋃ i, c i
The family covers s.

Under these hypotheses, the conclusion is:

∃ δ > 0, ∀ x ∈ s, ∃ i, Metric.ball x δ ⊆ c i

Question. Is knowing that one point lies in one open member enough to apply this theorem? Find the missing requirements in the whole statement.

Answer: what must be known

No. The theorem requires s to be compact, every family member to be open and all of s to be covered, in the stated pseudometric space. Covering one point alone does not provide these hypotheses.

The space, set and family are background data. Do not count them as propositional hypotheses alongside hs, hc₁ and hc₂.

2. Read the choices in order

Question. May the radius δ change after choosing x? Must the same index i work for every x?

Select Explore a sample, then Choices. The view lists the candidate radius δ at step 11, before the arbitrary center x at step 12; δ is among the earlier choices available to x. The view shows 12 of the statement’s 14 choices, so the final existential index i is beyond its display limit. Read that choice in the whole statement or the Visual sequence, and keep the conditions in view: a list of choices alone does not show every condition.

Answer: one radius, a possibly varying index

One positive δ is chosen before x and must work for every x ∈ s. Its choice may use the fixed space, set and cover. It cannot be chosen again for each later point.

The index i comes after x and its membership condition. It may vary with x; the theorem neither requires it to vary nor gives a procedure for choosing it.

δ > 0 is part of what the conclusion guarantees about its radius. It is joined to the rest of the conclusion under ∃ δ; it is not an extra hypothesis required before applying the theorem.

3. Read the whole-ball requirement

Select Visual sequence, then use Choose reading step to select 20. Read the inclusion condition. Read Metric.ball x δ ⊆ c i with its enclosing scope. In Definograph, the figure at this step states a containment requirement; it supplies no numerical witness.

Open 4 assumptions in scope: the theorem’s three hypotheses and the local condition x ∈ s. Open Alongside this clause to keep δ > 0 at its place in the conclusion.

Question. Does the conclusion cover only the center x, only the part of the ball inside s, or the whole ball?

Answer: which points are covered

Every point of the whole ball belongs to c i, for the index chosen for this center. Only the center x is restricted to s. The theorem does not say that the ball is contained in s.

Replacing the conclusion by x ∈ c i would lose the neighborhood guarantee. Replacing the ball by its intersection with s would also weaken the statement.

Inspect the ball’s definition

Keep the inclusion clause selected and inspect Metric.ball x δ:

  1. Select Inspect a definition in this statement.
  2. Enter Metric.ball in Find an application. Applications come from the whole selected statement, so check each occurrence’s arguments and scope. Choose the one with center x and radius δ using Inspect this occurrence →.
  3. In Keep the clause in view, check that Original clause still shows Metric.ball x δ ⊆ c i. Wait for the inspection to finish, then read its result and check outcomes.

The recorded result of inspecting Metric.ball is:

{y | dist y x < δ}

Notation may hide implicit arguments. Use Exact result and surrounding scope for the exact arguments and scope. The result keeps the surrounding scope of the chosen application. The variable y is local to the set description; it does not replace the center x.

In the recorded session, Result context, Result component and Definition-head conversion are all marked accepted. These checks concern this exposure of the definition in its scope; they do not prove the containment clause.

The bound is strict. Together, the definition and the containment clause say that every y with dist y x < δ belongs to the same c i. For the source, see the pinned library definition of Metric.ball.

4. Put the conclusion back together

Select Return to reading. The definition workspace closes and focus returns to Choose reading step, still on 20. Read the inclusion condition. Check the center, radius and cover member against the original statement, with the four assumptions and δ > 0 still in view.

Question. State the conclusion in one sentence. Say what is fixed and what may vary.

One complete reading

For the fixed compact set and open cover, there is one positive radius such that, for every center in the set, the entire ball of that radius lies in some cover member, whose index may depend on the center.

This describes the theorem’s statement. The view does not explain the proof or compute the radius and indices. If s is empty, there are no center-specific obligations; do not infer a selected point or a nonempty index family from the diagram.

Check your reading. Compare these forms of the conclusion for arbitrary sets and families, before using the theorem’s three hypotheses. Classify each change as equivalent to the original conclusion, weaker or stronger:

  1. Choose a new positive radius after each center x ∈ s.
  2. Choose one cover member before all centers and require it to contain every ball.
  3. Remove the restriction x ∈ s.
Answer: the changed statements

The first is weaker: it loses the uniform radius. The second is stronger: it demands one member for every center, which the theorem does not guarantee. The third is also stronger: it extends the requirement to arbitrary centers in the space. In general these forms are not equivalent, and a weaker statement should not simply be labelled false.

Try the same reading on a different statement

In pseudometric spaces, Metric.uniformContinuousOn_iff states the equivalence below for a function f : α → β and a set s : Set α. This is a separate reading exercise.

UniformContinuousOn f s ↔
  ∀ ε > 0, ∃ δ > 0, ∀ x ∈ s, ∀ y ∈ s,
    dist x y < δ → dist (f x) (f y) < ε

Does the theorem assert that this particular f is uniformly continuous? What may δ depend on? Are both points restricted to s?

Answer: follow the equivalence and the quantifiers

The theorem equates two conditions; it establishes neither for an arbitrary f. For each positive ε, the right-hand side requires one positive δ that works for all later x,y ∈ s. That δ may depend on ε and the fixed data, but not on those later points.

Both points must lie in s, and dist x y < δ is a premise of the distance conclusion. Reading ↔ as only one implication would lose the converse.

The epsilon–delta expression comes from a proved equivalence theorem. It is not the definition body of UniformContinuousOn.

For more practice, use Lesson 1: the order of choices. Lesson 4 explains definition inspection, and Lesson 5 explains source checks in the editor.