@@ -35,6 +35,47 @@ Unset Printing Implicit Defensive.
3535Import Order.TTheory GRing.Theory Num.Theory.
3636Local Open Scope ring_scope.
3737
38+ Lemma coprime_prodr (I : Type ) (r : seq I) (P : {pred I}) (F : I -> nat) (a : I)
39+ (l : seq I) :
40+ all (coprime (F a)) [seq F i | i <- [seq i <- l | P i]] ->
41+ coprime (F a) (\prod_(j <- l | P j) F j).
42+ Proof .
43+ elim: l => /= [_|h t ih]; first by rewrite big_nil coprimen1.
44+ rewrite big_cons; case: ifPn => // Ph.
45+ rewrite map_cons => /= /andP[FaFh FatP].
46+ by rewrite coprimeMr FaFh/= ih.
47+ Qed .
48+
49+ Lemma Gauss_dvd_prod (I : eqType) (r : seq I) (P : {pred I}) (F : I -> nat)
50+ (n : nat) :
51+ pairwise coprime [seq F i | i <- [seq i <- r | P i]] ->
52+ reflect (forall i, i \in r -> P i -> F i %| n)
53+ (\prod_(i <- r | P i) F i %| n).
54+ Proof .
55+ elim: r => /= [_|a l HI].
56+ by rewrite big_nil dvd1n; apply: ReflectT => i; rewrite in_nil.
57+ rewrite big_cons; case: ifP => [Pa|nPa]; last first.
58+ move/HI/equivP; apply; split=> [Fidvdn i|Fidvdn i il].
59+ by rewrite in_cons => /predU1P[->|]; [rewrite nPa|exact: Fidvdn].
60+ by apply: Fidvdn; rewrite in_cons il orbT.
61+ rewrite map_cons pairwise_cons => /andP[allcoprimea pairwisecoprime].
62+ rewrite Gauss_dvd; last exact: coprime_prodr.
63+ apply: (equivP (andPP idP (HI pairwisecoprime))).
64+ split=> [[Fadvdn Fidvdn] i|Fidvdn].
65+ by rewrite in_cons => /predU1P[->//|]; exact: Fidvdn.
66+ split=> [|i il].
67+ by apply: Fidvdn => //; exact: mem_head.
68+ by apply: Fidvdn; rewrite in_cons il orbT.
69+ Qed .
70+
71+ Lemma expn_prod (I : eqType) (r : seq I) (P : {pred I}) (F : I -> nat)
72+ (n : nat) :
73+ ((\prod_(i <- r | P i) F i) ^ n = \prod_(i <- r | P i) (F i) ^ n)%N.
74+ Proof .
75+ elim: r => [|a l]; first by rewrite !big_nil exp1n.
76+ by rewrite !big_cons; case: ifPn => // Pa <-; rewrite expnMn.
77+ Qed .
78+
3879Section max_min.
3980Variable R : realFieldType.
4081
97138Definition monotonous d (T : porderType d) (pT : predType T) (A : pT) (f : T -> T) :=
98139 {in A &, {mono f : x y / (x <= y)%O}} \/ {in A &, {mono f : x y /~ (x <= y)%O}}.
99140
141+ Lemma mono_leq_infl f : {mono f : m n / (m <= n)%N} -> forall n, (n <= f n)%N.
142+ Proof .
143+ move=> fincr; elim=> [//| n HR]; rewrite (leq_ltn_trans HR)//.
144+ by rewrite ltn_neqAle fincr (inj_eq (incn_inj fincr)) -ltn_neqAle.
145+ Qed .
146+
100147(* NB: these lemmas have been introduced to develop the theory of bounded variation *)
101148Section path_lt.
102149Context d {T : orderType d}.
@@ -177,6 +224,14 @@ Arguments big_rmcond_in {R idx op I r} P.
177224
178225Reserved Notation "`1- x" (format "`1- x", at level 2).
179226
227+ Lemma card_big_setU (I : Type ) (T : finType) (r : seq I) (P : {pred I})
228+ (F : I -> {set T}) :
229+ (#|\bigcup_(i <- r | P i) F i| <= \sum_(i <- r | P i) #|F i|)%N.
230+ Proof .
231+ elim/big_ind2 : _ => // [|m A n B Am Bn]; first by rewrite cards0.
232+ by rewrite (leq_trans (leq_card_setU _ _))// leq_add.
233+ Qed .
234+
180235Section onem.
181236Variable R : numDomainType.
182237Implicit Types r : R.
0 commit comments