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
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
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
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
let: Countable p _ _ := c in p.
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
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
countable_countMixin : forall [T : eqType] [E : pred T], countable (T:=T) E -> Countable.axioms_ [psub E] countable_countMixin is not universe polymorphic Arguments countable_countMixin [T E] c countable_countMixin is transparent Expands to: Constant mathcomp.experimental_reals.discrete.countable_countMixin Declared in library mathcomp.experimental_reals.discrete, line 110, characters 11-31
Source code
(pcan_type (rpickleK c)).
Definition
countable_choiceMixin : forall [T : eqType] [E : pred T], countable (T:=T) E -> Choice.axioms_ [psub E] countable_choiceMixin is not universe polymorphic Arguments countable_choiceMixin [T E] c countable_choiceMixin is transparent Expands to: Constant mathcomp.experimental_reals.discrete.countable_choiceMixin Declared in library mathcomp.experimental_reals.discrete, line 112, characters 11-32
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.