Documentation

HexModArithMathlib.WordMod

Interpret an executable WordMod residue as a Mathlib ZMod class.

Equations
Instances For
    @[simp]

    The canonical representative of a transferred class is the residue's value.

    toZMod is injective: its ZMod value is the residue, which pins the word.

    @[simp]
    theorem HexModArithMathlib.WordMod.toZMod_add {m : UInt64} {ctx : MontCtx m} (a b : Hex.WordMod ctx) :
    toZMod (a + b) = toZMod a + toZMod b
    @[simp]
    theorem HexModArithMathlib.WordMod.toZMod_mul {m : UInt64} {ctx : MontCtx m} (a b : Hex.WordMod ctx) :
    toZMod (a * b) = toZMod a * toZMod b
    @[simp]
    @[simp]
    theorem HexModArithMathlib.WordMod.toZMod_sub {m : UInt64} {ctx : MontCtx m} (a b : Hex.WordMod ctx) :
    toZMod (a - b) = toZMod a - toZMod b
    @[simp]
    theorem HexModArithMathlib.WordMod.toZMod_natCast {m : UInt64} {ctx : MontCtx m} (n : ) :
    toZMod n = n
    @[simp]
    theorem HexModArithMathlib.WordMod.toZMod_intCast {m : UInt64} {ctx : MontCtx m} (z : ) :
    toZMod z = z
    theorem HexModArithMathlib.WordMod.toZMod_pow {m : UInt64} {ctx : MontCtx m} (a : Hex.WordMod ctx) (n : ) :
    toZMod (a ^ n) = toZMod a ^ n
    @[instance_reducible]

    The executable WordMod residue ring is a Mathlib CommRing, pulled back along the injective toZMod.

    Equations

    toZMod packaged as a ring homomorphism.

    Equations
    Instances For