# Generic property

In mathematics, properties that hold for "typical" examples are called generic properties. For instance, a generic property of a class of functions is one that is true of "almost all" of those functions, as in the statements, "A generic polynomial does not have a root at zero," or "A generic square matrix is invertible." As another example, a generic property of a space is a property that holds at "almost all" points of the space, as in the statement, "If f : M → N is a smooth function between smooth manifolds, then a generic point of N is not a critical value of f." (This is by Sard's theorem.)
There are many different notions of "generic" (what is meant by "almost all") in mathematics, with corresponding dual notions of "almost none" (negligible set); the two main classes are:
* In measure theory, a generic property is one that holds almost everywhere, with the dual concept being null set, meaning "with probability 0".
* In topology and algebraic geometry, a generic property is one that holds on a dense open set, or more generally on a residual set, with the dual concept being a nowhere dense set, or more generally a meagre set.
There are several natural examples where those notions are not equal. For instance, the set of Liouville numbers is generic in the topological sense, but has Lebesgue measure zero.

## In measure theory

In measure theory, a generic property is one that holds almost everywhere. The dual concept is a null set, that is, a set of measure zero.

### In probability

In probability, a generic property is an event that occurs almost surely, meaning that it occurs with probability 1. For example, the law of large numbers states that the sample mean converges almost surely to the population mean. This is the definition in the measure theory case specialized to a probability space.

## In discrete mathematics

In discrete mathematics, one uses the term almost all to mean cofinite (all but finitely many), cocountable (all but countably many), for sufficiently large numbers, or, sometimes, asymptotically almost surely. The concept is particularly important in the study of random graphs.

## In topology

In topology and algebraic geometry, a generic property is one that holds on a dense open set, or more generally on a residual set (a countable intersection of dense open sets), with the dual concept being a closed nowhere dense set, or more generally a meagre set (a countable union of nowhere dense closed sets).
However, density alone is not sufficient to characterize a generic property. This can be seen even in the real numbers, where both the rational numbers and their complement, the irrational numbers, are dense. Since it does not make sense to say that both a set and its complement exhibit typical behavior, both the rationals and irrationals cannot be examples of sets large enough to be typical. Consequently, we rely on the stronger definition above which implies that the irrationals are typical and the rationals are not.
For applications, if a property holds on a residual set, it may not hold for every point, but perturbing it slightly will generally land one inside the residual set (by nowhere density of the components of the meagre set), and these are thus the most important case to address in theorems and algorithms.

### In function spaces

A property is generic in C$^r$ if the set holding this property contains a residual subset in the C$^r$ topology. Here C$^r$ is the function space whose members are continuous functions with r continuous derivatives from a manifold M to a manifold N.
The space C$^r$(M, N), of C$^r$ mappings between M and N, is a Baire space, hence any residual set is dense. This property of the function space is what makes generic properties typical.

## In algebraic geometry
### Algebraic varieties

A property of an irreducible algebraic variety X is said to be true generically if it holds except on a proper Zariski-closed subset of X, in other words, if it holds on a non-empty Zariski-open subset. This definition agrees with the topological one above, because for irreducible algebraic varieties any non-empty open set is dense.
For example, by the Jacobian criterion for regularity, a generic point of a variety over a field of characteristic zero is smooth. (This statement is known as generic smoothness.) This is true because the Jacobian criterion can be used to find equations for the points which are not smooth: They are exactly the points where the Jacobian matrix of a point of X does not have full rank. In characteristic zero, these equations are non-trivial, so they cannot be true for every point in the variety. Consequently, the set of all non-regular points of X is a proper Zariski-closed subset of X.
Here is another example. Let f : X → Y be a regular map between two algebraic varieties. For every point y of Y, consider the dimension of the fiber of f over y, that is, dim f$^{−1}$(y). Generically, this number is constant. It is not necessarily constant everywhere. If, say, X is the blowup of Y at a point and f is the natural projection, then the relative dimension of f is zero except at the point which is blown up, where it is dim Y - 1.
Some properties are said to hold very generically. Frequently this means that the ground field is uncountable and that the property is true except on a countable union of proper Zariski-closed subsets (i.e., the property holds on a dense G$_δ$ set). For instance, this notion of very generic occurs when considering rational connectedness. However, other definitions of very generic can and do occur in other contexts.

### Generic point

In algebraic geometry, a generic point of an algebraic variety is a point whose coordinates do not satisfy any other algebraic relation than those satisfied by every point of the variety. For example, a generic point of an affine space over a field k is a point whose coordinates are algebraically independent over k.
In scheme theory, where the points are the sub varieties, a generic point of a variety is a point whose closure for the Zariski topology is the whole variety.
A generic property is a property of the generic point. For any reasonable property, it turns out that the property is true generically on the subvariety (in the sense of being true on an open dense subset) if and only if the property is true at the generic point. Such results are frequently proved using the methods of limits of affine schemes developed in EGA IV 8.

### General position

A related concept in algebraic geometry is general position, whose precise meaning depends on the context. For example, in the Euclidean plane, three points in general position are not collinear. This is because the property of not being collinear is a generic property of the configuration space of three points in R$^2$.

## In computability

In computability and algorithmic randomness, an infinite string of natural numbers $f\in \omega ^{\omega }$ is called 1-generic if, for every c.e. set $W\subseteq \omega ^{<\omega }$, either $f$ has an initial segment $\sigma$ in $W$, or $f$ has an initial segment $\sigma$ such that every extension $\tau \succcurlyeq \sigma$ is not in W. 1-generics are important in computability, as many constructions can be simplified by considering an appropriate 1-generic. Some key properties are:
* A 1-generic contains every natural number as an element;
* No 1-generic is computable (or even bounded by a computable function);
* All 1-generics $f$ are generalised low: $f'\equiv _{\mathrm {T} }f\oplus \varnothing '$.
1-genericity is connected to the topological notion of "generic", as follows. Baire space $\omega ^{\omega }$ has a topology with basic open sets $[\sigma ]=\{f:\sigma \preccurlyeq f\}$ for every finite string of natural numbers $\sigma \in \omega ^{<\omega }$. Then, an element $f\in \omega ^{\omega }$ is 1-generic if and only if it is not on the boundary of any open set. In particular, 1-generics are required to meet every dense open set (though this is a strictly weaker property, called weakly 1-generic).

## Genericity results

* Sard's theorem: If $f\colon M\to N$ is a smooth function between smooth manifolds, then a generic point of N is not a critical value of f – critical values of f are a null set in N.
* Jacobian criterion / generic smoothness: A generic point of a variety over a field of characteristic zero is smooth.
* Controllability and observability of linear time-invariant systems are generic both in the topological and measure theory sense.