# Fiber (mathematics)

In mathematics, the fiber (US English) or fibre (British English) of an element $y$ under a function $f$ is the preimage of the singleton set $\{y\}$,$^{:p.69}$ that is
    $f^{-1}(y)=\{x\mathrel {:} f(x)=y\}.$

## Properties and applications
### In elementary set theory

If $X$ and $Y$ are the domain and image of $f$, respectively, then the fibers of $f$ are the sets in
    $\left\{f^{-1}(y)\mathrel {:} y\in Y\right\}\quad =\quad \left\{\left\{x\in X\mathrel {:} f(x)=y\right\}\mathrel {:} y\in Y\right\}$
which is a partition of the domain set $X$. Note that $y$ must be restricted to the image set $Y$ of $f$, since otherwise $f^{-1}(y)$ would be the empty set which is not allowed in a partition. The fiber containing an element $x\in X$ is the set $f^{-1}(f(x)).$
For example, let $f$ be the function from $\mathbb {R} ^{2}$ to $\mathbb {R}$ that sends point $(a,b)$ to $a+b$. The fiber of 5 under $f$ are all the points on the straight line with equation $a+b=5$. The fibers of $f$ are that line and all the straight lines parallel to it, which form a partition of the plane $\mathbb {R} ^{2}$.
More generally, if $f$ is a linear map from some linear vector space $X$ to some other linear space $Y$, the fibers of $f$ are affine subspaces of $X$, which are all the translated copies of the null space of $f$.
If $f$ is a real-valued function of several real variables, the fibers of the function are the level sets of $f$. If $f$ is also a continuous function and $y\in \mathbb {R}$ is in the image of $f,$ the level set $f^{-1}(y)$ will typically be a curve in 2D, a surface in 3D, and, more generally, a hypersurface in the domain of $f.$
The fibers of $f$ are the equivalence classes of the equivalence relation $\equiv _{f}$ defined on the domain $X$ such that $x'\equiv _{f}x''$ if and only if $f(x')=f(x'')$.

### In topology

In point set topology, one generally considers functions from topological spaces to topological spaces.
If $f$ is a continuous function and if $Y$ (or more generally, the image set $f(X)$) is a T$_1$ space then every fiber is a closed subset of $X.$ In particular, if $f$ is a local homeomorphism from $X$ to $Y$, each fiber of $f$ is a discrete subspace of $X$.
A function between topological spaces is called monotone if every fiber is a connected subspace of its domain. A function $f:\mathbb {R} \to \mathbb {R}$ is monotone in this topological sense if and only if it is non-increasing or non-decreasing, which is the usual meaning of "monotone function" in real analysis.
A function between topological spaces is (sometimes) called a proper map if every fiber is a compact subspace of its domain. However, many authors use other non-equivalent competing definitions of "proper map" so it is advisable to always check how a particular author defines this term. A continuous closed surjective function whose fibers are all compact is called a perfect map.
A fiber bundle is a function $f$ between topological spaces $X$ and $Y$ whose fibers have certain special properties related to the topology of those spaces.

### In algebraic geometry

In algebraic geometry, if $f:X\to Y$ is a morphism of schemes, the fiber of a point $p$ in $Y$ is the fiber product of schemes $X\times _{Y}\operatorname {Spec} k(p)$ where $k(p)$ is the residue field at $p.$