Zulip Chat Archive

Stream: new members

Topic: Set of Nats has minimum


Kent Van Vels (Nov 30 2024 at 02:29):

I want to prove that a nonempty set of nats has a (unique) minimum.

Do I have to do a compactness/topological proof? Is there a better/easier way? I am planning on using this to show that infinite descent of nats is impossible so I would like to avoid using an infinite descent argument. Also I would like any recommendations for a better theorem name.

theorem min_exists_of_nonempty
(S: Set ) : S.Nonempty   (n_min : S), ( (k:S), n_min  k) := by
  intro h0
  sorry

I couldn't find the correct theorem in mathlib. Is there something similar there?

Kent Van Vels (Nov 30 2024 at 03:21):

This is what I did, after using the strong induction_on, I more or less followed my nose.

theorem min_exists_of_nonempty (S: Set ) :
S.Nonempty   (n_min : ), n_min  S  ( (k:), k  S  n_min  k) := by
  rintro x,h0
  by_contra h1
  push_neg at h1
  induction' x using Nat.strong_induction_on with k hk
  rcases h1 k h0 with α,h2,h3
  exact hk α h3 h2

Daniel Weber (Nov 30 2024 at 03:25):

You can use sInf for the infimum of the set, and then use docs#csInf_mem and docs#csInf_le'

Kyle Miller (Nov 30 2024 at 03:27):

theorem min_exists_of_nonempty (S : Set ) (h : S.Nonempty) :
     (n_min : S), ( (k:S), n_min  k) := by
  use! sInf S
  · exact Nat.sInf_mem h
  · simp only [Subtype.forall, Subtype.mk_le_mk]
    intro _ hs
    exact Nat.sInf_le hs

Kyle Miller (Nov 30 2024 at 03:27):

(That's meant to be pointers into the library)

Kent Van Vels (Nov 30 2024 at 03:27):

@Kyle Miller and @Daniel Weber, thank you both, I will look into this. I appreciate it.

Kyle Miller (Nov 30 2024 at 03:29):

docs#Nat.find is another more algorithmic way to express the infimum.

theorem min_exists_of_nonempty (S : Set ) (h : S.Nonempty) :
     (n_min : S), ( (k:S), n_min  k) := by
  classical
  use! Nat.find h
  · apply Nat.find_spec
  · simp only [Subtype.forall, Subtype.mk_le_mk]
    intro _ hs
    exact Nat.find_min' _ hs

Last updated: May 02 2025 at 03:31 UTC