Documentation

Transfer.Examples.CoqEAL.BinInt

CoqEAL binint, ported to Lean — sign + magnitude refines ℤ #

CoqEAL's binint refines MathComp integers to a signed representation. Here a Bool × List Bool — a sign bit (true = negative) with a little-endian magnitude — refines ℤ via toInt, reusing BinNat.toNat for the magnitude. The concrete sign flip binNeg refines ℤ negation (the CoqEAL Rneg square).

The relation is non-injective (+0 and -0 both denote 0), a map-level refinement — the same shape as the companion binnat, seqpoly, and seqmatrix data refinements.

@[reducible, inline]

A sign bit (true = negative) with a little-endian magnitude, refining ℤ.

Equations
Instances For

    Concrete negation: flip the sign bit.

    Equations
    Instances For

      The CoqEAL Rneg refinement square. The concrete sign flip refines ℤ negation: toInt (binNeg x) = -(toInt x).