Module mathcomp.reals.signed
From HB Require Import structures.From mathcomp Require Import ssreflect ssrfun ssrbool.
From mathcomp Require Import ssrnat eqtype choice order ssralg ssrnum ssrint.
#[warning="-warn-library-file-internal-analysis"]
From mathcomp Require Import unstable.
From mathcomp Require Import mathcomp_extra.
Attributes deprecated(since="mathcomp-analysis 1.9.0",
note="Use ""From mathcomp Require Import interval_inference."" instead.").
Reserved Notation "{ 'compare' x0 & nz & cond }"
(format "{ 'compare' x0 & nz & cond }").
Reserved Notation "{ 'num' R & nz & cond }"
(format "{ 'num' R & nz & cond }").
Reserved Notation "{ = x0 }" (format "{ = x0 }").
Reserved Notation "{ > x0 }" (format "{ > x0 }").
Reserved Notation "{ < x0 }" (format "{ < x0 }").
Reserved Notation "{ >= x0 }" (format "{ >= x0 }").
Reserved Notation "{ <= x0 }" (format "{ <= x0 }").
Reserved Notation "{ >=< x0 }" (format "{ >=< x0 }").
Reserved Notation "{ >< x0 }" (format "{ >< x0 }").
Reserved Notation "{ != x0 }" (format "{ != x0 }").
Reserved Notation "{ ?= x0 }" (format "{ ?= x0 }").
Reserved Notation "{ = x0 : T }" (format "{ = x0 : T }").
Reserved Notation "{ > x0 : T }" (format "{ > x0 : T }").
Reserved Notation "{ < x0 : T }" (format "{ < x0 : T }").
Reserved Notation "{ >= x0 : T }" (format "{ >= x0 : T }").
Reserved Notation "{ <= x0 : T }" (format "{ <= x0 : T }").
Reserved Notation "{ >=< x0 : T }" (format "{ >=< x0 : T }").
Reserved Notation "{ >< x0 : T }" (format "{ >< x0 : T }").
Reserved Notation "{ != x0 : T }" (format "{ != x0 : T }").
Reserved Notation "{ ?= x0 : T }" (format "{ ?= x0 : T }").
Reserved Notation "=0" (format "=0").
Reserved Notation ">=0" (format ">=0").
Reserved Notation "<=0" (format "<=0").
Reserved Notation ">=<0" (format ">=<0").
Reserved Notation ">?<0" (format ">?<0").
Reserved Notation "!=0" (format "!=0").
Reserved Notation "?=0" (format "?=0").
Reserved Notation "x %:sgn" (format "x %:sgn").
Reserved Notation "x %:num" (format "x %:num").
Reserved Notation "x %:posnum" (format "x %:posnum").
Reserved Notation "x %:nngnum" (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 }" (format "{ 'posnum' R }").
Reserved Notation "{ 'nonneg' R }" (format "{ 'nonneg' R }").
Reserved Notation "x %:pos" (format "x %:pos").
Reserved Notation "x %:nng" (format "x %:nng").
Reserved Notation "!! x" (at level 100, only parsing).
Set SsrOldRewriteGoalsOrder.
Set Implicit Arguments.
Unset Strict Implicit.
Unset Printing Implicit Defensive.
Import Order.TTheory Order.Syntax.
Import GRing.Theory Num.Theory.
Local Open Scope ring_scope.
Local Open 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
Class
#[global] Hint Mode infer ! : typeclass_instances.
#[global] Hint Extern 0 (infer _) => (exact) : typeclass_instances.
Lemma
Proof.
Module Import
Variant
Coercion
Source code
Definition
Source code
Variant
Variant
Variant
Definition
Source code
match xnz, ynz with
| MaybeZero, _
| NonZero, NonZero => true
| NonZero, MaybeZero => false
end.
Definition
KnownSign.nullity_bool : KnownSign.nullity -> bool KnownSign.nullity_bool is not universe polymorphic Arguments KnownSign.nullity_bool nz%snum_nullity_scope KnownSign.nullity_bool is transparent Expands to: Constant mathcomp.reals.signed.KnownSign.nullity_bool Declared in library mathcomp.reals.signed, line 208, characters 9-21
Source code
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.
Definition
KnownSign.nz_of_bool : bool -> KnownSign.nullity KnownSign.nz_of_bool is not universe polymorphic Arguments KnownSign.nz_of_bool b%bool_scope KnownSign.nz_of_bool is transparent Expands to: Constant mathcomp.reals.signed.KnownSign.nz_of_bool Declared in library mathcomp.reals.signed, line 209, characters 11-21
Source code
match xr, yr with
| AnySign, _ => true
| Sign sx, Sign sy => wider_sign sx sy
| Sign _, AnySign => false
end.
Definition
KnownSign.wider_nullity : KnownSign.nullity -> KnownSign.nullity -> bool KnownSign.wider_nullity is not universe polymorphic Arguments KnownSign.wider_nullity (xnz ynz)%snum_nullity_scope KnownSign.wider_nullity is transparent Expands to: Constant mathcomp.reals.signed.KnownSign.wider_nullity Declared in library mathcomp.reals.signed, line 215, characters 11-24
Source code
match xr, yr with
| Arbitrary, _ => true
| Real xr, Real yr => wider_real xr yr
| Real _, Arbitrary => false
end.
End KnownSign.
Module
Section Signed.
Context (
Local Coercion
KnownSign.wider_sign : KnownSign.sign -> KnownSign.sign -> bool KnownSign.wider_sign is not universe polymorphic Arguments KnownSign.wider_sign (xs ys)%snum_sign_scope KnownSign.wider_sign is transparent Expands to: Constant mathcomp.reals.signed.KnownSign.wider_sign Declared in library mathcomp.reals.signed, line 221, characters 11-21
Source code
Definition
KnownSign.wider_real : KnownSign.real -> KnownSign.real -> bool KnownSign.wider_real is not universe polymorphic Arguments KnownSign.wider_real xr yr KnownSign.wider_real is transparent Expands to: Constant mathcomp.reals.signed.KnownSign.wider_real Declared in library mathcomp.reals.signed, line 229, characters 11-21
Source code
match n with
| Real (Sign EqZero) => x == x0
| Real (Sign NonNeg) => x >= x0
| Real (Sign NonPos) => x <= x0
| Real AnySign => (x0 <= x) || (x <= x0)
| Arbitrary => true
end.
Record
:> T;
#[canonical=no]
: (nz ==> (r != x0)) && reality_cond cond r
}.
End Signed.
Notation
((nullity_bool nz%snum_nullity ==> (x != x0))
&& (reality_cond x0 cond%snum_sign x)).
Record
#[canonical=no]
#[canonical=no]
}.
Definition
KnownSign.wider_reality : KnownSign.reality -> KnownSign.reality -> bool KnownSign.wider_reality is not universe polymorphic Arguments KnownSign.wider_reality (xr yr)%snum_sign_scope KnownSign.wider_reality is transparent Expands to: Constant mathcomp.reals.signed.KnownSign.wider_reality Declared in library mathcomp.reals.signed, line 235, characters 11-24
Source code
@Def d T x0 nz cond r P.
Definition
Signed.is_real not a defined object.
Source code
{ : @def d T x0 nz cond} (
Definition
Signed.reality_cond : forall [disp : disp_t] [T : porderType disp], T -> KnownSign.reality -> T -> bool Signed.reality_cond is not universe polymorphic Arguments Signed.reality_cond [disp T] x0 n%snum_sign_scope x Signed.reality_cond is transparent Expands to: Constant mathcomp.reals.signed.Signed.reality_cond Declared in library mathcomp.reals.signed, line 248, characters 11-23
Source code
{ : @def d T x0 nz cond} (
Module
Coercion Sign : sign >-> real.
Coercion Real : real >-> reality.
Coercion is_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
Notation
Notation
Notation
Notation
Notation
Notation
Notation
Notation
Notation
Notation
Notation
Notation
Notation
Notation
Notation
Notation
Notation
Notation
Notation
Notation
Notation
Notation
Notation
Notation
Notation
Notation
Notation
Notation
Notation
Notation
Definition
Signed.mk : forall {d : disp_t} {T : porderType d} [x0 : T] [nz : KnownSign.nullity] [cond : KnownSign.reality] [r : T], Signed.spec x0 nz cond r -> {compare x0 & nz & cond} Signed.mk is not universe polymorphic Arguments Signed.mk {d T} [x0] [nz]%snum_nullity_scope [cond]%snum_sign_scope [r] P Signed.mk is transparent Expands to: Constant mathcomp.reals.signed.Signed.mk Declared in library mathcomp.reals.signed, line 277, characters 11-13
Source code
Notation
Notation
Definition
Signed.from : forall {d : disp_t} {T : porderType d} {x0 : T} {nz : KnownSign.nullity} {cond : KnownSign.reality} {x : {compare x0 & nz & cond}}, phantom T x%:num%R -> {compare x0 & nz & cond} Signed.from is not universe polymorphic Arguments Signed.from {d T x0} {nz}%snum_nullity_scope {cond}%snum_sign_scope {x} phx Signed.from is transparent Expands to: Constant mathcomp.reals.signed.Signed.from Declared in library mathcomp.reals.signed, line 280, characters 11-15
Source code
Notation
Notation
Arguments r {disp T x0 nz cond}.
End Exports.
End Signed.
Export Signed.Exports.
Section POrder.
Variables ( : Order.disp_t) ( : porderType d).
Variables ( : T) ( : nullity) (
Local Notation := {compare x0 & nz & cond}.
.
.
End POrder.
Lemma
Signed.spec x0 ?=0 >?<0 x.
Proof.
Canonical
posnum : forall [R : numDomainType], phant R -> Type posnum is not universe polymorphic Arguments posnum [R] _ posnum is transparent Expands to: Constant mathcomp.reals.signed.Signed.Exports.posnum Declared in library mathcomp.reals.signed, line 324, characters 11-17
Source code
Signed.Typ (top_typ_subproof x0).
Lemma
Signed.spec 0%R ?=0 >=<0 x.
Canonical
nonneg : forall [R : numDomainType], phant R -> Type nonneg is not universe polymorphic Arguments nonneg [R] _ nonneg is transparent Expands to: Constant mathcomp.reals.signed.Signed.Exports.nonneg Declared in library mathcomp.reals.signed, line 327, characters 11-17
Source code
Signed.Typ (@real_domain_typ_subproof R).
Lemma
Signed.spec 0%R ?=0 >=<0 x.
Proof.
Canonical
top_typ : forall [d : disp_t] [T : porderType d], T -> Signed.typ d ?=0 >?<0 top_typ is not universe polymorphic Arguments top_typ [d T] x0 top_typ is transparent Expands to: Constant mathcomp.reals.signed.top_typ Declared in library mathcomp.reals.signed, line 347, characters 10-17
Source code
Signed.Typ (@real_field_typ_subproof R).
Lemma
Proof.
Canonical
real_domain_typ : realDomainType -> Signed.typ ring_display ?=0 >=<0 real_domain_typ is not universe polymorphic Arguments real_domain_typ R real_domain_typ is transparent Expands to: Constant mathcomp.reals.signed.real_domain_typ Declared in library mathcomp.reals.signed, line 354, characters 10-25
Source code
Lemma
( : Signed.sort xt) :
Signed.spec (Signed.sort_x0 xt) nz cond x.
Proof.
real_field_typ : realFieldType -> Signed.typ ring_display ?=0 >=<0 real_field_typ is not universe polymorphic Arguments real_field_typ R real_field_typ is transparent Expands to: Constant mathcomp.reals.signed.real_field_typ Declared in library mathcomp.reals.signed, line 361, characters 10-24
Source code
Signed.mk (typ_snum_subproof x).
Class
#[global] Hint Mode unify - - - + : typeclass_instances.
Class
#[global] Instance
#[global]
Hint Extern 0 (unify' _ _ _) => vm_compute; reflexivity : typeclass_instances.
Notation
(unify wider_nullity nzx%snum_nullity nzy%snum_nullity).
Notation
(unify wider_reality rx%snum_sign ry%snum_sign).
#[global] Instance
Proof.
#[global] Instance
Proof.
Section Theory.
Context { : Order.disp_t} { : porderType d} { : T}.
Context { : nullity} {
Local Notation := {compare x0 & nz & cond}.
Implicit Type x : sT.
Lemma
Proof.
Lemma
Lemma
Proof.
Lemma
Lemma
Proof.
Lemma
Lemma
Lemma
Lemma
Lemma
Lemma
Proof.
by move: cond nz => [[[]|]|] [] //= _;
do ?[by move=> /eqP ->; rewrite comparablexx];
move=> sx; rewrite /Order.comparable sx// orbT.
Qed.
Lemma
Lemma
Lemma
Lemma
unify_nz nz' nz -> unify_r cond' cond ->
Signed.spec x0 nz' cond' x%:num.
Proof.
Definition
nat_typ : Signed.typ nat_display ?=0 >=0 nat_typ is not universe polymorphic nat_typ is transparent Expands to: Constant mathcomp.reals.signed.nat_typ Declared in library mathcomp.reals.signed, line 367, characters 10-17
Source code
(
Signed.mk (widen_signed_subproof x unz ucond).
Lemma
@widen_signed x nz cond unz ucond = x.
Proof.
Lemma
(widen_signed x%:num%:sgn unz ucond)%:num = x%:num.
Proof.
Lemma
(widen_signed x%:num%:sgn unz ucond)%:num = x%:num.
Proof.
End Theory.
Arguments bottom {d T x0 nz cond} _ {_ _}.
Arguments gt0 {d T x0 nz cond} _ {_ _}.
Arguments le0F {d T x0 nz cond} _ {_ _}.
Arguments lt0 {d T x0 nz cond} _ {_ _}.
Arguments ge0F {d T x0 nz cond} _ {_ _}.
Arguments ge0 {d T x0 nz cond} _ {_}.
Arguments lt0F {d T x0 nz cond} _ {_}.
Arguments le0 {d T x0 nz cond} _ {_}.
Arguments gt0F {d T x0 nz cond} _ {_}.
Arguments cmp0 {d T x0 nz cond} _ {_}.
Arguments neq0 {d T x0 nz cond} _ {_}.
Arguments eq0F {d T x0 nz cond} _ {_}.
Arguments eq0 {d T x0 nz cond} _ {_}.
Arguments widen_signed {d T x0 nz cond} _ {_ _ _ _}.
Arguments widen_signedE {d T x0 nz cond} _ {_ _}.
Arguments posE {d T x0 nz cond} _ {_ _}.
Arguments nngE {d T x0 nz cond} _ {_ _}.
Notation
Notation
Notation
Notation
Notation
Notation
#[global] Hint Extern 0 (is_true (0%R < _)%O) => solve [apply: gt0] : core.
#[global] Hint Extern 0 (is_true (_ < 0%R)%O) => solve [apply: lt0] : core.
#[global] Hint Extern 0 (is_true (0%R <= _)%O) => solve [apply: ge0] : core.
#[global] Hint Extern 0 (is_true (_ <= 0%R)%O) => solve [apply: le0] : core.
#[global] Hint Extern 0 (is_true (_ \is Num.real)) => solve [apply: cmp0] : core.
#[global] Hint Extern 0 (is_true (0%R >=< _)%O) => solve [apply: cmp0] : core.
#[global] Hint Extern 0 (is_true (_ != 0%R)%O) => solve [apply: neq0] : core.
Notation
: ring_scope.
Notation
: ring_scope.
Notation
(@Signed.from _ _ _ _ _ _ (Phantom _ x)) !=0 (Real (Sign >=0)) _ _)
(only printing) : ring_scope.
Notation
(@Signed.from _ _ _ _ _ _ (Phantom _ x)) ?=0 (Real (Sign >=0)) _ _)
(only printing) : ring_scope.
Local Open Scope ring_scope.
Section Order.
Variables ( : numDomainType) ( : nullity) ( : real).
Local Notation := {num R & nz & r}.
Lemma
Proof.
.
signed_le_total.
End Order.
Section POrderStability.
Context {
Definition
typ_snum : forall [d : disp_t] [nz : KnownSign.nullity] [cond : KnownSign.reality] [xt : Signed.typ d nz cond], Signed.sort xt -> {compare Signed.sort_x0 xt & nz & cond} typ_snum is not universe polymorphic Arguments typ_snum [d] [nz]%snum_nullity_scope [cond]%snum_sign_scope [xt] x typ_snum is transparent Expands to: Constant mathcomp.reals.signed.typ_snum Declared in library mathcomp.reals.signed, line 379, characters 10-18
Source code
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 /.
Definition
widen_signed : forall {d : disp_t} {T : porderType d} {x0 : T} {nz : KnownSign.nullity} {cond : KnownSign.reality}, {compare x0 & nz & cond} -> forall {nz' : KnownSign.nullity} {cond' : KnownSign.reality}, unify_nz nz' nz -> unify_r cond' cond -> {compare x0 & nz' & cond'} widen_signed is not universe polymorphic Arguments widen_signed {d T x0} {nz}%snum_nullity_scope {cond}%snum_sign_scope x {nz'}%snum_nullity_scope {cond'}%snum_sign_scope {unz ucond} widen_signed is transparent Expands to: Constant mathcomp.reals.signed.widen_signed Declared in library mathcomp.reals.signed, line 489, characters 11-23
Source code
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
| _, _ => >?<0
end.
Arguments min_reality_subdef /.
Lemma
( : {compare x0 & xnz & xr}) ( : {compare x0 & ynz & yr})
(
(
Signed.spec x0 rnz rrl (Order.min x%:num y%:num).
Proof.
move: xr yr xnz ynz x y => [[[]|]|] [[[]|]|] [] []//= x y; rewrite /Order.min;
do ?[by case: (bottom x)|by case: (bottom y)
|by case: ifP; rewrite ?eq0F// => xlty;
have := !! lt_trans xlty (lt0 y); rewrite lt_neqAle => /andP[]
|by rewrite ifT ?eq0F//; apply: lt_le_trans (ge0 y); exact: lt0
|by have := !! le0 y;
rewrite le_eqVlt => /predU1P[->|]; rewrite ?lt0 ?eq0F//;
case: ifP => _; rewrite ?eq0F// lt_neqAle => /andP[]].
have /orP[x0ley|] := !! cmp0 y.
by rewrite ifT ?eq0F//; apply: lt_le_trans x0ley; exact: lt0.
rewrite le_eqVlt => /predU1P[->|]; rewrite ?lt0 ?eq0F//.
by case: ifP => _; rewrite ?eq0F// lt_neqAle => /andP[].
move: xr yr xnz ynz x y => [[[]|]|] [[[]|]|] [] []//= x y;
do ?[by case: (bottom x)|by case: (bottom y)
|by apply: comparable_minr; exact: cmp0
|by rewrite minEle; case: ifP; rewrite ge0
|by rewrite ?eq0 minEle ?ge0
|by rewrite ?eq0 minElt; case: ifP; rewrite ?eq0// lt0F
|by rewrite minEle; case: ifP => [xlty|]; rewrite ?le0//;
apply: (le_trans xlty); rewrite le0
|by have /orP[x0ley|] := !! cmp0 y;
[rewrite minEle ifT ?le0//; apply: le_trans x0ley; exact: le0
|rewrite minEle; case: ifP => //; exact: le_trans]].
Qed.
Canonical
min_nonzero_subdef : KnownSign.nullity -> KnownSign.nullity -> KnownSign.reality -> KnownSign.reality -> KnownSign.nullity min_nonzero_subdef is not universe polymorphic Arguments min_nonzero_subdef (xnz ynz)%snum_nullity_scope (xr yr)%snum_sign_scope min_nonzero_subdef is transparent Expands to: Constant mathcomp.reals.signed.min_nonzero_subdef Declared in library mathcomp.reals.signed, line 568, characters 11-29
Source code
( : {compare x0 & xnz & xr}) ( : {compare x0 & ynz & yr}) :=
Signed.mk (min_snum_subproof x y).
Definition
min_reality_subdef : KnownSign.nullity -> KnownSign.nullity -> KnownSign.reality -> KnownSign.reality -> KnownSign.reality min_reality_subdef is not universe polymorphic Arguments min_reality_subdef (xnz ynz)%snum_nullity_scope (xr yr)%snum_sign_scope min_reality_subdef is transparent Expands to: Constant mathcomp.reals.signed.min_reality_subdef Declared in library mathcomp.reals.signed, line 575, characters 11-29
Source code
nz_of_bool
(xnz && ynz
|| xnz && match xr with Real (Sign >=0) => true | _ => false end
|| ynz && xr && match yr with Real (Sign >=0) => true | _ => false end).
Arguments max_nonzero_subdef /.
Definition
min_snum : forall {disp : disp_t} {T : porderType disp} {x0 : T} [xnz ynz : KnownSign.nullity] [xr yr : KnownSign.reality], {compare x0 & xnz & xr} -> {compare x0 & ynz & yr} -> {compare x0 & min_nonzero_subdef xnz ynz xr yr & min_reality_subdef xnz ynz xr yr} min_snum is not universe polymorphic Arguments min_snum {disp T x0} [xnz ynz]%snum_nullity_scope [xr yr]%snum_sign_scope x y min_snum is transparent Expands to: Constant mathcomp.reals.signed.min_snum Declared in library mathcomp.reals.signed, line 620, characters 10-18
Source code
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
| _, _ => >?<0
end.
Arguments max_reality_subdef /.
Lemma
( : {compare x0 & xnz & xr}) ( : {compare x0 & ynz & yr})
(
(
Signed.spec x0 rnz rrl (Order.max x%:num y%:num).
Proof.
move: xr yr xnz ynz x y => [[[]|]|] [[[]|]|] [] []//= x y; rewrite maxElt;
do ?[by case: (bottom x)|by case: (bottom y)
|by case: ifP => [xlty|]; rewrite ?eq0F//;
do [suff : (x0 < y%:num)%O by rewrite lt_def => /andP[]];
apply: le_lt_trans xlty; exact: ge0
|by rewrite ifT ?eq0F//; apply: le_lt_trans (gt0 y); exact: le0
|by have := !! ge0 x;
rewrite le_eqVlt => /predU1P[<-|]; rewrite ?gt0 ?eq0F//;
case: ifP => _; rewrite ?eq0F// lt_def => /andP[]].
have /orP[|xlex0] := !! cmp0 x.
rewrite le_eqVlt => /predU1P[<-|]; rewrite ?gt0 ?eq0F//.
by case: ifP => _; rewrite ?eq0F// lt_def => /andP[].
by rewrite ifT ?eq0F//; apply: (le_lt_trans xlex0); exact: gt0.
move: xr yr xnz ynz x y => [[[]|]|] [[[]|]|] [] []//= x y;
do ?[by case: (bottom x)|by case: (bottom y)
|by apply: comparable_maxr; exact: cmp0
|by rewrite ?eq0 maxEle ?le0
|by rewrite ?eq0 maxElt ifF// le_gtF// le0
|by rewrite maxEle; case: ifP; rewrite ?ge0//; exact/le_trans/ge0
|by rewrite maxElt; case: ifP => [xlty|]; rewrite ?le0//
|by have /orP[|xlex0] := !! cmp0 x;
[rewrite maxEle; case: ifP => // /[swap]; exact: le_trans
|rewrite maxEle ifT ?ge0//; apply: (le_trans xlex0); exact: ge0]].
Qed.
Canonical
max_nonzero_subdef : KnownSign.nullity -> KnownSign.nullity -> KnownSign.reality -> KnownSign.reality -> KnownSign.nullity max_nonzero_subdef is not universe polymorphic Arguments max_nonzero_subdef (xnz ynz)%snum_nullity_scope (xr yr)%snum_sign_scope max_nonzero_subdef is transparent Expands to: Constant mathcomp.reals.signed.max_nonzero_subdef Declared in library mathcomp.reals.signed, line 624, characters 11-29
Source code
( : {compare x0 & xnz & xr}) ( : {compare x0 & ynz & yr}) :=
Signed.mk (max_snum_subproof x y).
End POrderStability.
Section NumDomainStability.
Context { : numDomainType}.
Lemma
Proof.
Canonical
max_reality_subdef : KnownSign.nullity -> KnownSign.nullity -> KnownSign.reality -> KnownSign.reality -> KnownSign.reality max_reality_subdef is not universe polymorphic Arguments max_reality_subdef (xnz ynz)%snum_nullity_scope (xr yr)%snum_sign_scope max_reality_subdef is transparent Expands to: Constant mathcomp.reals.signed.max_reality_subdef Declared in library mathcomp.reals.signed, line 631, characters 11-29
Source code
Lemma
Canonical
max_snum : forall {disp : disp_t} {T : porderType disp} {x0 : T} [xnz ynz : KnownSign.nullity] [xr yr : KnownSign.reality], {compare x0 & xnz & xr} -> {compare x0 & ynz & yr} -> {compare x0 & max_nonzero_subdef xnz ynz xr yr & max_reality_subdef xnz ynz xr yr} max_snum is not universe polymorphic Arguments max_snum {disp T x0} [xnz ynz]%snum_nullity_scope [xr yr]%snum_sign_scope x y max_snum is transparent Expands to: Constant mathcomp.reals.signed.max_snum Declared in library mathcomp.reals.signed, line 676, characters 10-18
Source code
Definition
zero_snum : forall {R : numDomainType}, {compare 0%R & ?=0 & =0} zero_snum is not universe polymorphic Arguments zero_snum {R} zero_snum is transparent Expands to: Constant mathcomp.reals.signed.zero_snum Declared in library mathcomp.reals.signed, line 688, characters 10-19
Source code
match xr with
| Real (Sign =0) => =0
| Real (Sign >=0) => <=0
| Real (Sign <=0) => >=0
| Real AnySign => >=<0
| Arbitrary => >?<0
end.
Lemma
( : {num R & xnz & xr}) ( := opp_reality_subdef xnz xr) :
Signed.spec 0 xnz r (- x%:num).
Proof.
Canonical
one_snum : forall {R : numDomainType}, {compare 0%R & !=0 & >=0} one_snum is not universe polymorphic Arguments one_snum {R} one_snum is transparent Expands to: Constant mathcomp.reals.signed.one_snum Declared in library mathcomp.reals.signed, line 693, characters 10-18
Source code
Signed.mk (opp_snum_subproof x).
Definition
opp_reality_subdef : KnownSign.nullity -> KnownSign.reality -> KnownSign.reality opp_reality_subdef is not universe polymorphic Arguments opp_reality_subdef xnz%snum_nullity_scope xr%snum_sign_scope opp_reality_subdef is transparent Expands to: Constant mathcomp.reals.signed.opp_reality_subdef Declared in library mathcomp.reals.signed, line 695, characters 11-29
Source code
match xr, yr with
| Real (Sign >=0), Real (Sign =0)
| Real (Sign =0), Real (Sign >=0)
| Real (Sign <=0), Real (Sign =0)
| Real (Sign =0), Real (Sign <=0)
| Real (Sign =0), Real (Sign =0)
| Real (Sign >=0), Real (Sign >=0)
| Real (Sign <=0), Real (Sign <=0) => true
| _, _ => false
end.
Definition
opp_snum : forall {R : numDomainType} [xnz : KnownSign.nullity] [xr : KnownSign.reality], {num R & xnz & xr}%R -> {compare 0%R & xnz & opp_reality_subdef xnz xr} opp_snum is not universe polymorphic Arguments opp_snum {R} [xnz]%snum_nullity_scope [xr]%snum_sign_scope x opp_snum is transparent Expands to: Constant mathcomp.reals.signed.opp_snum Declared in library mathcomp.reals.signed, line 712, characters 10-18
Source code
nz_of_bool (add_samesign_subdef xnz ynz xr yr && (xnz || ynz)).
Arguments add_nonzero_subdef /.
Definition
add_samesign_subdef : KnownSign.nullity -> KnownSign.nullity -> KnownSign.reality -> KnownSign.reality -> bool add_samesign_subdef is not universe polymorphic Arguments add_samesign_subdef (xnz ynz)%snum_nullity_scope (xr yr)%snum_sign_scope add_samesign_subdef is transparent Expands to: Constant mathcomp.reals.signed.add_samesign_subdef Declared in library mathcomp.reals.signed, line 715, characters 11-30
Source code
match xr, yr with
| Real (Sign =0), Real (Sign =0) => =0
| 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)
| Real (Sign =0), Real (Sign <=0)
| Real (Sign <=0), Real (Sign <=0) => <=0
| Real _, Real _ => >=<0
| _, _ => >?<0
end.
Arguments add_reality_subdef /.
Lemma
( : {num R & xnz & xr}) ( : {num R & ynz & yr})
(
(
Signed.spec 0 rnz rrl (x%:num + y%:num).
Proof.
move: xr yr xnz ynz x y => [[[]|]|] [[[]|]|] [] []//= x y;
by rewrite 1?addr_ss_eq0 ?(eq0F, ge0, le0, andbF, orbT).
have addr_le0 ( : R) : a <= 0 -> b <= 0 -> a + b <= 0.
by rewrite -!oppr_ge0 opprD; apply: addr_ge0.
move: xr yr xnz ynz x y => [[[]|]|] [[[]|]|] [] []//= x y;
do ?[by rewrite addr_ge0|by rewrite addr_le0|by rewrite -realE realD
|by case: (bottom x)|by case: (bottom y)|by rewrite !eq0 addr0].
Qed.
Canonical
add_nonzero_subdef : KnownSign.nullity -> KnownSign.nullity -> KnownSign.reality -> KnownSign.reality -> KnownSign.nullity add_nonzero_subdef is not universe polymorphic Arguments add_nonzero_subdef (xnz ynz)%snum_nullity_scope (xr yr)%snum_sign_scope add_nonzero_subdef is transparent Expands to: Constant mathcomp.reals.signed.add_nonzero_subdef Declared in library mathcomp.reals.signed, line 727, characters 11-29
Source code
( : {num R & xnz & xr}) ( : {num R & ynz & yr}) :=
Signed.mk (add_snum_subproof x y).
Definition
add_reality_subdef : KnownSign.nullity -> KnownSign.nullity -> KnownSign.reality -> KnownSign.reality -> KnownSign.reality add_reality_subdef is not universe polymorphic Arguments add_reality_subdef (xnz ynz)%snum_nullity_scope (xr yr)%snum_sign_scope add_reality_subdef is transparent Expands to: Constant mathcomp.reals.signed.add_reality_subdef Declared in library mathcomp.reals.signed, line 731, characters 11-29
Source code
nz_of_bool (xnz && ynz).
Arguments mul_nonzero_subdef /.
Definition
add_snum : forall {R : numDomainType} [xnz ynz : KnownSign.nullity] [xr yr : KnownSign.reality], {num R & xnz & xr}%R -> {num R & ynz & yr}%R -> {compare 0%R & add_nonzero_subdef xnz ynz xr yr & add_reality_subdef xnz ynz xr yr} add_snum is not universe polymorphic Arguments add_snum {R} [xnz ynz]%snum_nullity_scope [xr yr]%snum_sign_scope x y add_snum is transparent Expands to: Constant mathcomp.reals.signed.add_snum Declared in library mathcomp.reals.signed, line 761, characters 10-18
Source code
match xr, yr with
| Real (Sign =0), _ | _, Real (Sign =0) => =0
| Real (Sign >=0), Real (Sign >=0)
| Real (Sign <=0), Real (Sign <=0) => >=0
| Real (Sign >=0), Real (Sign <=0)
| Real (Sign <=0), Real (Sign >=0) => <=0
| Real _, Real _ => >=<0
| _ , _ => >?<0
end.
Arguments mul_reality_subdef /.
Lemma
( : {num R & xnz & xr}) ( : {num R & ynz & yr})
(
(
Signed.spec 0 rnz rrl (x%:num * y%:num).
Proof.
by move: xr yr xnz ynz x y => [[[]|]|] [[[]|]|] [] []// x y;
rewrite mulf_neq0.
by move: xr yr xnz ynz x y => [[[]|]|] [[[]|]|] [] []/= x y //;
do ?[by rewrite mulr_ge0|by rewrite mulr_le0_ge0
|by rewrite mulr_ge0_le0|by rewrite mulr_le0|by rewrite -realE realM
|by case: (bottom x)|by case: (bottom y)|by rewrite eq0 ?mulr0// mul0r].
Qed.
Canonical
mul_nonzero_subdef : KnownSign.nullity -> KnownSign.nullity -> KnownSign.reality -> KnownSign.reality -> KnownSign.nullity mul_nonzero_subdef is not universe polymorphic Arguments mul_nonzero_subdef (xnz ynz)%snum_nullity_scope (xr yr)%snum_sign_scope mul_nonzero_subdef is transparent Expands to: Constant mathcomp.reals.signed.mul_nonzero_subdef Declared in library mathcomp.reals.signed, line 765, characters 11-29
Source code
( : {num R & xnz & xr}) ( : {num R & ynz & yr}) :=
Signed.mk (mul_snum_subproof x y).
Lemma
( : {num R & xnz & xr}) ( : {compare 0%N & nnz & nr})
(
(
Signed.spec 0 rnz rrl (x%:num *+ n%:num).
Proof.
by move: xr nr xnz nnz x n => [[[]|]|] [[[]|]|] [] []// x n;
rewrite mulrn_eq0//= ?eq0F.
move: xr nr xnz nnz x n => [[[]|]|] [[[]|]|] [] []/= x [[|n]//= _] //;
do ?[by case: (bottom x)|by case: (bottom n)
|by rewrite mulrn_wge0|by rewrite mulrn_wle0|by rewrite eq0 mul0rn
|by apply: real_comparable; rewrite ?real0 ?realrMn].
Qed.
Canonical
mul_reality_subdef : KnownSign.nullity -> KnownSign.nullity -> KnownSign.reality -> KnownSign.reality -> KnownSign.reality mul_reality_subdef is not universe polymorphic Arguments mul_reality_subdef (xnz ynz)%snum_nullity_scope (xr yr)%snum_sign_scope mul_reality_subdef is transparent Expands to: Constant mathcomp.reals.signed.mul_reality_subdef Declared in library mathcomp.reals.signed, line 769, characters 11-29
Source code
( : {num R & xnz & xr}) ( : {compare 0%N & nnz & nr}) :=
Signed.mk (natmul_snum_subproof x n).
Lemma
( : {num R & xnz & xr}) ( : {num int & nnz & nr})
(
(
Signed.spec 0 rnz rrl (x%:num *~ n%:num).
Proof.
by move: xr nr xnz nnz x n => [[[]|]|] [[[]|]|] [] []// x n;
rewrite mulrz_neq0//= ?neq0.
move: xr nr xnz nnz x n => [[[]|]|] [[[]|]|] [] []/= x n //;
do ?[by case: (bottom x)|by case: (bottom n)
|by rewrite mulrz_ge0|by rewrite mulrz_le0_ge0|by rewrite eq0 mul0rz
|by rewrite mulrz_ge0_le0|by rewrite mulrz_le0|by rewrite eq0 mulr0z
|by rewrite -realE rpredMz//; apply: cmp0].
Qed.
Canonical
mul_snum : forall {R : numDomainType} [xnz ynz : KnownSign.nullity] [xr yr : KnownSign.reality], {num R & xnz & xr}%R -> {num R & ynz & yr}%R -> {compare 0%R & mul_nonzero_subdef xnz ynz xr yr & mul_reality_subdef xnz ynz xr yr} mul_snum is not universe polymorphic Arguments mul_snum {R} [xnz ynz]%snum_nullity_scope [xr yr]%snum_sign_scope x y mul_snum is transparent Expands to: Constant mathcomp.reals.signed.mul_snum Declared in library mathcomp.reals.signed, line 796, characters 10-18
Source code
( : {num R & xnz & xr}) ( : {num int & nnz & nr}) :=
Signed.mk (intmul_snum_subproof x n).
Lemma
( : {num R & xnz & xr}) :
Signed.spec 0 xnz xr (x%:num^-1 : R).
Canonical
natmul_snum : forall {R : numDomainType} [xnz nnz : KnownSign.nullity] [xr nr : KnownSign.reality], {num R & xnz & xr}%R -> {compare 0 & nnz & nr} -> {compare 0%R & mul_nonzero_subdef xnz nnz xr nr & mul_reality_subdef xnz nnz xr nr} natmul_snum is not universe polymorphic Arguments natmul_snum {R} [xnz nnz]%snum_nullity_scope [xr nr]%snum_sign_scope x n natmul_snum is transparent Expands to: Constant mathcomp.reals.signed.natmul_snum Declared in library mathcomp.reals.signed, line 815, characters 10-21
Source code
Signed.mk (inv_snum_subproof x).
Definition
intmul_snum : forall {R : numDomainType} [xnz nnz : KnownSign.nullity] [xr nr : KnownSign.reality], {num R & xnz & xr}%R -> {num int & nnz & nr}%R -> {compare 0%R & mul_nonzero_subdef xnz nnz xr nr & mul_reality_subdef xnz nnz xr nr} intmul_snum is not universe polymorphic Arguments intmul_snum {R} [xnz nnz]%snum_nullity_scope [xr nr]%snum_sign_scope x n intmul_snum is transparent Expands to: Constant mathcomp.reals.signed.intmul_snum Declared in library mathcomp.reals.signed, line 835, characters 10-21
Source code
( : reality) : nullity :=
nz_of_bool (xnz || match nr with Real (Sign =0) => true | _ => false end).
Arguments exprn_nonzero_subdef /.
Definition
inv_snum : forall {R : numDomainType} [xnz : KnownSign.nullity] [xr : KnownSign.reality], {num R & xnz & xr}%R -> {compare 0%R & xnz & xr} inv_snum is not universe polymorphic Arguments inv_snum {R} [xnz]%snum_nullity_scope [xr]%snum_sign_scope x inv_snum is transparent Expands to: Constant mathcomp.reals.signed.inv_snum Declared in library mathcomp.reals.signed, line 847, characters 10-18
Source code
( : reality) : reality :=
match xr, nr with
| _, Real (Sign =0) => >=0
| Real (Sign =0), _ => (if nnz then =0 else >=0)%snum_sign
| Real (Sign >=0), _ => >=0
| Real _, _ => >=<0
| _, _ => >?<0
end.
Arguments exprn_reality_subdef /.
Lemma
( : {num R & xnz & xr}) ( : {compare 0%N & nnz & nr})
(
(
Signed.spec 0 rnz rrl (x%:num ^+ n%:num).
Proof.
by move: xr nr xnz nnz x n => [[[]|]|] [[[]|]|] [] []// x n;
do ?[by case: (bottom x)|by case: (bottom n)];
rewrite expf_eq0/= ?eq0// ?eq0F ?andbF//.
move: xr nr xnz nnz x n => [[[]|]|] [[[]|]|] [] []/= x [[|n]//= _] //;
do ?[by case: (bottom x)|by case: (bottom n)|by rewrite [_ || _]realX
|by rewrite eq0 expr0n|exact: exprn_ge0|by rewrite expr0 ler01].
Qed.
Canonical
exprn_nonzero_subdef : KnownSign.nullity -> KnownSign.nullity -> KnownSign.reality -> KnownSign.reality -> KnownSign.nullity exprn_nonzero_subdef is not universe polymorphic Arguments exprn_nonzero_subdef (xnz nnz)%snum_nullity_scope (xr nr)%snum_sign_scope exprn_nonzero_subdef is transparent Expands to: Constant mathcomp.reals.signed.exprn_nonzero_subdef Declared in library mathcomp.reals.signed, line 850, characters 11-31
Source code
( : {num R & xnz & xr}) ( : {compare 0%N & nnz & nr}) :=
Signed.mk (exprn_snum_subproof x n).
Lemma
Signed.spec 0 ?=0 >=0 `|x|.
Proof.
Canonical
exprn_reality_subdef : KnownSign.nullity -> KnownSign.nullity -> KnownSign.reality -> KnownSign.reality -> KnownSign.reality exprn_reality_subdef is not universe polymorphic Arguments exprn_reality_subdef (xnz nnz)%snum_nullity_scope (xr nr)%snum_sign_scope exprn_reality_subdef is transparent Expands to: Constant mathcomp.reals.signed.exprn_reality_subdef Declared in library mathcomp.reals.signed, line 855, characters 11-31
Source code
Signed.mk (norm_snum_subproof x).
End NumDomainStability.
Section RcfStability.
Context { : rcfType}.
Definition
exprn_snum : forall {R : numDomainType} [xnz nnz : KnownSign.nullity] [xr nr : KnownSign.reality], {num R & xnz & xr}%R -> {compare 0 & nnz & nr} -> {compare 0%R & exprn_nonzero_subdef xnz nnz xr nr & exprn_reality_subdef xnz nnz xr nr} exprn_snum is not universe polymorphic Arguments exprn_snum {R} [xnz nnz]%snum_nullity_scope [xr nr]%snum_sign_scope x n exprn_snum is transparent Expands to: Constant mathcomp.reals.signed.exprn_snum Declared in library mathcomp.reals.signed, line 881, characters 10-20
Source code
if xr is Real (Sign >=0) then xnz else MaybeZero.
Arguments sqrt_nonzero_subdef /.
Lemma
( := sqrt_nonzero_subdef xnz xr) :
Signed.spec 0 nz >=0 (Num.sqrt x%:num).
Proof.
Canonical
norm_snum : forall {R : numDomainType} {V : normedZmodType R}, V -> {compare 0%R & ?=0 & >=0} norm_snum is not universe polymorphic Arguments norm_snum {R V} x%ring_scope norm_snum is transparent Expands to: Constant mathcomp.reals.signed.norm_snum Declared in library mathcomp.reals.signed, line 889, characters 10-19
Source code
Signed.mk (sqrt_snum_subproof x).
End RcfStability.
Section NumClosedStability.
Context { : numClosedFieldType}.
Definition
sqrt_nonzero_subdef : KnownSign.nullity -> KnownSign.reality -> KnownSign.nullity sqrt_nonzero_subdef is not universe polymorphic Arguments sqrt_nonzero_subdef xnz%snum_nullity_scope xr%snum_sign_scope sqrt_nonzero_subdef is transparent Expands to: Constant mathcomp.reals.signed.sqrt_nonzero_subdef Declared in library mathcomp.reals.signed, line 897, characters 11-30
Source code
match xr with
| Real (Sign =0) => =0
| Real (Sign >=0) => >=0
| _ => >?<0
end.
Arguments sqrtC_reality_subdef /.
Lemma
( := sqrtC_reality_subdef xnz xr) :
Signed.spec 0 xnz r (sqrtC x%:num).
Proof.
Canonical
sqrt_snum : forall {R : rcfType} [xnz : KnownSign.nullity] [xr : KnownSign.reality], {num R & xnz & xr}%R -> {compare 0%R & sqrt_nonzero_subdef xnz xr & >=0} sqrt_snum is not universe polymorphic Arguments sqrt_snum {R} [xnz]%snum_nullity_scope [xr]%snum_sign_scope x sqrt_snum is transparent Expands to: Constant mathcomp.reals.signed.sqrt_snum Declared in library mathcomp.reals.signed, line 909, characters 10-19
Source code
Signed.mk (sqrtC_snum_subproof x).
End NumClosedStability.
Section NatStability.
Local Open Scope nat_scope.
Implicit Type (n : nat).
Lemma
Proof.
Canonical
sqrtC_reality_subdef : KnownSign.nullity -> KnownSign.reality -> KnownSign.reality sqrtC_reality_subdef is not universe polymorphic Arguments sqrtC_reality_subdef xnz%snum_nullity_scope xr%snum_sign_scope sqrtC_reality_subdef is transparent Expands to: Constant mathcomp.reals.signed.sqrtC_reality_subdef Declared in library mathcomp.reals.signed, line 917, characters 11-31
Source code
Lemma
Proof.
Canonical
sqrtC_snum : forall {R : numClosedFieldType} [xnz : KnownSign.nullity] [xr : KnownSign.reality], {num R & xnz & xr}%R -> {compare 0%R & xnz & sqrtC_reality_subdef xnz xr} sqrtC_snum is not universe polymorphic Arguments sqrtC_snum {R} [xnz]%snum_nullity_scope [xr]%snum_sign_scope x sqrtC_snum is transparent Expands to: Constant mathcomp.reals.signed.sqrtC_snum Declared in library mathcomp.reals.signed, line 934, characters 10-20
Source code
Lemma
Signed.spec 0 nz r x%:num.*2.
Proof.
Canonical
zeron_snum : {compare 0 & ?=0 & =0} zeron_snum is not universe polymorphic zeron_snum is transparent Expands to: Constant mathcomp.reals.signed.zeron_snum Declared in library mathcomp.reals.signed, line 946, characters 10-20
Source code
Signed.mk (@double_snum_subproof nz r x).
Lemma
( : {compare 0 & xnz & xr}) ( : {compare 0 & ynz & yr})
(
(
Signed.spec 0 rnz rrl (x%:num + y%:num).
Proof.
by move: xr yr xnz ynz x y => [[[]|]|] [[[]|]|] [] []//= [[|x]//= _] [[|y]].
Qed.
Canonical
succn_snum : nat -> {compare 0 & !=0 & >=0} succn_snum is not universe polymorphic Arguments succn_snum n%nat_scope succn_snum is transparent Expands to: Constant mathcomp.reals.signed.succn_snum Declared in library mathcomp.reals.signed, line 951, characters 10-20
Source code
( : {compare 0 & xnz & xr}) ( : {compare 0 & ynz & yr}) :=
Signed.mk (addn_snum_subproof x y).
Lemma
( : {compare 0 & xnz & xr}) ( : {compare 0 & ynz & yr})
(
(
Signed.spec 0 rnz rrl (x%:num * y%:num).
Proof.
Canonical
double_snum : forall [nz : KnownSign.nullity] [r : KnownSign.reality], {compare 0 & nz & r} -> {compare 0 & nz & r} double_snum is not universe polymorphic Arguments double_snum [nz]%snum_nullity_scope [r]%snum_sign_scope x double_snum is transparent Expands to: Constant mathcomp.reals.signed.double_snum Declared in library mathcomp.reals.signed, line 957, characters 10-21
Source code
( : {compare 0 & xnz & xr}) ( : {compare 0 & ynz & yr}) :=
Signed.mk (muln_snum_subproof x y).
Lemma
( : {compare 0 & xnz & xr}) ( : {compare 0 & nnz & nr})
(
(
Signed.spec 0 rnz rrl (x%:num ^ n%:num).
Proof.
move: xr nr xnz nnz x n => [[[]|]|] [[[]|]|] [] []// x n;
do ?[by case: (bottom x)|by case: (bottom n)
|by rewrite ?eq0 ?expn0// expn_eq0 ?eq0F].
move: xr nr xnz nnz x n => [[[]|]|] [[[]|]|] [] []/= x [[|n]//= _] //;
do ?[by case: (bottom x)|by case: (bottom n)|by rewrite eq0 exp0n].
Qed.
Canonical
addn_snum : forall [xnz ynz : KnownSign.nullity] [xr yr : KnownSign.reality], {compare 0 & xnz & xr} -> {compare 0 & ynz & yr} -> {compare 0 & add_nonzero_subdef xnz ynz xr yr & add_reality_subdef xnz ynz xr yr} addn_snum is not universe polymorphic Arguments addn_snum [xnz ynz]%snum_nullity_scope [xr yr]%snum_sign_scope x y addn_snum is transparent Expands to: Constant mathcomp.reals.signed.addn_snum Declared in library mathcomp.reals.signed, line 970, characters 10-19
Source code
( : {compare 0 & xnz & xr}) ( : {compare 0 & nnz & nr}) :=
Signed.mk (expn_snum_subproof x n).
Lemma
( : {compare 0 & xnz & xr}) ( : {compare 0 & ynz & yr})
(
(
Signed.spec 0 rnz rrl (min x%:num y%:num).
Proof.
by move: xr yr xnz ynz x y => [[[]|]|] [[[]|]|] [] []//= [[|x]//= _] [[|y]].
Qed.
Canonical
muln_snum : forall [xnz ynz : KnownSign.nullity] [xr yr : KnownSign.reality], {compare 0 & xnz & xr} -> {compare 0 & ynz & yr} -> {compare 0 & mul_nonzero_subdef xnz ynz xr yr & mul_reality_subdef xnz ynz xr yr} muln_snum is not universe polymorphic Arguments muln_snum [xnz ynz]%snum_nullity_scope [xr yr]%snum_sign_scope x y muln_snum is transparent Expands to: Constant mathcomp.reals.signed.muln_snum Declared in library mathcomp.reals.signed, line 985, characters 10-19
Source code
( : {compare 0 & xnz & xr}) ( : {compare 0 & ynz & yr}) :=
Signed.mk (minn_snum_subproof x y).
Lemma
( : {compare 0 & xnz & xr}) ( : {compare 0 & ynz & yr})
(
(
Signed.spec 0 rnz rrl (maxn x%:num y%:num).
Proof.
Canonical
expn_snum : forall [xnz nnz : KnownSign.nullity] [xr nr : KnownSign.reality], {compare 0 & xnz & xr} -> {compare 0 & nnz & nr} -> {compare 0 & exprn_nonzero_subdef xnz nnz xr nr & exprn_reality_subdef xnz nnz xr nr} expn_snum is not universe polymorphic Arguments expn_snum [xnz nnz]%snum_nullity_scope [xr nr]%snum_sign_scope x n expn_snum is transparent Expands to: Constant mathcomp.reals.signed.expn_snum Declared in library mathcomp.reals.signed, line 1003, characters 10-19
Source code
( : {compare 0 & xnz & xr}) ( : {compare 0 & ynz & yr}) :=
Signed.mk (maxn_snum_subproof x y).
End NatStability.
Section IntStability.
Lemma
( : {compare 0%N & xnz & xr}) :
Signed.spec 0%Z xnz xr (Posz x%:num).
Proof.
Canonical
minn_snum : forall [xnz ynz : KnownSign.nullity] [xr yr : KnownSign.reality], {compare 0 & xnz & xr} -> {compare 0 & ynz & yr} -> {compare 0 & min_nonzero_subdef xnz ynz xr yr & min_reality_subdef xnz ynz xr yr} minn_snum is not universe polymorphic Arguments minn_snum [xnz ynz]%snum_nullity_scope [xr yr]%snum_sign_scope x y minn_snum is transparent Expands to: Constant mathcomp.reals.signed.minn_snum Declared in library mathcomp.reals.signed, line 1017, characters 10-19
Source code
( : {compare 0%N & xnz & xr}) :=
Signed.mk (Posz_snum_subproof x).
Lemma
Proof.
Canonical
maxn_snum : forall [xnz ynz : KnownSign.nullity] [xr yr : KnownSign.reality], {compare 0 & xnz & xr} -> {compare 0 & ynz & yr} -> {compare 0 & max_nonzero_subdef xnz ynz xr yr & max_reality_subdef xnz ynz xr yr} maxn_snum is not universe polymorphic Arguments maxn_snum [xnz ynz]%snum_nullity_scope [xr yr]%snum_sign_scope x y maxn_snum is transparent Expands to: Constant mathcomp.reals.signed.maxn_snum Declared in library mathcomp.reals.signed, line 1032, characters 10-19
Source code
End IntStability.
Section Morph0.
Context { : numDomainType} {
Local Notation := {num R & ?=0 & cond}.
Implicit Types x y : nR.
Local Notation
Lemma
Proof.
End Morph0.
Section Morph.
Context { : Order.disp_t} { : porderType d}.
Context { : T} { : nullity} {
Local Notation := {compare x0 & nz & cond}.
Implicit Types x y : sT.
Local Notation
Lemma
Proof.
Proof.
Proof.
Lemma
End Morph.
Section MorphNum.
Context { : numDomainType} { : nullity} {
Local Notation := {num R & nz & cond}.
Implicit Types (a : R) (x y : nR).
Local Notation
Lemma
Proof.
End MorphNum.
Section MorphReal.
Context { : numDomainType} { : nullity} { : real}.
Local Notation := {num R & nz & r}.
Implicit Type x y : nR.
Local Notation
Lemma
a <= Num.max x%:num y%:num = (a <= x%:num) || (a <= y%:num).
Proof.
Lemma
Num.max x%:num y%:num <= a = (x%:num <= a) && (y%:num <= a).
Proof.
Lemma
a <= Num.min x%:num y%:num = (a <= x%:num) && (a <= y%:num).
Proof.
Lemma
Num.min x%:num y%:num <= a = (x%:num <= a) || (y%:num <= a).
Proof.
Lemma
a < Num.max x%:num y%:num = (a < x%:num) || (a < y%:num).
Proof.
Lemma
Num.max x%:num y%:num < a = (x%:num < a) && (y%:num < a).
Proof.
Lemma
a < Num.min x%:num y%:num = (a < x%:num) && (a < y%:num).
Proof.
Lemma
Num.min x%:num y%:num < a = (x%:num < a) || (y%:num < a).
Proof.
End MorphReal.
Section MorphGe0.
Context { : numDomainType} { : nullity}.
Local Notation := {num R & ?=0 & >=0}.
Implicit Type x y : nR.
Local Notation
Lemma
Lemma
End MorphGe0.
Section Posnum.
Context ( : numDomainType) ( : R) (
Lemma
Proof.
Posz_snum : forall [xnz : KnownSign.nullity] [xr : KnownSign.reality], {compare 0 & xnz & xr} -> {compare 0%Z & xnz & xr} Posz_snum is not universe polymorphic Arguments Posz_snum [xnz]%snum_nullity_scope [xr]%snum_sign_scope x Posz_snum is transparent Expands to: Constant mathcomp.reals.signed.Posz_snum Declared in library mathcomp.reals.signed, line 1047, characters 10-19
Source code
End Posnum.
Definition
Negz_snum : nat -> {compare 0%Z & !=0 & <=0} Negz_snum is not universe polymorphic Arguments Negz_snum n%nat_scope Negz_snum is transparent Expands to: Constant mathcomp.reals.signed.Negz_snum Declared in library mathcomp.reals.signed, line 1054, characters 10-19
Source code
(@Signed.mk _ _ 0 ?=0 >=0 x x_ge0).
CoInductive
R -> bool -> bool -> bool -> Type :=
|
Lemma
posnum_spec x x (x == 0) (0 <= x) (0 < x).
Proof.
by rewrite -[x]/(PosNum x_gt0)%:num; constructor.
Qed.
CoInductive
|
Lemma
Variable : numDomainType.
Implicit Types r : R.
Lemma
Proof.
Lemma
(r ^+ n).~ = (NngNum (onemX_ge0 n r0 r1))%:num.
Proof.
Lemma
Definition
PosNum : forall [R : numDomainType] [x : R], (0 < x)%R -> {posnum R}%R PosNum is not universe polymorphic Arguments PosNum [R] [x]%ring_scope x_gt0 PosNum is transparent Expands to: Constant mathcomp.reals.signed.PosNum Declared in library mathcomp.reals.signed, line 1153, characters 11-17
Source code
NngNum (onem_nonneg_proof p1).
End onem_signed.