Zulip Chat Archive

Stream: maths

Topic: generalizing lemmas about monotone nat -> nat functions


Jakub Kądziołka (Mar 07 2022 at 17:11):

In #12443 I proved the following, very specific lemma:

lemma fib_between (n : ℕ) : ∃ k : ℕ, fib k ≤ n ∧ n < fib k.succ :=

This is obviously be generalized, but I'm not exactly sure how much. So far I've split it into two lemmas: an unbounded monotone function satisfies this property, and a strictly monotone function is unbounded. However so far I'm only stating it for ℕ → ℕ functions, and I'm having trouble stating exactly what kind of an ordered set is necessary. At least for ℤ one could state something similar, but the f 0 ≤ n assumption then becomes problematic...

lemma ex_le_lt_of_mono_of_unbounded
  (f : ℕ → ℕ) (Hmono : monotone f)
  (Hunbounded : set.unbounded (≤) (set.range f))
  (n : ℕ) (Hlow: f 0 ≤ n):
  ∃ k : ℕ, f k ≤ n ∧ n < f k.succ :=
begin
  by_contra' next : ∀ k : ℕ, f k ≤ n → f k.succ ≤ n,
  have all_bounded : ∀ k : ℕ, f k ≤ n,
  { intro k, induction k with k IH,
    exact Hlow, exact next k IH },
  have bounded : set.bounded (≤) (set.range f),
  { use n, assume (v : ℕ) (Hv : v ∈ set.range f),
    obtain ⟨k, Hk⟩ : ∃ k, f k = v := by simp at Hv; exact Hv,
    rw ← Hk, apply all_bounded },
  have not_unbounded : ¬ set.unbounded (≤) (set.range f) := by rwa set.not_unbounded_iff,
  contradiction
end

lemma arg_le_strict_mono {f : ℕ → ℕ} {Hmono : strict_mono f} {n : ℕ} : n ≤ f n :=
begin
  induction n with n IH,
  { apply zero_le },
  { suffices : n < f n.succ, tauto,
    calc n ≤ f n : IH
    ...    < f n.succ : Hmono _,
    rw lt_succ_iff }
end

lemma unbounded_of_strict_mono
  (f : ℕ → ℕ) (Hmono : strict_mono f) : set.unbounded (≤) (set.range f) :=
begin
  by_contra',
  have bounded : set.bounded (≤) (set.range f) := by rwa set.not_unbounded_iff at this,
  obtain ⟨m, Hm⟩ : ∃ m, ∀ v ∈ set.range f, v ≤ m := bounded,
  have : m + 1 ≤ m :=
    calc m.succ ≤ f m.succ : by apply arg_le_strict_mono; assumption
    ...         ≤ m        : Hm (f m.succ) (set.mem_range_self _),
  linarith
end

Yaël Dillies (Mar 07 2022 at 17:20):

Your arg_le_strict_mono is docs#strict_mono.id_le. For the strict_mono -> unbounded part, you need no_max_orderon the domain and something like eventually docs#well_founded on the codomain. For the unbounded -> exists_between part, you need docs#linear_order + docs#succ_order on the domain.

Jakub Kądziołka (Mar 07 2022 at 17:56):

are you sure you need well_founded? I'm pretty sure \Z isn't and yet it works on \Z...

Yaël Dillies (Mar 07 2022 at 18:20):

"eventually well-founded"

Yaël Dillies (Mar 07 2022 at 18:21):

It's like ∀ a, (Ici a).is_wf.

Jakub Kądziołka (Mar 07 2022 at 18:29):

Yaël Dillies said:

For the unbounded -> exists_between part, you need docs#linear_order + docs#succ_order on the domain.

Well that's not enough, consider f(n) = 1 - 1/n

Yaël Dillies (Mar 07 2022 at 18:54):

What's the codomain?

Jakub Kądziołka (Mar 07 2022 at 20:55):

nat -> rat

Yaël Dillies (Mar 07 2022 at 23:47):

Well, range f is bounded then.

Jakub Kądziołka (Mar 07 2022 at 23:49):

looks like I've misread something :P

Jakub Kądziołka (Mar 08 2022 at 11:56):

just realized that there's set.bounded and bdd_above. Is one of these preferred?

Yaël Dillies (Mar 08 2022 at 12:04):

bdd_above


Last updated: Feb 28 2026 at 14:05 UTC