Zulip Chat Archive

Stream: new members

Topic: 4 proofs from The Mechanics


Michael Bucko (Nov 20 2024 at 19:14):

I wrote 4 more proofs from chapter 4 from The Mechanics.. How can I optimize them?

4 proofs

Bjørn Kjos-Hanssen (Nov 20 2024 at 20:34):

example : ∃ n : ℕ, ∀ m : ℕ, n ≤ m := ⟨0, zero_le⟩

Ilmārs Cīrulis (Nov 21 2024 at 09:18):

I don't know if this is much of optimization, but here's the first example.
(All the by exact was removed.) And it seems that I can replace linarith with omega, too.

example {n : ℤ} (hn : ∀ m, 1 ≤ m → m ≤ 5 → m ∣ n) : 15 ∣ n := by
  have h3 : 3 ∣ n := hn 3 (by linarith) (by linarith)
  have h5 : 5 ∣ n := hn 5 (by linarith) (by linarith)
  exact lcm_dvd h3 h5

Ilmārs Cīrulis (Nov 21 2024 at 09:21):

I don't believe that anything else can be optimized, except post by Bjørn (and maybe mine).

Michael Bucko (Nov 21 2024 at 09:27):

Both your example and Bjørn's are great improvements from my perspective. :thank_you:

Is there any way to write such a chain (by linarith) (by linarith) differently? Perhaps using ⟨⟩?

Also, I'll learn more about omega, too.

Ruben Van de Velde (Nov 21 2024 at 09:30):

You could write by apply hn 3 <;> linarith


Last updated: Feb 28 2026 at 14:05 UTC