Zulip Chat Archive
Stream: new members
Topic: Trouble with example in MIL Section 2.4
JK (Aug 19 2025 at 01:00):
I'm mystified why the following proof does not work, since the first calc block seems fine and the second one is symmetric. What am I doing wrong?
import Mathlib
variable (a b c d : ℝ)
theorem aux : min a b + c ≤ min (a + c) (b + c) := by
apply le_min
calc
min a b + c ≤ a + c := by rel [min_le_left a b]
calc
min a b + c ≤ b + c := by rel [min_le_right a b]
Aaron Liu (Aug 19 2025 at 01:08):
it's because one-line calc block are not supported since they cause parse errors
James Sundstrom (Aug 19 2025 at 01:10):
Also, one-line calc blocks are not necessary because you can do them without calc:
import Mathlib
variable (a b c d : ℝ)
theorem aux : min a b + c ≤ min (a + c) (b + c) := by
apply le_min
· rel [min_le_left a b]
· rel [min_le_right a b]
JK (Aug 19 2025 at 02:04):
Hmm...then why does the first one-line calc block work?
Ruben Van de Velde (Aug 19 2025 at 07:41):
It doesn't. If you replace the second calc by sorry, you still get an error
Kenny Lau (Aug 19 2025 at 08:18):
one line calc block is basically equivalent to change
Aaron Liu (Aug 19 2025 at 11:34):
it's trying to interpret the second calc statement as a calc line
JK (Aug 19 2025 at 21:31):
OK, I found it strange since the one-line calc block in
import Mathlib
variable (a b c d : ℝ)
theorem aux' : min a b + c ≤ a + c := by
calc
min a b + c ≤ a + c := by rel [min_le_left a b]
does work.
Aaron Liu (Aug 19 2025 at 21:47):
that's because it's the last tactic in the sequence
Last updated: Dec 20 2025 at 21:32 UTC