Zulip Chat Archive

Stream: Is there code for X?

Topic: Algebraic numbers


Alfredo Moreira-Rosa (Sep 20 2025 at 09:59):

Have algebraic numbers ℚ̅ been already defined in Mathlib ? With Coe ℚ̅ ℝ ? if so is there any pointers to the definition ? can't seem to find it.

Riccardo Brasca (Sep 20 2025 at 10:04):

Algebraic numbers are simply integralClosure ℚ ℂ (you may want to use IsIntegralClosure depending on what you need to do). What do you mean by a coercion to ? There are algebraic numbers that are not real.

Riccardo Brasca (Sep 20 2025 at 10:04):

Or you may use docs#AlgebraicClosure

Riccardo Brasca (Sep 20 2025 at 10:05):

again, it depends on what you are doing

Alfredo Moreira-Rosa (Sep 20 2025 at 10:05):

yes, i'm particularly looking for algebraic real numbers, sorry

Riccardo Brasca (Sep 20 2025 at 10:07):

integralClosure ℚ ℝ is a subalgebra of , so it is probably what you need

Riccardo Brasca (Sep 20 2025 at 10:09):

but a more idiomatic way is probably something like K with isIntegralClosure K ℚ ℝ

Riccardo Brasca (Sep 20 2025 at 10:10):

so you work with "any" ring that is abstractly the field of real algebraic numbers, not the actual subset of the reals

Alfredo Moreira-Rosa (Sep 20 2025 at 11:31):

Thank you very much !


Last updated: Dec 20 2025 at 21:32 UTC