Nat.nth_of_strictMono
theoremverifiedformalizationimported Lean
For a strictly monotonic function f : ℕ → ℕ, f n is exactly the n-th element of the range of f.
Statement
set_option autoImplicit true in set_option relaxedAutoImplicit true in open Function Set in variable {f : ℕ → ℕ} in theorem Nat.nth_of_strictMono (hm : StrictMono f) (n : ℕ) : f n = nth (· ∈ range f) n
- Formalizes
- CSLib, `Nat.nth_of_strictMono`
- 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.nth_of_strictMono← Nat.nth_of_strictMono (Cslib/Foundations/Data/Nat/Segment.lean:60): verbatim
- Verified
- 08 Oct 2026
- Axioms
Classical.choiceQuot.soundpropext- Built on 1
- Nat.strictMono_infiniteAny strictly monotonic function
f : ℕ → ℕhas an infinite range.
- Nat.strictMono_infiniteAny strictly monotonic function
- Used by 5
- Nat.segment_upper_boundFor a strictly monotonic function
f : ℕ → ℕwithf 0 = 0,k < f (segment f k + 1)for allk : ℕ. - Nat.segment_lower_boundFor a strictly monotonic function
f : ℕ → ℕwithf 0 = 0,f (segment f k) ≤ kfor allk : ℕ. - Nat.segment_range_valFor a strictly monotonic function
f : ℕ → ℕ, allksatisfyingf m ≤ k < f (m + 1)hassegment f k = m. - Nat.strictMono_range_gapFor a strictly monotonic function
f : ℕ → ℕ, no number (strictly) betweenf mandf (m + 1)is in the range off. - Nat.segment_idemFor a strictly monotonic function
f : ℕ → ℕ, the segment off kisk.
- Nat.segment_upper_boundFor 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 : ℕ → ℕ`, `f n` is exactly the n-th element of the range of `f`. -/theorem Nat.nth_of_strictMono (hm : StrictMono f) (n : ℕ) : f n = nth (· ∈ range f) n := by rw [← nth_comp_of_strictMono hm] · simp · simp · #adaptation_note /-- A grind regression found moving to nightly-2026-03-31 (changes from lean#13166) -/ intros have : (range f).Infinite := strictMono_infinite hm contradiction