FormalConjecturesForMathlib/Data/Int/IntermediateValue.lean

GitHub source file

Explanation legend Lean4 Domain Explanation Language (L4DEL)

L4DEL explanations are a separate layer. They do not change the Lean source. Intuition is explanatory prose; numbered items are a reading path; sources link the wording back to evidence.

L4DEL
Lean4 Domain Explanation Language

Credit: The upstream authors and contributors retain credit for the project and mathematics. lean4-explainer only renders their pinned source and adds the separately disclosed explanation layer.

Project sources: Pinned project documentation, Formal Conjectures paper, arXiv v1

1 declarations, 0 contain sorry, 0 declared as axioms

A discrete intermediate value theorem

An integer-valued sequence whose consecutive terms differ by at most 1 attains every integer value lying between two of its terms. This is the discrete analogue of the intermediate value theorem for a unit-step walk on ℤ.

Imports (3)
Imported by 1 file
  1. theorem Int.exists_eq_of_natAbs_sub_le_one Discrete intermediate value theorem line 35 source

    Source documentation

    Discrete intermediate value theorem. If an integer-valued sequence f : ℕ → ℤ has consecutive terms differing by at most 1, then it attains every value between f a and f b: for a ≤ b and f a ≤ t ≤ f b there is some index c ∈ [a, b] with f c = t.

    standard axioms: Quot.sound, propext what this means

    Statement uses: Nat, Int, LE.le, Int.natAbs, HSub.hSub, HAdd.hAdd, OfNat.ofNat, Exists, And, Eq

    Proof uses: Nat.le_induction, Exists.intro, And.intro, le_refl, le_antisymm, dite, Decidable.byContradiction, Not

    25 instances, coercions and auxiliary constants left out.

    Tactic trace: 12 steps

    Open to load the checked before-and-after goal states.

    theorem Int.exists_eq_of_natAbs_sub_le_one (f : ℕ → ℤ)
        (hf : ∀ n, (f (n + 1) - f n).natAbs ≤ 1) {a b : ℕ} (hab : a ≤ b) {t : ℤ}
        (hta : f a ≤ t) (htb : t ≤ f b) : ∃ c, a ≤ c ∧ c ≤ b ∧ f c = t := by
    …

    Mentions: c