Zulip Chat Archive

Stream: new members

Topic: where to ask for code error?


Bo Qin (Oct 28 2024 at 07:46):

where do I ask question why my code shows error even if it looks fine? Maybe I'm using the wrong tactics? I'm new to using lean

Bo Qin (Oct 28 2024 at 07:49):

lean_learning_error.png

Bo Qin (Oct 28 2024 at 07:50):

Can you do

(x + 3) / (x + 3)

as by ring?

Bo Qin (Oct 28 2024 at 07:51):

is it because of possibility of being 0?

Bo Qin (Oct 28 2024 at 07:52):

that's probably it

Ruben Van de Velde (Oct 28 2024 at 08:02):

ring isn't expected to handle division; field_simp might help

Damiano Testa (Oct 28 2024 at 08:03):

Also, you are right about 0 being special-cased: a / a can be equal to 0, when a = 0.

Daniel Weber (Oct 28 2024 at 08:04):

polyrith would probably also work here

Daniel Weber (Oct 28 2024 at 08:13):

import Mathlib.Tactic

example {x y : } (h1 : x + 3 = 5) (h2 : 2 * x - y * x = 0) : y = 2 := by
  polyrith says linear_combination (-(1 / 2 * y) + 1) * h1 + -1 * h2 / 2

Last updated: May 02 2025 at 03:31 UTC