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
contra_leqN b m n : (b -> m < n) -> (n <= m -> ~~ b).
Proof. by rewrite ltnNge; apply: contraTN. Qed.
Lemma
contra_leqN
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "apply", "ltnNge" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
contra_ltnN b m n : (b -> m <= n) -> (n < m -> ~~ b).
Proof. by rewrite ltnNge; apply: contraNN. Qed.
Lemma
contra_ltnN
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "apply", "ltnNge" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
contra_leq_not P m n : (P -> m < n) -> (n <= m -> ~ P).
Proof. by rewrite ltnNge; apply: contraTnot. Qed.
Lemma
contra_leq_not
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "apply", "ltnNge" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
contra_ltn_not P m n : (P -> m <= n) -> (n < m -> ~ P).
Proof. by rewrite ltnNge; apply: contraNnot. Qed.
Lemma
contra_ltn_not
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "apply", "ltnNge" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
contra_leqF b m n : (b -> m < n) -> (n <= m -> b = false).
Proof. by rewrite ltnNge; apply: contraTF. Qed.
Lemma
contra_leqF
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "apply", "ltnNge" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
contra_ltnF b m n : (b -> m <= n) -> (n < m -> b = false).
Proof. by rewrite ltnNge; apply: contraNF. Qed.
Lemma
contra_ltnF
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "apply", "ltnNge" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
contra_leq m n p q : (q < p -> n < m) -> (m <= n -> p <= q).
Proof. by rewrite !ltnNge; apply: contraTT. Qed.
Lemma
contra_leq
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "apply", "ltnNge" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
contra_leq_ltn m n p q : (q <= p -> n < m) -> (m <= n -> p < q).
Proof. by rewrite !ltnNge; apply: contraTN. Qed.
Lemma
contra_leq_ltn
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "apply", "ltnNge" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
contra_ltn_leq m n p q : (q < p -> n <= m) -> (m < n -> p <= q).
Proof. by rewrite !ltnNge; apply: contraNT. Qed.
Lemma
contra_ltn_leq
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "apply", "ltnNge" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
contra_ltn m n p q : (q <= p -> n <= m) -> (m < n -> p < q).
Proof. by rewrite !ltnNge; apply: contraNN. Qed.
Lemma
contra_ltn
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "apply", "ltnNge" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
homo_ltn_in (D : {pred nat}) (f : nat -> T) (r : T -> T -> Prop) : (forall y x z, r x y -> r y z -> r x z) -> {in D &, forall i j k, i < k < j -> k \in D} -> {in D, forall i, i.+1 \in D -> r (f i) (f i.+1)} -> {in D &, {homo f : i j / i < j >-> r i j}}.
Proof. move=> r_trans Dcx r_incr i j iD jD lt_ij; move: (lt_ij) (jD) => /subnKC<-. elim: (_ - _) => [|k ihk]; first by rewrite addn0 => Dsi; apply: r_incr. move=> DSiSk [: DSik]; apply: (r_trans _ _ _ (ihk _)); rewrite ?addnS. by abstract: DSik; apply: (Dcx _ _ iD DSiSk); rewrite ltn_addr ?addnS /=. by apply: r_incr;...
Lemma
homo_ltn_in
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "addn0", "addnS", "apply", "ltn_addr", "nat", "subnKC" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
homo_ltn (f : nat -> T) (r : T -> T -> Prop) : (forall y x z, r x y -> r y z -> r x z) -> (forall i, r (f i) (f i.+1)) -> {homo f : i j / i < j >-> r i j}.
Proof. by move=> /(@homo_ltn_in predT f) fr fS i j; apply: fr. Qed.
Lemma
homo_ltn
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "apply", "homo_ltn_in", "nat" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
homo_leq_in (D : {pred nat}) (f : nat -> T) (r : T -> T -> Prop) : (forall x, r x x) -> (forall y x z, r x y -> r y z -> r x z) -> {in D &, forall i j k, i < k < j -> k \in D} -> {in D, forall i, i.+1 \in D -> r (f i) (f i.+1)} -> {in D &, {homo f : i j / i <= j >-> r i j}}.
Proof. move=> r_refl r_trans Dcx /(homo_ltn_in r_trans Dcx) lt_r i j iD jD. case: ltngtP => [? _||->] //; exact: lt_r. Qed.
Lemma
homo_leq_in
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "homo_ltn_in", "ltngtP", "nat" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
homo_leq (f : nat -> T) (r : T -> T -> Prop) : (forall x, r x x) -> (forall y x z, r x y -> r y z -> r x z) -> (forall i, r (f i) (f i.+1)) -> {homo f : i j / i <= j >-> r i j}.
Proof. by move=> rrefl /(@homo_leq_in predT f r) fr fS i j; apply: fr. Qed.
Lemma
homo_leq
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "apply", "homo_leq_in", "nat" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
ltn_neqAle
:= ltn_neqAle.
Let
ltn_neqAle
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
gtn_neqAge x y : (y < x) = (x != y) && (y <= x).
Proof. by rewrite ltn_neqAle eq_sym. Qed.
Let
gtn_neqAge
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "eq_sym", "ltn_neqAle" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
anti_leq
:= anti_leq.
Let
anti_leq
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
anti_geq : antisymmetric geq.
Proof. by move=> m n /=; rewrite andbC => /anti_leq. Qed.
Let
anti_geq
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "anti_leq", "geq" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
leq_total
:= leq_total.
Let
leq_total
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
ltnW_homo : {homo f : m n / m < n} -> {homo f : m n / m <= n}.
Proof. exact: homoW. Qed.
Lemma
ltnW_homo
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "homoW" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
inj_homo_ltn : injective f -> {homo f : m n / m <= n} -> {homo f : m n / m < n}.
Proof. exact: inj_homo. Qed.
Lemma
inj_homo_ltn
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "inj_homo" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
ltnW_nhomo : {homo f : m n /~ m < n} -> {homo f : m n /~ m <= n}.
Proof. exact: homoW. Qed.
Lemma
ltnW_nhomo
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "homoW" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
inj_nhomo_ltn : injective f -> {homo f : m n /~ m <= n} -> {homo f : m n /~ m < n}.
Proof. exact: inj_homo. Qed.
Lemma
inj_nhomo_ltn
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "inj_homo" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
incn_inj : {mono f : m n / m <= n} -> injective f.
Proof. exact: mono_inj. Qed.
Lemma
incn_inj
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "mono_inj" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
decn_inj : {mono f : m n /~ m <= n} -> injective f.
Proof. exact: mono_inj. Qed.
Lemma
decn_inj
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "mono_inj" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
leqW_mono : {mono f : m n / m <= n} -> {mono f : m n / m < n}.
Proof. exact: anti_mono. Qed.
Lemma
leqW_mono
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "anti_mono" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
leqW_nmono : {mono f : m n /~ m <= n} -> {mono f : m n /~ m < n}.
Proof. exact: anti_mono. Qed.
Lemma
leqW_nmono
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "anti_mono" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
leq_mono : {homo f : m n / m < n} -> {mono f : m n / m <= n}.
Proof. exact: total_homo_mono. Qed.
Lemma
leq_mono
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "total_homo_mono" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
leq_nmono : {homo f : m n /~ m < n} -> {mono f : m n /~ m <= n}.
Proof. exact: total_homo_mono. Qed.
Lemma
leq_nmono
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "total_homo_mono" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
ltnW_homo_in : {in D & D', {homo f : m n / m < n}} -> {in D & D', {homo f : m n / m <= n}}.
Proof. exact: homoW_in. Qed.
Lemma
ltnW_homo_in
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "homoW_in" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
ltnW_nhomo_in : {in D & D', {homo f : m n /~ m < n}} -> {in D & D', {homo f : m n /~ m <= n}}.
Proof. exact: homoW_in. Qed.
Lemma
ltnW_nhomo_in
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "homoW_in" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
inj_homo_ltn_in : {in D & D', injective f} -> {in D & D', {homo f : m n / m <= n}} -> {in D & D', {homo f : m n / m < n}}.
Proof. exact: inj_homo_in. Qed.
Lemma
inj_homo_ltn_in
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "inj_homo_in" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
inj_nhomo_ltn_in : {in D & D', injective f} -> {in D & D', {homo f : m n /~ m <= n}} -> {in D & D', {homo f : m n /~ m < n}}.
Proof. exact: inj_homo_in. Qed.
Lemma
inj_nhomo_ltn_in
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "inj_homo_in" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
incn_inj_in : {in D &, {mono f : m n / m <= n}} -> {in D &, injective f}.
Proof. exact: mono_inj_in. Qed.
Lemma
incn_inj_in
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "mono_inj_in" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
decn_inj_in : {in D &, {mono f : m n /~ m <= n}} -> {in D &, injective f}.
Proof. exact: mono_inj_in. Qed.
Lemma
decn_inj_in
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "mono_inj_in" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
leqW_mono_in : {in D &, {mono f : m n / m <= n}} -> {in D &, {mono f : m n / m < n}}.
Proof. exact: anti_mono_in. Qed.
Lemma
leqW_mono_in
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "anti_mono_in" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
leqW_nmono_in : {in D &, {mono f : m n /~ m <= n}} -> {in D &, {mono f : m n /~ m < n}}.
Proof. exact: anti_mono_in. Qed.
Lemma
leqW_nmono_in
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "anti_mono_in" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
leq_mono_in : {in D &, {homo f : m n / m < n}} -> {in D &, {mono f : m n / m <= n}}.
Proof. exact: total_homo_mono_in. Qed.
Lemma
leq_mono_in
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "total_homo_mono_in" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
leq_nmono_in : {in D &, {homo f : m n /~ m < n}} -> {in D &, {mono f : m n /~ m <= n}}.
Proof. exact: total_homo_mono_in. Qed.
Lemma
leq_nmono_in
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "total_homo_mono_in" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
leq_pfact : {in [pred n | 0 < n] &, {mono factorial : m n / m <= n}}.
Proof. by apply: leq_mono_in => n m n0 m0; apply: ltn_fact. Qed.
Lemma
leq_pfact
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "apply", "factorial", "leq_mono_in", "ltn_fact" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
leq_fact : {homo factorial : m n / m <= n}.
Proof. by move=> [m|m n mn]; rewrite ?fact_gt0// leq_pfact// inE (leq_trans _ mn). Qed.
Lemma
leq_fact
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "fact_gt0", "factorial", "inE", "leq_pfact", "leq_trans" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
ltn_pfact : {in [pred n | 0 < n] &, {mono factorial : m n / m < n}}.
Proof. exact/leqW_mono_in/leq_pfact. Qed.
Lemma
ltn_pfact
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "factorial", "leqW_mono_in", "leq_pfact" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
add m n
:= if m is m'.+1 then m' + n.+1 else n where "n + m" := (add n m) : nat_scope.
Fixpoint
add
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[]
in the correctness proof, restores operators
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
add_mul m n s
:= if m is m'.+1 then add_mul m' n (n + s) else s.
Fixpoint
add_mul
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
mul m n
:= if m is m'.+1 then add_mul m' n n else 0.
Definition
mul
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "add_mul" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
"n * m"
:= (mul n m) : nat_scope.
Notation
n * m
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "mul" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
mul_exp m n p
:= if n is n'.+1 then mul_exp m n' (m * p) else p.
Fixpoint
mul_exp
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "n'" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
exp m n
:= if n is n'.+1 then mul_exp m n' m else 1.
Definition
exp
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "mul_exp", "n'" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
"n ^ m"
:= (exp n m) : nat_scope.
Notation
n ^ m
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "exp" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
oddn
:= odd.
Notation
oddn
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "odd" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
odd n
:= if n is n'.+2 then odd n' else eqn n 1.
Fixpoint
odd
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "eqn", "n'" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
doublen
:= double.
Notation
doublen
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "double" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
double n
:= if n is n'.+1 then n' + n.+1 else 0.
Definition
double
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "n'" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
addE : add =2 addn.
Proof. by elim=> //= n IHn m; rewrite IHn addSnnS. Qed.
Lemma
addE
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "add", "addSnnS", "addn" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
doubleE : double =1 doublen.
Proof. by case=> // n; rewrite -addnn -addE. Qed.
Lemma
doubleE
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "addE", "addnn", "double", "doublen" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
add_mulE n m s : add_mul n m s = addn (muln n m) s.
Proof. by elim: n => //= n IHn in m s *; rewrite IHn addE addnCA addnA. Qed.
Lemma
add_mulE
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "addE", "add_mul", "addn", "addnA", "addnCA", "muln" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
mulE : mul =2 muln.
Proof. by case=> //= n m; rewrite add_mulE addnC. Qed.
Lemma
mulE
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "add_mulE", "addnC", "mul", "muln" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
mul_expE m n p : mul_exp m n p = muln (expn m n) p.
Proof. by elim: n => [|n IHn] in p *; rewrite ?mul1n //= expnS IHn mulE mulnCA mulnA. Qed.
Lemma
mul_expE
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "expn", "expnS", "mul1n", "mulE", "mul_exp", "muln", "mulnA", "mulnCA" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
expE : exp =2 expn.
Proof. by move=> m [|n] //=; rewrite mul_expE expnS mulnC. Qed.
Lemma
expE
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "exp", "expn", "expnS", "mul_expE", "mulnC" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
oddE : odd =1 oddn.
Proof. move=> n; rewrite -[n in LHS]odd_double_half addnC. by elim: n./2 => //=; case (oddn n). Qed.
Lemma
oddE
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "addnC", "odd", "odd_double_half", "oddn" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
trecE
:= (addE, (doubleE, oddE), (mulE, add_mulE, (expE, mul_expE))).
Definition
trecE
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "addE", "add_mulE", "doubleE", "expE", "mulE", "mul_expE", "oddE" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
natTrecE
:= NatTrec.trecE.
Notation
natTrecE
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "trecE" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
N_eqb n m
:= match n, m with | N0, N0 => true | Npos p, Npos q => Pos.eqb p q | _, _ => false end.
Definition
N_eqb
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "eqb" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
eq_binP : Equality.axiom N_eqb.
Proof. move=> p q; apply: (iffP idP) => [|<-]; last by case: p => //; elim. by case: q; case: p => //; elim=> [p IHp|p IHp|] [q|q|] //= /IHp [->]. Qed.
Lemma
eq_binP
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "N_eqb", "apply", "axiom", "last" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
nat_of_pos p0
:= match p0 with | xO p => (nat_of_pos p).*2 | xI p => (nat_of_pos p).*2.+1 | xH => 1 end.
Fixpoint
nat_of_pos
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "p0" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
nat_of_pos : positive >-> nat.
Coercion
nat_of_pos
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "nat" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
nat_of_bin b
:= if b is Npos p then p : nat else 0.
Coercion
nat_of_bin
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "nat" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
pos_of_nat n0 m0
:= match n0, m0 with | n.+1, m.+2 => pos_of_nat n m | n.+1, 1 => xO (pos_of_nat n n) | n.+1, 0 => xI (pos_of_nat n n) | 0, _ => xH end.
Fixpoint
pos_of_nat
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
bin_of_nat n0
:= if n0 is n.+1 then Npos (pos_of_nat n n) else N0.
Definition
bin_of_nat
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "pos_of_nat" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
bin_of_natK : cancel bin_of_nat nat_of_bin.
Proof. have sub2nn n : n.*2 - n = n by rewrite -addnn addKn. case=> //= n; rewrite -[n in RHS]sub2nn. by elim: n {2 4}n => // m IHm [|[|n]] //=; rewrite IHm // natTrecE sub2nn. Qed.
Lemma
bin_of_natK
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "addKn", "addnn", "bin_of_nat", "natTrecE", "nat_of_bin" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
nat_of_binK : cancel nat_of_bin bin_of_nat.
Proof. case=> //=; elim=> //= p; case: (nat_of_pos p) => //= n [<-]. by rewrite natTrecE !addnS {2}addnn; elim: {1 3}n. by rewrite natTrecE addnS /= addnS {2}addnn; elim: {1 3}n. Qed.
Lemma
nat_of_binK
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "addnS", "addnn", "bin_of_nat", "natTrecE", "nat_of_bin", "nat_of_pos" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
nat_of_succ_pos p : Pos.succ p = p.+1 :> nat.
Proof. by elim: p => //= p ->; rewrite !natTrecE. Qed.
Lemma
nat_of_succ_pos
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "nat", "natTrecE" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
nat_of_add_pos p q : Pos.add p q = p + q :> nat.
Proof. apply: @fst _ (Pos.add_carry p q = (p + q).+1 :> nat) _. elim: p q => [p IHp|p IHp|] [q|q|] //=; rewrite !natTrecE //; by rewrite ?IHp ?nat_of_succ_pos ?(doubleS, doubleD, addn1, addnS). Qed.
Lemma
nat_of_add_pos
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "add", "addn1", "addnS", "apply", "doubleD", "doubleS", "nat", "natTrecE", "nat_of_succ_pos" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
nat_of_mul_pos p q : Pos.mul p q = p * q :> nat.
Proof. elim: p => [p IHp|p IHp|] /=; rewrite ?mul1n //; by rewrite ?nat_of_add_pos /= !natTrecE IHp doubleMl. Qed.
Lemma
nat_of_mul_pos
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "doubleMl", "mul", "mul1n", "nat", "natTrecE", "nat_of_add_pos" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
number : Type
:= Num {bin_of_number :> N}.
Record
number
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[]
returns a larger integer.
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
number_subType
:= Eval hnf in [isNew for bin_of_number].
Definition
number_subType
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
"[ 'Num' 'of' e ]"
:= (Num (bin_of_nat e)) (format "[ 'Num' 'of' e ]") : nat_scope.
Notation
[ 'Num' 'of' e ]
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "bin_of_nat" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
pop_succn e
:= if e is e'.+1 then fun n => pop_succn e' n.+1 else id.
Fixpoint
pop_succn
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "e'", "id" ]
normalization tactic.
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
pop_succn e
:= eval lazy beta iota delta [pop_succn] in (pop_succn e 1).
Ltac
pop_succn
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "delta", "eval", "iota" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
succn_to_add
:= match goal with | |- context G [?e.+1] => let x := fresh "NatLit0" in match pop_succn e with | ?n.+1 => pose x := n.+1; let G' := context G [x] in change G' | _ ?e' ?n => pose x := n; let G' := context G [x + e'] in change G' end; succn_to_add; rewrite {}/x | _ => idtac end.
Ltac
succn_to_add
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "G'", "e'", "pop_succn" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
nat_norm
:= succn_to_add; rewrite ?add0n ?addn0 -?addnA ?(addSn, addnS, add0n, addn0).
Ltac
nat_norm
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "add0n", "addSn", "addn0", "addnA", "addnS", "succn_to_add" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
nat_congr
:= first [ apply: (congr1 succn _) | apply: (congr1 predn _) | apply: (congr1 (addn _) _) | apply: (congr1 (subn _) _) | apply: (congr1 (addn^~ _) _) | match goal with |- (?X1 + ?X2 = ?X3) => symmetry; rewrite -1?(addnC X1) -?(addnCA X1); apply: (congr1 (addn X1) _); symmetry end ].
Ltac
nat_congr
boot
boot/ssrnat.v
[ "Corelib", "PosDef", "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "NatTrec" ]
[ "addn", "addnC", "addnCA", "apply", "predn", "subn", "succn" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
tuple_of : Type
:= Tuple {tval :> seq T; _ : size tval == n}.
Structure
tuple_of
boot
boot/tuple.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "path" ]
[ "seq", "size" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
tsize & tuple_of
:= n.
Definition
tsize
boot
boot/tuple.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "path" ]
[ "tuple_of" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
size_tuple t : size t = n.
Proof. exact: (eqP (valP t)). Qed.
Lemma
size_tuple
boot
boot/tuple.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "path" ]
[ "size", "valP" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
tnth_default t : 'I_n -> T.
Proof. by rewrite -(size_tuple t); case: (tval t) => [|//] []. Qed.
Lemma
tnth_default
boot
boot/tuple.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "path" ]
[ "size_tuple" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
tnth t i
:= nth (tnth_default t i) t i.
Definition
tnth
boot
boot/tuple.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "path" ]
[ "nth", "tnth_default" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
tnth_nth x t i : tnth t i = nth x t i.
Proof. by apply: set_nth_default; rewrite size_tuple. Qed.
Lemma
tnth_nth
boot
boot/tuple.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "path" ]
[ "apply", "nth", "set_nth_default", "size_tuple", "tnth" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
tnth_onth x t i : tnth t i = x <-> onth t i = Some x.
Proof. rewrite (tnth_nth x) onthE (nth_map x) ?size_tuple//. by split; [move->|case]. Qed.
Lemma
tnth_onth
boot
boot/tuple.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "path" ]
[ "nth_map", "onth", "onthE", "size_tuple", "split", "tnth", "tnth_nth" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
map_tnth_enum t : map (tnth t) (enum 'I_n) = t.
Proof. case def_t: {-}(val t) => [|x0 t']. by rewrite [enum _]size0nil // -cardE card_ord -(size_tuple t) def_t. apply: (@eq_from_nth _ x0) => [|i]; rewrite size_map. by rewrite -cardE size_tuple card_ord. move=> lt_i_e; have lt_i_n: i < n by rewrite -cardE card_ord in lt_i_e. by rewrite (nth_map (Ordinal lt_i_n)) ...
Lemma
map_tnth_enum
boot
boot/tuple.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "path" ]
[ "apply", "cardE", "card_ord", "enum", "eq_from_nth", "map", "nth_enum_ord", "nth_map", "size0nil", "size_map", "size_tuple", "tnth", "tnth_nth", "val" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
eq_from_tnth t1 t2 : tnth t1 =1 tnth t2 -> t1 = t2.
Proof. by move/eq_map=> eq_t; apply: val_inj; rewrite /= -!map_tnth_enum eq_t. Qed.
Lemma
eq_from_tnth
boot
boot/tuple.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "path" ]
[ "apply", "eq_map", "map_tnth_enum", "tnth", "val_inj" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
tuple t mkT : tuple_of
:= mkT (let: Tuple _ tP := t return size t == n in tP).
Definition
tuple
boot
boot/tuple.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "path" ]
[ "size", "tuple_of" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
tupleE t : tuple (fun sP => @Tuple t sP) = t.
Proof. by case: t. Qed.
Lemma
tupleE
boot
boot/tuple.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "path" ]
[ "tuple" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
"n .-tuple"
:= (tuple_of n) (format "n .-tuple") : type_scope.
Notation
n .-tuple
boot
boot/tuple.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "path" ]
[ "tuple_of" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
"{ 'tuple' n 'of' T }"
:= (n.-tuple T : predArgType) (only parsing) : type_scope.
Notation
{ 'tuple' n 'of' T }
boot
boot/tuple.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "path" ]
[ "tuple" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
"[ 'tuple' 'of' s ]"
:= (tuple (fun sP => @Tuple _ _ s sP)) (format "[ 'tuple' 'of' s ]") : form_scope.
Notation
[ 'tuple' 'of' s ]
boot
boot/tuple.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "path" ]
[ "tuple" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
"[ 'tnth' t i ]"
:= (tnth t (@Ordinal (tsize t) i (erefl true))) (t, i at level 8, format "[ 'tnth' t i ]") : form_scope.
Notation
[ 'tnth' t i ]
boot
boot/tuple.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "path" ]
[ "tnth", "tsize" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
nil_tuple T
:= Tuple (isT : @size T [::] == 0).
Canonical
nil_tuple
boot
boot/tuple.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "path" ]
[ "size" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
cons_tuple n T x (t : n.-tuple T)
:= Tuple (valP t : size (x :: t) == n.+1).
Canonical
cons_tuple
boot
boot/tuple.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "path" ]
[ "size", "tuple", "valP" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d
"[ 'tuple' x1 ; .. ; xn ]"
:= [tuple of x1 :: .. [:: xn] ..] (format "[ 'tuple' '[' x1 ; '/' .. ; '/' xn ']' ]") : form_scope.
Notation
[ 'tuple' x1 ; .. ; xn ]
boot
boot/tuple.v
[ "HB", "structures", "mathcomp", "ssreflect", "ssrfun", "ssrbool", "eqtype", "ssrnat", "seq", "choice", "fintype", "path" ]
[ "tuple" ]
https://github.com/math-comp/math-comp
91d97df9cf3204b4dab84f4e24bc633e84b6473d