Section FinGroup.
Variables (R : numDomainType) (gT : finGroupType).
Implicit Types G : {group gT}.
Definition midf_lte := (midf_le, midf_lt).
(* The AGM, unscaled but without the nth root. *)
Implicit Type p : {poly F}.
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).