@@ -25,6 +25,7 @@ From mathcomp.finmap Require Import finmap.
2525(* fperm_on X == The set of all permutations with support in X *)
2626(***************************************************************************** *)
2727
28+ Unset SsrOldRewriteGoalsOrder. (* remove this line when requiring MathComp >= 2.6 *)
2829Set Implicit Arguments .
2930Unset Strict Implicit .
3031Unset Printing Implicit Defensive.
@@ -137,7 +138,7 @@ Proof. by rewrite !unlock. Qed.
137138
138139Lemma fpermE k f X : {in X &, injective f} -> {in X, fperm_keyed k X f =1 f}.
139140Proof .
140- move=> /card_in_imfsetP inj; rewrite unlock insubT /=; last first .
141+ move=> /card_in_imfsetP inj; rewrite unlock insubT /=.
141142 by move=> _ x x_X; rewrite fsfunE in_fsetU /fperm_def /= in_fsetD x_X.
142143set D := X `|` _; apply/fsinjectivebP; exists D; rewrite ?finsupp_sub //.
143144rewrite /fperm_def; set Y1 := f @` X `\` X; set Y2 := X `\` f @` X.
@@ -248,15 +249,15 @@ Variable (s : {fperm T}).
248249
249250Lemma fpermK : cancel s s^-1.
250251Proof .
251- move=> x; rewrite unlock fpermEst; last exact: fperm_inv_subproof.
252+ move=> x; rewrite unlock fpermEst; first exact: fperm_inv_subproof.
252253rewrite fperm_finsupp; case: finsuppP => // x_in_supp.
253254case: pickP => [y /= /eqP/esym /fperm_inj-> //|/(_ (Sub x x_in_supp)) /=].
254255by rewrite eqxx.
255256Qed .
256257
257258Lemma fpermKV : cancel s^-1 s.
258259Proof .
259- move=> x; rewrite unlock fpermEst; last exact: fperm_inv_subproof.
260+ move=> x; rewrite unlock fpermEst; first exact: fperm_inv_subproof.
260261case: ifPn=> [x_in_sup|].
261262 case: pickP=> [x' /= /eqP/esym -> //|/=].
262263 rewrite -imfset_finsuppfp in x_in_sup; case/imfsetP: x_in_sup=> [x' Px' ->].
291292
292293Lemma fpermM s1 s2 : s1 * s2 =1 s1 \o s2.
293294Proof .
294- move=> x; rewrite unlock fpermEst; last first .
295+ move=> x; rewrite unlock fpermEst.
295296 exact: fperm_mul_subproof.
296297have [|nin_supp] //= := boolP (x \in _).
297298rewrite in_fsetU negb_or !mem_finsupp !negbK in nin_supp.
@@ -399,7 +400,7 @@ Definition fperm2 x y := fperm_keyed fperm2_key [fset x; y] (fperm2_def x y).
399400
400401Lemma fperm2E x y : fperm2 x y =1 [fun z => z with x |-> y, y |-> x].
401402Proof .
402- move=> z; rewrite fpermEst; last exact: fperm2_subproof.
403+ move=> z; rewrite fpermEst; first exact: fperm2_subproof.
403404rewrite /= in_fset2.
404405have [->|] := altP eqP => //= ?.
405406by have [?|] := altP eqP => //= ?.
@@ -516,7 +517,7 @@ Lemma fperm_expDs s1 s2 n :
516517Proof .
517518move=> com; elim: n => [|n IH]; first by rewrite !fperm_exp0 fperm_mul1s.
518519rewrite !fperm_expSl {}IH [s1 * s2 * _]fperm_mulA -[s1 * s2 * _]fperm_mulA.
519- rewrite (@fperm_exp_com s2 s1); first by rewrite -!fperm_mulA.
520+ rewrite (@fperm_exp_com s2 s1); last by rewrite -!fperm_mulA.
520521by rewrite com.
521522Qed .
522523
@@ -578,7 +579,7 @@ Lemma ext_fpermE s y :
578579 ext_fperm s y =
579580 if g s y is Some xx then f (s (\val xx)) else y.
580581Proof .
581- rewrite fpermEst /=.
582+ rewrite fpermEst /=; last first .
582583 case g_y: (g s y) => [xx|]; rewrite ?if_same //=.
583584 move: (gK s y); rewrite g_y /= => <-.
584585 by rewrite mem_imfset //= (valP xx).
@@ -609,7 +610,7 @@ Variables (T : choiceType) (P : pred T) (sT : subChoiceType P).
609610Lemma ext_fpermE_sub (s : {fperm sT}) (y : T) :
610611 ext_fperm \val s y = if insub y is Some x then \val (s x) else y.
611612Proof .
612- rewrite ext_fpermE; last exact: val_inj.
613+ rewrite ext_fpermE; first exact: val_inj.
613614case: pickP=> /= [x /eqP <-|yP].
614615- rewrite insubT ?valP //= => ?; congr (\val (s _)).
615616 by apply/val_inj; rewrite SubK.
@@ -764,7 +765,7 @@ Lemma generateP s : reflect
764765Proof .
765766apply/(iffP idP) => [|[{s} ss ss_A ->]].
766767- rewrite unlock.
767- rewrite -in_iter_ffix_orderE; last exact: generateF_bounded.
768+ rewrite -in_iter_ffix_orderE; first exact: generateF_bounded.
768769 move: (ffix_order _ _ _) => n; elim: n => //= n IH in s *.
769770 case/fset1UP => [->|]; first by exists [::].
770771 case/imfset2P=> /= s1 s1_in [s2 s2_in ->].
0 commit comments