Relating ℤ_[p]
to ZMod (p ^ n)
, aka ℤ/p^nℤ
. #
In this file we establish connections between the p
-adic integers ℤ_[p]
and the integers modulo powers of p
, ℤ/p^nℤ
, implemented as ZMod (p^n)
.
Main declarations #
We show that ℤ_[p]
has a ring homomorphism to ℤ/p^nℤ
for each n
.
The case for n = 1
is handled separately, since it is used in the general construction
and we may want to use it without the ^1
getting in the way.
PadicInt.toZMod
: ring homomorphism toℤ/pℤ
, implemented asZMod p
.PadicInt.toZModPow
: ring homomorphism toℤ/p^nℤ
, implemented asZMod (p^n)
.PadicInt.ker_toZMod
/PadicInt.ker_toZModPow
: the kernels of these maps are the ideals generated byp^n
PadicInt.residueField
shows that the residue field ofℤ_[p]
is isomorhic to ``ℤ/pℤ`.
We also establish the universal property of ℤ_[p]
as a projective limit.
Given a family of compatible ring homomorphisms f_k : R → ℤ/p^nℤ
,
there is a unique limit R → ℤ_[p]
PadicInt.lift
: the limit functionPadicInt.lift_spec
/PadicInt.lift_unique
: the universal property
Implementation notes #
The constructions of the ring homomorphisms go through an auxiliary constructor
PadicInt.toZModHom
, which removes some boilerplate code.
modPart p r
is an integer that satisfies
‖(r - modPart p r : ℚ_[p])‖ < 1
when ‖(r : ℚ_[p])‖ ≤ 1
,
see PadicInt.norm_sub_modPart
.
It is the unique non-negative integer that is < p
with this property.
(Note that this definition assumes r : ℚ
.
See PadicInt.zmodRepr
for a version that takes values in ℕ
and works for arbitrary x : ℤ_[p]
.)
Equations
- PadicInt.modPart p r = r.num * r.den.gcdA p % ↑p
Instances For
zmod_repr x
is the unique natural number smaller than p
satisfying ‖(x - zmod_repr x : ℤ_[p])‖ < 1
.
Equations
- x.zmodRepr = Classical.choose ⋯
Instances For
toZModHom
is an auxiliary constructor for creating ring homs from ℤ_[p]
to ZMod v
.
Equations
- PadicInt.toZModHom v f f_spec f_congr = { toFun := fun (x : ℤ_[p]) => ↑(f x), map_one' := ⋯, map_mul' := ⋯, map_zero' := ⋯, map_add' := ⋯ }
Instances For
z - (toZMod z : ℤ_[p])
is contained in the maximal ideal of ℤ_[p]
, for every z : ℤ_[p]
.
The coercion from ZMod p
to ℤ_[p]
is ZMod.cast
,
which coerces ZMod p
into arbitrary rings.
This is unfortunate, but a consequence of the fact that we allow ZMod p
to coerce to rings of arbitrary characteristic, instead of only rings of characteristic p
.
This coercion is only a ring homomorphism if it coerces into a ring whose characteristic divides
p
. While this is not the case here we can still make use of the coercion.
The equivalence between the residue field of the p
-adic integers and ℤ/pℤ
Equations
- PadicInt.residueField = cast ⋯ (⋯ ▸ RingHom.quotientKerEquivOfSurjective ⋯)
Instances For
A ring hom from ℤ_[p]
to ZMod (p^n)
, with underlying function PadicInt.appr n
.
Equations
- PadicInt.toZModPow n = PadicInt.toZModHom (p ^ n) (fun (x : ℤ_[p]) => x.appr n) ⋯ ⋯
Instances For
Alias of PadicInt.denseRange_natCast
.
Alias of PadicInt.denseRange_intCast
.
Universal property as projective limit #
Given a family of ring homs f : Π n : ℕ, R →+* ZMod (p ^ n)
,
nthHom f r
is an integer-valued sequence
whose n
th value is the unique integer k
such that 0 ≤ k < p ^ n
and f n r = (k : ZMod (p ^ n))
.
Equations
- PadicInt.nthHom f r n = ↑((f n) r).val
Instances For
nthHomSeq f_compat r
bundles PadicInt.nthHom f r
as a Cauchy sequence of rationals with respect to the p
-adic norm.
The n
th value of the sequence is ((f n r).val : ℚ)
.
Equations
- PadicInt.nthHomSeq f_compat r = ⟨fun (n : ℕ) => ↑(PadicInt.nthHom f r n), ⋯⟩
Instances For
limNthHom f_compat r
is the limit of a sequence f
of compatible ring homs R →+* ZMod (p^k)
.
This is itself a ring hom: see PadicInt.lift
.
Equations
- PadicInt.limNthHom f_compat r = PadicInt.ofIntSeq (PadicInt.nthHom f r) ⋯
Instances For
lift f_compat
is the limit of a sequence f
of compatible ring homs R →+* ZMod (p^k)
,
with the equality lift f_compat r = PadicInt.limNthHom f_compat r
.
Equations
- PadicInt.lift f_compat = { toFun := PadicInt.limNthHom f_compat, map_one' := ⋯, map_mul' := ⋯, map_zero' := ⋯, map_add' := ⋯ }
Instances For
One part of the universal property of ℤ_[p]
as a projective limit.
See also PadicInt.lift_unique
.
One part of the universal property of ℤ_[p]
as a projective limit.
See also PadicInt.lift_spec
.