Variant sgr_val x : R -> bool -> bool -> bool -> bool -> bool -> bool
-> bool -> bool -> bool -> bool -> bool -> bool -> R -> Set :=
| SgrNull of x = 0 : sgr_val x 0 true true true true false false
true false false true false false 0
| SgrPos of x > 0 : sgr_val x x false false true false false true
false false true false false true 1
| SgrNeg of x < 0 : sgr_val x (- x) false true false false true false
false true false false true false (-1).

Lemma sgrP x :
sgr_val x `|x| (0 == x) (x <= 0) (0 <= x) (x == 0) (x < 0) (0 < x)
(0 == sg x) (-1 == sg x) (1 == sg x)
(sg x == 0)  (sg x == -1) (sg x == 1) (sg x).