Least upper bound and greatest lower bound properties for integers #
In this file we prove that a bounded above nonempty set of integers has the greatest element, and a counterpart of this statement for the least element.
Main definitions #
int.least_of_bdd
: ifP : ℤ → Prop
is a decidable predicate,b
is a lower bound of the set{m | P m}
, and there existsm : ℤ
such thatP m
(this time, no witness is required), thenint.least_of_bdd
returns the least numberm
such thatP m
, together with proofs ofP m
and of the minimality. This definition is computable and does not rely on the axiom of choice.int.greatest_of_bdd
: a similar definition with all inequalities reversed.
Main statements #
-
int.exists_least_of_bdd
: ifP : ℤ → Prop
is a predicate such that the set{m : P m}
is bounded below and nonempty, then this set has the least element. This lemma uses classical logic to avoid assumption[decidable_pred P]
. Seeint.least_of_bdd
for a constructive counterpart. -
int.coe_least_of_bdd_eq
:(int.least_of_bdd b Hb Hinh : ℤ)
does not depend onb
. -
int.exists_greatest_of_bdd
,int.coe_greatest_of_bdd_eq
: versions of the above lemmas with all inequalities reversed.
Tags #
integer numbers, least element, greatest element
A computable version of exists_least_of_bdd
: given a decidable predicate on the
integers, with an explicit lower bound and a proof that it is somewhere true, return
the least value for which the predicate is true.
If P : ℤ → Prop
is a predicate such that the set {m : P m}
is bounded below and nonempty,
then this set has the least element. This lemma uses classical logic to avoid assumption
[decidable_pred P]
. See int.least_of_bdd
for a constructive counterpart.
A computable version of exists_greatest_of_bdd
: given a decidable predicate on the
integers, with an explicit upper bound and a proof that it is somewhere true, return
the greatest value for which the predicate is true.
If P : ℤ → Prop
is a predicate such that the set {m : P m}
is bounded above and nonempty,
then this set has the greatest element. This lemma uses classical logic to avoid assumption
[decidable_pred P]
. See int.greatest_of_bdd
for a constructive counterpart.