Nat.segment_upper_bound
theoremverifiedformalizationimported Lean
For a strictly monotonic function f : ℕ → ℕ with f 0 = 0, k < f (segment f k + 1) for all k : ℕ.
Statement
set_option autoImplicit true in set_option relaxedAutoImplicit true in open Function Set in variable {f : ℕ → ℕ} in theorem Nat.segment_upper_bound (hm : StrictMono f) (h0 : f 0 = 0) (k : ℕ) : k < f (segment f k + 1)
- Formalizes
- CSLib, `Nat.segment_upper_bound`
- Lean proof
- By Ching-Tsun Chou, from github.com/leanprover/cslib at
3951377e5a3f(Copyright (c) 2025 Ching-Tsun Chou. All rights reserved, Apache-2.0). Compiled here against leanprover/lean4:v4.33.1, Mathlib v4.33.1; written for leanprover/lean4:v4.33.0.Nat.segment_upper_bound← Nat.segment_upper_bound (Cslib/Foundations/Data/Nat/Segment.lean:127): verbatim
- Verified
- 08 Oct 2026
- Axioms
Classical.choiceQuot.soundpropext- Built on 5
- Nat.strictMono_infiniteAny strictly monotonic function
f : ℕ → ℕhas an infinite range. - Nat.segmentThe
f-segment ofk, wheref : ℕ → ℕwill be assumed to be at least StrictMono. - Nat.nth_of_strictMonoFor a strictly monotonic function
f : ℕ → ℕ,f nis exactly the n-th element of the range off. - Nat.segment_plus_oneA slight restatement of the definition of
segmentwhich has proven useful. - Nat.segment_idemFor a strictly monotonic function
f : ℕ → ℕ, the segment off kisk.
- Nat.strictMono_infiniteAny strictly monotonic function
- Used by 1
- Nat.segment_galois_connectionFor a strictly monotonic function
f : ℕ → ℕwithf 0 = 0,fandsegment fform a Galois connection.
- Nat.segment_galois_connectionFor a strictly monotonic function
Lean source view module on GitHub
Choose a tactic — a marked line — to see the goals Lean had before and after it, as in Lean’s infoview. Step with ← → or j k.
set_option autoImplicit true inset_option relaxedAutoImplicit true inopen Function Set invariable {f : ℕ → ℕ} in/-- For a strictly monotonic function `f : ℕ → ℕ` with `f 0 = 0`, `k < f (segment f k + 1)` for all `k : ℕ`. -/theorem Nat.segment_upper_bound (hm : StrictMono f) (h0 : f 0 = 0) (k : ℕ) : k < f (segment f k + 1) := by classical rw [nth_of_strictMono hm (segment f k + 1), segment_plus_one h0 k] suffices _ : k + 1 ≤ nth (· ∈ range f) (count (· ∈ range f) (k + 1)) by omega apply le_nth_count exact strictMono_infinite hm