Fact-checked by Grok 2 weeks ago

Integer

In mathematics, an integer is a number that represents a whole quantity without any fractional or decimal part, encompassing all positive whole numbers (such as 1, 2, 3, ...), zero, and their corresponding negative values (such as -1, -2, -3, ...). The set of all integers is denoted by the symbol , derived from the German word Zahlen meaning "numbers," and it forms the foundational structure for arithmetic and number theory. The integers exhibit key algebraic properties that make them a with unity under the operations of and . These include (the sum or product of any two integers is an integer), commutativity (order does not affect or ), associativity (grouping does not affect results), the existence of additive and multiplicative identities ( and 1, respectively), and additive inverses (for every integer a, there exists -a such that a + (-a) = ). Additionally, distributes over , and the integers satisfy the cancellation property for by non-zero elements. Unlike the rational or real numbers, integers are and not closed under , as the result of dividing two integers is not always an integer. Historically, the concept of integers developed gradually, with positive whole numbers appearing in ancient Egyptian records around 3000 BC, while negative integers emerged later to resolve subtraction problems beyond zero. Evidence of negative numbers first surfaces in Chinese mathematics between 200 BC and 200 AD, followed by their formal treatment in Indian texts around the 7th century AD, where rules for operations involving positives and negatives were established. By the 17th century, Western mathematicians began incorporating negatives into calculations, and by the 19th century, integers achieved full parity with other number types in European mathematics. Today, integers underpin diverse fields, from basic arithmetic to advanced topics like divisibility, primes, and modular arithmetic in number theory.

Definition and Fundamentals

Definition

In mathematics, the integers are defined as the set \mathbb{Z} = \{\dots, -2, -1, 0, 1, 2, \dots \}, comprising all whole numbers that include positive values, their negatives, and zero. This set represents the complete collection of numbers without fractional or decimal parts, extending beyond non-negative counts to incorporate directionality through negatives. The symbol \mathbb{Z} derives from the German word Zahl, meaning "number," and is conventionally rendered in double-struck typeface to denote this specific algebraic structure. The integers differ from the natural numbers \mathbb{N}, which form the foundational set for counting and are typically defined as \mathbb{N} = \{0, 1, 2, \dots \} or \mathbb{N} = \{1, 2, 3, \dots \}, excluding negatives. In contrast to the rational numbers \mathbb{Q}, which include all ratios of integers \frac{p}{q} where p \in \mathbb{Z}, q \in \mathbb{Z} \setminus \{0\}, the integers exclude fractions and thus form a proper subset of \mathbb{Q}. Algebraically, the integers constitute the smallest containing the natural numbers, constructed by adjoining additive inverses to \mathbb{N} to enable while preserving the ring operations of and . For instance, \mathbb{Z} is closed under and —the result of adding or subtracting any two integers remains an integer—but not under , as dividing 3 by 2 yields the rational \frac{3}{2}, which is not an integer. This closure property underscores the integers' role as a foundational for more advanced number systems.

Basic Notation and Sets

The set of all integers is commonly denoted by the blackboard bold symbol \mathbb{Z}, derived from the German word Zahl for "number." This notation represents the infinite collection \mathbb{Z} = \{\dots, -3, -2, -1, 0, 1, 2, 3, \dots \}. Subsets of \mathbb{Z} are frequently distinguished using superscripts or other modifiers for clarity in mathematical discourse. The positive integers form the subset \mathbb{Z}^+ = \{1, 2, 3, \dots \}, while the negative integers are \mathbb{Z}^- = \{-1, -2, -3, \dots \}. The singleton set containing only zero is denoted \{0\}, and the non-negative integers can be written as \mathbb{Z}_{\geq 0} = \{0, 1, 2, \dots \}. These notations allow precise specification of membership within \mathbb{Z}, such as verifying that 5 belongs to \mathbb{Z}^+ but -5 does not. Integer intervals are often expressed using set intersection with real intervals to denote bounded subsets. For real numbers a \leq b, the closed interval of integers from a to b inclusive is \mathbb{Z} \cap [a, b], which includes all n \in \mathbb{Z} such that a \leq n \leq b. For example, \mathbb{Z} \cap [2, 5] = \{2, 3, 4, 5\}. Open or half-open variants follow similarly, such as \mathbb{Z} \cap (1, 4) = \{2, 3\}. This notation leverages the standard interval symbols from real analysis while restricting to integer elements. Set-builder notation provides a flexible way to define subsets of \mathbb{Z} based on properties or conditions. The general form is \{n \in \mathbb{Z} \mid P(n)\}, where P(n) is a true for desired elements. For instance, the set of even integers is \{n \in \mathbb{Z} \mid n \equiv 0 \pmod{2}\}, or more simply \{n \in \mathbb{Z} \mid 2 \mid n\}, yielding \{\dots, -4, -2, 0, 2, 4, \dots \}. Singletons like \{3\} = \{n \in \mathbb{Z} \mid n = 3\} exemplify minimal non-empty subsets, while contradictory conditions produce the , such as \emptyset = \{n \in \mathbb{Z} \mid n > 0 \land n < 0\}. These constructions emphasize the discrete membership rules of \mathbb{Z}, where elements are uniquely identifiable whole numbers. Unlike the rational numbers \mathbb{Q}, which are dense in the real numbers \mathbb{R} (meaning between any two reals there exists a rational), the integers exhibit no such density. Specifically, between any two consecutive integers m and m+1 with m \in \mathbb{Z}, there are no other integers, highlighting the discrete structure of \mathbb{Z} within \mathbb{R}. This sparsity underscores basic topological distinctions in number systems.

Algebraic Properties

Ring and Field Connections

The integers \mathbb{Z} form a commutative ring with unity under the standard operations of addition and multiplication. This structure satisfies the following axioms: closure under addition and multiplication, associativity of addition and multiplication, commutativity of addition and multiplication, distributivity of multiplication over addition, the existence of an additive identity $0such that0 + a = a = a + 0for alla \in \mathbb{Z}, the existence of a multiplicative identity &#36;1 such that $1 \cdot a = a = a \cdot 1 for all a \in \mathbb{Z}, and the existence of additive inverses such that for every a \in \mathbb{Z}, there exists -a \in \mathbb{Z} with a + (-a) = 0. Furthermore, \mathbb{Z} is an integral domain, meaning it is a commutative ring with unity and no zero divisors: if a \cdot b = 0 for a, b \in \mathbb{Z}, then a = 0 or b = 0. This property ensures that multiplication in \mathbb{Z} is "cancellation-friendly" in the absence of zero, distinguishing it from rings with zero divisors like \mathbb{Z}/6\mathbb{Z}. Although \mathbb{Z} satisfies the ring axioms, it is not a field because not every non-zero element has a multiplicative inverse within \mathbb{Z}; for example, there is no b \in \mathbb{Z} such that $2 \cdot b = 1. However, the field of fractions of \mathbb{Z}—constructed by adjoining multiplicative inverses for all non-zero elements—is the field of rational numbers \mathbb{Q}, which embeds \mathbb{Z} as a subring and provides the necessary inverses. This construction highlights \mathbb{Z} as the initial ring in the category of integral domains of characteristic zero, with \mathbb{Q} as its universal field extension.

Divisibility and Greatest Common Divisor

In the integers, divisibility is a fundamental relation where an integer a divides an integer b, denoted a \mid b, if there exists an integer k such that b = a k. This relation captures the structure of multiplication within the ring of integers, where multiples form ideals generated by the divisor. Prime integers play a central role in divisibility, defined as positive integers greater than 1 that have no positive divisors other than 1 and themselves. For instance, 2, 3, 5, and 7 are primes, while 4 is not since it is divisible by 2. Primes are irreducible elements in the integers, meaning they cannot be expressed as a product of two non-unit integers. The Fundamental Theorem of Arithmetic asserts that every positive integer greater than 1 can be uniquely expressed as a product of prime integers, up to the order of the factors. For example, $12 = 2^2 \cdot 3, and this factorization is the only one using primes. This uniqueness underpins much of number theory, ensuring that factorization provides a canonical representation for integers. The greatest common divisor of two integers a and b, denoted \gcd(a, b), is the largest positive integer that divides both a and b. It measures the extent of shared divisibility and is always positive, with \gcd(a, 0) = |a| and \gcd(0, 0) undefined or taken as 0 in some contexts. The efficiently computes \gcd(a, b) by repeated division: \gcd(a, b) = \gcd(b, a \mod b), terminating when the remainder is zero, at which point the divisor is the GCD. For example, \gcd(48, 18) = \gcd(18, 12) = \gcd(12, 6) = \gcd(6, 0) = 6. This algorithm's efficiency stems from the fact that each step reduces the problem size, typically requiring O(\log \min(a, b)) steps. The least common multiple of a and b, denoted \operatorname{lcm}(a, b), is the smallest positive integer divisible by both, and it relates to the via the formula \operatorname{lcm}(a, b) = \frac{|a b|}{\gcd(a, b)}. This identity holds because the prime factorizations of a and b combine by taking the highest powers of each prime, which aligns with dividing the product by their common factors captured in the . For instance, with a = 12 = 2^2 \cdot 3 and b = 18 = 2 \cdot 3^2, \gcd(12, 18) = 6 = 2 \cdot 3 and \operatorname{lcm}(12, 18) = 36 = 2^2 \cdot 3^2 = \frac{12 \cdot 18}{6}.

Order-Theoretic Aspects

Linear Ordering

The integers \mathbb{Z} form a totally ordered set under the standard strict order relation <, where for any two integers a, b \in \mathbb{Z}, exactly one of the following holds: a < b, a = b, or a > b. This property, known as the , ensures that the order is complete and linear, distinguishing \mathbb{Z} from partially ordered structures. The associated non-strict order \leq inherits key properties from <, including transitivity (if a \leq b and b \leq c, then a \leq c), totality (for any a, b \in \mathbb{Z}, either a \leq b or b \leq a), and antisymmetry (if a \leq b and b \leq a, then a = b). These axioms make \leq a total order, enabling systematic comparisons across all integers. Unlike the rational or real numbers, the order on \mathbb{Z} lacks density: for any integer n \in \mathbb{Z}, there exists no integer m such that n < m < n+1. This discrete nature means the integers are "gapped," with successors and predecessors defined uniquely via addition by 1. The non-negative integers \mathbb{N}_0 = \{0, 1, 2, \dots \} form a well-ordered subset under \leq, where every non-empty subset has a least element. This well-ordering principle underpins proofs by induction and the fundamental theorem of arithmetic, ensuring no infinite descending chains in \mathbb{N}_0.

Absolute Value and Inequalities

The absolute value of an integer n, denoted \lvert n \rvert, is defined algebraically as n if n \geq 0 and -n if n < 0. Geometrically, \lvert n \rvert represents the distance from n to 0 on the , ensuring that \lvert n \rvert is always a non-negative integer, belonging to the set \mathbb{N}_0 = \{0, 1, 2, \dots \}. For example, \lvert -3 \rvert = 3, illustrating how the absolute value maps negative integers to their positive counterparts while preserving the magnitude. A fundamental inequality involving absolute values on integers is the triangle inequality, which states that for any integers a and b, \lvert a + b \rvert \leq \lvert a \rvert + \lvert b \rvert. This property reflects the subadditive nature of distances on the number line, where the direct distance between two points is no greater than the path length via an intermediate point. Equality holds if and only if a and b have the same sign (both non-negative or both negative), or if at least one is zero. For instance, \lvert 4 + (-2) \rvert = \lvert 2 \rvert = 2 < 4 + 2 = \lvert 4 \rvert + \lvert -2 \rvert, but \lvert 3 + 5 \rvert = 8 = 3 + 5 = \lvert 3 \rvert + \lvert 5 \rvert. Another key inequality for positive integers a, b > 0 is the arithmetic mean-geometric mean (AM-GM) inequality, which asserts that \sqrt{a b} \leq \frac{a + b}{2}, with a = b. This highlights the relationship between additive and multiplicative structures in the integers, providing a bound on products in terms of sums. For example, with a = 4 and b = 9, \sqrt{4 \cdot 9} = 6 < 6.5 = \frac{4 + 9}{2}. Such inequalities underpin many applications in number theory, emphasizing the ordered nature of integers under the standard linear ordering.

Formal Constructions

Peano Axioms Approach

The Peano axioms establish a rigorous foundation for the natural numbers \mathbb{N}, treating 0 as the initial element and a successor function S as the primary operation for generating subsequent numbers, alongside an induction principle to ensure completeness. These axioms, originally formulated by in 1889, are as follows:
  • 0 is a natural number.
  • For every natural number n, S(n) is a natural number.
  • No natural number has 0 as its successor: there is no n such that S(n) = 0.
  • Distinct natural numbers have distinct successors: if S(n) = S(m), then n = m.
  • Induction axiom: If a property P holds for 0 and, whenever it holds for n, it holds for S(n), then P holds for every natural number.
These axioms define \mathbb{N} up to isomorphism as the standard non-negative integers, with addition and multiplication defined recursively using the successor function—for instance, n + 0 = n and n + S(m) = S(n + m). To construct the integers \mathbb{Z} from \mathbb{N}, the Peano approach extends the structure by introducing negatives as formal differences, effectively adjoining additive inverses to the additive monoid of natural numbers while preserving the successor-based arithmetic. This yields \mathbb{Z} as pairs representing differences n - m for n, m \in \mathbb{N}, where expressions are identified if they yield the same value under the extended operations, ensuring every element has an additive inverse -k such that k + (-k) = 0. The successor function extends naturally to the integers as adding 1, consistent with the ring operations. In this development, addition and multiplication on \mathbb{Z} are defined to extend those on \mathbb{N}—for example, (n - m) + (p - q) = (n + p) - (m + q) and (n - m) \cdot (p - q) = (n p + m q) - (n q + m p)—verifying that \mathbb{Z} forms a commutative ring with identity 1 and additive inverses for all elements. The construction ensures ring properties like distributivity and commutativity hold by reduction to properties proven in \mathbb{N} via induction. A sketch of the isomorphism to the intuitive integers proceeds by \mathbb{N} into \mathbb{Z} via the map i(n) = n - 0, which preserves addition and successor: i(S(n)) = S(i(n)) and i(n + m) = i(n) + i(m). This embedding is injective by the injectivity of successor in \mathbb{N}, and surjective onto non-negative integers; negatives correspond uniquely to $0 - m, with the ring operations matching the standard ones, as any two such constructions satisfying the extended Peano-like axioms (including inverses and induction over positives) are isomorphic by uniqueness of the initial ring model.

Set-Theoretic Equivalence Classes

In set theory, the integers \mathbb{Z} can be constructed from the natural numbers \mathbb{N} (including 0) using equivalence classes of ordered pairs. Each integer is represented intuitively as a difference m - n, where m, n \in \mathbb{N}, formalized as the ordered pair (m, n) \in \mathbb{N} \times \mathbb{N}. This approach assumes \mathbb{N} is given, for instance via the Peano axioms. To account for the fact that different pairs can represent the same integer—such as (3, 1) and (4, 2) both equaling 2—an equivalence relation \sim is defined on \mathbb{N} \times \mathbb{N} by (m, n) \sim (m', n') if and only if m + n' = n + m'. This relation is reflexive, symmetric, and transitive, partitioning \mathbb{N} \times \mathbb{N} into equivalence classes. The set of integers \mathbb{Z} is then the quotient set (\mathbb{N} \times \mathbb{N}) / \sim, where each element is an equivalence class [(m, n)], the set of all pairs equivalent to (m, n). Addition on \mathbb{Z} is defined by [(m, n)] + [(m', n')] = [(m + m', n + n')], which is well-defined independent of the choice of representatives since if (m, n) \sim (m_1, n_1) and (m', n') \sim (m_1', n_1'), then the sums align under the equivalence. This operation makes \mathbb{Z} an abelian group under addition. The zero element is the class [(0, 0)], consisting of all pairs (k, k) for k \in \mathbb{N}. Positive integers correspond to classes [(k, 0)] for k \in \mathbb{N} with k > 0, embedding \mathbb{N} into \mathbb{Z} via k \mapsto [(k, 0)]. Negative integers are represented by classes [(0, k)] for k > 0, with the of [(m, n)] being [(n, m)]. This construction ensures \mathbb{Z} captures both directions of the while inheriting the structure of \mathbb{N}.

Alternative Constructions

One alternative construction of the integers arises from the completion of the additive of natural numbers \mathbb{N}. The \mathbb{Z} is formed as the generated by \mathbb{N} modulo the relations that embed \mathbb{N} as a submonoid, specifically the of \mathbb{N} \times \mathbb{N} by the (m, n) \sim (m', n') m + n' = m' + n, with group operation (m, n) + (m', n') = (m + m', n + n'). Here, positive integers correspond to classes (k, 0) for k \in \mathbb{N}, negative integers to (0, k), and zero to (0, 0). This yields a structure when extending the monoid multiplication appropriately, isomorphic to the standard integers \mathbb{Z}. Categorically, the integers \mathbb{Z} can be defined as the initial object in the \mathbf{Ring}, meaning there exists a unique from \mathbb{Z} to any R, sending n \in \mathbb{Z} to the n-fold sum of the multiplicative $1_R in R. This construction abstracts \mathbb{Z} as the free on one modulo the relations of ring axioms, equivalently the filtered colimit of copies of \mathbb{N} with maps incorporating additive inverses. It emphasizes the universal property of \mathbb{Z} as the of all structures. All these constructions—Grothendieck completion and the categorical initial ring—yield rings isomorphic to the standard integers \mathbb{Z}, preserving the algebraic structure, order, and universal properties up to unique . This equivalence underscores the robustness of \mathbb{Z} as the prototypical with unity.

Historical Development

Ancient and Medieval Views

In ancient and around 2000 BCE, integers were primarily employed for practical purposes such as counting goods, measuring land, and solving geometric problems in and , with numerical systems based on positive and no concept of negatives or . utilized a (base-60) positional system recorded on tablets, enabling calculations for astronomy, timekeeping, and trade, as evidenced in texts like the tablet which lists Pythagorean triples derived from positive integer ratios. Similarly, Egyptian scribes in the (c. 1650 BCE) applied a system with hieroglyphic notations for , , , and in problems involving area and , always restricting to non-negative integers for tangible quantities like or labor units. Greek mathematicians in the classical period, particularly in his (c. 300 BCE), advanced the theoretical understanding of positive integers through concepts of divisibility and proportion, laying foundational principles for without formalizing negative numbers. Books VII-IX of the define integers as positive starting from unity, explore the for finding the , and prove key results like the infinitude of primes, treating numbers geometrically as lines or magnitudes to avoid conceptual issues with zero or negatives. This approach emphasized rational relations among positives, influencing later Western mathematics but limiting applications to debt or direction until external influences. Independently, in Chinese mathematics between 200 BCE and 200 AD, negative numbers were used in practical computations, such as solving linear equations in systems like the Nine Chapters on the Mathematical Art, represented by black counting rods in contrast to red for positive numbers. In 7th-century India, Brahmagupta's Brahmasphutasiddhanta (628 CE) marked a pivotal advancement by explicitly defining zero as a number and introducing rules for operations with negative integers, termed "debts" in contrast to positive "fortunes." He provided arithmetic rules such as the sum of two negatives being negative and the product of a negative and positive being negative, enabling solutions to quadratic equations that could yield negative roots, thus expanding integers beyond non-negatives for algebraic and astronomical computations. These innovations built on earlier Indian decimal place-value systems incorporating zero, facilitating more abstract mathematical reasoning. During the medieval period in , Leonardo of , known as , popularized the Hindu-Arabic —including zero and negative numbers—through his (1202 CE), bridging Indian and Islamic developments with Western practice. demonstrated operations on integers, including negatives interpreted as debits in commercial problems, and used them in solving equations, thereby facilitating the gradual acceptance of a full integer system in European commerce, accounting, and scholarship. This work accelerated the transition from , enhancing computational efficiency across disciplines.

Modern Axiomatization

In the , Peter Gustav Lejeune Dirichlet's 1837 proof of the infinitude of primes in arithmetic progressions marked a pivotal advancement in the formal study of integers, laying the groundwork for by introducing L-functions to analyze prime distributions among residue classes. This work demonstrated that for a and m, there are infinitely many primes p \equiv a \pmod{m}, establishing equidistribution principles that relied on properties of the integers m. Dirichlet's approach shifted focus from empirical observations of divisibility—rooted in ancient practices—to rigorous analytic methods, providing a foundational framework for later axiomatic developments in integer theory. Giuseppe Peano's 1889 formulation of axioms for the natural numbers represented a cornerstone of modern integer axiomatization, defining the structure of non-negative integers through successor functions and induction. These axioms, presented in Arithmetices principia, include: zero as a natural number, the successor function's injectivity, absence of cycles in successors, and the induction axiom ensuring properties hold for all naturals if true for zero and successors. Gottlob Frege extended this framework in the late 19th century by deriving Peano's axioms from purely logical principles in second-order logic, using Hume's Principle to define cardinals as equinumerosity classes, thus grounding natural numbers—and by extension, integer arithmetic—in logic alone. Bertrand Russell further advanced this in Principia Mathematica (1910–1913), incorporating Peano's axioms into a type-theoretic system to formalize arithmetic while addressing paradoxes in Frege's approach, enabling a consistent extension to integer operations like addition and multiplication. David Hilbert's program, initiated in the early 1920s, sought to axiomatize all of —including —using finitary methods to prove and . Hilbert aimed to formalize systems like Peano arithmetic in a way that justified ideal mathematical reasoning through concrete, contentual proofs involving integer numerals, avoiding reliance on higher infinities. This effort, pursued by collaborators like Paul Bernays and , emphasized metamathematical analysis of formal systems to secure the foundations of integer theory against inconsistencies. Kurt Gödel's incompleteness theorems of 1931 profoundly impacted these axiomatizations, revealing inherent limitations in s for integers. The first theorem states that any consistent capable of expressing basic , such as Peano arithmetic, is incomplete, as there exist true statements about natural numbers (and thus integers) that cannot be proved or disproved within the system. The second theorem extends this by showing that such a system cannot prove its own consistency, undermining Hilbert's goal of finitary consistency proofs for and highlighting undecidability in integer properties like primality or divisibility. These results, published in Monatshefte für Mathematik und Physik, demonstrated that no finite set of axioms could fully capture all truths about the integers without gaps or reliance on external assumptions.

Applications in Computing

Binary Representation

In computer systems, integers are represented in using a fixed number of bits, where each bit position corresponds to a power of 2. Positive integers, including zero, are encoded directly in unsigned representation, with the most significant bit (MSB) indicating the highest power of 2. For signed integers, several encoding schemes exist, but has become the dominant method due to its simplicity in implementation for arithmetic operations. Two's complement represents negative numbers by inverting all bits of the positive equivalent and adding 1, allowing seamless addition and subtraction using the same circuitry as unsigned operations. For example, the 8-bit two's complement representation of -5 starts with the binary for 5 (00000101), inverts it to 11111010, and adds 1 to yield 11111011. This scheme eliminates the dual representations of zero found in alternatives and avoids the need for special handling of negative values during addition. In the ISO/IEC 9899:2023 (C23) programming language standard, signed integer types are mandated to use two's complement representation, solidifying its status as the de facto norm across modern processors. Alternative representations include sign-magnitude, where the MSB denotes the sign (0 for positive, 1 for negative) and the remaining bits hold the , and one's complement, which inverts all bits of the positive number for negatives. Sign-magnitude is intuitive for humans but complicates , requiring separate logic for like and unlike signs, and produces two zeros (+0 as 00000000 and -0 as 10000000 in 8 bits). One's complement simplifies but still mandates an end-around carry for and retains dual zeros (e.g., -0 as 11111111). Both alternatives were used in early computers like the (sign-magnitude) and (one's complement) but fell out of favor because enables uniform binary without these issues, reducing hardware complexity and cost. The range of representable values depends on the bit length n. For an n-bit two's complement signed integer, the values span from -2^{n-1} to $2^{n-1} - 1; a common example is the 32-bit integer, supporting -2³¹ to 2³¹ - 1, or approximately -2.147 billion to +2.147 billion. This asymmetry arises because the MSB as sign bit halves the positive range compared to unsigned. In programming languages like C, the exact range is defined by types such as int32_t from the ISO C standard. Overflow occurs when an operation exceeds the representable range, leading to wrap-around behavior equivalent to modulo 2ⁿ. For instance, in 32-bit , adding 1 to 2³¹ - 1 (0111...1) yields 1000...0, interpreted as -2³¹. This defined wrap-around simplifies low-level programming but can introduce bugs if not handled, as the treats signed overflow as to allow optimizations, though practical implementations follow semantics.

Integer Arithmetic in Programming

In programming, integer arithmetic operations are implemented at both hardware and software levels to perform computations on binary representations of integers. Integers are typically stored in using a fixed number of bits, such as 32 or 64, in notation for signed values. Basic operations like and subtraction rely on circuits known as arithmetic logic units (ALUs), which process bit-by-bit operations efficiently. Addition of two integers is performed using a or more advanced in , where each computes the and a that propagates to the next . The in the processor's is set if there is a carry-out from the most significant bit, indicating potential for unsigned operations or aiding multi-word additions. is implemented by adding the of the subtrahend, which involves inverting the bits and adding 1, effectively using the same . A borrow flag is set if a borrow is needed from a higher , equivalent to the being clear after the operation in many architectures. Multiplication of integers is often handled through shift-and-add methods in , where the multiplicand is shifted left (multiplied by powers of 2) and added to an accumulator based on each '1' bit in the multiplier, mimicking long . For efficiency, especially with signed numbers, Booth's algorithm reduces the number of additions by examining pairs of bits in the multiplier to decide whether to add, subtract, or shift the multiplicand, skipping runs of identical bits. This algorithm, introduced in , halves the average number of add operations compared to basic shift-and-add for random bit patterns. Division algorithms in , such as the , iteratively estimate bits by shifting the and , subtracting a shifted from the partial , and restoring the if the subtraction yields a negative result. The is built bit by bit, and the final is the last partial after all . Non-restoring improves efficiency by avoiding the restoration step; instead, it adds back the only when necessary in the next , using conditional or based on the sign of the partial . Both algorithms produce both the and , handling unsigned or signed through appropriate sign extensions. For integers exceeding the native word size of a , arbitrary-precision arithmetic is supported via software libraries that represent big integers as arrays of fixed-size limbs (e.g., 32-bit words). In , the BigInteger class implements this using a signed-magnitude representation with an array of ints for the magnitude, enabling operations like through schoolbook methods or faster Karatsuba for large values. These libraries manage carry propagation across array elements during operations, ensuring exact results without overflow limitations imposed by hardware integers.

Cardinality and Generalizations

Countable Infinity

The set of all integers \mathbb{Z} possesses the same cardinality as the set of natural numbers \mathbb{N}, denoted |\mathbb{Z}| = |\mathbb{N}| = \aleph_0, indicating that \mathbb{Z} is countably infinite. This equivalence establishes \mathbb{Z} as denumerable, allowing every integer to be paired uniquely with a natural number in a one-to-one correspondence. Georg Cantor introduced the concept of countability in his 1874 paper, where he demonstrated that sets like (and by extension, their subset of integers) can be enumerated via s with \mathbb{N}. An explicit f: \mathbb{N} \to \mathbb{Z} (with \mathbb{N} = \{0, 1, 2, \dots \}) is given by f(0) = 0, f(2n) = n for positive integers n \geq 1, and f(2n-1) = -n for n \geq 1. This mapping assigns even natural numbers (starting from 2) to positive integers, odd natural numbers (starting from 1) to negative integers, and 0 to itself, ensuring every integer is hit exactly once and every natural number is used precisely once. The countability of \mathbb{Z} can also be shown through an alternating enumeration: $0, 1, -1, 2, -2, 3, -3, \dots , which provides a from \mathbb{N} to \mathbb{Z}. Since there is an obvious injection from \mathbb{Z} to \mathbb{N} (via the bijection above) and a surjection in the reverse direction, the guarantees a exists, confirming equal . This denumerability contrasts sharply with the uncountability of the real numbers \mathbb{R}, whose $2^{\aleph_0} exceeds \aleph_0, as proven by in the same 1874 work; thus, while integers can be listed exhaustively, reals cannot. The countable infinity of \mathbb{Z} underpins foundational results in set theory, emphasizing that not all infinities are equivalent in size.

Integers in Number Theory Extensions

In algebraic number theory, the concept of integers extends beyond the rational integers \mathbb{Z} to finite field extensions K of the rational numbers \mathbb{Q}, known as number fields. The ring of integers \mathcal{O}_K of such a field K is defined as the integral closure of \mathbb{Z} in K, consisting of all elements \alpha \in K that are algebraic integers—roots of monic polynomials with coefficients in \mathbb{Z}. This construction generalizes the ordinary integers, capturing elements integral over \mathbb{Z} within the larger field, and forms a subring of K containing \mathbb{Z}. The foundational development of this notion traces back to Ernst Kummer's introduction of "ideal numbers" in the to resolve failures in cyclotomic fields while studying , though Kummer lacked a general theory of algebraic integers. Richard formalized the ring of algebraic integers in his 1871 supplement to Dirichlet's Vorlesungen über Zahlentheorie, defining them precisely as roots of monic polynomials over \mathbb{Z} and introducing ideals to restore in these rings. For a number field K of degree n = [K : \mathbb{Q}], \mathcal{O}_K is finitely generated as a \mathbb{Z}- of n, and its \Delta_K satisfies \Delta_K \equiv 0 or $1 \pmod{4}. A key property of \mathcal{O}_K is that it is always a : a Noetherian, integrally closed in which every nonzero is maximal. This ensures that every nonzero ideal in \mathcal{O}_K factors uniquely into a product of prime ideals, providing an arithmetic structure analogous to unique prime factorization in \mathbb{Z}, but for ideals rather than elements. The class number h_K, which measures the extent to which \mathcal{O}_K deviates from being a principal ideal domain (where every ideal is principal), is finite for all number fields, bounded by the Minkowski bound involving the discriminant and degree. Primes in \mathbb{Z} factor in \mathcal{O}_K according to how they interact with the minimal polynomial of a primitive element of K, with ramification occurring precisely when the prime divides \Delta_K. Explicit constructions of \mathcal{O}_K vary by field. For quadratic fields K = \mathbb{Q}(\sqrt{d}) with square-free integer d, \mathcal{O}_K = \mathbb{Z}[\sqrt{d}] if d \equiv 2, 3 \pmod{4}, and \mathcal{O}_K = \mathbb{Z}\left[\frac{1 + \sqrt{d}}{2}\right] if d \equiv 1 \pmod{4}. In cyclotomic fields K = \mathbb{Q}(\zeta_n) generated by a primitive nth root of unity \zeta_n, \mathcal{O}_K = \mathbb{Z}[\zeta_n]. For example, in the Gaussian integers \mathbb{Z} = \mathcal{O}_{\mathbb{Q}(i)}, unique factorization holds for elements (it is a PID), while in \mathcal{O}_{\mathbb{Q}(\sqrt{-5})} = \mathbb{Z}[\sqrt{-5}], the class number is 2, illustrating non-unique factorization: $6 = 2 \cdot 3 = (1 + \sqrt{-5})(1 - \sqrt{-5}), with these factors irreducible but not associates. The unit group of \mathcal{O}_K is finitely generated of rank r_1 + r_2 - 1, where r_1 and r_2 are the numbers of real and pairs of complex embeddings of K. These extensions enable the study of Diophantine equations and L-functions in broader arithmetic contexts.

References

  1. [1]
    [PDF] Basic properties of the integers
    The integers (a.k.a. the whole numbers) are the natural numbers, together with zero and the negatives of the natural numbers, and we will denote them by Z. So, ...
  2. [2]
    None
    ### Axiomatic Definition and Key Properties of the Integers
  3. [3]
    History of Integers - Ximera - The Ohio State University
    Jun 17, 2025 · We see the first evidence of negative numbers appearing sometime between BC and AD in Chinese mathematics, and around the th century AD in ...
  4. [4]
    [PDF] Contents 1 The Integers - Evan Dummit
    Our goal in this chapter is to define the integers axiomatically and to develop some basic properties of primes and divisibility.
  5. [5]
    Z -- from Wolfram MathWorld
    The doublestruck capital letter Z, Z , denotes the ring of integers ..., -2 , -1 , 0, 1, 2, .... The symbol derives from the German word Zahl, meaning "number".
  6. [6]
    NaturalNumbers - Computer Science
    The natural numbers are the set N = { 0, 1, 2, 3, .... }. These correspond to all possible sizes of finite sets; in a sense, the natural numbers are precisely ...
  7. [7]
    [PDF] 1.1 The Natural Numbers
    The elements of the set of natural numbers: N = {1, 2, 3, 4, 5, ...} are the numbers we use for counting. They come equipped with an ordering: 1 < 2 < 3 < 4 < ... ...
  8. [8]
    [PDF] chapter 6: the rational numbers q - CSUSM
    Before defining Q we define a related set Q which informally represents quotients of integers. The difference between Q and Q is that the latter consists of ...
  9. [9]
    [PDF] CS 2800: Discrete Structures
    the smallest ring containing the natural numbers. We will not have time to ... This is because we have not defined what / is on the integers! Addi ...
  10. [10]
    Integers | Brilliant Math & Science Wiki
    An integer is a number that does not have a fractional part. The set of integers is Z={⋯−4,−3,−2,−1,0,1,2,3,4...}.<|control11|><|separator|>
  11. [11]
    Z^+ -- from Wolfram MathWorld
    Z^+ The positive integers 1, 2, 3, ..., equivalent to N. See also Counting Number, N, Natural Number, Positive, Whole Number, Z, Z--, Z-*
  12. [12]
    Negative Integer -- from Wolfram MathWorld
    A negative integer is one of the integers -4, -3, -2, -1 obtained by negating the positive integers. The negative integers are commonly denoted Z^-.
  13. [13]
    Notation Convention for integer in a certain range
    Jan 29, 2018 · I am wondering what notation I should use when writing that some variable is an integer within some range. What is the most common way to do this?Standard notation for an integer range - Mathematics Stack ExchangeIs there a quick way to write say positive integers in an interval in ...More results from math.stackexchange.com
  14. [14]
    [PDF] Contents 2 Rings - Evan Dummit
    • Example: The integers Z are a commutative ring with identity. • Example: The set of even integers is a commutative ring that does not have an identity.
  15. [15]
    [PDF] 18.704 Supplementary Notes February 2, 2005 Fields This seminar ...
    Feb 2, 2005 · The integers are therefore a commutative ring. Axiom (10) is not satisfied, however: the non-zero element 2 of Z has no multiplicative inverse ...Missing: unity | Show results with:unity
  16. [16]
    IAAWA Fields of Fractions - UTK Math
    The rational numbers are certainly a field. In fact, it can be shown that the rationals are the smallest field that contains the integers. Given an integral ...
  17. [17]
    Divisible -- from Wolfram MathWorld
    A number n is said to be divisible by d if d is a divisor of n, denoted d|n ("d divides n"). The converse of d|n is p n ("p does not divide n").
  18. [18]
    Prime Number -- from Wolfram MathWorld
    More concisely, a prime number is a positive integer having exactly one positive divisor other than 1, meaning it is a number that cannot be factored.
  19. [19]
    Fundamental Theorem of Arithmetic -- from Wolfram MathWorld
    The fundamental theorem of arithmetic states that every positive integer (except the number 1) can be represented in exactly one way.
  20. [20]
    Greatest Common Divisor -- from Wolfram MathWorld
    positive integers. The Euclidean algorithm can be used to find the greatest common divisor of two integers and to find integers x and y such that ...
  21. [21]
    Euclidean Algorithm -- from Wolfram MathWorld
    The Euclidean algorithm, also called Euclid's algorithm, is an algorithm for finding the greatest common divisor of two numbers a and b.
  22. [22]
    Least Common Multiple -- from Wolfram MathWorld
    The least common multiple of two numbers a and b can be obtained by finding the prime factorization of each where the p_i s are all prime factors of a and b.
  23. [23]
    The Integers
    $$\integers$ is a totally ordered set: the order relationship has the property of trichotomy. For any $n,m \in \integers$, $n \lt m$ or $m \lt n$ or $n = m$. ...Missing: total | Show results with:total
  24. [24]
    [PDF] 1 We say that Z is an example of a ring, namely it has two operations ...
    For example, there are no integers between n and n + 1 for any n ∈ Z. Can you prove it just from these axioms? Is it possible to prove this fact without using.
  25. [25]
    SI242: What makes the integers different? Induction!
    We noted before that one way the integers are different than rationals and reals is that there is nothing in between 0 and 1. Let's see if the induction ...
  26. [26]
    [PDF] Well Ordering Principle: Chapter 2.1 – 2.3 - MIT OpenCourseWare
    The n can't be prime, because a prime by itself is considered a (length one) product of primes and no such products are in C. So n must be a product of two ...<|separator|>
  27. [27]
    section 1.1
    Definitions. Well-Ordering Principle: Every nonempty set S of non-negative integers contains a least element; that is, there is some integer a in S such that ...
  28. [28]
    1.1: An Introduction to the Integers - Mathematics LibreTexts
    Oct 6, 2021 · If \(a\) is an integer, then the absolute value of \(a\), written \(|a|\), is defined as the distance between the integer and zero on the number ...
  29. [29]
    Nonnegative Integer -- from Wolfram MathWorld
    An integer that is either 0 or positive, ie, a member of the set Z^*={0} union Z^+ , where Z-+ denotes the positive integers.Missing: definition | Show results with:definition
  30. [30]
    1.3: Integers - Mathematics LibreTexts
    Feb 13, 2022 · The absolute value of a number n is written as | n | and | n | ≥ 0 for all numbers. Absolute values are always greater than or equal to zero.
  31. [31]
    3.3: Q-R Theorem and Mod - Math LibreTexts
    Jan 1, 2024 · Absolute Value and Triangle Inequality Theorem ... For all real numbers x and y , the following inequality holds: | x + y | ≤ | x | + | y | .
  32. [32]
    [PDF] Section 2.2 Absolute Value and the Real Line - Purdue Math
    It can be shown that equality occurs in the Triangle Inequality if and only if ab > 0, which is equivalent to saying that a and b have the same sign. (See ...
  33. [33]
    [PDF] 6. Inequalities - CMU Math
    AM-GM. Let a1,a2,...,an be non-negative real numbers. Then. (a1a2 ··· an)1/n ≤ a1 + ··· + an n. , with equality if and only if all ai are equal. Cauchy ...
  34. [34]
    3.4: Using Cases in Proofs - Mathematics LibreTexts
    Sep 29, 2021 · Theorem 3.25 Let be a positive real number.​​ | x + y | ≤ | x | + | y | . This is know as the Triangle Inequality.
  35. [35]
    [PDF] The Peano Axioms
    (1) 0 is a natural number. (2) For every natural number n, the successor of n is also a natural number. We denote the successor of n by S(n).
  36. [36]
    [PDF] 1. Peano's Axioms and Natural Numbers
    Integers. We will briefly desribe the construction of integers and rational num- bers below and state various properties in the correct order and prove just ...
  37. [37]
    [PDF] A Construction of the Numbers: The Integers - MIT ESP
    We gave a formal definition of the natural numbers via an axiomatic system. These were the so-called Peano axioms. We inductively defined addition and ...
  38. [38]
    Set Theory (Stanford Encyclopedia of Philosophy)
    ### Summary of Set-Theoretic Construction of Integers
  39. [39]
    [PDF] Defining Functions on Equivalence Classes - University of Cambridge
    Let us examine the construction of the integers. Here A is the set of pairs of natural numbers. As mentioned above, the equivalence relation is (x, y) ∼ (u, ...
  40. [40]
    [PDF] CONSTRUCTION OF INTEGERS 0.1. Natural numbers. We assume ...
    Thus, by our definition, an integer is nothing but an equivalence class of ordered pairs of natural numbers, [(m, n)]∼. 0.5. Naturals among integers. We ...
  41. [41]
    [PDF] Constructing the Integers
    Officially, these equivalence classes are going to be “the integers.” Here, finally, is the definition. Definition ™. = = ™ œ Р ‚ СО ¶ . A member of is called ...<|control11|><|separator|>
  42. [42]
    [PDF] the grothendieck group k0
    There are several ways to construct the “Grothendieck group” of a mathematical object. We begin with the group completion version, because it has been the ...
  43. [43]
    integer in nLab
    ### Summary of Formal Constructions of Integers
  44. [44]
    [PDF] 1 Ancient Egypt - UCI Mathematics
    Ancient Egyptian math used Rhind/Ahmes and Moscow papyri, focused on practical problems, used hieroglyphic/hieratic notation, and had a base-two multiplication ...
  45. [45]
    [PDF] Euclid's Elements in the Modern Classroom - Harvard DASH
    In classical Greek geometry the numbers were 2,3,4,… and the unity 1. What we call negative numbers and zero were not yet accepted. Geometrical quantities ...
  46. [46]
    (PDF) BRAHMAGUPTA AND THE CONCEPT OF ZERO
    This paper attempts to reconstruct the possible reasoning process that led the Indian mathematician Brahmagupta in 628 AD to the formulation of two ...
  47. [47]
    [PDF] Fibonacci's Liber Abaci - mifami.org
    Leonardo makes frequent use of negative numbers in Liber abaci. We wish to emphasize that Leonardo was completely capable of conceiving of negative numbers ...
  48. [48]
    [PDF] 18 Dirichlet L-functions, primes in arithmetic progressions
    Nov 10, 2016 · We begin with Dirichlet's theorem on primes in arithmetic progressions, a result that predates the prime number theorem by sixty years. Theorem ...
  49. [49]
    [PDF] Untitled - ResearchGate
    I propose to study the historical context of PEANO's axioms by following, step by step, the process of their formulation and by considering them in relation ...
  50. [50]
    Frege's Theorem and Foundations for Arithmetic
    Jun 10, 1998 · Gottlob Frege formulated two logical systems in his attempts to define basic concepts of mathematics and to derive mathematical laws from the laws of logic.
  51. [51]
    Hilbert's Program - Stanford Encyclopedia of Philosophy
    Jul 31, 2003 · It calls for a formalization of all of mathematics in axiomatic form, together with a proof that this axiomatization of mathematics is consistent.
  52. [52]
    Gödel's Incompleteness Theorems
    Nov 11, 2013 · Gödel's two incompleteness theorems are among the most important results in modern logic, and have deep implications for various issues.
  53. [53]
    [PDF] CS 107 Lecture 2: Integer Representations and Bits / Bytes
    • In two's complement, we represent a positive number as itself, and ... binary representation of integers. EDSAC (1949). System/360 (1964). 8-bit one's ...<|control11|><|separator|>
  54. [54]
    N2218: Signed Integers are Two's Complement - Open Standards
    Mar 26, 2018 · There is One True Representation for signed integers, and that representation is two's complement.Introduction · Details · C Signed Integer Wording · Survey of Signed Integer...
  55. [55]
    [PDF] CS2110: Two's complement notation - CS@Cornell
    In the sign- magnitude representation, the leftmost bit is used for the sign: 0 means positive, 1 means negative. The other 7 bits contain the magnitude of the ...
  56. [56]
    [PDF] Chapter 2 Number Systems and Codes - RPI ECSE
    Slide 28 Two's Complement Number Range Like for unsigned binary, a N bit two's complement number can represent 2 decimal values ranging from -2n-1 to 2n-1 1, ...
  57. [57]
    Organization of Computer Systems: § 3: Computer Arithmetic
    This can be implemented in addition (subtraction) by letting a carry (borrow) occur into (from) the sign bit. To make a pictorial example of convenient size, ...
  58. [58]
    [PDF] Chapter 3 Arithmetic for Computers
    Is a 32-bit ALU as fast as a 1-bit ALU? Is there more than one way to do addition? two extremes: ripple carry and sum-of-products.
  59. [59]
    [PDF] chap4.pdf
    The basis for all of these implementations is the add-and-shift algorithm, which is similar to the way one multiplies using pencil and paper. For example, in ...
  60. [60]
    [PDF] 3.2.1. Shift-and-Add Multiplication
    Shift-and-add multiplication is similar to the multiplication performed by pa- per and pencil. This method adds the multiplicand X to itself Y times, ...
  61. [61]
    [PDF] Chapter 5 Division Division algorithms can be grouped into two ...
    This brings us to restoring division— algorithms, which restore the partial remainder to a positive condition before beginning the next quotient digit iteration ...
  62. [62]
    BigInteger (Java Platform SE 8 ) - Oracle Help Center
    Immutable arbitrary-precision integers. All operations behave as if BigIntegers were represented in two's-complement notation (like Java's primitive integer ...
  63. [63]
    Guide to Java BigInteger | Baeldung
    Jul 15, 2021 · It represents immutable arbitrary-precision integers. Before going further, let's remember that in Java all bytes are represented in the two's- ...
  64. [64]
    Aleph-0 -- from Wolfram MathWorld
    The set theory symbol aleph_0 refers to a set having the same cardinal number as the "small" infinite set of integers.
  65. [65]
    Ueber eine Eigenschaft des Inbegriffs aller reellen algebraischen ...
    Cantor, G.. "Ueber eine Eigenschaft des Inbegriffs aller reellen algebraischen Zahlen.." Journal für die reine und angewandte Mathematik 77 (1874): 258-262.Missing: PDF | Show results with:PDF
  66. [66]
    [PDF] Algebraic Number Theory - James Milne
    the ring of integers in the number field, the ideals and units in the ring of.
  67. [67]
    [PDF] Dedekind's 1871 version of the theory of ideals∗ - andrew.cmu.ed
    Mar 19, 2004 · [7] Richard Dedekind. Theory of Algebraic Integers. Cambridge University. Press, Cambridge, 1996. A translation of [4], translated and ...