Module mathcomp.experimental_reals.discrete
From Corelib Require Setoid.
From HB Require Import structures.
From mathcomp Require Import boot order algebra.
From mathcomp.classical Require Import boolp.
From mathcomp Require Import xfinmap reals.
Unset SsrOldRewriteGoalsOrder.
Set Implicit Arguments.
Unset Strict Implicit.
Unset Printing Implicit Defensive.
Import GRing.Theory Num.Theory.
Local Open Scope ring_scope.
Local Open Scope real_scope.
Section ProofIrrelevantChoice.
Context { : choiceType}.
Lemma
Source code
Proof.
End ProofIrrelevantChoice.
Section PredSubtype.
Section Def.
Variable : Type.
Variable : pred T.
Record
Source code
PSubSub {
Source code
Source code
.
Source code
Source code
Source code
End Def.
.
Source code
Source code
Source code
[Equality of pred_sub E by <:].
.
Source code
Source code
Source code
[Choice of pred_sub E by <:].
.
Source code
Source code
Source code
[Countable of pred_sub E by <:].
End PredSubtype.
Notation
Source code
(format "[ 'psub' E ]").
Section PIncl.
Variables ( : Type) ( : pred T) ( : {subset E <= F}).
Definition
mkdistr : forall {R : realType} {T : choiceType} [mu : T -> R], isdistr mu -> distr R T mkdistr is not universe polymorphic Arguments mkdistr {R T} [mu]%_function_scope isd mkdistr is transparent Expands to: Constant mathcomp.experimental_reals.distr.mkdistr Declared in library mathcomp.experimental_reals.distr, line 164, characters 11-18
Source code
PSubSub (le (valP x)).
End PIncl.
Section Countable.
Variable ( : Type) ( : pred T).
Variant
Source code
Source code
(
Source code
(
Source code
of pcancel rpickle runpickle.
Definition
ispredistr : forall {R : realType} {T : choiceType}, (T -> R) -> Prop ispredistr is not universe polymorphic Arguments ispredistr {R T} mu%_function_scope ispredistr is transparent Expands to: Constant mathcomp.experimental_reals.distr.ispredistr Declared in library mathcomp.experimental_reals.distr, line 169, characters 11-21
Source code
let: Countable p _ _ := c in p.
Definition
mnull : forall {R : realType} {T : choiceType}, T -> R mnull is not universe polymorphic Arguments mnull {R T} x mnull is transparent Expands to: Constant mathcomp.experimental_reals.distr.mnull Declared in library mathcomp.experimental_reals.distr, line 192, characters 11-16
Source code
let: Countable _ p _ := c in p.
Lemma
Source code
Proof.
Section CountableTheory.
Lemma
Source code
Section CanCountable.
Variables ( : Type) ( : countType) ( : pred T).
Variables ( : [psub E] -> U) ( : U -> [psub E]).
Lemma
Source code
Proof.
Section CountType.
Variables ( : eqType) ( : pred T) ( : countable E).
Definition
dnull : forall {R : realType} {T : choiceType}, distr R T dnull is not universe polymorphic Arguments dnull {R T} dnull is transparent Expands to: Constant mathcomp.experimental_reals.distr.dnull Declared in library mathcomp.experimental_reals.distr, line 197, characters 11-16
Source code
(pcan_type (rpickleK c)).
Definition
mkdistrd : forall {R : realType} {T : choiceType}, (T -> R) -> {distr T / R} mkdistrd is not universe polymorphic Arguments mkdistrd {R T} mu%_function_scope mkdistrd is transparent Expands to: Constant mathcomp.experimental_reals.distr.mkdistrd Declared in library mathcomp.experimental_reals.distr, line 202, characters 11-19
Source code
(pcan_type (rpickleK c)).
End CountType.
End CountableTheory.
Section Finite.
Variables ( : eqType).
CoInductive
Source code
|
Source code
End Finite.
Section FiniteTheory.
Context { : choiceType}.
Lemma
Source code
Proof.
by move=> x; rewrite mem_undup; exact: sEs.
Qed.
Lemma
Source code
forall , exists : seq T, [/\ size s = n, uniq s & {subset s <= E}].
Proof.
have [x sxN xE]: exists2 , x \notin s & x \in E.
apply: contra_notP (finN (filter (mem E) s)) => /forall2NP finE x Ex.
move/or_asboolP: (finE x).
by rewrite !asbool_neg !asboolb negbK Ex mem_filter orbF [(mem E) x]Ex.
exists (x :: s) => /=; rewrite sxN; split=> // y.
by rewrite in_cons => /orP[/eqP->//|/sE].
Qed.
End FiniteTheory.
Section FiniteCountable.
Variables ( : eqType) ( : pred T).
Lemma
Source code
Proof.
pose f := index x t; pose g := nth None [seq Some x | <- t] i.
apply (@Countable _ E f g) => x; rewrite {}/f {}/g /=.
have x_in_t: x \in t; first case: x => x h.
by rewrite {}/t mem_pmap_sub /= Es.
by rewrite (nth_map x) ?index_mem ?nth_index.
Qed.
Section CountSub.
Variables ( : eqType) ( : pred T).
Lemma
Source code
Proof.
Section CountableUnion.
Variables ( : eqType) ( : nat -> pred T).
Hypothesis : forall , countable (E i).
Lemma
Source code
Proof.
pose S := { : nat & Ci i }; set F := [pred | _].
have H: forall ( : [psub F]), exists : nat, val x \in E i.
by case=> x /= /asboolP[i] Eix; exists i.
have G: forall ( : S), val (tagged x) \in F.
by case=> i [x /= Eix]; apply/asboolP; exists i.
pose f ( : [psub F]) : S := Tagged (fun => [psub E i])
(PSubSub (xchooseP (H x))).
pose g ( : S) := PSubSub (G x).
by have /can_countable: cancel f g by case=> x hx; apply/val_inj.
Qed.