Built with Alectryon, running Coq+SerAPI v8.15.0+0.15.0. Bubbles () indicate interactive fragments: hover for details, tap to reveal contents. Use Ctrl+↑Ctrl+↓ to navigate, Ctrl+🖱️ to focus. On Mac, use ⌘ instead of Ctrl.
Notation"_ + _" was already used in scope nat_scope.
[notation-overridden,parsing]
Notation"_ - _" was already used in scope nat_scope.
[notation-overridden,parsing]
Notation"_ <= _" was already used in scope nat_scope.
[notation-overridden,parsing]
Notation"_ < _" was already used in scope nat_scope.
[notation-overridden,parsing]
Notation"_ >= _" was already used in scope nat_scope.
[notation-overridden,parsing]
Notation"_ > _" was already used in scope nat_scope.
[notation-overridden,parsing]
Notation"_ <= _ <= _" was already used in scope
nat_scope. [notation-overridden,parsing]
Notation"_ < _ <= _" was already used in scope
nat_scope. [notation-overridden,parsing]
Notation"_ <= _ < _" was already used in scope
nat_scope. [notation-overridden,parsing]
Notation"_ < _ < _" was already used in scope
nat_scope. [notation-overridden,parsing]
Notation"_ * _" was already used in scope nat_scope.
[notation-overridden,parsing]
New coercion path [GRing.subring_closedM;
GRing.smulr_closedN] : GRing.subring_closed >-> GRing.oppr_closed is ambiguous with existing
[GRing.subring_closedB; GRing.zmod_closedN] : GRing.subring_closed >-> GRing.oppr_closed.
[ambiguous-paths,typechecker]
New coercion path [GRing.subring_closed_semi;
GRing.semiring_closedM] : GRing.subring_closed >-> GRing.mulr_closed is ambiguous with existing
[GRing.subring_closedM; GRing.smulr_closedM] : GRing.subring_closed >-> GRing.mulr_closed.
New coercion path [GRing.subring_closed_semi;
GRing.semiring_closedD] : GRing.subring_closed >-> GRing.addr_closed is ambiguous with existing
[GRing.subring_closedB; GRing.zmod_closedD] : GRing.subring_closed >-> GRing.addr_closed.
[ambiguous-paths,typechecker]
New coercion path [GRing.sdivr_closed_div;
GRing.divr_closedM] : GRing.sdivr_closed >-> GRing.mulr_closed is ambiguous with existing
[GRing.sdivr_closedM; GRing.smulr_closedM] : GRing.sdivr_closed >-> GRing.mulr_closed.
[ambiguous-paths,typechecker]
New coercion path [GRing.subalg_closedBM;
GRing.subring_closedB] : GRing.subalg_closed >-> GRing.zmod_closed is ambiguous with existing
[GRing.subalg_closedZ; GRing.submod_closedB] : GRing.subalg_closed >-> GRing.zmod_closed.
[ambiguous-paths,typechecker]
New coercion path [GRing.divring_closed_div;
GRing.sdivr_closedM] : GRing.divring_closed >-> GRing.smulr_closed is ambiguous with existing
[GRing.divring_closedBM; GRing.subring_closedM] : GRing.divring_closed >-> GRing.smulr_closed.
[ambiguous-paths,typechecker]
New coercion path [GRing.divalg_closedBdiv;
GRing.divring_closedBM] : GRing.divalg_closed >-> GRing.subring_closed is ambiguous with existing
[GRing.divalg_closedZ; GRing.subalg_closedBM] : GRing.divalg_closed >-> GRing.subring_closed.
[ambiguous-paths,typechecker]
New coercion path [GRing.Pred.subring_smul;
GRing.Pred.smul_mul] : GRing.Pred.subring >-> GRing.Pred.mul is ambiguous with existing
[GRing.Pred.subring_semi; GRing.Pred.semiring_mul] : GRing.Pred.subring >-> GRing.Pred.mul.
[ambiguous-paths,typechecker]
Notation"_ \* _" was already used in scope
ring_scope. [notation-overridden,parsing]
Notation"\- _" was already used in scope ring_scope.
[notation-overridden,parsing]
(******************************************************************************)(* This file develops tools to make the manipulation of numbers with a known *)(* sign easier, thanks to canonical structures. This adds types like *)(* {posnum R} for positive values in R, a notation e%:pos that infers the *)(* positivity of expression e according to existing canonical instances and *)(* %:num to cast back from type {posnum R} to R. *)(* For instance, given x, y : {posnum R}, we have *)(* ((x%:num + y%:num) / 2)%:pos : {posnum R} automatically inferred. *)(* *)(* * types for values with known sign *)(* {posnum R} == interface type for elements in R that are positive; R *)(* must have a zmodType structure. *)(* Allows to solve automatically goals of the form x > 0 if *)(* x is canonically a {posnum R}. {posnum R} is canonically *)(* stable by common operations. All positive natural numbers *)(* ((n.+1)%:R) are also canonically in {posnum R} *)(* {nonneg R} == interface types for elements in R that are non-negative; *)(* R must have a zmodType structure. Automatically solves *)(* goals of the form x >= 0. {nonneg R} is stable by *)(* common operations. All natural numbers n%:R are also *)(* canonically in {nonneg R}. *)(* {compare x0 & nz & cond} == more generic type of values comparing to *)(* x0 : T according to nz and cond (see below). T must have *)(* a porderType structure. This type is shown to be a *)(* porderType. It is also an orderTpe, as soon as T is a *)(* numDomainType. *)(* {num R & nz & cond} == {compare 0%R : R & nz & cond}. T must have a *)(* zmodType structure. *)(* {= x0} == {compare x0 & ?=0 & =0} *)(* {= x0 : T} == same with an explicit type T *)(* {> x0} == {compare x0 & !=0 & >=0} *)(* {> x0 : T} == same with an explicit type T *)(* {< x0} == {compare x0 & !=0 & <=0} *)(* {< x0 : T} == same with an explicit type T *)(* {>= x0} == {compare x0 & ?=0 & >=0} *)(* {>= x0 : T} == same with an explicit type T *)(* {<= x0} == {compare x0 & ?=0 & <=0} *)(* {<= x0 : T} == same with an explicit type T *)(* {>=< x0} == {compare x0 & ?=0 & >=<0} *)(* {>=< x0 : T} == same with an explicit type T *)(* {>< x0} == {compare x0 & !=0 & >=<0} *)(* {>< x0 : T} == same with an explicit type T *)(* {!= x0} == {compare x0 & !=0 & >?<0} *)(* {!= x0 : T} == same with an explicit type T *)(* {?= x0} == {compare x0 & ?=0 & >?<0} *)(* {?= x0 : T} == same with an explicit type T *)(* *)(* * casts from/to values with known sign *)(* x%:pos == explicitly casts x to {posnum R}, triggers the inference *)(* of a {posnum R} structure for x. *)(* x%:nng == explicitly casts x to {nonneg R}, triggers the inference *)(* of a {nonneg R} structure for x. *)(* x%:sgn == explicitly casts x to the most precise known *)(* {compare x0 & nz & cond} according to existing canonical *)(* instances. *)(* x%:num == explicit cast from {compare x0 & nz & cond} to R. In *)(* particular this works from {posnum R} and {nonneg R} to R.*)(* x%:posnum == explicit cast from {posnum R} to R. *)(* x%:nngnum == explicit cast from {nonneg R} to R. *)(* *)(* * nullity conditions nz *)(* All nz above can be the following (in scope snum_nullity_scope delimited *)(* by %snum_nullity) *)(* !=0 == to encode x != 0 *)(* ?=0 == unknown nullity *)(* *)(* * reality conditions cond *)(* All cond above can be the following (in scope snum_sign_scope delimited by *)(* by %snum_sign) *)(* =0 == to encode x == 0 *)(* >=0 == to encode x >= 0 *)(* <=0 == to encode x <= 0 *)(* >=<0 == to encode x >=< 0 *)(* >?<0 == unknown reality *)(* *)(* * sign proofs *)(* [sgn of x] == proof that x is of sign inferred by x%:sgn *)(* [gt0 of x] == proof that x > 0 *)(* [lt0 of x] == proof that x < 0 *)(* [ge0 of x] == proof that x >= 0 *)(* [le0 of x] == proof that x <= 0 *)(* [cmp0 of x] == proof that 0 >=< x *)(* [neq0 of x] == proof that x != 0 *)(* *)(* * constructors *)(* PosNum xgt0 == builds a {posnum R} from a proof xgt0 : x > 0 where x : R *)(* NngNum xge0 == builds a {posnum R} from a proof xgt0 : x >= 0 where x : R*)(* Signed.mk p == builds a {compare x0 & nz & cond} from a proof p that *)(* some x satisfies sign conditions encoded by nz and cond *)(* *)(* * misc *)(* !! x == triggers pretyping to fill the holes of the term x. The *)(* main use case is to trigger typeclass inference in the *)(* body of a ssreflect have := !! body. *)(* Credits: Enrico Tassi. *)(* 2 == notation for 2%:R. *)(* *)(* --> A number of canonical instances are provided for common operations, if *)(* your favorite operator is missing, look below for examples on how to add *)(* the appropriate Canonical. *)(* --> Canonical instances are also provided according to types, as a *)(* fallback when no known operator appears in the expression. Look to *)(* nat_snum below for an example on how to add your favorite type. *)(******************************************************************************)Reserved Notation"{ 'compare' x0 & nz & cond }"
(at level0, x0 at level200, nz at level200,
format"{ 'compare' x0 & nz & cond }").Reserved Notation"{ 'num' R & nz & cond }"
(at level0, R at level200, nz at level200,
format"{ 'num' R & nz & cond }").Reserved Notation"{ = x0 }" (at level0, format"{ = x0 }").Reserved Notation"{ > x0 }" (at level0, format"{ > x0 }").Reserved Notation"{ < x0 }" (at level0, format"{ < x0 }").Reserved Notation"{ >= x0 }" (at level0, format"{ >= x0 }").Reserved Notation"{ <= x0 }" (at level0, format"{ <= x0 }").Reserved Notation"{ >=< x0 }" (at level0, format"{ >=< x0 }").Reserved Notation"{ >< x0 }" (at level0, format"{ >< x0 }").Reserved Notation"{ != x0 }" (at level0, format"{ != x0 }").Reserved Notation"{ ?= x0 }" (at level0, format"{ ?= x0 }").Reserved Notation"{ = x0 : T }" (at level0, format"{ = x0 : T }").Reserved Notation"{ > x0 : T }" (at level0, format"{ > x0 : T }").Reserved Notation"{ < x0 : T }" (at level0, format"{ < x0 : T }").Reserved Notation"{ >= x0 : T }" (at level0, format"{ >= x0 : T }").Reserved Notation"{ <= x0 : T }" (at level0, format"{ <= x0 : T }").Reserved Notation"{ >=< x0 : T }" (at level0, format"{ >=< x0 : T }").Reserved Notation"{ >< x0 : T }" (at level0, format"{ >< x0 : T }").Reserved Notation"{ != x0 : T }" (at level0, format"{ != x0 : T }").Reserved Notation"{ ?= x0 : T }" (at level0, format"{ ?= x0 : T }").Reserved Notation"=0" (at level0, format"=0").Reserved Notation">=0" (at level0, format">=0").Reserved Notation"<=0" (at level0, format"<=0").Reserved Notation">=<0" (at level0, format">=<0").Reserved Notation">?<0" (at level0, format">?<0").Reserved Notation"!=0" (at level0, format"!=0").Reserved Notation"?=0" (at level0, format"?=0").Reserved Notation"x %:sgn" (at level2, format"x %:sgn").Reserved Notation"x %:num" (at level2, format"x %:num").Reserved Notation"x %:posnum" (at level2, format"x %:posnum").Reserved Notation"x %:nngnum" (at level2, format"x %:nngnum").Reserved Notation"[ 'sgn' 'of' x ]" (format"[ 'sgn' 'of' x ]").Reserved Notation"[ 'gt0' 'of' x ]" (format"[ 'gt0' 'of' x ]").Reserved Notation"[ 'lt0' 'of' x ]" (format"[ 'lt0' 'of' x ]").Reserved Notation"[ 'ge0' 'of' x ]" (format"[ 'ge0' 'of' x ]").Reserved Notation"[ 'le0' 'of' x ]" (format"[ 'le0' 'of' x ]").Reserved Notation"[ 'cmp0' 'of' x ]" (format"[ 'cmp0' 'of' x ]").Reserved Notation"[ 'neq0' 'of' x ]" (format"[ 'neq0' 'of' x ]").Reserved Notation"{ 'posnum' R }" (at level0, format"{ 'posnum' R }").Reserved Notation"{ 'nonneg' R }" (at level0, format"{ 'nonneg' R }").Reserved Notation"x %:pos" (at level2, format"x %:pos").Reserved Notation"x %:nng" (at level2, format"x %:nng").
The only parsing modifier has no effect in Reserved
Notation.
[irrelevant-reserved-notation-only-parsing,parsing]
Set Implicit Arguments.Unset Strict Implicit.Unset Printing Implicit Defensive.Import Order.TTheory Order.Syntax.Import GRing.Theory Num.Theory.LocalOpen Scope ring_scope.LocalOpen Scope order_scope.Declare Scope snum_scope.Delimit Scope snum_scope with snum.Declare Scope snum_sign_scope.Delimit Scope snum_sign_scope with snum_sign.Declare Scope snum_nullity_scope.Delimit Scope snum_nullity_scope with snum_nullity.Notation"!! x" := (ltac:(refine x)) (only parsing).(* infer class to help typeclass inference on the fly *)Classinfer (P : Prop) := Infer : P.#[global] Hint Mode infer ! : typeclass_instances.#[global] Hint Extern0 (infer _) => (exact) : typeclass_instances.
P: Prop
P -> infer P
4
by [].Qed.ModuleImport KnownSign.Variantnullity := NonZero | MaybeZero.Coercionnullity_bool nz := if nz is NonZero then true else false.Definitionnz_of_boolb := if b then NonZero else MaybeZero.Variantsign := EqZero | NonNeg | NonPos.Variantreal := Sign of sign | AnySign.Variantreality := Real of real | Arbitrary.Definitionwider_nullityxnzynz :=
match xnz, ynz with
| MaybeZero, _
| NonZero, NonZero => true
| NonZero, MaybeZero => false
end.Definitionwider_signxsys :=
match xs, ys with
| NonNeg, NonNeg | NonNeg, EqZero
| NonPos, NonPos | NonPos, EqZero
| EqZero, EqZero => true
| NonNeg, NonPos | NonPos, NonNeg
| EqZero, NonPos | EqZero, NonNeg => false
end.Definitionwider_realxryr :=
match xr, yr with
| AnySign, _ => true
| Sign sx, Sign sy => wider_sign sx sy
| Sign _, AnySign => false
end.Definitionwider_realityxryr :=
match xr, yr with
| Arbitrary, _ => true
| Real xr, Real yr => wider_real xr yr
| Real _, Arbitrary => false
end.EndKnownSign.ModuleSigned.SectionSigned.Context (disp : unit) (T : porderType disp) (x0 : T).Local Coercionis_real r := if r is Real _ then true else false.Definitionreality_cond (n : reality) (x : T) :=
match n with
| Real (Sign EqZero) => x == x0
| Real (Sign NonNeg) => x >= x0
| Real (Sign NonPos) => x <= x0
| Real AnySign => (x0 <= x) || (x <= x0)
| Arbitary => true
end.Recorddef (nz : nullity) (cond : reality) := Def {
r :> T;
#[canonical=no]
P : (nz ==> (r != x0)) && reality_cond cond r
}.EndSigned.Notationspec x0 nz cond x :=
((nullity_bool nz%snum_nullity ==> (x != x0))
&& (reality_cond x0 cond%snum_sign x)).Recordtypdnzcond := Typ {
sort : porderType d;
#[canonical=no]
sort_x0 : sort;
#[canonical=no]
allP : forallx : sort, spec sort_x0 nz cond x
}.Definitionmk {dT} x0nzcondrP : @def d T x0 nz cond :=
@Def d T x0 nz cond r P.Definitionfrom {dTx0nzcond}
{x : @def d T x0 nz cond} (phx : phantom T x) := x.DefinitionfromP {dTx0nzcond}
{x : @def d T x0 nz cond} (phx : phantom T x) := P x.ModuleExports.CoercionSign : sign >-> real.CoercionReal : real >-> reality.Coercionis_real : reality >-> bool.Bind Scope snum_sign_scope with sign.Bind Scope snum_sign_scope with reality.Bind Scope snum_nullity_scope with nullity.Notation"=0" := EqZero : snum_sign_scope.Notation">=0" := NonNeg : snum_sign_scope.Notation"<=0" := NonPos : snum_sign_scope.Notation">=<0" := AnySign : snum_sign_scope.Notation">?<0" := Arbitrary : snum_sign_scope.Notation"!=0" := NonZero : snum_nullity_scope.Notation"?=0" := MaybeZero : snum_nullity_scope.Notation"{ 'compare' x0 & nz & cond }" := (def x0 nz cond) : type_scope.Notation"{ 'num' R & nz & cond }" := (def (0%R : R) nz cond) : ring_scope.Notation"{ = x0 : T }" := (def (x0 : T) MaybeZero EqZero) : type_scope.Notation"{ > x0 : T }" := (def (x0 : T) NonZero NonNeg) : type_scope.Notation"{ < x0 : T }" := (def (x0 : T) NonZero NonPos) : type_scope.Notation"{ >= x0 : T }" := (def (x0 : T) MaybeZero NonNeg) : type_scope.Notation"{ <= x0 : T }" := (def (x0 : T) MaybeZero NonPos) : type_scope.Notation"{ >< x0 : T }" := (def (x0 : T) NonZero Real) : type_scope.Notation"{ >=< x0 : T }" := (def (x0 : T) MaybeZero Real) : type_scope.Notation"{ != x0 : T }" := (def (x0 : T) NonZero Arbitrary) : type_scope.Notation"{ ?= x0 : T }" := (def (x0 : T) MaybeZero Arbitrary) : type_scope.Notation"{ = x0 }" := (def x0 MaybeZero EqZero) : type_scope.Notation"{ > x0 }" := (def x0 NonZero NonNeg) : type_scope.Notation"{ < x0 }" := (def x0 NonZero NonPos) : type_scope.Notation"{ >= x0 }" := (def x0 MaybeZero NonNeg) : type_scope.Notation"{ <= x0 }" := (def x0 MaybeZero NonPos) : type_scope.Notation"{ >< x0 }" := (def x0 NonZero Real) : type_scope.Notation"{ >=< x0 }" := (def x0 MaybeZero Real) : type_scope.Notation"{ != x0 }" := (def x0 NonZero Arbitrary) : type_scope.Notation"{ ?= x0 }" := (def x0 MaybeZero Arbitrary) : type_scope.Notation"x %:sgn" := (from (Phantom _ x)) : ring_scope.Notation"[ 'sgn' 'of' x ]" := (fromP (Phantom _ x)) : ring_scope.Notationnum := r.Notation"x %:num" := (r x) : ring_scope.Definitionposnum (R : numDomainType) ofphantR := {> 0%R : R}.Notation"{ 'posnum' R }" := (@posnum _ (Phant R)) : ring_scope.Notation"x %:posnum" := (@num _ _ 0%R !=0 >=0 x) : ring_scope.Definitionnonneg (R : numDomainType) ofphantR := {>= 0%R : R}.Notation"{ 'nonneg' R }" := (@nonneg _ (Phant R)) : ring_scope.Notation"x %:nngnum" := (@num _ _ 0%R ?=0 >=0 x) : ring_scope.Notation"2" := 2%:R : ring_scope.Arguments r {disp T x0 nz cond}.EndExports.EndSigned.Export Signed.Exports.SectionPOrder.Variables (d : unit) (T : porderType d) (x0 : T) (nz : nullity) (cond : reality).Local NotationsT := {compare x0 & nz & cond}.Canonicalsigned_subType := [subType for @Signed.r d T x0 nz cond].Definitionsigned_eqMixin := [eqMixin of sT by <:].Canonicalsigned_eqType := EqType sT signed_eqMixin.Definitionsigned_choiceMixin := [choiceMixin of sT by <:].Canonicalsigned_choiceType := ChoiceType sT signed_choiceMixin.Definitionsigned_porderMixin := [porderMixin of sT by <:].Canonicalsigned_porderType := POrderType d sT signed_porderMixin.EndPOrder.
d: unit T: porderType d x0, x: T
(?=0%snum_nullity ==> (x != x0)) &&
Signed.reality_cond x0 >?<0 x
b
by [].Qed.Canonicaltop_typ d (T : porderType d) (x0 : T) :=
Signed.Typ (top_typ_subproof x0).
R: realDomainType x: R
(?=0%snum_nullity ==> (x != 0%R)) &&
Signed.reality_cond 0%R >=<0 x
bymove: xt x => [].Qed.(* This adds _ <- Signed.r ( typ_snum ) to canonical projections (c.f., Print Canonical Projections Signed.r) meaning that if no other canonical instance (with a registered head symbol) is found, a canonical instance of Signed.typ, like the ones above, will be looked for. *)Canonicaltyp_snum d nz cond (xt : Signed.typ d nz cond) (x : Signed.sort xt) :=
Signed.mk (typ_snum_subproof x).(* Section Order. *)(* Variables (d : unit) (T : orderType d) (x0 : T) (nz : nullity) (cond : reality). *)(* Local Notation sT := {compare x0 & nz & cond}. *)(* Lemma signed_le_total : totalPOrderMixin [porderType of sT]. *)(* Proof. by move=> x y; apply: le_total. Qed. *)(* Canonical signed_latticeType := LatticeType sT signed_le_total. *)(* Canonical signed_distrLatticeType := DistrLatticeType sT signed_le_total. *)(* Canonical signed_orderType := OrderType sT signed_le_total. *)(* End Order. *)Classunify {T} f (xy : T) := Unify : f x y = true.#[global] Hint Modeunify - - - + : typeclass_instances.Classunify' {T} f (xy : T) := Unify' : f x y = true.#[global] Instanceunify'P {T} f (xy : T) : unify' f x y -> unify f x y := id.#[global]
Hint Extern0 (unify' _ _ _) => vm_compute; reflexivity : typeclass_instances.Notationunify_nz nzx nzy :=
(unify wider_nullity nzx%snum_nullity nzy%snum_nullity).Notationunify_r rx ry :=
(unify wider_reality rx%snum_sign ry%snum_sign).
bymove=> x y; apply: real_comparable => /=.Qed.Canonicalsigned_latticeType := LatticeType nR signed_le_total.Canonicalsigned_distrLatticeType := DistrLatticeType nR signed_le_total.Canonicalsigned_orderType := OrderType nR signed_le_total.EndOrder.SectionPOrderStability.Context {disp : unit} {T : porderType disp} {x0 : T}.Definitionmin_nonzero_subdef (xnzynz : nullity) (xryr : reality) :=
nz_of_bool
(xnz && ynz
|| xnz && yr && match xr with Real (Sign <=0) => true | _ => false end
|| ynz && match yr with Real (Sign <=0) => true | _ => false end).Arguments min_nonzero_subdef /.Definitionmin_reality_subdef (xnzynz : nullity) (xryr : reality) : reality :=
match xr, yr with
| Real (Sign =0), Real (Sign =0)
| Real (Sign =0), Real (Sign >=0)
| Real (Sign >=0), Real (Sign =0) => =0
| Real (Sign >=0), Real (Sign >=0) => >=0
| Real (Sign <=0), Real _
| Real _, Real (Sign <=0) => <=0
| Real _, Real _ => >=<0
| _, _ => >?<0end.Arguments min_reality_subdef /.
0 < x -> posnum_spec x x (x == 0) (0 <= x) (0 < x)
279
274
posnum_spec x x false true true
byrewrite -[x]/(PosNum x_gt0)%:num; constructor.Qed.CoInductivenonneg_spec (R : numDomainType) (x : R) : R -> bool -> Type :=
| IsNonneg (p : {nonneg R}) : nonneg_spec x (p%:num) true.
27b
0 <= x -> nonneg_spec x x (0 <= x)
283
bymove=> xge0; rewrite xge0 -[x]/(NngNum xge0)%:num; constructor.Qed.(* Section PosnumOrder. *)(* Variables (R : numDomainType). *)(* Local Notation nR := {posnum R}. *)(* Lemma posnum_le_total : totalPOrderMixin [porderType of nR]. *)(* Proof. by move=> x y; apply: real_comparable. Qed. *)(* Canonical posnum_latticeType := LatticeType nR posnum_le_total. *)(* Canonical posnum_distrLatticeType := DistrLatticeType nR posnum_le_total. *)(* Canonical posnum_orderType := OrderType nR posnum_le_total. *)(* End PosnumOrder. *)(* Section NonnegOrder. *)(* Variables (R : numDomainType). *)(* Local Notation nR := {nonneg R}. *)(* Lemma nonneg_le_total : totalPOrderMixin [porderType of nR]. *)(* Proof. by move=> x y; apply: real_comparable. Qed. *)(* Canonical nonneg_latticeType := LatticeType nR nonneg_le_total. *)(* Canonical nonneg_distrLatticeType := DistrLatticeType nR nonneg_le_total. *)(* Canonical nonneg_orderType := OrderType nR nonneg_le_total. *)(* End NonnegOrder. *)(* These proofs help integrate more arithmetic with signed.v. The issue is *)(* Terms like `0 < 1-q` with subtraction don't work well. So we hide the *)(* subtractions behind `PosNum` and `NngNum` constructors, see sequences.v *)(* for examples. *)Sectiononem_signed.VariableR : numDomainType.Implicit Typesr : R.