Documentation

CslibFrontier.Computability.PolyTime.GaloisRingUnits

Newton inversion inverts every unit of a Galois ring #

CslibFrontier/Computability/PolyTime/GaloisRingArithmetic.lean computes in A_p = (ℤ / 2 ^ p)[U] / (f) on coefficient lists, and inverts by p Newton steps from the seed x ^ (2 ^ e - 2), e = deg f (GaloisRingArith.inv). Its correctness (GaloisRingArith.val_mul_inv) assumes that the seed inverts x modulo 2. This file discharges that assumption when f is irreducible modulo 2, so that A_p is the Galois ring GaloisRing 2 p f.

Reduction modulo 2 maps A_p onto the field 𝔽_2[U] / (f) with 2 ^ e elements, where every nonzero r has r ^ (2 ^ e - 1) = 1. A unit y reduces to a nonzero element, so y y ^ (2 ^ e - 2) - 1 lies in the kernel (2) of reduction (GaloisRing.ker_residue). The seed is computed natively (GaloisRingArith.seed), so no inversion modulo 2 is needed separately.

So GaloisRingArith.inv inverts every unit, that is every element that is nonzero modulo 2 (GaloisRing.isUnit_iff), in polynomial time (GaloisRingArith.computableInPolyTime_inv). This is the inversion of units by inversion modulo two and Newton lifting of [OAI26k] (Appendix D.4.1, p. 58), with ℓ = 1.

Main results #

References #

monicOf fl has degree fl.length.

A_p is the Galois ring GaloisRing 2 p (monicOf fl).

theorem Cslib.GaloisRingArith.exists_mul_pow_eq_one_add_two_mul {p : ℕ} {fl : List ℕ} [NeZero p] (hirr : Irreducible (Polynomial.map (Int.castRingHom (ZMod 2)) (monicOf fl))) {y : Ring p fl} (hy : IsUnit y) :
∃ (w : Ring p fl), y * y ^ (2 ^ fl.length - 2) = 1 + 2 * w

The seed inverts a unit modulo 2. In a Galois ring of rank e, the residue field has 2 ^ e elements, so a unit y satisfies y y ^ (2 ^ e - 2) = 1 + 2 w.

theorem Cslib.GaloisRingArith.val_mul_inv_of_isUnit {p : ℕ} {fl : List ℕ} (hirr : Irreducible (Polynomial.map (Int.castRingHom (ZMod 2)) (monicOf fl))) {x : List ℕ} (hx : IsUnit (val p fl x)) :
val p fl x * val p fl (inv p fl x) = 1

Newton inversion inverts every unit of the Galois ring A_p, f irreducible modulo 2.

theorem Cslib.GaloisRingArith.val_inv_of_isUnit {p : ℕ} {fl : List ℕ} (hirr : Irreducible (Polynomial.map (Int.castRingHom (ZMod 2)) (monicOf fl))) {x : List ℕ} (hx : IsUnit (val p fl x)) :
val p fl (inv p fl x) = Ring.inverse (val p fl x)

Newton inversion computes the inverse of a unit.

theorem Cslib.GaloisRingArith.val_mul_inv_of_residue_ne_zero {p : ℕ} {fl : List ℕ} [NeZero p] (hirr : Irreducible (Polynomial.map (Int.castRingHom (ZMod 2)) (monicOf fl))) {x : List ℕ} (hx : (GaloisRing.residue 2 p (monicOf fl)) (val p fl x) ≠ 0) :
val p fl x * val p fl (inv p fl x) = 1

Newton inversion inverts every element that is nonzero modulo 2.