statement stringlengths 1 1.39k | proof stringlengths 0 4.58k | type stringclasses 21
values | symbolic_name stringlengths 1 49 | library stringclasses 18
values | filename stringclasses 100
values | imports listlengths 0 26 | deps listlengths 0 23 | docstring stringlengths 0 2.01k | source_url stringclasses 1
value | commit stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|
bigcup_set_I_l {A B} (s1 s2 : set A) (s3 : set B) (f : A -> set B) :
\bigcup_(x in s1) (f x) \subset s3 ->
\bigcup_(x in (s1 :&: s2)) (f x) \subset s3. | Proof.
firstorder.
Qed. | Lemma | bigcup_set_I_l | src | src/Sets.v | [
"Coq",
"Classes.RelationClasses",
"Classes.Morphisms",
"List",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"seq",
"QuickChick",
"Tactics",
"ListNotations"
] | [
"set"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
bigcup_set_U {A B} (s1 s2 : set A) (s3 : set B) (f : A -> set B) :
\bigcup_(x in s1) (f x) \subset s3 ->
\bigcup_(x in s2) (f x) \subset s3 ->
\bigcup_(x in (s1 :|: s2)) (f x) \subset s3. | Proof.
firstorder.
Qed. | Lemma | bigcup_set_U | src | src/Sets.v | [
"Coq",
"Classes.RelationClasses",
"Classes.Morphisms",
"List",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"seq",
"QuickChick",
"Tactics",
"ListNotations"
] | [
"set"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
bigcup_set0_subset {A B} (s : set B) (f : A -> set B) :
\bigcup_(x in set0) (f x) \subset s. | Proof.
firstorder.
Qed. | Lemma | bigcup_set0_subset | src | src/Sets.v | [
"Coq",
"Classes.RelationClasses",
"Classes.Morphisms",
"List",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"seq",
"QuickChick",
"Tactics",
"ListNotations"
] | [
"set",
"set0"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
bigcup_cons_subset {A B} l (ls : seq A) (f : A -> set B) s :
f l \subset s ->
\bigcup_(x in ls) (f x) \subset s ->
\bigcup_(x in l :: ls) (f x) \subset s. | Proof.
intros H1 H2 x [y [Hl Hr]].
inv Hl.
- eauto.
- eapply H2. eexists; split; eauto.
Qed. | Lemma | bigcup_cons_subset | src | src/Sets.v | [
"Coq",
"Classes.RelationClasses",
"Classes.Morphisms",
"List",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"seq",
"QuickChick",
"Tactics",
"ListNotations"
] | [
"inv",
"set",
"split"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
bigcup_nil_subset {A B} (f : A -> set B) s :
\bigcup_(x in []) (f x) \subset s. | Proof.
intros x [y [H1 H2]]. inv H1.
Qed. | Lemma | bigcup_nil_subset | src | src/Sets.v | [
"Coq",
"Classes.RelationClasses",
"Classes.Morphisms",
"List",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"seq",
"QuickChick",
"Tactics",
"ListNotations"
] | [
"inv",
"set"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
option_subset {A} (s1 : set (option A)) :
s1 \subset (isSome :&: s1) :|: [set None]. | Proof.
intros [x |]; firstorder.
Qed. | Lemma | option_subset | src | src/Sets.v | [
"Coq",
"Classes.RelationClasses",
"Classes.Morphisms",
"List",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"seq",
"QuickChick",
"Tactics",
"ListNotations"
] | [
"set"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
setU_l_subset {U} (s1 s2 s3 : set U) :
s1 \subset s3 ->
s2 \subset s3 ->
(s1 :|: s2) \subset s3. | Proof.
firstorder.
Qed. | Lemma | setU_l_subset | src | src/Sets.v | [
"Coq",
"Classes.RelationClasses",
"Classes.Morphisms",
"List",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"seq",
"QuickChick",
"Tactics",
"ListNotations"
] | [
"set"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
bigcup_lift_lift_bigcup {T U} (s1 : set T) (f : T -> set U) :
\bigcup_(x in s1) (lift (f x)) \subset lift (\bigcup_(x in s1) (f x)). | Proof.
intros x [y [H1 [[z [H2 H3]] | H2]]].
+ inv H3. left; eexists; split; eauto.
eexists; split; eauto.
+ inv H2; now right.
Qed. | Lemma | bigcup_lift_lift_bigcup | src | src/Sets.v | [
"Coq",
"Classes.RelationClasses",
"Classes.Morphisms",
"List",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"seq",
"QuickChick",
"Tactics",
"ListNotations"
] | [
"inv",
"lift",
"set",
"split"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
lift_subset_compat {U} (s1 s2 : set U) :
s1 \subset s2 ->
lift s1 \subset lift s2. | Proof.
firstorder.
Qed. | Lemma | lift_subset_compat | src | src/Sets.v | [
"Coq",
"Classes.RelationClasses",
"Classes.Morphisms",
"List",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"seq",
"QuickChick",
"Tactics",
"ListNotations"
] | [
"lift",
"set"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
lift_set_eq_compat {U} (s1 s2 : set U) :
s1 <--> s2 ->
lift s1 <--> lift s2. | Proof.
firstorder.
Qed. | Lemma | lift_set_eq_compat | src | src/Sets.v | [
"Coq",
"Classes.RelationClasses",
"Classes.Morphisms",
"List",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"seq",
"QuickChick",
"Tactics",
"ListNotations"
] | [
"lift",
"set"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
bigcup_setU_r:
forall (U T : Type) (s : set U) (f g : U -> set T),
\bigcup_(i in s) (f i :|: g i) <-->
\bigcup_(i in s) f i :|: \bigcup_(i in s) g i. | Proof.
firstorder.
Qed. | Lemma | bigcup_setU_r | src | src/Sets.v | [
"Coq",
"Classes.RelationClasses",
"Classes.Morphisms",
"List",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"seq",
"QuickChick",
"Tactics",
"ListNotations"
] | [
"set"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
lift_bigcup_comm :
forall (U T : Type) (s : set U) (f : U -> set T),
inhabited U ->
lift (\bigcup_(i in [set : U]) (f i)) <-->
\bigcup_(i in [set : U]) (lift (f i)). | Proof.
intros U T s f Hin. unfold lift.
rewrite !bigcup_setU_r -!imset_bigcup.
rewrite bigcup_const; eauto.
reflexivity.
Qed. | Lemma | lift_bigcup_comm | src | src/Sets.v | [
"Coq",
"Classes.RelationClasses",
"Classes.Morphisms",
"List",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"seq",
"QuickChick",
"Tactics",
"ListNotations"
] | [
"bigcup_const",
"bigcup_setU_r",
"imset_bigcup",
"lift",
"set"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
bigcap_setU_distr:
forall (U T : Type) (s1 s2 : set U) (f : U -> set T),
\bigcap_(i in s1) f i :&: \bigcap_(i in s2) f i <--> \bigcap_(i in s1 :|: s2) f i. | Proof.
intros. split.
- intros [ H1 H2 ] x [ H3 | H3 ]; eauto.
- intros H. split; intros x H3; eapply H.
now left. now right.
Qed. | Lemma | bigcap_setU_distr | src | src/Sets.v | [
"Coq",
"Classes.RelationClasses",
"Classes.Morphisms",
"List",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"seq",
"QuickChick",
"Tactics",
"ListNotations"
] | [
"set",
"split"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
setI_set_incl :
forall (A : Type) (s1 s2 s3 : set A),
s1 \subset s2 ->
s1 \subset s3 ->
s1 \subset s2 :&: s3. | Proof.
firstorder.
Qed. | Lemma | setI_set_incl | src | src/Sets.v | [
"Coq",
"Classes.RelationClasses",
"Classes.Morphisms",
"List",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"seq",
"QuickChick",
"Tactics",
"ListNotations"
] | [
"set"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
imset_isSome {A} (s : set A) :
Some @: s \subset isSome. | Proof.
intros y [x [Sx H]]. inv H. eauto.
Qed. | Lemma | imset_isSome | src | src/Sets.v | [
"Coq",
"Classes.RelationClasses",
"Classes.Morphisms",
"List",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"seq",
"QuickChick",
"Tactics",
"ListNotations"
] | [
"inv",
"set"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
bigcup_cons_subset_r :
forall (A B : Type) (l : A) (ls : seq A) (f : A -> set B) (s1 s2 : set B),
s1 \subset f l ->
s2 \subset \bigcup_(x in ls) f x ->
s1 :|: s2 \subset \bigcup_(x in (l :: ls)) f x. | Proof.
intros A B l ls f s1 s2 H1 H2.
apply setU_l_subset.
- rewrite bigcup_setU_l bigcup_set1.
eapply setU_subset_l. eassumption.
- rewrite bigcup_setU_l bigcup_set1.
eapply setU_subset_r. eassumption.
Qed. | Lemma | bigcup_cons_subset_r | src | src/Sets.v | [
"Coq",
"Classes.RelationClasses",
"Classes.Morphisms",
"List",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"seq",
"QuickChick",
"Tactics",
"ListNotations"
] | [
"bigcup_set1",
"bigcup_setU_l",
"set",
"setU_l_subset",
"setU_subset_l",
"setU_subset_r"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
bigcup_setI_cons_subset_r :
forall (A B : Type) (l : A) (ls : seq A) (f : A -> set B) (s1 s2 : set B) (s3 : set A),
s3 l ->
s1 \subset f l ->
s2 \subset \bigcup_(x in ls :&: s3) f x ->
s1 :|: s2 \subset \bigcup_(x in (l :: ls) :&: s3) f x. | Proof.
intros A B l ls f s1 s2 s3 H1 H2 H3.
apply setU_l_subset.
- intros x Hs1. eexists l; split; eauto.
split; eauto. left; eauto.
- intros x Hs1. eapply H3 in Hs1.
edestruct Hs1 as [x' [[Hs3 Hls] Hin]].
eexists x'; split; eauto. split; eauto.
right; eauto.
Qed. | Lemma | bigcup_setI_cons_subset_r | src | src/Sets.v | [
"Coq",
"Classes.RelationClasses",
"Classes.Morphisms",
"List",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"seq",
"QuickChick",
"Tactics",
"ListNotations"
] | [
"set",
"setU_l_subset",
"split"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
imset_union_set_eq:
forall (U T : Type) (s1 s2 : set U) (f : U -> T),
f @: (s1 :|: s2) <--> f @: s1 :|: f @: s2. | Proof.
intros U T s1 s2 f.
firstorder.
Qed. | Lemma | imset_union_set_eq | src | src/Sets.v | [
"Coq",
"Classes.RelationClasses",
"Classes.Morphisms",
"List",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"seq",
"QuickChick",
"Tactics",
"ListNotations"
] | [
"set"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
imset_bigcup_setI_cons_subset_r :
forall (A B : Type) (l : A) (ls : seq A) (f : A -> set (option B))
(s1 s2 : set B) (s3 : set A),
s3 l ->
Some @: s1 \subset f l ->
Some @: s2 \subset \bigcup_(x in ls :&: s3) f x ->
Some @: (s1 :|: s2) \subset \bigcup_(x in (l :: ls) :&: s3) f x. | Proof.
intros A B l ls f s1 s2 s3 H1 H2 H3.
rewrite imset_union_set_eq. apply setU_l_subset.
- intros x Hs1. eexists l; split; eauto.
split; eauto. left; eauto.
- intros x Hs1. eapply H3 in Hs1.
edestruct Hs1 as [x' [[Hs3 Hls] Hin]].
eexists x'; split; eauto. split; eauto.
right; eauto.
Qed. | Lemma | imset_bigcup_setI_cons_subset_r | src | src/Sets.v | [
"Coq",
"Classes.RelationClasses",
"Classes.Morphisms",
"List",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"seq",
"QuickChick",
"Tactics",
"ListNotations"
] | [
"imset_union_set_eq",
"set",
"setU_l_subset",
"split"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
imset_set0_subset {A B} (f : A -> B) (s : set B) :
(f @: set0) \subset s. | Proof.
firstorder.
Qed. | Lemma | imset_set0_subset | src | src/Sets.v | [
"Coq",
"Classes.RelationClasses",
"Classes.Morphisms",
"List",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"seq",
"QuickChick",
"Tactics",
"ListNotations"
] | [
"set",
"set0"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
setI_set_eq_r {A : Type} (s1 s2 s2' : set A) :
s2 <--> s2' ->
(s1 :&: s2) <--> (s1 :&: s2'). | Proof.
intros. rewrite H; reflexivity.
Qed. | Lemma | setI_set_eq_r | src | src/Sets.v | [
"Coq",
"Classes.RelationClasses",
"Classes.Morphisms",
"List",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"seq",
"QuickChick",
"Tactics",
"ListNotations"
] | [
"set"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
isSome_subset {A : Type} (s1 s2 s1' s2' : set (option A)) :
isSome :&: s1 \subset isSome :&: s2 ->
isSome :&: (s1 :|: ([set None] :&: s1')) \subset isSome :&: (s2 :|: ([set None] :&: s2')). | Proof.
intros Hyp x [H1 H2]. destruct x as [ x | ]; try discriminate.
split; eauto.
inv H2. left; eauto.
eapply Hyp. now split; eauto.
inv H. now inv H0.
Qed. | Lemma | isSome_subset | src | src/Sets.v | [
"Coq",
"Classes.RelationClasses",
"Classes.Morphisms",
"List",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"seq",
"QuickChick",
"Tactics",
"ListNotations"
] | [
"inv",
"set",
"split"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
bigcup_nil_setI {A B} (f : A -> set B)
(l : seq A) s :
\bigcup_(x in [] :&: s) (f x) \subset
\bigcup_(x in (l :&: s)) (f x). | Proof.
intros z [y [[Hin1 _] Hin2]]. inv Hin1.
Qed. | Lemma | bigcup_nil_setI | src | src/Sets.v | [
"Coq",
"Classes.RelationClasses",
"Classes.Morphisms",
"List",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"seq",
"QuickChick",
"Tactics",
"ListNotations"
] | [
"inv",
"set"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
isSome_set_eq {A} (s : set (option A)) (s' : set A) :
s \subset (Some @: s') :|: [set None] ->
Some @: s' \subset s ->
isSome :&: s <--> Some @: s'. | Proof.
intros H1 H2 x; split.
- intros [H3 H4]. destruct x; try discriminate.
eapply H1 in H4. inv H4; try discriminate.
eassumption.
- intros [y [H3 H4]].
inv H4. split. now eauto.
eapply H2.
eexists; split; eauto.
Qed. | Lemma | isSome_set_eq | src | src/Sets.v | [
"Coq",
"Classes.RelationClasses",
"Classes.Morphisms",
"List",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"seq",
"QuickChick",
"Tactics",
"ListNotations"
] | [
"inv",
"set",
"split"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
set_eq_isSome_sound {A} (s : set (option A)) (s' : set A) :
isSome :&: s <--> Some @: s' ->
s \subset (Some @: s') :|: [set None]. | Proof.
intros H [x| ] Hin.
- left. eapply H.
eexists; eauto.
- right; reflexivity.
Qed. | Lemma | set_eq_isSome_sound | src | src/Sets.v | [
"Coq",
"Classes.RelationClasses",
"Classes.Morphisms",
"List",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"seq",
"QuickChick",
"Tactics",
"ListNotations"
] | [
"set"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
set_eq_isSome_complete {A} (s : set (option A)) (s' : set A) :
isSome :&: s <--> Some @: s' ->
Some @: s' \subset s. | Proof.
intros H. rewrite <- H. firstorder.
Qed. | Lemma | set_eq_isSome_complete | src | src/Sets.v | [
"Coq",
"Classes.RelationClasses",
"Classes.Morphisms",
"List",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"seq",
"QuickChick",
"Tactics",
"ListNotations"
] | [
"set"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
somes {A} (s : set (option A)) : set A | :=
[set x | Some x \in s]. | Definition | somes | src | src/Sets.v | [
"Coq",
"Classes.RelationClasses",
"Classes.Morphisms",
"List",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"seq",
"QuickChick",
"Tactics",
"ListNotations"
] | [
"set"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
somes_subset {A} (s1 s2 : set (option A)) :
s1 \subset s2 ->
somes s1 \subset somes s2. | Proof.
intros Hs a.
apply Hs.
Qed. | Lemma | somes_subset | src | src/Sets.v | [
"Coq",
"Classes.RelationClasses",
"Classes.Morphisms",
"List",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"seq",
"QuickChick",
"Tactics",
"ListNotations"
] | [
"set",
"somes"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
bigcup_somes {A B} (sA : set A) (s : A -> set (option B)) :
somes (\bigcup_(a in sA) s a) <--> \bigcup_(a in sA) somes (s a). | Proof.
intro b; split; intros [a Ha]; eexists a; auto.
Qed. | Lemma | bigcup_somes | src | src/Sets.v | [
"Coq",
"Classes.RelationClasses",
"Classes.Morphisms",
"List",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"seq",
"QuickChick",
"Tactics",
"ListNotations"
] | [
"set",
"somes",
"split"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
proper_somes A : Morphisms.Proper (set_eq ==> set_eq) (@somes A). | Proof. firstorder. Qed. | Instance | proper_somes | src | src/Sets.v | [
"Coq",
"Classes.RelationClasses",
"Classes.Morphisms",
"List",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"seq",
"QuickChick",
"Tactics",
"ListNotations"
] | [
"set_eq",
"somes"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
bigcup_setI {T U} (s1 : set T) (s2 : set U) F :
\bigcup_(x in s1) (s2 :&: F x) <--> s2 :&: \bigcup_(x in s1) (F x). | Proof. firstorder. Qed. | Lemma | bigcup_setI | src | src/Sets.v | [
"Coq",
"Classes.RelationClasses",
"Classes.Morphisms",
"List",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"seq",
"QuickChick",
"Tactics",
"ListNotations"
] | [
"set"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
incl_bigcup_compat_list (T U : Type) (h1 h2 : T) (t1 t2 : list T) (F G : T -> set U) :
F h1 \subset G h2 ->
\bigcup_(x in t1) F x \subset \bigcup_(x in t2) G x ->
\bigcup_(x in h1 :: t1) F x \subset \bigcup_(x in h2 :: t2) G x. | Proof.
intros Hs1 Hs2.
intros x Hin. inv Hin. inv H. inv H0.
- eexists. split. now left. eauto.
- edestruct Hs2.
eexists. split; eauto.
destruct H3. eexists. split. now right; eauto.
eassumption.
Qed. | Lemma | incl_bigcup_compat_list | src | src/Sets.v | [
"Coq",
"Classes.RelationClasses",
"Classes.Morphisms",
"List",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"seq",
"QuickChick",
"Tactics",
"ListNotations"
] | [
"inv",
"set",
"split"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
incl_bigcup_list_tl (T U : Type) (h : T) (t : list T) (G : T -> set U) s :
s \subset \bigcup_(x in t) G x ->
s \subset \bigcup_(x in h :: t) G x. | Proof.
intros Hyp x Hin. eapply Hyp in Hin.
inv Hin. inv H.
eexists. split. now right; eauto. eauto.
Qed. | Lemma | incl_bigcup_list_tl | src | src/Sets.v | [
"Coq",
"Classes.RelationClasses",
"Classes.Morphisms",
"List",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"seq",
"QuickChick",
"Tactics",
"ListNotations"
] | [
"inv",
"set",
"split"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
incl_bigcup_list_hd (T U : Type) (h : T) (t : list T) (G : T -> set U) s :
s \subset G h ->
s \subset \bigcup_(x in h :: t) G x. | Proof.
intros Hyp x Hin. eapply Hyp in Hin.
eexists. split. now left. eauto.
Qed. | Lemma | incl_bigcup_list_hd | src | src/Sets.v | [
"Coq",
"Classes.RelationClasses",
"Classes.Morphisms",
"List",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"seq",
"QuickChick",
"Tactics",
"ListNotations"
] | [
"set",
"split"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
incl_bigcup_list_nil (T U : Type) (G : T -> set U) s :
\bigcup_(x in [::]) G x \subset s. | Proof.
intros x Hin. inv Hin. inv H. inv H0.
Qed. | Lemma | incl_bigcup_list_nil | src | src/Sets.v | [
"Coq",
"Classes.RelationClasses",
"Classes.Morphisms",
"List",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"seq",
"QuickChick",
"Tactics",
"ListNotations"
] | [
"inv",
"set"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
in_bigcup_list_hd (T U : Type) (h : T) (t : seq T) (G : T -> set U) (z : U) :
G h z -> (\bigcup_(x in (h :: t)) G x) z. | Proof.
intros Hin.
eapply incl_bigcup_list_hd. now eapply subset_refl.
eassumption.
Qed. | Lemma | in_bigcup_list_hd | src | src/Sets.v | [
"Coq",
"Classes.RelationClasses",
"Classes.Morphisms",
"List",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"seq",
"QuickChick",
"Tactics",
"ListNotations"
] | [
"incl_bigcup_list_hd",
"set",
"subset_refl"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
in_bigcup_list_tl (T U : Type) (h : T) (t : seq T) (G : T -> set U) (z : U) :
(\bigcup_(x in t) G x) z -> (\bigcup_(x in (h :: t)) G x) z. | Proof.
intros Hin.
eapply incl_bigcup_list_tl. now eapply subset_refl.
eassumption.
Qed. | Lemma | in_bigcup_list_tl | src | src/Sets.v | [
"Coq",
"Classes.RelationClasses",
"Classes.Morphisms",
"List",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"seq",
"QuickChick",
"Tactics",
"ListNotations"
] | [
"incl_bigcup_list_tl",
"set",
"subset_refl"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
in_bigcup_list_cons (T U : Type) (h : T) (t : seq T) (G : T -> set U) (z : U) :
(\bigcup_(x in (h :: t)) G x) z ->
G h z \/ (\bigcup_(x in t) G x) z. | Proof.
intros Hin. inv Hin. inv H. inv H0; eauto.
right. eexists; split; eauto.
Qed. | Lemma | in_bigcup_list_cons | src | src/Sets.v | [
"Coq",
"Classes.RelationClasses",
"Classes.Morphisms",
"List",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"seq",
"QuickChick",
"Tactics",
"ListNotations"
] | [
"inv",
"set",
"split"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
bigcup_nil_set0 (T U : Type) (F : T -> set U) :
\bigcup_(x in [::]) F x <--> set0. | Proof.
split; intros Hin; inv Hin; eauto.
inv H. inv H0.
Qed. | Lemma | bigcup_nil_set0 | src | src/Sets.v | [
"Coq",
"Classes.RelationClasses",
"Classes.Morphisms",
"List",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"seq",
"QuickChick",
"Tactics",
"ListNotations"
] | [
"inv",
"set",
"set0",
"split"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
incl_bigcup_compat_list_inter (T U : Type) (h1 h2 : T)
(t1 t2 : seq T) (F G : T -> set U) S :
S :&: F h1 \subset S :&: G h2 ->
S :&: \bigcup_(x in t1) F x \subset S :&: \bigcup_(x in t2) G x ->
S :&: \bigcup_(x in (h1 :: t1)) F x \subset
S :&: \bigcup_(x in (h2 :: t2)) G x. | Proof.
intros Hs1 Hs2.
intros x Hin. inv Hin. constructor; eauto.
inv H0. inv H1. inv H2.
- eexists. split. now left. eapply Hs1. split; eauto.
- edestruct Hs2. split. eassumption.
eexists. split; eauto.
destruct H6. destruct H6.
eexists. split. right; eauto. eassumption.
Qed. | Lemma | incl_bigcup_compat_list_inter | src | src/Sets.v | [
"Coq",
"Classes.RelationClasses",
"Classes.Morphisms",
"List",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"seq",
"QuickChick",
"Tactics",
"ListNotations"
] | [
"inv",
"set",
"split"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
incl_bigcup_list_tl_inter {T U : Type} (h : T) (t : list T) (G : T -> set U) s S :
s \subset S :&: (\bigcup_(x in t) G x) ->
s \subset S :&: (\bigcup_(x in h :: t) G x). | Proof.
intros Hyp x Hin. eapply Hyp in Hin.
inv Hin. inv H0. inv H1.
split. eassumption.
eexists. split. now right; eauto. eauto.
Qed. | Lemma | incl_bigcup_list_tl_inter | src | src/Sets.v | [
"Coq",
"Classes.RelationClasses",
"Classes.Morphisms",
"List",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"seq",
"QuickChick",
"Tactics",
"ListNotations"
] | [
"inv",
"set",
"split"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
incl_bigcup_compat_list_eq (T U : Type) (h1 h2 : T) (t1 t2 : list T) (F G : T -> set U) :
F h1 <--> G h2 ->
\bigcup_(x in t1) F x <--> \bigcup_(x in t2) G x ->
\bigcup_(x in h1 :: t1) F x <--> \bigcup_(x in h2 :: t2) G x. | Proof.
intros Hs1 Hs2. split; eapply incl_bigcup_compat_list.
- rewrite Hs1. eapply subset_refl.
- rewrite Hs2. eapply subset_refl.
- rewrite Hs1. eapply subset_refl.
- rewrite Hs2. eapply subset_refl.
Qed. | Lemma | incl_bigcup_compat_list_eq | src | src/Sets.v | [
"Coq",
"Classes.RelationClasses",
"Classes.Morphisms",
"List",
"mathcomp",
"ssreflect",
"ssrfun",
"ssrbool",
"seq",
"QuickChick",
"Tactics",
"ListNotations"
] | [
"incl_bigcup_compat_list",
"set",
"split",
"subset_refl"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
Time : Set | := mkTime {time: nat}. | Record | Time | src | src/Show.v | [
"Coq",
"Ascii",
"Basics",
"Decimal",
"List",
"String",
"ZArith",
"ListNotations",
"Coq.Strings.String.StringSyntax"
] | [
"nat"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
AugmentedTime (A: Type) | :=
mkAugTime {
aug_res : A;
aug_time : Time
}. | Record | AugmentedTime | src | src/Show.v | [
"Coq",
"Ascii",
"Basics",
"Decimal",
"List",
"String",
"ZArith",
"ListNotations",
"Coq.Strings.String.StringSyntax"
] | [
"Time"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
newline | := String "010" ""%string. | Definition | newline | src | src/Show.v | [
"Coq",
"Ascii",
"Basics",
"Decimal",
"List",
"String",
"ZArith",
"ListNotations",
"Coq.Strings.String.StringSyntax"
] | [
"string"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
Show (A : Type) : Type | :=
{
show : A -> string
}. | Class | Show | src | src/Show.v | [
"Coq",
"Ascii",
"Basics",
"Decimal",
"List",
"String",
"ZArith",
"ListNotations",
"Coq.Strings.String.StringSyntax"
] | [
"string"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
show_uint (n : uint) : string | :=
match n with
| Nil => ""
| D0 n => String "0" (show_uint n)
| D1 n => String "1" (show_uint n)
| D2 n => String "2" (show_uint n)
| D3 n => String "3" (show_uint n)
| D4 n => String "4" (show_uint n)
| D5 n => String "5" (show_uint n)
| D6 n => String "6" (show_uint n)
| D7 n => String "7" (show_... | Fixpoint | show_uint | src | src/Show.v | [
"Coq",
"Ascii",
"Basics",
"Decimal",
"List",
"String",
"ZArith",
"ListNotations",
"Coq.Strings.String.StringSyntax"
] | [
"string"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
show_int (n : int) : string | :=
match n with
| Pos n => show_uint n
| Neg n => String "-" (show_uint n)
end. | Definition | show_int | src | src/Show.v | [
"Coq",
"Ascii",
"Basics",
"Decimal",
"List",
"String",
"ZArith",
"ListNotations",
"Coq.Strings.String.StringSyntax"
] | [
"int",
"show_uint",
"string"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
show_nat (n : nat) : string | :=
show_uint (Nat.to_uint n). | Definition | show_nat | src | src/Show.v | [
"Coq",
"Ascii",
"Basics",
"Decimal",
"List",
"String",
"ZArith",
"ListNotations",
"Coq.Strings.String.StringSyntax"
] | [
"nat",
"show_uint",
"string"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
show_bool (b : bool) : string | :=
match b with
| true => "true"
| false => "false"
end. | Definition | show_bool | src | src/Show.v | [
"Coq",
"Ascii",
"Basics",
"Decimal",
"List",
"String",
"ZArith",
"ListNotations",
"Coq.Strings.String.StringSyntax"
] | [
"string"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
show_Z (n : Z) : string | :=
show_int (Z.to_int n). | Definition | show_Z | src | src/Show.v | [
"Coq",
"Ascii",
"Basics",
"Decimal",
"List",
"String",
"ZArith",
"ListNotations",
"Coq.Strings.String.StringSyntax"
] | [
"show_int",
"string"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
show_N : N -> string | :=
show_Z ∘ Z.of_N. | Definition | show_N | src | src/Show.v | [
"Coq",
"Ascii",
"Basics",
"Decimal",
"List",
"String",
"ZArith",
"ListNotations",
"Coq.Strings.String.StringSyntax"
] | [
"show_Z",
"string"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
showUint : Show uint | :=
{|
show := show_uint
|}. | Instance | showUint | src | src/Show.v | [
"Coq",
"Ascii",
"Basics",
"Decimal",
"List",
"String",
"ZArith",
"ListNotations",
"Coq.Strings.String.StringSyntax"
] | [
"Show",
"show_uint"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
showInt : Show int | :=
{|
show := show_int
|}. | Instance | showInt | src | src/Show.v | [
"Coq",
"Ascii",
"Basics",
"Decimal",
"List",
"String",
"ZArith",
"ListNotations",
"Coq.Strings.String.StringSyntax"
] | [
"Show",
"int",
"show_int"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
showNat : Show nat | :=
{|
show := show_nat
|}. | Instance | showNat | src | src/Show.v | [
"Coq",
"Ascii",
"Basics",
"Decimal",
"List",
"String",
"ZArith",
"ListNotations",
"Coq.Strings.String.StringSyntax"
] | [
"Show",
"nat",
"show_nat"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
showBool : Show bool | :=
{|
show := show_bool
|}. | Instance | showBool | src | src/Show.v | [
"Coq",
"Ascii",
"Basics",
"Decimal",
"List",
"String",
"ZArith",
"ListNotations",
"Coq.Strings.String.StringSyntax"
] | [
"Show",
"show_bool"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
showZ : Show Z | :=
{|
show := show_Z
|}. | Instance | showZ | src | src/Show.v | [
"Coq",
"Ascii",
"Basics",
"Decimal",
"List",
"String",
"ZArith",
"ListNotations",
"Coq.Strings.String.StringSyntax"
] | [
"Show",
"show_Z"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
showN : Show N | :=
{|
show := show_N
|}. | Instance | showN | src | src/Show.v | [
"Coq",
"Ascii",
"Basics",
"Decimal",
"List",
"String",
"ZArith",
"ListNotations",
"Coq.Strings.String.StringSyntax"
] | [
"Show",
"show_N"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
from_list (s : list ascii) : string | :=
match s with
| [] => EmptyString
| c :: s' => String c (from_list s')
end. | Fixpoint | from_list | src | src/Show.v | [
"Coq",
"Ascii",
"Basics",
"Decimal",
"List",
"String",
"ZArith",
"ListNotations",
"Coq.Strings.String.StringSyntax"
] | [
"string"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
unit_digit (n : nat) : ascii | :=
ascii_of_nat ((n mod 10) + 48 (* 0 *)). | Definition | unit_digit | src | src/Show.v | [
"Coq",
"Ascii",
"Basics",
"Decimal",
"List",
"String",
"ZArith",
"ListNotations",
"Coq.Strings.String.StringSyntax"
] | [
"nat"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
three_digit (n : nat) : string | :=
let n0 := unit_digit n in
let n1 := unit_digit (n / 10) in
let n2 := unit_digit (n / 100) in
from_list [n2; n1; n0]. | Definition | three_digit | src | src/Show.v | [
"Coq",
"Ascii",
"Basics",
"Decimal",
"List",
"String",
"ZArith",
"ListNotations",
"Coq.Strings.String.StringSyntax"
] | [
"from_list",
"nat",
"string",
"unit_digit"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
digit_of_ascii (c : ascii) : option nat | :=
let n := nat_of_ascii c in
if ((48 <=? n)%nat && (n <=? 57)%nat)%bool then
Some (n - 48)
else
None. | Definition | digit_of_ascii | src | src/Show.v | [
"Coq",
"Ascii",
"Basics",
"Decimal",
"List",
"String",
"ZArith",
"ListNotations",
"Coq.Strings.String.StringSyntax"
] | [
"nat"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
unthree_digit (c2 c1 c0 : ascii) : option ascii | :=
let doa := digit_of_ascii in
match doa c2, doa c1, doa c0 with
| Some n2, Some n1, Some n0 =>
Some (ascii_of_nat (n2 * 100 + n1 * 10 + n0))
| _, _, _ => None
end. | Definition | unthree_digit | src | src/Show.v | [
"Coq",
"Ascii",
"Basics",
"Decimal",
"List",
"String",
"ZArith",
"ListNotations",
"Coq.Strings.String.StringSyntax"
] | [
"digit_of_ascii"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
show_quoted_string (s:string) : string | :=
match s with
| EmptyString => """"
| String c s' =>
let quoted_s' := show_quoted_string s' in
let n := nat_of_ascii c in
if ascii_dec c "009" (* TAB *) then
"\t" ++ quoted_s'
else if ascii_dec c "010" (* NEWLINE *) then
"\n" ++ quoted_s'
else if ascii_dec c "013" (* CARRIAGE RET... | Fixpoint | show_quoted_string | src | src/Show.v | [
"Coq",
"Ascii",
"Basics",
"Decimal",
"List",
"String",
"ZArith",
"ListNotations",
"Coq.Strings.String.StringSyntax"
] | [
"nat",
"string",
"three_digit"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
showString : Show string | :=
{|
show s := String """" (show_quoted_string s)
|}. | Instance | showString | src | src/Show.v | [
"Coq",
"Ascii",
"Basics",
"Decimal",
"List",
"String",
"ZArith",
"ListNotations",
"Coq.Strings.String.StringSyntax"
] | [
"Show",
"show_quoted_string",
"string"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
read_quoted_string (s : string) : option string | :=
match s with
| String c s' =>
if ascii_dec c """" then
match s' with
| EmptyString => Some EmptyString
| _ => None
end
else if ascii_dec c "\" then
match s' with
| String c2 s'' =>
if ascii_dec c2 "n" then
option_map (String "010") (read_quoted_string... | Fixpoint | read_quoted_string | src | src/Show.v | [
"Coq",
"Ascii",
"Basics",
"Decimal",
"List",
"String",
"ZArith",
"ListNotations",
"Coq.Strings.String.StringSyntax"
] | [
"option_map",
"string",
"unthree_digit"
] | Example:
Compute (show (from_list
[ascii_of_nat 10;
ascii_of_nat 14;
"a"%char;
ascii_of_nat 127])).
> """\n\014a\127""" | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 |
read_string (s : string) : option string | :=
match s with
| EmptyString => None
| String c s' => read_quoted_string s'
end. | Definition | read_string | src | src/Show.v | [
"Coq",
"Ascii",
"Basics",
"Decimal",
"List",
"String",
"ZArith",
"ListNotations",
"Coq.Strings.String.StringSyntax"
] | [
"read_quoted_string",
"string"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
contents {A : Type} (s : A -> string) (l : list A) : string | :=
match l with
| nil => ""%string
| cons h nil => s h
| cons h t => append (append (s h) "; ") (contents s t)
end. | Fixpoint | contents | src | src/Show.v | [
"Coq",
"Ascii",
"Basics",
"Decimal",
"List",
"String",
"ZArith",
"ListNotations",
"Coq.Strings.String.StringSyntax"
] | [
"string"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
showList {A : Type} `{_ : Show A} : Show (list A) | :=
{|
show l := append "[" (append (contents show l) "]")
|}. | Instance | showList | src | src/Show.v | [
"Coq",
"Ascii",
"Basics",
"Decimal",
"List",
"String",
"ZArith",
"ListNotations",
"Coq.Strings.String.StringSyntax"
] | [
"Show",
"contents"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
show_time : Show Time | :=
{|
show t := """time"": " ++
(
let s := (show (time t)) in
let len := length s in
"""" ++ (substring 0 (len - 3) s) ++ "." ++ (substring (len-3) len s) ++ "ms"""
)
|}. | Instance | show_time | src | src/Show.v | [
"Coq",
"Ascii",
"Basics",
"Decimal",
"List",
"String",
"ZArith",
"ListNotations",
"Coq.Strings.String.StringSyntax"
] | [
"Show",
"Time",
"length"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
show_augmented_time {A : Type} `{_ : Show A} : Show (AugmentedTime A) | :=
{|
show aut := match aut with mkAugTime _ res tAux => (show (res) ++ ", " ++ show (tAux))%string end
|}. | Instance | show_augmented_time | src | src/Show.v | [
"Coq",
"Ascii",
"Basics",
"Decimal",
"List",
"String",
"ZArith",
"ListNotations",
"Coq.Strings.String.StringSyntax"
] | [
"AugmentedTime",
"Show",
"string"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
showPair {A B : Type} `{_ : Show A} `{_ : Show B} : Show (A * B) | :=
{|
show p := match p with (a,b) => ("(" ++ show a ++ ", " ++ show b ++ ")")%string end
|}. | Instance | showPair | src | src/Show.v | [
"Coq",
"Ascii",
"Basics",
"Decimal",
"List",
"String",
"ZArith",
"ListNotations",
"Coq.Strings.String.StringSyntax"
] | [
"Show",
"string"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
showOpt {A : Type} `{_ : Show A} : Show (option A) | :=
{|
show x := match x with
| Some x => "Some " ++ (show x)
| None => "None"
end
|}. | Instance | showOpt | src | src/Show.v | [
"Coq",
"Ascii",
"Basics",
"Decimal",
"List",
"String",
"ZArith",
"ListNotations",
"Coq.Strings.String.StringSyntax"
] | [
"Show"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
showType : Show Type | :=
{|
show x := "nat :-)"
|}. | Instance | showType | src | src/Show.v | [
"Coq",
"Ascii",
"Basics",
"Decimal",
"List",
"String",
"ZArith",
"ListNotations",
"Coq.Strings.String.StringSyntax"
] | [
"Show"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
showEx {A} `{_ : Show A} P : Show ({x : A | P x}) | :=
{|
show ex := let '(exist _ x _) := ex in show x
|}. | Instance | showEx | src | src/Show.v | [
"Coq",
"Ascii",
"Basics",
"Decimal",
"List",
"String",
"ZArith",
"ListNotations",
"Coq.Strings.String.StringSyntax"
] | [
"Show",
"ex"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
nl : string | := String "010" EmptyString. | Definition | nl | src | src/Show.v | [
"Coq",
"Ascii",
"Basics",
"Decimal",
"List",
"String",
"ZArith",
"ListNotations",
"Coq.Strings.String.StringSyntax"
] | [
"string"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
smart_paren (s : string) : string | :=
let fix aux s (b : bool) :=
match s with
| EmptyString => (if b then ")" else "", b)
| String a s =>
let (s', b) := aux s (orb b (nat_of_ascii a =? 32)%nat) in
(String a s', b)
end in
let (s', b) := aux s false in
if b then "(" ++ s' else s'. | Definition | smart_paren | src | src/Show.v | [
"Coq",
"Ascii",
"Basics",
"Decimal",
"List",
"String",
"ZArith",
"ListNotations",
"Coq.Strings.String.StringSyntax"
] | [
"nat",
"orb",
"string"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
ReprSubset (A : Type) | :=
{ representatives : list A }. | Class | ReprSubset | src | src/Show.v | [
"Coq",
"Ascii",
"Basics",
"Decimal",
"List",
"String",
"ZArith",
"ListNotations",
"Coq.Strings.String.StringSyntax"
] | [] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
repr_bool : ReprSubset bool | :=
{| representatives := [ true; false ] |}. | Instance | repr_bool | src | src/Show.v | [
"Coq",
"Ascii",
"Basics",
"Decimal",
"List",
"String",
"ZArith",
"ListNotations",
"Coq.Strings.String.StringSyntax"
] | [
"ReprSubset"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
repr_nat : ReprSubset nat | :=
{| representatives := [ 0 ; 1 ; 2 ; 17 ; 42 ] |}. | Instance | repr_nat | src | src/Show.v | [
"Coq",
"Ascii",
"Basics",
"Decimal",
"List",
"String",
"ZArith",
"ListNotations",
"Coq.Strings.String.StringSyntax"
] | [
"ReprSubset",
"nat"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
repr_option {A} `{_ : ReprSubset A} : ReprSubset (option A) | :=
{| representatives := None :: map Some representatives |}. | Instance | repr_option | src | src/Show.v | [
"Coq",
"Ascii",
"Basics",
"Decimal",
"List",
"String",
"ZArith",
"ListNotations",
"Coq.Strings.String.StringSyntax"
] | [
"ReprSubset",
"map"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
repr_list {A} `{_ : ReprSubset A} : ReprSubset (list A) | :=
{| representatives :=
[] :: map (fun x => [x]) representatives
++ flat_map (fun x : A =>
map (fun y : A => [x;y]) representatives
) representatives
|}%list. | Instance | repr_list | src | src/Show.v | [
"Coq",
"Ascii",
"Basics",
"Decimal",
"List",
"String",
"ZArith",
"ListNotations",
"Coq.Strings.String.StringSyntax"
] | [
"ReprSubset",
"flat_map",
"map"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
repr_prod {A B} `{_ : ReprSubset A} `{_ : ReprSubset B} :
ReprSubset (A * B) | :=
{| representatives :=
flat_map (fun x : A =>
map (fun y : B => (x,y)) representatives
) representatives
|}. | Instance | repr_prod | src | src/Show.v | [
"Coq",
"Ascii",
"Basics",
"Decimal",
"List",
"String",
"ZArith",
"ListNotations",
"Coq.Strings.String.StringSyntax"
] | [
"ReprSubset",
"flat_map",
"map"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
prepend {A : Type} (a : A) (l : list A) | :=
match l with
| [] => []
| h::t => a :: h :: prepend a t
end. | Fixpoint | prepend | src | src/Show.v | [
"Coq",
"Ascii",
"Basics",
"Decimal",
"List",
"String",
"ZArith",
"ListNotations",
"Coq.Strings.String.StringSyntax"
] | [] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
intersperse {A : Type} (a : A) (l : list A) | :=
match l with
| [] => []
| h::t => h :: prepend a t
end. | Definition | intersperse | src | src/Show.v | [
"Coq",
"Ascii",
"Basics",
"Decimal",
"List",
"String",
"ZArith",
"ListNotations",
"Coq.Strings.String.StringSyntax"
] | [
"prepend"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
string_concat (l : list string) : string | :=
fold_left (fun a b => a ++ b) l "". | Definition | string_concat | src | src/Show.v | [
"Coq",
"Ascii",
"Basics",
"Decimal",
"List",
"String",
"ZArith",
"ListNotations",
"Coq.Strings.String.StringSyntax"
] | [
"string"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
show_fun {A B} `{_ : Show A} `{_ : ReprSubset A}
`{_ : Show B} : Show (A -> B) | :=
{| show f :=
"{ " ++ string_concat (intersperse " , "
(map (fun x => show x ++ " |-> " ++ show (f x))
(@representatives A _)))
++ " }"
|}. | Instance | show_fun | src | src/Show.v | [
"Coq",
"Ascii",
"Basics",
"Decimal",
"List",
"String",
"ZArith",
"ListNotations",
"Coq.Strings.String.StringSyntax"
] | [
"ReprSubset",
"Show",
"intersperse",
"map",
"string_concat"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
trace {A : Type} (s : string) (a : A) : A | := a. | Definition | trace | src | src/Show.v | [
"Coq",
"Ascii",
"Basics",
"Decimal",
"List",
"String",
"ZArith",
"ListNotations",
"Coq.Strings.String.StringSyntax"
] | [
"string"
] | Extraction will map this to something that additionally prints stuff | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 |
deprecate {A : Type} (old new: string) (a : A) : A | :=
trace ("Deprecated function: " ++ old ++ ". Use " ++ new ++ " instead.") a. | Definition | deprecate | src | src/Show.v | [
"Coq",
"Ascii",
"Basics",
"Decimal",
"List",
"String",
"ZArith",
"ListNotations",
"Coq.Strings.String.StringSyntax"
] | [
"string",
"trace"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
not_digit_when (c : ascii) (x : nat) :
(nat_of_ascii c < 48) \/ (57 < nat_of_ascii c) ->
unit_digit x <> c. | Proof.
assert (mod_fact : x mod 10 < 10).
{ apply Nat.mod_upper_bound; auto. }
intros H e.
unfold unit_digit in e.
apply (f_equal nat_of_ascii) in e.
rewrite nat_ascii_embedding in e.
all: lia.
Qed. | Lemma | not_digit_when | src | src/ShowFacts.v | [
"Coq",
"List",
"String",
"Ascii",
"Lia",
"Arith",
"ListNotations",
"QuickChick",
"Compat",
"Show"
] | [
"all",
"nat",
"unit_digit"
] | Proof that Show for string round-trips. | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 |
unit_digit_ascii :
forall n, digit_of_ascii (unit_digit n) = Some (n mod 10). | Proof.
intro.
assert (mod_fact : n mod 10 < 10).
{ apply Nat.mod_upper_bound; auto. }
unfold unit_digit.
unfold digit_of_ascii.
rewrite nat_ascii_embedding.
replace (48 <=? n mod 10 + 48) with true.
replace (n mod 10 + 48 <=? 57) with true.
rewrite Nat.add_sub.
auto.
{ symmetry. apply leb_correct.... | Lemma | unit_digit_ascii | src | src/ShowFacts.v | [
"Coq",
"List",
"String",
"Ascii",
"Lia",
"Arith",
"ListNotations",
"QuickChick",
"Compat",
"Show"
] | [
"digit_of_ascii",
"leb_correct",
"unit_digit"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
decimal_thousand : forall n,
n < 256 ->
(n / 100) mod 10 * 100 + (n / 10) mod 10 * 10 + n mod 10 = n. | Proof.
intros.
rewrite Nat.div_mod with (y:=10); auto.
rewrite Nat.add_cancel_r.
replace 100 with (10*10) by auto.
rewrite Nat.mul_assoc.
rewrite <- Nat.mul_add_distr_r.
rewrite Nat.mul_comm.
rewrite Nat.mul_cancel_l; auto.
rewrite <- Nat.div_div.
rewrite (Nat.div_mod (n/10) 10) at 3; auto.
rewrit... | Lemma | decimal_thousand | src | src/ShowFacts.v | [
"Coq",
"List",
"String",
"Ascii",
"Lia",
"Arith",
"ListNotations",
"QuickChick",
"Compat",
"Show"
] | [] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
unthree_three_digit (c : ascii) :
let n := nat_of_ascii c in
unthree_digit
(unit_digit (n / 100)) (unit_digit (n / 10)) (unit_digit n)
= Some (ascii_of_nat n). | Proof.
unfold unthree_digit.
do 3 rewrite unit_digit_ascii.
rewrite decimal_thousand.
auto.
apply nat_ascii_bounded.
Qed. | Lemma | unthree_three_digit | src | src/ShowFacts.v | [
"Coq",
"List",
"String",
"Ascii",
"Lia",
"Arith",
"ListNotations",
"QuickChick",
"Compat",
"Show"
] | [
"decimal_thousand",
"unit_digit",
"unit_digit_ascii",
"unthree_digit"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
read_show_quoted_string : forall (s : string),
read_quoted_string (show_quoted_string s) = Some s. | Proof.
induction s.
- auto.
- unfold show_quoted_string.
destruct (ascii_dec a "009") as [is_tab | isn_tab].
{ fold show_quoted_string.
simpl.
rewrite IHs.
rewrite is_tab; auto.
}
destruct (ascii_dec a "010") as [is_nl | isn_nl].
{ fold show_quoted_string.
simpl; rewrit... | Lemma | read_show_quoted_string | src | src/ShowFacts.v | [
"Coq",
"List",
"String",
"Ascii",
"Lia",
"Arith",
"ListNotations",
"QuickChick",
"Compat",
"Show"
] | [
"fold",
"not_digit_when",
"read_quoted_string",
"show_quoted_string",
"string",
"unthree_three_digit"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
read_show_string : forall (s : string),
read_string (show s) = Some s. | Proof.
intro.
simpl.
apply read_show_quoted_string.
Qed. | Lemma | read_show_string | src | src/ShowFacts.v | [
"Coq",
"List",
"String",
"Ascii",
"Lia",
"Arith",
"ListNotations",
"QuickChick",
"Compat",
"Show"
] | [
"read_show_quoted_string",
"read_string",
"string"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
State | := MkState
{ maxSuccessTests : nat
; maxDiscardedTests : nat
; maxShrinkNo : nat
; computeSize : nat -> nat -> nat
; numSuccessTests : nat
; numDiscardedTests : nat
; labels : Map.t nat
; expectedFailure : bool
; randomSeed : RandomSeed
; numSuccessShrinks : n... | Record | State | src | src/State.v | [
"RandomQC",
"Coq.Strings.String",
"StringOT",
"FSets.FMapAVL"
] | [
"RandomSeed",
"nat"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
updTryShrinks (st : State) (f : nat -> nat) : State | :=
match st with
| MkState mst mdt ms cs nst ndt ls e r nss nts ana =>
MkState mst mdt ms cs nst ndt ls e r nss (f nts) ana
end. | Definition | updTryShrinks | src | src/State.v | [
"RandomQC",
"Coq.Strings.String",
"StringOT",
"FSets.FMapAVL"
] | [
"State",
"nat"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
updSuccessShrinks (st : State) (f : nat -> nat) : State | :=
match st with
| MkState mst mdt ms cs nst ndt ls e r nss nts ana =>
MkState mst mdt ms cs nst ndt ls e r (f nss) nts ana
end. | Definition | updSuccessShrinks | src | src/State.v | [
"RandomQC",
"Coq.Strings.String",
"StringOT",
"FSets.FMapAVL"
] | [
"State",
"nat"
] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
updSuccTests st f | :=
match st with
| MkState mst mdt ms cs nst ndt ls e r nss nts ana =>
MkState mst mdt ms cs (f nst) ndt ls e r nss nts ana
end. | Definition | updSuccTests | src | src/State.v | [
"RandomQC",
"Coq.Strings.String",
"StringOT",
"FSets.FMapAVL"
] | [] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 | |
updDiscTests st f | :=
match st with
| MkState mst mdt ms cs nst ndt ls e r nss nts ana =>
MkState mst mdt ms cs nst (f ndt) ls e r nss nts ana
end. | Definition | updDiscTests | src | src/State.v | [
"RandomQC",
"Coq.Strings.String",
"StringOT",
"FSets.FMapAVL"
] | [] | https://github.com/QuickChick/QuickChick | 5a6c291b11e9affe059c0e1812612bc474d0a129 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.