Zulip Chat Archive

Stream: new members

Topic: beginner question : proving no smallest rational number


rzeta0 (Dec 13 2024 at 23:36):

After learning about proof by contradiction in MoP, I set myself the following challenge:

Show there is no smallest positive rational number.

I formulated it as disproving the following:

rQ+,sQ+:rs.\exists r \in \mathbb{Q}^+, \forall s \in \mathbb{Q}^+: r \le s.

that is, proving

¬rQ+,sQ+:rs\neg \exists r \in \mathbb{Q}^+, \forall s \in \mathbb{Q}^+ : r \le s

which is equivalent to

rQ+,¬sQ+:rs\forall r \in \mathbb{Q}^+, \neg \forall s \in \mathbb{Q}^+ : r \le s

which in turn is equivalent to

rQ+,sQ+:¬rs\forall r \in \mathbb{Q}^+, \exists s \in \mathbb{Q}^+ : \neg r \le s

(I think the above is correct)


I'm struggling with converting this into Lean. My code thus far has 2 problems I'd like advice on:

import Mathlib.Tactic

example :  r : ,  s : , ¬ r  s := by -- < -- problem 1
  intro r
  use r/2
  intro g1
  have g2: r  r/2 := by ring -- < -- problem 2
  sorry

Code Problems:

  • How do I change the set ℚ to ℚ+? I tried asserting hypotheses as follows, but this fails: example (h1: r > 0) (h2: s > 0): ∀ r : ℚ, ∃ s : ℚ, ¬ r ≤ s := by

  • How do I create an intermediate result that r ≥ r/2? The ring and linarith tactics don't do it. It feels like a trivial result that should require lots of code to prove.

Kevin Buzzard (Dec 13 2024 at 23:39):

How do I change the set ℚ to ℚ+

\forall r : \Q, r > 0 -> \exists s : \Q, s > 0 \and \not r \leq s

How do I create an intermediate result that r ≥ r/2

have foo : r \geq r / 2

Matt Diamond (Dec 13 2024 at 23:58):

take a look at docs#half_le_self and docs#half_lt_self

Matt Diamond (Dec 14 2024 at 00:04):

here's one approach:

import Mathlib.Tactic

example :  (r : ) (hr : r > 0),  (s : ) (hs : s > 0), ¬ r  s := by
  intro r hr
  use r / 2
  have gt_zero : r / 2 > 0 := by
    sorry
  use gt_zero
  intro g1
  have g2 : r / 2 < r := half_lt_self hr
  sorry

Matt Diamond (Dec 14 2024 at 00:08):

(Kevin's suggestion to phrase it as ∀ r : ℚ, r > 0 → ∃ (s : ℚ), s > 0 ∧ ¬ r ≤ s works just as well if you prefer that)

rzeta0 (Dec 14 2024 at 00:17):

Thanks Matt = the half_le_self is helpful.

Thanks also Kevin for the help on Q+.

I'm not familiar with the right arrow -> so will see if I can make it work without.

Matt Diamond (Dec 14 2024 at 01:16):

I'm not familiar with the right arrow ->

You're more familiar with it than you think. Every time you've posted on Zulip about "P ⟹ Q", you've been talking about ->!

Johan Commelin (Dec 14 2024 at 10:41):

Btw, another option is to use {x : ℚ // x > 0}. This is a "subtype", which you may or may not want to engage with yet.


Last updated: May 02 2025 at 03:31 UTC