In topology, Lebesgue's number lemma, named after Henri Lebesgue, is a useful tool in the study of compact metric spaces. It states:
If the metric space 
                    (        X        ,        d        )                 is compact and an open cover of 
                    X                 is given, then there exists a number 
                    δ        >        0                 such that every 
subset of 
                    X                 having diameter less than 
                    δ                 is contained in some member of the cover.
Such a number                     δ                 is called a Lebesgue number of this cover. The notion of a Lebesgue number itself is useful in other applications as well.
Let                                           U                                   be an open cover of                     X                . Since                     X                 is compact we can extract a finite subcover                     {                  A                      1                          ,        …        ,                  A                      n                          }        ⊆                              U                                  .
For each                     i        ∈        {        1        ,        …        ,        n        }                , let                               C                      i                          :=        X        ∖                  A                      i                                   and define a function                     f        :        X        →                  R                         by                     f        (        x        )        :=                              1            n                                    ∑                      i            =            1                                n                          d        (        x        ,                  C                      i                          )                .
Since                     f                 is continuous on a compact set, it attains a minimum                     δ                . The key observation is that                     δ        >        0                . If                     Y                 is a subset of                     X                 of diameter less than                     δ                , then there exist                               x                      0                          ∈        X                 such that                     Y        ⊆                  B                      δ                          (                  x                      0                          )                , where                               B                      δ                          (                  x                      0                          )                 denotes the ball of radius                     δ                 centered at                               x                      0                                   (namely, one can choose as                               x                      0                                   any point in                     Y                ). Since                     f        (                  x                      0                          )        ≥        δ                 there must exist at least one                     i                 such that                     d        (                  x                      0                          ,                  C                      i                          )        ≥        δ                . But this means that                               B                      δ                          (                  x                      0                          )        ⊆                  A                      i                                   and so, in particular,                     Y        ⊆                  A                      i                                  .