fact stringlengths 8 1.54k | type stringclasses 19 values | library stringclasses 8 values | imports listlengths 1 10 | filename stringclasses 98 values | symbolic_name stringlengths 1 42 | docstring stringclasses 1 value |
|---|---|---|---|---|---|---|
all_nseqb(b : bool) x : all (nseq b x) = b ==> a x.
Proof. by rewrite all_nseq eqb0 implybE. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | all_nseqb | |
filter_nseqn x : filter (nseq n x) = nseq (a x * n) x.
Proof. by elim: n => /= [|n ->]; case: (a x). Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | filter_nseq | |
count_nseqn x : count (nseq n x) = a x * n.
Proof. by rewrite -size_filter filter_nseq size_nseq. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | count_nseq | |
find_nseqn x : find (nseq n x) = ~~ a x * n.
Proof. by elim: n => /= [|n ->]; case: (a x). Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | find_nseq | |
nth_finds : has s -> a (nth s (find s)).
Proof. by elim: s => //= x s IHs; case a_x: (a x). Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | nth_find | |
before_finds i : i < find s -> a (nth s i) = false.
Proof. by elim: s i => //= x s IHs; case: ifP => // a'x [|i] // /(IHs i). Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | before_find | |
hasNfinds : ~~ has s -> find s = size s.
Proof. by rewrite has_find; case: ltngtP (find_size s). Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | hasNfind | |
filter_cats1 s2 : filter (s1 ++ s2) = filter s1 ++ filter s2.
Proof. by elim: s1 => //= x s1 ->; case (a x). Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | filter_cat | |
filter_rconss x :
filter (rcons s x) = if a x then rcons (filter s) x else filter s.
Proof. by rewrite -!cats1 filter_cat /=; case (a x); rewrite /= ?cats0. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | filter_rcons | |
count_cats1 s2 : count (s1 ++ s2) = count s1 + count s2.
Proof. by rewrite -!size_filter filter_cat size_cat. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | count_cat | |
has_cats1 s2 : has (s1 ++ s2) = has s1 || has s2.
Proof. by elim: s1 => [|x s1 IHs] //=; rewrite IHs orbA. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | has_cat | |
has_rconss x : has (rcons s x) = a x || has s.
Proof. by rewrite -cats1 has_cat has_seq1 orbC. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | has_rcons | |
all_cats1 s2 : all (s1 ++ s2) = all s1 && all s2.
Proof. by elim: s1 => [|x s1 IHs] //=; rewrite IHs andbA. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | all_cat | |
all_rconss x : all (rcons s x) = a x && all s.
Proof. by rewrite -cats1 all_cat all_seq1 andbC. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | all_rcons | |
find_pred0s : find pred0 s = size s. Proof. by []. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | find_pred0 | |
find_predTs : find predT s = 0.
Proof. by case: s. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | find_predT | |
eq_finda1 a2 : a1 =1 a2 -> find a1 =1 find a2.
Proof. by move=> Ea; elim=> //= x s IHs; rewrite Ea IHs. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | eq_find | |
eq_filtera1 a2 : a1 =1 a2 -> filter a1 =1 filter a2.
Proof. by move=> Ea; elim=> //= x s IHs; rewrite Ea IHs. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | eq_filter | |
eq_counta1 a2 : a1 =1 a2 -> count a1 =1 count a2.
Proof. by move=> Ea s; rewrite -!size_filter (eq_filter Ea). Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | eq_count | |
eq_hasa1 a2 : a1 =1 a2 -> has a1 =1 has a2.
Proof. by move=> Ea s; rewrite !has_count (eq_count Ea). Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | eq_has | |
eq_alla1 a2 : a1 =1 a2 -> all a1 =1 all a2.
Proof. by move=> Ea s; rewrite !all_count (eq_count Ea). Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | eq_all | |
all_filter(p q : pred T) xs :
all p (filter q xs) = all [pred i | q i ==> p i] xs.
Proof. by elim: xs => //= x xs <-; case: (q x). Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | all_filter | |
sub_finds : find a2 s <= find a1 s.
Proof. by elim: s => //= x s IHs; case: ifP => // /(contraFF (@s12 x))->. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | sub_find | |
sub_hass : has a1 s -> has a2 s.
Proof. by rewrite !has_find; apply: leq_ltn_trans (sub_find s). Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | sub_has | |
sub_counts : count a1 s <= count a2 s.
Proof.
by elim: s => //= x s; apply: leq_add; case a1x: (a1 x); rewrite // s12.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | sub_count | |
sub_alls : all a1 s -> all a2 s.
Proof.
by rewrite !all_count !eqn_leq !count_size => /leq_trans-> //; apply: sub_count.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | sub_all | |
filter_pred0s : filter pred0 s = [::]. Proof. by elim: s. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | filter_pred0 | |
filter_predTs : filter predT s = s.
Proof. by elim: s => //= x s ->. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | filter_predT | |
filter_predIa1 a2 s : filter (predI a1 a2) s = filter a1 (filter a2 s).
Proof. by elim: s => //= x s ->; rewrite andbC; case: (a2 x). Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | filter_predI | |
count_pred0s : count pred0 s = 0.
Proof. by rewrite -size_filter filter_pred0. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | count_pred0 | |
count_predTs : count predT s = size s.
Proof. by rewrite -size_filter filter_predT. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | count_predT | |
count_predUIa1 a2 s :
count (predU a1 a2) s + count (predI a1 a2) s = count a1 s + count a2 s.
Proof.
elim: s => //= x s IHs; rewrite /= addnACA [RHS]addnACA IHs.
by case: (a1 x) => //; rewrite addn0.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | count_predUI | |
count_predCa s : count a s + count (predC a) s = size s.
Proof. by elim: s => //= x s IHs; rewrite addnACA IHs; case: (a _). Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | count_predC | |
count_filtera1 a2 s : count a1 (filter a2 s) = count (predI a1 a2) s.
Proof. by rewrite -!size_filter filter_predI. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | count_filter | |
has_pred0s : has pred0 s = false.
Proof. by rewrite has_count count_pred0. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | has_pred0 | |
has_predTs : has predT s = (0 < size s).
Proof. by rewrite has_count count_predT. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | has_predT | |
has_predCa s : has (predC a) s = ~~ all a s.
Proof. by elim: s => //= x s ->; case (a x). Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | has_predC | |
has_predUa1 a2 s : has (predU a1 a2) s = has a1 s || has a2 s.
Proof. by elim: s => //= x s ->; rewrite -!orbA; do !bool_congr. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | has_predU | |
all_pred0s : all pred0 s = (size s == 0).
Proof. by rewrite all_count count_pred0 eq_sym. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | all_pred0 | |
all_predTs : all predT s.
Proof. by rewrite all_count count_predT. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | all_predT | |
allT(a : pred T) s : (forall x, a x) -> all a s.
Proof. by move/eq_all->; apply/all_predT. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | allT | |
all_predCa s : all (predC a) s = ~~ has a s.
Proof. by elim: s => //= x s ->; case (a x). Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | all_predC | |
all_predIa1 a2 s : all (predI a1 a2) s = all a1 s && all a2 s.
Proof.
apply: (can_inj negbK); rewrite negb_and -!has_predC -has_predU.
by apply: eq_has => x; rewrite /= negb_and.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | all_predI | |
dropn s {struct s} :=
match s, n with
| _ :: s', n'.+1 => drop n' s'
| _, _ => s
end. | Fixpoint | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | drop | |
drop_behead: drop n0 =1 iter n0 behead.
Proof. by elim: n0 => [|n IHn] [|x s] //; rewrite iterSr -IHn. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | drop_behead | |
drop0s : drop 0 s = s. Proof. by case: s. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | drop0 | |
drop1: drop 1 =1 behead. Proof. by case=> [|x [|y s]]. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | drop1 | |
drop_oversizen s : size s <= n -> drop n s = [::].
Proof. by elim: s n => [|x s IHs] []. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | drop_oversize | |
drop_sizes : drop (size s) s = [::].
Proof. by rewrite drop_oversize // leqnn. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | drop_size | |
drop_consx s :
drop n0 (x :: s) = if n0 is n.+1 then drop n s else x :: s.
Proof. by []. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | drop_cons | |
size_drops : size (drop n0 s) = size s - n0.
Proof. by elim: s n0 => [|x s IHs] []. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | size_drop | |
drop_cats1 s2 :
drop n0 (s1 ++ s2) =
if n0 < size s1 then drop n0 s1 ++ s2 else drop (n0 - size s1) s2.
Proof. by elim: s1 n0 => [|x s1 IHs] []. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | drop_cat | |
drop_size_catn s1 s2 : size s1 = n -> drop n (s1 ++ s2) = s2.
Proof. by move <-; elim: s1 => //=; rewrite drop0. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | drop_size_cat | |
nconsKn x : cancel (ncons n x) (drop n).
Proof. by elim: n => // -[]. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | nconsK | |
drop_drops n1 n2 : drop n1 (drop n2 s) = drop (n1 + n2) s.
Proof. by elim: s n2 => // x s ihs [|n2]; rewrite ?drop0 ?addn0 ?addnS /=. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | drop_drop | |
taken s {struct s} :=
match s, n with
| x :: s', n'.+1 => x :: take n' s'
| _, _ => [::]
end. | Fixpoint | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | take | |
take0s : take 0 s = [::]. Proof. by case: s. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | take0 | |
take_oversizen s : size s <= n -> take n s = s.
Proof. by elim: s n => [|x s IHs] [|n] //= /IHs->. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | take_oversize | |
take_sizes : take (size s) s = s.
Proof. exact: take_oversize. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | take_size | |
take_consx s :
take n0 (x :: s) = if n0 is n.+1 then x :: (take n s) else [::].
Proof. by []. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | take_cons | |
drop_rconss : n0 <= size s ->
forall x, drop n0 (rcons s x) = rcons (drop n0 s) x.
Proof. by elim: s n0 => [|y s IHs] []. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | drop_rcons | |
cat_take_drops : take n0 s ++ drop n0 s = s.
Proof. by elim: s n0 => [|x s IHs] [|n] //=; rewrite IHs. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | cat_take_drop | |
size_takels : n0 <= size s -> size (take n0 s) = n0.
Proof.
by move/subKn; rewrite -size_drop -[in size s](cat_take_drop s) size_cat addnK.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | size_takel | |
size_takes : size (take n0 s) = if n0 < size s then n0 else size s.
Proof.
have [le_sn | lt_ns] := leqP (size s) n0; first by rewrite take_oversize.
by rewrite size_takel // ltnW.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | size_take | |
size_take_mins : size (take n0 s) = minn n0 (size s).
Proof. exact: size_take. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | size_take_min | |
take_cats1 s2 :
take n0 (s1 ++ s2) =
if n0 < size s1 then take n0 s1 else s1 ++ take (n0 - size s1) s2.
Proof.
elim: s1 n0 => [|x s1 IHs] [|n] //=.
by rewrite ltnS subSS -(fun_if (cons x)) -IHs.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | take_cat | |
take_size_catn s1 s2 : size s1 = n -> take n (s1 ++ s2) = s1.
Proof. by move <-; elim: s1 => [|x s1 IHs]; rewrite ?take0 //= IHs. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | take_size_cat | |
takel_cats1 s2 : n0 <= size s1 -> take n0 (s1 ++ s2) = take n0 s1.
Proof.
by rewrite take_cat; case: ltngtP => // ->; rewrite subnn take0 take_size cats0.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | takel_cat | |
nth_drops i : nth (drop n0 s) i = nth s (n0 + i).
Proof.
rewrite -[s in RHS]cat_take_drop nth_cat size_take ltnNge.
case: ltnP => [?|le_s_n0]; rewrite ?(leq_trans le_s_n0) ?leq_addr ?addKn //=.
by rewrite drop_oversize // !nth_default.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | nth_drop | |
find_ltnp s i : has p (take i s) -> find p s < i.
Proof. by elim: s i => [|y s ihs] [|i]//=; case: (p _) => //= /ihs. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | find_ltn | |
has_takep s i : has p s -> has p (take i s) = (find p s < i).
Proof. by elim: s i => [|y s ihs] [|i]//=; case: (p _) => //= /ihs ->. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | has_take | |
has_take_leq(p : pred T) (s : seq T) i : i <= size s ->
has p (take i s) = (find p s < i).
Proof. by elim: s i => [|y s ihs] [|i]//=; case: (p _) => //= /ihs ->. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | has_take_leq | |
nth_takei : i < n0 -> forall s, nth (take n0 s) i = nth s i.
Proof.
move=> lt_i_n0 s; case lt_n0_s: (n0 < size s).
by rewrite -[s in RHS]cat_take_drop nth_cat size_take lt_n0_s /= lt_i_n0.
by rewrite -[s in LHS]cats0 take_cat lt_n0_s /= cats0.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | nth_take | |
take_mini j s : take (minn i j) s = take i (take j s).
Proof. by elim: s i j => //= a l IH [|i] [|j] //=; rewrite minnSS IH. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | take_min | |
take_takeli j s : i <= j -> take i (take j s) = take i s.
Proof. by move=> ?; rewrite -take_min (minn_idPl _). Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | take_takel | |
take_takeri j s : j <= i -> take i (take j s) = take j s.
Proof. by move=> ?; rewrite -take_min (minn_idPr _). Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | take_taker | |
take_dropi 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 | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | take_drop | |
takeDi 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 | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | takeD | |
takeCi j s : take i (take j s) = take j (take i s).
Proof. by rewrite -!take_min minnC. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | takeC | |
take_nseqi 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 | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | take_nseq | |
drop_nseqi 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 | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | drop_nseq | |
drop_nthn 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 | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | drop_nth | |
take_nthn 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 | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | take_nth | |
rotn s := drop n s ++ take n s. | Definition | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | rot | |
rot0s : rot 0 s = s.
Proof. by rewrite /rot drop0 take0 cats0. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | rot0 | |
size_rots : size (rot n0 s) = size s.
Proof. by rewrite -[s in RHS]cat_take_drop /rot !size_cat addnC. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | size_rot | |
rot_oversizen s : size s <= n -> rot n s = s.
Proof. by move=> le_s_n; rewrite /rot take_oversize ?drop_oversize. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | rot_oversize | |
rot_sizes : rot (size s) s = s.
Proof. exact: rot_oversize. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | rot_size | |
has_rots a : has a (rot n0 s) = has a s.
Proof. by rewrite has_cat orbC -has_cat cat_take_drop. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | has_rot | |
rot_size_cats1 s2 : rot (size s1) (s1 ++ s2) = s2 ++ s1.
Proof. by rewrite /rot take_size_cat ?drop_size_cat. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | rot_size_cat | |
rotrn s := rot (size s - n) s. | Definition | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | rotr | |
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 | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | rotK | |
rot_inj: injective (rot n0). Proof. exact (can_inj rotK). Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | rot_inj | |
catrevs1 s2 := if s1 is x :: s1' then catrev s1' (x :: s2) else s2. | Fixpoint | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | catrev | |
revs := catrev s [::]. | Definition | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | rev | |
catrev_catls t u : catrev (s ++ t) u = catrev t (catrev s u).
Proof. by elim: s u => /=. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | catrev_catl | |
catrev_catrs t u : catrev s (t ++ u) = catrev s t ++ u.
Proof. by elim: s t => //= x s IHs t; rewrite -IHs. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | catrev_catr | |
catrevEs t : catrev s t = rev s ++ t.
Proof. by rewrite -catrev_catr. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | catrevE | |
rev_consx s : rev (x :: s) = rcons (rev s) x.
Proof. by rewrite -cats1 -catrevE. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | rev_cons | |
size_revs : size (rev s) = size s.
Proof. by elim: s => // x s IHs; rewrite rev_cons size_rcons IHs. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat"
] | boot/seq.v | size_rev |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.