@@ -35,48 +35,45 @@ 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) (l : seq I) :
38+ Lemma coprime_prodr (I : Type ) (r : seq I) (P : {pred I}) (F : I -> nat) (a : I)
39+ (l : seq I) :
3940 all (coprime (F a)) [seq F i | i <- [seq i <- l | P i]] ->
4041 coprime (F a) (\prod_(j <- l | P j) F j).
4142Proof .
42- elim: l => /= [_|a0 l HI].
43- by rewrite big_nil coprimen1.
44- rewrite big_cons. case: (P a0) => //.
45- rewrite map_cons => /= /andP [] ? ?.
46- rewrite coprimeMr. apply/andP. split=> //.
47- exact: HI.
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.
4847Qed .
4948
50- Lemma Gauss_dvd_prod (I : eqType) (r : seq I) (P : {pred I}) (F : I -> nat) (n : nat) :
49+ Lemma Gauss_dvd_prod (I : eqType) (r : seq I) (P : {pred I}) (F : I -> nat)
50+ (n : nat) :
5151 pairwise coprime [seq F i | i <- [seq i <- r | P i]] ->
5252 reflect (forall i, i \in r -> P i -> F i %| n)
53- (\prod_(i <- r | P i) F i %| n).
53+ (\prod_(i <- r | P i) F i %| n).
5454Proof .
5555elim: r => /= [_|a l HI].
5656 by rewrite big_nil dvd1n; apply: ReflectT => i; rewrite in_nil.
57- rewrite big_cons.
58- case: (boolP (P a)) => [Pa|]; last first.
59- rewrite -eqbF_neg => /eqP nPa pairwisecoprime.
60- apply: (equivP (HI pairwisecoprime)).
61- split; last first => [Fidvdn i iinl|Fidvdn i].
62- by apply: Fidvdn; rewrite in_cons; apply/orP; right.
63- rewrite in_cons => /orP [/eqP ->|]; first by rewrite nPa.
64- exact: Fidvdn.
65- rewrite map_cons pairwise_cons => /andP [] allcoprimea pairwisecoprime.
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].
6662rewrite Gauss_dvd; last exact: coprime_prodr.
6763apply: (equivP (andPP idP (HI pairwisecoprime))).
68- split=> [[] Fadvdn Fidvdn i|Fidvdn].
69- by rewrite in_cons => /orP [/eqP -> |]; last exact: Fidvdn.
70- split=> [|i iinl ].
71- apply: Fidvdn => //; first exact: mem_head.
72- by apply: Fidvdn; rewrite in_cons; apply/orP; right .
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 .
7369Qed .
7470
75- Lemma expn_prod (I : eqType) (r : seq I) (P : {pred I}) (F : I -> nat) (n : nat) :
71+ Lemma expn_prod (I : eqType) (r : seq I) (P : {pred I}) (F : I -> nat)
72+ (n : nat) :
7673 ((\prod_(i <- r | P i) F i) ^ n = \prod_(i <- r | P i) (F i) ^ n)%N.
7774Proof .
7875elim: r => [|a l]; first by rewrite !big_nil exp1n.
79- by rewrite !big_cons; case: (P a) => <- // ; rewrite expnMn.
76+ by rewrite !big_cons; case: ifPn => // Pa <- ; rewrite expnMn.
8077Qed .
8178
8279Section max_min.
@@ -141,11 +138,10 @@ Qed.
141138Definition monotonous d (T : porderType d) (pT : predType T) (A : pT) (f : T -> T) :=
142139 {in A &, {mono f : x y / (x <= y)%O}} \/ {in A &, {mono f : x y /~ (x <= y)%O}}.
143140
144- Lemma mono_ext: forall f, {mono f : m n / (m <= n)%N} -> forall n : nat , (n <= f n)%N.
141+ Lemma mono_ext f : {mono f : m n / (m <= n)%N} -> forall n, (n <= f n)%N.
145142Proof .
146- move=> f fincr. elim=> [//| n HR]. apply: (leq_ltn_trans HR).
147- rewrite ltn_neqAle fincr (inj_eq (incn_inj fincr)) -ltn_neqAle.
148- exact: ltnSn.
143+ move=> fincr; elim=> [//| n HR]; rewrite (leq_ltn_trans HR)//.
144+ by rewrite ltn_neqAle fincr (inj_eq (incn_inj fincr)) -ltn_neqAle.
149145Qed .
150146
151147(* NB: these lemmas have been introduced to develop the theory of bounded variation *)
@@ -228,13 +224,12 @@ Arguments big_rmcond_in {R idx op I r} P.
228224
229225Reserved Notation "`1- x" (format "`1- x", at level 2).
230226
231- Lemma card_big_setU (I : Type ) (T : finType) (r : seq I) (P : {pred I}) (F : I -> {set T}) :
227+ Lemma card_big_setU (I : Type ) (T : finType) (r : seq I) (P : {pred I})
228+ (F : I -> {set T}) :
232229 (#|\bigcup_(i <- r | P i) F i| <= \sum_(i <- r | P i) #|F i|)%N.
233230Proof .
234- elim: r => [|a l HI]; first by rewrite !big_nil cards0.
235- rewrite !big_cons. case: (P a); last exact: HI.
236- apply: (leq_trans (leq_card_setU (F a) _)).
237- by rewrite leq_add2l.
231+ elim/big_ind2 : _ => // [|m A n B Am Bn]; first by rewrite cards0.
232+ by rewrite (leq_trans (leq_card_setU _ _))// leq_add.
238233Qed .
239234
240235Section onem.
0 commit comments