Zulip Chat Archive
Stream: new members
Topic: linarith with complex numbers?
Sabbir Rahman (Mar 12 2025 at 11:08):
linarith works pretty well with reals, but doesn't work with complex numbers. What is the reason for this and then what to do for simple cases like below?
import Mathlib
example (x : ℝ) (h: x - 1 = 0) : x = 1 := by linarith
example (x : ℂ) (h: x - 1 = 0) : x = 1 := by linarith -- didn't succeed
Yakov Pechersky (Mar 12 2025 at 11:34):
The complexes don't have a linear order instance, and linarith
is for _lin_ear orders. The complexes can have a linear order, but not one that is compatible with the field structure.
Vlad Tsyrklevich (Mar 12 2025 at 11:43):
have := Complex.ext_iff.mp h
simp at this
apply Complex.ext <;> simp <;> linarith
or
apply (@sub_left_inj _ _ 1).mp
simp [h]
Riccardo Brasca (Mar 12 2025 at 11:56):
It may be an overkill, but I guess polyrith
works.
Sabbir Rahman (Mar 12 2025 at 12:34):
Yakov Pechersky said:
The complexes don't have a linear order instance, and
linarith
is for _lin_ear orders. The complexes can have a linear order, but not one that is compatible with the field structure.
ah makes sense
Sabbir Rahman (Mar 12 2025 at 12:35):
I generally prefer overkill methods over trying to remember theorem names. NO matter how much I try, I can't remember the theorem for my particular case
Vlad Tsyrklevich (Mar 12 2025 at 13:52):
You don't have to remember all of the names. I don't.
ext
ensionality theorems tell you that if the components of something are equal, then the whole object is equal. That's the first approach, I just reduce proving equality over C to proving 2 equalities in R. Findable by loogling: Complex, "ext"
Otherwise, how would you prove that x - 1 = 0
implies x = 1
? In school you would just write +1 on both sides of the equation and simplify. But _why_ can you do that? Because addition/subtraction is injective, so you can add/subtract quantities to both sides of an equation and it remains true. Hence you can search for an inj
ectivity theorem for sub
traction. Findable by loogling: "sub_", "inj"
Last updated: May 02 2025 at 03:31 UTC