Documentation

Mathlib.Data.Int.LeastGreatest

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 #

Main statements #

Tags #

integer numbers, least element, greatest element

def Int.leastOfBdd {P : ℤ → Prop} [DecidablePred P] (b : ℤ) (Hb : ∀ (z : ℤ), P z → b ≤ z) (Hinh : ∃ (z : ℤ), P z) :
{ lb : ℤ // P lb ∧ ∀ (z : ℤ), P z → lb ≤ z }

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.

Equations
Instances For
    theorem Int.exists_least_of_bdd {P : ℤ → Prop} [DecidablePred P] (Hbdd : ∃ (b : ℤ), ∀ (z : ℤ), P z → b ≤ z) (Hinh : ∃ (z : ℤ), P z) :
    ∃ (lb : ℤ), P lb ∧ ∀ (z : ℤ), P z → lb ≤ z

    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 [DecidablePred P]. See Int.leastOfBdd for a constructive counterpart.

    theorem Int.coe_leastOfBdd_eq {P : ℤ → Prop} [DecidablePred P] {b : ℤ} {b' : ℤ} (Hb : ∀ (z : ℤ), P z → b ≤ z) (Hb' : ∀ (z : ℤ), P z → b' ≤ z) (Hinh : ∃ (z : ℤ), P z) :
    ↑(Int.leastOfBdd b Hb Hinh) = ↑(Int.leastOfBdd b' Hb' Hinh)
    def Int.greatestOfBdd {P : ℤ → Prop} [DecidablePred P] (b : ℤ) (Hb : ∀ (z : ℤ), P z → z ≤ b) (Hinh : ∃ (z : ℤ), P z) :
    { ub : ℤ // P ub ∧ ∀ (z : ℤ), P z → z ≤ ub }

    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.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      theorem Int.exists_greatest_of_bdd {P : ℤ → Prop} [DecidablePred P] (Hbdd : ∃ (b : ℤ), ∀ (z : ℤ), P z → z ≤ b) (Hinh : ∃ (z : ℤ), P z) :
      ∃ (ub : ℤ), P ub ∧ ∀ (z : ℤ), P z → z ≤ ub

      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 [DecidablePred P]. See Int.greatestOfBdd for a constructive counterpart.

      theorem Int.coe_greatestOfBdd_eq {P : ℤ → Prop} [DecidablePred P] {b : ℤ} {b' : ℤ} (Hb : ∀ (z : ℤ), P z → z ≤ b) (Hb' : ∀ (z : ℤ), P z → z ≤ b') (Hinh : ∃ (z : ℤ), P z) :
      ↑(Int.greatestOfBdd b Hb Hinh) = ↑(Int.greatestOfBdd b' Hb' Hinh)