Section NumIntegralDomainTheory.
Variable R : numDomainType.
Implicit Types (V : normedZmodType R) (x y z t : R).
(* Lemmas from the signature (reexported from internals). *)
Definition ler_norm_add V (x y : V) : `|x + y| <= `|x| + `|y| :=
ler_norm_add x y.
Definition addr_gt0 x y : 0 < x -> 0 < y -> 0 < x + y := @addr_gt0 R x y.
Definition normr0_eq0 V (x : V) : `|x| = 0 -> x = 0 := @normr0_eq0 R V x.
Definition ger_leVge x y : 0 <= x -> 0 <= y -> (x <= y) || (y <= x) :=
@ger_leVge R x y.
Definition normrM : {morph norm : x y / (x : R) * y} := @normrM R.
Definition ler_def x y : (x <= y) = (`|y - x| == y - x) := ler_def x y.
Definition normrMn V (x : V) n : `|x *+ n| = `|x| *+ n := normrMn x n.
Definition normrN V (x : V) : `|- x| = `|x| := normrN x.
(* Predicate definitions. *)
(* General properties of <= and < *)
Hint Resolve ler01 ltr01 ler0n : core.
(* Ordered ring properties. *)
Definition lter01 := (ler01, ltr01).
(* Properties of the real subset. *)
Variant ger0_xor_lt0 (x : R) : R -> R -> R -> R -> R ->
bool -> bool -> Set :=
| Ger0NotLt0 of 0 <= x : ger0_xor_lt0 x 0 0 x x x false true
| Ltr0NotGe0 of x < 0  : ger0_xor_lt0 x x x 0 0 (- x) true false.
Variant ler0_xor_gt0 (x : R) : R -> R -> R -> R -> R ->
bool -> bool -> Set :=
| Ler0NotLe0 of x <= 0 : ler0_xor_gt0 x x x 0 0 (- x) false true
| Gtr0NotGt0 of 0 < x  : ler0_xor_gt0 x 0 0 x x x true false.
Variant comparer0 x : R -> R -> R -> R -> R ->
bool -> bool -> bool -> bool -> bool -> bool -> Set :=
| ComparerGt0 of 0 < x : comparer0 x 0 0 x x x false false false true false true
| ComparerLt0 of x < 0 : comparer0 x x x 0 0 (- x) false false true false true false
| ComparerEq0 of x = 0 : comparer0 x 0 0 0 0 0 true true true true false false.

Lemma real_ltgt0P x : x \is real ->
comparer0 x (min 0 x) (min x 0) (max 0 x) (max x 0)
`|x| (0 == x) (x == 0) (x <= 0) (0 <= x) (x < 0) (x > 0).