Module docstring
{"# Semicontinuous maps
A function f from a topological space α to an ordered space β is lower semicontinuous at a
point x if, for any y < f x, for any x' close enough to x, one has f x' > y. In other
words, f can jump up, but it can not jump down.
Upper semicontinuous functions are defined similarly.
This file introduces these notions, and a basic API around them mimicking the API for continuous functions.
Main definitions and results
We introduce 4 definitions related to lower semicontinuity:
* LowerSemicontinuousWithinAt f s x
* LowerSemicontinuousAt f x
* LowerSemicontinuousOn f s
* LowerSemicontinuous f
We build a basic API using dot notation around these notions, and we prove that
* constant functions are lower semicontinuous;
* indicator s (fun _ ↦ y) is lower semicontinuous when s is open and 0 ≤ y,
  or when s is closed and y ≤ 0;
* continuous functions are lower semicontinuous;
* left composition with a continuous monotone functions maps lower semicontinuous functions to lower
  semicontinuous functions. If the function is anti-monotone, it instead maps lower semicontinuous
  functions to upper semicontinuous functions;
* right composition with continuous functions preserves lower and upper semicontinuity;
* a sum of two (or finitely many) lower semicontinuous functions is lower semicontinuous;
* a supremum of a family of lower semicontinuous functions is lower semicontinuous;
* An infinite sum of ℝ≥0∞-valued lower semicontinuous functions is lower semicontinuous.
Similar results are stated and proved for upper semicontinuity.
We also prove that a function is continuous if and only if it is both lower and upper semicontinuous.
We have some equivalent definitions of lower- and upper-semicontinuity (under certain
restrictions on the order on the codomain):
* lowerSemicontinuous_iff_isOpen_preimage in a linear order;
* lowerSemicontinuous_iff_isClosed_preimage in a linear order;
* lowerSemicontinuousAt_iff_le_liminf in a dense complete linear order;
* lowerSemicontinuous_iff_isClosed_epigraph in a dense complete linear order with the order
  topology.
Implementation details
All the nontrivial results for upper semicontinuous functions are deduced from the corresponding
ones for lower semicontinuous functions using OrderDual.
References
","### Main definitions ","### Lower semicontinuous functions ","#### Basic dot notation interface for lower semicontinuity ","#### Constants ","#### Indicators ","#### Relationship with continuity ","#### Equivalent definitions ","### Composition ","#### Addition ","#### Supremum ","#### Infinite sums ","### Upper semicontinuous functions ","#### Basic dot notation interface for upper semicontinuity ","#### Constants ","#### Indicators ","#### Relationship with continuity ","#### Equivalent definitions ","### Composition ","#### Addition ","#### Infimum "}