statement
stringlengths
1
4.33k
proof
stringlengths
0
37.9k
type
stringclasses
25 values
symbolic_name
stringlengths
1
67
library
stringclasses
10 values
filename
stringclasses
112 values
imports
listlengths
2
138
deps
listlengths
0
64
docstring
stringclasses
798 values
source_url
stringclasses
1 value
commit
stringclasses
1 value
take_taker i j s : j <= i -> take i (take j s) = take j s.
Proof. by move=> ?; rewrite -take_min (minn_idPr _). Qed.
Lemma
take_taker
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "minn_idPr", "take", "take_min" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
take_drop i j s : take i (drop j s) = drop j (take (i + j) s).
Proof. by rewrite addnC; elim: s i j => // x s IHs [|i] [|j] /=. Qed.
Lemma
take_drop
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "addnC", "drop", "take" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
takeD i j s : take (i + j) s = take i s ++ take j (drop i s).
Proof. elim: i j s => [|i IHi] [|j] [|a s] //; first by rewrite take0 addn0 cats0. by rewrite addSn /= IHi. Qed.
Lemma
takeD
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "addSn", "addn0", "cats0", "drop", "take", "take0" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
takeC i j s : take i (take j s) = take j (take i s).
Proof. by rewrite -!take_min minnC. Qed.
Lemma
takeC
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "minnC", "take", "take_min" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
take_nseq i j x : i <= j -> take i (nseq j x) = nseq i x.
Proof. by move=>/subnKC <-; rewrite nseqD take_size_cat // size_nseq. Qed.
Lemma
take_nseq
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "nseq", "nseqD", "size_nseq", "subnKC", "take", "take_size_cat" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
drop_nseq i j x : drop i (nseq j x) = nseq (j - i) x.
Proof. case: (leqP i j) => [/subnKC {1}<-|/ltnW j_le_i]. by rewrite nseqD drop_size_cat // size_nseq. by rewrite drop_oversize ?size_nseq // (eqP j_le_i). Qed.
Lemma
drop_nseq
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "drop", "drop_oversize", "drop_size_cat", "leqP", "ltnW", "nseq", "nseqD", "size_nseq", "subnKC" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
drop_nth n s : n < size s -> drop n s = nth s n :: drop n.+1 s.
Proof. by elim: s n => [|x s IHs] [|n] Hn //=; rewrite ?drop0 1?IHs. Qed.
Lemma
drop_nth
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "drop", "drop0", "nth", "size" ]
will have to be given explicitly (and this will provide "d" as well).
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
take_nth n s : n < size s -> take n.+1 s = rcons (take n s) (nth s n).
Proof. by elim: s n => [|x s IHs] //= [|n] Hn /=; rewrite ?take0 -?IHs. Qed.
Lemma
take_nth
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "nth", "rcons", "size", "take", "take0" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
rot n s
:= drop n s ++ take n s.
Definition
rot
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "drop", "take" ]
Rotation
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
rot0 s : rot 0 s = s.
Proof. by rewrite /rot drop0 take0 cats0. Qed.
Lemma
rot0
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "cats0", "drop0", "rot", "take0" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
size_rot s : size (rot n0 s) = size s.
Proof. by rewrite -[s in RHS]cat_take_drop /rot !size_cat addnC. Qed.
Lemma
size_rot
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "addnC", "cat_take_drop", "rot", "size", "size_cat" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
rot_oversize n s : size s <= n -> rot n s = s.
Proof. by move=> le_s_n; rewrite /rot take_oversize ?drop_oversize. Qed.
Lemma
rot_oversize
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "drop_oversize", "rot", "size", "take_oversize" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
rot_size s : rot (size s) s = s.
Proof. exact: rot_oversize. Qed.
Lemma
rot_size
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "rot", "rot_oversize", "size" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
has_rot s a : has a (rot n0 s) = has a s.
Proof. by rewrite has_cat orbC -has_cat cat_take_drop. Qed.
Lemma
has_rot
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "cat_take_drop", "has", "has_cat", "rot" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
rot_size_cat s1 s2 : rot (size s1) (s1 ++ s2) = s2 ++ s1.
Proof. by rewrite /rot take_size_cat ?drop_size_cat. Qed.
Lemma
rot_size_cat
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "drop_size_cat", "rot", "s1", "s2", "size", "take_size_cat" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
rotr n s
:= rot (size s - n) s.
Definition
rotr
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "rot", "size" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
rotK : cancel (rot n0) (rotr n0).
Proof. move=> s; rewrite /rotr size_rot -size_drop {2}/rot. by rewrite rot_size_cat cat_take_drop. Qed.
Lemma
rotK
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "cat_take_drop", "rot", "rot_size_cat", "rotr", "size_drop", "size_rot" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
rot_inj : injective (rot n0).
Proof. exact (can_inj rotK). Qed.
Lemma
rot_inj
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "rot", "rotK" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
catrev s1 s2
:= if s1 is x :: s1' then catrev s1' (x :: s2) else s2.
Fixpoint
catrev
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "s1", "s2" ]
(efficient) reversal
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
rev s
:= catrev s [::].
Definition
rev
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "catrev" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
catrev_catl s t u : catrev (s ++ t) u = catrev t (catrev s u).
Proof. by elim: s u => /=. Qed.
Lemma
catrev_catl
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "catrev" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
catrev_catr s t u : catrev s (t ++ u) = catrev s t ++ u.
Proof. by elim: s t => //= x s IHs t; rewrite -IHs. Qed.
Lemma
catrev_catr
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "catrev" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
catrevE s t : catrev s t = rev s ++ t.
Proof. by rewrite -catrev_catr. Qed.
Lemma
catrevE
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "catrev", "catrev_catr", "rev" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
rev_cons x s : rev (x :: s) = rcons (rev s) x.
Proof. by rewrite -cats1 -catrevE. Qed.
Lemma
rev_cons
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "catrevE", "cats1", "rcons", "rev" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
size_rev s : size (rev s) = size s.
Proof. by elim: s => // x s IHs; rewrite rev_cons size_rcons IHs. Qed.
Lemma
size_rev
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "rev", "rev_cons", "size", "size_rcons" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
rev_nilp s : nilp (rev s) = nilp s.
Proof. by rewrite /nilp size_rev. Qed.
Lemma
rev_nilp
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "nilp", "rev", "size_rev" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
rev_cat s t : rev (s ++ t) = rev t ++ rev s.
Proof. by rewrite -catrev_catr -catrev_catl. Qed.
Lemma
rev_cat
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "catrev_catl", "catrev_catr", "rev" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
rev_rcons s x : rev (rcons s x) = x :: rev s.
Proof. by rewrite -cats1 rev_cat. Qed.
Lemma
rev_rcons
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "cats1", "rcons", "rev", "rev_cat" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
revK : involutive rev.
Proof. by elim=> //= x s IHs; rewrite rev_cons rev_rcons IHs. Qed.
Lemma
revK
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "rev", "rev_cons", "rev_rcons" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
nth_rev n s : n < size s -> nth (rev s) n = nth s (size s - n.+1).
Proof. elim/last_ind: s => // s x IHs in n *. rewrite rev_rcons size_rcons ltnS subSS -cats1 nth_cat /=. case: n => [|n] lt_n_s; first by rewrite subn0 ltnn subnn. by rewrite subnSK //= leq_subr IHs. Qed.
Lemma
nth_rev
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "cats1", "last_ind", "leq_subr", "ltnS", "ltnn", "nth", "nth_cat", "rev", "rev_rcons", "size", "size_rcons", "subSS", "subn0", "subnSK", "subnn" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
filter_rev a s : filter a (rev s) = rev (filter a s).
Proof. by elim: s => //= x s IH; rewrite fun_if !rev_cons filter_rcons IH. Qed.
Lemma
filter_rev
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "filter", "filter_rcons", "rev", "rev_cons" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
count_rev a s : count a (rev s) = count a s.
Proof. by rewrite -!size_filter filter_rev size_rev. Qed.
Lemma
count_rev
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "count", "filter_rev", "rev", "size_filter", "size_rev" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
has_rev a s : has a (rev s) = has a s.
Proof. by rewrite !has_count count_rev. Qed.
Lemma
has_rev
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "count_rev", "has", "has_count", "rev" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
all_rev a s : all a (rev s) = all a s.
Proof. by rewrite !all_count count_rev size_rev. Qed.
Lemma
all_rev
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "all", "all_count", "count_rev", "rev", "size_rev" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
rev_nseq n x : rev (nseq n x) = nseq n x.
Proof. by elim: n => // n IHn; rewrite -[in LHS]addn1 nseqD rev_cat IHn. Qed.
Lemma
rev_nseq
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "addn1", "nseq", "nseqD", "rev", "rev_cat" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
count_mem x
:= (count (pred_of_simpl (pred1 x))).
Notation
count_mem
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "count", "pred1" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
"[ 'seq' x <- s | C ]"
:= (filter (fun x => C%B) s) (x at level 99, format "[ '[hv' 'seq' x <- s '/ ' | C ] ']'") : seq_scope.
Notation
[ 'seq' x <- s | C ]
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "filter" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
"[ 'seq' x <- s | C1 & C2 ]"
:= [seq x <- s | C1 && C2] (format "[ '[hv' 'seq' x <- s '/ ' | C1 '/ ' & C2 ] ']'") : seq_scope.
Notation
[ 'seq' x <- s | C1 & C2 ]
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "seq" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
"[ 'seq' ' x <- s | C ]"
:= (filter (fun x => C%B) s) (x strict pattern, format "[ '[hv' 'seq' ' x <- s '/ ' | C ] ']'") : seq_scope.
Notation
[ 'seq' ' x <- s | C ]
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "filter", "pattern" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
"[ 'seq' ' x <- s | C1 & C2 ]"
:= [seq x <- s | C1 && C2] (x strict pattern, format "[ '[hv' 'seq' ' x <- s '/ ' | C1 '/ ' & C2 ] ']'") : seq_scope.
Notation
[ 'seq' ' x <- s | C1 & C2 ]
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "pattern", "seq" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
"[ 'seq' x : T <- s | C ]"
:= (filter (fun x : T => C%B) s) (only parsing).
Notation
[ 'seq' x : T <- s | C ]
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "filter" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
"[ 'seq' x : T <- s | C1 & C2 ]"
:= [seq x : T <- s | C1 && C2] (only parsing).
Notation
[ 'seq' x : T <- s | C1 & C2 ]
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "seq" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
seq_ind2 {S T} (P : seq S -> seq T -> Type) : P [::] [::] -> (forall x y s t, size s = size t -> P s t -> P (x :: s) (y :: t)) -> forall s t, size s = size t -> P s t.
Proof. by move=> Pnil Pcons; elim=> [|x s IHs] [|y t] //= [eq_sz]; apply/Pcons/IHs. Qed.
Lemma
seq_ind2
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "apply", "seq", "size" ]
Double induction/recursion.
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
all_iff_and (P Q : Prop) : Prop
:= AllIffConj of P & Q.
Inductive
all_iff_and
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[]
items in a circular list of implications
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
all_iff (P0 : Prop) (Ps : seq Prop) : Prop
:= let fix loop (P : Prop) (Qs : seq Prop) : Prop := if Qs is Q :: Qs then all_iff_and (P -> Q) (loop Q Qs) else P -> P0 in loop P0 Ps.
Definition
all_iff
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "P0", "all_iff_and", "seq" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
all_iffLR P0 Ps : all_iff P0 Ps -> forall m n, nth P0 (P0 :: Ps) m -> nth P0 (P0 :: Ps) n.
Proof. move=> iffPs; have PsS n: nth P0 Ps n -> nth P0 Ps n.+1. elim: n P0 Ps iffPs => [|n IHn] P0 [|P [|Q Ps]] //= [iP0P] //; first by case. by rewrite nth_nil. by case=> iPQ iffPs; apply: IHn; split=> // /iP0P. have{PsS} lePs: {homo nth P0 Ps : m n / m <= n >-> (m -> n)}. by move=> m n /subnK<-; elim: {n}(n...
Lemma
all_iffLR
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "P0", "all_iff", "apply", "leq0n", "leq_maxl", "leq_maxr", "nth", "nth_default", "nth_nil", "size", "split", "subnK" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
all_iffP P0 Ps : all_iff P0 Ps -> forall m n, nth P0 (P0 :: Ps) m <-> nth P0 (P0 :: Ps) n.
Proof. by move=> /all_iffLR-iffPs m n; split => /iffPs. Qed.
Lemma
all_iffP
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "P0", "all_iff", "all_iffLR", "nth", "split" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
all_iffP : all_iff >-> Funclass.
Coercion
all_iffP
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "all_iff" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
"[ '<->' P0 ; P1 ; .. ; Pn ]"
:= (all_iff P0 (@cons Prop P1 (.. (@cons Prop Pn nil) ..))) : form_scope.
Notation
[ '<->' P0 ; P1 ; .. ; Pn ]
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "P0", "P1", "all_iff" ]
This means "the following are all equivalent: P0, ... Pn"
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
tfae
:= do !apply: AllIffConj.
Ltac
tfae
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "apply" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
find_spec : bool -> nat -> Type
:= | NotFound of ~~ has a s : find_spec false (size s) | Found (i : nat) of i < size s & (forall x0, a (nth x0 s i)) & (forall x0 j, j < i -> a (nth x0 s j) = false) : find_spec true i.
Variant
find_spec
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "has", "nat", "nth", "size" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
findP : find_spec (has a s) (find a s).
Proof. have [a_s|aNs] := boolP (has a s); last by rewrite hasNfind//; constructor. by constructor=> [|x0|x0]; rewrite -?has_find ?nth_find//; apply: before_find. Qed.
Lemma
findP
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "apply", "before_find", "find", "find_spec", "has", "hasNfind", "has_find", "last", "nth_find" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
rot1_cons x s : rot 1 (x :: s) = rcons s x.
Proof. by rewrite /rot /= take0 drop0 -cats1. Qed.
Lemma
rot1_cons
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "cats1", "drop0", "rcons", "rot", "take0" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
rcons_inj s1 s2 x1 x2 : rcons s1 x1 = rcons s2 x2 :> seq T -> (s1, x1) = (s2, x2).
Proof. by rewrite -!rot1_cons => /rot_inj[-> ->]. Qed.
Lemma
rcons_inj
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "rcons", "rot1_cons", "rot_inj", "s1", "s2", "seq" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
rcons_injl x : injective (rcons^~ x).
Proof. by move=> s1 s2 /rcons_inj[]. Qed.
Lemma
rcons_injl
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "rcons", "rcons_inj", "s1", "s2" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
rcons_injr s : injective (rcons s).
Proof. by move=> x1 x2 /rcons_inj[]. Qed.
Lemma
rcons_injr
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "rcons", "rcons_inj" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
nth
:= (nth x0).
Notation
nth
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
eqseq s1 s2 {struct s2}
:= match s1, s2 with | [::], [::] => true | x1 :: s1', x2 :: s2' => (x1 == x2) && eqseq s1' s2' | _, _ => false end.
Fixpoint
eqseq
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "s1", "s2" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
eqseqP : Equality.axiom eqseq.
Proof. move; elim=> [|x1 s1 IHs] [|x2 s2]; do [by constructor | simpl]. have [<-|neqx] := x1 =P x2; last by right; case. by apply: (iffP (IHs s2)) => [<-|[]]. Qed.
Lemma
eqseqP
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "apply", "axiom", "eqseq", "last", "s1", "s2" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
eqseqE : eqseq = eq_op.
Proof. by []. Qed.
Lemma
eqseqE
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "eqseq" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
eqseq_cons x1 x2 s1 s2 : (x1 :: s1 == x2 :: s2) = (x1 == x2) && (s1 == s2).
Proof. by []. Qed.
Lemma
eqseq_cons
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "s1", "s2" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
eqseq_cat s1 s2 s3 s4 : size s1 = size s2 -> (s1 ++ s3 == s2 ++ s4) = (s1 == s2) && (s3 == s4).
Proof. elim: s1 s2 => [|x1 s1 IHs] [|x2 s2] //= [sz12]. by rewrite !eqseq_cons -andbA IHs. Qed.
Lemma
eqseq_cat
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "eqseq_cons", "s1", "s2", "s3", "s4", "size" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
eqseq_rcons s1 s2 x1 x2 : (rcons s1 x1 == rcons s2 x2) = (s1 == s2) && (x1 == x2).
Proof. by rewrite -(can_eq revK) !rev_rcons eqseq_cons andbC (can_eq revK). Qed.
Lemma
eqseq_rcons
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "can_eq", "eqseq_cons", "rcons", "revK", "rev_rcons", "s1", "s2" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
size_eq0 s : (size s == 0) = (s == [::]).
Proof. exact: (sameP nilP eqP). Qed.
Lemma
size_eq0
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "nilP", "size" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
nilpE s : nilp s = (s == [::]).
Proof. by case: s. Qed.
Lemma
nilpE
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "nilp" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
has_filter a s : has a s = (filter a s != [::]).
Proof. by rewrite -size_eq0 size_filter has_count lt0n. Qed.
Lemma
has_filter
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "filter", "has", "has_count", "lt0n", "size_eq0", "size_filter" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
mem_seq (s : seq T)
:= if s is y :: s' then xpredU1 y (mem_seq s') else xpred0.
Fixpoint
mem_seq
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "seq", "xpredU1" ]
mem_seq defines a predType for seq.
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
seq_eqclass
:= seq T.
Definition
seq_eqclass
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "seq" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
pred_of_seq (s : seq_eqclass) : {pred T}
:= mem_seq s.
Coercion
pred_of_seq
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "mem_seq", "seq_eqclass" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
seq_predType
:= PredType (pred_of_seq : seq T -> pred T).
Canonical
seq_predType
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "pred_of_seq", "seq" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
mem_seq_predType
:= PredType mem_seq.
Canonical
mem_seq_predType
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "mem_seq" ]
The line below makes mem_seq a canonical instance of topred.
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
in_cons y s x : (x \in y :: s) = (x == y) || (x \in s).
Proof. by []. Qed.
Lemma
in_cons
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
in_nil x : (x \in [::]) = false.
Proof. by []. Qed.
Lemma
in_nil
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
mem_seq1 x y : (x \in [:: y]) = (x == y).
Proof. by rewrite in_cons orbF. Qed.
Lemma
mem_seq1
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "in_cons" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
inE
:= (mem_seq1, in_cons, inE).
Let
inE
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "in_cons", "mem_seq1" ]
to be repeated after the Section discharge.
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
forall_cons {P : T -> Prop} {a s} : {in a::s, forall x, P x} <-> P a /\ {in s, forall x, P x}.
Proof. split=> [A|[A B]]; last by move => x /predU1P [-> //|]; apply: B. by split=> [|b Hb]; apply: A; rewrite !inE ?eqxx ?Hb ?orbT. Qed.
Lemma
forall_cons
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "apply", "eqxx", "inE", "last", "predU1P", "split" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
exists_cons {P : T -> Prop} {a s} : (exists2 x, x \in a::s & P x) <-> P a \/ exists2 x, x \in s & P x.
Proof. split=> [[x /predU1P[->|x_s] Px]|]; [by left| by right; exists x|]. by move=> [?|[x x_s ?]]; [exists a|exists x]; rewrite ?inE ?eqxx ?x_s ?orbT. Qed.
Lemma
exists_cons
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "Px", "eqxx", "inE", "predU1P", "split" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
mem_seq2 x y z : (x \in [:: y; z]) = xpred2 y z x.
Proof. by rewrite !inE. Qed.
Lemma
mem_seq2
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "inE", "xpred2" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
mem_seq3 x y z t : (x \in [:: y; z; t]) = xpred3 y z t x.
Proof. by rewrite !inE. Qed.
Lemma
mem_seq3
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "inE", "xpred3" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
mem_seq4 x y z t u : (x \in [:: y; z; t; u]) = xpred4 y z t u x.
Proof. by rewrite !inE. Qed.
Lemma
mem_seq4
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "inE", "xpred4" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
mem_cat x s1 s2 : (x \in s1 ++ s2) = (x \in s1) || (x \in s2).
Proof. by elim: s1 => //= y s1 IHs; rewrite !inE /= -orbA -IHs. Qed.
Lemma
mem_cat
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "inE", "s1", "s2" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
mem_catC x s1 s2 : (x \in s1 ++ s2) = (x \in s2 ++ s1).
Proof. by rewrite !mem_cat orbC. Qed.
Lemma
mem_catC
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "mem_cat", "s1", "s2" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
mem_rcons s y : rcons s y =i y :: s.
Proof. by move=> x; rewrite -cats1 /= mem_cat mem_seq1 orbC in_cons. Qed.
Lemma
mem_rcons
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "cats1", "in_cons", "mem_cat", "mem_seq1", "rcons" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
mem_head x s : x \in x :: s.
Proof. exact: predU1l. Qed.
Lemma
mem_head
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "predU1l" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
mem_last x s : last x s \in x :: s.
Proof. by rewrite lastI mem_rcons mem_head. Qed.
Lemma
mem_last
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "last", "lastI", "mem_head", "mem_rcons" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
mem_behead s : {subset behead s <= s}.
Proof. by case: s => // y s x; apply: predU1r. Qed.
Lemma
mem_behead
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "apply", "behead", "predU1r" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
mem_belast s y : {subset belast y s <= y :: s}.
Proof. by move=> x ys'x; rewrite lastI mem_rcons mem_behead. Qed.
Lemma
mem_belast
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "belast", "lastI", "mem_behead", "mem_rcons" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
mem_nth s n : n < size s -> nth s n \in s.
Proof. by elim: s n => // x s IHs [_|n sz_s]; rewrite ?mem_head // mem_behead ?IHs. Qed.
Lemma
mem_nth
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "mem_behead", "mem_head", "nth", "size" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
mem_nthE s n : (nth s n \in s) = ((n >= size s) ==> (x0 \in s)).
Proof. apply/idP/idP; first by case: ltnP => // ?; rewrite nth_default. by case: ltnP => //= ns x0s; [rewrite mem_nth|rewrite nth_default]. Qed.
Lemma
mem_nthE
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "apply", "ltnP", "mem_nth", "nth", "nth_default", "size" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
mem_take s x : x \in take n0 s -> x \in s.
Proof. by move=> s0x; rewrite -(cat_take_drop n0 s) mem_cat /= s0x. Qed.
Lemma
mem_take
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "cat_take_drop", "mem_cat", "take" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
mem_drop s x : x \in drop n0 s -> x \in s.
Proof. by move=> s0'x; rewrite -(cat_take_drop n0 s) mem_cat /= s0'x orbT. Qed.
Lemma
mem_drop
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "cat_take_drop", "drop", "mem_cat" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
last_eq s z x y : x != y -> z != y -> (last x s == y) = (last z s == y).
Proof. by move=> /negPf xz /negPf yz; case: s => [|t s]//; rewrite xz yz. Qed.
Lemma
last_eq
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "last" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
subset_cons2 x s s' : {subset s <= s'} -> {subset x :: s <= x :: s'}.
Proof. by move=> ss' y; rewrite !in_cons => /orP[->//|/ss'->]; rewrite orbT. Qed.
Lemma
subset_cons2
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "in_cons" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
subset_cons x s s' : {subset s <= s'} -> {subset s <= x :: s'}.
Proof. by move=> ss' y; rewrite !in_cons => /ss'-> /[!orbT]. Qed.
Lemma
subset_cons
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "in_cons" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
hasP {a s} : reflect (exists2 x, x \in s & a x) (has a s).
Proof. elim: s => [|y s IHs] /=; first by right; case. exact: equivP (orPP idP IHs) (iff_sym exists_cons). Qed.
Lemma
hasP
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "exists_cons", "has" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
allP {a s} : reflect {in s, forall x, a x} (all a s).
Proof. elim: s => [|/= y s IHs]; first by left. exact: equivP (andPP idP IHs) (iff_sym forall_cons). Qed.
Lemma
allP
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "all", "forall_cons" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
hasPn a s : reflect {in s, forall x, ~~ a x} (~~ has a s).
Proof. by rewrite -all_predC; apply: allP. Qed.
Lemma
hasPn
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "allP", "all_predC", "apply", "has" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
allPn a s : reflect (exists2 x, x \in s & ~~ a x) (~~ all a s).
Proof. by rewrite -has_predC; apply: hasP. Qed.
Lemma
allPn
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "all", "apply", "hasP", "has_predC" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
allss s : all [in s] s.
Proof. exact/allP. Qed.
Lemma
allss
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "all", "allP" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
mem_filter a x s : (x \in filter a s) = a x && (x \in s).
Proof. rewrite andbC; elim: s => //= y s IHs. rewrite (fun_if (fun s' : seq T => x \in s')) !in_cons {}IHs. by case: eqP => [->|_]; case (a y); rewrite /= ?andbF. Qed.
Lemma
mem_filter
boot
boot/seq.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat" ]
[ "filter", "in_cons", "seq" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d