Sign type #
This file defines the type of signs $\{-1, 0, 1\}$ and its basic arithmetic instances.
The less-than-or-equal relation on signs.
- of_neg (a : SignType) : neg.LE a
- zero : SignType.zero.LE SignType.zero
- of_pos (a : SignType) : a.LE pos
Instances For
SignType is equivalent to Fin 3.
Instances For
Turn a SignType into zero, one, or minus one. This is a coercion instance.
Instances For
This can't be a CoeTail or Coe instance because we don't want it to fire when SignType isn't
involved in the coercion (or CoeHead or CoeOut because of outParams). The only other
user-exposed option is CoeDep then, which allows us to match on both given and expected type.
Casting out of SignType respects composition with functions preserving 0, 1, -1.
Casting out of SignType respects composition with suitable bundled homomorphism types.
The sign of an element is 1 if it's positive, -1 if negative, 0 otherwise.
Instances For
SignType.sign respects strictly monotone zero-preserving maps.