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
- mathcomp.experimental_reals.realsum
Source code
Proof.
End ProofIrrelevantChoice.
Section PredSubtype.
Section Def.
Variable : Type.
Variable : pred T.
Record
PSubSub {
.
End Def.
.
[Equality of pred_sub E by <:].
.
[Choice of pred_sub E by <:].
.
[Countable of pred_sub E by <:].
End PredSubtype.
Notation
(format "[ 'psub' E ]").
Section PIncl.
Variables ( : Type) ( : pred T) ( : {subset E <= F}).
Definition
Source code
PSubSub (le (valP x)).
End PIncl.
Section Countable.
Variable ( : Type) ( : pred T).
Variant
- mathcomp.experimental_reals.realsum
Source code
(
(
of pcancel rpickle runpickle.
Definition
Source code
let: Countable p _ _ := c in p.
Definition
pincl : forall [T : Type] [E F : pred T], {subset E <= F} -> [psub E] -> [psub F] pincl is not universe polymorphic Arguments pincl [T]%_type_scope [E F] le x pincl is transparent Expands to: Constant mathcomp.experimental_reals.discrete.pincl Declared in library mathcomp.experimental_reals.discrete, line 66, characters 11-16
Source code
let: Countable _ p _ := c in p.
Lemma
Proof.
Section CountableTheory.
Lemma
Section CanCountable.
Variables ( : Type) ( : countType) ( : pred T).
Variables ( : [psub E] -> U) ( : U -> [psub E]).
Lemma
Proof.
Section CountType.
Variables ( : eqType) ( : pred T) ( : countable E).
Definition
rpickle : forall [T : Type] [E : pred T], countable (T:=T) E -> [psub E] -> nat rpickle is not universe polymorphic Arguments rpickle [T]%_type_scope [E] c _ rpickle is transparent Expands to: Constant mathcomp.experimental_reals.discrete.rpickle Declared in library mathcomp.experimental_reals.discrete, line 80, characters 11-18
Source code
(pcan_type (rpickleK c)).
Definition
runpickle : forall [T : Type] [E : pred T], countable (T:=T) E -> nat -> option [psub E] runpickle is not universe polymorphic Arguments runpickle [T]%_type_scope [E] c _%_nat_scope runpickle is transparent Expands to: Constant mathcomp.experimental_reals.discrete.runpickle Declared in library mathcomp.experimental_reals.discrete, line 83, characters 11-20
Source code
(pcan_type (rpickleK c)).
End CountType.
End CountableTheory.
Section Finite.
Variables ( : eqType).
CoInductive
|
End Finite.
Section FiniteTheory.
Context { : choiceType}.
Lemma
- mathcomp.experimental_reals.realsum
Source code
Proof.
by move=> x; rewrite mem_undup; exact: sEs.
Qed.
Lemma
- mathcomp.experimental_reals.realsum
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
- mathcomp.experimental_reals.realsum
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
- mathcomp.experimental_reals.realsum
Source code
Proof.
Section CountableUnion.
Variables ( : eqType) ( : nat -> pred T).
Hypothesis : forall , countable (E i).
Lemma
- mathcomp.experimental_reals.realsum
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.