---
tag: 0NV6E43P4A
kind: statement
role: theorem
name: Z/pZ is a field for p prime
msc: [11A07]
uses: [0QA8CHH8MG, 0EBE031B8E]
sources:
  - url: https://en.wikipedia.org/wiki/Modular_arithmetic
    locator: Integers modulo m
---

## Statement

Let $n \ge 2$ be an integer.
The ring $\mathbb{Z}/n\mathbb{Z}$ of integers modulo $n$ is a [[field|0QA8CHH8MG]] if and only if $n$ is a prime number.

## Remarks

If $n = a b$ with $1 < a, b < n$, then the classes of $a$ and $b$ are nonzero and their product is $0$. So $\mathbb{Z}/n\mathbb{Z}$ is not an integral domain.
If $n = p$ is prime and $p \nmid a$, then Bézout's identity gives $a x + p y = 1$ for some integers $x, y$. So $x$ is an inverse of $a$ modulo $p$.
The field $\mathbb{Z}/p\mathbb{Z}$ is often written $\mathbb{F}_p$. It is the smallest [[finite field|08RTDHX1SK]] of characteristic $p$.

## Explanations

### L1 human

Modulo $5$, every nonzero class has an inverse: $1 \cdot 1 = 1$, $2 \cdot 3 = 6 \equiv 1$ and $4 \cdot 4 = 16 \equiv 1$.
Modulo $6$, the class of $2$ has no inverse, because $2 x$ is always even.
Division works modulo $n$ exactly when $n$ is prime.
