Documentation

TauCeti.Data.ZMod.Four

The carry from โ„ค/4 to ๐”ฝโ‚‚ #

A residue x modulo four has canonical representative x.val โˆˆ {0, 1, 2, 3}, whose binary digits are x mod 2 and the carry โŒŠx.val / 2โŒ‹. Reducing the carry modulo two gives the function ZMod.carryFour : โ„ค/4 โ†’ ๐”ฝโ‚‚. Its failure to be additive is measured by the product of the residues modulo two: โŒŠ(u + v)/2โŒ‹ = โŒŠu/2โŒ‹ + โŒŠv/2โŒ‹ + (u mod 2)(v mod 2). This is the identity behind the vanishing of the cup square of a class of Hยน(G, ๐”ฝโ‚‚) that lifts to a character to โ„ค/4.

Main results #

def ZMod.carryFour (x : ZMod 4) :

The carry โŒŠx.val / 2โŒ‹ : โ„ค/4 โ†’ ๐”ฝโ‚‚: the binary digit of weight two of the canonical representative of a residue modulo four.

Equations
Instances For
    @[simp]

    The carry of 0 is 0.

    @[simp]

    The carry identity in โ„ค/4: โŒŠ(u + v)/2โŒ‹ = โŒŠu/2โŒ‹ + โŒŠv/2โŒ‹ + (u mod 2)(v mod 2) in ๐”ฝโ‚‚.

    theorem ZMod.cast_add_two_mul_cast_sub_mul (u v s t : ZMod 2) :
    (u + v).cast + 2 * (s + t - u * v).cast = u.cast + 2 * s.cast + (v.cast + 2 * t.cast)

    The lift (u, s) โ†ฆ u + 2s of two residues modulo two to โ„ค/4 is additive up to the carry: (u + v) + 2 (s + t - u v) = (u + 2 s) + (v + 2 t) in โ„ค/4, where the residues are lifted through ZMod.cast. This is the identity that turns a character G โ†’ ๐”ฝโ‚‚ with vanishing cup square into a character G โ†’ โ„ค/4.

    @[simp]
    theorem ZMod.cast_cast_add_two_mul_cast (u s : ZMod 2) :
    (u.cast + 2 * s.cast).cast = u

    The lift u + 2s of a pair of residues modulo two reduces to u modulo 2.