Zulip Chat Archive

Stream: new members

Topic: Dealing with Coercing Real to Complex


Gregory Wickham (Sep 27 2025 at 21:07):

In the course of a much larger proof, I want to show

import Mathlib.Analysis.CStarAlgebra.PositiveLinearMap
import Mathlib.Data.Complex.Basic

noncomputable def c :  := 1 + (2:) ^ ((1:)/(2:))
example : (c : ) = 1 + ((2:) ^ ((1:)/(2:))) := by sorry

It seems like it should be trivial, but I just can't figure out how to do it. I needed to declare the original constant to be real to prove certain properties of it, but alternatively, if there is a way to declare it complex initially and then prove that it is its own conjugate and has 0 imaginary part, that would probably work too. How can I fix this issue?

Ruben Van de Velde (Sep 27 2025 at 21:09):

by norm_cast solves it

Gregory Wickham (Sep 27 2025 at 21:11):

You're right. In this example, it works, but in the original context, it doesn't. It seems I haven't recreated the issue correctly. I will try to construct a better minimal example


Last updated: Dec 20 2025 at 21:32 UTC