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 |
|---|---|---|---|---|---|---|
nth_imageT' y0 (f : T -> T') A (i : 'I_#|A|) :
nth y0 (image f A) i = f (enum_val i).
Proof. by rewrite -(nth_map _ y0) // -cardE. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | nth_image | |
nth_codomT' y0 (f : T -> T') (i : 'I_#|T|) :
nth y0 (codom f) i = f (enum_val i).
Proof. exact: nth_image. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | nth_codom | |
nth_enum_rank_inx00 x0 A Ax0 :
{in A, cancel (@enum_rank_in T x0 A Ax0) (nth x00 (enum A))}.
Proof.
move=> x Ax; rewrite enum_rank_in.unlock insubdK ?nth_index ?mem_enum //.
by rewrite cardE [_ \in _]index_mem mem_enum.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | nth_enum_rank_in | |
nth_enum_rankx0 : cancel enum_rank (nth x0 (enum T)).
Proof. by move=> x; apply: nth_enum_rank_in. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | nth_enum_rank | |
enum_rankK_inx0 A Ax0 :
{in A, cancel (@enum_rank_in T x0 A Ax0) enum_val}.
Proof. by move=> x; apply: nth_enum_rank_in. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | enum_rankK_in | |
enum_rankK: cancel enum_rank enum_val.
Proof. by move=> x; apply: enum_rankK_in. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | enum_rankK | |
enum_valK_inx0 A Ax0 : cancel enum_val (@enum_rank_in T x0 A Ax0).
Proof.
move=> x; apply: ord_inj; rewrite enum_rank_in.unlock insubdK; last first.
by rewrite cardE [_ \in _]index_mem mem_nth // -cardE.
by rewrite index_uniq ?enum_uniq // -cardE.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | enum_valK_in | |
enum_valK: cancel enum_val enum_rank.
Proof. by move=> x; apply: enum_valK_in. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | enum_valK | |
enum_rank_inj: injective enum_rank.
Proof. exact: can_inj enum_rankK. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | enum_rank_inj | |
enum_val_injA : injective (@enum_val A).
Proof. by move=> i; apply: can_inj (enum_valK_in (enum_valP i)) (i). Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | enum_val_inj | |
enum_val_bij_inx0 A : x0 \in A -> {on A, bijective (@enum_val A)}.
Proof.
move=> Ax0; exists (enum_rank_in Ax0) => [i _|]; last exact: enum_rankK_in.
exact: enum_valK_in.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | enum_val_bij_in | |
eq_enum_rank_in(x0 y0 : T) A (Ax0 : x0 \in A) (Ay0 : y0 \in A) :
{in A, enum_rank_in Ax0 =1 enum_rank_in Ay0}.
Proof. by move=> x xA; apply: enum_val_inj; rewrite !enum_rankK_in. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | eq_enum_rank_in | |
enum_rank_in_inj(x0 y0 : T) A (Ax0 : x0 \in A) (Ay0 : y0 \in A) :
{in A &, forall x y, enum_rank_in Ax0 x = enum_rank_in Ay0 y -> x = y}.
Proof. by move=> x y xA yA /(congr1 enum_val); rewrite !enum_rankK_in. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | enum_rank_in_inj | |
enum_rank_bij: bijective enum_rank.
Proof. by move: enum_rankK enum_valK; exists (@enum_val T). Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | enum_rank_bij | |
enum_val_bij: bijective (@enum_val T).
Proof. by move: enum_rankK enum_valK; exists enum_rank. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | enum_val_bij | |
fin_all_existsU (P : forall x : T, U x -> Prop) :
(forall x, exists u, P x u) -> (exists u, forall x, P x (u x)).
Proof.
move=> ex_u; pose Q m x := enum_rank x < m -> {ux | P x ux}.
suffices: forall m, m <= #|T| -> exists w : forall x, Q m x, True.
case/(_ #|T|)=> // w _; pose u x := sval (w x (ltn_ord _)).
by exists u => x; rewrite {}/u; case: (w x _).
elim=> [|m IHm] ltmX; first by have w x: Q 0 x by []; exists w.
have{IHm} [w _] := IHm (ltnW ltmX); pose i := Ordinal ltmX.
have [u Pu] := ex_u (enum_val i); suffices w' x: Q m.+1 x by exists w'.
rewrite /Q ltnS leq_eqVlt (val_eqE _ i); case: eqP => [def_i _ | _ /w //].
by rewrite -def_i enum_rankK in u Pu; exists u.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | fin_all_exists | |
fin_all_exists2U (P Q : forall x : T, U x -> Prop) :
(forall x, exists2 u, P x u & Q x u) ->
(exists2 u, forall x, P x (u x) & forall x, Q x (u x)).
Proof.
move=> ex_u; have (x): exists u, P x u /\ Q x u by have [u] := ex_u x; exists u.
by case/fin_all_exists=> u /all_and2[]; exists u.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | fin_all_exists2 | |
enum_rank_ordn i : enum_rank i = cast_ord (esym (card_ord n)) i.
Proof.
apply: val_inj; rewrite /enum_rank enum_rank_in.unlock.
by rewrite insubdK ?index_enum_ord // card_ord [_ \in _]ltn_ord.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | enum_rank_ord | |
enum_val_ordn i : enum_val i = cast_ord (card_ord n) i.
Proof.
by apply: canLR (@enum_rankK _) _; apply: val_inj; rewrite enum_rank_ord.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | enum_val_ord | |
bumph i := (h <= i) + i. | Definition | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | bump | |
unbumph i := i - (h < i). | Definition | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | unbump | |
bumpKh : cancel (bump h) (unbump h).
Proof.
rewrite /bump /unbump => i.
have [le_hi | lt_ih] := leqP h i; first by rewrite ltnS le_hi subn1.
by rewrite ltnNge ltnW ?subn0.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | bumpK | |
neq_bumph i : h != bump h i.
Proof.
rewrite /bump eqn_leq; have [le_hi | lt_ih] := leqP h i.
by rewrite ltnNge le_hi andbF.
by rewrite leqNgt lt_ih.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | neq_bump | |
unbumpKcondh i : bump h (unbump h i) = (i == h) + i.
Proof.
rewrite /bump /unbump leqNgt -subSKn.
case: (ltngtP i h) => /= [-> | ltih | ->] //; last by rewrite ltnn.
by rewrite subn1 /= leqNgt !(ltn_predK ltih, ltih, add1n).
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | unbumpKcond | |
unbumpK{h} : {in predC1 h, cancel (unbump h) (bump h)}.
Proof. by move=> i /negbTE-neq_h_i; rewrite unbumpKcond neq_h_i. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | unbumpK | |
bumpDlh i k : bump (k + h) (k + i) = k + bump h i.
Proof. by rewrite /bump leq_add2l addnCA. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | bumpDl | |
bumpSh i : bump h.+1 i.+1 = (bump h i).+1.
Proof. exact: addnS. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | bumpS | |
unbumpDlh i k : unbump (k + h) (k + i) = k + unbump h i.
Proof.
apply: (can_inj (bumpK (k + h))).
by rewrite bumpDl !unbumpKcond eqn_add2l addnCA.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | unbumpDl | |
unbumpSh i : unbump h.+1 i.+1 = (unbump h i).+1.
Proof. exact: unbumpDl 1. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | unbumpS | |
leq_bumph i j : (i <= bump h j) = (unbump h i <= j).
Proof.
rewrite /bump leq_subLR.
case: (leqP i h) (leqP h j) => [le_i_h | lt_h_i] [le_h_j | lt_j_h] //.
by rewrite leqW (leq_trans le_i_h).
by rewrite !(leqNgt i) ltnW (leq_trans _ lt_h_i).
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | leq_bump | |
leq_bump2h i j : (bump h i <= bump h j) = (i <= j).
Proof. by rewrite leq_bump bumpK. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | leq_bump2 | |
bumpCh1 h2 i :
bump h1 (bump h2 i) = bump (bump h1 h2) (bump (unbump h2 h1) i).
Proof.
rewrite {1 5}/bump -leq_bump addnCA; congr (_ + (_ + _)).
rewrite 2!leq_bump /unbump /bump; case: (leqP h1 h2) => [le_h12 | lt_h21].
by rewrite subn0 ltnS le_h12 subn1.
by rewrite subn1 (ltn_predK lt_h21) (leqNgt h1) lt_h21 subn0.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | bumpC | |
lift_subproofn h (i : 'I_n.-1) : bump h i < n.
Proof. by case: n i => [[]|n] //= i; rewrite -addnS (leq_add (leq_b1 _)). Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | lift_subproof | |
liftn (h : 'I_n) (i : 'I_n.-1) := Ordinal (lift_subproof h i). | Definition | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | lift | |
unlift_subproofn (h : 'I_n) (u : {j | j != h}) : unbump h (val u) < n.-1.
Proof.
case: n h u => [|n h] [] //= j ne_jh.
rewrite -(leq_bump2 h.+1) bumpS unbumpK // /bump.
case: (ltngtP n h) => [|_|eq_nh]; rewrite ?(leqNgt _ h) ?ltn_ord //.
by rewrite ltn_neqAle [j <= _](valP j) {2}eq_nh andbT.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | unlift_subproof | |
unliftn (h i : 'I_n) :=
omap (fun u : {j | j != h} => Ordinal (unlift_subproof u)) (insub i). | Definition | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | unlift | |
unlift_specn h i : option 'I_n.-1 -> Type :=
| UnliftSome j of i = lift h j : unlift_spec h i (Some j)
| UnliftNone of i = h : unlift_spec h i None. | Variant | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | unlift_spec | |
unliftPn (h i : 'I_n) : unlift_spec h i (unlift h i).
Proof.
rewrite /unlift; case: insubP => [u nhi | ] def_i /=; constructor.
by apply: val_inj; rewrite /= def_i unbumpK.
by rewrite negbK in def_i; apply/eqP.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | unliftP | |
neq_liftn (h : 'I_n) i : h != lift h i.
Proof. exact: neq_bump. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | neq_lift | |
eq_liftFn (h : 'I_n) i : (h == lift h i) = false.
Proof. exact/negbTE/neq_lift. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | eq_liftF | |
lift_eqFn (h : 'I_n) i : (lift h i == h) = false.
Proof. by rewrite eq_sym eq_liftF. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | lift_eqF | |
unlift_nonen (h : 'I_n) : unlift h h = None.
Proof. by case: unliftP => // j Dh; case/eqP: (neq_lift h j). Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | unlift_none | |
unlift_somen (h i : 'I_n) :
h != i -> {j | i = lift h j & unlift h i = Some j}.
Proof.
rewrite eq_sym => /eqP neq_ih.
by case Dui: (unlift h i) / (unliftP h i) => [j Dh|//]; exists j.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | unlift_some | |
lift_injn (h : 'I_n) : injective (lift h).
Proof. by move=> i1 i2 [/(can_inj (bumpK h))/val_inj]. Qed.
Arguments lift_inj {n h} [i1 i2] eq_i12h : rename. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | lift_inj | |
liftKn (h : 'I_n) : pcancel (lift h) (unlift h).
Proof. by move=> i; case: (unlift_some (neq_lift h i)) => j /lift_inj->. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | liftK | |
lshift_subproofm n (i : 'I_m) : i < m + n.
Proof. by apply: leq_trans (valP i) _; apply: leq_addr. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | lshift_subproof | |
rshift_subproofm n (i : 'I_n) : m + i < m + n.
Proof. by rewrite ltn_add2l. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | rshift_subproof | |
lshiftm n (i : 'I_m) := Ordinal (lshift_subproof n i). | Definition | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | lshift | |
rshiftm n (i : 'I_n) := Ordinal (rshift_subproof m i). | Definition | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | rshift | |
lshift_injm n : injective (@lshift m n).
Proof. by move=> ? ? /(f_equal val) /= /val_inj. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | lshift_inj | |
rshift_injm n : injective (@rshift m n).
Proof. by move=> ? ? /(f_equal val) /addnI /val_inj. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | rshift_inj | |
eq_lshiftm n i j : (@lshift m n i == @lshift m n j) = (i == j).
Proof. by rewrite (inj_eq (@lshift_inj _ _)). Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | eq_lshift | |
eq_rshiftm n i j : (@rshift m n i == @rshift m n j) = (i == j).
Proof. by rewrite (inj_eq (@rshift_inj _ _)). Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | eq_rshift | |
eq_lrshiftm n i j : (@lshift m n i == @rshift m n j) = false.
Proof.
apply/eqP=> /(congr1 val)/= def_i; have := ltn_ord i.
by rewrite def_i -ltn_subRL subnn.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | eq_lrshift | |
eq_rlshiftm n i j : (@rshift m n i == @lshift m n j) = false.
Proof. by rewrite eq_sym eq_lrshift. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | eq_rlshift | |
eq_shift:= (eq_lshift, eq_rshift, eq_lrshift, eq_rlshift). | Definition | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | eq_shift | |
split_subproofm n (i : 'I_(m + n)) : i >= m -> i - m < n.
Proof. by move/subSn <-; rewrite leq_subLR. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | split_subproof | |
split{m n} (i : 'I_(m + n)) : 'I_m + 'I_n :=
match ltnP (i) m with
| LtnNotGeq lt_i_m => inl _ (Ordinal lt_i_m)
| GeqNotLtn ge_i_m => inr _ (Ordinal (split_subproof ge_i_m))
end. | Definition | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | split | |
split_specm n (i : 'I_(m + n)) : 'I_m + 'I_n -> bool -> Type :=
| SplitLo (j : 'I_m) of i = j :> nat : split_spec i (inl _ j) true
| SplitHi (k : 'I_n) of i = m + k :> nat : split_spec i (inr _ k) false. | Variant | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | split_spec | |
splitPm n (i : 'I_(m + n)) : split_spec i (split i) (i < m).
Proof. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | splitP | |
split_ord_specm n (i : 'I_(m + n)) : 'I_m + 'I_n -> bool -> Type :=
| SplitOrdLo (j : 'I_m) of i = lshift _ j : split_ord_spec i (inl _ j) true
| SplitOrdHi (k : 'I_n) of i = rshift _ k : split_ord_spec i (inr _ k) false. | Variant | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | split_ord_spec | |
split_ordPm n (i : 'I_(m + n)) : split_ord_spec i (split i) (i < m).
Proof. by case: splitP; [left|right]; apply: val_inj. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | split_ordP | |
unsplit{m n} (jk : 'I_m + 'I_n) :=
match jk with inl j => lshift n j | inr k => rshift m k end. | Definition | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | unsplit | |
ltn_unsplitm n (jk : 'I_m + 'I_n) : (unsplit jk < m) = jk.
Proof. by case: jk => [j|k]; rewrite /= ?ltn_ord // ltnNge leq_addr. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | ltn_unsplit | |
splitK{m n} : cancel (@split m n) unsplit.
Proof. by move=> i; case: split_ordP. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | splitK | |
unsplitK{m n} : cancel (@unsplit m n) split.
Proof.
by move=> [j|k]; case: split_ordP => ? /eqP; rewrite eq_shift// => /eqP->.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | unsplitK | |
ord0:= Ordinal (ltn0Sn n'). | Definition | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | ord0 | |
ord_max:= Ordinal (ltnSn n'). | Definition | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | ord_max | |
leq_ord(i : 'I_n) : i <= n'. Proof. exact: valP i. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | leq_ord | |
sub_ord_proofm : n' - m < n.
Proof. by rewrite ltnS leq_subr. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | sub_ord_proof | |
sub_ordm := Ordinal (sub_ord_proof m). | Definition | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | sub_ord | |
sub_ordK(i : 'I_n) : n' - (n' - i) = i.
Proof. by rewrite subKn ?leq_ord. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | sub_ordK | |
inordm : 'I_n := insubd ord0 m. | Definition | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | inord | |
inordKm : m < n -> inord m = m :> nat.
Proof. by move=> lt_m; rewrite val_insubd lt_m. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | inordK | |
inord_val(i : 'I_n) : inord i = i.
Proof. by rewrite /inord /insubd valK. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | inord_val | |
enum_ordSl: enum 'I_n = ord0 :: map (lift ord0) (enum 'I_n').
Proof.
apply: (inj_map val_inj); rewrite val_enum_ord /= -map_comp.
by rewrite (map_comp (addn 1)) val_enum_ord -iotaDl.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | enum_ordSl | |
enum_ordSr:
enum 'I_n = rcons (map (widen_ord (leqnSn _)) (enum 'I_n')) ord_max.
Proof.
apply: (inj_map val_inj); rewrite val_enum_ord.
rewrite -[in iota _ _]addn1 iotaD/= cats1 map_rcons; congr (rcons _ _).
by rewrite -map_comp/= (@eq_map _ _ _ val) ?val_enum_ord.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | enum_ordSr | |
lift_max(i : 'I_n') : lift ord_max i = i :> nat.
Proof. by rewrite /= /bump leqNgt ltn_ord. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | lift_max | |
lift0(i : 'I_n') : lift ord0 i = i.+1 :> nat. Proof. by []. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | lift0 | |
ord1: all_equal_to (ord0 : 'I_1).
Proof. by case=> [[] // ?]; apply: val_inj. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | ord1 | |
prod_enum:= [seq (x1, x2) | x1 <- enum T1, x2 <- enum T2]. | Definition | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | prod_enum | |
predX_prod_enum(A1 : {pred T1}) (A2 : {pred T2}) :
count [predX A1 & A2] prod_enum = #|A1| * #|A2|.
Proof.
rewrite !cardE !size_filter -!enumT /prod_enum.
elim: (enum T1) => //= x1 s1 IHs; rewrite count_cat {}IHs count_map /preim /=.
by case: (x1 \in A1); rewrite ?count_pred0.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | predX_prod_enum | |
prod_enumP: Finite.axiom prod_enum.
Proof.
by case=> x1 x2; rewrite (predX_prod_enum (pred1 x1) (pred1 x2)) !card1.
Qed.
HB.instance Definition _ := isFinite.Build (T1 * T2)%type prod_enumP. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | prod_enumP | |
cardX(A1 : {pred T1}) (A2 : {pred T2}) :
#|[predX A1 & A2]| = #|A1| * #|A2|.
Proof. by rewrite -predX_prod_enum unlock size_filter unlock. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | cardX | |
card_prod: #|{: T1 * T2}| = #|T1| * #|T2|.
Proof. by rewrite -cardX; apply: eq_card; case. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | card_prod | |
eq_card_prod(A : {pred (T1 * T2)}) : A =i predT -> #|A| = #|T1| * #|T2|.
Proof. exact: eq_card_trans card_prod. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | eq_card_prod | |
tag_enum:=
flatten [seq [seq Tagged T_ x | x <- enumF (T_ i)] | i <- enumF I]. | Definition | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | tag_enum | |
tag_enumP: Finite.axiom tag_enum.
Proof.
case=> i x; rewrite -(enumP i) /tag_enum -enumT.
elim: (enum I) => //= j e IHe.
rewrite count_cat count_map {}IHe; congr (_ + _).
rewrite -size_filter -cardE /=; case: eqP => [-> | ne_j_i].
by apply: (@eq_card1 _ x) => y; rewrite -topredE /= tagged_asE ?eqxx.
by apply: eq_card0 => y.
Qed.
HB.instance Definition _ := isFinite.Build {i : I & T_ i} tag_enumP. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | tag_enumP | |
card_tagged:
#|{: {i : I & T_ i}}| = sumn (map (fun i => #|T_ i|) (enum I)).
Proof.
rewrite cardE !enumT [in LHS]unlock size_flatten /shape -map_comp.
by congr (sumn _); apply: eq_map => i; rewrite /= size_map -enumT -cardE.
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | card_tagged | |
sum_enum:=
[seq inl _ x | x <- enumF T1] ++ [seq inr _ y | y <- enumF T2]. | Definition | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | sum_enum | |
sum_enum_uniq: uniq sum_enum.
Proof.
rewrite cat_uniq -!enumT !(enum_uniq, map_inj_uniq); try by move=> ? ? [].
by rewrite andbT; apply/hasP=> [[_ /mapP[x _ ->] /mapP[]]].
Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | sum_enum_uniq | |
mem_sum_enumu : u \in sum_enum.
Proof. by case: u => x; rewrite mem_cat -!enumT map_f ?mem_enum ?orbT. Qed.
HB.instance Definition sum_isFinite := isFinite.Build (T1 + T2)%type
(Finite.uniq_enumP sum_enum_uniq mem_sum_enum). | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | mem_sum_enum | |
card_sum: #|{: T1 + T2}| = #|T1| + #|T2|.
Proof. by rewrite !cardT !enumT [in LHS]unlock size_cat !size_map. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool ssrnotations eqtype",
"From mathcomp Require Import ssrnat seq choice path div"
] | boot/fintype.v | card_sum | |
RecordisQuotient T (qT : Type) := {
repr_of : qT -> T;
quot_pi_subdef : T -> qT;
repr_ofK_subproof : cancel repr_of quot_pi_subdef
}.
#[short(type="quotType")]
HB.structure Definition Quotient T := { qT of isQuotient T qT }.
Arguments repr_of [T qT] : rename. | HB.mixin | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat choice",
"From mathcomp Require Import seq fintype"
] | boot/generic_quotient.v | Record | |
pi_subdef:= @quot_pi_subdef _ qT.
Local Notation "\pi" := pi_subdef. | Definition | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat choice",
"From mathcomp Require Import seq fintype"
] | boot/generic_quotient.v | pi_subdef | |
repr_ofK: cancel (@repr_of _ _) \pi.
Proof. exact: repr_ofK_subproof. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat choice",
"From mathcomp Require Import seq fintype"
] | boot/generic_quotient.v | repr_ofK | |
mpi_unlock:= Unlockable mpi.unlock. | Canonical | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat choice",
"From mathcomp Require Import seq fintype"
] | boot/generic_quotient.v | mpi_unlock | |
pi_unlock:= Unlockable pi.unlock. | Canonical | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat choice",
"From mathcomp Require Import seq fintype"
] | boot/generic_quotient.v | pi_unlock | |
repr_unlock:= Unlockable repr.unlock.
Arguments repr {T qT} x. | Canonical | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat choice",
"From mathcomp Require Import seq fintype"
] | boot/generic_quotient.v | repr_unlock | |
reprK: cancel repr \pi_qT.
Proof. by move=> x; rewrite !unlock repr_ofK. Qed. | Lemma | boot | [
"From HB Require Import structures",
"From mathcomp Require Import ssreflect ssrfun ssrbool eqtype ssrnat choice",
"From mathcomp Require Import seq fintype"
] | boot/generic_quotient.v | reprK |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.