In elementary mathematics, a number line is a picture of a straight line that serves as spatial representation of numbers, usually graduated like a ruler with a particular origin point representing the number zero and evenly spaced marks in either direction representing integers, imagined to extend infinitely. The metaphorical association between numbers and points on the line links arithmetical operations on numbers to geometric relations between points, and provides a conceptual scaffold for learning mathematics.
The number line is initially used to teach addition and subtraction of integers, especially involving negative numbers. As students progress, more kinds of numbers can be placed on the line, including fractions, decimal fractions, square roots, and transcendental numbers such as the circle constant π: Every point of the number line corresponds to a unique real number, and every real number to a unique point.^{[1]}
Using a number line, numerical concepts can be interpreted geometrically and geometric concepts interpreted numerically. An inequality between numbers corresponds to a left-or-right order relation between points. Numerical intervals are associated to geometrical segments of the line. Operations and functions on numbers correspond to geometric transformations of the line. Wrapping the line into a circle relates modular arithmetic to the geometric composition of angles. Marking the line with logarithmically spaced graduations associates multiplication and division with geometric translations, the principle underlying the slide rule. In analytic geometry, coordinate axes are number lines which associate points in a geometric space with tuples of numbers, so geometric shapes can be described using numerical equations and numerical functions can be graphed.
In advanced mathematics, the number line is usually called the real line or real number line, and is a geometric line isomorphic to the set of real numbers, with which it is often conflated; both the real numbers and the real line are commonly denoted R or . The real line is a one-dimensional real coordinate space, so is sometimes denoted R^{1} when comparing it to higher-dimensional spaces. The real line is a one-dimensional Euclidean space using the difference between numbers to define the distance between points on the line. It can also be thought of as a vector space, a metric space, a topological space, a measure space, or a linear continuum. The real line can be embedded in the complex plane, used as a two-dimensional geometric representation of the complex numbers.
The first mention of the number line used for operation purposes is found in John Wallis's Treatise of algebra.^{[2]} In his treatise, Wallis describes addition and subtraction on a number line in terms of moving forward and backward, under the metaphor of a person walking.
An earlier depiction without mention to operations, though, is found in John Napier's A description of the admirable table of logarithmes, which shows values 1 through 12 lined up from left to right.^{[3]}
Contrary to popular belief, René Descartes's original La Géométrie does not feature a number line, defined as we use it today, though it does use a coordinate system. In particular, Descartes's work does not contain specific numbers mapped onto lines, only abstract quantities.^{[4]}
A number line is usually represented as being horizontal, but in a Cartesian coordinate plane the vertical axis (y-axis) is also a number line.^{[5]} According to one convention, positive numbers always lie on the right side of zero, negative numbers always lie on the left side of zero, and arrowheads on both ends of the line are meant to suggest that the line continues indefinitely in the positive and negative directions. Another convention uses only one arrowhead which indicates the direction in which numbers grow.^{[5]} The line continues indefinitely in the positive and negative directions according to the rules of geometry which define a line without endpoints as an infinite line, a line with one endpoint as a ray, and a line with two endpoints as a line segment.
If a particular number is farther to the right on the number line than is another number, then the first number is greater than the second (equivalently, the second is less than the first). The distance between them is the magnitude of their difference—that is, it measures the first number minus the second one, or equivalently the absolute value of the second number minus the first one. Taking this difference is the process of subtraction.
Thus, for example, the length of a line segment between 0 and some other number represents the magnitude of the latter number.
Two numbers can be added by "picking up" the length from 0 to one of the numbers, and putting it down again with the end that was 0 placed on top of the other number.
Two numbers can be multiplied as in this example: To multiply 5 × 3, note that this is the same as 5 + 5 + 5, so pick up the length from 0 to 5 and place it to the right of 5, and then pick up that length again and place it to the right of the previous result. This gives a result that is 3 combined lengths of 5 each; since the process ends at 15, we find that 5 × 3 = 15.
Division can be performed as in the following example: To divide 6 by 2—that is, to find out how many times 2 goes into 6—note that the length from 0 to 2 lies at the beginning of the length from 0 to 6; pick up the former length and put it down again to the right of its original position, with the end formerly at 0 now placed at 2, and then move the length to the right of its latest position again. This puts the right end of the length 2 at the right end of the length from 0 to 6. Since three lengths of 2 filled the length 6, 2 goes into 6 three times (that is, 6 ÷ 2 = 3).
The section of the number line between two numbers is called an interval. If the section includes both numbers it is said to be a closed interval, while if it excludes both numbers it is called an open interval. If it includes one of the numbers but not the other one, it is called a half-open interval.
All the points extending forever in one direction from a particular point are together known as a ray. If the ray includes the particular point, it is a closed ray; otherwise it is an open ray.
On the number line, the distance between two points is the unit length if and only if the difference of the represented numbers equals 1. Other choices are possible.
One of the most common choices is the logarithmic scale, which is a representation of the positive numbers on a line, such that the distance of two points is the unit length, if the ratio of the represented numbers has a fixed value, typically 10. In such a logarithmic scale, the origin represents 1; one inch to the right, one has 10, one inch to the right of 10 one has 10×10 = 100, then 10×100 = 1000 = 10^{3}, then 10×1000 = 10,000 = 10^{4}, etc. Similarly, one inch to the left of 1, one has 1/10 = 10^{–1}, then 1/100 = 10^{–2}, etc.
This approach is useful, when one wants to represent, on the same figure, values with very different order of magnitude. For example, one requires a logarithmic scale for representing simultaneously the size of the different bodies that exist in the Universe, typically, a photon, an electron, an atom, a molecule, a human, the Earth, the Solar System, a galaxy, and the visible Universe.
Logarithmic scales are used in slide rules for multiplying or dividing numbers by adding or subtracting lengths on logarithmic scales.
A line drawn through the origin at right angles to the real number line can be used to represent the imaginary numbers. This line, called imaginary line, extends the number line to a complex number plane, with points representing complex numbers.
Alternatively, one real number line can be drawn horizontally to denote possible values of one real number, commonly called x, and another real number line can be drawn vertically to denote possible values of another real number, commonly called y. Together these lines form what is known as a Cartesian coordinate system, and any point in the plane represents the value of a pair of real numbers. Further, the Cartesian coordinate system can itself be extended by visualizing a third number line "coming out of the screen (or page)", measuring a third variable called z. Positive numbers are closer to the viewer's eyes than the screen is, while negative numbers are "behind the screen"; larger numbers are farther from the screen. Then any point in the three-dimensional space that we live in represents the values of a trio of real numbers.
The real line is a linear continuum under the standard < ordering. Specifically, the real line is linearly ordered by <, and this ordering is dense and has the least-upper-bound property.
In addition to the above properties, the real line has no maximum or minimum element. It also has a countable dense subset, namely the set of rational numbers. It is a theorem that any linear continuum with a countable dense subset and no maximum or minimum element is order-isomorphic to the real line.
The real line also satisfies the countable chain condition: every collection of mutually disjoint, nonempty open intervals in R is countable. In order theory, the famous Suslin problem asks whether every linear continuum satisfying the countable chain condition that has no maximum or minimum element is necessarily order-isomorphic to R. This statement has been shown to be independent of the standard axiomatic system of set theory known as ZFC.
The real line forms a metric space, with the distance function given by absolute difference:
The metric tensor is clearly the 1-dimensional Euclidean metric. Since the n-dimensional Euclidean metric can be represented in matrix form as the n-by-n identity matrix, the metric on the real line is simply the 1-by-1 identity matrix, i.e. 1.
If p ∈ R and ε > 0, then the ε-ball in R centered at p is simply the open interval (p − ε, p + ε).
This real line has several important properties as a metric space:
The real line carries a standard topology, which can be introduced in two different, equivalent ways. First, since the real numbers are totally ordered, they carry an order topology. Second, the real numbers inherit a metric topology from the metric defined above. The order topology and metric topology on R are the same. As a topological space, the real line is homeomorphic to the open interval (0, 1).
The real line is trivially a topological manifold of dimension 1. Up to homeomorphism, it is one of only two different connected 1-manifolds without boundary, the other being the circle. It also has a standard differentiable structure on it, making it a differentiable manifold. (Up to diffeomorphism, there is only one differentiable structure that the topological space supports.)
The real line is a locally compact space and a paracompact space, as well as second-countable and normal. It is also path-connected, and is therefore connected as well, though it can be disconnected by removing any one point. The real line is also contractible, and as such all of its homotopy groups and reduced homology groups are zero.
As a locally compact space, the real line can be compactified in several different ways. The one-point compactification of R is a circle (namely, the real projective line), and the extra point can be thought of as an unsigned infinity. Alternatively, the real line has two ends, and the resulting end compactification is the extended real line [−∞, +∞]. There is also the Stone–Čech compactification of the real line, which involves adding an infinite number of additional points.
In some contexts, it is helpful to place other topologies on the set of real numbers, such as the lower limit topology or the Zariski topology. For the real numbers, the latter is the same as the finite complement topology.
The real line is a vector space over the field R of real numbers (that is, over itself) of dimension 1. It has the usual multiplication as an inner product, making it a Euclidean vector space. The norm defined by this inner product is simply the absolute value.
The real line carries a canonical measure, namely the Lebesgue measure. This measure can be defined as the completion of a Borel measure defined on R, where the measure of any interval is the length of the interval.
Lebesgue measure on the real line is one of the simplest examples of a Haar measure on a locally compact group.
When A is a unital real algebra, the products of real numbers with 1 is a real line within the algebra. For example, in the complex plane z = x + iy, the subspace {z : y = 0} is a real line. Similarly, the algebra of quaternions
has a real line in the subspace {q : x = y = z = 0 }.
When the real algebra is a direct sum then a conjugation on A is introduced by the mapping of subspace V. In this way the real line consists of the fixed points of the conjugation.
For a dimension n, the square matrices form a ring that has a real line in the form of real products with the identity matrix in the ring.