Skip to content

Commit 0d5d6ba

Browse files
committed
Generalize fsfun_injective_inP to arbitrary functions.
1 parent 56c1ab6 commit 0d5d6ba

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

finmap.v

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2110,6 +2110,15 @@ Qed.
21102110
Lemma FSetK A (X : {set A}) : fsub A [fsetval k in X] = X.
21112111
Proof. by apply/setP => x; rewrite !inE. Qed.
21122112

2113+
Lemma fset_injective_inP (T : eqType) (f : K -> T) A :
2114+
reflect {in A &, injective f} (injectiveb (fun x : A => f (val x))).
2115+
Proof.
2116+
apply: (iffP (@injectiveP _ _ _)) => f_inj a b; last first.
2117+
by move => *; apply: val_inj; apply: f_inj => //; apply: valP.
2118+
move=> aT bT eq_ga_gb; have := f_inj (Sub a aT) (Sub b bT).
2119+
by move=> /(_ eq_ga_gb) /(congr1 val).
2120+
Qed.
2121+
21132122
End Theory.
21142123
#[global] Hint Resolve fsubset_refl fsubset_trans : core.
21152124
#[global] Hint Resolve fproper_irrefl fsub0set : core.
@@ -4090,7 +4099,7 @@ Lemma fscomp_inj g f : injective f -> injective g -> injective (g \o f)%fsfun.
40904099
Proof. by move=> f_inj g_inj k k'; rewrite !fscompE => /= /g_inj /f_inj. Qed.
40914100

40924101
Definition fsinjectiveb : pred {fsfun K -> K} :=
4093-
[pred f | (injectiveb [ffun a : finsupp f => f (val a)])
4102+
[pred f | (injectiveb (fun a : finsupp f => f (val a)))
40944103
&& [forall a : finsupp f, f (val a) \in finsupp f]].
40954104

40964105
Lemma fsinjP {f} : [<->
@@ -4118,7 +4127,7 @@ Qed.
41184127
Lemma fsinjectiveP f : reflect (injective f) (fsinjectiveb f).
41194128
Proof.
41204129
apply: equivP (fsinjP 1 0) => /=;
4121-
by apply: (iffP andP)=> -[/fsfun_injective_inP ? /forallP ?].
4130+
by apply: (iffP andP)=> -[/fset_injective_inP ? /forallP ?].
41224131
Qed.
41234132

41244133
Lemma fsinjectivebP f :

0 commit comments

Comments
 (0)