Zulip Chat Archive
Stream: new members
Topic: using mul_right_cancel
JK (Aug 04 2025 at 23:37):
Can someone help with the syntax for using mul_right_cancel? Here is what I would like to prove:
example (s t : ℚ) (h1 : s ≠ 0) (h2 : t*s = 3*s) : t = 3 := by
It seems obvious to try to use
mul_right_cancel₀
here, but I can't seem to get the syntax right
Kenny Lau (Aug 04 2025 at 23:42):
import Mathlib
example (s t : ℚ) (h1 : s ≠ 0) (h2 : t*s = 3*s) : t = 3 := by
rw [mul_left_inj'] at h2
· exact h2
· exact h1
example (s t : ℚ) (h1 : s ≠ 0) (h2 : t*s = 3*s) : t = 3 := by
exact mul_right_cancel₀ h1 h2
example (s t : ℚ) (h1 : s ≠ 0) (h2 : t*s = 3*s) : t = 3 :=
mul_right_cancel₀ h1 h2
example (s t : ℚ) (h1 : s ≠ 0) (h2 : t*s = 3*s) : t = 3 := by
apply mul_right_cancel₀ at h2
· exact h2
· exact h1
Aaron Liu (Aug 04 2025 at 23:42):
apply?
Kenny Lau (Aug 04 2025 at 23:43):
import Mathlib
example (s t : ℚ) (h1 : s ≠ 0) (h2 : t*s = 3*s) : t = 3 := by
apply mul_right_cancel₀
· exact h1
· exact h2
Kim Morrison (Aug 06 2025 at 09:15):
import Mathlib
example (s t : ℚ) (h1 : s ≠ 0) (h2 : t*s = 3*s) : t = 3 := by
try?
suhr (Aug 06 2025 at 11:16):
import Mathlib
example (s t : ℚ) (h1 : s ≠ 0) (h2 : t*s = 3*s) : t = 3 :=
mul_right_cancel₀ h1 h2
Last updated: Dec 20 2025 at 21:32 UTC