The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V02. Numbers

Mathlib.Data.ZMod.Units

19 declarations and 5 deprecated aliases. Mathlib docs · Source

theorem ZMod.unitsMap.congr_simp E1 #

∀ {n m : ℕ} (hm : n ∣ m), ZMod.unitsMap hm = ZMod.unitsMap hm

theorem ZMod.unitOfIsCoprime.congr_simp E1 #

∀ {m : ℕ} (n n_1 : ℤ) (e_n : n = n_1) (h : IsCoprime n ↑m), ZMod.unitOfIsCoprime n h = ZMod.unitOfIsCoprime n_1 ⋯

def ZMod.unitsMap E1 #

{n m : ℕ} → n ∣ m → (ZMod m)ˣ →* (ZMod n)ˣ

unitsMap is a group homomorphism that maps units of ZMod m to units of ZMod n when n divides m.

theorem ZMod.unitsMap_def E0 #

∀ {n m : ℕ} (hm : n ∣ m), ZMod.unitsMap hm = Units.map ↑(ZMod.castHom hm (ZMod n))

theorem ZMod.unitsMap_comp E1 #

∀ {n m d : ℕ} (hm : n ∣ m) (hd : m ∣ d), (ZMod.unitsMap hm).comp (ZMod.unitsMap hd) = ZMod.unitsMap ⋯

theorem ZMod.unitsMap_self E0 #

∀ (n : ℕ), ZMod.unitsMap ⋯ = MonoidHom.id (ZMod n)ˣ

theorem ZMod.unitsMap_val E0 #

∀ {n m : ℕ} (h : n ∣ m) (a : (ZMod m)ˣ), ↑((ZMod.unitsMap h) a) = (↑a).cast

unitsMap_val shows that coercing from (ZMod m)ˣ to ZMod n gives the same result when going via (ZMod n)ˣ and ZMod m.

theorem ZMod.isUnit_cast_of_dvd E1 #

∀ {n m : ℕ}, n ∣ m → ∀ (a : (ZMod m)ˣ), IsUnit (↑a).cast

theorem ZMod.unitsMap_surjective E1 #

∀ {n m : ℕ} [hm : NeZero m] (h : n ∣ m), Function.Surjective ⇑(ZMod.unitsMap h)

theorem ZMod.not_isUnit_of_mem_primeFactors E1 #

∀ {n p : ℕ}, p ∈ n.primeFactors → ¬IsUnit ↑p

theorem ZMod.intCast_mul_inv_eq_one E1 #

∀ {n : ℕ} {x : ℤ}, IsCoprime x ↑n → ↑x * (↑x)⁻¹ = 1

theorem ZMod.intCast_inv_mul_eq_one E1 #

∀ {n : ℕ} {x : ℤ}, IsCoprime x ↑n → (↑x)⁻¹ * ↑x = 1

theorem ZMod.intCast_mul_val_inv E1 #

∀ {n : ℕ} [NeZero n] {m : ℤ}, IsCoprime m ↑n → ↑m * ↑(↑m)⁻¹.val = 1

theorem ZMod.intCast_val_inv_mul E1 #

∀ {n : ℕ} [NeZero n] {m : ℤ}, IsCoprime m ↑n → ↑(↑m)⁻¹.val * ↑m = 1

def ZMod.unitOfIsCoprime E1 #

{m : ℕ} → (n : ℤ) → IsCoprime n ↑m → (ZMod m)ˣ

The unit of ZMod m associated with an integer prime to n.

theorem ZMod.coe_unitOfIsCoprime E0 #

∀ {m : ℕ} (n : ℤ) (h : IsCoprime n ↑m), ↑(ZMod.unitOfIsCoprime n h) = ↑n

theorem ZMod.isUnit_inv E1 #

∀ {m : ℕ} {n : ℤ}, IsUnit ↑n → IsUnit (↑n)⁻¹

theorem ZMod.isUnit_intCast_iff_isCoprime E1 #

∀ (n : ℤ) (m : ℕ), IsUnit ↑n ↔ IsCoprime (↑m) n

instance ZMod.instFiniteZModUnits E0 #

∀ (n : ℕ), Finite (ZMod n)ˣ

For each n ≥ 0, the unit group of ZMod n is finite.

Deprecated aliases

NameNew nameSince
ZMod.coe_int_inv_mul_eq_oneZMod.intCast_inv_mul_eq_one2026-10-27
ZMod.coe_int_isUnit_iff_isCoprimeZMod.isUnit_intCast_iff_isCoprime2026-10-27
ZMod.coe_int_mul_inv_eq_oneZMod.intCast_mul_inv_eq_one2026-10-27
ZMod.coe_int_mul_val_invZMod.intCast_mul_val_inv2026-10-27
ZMod.coe_int_val_inv_mulZMod.intCast_val_inv_mul2026-10-27