Module mathcomp.classical.unstable

From HB Require Import structures.
From mathcomp Require Import boot order finmap ssralg ssrnum ssrint.
From mathcomp Require Import vector archimedean interval matrix.

# Unstable This files contains lemmas that should eventually be backported to mathcomp. These lemmas may change before being backported to mathcomp, don't use anything in this file outside of Analysis. For this same reason, nothing in this file should be mentioned in the changelog. Once a result is backported to mathcomp, please move it to mathcomp_extra.v and mention it in the changelog. ``` clamp x := max (min x max) min swap x := (x.2, x.1) map_pair f x := (f x.1, f x.2) nondecreasing_fun f == the function f is non-decreasing nonincreasing_fun f == the function f is non-increasing increasing_fun f == the function f is (strictly) increasing decreasing_fun f == the function f is (strictly) decreasing nondecreasing_seq u == the sequence u is non-decreasing nonincreasing_seq u == the sequence u is non-increasing monotonic A f := {in A &, {homo f : x y / x <= y}} \/ {in A &, {homo f : x y /~ x <= y}} strict_monotonic A f := {in A &, {homo f : x y / x < y}} \/ {in A &, {homo f : x y /~ x < y}} sigT_fun f := lifts a family of functions f into a function on the dependent sum prodA x := sends (X * Y) * Z to X * (Y * Z) prodAr x := sends X * (Y * Z) to (X * Y) * Z isSemiNorm f == f : K -> L is a seminorm K is a numDomainType. L is a lmodType K. The HB class is SemiNorm. isNorm f == f : K -> L is a norm K is a numDomainType. L is a lmodType K. The HB class is Norm. ``` `with_basis basisB` : where `basisB` is a proof of `basis_of fullv B` : with `B : (dim E).-tuple E` (`E : vectType K` and `K` a `fieldType`) ``` Module MaxNngComLaw == contains on instance of Monoid.isComLaw on (@maxr {nonneg _}) to be used with caution ``` In module `EndlessDense`: ``` is_endless {d} T == forall x, (exists y, y < x) /\ (exists y, x < y) is_dense {d} T == forall x y, x < y -> exists z, x < z < y ``` The implementation of this module is likely to change following the review of https://github.com/math-comp/math-comp/pull/1597.

Attributes warn(note="The unstable.v file should only be used inside analysis.",
  cats="internal-analysis").

Set Implicit Arguments.
Unset Strict Implicit.
Unset Printing Implicit Defensive.

Import Order.TTheory GRing.Theory Num.Theory.
Local Open Scope ring_scope.

Section Clamp.
Context {RSource code : realDomainType} (minSource code maxSource code : R).
Hypothesis minmaxSource code : min <= max.

Definition clamp
Source code
 (xSource code : R) := Num.max (Num.min x max) min.

Lemma clamp_geminSource code xSource code : min <= clamp x.
Proof.
by rewrite le_max lexx orbT. Qed.

Lemma clamp_lemaxSource code xSource code : clamp x <= max.
Proof.
by rewrite ge_max ge_min lexx minmax orbT. Qed.

Definition clamp_gele
Source code
:= (clamp_gemin, clamp_lemax).

Lemma minmax_clampSource code xSource code : min <= x <= max -> clamp x = x.
Proof.
by case/andP => minx xmax; rewrite /clamp min_l ?max_l. Qed.

Lemma clamp_idSource code xSource code : clamp (clamp x) = clamp x.
Proof.
by rewrite minmax_clamp// !clamp_gele. Qed.

Lemma clamp_minSource code : clamp min = min.
Proof.
by rewrite minmax_clamp// lexx minmax. Qed.

Lemma clamp_maxSource code : clamp max = max.
Proof.
by rewrite minmax_clamp// lexx minmax. Qed.

End Clamp.

Module OrderSource code.
Import Order.
Definition default_display

clamp_gele : forall {R : realDomainType} [min max : R], (min <= max)%R -> (forall x : R, (min <= clamp min max x)%R) * (forall x : R, (clamp min max x <= max)%R) clamp_gele is not universe polymorphic Arguments clamp_gele {R} [min max]%_ring_scope minmax clamp_gele is transparent Expands to: Constant mathcomp.classical.unstable.clamp_gele Declared in library mathcomp.classical.unstable, line 85, characters 11-21


Used by
  • mathcomp.classical.boolp

Source code
: disp_t.
Proof.
exact: Disp tt tt. Defined.
End Order.

Definition proj
Used by
  • mathcomp.analysis.cantor
  • mathcomp.analysis.topology_theory.function_spaces
  • mathcomp.analysis.homotopy_theory.wedge_sigT

Source code
{ISource code} {TSource code : I -> Type} iSource code (fSource code : forall iSource code, T i) := f i.

Section DFunWith.
Variables (I'Source code : eqType) (TSource code : I' -> Type) (fSource code : forall iSource code, T i).

Lemma projKUsed by
  • mathcomp.analysis.topology_theory.function_spaces

Source code
iSource code (xSource code : T i) : cancel (@dfwith _ _ f i) (proj i).
Proof.
by move=> z; rewrite /proj dfwith_in. Qed.

End DFunWith.

Lemma sub_row_mxUsed by
  • mathcomp.analysis.normedtype_theory.matrix_normedtype

Source code
{VSource code : zmodType} mSource code n1Source code n2Source code (A1Source code : 'M[V]_(m, n1)) (A2Source code : 'M[V]_(m, n2))
    (B1Source code : 'M[V]_(m, n1)) (B2Source code : 'M[V]_(m, n2)) :
  row_mx A1 A2 - row_mx B1 B2 = row_mx (A1 - B1) (A2 - B2).
Proof.
by rewrite opp_row_mx add_row_mx. Qed.

Section IntervalNumDomain.
Variable RSource code : numDomainType.
Implicit Types x : R.

Lemma oppr_itvNySource code baSource code bbSource code (xaSource code xbSource code xSource code : R) :
  (- x \in Interval (BInfty _ ba) (BSide bb xb)) =
  (x \in Interval (BSide (~~ bb) (- xb)) (BInfty _ (~~ ba))).
Proof.
by rewrite !itv_boundlr /<=%O /= !implybF if_neg lteifNl andbC.
Qed.

Lemma oppr_itvyUsed by
  • mathcomp.classical.set_interval

Source code
baSource code bbSource code (xaSource code xSource code : R) :
  (- x \in Interval (BSide ba xa) (BInfty _ bb)) =
  (x \in Interval (BInfty _ (~~ bb)) (BSide (~~ ba) (- xa))).
Proof.
by rewrite !itv_boundlr /<=%O /= !implybF if_neg lteifNr negbK andbC.
Qed.

End IntervalNumDomain.

Lemma coprime_prodrSource code (ISource code : Type) (rSource code : seq I) (PSource code : {pred I}) (FSource code : I -> nat) (aSource code : I)
    (lSource code : seq I) :
  all (coprime (F a)) [seq F i | iSource code <- [seq iSource code <- l | P i]] ->
  coprime (F a) (\prod_(jSource code <- l | P j) F j).
Proof.
elim: l => /= [_|h t ih]; first by rewrite big_nil coprimen1.
rewrite big_cons; case: ifPn => // Ph.
rewrite map_cons => /= /andP[FaFh FatP].
by rewrite coprimeMr FaFh/= ih.
Qed.

Lemma Gauss_dvd_prodSource code (ISource code : eqType) (rSource code : seq I) (PSource code : {pred I}) (FSource code : I -> nat)
    (nSource code : nat) :
  pairwise coprime [seq F i | iSource code <- [seq iSource code <- r | P i]] ->
  reflect (forall iSource code, i \in r -> P i -> F i %| n)
          (\prod_(iSource code <- r | P i) F i %| n).
Proof.
elim: r => /= [_|a l HI].
  by rewrite big_nil dvd1n; apply: ReflectT => i; rewrite in_nil.
rewrite big_cons; case: ifP => [Pa|nPa]; last first.
  move/HI/equivP; apply; split=> [Fidvdn i|Fidvdn i il].
    by rewrite in_cons => /predU1P[->|]; [rewrite nPa|exact: Fidvdn].
  by apply: Fidvdn; rewrite in_cons il orbT.
rewrite map_cons pairwise_cons => /andP[allcoprimea pairwisecoprime].
rewrite Gauss_dvd; first exact: coprime_prodr.
apply: (equivP (andPP idP (HI pairwisecoprime))).
split=> [[Fadvdn Fidvdn] i|Fidvdn].
  by rewrite in_cons => /predU1P[->//|]; exact: Fidvdn.
split=> [|i il].
  by apply: Fidvdn => //; exact: mem_head.
by apply: Fidvdn; rewrite in_cons il orbT.
Qed.

Lemma expn_prodUsed by
  • mathcomp.analysis.showcase.pnt

Source code
 (ISource code : eqType) (rSource code : seq I) (PSource code : {pred I}) (FSource code : I -> nat)
    (nSource code : nat) :
  ((\prod_(iSource code <- r | P i) F i) ^ n = \prod_(iSource code <- r | P i) (F i) ^ n)%N.
Proof.
elim: r => [|a l]; first by rewrite !big_nil exp1n.
by rewrite !big_cons; case: ifPn => // Pa <-; rewrite expnMn.
Qed.

Lemma leq_Mprod_prodDSource code (xSource code ySource code nSource code mSource code : nat) : (n <= x)%N -> (m <= y)%N ->
  (\prod_(m <= iSource code < y) i * \prod_(n <= iSource code < x) i <= \prod_(n + m <= iSource code < x + y) i)%N.
Proof.
move=> nx my; rewrite big_addn -addnBA//.
rewrite [in leqRHS]/index_iota -addnBAC// iotaD big_cat/=.
rewrite mulnC leq_mul//.
  by apply: leq_prod; move=> i _; rewrite leq_addr.
rewrite subnKC//.
rewrite -[in leqLHS](add0n m) big_addn.
rewrite [in leqRHS](_ : y - m = ((y - m + x) - x))%N.
  by rewrite -addnBA// subnn addn0.
rewrite -[X in iota X _](add0n x) big_addn -addnBA// subnn addn0.
by apply: leq_prod => i _; rewrite leq_add2r leq_addr.
Qed.

Lemma leq_fact2Used by
  • mathcomp.analysis.probability_theory.beta_distribution

Source code
 (xSource code ySource code nSource code mSource code : nat) : (n <= x) %N -> (m <= y)%N ->
  (x`! * y`! * ((n + m).+1)`! <= n`! * m`! * ((x + y).+1)`!)%N.
Proof.
move=> nx my.
rewrite (fact_split nx) -!mulnA leq_mul2l; apply/orP; right.
rewrite (fact_split my) mulnCA -!mulnA leq_mul2l; apply/orP; right.
rewrite [leqRHS](_ : _ =
    (n + m).+1`! * \prod_((n + m).+2 <= iSource code < (x + y).+2) i)%N.
  by rewrite -fact_split// ltnS leq_add.
rewrite mulnA mulnC leq_mul2l; apply/orP; right.
do 2 rewrite -addSn -addnS.
exact: leq_Mprod_prodD.
Qed.

Notation trivialUsed by
  • mathcomp.analysis.topology_theory.edist

Source code
:= (ltac:(done)).

Lemma leq_ltn_expnUsed by
  • mathcomp.analysis.normedtype_theory.vitali_lemma

Source code
mSource code : exists nSource code, (2 ^ n <= m.+1 < 2 ^ n.+1)%N.
Proof.
elim: m => [|m [n /andP[h1 h2]]]; first by exists O.
have [m2n|nm2] := ltnP m.+2 (2 ^ n.+1)%N.
  by exists n; rewrite m2n andbT (leq_trans h1).
exists n.+1; rewrite nm2/= -addn1.
rewrite -[X in (_ <= X)%N]prednK ?expn_gt0// -[X in (_ <= X)%N]addn1 leq_add2r.
by rewrite (leq_trans h2)// -subn1 leq_subRL ?expn_gt0// add1n ltn_exp2l.
Qed.

Notation "'nondecreasing_fun' f"Used by
  • mathcomp.analysis.probability_theory.random_variable
  • mathcomp.analysis.real_measure.measurable_realfun
  • mathcomp.analysis.realfun
  • mathcomp.analysis.numfun

Source code
:= ({homo f : nSource code mSource code / (n <= m)%O >-> (n <= m)%O})
  (at level 10).
Notation "'nonincreasing_fun' f"Used by
  • mathcomp.analysis.probability_theory.random_variable
  • mathcomp.analysis.real_measure.measurable_realfun
  • mathcomp.analysis.realfun
  • mathcomp.analysis.numfun

Source code
:= ({homo f : nSource code mSource code / (n <= m)%O >-> (n >= m)%O})
  (at level 10).
Notation "'increasing_fun' f"Source code := ({mono f : nSource code mSource code / (n <= m)%O >-> (n <= m)%O})
  (at level 10).
Notation "'decreasing_fun' f"Source code := ({mono f : nSource code mSource code / (n <= m)%O >-> (n >= m)%O})
  (at level 10).
Notation "'nondecreasing_seq' f"Used by
  • mathcomp.analysis.measure_theory.measurable_structure
  • mathcomp.classical.classical_sets

Source code
:= ({homo f : nSource code mSource code / (n <= m)%nat >-> (n <= m)%O})
  (at level 10).
Notation "'nonincreasing_seq' f"Used by
  • mathcomp.analysis.measure_theory.measurable_structure

Source code
:= ({homo f : nSource code mSource code / (n <= m)%nat >-> (n >= m)%O})
  (at level 10).

Definition monotonic
Used by
  • mathcomp.analysis.normedtype_theory.num_normedtype

Source code
dSource code (TSource code : porderType d) d'Source code (T'Source code : porderType d')
    (pTSource code : predType T) (ASource code : pT) (fSource code : T -> T') :=
  {in A &, nondecreasing f} \/ {in A &, {homo f : xSource code ySource code /~ (x <= y)%O}}.

Definition strict_monotonic

Order.default_display : disp_t Order.default_display is not universe polymorphic Order.default_display is transparent Expands to: Constant mathcomp.classical.unstable.Order.default_display Declared in library mathcomp.classical.unstable, line 103, characters 11-26


Used by
  • mathcomp.analysis.realfun
  • mathcomp.analysis.normedtype_theory.num_normedtype

Source code
dSource code (TSource code : porderType d) d'Source code (T'Source code : porderType d')
    (pTSource code : predType T) (ASource code : pT) (fSource code : T -> T') :=
  {in A &, {homo f : xSource code ySource code / (x < y)%O}} \/ {in A &, {homo f : xSource code ySource code /~ (x < y)%O}}.

Lemma strict_monotonicWUsed by
  • mathcomp.analysis.realfun

Source code
dSource code (TSource code : orderType d) d'Source code (T'Source code : porderType d')
    (pTSource code : predType T) (ASource code : pT) (fSource code : T -> T') :
  strict_monotonic A f -> monotonic A f.
Proof.
by move=> [/le_mono_in/monoW_in|/le_nmono_in/monoW_in]; [left|right].
Qed.

Lemma mono_leq_inflUsed by
  • mathcomp.analysis.showcase.pnt

Source code
fSource code : {mono f : mSource code nSource code / (m <= n)%N} -> forall nSource code, (n <= f n)%N.
Proof.
move=> fincr; elim=> [//| n HR]; rewrite (leq_ltn_trans HR)//.
by rewrite ltn_neqAle fincr (inj_eq (incn_inj fincr)) -ltn_neqAle.
Qed.

Section path_lt.
Context dSource code {TSource code : orderType d}.
Implicit Types (a b c : T) (s : seq T).

Lemma last_filterPUsed by
  • mathcomp.analysis.numfun

Source code
aSource code (PSource code : pred T) sSource code :
  P a -> P (last a [seq xSource code <- s | P x]).
Proof.
by elim: s a => //= t1 t2 ih a Pa; case: ifPn => //= Pt1; exact: ih.
Qed.

Lemma path_lt_filter0Used by
  • mathcomp.analysis.numfun

Source code
aSource code sSource code : path <%O a s -> [seq xSource code <- s | (x < a)%O] = [::].
Proof.
move=> /lt_path_min/allP sa; rewrite -(filter_pred0 s).
apply: eq_in_filter => x xs.
by apply/negbTE; have := sa _ xs; rewrite ltNge; apply: contra => /ltW.
Qed.

Lemma path_lt_filterTUsed by
  • mathcomp.analysis.numfun

Source code
aSource code sSource code : path <%O a s -> [seq xSource code <- s | (a < x)%O] = s.
Proof.
move=> /lt_path_min/allP sa; rewrite -[RHS](filter_predT s).
by apply: eq_in_filter => x xs; exact: sa.
Qed.

Lemma path_lt_headUsed by
  • mathcomp.analysis.numfun

Source code
aSource code bSource code sSource code : (a < b)%O -> path <%O b s -> path <%O a s.
Proof.
by elim: s b => // h t ih b /= ab /andP[bh ->]; rewrite andbT (lt_trans ab).
Qed.

Lemma path_lt_last_filterUsed by
  • mathcomp.analysis.numfun

Source code
aSource code bSource code cSource code sSource code :
  (a < c)%O -> (c < b)%O -> path <%O a s -> last a s = b ->
  last c [seq xSource code <- s | (c < x)%O] = b.
Proof.
elim/last_ind : s a b c => /= [|h t ih a b c ac cb].
  move=> a b c ac cb _ ab.
  by apply/eqP; rewrite eq_le (ltW cb) -ab (ltW ac).
rewrite rcons_path => /andP[ah ht]; rewrite last_rcons => tb.
by rewrite filter_rcons tb cb last_rcons.
Qed.

Lemma path_lt_le_lastUsed by
  • mathcomp.analysis.realfun

Source code
aSource code sSource code : path <%O a s -> (a <= last a s)%O.
Proof.
elim: s a => // a [_ c /andP[/ltW//]|b t ih i/= /and3P[ia ab bt]] /=.
have /= := ih a; rewrite ab bt => /(_ erefl).
by apply: le_trans; exact/ltW.
Qed.

End path_lt.
Arguments last_filterP {d T a} P s.

Inductive boxedSource code TSource code := BoxUsed by
  • mathcomp.analysis.real_measure.lebesgue_measure

Source code
of T.

Reserved Notation "`1- r" (format "`1- r", at level 2).
Reserved Notation "f \^-1" (at level 1, format "f \^-1").

Lemma fset_nat_maximumSource code (XSource code : choiceType) (ASource code : {fset X})
    (fSource code : X -> nat) : A != fset0 ->
  (exists iSource code, i \in A /\ forall jSource code, j \in A -> f j <= f i)%nat.
Proof.
move=> /fset0Pn[x Ax].
have [/= y _ /(_ _ isT) mf] := @arg_maxnP _ [` Ax]%fset xpredT (f \o val) isT.
exists (val y); split; first exact: valP.
by move=> z Az; have := mf [` Az]%fset.
Qed.

Lemma image_nat_maximumSource code nSource code (fSource code : nat -> nat) :
  (exists iSource code, i <= n /\ forall jSource code, j <= n -> f j <= f i)%N.
Proof.
have [i _ /(_ _ isT) mf] := @arg_maxnP _ (@ord0 n) xpredT f isT.
by exists i; split; rewrite ?leq_ord// => j jn; have := mf (@Ordinal n.+1 j jn).
Qed.

Arguments big_rmcond {R idx op I r} P.
Arguments big_rmcond_in {R idx op I r} P.

Reserved Notation "`1- x" (format "`1- x", at level 2).

Lemma card_big_setUUsed by
  • mathcomp.analysis.showcase.pnt

Source code
 (ISource code : Type) (TSource code : finType) (rSource code : seq I) (PSource code : {pred I})
    (FSource code : I -> {set T}) :
  (#|\bigcup_(iSource code <- r | P i)  F i| <= \sum_(iSource code <- r | P i) #|F i|)%N.
Proof.
elim/big_ind2 : _ => // [|m A n B Am Bn]; first by rewrite cards0.
by rewrite (leq_trans (leq_card_setU _ _))// leq_add.
Qed.

Definition onem

proj : forall {I : Type} {T : I -> Type} (i : I), (forall i0 : I, T i0) -> T i proj is not universe polymorphic Arguments proj {I}%_type_scope {T}%_function_scope i f%_function_scope proj is transparent Expands to: Constant mathcomp.classical.unstable.proj Declared in library mathcomp.classical.unstable, line 108, characters 11-15


Used by
  • mathcomp.analysis.probability_theory.beta_distribution
  • mathcomp.analysis.hoelder
  • mathcomp.analysis.realfun
  • mathcomp.analysis.ftc
  • mathcomp.analysis.convex
  • mathcomp.analysis.normedtype_theory.tvs
  • mathcomp.analysis.exp
  • mathcomp.classical.set_interval

Source code
{RSource code : pzRingType} (rSource code : R) : R := 1 - r.
#[deprecated(since="mathcomp-analysis 1.15.0")]
Notation "`1- r"Source code := (onem r) : ring_scope.

Reserved Notation "p '.~'" (format "p .~", at level 1).
Notation "p '.~'"Source code := (onem p) : ring_scope.

Section onem_ring.
Context {RSource code : pzRingType}.
Implicit Type r : R.

Lemma onem0Used by
  • mathcomp.analysis.probability_theory.beta_distribution
  • mathcomp.analysis.ftc

Source code
: 0.~ = 1 :> R
Proof.
by rewrite /onem subr0. Qed.

Lemma onem1Used by
  • mathcomp.analysis.probability_theory.beta_distribution
  • mathcomp.analysis.probability_theory.binomial_distribution
  • mathcomp.analysis.ftc
  • mathcomp.analysis.convex

Source code
: 1.~ = 0 :> R
Proof.
by rewrite /onem subrr. Qed.

Lemma onemKUsed by
  • mathcomp.analysis.ftc
  • mathcomp.analysis.convex
  • mathcomp.analysis.sequences

Source code
rSource code : (r.~).~ = r
Proof.
exact: subKr. Qed.

Lemma add_onemKUsed by
  • mathcomp.analysis.probability_theory.binomial_distribution
  • mathcomp.analysis.convex
  • mathcomp.analysis.normedtype_theory.tvs
  • mathcomp.analysis.normedtype_theory.normed_module

Source code
rSource code : r + r.~ = 1
Proof.
by rewrite /onem addrC subrK. Qed.

Lemma onemDUsed by
  • mathcomp.analysis.probability_theory.binomial_distribution

Source code
rSource code sSource code : (r + s).~ = r.~ - s.
Proof.
by rewrite /onem opprD addrA. Qed.

Lemma onemMrUsed by
  • mathcomp.analysis.sequences

Source code
rSource code sSource code : s * r.~ = s - s * r.
Proof.
by rewrite /onem mulrBr mulr1. Qed.

Lemma onemMUsed by
  • mathcomp.analysis.sequences

Source code
rSource code sSource code : (r * s).~ = r.~ + s.~ - r.~ * s.~.
Proof.
by rewrite /onem mulrBl 2!mulrBr !mul1r mulr1 addrKA opprK subrKA. Qed.

End onem_ring.

Section onem_order.
Variable RSource code : numDomainType.
Implicit Types r : R.

Lemma onem_gt0Used by
  • mathcomp.analysis.hoelder
  • mathcomp.analysis.sequences
  • mathcomp.analysis.normedtype_theory.tvs
  • mathcomp.analysis.normedtype_theory.normed_module

Source code
rSource code : r < 1 -> 0 < r.~
Proof.
by rewrite subr_gt0. Qed.

Lemma onem_ge0Used by
  • mathcomp.analysis.probability_theory.beta_distribution
  • mathcomp.analysis.probability_theory.binomial_distribution
  • mathcomp.analysis.functional_analysis.hahn_banach_theorem
  • mathcomp.analysis.hoelder
  • mathcomp.analysis.normedtype_theory.tvs
  • mathcomp.analysis.normedtype_theory.normed_module

Source code
rSource code : r <= 1 -> 0 <= r.~.
Proof.
by rewrite le_eqVlt => /predU1P[->|/onem_gt0/ltW]; rewrite ?onem1. Qed.

Lemma onem_le1Used by
  • mathcomp.analysis.probability_theory.beta_distribution
  • mathcomp.analysis.probability_theory.binomial_distribution
  • mathcomp.analysis.hoelder

Source code
rSource code : 0 <= r -> r.~ <= 1.
Proof.
by rewrite lerBlDr lerDl. Qed.

Lemma onem_lt1Source code rSource code : 0 < r -> r.~ < 1.
Proof.
by rewrite ltrBlDr ltrDl. Qed.

Lemma onemX_ge0Source code rSource code nSource code : 0 <= r -> r <= 1 -> 0 <= (r ^+ n).~.
Proof.
by move=> ? ?; rewrite subr_ge0 exprn_ile1. Qed.

Lemma onemX_lt1Source code rSource code nSource code : 0 < r -> (r ^+ n).~ < 1.
Proof.
by move=> ?; rewrite onem_lt1// exprn_gt0. Qed.

End onem_order.

Lemma normr_onemUsed by
  • mathcomp.analysis.probability_theory.beta_distribution

Source code
{RSource code : realDomainType} (xSource code : R) :
  (0 <= x <= 1 -> `| x.~ | <= 1)%R.
Proof.
move=> /andP[x0 x1]; rewrite ler_norml; apply/andP; split.
  by rewrite lerBrDl lerBlDr (le_trans x1)// lerDl.
by rewrite lerBlDr lerDl.
Qed.

Lemma onemVUsed by
  • mathcomp.analysis.hoelder

Source code
 (FSource code : numFieldType) (xSource code : F) : x != 0 -> x^-1.~ = (x - 1) / x.
Proof.
by move=> ?; rewrite mulrDl divff// mulN1r. Qed.

Lemma divD_onemUsed by
  • mathcomp.analysis.functional_analysis.hahn_banach_theorem
  • mathcomp.analysis.normedtype_theory.tvs

Source code
 (RSource code : realFieldType) (sSource code tSource code : R) (s0Source code : 0 < s) (t0Source code : 0 < t) :
  (s / (s + t)).~ = t / (s + t).
Proof.
rewrite /onem.
by rewrite -(@divff _ (s + t)) ?gt_eqF ?addr_gt0// -mulrBl (addrC s) addrK.
Qed.

Lemma lez_abs2Source code (aSource code bSource code : int) : 0 <= a -> a <= b -> (`|a| <= `|b|)%N.
Proof.
by case: a => //= n _; case: b. Qed.

Lemma ler_gtPUsed by
  • mathcomp.analysis.derive

Source code
 (RSource code : numFieldType) (xSource code ySource code : R) :
  reflect (forall zSource code, z > y -> x <= z) (x <= y).
Proof.
apply: (equivP (ler_addgt0Pr _ _)); split=> [xy z|xz e e_gt0].
  by rewrite -subr_gt0 => /xy; rewrite addrC addrNK.
by apply: xz; rewrite -[ltLHS]addr0 ler_ltD.
Qed.

Lemma ler_ltPSource code (RSource code : numFieldType) (xSource code ySource code : R) :
  reflect (forall zSource code, z < x -> z <= y) (x <= y).
Proof.
apply: (equivP (ler_addgt0Pr _ _)); split=> [xy z|xz e e_gt0].
  by rewrite -subr_gt0 => /xy; rewrite addrCA -[leLHS]addr0 lerD2l subr_ge0.
by rewrite -lerBlDr xz// -[ltRHS]subr0 ler_ltB.
Qed.

Definition inv_fun

monotonic : forall [d : disp_t] [T : porderType d] [d' : disp_t] [T' : porderType d'] [pT : predType T], pT -> (T -> T') -> Prop monotonic is not universe polymorphic Arguments monotonic [d T d' T' pT] A f%_function_scope monotonic is transparent Expands to: Constant mathcomp.classical.unstable.monotonic Declared in library mathcomp.classical.unstable, line 239, characters 11-20


Used by
  • mathcomp.classical.functions

Source code
TSource code (RSource code : unitRingType) (fSource code : T -> R) xSource code := (f x)^-1%R.
Notation "f \^-1"Source code := (inv_fun f) : ring_scope.
Arguments inv_fun {T R} _ _ /.

Definition bound_side

strict_monotonic : forall [d : disp_t] [T : porderType d] [d' : disp_t] [T' : porderType d'] [pT : predType T], pT -> (T -> T') -> Prop strict_monotonic is not universe polymorphic Arguments strict_monotonic [d T d' T' pT] A f%_function_scope strict_monotonic is transparent Expands to: Constant mathcomp.classical.unstable.strict_monotonic Declared in library mathcomp.classical.unstable, line 243, characters 11-27


Used by
  • mathcomp.analysis.normedtype_theory.num_normedtype

Source code
dSource code (TSource code : porderType d) (cSource code : bool) (xSource code : itv_bound T) :=
  if x is BSide c' _ then c == c' else false.

Lemma real_ltr_distlCSource code [RSource code : numDomainType] [xSource code ySource code : R] (eSource code : R) :
  x - y \is Num.real -> (`|x - y| < e) = (x - e < y < x + e).
Proof.
by move=> ?; rewrite distrC real_ltr_distl// -rpredN opprB. Qed.

Definition swap

onem : forall {R : pzRingType}, R -> R onem is not universe polymorphic Arguments onem {R} r%_ring_scope onem is transparent Expands to: Constant mathcomp.classical.unstable.onem Declared in library mathcomp.classical.unstable, line 347, characters 11-15


Used by
  • mathcomp.analysis.esum
  • mathcomp.analysis.measure_theory.measurable_function
  • mathcomp.analysis.topology_theory.order_topology
  • mathcomp.analysis.topology_theory.product_topology
  • mathcomp.analysis.topology_theory.function_spaces

Source code
{T1Source code T2Source code : Type} (xSource code : T1 * T2) := (x.2, x.1).

Section reassociate_products.
Context {XSource code YSource code ZSource code : Type}.

Definition prodA

inv_fun : forall {T : Type} {R : unitRingType}, (T -> R) -> T -> R inv_fun is not universe polymorphic Arguments inv_fun {T}%_type_scope {R} f%_function_scope x / The reduction tactics unfold inv_fun when applied to 4 arguments inv_fun is transparent Expands to: Constant mathcomp.classical.unstable.inv_fun Declared in library mathcomp.classical.unstable, line 437, characters 11-18


Used by
  • mathcomp.analysis.topology_theory.product_topology
  • mathcomp.analysis.topology_theory.function_spaces

Source code
 (xyzSource code : (X * Y) * Z) : X * (Y * Z) :=
  (xyz.1.1, (xyz.1.2, xyz.2)).

Definition prodAr

bound_side : forall [d : disp_t] [T : porderType d], bool -> itv_bound T -> bool bound_side is not universe polymorphic Arguments bound_side [d T] c%_bool_scope x bound_side is transparent Expands to: Constant mathcomp.classical.unstable.bound_side Declared in library mathcomp.classical.unstable, line 441, characters 11-21


Used by
  • mathcomp.analysis.topology_theory.product_topology
  • mathcomp.analysis.topology_theory.function_spaces

Source code
 (xyzSource code : X * (Y * Z)) : (X * Y) * Z :=
  ((xyz.1, xyz.2.1), xyz.2.2).

Lemma prodAKSource code : cancel prodA prodAr.
Proof.
by case; case. Qed.

Lemma prodArKSource code : cancel prodAr prodA.
Proof.
by case => ? []. Qed.

End reassociate_products.

Lemma swapKSource code {T1Source code T2Source code : Type} : cancel (@swap T1 T2) (@swap T2 T1).
Proof.
by case=> ? ?. Qed.

Definition map_pair

swap : forall {T1 T2 : Type}, T1 * T2 -> T2 * T1 swap is not universe polymorphic Arguments swap {T1 T2}%_type_scope x swap is transparent Expands to: Constant mathcomp.classical.unstable.swap Declared in library mathcomp.classical.unstable, line 448, characters 11-15


Used by
  • mathcomp.analysis.topology_theory.uniform_structure
  • mathcomp.analysis.topology_theory.product_topology
  • mathcomp.analysis.topology_theory.function_spaces
  • mathcomp.analysis.topology_theory.initial_topology
  • mathcomp.analysis.topology_theory.subspace_topology
  • mathcomp.analysis.normedtype_theory.pseudometric_normed_Zmodule
  • mathcomp.analysis.normedtype_theory.urysohn

Source code
{SSource code USource code : Type} (fSource code : S -> U) (xSource code : S * S) : (U * U) :=
  (f x.1, f x.2).

Section order_min.
Variables (dSource code : Order.disp_t) (TSource code : orderType d).

Lemma lt_min_ltUsed by
  • mathcomp.analysis.sequences

Source code
 (xSource code ySource code zSource code : T) : (Order.min x z < Order.min y z)%O -> (x < y)%O.
Proof.
rewrite /Order.min/=; case: ifPn => xz; case: ifPn => yz; rewrite ?ltxx//.
- by move=> /lt_le_trans; apply; rewrite leNgt.
- by rewrite ltNge (ltW yz).
Qed.

End order_min.

Section bijection_forall.

Lemma bij_forallUsed by
  • mathcomp.analysis.realfun

Source code
ASource code BSource code (fSource code : A -> B) (PSource code : B -> Prop) :
  bijective f -> (forall ySource code, P y) <-> (forall xSource code, P (f x)).
Proof.
by case; rewrite /cancel => g _ cangf; split => // => ? y; rewrite -(cangf y).
Qed.

End bijection_forall.

Lemma and_prop_inSource code (TSource code : Type) (pSource code : mem_pred T) (PSource code QSource code : T -> Prop) :
  {in p, forall xSource code, P x /\ Q x} <->
  {in p, forall xSource code, P x} /\ {in p, forall xSource code, Q x}.
Proof.
split=> [cnd|[cnd1 cnd2] x xin]; first by split=> x xin; case: (cnd x xin).
by split; [apply: cnd1 | apply: cnd2].
Qed.

Lemma mem_inc_segmentUsed by
  • mathcomp.analysis.realfun

Source code
dSource code (TSource code : porderType d) (aSource code bSource code : T) (fSource code : T -> T) :
    {in `[a, b] &, {mono f : xSource code ySource code / (x <= y)%O}} ->
  {homo f : xSource code / x \in `[a, b] >-> x \in `[f a, f b]}.
Proof.
move=> fle x xab; have leab : (a <= b)%O by rewrite (itvP xab).
by rewrite in_itv/= !fle ?(itvP xab).
Qed.

Lemma mem_dec_segmentUsed by
  • mathcomp.analysis.realfun

Source code
dSource code (TSource code : porderType d) (aSource code bSource code : T) (fSource code : T -> T) :
    {in `[a, b] &, {mono f : xSource code ySource code /~ (x <= y)%O}} ->
  {homo f : xSource code / x \in `[a, b] >-> x \in `[f b, f a]}.
Proof.
move=> fge x xab; have leab : (a <= b)%O by rewrite (itvP xab).
by rewrite in_itv/= !fge ?(itvP xab).
Qed.

Definition sigT_fun

prodA : forall {X Y Z : Type}, X * Y * Z -> X * (Y * Z) prodA is not universe polymorphic Arguments prodA {X Y Z}%_type_scope xyz prodA is transparent Expands to: Constant mathcomp.classical.unstable.prodA Declared in library mathcomp.classical.unstable, line 453, characters 11-16


Used by
  • mathcomp.analysis.topology_theory.sigT_topology
  • mathcomp.analysis.homotopy_theory.wedge_sigT

Source code
{ISource code : Type} {XSource code : I -> Type} {TSource code : Type}
  (fSource code : forall iSource code, X i -> T) (xSource code : {iSource code & X i}) : T :=
  (f (projT1 x) (projT2 x)).

Section FsetPartitions.
Variables TSource code ISource code : choiceType.
Implicit Types (x y z : T) (A B D X : {fset T}) (P Q : {fset {fset T}}).
Implicit Types (J : pred I) (F : I -> {fset T}).

Variables (RSource code : Type) (idxSource code : R) (opSource code : Monoid.com_law idx).
Let rhs_condSource code PSource code KSource code ESource code :=
  (\big[op/idx]_(ASource code <- P) \big[op/idx]_(xSource code <- A | K x) E x)%fset.
Let rhsSource code PSource code ESource code := (\big[op/idx]_(ASource code <- P) \big[op/idx]_(xSource code <- A) E x)%fset.

Lemma partition_disjoint_bigfcupSource code (fSource code : T -> R) (FSource code : I -> {fset T})
  (KSource code : {fset I}) :
  (forall iSource code jSource code, i \in K -> j \in K -> i != j -> [disjoint F i & F j])%fset ->
  \big[op/idx]_(iSource code <- \big[fsetU/fset0]_(xSource code <- K) (F x)) f i =
  \big[op/idx]_(kSource code <- K) (\big[op/idx]_(iSource code <- F k) f i).
Proof.
move=> disjF; pose P := [fset F i | iSource code in K & F i != fset0]%fset.
have trivP : trivIfset P.
  apply/trivIfsetP => _ _ /imfsetP[i iK ->] /imfsetP[j jK ->] neqFij.
  move: iK; rewrite !inE/= => /andP[iK Fi0].
  move: jK; rewrite !inE/= => /andP[jK Fj0].
  by apply: (disjF _ _ iK jK); apply: contraNneq neqFij => ->.
have -> : (\bigcup_(iSource code <- K) F i)%fset = fcover P.
  apply/esym; rewrite /P fcover_imfset big_mkcond /=; apply eq_bigr => i _.
  by case: ifPn => // /negPn/eqP.
rewrite big_trivIfset // /rhs big_imfset => [i j iK /andP[jK notFj0] eqFij|] /=.
  move: iK; rewrite !inE/= => /andP[iK Fi0].
  by apply: contraNeq (disjF _ _ iK jK) _; rewrite -fsetI_eq0 eqFij fsetIid.
rewrite big_filter big_mkcond; apply eq_bigr => i _.
by case: ifPn => // /negPn /eqP ->;  rewrite big_seq_fset0.
Qed.

End FsetPartitions.

Lemma prodr_ile1Source code {RSource code : realDomainType} (sSource code : seq R) :
  (forall xSource code, x \in s -> 0 <= x <= 1)%R -> (\prod_(jSource code <- s) j <= 1)%R.
Proof.
elim: s => [_ | y s ih xs01]; rewrite ?big_nil// big_cons.
have /andP[y0 y1] : (0 <= y <= 1)%R by rewrite xs01// mem_head.
rewrite mulr_ile1 ?andbT//.
  rewrite big_seq prodr_ge0// => x xs.
  by have := xs01 x; rewrite inE xs orbT => /(_ _)/andP[].
by rewrite ih// => e xs; rewrite xs01// in_cons xs orbT.
Qed.

Lemma size_filter_gt0Source code TSource code PSource code (rSource code : seq T) : (size (filter P r) > 0)%N = (has P r).
Proof.
by elim: r => //= x r; case: ifP. Qed.

Lemma ltr_sumSource code [RSource code : numDomainType] [ISource code : Type] (rSource code : seq I)
    [PSource code : pred I] [FSource code GSource code : I -> R] :
  has P r ->
  (forall iSource code : I, P i -> F i < G i) ->
  \sum_(iSource code <- r | P i) F i < \sum_(iSource code <- r | P i) G i.
Proof.
rewrite -big_filter -[ltRHS]big_filter -size_filter_gt0.
case: filter (filter_all P r) => //= x {}r /andP[Px Pr] _ ltFG.
rewrite !big_cons ltr_leD// ?ltFG// -(all_filterP Pr) !big_filter.
by rewrite ler_sum => // i Pi; rewrite ltW ?ltFG.
Qed.

Lemma ltr_sum_natSource code [RSource code : numDomainType] [mSource code nSource code : nat] [FSource code GSource code : nat -> R] :
  (m < n)%N -> (forall iSource code : nat, (m <= i < n)%N -> F i < G i) ->
  \sum_(m <= iSource code < n) F i < \sum_(m <= iSource code < n) G i.
Proof.
move=> lt_mn i; rewrite big_nat [ltRHS]big_nat ltr_sum//.
by apply/hasP; exists m; rewrite ?mem_index_iota leqnn lt_mn.
Qed.

Lemma eq_exists2lSource code (ASource code : Type) (PSource code P'Source code QSource code : A -> Prop) :
  (forall xSource code, P x <-> P' x) ->
  (exists2 xSource code, P x & Q x) <-> (exists2 xSource code, P' x & Q x).
Proof.
by move=> eqQ; split=> -[x p q]; exists x; move: p q; rewrite ?eqQ.
Qed.

Lemma eq_exists2rUsed by
  • mathcomp.analysis.ereal

Source code
 (ASource code : Type) (PSource code QSource code Q'Source code : A -> Prop) :
  (forall xSource code, Q x <-> Q' x) ->
  (exists2 xSource code, P x & Q x) <-> (exists2 xSource code, P x & Q' x).
Proof.
by move=> eqP; split=> -[x p q]; exists x; move: p q; rewrite ?eqP.
Qed.

Declare Scope signature_scope.
Delimit Scope signature_scope with signature.

Import -(notations) Morphisms.
Arguments Proper {A}%_type R%_signature m.
Arguments respectful {A B}%_type (R R')%_signature _ _.

Module ProperNotationsSource code.

Notation " R ++> R' "Source code := (@respectful _ _ (R%signature) (R'%signature))
  (right associativity, at level 55) : signature_scope.

Notation " R ==> R' "Source code := (@respectful _ _ (R%signature) (R'%signature))
  (right associativity, at level 55) : signature_scope.

Notation " R ~~> R' "Source code := (@respectful _ _ (Program.Basics.flip (R%signature)) (R'%signature))
  (right associativity, at level 55) : signature_scope.

Export -(notations) Morphisms.
End ProperNotations.

Lemma sqrtKUsed by
  • mathcomp.analysis.realfun

Source code
{KSource code : rcfType} : {in Num.nneg, cancel (@Num.sqrt K) (fun xSource code => x ^+ 2)}.
Proof.
by move=> r r0; rewrite sqr_sqrtr. Qed.

Lemma ltr_norm_boundUsed by
  • mathcomp.experimental_reals.realsum

Source code
{RSource code : archiNumDomainType} (xSource code : R) : `|x| < (Num.bound x)%:R.
Proof.
by rewrite /Num.bound -[in ltRHS]normr_id archi_boundP. Qed.

Lemma real_ltr_boundSource code {RSource code : archiNumDomainType} (xSource code : R) :
  x \is Num.real -> x < (Num.bound x)%:R.
Proof.
by move=> /real_ler_norm /le_lt_trans -> //; apply: ltr_norm_bound. Qed.

Lemma real_ltrNboundSource code {RSource code : archiNumDomainType} (xSource code : R) :
  x \is Num.real -> - x < (Num.bound x)%:R.
Proof.
by rewrite /Num.bound -realN -normrN; exact: real_ltr_bound. Qed.

Lemma ltr_boundUsed by
  • mathcomp.analysis.real_measure.measurable_realfun
  • mathcomp.analysis.real_measure.lebesgue_stieltjes_measure
  • mathcomp.analysis.topology_theory.nat_topology
  • mathcomp.reals.real_interval

Source code
{RSource code : archiRealDomainType} (xSource code : R) : x < (Num.bound x)%:R.
Proof.
exact: real_ltr_bound. Qed.

Lemma ltrNboundUsed by
  • mathcomp.analysis.probability_theory.random_variable
  • mathcomp.analysis.real_measure.measurable_realfun
  • mathcomp.analysis.real_measure.lebesgue_stieltjes_measure
  • mathcomp.reals.real_interval

Source code
{RSource code : archiRealDomainType} (xSource code : R) : - x < (Num.bound x)%:R.
Proof.
exact: real_ltrNbound. Qed.

Module NormUsed by
  • mathcomp.analysis.functional_analysis.hahn_banach_theorem
  • mathcomp.analysis.normedtype_theory.tvs

Source code
.

HBSource code.mixinSource code RecordSource code isSemiNormSource code (KSource code :Source code numDomainTypeSource code) (L : lmodType K) (norm : L -> K) := {
  norm0 : norm 0 = 0 ;
  norm_ge0 : forall xSource code, 0 <= norm x ;
  ler_normD : forall xSource code ySource code, norm (x + y) <= norm x + norm y ;
  normZ : forall rSource code xSource code, norm (r *: x) = `|r| * norm x
}.

#[export]Source code
HBSource code.structureSource code DefinitionSource code SemiNormSource code KSource code LSource code :=Source code {Source code normSource code of @isSemiNorm K L norm }.

HBSource code.mixinSource code RecordSource code SemiNorm_isNormSource code (KSource code :Source code numDomainTypeSource code) (L : lmodType K)
  (norm : L -> K) := { norm0_eq0 : forall xSource code, norm x = 0 -> x = 0 }.

#[export]Source code
HBSource code.structureSource code DefinitionSource code NormSource code KSource code LSource code :=Source code
  { normSource code of @SemiNorm_isNorm K L norm & @SemiNorm K L norm }.

Module Import TheorySource code.
Section Theory.
Variables (KSource code : numDomainType) (LSource code : lmodType K) (normSource code : SemiNorm.type L).

Lemma normMnUsed by
  • mathcomp.analysis.normedtype_theory.normed_module

Source code
xSource code nSource code : norm (x *+ n) = norm x *+ n.
Proof.
by rewrite -scaler_nat normZ normr_nat mulr_natl. Qed.

Lemma normNUsed by
  • mathcomp.analysis.normedtype_theory.tvs
  • mathcomp.analysis.normedtype_theory.normed_module

Source code
xSource code : norm (- x) = norm x.
Proof.
by rewrite -scaleN1r normZ normrN1 mul1r. Qed.

Lemma ler_norm_sumUsed by
  • mathcomp.analysis.normedtype_theory.normed_module

Source code
 (ISource code : Type) (rSource code : seq I) (FSource code : I -> L) :
  norm (\sum_(iSource code <- r) F i) <= \sum_(iSource code <- r) norm (F i).
Proof.
by elim/big_ind2 : _ => *; rewrite ?norm0// (le_trans (ler_normD _ _))// lerD.
Qed.

End Theory.

Section realTheory.
Variables (KSource code : realDomainType) (LSource code : lmodType K) (normSource code : SemiNorm.type L).

Lemma seminorm_normrBUsed by
  • mathcomp.analysis.normedtype_theory.tvs

Source code
xSource code ySource code: `|norm x - norm y| <= norm (x - y).
Proof.
have [pxy | pyx] := leP (norm x) (norm y).
  rewrite ler0_norm ?subr_le0 // opprB.
  rewrite lerBlDl; rewrite  -(@normN _ _ norm (x-y)) opprB.
  by rewrite (le_trans _ (ler_normD _ _ )) // addrC subrK.
rewrite gtr0_norm ?subr_gt0 // lerBlDl.
by rewrite (le_trans _ (ler_normD _ _ )) // addrC subrK.
Qed.

End realTheory.
End Theory.

Module Import ExportsSource code. HB.reexport. End Exports.
End Norm.
Export Norm.Exports.

Definition with_basis

with_basis : forall {K : fieldType} {E : vectType K} {B : (dim E).-tuple E}, basis_of fullv B -> Type with_basis is not universe polymorphic Arguments with_basis {K E B} _ with_basis is transparent Expands to: Constant mathcomp.classical.unstable.with_basis Declared in library mathcomp.classical.unstable, line 711, characters 11-21


Source code
{KSource code : fieldType} {ESource code : vectType K} {BSource code : (dim E).-tuple E}
  & basis_of fullv B : Type := E.

HBSource code.instanceSource code DefinitionSource code _Source code {KSource code :Source code fieldType}Source code {E : vectType K} {B : (dim E).-tuple E}
    (basisB : basis_of fullv B) :=
  GRing.Lmodule.on (with_basis basisB).

Section with_basis_has_fin_dim.
Context {KSource code : fieldType} {ESource code : vectType K} {BSource code : (dim E).-tuple E}
  (basisBSource code : basis_of fullv B).

Let with_basis_semivectorSource code : semivector_axiom_def (dim E) (with_basis basisB).
Proof.
simple refine (Build_semivector_axiom_def _ _).
- by move=> v; exact: (\row_iSource code (coord B i v)).
- split.
  + by move=> k a; apply/rowP => i; rewrite !mxE linearZ.
  + by move=> a b; apply/rowP => i; rewrite !mxE linearD.
exists (fun vSource code : 'rV_(dim E) => \sum_(iSource code < dim E) (v ord0 i) *: B`_i).
- move=> v; have : v \in fullv by exact: memvf.
  rewrite -(span_basis basisB) => /coord_span vE.
  by rewrite [RHS]vE; apply: eq_bigr => /= i _; rewrite !mxE.
- by move=> v; apply/rowP=> i; rewrite !mxE coord_sum_free ?(basis_free basisB).
Qed.

HBSource code.instanceSource code DefinitionSource code _Source code :=Source code @LSemiModule_hasFinDimSource code.Build _
  (with_basis basisB) (dim E) with_basis_semivector.

End with_basis_has_fin_dim.

From mathcomp Require Import interval_inference.
Module MaxNngComLawUsed by
  • mathcomp.analysis.normedtype_theory.matrix_normedtype

Source code
.
Section max_nng_comlaw.
Import Num.Def.
Context {KSource code : realFieldType}.

Let nng_max0rSource code : left_id ((0 : K)%:nng) (@maxr {nonneg K}).
Proof.
move=> x; rewrite /maxr; case: ifPn => //.
rewrite -leNgt => x0.
apply/eqP; rewrite eq_le x0 andbT.
(* NB: the goal is `widen_itv 0%:itv <= x`, which does not match the syntax to
   trigger the hint for `ge0` as can be seen at
   https://github.com/math-comp/math-comp/blob/900e37912dbecbd3c04d3c1b320efe721d3f56dd/algebra/interval_inference.v#L770 *)

by rewrite -num_le/=.
Qed.

HBSource code.instanceSource code DefinitionSource code _Source code :=Source code
  Monoid.isComLaw.Build {nonneg K} 0%:nng maxr maxA maxC nng_max0r.

End max_nng_comlaw.
End MaxNngComLaw.

Module ProdNormedZmoduleSource code.
Section ProdNormedZmodule.
Context {RSource code : numDomainType} {USource code VSource code : normedZmodType R}.

Definition norm

ProdNormedZmodule.norm : forall {R : numDomainType} {U V : normedZmodType R}, U * V -> R ProdNormedZmodule.norm is not universe polymorphic Arguments ProdNormedZmodule.norm {R U V} x ProdNormedZmodule.norm is transparent Expands to: Constant mathcomp.classical.unstable.ProdNormedZmodule.norm Declared in library mathcomp.classical.unstable, line 772, characters 11-15


Source code
 (xSource code : U * V) : R := Num.max `|x.1| `|x.2|.

Lemma normDSource code xSource code ySource code : norm (x + y) <= norm x + norm y.
Proof.
rewrite /norm num_ge_max !(le_trans (ler_normD _ _)) ?lerD//;
by rewrite comparable_le_max ?lexx ?orbT// real_comparable.
Qed.

Lemma norm_eq0Source code xSource code : norm x = 0 -> x = 0.
Proof.
case: x => x1 x2 /eqP; rewrite eq_le num_ge_max 2!normr_le0 -andbA/=.
by case/and3P => /eqP -> /eqP ->.
Qed.

Lemma normMnSource code xSource code nSource code : norm (x *+ n) = (norm x) *+ n.
Proof.

Lemma normrNSource code xSource code : norm (- x) = norm x.
Proof.
by rewrite /norm/= !normrN. Qed.

#[export]Source code
HBSource code.instanceSource code DefinitionSource code _Source code :=Source code NumSource code.Zmodule_isNormed.Build R (U * V)%type
  normD norm_eq0 normMn normrN.

Lemma prod_normESource code (xSource code : U * V) : `|x| = Num.max `|x.1| `|x.2|.
Proof.
by []. Qed.

End ProdNormedZmodule.

Module ExportsSource code.
HB.reexport.
Definition prod_normE

prod_normE : forall [R : numDomainType] [U V : normedZmodType R] (x : U * V), `|x|%R = maxr `|x.1|%R `|x.2|%R prod_normE is not universe polymorphic Arguments prod_normE [R U V] x prod_normE is transparent Expands to: Constant mathcomp.classical.unstable.ProdNormedZmodule.Exports.prod_normE Declared in library mathcomp.classical.unstable, line 803, characters 11-21


Used by
  • mathcomp.analysis.derive
  • mathcomp.analysis.normedtype_theory.normed_module

Source code
:= @prod_normE.
End Exports.

End ProdNormedZmodule.
Export ProdNormedZmodule.Exports.

Section interval.
Local Open Scope order_scope.
Context {dispSource code} {TSource code : porderType disp}.
Implicit Types (x : T) (bl br : itv_bound T).

Lemma itv_boundlr_ltUsed by
  • mathcomp.analysis.topology_theory.num_topology
  • mathcomp.classical.set_interval

Source code
blSource code brSource code xSource code : x \in Interval bl br -> bl < br.
Proof.
rewrite itv_boundlr => /andP[] lx.
by apply/lt_le_trans/(le_lt_trans lx); rewrite bnd_simp.
Qed.

End interval.

Module EndlessDenseUsed by
  • mathcomp.analysis.topology_theory.num_topology

Source code
.
Local Open Scope order_scope.

Definition is_endless

is_endless : forall {d : disp_t}, porderType d -> Prop is_endless is not universe polymorphic Arguments is_endless {d} T is_endless is transparent Expands to: Constant mathcomp.classical.unstable.EndlessDense.is_endless Declared in library mathcomp.classical.unstable, line 825, characters 11-21


Used by
  • mathcomp.analysis.topology_theory.num_topology

Source code
{dSource code} (TSource code : porderType d) :=
  forall xSource code : T, (exists ySource code, y < x) /\ (exists ySource code, x < y).

Definition is_dense

is_dense : forall {d : disp_t}, porderType d -> Prop is_dense is not universe polymorphic Arguments is_dense {d} T is_dense is transparent Expands to: Constant mathcomp.classical.unstable.EndlessDense.is_dense Declared in library mathcomp.classical.unstable, line 828, characters 11-19


Used by
  • mathcomp.analysis.topology_theory.num_topology

Source code
{dSource code} (TSource code : porderType d) :=
  forall xSource code ySource code : T, x < y -> exists zSource code, x < z < y.

Section endless_dense_porderType.
Context {dSource code} {TSource code : porderType d}.
Implicit Type i j : itv_bound T.

Let fin_itv_bound_half_denseSource code blSource code brSource code (LSource code RSource code : T) :
  is_dense T ->
  BSide bl L < BSide br R ->
  exists ySource code, BSide bl L <= BLeft y < BSide br R.
Proof.
move=> T_dense.
case: bl; case: br; rewrite !bnd_simp.
- by exists L; rewrite !bnd_simp.
- by exists R; rewrite !bnd_simp andbT.
- by case/T_dense => y ?; exists y; rewrite !bnd_simp.
- by exists R; rewrite !bnd_simp andbT.
Qed.

Let linfty_itv_bound_half_denseSource code (xSource code : T) blSource code jSource code :
  is_endless T ->
  BInfty _ bl < j ->
  exists ySource code, BInfty _ bl <= BLeft y < j.
Proof.
move=> T_endless.
case: bl; case: j => [[] J | []//]; rewrite !bnd_simp//.
- by have [[y ?] _] := T_endless J; exists y; rewrite !bnd_simp.
- by exists J; rewrite !bnd_simp.
- by exists x; rewrite !bnd_simp.
Qed.

Let rinfty_itv_bound_half_denseSource code (xSource code : T) brSource code iSource code :
  is_endless T ->
  i < BInfty _ br ->
  exists ySource code, i <= BLeft y < BInfty _ br.
Proof.
move=> T_endless.
case: br; case: i => [[] I | []//]; rewrite !bnd_simp//.
- by exists I; rewrite !bnd_simp.
- by have [_ [y ?]] := T_endless I; exists y; rewrite !bnd_simp andbT.
- by exists x; rewrite !bnd_simp.
Qed.

Lemma itv_bound_half_denseUsed by
  • mathcomp.analysis.topology_theory.num_topology

Source code
 (xSource code : T) iSource code jSource code :
  is_endless T ->
  is_dense T ->
  i < j -> exists ySource code, i <= BLeft y < j.
Proof.
move=> T_endless T_dense.
case: i => [? ? | ?]; case j => [? ? | ?].
- exact: fin_itv_bound_half_dense.
- exact: rinfty_itv_bound_half_dense.
- exact: linfty_itv_bound_half_dense.
- exact: linfty_itv_bound_half_dense.
Qed.

End endless_dense_porderType.

Local Lemma subitvP_half1Source code {dSource code} {TSource code : orderType d} (iSource code jSource code : interval T) xSource code :
  is_endless T ->
  is_dense T ->
  x \in i -> {subset i <= j} -> j.1 <= i.1.
Proof.
case: i => il ir; case: j => jl jr /=.
move=> T_endless T_dense xi isubj.
have := xi; rewrite itv_boundlr => /andP[] _ xir.
have := isubj _ xi; rewrite itv_boundlr => /andP[] jlx _.
rewrite leNgt; apply/negP => /itv_bound_half_dense [] // y /andP[ily yjl].
suff/isubj : y \in Interval il ir by rewrite itv_boundlr leNgt yjl.
rewrite itv_boundlr ily/= (le_trans _ xir)// ltW//.
by have:= lt_le_trans yjl jlx; rewrite !bnd_simp.
Qed.

Definition dual_itv_bound

dual_itv_bound : forall {d : disp_t} {T : porderType d}, itv_bound T -> itv_bound T^d dual_itv_bound is not universe polymorphic Arguments dual_itv_bound {d T} ib dual_itv_bound is transparent Expands to: Constant mathcomp.classical.unstable.EndlessDense.dual_itv_bound Declared in library mathcomp.classical.unstable, line 902, characters 11-25


Source code
{dSource code} {TSource code : porderType d} (ibSource code : itv_bound T) :
  itv_bound T^d :=
  match ib with
  | BInfty b => BInfty _ (~~ b)
  | BSide b x => BSide (~~ b) x
  end.

Definition dual_itv

dual_itv : forall {d : disp_t} {T : porderType d}, interval T -> interval T^d dual_itv is not universe polymorphic Arguments dual_itv {d T} i dual_itv is transparent Expands to: Constant mathcomp.classical.unstable.EndlessDense.dual_itv Declared in library mathcomp.classical.unstable, line 909, characters 11-19


Source code
{dSource code} {TSource code : porderType d} (iSource code : interval T) : interval T^d :=
  @Interval T^d (dual_itv_bound i.2) (dual_itv_bound i.1).

Section dual_porderType.
Context {dSource code} {TSource code : porderType d}.
Implicit Types i j : interval T.

Lemma dual_itvESource code iSource code : dual_itv i =i i.
Proof.
case: i => l r; move=> p; rewrite /dual_itv /dual_itv_bound.
case: l => [[] x | []]; case: r => [[] y | []]//=.
all: rewrite /= !in_itv/=  !(@in_itv d T)/= ?ltEdual ?leEdual.
all: by rewrite ?andbT// ?andbF// andbC.
Qed.

Lemma dual_itv_sub_memPSource code iSource code jSource code :
  {subset i <= j} <-> {subset dual_itv i <= dual_itv j}.
Proof.
by split => + x => /(_ x); rewrite !dual_itvE. Qed.

Lemma dual_is_denseSource code : is_dense T -> is_dense T^d.
Proof.
move=> + x y xy /= => /(_ y x xy) [] z yzx.
by exists z; rewrite !ltEdual andbC.
Qed.

Lemma dual_is_endlessSource code : is_endless T -> is_endless T^d.
Proof.
move=> + x => /(_ x) [[y yx] [z xz]]; split.
  by exists z; rewrite ltEdual.
by exists y; rewrite ltEdual.
Qed.

Lemma dual_itv_boundKSource code (ibSource code : itv_bound T) :
  dual_itv_bound (dual_itv_bound ib) = ib.
Proof.
by case: ib => [[]?|[]]. Qed.

Lemma dual_itv_bound_ltSource code (lSource code rSource code : itv_bound T) :
  (dual_itv_bound l < dual_itv_bound r) = (r < l).
Proof.
by case: l => [[]?|[]]; case: r => [[]?|[]]. Qed.

Lemma dual_itv_bound_leSource code (lSource code rSource code : itv_bound T) :
  (dual_itv_bound l <= dual_itv_bound r) = (r <= l).
Proof.
by case: l => [[]?|[]]; case: r => [[]?|[]]. Qed.

End dual_porderType.

Section endless_dense_orderType.
Context {dSource code} {TSource code : orderType d}.

Let subitvP_half2Source code (iSource code jSource code : interval T) xSource code :
  is_endless T ->
  is_dense T ->
  x \in i -> {subset i <= j} -> i.2 <= j.2.
Proof.
case: i => il ir; case: j => jl jr.
move=> /dual_is_endless T_endless /dual_is_dense T_dense.
rewrite -dual_itvE => xi /dual_itv_sub_memP isubj.
have := @subitvP_half1 _ T^d.
move/(_ (dual_itv (Interval il ir)) (dual_itv (Interval jl jr)) x).
move/(_ T_endless T_dense xi isubj).
by rewrite dual_itv_bound_le.
Qed.

Lemma subitvPUsed by
  • mathcomp.analysis.topology_theory.num_topology

Source code
 (iSource code jSource code : interval T) xSource code :
  is_endless T ->
  is_dense T ->
  x \in i ->
  i <= j <-> {subset i <= j}.
Proof.
case: i => ? ?; case: j => ? ?.
move=> *; split; first exact: subitvP.
move=> isubj; apply/andP; split.
- by move/(@subitvP_half1 _ _ _ _ x): isubj; exact.
- by move/(@subitvP_half2 _ _ x): isubj; exact.
Qed.

End endless_dense_orderType.

Section num.
Local Open Scope ring_scope.

Lemma numDomain_is_endlessUsed by
  • mathcomp.analysis.topology_theory.num_topology

Source code
 (RSource code : numDomainType) : is_endless R.
Proof.
move=> x; split.
- by exists (x - 1); rewrite gtrBl.
- by exists (x + 1); rewrite ltrDl.
Qed.

Lemma numField_is_denseUsed by
  • mathcomp.analysis.topology_theory.num_topology

Source code
 (RSource code : numFieldType) : is_dense R.
Proof.
move=> x y xy; exists (2^-1 * (x + y)).
rewrite -(@ltr_pM2l _ 2)// -[X in _ && X](@ltr_pM2l _ 2)//.
rewrite mulrA divff ?lt0r_neq0// mul1r !mulr_natl !mulr2n.
by rewrite ltrD2l ltrD2r xy.
Qed.

End num.

End EndlessDense.

Section interval_realFieldType.
Context {RSource code : realFieldType}.
Local Open Scope order_scope.

Lemma real_subitvPSource code (iSource code jSource code : interval R) xSource code : x \in i -> i <= j <-> {subset i <= j}.
Proof.

End interval_realFieldType.