Skip to content

Commit bb472be

Browse files
committed
from MathComp-Analysis' unstable.v
1 parent d9ffee5 commit bb472be

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

CHANGELOG_UNRELEASED.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
### Added
66

7+
- in `finmap.v`:
8+
+ lemma `fset_nat_maximum`
9+
710
### Changed
811

912
### Renamed

finmap.v

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1800,6 +1800,15 @@ rewrite -cardfs_eq0 cardfE; apply: (equivP existsP).
18001800
by split=> [] [a aP]; [exists (val a); apply: valP|exists [` aP]].
18011801
Qed.
18021802

1803+
Lemma fset_nat_maximum A (f : K -> nat) : A != fset0 ->
1804+
(exists i, i \in A /\ forall j, j \in A -> f j <= f i)%N.
1805+
Proof.
1806+
move=> /fset0Pn[x Ax].
1807+
have [/= y _ /(_ _ isT) mf] := @arg_maxnP _ [` Ax]%fset xpredT (f \o val) isT.
1808+
exists (val y); split; first exact: valP.
1809+
by move=> z Az; have := mf [` Az]%fset.
1810+
Qed.
1811+
18031812
Lemma cardfs_gt0 A : (0 < #|` A|)%N = (A != fset0).
18041813
Proof. by rewrite lt0n cardfs_eq0. Qed.
18051814

0 commit comments

Comments
 (0)