# Almost all

In mathematics, the term "**almost all**" means "all but a negligible amount". More precisely, if `X` is a set, "almost all elements of `X`" means "all elements of `X` but those in a negligible subset of `X`". The meaning of "negligible" depends on the mathematical context; for instance, it can mean finite, countable, or null.

In contrast, "**almost no**" means "a negligible amount"; that is, "almost no elements of `X`" means "the elements of some negligible subset of `X`".

## Contents

## Meanings in areas of mathematics[edit]

### Prevalent meaning[edit]

Throughout mathematics, "almost all" is sometimes used to mean "all (elements of an infinite set) but finitely many";^{[1]}^{[2]}^{[3]} this use occurs in philosophy as well.^{[4]} Similarly, "almost all" can mean "all (elements of an uncountable set) but countably many".^{[sec 1]}

Examples:

- Almost all positive integers are greater than 1,000,000,000,000.
^{[5]}^{:293} - Almost all prime numbers are odd, as 2 is the only exception.
- Almost all polyhedra are irregular, as there are only nine exceptions: the five platonic solids and the four Kepler–Poinsot polyhedra.
- If
`P`is a nonzero polynomial,`P(x)`≠0 for almost all`x`.

### Meaning in measure theory[edit]

When speaking about the reals, sometimes "almost all" means "all reals but a null set".^{[6]}^{[7]}^{[sec 2]} Similarly, if `S` is some set of reals, "almost all numbers in `S`" can mean "all numbers in `S` but those in a null set".^{[8]} The real line can be thought of as a one-dimensional Euclidean space. In the more general case of an `n`-dimensional space (where `n` is a positive integer), these definitions can be generalised to "all points but those in a null set"^{[sec 3]} or "all points in `S` but those in a null set" (this time, `S` is a set of points in the space).^{[9]} Even more generally, "almost all" is sometimes used in the sense of "almost everywhere" in measure theory,^{[10]}^{[11]}^{[sec 4]} or in the closely related sense of "almost surely" in probability theory.^{[11]}^{[sec 5]}

Examples:

- In a measure space, such as the real line, countable sets are null. The set of rational numbers is countable, and thus almost all real numbers are irrational.
^{[12]} - As Georg Cantor proved in his first set theory article, the set of algebraic numbers is countable as well, so almost all reals are transcendental.
^{[13]} - Almost all reals are normal.
^{[14]} - The Cantor set is null as well. Thus, almost all reals are not members of it even though it is uncountable.
^{[6]} - The derivative of the Cantor function is 0 for almost all numbers in the unit interval.
^{[15]}It follows from the previous example because the Cantor function is locally constant—and thus with derivative 0—outside the Cantor set.

### Meaning in number theory[edit]

In number theory, "almost all positive integers" can mean "the positive integers in a set whose natural density is 1"; that is, if `A` is a set of positive integers, and if the proportion of positive integers below `n` that are in `A` (out of all positive integers below `n`) tends to 1 as `n` tends to infinity, then almost all positive integers are in `A`.^{[16]}^{[17]}^{[sec 6]} More generally, let `S` be an infinite set of positive integers, such as the set of even positive numbers or of primes. If `A` is a subset of `S`, and if the proportion of elements of `S` below `n` that are in `A` (out of all elements of `S` below `n`) tends to 1 as `n` tends to infinity, then it can be said that almost all elements of `S` are in `A`.

Examples:

- The natural density of cofinite sets of positive integers is 1, so each of them contains almost all positive integers.
- Almost all positive integers are composite.
^{[sec 6]}^{[proof 1]} - Almost all even positive numbers can be expressed as the sum of two primes.
^{[5]}^{:489} - Almost all primes are isolated. Moreover, for every positive integer
`g`, almost all primes have prime gaps of more than`g`both to their left and to their right (no other primes between`p−g`and`p+g)`.^{[18]}

### Meaning in graph theory[edit]

In graph theory, if `A` is a set of (finite labelled) graphs, it can be said to contain almost all graphs if the proportion of graphs with `n` vertices that are in `A` tends to 1 as `n` tends to infinity.^{[19]} However, it is sometimes easier to work with probabilities,^{[20]} so the definition is reformulated as follows; the proportion of graphs with `n` vertices that are in `A` equals the probability that a random graph with `n` vertices (chosen with the uniform distribution) is in `A`, and choosing a graph in this way has the same outcome as generating a graph by flipping a coin for each pair of vertices to decide whether to connect them.^{[21]} Therefore, equivalently to the preceding definition, `A` contains almost all graphs if the probability that a coin flip-generated graph with `n` vertices is in `A` tends to 1 as `n` tends to infinity.^{[20]}^{[22]} Sometimes the latter definition is modified so that the graph is chosen randomly in some other way, where not all graphs with `n` vertices have the same probability,^{[21]} and those modified definitions are not always equivalent to the main one.

The use of the term "almost all" in graph theory is not standard; the term "asymptotically almost surely" is more commonly used for this concept.^{[20]}

Example:

- Almost all graphs are asymmetric.
^{[19]} - Almost all graphs have diameter 2.
^{[23]}

### Meaning in topology[edit]

In topology^{[24]} and especially dynamical systems theory^{[25]}^{[26]}^{[27]} (including applications in economics),^{[28]} "almost all" of a topological space's points can mean "all of the space's points but those in a meagre set"; some use a more limited definition, where a subset only contains almost all of the space's points if it contains some open dense set.^{[26]}^{[29]}^{[30]}

Example:

- Given an irreducible algebraic variety, the properties that hold for almost all points in the variety are exactly the generic properties.
^{[sec 7]}It is because in an irreducible algebraic variety equipped with the Zariski topology, all nonempty open sets are dense.

### Meaning in algebra[edit]

In abstract algebra and mathematical logic, if `U` is an ultrafilter on a set `X`, "almost all elements of `X`" sometimes means "the elements of some *element* of `U`".^{[31]}^{[32]}^{[33]}^{[34]} For any partition of `X` into two disjoint sets, one of them necessarily contains almost all elements of `X`. It is possible to think of the elements of a filter on `X` as containing almost all elements of `X` even if it isn't an ultrafilter.^{[34]}

## Proofs[edit]

**^**According to the prime number theorem, the number of primes less than or equal to`n`is asymptotically equal to`n`/ln(`n`). Therefore, the proportion of primes is roughly ln(`n`)/`n`, which tends to 0 as`n`tends to infinity, so the proportion of composite numbers less than or equal to`n`tends to 1 as`n`tends to infinity.^{[17]}

## References[edit]

### Primary sources[edit]

**^**Cahen, Paul-Jean; Chabert, Jean-Luc (3 December 1996).*Integer-Valued Polynomials*. Mathematical Surveys and Monographs.**48**. American Mathematical Society. p. xix. ISBN 978-0-8218-0388-2. ISSN 0076-5376.**^**Cahen, Paul-Jean; Chabert, Jean-Luc (7 December 2010) [First published 2000]. "Chapter 4: What's New About Integer-Valued Polynomials on a Subset?". In Hazewinkel, Michiel (ed.).*Non-Noetherian Commutative Ring Theory*. Mathematics and Its Applications.**520**. Springer. p. 85. doi:10.1007/978-1-4757-3180-4. ISBN 978-1-4419-4835-9.**^**Halmos, Paul R. (1962).*Algebraic Logic*. New York: Chelsea Publishing Company. p. 114.**^**Gärdenfors, Peter (22 August 2005).*The Dynamics of Thought*. Synthese Library.**300**. Springer. pp. 190–191. ISBN 978-1-4020-3398-8.- ^
^{a}^{b}Courant, Richard; Robbins, Herbert; Stewart, Ian (18 July 1996).*What is Mathematics? An Elementary Approach to Ideas and Methods*(PDF) (2nd ed.). Oxford University Press. ISBN 978-0-19-510519-3. - ^
^{a}^{b}Korevaar, Jacob (1 January 1968).*Mathematical Methods: Linear Algebra / Normed Spaces / Distributions / Integration*.**1**. New York: Academic Press. pp. 359–360. ISBN 978-1-4832-2813-6. **^**Natanson, Isidor P. (June 1961).*Theory of Functions of a Real Variable*.**1**. Translated by Boron, Leo F. (revised ed.). New York: Frederick Ungar Publishing. p. 90. ISBN 978-0-8044-7020-9.**^**Sohrab, Houshang H. (15 November 2014).*Basic Real Analysis*(2 ed.). Birkhäuser. p. 307. doi:10.1007/978-1-4939-1841-6. ISBN 978-1-4939-1841-6.**^**Helmberg, Gilbert (December 1969).*Introduction to Spectral Theory in Hilbert Space*. North-Holland Series in Applied Mathematics and Mechanics.**6**(1st ed.). Amsterdam: North-Holland Publishing Company. p. 320. ISBN 978-0-7204-2356-3.**^**Vestrup, Eric M. (18 September 2003).*The Theory of Measures and Integration*. Wiley Series in Probability and Statistics. United States: Wiley-Interscience. p. 182. ISBN 978-0-471-24977-1.- ^
^{a}^{b}Billingsley, Patrick (1 May 1995).*Probability and Measure*(PDF). Wiley Series in Probability and Statistics (3rd ed.). United States: Wiley-Interscience. p. 60. ISBN 978-0-471-00710-4. Archived from the original (PDF) on 23 May 2018. **^**Niven, Ivan (1 June 1956).*Irrational Numbers*. Carus Mathematical Monographs.**11**. Rahway: Mathematical Association of America. pp. 2–5. ISBN 978-0-88385-011-4.**^**Baker, Alan (1984).*A concise introduction to the theory of numbers*(PDF). Cambridge University Press. p. 53. ISBN 978-0-521-24383-4.**^**Granville, Andrew; Rudnick, Zeev (7 January 2007).*Equidistribution in Number Theory, An Introduction*. Nato Science Series II.**237**. Springer. p. 11. ISBN 978-1-4020-5404-4.**^**Burk, Frank (3 November 1997).*Lebesgue Measure and Integration: An Introduction*. A Wiley-Interscience Series of Texts, Monographs, and Tracts. United States: Wiley-Interscience. p. 260. ISBN 978-0-471-17978-8.**^**Hardy, G. H. (1940).*Ramanujan: Twelve Lectures on Subjects Suggested by His Life and Work*. Cambridge University Press. p. 50.- ^
^{a}^{b}Hardy, G. H.; Wright, E. M. (December 1960).*An Introduction to the Theory of Numbers*(PDF) (4th ed.). Oxford University Press. pp. 8–9. ISBN 978-0-19-853310-8. **^**Prachar, Karl (1957).*Primzahlverteilung*. Grundlehren der mathematischen Wissenschaften (in German).**91**. Berlin: Springer. p. 164. Cited in Grosswald, Emil (1 January 1984).*Topics from the Theory of Numbers*(2nd ed.). Boston: Birkhäuser. p. 30. ISBN 978-0-8176-3044-7.- ^
^{a}^{b}Babai, László (25 December 1995). "Automorphism Groups, Isomorphism, Reconstruction". In Graham, Ronald; Grötschel, Martin; Lovász, László (eds.).*Handbook of Combinatorics*.**2**. Netherlands: North-Holland Publishing Company. p. 1462. ISBN 978-0-444-82351-9. - ^
^{a}^{b}^{c}Spencer, Joel (9 August 2001).*The Strange Logic of Random Graphs*. Algorithms and Combinatorics.**22**. Springer. pp. 3–4. ISBN 978-3-540-41654-8. - ^
^{a}^{b}Bollobás, Béla (8 October 2001).*Random Graphs*. Cambridge Studies in Advanced Mathematics.**73**(2nd ed.). Cambridge University Press. pp. 34–36. ISBN 978-0-521-79722-1. **^**Grädel, Eric; Kolaitis, Phokion G.; Libkin, Leonid; Marx, Maarten; Spencer, Joel; Vardi, Moshe Y.; Venema, Yde; Weinstein, Scott (11 June 2007).*Finite Model Theory and Its Applications*. Texts in Theoretical Computer Science (An EATCS Series). Springer. p. 298. ISBN 978-3-540-00428-8.**^**Buckley, Fred; Harary, Frank (21 January 1990).*Distance in Graphs*. Addison-Wesley. p. 109. ISBN 978-0-201-09591-3.**^**Oxtoby, John C. (1980).*Measure and Category*. Graduate Texts in Mathematics.**2**(2nd ed.). United States: Springer. pp. 59, 68. ISBN 978-0-387-90508-2. While Oxtoby does not explicitly define the term there, Babai has borrowed it from*Measure and Category*in his chapter "Automorphism Groups, Isomorphism, Reconstruction" of Graham, Grötschel and Lovász's*Handbook of Combinatorics*(vol. 2), and Broer and Takens note in their book*Dynamical Systems and Chaos*that*Measure and Category*compares this meaning of "almost all" to the measure theoretic one in the real line (though Oxtoby's book discusses meagre sets in general topological spaces as well).**^**Baratchart, Laurent (1987). "Recent and New Results in Rational L^{2}Approximation". In Curtain, Ruth F. (ed.).*Modelling, Robustness and Sensitivity Reduction in Control Systems*. NATO ASI Series F.**34**. Springer. p. 123. doi:10.1007/978-3-642-87516-8. ISBN 978-3-642-87516-8.- ^
^{a}^{b}Broer, Henk; Takens, Floris (28 October 2010).*Dynamical Systems and Chaos*. Applied Mathematical Sciences.**172**. Springer. p. 245. doi:10.1007/978-1-4419-6870-8. ISBN 978-1-4419-6870-8. **^**Sharkovsky, A. N.; Kolyada, S. F.; Sivak, A. G.; Fedorenko, V. V. (30 April 1997).*Dynamics of One-Dimensional Maps*. Mathematics and Its Applications.**407**. Springer. p. 33. doi:10.1007/978-94-015-8897-3. ISBN 978-94-015-8897-3.**^**Yuan, George Xian-Zhi (9 February 1999).*KKM Theory and Applications in Nonlinear Analysis*. Pure and Applied Mathematics; A Series of Monographs and Textbooks. Marcel Dekker. p. 21. ISBN 978-0-8247-0031-7.**^**Albertini, Francesca; Sontag, Eduardo D. (1 September 1991). "Transitivity and Forward Accessibility of Discrete-Time Nonlinear Systems". In Bonnard, Bernard; Bride, Bernard; Gauthier, Jean-Paul; Kupka, Ivan (eds.).*Analysis of Controlled Dynamical Systems*. Progress in Systems and Control Theory.**8**. Birkhäuser. p. 29. doi:10.1007/978-1-4612-3214-8. ISBN 978-1-4612-3214-8.**^**De la Fuente, Angel (28 January 2000).*Mathematical Models and Methods for Economists*. Cambridge University Press. p. 217. ISBN 978-0-521-58529-3.**^**Komjáth, Péter; Totik, Vilmos (2 May 2006).*Problems and Theorems in Classical Set Theory*. Problem Books in Mathematics. United States: Springer. p. 75. ISBN 978-0387-30293-5.**^**Salzmann, Helmut; Grundhöfer, Theo; Hähl, Hermann; Löwen, Rainer (24 September 2007).*The Classical Fields: Structural Features of the Real and Rational Numbers*. Encyclopedia of Mathematics and Its Applications.**112**. Cambridge University Press. p. 155. ISBN 978-0-521-86516-6.**^**Schoutens, Hans (2 August 2010).*The Use of Ultraproducts in Commutative Algebra*. Lecture Notes in Mathematics.**1999**. Springer. p. 8. doi:10.1007/978-3-642-13368-8. ISBN 978-3-642-13367-1.- ^
^{a}^{b}Rautenberg, Wolfgang (17 December 2009).*A Concise to Mathematical Logic*. Universitext (3rd ed.). Springer. pp. 210–212. doi:10.1007/978-1-4419-1221-3. ISBN 978-1-4419-1221-3.

### Secondary sources[edit]

**^**Schwartzman, Steven (1 May 1994).*The Words of Mathematics: An Etymological Dictionary of Mathematical Terms Used in English*. Spectrum Series. Mathematical Association of America. p. 22. ISBN 978-0-88385-511-9.**^**Clapham, Christopher; Nicholson, James (7 June 2009).*The Concise Oxford Dictionary of mathematics*. Oxford Paperback References (4th ed.). Oxford University Press. p. 38. ISBN 978-0-19-923594-0.**^**James, Robert C. (31 July 1992).*Mathematics Dictionary*(5th ed.). Chapman & Hall. p. 269. ISBN 978-0-412-99031-1.**^**Bityutskov, Vadim I. (30 November 1987). "Almost-everywhere". In Hazewinkel, Michiel (ed.).*Encyclopaedia of Mathematics*.**1**. Kluwer Academic Publishers. p. 153. doi:10.1007/978-94-015-1239-8. ISBN 978-94-015-1239-8.**^**Itô, Kiyosi, ed. (4 June 1993).*Encyclopedic Dictionary of Mathematics*.**2**(2nd ed.). Kingsport: MIT Press. p. 1267. ISBN 978-0-262-09026-1.- ^
^{a}^{b}Weisstein, Eric W. "Almost All".*MathWorld*. See also Weisstein, Eric W. (25 November 1988).*CRC Concise Encyclopedia of Mathematics*(PDF) (1st ed.). CRC Press. p. 41. ISBN 978-0-8493-9640-3. **^**Itô, Kiyosi, ed. (4 June 1993).*Encyclopedic Dictionary of Mathematics*.**1**(2nd ed.). Kingsport: MIT Press. p. 67. ISBN 978-0-262-09026-1.