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
card_Zp: p > 0 -> #|Zp| = p. Proof. rewrite /Zp; case: p => [|[|p']] //= _; first by rewrite cards1. by rewrite cardsT card_ord. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool choice eqtype ssrnat seq", "From mathcomp Require Import div fintype bigop finset prime fingroup perm", "From mathcomp Require Import ssralg finalg countalg" ]
algebra/zmodp.v
card_Zp
mem_Zpx : p > 1 -> x \in Zp. Proof. by rewrite /Zp => ->. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool choice eqtype ssrnat seq", "From mathcomp Require Import div fintype bigop finset prime fingroup perm", "From mathcomp Require Import ssralg finalg countalg" ]
algebra/zmodp.v
mem_Zp
units_Zp_group:= [group of units_Zp].
Canonical
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool choice eqtype ssrnat seq", "From mathcomp Require Import div fintype bigop finset prime fingroup perm", "From mathcomp Require Import ssralg finalg countalg" ]
algebra/zmodp.v
units_Zp_group
card_units_Zp: p > 0 -> #|units_Zp| = totient p. Proof. move=> p_gt0; transitivity (totient p.-2.+2); last by case: p p_gt0 => [|[|p']]. rewrite cardsT card_sub -sum1_card big_mkcond /=. by rewrite totient_count_coprime big_mkord. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool choice eqtype ssrnat seq", "From mathcomp Require Import div fintype bigop finset prime fingroup perm", "From mathcomp Require Import ssralg finalg countalg" ]
algebra/zmodp.v
card_units_Zp
units_Zp_abelian: abelian units_Zp. Proof. by apply/centsP=> u _ v _; apply: unit_Zp_mulgC. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool choice eqtype ssrnat seq", "From mathcomp Require Import div fintype bigop finset prime fingroup perm", "From mathcomp Require Import ssralg finalg countalg" ]
algebra/zmodp.v
units_Zp_abelian
char_Zp:= (pchar_Zp) (only parsing).
Notation
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool choice eqtype ssrnat seq", "From mathcomp Require Import div fintype bigop finset prime fingroup perm", "From mathcomp Require Import ssralg finalg countalg" ]
algebra/zmodp.v
char_Zp
Fp_Zcast: Zp_trunc (pdiv p) = Zp_trunc p. Proof. by rewrite /pdiv primes_prime. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool choice eqtype ssrnat seq", "From mathcomp Require Import div fintype bigop finset prime fingroup perm", "From mathcomp Require Import ssralg finalg countalg" ]
algebra/zmodp.v
Fp_Zcast
Fp_cast: (Zp_trunc (pdiv p)).+2 = p. Proof. by rewrite Fp_Zcast ?Zp_cast ?prime_gt1. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool choice eqtype ssrnat seq", "From mathcomp Require Import div fintype bigop finset prime fingroup perm", "From mathcomp Require Import ssralg finalg countalg" ]
algebra/zmodp.v
Fp_cast
card_Fp: #|'F_p| = p. Proof. by rewrite card_ord Fp_cast. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool choice eqtype ssrnat seq", "From mathcomp Require Import div fintype bigop finset prime fingroup perm", "From mathcomp Require Import ssralg finalg countalg" ]
algebra/zmodp.v
card_Fp
val_Fp_natn : (n%:R : 'F_p) = (n %% p)%N :> nat. Proof. by rewrite Zp_nat /= Fp_cast. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool choice eqtype ssrnat seq", "From mathcomp Require Import div fintype bigop finset prime fingroup perm", "From mathcomp Require Import ssralg finalg countalg" ]
algebra/zmodp.v
val_Fp_nat
Fp_nat_modm : (m %% p)%:R = m%:R :> 'F_p. Proof. by apply: ord_inj; rewrite !val_Fp_nat // modn_mod. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool choice eqtype ssrnat seq", "From mathcomp Require Import div fintype bigop finset prime fingroup perm", "From mathcomp Require Import ssralg finalg countalg" ]
algebra/zmodp.v
Fp_nat_mod
pchar_Fp: p \in [pchar 'F_p]. Proof. by rewrite !inE -Fp_nat_mod p_pr ?modnn. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool choice eqtype ssrnat seq", "From mathcomp Require Import div fintype bigop finset prime fingroup perm", "From mathcomp Require Import ssralg finalg countalg" ]
algebra/zmodp.v
pchar_Fp
pchar_Fp_0: p%:R = 0 :> 'F_p. Proof. exact: GRing.pcharf0 pchar_Fp. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool choice eqtype ssrnat seq", "From mathcomp Require Import div fintype bigop finset prime fingroup perm", "From mathcomp Require Import ssralg finalg countalg" ]
algebra/zmodp.v
pchar_Fp_0
unitFpEx : ((x%:R : 'F_p) \is a GRing.unit) = coprime p x. Proof. by rewrite pdiv_id // unitZpE // prime_gt1. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool choice eqtype ssrnat seq", "From mathcomp Require Import div fintype bigop finset prime fingroup perm", "From mathcomp Require Import ssralg finalg countalg" ]
algebra/zmodp.v
unitFpE
Fp_fieldMixin: GRing.ComUnitRing_isField 'F_p. Proof. constructor => x nzx. rewrite qualifE /= prime_coprime ?gtnNdvd ?lt0n //. case: (ltnP 1 p) => [lt1p | ]; last by case: p => [|[|p']]. by rewrite Zp_cast ?prime_gt1 ?pdiv_prime. Qed. HB.instance Definition _ := Fp_fieldMixin. HB.instance Definition _ := FinRing.isField.Build 'F_p.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool choice eqtype ssrnat seq", "From mathcomp Require Import div fintype bigop finset prime fingroup perm", "From mathcomp Require Import ssralg finalg countalg" ]
algebra/zmodp.v
Fp_fieldMixin
gen_tperm_stepn (k : 'I_n.+1) : coprime n.+1 k -> <<[set tperm i (i + k) | i : 'I_n.+1]>>%g = [set: 'S_n.+1]. Proof. case: n k => [|n] k. move=> _; apply/eqP; rewrite eqEsubset subsetT/= -(gen_tperm 0)/= gen_subG. apply/subsetP => s /imsetP[/= [][|//] lt01 _ ->]. have ->: (Ordinal lt01) = 0 by apply/val_inj. by rewrite tperm1 group1. rewrite -unitZpE// natr_Zp => k_unit. apply/eqP; rewrite eqEsubset subsetT/= -(gen_tperm 0)/= gen_subG. apply/subsetP => s /imsetP[/= i _ ->]. rewrite -[i](mulVKr k_unit) -[_ * i]natr_Zp mulr_natr. elim: (val _) => //= {i} [|[|i] IHi]; first by rewrite tperm1 group1. by rewrite mulrSr mem_gen//; apply/imsetP; exists 0. have [->|kS2N0] := eqVneq (k *+ i.+2) 0; first by rewrite tperm1 group1. have kSSneqkS : k *+ i.+2 != k *+ i.+1. rewrite -subr_eq0 -mulrnBr// subSnn mulr1n. by apply: contraTneq k_unit => ->; rewrite unitr0. rewrite -(@tpermJ_tperm _ (k *+ i.+1)) 1?eq_sym//. rewrite groupJ// 1?tpermC// mulrSr 1?tpermC. by rewrite mem_gen//; apply/imsetP; exists (k *+ i.+1). Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool choice eqtype ssrnat seq", "From mathcomp Require Import div fintype bigop finset prime fingroup perm", "From mathcomp Require Import ssralg finalg countalg" ]
algebra/zmodp.v
gen_tperm_step
perm_addr1Xn m (j k : 'I_n.+1) : (perm (addrI m%R) ^+ j)%g k = m *+ j + k. Proof. by rewrite permX (eq_iter (permE _)) iter_addr. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool choice eqtype ssrnat seq", "From mathcomp Require Import div fintype bigop finset prime fingroup perm", "From mathcomp Require Import ssralg finalg countalg" ]
algebra/zmodp.v
perm_addr1X
gen_tpermn_circular_shiftn (i j : 'I_n.+2) (c := perm (addrI 1)) : coprime n.+2 (j - i)%R -> <<[set tperm i j ; c]>>%g = [set: 'S_n.+2]. Proof. move=> jBi_coprime; apply/eqP; rewrite eqEsubset subsetT/=. rewrite -(gen_tperm_step jBi_coprime) gen_subG. apply/subsetP => s /imsetP[/= k _ ->]. suff -> : tperm k (k + (j - i)) = (tperm i j ^ c ^+ (k - i)%R)%g. by rewrite groupJ ?groupX ?mem_gen ?inE ?eqxx ?orbT. by rewrite tpermJ !perm_addr1X natr_Zp addrNK addrAC addrA. Qed.
Lemma
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool choice eqtype ssrnat seq", "From mathcomp Require Import div fintype bigop finset prime fingroup perm", "From mathcomp Require Import ssralg finalg countalg" ]
algebra/zmodp.v
gen_tpermn_circular_shift
char_Fp:= (pchar_Fp) (only parsing). #[deprecated(since="mathcomp 2.4.0", note="Use pchar_Fp_0 instead.")]
Notation
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool choice eqtype ssrnat seq", "From mathcomp Require Import div fintype bigop finset prime fingroup perm", "From mathcomp Require Import ssralg finalg countalg" ]
algebra/zmodp.v
char_Fp
char_Fp_0:= (pchar_Fp_0) (only parsing).
Notation
algebra
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrfun ssrbool choice eqtype ssrnat seq", "From mathcomp Require Import div fintype bigop finset prime fingroup perm", "From mathcomp Require Import ssralg finalg countalg" ]
algebra/zmodp.v
char_Fp_0
RecordisLaw T (op : T -> T -> T) := { opA : associative op; }. #[export] HB.structure Definition Law T := {op of isLaw T op}.
HB.mixin
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
Record
law:= Law.type. HB.mixin Record isCommutativeLaw T (op : T -> T -> T) := { opC : commutative op; }. #[export] HB.structure Definition ComLaw T := {op of Law T op & isCommutativeLaw T op}.
Notation
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
law
com_law:= ComLaw.type. HB.factory Record isComLaw T (op : T -> T -> T) := { opA : associative op; opC : commutative op; }. HB.builders Context T op of isComLaw T op. HB.instance Definition _ := isLaw.Build T op opA. HB.instance Definition _ := isCommutativeLaw.Build T op opC. HB.end.
Notation
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
com_law
mulmA: associative mul. Proof. exact: opA. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
mulmA
mulmC: commutative mul. Proof. exact: opC. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
mulmC
mulmCA: left_commutative mul. Proof. by move=> x y z; rewrite !mulmA [_ x _]mulmC. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
mulmCA
mulmAC: right_commutative mul. Proof. by move=> x y z; rewrite -!mulmA [_ y _]mulmC. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
mulmAC
mulmACA: interchange mul mul. Proof. by move=> x y z t; rewrite -!mulmA [_ y _]mulmCA. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
mulmACA
RecordisMonoidLaw T (idm : T) (op : T -> T -> T) := { op1m : left_id idm op; opm1 : right_id idm op; }. #[export] HB.structure Definition Law T idm := {op of SemiGroup.Law T op & isMonoidLaw T idm op}.
HB.mixin
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
Record
law:= Law.type. HB.factory Record isLaw T (idm : T) (op : T -> T -> T) := { opA : associative op; op1m : left_id idm op; opm1 : right_id idm op; }. HB.builders Context T idm op of isLaw T idm op. HB.instance Definition _ := SemiGroup.isLaw.Build T op opA. HB.instance Definition _ := isMonoidLaw.Build T idm op op1m opm1. HB.end. #[export] HB.structure Definition ComLaw T idm := {op of Law T idm op & isCommutativeLaw T op}.
Notation
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
law
com_law:= ComLaw.type. HB.factory Record isComLaw T (idm : T) (op : T -> T -> T) := { opA : associative op; opC : commutative op; op1m : left_id idm op; }. HB.builders Context T idm op of isComLaw T idm op.
Notation
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
com_law
opm1: right_id idm op. Proof. by move=> x; rewrite opC op1m. Qed. HB.instance Definition _ := isLaw.Build T idm op opA op1m opm1. HB.instance Definition _ := isCommutativeLaw.Build T op opC. HB.end. HB.mixin Record isMulLaw T (zero : T) (mul : T -> T -> T) := { mul_zerol : left_zero zero mul; mul_zeror : right_zero zero mul; }. #[export] HB.structure Definition MulLaw T zero := {mul of isMulLaw T zero mul}.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
opm1
mul_law:= MulLaw.type. HB.mixin Record isAddLaw T (mul : T -> T -> T) (op : T -> T -> T) := { mul_op_Dl : left_distributive mul op; mul_op_Dr : right_distributive mul op; }. #[export] HB.structure Definition AddLaw T zero mul := {add of ComLaw T zero add & isAddLaw T mul add}.
Notation
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
mul_law
add_law:= AddLaw.type.
Notation
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
add_law
mulC_id: left_id one mul -> right_id one mul. Proof. by move=> mul1x x; rewrite mulC. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
mulC_id
mulC_zero: left_zero zero mul -> right_zero zero mul. Proof. by move=> mul0x x; rewrite mulC. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
mulC_zero
mulC_dist: left_distributive mul add -> right_distributive mul add. Proof. by move=> mul_addl x y z; rewrite !(mulC x). Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
mulC_dist
mul1m: left_id idm mul. Proof. exact: op1m. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
mul1m
mulm1: right_id idm mul. Proof. exact: opm1. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
mulm1
iteropEn x : iterop n mul x idm = iter n (mul x) idm. Proof. by case: n => // n; rewrite iterSr mulm1 iteropS. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
iteropE
mul0m: left_zero idm mul. Proof. exact: mul_zerol. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
mul0m
mulm0: right_zero idm mul. Proof. exact: mul_zeror. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
mulm0
addmA: associative add. Proof. exact: mulmA. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
addmA
addmC: commutative add. Proof. exact: mulmC. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
addmC
addmCA: left_commutative add. Proof. exact: mulmCA. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
addmCA
addmAC: right_commutative add. Proof. exact: mulmAC. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
addmAC
add0m: left_id idm add. Proof. exact: mul1m. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
add0m
addm0: right_id idm add. Proof. exact: mulm1. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
addm0
mulmDl: left_distributive mul add. Proof. exact: mul_op_Dl. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
mulmDl
mulmDr: right_distributive mul add. Proof. exact: mul_op_Dr. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
mulmDr
simpm:= (mulm1, mulm0, mul1m, mul0m, mulmA).
Definition
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
simpm
Definition_ := isComLaw.Build bool true andb andbA andbC andTb. HB.instance Definition _ := isMulLaw.Build bool false andb andFb andbF. HB.instance Definition _ := isComLaw.Build bool false orb orbA orbC orFb. HB.instance Definition _ := isMulLaw.Build bool true orb orTb orbT. HB.instance Definition _ := isComLaw.Build bool false addb addbA addbC addFb. HB.instance Definition _ := isAddLaw.Build bool andb orb andb_orl andb_orr. HB.instance Definition _ := isAddLaw.Build bool orb andb orb_andl orb_andr. HB.instance Definition _ := isAddLaw.Build bool andb addb andb_addl andb_addr. HB.instance Definition _ := isComLaw.Build nat 0 addn addnA addnC add0n. HB.instance Definition _ := isComLaw.Build nat 1 muln mulnA mulnC mul1n. HB.instance Definition _ := isMulLaw.Build nat 0 muln mul0n muln0. HB.instance Definition _ := isAddLaw.Build nat muln addn mulnDl mulnDr. HB.instance Definition _ := isComLaw.Build nat 0 maxn maxnA maxnC max0n. HB.instance Definition _ := isAddLaw.Build nat muln maxn maxnMl maxnMr. HB.instance Definition _ := isComLaw.Build nat 0 gcdn gcdnA gcdnC gcd0n. HB.instance Definition _ := isAddLaw.Build nat muln gcdn muln_gcdl muln_gcdr. HB.instance Definition _ := isComLaw.Build nat 1 lcmn lcmnA lcmnC lcm1n. HB.instance Definition _ := isAddLaw.Build nat muln lcmn muln_lcml muln_lcmr. HB.instance Definition _ T := isLaw.Build (seq T) nil cat (@catA T) (@cat0s T) (@cats0 T).
HB.instance
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
Definition
myp:= addn. Definition mym := muln.
Definition
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
myp
myp_mon:= [law of myp].
Canonical
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
myp_mon
myp_cmon:= [com_law of myp].
Canonical
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
myp_cmon
mym_mul:= [mul_law of mym].
Canonical
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
mym_mul
myp_add:= [add_law _ of myp]. Print myp_add. Print Canonical Projections. *) Delimit Scope big_scope with BIG. Open Scope big_scope.
Canonical
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
myp_add
bigbodyR I := BigBody of I & (R -> R -> R) & bool & R.
Variant
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
bigbody
applybig{R I} (body : bigbody R I) x := let: BigBody _ op b v := body in if b then op v x else x.
Definition
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
applybig
reducebigR I idx r (body : I -> bigbody R I) := foldr (applybig \o body) idx r. HB.lock Definition bigop := reducebig.
Definition
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
reducebig
bigop_unlock:= Unlockable bigop.unlock.
Canonical
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
bigop_unlock
index_iotam n := iota m (n - m).
Definition
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
index_iota
mem_index_iotam n i : i \in index_iota m n = (m <= i < n). Proof. rewrite mem_iota; case le_m_i: (m <= i) => //=. by rewrite -leq_subLR subSn // -subn_gt0 -subnDA subnKC // subn_gt0. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
mem_index_iota
index_enum(T : finType) := locked_with index_enum_key (Finite.enum T).
Definition
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
index_enum
deprecated_filter_index_enumT P : filter P (index_enum T) = enum P. Proof. by rewrite [index_enum T]unlock. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
deprecated_filter_index_enum
mem_index_enumT i : i \in index_enum T. Proof. by rewrite [index_enum T]unlock -enumT mem_enum. Qed. #[global] Hint Resolve mem_index_enum : core.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
mem_index_enum
index_enum_uniqT : uniq (index_enum T). Proof. by rewrite [index_enum T]unlock -enumT enum_uniq. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
index_enum_uniq
BIG_F:= (F in \big[_/_]_(i <- _ | _) F i)%pattern.
Notation
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
BIG_F
BIG_P:= (P in \big[_/_]_(i <- _ | P i) _)%pattern. Local Notation "+%N" := addn (only parsing).
Notation
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
BIG_P
big_loadR (K K' : R -> Type) idx op I r (P : pred I) F : K (\big[op/idx]_(i <- r | P i) F i) * K' (\big[op/idx]_(i <- r | P i) F i) -> K' (\big[op/idx]_(i <- r | P i) F i). Proof. by case. Qed. Arguments big_load [R] K [K'] idx op [I].
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
big_load
big_rec3I r (P : pred I) F1 F2 F3 (K_F : forall i y1 y2 y3, P i -> K y1 y2 y3 -> K (op1 (F1 i) y1) (op2 (F2 i) y2) (op3 (F3 i) y3)) : K (\big[op1/id1]_(i <- r | P i) F1 i) (\big[op2/id2]_(i <- r | P i) F2 i) (\big[op3/id3]_(i <- r | P i) F3 i). Proof. by rewrite unlock; elim: r => //= i r; case: ifP => //; apply: K_F. Qed. Hypothesis Kop : forall x1 x2 x3 y1 y2 y3, K x1 x2 x3 -> K y1 y2 y3-> K (op1 x1 y1) (op2 x2 y2) (op3 x3 y3).
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
big_rec3
big_ind3I r (P : pred I) F1 F2 F3 (K_F : forall i, P i -> K (F1 i) (F2 i) (F3 i)) : K (\big[op1/id1]_(i <- r | P i) F1 i) (\big[op2/id2]_(i <- r | P i) F2 i) (\big[op3/id3]_(i <- r | P i) F3 i). Proof. by apply: big_rec3 => i x1 x2 x3 /K_F; apply: Kop. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
big_ind3
big_rec2I r (P : pred I) F1 F2 (K_F : forall i y1 y2, P i -> K y1 y2 -> K (op1 (F1 i) y1) (op2 (F2 i) y2)) : K (\big[op1/id1]_(i <- r | P i) F1 i) (\big[op2/id2]_(i <- r | P i) F2 i). Proof. by rewrite unlock; elim: r => //= i r; case: ifP => //; apply: K_F. Qed. Hypothesis Kop : forall x1 x2 y1 y2, K x1 x2 -> K y1 y2 -> K (op1 x1 y1) (op2 x2 y2).
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
big_rec2
big_ind2I r (P : pred I) F1 F2 (K_F : forall i, P i -> K (F1 i) (F2 i)) : K (\big[op1/id1]_(i <- r | P i) F1 i) (\big[op2/id2]_(i <- r | P i) F2 i). Proof. by apply: big_rec2 => i x1 x2 /K_F; apply: Kop. Qed. Hypotheses (f_op : {morph f : x y / op2 x y >-> op1 x y}) (f_id : f id2 = id1).
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
big_ind2
big_morphI r (P : pred I) F : f (\big[op2/id2]_(i <- r | P i) F i) = \big[op1/id1]_(i <- r | P i) f (F i). Proof. by rewrite unlock; elim: r => //= i r <-; rewrite -f_op -fun_if. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
big_morph
big_recI r (P : pred I) F (Kop : forall i x, P i -> K x -> K (op (F i) x)) : K (\big[op/idx]_(i <- r | P i) F i). Proof. by rewrite unlock; elim: r => //= i r; case: ifP => //; apply: Kop. Qed. Hypothesis Kop : forall x y, K x -> K y -> K (op x y).
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
big_rec
big_indI r (P : pred I) F (K_F : forall i, P i -> K (F i)) : K (\big[op/idx]_(i <- r | P i) F i). Proof. by apply: big_rec => // i x /K_F /Kop; apply. Qed. Hypothesis Kop' : forall x y, K x -> K y -> op x y = op' x y.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
big_ind
eq_big_opI r (P : pred I) F (K_F : forall i, P i -> K (F i)) : \big[op/idx]_(i <- r | P i) F i = \big[op'/idx]_(i <- r | P i) F i. Proof. by elim/(big_load K): _; elim/big_rec2: _ => // i _ y Pi [Ky <-]; auto. Qed. Hypotheses (fM : {morph f : x y / op x y}) (f_id : f idx = idx).
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
eq_big_op
big_endoI r (P : pred I) F : f (\big[op/idx]_(i <- r | P i) F i) = \big[op/idx]_(i <- r | P i) f (F i). Proof. exact: big_morph. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
big_endo
big_morph_in(R1 R2 : Type) (Q : {pred R2}) (f : R2 -> R1) (id1 : R1) (op1 : R1 -> R1 -> R1) (id2 : R2) (op2 : R2 -> R2 -> R2) : {in Q &, forall x y, op2 x y \in Q} -> id2 \in Q -> {in Q &, {morph f : x y / op2 x y >-> op1 x y}} -> f id2 = id1 -> forall [I : Type] (r : seq I) (P : pred I) (F : I -> R2), (forall i, P i -> F i \in Q) -> f (\big[op2/id2]_(i <- r | P i) F i) = \big[op1/id1]_(i <- r | P i) f (F i). Proof. move=> Qop Qid fop fid I r P F QF; elim/(big_load Q): _. by elim/big_rec2: _ => // j x y Pj [Qx <-]; rewrite [Q _]Qop ?fop ?QF. Qed. Arguments big_morph_in [R1 R2] Q f [id1 op1 id2 op2].
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
big_morph_in
oACof associative op & commutative op := fun x => oapp (fun y => Some (oapp (op^~ y) y x)) x. Arguments oAC : simpl never. Hypothesis (opA : associative op) (opC : commutative op). Local Notation oop := (oAC opA opC).
Definition
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
oAC
oACEx y : oop (Some x) (Some y) = some (op x y). Proof. by []. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
oACE
oopA_subdef: associative oop. Proof. by move=> [x|] [y|] [z|]//; rewrite /oAC/= opA. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
oopA_subdef
oopx1_subdef: left_id None oop. Proof. by case. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
oopx1_subdef
oop1x_subdef: right_id None oop. Proof. by []. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
oop1x_subdef
oopC_subdef: commutative oop. Proof. by move=> [x|] [y|]//; rewrite /oAC/= opC. Qed. HB.instance Definition _ := Monoid.isComLaw.Build (option T) None oop oopA_subdef oopC_subdef oopx1_subdef. Context [x : T].
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
oopC_subdef
some_big_AC_mk_monoid[I : Type] r P (F : I -> T) : Some (\big[op/x]_(i <- r | P i) F i) = oop (\big[oop/None]_(i <- r | P i) Some (F i)) (Some x). Proof. by elim/big_rec2 : _ => //= i [y|] _ Pi [] -> //=; rewrite opA. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
some_big_AC_mk_monoid
big_AC_mk_monoid[I : Type] r P (F : I -> T) : \big[op/x]_(i <- r | P i) F i = odflt x (oop (\big[oop/None]_(i <- r | P i) Some (F i)) (Some x)). Proof. by apply: Some_inj; rewrite some_big_AC_mk_monoid. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
big_AC_mk_monoid
foldrEr : foldr op idx r = \big[op/idx]_(x <- r) x. Proof. by rewrite unlock. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
foldrE
big_filterr (P : pred I) F : \big[op/idx]_(i <- filter P r) F i = \big[op/idx]_(i <- r | P i) F i. Proof. by rewrite unlock; elim: r => //= i r <-; case (P i). Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
big_filter
big_filter_condr (P1 P2 : pred I) F : \big[op/idx]_(i <- filter P1 r | P2 i) F i = \big[op/idx]_(i <- r | P1 i && P2 i) F i. Proof. rewrite -big_filter -(big_filter r); congr bigop. by rewrite -filter_predI; apply: eq_filter => i; apply: andbC. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
big_filter_cond
eq_biglr (P1 P2 : pred I) F : P1 =1 P2 -> \big[op/idx]_(i <- r | P1 i) F i = \big[op/idx]_(i <- r | P2 i) F i. Proof. by move=> eqP12; rewrite -!(big_filter r) (eq_filter eqP12). Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
eq_bigl
big_andbCr (P Q : pred I) F : \big[op/idx]_(i <- r | P i && Q i) F i = \big[op/idx]_(i <- r | Q i && P i) F i. Proof. by apply: eq_bigl => i; apply: andbC. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
big_andbC
eq_bigrr (P : pred I) F1 F2 : (forall i, P i -> F1 i = F2 i) -> \big[op/idx]_(i <- r | P i) F1 i = \big[op/idx]_(i <- r | P i) F2 i. Proof. by move=> eqF12; elim/big_rec2: _ => // i x _ /eqF12-> ->. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
eq_bigr
eq_bigr (P1 P2 : pred I) F1 F2 : P1 =1 P2 -> (forall i, P1 i -> F1 i = F2 i) -> \big[op/idx]_(i <- r | P1 i) F1 i = \big[op/idx]_(i <- r | P2 i) F2 i. Proof. by move/eq_bigl <-; move/eq_bigr->. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
eq_big
congr_bigr1 r2 (P1 P2 : pred I) F1 F2 : r1 = r2 -> P1 =1 P2 -> (forall i, P1 i -> F1 i = F2 i) -> \big[op/idx]_(i <- r1 | P1 i) F1 i = \big[op/idx]_(i <- r2 | P2 i) F2 i. Proof. by move=> <-{r2}; apply: eq_big. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
congr_big
big_nil(P : pred I) F : \big[op/idx]_(i <- [::] | P i) F i = idx. Proof. by rewrite unlock. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
big_nil
big_consi r (P : pred I) F : let x := \big[op/idx]_(j <- r | P j) F j in \big[op/idx]_(j <- i :: r | P j) F j = if P i then op (F i) x else x. Proof. by rewrite unlock. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
big_cons
big_rcons_opi r (P : pred I) F : let idx' := if P i then op (F i) idx else idx in \big[op/idx]_(j <- rcons r i | P j) F j = \big[op/idx']_(j <- r | P j) F j. Proof. by elim: r => /= [|j r]; rewrite !(big_nil, big_cons, unlock)// => ->. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
big_rcons_op
big_mapJ (h : J -> I) r (P : pred I) F : \big[op/idx]_(i <- map h r | P i) F i = \big[op/idx]_(j <- r | P (h j)) F (h j). Proof. by rewrite unlock; elim: r => //= j r ->. Qed.
Lemma
boot
[ "From HB Require Import structures", "From mathcomp Require Import ssreflect ssrbool ssrfun eqtype ssrnat seq path", "From mathcomp Require Import div fintype tuple finfun" ]
boot/bigop.v
big_map